PageSourceSearch

https://vograce.com/cdn/shopifycloud/checkout-web/assets/c1/extensions-rpc.BMPl-VrM.js

js vograce.com collected 2026-09-25 21:00:44 UTC 6,572 bytes, 3 lines download raw bytes

1import{bK as W,bL as O,g as $,B as C,bM as F,bN as I}from"./addresses-is-address-empty.Bn2lNY_L.js";import{S as P}from"./app.DbSrjjlA.js";import{a as R}from"./amazon-pay-useAmazonPayPaymentLine.Ju006AId.js";import{r as D}from"./esnext-vendor.B9Da21W6.js";import{e as g,s as B,a as z}from"./performance-index.mu6MOGR9.js";import{i as _,c as K}from"./hooks-useReplaceShopPayInHistory.DPpLejwu.js";class de extends Error{constructor(){super(...arguments),this.name="ExtensionUsageError"}}class N extends Error{constructor(){super(...arguments),this.name="ExtensionSandboxTruncatedScriptError"}}function V(e,t){if(e.startsWith(t))return e;const r=new URL("/cdn/shopifycloud/checkout-web/assets/c1/",import.meta.url).pathname.replace(/(c1|shop-pay-external)\/$/,"");return e.replace(r,t)}function H(e){const t=new Map;async function s(r,d){let a="",o=0;const f=B[d];g.markStarted(f,{type:"sandbox-fetch"});try{const{response:l,text:h}=await D(async()=>{const p=o>0?{cache:"reload"}:{},i=await fetch(r,p);if(!i.ok)throw new W(`Failed to fetch sandbox asset: ${i.status}`);const c=await i.text();if(a=c,!c.slice(-256).includes("SANDBOX_EOF"))throw o++,e.observability&&e.observability.leaveErrorBreadcrumb("truncated_sandbox_fetch",{scriptUrl:r.href,sandboxType:d,httpStatus:i.status,contentLengthHeader:i.headers.get("content-length"),scriptBodyLength:c.length,scriptEnd:c.slice(-50)},"error"),new N("Sandbox script does not have expected end of file marker, likely truncated");return e.observability&&o>0&&e.observability.log("successful_retry_truncated_sandbox_fetch","Successful retry of truncated sandbox fetch",{scriptUrl:r.href,sandboxType:d,truncatedSandboxCounter:o}),{response:i,text:c}},{maxAttempts:2,initialRetryDelay:.5});return g.markFinished(f,{type:"sandbox-fetch",transferredBundleSize:Number(l.headers.get("content-length")),bundleSize:h.length}),h}catch(l){if(l instanceof N&&a.length>0)return a;throw l}finally{t.delete(r)}}return function({url:d,sandboxType:n,name:a}){return[{type:"classic",name:a},(()=>{if(t.has(d)){const l=t.get(d);if(l)return l}const f=s(d,n);return t.set(d,f),f})()]}}function j({extension:e,appSandboxPermissions:t,observability:s}){const{capabilities:r,apiVersion:d,appId:n,type:a,extensionPoint:{target:o}}=e,f=!!n&&_(d)&&!G(r)&&!O(o),l={isShared:!1,appId:n,extensionType:a,hasSharedNetworkAccess:!1,hasSharedApiAccess:!1,cacheKey:()=>""};if(!f)return l;const h=a==="local",p=h||t.app(n).has("networkAccess",{extensionType:a}),i=h||t.app(n).has("apiAccess",{extensionType:a}),c=K(e),w=c&&!p,b=r.apiAccess&&!i;return!h&&(w||b)?(s.log("shared_sandbox_permissions_mismatch","Extension is ineligible for a shared sandbox because its permissions do not match the shared sandbox permissions",{appId:n,extensionType:a,target:o,hasSharedNetworkAccess:p,hasSharedApiAccess:i,extensionNetworkAccess:c,extensionApiAccess:r.apiAccess}),l):{isShared:!0,appId:n,extensionType:a,hasSharedNetworkAccess:p,hasSharedApiAccess:i,cacheKey:()=>`appId=${$(n)??n}:remote-dom:${a}:net=${p}:api=${i}`}}function G(e){const t=e.collectBuyerConsent;for(const s of Object.keys(t))switch(s){case"smsMarketing":case"customerPrivacy":if(t[s])return!0;break}return!1}const X="/cdn/shopifycloud/checkout-web/assets/c1/assets/load.D9UyAKTL.html",J="__run",Q="__terminate";class Y extends Error{constructor(t,s,r){super(t),this.name=s,this.stack=r}toString(){return`${this.name}: ${this.message}
2    ${this.stack}`}}function Z(){}function q(e,t,s){const{appName:r,appId:d,extensionId:n,extensionPoint:{target:a}}=e,o=r||`app-id-${$(d)??"unknown"}`,f=j({extension:e,appSandboxPermissions:s.appSandboxPermissions,observability:s.observability});return f.isShared?`checkout-ui-sandbox-shared-${f.cacheKey()}-${t}`:`checkout-ui-sandbox-${o}-${a}-${n}-${t}`}function le({extensionsPublicPath:e,isPostPurchase:t,observability:s,getPolyfills:r,appSandboxPermissions:d}){let n,a=!1;const o=new Set,f=H({observability:s}),l=V(X,e);let h="";return(p=Z,i,c)=>w=>{const b=new MessageChannel,E=new MessageChannel,{port1:S}=b,A=C();let y="checkout-2025-07";t?y="checkout-post-purchase":c?.apiVersion==="2023-04"?y="checkout-2023-04":c?.apiVersion&&_(c.apiVersion)&&(y="checkout");let M;c?M=q(c,A,{appSandboxPermissions:d,observability:s}):M=`post-purchase-extension-${A}`;const[T,U]=f({url:w,sandboxType:y,name:M}),k={id:A,url:w.href,channel:b,errorChannel:E,allowNetworkAccess:!!i.allowNetworkAccess,webWorkerOptions:T,sandboxScriptPromise:U,extension:c,sandboxType:y};if(n==null){const m=t?"post-purchase-iframe-load":"sandbox-iframe-load";o.add(k);const u=r?.();g.markStarted(m,{type:"iframe-loader",appId:c?.appId}),n=ee({iframeUrl:l,async onLoad(){g.markFinished(m,{type:"iframe-loader",appId:c?.appId});try{u&&(h=await u)}catch(x){return a=!0,o.clear(),p(x instanceof I?x:new I("Failed to load sandbox polyfills",{cause:x}))}a=!0;for(const x of o)v(x,n,p,h);o.clear()}}),R(n)}else a?v(k,n,p,h):o.add(k);return E.port1.addEventListener("message",m=>{const u=m.data,x=new Y(u.message,u.name,u.stack);p?.(x)}),{postMessage:(...m)=>{try{S.postMessage(...m)}catch(u){if(L(u))p(new F(u.message??"Unknown postMessage error",{cause:u}));else throw u}},addEventListener:(...m)=>S.addEventListener(...m),removeEventListener:(...m)=>S.removeEventListener(...m),terminate:()=>{o.delete(k),n&&te(k,n)}}}}function ee({iframeUrl:e,onLoad:t}){const s=document.createElement("iframe");return s.setAttribute("style","display:none;"),s.addEventListener("load",function r(){t(),s.removeEventListener("load",r)}),s.src=e,s.setAttribute("allow","local-network-access"),s}async function v({channel:e,errorChannel:t,id:s,url:r,allowNetworkAccess:d,sandboxScriptPromise:n,webWorkerOptions:a,extension:o,sandboxType:f},l,h,p=""){e.port1.start(),t.port1.start();const i=await n;if(!l.contentWindow)throw new se("iframe.contentWindow is not defined");const c=z[f];o&&c&&g.markStarted(c,{type:"extension",extension:o,instanceId:null});const w=p&&typeof i=="string"&&!i.startsWith("data:")?`${p};
3${i}`:i;try{l.contentWindow.postMessage({[J]:{id:s,url:r,allowNetworkAccess:d,sandboxScript:w,webWorkerOptions:a}},"*",[e.port2,t.port2])}catch(b){if(L(b))h(new F(b.message??"Unknown postMessage error",{cause:b}));else throw b}}function L(e){return e instanceof DOMException&&e.name==="DataCloneError"&&/out of memory/i.test(e.message)}
3function te({id:e,channel:t,errorChannel:s},r){t.port1.close(),s.port1.close(),r.contentWindow?.postMessage({[Q]:e},"*")}class se extends P{constructor(){super(...arguments),this.name="IframeContentWindowError",this.unactionable=!0}}export{de as E,j as a,le as c,V as r};

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.