PageSourceSearch

https://shop.netgate.com/cdn/shopifycloud/checkout-web/assets/c1/DeferredPrivacy.BYCjQmBD.js

js netgate.com collected 2026-09-24 08:32:12 UTC 8,437 bytes, 1 lines download raw bytes

1import{T as re,q as m,o as E,j,u as n,e as x,n as z,S as L,f as te,h as ce}from"./esnext-vendor.D7ldIee_.js";import{_ as ie,l as se,L as I,c2 as G,b as le,n as F,k as M,cm as ue,cn as de,P as R,bt as ve,i as A,co as pe,cp as he,ca as ye}from"./hydrate.ByRIsqvd.js";import{N as T,bB as Q,ac as U,bF as J,cM as me,bx as fe}from"./addresses-is-address-empty.-MuOhIyI.js";import{C as D}from"./Checkbox.Cby2hWUV.js";import{S as ke}from"./Sheet.BMp0ktaT.js";import{C as N}from"./mobile-checkout-sdk-MobileCheckoutSdkClient.CVSnUTrf.js";import"./app.A60-IfPs.js";import"./constants.DowbVE6J.js";import"./hooks-useReplaceShopPayInHistory.Cz4PqGkk.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 K={id:"76113fc688fe950e2e09d64b5b10df17007abf25436339310e6aeb706bdf5e30",type:"query",name:"PrivacyBannerSettings",source:""},ge=Q(({graphql:{coreGraphql:e}},{privacyBannerSettingsSignal:a})=>{const o=e.query(K,{cache:!1}),r=E(()=>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}=J(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(I,{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 W=(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},W)};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},W)},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(M,{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(M,{children:[n(F,{level:3,children:e.introTitle}),n(R,{children:e.introText}),g]}),P=n(M,{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(M,{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===N.NO_VALUE&&a.marketing===N.NO_VALUE&&a.preferences===N.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=E(()=>a.currentUrl.value.searchParams.get("previewPrivacyBanner")==="true"),c=e.query(K,{cache:!1,skip:()=>!s.value&&!l.value||o}),t=E(()=>c.data.value?.privacyBannerSettings);return j(()=>{t.value&&(r.value=t.value)}),{error:c.error,hidden:E(()=>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}=J(_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:X,text:Z,policyLinkUrl:b,policyLinkText:O,buttonAcceptText:$,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:X||"",onHide:i,primaryAction:n(L,{children:[n(A,{onClick:()=>{Y({givenConsent:!0,token:q,consentManager:r}),e(h.Accept),u(B)},children:$}),n(A,{onClick:()=>{Y({givenConsent:!1,token:q,consentManager:r}),e(h.Decline),u(B)},children:ee})]}),secondaryActions:n(I,{textDecoration:"none",onClick:k,commandFor:w,"aria-haspopup":"dialog",children:ne}),children:n(R,{tone:"info",type:"small",children:[Z,n(I,{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.