import{at as C,au as E,av as T,aw as x,ax as A,ay as M,az as L,aA as y,aB as v,aC as R,aD as k,aE as U,aF as w,aG as S,aH as Y,aI as z,u as f}from"./vendor.CynPCimz.js";import{b as F,aG as g,L as O,T as H}from"./app.BXvw8ij6.js";function $(a,e){const r=new Map;function s(c){for(const t of c){const[i,n]=t;switch(i){case E:{const o=t[2],l=t[3];p(n,o,l);break}case T:{const o=t[2];I(n,o);break}}}a.mutate(c)}function p(c,t,i){if(r.has(c)||r.set(c,[]),r.get(c).splice(i,0,{id:t.id,slot:"attributes"in t?t.attributes?.slot:void 0}),"children"in t&&t.children)for(const[o,l]of t.children.entries())p(t.id,l,o)}function I(c,t){const i=r.get(c);if(!i?.[t])return;const n=i[t].id;i.splice(t,1),h(n)}function h(c){const t=r.get(c);if(t){for(const i of t)h(i.id);r.delete(c)}}return function(t,...i){switch(t){case v:{const[n]=i,o=n.map((l,d)=>[E,y,N(l,e),d]);s(o);break}case L:{const[n=y,o,l]=i,d=[],_=r.get(n);if(_){const u=_.findIndex(({id:m})=>m===l.id);u>=0&&d.push([T,n,u])}d.push([E,n,N(l,e),o]),s(d);break}case M:{const[n,o]=i;s([[T,n??y,o]]);break}case A:{const[n,o]=i;s([[Y,n,o]]);break}case C:{const[n,o]=i,l=r.get(n),d=[];for(const[_,u]of Object.entries(o)){const m=l?.findIndex(({slot:b})=>b===_)??-1;D(u)?(m>=0&&d.push([T,n,m]),d.push([E,n,P(_,u,e),r.get(n)?.length??0])):m>=0?d.push([T,n,m]):d.push([x,n,_,u])}s(d);break}default:throw new Error(`Unsupported action type: ${t}`)}}}function N(a,e){switch(a.kind){case S:return j(a);case w:return X(a,e);default:return{id:a.id,type:U,data:"added by remote-ui legacy adaptor to replace a fragment rendered as a child"}}}function j({id:a,text:e}){return{id:a,type:z,data:e}}function X({id:a,type:e,props:r,children:s},p){const I=p?.elements?.[e]??e,[h,c]=G(r);return{id:a,type:k,element:I,properties:c,children:[...s.map(t=>N(t,p)),...K(h,p)]}}function G(a){const e={},r={};for(const[s,p]of Object.entries(a))D(p)?e[s]=p:r[s]=p;return[e,r]}function D(a){return a!=null&&typeof a=="object"&&"kind"in a&&a.kind===R}function K(a,e){return Object.entries(a).map(([r,s])=>P(r,s,e))}function P(a,e,r){return{id:e.id,element:r?.slotProps?.wrapper??"remote-fragment",attributes:{slot:a},type:k,children:e.children.map(s=>N(s,r))}}function q({textProps:a}){const{i18n:e,shop:{name:r}}=F(),s={markets_pro_terms:f(O,{textDecoration:"none",overlay:f(g,{source:"https://content.global-e.com/shopper-terms",heading:e.translate("payment.markets_pro_disclaimer_terms_and_conditions_title")}),children:e.translate("payment.markets_pro_disclaimer_terms_and_conditions")}),privacy_policy:f(O,{textDecoration:"none",overlay:f(g,{source:"https://content.global-e.com/privacy-policy",heading:e.translate("payment.markets_pro_disclaimer_privacy_policy_title")}),children:e.translate("payment.markets_pro_disclaimer_privacy_policy")}),shop_name:r};return f(H,{...a,children:e.translate("payment.markets_pro_disclaimer_label",s)})}export{q as M,$ as a};
