PageSourceSearch

https://ourlatincity.com/assets/ProductCard-CuaL6Vk3.js

js ourlatincity.com collected 2026-10-07 07:09:14 UTC 11,892 bytes, 1 lines download raw bytes

vendor: 4,863 bytes, line 1
1import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{D as t,a as n,d as r,i,r as a,vt as o,x as s}from"./shopify-DxAddMUW.js";import{a as c,z as l}from"./SiteFooter-BV4ifUwQ.js";import{C as u,D as d,E as f,O as p,S as m,T as h,_ as g,b as _,c as v,i as y,l as b,m as x,n as S,u as C,x as w,y as T}from"./QueryClientProvider-CJjUbx4J.js";import{c as E,l as D,o as O,r as k,s as A}from"./regions-BqCClyGr.js";var j=class extends p{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=b(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),N(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return P(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return P(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!m(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&F(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||w(this.options.staleTime,this.#t)!==w(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return L(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(g)),t}#g(){this.#b();let e=w(this.options.staleTime,this.#t);if(C.isServer()||this.#r.isStale||!x(e))return;let t=h(this.#r.dataUpdatedAt,e)+1;this.#d=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(C.isServer()||_(this.options.enabled,this.#t)===!1||!x(this.#p)||this.#p===0)&&(this.#f=f.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(f.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(f.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&N(e,t),o=i&&F(e,n,t,r);(a||o)&&(l={...l,...y(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=T(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=T(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,v=m===`pending`,x=m===`error`,S=v&&g,C=d!==void 0,w={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:x,isInitialLoading:S,isLoading:S,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdate
1Count:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:x&&!C,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:x&&C,isStale:I(e,t),refetch:this.refetch,promise:this.#o,isEnabled:_(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=w.data!==void 0,r=w.status===`error`&&!t,i=e=>{r?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{let e=this.#o=w.promise=b();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||w.data!==o.value)&&a();break;case`rejected`:(!r||w.error!==o.reason)&&a();break}}return w}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!m(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){v.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function M(e,t){return _(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||_(t.retryOnMount,e)!==!1)}function N(e,t){return M(e,t)||e.state.data!==void 0&&P(e,t,t.refetchOnMount)}function P(e,t,n){if(_(t.enabled,e)!==!1&&w(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&I(e,t)}return!1}function F(e,t,n,r){return(e!==t||_(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&I(e,n)}function I(e,t){return _(t.enabled,e)!==!1&&e.isStaleByTime(w(t.staleTime,e))}function L(e,t){return!m(e.getCurrentResult(),t)}var R=t(),z=e(o(),1),B=z.createContext(!1),V=()=>z.useContext(B);B.Provider;function H(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var U=z.createContext(H()),W=()=>z.useContext(U),G=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?u(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},K=e=>{z.useEffect(()=>{e.clearReset()},[e])},q=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||u(n,[e.error,r])),J=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Y=(e,t)=>e.isLoading&&e.isFetching&&!t,X=(e,t)=>e?.suspense&&t.isPending,Z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Q(e,t,n){let r=V(),i=W(),a=S(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,J(o),G(o,i,s),K(i);let l=!a.getQueryCache().get(o.queryHash),[u]=z.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(z.useSyncExternalStore(z.useCallback(e=>{let t=f?u.subscribe(v.batchCalls(e)):g;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),z.useEffect(()=>{u.setOptions(o)},[o,u]),X(o,d))throw Z(o,u,i);if(q({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!C.isServer()&&Y(d,r)&&(l?Z(o,u,i):s?.promise)?.catch(g).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function $(e,t){return Q(e,j,t)}function ee({product:e,badge:t,badgeTone:o=`cobalt`}){let u=c(e=>e.addItem),[d,f]=(0,z.useState)(!1),p=e.node,m=p.variants.edges.find(e=>e.node.availableForSale)?.node,h=p.images.edges[0]?.node,g=p.priceRange.minVariantPrice,_=i(e),v=_?n(g.amount,_.amount):0,y=k(e)!==`apparel`,b=A(e)?E(e):[],x=p.variants.edges.length>1;return(0,R.jsxs)(`article`,{className:`group flex flex-col`,children:[(0,R.jsxs)(s,{to:`/product/$handle`,params:{handle:p.handle},className:`relative block aspect-[4/5] overflow-hidden rounded-2xl bg-card shadow-warm-lg transition-all duration-[250ms] ease-out group-hover:-translate-y-1 group-hover:shadow-warm-xl`,children:[(0,R.jsxs)(`span`,{className:`absolute top-3 left-3 z-10 flex flex-col items-start gap-2`,children:[v>0?(0,R.jsxs)(`span`,{className:`rounded-full bg-pink px-2.5 py-1 text-[12px] font-bold tracking-widest text-cream uppercase`,children:[`Save `,v,`%`]}):null,t?(0,R.jsx)(`span`,{className:`rounded-full px-2.5 py-1 text-[12px] font-bold tracking-widest text-cream uppercase ${o===`terracotta`?`bg-terracotta`:`bg-cobalt`}`,children:t}):null]}),h?(0,R.jsx)(`img`,{src:h.url,alt:h.altText??p.title,loading:`lazy`,className:`h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.04]`}):(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center bg-ink p-6 text-center`,children:(0,R.jsx)(`p`,{className:`font-display text-3xl leading-none text-cta uppercase`,children:p.title})})]}),(0,R.jsxs)(`div`,{className:`flex flex-1 flex-col pt-4`,children:[(0,R.jsx)(s,{to:`/product/$handle`,params:{handle:p.handle},children:(0,R.jsx)(`h3`,{className:`text-[20px] leading-snug font-semibold text-charcoal group-hover:text-cta`,children:p.title})}),b.length?(0,R.jsx)(`p`,{className:`mt-2 flex flex-wrap gap-1.5`,children:b.map(e=>(0,R.jsx)(D,{code:O(e),name:e,className:`h-4 w-6`},e))}):null,(0,R.jsxs)(`p`,{className:`mt-2 flex items-baseline gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[20px] font-bold text-charcoal`,children:a(g.amount,g.currencyCode)}),_?(0,R.jsx)(`span`,{className:`text-[15px] text-muted-foreground line-through`,children:a(_.amount,_.currencyCode)}):null]}),y?(0,R.jsx)(`p`,{className:`mt-1 text-[13px] font-semibold text-cactus`,children:`Instant digital delivery`}):null,x?(0,R.jsx)(s,{to:`/product/$handle`,params:{handle:p.handle},className:`btn-cta mt-4 w-full text-center ${m?``:`pointer-events-none opacity-50`}`,children:m?`Choose your size`:`Sold out`}):(0,R.jsx)(`button`,{onClick:async()=>{m&&(f(!0),await u({product:e,variantId:m.id,variantTitle:m.title,price:m.price,quantity:1,selectedOptions:m.selectedOptions??[]}),f(!1),r.success(`${p.title} added to your bag`,{position:`top-center`}))},disabled:d||!m,className:`btn-cta mt-4 w-full disabled:opacity-50`,children:d?(0,R.jsx)(l,{className:`mx-auto h-4 w-4 animate-spin`}):m?`Add to cart`:`Sold out`})]})]})}export{$ as n,ee as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.