@billgangcom/theme-lib 1.21.0 → 1.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,7 +63,7 @@ React keys must be passed directly to JSX without using spread:
63
63
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const s=new this(t);return r.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[j1]=this[j1]={accessors:{}}).accessors,n=this.prototype;function o(i){const l=To(i);s[l]||(F6(n,i),s[l]=!0)}return H.isArray(t)?t.forEach(o):o(t),this}}Gt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);H.reduceDescriptors(Gt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[r]=s}}});H.freezeMethods(Gt);function Vl(e,t){const r=this||Pi,s=t||r,n=Gt.from(s.headers);let o=s.data;return H.forEach(e,function(l){o=l.call(r,o,n.normalize(),t?t.status:void 0)}),n.normalize(),o}function lm(e){return!!(e&&e.__CANCEL__)}function eo(e,t,r){De.call(this,e??"canceled",De.ERR_CANCELED,t,r),this.name="CanceledError"}H.inherits(eo,De,{__CANCEL__:!0});function cm(e,t,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?e(r):t(new De("Request failed with status code "+r.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function B6(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function H6(e,t){e=e||10;const r=new Array(e),s=new Array(e);let n=0,o=0,i;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=s[o];i||(i=u),r[n]=c,s[n]=u;let h=o,f=0;for(;h!==n;)f+=r[h++],h=h%e;if(n=(n+1)%e,n===o&&(o=(o+1)%e),u-i<t)return;const v=d&&u-d;return v?Math.round(f*1e3/v):void 0}}function V6(e,t){let r=0,s=1e3/t,n,o;const i=(u,d=Date.now())=>{r=d,n=null,o&&(clearTimeout(o),o=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),h=d-r;h>=s?i(u,d):(n=u,o||(o=setTimeout(()=>{o=null,i(n)},s-h)))},()=>n&&i(n)]}const ja=(e,t,r=3)=>{let s=0;const n=H6(50,250);return V6(o=>{const i=o.loaded,l=o.lengthComputable?o.total:void 0,c=i-s,u=n(c),d=i<=l;s=i;const h={loaded:i,total:l,progress:l?i/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-i)/u:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(h)},r)},T1=(e,t)=>{const r=e!=null;return[s=>t[0]({lengthComputable:r,total:e,loaded:s}),t[1]]},N1=e=>(...t)=>H.asap(()=>e(...t)),$6=Yt.hasStandardBrowserEnv?function(){const t=Yt.navigator&&/(msie|trident)/i.test(Yt.navigator.userAgent),r=document.createElement("a");let s;function n(o){let i=o;return t&&(r.setAttribute("href",i),i=r.href),r.setAttribute("href",i),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=n(window.location.href),function(i){const l=H.isString(i)?n(i):i;return l.protocol===s.protocol&&l.host===s.host}}():function(){return function(){return!0}}(),U6=Yt.hasStandardBrowserEnv?{write(e,t,r,s,n,o){const i=[e+"="+encodeURIComponent(t)];H.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),H.isString(s)&&i.push("path="+s),H.isString(n)&&i.push("domain="+n),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function W6(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function z6(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function um(e,t){return e&&!W6(t)?z6(e,t):t}const q1=e=>e instanceof Gt?{...e}:e;function ln(e,t){t=t||{};const r={};function s(u,d,h){return H.isPlainObject(u)&&H.isPlainObject(d)?H.merge.call({caseless:h},u,d):H.isPlainObject(d)?H.merge({},d):H.isArray(d)?d.slice():d}function n(u,d,h){if(H.isUndefined(d)){if(!H.isUndefined(u))return s(void 0,u,h)}else return s(u,d,h)}function o(u,d){if(!H.isUndefined(d))return s(void 0,d)}function i(u,d){if(H.isUndefined(d)){if(!H.isUndefined(u))return s(void 0,u)}else return s(void 0,d)}function l(u,d,h){if(h in t)return s(u,d);if(h in e)return s(void 0,u)}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,d)=>n(q1(u),q1(d),!0)};return H.forEach(Object.keys(Object.assign({},e,t)),function(d){const h=c[d]||n,f=h(e[d],t[d],d);H.isUndefined(f)&&h!==l||(r[d]=f)}),r}const dm=e=>{const t=ln({},e);let{data:r,withXSRFToken:s,xsrfHeaderName:n,xsrfCookieName:o,headers:i,auth:l}=t;t.headers=i=Gt.from(i),t.url=om(um(t.baseURL,t.url),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(H.isFormData(r)){if(Yt.hasStandardBrowserEnv||Yt.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((c=i.getContentType())!==!1){const[u,...d]=c?c.split(";").map(h=>h.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Yt.hasStandardBrowserEnv&&(s&&H.isFunction(s)&&(s=s(t)),s||s!==!1&&$6(t.url))){const u=n&&o&&U6.read(o);u&&i.set(n,u)}return t},Z6=typeof XMLHttpRequest<"u",Y6=Z6&&function(e){return new Promise(function(r,s){const n=dm(e);let o=n.data;const i=Gt.from(n.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=n,d,h,f,v,m;function p(){v&&v(),m&&m(),n.cancelToken&&n.cancelToken.unsubscribe(d),n.signal&&n.signal.removeEventListener("abort",d)}let g=new XMLHttpRequest;g.open(n.method.toUpperCase(),n.url,!0),g.timeout=n.timeout;function y(){if(!g)return;const E=Gt.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),w={data:!l||l==="text"||l==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:E,config:e,request:g};cm(function(j){r(j),p()},function(j){s(j),p()},w),g=null}"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(y)},g.onabort=function(){g&&(s(new De("Request aborted",De.ECONNABORTED,e,g)),g=null)},g.onerror=function(){s(new De("Network Error",De.ERR_NETWORK,e,g)),g=null},g.ontimeout=function(){let S=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const w=n.transitional||im;n.timeoutErrorMessage&&(S=n.timeoutErrorMessage),s(new De(S,w.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,e,g)),g=null},o===void 0&&i.setContentType(null),"setRequestHeader"in g&&H.forEach(i.toJSON(),function(S,w){g.setRequestHeader(w,S)}),H.isUndefined(n.withCredentials)||(g.withCredentials=!!n.withCredentials),l&&l!=="json"&&(g.responseType=n.responseType),u&&([f,m]=ja(u,!0),g.addEventListener("progress",f)),c&&g.upload&&([h,v]=ja(c),g.upload.addEventListener("progress",h),g.upload.addEventListener("loadend",v)),(n.cancelToken||n.signal)&&(d=E=>{g&&(s(!E||E.type?new eo(null,e,g):E),g.abort(),g=null)},n.cancelToken&&n.cancelToken.subscribe(d),n.signal&&(n.signal.aborted?d():n.signal.addEventListener("abort",d)));const b=B6(n.url);if(b&&Yt.protocols.indexOf(b)===-1){s(new De("Unsupported protocol "+b+":",De.ERR_BAD_REQUEST,e));return}g.send(o||null)})},G6=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let s=new AbortController,n;const o=function(u){if(!n){n=!0,l();const d=u instanceof Error?u:this.reason;s.abort(d instanceof De?d:new eo(d instanceof Error?d.message:d))}};let i=t&&setTimeout(()=>{i=null,o(new De(`timeout ${t} of ms exceeded`,De.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:c}=s;return c.unsubscribe=()=>H.asap(l),c}},K6=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let s=0,n;for(;s<r;)n=s+t,yield e.slice(s,n),s=n},X6=async function*(e,t){for await(const r of J6(e))yield*K6(r,t)},J6=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:s}=await t.read();if(r)break;yield s}}finally{await t.cancel()}},D1=(e,t,r,s)=>{const n=X6(e,t);let o=0,i,l=c=>{i||(i=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await n.next();if(u){l(),c.close();return}let h=d.byteLength;if(r){let f=o+=h;r(f)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),n.return()}},{highWaterMark:2})},cl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",fm=cl&&typeof ReadableStream=="function",Q6=cl&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),hm=(e,...t)=>{try{return!!e(...t)}catch{return!1}},e4=fm&&hm(()=>{let e=!1;const t=new Request(Yt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),O1=64*1024,Dc=fm&&hm(()=>H.isReadableStream(new Response("").body)),Ta={stream:Dc&&(e=>e.body)};cl&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ta[t]&&(Ta[t]=H.isFunction(e[t])?r=>r[t]():(r,s)=>{throw new De(`Response type '${t}' is not supported`,De.ERR_NOT_SUPPORT,s)})})})(new Response);const t4=async e=>{if(e==null)return 0;if(H.isBlob(e))return e.size;if(H.isSpecCompliantForm(e))return(await new Request(Yt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(H.isArrayBufferView(e)||H.isArrayBuffer(e))return e.byteLength;if(H.isURLSearchParams(e)&&(e=e+""),H.isString(e))return(await Q6(e)).byteLength},r4=async(e,t)=>{const r=H.toFiniteNumber(e.getContentLength());return r??t4(t)},s4=cl&&(async e=>{let{url:t,method:r,data:s,signal:n,cancelToken:o,timeout:i,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:f}=dm(e);u=u?(u+"").toLowerCase():"text";let v=G6([n,o&&o.toAbortSignal()],i),m;const p=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let g;try{if(c&&e4&&r!=="get"&&r!=="head"&&(g=await r4(d,s))!==0){let w=new Request(t,{method:"POST",body:s,duplex:"half"}),R;if(H.isFormData(s)&&(R=w.headers.get("content-type"))&&d.setContentType(R),w.body){const[j,P]=T1(g,ja(N1(c)));s=D1(w.body,O1,j,P)}}H.isString(h)||(h=h?"include":"omit");const y="credentials"in Request.prototype;m=new Request(t,{...f,signal:v,method:r.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:y?h:void 0});let b=await fetch(m);const E=Dc&&(u==="stream"||u==="response");if(Dc&&(l||E&&p)){const w={};["status","statusText","headers"].forEach(D=>{w[D]=b[D]});const R=H.toFiniteNumber(b.headers.get("content-length")),[j,P]=l&&T1(R,ja(N1(l),!0))||[];b=new Response(D1(b.body,O1,j,()=>{P&&P(),p&&p()}),w)}u=u||"text";let S=await Ta[H.findKey(Ta,u)||"text"](b,e);return!E&&p&&p(),await new Promise((w,R)=>{cm(w,R,{data:S,headers:Gt.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:m})})}catch(y){throw p&&p(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new De("Network Error",De.ERR_NETWORK,e,m),{cause:y.cause||y}):De.from(y,y&&y.code,e,m)}}),Oc={http:x6,xhr:Y6,fetch:s4};H.forEach(Oc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const R1=e=>`- ${e}`,n4=e=>H.isFunction(e)||e===null||e===!1,mm={getAdapter:e=>{e=H.isArray(e)?e:[e];const{length:t}=e;let r,s;const n={};for(let o=0;o<t;o++){r=e[o];let i;if(s=r,!n4(r)&&(s=Oc[(i=String(r)).toLowerCase()],s===void 0))throw new De(`Unknown adapter '${i}'`);if(s)break;n[i||"#"+o]=s}if(!s){const o=Object.entries(n).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
64
64
  `+o.map(R1).join(`
65
65
  `):" "+R1(o[0]):"as no adapter specified";throw new De("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s},adapters:Oc};function $l(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eo(null,e)}function k1(e){return $l(e),e.headers=Gt.from(e.headers),e.data=Vl.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),mm.getAdapter(e.adapter||Pi.adapter)(e).then(function(s){return $l(e),s.data=Vl.call(e,e.transformResponse,s),s.headers=Gt.from(s.headers),s},function(s){return lm(s)||($l(e),s&&s.response&&(s.response.data=Vl.call(e,e.transformResponse,s.response),s.response.headers=Gt.from(s.response.headers))),Promise.reject(s)})}const pm="1.7.7",Ou={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ou[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const L1={};Ou.transitional=function(t,r,s){function n(o,i){return"[Axios v"+pm+"] Transitional option '"+o+"'"+i+(s?". "+s:"")}return(o,i,l)=>{if(t===!1)throw new De(n(i," has been removed"+(r?" in "+r:"")),De.ERR_DEPRECATED);return r&&!L1[i]&&(L1[i]=!0,console.warn(n(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,i,l):!0}};function o4(e,t,r){if(typeof e!="object")throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let n=s.length;for(;n-- >0;){const o=s[n],i=t[o];if(i){const l=e[o],c=l===void 0||i(l,o,e);if(c!==!0)throw new De("option "+o+" must be "+c,De.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new De("Unknown option "+o,De.ERR_BAD_OPTION)}}const Rc={assertOptions:o4,validators:Ou},xs=Rc.validators;class sn{constructor(t){this.defaults=t,this.interceptors={request:new _1,response:new _1}}async request(t,r){try{return await this._request(t,r)}catch(s){if(s instanceof Error){let n;Error.captureStackTrace?Error.captureStackTrace(n={}):n=new Error;const o=n.stack?n.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
66
- `+o):s.stack=o}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ln(this.defaults,r);const{transitional:s,paramsSerializer:n,headers:o}=r;s!==void 0&&Rc.assertOptions(s,{silentJSONParsing:xs.transitional(xs.boolean),forcedJSONParsing:xs.transitional(xs.boolean),clarifyTimeoutError:xs.transitional(xs.boolean)},!1),n!=null&&(H.isFunction(n)?r.paramsSerializer={serialize:n}:Rc.assertOptions(n,{encode:xs.function,serialize:xs.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&H.merge(o.common,o[r.method]);o&&H.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),r.headers=Gt.concat(i,o);const l=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(c=c&&p.synchronous,l.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,h=0,f;if(!c){const m=[k1.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,u),f=m.length,d=Promise.resolve(r);h<f;)d=d.then(m[h++],m[h++]);return d}f=l.length;let v=r;for(h=0;h<f;){const m=l[h++],p=l[h++];try{v=m(v)}catch(g){p.call(this,g);break}}try{d=k1.call(this,v)}catch(m){return Promise.reject(m)}for(h=0,f=u.length;h<f;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=ln(this.defaults,t);const r=um(t.baseURL,t.url);return om(r,t.params,t.paramsSerializer)}}H.forEach(["delete","get","head","options"],function(t){sn.prototype[t]=function(r,s){return this.request(ln(s||{},{method:t,url:r,data:(s||{}).data}))}});H.forEach(["post","put","patch"],function(t){function r(s){return function(o,i,l){return this.request(ln(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}sn.prototype[t]=r(),sn.prototype[t+"Form"]=r(!0)});class Ru{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const s=this;this.promise.then(n=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](n);s._listeners=null}),this.promise.then=n=>{let o;const i=new Promise(l=>{s.subscribe(l),o=l}).then(n);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,l){s.reason||(s.reason=new eo(o,i,l),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Ru(function(n){t=n}),cancel:t}}}function i4(e){return function(r){return e.apply(null,r)}}function a4(e){return H.isObject(e)&&e.isAxiosError===!0}const kc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(kc).forEach(([e,t])=>{kc[t]=e});function vm(e){const t=new sn(e),r=Zh(sn.prototype.request,t);return H.extend(r,sn.prototype,t,{allOwnKeys:!0}),H.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return vm(ln(e,n))},r}const Ct=vm(Pi);Ct.Axios=sn;Ct.CanceledError=eo;Ct.CancelToken=Ru;Ct.isCancel=lm;Ct.VERSION=pm;Ct.toFormData=ll;Ct.AxiosError=De;Ct.Cancel=Ct.CanceledError;Ct.all=function(t){return Promise.all(t)};Ct.spread=i4;Ct.isAxiosError=a4;Ct.mergeConfig=ln;Ct.AxiosHeaders=Gt;Ct.formToJSON=e=>am(H.isHTMLForm(e)?new FormData(e):e);Ct.getAdapter=mm.getAdapter;Ct.HttpStatusCode=kc;Ct.default=Ct;const l4=async(e,t,r)=>{const s=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${Ci}/v2/builder/shops/${s}/drafts/${n}/${t}`;return to({url:o,withToken:!0,method:e,body:r})},c4=async()=>{const e=localStorage.getItem("shopId")||void 0,t=`${Ci}/v1/dash/shops/${e}/images`;return to({url:t,withToken:!0,method:"get"})},u4=async e=>{const t=localStorage.getItem("shopId")||void 0,r=`${Ci}/v1/dash/shops/${t}/images`;return to({url:r,withToken:!0,method:"post",body:e})},d4=async e=>{const t=localStorage.getItem("shopId")||void 0,r=localStorage.getItem("draftId"),s=`${Ci}/v2/builder/shops/${t}/drafts/${r}/pages/${e}`;return to({url:s,withToken:!0,method:"delete"})},f4=async e=>{const t=window.location.hostname.includes("localhost")?"subscriptions.billgang.store":window.location.hostname,r=`${zh}/v2/shops/${t}/pages/${e}`;try{return to({url:r,withToken:!0,method:"get"})}catch(s){if(Ct.isAxiosError(s)&&s.response&&s.response.status===404)return null;throw s}},h4=async()=>{const e=window.location.hostname.includes("localhost")?"subscriptions.billgang.store":window.location.hostname,t=`${zh}/v2/shops/${e}/settings-theme`;return to({url:t,withToken:!0,method:"get"})},to=async e=>{const{url:t,withToken:r,method:s,body:n}=e,o=r?localStorage.getItem("sellerAccessToken"):null;return(await Ct[s](t,{...n},{headers:{Authorization:`Bearer ${o}`,"Content-Type":"multipart/form-data"}})).data},A1=e=>{let t;const r=new Set,s=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const f=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(v=>v(t,f))}},n=()=>t,l={setState:s,getState:n,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(s,n,l);return l},m4=e=>e?A1(e):A1,p4=e=>e;function v4(e,t=p4){const r=x.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return x.useDebugValue(r),r}const I1=e=>{const t=m4(e),r=s=>v4(t,s);return Object.assign(r,t),r},Jt=e=>e?I1(e):I1,g4=Jt(e=>({blocks:null,setBlocks:t=>e(()=>({blocks:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),sourceBlocks:{},setSourceBlocks:t=>e(()=>({sourceBlocks:t})),currentInstance:null,setCurrentInstance:t=>e(()=>({currentInstance:t}))})),x4=Jt(e=>({currentDevice:{icon:"Desktop",value:"desktop"},setCurrentDevice:t=>e(()=>({currentDevice:t}))}));Jt(e=>({pageData:null,setPageData:t=>e(()=>({pageData:t}))}));const y4=Jt(e=>({activeBlock:Wh[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function b4(e,t){let r;try{r=e()}catch{return}return{getItem:n=>{var o;const i=c=>c===null?null:JSON.parse(c,void 0),l=(o=r.getItem(n))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(n,o)=>r.setItem(n,JSON.stringify(o,void 0)),removeItem:n=>r.removeItem(n)}}const Lc=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(s){return Lc(s)(r)},catch(s){return this}}}catch(r){return{then(s){return this},catch(s){return Lc(s)(r)}}}},C4=(e,t)=>(r,s,n)=>{let o={storage:b4(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},i=!1;const l=new Set,c=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...p)},s,n);const d=()=>{const p=o.partialize({...s()});return u.setItem(o.name,{state:p,version:o.version})},h=n.setState;n.setState=(p,g)=>{h(p,g),d()};const f=e((...p)=>{r(...p),d()},s,n);n.getInitialState=()=>f;let v;const m=()=>{var p,g;if(!u)return;i=!1,l.forEach(b=>{var E;return b((E=s())!=null?E:f)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=s())!=null?p:f))||void 0;return Lc(u.getItem.bind(u))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate)return[!0,o.migrate(b.state,b.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var E;const[S,w]=b;if(v=o.merge(w,(E=s())!=null?E:f),r(v,!0),S)return d()}).then(()=>{y==null||y(v,void 0),v=s(),i=!0,c.forEach(b=>b(v))}).catch(b=>{y==null||y(void 0,b)})};return n.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:p=>(l.add(p),()=>{l.delete(p)}),onFinishHydration:p=>(c.add(p),()=>{c.delete(p)})},o.skipHydration||m(),v||f},ul=C4,w4=Jt(ul(e=>({onPreview:!1,setOnPreview:t=>e(()=>({onPreview:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t}))}),{name:"preview-storage",partialize:e=>{const{onPreview:t}=e;return{onPreview:t}}}));var Rt=[];for(var Ul=0;Ul<256;++Ul)Rt.push((Ul+256).toString(16).slice(1));function P4(e,t=0){return(Rt[e[t+0]]+Rt[e[t+1]]+Rt[e[t+2]]+Rt[e[t+3]]+"-"+Rt[e[t+4]]+Rt[e[t+5]]+"-"+Rt[e[t+6]]+Rt[e[t+7]]+"-"+Rt[e[t+8]]+Rt[e[t+9]]+"-"+Rt[e[t+10]]+Rt[e[t+11]]+Rt[e[t+12]]+Rt[e[t+13]]+Rt[e[t+14]]+Rt[e[t+15]]).toLowerCase()}var Zi,S4=new Uint8Array(16);function E4(){if(!Zi&&(Zi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zi(S4)}var _4=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const M1={randomUUID:_4};function Na(e,t,r){if(M1.randomUUID&&!t&&!e)return M1.randomUUID();e=e||{};var s=e.random||(e.rng||E4)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,P4(s)}const Fo=Jt(ul((e,t)=>({header:null,blocks:{},footer:null,currentBlock:null,positionBlock:null,setBlocks:r=>{e({blocks:r})},setHeader:r=>{e({header:r})},setFooter:r=>{e({footer:r})},createPage:r=>{const s=t().blocks;s[r]={},e({blocks:s})},deletePage:r=>{const s=t().blocks;delete s[r],e({blocks:s})},updatePage:(r,s)=>{const n=t().blocks;if(n[s])return;const o=n[r];delete n[r],n[s]=o,e({blocks:n})},setCurrentBlock:r=>{e({currentBlock:r})},setPositionBlock:r=>{e({positionBlock:r})},addBlock:(r,s)=>{const n=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));kn.getState().addHistory(n),console.log("addHistory");const o=t().blocks,i=o[r]||{},l=t().positionBlock,c=Na();i[c]={name:s.name,value:s.value};const u=Object.keys(i);if(l===null||l>=u.length)e({blocks:{...o,[r]:i}});else{const d={name:s.name,value:{...s.value}},h=u.slice(0,l),f=u.slice(l),v={...h.reduce((m,p)=>(m[p]=i[p],m),{}),[c]:d,...f.reduce((m,p)=>(m[p]=i[p],m),{})};e({blocks:{...o,[r]:v}})}},editBlock:(r,s,n)=>{const o=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));kn.getState().addHistory(o),console.log("addHistory");const i=t().blocks,l=i[r]||{};l[s]={name:n.name,value:{...n.value}},e({blocks:{...i,[r]:l}})},removeBlock:(r,s)=>{const n={...t().blocks};kn.getState().addHistory(n);const o=t().blocks,i=o[r]||{};delete i[s],e({blocks:{...o,[r]:i}})},moveBlock:(r,s,n)=>e(o=>{const i=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));kn.getState().addHistory(i);const l={...o.blocks[r]},c=Object.keys(l),[u]=c.splice(s,1);c.splice(n,0,u);const d=c.reduce((h,f)=>(h[f]=l[f],h),{});return{blocks:{...o.blocks,[r]:d}}}),duplicateBlock:(r,s)=>{const n=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));kn.getState().addHistory(n);const{blocks:o}=t(),i=o[r],l=i[s],c=Na(),u={name:l.name,value:{...l.value}},d=Object.keys(i),h=d.indexOf(s),f=d.slice(0,h+1),v=d.slice(h+1),m={...f.reduce((p,g)=>(p[g]=i[g],p),{}),[c]:u,...v.reduce((p,g)=>(p[g]=i[g],p),{})};e({blocks:{...o,[r]:m}})}}),{name:"layers-storage",partialize:e=>{const{blocks:t,header:r,footer:s}=e;return{blocks:t,header:r,footer:s}}})),gm=Jt((e,t)=>({isModalVisible:!1,hoverBlockId:null,isMouseOverModal:!1,hideTimeout:null,setHoverBlockId:r=>{e({hoverBlockId:r})},showModal:r=>{t().hideTimeout&&clearTimeout(t().hideTimeout),e({isModalVisible:!0,hoverBlockId:r})},hideModal:()=>{e({isModalVisible:!1,hoverBlockId:null})},startHideTimeout:()=>{if(!t().isMouseOverModal){const r=setTimeout(()=>{e({isModalVisible:!1,hoverBlockId:null})},500);e({hideTimeout:r})}},clearHideTimeout:()=>{t().hideTimeout&&(clearTimeout(t().hideTimeout),e({hideTimeout:null}))},setMouseOverModal:r=>{e({isMouseOverModal:r})},isPreviewVisible:!1,showPreview:r=>{e({isPreviewVisible:!0,hoverBlockId:r})},hidePreview:()=>{e({isPreviewVisible:!1,hoverBlockId:null})}})),j4=Jt(e=>({activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),activeFont:null,setActiveFont:t=>e(()=>({activeFont:t})),setThemeSettings:t=>e(()=>({themeSettings:t})),themeSettings:{colors:{brand:{primary:"#fefefe",secondary:"#fefefe",toner:"#ffffff"},background:{primary:"#fefefe",secondary:"#000000"},text_icons:{primary:"#000000",secondary:"#fefefe",tertiary:"#fefefe",disabled:"#ffffff"},lines:{divider:"#000000",border:"#fefefe"},others:{link:"#000000"}},fonts:{heading:{h1:{font:"Archivo",weight:"900",size:48},h2:{font:"Archivo",weight:"700",size:32},h3:{font:"Archivo",weight:"600",size:24},h4:{font:"Archivo",weight:"500",size:16},h5:{font:"Archivo",weight:"400",size:16},h6:{font:"Archivo",weight:"400",size:16}},paragraph:{text:{font:"Archivo",size:48,weight:"400"}}},borders:{radius:52,thickness:52},buttons:{size:26,alignment:"left",radius:32,height:40},inputs:{general:{height:48,name:"Style Name",size:48,color:"black"},field:{active:!0,color:"black",opacity:40},border:{active:!0,style:"solid",radius:0,thickness:0,color:"black"},label:{height:48,size:48,color:"black",alignment:"left"}}},updateColor:(t,r,s)=>e(n=>{const o={...n.themeSettings.colors,[t]:{...n.themeSettings.colors[t],[r]:s}};return{themeSettings:{...n.themeSettings,colors:o}}}),updateFont:(t,r,s,n)=>e(o=>{const i={...o.themeSettings.fonts,[t]:{...o.themeSettings.fonts[t],[r]:{...o.themeSettings.fonts[t][r],[s]:n}}};return{themeSettings:{...o.themeSettings,fonts:i}}}),updateBorder:(t,r)=>e(s=>{const n={...s.themeSettings.borders,[t]:r};return{themeSettings:{...s.themeSettings,borders:n}}}),updateButton:(t,r)=>e(s=>{const n={...s.themeSettings.buttons,[t]:r};return{themeSettings:{...s.themeSettings,buttons:n}}}),updateInput:(t,r,s)=>e(n=>({themeSettings:{...n.themeSettings,inputs:{...n.themeSettings.inputs,[t]:{...n.themeSettings.inputs[t],[s]:r}}}}))})),T4=Jt(ul(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),N4=Jt(e=>({settings:null,setSettings:t=>e(()=>({settings:t}))})),xm=Jt()(e=>({color:"default",initialColor:"",setInitialColor:t=>e(()=>({initialColor:t})),colorChange:()=>{},update:()=>{},activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,setModalPosition:t=>e(()=>({modalPosition:t})),setHue:t=>e(()=>({hue:t})),setSaturation:t=>e(()=>({saturation:t})),setBrightness:t=>e(()=>({brightness:t})),setShowModal:t=>e(()=>({showModal:t})),setDragging:t=>e(()=>({dragging:t})),setActiveLabel:t=>e(()=>({activeLabel:t})),setColor:t=>e(()=>({color:t})),setUpdate:t=>e(()=>({update:t})),setColorChange:t=>e(()=>({colorChange:t}))})),q4=Jt(ul((e,t)=>({pages:null,currentPage:"/",setPages:r=>e(()=>({pages:r})),pageContext:{listings:null,products:null,reviews:null,categories:null,faqs:null,general:null},isOpenModal:!1,isOpenSelectModal:!1,isEdit:!1,editedPage:null,setEditedPage:r=>e(()=>({editedPage:r})),setCurrentPage:r=>e(()=>({currentPage:r})),setPageContext:r=>e(()=>({pageContext:r})),setIsOpenModal:r=>e(()=>({isOpenModal:r})),setIsOpenSelectModal:r=>e(()=>({isOpenSelectModal:r})),setIsEdit:r=>e(()=>({isEdit:r})),createPage:r=>{const s=t().pages,n=Na();if(s)s[n]=r,e({pages:s});else{const o=t().setPages;o({});const i=t().pages;i[n]=r,e({pages:i})}},updatePage:(r,s)=>{const n=t().pages;n&&(n[r]={...s},e({pages:n}))},deletePage:r=>{const s=t().pages;s&&(delete s[r],e({pages:s}))}}),{name:"pages-storage",partialize:e=>{const{pages:t,pageContext:r}=e;return{pages:t,pageContext:r}}})),ku=Jt(e=>({openModal:!1,setOpenModal:t=>e(()=>({openModal:t})),onChange:null,setOnChange:t=>e(()=>({onChange:t}))})),kn=Jt((e,t)=>({past:[],future:[],addHistory:r=>{const{past:s}=t();e({past:[...s,r],future:[]})},undo:()=>{const{past:r,future:s}=t();if(r.length===0)return;const n=r[r.length-1],o=r.slice(0,-1);e({past:o,future:[Fo.getState().blocks,...s]}),Fo.getState().setBlocks(n)},redo:()=>{const{past:r,future:s}=t();if(s.length===0)return;const n=s[0],o=s.slice(1);e({past:[...r,Fo.getState().blocks],future:o}),Fo.getState().setBlocks(n)}})),D4=(e,t,r)=>{const s=e[t];return s?typeof s=="function"?s():Promise.resolve(s):new Promise((n,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==r?". Note that variables only represent file names one level deep.":""))))})},O4="_icon_bsuj2_1",R4="_hoverable_bsuj2_5",k4="_rotated_bsuj2_9",F1={icon:O4,hoverable:R4,rotated:k4};var ym={exports:{}};/*!
66
+ `+o):s.stack=o}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ln(this.defaults,r);const{transitional:s,paramsSerializer:n,headers:o}=r;s!==void 0&&Rc.assertOptions(s,{silentJSONParsing:xs.transitional(xs.boolean),forcedJSONParsing:xs.transitional(xs.boolean),clarifyTimeoutError:xs.transitional(xs.boolean)},!1),n!=null&&(H.isFunction(n)?r.paramsSerializer={serialize:n}:Rc.assertOptions(n,{encode:xs.function,serialize:xs.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&H.merge(o.common,o[r.method]);o&&H.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),r.headers=Gt.concat(i,o);const l=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(c=c&&p.synchronous,l.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,h=0,f;if(!c){const m=[k1.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,u),f=m.length,d=Promise.resolve(r);h<f;)d=d.then(m[h++],m[h++]);return d}f=l.length;let v=r;for(h=0;h<f;){const m=l[h++],p=l[h++];try{v=m(v)}catch(g){p.call(this,g);break}}try{d=k1.call(this,v)}catch(m){return Promise.reject(m)}for(h=0,f=u.length;h<f;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=ln(this.defaults,t);const r=um(t.baseURL,t.url);return om(r,t.params,t.paramsSerializer)}}H.forEach(["delete","get","head","options"],function(t){sn.prototype[t]=function(r,s){return this.request(ln(s||{},{method:t,url:r,data:(s||{}).data}))}});H.forEach(["post","put","patch"],function(t){function r(s){return function(o,i,l){return this.request(ln(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}sn.prototype[t]=r(),sn.prototype[t+"Form"]=r(!0)});class Ru{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const s=this;this.promise.then(n=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](n);s._listeners=null}),this.promise.then=n=>{let o;const i=new Promise(l=>{s.subscribe(l),o=l}).then(n);return i.cancel=function(){s.unsubscribe(o)},i},t(function(o,i,l){s.reason||(s.reason=new eo(o,i,l),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Ru(function(n){t=n}),cancel:t}}}function i4(e){return function(r){return e.apply(null,r)}}function a4(e){return H.isObject(e)&&e.isAxiosError===!0}const kc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(kc).forEach(([e,t])=>{kc[t]=e});function vm(e){const t=new sn(e),r=Zh(sn.prototype.request,t);return H.extend(r,sn.prototype,t,{allOwnKeys:!0}),H.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return vm(ln(e,n))},r}const Ct=vm(Pi);Ct.Axios=sn;Ct.CanceledError=eo;Ct.CancelToken=Ru;Ct.isCancel=lm;Ct.VERSION=pm;Ct.toFormData=ll;Ct.AxiosError=De;Ct.Cancel=Ct.CanceledError;Ct.all=function(t){return Promise.all(t)};Ct.spread=i4;Ct.isAxiosError=a4;Ct.mergeConfig=ln;Ct.AxiosHeaders=Gt;Ct.formToJSON=e=>am(H.isHTMLForm(e)?new FormData(e):e);Ct.getAdapter=mm.getAdapter;Ct.HttpStatusCode=kc;Ct.default=Ct;const l4=async(e,t,r)=>{const s=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${Ci}/v2/builder/shops/${s}/drafts/${n}/${t}`;return to({url:o,withToken:!0,method:e,body:r})},c4=async()=>{const e=localStorage.getItem("shopId")||void 0,t=`${Ci}/v1/dash/shops/${e}/images`;return to({url:t,withToken:!0,method:"get"})},u4=async e=>{const t=localStorage.getItem("shopId")||void 0,r=`${Ci}/v1/dash/shops/${t}/images`;return to({url:r,withToken:!0,method:"post",body:e})},d4=async e=>{const t=localStorage.getItem("shopId")||void 0,r=localStorage.getItem("draftId"),s=`${Ci}/v2/builder/shops/${t}/drafts/${r}/pages/${e}`;return to({url:s,withToken:!0,method:"delete"})},f4=async e=>{const t=window.location.hostname.includes("localhost")?localStorage.getItem("fakeDomain")||"subscriptions.billgang.store":window.location.hostname,r=`${zh}/v2/shops/${t}/pages/${e}`;try{return to({url:r,withToken:!0,method:"get"})}catch(s){if(Ct.isAxiosError(s)&&s.response&&s.response.status===404)return null;throw s}},h4=async()=>{const e=window.location.hostname.includes("localhost")?localStorage.getItem("fakeDomain")||"subscriptions.billgang.store":window.location.hostname,t=`${zh}/v2/shops/${e}/settings-theme`;return to({url:t,withToken:!0,method:"get"})},to=async e=>{const{url:t,withToken:r,method:s,body:n}=e,o=r?localStorage.getItem("sellerAccessToken"):null;return(await Ct[s](t,{...n},{headers:{Authorization:`Bearer ${o}`,"Content-Type":"multipart/form-data"}})).data},A1=e=>{let t;const r=new Set,s=(u,d)=>{const h=typeof u=="function"?u(t):u;if(!Object.is(h,t)){const f=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),r.forEach(v=>v(t,f))}},n=()=>t,l={setState:s,getState:n,getInitialState:()=>c,subscribe:u=>(r.add(u),()=>r.delete(u))},c=t=e(s,n,l);return l},m4=e=>e?A1(e):A1,p4=e=>e;function v4(e,t=p4){const r=x.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return x.useDebugValue(r),r}const I1=e=>{const t=m4(e),r=s=>v4(t,s);return Object.assign(r,t),r},Jt=e=>e?I1(e):I1,g4=Jt(e=>({blocks:null,setBlocks:t=>e(()=>({blocks:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),sourceBlocks:{},setSourceBlocks:t=>e(()=>({sourceBlocks:t})),currentInstance:null,setCurrentInstance:t=>e(()=>({currentInstance:t}))})),x4=Jt(e=>({currentDevice:{icon:"Desktop",value:"desktop"},setCurrentDevice:t=>e(()=>({currentDevice:t}))}));Jt(e=>({pageData:null,setPageData:t=>e(()=>({pageData:t}))}));const y4=Jt(e=>({activeBlock:Wh[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function b4(e,t){let r;try{r=e()}catch{return}return{getItem:n=>{var o;const i=c=>c===null?null:JSON.parse(c,void 0),l=(o=r.getItem(n))!=null?o:null;return l instanceof Promise?l.then(i):i(l)},setItem:(n,o)=>r.setItem(n,JSON.stringify(o,void 0)),removeItem:n=>r.removeItem(n)}}const Lc=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(s){return Lc(s)(r)},catch(s){return this}}}catch(r){return{then(s){return this},catch(s){return Lc(s)(r)}}}},C4=(e,t)=>(r,s,n)=>{let o={storage:b4(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},i=!1;const l=new Set,c=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...p)},s,n);const d=()=>{const p=o.partialize({...s()});return u.setItem(o.name,{state:p,version:o.version})},h=n.setState;n.setState=(p,g)=>{h(p,g),d()};const f=e((...p)=>{r(...p),d()},s,n);n.getInitialState=()=>f;let v;const m=()=>{var p,g;if(!u)return;i=!1,l.forEach(b=>{var E;return b((E=s())!=null?E:f)});const y=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=s())!=null?p:f))||void 0;return Lc(u.getItem.bind(u))(o.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==o.version){if(o.migrate)return[!0,o.migrate(b.state,b.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var E;const[S,w]=b;if(v=o.merge(w,(E=s())!=null?E:f),r(v,!0),S)return d()}).then(()=>{y==null||y(v,void 0),v=s(),i=!0,c.forEach(b=>b(v))}).catch(b=>{y==null||y(void 0,b)})};return n.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>i,onHydrate:p=>(l.add(p),()=>{l.delete(p)}),onFinishHydration:p=>(c.add(p),()=>{c.delete(p)})},o.skipHydration||m(),v||f},ul=C4,w4=Jt(ul(e=>({onPreview:!1,setOnPreview:t=>e(()=>({onPreview:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t}))}),{name:"preview-storage",partialize:e=>{const{onPreview:t}=e;return{onPreview:t}}}));var Rt=[];for(var Ul=0;Ul<256;++Ul)Rt.push((Ul+256).toString(16).slice(1));function P4(e,t=0){return(Rt[e[t+0]]+Rt[e[t+1]]+Rt[e[t+2]]+Rt[e[t+3]]+"-"+Rt[e[t+4]]+Rt[e[t+5]]+"-"+Rt[e[t+6]]+Rt[e[t+7]]+"-"+Rt[e[t+8]]+Rt[e[t+9]]+"-"+Rt[e[t+10]]+Rt[e[t+11]]+Rt[e[t+12]]+Rt[e[t+13]]+Rt[e[t+14]]+Rt[e[t+15]]).toLowerCase()}var Zi,S4=new Uint8Array(16);function E4(){if(!Zi&&(Zi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zi(S4)}var _4=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const M1={randomUUID:_4};function Na(e,t,r){if(M1.randomUUID&&!t&&!e)return M1.randomUUID();e=e||{};var s=e.random||(e.rng||E4)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,P4(s)}const Fo=Jt(ul((e,t)=>({header:null,blocks:{},footer:null,currentBlock:null,positionBlock:null,setBlocks:r=>{e({blocks:r})},setHeader:r=>{e({header:r})},setFooter:r=>{e({footer:r})},createPage:r=>{const s=t().blocks;s[r]={},e({blocks:s})},deletePage:r=>{const s=t().blocks;delete s[r],e({blocks:s})},updatePage:(r,s)=>{const n=t().blocks;if(n[s])return;const o=n[r];delete n[r],n[s]=o,e({blocks:n})},setCurrentBlock:r=>{e({currentBlock:r})},setPositionBlock:r=>{e({positionBlock:r})},addBlock:(r,s)=>{const n=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));kn.getState().addHistory(n),console.log("addHistory");const o=t().blocks,i=o[r]||{},l=t().positionBlock,c=Na();i[c]={name:s.name,value:s.value};const u=Object.keys(i);if(l===null||l>=u.length)e({blocks:{...o,[r]:i}});else{const d={name:s.name,value:{...s.value}},h=u.slice(0,l),f=u.slice(l),v={...h.reduce((m,p)=>(m[p]=i[p],m),{}),[c]:d,...f.reduce((m,p)=>(m[p]=i[p],m),{})};e({blocks:{...o,[r]:v}})}},editBlock:(r,s,n)=>{const o=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));kn.getState().addHistory(o),console.log("addHistory");const i=t().blocks,l=i[r]||{};l[s]={name:n.name,value:{...n.value}},e({blocks:{...i,[r]:l}})},removeBlock:(r,s)=>{const n={...t().blocks};kn.getState().addHistory(n);const o=t().blocks,i=o[r]||{};delete i[s],e({blocks:{...o,[r]:i}})},moveBlock:(r,s,n)=>e(o=>{const i=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));kn.getState().addHistory(i);const l={...o.blocks[r]},c=Object.keys(l),[u]=c.splice(s,1);c.splice(n,0,u);const d=c.reduce((h,f)=>(h[f]=l[f],h),{});return{blocks:{...o.blocks,[r]:d}}}),duplicateBlock:(r,s)=>{const n=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));kn.getState().addHistory(n);const{blocks:o}=t(),i=o[r],l=i[s],c=Na(),u={name:l.name,value:{...l.value}},d=Object.keys(i),h=d.indexOf(s),f=d.slice(0,h+1),v=d.slice(h+1),m={...f.reduce((p,g)=>(p[g]=i[g],p),{}),[c]:u,...v.reduce((p,g)=>(p[g]=i[g],p),{})};e({blocks:{...o,[r]:m}})}}),{name:"layers-storage",partialize:e=>{const{blocks:t,header:r,footer:s}=e;return{blocks:t,header:r,footer:s}}})),gm=Jt((e,t)=>({isModalVisible:!1,hoverBlockId:null,isMouseOverModal:!1,hideTimeout:null,setHoverBlockId:r=>{e({hoverBlockId:r})},showModal:r=>{t().hideTimeout&&clearTimeout(t().hideTimeout),e({isModalVisible:!0,hoverBlockId:r})},hideModal:()=>{e({isModalVisible:!1,hoverBlockId:null})},startHideTimeout:()=>{if(!t().isMouseOverModal){const r=setTimeout(()=>{e({isModalVisible:!1,hoverBlockId:null})},500);e({hideTimeout:r})}},clearHideTimeout:()=>{t().hideTimeout&&(clearTimeout(t().hideTimeout),e({hideTimeout:null}))},setMouseOverModal:r=>{e({isMouseOverModal:r})},isPreviewVisible:!1,showPreview:r=>{e({isPreviewVisible:!0,hoverBlockId:r})},hidePreview:()=>{e({isPreviewVisible:!1,hoverBlockId:null})}})),j4=Jt(e=>({activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),activeFont:null,setActiveFont:t=>e(()=>({activeFont:t})),setThemeSettings:t=>e(()=>({themeSettings:t})),themeSettings:{colors:{brand:{primary:"#fefefe",secondary:"#fefefe",toner:"#ffffff"},background:{primary:"#fefefe",secondary:"#000000"},text_icons:{primary:"#000000",secondary:"#fefefe",tertiary:"#fefefe",disabled:"#ffffff"},lines:{divider:"#000000",border:"#fefefe"},others:{link:"#000000"}},fonts:{heading:{h1:{font:"Archivo",weight:"900",size:48},h2:{font:"Archivo",weight:"700",size:32},h3:{font:"Archivo",weight:"600",size:24},h4:{font:"Archivo",weight:"500",size:16},h5:{font:"Archivo",weight:"400",size:16},h6:{font:"Archivo",weight:"400",size:16}},paragraph:{text:{font:"Archivo",size:48,weight:"400"}}},borders:{radius:52,thickness:52},buttons:{size:26,alignment:"left",radius:32,height:40},inputs:{general:{height:48,name:"Style Name",size:48,color:"black"},field:{active:!0,color:"black",opacity:40},border:{active:!0,style:"solid",radius:0,thickness:0,color:"black"},label:{height:48,size:48,color:"black",alignment:"left"}}},updateColor:(t,r,s)=>e(n=>{const o={...n.themeSettings.colors,[t]:{...n.themeSettings.colors[t],[r]:s}};return{themeSettings:{...n.themeSettings,colors:o}}}),updateFont:(t,r,s,n)=>e(o=>{const i={...o.themeSettings.fonts,[t]:{...o.themeSettings.fonts[t],[r]:{...o.themeSettings.fonts[t][r],[s]:n}}};return{themeSettings:{...o.themeSettings,fonts:i}}}),updateBorder:(t,r)=>e(s=>{const n={...s.themeSettings.borders,[t]:r};return{themeSettings:{...s.themeSettings,borders:n}}}),updateButton:(t,r)=>e(s=>{const n={...s.themeSettings.buttons,[t]:r};return{themeSettings:{...s.themeSettings,buttons:n}}}),updateInput:(t,r,s)=>e(n=>({themeSettings:{...n.themeSettings,inputs:{...n.themeSettings.inputs,[t]:{...n.themeSettings.inputs[t],[s]:r}}}}))})),T4=Jt(ul(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),N4=Jt(e=>({settings:null,setSettings:t=>e(()=>({settings:t}))})),xm=Jt()(e=>({color:"default",initialColor:"",setInitialColor:t=>e(()=>({initialColor:t})),colorChange:()=>{},update:()=>{},activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,setModalPosition:t=>e(()=>({modalPosition:t})),setHue:t=>e(()=>({hue:t})),setSaturation:t=>e(()=>({saturation:t})),setBrightness:t=>e(()=>({brightness:t})),setShowModal:t=>e(()=>({showModal:t})),setDragging:t=>e(()=>({dragging:t})),setActiveLabel:t=>e(()=>({activeLabel:t})),setColor:t=>e(()=>({color:t})),setUpdate:t=>e(()=>({update:t})),setColorChange:t=>e(()=>({colorChange:t}))})),q4=Jt(ul((e,t)=>({pages:null,currentPage:"/",setPages:r=>e(()=>({pages:r})),pageContext:{listings:null,products:null,reviews:null,categories:null,faqs:null,general:null},isOpenModal:!1,isOpenSelectModal:!1,isEdit:!1,editedPage:null,setEditedPage:r=>e(()=>({editedPage:r})),setCurrentPage:r=>e(()=>({currentPage:r})),setPageContext:r=>e(()=>({pageContext:r})),setIsOpenModal:r=>e(()=>({isOpenModal:r})),setIsOpenSelectModal:r=>e(()=>({isOpenSelectModal:r})),setIsEdit:r=>e(()=>({isEdit:r})),createPage:r=>{const s=t().pages,n=Na();if(s)s[n]=r,e({pages:s});else{const o=t().setPages;o({});const i=t().pages;i[n]=r,e({pages:i})}},updatePage:(r,s)=>{const n=t().pages;n&&(n[r]={...s},e({pages:n}))},deletePage:r=>{const s=t().pages;s&&(delete s[r],e({pages:s}))}}),{name:"pages-storage",partialize:e=>{const{pages:t,pageContext:r}=e;return{pages:t,pageContext:r}}})),ku=Jt(e=>({openModal:!1,setOpenModal:t=>e(()=>({openModal:t})),onChange:null,setOnChange:t=>e(()=>({onChange:t}))})),kn=Jt((e,t)=>({past:[],future:[],addHistory:r=>{const{past:s}=t();e({past:[...s,r],future:[]})},undo:()=>{const{past:r,future:s}=t();if(r.length===0)return;const n=r[r.length-1],o=r.slice(0,-1);e({past:o,future:[Fo.getState().blocks,...s]}),Fo.getState().setBlocks(n)},redo:()=>{const{past:r,future:s}=t();if(s.length===0)return;const n=s[0],o=s.slice(1);e({past:[...r,Fo.getState().blocks],future:o}),Fo.getState().setBlocks(n)}})),D4=(e,t,r)=>{const s=e[t];return s?typeof s=="function"?s():Promise.resolve(s):new Promise((n,o)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(o.bind(null,new Error("Unknown variable dynamic import: "+t+(t.split("/").length!==r?". Note that variables only represent file names one level deep.":""))))})},O4="_icon_bsuj2_1",R4="_hoverable_bsuj2_5",k4="_rotated_bsuj2_9",F1={icon:O4,hoverable:R4,rotated:k4};var ym={exports:{}};/*!
67
67
  Copyright (c) 2018 Jed Watson.
68
68
  Licensed under the MIT License (MIT), see
69
69
  http://jedwatson.github.io/classnames
@@ -5763,7 +5763,7 @@ const wR = async (e, t, r) => {
5763
5763
  method: "delete"
5764
5764
  });
5765
5765
  }, ER = async (e) => {
5766
- const t = window.location.hostname.includes("localhost") ? "subscriptions.billgang.store" : window.location.hostname, r = `${tm}/v2/shops/${t}/pages/${e}`;
5766
+ const t = window.location.hostname.includes("localhost") ? localStorage.getItem("fakeDomain") || "subscriptions.billgang.store" : window.location.hostname, r = `${tm}/v2/shops/${t}/pages/${e}`;
5767
5767
  try {
5768
5768
  return io({
5769
5769
  url: r,
@@ -5776,7 +5776,7 @@ const wR = async (e, t, r) => {
5776
5776
  throw s;
5777
5777
  }
5778
5778
  }, _R = async () => {
5779
- const e = window.location.hostname.includes("localhost") ? "subscriptions.billgang.store" : window.location.hostname, t = `${tm}/v2/shops/${e}/settings-theme`;
5779
+ const e = window.location.hostname.includes("localhost") ? localStorage.getItem("fakeDomain") || "subscriptions.billgang.store" : window.location.hostname, t = `${tm}/v2/shops/${e}/settings-theme`;
5780
5780
  return io({
5781
5781
  url: t,
5782
5782
  withToken: !0,
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./root-BsdCG0vR.cjs"),h=require("react"),rt="_accordion_9e4oa_1",at="_header_9e4oa_9",lt="_icon_9e4oa_18",ut="_open_9e4oa_21",dt="_content_9e4oa_25",z={accordion:rt,header:at,icon:lt,open:ut,content:dt},xt=({title:l,content:n})=>{const[e,o]=h.useState(!1),[r,a]=h.useState(0),s=h.useRef(null),c=()=>{o(!e)};return h.useEffect(()=>{s.current&&a(e?s.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:z.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:z.header,onClick:c,children:[t.jsxRuntimeExports.jsx("h3",{children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(z.icon,{[z.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:s,className:z.content,style:{height:`${r}px`},children:t.jsxRuntimeExports.jsx("p",{children:n})})]})},mt="_wrapper_9rr5j_2",pt="_alignmentBlock_9rr5j_8",_t="_title_9rr5j_15",jt="_subtitle_9rr5j_22",ht="_alignmentContent_9rr5j_29",gt="_alignments_9rr5j_37",ft="_alignment_9rr5j_8",bt="_circle_9rr5j_58",vt="_paddings_9rr5j_65",Rt="_padding_9rr5j_65",Et="_input_9rr5j_84",A={wrapper:mt,alignmentBlock:pt,title:_t,subtitle:jt,alignmentContent:ht,alignments:gt,alignment:ft,circle:bt,paddings:vt,padding:Rt,input:Et},kt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],yt=["left","top","right","bottom"],It=l=>{const{alignment:n,padding:e,setPadding:o,setAlignment:r}=l;function a(){switch(n){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function s(c){switch(c){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}return t.jsxRuntimeExports.jsxs("div",{className:A.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:A.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:A.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:A.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:A.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:A.alignments,children:kt.map(c=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{r(c)},className:A.alignment,children:[c!==n&&t.jsxRuntimeExports.jsx("div",{className:A.circle}),c===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:a(),fill:"#FF3F19",width:22,height:22})]},c))}),t.jsxRuntimeExports.jsx("div",{className:A.paddings,children:yt.map(c=>t.jsxRuntimeExports.jsxs("label",{className:A.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(c),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(e[c]),onChange:d=>o({...e,[c]:Number(d)}),paddingless:!0,borderless:!0})]},c))})]})]})]})},$t="_subtitle_1qrz9_1",Nt="_header_1qrz9_8",Ct="_text_1qrz9_9",Bt="_top_1qrz9_17",qt="_itemsBlock_1qrz9_26",G={subtitle:$t,header:Nt,text:Ct,top:Bt,itemsBlock:qt},Pt="_typeTexts_rcw8p_1",wt="_block_rcw8p_8",St="_active_rcw8p_21",W={typeTexts:Pt,block:wt,active:St},Tt=["bold","italic","underline","strike-through","code"],K=l=>{const{typesText:n,setTypesText:e}=l;function o(r){switch(r){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:W.typeTexts,children:Tt.map(r=>t.jsxRuntimeExports.jsx("div",{className:t.clx(W.block,{[W.active]:n.includes(r)}),onClick:()=>{const a=[...n];if(a.includes(r)){const s=a.filter(c=>c!==r);e(s)}else a.push(r),e(a)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:o(r),fill:n.includes(r)?"#252525":"#757575",width:20,height:20})},String(r)))})},Z=l=>{const{typesText:n,isActiveText:e,setIsActiveText:o,text:r,setText:a,setTypesText:s,title:c,subtitle:d="Items"}=l;return t.jsxRuntimeExports.jsxs("div",{className:G.text,children:[(c||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:G.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:G.title,children:c}),e!==void 0&&o&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:R=>o(R)})]}),t.jsxRuntimeExports.jsxs("div",{className:G.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:d}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>a(R),value:r,maxLength:150}),t.jsxRuntimeExports.jsx(K,{typesText:n,setTypesText:s})]})]})},At="_subtitle_cuny2_1",Ot="_header_cuny2_8",Dt="_text_cuny2_9",Lt="_productsBlock_cuny2_10",Mt="_top_cuny2_22",Ht="_itemsBlock_cuny2_31",Vt="_typeTexts_cuny2_37",Ft="_block_cuny2_44",Ut="_active_cuny2_57",zt="_products_cuny2_10",Gt="_product_cuny2_10",Yt="_button_cuny2_76",Xt="_disabled_cuny2_87",Qt="_image_cuny2_91",Wt="_info_cuny2_98",Jt="_name_cuny2_110",Kt="_buttons_cuny2_114",Zt="_modal_cuny2_121",ts="_link_cuny2_141",ss="_modalOptions_cuny2_147",$={subtitle:At,header:Ot,text:Dt,productsBlock:Lt,top:Mt,itemsBlock:Ht,typeTexts:Vt,block:Ft,active:Ut,products:zt,product:Gt,button:Yt,disabled:Xt,image:Qt,info:Wt,name:Jt,buttons:Kt,modal:Zt,link:ts,modalOptions:ss},es=l=>{const{activeItem:n,setActiveItem:e,popupPosition:o,modalOptions:r,setIsOpenModal:a}=l;return t.jsxRuntimeExports.jsxs("div",{className:$.modal,onClick:s=>{s.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{e(null),a(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:$.modalOptions,children:r.map(s=>{if(s.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:c=>{const d={...n,[s.field]:c};e(d)}},String(s.field));if(s.type==="text")return t.jsxRuntimeExports.jsx(Z,{typesText:n[s.field.type],setTypesText:c=>{const d={...n,[s.field.type]:c};e(d)},text:n[s.field.text]||"",setText:c=>{const d={...n,[s.field.text]:c};e(d)},subtitle:s.label});if(s.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const d={...n,[s.field]:c};e(d)},value:n[s.field]||"",label:s.label,placeholder:s.placeholder});if(s.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:$.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const d={...n,[s.field.text]:c};e(d)},value:n[s.field.text]||"",label:s.inputLabel,placeholder:s.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!n[s.field.switch]||!1,label:s.switchLabel,onChange:c=>{const d={...n,[s.field.switch]:c};e(d)}})]});if(s.type==="list")return t.jsxRuntimeExports.jsx(st,{items:n[s.field]||[],setItems:c=>{const d={...n,[s.field]:c};e(d)},itemsType:"select",draggable:s.draggable||!1,itemsOptions:s.itemsOptions,deletable:s.deletable||!1,editable:!1,subtitle:s.label});if(s.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:s.itemsOptions,onChange:c=>{const d={...n,[s.field]:c};e(d)},label:s.label,value:n[s.field]||"String",leftAddon:s.leftAddon&&s.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:n[s.field]})})})})]})},ns="_other_g74jx_1",os="_subtitle_g74jx_7",is="_items_g74jx_14",J={other:ns,subtitle:os,items:is},tt=l=>{const{items:n,title:e="Other"}=l;return t.jsxRuntimeExports.jsxs("div",{className:J.other,children:[t.jsxRuntimeExports.jsx("h5",{className:J.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:J.items,children:n.map((o,r)=>t.jsxRuntimeExports.jsx(t.Switch,{current:o.isItem,onChange:a=>o.setIsItem(a),label:o.label,hasBackground:!0,paddingless:!1},r))})]})},cs=l=>{const{index:n,moveProduct:e,children:o}=l,[,r]=t.useDrop({accept:"product",hover(c){c.index!==n&&(e(c.index,n),c.index=n)}}),[{isDragging:a},s]=t.useDrag({type:"product",item:{index:n},collect:c=>({isDragging:c.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:c=>s(r(c)),className:`${$.product} ${a?$.dragging:""}`,children:o})},st=l=>{const{isActiveItems:n,setIsActiveItems:e,items:o,setItems:r,other:a,title:s,subtitle:c,editable:d=!0,draggable:R=!1,withImage:p=!1,deletable:v=!0,addable:g=!0,itemsType:i,itemsPlaceholder:x="",itemsOptions:_,hasRangeSelector:N=!1,rangeSelectorOptions:q,modalOptions:k,addableOptions:F={},limit:S}=l,[D,L]=h.useState(null),[Q,X]=h.useState({top:0,left:0}),[m,b]=h.useState(!1),P=(u,C)=>{const w=[...o],[E]=w.splice(u,1);w.splice(C,0,E),r(w)};h.useEffect(()=>{const u=()=>{L(null),b(!1)};return document.body.addEventListener("click",u),L(null),b(!1),()=>{L(null),b(!1),document.body.removeEventListener("click",u)}},[]),h.useEffect(()=>{if(D){const u=[...o].map(C=>C.id===D.id?D:C);r(u)}},[D]);const y=(u,C)=>{u.stopPropagation(),b(!0);const w=u.target.getBoundingClientRect(),E=500,U=window.innerHeight;let O=w.top+window.scrollY;O+E>U&&(O=U-E-20),X({top:O-80,left:w.left-30}),L(C)};function H(u){if(p)return u?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${u[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const T=(u,C)=>{const w=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),i==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:E=>{const O=[...o].map(M=>M.id===u.id?{...u,name:E}:M);L({...u,name:E}),r([...O])},value:u.name,options:_,leftAddon:H(u.images)}),i==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:E=>{const O=[...o].map(M=>M.id===u.id?{...u,name:E}:M);r([...O])},value:u.name,placeholder:x}),i==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:E=>{const O=[...o].map(M=>M.id===u.id?{...u,images:E}:M);r([...O])}}),t.jsxRuntimeExports.jsxs("div",{className:$.buttons,children:[d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:E=>y(E,u)}),v&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>r(o.filter(E=>E.id!==u.id))})]})]});return R?t.jsxRuntimeExports.jsx(cs,{product:u,index:C,moveProduct:P,children:w},u.id):t.jsxRuntimeExports.jsx("div",{className:$.product,children:w},u.id)};return t.jsxRuntimeExports.jsxs("div",{className:$.productsBlock,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:$.title,children:s}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:u=>e==null?void 0:e(u)})]}),D&&d&&k&&m&&t.jsxRuntimeExports.jsx(es,{activeItem:D,setActiveItem:L,popupPosition:Q,modalOptions:k,setIsOpenModal:b}),N&&q&&t.jsxRuntimeExports.jsx(nt,{...q}),t.jsxRuntimeExports.jsxs("div",{className:$.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:$.subtitle,children:c}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:o.map((u,C)=>T(u,C))}):o.map((u,C)=>T(u,C)),g&&t.jsxRuntimeExports.jsxs(t.Button,{className:t.clx($.button,{[$.disabled]:!!(S&&S<=o.length)}),size:"s",disabled:!!(S&&S<=o.length),onClick:()=>{const u=[...o];i==="select"?u.push({name:_[0]||`Product ${o.length+1}`,id:t.v4(),...F}):i==="input"?u.push({name:"",id:t.v4(),...F}):u.push({name:`Image ${o.length+1}`,id:t.v4(),...F}),r(u)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),a!==void 0&&t.jsxRuntimeExports.jsx(tt,{items:a})]})},rs="_subtitle_1fb9q_1",as="_header_1fb9q_8",ls="_text_1fb9q_9",us="_productsBlock_1fb9q_10",ds="_buttonsBlock_1fb9q_11",xs="_top_1fb9q_22",ms="_itemsBlock_1fb9q_31",ps="_typeTexts_1fb9q_37",_s="_block_1fb9q_44",js="_active_1fb9q_56",hs="_products_1fb9q_10",gs="_product_1fb9q_10",fs="_button_1fb9q_11",bs="_image_1fb9q_86",vs="_info_1fb9q_93",Rs="_name_1fb9q_105",Es="_buttons_1fb9q_11",ks="_modal_1fb9q_116",ys="_other_1fb9q_135",Is="_options_1fb9q_141",V={subtitle:rs,header:as,text:ls,productsBlock:us,buttonsBlock:ds,top:xs,itemsBlock:ms,typeTexts:ps,block:_s,active:js,products:hs,product:gs,button:fs,image:bs,info:vs,name:Rs,buttons:Es,modal:ks,other:ys,options:Is},$s=l=>{const{activeButton:n,setActiveButton:e,popupPosition:o}=l,[r,a]=h.useState(n.typesText),[s,c]=h.useState(n.destination),[d,R]=h.useState(n.link||""),[p,v]=h.useState(n.text||"");return h.useEffect(()=>{e({...n,...{text:p,link:d,destination:s,typesText:r}})},[r,s,d,p]),t.jsxRuntimeExports.jsxs("div",{className:V.modal,onClick:g=>{g.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>e(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:V.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:g=>c(g),options:["Go to Page","Open Link"],value:s}),s==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:g=>R(g),value:d,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:g=>v(g),value:p,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(K,{typesText:r,setTypesText:a})]})]})},Ns="_subtitle_m8qel_1",Cs="_header_m8qel_8",Bs="_text_m8qel_9",qs="_productsBlock_m8qel_10",Ps="_buttonsBlock_m8qel_11",ws="_top_m8qel_23",Ss="_itemsBlock_m8qel_32",Ts="_typeTexts_m8qel_38",As="_block_m8qel_45",Os="_active_m8qel_58",Ds="_products_m8qel_10",Ls="_product_m8qel_10",Ms="_button_m8qel_11",Hs="_image_m8qel_88",Vs="_info_m8qel_95",Fs="_name_m8qel_107",Us="_buttons_m8qel_11",zs="_modal_m8qel_118",Gs="_other_m8qel_137",Ys="_options_m8qel_143",Y={subtitle:Ns,header:Cs,text:Bs,productsBlock:qs,buttonsBlock:Ps,top:ws,itemsBlock:Ss,typeTexts:Ts,block:As,active:Os,products:Ds,product:Ls,button:Ms,image:Hs,info:Vs,name:Fs,buttons:Us,modal:zs,other:Gs,options:Ys},et=l=>{const{buttons:n,setButtons:e,deletable:o=!0,addable:r=!0}=l,[a,s]=h.useState(null),[c,d]=h.useState({top:0,left:0});h.useEffect(()=>{const p=()=>{s(null)};return document.body.addEventListener("click",p),s(null),()=>{s(null),document.body.removeEventListener("click",p)}},[]),h.useEffect(()=>{if(a){const p=[...n].map(v=>v.id===a.id?a:v);e(p)}},[a]);const R=(p,v)=>{p.stopPropagation();const g=p.target.getBoundingClientRect(),i=490,x=window.innerHeight;let _=g.top+window.scrollY;_+i>x&&(_=x-i-20),d({top:_,left:g.left-30}),s(v)};return t.jsxRuntimeExports.jsxs("div",{className:Y.products,children:[t.jsxRuntimeExports.jsx("h5",{className:Y.subtitle,children:"Button Type"}),n.map(p=>t.jsxRuntimeExports.jsxs("div",{className:Y.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const i=[...n].map(x=>x.id===p.id?{...p,type:v}:x);e(i)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:Y.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:v=>{R(v,p)}}),o&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const v=n.filter(g=>g.id!==p.id);e(v)},width:20,height:20,fill:"#C12A2A"})]})]},p.id)),a&&t.jsxRuntimeExports.jsx($s,{activeButton:a,setActiveButton:s,popupPosition:c}),r&&t.jsxRuntimeExports.jsxs(t.Button,{className:Y.button,size:"s",onClick:()=>{const p=[...n];p.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:""}),e(p)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Xs=l=>{const{isActiveButtons:n,setIsActiveButtons:e,buttons:o,setButtons:r}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:V.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{className:V.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:a=>e(a)})]}),t.jsxRuntimeExports.jsx(et,{buttons:o,setButtons:r})]})})},Qs="_wrapper_m18qi_1",Ws="_subtitle_m18qi_7",Js="_content_m18qi_14",Ks="_range_m18qi_22",Zs="_track_m18qi_27",te="_progress_m18qi_36",se="_dots_m18qi_46",ee="_dot_m18qi_46",ne="_active_m18qi_65",oe="_input_m18qi_77",ie="_countBlock_m18qi_91",ce="_count_m18qi_91",re="_controls_m18qi_107",ae="_button_m18qi_113",I={wrapper:Qs,subtitle:Ws,content:Js,range:Ks,track:Zs,progress:te,dots:se,dot:ee,active:ne,input:oe,countBlock:ie,count:ce,controls:re,button:ae},nt=l=>{const{label:n,min:e=1,max:o=4,step:r=1,count:a,setCount:s}=l,[c,d]=h.useState(!1),R=Array.from({length:(o-e)/r+1}),p=(a-e)/(o-e)*100,v=()=>{a<o&&s(a+r)},g=()=>{a>e&&s(a-r)},i=x=>{const _=e+x*r;s(_)};return t.jsxRuntimeExports.jsxs("div",{className:I.wrapper,children:[n&&t.jsxRuntimeExports.jsx("h5",{className:I.subtitle,children:n}),t.jsxRuntimeExports.jsxs("div",{className:I.content,children:[t.jsxRuntimeExports.jsxs("div",{className:I.range,children:[t.jsxRuntimeExports.jsx("div",{className:I.track}),t.jsxRuntimeExports.jsx("div",{className:I.progress,style:{width:`${p}%`}}),t.jsxRuntimeExports.jsx("div",{className:I.dots,children:R.map((x,_)=>{const N=_<=(a-e)/r;return t.jsxRuntimeExports.jsx("button",{onClick:()=>i(_),className:t.clx(I.dot,{[I.active]:N,[I.inactive]:!N,[I.dragging]:c}),"aria-label":`Set value to ${e+_*r}`},_)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:o,step:r,value:a,onChange:x=>s(Number(x.target.value)),onMouseDown:()=>d(!0),onMouseUp:()=>d(!1),onTouchStart:()=>d(!0),onTouchEnd:()=>d(!1),className:I.input})]}),t.jsxRuntimeExports.jsxs("div",{className:I.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:o,paddingless:!0,onChange:x=>{const _=Number(x);_>o?s(o):_<e?s(e):s(_)},value:String(a)}),t.jsxRuntimeExports.jsxs("div",{className:I.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:v,disabled:a>=o,className:I.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:g,disabled:a<=e,className:I.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},le="_subtitle_16rdk_1",ue="_header_16rdk_8",de="_text_16rdk_9",xe="_productsBlock_16rdk_10",me="_top_16rdk_22",pe="_itemsBlock_16rdk_31",_e="_typeTexts_16rdk_37",je="_block_16rdk_44",he="_active_16rdk_57",ge="_products_16rdk_10",fe="_product_16rdk_10",be="_button_16rdk_76",ve="_image_16rdk_87",Re="_info_16rdk_94",Ee="_name_16rdk_106",ke="_buttons_16rdk_110",ye="_modal_16rdk_117",Ie="_link_16rdk_137",$e="_modalOptions_16rdk_143",B={subtitle:le,header:ue,text:de,productsBlock:xe,top:me,itemsBlock:pe,typeTexts:_e,block:je,active:he,products:ge,product:fe,button:be,image:ve,info:Re,name:Ee,buttons:ke,modal:ye,link:Ie,modalOptions:$e},Ne=l=>{const{activeItem:n,setActiveItem:e,popupPosition:o,setIsOpenModal:r}=l;return t.jsxRuntimeExports.jsxs("div",{className:B.modal,onClick:a=>{a.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:B.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{r(!1),e(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:B.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:a=>{const s={...n,images:a,imagePath:a[0]};e(s)}})})]})},Ce=l=>{const{index:n,moveProduct:e,children:o}=l,[,r]=t.useDrop({accept:"product",hover(c){c.index!==n&&(e(c.index,n),c.index=n)}}),[{isDragging:a},s]=t.useDrag({type:"product",item:{index:n},collect:c=>({isDragging:c.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:c=>s(r(c)),className:`${B.product} ${a?B.dragging:""}`,children:o})},Be=l=>{const{isActiveItems:n,setIsActiveItems:e,items:o,setItems:r,other:a,title:s,subtitle:c,editable:d=!0,draggable:R=!1,withImage:p=!1,deletable:v=!0,addable:g=!0,itemsType:i,itemsOptions:x}=l,[_,N]=h.useState(null),[q,k]=h.useState({top:0,left:0}),[F,S]=h.useState(!1),D=(m,b)=>{const P=[...o],[y]=P.splice(m,1);P.splice(b,0,y),r(P)};h.useEffect(()=>{const m=()=>{N(null),S(!1)};return document.body.addEventListener("click",m),N(null),S(!1),()=>{N(null),S(!1),document.body.removeEventListener("click",m)}},[]),h.useEffect(()=>{if(_){const m=[...o].map(b=>b.id===_.id?_:b);r(m)}},[_]);const L=(m,b)=>{m.stopPropagation();const P=m.target.getBoundingClientRect(),y=100,H=window.innerHeight;let T=P.top+window.scrollY;T+y>H&&(T=H-y-20),S(!0),k({top:T-80,left:P.left-30}),N(b)};function Q(m){if(p)return m?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${m}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const X=(m,b)=>{const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})},b),i==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const H=[...o],T=Number(y.split(" ")[1]),u=x.find(E=>E.id===T);if(!u)return;const C={...u.productData.stats,newPrice:u.productData.minPrice.amount,oldPrice:u.productData.compareAtPrice.amount},w=H.map(E=>E.id===m.id?{...m,name:y,listingId:T,stats:C}:E);N({...m,name:y,listingId:T}),r([...w])},value:m.name,options:[...x.map(y=>`Product ${y.id}`)],leftAddon:Q(m.images[0])},b),t.jsxRuntimeExports.jsxs("div",{className:B.buttons,children:[d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>L(y,m)}),v&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>r(o.filter(y=>y.id!==m.id))})]})]});return R?t.jsxRuntimeExports.jsx(Ce,{product:m,index:b,moveProduct:D,children:P},m.id):t.jsxRuntimeExports.jsx("div",{className:B.product,children:P},m.id)};return t.jsxRuntimeExports.jsxs("div",{className:B.productsBlock,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:B.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:B.title,children:s}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:m=>e==null?void 0:e(m)})]}),F&&_&&t.jsxRuntimeExports.jsx(Ne,{activeItem:_,setActiveItem:N,setIsOpenModal:S,popupPosition:q}),t.jsxRuntimeExports.jsxs("div",{className:B.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:B.subtitle,children:c}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:o.map((m,b)=>X(m,b))}):o.map((m,b)=>X(m,b)),g&&t.jsxRuntimeExports.jsxs(t.Button,{className:B.button,size:"s",onClick:()=>{const m=[...o],b=x[0].id;m.push({name:`Product ${b}`,id:t.v4(),listingId:b,imagePath:"",images:[],stats:{...x[0].productData.stats,newPrice:x[0].productData.minPrice.amount,oldPrice:x[0].productData.compareAtPrice.amount}}),r(m)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),a!==void 0&&t.jsxRuntimeExports.jsx(tt,{items:a})]})},qe="_options_q6sjs_1",Pe="_price_q6sjs_12",we="_oldPrice_q6sjs_19",Se="_newPrice_q6sjs_27",Te="_meta_q6sjs_34",Ae="_info_q6sjs_40",Oe="_infoRight_q6sjs_48",De="_buttons_q6sjs_55",Le="_variants_q6sjs_62",Me="_variant_q6sjs_62",He="_stock_q6sjs_79",Ve="_variantInfo_q6sjs_86",Fe="_quantity_q6sjs_92",Ue="_count_q6sjs_99",ze="_button_q6sjs_55",Ge="_activeVariant_q6sjs_120",Ye="_chargeTypes_q6sjs_124",Xe="_charge_q6sjs_124",Qe="_chargeActive_q6sjs_144",f={options:qe,price:Pe,oldPrice:we,newPrice:Se,meta:Te,info:Ae,infoRight:Oe,buttons:De,variants:Le,variant:Me,stock:He,variantInfo:Ve,quantity:Fe,count:Ue,button:ze,activeVariant:Ge,chargeTypes:Ye,charge:Xe,chargeActive:Qe},We=l=>{const{variants:n}=l,[e,o]=h.useState(n[0]),r=t.useNavigate(),[a,s]=h.useState(1),{reset:c,addProductToCart:d,getProducts:R}=t.useCart();async function p(){await R(),await d({productId:l.id,productVariantId:e.id,quantity:a})}function v(){c(),p(),r("/checkout")}function g(i){if(i>=864e5){const k=Math.floor(i/864e5);return`${k} ${k===1?"day":"days"}`}else if(i>=36e5){const k=Math.floor(i/36e5);return`${k} ${k===1?"hour":"hours"}`}else if(i>=6e4){const k=Math.floor(i/6e4);return`${k} ${k===1?"minute":"minutes"}`}else{const k=Math.floor(i/1e3);return`${k} ${k===1?"second":"seconds"}`}}return t.jsxRuntimeExports.jsxs("div",{className:f.options,children:[t.jsxRuntimeExports.jsx("div",{className:f.chargeTypes,children:e.chargeTypes?e.chargeTypes.map(i=>t.jsxRuntimeExports.jsx("div",{children:i},i)):t.jsxRuntimeExports.jsx("div",{className:t.clx(f.charge,f.chargeActive),children:"One-Time"})}),t.jsxRuntimeExports.jsx("div",{className:f.variants,children:n.map(i=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(f.variant,{[f.activeVariant]:e.id===i.id}),onClick:()=>o(i),children:[t.jsxRuntimeExports.jsxs("div",{className:f.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:f.title,children:i.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i.price.amount]})]}),t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsxs("span",{className:f.stock,children:[i.quantity.restrictions.max||0," in stock"]})})]},i.id))}),t.jsxRuntimeExports.jsxs("div",{className:f.quantity,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{a>1?s(i=>i-1):s(1)},className:f.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("div",{className:f.count,children:a}),t.jsxRuntimeExports.jsx("div",{onClick:()=>s(i=>i+1),className:f.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:f.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:f.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:f.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:e.deliveryTime===0?"Instant":g(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:f.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:f.infoRight,children:e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:f.price,children:[t.jsxRuntimeExports.jsxs("span",{className:f.newPrice,children:["$ ",(e.price.amount||0)*a]}),t.jsxRuntimeExports.jsxs("span",{className:f.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*a]})]}):t.jsxRuntimeExports.jsxs("span",{className:f.newPrice,children:["$ ",(e.price.amount||0)*a]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:f.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>v(),children:"Buy Now"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>p(),children:"Add to Cart"})]})]})},Je="_button_14i4s_1",Ke="_login_14i4s_14",Ze="_signUp_14i4s_18",tn="_buttons_14i4s_23",sn="_modal_14i4s_32",en="_info_14i4s_48",nn="_top_14i4s_55",on="_title_14i4s_66",cn="_clear_14i4s_72",rn="_activeClear_14i4s_79",an="_count_14i4s_83",ln="_cart_14i4s_98",un="_empty_14i4s_106",dn="_product_14i4s_132",xn="_products_14i4s_141",mn="_image_14i4s_149",pn="_productInfo_14i4s_155",_n="_content_14i4s_162",jn="_name_14i4s_168",hn="_price_14i4s_174",gn="_productButtons_14i4s_180",fn="_productButton_14i4s_180",bn="_productCount_14i4s_200",vn="_bottom_14i4s_216",Rn="_subtotal_14i4s_224",En="_block_14i4s_232",kn="_shoppingCount_14i4s_239",j={button:Je,login:Ke,signUp:Ze,buttons:tn,modal:sn,info:en,top:nn,title:on,clear:cn,activeClear:rn,count:an,cart:ln,empty:un,product:dn,products:xn,image:mn,productInfo:pn,content:_n,name:jn,price:hn,productButtons:gn,productButton:fn,productCount:bn,bottom:vn,subtotal:Rn,block:En,shoppingCount:kn},yn=l=>{const{shopping:n,signUp:e}=l,o=t.useNavigate();function r(a){o(a)}return t.jsxRuntimeExports.jsxs("div",{className:j.buttons,children:[n&&t.jsxRuntimeExports.jsx(ot,{}),t.jsxRuntimeExports.jsx("div",{className:t.clx(j.button,j.login),onClick:()=>r("/customer-dash"),children:"Login"}),e&&t.jsxRuntimeExports.jsx("div",{className:t.clx(j.button,j.login,j.signUp),onClick:()=>r("/customer-dash"),children:"Sign Up"})]})},ot=()=>{const[l,n]=h.useState(!1),{cart:e}=t.useCart();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:j.button,onClick:o=>{o.stopPropagation(),n(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"#252525"}),e.parts.length>0&&t.jsxRuntimeExports.jsx("div",{className:j.shoppingCount,children:e.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:n,children:t.jsxRuntimeExports.jsx(it,{})})]})},it=()=>{const{cart:l,reset:n,getProducts:e,getTotalAndDiscount:o,updateQuantityOfProduct:r}=t.useCart(),[a,s]=h.useState([]),c=t.useNavigate();function d(i){for(let x=0;x<l.parts.length;x++)for(let _=0;_<i.variants.length;_++)if(l.parts[x].productVariantId===i.variants[x].id)return l.parts[x].productVariantId}function R(i){for(let x=0;x<l.parts.length;x++)for(let _=0;_<i.variants.length;_++)if(l.parts[x].productVariantId===i.variants[x].id)return l.parts[x].quantity}function p(i){c(i)}function v(i){r({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity+1})}function g(i){r({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity-1})}return h.useEffect(()=>{(async()=>{const x=l.parts.map(q=>String(q.productId)),N=(await e([...x])).map(q=>({...q,activeVariantId:d(q),quantity:R(q)}));s(N)})()},[l]),t.jsxRuntimeExports.jsxs("div",{className:j.modal,onClick:i=>i.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:j.top,children:[t.jsxRuntimeExports.jsxs("div",{className:j.info,children:[t.jsxRuntimeExports.jsx("span",{className:j.title,children:"Cart"}),l.parts.length>0&&t.jsxRuntimeExports.jsx("div",{className:j.count,children:l.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(j.clear,{[j.activeClear]:l.parts.length>0}),disabled:l.parts.length===0,onClick:()=>n(),children:"Clear all"})]}),l.parts.length>0?t.jsxRuntimeExports.jsxs("div",{className:j.cart,children:[t.jsxRuntimeExports.jsx("div",{className:j.products,children:a.map(i=>t.jsxRuntimeExports.jsxs("div",{className:j.product,children:[t.jsxRuntimeExports.jsxs("div",{className:j.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:j.image}),t.jsxRuntimeExports.jsxs("div",{className:j.content,children:[t.jsxRuntimeExports.jsx("div",{className:j.name,children:i.name}),t.jsxRuntimeExports.jsxs("div",{className:j.price,children:["$",i.variants.find(x=>x.id===i.activeVariantId).price.amount*((i==null?void 0:i.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:j.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{i.quantity!==1&&g(i)},className:j.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:j.productCount,children:i.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>v(i),className:j.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},i.id))}),t.jsxRuntimeExports.jsxs("div",{className:j.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:j.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:j.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{children:["$",o().total]})]}),t.jsxRuntimeExports.jsx(t.Button,{onClick:()=>p("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ct,{})]})},ct=()=>t.jsxRuntimeExports.jsxs("div",{className:j.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"})}),t.jsxRuntimeExports.jsx("span",{children:"Your cart is empty"}),t.jsxRuntimeExports.jsx("span",{children:"Check out the store's products and add them here"})]});exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.ErrorableBlock=t.ErrorableBlock;exports.Icon=t.Icon;exports.Input=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.Accordion=xt;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Xs;exports.EmptyCart=ct;exports.HeaderButtons=yn;exports.ItemsSettings=st;exports.LayoutSettings=It;exports.ListingSelector=Be;exports.ProductOptions=We;exports.RangeSelector=nt;exports.ShoppingButton=ot;exports.ShoppingModalCart=it;exports.TextSettings=Z;exports.TypesText=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./root-DViUor-X.cjs"),h=require("react"),rt="_accordion_9e4oa_1",at="_header_9e4oa_9",lt="_icon_9e4oa_18",ut="_open_9e4oa_21",dt="_content_9e4oa_25",z={accordion:rt,header:at,icon:lt,open:ut,content:dt},xt=({title:l,content:n})=>{const[e,o]=h.useState(!1),[r,a]=h.useState(0),s=h.useRef(null),c=()=>{o(!e)};return h.useEffect(()=>{s.current&&a(e?s.current.scrollHeight:0)},[e]),t.jsxRuntimeExports.jsxs("div",{className:z.accordion,children:[t.jsxRuntimeExports.jsxs("div",{className:z.header,onClick:c,children:[t.jsxRuntimeExports.jsx("h3",{children:l}),t.jsxRuntimeExports.jsx("div",{className:t.clx(z.icon,{[z.open]:e}),children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown"})})]}),t.jsxRuntimeExports.jsx("div",{ref:s,className:z.content,style:{height:`${r}px`},children:t.jsxRuntimeExports.jsx("p",{children:n})})]})},mt="_wrapper_9rr5j_2",pt="_alignmentBlock_9rr5j_8",_t="_title_9rr5j_15",jt="_subtitle_9rr5j_22",ht="_alignmentContent_9rr5j_29",gt="_alignments_9rr5j_37",ft="_alignment_9rr5j_8",bt="_circle_9rr5j_58",vt="_paddings_9rr5j_65",Rt="_padding_9rr5j_65",Et="_input_9rr5j_84",A={wrapper:mt,alignmentBlock:pt,title:_t,subtitle:jt,alignmentContent:ht,alignments:gt,alignment:ft,circle:bt,paddings:vt,padding:Rt,input:Et},kt=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],yt=["left","top","right","bottom"],It=l=>{const{alignment:n,padding:e,setPadding:o,setAlignment:r}=l;function a(){switch(n){case"left":case"topLeft":case"bottomLeft":return"TextAlignLeft";case"right":case"topRight":case"bottomRight":return"TextAlignRight";case"center":case"top":case"bottom":return"TextAlignCenter";default:return"TextAlignCenter"}}function s(c){switch(c){case"left":return"AlignLeft";case"right":return"AlignRight";case"top":return"AlignTop";case"bottom":return"AlignBottom"}}return t.jsxRuntimeExports.jsxs("div",{className:A.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:A.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:A.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:A.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:A.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:A.alignments,children:kt.map(c=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{r(c)},className:A.alignment,children:[c!==n&&t.jsxRuntimeExports.jsx("div",{className:A.circle}),c===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:a(),fill:"#FF3F19",width:22,height:22})]},c))}),t.jsxRuntimeExports.jsx("div",{className:A.paddings,children:yt.map(c=>t.jsxRuntimeExports.jsxs("label",{className:A.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:s(c),width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(e[c]),onChange:d=>o({...e,[c]:Number(d)}),paddingless:!0,borderless:!0})]},c))})]})]})]})},$t="_subtitle_1qrz9_1",Nt="_header_1qrz9_8",Ct="_text_1qrz9_9",Bt="_top_1qrz9_17",qt="_itemsBlock_1qrz9_26",G={subtitle:$t,header:Nt,text:Ct,top:Bt,itemsBlock:qt},Pt="_typeTexts_rcw8p_1",wt="_block_rcw8p_8",St="_active_rcw8p_21",W={typeTexts:Pt,block:wt,active:St},Tt=["bold","italic","underline","strike-through","code"],K=l=>{const{typesText:n,setTypesText:e}=l;function o(r){switch(r){case"bold":return"TextB";case"italic":return"TextItalic";case"code":return"CodeSimple";case"strike-through":return"TextStrikethrough";case"underline":return"TextUnderline"}}return t.jsxRuntimeExports.jsx("div",{className:W.typeTexts,children:Tt.map(r=>t.jsxRuntimeExports.jsx("div",{className:t.clx(W.block,{[W.active]:n.includes(r)}),onClick:()=>{const a=[...n];if(a.includes(r)){const s=a.filter(c=>c!==r);e(s)}else a.push(r),e(a)},children:t.jsxRuntimeExports.jsx(t.Icon,{name:o(r),fill:n.includes(r)?"#252525":"#757575",width:20,height:20})},String(r)))})},Z=l=>{const{typesText:n,isActiveText:e,setIsActiveText:o,text:r,setText:a,setTypesText:s,title:c,subtitle:d="Items"}=l;return t.jsxRuntimeExports.jsxs("div",{className:G.text,children:[(c||e!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:G.top,children:[c&&t.jsxRuntimeExports.jsx("h3",{className:G.title,children:c}),e!==void 0&&o&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:R=>o(R)})]}),t.jsxRuntimeExports.jsxs("div",{className:G.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:G.subtitle,children:d}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:R=>a(R),value:r,maxLength:150}),t.jsxRuntimeExports.jsx(K,{typesText:n,setTypesText:s})]})]})},At="_subtitle_cuny2_1",Ot="_header_cuny2_8",Dt="_text_cuny2_9",Lt="_productsBlock_cuny2_10",Mt="_top_cuny2_22",Ht="_itemsBlock_cuny2_31",Vt="_typeTexts_cuny2_37",Ft="_block_cuny2_44",Ut="_active_cuny2_57",zt="_products_cuny2_10",Gt="_product_cuny2_10",Yt="_button_cuny2_76",Xt="_disabled_cuny2_87",Qt="_image_cuny2_91",Wt="_info_cuny2_98",Jt="_name_cuny2_110",Kt="_buttons_cuny2_114",Zt="_modal_cuny2_121",ts="_link_cuny2_141",ss="_modalOptions_cuny2_147",$={subtitle:At,header:Ot,text:Dt,productsBlock:Lt,top:Mt,itemsBlock:Ht,typeTexts:Vt,block:Ft,active:Ut,products:zt,product:Gt,button:Yt,disabled:Xt,image:Qt,info:Wt,name:Jt,buttons:Kt,modal:Zt,link:ts,modalOptions:ss},es=l=>{const{activeItem:n,setActiveItem:e,popupPosition:o,modalOptions:r,setIsOpenModal:a}=l;return t.jsxRuntimeExports.jsxs("div",{className:$.modal,onClick:s=>{s.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{e(null),a(!1)}})]}),t.jsxRuntimeExports.jsx("div",{className:$.modalOptions,children:r.map(s=>{if(s.type==="image")return t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:c=>{const d={...n,[s.field]:c};e(d)}},String(s.field));if(s.type==="text")return t.jsxRuntimeExports.jsx(Z,{typesText:n[s.field.type],setTypesText:c=>{const d={...n,[s.field.type]:c};e(d)},text:n[s.field.text]||"",setText:c=>{const d={...n,[s.field.text]:c};e(d)},subtitle:s.label});if(s.type==="input")return t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const d={...n,[s.field]:c};e(d)},value:n[s.field]||"",label:s.label,placeholder:s.placeholder});if(s.type==="inputSwitch")return t.jsxRuntimeExports.jsxs("div",{className:$.link,children:[t.jsxRuntimeExports.jsx(t.Input,{onChange:c=>{const d={...n,[s.field.text]:c};e(d)},value:n[s.field.text]||"",label:s.inputLabel,placeholder:s.placeholder}),t.jsxRuntimeExports.jsx(t.Switch,{current:!!n[s.field.switch]||!1,label:s.switchLabel,onChange:c=>{const d={...n,[s.field.switch]:c};e(d)}})]});if(s.type==="list")return t.jsxRuntimeExports.jsx(st,{items:n[s.field]||[],setItems:c=>{const d={...n,[s.field]:c};e(d)},itemsType:"select",draggable:s.draggable||!1,itemsOptions:s.itemsOptions,deletable:s.deletable||!1,editable:!1,subtitle:s.label});if(s.type==="select")return t.jsxRuntimeExports.jsx(t.Select,{options:s.itemsOptions,onChange:c=>{const d={...n,[s.field]:c};e(d)},label:s.label,value:n[s.field]||"String",leftAddon:s.leftAddon&&s.leftAddon==="icon"&&t.jsxRuntimeExports.jsx(t.Icon,{name:n[s.field]})})})})]})},ns="_other_g74jx_1",os="_subtitle_g74jx_7",is="_items_g74jx_14",J={other:ns,subtitle:os,items:is},tt=l=>{const{items:n,title:e="Other"}=l;return t.jsxRuntimeExports.jsxs("div",{className:J.other,children:[t.jsxRuntimeExports.jsx("h5",{className:J.subtitle,children:e}),t.jsxRuntimeExports.jsx("div",{className:J.items,children:n.map((o,r)=>t.jsxRuntimeExports.jsx(t.Switch,{current:o.isItem,onChange:a=>o.setIsItem(a),label:o.label,hasBackground:!0,paddingless:!1},r))})]})},cs=l=>{const{index:n,moveProduct:e,children:o}=l,[,r]=t.useDrop({accept:"product",hover(c){c.index!==n&&(e(c.index,n),c.index=n)}}),[{isDragging:a},s]=t.useDrag({type:"product",item:{index:n},collect:c=>({isDragging:c.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:c=>s(r(c)),className:`${$.product} ${a?$.dragging:""}`,children:o})},st=l=>{const{isActiveItems:n,setIsActiveItems:e,items:o,setItems:r,other:a,title:s,subtitle:c,editable:d=!0,draggable:R=!1,withImage:p=!1,deletable:v=!0,addable:g=!0,itemsType:i,itemsPlaceholder:x="",itemsOptions:_,hasRangeSelector:N=!1,rangeSelectorOptions:q,modalOptions:k,addableOptions:F={},limit:S}=l,[D,L]=h.useState(null),[Q,X]=h.useState({top:0,left:0}),[m,b]=h.useState(!1),P=(u,C)=>{const w=[...o],[E]=w.splice(u,1);w.splice(C,0,E),r(w)};h.useEffect(()=>{const u=()=>{L(null),b(!1)};return document.body.addEventListener("click",u),L(null),b(!1),()=>{L(null),b(!1),document.body.removeEventListener("click",u)}},[]),h.useEffect(()=>{if(D){const u=[...o].map(C=>C.id===D.id?D:C);r(u)}},[D]);const y=(u,C)=>{u.stopPropagation(),b(!0);const w=u.target.getBoundingClientRect(),E=500,U=window.innerHeight;let O=w.top+window.scrollY;O+E>U&&(O=U-E-20),X({top:O-80,left:w.left-30}),L(C)};function H(u){if(p)return u?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${u[0]}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const T=(u,C)=>{const w=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})}),i==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:E=>{const O=[...o].map(M=>M.id===u.id?{...u,name:E}:M);L({...u,name:E}),r([...O])},value:u.name,options:_,leftAddon:H(u.images)}),i==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:E=>{const O=[...o].map(M=>M.id===u.id?{...u,name:E}:M);r([...O])},value:u.name,placeholder:x}),i==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{onChange:E=>{const O=[...o].map(M=>M.id===u.id?{...u,images:E}:M);r([...O])}}),t.jsxRuntimeExports.jsxs("div",{className:$.buttons,children:[d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:E=>y(E,u)}),v&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>r(o.filter(E=>E.id!==u.id))})]})]});return R?t.jsxRuntimeExports.jsx(cs,{product:u,index:C,moveProduct:P,children:w},u.id):t.jsxRuntimeExports.jsx("div",{className:$.product,children:w},u.id)};return t.jsxRuntimeExports.jsxs("div",{className:$.productsBlock,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:$.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:$.title,children:s}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:u=>e==null?void 0:e(u)})]}),D&&d&&k&&m&&t.jsxRuntimeExports.jsx(es,{activeItem:D,setActiveItem:L,popupPosition:Q,modalOptions:k,setIsOpenModal:b}),N&&q&&t.jsxRuntimeExports.jsx(nt,{...q}),t.jsxRuntimeExports.jsxs("div",{className:$.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:$.subtitle,children:c}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:o.map((u,C)=>T(u,C))}):o.map((u,C)=>T(u,C)),g&&t.jsxRuntimeExports.jsxs(t.Button,{className:t.clx($.button,{[$.disabled]:!!(S&&S<=o.length)}),size:"s",disabled:!!(S&&S<=o.length),onClick:()=>{const u=[...o];i==="select"?u.push({name:_[0]||`Product ${o.length+1}`,id:t.v4(),...F}):i==="input"?u.push({name:"",id:t.v4(),...F}):u.push({name:`Image ${o.length+1}`,id:t.v4(),...F}),r(u)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),a!==void 0&&t.jsxRuntimeExports.jsx(tt,{items:a})]})},rs="_subtitle_1fb9q_1",as="_header_1fb9q_8",ls="_text_1fb9q_9",us="_productsBlock_1fb9q_10",ds="_buttonsBlock_1fb9q_11",xs="_top_1fb9q_22",ms="_itemsBlock_1fb9q_31",ps="_typeTexts_1fb9q_37",_s="_block_1fb9q_44",js="_active_1fb9q_56",hs="_products_1fb9q_10",gs="_product_1fb9q_10",fs="_button_1fb9q_11",bs="_image_1fb9q_86",vs="_info_1fb9q_93",Rs="_name_1fb9q_105",Es="_buttons_1fb9q_11",ks="_modal_1fb9q_116",ys="_other_1fb9q_135",Is="_options_1fb9q_141",V={subtitle:rs,header:as,text:ls,productsBlock:us,buttonsBlock:ds,top:xs,itemsBlock:ms,typeTexts:ps,block:_s,active:js,products:hs,product:gs,button:fs,image:bs,info:vs,name:Rs,buttons:Es,modal:ks,other:ys,options:Is},$s=l=>{const{activeButton:n,setActiveButton:e,popupPosition:o}=l,[r,a]=h.useState(n.typesText),[s,c]=h.useState(n.destination),[d,R]=h.useState(n.link||""),[p,v]=h.useState(n.text||"");return h.useEffect(()=>{e({...n,...{text:p,link:d,destination:s,typesText:r}})},[r,s,d,p]),t.jsxRuntimeExports.jsxs("div",{className:V.modal,onClick:g=>{g.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>e(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:V.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:g=>c(g),options:["Go to Page","Open Link"],value:s}),s==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:g=>R(g),value:d,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:g=>v(g),value:p,label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(K,{typesText:r,setTypesText:a})]})]})},Ns="_subtitle_m8qel_1",Cs="_header_m8qel_8",Bs="_text_m8qel_9",qs="_productsBlock_m8qel_10",Ps="_buttonsBlock_m8qel_11",ws="_top_m8qel_23",Ss="_itemsBlock_m8qel_32",Ts="_typeTexts_m8qel_38",As="_block_m8qel_45",Os="_active_m8qel_58",Ds="_products_m8qel_10",Ls="_product_m8qel_10",Ms="_button_m8qel_11",Hs="_image_m8qel_88",Vs="_info_m8qel_95",Fs="_name_m8qel_107",Us="_buttons_m8qel_11",zs="_modal_m8qel_118",Gs="_other_m8qel_137",Ys="_options_m8qel_143",Y={subtitle:Ns,header:Cs,text:Bs,productsBlock:qs,buttonsBlock:Ps,top:ws,itemsBlock:Ss,typeTexts:Ts,block:As,active:Os,products:Ds,product:Ls,button:Ms,image:Hs,info:Vs,name:Fs,buttons:Us,modal:zs,other:Gs,options:Ys},et=l=>{const{buttons:n,setButtons:e,deletable:o=!0,addable:r=!0}=l,[a,s]=h.useState(null),[c,d]=h.useState({top:0,left:0});h.useEffect(()=>{const p=()=>{s(null)};return document.body.addEventListener("click",p),s(null),()=>{s(null),document.body.removeEventListener("click",p)}},[]),h.useEffect(()=>{if(a){const p=[...n].map(v=>v.id===a.id?a:v);e(p)}},[a]);const R=(p,v)=>{p.stopPropagation();const g=p.target.getBoundingClientRect(),i=490,x=window.innerHeight;let _=g.top+window.scrollY;_+i>x&&(_=x-i-20),d({top:_,left:g.left-30}),s(v)};return t.jsxRuntimeExports.jsxs("div",{className:Y.products,children:[t.jsxRuntimeExports.jsx("h5",{className:Y.subtitle,children:"Button Type"}),n.map(p=>t.jsxRuntimeExports.jsxs("div",{className:Y.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:v=>{const i=[...n].map(x=>x.id===p.id?{...p,type:v}:x);e(i)},value:p.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:Y.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:v=>{R(v,p)}}),o&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,onClick:()=>{const v=n.filter(g=>g.id!==p.id);e(v)},width:20,height:20,fill:"#C12A2A"})]})]},p.id)),a&&t.jsxRuntimeExports.jsx($s,{activeButton:a,setActiveButton:s,popupPosition:c}),r&&t.jsxRuntimeExports.jsxs(t.Button,{className:Y.button,size:"s",onClick:()=>{const p=[...n];p.push({type:"Primary",id:t.v4(),typesText:[],destination:"Go to Page",text:""}),e(p)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]})},Xs=l=>{const{isActiveButtons:n,setIsActiveButtons:e,buttons:o,setButtons:r}=l;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:V.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:V.top,children:[t.jsxRuntimeExports.jsx("h3",{className:V.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:a=>e(a)})]}),t.jsxRuntimeExports.jsx(et,{buttons:o,setButtons:r})]})})},Qs="_wrapper_m18qi_1",Ws="_subtitle_m18qi_7",Js="_content_m18qi_14",Ks="_range_m18qi_22",Zs="_track_m18qi_27",te="_progress_m18qi_36",se="_dots_m18qi_46",ee="_dot_m18qi_46",ne="_active_m18qi_65",oe="_input_m18qi_77",ie="_countBlock_m18qi_91",ce="_count_m18qi_91",re="_controls_m18qi_107",ae="_button_m18qi_113",I={wrapper:Qs,subtitle:Ws,content:Js,range:Ks,track:Zs,progress:te,dots:se,dot:ee,active:ne,input:oe,countBlock:ie,count:ce,controls:re,button:ae},nt=l=>{const{label:n,min:e=1,max:o=4,step:r=1,count:a,setCount:s}=l,[c,d]=h.useState(!1),R=Array.from({length:(o-e)/r+1}),p=(a-e)/(o-e)*100,v=()=>{a<o&&s(a+r)},g=()=>{a>e&&s(a-r)},i=x=>{const _=e+x*r;s(_)};return t.jsxRuntimeExports.jsxs("div",{className:I.wrapper,children:[n&&t.jsxRuntimeExports.jsx("h5",{className:I.subtitle,children:n}),t.jsxRuntimeExports.jsxs("div",{className:I.content,children:[t.jsxRuntimeExports.jsxs("div",{className:I.range,children:[t.jsxRuntimeExports.jsx("div",{className:I.track}),t.jsxRuntimeExports.jsx("div",{className:I.progress,style:{width:`${p}%`}}),t.jsxRuntimeExports.jsx("div",{className:I.dots,children:R.map((x,_)=>{const N=_<=(a-e)/r;return t.jsxRuntimeExports.jsx("button",{onClick:()=>i(_),className:t.clx(I.dot,{[I.active]:N,[I.inactive]:!N,[I.dragging]:c}),"aria-label":`Set value to ${e+_*r}`},_)})}),t.jsxRuntimeExports.jsx("input",{type:"range",min:e,max:o,step:r,value:a,onChange:x=>s(Number(x.target.value)),onMouseDown:()=>d(!0),onMouseUp:()=>d(!1),onTouchStart:()=>d(!0),onTouchEnd:()=>d(!1),className:I.input})]}),t.jsxRuntimeExports.jsxs("div",{className:I.countBlock,children:[t.jsxRuntimeExports.jsx(t.Input,{type:"number",min:e,max:o,paddingless:!0,onChange:x=>{const _=Number(x);_>o?s(o):_<e?s(e):s(_)},value:String(a)}),t.jsxRuntimeExports.jsxs("div",{className:I.controls,children:[t.jsxRuntimeExports.jsx("button",{onClick:v,disabled:a>=o,className:I.button,"aria-label":"Increment count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretUp",width:15,height:15})}),t.jsxRuntimeExports.jsx("button",{onClick:g,disabled:a<=e,className:I.button,"aria-label":"Decrement count",children:t.jsxRuntimeExports.jsx(t.Icon,{name:"CaretDown",width:15,height:15})})]})]})]})]})},le="_subtitle_16rdk_1",ue="_header_16rdk_8",de="_text_16rdk_9",xe="_productsBlock_16rdk_10",me="_top_16rdk_22",pe="_itemsBlock_16rdk_31",_e="_typeTexts_16rdk_37",je="_block_16rdk_44",he="_active_16rdk_57",ge="_products_16rdk_10",fe="_product_16rdk_10",be="_button_16rdk_76",ve="_image_16rdk_87",Re="_info_16rdk_94",Ee="_name_16rdk_106",ke="_buttons_16rdk_110",ye="_modal_16rdk_117",Ie="_link_16rdk_137",$e="_modalOptions_16rdk_143",B={subtitle:le,header:ue,text:de,productsBlock:xe,top:me,itemsBlock:pe,typeTexts:_e,block:je,active:he,products:ge,product:fe,button:be,image:ve,info:Re,name:Ee,buttons:ke,modal:ye,link:Ie,modalOptions:$e},Ne=l=>{const{activeItem:n,setActiveItem:e,popupPosition:o,setIsOpenModal:r}=l;return t.jsxRuntimeExports.jsxs("div",{className:B.modal,onClick:a=>{a.stopPropagation()},style:{top:`${o.top}px`,left:`${o.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:B.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"X",height:20,width:20,hoverable:!0,onClick:()=>{r(!1),e(null)}})]}),t.jsxRuntimeExports.jsx("div",{className:B.modalOptions,children:t.jsxRuntimeExports.jsx(t.ChooseImage,{label:"Put up an attractive image",onChange:a=>{const s={...n,images:a,imagePath:a[0]};e(s)}})})]})},Ce=l=>{const{index:n,moveProduct:e,children:o}=l,[,r]=t.useDrop({accept:"product",hover(c){c.index!==n&&(e(c.index,n),c.index=n)}}),[{isDragging:a},s]=t.useDrag({type:"product",item:{index:n},collect:c=>({isDragging:c.isDragging()})});return t.jsxRuntimeExports.jsx("div",{ref:c=>s(r(c)),className:`${B.product} ${a?B.dragging:""}`,children:o})},Be=l=>{const{isActiveItems:n,setIsActiveItems:e,items:o,setItems:r,other:a,title:s,subtitle:c,editable:d=!0,draggable:R=!1,withImage:p=!1,deletable:v=!0,addable:g=!0,itemsType:i,itemsOptions:x}=l,[_,N]=h.useState(null),[q,k]=h.useState({top:0,left:0}),[F,S]=h.useState(!1),D=(m,b)=>{const P=[...o],[y]=P.splice(m,1);P.splice(b,0,y),r(P)};h.useEffect(()=>{const m=()=>{N(null),S(!1)};return document.body.addEventListener("click",m),N(null),S(!1),()=>{N(null),S(!1),document.body.removeEventListener("click",m)}},[]),h.useEffect(()=>{if(_){const m=[...o].map(b=>b.id===_.id?_:b);r(m)}},[_]);const L=(m,b)=>{m.stopPropagation();const P=m.target.getBoundingClientRect(),y=100,H=window.innerHeight;let T=P.top+window.scrollY;T+y>H&&(T=H-y-20),S(!0),k({top:T-80,left:P.left-30}),N(b)};function Q(m){if(p)return m?t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${m}/w=1000`,alt:"image",width:16,height:16}):t.jsxRuntimeExports.jsx(t.Icon,{name:"Image",width:16,height:16,fill:"#757575"})}const X=(m,b)=>{const P=t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[R&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20})},b),i==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:y=>{const H=[...o],T=Number(y.split(" ")[1]),u=x.find(E=>E.id===T);if(!u)return;const C={...u.productData.stats,newPrice:u.productData.minPrice.amount,oldPrice:u.productData.compareAtPrice.amount},w=H.map(E=>E.id===m.id?{...m,name:y,listingId:T,stats:C}:E);N({...m,name:y,listingId:T}),r([...w])},value:m.name,options:[...x.map(y=>`Product ${y.id}`)],leftAddon:Q(m.images[0])},b),t.jsxRuntimeExports.jsxs("div",{className:B.buttons,children:[d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Sliders",hoverable:!0,width:20,height:20,onClick:y=>L(y,m)}),v&&t.jsxRuntimeExports.jsx(t.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A",onClick:()=>r(o.filter(y=>y.id!==m.id))})]})]});return R?t.jsxRuntimeExports.jsx(Ce,{product:m,index:b,moveProduct:D,children:P},m.id):t.jsxRuntimeExports.jsx("div",{className:B.product,children:P},m.id)};return t.jsxRuntimeExports.jsxs("div",{className:B.productsBlock,children:[(s||n!==void 0)&&t.jsxRuntimeExports.jsxs("div",{className:B.top,children:[s&&t.jsxRuntimeExports.jsx("h3",{className:B.title,children:s}),n!==void 0&&t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:m=>e==null?void 0:e(m)})]}),F&&_&&t.jsxRuntimeExports.jsx(Ne,{activeItem:_,setActiveItem:N,setIsOpenModal:S,popupPosition:q}),t.jsxRuntimeExports.jsxs("div",{className:B.products,children:[c&&t.jsxRuntimeExports.jsx("h5",{className:B.subtitle,children:c}),R?t.jsxRuntimeExports.jsx(t.DndProvider,{backend:t.HTML5Backend,children:o.map((m,b)=>X(m,b))}):o.map((m,b)=>X(m,b)),g&&t.jsxRuntimeExports.jsxs(t.Button,{className:B.button,size:"s",onClick:()=>{const m=[...o],b=x[0].id;m.push({name:`Product ${b}`,id:t.v4(),listingId:b,imagePath:"",images:[],stats:{...x[0].productData.stats,newPrice:x[0].productData.minPrice.amount,oldPrice:x[0].productData.compareAtPrice.amount}}),r(m)},children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",width:16,height:16})]})]}),a!==void 0&&t.jsxRuntimeExports.jsx(tt,{items:a})]})},qe="_options_q6sjs_1",Pe="_price_q6sjs_12",we="_oldPrice_q6sjs_19",Se="_newPrice_q6sjs_27",Te="_meta_q6sjs_34",Ae="_info_q6sjs_40",Oe="_infoRight_q6sjs_48",De="_buttons_q6sjs_55",Le="_variants_q6sjs_62",Me="_variant_q6sjs_62",He="_stock_q6sjs_79",Ve="_variantInfo_q6sjs_86",Fe="_quantity_q6sjs_92",Ue="_count_q6sjs_99",ze="_button_q6sjs_55",Ge="_activeVariant_q6sjs_120",Ye="_chargeTypes_q6sjs_124",Xe="_charge_q6sjs_124",Qe="_chargeActive_q6sjs_144",f={options:qe,price:Pe,oldPrice:we,newPrice:Se,meta:Te,info:Ae,infoRight:Oe,buttons:De,variants:Le,variant:Me,stock:He,variantInfo:Ve,quantity:Fe,count:Ue,button:ze,activeVariant:Ge,chargeTypes:Ye,charge:Xe,chargeActive:Qe},We=l=>{const{variants:n}=l,[e,o]=h.useState(n[0]),r=t.useNavigate(),[a,s]=h.useState(1),{reset:c,addProductToCart:d,getProducts:R}=t.useCart();async function p(){await R(),await d({productId:l.id,productVariantId:e.id,quantity:a})}function v(){c(),p(),r("/checkout")}function g(i){if(i>=864e5){const k=Math.floor(i/864e5);return`${k} ${k===1?"day":"days"}`}else if(i>=36e5){const k=Math.floor(i/36e5);return`${k} ${k===1?"hour":"hours"}`}else if(i>=6e4){const k=Math.floor(i/6e4);return`${k} ${k===1?"minute":"minutes"}`}else{const k=Math.floor(i/1e3);return`${k} ${k===1?"second":"seconds"}`}}return t.jsxRuntimeExports.jsxs("div",{className:f.options,children:[t.jsxRuntimeExports.jsx("div",{className:f.chargeTypes,children:e.chargeTypes?e.chargeTypes.map(i=>t.jsxRuntimeExports.jsx("div",{children:i},i)):t.jsxRuntimeExports.jsx("div",{className:t.clx(f.charge,f.chargeActive),children:"One-Time"})}),t.jsxRuntimeExports.jsx("div",{className:f.variants,children:n.map(i=>t.jsxRuntimeExports.jsxs("div",{className:t.clx(f.variant,{[f.activeVariant]:e.id===i.id}),onClick:()=>o(i),children:[t.jsxRuntimeExports.jsxs("div",{className:f.variantInfo,children:[t.jsxRuntimeExports.jsx("span",{className:f.title,children:i.name}),t.jsxRuntimeExports.jsxs("span",{children:["$",i.price.amount]})]}),t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsxs("span",{className:f.stock,children:[i.quantity.restrictions.max||0," in stock"]})})]},i.id))}),t.jsxRuntimeExports.jsxs("div",{className:f.quantity,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{a>1?s(i=>i-1):s(1)},className:f.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus"})}),t.jsxRuntimeExports.jsx("div",{className:f.count,children:a}),t.jsxRuntimeExports.jsx("div",{onClick:()=>s(i=>i+1),className:f.button,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus"})})]}),t.jsxRuntimeExports.jsxs("div",{className:f.meta,children:[t.jsxRuntimeExports.jsxs("div",{className:f.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Delivery"}),t.jsxRuntimeExports.jsxs("div",{className:f.infoRight,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Lightning",fill:"#FF3F19",width:20,height:20}),t.jsxRuntimeExports.jsx("span",{children:e.deliveryTime===0?"Instant":g(e.deliveryTime)})]})]}),t.jsxRuntimeExports.jsxs("div",{className:f.info,children:[t.jsxRuntimeExports.jsx("span",{children:"Price"}),t.jsxRuntimeExports.jsx("div",{className:f.infoRight,children:e.compareAtPrice&&(e.compareAtPrice.amount||0)-(e.price.amount||0)>0?t.jsxRuntimeExports.jsxs("div",{className:f.price,children:[t.jsxRuntimeExports.jsxs("span",{className:f.newPrice,children:["$ ",(e.price.amount||0)*a]}),t.jsxRuntimeExports.jsxs("span",{className:f.oldPrice,children:["$ ",(e.compareAtPrice.amount||0)*a]})]}):t.jsxRuntimeExports.jsxs("span",{className:f.newPrice,children:["$ ",(e.price.amount||0)*a]})})]})]}),t.jsxRuntimeExports.jsxs("div",{className:f.buttons,children:[t.jsxRuntimeExports.jsx(t.Button,{type:"Primary",onClick:()=>v(),children:"Buy Now"}),t.jsxRuntimeExports.jsx(t.Button,{type:"Secondary",onClick:()=>p(),children:"Add to Cart"})]})]})},Je="_button_14i4s_1",Ke="_login_14i4s_14",Ze="_signUp_14i4s_18",tn="_buttons_14i4s_23",sn="_modal_14i4s_32",en="_info_14i4s_48",nn="_top_14i4s_55",on="_title_14i4s_66",cn="_clear_14i4s_72",rn="_activeClear_14i4s_79",an="_count_14i4s_83",ln="_cart_14i4s_98",un="_empty_14i4s_106",dn="_product_14i4s_132",xn="_products_14i4s_141",mn="_image_14i4s_149",pn="_productInfo_14i4s_155",_n="_content_14i4s_162",jn="_name_14i4s_168",hn="_price_14i4s_174",gn="_productButtons_14i4s_180",fn="_productButton_14i4s_180",bn="_productCount_14i4s_200",vn="_bottom_14i4s_216",Rn="_subtotal_14i4s_224",En="_block_14i4s_232",kn="_shoppingCount_14i4s_239",j={button:Je,login:Ke,signUp:Ze,buttons:tn,modal:sn,info:en,top:nn,title:on,clear:cn,activeClear:rn,count:an,cart:ln,empty:un,product:dn,products:xn,image:mn,productInfo:pn,content:_n,name:jn,price:hn,productButtons:gn,productButton:fn,productCount:bn,bottom:vn,subtotal:Rn,block:En,shoppingCount:kn},yn=l=>{const{shopping:n,signUp:e}=l,o=t.useNavigate();function r(a){o(a)}return t.jsxRuntimeExports.jsxs("div",{className:j.buttons,children:[n&&t.jsxRuntimeExports.jsx(ot,{}),t.jsxRuntimeExports.jsx("div",{className:t.clx(j.button,j.login),onClick:()=>r("/customer-dash"),children:"Login"}),e&&t.jsxRuntimeExports.jsx("div",{className:t.clx(j.button,j.login,j.signUp),onClick:()=>r("/customer-dash"),children:"Sign Up"})]})},ot=()=>{const[l,n]=h.useState(!1),{cart:e}=t.useCart();return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:j.button,onClick:o=>{o.stopPropagation(),n(!0)},children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag",fill:"#252525"}),e.parts.length>0&&t.jsxRuntimeExports.jsx("div",{className:j.shoppingCount,children:e.parts.length})]}),l&&t.jsxRuntimeExports.jsx(t.Modal,{close:n,children:t.jsxRuntimeExports.jsx(it,{})})]})},it=()=>{const{cart:l,reset:n,getProducts:e,getTotalAndDiscount:o,updateQuantityOfProduct:r}=t.useCart(),[a,s]=h.useState([]),c=t.useNavigate();function d(i){for(let x=0;x<l.parts.length;x++)for(let _=0;_<i.variants.length;_++)if(l.parts[x].productVariantId===i.variants[x].id)return l.parts[x].productVariantId}function R(i){for(let x=0;x<l.parts.length;x++)for(let _=0;_<i.variants.length;_++)if(l.parts[x].productVariantId===i.variants[x].id)return l.parts[x].quantity}function p(i){c(i)}function v(i){r({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity+1})}function g(i){r({productId:i.id,productVariantId:i.activeVariantId,quantity:i.quantity-1})}return h.useEffect(()=>{(async()=>{const x=l.parts.map(q=>String(q.productId)),N=(await e([...x])).map(q=>({...q,activeVariantId:d(q),quantity:R(q)}));s(N)})()},[l]),t.jsxRuntimeExports.jsxs("div",{className:j.modal,onClick:i=>i.stopPropagation(),children:[t.jsxRuntimeExports.jsxs("div",{className:j.top,children:[t.jsxRuntimeExports.jsxs("div",{className:j.info,children:[t.jsxRuntimeExports.jsx("span",{className:j.title,children:"Cart"}),l.parts.length>0&&t.jsxRuntimeExports.jsx("div",{className:j.count,children:l.parts.length})]}),t.jsxRuntimeExports.jsx("button",{className:t.clx(j.clear,{[j.activeClear]:l.parts.length>0}),disabled:l.parts.length===0,onClick:()=>n(),children:"Clear all"})]}),l.parts.length>0?t.jsxRuntimeExports.jsxs("div",{className:j.cart,children:[t.jsxRuntimeExports.jsx("div",{className:j.products,children:a.map(i=>t.jsxRuntimeExports.jsxs("div",{className:j.product,children:[t.jsxRuntimeExports.jsxs("div",{className:j.productInfo,children:[t.jsxRuntimeExports.jsx("img",{src:`https://imagedelivery.net/${i.images[0].cfId}/w=500`,alt:"image",width:"100%",height:"100%",className:j.image}),t.jsxRuntimeExports.jsxs("div",{className:j.content,children:[t.jsxRuntimeExports.jsx("div",{className:j.name,children:i.name}),t.jsxRuntimeExports.jsxs("div",{className:j.price,children:["$",i.variants.find(x=>x.id===i.activeVariantId).price.amount*((i==null?void 0:i.quantity)||1)]})]})]}),t.jsxRuntimeExports.jsxs("div",{className:j.productButtons,children:[t.jsxRuntimeExports.jsx("div",{onClick:()=>{i.quantity!==1&&g(i)},className:j.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Minus",fill:"#757575",width:20,height:20})}),t.jsxRuntimeExports.jsx("div",{className:j.productCount,children:i.quantity}),t.jsxRuntimeExports.jsx("div",{onClick:()=>v(i),className:j.productButton,children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Plus",fill:"#757575",width:20,height:20})})]})]},i.id))}),t.jsxRuntimeExports.jsxs("div",{className:j.bottom,children:[t.jsxRuntimeExports.jsxs("div",{className:j.subtotal,children:[t.jsxRuntimeExports.jsxs("div",{className:j.block,children:[t.jsxRuntimeExports.jsx("span",{children:"Subtotal"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"Info",width:20,height:20,fill:"#757575"})]}),t.jsxRuntimeExports.jsxs("div",{children:["$",o().total]})]}),t.jsxRuntimeExports.jsx(t.Button,{onClick:()=>p("/checkout"),children:"Checkout"})]})]}):t.jsxRuntimeExports.jsx(ct,{})]})},ct=()=>t.jsxRuntimeExports.jsxs("div",{className:j.empty,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"Handbag"})}),t.jsxRuntimeExports.jsx("span",{children:"Your cart is empty"}),t.jsxRuntimeExports.jsx("span",{children:"Check out the store's products and add them here"})]});exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.ErrorableBlock=t.ErrorableBlock;exports.Icon=t.Icon;exports.Input=t.Input;exports.Loader=t.Loader;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.Accordion=xt;exports.ButtonTypeSettings=et;exports.ButtonsSettings=Xs;exports.EmptyCart=ct;exports.HeaderButtons=yn;exports.ItemsSettings=st;exports.LayoutSettings=It;exports.ListingSelector=Be;exports.ProductOptions=We;exports.RangeSelector=nt;exports.ShoppingButton=ot;exports.ShoppingModalCart=it;exports.TextSettings=Z;exports.TypesText=K;
package/dist/ui.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { j as t, c as H, I as x, a as G, S as F, T as lt, C as ot, b as Y, D as rt, H as dt, B as X, v as tt, u as ut, d as _t, e as it, f as at, M as pt } from "./root-Dypsy1hs.js";
2
- import { k as Gn, l as Yn, h as Xn, E as Qn, L as Wn, P as Jn, R as Kn, g as Zn, i as tc } from "./root-Dypsy1hs.js";
1
+ import { j as t, c as H, I as x, a as G, S as F, T as lt, C as ot, b as Y, D as rt, H as dt, B as X, v as tt, u as ut, d as _t, e as it, f as at, M as pt } from "./root-bb64CWCq.js";
2
+ import { k as Gn, l as Yn, h as Xn, E as Qn, L as Wn, P as Jn, R as Kn, g as Zn, i as tc } from "./root-bb64CWCq.js";
3
3
  import f from "react";
4
4
  const gt = "_accordion_9e4oa_1", xt = "_header_9e4oa_9", ft = "_icon_9e4oa_18", jt = "_open_9e4oa_21", bt = "_content_9e4oa_25", J = {
5
5
  accordion: gt,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@billgangcom/theme-lib",
3
- "version": "1.21.0",
3
+ "version": "1.21.2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"