| 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/reports-fees.js?ver=9dbd72e4c8d1c1c0d342","mappings":"iNAmBO,MAAMA,EAAgBA,CAI5BC,EAIAC,KAEAC,EAAAA,EAAAA,IAAa,CACZC,KAAM,WACNC,KAAM,aAAcH,YACpBD,OAoBF,EAPkDK,EAAIL,KAAIC,mBACzDD,GACCM,EAAAA,EAAAA,KAACC,EAAAA,KAAI,CAACC,KAAOT,EAAeC,EAAIC,GAAiBQ,UAChDH,EAAAA,EAAAA,KAACI,EAAAA,EAAe,CAACC,KAAO,OAEtB,I,iECnCL,MAAMC,EAA+B,kCAG/BC,EAA6B,0EAA2ED,IAGxGE,GAAwBC,EAAAA,EAAAA,IAAI,UAG5BC,EAAwD,CAC7D,aACA,aAEKC,EAA4BD,EAA6BE,IAC5DC,IAAM,CACPA,SACAC,OAAOC,EAAAA,EAAAA,IAAqBF,MAoExBG,EAA6BA,CAClCC,EACAC,KAEA,IAAOD,GAAoC,YAAvBA,EAAUE,SAC7B,OAAO,KAGR,MAAMN,GAASO,EAAAA,EAAAA,IAAaH,EAAWC,GACvC,MAbAL,IAEAH,EAA6BW,SAAUR,GAWhCS,CAA4BT,GAAWA,EAAS,MAGlDU,EAA4BA,CACjCC,EACAC,KAEA,MAAMC,EAAsBF,EAAQG,iBACnC,yCAA0CrB,MAErCsB,EAAUC,MAAMC,KAAMJ,GACtBK,EAAqBH,EAAQI,KAChCC,GAAYA,E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,EAAAA,EAAAA,IAAI,kBAAmB,yBAI1Bsb,EAAY,CACxB,GAAKtb,EAAAA,EAAAA,IAAI,SAAU,wBACnB,GAAKA,EAAAA,EAAAA,IAAI,WAAY,wBACrB,GAAKA,EAAAA,EAAAA,IAAI,UAAW,wB,6CCGd,MAAMub,EAAoC,CAChDC,qBAAqBxb,EAAAA,EAAAA,IAAI,sBAAuB,wBAChDyb,WAAWzb,EAAAA,EAAAA,IAAI,YAAa,wBAC5B0b,YAAY1b,EAAAA,EAAAA,IAAI,aAAc,wBAC9B2b,YAAY3b,EAAAA,EAAAA,IAAI,aAAc,wBAC9B4b,MAAM5b,EAAAA,EAAAA,IAAI,mBAAoB,wBAC9B6b,MAAM7b,EAAAA,EAAAA,IAAI,eAAgB,wBAC1B8b,cAAc9b,EAAAA,EAAAA,IAAI,yBAA0B,wBAC5C+b,kBAAkB/b,EAAAA,EAAAA,IAAI,mBAAoB,wBAC1Cgc,QAAQhc,EAAAA,EAAAA,IAAI,cAAe,wBAC3Bic,UAAUjc,EAAAA,EAAAA,IAAI,WAAY,wBAC1Bkc,WAAWlc,EAAAA,EAAAA,IAAI,SAAU,wBACzBmc,KAAKnc,EAAAA,EAAAA,IAAI,MAAO,wBAChBoc,YAAYpc,EAAAA,EAAAA,IAAI,aAAc,wBAC9Bqc,gBAAgBrc,EAAAA,EAAAA,IAAI,iBAAkB,wBACtCsc,UAAUtc,EAAAA,EAAAA,IAAI,YAAa,wBAC3Buc,MAAMvc,EAAAA,EAAAA,IAAI,OAAQ,yBC/CN0N,EAAmCA,CAC/C8O,EACAC,EAASjX,QAAQkX,kCAGhBD,IAAUD,IAAmBzD,OAC7BwC,EACCiB,IAEDA,C","sources":["webpack://woocommerce-payments/./client/components/details-link/index.tsx","webpack://woocommerce-payments/./client/reports/date-filter/dataviews-date-range-preset-portal.tsx","webpack://woocommerce-payments/./client/reports/date-filter/presets.ts","webpack://woocommerce-payments/./client/reports/fees/view.ts","webpack://woocommerce-payments/./client/reports/fees/use-fees-url-sync.ts","webpack://woocommerce-payments/./client/reports/fees/use-fees-user-prefs.ts","webpack://woocommerce-payments/./client/reports/fees/use-fees-view.ts","webpack://woocommerce-payments/./client/reports/fees/strings.ts","webpack://woocommerce-payments/./client/reports/fees/use-fees-data.ts","webpack://woocommerce-payments/./client/reports/fees/fields.tsx","webpack://woocommerce-payments/./client/reports/fees/index.tsx","webpack://woocommerce-payments/./client/reports/report-state.tsx","webpack://woocommerce-payments/./client/transactions/strings.ts","webpack://woocommerce-payments/./client/constants/payment-method.ts","webpack://woocommerce-payments/./client/transactions/utils/getTransactionPaymentMethodTitle.ts"],"sourcesContent":["/** @format **/\n\n/**\n * External dependencies\n */\nimport React from 'react';\nimport InfoOutlineIcon from 'gridicons/dist/info-outline';\nimport { Link } from '@woocommerce/components';\n\n/**\n * Internal dependencies\n */\nimport { getAdminUrl } from 'wcpay/utils';\n\n/**\n * The parent segment is the first part of the URL after the /payments/ path.\n */\ntype ParentSegment = 'payouts' | 'transactions';\n\nexport const getDetailsURL = (\n\t/**\n\t * The ID of the object to link to.\n\t */\n\tid: string,\n\t/**\n\t * The parent segment is the first part of the URL after the /payments/ path.\n\t */\n\tparentSegment: ParentSegment\n): string =>\n\tgetAdminUrl( {\n\t\tpage: 'wc-admin',\n\t\tpath: `/payments/${ parentSegment }/details`,\n\t\tid,\n\t} );\n\ninterface DetailsLinkProps {\n\t/**\n\t * The ID of the object to link to.\n\t */\n\tid?: string;\n\t/**\n\t * The parent segment is the first part of the URL after the /payments/ path.\n\t */\n\tparentSegment: ParentSegment;\n}\nconst DetailsLink: React.FC< DetailsLinkProps > = ( { id, parentSegment } ) =>\n\tid ? (\n\t\t<Link href={ getDetailsURL( id, parentSegment ) }>\n\t\t\t<InfoOutlineIcon size={ 18 } />\n\t\t</Link>\n\t) : null;\n\nexport default DetailsLink;\n","/** @format */\n\n/**\n * External dependencies\n */\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { DateFilterValue } from './types';\nimport type { RangePreset } from './presets';\nimport { getRangePresetLabel, matchPreset, resolvePreset } from './presets';\n\nconst injectedDateRangePresetClass = 'wcpay-reports-date-range-preset';\nconst injectedDateRangePresetInsertClass =\n\t'wcpay-reports-date-range-preset-insert';\nconst dateRangePresetButtonClass = `components-button is-tertiary is-small dataviews-controls__date-preset ${ injectedDateRangePresetClass }`;\n// DataViews owns this native label and translates it with the default domain.\n// eslint-disable-next-line @wordpress/i18n-text-domain\nconst customDatePresetLabel = __( 'Custom' );\n\ntype ReportDateRangePreset = Extract< RangePreset, 'last_month' | 'last_year' >;\nconst dataViewsDateRangePresetKeys: ReportDateRangePreset[] = [\n\t'last_month',\n\t'last_year',\n];\nconst dataViewsDateRangePresets = dataViewsDateRangePresetKeys.map(\n\t( preset ) => ( {\n\t\tpreset,\n\t\tlabel: getRangePresetLabel( preset ),\n\t} )\n);\n\ntype DateRangePresetInsertionPoint = {\n\tpopover: HTMLElement;\n\tparent: HTMLElement;\n\tbefore: Element;\n};\n\ntype SyncPortalNodeOptions = {\n\tforce?: boolean;\n};\n\n// DataViews does not expose a public preset-extension API. These selectors are\n// private DataViews markup verified against the `@wordpress/dataviews` version\n// bundled with this branch; if upstream renames them, the injected presets will\n// silently stop rendering while the native date filter continues to work.\nconst getDateRangePresetInsertionPoint = (\n\townerDocument: Document\n): DateRangePresetInsertionPoint | null => {\n\tconst popovers = ownerDocument.querySelectorAll< HTMLElement >(\n\t\t'.dataviews-filters__summary-popover'\n\t);\n\n\tfor ( const popover of Array.from( popovers ) ) {\n\t\tconst rangeInputs = popover.querySelector< HTMLElement >(\n\t\t\t'.dataviews-controls__date-range-inputs'\n\t\t);\n\t\tif ( ! rangeInputs ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst firstNativePreset = popover.querySelector< HTMLElement >(\n\t\t\t`.dataviews-controls__date-preset:not(.${ injectedDateRangePresetClass })`\n\t\t);\n\t\tif ( firstNativePreset?.parentElement ) {\n\t\t\treturn {\n\t\t\t\tpopover,\n\t\t\t\tparent: firstNativePreset.parentElement,\n\t\t\t\tbefore: firstNativePreset,\n\t\t\t};\n\t\t}\n\n\t\tif ( rangeInputs?.parentElement ) {\n\t\t\treturn {\n\t\t\t\tpopover,\n\t\t\t\tparent: rangeInputs.parentElement,\n\t\t\t\tbefore: rangeInputs,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn null;\n};\n\nconst getDateRangePresetPopoverFallbackContainer = (\n\townerDocument: Document\n): HTMLElement | null =>\n\townerDocument.querySelector< HTMLElement >(\n\t\t'.components-popover__fallback-container'\n\t);\n\nconst isDataViewsDateRangePreset = (\n\tpreset: string\n): preset is ReportDateRangePreset =>\n\tdataViewsDateRangePresetKeys.includes( preset as ReportDateRangePreset );\n\nconst getSelectedDateRangePreset = (\n\tdateValue: DateFilterValue | undefined,\n\tnow: Date\n): ReportDateRangePreset | null => {\n\tif ( ! dateValue || dateValue.operator !== 'between' ) {\n\t\treturn null;\n\t}\n\n\tconst preset = matchPreset( dateValue, now );\n\treturn isDataViewsDateRangePreset( preset ) ? preset : null;\n};\n\nconst syncNativeDatePresetState = (\n\tpopover: HTMLElement,\n\tselectedPreset: ReportDateRangePreset | null\n): void => {\n\tconst nativePresetButtons = popover.querySelectorAll< HTMLButtonElement >(\n\t\t`.dataviews-controls__date-preset:not(.${ injectedDateRangePresetClass })`\n\t);\n\tconst buttons = Array.from( nativePresetButtons );\n\tconst customPresetButton = buttons.find(\n\t\t( button ) => button.textContent?.trim() === customDatePresetLabel\n\t);\n\n\tfor ( const button of buttons ) {\n\t\tif ( selectedPreset ) {\n\t\t\tif ( button.getAttribute( 'aria-pressed' ) !== 'false' ) {\n\t\t\t\tbutton.setAttribute( 'aria-pressed', 'false' );\n\t\t\t}\n\t\t\tif ( button.classList.contains( 'is-pressed' ) ) {\n\t\t\t\tbutton.classList.remove( 'is-pressed' );\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! customPresetButton ) {\n\t\treturn;\n\t}\n\n\tcustomPresetButton.removeAttribute( 'aria-disabled' );\n};\n\nconst syncDateRangePresetButtons = (\n\tportalNode: HTMLElement,\n\tselectedPreset: ReportDateRangePreset | null,\n\tonPresetClick: ( preset: ReportDateRangePreset ) => void\n): void => {\n\tfor ( const { preset, label } of dataViewsDateRangePresets ) {\n\t\tconst selector = `[data-wcpay-date-range-preset=\"${ preset }\"]`;\n\t\tlet button = portalNode.querySelector< HTMLButtonElement >( selector );\n\t\tif ( ! button ) {\n\t\t\tbutton = portalNode.ownerDocument.createElement( 'button' );\n\t\t\tbutton.type = 'button';\n\t\t\tbutton.className = dateRangePresetButtonClass;\n\t\t\tbutton.dataset.wcpayDateRangePreset = preset;\n\t\t\tbutton.textContent = label;\n\t\t\tbutton.onclick = () => onPresetClick( preset );\n\t\t\tportalNode.appendChild( button );\n\t\t}\n\n\t\tconst isSelected = selectedPreset === preset;\n\t\tconst ariaPressed = isSelected ? 'true' : 'false';\n\t\tif ( button.textContent !== label ) {\n\t\t\tbutton.textContent = label;\n\t\t}\n\t\tif ( button.getAttribute( 'aria-pressed' ) !== ariaPressed ) {\n\t\t\tbutton.setAttribute( 'aria-pressed', ariaPressed );\n\t\t}\n\t\tif ( button.classList.contains( 'is-pressed' ) !== isSelected ) {\n\t\t\tbutton.classList.toggle( 'is-pressed', isSelected );\n\t\t}\n\t}\n};\n\nexport const DataViewsDateRangePresetPortal = ( {\n\trootRef,\n\tdateValue,\n\tdateFilterNow,\n\tonDateChange,\n}: {\n\trootRef: React.RefObject< HTMLElement | null >;\n\tdateValue: DateFilterValue | undefined;\n\tdateFilterNow?: Date;\n\tonDateChange: ( next: DateFilterValue, referenceDate: Date ) => void;\n} ): null => {\n\tconst portalNodeRef = useRef< HTMLDivElement | null >( null );\n\tconst stableDateFilterNowRef = useRef< Date | null >( null );\n\tif ( ! stableDateFilterNowRef.current ) {\n\t\tstableDateFilterNowRef.current = dateFilterNow ?? new Date();\n\t}\n\tconst [ clickedDateFilterNow, setClickedDateFilterNow ] =\n\t\tuseState< Date | null >( null );\n\tconst selectedPreset =\n\t\t( clickedDateFilterNow &&\n\t\t\tgetSelectedDateRangePreset( dateValue, clickedDateFilterNow ) ) ||\n\t\tgetSelectedDateRangePreset( dateValue, stableDateFilterNowRef.current );\n\tconst applyDatePreset = useCallback(\n\t\t( preset: ReportDateRangePreset ) => {\n\t\t\tconst currentDateFilterNow = new Date();\n\t\t\tconst nextValue = resolvePreset(\n\t\t\t\tpreset,\n\t\t\t\t'between',\n\t\t\t\tcurrentDateFilterNow\n\t\t\t);\n\t\t\tif ( nextValue ) {\n\t\t\t\tsetClickedDateFilterNow( currentDateFilterNow );\n\t\t\t\tonDateChange( nextValue, currentDateFilterNow );\n\t\t\t}\n\t\t},\n\t\t[ onDateChange ]\n\t);\n\tconst applyDatePresetRef = useRef( applyDatePreset );\n\tapplyDatePresetRef.current = applyDatePreset;\n\tconst selectedPresetRef = useRef( selectedPreset );\n\tselectedPresetRef.current = selectedPreset;\n\n\tconst syncPortalNode = useCallback(\n\t\t( { force = false }: SyncPortalNodeOptions = {} ) => {\n\t\t\tconst ownerDocument = rootRef.current?.ownerDocument ?? document;\n\t\t\tconst insertionPoint =\n\t\t\t\tgetDateRangePresetInsertionPoint( ownerDocument );\n\t\t\tconst currentSelectedPreset = selectedPresetRef.current;\n\n\t\t\tif ( ! insertionPoint ) {\n\t\t\t\tportalNodeRef.current?.remove();\n\t\t\t\tportalNodeRef.current = null;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tportalNodeRef.current?.parentElement ===\n\t\t\t\t\tinsertionPoint.parent &&\n\t\t\t\tportalNodeRef.current.nextElementSibling ===\n\t\t\t\t\tinsertionPoint.before\n\t\t\t) {\n\t\t\t\tif ( ! force ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsyncNativeDatePresetState(\n\t\t\t\t\tinsertionPoint.popover,\n\t\t\t\t\tcurrentSelectedPreset\n\t\t\t\t);\n\t\t\t\tsyncDateRangePresetButtons(\n\t\t\t\t\tportalNodeRef.current,\n\t\t\t\t\tcurrentSelectedPreset,\n\t\t\t\t\t( preset ) => applyDatePresetRef.current( preset )\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsyncNativeDatePresetState(\n\t\t\t\tinsertionPoint.popover,\n\t\t\t\tcurrentSelectedPreset\n\t\t\t);\n\t\t\tportalNodeRef.current?.remove();\n\n\t\t\tconst nextPortalNode = ownerDocument.createElement( 'div' );\n\t\t\tnextPortalNode.className = injectedDateRangePresetInsertClass;\n\t\t\tnextPortalNode.style.display = 'contents';\n\t\t\tinsertionPoint.parent.insertBefore(\n\t\t\t\tnextPortalNode,\n\t\t\t\tinsertionPoint.before\n\t\t\t);\n\n\t\t\tportalNodeRef.current = nextPortalNode;\n\t\t\tsyncDateRangePresetButtons(\n\t\t\t\tnextPortalNode,\n\t\t\t\tcurrentSelectedPreset,\n\t\t\t\t( preset ) => applyDatePresetRef.current( preset )\n\t\t\t);\n\t\t},\n\t\t[ rootRef ]\n\t);\n\n\tuseEffect( () => {\n\t\tsyncPortalNode( { force: true } );\n\t}, [ selectedPreset, syncPortalNode ] );\n\n\tuseEffect( () => {\n\t\tconst ownerDocument = rootRef.current?.ownerDocument ?? document;\n\t\tconst ownerWindow = ownerDocument.defaultView ?? window;\n\t\tsyncPortalNode();\n\t\tlet syncAnimationFrame: number | null = null;\n\n\t\tconst observedTargets = new Set< HTMLElement >();\n\n\t\tfunction observeTarget(\n\t\t\tobserver: MutationObserver,\n\t\t\ttarget: HTMLElement | null,\n\t\t\toptions: MutationObserverInit\n\t\t) {\n\t\t\tif ( ! target || observedTargets.has( target ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tobserver.observe( target, options );\n\t\t\tobservedTargets.add( target );\n\t\t}\n\n\t\tfunction observePopoverFallbackContainer( observer: MutationObserver ) {\n\t\t\tobserveTarget(\n\t\t\t\tobserver,\n\t\t\t\tgetDateRangePresetPopoverFallbackContainer( ownerDocument ),\n\t\t\t\t{\n\t\t\t\t\tchildList: true,\n\t\t\t\t\tsubtree: true,\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tconst observer = new MutationObserver( () => {\n\t\t\tif ( syncAnimationFrame !== null ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsyncAnimationFrame = ownerWindow.requestAnimationFrame( () => {\n\t\t\t\tsyncAnimationFrame = null;\n\t\t\t\tsyncPortalNode();\n\t\t\t\tobservePopoverFallbackContainer( observer );\n\t\t\t} );\n\t\t} );\n\n\t\tobservePopoverFallbackContainer( observer );\n\t\tobserveTarget(\n\t\t\tobserver,\n\t\t\townerDocument.getElementById( 'wpbody-content' ),\n\t\t\t{\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true,\n\t\t\t}\n\t\t);\n\t\tobserveTarget( observer, ownerDocument.body, {\n\t\t\tchildList: true,\n\t\t} );\n\n\t\tif ( ! observedTargets.size ) {\n\t\t\treturn () => {\n\t\t\t\tif ( syncAnimationFrame !== null ) {\n\t\t\t\t\townerWindow.cancelAnimationFrame( syncAnimationFrame );\n\t\t\t\t}\n\t\t\t\tportalNodeRef.current?.remove();\n\t\t\t\tportalNodeRef.current = null;\n\t\t\t};\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( syncAnimationFrame !== null ) {\n\t\t\t\townerWindow.cancelAnimationFrame( syncAnimationFrame );\n\t\t\t}\n\t\t\tobserver.disconnect();\n\t\t\tportalNodeRef.current?.remove();\n\t\t\tportalNodeRef.current = null;\n\t\t};\n\t}, [ rootRef, syncPortalNode ] );\n\n\treturn null;\n};\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tDateFilterPresetElement,\n\tDateFilterValue,\n\tDateOperator,\n} from './types';\n\nexport type SingleDatePreset =\n\t| 'today'\n\t| 'yesterday'\n\t| 'past_week'\n\t| 'past_month';\n\nexport type RangePreset =\n\t| 'last_month'\n\t| 'month_to_date'\n\t| 'last_year'\n\t| 'year_to_date';\n\nexport type CustomPreset = 'custom';\n\nexport type DatePreset = SingleDatePreset | RangePreset | CustomPreset;\n\nconst toYmd = ( d: Date ): string =>\n\t`${ d.getFullYear() }-${ String( d.getMonth() + 1 ).padStart(\n\t\t2,\n\t\t'0'\n\t) }-${ String( d.getDate() ).padStart( 2, '0' ) }`;\n\nconst startOfDay = ( now: Date ): Date =>\n\tnew Date( now.getFullYear(), now.getMonth(), now.getDate() );\n\nconst singleDatePresetLabels = (): Record< SingleDatePreset, string > => ( {\n\ttoday: __( 'Today', 'woocommerce-payments' ),\n\tyesterday: __( 'Yesterday', 'woocommerce-payments' ),\n\tpast_week: __( 'Past week', 'woocommerce-payments' ),\n\tpast_month: __( 'Past month', 'woocommerce-payments' ),\n} );\n\nconst rangePresetLabels = (): Record< RangePreset, string > => ( {\n\tlast_month: __( 'Previous month', 'woocommerce-payments' ),\n\tmonth_to_date: __( 'Month to date', 'woocommerce-payments' ),\n\tlast_year: __( 'Previous year', 'woocommerce-payments' ),\n\tyear_to_date: __( 'Year to date', 'woocommerce-payments' ),\n} );\n\nexport const getRangePresetLabel = ( preset: RangePreset ): string =>\n\trangePresetLabels()[ preset ];\n\n/**\n * Return the preset chip list for the given operator. `between` operates on\n * date ranges; `on`/`before`/`after` operate on a single anchor date.\n */\nexport const getPresetsForOperator = (\n\toperator: DateOperator\n): DateFilterPresetElement[] => {\n\tconst customLabel = __( 'Custom', 'woocommerce-payments' );\n\n\tif ( operator === 'between' ) {\n\t\tconst labels = rangePresetLabels();\n\t\treturn [\n\t\t\t{ value: 'last_month', label: labels.last_month },\n\t\t\t{ value: 'month_to_date', label: labels.month_to_date },\n\t\t\t{ value: 'last_year', label: labels.last_year },\n\t\t\t{ value: 'year_to_date', label: labels.year_to_date },\n\t\t\t{ value: 'custom', label: customLabel },\n\t\t];\n\t}\n\n\tconst labels = singleDatePresetLabels();\n\treturn [\n\t\t{ value: 'today', label: labels.today },\n\t\t{ value: 'yesterday', label: labels.yesterday },\n\t\t{ value: 'past_week', label: labels.past_week },\n\t\t{ value: 'past_month', label: labels.past_month },\n\t\t{ value: 'custom', label: customLabel },\n\t];\n};\n\nconst resolveSingleAnchorDate = (\n\tpreset: SingleDatePreset,\n\tnow: Date\n): string => {\n\tconst today = startOfDay( now );\n\n\tswitch ( preset ) {\n\t\tcase 'today':\n\t\t\treturn toYmd( today );\n\t\tcase 'yesterday': {\n\t\t\tconst d = new Date( today );\n\t\t\td.setDate( d.getDate() - 1 );\n\t\t\treturn toYmd( d );\n\t\t}\n\t\tcase 'past_week': {\n\t\t\tconst d = new Date( today );\n\t\t\td.setDate( d.getDate() - 7 );\n\t\t\treturn toYmd( d );\n\t\t}\n\t\tcase 'past_month': {\n\t\t\tconst d = new Date( today );\n\t\t\td.setMonth( d.getMonth() - 1 );\n\t\t\treturn toYmd( d );\n\t\t}\n\t}\n};\n\nconst resolveRange = ( preset: RangePreset, now: Date ): [ string, string ] => {\n\tconst today = startOfDay( now );\n\tconst year = today.getFullYear();\n\tconst month = today.getMonth();\n\n\tswitch ( preset ) {\n\t\tcase 'last_month': {\n\t\t\tconst start = new Date( year, month - 1, 1 );\n\t\t\tconst end = new Date( year, month, 0 );\n\t\t\treturn [ toYmd( start ), toYmd( end ) ];\n\t\t}\n\t\tcase 'month_to_date': {\n\t\t\tconst start = new Date( year, month, 1 );\n\t\t\treturn [ toYmd( start ), toYmd( today ) ];\n\t\t}\n\t\tcase 'last_year': {\n\t\t\tconst start = new Date( year - 1, 0, 1 );\n\t\t\tconst end = new Date( year - 1, 11, 31 );\n\t\t\treturn [ toYmd( start ), toYmd( end ) ];\n\t\t}\n\t\tcase 'year_to_date': {\n\t\t\tconst start = new Date( year, 0, 1 );\n\t\t\treturn [ toYmd( start ), toYmd( today ) ];\n\t\t}\n\t}\n};\n\nconst singleDatePresets: SingleDatePreset[] = [\n\t'today',\n\t'yesterday',\n\t'past_week',\n\t'past_month',\n];\n\nconst rangePresets: RangePreset[] = [\n\t// Keep these keys stable: they are emitted in analytics even when labels use\n\t// \"Previous month\" / \"Previous year\" for merchant-facing copy.\n\t'last_month',\n\t'month_to_date',\n\t'last_year',\n\t'year_to_date',\n];\n\nconst isSingleDatePreset = ( value: unknown ): value is SingleDatePreset =>\n\ttypeof value === 'string' &&\n\tsingleDatePresets.includes( value as SingleDatePreset );\n\nconst isRangePreset = ( value: unknown ): value is RangePreset =>\n\ttypeof value === 'string' && rangePresets.includes( value as RangePreset );\n\n/**\n * Resolve a preset key + operator into a `DateFilterValue`. Returns `undefined`\n * for unrecognized presets, the `custom` sentinel, or operator/preset\n * mismatches (e.g., a range preset against a single-date operator).\n */\nexport const resolvePreset = (\n\tpreset: string,\n\toperator: DateOperator,\n\tnow: Date = new Date()\n): DateFilterValue | undefined => {\n\tif ( preset === 'custom' ) {\n\t\treturn undefined;\n\t}\n\n\tif ( operator === 'between' ) {\n\t\tif ( ! isRangePreset( preset ) ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn { operator: 'between', value: resolveRange( preset, now ) };\n\t}\n\n\tif ( ! isSingleDatePreset( preset ) ) {\n\t\treturn undefined;\n\t}\n\tconst anchor = resolveSingleAnchorDate( preset, now );\n\tif ( operator === 'on' ) {\n\t\treturn { operator: 'on', value: anchor };\n\t}\n\tif ( operator === 'before' ) {\n\t\treturn { operator: 'before', value: anchor };\n\t}\n\treturn { operator: 'after', value: anchor };\n};\n\n/**\n * Try to recognize a `DateFilterValue` as one of the named presets, given a\n * reference \"now\". Returns the preset key, or `'custom'` if no preset matches.\n * Useful so the popover can highlight the active preset chip on reopen.\n */\nexport const matchPreset = (\n\tvalue: DateFilterValue,\n\tnow: Date = new Date()\n): DatePreset => {\n\tif ( value.operator === 'between' ) {\n\t\tfor ( const preset of rangePresets ) {\n\t\t\tconst range = resolveRange( preset, now );\n\t\t\tif (\n\t\t\t\trange[ 0 ] === value.value[ 0 ] &&\n\t\t\t\trange[ 1 ] === value.value[ 1 ]\n\t\t\t) {\n\t\t\t\treturn preset;\n\t\t\t}\n\t\t}\n\t\treturn 'custom';\n\t}\n\n\tfor ( const preset of singleDatePresets ) {\n\t\tif ( resolveSingleAnchorDate( preset, now ) === value.value ) {\n\t\t\treturn preset;\n\t\t}\n\t}\n\treturn 'custom';\n};\n","/** @format */\n\nimport type { View, ViewTable } from '@wordpress/dataviews/wp';\n\nexport const feesViewUserMetaKey = 'wc_payments_reports_fees_view';\n\nexport type FeesFieldId =\n\t| 'date'\n\t| 'payment_method'\n\t| 'type'\n\t| 'order_id'\n\t| 'transaction_id'\n\t| 'transaction_currency'\n\t| 'amount'\n\t| 'fees'\n\t| 'deposit_date'\n\t| 'deposit_id';\n\nconst defaultVisibleFields: FeesFieldId[] = [\n\t'transaction_id',\n\t'payment_method',\n\t'type',\n\t'order_id',\n\t'transaction_currency',\n\t'amount',\n\t'fees',\n];\n\nexport const defaultPerPage = 25;\nexport const feesPrimaryField: FeesFieldId = 'date';\n\nexport const getFeesTableFields = (\n\tfields: readonly string[] = defaultVisibleFields\n): FeesFieldId[] =>\n\tfields.filter( ( field ) => field !== feesPrimaryField ) as FeesFieldId[];\n\n/**\n * Subset of the View object that we persist to user_meta. Sort/page/search/filters\n * live in the URL; only layout-ish state goes to user_meta so a user's preferred\n * column set and density survive across sessions without polluting bookmarks.\n * Density is stored inside `layout`, not at the top level.\n */\nexport interface PersistedFeesView {\n\tfields: FeesFieldId[];\n\tlayout?: ViewTable[ 'layout' ];\n\tperPage?: number;\n}\n\nexport const getFeesTableLayout = (\n\tlayout: ViewTable[ 'layout' ] = {}\n): ViewTable[ 'layout' ] => {\n\tconst styles = layout?.styles ?? {};\n\n\treturn {\n\t\t...layout,\n\t\tstyles: {\n\t\t\t...styles,\n\t\t\tamount: {\n\t\t\t\t...styles.amount,\n\t\t\t\talign: 'start',\n\t\t\t},\n\t\t\tfees: {\n\t\t\t\t...styles.fees,\n\t\t\t\talign: 'start',\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport const getDefaultFeesView = (): View => ( {\n\ttype: 'table',\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: defaultPerPage,\n\tsort: { field: 'date', direction: 'desc' },\n\ttitleField: feesPrimaryField,\n\tfields: getFeesTableFields(),\n\tlayout: getFeesTableLayout(),\n} );\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { getQuery, updateQueryString } from '@woocommerce/navigation';\nimport type { View, ViewTable, Filter } from '@wordpress/dataviews/wp';\n\n/**\n * Internal dependencies\n */\nimport {\n\tdefaultPerPage,\n\tgetDefaultFeesView,\n\tgetFeesTableLayout,\n\tgetFeesTableFields,\n\tPersistedFeesView,\n} from './view';\nimport {\n\tparseFeesDateFilterFromQuery,\n\tserializeFeesDateFilterToQuery,\n} from './date-filter-values';\n\nconst reportsPath = '/payments/reports';\nconst searchDebounceMs = 500;\n\nconst parseIntOr = ( value: unknown, fallback: number ): number => {\n\tconst n = parseInt( String( value ?? '' ), 10 );\n\treturn Number.isNaN( n ) ? fallback : n;\n};\n\nconst getSingleQueryValue = ( value: unknown ): string | undefined => {\n\tif ( typeof value !== 'string' || value === '' ) {\n\t\treturn undefined;\n\t}\n\n\tconst trimmed = value.trim();\n\tif ( trimmed === '' || trimmed.includes( ',' ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn trimmed;\n};\n\nconst getFirstQueryValue = ( value: unknown ): string | undefined => {\n\tif ( Array.isArray( value ) ) {\n\t\treturn getFirstQueryValue( value[ 0 ] );\n\t}\n\n\tif ( typeof value !== 'string' || value === '' ) {\n\t\treturn undefined;\n\t}\n\n\treturn value.split( ',' )[ 0 ] || undefined;\n};\n\nconst buildFiltersFromQuery = (\n\tquery: Record< string, unknown >\n): Filter[] => {\n\tconst filters: Filter[] = [];\n\tconst dateFilter = parseFeesDateFilterFromQuery( query );\n\n\tif ( dateFilter ) {\n\t\tfilters.push( dateFilter );\n\t}\n\n\tif ( query.payment_method_type ) {\n\t\tfilters.push( {\n\t\t\tfield: 'payment_method',\n\t\t\toperator: 'is',\n\t\t\tvalue: query.payment_method_type as string,\n\t\t} );\n\t}\n\n\tif ( query.type ) {\n\t\tconst value = getSingleQueryValue( query.type );\n\t\tif ( ! value ) {\n\t\t\treturn filters;\n\t\t}\n\t\tfilters.push( {\n\t\t\tfield: 'type',\n\t\t\toperator: 'is',\n\t\t\tvalue,\n\t\t} );\n\t}\n\n\treturn filters;\n};\n\n/**\n * Translate active filters into a URL-query patch that clears stale filter\n * keys (sets them to `undefined`) and writes only the keys that are currently\n * active. Always returns the full filter-query object — every key not set by\n * an active filter is explicitly `undefined` so `updateQueryString` removes it.\n */\nconst buildFilterQueryParams = (\n\tfilters: Filter[]\n): Record< string, unknown > => {\n\tconst params: Record< string, unknown > = {\n\t\tdate_preset: undefined,\n\t\tdate_between: undefined,\n\t\tdate_before: undefined,\n\t\tdate_after: undefined,\n\t\tpayment_method_type: undefined,\n\t\ttype: undefined,\n\t};\n\n\tfor ( const filter of filters ) {\n\t\tif ( filter.field === 'date' ) {\n\t\t\tObject.assign( params, serializeFeesDateFilterToQuery( filter ) );\n\t\t} else if ( filter.field === 'payment_method' ) {\n\t\t\tparams.payment_method_type = filter.value;\n\t\t} else if ( filter.field === 'type' ) {\n\t\t\tparams.type = getSingleQueryValue( filter.value );\n\t\t}\n\t}\n\n\treturn params;\n};\n\nconst buildUrlQueryParams = ( view: View ): Record< string, unknown > => ( {\n\torderby: view.sort?.field,\n\torder: view.sort?.direction,\n\tpaged: view.page ? String( view.page ) : undefined,\n\tper_page: view.perPage ? String( view.perPage ) : undefined,\n\tsearch: view.search ? [ view.search ] : undefined,\n\t...buildFilterQueryParams( view.filters ?? [] ),\n} );\n\n// Strip the params that are debounced or auto-reset by a search transition,\n// so the \"do non-search params differ?\" comparison upstream isn't fooled by\n// the search field flush or its page=1 side effect.\nconst withoutTransientParams = (\n\tparams: Record< string, unknown >,\n\tdropPagedReset = false\n): Record< string, unknown > => {\n\tconst rest = { ...params };\n\tdelete rest.search;\n\tif ( dropPagedReset ) {\n\t\tdelete rest.paged;\n\t}\n\treturn rest;\n};\n\nconst areQueryParamsEqual = (\n\ta: Record< string, unknown >,\n\tb: Record< string, unknown >\n): boolean => JSON.stringify( a ) === JSON.stringify( b );\n\ninterface UseFeesUrlSyncResult {\n\tderivedView: View;\n\tsyncViewToUrl: ( current: View, next: View ) => void;\n\turlVersion: number;\n}\n\nexport const useFeesUrlSync = (\n\tpersisted: PersistedFeesView | undefined\n): UseFeesUrlSyncResult => {\n\tconst [ navTick, setNavTick ] = useState( 0 );\n\tconst bumpNavTick = useCallback( () => setNavTick( ( t ) => t + 1 ), [] );\n\tuseEffect( () => {\n\t\twindow.addEventListener( 'popstate', bumpNavTick );\n\t\treturn () => window.removeEventListener( 'popstate', bumpNavTick );\n\t}, [ bumpNavTick ] );\n\n\tconst derivedView: View = useMemo< ViewTable >( () => {\n\t\tconst query = getQuery() as Record< string, unknown >;\n\t\tconst defaultView = getDefaultFeesView() as ViewTable;\n\t\treturn {\n\t\t\t...defaultView,\n\t\t\tfields: getFeesTableFields(\n\t\t\t\tpersisted?.fields ?? defaultView.fields\n\t\t\t),\n\t\t\tperPage: parseIntOr(\n\t\t\t\tquery.per_page,\n\t\t\t\tpersisted?.perPage ?? defaultPerPage\n\t\t\t),\n\t\t\tpage: parseIntOr( query.paged, 1 ),\n\t\t\tsort: {\n\t\t\t\tfield: ( query.orderby as string ) ?? 'date',\n\t\t\t\tdirection:\n\t\t\t\t\t( query.order as 'asc' | 'desc' ) ??\n\t\t\t\t\tdefaultView.sort?.direction ??\n\t\t\t\t\t'desc',\n\t\t\t},\n\t\t\tsearch: getFirstQueryValue( query.search ) ?? '',\n\t\t\tfilters: buildFiltersFromQuery( query ),\n\t\t\tlayout: getFeesTableLayout(\n\t\t\t\tpersisted?.layout ?? defaultView.layout\n\t\t\t),\n\t\t};\n\t\t// navTick forces re-derive when the URL changes externally (popstate).\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ persisted, navTick ] );\n\n\tconst searchDebounceTimerRef = useRef< ReturnType<\n\t\ttypeof setTimeout\n\t> | null >( null );\n\tconst clearPendingSearchUpdate = useCallback( () => {\n\t\tif ( searchDebounceTimerRef.current ) {\n\t\t\tclearTimeout( searchDebounceTimerRef.current );\n\t\t\tsearchDebounceTimerRef.current = null;\n\t\t}\n\t}, [] );\n\tuseEffect( () => clearPendingSearchUpdate, [ clearPendingSearchUpdate ] );\n\n\tconst syncViewToUrl = useCallback(\n\t\t( current: View, next: View ) => {\n\t\t\tconst currentQueryParams = buildUrlQueryParams( current );\n\t\t\tconst nextQueryParams = buildUrlQueryParams( next );\n\t\t\tconst hasSearchChange = ! areQueryParamsEqual(\n\t\t\t\t{ search: currentQueryParams.search },\n\t\t\t\t{ search: nextQueryParams.search }\n\t\t\t);\n\t\t\tconst isSearchPageReset =\n\t\t\t\thasSearchChange && nextQueryParams.paged === '1';\n\t\t\tconst hasImmediateUrlChange = ! areQueryParamsEqual(\n\t\t\t\twithoutTransientParams( currentQueryParams, isSearchPageReset ),\n\t\t\t\twithoutTransientParams( nextQueryParams, isSearchPageReset )\n\t\t\t);\n\n\t\t\tclearPendingSearchUpdate();\n\t\t\tif ( hasImmediateUrlChange ) {\n\t\t\t\tupdateQueryString( nextQueryParams, reportsPath );\n\t\t\t} else if ( hasSearchChange ) {\n\t\t\t\tsearchDebounceTimerRef.current = setTimeout( () => {\n\t\t\t\t\tupdateQueryString( nextQueryParams, reportsPath );\n\t\t\t\t\tsearchDebounceTimerRef.current = null;\n\t\t\t\t}, searchDebounceMs );\n\t\t\t}\n\t\t},\n\t\t[ clearPendingSearchUpdate ]\n\t);\n\n\treturn { derivedView, syncViewToUrl, urlVersion: navTick };\n};\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { useCallback, useEffect, useRef } from 'react';\nimport { useUserPreferences } from '@woocommerce/data';\nimport type { View, ViewTable } from '@wordpress/dataviews/wp';\n\n/**\n * Internal dependencies\n */\nimport {\n\tfeesViewUserMetaKey,\n\tgetFeesTableFields,\n\tPersistedFeesView,\n} from './view';\n\nconst persistDebounceMs = 750;\n\nconst isPersistedShapeEqual = (\n\ta: PersistedFeesView | undefined,\n\tb: PersistedFeesView\n): boolean => a !== undefined && JSON.stringify( a ) === JSON.stringify( b );\n\nconst normalizePersistedFeesView = (\n\tpersisted: PersistedFeesView | null | undefined\n): PersistedFeesView | undefined => {\n\tif ( ! persisted ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...persisted,\n\t\tfields: getFeesTableFields( persisted.fields ),\n\t};\n};\n\ninterface UseFeesUserPrefsResult {\n\tpersisted: PersistedFeesView | undefined;\n\thasLoadedPersisted: boolean;\n\tpersistViewShape: ( next: View ) => void;\n}\n\nexport const useFeesUserPrefs = (): UseFeesUserPrefsResult => {\n\tconst { updateUserPreferences, ...userPrefs } = useUserPreferences();\n\tconst prefs = userPrefs as unknown as Record< string, unknown >;\n\tconst rawPersisted = prefs[ feesViewUserMetaKey ] as\n\t\t| PersistedFeesView\n\t\t| null\n\t\t| undefined;\n\tconst persisted = normalizePersistedFeesView( rawPersisted );\n\t// `undefined` means user_meta hasn't loaded yet; `null`-ish empty string is\n\t// what wp-data returns once the resolver finishes with no stored value.\n\tconst hasLoadedPersisted = feesViewUserMetaKey in prefs;\n\n\tconst persistDebounceTimerRef = useRef< ReturnType<\n\t\ttypeof setTimeout\n\t> | null >( null );\n\tconst clearPendingPersistUpdate = useCallback( () => {\n\t\tif ( persistDebounceTimerRef.current ) {\n\t\t\tclearTimeout( persistDebounceTimerRef.current );\n\t\t\tpersistDebounceTimerRef.current = null;\n\t\t}\n\t}, [] );\n\tuseEffect( () => clearPendingPersistUpdate, [ clearPendingPersistUpdate ] );\n\n\tconst persistViewShape = useCallback(\n\t\t( next: View ) => {\n\t\t\tconst nextPersisted: PersistedFeesView = {\n\t\t\t\tfields: getFeesTableFields( next.fields ),\n\t\t\t\tperPage: next.perPage,\n\t\t\t\tlayout: ( next as ViewTable ).layout,\n\t\t\t};\n\n\t\t\t// Skip the write until user_meta has actually loaded; otherwise\n\t\t\t// the first interaction on a fresh page write the default shape\n\t\t\t// over whatever the user previously stored.\n\t\t\tif (\n\t\t\t\t! hasLoadedPersisted ||\n\t\t\t\tisPersistedShapeEqual( persisted, nextPersisted )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Debounce: a burst of view changes (e.g. toggling several columns\n\t\t\t// or rapidly changing perPage) collapses into a single REST write\n\t\t\t// of the final shape.\n\t\t\tclearPendingPersistUpdate();\n\t\t\tpersistDebounceTimerRef.current = setTimeout( () => {\n\t\t\t\tupdateUserPreferences( {\n\t\t\t\t\t[ feesViewUserMetaKey ]: nextPersisted,\n\t\t\t\t} );\n\t\t\t\tpersistDebounceTimerRef.current = null;\n\t\t\t}, persistDebounceMs );\n\t\t},\n\t\t[\n\t\t\tclearPendingPersistUpdate,\n\t\t\thasLoadedPersisted,\n\t\t\tpersisted,\n\t\t\tupdateUserPreferences,\n\t\t]\n\t);\n\n\treturn { persisted, hasLoadedPersisted, persistViewShape };\n};\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport type { Filter, View } from '@wordpress/dataviews/wp';\nimport { recordEvent } from 'tracks';\n\n/**\n * Internal dependencies\n */\nimport { matchPreset } from 'wcpay/reports/date-filter/presets';\nimport { useFeesUrlSync } from './use-fees-url-sync';\nimport { useFeesUserPrefs } from './use-fees-user-prefs';\nimport {\n\tgetFeesDateFilterRangeDays,\n\tgetFeesDateFilterValue,\n} from './date-filter-values';\n\nconst searchTrackingDebounceMs = 500;\n\nconst getTrackedFilterField = ( field: string ): string =>\n\tfield === 'payment_method' ? 'payment_method_type' : field;\n\nconst dateFilterField = 'date';\n\nconst findFilterByField = (\n\tfilters: Filter[] | undefined,\n\tfield: string\n): Filter | undefined => filters?.find( ( filter ) => filter.field === field );\n\nconst stringifyFilterValue = ( value: unknown ): string | undefined => {\n\ttry {\n\t\treturn JSON.stringify( value );\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\nconst areFilterValuesEqual = ( previous: unknown, next: unknown ): boolean => {\n\tif ( previous === next ) {\n\t\treturn true;\n\t}\n\n\tconst previousValue = stringifyFilterValue( previous );\n\tconst nextValue = stringifyFilterValue( next );\n\treturn previousValue !== undefined && previousValue === nextValue;\n};\n\nconst getTrackableFilterField = ( filter: Filter ): string | undefined => {\n\tif ( filter.field === 'date' ) {\n\t\treturn undefined;\n\t}\n\n\tif (\n\t\tfilter.field === 'payment_method' &&\n\t\ttypeof filter.value === 'string' &&\n\t\tfilter.value.trim() !== ''\n\t) {\n\t\treturn getTrackedFilterField( filter.field );\n\t}\n\n\tif ( filter.field === 'type' && typeof filter.value === 'string' ) {\n\t\tconst value = filter.value.trim();\n\t\tif ( value !== '' && ! value.includes( ',' ) ) {\n\t\t\treturn getTrackedFilterField( filter.field );\n\t\t}\n\t}\n\n\treturn undefined;\n};\n\ninterface SearchTrackingControls {\n\tclearPendingSearchTracking: () => void;\n\tscheduleSearchTracking: ( search: string ) => void;\n}\n\ntype SetFeesViewOptions = {\n\tdateFilterNow?: Date;\n};\n\ntype SetFeesView = ( next: View, options?: SetFeesViewOptions ) => void;\n\nconst trackViewChange = (\n\tprevious: View,\n\tnext: View,\n\t{\n\t\tclearPendingSearchTracking,\n\t\tscheduleSearchTracking,\n\t}: SearchTrackingControls,\n\tnow: Date\n): void => {\n\tconst previousSearch = previous.search ?? '';\n\tconst nextSearch = next.search ?? '';\n\tif ( nextSearch !== previousSearch ) {\n\t\tclearPendingSearchTracking();\n\t\tif ( nextSearch ) {\n\t\t\tscheduleSearchTracking( nextSearch );\n\t\t}\n\t}\n\n\tconst previousDateFilter = findFilterByField(\n\t\tprevious.filters,\n\t\tdateFilterField\n\t);\n\tconst nextDateFilter = findFilterByField( next.filters, dateFilterField );\n\tconst previousDateValue = getFeesDateFilterValue( previousDateFilter );\n\tconst nextDateValue = getFeesDateFilterValue( nextDateFilter );\n\tif ( previousDateValue && ! nextDateValue ) {\n\t\trecordEvent( 'wcpay_reports_fees_date_filter_change', {\n\t\t\tpreset: 'reset',\n\t\t\trange_days: null,\n\t\t\tis_initial_apply: false,\n\t\t} );\n\t} else if (\n\t\tnextDateValue &&\n\t\t! areFilterValuesEqual( previousDateValue, nextDateValue )\n\t) {\n\t\trecordEvent( 'wcpay_reports_fees_date_filter_change', {\n\t\t\tpreset: matchPreset( nextDateValue, now ),\n\t\t\trange_days: getFeesDateFilterRangeDays( nextDateFilter ),\n\t\t\tis_initial_apply: ! previousDateValue,\n\t\t} );\n\t}\n\n\t( next.filters ?? [] ).forEach( ( filter ) => {\n\t\tconst filterField = getTrackableFilterField( filter );\n\t\tif ( ! filterField ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst previousFilter = findFilterByField(\n\t\t\tprevious.filters,\n\t\t\tfilter.field\n\t\t);\n\t\tif ( areFilterValuesEqual( previousFilter?.value, filter.value ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\trecordEvent( 'wcpay_reports_fees_filter_change', {\n\t\t\tfilter_field: filterField,\n\t\t\thad_previous_value: previousFilter?.value !== undefined,\n\t\t} );\n\t} );\n};\n\n/**\n * Hook that owns the Fees report's DataViews `view`, bidirectionally synced\n * with the URL (sort, page, search, filters) and `user_meta` (fields, layout,\n * perPage). Returns the current view and a setter.\n */\nexport const useFeesView = ( dateFilterNow?: Date ): [ View, SetFeesView ] => {\n\tconst { persisted, hasLoadedPersisted, persistViewShape } =\n\t\tuseFeesUserPrefs();\n\tconst { derivedView, syncViewToUrl, urlVersion } =\n\t\tuseFeesUrlSync( persisted );\n\tconst searchTrackingTimerRef = useRef< ReturnType<\n\t\ttypeof setTimeout\n\t> | null >( null );\n\tconst stableDateFilterNow = useRef( dateFilterNow ?? new Date() ).current;\n\tconst clearPendingSearchTracking = useCallback( () => {\n\t\tif ( searchTrackingTimerRef.current ) {\n\t\t\tclearTimeout( searchTrackingTimerRef.current );\n\t\t\tsearchTrackingTimerRef.current = null;\n\t\t}\n\t}, [] );\n\tconst scheduleSearchTracking = useCallback( ( search: string ) => {\n\t\tsearchTrackingTimerRef.current = setTimeout( () => {\n\t\t\trecordEvent( 'wcpay_reports_fees_search', {\n\t\t\t\tsearch_length: search.length,\n\t\t\t} );\n\t\t\tsearchTrackingTimerRef.current = null;\n\t\t}, searchTrackingDebounceMs );\n\t}, [] );\n\n\tuseEffect(\n\t\t() => () => clearPendingSearchTracking(),\n\t\t[ clearPendingSearchTracking ]\n\t);\n\n\t// Hold the view in local React state so DataViews can stage in-progress\n\t// filters (a method/type filter is added before its value is picked — the\n\t// chip needs to live on the page long enough for the user to pick a value\n\t// from the popover). The URL is the source of truth for applied filters,\n\t// but it can't represent a value-less filter chip, so URL-only derivation\n\t// would erase the chip on the very next render.\n\tconst [ localView, setLocalView ] = useState< View >( derivedView );\n\n\t// Re-seed local state only on external URL navigation or the first time\n\t// persisted user_meta loads. Own setView writes can update user_meta, which\n\t// changes the derived view identity, but that must not erase staged chips.\n\tconst lastUrlVersionRef = useRef( urlVersion );\n\tconst wasLoadedRef = useRef( hasLoadedPersisted );\n\tuseEffect( () => {\n\t\tconst urlChanged = lastUrlVersionRef.current !== urlVersion;\n\t\tconst justLoaded = ! wasLoadedRef.current && hasLoadedPersisted;\n\n\t\tlastUrlVersionRef.current = urlVersion;\n\t\twasLoadedRef.current = hasLoadedPersisted;\n\n\t\tif ( urlChanged || justLoaded ) {\n\t\t\tsetLocalView( derivedView );\n\t\t}\n\t}, [ urlVersion, hasLoadedPersisted, derivedView ] );\n\n\tconst setView = useCallback(\n\t\t( next: View, options?: SetFeesViewOptions ) => {\n\t\t\ttrackViewChange(\n\t\t\t\tlocalView,\n\t\t\t\tnext,\n\t\t\t\t{\n\t\t\t\t\tclearPendingSearchTracking,\n\t\t\t\t\tscheduleSearchTracking,\n\t\t\t\t},\n\t\t\t\toptions?.dateFilterNow ?? stableDateFilterNow\n\t\t\t);\n\t\t\tsetLocalView( next );\n\t\t\tsyncViewToUrl( localView, next );\n\t\t\tpersistViewShape( next );\n\t\t},\n\t\t[\n\t\t\tclearPendingSearchTracking,\n\t\t\tlocalView,\n\t\t\tpersistViewShape,\n\t\t\tscheduleSearchTracking,\n\t\t\tstableDateFilterNow,\n\t\t\tsyncViewToUrl,\n\t\t]\n\t);\n\n\treturn [ localView, setView ];\n};\n","/** @format */\n\n/**\n * Internal dependencies\n */\nimport { displayType as transactionDisplayType } from 'wcpay/transactions/strings';\nimport { getTransactionPaymentMethodTitle } from 'wcpay/transactions/utils/getTransactionPaymentMethodTitle';\n\nexport const displayType = {\n\tcharge: transactionDisplayType.charge,\n\tpayment: transactionDisplayType.payment,\n\tpayment_failure_refund: transactionDisplayType.payment_failure_refund,\n\tpayment_refund: transactionDisplayType.payment_refund,\n\trefund: transactionDisplayType.refund,\n\trefund_failure: transactionDisplayType.refund_failure,\n\tdispute: transactionDisplayType.dispute,\n\tdispute_reversal: transactionDisplayType.dispute_reversal,\n\tfee_refund: transactionDisplayType.fee_refund,\n\tnetwork_costs: transactionDisplayType.network_costs,\n};\n\nexport const displayMethod = ( paymentMethodType?: string ): string =>\n\tpaymentMethodType\n\t\t? getTransactionPaymentMethodTitle( paymentMethodType )\n\t\t: '';\n","/** @format */\n\n/**\n * External dependencies\n */\nimport { useMemo } from 'react';\nimport type { View, Filter } from '@wordpress/dataviews/wp';\n\n/**\n * Internal dependencies\n */\nimport { useReportsFees, useReportsFeesSummary } from 'wcpay/data/reports';\nimport type { ReportsFee } from 'wcpay/data/reports/hooks';\nimport { formatStringValue } from 'wcpay/utils';\nimport { displayMethod, displayType } from './strings';\nimport { buildFeesDateQueryFromFilter } from './date-filter-values';\n\n// Default fee-bearing transaction types, mirroring DEFAULT_FEE_BEARING_TYPES in\n// the PHP controller. The summary endpoint exposes `sources` (payment methods\n// seen in the active range) but not `types`, so we hard-code them here. DataViews\n// won't show a field in the \"Add filter\" menu unless `elements` is non-empty.\nconst feeBearingTypes: ReadonlyArray< string > = [\n\t'charge',\n\t'payment',\n\t'payment_failure_refund',\n\t'payment_refund',\n\t'refund',\n\t'refund_failure',\n\t'dispute',\n\t'dispute_reversal',\n\t'fee_refund',\n\t'network_costs',\n];\n\ninterface FeesQuery {\n\tpaged?: string;\n\tper_page?: string;\n\torderby?: string;\n\torder?: 'asc' | 'desc';\n\tdate_before?: string;\n\tdate_after?: string;\n\tdate_between?: string[];\n\tpayment_method_type?: string;\n\ttype?: string;\n\tsearch?: string[];\n}\n\nconst findFilter = (\n\tfilters: Filter[] | undefined,\n\tfield: string\n): Filter | undefined => filters?.find( ( f ) => f.field === field );\n\n// DataViews column ids that differ from the backend `sort_field` enum\n// (validated against `Transaction::$fields` server-side). Unmapped ids pass\n// through unchanged — they already match the backend column name.\nconst sortFieldByColumnId: Record< string, string > = {\n\tpayment_method: 'source',\n\ttransaction_currency: 'customer_currency',\n\tdeposit_date: 'available_on',\n};\n\nconst resolveSortField = ( columnId: string | undefined ): string => {\n\tif ( ! columnId ) {\n\t\treturn 'date';\n\t}\n\treturn sortFieldByColumnId[ columnId ] ?? columnId;\n};\n\nconst getSingleStringValue = ( value: unknown ): string | undefined => {\n\tif ( typeof value !== 'string' ) {\n\t\treturn undefined;\n\t}\n\n\tconst trimmed = value.trim();\n\tif ( trimmed === '' || trimmed.includes( ',' ) ) {\n\t\treturn undefined;\n\t}\n\n\treturn trimmed;\n};\n\n/**\n * Build a REST query for the Fees endpoint from the DataViews `view`. When no\n * date filter is active the query carries no date bounds, so the endpoint\n * returns all available fees.\n *\n * NOTE: The previous TableCard implementation accepted `order_id` and\n * `deposit_id` filter params, which the PHP controller still honours. They\n * are intentionally not surfaced from the DataViews UI in this PR; a\n * follow-up will add purpose-built filter chips for them.\n *\n */\nexport const buildFeesQuery = ( view: View ): FeesQuery => {\n\tconst query: FeesQuery = {\n\t\tpaged: String( view.page ?? 1 ),\n\t\tper_page: String( view.perPage ?? 25 ),\n\t\torderby: resolveSortField( view.sort?.field ),\n\t\torder: ( view.sort?.direction as 'asc' | 'desc' ) || 'desc',\n\t};\n\n\tObject.assign(\n\t\tquery,\n\t\tbuildFeesDateQueryFromFilter( findFilter( view.filters, 'date' ) )\n\t);\n\n\tconst methodFilter = findFilter( view.filters, 'payment_method' );\n\tif ( methodFilter && methodFilter.value ) {\n\t\tquery.payment_method_type = methodFilter.value as string;\n\t}\n\n\tconst typeFilter = findFilter( view.filters, 'type' );\n\tif ( typeFilter && typeFilter.value ) {\n\t\tconst value = getSingleStringValue( typeFilter.value );\n\t\tif ( value ) {\n\t\t\tquery.type = value;\n\t\t}\n\t}\n\n\tif ( view.search ) {\n\t\tquery.search = [ view.search ];\n\t}\n\n\treturn query;\n};\n\ninterface UseFeesDataResult {\n\trows: ReportsFee[];\n\ttotalItems: number;\n\ttotalPages: number;\n\tmethodElements: Array< { value: string; label: string } >;\n\ttypeElements: Array< { value: string; label: string } >;\n\tisLoading: boolean;\n\terror: Record< string, unknown >;\n}\n\nconst buildMethodElements = (\n\tsources: Array< string | null >\n): Array< { value: string; label: string } > =>\n\tsources\n\t\t.filter( ( source ): source is string => Boolean( source ) )\n\t\t.map( ( source ) => ( {\n\t\t\tvalue: source,\n\t\t\tlabel: displayMethod( source ) || source,\n\t\t} ) );\n\nconst buildTypeElements = (\n\ttypes: Array< string | null >\n): Array< { value: string; label: string } > =>\n\ttypes\n\t\t.filter( ( type ): type is string => Boolean( type ) )\n\t\t.map( ( type ) => ( {\n\t\t\tvalue: type,\n\t\t\tlabel:\n\t\t\t\tdisplayType[ type as keyof typeof displayType ] ||\n\t\t\t\tformatStringValue( type ),\n\t\t} ) );\n\nexport const useFeesData = ( view: View ): UseFeesDataResult => {\n\tconst feesQuery = useMemo( () => buildFeesQuery( view ), [ view ] );\n\t// Summary aggregates (count, total, fees, sources, types) don't change\n\t// with pagination or sort, so derive a stable summary query that omits\n\t// those params. Without this, paging or re-sorting would invalidate\n\t// the summary cache and trigger an unnecessary refetch.\n\tconst summaryQuery = useMemo( () => {\n\t\tconst next: FeesQuery = { ...feesQuery };\n\t\tdelete next.paged;\n\t\tdelete next.per_page;\n\t\tdelete next.orderby;\n\t\tdelete next.order;\n\t\treturn next;\n\t}, [ feesQuery ] );\n\tconst { feesRows, feesError = {}, isLoading } = useReportsFees( feesQuery );\n\tconst {\n\t\tfeesSummary,\n\t\tfeesSummaryError = {},\n\t\tisLoading: isSummaryLoading,\n\t} = useReportsFeesSummary( summaryQuery );\n\n\tconst totalItems = feesSummary.count ?? 0;\n\tconst perPage = parseInt( feesQuery.per_page ?? '25', 10 );\n\tconst totalPages = Math.max( 1, Math.ceil( totalItems / perPage ) );\n\n\tconst sources = feesSummary.sources ?? [];\n\t// The summary endpoint returns `sources` filtered by the active query, so\n\t// when the user picks a method (or reloads with a method already in the\n\t// URL) `sources` collapses to just that method — or to an empty list when\n\t// the filter narrows results to zero rows. DataViews' `FilterText` resolves\n\t// the chip label by matching `element.value === filterInView.value`, and\n\t// falls back to bare \"Method\" when no element matches. To keep the chip\n\t// stable across fetches, we ensure the currently-active filter value is\n\t// always present with a derived label, regardless of what summary returns.\n\tconst activeMethodValue = useMemo( () => {\n\t\tconst f = view.filters?.find(\n\t\t\t( filter ) => filter.field === 'payment_method'\n\t\t);\n\t\treturn typeof f?.value === 'string' ? f.value : undefined;\n\t}, [ view.filters ] );\n\tconst methodElements = useMemo(\n\t\t() => {\n\t\t\tconst fromSources = buildMethodElements( sources );\n\t\t\tif (\n\t\t\t\tactiveMethodValue &&\n\t\t\t\t! fromSources.some( ( el ) => el.value === activeMethodValue )\n\t\t\t) {\n\t\t\t\tfromSources.push( {\n\t\t\t\t\tvalue: activeMethodValue,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\tdisplayMethod( activeMethodValue ) || activeMethodValue,\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn fromSources;\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[ sources.join( '|' ), activeMethodValue ]\n\t);\n\tconst typeElements = useMemo(\n\t\t() => buildTypeElements( [ ...feeBearingTypes ] ),\n\t\t[]\n\t);\n\treturn {\n\t\trows: feesRows,\n\t\ttotalItems,\n\t\ttotalPages,\n\t\tmethodElements,\n\t\ttypeElements,\n\t\tisLoading: isLoading || isSummaryLoading,\n\t\terror: {\n\t\t\t...feesSummaryError,\n\t\t\t...feesError,\n\t\t},\n\t};\n};\n","/** @format */\n\n/**\n * External dependencies\n */\nimport React from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { Link } from '@woocommerce/components';\nimport type { Field } from '@wordpress/dataviews/wp';\n\n/**\n * Internal dependencies\n */\nimport type { ReportsFee } from 'wcpay/data/reports/hooks';\nimport { getDetailsURL } from 'wcpay/components/details-link';\nimport { formatDateTimeFromString } from 'wcpay/utils/date-time';\nimport { formatStringValue, getAdminUrl } from 'wcpay/utils';\nimport { formatExplicitCurrency } from 'multi-currency/interface/functions';\nimport { displayMethod, displayType } from './strings';\n\nconst EMPTY = '–';\n\ninterface FilterElement {\n\tvalue: string;\n\tlabel: string;\n}\n\ninterface GetFeesFieldsArgs {\n\tmethodElements: FilterElement[];\n\ttypeElements: FilterElement[];\n}\n\nconst getTransactionURL = ( row: ReportsFee ): string => {\n\tconst detailsURL = getDetailsURL(\n\t\trow.payment_id || row.transaction_id,\n\t\t'transactions'\n\t);\n\treturn `${ detailsURL }&transaction_id=${ row.transaction_id }&transaction_type=${ row.type }`;\n};\n\nconst getOrderURL = ( orderId: ReportsFee[ 'order_id' ] ): string =>\n\tgetAdminUrl( {\n\t\tpage: 'wc-orders',\n\t\taction: 'edit',\n\t\tid: orderId ?? '',\n\t} );\n\nexport const getFeesFields = ( {\n\tmethodElements,\n\ttypeElements,\n}: GetFeesFieldsArgs ): Field< ReportsFee >[] =>\n\t[\n\t\t{\n\t\t\tid: 'date',\n\t\t\tlabel: __( 'Date', 'woocommerce-payments' ),\n\t\t\theader: __( 'Date & time', 'woocommerce-payments' ),\n\t\t\ttype: 'date',\n\t\t\tenableSorting: true,\n\t\t\tenableGlobalSearch: false,\n\t\t\t// `between` leads so DataViews defaults a newly added date filter to\n\t\t\t// it (operators[0]); its range presets avoid the confusing\n\t\t\t// single-date \"Past week / Past month\" anchors (see WOOPMNT-6243).\n\t\t\tfilterBy: { operators: [ 'between', 'on', 'before', 'after' ] },\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) => item.date,\n\t\t\trender: ( { item }: { item: ReportsFee } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ formatDateTimeFromString( item.date, {\n\t\t\t\t\t\tincludeTime: true,\n\t\t\t\t\t} ) }\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tid: 'payment_method',\n\t\t\tlabel: __( 'Method', 'woocommerce-payments' ),\n\t\t\telements: methodElements,\n\t\t\tfilterBy: { operators: [ 'is' ] },\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) =>\n\t\t\t\titem.payment_method?.type || '',\n\t\t\trender: ( { item }: { item: ReportsFee } ) => (\n\t\t\t\t<>{ displayMethod( item.payment_method?.type ) || EMPTY }</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tid: 'type',\n\t\t\tlabel: __( 'Type', 'woocommerce-payments' ),\n\t\t\telements: typeElements,\n\t\t\tfilterBy: { operators: [ 'is' ] },\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) => item.type,\n\t\t\trender: ( { item }: { item: ReportsFee } ) => {\n\t\t\t\tconst label =\n\t\t\t\t\tdisplayType[ item.type as keyof typeof displayType ] ||\n\t\t\t\t\tformatStringValue( item.type );\n\t\t\t\treturn <>{ label }</>;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tid: 'order_id',\n\t\t\tlabel: __( 'Order ID', 'woocommerce-payments' ),\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) => item.order_id ?? '',\n\t\t\trender: ( { item }: { item: ReportsFee } ) =>\n\t\t\t\titem.order_id ? (\n\t\t\t\t\t<Link href={ getOrderURL( item.order_id ) } type=\"external\">\n\t\t\t\t\t\t{ String( item.order_id ) }\n\t\t\t\t\t</Link>\n\t\t\t\t) : (\n\t\t\t\t\t<>{ EMPTY }</>\n\t\t\t\t),\n\t\t},\n\t\t// Link only cells that have a concrete details destination. Other\n\t\t// cells render plain text rather than using the old `ClickableCell`\n\t\t// wrapper, which hid anchors from the tab order with `tabIndex=\"-1\"`.\n\t\t{\n\t\t\tid: 'transaction_id',\n\t\t\tlabel: __( 'Transaction ID', 'woocommerce-payments' ),\n\t\t\tenableHiding: false,\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) => item.transaction_id,\n\t\t\trender: ( { item }: { item: ReportsFee } ) => (\n\t\t\t\t<Link href={ getTransactionURL( item ) }>\n\t\t\t\t\t{ item.transaction_id }\n\t\t\t\t</Link>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tid: 'transaction_currency',\n\t\t\tlabel: __( 'Currency', 'woocommerce-payments' ),\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) =>\n\t\t\t\t( item.transaction_currency ?? '' ).toUpperCase(),\n\t\t\trender: ( { item }: { item: ReportsFee } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ ( item.transaction_currency ?? '' ).toUpperCase() ||\n\t\t\t\t\t\tEMPTY }\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tid: 'amount',\n\t\t\tlabel: __( 'Gross amount', 'woocommerce-payments' ),\n\t\t\ttype: 'integer',\n\t\t\tenableSorting: true,\n\t\t\tfilterBy: false,\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) => item.amount,\n\t\t\trender: ( { item }: { item: ReportsFee } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ formatExplicitCurrency(\n\t\t\t\t\t\titem.amount,\n\t\t\t\t\t\titem.deposit_currency\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tid: 'fees',\n\t\t\tlabel: __( 'Fees total', 'woocommerce-payments' ),\n\t\t\ttype: 'integer',\n\t\t\tenableSorting: true,\n\t\t\tfilterBy: false,\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) => item.fees,\n\t\t\trender: ( { item }: { item: ReportsFee } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ formatExplicitCurrency(\n\t\t\t\t\t\titem.fees,\n\t\t\t\t\t\titem.deposit_currency\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tid: 'deposit_date',\n\t\t\tlabel: __( 'Settlement date', 'woocommerce-payments' ),\n\t\t\ttype: 'datetime',\n\t\t\tfilterBy: false,\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) =>\n\t\t\t\titem.deposit_date ?? '',\n\t\t\trender: ( { item }: { item: ReportsFee } ) => (\n\t\t\t\t<>\n\t\t\t\t\t{ item.deposit_date\n\t\t\t\t\t\t? formatDateTimeFromString( item.deposit_date )\n\t\t\t\t\t\t: EMPTY }\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tid: 'deposit_id',\n\t\t\tlabel: __( 'Payout ID', 'woocommerce-payments' ),\n\t\t\tgetValue: ( { item }: { item: ReportsFee } ) =>\n\t\t\t\titem.deposit_id ?? '',\n\t\t\trender: ( { item }: { item: ReportsFee } ) =>\n\t\t\t\titem.deposit_id ? (\n\t\t\t\t\t<Link href={ getDetailsURL( item.deposit_id, 'payouts' ) }>\n\t\t\t\t\t\t{ item.deposit_id }\n\t\t\t\t\t</Link>\n\t\t\t\t) : (\n\t\t\t\t\t<>{ EMPTY }</>\n\t\t\t\t),\n\t\t},\n\t] as Field< ReportsFee >[];\n","/** @format */\n\n/**\n * External dependencies\n */\nimport React, { useCallback, useEffect, useId, useMemo, useRef } from 'react';\nimport { Button, Spinner } from '@wordpress/components';\nimport { calendar } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { speak } from '@wordpress/a11y';\nimport { DataViews, type Filter, type View } from '@wordpress/dataviews/wp';\nimport { recordEvent } from 'tracks';\n\n/**\n * Internal dependencies\n */\nimport { useFeesView } from './use-fees-view';\nimport { useFeesData } from './use-fees-data';\nimport { getFeesFields } from './fields';\nimport {\n\tgetFeesDateFilterRangeDays,\n\tgetFeesDateFilterValue,\n} from './date-filter-values';\nimport { ReportState } from '../report-state';\nimport type { DateFilterValue } from 'wcpay/reports/date-filter';\nimport { DataViewsDateRangePresetPortal } from 'wcpay/reports/date-filter/dataviews-date-range-preset-portal';\nimport './style.scss';\n\ninterface FeesReportProps {\n\tonReload?: () => void;\n}\n\nconst findDateFilter = ( filters: Filter[] = [] ): Filter | undefined =>\n\tfilters.find( ( filter ) => filter.field === 'date' );\n\nconst getDateRangeDays = ( view: View ): number | null =>\n\tgetFeesDateFilterRangeDays( findDateFilter( view.filters ) );\n\nconst replaceDateFilter = (\n\tfilters: Filter[] | undefined,\n\tdateValue: DateFilterValue\n): Filter[] => {\n\tconst nextDateFilter: Filter = {\n\t\tfield: 'date',\n\t\toperator: dateValue.operator,\n\t\tvalue: dateValue.value,\n\t};\n\tconst existingFilters = filters ?? [];\n\tconst dateFilterIndex = existingFilters.findIndex(\n\t\t( filter ) => filter.field === 'date'\n\t);\n\n\tif ( dateFilterIndex === -1 ) {\n\t\treturn [ nextDateFilter, ...existingFilters ];\n\t}\n\n\treturn existingFilters.map( ( filter, index ) =>\n\t\tindex === dateFilterIndex ? nextDateFilter : filter\n\t);\n};\n\n// DataViews.Footer is callable in the runtime version used here, but upstream\n// types do not expose a callable compound component shape yet.\nconst DataViewsFooter = DataViews.Footer as () => JSX.Element | null;\n\nexport const FeesReport = ( {\n\tonReload = () => undefined,\n}: FeesReportProps ): JSX.Element => {\n\t// The report feedback survey is intentionally Balance-only.\n\tconst rootRef = useRef< HTMLDivElement >( null );\n\tconst stableDateFilterNow = useRef( new Date() ).current;\n\tconst [ view, setView ] = useFeesView( stableDateFilterNow );\n\tconst initialEmptyHeadingId = useId();\n\tconst initialEmptyDescriptionId = useId();\n\tconst filteredEmptyHeadingId = useId();\n\tconst filteredEmptyDescriptionId = useId();\n\tconst {\n\t\trows,\n\t\ttotalItems,\n\t\ttotalPages,\n\t\tmethodElements,\n\t\ttypeElements,\n\t\tisLoading,\n\t\terror,\n\t} = useFeesData( view );\n\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\tgetFeesFields( {\n\t\t\t\tmethodElements,\n\t\t\t\ttypeElements,\n\t\t\t} ),\n\t\t[ methodElements, typeElements ]\n\t);\n\tconst hasError = Object.keys( error ).length > 0;\n\tconst hasFilters = ( view.filters ?? [] ).length > 0 || !! view.search;\n\tconst hasNoRows = ! isLoading && ! hasError && rows.length === 0;\n\tconst isInitialEmpty = hasNoRows && ! hasFilters;\n\tconst isFilteredEmpty = hasNoRows && hasFilters;\n\tconst rangeDays = useMemo( () => getDateRangeDays( view ), [ view ] );\n\tconst dateFilterValue = useMemo(\n\t\t() => getFeesDateFilterValue( findDateFilter( view.filters ) ),\n\t\t[ view.filters ]\n\t);\n\tconst onDatePresetChange = useCallback(\n\t\t( nextValue: DateFilterValue, referenceDate?: Date ) => {\n\t\t\tsetView(\n\t\t\t\t{\n\t\t\t\t\t...view,\n\t\t\t\t\tpage: 1,\n\t\t\t\t\tfilters: replaceDateFilter( view.filters, nextValue ),\n\t\t\t\t},\n\t\t\t\treferenceDate\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tdateFilterNow: referenceDate,\n\t\t\t\t\t }\n\t\t\t\t\t: undefined\n\t\t\t);\n\t\t},\n\t\t[ setView, view ]\n\t);\n\n\t// Move focus to the error region and announce when an error surfaces, so\n\t// keyboard/AT users notice the table disappearing. `role=\"alert\"` on the\n\t// container takes care of automatic announcement; the focus move handles\n\t// keyboard context.\n\tconst errorHeadingRef = useRef< HTMLHeadingElement >( null );\n\tconst previousErrorRef = useRef( hasError );\n\tconst previousLoadingRef = useRef( isLoading );\n\tconst previousLoadingAnnouncementRef = useRef( false );\n\tuseEffect( () => {\n\t\tconst reachedErrorTerminal =\n\t\t\thasError &&\n\t\t\t! isLoading &&\n\t\t\t( ! previousErrorRef.current || previousLoadingRef.current );\n\n\t\tif ( reachedErrorTerminal ) {\n\t\t\trecordEvent( 'wcpay_reports_fees_load_error', {\n\t\t\t\thas_filters: hasFilters,\n\t\t\t\trange_days: rangeDays,\n\t\t\t} );\n\t\t}\n\n\t\tif ( hasError && ! previousErrorRef.current ) {\n\t\t\terrorHeadingRef.current?.focus();\n\t\t}\n\n\t\tpreviousErrorRef.current = hasError;\n\t}, [ hasError, hasFilters, isLoading, rangeDays ] );\n\n\tuseEffect( () => {\n\t\tif ( isLoading && ! previousLoadingAnnouncementRef.current ) {\n\t\t\tspeak( __( 'Loading fees', 'woocommerce-payments' ), 'polite' );\n\t\t}\n\t\tpreviousLoadingAnnouncementRef.current = isLoading;\n\t}, [ isLoading ] );\n\n\t// Announce \"Fees report loaded\" to AT users on every loading→ready edge.\n\t// Debounced (500ms) and de-duplicated so rapid filter changes — which can\n\t// cause loading→ready→loading→ready bursts — collapse into a single\n\t// announcement instead of spamming AT users.\n\tconst speakTimerRef = useRef< ReturnType< typeof setTimeout > | null >(\n\t\tnull\n\t);\n\tconst lastSpokenRef = useRef< string | null >( null );\n\tuseEffect( () => {\n\t\tif ( previousLoadingRef.current && ! isLoading && ! hasError ) {\n\t\t\trecordEvent( 'wcpay_reports_fees_load_success', {\n\t\t\t\ttotal_items: totalItems,\n\t\t\t\thas_filters: hasFilters,\n\t\t\t\tis_initial_empty: isInitialEmpty,\n\t\t\t\tis_filtered_empty: isFilteredEmpty,\n\t\t\t\trange_days: rangeDays,\n\t\t\t} );\n\n\t\t\tconst message = sprintf(\n\t\t\t\t/* translators: %d: number of fees loaded into the report table. */\n\t\t\t\t__( '%d fees loaded.', 'woocommerce-payments' ),\n\t\t\t\ttotalItems\n\t\t\t);\n\t\t\tif ( speakTimerRef.current ) {\n\t\t\t\tclearTimeout( speakTimerRef.current );\n\t\t\t}\n\t\t\tspeakTimerRef.current = setTimeout( () => {\n\t\t\t\tspeakTimerRef.current = null;\n\t\t\t\tif ( lastSpokenRef.current === message ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlastSpokenRef.current = message;\n\t\t\t\tspeak( message, 'polite' );\n\t\t\t}, 500 );\n\t\t}\n\t\tpreviousLoadingRef.current = isLoading;\n\t}, [\n\t\thasError,\n\t\thasFilters,\n\t\tisFilteredEmpty,\n\t\tisInitialEmpty,\n\t\tisLoading,\n\t\trangeDays,\n\t\ttotalItems,\n\t] );\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tif ( speakTimerRef.current ) {\n\t\t\t\tclearTimeout( speakTimerRef.current );\n\t\t\t\tspeakTimerRef.current = null;\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\tif ( hasError ) {\n\t\treturn (\n\t\t\t<ReportState\n\t\t\t\ttitle={ __(\n\t\t\t\t\t'Fees report unavailable',\n\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t) }\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\"We couldn't load your fees data.\",\n\t\t\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</span>{ ' ' }\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Try again in a few minutes.',\n\t\t\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\taction={\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\trecordEvent( 'wcpay_reports_fees_reload_click', {\n\t\t\t\t\t\t\t\trange_days: rangeDays,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tonReload();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reload report', 'woocommerce-payments' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t}\n\t\t\t\ticon={ calendar }\n\t\t\t\tclassName=\"wcpay-reports-state--error wcpay-reports-state--fees-error\"\n\t\t\t\tdescriptionId=\"wcpay-reports-fees-error-description\"\n\t\t\t\theadingId=\"wcpay-reports-fees-error\"\n\t\t\t\theadingRef={ errorHeadingRef }\n\t\t\t\theadingTabIndex={ -1 }\n\t\t\t\trole=\"alert\"\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isInitialEmpty ) {\n\t\treturn (\n\t\t\t/* role=\"status\" is implicitly aria-live=\"polite\". Safe here because the\n\t\t\t empty states do not shift focus — keep this in sync if you add focus\n\t\t\t management later. */\n\t\t\t<ReportState\n\t\t\t\ttitle={ __( 'No fees yet', 'woocommerce-payments' ) }\n\t\t\t\tclassName=\"wcpay-reports-state--empty wcpay-reports-state--fees-empty\"\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Fees will appear here once you start receiving payments.',\n\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t) }\n\t\t\t\ticon={ calendar }\n\t\t\t\tdescriptionId={ initialEmptyDescriptionId }\n\t\t\t\theadingId={ initialEmptyHeadingId }\n\t\t\t\trole=\"status\"\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"wcpay-reports-fees\">\n\t\t\t<div\n\t\t\t\tref={ rootRef }\n\t\t\t\tclassName={\n\t\t\t\t\tisFilteredEmpty\n\t\t\t\t\t\t? 'wcpay-reports-fees__main wcpay-reports-fees__main--filtered-empty'\n\t\t\t\t\t\t: 'wcpay-reports-fees__main'\n\t\t\t\t}\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t<DataViewsDateRangePresetPortal\n\t\t\t\t\trootRef={ rootRef }\n\t\t\t\t\tdateValue={ dateFilterValue }\n\t\t\t\t\tdateFilterNow={ stableDateFilterNow }\n\t\t\t\t\tonDateChange={ onDatePresetChange }\n\t\t\t\t/>\n\t\t\t\t<DataViews\n\t\t\t\t\tdata={ rows }\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ setView }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tpaginationInfo={ { totalItems, totalPages } }\n\t\t\t\t\tisLoading={ isLoading }\n\t\t\t\t\tempty={\n\t\t\t\t\t\tisLoading ? (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"wcpay-reports-fees__loading-empty\"\n\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : undefined\n\t\t\t\t\t}\n\t\t\t\t\tdefaultLayouts={ { table: {} } }\n\t\t\t\t\tgetItemId={ ( item ) => item.transaction_id }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey=\"view-actions\"\n\t\t\t\t\t\tclassName=\"wcpay-reports-fees__view-actions\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<DataViews.Search\n\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t'Search fees',\n\t\t\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DataViews.FiltersToggle />\n\t\t\t\t\t\t<DataViews.ViewConfig />\n\t\t\t\t\t</div>\n\t\t\t\t\t<DataViews.FiltersToggled\n\t\t\t\t\t\tkey=\"filters-toggled\"\n\t\t\t\t\t\tclassName=\"dataviews-filters__container\"\n\t\t\t\t\t/>\n\t\t\t\t\t<DataViews.Layout key=\"layout\" />\n\t\t\t\t\t<DataViewsFooter key=\"footer\" />\n\t\t\t\t</DataViews>\n\t\t\t\t{ isFilteredEmpty && (\n\t\t\t\t\t/* role=\"status\" is implicitly aria-live=\"polite\". Safe here because the\n\t\t\t\t\t empty states do not shift focus — keep this in sync if you add focus\n\t\t\t\t\t management later. */\n\t\t\t\t\t<ReportState\n\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t'No fees to display',\n\t\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tclassName=\"wcpay-reports-state--empty wcpay-reports-state--fees-empty\"\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Fees will appear here.',\n\t\t\t\t\t\t\t'woocommerce-payments'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\ticon={ calendar }\n\t\t\t\t\t\tdescriptionId={ filteredEmptyDescriptionId }\n\t\t\t\t\t\theadingId={ filteredEmptyHeadingId }\n\t\t\t\t\t\trole=\"status\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default FeesReport;\n","/** @format */\n\n/**\n * External dependencies\n */\nimport React from 'react';\nimport { Icon } from '@wordpress/components';\n\ninterface ReportStateProps {\n\ttitle: string;\n\tdescription: React.ReactNode;\n\ticon: React.ComponentProps< typeof Icon >[ 'icon' ];\n\taction?: React.ReactNode;\n\tclassName?: string;\n\tdescriptionId?: string;\n\theadingId?: string;\n\theadingRef?: React.Ref< HTMLHeadingElement >;\n\theadingTabIndex?: number;\n\trole?: string;\n}\n\nexport const ReportState = ( {\n\ttitle,\n\tdescription,\n\ticon,\n\taction,\n\tclassName,\n\tdescriptionId,\n\theadingId,\n\theadingRef,\n\theadingTabIndex,\n\trole,\n}: ReportStateProps ): JSX.Element => (\n\t<div\n\t\tclassName={ [\n\t\t\t'wcpay-reports-state',\n\t\t\t'wcpay-reports-state--illustrated',\n\t\t\tclassName,\n\t\t]\n\t\t\t.filter( Boolean )\n\t\t\t.join( ' ' ) }\n\t\trole={ role }\n\t\taria-labelledby={ headingId }\n\t\taria-describedby={ descriptionId }\n\t>\n\t\t<span className=\"wcpay-reports-state__icon\" aria-hidden=\"true\">\n\t\t\t<Icon icon={ icon } size={ 48 } />\n\t\t</span>\n\t\t<div className=\"wcpay-reports-state__copy\">\n\t\t\t<h2\n\t\t\t\tid={ headingId }\n\t\t\t\tref={ headingRef }\n\t\t\t\ttabIndex={ headingTabIndex }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t\t<p id={ descriptionId }>{ description }</p>\n\t\t</div>\n\t\t{ action }\n\t</div>\n);\n","/** @format **/\n\n/**\n * External dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n// Mapping of transaction types to display string.\nexport const displayType = {\n\tcharge: __( 'Charge', 'woocommerce-payments' ),\n\tpayment: __( 'Payment', 'woocommerce-payments' ),\n\tpayment_failure_refund: __(\n\t\t'Payment failure refund',\n\t\t'woocommerce-payments'\n\t),\n\tpayment_refund: __( 'Payment refund', 'woocommerce-payments' ),\n\trefund: __( 'Refund', 'woocommerce-payments' ),\n\trefund_failure: __( 'Refund failure', 'woocommerce-payments' ),\n\tdispute: __( 'Dispute', 'woocommerce-payments' ),\n\tdispute_reversal: __( 'Dispute reversal', 'woocommerce-payments' ),\n\tcard_reader_fee: __( 'Reader fee', 'woocommerce-payments' ),\n\tfinancing_payout: __( 'Loan disbursement', 'woocommerce-payments' ),\n\tfinancing_paydown: __( 'Loan repayment', 'woocommerce-payments' ),\n\tfee_refund: __( 'Fee refund', 'woocommerce-payments' ),\n\tnetwork_costs: __( 'Network costs', 'woocommerce-payments' ),\n};\n\n// Mapping of transaction device type string.\nexport const sourceDevice = {\n\tandroid: __( 'Android', 'woocommerce-payments' ),\n\tios: __( 'iPhone', 'woocommerce-payments' ),\n};\n\n// Mapping of transaction channel type string.\nexport const channel = {\n\tonline: __( 'Online store', 'woocommerce-payments' ),\n\tin_person: __( 'In-Person', 'woocommerce-payments' ),\n\tin_person_pos: __( 'In-Person (POS)', 'woocommerce-payments' ),\n};\n\n// Mapping of transaction risk level string.\nexport const riskLevel = {\n\t'0': __( 'Normal', 'woocommerce-payments' ),\n\t'1': __( 'Elevated', 'woocommerce-payments' ),\n\t'2': __( 'Highest', 'woocommerce-payments' ),\n};\n","/**\n * External dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * FLAG: PAYMENT_METHODS_LIST\n * New payment methods should be added here, the value should match the definition ID.\n */\nenum PAYMENT_METHOD_IDS {\n\tAFFIRM = 'affirm',\n\tAFTERPAY_CLEARPAY = 'afterpay_clearpay',\n\tALIPAY = 'alipay',\n\tAMAZON_PAY = 'amazon_pay',\n\tAPPLE_PAY = 'apple_pay',\n\tAU_BECS_DEBIT = 'au_becs_debit',\n\tBANCONTACT = 'bancontact',\n\tCARD = 'card',\n\tCARD_PRESENT = 'card_present',\n\tEPS = 'eps',\n\tGIROPAY = 'giropay',\n\tGOOGLE_PAY = 'google_pay',\n\tGRABPAY = 'grabpay',\n\tIDEAL = 'ideal',\n\tKLARNA = 'klarna',\n\tLINK = 'link',\n\tMULTIBANCO = 'multibanco',\n\tP24 = 'p24',\n\tSEPA_DEBIT = 'sepa_debit',\n\tSOFORT = 'sofort',\n\tWECHAT_PAY = 'wechat_pay',\n}\n\nexport enum PAYMENT_METHOD_BRANDS {\n\tAMEX = 'amex',\n\tCARTES_BANCAIRES = 'cartes_bancaires',\n\tDINERS = 'diners',\n\tDISCOVER = 'discover',\n\tEFTPOS_AU = 'eftpos_au',\n\tJCB = 'jcb',\n\tMASTERCARD = 'mastercard',\n\tUNIONPAY = 'unionpay',\n\tVISA = 'visa',\n}\n\n// This constant is used for rendering tooltip titles for \"payment methods\" in transaction list and details pages.\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const TRANSACTION_PAYMENT_METHOD_TITLES = {\n\tach_credit_transfer: __( 'ACH Credit Transfer', 'woocommerce-payments' ),\n\tach_debit: __( 'ACH Debit', 'woocommerce-payments' ),\n\tacss_debit: __( 'ACSS Debit', 'woocommerce-payments' ),\n\tamazon_pay: __( 'Amazon Pay', 'woocommerce-payments' ),\n\tamex: __( 'American Express', 'woocommerce-payments' ),\n\tcard: __( 'Card Payment', 'woocommerce-payments' ),\n\tcard_present: __( 'In-Person Card Payment', 'woocommerce-payments' ),\n\tcartes_bancaires: __( 'Cartes Bancaires', 'woocommerce-payments' ),\n\tdiners: __( 'Diners Club', 'woocommerce-payments' ),\n\tdiscover: __( 'Discover', 'woocommerce-payments' ),\n\teftpos_au: __( 'eftpos', 'woocommerce-payments' ),\n\tjcb: __( 'JCB', 'woocommerce-payments' ),\n\tmastercard: __( 'Mastercard', 'woocommerce-payments' ),\n\tstripe_account: __( 'Stripe Account', 'woocommerce-payments' ),\n\tunionpay: __( 'Union Pay', 'woocommerce-payments' ),\n\tvisa: __( 'Visa', 'woocommerce-payments' ),\n};\n\nexport default PAYMENT_METHOD_IDS;\n","/**\n * Internal dependencies\n */\nimport { TRANSACTION_PAYMENT_METHOD_TITLES } from 'wcpay/constants/payment-method';\n\ntype TransactionPaymentMethodId =\n\t| keyof typeof TRANSACTION_PAYMENT_METHOD_TITLES\n\t| string;\n\n/**\n * Gets the display title for a payment method in the transaction context.\n *\n * @param {TransactionPaymentMethodId} paymentMethodId - The ID of the payment method or transaction type\n * @param {Record<string, { title: string }>} [config] - Optional payment method configuration. Defaults to window.wooPaymentsPaymentMethodsConfig\n * @return {string} The display title for the payment method\n */\nexport const getTransactionPaymentMethodTitle = (\n\tpaymentMethodId: TransactionPaymentMethodId,\n\tconfig = window?.wooPaymentsPaymentMethodsConfig\n): string => {\n\treturn (\n\t\tconfig?.[ paymentMethodId ]?.title ||\n\t\tTRANSACTION_PAYMENT_METHOD_TITLES[\n\t\t\tpaymentMethodId as keyof typeof TRANSACTION_PAYMENT_METHOD_TITLES\n\t\t] ||\n\t\tpaymentMethodId\n\t);\n};\n"],"names":["getDetailsURL","id","parentSegment","getAdminUrl","page","path","DetailsLink","_jsx","Link","href","children","InfoOutlineIcon","size","injectedDateRangePresetClass","dateRangePresetButtonClass","customDatePresetLabel","__","dataViewsDateRangePresetKeys","dataViewsDateRangePresets","map","preset","label","getRangePresetLabel","getSelectedDateRangePreset","dateValue","now","operator","matchPreset","includes","isDataViewsDateRangePreset","syncNativeDatePresetState","popover","selectedPreset","nativePresetButtons","querySelectorAll","buttons","Array","from","customPresetButton","find","button","textContent","trim","getAttribute","setAttribute","classList","contains","remove","removeAttribute","syncDateRangePresetButtons","portalNode","onPresetClick","selector","querySelector","ownerDocument","createElement","type","className","dataset","wcpayDateRangePreset","onclick","appendChild","isSelected","ariaPressed","toggle","DataViewsDateRangePresetPortal","rootRef","dateFilterNow","onDateChange","portalNodeRef","useRef","stableDateFilterNowRef","current","Date","clickedDateFilterNow","setClickedDateFilterNow","useState","applyDatePreset","useCallback","currentDateFilterNow","nextValue","resolvePreset","applyDatePresetRef","selectedPresetRef","syncPortalNode","force","document","insertionPoint","popovers","rangeInputs","firstNativePreset","parentElement","parent","before","getDateRangePresetInsertionPoint","currentSelectedPreset","nextElementSibling","nextPortalNode","style","display","insertBefore","useEffect","ownerWindow","defaultView","window","syncAnimationFrame","observedTargets","Set","observeTarget","observer","target","options","has","observe","add","observePopoverFallbackContainer","getDateRangePresetPopoverFallbackContainer","childList","subtree","MutationObserver","requestAnimationFrame","getElementById","body","cancelAnimationFrame","disconnect","toYmd","d","getFullYear","String","getMonth","padStart","getDate","startOfDay","last_month","month_to_date","last_year","year_to_date","resolveSingleAnchorDate","today","setDate","setMonth","resolveRange","year","month","start","end","singleDatePresets","rangePresets","value","isSingleDatePreset","anchor","range","feesViewUserMetaKey","defaultVisibleFields","feesPrimaryField","getFeesTableFields","fields","filter","field","getFeesTableLayout","layout","styles","amount","align","fees","reportsPath","parseIntOr","fallback","n","parseInt","Number","isNaN","getSingleQueryValue","trimmed","getFirstQueryValue","isArray","split","buildFiltersFromQuery","query","filters","dateFilter","parseFeesDateFilterFromQuery","push","payment_method_type","buildFilterQueryParams","params","date_preset","undefined","date_between","date_before","date_after","Object","assign","serializeFeesDateFilterToQuery","buildUrlQueryParams","view","orderby","sort","order","direction","paged","per_page","perPage","search","withoutTransientParams","dropPagedReset","rest","areQueryParamsEqual","a","b","JSON","stringify","getTrackedFilterField","dateFilterField","findFilterByField","stringifyFilterValue","areFilterValuesEqual","previous","next","previousValue","displayType","charge","transactionDisplayType","payment","payment_failure_refund","payment_refund","refund","refund_failure","dispute","dispute_reversal","fee_refund","network_costs","displayMethod","paymentMethodType","getTransactionPaymentMethodTitle","feeBearingTypes","findFilter","f","sortFieldByColumnId","payment_method","transaction_currency","deposit_date","EMPTY","findDateFilter","replaceDateFilter","nextDateFilter","existingFilters","dateFilterIndex","findIndex","index","DataViewsFooter","DataViews","Footer","FeesReport","onReload","stableDateFilterNow","setView","persisted","hasLoadedPersisted","persistViewShape","useFeesUserPrefs","updateUserPreferences","userPrefs","useUserPreferences","prefs","normalizePersistedFeesView","persistDebounceTimerRef","clearPendingPersistUpdate","clearTimeout","nextPersisted","isPersistedShapeEqual","setTimeout","derivedView","syncViewToUrl","urlVersion","navTick","setNavTick","bumpNavTick","t","addEventListener","removeEventListener","useMemo","getQuery","titleField","searchDebounceTimerRef","clearPendingSearchUpdate","currentQueryParams","nextQueryParams","hasSearchChange","isSearchPageReset","hasImmediateUrlChange","updateQueryString","useFeesUrlSync","searchTrackingTimerRef","clearPendingSearchTracking","scheduleSearchTracking","recordEvent","search_length","length","localView","setLocalView","lastUrlVersionRef","wasLoadedRef","urlChanged","justLoaded","trackViewChange","previousSearch","nextSearch","previousDateFilter","previousDateValue","getFeesDateFilterValue","nextDateValue","range_days","is_initial_apply","getFeesDateFilterRangeDays","forEach","filterField","getTrackableFilterField","previousFilter","filter_field","had_previous_value","useFeesView","initialEmptyHeadingId","useId","initialEmptyDescriptionId","filteredEmptyHeadingId","filteredEmptyDescriptionId","rows","totalItems","totalPages","methodElements","typeElements","isLoading","error","feesQuery","columnId","buildFeesDateQueryFromFilter","methodFilter","typeFilter","getSingleStringValue","buildFeesQuery","summaryQuery","feesRows","feesError","useReportsFees","feesSummary","feesSummaryError","isSummaryLoading","useReportsFeesSummary","count","Math","max","ceil","sources","activeMethodValue","fromSources","source","Boolean","buildMethodElements","some","el","join","formatStringValue","useFeesData","getFeesFields","header","enableSorting","enableGlobalSearch","filterBy","operators","getValue","item","date","render","_Fragment","formatDateTimeFromString","includeTime","elements","order_id","orderId","action","enableHiding","transaction_id","row","payment_id","toUpperCase","formatExplicitCurrency","deposit_currency","deposit_id","hasError","keys","hasFilters","hasNoRows","isInitialEmpty","isFilteredEmpty","rangeDays","getDateRangeDays","dateFilterValue","onDatePresetChange","referenceDate","errorHeadingRef","previousErrorRef","previousLoadingRef","previousLoadingAnnouncementRef","has_filters","focus","speak","speakTimerRef","lastSpokenRef","total_items","is_initial_empty","is_filtered_empty","message","sprintf","ReportState","title","description","_jsxs","Button","variant","onClick","icon","calendar","descriptionId","headingId","headingRef","headingTabIndex","role","ref","tabIndex","data","onChangeView","paginationInfo","empty","Spinner","defaultLayouts","table","getItemId","Search","FiltersToggle","ViewConfig","FiltersToggled","Layout","Icon","card_reader_fee","financing_payout","financing_paydown","sourceDevice","android","ios","channel","online","in_person","in_person_pos","riskLevel","TRANSACTION_PAYMENT_METHOD_TITLES","ach_credit_transfer","ach_debit","acss_debit","amazon_pay","amex","card","card_present","cartes_bancaires","diners","discover","eftpos_au","jcb","mastercard","stripe_account","unionpay","visa","paymentMethodId","config","wooPaymentsPaymentMethodsConfig"],"sourceRoot":""}