@flemist/simple-utils 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/build/browser/index.cjs +1 -1
  2. package/build/browser/index.mjs +148 -115
  3. package/build/common/index.cjs +1 -1
  4. package/build/common/index.mjs +148 -115
  5. package/build/common/string/format/index.d.ts +1 -0
  6. package/build/common/test/index.d.ts +1 -0
  7. package/build/common/test/match/Matcher.d.ts +14 -0
  8. package/build/common/test/match/check.d.ts +9 -0
  9. package/build/common/test/match/helpers.d.ts +4 -0
  10. package/build/common/test/match/index.d.ts +7 -0
  11. package/build/common/test/match/match.d.ts +6 -0
  12. package/build/common/test/match/matchers/MatchInstanceOf.d.ts +11 -0
  13. package/build/common/test/match/matchers/MatcherAny.d.ts +6 -0
  14. package/build/common/test/match/matchers/MatcherArray.d.ts +12 -0
  15. package/build/common/test/match/matchers/MatcherArrayItem.d.ts +10 -0
  16. package/build/common/test/match/matchers/MatcherConvert.d.ts +10 -0
  17. package/build/common/test/match/matchers/MatcherCustom.d.ts +9 -0
  18. package/build/common/test/match/matchers/MatcherFew.d.ts +13 -0
  19. package/build/common/test/match/matchers/MatcherIn.d.ts +12 -0
  20. package/build/common/test/match/matchers/MatcherIs.d.ts +10 -0
  21. package/build/common/test/match/matchers/MatcherNever.d.ts +6 -0
  22. package/build/common/test/match/matchers/MatcherNot.d.ts +9 -0
  23. package/build/common/test/match/matchers/MatcherNumber.d.ts +15 -0
  24. package/build/common/test/match/matchers/MatcherObject.d.ts +14 -0
  25. package/build/common/test/match/matchers/MatcherObjectEntry.d.ts +11 -0
  26. package/build/common/test/match/matchers/MatcherRef.d.ts +10 -0
  27. package/build/common/test/match/matchers/MatcherString.d.ts +10 -0
  28. package/build/common/test/match/matchers/constants.d.ts +1 -0
  29. package/build/common/test/match/matchers/index.d.ts +18 -0
  30. package/build/common/test/match/matchers/matchers.d.ts +92 -0
  31. package/build/common/test/match/report.d.ts +5 -0
  32. package/build/common/test/match/types.d.ts +24 -0
  33. package/build/node/index.cjs +7 -7
  34. package/build/node/index.mjs +510 -477
  35. package/build/node/test/e2e/check/checkPageHttpErrors.d.ts +25 -0
  36. package/build/node/test/e2e/check/index.d.ts +3 -0
  37. package/build/node/test/e2e/check/subscribeJsErrors.d.ts +10 -0
  38. package/build/node/test/e2e/check/types.d.ts +1 -0
  39. package/build/node/test/e2e/index.d.ts +3 -0
  40. package/build/node/test/e2e/setPlaywrightPriorityLow.d.ts +1 -0
  41. package/build/node/test/e2e/test/delayOnError.d.ts +3 -0
  42. package/build/node/test/e2e/test/index.d.ts +6 -0
  43. package/build/node/test/e2e/test/initPage.d.ts +25 -0
  44. package/build/node/test/e2e/test/testPage.d.ts +17 -0
  45. package/build/node/test/e2e/test/types.d.ts +7 -0
  46. package/build/node/test/e2e/test/useBrowser.d.ts +5 -0
  47. package/build/node/test/e2e/test/useBrowserContext.d.ts +5 -0
  48. package/build/node/test/index.d.ts +2 -0
  49. package/build/node/test/refactor/createPagesElementsChangesTest.d.ts +11 -0
  50. package/build/node/test/refactor/forcePseudoClasses.d.ts +5 -0
  51. package/build/node/test/refactor/getAllElements.d.ts +2 -0
  52. package/build/node/test/refactor/getElementsStyleDiff.d.ts +2 -0
  53. package/build/node/test/refactor/getObjectsDiff.d.ts +6 -0
  54. package/build/node/test/refactor/index.d.ts +7 -0
  55. package/build/node/test/refactor/loadSaveJson.d.ts +2 -0
  56. package/build/node/test/refactor/types.d.ts +72 -0
  57. package/build/urlGet-CerQ1cKh.js +17 -0
  58. package/build/{urlGet-BCW9jvAm.mjs → urlGet-DZEwtNXt.mjs} +614 -561
  59. package/package.json +1 -1
  60. package/build/urlGet-BOGFUahf.js +0 -17
