PageSourceSearch

https://www.takedownproducts.com/cdn/shopifycloud/checkout-web/assets/c1/EditorBridge.CJpkJutC.js

js takedownproducts.com collected 2026-09-26 03:34:04 UTC 4,629 bytes, 1 lines download raw bytes

1import{S as E,bo as k,bp as R}from"./addresses-is-address-empty.Bn2lNY_L.js";import{a2 as M,a3 as A}from"./hydrate.DZ4YTm7p.js";import{h as x}from"./esnext-vendor.B9Da21W6.js";import"./app.DbSrjjlA.js";import"./graphql-PaymentSessionMutation.CAXCwUvV.js";import"./hooks-useShopPayExternalAppContext.DWwMuRnz.js";import"./hooks-useReplaceShopPayInHistory.DPpLejwu.js";let y=class extends Error{constructor(){super(...arguments),this.name="EditorBridgeError"}};const T="editor_domain";function H(){if(window.Shopify==null)throw new y("Shopify object is missing");const{shop:t,editorDomain:o}=window.Shopify;if(o==null&&t==null){const c=new URLSearchParams(window.location.search).get(T);if(c==null)throw new y("Could not find Editor Domain on URL");return c}return o||t}function L(){return`https://${H()}`}const O={error:!1},P={error:!0};function D(t,o){x(()=>{const c=B(t,o);return()=>c()},[o,t])}function B(t,o){const c=async i=>{if(i.origin===L()&&i.data.type===t){const g=i.data.payload;let n;try{const s=await o(g);n=s?{...s,error:!1}:O}catch(s){const d=s instanceof Error?s.message:"";n={...P,errorMessage:d}}window.parent.postMessage({id:i.data.id,type:i.data.type,payload:n},i.origin)}};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)}const C={id:"1ddc80dd1747cfb53029784271e481f3361746816882735d1284cb4b37994106",type:"query",name:"Fonts",source:""},F="rgba(0,0,0,0)",l={small:40,medium:60,large:80};class f extends Error{constructor(){super(...arguments),this.name="EditorBridgeError"}}function j(){const t=M(),o=A(),{graphql:{coreGraphql:c}}=E(),i=e=>{t.preview(e)},g=(e,r)=>{t.set(e,{...t.configuration[e],...r})},n=(e,r)=>{o.set(e,{...o.configuration[e],...r})},s=async e=>{const{data:r,error:a}=await c.staticQuery(C,{cache:!1});if(a)throw a;if(!r?.shop)throw new f("Fonts query failed");g(e==="primary"?"typographyPrimary":"typographySecondary",R(r.shop.designSystem?.typography?.[e]??{}))},d=e=>e?.image.originalSrc,b=e=>{const r=new Image,a=new Promise(h=>{r.onload=()=>{h({width:r.width,height:r.height})}});return r.src=e,a},u=e=>e&&e!==F?k(e):void 0;function p(e){n("header",{position:W(o)[e],alignment:U(o)[e]}),n("buyerJourney",{alignment:I(o)[e]})}return D("StorefrontMessage::BroadcastSettingUpdate",({settingId:e,settingValue:r})=>{if(e.startsWith("checkout_"))switch(e){case"checkout_header_image":{const a=o.configuration.header.alignment==="center"&&o.configuration.header.position!=="inlineSecondary",h=o.configuration.header.alignment==="start",m=a?"center":h?"left":"right";return n("header",{banner:{...o.configuration.header.banner,image:d(r)}}),p(m)}case"checkout_logo_image":{const{logo:a}=o.configuration.header,h=a?.maxWidth&&a?.aspectRatio?Math.round(a.maxWidth/a.aspectRatio/10)*10:l.medium;if(!r){n("header",{logo:{...o.configuration.header.logo,image:void 0,maxWidth:h,aspectRatio:1}});return}b(d(r)).then(({width:m,height:w})=>{const _=m/w,S=h*_;n("header",{logo:{...a,image:d(r),maxWidth:S,aspectRatio:_}})}).catch(()=>{throw new f(`${e} is not handled!`)});return}case"checkout_logo_position":return n("header",{colorScheme:r==="start"?"scheme1":void 0}),p(r);case"checkout_logo_size":if(o.configuration.header.logo?.aspectRatio){const a=l[r]*o.configuration.header.logo.aspectRatio;n("header",{logo:{...o.configuration.header.logo,maxWidth:a}})}else n("header",{logo:{...o.configuration.header.logo,maxWidth:l[r],aspectRatio:1}});return;case"checkout_body_background_color":return i({schemes:{scheme1:{base:{background:u(r)}}}});case"checkout_body_background_image":return n("main",{backgroundImage:d(r)});case"checkout_input_background_color_mode":return;case"checkout_sidebar_background_image":return n("orderSummary",{backgroundImage:d(r)});case"checkout_sidebar_background_color":return i({schemes:{scheme2:{base:{background:u(r)}}}});case"checkout_heading_font":return s("secondary");case"checkout_body_font":return s("primary");case"checkout_accent_color":return i({global:{accent:u(r)}});case"checkout_button_color":return i({global:{brand:u(r)}});case"checkout_error_color":return i({global:{critical:u(r)}});default:throw new f(`${e} is not handled!`)}}),null}function U(t){return t.configuration.header?.banner?.image?{left:"start",center:"center",right:"end"}:{left:"start",center:"center",right:"center"}}function W(t){return t.configuration.header?.banner?.image?{left:"start",center:"start",right:"start"}
1:{left:"inline",center:"inline",right:"inlineSecondary"}}function I(t){return t.configuration.header?.banner?.image?{left:"start",center:"start",right:"start"}:{left:"start",center:"center",right:"start"}}export{j as default};

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.