/*! For license information please see order.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),u=["gridicon","gridicons-checkmark",i,!1,!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:u,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)}},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),u=["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:u,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),u=["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:u,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 u(e,t,r){var o,a={},u=null,d=null;for(o in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(d=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:u,ref:d,props:a,_owner:i.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},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:()=>ke,getAllDepositsOverviewsError:()=>je,getDeposit:()=>xe,getDepositQueryError:()=>$e,getDeposits:()=>qe,getDepositsCount:()=>Le,getDepositsSummary:()=>Be,getDepositsSummaryError:()=>He,getInstantDeposit:()=>Ve});var t={};r.r(t),r.d(t,{submitInstantDeposit:()=>rt,updateAllDepositsOverviews:()=>We,updateDeposit:()=>Qe,updateDeposits:()=>Ze,updateDepositsCount:()=>Ke,updateDepositsSummary:()=>Xe,updateErrorForAllDepositsOverviews:()=>Ge,updateErrorForDepositQuery:()=>Je,updateErrorForDepositsSummary:()=>et,updateInstantDeposit:()=>tt});var o={};r.r(o),r.d(o,{getAllDepositsOverviews:()=>nt,getDeposit:()=>ot,getDeposits:()=>ct,getDepositsSummary:()=>ut,getPayoutsCSVRequestURL:()=>it,payoutsDownloadEndpoint:()=>st});var n={};r.r(n),r.d(n,{getFraudOutcomeTransactions:()=>gt,getFraudOutcomeTransactionsError:()=>wt,getFraudOutcomeTransactionsSummary:()=>Rt,getFraudOutcomeTransactionsSummaryError:()=>Ot,getTransactions:()=>_t,getTransactionsError:()=>yt,getTransactionsSummary:()=>St,getTransactionsSummaryError:()=>Et});var a={};r.r(a),r.d(a,{updateErrorForFraudOutcomeTransactions:()=>Dt,updateErrorForFraudOutcomeTransactionsSummary:()=>Ct,updateErrorForTransactions:()=>bt,updateErrorForTransactionsSummary:()=>At,updateFraudOutcomeTransactions:()=>Nt,updateFraudOutcomeTransactionsSummary:()=>Pt,updateTransactions:()=>vt,updateTransactionsSummary:()=>It});var s={};r.r(s),r.d(s,{formatQueryFilters:()=>Mt,getFraudOutcomeTransactions:()=>jt,getFraudOutcomeTransactionsExport:()=>qt,getFraudOutcomeTransactionsSummary:()=>zt,getTransactions:()=>Ft,getTransactionsCSVRequestURL:()=>xt,getTransactionsSummary:()=>kt,transactionsDownloadEndpoint:()=>Ut});var i={};r.r(i),r.d(i,{getCharge:()=>$t,getChargeError:()=>Yt,getChargeFromOrder:()=>Bt,getChargeFromOrderError:()=>Ht});var c={};r.r(c),r.d(c,{updateCharge:()=>Vt,updateErrorForCharge:()=>Qt});var u={};r.r(u),r.d(u,{getCharge:()=>Wt,getChargeFromOrder:()=>Gt});var d={};r.r(d),r.d(d,{getTimeline:()=>Kt,getTimelineError:()=>Jt});var m={};r.r(m),r.d(m,{updateErrorForTimeline:()=>er,updateTimeline:()=>Xt});var p={};r.r(p),r.d(p,{getTimeline:()=>tr});var l={};r.r(l),r.d(l,{getCachedDispute:()=>ir,getDispute:()=>ar,getDisputeError:()=>sr,getDisputes:()=>cr,getDisputesSummary:()=>ur});var _={};r.r(_),r.d(_,{refundCharge:()=>_r,updateErrorForPaymentIntent:()=>lr,updatePaymentIntent:()=>pr});var y={};r.r(y),r.d(y,{getPaymentIntent:()=>yr});var h={};r.r(h),r.d(h,{acceptDispute:()=>gr,updateDispute:()=>hr,updateDisputes:()=>Er,updateDisputesSummary:()=>fr,updateErrorForDispute:()=>Sr});var S={};r.r(S),r.d(S,{disputesDownloadEndpoint:()=>Tr,getDispute:()=>Or,getDisputes:()=>vr,getDisputesCSVRequestURL:()=>Rr,getDisputesSummary:()=>br});var E={};r.r(E),r.d(E,{getAccountBusinessSupportEmail:()=>Yr,getAccountBusinessSupportPhone:()=>Br,getAccountCommunicationsEmail:()=>No,getAccountDomesticCurrency:()=>Hr,getAccountStatementDescriptor:()=>qr,getAccountStatementDescriptorKana:()=>$r,getAccountStatementDescriptorKanji:()=>Lr,getAdvancedFraudProtectionSettings:()=>Ro,getAvailablePaymentMethodIds:()=>xr,getCompletedWaitingPeriod:()=>Zr,getCurrentProtectionLevel:()=>To,getDepositDelayDays:()=>Gr,getDepositRestrictions:()=>Jr,getDepositScheduleInterval:()=>Vr,getDepositScheduleMonthlyAnchor:()=>Wr,getDepositScheduleWeeklyAnchor:()=>Qr,getDepositStatus:()=>Kr,getDuplicatedPaymentMethodIds:()=>Mr,getEnabledPaymentMethodIds:()=>Ur,getExpressCheckoutCartMethods:()=>Po,getExpressCheckoutCheckoutMethods:()=>Co,getExpressCheckoutProductMethods:()=>Do,getIsCardPresentEligible:()=>_o,getIsDebugLogEnabled:()=>ao,getIsDevModeEnabled:()=>ro,getIsExpressCheckoutInPaymentMethodsEnabled:()=>no,getIsManualCaptureEnabled:()=>Xr,getIsMultiCurrencyEnabled:()=>so,getIsPaymentRequestEnabled:()=>oo,getIsSavedCardsEnabled:()=>po,getIsStripeBillingEnabled:()=>vo,getIsStripeBillingMigrationInProgress:()=>bo,getIsSubscriptionsPluginActive:()=>So,getIsTestModeEnabled:()=>eo,getIsTestModeOnboarding:()=>to,getIsWCPayEnabled:()=>Fr,getIsWCPaySubscriptionsEligible:()=>ho,getIsWCPaySubscriptionsEnabled:()=>yo,getIsWooPayEnabled:()=>Eo,getIsWooPayGlobalThemeSupportEnabled:()=>fo,getPaymentMethodStatuses:()=>kr,getPaymentRequestButtonBorderRadius:()=>mo,getPaymentRequestButtonSize:()=>co,getPaymentRequestButtonTheme:()=>uo,getPaymentRequestButtonType:()=>io,getSavingError:()=>lo,getSettings:()=>Cr,getShowWooPayIncompatibilityNotice:()=>Oo,getStripeBillingMigratedCount:()=>Ao,getStripeBillingSubscriptionCount:()=>Io,getWooPayCustomMessage:()=>go,getWooPayStoreLogo:()=>wo,isDirty:()=>zr,isSavingSettings:()=>jr});var f={};r.r(f),r.d(f,{saveOption:()=>Rn,saveSettings:()=>dn,submitStripeBillingSubscriptionMigration:()=>Tn,updateAccountBusinessSupportEmail:()=>nn,updateAccountBusinessSupportPhone:()=>an,updateAccountCommunicationsEmail:()=>En,updateAccountStatementDescriptor:()=>tn,updateAccountStatementDescriptorKana:()=>on,updateAccountStatementDescriptorKanji:()=>rn,updateAdvancedFraudProtectionSettings:()=>hn,updateDepositScheduleInterval:()=>sn,updateDepositScheduleMonthlyAnchor:()=>un,updateDepositScheduleWeeklyAnchor:()=>cn,updateEnabledPaymentMethodIds:()=>Vo,updateExpressCheckoutCartMethods:()=>gn,updateExpressCheckoutCheckoutMethods:()=>wn,updateExpressCheckoutProductMethods:()=>fn,updateIsCardPresentEligible:()=>ko,updateIsDebugLogEnabled:()=>Jo,updateIsExpressCheckoutInPaymentMethodsEnabled:()=>Ho,updateIsManualCaptureEnabled:()=>Zo,updateIsMultiCurrencyEnabled:()=>Xo,updateIsPaymentRequestEnabled:()=>Bo,updateIsSavedCardsEnabled:()=>xo,updateIsSavingSettings:()=>Qo,updateIsStripeBillingEnabled:()=>Sn,updateIsTestModeEnabled:()=>Ko,updateIsWCPayEnabled:()=>Yo,updateIsWCPaySubscriptionsEnabled:()=>en,updateIsWooPayEnabled:()=>mn,updateIsWooPayGlobalThemeSupportEnabled:()=>pn,updatePaymentRequestButtonBorderRadius:()=>Lo,updatePaymentRequestButtonSize:()=>zo,updatePaymentRequestButtonTheme:()=>qo,updatePaymentRequestButtonType:()=>jo,updateProtectionLevel:()=>yn,updateSelectedPaymentMethod:()=>Wo,updateSettings:()=>$o,updateUnselectedPaymentMethod:()=>Go,updateWooPayCustomMessage:()=>ln,updateWooPayStoreLogo:()=>_n});var g={};r.r(g),r.d(g,{getSettings:()=>On});var w={};r.r(w),r.d(w,{getCardReaderStats:()=>In,getCardReaderStatsError:()=>An,getCardReaders:()=>Nn});var T={};r.r(T),r.d(T,{updateCardReaderStats:()=>Dn,updateCardReaders:()=>Pn,updateErrorForCardReaderStats:()=>Cn,updateErrorForCardReaders:()=>Mn});var R={};r.r(R),r.d(R,{getCardReaderStats:()=>Fn,getCardReaders:()=>Un});var O={};r.r(O),r.d(O,{getActiveLoanSummary:()=>Ln,getActiveLoanSummaryError:()=>$n,getLoans:()=>Yn,getLoansError:()=>Bn});var v={};r.r(v),r.d(v,{updateActiveLoanSummary:()=>Hn,updateErrorForActiveLoanSummary:()=>Vn,updateErrorForLoans:()=>Wn,updateLoans:()=>Qn});var b={};r.r(b),r.d(b,{getActiveLoanSummary:()=>Gn,getLoans:()=>Zn});var I={};r.r(I),r.d(I,{getDocuments:()=>ta,getDocumentsError:()=>ra,getDocumentsSummary:()=>na,getDocumentsSummaryError:()=>aa});var A={};r.r(A),r.d(A,{updateDocuments:()=>sa,updateDocumentsSummary:()=>ca,updateErrorForDocuments:()=>ia,updateErrorForDocumentsSummary:()=>ua});var N={};r.r(N),r.d(N,{formatQueryFilters:()=>da,getDocuments:()=>ma,getDocumentsSummary:()=>pa});var D={};r.r(D),r.d(D,{getPaymentIntent:()=>_a,getPaymentIntentError:()=>ya});var P={};r.r(P),r.d(P,{getAuthorization:()=>wa,getAuthorizations:()=>ga,getAuthorizationsError:()=>Ta,getAuthorizationsSummary:()=>Oa,getAuthorizationsSummaryError:()=>va,getIsRequesting:()=>ba});var C={};r.r(C),r.d(C,{setIsRequestingAuthorization:()=>Ca,submitCancelAuthorization:()=>Fa,submitCaptureAuthorization:()=>Ma,updateAuthorization:()=>Da,updateAuthorizations:()=>Aa,updateAuthorizationsSummary:()=>Pa,updateErrorForAuthorizations:()=>Na,updateErrorForAuthorizationsSummary:()=>Ua});var M={};r.r(M),r.d(M,{getAuthorization:()=>ka,getAuthorizations:()=>xa,getAuthorizationsSummary:()=>ja});var F={};r.r(F),r.d(F,{getFile:()=>$a,getFileError:()=>Ya});var U={};r.r(U),r.d(U,{updateErrorForFiles:()=>Ha,updateFiles:()=>Ba});var x={};r.r(x),r.d(x,{getFile:()=>Va});var k={};r.r(k),r.d(k,{getPmPromotions:()=>Ga,getPmPromotionsError:()=>Za});var j={};r.r(j),r.d(j,{activatePmPromotion:()=>es,dismissPmPromotion:()=>ts,updateErrorForPmPromotions:()=>Xa,updatePmPromotions:()=>Ja});var z={};r.r(z),r.d(z,{getPmPromotions:()=>os});var q=r(5338),L=r(1609);const $=window.wp.i18n,Y=e=>{const t=wcpay_order_config??wc.wcSettings.getSetting("woocommerce_payments_data");return t?.[e]},B=window.moment;var H=r.n(B);const V={bank_cannot_process:{display:(0,$.__)("Bank cannot process","woocommerce-payments")},check_returned:{display:(0,$.__)("Check returned","woocommerce-payments")},credit_not_processed:{display:(0,$.__)("Credit not processed","woocommerce-payments"),overview:[(0,$.__)("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,$.__)("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")],summary:[(0,$.__)("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")],required:[(0,$.__)("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")],respond:[(0,$.__)("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,$.__)("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")],claim:(0,$.__)("The cardholder claims a credit was not processed.","woocommerce-payments")},customer_initiated:{display:(0,$.__)("Customer initiated","woocommerce-payments")},debit_not_authorized:{display:(0,$.__)("Debit not authorized","woocommerce-payments")},duplicate:{display:(0,$.__)("Duplicate","woocommerce-payments"),overview:[(0,$.__)("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,$.__)("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")],summary:[(0,$.__)("The customer claims they were charged multiple times for the same product or service.","woocommerce-payments")],required:[(0,$.__)("Demonstrate that each payment was for a separate product or service.","woocommerce-payments")],respond:[(0,$.__)("Determine if your customer was incorrectly charged multiple times.","woocommerce-payments"),(0,$.__)("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,$.__)("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,$.__)("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")],claim:(0,$.__)("The cardholder claims this is a duplicate transaction.","woocommerce-payments")},fraudulent:{display:(0,$.__)("Transaction unauthorized","woocommerce-payments"),overview:[(0,$.__)("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,$.__)("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")],summary:[(0,$.__)("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")],required:[(0,$.__)("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")],respond:[(0,$.__)("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,$.__)("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,$.__)("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")],claim:(0,$.__)("The cardholder claims this is an unauthorized transaction.","woocommerce-payments")},general:{display:(0,$.__)("General","woocommerce-payments"),overview:[(0,$.__)("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")],summary:[(0,$.__)("This is an uncategorized dispute, so you should contact the customer for additional details to find out why the payment was disputed.","woocommerce-payments")]},incorrect_account_details:{display:(0,$.__)("Incorrect account details","woocommerce-payments")},insufficient_funds:{display:(0,$.__)("Insufficient funds","woocommerce-payments")},product_not_received:{display:(0,$.__)("Product not received","woocommerce-payments"),overview:[(0,$.__)("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,$.__)("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")],summary:[(0,$.__)("The customer claims they did not receive the products or services purchased.","woocommerce-payments")],required:[(0,$.__)("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")],respond:[(0,$.__)("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,$.__)("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")],claim:(0,$.__)("The cardholder claims they did not receive the product.","woocommerce-payments")},product_unacceptable:{display:(0,$.__)("Product unacceptable","woocommerce-payments"),overview:[(0,$.__)("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,$.__)("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")],summary:[(0,$.__)("The product or service was received but was defective, damaged, or not as described.","woocommerce-payments")],required:[(0,$.__)("Demonstrate that the product or service was delivered as described at the time of purchase.","woocommerce-payments")],respond:[(0,$.__)("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,$.__)("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,$.__)("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,$.__)("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,$.__)("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")],claim:(0,$.__)("The cardholder claims the product was unacceptable.","woocommerce-payments")},subscription_canceled:{display:(0,$.__)("Subscription canceled","woocommerce-payments"),overview:[(0,$.__)("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,$.__)("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")],summary:[(0,$.__)("The customer claims that you continued to charge them after a subscription was canceled.","woocommerce-payments")],required:[(0,$.__)("Prove that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments")],respond:[(0,$.__)("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,$.__)("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,$.__)("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")],claim:(0,$.__)("The cardholder claims a subscription was canceled.","woocommerce-payments")},unrecognized:{display:(0,$.__)("Unrecognized","woocommerce-payments"),overview:[(0,$.__)("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,$.__)("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")],summary:[(0,$.__)("The customer doesn’t recognize the payment appearing on their card statement.","woocommerce-payments")],required:[(0,$.__)("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")],respond:[(0,$.__)("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,$.__)("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")]},noncompliant:{display:(0,$.__)("Non-compliant","woocommerce-payments"),claim:(0,$.__)("Your customer’s bank claims this payment violates Visa’s rules.","woocommerce-payments"),summary:[(0,$.__)("This transaction is being reviewed under Visa’s network compliance rules.","woocommerce-payments")]}},Q={warning_needs_response:(0,$.__)("Inquiry: Response needed","woocommerce-payments"),warning_under_review:(0,$.__)("Inquiry: Under review","woocommerce-payments"),warning_closed:(0,$.__)("Inquiry: Closed","woocommerce-payments"),needs_response:(0,$.__)("Response needed","woocommerce-payments"),under_review:(0,$.__)("Under review","woocommerce-payments"),charge_refunded:(0,$.__)("Charge refunded","woocommerce-payments"),won:(0,$.__)("Won","woocommerce-payments"),lost:(0,$.__)("Lost","woocommerce-payments")},W=(Object.entries(Q).map(([e,t])=>({label:t,value:e})).filter(function(e){return null!=e}),["needs_response","warning_needs_response"]),G=["under_review","warning_under_review"],Z=((0,$.__)("Dispute currency","woocommerce-payments"),(0,$.__)("All currencies","woocommerce-payments"),(0,$.__)("Show","woocommerce-payments"),(0,$.__)("Needs response","woocommerce-payments"),(0,$.__)("All disputes","woocommerce-payments"),(0,$.__)("Advanced filters","woocommerce-payments"),(()=>{const e=window.wc?.wcSettings,t=e?.getSetting?.("wcVersion");return null==t?"":String(t)})()),K=parseFloat(Z),J=(K<7.8?(0,$.__)("Disputes match {{select /}} filters","woocommerce-payments"):(0,$.__)("Disputes match <select /> filters","woocommerce-payments"),(0,$.__)("Disputed on date","woocommerce-payments"),(0,$.__)("Remove dispute date filter","woocommerce-payments"),(0,$.__)("Select a dispute date filter match","woocommerce-payments"),K<7.8?(0,$.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,$.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),(0,$.__)("Select a dispute date","woocommerce-payments"),(0,$.__)("Before","woocommerce-payments"),(0,$.__)("After","woocommerce-payments"),(0,$.__)("Between","woocommerce-payments"),(0,$.__)("Status","woocommerce-payments"),(0,$.__)("Remove dispute status filter","woocommerce-payments"),(0,$.__)("Select a dispute status filter match","woocommerce-payments"),K<7.8?(0,$.__)("{{title}}Status{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,$.__)("<title>Status</title> <rule /> <filter />","woocommerce-payments"),(0,$.__)("Select a dispute status","woocommerce-payments"),(0,$._x)("Is","dispute status","woocommerce-payments"),(0,$._x)("Is not","dispute status","woocommerce-payments"),window.wp.domReady);var X=r.n(J);const ee=(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]}X()(()=>{(wc?.tracks?.recordEvent??wcTracks.recordEvent)(e,t)})};(0,L.createContext)(window.wcpaySettings),(0,L.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""});const te=window.wc.currency;var re=r.n(te);const oe=window.lodash;(0,$.__)("Australian dollar","woocommerce-payments"),(0,$.__)("Canadian dollar","woocommerce-payments"),(0,$.__)("Swiss franc","woocommerce-payments"),(0,$.__)("Danish krone","woocommerce-payments"),(0,$.__)("Euro","woocommerce-payments"),(0,$.__)("Pound sterling","woocommerce-payments"),(0,$.__)("Norwegian krone","woocommerce-payments"),(0,$.__)("New Zealand dollar","woocommerce-payments"),(0,$.__)("Swedish krona","woocommerce-payments"),(0,$.__)("United States (US) dollar","woocommerce-payments");const ne=(e,t="USD",r=null,o=!1)=>{const n=(e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase()))(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 re()(r[o]);const n=(0,oe.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),re()(n)}return null})(t):((e,t=null)=>{const{currencyData:r,connect:{country:o="US"}}=wcpaySettings,n=(0,oe.find)(r,{code:e.toUpperCase()});if(n){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||r[o]){const e=t?(0,oe.find)(r,{code:t.toUpperCase()}):r[o];e&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition)}return re()(n)}return null})(t,r);if(null===c)return i+se(s,t,n);try{return i+("function"==typeof c.formatAmount?ie(c.formatAmount(s)):ie(c.formatCurrency(s)))}catch(e){return i+ie(se(s,t,n))}},ae=(e,t="USD",r=!1,o=null)=>{let n=ne(e,t,o);return wcpaySettings.shouldUseExplicitPrice?(r&&(n=function(e){return e.replace(/[^0-9,.' ]/g,"").trim()}(n)),((e,t)=>(-1===e.toString().indexOf(t)&&(e=e+" "+t),e))(n,t.toUpperCase())):n};function se(e,t,r){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:r})}catch(o){return(0,$.sprintf)(r?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function ie(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}const ce=e=>W.includes(e),ue=e=>G.includes(e),de=e=>e.startsWith("warning");function me(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 pe(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=pe(e.slice(o+1,a),t),i=(0,L.cloneElement)(r,{},s);if(n.push(i),a<e.length-1){const r=pe(e.slice(a+1),t);n=n.concat(r)}}return n=n.filter(Boolean),0===n.length?null:1===n.length?n[0]:(0,L.createElement)(L.Fragment,null,...n)}function le(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(me)}(t);try{return pe(n,r)}catch(e){if(o)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}const _e=window.wp.components;function ye(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=ye(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const he=function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=ye(e))&&(o&&(o+=" "),o+=t);return o};var Se=r(5955),Ee=r(9031),fe=r(4275),ge=r(4848);const we=function(e){const{icon:t,actions:r,children:o,buttonVariant:n,...a}=e;a.className=he("wcpay-inline-notice",`wcpay-inline-${a.status}-notice`,a.className);let s=t;if(!0===s)switch(a.status){case"success":s=(0,ge.jsx)(Se.A,{});break;case"error":case"warning":s=(0,ge.jsx)(Ee.A,{});break;default:s=(0,ge.jsx)(fe.A,{})}const i="wcpay-inline-notice__action",c=r?.map((e,t)=>"url"in e?(0,ge.jsx)("a",{className:i,href:e.url,children:e.label},t):(0,ge.jsx)(_e.Button,{className:i,onClick:e.onClick,isBusy:e.isBusy??!1,disabled:e.disabled??!1,variant:n,children:e.label},t));return(0,ge.jsx)(_e.Notice,{...a,children:(0,ge.jsxs)(_e.Flex,{align:"center",justify:"flex-start",children:[s&&(0,ge.jsx)(_e.FlexItem,{className:`wcpay-inline-notice__icon wcpay-inline-${a.status}-notice__icon`,children:(0,ge.jsx)(_e.Icon,{icon:s,size:24})}),(0,ge.jsxs)(_e.FlexItem,{className:`wcpay-inline-notice__content wcpay-inline-${a.status}-notice__content`,children:[o,c&&(0,ge.jsx)(_e.Flex,{className:"wcpay-inline-notice__content__actions",align:"baseline",justify:"flex-start",gap:4,children:c})]})]})})},Te=()=>(0,ge.jsx)(we,{icon:!0,status:"warning",isDismissible:!1,children:le({mixedString:(0,$.__)("WooPayments was in test mode when this order was placed. {{learnMoreLink/}}","woocommerce-payments"),components:{learnMoreLink:(0,ge.jsx)(_e.ExternalLink,{href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/testing/",children:(0,$.__)("Learn more about test mode","woocommerce-payments")})}})}),Re=window.wp.element,Oe=(window.wc.components,window.wp.url),ve=window.wp.date;window.wc.number;const be=e=>(0,Oe.addQueryArgs)("admin.php",e),Ie=(e,t=!1)=>{const r=t?H()(e).endOf("day").utc().toISOString():H()(e).startOf("day").utc().toISOString();return e&&(0,ve.dateI18n)("Y-m-d H:i:s",r,!0)},Ae=window.wp.data,Ne=window.wp.dataControls,De="/wc/v3/payments",Pe="wc/payments",Ce={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"},Me=e=>JSON.stringify(e,Object.keys(e).sort()),Fe={byId:{},queries:{},count:0,instant:{}},Ue=e=>e&&e.deposits||{},xe=(e,t)=>(Ue(e).byId||{})[t],ke=e=>{const t=Ue(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)]}},je=e=>(Ue(e).overviews||{}).error,ze=(e,t)=>{const r=Me(t);return(Ue(e).queries||{})[r]||{}},qe=(e,t)=>(ze(e,t).data||[]).map(xe.bind(void 0,e)),Le=e=>Ue(e).count,$e=(e,t)=>ze(e,t).error||{},Ye=(e,t)=>{const r=Me(t);return(Ue(e).summary||{})[r]||{}},Be=(e,t)=>Ye(e,t).data||{},He=(e,t)=>Ye(e,t).error||{},Ve=e=>(Ue(e).instant||{}).data;function Qe(e){return{type:Ce.SET_DEPOSIT,data:e}}function We(e){return{type:Ce.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function Ge(e,t){return{type:Ce.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function Ze(e,t){return{type:Ce.SET_DEPOSITS,query:e,data:t}}function Ke(e){return{type:Ce.SET_DEPOSITS_COUNT,data:e}}function Je(e,t,r){return{type:Ce.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:r}}function Xe(e,t){return{type:Ce.SET_DEPOSITS_SUMMARY,query:e,data:t}}function et(e,t,r){return{type:Ce.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:r}}function tt(e){return{type:Ce.SET_INSTANT_DEPOSIT,data:e}}function*rt(e){try{yield(0,Ae.dispatch)(Pe).startResolution("getInstantDeposit",[e]);const t=yield(0,Ne.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield tt(t),yield(0,Ae.dispatch)(Pe).invalidateResolutionForStoreSelector("getDeposits"),yield(0,Ae.dispatch)(Pe).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,Ae.dispatch)("core/notices").createSuccessNotice((0,$.sprintf)((0,$.__)("Instant payout for %s in transit.","woocommerce-payments"),ne(t.amount)),{actions:[{label:(0,$.__)("View details","woocommerce-payments"),url:be({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,Ae.dispatch)("core/notices").createErrorNotice((0,$.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,Ae.dispatch)(Pe).finishResolution("getInstantDeposit",[e])}}function*ot(e){if(/\W/.test(e))return;const t=(0,Oe.addQueryArgs)(`${De}/deposits/${e}`);try{const e=yield(0,Ne.apiFetch)({path:t});yield Qe(e)}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving payout.","woocommerce-payments"))}}function*nt(){const e=(0,Oe.addQueryArgs)(`${De}/deposits/overview-all`);try{const t=yield(0,Ne.apiFetch)({path:e});yield We(t)}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield Ge()}}const at=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Ie(e.dateBefore,!0),date_after:Ie(e.dateAfter),date_between:e.dateBetween&&[Ie(e.dateBetween[0]),Ie(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),st=`${De}/deposits/download`;function it(e){return(0,Oe.addQueryArgs)(st,at(e))}function*ct(e){const t=(0,Oe.addQueryArgs)(`${De}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...at(e)});try{const r=yield(0,Ne.apiFetch)({path:t})||{};yield Ze(e,r.data),yield Ke(r.total_count);for(const e in r.data)yield Ae.controls.dispatch(Pe,"finishResolution","getDeposit",[r.data[e].id])}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving payouts.","woocommerce-payments")),yield Je(e,null,t)}}function*ut(e){const t=(0,Oe.addQueryArgs)(`${De}/deposits/summary`,at(e));try{const r=yield(0,Ne.apiFetch)({path:t});yield Xe(e,r)}catch(t){yield et(e,null,t)}}const dt={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"},mt={summary:{},fraudProtection:{review:{summary:{}},block:{summary:{}}}},pt=e=>e&&e.transactions||{},lt=(e,t)=>{const r=Me(t);return pt(e)[r]||{}},_t=(e,t)=>lt(e,t).data||[],yt=(e,t)=>lt(e,t).error||{},ht=(e,t)=>{const r=Me(t);return pt(e).summary[r]||{}},St=(e,t)=>ht(e,t).data||{},Et=(e,t)=>ht(e,t).error||{},ft=(e,t,r)=>{const o=Me(r);return pt(e).fraudProtection?.[t]?.[o]||{}},gt=(e,t,r)=>ft(e,t,r).data||[],wt=(e,t,r)=>ft(e,t,r).error||{},Tt=(e,t,r)=>{const o=Me(r);return pt(e).fraudProtection?.[t]?.summary[o]||{}},Rt=(e,t,r)=>Tt(e,t,r).data||{},Ot=(e,t,r)=>Tt(e,t,r).error||{};function vt(e,t){return{type:dt.SET_TRANSACTIONS,query:e,data:t}}function bt(e,t,r){return{type:dt.SET_ERROR_FOR_TRANSACTIONS,query:e,data:t,error:r}}function It(e,t){return{type:dt.SET_TRANSACTIONS_SUMMARY,query:e,data:t}}function At(e,t,r){return{type:dt.SET_ERROR_FOR_TRANSACTIONS_SUMMARY,query:e,data:t,error:r}}function Nt(e,t,r){return{type:dt.SET_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:r}}function Dt(e,t,r){return{type:dt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:null,error:r}}function Pt(e,t,r){return{type:dt.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:r}}function Ct(e,t,r){return{type:dt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:null,error:r}}const Mt=e=>({user_email:e.userEmail,match:e.match,date_before:Ie(e.dateBefore,!0),date_after:Ie(e.dateAfter),date_between:e.dateBetween&&[Ie(e.dateBetween[0]),Ie(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:H()(new Date).format("Z"),locale:e.locale});function*Ft(e){const t=(0,Oe.addQueryArgs)(`${De}/transactions`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Mt(e)});try{const r=yield(0,Ne.apiFetch)({path:t});yield vt(e,r.data||[])}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transactions.","woocommerce-payments")),yield bt(e,null,t)}}const Ut=`${De}/transactions/download`;function xt(e){return(0,Oe.addQueryArgs)(Ut,Mt(e))}function*kt(e){const t=(0,Oe.addQueryArgs)(`${De}/transactions/summary`,Mt(e));try{const r=yield(0,Ne.apiFetch)({path:t});yield It(e,r)}catch(t){yield At(e,null,t)}}function*jt(e,t){const r=(0,Oe.addQueryArgs)(`${De}/transactions/fraud-outcomes`,{status:e,page:t.paged,sort:t.orderby,pagesize:t.perPage,direction:t.order,additional_status:t.additionalStatus,...Mt(t)});try{const o=yield(0,Ne.apiFetch)({path:r});yield Nt(e,t,o.data||[])}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield Nt(e,t,[]));yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transactions.","woocommerce-payments")),yield Dt(e,t,r)}}function*zt(e,t){const r=(0,Oe.addQueryArgs)(`${De}/transactions/fraud-outcomes/summary`,{status:e,additional_status:t.additionalStatus}),o={count:0,total:0};try{const n=yield(0,Ne.apiFetch)({path:r});yield Pt(e,t,n||o)}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield Pt(e,t,o));yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving on review transactions.","woocommerce-payments")),yield Ct(e,t,r)}}function qt(e,t){return(0,Oe.addQueryArgs)(`${De}/transactions/fraud-outcomes/download`,{status:e,sort:t.orderby,direction:t.order,additional_status:t.additionalStatus,...Mt(t)})}const Lt={SET_CHARGE:"SET_CHARGE",SET_ERROR_FOR_CHARGE:"SET_ERROR_FOR_CHARGE"},$t=(e,t)=>e.charges[t]&&e.charges[t].data?e.charges[t].data:{},Yt=(e,t)=>e.charges[t]&&e.charges[t].error?e.charges[t].error:{},Bt=(e,t)=>$t(e,t),Ht=(e,t)=>Yt(e,t);function Vt(e,t){return{type:Lt.SET_CHARGE,id:e,data:t}}function Qt(e,t,r){return{type:Lt.SET_ERROR_FOR_CHARGE,id:e,data:t,error:r}}function*Wt(e){try{const t=yield(0,Ne.apiFetch)({path:`${De}/charges/${e}`});yield Vt(e,t)}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transaction.","woocommerce-payments")),yield Qt(e,null,t)}}function*Gt(e){try{const t=yield(0,Ne.apiFetch)({path:`${De}/charges/order/${e}`});yield Vt(e,t)}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transaction.","woocommerce-payments")),yield Qt(e,null,t)}}const Zt={SET_TIMELINE:"SET_TIMELINE",SET_ERROR_FOR_TIMELINE:"SET_ERROR_FOR_TIMELINE"},Kt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].data?e.timeline[t].data:{},Jt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].error?e.timeline[t].error:{};function Xt(e,t){return{id:e,type:Zt.SET_TIMELINE,data:t}}function er(e,t){return{id:e,type:Zt.SET_ERROR_FOR_TIMELINE,error:t}}function*tr(e){try{const t=yield(0,Ne.apiFetch)({path:`${De}/timeline/${e}`});yield Xt(e,t.data)}catch(t){yield er(e,t)}}const rr={SET_DISPUTE:"SET_DISPUTE",SET_ERROR_FOR_DISPUTE:"SET_ERROR_FOR_DISPUTE",SET_DISPUTES:"SET_DISPUTES",SET_DISPUTES_SUMMARY:"SET_DISPUTES_SUMMARY"},or={byId:{},queries:{},summary:{},cached:{}},nr=e=>e&&e.disputes||{},ar=(e,t)=>(nr(e).byId||{})[t],sr=(e,t)=>{const r=nr(e).byId||{};return r[t]?.error},ir=(e,t)=>(nr(e).cached||{})[t],cr=(e,t)=>{const r=((e,t)=>{const r=Me(t);return(nr(e).queries||{})[r]||{}})(e,t).data||[];return r.map(ir.bind(void 0,e))},ur=(e,t)=>((e,t)=>{const r=Me(t);return(nr(e).summary||{})[r]||{}})(e,t).data||{};var dr=function(e){return e.SET_PAYMENT_INTENT="SET_PAYMENT_INTENT",e.SET_ERROR_FOR_PAYMENT_INTENT="SET_ERROR_FOR_PAYMENT_INTENT",e}(dr||{});const mr=dr;function pr(e,t){return{type:mr.SET_PAYMENT_INTENT,id:e,data:t}}function lr(e,t){return{type:mr.SET_ERROR_FOR_PAYMENT_INTENT,id:e,error:t}}function*_r(e,t){const r=e.payment_intent;try{yield(0,Ne.apiFetch)({path:"/wc/v3/payments/refund/",method:"post",data:{charge_id:e.id,amount:e.amount,reason:t,order_id:e?.order?.id}}),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getTimeline"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield Ae.controls.dispatch("core/notices","createSuccessNotice",(0,$.sprintf)((0,$.__)("Refunded payment #%s.","woocommerce-payments"),r))}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.sprintf)((0,$.__)("There has been an error refunding the payment #%s. Please try again later.","woocommerce-payments"),r))}}function*yr(e){try{const t=yield(0,Ne.apiFetch)({path:`${De}/payment_intents/${e}`});yield pr(e,t)}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transaction.","woocommerce-payments")),yield lr(e,t)}}function hr(e){return{type:rr.SET_DISPUTE,data:e}}function Sr(e,t,r){return{type:rr.SET_ERROR_FOR_DISPUTE,id:e,data:t,error:r}}function Er(e,t){return{type:rr.SET_DISPUTES,query:e,data:t}}function fr(e,t){return{type:rr.SET_DISPUTES_SUMMARY,query:e,data:t}}function*gr(e){const{id:t,payment_intent:r}=e;try{yield Ae.controls.dispatch(Pe,"startResolution","getDispute",[t]);const e=yield(0,Ne.apiFetch)({path:`${De}/disputes/${t}/close`,method:"post"});yield hr(e),yield yr(r),yield Ae.controls.dispatch(Pe,"finishResolution","getDispute",[t]);const o=e.order?(0,$.sprintf)((0,$.__)("You have accepted the dispute for order #%s.","woocommerce-payments"),e.order.number):(0,$.__)("You have accepted the dispute.","woocommerce-payments");yield Ae.controls.dispatch("core/notices","createSuccessNotice",o)}catch(e){const r=(0,$.__)("There has been an error accepting the dispute. Please try again later.","woocommerce-payments");yield Ae.controls.dispatch("core/notices","createErrorNotice",r),yield Ae.controls.dispatch(Pe,"finishResolution","getDispute",[t])}}const wr=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Ie(e.dateBefore,!0),date_after:Ie(e.dateAfter),date_between:e.dateBetween&&[Ie(e.dateBetween[0]),Ie(e.dateBetween[1],!0)],search:"awaiting_response"===e.filter?W:e.search,status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),Tr=`${De}/disputes/download`;function Rr(e){return(0,Oe.addQueryArgs)(Tr,wr(e))}function*Or(e){const t=(0,Oe.addQueryArgs)(`${De}/disputes/${e}`);try{const e=yield(0,Ne.apiFetch)({path:t});yield hr(e)}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving dispute.","woocommerce-payments")),yield Sr(e,void 0,t)}}function*vr(e){const t=(0,Oe.addQueryArgs)(`${De}/disputes`,{page:e.paged,pagesize:e.perPage,sort:(0,oe.snakeCase)(e.orderBy),direction:e.order,...wr(e)});try{const r=yield(0,Ne.apiFetch)({path:t})||{};yield Er(e,r.data)}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving disputes.","woocommerce-payments"))}}function*br(e){const t=(0,Oe.addQueryArgs)(`${De}/disputes/summary`,{page:e.paged,pagesize:e.perPage,...wr(e)});try{const r=yield(0,Ne.apiFetch)({path:t});yield fr(e,r)}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving the summary of disputes.","woocommerce-payments"))}}const Ir={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"},Ar={isDirty:!1,isSaving:!1,savingError:null,data:{}},Nr={},Dr=[],Pr=e=>e&&e.settings||Nr,Cr=e=>Pr(e).data||Nr,Mr=e=>Cr(e).duplicated_payment_method_ids||Nr,Fr=e=>Cr(e).is_wcpay_enabled||!1,Ur=e=>Cr(e).enabled_payment_method_ids||Dr,xr=e=>Cr(e).available_payment_method_ids||Dr,kr=e=>Cr(e).payment_method_statuses||Nr,jr=e=>Pr(e).isSaving||!1,zr=e=>Pr(e).isDirty||!1,qr=e=>Cr(e).account_statement_descriptor||"",Lr=e=>Cr(e).account_statement_descriptor_kanji||"",$r=e=>Cr(e).account_statement_descriptor_kana||"",Yr=e=>Cr(e).account_business_support_email||"",Br=e=>Cr(e).account_business_support_phone||"",Hr=e=>Cr(e).account_domestic_currency||"",Vr=e=>Cr(e).deposit_schedule_interval||"",Qr=e=>Cr(e).deposit_schedule_weekly_anchor||"",Wr=e=>Cr(e).deposit_schedule_monthly_anchor||"",Gr=e=>Cr(e).deposit_delay_days||"7",Zr=e=>Cr(e).deposit_completed_waiting_period||!1,Kr=e=>Cr(e).deposit_status||"",Jr=e=>Cr(e).deposit_restrictions||"",Xr=e=>Cr(e).is_manual_capture_enabled||!1,eo=e=>Cr(e).is_test_mode_enabled||!1,to=e=>Cr(e).is_test_mode_onboarding||!1,ro=e=>Cr(e).is_dev_mode_enabled||!1,oo=e=>Cr(e).is_payment_request_enabled||!1,no=e=>Cr(e).is_express_checkout_in_payment_methods_enabled||!1,ao=e=>Cr(e).is_debug_log_enabled||!1,so=e=>Cr(e).is_multi_currency_enabled||!1,io=e=>Cr(e).payment_request_button_type||"",co=e=>Cr(e).payment_request_button_size||"",uo=e=>Cr(e).payment_request_button_theme||"",mo=e=>{const t=Cr(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=>Cr(e).is_saved_cards_enabled||!1,lo=e=>Pr(e).savingError,_o=e=>Cr(e).is_card_present_eligible||!1,yo=e=>Cr(e).is_wcpay_subscriptions_enabled||!1,ho=e=>Cr(e).is_wcpay_subscriptions_eligible||!1,So=e=>Cr(e).is_subscriptions_plugin_active||!1,Eo=e=>Cr(e).is_woopay_enabled||!1,fo=e=>Cr(e).is_woopay_global_theme_support_enabled||!1,go=e=>Cr(e).woopay_custom_message||"",wo=e=>Cr(e).woopay_store_logo||"",To=e=>Cr(e).current_protection_level||"basic",Ro=e=>Cr(e).advanced_fraud_protection_settings||Dr,Oo=e=>Cr(e).show_woopay_incompatibility_notice||!1,vo=e=>Cr(e).is_stripe_billing_enabled||!1,bo=e=>Cr(e).is_migrating_stripe_billing||!1,Io=e=>Cr(e).stripe_billing_subscription_count||0,Ao=e=>Cr(e).stripe_billing_migrated_count||0,No=e=>Cr(e).account_communications_email||"",Do=e=>Cr(e).express_checkout_product_methods||Dr,Po=e=>Cr(e).express_checkout_cart_methods||Dr,Co=e=>Cr(e).express_checkout_checkout_methods||Dr,Mo=window.wp.apiFetch;var Fo=r.n(Mo);function Uo(e){return{type:Ir.SET_SETTINGS_VALUES,payload:e}}function xo(e){return Uo({is_saved_cards_enabled:e})}function ko(e){return Uo({is_card_present_eligible:e})}function jo(e){return Uo({payment_request_button_type:e})}function zo(e){return Uo({payment_request_button_size:e})}function qo(e){return Uo({payment_request_button_theme:e})}function Lo(e){return Uo({payment_request_button_border_radius:e})}function $o(e){return{type:Ir.SET_SETTINGS,data:e}}function Yo(e){return Uo({is_wcpay_enabled:e})}function Bo(e){return Uo({is_payment_request_enabled:e})}function Ho(e){return Uo({is_express_checkout_in_payment_methods_enabled:e})}function Vo(e){return Uo({enabled_payment_method_ids:[...e]})}function Qo(e,t){return{type:Ir.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function Wo(e){return{type:Ir.SET_SELECTED_PAYMENT_METHOD,id:e}}function Go(e){return{type:Ir.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function Zo(e){return Uo({is_manual_capture_enabled:e})}function Ko(e){return Uo({is_test_mode_enabled:e})}function Jo(e){return Uo({is_debug_log_enabled:e})}function Xo(e){return Uo({is_multi_currency_enabled:e})}function en(e){return Uo({is_wcpay_subscriptions_enabled:e})}function tn(e){return Uo({account_statement_descriptor:e})}function rn(e){return Uo({account_statement_descriptor_kanji:e})}function on(e){return Uo({account_statement_descriptor_kana:e})}function nn(e){return Uo({account_business_support_email:e})}function an(e){return Uo({account_business_support_phone:e})}function sn(e){return Uo({deposit_schedule_interval:e})}function cn(e){return Uo({deposit_schedule_weekly_anchor:e})}function un(e){return Uo({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*dn(){let e=null;try{const e=(0,Ae.select)(Pe).getSettings();yield Qo(!0,null);const t=yield(0,Ne.apiFetch)({path:`${De}/settings`,method:"post",data:e});yield Uo({payment_method_statuses:t.data.payment_method_statuses}),yield(0,Ae.dispatch)("core/notices").createSuccessNotice((0,$.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,Ae.dispatch)("core/notices").createErrorNotice((0,$.__)("Error saving settings.","woocommerce-payments")),e.server_error&&(yield(0,Ae.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield Qo(!1,e)}return null===e}function mn(e){return Uo({is_woopay_enabled:e})}function pn(e){return Uo({is_woopay_global_theme_support_enabled:e})}function ln(e){return Uo({woopay_custom_message:e})}function _n(e){return Uo({woopay_store_logo:e})}function yn(e){return Uo({current_protection_level:e})}function hn(e){return Uo({advanced_fraud_protection_settings:e})}function Sn(e){return Uo({is_stripe_billing_enabled:e})}function En(e){return Uo({account_communications_email:e})}function fn(e){return Uo({express_checkout_product_methods:[...e]})}function gn(e){return Uo({express_checkout_cart_methods:[...e]})}function wn(e){return Uo({express_checkout_checkout_methods:[...e]})}function*Tn(){try{yield(0,Ae.dispatch)(Pe).startResolution("scheduleStripeBillingMigration"),yield(0,Ne.apiFetch)({path:`${De}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,Ae.dispatch)("core/notices").createErrorNotice((0,$.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,Ae.dispatch)(Pe).finishResolution("scheduleStripeBillingMigration")}function Rn(e,t){return Fo()({path:`${De}/settings/${e}`,method:"post",data:{value:t}}).catch(()=>{(0,Ae.dispatch)("core/notices").createErrorNotice((0,$.__)("Error saving option","woocommerce-payments"))})}function*On(){const e=`${De}/settings`;try{const t=yield(0,Ne.apiFetch)({path:e});yield $o(t)}catch(e){yield(0,Ae.dispatch)("core/notices").createErrorNotice((0,$.__)("Error retrieving settings.","woocommerce-payments"))}}const vn=e=>()=>{const{updateExpressCheckoutProductMethods:t,updateExpressCheckoutCartMethods:r,updateExpressCheckoutCheckoutMethods:o}=(0,Ae.useDispatch)(Pe),n=(0,Ae.useSelect)(e=>e(Pe).getExpressCheckoutProductMethods()),a=(0,Ae.useSelect)(e=>e(Pe).getExpressCheckoutCartMethods()),s=(0,Ae.useSelect)(e=>e(Pe).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))}]},bn=(vn("payment_request"),vn("woopay"),vn("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"}),In=(e,t)=>e.readers[t]&&e.readers[t].data?e.readers[t].data:{},An=(e,t)=>e.readers[t]&&e.readers[t].error?e.readers[t].error:{},Nn=e=>e.readers&&e.readers.list?e.readers.list:{};function Dn(e,t){return{type:bn.SET_CARD_READER_STATS,id:e,data:t}}function Pn(e,t){return{type:bn.SET_READERS,query:e,data:t}}function Cn(e,t,r){return{type:bn.SET_CARD_ERROR_FOR_READER_STATS,id:e,data:t,error:r}}function Mn(e,t){return{type:bn.SET_CARD_ERROR_FOR_READERS,data:e,error:t}}function*Fn(e,t){try{const r=yield(0,Ne.apiFetch)({path:`${De}/readers/charges/${t}`});yield Dn(e,r)}catch(t){yield Cn(e,null,t)}}function*Un(e){const t=(0,Oe.addQueryArgs)(`${De}/readers`,{limit:e.limit});try{const r=yield(0,Ne.apiFetch)({path:t})||{};yield Pn(e,r)}catch(e){yield Mn(null,e)}}var xn=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}(xn||{});const kn=xn,jn={},zn=(e=jn,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 qn=e=>e&&e.capital||{},Ln=e=>qn(e).summary,$n=e=>qn(e).summaryError,Yn=e=>qn(e).loans||[],Bn=e=>qn(e).loansError;function Hn(e){return{type:kn.SET_ACTIVE_LOAN_SUMMARY,data:e}}function Vn(e){return{type:kn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY,error:e}}function Qn(e){return{type:kn.SET_LOANS,data:e.data}}function Wn(e){return{type:kn.SET_ERROR_FOR_LOANS,error:e}}function*Gn(){const e=`${De}/capital/active_loan_summary`;try{const t=yield(0,Ne.apiFetch)({path:e});yield Hn(t)}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Vn(e)}}function*Zn(){const e=`${De}/capital/loans`;try{const t=yield(0,Ne.apiFetch)({path:e});yield Qn(t)}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Wn(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"},Jn={summary:{}},Xn=e=>e&&e.documents||{},ea=(e,t)=>{const r=Me(t);return Xn(e)[r]||{}},ta=(e,t)=>ea(e,t).data||[],ra=(e,t)=>ea(e,t).error||{},oa=(e,t)=>{const r=Me(t);return Xn(e).summary[r]||{}},na=(e,t)=>oa(e,t).data||{},aa=(e,t)=>oa(e,t).error||{};function sa(e,t){return{type:Kn.SET_DOCUMENTS,query:e,data:t}}function ia(e,t,r){return{type:Kn.SET_ERROR_FOR_DOCUMENTS,query:e,data:t,error:r}}function ca(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 da=e=>({user_email:e.userEmail,match:e.match,date_before:Ie(e.dateBefore,!0),date_after:Ie(e.dateAfter),date_between:e.dateBetween&&[Ie(e.dateBetween[0]),Ie(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*ma(e){const t=(0,Oe.addQueryArgs)(`${De}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...da(e)});try{const r=yield(0,Ne.apiFetch)({path:t});yield sa(e,r.data||[])}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving documents.","woocommerce-payments")),yield ia(e,null,t)}}function*pa(e){const t=(0,Oe.addQueryArgs)(`${De}/documents/summary`,da(e));try{const r=yield(0,Ne.apiFetch)({path:t});yield ca(e,r)}catch(t){yield ua(e,null,t)}}const la={},_a=({paymentIntents:e},t)=>{const r=e?.[t];return r?.data||{}},ya=({paymentIntents:e},t)=>{const r=e?.[t];return r?.error||{}},ha={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"},Sa={summary:{},byId:{},isRequesting:!1},Ea=e=>e&&e.authorizations||{},fa=(e,t)=>{const r=Me(t);return Ea(e)[r]||{}},ga=(e,t)=>fa(e,t).data||[],wa=(e,t)=>(Ea(e).byId||{})[t],Ta=(e,t)=>fa(e,t).error||{},Ra=(e,t)=>{const r=Me(t);return Ea(e).summary[r]||{}},Oa=(e,t)=>Ra(e,t).data||{},va=(e,t)=>Ra(e,t).error||{},ba=e=>Ea(e).isRequesting,Ia=e=>{const t={wcpay_missing_order:(0,$.__)("The order could not be found.","woocommerce-payments"),wcpay_refunded_order_uncapturable:(0,$.__)("Payment cannot be processed for partially or fully refunded orders.","woocommerce-payments"),wcpay_intent_order_mismatch:(0,$.__)("The payment cannot be processed due to a mismatch with order details.","woocommerce-payments"),wcpay_payment_uncapturable:(0,$.__)("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,$.__)("The payment amount is too small to be processed.","woocommerce-payments");const t=e.data.extra_details.minimum_amount_currency,r=ne(e.data.extra_details.minimum_amount,t);return(0,$.sprintf)((0,$.__)("The minimum amount that can be processed is %1$s %2$s.","woocommerce-payments"),r,t.toUpperCase())})(e):(0,$.__)("The payment capture failed to complete.","woocommerce-payments"),wcpay_cancel_error:(0,$.__)("The payment cancellation failed to complete.","woocommerce-payments"),wcpay_server_error:(0,$.__)("An unexpected error occurred. Please try again later.","woocommerce-payments")}[e.code??""];return"function"==typeof t?t(e):t??(0,$.__)("Unable to process the payment. Please try again later.","woocommerce-payments")};function Aa(e,t){return{type:ha.SET_AUTHORIZATIONS,data:t,query:e}}function Na(e,t){return{type:ha.SET_ERROR_FOR_AUTHORIZATIONS,query:e,error:t}}function Da(e){return{type:ha.SET_AUTHORIZATION,data:e}}function Pa(e,t){return{type:ha.SET_AUTHORIZATIONS_SUMMARY,data:t,query:e}}function Ca(e){return{type:ha.SET_IS_REQUESTING_AUTHORIZATION,data:e}}function*Ma(e,t){try{yield Ae.controls.dispatch(Pe,"startResolution","getAuthorization",[e]),yield Ae.controls.dispatch(Pe,"setIsRequestingAuthorization",!0);const r=yield(0,Ne.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 Da(o),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getAuthorizations"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getTimeline"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getTransactions"),yield Ae.controls.dispatch("core/notices","createSuccessNotice",(0,$.sprintf)((0,$.__)("Payment for order #%s captured successfully.","woocommerce-payments"),t))}catch(e){const r=(0,$.sprintf)((0,$.__)("There has been an error capturing the payment for order #%s.","woocommerce-payments"),t),o=Ia(e);yield Ae.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield Ae.controls.dispatch(Pe,"finishResolution","getAuthorization",[e]),yield Ae.controls.dispatch(Pe,"setIsRequestingAuthorization",!1)}}function*Fa(e,t){try{yield Ae.controls.dispatch(Pe,"startResolution","getAuthorization",[e]),yield Ae.controls.dispatch(Pe,"setIsRequestingAuthorization",!0);const r=yield(0,Ne.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 Da(o),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getAuthorizations"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getTimeline"),yield Ae.controls.dispatch(Pe,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield Ae.controls.dispatch("core/notices","createSuccessNotice",(0,$.sprintf)((0,$.__)("Payment for order #%s canceled successfully.","woocommerce-payments"),t))}catch(e){const r=(0,$.sprintf)((0,$.__)("There has been an error canceling the payment for order #%s.","woocommerce-payments"),t),o=Ia(e);yield Ae.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield Ae.controls.dispatch(Pe,"finishResolution","getAuthorization",[e]),yield Ae.controls.dispatch(Pe,"setIsRequestingAuthorization",!1)}}function Ua(e,t){return{type:ha.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY,query:e,error:t}}function*xa(e){let{paged:t=1,per_page:r=25,orderby:o="created",order:n="asc"}=e;"capture_by"===o&&(o="created");const a=(0,Oe.addQueryArgs)(`${De}/authorizations`,{page:t,pagesize:r,sort:o,direction:n});try{const t=yield(0,Ne.apiFetch)({path:a});yield Aa(e,t.data??[])}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Na(e,t)}}function*ka(e){try{if(e){const t=yield(0,Ne.apiFetch)({path:`${De}/authorizations/${e}`}),{is_captured:r,payment_intent_id:o,created:n}=t;yield Da({payment_intent_id:o,captured:r,created:n})}}catch(e){"authorization_missing"!==e.code&&(yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving authorization.","woocommerce-payments")))}}function*ja(e){const t=(0,Oe.addQueryArgs)(`${De}/authorizations/summary`,{pagesize:e.per_page,sort:e.orderby,direction:e.order,page:e.paged});try{const r=yield(0,Ne.apiFetch)({path:t});yield Pa(e,r??[])}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Ua(e,t)}}var za=function(e){return e.SET_FILE="SET_FILE",e.SET_ERROR_FOR_FILES="SET_ERROR_FOR_FILES",e}(za||{});const qa=za,La={},$a=({files:e},t)=>{const r=e?.[t];return r?.data||{}},Ya=({files:e},t)=>{const r=e?.[t];return r?.error||{}};function Ba(e,t){return{type:qa.SET_FILE,id:e,data:t}}function Ha(e,t){return{type:qa.SET_ERROR_FOR_FILES,id:e,error:t}}function*Va(e){try{const t=yield(0,Ne.apiFetch)({path:`${De}/file/${e}/details`});yield Ba(e,t)}catch(t){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving file.","woocommerce-payments")),yield Ha(e,t)}}let Qa=function(e){return e.SET_PM_PROMOTIONS="SET_PM_PROMOTIONS",e.SET_ERROR_FOR_PM_PROMOTIONS="SET_ERROR_FOR_PM_PROMOTIONS",e}({});const Wa={pmPromotions:void 0,pmPromotionsError:void 0},Ga=e=>e.pmPromotions?.pmPromotions??[],Za=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 Ja(e){return{type:Qa.SET_PM_PROMOTIONS,data:e}}function Xa(e){return{type:Qa.SET_ERROR_FOR_PM_PROMOTIONS,error:e}}function*es(e){const t=`${De}/pm-promotions/${e}/activate`;try{yield(0,Ne.apiFetch)({path:t,method:"POST"}),yield Ae.controls.dispatch("core/notices","createSuccessNotice",(0,$.__)("Promotion activated successfully!","woocommerce-payments")),yield Ae.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error activating promotion. Please try again.","woocommerce-payments")),yield Ae.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ka(e))}}function*ts(e){const t=`${De}/pm-promotions/${e}/dismiss`;try{yield(0,Ne.apiFetch)({path:t,method:"POST"}),yield Ae.controls.dispatch("core/notices","createSuccessNotice",(0,$.__)("Promotion dismissed.","woocommerce-payments")),yield Ae.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error dismissing promotion. Please try again.","woocommerce-payments")),yield Ae.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ka(e))}}function rs(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*os(){const e=`${De}/pm-promotions`;try{const t=yield(0,Ne.apiFetch)({path:e});if(r=t,!Array.isArray(r)||!r.every(rs))throw new Error("Invalid promotions data received from API");yield Ae.controls.dispatch("wc/payments","updatePmPromotions",t)}catch(e){yield Ae.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving promotions. Please try again later.","woocommerce-payments")),yield Ae.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}function ns(e,t={}){const{customFormat:r=null,includeTime:o=!1,separator:n=" / ",timezone:a}=t,s=H().utc(e).toISOString(),i=r||`${window.wcpaySettings.dateFormat}${o?`${n}${window.wcpaySettings.timeFormat}`:""}`;return(0,ve.dateI18n)(i,s,a)}(0,Ae.registerStore)(Pe,{reducer:(0,Ae.combineReducers)({deposits:(e=Fe,{type:t,query:r={},data:o=[],error:n})=>{const a=Me(r);switch(t){case Ce.SET_DEPOSIT:return{...e,byId:{...e.byId,[o.id]:o}};case Ce.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:o}};case Ce.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:n}};case Ce.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,oe.keyBy)(o,"id")},queries:{...e.queries,[a]:{data:(0,oe.map)(o,"id")}}};case Ce.SET_DEPOSITS_COUNT:return{...e,count:o};case Ce.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[a]:{error:n}}};case Ce.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Ce.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}};case Ce.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:o}}}return e},transactions:(e=mt,{type:t,query:r={},data:o=[],error:n,status:a})=>{const s=Me(r);switch(t){case dt.SET_TRANSACTIONS:return{...e,[s]:{data:o}};case dt.SET_ERROR_FOR_TRANSACTIONS:return{...e,[s]:{error:n}};case dt.SET_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}};case dt.SET_ERROR_FOR_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{error:n}}};case dt.SET_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{data:o}}}};case dt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{error:n}}}};case dt.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[s]:{data:o}}}}};case dt.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 Lt.SET_CHARGE:e={...e,[r]:{...e[r],data:o}};break;case Lt.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 Zt.SET_TIMELINE:e={...e,[r]:{data:o}};break;case Zt.SET_ERROR_FOR_TIMELINE:e={...e,[r]:{...e[r],error:n}}}return e},disputes:(e=or,{type:t,query:r={},data:o=[],id:n,error:a})=>{const s=Me(r);switch(t){case rr.SET_DISPUTE:return{...e,byId:{...e.byId,[o.id]:o}};case rr.SET_ERROR_FOR_DISPUTE:e={...e,byId:{...e.byId,[n]:{error:a}}};break;case rr.SET_DISPUTES:return{...e,cached:{...e.cached,...(0,oe.keyBy)(o,"dispute_id")},queries:{...e.queries,[s]:{data:(0,oe.map)(o,"dispute_id")}}};case rr.SET_DISPUTES_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}}}return e},settings:(e=Ar,{type:t,...r})=>{switch(t){case Ir.SET_SETTINGS:return{...e,data:r.data,isDirty:!1};case Ir.SET_SETTINGS_VALUES:return{...e,savingError:null,isDirty:!0,data:{...e.data,...r.payload}};case Ir.SET_IS_SAVING_SETTINGS:return{...e,isDirty:!(!r.isSaving&&!r.error)&&e.isDirty,isSaving:r.isSaving,savingError:r.error};case Ir.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 Ir.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 bn.SET_CARD_READER_STATS:e={...e,[r]:{...e[r],data:o}};break;case bn.SET_ERROR_FOR_CARD_READER_STATS:e={...e,[r]:{...e[r],error:n}};break;case bn.SET_READERS:e={...e,list:o}}return e},capital:zn,documents:(e=Jn,{type:t,query:r={},data:o=[],error:n})=>{const a=Me(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=la,t)=>{const{type:r,id:o}=t;switch(r){case mr.SET_PAYMENT_INTENT:return{...e,[o]:{...e[o],data:t.data}};case mr.SET_ERROR_FOR_PAYMENT_INTENT:return{...e,[o]:{...e[o],error:t.error}};default:return e}},authorizations:(e=Sa,t)=>{switch(t.type){case ha.SET_AUTHORIZATION:{const{data:r}=t;return{...e,byId:{...e.byId,[r.payment_intent_id]:{...e.byId[r.payment_intent_id],...r}}}}case ha.SET_AUTHORIZATIONS:{const{data:r,query:o}=t;return{...e,[Me(o)]:{data:r}}}case ha.SET_ERROR_FOR_AUTHORIZATIONS:{const{error:r,query:o}=t;return{...e,[Me(o)]:{error:r}}}case ha.SET_AUTHORIZATIONS_SUMMARY:{const{data:r,query:o}=t;return{...e,summary:{...e.summary,[Me(o)]:{data:r||{}}}}}case ha.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:{const{query:r,error:o}=t;return{...e,summary:{...e.summary,[Me(r)]:{error:o||""}}}}case ha.SET_IS_REQUESTING_AUTHORIZATION:{const{data:r}=t;return{...e,isRequesting:r}}}return e},files:(e=La,t)=>{const{type:r,id:o}=t;switch(r){case qa.SET_FILE:return{...e,[o]:{...e[o],data:t.data}};case qa.SET_ERROR_FOR_FILES:return{...e,[o]:{...e[o],error:t.error}};default:return e}},pmPromotions:(e=Wa,t)=>{switch(t.type){case Qa.SET_PM_PROMOTIONS:return{...e,pmPromotions:t.data,pmPromotionsError:void 0};case Qa.SET_ERROR_FOR_PM_PROMOTIONS:return{...e,pmPromotions:void 0,pmPromotionsError:t.error}}return e}}),actions:{...t,...a,...c,...m,...h,...f,...T,...v,...A,..._,...C,...U,...j},controls:Ne.controls,selectors:{...e,...n,...i,...d,...l,...E,...w,...O,...I,...D,...P,...F,...k},resolvers:{...o,...s,...u,...p,...S,...g,...R,...b,...N,...y,...M,...x,...z}});const as=({isPreDisputeInquiry:e,disputeReason:t,formattedAmount:r,dueBy:o,countdownDays:n})=>{const a=e?(0,$.__)("Please resolve the inquiry on this order of %1$s labeled '%2$s' by %3$s.","woocommerce-payments"):(0,$.__)("Please resolve the dispute on this order of %1$s labeled '%2$s' by %3$s.","woocommerce-payments"),s=(0,$.sprintf)(a,r,V[t].display,ns(o.toISOString()));let i=(0,$.sprintf)((0,$._n)("(%s day left)","(%s days left)",n,"woocommerce-payments"),n);return n<1&&(i=(0,$.__)("(Last day today)","woocommerce-payments")),(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)("strong",{children:s})," ",i]})},ss=({isPreDisputeInquiry:e,disputeReason:t,formattedAmount:r,dueBy:o})=>{const n=e?(0,$.__)("Please resolve the inquiry on this order of %1$s with reason '%2$s'.","woocommerce-payments"):(0,$.__)("This order has a payment dispute for %1$s for the reason '%2$s'. ","woocommerce-payments"),a=(0,$.sprintf)(n,r,V[t].display),s=(0,$.sprintf)((0,$.__)("Please respond before %1$s.","woocommerce-payments"),ns(o.toISOString()));return(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)("strong",{children:a})," ",s]})},is=({disputeReason:e,formattedAmount:t,isPreDisputeInquiry:r,dueBy:o,countdownDays:n,disputeDetailsUrl:a})=>{(0,L.useEffect)(()=>{ee("wcpay_order_dispute_notice_view",{is_inquiry:r,dispute_reason:e,due_by_days:n})},[r,e,n]);const s=n<7,i=n<1?(0,$.__)("Respond today","woocommerce-payments"):(0,$.__)("Respond now","woocommerce-payments"),c=s?(0,ge.jsx)(as,{isPreDisputeInquiry:r,disputeReason:e,formattedAmount:t,dueBy:o,countdownDays:n}):(0,ge.jsx)(ss,{isPreDisputeInquiry:r,disputeReason:e,formattedAmount:t,dueBy:o});return(0,ge.jsx)(we,{status:n<3?"error":"warning",isDismissible:!1,actions:[{label:i,variant:"secondary",onClick:()=>{ee("wcpay_order_dispute_notice_action_click",{due_by_days:n}),window.location=a}}],children:c})},cs=({message:e,disputeDetailsUrl:t})=>(0,ge.jsxs)(we,{status:"warning",isDismissible:!1,children:[e,(0,Re.createInterpolateElement)((0,$.__)(" <a>View details</a>","woocommerce-payments"),{a:(0,ge.jsx)("a",{href:t})})]}),us=({chargeId:e,onDisableOrderRefund:t})=>{const{data:r}=(e=>(0,Ae.useSelect)(t=>{const r=t(Pe);return((e,t)=>{const{getCharge:r,isResolving:o,getChargeError:n,hasFinishedResolution:a}=t;return{data:r(e),error:n(e),isLoading:o("getCharge",[e])||!a("getCharge",[e])}})(e,r)},[e]))(e),o=be({page:"wc-admin",path:`/payments/${"transactions"}/details`,id:e});(0,L.useEffect)(()=>{const{dispute:e}=r;var o;r?.dispute&&(o=e.status,de(o)||"won"===o||t(e.status))},[r,t]);const{dispute:n}=r;if(!r?.dispute)return null;if(ue(n.status)&&!de(n.status))return(0,ge.jsx)(cs,{message:(0,$.__)("This order has an active payment dispute. Refunds and order editing are disabled.","woocommerce-payments"),disputeDetailsUrl:o});if("lost"===n.status)return(0,ge.jsx)(cs,{message:(0,$.__)("Refunds and order editing have been disabled as a result of a lost dispute.","woocommerce-payments"),disputeDetailsUrl:o});if(!ce(n.status))return null;if(!n.evidence_details?.due_by)return null;const a=H()().utc(),s=H().unix(n.evidence_details?.due_by).utc();return a.isBefore(s)?(0,ge.jsx)(is,{chargeId:e,disputeReason:n.reason,formattedAmount:ae(n.amount,n.currency),isPreDisputeInquiry:de(n.status),dueBy:s,countdownDays:Math.floor(s.diff(a,"days",!0)),disputeDetailsUrl:o}):null},ds=window.wp.primitives,ms=({children:e,actions:t,className:r,...o})=>(0,ge.jsxs)(_e.Modal,{className:he("wcpay-confirmation-modal",r),...o,children:[e,(0,ge.jsx)(ds.HorizontalRule,{className:"wcpay-confirmation-modal__separator"}),(0,ge.jsx)("div",{className:"wcpay-confirmation-modal__footer",children:t})]}),ps=({orderStatus:e,refundAmount:t,formattedRefundAmount:r,refundedAmount:o})=>{const[n,a]=(0,Re.useState)(!0),s=()=>{a(!1)},i=()=>{const t=document.querySelector("#order_status");t.value=e,t.dispatchEvent(new Event("change"))};return(0,ge.jsx)(ge.Fragment,{children:n&&(0,ge.jsx)(ms,{title:(0,$.__)("Refund order in full","woocommerce-payments"),isDismissible:!1,className:"refund-confirmation-modal",actions:(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_e.Button,{variant:"secondary",onClick:()=>{i(),s()},__next40pxDefaultSize:!0,children:(0,$.__)("Cancel","woocommerce-payments")}),(0,ge.jsx)(_e.Button,{variant:"primary",onClick:()=>{jQuery.ajax({type:"post",url:woocommerce_admin_meta_boxes.ajax_url,data:{action:"woocommerce_refund_line_items",order_id:woocommerce_admin_meta_boxes.post_id,security:woocommerce_admin_meta_boxes.order_item_nonce,refund_amount:t,refunded_amount:o,api_refund:!0},beforeSend:function(){jQuery(".refund-confirmation-modal").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},success:function(e){!0===e.success?window.location.reload():(i(),(0,Ae.dispatch)("core/notices").createErrorNotice(e.data.error))},complete:function(){jQuery(".refund-confirmation-modal").unblock(),s()}})},__next40pxDefaultSize:!0,children:(0,$.sprintf)((0,$.__)("Refund %s","woocommerce-payments"),r)})]}),children:(0,ge.jsx)("p",{children:(0,$.sprintf)((0,$.__)('Issue a full refund back to your customer\'s payment method using %s. This action can not be undone. To issue a partial refund, click "Cancel", and use the "Refund" button in the order details below.',"woocommerce-payments"),"WooPayments")})})})},ls=({title:e,confirmButtonText:t,cancelButtonText:r,confirmationMessage:o,onConfirm:n,onCancel:a})=>{const[s,i]=(0,Re.useState)(!0),c=()=>{i(!1)},u=(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsx)(_e.Button,{variant:"secondary",onClick:()=>{a(),c()},children:r}),(0,ge.jsx)(_e.Button,{variant:"primary",onClick:()=>{n(),c()},children:t})]});return(0,ge.jsx)(ge.Fragment,{children:s&&(0,ge.jsx)(ms,{title:e,isDismissible:!1,className:"generic-confirmation-modal",actions:u,onRequestClose:()=>!1,children:(0,ge.jsx)("p",{children:o})})})},_s={CANCELLED:(0,$.__)("cancelled","woocommerce-payments"),COMPLETED:(0,$.__)("completed","woocommerce-payments"),FAILED:(0,$.__)("failed","woocommerce-payments"),ON_HOLD:(0,$.__)("on-hold","woocommerce-payments"),PENDING:(0,$.__)("pending","woocommerce-payments"),PROCESSING:(0,$.__)("processing","woocommerce-payments"),REFUNDED:(0,$.__)("refunded","woocommerce-payments"),TRASH:(0,$.__)("trash","woocommerce-payments")},ys="wc-cancelled",hs="wc-completed",Ss="wc-failed",Es="wc-on-hold",fs="wc-pending",gs="wc-processing",ws="wc-refunded",Ts="wc-trash",Rs={[ys]:_s.CANCELLED,[hs]:_s.COMPLETED,[Ss]:_s.FAILED,[Es]:_s.ON_HOLD,[fs]:_s.PENDING,[gs]:_s.PROCESSING,[ws]:_s.REFUNDED,[Ts]:_s.TRASH};function Os(e){const t=document.createElement("div");t.id="wcpay-orderstatus-confirm-container",document.body.appendChild(t),(0,q.H)(t).render(e)}function vs(){console.log("No specific action defined for this status change.")}const bs={[ys]:function(e,t){if(e===ys)return;const r=Y("hasOpenAuthorization"),o=Y("canRefund"),n=Y("refundAmount");if(r&&function(e,t){const r=le({mixedString:(0,$.__)("This order has been {{authorizedNotCaptured/}} yet. Changing the status to {{newOrderStatus/}} will also {{cancelAuthorization/}}. Do you want to continue?","woocommerce-payments"),components:{authorizedNotCaptured:(0,ge.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/#authorize-vs-capture",rel:"noopener noreferrer",children:(0,$.__)("authorized but payment has not been captured","woocommerce-payments")}),cancelAuthorization:(0,ge.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/#cancelling-authorizations",rel:"noopener noreferrer",children:(0,$.__)("cancel the payment","woocommerce-payments")}),newOrderStatus:(0,ge.jsx)("b",{children:Rs[t]})}});Os((0,ge.jsx)(ls,{title:(0,$.__)("Cancel payment","woocommerce-payments"),confirmButtonText:(0,$.__)("Cancel order and payment","woocommerce-payments"),cancelButtonText:(0,$.__)("Cancel","woocommerce-payments"),confirmationMessage:r,onConfirm:()=>{const e=document.querySelector("#order_status")?.closest("form")||null;null!==e&&e.submit()},onCancel:()=>{const t=document.querySelector("#order_status");null!==t&&(t.value=e,t.dispatchEvent(new Event("change")))}}))}(e,t),!r&&o&&n>0){const t=le({mixedString:(0,$.__)("Are you trying to issue a refund for this order? If so, please click {{doNothingBold/}} and see our documentation on {{howtoIssueRefunds/}}. If you want to mark this order as Cancelled without issuing a refund, click {{cancelOrderBold/}}.","woocommerce-payments"),components:{doNothingBold:(0,ge.jsx)("b",{children:(0,$.__)("Do Nothing","woocommerce-payments")}),cancelOrderBold:(0,ge.jsx)("b",{children:(0,$.__)("Cancel order","woocommerce-payments")}),howtoIssueRefunds:(0,ge.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/managing-money/#refunds",rel:"noopener noreferrer",children:(0,$.__)("how to issue refunds","woocommerce-payments")})}});Os((0,ge.jsx)(ls,{title:(0,$.__)("Cancel order","woocommerce-payments"),confirmButtonText:(0,$.__)("Cancel order","woocommerce-payments"),cancelButtonText:(0,$.__)("Do Nothing","woocommerce-payments"),confirmationMessage:t,onConfirm:()=>{const e=document.querySelector("#order_status")?.closest("form")||null;null!==e&&e.submit()},onCancel:()=>{const t=document.querySelector("#order_status");null!==t&&(t.value=e,t.dispatchEvent(new Event("change")))}}))}},[hs]:function(e,t){e!==hs&&Y("hasOpenAuthorization")&&function(e,t){const r=le({mixedString:(0,$.__)("This order has been {{authorizedNotCaptured/}} yet. Changing the status to {{newOrderStatus/}} will also {{captureAuthorization/}}. Do you want to continue?","woocommerce-payments"),components:{authorizedNotCaptured:(0,ge.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/#authorize-vs-capture",rel:"noopener noreferrer",children:(0,$.__)("authorized but payment has not been captured","woocommerce-payments")}),captureAuthorization:(0,ge.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/#capturing-authorized-payments",rel:"noopener noreferrer",children:(0,$.__)("capture the payment","woocommerce-payments")}),newOrderStatus:(0,ge.jsx)("b",{children:Rs[t]})}});Os((0,ge.jsx)(ls,{title:(0,$.__)("Capture payment","woocommerce-payments"),confirmButtonText:(0,$.__)("Complete order and capture payment","woocommerce-payments"),cancelButtonText:(0,$.__)("Cancel","woocommerce-payments"),confirmationMessage:r,onConfirm:()=>{const e=document.querySelector("#order_status")?.closest("form")||null;null!==e&&e.submit()},onCancel:()=>{const t=document.querySelector("#order_status");null!==t&&(t.value=e,t.dispatchEvent(new Event("change")))}}))}(e,t)},[ws]:function(e){e!==ws&&function(e,t,r){t?r<=0?(0,Ae.dispatch)("core/notices").createErrorNotice((0,$.__)("Invalid Refund Amount","woocommerce-payments")):Os((0,ge.jsx)(ps,{orderStatus:e,refundAmount:r,formattedRefundAmount:Y("formattedRefundAmount"),refundedAmount:Y("refundedAmount")})):(0,Ae.dispatch)("core/notices").createErrorNotice((0,$.__)("Order cannot be refunded","woocommerce-payments"))}(e,Y("canRefund"),Y("refundAmount"))}};function Is(e){const t=document.querySelector("button.refund-items");if(!t)return;t.disabled=!0;let r="";ce(e)?r=(0,$.__)("Refunds and order editing are disabled during disputes.","woocommerce-payments"):ue(e)?r=(0,$.__)("Refunds and order editing are disabled during an active dispute.","woocommerce-payments"):"lost"===e&&(r=(0,$.__)("Refunds and order editing have been disabled as a result of a lost dispute.","woocommerce-payments")),jQuery(t).parent().find(".woocommerce-help-tip").attr({title:r,"aria-label":r}).tipTip()}jQuery(function(e){const t=Y("disableManualRefunds")??!1,r=Y("manualRefundsTip")??"",o=Y("chargeId"),n=Y("testMode"),a=""!==Y("orderTestModeMatch");!function(){const e=document.querySelector("#wcpay-order-payment-details-container");e&&(0,q.H)(e).render((0,ge.jsxs)(ge.Fragment,{children:[n&&(0,ge.jsx)(Te,{}),o&&a&&(0,ge.jsx)(us,{chargeId:o,onDisableOrderRefund:Is})]}))}(),e("#woocommerce-order-items").on("click","button.refund-items",function(){const o=e(".do-manual-refund");t?o.hide():o.attr({title:r}).tipTip()}),e("select#order_status").on("change",function(){let t=e("input#original_post_status").val()||e("input#original_order_status").val();var r;t&&!t.startsWith("wc-")&&(t="wc-"+t),(r=this.value,bs[r]||vs)(t,this.value)})})})()})();