@storecraft/dashboard 1.0.11 β 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/lib/index.cjs +11 -13
- package/dist/lib/index.js +37 -22
- package/dist/lib/index.umd.cjs +11 -13
- package/dist/lib/src/comps/common-ui.d.ts +1 -1
- package/dist/lib/src/comps/settings-change-password.d.ts +1 -1
- package/dist/website/assets/{index-Mf1yKRWi.js β index-CdT-oZP-.js} +11 -13
- package/dist/website/index.html +1 -1
- package/package.json +4 -5
- package/dist/a.html +0 -31
package/dist/lib/index.umd.cjs
CHANGED
@@ -111,7 +111,7 @@ ${e}</tr>
|
|
111
111
|
`}tablecell(e,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
|
112
112
|
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,n,r){if(e=tb(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let i='<a href="'+e+'"';return n&&(i+=' title="'+n+'"'),i+=">"+r+"</a>",i}image(e,n,r){if(e=tb(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let i=`<img src="${e}" alt="${r}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(e){return e}}class Q5{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,r){return""+r}image(e,n,r){return""+r}br(){return""}}class Z5{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,n){let r=e,i=0;if(this.seen.hasOwnProperty(r)){i=this.seen[e];do i++,r=e+"-"+i;while(this.seen.hasOwnProperty(r))}return n||(this.seen[e]=i,this.seen[r]=0),r}slug(e,n={}){const r=this.serialize(e);return this.getNextSafeSlug(r,n.dryrun)}}let Xo=class Vx{constructor(e){this.options=e||Wa,this.options.renderer=this.options.renderer||new up,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Q5,this.slugger=new Z5}static parse(e,n){return new Vx(n).parse(e)}static parseInline(e,n){return new Vx(n).parseInline(e)}parse(e,n=!0){let r="",i,s,a,o,l,c,u,d,h,p,m,g,y,v,x,b,w,C,S;const k=e.length;for(i=0;i<k;i++){if(p=e[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(S=this.options.extensions.renderers[p.type].call({parser:this},p),S!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type))){r+=S||"";continue}switch(p.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{r+=this.renderer.heading(this.parseInline(p.tokens),p.depth,eb(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue}case"code":{r+=this.renderer.code(p.text,p.lang,p.escaped);continue}case"table":{for(d="",u="",o=p.header.length,s=0;s<o;s++)u+=this.renderer.tablecell(this.parseInline(p.header[s].tokens),{header:!0,align:p.align[s]});for(d+=this.renderer.tablerow(u),h="",o=p.rows.length,s=0;s<o;s++){for(c=p.rows[s],u="",l=c.length,a=0;a<l;a++)u+=this.renderer.tablecell(this.parseInline(c[a].tokens),{header:!1,align:p.align[a]});h+=this.renderer.tablerow(u)}r+=this.renderer.table(d,h);continue}case"blockquote":{h=this.parse(p.tokens),r+=this.renderer.blockquote(h);continue}case"list":{for(m=p.ordered,g=p.start,y=p.loose,o=p.items.length,h="",s=0;s<o;s++)x=p.items[s],b=x.checked,w=x.task,v="",x.task&&(C=this.renderer.checkbox(b),y?x.tokens.length>0&&x.tokens[0].type==="paragraph"?(x.tokens[0].text=C+" "+x.tokens[0].text,x.tokens[0].tokens&&x.tokens[0].tokens.length>0&&x.tokens[0].tokens[0].type==="text"&&(x.tokens[0].tokens[0].text=C+" "+x.tokens[0].tokens[0].text)):x.tokens.unshift({type:"text",text:C}):v+=C),v+=this.parse(x.tokens,y),h+=this.renderer.listitem(v,w,b);r+=this.renderer.list(h,m,g);continue}case"html":{r+=this.renderer.html(p.text,p.block);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(h=p.tokens?this.parseInline(p.tokens):p.text;i+1<k&&e[i+1].type==="text";)p=e[++i],h+=`
|
113
113
|
`+(p.tokens?this.parseInline(p.tokens):p.text);r+=n?this.renderer.paragraph(h):h;continue}default:{const N='Token with "'+p.type+'" type was not found.';if(this.options.silent){console.error(N);return}else throw new Error(N)}}}return r}parseInline(e,n){n=n||this.renderer;let r="",i,s,a;const o=e.length;for(i=0;i<o;i++){if(s=e[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]&&(a=this.options.extensions.renderers[s.type].call({parser:this},s),a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type))){r+=a||"";continue}switch(s.type){case"escape":{r+=n.text(s.text);break}case"html":{r+=n.html(s.text);break}case"link":{r+=n.link(s.href,s.title,this.parseInline(s.tokens,n));break}case"image":{r+=n.image(s.href,s.title,s.text);break}case"strong":{r+=n.strong(this.parseInline(s.tokens,n));break}case"em":{r+=n.em(this.parseInline(s.tokens,n));break}case"codespan":{r+=n.codespan(s.text);break}case"br":{r+=n.br();break}case"del":{r+=n.del(this.parseInline(s.tokens,n));break}case"text":{r+=n.text(s.text);break}default:{const l='Token with "'+s.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return r}};class C1{constructor(e){this.options=e||Wa}preprocess(e){return e}postprocess(e){return e}}ee(C1,"passThroughHooks",new Set(["preprocess","postprocess"]));class bR{constructor(...e){_i(this,zl);ee(this,"defaults",q5());ee(this,"options",this.setOptions);ee(this,"parse",vg(this,zl,Yx).call(this,is.lex,Xo.parse));ee(this,"parseInline",vg(this,zl,Yx).call(this,is.lexInline,Xo.parseInline));ee(this,"Parser",Xo);ee(this,"parser",Xo.parse);ee(this,"Renderer",up);ee(this,"TextRenderer",Q5);ee(this,"Lexer",is);ee(this,"lexer",is.lex);ee(this,"Tokenizer",cp);ee(this,"Slugger",Z5);ee(this,"Hooks",C1);this.use(...e)}walkTokens(e,n){let r=[];for(const i of e)switch(r=r.concat(n.call(this,i)),i.type){case"table":{for(const s of i.header)r=r.concat(this.walkTokens(s.tokens,n));for(const s of i.rows)for(const a of s)r=r.concat(this.walkTokens(a.tokens,n));break}case"list":{r=r.concat(this.walkTokens(i.items,n));break}default:this.defaults.extensions&&this.defaults.extensions.childTokens&&this.defaults.extensions.childTokens[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{r=r.concat(this.walkTokens(i[s],n))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,n)))}return r}use(...e){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){const a=n.renderers[s.name];a?n.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:n.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[s.level]?n[s.level].unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),i.extensions=n),r.renderer){const s=this.defaults.renderer||new up(this.defaults);for(const a in r.renderer){const o=s[a];s[a]=(...l)=>{let c=r.renderer[a].apply(s,l);return c===!1&&(c=o.apply(s,l)),c}}i.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new cp(this.defaults);for(const a in r.tokenizer){const o=s[a];s[a]=(...l)=>{let c=r.tokenizer[a].apply(s,l);return c===!1&&(c=o.apply(s,l)),c}}i.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new C1;for(const a in r.hooks){const o=s[a];C1.passThroughHooks.has(a)?s[a]=l=>{if(this.defaults.async)return Promise.resolve(r.hooks[a].call(s,l)).then(u=>o.call(s,u));const c=r.hooks[a].call(s,l);return o.call(s,c)}:s[a]=(...l)=>{let c=r.hooks[a].apply(s,l);return c===!1&&(c=o.apply(s,l)),c}}i.hooks=s}if(r.walkTokens){const s=this.defaults.walkTokens;i.walkTokens=function(a){let o=[];return o.push(r.walkTokens.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}}zl=new WeakSet,Yx=function(e,n){return(r,i,s)=>{typeof i=="function"&&(s=i,i=null);const a={...i};i={...this.defaults,...a};const o=vg(this,zl,zO).call(this,i.silent,i.async,s);if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(vR(i,s),i.hooks&&(i.hooks.options=i),s){const l=i.highlight;let c;try{i.hooks&&(r=i.hooks.preprocess(r)),c=e(r,i)}catch(h){return o(h)}const u=h=>{let p;if(!h)try{i.walkTokens&&this.walkTokens(c,i.walkTokens),p=n(c,i),i.hooks&&(p=i.hooks.postprocess(p))}catch(m){h=m}return i.highlight=l,h?o(h):s(null,p)};if(!l||l.length<3||(delete i.highlight,!c.length))return u();let d=0;this.walkTokens(c,h=>{h.type==="code"&&(d++,setTimeout(()=>{l(h.text,h.lang,(p,m)=>{if(p)return u(p);m!=null&&m!==h.text&&(h.text=m,h.escaped=!0),d--,d===0&&u()})},0))}),d===0&&u();return}if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(l=>e(l,i)).then(l=>i.walkTokens?Promise.all(this.walkTokens(l,i.walkTokens)).then(()=>l):l).then(l=>n(l,i)).then(l=>i.hooks?i.hooks.postprocess(l):l).catch(o);try{i.hooks&&(r=i.hooks.preprocess(r));const l=e(r,i);i.walkTokens&&this.walkTokens(l,i.walkTokens);let c=n(l,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(l){return o(l)}}},zO=function(e,n,r){return i=>{if(i.message+=`
|
114
|
-
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+jn(i.message+"",!0)+"</pre>";if(n)return Promise.resolve(s);if(r){r(null,s);return}return s}if(n)return Promise.reject(i);if(r){r(i);return}throw i}};const Jo=new bR(Wa);function dt(t,e,n){return Jo.parse(t,e,n)}dt.options=dt.setOptions=function(t){return Jo.setOptions(t),dt.defaults=Jo.defaults,Q_(dt.defaults),dt},dt.getDefaults=q5,dt.defaults=Wa,dt.use=function(...t){return Jo.use(...t),dt.defaults=Jo.defaults,Q_(dt.defaults),dt},dt.walkTokens=function(t,e){return Jo.walkTokens(t,e)},dt.parseInline=Jo.parseInline,dt.Parser=Xo,dt.parser=Xo.parse,dt.Renderer=up,dt.TextRenderer=Q5,dt.Lexer=is,dt.lexer=is.lex,dt.Tokenizer=cp,dt.Slugger=Z5,dt.Hooks=C1,dt.parse=dt,dt.options,dt.setOptions,dt.use,dt.walkTokens,dt.parseInline,Xo.parse,is.lex;const Xt=({value:t,...e})=>f.jsx("div",{...e,children:f.jsx("p",{className:"--mdx md-view",dangerouslySetInnerHTML:{__html:dt.parse(t??"",{mangle:!1,headerIds:!1,sanitize:!1})}})}),wR="π‘ changes made, don't forget to save",ss=_.forwardRef(({time:t,changes_made:e=!1,rightText:n="created at: ",...r},i)=>{const[s,a]=_.useState(e),o=t?n+new Date(t).toLocaleString():"*";return _.useEffect(()=>rs.add_sub(l=>{switch(l){case W_:a(!0);return;case G_:return;default:return}}),[rs]),_.useImperativeHandle(i,()=>({get:()=>s,set:(l=!1)=>a(l)}),[s]),f.jsx("div",{...r,children:f.jsxs("div",{className:`relative w-full flex flex-row
|
114
|
+
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+jn(i.message+"",!0)+"</pre>";if(n)return Promise.resolve(s);if(r){r(null,s);return}return s}if(n)return Promise.reject(i);if(r){r(i);return}throw i}};const Jo=new bR(Wa);function dt(t,e,n){return Jo.parse(t,e,n)}dt.options=dt.setOptions=function(t){return Jo.setOptions(t),dt.defaults=Jo.defaults,Q_(dt.defaults),dt},dt.getDefaults=q5,dt.defaults=Wa,dt.use=function(...t){return Jo.use(...t),dt.defaults=Jo.defaults,Q_(dt.defaults),dt},dt.walkTokens=function(t,e){return Jo.walkTokens(t,e)},dt.parseInline=Jo.parseInline,dt.Parser=Xo,dt.parser=Xo.parse,dt.Renderer=up,dt.TextRenderer=Q5,dt.Lexer=is,dt.lexer=is.lex,dt.Tokenizer=cp,dt.Slugger=Z5,dt.Hooks=C1,dt.parse=dt,dt.options,dt.setOptions,dt.use,dt.walkTokens,dt.parseInline,Xo.parse,is.lex;const Xt=({value:t,...e})=>f.jsx("div",{...e,children:f.jsx("p",{className:"--mdx md-view overflow-auto",dangerouslySetInnerHTML:{__html:dt.parse(t??"",{mangle:!1,headerIds:!1,sanitize:!1})}})}),wR="π‘ changes made, don't forget to save",ss=_.forwardRef(({time:t,changes_made:e=!1,rightText:n="created at: ",...r},i)=>{const[s,a]=_.useState(e),o=t?n+new Date(t).toLocaleString():"*";return _.useEffect(()=>rs.add_sub(l=>{switch(l){case W_:a(!0);return;case G_:return;default:return}}),[rs]),_.useImperativeHandle(i,()=>({get:()=>s,set:(l=!1)=>a(l)}),[s]),f.jsx("div",{...r,children:f.jsxs("div",{className:`relative w-full flex flex-row
|
115
115
|
justify-between items-center`,children:[s&&f.jsx("p",{children:wR,className:`absolute left-0 -top-full shelf-border-color
|
116
116
|
border rounded-md px-1 py-0
|
117
117
|
bg-lime-50/50 text-green-700
|
@@ -141,7 +141,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An err
|
|
141
141
|
text-gray-600 dark:text-gray-400
|
142
142
|
text-base font-semibold tracking-tight`,loading:c,onClick:d,...l})}):null},Gn=({from:t,to:e,rounded:n="rounded-lg",stroke:r="border-2",children:i,text:s="what",className:a="h-10",btnClassName:o="",...l})=>f.jsx(lt,{from:t,to:e,rounded:n,stroke:r,className:a,children:f.jsx("button",{className:`h-full w-full align-middle text-center px-3
|
143
143
|
rounded-md shelf-button-color-soft
|
144
|
-
whitespace-nowrap ${o}`,children:i??s,...l})}),TR=({from:t,to:e,rounded:n="rounded-lg",stroke:r,...i})=>f.jsx(lt,{from:t,to:e,rounded:n,stroke:r,className:"w-fit h-fit",children:f.jsx(kR,{...i})}),N1=({Icon:t,from:e="#973cff",to:n="rgb(236 72 153)",...r})=>{const i=btoa(`gradient_${e}_${n}`);return f.jsxs(f.Fragment,{children:[f.jsx("svg",{width:"0",height:"0",className:"absolute",children:f.jsxs("linearGradient",{id:i,x1:"100%",y1:"100%",x2:"0%",y2:"0%",children:[f.jsx("stop",{stopColor:e,offset:"0%"}),f.jsx("stop",{stopColor:n,offset:"100%"})]})}),f.jsx(t,{style:{fill:`url(#${i})`},...r})]})},ob="3.7.7",SR=ob,bc=typeof Buffer=="function",lb=typeof TextDecoder=="function"?new TextDecoder:void 0,cb=typeof TextEncoder=="function"?new TextEncoder:void 0,A1=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),dp=(t=>{let e={};return t.forEach((n,r)=>e[n]=r),e})(A1),NR=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,En=String.fromCharCode.bind(String),ub=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),db=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),fb=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),hb=t=>{let e,n,r,i,s="";const a=t.length%3;for(let o=0;o<t.length;){if((n=t.charCodeAt(o++))>255||(r=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=n<<16|r<<8|i,s+=A1[e>>18&63]+A1[e>>12&63]+A1[e>>6&63]+A1[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},X5=typeof btoa=="function"?t=>btoa(t):bc?t=>Buffer.from(t,"binary").toString("base64"):hb,J5=bc?t=>Buffer.from(t).toString("base64"):t=>{let n=[];for(let r=0,i=t.length;r<i;r+=4096)n.push(En.apply(null,t.subarray(r,r+4096)));return X5(n.join(""))},fp=(t,e=!1)=>e?db(J5(t)):J5(t),AR=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?En(192|e>>>6)+En(128|e&63):En(224|e>>>12&15)+En(128|e>>>6&63)+En(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return En(240|e>>>18&7)+En(128|e>>>12&63)+En(128|e>>>6&63)+En(128|e&63)}},DR=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,pb=t=>t.replace(DR,AR),mb=bc?t=>Buffer.from(t,"utf8").toString("base64"):cb?t=>J5(cb.encode(t)):t=>X5(pb(t)),wc=(t,e=!1)=>e?db(mb(t)):mb(t),gb=t=>wc(t,!0),OR=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,MR=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),n=e-65536;return En((n>>>10)+55296)+En((n&1023)+56320);case 3:return En((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return En((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},yb=t=>t.replace(OR,MR),vb=t=>{if(t=t.replace(/\s+/g,""),!NR.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,n="",r,i;for(let s=0;s<t.length;)e=dp[t.charAt(s++)]<<18|dp[t.charAt(s++)]<<12|(r=dp[t.charAt(s++)])<<6|(i=dp[t.charAt(s++)]),n+=r===64?En(e>>16&255):i===64?En(e>>16&255,e>>8&255):En(e>>16&255,e>>8&255,e&255);return n},e4=typeof atob=="function"?t=>atob(fb(t)):bc?t=>Buffer.from(t,"base64").toString("binary"):vb,xb=bc?t=>ub(Buffer.from(t,"base64")):t=>ub(e4(t).split("").map(e=>e.charCodeAt(0))),_b=t=>xb(bb(t)),IR=bc?t=>Buffer.from(t,"base64").toString("utf8"):lb?t=>lb.decode(xb(t)):t=>yb(e4(t)),bb=t=>fb(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),t4=t=>IR(bb(t)),LR=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},wb=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),Eb=function(){const t=(e,n)=>Object.defineProperty(String.prototype,e,wb(n));t("fromBase64",function(){return t4(this)}),t("toBase64",function(e){return wc(this,e)}),t("toBase64URI",function(){return wc(this,!0)}),t("toBase64URL",function(){return wc(this,!0)}),t("toUint8Array",function(){return _b(this)})},kb=function(){const t=(e,n)=>Object.defineProperty(Uint8Array.prototype,e,wb(n));t("toBase64",function(e){return fp(this,e)}),t("toBase64URI",function(){return fp(this,!0)}),t("toBase64URL",function(){return fp(this,!0)})},PR={version:ob,VERSION:SR,atob:e4,atobPolyfill:vb,btoa:X5,btoaPolyfill:hb,fromBase64:t4,toBase64:wc,encode:wc,encodeURI:gb,encodeURL:gb,utob:pb,btou:yb,decode:t4,isValid:LR,fromUint8Array:fp,toUint8Array:_b,extendString:Eb,extendUint8Array:kb,extendBuiltins:()=>{Eb(),kb()}},Cb=t=>t.toLowerCase().split(" ").join("-"),n4=async()=>{let t;try{t=await navigator.clipboard.readText(),console.log("Content read from clipboard: ",t)}catch(e){console.error("Failed to read: ",e)}return t},r4=async t=>{try{await navigator.clipboard.writeText(t),console.log("Content copied to clipboard")}catch(e){console.error("Failed to copy: ",e)}},Tb=()=>"maxTouchPoints"in navigator?navigator.maxTouchPoints>0:!1,RR=t=>JSON.parse(PR.decode(decodeURIComponent(t)));var hp=wn.GenIcon,jR=function(e){return hp({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.00488 4C2.00488 3.44772 2.4526 3 3.00488 3H21.0049C21.5572 3 22.0049 3.44772 22.0049 4V9.5C20.6242 9.5 19.5049 10.6193 19.5049 12C19.5049 13.3807 20.6242 14.5 22.0049 14.5V20C22.0049 20.5523 21.5572 21 21.0049 21H3.00488C2.4526 21 2.00488 20.5523 2.00488 20V4ZM8.09024 19C8.29615 18.4174 8.85177 18 9.50488 18C10.158 18 10.7136 18.4174 10.9195 19H20.0049V16.0322C18.5232 15.2959 17.5049 13.7669 17.5049 12C17.5049 10.2331 18.5232 8.70411 20.0049 7.96776V5H10.9195C10.7136 5.5826 10.158 6 9.50488 6C8.85177 6 8.29615 5.5826 8.09024 5H4.00488V19H8.09024ZM9.50488 11C8.67646 11 8.00488 10.3284 8.00488 9.5C8.00488 8.67157 8.67646 8 9.50488 8C10.3333 8 11.0049 8.67157 11.0049 9.5C11.0049 10.3284 10.3333 11 9.50488 11ZM9.50488 16C8.67646 16 8.00488 15.3284 8.00488 14.5C8.00488 13.6716 8.67646 13 9.50488 13C10.3333 13 11.0049 13.6716 11.0049 14.5C11.0049 15.3284 10.3333 16 9.50488 16Z"}}]})(e)},FR=function(e){return hp({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 13C18.3221 13 16.7514 13.4592 15.4068 14.2587C16.5908 15.6438 17.5269 17.2471 18.1465 19H20V13ZM16.0037 19C14.0446 14.3021 9.4079 11 4 11V19H16.0037ZM4 9C7.82914 9 11.3232 10.4348 13.9738 12.7961C15.7047 11.6605 17.7752 11 20 11V3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H6V1H8V5H4V9ZM18 1V5H10V3H16V1H18ZM16.5 10C15.6716 10 15 9.32843 15 8.5C15 7.67157 15.6716 7 16.5 7C17.3284 7 18 7.67157 18 8.5C18 9.32843 17.3284 10 16.5 10Z"}}]})(e)},BR=function(e){return hp({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 13H11V3H3V13ZM3 21H11V15H3V21ZM13 21H21V11H13V21ZM13 3V9H21V3H13Z"}}]})(e)},HR=function(e){return hp({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 8H20C20.5523 8 21 8.44772 21 9V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V9C3 8.44772 3.44772 8 4 8H6V7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7V8ZM5 10V20H19V10H5ZM11 14H13V16H11V14ZM7 14H9V16H7V14ZM15 14H17V16H15V14ZM16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8H16Z"}}]})(e)},pp=wn.GenIcon,zR=function(e){return pp({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(e)},UR=function(e){return pp({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"16"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(e)},$R=function(e){return pp({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}},{tag:"polyline",attr:{points:"17 21 17 13 7 13 7 21"}},{tag:"polyline",attr:{points:"7 3 7 8 15 8"}}]})(e)},VR=function(e){return pp({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}}]})(e)};const YR={name:"@storecraft/dashboard",version:"1.0.11",description:"Storecraft Official Dashboard",license:"MIT",author:"Tomer Shalev (https://github.com/store-craft)",homepage:"https://github.com/store-craft/storecraft",repository:{type:"git",url:"https://github.com/store-craft/storecraft.git",directory:"packages/dashboard"},keywords:["commerce","dashboard","react","storecraft"],type:"module",module:"./src/index.jsx",exports:{".":{import:"./dist/lib/index.js",require:"./dist/lib/index.umd.cjs",types:"./dist/lib/src/index.d.ts"}},scripts:{start:"npm run dashboard:dev","dashboard:dev":"vite --host","dashboard:build":"vite build && npm run dashboard:lib:build","dashboard:lib:build":"vite build -c vite.lib.config.js","dashboard:lint":"eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0","dashboard:preview":"vite preview","dashboard:publish":"npm publish --access public","dashboard:analyze":"npx vite-bundle-visualizer -c vite.lib.config.js",prepublishOnly:"npm run dashboard:build"},dependencies:{"@storecraft/core":"^1.0.0","@storecraft/sdk":"^0.1.0","@storecraft/sdk-react-hooks":"^0.1.0","@uiw/react-md-editor":"^3.18.1","@monaco-editor/react":"^4.6.0","monaco-editor":"^0.48.0","chart.js":"^4.2.0",handlebars:"^4.7.8","js-base64":"^3.7.5",marked:"^5.0.2",react:"18.2.0","react-datepicker":"^4.10.0","react-dom":"18.2.0","react-drag-drop-container":"^6.1.1","react-icons":"^4.9.0","react-image-crop":"^10.0.7","react-inspector":"^6.0.1","react-router-dom":"^6.14.1"},devDependencies:{"@types/react":"^18.2.66","@types/react-datepicker":"^6.2.0","@types/react-dom":"^18.2.22","@types/react-image-crop":"^8.1.6","@vitejs/plugin-react":"^4.2.1",autoprefixer:"^10.4.19",eslint:"^8.57.0","eslint-plugin-react":"^7.34.1","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.6",postcss:"^8.4.38","postcss-flexbugs-fixes":"^5.0.2","postcss-import":"^14.1.0","postcss-preset-env":"^7.7.2",sass:"^1.58.3","tailwind-scrollbar":"^2.1.0",tailwindcss:"^3.4.3",vite:"^5.2.0","vite-plugin-css-injected-by-js":"^3.5.1","vite-plugin-dts":"^3.9.1"},files:["dist"]},WR="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA9CAYAAAD1VdrqAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAGJhJREFUeJzlOwmYXEWZf9V7r+/p6ZmeycxkkplJyIRcJCbhygFyHyqnsKgICyYgsIKurqirn4uCH3gsuwt8uPst64qfLrriwSEYXYEoIkeQKxByTJK5JzM9ffe7X9X+Ve+9np4k4OfuurrZ6unp1/XqVdV/H/W3CkG79sxPX8+rymZFU5KEEIUAvgihgJ8A/hf/AhuXf/71zF1S7yLhHS6bnIeTcCyQYBbO5VzMf4QQxpjHPO64jmtP6Ptr03yIEaqomqpGxJ7EOEVRIpRSRUxBcV4xB6HiM5hNzo7X4gFKVXkfb3jYEk2pN3+w5TvvEvOo4d6ppS2tTjtrOLjhxoK9Ewnk4dvh75BZd3kjsA13yaFP8fA5DgnohIJXhCrP4x3zkKGk4Uvj9eH2xoPLdqJ4YV8dcMIQiRz7SUDOw059MKAHb76x8ZD8DY/VGac+HZ+5U39KXCn4mqsshRG2HXReBNI4mB+0LmmY8G0aAVq/loDfcOqX/tqteuf5myQN25i9ydkXhwOaH/SNNwwNGbyR4nw2tXhdVuQrgsDPpysl8DVegNm8d9DeyEF9hxlZLVXnnrHmwrvuuu+rN0nArZJztV12+sIF3xqwxoXIQYvOAHPI1mZRaAY0fsga5JD/Go9CF10Go952MElpZsGQKw+7zcNzhFEzE6bu3IgdN6lbPz/+0W3Pb+vU46bUM+Il5+ShhB7MPnwWtHVEvR3Xv8XGZuGrzuqhoAdEIET29ZGjIO8NQb425Q8lwciZf7NXaOAsMZLXGZX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kSE64p7YcixLu7Pcu0O0zU7gIpyMRRbooKtux3/CRMitNFcerR3AAAAAElFTkSuQmCC",GR=({children:t,...e})=>f.jsxs("svg",{viewBox:"0 0 302 53",...e,children:[t,f.jsxs("g",{className:"",children:[f.jsx("path",{d:"M 29.756 18.948 C 29.962 17.646 29.691 16.631 28.944 15.903 C 28.196 15.175 26.964 14.811 25.248 14.811 C 24.111 14.811 23.127 14.959 22.296 15.255 C 21.465 15.551 20.795 15.956 20.288 16.471 C 19.781 16.986 19.439 17.575 19.262 18.238 C 19.103 18.783 19.093 19.262 19.232 19.676 C 19.371 20.091 19.636 20.455 20.025 20.768 C 20.414 21.082 20.911 21.357 21.515 21.594 C 21.883 21.738 22.285 21.872 22.72 21.994 L 9.695 21.994 C 9.62 21.043 9.728 19.992 10.02 18.842 C 10.569 16.593 11.665 14.622 13.306 12.929 C 14.947 11.236 16.963 9.917 19.353 8.97 C 21.744 8.023 24.318 7.549 27.076 7.549 C 29.893 7.549 32.222 8.026 34.062 8.979 C 35.901 9.932 37.181 11.266 37.902 12.982 C 38.622 14.699 38.712 16.687 38.172 18.948 Z M 30.923 24.488 C 32.14 25.139 33.106 25.915 33.823 26.814 C 34.346 27.47 34.729 28.199 34.974 29 L 18.016 29 L 17.649 28.909 C 14.68 28.187 12.492 27.018 11.084 25.403 C 10.7 24.963 10.395 24.48 10.167 23.955 L 29.804 23.955 C 30.197 24.122 30.57 24.299 30.923 24.488 Z M 34.951 33.863 C 34.761 34.61 34.519 35.322 34.226 36 L 24.639 36 C 24.716 35.935 24.79 35.867 24.862 35.798 C 25.453 35.23 25.847 34.579 26.042 33.845 C 26.201 33.159 26.135 32.57 25.843 32.079 C 25.593 31.659 25.169 31.286 24.572 30.961 L 35.287 30.961 C 35.313 31.856 35.201 32.823 34.951 33.863 Z M 31.736 39.776 C 30.178 41.421 28.216 42.682 25.849 43.558 C 23.482 44.434 20.783 44.872 17.753 44.872 C 14.711 44.872 12.173 44.416 10.139 43.504 C 8.106 42.593 6.693 41.208 5.902 39.35 C 5.716 38.914 5.571 38.451 5.466 37.961 L 33.173 37.961 C 32.751 38.605 32.273 39.21 31.736 39.776 Z M 5.724 32.301 L 14.14 32.301 C 13.919 33.472 13.989 34.449 14.351 35.23 C 14.481 35.511 14.644 35.768 14.841 36 L 5.261 36 C 5.252 34.877 5.406 33.644 5.724 32.301 Z M 38.769 15.184 L 40.549 8.046 L 71.284 8.046 L 69.504 15.184 L 58.478 15.184 L 56.78 21.994 L 48.115 21.994 L 49.813 15.184 Z M 51.191 44.41 L 42.526 44.41 L 44.134 37.961 L 52.799 37.961 Z M 99.63 26.228 C 99.391 27.187 99.116 28.111 98.806 29 L 89.779 29 C 90.11 28.14 90.399 27.216 90.645 26.228 C 90.844 25.428 90.995 24.671 91.098 23.955 L 100.109 23.955 C 99.984 24.689 99.825 25.447 99.63 26.228 Z M 86.963 42.741 C 83.981 44.185 80.862 44.907 77.607 44.907 C 74.34 44.907 71.58 44.179 69.327 42.723 C 67.525 41.558 66.174 39.971 65.276 37.961 L 93.429 37.961 C 91.516 39.987 89.36 41.58 86.963 42.741 Z M 64.917 26.228 C 65.112 25.447 65.33 24.689 65.572 23.955 L 74.565 23.955 C 74.31 24.671 74.083 25.428 73.884 26.228 C 73.638 27.216 73.466 28.14 73.368 29 L 64.359 29 C 64.492 28.111 64.678 27.187 64.917 26.228 Z M 69.753 16.054 C 71.98 13.273 74.581 11.16 77.557 9.715 C 80.533 8.271 83.655 7.549 86.922 7.549 C 90.177 7.549 92.936 8.271 95.197 9.715 C 97.459 11.16 99.013 13.273 99.858 16.054 C 100.387 17.795 100.555 19.775 100.362 21.994 L 91.258 21.994 C 91.266 21.364 91.226 20.775 91.138 20.227 C 90.877 18.593 90.226 17.356 89.187 16.516 C 88.148 15.675 86.752 15.255 85 15.255 C 83.26 15.255 81.658 15.675 80.194 16.516 C 78.73 17.356 77.46 18.593 76.383 20.227 C 76.022 20.775 75.689 21.364 75.382 21.994 L 66.295 21.994 C 67.207 19.775 68.36 17.795 69.753 16.054 Z M 73.391 32.23 C 73.652 33.863 74.306 35.1 75.351 35.941 C 75.376 35.961 75.401 35.981 75.426 36 L 64.58 36 C 64.175 34.492 64.031 32.813 64.148 30.961 L 73.276 30.961 C 73.288 31.406 73.327 31.829 73.391 32.23 Z M 84.344 35.941 C 85.803 35.1 87.07 33.863 88.146 32.23 C 88.41 31.829 88.659 31.406 88.894 30.961 L 98.04 30.961 C 97.234 32.813 96.254 34.492 95.1 36 L 84.24 36 C 84.275 35.981 84.309 35.961 84.344 35.941 Z M 96.11 44.41 L 97.718 37.961 L 106.507 37.961 L 104.899 44.41 Z M 105.177 8.046 L 120.198 8.046 C 122.921 8.046 125.152 8.534 126.891 9.511 C 128.63 10.488 129.811 11.885 130.436 13.702 C 131.06 15.519 131.062 17.67 130.442 20.156 C 130.283 20.793 130.095 21.406 129.878 21.994 L 120.615 21.994 C 120.922 21.458 121.162 20.845 121.334 20.156 C 121.614 19.031 121.615 18.099 121.338 17.359 C 121.061 16.619 120.52 16.063 119.713 15.69 C 118.906 15.317 117.846 15.131 116.532 15.131 L 112.199 15.131 L 110.488 21.994 L 101.699 21.994 Z M 127.191 26.574 C 126.381 27.499 125.472 28.308 124.465 29 L 99.952 29 L 101.21 23.955 L 109.999 23.955 L 109.729 25.039 L 114.061 25.039 C 115.387 25.039 116.54 24.864 117.521 24.515 C 117.948 24.363 118.342 24.176 118.704 23.955 L 129 23.955 C 128.49 24.906 127.887 25.779 127.191 26.574 Z M 125.347 43.426 L 126.71 37.961 L 152.065 37.961 L 150.457 44.41 L 125.102 44.41 L 125.347 43.426 L 125.638 44.41 L 116.05 44.41 L 114.213 37.961 L 123.732 37.961 Z M 134.168 8.046 L 159.523 8.046 L 157.744 15.184 L 141.178 15.184 L 139.48 21.994 L 130.691 21.994 Z M 112.504 31.963 L 108.002 31.963 L 106.996 36 L 98.207 36 L 99.463 30.961 L 121.663 30.961 L 123.152 36 L 113.654 36 Z M 56.291 23.955 L 55.033 29 L 46.368 29 L 47.626 23.955 Z M 54.544 30.961 L 53.288 36 L 44.623 36 L 45.879 30.961 Z M 127.199 36 L 128.455 30.961 L 137.244 30.961 L 135.987 36 Z M 128.944 29 L 130.202 23.955 L 154.261 23.955 L 153.003 29 Z",sstyle:"fill: rgb(51, 51, 51);"}),f.jsx("path",{d:"M 188.795 19.736 L 185.933 19.736 Q 185.571 17.852 184.575 16.15 Q 183.579 14.448 182.058 13.135 Q 180.536 11.822 178.562 11.061 Q 176.588 10.3 174.234 10.3 Q 170.648 10.3 167.668 12.193 Q 164.689 14.085 162.905 17.744 Q 161.121 21.402 161.121 26.691 Q 161.121 32.015 162.905 35.664 Q 164.689 39.314 167.668 41.197 Q 170.648 43.081 174.234 43.081 Q 176.588 43.081 178.562 42.329 Q 180.536 41.578 182.058 40.265 Q 183.579 38.952 184.575 37.24 Q 185.571 35.529 185.933 33.645 L 188.795 33.645 Q 188.36 36.036 187.174 38.218 Q 185.988 40.4 184.122 42.094 Q 182.257 43.787 179.766 44.765 Q 177.276 45.743 174.234 45.743 Q 169.579 45.743 166.002 43.389 Q 162.425 41.034 160.397 36.751 Q 158.369 32.468 158.369 26.691 Q 158.369 20.913 160.397 16.63 Q 162.425 12.347 166.002 9.992 Q 169.579 7.638 174.234 7.638 Q 177.276 7.638 179.766 8.607 Q 182.257 9.576 184.122 11.269 Q 185.988 12.963 187.174 15.136 Q 188.36 17.309 188.795 19.736 Z M 192.123 45.236 L 192.123 8.145 L 203.823 8.145 Q 207.554 8.145 210.143 9.54 Q 212.733 10.934 214.092 13.406 Q 215.45 15.878 215.45 19.12 Q 215.45 22.326 214.092 24.78 Q 212.733 27.234 210.152 28.61 Q 207.572 29.987 203.859 29.987 L 193.644 29.987 L 193.644 27.379 L 203.787 27.379 Q 206.666 27.379 208.649 26.365 Q 210.632 25.35 211.647 23.494 Q 212.661 21.638 212.661 19.12 Q 212.661 16.585 211.638 14.692 Q 210.614 12.8 208.631 11.749 Q 206.648 10.699 203.75 10.699 L 194.948 10.699 L 194.948 45.236 Z M 207.916 28.465 L 217.044 45.236 L 213.784 45.236 L 204.728 28.465 Z M 218.397 45.236 L 215.445 45.236 L 228.883 8.145 L 231.98 8.145 L 245.418 45.236 L 242.466 45.236 L 230.549 11.785 L 230.332 11.785 Z M 221.385 31.146 L 239.496 31.146 L 239.496 33.718 L 221.385 33.718 Z M 247.05 45.236 L 247.05 8.145 L 268.131 8.145 L 268.131 10.699 L 249.876 10.699 L 249.876 25.387 L 266.429 25.387 L 266.429 27.958 L 249.876 27.958 L 249.876 45.236 Z M 269.583 10.699 L 269.583 8.145 L 296.024 8.145 L 296.024 10.699 L 284.216 10.699 L 284.216 45.236 L 281.391 45.236 L 281.391 10.699 Z",transform:"matrix(0.998892068862915, 0, 0, 1, 0.17177101969718933, 0)",sstyle:"fill: rgb(51, 51, 51);"})]})]}),Sb=({className:t})=>f.jsx(GR,{className:"fill-[url(#a)] text-pink-500 "+t,children:f.jsx("defs",{children:f.jsxs("linearGradient",{id:"a",children:[f.jsx("stop",{offset:"0%","stop-color":"rgb(236 72 153)"}),f.jsx("stop",{offset:"100%","stop-color":"rgb(151 60 255)"})]})})}),KR=({...t})=>{const e=({})=>f.jsxs("div",{className:`rounded-lg my-auto b
|
144
|
+
whitespace-nowrap ${o}`,children:i??s,...l})}),TR=({from:t,to:e,rounded:n="rounded-lg",stroke:r,...i})=>f.jsx(lt,{from:t,to:e,rounded:n,stroke:r,className:"w-fit h-fit",children:f.jsx(kR,{...i})}),N1=({Icon:t,from:e="#973cff",to:n="rgb(236 72 153)",...r})=>{const i=btoa(`gradient_${e}_${n}`);return f.jsxs(f.Fragment,{children:[f.jsx("svg",{width:"0",height:"0",className:"absolute",children:f.jsxs("linearGradient",{id:i,x1:"100%",y1:"100%",x2:"0%",y2:"0%",children:[f.jsx("stop",{stopColor:e,offset:"0%"}),f.jsx("stop",{stopColor:n,offset:"100%"})]})}),f.jsx(t,{style:{fill:`url(#${i})`},...r})]})},ob="3.7.7",SR=ob,bc=typeof Buffer=="function",lb=typeof TextDecoder=="function"?new TextDecoder:void 0,cb=typeof TextEncoder=="function"?new TextEncoder:void 0,A1=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),dp=(t=>{let e={};return t.forEach((n,r)=>e[n]=r),e})(A1),NR=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,En=String.fromCharCode.bind(String),ub=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),db=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),fb=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),hb=t=>{let e,n,r,i,s="";const a=t.length%3;for(let o=0;o<t.length;){if((n=t.charCodeAt(o++))>255||(r=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=n<<16|r<<8|i,s+=A1[e>>18&63]+A1[e>>12&63]+A1[e>>6&63]+A1[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},X5=typeof btoa=="function"?t=>btoa(t):bc?t=>Buffer.from(t,"binary").toString("base64"):hb,J5=bc?t=>Buffer.from(t).toString("base64"):t=>{let n=[];for(let r=0,i=t.length;r<i;r+=4096)n.push(En.apply(null,t.subarray(r,r+4096)));return X5(n.join(""))},fp=(t,e=!1)=>e?db(J5(t)):J5(t),AR=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?En(192|e>>>6)+En(128|e&63):En(224|e>>>12&15)+En(128|e>>>6&63)+En(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return En(240|e>>>18&7)+En(128|e>>>12&63)+En(128|e>>>6&63)+En(128|e&63)}},DR=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,pb=t=>t.replace(DR,AR),mb=bc?t=>Buffer.from(t,"utf8").toString("base64"):cb?t=>J5(cb.encode(t)):t=>X5(pb(t)),wc=(t,e=!1)=>e?db(mb(t)):mb(t),gb=t=>wc(t,!0),OR=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,MR=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),n=e-65536;return En((n>>>10)+55296)+En((n&1023)+56320);case 3:return En((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return En((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},yb=t=>t.replace(OR,MR),vb=t=>{if(t=t.replace(/\s+/g,""),!NR.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,n="",r,i;for(let s=0;s<t.length;)e=dp[t.charAt(s++)]<<18|dp[t.charAt(s++)]<<12|(r=dp[t.charAt(s++)])<<6|(i=dp[t.charAt(s++)]),n+=r===64?En(e>>16&255):i===64?En(e>>16&255,e>>8&255):En(e>>16&255,e>>8&255,e&255);return n},e4=typeof atob=="function"?t=>atob(fb(t)):bc?t=>Buffer.from(t,"base64").toString("binary"):vb,xb=bc?t=>ub(Buffer.from(t,"base64")):t=>ub(e4(t).split("").map(e=>e.charCodeAt(0))),_b=t=>xb(bb(t)),IR=bc?t=>Buffer.from(t,"base64").toString("utf8"):lb?t=>lb.decode(xb(t)):t=>yb(e4(t)),bb=t=>fb(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),t4=t=>IR(bb(t)),LR=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},wb=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),Eb=function(){const t=(e,n)=>Object.defineProperty(String.prototype,e,wb(n));t("fromBase64",function(){return t4(this)}),t("toBase64",function(e){return wc(this,e)}),t("toBase64URI",function(){return wc(this,!0)}),t("toBase64URL",function(){return wc(this,!0)}),t("toUint8Array",function(){return _b(this)})},kb=function(){const t=(e,n)=>Object.defineProperty(Uint8Array.prototype,e,wb(n));t("toBase64",function(e){return fp(this,e)}),t("toBase64URI",function(){return fp(this,!0)}),t("toBase64URL",function(){return fp(this,!0)})},PR={version:ob,VERSION:SR,atob:e4,atobPolyfill:vb,btoa:X5,btoaPolyfill:hb,fromBase64:t4,toBase64:wc,encode:wc,encodeURI:gb,encodeURL:gb,utob:pb,btou:yb,decode:t4,isValid:LR,fromUint8Array:fp,toUint8Array:_b,extendString:Eb,extendUint8Array:kb,extendBuiltins:()=>{Eb(),kb()}},Cb=t=>t.toLowerCase().split(" ").join("-"),n4=async()=>{let t;try{t=await navigator.clipboard.readText(),console.log("Content read from clipboard: ",t)}catch(e){console.error("Failed to read: ",e)}return t},r4=async t=>{try{await navigator.clipboard.writeText(t),console.log("Content copied to clipboard")}catch(e){console.error("Failed to copy: ",e)}},Tb=()=>"maxTouchPoints"in navigator?navigator.maxTouchPoints>0:!1,RR=t=>JSON.parse(PR.decode(decodeURIComponent(t)));var hp=wn.GenIcon,jR=function(e){return hp({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.00488 4C2.00488 3.44772 2.4526 3 3.00488 3H21.0049C21.5572 3 22.0049 3.44772 22.0049 4V9.5C20.6242 9.5 19.5049 10.6193 19.5049 12C19.5049 13.3807 20.6242 14.5 22.0049 14.5V20C22.0049 20.5523 21.5572 21 21.0049 21H3.00488C2.4526 21 2.00488 20.5523 2.00488 20V4ZM8.09024 19C8.29615 18.4174 8.85177 18 9.50488 18C10.158 18 10.7136 18.4174 10.9195 19H20.0049V16.0322C18.5232 15.2959 17.5049 13.7669 17.5049 12C17.5049 10.2331 18.5232 8.70411 20.0049 7.96776V5H10.9195C10.7136 5.5826 10.158 6 9.50488 6C8.85177 6 8.29615 5.5826 8.09024 5H4.00488V19H8.09024ZM9.50488 11C8.67646 11 8.00488 10.3284 8.00488 9.5C8.00488 8.67157 8.67646 8 9.50488 8C10.3333 8 11.0049 8.67157 11.0049 9.5C11.0049 10.3284 10.3333 11 9.50488 11ZM9.50488 16C8.67646 16 8.00488 15.3284 8.00488 14.5C8.00488 13.6716 8.67646 13 9.50488 13C10.3333 13 11.0049 13.6716 11.0049 14.5C11.0049 15.3284 10.3333 16 9.50488 16Z"}}]})(e)},FR=function(e){return hp({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 13C18.3221 13 16.7514 13.4592 15.4068 14.2587C16.5908 15.6438 17.5269 17.2471 18.1465 19H20V13ZM16.0037 19C14.0446 14.3021 9.4079 11 4 11V19H16.0037ZM4 9C7.82914 9 11.3232 10.4348 13.9738 12.7961C15.7047 11.6605 17.7752 11 20 11V3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H6V1H8V5H4V9ZM18 1V5H10V3H16V1H18ZM16.5 10C15.6716 10 15 9.32843 15 8.5C15 7.67157 15.6716 7 16.5 7C17.3284 7 18 7.67157 18 8.5C18 9.32843 17.3284 10 16.5 10Z"}}]})(e)},BR=function(e){return hp({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 13H11V3H3V13ZM3 21H11V15H3V21ZM13 21H21V11H13V21ZM13 3V9H21V3H13Z"}}]})(e)},HR=function(e){return hp({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18 8H20C20.5523 8 21 8.44772 21 9V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V9C3 8.44772 3.44772 8 4 8H6V7C6 3.68629 8.68629 1 12 1C15.3137 1 18 3.68629 18 7V8ZM5 10V20H19V10H5ZM11 14H13V16H11V14ZM7 14H9V16H7V14ZM15 14H17V16H15V14ZM16 8V7C16 4.79086 14.2091 3 12 3C9.79086 3 8 4.79086 8 7V8H16Z"}}]})(e)},pp=wn.GenIcon,zR=function(e){return pp({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(e)},UR=function(e){return pp({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"16"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(e)},$R=function(e){return pp({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}},{tag:"polyline",attr:{points:"17 21 17 13 7 13 7 21"}},{tag:"polyline",attr:{points:"7 3 7 8 15 8"}}]})(e)},VR=function(e){return pp({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}}]})(e)};const YR={name:"@storecraft/dashboard",version:"1.0.11",description:"Storecraft Official Dashboard",license:"MIT",author:"Tomer Shalev (https://github.com/store-craft)",homepage:"https://github.com/store-craft/storecraft",repository:{type:"git",url:"https://github.com/store-craft/storecraft.git",directory:"packages/dashboard"},keywords:["commerce","dashboard","react","storecraft"],type:"module",module:"./src/index.jsx",exports:{".":{import:"./dist/lib/index.js",require:"./dist/lib/index.umd.cjs",types:"./dist/lib/src/index.d.ts"}},scripts:{start:"npm run dashboard:dev","dashboard:dev":"vite --host","dashboard:build":"vite build && npm run dashboard:lib:build","dashboard:lib:build":"vite build -c vite.lib.config.js","dashboard:lint":"eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0","dashboard:preview":"vite preview","dashboard:analyze":"npx vite-bundle-visualizer -c vite.lib.config.js",prepublishOnly:"npm run dashboard:build && npm version patch --force"},dependencies:{"@storecraft/core":"^1.0.0","@storecraft/sdk":"^1.0.0","@storecraft/sdk-react-hooks":"^1.0.0","@uiw/react-md-editor":"^3.18.1","@monaco-editor/react":"^4.6.0","monaco-editor":"^0.48.0","chart.js":"^4.2.0",handlebars:"^4.7.8","js-base64":"^3.7.5",marked:"^5.0.2",react:"18.2.0","react-datepicker":"^4.10.0","react-dom":"18.2.0","react-drag-drop-container":"^6.1.1","react-icons":"^4.9.0","react-image-crop":"^10.0.7","react-inspector":"^6.0.1","react-router-dom":"^6.14.1"},devDependencies:{"@types/react":"^18.2.66","@types/react-datepicker":"^6.2.0","@types/react-dom":"^18.2.22","@types/react-image-crop":"^8.1.6","@vitejs/plugin-react":"^4.2.1",autoprefixer:"^10.4.19",eslint:"^8.57.0","eslint-plugin-react":"^7.34.1","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.6",postcss:"^8.4.38","postcss-flexbugs-fixes":"^5.0.2","postcss-import":"^14.1.0","postcss-preset-env":"^7.7.2",sass:"^1.58.3","tailwind-scrollbar":"^2.1.0",tailwindcss:"^3.4.3",vite:"^5.2.0","vite-plugin-css-injected-by-js":"^3.5.1","vite-plugin-dts":"^3.9.1"},files:["dist"]},WR="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA9CAYAAAD1VdrqAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAGJhJREFUeJzlOwmYXEWZf9V7r+/p6ZmeycxkkplJyIRcJCbhygFyHyqnsKgICyYgsIKurqirn4uCH3gsuwt8uPst64qfLrriwSEYXYEoIkeQKxByTJK5JzM9ffe7X9X+Ve+9np4k4OfuurrZ6unp1/XqVdV/H/W3CkG79sxPX8+rymZFU5KEEIUAvgihgJ8A/hf/AhuXf/71zF1S7yLhHS6bnIeTcCyQYBbO5VzMf4QQxpjHPO64jmtP6Ptr03yIEaqomqpGxJ7EOEVRIpRSRUxBcV4xB6HiM5hNzo7X4gFKVXkfb3jYEk2pN3+w5TvvEvOo4d6ppS2tTjtrOLjhxoK9Ewnk4dvh75BZd3kjsA13yaFP8fA5DgnohIJXhCrP4x3zkKGk4Uv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YWYHEfotBcj6VVRfoLjJLg1p2IXioYVpbRR0aorm3B7LtS+AG5wxIxZqhDKj9jzsWlqNSOyFj4yYtaNbiEMM5unuWQMY5DSUnClUHpZxod26/1R5jNUf3uPuAKD3Zcs0+RCBTaYTEUe03OS/n2qhdwGAjLrWxJ/JUwQ92aODwSFlGJWghoJk4Ir1LFAtFwGmPIy0Wn3bJoueeKzhlQFuzzOYO2NubH1AVph7dFmuP+HUpzipRU6bSOOTyiJgSShZJypoxHrz9ZBQG81NCqLXgl1AJ6YFMWwFWFXxGTULNFpkRVBgeC4ri8UPoAdxwXJO5slbTqbUyNQyQmEwbSVHEZ4lDJBdFZA7NBZ+p/F8f0eDkJ+Qmsbco9kSE64p7YcixLu7Pcu0O0zU7gIpyMRRbooKtux3/CRMitNFcerR3AAAAAElFTkSuQmCC",GR=({children:t,...e})=>f.jsxs("svg",{viewBox:"0 0 302 53",...e,children:[t,f.jsxs("g",{className:"",children:[f.jsx("path",{d:"M 29.756 18.948 C 29.962 17.646 29.691 16.631 28.944 15.903 C 28.196 15.175 26.964 14.811 25.248 14.811 C 24.111 14.811 23.127 14.959 22.296 15.255 C 21.465 15.551 20.795 15.956 20.288 16.471 C 19.781 16.986 19.439 17.575 19.262 18.238 C 19.103 18.783 19.093 19.262 19.232 19.676 C 19.371 20.091 19.636 20.455 20.025 20.768 C 20.414 21.082 20.911 21.357 21.515 21.594 C 21.883 21.738 22.285 21.872 22.72 21.994 L 9.695 21.994 C 9.62 21.043 9.728 19.992 10.02 18.842 C 10.569 16.593 11.665 14.622 13.306 12.929 C 14.947 11.236 16.963 9.917 19.353 8.97 C 21.744 8.023 24.318 7.549 27.076 7.549 C 29.893 7.549 32.222 8.026 34.062 8.979 C 35.901 9.932 37.181 11.266 37.902 12.982 C 38.622 14.699 38.712 16.687 38.172 18.948 Z M 30.923 24.488 C 32.14 25.139 33.106 25.915 33.823 26.814 C 34.346 27.47 34.729 28.199 34.974 29 L 18.016 29 L 17.649 28.909 C 14.68 28.187 12.492 27.018 11.084 25.403 C 10.7 24.963 10.395 24.48 10.167 23.955 L 29.804 23.955 C 30.197 24.122 30.57 24.299 30.923 24.488 Z M 34.951 33.863 C 34.761 34.61 34.519 35.322 34.226 36 L 24.639 36 C 24.716 35.935 24.79 35.867 24.862 35.798 C 25.453 35.23 25.847 34.579 26.042 33.845 C 26.201 33.159 26.135 32.57 25.843 32.079 C 25.593 31.659 25.169 31.286 24.572 30.961 L 35.287 30.961 C 35.313 31.856 35.201 32.823 34.951 33.863 Z M 31.736 39.776 C 30.178 41.421 28.216 42.682 25.849 43.558 C 23.482 44.434 20.783 44.872 17.753 44.872 C 14.711 44.872 12.173 44.416 10.139 43.504 C 8.106 42.593 6.693 41.208 5.902 39.35 C 5.716 38.914 5.571 38.451 5.466 37.961 L 33.173 37.961 C 32.751 38.605 32.273 39.21 31.736 39.776 Z M 5.724 32.301 L 14.14 32.301 C 13.919 33.472 13.989 34.449 14.351 35.23 C 14.481 35.511 14.644 35.768 14.841 36 L 5.261 36 C 5.252 34.877 5.406 33.644 5.724 32.301 Z M 38.769 15.184 L 40.549 8.046 L 71.284 8.046 L 69.504 15.184 L 58.478 15.184 L 56.78 21.994 L 48.115 21.994 L 49.813 15.184 Z M 51.191 44.41 L 42.526 44.41 L 44.134 37.961 L 52.799 37.961 Z M 99.63 26.228 C 99.391 27.187 99.116 28.111 98.806 29 L 89.779 29 C 90.11 28.14 90.399 27.216 90.645 26.228 C 90.844 25.428 90.995 24.671 91.098 23.955 L 100.109 23.955 C 99.984 24.689 99.825 25.447 99.63 26.228 Z M 86.963 42.741 C 83.981 44.185 80.862 44.907 77.607 44.907 C 74.34 44.907 71.58 44.179 69.327 42.723 C 67.525 41.558 66.174 39.971 65.276 37.961 L 93.429 37.961 C 91.516 39.987 89.36 41.58 86.963 42.741 Z M 64.917 26.228 C 65.112 25.447 65.33 24.689 65.572 23.955 L 74.565 23.955 C 74.31 24.671 74.083 25.428 73.884 26.228 C 73.638 27.216 73.466 28.14 73.368 29 L 64.359 29 C 64.492 28.111 64.678 27.187 64.917 26.228 Z M 69.753 16.054 C 71.98 13.273 74.581 11.16 77.557 9.715 C 80.533 8.271 83.655 7.549 86.922 7.549 C 90.177 7.549 92.936 8.271 95.197 9.715 C 97.459 11.16 99.013 13.273 99.858 16.054 C 100.387 17.795 100.555 19.775 100.362 21.994 L 91.258 21.994 C 91.266 21.364 91.226 20.775 91.138 20.227 C 90.877 18.593 90.226 17.356 89.187 16.516 C 88.148 15.675 86.752 15.255 85 15.255 C 83.26 15.255 81.658 15.675 80.194 16.516 C 78.73 17.356 77.46 18.593 76.383 20.227 C 76.022 20.775 75.689 21.364 75.382 21.994 L 66.295 21.994 C 67.207 19.775 68.36 17.795 69.753 16.054 Z M 73.391 32.23 C 73.652 33.863 74.306 35.1 75.351 35.941 C 75.376 35.961 75.401 35.981 75.426 36 L 64.58 36 C 64.175 34.492 64.031 32.813 64.148 30.961 L 73.276 30.961 C 73.288 31.406 73.327 31.829 73.391 32.23 Z M 84.344 35.941 C 85.803 35.1 87.07 33.863 88.146 32.23 C 88.41 31.829 88.659 31.406 88.894 30.961 L 98.04 30.961 C 97.234 32.813 96.254 34.492 95.1 36 L 84.24 36 C 84.275 35.981 84.309 35.961 84.344 35.941 Z M 96.11 44.41 L 97.718 37.961 L 106.507 37.961 L 104.899 44.41 Z M 105.177 8.046 L 120.198 8.046 C 122.921 8.046 125.152 8.534 126.891 9.511 C 128.63 10.488 129.811 11.885 130.436 13.702 C 131.06 15.519 131.062 17.67 130.442 20.156 C 130.283 20.793 130.095 21.406 129.878 21.994 L 120.615 21.994 C 120.922 21.458 121.162 20.845 121.334 20.156 C 121.614 19.031 121.615 18.099 121.338 17.359 C 121.061 16.619 120.52 16.063 119.713 15.69 C 118.906 15.317 117.846 15.131 116.532 15.131 L 112.199 15.131 L 110.488 21.994 L 101.699 21.994 Z M 127.191 26.574 C 126.381 27.499 125.472 28.308 124.465 29 L 99.952 29 L 101.21 23.955 L 109.999 23.955 L 109.729 25.039 L 114.061 25.039 C 115.387 25.039 116.54 24.864 117.521 24.515 C 117.948 24.363 118.342 24.176 118.704 23.955 L 129 23.955 C 128.49 24.906 127.887 25.779 127.191 26.574 Z M 125.347 43.426 L 126.71 37.961 L 152.065 37.961 L 150.457 44.41 L 125.102 44.41 L 125.347 43.426 L 125.638 44.41 L 116.05 44.41 L 114.213 37.961 L 123.732 37.961 Z M 134.168 8.046 L 159.523 8.046 L 157.744 15.184 L 141.178 15.184 L 139.48 21.994 L 130.691 21.994 Z M 112.504 31.963 L 108.002 31.963 L 106.996 36 L 98.207 36 L 99.463 30.961 L 121.663 30.961 L 123.152 36 L 113.654 36 Z M 56.291 23.955 L 55.033 29 L 46.368 29 L 47.626 23.955 Z M 54.544 30.961 L 53.288 36 L 44.623 36 L 45.879 30.961 Z M 127.199 36 L 128.455 30.961 L 137.244 30.961 L 135.987 36 Z M 128.944 29 L 130.202 23.955 L 154.261 23.955 L 153.003 29 Z",sstyle:"fill: rgb(51, 51, 51);"}),f.jsx("path",{d:"M 188.795 19.736 L 185.933 19.736 Q 185.571 17.852 184.575 16.15 Q 183.579 14.448 182.058 13.135 Q 180.536 11.822 178.562 11.061 Q 176.588 10.3 174.234 10.3 Q 170.648 10.3 167.668 12.193 Q 164.689 14.085 162.905 17.744 Q 161.121 21.402 161.121 26.691 Q 161.121 32.015 162.905 35.664 Q 164.689 39.314 167.668 41.197 Q 170.648 43.081 174.234 43.081 Q 176.588 43.081 178.562 42.329 Q 180.536 41.578 182.058 40.265 Q 183.579 38.952 184.575 37.24 Q 185.571 35.529 185.933 33.645 L 188.795 33.645 Q 188.36 36.036 187.174 38.218 Q 185.988 40.4 184.122 42.094 Q 182.257 43.787 179.766 44.765 Q 177.276 45.743 174.234 45.743 Q 169.579 45.743 166.002 43.389 Q 162.425 41.034 160.397 36.751 Q 158.369 32.468 158.369 26.691 Q 158.369 20.913 160.397 16.63 Q 162.425 12.347 166.002 9.992 Q 169.579 7.638 174.234 7.638 Q 177.276 7.638 179.766 8.607 Q 182.257 9.576 184.122 11.269 Q 185.988 12.963 187.174 15.136 Q 188.36 17.309 188.795 19.736 Z M 192.123 45.236 L 192.123 8.145 L 203.823 8.145 Q 207.554 8.145 210.143 9.54 Q 212.733 10.934 214.092 13.406 Q 215.45 15.878 215.45 19.12 Q 215.45 22.326 214.092 24.78 Q 212.733 27.234 210.152 28.61 Q 207.572 29.987 203.859 29.987 L 193.644 29.987 L 193.644 27.379 L 203.787 27.379 Q 206.666 27.379 208.649 26.365 Q 210.632 25.35 211.647 23.494 Q 212.661 21.638 212.661 19.12 Q 212.661 16.585 211.638 14.692 Q 210.614 12.8 208.631 11.749 Q 206.648 10.699 203.75 10.699 L 194.948 10.699 L 194.948 45.236 Z M 207.916 28.465 L 217.044 45.236 L 213.784 45.236 L 204.728 28.465 Z M 218.397 45.236 L 215.445 45.236 L 228.883 8.145 L 231.98 8.145 L 245.418 45.236 L 242.466 45.236 L 230.549 11.785 L 230.332 11.785 Z M 221.385 31.146 L 239.496 31.146 L 239.496 33.718 L 221.385 33.718 Z M 247.05 45.236 L 247.05 8.145 L 268.131 8.145 L 268.131 10.699 L 249.876 10.699 L 249.876 25.387 L 266.429 25.387 L 266.429 27.958 L 249.876 27.958 L 249.876 45.236 Z M 269.583 10.699 L 269.583 8.145 L 296.024 8.145 L 296.024 10.699 L 284.216 10.699 L 284.216 45.236 L 281.391 45.236 L 281.391 10.699 Z",transform:"matrix(0.998892068862915, 0, 0, 1, 0.17177101969718933, 0)",sstyle:"fill: rgb(51, 51, 51);"})]})]}),Sb=({className:t})=>f.jsx(GR,{className:"fill-[url(#a)] text-pink-500 "+t,children:f.jsx("defs",{children:f.jsxs("linearGradient",{id:"a",children:[f.jsx("stop",{offset:"0%","stop-color":"rgb(236 72 153)"}),f.jsx("stop",{offset:"100%","stop-color":"rgb(151 60 255)"})]})})}),KR=({...t})=>{const e=({})=>f.jsxs("div",{className:`rounded-lg my-auto b
|
145
145
|
bg-pink-50 dark:bg-pink-50/10 w-fit text-sm
|
146
146
|
text-pink-500 -tracking-wideset
|
147
147
|
py-0 px-1 --border font-semibold`,children:[f.jsx("div",{children:"docs",className:"inline-block -translate-y-px --inline"}),f.jsx("span",{children:" π"})]});return f.jsxs("div",{className:`relative w-full h-16 flex flex-row
|
@@ -171,8 +171,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An err
|
|
171
171
|
at `+a}return e},kc.buildMessage=function(t,e){var n={literal:function(c){return'"'+i(c.text)+'"'},class:function(c){var u=c.parts.map(function(d){return Array.isArray(d)?s(d[0])+"-"+s(d[1]):s(d)});return"["+(c.inverted?"^":"")+u.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(c){return c.description}};function r(c){return c.charCodeAt(0).toString(16).toUpperCase()}function i(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function s(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function a(c){return n[c.type](c)}function o(c){var u=c.map(a),d,h;if(u.sort(),u.length>0){for(d=1,h=1;d<u.length;d++)u[d-1]!==u[d]&&(u[h]=u[d],h++);u.length=h}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function l(c){return c?'"'+i(c)+'"':"end of input"}return"Expected "+o(t)+" but "+l(e)+" found."};function nj(t,e){e=e!==void 0?e:{};var n={},r=e.grammarSource,i={expression:tr},s=tr,a="|",o="-",l="(",c=")",u="'",d='"',h=/^[^"' ()|&]/,p=/^[^']/,m=/^[^"]/,g=/^[ ]/,y=Fe("expression"),v=Fe("sum term"),x=An("|",!1),b=Fe("product term"),w=An("&",!1),C=Fe("subexpression"),S=An("-",!1),k=Fe("term"),N=An("(",!1),D=An(")",!1),A=Fe("variable"),L=vr(['"',"'"," ","(",")","|","&"],!0,!1),$=Fe("variable 1"),K=An("'",!1),X=vr(["'"],!0,!1),H=An('"',!1),U=vr(['"'],!0,!1),G=Fe("whitespace character(s)"),R=vr([" "],!1,!1),z=function(Y,te){return Ab("|",Y,te)},O=function(Y,te){return Ab("&",Y,te)},W=function(Y){return{op:"!",args:[Y]}},Z=function(Y){return Y.group=!0,Y},I=function(Y){return{op:"LEAF",value:vi().trim()}},se=function(Y){return{op:"LEAF",value:vi().trim().slice(1,-1)}},V=0,ce=0,De=[{line:1,column:1}],we=0,Ne=[],ve=0,qt;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');s=i[e.startRule]}function vi(){return t.substring(ce,V)}function An(Y,te){return{type:"literal",text:Y,ignoreCase:te}}function vr(Y,te,ue){return{type:"class",parts:Y,inverted:te,ignoreCase:ue}}function Ps(){return{type:"end"}}function Fe(Y){return{type:"other",description:Y}}function xi(Y){var te=De[Y],ue;if(te)return te;for(ue=Y-1;!De[ue];)ue--;for(te=De[ue],te={line:te.line,column:te.column};ue<Y;)t.charCodeAt(ue)===10?(te.line++,te.column=1):te.column++,ue++;return De[Y]=te,te}function Dn(Y,te,ue){var st=xi(Y),tt=xi(te),qi={source:r,start:{offset:Y,line:st.line,column:st.column},end:{offset:te,line:tt.line,column:tt.column}};return qi}function Ue(Y){V<we||(V>we&&(we=V,Ne=[]),Ne.push(Y))}function er(Y,te,ue){return new kc(kc.buildMessage(Y,te),Y,te,ue)}function tr(){var Y;return ve++,Y=Ul(),ve--,Y===n&&ve===0&&Ue(y),Y}function Ul(){var Y,te,ue,st;return ve++,Y=V,te=Mo(),te!==n?(t.charCodeAt(V)===124?(ue=a,V++):(ue=n,ve===0&&Ue(x)),ue!==n?(st=Ul(),st!==n?(ce=Y,Y=z(te,st)):(V=Y,Y=n)):(V=Y,Y=n)):(V=Y,Y=n),Y===n&&(Y=Mo()),ve--,Y===n&&(te=n,ve===0&&Ue(v)),Y}function Mo(){var Y,te,ue;return ve++,Y=V,te=Io(),te!==n?(t.charCodeAt(V)===38?V++:ve===0&&Ue(w),ue=Mo(),ue!==n?(ce=Y,Y=O(te,ue)):(V=Y,Y=n)):(V=Y,Y=n),Y===n&&(Y=Io()),ve--,Y===n&&(te=n,ve===0&&Ue(b)),Y}function Io(){var Y,te,ue;return ve++,Y=V,ne(),t.charCodeAt(V)===45?(te=o,V++):(te=n,ve===0&&Ue(S)),te!==n?(ue=$l(),ue!==n?(ne(),ce=Y,Y=W(ue)):(V=Y,Y=n)):(V=Y,Y=n),Y===n&&(Y=$l()),ve--,Y===n&&ve===0&&Ue(C),Y}function $l(){var Y,te,ue,st;return ve++,Y=q(),Y===n&&(Y=Mu()),Y===n&&(Y=V,ne(),t.charCodeAt(V)===40?(te=l,V++):(te=n,ve===0&&Ue(N)),te!==n?(ue=tr(),ue!==n?(t.charCodeAt(V)===41?(st=c,V++):(st=n,ve===0&&Ue(D)),st!==n?(ne(),ce=Y,Y=Z(ue)):(V=Y,Y=n)):(V=Y,Y=n)):(V=Y,Y=n)),ve--,Y===n&&ve===0&&Ue(k),Y}function Mu(){var Y,te,ue;if(ve++,Y=V,ne(),te=[],h.test(t.charAt(V))?(ue=t.charAt(V),V++):(ue=n,ve===0&&Ue(L)),ue!==n)for(;ue!==n;)te.push(ue),h.test(t.charAt(V))?(ue=t.charAt(V),V++):(ue=n,ve===0&&Ue(L));else te=n;return te!==n?(ue=ne(),ce=Y,Y=I()):(V=Y,Y=n),ve--,Y===n&&ve===0&&Ue(A),Y}function q(){var Y,te,ue,st,tt;if(ve++,Y=V,ne(),te=V,t.charCodeAt(V)===39?(ue=u,V++):(ue=n,ve===0&&Ue(K)),ue!==n){if(st=[],p.test(t.charAt(V))?(tt=t.charAt(V),V++):(tt=n,ve===0&&Ue(X)),tt!==n)for(;tt!==n;)st.push(tt),p.test(t.charAt(V))?(tt=t.charAt(V),V++):(tt=n,ve===0&&Ue(X));else st=n;st!==n?(t.charCodeAt(V)===39?(tt=u,V++):(tt=n,ve===0&&Ue(K)),tt!==n?(ue=[ue,st,tt],te=ue):(V=te,te=n)):(V=te,te=n)}else V=te,te=n;if(te===n)if(te=V,t.charCodeAt(V)===34?(ue=d,V++):(ue=n,ve===0&&Ue(H)),ue!==n){if(st=[],m.test(t.charAt(V))?(tt=t.charAt(V),V++):(tt=n,ve===0&&Ue(U)),tt!==n)for(;tt!==n;)st.push(tt),m.test(t.charAt(V))?(tt=t.charAt(V),V++):(tt=n,ve===0&&Ue(U));else st=n;st!==n?(t.charCodeAt(V)===34?(tt=d,V++):(tt=n,ve===0&&Ue(H)),tt!==n?(ue=[ue,st,tt],te=ue):(V=te,te=n)):(V=te,te=n)}else V=te,te=n;return te!==n?(ue=ne(),ce=Y,Y=se()):(V=Y,Y=n),ve--,Y===n&&ve===0&&Ue($),Y}function ne(){var Y,te;for(ve++,Y=[],g.test(t.charAt(V))?(te=t.charAt(V),V++):(te=n,ve===0&&Ue(R));te!==n;)Y.push(te),g.test(t.charAt(V))?(te=t.charAt(V),V++):(te=n,ve===0&&Ue(R));return ve--,te=n,ve===0&&Ue(G),Y}if(qt=s(),qt!==n&&V===t.length)return qt;throw qt!==n&&V<t.length&&Ue(Ps()),er(Ne,we<t.length?t.charAt(we):null,we<t.length?Dn(we,we+1):Dn(we,we))}class rj extends Error{constructor(e,n=400){super(JSON.stringify(e,null,2)),this.code=n,this.message=e;try{this.message_string=JSON.stringify(this.message,null,2)}catch{this.message_string=":("}}toString(){return this.message_string}}const mp=(t,e,n=400)=>{if(!t)throw new rj([{message:e}],n)},ij=(t,e="-")=>{if(typeof t!="string")return;let n=t.trim();if(n!==""&&(n=n.toLowerCase().match(/[\p{L}\d]+/gu).join(e),n.length!=0))return n},Db="sortBy",Ob="order",s4="limit",a4="limitToLast",o4="vql",Mb="startAt",Ib="startAfter",Lb="endAt",Pb="endBefore",Rb="expand",gp=(t="")=>{if(!t)return;const e=/(^[^\w]+)/g,n=/([^\w]+$)/g;let r=t.match(e),i=t.match(n),s=t.substring((r==null?void 0:r[0].length)??0);if(s=s.substring(0,s.length-((i==null?void 0:i[0].length)??0)),s!=="")return s.split(",").map(a=>{const o=a.split(":");return[o[0].trim(),o.slice(1).join(":").trim()]})},sj=(t,e=["*"])=>{var n,r;return((r=(n=t.get(Rb))==null?void 0:n.replace(/[()]/g,"").split(","))==null?void 0:r.map(i=>i.trim()).filter(Boolean))??e},aj=t=>(t??"(updated_at, id)").replace(/[()]/g,"").split(",").map(e=>e.trim()).filter(Boolean),oj=(t="desc")=>t==="asc"?"asc":"desc",lj=t=>{t=t instanceof URLSearchParams?t:new URLSearchParams(t);const e={};e.expand=sj(t),e.limit=parseInt(t.get(s4))?Math.abs(parseInt(t.get(s4))):void 0,e.limitToLast=parseInt(t.get(a4))?Math.abs(parseInt(t.get(a4))):void 0,!e.limitToLast&&!e.limit&&(e.limit=5);try{const a=t.get(o4);a&&(e.vqlParsed=nj(a))}catch(a){console.log(a),mp(!1,"VQL parsing failed",401)}e.vql=t.get(o4),e.startAt=gp(t.get(Mb)),e.startAfter=gp(t.get(Ib)),mp(!(e.startAt&&e.startAfter),"Cannot set both startAt and startAfter",401),e.endAt=gp(t.get(Lb)),e.endBefore=gp(t.get(Pb)),mp(!(e.endAt&&e.endBefore),"Cannot set both endAt and endAfter",401);const n=e.startAt||e.startAfter,r=e.endAt||e.endBefore,i=((n==null?void 0:n.length)??0)<((r==null?void 0:r.length)??0)?n:r,s=i===n?r:n;if(n&&r)for(let a=0;a<i.length;a++){const o=i[a][0],l=s[a][0];mp(o===l,`non matching keys \`${o}\`!==\`${l}\` in range cursors`,401)}return e.sortBy=aj(t.get(Db)),e.order=oj(t.get(Ob)),s&&(s!=null&&s.length)&&(e.sortBy=s.map(([a,o],l)=>a)),e},l4=t=>"("+t.join(",")+")",cj=t=>{const e=t.map(n=>`${n[0]}:${n[1]}`);return l4(e)},os=t=>{const e=new URLSearchParams;return t.order=(t==null?void 0:t.order)??"desc",t.sortBy=(t==null?void 0:t.sortBy)??["updated_at","id"],t.expand=(t==null?void 0:t.expand)??["*"],!t.limit&&!t.limitToLast&&(t.limit=5),[{cursor:t.endAt,key:Lb},{cursor:t.endBefore,key:Pb},{cursor:t.startAt,key:Mb},{cursor:t.startAfter,key:Ib}].filter(n=>{var r;return!!n.cursor&&((r=n.cursor)==null?void 0:r.length)}).forEach(n=>{e.set(n.key,cj(n.cursor))}),e.set(Ob,t.order),e.set(Db,l4(t.sortBy)),e.set(Rb,l4(t.expand)),t.vql&&e.set(o4,t.vql),t.limit&&e.set(s4,t.limit.toString()),t.limitToLast&&e.set(a4,t.limitToLast.toString()),e},jb=t=>{if(typeof t!="string")return;let e=t.trim();if(e!==""&&(e=e.toLowerCase().match(/[\p{L}\d]+/gu).join("-"),e.length!=0))return e},uj=(t,e)=>{if(!t)throw e},D1=(t,e)=>{var r;let n=(r=t==null?void 0:t.endpoint)==null?void 0:r.trim();return n=n!=null&&n.endsWith("/")?n.slice(0,-1):n,e=e!=null&&e.startsWith("/")?e.slice(1):e,n?`${n}/api/${e}`:`/api/${e}`},Ga=async(t,e,n={})=>{const r=await t.auth.working_auth_token(),i=(t.auth.authStrategy==="apikey"?"Basic":"Bearer")+` ${r}`;return await fetch(D1(t.config,e),{...n,headers:{...(n==null?void 0:n.headers)??{},Authorization:i}})},sn=async(t,e,n={})=>{const r=await Ga(t,e,n),i=r.ok;let s;try{s=await r.json()}catch(a){console.log("fetchApiWithAuth.json()",a)}if(!i)throw s;return s};async function el(t,e,n){return sn(t,`${e}/${n}`,{method:"get"})}async function Fb(t,e,n){return sn(t,`${e}`,{method:"post",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async function c4(t,e,n){return sn(t,`${e}/${n}`,{method:"delete"})}async function yp(t,e,n={}){const r=os(n);return sn(t,`${e}?${r.toString()}`,{method:"get"})}class Tr{constructor(e,n){_i(this,Of);_i(this,Mf);Lo(this,Of,e),Lo(this,Mf,n)}async get(e){return el(this.sdk,this.base_name,e)}async upsert(e){return Fb(this.sdk,this.base_name,e)}async remove(e){return c4(this.sdk,this.base_name,e)}async list(e){return yp(this.sdk,this.base_name,e)}get base_name(){return ft(this,Mf)}get sdk(){return ft(this,Of)}}Of=new WeakMap,Mf=new WeakMap,typeof TextDecoder=="function"&&new TextDecoder,typeof TextEncoder=="function"&&new TextEncoder;const dj=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");(t=>{let e={};return t.forEach((n,r)=>e[n]=r),e})(dj),String.fromCharCode.bind(String),typeof Uint8Array.from=="function"&&Uint8Array.from.bind(Uint8Array);var Xe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Xe||(Xe={}));var u4;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(u4||(u4={}));const ye=Xe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ka=t=>{switch(typeof t){case"undefined":return ye.undefined;case"string":return ye.string;case"number":return isNaN(t)?ye.nan:ye.number;case"boolean":return ye.boolean;case"function":return ye.function;case"bigint":return ye.bigint;case"symbol":return ye.symbol;case"object":return Array.isArray(t)?ye.array:t===null?ye.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ye.promise:typeof Map<"u"&&t instanceof Map?ye.map:typeof Set<"u"&&t instanceof Set?ye.set:typeof Date<"u"&&t instanceof Date?ye.date:ye.object;default:return ye.unknown}},ie=Xe.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"]),fj=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Sr extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(a))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof Sr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Xe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Sr.create=t=>new Sr(t);const Cc=(t,e)=>{let n;switch(t.code){case ie.invalid_type:t.received===ye.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Xe.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${Xe.joinValues(t.keys,", ")}`;break;case ie.invalid_union:n="Invalid input";break;case ie.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Xe.joinValues(t.options)}`;break;case ie.invalid_enum_value:n=`Invalid enum value. Expected ${Xe.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:n="Invalid function arguments";break;case ie.invalid_return_type:n="Invalid function return type";break;case ie.invalid_date:n="Invalid date";break;case ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Xe.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ie.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ie.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ie.custom:n="Invalid input";break;case ie.invalid_intersection_types:n="Intersection results could not be merged";break;case ie.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:n="Number must be finite";break;default:n=e.defaultError,Xe.assertNever(t)}return{message:n}};let Bb=Cc;function hj(t){Bb=t}function vp(){return Bb}const xp=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(a,{data:e,defaultError:o}).message;return{...i,path:s,message:o}},pj=[];function me(t,e){const n=vp(),r=xp({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Cc?void 0:Cc].filter(i=>!!i)});t.common.issues.push(r)}class Fn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Oe;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return Fn.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return Oe;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}}const Oe=Object.freeze({status:"aborted"}),Tc=t=>({status:"dirty",value:t}),Kn=t=>({status:"valid",value:t}),d4=t=>t.status==="aborted",f4=t=>t.status==="dirty",O1=t=>t.status==="valid",M1=t=>typeof Promise<"u"&&t instanceof Promise;function _p(t,e,n,r){if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Hb(t,e,n,r,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var ke;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ke||(ke={}));var I1,L1;class ls{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}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 zb=(t,e)=>{if(O1(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 n=new Sr(t.common.issues);return this._error=n,this._error}}};function Le(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{var l,c;const{message:u}=t;return a.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:o.defaultError}},description:i}}class je{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.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Ka(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Ka(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Fn,ctx:{common:e.parent.common,data:e.data,parsedType:Ka(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(M1(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ka(e)},s=this._parseSync({data:e,path:i.path,parent:i});return zb(i,s)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ka(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(M1(i)?i:Promise.resolve(i));return zb(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:ie.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Oi({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return us.create(this,this._def)}nullable(){return Xa.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Di.create(this,this._def)}promise(){return Dc.create(this,this._def)}or(e){return F1.create([this,e],this._def)}and(e){return B1.create(this,e,this._def)}transform(e){return new Oi({...Le(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new V1({...Le(this._def),innerType:this,defaultValue:n,typeName:Ae.ZodDefault})}brand(){return new m4({typeName:Ae.ZodBranded,type:this,...Le(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new Y1({...Le(this._def),innerType:this,catchValue:n,typeName:Ae.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return W1.create(this,e)}readonly(){return G1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const mj=/^c[^\s-]{8,}$/i,gj=/^[0-9a-z]+$/,yj=/^[0-9A-HJKMNP-TV-Z]{26}$/,vj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xj=/^[a-z0-9_-]{21}$/i,_j=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let h4;const Ej=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kj=/^(([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})))$/,Cj=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ub="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Tj=new RegExp(`^${Ub}$`);function $b(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Sj(t){return new RegExp(`^${$b(t)}$`)}function Vb(t){let e=`${Ub}T${$b(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Nj(t,e){return!!((e==="v4"||!e)&&Ej.test(t)||(e==="v6"||!e)&&kj.test(t))}class Ai extends je{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ye.string){const s=this._getOrReturnCtx(e);return me(s,{code:ie.invalid_type,expected:ye.string,received:s.parsedType}),Oe}const r=new Fn;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),me(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),me(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?me(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&me(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")bj.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"email",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")h4||(h4=new RegExp(wj,"u")),h4.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"emoji",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")vj.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"uuid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")xj.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"nanoid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")mj.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"cuid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")gj.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"cuid2",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")yj.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"ulid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),me(i,{validation:"url",code:ie.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"regex",code:ie.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),me(i,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),me(i,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),me(i,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Vb(s).test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{code:ie.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?Tj.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{code:ie.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Sj(s).test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{code:ie.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?_j.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"duration",code:ie.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Nj(e.data,s.version)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"ip",code:ie.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Cj.test(e.data)||(i=this._getOrReturnCtx(e,i),me(i,{validation:"base64",code:ie.invalid_string,message:s.message}),r.dirty()):Xe.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:ie.invalid_string,...ke.errToObj(r)})}_addCheck(e){return new Ai({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ke.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ke.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ke.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ke.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ke.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ke.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ke.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ke.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ke.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ke.errToObj(e)})}datetime(e){var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...ke.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ke.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ke.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...ke.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...ke.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...ke.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...ke.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...ke.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...ke.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...ke.errToObj(n)})}nonempty(e){return this.min(1,ke.errToObj(e))}trim(){return new Ai({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ai({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ai({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}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 isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ai.create=t=>{var e;return new Ai({checks:[],typeName:Ae.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Le(t)})};function Aj(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}class qa extends je{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)!==ye.number){const s=this._getOrReturnCtx(e);return me(s,{code:ie.invalid_type,expected:ye.number,received:s.parsedType}),Oe}let r;const i=new Fn;for(const s of this._def.checks)s.kind==="int"?Xe.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),me(r,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),me(r,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),me(r,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Aj(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),me(r,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),me(r,{code:ie.not_finite,message:s.message}),i.dirty()):Xe.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ke.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ke.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ke.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ke.toString(n))}setLimit(e,n,r,i){return new qa({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ke.toString(i)}]})}_addCheck(e){return new qa({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ke.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ke.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ke.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ke.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ke.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Xe.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}qa.create=t=>new qa({checks:[],typeName:Ae.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Le(t)});class Qa extends je{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)!==ye.bigint){const s=this._getOrReturnCtx(e);return me(s,{code:ie.invalid_type,expected:ye.bigint,received:s.parsedType}),Oe}let r;const i=new Fn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),me(r,{code:ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),me(r,{code:ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),me(r,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Xe.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ke.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ke.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ke.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ke.toString(n))}setLimit(e,n,r,i){return new Qa({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ke.toString(i)}]})}_addCheck(e){return new Qa({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ke.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ke.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Qa.create=t=>{var e;return new Qa({checks:[],typeName:Ae.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Le(t)})};class P1 extends je{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ye.boolean){const r=this._getOrReturnCtx(e);return me(r,{code:ie.invalid_type,expected:ye.boolean,received:r.parsedType}),Oe}return Kn(e.data)}}P1.create=t=>new P1({typeName:Ae.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Le(t)});class tl extends je{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ye.date){const s=this._getOrReturnCtx(e);return me(s,{code:ie.invalid_type,expected:ye.date,received:s.parsedType}),Oe}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return me(s,{code:ie.invalid_date}),Oe}const r=new Fn;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),me(i,{code:ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),me(i,{code:ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Xe.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new tl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ke.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ke.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}tl.create=t=>new tl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Ae.ZodDate,...Le(t)});class bp extends je{_parse(e){if(this._getType(e)!==ye.symbol){const r=this._getOrReturnCtx(e);return me(r,{code:ie.invalid_type,expected:ye.symbol,received:r.parsedType}),Oe}return Kn(e.data)}}bp.create=t=>new bp({typeName:Ae.ZodSymbol,...Le(t)});class R1 extends je{_parse(e){if(this._getType(e)!==ye.undefined){const r=this._getOrReturnCtx(e);return me(r,{code:ie.invalid_type,expected:ye.undefined,received:r.parsedType}),Oe}return Kn(e.data)}}R1.create=t=>new R1({typeName:Ae.ZodUndefined,...Le(t)});class j1 extends je{_parse(e){if(this._getType(e)!==ye.null){const r=this._getOrReturnCtx(e);return me(r,{code:ie.invalid_type,expected:ye.null,received:r.parsedType}),Oe}return Kn(e.data)}}j1.create=t=>new j1({typeName:Ae.ZodNull,...Le(t)});class Sc extends je{constructor(){super(...arguments),this._any=!0}_parse(e){return Kn(e.data)}}Sc.create=t=>new Sc({typeName:Ae.ZodAny,...Le(t)});class nl extends je{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Kn(e.data)}}nl.create=t=>new nl({typeName:Ae.ZodUnknown,...Le(t)});class Ks extends je{_parse(e){const n=this._getOrReturnCtx(e);return me(n,{code:ie.invalid_type,expected:ye.never,received:n.parsedType}),Oe}}Ks.create=t=>new Ks({typeName:Ae.ZodNever,...Le(t)});class wp extends je{_parse(e){if(this._getType(e)!==ye.undefined){const r=this._getOrReturnCtx(e);return me(r,{code:ie.invalid_type,expected:ye.void,received:r.parsedType}),Oe}return Kn(e.data)}}wp.create=t=>new wp({typeName:Ae.ZodVoid,...Le(t)});class Di extends je{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ye.array)return me(n,{code:ie.invalid_type,expected:ye.array,received:n.parsedType}),Oe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(a||o)&&(me(n,{code:a?ie.too_big:ie.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(me(n,{code:ie.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(me(n,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new ls(n,a,n.path,o)))).then(a=>Fn.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new ls(n,a,n.path,o)));return Fn.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Di({...this._def,minLength:{value:e,message:ke.toString(n)}})}max(e,n){return new Di({...this._def,maxLength:{value:e,message:ke.toString(n)}})}length(e,n){return new Di({...this._def,exactLength:{value:e,message:ke.toString(n)}})}nonempty(e){return this.min(1,e)}}Di.create=(t,e)=>new Di({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...Le(e)});function Nc(t){if(t instanceof jt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=us.create(Nc(r))}return new jt({...t._def,shape:()=>e})}else return t instanceof Di?new Di({...t._def,type:Nc(t.element)}):t instanceof us?us.create(Nc(t.unwrap())):t instanceof Xa?Xa.create(Nc(t.unwrap())):t instanceof cs?cs.create(t.items.map(e=>Nc(e))):t}class jt extends je{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(),n=Xe.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ye.object){const c=this._getOrReturnCtx(e);return me(c,{code:ie.invalid_type,expected:ye.object,received:c.parsedType}),Oe}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ks&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||o.push(c);const l=[];for(const c of a){const u=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ls(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Ks){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(me(i,{code:ie.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ls(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,h=await u.value;c.push({key:d,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>Fn.mergeObjectSync(r,c)):Fn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ke.errToObj,new jt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,a,o;const l=(a=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(o=ke.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new jt({...this._def,unknownKeys:"strip"})}passthrough(){return new jt({...this._def,unknownKeys:"passthrough"})}extend(e){return new jt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new jt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ae.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new jt({...this._def,catchall:e})}pick(e){const n={};return Xe.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new jt({...this._def,shape:()=>n})}omit(e){const n={};return Xe.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new jt({...this._def,shape:()=>n})}deepPartial(){return Nc(this)}partial(e){const n={};return Xe.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new jt({...this._def,shape:()=>n})}required(e){const n={};return Xe.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof us;)s=s._def.innerType;n[r]=s}}),new jt({...this._def,shape:()=>n})}keyof(){return Yb(Xe.objectKeys(this.shape))}}jt.create=(t,e)=>new jt({shape:()=>t,unknownKeys:"strip",catchall:Ks.create(),typeName:Ae.ZodObject,...Le(e)}),jt.strictCreate=(t,e)=>new jt({shape:()=>t,unknownKeys:"strict",catchall:Ks.create(),typeName:Ae.ZodObject,...Le(e)}),jt.lazycreate=(t,e)=>new jt({shape:t,unknownKeys:"strip",catchall:Ks.create(),typeName:Ae.ZodObject,...Le(e)});class F1 extends je{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new Sr(o.ctx.common.issues));return me(n,{code:ie.invalid_union,unionErrors:a}),Oe}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(l=>new Sr(l));return me(n,{code:ie.invalid_union,unionErrors:o}),Oe}}get options(){return this._def.options}}F1.create=(t,e)=>new F1({options:t,typeName:Ae.ZodUnion,...Le(e)});const qs=t=>t instanceof z1?qs(t.schema):t instanceof Oi?qs(t.innerType()):t instanceof U1?[t.value]:t instanceof Za?t.options:t instanceof $1?Xe.objectValues(t.enum):t instanceof V1?qs(t._def.innerType):t instanceof R1?[void 0]:t instanceof j1?[null]:t instanceof us?[void 0,...qs(t.unwrap())]:t instanceof Xa?[null,...qs(t.unwrap())]:t instanceof m4||t instanceof G1?qs(t.unwrap()):t instanceof Y1?qs(t._def.innerType):[];class Ep extends je{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ye.object)return me(n,{code:ie.invalid_type,expected:ye.object,received:n.parsedType}),Oe;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(me(n,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const a=qs(s.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of a){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,s)}}return new Ep({typeName:Ae.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Le(r)})}}function p4(t,e){const n=Ka(t),r=Ka(e);if(t===e)return{valid:!0,data:t};if(n===ye.object&&r===ye.object){const i=Xe.objectKeys(e),s=Xe.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const l=p4(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===ye.array&&r===ye.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],l=p4(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===ye.date&&r===ye.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class B1 extends je{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(d4(s)||d4(a))return Oe;const o=p4(s.value,a.value);return o.valid?((f4(s)||f4(a))&&n.dirty(),{status:n.value,value:o.data}):(me(r,{code:ie.invalid_intersection_types}),Oe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}B1.create=(t,e,n)=>new B1({left:t,right:e,typeName:Ae.ZodIntersection,...Le(n)});class cs extends je{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.array)return me(r,{code:ie.invalid_type,expected:ye.array,received:r.parsedType}),Oe;if(r.data.length<this._def.items.length)return me(r,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Oe;!this._def.rest&&r.data.length>this._def.items.length&&(me(r,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new ls(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>Fn.mergeArray(n,a)):Fn.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new cs({...this._def,rest:e})}}cs.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new cs({items:t,typeName:Ae.ZodTuple,rest:null,...Le(e)})};class H1 extends je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.object)return me(r,{code:ie.invalid_type,expected:ye.object,received:r.parsedType}),Oe;const i=[],s=this._def.keyType,a=this._def.valueType;for(const o in r.data)i.push({key:s._parse(new ls(r,o,r.path,o)),value:a._parse(new ls(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?Fn.mergeObjectAsync(n,i):Fn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof je?new H1({keyType:e,valueType:n,typeName:Ae.ZodRecord,...Le(r)}):new H1({keyType:Ai.create(),valueType:e,typeName:Ae.ZodRecord,...Le(n)})}}class kp extends je{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.map)return me(r,{code:ie.invalid_type,expected:ye.map,received:r.parsedType}),Oe;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],c)=>({key:i._parse(new ls(r,o,r.path,[c,"key"])),value:s._parse(new ls(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Oe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Oe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}}kp.create=(t,e,n)=>new kp({valueType:e,keyType:t,typeName:Ae.ZodMap,...Le(n)});class rl extends je{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ye.set)return me(r,{code:ie.invalid_type,expected:ye.set,received:r.parsedType}),Oe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(me(r,{code:ie.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(me(r,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Oe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>s._parse(new ls(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new rl({...this._def,minSize:{value:e,message:ke.toString(n)}})}max(e,n){return new rl({...this._def,maxSize:{value:e,message:ke.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}rl.create=(t,e)=>new rl({valueType:t,minSize:null,maxSize:null,typeName:Ae.ZodSet,...Le(e)});class Ac extends je{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ye.function)return me(n,{code:ie.invalid_type,expected:ye.function,received:n.parsedType}),Oe;function r(o,l){return xp({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vp(),Cc].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function i(o,l){return xp({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,vp(),Cc].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Dc){const o=this;return Kn(async function(...l){const c=new Sr([]),u=await o._def.args.parseAsync(l,s).catch(p=>{throw c.addIssue(r(l,p)),c}),d=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(d,s).catch(p=>{throw c.addIssue(i(d,p)),c})})}else{const o=this;return Kn(function(...l){const c=o._def.args.safeParse(l,s);if(!c.success)throw new Sr([r(l,c.error)]);const u=Reflect.apply(a,this,c.data),d=o._def.returns.safeParse(u,s);if(!d.success)throw new Sr([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ac({...this._def,args:cs.create(e).rest(nl.create())})}returns(e){return new Ac({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Ac({args:e||cs.create([]).rest(nl.create()),returns:n||nl.create(),typeName:Ae.ZodFunction,...Le(r)})}}class z1 extends je{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}z1.create=(t,e)=>new z1({getter:t,typeName:Ae.ZodLazy,...Le(e)});class U1 extends je{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return me(n,{received:n.data,code:ie.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:e.data}}get value(){return this._def.value}}U1.create=(t,e)=>new U1({value:t,typeName:Ae.ZodLiteral,...Le(e)});function Yb(t,e){return new Za({values:t,typeName:Ae.ZodEnum,...Le(e)})}class Za extends je{constructor(){super(...arguments),I1.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return me(n,{expected:Xe.joinValues(r),received:n.parsedType,code:ie.invalid_type}),Oe}if(_p(this,I1)||Hb(this,I1,new Set(this._def.values)),!_p(this,I1).has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return me(n,{received:n.data,code:ie.invalid_enum_value,options:r}),Oe}return Kn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Za.create(e,{...this._def,...n})}exclude(e,n=this._def){return Za.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}I1=new WeakMap,Za.create=Yb;class $1 extends je{constructor(){super(...arguments),L1.set(this,void 0)}_parse(e){const n=Xe.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ye.string&&r.parsedType!==ye.number){const i=Xe.objectValues(n);return me(r,{expected:Xe.joinValues(i),received:r.parsedType,code:ie.invalid_type}),Oe}if(_p(this,L1)||Hb(this,L1,new Set(Xe.getValidEnumValues(this._def.values))),!_p(this,L1).has(e.data)){const i=Xe.objectValues(n);return me(r,{received:r.data,code:ie.invalid_enum_value,options:i}),Oe}return Kn(e.data)}get enum(){return this._def.values}}L1=new WeakMap,$1.create=(t,e)=>new $1({values:t,typeName:Ae.ZodNativeEnum,...Le(e)});class Dc extends je{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ye.promise&&n.common.async===!1)return me(n,{code:ie.invalid_type,expected:ye.promise,received:n.parsedType}),Oe;const r=n.parsedType===ye.promise?n.data:Promise.resolve(n.data);return Kn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Dc.create=(t,e)=>new Dc({type:t,typeName:Ae.ZodPromise,...Le(e)});class Oi extends je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{me(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);if(r.common.async)return Promise.resolve(a).then(async o=>{if(n.value==="aborted")return Oe;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?Oe:l.status==="dirty"||n.value==="dirty"?Tc(l.value):l});{if(n.value==="aborted")return Oe;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?Oe:o.status==="dirty"||n.value==="dirty"?Tc(o.value):o}}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Oe:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?Oe:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!O1(a))return a;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>O1(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):a);Xe.assertNever(i)}}Oi.create=(t,e,n)=>new Oi({schema:t,typeName:Ae.ZodEffects,effect:e,...Le(n)}),Oi.createWithPreprocess=(t,e,n)=>new Oi({schema:e,effect:{type:"preprocess",transform:t},typeName:Ae.ZodEffects,...Le(n)});class us extends je{_parse(e){return this._getType(e)===ye.undefined?Kn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}us.create=(t,e)=>new us({innerType:t,typeName:Ae.ZodOptional,...Le(e)});class Xa extends je{_parse(e){return this._getType(e)===ye.null?Kn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xa.create=(t,e)=>new Xa({innerType:t,typeName:Ae.ZodNullable,...Le(e)});class V1 extends je{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ye.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}V1.create=(t,e)=>new V1({innerType:t,typeName:Ae.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Le(e)});class Y1 extends je{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return M1(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Y1.create=(t,e)=>new Y1({innerType:t,typeName:Ae.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Le(e)});class Cp extends je{_parse(e){if(this._getType(e)!==ye.nan){const r=this._getOrReturnCtx(e);return me(r,{code:ie.invalid_type,expected:ye.nan,received:r.parsedType}),Oe}return{status:"valid",value:e.data}}}Cp.create=t=>new Cp({typeName:Ae.ZodNaN,...Le(t)});const Dj=Symbol("zod_brand");class m4 extends je{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class W1 extends je{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Oe:s.status==="dirty"?(n.dirty(),Tc(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Oe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new W1({in:e,out:n,typeName:Ae.ZodPipeline})}}class G1 extends je{_parse(e){const n=this._def.innerType._parse(e),r=i=>(O1(i)&&(i.value=Object.freeze(i.value)),i);return M1(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}G1.create=(t,e)=>new G1({innerType:t,typeName:Ae.ZodReadonly,...Le(e)});function Wb(t,e={},n){return t?Sc.create().superRefine((r,i)=>{var s,a;if(!t(r)){const o=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(a=(s=o.fatal)!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:!0,c=typeof o=="string"?{message:o}:o;i.addIssue({code:"custom",...c,fatal:l})}}):Sc.create()}const Oj={object:jt.lazycreate};var Ae;(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",t.ZodReadonly="ZodReadonly"})(Ae||(Ae={}));const Mj=(t,e={message:`Input not instance of ${t.name}`})=>Wb(n=>n instanceof t,e),Gb=Ai.create,Kb=qa.create,Ij=Cp.create,Lj=Qa.create,qb=P1.create,Pj=tl.create,Rj=bp.create,jj=R1.create,Fj=j1.create,Bj=Sc.create,Hj=nl.create,zj=Ks.create,Uj=wp.create,$j=Di.create,Vj=jt.create,Yj=jt.strictCreate,Wj=F1.create,Gj=Ep.create,Kj=B1.create,qj=cs.create,Qj=H1.create,Zj=kp.create,Xj=rl.create,Jj=Ac.create,eF=z1.create,tF=U1.create,nF=Za.create,rF=$1.create,iF=Dc.create,Qb=Oi.create,sF=us.create,aF=Xa.create,oF=Oi.createWithPreprocess,lF=W1.create;var E=Object.freeze({__proto__:null,defaultErrorMap:Cc,setErrorMap:hj,getErrorMap:vp,makeIssue:xp,EMPTY_PATH:pj,addIssueToContext:me,ParseStatus:Fn,INVALID:Oe,DIRTY:Tc,OK:Kn,isAborted:d4,isDirty:f4,isValid:O1,isAsync:M1,get util(){return Xe},get objectUtil(){return u4},ZodParsedType:ye,getParsedType:Ka,ZodType:je,datetimeRegex:Vb,ZodString:Ai,ZodNumber:qa,ZodBigInt:Qa,ZodBoolean:P1,ZodDate:tl,ZodSymbol:bp,ZodUndefined:R1,ZodNull:j1,ZodAny:Sc,ZodUnknown:nl,ZodNever:Ks,ZodVoid:wp,ZodArray:Di,ZodObject:jt,ZodUnion:F1,ZodDiscriminatedUnion:Ep,ZodIntersection:B1,ZodTuple:cs,ZodRecord:H1,ZodMap:kp,ZodSet:rl,ZodFunction:Ac,ZodLazy:z1,ZodLiteral:U1,ZodEnum:Za,ZodNativeEnum:$1,ZodPromise:Dc,ZodEffects:Oi,ZodTransformer:Oi,ZodOptional:us,ZodNullable:Xa,ZodDefault:V1,ZodCatch:Y1,ZodNaN:Cp,BRAND:Dj,ZodBranded:m4,ZodPipeline:W1,ZodReadonly:G1,custom:Wb,Schema:je,ZodSchema:je,late:Oj,get ZodFirstPartyTypeKind(){return Ae},coerce:{string:t=>Ai.create({...t,coerce:!0}),number:t=>qa.create({...t,coerce:!0}),boolean:t=>P1.create({...t,coerce:!0}),bigint:t=>Qa.create({...t,coerce:!0}),date:t=>tl.create({...t,coerce:!0})},any:Bj,array:$j,bigint:Lj,boolean:qb,date:Pj,discriminatedUnion:Gj,effect:Qb,enum:nF,function:Jj,instanceof:Mj,intersection:Kj,lazy:eF,literal:tF,map:Zj,nan:Ij,nativeEnum:rF,never:zj,null:Fj,nullable:aF,number:Kb,object:Vj,oboolean:()=>qb().optional(),onumber:()=>Kb().optional(),optional:sF,ostring:()=>Gb().optional(),pipeline:lF,preprocess:oF,promise:iF,record:Qj,set:Xj,strictObject:Yj,string:Gb,symbol:Rj,transformer:Qb,tuple:qj,undefined:jj,union:Wj,unknown:Hj,void:Uj,NEVER:Oe,ZodIssueCode:ie,quotelessJson:fj,ZodError:Sr});const cF=E.object({origin:E.union([E.string(),E.array(E.string())]),allowMethods:E.array(E.string()).optional(),allowHeaders:E.array(E.string()).optional(),exposeHeaders:E.array(E.string()).optional(),maxAge:E.number().optional(),credentials:E.boolean().optional()}),uF=E.object({message:E.string().optional(),code:E.string().optional(),expected:E.string().optional(),received:E.string().optional(),path:E.array(E.string()).optional()});E.object({messages:E.array(uF).optional()});const Tp=E.string(),Sp=E.string(),g4=E.object({created_at:E.string().optional().describe("ISO string creation time"),updated_at:E.string().optional().describe("ISO string update time")}).describe("Timestamps");E.object({search:E.array(E.string()).optional()}).describe("searchable");const dF=E.object({id:E.string().optional().describe("ID")}).describe("with `id`"),fF=E.object({id:E.string().describe("ID")}).describe("with `id`"),ei=E.object({id:E.string().optional().describe("Optional `id`"),handle:E.string().optional().describe("Optional `handle`")}),hF=E.object({key:E.string().describe("The key"),value:E.string().optional().describe("The value")}).describe("Attribute type, a key/value storage"),pF=E.object({iss:E.string(),sub:E.string(),aud:E.string(),exp:E.number(),nbf:E.number(),iat:E.number(),jti:E.string(),roles:E.array(E.string()).describe("User roles and authorizations")}),y4=E.object({email:E.string().email().describe("Email of user"),password:E.string().min(4).max(20).describe("password")}).describe("Auth base type"),mF=E.union([E.literal("admin"),E.literal("user"),E.string()]).describe("Role of authenticated user");y4.describe("Sign in type"),y4.and(E.object({firstname:E.string().optional().describe("(optional) readable `name` of `customer`"),lastname:E.string().optional().describe("(optional) readable `name` of `customer`")})).describe("Sign up type"),E.object({user_id_or_email:E.string().describe("User `ID` or `Email`"),current_password:E.string().describe("Current password"),new_password:E.string().describe("New password"),confirm_new_password:E.string().describe("Again New password for confirmation")}).describe("Change Password Type"),E.object({refresh_token:E.string().describe("A refresh token")}).describe("Refresh token input type");const Zb=E.object({token:E.string().describe("a token (`access` or `refresh`)"),claims:pF.partial().describe("Claims the `JSON Web Token` holds")}).describe("API token with parsed claims");E.object({apikey:E.string().describe("The `apikey` is `base64_uri(apikey@storecraft.api:{password})`.\nIt will be shown only once to the user, at the `backend`, the password hash\nwill be saved, thus, the real password is only known to the user.")}).describe("Result of `auth` `apikey` creation"),E.object({token_type:E.string().describe("The type of token, should be `bearer` or `refresh`"),user_id:E.string().describe("the `ID` of user, example `au_....`"),access_token:Zb.describe("The access token"),refresh_token:Zb.describe("The refresh token")}).describe("Result of `auth` request for `signin` / `signup` / `refresh`");const Mi=fF.extend(g4.shape).extend({media:E.array(E.string()).optional().describe("List of images urls"),attributes:E.array(hF).optional().describe("List of attributes"),tags:E.array(E.string()).optional().describe("List of tags , example ['genere_action', 'rated_M', ...]"),description:E.string().optional().describe("Rich description"),active:E.boolean().optional().describe("Is the entity active ?")});dF.extend(g4.shape).extend({handle:E.string().describe("The key name"),values:E.array(E.string()).describe("List of values, related to the key")}).omit({id:!0,handle:!0}).and(ei).describe("Tag upsert type");const v4=Mi.extend({handle:E.string().describe("The `handle` of the entity"),title:E.string().min(3,"Title should be longer than 3").describe("Title of collection"),active:E.boolean().describe("Is the entity active ?"),published:E.string().optional().describe(`Collections can be exported into
|
172
172
|
json with products, this is the url`)});v4.omit({id:!0,handle:!0}).and(ei).describe("Collection upsert type");const Xb=E.object({option_id:E.string().describe("Variant option id"),value_id:E.string().describe("Variant selected value id")}).describe("Variant option selection type"),gF=E.object({id:E.string().describe("The `id` of the entity"),value:E.string().describe("The text value of the entity")}).describe("Identifiable text entity type"),il=E.object({id:E.string().describe("The `id` of the entity"),handle:E.string().describe("The `handle` of the entity")}).describe("both `id` and `handle` of entity required"),yF=E.object({name:E.string().min(3,"Name should be longer than 3").describe("Variant option name (for example 'Size')"),id:E.string().describe("Variant option id"),values:E.array(gF).describe("Variant option values\n(for example `Small` / `Medium` / `Large` ..)")}).describe("The data of a variant option"),Jb=E.object({Auto:E.object({id:E.literal(0),name:E.string().optional(),name2:E.literal("automatic")}),Manual:E.object({id:E.literal(1),name:E.string().optional(),name2:E.literal("manual")})}).describe(`Discounts can be manual(coupon) or automatic types,
|
173
173
|
see <a href='#DiscountApplicationEnum'>#DiscountApplicationEnum</a>`),ew=E.array(E.object({id:E.string().optional().describe("`p_in_collections` filter, `id` of collection"),title:E.string().optional().describe("`p_in_collections` filter, `title` of collection"),handle:E.string().optional().describe("`p_in_collections` filter, `handle` of the collection")})).describe("Filter for product in collections"),vF=ew.describe("Filter for product not in collections"),tw=E.array(E.object({id:E.string().optional().describe("`p_in_products` filter, `id` of `product`"),title:E.string().optional().describe("`p_in_products` filter, `title` of `product`"),handle:E.string().optional().describe("`p_in_products` filter, `handle` of the `product`")})).describe("Filter for product discount, product in handles"),xF=tw.describe("Filter for product discount, product not in handles"),_F=E.array(E.string()).describe("Filter for product discount, product has tags"),bF=E.array(E.string()).describe("Filter for product discount, NOT has tags");E.object({}).describe(`Filter for product discount,
|
174
|
-
that chooses all products`);const wF=E.object({from:E.number().optional().describe("`p_in_price_range` filter From price"),to:E.number().describe("`p_in_price_range` filter To price")}).describe("Filter for product discount, product in price range"),EF=E.object({from:E.number().optional().describe("`o_subtotal_in_range` filter From price"),to:E.number().optional().describe("`o_subtotal_in_range` filter To price")}).describe("Filter for order discount, subtotal in range"),kF=E.object({from:E.number().optional().describe("`o_items_count_in_range` filter From count"),to:E.number().optional().describe("`o_items_count_in_range` filter To count")}).describe("Filter for order discount, items count in range"),CF=E.object({from:E.string().optional().describe("`o_date_in_range` filter From date `ISO` format"),to:E.string().optional().describe("`o_date_in_range` filter To date `ISO` format")}).describe("Filter for order discount, subtotal in range"),TF=E.array(E.object({id:E.string().describe("`id` of `customer`"),email:E.string().optional().describe("(optional) `email` of `customer`"),firstname:E.string().optional().describe("(optional) readable `name` of `customer`"),lastname:E.string().optional().describe("(optional) readable `name` of `customer`")})).describe("Filter for order discount, order has customer id"),Nr=E.object({any:E.object({id:E.number().optional(),type:E.string().optional(),op:E.string().optional(),name:E.string().optional()}),p_in_collections:E.object({id:E.literal(0),type:E.literal("product"),op:E.literal("p-in-collections"),name:E.string().optional()}),p_not_in_collections:E.object({id:E.literal(1),type:E.literal("product"),op:E.literal("p-not-in-collections"),name:E.string().optional()}),p_in_products:E.object({id:E.literal(2),type:E.literal("product"),op:E.literal("p-in-products"),name:E.string().optional()}),p_not_in_products:E.object({id:E.literal(3),type:E.literal("product"),op:E.literal("p-not-in-products"),name:E.string().optional()}),p_in_tags:E.object({id:E.literal(4),type:E.literal("product"),op:E.literal("p-in-tags"),name:E.string().optional()}),p_not_in_tags:E.object({id:E.literal(5),type:E.literal("product"),op:E.literal("p-not-in-tags"),name:E.string().optional()}),p_all:E.object({id:E.literal(6),type:E.literal("product"),op:E.literal("p-all"),name:E.string().optional()}),p_in_price_range:E.object({id:E.literal(7),type:E.literal("product"),op:E.literal("p-in-price-range"),name:E.string().optional()}),o_subtotal_in_range:E.object({id:E.literal(100),type:E.literal("order"),op:E.literal("o-subtotal-in-range"),name:E.string().optional()}),o_items_count_in_range:E.object({id:E.literal(101),type:E.literal("order"),op:E.literal("o-items-count-in-range"),name:E.string().optional()}),o_date_in_range:E.object({id:E.literal(102),type:E.literal("order"),op:E.literal("o-date-in-range"),name:E.string().optional()}),o_has_customer:E.object({id:E.literal(103),type:E.literal("order"),op:E.literal("o-has-customer"),name:E.string().optional()})}),Oc=E.object({regular:E.object({id:E.literal(0),type:E.literal("regular"),name:E.string().optional()}),bulk:E.object({id:E.literal(1),type:E.literal("bulk"),name:E.string().optional()}),buy_x_get_y:E.object({id:E.literal(2),type:E.literal("buy_x_get_y"),name:E.string().optional()}),order:E.object({id:E.literal(3),type:E.literal("order"),name:E.string().optional()}),bundle:E.object({id:E.literal(4),type:E.literal("bundle"),name:E.string().optional()}),any:E.object({id:E.number().optional(),type:E.string().optional(),name:E.string().optional()})}).describe(
|
175
|
-
see <a href='#DiscountMetaEnum'>#DiscountMetaEnum</a>`),SF=E.object({fixed:E.number().describe("`RegularDiscountExtra` params, Fixed price addition"),percent:E.number().describe("`RegularDiscountExtra` params, Percents off")}).describe("Parameters of a regular discount"),NF=E.object({fixed:E.number().describe("`OrderDiscountExtra` params, Fixed price addition"),percent:E.number().describe("`OrderDiscountExtra` params, Percents off"),free_shipping:E.boolean().optional().describe("`OrderDiscountExtra` params, Do we have free shipping ?")}).describe("Parameters of order discount"),AF=E.object({fixed:E.number().describe("`BulkDiscountExtra` params, Fixed price addition"),percent:E.number().describe("`BulkDiscountExtra` params, Percents off"),qty:E.number().describe("`BulkDiscountExtra` params, The integer quantity\nfor which the discount is given"),recursive:E.boolean().optional().describe("`BulkDiscountExtra` params, Apply the discount as\nmany times as possible")}).describe("Parameters of bulk discount"),DF=E.object({fixed:E.number().describe("`BundleDiscountExtra` params, Fixed price addition"),percent:E.number().describe("`BundleDiscountExtra` params, Percents off"),recursive:E.boolean().optional().describe("`BundleDiscountExtra` params, Apply the discount\nas many times as possible")}).describe("Parameters of bulk discount"),nw=E.object({meta:E.union([Nr.shape.p_all,Nr.shape.p_in_collections,Nr.shape.p_not_in_collections,Nr.shape.p_in_tags,Nr.shape.p_not_in_tags,Nr.shape.p_in_products,Nr.shape.p_not_in_products,Nr.shape.p_in_price_range,Nr.shape.o_date_in_range,Nr.shape.o_has_customer,Nr.shape.o_items_count_in_range,Nr.shape.o_subtotal_in_range,Nr.shape.any]).describe("Meta data related to identifying the filter"),value:E.union([ew,vF,tw,xF,_F,bF,wF,EF,kF,CF,TF]).optional().describe("The filter params")}).describe("Discount filter schema"),Np=Mi.extend({price:E.number().min(0,"Please set a price >= 0").describe("Shipping method price"),title:E.string().min(3,"Title should be longer than 3").describe("Name of shipping method"),handle:E.string().describe("Readable `handle` of shipping")}),rw=Mi.extend({handle:E.string().describe("Unique `handle`"),title:E.string().min(3,"Title should be longer than 3").describe("Title of post"),text:E.string().describe("Rich text of post")}),iw=E.object({firstname:E.string().optional().describe("First name of recipient"),lastname:E.string().optional().describe("Last name of recipient"),phone_number:E.string().regex(/^([+]?d{1,2}[-s]?|)d{3}[-s]?d{3}[-s]?d{4}$ Invalid phone number/).optional().describe("The phone number of the recipient"),company:E.string().optional().describe("Optional company name of recipient"),street1:E.string().optional().describe("Street address 1"),street2:E.string().optional().describe("Street address 2"),city:E.string().optional().describe("City"),country:E.string().optional().describe("Country"),state:E.string().optional().describe("State"),zip_code:E.string().optional().describe("ZIP code"),postal_code:E.string().optional().describe("Postal code")}).describe("Address type");Mi.extend({auth_id:E.string().optional().describe("The `auth id` of the customer. it is the same as\ncustomer `id` with `au` prefix instead"),firstname:E.string().min(1,"Should be longer than 1 characters").optional().describe("Firstname"),lastname:E.string().min(1,"Should be longer than 1 characters").optional().describe("Lastname"),email:E.string().email().describe("Email of customer"),phone_number:E.string().regex(/^([+]?d{1,2}[-s]?|)d{3}[-s]?d{3}[-s]?d{4}$/).optional().describe("The phone number"),address:iw.optional().describe("Address info of customer")}).omit({id:!0,handle:!0}).and(ei).describe("Customer upsert type"),Mi.extend({handle:E.string().describe("Unique handle"),name:E.string().min(1,"Should be longer than 1 characters").describe("Name"),url:E.string().min(1,"Should be longer than 1 characters").describe("It's published public url"),usage:E.array(E.string()).optional().describe("List of assets using this image")}).omit({id:!0,handle:!0}).and(ei).describe("Image upsert type"),Np.omit({id:!0,handle:!0}).and(ei).describe("Shipping upsert type"),rw.omit({id:!0,handle:!0}).and(ei).describe("Post upsert type");const OF=E.union([E.literal("route"),E.literal("url")]).describe("'route' means routing inside admin panel 'url' is linking to a url"),MF=E.object({collection:E.string().describe("Which collection"),document:E.string().describe("Which document")}).describe("route inside admin panel action params"),IF=E.object({new_window:E.boolean().optional().describe("Ppen the url in new window"),url:E.string().describe("The url to open")}).describe("Action params for actions of type 'url'"),LF=E.object({firstname:E.string().optional().describe("First name"),lastname:E.string().optional().describe("Last name"),phone_number:E.string().optional().describe("Phone number"),email:E.string().optional().describe("Email"),customer_id:E.string().optional().describe("Customer `id`")}).describe("Order buyer info"),PF=E.object({id:E.string().describe("`id`"),title:E.string().min(3,"Title should be longer than 3").optional().describe("title"),message:E.union([E.literal("shipping-method-not-found"),E.literal("product-not-exists"),E.literal("product-out-of-stock"),E.literal("product-not-enough-stock"),E.literal("product-inactive")]).optional().describe("message")}).describe(`Checkouts or draft orders might be validated
|
174
|
+
that chooses all products`);const wF=E.object({from:E.number().optional().describe("`p_in_price_range` filter From price"),to:E.number().describe("`p_in_price_range` filter To price")}).describe("Filter for product discount, product in price range"),EF=E.object({from:E.number().optional().describe("`o_subtotal_in_range` filter From price"),to:E.number().optional().describe("`o_subtotal_in_range` filter To price")}).describe("Filter for order discount, subtotal in range"),kF=E.object({from:E.number().optional().describe("`o_items_count_in_range` filter From count"),to:E.number().optional().describe("`o_items_count_in_range` filter To count")}).describe("Filter for order discount, items count in range"),CF=E.object({from:E.string().optional().describe("`o_date_in_range` filter From date `ISO` format"),to:E.string().optional().describe("`o_date_in_range` filter To date `ISO` format")}).describe("Filter for order discount, subtotal in range"),TF=E.array(E.object({id:E.string().describe("`id` of `customer`"),email:E.string().optional().describe("(optional) `email` of `customer`"),firstname:E.string().optional().describe("(optional) readable `name` of `customer`"),lastname:E.string().optional().describe("(optional) readable `name` of `customer`")})).describe("Filter for order discount, order has customer id"),Nr=E.object({any:E.object({id:E.number().optional(),type:E.string().optional(),op:E.string().optional(),name:E.string().optional()}),p_in_collections:E.object({id:E.literal(0),type:E.literal("product"),op:E.literal("p-in-collections"),name:E.string().optional()}),p_not_in_collections:E.object({id:E.literal(1),type:E.literal("product"),op:E.literal("p-not-in-collections"),name:E.string().optional()}),p_in_products:E.object({id:E.literal(2),type:E.literal("product"),op:E.literal("p-in-products"),name:E.string().optional()}),p_not_in_products:E.object({id:E.literal(3),type:E.literal("product"),op:E.literal("p-not-in-products"),name:E.string().optional()}),p_in_tags:E.object({id:E.literal(4),type:E.literal("product"),op:E.literal("p-in-tags"),name:E.string().optional()}),p_not_in_tags:E.object({id:E.literal(5),type:E.literal("product"),op:E.literal("p-not-in-tags"),name:E.string().optional()}),p_all:E.object({id:E.literal(6),type:E.literal("product"),op:E.literal("p-all"),name:E.string().optional()}),p_in_price_range:E.object({id:E.literal(7),type:E.literal("product"),op:E.literal("p-in-price-range"),name:E.string().optional()}),o_subtotal_in_range:E.object({id:E.literal(100),type:E.literal("order"),op:E.literal("o-subtotal-in-range"),name:E.string().optional()}),o_items_count_in_range:E.object({id:E.literal(101),type:E.literal("order"),op:E.literal("o-items-count-in-range"),name:E.string().optional()}),o_date_in_range:E.object({id:E.literal(102),type:E.literal("order"),op:E.literal("o-date-in-range"),name:E.string().optional()}),o_has_customer:E.object({id:E.literal(103),type:E.literal("order"),op:E.literal("o-has-customer"),name:E.string().optional()})}),Oc=E.object({regular:E.object({id:E.literal(0),type:E.literal("regular"),name:E.string().optional()}),bulk:E.object({id:E.literal(1),type:E.literal("bulk"),name:E.string().optional()}),buy_x_get_y:E.object({id:E.literal(2),type:E.literal("buy_x_get_y"),name:E.string().optional()}),order:E.object({id:E.literal(3),type:E.literal("order"),name:E.string().optional()}),bundle:E.object({id:E.literal(4),type:E.literal("bundle"),name:E.string().optional()}),any:E.object({id:E.number().optional(),type:E.string().optional(),name:E.string().optional()})}).describe("Discount meta data,"),SF=E.object({fixed:E.number().describe("`RegularDiscountExtra` params, Fixed price addition"),percent:E.number().describe("`RegularDiscountExtra` params, Percents off")}).describe("Parameters of a regular discount"),NF=E.object({fixed:E.number().describe("`OrderDiscountExtra` params, Fixed price addition"),percent:E.number().describe("`OrderDiscountExtra` params, Percents off"),free_shipping:E.boolean().optional().describe("`OrderDiscountExtra` params, Do we have free shipping ?")}).describe("Parameters of order discount"),AF=E.object({fixed:E.number().describe("`BulkDiscountExtra` params, Fixed price addition"),percent:E.number().describe("`BulkDiscountExtra` params, Percents off"),qty:E.number().describe("`BulkDiscountExtra` params, The integer quantity\nfor which the discount is given"),recursive:E.boolean().optional().describe("`BulkDiscountExtra` params, Apply the discount as\nmany times as possible")}).describe("Parameters of bulk discount"),DF=E.object({fixed:E.number().describe("`BundleDiscountExtra` params, Fixed price addition"),percent:E.number().describe("`BundleDiscountExtra` params, Percents off"),recursive:E.boolean().optional().describe("`BundleDiscountExtra` params, Apply the discount\nas many times as possible")}).describe("Parameters of bulk discount"),nw=E.object({meta:E.union([Nr.shape.p_all,Nr.shape.p_in_collections,Nr.shape.p_not_in_collections,Nr.shape.p_in_tags,Nr.shape.p_not_in_tags,Nr.shape.p_in_products,Nr.shape.p_not_in_products,Nr.shape.p_in_price_range,Nr.shape.o_date_in_range,Nr.shape.o_has_customer,Nr.shape.o_items_count_in_range,Nr.shape.o_subtotal_in_range,Nr.shape.any]).describe("Meta data related to identifying the filter"),value:E.union([ew,vF,tw,xF,_F,bF,wF,EF,kF,CF,TF]).optional().describe("The filter params")}).describe("Discount filter schema"),Np=Mi.extend({price:E.number().min(0,"Please set a price >= 0").describe("Shipping method price"),title:E.string().min(3,"Title should be longer than 3").describe("Name of shipping method"),handle:E.string().describe("Readable `handle` of shipping")}),rw=Mi.extend({handle:E.string().describe("Unique `handle`"),title:E.string().min(3,"Title should be longer than 3").describe("Title of post"),text:E.string().describe("Rich text of post")}),iw=E.object({firstname:E.string().optional().describe("First name of recipient"),lastname:E.string().optional().describe("Last name of recipient"),phone_number:E.string().regex(/^([+]?d{1,2}[-s]?|)d{3}[-s]?d{3}[-s]?d{4}$ Invalid phone number/).optional().describe("The phone number of the recipient"),company:E.string().optional().describe("Optional company name of recipient"),street1:E.string().optional().describe("Street address 1"),street2:E.string().optional().describe("Street address 2"),city:E.string().optional().describe("City"),country:E.string().optional().describe("Country"),state:E.string().optional().describe("State"),zip_code:E.string().optional().describe("ZIP code"),postal_code:E.string().optional().describe("Postal code")}).describe("Address type");Mi.extend({auth_id:E.string().optional().describe("The `auth id` of the customer. it is the same as\ncustomer `id` with `au` prefix instead"),firstname:E.string().min(1,"Should be longer than 1 characters").optional().describe("Firstname"),lastname:E.string().min(1,"Should be longer than 1 characters").optional().describe("Lastname"),email:E.string().email().describe("Email of customer"),phone_number:E.string().regex(/^([+]?d{1,2}[-s]?|)d{3}[-s]?d{3}[-s]?d{4}$/).optional().describe("The phone number"),address:iw.optional().describe("Address info of customer")}).omit({id:!0,handle:!0}).and(ei).describe("Customer upsert type"),Mi.extend({handle:E.string().describe("Unique handle"),name:E.string().min(1,"Should be longer than 1 characters").describe("Name"),url:E.string().min(1,"Should be longer than 1 characters").describe("It's published public url"),usage:E.array(E.string()).optional().describe("List of assets using this image")}).omit({id:!0,handle:!0}).and(ei).describe("Image upsert type"),Np.omit({id:!0,handle:!0}).and(ei).describe("Shipping upsert type"),rw.omit({id:!0,handle:!0}).and(ei).describe("Post upsert type");const OF=E.union([E.literal("route"),E.literal("url")]).describe("'route' means routing inside admin panel 'url' is linking to a url"),MF=E.object({collection:E.string().describe("Which collection"),document:E.string().describe("Which document")}).describe("route inside admin panel action params"),IF=E.object({new_window:E.boolean().optional().describe("Ppen the url in new window"),url:E.string().describe("The url to open")}).describe("Action params for actions of type 'url'"),LF=E.object({firstname:E.string().optional().describe("First name"),lastname:E.string().optional().describe("Last name"),phone_number:E.string().optional().describe("Phone number"),email:E.string().optional().describe("Email"),customer_id:E.string().optional().describe("Customer `id`")}).describe("Order buyer info"),PF=E.object({id:E.string().describe("`id`"),title:E.string().min(3,"Title should be longer than 3").optional().describe("title"),message:E.union([E.literal("shipping-method-not-found"),E.literal("product-not-exists"),E.literal("product-out-of-stock"),E.literal("product-not-enough-stock"),E.literal("product-inactive")]).optional().describe("message")}).describe(`Checkouts or draft orders might be validated
|
176
175
|
in automatic systems`),K1=E.object({created:E.object({id:E.literal(0),name2:E.literal("created"),name:E.string().optional()}),requires_action:E.object({id:E.literal(1),name2:E.literal("requires_action"),name:E.string().optional()}),failed:E.object({id:E.literal(2),name2:E.literal("failed"),name:E.string().optional()}),complete:E.object({id:E.literal(3),name2:E.literal("complete"),name:E.string().optional()}),unknown:E.object({id:E.literal(4),name2:E.literal("unknown"),name:E.string().optional()})}).describe(`Checkout status encapsulate the current state,
|
177
176
|
see <a href='#CheckoutStatusEnum'>#CheckoutStatusEnum</a>`),Qs=E.object({unpaid:E.object({id:E.literal(0),name:E.string().optional(),name2:E.literal("unpaid")}),authorized:E.object({id:E.literal(1),name:E.string().optional(),name2:E.literal("authorized")}),captured:E.object({id:E.literal(2),name:E.string().optional(),name2:E.literal("captured")}),requires_auth:E.object({id:E.literal(3),name:E.string().optional(),name2:E.literal("requires_auth")}),voided:E.object({id:E.literal(4),name:E.string().optional(),name2:E.literal("voided")}),failed:E.object({id:E.literal(5),name:E.string().optional(),name2:E.literal("failed")}),partially_paid:E.object({id:E.literal(6),name:E.string().optional(),name2:E.literal("partially_paid")}),refunded:E.object({id:E.literal(7),name:E.string().optional(),name2:E.literal("refunded")}),partially_refunded:E.object({id:E.literal(8),name:E.string().optional(),name2:E.literal("partially_refunded")}),cancelled:E.object({id:E.literal(9),name:E.string().optional(),name2:E.literal("cancelled")})}).describe(`Payment options encapsulate the current state,
|
178
177
|
see <a href='#PaymentOptionsEnum'>#PaymentOptionsEnum</a>`),q1=E.object({draft:E.object({id:E.literal(0),name2:E.literal("draft"),name:E.string().optional()}),processing:E.object({id:E.literal(1),name2:E.literal("processing"),name:E.string().optional()}),shipped:E.object({id:E.literal(2),name2:E.literal("shipped"),name:E.string().optional()}),fulfilled:E.object({id:E.literal(3),name2:E.literal("fulfilled"),name:E.string().optional()}),cancelled:E.object({id:E.literal(4),name2:E.literal("cancelled"),name:E.string().optional()})}).describe(`Fulfillment options encapsulate the current state,
|
@@ -204,7 +203,7 @@ to discount line items`);E.object({selection:E.array(Xb).describe("A list of sel
|
|
204
203
|
this is an explicit connection, to form a better UX experience`),related_products:E.array(Mc.pick({id:!0,handle:!0})).optional().describe(`List of related products to add the product into,
|
205
204
|
this is an explicit connection, to form a better UX experience`)})).and(ei).describe("Variant upsert type");const XF=E.object({evo:E.array(ZF).optional().describe("Explanation of how discounts stack and change pricing"),shipping_method:Np.partial().optional().describe("Selected shipping method"),taxes:E.array(RF).optional().describe("The taxes collected from the sale"),subtotal_undiscounted:E.number().describe("Subtotal of items price before discounts"),subtotal_discount:E.number().describe("Sum of all discounts at all stages"),subtotal:E.number().describe("`subtotal_undiscounted` - `subtotal_discount`"),total_without_taxes:E.number().optional().describe("`subtotal` + `shipping`"),total:E.number().describe("`subtotal` + `shipping` + `taxes`"),quantity_total:E.number().describe("How many items are eligible"),quantity_discounted:E.number().describe("How many items were discounted"),uid:E.string().optional().describe("Authentication user id"),errors:E.array(jF).optional().describe("Errors")}).describe(`Pricing object exaplins how the pricing of an order
|
206
205
|
was calculated given a stack of automatic discounts, coupons,
|
207
|
-
line items and shipping method`);QF.extend(Mi.shape).extend({status:WF.describe("Status of `checkout`, `fulfillment` and `payment`"),pricing:XF.describe("Pricing information"),validation:E.array(PF).optional().describe("In case the order went through validation"),payment_gateway:GF.optional().describe("Payment gateway info and status")}).omit({id:!0}).and(ei).describe("Order upsert type");const Ic={Auto:{id:0,name:"Automatic",name2:"automatic"},Manual:{id:1,name:"Manual",name2:"manual"}},Jt={any:{},p_in_collections:{id:0,type:"product",op:"p-in-collections",name:"Product In Collection"},p_not_in_collections:{id:1,type:"product",op:"p-not-in-collections",name:"Product not in Collection"},p_in_products:{id:2,type:"product",op:"p-in-products",name:"Product belongs to"},p_not_in_products:{id:3,type:"product",op:"p-not-in-products",name:"Product does not belong to"},p_in_tags:{id:4,type:"product",op:"p-in-tags",name:"Product has Tag"},p_not_in_tags:{id:5,type:"product",op:"p-not-in-tags",name:"Product excludes Tag"},p_all:{id:6,type:"product",op:"p-all",name:"All Products"},p_in_price_range:{id:7,type:"product",op:"p-in-price-range",name:"Product in Price range"},o_subtotal_in_range:{id:100,type:"order",op:"o-subtotal-in-range",name:"Order subtotal in range"},o_items_count_in_range:{id:101,type:"order",op:"o-items-count-in-range",name:"Order items count in range"},o_date_in_range:{id:102,type:"order",op:"o-date-in-range",name:"Order in dates"},o_has_customer:{id:103,type:"order",op:"o-has-customer",name:"Order has Customers"}},Ar={any:{},regular:{id:0,type:"regular",name:"Regular Discount"},bulk:{id:1,type:"bulk",name:"Bulk Discount"},buy_x_get_y:{id:2,type:"buy_x_get_y",name:"Buy X Get Y"},order:{id:3,type:"order",name:"Order Discount"},bundle:{id:4,type:"bundle",name:"Bundle Discount"}},uw={created:{id:0,name2:"created",name:"Created"},requires_action:{id:1,name2:"requires_action",name:"Requires Action"},failed:{id:2,name2:"failed",name:"Failed"},complete:{id:3,name2:"complete",name:"Complete"},unknown:{id:4,name2:"unknown",name:"Unknown"}},_4={draft:{id:0,name2:"draft",name:"Draft"},processing:{id:1,name2:"processing",name:"Processing (Stock Reserved)"},shipped:{id:2,name2:"shipped",name:"Shipped"},fulfilled:{id:3,name2:"fulfilled",name:"Fulfilled"},cancelled:{id:4,name2:"cancelled",name:"Cancelled (Stock returned)"}},b4={unpaid:{id:0,name:"Unpaid",name2:"unpaid"},authorized:{id:1,name:"Authorized",name2:"authorized"},captured:{id:2,name:"Captured",name2:"captured"},requires_auth:{id:3,name:"Requires Authentication",name2:"requires_auth"},voided:{id:4,name:"Voided",name2:"voided"},failed:{id:5,name:"Failed",name2:"failed"},partially_paid:{id:6,name:"Partially paid",name2:"partially_paid"},refunded:{id:7,name:"Refunded",name2:"refunded"},partially_refunded:{id:8,name:"Partially Refunded",name2:"partially_refunded"},cancelled:{id:9,name:"Cancelled",name2:"cancelled"}};class JF{constructor(e){_i(this,Au,new Set);_i(this,Jn);ee(this,"notify_subscribers",()=>{for(let e of ft(this,Au))e({auth:this.currentAuth,isAuthenticated:this.isAuthenticated})});ee(this,"add_sub",e=>(ft(this,Au).add(e),()=>{ft(this,Au).delete(e)}));_i(this,Oo,e=>{this.currentAuth=e,this.notify_subscribers()});ee(this,"signin",async(e,n)=>{const r={email:e,password:n},i=await fetch(D1(ft(this,Jn).config,"/auth/signin"),{method:"post",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}});if(!i.ok){let a={messages:[{message:"auth/error"}]};try{a=await i.json()}catch{}throw a}const s=await i.json();return ft(this,Oo).call(this,s),s});ee(this,"signup",async(e,n,r,i)=>{const s={email:e,password:n,firstname:r,lastname:i},a=await fetch(D1(ft(this,Jn).config,"/auth/signup"),{method:"post",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}});uj(a.ok,"auth/error");const o=await a.json();return ft(this,Oo).call(this,o),o});ee(this,"changePassword",async e=>{const n=await fetch(D1(ft(this,Jn).config,"/auth/change-password"),{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});if(!n.ok){let i={messages:[{message:"auth/error"}]};try{i=await n.json()}catch{}throw i}const r=await n.json();return ft(this,Oo).call(this,r),r});ee(this,"signout",async()=>{console.log("signout"),ft(this,Oo).call(this,void 0)});ee(this,"create_api_key",async()=>(await sn(ft(this,Jn),"/auth/apikeys",{method:"post"})).apikey);ee(this,"get_auth_user",async e=>await sn(ft(this,Jn),`/auth/users/${e}`,{method:"get"}));ee(this,"remove_auth_user",async e=>sn(ft(this,Jn),`/auth/users/${e}`,{method:"delete"}));ee(this,"list_auth_users",async e=>{const n=os(e);return sn(ft(this,Jn),`/auth/users?${n.toString()}`,{method:"get"})});ee(this,"list_api_keys_auth_users",async()=>await sn(ft(this,Jn),"/auth/apikeys",{method:"get"}));Lo(this,Jn,e)}get currentAuth(){var e,n;return(n=(e=ft(this,Jn))==null?void 0:e.config)==null?void 0:n.auth}set currentAuth(e){ft(this,Jn).config.auth=e}init(){}async working_auth_token(e=!1){if(this.currentAuth){if("apikey"in this.currentAuth)return this.currentAuth.apikey;if("access_token"in this.currentAuth)return(e||!this.isAuthenticated)&&await this.reAuthenticateIfNeeded(e),this.currentAuth.access_token.token}}async reAuthenticateIfNeeded(e=!1){if(this.currentAuth&&!(this.isAuthenticated&&!e)&&"access_token"in this.currentAuth){const n=await fetch(D1(ft(this,Jn).config,"/auth/refresh"),{method:"post",body:JSON.stringify({refresh_token:this.currentAuth.refresh_token.token}),headers:{"Content-Type":"application/json"}});let r;return n.ok&&(r=await n.json()),ft(this,Oo).call(this,r),r}}get authStrategy(){if(this.currentAuth){if("apikey"in this.currentAuth)return"apikey";if("access_token"in this.currentAuth)return"jwt"}return"unknown"}get isAuthenticated(){var e,n,r;if(this.currentAuth){if("apikey"in this.currentAuth)return!!this.currentAuth.apikey;if("access_token"in this.currentAuth){const i=(r=(n=(e=this.currentAuth)==null?void 0:e.access_token)==null?void 0:n.claims)==null?void 0:r.exp;return i&&Date.now()<(i-60)*1e3}}return!1}}Au=new WeakMap,Jn=new WeakMap,Oo=new WeakMap;let eB=class extends Tr{constructor(e){super(e,"customers")}},tB=class extends Tr{constructor(e){super(e,"tags")}},nB=class extends Tr{constructor(e){super(e,"templates")}},rB=class extends Tr{constructor(n){super(n,"products");ee(this,"changeStockOfBy",async(n,r)=>(await Ga(this.sdk,`products/${n}?quantityBy=${r}`,{method:"put"})).ok);ee(this,"batchAddProductsToCollection",async(n,r)=>{for(const i of n)await this.upsert({...i,collections:[...i.collections??[],r]})});ee(this,"batchRemoveProductsFromCollection",async(n,r)=>{for(const i of n)await this.upsert({...i,collections:(i.collections??[]).filter(s=>s.id!==r.id)})})}},iB=class extends Tr{constructor(e){super(e,"orders")}},sB=class extends Tr{constructor(e){super(e,"discounts")}},aB=class extends Tr{constructor(n){super(n,"collections");ee(this,"publish",async(n,r=1e3)=>await sn(this.sdk,`collections/${n}/export`,{method:"post"}))}};class oB extends Tr{constructor(e){super(e,"shipping")}}let lB=class extends Tr{constructor(n){super(n,"storefronts");ee(this,"publish",async n=>await sn(this.sdk,`storefronts/${n}/export`,{method:"post"}))}};class cB{constructor(e){_i(this,If);_i(this,Lf,{});ee(this,"isCacheValid",e=>!1);ee(this,"fromCache",e=>{if(this.isCacheValid(e))return ft(this,Lf)[e]});ee(this,"putCache",(e,n)=>{ft(this,Lf)[e]=n});ee(this,"orders",async(e,n)=>{const r=new URLSearchParams;return e&&r.set("fromDay",new Date(e).toISOString()),n&&r.set("toDay",new Date(n).toISOString()),sn(this.sdk,`statistics/orders?${r.toString()}`)});ee(this,"countOf",async(e,n)=>{const r=os(n);return sn(this.sdk,`statistics/count/${e}?${r.toString()}`)});Lo(this,If,e)}get sdk(){return ft(this,If)}}If=new WeakMap,Lf=new WeakMap;let uB=class extends Tr{constructor(e){super(e,"images")}},dB=class extends Tr{constructor(e){super(e,"posts")}};class fB{constructor(e){ee(this,"create",async(e,n)=>(console.log("input",e),await sn(this.sdk,`checkout/create?gateway=${n}`,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})));ee(this,"complete",async e=>await sn(this.sdk,`checkout/${e}/complete`,{method:"post"}));ee(this,"pricing",async e=>await sn(this.sdk,"checkout/pricing",{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));this.sdk=e}}class hB{constructor(e){_i(this,Pf);Lo(this,Pf,e)}get(e){return el(this.sdk,"payments/gateways",e)}list(){return yp(this.sdk,"payments/gateways")}paymentStatusOfOrder(e){return sn(this.sdk,`/payments/status/${e}`,{method:"get"})}invokeAction(e,n){return sn(this.sdk,`/payments/${e}/${n}`,{method:"post"})}get sdk(){return ft(this,Pf)}}Pf=new WeakMap;let pB=class extends Tr{constructor(e){super(e,"settings")}},mB=class extends Tr{constructor(n){super(n,"notifications");ee(this,"upsertBulk",n=>sn(this.sdk,`${this.base_name}`,{method:"post",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}));ee(this,"meta",()=>this.get("_meta"))}};class gB{constructor(e){_i(this,Du,{features:void 0});ee(this,"features",async()=>{if(ft(this,Du).features)return ft(this,Du).features;try{const e=await Ga(this.sdk,"storage",{method:"get"});if(!e.ok)throw new Error;const n=await e.json();return ft(this,Du).features=n,n}catch(e){console.log(e)}return{supports_signed_urls:!1}});ee(this,"getBlobSigned",async e=>{const n=await Ga(this.sdk,`storage/${e}?signed=true`,{method:"get"}),r=n.headers.get("Content-Type");if(!n.ok)throw await n.json();if(r==="application/json"){const i=await n.json();return(await fetch(i.url,{method:i.method,headers:i.headers})).blob()}throw"unknown"});ee(this,"getBlobUnsigned",async e=>{const n=await Ga(this.sdk,`storage/${e}?signed=false`,{method:"get"});if(n.headers.get("Content-Type"),!n.ok)throw await n.json();return n.blob()});ee(this,"getBlob",async e=>(await this.features()).supports_signed_urls?this.getBlobSigned(e):this.getBlobUnsigned(e));ee(this,"getText",e=>this.getBlob(e).then(n=>n.text()));ee(this,"getJson",e=>this.getBlob(e).then(n=>n.text().then(JSON.parse)));ee(this,"getImageObjectURL",e=>this.getBlob(e).then(n=>URL.createObjectURL(n)));ee(this,"getSource",async(e,n=!0)=>{try{if(!e.startsWith("storage://"))return e;const i=e.split("storage://").at(-1),s=await this.getBlob(i);return n?URL.createObjectURL(s):s.text().then(JSON.parse)}catch(r){console.log(r)}return e});ee(this,"putBytesSigned",async(e,n)=>{const r=await Ga(this.sdk,`storage/${e}?signed=true`,{method:"put"}),i=r.headers.get("Content-Type");if(!r.ok)throw await r.json();if(i==="application/json"){const s=await r.json();return(await fetch(s.url,{method:s.method,headers:s.headers,body:n})).ok}throw"unknown"});ee(this,"putBytesUnsigned",async(e,n)=>{const r=await Ga(this.sdk,`storage/${e}?signed=false`,{method:"put",body:n});if(r.headers.get("Content-Type"),!r.ok)throw await r.json();return r.ok});ee(this,"putBytes",async(e,n)=>(await this.features()).supports_signed_urls?this.putBytesSigned(e,n):this.putBytesUnsigned(e,n));ee(this,"delete",async e=>(await Ga(this.sdk,`storage/${e}`,{method:"delete"})).ok);this.sdk=e}}Du=new WeakMap;class yB{constructor(e){_i(this,Ou);Lo(this,Ou,e),this.auth=new JF(this),this.storage=new gB(this),this.customers=new eB(this),this.tags=new tB(this),this.templates=new nB(this),this.products=new rB(this),this.orders=new iB(this),this.collections=new aB(this),this.discounts=new sB(this),this.shipping=new oB(this),this.storefronts=new lB(this),this.statistics=new cB(this),this.images=new uB(this),this.posts=new dB(this),this.payments=new hB(this),this.checkout=new fB(this),this.settings=new pB(this),this.notifications=new mB(this)}updateConfig(e){Lo(this,Ou,e)}get config(){return ft(this,Ou)}}Ou=new WeakMap;const Op=(t=>({get:e=>{if(typeof window>"u")return null;const n=t.getItem(e);return n?JSON.parse(n):null},set:(e,n)=>{if(!(typeof window>"u"))try{typeof window<"u"&&t.setItem(e,JSON.stringify(typeof n>"u"?null:n))}catch(r){console.error(`local_storage_adapter ${e} `,r)}},remove:e=>{typeof window<"u"&&t.removeItem(e)}}))(typeof window<"u"?window.localStorage:void 0),dw="storecraft_latest_config",fw=()=>(ds==null?void 0:ds.config)??Op.get(dw);var ds=new yB;const vB=(t={})=>{Op.set(dw,t)},xB=t=>{ds.updateConfig(t),vB(t)},an=(t=fw())=>{const[e,n]=_.useState(void 0),r=Ec(),i=ds.auth.isAuthenticated,s=_.useCallback(a=>{xB(a),r()},[r]);return _.useEffect(()=>{s(t)},[t]),_.useEffect(()=>{const a=ds.auth.add_sub(({auth:o})=>{s({...ds.config,auth:o})});return ds.auth.reAuthenticateIfNeeded(),a},[]),{config:ds.config??fw(),sdk:ds,isAuthenticated:i,error:e,actions:{updateConfig:s,trigger:r}}},Mp=t=>new Promise((e,n)=>{let r=indexedDB.open(t,1);r.onupgradeneeded=function(i){i.target.result.createObjectStore("main")},r.onsuccess=function(i){e(i.target.result)},r.onerror=function(i){n(i.target.errorCode)}}),_B=(t,e="main")=>(n,r)=>new Promise((i,s)=>{Mp(t).then(a=>{let c=a.transaction(e,"readwrite").objectStore(e).put(r,n);c.onsuccess=function(u){const d=u.target.result;n===d?i(n):s()},c.onerror=function(u){s(u.target.errorCode)}}).catch(s)}),bB=(t,e="main")=>n=>new Promise((r,i)=>{Mp(t).then(s=>{let l=s.transaction(e,"readwrite").objectStore(e).get(n);l.onsuccess=function(c){const u=c.target.result;u?r(u):i()},l.onerror=function(c){i(c.target.errorCode)}}).catch(i)}),wB=(t,e="main")=>n=>new Promise((r,i)=>{Mp(t).then(s=>{let l=s.transaction(e,"readwrite").objectStore(e).delete(n);l.onsuccess=function(c){r(n)},l.onerror=function(c){i(c.target.errorCode)}}).catch(i)}),w4=t=>{const[e,n]=_.useState(),[r,i]=_.useState();_.useEffect(()=>{Mp(t).then(n).catch(i)},[t]);const s=_.useCallback(async(l,c)=>{try{return await _B(t,"main")(l,c)}catch(u){i(u)}},[]),a=_.useCallback(async l=>{try{return await bB(t,"main")(l)}catch(c){i(c)}},[]),o=_.useCallback(async l=>{try{return await wB(t,"main")(l)}catch(c){i(c)}},[]);return{db:e,error:r,actions:{get:a,put:s,remove:o}}},hw=()=>{const{db:t,error:e,actions:{get:n,put:r,remove:i}}=w4("storecraft_document_cache"),s=_.useCallback(c=>n(c),[n]),a=_.useCallback(async c=>{try{const u=[];c&&"handle"in c&&u.push(r(String(c.handle),c)),c&&"id"in c&&u.push(r(c.id,c)),await Promise.all(u)}catch{}return c.id},[r]),o=_.useCallback(async(c,u)=>{try{await r(c,u)}catch{}return u.id},[r]),l=_.useCallback(c=>{try{return i(c)}catch{}},[i]);return{db:t,error:e,actions:{get:s,put:a,putWithKey:o,remove:l}}},EB=()=>w4("storecraft_misc_cache"),kB=()=>{const{db:t,error:e,actions:{get:n,put:r,remove:i}}=w4("storecraft_query_cache"),s=_.useCallback((l,c)=>{const u=l+"_"+os(c).toString();return n(u)},[n]),a=_.useCallback((l,c,u)=>{const d=l+"_"+os(c).toString();return r(d,u)},[r]),o=_.useCallback((l,c)=>{try{const u=l+"_"+os(c).toString();return i(u)}catch{}},[i]);return{db:t,error:e,actions:{get:s,put:a,remove:o}}},pw=t=>t==="shipping"?"shipping_methods":t,CB=(t,e,n,r)=>e&&!n&&r!==void 0&&r<=0&&t&&!t.vql&&!t.endAt&&!t.endBefore&&!t.startAt&&!t.startAfter,TB=(t,e,n)=>{e.sortBy=e.sortBy??["updated_at","id"];let r=e.startAfter;return async()=>{const s={...e,startAfter:r},a=await yp(t,n,s);return a!=null&&a.length&&(r=s.sortBy.map((o,l)=>{var c;return[o,(c=a.at(-1))==null?void 0:c[o]]})),a}},sl={sortBy:["updated_at","id"],order:"desc",limit:5},Ja=(t,e=sl,n=!0)=>{const{actions:{get:r,put:i}}=kB(),{actions:{get:s,put:a,putWithKey:o,remove:l}}=hw(),{sdk:c}=an(),u=_.useRef(e),d=_.useRef(!1),h=_.useRef(),[p,m]=_.useState(void 0),[g,y]=_.useState([]),[v,x]=_.useState(-1),[b,w]=_.useState(n),[C,S]=_.useState(!1),[k,N]=_.useState(-1),D=Ec();_.useEffect(()=>c.auth.add_sub(D),[D]);const A=_.useCallback(async(R=!1)=>{let z;w(!0);try{z=await h.current();for(let O of z)a(O);R?(x(0),y([[...z]])):(x(O=>O+1),y(O=>[...O,[...z]])),S(!0)}catch(O){m(O==null?void 0:O.code)}finally{w(!1)}return z},[]),L=_.useCallback(R=>{if(!h.current)return Promise.resolve();const z=R?1:-1;return v+z<0?Promise.resolve():v+z<g.length?(x(v+z),Promise.resolve()):A()},[g,v,A]),$=_.useCallback(()=>L(!0),[L]),K=_.useCallback(()=>L(!1),[L]),X=_.useCallback(async(R=u.current,z=!0)=>{let O={...sl,...R};u.current=O,h.current=TB(c,O,t);let W;z&&(W=await r(t,O),W&&(x(0),y([[...W]]),A(!0).then(I=>{i(t,O,I)}))),W||(W=await A(!0),i(t,O,W));{const{limit:Z,limitToLast:I,startAfter:se,startAt:V,endAt:ce,endBefore:De,...we}=O;c.statistics.countOf(pw(t),we).then(N).catch(console.log)}return W},[t,A,r,i]),H=_.useCallback(async R=>{try{return l(R),await c4(c,t,R),await X(u.current,!1),R}catch(z){throw m(z),w(!1),z}},[t,X]);_.useEffect(()=>{async function R(){var Z;const z=g.flat(1).reduce((I,se)=>se.updated_at>I.updated_at?se:I,(Z=g==null?void 0:g.at(0))==null?void 0:Z.at(0)),O=`storecraft_max_updated_seen_${t}`;let W=await s(O);(z||W)&&(z&&W?(z.updated_at>W.updated_at||z.updated_at==W.updated_at&&z.id>W.id)&&(W=z):W=W??z),W&&o(O,W)}R()},[g,t]);const U=_.useCallback(async()=>{const R=`storecraft_max_updated_seen_${t}`,z=await s(R);return z?await c.statistics.countOf(pw(t),{startAfter:[["updated_at",z.updated_at],["id",z.id]],order:"asc"})>0:!0},[]);_.useEffect(()=>{n&&v==-1&&!d.current&&X(u.current)},[]);const G=v>=0?g[v]:[];return{pages:g,page:G,loading:b,hasLoaded:C,resource_is_probably_empty:CB(u.current,C,b,G.length),error:p,sdk:c,queryCount:k,resource:t,actions:{prev:K,next:$,query:X,poll:U,removeDocument:H}}};function E4(t,e,n=!0,r=!0){const{actions:{get:i,put:s,remove:a}}=hw(),{sdk:o}=an(),[l,c]=_.useState(!!(t&&e&&n)),[u,d]=_.useState(),[h,p]=_.useState(!1),[m,g]=_.useState(void 0),[y,v]=_.useState(void 0),x=Ec();_.useEffect(()=>o.auth.add_sub(x),[x]);const b=_.useRef([t,e]);_.useEffect(()=>{b.current=[t,e]},[t,e]);const w=_.useRef(async(N=!0)=>{const D=b.current[0],A=b.current[1];if(!(D&&A))throw"no doc id";c(!0),g(void 0),v("load");try{let L;return N&&(L=await i(A),L&&el(o,D,A).then($=>{s($),d($)})),L||(L=await el(o,D,A),s(L)),d(L),p(!0),L}catch(L){throw console.log(L),g(L),L}finally{c(!1)}}),C=_.useCallback(async(N=!0)=>{const D=b.current[0],A=b.current[1];if(!(D&&A))throw console.log("resource",D),console.log("document",A),"no doc id";c(!0),g(void 0),v("load");try{let L;return N&&(L=await i(A),L&&el(o,D,A).then($=>{s($),d($)})),L||(L=await el(o,D,A),s(L)),d(L),p(!0),L}catch(L){throw console.log(L),g(L),L}finally{c(!1)}},[]),S=_.useCallback(async(N,...D)=>{c(!0),g(void 0),v("update");try{const A=await Fb(o,t,N),L=await el(o,t,A);return d(L),p(!0),L}catch(A){throw g(A),console.log(JSON.stringify(A,null,2)),A}finally{c(!1)}},[t,e]),k=_.useCallback(async()=>{c(!0),g(void 0),v("delete");try{return await c4(o,t,e),a(e),d(void 0),p(!0),e}catch(N){throw g(N),N}finally{c(!1)}},[t,e]);return _.useEffect(()=>{if(t==null)throw new Error("useDocument: no Collection Id");d(void 0)},[t,e]),_.useEffect(()=>{n&&C(r)},[n,C,t,e]),{doc:u,sdk:o,loading:l,hasLoaded:h,error:m,op:y,resource:t,document:e,actions:{reload:C,reload_hard:w,upsert:S,remove:k,setError:g}}}const k4=()=>{const t=Ec(),{sdk:e}=an();return _.useEffect(()=>{const n=e.auth.add_sub(t);return e.auth.reAuthenticateIfNeeded(),n},[]),{sdk:e,auth:e.auth.currentAuth,isAuthenticated:e.auth.isAuthenticated,actions:{signin:e.auth.signin,signup:e.auth.signup,signout:e.auth.signout,refresh:e.auth.reAuthenticateIfNeeded,changePassword:e.auth.changePassword,apikeys:{list:e.auth.list_api_keys_auth_users,create:e.auth.create_api_key},users:{get:e.auth.get_auth_user,remove:e.auth.remove_auth_user,list:e.auth.list_auth_users}}}},SB=(t,e)=>{const n=t;let r=Op.get(n)??e;const i=new Set,s=o=>(i.add(o),()=>{i.delete(o)}),a=o=>{r=o,Op.set(n,o),i.forEach(l=>l(r))};return()=>{const o=Ec();_.useEffect(()=>s(o),[o]);const l=_.useCallback(c=>{typeof c=="function"&&c(r),a(c)},[]);return{state:r,setState:l}}},NB={sortBy:["updated_at","id"],order:"desc",limit:5},AB=()=>{const{sdk:t}=an();_.useRef(!1);const[e,n]=_.useState(void 0),[r,i]=_.useState(),[s,a]=_.useState(!1),[o,l]=_.useState(!1);Ec();const c=_.useCallback(async(u,d=!0)=>{u={...NB,...u};try{const h=await yp(t,"search",u);i(h)}catch(h){n(h)}},[]);return{result:r,loading:s,hasLoaded:o,error:e,sdk:t,actions:{query:c}}},mw=1e3,Ip=mw*60,gw=Ip*60,C4=gw*24,DB=C4*30,yw=[{millis:C4*365,adj:"year"},{millis:DB,adj:"month"},{millis:C4,adj:"day"},{millis:gw,adj:"hour",singular:"about an hour ago"},{millis:Ip,adj:"minute"},{millis:mw,adj:"second"}],OB=t=>{const e=Math.max(Date.now()-new Date(t).getTime(),0);if(e<1e3)return"now";for(let n=0;n<yw.length;n++){const r=yw[n];let i=e/r.millis,s=Math.floor(i);if(s==1)return r.singular??`about a ${r.adj} ago`;if(s>1)return`${s} ${r.adj}s ago`}},vw=(t,e=5e3,n=!0,r=Number.POSITIVE_INFINITY)=>{const i=_.useRef(),s=_.useRef({count:0}),a=_.useCallback(()=>{i.current&&clearTimeout(i.current)},[]),o=_.useCallback(()=>{a(),s.current.count=1,t(1),i.current=setInterval(()=>{s.current.count+=1,t(s.current.count),s.current.count==r&&a()},e)},[a,e]);return _.useEffect(()=>(a(),n&&o(),a),[o,a]),{start:o,stop:a}};new Date().toISOString(),new Date().toISOString();const MB=({notification:t})=>{const e=Ws(),n=_.useCallback(()=>{var s;const r=(s=t==null?void 0:t.actions)==null?void 0:s.at(0),i=r==null?void 0:r.params;if(r)switch(r.type){case"route":let a=i;e(`/pages/${a.collection}/${a.document}`);break;case"url":let o=i;window.open(o.url,o.new_window?"_blank":"_self")}},[t,e,window]);return f.jsx("div",{className:`flex flex-row justify-between items-center w-full
|
206
|
+
line items and shipping method`);QF.extend(Mi.shape).extend({status:WF.describe("Status of `checkout`, `fulfillment` and `payment`"),pricing:XF.describe("Pricing information"),validation:E.array(PF).optional().describe("In case the order went through validation"),payment_gateway:GF.optional().describe("Payment gateway info and status")}).omit({id:!0}).and(ei).describe("Order upsert type");const Ic={Auto:{id:0,name:"Automatic",name2:"automatic"},Manual:{id:1,name:"Manual",name2:"manual"}},Jt={any:{id:void 0,name:void 0,op:void 0,type:void 0},p_in_collections:{id:0,type:"product",op:"p-in-collections",name:"Product In Collection"},p_not_in_collections:{id:1,type:"product",op:"p-not-in-collections",name:"Product not in Collection"},p_in_products:{id:2,type:"product",op:"p-in-products",name:"Product belongs to"},p_not_in_products:{id:3,type:"product",op:"p-not-in-products",name:"Product does not belong to"},p_in_tags:{id:4,type:"product",op:"p-in-tags",name:"Product has Tag"},p_not_in_tags:{id:5,type:"product",op:"p-not-in-tags",name:"Product excludes Tag"},p_all:{id:6,type:"product",op:"p-all",name:"All Products"},p_in_price_range:{id:7,type:"product",op:"p-in-price-range",name:"Product in Price range"},o_subtotal_in_range:{id:100,type:"order",op:"o-subtotal-in-range",name:"Order subtotal in range"},o_items_count_in_range:{id:101,type:"order",op:"o-items-count-in-range",name:"Order items count in range"},o_date_in_range:{id:102,type:"order",op:"o-date-in-range",name:"Order in dates"},o_has_customer:{id:103,type:"order",op:"o-has-customer",name:"Order has Customers"}},Ar={any:{id:void 0,type:void 0,name:void 0},regular:{id:0,type:"regular",name:"Regular Discount"},bulk:{id:1,type:"bulk",name:"Bulk Discount"},buy_x_get_y:{id:2,type:"buy_x_get_y",name:"Buy X Get Y"},order:{id:3,type:"order",name:"Order Discount"},bundle:{id:4,type:"bundle",name:"Bundle Discount"}},uw={created:{id:0,name2:"created",name:"Created"},requires_action:{id:1,name2:"requires_action",name:"Requires Action"},failed:{id:2,name2:"failed",name:"Failed"},complete:{id:3,name2:"complete",name:"Complete"},unknown:{id:4,name2:"unknown",name:"Unknown"}},_4={draft:{id:0,name2:"draft",name:"Draft"},processing:{id:1,name2:"processing",name:"Processing (Stock Reserved)"},shipped:{id:2,name2:"shipped",name:"Shipped"},fulfilled:{id:3,name2:"fulfilled",name:"Fulfilled"},cancelled:{id:4,name2:"cancelled",name:"Cancelled (Stock returned)"}},b4={unpaid:{id:0,name:"Unpaid",name2:"unpaid"},authorized:{id:1,name:"Authorized",name2:"authorized"},captured:{id:2,name:"Captured",name2:"captured"},requires_auth:{id:3,name:"Requires Authentication",name2:"requires_auth"},voided:{id:4,name:"Voided",name2:"voided"},failed:{id:5,name:"Failed",name2:"failed"},partially_paid:{id:6,name:"Partially paid",name2:"partially_paid"},refunded:{id:7,name:"Refunded",name2:"refunded"},partially_refunded:{id:8,name:"Partially Refunded",name2:"partially_refunded"},cancelled:{id:9,name:"Cancelled",name2:"cancelled"}};class JF{constructor(e){_i(this,Au,new Set);_i(this,Jn);ee(this,"notify_subscribers",()=>{for(let e of ft(this,Au))e({auth:this.currentAuth,isAuthenticated:this.isAuthenticated})});ee(this,"add_sub",e=>(ft(this,Au).add(e),()=>{ft(this,Au).delete(e)}));_i(this,Oo,e=>{this.currentAuth=e,this.notify_subscribers()});ee(this,"signin",async(e,n)=>{const r={email:e,password:n},i=await fetch(D1(ft(this,Jn).config,"/auth/signin"),{method:"post",body:JSON.stringify(r),headers:{"Content-Type":"application/json"}});if(!i.ok){let a={messages:[{message:"auth/error"}]};try{a=await i.json()}catch{}throw a}const s=await i.json();return ft(this,Oo).call(this,s),s});ee(this,"signup",async(e,n,r,i)=>{const s={email:e,password:n,firstname:r,lastname:i},a=await fetch(D1(ft(this,Jn).config,"/auth/signup"),{method:"post",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}});uj(a.ok,"auth/error");const o=await a.json();return ft(this,Oo).call(this,o),o});ee(this,"changePassword",async e=>{const n=await fetch(D1(ft(this,Jn).config,"/auth/change-password"),{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});if(!n.ok){let i={messages:[{message:"auth/error"}]};try{i=await n.json()}catch{}throw i}const r=await n.json();return ft(this,Oo).call(this,r),r});ee(this,"signout",async()=>{console.log("signout"),ft(this,Oo).call(this,void 0)});ee(this,"create_api_key",async()=>(await sn(ft(this,Jn),"/auth/apikeys",{method:"post"})).apikey);ee(this,"get_auth_user",async e=>await sn(ft(this,Jn),`/auth/users/${e}`,{method:"get"}));ee(this,"remove_auth_user",async e=>sn(ft(this,Jn),`/auth/users/${e}`,{method:"delete"}));ee(this,"list_auth_users",async e=>{const n=os(e);return sn(ft(this,Jn),`/auth/users?${n.toString()}`,{method:"get"})});ee(this,"list_api_keys_auth_users",async()=>await sn(ft(this,Jn),"/auth/apikeys",{method:"get"}));Lo(this,Jn,e)}get currentAuth(){var e,n;return(n=(e=ft(this,Jn))==null?void 0:e.config)==null?void 0:n.auth}set currentAuth(e){ft(this,Jn).config.auth=e}init(){}async working_auth_token(e=!1){if(this.currentAuth){if("apikey"in this.currentAuth)return this.currentAuth.apikey;if("access_token"in this.currentAuth)return(e||!this.isAuthenticated)&&await this.reAuthenticateIfNeeded(e),this.currentAuth.access_token.token}}async reAuthenticateIfNeeded(e=!1){if(this.currentAuth&&!(this.isAuthenticated&&!e)&&"access_token"in this.currentAuth){const n=await fetch(D1(ft(this,Jn).config,"/auth/refresh"),{method:"post",body:JSON.stringify({refresh_token:this.currentAuth.refresh_token.token}),headers:{"Content-Type":"application/json"}});let r;return n.ok&&(r=await n.json()),ft(this,Oo).call(this,r),r}}get authStrategy(){if(this.currentAuth){if("apikey"in this.currentAuth)return"apikey";if("access_token"in this.currentAuth)return"jwt"}return"unknown"}get isAuthenticated(){var e,n,r;if(this.currentAuth){if("apikey"in this.currentAuth)return!!this.currentAuth.apikey;if("access_token"in this.currentAuth){const i=(r=(n=(e=this.currentAuth)==null?void 0:e.access_token)==null?void 0:n.claims)==null?void 0:r.exp;return i&&Date.now()<(i-60)*1e3}}return!1}}Au=new WeakMap,Jn=new WeakMap,Oo=new WeakMap;let eB=class extends Tr{constructor(e){super(e,"customers")}},tB=class extends Tr{constructor(e){super(e,"tags")}},nB=class extends Tr{constructor(e){super(e,"templates")}},rB=class extends Tr{constructor(n){super(n,"products");ee(this,"changeStockOfBy",async(n,r)=>(await Ga(this.sdk,`products/${n}?quantityBy=${r}`,{method:"put"})).ok);ee(this,"batchAddProductsToCollection",async(n,r)=>{for(const i of n)await this.upsert({...i,collections:[...i.collections??[],r]})});ee(this,"batchRemoveProductsFromCollection",async(n,r)=>{for(const i of n)await this.upsert({...i,collections:(i.collections??[]).filter(s=>s.id!==r.id)})})}},iB=class extends Tr{constructor(e){super(e,"orders")}},sB=class extends Tr{constructor(e){super(e,"discounts")}},aB=class extends Tr{constructor(n){super(n,"collections");ee(this,"publish",async(n,r=1e3)=>await sn(this.sdk,`collections/${n}/export`,{method:"post"}))}};class oB extends Tr{constructor(e){super(e,"shipping")}}let lB=class extends Tr{constructor(n){super(n,"storefronts");ee(this,"publish",async n=>await sn(this.sdk,`storefronts/${n}/export`,{method:"post"}))}};class cB{constructor(e){_i(this,If);_i(this,Lf,{});ee(this,"isCacheValid",e=>!1);ee(this,"fromCache",e=>{if(this.isCacheValid(e))return ft(this,Lf)[e]});ee(this,"putCache",(e,n)=>{ft(this,Lf)[e]=n});ee(this,"orders",async(e,n)=>{const r=new URLSearchParams;return e&&r.set("fromDay",new Date(e).toISOString()),n&&r.set("toDay",new Date(n).toISOString()),sn(this.sdk,`statistics/orders?${r.toString()}`)});ee(this,"countOf",async(e,n)=>{const r=os(n);return sn(this.sdk,`statistics/count/${e}?${r.toString()}`)});Lo(this,If,e)}get sdk(){return ft(this,If)}}If=new WeakMap,Lf=new WeakMap;let uB=class extends Tr{constructor(e){super(e,"images")}},dB=class extends Tr{constructor(e){super(e,"posts")}};class fB{constructor(e){ee(this,"create",async(e,n)=>(console.log("input",e),await sn(this.sdk,`checkout/create?gateway=${n}`,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})));ee(this,"complete",async e=>await sn(this.sdk,`checkout/${e}/complete`,{method:"post"}));ee(this,"pricing",async e=>await sn(this.sdk,"checkout/pricing",{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}));this.sdk=e}}class hB{constructor(e){_i(this,Pf);Lo(this,Pf,e)}get(e){return el(this.sdk,"payments/gateways",e)}list(){return yp(this.sdk,"payments/gateways")}paymentStatusOfOrder(e){return sn(this.sdk,`/payments/status/${e}`,{method:"get"})}invokeAction(e,n){return sn(this.sdk,`/payments/${e}/${n}`,{method:"post"})}get sdk(){return ft(this,Pf)}}Pf=new WeakMap;let pB=class extends Tr{constructor(e){super(e,"settings")}},mB=class extends Tr{constructor(n){super(n,"notifications");ee(this,"upsertBulk",n=>sn(this.sdk,`${this.base_name}`,{method:"post",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}));ee(this,"meta",()=>this.get("_meta"))}};class gB{constructor(e){_i(this,Du,{features:void 0});ee(this,"features",async()=>{if(ft(this,Du).features)return ft(this,Du).features;try{const e=await Ga(this.sdk,"storage",{method:"get"});if(!e.ok)throw new Error;const n=await e.json();return ft(this,Du).features=n,n}catch(e){console.log(e)}return{supports_signed_urls:!1}});ee(this,"getBlobSigned",async e=>{const n=await Ga(this.sdk,`storage/${e}?signed=true`,{method:"get"}),r=n.headers.get("Content-Type");if(!n.ok)throw await n.json();if(r==="application/json"){const i=await n.json();return(await fetch(i.url,{method:i.method,headers:i.headers})).blob()}throw"unknown"});ee(this,"getBlobUnsigned",async e=>{const n=await Ga(this.sdk,`storage/${e}?signed=false`,{method:"get"});if(n.headers.get("Content-Type"),!n.ok)throw await n.json();return n.blob()});ee(this,"getBlob",async e=>(await this.features()).supports_signed_urls?this.getBlobSigned(e):this.getBlobUnsigned(e));ee(this,"getText",e=>this.getBlob(e).then(n=>n.text()));ee(this,"getJson",e=>this.getBlob(e).then(n=>n.text().then(JSON.parse)));ee(this,"getImageObjectURL",e=>this.getBlob(e).then(n=>URL.createObjectURL(n)));ee(this,"getSource",async(e,n=!0)=>{try{if(!e.startsWith("storage://"))return e;const i=e.split("storage://").at(-1),s=await this.getBlob(i);return n?URL.createObjectURL(s):s.text().then(JSON.parse)}catch(r){console.log(r)}return e});ee(this,"putBytesSigned",async(e,n)=>{const r=await Ga(this.sdk,`storage/${e}?signed=true`,{method:"put"}),i=r.headers.get("Content-Type");if(!r.ok)throw await r.json();if(i==="application/json"){const s=await r.json();return(await fetch(s.url,{method:s.method,headers:s.headers,body:n})).ok}throw"unknown"});ee(this,"putBytesUnsigned",async(e,n)=>{const r=await Ga(this.sdk,`storage/${e}?signed=false`,{method:"put",body:n});if(r.headers.get("Content-Type"),!r.ok)throw await r.json();return r.ok});ee(this,"putBytes",async(e,n)=>(await this.features()).supports_signed_urls?this.putBytesSigned(e,n):this.putBytesUnsigned(e,n));ee(this,"delete",async e=>(await Ga(this.sdk,`storage/${e}`,{method:"delete"})).ok);this.sdk=e}}Du=new WeakMap;class yB{constructor(e){_i(this,Ou);Lo(this,Ou,e),this.auth=new JF(this),this.storage=new gB(this),this.customers=new eB(this),this.tags=new tB(this),this.templates=new nB(this),this.products=new rB(this),this.orders=new iB(this),this.collections=new aB(this),this.discounts=new sB(this),this.shipping=new oB(this),this.storefronts=new lB(this),this.statistics=new cB(this),this.images=new uB(this),this.posts=new dB(this),this.payments=new hB(this),this.checkout=new fB(this),this.settings=new pB(this),this.notifications=new mB(this)}updateConfig(e){Lo(this,Ou,e)}get config(){return ft(this,Ou)}}Ou=new WeakMap;const Op=(t=>({get:e=>{if(typeof window>"u")return null;const n=t.getItem(e);return n?JSON.parse(n):null},set:(e,n)=>{if(!(typeof window>"u"))try{typeof window<"u"&&t.setItem(e,JSON.stringify(typeof n>"u"?null:n))}catch(r){console.error(`local_storage_adapter ${e} `,r)}},remove:e=>{typeof window<"u"&&t.removeItem(e)}}))(typeof window<"u"?window.localStorage:void 0),dw="storecraft_latest_config",fw=()=>(ds==null?void 0:ds.config)??Op.get(dw);var ds=new yB;const vB=(t={})=>{Op.set(dw,t)},xB=t=>{ds.updateConfig(t),vB(t)},an=(t=fw())=>{const[e,n]=_.useState(void 0),r=Ec(),i=ds.auth.isAuthenticated,s=_.useCallback(a=>{xB(a),r()},[r]);return _.useEffect(()=>{s(t)},[t]),_.useEffect(()=>{const a=ds.auth.add_sub(({auth:o})=>{s({...ds.config,auth:o})});return ds.auth.reAuthenticateIfNeeded(),a},[]),{config:ds.config??fw(),sdk:ds,isAuthenticated:i,error:e,actions:{updateConfig:s,trigger:r}}},Mp=t=>new Promise((e,n)=>{let r=indexedDB.open(t,1);r.onupgradeneeded=function(i){i.target.result.createObjectStore("main")},r.onsuccess=function(i){e(i.target.result)},r.onerror=function(i){n(i.target.errorCode)}}),_B=(t,e="main")=>(n,r)=>new Promise((i,s)=>{Mp(t).then(a=>{let c=a.transaction(e,"readwrite").objectStore(e).put(r,n);c.onsuccess=function(u){const d=u.target.result;n===d?i(n):s()},c.onerror=function(u){s(u.target.errorCode)}}).catch(s)}),bB=(t,e="main")=>n=>new Promise((r,i)=>{Mp(t).then(s=>{let l=s.transaction(e,"readwrite").objectStore(e).get(n);l.onsuccess=function(c){const u=c.target.result;u?r(u):i()},l.onerror=function(c){i(c.target.errorCode)}}).catch(i)}),wB=(t,e="main")=>n=>new Promise((r,i)=>{Mp(t).then(s=>{let l=s.transaction(e,"readwrite").objectStore(e).delete(n);l.onsuccess=function(c){r(n)},l.onerror=function(c){i(c.target.errorCode)}}).catch(i)}),w4=t=>{const[e,n]=_.useState(),[r,i]=_.useState();_.useEffect(()=>{Mp(t).then(n).catch(i)},[t]);const s=_.useCallback(async(l,c)=>{try{return await _B(t,"main")(l,c)}catch(u){i(u)}},[]),a=_.useCallback(async l=>{try{return await bB(t,"main")(l)}catch(c){i(c)}},[]),o=_.useCallback(async l=>{try{return await wB(t,"main")(l)}catch(c){i(c)}},[]);return{db:e,error:r,actions:{get:a,put:s,remove:o}}},hw=()=>{const{db:t,error:e,actions:{get:n,put:r,remove:i}}=w4("storecraft_document_cache"),s=_.useCallback(c=>n(c),[n]),a=_.useCallback(async c=>{try{const u=[];c&&"handle"in c&&u.push(r(String(c.handle),c)),c&&"id"in c&&u.push(r(c.id,c)),await Promise.all(u)}catch{}return c.id},[r]),o=_.useCallback(async(c,u)=>{try{await r(c,u)}catch{}return u.id},[r]),l=_.useCallback(c=>{try{return i(c)}catch{}},[i]);return{db:t,error:e,actions:{get:s,put:a,putWithKey:o,remove:l}}},EB=()=>w4("storecraft_misc_cache"),kB=()=>{const{db:t,error:e,actions:{get:n,put:r,remove:i}}=w4("storecraft_query_cache"),s=_.useCallback((l,c)=>{const u=l+"_"+os(c).toString();return n(u)},[n]),a=_.useCallback((l,c,u)=>{const d=l+"_"+os(c).toString();return r(d,u)},[r]),o=_.useCallback((l,c)=>{try{const u=l+"_"+os(c).toString();return i(u)}catch{}},[i]);return{db:t,error:e,actions:{get:s,put:a,remove:o}}},pw=t=>t==="shipping"?"shipping_methods":t,CB=(t,e,n,r)=>e&&!n&&r!==void 0&&r<=0&&t&&!t.vql&&!t.endAt&&!t.endBefore&&!t.startAt&&!t.startAfter,TB=(t,e,n)=>{e.sortBy=e.sortBy??["updated_at","id"];let r=e.startAfter;return async()=>{const s={...e,startAfter:r},a=await yp(t,n,s);return a!=null&&a.length&&(r=s.sortBy.map((o,l)=>{var c;return[o,(c=a.at(-1))==null?void 0:c[o]]})),a}},sl={sortBy:["updated_at","id"],order:"desc",limit:5},Ja=(t,e=sl,n=!0)=>{const{actions:{get:r,put:i}}=kB(),{actions:{get:s,put:a,putWithKey:o,remove:l}}=hw(),{sdk:c}=an(),u=_.useRef(e),d=_.useRef(!1),h=_.useRef(),[p,m]=_.useState(void 0),[g,y]=_.useState([]),[v,x]=_.useState(-1),[b,w]=_.useState(n),[C,S]=_.useState(!1),[k,N]=_.useState(-1),D=Ec();_.useEffect(()=>c.auth.add_sub(D),[D]);const A=_.useCallback(async(R=!1)=>{let z;w(!0);try{z=await h.current();for(let O of z)a(O);R?(x(0),y([[...z]])):(x(O=>O+1),y(O=>[...O,[...z]])),S(!0)}catch(O){m(O==null?void 0:O.code)}finally{w(!1)}return z},[]),L=_.useCallback(R=>{if(!h.current)return Promise.resolve();const z=R?1:-1;return v+z<0?Promise.resolve():v+z<g.length?(x(v+z),Promise.resolve()):A()},[g,v,A]),$=_.useCallback(()=>L(!0),[L]),K=_.useCallback(()=>L(!1),[L]),X=_.useCallback(async(R=u.current,z=!0)=>{let O={...sl,...R};u.current=O,h.current=TB(c,O,t);let W;z&&(W=await r(t,O),W&&(x(0),y([[...W]]),A(!0).then(I=>{i(t,O,I)}))),W||(W=await A(!0),i(t,O,W));{const{limit:Z,limitToLast:I,startAfter:se,startAt:V,endAt:ce,endBefore:De,...we}=O;c.statistics.countOf(pw(t),we).then(N).catch(console.log)}return W},[t,A,r,i]),H=_.useCallback(async R=>{try{return l(R),await c4(c,t,R),await X(u.current,!1),R}catch(z){throw m(z),w(!1),z}},[t,X]);_.useEffect(()=>{async function R(){var Z;const z=g.flat(1).reduce((I,se)=>se.updated_at>I.updated_at?se:I,(Z=g==null?void 0:g.at(0))==null?void 0:Z.at(0)),O=`storecraft_max_updated_seen_${t}`;let W=await s(O);(z||W)&&(z&&W?(z.updated_at>W.updated_at||z.updated_at==W.updated_at&&z.id>W.id)&&(W=z):W=W??z),W&&o(O,W)}R()},[g,t]);const U=_.useCallback(async()=>{const R=`storecraft_max_updated_seen_${t}`,z=await s(R);return z?await c.statistics.countOf(pw(t),{startAfter:[["updated_at",z.updated_at],["id",z.id]],order:"asc"})>0:!0},[]);_.useEffect(()=>{n&&v==-1&&!d.current&&X(u.current)},[]);const G=v>=0?g[v]:[];return{pages:g,page:G,loading:b,hasLoaded:C,resource_is_probably_empty:CB(u.current,C,b,G.length),error:p,sdk:c,queryCount:k,resource:t,actions:{prev:K,next:$,query:X,poll:U,removeDocument:H}}};function E4(t,e,n=!0,r=!0){const{actions:{get:i,put:s,remove:a}}=hw(),{sdk:o}=an(),[l,c]=_.useState(!!(t&&e&&n)),[u,d]=_.useState(),[h,p]=_.useState(!1),[m,g]=_.useState(void 0),[y,v]=_.useState(void 0),x=Ec();_.useEffect(()=>o.auth.add_sub(x),[x]);const b=_.useRef([t,e]);_.useEffect(()=>{b.current=[t,e]},[t,e]);const w=_.useRef(async(N=!0)=>{const D=b.current[0],A=b.current[1];if(!(D&&A))throw"no doc id";c(!0),g(void 0),v("load");try{let L;return N&&(L=await i(A),L&&el(o,D,A).then($=>{s($),d($)})),L||(L=await el(o,D,A),s(L)),d(L),p(!0),L}catch(L){throw console.log(L),g(L),L}finally{c(!1)}}),C=_.useCallback(async(N=!0)=>{const D=b.current[0],A=b.current[1];if(!(D&&A))throw console.log("resource",D),console.log("document",A),"no doc id";c(!0),g(void 0),v("load");try{let L;return N&&(L=await i(A),L&&el(o,D,A).then($=>{s($),d($)})),L||(L=await el(o,D,A),s(L)),d(L),p(!0),L}catch(L){throw console.log(L),g(L),L}finally{c(!1)}},[]),S=_.useCallback(async(N,...D)=>{c(!0),g(void 0),v("update");try{const A=await Fb(o,t,N),L=await el(o,t,A);return d(L),p(!0),L}catch(A){throw g(A),console.log(JSON.stringify(A,null,2)),A}finally{c(!1)}},[t,e]),k=_.useCallback(async()=>{c(!0),g(void 0),v("delete");try{return await c4(o,t,e),a(e),d(void 0),p(!0),e}catch(N){throw g(N),N}finally{c(!1)}},[t,e]);return _.useEffect(()=>{if(t==null)throw new Error("useDocument: no Collection Id");d(void 0)},[t,e]),_.useEffect(()=>{n&&C(r)},[n,C,t,e]),{doc:u,sdk:o,loading:l,hasLoaded:h,error:m,op:y,resource:t,document:e,actions:{reload:C,reload_hard:w,upsert:S,remove:k,setError:g}}}const k4=()=>{const t=Ec(),{sdk:e}=an();return _.useEffect(()=>{const n=e.auth.add_sub(t);return e.auth.reAuthenticateIfNeeded(),n},[]),{sdk:e,auth:e.auth.currentAuth,isAuthenticated:e.auth.isAuthenticated,actions:{signin:e.auth.signin,signup:e.auth.signup,signout:e.auth.signout,refresh:e.auth.reAuthenticateIfNeeded,changePassword:e.auth.changePassword,apikeys:{list:e.auth.list_api_keys_auth_users,create:e.auth.create_api_key},users:{get:e.auth.get_auth_user,remove:e.auth.remove_auth_user,list:e.auth.list_auth_users}}}},SB=(t,e)=>{const n=t;let r=Op.get(n)??e;const i=new Set,s=o=>(i.add(o),()=>{i.delete(o)}),a=o=>{r=o,Op.set(n,o),i.forEach(l=>l(r))};return()=>{const o=Ec();_.useEffect(()=>s(o),[o]);const l=_.useCallback(c=>{typeof c=="function"&&c(r),a(c)},[]);return{state:r,setState:l}}},NB={sortBy:["updated_at","id"],order:"desc",limit:5},AB=()=>{const{sdk:t}=an();_.useRef(!1);const[e,n]=_.useState(void 0),[r,i]=_.useState(),[s,a]=_.useState(!1),[o,l]=_.useState(!1);Ec();const c=_.useCallback(async(u,d=!0)=>{u={...NB,...u};try{const h=await yp(t,"search",u);i(h)}catch(h){n(h)}},[]);return{result:r,loading:s,hasLoaded:o,error:e,sdk:t,actions:{query:c}}},mw=1e3,Ip=mw*60,gw=Ip*60,C4=gw*24,DB=C4*30,yw=[{millis:C4*365,adj:"year"},{millis:DB,adj:"month"},{millis:C4,adj:"day"},{millis:gw,adj:"hour",singular:"about an hour ago"},{millis:Ip,adj:"minute"},{millis:mw,adj:"second"}],OB=t=>{const e=Math.max(Date.now()-new Date(t).getTime(),0);if(e<1e3)return"now";for(let n=0;n<yw.length;n++){const r=yw[n];let i=e/r.millis,s=Math.floor(i);if(s==1)return r.singular??`about a ${r.adj} ago`;if(s>1)return`${s} ${r.adj}s ago`}},vw=(t,e=5e3,n=!0,r=Number.POSITIVE_INFINITY)=>{const i=_.useRef(),s=_.useRef({count:0}),a=_.useCallback(()=>{i.current&&clearTimeout(i.current)},[]),o=_.useCallback(()=>{a(),s.current.count=1,t(1),i.current=setInterval(()=>{s.current.count+=1,t(s.current.count),s.current.count==r&&a()},e)},[a,e]);return _.useEffect(()=>(a(),n&&o(),a),[o,a]),{start:o,stop:a}};new Date().toISOString(),new Date().toISOString();const MB=({notification:t})=>{const e=Ws(),n=_.useCallback(()=>{var s;const r=(s=t==null?void 0:t.actions)==null?void 0:s.at(0),i=r==null?void 0:r.params;if(r)switch(r.type){case"route":let a=i;e(`/pages/${a.collection}/${a.document}`);break;case"url":let o=i;window.open(o.url,o.new_window?"_blank":"_self")}},[t,e,window]);return f.jsx("div",{className:`flex flex-row justify-between items-center w-full
|
208
207
|
cursor-pointer`,onClick:n,children:f.jsxs("div",{className:"w-full",children:[f.jsx(Xt,{className:"text-base",value:t.message}),f.jsxs("div",{className:`flex flex-row items-center w-full
|
209
208
|
justify-between mt-1`,children:[f.jsx("p",{children:OB(t.updated_at??Date.now()),className:`text-pink-500 --text-gray-400
|
210
209
|
font-semibold text-xs w-fit`}),f.jsxs("div",{className:`flex flex-row items-baseline
|
@@ -663,7 +662,7 @@ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var ve=Ne(V,we,Z,I,se+".
|
|
663
662
|
transition-transform cursor-pointer`,stroke:"border-2",rounded:"rounded-full",from:"from-pink-500",to:"to-kf-500",onClick:()=>!r&&c.current.show(),children:f.jsx(BB,{className:"text-4xl text-white "+(r?"animate-spin":"")})})]})}),f.jsx(Xs,{ref:c,children:f.jsx(kd,{onSave:d,onCancel:()=>c.current.hide()})})]}),f.jsx(de,{show:!(t!=null&&t.handle),children:f.jsx("p",{children:`Only after Collection is created,
|
664
663
|
you will be able to add products here`,className:"text-2xl font-semibold text-gray-400"})})]})},Dle=({collectionId:t,value:e})=>{const[n,r]=_.useState([]),[i,s]=_.useState(),{sdk:a}=an();t=(e==null?void 0:e.handle)??t;const o=_.useCallback(async(l=!0)=>{try{s(void 0),await a.collections.bulkAddRemoveTags(t,n,l)}catch(c){console.error(c),s((c==null?void 0:c.message)??String(c))}},[n,t]);return t?f.jsxs(Gs,{name:"Add tags to all products in Collection",className:"w-full h-fit",error:i,desc:"Add/Remove all tags at once",children:[f.jsx(ia,{className:"w-full h-fit",onChange:r}),f.jsx(kt,{className:"my-5"}),f.jsxs("div",{className:"flex flex-row justify-between w-full --mt-5",children:[f.jsx(Jr,{text:"Add Tags",keep_text_on_load:!0,className:"w-fit",onClick:l=>o(!0)}),f.jsx(Jr,{text:"Remove Tags",keep_text_on_load:!0,className:"w-fit",onClick:l=>o(!1)})]})]}):null},Ole={name:"Root",comp:Be,comp_params:{className:"w-full flex flex-col gap-5 max-w- lg:w-[35rem]"},fields:[{comp:Ale,comp_params:{className:"w-full"}},{key:"title",name:"Title",type:"text",validate:!0,editable:!0,desc:"Give an efficient title to the collection, e.g. - Women shirts",comp:Q(Me(Pe),{className:"w-full h-10"}),comp_params:{className:"w-full h-fit"}},{key:"handle",name:"π Handle",type:"text",validate:!1,editable:!0,desc:`A handle uniquely identifies the collection.
|
665
664
|
Will be computed automatically if not filled by the product title`,comp:Q(mm,{className:"w-full h-fit"}),comp_params:{className:"w-full h-fit"}},{key:"desc",name:"π Description",type:"text",validate:!1,editable:!0,desc:"Describe the collection for your customers",comp:Q(pa),comp_params:{className:"w-full"}},{key:"media",name:"π₯ Media",validate:!1,editable:!0,desc:"Manage and edit your media files",comp:Q(mu),comp_params:{className:"w-full"}},{key:"attributes",name:"Attributes",validate:!1,editable:!0,desc:"Attributes can contain richer text values than tags",comp:Q(co),comp_params:{className:"w-full"}},{name:"JSON",type:"compund",validate:!1,editable:!1,desc:"Observe the RAW data",comp:xs,comp_params:{className:"w-full"}}]},Mle={name:"Main",comp:Be,comp_params:{className:`w-full items-center lg:items-start lg:w-[18rem]
|
666
|
-
flex flex-col gap-5`},fields:[{key:"active",name:"Active",validate:!0,desc:"activate or deactivate the collection",editable:!0,defaultValue:!0,comp:Q(bd,{className:"text-gray-600"},!0),comp_params:{className:"w-full"}},{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Use tags to attach attributes to the collection",comp:Q(ia),comp_params:{className:"w-full "}},{comp:Dle,comp_params:{className:"w-full"}}]},Ile={name:"Root",comp:Be,comp_params:{className:"w-full gap-5 --justify-center --bg-red-100 items-center lg:max-w-max lg:items-start lg:w-fit flex flex-col lg:flex-row --mx-auto"},fields:[Ole,Mle]},Lle=({onClickSave:t=void 0,onClickCreate:e=void 0,onClickDelete:n=void 0,onClickPublish:r=void 0,onClickDuplicate:i=void 0,onClickReload:s,id:a,className:o})=>f.jsx(ys,{id:a,className:o,onClickCreate:e,onClickDelete:n,onClickDuplicate:i,onClickReload:s,onClickSave:t,children:f.jsx(Jr,{Icon:f.jsx(G5,{}),text:"publish",keep_text_on_load:!0,show:!!r,onClick:r,className:""})}),Kv=({mode:t,...e})=>{const{id:n,base:r}=or(),{actions:{savePromise:i,deletePromise:s,setError:a,reload:o,navWithState:l,duplicate:c},context:u,key:d,sdk:h,doc:p,isCreateMode:m,isEditMode:g,isViewMode:y,loading:v,hasChanged:x,hasLoaded:b,error:w,ref_head:C,ref_root:S}=di("collections",n,"/pages/collections",t,r),k=_.useCallback(()=>c({title:(p==null?void 0:p.title)+" duplicate"}),[p,c]),N=_.useCallback(async()=>{await i(),a(void 0);try{await h.collections.publish(n,400),await o()}catch(D){a({messages:[{message:D.toString()}]})}},[n,i,o]);return f.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[f.jsx(ji,{major:["collections",n??"create"],className:""}),f.jsx(vs,{doc:p,className:"mt-5",collectionId:"collections"}),f.jsx(Lle,{onClickSave:g?i:void 0,onClickCreate:m?i:void 0,onClickPublish:m?void 0:N,onClickDelete:m?void 0:s,onClickDuplicate:m?void 0:k,onClickReload:m?void 0:async()=>o(!1),id:n,className:"mt-5"}),f.jsx(ss,{changes_made:x,ref:C,time:p==null?void 0:p.created_at,className:"mt-8"},p==null?void 0:p.updated_at),f.jsx(de,{show:b&&g||m,children:f.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[f.jsx(jr,{error:w,className:"w-full"}),f.jsx(Xr,{ref:S,field:Ile,context:u,value:p??{},isViewMode:y,className:"mt-8"},d)]})})]})},U0=t=>{switch(t){case Ar.regular.type:return"bg-teal-600 dark:bg-teal-600/40";case Ar.bulk.type:return"bg-red-400 dark:bg-red-400/40";case Ar.buy_x_get_y.type:return"bg-cyan-500 dark:bg-cyan-500/40";case Ar.order.type:return"bg-kf-400 dark:bg-kf-400/40";case Ar.bundle.type:return"bg-sky-500 dark:bg-sky-400/40";default:return"bg-slate-400 dark:bg-slate-400/20"}},Ple=({value:t,...e})=>{const n=_.useMemo(()=>{var i;return(i=Object.values(Ar).find(s=>s.type===(t==null?void 0:t.type)))==null?void 0:i.name.split(" ")[0]},[t]),r="text-white rounded-xl py-px px-2 whitespace-nowrap border shelf-border-color-blend "+U0(t==null?void 0:t.type);return f.jsx("span",{className:r+" bg-",children:n})},Rle=({...t})=>f.jsxs("div",{...t,children:[f.jsxs("div",{className:"flex flex-row gap-2 flex-wrap",children:[f.jsx(un,{to:"/pages/discounts",draggable:"false",children:f.jsx(lo,{value:"all",bgColor:"bg-pink-400 dark:bg-pink-400/60"})}),Object.values(Ar).map(e=>f.jsx(un,{draggable:"false",to:`/pages/discounts/q/vql=type:${e.id}`,children:f.jsx(lo,{value:e.name,bgColor:U0(e.type)})},e.id))]}),f.jsxs("div",{className:"flex flex-row flex-wrap gap-2 mt-1",children:[Object.values(Ic).map(e=>f.jsx(un,{draggable:"false",to:`/pages/discounts/q/vql=app:${e.name.toLowerCase()}`,children:f.jsx(lo,{value:e.name,bgColor:U0(
|
665
|
+
flex flex-col gap-5`},fields:[{key:"active",name:"Active",validate:!0,desc:"activate or deactivate the collection",editable:!0,defaultValue:!0,comp:Q(bd,{className:"text-gray-600"},!0),comp_params:{className:"w-full"}},{key:"tags",name:"# Tags",type:"compund",validate:!1,editable:!0,desc:"Use tags to attach attributes to the collection",comp:Q(ia),comp_params:{className:"w-full "}},{comp:Dle,comp_params:{className:"w-full"}}]},Ile={name:"Root",comp:Be,comp_params:{className:"w-full gap-5 --justify-center --bg-red-100 items-center lg:max-w-max lg:items-start lg:w-fit flex flex-col lg:flex-row --mx-auto"},fields:[Ole,Mle]},Lle=({onClickSave:t=void 0,onClickCreate:e=void 0,onClickDelete:n=void 0,onClickPublish:r=void 0,onClickDuplicate:i=void 0,onClickReload:s,id:a,className:o})=>f.jsx(ys,{id:a,className:o,onClickCreate:e,onClickDelete:n,onClickDuplicate:i,onClickReload:s,onClickSave:t,children:f.jsx(Jr,{Icon:f.jsx(G5,{}),text:"publish",keep_text_on_load:!0,show:!!r,onClick:r,className:""})}),Kv=({mode:t,...e})=>{const{id:n,base:r}=or(),{actions:{savePromise:i,deletePromise:s,setError:a,reload:o,navWithState:l,duplicate:c},context:u,key:d,sdk:h,doc:p,isCreateMode:m,isEditMode:g,isViewMode:y,loading:v,hasChanged:x,hasLoaded:b,error:w,ref_head:C,ref_root:S}=di("collections",n,"/pages/collections",t,r),k=_.useCallback(()=>c({title:(p==null?void 0:p.title)+" duplicate"}),[p,c]),N=_.useCallback(async()=>{await i(),a(void 0);try{await h.collections.publish(n,400),await o()}catch(D){a({messages:[{message:D.toString()}]})}},[n,i,o]);return f.jsxs("div",{className:"w-full lg:min-w-fit mx-auto",children:[f.jsx(ji,{major:["collections",n??"create"],className:""}),f.jsx(vs,{doc:p,className:"mt-5",collectionId:"collections"}),f.jsx(Lle,{onClickSave:g?i:void 0,onClickCreate:m?i:void 0,onClickPublish:m?void 0:N,onClickDelete:m?void 0:s,onClickDuplicate:m?void 0:k,onClickReload:m?void 0:async()=>o(!1),id:n,className:"mt-5"}),f.jsx(ss,{changes_made:x,ref:C,time:p==null?void 0:p.created_at,className:"mt-8"},p==null?void 0:p.updated_at),f.jsx(de,{show:b&&g||m,children:f.jsxs("div",{className:"w-full max-w-[40rem] lg:w-fit lg:max-w-none mx-auto",children:[f.jsx(jr,{error:w,className:"w-full"}),f.jsx(Xr,{ref:S,field:Ile,context:u,value:p??{},isViewMode:y,className:"mt-8"},d)]})})]})},U0=t=>{switch(t){case Ar.regular.type:return"bg-teal-600 dark:bg-teal-600/40";case Ar.bulk.type:return"bg-red-400 dark:bg-red-400/40";case Ar.buy_x_get_y.type:return"bg-cyan-500 dark:bg-cyan-500/40";case Ar.order.type:return"bg-kf-400 dark:bg-kf-400/40";case Ar.bundle.type:return"bg-sky-500 dark:bg-sky-400/40";default:return"bg-slate-400 dark:bg-slate-400/20"}},Ple=({value:t,...e})=>{const n=_.useMemo(()=>{var i;return(i=Object.values(Ar).find(s=>s.type===(t==null?void 0:t.type)))==null?void 0:i.name.split(" ")[0]},[t]),r="text-white rounded-xl py-px px-2 whitespace-nowrap border shelf-border-color-blend "+U0(t==null?void 0:t.type);return f.jsx("span",{className:r+" bg-",children:n})},Rle=({...t})=>f.jsxs("div",{...t,children:[f.jsxs("div",{className:"flex flex-row gap-2 flex-wrap",children:[f.jsx(un,{to:"/pages/discounts",draggable:"false",children:f.jsx(lo,{value:"all",bgColor:"bg-pink-400 dark:bg-pink-400/60"})}),Object.values(Ar).filter(e=>!!e.type).map(e=>f.jsx(un,{draggable:"false",to:`/pages/discounts/q/vql=type:${e.id}`,children:f.jsx(lo,{value:e.name,bgColor:U0(e.type)})},e.id))]}),f.jsxs("div",{className:"flex flex-row flex-wrap gap-2 mt-1",children:[Object.values(Ic).map(e=>f.jsx(un,{draggable:"false",to:`/pages/discounts/q/vql=app:${e.name.toLowerCase()}`,children:f.jsx(lo,{value:e.name,bgColor:U0("")})},e.id)),[{name:"enabled",v:!0},{name:"disabled",v:!1}].map((e,n)=>f.jsx(un,{draggable:"false",to:`/pages/discounts/q/vql=active:${e.v}`,children:f.jsx(lo,{value:e.name,bgColor:U0(void 0)})},n))]})]}),jle=[{key:"handle",name:"Code",comp:({value:t,context:e,...n})=>{const r=e.item.active?"bg-teal-500":"bg-red-500",i="whitespace-nowrap pr-2 font-semibold text-base max-w-[150px] sm:max-w-max overflow-clip hover:overflow-x-auto",s=e.item.application.id===Ic.Manual.id;return f.jsxs("div",{className:i,children:[f.jsx("span",{children:t}),s&&f.jsx(jR,{className:`block --text-xl text-white --p-0.5
|
667
666
|
align-middle text-center ${r}`}),!s&&f.jsx("span",{children:"AUTO",className:`block text-xs text-white w-fit px-1 border shelf-border-color-blend
|
668
667
|
align-middle text-center ${r}`})]})}},{key:"info.details.meta",name:"Type",comp:Ple},{key:"updated_at",name:"Last Updated",comp:gs,comp_params:{className:"font-semibold"}},{key:void 0,name:"Actions",comp:Pr}],KA=({})=>{const{query_api:t,context:e,ref_actions:n,page:r,loading:i,error:s,queryCount:a,hasLoaded:o,resource:l,resource_is_probably_empty:c,actions:{onLimitChange:u,onReload:d,prev:h,next:p}}=Rr("discounts","/pages/discounts");return f.jsx("div",{className:"h-full w-full",children:f.jsxs("div",{className:"max-w-[56rem] mx-auto",children:[f.jsx(dr,{should_onboard:c,overallCollectionCount:a,hasLoaded:o,resource:l}),f.jsx(de,{show:s,children:s==null?void 0:s.toString()}),f.jsx(Rle,{className:"mt-5"}),f.jsxs("div",{className:`w-full rounded-md overflow-hidden border
|
669
668
|
shelf-border-color dark:shadow-slate-900
|
@@ -679,7 +678,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
679
678
|
rounded-lg w-full border pl-2 sm:px-3 --pl-3
|
680
679
|
py-2 shadow-lg flex overflow-x-hidden
|
681
680
|
flex-col justify-between h-full text-base`,children:[f.jsx("p",{children:`${t} Filter`,className:"shelf-text-minor-2 overflow-x-hidden whitespace-nowrap"}),f.jsxs("select",{value:"-1",className:"w-full h-9 bg-transparent outline-none text-gray-500 p-0",onChange:r=>e(r.currentTarget.value),children:[f.jsx("option",{children:"Add Filter",value:"-1",className:"p-0 appearance-none"},"-1"),n.map((r,i)=>f.jsx("option",{children:r.name,value:r.id},i))]})]})},OO=({value:t,onChange:e,types:n=["product","order"],context:r,...i})=>{const[s,a]=_.useState(t??[]),o=_.useCallback(d=>{a(d),e&&e(d)},[e]),l=_.useCallback((d,h)=>{s[d].value=h;const p=[...s];o(p)},[s,o]),c=_.useCallback(d=>{s.splice(d,1),o([...s])},[s,o]),u=_.useCallback(d=>{const h=mg.find(g=>g.id==d),p={meta:{id:h.id,type:h.type,op:h.op},value:void 0},m=[...s,p];o(m)},[s,o,mg]);return f.jsxs("div",{className:"w-full",children:[f.jsx("div",{className:"flex flex-row gap-4 mt-3 w-full ",children:n.map((d,h)=>f.jsx(lt,{className:"flex-1",rounded:"rounded-lg",children:f.jsx(Lfe,{type:d,onAdd:u})},h))}),f.jsx(de,{show:s.length,children:f.jsx("p",{children:"",className:`mt-5 h-0.5 mb-5 bg-gradient-to-r
|
682
|
-
from-pink-500/50 to-kf-500/50`})}),f.jsx("div",{className:"w-full flex flex-col gap-5",children:s.map((d,h)=>{var p,m,g;return _.createElement(Mfe,{...Ife((p=d==null?void 0:d.meta)==null?void 0:p.id),context:r,onChange:y=>l(h,y),onRemove:()=>c(h),key:h,ix:h,value:d.value,id:String((m=d.meta)==null?void 0:m.id),type:(g=d.meta)==null?void 0:g.type})})})]})},Pfe=t=>t===void 0?[!1,"You have to choose a Discount"]:[!0,void 0],MO=[{id:0,type:"regular",name:"Regular Discount",desc:"All Filtered products you defined will get the same discount. For Example: Every shirt will have 10% discount"},{id:1,type:"bulk",name:"Bulk Discount",desc:"Set an exact bulk discount on filtered products. for Example, 3 for 100$, 5 for 5% off"},{id:2,type:"buy_x_get_y",name:"Buy X Get Y",desc:"Buy some from the filtered products and get Y for discount. For Example: Buy 3 pants, get a Shirt for 50% off"},{id:3,type:"order",name:"Order Discount",desc:"Offer a discount on the total order including perks such as Free Shipping"},{id:4,type:"bundle",name:"Bundle Discount",desc:"Offer a discount on a bundle of products. For Example, buy a Laptop + Headset at discount π²"}],Rfe=({selectedType:t,onChange:e})=>{const n=_.useMemo(()=>{var i;return(i=MO.find(s=>s.id===(t==null?void 0:t.id)))==null?void 0:i.desc},[t,MO]),r=({type:i})=>f.jsxs("div",{className:"",children:[f.jsx("input",{type:"radio",id:i.type,name:"discount_type",value:i.type,className:"accent-pink-500",checked:i.type===(t==null?void 0:t.type),onChange:s=>e(i)}),f.jsx("label",{htmlFor:i.type,children:i.name,onClick:s=>e(i),className:"mx-3"})]});return f.jsxs("div",{className:"flex flex-row flex-wrap gap-5 --items-start",children:[f.jsx("div",{className:"flex flex-col gap-2 --flex-shrink-0 w-fit",children:Object.values(Ar).map((i,s)=>f.jsx(r,{type:i},i.type))}),f.jsx("div",{className:"pl-5 border-l-2 shelf-border-color flex-1 min-w-[13rem]",children:f.jsx("p",{children:n,className:"text-gray-500 text-sm tracking-wide"})})]})},jfe=(t,e,n)=>{e=Number.isNaN(e)?0:e,n=Number.isNaN(n)?0:n;const r=(100-e)/100,i=Number.isNaN(n)?"":Math.abs(n)!=0?`${n<0?" - ":" + "} ${Math.abs(n)}`:"";let s=(100-e)/100;return s=typeof r=="number"&&!Number.isNaN(r)?r:"(100 - Percents)/100",s==0?Number.isNaN(n)?0:n:s==1?t+i:t+" * "+s+i},Ffe=({type:t,value:e,onChange:n})=>{const[r,i]=_.useState(e),s=_.useCallback((a,o)=>{const l={...r,[a]:o};i(l),n(l)},[r,n]);return f.jsxs("div",{className:"shelf-text-title-color",children:[f.jsx("p",{children:"Quantity Discount",className:"text-lg font-bold "}),f.jsxs("div",{className:`w-full mt-3 flex flex-row gap-3 items-end
|
681
|
+
from-pink-500/50 to-kf-500/50`})}),f.jsx("div",{className:"w-full flex flex-col gap-5",children:s.map((d,h)=>{var p,m,g;return _.createElement(Mfe,{...Ife((p=d==null?void 0:d.meta)==null?void 0:p.id),context:r,onChange:y=>l(h,y),onRemove:()=>c(h),key:h,ix:h,value:d.value,id:String((m=d.meta)==null?void 0:m.id),type:(g=d.meta)==null?void 0:g.type})})})]})},Pfe=t=>t===void 0?[!1,"You have to choose a Discount"]:[!0,void 0],MO=[{id:0,type:"regular",name:"Regular Discount",desc:"All Filtered products you defined will get the same discount. For Example: Every shirt will have 10% discount"},{id:1,type:"bulk",name:"Bulk Discount",desc:"Set an exact bulk discount on filtered products. for Example, 3 for 100$, 5 for 5% off"},{id:2,type:"buy_x_get_y",name:"Buy X Get Y",desc:"Buy some from the filtered products and get Y for discount. For Example: Buy 3 pants, get a Shirt for 50% off"},{id:3,type:"order",name:"Order Discount",desc:"Offer a discount on the total order including perks such as Free Shipping"},{id:4,type:"bundle",name:"Bundle Discount",desc:"Offer a discount on a bundle of products. For Example, buy a Laptop + Headset at discount π²"}],Rfe=({selectedType:t,onChange:e})=>{const n=_.useMemo(()=>{var i;return(i=MO.find(s=>s.id===(t==null?void 0:t.id)))==null?void 0:i.desc},[t,MO]),r=({type:i})=>f.jsxs("div",{className:"",children:[f.jsx("input",{type:"radio",id:i.type,name:"discount_type",value:i.type,className:"accent-pink-500",checked:i.type===(t==null?void 0:t.type),onChange:s=>e(i)}),f.jsx("label",{htmlFor:i.type,children:i.name,onClick:s=>e(i),className:"mx-3"})]});return f.jsxs("div",{className:"flex flex-row flex-wrap gap-5 --items-start",children:[f.jsx("div",{className:"flex flex-col gap-2 --flex-shrink-0 w-fit",children:Object.values(Ar).filter(i=>i.type).map((i,s)=>f.jsx(r,{type:i},i.type))}),f.jsx("div",{className:"pl-5 border-l-2 shelf-border-color flex-1 min-w-[13rem]",children:f.jsx("p",{children:n,className:"text-gray-500 text-sm tracking-wide"})})]})},jfe=(t,e,n)=>{e=Number.isNaN(e)?0:e,n=Number.isNaN(n)?0:n;const r=(100-e)/100,i=Number.isNaN(n)?"":Math.abs(n)!=0?`${n<0?" - ":" + "} ${Math.abs(n)}`:"";let s=(100-e)/100;return s=typeof r=="number"&&!Number.isNaN(r)?r:"(100 - Percents)/100",s==0?Number.isNaN(n)?0:n:s==1?t+i:t+" * "+s+i},Ffe=({type:t,value:e,onChange:n})=>{const[r,i]=_.useState(e),s=_.useCallback((a,o)=>{const l={...r,[a]:o};i(l),n(l)},[r,n]);return f.jsxs("div",{className:"shelf-text-title-color",children:[f.jsx("p",{children:"Quantity Discount",className:"text-lg font-bold "}),f.jsxs("div",{className:`w-full mt-3 flex flex-row gap-3 items-end
|
683
682
|
flex-wrap text-base `,children:[f.jsxs("p",{children:[f.jsx(yr,{children:"Customer"})," buys a ",f.jsx(yr,{children:"Quantity"})," of"]}),f.jsx(qe,{type:"number",min:"1",step:"1",onWheel:a=>a.target.blur(),value:r.qty,onChange:a=>s("qty",Math.max(parseInt(a.currentTarget.value),1)),inputClsName:"h-7",stroke:"border-b",className:"rounded-md w-14"}),f.jsxs("p",{children:[f.jsx(yr,{children:"products"})," specified by the filters ",f.jsx("b",{children:"ABOVE β¬οΈ"})]})]}),f.jsx("p",{children:`How to discount a bulk of ${r.qty} items`,className:"text-lg font-bold mt-6"}),f.jsxs("div",{className:"w-full mt-5 flex flex-row flex-wrap gap-3 items-center ",children:[f.jsx("label",{children:"Percents off"}),f.jsx(qe,{type:"number",min:"0",max:"100",step:"1",onWheel:a=>a.target.blur(),value:r.percent,onChange:a=>s("percent",Math.min(parseFloat(a.currentTarget.value),100)),inputClsName:"h-7",className:"rounded-lg w-16"}),f.jsx("span",{children:"+",className:"text-2xl font-bold"}),f.jsxs("div",{className:"flex flex-row items-center gap-3",children:[f.jsx("label",{children:"Fixed Price"}),f.jsx(qe,{type:"number",value:r.fixed,onWheel:a=>a.target.blur(),onChange:a=>s("fixed",parseFloat(a.currentTarget.value)),inputClsName:"h-7",className:"rounded-lg w-16"})]})]}),f.jsx("p",{children:"* Fixed Price may be negative.",className:"text-sm mt-5 tracking-wider"}),f.jsx("p",{children:"Other Options",className:"text-lg font-bold mt-6"}),f.jsxs("div",{className:"flex flex-row gap-3 items-center mt-5",children:[f.jsx("input",{id:"cb_recursive",type:"checkbox",checked:r.recursive===!0,onChange:a=>s("recursive",!r.recursive),className:`w-4 h-4 accent-pink-500 border-0 rounded-md
|
684
683
|
focus:ring-0`}),f.jsx("label",{htmlFor:"cb_recursive",children:"Recursive"}),f.jsx("span",{children:"(Apply the discount as much as possible)",className:" text-sm"})]}),f.jsx(Df,{prefix:`total price of ${Number.isNaN(r==null?void 0:r.qty)?1:r.qty}`,percent:r==null?void 0:r.percent,fixed:r==null?void 0:r.fixed})]})},Bfe=t=>{switch(t.meta.op){case Jt.p_all.op:return f.jsxs(f.Fragment,{children:[f.jsx("b",{children:"any"})," product"]});case Jt.p_in_collections.op:{const e=t.value??[];return f.jsxs(f.Fragment,{children:["a product, that belongs to any of the following ",f.jsx("b",{children:"collections"}),":",f.jsx("ol",{className:"list-disc list-inside",children:e.map((n,r)=>f.jsx("li",{children:n.title,className:"font-semibold shelf-text-label-color-second"},r))})]})}case Jt.p_not_in_collections.op:{const e=t.value??[];return f.jsxs(f.Fragment,{children:["a product, that ",f.jsx("span",{className:"underline",children:"does not"}),"Β belong to the following ",f.jsx("b",{children:"collections"}),":",f.jsx("ol",{className:"list-disc list-inside",children:e.map((n,r)=>f.jsx("li",{children:n.title,className:"font-semibold shelf-text-label-color-second"},r))})]})}case Jt.p_in_tags.op:{const e=t.value??[];return f.jsxs(f.Fragment,{children:["a product, that has any of the following ",f.jsx("b",{children:"tags"}),":",f.jsx("ol",{className:"list-disc list-inside",children:e.map((n,r)=>f.jsx("li",{children:n,className:"font-semibold shelf-text-label-color-second"},r))})]})}case Jt.p_not_in_tags.op:{const e=t.value??[];return f.jsxs(f.Fragment,{children:["a product, that has ",f.jsx("span",{className:"underline",children:"does not"}),"Β have any of the following ",f.jsx("b",{children:"tags"}),":",f.jsx("ol",{className:"list-disc list-inside",children:e.map((n,r)=>f.jsx("li",{children:n,className:"font-semibold shelf-text-label-color-second"},r))})]})}case Jt.p_in_products.op:{const e=t.value??[];return f.jsxs(f.Fragment,{children:["a product, that is any of the ",f.jsx("b",{children:"following"}),":",f.jsx("ol",{className:"list-disc list-inside",children:e.map((n,r)=>f.jsx("li",{children:n.title,className:"font-semibold shelf-text-label-color-second"},r))})]})}case Jt.p_not_in_products.op:{const e=t.value??[];return f.jsxs(f.Fragment,{children:["a product, that is ",f.jsx("span",{className:"underline",children:"not"}),"any of the following ",f.jsx("b",{children:"products"}),":",f.jsx("ol",{className:"list-disc list-inside",children:e.map((n,r)=>f.jsx("li",{children:n.title,className:"font-semibold shelf-text-label-color-second"},r))})]})}case Jt.p_in_price_range.op:{const e=t.value;return f.jsxs(f.Fragment,{children:["a product, that is ",f.jsx("b",{children:"priced"})," between",f.jsx("b",{children:` ${(e==null?void 0:e.from)??0}`,className:"shelf-text-label-color-second"})," to",f.jsx("b",{className:"shelf-text-label-color-second",children:` ${(e==null?void 0:e.to)??"Infinity"}`})]})}default:return"WHAT"}},Hfe=t=>{switch(t){case 1:return"1st";case 2:return"2nd";case 3:return"3rd";default:return`${t}th`}},IO=t=>t.meta.type==="product",zfe=({meta:t,value:e,context:n,onChange:r})=>{const[i,s]=_.useState([]),[a,o]=_.useState(e);_.useEffect(()=>{var u;return(()=>{var h;const d=((h=n==null?void 0:n.query["info.filters"])==null?void 0:h.get())??[];s([...d].filter(IO))})(),(u=n==null?void 0:n.pubsub)==null?void 0:u.add_sub((d,h=[])=>{d==="info.filters"&&s(h.filter(IO))})},[n]);const l=_.useCallback((c,u)=>{const d={...a,[c]:u};o(d),r(d)},[a,r]);return f.jsxs("div",{className:"shelf-text-title-color",children:[f.jsx("p",{children:"Bundle Breakdown",className:"text-lg font-bold "}),f.jsxs("div",{className:`w-full mt-2 flex flex-col gap-3 --items-end
|
685
684
|
text-base `,children:[f.jsx(de,{show:i==null?void 0:i.length,children:i.map((c,u)=>f.jsxs("div",{children:[f.jsxs("div",{children:[f.jsx(yr,{children:Hfe(u+1),className:"text-lg shelf-text-label-color"}),"Β item in bundle isΒ ",Bfe(c)]}),f.jsx(kt,{})]},u))}),f.jsx(de,{show:!(i!=null&&i.length),children:f.jsxs("p",{className:"text-base mt-3",children:["Use the ",f.jsx(yr,{children:"products"})," filters ",f.jsx("b",{children:"ABOVE β¬οΈ"}),". ",f.jsx("br",{}),"Each ",f.jsx(yr,{children:"filter"})," is a bundle item"]})})]}),f.jsx("p",{children:"How to discount a Bundle",className:"text-lg font-bold mt-6"}),f.jsxs("div",{className:"w-full mt-5 flex flex-row flex-wrap gap-3 items-center ",children:[f.jsx("label",{children:"Percents off"}),f.jsx(qe,{type:"number",min:"0",max:"100",step:"1",onWheel:c=>c.target.blur(),value:a.percent,onChange:c=>l("percent",Math.min(parseFloat(c.currentTarget.value),100)),inputClsName:"h-7",className:"rounded-lg w-16"}),f.jsx("span",{children:"+",className:"text-2xl font-bold"}),f.jsxs("div",{className:"flex flex-row items-center gap-3",children:[f.jsx("label",{children:"Fixed Price"}),f.jsx(qe,{type:"number",value:a.fixed,onWheel:c=>c.target.blur(),onChange:c=>l("fixed",parseFloat(c.currentTarget.value)),inputClsName:"h-7",className:"rounded-lg w-16"})]})]}),f.jsx("p",{children:"* Fixed Price may be negative. ",className:"text-sm mt-5 tracking-wider"}),f.jsx("p",{children:"Other Options",className:"text-lg font-bold mt-6"}),f.jsxs("div",{className:"flex flex-row gap-3 items-center mt-5",children:[f.jsx("input",{id:"cb_recursive",type:"checkbox",checked:a.recursive===!0,onChange:c=>l("recursive",!a.recursive),className:`w-4 h-4 accent-pink-500 border-0 rounded-md
|
@@ -729,14 +728,13 @@ have a high order number`,editable:!0,comp:Q(Me(Pe),{className:"h-10",type:"numb
|
|
729
728
|
shelf-input-color shelf-border-color border rounded-md`,children:[f.jsx(Xt,{className:`rounded-md overflow-x-scroll
|
730
729
|
text-base min-h-8 align-middle
|
731
730
|
flex flex-row items-center`,value:t}),f.jsx(p9,{value:t,process_before_copy:e})]})}),Dhe=({user:t,removePromise:e})=>f.jsxs("div",{className:`flex flex-row justify-between items-center
|
732
|
-
w-full shelf-input-color p-2 rounded-md `,children:[f.jsxs("div",{className:"w-3/4 overflow-x-scroll ",children:[f.jsx("p",{children:"email: "+t.email,className:"font-mono whitespace-nowrap"}),f.jsx("p",{children:`created at ${new Date(t.created_at).toLocaleDateString()}`,className:"font-mono"})]}),f.jsx(Jr,{text:"revoke",Icon:f.jsx(GB,{}),className:"h-6",rounded:"rounded-md",keep_text_on_load:!0,onClick:()=>e(t)})]}),Ohe=({...t})=>{var p,m;const{actions:{apikeys:{create:e,list:n},users:{remove:r}}}=k4(),[i,s]=_.useState([]),[a,o]=_.useState(""),[l,c]=_.useState();_.useEffect(()=>{u()},[]);const u=_.useCallback(()=>{n().then(s).catch(c)},[]),d=_.useCallback(g=>r(g.id).then(u).catch(c),[]),h=_.useCallback(()=>e().then(g=>{o(g),u()}).catch(c),[]);return f.jsxs(Gs,{name:"π API Keys",desc:"Manage your API keys",border:!0,error:(m=(p=l==null?void 0:l.messages)==null?void 0:p[0])==null?void 0:m.message,setError:c,...t,children:[f.jsx("div",{className:"flex flex-col gap-3 w-full max-h-56 overflow-y-scroll",children:i.map(g=>f.jsx(Dhe,{user:g,removePromise:d},g.email))}),f.jsxs("div",{className:"flex flex-col gap-3 mt-3 w-full",children:[f.jsx(as,{Icon:void 0,text:"+ create new api key",show:!0,onClick:h,keep_text_on_load:!0,classNameLoading:"text-xs",className:"w-fit text-base shelf-text-label-color underline self-end "}),f.jsxs(de,{show:a,children:[f.jsx(kt,{className:"my-2"}),f.jsx("span",{children:"latest api key (only visible to you)"}),f.jsx(Ahe,{value:`\`${a}\``,process_before_copy:g=>g.slice(1,-1)})]})]})]})},Mhe=({...t})=>{var d,h;const{auth:e,actions:{changePassword:n}}=k4(),r=_.useRef(),i=_.useRef(),s=_.useRef(),[a,o]=_.useState(),[l,c]=_.useState(!1),u=_.useCallback(async()=>{try{c(!1),await n({user_id_or_email:e.user_id,current_password:String(r.current.value),new_password:String(i.current.value),confirm_new_password:String(s.current.value)}),c(!0)}catch(p){console.log("ee ",p),o(p)}},[n]);return f.jsxs(Gs,{name:"π Change Password",desc:"Change Your Password",border:!0,error:(h=(d=a==null?void 0:a.messages)==null?void 0:d[0])==null?void 0:h.message,setError:o,...t,children:[f.jsx("div",{className:"flex flex-col gap-3 w-full max-h-56 overflow-y-scroll"}),f.jsxs("div",{className:"flex flex-col gap-3 --mt-3 w-full",children:[f.jsx("p",{children:"Current Password"}),f.jsx(qe,{stroke:"border-none",ref:r}),f.jsx("p",{children:"New Password"}),f.jsx(qe,{stroke:"border-none",ref:i}),f.jsx("p",{children:"Confirm New Password"}),f.jsx(qe,{stroke:"border-none",ref:s}),f.jsxs("div",{className:"w-full flex flex-row justify-between mt-3",children:[f.jsxs(K5,{toggle:l,children:[f.jsxs("div",{className:"w-full flex flex-row items-center gap-2 text-xl text-green-500 dark:text-green-400",children:[f.jsx(qP,{}),f.jsx("span",{children:"All done",className:"text-base font-normal"})]}),f.jsx("span",{})]}),f.jsx(Jr,{Icon:f.jsx(HR,{}),text:"update",show:!0,onClick:u,keep_text_on_load:!0,classNameLoading:"text-xs",rounded:"rounded-md",className:"w-fit text-base shelf-text-label-color self-end "})]})]})]})},Ihe=t=>{let e=`Here is what you need to know:
|
731
|
+
w-full shelf-input-color p-2 rounded-md `,children:[f.jsxs("div",{className:"w-3/4 overflow-x-scroll ",children:[f.jsx("p",{children:"email: "+t.email,className:"font-mono whitespace-nowrap"}),f.jsx("p",{children:`created at ${new Date(t.created_at).toLocaleDateString()}`,className:"font-mono"})]}),f.jsx(Jr,{text:"revoke",Icon:f.jsx(GB,{}),className:"h-6",rounded:"rounded-md",keep_text_on_load:!0,onClick:()=>e(t)})]}),Ohe=({...t})=>{var p,m;const{actions:{apikeys:{create:e,list:n},users:{remove:r}}}=k4(),[i,s]=_.useState([]),[a,o]=_.useState(""),[l,c]=_.useState();_.useEffect(()=>{u()},[]);const u=_.useCallback(()=>{n().then(s).catch(c)},[]),d=_.useCallback(g=>r(g.id).then(u).catch(c),[]),h=_.useCallback(()=>e().then(g=>{o(g),u()}).catch(c),[]);return f.jsxs(Gs,{name:"π API Keys",desc:"Manage your API keys",border:!0,error:(m=(p=l==null?void 0:l.messages)==null?void 0:p[0])==null?void 0:m.message,setError:c,...t,children:[f.jsx("div",{className:"flex flex-col gap-3 w-full max-h-56 overflow-y-scroll",children:i.map(g=>f.jsx(Dhe,{user:g,removePromise:d},g.email))}),f.jsxs("div",{className:"flex flex-col gap-3 mt-3 w-full",children:[f.jsx(as,{Icon:void 0,text:"+ create new api key",show:!0,onClick:h,keep_text_on_load:!0,classNameLoading:"text-xs",className:"w-fit text-base shelf-text-label-color underline self-end "}),f.jsxs(de,{show:a,children:[f.jsx(kt,{className:"my-2"}),f.jsx("span",{children:"latest api key (only visible to you)"}),f.jsx(Ahe,{value:`\`${a}\``,process_before_copy:g=>g.slice(1,-1)})]})]})]})},Mhe=({...t})=>{var d,h;const{auth:e,actions:{changePassword:n}}=k4(),r=_.useRef(),i=_.useRef(),s=_.useRef(),[a,o]=_.useState(),[l,c]=_.useState(!1),u=_.useCallback(async()=>{try{c(!1),await n({user_id_or_email:e.user_id,current_password:String(r.current.value),new_password:String(i.current.value),confirm_new_password:String(s.current.value)}),c(!0)}catch(p){console.log("ee ",p),o(p)}},[n]);return f.jsxs(Gs,{name:"π Change Password",desc:"Change Your Password",border:!0,error:(h=(d=a==null?void 0:a.messages)==null?void 0:d[0])==null?void 0:h.message,setError:o,...t,children:[f.jsx("div",{className:"flex flex-col gap-3 w-full max-h-56 overflow-y-scroll"}),f.jsxs("div",{className:"flex flex-col gap-3 --mt-3 w-full",children:[f.jsx("p",{children:"Current Password"}),f.jsx(qe,{stroke:"border-none",ref:r}),f.jsx("p",{children:"New Password"}),f.jsx(qe,{stroke:"border-none",ref:i}),f.jsx("p",{children:"Confirm New Password"}),f.jsx(qe,{stroke:"border-none",ref:s}),f.jsxs("div",{className:"w-full flex flex-row justify-between mt-3",children:[f.jsxs(K5,{toggle:l,children:[f.jsxs("div",{className:"w-full flex flex-row items-center gap-2 text-xl text-green-500 dark:text-green-400",children:[f.jsx(qP,{}),f.jsx("span",{children:"All done",className:"text-base font-normal"})]}),f.jsx("span",{})]}),f.jsx(Jr,{Icon:f.jsx(HR,{}),text:"update",show:!0,onClick:u,keep_text_on_load:!0,classNameLoading:"text-xs",rounded:"rounded-md",className:"w-fit text-base shelf-text-label-color self-end "})]})]})]})},Ihe=t=>{var n,r;let e=`Here is what you need to know:
|
733
732
|
|
734
733
|
`;return t!=null&&t.auth_admins_emails&&(e=`- The following are the **admin** emails:
|
735
|
-
`+(t==null?void 0:t.auth_admins_emails.map(
|
736
|
-
`))),t!=null&&t.
|
737
|
-
-
|
738
|
-
- **JWT**
|
739
|
-
- **JWT** refresh token \`secret\` is **${t==null?void 0:t.auth_secret_refresh_token}**`),e},Lhe=t=>{const e=(t==null?void 0:t.general_store_name)??"unknown right now",n=(t==null?void 0:t.general_store_website)??"unknown right now",r=(t==null?void 0:t.general_store_support_email)??"unknown right now",i=(t==null?void 0:t.general_store_description)??"You still have not written one";return`Hi π, **your** store name is \`${e}\`, your store's
|
734
|
+
`+(t==null?void 0:t.auth_admins_emails.map(i=>` - ${i}`).join(`
|
735
|
+
`))),t!=null&&t.auth_secret_access_token&&(e+=`
|
736
|
+
- **JWT** access token \`secret\` is **${((n=t==null?void 0:t.auth_secret_access_token)==null?void 0:n.slice(0,4))+"------------"}**`),t!=null&&t.auth_secret_refresh_token&&(e+=`
|
737
|
+
- **JWT** refresh token \`secret\` is **${((r=t==null?void 0:t.auth_secret_refresh_token)==null?void 0:r.slice(0,4))+"------------"}**`),e},Lhe=t=>{const e=(t==null?void 0:t.general_store_name)??"unknown right now",n=(t==null?void 0:t.general_store_website)??"unknown right now",r=(t==null?void 0:t.general_store_support_email)??"unknown right now",i=(t==null?void 0:t.general_store_description)??"You still have not written one";return`Hi π, **your** store name is \`${e}\`, your store's
|
740
738
|
website is ${n} and the support email is ${r} .
|
741
739
|
|
742
740
|
|