'use strict';
import { tableElementSuffixes } from '../../level2/fd-component-toolbox/constants/table-element-suffixes.js';
import { elementPrefixes } from '../../level2/meta/constants/element-prefixes.js';
import { elements } from '../../fd-toolbox/constants/elements.js';
import { getResourceListTableId } from '../../level2/meta/resource-list/ResourceList.funcs.js';
import { ResourceList } from '../../level2/meta/resource-list/ResourceList.js';
import { filterPoGetResourceFilterListId } from './filter-po.js';
import { getUiTester, getUiTestPage } from '../ui-tester/global-ui-test.js';
import { editPoWaitForUrl } from './edit-po.js';
import { uiAssertNotEqual } from '../asserters/ui-asserts.js';
import { getElementId } from '../../fd-toolbox/html/element-ids.js';
import { getEditResourceId } from '../../level2/meta/edit-resource/EditResource.funcs.js';
import { getViewSheetEditButtonId } from '../../level2/meta/view/ViewSheet.funcs.js';
import { htmlElementVisibilityState } from '../constants/ui-tester/html-contants.js';
import { getTableCellElementId } from '../../level2/meta/resource-list/resource-list-cell-element-ids.js';

var __defProp=Object['defineProperty'],__name=(_0x11f2c1,_0x5eec97)=>__defProp(_0x11f2c1,'name',{'value':_0x5eec97,'configurable':!![]});function tablePoGetTableId(_0x4e2d73){return getResourceListTableId(_0x4e2d73);}__name(tablePoGetTableId,'tablePoGetTableId');async function tablePoClickAddButton(_0x1956aa){const _0x265598=getUiTester();await clickVisibleAddButton(),await editPoWaitForUrl(_0x1956aa),await _0x265598['waitForElementToLoad'](getEditResourceId());}__name(tablePoClickAddButton,'tablePoClickAddButton');async function tablePoClickEditButton(_0x2e5618){const _0x44a9b3=getUiTester(),_0x56f415=getViewSheetEditButtonId(_0x2e5618);await _0x44a9b3['waitForElementToLoad'](_0x56f415),await _0x44a9b3['click'](_0x56f415),await _0x44a9b3['waitForElementToLoad'](getEditResourceId());}__name(tablePoClickEditButton,'tablePoClickEditButton');async function tablePoClickPreviousPageButton(){const _0x43de44=getUiTester();await _0x43de44['click'](elements['pager']['previousPageButton']);}__name(tablePoClickPreviousPageButton,'tablePoClickPreviousPageButton');async function tablePoClickNextPageButton(){const _0x16c3cd=getUiTester();await _0x16c3cd['click'](elements['pager']['nextPageButton']);}__name(tablePoClickNextPageButton,'tablePoClickNextPageButton');async function tablePoClickElementByResourceId(_0x39b21a,_0x468f2b,_0xd8a6ae){const _0xb632e6=getUiTester(),_0x9459e7=await _0xb632e6['getResourceIndexByResourceId'](_0x468f2b,_0x39b21a),_0xa78b16=getElementId(_0x39b21a,_0xd8a6ae,_0x9459e7);await _0xb632e6['click'](_0xa78b16,!![]);}__name(tablePoClickElementByResourceId,'tablePoClickElementByResourceId');async function tablePoAreFiltersPresent(_0x2f8c3b){const _0x328937=getUiTester(),_0x928a94=getElementId(ResourceList['displayName'],_0x2f8c3b),_0x351b0d=filterPoGetResourceFilterListId(_0x928a94);await _0x328937['waitForElementToLoad'](_0x351b0d);}__name(tablePoAreFiltersPresent,'tablePoAreFiltersPresent');async function tablePoSelectPageSize(_0x36e909){const _0x3c13e8=getUiTester();await _0x3c13e8['click'](elements['pager']['openPagerButtonId']),await _0x3c13e8['click'](elements['pager']['pagerSelectTriggerId']),await _0x3c13e8['click'](elementPrefixes['selectItem']+_0x36e909);}__name(tablePoSelectPageSize,'tablePoSelectPageSize');async function tablePoGetElementCount(_0x379e38,_0x562193){const _0xda8131=getUiTester(),_0x56f886=await _0xda8131['getPrefixesById'](_0x379e38+_0x562193),_0x1a9109=_0x56f886['length'];return _0x1a9109;}__name(tablePoGetElementCount,'tablePoGetElementCount');async function tablePoGetResourceIndexByResourceId(_0x24cd7f,_0x1a17cc){const _0x6e3e40=getUiTester();return _0x6e3e40['getResourceIndexByResourceId'](_0x24cd7f,_0x1a17cc);}__name(tablePoGetResourceIndexByResourceId,'tablePoGetResourceIndexByResourceId');function tablePoGetCheckMarkId(_0x8fce1f,_0x4c3a70,_0x1f6d16){const _0x4513c8=tablePoGetTableId(_0x8fce1f);return getTableCellElementId(''+_0x4513c8+_0x4c3a70,_0x1f6d16);}__name(tablePoGetCheckMarkId,'tablePoGetCheckMarkId');async function tablePoWaitForDataToChange(_0x3694af,_0x17fa09){const _0x1e09d7=getUiTestPage(),_0x51f79a=getUiTester(),_0x125e89=tablePoGetTableId(_0x3694af),_0x181458=await _0x51f79a['getById'](_0x125e89);await _0x51f79a['waitForElementToLoad'](_0x125e89);const _0x1b549e=_0x17fa09??await _0x181458['textContent']();await _0x1e09d7['waitForFunction'](_0x3796ea=>{const _0x1c3d29=_0x3796ea['el']?.['textContent']??'',_0xe87aa8=_0x3796ea['prevText']??'';return _0x1c3d29!==_0xe87aa8;},{'el':await _0x181458['elementHandle'](),'prevText':_0x1b549e}),await _0x1e09d7['waitForLoadState'](htmlElementVisibilityState['domcontentloaded']);}__name(tablePoWaitForDataToChange,'tablePoWaitForDataToChange');async function tablePoGetTableRowValue(_0x2a2721,_0x2420b6){const _0x55b9fe=getUiTester(),_0x4121ce=tablePoGetTableId(_0x2a2721),_0xfb1f84=getElementId(_0x4121ce,tableElementSuffixes['row'],_0x2420b6);return _0x55b9fe['getText'](_0xfb1f84);}__name(tablePoGetTableRowValue,'tablePoGetTableRowValue');async function tablePoGetTableText(_0x4d0482){const _0x5c994b=getUiTester(),_0x8e0d51=tablePoGetTableId(_0x4d0482),_0x51c4dd=await _0x5c994b['getById'](_0x8e0d51);return await _0x51c4dd['textContent']()??void(0xd*-0x13f+0x1b92+-0xb5f);}__name(tablePoGetTableText,'tablePoGetTableText');async function assertTableCellNotEqual(_0x89d457,_0x14f6e4,_0xd31093){const _0x4196b5=await tablePoGetTableRowValue(_0x89d457,_0x14f6e4);return await uiAssertNotEqual(_0x4196b5,_0xd31093),_0x4196b5;}__name(assertTableCellNotEqual,'assertTableCellNotEqual');async function tablePoSimulateHover(_0x5817b5){const _0x3cc300=getUiTester(),_0x555ccc=await _0x3cc300['getById'](_0x5817b5);await _0x555ccc['hover']();}__name(tablePoSimulateHover,'tablePoSimulateHover');async function tablePoSimulateUnhover(){const _0x297441=getUiTester();await _0x297441['page']['mouse']['move'](-(0x2169+0x1605+-0x5*0xb14),-(0x1a*-0x11b+-0xe56+0x2b1e));}__name(tablePoSimulateUnhover,'tablePoSimulateUnhover');async function clickVisibleAddButton(){const _0x4bdfd0=getUiTester(),_0x21b5e8=_0x4bdfd0['page']['locator']('#'+elements['table']['addButton']+':visible')['first']();await _0x21b5e8['dispatchEvent'](htmlElementVisibilityState['click']);}__name(clickVisibleAddButton,'clickVisibleAddButton');

export { assertTableCellNotEqual, tablePoAreFiltersPresent, tablePoClickAddButton, tablePoClickEditButton, tablePoClickElementByResourceId, tablePoClickNextPageButton, tablePoClickPreviousPageButton, tablePoGetCheckMarkId, tablePoGetElementCount, tablePoGetResourceIndexByResourceId, tablePoGetTableId, tablePoGetTableRowValue, tablePoGetTableText, tablePoSelectPageSize, tablePoSimulateHover, tablePoSimulateUnhover, tablePoWaitForDataToChange };
