picture-designer 0.1.7 → 0.1.9
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.
|
@@ -19458,7 +19458,7 @@ function pO({ productId: l, imageUrl: r }) {
|
|
|
19458
19458
|
properties: {
|
|
19459
19459
|
Width: `${i}"`,
|
|
19460
19460
|
Height: `${s}"`,
|
|
19461
|
-
Mirror: `${d}
|
|
19461
|
+
Mirror: `${d}`,
|
|
19462
19462
|
_Image: O
|
|
19463
19463
|
}
|
|
19464
19464
|
}]
|
|
@@ -141,4 +141,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${r.do
|
|
|
141
141
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...i){const o=new this(r);return i.forEach(s=>o.set(s)),o}static accessor(r){const o=(this[Om]=this[Om]={accessors:{}}).accessors,s=this.prototype;function f(d){const h=Qa(d);o[h]||(dA(s,d),o[h]=!0)}return L.isArray(r)?r.forEach(f):f(r),this}};ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(ht.prototype,({value:l},r)=>{let i=r[0].toUpperCase()+r.slice(1);return{get:()=>l,set(o){this[i]=o}}}),L.freezeMethods(ht);function ns(l,r){const i=this||Xa,o=r||i,s=ht.from(o.headers);let f=o.data;return L.forEach(l,function(h){f=h.call(i,f,s.normalize(),r?r.status:void 0)}),s.normalize(),f}function Cm(l){return!!(l&&l.__CANCEL__)}function Zl(l,r,i){fe.call(this,l??"canceled",fe.ERR_CANCELED,r,i),this.name="CanceledError"}L.inherits(Zl,fe,{__CANCEL__:!0});function _m(l,r,i){const o=i.config.validateStatus;!i.status||!o||o(i.status)?l(i):r(new fe("Request failed with status code "+i.status,[fe.ERR_BAD_REQUEST,fe.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function hA(l){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l);return r&&r[1]||""}function mA(l,r){l=l||10;const i=new Array(l),o=new Array(l);let s=0,f=0,d;return r=r!==void 0?r:1e3,function(g){const p=Date.now(),v=o[f];d||(d=p),i[s]=g,o[s]=p;let b=f,A=0;for(;b!==s;)A+=i[b++],b=b%l;if(s=(s+1)%l,s===f&&(f=(f+1)%l),p-d<r)return;const C=v&&p-v;return C?Math.round(A*1e3/C):void 0}}function pA(l,r){let i=0,o=1e3/r,s,f;const d=(p,v=Date.now())=>{i=v,s=null,f&&(clearTimeout(f),f=null),l(...p)};return[(...p)=>{const v=Date.now(),b=v-i;b>=o?d(p,v):(s=p,f||(f=setTimeout(()=>{f=null,d(s)},o-b)))},()=>s&&d(s)]}const Ci=(l,r,i=3)=>{let o=0;const s=mA(50,250);return pA(f=>{const d=f.loaded,h=f.lengthComputable?f.total:void 0,g=d-o,p=s(g),v=d<=h;o=d;const b={loaded:d,total:h,progress:h?d/h:void 0,bytes:g,rate:p||void 0,estimated:p&&h&&v?(h-d)/p:void 0,event:f,lengthComputable:h!=null,[r?"download":"upload"]:!0};l(b)},i)},Dm=(l,r)=>{const i=l!=null;return[o=>r[0]({lengthComputable:i,total:l,loaded:o}),r[1]]},Mm=l=>(...r)=>L.asap(()=>l(...r)),gA=rt.hasStandardBrowserEnv?((l,r)=>i=>(i=new URL(i,rt.origin),l.protocol===i.protocol&&l.host===i.host&&(r||l.port===i.port)))(new URL(rt.origin),rt.navigator&&/(msie|trident)/i.test(rt.navigator.userAgent)):()=>!0,yA=rt.hasStandardBrowserEnv?{write(l,r,i,o,s,f,d){if(typeof document>"u")return;const h=[`${l}=${encodeURIComponent(r)}`];L.isNumber(i)&&h.push(`expires=${new Date(i).toUTCString()}`),L.isString(o)&&h.push(`path=${o}`),L.isString(s)&&h.push(`domain=${s}`),f===!0&&h.push("secure"),L.isString(d)&&h.push(`SameSite=${d}`),document.cookie=h.join("; ")},read(l){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+l+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(l){this.write(l,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function vA(l){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(l)}function bA(l,r){return r?l.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):l}function Nm(l,r,i){let o=!vA(r);return l&&(o||i==!1)?bA(l,r):r}const zm=l=>l instanceof ht?{...l}:l;function cl(l,r){r=r||{};const i={};function o(p,v,b,A){return L.isPlainObject(p)&&L.isPlainObject(v)?L.merge.call({caseless:A},p,v):L.isPlainObject(v)?L.merge({},v):L.isArray(v)?v.slice():v}function s(p,v,b,A){if(L.isUndefined(v)){if(!L.isUndefined(p))return o(void 0,p,b,A)}else return o(p,v,b,A)}function f(p,v){if(!L.isUndefined(v))return o(void 0,v)}function d(p,v){if(L.isUndefined(v)){if(!L.isUndefined(p))return o(void 0,p)}else return o(void 0,v)}function h(p,v,b){if(b in r)return o(p,v);if(b in l)return o(void 0,p)}const g={url:f,method:f,data:f,baseURL:d,transformRequest:d,transformResponse:d,paramsSerializer:d,timeout:d,timeoutMessage:d,withCredentials:d,withXSRFToken:d,adapter:d,responseType:d,xsrfCookieName:d,xsrfHeaderName:d,onUploadProgress:d,onDownloadProgress:d,decompress:d,maxContentLength:d,maxBodyLength:d,beforeRedirect:d,transport:d,httpAgent:d,httpsAgent:d,cancelToken:d,socketPath:d,responseEncoding:d,validateStatus:h,headers:(p,v,b)=>s(zm(p),zm(v),b,!0)};return L.forEach(Object.keys({...l,...r}),function(v){const b=g[v]||s,A=b(l[v],r[v],v);L.isUndefined(A)&&b!==h||(i[v]=A)}),i}const Um=l=>{const r=cl({},l);let{data:i,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:f,headers:d,auth:h}=r;if(r.headers=d=ht.from(d),r.url=wm(Nm(r.baseURL,r.url,r.allowAbsoluteUrls),l.params,l.paramsSerializer),h&&d.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):""))),L.isFormData(i)){if(rt.hasStandardBrowserEnv||rt.hasStandardBrowserWebWorkerEnv)d.setContentType(void 0);else if(L.isFunction(i.getHeaders)){const g=i.getHeaders(),p=["content-type","content-length"];Object.entries(g).forEach(([v,b])=>{p.includes(v.toLowerCase())&&d.set(v,b)})}}if(rt.hasStandardBrowserEnv&&(o&&L.isFunction(o)&&(o=o(r)),o||o!==!1&&gA(r.url))){const g=s&&f&&yA.read(f);g&&d.set(s,g)}return r},SA=typeof XMLHttpRequest<"u"&&function(l){return new Promise(function(i,o){const s=Um(l);let f=s.data;const d=ht.from(s.headers).normalize();let{responseType:h,onUploadProgress:g,onDownloadProgress:p}=s,v,b,A,C,w;function x(){C&&C(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(v),s.signal&&s.signal.removeEventListener("abort",v)}let O=new XMLHttpRequest;O.open(s.method.toUpperCase(),s.url,!0),O.timeout=s.timeout;function H(){if(!O)return;const Q=ht.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),$={data:!h||h==="text"||h==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:Q,config:l,request:O};_m(function(Z){i(Z),x()},function(Z){o(Z),x()},$),O=null}"onloadend"in O?O.onloadend=H:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(H)},O.onabort=function(){O&&(o(new fe("Request aborted",fe.ECONNABORTED,l,O)),O=null)},O.onerror=function(Y){const $=Y&&Y.message?Y.message:"Network Error",F=new fe($,fe.ERR_NETWORK,l,O);F.event=Y||null,o(F),O=null},O.ontimeout=function(){let Y=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const $=s.transitional||Tm;s.timeoutErrorMessage&&(Y=s.timeoutErrorMessage),o(new fe(Y,$.clarifyTimeoutError?fe.ETIMEDOUT:fe.ECONNABORTED,l,O)),O=null},f===void 0&&d.setContentType(null),"setRequestHeader"in O&&L.forEach(d.toJSON(),function(Y,$){O.setRequestHeader($,Y)}),L.isUndefined(s.withCredentials)||(O.withCredentials=!!s.withCredentials),h&&h!=="json"&&(O.responseType=s.responseType),p&&([A,w]=Ci(p,!0),O.addEventListener("progress",A)),g&&O.upload&&([b,C]=Ci(g),O.upload.addEventListener("progress",b),O.upload.addEventListener("loadend",C)),(s.cancelToken||s.signal)&&(v=Q=>{O&&(o(!Q||Q.type?new Zl(null,l,O):Q),O.abort(),O=null)},s.cancelToken&&s.cancelToken.subscribe(v),s.signal&&(s.signal.aborted?v():s.signal.addEventListener("abort",v)));const P=hA(s.url);if(P&&rt.protocols.indexOf(P)===-1){o(new fe("Unsupported protocol "+P+":",fe.ERR_BAD_REQUEST,l));return}O.send(f||null)})},EA=(l,r)=>{const{length:i}=l=l?l.filter(Boolean):[];if(r||i){let o=new AbortController,s;const f=function(p){if(!s){s=!0,h();const v=p instanceof Error?p:this.reason;o.abort(v instanceof fe?v:new Zl(v instanceof Error?v.message:v))}};let d=r&&setTimeout(()=>{d=null,f(new fe(`timeout ${r} of ms exceeded`,fe.ETIMEDOUT))},r);const h=()=>{l&&(d&&clearTimeout(d),d=null,l.forEach(p=>{p.unsubscribe?p.unsubscribe(f):p.removeEventListener("abort",f)}),l=null)};l.forEach(p=>p.addEventListener("abort",f));const{signal:g}=o;return g.unsubscribe=()=>L.asap(h),g}},xA=function*(l,r){let i=l.byteLength;if(i<r){yield l;return}let o=0,s;for(;o<i;)s=o+r,yield l.slice(o,s),o=s},wA=async function*(l,r){for await(const i of AA(l))yield*xA(i,r)},AA=async function*(l){if(l[Symbol.asyncIterator]){yield*l;return}const r=l.getReader();try{for(;;){const{done:i,value:o}=await r.read();if(i)break;yield o}}finally{await r.cancel()}},jm=(l,r,i,o)=>{const s=wA(l,r);let f=0,d,h=g=>{d||(d=!0,o&&o(g))};return new ReadableStream({async pull(g){try{const{done:p,value:v}=await s.next();if(p){h(),g.close();return}let b=v.byteLength;if(i){let A=f+=b;i(A)}g.enqueue(new Uint8Array(v))}catch(p){throw h(p),p}},cancel(g){return h(g),s.return()}},{highWaterMark:2})},Lm=64*1024,{isFunction:_i}=L,TA=(({Request:l,Response:r})=>({Request:l,Response:r}))(L.global),{ReadableStream:Hm,TextEncoder:Bm}=L.global,km=(l,...r)=>{try{return!!l(...r)}catch{return!1}},RA=l=>{l=L.merge.call({skipUndefined:!0},TA,l);const{fetch:r,Request:i,Response:o}=l,s=r?_i(r):typeof fetch=="function",f=_i(i),d=_i(o);if(!s)return!1;const h=s&&_i(Hm),g=s&&(typeof Bm=="function"?(w=>x=>w.encode(x))(new Bm):async w=>new Uint8Array(await new i(w).arrayBuffer())),p=f&&h&&km(()=>{let w=!1;const x=new i(rt.origin,{body:new Hm,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!x}),v=d&&h&&km(()=>L.isReadableStream(new o("").body)),b={stream:v&&(w=>w.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!b[w]&&(b[w]=(x,O)=>{let H=x&&x[w];if(H)return H.call(x);throw new fe(`Response type '${w}' is not supported`,fe.ERR_NOT_SUPPORT,O)})});const A=async w=>{if(w==null)return 0;if(L.isBlob(w))return w.size;if(L.isSpecCompliantForm(w))return(await new i(rt.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(L.isArrayBufferView(w)||L.isArrayBuffer(w))return w.byteLength;if(L.isURLSearchParams(w)&&(w=w+""),L.isString(w))return(await g(w)).byteLength},C=async(w,x)=>{const O=L.toFiniteNumber(w.getContentLength());return O??A(x)};return async w=>{let{url:x,method:O,data:H,signal:P,cancelToken:Q,timeout:Y,onDownloadProgress:$,onUploadProgress:F,responseType:Z,headers:J,withCredentials:ie="same-origin",fetchOptions:ce}=Um(w),Ce=r||fetch;Z=Z?(Z+"").toLowerCase():"text";let ve=EA([P,Q&&Q.toAbortSignal()],Y),he=null;const me=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let we;try{if(F&&p&&O!=="get"&&O!=="head"&&(we=await C(J,H))!==0){let T=new i(x,{method:"POST",body:H,duplex:"half"}),G;if(L.isFormData(H)&&(G=T.headers.get("content-type"))&&J.setContentType(G),T.body){const[W,K]=Dm(we,Ci(Mm(F)));H=jm(T.body,Lm,W,K)}}L.isString(ie)||(ie=ie?"include":"omit");const q=f&&"credentials"in i.prototype,B={...ce,signal:ve,method:O.toUpperCase(),headers:J.normalize().toJSON(),body:H,duplex:"half",credentials:q?ie:void 0};he=f&&new i(x,B);let D=await(f?Ce(he,ce):Ce(x,B));const re=v&&(Z==="stream"||Z==="response");if(v&&($||re&&me)){const T={};["status","statusText","headers"].forEach(le=>{T[le]=D[le]});const G=L.toFiniteNumber(D.headers.get("content-length")),[W,K]=$&&Dm(G,Ci(Mm($),!0))||[];D=new o(jm(D.body,Lm,W,()=>{K&&K(),me&&me()}),T)}Z=Z||"text";let pe=await b[L.findKey(b,Z)||"text"](D,w);return!re&&me&&me(),await new Promise((T,G)=>{_m(T,G,{data:pe,headers:ht.from(D.headers),status:D.status,statusText:D.statusText,config:w,request:he})})}catch(q){throw me&&me(),q&&q.name==="TypeError"&&/Load failed|fetch/i.test(q.message)?Object.assign(new fe("Network Error",fe.ERR_NETWORK,w,he),{cause:q.cause||q}):fe.from(q,q&&q.code,w,he)}}},OA=new Map,qm=l=>{let r=l&&l.env||{};const{fetch:i,Request:o,Response:s}=r,f=[o,s,i];let d=f.length,h=d,g,p,v=OA;for(;h--;)g=f[h],p=v.get(g),p===void 0&&v.set(g,p=h?new Map:RA(r)),v=p;return p};qm();const ls={http:$w,xhr:SA,fetch:{get:qm}};L.forEach(ls,(l,r)=>{if(l){try{Object.defineProperty(l,"name",{value:r})}catch{}Object.defineProperty(l,"adapterName",{value:r})}});const Vm=l=>`- ${l}`,CA=l=>L.isFunction(l)||l===null||l===!1;function _A(l,r){l=L.isArray(l)?l:[l];const{length:i}=l;let o,s;const f={};for(let d=0;d<i;d++){o=l[d];let h;if(s=o,!CA(o)&&(s=ls[(h=String(o)).toLowerCase()],s===void 0))throw new fe(`Unknown adapter '${h}'`);if(s&&(L.isFunction(s)||(s=s.get(r))))break;f[h||"#"+d]=s}if(!s){const d=Object.entries(f).map(([g,p])=>`adapter ${g} `+(p===!1?"is not supported by the environment":"is not available in the build"));let h=i?d.length>1?`since :
|
|
142
142
|
`+d.map(Vm).join(`
|
|
143
143
|
`):" "+Vm(d[0]):"as no adapter specified";throw new fe("There is no suitable adapter to dispatch the request "+h,"ERR_NOT_SUPPORT")}return s}const Gm={getAdapter:_A,adapters:ls};function as(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new Zl(null,l)}function Ym(l){return as(l),l.headers=ht.from(l.headers),l.data=ns.call(l,l.transformRequest),["post","put","patch"].indexOf(l.method)!==-1&&l.headers.setContentType("application/x-www-form-urlencoded",!1),Gm.getAdapter(l.adapter||Xa.adapter,l)(l).then(function(o){return as(l),o.data=ns.call(l,l.transformResponse,o),o.headers=ht.from(o.headers),o},function(o){return Cm(o)||(as(l),o&&o.response&&(o.response.data=ns.call(l,l.transformResponse,o.response),o.response.headers=ht.from(o.response.headers))),Promise.reject(o)})}const Xm="1.13.2",Di={};["object","boolean","number","function","string","symbol"].forEach((l,r)=>{Di[l]=function(o){return typeof o===l||"a"+(r<1?"n ":" ")+l}});const Qm={};Di.transitional=function(r,i,o){function s(f,d){return"[Axios v"+Xm+"] Transitional option '"+f+"'"+d+(o?". "+o:"")}return(f,d,h)=>{if(r===!1)throw new fe(s(d," has been removed"+(i?" in "+i:"")),fe.ERR_DEPRECATED);return i&&!Qm[d]&&(Qm[d]=!0,console.warn(s(d," has been deprecated since v"+i+" and will be removed in the near future"))),r?r(f,d,h):!0}},Di.spelling=function(r){return(i,o)=>(console.warn(`${o} is likely a misspelling of ${r}`),!0)};function DA(l,r,i){if(typeof l!="object")throw new fe("options must be an object",fe.ERR_BAD_OPTION_VALUE);const o=Object.keys(l);let s=o.length;for(;s-- >0;){const f=o[s],d=r[f];if(d){const h=l[f],g=h===void 0||d(h,f,l);if(g!==!0)throw new fe("option "+f+" must be "+g,fe.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new fe("Unknown option "+f,fe.ERR_BAD_OPTION)}}const Mi={assertOptions:DA,validators:Di},en=Mi.validators;let fl=class{constructor(r){this.defaults=r||{},this.interceptors={request:new Am,response:new Am}}async request(r,i){try{return await this._request(r,i)}catch(o){if(o instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const f=s.stack?s.stack.replace(/^.+\n/,""):"";try{o.stack?f&&!String(o.stack).endsWith(f.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
|
144
|
-
`+f):o.stack=f}catch{}}throw o}}_request(r,i){typeof r=="string"?(i=i||{},i.url=r):i=r||{},i=cl(this.defaults,i);const{transitional:o,paramsSerializer:s,headers:f}=i;o!==void 0&&Mi.assertOptions(o,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},!1),s!=null&&(L.isFunction(s)?i.paramsSerializer={serialize:s}:Mi.assertOptions(s,{encode:en.function,serialize:en.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Mi.assertOptions(i,{baseUrl:en.spelling("baseURL"),withXsrfToken:en.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let d=f&&L.merge(f.common,f[i.method]);f&&L.forEach(["delete","get","head","post","put","patch","common"],w=>{delete f[w]}),i.headers=ht.concat(d,f);const h=[];let g=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(i)===!1||(g=g&&x.synchronous,h.unshift(x.fulfilled,x.rejected))});const p=[];this.interceptors.response.forEach(function(x){p.push(x.fulfilled,x.rejected)});let v,b=0,A;if(!g){const w=[Ym.bind(this),void 0];for(w.unshift(...h),w.push(...p),A=w.length,v=Promise.resolve(i);b<A;)v=v.then(w[b++],w[b++]);return v}A=h.length;let C=i;for(;b<A;){const w=h[b++],x=h[b++];try{C=w(C)}catch(O){x.call(this,O);break}}try{v=Ym.call(this,C)}catch(w){return Promise.reject(w)}for(b=0,A=p.length;b<A;)v=v.then(p[b++],p[b++]);return v}getUri(r){r=cl(this.defaults,r);const i=Nm(r.baseURL,r.url,r.allowAbsoluteUrls);return wm(i,r.params,r.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(r){fl.prototype[r]=function(i,o){return this.request(cl(o||{},{method:r,url:i,data:(o||{}).data}))}}),L.forEach(["post","put","patch"],function(r){function i(o){return function(f,d,h){return this.request(cl(h||{},{method:r,headers:o?{"Content-Type":"multipart/form-data"}:{},url:f,data:d}))}}fl.prototype[r]=i(),fl.prototype[r+"Form"]=i(!0)});let MA=class kv{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(f){i=f});const o=this;this.promise.then(s=>{if(!o._listeners)return;let f=o._listeners.length;for(;f-- >0;)o._listeners[f](s);o._listeners=null}),this.promise.then=s=>{let f;const d=new Promise(h=>{o.subscribe(h),f=h}).then(s);return d.cancel=function(){o.unsubscribe(f)},d},r(function(f,d,h){o.reason||(o.reason=new Zl(f,d,h),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const i=this._listeners.indexOf(r);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const r=new AbortController,i=o=>{r.abort(o)};return this.subscribe(i),r.signal.unsubscribe=()=>this.unsubscribe(i),r.signal}static source(){let r;return{token:new kv(function(s){r=s}),cancel:r}}};function NA(l){return function(i){return l.apply(null,i)}}function zA(l){return L.isObject(l)&&l.isAxiosError===!0}const rs={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rs).forEach(([l,r])=>{rs[r]=l});function Zm(l){const r=new fl(l),i=om(fl.prototype.request,r);return L.extend(i,fl.prototype,r,{allOwnKeys:!0}),L.extend(i,r,null,{allOwnKeys:!0}),i.create=function(s){return Zm(cl(l,s))},i}const qe=Zm(Xa);qe.Axios=fl,qe.CanceledError=Zl,qe.CancelToken=MA,qe.isCancel=Cm,qe.VERSION=Xm,qe.toFormData=Ri,qe.AxiosError=fe,qe.Cancel=qe.CanceledError,qe.all=function(r){return Promise.all(r)},qe.spread=NA,qe.isAxiosError=zA,qe.mergeConfig=cl,qe.AxiosHeaders=ht,qe.formToJSON=l=>Rm(L.isHTMLForm(l)?new FormData(l):l),qe.getAdapter=Gm.getAdapter,qe.HttpStatusCode=rs,qe.default=qe;const{Axios:xO,AxiosError:wO,CanceledError:AO,isCancel:TO,CancelToken:RO,VERSION:OO,all:CO,Cancel:_O,isAxiosError:DO,spread:MO,toFormData:NO,AxiosHeaders:zO,HttpStatusCode:UO,formToJSON:jO,getAdapter:LO,mergeConfig:HO}=qe;function UA({className:l,...r}){return z.jsx(jS,{role:"status","aria-label":"Loading",className:ct("size-4 animate-spin",l),...r})}function jA({productId:l,imageUrl:r}){const[i,o]=S.useState(),[s,f]=S.useState(),[d,h]=S.useState(!1),[g,p]=S.useState(!1),[v,b]=S.useState(!1),A=S.useRef(null),C=async O=>await cw(O,{cacheBust:!0,pixelRatio:1,skipFonts:!1}),w=async()=>{if(A.current){p(!0),b(!0),await kb(100);try{const O=await C(A.current);await qe.post("/cart/add.json",{items:[{id:l,quantity:1,properties:{Width:`${i}"`,Height:`${s}"`,Mirror:`${d}
|
|
144
|
+
`+f):o.stack=f}catch{}}throw o}}_request(r,i){typeof r=="string"?(i=i||{},i.url=r):i=r||{},i=cl(this.defaults,i);const{transitional:o,paramsSerializer:s,headers:f}=i;o!==void 0&&Mi.assertOptions(o,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},!1),s!=null&&(L.isFunction(s)?i.paramsSerializer={serialize:s}:Mi.assertOptions(s,{encode:en.function,serialize:en.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),Mi.assertOptions(i,{baseUrl:en.spelling("baseURL"),withXsrfToken:en.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let d=f&&L.merge(f.common,f[i.method]);f&&L.forEach(["delete","get","head","post","put","patch","common"],w=>{delete f[w]}),i.headers=ht.concat(d,f);const h=[];let g=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(i)===!1||(g=g&&x.synchronous,h.unshift(x.fulfilled,x.rejected))});const p=[];this.interceptors.response.forEach(function(x){p.push(x.fulfilled,x.rejected)});let v,b=0,A;if(!g){const w=[Ym.bind(this),void 0];for(w.unshift(...h),w.push(...p),A=w.length,v=Promise.resolve(i);b<A;)v=v.then(w[b++],w[b++]);return v}A=h.length;let C=i;for(;b<A;){const w=h[b++],x=h[b++];try{C=w(C)}catch(O){x.call(this,O);break}}try{v=Ym.call(this,C)}catch(w){return Promise.reject(w)}for(b=0,A=p.length;b<A;)v=v.then(p[b++],p[b++]);return v}getUri(r){r=cl(this.defaults,r);const i=Nm(r.baseURL,r.url,r.allowAbsoluteUrls);return wm(i,r.params,r.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(r){fl.prototype[r]=function(i,o){return this.request(cl(o||{},{method:r,url:i,data:(o||{}).data}))}}),L.forEach(["post","put","patch"],function(r){function i(o){return function(f,d,h){return this.request(cl(h||{},{method:r,headers:o?{"Content-Type":"multipart/form-data"}:{},url:f,data:d}))}}fl.prototype[r]=i(),fl.prototype[r+"Form"]=i(!0)});let MA=class kv{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(f){i=f});const o=this;this.promise.then(s=>{if(!o._listeners)return;let f=o._listeners.length;for(;f-- >0;)o._listeners[f](s);o._listeners=null}),this.promise.then=s=>{let f;const d=new Promise(h=>{o.subscribe(h),f=h}).then(s);return d.cancel=function(){o.unsubscribe(f)},d},r(function(f,d,h){o.reason||(o.reason=new Zl(f,d,h),i(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const i=this._listeners.indexOf(r);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const r=new AbortController,i=o=>{r.abort(o)};return this.subscribe(i),r.signal.unsubscribe=()=>this.unsubscribe(i),r.signal}static source(){let r;return{token:new kv(function(s){r=s}),cancel:r}}};function NA(l){return function(i){return l.apply(null,i)}}function zA(l){return L.isObject(l)&&l.isAxiosError===!0}const rs={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rs).forEach(([l,r])=>{rs[r]=l});function Zm(l){const r=new fl(l),i=om(fl.prototype.request,r);return L.extend(i,fl.prototype,r,{allOwnKeys:!0}),L.extend(i,r,null,{allOwnKeys:!0}),i.create=function(s){return Zm(cl(l,s))},i}const qe=Zm(Xa);qe.Axios=fl,qe.CanceledError=Zl,qe.CancelToken=MA,qe.isCancel=Cm,qe.VERSION=Xm,qe.toFormData=Ri,qe.AxiosError=fe,qe.Cancel=qe.CanceledError,qe.all=function(r){return Promise.all(r)},qe.spread=NA,qe.isAxiosError=zA,qe.mergeConfig=cl,qe.AxiosHeaders=ht,qe.formToJSON=l=>Rm(L.isHTMLForm(l)?new FormData(l):l),qe.getAdapter=Gm.getAdapter,qe.HttpStatusCode=rs,qe.default=qe;const{Axios:xO,AxiosError:wO,CanceledError:AO,isCancel:TO,CancelToken:RO,VERSION:OO,all:CO,Cancel:_O,isAxiosError:DO,spread:MO,toFormData:NO,AxiosHeaders:zO,HttpStatusCode:UO,formToJSON:jO,getAdapter:LO,mergeConfig:HO}=qe;function UA({className:l,...r}){return z.jsx(jS,{role:"status","aria-label":"Loading",className:ct("size-4 animate-spin",l),...r})}function jA({productId:l,imageUrl:r}){const[i,o]=S.useState(),[s,f]=S.useState(),[d,h]=S.useState(!1),[g,p]=S.useState(!1),[v,b]=S.useState(!1),A=S.useRef(null),C=async O=>await cw(O,{cacheBust:!0,pixelRatio:1,skipFonts:!1}),w=async()=>{if(A.current){p(!0),b(!0),await kb(100);try{const O=await C(A.current);await qe.post("/cart/add.json",{items:[{id:l,quantity:1,properties:{Width:`${i}"`,Height:`${s}"`,Mirror:`${d}`,_Image:O}}]}),window.location.href="/cart"}catch(O){window.alert("Error while cropping or adding product to cart. Contact our manager."),console.error("Error while cropping or adding product to cart. Contact our manager."),console.error(O)}finally{p(!1),b(!1)}}},x=z.jsxs(su,{onClick:w,disabled:g,children:[g&&z.jsx(UA,{})," Add to cart"]});return z.jsx(z.Fragment,{children:z.jsx(px,{actionButton:x,heightValue:s,widthValue:i,onHeightChange:f,onWidthChange:o,onMirrorChange:h,mirror:d,children:z.jsxs("div",{className:"flex justify-center",children:[z.jsx("img",{className:"object-cover max-h-[70vh] border-2 border-dashed border-black",src:r,ref:A,style:{aspectRatio:`${i??"50"} / ${s??"50"}`,pointerEvents:"none",display:v?"block":"none"}}),z.jsx(gx,{mirror:d,width:i,height:s,imageUrl:r,generatingImg:v})]})})})}function LA(l,r){const i=typeof l=="string"?document.querySelector(l):l;Fv.createRoot(i).render(z.jsx(jA,{...r}))}return Po.mountConstructorWidget=LA,Object.defineProperty(Po,Symbol.toStringTag,{value:"Module"}),Po}({});
|