JezK
Edit File: express-checkout-previews.js.map
{"version":3,"file":"chunks/express-checkout-previews.js?ver=7468f92111182c4c7ff4","mappings":"2NAeA,MAAMA,EAAgBA,KACrBC,EAAAA,EAAAA,MAAA,OACCC,MAAM,MACNC,OAAO,KACPC,QAAQ,YACRC,KAAK,OACLC,MAAM,6BACN,cAAaC,EAAAA,EAAAA,IAAI,kBAAmB,wBAA0BC,SAAA,EAE9DC,EAAAA,EAAAA,KAAA,QACCC,SAAS,UACTC,SAAS,UACTC,EAAE,4MAIFP,KAAK,aAENI,EAAAA,EAAAA,KAAA,QACCC,SAAS,UACTC,SAAS,UACTC,EAAE,gMAIFP,KAAK,aAENI,EAAAA,EAAAA,KAAA,QACCC,SAAS,UACTC,SAAS,UACTC,EAAE,mqIAoEFP,KAAK,eAqDR,EAhDyBQ,EAAIC,uBAAwB,IAAAC,EACpD,MAAMC,GAAgBC,EAAAA,EAAAA,UACrB,KAAMC,EAAAA,EAAAA,MACN,IAGKC,GAAeF,EAAAA,EAAAA,UAAS,KACVG,EAAAA,EAAAA,GAClBN,GAEiBO,UAAUF,cAC1B,CAAEL,IAECQ,EAAeC,KAAKC,IACzBD,KAAKE,IAA6B,QAA1BV,EAAED,GAAkBX,cAAM,IAAAY,EAAAA,EAAIC,EAAcM,aAAc,IAClE,IAGKI,GAAcT,EAAAA,EAAAA,UACnB,KAAM,CACLd,OAAQ,GAAImB,MACZH,eACAjB,MAAO,OACPyB,gBAAiB,UACjBC,OAAQ,OACRC,OAAQ,UACRC,QAAS,OACTC,WAAY,SACZC,eAAgB,YAEjB,CAAEV,EAAcH,IAGjB,OACCV,EAAAA,EAAAA,KAAA,OAAAD,UACCC,EAAAA,EAAAA,KAAA,UACCwB,KAAK,SACLC,GAAG,4CACHC,UAAU,kCACVC,MAAQV,EACR,cAAanB,EAAAA,EAAAA,IAAI,aAAc,wBAA0BC,UAEzDC,EAAAA,EAAAA,KAACT,EAAa,OAEV,C,qGCpJR,MAmDA,EAnDwBqC,EAAIvB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ks/components/amazon-pay-preview.js","webpack://woocommerce-payments/./client/express-checkout/blocks/components/apple-pay-preview.js","webpack://woocommerce-payments/./client/express-checkout/blocks/components/google-pay-preview.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { useMemo } from 'react';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetExpressCheckoutButtonAppearance,\n\tgetExpressCheckoutButtonStyleSettings,\n} from '../../utils';\n\n// Amazon Pay logo SVG without background (extracted from amazon-pay.svg)\nconst AmazonPayLogo = () => (\n\t<svg\n\t\twidth=\"102\"\n\t\theight=\"32\"\n\t\tviewBox=\"4 8 56 24\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\taria-label={ __( 'Amazon Pay logo', 'woocommerce-payments' ) }\n\t>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M26.519 24.803c-1.922 1.419-4.708 2.173-7.107 2.173-3.362\n\t\t\t0-6.39-1.243-8.681-3.312-.18-.163-.02-.384.197-.259 2.472 1.439\n\t\t\t5.529 2.305 8.686 2.305 2.13 0 4.471-.442 6.626-1.356.325-.137\n\t\t\t.597.214.279.45Z\"\n\t\t\tfill=\"#F79C34\"\n\t\t/>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M27.319 23.89c-.246-.314-1.625-.149-2.244-.075-.188.023-.217\n\t\t\t-.141-.048-.26 1.1-.772 2.902-.55 3.112-.29.21.26-.056 2.068\n\t\t\t-1.086 2.93-.159.132-.31.062-.24-.113.233-.58.752-1.877.506\n\t\t\t-2.192Z\"\n\t\t\tfill=\"#F79C34\"\n\t\t/>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M25.118 18.097v-.75c0-.115.087-.19.19-.19h3.365c.108 0\n\t\t\t.195.077.195.189v.643c-.002.108-.093.25-.254.473l-1.743\n\t\t\t2.489c.647-.015 1.331.081 1.92.412.132.074.168.185.178.293v.8c0\n\t\t\t.111-.121.239-.248.172-1.036-.542-2.41-.601-3.555.007-.117.062\n\t\t\t-.24-.064-.24-.174v-.762c0-.121.003-.33.126-.516l2.019-2.896h\n\t\t\t-1.758a.187.187 0 0 1-.195-.19ZM12.844 22.786h-1.023a.193.193\n\t\t\t0 0 1-.184-.173l.001-5.254c0-.105.089-.189.198-.189h.953c.1.005\n\t\t\t.18.08.186.176v.686h.02c.248-.663.716-.973 1.347-.973.64 0\n\t\t\t1.041.31 1.328.973.248-.663.812-.973 1.414-.973.43 0 .898.177\n\t\t\t1.185.575.325.443.258 1.084.258 1.648v3.315a.193.193 0 0 1-.198\n\t\t\t.19h-1.023a.192.192 0 0 1-.183-.19v-2.785c0-.22.018-.773-.03\n\t\t\t-.983-.076-.355-.305-.454-.601-.454a.68.68 0 0 0-.612.43c-.105\n\t\t\t.267-.095.709-.095 1.007v2.785a.193.193 0 0 1-.198.19h-1.022a\n\t\t\t.192.192 0 0 1-.184-.19l-.001-2.785c0-.586.095-1.448-.63-1.448\n\t\t\t-.737 0-.708.84-.708 1.448v2.785a.193.193 0 0 1-.198.19ZM31.773\n\t\t\t18.132c-.754 0-.802 1.028-.802 1.669s-.01 2.012.793 2.012c.793\n\t\t\t0 .832-1.105.832-1.78 0-.442-.02-.973-.154-1.393-.114-.365-.344\n\t\t\t-.508-.669-.508Zm-.009-1.073c1.52 0 2.341 1.305 2.341 2.963 0\n\t\t\t1.603-.908 2.875-2.34 2.875-1.492 0-2.304-1.305-2.304-2.93 0\n\t\t\t-1.636.822-2.908 2.303-2.908ZM36.076 22.786h-1.02a.192.192 0 0\n\t\t\t1-.184-.188l-.002-5.256a.194.194 0 0 1 .197-.172h.95c.089.005\n\t\t\t.163.065.181.147v.804h.02c.286-.72.687-1.062 1.394-1.062.46 0\n\t\t\t.908.166 1.195.62.267.42.267 1.127.267 1.636v3.306a.194.194 0\n\t\t\t0 1-.196.165h-1.026a.193.193 0 0 1-.182-.165v-2.853c0-.575.067\n\t\t\t-1.415-.64-1.415-.249 0-.478.166-.593.42-.143.32-.162.641-.162\n\t\t\t.995v2.83a.196.196 0 0 1-.2.188ZM23.468 22.773a.212.212 0 0 1\n\t\t\t-.242.024c-.34-.282-.4-.413-.587-.682-.562.572-.96.744-1.688.744\n\t\t\t-.861 0-1.532-.532-1.532-1.596 0-.83.45-1.396 1.092-1.673.555\n\t\t\t-.244 1.331-.288 1.925-.354v-.133c0-.244.02-.532-.125-.743-.124\n\t\t\t-.188-.363-.266-.574-.266-.39 0-.737.2-.823.615-.018.092-.085\n\t\t\t.184-.178.189l-.992-.108c-.084-.02-.177-.086-.153-.214.225-1.187\n\t\t\t1.285-1.557 2.249-1.567h.076c.493.006 1.123.141 1.506.51.498.465\n\t\t\t.45 1.085.45 1.761v1.595c0 .48.2.69.387.948.065.094.08.204-.004\n\t\t\t.273-.209.175-.58.497-.784.68l-.003-.003Zm-1.032-2.496c0 .4.01\n\t\t\t.732-.192 1.086-.163.288-.421.465-.708.465-.393 0-.623-.299-.623\n\t\t\t-.742 0-.872.782-1.03 1.523-1.03v.221ZM10.049 22.773a.212.212\n\t\t\t0 0 1-.242.024c-.34-.282-.402-.413-.587-.682-.562.572-.96.744\n\t\t\t-1.688.744-.862 0-1.532-.532-1.532-1.596 0-.83.45-1.396 1.092\n\t\t\t-1.673.555-.244 1.33-.288 1.924-.354v-.133c0-.244.02-.532-.124\n\t\t\t-.743-.125-.188-.364-.266-.574-.266-.391 0-.738.2-.823.615-.018\n\t\t\t.092-.085.184-.178.189l-.992-.108c-.084-.02-.177-.086-.153-.214\n\t\t\t.225-1.187 1.285-1.557 2.248-1.567h.076c.494.006 1.123.141 1.507\n\t\t\t.51.498.465.45 1.085.45 1.761v1.595c0 .48.2.69.386.948.065.094\n\t\t\t.08.204-.003.273-.21.175-.58.497-.785.68l-.002-.003Zm-1.033\n\t\t\t-2.496c0 .4.01.732-.191 1.086-.163.288-.421.465-.709.465-.392\n\t\t\t0-.622-.299-.622-.742 0-.872.782-1.03 1.522-1.03v.221ZM53.068\n\t\t\t24.67v-.385c0-.11.054-.186.169-.179.213.03.516.06.73.017.281\n\t\t\t-.059.482-.258.601-.53.168-.384.279-.693.35-.896l-2.13-5.275c\n\t\t\t-.036-.09-.047-.256.132-.256h.744c.142 0 .2.09.232.178l1.544\n\t\t\t4.285 1.474-4.285c.03-.087.09-.178.23-.178h.703c.178 0 .167.166\n\t\t\t.132.256l-2.112 5.44c-.274.724-.638 1.877-1.458 2.078-.411.107\n\t\t\t-.93.068-1.235-.06-.077-.038-.106-.141-.106-.21ZM52.075 22.465a\n\t\t\t.18.18 0 0 1-.18.178h-.524a.205.205 0 0 1-.206-.178l-.052-.358a\n\t\t\t3.067 3.067 0 0 1-.859.509c-.617.24-1.329.28-1.932-.091-.437\n\t\t\t-.268-.668-.791-.668-1.331 0-.418.129-.832.414-1.133.381-.411.933\n\t\t\t-.613 1.6-.613.403 0 .979.047 1.398.184v-.719c0-.73-.308-1.047\n\t\t\t-1.12-1.047-.62 0-1.095.093-1.755.299-.106.003-.168-.077-.168\n\t\t\t-.175v-.41c0-.099.084-.194.175-.223.472-.205 1.14-.333 1.85-.357\n\t\t\t.926 0 2.027.209 2.027 1.633v3.832Zm-1.01-1.05V20.33c-.351-.097\n\t\t\t-.934-.137-1.16-.137-.357 0-.747.085-.95.304a.897.897 0 0 0-.222\n\t\t\t.615c0 .289.1.579.333.722.271.184.692.161 1.087.05.38-.109.736\n\t\t\t-.3.913-.47ZM44.334 17.882c1.165 0 1.482.916 1.482 1.965.007.707\n\t\t\t-.123 1.337-.49 1.698-.273.27-.58.344-1.04.344-.41 0-.95-.214\n\t\t\t-1.352-.512v-2.999c.42-.322.954-.496 1.4-.496Zm-1.579 6.977h-.703a\n\t\t\t.18.18 0 0 1-.179-.178v-7.327a.18.18 0 0 1 .179-.179h.538c.113 0\n\t\t\t.19.082.205.179l.057.384c.504-.448 1.153-.735 1.771-.735 1.732 0\n\t\t\t2.302 1.427 2.302 2.911 0 1.588-.872 2.863-2.345 2.863-.62 0-1.2\n\t\t\t-.229-1.646-.626v2.53a.18.18 0 0 1-.179.178Z\"\n\t\t\tfill=\"#232F3E\"\n\t\t/>\n\t</svg>\n);\n\nconst AmazonPayPreview = ( { buttonAttributes } ) => {\n\tconst styleSettings = useMemo(\n\t\t() => getExpressCheckoutButtonStyleSettings(),\n\t\t[]\n\t);\n\n\tconst borderRadius = useMemo( () => {\n\t\tconst appearance = getExpressCheckoutButtonAppearance(\n\t\t\tbuttonAttributes\n\t\t);\n\t\treturn appearance.variables.borderRadius;\n\t}, [ buttonAttributes ] );\n\n\tconst buttonHeight = Math.min(\n\t\tMath.max( buttonAttributes?.height ?? styleSettings.buttonHeight, 40 ),\n\t\t55\n\t);\n\n\tconst buttonStyle = useMemo(\n\t\t() => ( {\n\t\t\theight: `${ buttonHeight }px`,\n\t\t\tborderRadius,\n\t\t\twidth: '100%',\n\t\t\tbackgroundColor: '#FFD814',\n\t\t\tborder: 'none',\n\t\t\tcursor: 'pointer',\n\t\t\tdisplay: 'flex',\n\t\t\talignItems: 'center',\n\t\t\tjustifyContent: 'center',\n\t\t} ),\n\t\t[ buttonHeight, borderRadius ]\n\t);\n\n\treturn (\n\t\t<div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tid=\"express-checkout-button-preview-amazonPay\"\n\t\t\t\tclassName=\"express-checkout-button-preview\"\n\t\t\t\tstyle={ buttonStyle }\n\t\t\t\taria-label={ __( 'Amazon Pay', 'woocommerce-payments' ) }\n\t\t\t>\n\t\t\t\t<AmazonPayLogo />\n\t\t\t</button>\n\t\t</div>\n\t);\n};\n\nexport default AmazonPayPreview;\n","/**\n * External dependencies\n */\nimport { useMemo } from 'react';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetExpressCheckoutButtonAppearance,\n\tgetExpressCheckoutButtonStyleSettings,\n} from '../../utils';\n\nconst ApplePayPreview = ( { buttonAttributes } ) => {\n\tconst styleSettings = useMemo(\n\t\t() => getExpressCheckoutButtonStyleSettings(),\n\t\t[]\n\t);\n\n\tconst borderRadius = useMemo( () => {\n\t\tconst appearance = getExpressCheckoutButtonAppearance(\n\t\t\tbuttonAttributes\n\t\t);\n\t\treturn appearance.variables.borderRadius;\n\t}, [ buttonAttributes ] );\n\n\tconst buttonHeight = Math.min(\n\t\tMath.max( buttonAttributes?.height ?? styleSettings.buttonHeight, 40 ),\n\t\t55\n\t);\n\tconst theme = styleSettings.buttonTheme?.applePay ?? 'black';\n\tconst buttonType = styleSettings.buttonType?.applePay ?? 'plain';\n\n\tconst buttonStyle = useMemo( () => {\n\t\tconst style = {\n\t\t\theight: `${ buttonHeight }px`,\n\t\t\tborderRadius,\n\t\t\tApplePayButtonType: buttonType,\n\t\t\tWebkitAppearance: '-apple-pay-button',\n\t\t\twidth: '100%',\n\t\t};\n\n\t\tif ( [ 'black', 'white', 'white-outline' ].includes( theme ) ) {\n\t\t\tstyle.ApplePayButtonStyle = theme;\n\t\t} else {\n\t\t\tstyle.ApplePayButtonStyle = 'white';\n\t\t}\n\n\t\treturn style;\n\t}, [ buttonHeight, borderRadius, buttonType, theme ] );\n\n\treturn (\n\t\t<div>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tid=\"express-checkout-button-preview-applePay\"\n\t\t\t\tclassName=\"express-checkout-button-preview\"\n\t\t\t\tstyle={ buttonStyle }\n\t\t\t\taria-label={ __( 'Apple Pay', 'woocommerce-payments' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nexport default ApplePayPreview;\n","/**\n * External dependencies\n */\nimport { useEffect, useMemo, useRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetExpressCheckoutButtonAppearance,\n\tgetExpressCheckoutButtonStyleSettings,\n} from '../../utils';\n\nconst GooglePayPreview = ( { buttonAttributes } ) => {\n\tconst googlePayContainerRef = useRef( null );\n\tconst isScriptLoaded = useRef( false );\n\n\tconst styleSettings = useMemo(\n\t\t() => getExpressCheckoutButtonStyleSettings(),\n\t\t[]\n\t);\n\n\tconst borderRadius = useMemo( () => {\n\t\tconst appearance = getExpressCheckoutButtonAppearance(\n\t\t\tbuttonAttributes\n\t\t);\n\t\treturn appearance.variables.borderRadius;\n\t}, [ buttonAttributes ] );\n\n\tconst buttonHeight = Math.min(\n\t\tMath.max( buttonAttributes?.height ?? styleSettings.buttonHeight, 40 ),\n\t\t55\n\t);\n\tconst theme = styleSettings.buttonTheme?.googlePay ?? 'black';\n\tconst buttonType = styleSettings.buttonType?.googlePay ?? 'plain';\n\n\tconst containerStyle = useMemo(\n\t\t() => ( {\n\t\t\theight: `${ buttonHeight }px`,\n\t\t\twidth: '100%',\n\t\t\toverflow: 'hidden',\n\t\t} ),\n\t\t[ buttonHeight ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( ! googlePayContainerRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst container = googlePayContainerRef.current;\n\n\t\tconst loadGooglePayButton = async () => {\n\t\t\t// The container may be inside an iframe, so we need to retrieve a reference to the document and window objects.\n\t\t\tconst targetDocument = container.ownerDocument;\n\t\t\tconst targetWindow = targetDocument.defaultView;\n\n\t\t\tif (\n\t\t\t\t! isScriptLoaded.current &&\n\t\t\t\t! targetWindow.google?.payments?.api?.PaymentsClient\n\t\t\t) {\n\t\t\t\tawait new Promise( ( resolve, reject ) => {\n\t\t\t\t\tconst script = targetDocument.createElement( 'script' );\n\t\t\t\t\tscript.src = 'https://pay.google.com/gp/p/js/pay.js';\n\t\t\t\t\tscript.onload = resolve;\n\t\t\t\t\tscript.onerror = () =>\n\t\t\t\t\t\treject(\n\t\t\t\t\t\t\tnew Error( 'Failed to load Google Pay script.' )\n\t\t\t\t\t\t);\n\t\t\t\t\ttargetDocument.head.appendChild( script );\n\t\t\t\t} );\n\t\t\t\tisScriptLoaded.current = true;\n\t\t\t}\n\n\t\t\tconst googlePayClient = new targetWindow.google.payments.api.PaymentsClient(\n\t\t\t\t{\n\t\t\t\t\tenvironment: 'TEST',\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst buttonColor = theme === 'black' ? 'black' : 'white'; // There is no 'outline' theme in Google Pay.\n\n\t\t\t// Clear the existing button before creating a new one.\n\t\t\tcontainer.innerHTML = '';\n\n\t\t\tconst button = googlePayClient.createButton( {\n\t\t\t\tbuttonType,\n\t\t\t\tbuttonColor,\n\t\t\t\tbuttonRadius: parseFloat( borderRadius ) || 0,\n\t\t\t\tbuttonSizeMode: 'fill',\n\t\t\t\tonClick: () => {},\n\t\t\t} );\n\t\t\tcontainer.appendChild( button );\n\t\t};\n\n\t\t// Fail gracefully if script fails to load - just don't render the button.\n\t\tloadGooglePayButton().catch( () => {} );\n\t}, [ theme, borderRadius, buttonType ] );\n\n\treturn (\n\t\t<div\n\t\t\tref={ googlePayContainerRef }\n\t\t\tid=\"express-checkout-button-preview-googlePay\"\n\t\t\tstyle={ containerStyle }\n\t\t/>\n\t);\n};\n\nexport default GooglePayPreview;\n"],"names":["AmazonPayLogo","_jsxs","width","height","viewBox","fill","xmlns","__","children","_jsx","fillRule","clipRule","d","AmazonPayPreview","buttonAttributes","_buttonAttributes$hei","styleSettings","useMemo","getExpressCheckoutButtonStyleSettings","borderRadius","getExpressCheckoutButtonAppearance","variables","buttonHeight","Math","min","max","buttonStyle","backgroundColor","border","cursor","display","alignItems","justifyContent","type","id","className","style","ApplePayPreview","_styleSettings$button","_styleSettings$button2","theme","buttonTheme","applePay","buttonType","ApplePayButtonType","WebkitAppearance","includes","ApplePayButtonStyle","GooglePayPreview","googlePayContainerRef","useRef","isScriptLoaded","googlePay","containerStyle","overflow","useEffect","current","container","async","targetDocument","ownerDocument","targetWindow","defaultView","google","payments","api","PaymentsClient","Promise","resolve","reject","script","createElement","src","onload","onerror","Error","head","appendChild","googlePayClient","environment","buttonColor","innerHTML","button","createButton","buttonRadius","parseFloat","buttonSizeMode","onClick","loadGooglePayButton","catch","ref"],"sourceRoot":""}