| Server IP : 146.59.209.152 / Your IP : 216.73.216.152 Web Server : Apache System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : monpetu ( 144298) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/monpetu/www/ipprint/wp-content/plugins/woocommerce-payments/dist/chunks/ |
Upload File : |
{"version":3,"file":"chunks/5033.js?ver=451c9f8aa44f63ae911b","mappings":"gMAeA,MAAMA,EAA8C,CACnDC,QAAS,UACTC,WAAY,UACZC,KAAM,UACNC,OAAQ,QACRC,SAAU,SAkBX,EAVMC,EAAIC,cACT,IAAIC,EAAUC,EAAAA,GAAqBF,EAAQG,QAM3C,MAHsB,eAAjBH,EAAQI,MAA4C,SAAnBJ,EAAQG,SAC7CF,EAAUC,EAAAA,GAAoBG,WAExBC,EAAAA,EAAAA,KAACC,EAAAA,EAAI,CAACH,KAAOX,EAAUO,EAAQG,QAAWF,QAAUA,I,0HCP5D,MAAMO,EAA2DA,EAChEC,uBAEA,OAASA,EAAiBC,UACzB,IAAK,QACJ,OAAOC,EAAAA,EAAAA,GAAuB,CAC7BC,aAAaC,EAAAA,EAAAA,UAEZC,EAAAA,EAAAA,IACC,+EACA,yBAGFC,WAAY,CACXC,QAAQV,EAAAA,EAAAA,KAAA,gBAGX,IAAK,SACJ,MAAMW,EAAYC,MAChBC,OAAQ,MACRC,IAAKX,EAAiBY,eACtBF,OAAQD,IAAAA,UACRI,OAAQ,QAEV,OAAOX,EAAAA,EAAAA,GAAuB,CAC7BC,aAAaC,EAAAA,EAAAA,UAEZC,EAAAA,EAAAA,IACC,gFACA,wBAEDG,GAEDF,WAAY,CACXC,QAAQV,EAAAA,EAAAA,KAAA,gBAGX,IAAK,UACJ,MAAMiB,EAAgBd,EA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,MAMb,MAAM+K,EAAcvL,IAAAA,SAAgBwL,WAAY,MAC7C,KACAxL,IAAAA,SAEH,IAAI2D,EAAQ3D,MACVC,OAAQsL,GACRD,KAAMjL,GACND,OAAQ,MAQV,OANuB,KAAlBC,IACJsD,GAAQ/D,EAAAA,EAAAA,IAAI,wBAAyB,yBAE/BY,IACNmD,EAAQA,EAAM8H,eAER9H,GAIKhD,EACZ+K,KAEOA,GAIA,CAAE,QAAS,SAAU,WAAYC,SACvCD,E","sources":["webpack://woocommerce-payments/./client/components/deposit-status-chip/index.tsx","webpack://woocommerce-payments/./client/components/deposits-overview/deposit-schedule.tsx","webpack://woocommerce-payments/./client/data/deposits/action-types.js","webpack://woocommerce-payments/./client/data/deposits/actions.js","webpack://woocommerce-payments/./client/data/deposits/hooks.ts","webpack://woocommerce-payments/./client/data/deposits/reducer.js","webpack://woocommerce-payments/./client/data/deposits/resolvers.js","webpack://woocommerce-payments/./client/data/deposits/selectors.js","webpack://woocommerce-payments/./client/data/deposits/store.js","webpack://woocommerce-payments/./client/deposits/utils/index.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport React from 'react';\n\n/**\n * Internal dependencies\n */\nimport Chip, { ChipType } from 'components/chip';\nimport type { CachedDeposit, DepositStatus } from 'wcpay/types/deposits';\nimport { depositStatusLabels } from 'wcpay/deposits/strings';\n\n/**\n * Maps a DepositStatus to a ChipType.\n */\nconst mappings: Record< DepositStatus, ChipType > = {\n\tpending: 'warning',\n\tin_transit: 'primary',\n\tpaid: 'success',\n\tfailed: 'alert',\n\tcanceled: 'light',\n};\n\n/**\n * Renders a deposits status chip.\n */\nconst DepositStatusChip: React.FC< {\n\tdeposit: Pick< CachedDeposit, 'status' | 'type' >;\n} > = ( { deposit } ) => {\n\tlet message = depositStatusLabels[ deposit.status ];\n\n\t// Withdrawals are displayed as 'Deducted' instead of 'Paid'.\n\tif ( deposit.type === 'withdrawal' && deposit.status === 'paid' ) {\n\t\tmessage = depositStatusLabels.deducted;\n\t}\n\treturn <Chip type={ mappings[ deposit.status ] } message={ message } />;\n};\n\nexport default DepositStatusChip;\n","/**\n * External dependencies\n */\nimport React from 'react';\nimport { __, sprintf } from '@wordpress/i18n';\nimport interpolateComponents from '@automattic/interpolate-components';\nimport moment from 'moment';\nimport HelpOutlineIcon from 'gridicons/dist/help-outline';\n\n/**\n * Internal dependencies\n */\nimport { ClickTooltip } from 'components/tooltip';\nimport {\n\thasAutomaticScheduledDeposits,\n\tgetDepositMonthlyAnchorLabel,\n} from 'wcpay/deposits/utils';\nimport type * as AccountOverview from 'wcpay/types/account-overview';\n\ninterface DepositScheduleProps {\n\tdepositsSchedule: AccountOverview.Account[ 'deposits_schedule' ];\n}\n\n/**\n * Renders a rich-text sentence summarising the deposit schedule.\n *\n * eg \"Your deposits are dispatched automatically every day\"\n */\nconst DepositScheduleSummary: React.FC< DepositScheduleProps > = ( {\n\tdepositsSchedule,\n} ) => {\n\tswitch ( depositsSchedule.interval ) {\n\t\tcase 'daily':\n\t\t\treturn interpolateComponents( {\n\t\t\t\tmixedString: sprintf(\n\t\t\t\t\t/** translators: {{strong}}: placeholders are opening and closing strong tags. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Available funds are automatically dispatched {{strong}}every day{{/strong}}.',\n\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tcomponents: {\n\t\t\t\t\tstrong: <strong />,\n\t\t\t\t},\n\t\t\t} );\n\t\tcase 'weekly':\n\t\t\tconst dayOfWeek = moment()\n\t\t\t\t.locale( 'en' )\n\t\t\t\t.day( depositsSchedule.weekly_anchor )\n\t\t\t\t.locale( moment.locale() )\n\t\t\t\t.format( 'dddd' );\n\n\t\t\treturn interpolateComponents( {\n\t\t\t\tmixedString: sprintf(\n\t\t\t\t\t/** translators: %1$s: is the day of the week. eg \"Friday\". {{strong}}: placeholders are opening and closing strong tags. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Available funds are automatically dispatched {{strong}}every %1$s{{/strong}}.',\n\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t),\n\t\t\t\t\tdayOfWeek\n\t\t\t\t),\n\t\t\t\tcomponents: {\n\t\t\t\t\tstrong: <strong />,\n\t\t\t\t},\n\t\t\t} );\n\t\tcase 'monthly':\n\t\t\tconst monthlyAnchor = depositsSchedule.monthly_anchor;\n\n\t\t\t// If the monthly anchor is 31, it means the deposit is scheduled for the last day of the month and has special handling.\n\t\t\tif ( monthlyAnchor === 31 ) {\n\t\t\t\treturn interpolateComponents( {\n\t\t\t\t\tmixedString: sprintf(\n\t\t\t\t\t\t/** translators: {{strong}}: placeholders are opening and closing strong tags. */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Available funds are automatically dispatched {{strong}}on the last day of every month{{/strong}}.',\n\t\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tcomponents: {\n\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn interpolateComponents( {\n\t\t\t\tmixedString: sprintf(\n\t\t\t\t\t/** translators: {{strong}}: placeholders are opening and closing strong tags. %1$s: is the day of the month. eg \"31st\". */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Available funds are automatically dispatched {{strong}}on the %1$s of every month{{/strong}}.',\n\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t),\n\t\t\t\t\tgetDepositMonthlyAnchorLabel( {\n\t\t\t\t\t\tmonthlyAnchor: monthlyAnchor,\n\t\t\t\t\t\tcapitalize: false,\n\t\t\t\t\t} )\n\t\t\t\t),\n\t\t\t\tcomponents: {\n\t\t\t\t\tstrong: <strong />,\n\t\t\t\t},\n\t\t\t} );\n\t\tdefault:\n\t\t\treturn <></>;\n\t}\n};\n\n/**\n * Renders a summary of the deposit schedule & a tooltip so merchant understands when they will get paid.\n *\n * If the merchant has no schedule configured, renders nothing.\n */\nconst DepositSchedule: React.FC< DepositScheduleProps > = ( {\n\tdepositsSchedule,\n} ) => {\n\t// Bail if the merchant is on manual or ad-hoc deposits.\n\tif ( ! hasAutomaticScheduledDeposits( depositsSchedule.interval ) ) {\n\t\treturn null;\n\t}\n\n\tconst nextDepositHelpContent = (\n\t\t<>\n\t\t\t{ interpolateComponents( {\n\t\t\t\tmixedString: __(\n\t\t\t\t\t'The timing and amount of your payouts may vary due to several factors. Check out our {{link}}payout schedule guide{{/link}} for details.',\n\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t),\n\t\t\t\tcomponents: {\n\t\t\t\t\tlink: (\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\trel=\"external noopener noreferrer\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t'https://woocommerce.com/document/woopayments/payouts/payout-schedule/'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t} ) }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<DepositScheduleSummary depositsSchedule={ depositsSchedule } />\n\t\t\t<ClickTooltip\n\t\t\t\tcontent={ nextDepositHelpContent }\n\t\t\t\tbuttonIcon={ <HelpOutlineIcon /> }\n\t\t\t\tbuttonLabel={ 'Payout schedule tooltip' }\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default DepositSchedule;\n","/** @format */\n\nexport default {\n\tSET_DEPOSIT: 'SET_DEPOSIT',\n\tSET_DEPOSITS: 'SET_DEPOSITS',\n\tSET_DEPOSITS_COUNT: 'SET_DEPOSITS_COUNT',\n\tSET_ERROR_FOR_DEPOSIT_QUERY: 'SET_ERROR_FOR_DEPOSIT_QUERY',\n\tSET_DEPOSITS_SUMMARY: 'SET_DEPOSITS_SUMMARY',\n\tSET_ERROR_FOR_DEPOSITS_SUMMARY: 'SET_ERROR_FOR_DEPOSITS_SUMMARY',\n\tSET_INSTANT_DEPOSIT: 'SET_INSTANT_DEPOSIT',\n\tSET_ALL_DEPOSITS_OVERVIEWS: 'SET_ALL_DEPOSITS_OVERVIEWS',\n\tSET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:\n\t\t'SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS',\n};\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { apiFetch } from '@wordpress/data-controls';\nimport { dispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { formatCurrency } from 'multi-currency/interface/functions';\n\n/**\n * Internal Dependencies\n */\nimport TYPES from './action-types';\nimport { DEPOSITS_STORE_NAME as STORE_NAME } from '../store-names';\nimport { getAdminUrl } from 'wcpay/utils';\n\nexport function updateDeposit( data ) {\n\treturn {\n\t\ttype: TYPES.SET_DEPOSIT,\n\t\tdata,\n\t};\n}\n\nexport function updateAllDepositsOverviews( data ) {\n\treturn {\n\t\ttype: TYPES.SET_ALL_DEPOSITS_OVERVIEWS,\n\t\tdata,\n\t};\n}\n\nexport function updateErrorForAllDepositsOverviews( data, error ) {\n\treturn {\n\t\ttype: TYPES.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,\n\t\terror,\n\t};\n}\n\nexport function updateDeposits( query, data ) {\n\treturn {\n\t\ttype: TYPES.SET_DEPOSITS,\n\t\tquery,\n\t\tdata,\n\t};\n}\n\nexport function updateDepositsCount( data ) {\n\treturn {\n\t\ttype: TYPES.SET_DEPOSITS_COUNT,\n\t\tdata,\n\t};\n}\n\nexport function updateErrorForDepositQuery( query, data, error ) {\n\treturn {\n\t\ttype: TYPES.SET_ERROR_FOR_DEPOSIT_QUERY,\n\t\tquery,\n\t\tdata,\n\t\terror,\n\t};\n}\n\nexport function updateDepositsSummary( query, data ) {\n\treturn {\n\t\ttype: TYPES.SET_DEPOSITS_SUMMARY,\n\t\tquery,\n\t\tdata,\n\t};\n}\n\nexport function updateErrorForDepositsSummary( query, data, error ) {\n\treturn {\n\t\ttype: TYPES.SET_ERROR_FOR_DEPOSITS_SUMMARY,\n\t\tquery,\n\t\tdata,\n\t\terror,\n\t};\n}\n\nexport function updateInstantDeposit( data ) {\n\treturn {\n\t\ttype: TYPES.SET_INSTANT_DEPOSIT,\n\t\tdata,\n\t};\n}\n\nexport function* submitInstantDeposit( currency ) {\n\ttry {\n\t\tyield dispatch( STORE_NAME ).startResolution( 'getInstantDeposit', [\n\t\t\tcurrency,\n\t\t] );\n\n\t\tconst deposit = yield apiFetch( {\n\t\t\tpath: '/wc/v3/payments/deposits',\n\t\t\tmethod: 'POST',\n\t\t\tdata: {\n\t\t\t\ttype: 'instant',\n\t\t\t\tcurrency,\n\t\t\t},\n\t\t} );\n\n\t\tyield updateInstantDeposit( deposit );\n\n\t\t// Invalidate deposits and deposits overview queries to ensure that the UI is updated with fresh data.\n\t\tyield dispatch( STORE_NAME ).invalidateResolutionForStoreSelector(\n\t\t\t'getDeposits'\n\t\t);\n\t\tyield dispatch( STORE_NAME ).invalidateResolutionForStoreSelector(\n\t\t\t'getAllDepositsOverviews'\n\t\t);\n\n\t\tyield dispatch( 'core/notices' ).createSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t__(\n\t\t\t\t\t'Instant payout for %s in transit.',\n\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t),\n\t\t\t\tformatCurrency( deposit.amount )\n\t\t\t),\n\t\t\t{\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'View details', 'woocommerce-payments' ),\n\t\t\t\t\t\turl: getAdminUrl( {\n\t\t\t\t\t\t\tpage: 'wc-admin',\n\t\t\t\t\t\t\tpath: '/payments/payouts/details',\n\t\t\t\t\t\t\tid: deposit.id,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}\n\t\t);\n\t} catch {\n\t\tyield dispatch( 'core/notices' ).createErrorNotice(\n\t\t\t__( 'Error creating instant payout.', 'woocommerce-payments' )\n\t\t);\n\t} finally {\n\t\tyield dispatch( STORE_NAME ).finishResolution( 'getInstantDeposit', [\n\t\t\tcurrency,\n\t\t] );\n\t}\n}\n","/** @format */\n/* eslint-disable react-hooks/exhaustive-deps -- useSelect dep arrays intentionally use JSON.stringify for object comparison */\n\n/**\n * External dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport moment from 'moment';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from './store';\nimport type { Query } from '@woocommerce/navigation';\nimport type {\n\tCachedDeposits,\n\tCachedDeposit,\n\tDepositsSummaryCache,\n} from 'wcpay/types/deposits';\nimport type { Transaction } from 'wcpay/data/transactions';\nimport type * as AccountOverview from 'wcpay/types/account-overview';\n\nexport const useDeposit = (\n\tid: string\n): { deposit: CachedDeposit; isLoading: boolean } =>\n\tuseSelect(\n\t\t( select ) => {\n\t\t\tconst { getDeposit, isResolving, hasFinishedResolution } =\n\t\t\t\tselect( STORE_NAME );\n\n\t\t\treturn {\n\t\t\t\tdeposit: getDeposit( id ),\n\t\t\t\tisLoading:\n\t\t\t\t\t! hasFinishedResolution( 'getDeposit', [ id ] ) ||\n\t\t\t\t\tisResolving( 'getDeposit', [ id ] ),\n\t\t\t};\n\t\t},\n\t\t[ id ]\n\t);\n\nexport const useDepositIncludesLoan = (\n\tdepositId?: string\n): {\n\tincludesFinancingPayout: boolean;\n\tisLoading: boolean;\n} => {\n\tconst hasActiveLoan = wcpaySettings.accountLoans.has_active_loan;\n\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\t// Using a conditional select here to avoid fetching transactions if there is no active loan.\n\t\t\tif ( ! depositId || ! hasActiveLoan ) {\n\t\t\t\treturn {\n\t\t\t\t\tincludesFinancingPayout: false,\n\t\t\t\t\tisLoading: false,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst { getTransactions, isResolving } = select( STORE_NAME );\n\t\t\tconst query = {\n\t\t\t\tdepositId,\n\t\t\t\tpage: '1',\n\t\t\t\ttypeIs: 'financing_payout',\n\t\t\t\tperPage: '1',\n\t\t\t\torderby: 'date',\n\t\t\t\torder: 'desc',\n\t\t\t};\n\t\t\tconst financingPayoutTransactions = getTransactions(\n\t\t\t\tquery\n\t\t\t) as Transaction[];\n\t\t\tconst isLoading = !! isResolving( 'getTransactions', [ query ] );\n\n\t\t\treturn {\n\t\t\t\tincludesFinancingPayout: financingPayoutTransactions.length > 0,\n\t\t\t\tisLoading,\n\t\t\t};\n\t\t},\n\t\t[ depositId, hasActiveLoan ]\n\t);\n};\n\nexport const useAllDepositsOverviews = (): AccountOverview.OverviewsResponse =>\n\tuseSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetAllDepositsOverviews,\n\t\t\tgetAllDepositsOverviewsError,\n\t\t\tisResolving,\n\t\t\thasFinishedResolution,\n\t\t} = select( STORE_NAME );\n\n\t\treturn {\n\t\t\toverviews: getAllDepositsOverviews(),\n\t\t\toverviewError: getAllDepositsOverviewsError(),\n\t\t\tisLoading:\n\t\t\t\t! hasFinishedResolution( 'getAllDepositsOverviews' ) ||\n\t\t\t\tisResolving( 'getAllDepositsOverviews' ),\n\t\t};\n\t} );\n\nexport const useDeposits = ( {\n\tpaged,\n\tper_page: perPage,\n\torderby = 'date',\n\torder = 'desc',\n\tstore_currency_is: storeCurrencyIs,\n\tmatch,\n\tdate_before: dateBefore,\n\tdate_after: dateAfter,\n\tdate_between: dateBetween,\n\tstatus_is: statusIs,\n\tstatus_is_not: statusIsNot,\n}: Query ): CachedDeposits => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetDeposits,\n\t\t\t\tgetDepositsCount,\n\t\t\t\tgetDepositQueryError,\n\t\t\t\tisResolving,\n\t\t\t} = select( STORE_NAME );\n\n\t\t\tconst query = {\n\t\t\t\tpaged: Number.isNaN( parseInt( paged ?? '', 10 ) )\n\t\t\t\t\t? '1'\n\t\t\t\t\t: paged,\n\t\t\t\tperPage: Number.isNaN( parseInt( perPage ?? '', 10 ) )\n\t\t\t\t\t? '25'\n\t\t\t\t\t: perPage,\n\t\t\t\torderby,\n\t\t\t\torder,\n\t\t\t\tstoreCurrencyIs,\n\t\t\t\tmatch,\n\t\t\t\tdateBefore,\n\t\t\t\tdateAfter,\n\t\t\t\tdateBetween:\n\t\t\t\t\tdateBetween &&\n\t\t\t\t\tdateBetween.sort( ( a, b ) =>\n\t\t\t\t\t\tmoment( a ).diff( moment( b ) )\n\t\t\t\t\t),\n\t\t\t\tstatusIs,\n\t\t\t\tstatusIsNot,\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tdeposits: getDeposits( query ),\n\t\t\t\tdepositsCount: getDepositsCount(),\n\t\t\t\tdepositsError: getDepositQueryError( query ),\n\t\t\t\tisLoading: isResolving( 'getDeposits', [ query ] ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tpaged,\n\t\t\tperPage,\n\t\t\torderby,\n\t\t\torder,\n\t\t\tstoreCurrencyIs,\n\t\t\tmatch,\n\t\t\tdateBefore,\n\t\t\tdateAfter,\n\t\t\tJSON.stringify( dateBetween ),\n\t\t\tstatusIs,\n\t\t\tstatusIsNot,\n\t\t]\n\t);\n};\n\nexport const useDepositsSummary = ( {\n\tmatch,\n\tstore_currency_is: storeCurrencyIs,\n\tdate_before: dateBefore,\n\tdate_after: dateAfter,\n\tdate_between: dateBetween,\n\tstatus_is: statusIs,\n\tstatus_is_not: statusIsNot,\n}: Query ): DepositsSummaryCache => {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDepositsSummary, isResolving } = select( STORE_NAME );\n\n\t\t\tconst query = {\n\t\t\t\tmatch,\n\t\t\t\tstoreCurrencyIs,\n\t\t\t\tdateBefore,\n\t\t\t\tdateAfter,\n\t\t\t\tdateBetween,\n\t\t\t\tstatusIs,\n\t\t\t\tstatusIsNot,\n\t\t\t};\n\n\t\t\treturn {\n\t\t\t\tdepositsSummary: getDepositsSummary( query ),\n\t\t\t\tisLoading: isResolving( 'getDepositsSummary', [ query ] ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tstoreCurrencyIs,\n\t\t\tmatch,\n\t\t\tdateBefore,\n\t\t\tdateAfter,\n\t\t\tJSON.stringify( dateBetween ),\n\t\t\tstatusIs,\n\t\t\tstatusIsNot,\n\t\t]\n\t);\n};\n\nexport const useInstantDeposit = (\n\tcurrency: string\n): { inProgress: boolean; submit: () => void; deposit: unknown } => {\n\tconst { deposit, inProgress } = useSelect( ( select ) => {\n\t\tconst { getInstantDeposit, isResolving } = select( STORE_NAME );\n\n\t\treturn {\n\t\t\tdeposit: getInstantDeposit( [ currency ] ),\n\t\t\tinProgress: isResolving( 'getInstantDeposit', [ currency ] ),\n\t\t};\n\t} );\n\tconst { submitInstantDeposit } = useDispatch( STORE_NAME );\n\tconst submit = () => submitInstantDeposit( currency );\n\n\treturn { deposit, inProgress, submit };\n};\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { map, keyBy } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport TYPES from './action-types';\nimport { getResourceId } from 'utils/data';\n\nconst defaultState = { byId: {}, queries: {}, count: 0, instant: {} };\n\nconst receiveDeposits = (\n\tstate = defaultState,\n\t{ type, query = {}, data = [], error }\n) => {\n\tconst index = getResourceId( query );\n\n\tswitch ( type ) {\n\t\tcase TYPES.SET_DEPOSIT:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tbyId: { ...state.byId, [ data.id ]: data },\n\t\t\t};\n\t\tcase TYPES.SET_ALL_DEPOSITS_OVERVIEWS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\toverviews: {\n\t\t\t\t\t...state.overviews,\n\t\t\t\t\tdata,\n\t\t\t\t},\n\t\t\t};\n\t\tcase TYPES.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\toverviews: {\n\t\t\t\t\t...state.overviews,\n\t\t\t\t\terror,\n\t\t\t\t},\n\t\t\t};\n\t\tcase TYPES.SET_DEPOSITS:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tbyId: { ...state.byId, ...keyBy( data, 'id' ) },\n\t\t\t\tqueries: {\n\t\t\t\t\t...state.queries,\n\t\t\t\t\t[ index ]: {\n\t\t\t\t\t\tdata: map( data, 'id' ),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t// Note: count is currently independent of query, so no need to map from the query index as above.\n\t\tcase TYPES.SET_DEPOSITS_COUNT:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcount: data,\n\t\t\t};\n\t\tcase TYPES.SET_ERROR_FOR_DEPOSIT_QUERY:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tqueries: {\n\t\t\t\t\t...state.queries,\n\t\t\t\t\t[ index ]: {\n\t\t\t\t\t\terror: error,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\tcase TYPES.SET_DEPOSITS_SUMMARY:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tsummary: {\n\t\t\t\t\t...state.summary,\n\t\t\t\t\t[ index ]: {\n\t\t\t\t\t\tdata: data,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\tcase TYPES.SET_ERROR_FOR_DEPOSITS_SUMMARY:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tsummary: {\n\t\t\t\t\t...state.summary,\n\t\t\t\t\t[ index ]: {\n\t\t\t\t\t\terror: error,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\tcase TYPES.SET_INSTANT_DEPOSIT:\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstant: {\n\t\t\t\t\t...state.instant,\n\t\t\t\t\tdata,\n\t\t\t\t},\n\t\t\t};\n\t}\n\n\treturn state;\n};\n\nexport default receiveDeposits;\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { apiFetch } from '@wordpress/data-controls';\nimport { controls } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { NAMESPACE } from '../constants';\nimport { DEPOSITS_STORE_NAME as STORE_NAME } from '../store-names';\nimport {\n\tupdateDeposit,\n\tupdateDeposits,\n\tupdateDepositsCount,\n\tupdateErrorForDepositQuery,\n\tupdateDepositsSummary,\n\tupdateErrorForDepositsSummary,\n\tupdateAllDepositsOverviews,\n\tupdateErrorForAllDepositsOverviews,\n} from './actions';\nimport { formatDateValue } from 'utils';\n\n/**\n * Retrieve a single deposit from the deposits API.\n *\n * @param {string} id Identifier for specified deposit to retrieve.\n */\nexport function* getDeposit( id ) {\n\t// Validate input to avoid path traversal request.\n\t// Avoid lookup if the id contains any unexpected characters.\n\tif ( /\\W/.test( id ) ) {\n\t\treturn;\n\t}\n\n\tconst path = addQueryArgs( `${ NAMESPACE }/deposits/${ id }` );\n\n\ttry {\n\t\tconst result = yield apiFetch( { path } );\n\t\tyield updateDeposit( result );\n\t} catch ( e ) {\n\t\tyield controls.dispatch(\n\t\t\t'core/notices',\n\t\t\t'createErrorNotice',\n\t\t\t__( 'Error retrieving payout.', 'woocommerce-payments' )\n\t\t);\n\t}\n}\n\n/**\n * Retrieve all deposits' overviews from the deposits API.\n */\nexport function* getAllDepositsOverviews() {\n\tconst path = addQueryArgs( `${ NAMESPACE }/deposits/overview-all` );\n\n\ttry {\n\t\tconst result = yield apiFetch( { path } );\n\t\tyield updateAllDepositsOverviews( result );\n\t} catch ( e ) {\n\t\tyield controls.dispatch(\n\t\t\t'core/notices',\n\t\t\t'createErrorNotice',\n\t\t\t__(\n\t\t\t\t\"Error retrieving all payouts' overviews.\",\n\t\t\t\t'woocommerce-payments'\n\t\t\t)\n\t\t);\n\t\tyield updateErrorForAllDepositsOverviews( e );\n\t}\n}\n\nconst formatQueryFilters = ( query ) => ( {\n\tuser_email: query.userEmail,\n\tmatch: query.match,\n\tstore_currency_is: query.storeCurrencyIs,\n\tdate_before: formatDateValue( query.dateBefore, true ),\n\tdate_after: formatDateValue( query.dateAfter ),\n\tdate_between: query.dateBetween && [\n\t\tformatDateValue( query.dateBetween[ 0 ] ),\n\t\tformatDateValue( query.dateBetween[ 1 ], true ),\n\t],\n\tstatus_is: query.statusIs,\n\tstatus_is_not: query.statusIsNot,\n\tlocale: query.locale,\n} );\n\nexport const payoutsDownloadEndpoint = `${ NAMESPACE }/deposits/download`;\nexport function getPayoutsCSVRequestURL( query ) {\n\tconst path = addQueryArgs(\n\t\tpayoutsDownloadEndpoint,\n\t\tformatQueryFilters( query )\n\t);\n\n\treturn path;\n}\n\n/**\n * Retrieves a series of deposits from the deposits list API.\n *\n * @param {string} query Data on which to parameterize the selection.\n */\nexport function* getDeposits( query ) {\n\tconst path = addQueryArgs( `${ NAMESPACE }/deposits`, {\n\t\tpage: query.paged,\n\t\tpagesize: query.perPage,\n\t\tsort: query.orderby,\n\t\tdirection: query.order,\n\t\t...formatQueryFilters( query ),\n\t} );\n\n\ttry {\n\t\tconst results = yield apiFetch( { path } ) || {};\n\n\t\tyield updateDeposits( query, results.data );\n\t\tyield updateDepositsCount( results.total_count );\n\n\t\t// Update resolution state on getDeposit selector for each result.\n\t\tfor ( const i in results.data ) {\n\t\t\tyield controls.dispatch(\n\t\t\t\tSTORE_NAME,\n\t\t\t\t'finishResolution',\n\t\t\t\t'getDeposit',\n\t\t\t\t[ results.data[ i ].id ]\n\t\t\t);\n\t\t}\n\t} catch ( e ) {\n\t\tyield controls.dispatch(\n\t\t\t'core/notices',\n\t\t\t'createErrorNotice',\n\t\t\t__( 'Error retrieving payouts.', 'woocommerce-payments' )\n\t\t);\n\t\tyield updateErrorForDepositQuery( query, null, e );\n\t}\n}\n\n/**\n * Retrieves the deposits summary from the summary API.\n *\n * @param {string} query Data on which to parameterize the selection.\n */\nexport function* getDepositsSummary( query ) {\n\tconst path = addQueryArgs(\n\t\t`${ NAMESPACE }/deposits/summary`,\n\t\tformatQueryFilters( query )\n\t);\n\n\ttry {\n\t\tconst summary = yield apiFetch( { path } );\n\t\tyield updateDepositsSummary( query, summary );\n\t} catch ( e ) {\n\t\tyield updateErrorForDepositsSummary( query, null, e );\n\t}\n}\n","/** @format */\n\n/**\n * Internal dependencies\n */\nimport { getResourceId } from 'utils/data';\n\n/**\n * Retrieves the deposits state from the wp.data store if the state\n * has been initialized, otherwise returns an empty state.\n *\n * @param {Object} state Current wp.data state.\n *\n * @return {Object} The deposits state.\n */\nconst getDepositsState = ( state ) => {\n\tif ( ! state ) {\n\t\treturn {};\n\t}\n\n\treturn state.deposits || {};\n};\n\nexport const getDeposit = ( state, id ) => {\n\tconst depositById = getDepositsState( state ).byId || {};\n\treturn depositById[ id ];\n};\n\n/**\n * Prepares and returns all deposits' overviews from the state.\n *\n * The API returns this in the form of separate arrays\n * for each balance/deposit type, each of them containing\n * a separate entry for each currency.\n *\n * This selector will return the account, as well as an\n * array with all of the neccessary details grouped by currency.\n *\n * Check the `AccountOverview.OverviewsResponse` declaration\n * for the shape of the returned object.\n *\n * @param {Object} state Current wp.data state.\n * @return {Object} A complex object, containing all neccessary overviews.\n */\nexport const getAllDepositsOverviews = ( state ) => {\n\tconst DepositsOverview = getDepositsState( state ).overviews || {};\n\n\t// Return an empty skeleton if data has not been loaded yet.\n\tif ( ! DepositsOverview.data ) {\n\t\treturn {\n\t\t\taccount: null,\n\t\t\tcurrencies: [],\n\t\t};\n\t}\n\n\tconst { deposit, balance, account } = DepositsOverview.data;\n\n\tconst groups = {\n\t\tlastPaid: deposit.last_paid,\n\t\tpending: balance.pending,\n\t\tavailable: balance.available,\n\t\tinstant: balance.instant,\n\t};\n\n\t/**\n\t * Note: The computations in this selector should be simple enough\n\t * not to require memorization, but it can be added if required.\n\t */\n\tconst currencies = {};\n\tfor ( const [ key, values ] of Object.entries( groups ) ) {\n\t\tvalues?.forEach( ( value ) => {\n\t\t\tconst { currency } = value;\n\n\t\t\tif ( ! currencies[ currency ] ) {\n\t\t\t\tcurrencies[ currency ] = {\n\t\t\t\t\tcurrency,\n\t\t\t\t\tlastPaid: undefined,\n\t\t\t\t\tpending: undefined,\n\t\t\t\t\tavailable: undefined,\n\t\t\t\t\tinstant: undefined,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// There will be a single deposit/balance per currency, no arrays here.\n\t\t\tcurrencies[ currency ][ key ] = value;\n\t\t} );\n\t}\n\n\tconst currenciesArray = Object.values( currencies );\n\treturn {\n\t\taccount,\n\n\t\t// The default currency should appear at the top of the list.\n\t\tcurrencies: [\n\t\t\t...currenciesArray.filter(\n\t\t\t\t( currency ) => account.default_currency === currency.currency\n\t\t\t),\n\t\t\t...currenciesArray.filter(\n\t\t\t\t( currency ) => account.default_currency !== currency.currency\n\t\t\t),\n\t\t],\n\t};\n};\n\nexport const getAllDepositsOverviewsError = ( state ) => {\n\tconst DepositsOverview = getDepositsState( state ).overviews || {};\n\treturn DepositsOverview.error;\n};\n\n/**\n * Retrieves the deposits corresponding to the provided query or a sane\n * default if they don't exist.\n *\n * @param {Object} state Current wp.data state.\n * @param {Object} query The deposits query.\n *\n * @return {Object} The list of deposits for the given query.\n */\nconst getDepositsForQuery = ( state, query ) => {\n\tconst index = getResourceId( query );\n\tconst queries = getDepositsState( state ).queries || {};\n\treturn queries[ index ] || {};\n};\n\nexport const getDeposits = ( state, query ) => {\n\tconst ids = getDepositsForQuery( state, query ).data || [];\n\treturn ids.map( getDeposit.bind( this, state ) );\n};\n\nexport const getDepositsCount = ( state ) => {\n\treturn getDepositsState( state ).count;\n};\n\nexport const getDepositQueryError = ( state, query ) => {\n\treturn getDepositsForQuery( state, query ).error || {};\n};\n\n/**\n * Retrieves the deposits summary corresponding to the provided query.\n *\n * @param {Object} state Current wp.data state.\n * @param {Object} query The deposits summary query.\n *\n * @return {Object} The deposits summary for the given query.\n */\nconst getDepositsSummaryForQuery = ( state, query ) => {\n\tconst index = getResourceId( query );\n\tconst summary = getDepositsState( state ).summary || {};\n\treturn summary[ index ] || {};\n};\n\nexport const getDepositsSummary = ( state, query ) => {\n\treturn getDepositsSummaryForQuery( state, query ).data || {};\n};\n\nexport const getDepositsSummaryError = ( state, query ) => {\n\treturn getDepositsSummaryForQuery( state, query ).error || {};\n};\n\nexport const getInstantDeposit = ( state ) => {\n\tconst instantDeposit = getDepositsState( state ).instant || {};\n\treturn instantDeposit.data;\n};\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { createReduxStore, register, combineReducers } from '@wordpress/data';\nimport { controls } from '@wordpress/data-controls';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\nimport { DEPOSITS_STORE_NAME } from '../store-names';\n\nexport const STORE_NAME = DEPOSITS_STORE_NAME;\n\n// The reducer is nested under its slice key so selectors keep reading\n// `state.deposits.…`, exactly as they did under the old combined store.\nexport const store = createReduxStore( STORE_NAME, {\n\treducer: combineReducers( { deposits: reducer } ),\n\tactions,\n\tselectors,\n\tresolvers,\n\tcontrols,\n} );\n\nregister( store );\n","/**\n * External dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport moment from 'moment';\nimport { formatDateTimeFromString } from 'wcpay/utils/date-time';\n\ninterface DepositObject {\n\tdate: number | string;\n}\n\nexport const getDepositDate = ( deposit?: DepositObject | null ): string =>\n\tdeposit ? formatDateTimeFromString( deposit?.date as string ) : '—';\n\ninterface GetDepositMonthlyAnchorLabelProps {\n\tmonthlyAnchor: number;\n\tcapitalize?: boolean;\n}\nexport const getDepositMonthlyAnchorLabel = ( {\n\tmonthlyAnchor,\n\tcapitalize = true,\n}: GetDepositMonthlyAnchorLabelProps ): string => {\n\t// If locale is set up as en_US or en_GB the ordinal will not show up\n\t// More details can be found in https://github.com/WordPress/gutenberg/issues/15221/\n\t// Using 'en' as the locale should be enough to workaround it\n\t// TODO: This was resolved in WP 6.1. When the required version is 6.1 or higher, we can remove this workaround.\n\tconst fixedLocale = moment.locale().startsWith( 'en' )\n\t\t? 'en'\n\t\t: moment.locale();\n\n\tlet label = moment()\n\t\t.locale( fixedLocale )\n\t\t.date( monthlyAnchor )\n\t\t.format( 'Do' );\n\n\tif ( monthlyAnchor === 31 ) {\n\t\tlabel = __( 'Last day of the month', 'woocommerce-payments' );\n\t}\n\tif ( ! capitalize ) {\n\t\tlabel = label.toLowerCase();\n\t}\n\treturn label;\n};\n\n// Determine if the store/merchant has scheduled deposits configured.\nexport const hasAutomaticScheduledDeposits = (\n\tdepositsScheduleInterval: string | undefined\n): boolean => {\n\tif ( ! depositsScheduleInterval ) {\n\t\treturn false;\n\t}\n\n\treturn [ 'daily', 'weekly', 'monthly' ].includes(\n\t\tdepositsScheduleInterval\n\t);\n};\n"],"names":["mappings","pending","in_transit","paid","failed","canceled","DepositStatusChip","deposit","message","depositStatusLabels","status","type","deducted","_jsx","Chip","DepositScheduleSummary","depositsSchedule","interval","interpolateComponents","mixedString","sprintf","__","components","strong","dayOfWeek","moment","locale","day","weekly_anchor","format","monthlyAnchor","monthly_anchor","getDepositMonthlyAnchorLabel","capitalize","_Fragment","DepositSchedule","hasAutomaticScheduledDeposits","nextDepositHelpContent","children","link","rel","target","href","_jsxs","ClickTooltip","content","buttonIcon","HelpOutlineIcon","buttonLabel","SET_DEPOSIT","SET_DEPOSITS","SET_DEPOSITS_COUNT","SET_ERROR_FOR_DEPOSIT_QUERY","SET_DEPOSITS_SUMMARY","SET_ERROR_FOR_DEPOSITS_SUMMARY","SET_INSTANT_DEPOSIT","SET_ALL_DEPOSITS_OVERVIEWS","SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS","updateDeposit","data","TYPES","updateAllDepositsOverviews","updateErrorForAllDepositsOverviews","error","updateDeposits","query","updateDepositsCount","updateErrorForDepositQuery","updateDepositsSummary","updateErrorForDepositsSummary","updateInstantDeposit","submitInstantDeposit","currency","dispatch","STORE_NAME","startResolution","apiFetch","path","method","invalidateResolutionForStoreSelector","createSuccessNotice","formatCurrency","amount","actions","label","url","getAdminUrl","page","id","createErrorNotice","finishResolution","useDeposit","useSelect","select","getDeposit","isResolving","hasFinishedResolution","isLoading","useAllDepositsOverviews","getAllDepositsOverviews","getAllDepositsOverviewsError","overviews","overviewError","useDeposits","paged","per_page","perPage","orderby","order","store_currency_is","storeCurrencyIs","match","date_before","dateBefore","date_after","dateAfter","date_between","dateBetween","status_is","statusIs","status_is_not","statusIsNot","getDeposits","getDepositsCount","getDepositQueryError","Number","isNaN","parseInt","sort","a","b","diff","deposits","depositsCount","depositsError","JSON","stringify","useDepositsSummary","getDepositsSummary","depositsSummary","useInstantDeposit","inProgress","getInstantDeposit","useDispatch","submit","defaultState","byId","queries","count","instant","receiveDeposits","state","index","getResourceId","keyBy","map","summary","test","addQueryArgs","NAMESPACE","result","e","controls","formatQueryFilters","user_email","userEmail","formatDateValue","payoutsDownloadEndpoint","getPayoutsCSVRequestURL","pagesize","direction","results","total_count","i","getDepositsState","DepositsOverview","account","currencies","balance","groups","lastPaid","last_paid","available","key","values","Object","entries","forEach","value","undefined","currenciesArray","filter","default_currency","getDepositsForQuery","bind","getDepositsSummaryForQuery","getDepositsSummaryError","DEPOSITS_STORE_NAME","store","createReduxStore","reducer","combineReducers","selectors","resolvers","register","getDepositDate","formatDateTimeFromString","date","fixedLocale","startsWith","toLowerCase","depositsScheduleInterval","includes"],"sourceRoot":""}