(e=>{"use strict";const t={init:()=>{const e=t;e.toggleMode(),e.toggleDelayPeriodField(),e.togglePaymentRequestFields(),e.toggleCrossBorderTransferFields(),e.toggleIntervalField(),e.toggleSandboxFields(),e.element("testmode").change(function(){e.toggleMode(),e.toggleSandboxFields()}),e.element("sandbox_mode").change(function(){e.toggleSandboxFields()}),e.element("disburse_mode").change(e.toggleDelayPeriodField),e.element("payment_request").change(e.togglePaymentRequestFields),e.element("cross_border_transfer").change(e.toggleCrossBorderTransferFields),e.element("announcement_to_sellers").change(e.toggleIntervalField)},toggleMode:()=>{["test_publishable_key","test_secret_key","test_webhook_key"].forEach(e=>{t.element("testmode").is(":checked")?(t.element(e).closest("tr").show(),t.element("webhook_key").closest("tr").hide()):(t.element(e).closest("tr").hide(),t.element("webhook_key").closest("tr").show())})},togglePaymentRequestFields:()=>{["type","theme","size","locations"].forEach(e=>{t.element("payment_request").is(":checked")?t.element(e,"payment_request_button").closest("tr").show():t.element(e,"payment_request_button").closest("tr").hide()})},toggleCrossBorderTransferFields:()=>{["restricted_countries","disconnect_restricted_vendors"].forEach(e=>{t.element("cross_border_transfer").is(":checked")?t.element(e).closest("tr").show():t.element(e).closest("tr").hide()}),["disconnect_connected_vendors"].forEach(e=>{t.element("cross_border_transfer").is(":checked")?t.element(e).closest("tr").hide():t.element(e).closest("tr").show()})},toggleDelayPeriodField:()=>{"DELAYED"===t.element("disburse_mode").val()?t.element("disbursement_delay_period").closest("tr").show():t.element("disbursement_delay_period").closest("tr").hide()},toggleIntervalField:()=>{t.element("announcement_to_sellers").is(":checked")?t.element("notice_interval").closest("tr").show():t.element("notice_interval").closest("tr").hide()},toggleSandboxFields:()=>{const e=t.element("testmode"),s=t.element("sandbox_mode"),o=t.element("sandbox_webhook_key"),l=t.element("sandbox_publishable_key"),n=t.element("sandbox_secret_key");e.is(":checked")?(s.prop("disabled",!0),s.prop("checked",!1)):s.prop("disabled",!1),s.is(":checked")?(e.prop("disabled",!0),e.prop("checked",!1),o.closest("tr").show(),l.closest("tr").show(),n.closest("tr").show()):(e.prop("disabled",!1),o.closest("tr").hide(),l.closest("tr").hide(),n.closest("tr").hide())},element:(t,s=!1)=>(s&&s.length&&(t=`${s}_${t}`),e(`#woocommerce_dokan_stripe_express_${t}`))};e(document).ready(t.init)})(jQuery);