'use strict';
import { getUiTester } from '../ui-tester/global-ui-test.js';
import { uiClickCheckboxOrSwitch } from '../asserters/ui-asserts.js';
import { browserPoSetRelation } from './browser-po.js';
import { multiBrowserPoAddRelation } from './multi-browser-po.js';
import { getElementId } from '../../fd-toolbox/html/element-ids.js';
import { elementSuffixes } from '../../fd-toolbox/constants/element-suffixes.js';
import { getEditResourceId, getEditResourcePropertyId, getEditResourceMarkdownPreviewButtonId } from '../../level2/meta/edit-resource/EditResource.funcs.js';
import { getEditUrl } from '../../level2/meta/server/meta-url-service.js';
import { htmlElementVisibilityState } from '../constants/ui-tester/html-contants.js';

var __defProp=Object['defineProperty'],__name=(_0x1112a6,_0x2d216a)=>__defProp(_0x1112a6,'name',{'value':_0x2d216a,'configurable':!![]});async function editPoClickExpandRelationButton(_0x3b0c44,_0xd3d879){const _0x454646=getUiTester(),_0x428345=getElementId(elementSuffixes['expandRelation'],_0x3b0c44,_0xd3d879);await _0x454646['click'](_0x428345);}__name(editPoClickExpandRelationButton,'editPoClickExpandRelationButton');async function editPoClickCancelButton(_0x40d91f,_0xb224e0){const _0x20ffbf=getUiTester(),_0x68d37e=getElementId(elementSuffixes['cancel'],_0x40d91f,_0xb224e0),_0x14fc51=_0x20ffbf['page']['locator']('#'+_0x68d37e);await _0x14fc51['dispatchEvent'](htmlElementVisibilityState['click']),await _0x20ffbf['waitForElementToBeHidden'](getEditResourceId(_0xb224e0));}__name(editPoClickCancelButton,'editPoClickCancelButton');async function editPoClickBackButton(_0x3b1d30,_0x4d0044){const _0xe62fee=getUiTester(),_0x301cc2=getElementId(elementSuffixes['back'],_0x3b1d30,_0x4d0044),_0x4d4f32=_0xe62fee['page']['locator']('#'+_0x301cc2);await _0x4d4f32['dispatchEvent'](htmlElementVisibilityState['click']),await _0xe62fee['waitForElementToBeHidden'](getEditResourceId(_0x4d0044));}__name(editPoClickBackButton,'editPoClickBackButton');async function editPoClickSaveButton(_0x141b98,_0x481885){const _0x4f2faf=getUiTester(),_0x17b9fa=getElementId(elementSuffixes['save'],_0x141b98,_0x481885);await _0x4f2faf['click'](_0x17b9fa);}__name(editPoClickSaveButton,'editPoClickSaveButton');async function editPoWaitForUrl(_0xe76437,_0x2d65a4){const _0x23ac8a=getUiTester(),_0x17afd6=editPoGetUrlToNavigate(_0xe76437,_0x2d65a4,_0x23ac8a['getBaseUrl']());await _0x23ac8a['expectUrl'](_0x17afd6);}__name(editPoWaitForUrl,'editPoWaitForUrl');async function editPoWaitForResourceViewToBeHidden(_0x42a625){const _0x2327b7=getUiTester();await _0x2327b7['waitForElementToBeHidden'](getEditResourceId(_0x42a625));}__name(editPoWaitForResourceViewToBeHidden,'editPoWaitForResourceViewToBeHidden');async function editPoGoTo(_0x1e73f0,_0x183b5d){const _0x353f78=getUiTester(),_0x38a29a=editPoGetUrlToNavigate(_0x1e73f0,_0x183b5d);await _0x353f78['goAndWait'](_0x38a29a);}__name(editPoGoTo,'editPoGoTo');async function editPoSetInputValue(_0x3bb7a0,_0x52ebb3,_0x3eed65){const _0xd68fe8=getUiTester(),_0x14f1ac=_0x3eed65??getEditResourceId(),_0x25d72d=getEditResourcePropertyId(_0x3bb7a0,_0x14f1ac);await _0xd68fe8['clearWithBackspacesAndSendKeys'](_0x25d72d,_0x52ebb3);}__name(editPoSetInputValue,'editPoSetInputValue');async function editPoToggleBooleanField(_0x388d5d){const _0x5db220=getEditResourceId(),_0x3c8d04=getEditResourcePropertyId(_0x388d5d,_0x5db220);await uiClickCheckboxOrSwitch(_0x3c8d04);}__name(editPoToggleBooleanField,'editPoToggleBooleanField');async function editPoClickPreviewMarkDown(_0x3000a3){const _0x1c66aa=getUiTester(),_0xe0a77c=getEditResourceId(),_0x3c7fdc=getEditResourceMarkdownPreviewButtonId(_0x3000a3,_0xe0a77c);await _0x1c66aa['click'](_0x3c7fdc);}__name(editPoClickPreviewMarkDown,'editPoClickPreviewMarkDown');function editPoGetUrlToNavigate(_0x2f472f,_0x472aa7,_0xfa2c6b){const _0x199876=getEditUrl(_0x2f472f,_0x472aa7,void(0x1*-0x254b+-0xd0d+0x3258),_0xfa2c6b);return _0x199876;}__name(editPoGetUrlToNavigate,'editPoGetUrlToNavigate');async function editPoSetRelation(_0x33e402,_0xe07663){const _0x8a2dbb=getEditResourceId();await browserPoSetRelation(_0x33e402,_0xe07663,_0x8a2dbb);}__name(editPoSetRelation,'editPoSetRelation');async function editPoAddRelation(_0xd1b935,_0x1d9dbd){const _0x142e63=getEditResourceId();await multiBrowserPoAddRelation(_0xd1b935,_0x1d9dbd,_0x142e63);}__name(editPoAddRelation,'editPoAddRelation');async function editPoAddManyToManyRelation(_0x147cf1,_0x1b4332){await editPoAddRelation(_0x147cf1,_0x1b4332);}__name(editPoAddManyToManyRelation,'editPoAddManyToManyRelation');

export { editPoAddManyToManyRelation, editPoAddRelation, editPoClickBackButton, editPoClickCancelButton, editPoClickExpandRelationButton, editPoClickPreviewMarkDown, editPoClickSaveButton, editPoGetUrlToNavigate, editPoGoTo, editPoSetInputValue, editPoSetRelation, editPoToggleBooleanField, editPoWaitForResourceViewToBeHidden, editPoWaitForUrl };
