import{d as e,f as t,n,r,t as i,u as a}from"./bridgePayload-AU-EBFyj.js";function o(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function s(){let e=window.rawData;return!o(e)||!t(e)?null:i(e)}function c(t){let r=e(t),i=n(t);return console.log(`[xyxp-pdd-sku] rawData bridge post`,{href:location.href,skuRowCount:r.length,posted:i}),r.length>0&&a(t,`pdd-main-world:bridge`),i}function l(){let e=s();return e?c(e):!1}function u(){let e=!1,t=0;window.addEventListener(`message`,t=>{if(t.source!==window)return;let n=t.data;if(r(n)){if(n.type===`PDD_RAW_DATA_ACK`){e=!0;return}n.type===`PDD_RAW_DATA_REQUEST`&&l()}});let n=()=>e?!0:l(),i=window.setInterval(()=>{if(t+=1,e){clearInterval(i);return}n(),t>=40&&clearInterval(i)},500);n(),window.addEventListener(`DOMContentLoaded`,n,{once:!0}),window.addEventListener(`load`,n,{once:!0})}u(),console.log(`[xyxp-pdd] MAIN world bridge booted`,location.href);