/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./modules/stripe-express/assets/src/js/payment-request.js":
/*!*****************************************************************!*\
  !*** ./modules/stripe-express/assets/src/js/payment-request.js ***!
  \*****************************************************************/
/***/ (() => {

eval("/* global dokanStripeExpressPRData */\n;\n\n(function ($) {\n  'use strict';\n\n  var paymentRequestType;\n  var dokanStripeExpressPRApi = Stripe(dokanStripeExpressPRData.stripe.key, {\n    locale: dokanStripeExpressPRData.stripe.locale,\n    apiVersion: dokanStripeExpressPRData.stripe.apiVersion\n  });\n  /**\n   * Object to handle Stripe payment forms.\n   */\n\n  var dokanStripeExpressPaymentRequest = {\n    ajaxEndpoint: function ajaxEndpoint(endpoint) {\n      return dokanStripeExpressPRData.ajaxUrl.toString().replace('%%endpoint%%', 'dokan_stripe_express_' + endpoint);\n    },\n    makeRequest: function makeRequest(endpoint) {\n      var formData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n      var dataType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n      var requestType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'POST';\n      var data = {\n        type: requestType,\n        data: formData,\n        url: dokanStripeExpressPaymentRequest.ajaxEndpoint(endpoint)\n      };\n\n      if (dataType) {\n        data.dataType = dataType;\n      }\n\n      return $.ajax(data);\n    },\n    getCartDetails: function getCartDetails() {\n      $.when(dokanStripeExpressPaymentRequest.makeRequest('get_cart_details', {\n        security: dokanStripeExpressPRData.nonce.payment\n      })).then(dokanStripeExpressPaymentRequest.startPaymentRequest);\n    },\n    getAttributes: function getAttributes() {\n      var select = $('.variations_form').find('.variations select'),\n          data = {},\n          count = 0,\n          chosen = 0;\n      select.each(function () {\n        var attribute_name = $(this).data('attribute_name') || $(this).attr('name');\n        var value = $(this).val() || '';\n\n        if (value.length > 0) {\n          chosen++;\n        }\n\n        count++;\n        data[attribute_name] = value;\n      });\n      return {\n        'count': count,\n        'chosenCount': chosen,\n        'data': data\n      };\n    },\n    processSource: function processSource(source, paymentRequestType) {\n      return dokanStripeExpressPaymentRequest.makeRequest('create_order', dokanStripeExpressPaymentRequest.getOrderData(source, paymentRequestType), 'json');\n    },\n    getOrderData: function getOrderData(event, paymentRequestType) {\n      var source = event.source,\n          email = source.owner.email,\n          phone = source.owner.phone,\n          billing = source.owner.address,\n          name = source.owner.name,\n          shipping = event.shippingAddress,\n          data = {\n        _wpnonce: dokanStripeExpressPRData.nonce.checkout,\n        billing_company: '',\n        billing_first_name: null !== name ? name.split(' ').slice(0, 1).join(' ') : '',\n        billing_last_name: null !== name ? name.split(' ').slice(1).join(' ') : '',\n        billing_email: null !== email ? email : event.payerEmail,\n        billing_phone: null !== phone ? phone : event.payerPhone && event.payerPhone.replace('/[() -]/g', ''),\n        billing_country: null !== billing ? billing.country : '',\n        billing_address_1: null !== billing ? billing.line1 : '',\n        billing_address_2: null !== billing ? billing.line2 : '',\n        billing_city: null !== billing ? billing.city : '',\n        billing_state: null !== billing ? billing.state : '',\n        billing_postcode: null !== billing ? billing.postal_code : '',\n        shipping_first_name: '',\n        shipping_last_name: '',\n        shipping_company: '',\n        shipping_country: '',\n        shipping_address_1: '',\n        shipping_address_2: '',\n        shipping_city: '',\n        shipping_state: '',\n        shipping_postcode: '',\n        shipping_method: [null === event.shippingOption ? null : event.shippingOption.id],\n        order_comments: '',\n        payment_method: dokanStripeExpressPRData.stripe.paymentMethod,\n        ship_to_different_address: 1,\n        terms: 1,\n        stripe_source: source.id,\n        payment_request_type: paymentRequestType\n      };\n\n      if (shipping) {\n        data.shipping_first_name = shipping.recipient.split(' ').slice(0, 1).join(' ');\n        data.shipping_last_name = shipping.recipient.split(' ').slice(1).join(' ');\n        data.shipping_company = shipping.organization;\n        data.shipping_country = shipping.country;\n        data.shipping_address_1 = typeof shipping.addressLine[0] === 'undefined' ? '' : shipping.addressLine[0];\n        data.shipping_address_2 = typeof shipping.addressLine[1] === 'undefined' ? '' : shipping.addressLine[1];\n        data.shipping_city = shipping.city;\n        data.shipping_state = shipping.region;\n        data.shipping_postcode = shipping.postalCode;\n      }\n\n      if (!data.billing_first_name) {\n        data.billing_first_name = data.shipping_first_name ? data.shipping_first_name : dokanStripeExpressPRData.customer.first_name;\n      }\n\n      if (!data.billing_last_name) {\n        data.billing_last_name = data.shipping_last_name ? data.shipping_last_name : dokanStripeExpressPRData.customer.last_name;\n      }\n\n      return data;\n    },\n    prepareErrorMessage: function prepareErrorMessage(message) {\n      return $('<div class=\"woocommerce-error\" />').text(message);\n    },\n    showErrorMessage: function showErrorMessage(message) {\n      $('.woocommerce-error').remove();\n\n      if (dokanStripeExpressPRData.isProductPage) {\n        var element = $('.product').first();\n        element.before(message);\n        $('html, body').animate({\n          scrollTop: element.prev('.woocommerce-error').offset().top\n        }, 600);\n      } else {\n        var $form = $('.shop_table.cart').closest('form');\n        $form.before(message);\n        $('html, body').animate({\n          scrollTop: $form.prev('.woocommerce-error').offset().top\n        }, 600);\n      }\n    },\n    abortPayment: function abortPayment(payment, message) {\n      payment.complete('fail');\n      dokanStripeExpressPaymentRequest.showErrorMessage(message);\n    },\n    completePayment: function completePayment(payment, url) {\n      dokanStripeExpressPaymentRequest.block();\n      payment.complete('success'); // Success, then redirect to the Thank You page.\n\n      window.location = url;\n    },\n    block: function block() {\n      $.blockUI({\n        message: null,\n        overlayCSS: {\n          background: '#fff',\n          opacity: 0.6\n        }\n      });\n    },\n    updateShippingOptions: function updateShippingOptions(details, address) {\n      return dokanStripeExpressPaymentRequest.makeRequest('get_shipping_options', {\n        security: dokanStripeExpressPRData.nonce.shipping,\n        country: address.country,\n        state: address.region,\n        postcode: address.postalCode,\n        city: address.city,\n        address: typeof address.addressLine[0] === 'undefined' ? '' : address.addressLine[0],\n        address_2: typeof address.addressLine[1] === 'undefined' ? '' : address.addressLine[1],\n        payment_request_type: paymentRequestType,\n        is_product_page: dokanStripeExpressPRData.isProductPage\n      });\n    },\n    updateShippingDetails: function updateShippingDetails(details, shippingOption) {\n      return dokanStripeExpressPaymentRequest.makeRequest('update_shipping_method', {\n        security: dokanStripeExpressPRData.nonce.updateShipping,\n        shipping_method: [shippingOption.id],\n        payment_request_type: paymentRequestType,\n        is_product_page: dokanStripeExpressPRData.isProductPage\n      });\n    },\n\n    /**\n     * Adds the item to the cart and return cart details.\n     */\n    addToCart: function addToCart() {\n      var product_id = $('.single_add_to_cart_button').val(); // Check if product is a variable product.\n\n      if ($('.single_variation_wrap').length) {\n        product_id = $('.single_variation_wrap').find('input[name=\"product_id\"]').val();\n      }\n\n      var data = {\n        security: dokanStripeExpressPRData.nonce.addToCart,\n        product_id: product_id,\n        qty: $('.quantity .qty').val(),\n        attributes: $('.variations_form').length ? dokanStripeExpressPaymentRequest.getAttributes().data : []\n      }; // add addons data to the POST body\n\n      var formData = $('form.cart').serializeArray();\n      $.each(formData, function (i, field) {\n        if (/^addon-/.test(field.name)) {\n          if (/\\[\\]$/.test(field.name)) {\n            var fieldName = field.name.substring(0, field.name.length - 2);\n\n            if (data[fieldName]) {\n              data[fieldName].push(field.value);\n            } else {\n              data[fieldName] = [field.value];\n            }\n          } else {\n            data[field.name] = field.value;\n          }\n        }\n      });\n      return dokanStripeExpressPaymentRequest.makeRequest('add_to_cart', data);\n    },\n    clearCart: function clearCart() {\n      dokanStripeExpressPaymentRequest.makeRequest('clear_cart', {\n        security: dokanStripeExpressPRData.nonce.clearCart\n      });\n    },\n    getRequestOptionsFromLocal: function getRequestOptionsFromLocal() {\n      return {\n        total: dokanStripeExpressPRData.product.total,\n        currency: dokanStripeExpressPRData.checkout.currencyCode,\n        country: dokanStripeExpressPRData.checkout.countryCode,\n        requestPayerName: true,\n        requestPayerEmail: true,\n        requestPayerPhone: dokanStripeExpressPRData.checkout.payerPhoneNeeded,\n        requestShipping: dokanStripeExpressPRData.product.requestShipping,\n        displayItems: dokanStripeExpressPRData.product.displayItems\n      };\n    },\n    startPaymentRequest: function startPaymentRequest(cart) {\n      var paymentDetails, options;\n\n      if (dokanStripeExpressPRData.isProductPage) {\n        options = dokanStripeExpressPaymentRequest.getRequestOptionsFromLocal();\n        paymentDetails = options;\n      } else {\n        options = {\n          total: cart.order_data.total,\n          currency: cart.order_data.currency,\n          country: cart.order_data.country_code,\n          requestPayerName: true,\n          requestPayerEmail: true,\n          requestPayerPhone: dokanStripeExpressPRData.checkout.payerPhoneNeeded,\n          requestShipping: cart.shipping_required ? true : false,\n          displayItems: cart.order_data.displayItems\n        };\n        paymentDetails = cart.order_data;\n      } // Puerto Rico (PR) is the only US territory/possession that's supported by Stripe.\n      // Since it's considered a US state by Stripe, we need to do some special mapping.\n\n\n      if ('PR' === options.country) {\n        options.country = 'US';\n      } // Handle errors thrown by Stripe, so we don't break the product page\n\n\n      try {\n        var paymentRequest = dokanStripeExpressPRApi.paymentRequest(options),\n            elements = dokanStripeExpressPRApi.elements({\n          locale: dokanStripeExpressPRData.button.locale\n        }),\n            prButton = dokanStripeExpressPaymentRequest.createPaymentRequestButton(elements, paymentRequest); // Check the availability of the Payment Request API first.\n\n        paymentRequest.canMakePayment().then(function (response) {\n          if (!response) {\n            return;\n          }\n\n          if (response.applePay) {\n            paymentRequestType = 'apple_pay';\n          } else if (response.googlePay) {\n            paymentRequestType = 'google_pay';\n          } else {\n            paymentRequestType = 'payment_request_api';\n          }\n\n          dokanStripeExpressPaymentRequest.attachBtnEventListeners(prButton, paymentRequest);\n          dokanStripeExpressPaymentRequest.showPaymentRequestButton(prButton);\n        }); // Possible statuses success, fail, invalid_payer_name, invalid_payer_email, invalid_payer_phone, invalid_shipping_address.\n\n        paymentRequest.on('shippingaddresschange', function (event) {\n          $.when(dokanStripeExpressPaymentRequest.updateShippingOptions(paymentDetails, event.shippingAddress)).then(function (response) {\n            var data = {\n              status: response.result,\n              shippingOptions: [],\n              total: response.total,\n              displayItems: response.displayItems\n            };\n\n            if (response.shipping_options && response.shipping_options.length) {\n              data.shippingOptions = response.shipping_options;\n            }\n\n            event.updateWith(data);\n          });\n        });\n        paymentRequest.on('shippingoptionchange', function (event) {\n          $.when(dokanStripeExpressPaymentRequest.updateShippingDetails(paymentDetails, event.shippingOption)).then(function (response) {\n            if ('success' === response.result) {\n              event.updateWith({\n                status: 'success',\n                total: response.total,\n                displayItems: response.displayItems\n              });\n            }\n\n            if ('fail' === response.result) {\n              event.updateWith({\n                status: 'fail'\n              });\n            }\n          });\n        });\n        paymentRequest.on('source', function (event) {\n          // Check if we allow prepaid cards.\n          if ('no' === dokanStripeExpressPRData.stripe.allowPrepaidCard && 'prepaid' === event.source.card.funding) {\n            dokanStripeExpressPaymentRequest.abortPayment(event, dokanStripeExpressPaymentRequest.dokanStripeExpressPaymentRequest.prepareErrorMessage(dokanStripeExpressPRData.i18n.error.noPrepaidCard));\n          } else {\n            $.when(dokanStripeExpressPaymentRequest.processSource(event, paymentRequestType)).then(function (response) {\n              if ('success' === response.result) {\n                dokanStripeExpressPaymentRequest.completePayment(event, response.redirect);\n              } else {\n                dokanStripeExpressPaymentRequest.abortPayment(event, response.messages);\n              }\n            });\n          }\n        });\n      } catch (e) {\n        // Leave for troubleshooting\n        console.error(e);\n      }\n    },\n    getSelectedProductData: function getSelectedProductData() {\n      var product_id = $('.single_add_to_cart_button').val(); // Check if product is a variable product.\n\n      if ($('.single_variation_wrap').length) {\n        product_id = $('.single_variation_wrap').find('input[name=\"product_id\"]').val();\n      }\n\n      var addons = $('#product-addons-total').data('price_data') || [],\n          addon_value = addons.reduce(function (sum, addon) {\n        return sum + addon.cost;\n      }, 0);\n      return dokanStripeExpressPaymentRequest.makeRequest('get_selected_product_data', {\n        security: dokanStripeExpressPRData.nonce.getSelectedProductData,\n        product_id: product_id,\n        qty: $('.quantity .qty').val(),\n        attributes: $('.variations_form').length ? dokanStripeExpressPaymentRequest.getAttributes().data : [],\n        addon_value: addon_value\n      });\n    },\n\n    /**\n     * Creates a wrapper around a function that ensures a function can not\n     * called in rappid succesion. The function can only be executed once and then agin after\n     * the wait time has expired.  Even if the wrapper is called multiple times, the wrapped\n     * function only excecutes once and then blocks until the wait time expires.\n     */\n    debounce: function debounce(wait, func, immediate) {\n      var timeout;\n      return function () {\n        var context = this,\n            args = arguments;\n\n        var later = function later() {\n          timeout = null;\n          if (!immediate) func.apply(context, args);\n        };\n\n        var callNow = immediate && !timeout;\n        clearTimeout(timeout);\n        timeout = setTimeout(later, wait);\n        if (callNow) func.apply(context, args);\n      };\n    },\n\n    /**\n     * Creates stripe paymentRequest element or connects to custom button\n     */\n    createPaymentRequestButton: function createPaymentRequestButton(elements, paymentRequest) {\n      return elements.create('paymentRequestButton', {\n        paymentRequest: paymentRequest,\n        style: {\n          paymentRequestButton: {\n            type: dokanStripeExpressPRData.button.type,\n            theme: dokanStripeExpressPRData.button.theme,\n            height: dokanStripeExpressPRData.button.height + 'px'\n          }\n        }\n      });\n    },\n\n    /**\n     * Checks if button is custom payment request button.\n     */\n    isCustomPRButton: function isCustomPRButton(prButton) {\n      return prButton && 'function' === typeof prButton.data && prButton.data('isCustom');\n    },\n    isBrandedPRButton: function isBrandedPRButton(prButton) {\n      return prButton && 'function' === typeof prButton.data && prButton.data('isBranded');\n    },\n    attachBtnEventListeners: function attachBtnEventListeners(prButton, paymentRequest) {\n      // First, mark the body so we know a payment request button was used.\n      // This way error handling can any display errors in the most appropriate place.\n      prButton.on('click', function (event) {\n        $('body').addClass('dokan-stripe-express-pay-req-btn-clicked');\n      }); // Then, attach specific handling for selected pages and button types\n\n      if (dokanStripeExpressPRData.isProductPage) {\n        dokanStripeExpressPaymentRequest.attachProductPageEventListeners(prButton, paymentRequest);\n      } else {\n        dokanStripeExpressPaymentRequest.attachCartPageEventListeners(prButton, paymentRequest);\n      }\n    },\n    attachProductPageEventListeners: function attachProductPageEventListeners(prButton, paymentRequest) {\n      var paymentRequestError = [],\n          addToCartButton = $('.single_add_to_cart_button');\n      prButton.on('click', function (event) {\n        // If login is required for checkout, display redirect confirmation dialog.\n        if (dokanStripeExpressPRData.loginStatus) {\n          event.preventDefault();\n          dokanStripeExpressPaymentRequest.verifyLoginRequirement(paymentRequestType);\n          return;\n        } // First check if product can be added to cart.\n\n\n        if (addToCartButton.is('.disabled')) {\n          event.preventDefault(); // Prevent showing payment request modal.\n\n          if (addToCartButton.is('.wc-variation-is-unavailable')) {\n            return dokan_sweetalert(dokanStripeExpressPRData.i18n.makeSelection, {\n              action: 'alert',\n              icon: 'warning',\n              timer: 2200\n            });\n          } else if (addToCartButton.is('.wc-variation-selection-needed')) {\n            return dokan_sweetalert(dokanStripeExpressPRData.i18n.productUnavailable, {\n              action: 'alert',\n              icon: 'warning',\n              timer: 2200\n            });\n          }\n        }\n\n        if (paymentRequestError.length) {\n          event.preventDefault();\n          return dokan_sweetalert(paymentRequestError, {\n            action: 'alert',\n            icon: 'error',\n            timer: 2200\n          });\n        }\n\n        dokanStripeExpressPaymentRequest.addToCart(); // $.when( dokanStripeExpressPaymentRequest.addToCart() ).then( (response) => {\n        //     paymentRequest.update( {\n        //         total: response.total,\n        //         displayItems: response.displayItems,\n        //     } );\n        // });\n        // paymentRequest.show();\n\n        if (dokanStripeExpressPaymentRequest.isCustomPRButton(prButton) || dokanStripeExpressPaymentRequest.isBrandedPRButton(prButton)) {\n          event.preventDefault();\n          paymentRequest.show();\n        }\n      });\n      $(document.body).on('dokan_stripe_express_unblock_payment_request_button dokan_stripe_express_enable_payment_request_button', function () {\n        dokanStripeExpressPaymentRequest.unblockPaymentRequestButton();\n      });\n      $(document.body).on('dokan_stripe_express_block_payment_request_button', function () {\n        dokanStripeExpressPaymentRequest.blockPaymentRequestButton('wc_request_button_is_blocked');\n      });\n      $(document.body).on('dokan_stripe_express_disable_payment_request_button', function () {\n        dokanStripeExpressPaymentRequest.blockPaymentRequestButton('wc_request_button_is_disabled');\n      });\n      $(document.body).on('woocommerce_variation_has_changed', function () {\n        $(document.body).trigger('dokan_stripe_express_block_payment_request_button');\n        $.when(dokanStripeExpressPaymentRequest.getSelectedProductData()).then(function (response) {\n          $.when(paymentRequest.update({\n            total: response.total,\n            displayItems: response.displayItems\n          })).then(function () {\n            $(document.body).trigger('dokan_stripe_express_unblock_payment_request_button');\n          });\n        });\n      }); // Block the payment request button as soon as an \"input\" event is fired, to avoid sync issues\n      // when the customer clicks on the button before the debounced event is processed.\n\n      $('.quantity').on('input', '.qty', function () {\n        $(document.body).trigger('dokan_stripe_express_block_payment_request_button');\n      });\n      $('.quantity').on('input', '.qty', dokanStripeExpressPaymentRequest.debounce(250, function () {\n        $(document.body).trigger('dokan_stripe_express_block_payment_request_button');\n        paymentRequestError = [];\n        $.when(dokanStripeExpressPaymentRequest.getSelectedProductData()).then(function (response) {\n          if (response.error) {\n            paymentRequestError = [response.error];\n            $(document.body).trigger('dokan_stripe_express_unblock_payment_request_button');\n          } else {\n            $.when(paymentRequest.update({\n              total: response.total,\n              displayItems: response.displayItems\n            })).then(function () {\n              $(document.body).trigger('dokan_stripe_express_unblock_payment_request_button');\n            });\n          }\n        });\n      }));\n\n      if ($('.variations_form').length) {\n        $('.variations_form').on('found_variation.wc-variation-form', function (event, variation) {\n          if (variation.is_in_stock) {\n            dokanStripeExpressPaymentRequest.unhidePaymentRequestButton();\n          } else {\n            dokanStripeExpressPaymentRequest.hidePaymentRequestButton();\n          }\n        });\n      }\n    },\n    attachCartPageEventListeners: function attachCartPageEventListeners(prButton, paymentRequest) {\n      prButton.on('click', function (event) {\n        // If login is required for checkout, display redirect confirmation dialog.\n        if (dokanStripeExpressPRData.loginStatus) {\n          event.preventDefault();\n          dokanStripeExpressPaymentRequest.verifyLoginRequirement(paymentRequestType);\n          return;\n        }\n\n        if (dokanStripeExpressPaymentRequest.isCustomPRButton(prButton) || dokanStripeExpressPaymentRequest.isBrandedPRButton(prButton)) {\n          event.preventDefault();\n          paymentRequest.show();\n        }\n      });\n    },\n    showPaymentRequestButton: function showPaymentRequestButton(prButton) {\n      if (dokanStripeExpressPaymentRequest.isCustomPRButton(prButton)) {\n        prButton.addClass('is-active');\n        $('#dokan-stripe-express-payment-request-wrapper, #dokan-stripe-express-payment-request-button-separator').show();\n      } else if (dokanStripeExpressPaymentRequest.isBrandedPRButton(prButton)) {\n        $('#dokan-stripe-express-payment-request-wrapper, #dokan-stripe-express-payment-request-button-separator').show();\n        $('#dokan-stripe-express-payment-request-button').html(prButton);\n      } else if ($('#dokan-stripe-express-payment-request-button').length) {\n        $('#dokan-stripe-express-payment-request-wrapper, #dokan-stripe-express-payment-request-button-separator').show();\n        prButton.mount('#dokan-stripe-express-payment-request-button');\n      }\n    },\n    hidePaymentRequestButton: function hidePaymentRequestButton() {\n      $('#dokan-stripe-express-payment-request-wrapper, #dokan-stripe-express-payment-request-button-separator').hide();\n    },\n    unhidePaymentRequestButton: function unhidePaymentRequestButton() {\n      var stripe_wrapper = $('#dokan-stripe-express-payment-request-wrapper');\n      var stripe_separator = $('#dokan-stripe-express-payment-request-button-separator'); // If either element is hidden, ensure both show.\n\n      if (stripe_wrapper.is(':hidden') || stripe_separator.is(':hidden')) {\n        stripe_wrapper.show();\n        stripe_separator.show();\n      }\n    },\n    blockPaymentRequestButton: function blockPaymentRequestButton(cssClassname) {\n      // check if element isn't already blocked before calling block() to avoid blinking overlay issues\n      // blockUI.isBlocked is either undefined or 0 when element is not blocked\n      if ($('#dokan-stripe-express-payment-request-button').data('blockUI.isBlocked')) {\n        return;\n      }\n\n      $('#dokan-stripe-express-payment-request-button').addClass(cssClassname).block({\n        message: null\n      });\n    },\n    unblockPaymentRequestButton: function unblockPaymentRequestButton() {\n      $('#dokan-stripe-express-payment-request-button').removeClass(['wc_request_button_is_blocked', 'wc_request_button_is_disabled']).unblock();\n    },\n    verifyLoginRequirement: function verifyLoginRequirement(paymentRequestType) {\n      if (!dokanStripeExpressPRData.loginStatus) {\n        return;\n      }\n\n      var message = dokanStripeExpressPRData.loginStatus.message; // Replace dialog text with specific payment request type \"Apple Pay\" or \"Google Pay\".\n\n      if ('payment_request_api' !== paymentRequestType) {\n        message = message.replace(/\\*\\*.*?\\*\\*/, 'apple_pay' === paymentRequestType ? dokanStripeExpressPRData.i18n.applePay : dokanStripeExpressPRData.i18n.googlePay);\n      } // Remove asterisks from string.\n\n\n      message = message.replace(/\\*\\*/g, '');\n      dokan_sweetalert(message, {\n        action: 'confirm',\n        icon: 'warning',\n        confirmButtonColor: '#363636',\n        cancelButtonColor: '#b54545',\n        confirmButtonText: dokanStripeExpressPRData.i18n.login,\n        cancelButtonText: dokanStripeExpressPRData.i18n.cancel\n      }).then(function (response) {\n        if (response.isConfirmed) {\n          // Redirect to my account page.\n          window.location.href = dokanStripeExpressPRData.loginStatus.redirect_url;\n        }\n      });\n    },\n\n    /**\n     * Initialize event handlers and UI state\n     */\n    init: function init() {\n      if (dokanStripeExpressPRData.isProductPage) {\n        dokanStripeExpressPaymentRequest.startPaymentRequest('');\n      } else {\n        dokanStripeExpressPaymentRequest.getCartDetails();\n      }\n    }\n  }; // Kick off the script\n\n  dokanStripeExpressPaymentRequest.init(); // We need to refresh payment request data when total is updated.\n\n  $(document.body).on('updated_cart_totals', function () {\n    dokanStripeExpressPaymentRequest.init();\n  }); // We need to refresh payment request data when total is updated.\n\n  $(document.body).on('updated_checkout', function () {\n    dokanStripeExpressPaymentRequest.init();\n  });\n})(jQuery);\n\n//# sourceURL=webpack://dokan-pro/./modules/stripe-express/assets/src/js/payment-request.js?");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = {};
/******/ 	__webpack_modules__["./modules/stripe-express/assets/src/js/payment-request.js"]();
/******/ 	
/******/ })()
;