import{a as h,gZ as g,as as S,sf as m,aC as C,b as f,nk as y,bO as v,mr as P,ei as k,g_ as b,g$ as B,od as z,ht as L,q as M}from"./app.owqgWGYv.js";const V=o=>h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"inherit","aria-hidden":"true",preserveAspectRatio:"xMidYMid",viewBox:"0 0 341 80.035",...o,children:[h("path",{fillRule:"evenodd",d:"M227.297 0c-6.849 0-12.401 5.472-12.401 12.223v55.59c0 6.75 5.552 12.222 12.401 12.222h101.06c6.849 0 12.401-5.472 12.401-12.222v-55.59c0-6.75-5.552-12.223-12.401-12.223zm17.702 55.892v-14.09h8.994c8.217 0 12.586-4.542 12.586-11.423s-4.369-11-12.586-11h-14.788v36.513zm0-31.084h7.664c5.319 0 7.932 2.154 7.932 5.758s-2.518 5.758-7.695 5.758h-7.901zm31.796 31.833c4.417 0 7.314-1.92 8.644-5.196.38 3.65 2.613 5.523 7.457 4.26l.048-3.886c-1.948.187-2.328-.515-2.328-2.528v-9.55c0-5.617-3.752-8.94-10.686-8.94-6.84 0-10.782 3.37-10.782 9.08h5.32c0-2.714 1.947-4.353 5.367-4.353 3.609 0 5.272 1.545 5.224 4.214v1.217l-6.127.655c-6.887.749-10.686 3.324-10.686 7.818 0 3.698 2.659 7.209 8.549 7.209m1.187-4.213c-2.992 0-4.179-1.592-4.179-3.184 0-2.153 2.47-3.136 7.314-3.698l3.8-.421c-.238 4.12-3.04 7.303-6.935 7.303m32.555 5.29c-2.422 5.804-6.317 7.536-12.396 7.536h-2.613V60.48h2.803c3.324 0 4.939-1.03 6.697-3.979l-10.782-24.95h5.984l7.695 18.21 6.839-18.21h5.842z",clipRule:"evenodd"}),h("path",{d:"M29.514 35.18c-7.934-1.697-11.469-2.36-11.469-5.374 0-2.834 2.392-4.246 7.176-4.246 4.207 0 7.283 1.813 9.546 5.363a.623.623 0 0 0 .812.222l8.927-4.447a.616.616 0 0 0 .256-.864c-3.705-6.332-10.55-9.798-19.562-9.798-11.843 0-19.2 5.752-19.2 14.898 0 9.714 8.96 12.169 16.904 13.865 7.944 1.697 11.49 2.36 11.49 5.374s-2.584 4.435-7.742 4.435c-4.763 0-8.297-2.15-10.433-6.321a.63.63 0 0 0-.843-.274L6.47 52.364a.623.623 0 0 0-.278.843c3.535 7.006 10.785 10.947 20.47 10.947 12.334 0 19.787-5.658 19.787-15.088s-9.001-12.169-16.935-13.865zm47.839-19.144c-5.062 0-9.536 1.77-12.75 4.92-.203.19-.534.053-.534-.221V.622a.62.62 0 0 0-.63-.622h-11.17a.62.62 0 0 0-.63.622v62.426a.62.62 0 0 0 .63.621h11.17a.62.62 0 0 0 .63-.621V35.664c0-5.289 4.11-9.345 9.653-9.345 5.542 0 9.557 3.972 9.557 9.345v27.384a.62.62 0 0 0 .63.621h11.17a.62.62 0 0 0 .63-.621V35.664c0-11.505-7.646-19.618-18.356-19.618zm41.036-1.781c-6.065 0-11.767 1.823-15.847 4.467a.62.62 0 0 0-.202.833l4.922 8.292c.182.295.566.4.865.22a19.8 19.8 0 0 1 10.262-2.78c9.749 0 16.914 6.785 16.914 15.75 0 7.64-5.734 13.297-13.006 13.297-5.926 0-10.037-3.403-10.037-8.207 0-2.75 1.185-5.005 4.271-6.596a.607.607 0 0 0 .246-.864l-4.645-7.754a.63.63 0 0 0-.759-.264c-6.225 2.276-10.593 7.755-10.593 15.109 0 11.126 8.981 19.428 21.507 19.428 14.629 0 25.147-9.998 25.147-24.338 0-15.372-12.237-26.603-29.066-26.603zm61.709 1.697c-5.649 0-10.689 2.054-14.373 5.678a.313.313 0 0 1-.534-.22v-4.363a.62.62 0 0 0-.63-.621H153.68a.62.62 0 0 0-.63.621v62.331a.62.62 0 0 0 .63.622h11.169a.62.62 0 0 0 .631-.622v-20.44c0-.274.331-.41.533-.231 3.674 3.371 8.532 5.342 14.096 5.342 13.102 0 23.321-10.463 23.321-24.054 0-13.592-10.23-24.054-23.321-24.054zm-2.103 37.54c-7.454 0-13.103-5.848-13.103-13.582 0-7.733 5.638-13.58 13.103-13.58s13.091 5.752 13.091 13.58-5.553 13.581-13.102 13.581z"})]});function _({color:o="white",inline:n,size:s="medium",className:a}){const t=o==="branded"?g.toRgb():o;return h(V,{className:S(m.ShopPayLogo,m[s],{[m.inline]:n},a),style:{fill:t}})}const w=o=>({backgroundColor:n,foregroundColor:s})=>{const a=p(n),t=p(s),c=Math.max(a,t),e=Math.min(a,t),r=(c+.05)/(e+.05);return{isValidContrast:r>=o,ratio:Math.round(r*100)/100}},E=w(3.06);function p(o){const s=o.toRgbTuple().map(a=>{const t=a/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return .2126*s[0]+.7152*s[1]+.0722*s[2]}const u=new y(0,0,100);function R({foregroundColor:o,backgroundColor:n,section:s="main"}){const a=C(),{colors:t}=f(),c=a[s];let e=u;if(n!==void 0)e=n;else if(c.colorScheme==="inherit"){const{background:i,colorScheme:d}=a.canvas;d&&i!=="transparent"&&(e=t.schemes?.[d]?.base?.background??u)}else{const i=c.colorScheme;e=i?t.schemes?.[i]?.base?.background??u:u}const{isValidContrast:r}=v(()=>E({backgroundColor:e,foregroundColor:o}),[e,o]);return r}const x="_0mzUL",l={Button:x,"Button--dark":"_6W0f3","Button--contrast":"aFsKX","Button--progressing":"XVUQD"};function T({progressing:o=!1}={}){const n=R({foregroundColor:g}),s=k(),a=b(),t=B(a,s);return v(()=>S(l.Button,{[l["Button--contrast"]]:!n&&!t,[l["Button--dark"]]:t,[l["Button--progressing"]]:o}),[t,n,o])}function H(){const{shopPayParts:o}=P();return T({progressing:o.internalProgressing.value})}function N(){const o=z(),{editorSetShopPaySignal:n}=L(),s=n.value,a=M(t=>s?.setShopPay(t),[s]);return{setEditorShopPay:o&&s?a:void 0}}export{_ as S,N as a,H as b,T as c,R as u};