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