Viewing File: /home/rtsgrob/ww6/wp-content/plugins/woocommerce-payments/dist/multi-currency.js

/*! For license information please see multi-currency.js.LICENSE.txt */
(()=>{var e={5955(e,t,r){"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),d=["gridicon","gridicons-checkmark",i,!1,!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:d,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M9 19.414l-6.707-6.707 1.414-1.414L9 16.586 20.293 5.293l1.414 1.414z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},9387(e,t,r){"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),d=["gridicon","gridicons-cross-circle",i,!1,!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:d,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M19.1 4.9C15.2 1 8.8 1 4.9 4.9S1 15.2 4.9 19.1s10.2 3.9 14.1 0 4-10.3.1-14.2zm-4.3 11.3L12 13.4l-2.8 2.8-1.4-1.4 2.8-2.8-2.8-2.8 1.4-1.4 2.8 2.8 2.8-2.8 1.4 1.4-2.8 2.8 2.8 2.8-1.4 1.4z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},4275(e,t,r){"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),d=["gridicon","gridicons-info-outline",i,!!function(e){return 0==e%18}(r)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:d,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M13 9h-2V7h2v2zm0 2h-2v6h2v-6zm-1-7c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8m0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},9031(e,t,r){"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),d=["gridicon","gridicons-notice-outline",i,!!function(e){return 0==e%18}(r)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:d,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},5338(e,t,r){"use strict";var o=r(5795);t.H=o.createRoot,o.hydrateRoot},1020(e,t,r){"use strict";var o=r(1609),n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(e,t,r){var o,a={},d=null,u=null;for(o in void 0!==r&&(d=""+r),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,o)&&!c.hasOwnProperty(o)&&(a[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===a[o]&&(a[o]=t[o]);return{$$typeof:n,type:e,key:d,ref:u,props:a,_owner:i.current}}t.Fragment=a,t.jsx=d,t.jsxs=d},4848(e,t,r){"use strict";e.exports=r(1020)},1609(e){"use strict";e.exports=window.React},5795(e){"use strict";e.exports=window.ReactDOM}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.p=window.wcpayAssets.url,(()=>{"use strict";var e={};r.r(e),r.d(e,{getAllDepositsOverviews:()=>Ae,getAllDepositsOverviewsError:()=>Ne,getDeposit:()=>Ie,getDepositQueryError:()=>De,getDeposits:()=>xe,getDepositsCount:()=>Pe,getDepositsSummary:()=>Fe,getDepositsSummaryError:()=>je,getInstantDeposit:()=>Ue});var t={};r.r(t),r.d(t,{submitInstantDeposit:()=>Xe,updateAllDepositsOverviews:()=>Ve,updateDeposit:()=>qe,updateDeposits:()=>Ge,updateDepositsCount:()=>We,updateDepositsSummary:()=>Ze,updateErrorForAllDepositsOverviews:()=>He,updateErrorForDepositQuery:()=>Qe,updateErrorForDepositsSummary:()=>Je,updateInstantDeposit:()=>Ke});var o={};r.r(o),r.d(o,{getAllDepositsOverviews:()=>tt,getDeposit:()=>et,getDeposits:()=>at,getDepositsSummary:()=>st,getPayoutsCSVRequestURL:()=>nt,payoutsDownloadEndpoint:()=>ot});var n={};r.r(n),r.d(n,{getFraudOutcomeTransactions:()=>St,getFraudOutcomeTransactionsError:()=>gt,getFraudOutcomeTransactionsSummary:()=>ft,getFraudOutcomeTransactionsSummaryError:()=>wt,getTransactions:()=>lt,getTransactionsError:()=>mt,getTransactionsSummary:()=>_t,getTransactionsSummaryError:()=>yt});var a={};r.r(a),r.d(a,{updateErrorForFraudOutcomeTransactions:()=>It,updateErrorForFraudOutcomeTransactionsSummary:()=>Nt,updateErrorForTransactions:()=>Rt,updateErrorForTransactionsSummary:()=>bt,updateFraudOutcomeTransactions:()=>Ot,updateFraudOutcomeTransactionsSummary:()=>At,updateTransactions:()=>Tt,updateTransactionsSummary:()=>vt});var s={};r.r(s),r.d(s,{formatQueryFilters:()=>Ct,getFraudOutcomeTransactions:()=>Ft,getFraudOutcomeTransactionsExport:()=>Ut,getFraudOutcomeTransactionsSummary:()=>jt,getTransactions:()=>xt,getTransactionsCSVRequestURL:()=>Dt,getTransactionsSummary:()=>Mt,transactionsDownloadEndpoint:()=>Pt});var i={};r.r(i),r.d(i,{getCharge:()=>Lt,getChargeError:()=>zt,getChargeFromOrder:()=>$t,getChargeFromOrderError:()=>Bt});var c={};r.r(c),r.d(c,{updateCharge:()=>Yt,updateErrorForCharge:()=>qt});var d={};r.r(d),r.d(d,{getCharge:()=>Vt,getChargeFromOrder:()=>Ht});var u={};r.r(u),r.d(u,{getTimeline:()=>Wt,getTimelineError:()=>Qt});var l={};r.r(l),r.d(l,{updateErrorForTimeline:()=>Jt,updateTimeline:()=>Zt});var m={};r.r(m),r.d(m,{getTimeline:()=>Kt});var p={};r.r(p),r.d(p,{getCachedDispute:()=>nr,getDispute:()=>rr,getDisputeError:()=>or,getDisputes:()=>ar,getDisputesSummary:()=>sr});var _={};r.r(_),r.d(_,{refundCharge:()=>lr,updateErrorForPaymentIntent:()=>ur,updatePaymentIntent:()=>dr});var y={};r.r(y),r.d(y,{getPaymentIntent:()=>mr});var h={};r.r(h),r.d(h,{acceptDispute:()=>Sr,updateDispute:()=>pr,updateDisputes:()=>yr,updateDisputesSummary:()=>hr,updateErrorForDispute:()=>_r});var S={};r.r(S),r.d(S,{disputesDownloadEndpoint:()=>Rr,getDispute:()=>br,getDisputes:()=>Or,getDisputesCSVRequestURL:()=>vr,getDisputesSummary:()=>Ir});var g={};r.r(g),r.d(g,{getAccountBusinessSupportEmail:()=>qr,getAccountBusinessSupportPhone:()=>Vr,getAccountCommunicationsEmail:()=>Co,getAccountDomesticCurrency:()=>Hr,getAccountStatementDescriptor:()=>$r,getAccountStatementDescriptorKana:()=>Yr,getAccountStatementDescriptorKanji:()=>Br,getAdvancedFraudProtectionSettings:()=>vo,getAvailablePaymentMethodIds:()=>Ur,getCompletedWaitingPeriod:()=>Jr,getCurrentProtectionLevel:()=>Ro,getDepositDelayDays:()=>Zr,getDepositRestrictions:()=>Xr,getDepositScheduleInterval:()=>Gr,getDepositScheduleMonthlyAnchor:()=>Qr,getDepositScheduleWeeklyAnchor:()=>Wr,getDepositStatus:()=>Kr,getDuplicatedPaymentMethodIds:()=>Mr,getEnabledPaymentMethodIds:()=>jr,getExpressCheckoutCartMethods:()=>Po,getExpressCheckoutCheckoutMethods:()=>Do,getExpressCheckoutProductMethods:()=>xo,getIsCardPresentEligible:()=>yo,getIsDebugLogEnabled:()=>so,getIsDevModeEnabled:()=>oo,getIsExpressCheckoutInPaymentMethodsEnabled:()=>ao,getIsManualCaptureEnabled:()=>eo,getIsMultiCurrencyEnabled:()=>io,getIsPaymentRequestEnabled:()=>no,getIsSavedCardsEnabled:()=>po,getIsStripeBillingEnabled:()=>Oo,getIsStripeBillingMigrationInProgress:()=>Io,getIsSubscriptionsPluginActive:()=>go,getIsTestModeEnabled:()=>to,getIsTestModeOnboarding:()=>ro,getIsWCPayEnabled:()=>Fr,getIsWCPaySubscriptionsEligible:()=>So,getIsWCPaySubscriptionsEnabled:()=>ho,getIsWooPayEnabled:()=>Eo,getIsWooPayGlobalThemeSupportEnabled:()=>fo,getPaymentMethodStatuses:()=>kr,getPaymentRequestButtonBorderRadius:()=>mo,getPaymentRequestButtonSize:()=>uo,getPaymentRequestButtonTheme:()=>lo,getPaymentRequestButtonType:()=>co,getSavingError:()=>_o,getSettings:()=>Dr,getShowWooPayIncompatibilityNotice:()=>bo,getStripeBillingMigratedCount:()=>No,getStripeBillingSubscriptionCount:()=>Ao,getWooPayCustomMessage:()=>wo,getWooPayStoreLogo:()=>To,isDirty:()=>zr,isSavingSettings:()=>Lr});var E={};r.r(E),r.d(E,{saveOption:()=>vn,saveSettings:()=>ln,submitStripeBillingSubscriptionMigration:()=>Rn,updateAccountBusinessSupportEmail:()=>an,updateAccountBusinessSupportPhone:()=>sn,updateAccountCommunicationsEmail:()=>En,updateAccountStatementDescriptor:()=>rn,updateAccountStatementDescriptorKana:()=>nn,updateAccountStatementDescriptorKanji:()=>on,updateAdvancedFraudProtectionSettings:()=>Sn,updateDepositScheduleInterval:()=>cn,updateDepositScheduleMonthlyAnchor:()=>un,updateDepositScheduleWeeklyAnchor:()=>dn,updateEnabledPaymentMethodIds:()=>Go,updateExpressCheckoutCartMethods:()=>wn,updateExpressCheckoutCheckoutMethods:()=>Tn,updateExpressCheckoutProductMethods:()=>fn,updateIsCardPresentEligible:()=>ko,updateIsDebugLogEnabled:()=>Xo,updateIsExpressCheckoutInPaymentMethodsEnabled:()=>Ho,updateIsManualCaptureEnabled:()=>Jo,updateIsMultiCurrencyEnabled:()=>en,updateIsPaymentRequestEnabled:()=>Vo,updateIsSavedCardsEnabled:()=>Uo,updateIsSavingSettings:()=>Wo,updateIsStripeBillingEnabled:()=>gn,updateIsTestModeEnabled:()=>Ko,updateIsWCPayEnabled:()=>qo,updateIsWCPaySubscriptionsEnabled:()=>tn,updateIsWooPayEnabled:()=>mn,updateIsWooPayGlobalThemeSupportEnabled:()=>pn,updatePaymentRequestButtonBorderRadius:()=>Bo,updatePaymentRequestButtonSize:()=>zo,updatePaymentRequestButtonTheme:()=>$o,updatePaymentRequestButtonType:()=>Lo,updateProtectionLevel:()=>hn,updateSelectedPaymentMethod:()=>Qo,updateSettings:()=>Yo,updateUnselectedPaymentMethod:()=>Zo,updateWooPayCustomMessage:()=>_n,updateWooPayStoreLogo:()=>yn});var f={};r.r(f),r.d(f,{getSettings:()=>bn});var w={};r.r(w),r.d(w,{getCardReaderStats:()=>An,getCardReaderStatsError:()=>Nn,getCardReaders:()=>Cn});var T={};r.r(T),r.d(T,{updateCardReaderStats:()=>xn,updateCardReaders:()=>Pn,updateErrorForCardReaderStats:()=>Dn,updateErrorForCardReaders:()=>Mn});var R={};r.r(R),r.d(R,{getCardReaderStats:()=>Fn,getCardReaders:()=>jn});var v={};r.r(v),r.d(v,{getActiveLoanSummary:()=>Bn,getActiveLoanSummaryError:()=>Yn,getLoans:()=>qn,getLoansError:()=>Vn});var b={};r.r(b),r.d(b,{updateActiveLoanSummary:()=>Hn,updateErrorForActiveLoanSummary:()=>Gn,updateErrorForLoans:()=>Qn,updateLoans:()=>Wn});var O={};r.r(O),r.d(O,{getActiveLoanSummary:()=>Zn,getLoans:()=>Jn});var I={};r.r(I),r.d(I,{getDocuments:()=>ra,getDocumentsError:()=>oa,getDocumentsSummary:()=>aa,getDocumentsSummaryError:()=>sa});var A={};r.r(A),r.d(A,{updateDocuments:()=>ia,updateDocumentsSummary:()=>da,updateErrorForDocuments:()=>ca,updateErrorForDocumentsSummary:()=>ua});var N={};r.r(N),r.d(N,{formatQueryFilters:()=>la,getDocuments:()=>ma,getDocumentsSummary:()=>pa});var C={};r.r(C),r.d(C,{getPaymentIntent:()=>ya,getPaymentIntentError:()=>ha});var x={};r.r(x),r.d(x,{getAuthorization:()=>Ta,getAuthorizations:()=>wa,getAuthorizationsError:()=>Ra,getAuthorizationsSummary:()=>ba,getAuthorizationsSummaryError:()=>Oa,getIsRequesting:()=>Ia});var P={};r.r(P),r.d(P,{setIsRequestingAuthorization:()=>Da,submitCancelAuthorization:()=>Fa,submitCaptureAuthorization:()=>Ma,updateAuthorization:()=>xa,updateAuthorizations:()=>Na,updateAuthorizationsSummary:()=>Pa,updateErrorForAuthorizations:()=>Ca,updateErrorForAuthorizationsSummary:()=>ja});var D={};r.r(D),r.d(D,{getAuthorization:()=>ka,getAuthorizations:()=>Ua,getAuthorizationsSummary:()=>La});var M={};r.r(M),r.d(M,{getFile:()=>Ya,getFileError:()=>qa});var F={};r.r(F),r.d(F,{updateErrorForFiles:()=>Ha,updateFiles:()=>Va});var j={};r.r(j),r.d(j,{getFile:()=>Ga});var U={};r.r(U),r.d(U,{getPmPromotions:()=>Za,getPmPromotionsError:()=>Ja});var k={};r.r(k),r.d(k,{activatePmPromotion:()=>ts,dismissPmPromotion:()=>rs,updateErrorForPmPromotions:()=>es,updatePmPromotions:()=>Xa});var L={};r.r(L),r.d(L,{getPmPromotions:()=>ns});var z={};r.r(z),r.d(z,{getAvailableCurrencies:()=>ls,getCurrencies:()=>us,getCurrencySettings:()=>_s,getDefaultCurrency:()=>ps,getEnabledCurrencies:()=>ms,getStoreSettings:()=>ys,isSavingStoreSettings:()=>Ss,isStoreSettingsDirty:()=>hs});var $={};r.r($),r.d($,{saveOption:()=>Ns,saveStoreSettings:()=>As,submitCurrencySettings:()=>Is,submitEnabledCurrenciesUpdate:()=>Os,updateAvailableCurrencies:()=>Es,updateCurrencies:()=>gs,updateCurrencySettings:()=>Ts,updateDefaultCurrency:()=>ws,updateEnabledCurrencies:()=>fs,updateIsSavingStoreSettings:()=>bs,updateStoreSettingValues:()=>vs,updateStoreSettings:()=>Rs});var B={};r.r(B),r.d(B,{getCurrencies:()=>Cs,getCurrencySettings:()=>xs,getStoreSettings:()=>Ps});var Y=r(1609),q=r(5338);(0,Y.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""});var V=r(4848);(0,Y.createContext)({activeTask:"",setActiveTask:()=>null,completedTasks:{},setCompletedTasks:()=>null});const H=window.wp.components;function G(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=G(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const W=function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=G(e))&&(o&&(o+=" "),o+=t);return o},Q=window.wp.primitives,Z=({children:e,actions:t,className:r,...o})=>(0,V.jsxs)(H.Modal,{className:W("wcpay-confirmation-modal",r),...o,children:[e,(0,V.jsx)(Q.HorizontalRule,{className:"wcpay-confirmation-modal__separator"}),(0,V.jsx)("div",{className:"wcpay-confirmation-modal__footer",children:t})]}),J="https://cdn.sift.com/s.js",K=({beacon_key:e,session_id:t,user_id:r})=>{const o=window._sift=window._sift||[];if(o.push(["_setAccount",e]),o.push(["_setUserId",r]),o.push(["_setSessionId",t]),o.push(["_trackPageview"]),!document.querySelector(`[src="${J}"]`)){const e=document.createElement("script");e.src=J,e.async=!0,document.body.appendChild(e)}};(Object.getOwnPropertyDescriptor(K,"name")||{}).writable||Object.defineProperty(K,"name",{value:"default",configurable:!0});const X="https://js.stripe.com/v3",ee=()=>{if(!document.querySelector(`[src^="${X}"]`)){const e=document.createElement("script");e.src=X,e.async=!0,document.body.appendChild(e)}};(Object.getOwnPropertyDescriptor(ee,"name")||{}).writable||Object.defineProperty(ee,"name",{value:"default",configurable:!0});const te={sift:K,stripe:ee},re=e=>{for(const t in e){const r=te[t];r&&e[t]&&r(e[t])}};(Object.getOwnPropertyDescriptor(re,"name")||{}).writable||Object.defineProperty(re,"name",{value:"default",configurable:!0});const oe=window.wp.i18n;r(5955),r(9031),r(4275),Y.Component;const ne=({isLoading:e,display:t,placeholder:r,value:o,children:n,...a})=>e?(0,V.jsx)("span",{className:t?`is-loadable-placeholder is-${t}`:"is-loadable-placeholder","aria-busy":"true",...a,children:void 0===r?n||o:r}):(0,V.jsx)(V.Fragment,{children:n||o}),ae=({numLines:e,...t})=>{const r=(0,V.jsx)("p",{style:{lineHeight:e},children:"Block placeholder"});return(0,V.jsx)(ne,{...t,placeholder:r,display:"block","aria-hidden":!0})},se=({Icon:e,label:t})=>e?(0,V.jsxs)("span",{className:W("woocommerce-payments__payment-method-icon"),children:[(0,V.jsx)(e,{}),t&&(0,V.jsx)("span",{className:"woocommerce-payments__payment-method-icon__label",children:t})]}):null,ie=({children:e})=>(0,V.jsx)("div",{className:"wcpay-settings-layout",children:e}),ce=({description:e=()=>null,children:t,className:r,id:o})=>(0,V.jsxs)("div",{className:W("settings-section",r),id:o,children:[(0,V.jsx)("div",{className:"settings-section__details",children:(0,V.jsx)(e,{})}),(0,V.jsx)("div",{className:"settings-section__controls",children:t})]}),de=window.wp.domReady;var ue=r.n(de);const le=(e,t={})=>{if(window.wcpaySettings){Object.assign(t,{is_test_mode:wcpaySettings.testMode,jetpack_connected:wcpaySettings.isJetpackConnected,wcpay_version:wcpaySettings.version,woo_country_code:wcpaySettings.connect.country,hosting_provider:wcpaySettings.trackingInfo?.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}ue()(()=>{(wc?.tracks?.recordEvent??wcTracks.recordEvent)(e,t)})};(0,Y.createContext)(window.wcpaySettings);const me=window.wc.currency;var pe=r.n(me);const _e=window.lodash;(0,oe.__)("Australian dollar","woocommerce-payments"),(0,oe.__)("Canadian dollar","woocommerce-payments"),(0,oe.__)("Swiss franc","woocommerce-payments"),(0,oe.__)("Danish krone","woocommerce-payments"),(0,oe.__)("Euro","woocommerce-payments"),(0,oe.__)("Pound sterling","woocommerce-payments"),(0,oe.__)("Norwegian krone","woocommerce-payments"),(0,oe.__)("New Zealand dollar","woocommerce-payments"),(0,oe.__)("Swedish krona","woocommerce-payments"),(0,oe.__)("United States (US) dollar","woocommerce-payments");const ye=e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase()),he=(e,t="USD",r=null,o=!1)=>{const n=ye(t);n||(e/=100);const a=e<0,s=a?-1*e:e,i=a?"-":"",c=o?(e=>{const t=e.toUpperCase(),{currencyData:r,connect:{country:o="US"}}=wcpaySettings;if(r[o]?.code===t)return pe()(r[o]);const n=(0,_e.find)(r,{code:t});if(n){const{defaultLocale:e={}}=n;return e.hasOwnProperty("decimalSeparator")&&e.hasOwnProperty("thousandSeparator")&&e.hasOwnProperty("symbolPosition")&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition),pe()(n)}return null})(t):((e,t=null)=>{const{currencyData:r,connect:{country:o="US"}}=wcpaySettings,n=(0,_e.find)(r,{code:e.toUpperCase()});if(n){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||r[o]){const e=t?(0,_e.find)(r,{code:t.toUpperCase()}):r[o];e&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition)}return pe()(n)}return null})(t,r);if(null===c)return i+Se(s,t,n);try{return i+("function"==typeof c.formatAmount?ge(c.formatAmount(s)):ge(c.formatCurrency(s)))}catch(e){return i+ge(Se(s,t,n))}};function Se(e,t,r){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:r})}catch(o){return(0,oe.sprintf)(r?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function ge(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}const Ee=window.wp.data,fe=window.wp.dataControls,we="/wc/v3/payments",Te="wc/payments",Re={SET_DEPOSIT:"SET_DEPOSIT",SET_DEPOSITS:"SET_DEPOSITS",SET_DEPOSITS_COUNT:"SET_DEPOSITS_COUNT",SET_ERROR_FOR_DEPOSIT_QUERY:"SET_ERROR_FOR_DEPOSIT_QUERY",SET_DEPOSITS_SUMMARY:"SET_DEPOSITS_SUMMARY",SET_ERROR_FOR_DEPOSITS_SUMMARY:"SET_ERROR_FOR_DEPOSITS_SUMMARY",SET_INSTANT_DEPOSIT:"SET_INSTANT_DEPOSIT",SET_ALL_DEPOSITS_OVERVIEWS:"SET_ALL_DEPOSITS_OVERVIEWS",SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:"SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS"},ve=e=>JSON.stringify(e,Object.keys(e).sort()),be={byId:{},queries:{},count:0,instant:{}},Oe=e=>e&&e.deposits||{},Ie=(e,t)=>(Oe(e).byId||{})[t],Ae=e=>{const t=Oe(e).overviews||{};if(!t.data)return{account:null,currencies:[]};const{deposit:r,balance:o,account:n}=t.data,a={lastPaid:r.last_paid,pending:o.pending,available:o.available,instant:o.instant},s={};for(const[e,t]of Object.entries(a))t?.forEach(t=>{const{currency:r}=t;s[r]||(s[r]={currency:r,lastPaid:void 0,pending:void 0,available:void 0,instant:void 0}),s[r][e]=t});const i=Object.values(s);return{account:n,currencies:[...i.filter(e=>n.default_currency===e.currency),...i.filter(e=>n.default_currency!==e.currency)]}},Ne=e=>(Oe(e).overviews||{}).error,Ce=(e,t)=>{const r=ve(t);return(Oe(e).queries||{})[r]||{}},xe=(e,t)=>(Ce(e,t).data||[]).map(Ie.bind(void 0,e)),Pe=e=>Oe(e).count,De=(e,t)=>Ce(e,t).error||{},Me=(e,t)=>{const r=ve(t);return(Oe(e).summary||{})[r]||{}},Fe=(e,t)=>Me(e,t).data||{},je=(e,t)=>Me(e,t).error||{},Ue=e=>(Oe(e).instant||{}).data,ke=window.wp.url,Le=window.moment;var ze=r.n(Le);const $e=window.wp.date;window.wc.number;const Be=e=>(0,ke.addQueryArgs)("admin.php",e),Ye=(e,t=!1)=>{const r=t?ze()(e).endOf("day").utc().toISOString():ze()(e).startOf("day").utc().toISOString();return e&&(0,$e.dateI18n)("Y-m-d H:i:s",r,!0)};function qe(e){return{type:Re.SET_DEPOSIT,data:e}}function Ve(e){return{type:Re.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function He(e,t){return{type:Re.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function Ge(e,t){return{type:Re.SET_DEPOSITS,query:e,data:t}}function We(e){return{type:Re.SET_DEPOSITS_COUNT,data:e}}function Qe(e,t,r){return{type:Re.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:r}}function Ze(e,t){return{type:Re.SET_DEPOSITS_SUMMARY,query:e,data:t}}function Je(e,t,r){return{type:Re.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:r}}function Ke(e){return{type:Re.SET_INSTANT_DEPOSIT,data:e}}function*Xe(e){try{yield(0,Ee.dispatch)(Te).startResolution("getInstantDeposit",[e]);const t=yield(0,fe.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield Ke(t),yield(0,Ee.dispatch)(Te).invalidateResolutionForStoreSelector("getDeposits"),yield(0,Ee.dispatch)(Te).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,Ee.dispatch)("core/notices").createSuccessNotice((0,oe.sprintf)((0,oe.__)("Instant payout for %s in transit.","woocommerce-payments"),he(t.amount)),{actions:[{label:(0,oe.__)("View details","woocommerce-payments"),url:Be({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,Ee.dispatch)(Te).finishResolution("getInstantDeposit",[e])}}function*et(e){if(/\W/.test(e))return;const t=(0,ke.addQueryArgs)(`${we}/deposits/${e}`);try{const e=yield(0,fe.apiFetch)({path:t});yield qe(e)}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving payout.","woocommerce-payments"))}}function*tt(){const e=(0,ke.addQueryArgs)(`${we}/deposits/overview-all`);try{const t=yield(0,fe.apiFetch)({path:e});yield Ve(t)}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield He()}}const rt=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Ye(e.dateBefore,!0),date_after:Ye(e.dateAfter),date_between:e.dateBetween&&[Ye(e.dateBetween[0]),Ye(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),ot=`${we}/deposits/download`;function nt(e){return(0,ke.addQueryArgs)(ot,rt(e))}function*at(e){const t=(0,ke.addQueryArgs)(`${we}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...rt(e)});try{const r=yield(0,fe.apiFetch)({path:t})||{};yield Ge(e,r.data),yield We(r.total_count);for(const e in r.data)yield Ee.controls.dispatch(Te,"finishResolution","getDeposit",[r.data[e].id])}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving payouts.","woocommerce-payments")),yield Qe(e,null,t)}}function*st(e){const t=(0,ke.addQueryArgs)(`${we}/deposits/summary`,rt(e));try{const r=yield(0,fe.apiFetch)({path:t});yield Ze(e,r)}catch(t){yield Je(e,null,t)}}const it={SET_TRANSACTIONS:"SET_TRANSACTIONS",SET_ERROR_FOR_TRANSACTIONS:"SET_ERROR_FOR_TRANSACTIONS",SET_TRANSACTIONS_SUMMARY:"SET_TRANSACTIONS_SUMMARY",SET_ERROR_FOR_TRANSACTIONS_SUMMARY:"SET_ERROR_FOR_TRANSACTIONS_SUMMARY",SET_FRAUD_OUTCOME_TRANSACTIONS:"SET_FRAUD_OUTCOME_TRANSACTIONS",SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:"SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS",SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:"SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY",SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:"SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY"},ct={summary:{},fraudProtection:{review:{summary:{}},block:{summary:{}}}},dt=e=>e&&e.transactions||{},ut=(e,t)=>{const r=ve(t);return dt(e)[r]||{}},lt=(e,t)=>ut(e,t).data||[],mt=(e,t)=>ut(e,t).error||{},pt=(e,t)=>{const r=ve(t);return dt(e).summary[r]||{}},_t=(e,t)=>pt(e,t).data||{},yt=(e,t)=>pt(e,t).error||{},ht=(e,t,r)=>{const o=ve(r);return dt(e).fraudProtection?.[t]?.[o]||{}},St=(e,t,r)=>ht(e,t,r).data||[],gt=(e,t,r)=>ht(e,t,r).error||{},Et=(e,t,r)=>{const o=ve(r);return dt(e).fraudProtection?.[t]?.summary[o]||{}},ft=(e,t,r)=>Et(e,t,r).data||{},wt=(e,t,r)=>Et(e,t,r).error||{};function Tt(e,t){return{type:it.SET_TRANSACTIONS,query:e,data:t}}function Rt(e,t,r){return{type:it.SET_ERROR_FOR_TRANSACTIONS,query:e,data:t,error:r}}function vt(e,t){return{type:it.SET_TRANSACTIONS_SUMMARY,query:e,data:t}}function bt(e,t,r){return{type:it.SET_ERROR_FOR_TRANSACTIONS_SUMMARY,query:e,data:t,error:r}}function Ot(e,t,r){return{type:it.SET_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:r}}function It(e,t,r){return{type:it.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:null,error:r}}function At(e,t,r){return{type:it.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:r}}function Nt(e,t,r){return{type:it.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:null,error:r}}const Ct=e=>({user_email:e.userEmail,match:e.match,date_before:Ye(e.dateBefore,!0),date_after:Ye(e.dateAfter),date_between:e.dateBetween&&[Ye(e.dateBetween[0]),Ye(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot,type_is_in:e.typeIsIn,source_device_is:e.sourceDeviceIs,source_device_is_not:e.sourceDeviceIsNot,channel_is:e.channelIs,channel_is_not:e.channelIsNot,customer_country_is:e.customerCountryIs,customer_country_is_not:e.customerCountryIsNot,risk_level_is:e.riskLevelIs,risk_level_is_not:e.riskLevelIsNot,store_currency_is:e.storeCurrencyIs,loan_id_is:e.loanIdIs,deposit_id:e.depositId,customer_currency_is:e.customerCurrencyIs,customer_currency_is_not:e.customerCurrencyIsNot,source_is:e.sourceIs,source_is_not:e.sourceIsNot,search:e.search,user_timezone:ze()(new Date).format("Z"),locale:e.locale});function*xt(e){const t=(0,ke.addQueryArgs)(`${we}/transactions`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Ct(e)});try{const r=yield(0,fe.apiFetch)({path:t});yield Tt(e,r.data||[])}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving transactions.","woocommerce-payments")),yield Rt(e,null,t)}}const Pt=`${we}/transactions/download`;function Dt(e){return(0,ke.addQueryArgs)(Pt,Ct(e))}function*Mt(e){const t=(0,ke.addQueryArgs)(`${we}/transactions/summary`,Ct(e));try{const r=yield(0,fe.apiFetch)({path:t});yield vt(e,r)}catch(t){yield bt(e,null,t)}}function*Ft(e,t){const r=(0,ke.addQueryArgs)(`${we}/transactions/fraud-outcomes`,{status:e,page:t.paged,sort:t.orderby,pagesize:t.perPage,direction:t.order,additional_status:t.additionalStatus,...Ct(t)});try{const o=yield(0,fe.apiFetch)({path:r});yield Ot(e,t,o.data||[])}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield Ot(e,t,[]));yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving transactions.","woocommerce-payments")),yield It(e,t,r)}}function*jt(e,t){const r=(0,ke.addQueryArgs)(`${we}/transactions/fraud-outcomes/summary`,{status:e,additional_status:t.additionalStatus}),o={count:0,total:0};try{const n=yield(0,fe.apiFetch)({path:r});yield At(e,t,n||o)}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield At(e,t,o));yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving on review transactions.","woocommerce-payments")),yield Nt(e,t,r)}}function Ut(e,t){return(0,ke.addQueryArgs)(`${we}/transactions/fraud-outcomes/download`,{status:e,sort:t.orderby,direction:t.order,additional_status:t.additionalStatus,...Ct(t)})}const kt={SET_CHARGE:"SET_CHARGE",SET_ERROR_FOR_CHARGE:"SET_ERROR_FOR_CHARGE"},Lt=(e,t)=>e.charges[t]&&e.charges[t].data?e.charges[t].data:{},zt=(e,t)=>e.charges[t]&&e.charges[t].error?e.charges[t].error:{},$t=(e,t)=>Lt(e,t),Bt=(e,t)=>zt(e,t);function Yt(e,t){return{type:kt.SET_CHARGE,id:e,data:t}}function qt(e,t,r){return{type:kt.SET_ERROR_FOR_CHARGE,id:e,data:t,error:r}}function*Vt(e){try{const t=yield(0,fe.apiFetch)({path:`${we}/charges/${e}`});yield Yt(e,t)}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving transaction.","woocommerce-payments")),yield qt(e,null,t)}}function*Ht(e){try{const t=yield(0,fe.apiFetch)({path:`${we}/charges/order/${e}`});yield Yt(e,t)}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving transaction.","woocommerce-payments")),yield qt(e,null,t)}}const Gt={SET_TIMELINE:"SET_TIMELINE",SET_ERROR_FOR_TIMELINE:"SET_ERROR_FOR_TIMELINE"},Wt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].data?e.timeline[t].data:{},Qt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].error?e.timeline[t].error:{};function Zt(e,t){return{id:e,type:Gt.SET_TIMELINE,data:t}}function Jt(e,t){return{id:e,type:Gt.SET_ERROR_FOR_TIMELINE,error:t}}function*Kt(e){try{const t=yield(0,fe.apiFetch)({path:`${we}/timeline/${e}`});yield Zt(e,t.data)}catch(t){yield Jt(e,t)}}const Xt={SET_DISPUTE:"SET_DISPUTE",SET_ERROR_FOR_DISPUTE:"SET_ERROR_FOR_DISPUTE",SET_DISPUTES:"SET_DISPUTES",SET_DISPUTES_SUMMARY:"SET_DISPUTES_SUMMARY"},er={byId:{},queries:{},summary:{},cached:{}},tr=e=>e&&e.disputes||{},rr=(e,t)=>(tr(e).byId||{})[t],or=(e,t)=>{const r=tr(e).byId||{};return r[t]?.error},nr=(e,t)=>(tr(e).cached||{})[t],ar=(e,t)=>{const r=((e,t)=>{const r=ve(t);return(tr(e).queries||{})[r]||{}})(e,t).data||[];return r.map(nr.bind(void 0,e))},sr=(e,t)=>((e,t)=>{const r=ve(t);return(tr(e).summary||{})[r]||{}})(e,t).data||{};var ir=function(e){return e.SET_PAYMENT_INTENT="SET_PAYMENT_INTENT",e.SET_ERROR_FOR_PAYMENT_INTENT="SET_ERROR_FOR_PAYMENT_INTENT",e}(ir||{});const cr=ir;function dr(e,t){return{type:cr.SET_PAYMENT_INTENT,id:e,data:t}}function ur(e,t){return{type:cr.SET_ERROR_FOR_PAYMENT_INTENT,id:e,error:t}}function*lr(e,t){const r=e.payment_intent;try{yield(0,fe.apiFetch)({path:"/wc/v3/payments/refund/",method:"post",data:{charge_id:e.id,amount:e.amount,reason:t,order_id:e?.order?.id}}),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getTimeline"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield Ee.controls.dispatch("core/notices","createSuccessNotice",(0,oe.sprintf)((0,oe.__)("Refunded payment #%s.","woocommerce-payments"),r))}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.sprintf)((0,oe.__)("There has been an error refunding the payment #%s. Please try again later.","woocommerce-payments"),r))}}function*mr(e){try{const t=yield(0,fe.apiFetch)({path:`${we}/payment_intents/${e}`});yield dr(e,t)}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving transaction.","woocommerce-payments")),yield ur(e,t)}}function pr(e){return{type:Xt.SET_DISPUTE,data:e}}function _r(e,t,r){return{type:Xt.SET_ERROR_FOR_DISPUTE,id:e,data:t,error:r}}function yr(e,t){return{type:Xt.SET_DISPUTES,query:e,data:t}}function hr(e,t){return{type:Xt.SET_DISPUTES_SUMMARY,query:e,data:t}}function*Sr(e){const{id:t,payment_intent:r}=e;try{yield Ee.controls.dispatch(Te,"startResolution","getDispute",[t]);const e=yield(0,fe.apiFetch)({path:`${we}/disputes/${t}/close`,method:"post"});yield pr(e),yield mr(r),yield Ee.controls.dispatch(Te,"finishResolution","getDispute",[t]);const o=e.order?(0,oe.sprintf)((0,oe.__)("You have accepted the dispute for order #%s.","woocommerce-payments"),e.order.number):(0,oe.__)("You have accepted the dispute.","woocommerce-payments");yield Ee.controls.dispatch("core/notices","createSuccessNotice",o)}catch(e){const r=(0,oe.__)("There has been an error accepting the dispute. Please try again later.","woocommerce-payments");yield Ee.controls.dispatch("core/notices","createErrorNotice",r),yield Ee.controls.dispatch(Te,"finishResolution","getDispute",[t])}}(0,oe.__)("Bank cannot process","woocommerce-payments"),(0,oe.__)("Check returned","woocommerce-payments"),(0,oe.__)("Credit not processed","woocommerce-payments"),(0,oe.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,oe.__)("If your customer was not refunded appropriately, you will need to accept the dispute, or resolve the issue with your customer. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,oe.__)("The customer claims that the purchased product was returned or the transaction was otherwise canceled, but you have not yet provided a refund or credit.","woocommerce-payments"),(0,oe.__)("Demonstrate that you have refunded your customer through other means or that your customer is not entitled to a refund. You cannot issue a refund while a payment is being disputed. If you believe that your customer was entitled a refund that you did not provide, you can accept the dispute.","woocommerce-payments"),(0,oe.__)("You should first get in touch with your customer. If you understand what their complaint is, there is a chance for you to explain the misunderstanding or to make it right. If you’re able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,oe.__)("If the cardholder agrees to withdraw the dispute, you should still submit evidence for the dispute using the forms on the next screen. In addition to the following evidence, your submission should include correspondence with the cardholder saying they would withdraw the dispute and a written statement from their card issuer confirming that the dispute has been withdrawn.","woocommerce-payments"),(0,oe.__)("The cardholder claims a credit was not processed.","woocommerce-payments"),(0,oe.__)("Customer initiated","woocommerce-payments"),(0,oe.__)("Debit not authorized","woocommerce-payments"),(0,oe.__)("Duplicate","woocommerce-payments"),(0,oe.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,oe.__)("If there were duplicate payments, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,oe.__)("The customer claims they were charged multiple times for the same product or service.","woocommerce-payments"),(0,oe.__)("Demonstrate that each payment was for a separate product or service.","woocommerce-payments"),(0,oe.__)("Determine if your customer was incorrectly charged multiple times.","woocommerce-payments"),(0,oe.__)("If they were not, collect any and all information documenting that each payment was made separately, such as copies of receipts. If the receipts don’t include the items purchased, be sure to include an itemized list. Each receipt should clearly indicate that the payments are for separate purchases of items or services. If you’ve been able to get in touch with the customer you should be sure to address any concerns they had in your evidence.","woocommerce-payments"),(0,oe.__)("If there have been two or more separate payments, you should get in touch with your customer. If you understand what their complaint is, there is a chance for you to explain the misunderstanding or to make it right. If you’re able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,oe.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,oe.__)("The cardholder claims this is a duplicate transaction.","woocommerce-payments"),(0,oe.__)("Transaction unauthorized","woocommerce-payments"),(0,oe.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,oe.__)("If you believe the payment was actually made using a stolen credit card, you will need to accept the dispute. The credit card networks place liability for accepting unauthorized transactions with you, the business.","woocommerce-payments"),(0,oe.__)("This is the most common reason for a dispute, and happens when a cardholder claims that they didn’t authorize the payment. This can happen if the card was lost or stolen and used to make an unauthorized transaction. It can also happen if the cardholder doesn’t recognize the payment as it appears on the billing statement from their card issuer.","woocommerce-payments"),(0,oe.__)("Provide adequate payment and order details so that a legitimate customer recognizes it, or proves to the card issuer that their cardholder authorized the transaction.","woocommerce-payments"),(0,oe.__)("Try to get in touch with your customer. Sometimes people forget about payments they make or don’t recognize the way they appear on their card statement. If this is the case, ask them to contact their card issuer and let them know they no longer dispute the transaction.","woocommerce-payments"),(0,oe.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,oe.__)("It may be more efficient—and provide a better customer experience—to accept an accidental dispute and charge the customer again, if appropriate. Even when a dispute is withdrawn, it usually takes approximately 75 days to be finalized. Remember, it doesn’t matter to the card networks whether you win or lose a dispute; what matters is how many disputes a business receives, regardless of how many disputes are won.","woocommerce-payments"),(0,oe.__)("The cardholder claims this is an unauthorized transaction.","woocommerce-payments"),(0,oe.__)("General","woocommerce-payments"),(0,oe.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,oe.__)("This is an uncategorized dispute, so you should contact the customer for additional details to find out why the payment was disputed.","woocommerce-payments"),(0,oe.__)("Incorrect account details","woocommerce-payments"),(0,oe.__)("Insufficient funds","woocommerce-payments"),(0,oe.__)("Product not received","woocommerce-payments"),(0,oe.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,oe.__)("If you can not prove the customer received their product or service, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,oe.__)("The customer claims they did not receive the products or services purchased.","woocommerce-payments"),(0,oe.__)("Prove that the customer received a physical product or offline service, or made use of a digital product or online service. This must have occurred prior to the date the dispute was initiated.","woocommerce-payments"),(0,oe.__)("First, get in touch with your customer. Understanding why they filed the dispute will be important for helping make sure your customer gets the product and will give you critical information to prevent this from happening to others.","woocommerce-payments"),(0,oe.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,oe.__)("The cardholder claims they did not receive the product.","woocommerce-payments"),(0,oe.__)("Product unacceptable","woocommerce-payments"),(0,oe.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,oe.__)("If you can not prove the customer received their product or service as described, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,oe.__)("The product or service was received but was defective, damaged, or not as described.","woocommerce-payments"),(0,oe.__)("Demonstrate that the product or service was delivered as described at the time of purchase.","woocommerce-payments"),(0,oe.__)("If the product or service is as described, provide specific information (invoice, contract, etc.) to refute the cardholder’s claims. Quality disputes are where the customer does not agree with the condition of merchandise or service received (e.g., a car repair situation or quality of a hotel room). There may be instances where you will need to obtain a neutral third-party opinion to help corroborate your claim against the cardholder. Provide as much specific information and documentation as possible to refute the cardholder’s claims. It is recommended that you address each point that the cardholder has made.","woocommerce-payments"),(0,oe.__)("If the customer has not yet returned the product or canceled the service, provide specific information to that effect. You should double-check your incoming shipping records to verify that you have not received a return before you respond. If you have processed a credit or reversal for this transaction, provide evidence of this which includes the amount and date processed.","woocommerce-payments"),(0,oe.__)("For products that have been repaired or replaced, provide evidence that the cardholder agreed to a repair or replacement, it has been received by the customer, and the repair or replacement has not since been disputed.","woocommerce-payments"),(0,oe.__)("If your customer made no attempt to return the product or cancel the service, or if you provided a replacement product or service, make sure to note that as well.","woocommerce-payments"),(0,oe.__)("If the customer withdraws their dispute you should still submit evidence using the forms on the next screen. Be sure to provide a letter or email from the cardholder stating that they are no longer in dispute.","woocommerce-payments"),(0,oe.__)("The cardholder claims the product was unacceptable.","woocommerce-payments"),(0,oe.__)("Subscription canceled","woocommerce-payments"),(0,oe.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,oe.__)("If you can not prove the customer’s subscription was canceled, and or they did not follow your cancellation policy, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,oe.__)("The customer claims that you continued to charge them after a subscription was canceled.","woocommerce-payments"),(0,oe.__)("Prove that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,oe.__)("First, get in touch with your customer. If you understand what they believe happened, there is a chance for you to explain the misunderstanding or to make it right. ","woocommerce-payments"),(0,oe.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,oe.__)("Otherwise, use the forms on the next screen to submit evidence that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,oe.__)("The cardholder claims a subscription was canceled.","woocommerce-payments"),(0,oe.__)("Unrecognized","woocommerce-payments"),(0,oe.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,oe.__)("If you can not prove the customer’s subscription was canceled, and or they did not follow your cancellation policy, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments"),(0,oe.__)("The customer doesn’t recognize the payment appearing on their card statement.","woocommerce-payments"),(0,oe.__)("Get your customer to withdraw the dispute by helping them identify the payment. Otherwise, challenge the dispute with appropriate evidence that proves the purchase was legitimate. ","woocommerce-payments"),(0,oe.__)("First, try to get in touch with your customer. Sometimes people forget about payments they make or don’t recognize the way they appear on their card statement. If this is the case, ask them to contact their card issuer and let them know they no longer dispute the transaction. Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,oe.__)("It may be more efficient—and provide a better customer experience—to accept an accidental dispute and charge the customer again, if appropriate. Even when a dispute is withdrawn, it usually takes approximately 75 days to be finalized. Remember, it doesn’t matter to the card networks whether you win or lose a dispute; what matters is how many disputes a business receives, regardless of how many disputes are won.","woocommerce-payments"),(0,oe.__)("Non-compliant","woocommerce-payments"),(0,oe.__)("Your customer’s bank claims this payment violates Visa’s rules.","woocommerce-payments"),(0,oe.__)("This transaction is being reviewed under Visa’s network compliance rules.","woocommerce-payments");const gr={warning_needs_response:(0,oe.__)("Inquiry: Response needed","woocommerce-payments"),warning_under_review:(0,oe.__)("Inquiry: Under review","woocommerce-payments"),warning_closed:(0,oe.__)("Inquiry: Closed","woocommerce-payments"),needs_response:(0,oe.__)("Response needed","woocommerce-payments"),under_review:(0,oe.__)("Under review","woocommerce-payments"),charge_refunded:(0,oe.__)("Charge refunded","woocommerce-payments"),won:(0,oe.__)("Won","woocommerce-payments"),lost:(0,oe.__)("Lost","woocommerce-payments")},Er=(Object.entries(gr).map(([e,t])=>({label:t,value:e})).filter(function(e){return null!=e}),["needs_response","warning_needs_response"]),fr=((0,oe.__)("Dispute currency","woocommerce-payments"),(0,oe.__)("All currencies","woocommerce-payments"),(0,oe.__)("Show","woocommerce-payments"),(0,oe.__)("Needs response","woocommerce-payments"),(0,oe.__)("All disputes","woocommerce-payments"),(0,oe.__)("Advanced filters","woocommerce-payments"),(()=>{const e=window.wc?.wcSettings,t=e?.getSetting?.("wcVersion");return null==t?"":String(t)})()),wr=parseFloat(fr),Tr=(wr<7.8?(0,oe.__)("Disputes match {{select /}} filters","woocommerce-payments"):(0,oe.__)("Disputes match <select /> filters","woocommerce-payments"),(0,oe.__)("Disputed on date","woocommerce-payments"),(0,oe.__)("Remove dispute date filter","woocommerce-payments"),(0,oe.__)("Select a dispute date filter match","woocommerce-payments"),wr<7.8?(0,oe.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,oe.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),(0,oe.__)("Select a dispute date","woocommerce-payments"),(0,oe.__)("Before","woocommerce-payments"),(0,oe.__)("After","woocommerce-payments"),(0,oe.__)("Between","woocommerce-payments"),(0,oe.__)("Status","woocommerce-payments"),(0,oe.__)("Remove dispute status filter","woocommerce-payments"),(0,oe.__)("Select a dispute status filter match","woocommerce-payments"),wr<7.8?(0,oe.__)("{{title}}Status{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,oe.__)("<title>Status</title> <rule /> <filter />","woocommerce-payments"),(0,oe.__)("Select a dispute status","woocommerce-payments"),(0,oe._x)("Is","dispute status","woocommerce-payments"),(0,oe._x)("Is not","dispute status","woocommerce-payments"),e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Ye(e.dateBefore,!0),date_after:Ye(e.dateAfter),date_between:e.dateBetween&&[Ye(e.dateBetween[0]),Ye(e.dateBetween[1],!0)],search:"awaiting_response"===e.filter?Er:e.search,status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale})),Rr=`${we}/disputes/download`;function vr(e){return(0,ke.addQueryArgs)(Rr,Tr(e))}function*br(e){const t=(0,ke.addQueryArgs)(`${we}/disputes/${e}`);try{const e=yield(0,fe.apiFetch)({path:t});yield pr(e)}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving dispute.","woocommerce-payments")),yield _r(e,void 0,t)}}function*Or(e){const t=(0,ke.addQueryArgs)(`${we}/disputes`,{page:e.paged,pagesize:e.perPage,sort:(0,_e.snakeCase)(e.orderBy),direction:e.order,...Tr(e)});try{const r=yield(0,fe.apiFetch)({path:t})||{};yield yr(e,r.data)}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving disputes.","woocommerce-payments"))}}function*Ir(e){const t=(0,ke.addQueryArgs)(`${we}/disputes/summary`,{page:e.paged,pagesize:e.perPage,...Tr(e)});try{const r=yield(0,fe.apiFetch)({path:t});yield hr(e,r)}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving the summary of disputes.","woocommerce-payments"))}}const Ar={SET_SETTINGS:"SET_SETTINGS",SET_SETTINGS_VALUES:"SET_SETTINGS_VALUES",SET_IS_SAVING_SETTINGS:"SET_IS_SAVING_SETTINGS",SET_SELECTED_PAYMENT_METHOD:"SET_SELECTED_PAYMENT_METHOD",SET_UNSELECTED_PAYMENT_METHOD:"SET_UNSELECTED_PAYMENT_METHOD"},Nr={isDirty:!1,isSaving:!1,savingError:null,data:{}},Cr={},xr=[],Pr=e=>e&&e.settings||Cr,Dr=e=>Pr(e).data||Cr,Mr=e=>Dr(e).duplicated_payment_method_ids||Cr,Fr=e=>Dr(e).is_wcpay_enabled||!1,jr=e=>Dr(e).enabled_payment_method_ids||xr,Ur=e=>Dr(e).available_payment_method_ids||xr,kr=e=>Dr(e).payment_method_statuses||Cr,Lr=e=>Pr(e).isSaving||!1,zr=e=>Pr(e).isDirty||!1,$r=e=>Dr(e).account_statement_descriptor||"",Br=e=>Dr(e).account_statement_descriptor_kanji||"",Yr=e=>Dr(e).account_statement_descriptor_kana||"",qr=e=>Dr(e).account_business_support_email||"",Vr=e=>Dr(e).account_business_support_phone||"",Hr=e=>Dr(e).account_domestic_currency||"",Gr=e=>Dr(e).deposit_schedule_interval||"",Wr=e=>Dr(e).deposit_schedule_weekly_anchor||"",Qr=e=>Dr(e).deposit_schedule_monthly_anchor||"",Zr=e=>Dr(e).deposit_delay_days||"7",Jr=e=>Dr(e).deposit_completed_waiting_period||!1,Kr=e=>Dr(e).deposit_status||"",Xr=e=>Dr(e).deposit_restrictions||"",eo=e=>Dr(e).is_manual_capture_enabled||!1,to=e=>Dr(e).is_test_mode_enabled||!1,ro=e=>Dr(e).is_test_mode_onboarding||!1,oo=e=>Dr(e).is_dev_mode_enabled||!1,no=e=>Dr(e).is_payment_request_enabled||!1,ao=e=>Dr(e).is_express_checkout_in_payment_methods_enabled||!1,so=e=>Dr(e).is_debug_log_enabled||!1,io=e=>Dr(e).is_multi_currency_enabled||!1,co=e=>Dr(e).payment_request_button_type||"",uo=e=>Dr(e).payment_request_button_size||"",lo=e=>Dr(e).payment_request_button_theme||"",mo=e=>{const t=Dr(e)?.payment_request_button_border_radius;return 0===t||"0"===t||t?t:"undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10)},po=e=>Dr(e).is_saved_cards_enabled||!1,_o=e=>Pr(e).savingError,yo=e=>Dr(e).is_card_present_eligible||!1,ho=e=>Dr(e).is_wcpay_subscriptions_enabled||!1,So=e=>Dr(e).is_wcpay_subscriptions_eligible||!1,go=e=>Dr(e).is_subscriptions_plugin_active||!1,Eo=e=>Dr(e).is_woopay_enabled||!1,fo=e=>Dr(e).is_woopay_global_theme_support_enabled||!1,wo=e=>Dr(e).woopay_custom_message||"",To=e=>Dr(e).woopay_store_logo||"",Ro=e=>Dr(e).current_protection_level||"basic",vo=e=>Dr(e).advanced_fraud_protection_settings||xr,bo=e=>Dr(e).show_woopay_incompatibility_notice||!1,Oo=e=>Dr(e).is_stripe_billing_enabled||!1,Io=e=>Dr(e).is_migrating_stripe_billing||!1,Ao=e=>Dr(e).stripe_billing_subscription_count||0,No=e=>Dr(e).stripe_billing_migrated_count||0,Co=e=>Dr(e).account_communications_email||"",xo=e=>Dr(e).express_checkout_product_methods||xr,Po=e=>Dr(e).express_checkout_cart_methods||xr,Do=e=>Dr(e).express_checkout_checkout_methods||xr,Mo=window.wp.apiFetch;var Fo=r.n(Mo);function jo(e){return{type:Ar.SET_SETTINGS_VALUES,payload:e}}function Uo(e){return jo({is_saved_cards_enabled:e})}function ko(e){return jo({is_card_present_eligible:e})}function Lo(e){return jo({payment_request_button_type:e})}function zo(e){return jo({payment_request_button_size:e})}function $o(e){return jo({payment_request_button_theme:e})}function Bo(e){return jo({payment_request_button_border_radius:e})}function Yo(e){return{type:Ar.SET_SETTINGS,data:e}}function qo(e){return jo({is_wcpay_enabled:e})}function Vo(e){return jo({is_payment_request_enabled:e})}function Ho(e){return jo({is_express_checkout_in_payment_methods_enabled:e})}function Go(e){return jo({enabled_payment_method_ids:[...e]})}function Wo(e,t){return{type:Ar.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function Qo(e){return{type:Ar.SET_SELECTED_PAYMENT_METHOD,id:e}}function Zo(e){return{type:Ar.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function Jo(e){return jo({is_manual_capture_enabled:e})}function Ko(e){return jo({is_test_mode_enabled:e})}function Xo(e){return jo({is_debug_log_enabled:e})}function en(e){return jo({is_multi_currency_enabled:e})}function tn(e){return jo({is_wcpay_subscriptions_enabled:e})}function rn(e){return jo({account_statement_descriptor:e})}function on(e){return jo({account_statement_descriptor_kanji:e})}function nn(e){return jo({account_statement_descriptor_kana:e})}function an(e){return jo({account_business_support_email:e})}function sn(e){return jo({account_business_support_phone:e})}function cn(e){return jo({deposit_schedule_interval:e})}function dn(e){return jo({deposit_schedule_weekly_anchor:e})}function un(e){return jo({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*ln(){let e=null;try{const e=(0,Ee.select)(Te).getSettings();yield Wo(!0,null);const t=yield(0,fe.apiFetch)({path:`${we}/settings`,method:"post",data:e});yield jo({payment_method_statuses:t.data.payment_method_statuses}),yield(0,Ee.dispatch)("core/notices").createSuccessNotice((0,oe.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error saving settings.","woocommerce-payments")),e.server_error&&(yield(0,Ee.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield Wo(!1,e)}return null===e}function mn(e){return jo({is_woopay_enabled:e})}function pn(e){return jo({is_woopay_global_theme_support_enabled:e})}function _n(e){return jo({woopay_custom_message:e})}function yn(e){return jo({woopay_store_logo:e})}function hn(e){return jo({current_protection_level:e})}function Sn(e){return jo({advanced_fraud_protection_settings:e})}function gn(e){return jo({is_stripe_billing_enabled:e})}function En(e){return jo({account_communications_email:e})}function fn(e){return jo({express_checkout_product_methods:[...e]})}function wn(e){return jo({express_checkout_cart_methods:[...e]})}function Tn(e){return jo({express_checkout_checkout_methods:[...e]})}function*Rn(){try{yield(0,Ee.dispatch)(Te).startResolution("scheduleStripeBillingMigration"),yield(0,fe.apiFetch)({path:`${we}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,Ee.dispatch)(Te).finishResolution("scheduleStripeBillingMigration")}function vn(e,t){return Fo()({path:`${we}/settings/${e}`,method:"post",data:{value:t}}).catch(()=>{(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error saving option","woocommerce-payments"))})}function*bn(){const e=`${we}/settings`;try{const t=yield(0,fe.apiFetch)({path:e});yield Yo(t)}catch(e){yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error retrieving settings.","woocommerce-payments"))}}const On=e=>()=>{const{updateExpressCheckoutProductMethods:t,updateExpressCheckoutCartMethods:r,updateExpressCheckoutCheckoutMethods:o}=(0,Ee.useDispatch)(Te),n=(0,Ee.useSelect)(e=>e(Te).getExpressCheckoutProductMethods()),a=(0,Ee.useSelect)(e=>e(Te).getExpressCheckoutCartMethods()),s=(0,Ee.useSelect)(e=>e(Te).getExpressCheckoutCheckoutMethods()),i={product:n,cart:a,checkout:s},c={product:t,cart:r,checkout:o};return[[n.includes(e)&&"product",a.includes(e)&&"cart",s.includes(e)&&"checkout"].filter(Boolean),(t,r)=>{c[t](r?[...i[t],e]:i[t].filter(t=>t!==e))}]},In=(On("payment_request"),On("woopay"),On("amazon_pay"),{SET_CARD_READER_STATS:"SET_CARD_READER_STATS",SET_ERROR_FOR_CARD_READER_STATS:"SET_ERROR_FOR_CARD_READER_STATS",SET_READERS:"SET_READERS",SET_ERROR_FOR_CARD_READERS:"SET_ERROR_FOR_CARD_READERS"}),An=(e,t)=>e.readers[t]&&e.readers[t].data?e.readers[t].data:{},Nn=(e,t)=>e.readers[t]&&e.readers[t].error?e.readers[t].error:{},Cn=e=>e.readers&&e.readers.list?e.readers.list:{};function xn(e,t){return{type:In.SET_CARD_READER_STATS,id:e,data:t}}function Pn(e,t){return{type:In.SET_READERS,query:e,data:t}}function Dn(e,t,r){return{type:In.SET_CARD_ERROR_FOR_READER_STATS,id:e,data:t,error:r}}function Mn(e,t){return{type:In.SET_CARD_ERROR_FOR_READERS,data:e,error:t}}function*Fn(e,t){try{const r=yield(0,fe.apiFetch)({path:`${we}/readers/charges/${t}`});yield xn(e,r)}catch(t){yield Dn(e,null,t)}}function*jn(e){const t=(0,ke.addQueryArgs)(`${we}/readers`,{limit:e.limit});try{const r=yield(0,fe.apiFetch)({path:t})||{};yield Pn(e,r)}catch(e){yield Mn(null,e)}}var Un=function(e){return e.SET_ACTIVE_LOAN_SUMMARY="SET_ACTIVE_LOAN_SUMMARY",e.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY="SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY",e.SET_LOANS="SET_LOANS",e.SET_ERROR_FOR_LOANS="SET_ERROR_FOR_LOANS",e}(Un||{});const kn=Un,Ln={},zn=(e=Ln,t)=>{switch(t.type){case kn.SET_ACTIVE_LOAN_SUMMARY:return{...e,summary:t.data,summaryError:void 0};case kn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY:return{...e,summary:void 0,summaryError:t.error};case kn.SET_LOANS:return{...e,loans:t.data,loansError:void 0};case kn.SET_ERROR_FOR_LOANS:return{...e,loans:void 0,loansError:t.error}}return e};(Object.getOwnPropertyDescriptor(zn,"name")||{}).writable||Object.defineProperty(zn,"name",{value:"default",configurable:!0});const $n=e=>e&&e.capital||{},Bn=e=>$n(e).summary,Yn=e=>$n(e).summaryError,qn=e=>$n(e).loans||[],Vn=e=>$n(e).loansError;function Hn(e){return{type:kn.SET_ACTIVE_LOAN_SUMMARY,data:e}}function Gn(e){return{type:kn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY,error:e}}function Wn(e){return{type:kn.SET_LOANS,data:e.data}}function Qn(e){return{type:kn.SET_ERROR_FOR_LOANS,error:e}}function*Zn(){const e=`${we}/capital/active_loan_summary`;try{const t=yield(0,fe.apiFetch)({path:e});yield Hn(t)}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Gn(e)}}function*Jn(){const e=`${we}/capital/loans`;try{const t=yield(0,fe.apiFetch)({path:e});yield Wn(t)}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Qn(e)}}const Kn={SET_DOCUMENTS:"SET_DOCUMENTS",SET_ERROR_FOR_DOCUMENTS:"SET_ERROR_FOR_DOCUMENTS",SET_DOCUMENTS_SUMMARY:"SET_DOCUMENTS_SUMMARY",SET_ERROR_FOR_DOCUMENTS_SUMMARY:"SET_ERROR_FOR_DOCUMENTS_SUMMARY"},Xn={summary:{}},ea=e=>e&&e.documents||{},ta=(e,t)=>{const r=ve(t);return ea(e)[r]||{}},ra=(e,t)=>ta(e,t).data||[],oa=(e,t)=>ta(e,t).error||{},na=(e,t)=>{const r=ve(t);return ea(e).summary[r]||{}},aa=(e,t)=>na(e,t).data||{},sa=(e,t)=>na(e,t).error||{};function ia(e,t){return{type:Kn.SET_DOCUMENTS,query:e,data:t}}function ca(e,t,r){return{type:Kn.SET_ERROR_FOR_DOCUMENTS,query:e,data:t,error:r}}function da(e,t){return{type:Kn.SET_DOCUMENTS_SUMMARY,query:e,data:t}}function ua(e,t,r){return{type:Kn.SET_ERROR_FOR_DOCUMENTS_SUMMARY,query:e,data:t,error:r}}const la=e=>({user_email:e.userEmail,match:e.match,date_before:Ye(e.dateBefore,!0),date_after:Ye(e.dateAfter),date_between:e.dateBetween&&[Ye(e.dateBetween[0]),Ye(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*ma(e){const t=(0,ke.addQueryArgs)(`${we}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...la(e)});try{const r=yield(0,fe.apiFetch)({path:t});yield ia(e,r.data||[])}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving documents.","woocommerce-payments")),yield ca(e,null,t)}}function*pa(e){const t=(0,ke.addQueryArgs)(`${we}/documents/summary`,la(e));try{const r=yield(0,fe.apiFetch)({path:t});yield da(e,r)}catch(t){yield ua(e,null,t)}}const _a={},ya=({paymentIntents:e},t)=>{const r=e?.[t];return r?.data||{}},ha=({paymentIntents:e},t)=>{const r=e?.[t];return r?.error||{}},Sa={SET_AUTHORIZATIONS:"SET_AUTHORIZATIONS",SET_AUTHORIZATION:"SET_AUTHORIZATION",SET_ERROR_FOR_AUTHORIZATIONS:"SET_ERROR_FOR_AUTHORIZATIONS",SET_AUTHORIZATIONS_SUMMARY:"SET_AUTHORIZATIONS_SUMMARY",SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:"SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY",SET_IS_REQUESTING_AUTHORIZATION:"SET_IS_REQUESTING_AUTHORIZATION"},ga={summary:{},byId:{},isRequesting:!1},Ea=e=>e&&e.authorizations||{},fa=(e,t)=>{const r=ve(t);return Ea(e)[r]||{}},wa=(e,t)=>fa(e,t).data||[],Ta=(e,t)=>(Ea(e).byId||{})[t],Ra=(e,t)=>fa(e,t).error||{},va=(e,t)=>{const r=ve(t);return Ea(e).summary[r]||{}},ba=(e,t)=>va(e,t).data||{},Oa=(e,t)=>va(e,t).error||{},Ia=e=>Ea(e).isRequesting,Aa=e=>{const t={wcpay_missing_order:(0,oe.__)("The order could not be found.","woocommerce-payments"),wcpay_refunded_order_uncapturable:(0,oe.__)("Payment cannot be processed for partially or fully refunded orders.","woocommerce-payments"),wcpay_intent_order_mismatch:(0,oe.__)("The payment cannot be processed due to a mismatch with order details.","woocommerce-payments"),wcpay_payment_uncapturable:(0,oe.__)("This payment cannot be processed in its current state.","woocommerce-payments"),wcpay_capture_error:e=>"amount_too_small"===e.data?.error_type?(e=>{if(!e.data?.extra_details?.minimum_amount||!e.data?.extra_details?.minimum_amount_currency)return(0,oe.__)("The payment amount is too small to be processed.","woocommerce-payments");const t=e.data.extra_details.minimum_amount_currency,r=he(e.data.extra_details.minimum_amount,t);return(0,oe.sprintf)((0,oe.__)("The minimum amount that can be processed is %1$s %2$s.","woocommerce-payments"),r,t.toUpperCase())})(e):(0,oe.__)("The payment capture failed to complete.","woocommerce-payments"),wcpay_cancel_error:(0,oe.__)("The payment cancellation failed to complete.","woocommerce-payments"),wcpay_server_error:(0,oe.__)("An unexpected error occurred. Please try again later.","woocommerce-payments")}[e.code??""];return"function"==typeof t?t(e):t??(0,oe.__)("Unable to process the payment. Please try again later.","woocommerce-payments")};function Na(e,t){return{type:Sa.SET_AUTHORIZATIONS,data:t,query:e}}function Ca(e,t){return{type:Sa.SET_ERROR_FOR_AUTHORIZATIONS,query:e,error:t}}function xa(e){return{type:Sa.SET_AUTHORIZATION,data:e}}function Pa(e,t){return{type:Sa.SET_AUTHORIZATIONS_SUMMARY,data:t,query:e}}function Da(e){return{type:Sa.SET_IS_REQUESTING_AUTHORIZATION,data:e}}function*Ma(e,t){try{yield Ee.controls.dispatch(Te,"startResolution","getAuthorization",[e]),yield Ee.controls.dispatch(Te,"setIsRequestingAuthorization",!0);const r=yield(0,fe.apiFetch)({path:`/wc/v3/payments/orders/${t}/capture_authorization`,method:"post",data:{payment_intent_id:e}}),o={payment_intent_id:r.id,captured:"succeeded"===r.status};yield xa(o),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getAuthorizations"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getTimeline"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getTransactions"),yield Ee.controls.dispatch("core/notices","createSuccessNotice",(0,oe.sprintf)((0,oe.__)("Payment for order #%s captured successfully.","woocommerce-payments"),t))}catch(e){const r=(0,oe.sprintf)((0,oe.__)("There has been an error capturing the payment for order #%s.","woocommerce-payments"),t),o=Aa(e);yield Ee.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield Ee.controls.dispatch(Te,"finishResolution","getAuthorization",[e]),yield Ee.controls.dispatch(Te,"setIsRequestingAuthorization",!1)}}function*Fa(e,t){try{yield Ee.controls.dispatch(Te,"startResolution","getAuthorization",[e]),yield Ee.controls.dispatch(Te,"setIsRequestingAuthorization",!0);const r=yield(0,fe.apiFetch)({path:`/wc/v3/payments/orders/${t}/cancel_authorization`,method:"post",data:{payment_intent_id:e}}),o={payment_intent_id:r.id,captured:"succeeded"===r.status};yield xa(o),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getAuthorizations"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getTimeline"),yield Ee.controls.dispatch(Te,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield Ee.controls.dispatch("core/notices","createSuccessNotice",(0,oe.sprintf)((0,oe.__)("Payment for order #%s canceled successfully.","woocommerce-payments"),t))}catch(e){const r=(0,oe.sprintf)((0,oe.__)("There has been an error canceling the payment for order #%s.","woocommerce-payments"),t),o=Aa(e);yield Ee.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield Ee.controls.dispatch(Te,"finishResolution","getAuthorization",[e]),yield Ee.controls.dispatch(Te,"setIsRequestingAuthorization",!1)}}function ja(e,t){return{type:Sa.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY,query:e,error:t}}function*Ua(e){let{paged:t=1,per_page:r=25,orderby:o="created",order:n="asc"}=e;"capture_by"===o&&(o="created");const a=(0,ke.addQueryArgs)(`${we}/authorizations`,{page:t,pagesize:r,sort:o,direction:n});try{const t=yield(0,fe.apiFetch)({path:a});yield Na(e,t.data??[])}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Ca(e,t)}}function*ka(e){try{if(e){const t=yield(0,fe.apiFetch)({path:`${we}/authorizations/${e}`}),{is_captured:r,payment_intent_id:o,created:n}=t;yield xa({payment_intent_id:o,captured:r,created:n})}}catch(e){"authorization_missing"!==e.code&&(yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving authorization.","woocommerce-payments")))}}function*La(e){const t=(0,ke.addQueryArgs)(`${we}/authorizations/summary`,{pagesize:e.per_page,sort:e.orderby,direction:e.order,page:e.paged});try{const r=yield(0,fe.apiFetch)({path:t});yield Pa(e,r??[])}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield ja(e,t)}}var za=function(e){return e.SET_FILE="SET_FILE",e.SET_ERROR_FOR_FILES="SET_ERROR_FOR_FILES",e}(za||{});const $a=za,Ba={},Ya=({files:e},t)=>{const r=e?.[t];return r?.data||{}},qa=({files:e},t)=>{const r=e?.[t];return r?.error||{}};function Va(e,t){return{type:$a.SET_FILE,id:e,data:t}}function Ha(e,t){return{type:$a.SET_ERROR_FOR_FILES,id:e,error:t}}function*Ga(e){try{const t=yield(0,fe.apiFetch)({path:`${we}/file/${e}/details`});yield Va(e,t)}catch(t){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving file.","woocommerce-payments")),yield Ha(e,t)}}let Wa=function(e){return e.SET_PM_PROMOTIONS="SET_PM_PROMOTIONS",e.SET_ERROR_FOR_PM_PROMOTIONS="SET_ERROR_FOR_PM_PROMOTIONS",e}({});const Qa={pmPromotions:void 0,pmPromotionsError:void 0},Za=e=>e.pmPromotions?.pmPromotions??[],Ja=e=>e.pmPromotions?.pmPromotionsError;function Ka(e){return function(e){return"object"==typeof e&&null!==e&&"code"in e&&"string"==typeof e.code}(e)?e:{code:"unknown_error"}}function Xa(e){return{type:Wa.SET_PM_PROMOTIONS,data:e}}function es(e){return{type:Wa.SET_ERROR_FOR_PM_PROMOTIONS,error:e}}function*ts(e){const t=`${we}/pm-promotions/${e}/activate`;try{yield(0,fe.apiFetch)({path:t,method:"POST"}),yield Ee.controls.dispatch("core/notices","createSuccessNotice",(0,oe.__)("Promotion activated successfully!","woocommerce-payments")),yield Ee.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error activating promotion. Please try again.","woocommerce-payments")),yield Ee.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ka(e))}}function*rs(e){const t=`${we}/pm-promotions/${e}/dismiss`;try{yield(0,fe.apiFetch)({path:t,method:"POST"}),yield Ee.controls.dispatch("core/notices","createSuccessNotice",(0,oe.__)("Promotion dismissed.","woocommerce-payments")),yield Ee.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error dismissing promotion. Please try again.","woocommerce-payments")),yield Ee.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ka(e))}}function os(e){if("object"!=typeof e||null===e)return!1;const t=e;return"string"==typeof t.id&&"string"==typeof t.promo_id&&"string"==typeof t.payment_method&&"string"==typeof t.payment_method_title&&"string"==typeof t.type&&("spotlight"===t.type||"badge"===t.type)&&"string"==typeof t.title&&"string"==typeof t.description&&"string"==typeof t.cta_label&&"string"==typeof t.tc_url&&"string"==typeof t.tc_label}function*ns(){const e=`${we}/pm-promotions`;try{const t=yield(0,fe.apiFetch)({path:e});if(r=t,!Array.isArray(r)||!r.every(os))throw new Error("Invalid promotions data received from API");yield Ee.controls.dispatch("wc/payments","updatePmPromotions",t)}catch(e){yield Ee.controls.dispatch("core/notices","createErrorNotice",(0,oe.__)("Error retrieving promotions. Please try again later.","woocommerce-payments")),yield Ee.controls.dispatch("wc/payments","updateErrorForPmPromotions",(t=e,function(e){return"object"==typeof e&&null!==e&&"code"in e}(t)?t:{code:"unknown_error"}))}var t,r}(0,Ee.registerStore)(Te,{reducer:(0,Ee.combineReducers)({deposits:(e=be,{type:t,query:r={},data:o=[],error:n})=>{const a=ve(r);switch(t){case Re.SET_DEPOSIT:return{...e,byId:{...e.byId,[o.id]:o}};case Re.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:o}};case Re.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:n}};case Re.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,_e.keyBy)(o,"id")},queries:{...e.queries,[a]:{data:(0,_e.map)(o,"id")}}};case Re.SET_DEPOSITS_COUNT:return{...e,count:o};case Re.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[a]:{error:n}}};case Re.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Re.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}};case Re.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:o}}}return e},transactions:(e=ct,{type:t,query:r={},data:o=[],error:n,status:a})=>{const s=ve(r);switch(t){case it.SET_TRANSACTIONS:return{...e,[s]:{data:o}};case it.SET_ERROR_FOR_TRANSACTIONS:return{...e,[s]:{error:n}};case it.SET_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}};case it.SET_ERROR_FOR_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{error:n}}};case it.SET_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{data:o}}}};case it.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{error:n}}}};case it.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[s]:{data:o}}}}};case it.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[s]:{error:n}}}}}}return e},charges:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case kt.SET_CHARGE:e={...e,[r]:{...e[r],data:o}};break;case kt.SET_ERROR_FOR_CHARGE:e={...e,[r]:{...e[r],error:n}}}return e},timeline:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case Gt.SET_TIMELINE:e={...e,[r]:{data:o}};break;case Gt.SET_ERROR_FOR_TIMELINE:e={...e,[r]:{...e[r],error:n}}}return e},disputes:(e=er,{type:t,query:r={},data:o=[],id:n,error:a})=>{const s=ve(r);switch(t){case Xt.SET_DISPUTE:return{...e,byId:{...e.byId,[o.id]:o}};case Xt.SET_ERROR_FOR_DISPUTE:e={...e,byId:{...e.byId,[n]:{error:a}}};break;case Xt.SET_DISPUTES:return{...e,cached:{...e.cached,...(0,_e.keyBy)(o,"dispute_id")},queries:{...e.queries,[s]:{data:(0,_e.map)(o,"dispute_id")}}};case Xt.SET_DISPUTES_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}}}return e},settings:(e=Nr,{type:t,...r})=>{switch(t){case Ar.SET_SETTINGS:return{...e,data:r.data,isDirty:!1};case Ar.SET_SETTINGS_VALUES:return{...e,savingError:null,isDirty:!0,data:{...e.data,...r.payload}};case Ar.SET_IS_SAVING_SETTINGS:return{...e,isDirty:!(!r.isSaving&&!r.error)&&e.isDirty,isSaving:r.isSaving,savingError:r.error};case Ar.SET_SELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.concat(r.id)}};case Ar.SET_UNSELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.filter(e=>e!==r.id)}}}return e},readers:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case In.SET_CARD_READER_STATS:e={...e,[r]:{...e[r],data:o}};break;case In.SET_ERROR_FOR_CARD_READER_STATS:e={...e,[r]:{...e[r],error:n}};break;case In.SET_READERS:e={...e,list:o}}return e},capital:zn,documents:(e=Xn,{type:t,query:r={},data:o=[],error:n})=>{const a=ve(r);switch(t){case Kn.SET_DOCUMENTS:return{...e,[a]:{data:o}};case Kn.SET_ERROR_FOR_DOCUMENTS:return{...e,[a]:{error:n}};case Kn.SET_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Kn.SET_ERROR_FOR_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}}}return e},paymentIntents:(e=_a,t)=>{const{type:r,id:o}=t;switch(r){case cr.SET_PAYMENT_INTENT:return{...e,[o]:{...e[o],data:t.data}};case cr.SET_ERROR_FOR_PAYMENT_INTENT:return{...e,[o]:{...e[o],error:t.error}};default:return e}},authorizations:(e=ga,t)=>{switch(t.type){case Sa.SET_AUTHORIZATION:{const{data:r}=t;return{...e,byId:{...e.byId,[r.payment_intent_id]:{...e.byId[r.payment_intent_id],...r}}}}case Sa.SET_AUTHORIZATIONS:{const{data:r,query:o}=t;return{...e,[ve(o)]:{data:r}}}case Sa.SET_ERROR_FOR_AUTHORIZATIONS:{const{error:r,query:o}=t;return{...e,[ve(o)]:{error:r}}}case Sa.SET_AUTHORIZATIONS_SUMMARY:{const{data:r,query:o}=t;return{...e,summary:{...e.summary,[ve(o)]:{data:r||{}}}}}case Sa.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:{const{query:r,error:o}=t;return{...e,summary:{...e.summary,[ve(r)]:{error:o||""}}}}case Sa.SET_IS_REQUESTING_AUTHORIZATION:{const{data:r}=t;return{...e,isRequesting:r}}}return e},files:(e=Ba,t)=>{const{type:r,id:o}=t;switch(r){case $a.SET_FILE:return{...e,[o]:{...e[o],data:t.data}};case $a.SET_ERROR_FOR_FILES:return{...e,[o]:{...e[o],error:t.error}};default:return e}},pmPromotions:(e=Qa,t)=>{switch(t.type){case Wa.SET_PM_PROMOTIONS:return{...e,pmPromotions:t.data,pmPromotionsError:void 0};case Wa.SET_ERROR_FOR_PM_PROMOTIONS:return{...e,pmPromotions:void 0,pmPromotionsError:t.error}}return e}}),actions:{...t,...a,...c,...l,...h,...E,...T,...b,...A,..._,...P,...F,...k},controls:fe.controls,selectors:{...e,...n,...i,...u,...p,...g,...w,...v,...I,...C,...x,...M,...U},resolvers:{...o,...s,...d,...m,...S,...f,...R,...O,...N,...y,...D,...j,...L}});const as="/wc/v3/payments",ss="wc/payments/multi-currency",is={SET_CURRENCIES:"SET_CURRENCIES",SET_AVAILABLE_CURRENCIES:"SET_AVAILABLE_CURRENCIES",SET_ENABLED_CURRENCIES:"SET_ENABLED_CURRENCIES",SET_DEFAULT_CURRENCY:"SET_DEFAULT_CURRENCY",SET_CURRENCY_SETTINGS:"SET_CURRENCY_SETTINGS",SET_STORE_SETTINGS:"SET_STORE_SETTINGS",SET_STORE_SETTINGS_VALUES:"SET_STORE_SETTINGS_VALUES",SET_IS_SAVING_STORE_SETTINGS:"SET_IS_SAVING_STORE_SETTINGS"},cs={},ds=e=>e&&e||{},us=e=>ds(e).currencies||{},ls=e=>us(e).available||{},ms=e=>us(e).enabled||{},ps=e=>us(e).default||{},_s=e=>ds(e).currency_settings||{},ys=e=>ds(e).settings?.data||{},hs=e=>ds(e).settings?.isDirty??!1,Ss=e=>ds(e).settings?.isSaving??!1;function gs(e){return{type:is.SET_CURRENCIES,data:e}}function Es(e){return{type:is.SET_AVAILABLE_CURRENCIES,data:e}}function fs(e){return{type:is.SET_ENABLED_CURRENCIES,data:e}}function ws(e){return{type:is.SET_DEFAULT_CURRENCY,data:e}}function Ts(e,t){return{type:is.SET_CURRENCY_SETTINGS,data:{code:e,data:t}}}function Rs(e){return{type:is.SET_STORE_SETTINGS,data:e}}function vs(e){return{type:is.SET_STORE_SETTINGS_VALUES,data:e}}function bs(e,t){return{type:is.SET_IS_SAVING_STORE_SETTINGS,data:{isSaving:e,error:t}}}function*Os(e){const t=Object.keys((0,Ee.select)(ss).getEnabledCurrencies()),r=e.filter(e=>!t.includes(e)),o=t.filter(t=>!e.includes(t));try{const t=yield(0,fe.apiFetch)({path:`${as}/multi-currency/update-enabled-currencies`,method:"POST",data:{enabled:e}});yield gs(t),yield(0,Ee.dispatch)("core/notices").createSuccessNotice((0,oe.__)("Enabled currencies updated.","woocommerce-payments")),le("wcpay_multi_currency_enabled_currencies_updated",{added_currencies:r,removed_currencies:o})}catch(e){yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error updating enabled currencies.","woocommerce-payments"))}}function*Is(e,t){try{const r=yield(0,fe.apiFetch)({path:`${as}/multi-currency/currencies/${e}`,method:"POST",data:t});yield Ts(e,r),yield(0,Ee.dispatch)("core/notices").createSuccessNotice((0,oe.__)("Currency settings updated.","woocommerce-payments"))}catch(e){yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error updating currency settings.","woocommerce-payments"))}}function*As(e=!1){let t=null;try{const t=(0,Ee.select)(ss).getStoreSettings();yield bs(!0,null);const r=yield(0,fe.apiFetch)({path:`${as}/multi-currency/update-settings`,method:"POST",data:{wcpay_multi_currency_enable_auto_currency:t.enable_auto_currency?"yes":"no",wcpay_multi_currency_enable_storefront_switcher:t.enable_storefront_switcher?"yes":"no",wcpay_multi_currency_rendering_mode:t.rendering_mode||"speed"}});yield Rs(r),e||(yield(0,Ee.dispatch)("core/notices").createSuccessNotice((0,oe.__)("Store settings saved.","woocommerce-payments")))}catch(e){t=e,yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error saving store settings.","woocommerce-payments"))}finally{yield bs(!1,t)}}function Ns(e,t){Fo()({path:`${as}/settings/${e}`,method:"post",data:{value:t}}).catch(()=>{(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error saving option","woocommerce-payments"))})}function*Cs(){const e=`${as}/multi-currency/currencies`;try{const t=yield(0,fe.apiFetch)({path:e});yield gs(t)}catch(e){yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error retrieving currencies.","woocommerce-payments"))}}function*xs(e){const t=`${as}/multi-currency/currencies/${e}`;try{const r=yield(0,fe.apiFetch)({path:t});yield Ts(e,r)}catch(e){yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error retrieving single currency settings.","woocommerce-payments"))}}function*Ps(){const e=`${as}/multi-currency/get-settings`;try{const t=yield(0,fe.apiFetch)({path:e});yield Rs(t)}catch(e){yield(0,Ee.dispatch)("core/notices").createErrorNotice((0,oe.__)("Error retrieving store settings.","woocommerce-payments"))}}const Ds=()=>(0,Ee.useSelect)(e=>{const{getCurrencies:t,isResolving:r}=e(ss);return{currencies:t(),isLoading:r("getCurrencies",[])}},[]),Ms=()=>{const e=(0,Ee.useSelect)(e=>{const{getEnabledCurrencies:t}=e(ss);return t()}),{submitEnabledCurrenciesUpdate:t}=(0,Ee.useDispatch)(ss);return{enabledCurrencies:e,submitEnabledCurrenciesUpdate:t}},Fs=()=>{const{storeSettings:e,isLoading:t,isDirty:r,isSaving:o}=(0,Ee.useSelect)(e=>{const{getStoreSettings:t,isStoreSettingsDirty:r,isSavingStoreSettings:o,isResolving:n}=e(ss);return{storeSettings:t(),isLoading:n("getStoreSettings",[]),isDirty:r(),isSaving:o()}}),{updateStoreSettingValues:n,saveStoreSettings:a}=(0,Ee.useDispatch)(ss);return{storeSettings:e,isLoading:t,isDirty:r,isSaving:o,updateStoreSettingValues:n,saveStoreSettings:a}},js=()=>(0,Ee.useSelect)(e=>{const{getDefaultCurrency:t}=e(ss);return t()});(0,Ee.registerStore)(ss,{reducer:(e=cs,{type:t,data:r=[]})=>{switch(t){case is.SET_CURRENCIES:return{...e,currencies:r,available:r.available,enabled:r.enabled,default:r.default};case is.SET_AVAILABLE_CURRENCIES:return{...e,currencies:{...e,available:r.available},available:r.available};case is.SET_ENABLED_CURRENCIES:return{...e,currencies:{...e,enabled:r.enabled},enabled:r.enabled};case is.SET_DEFAULT_CURRENCY:return{...e,currencies:{...e,default:r.default},default:r.default};case is.SET_CURRENCY_SETTINGS:return{...e,currency_settings:{...e.currency_settings,[r.code]:r.data}};case is.SET_STORE_SETTINGS:return{...e,settings:{...e.settings,isDirty:!1,data:{enable_auto_currency:r.wcpay_multi_currency_enable_auto_currency,enable_storefront_switcher:r.wcpay_multi_currency_enable_storefront_switcher,rendering_mode:r.wcpay_multi_currency_rendering_mode,is_cache_optimized_feature_enabled:r.is_cache_optimized_feature_enabled,site_theme:r.site_theme,date_format:r.date_format,time_format:r.time_format,store_url:r.store_url}}};case is.SET_STORE_SETTINGS_VALUES:return{...e,settings:{...e.settings,savingError:null,isDirty:!0,data:{...e.settings?.data||{},...r}}};case is.SET_IS_SAVING_STORE_SETTINGS:return{...e,settings:{...e.settings,isDirty:!(!r.isSaving&&!r.error)&&(e.settings?.isDirty??!1),isSaving:r.isSaving,savingError:r.error}}}return e},actions:{...$},controls:fe.controls,selectors:{...z},resolvers:{...B}});const Us=({isPreviewModalOpen:e,setPreviewModalOpen:t,isStorefrontSwitcherEnabledValue:r,isAutomaticSwitchEnabledValue:o})=>{const{storeSettings:n}=Fs();return e&&(0,V.jsx)(H.Modal,{title:(0,oe.__)("Preview","woocommerce-payments"),isDismissible:!0,className:"multi-currency-store-settings-preview-modal",shouldCloseOnClickOutside:!1,onRequestClose:()=>{t(!1)},children:(0,V.jsx)("iframe",{title:(0,oe.__)("Preview","woocommerce-payments"),className:"multi-currency-store-settings-preview-iframe",src:"/"+n.store_url+"?is_mc_onboarding_simulation=1&enable_storefront_switcher="+r+"&enable_auto_currency="+o})})},ks=window.wp.element,Ls=({children:e})=>(0,V.jsx)("ul",{children:e});function zs(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function $s(e,t){let r,o,n=[];for(let a=0;a<e.length;a++){const s=e[a];if("string"!==s.type){if(void 0===t[s.value])throw new Error(`Invalid interpolation, missing component node: \`${s.value}\``);if("object"!=typeof t[s.value])throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${s.value}\``);if("componentClose"===s.type)throw new Error(`Missing opening component token: \`${s.value}\``);if("componentOpen"===s.type){r=t[s.value],o=a;break}n.push(t[s.value])}else n.push(s.value)}if(r){const a=function(e,t){const r=t[e];let o=0;for(let n=e+1;n<t.length;n++){const e=t[n];if(e.value===r.value){if("componentOpen"===e.type){o++;continue}if("componentClose"===e.type){if(0===o)return n;o--}}}throw new Error("Missing closing component token `"+r.value+"`")}(o,e),s=$s(e.slice(o+1,a),t),i=(0,Y.cloneElement)(r,{},s);if(n.push(i),a<e.length-1){const r=$s(e.slice(a+1),t);n=n.concat(r)}}return n=n.filter(Boolean),0===n.length?null:1===n.length?n[0]:(0,Y.createElement)(Y.Fragment,null,...n)}function Bs(e){const{mixedString:t,components:r,throwErrors:o}=e;if(!r)return t;if("object"!=typeof r){if(o)throw new Error(`Interpolation Error: unable to process \`${t}\` because components is not an object`);return t}const n=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(zs)}(t);try{return $s(n,r)}catch(e){if(o)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}const Ys=({onChange:e,checked:t=!1,currency:{flag:r,symbol:o,code:n,name:a},testId:s=null})=>{const i=(0,ks.useCallback)(t=>{e(n,t)},[n,e]);return(0,V.jsx)("li",{className:"enabled-currency-checkbox","data-testid":s,children:(0,V.jsx)(H.CheckboxControl,{code:n,checked:t,onChange:i,label:Bs({mixedString:"{{flag /}} {{name /}} {{code /}}",components:{flag:(0,V.jsx)("span",{className:"enabled-currency-checkbox__flag",children:""!==r?r:(0,V.jsx)("div",{className:"enabled-currency-checkbox__flag-text",children:(0,V.jsx)("span",{children:n})})}),name:(0,V.jsx)("span",{children:a}),code:(0,V.jsxs)("span",{className:"enabled-currency-checkbox__code",children:["(",o,o!==n&&" "+n,")"]})}}),__nextHasNoMarginBottom:!0})})};(0,oe.__)("any","woocommerce-payments"),(0,oe.__)("one","woocommerce-payments"),(0,oe.__)("two","woocommerce-payments"),(0,oe.__)("three","woocommerce-payments"),(0,oe.__)("four","woocommerce-payments"),(0,oe.__)("five","woocommerce-payments"),(0,oe.__)("six","woocommerce-payments"),(0,oe.__)("seven","woocommerce-payments"),(0,oe.__)("eight","woocommerce-payments"),(0,oe.__)("nine","woocommerce-payments");const qs=({className:e,children:t})=>(0,V.jsx)("ul",{className:e,children:t});var Vs=r(9387);const Hs=({symbol:e})=>(0,V.jsx)("div",{className:"currency-delete-illustration__wrapper",children:(0,V.jsxs)("div",{className:"currency-delete-illustration__illustrations",children:[e,(0,V.jsx)(Vs.A,{className:"currency-delete-illustration__currency-cross-icon"})]})}),Gs=r.p+"../assets/images/payment-methods/jcb.svg?ver=3351f2584f4a62ad094d",Ws=r.p+"../assets/images/cards/visa.svg?ver=f10d76e13a47cb867cca",Qs=r.p+"../assets/images/cards/mastercard.svg?ver=d21057587f14a719da45",Zs=r.p+"../assets/images/cards/amex.svg?ver=9035aad80e3ae7ac653c",Js=r.p+"../assets/images/payment-methods/woo.svg?ver=86a2411c2b2a56f57bc5",Ks=r.p+"../assets/images/payment-methods/woo-short.svg?ver=e7eb126add68e8fde2b6",Xs=r.p+"../assets/images/cards/diners.svg?ver=62451ea54fcf12af5e0d",ei=r.p+"../assets/images/cards/discover.svg?ver=a19341de516c258e11fe",ti=r.p+"../assets/images/cards/cb.svg?ver=375fa3d816484fa4b53c",ri=r.p+"../assets/images/cards/unionpay.svg?ver=e60ed9d9db08315ff5c9",oi=(e,t,r=!0)=>({className:o,...n})=>(0,V.jsx)("img",{className:W("payment-method__icon",r?"":"no-border",o),src:e,alt:t,...n}),ni=(oi(Zs,(0,oe.__)("American Express","woocommerce-payments")),oi(ti,(0,oe.__)("Cartes Bancaires","woocommerce-payments")),oi(Xs,(0,oe.__)("Diners Club","woocommerce-payments")),oi(ei,(0,oe.__)("Discover","woocommerce-payments")),oi(Gs,(0,oe.__)("JCB","woocommerce-payments")));if(oi(Qs,(0,oe.__)("Mastercard","woocommerce-payments")),oi(ri,(0,oe.__)("UnionPay","woocommerce-payments")),oi(Ws,(0,oe.__)("Visa","woocommerce-payments")),oi(Js,(0,oe.__)("WooPay","woocommerce-payments"),!1),oi(Ks,(0,oe.__)("WooPay","woocommerce-payments"),!1),"undefined"==typeof wooPaymentsPaymentMethodDefinitions)throw new Error("wooPaymentsPaymentMethodDefinitions is undefined");const ai=Object.keys(wooPaymentsPaymentMethodDefinitions).reduce((e,t)=>(e[t]={...wooPaymentsPaymentMethodDefinitions[t],icon:({className:e})=>(0,V.jsx)("img",{src:wooPaymentsPaymentMethodDefinitions[t].settings_icon_url,alt:wooPaymentsPaymentMethodDefinitions[t].label,className:W("payment-method__icon",e)})},e),{jcb:{id:"jcb",label:(0,oe.__)("JCB","woocommerce-payments"),description:(0,oe.__)("Let your customers pay with JCB, the only international payment brand based in Japan.","woocommerce-payments"),icon:ni,currencies:["JPY"],stripe_key:"jcb_payments",allows_manual_capture:!1,allows_pay_later:!1,accepts_only_domestic_payment:!1,settings_icon_url:""}}),si=({code:e,label:t,symbol:r,onClick:o,className:n})=>{const[a,s]=(0,ks.useState)(!1),i=window.multiCurrencyPaymentMethodsMap,c=i&&i[e]&&Object.keys(i[e]).length>0,d=c?Object.keys(i[e]):[],u=(0,ks.useCallback)(()=>{c?s(!0):o(e)},[s,c,o,e]),l=(0,ks.useCallback)(()=>{s(!1),o(e)},[o,s,e]),m=(0,ks.useCallback)(()=>{s(!1)},[s]);return(0,V.jsxs)(V.Fragment,{children:[a&&(0,V.jsxs)(Z,{title:(0,oe.sprintf)((0,oe.__)("Remove %1$s","woocommerce-payments"),t),onRequestClose:m,className:"enabled-currency-delete-modal",actions:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(H.Button,{onClick:l,isPrimary:!0,isDestructive:!0,children:(0,oe.__)("Remove","woocommerce-payments")}),(0,V.jsx)(H.Button,{onClick:m,isSecondary:!0,children:(0,oe.__)("Cancel","woocommerce-payments")})]}),children:[(0,V.jsx)(Hs,{symbol:r}),(0,V.jsx)("p",{children:Bs({mixedString:(0,oe.sprintf)((0,oe.__)("Are you sure you want to remove {{strong}}%s (%s){{/strong}}? Your customers will no longer be able to pay in this currency and use payment methods listed below.","woocommerce-payments"),t,e===r?e:[e,r].join(" ")),components:{strong:(0,V.jsx)("strong",{})}})}),(0,V.jsx)("ul",{children:d.map(e=>(0,V.jsx)("li",{children:(0,V.jsx)(se,{Icon:ai[e].icon,label:ai[e].label})},e))}),(0,V.jsx)("p",{children:(0,oe.sprintf)((0,oe.__)("You can add %s (%s) again at any time in Multi-Currency settings.","woocommerce-payments"),t,e===r?e:[e,r].join(" "))})]}),(0,V.jsx)(H.Button,{isLink:!0,"aria-label":(0,oe.sprintf)((0,oe.__)("Remove %1$s as an enabled currency","woocommerce-payments"),t),className:n,onClick:u,__next40pxDefaultSize:!0,children:(0,V.jsx)(H.Icon,{icon:"trash"})})]})},ii=(0,Y.createContext)(),ci=({currency:{code:e,flag:t,id:r,is_default:o,name:n,symbol:a,rate:s},onDeleteClick:i})=>{const{code:c,is_zero_decimal:d}=js(),{setCurrencyCodeToShowSettingsFor:u}=(0,Y.useContext)(ii);return(0,V.jsxs)("li",{className:W("enabled-currency",r),children:[(0,V.jsxs)("div",{className:"enabled-currency__container",children:[(0,V.jsx)("div",{className:"enabled-currency__flag",children:""!==t?t:(0,V.jsx)("div",{className:"enabled-currency__flag-text",children:(0,V.jsx)("span",{children:e})})}),(0,V.jsx)("div",{className:"enabled-currency__label",children:n}),(0,V.jsxs)("div",{className:"enabled-currency__code",children:["(",a+(a===e?"":` ${e}`),")"]})]}),(0,V.jsx)("div",{className:"enabled-currency__rate",children:(()=>{const t=d?Number.parseFloat(1e3*s).toFixed(2):Number.parseFloat(s).toFixed(2);return o?(0,oe.__)("Default currency","woocommerce-payments"):d?`1,000 ${c} → ${t} ${e}`:`1 ${c} → ${t} ${e}`})()}),(0,V.jsxs)("div",{className:"enabled-currency__actions",children:[!o&&(0,V.jsx)(H.Button,{isLink:!0,onClick:()=>{u(e)},"aria-label":(0,oe.sprintf)((0,oe.__)("Edit %1$s","woocommerce-payments"),n),className:"enabled-currency__action edit",__next40pxDefaultSize:!0,children:(0,oe.__)("manage","woocommerce-payments")}),i&&(0,V.jsx)(si,{className:"enabled-currency__action delete",onClick:i,label:n,code:e,symbol:a})]})]})},di=({isLoading:e})=>(0,V.jsxs)("li",{className:W("enabled-currency-placeholder","enabled-currency"),children:[(0,V.jsxs)("div",{className:"enabled-currency__container",children:[(0,V.jsx)("div",{className:"enabled-currency__flag",children:(0,V.jsx)(ae,{isLoading:e,numLines:1,children:(0,V.jsx)("div",{className:"enabled-currency__flag-text"})})}),(0,V.jsx)("div",{className:"enabled-currency__label",children:(0,V.jsx)(ae,{isLoading:e,numLines:1})}),(0,V.jsx)("div",{className:"enabled-currency__code",children:(0,V.jsx)(ae,{isLoading:e,numLines:1})})]}),(0,V.jsx)("div",{className:"enabled-currency__rate",children:(0,V.jsx)(ae,{isLoading:e,numLines:1})}),(0,V.jsx)("div",{className:"enabled-currency__actions",children:(0,V.jsx)(ae,{isLoading:e,numLines:1})})]}),ui=({className:e})=>{const t=(0,Ee.useSelect)(e=>{const{getAvailableCurrencies:t}=e(ss);return t()}),r=Object.keys(t),o=(0,ks.useRef)(null),{enabledCurrencies:n,submitEnabledCurrenciesUpdate:a}=Ms(),s=Object.keys(n),i=js().code;r.splice(r.indexOf(i),1);const[c,d]=(0,ks.useState)(""),[u,l]=(0,ks.useState)({}),m=c?r.filter(e=>{const{symbol:r,name:o}=t[e];return`${r} ${e} ${o}`.toLocaleLowerCase().indexOf(c.toLocaleLowerCase())>-1}):r,p=(0,ks.useCallback)(()=>{l(r.reduce((e,t)=>(e[t]=s.includes(t),e),{}))},[s,r]);(0,ks.useEffect)(()=>{p()},[JSON.stringify(r),JSON.stringify(s)]);const _=(e,t)=>{l(r=>({...r,[e]:t}))},[y,h]=(0,ks.useState)(!1),[S,g]=(0,ks.useState)(!1),E=(0,ks.useCallback)(()=>{h(!0)},[h]),f=(0,ks.useCallback)(()=>{h(!1),g(!1),d(""),p()},[h,p]);return(0,ks.useEffect)(()=>{y&&o&&!1===S&&g(o.current.offsetWidth)},[JSON.stringify(m),y]),(0,V.jsxs)(V.Fragment,{children:[y&&(0,V.jsxs)(Z,{focusOnMount:"firstContentElement",title:(0,oe.__)("Add enabled currencies","woocommerce-payments"),onRequestClose:f,className:"add-enabled-currencies-modal",actions:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(H.Button,{isSecondary:!0,onClick:f,__next40pxDefaultSize:!0,children:(0,oe.__)("Cancel","woocommerce-payments")}),(0,V.jsx)(H.Button,{isPrimary:!0,onClick:()=>{h(!1),g(!1),d("");const e=Object.entries(u).filter(([,e])=>e).map(([e])=>e);e.push(i),e.sort(),a(e)},__next40pxDefaultSize:!0,children:(0,oe.__)("Update selected","woocommerce-payments")})]}),children:[(0,V.jsx)("div",{className:"add-enabled-currencies-modal__search",children:(0,V.jsx)(H.SearchControl,{__nextHasNoMarginBottom:!0,value:c,onChange:d,placeholder:(0,oe.__)("Search currencies","woocommerce-payments")})}),(0,V.jsx)("h3",{children:c?(0,oe.sprintf)((0,oe.__)("Search results (%1$d currencies)","woocommerce-payments"),m.length):(0,oe.__)("All currencies","woocommerce-payments")}),(0,V.jsx)("div",{className:"add-enabled-currencies-modal__content",ref:o,style:{width:S||"auto"},children:(0,V.jsx)(Ls,{children:m.map(e=>(0,V.jsx)(Ys,{checked:u[e],onChange:_,currency:t[e]},t[e].id))})})]}),(0,V.jsx)(H.Button,{variant:"secondary",className:e,onClick:E,"data-testid":"enabled-currencies-add-button",__next40pxDefaultSize:!0,children:(0,oe.__)("Add/remove currencies","woocommerce-payments")})]})},li=()=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("h2",{children:(0,oe.__)("Enabled currencies","woocommerce-payments")}),(0,V.jsx)("p",{children:(0,ks.createInterpolateElement)((0,oe.__)("Accept payments in multiple currencies. Prices are converted based on exchange rates and rounding rules. <learnMoreLink>Learn more</learnMoreLink>","woocommerce-payments"),{learnMoreLink:(0,V.jsx)(H.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#enabled-currencies"})})})]}),mi=()=>{const{isLoading:e}=Ds(),{enabledCurrencies:t,submitEnabledCurrenciesUpdate:r}=Ms(),o="wcpay-multi-currency",n=e=>{const o=Object.keys(t);o.splice(o.indexOf(e),1),r(o)},a=t?Object.keys(t):[];return(0,V.jsx)(ce,{description:li,className:"multi-currency-settings-enabled-currencies-section",children:(0,V.jsxs)(H.Card,{className:`${o}__enabled-currencies`,children:[(0,V.jsxs)(H.CardBody,{className:`${o}__enabled-currencies-header`,children:[(0,V.jsx)("div",{children:(0,oe.__)("Name","woocommerce-payments")}),(0,V.jsx)("div",{children:(0,oe.__)("Exchange rate","woocommerce-payments")}),(0,V.jsx)("div",{})]}),(0,V.jsx)(H.CardDivider,{}),(0,V.jsx)(H.CardBody,{size:null,children:(0,V.jsxs)(qs,{className:"enabled-currencies-list",children:[!e&&t&&a.map(e=>(0,V.jsx)(ci,{currency:t[e],onDeleteClick:t[e].is_default?void 0:n},t[e].id)),e&&[1,2,3,4,5].map(e=>(0,V.jsx)(di,{isLoading:1},"loadable-placeholder-"+e))]})}),(0,V.jsx)(H.CardDivider,{}),(0,V.jsx)(H.CardBody,{className:`${o}__available-currencies-container`,children:t&&(0,V.jsx)(ui,{className:`${o}__available-currencies-modal`})})]})})},pi=()=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("h2",{children:(0,oe.__)("Store settings","woocommerce-payments")}),(0,V.jsx)("p",{children:(0,ks.createInterpolateElement)((0,oe.__)("Store settings allow your customers to choose which currency they would like to use when shopping at your store. <learnMoreLink>Learn more</learnMoreLink>","woocommerce-payments"),{learnMoreLink:(0,V.jsx)(H.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#store-settings"})})})]}),_i=()=>{const{storeSettings:e,isLoading:t,isDirty:r,isSaving:o,updateStoreSettingValues:n,saveStoreSettings:a}=Fs();(0,Y.useEffect)(()=>{r||(window.onbeforeunload=null)},[r]);const[s,i]=(0,Y.useState)(!1);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ce,{description:pi,className:"multi-currency-settings-store-settings-section",children:(0,V.jsx)(ae,{isLoading:t,numLines:10,children:(0,V.jsxs)(H.Card,{className:"multi-currency-settings__wrapper",children:[(0,V.jsxs)(H.CardBody,{className:"wcpay-card-body",children:[(0,V.jsx)(H.CheckboxControl,{checked:!!e.enable_auto_currency,onChange:e=>n({enable_auto_currency:e}),"data-testid":"enable_auto_currency",label:(0,oe.__)("Automatically switch customers to their local currency if it has been enabled","woocommerce-payments"),help:(0,ks.createInterpolateElement)((0,oe.__)("Customers will be notified via store alert banner. <previewLink>Preview</previewLink>","woocommerce-payments"),{previewLink:(0,V.jsx)(H.Button,{isLink:!0,onClick:()=>{i(!0)},__next40pxDefaultSize:!0})}),__nextHasNoMarginBottom:!0}),e.is_cache_optimized_feature_enabled?(0,V.jsx)(H.RadioControl,{label:(0,oe.__)("Price rendering mode","woocommerce-payments"),help:(0,oe.__)('Choose how multi-currency prices are rendered. "Optimized for caching" outputs identical HTML for all visitors and converts prices client-side, allowing hosting providers to cache pages effectively.',"woocommerce-payments"),selected:e.rendering_mode||"speed",options:[{label:(0,oe.__)("Optimized for speed (default)","woocommerce-payments"),value:"speed"},{label:(0,oe.__)("Optimized for caching","woocommerce-payments"),value:"cache"}],onChange:e=>n({rendering_mode:e})}):null,"Storefront"===e.site_theme?(0,V.jsx)(H.CheckboxControl,{checked:!!e.enable_storefront_switcher,onChange:e=>n({enable_storefront_switcher:e}),"data-testid":"enable_storefront_switcher",label:(0,oe.__)("Add a currency switcher to the Storefront theme on breadcrumb section.","woocommerce-payments"),help:(0,ks.createInterpolateElement)((0,oe.sprintf)((0,oe.__)("A currency switcher is also available in your widgets. <linkToWidgets>Configure now</linkToWidgets>","woocommerce-payments"),"widgets.php"),{linkToWidgets:(0,V.jsx)("a",{href:"widgets.php"})}),__nextHasNoMarginBottom:!0}):null]}),(0,V.jsx)(Us,{isPreviewModalOpen:s,setPreviewModalOpen:i,isStorefrontSwitcherEnabledValue:!1,isAutomaticSwitchEnabledValue:!0})]})})}),(0,V.jsx)(ce,{className:"multi-currency-settings-save-settings-section",children:(0,V.jsx)(H.Button,{isPrimary:!0,isBusy:o,disabled:o||!r,onClick:a,__next40pxDefaultSize:!0,children:(0,oe.__)("Save changes","woocommerce-payments")})})]})},yi=()=>(0,V.jsx)("div",{className:"multi-currency-settings",children:(0,V.jsxs)(ie,{children:[(0,V.jsx)(mi,{}),(0,V.jsx)(_i,{})]})}),hi=window.wc.components,Si=({storeCurrency:e,targetCurrency:t,currencyRate:r=null,roundingValue:o,charmValue:n})=>{const[a,s]=(0,Y.useState)(20),i=(0,Y.useMemo)(()=>{const e=parseFloat(a.toString().replace(/,/g,"."))*parseFloat(r||t.rate),s=(parseFloat(o)?Math.ceil(e/parseFloat(o))*parseFloat(o):e)+parseFloat(n);return isNaN(s)?(0,oe.__)("Please enter a valid number","woocommerce-payments"):he(ye(t.code)?s:100*s,t.code,null,!0)},[a,n,r,o,t]);return(0,V.jsx)(H.Card,{className:"single-currency-settings-preview-wrapper",children:(0,V.jsxs)(H.CardBody,{className:"wcpay-card-body",children:[(0,V.jsx)("div",{children:"left"===e.symbol_position?(0,V.jsx)(hi.TextControlWithAffixes,{label:e.name,prefix:e.symbol,"data-testid":"store_currency_value",value:a.toString(),onChange:s}):(0,V.jsx)(hi.TextControlWithAffixes,{label:e.name,suffix:e.symbol,"data-testid":"store_currency_value",value:a.toString(),onChange:s})}),(0,V.jsx)("div",{children:(0,V.jsx)(hi.TextControlWithAffixes,{"data-testid":"calculated_value",label:t&&t.name,value:i,onChange:()=>null,disabled:!0})})]})})},gi={0:(0,oe.__)("None","woocommerce-payments"),.25:"0.25","0.50":"0.50","1.00":"1.00 (recommended)","5.00":"5.00","10.00":"10.00"},Ei={1:"1",10:"10",25:"25",50:"50",100:"100 (recommended)",500:"500",1e3:"1000"},fi={"0.00":(0,oe.__)("None","woocommerce-payments"),"-0.01":"-0.01","-0.05":"-0.05"},wi={"0.00":(0,oe.__)("None","woocommerce-payments"),"-1":"-1","-5":"-5","-10":"-10","-20":"-20","-25":"-25","-50":"-50","-100":"-100"},Ti=()=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("h2",{children:(0,oe.__)("Currency settings","woocommerce-payments")}),(0,V.jsx)("p",{children:(0,oe.__)("Choose between automatic or manual exchange rates and modify formatting rules to refine the display of your prices.","woocommerce-payments")})]}),Ri=()=>{const{currencyCodeToShowSettingsFor:e,setCurrencyCodeToShowSettingsFor:t}=(0,Y.useContext)(ii),[r,o]=(0,Y.useState)(!1),{currencies:n}=Ds(),{enabledCurrencies:a}=Ms(),{storeSettings:s}=Fs(),{currencySettings:i,isLoading:c,submitCurrencySettings:d}=(e=>{const{currencySettings:t,isLoading:r}=(0,Ee.useSelect)(t=>{const{getCurrencySettings:r,isResolving:o}=t(ss);return{currencySettings:r(e),isLoading:o("getCurrencySettings",[e])}}),{submitCurrencySettings:o}=(0,Ee.dispatch)(ss);return{currencySettings:t,isLoading:r,submitCurrencySettings:o}})(e),u=n.default?n.default:{},l=n.available?n.available[e]:{},m=l.is_zero_decimal?Ei:gi,p=l.is_zero_decimal?wi:fi,_="automatic",y=l?.is_zero_decimal?"100":"1.00",h="0.00",[S,g]=(0,Y.useState)(_),[E,f]=(0,Y.useState)(0),[w,T]=(0,Y.useState)(y),[R,v]=(0,Y.useState)(h),[b,O]=(0,Y.useState)(!1);(0,Y.useEffect)(()=>{i[e]&&(g(i[e].exchange_rate_type||_),f(i[e].manual_rate||0),T(i[e].price_rounding??y),v(i[e].price_charm||h))},[i,e,y]);const I=s.date_format??"M j, Y",A=s.time_format??"g:iA",N=l?(0,$e.dateI18n)(`${I} ${A}`,ze().unix(l.last_updated).toISOString()):"";return(0,V.jsx)("div",{className:"single-currency-settings",children:(0,V.jsxs)(ie,{children:[(0,V.jsxs)("h2",{className:"single-currency-settings-breadcrumb",children:[(0,V.jsx)(H.Button,{isLink:!0,onClick:()=>t(null),__next40pxDefaultSize:!0,children:(0,oe.__)("Enabled currencies","woocommerce-payments")})," ","> ",l.name," (",l.code,")"," ",l.flag]}),(0,V.jsx)(ce,{description:Ti,children:(0,V.jsx)(ae,{isLoading:c,numLines:33,children:(0,V.jsx)(H.Card,{className:"single-currency-settings-currency-settings",children:(0,V.jsxs)(H.CardBody,{className:"wcpay-card-body",children:[(0,V.jsx)("h4",{children:(0,oe.__)("Exchange rate","woocommerce-payments")}),(0,V.jsx)("fieldset",{children:(0,V.jsxs)("ul",{children:[(0,V.jsx)("li",{children:(0,V.jsx)(H.RadioControl,{onChange:e=>{g(e),o(!0),"manual"===e&&f(E||l.rate)},options:[{description:l.last_updated?(0,oe.sprintf)((0,oe.__)("Current rate: 1 %s = %s %s (Last updated: %s)","woocommerce-payments"),u.code,l.rate,l.code,N):(0,oe.__)("Error - Unable to fetch automatic rate for this currency","woocommerce-payments"),label:(0,oe.__)("Fetch rates automatically","woocommerce-payments"),value:"automatic"},{description:(0,oe.__)("Enter your fixed rate of exchange","woocommerce-payments"),label:(0,oe.__)("Manual","woocommerce-payments"),value:"manual"}],selected:S})}),"manual"===S&&(0,V.jsx)("li",{children:(0,V.jsx)(H.TextControl,{"data-testid":"manual_rate_input",label:(0,oe.__)("Manual Rate","woocommerce-payments"),help:(0,oe.__)("Enter the manual rate you would like to use. Must be a positive number.","woocommerce-payments"),value:E||l.rate,onChange:e=>{f(e.replace(/,/g,".")),o(!0)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})]})}),(0,V.jsx)("h4",{children:(0,oe.__)("Formatting rules","woocommerce-payments")}),(0,V.jsx)("fieldset",{children:(0,V.jsxs)("ul",{children:[(0,V.jsx)("li",{children:(0,V.jsx)(H.SelectControl,{"data-testid":"price_rounding",label:(0,oe.__)("Price rounding","woocommerce-payments"),help:Bs({mixedString:(0,oe.sprintf)((0,oe.__)("Make your %s prices consistent by rounding them up after they're converted. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),l.code),components:{learnMoreLink:(0,V.jsx)(H.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#price-rounding"})}}),value:parseFloat(w),onChange:e=>{T(e),o(!0)},options:Object.keys(m).map(e=>({value:parseFloat(e),label:m[e]})),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}),(0,V.jsx)("li",{children:(0,V.jsx)(H.SelectControl,{"data-testid":"price_charm",label:(0,oe.__)("Charm pricing","woocommerce-payments"),help:Bs({mixedString:(0,oe.sprintf)((0,oe.__)("Reduce the converted price for a specific amount. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),l.code),components:{learnMoreLink:(0,V.jsx)(H.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/#charm-pricing"})}}),value:parseFloat(R),onChange:e=>{v(e),o(!0)},options:Object.keys(p).map(e=>({value:parseFloat(e),label:p[e]})),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})]})})]})})})}),(0,V.jsx)(ce,{description:()=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)("h2",{children:(0,oe.__)("Preview","woocommerce-payments")}),(0,V.jsx)("p",{children:c?"":(0,oe.sprintf)((0,oe.__)("Enter a price in your default currency (%s) to see it converted to %s using the exchange rate and formatting rules above.","woocommerce-payments"),u.name,l.name)})]}),children:(0,V.jsx)(ae,{isLoading:c,numLines:8,children:(0,V.jsx)(Si,{className:"single-currency-settings-currency-preview",storeCurrency:u,targetCurrency:l,currencyRate:"manual"===S?E:null,roundingValue:w,charmValue:R})})}),(0,V.jsx)(ce,{className:"single-currency-settings-save-settings-section",children:(0,V.jsx)(H.Button,{isPrimary:!0,isBusy:b,disabled:b||!r,onClick:()=>{O(!0),d(l.code,{exchange_rate_type:S,manual_rate:E,price_rounding:w,price_charm:R}),isNaN(E)||(a[l.code].rate=Number(E)),O(!1),o(!1)},__next40pxDefaultSize:!0,children:(0,oe.__)("Save changes","woocommerce-payments")})})]})})},vi=()=>{const[e,t]=(0,Y.useState)(null);return(0,V.jsx)(ii.Provider,{value:{currencyCodeToShowSettingsFor:e,setCurrencyCodeToShowSettingsFor:t},children:e?(0,V.jsx)(Ri,{}):(0,V.jsx)(yi,{})})},bi=document.querySelector("#wcpay_multi_currency_settings_container");(0,q.H)(bi).render((0,V.jsx)(vi,{}))})()})();
Back to Directory File Manager