PageSourceSearch

https://www.chiltons.com/cdn/shopifycloud/checkout-web/assets/c1/DeferredPrivacy.jSghrnMy.js

js chiltons.com collected 2026-09-29 02:43:08 UTC 8,422 bytes, 1 lines download raw bytes

1import{T as re,q as m,E as M,j,u as n,e as x,n as z,S as L,f as te,h as ce}from"./esnext-vendor.DDpcaSqU.js";import{$ as ie,l as se,L as N,cb as G,b as le,n as F,k as E,cx as ue,cy as de,P as R,bC as ve,i as A,cz as pe,cA as he,cl as ye}from"./hydrate.BcfGVx0L.js";import{T,aY as Q,af as U,bI as $,cv as me,bF as fe}from"./utilities-previous.Cnwy8G2v.js";import{C as D}from"./Checkbox.CdJzVizb.js";import{S as ke}from"./Sheet.CBSPD0rO.js";import{C as I}from"./app.DdDscdWN.js";import"./graphql-PaymentSessionMutation.C-nDEOnn.js";import"./shared-permissions.B59tuyWB.js";import"./hooks-useShopPayExternalAppContext.R6pnDxYu.js";const B="privacy-consent-banner",w="privacy_preferences_modal",H="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 V(){const{client:e,consentManager:a,userEvents:o,router:r,shop:s,source:l}=T(),c=r.currentUrl.value,{domain:t,storefrontDomains:v}=s,u=c.searchParams.get("previewPrivacyBanner")==="true",y=l.checkoutSessionIdentifier,d=re(()=>{const i=document.referrer;return v.some(p=>i.includes(p))},[v]),g=m(i=>{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:i,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 J={id:"76113fc688fe950e2e09d64b5b10df17007abf25436339310e6aeb706bdf5e30",type:"query",name:"PrivacyBannerSettings",source:""},ge=Q(({graphql:{coreGraphql:e}},{privacyBannerSettingsSignal:a})=>{const o=e.query(J,{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}=V(),{privacyBannerSettingsSignal:o}=U().context,{footer:{content:{typography:r}={}}={}}=ie(),s=m(()=>{a(h.ManagePreferences)},[a]),{settings:l,loading:c,error:t}=$(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:s,commandFor:w,"aria-haspopup":"dialog",children:v});return r?n(se,{size:r.size,color:r.color,type:r.weight==="bold"?"strong":void 0,children:u}):u}const K=(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},K)};function be(e){function a(){c(B),c(w)}const o=x(!1),r=x(!1),s=x(!1),l=x(!0),{hideOverlay:c}=G(),{emitPrivacyBannerInteractionEvent:t}=V(),{consentManager:v}=T(),u=async({analytics:i,marketing:p,preferences:k})=>{z(()=>{o.value=i,r.value=p,s.value=k}),await v.setTrackingConsent({analytics:i,marketing:p,preferences:k,storefrontAccessToken:e.consentTrackingApiToken},K)},y=m(()=>{t(h.LeavePreferences),l.value=!0},[t,l]),d=m(()=>{if(l.value){const{analytics:i,marketing:p,preferences:k}=v.currentVisitorConsent.value;z(()=>{o.value=i==="yes",r.value=p==="yes",s.value=k==="yes",l.value=!1})}},[o,v,l,r,s]),g=(()=>{const i=[e.bulletPoints?.firstText,e.bulletPoints?.secondText,e.bulletPoints?.thirdText].filter(p=>typeof p=="string");return e.bulletPoints?.enabled&&i.length>0?n(L,{children:[n(le,{blockSize:"base"}),n(F,{level:3,children:e?.bulletPoints?.title}),n(E,{gap:"base",padding:"small-300 none small-300 none",children:n(ue,{children:i.map((p,k)=>n(de,{children:n(R,{children:p})},k))})})]}):null})(),f=n(E,{children:[n(F,{level:3,children:e.introTitle}),n(R,{children:e.introText}),g]}),P=n(E,{gap:"base",children:[n(D,{checked:!0,disabled:!0,label:e.purposes.essentialName,details:e.purposes.essentialDesc}),n(D,{checked:s.value,onChange:i=>{s.value=i},label:e.purposes.preferencesName,details:e.purposes.preferencesDesc}),n(D,{checked:r.value,onChange:i=>{r.value=i},label:e.purposes.marketingName,details:e.purposes.marketingDesc}),n(D,{checked:o.value,onChange:i=>{o.value=i},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:s.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(E,{gap:"base",children:[f,P]})})}function Ce(){const{privacyBannerSettingsSignal:e}=U().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:s})=>{const l=M(()=>a.currentUrl.value.searchParams.get("previewPrivacyBanner")==="true"),c=e.query(J,{cache:!1,skip:()=>!s.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||(!s.value||!t.value?.showBannerOnCheckout)&&!l.value),loading:c.loading,settings:t}});function xe(){const{emitPrivacyBannerInteractionEvent:e,emitPrivacyBannerRenderEvent:a,emitPrivacyBannerInitializedEvent:o}=V();o();const{consentManager:r,embed:s,shop:l}=T(),{localPolicies:c}=me(),t=he(),v=Te(),{hideOverlay:u}=G(),{privacyBannerSettingsSignal:y}=U().context,{settings:d,loading:g,error:f,hidden:P}=$(_e,{isCheckoutEditor:t,privacyBannerSettingsSignal:y,showPrivacySheet:v}),i=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:W,text:X,policyLinkUrl:b,policyLinkText:O,buttonAcceptText:Z,buttonDeclineText:ee,buttonPrefsOpenText:ne}=d.value,q=d.value.consentTrackingApiToken||void 0,C=b.includes("/policies/"),_=C&&fe(s?.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:W||"",onHide:i,primaryAction:n(L,{children:[n(A,{onClick:()=>{Y({givenConsent:!0,token:q,consentManager:r}),e(h.Accept),u(B)},children:Z}),n(A,{onClick:()=>{Y({givenConsent:!1,token:q,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:[X,n(N,{href:C?void 0:b,target:C?void 0:"_blank",onClick:()=>{p(),_&&s?.client?.windowOpenRequest(b)},..._&&{"aria-haspopup":"dialog"},...C&&!_&&{commandFor:H},children:O})]})}),C&&!_&&n(ye,{heading:O,defaultPolicy:ae,id:H},S)]})}const Ue={PrivacyPreferencesFooterLink:Pe,PrivacyPreferences:Ce,PrivacySheet:xe};export{Ue 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.