PageSourceSearch

https://tugow.mx/cdn/shopifycloud/checkout-web/assets/c1/DeferredPrivacy.O-3Bn_r_.js

js tugow.mx collected 2026-09-28 05:43:45 UTC 8,445 bytes, 1 lines download raw bytes

1import{T as re,q as m,o as M,j,u as n,e as x,n as z,S as L,f as te,h as ce}from"./esnext-vendor.B9Da21W6.js";import{X as se,l as ie,L as N,c3 as G,b as le,m as H,k as D,cp as ue,cq as de,P as R,bu as ve,j as A,cr as pe,cs as he,cd as ye}from"./hydrate.DZ4YTm7p.js";import{S as T,aW as Q,af as q,bB as W,aY as I,cs as me,by as fe}from"./addresses-is-address-empty.Bn2lNY_L.js";import{C as E}from"./Checkbox.DQyvbr9E.js";import{S as ke}from"./Sheet.CvqBdJB1.js";import"./graphql-PaymentSessionMutation.CAXCwUvV.js";import"./app.DbSrjjlA.js";import"./hooks-useShopPayExternalAppContext.DWwMuRnz.js";import"./hooks-useReplaceShopPayInHistory.DPpLejwu.js";const B="privacy-consent-banner",w="privacy_preferences_modal",F="privacy-policy-modal";var h=(e=>(e.Accept="accept",e.Decline="decline",e.AcceptAll="accept_all",e.DeclineAll="decline_all",e.ManagePreferences="manage_preferences",e.Save="save",e.LeavePreferences="leave_preferences",e.PrivacyPolicyView="privacy_policy_view",e.CloseCheckoutBanner="close_checkout_banner",e))(h||{});function U(){const{client:e,consentManager:a,userEvents:o,router:r,shop:i,source:l}=T(),c=r.currentUrl.value,{domain:t,storefrontDomains:v}=i,u=c.searchParams.get("previewPrivacyBanner")==="true",y=l.checkoutSessionIdentifier,d=re(()=>{const s=document.referrer;return v.some(p=>s.includes(p))},[v]),g=m(s=>{u||o.monorailEvent({schemaId:"privacy_banner_interact/1.3",payload:{shopPermanentDomain:t,sessionToken:e.cookies.get("_shopify_y")||"0",regulation:"CMP",path:c.pathname,visitorRegion:a.getRegion.value,interactionType:s,checkoutSessionIdentifier:y,isStorefrontReferrer:d}})},[u,a,t,e.cookies,c.pathname,y,d,o]),f=m(()=>{u||o.monorailEvent({schemaId:"privacy_banner_render/1.2",payload:{shopPermanentDomain:t,sessionToken:e.cookies.get("_shopify_y")||"0",regulation:"CMP",path:c.pathname,checkoutSessionIdentifier:y,isStorefrontReferrer:d}})},[u,t,e.cookies,c.pathname,y,d,o]),P=m(()=>{u||o.monorailEvent({schemaId:"privacy_banner_initialized/1.1",payload:{shopPermanentDomain:t,sessionToken:e.cookies.get("_shopify_y")||"0",regulation:"CMP",path:c.pathname,checkoutSessionIdentifier:y,isStorefrontReferrer:d}})},[u,t,e.cookies,c.pathname,y,d,o]);return{emitPrivacyBannerInteractionEvent:g,emitPrivacyBannerRenderEvent:f,emitPrivacyBannerInitializedEvent:P}}const X={id:"76113fc688fe950e2e09d64b5b10df17007abf25436339310e6aeb706bdf5e30",type:"query",name:"PrivacyBannerSettings",source:""},ge=Q(({graphql:{coreGraphql:e}},{privacyBannerSettingsSignal:a})=>{const o=e.query(X,{cache:!1}),r=M(()=>o.data.value?.privacyBannerSettings);return j(()=>{r.value&&(a.value=r.value)}),{error:o.error,loading:o.loading,settings:r}});function Pe(){const{i18n:e}=T(),{emitPrivacyBannerInteractionEvent:a}=U(),{privacyBannerSettingsSignal:o}=q().context,{footer:{content:{typography:r}={}}={}}=se(),i=m(()=>{a(h.ManagePreferences)},[a]),{settings:l,loading:c,error:t}=W(ge,{privacyBannerSettingsSignal:o});if(c.value||!l.value?.enabled)return null;if(t.value)return console.error("Error fetching consent banner data",t.value),null;const v=e.translate("shop_policies.cookie_preferences"),u=n(N,{display:"block",onClick:i,commandFor:w,"aria-haspopup":"dialog",children:v});return r?n(ie,{size:r.size,color:r.color,type:r.weight==="bold"?"strong":void 0,children:u}):u}const J=(e,a)=>{a?console.debug(a):e?console.error("Set consent error: ",e):console.error("Set consent error: unknown")},Y=async({givenConsent:e,token:a,consentManager:o})=>{await o.setTrackingConsent({analytics:e,marketing:e,preferences:e,storefrontAccessToken:a},J)};function be(e){function a(){c(B),c(w)}const o=x(!1),r=x(!1),i=x(!1),l=x(!0),{hideOverlay:c}=G(),{emitPrivacyBannerInteractionEvent:t}=U(),{consentManager:v}=T(),u=async({analytics:s,marketing:p,preferences:k})=>{z(()=>{o.value=s,r.value=p,i.value=k}),await v.setTrackingConsent({analytics:s,marketing:p,preferences:k,storefrontAccessToken:e.consentTrackingApiToken},J)},y=m(()=>{t(h.LeavePreferences),l.value=!0},[t,l]),d=m(()=>{if(l.value){const{analytics:s,marketing:p,preferences:k}=v.currentVisitorConsent.value;z(()=>{o.value=s==="yes",r.value=p==="yes",i.value=k==="yes",l.value=!1})}},[o,v,l,r,i]),g=(()=>{const s=[e.bulletPoints?.firstText,e.bulletPoints?.secondText,e.bulletPoints?.thirdText].filter(p=>typeof p=="string");return e.bulletPoints?.enabled&&s.length>0?n(L,{children:[n(le,{blockSize:"base"}),n(H,{level:3,children:e?.bulletPoints?.title}),n(D,{gap:"base",padding:"small-300 none small-300 none",children:n(ue,{children:s.map((p,k)=>n(de,{children:n(R,{children:p})},k))})})]}):null})(),f=n(D,{children:[n(H,{level:3,children:e.introTitle}),n(R,{children:e.introText}),g]}),P=n(D,{gap:"base",children:[n(E,{checked:!0,disabled:!0,label:e.purposes.essentialName,details:e.purposes.essentialDesc}),n(E,{checked:i.value,onChange:s=>{i.value=s},label:e.purposes.preferencesName,details:e.purposes.preferencesDesc}),n(E,{checked:r.value,onChange:s=>{r.value=s},label:e.purposes.marketingName,details:e.purposes.marketingDesc}),n(E,{checked:o.value,onChange:s=>{o.value=s},label:e.purposes.performanceName,details:e.purposes.performanceDesc})]});return n(ve,{id:w,heading:e.title||"",primaryAction:n(A,{variant:"primary",onClick:()=>{u({analytics:o.value,marketing:r.value,preferences:i.value}),t(h.Save),a()},children:e.buttonSaveText}),secondaryActions:n(L,{children:[n(A,{onClick:()=>{u({analytics:!0,marketing:!0,preferences:!0}),t(h.AcceptAll),a()},children:e.buttonAcceptText}),n(A,{onClick:()=>{u({analytics:!1,marketing:!1,preferences:!1}),t(h.DeclineAll),a()},children:e.buttonDeclineText})]}),size:"large",onHide:y,onShow:d,children:n(D,{gap:"base",children:[f,P]})})}function Ce(){const{privacyBannerSettingsSignal:e}=q().context,a=e.value;return a?.enabled?n(be,{...a.preferences,consentTrackingApiToken:a.consentTrackingApiToken||void 0}):null}function Ae(e){const a=e.currentVisitorConsent.value;return a.analytics===I.NO_VALUE&&a.marketing===I.NO_VALUE&&a.preferences===I.NO_VALUE}function Te(){const{consentManager:e}=T(),a=pe();return te(()=>a.value?Ae(e):!1)}const _e=Q(({graphql:{coreGraphql:e},router:a},{isCheckoutEditor:o,privacyBannerSettingsSignal:r,showPrivacySheet:i})=>{const l=M(()=>a.currentUrl.value.searchParams.get("previewPrivacyBanner")==="true"),c=e.query(X,{cache:!1,skip:()=>!i.value&&!l.value||o}),t=M(()=>c.data.value?.privacyBannerSettings);return j(()=>{t.value&&(r.value=t.value)}),{error:c.error,hidden:M(()=>c.loading.value||o||(!i.value||!t.value?.showBannerOnCheckout)&&!l.value),loading:c.loading,settings:t}});function xe(){const{emitPrivacyBannerInteractionEvent:e,emitPrivacyBannerRenderEvent:a,emitPrivacyBannerInitializedEvent:o}=U();o();const{consentManager:r,embed:i,shop:l}=T(),{localPolicies:c}=me(),t=he(),v=Te(),{hideOverlay:u}=G(),{privacyBannerSettingsSignal:y}=q().context,{settings:d,loading:g,error:f,hidden:P}=W(_e,{isCheckoutEditor:t,privacyBannerSettingsSignal:y,showPrivacySheet:v}),s=m(()=>{e(h.CloseCheckoutBanner)},[e]),p=m(()=>{e(h.PrivacyPolicyView)},[e]),k=m(()=>{e(h.ManagePreferences)},[e]);if(ce(()=>{g.value||!v.value||f.value||!d.value?.showBannerOnCheckout||a()},[a,g.value,v.value,f.value,d.value]),P.value)return null;if(f.value||!d.value)return console.error("Error fetching consent banner data",f.value),null;const{title:K,text:Z,policyLinkUrl:b,policyLinkText:O,buttonAcceptText:$,buttonDeclineText:ee,buttonPrefsOpenText:ne}=d.value,V=d.value.consentTrackingApiToken||void 0,C=b.includes("/policies/"),_=C&&fe(i?.embedder),S=b.split("/").pop()||"privacy-policy",ae=c.find(oe=>oe.handle===S)??{shopName:l.name,shopId:l.id,handle:S,url:b,squareLogo:l.brandSettings?.squareLogo,name:O};return n(L,{children:[n(ke,{defaultOpen:!0,id:B,heading:K||"",onHide:s,primaryAction:n(L,{children:[n(A,{onClick:()=>{Y({givenConsent:!0,token:V,consentManager:r}),e(h.Accept),u(B)},children:$}),n(A,{onClick:()=>{Y({givenConsent:!1,token:V,consentManager:r}),e(h.Decline),u(B)},children:ee})]}),secondaryActions:n(N,{textDecoration:"none",onClick:k,commandFor:w,"aria-haspopup":"dialog",children:ne}),children:n(R,{tone:"info",type:"small",children:[Z,n(N,{href:C?void 0:b,target:C?void 0:"_blank",onClick:()=>{p(),_&&i?.client?.windowOpenRequest(b)},..._&&{"aria-haspopup":"dialog"},...C&&!_&&{commandFor:F},children:O})]})}),C&&!_&&n(ye,{heading:O,defaultPolicy:ae,id:F},S)]})}const qe={PrivacyPreferencesFooterLink:Pe,PrivacyPreferences:Ce,PrivacySheet:xe};export{qe as deferredPrivacyComponents};

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.