@@ -0,0 +1,7 @@
1
+ export * from './types';
2
+ export * from './Matcher';
3
+ export * from './helpers';
4
+ export * from './match';
5
+ export * from './check';
6
+ export * from './report';
7
+ export * from './matchers';
@@ -0,0 +1,6 @@
1
+ import { Expected, MatchResult, MatchResult3 } from './types';
2
+ export declare function validateMatchResult<T>(_result: MatchResult<T>): MatchResult<T>;
3
+ export declare function createMatchResultError<T>(actual: T, expected: Expected<T>, error: Error): MatchResult<T>;
4
+ export declare function createMatchResultBoolean<T>(actual: T, expected: Expected<T>, result: boolean): MatchResult<T>;
5
+ export declare function createMatchResult<T>(actual: T, expected: Expected<T>, result: MatchResult3): MatchResult<T>;
6
+ export declare function match<T>(actual: T, expected: Expected<T>): MatchResult<T>;
@@ -0,0 +1,11 @@
1
+ import { MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchInstanceOfArgs<T> = MatcherArgs<T> & {
4
+ expected: {
5
+ new (...args: any[]): T;
6
+ };
7
+ };
8
+ export declare class MatcherInstanceOf<T> extends Matcher<T, MatchInstanceOfArgs<T>> {
9
+ match(actual: T): MatchResult3;
10
+ nameDefault(): string;
11
+ }
@@ -0,0 +1,6 @@
1
+ import { MatchResult3 } from '../types';
2
+ import { Matcher } from '../Matcher';
3
+ export declare class MatcherAny extends Matcher<any> {
4
+ match(): MatchResult3;
5
+ nameDefault(): string;
6
+ }
@@ -0,0 +1,12 @@
1
+ import { Expected, MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchArray<T extends any[]> = Array<Expected<T[number]>>;
4
+ export type MatcherArrayArgs<T extends any[]> = MatcherArgs<T> & {
5
+ expected?: MatchArray<T> | null;
6
+ matchType?: 'equals' | 'includes';
7
+ maxReportItems?: number;
8
+ };
9
+ export declare class MatcherArray<T extends any[]> extends Matcher<T, MatcherArrayArgs<T> | null | undefined> {
10
+ match(actual: T): MatchResult3;
11
+ nameDefault(): string;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { Expected, MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchArrayItemArgs<T> = MatcherArgs<T[]> & {
4
+ expected: Expected<T>;
5
+ maxReportItems?: number;
6
+ };
7
+ export declare class MatcherArrayItem<T> extends Matcher<T[], MatchArrayItemArgs<T>> {
8
+ match(actual: T[]): MatchResult3;
9
+ nameDefault(): string;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { Expected, MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchConvertArgs<T, U> = MatcherArgs<T> & {
4
+ convert: (actual: T) => U;
5
+ expected: Expected<U>;
6
+ };
7
+ export declare class MatcherConvert<T, U> extends Matcher<T, MatchConvertArgs<T, U>> {
8
+ match(actual: T): MatchResult3;
9
+ nameDefault(): string;
10
+ }
@@ -0,0 +1,9 @@
1
+ import { MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchCustomArgs<T> = MatcherArgs<T> & {
4
+ matcher: Matcher<T> | ((actual: T) => MatchResult3);
5
+ };
6
+ export declare class MatcherCustom<T> extends Matcher<T, MatchCustomArgs<T>> {
7
+ match(actual: T): MatchResult3;
8
+ nameDefault(actual?: T): string;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { Expected, MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchFewArgs<T> = MatcherArgs<T> & {
4
+ type: 'or' | 'and';
5
+ expecteds: Array<Expected<T>>;
6
+ /** If true, then it will not check remains unnecessary expecteds.
7
+ * So there will be less information in logs especially if you use 'Not' operator */
8
+ pipe?: boolean | null;
9
+ };
10
+ export declare class MatcherFew<T> extends Matcher<T, MatchFewArgs<T>> {
11
+ match(actual: T): MatchResult3;
12
+ nameDefault(): string;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchInArgs<T> = MatcherArgs<T> & {
4
+ expected: Set<T>;
5
+ };
6
+ export declare class MatcherIn<T> extends Matcher<T, MatchInArgs<T>> {
7
+ constructor(args: Omit<MatchInArgs<T>, 'expected'> & {
8
+ expected: Set<T> | Iterable<T>;
9
+ });
10
+ match(actual: T): MatchResult3;
11
+ nameDefault(): string;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchIsArgs<T> = MatcherArgs<T> & {
4
+ expected: T;
5
+ nonStrict?: boolean | null;
6
+ };
7
+ export declare class MatcherIs<T> extends Matcher<T, MatchIsArgs<T>> {
8
+ match(actual: T): MatchResult3;
9
+ nameDefault(): string;
10
+ }
@@ -0,0 +1,6 @@
1
+ import { MatchResult3 } from '../types';
2
+ import { Matcher } from '../Matcher';
3
+ export declare class MatcherNever extends Matcher<any> {
4
+ match(): MatchResult3;
5
+ nameDefault(): string;
6
+ }
@@ -0,0 +1,9 @@
1
+ import { Expected, MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchNotArgs<T> = MatcherArgs<T> & {
4
+ expected: Expected<T>;
5
+ };
6
+ export declare class MatcherNot<T> extends Matcher<T, MatchNotArgs<T>> {
7
+ match(actual: T): MatchResult3;
8
+ nameDefault(): string;
9
+ }
@@ -0,0 +1,15 @@
1
+ import { MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchNumberArgsRange = MatcherArgs<number> & {
4
+ min?: number | null;
5
+ max?: number | null;
6
+ allowInfinity?: boolean | null;
7
+ allowNaN?: boolean | null;
8
+ };
9
+ export type MatchNumberArgs = MatchNumberArgsRange & {
10
+ float?: boolean | null;
11
+ };
12
+ export declare class MatcherNumber extends Matcher<number, MatchNumberArgs | undefined | null> {
13
+ match(actual: number): MatchResult3;
14
+ nameDefault(): string;
15
+ }
@@ -0,0 +1,14 @@
1
+ import { Expected, MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchObject<T> = {
4
+ [K in keyof T]: Expected<T[K]>;
5
+ };
6
+ export type MatcherObjectArgs<T> = MatcherArgs<T> & {
7
+ expected?: MatchObject<T> | null;
8
+ ignoreExtraKeys?: boolean;
9
+ maxReportItems?: number;
10
+ };
11
+ export declare class MatcherObject<T> extends Matcher<T, MatcherObjectArgs<T> | undefined | null> {
12
+ match(actual: T): MatchResult3;
13
+ nameDefault(): string;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { Expected, MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchObjectEntry<T> = Expected<[keyof T, T[keyof T]]>;
4
+ export type MatcherObjectEntryArgs<T> = MatcherArgs<T> & {
5
+ expected?: MatchObjectEntry<T> | null;
6
+ maxReportItems?: number;
7
+ };
8
+ export declare class MatcherObjectEntry<T> extends Matcher<T, MatcherObjectEntryArgs<T> | undefined | null> {
9
+ match(actual: T): MatchResult3;
10
+ nameDefault(): string;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { Matcher } from '../Matcher';
2
+ import { Expected, MatchResult3 } from '../types';
3
+ export declare class MatcherRef<T> extends Matcher<T> {
4
+ private _hasExpected;
5
+ private _expected;
6
+ get expected(): Expected<T>;
7
+ set expected(value: Expected<T>);
8
+ match(actual: T): MatchResult3;
9
+ nameDefault(): string;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { MatchResult3 } from '../types';
2
+ import { Matcher, MatcherArgs } from '../Matcher';
3
+ export type MatchStringPattern = RegExp | ((actual: string) => MatchResult3);
4
+ export type MatchStringArgs = MatcherArgs<string> & {
5
+ pattern?: MatchStringPattern | null;
6
+ };
7
+ export declare class MatcherString extends Matcher<string, MatchStringArgs | undefined | null> {
8
+ match(actual: string): MatchResult3;
9
+ nameDefault(): string;
10
+ }
@@ -0,0 +1 @@
1
+ export declare const MAX_REPORT_ITEMS_DEFAULT = 10;
@@ -0,0 +1,18 @@
1
+ export * from './constants';
2
+ export * from './matchers';
3
+ export * from './MatcherAny';
4
+ export * from './MatcherArray';
5
+ export * from './MatcherArrayItem';
6
+ export * from './MatcherConvert';
7
+ export * from './MatcherCustom';
8
+ export * from './MatcherFew';
9
+ export * from './MatcherIn';
10
+ export * from './MatcherIs';
11
+ export * from './MatcherNever';
12
+ export * from './MatcherNot';
13
+ export * from './MatcherNumber';
14
+ export * from './MatcherObject';
15
+ export * from './MatcherObjectEntry';
16
+ export * from './MatcherRef';
17
+ export * from './MatcherString';
18
+ export * from './MatchInstanceOf';
@@ -0,0 +1,92 @@
1
+ import { MatchArray, MatcherArray } from './MatcherArray';
2
+ import { MatcherAny } from './MatcherAny';
3
+ import { Expected, MatchResult3 } from '../types';
4
+ import { MatcherConvert } from './MatcherConvert';
5
+ import { MatcherIs } from './MatcherIs';
6
+ import { MatcherNumber, MatchNumberArgs, MatchNumberArgsRange } from './MatcherNumber';
7
+ import { MatcherObject, MatchObject } from './MatcherObject';
8
+ import { MatcherString, MatchStringPattern } from './MatcherString';
9
+ import { MatcherInstanceOf } from './MatchInstanceOf';
10
+ import { MatcherIn } from './MatcherIn';
11
+ import { MatcherFew } from './MatcherFew';
12
+ import { MatcherCustom } from './MatcherCustom';
13
+ import { MatcherNot } from './MatcherNot';
14
+ import { Matcher, MatcherArgsName } from '../Matcher';
15
+ import { MatcherNever } from './MatcherNever';
16
+ import { ValueState } from '@flemist/async-utils';
17
+ import { MatcherObjectEntry } from './MatcherObjectEntry';
18
+ import { MatcherRef } from './MatcherRef';
19
+ export declare function matchArray<T extends any[]>(expected?: MatchArray<T> | null): MatcherArray<T>;
20
+ export declare function matchArrayIncludes<T extends any[]>(expected: MatchArray<T>): MatcherArray<T>;
21
+ export declare function matchAny(): MatcherAny;
22
+ export declare function matchRef<T>(): MatcherRef<T>;
23
+ export declare function matchNever(name?: MatcherArgsName<any> | null): MatcherNever;
24
+ /** Check array length and then check each item with expected */
25
+ export declare function matchArrayItem<T>(expectedLength: Expected<number> | MatchIntArgs | null | undefined, expected: Expected<T>): Matcher<T[]>;
26
+ export declare function matchConvert<T, U>(name: MatcherArgsName<T>, convert: (actual: T) => U, expected: Expected<U>): MatcherConvert<T, U>;
27
+ export declare function matchIsNonStrict<T>(expected: T): MatcherIs<T>;
28
+ export declare function matchIs<T>(expected: T): MatcherIs<T>;
29
+ export declare function matchNumber(args?: MatchNumberArgs | null): MatcherNumber;
30
+ export type MatchIntArgs = MatchNumberArgsRange;
31
+ export declare function matchInt(args?: MatchIntArgs | null): MatcherNumber;
32
+ export type MatchFloatArgs = MatchNumberArgsRange;
33
+ export declare function matchFloat(args?: MatchFloatArgs | null): MatcherNumber;
34
+ export declare function matchObject<T>(expected?: MatchObject<T> | null): MatcherObject<T>;
35
+ export declare function matchDeep<T>(expected?: Expected<T> | null, toExpected?: <T>(value: T, key: string | number | null) => Expected<T> | null, key?: string | number | null): any;
36
+ export declare function matchObjectPartial<T>(expected?: MatchObject<Partial<T>> | null): MatcherObject<T>;
37
+ export declare function matchString(pattern?: MatchStringPattern | null): MatcherString;
38
+ export declare function matchInstanceOf<T>(expected: {
39
+ new (...args: any[]): T;
40
+ }): MatcherInstanceOf<T>;
41
+ export declare function matchTypeOf(expected: Expected<string>): MatcherConvert<any, string>;
42
+ export declare function matchConstructor<T>(expected: {
43
+ new (...args: any[]): T;
44
+ }): MatcherConvert<T, Function>;
45
+ export declare function matchBoolean(): MatcherConvert<any, string>;
46
+ export declare function matchNullish(): MatcherIs<any>;
47
+ export declare function matchNotNullish(): MatcherNot<any>;
48
+ export declare function matchOr<T>(...expecteds: Array<Expected<T>>): MatcherFew<T>;
49
+ export declare function matchAnd<T>(...expecteds: Array<Expected<T>>): MatcherFew<T>;
50
+ export declare function matchOrPipe<T>(...expecteds: Array<Expected<T>>): MatcherFew<T>;
51
+ export declare function matchAndPipe<T>(...expecteds: Array<Expected<T>>): MatcherFew<T>;
52
+ export declare function matchOptional<T>(expected: Expected<T>, required?: null | boolean): Expected<T>;
53
+ export declare function matchArrayLength(args?: MatchIntArgs | Expected<number> | null | undefined): MatcherFew<any[]>;
54
+ export declare function matchStringLength(args?: MatchIntArgs | Expected<number> | null | undefined): MatcherFew<string>;
55
+ export declare function matchObjectWith<T>(matcher: Matcher<T>): MatcherFew<T>;
56
+ /** Check if it is an array and then check with matcher */
57
+ export declare function matchArrayWith<T extends any[]>(matcher: Matcher<T[]>): MatcherFew<T>;
58
+ export declare function matchObjectKeys<T extends object>(expected: Expected<Array<keyof T>>): MatcherFew<T>;
59
+ export declare function matchObjectValues<T extends object>(expected: Expected<Array<T[keyof T]>>): MatcherFew<T>;
60
+ export declare function matchObjectEntries<T extends object>(expected: Expected<Array<[keyof T, T[keyof T]]>>): MatcherFew<T>;
61
+ export declare function matchObjectEntry<T extends object>(expected: Expected<[keyof T, T[keyof T]]>): MatcherObjectEntry<T>;
62
+ export declare function matchObjectKey<T extends object>(expected: Expected<keyof T>): MatcherObjectEntry<T>;
63
+ export declare function matchObjectValue<T extends object>(expected: Expected<T[keyof T]>): MatcherObjectEntry<T>;
64
+ export declare function matchObjectKeyValue<T extends object>(expectedKey: Expected<keyof T>, expectedValue: Expected<T[keyof T]>): MatcherObjectEntry<T>;
65
+ export declare function matchObjectKeysNotNull<T extends object>(expected: Expected<Array<keyof T>>): MatcherFew<T>;
66
+ export declare function matchIn<T>(expected: Set<T> | Iterable<T>): MatcherIn<T>;
67
+ export declare function matchEnum<T>(enumObject: {
68
+ [key: string]: T;
69
+ }): MatcherIn<T>;
70
+ export declare function matchCustom<T>(name: MatcherArgsName<T>, matcher: Matcher<T> | ((actual: T) => MatchResult3)): MatcherCustom<T>;
71
+ export type MatchRangeValueOptions = {
72
+ min?: number | null;
73
+ max?: number | null;
74
+ optional?: boolean | null;
75
+ float?: boolean | null;
76
+ };
77
+ export type MatchRangeOptions = {
78
+ common?: null | MatchRangeValueOptions;
79
+ from?: null | MatchRangeValueOptions;
80
+ to?: null | MatchRangeValueOptions;
81
+ };
82
+ export declare function matchIntDate(options?: MatchIntArgs): Matcher<number>;
83
+ export declare function matchRange(options?: MatchRangeOptions | null): MatcherFew<any[]>;
84
+ export declare function matchRangeDate(args?: MatchRangeOptions | null): MatcherFew<any[]>;
85
+ export declare function matchNot<T>(expected: Expected<T>): MatcherNot<T>;
86
+ export declare function matchUuid(): Matcher<string>;
87
+ export declare function matchValueState<T>(args: MatchObject<Partial<ValueState<T>>>): MatcherObject<ValueState<T>>;
88
+ export declare function matchArrayBuffer<T extends {
89
+ readonly byteLength: number;
90
+ }>(expected?: {
91
+ readonly byteLength: number;
92
+ } | string | null): Matcher<T>;
@@ -0,0 +1,5 @@
1
+ import { MatchResult, MatchResultNested } from './types';
2
+ export declare function filterMatchResultNested(matchResultNested: MatchResultNested, inverseResult: boolean): MatchResultNested | null;
3
+ export declare function filterMatchResult(matchResult: MatchResult<any>, inverseResult: boolean): MatchResult<any> | null;
4
+ export declare function matchResultNestedToString(matchResultNested: MatchResultNested, indent: string): string;
5
+ export declare function matchResultToString(matchResult: MatchResult<any>, indent: string): any;
@@ -0,0 +1,24 @@
1
+ import { Matcher } from './Matcher';
2
+ export type Expected<T> = T | Matcher<T>;
3
+ export type MatchResultNested = {
4
+ actualKey?: null | string | number;
5
+ expectedKey?: null | string | number;
6
+ result: MatchResult<any>;
7
+ };
8
+ export type MatchResult<T> = {
9
+ actual: T;
10
+ expected: Expected<T>;
11
+ result: boolean;
12
+ cause?: null | string;
13
+ nested?: null | MatchResultNested[];
14
+ error?: null | Error;
15
+ };
16
+ export interface MatchResult2 {
17
+ result: boolean;
18
+ cause?: string | null;
19
+ nested?: MatchResultNested[] | null;
20
+ }
21
+ export type MatchResult3 = boolean | string | MatchResult2;
22
+ export declare class MatchInternalError extends Error {
23
+ constructor(message: string);
24
+ }
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../urlGet-BOGFUahf.js"),$=require("@flemist/async-utils"),M=require("@flemist/time-limits"),Ie=require("node:os"),ne=require("path"),J=require("@flemist/priority-queue"),Te=require("fs"),Fe=require("picomatch"),K=require("child_process"),Re=require("@flemist/abort-controller-fast");function ue(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const F=ue(ne),R=ue(Te),ee=new M.Pool(Ie.cpus().length);function B(e){return e.replace(/\\/g,"/")}let H=null;function _e(e){H==null&&(H=new Map);const t=B(e);let o=H.get(t);return o==null&&(o=new $.Locker,H.set(t,o)),o}function Ne(e){const{filePath:t,func:o}=e;return _e(t).lock(()=>M.poolRunWait({pool:ee,count:1,func:o}))}function fe(e){return e.match(/^[/\\]?[^/\\]+/)[0]}function he(e,t){return fe(e)+"|"+t.ino}function de(e){return e.endsWith(":")&&(e+="/"),F.resolve(e)}function ce(e,t){e.totalSize+=t.totalSize,e.maxFileDateModified=Math.max(e.maxFileDateModified,t.maxFileDateModified),e.countFiles+=t.countFiles,e.countDirs+=t.countDirs,e.countLinks+=t.countLinks}const me=function(t){return t.code==="ENOENT"};function ye(e){const t=e.paths;if(!t||t.length===0)return Promise.resolve({totalSize:0,maxFileDateModified:0,countFiles:0,countDirs:0,countLinks:0});const o=e.level??0,s=e.walkedIds??new Set,r=e.abortSignal,i=e.pool??ee,a=e.handleError,c=e.priority??J.priorityCreate(0),f=e.walkLinks??!1,l=e.log,E=e.handlePath,h=e.matchPath;async function w(d){if(!(a&&await a(d))&&!me(d))throw d}function j(d){return!(!l||l.minTotalContentSize!=null&&d<l.minTotalContentSize||l.maxNestedLevel!=null&&o>l.maxNestedLevel)}return $.useAbortController(async d=>{const g=$.combineAbortSignals(r,d),y={totalSize:0,maxFileDateModified:0,countFiles:0,countDirs:0,countLinks:0};function I(S,P){if(j(P.totalSize)){const b=`${P.totalSize.toLocaleString("en-US").replace(/,/g," ").padStart(19)}: ${S}`;l?.handleLog?l.handleLog(b):console.log(b)}}async function u(S,P,p,b){return E?await M.poolRunWait({pool:i,func:async()=>{try{return await E({level:o,path:S,stat:P,itemStat:p,totalStat:y,abortSignal:g})}catch(k){return await w(k),!1}},count:1,priority:b,abortSignal:g}):!0}async function O(S,P,p,b){b||(b=S);const k=await M.poolRunWait({pool:i,func:()=>R.promises.lstat(S).catch(w),count:1,priority:J.priorityCreate(P,J.priorityCreate(1,c)),abortSignal:g});if(!k||!p&&k.isFile())return null;const A=he(S,k);if(s.has(A))return null;s.add(A);let m={totalSize:k.size,maxFileDateModified:k.isDirectory()?0:k.mtimeMs,countFiles:0,countDirs:0,countLinks:0};const D=J.priorityCreate(P,J.priorityCreate(k.isDirectory()?2:3,c));if(k.isSymbolicLink()){if(f){const C=await M.poolRunWait({pool:i,func:()=>R.promises.readlink(S).catch(w).then(T=>T??null),count:1,priority:D,abortSignal:g});if(C){const T=F.isAbsolute(C)?C:F.resolve(F.dirname(b),C),_=await O(T,P,p,b);_&&(m=_)}}return(p||m.countFiles+m.countDirs+m.countLinks>=1)&&(m.countLinks+=1,await u(b,k,m,D)&&(ce(y,m),I(b,m))),m}else if(k.isDirectory()){const C=await M.poolRunWait({pool:i,func:()=>R.promises.readdir(S).catch(w),count:1,priority:c,abortSignal:g});if(C){for(let T=0,_=C.length;T<_;T++)C[T]=F.join(b,C[T]);m=await ye({...e,paths:C,abortSignal:g,priority:D,level:o+1,walkedIds:s})}}return(p||m.countFiles+m.countDirs+m.countLinks>=1)&&(k.isDirectory()?m.countDirs+=1:k.isFile()&&(m.countFiles+=1),await u(b,k,m,D)&&(ce(y,m),I(b,m))),m}const x=[];for(let S=0,P=t.length;S<P;S++){const p=de(t[S]),b=h?h(p):!0;b!==!1&&x.push(O(p,S,b))}return await Promise.all(x),y})}function We(e){return ye(e)}function Me({globs:e,rootDir:t,noCase:o}){const s=[];return e.forEach(r=>{r=B(r).trim();const i=r.startsWith("^");i&&(r=r.substring(1).trim());const a=r.startsWith("!");if(a&&(r=r.substring(1).trim()),r.startsWith("!")||r.startsWith("^"))throw new Error(`Invalid glob pattern: "${r}". The syntax '${r.substring(0,2)}' is not supported. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class), ! (negate pattern), ^ (exclude if included). Examples of valid patterns: "*.js", "src/**/*.ts", "!node_modules", "^dist". Avoid starting with '!' after '^' or multiple special prefixes.`);r.startsWith("/")&&(r="."+r);const c=B(t?F.resolve(t,r):r);if(!c)return;let f;try{f=Fe(c,{nocase:o??!1,dot:!0,strictBrackets:!0})}catch(l){throw new Error(`Invalid glob pattern: "${r}". ${l instanceof Error?l.message:"Unknown error"}. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class with balanced brackets), ! (negate pattern), ^ (exclude if included). Examples: "*.js", "src/**/*.ts", "!node_modules", "[abc]def.txt". Ensure all brackets [ ] are properly closed and balanced.`)}s.push({exclude:i,negative:a,debugInfo:c,match:f})}),function(i){i=B(i);let a=null,c=!1;for(let f=0,l=s.length;f<l;f++){const E=s[f];E.match(i)&&(E.exclude?c=!E.negative:(a=!E.negative,c=!1))}return c?!1:a}}function pe(e){const t=e.startsWith("!");return t&&(e=e.substring(1)),e.startsWith("/")?e=e.substring(1):!e.startsWith("**")&&!e.startsWith("../")&&(e=`**/${e}`),t&&(e="!"+e),e}function we(e,t){if(!t||t===".")return e;const o=e.startsWith("^");o&&(e=e.substring(1));const s=e.startsWith("!");return s&&(e=e.substring(1)),e.startsWith("/")?(t.endsWith("/")&&(t=t.substring(0,t.length-1)),e=t+e):(t.endsWith("/")||(t+="/"),e.startsWith("./")?e=t+e.substring(2):e.startsWith("../")?e=t+e:(t.startsWith("..")&&(t=""),e.startsWith("**")?e=t+e:e=t+"**/"+e)),e=B(F.normalize(e)),s&&(e="!"+e),o&&(e="^"+e),e}function le(e){return"^"+e}async function ge(e){const o=(await R.promises.readFile(e,"utf-8")).split(`
2
- `),s=[];return o.forEach(r=>{r=r.trim(),!(!r||r.startsWith("#"))&&s.push(r)}),s}async function Be(e){const t=e.rootDir??".",o=[];if(!e.globs?.length)return o;const s=[];return e.globs.forEach(r=>{r.value&&(r.valueType==="file-contains-patterns"?s.push(r):r.valueType==="pattern"&&o.push(r.exclude?le(r.value):r.value))}),s.length&&await Promise.all(s.map(async r=>{await M.poolRunWait({pool:ee,count:1,func:async()=>{const i=F.resolve(t,r.value),a=await ge(i),c=F.relative(t,F.dirname(i));a.forEach(f=>{f=pe(f),f=we(f,c),o.push(r.exclude?le(f):f)})}})})),o}function be(e,t={}){return new Promise((o,s)=>{const r=K.spawn(e,{shell:!0,...t}),i=[];r.stdout.on("data",a=>{i.push(a)}),r.on("error",a=>{s(a)}),r.on("exit",a=>{const c=Buffer.concat(i).toString("utf8");if(a!==0){s(new Error(`[exec][exit] code: ${a}`));return}o(c)})})}async function $e(){let e;switch(process.platform){case"darwin":e=K.spawn("afplay",["/System/Library/Sounds/Ping.aiff"],{stdio:"ignore"});break;case"linux":e=K.spawn("beep",[],{stdio:"ignore",shell:!0});break;case"win32":e=K.spawn("powershell",["-c","[console]::beep(1000,300)"],{stdio:"ignore"});break;default:throw new Error(`[nodeBeep] Beep not supported on platform: ${process.platform}`)}await new Promise((t,o)=>{e.on("error",o),e.on("close",s=>{s!==0?o(new Error(`[nodeBeep] Beep process exited with code ${s}`)):t()})})}async function Se({page:e,urlFilters:t,timeouts:o}){return o||(o={}),o.downloadInternal||(o.downloadInternal=10*1e3),o.downloadExternal||(o.downloadExternal=60*1e3),o.total||(o.total=300*1e3),await n.withTimeout(()=>e.evaluate(({urlFilters:r,timeouts:i})=>{function a(l){return function(h){let w=!1;for(let j=0,d=l.length;j<d;j++){const g=l[j];g.pattern.test(h)&&(w=g.value)}return w}}const c=r&&a(r);let f=performance.getEntries&&performance.getEntries();return f||(f=[]),f.push({name:location.href}),Promise.all(f.map(l=>{if(l.entryType!=null&&l.entryType!=="resource"||c&&!c(l.name))return null;if(l.responseStatus!=null)return l.responseStatus>=400?Promise.resolve({url:l.name,error:l.responseStatus}):null;if(navigator.userAgent.indexOf("Chrome")===-1)return null;const E=typeof AbortController<"u"?new AbortController:null,h=new URL(l.name).origin===location.origin,w=h?i.downloadInternal:i.downloadExternal;let j;const d=new Promise((u,O)=>{j=O}),g=w&&setTimeout(()=>{E?.abort(),j(new Error("[test][getPageHttpErrors] fetch timeout"))},w);let y=fetch(l.name,{mode:h?"same-origin":"no-cors",signal:E?.signal,cache:h?"force-cache":void 0,method:"HEAD"}).then(u=>u.ok?null:{url:l.name,error:u.status+" "+u.statusText}).catch(u=>({url:l.name,error:u.message}));E||(y=Promise.race([y,d]));function I(){g&&clearTimeout(g)}return y.then(u=>(I(),u),u=>{throw I(),u})})).then(l=>{const E=l.filter(h=>h).map(h=>({url:new URL(h.url),error:h.error}));return E.length>0?E:null})},{urlFilters:t,timeouts:o}),{timeout:o.total})}async function Ee({page:e,urlFilters:t,errorFilter:o}){let s=await Se({page:e,urlFilters:t});if(s&&(o&&(s=s.filter(o)),s.length>0))throw new Error(`[test][checkPageHttpErrors] Page has http errors: ${JSON.stringify(s,null,2)}`)}async function Oe({page:e,filter:t,onError:o}){const s="callback_191b355ea6f64499a6607ad571da5d4d",r=e.context().browser()?.browserType().name(),i=n.getStackTrace();function a(c){try{if(t&&!t({url:new URL(e.url()),error:c}))return}catch(f){c=String(f)}try{console.error(`[test][subscribeJsErrors] BROWSER JS ERROR (${r}): ${c}`);const f=new Error(c);f.stack=i,o(f)}catch(f){console.error("[test][subscribeJsErrors] error",f)}}await e.exposeFunction(s,a),await e.addInitScript(c=>{function f(h){if(Array.isArray(h))return h.map(f).join(`\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../urlGet-CerQ1cKh.js"),v=require("@flemist/async-utils"),W=require("@flemist/time-limits"),Te=require("node:os"),ne=require("path"),U=require("@flemist/priority-queue"),Re=require("fs"),De=require("picomatch"),K=require("child_process"),Le=require("@flemist/abort-controller-fast");function ue(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,s.get?s:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const D=ue(ne),L=ue(Re),ee=new W.Pool(Te.cpus().length);function B(e){return e.replace(/\\/g,"/")}let H=null;function Fe(e){H==null&&(H=new Map);const t=B(e);let o=H.get(t);return o==null&&(o=new v.Locker,H.set(t,o)),o}function Ne(e){const{filePath:t,func:o}=e;return Fe(t).lock(()=>W.poolRunWait({pool:ee,count:1,func:o}))}function fe(e){return e.match(/^[/\\]?[^/\\]+/)[0]}function he(e,t){return fe(e)+"|"+t.ino}function de(e){return e.endsWith(":")&&(e+="/"),D.resolve(e)}function ie(e,t){e.totalSize+=t.totalSize,e.maxFileDateModified=Math.max(e.maxFileDateModified,t.maxFileDateModified),e.countFiles+=t.countFiles,e.countDirs+=t.countDirs,e.countLinks+=t.countLinks}const me=function(t){return t.code==="ENOENT"};function ye(e){const t=e.paths;if(!t||t.length===0)return Promise.resolve({totalSize:0,maxFileDateModified:0,countFiles:0,countDirs:0,countLinks:0});const o=e.level??0,s=e.walkedIds??new Set,n=e.abortSignal,a=e.pool??ee,c=e.handleError,i=e.priority??U.priorityCreate(0),f=e.walkLinks??!1,l=e.log,E=e.handlePath,h=e.matchPath;async function w(d){if(!(c&&await c(d))&&!me(d))throw d}function P(d){return!(!l||l.minTotalContentSize!=null&&d<l.minTotalContentSize||l.maxNestedLevel!=null&&o>l.maxNestedLevel)}return v.useAbortController(async d=>{const g=v.combineAbortSignals(n,d),y={totalSize:0,maxFileDateModified:0,countFiles:0,countDirs:0,countLinks:0};function T(S,M){if(P(M.totalSize)){const b=`${M.totalSize.toLocaleString("en-US").replace(/,/g," ").padStart(19)}: ${S}`;l?.handleLog?l.handleLog(b):console.log(b)}}async function u(S,M,p,b){return E?await W.poolRunWait({pool:a,func:async()=>{try{return await E({level:o,path:S,stat:M,itemStat:p,totalStat:y,abortSignal:g})}catch(k){return await w(k),!1}},count:1,priority:b,abortSignal:g}):!0}async function O(S,M,p,b){b||(b=S);const k=await W.poolRunWait({pool:a,func:()=>L.promises.lstat(S).catch(w),count:1,priority:U.priorityCreate(M,U.priorityCreate(1,i)),abortSignal:g});if(!k||!p&&k.isFile())return null;const C=he(S,k);if(s.has(C))return null;s.add(C);let m={totalSize:k.size,maxFileDateModified:k.isDirectory()?0:k.mtimeMs,countFiles:0,countDirs:0,countLinks:0};const A=U.priorityCreate(M,U.priorityCreate(k.isDirectory()?2:3,i));if(k.isSymbolicLink()){if(f){const j=await W.poolRunWait({pool:a,func:()=>L.promises.readlink(S).catch(w).then(R=>R??null),count:1,priority:A,abortSignal:g});if(j){const R=D.isAbsolute(j)?j:D.resolve(D.dirname(b),j),F=await O(R,M,p,b);F&&(m=F)}}return(p||m.countFiles+m.countDirs+m.countLinks>=1)&&(m.countLinks+=1,await u(b,k,m,A)&&(ie(y,m),T(b,m))),m}else if(k.isDirectory()){const j=await W.poolRunWait({pool:a,func:()=>L.promises.readdir(S).catch(w),count:1,priority:i,abortSignal:g});if(j){for(let R=0,F=j.length;R<F;R++)j[R]=D.join(b,j[R]);m=await ye({...e,paths:j,abortSignal:g,priority:A,level:o+1,walkedIds:s})}}return(p||m.countFiles+m.countDirs+m.countLinks>=1)&&(k.isDirectory()?m.countDirs+=1:k.isFile()&&(m.countFiles+=1),await u(b,k,m,A)&&(ie(y,m),T(b,m))),m}const x=[];for(let S=0,M=t.length;S<M;S++){const p=de(t[S]),b=h?h(p):!0;b!==!1&&x.push(O(p,S,b))}return await Promise.all(x),y})}function _e(e){return ye(e)}function We({globs:e,rootDir:t,noCase:o}){const s=[];return e.forEach(n=>{n=B(n).trim();const a=n.startsWith("^");a&&(n=n.substring(1).trim());const c=n.startsWith("!");if(c&&(n=n.substring(1).trim()),n.startsWith("!")||n.startsWith("^"))throw new Error(`Invalid glob pattern: "${n}". The syntax '${n.substring(0,2)}' is not supported. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class), ! (negate pattern), ^ (exclude if included). Examples of valid patterns: "*.js", "src/**/*.ts", "!node_modules", "^dist". Avoid starting with '!' after '^' or multiple special prefixes.`);n.startsWith("/")&&(n="."+n);const i=B(t?D.resolve(t,n):n);if(!i)return;let f;try{f=De(i,{nocase:o??!1,dot:!0,strictBrackets:!0})}catch(l){throw new Error(`Invalid glob pattern: "${n}". ${l instanceof Error?l.message:"Unknown error"}. Valid glob patterns use: * (match any characters), ** (match any directories), ? (match single character), [abc] (character class with balanced brackets), ! (negate pattern), ^ (exclude if included). Examples: "*.js", "src/**/*.ts", "!node_modules", "[abc]def.txt". Ensure all brackets [ ] are properly closed and balanced.`)}s.push({exclude:a,negative:c,debugInfo:i,match:f})}),function(a){a=B(a);let c=null,i=!1;for(let f=0,l=s.length;f<l;f++){const E=s[f];E.match(a)&&(E.exclude?i=!E.negative:(c=!E.negative,i=!1))}return i?!1:c}}function pe(e){const t=e.startsWith("!");return t&&(e=e.substring(1)),e.startsWith("/")?e=e.substring(1):!e.startsWith("**")&&!e.startsWith("../")&&(e=`**/${e}`),t&&(e="!"+e),e}function we(e,t){if(!t||t===".")return e;const o=e.startsWith("^");o&&(e=e.substring(1));const s=e.startsWith("!");return s&&(e=e.substring(1)),e.startsWith("/")?(t.endsWith("/")&&(t=t.substring(0,t.length-1)),e=t+e):(t.endsWith("/")||(t+="/"),e.startsWith("./")?e=t+e.substring(2):e.startsWith("../")?e=t+e:(t.startsWith("..")&&(t=""),e.startsWith("**")?e=t+e:e=t+"**/"+e)),e=B(D.normalize(e)),s&&(e="!"+e),o&&(e="^"+e),e}function le(e){return"^"+e}async function ge(e){const o=(await L.promises.readFile(e,"utf-8")).split(`
2
+ `),s=[];return o.forEach(n=>{n=n.trim(),!(!n||n.startsWith("#"))&&s.push(n)}),s}async function Be(e){const t=e.rootDir??".",o=[];if(!e.globs?.length)return o;const s=[];return e.globs.forEach(n=>{n.value&&(n.valueType==="file-contains-patterns"?s.push(n):n.valueType==="pattern"&&o.push(n.exclude?le(n.value):n.value))}),s.length&&await Promise.all(s.map(async n=>{await W.poolRunWait({pool:ee,count:1,func:async()=>{const a=D.resolve(t,n.value),c=await ge(a),i=D.relative(t,D.dirname(a));c.forEach(f=>{f=pe(f),f=we(f,i),o.push(n.exclude?le(f):f)})}})})),o}function be(e,t={}){return new Promise((o,s)=>{const n=K.spawn(e,{shell:!0,...t}),a=[];n.stdout.on("data",c=>{a.push(c)}),n.on("error",c=>{s(c)}),n.on("exit",c=>{const i=Buffer.concat(a).toString("utf8");if(c!==0){s(new Error(`[exec][exit] code: ${c}`));return}o(i)})})}async function ve(){let e;switch(process.platform){case"darwin":e=K.spawn("afplay",["/System/Library/Sounds/Ping.aiff"],{stdio:"ignore"});break;case"linux":e=K.spawn("beep",[],{stdio:"ignore",shell:!0});break;case"win32":e=K.spawn("powershell",["-c","[console]::beep(1000,300)"],{stdio:"ignore"});break;default:throw new Error(`[nodeBeep] Beep not supported on platform: ${process.platform}`)}await new Promise((t,o)=>{e.on("error",o),e.on("close",s=>{s!==0?o(new Error(`[nodeBeep] Beep process exited with code ${s}`)):t()})})}async function Se({page:e,urlFilters:t,timeouts:o}){return o||(o={}),o.downloadInternal||(o.downloadInternal=10*1e3),o.downloadExternal||(o.downloadExternal=60*1e3),o.total||(o.total=300*1e3),await r.withTimeout(()=>e.evaluate(({urlFilters:n,timeouts:a})=>{function c(l){return function(h){let w=!1;for(let P=0,d=l.length;P<d;P++){const g=l[P];g.pattern.test(h)&&(w=g.value)}return w}}const i=n&&c(n);let f=performance.getEntries&&performance.getEntries();return f||(f=[]),f.push({name:location.href}),Promise.all(f.map(l=>{if(l.entryType!=null&&l.entryType!=="resource"||i&&!i(l.name))return null;if(l.responseStatus!=null)return l.responseStatus>=400?Promise.resolve({url:l.name,error:l.responseStatus}):null;if(navigator.userAgent.indexOf("Chrome")===-1)return null;const E=typeof AbortController<"u"?new AbortController:null,h=new URL(l.name).origin===location.origin,w=h?a.downloadInternal:a.downloadExternal;let P;const d=new Promise((u,O)=>{P=O}),g=w&&setTimeout(()=>{E?.abort(),P(new Error("[test][getPageHttpErrors] fetch timeout"))},w);let y=fetch(l.name,{mode:h?"same-origin":"no-cors",signal:E?.signal,cache:h?"force-cache":void 0,method:"HEAD"}).then(u=>u.ok?null:{url:l.name,error:u.status+" "+u.statusText}).catch(u=>({url:l.name,error:u.message}));E||(y=Promise.race([y,d]));function T(){g&&clearTimeout(g)}return y.then(u=>(T(),u),u=>{throw T(),u})})).then(l=>{const E=l.filter(h=>h).map(h=>({url:new URL(h.url),error:h.error}));return E.length>0?E:null})},{urlFilters:t,timeouts:o}),{timeout:o.total})}async function Ee({page:e,urlFilters:t,errorFilter:o}){let s=await Se({page:e,urlFilters:t});if(s&&(o&&(s=s.filter(o)),s.length>0))throw new Error(`[test][checkPageHttpErrors] Page has http errors: ${JSON.stringify(s,null,2)}`)}async function Oe({page:e,filter:t,onError:o}){const s="callback_191b355ea6f64499a6607ad571da5d4d",n=e.context().browser()?.browserType().name(),a=r.getStackTrace();function c(i){try{if(t&&!t({url:new URL(e.url()),error:i}))return}catch(f){i=String(f)}try{console.error(`[test][subscribeJsErrors] BROWSER JS ERROR (${n}): ${i}`);const f=new Error(i);f.stack=a,o(f)}catch(f){console.error("[test][subscribeJsErrors] error",f)}}await e.exposeFunction(s,c),await e.addInitScript(i=>{function f(h){if(Array.isArray(h))return h.map(f).join(`\r
3
3
  \r
4
- `);if(h instanceof Error)return h.stack||h.toString();if(typeof h=="object"&&h!=null){const w=new Set;return JSON.stringify(h,(j,d)=>{if(typeof d=="object"&&d!=null){if(w.has(d))return"[Circular]";w.add(d)}return d},2)}return String(h)}function l(h){window[c](h)}const E={warn:console.warn.bind(console),error:console.error.bind(console)};console.warn=function(...w){return l("console.warn: "+f(w)),E.warn.apply(this,w)},console.error=function(...w){return l("console.error: "+f(w)),E.error.apply(this,w)},window.addEventListener("error",function(h){l("window error: "+(h.message||JSON.stringify(h)))},!0),window.addEventListener("unhandledrejection",function(h){l("window unhandledrejection: "+f(h.reason))},!0)},s)}async function xe(){try{process.platform==="win32"&&await be(`wmic process where "commandline like '%ms-playwright%' and not commandline like '%wmic.exe%' and priority != 4" CALL setpriority "idle"`)}catch(e){const t=e?.message?.trim();if(/exit code: 2147749890/.test(t))return;console.warn("[test][setPlaywrightPriorityLow] error: "+t)}}let V=null,te=null;function ze(e){te=e}function ke(){if(V)return;const e=te||(process.env.DELAY_ON_ERROR?parseInt(process.env.DELAY_ON_ERROR,10):0);if(te)return console.log(`[test][delayOnError] Delay on error: ${e} ms`),V=$.delay(e),V}function ve(){return V}async function Pe(e){const{page:t}=e,o=t.context().browser()?.browserType().name(),s=new Re.AbortControllerFast,r=$.combineAbortSignals(s.signal,e.abortSignal),i=c=>{let f=`Error in (${o}) ${t.url()}
4
+ `);if(h instanceof Error)return h.stack||h.toString();if(typeof h=="object"&&h!=null){const w=new Set;return JSON.stringify(h,(P,d)=>{if(typeof d=="object"&&d!=null){if(w.has(d))return"[Circular]";w.add(d)}return d},2)}return String(h)}function l(h){window[i](h)}const E={warn:console.warn.bind(console),error:console.error.bind(console)};console.warn=function(...w){return l("console.warn: "+f(w)),E.warn.apply(this,w)},console.error=function(...w){return l("console.error: "+f(w)),E.error.apply(this,w)},window.addEventListener("error",function(h){l("window error: "+(h.message||JSON.stringify(h)))},!0),window.addEventListener("unhandledrejection",function(h){l("window unhandledrejection: "+f(h.reason))},!0)},s)}async function xe(){try{process.platform==="win32"&&await be(`wmic process where "commandline like '%ms-playwright%' and not commandline like '%wmic.exe%' and priority != 4" CALL setpriority "idle"`)}catch(e){const t=e?.message?.trim();if(/exit code: 2147749890/.test(t))return;console.warn("[test][setPlaywrightPriorityLow] error: "+t)}}let V=null,te=null;function $e(e){te=e}function ke(){if(V)return;const e=te||(process.env.DELAY_ON_ERROR?parseInt(process.env.DELAY_ON_ERROR,10):0);if(te)return console.log(`[test][delayOnError] Delay on error: ${e} ms`),V=v.delay(e),V}function ze(){return V}async function Me(e){const{page:t}=e,o=t.context().browser()?.browserType().name(),s=new Le.AbortControllerFast,n=v.combineAbortSignals(s.signal,e.abortSignal),a=i=>{let f=`Error in (${o}) ${t.url()}
5
5
  `;e.pageFilePath&&(f+=` at _ (${ne.resolve(e.pageFilePath)}:0:0)
6
- `),c.stack=f+(c.stack||c.message),c.message=f+c.message,console.error("[test][initPage] error",c),s.abort(c)};return await Oe({page:t,filter:e.filters?.js?.filter,onError:i}),{abortSignal:r,checkErrors:async()=>{await Ee({page:t,urlFilters:e.filters?.http?.urlFilters,errorFilter:e.filters?.http?.errorFilter}),r.throwIfAborted()}}}async function Je({page:e,abortSignal:t,filters:o,func:s,pageFilePath:r}){const i=e.context().browser()?.browserType().name();try{const{abortSignal:a,checkErrors:c}=await Pe({page:e,abortSignal:t,filters:o,pageFilePath:r});await s({page:e,abortSignal:a,checkErrors:c}),await c()}catch(a){let c=`Error in (${i}) ${e.url()}
7
- `;throw r&&(c+=` at _ (${ne.resolve(r)}:0:0)
8
- `),a.stack=c+(a.stack||a.message),a.message=c+a.message,a}}function Ue({browserType:e,options:t}){return async function(s){const r=await e.launch(t??void 0);try{return await s(r)}finally{await r.close()}}}function Ge({browser:e,options:t}){return async function(s){const r=await e.newContext(t??void 0);await xe();try{const i=await s(r);return await r.close(),i}catch(i){const a=ke?.();throw a?(console.error("[test][useBrowserContext] error",i),a.finally(()=>r.close())):await r.close(),i}}}async function Q(e,t){const o=F.dirname(e);await R.promises.stat(o).catch(()=>null)||await R.promises.mkdir(o,{recursive:!0}),await R.promises.writeFile(e,JSON.stringify(t,null,4),{encoding:"utf-8"})}async function je(e){if(!await R.promises.stat(e).catch(()=>null))return null;const t=await R.promises.readFile(e,{encoding:"utf-8"});return JSON.parse(t)}const X="-",Z="+";function U(e,t,o){if(e===t)return null;if(Array.isArray(e)){if(Array.isArray(t)){let r=null;for(let i=0,a=Math.max(t.length,t.length);i<a;i++){const c=U(e[i],t[i],o);c!=null&&(r||(r=[]),r.push(c))}return r!=null&&o&&(r=o(e,t,r)),r}}else if(e instanceof Object&&t instanceof Object){let r=null;for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const a=U(e[i],t[i],o);a!=null&&(r||(r={}),r[i]=a)}for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&!Object.prototype.hasOwnProperty.call(e,i)){const a=U(e[i],t[i],o);a!=null&&(r||(r={}),r[i]=a)}return r!=null&&o&&(r=o(e,t,r)),r}let s={[X]:e,[Z]:t};return o&&(s=o(e,t,s)),s}function re(e){function t(u){return u.sort((O,x)=>O[0]>x[0]?1:-1).reduce((O,x)=>(O[x[0]]=x[1],O),{})}function o(u){return u.reduce((O,x)=>(O[x]=!0,O),{})}const s=e.filters&&e.filters.excludeAttrs&&o(e.filters.excludeAttrs),r=e.filters&&e.filters.fixAttrs,i=e.filters&&e.filters.fixStyles,a=e.filters&&e.filters.excludeStyles&&o(e.filters.excludeStyles),c=e.filters&&e.filters.fixTags,f=e.filters&&e.filters.excludeClasses,l=e.filters&&e.filters.excludeIds,E=e.filters&&e.filters.excludeSelectorClasses,h=e.filters&&e.filters.excludeSelectorIds;let w;if(e.filters&&e.filters.excludeSelectors&&e.filters.excludeSelectors.length>0){const u=Array.from(document.querySelectorAll(e.filters.excludeSelectors.join(",")));u.length>0&&(w=new Set(u))}function j(u,O,x,S){const P=getComputedStyle(u,O),p=[];for(let b=0,k=P.length;b<k;b++){const A=P[b];if(a&&a[A])continue;let m=P[A];if(m&&i)for(let D=0,C=i.length;D<C;D++)i[D].name.test(A)&&(m=m.replace(i[D].search,i[D].replace));(!x||x[A]!==m)&&(!S||S[A]===m)&&p.push([A,m])}return t(p)}function d(u,O,x){return{_:j(u,void 0,O&&O._,x&&x._),before:j(u,"before",O&&O.before,x&&x.before),after:j(u,"after",O&&O.after,x&&x.after)}}function g(u,O,x,S,P){for(let p=0,b=u.childNodes.length;p<b;p++){const k=u.childNodes[p];if(!k)throw new Error(`child is null; index=${p}; ${S}, ${u.className}\r
9
- You should wait js executions before test`);k instanceof Element&&y(k,O,x,S,P)}}function y(u,O,x,S,P){const p=P&&P[O.length];if(P&&!p||w&&w.has(u))return;let b=u.tagName&&u.tagName.toLowerCase();if(b==="head"&&(x=!1),c)for(let L=0,z=c.length;L<z;L++)b=b.replace(c[L].search,c[L].replace);if(p&&p.tag!==b)return;const k=[];for(let L=0,z=u.attributes.length;L<z;L++){const N=u.attributes.item(L);let W=N.name,q=N.value;if(W=W.toLowerCase(),W!=="class"&&!(s&&s[W])){if(r)for(let v=0,Le=r.length;v<Le;v++)r[v].name.test(W)&&(q=q.replace(r[v].search,r[v].replace));(!p||p.attrs&&p.attrs[W]===q)&&k.push([W,q])}}const A=[],m=[];for(let L=0,z=u.classList.length;L<z;L++){const N=u.classList.item(L);(!f||!f.test(N))&&A.push(N),(!E||!E.test(N))&&m.push(N)}const D=x?d(u,e.defaultStyle,p&&p.style):null,C=u.childElementCount?[]:null;u.id&&(!l||!l.test(u.id))&&u.id;const T=u.id&&(!h||!h.test(u.id))?u.id:"",_=(b||"")+(T?"#"+T:"")+(m.length>0?"."+m.join("."):""),ae=_?S?S+" > "+_:_:S,De={tag:b,selector:ae,classes:A,attrs:k.length>0?t(k):null,style:D,childs:C};O.push(De),C&&g(u,C,x,ae,p&&p.childs)}const I=[];return y(document.documentElement,I,!0,"",e.shouldEqualResult&&[e.shouldEqualResult]),I[0]}async function oe(e){const t=await e.context().newCDPSession(e);return await t.send("DOM.enable"),await t.send("CSS.enable"),t}async function se(e){await e.send("CSS.disable"),await e.send("DOM.disable"),await e.detach()}async function qe(e,t){const o=await oe(e);try{return await t(o)}finally{await se(o)}}async function Ce(e,t){const{nodes:o}=await e.send("DOM.getFlattenedDocument",{depth:-1,pierce:!0}),s=o.filter(r=>r.nodeType===1).map(r=>r.nodeId);for(const r of s)await e.send("CSS.forcePseudoState",{nodeId:r,forcedPseudoClasses:t})}function Y(e,t){if(!e||!t)return t||null;let o=null;for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&t[s]!==e[s]&&(o||(o={}),o[s]=t[s]);for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&!Object.prototype.hasOwnProperty.call(t,s)&&(o||(o={}),o[s]="");return o}function He(e,t){if(!e||!t)return t||null;const o=Y(e._,t._),s=Y(e.before,t.before),r=Y(e.after,t.after);return!o&&!s&&!r?null:{_:o||{},before:s||{},after:r||{}}}function Ke(e,t){if(!e||!t)return t||null;if(e.length!==t.length)return t;for(let o=0,s=e.length;o<s;o++)if(e[o]!==t[o])return t;return null}function ie(e,t){const o=Ke(e.classes,t.classes),s=Y(e.attrs,t.attrs),r=He(e.style,t.style);let i=null;if(e.childs&&t.childs){const a=Math.min(e.childs.length,t.childs.length);for(let c=0;c<a;c++){const f=ie(e.childs[c],t.childs[c]);if(f){if(!i){i=[];for(let l=0;l<a;l++)i.push({})}i[c]=f}}}return!o&&!s&&!r&&!i?null:{tag:t.tag,selector:t.selector,classes:o,attrs:s,style:r,childs:i}}const G=(e,t,o,s)=>{const r=s(e,t,o,s);if(r==null)return r;if(Array.isArray(r))return r.map((i,a,c)=>G(i,a,c,s));if(typeof r=="object"){const i={};for(const a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=G(r[a],a,r,s));return i}return r};function Ae(e,t){if(e.attrs&&t.excludeAttrs){for(let o=0,s=t.excludeAttrs.length;o<s;o++)delete e.attrs[t.excludeAttrs[o]];Object.keys(e.attrs).length===0&&(e.attrs=null)}if(e.classes&&t.excludeClasses&&(e.classes=e.classes.filter(o=>!t.excludeClasses.test(o))),e.style&&t.excludeStyles)for(const o of["_","before","after"]){const s=e.style[o];if(s)for(let r=0,i=t.excludeStyles.length;r<i;r++)delete s[t.excludeStyles[r]]}if(e.childs)for(let o=0,s=e.childs.length;o<s;o++)Ae(e.childs[o],t)}function Ve(e,t){for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;const s=e[o];for(const r in s){if(!Object.prototype.hasOwnProperty.call(s,r))continue;const i=s[r];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&Ae(i[a],t)}}}function Qe({actualResultFile:e,expectedResultFile:t,diffResultFile:o,filters:s,transform:r,pseudoStates:i}){let a,c,f,l={};return{async init(E){a=await je(t),r&&(a=G(a,null,null,r)),a&&s&&Ve(a,s),await E.goto("about:blank"),c=await E.evaluate(re,{filters:s}),f=c.style},async handlePage({page:E,testId:h,url:w,stateId:j,_filters:d}){let g=l[h];g||(g={},l[h]=g);let y=g[w.href];y||(y={},g[w.href]=y),await E.addStyleTag({content:"*, *::before, *::after { animation-name: none!important; transition-duration: 0s !important; }"});const I=i??[{states:[]}];let u=null,O;try{for(let x=0;x<I.length;x++){const S=I[x],P=S.states.length>0?j+":"+S.states.join(":"):j;let p=null;if(S.states.length>0){u||(u=await oe(E));const m=performance.now();await Ce(u,S.states),p=performance.now()-m}S.delay&&await $.delay(S.delay);const b=performance.now(),k=await E.evaluate(re,{filters:d||s,defaultStyle:f,shouldEqualResult:y[P]}),A=performance.now()-b;if(console.log(`SNAPSHOT ${P}:`+(p!=null?` forcePseudoClasses ${p.toFixed(0)}ms,`:"")+` getAllElements ${A.toFixed(0)}ms`),!O)O=k,y[P]=k;else{const m=ie(O,k);m&&(y[P]=m)}}}finally{u&&await se(u)}},async end({checkExistUrlsOnly:E}){if(l=n.getNormalizedObject(l),r&&(l=G(l,null,null,r)),a){let h,w;if(!E)h=a,w=l;else{h={},w={};for(const d in a)if(Object.prototype.hasOwnProperty.call(a,d)&&Object.prototype.hasOwnProperty.call(l,d)){h[d]={},w[d]={};for(const g in a[d])Object.prototype.hasOwnProperty.call(a[d],g)&&Object.prototype.hasOwnProperty.call(l[d],g)&&(h[d][g]=a[d][g],w[d][g]=l[d][g])}}const j=U(h,w,(d,g,y)=>y.selector&&(delete y.selector,Object.keys(y).length===0)?null:y.childs&&y.childs.length===1?y.childs[0]:(g&&g.selector?y[Z]?y[Z]=g.selector:y={selector:g.selector,...y}:d&&d.selector&&(y[X]?y[X]=d.selector:y={selector:d.selector,...y}),y));if(o&&await Q(o,j||{}),j)throw await Q(e,l),console.error("Pages elements changes: "+JSON.stringify(j,null,4).substring(0,5e3)),new Error("Pages elements changes detected");await R.promises.stat(e).catch(()=>null)&&await R.promises.unlink(e)}else await Q(t,l);return l}}}exports.ConsoleMessageLevel=n.ConsoleMessageLevel;exports.Lazy=n.Lazy;exports.LazyWithId=n.LazyWithId;exports.LogLevel=n.LogLevel;exports.Random=n.Random;exports.Subject=n.Subject;exports.SubjectWithId=n.SubjectWithId;exports.UNIQUE_PSEUDO_RANDOM_MAX_COUNT=n.UNIQUE_PSEUDO_RANDOM_MAX_COUNT;exports.alertConsole=n.alertConsole;exports.alertReplace=n.alertReplace;exports.check=n.check;exports.consoleIntercept=n.consoleIntercept;exports.consoleMessageToString=n.consoleMessageToString;exports.consoleReplace=n.consoleReplace;exports.convertTimeZone=n.convertTimeZone;exports.createTaskDelayRetry=n.createTaskDelayRetry;exports.createUniquePseudoRandom=n.createUniquePseudoRandom;exports.dateNowUnique=n.dateNowUnique;exports.deepCloneJsonLike=n.deepCloneJsonLike;exports.deepEqualJsonLike=n.deepEqualJsonLike;exports.deepEqualJsonLikeMap=n.deepEqualJsonLikeMap;exports.equalArray=n.equalArray;exports.escapeHtml=n.escapeHtml;exports.escapeRegExp=n.escapeRegExp;exports.fixStackTrace=n.fixStackTrace;exports.formatAny=n.formatAny;exports.formatDate=n.formatDate;exports.formatDateFileName=n.formatDateFileName;exports.getConsoleMessages=n.getConsoleMessages;exports.getDateInet=n.getDateInet;exports.getNormalizedObject=n.getNormalizedObject;exports.getRandomFunc=n.getRandomFunc;exports.getRandomSeed=n.getRandomSeed;exports.getStackTrace=n.getStackTrace;exports.isObservable=n.isObservable;exports.match=n.match;exports.matchAnd=n.matchAnd;exports.matchAndPipe=n.matchAndPipe;exports.matchAny=n.matchAny;exports.matchArray=n.matchArray;exports.matchArrayBuffer=n.matchArrayBuffer;exports.matchArrayIncludes=n.matchArrayIncludes;exports.matchArrayItem=n.matchArrayItem;exports.matchArrayLength=n.matchArrayLength;exports.matchArrayWith=n.matchArrayWith;exports.matchBoolean=n.matchBoolean;exports.matchConstructor=n.matchConstructor;exports.matchConvert=n.matchConvert;exports.matchCustom=n.matchCustom;exports.matchDeep=n.matchDeep;exports.matchEnum=n.matchEnum;exports.matchFloat=n.matchFloat;exports.matchIn=n.matchIn;exports.matchInstanceOf=n.matchInstanceOf;exports.matchInt=n.matchInt;exports.matchIntDate=n.matchIntDate;exports.matchIs=n.matchIs;exports.matchIsNonStrict=n.matchIsNonStrict;exports.matchNever=n.matchNever;exports.matchNot=n.matchNot;exports.matchNotNullish=n.matchNotNullish;exports.matchNullish=n.matchNullish;exports.matchNumber=n.matchNumber;exports.matchObject=n.matchObject;exports.matchObjectEntries=n.matchObjectEntries;exports.matchObjectEntry=n.matchObjectEntry;exports.matchObjectKey=n.matchObjectKey;exports.matchObjectKeyValue=n.matchObjectKeyValue;exports.matchObjectKeys=n.matchObjectKeys;exports.matchObjectKeysNotNull=n.matchObjectKeysNotNull;exports.matchObjectPartial=n.matchObjectPartial;exports.matchObjectValue=n.matchObjectValue;exports.matchObjectValues=n.matchObjectValues;exports.matchObjectWith=n.matchObjectWith;exports.matchOptional=n.matchOptional;exports.matchOr=n.matchOr;exports.matchOrPipe=n.matchOrPipe;exports.matchRange=n.matchRange;exports.matchRangeDate=n.matchRangeDate;exports.matchRef=n.matchRef;exports.matchString=n.matchString;exports.matchStringLength=n.matchStringLength;exports.matchTypeOf=n.matchTypeOf;exports.matchUuid=n.matchUuid;exports.matchValueState=n.matchValueState;exports.max=n.max;exports.min=n.min;exports.minMax=n.minMax;exports.numberMod=n.numberMod;exports.randomBoolean=n.randomBoolean;exports.randomEnum=n.randomEnum;exports.randomFloat=n.randomFloat;exports.randomIndexWeighted=n.randomIndexWeighted;exports.randomInt=n.randomInt;exports.randomItem=n.randomItem;exports.randomItems=n.randomItems;exports.setFuncName=n.setFuncName;exports.sha256=n.sha256;exports.sha256Buffer=n.sha256Buffer;exports.timeoutAbortController=n.timeoutAbortController;exports.toHex=n.toHex;exports.truncateString=n.truncateString;exports.urlGetBoolean=n.urlGetBoolean;exports.urlGetFloat=n.urlGetFloat;exports.urlGetInt=n.urlGetInt;exports.urlGetParams=n.urlGetParams;exports.urlGetString=n.urlGetString;exports.urlParamToBoolean=n.urlParamToBoolean;exports.urlParamToFloat=n.urlParamToFloat;exports.urlParamToInt=n.urlParamToInt;exports.waitObservable=n.waitObservable;exports.withConsoleReplace=n.withConsoleReplace;exports.withRetry=n.withRetry;exports.withTimeout=n.withTimeout;exports.DIFF_NEW=Z;exports.DIFF_OLD=X;exports.checkPageHttpErrors=Ee;exports.createCDPSession=oe;exports.createMatchPath=Me;exports.createPagesElementsChangesTest=Qe;exports.delayOnErrorCall=ke;exports.delayOnErrorSet=ze;exports.delayOnErrorWait=ve;exports.destroyCDPSession=se;exports.exec=be;exports.fileLock=Ne;exports.forcePseudoClasses=Ce;exports.getAllElements=re;exports.getDrive=fe;exports.getElementsStyleDiff=ie;exports.getFileId=he;exports.getObjectsDiff=U;exports.getPageHttpErrors=Se;exports.globGitIgnoreToPicomatch=pe;exports.globToRelative=we;exports.initPage=Pe;exports.loadGlobs=Be;exports.loadGlobsFromFile=ge;exports.loadJson=je;exports.nodeBeep=$e;exports.objectTransform=G;exports.pathNormalize=B;exports.pathResolve=de;exports.poolFs=ee;exports.saveJson=Q;exports.setPlaywrightPriorityLow=xe;exports.subscribeJsErrors=Oe;exports.testPage=Je;exports.useBrowser=Ue;exports.useBrowserContext=Ge;exports.usingCDPSession=qe;exports.walkPathHandleErrorDefault=me;exports.walkPaths=We;
6
+ `),i.stack=f+(i.stack||i.message),i.message=f+i.message,console.error("[test][initPage] error",i),s.abort(i)};return await Oe({page:t,filter:e.filters?.js?.filter,onError:a}),{abortSignal:n,checkErrors:async()=>{await Ee({page:t,urlFilters:e.filters?.http?.urlFilters,errorFilter:e.filters?.http?.errorFilter}),n.throwIfAborted()}}}async function Ue({page:e,abortSignal:t,filters:o,func:s,pageFilePath:n}){const a=e.context().browser()?.browserType().name();try{const{abortSignal:c,checkErrors:i}=await Me({page:e,abortSignal:t,filters:o,pageFilePath:n});await s({page:e,abortSignal:c,checkErrors:i}),await i()}catch(c){let i=`Error in (${a}) ${e.url()}
7
+ `;throw n&&(i+=` at _ (${ne.resolve(n)}:0:0)
8
+ `),c.stack=i+(c.stack||c.message),c.message=i+c.message,c}}function Je({browserType:e,options:t}){return async function(s){const n=await e.launch(t??void 0);try{return await s(n)}finally{await n.close()}}}function Ge({browser:e,options:t}){return async function(s){const n=await e.newContext(t??void 0);await xe();try{const a=await s(n);return await n.close(),a}catch(a){const c=ke?.();throw c?(console.error("[test][useBrowserContext] error",a),c.finally(()=>n.close())):await n.close(),a}}}async function X(e,t){const o=D.dirname(e);await L.promises.stat(o).catch(()=>null)||await L.promises.mkdir(o,{recursive:!0}),await L.promises.writeFile(e,JSON.stringify(t,null,4),{encoding:"utf-8"})}async function Pe(e){if(!await L.promises.stat(e).catch(()=>null))return null;const t=await L.promises.readFile(e,{encoding:"utf-8"});return JSON.parse(t)}const Y="-",Z="+";function J(e,t,o){if(e===t)return null;if(Array.isArray(e)){if(Array.isArray(t)){let n=null;for(let a=0,c=Math.max(t.length,t.length);a<c;a++){const i=J(e[a],t[a],o);i!=null&&(n||(n=[]),n.push(i))}return n!=null&&o&&(n=o(e,t,n)),n}}else if(e instanceof Object&&t instanceof Object){let n=null;for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)){const c=J(e[a],t[a],o);c!=null&&(n||(n={}),n[a]=c)}for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&!Object.prototype.hasOwnProperty.call(e,a)){const c=J(e[a],t[a],o);c!=null&&(n||(n={}),n[a]=c)}return n!=null&&o&&(n=o(e,t,n)),n}let s={[Y]:e,[Z]:t};return o&&(s=o(e,t,s)),s}function re(e){function t(u){return u.sort((O,x)=>O[0]>x[0]?1:-1).reduce((O,x)=>(O[x[0]]=x[1],O),{})}function o(u){return u.reduce((O,x)=>(O[x]=!0,O),{})}const s=e.filters&&e.filters.excludeAttrs&&o(e.filters.excludeAttrs),n=e.filters&&e.filters.fixAttrs,a=e.filters&&e.filters.fixStyles,c=e.filters&&e.filters.excludeStyles&&o(e.filters.excludeStyles),i=e.filters&&e.filters.fixTags,f=e.filters&&e.filters.excludeClasses,l=e.filters&&e.filters.excludeIds,E=e.filters&&e.filters.excludeSelectorClasses,h=e.filters&&e.filters.excludeSelectorIds;let w;if(e.filters&&e.filters.excludeSelectors&&e.filters.excludeSelectors.length>0){const u=Array.from(document.querySelectorAll(e.filters.excludeSelectors.join(",")));u.length>0&&(w=new Set(u))}function P(u,O,x,S){const M=getComputedStyle(u,O),p=[];for(let b=0,k=M.length;b<k;b++){const C=M[b];if(c&&c[C])continue;let m=M[C];if(m&&a)for(let A=0,j=a.length;A<j;A++)a[A].name.test(C)&&(m=m.replace(a[A].search,a[A].replace));(!x||x[C]!==m)&&(!S||S[C]===m)&&p.push([C,m])}return t(p)}function d(u,O,x){return{_:P(u,void 0,O&&O._,x&&x._),before:P(u,"before",O&&O.before,x&&x.before),after:P(u,"after",O&&O.after,x&&x.after)}}function g(u,O,x,S,M){for(let p=0,b=u.childNodes.length;p<b;p++){const k=u.childNodes[p];if(!k)throw new Error(`child is null; index=${p}; ${S}, ${u.className}\r
9
+ You should wait js executions before test`);k instanceof Element&&y(k,O,x,S,M)}}function y(u,O,x,S,M){const p=M&&M[O.length];if(M&&!p||w&&w.has(u))return;let b=u.tagName&&u.tagName.toLowerCase();if(b==="head"&&(x=!1),i)for(let I=0,$=i.length;I<$;I++)b=b.replace(i[I].search,i[I].replace);if(p&&p.tag!==b)return;const k=[];for(let I=0,$=u.attributes.length;I<$;I++){const N=u.attributes.item(I);let _=N.name,q=N.value;if(_=_.toLowerCase(),_!=="class"&&!(s&&s[_])){if(n)for(let z=0,Ie=n.length;z<Ie;z++)n[z].name.test(_)&&(q=q.replace(n[z].search,n[z].replace));(!p||p.attrs&&p.attrs[_]===q)&&k.push([_,q])}}const C=[],m=[];for(let I=0,$=u.classList.length;I<$;I++){const N=u.classList.item(I);(!f||!f.test(N))&&C.push(N),(!E||!E.test(N))&&m.push(N)}const A=x?d(u,e.defaultStyle,p&&p.style):null,j=u.childElementCount?[]:null;u.id&&(!l||!l.test(u.id))&&u.id;const R=u.id&&(!h||!h.test(u.id))?u.id:"",F=(b||"")+(R?"#"+R:"")+(m.length>0?"."+m.join("."):""),ce=F?S?S+" > "+F:F:S,Ae={tag:b,selector:ce,classes:C,attrs:k.length>0?t(k):null,style:A,childs:j};O.push(Ae),j&&g(u,j,x,ce,p&&p.childs)}const T=[];return y(document.documentElement,T,!0,"",e.shouldEqualResult&&[e.shouldEqualResult]),T[0]}async function oe(e){const t=await e.context().newCDPSession(e);return await t.send("DOM.enable"),await t.send("CSS.enable"),t}async function se(e){await e.send("CSS.disable"),await e.send("DOM.disable"),await e.detach()}async function qe(e,t){const o=await oe(e);try{return await t(o)}finally{await se(o)}}async function je(e,t){const{nodes:o}=await e.send("DOM.getFlattenedDocument",{depth:-1,pierce:!0}),s=o.filter(n=>n.nodeType===1).map(n=>n.nodeId);for(const n of s)await e.send("CSS.forcePseudoState",{nodeId:n,forcedPseudoClasses:t})}function Q(e,t){if(!e||!t)return t||null;let o=null;for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&t[s]!==e[s]&&(o||(o={}),o[s]=t[s]);for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&!Object.prototype.hasOwnProperty.call(t,s)&&(o||(o={}),o[s]="");return o}function He(e,t){if(!e||!t)return t||null;const o=Q(e._,t._),s=Q(e.before,t.before),n=Q(e.after,t.after);return!o&&!s&&!n?null:{_:o||{},before:s||{},after:n||{}}}function Ke(e,t){if(!e||!t)return t||null;if(e.length!==t.length)return t;for(let o=0,s=e.length;o<s;o++)if(e[o]!==t[o])return t;return null}function ae(e,t){const o=Ke(e.classes,t.classes),s=Q(e.attrs,t.attrs),n=He(e.style,t.style);let a=null;if(e.childs&&t.childs){const c=Math.min(e.childs.length,t.childs.length);for(let i=0;i<c;i++){const f=ae(e.childs[i],t.childs[i]);if(f){if(!a){a=[];for(let l=0;l<c;l++)a.push({})}a[i]=f}}}return!o&&!s&&!n&&!a?null:{tag:t.tag,selector:t.selector,classes:o,attrs:s,style:n,childs:a}}const G=(e,t,o,s)=>{const n=s(e,t,o,s);if(n==null)return n;if(Array.isArray(n))return n.map((a,c,i)=>G(a,c,i,s));if(typeof n=="object"){const a={};for(const c in n)Object.prototype.hasOwnProperty.call(n,c)&&(a[c]=G(n[c],c,n,s));return a}return n};function Ce(e,t){if(e.attrs&&t.excludeAttrs){for(let o=0,s=t.excludeAttrs.length;o<s;o++)delete e.attrs[t.excludeAttrs[o]];Object.keys(e.attrs).length===0&&(e.attrs=null)}if(e.classes&&t.excludeClasses&&(e.classes=e.classes.filter(o=>!t.excludeClasses.test(o))),e.style&&t.excludeStyles)for(const o of["_","before","after"]){const s=e.style[o];if(s)for(let n=0,a=t.excludeStyles.length;n<a;n++)delete s[t.excludeStyles[n]]}if(e.childs)for(let o=0,s=e.childs.length;o<s;o++)Ce(e.childs[o],t)}function Ve(e,t){for(const o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;const s=e[o];for(const n in s){if(!Object.prototype.hasOwnProperty.call(s,n))continue;const a=s[n];for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&Ce(a[c],t)}}}function Xe({actualResultFile:e,expectedResultFile:t,diffResultFile:o,filters:s,transform:n,pseudoStates:a}){let c,i,f,l={};return{async init(E){c=await Pe(t),n&&(c=G(c,null,null,n)),c&&s&&Ve(c,s),await E.goto("about:blank"),i=await E.evaluate(re,{filters:s}),f=i.style},async handlePage({page:E,testId:h,url:w,stateId:P,_filters:d}){let g=l[h];g||(g={},l[h]=g);let y=g[w.href];y||(y={},g[w.href]=y),await E.addStyleTag({content:"*, *::before, *::after { animation-name: none!important; transition-duration: 0s !important; }"});const T=a??[{states:[]}];let u=null,O;try{for(let x=0;x<T.length;x++){const S=T[x],M=S.states.length>0?P+":"+S.states.join(":"):P;let p=null;if(S.states.length>0){u||(u=await oe(E));const m=performance.now();await je(u,S.states),p=performance.now()-m}S.delay&&await v.delay(S.delay);const b=performance.now(),k=await E.evaluate(re,{filters:d||s,defaultStyle:f,shouldEqualResult:y[M]}),C=performance.now()-b;if(console.log(`SNAPSHOT ${M}:`+(p!=null?` forcePseudoClasses ${p.toFixed(0)}ms,`:"")+` getAllElements ${C.toFixed(0)}ms`),!O)O=k,y[M]=k;else{const m=ae(O,k);m&&(y[M]=m)}}}finally{u&&await se(u)}},async end({checkExistUrlsOnly:E}){if(l=r.getNormalizedObject(l),n&&(l=G(l,null,null,n)),c){let h,w;if(!E)h=c,w=l;else{h={},w={};for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d)&&Object.prototype.hasOwnProperty.call(l,d)){h[d]={},w[d]={};for(const g in c[d])Object.prototype.hasOwnProperty.call(c[d],g)&&Object.prototype.hasOwnProperty.call(l[d],g)&&(h[d][g]=c[d][g],w[d][g]=l[d][g])}}const P=J(h,w,(d,g,y)=>y.selector&&(delete y.selector,Object.keys(y).length===0)?null:y.childs&&y.childs.length===1?y.childs[0]:(g&&g.selector?y[Z]?y[Z]=g.selector:y={selector:g.selector,...y}:d&&d.selector&&(y[Y]?y[Y]=d.selector:y={selector:d.selector,...y}),y));if(o&&await X(o,P||{}),P)throw await X(e,l),console.error("Pages elements changes: "+JSON.stringify(P,null,4).substring(0,5e3)),new Error("Pages elements changes detected");await L.promises.stat(e).catch(()=>null)&&await L.promises.unlink(e)}else await X(t,l);return l}}}exports.CheckError=r.CheckError;exports.ConsoleMessageLevel=r.ConsoleMessageLevel;exports.Lazy=r.Lazy;exports.LazyWithId=r.LazyWithId;exports.LogLevel=r.LogLevel;exports.MAX_REPORT_ITEMS_DEFAULT=r.MAX_REPORT_ITEMS_DEFAULT;exports.MatchInternalError=r.MatchInternalError;exports.Matcher=r.Matcher;exports.MatcherAny=r.MatcherAny;exports.MatcherArray=r.MatcherArray;exports.MatcherArrayItem=r.MatcherArrayItem;exports.MatcherConvert=r.MatcherConvert;exports.MatcherCustom=r.MatcherCustom;exports.MatcherFew=r.MatcherFew;exports.MatcherIn=r.MatcherIn;exports.MatcherInstanceOf=r.MatcherInstanceOf;exports.MatcherIs=r.MatcherIs;exports.MatcherNever=r.MatcherNever;exports.MatcherNot=r.MatcherNot;exports.MatcherNumber=r.MatcherNumber;exports.MatcherObject=r.MatcherObject;exports.MatcherObjectEntry=r.MatcherObjectEntry;exports.MatcherRef=r.MatcherRef;exports.MatcherString=r.MatcherString;exports.Random=r.Random;exports.Subject=r.Subject;exports.SubjectWithId=r.SubjectWithId;exports.UNIQUE_PSEUDO_RANDOM_MAX_COUNT=r.UNIQUE_PSEUDO_RANDOM_MAX_COUNT;exports.alertConsole=r.alertConsole;exports.alertReplace=r.alertReplace;exports.argsToString=r.argsToString;exports.check=r.check;exports.checkFunc=r.checkFunc;exports.consoleIntercept=r.consoleIntercept;exports.consoleMessageToString=r.consoleMessageToString;exports.consoleReplace=r.consoleReplace;exports.convertTimeZone=r.convertTimeZone;exports.createMatchResult=r.createMatchResult;exports.createMatchResultBoolean=r.createMatchResultBoolean;exports.createMatchResultError=r.createMatchResultError;exports.createTaskDelayRetry=r.createTaskDelayRetry;exports.createUniquePseudoRandom=r.createUniquePseudoRandom;exports.dateNowUnique=r.dateNowUnique;exports.deepCloneJsonLike=r.deepCloneJsonLike;exports.deepEqualJsonLike=r.deepEqualJsonLike;exports.deepEqualJsonLikeMap=r.deepEqualJsonLikeMap;exports.equalArray=r.equalArray;exports.escapeHtml=r.escapeHtml;exports.escapeRegExp=r.escapeRegExp;exports.expectedToString=r.expectedToString;exports.filterMatchResult=r.filterMatchResult;exports.filterMatchResultNested=r.filterMatchResultNested;exports.fixStackTrace=r.fixStackTrace;exports.formatAny=r.formatAny;exports.formatDate=r.formatDate;exports.formatDateFileName=r.formatDateFileName;exports.getConsoleMessages=r.getConsoleMessages;exports.getDateInet=r.getDateInet;exports.getNormalizedObject=r.getNormalizedObject;exports.getObjectId=r.getObjectId;exports.getRandomFunc=r.getRandomFunc;exports.getRandomSeed=r.getRandomSeed;exports.getStackTrace=r.getStackTrace;exports.isMatcher=r.isMatcher;exports.isObservable=r.isObservable;exports.match=r.match;exports.matchAnd=r.matchAnd;exports.matchAndPipe=r.matchAndPipe;exports.matchAny=r.matchAny;exports.matchArray=r.matchArray;exports.matchArrayBuffer=r.matchArrayBuffer;exports.matchArrayIncludes=r.matchArrayIncludes;exports.matchArrayItem=r.matchArrayItem;exports.matchArrayLength=r.matchArrayLength;exports.matchArrayWith=r.matchArrayWith;exports.matchBoolean=r.matchBoolean;exports.matchConstructor=r.matchConstructor;exports.matchConvert=r.matchConvert;exports.matchCustom=r.matchCustom;exports.matchDeep=r.matchDeep;exports.matchEnum=r.matchEnum;exports.matchFloat=r.matchFloat;exports.matchIn=r.matchIn;exports.matchInstanceOf=r.matchInstanceOf;exports.matchInt=r.matchInt;exports.matchIntDate=r.matchIntDate;exports.matchIs=r.matchIs;exports.matchIsNonStrict=r.matchIsNonStrict;exports.matchNever=r.matchNever;exports.matchNot=r.matchNot;exports.matchNotNullish=r.matchNotNullish;exports.matchNullish=r.matchNullish;exports.matchNumber=r.matchNumber;exports.matchObject=r.matchObject;exports.matchObjectEntries=r.matchObjectEntries;exports.matchObjectEntry=r.matchObjectEntry;exports.matchObjectKey=r.matchObjectKey;exports.matchObjectKeyValue=r.matchObjectKeyValue;exports.matchObjectKeys=r.matchObjectKeys;exports.matchObjectKeysNotNull=r.matchObjectKeysNotNull;exports.matchObjectPartial=r.matchObjectPartial;exports.matchObjectValue=r.matchObjectValue;exports.matchObjectValues=r.matchObjectValues;exports.matchObjectWith=r.matchObjectWith;exports.matchOptional=r.matchOptional;exports.matchOr=r.matchOr;exports.matchOrPipe=r.matchOrPipe;exports.matchRange=r.matchRange;exports.matchRangeDate=r.matchRangeDate;exports.matchRef=r.matchRef;exports.matchResultNestedToString=r.matchResultNestedToString;exports.matchResultToString=r.matchResultToString;exports.matchString=r.matchString;exports.matchStringLength=r.matchStringLength;exports.matchTypeOf=r.matchTypeOf;exports.matchUuid=r.matchUuid;exports.matchValueState=r.matchValueState;exports.max=r.max;exports.min=r.min;exports.minMax=r.minMax;exports.numberMod=r.numberMod;exports.randomBoolean=r.randomBoolean;exports.randomEnum=r.randomEnum;exports.randomFloat=r.randomFloat;exports.randomIndexWeighted=r.randomIndexWeighted;exports.randomInt=r.randomInt;exports.randomItem=r.randomItem;exports.randomItems=r.randomItems;exports.setFuncName=r.setFuncName;exports.sha256=r.sha256;exports.sha256Buffer=r.sha256Buffer;exports.timeoutAbortController=r.timeoutAbortController;exports.toHex=r.toHex;exports.truncateString=r.truncateString;exports.urlGetBoolean=r.urlGetBoolean;exports.urlGetFloat=r.urlGetFloat;exports.urlGetInt=r.urlGetInt;exports.urlGetParams=r.urlGetParams;exports.urlGetString=r.urlGetString;exports.urlParamToBoolean=r.urlParamToBoolean;exports.urlParamToFloat=r.urlParamToFloat;exports.urlParamToInt=r.urlParamToInt;exports.validateMatchResult=r.validateMatchResult;exports.waitObservable=r.waitObservable;exports.withConsoleReplace=r.withConsoleReplace;exports.withRetry=r.withRetry;exports.withTimeout=r.withTimeout;exports.DIFF_NEW=Z;exports.DIFF_OLD=Y;exports.checkPageHttpErrors=Ee;exports.createCDPSession=oe;exports.createMatchPath=We;exports.createPagesElementsChangesTest=Xe;exports.delayOnErrorCall=ke;exports.delayOnErrorSet=$e;exports.delayOnErrorWait=ze;exports.destroyCDPSession=se;exports.exec=be;exports.fileLock=Ne;exports.forcePseudoClasses=je;exports.getAllElements=re;exports.getDrive=fe;exports.getElementsStyleDiff=ae;exports.getFileId=he;exports.getObjectsDiff=J;exports.getPageHttpErrors=Se;exports.globGitIgnoreToPicomatch=pe;exports.globToRelative=we;exports.initPage=Me;exports.loadGlobs=Be;exports.loadGlobsFromFile=ge;exports.loadJson=Pe;exports.nodeBeep=ve;exports.objectTransform=G;exports.pathNormalize=B;exports.pathResolve=de;exports.poolFs=ee;exports.saveJson=X;exports.setPlaywrightPriorityLow=xe;exports.subscribeJsErrors=Oe;exports.testPage=Ue;exports.useBrowser=Je;exports.useBrowserContext=Ge;exports.usingCDPSession=qe;exports.walkPathHandleErrorDefault=me;exports.walkPaths=_e;