add hw2
This commit is contained in:
24
node_modules/chromium-bidi/lib/cjs/utils/Base64.d.ts
generated
vendored
Normal file
24
node_modules/chromium-bidi/lib/cjs/utils/Base64.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Encodes a string to base64.
|
||||
*
|
||||
* Uses the native Web API if available, otherwise falls back to a NodeJS Buffer.
|
||||
* @param {string} base64Str
|
||||
* @return {string}
|
||||
*/
|
||||
export declare function base64ToString(base64Str: string): string;
|
||||
35
node_modules/chromium-bidi/lib/cjs/utils/Base64.js
generated
vendored
Normal file
35
node_modules/chromium-bidi/lib/cjs/utils/Base64.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.base64ToString = base64ToString;
|
||||
/**
|
||||
* Encodes a string to base64.
|
||||
*
|
||||
* Uses the native Web API if available, otherwise falls back to a NodeJS Buffer.
|
||||
* @param {string} base64Str
|
||||
* @return {string}
|
||||
*/
|
||||
function base64ToString(base64Str) {
|
||||
// Available only if run in a browser context.
|
||||
if ('atob' in globalThis) {
|
||||
return globalThis.atob(base64Str);
|
||||
}
|
||||
// Available only if run in a NodeJS context.
|
||||
return Buffer.from(base64Str, 'base64').toString('ascii');
|
||||
}
|
||||
//# sourceMappingURL=Base64.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/Base64.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/Base64.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Base64.js","sourceRoot":"","sources":["../../../src/utils/Base64.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AASH,wCAOC;AAdD;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,SAAiB;IAC9C,8CAA8C;IAC9C,IAAI,MAAM,IAAI,UAAU,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IACD,6CAA6C;IAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC5D,CAAC"}
|
||||
27
node_modules/chromium-bidi/lib/cjs/utils/Buffer.d.ts
generated
vendored
Normal file
27
node_modules/chromium-bidi/lib/cjs/utils/Buffer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/** Implements a FIFO buffer with a fixed size. */
|
||||
export declare class Buffer<T> {
|
||||
#private;
|
||||
/**
|
||||
* @param capacity The buffer capacity.
|
||||
* @param onItemRemoved Delegate called for each removed element.
|
||||
*/
|
||||
constructor(capacity: number, onItemRemoved?: (value: T) => void);
|
||||
get(): T[];
|
||||
add(value: T): void;
|
||||
}
|
||||
47
node_modules/chromium-bidi/lib/cjs/utils/Buffer.js
generated
vendored
Normal file
47
node_modules/chromium-bidi/lib/cjs/utils/Buffer.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Buffer = void 0;
|
||||
/** Implements a FIFO buffer with a fixed size. */
|
||||
class Buffer {
|
||||
#capacity;
|
||||
#entries = [];
|
||||
#onItemRemoved;
|
||||
/**
|
||||
* @param capacity The buffer capacity.
|
||||
* @param onItemRemoved Delegate called for each removed element.
|
||||
*/
|
||||
constructor(capacity, onItemRemoved) {
|
||||
this.#capacity = capacity;
|
||||
this.#onItemRemoved = onItemRemoved;
|
||||
}
|
||||
get() {
|
||||
return this.#entries;
|
||||
}
|
||||
add(value) {
|
||||
this.#entries.push(value);
|
||||
while (this.#entries.length > this.#capacity) {
|
||||
const item = this.#entries.shift();
|
||||
if (item !== undefined) {
|
||||
this.#onItemRemoved?.(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Buffer = Buffer;
|
||||
//# sourceMappingURL=Buffer.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/Buffer.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/Buffer.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Buffer.js","sourceRoot":"","sources":["../../../src/utils/Buffer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,kDAAkD;AAClD,MAAa,MAAM;IACR,SAAS,CAAS;IAClB,QAAQ,GAAQ,EAAE,CAAC;IACnB,cAAc,CAAsB;IAE7C;;;OAGG;IACH,YAAY,QAAgB,EAAE,aAAkC;QAC9D,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAED,GAAG;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,GAAG,CAAC,KAAQ;QACV,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACnC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACvB,IAAI,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA3BD,wBA2BC"}
|
||||
22
node_modules/chromium-bidi/lib/cjs/utils/CdpErrorConstants.d.ts
generated
vendored
Normal file
22
node_modules/chromium-bidi/lib/cjs/utils/CdpErrorConstants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/** @see https://crsrc.org/c/third_party/devtools-frontend/src/front_end/core/protocol_client/InspectorBackend.ts */
|
||||
export declare const enum CdpErrorConstants {
|
||||
CONNECTION_CLOSED = -32001,
|
||||
DEVTOOLS_STUB = -32015,
|
||||
GENERIC_ERROR = -32000
|
||||
}
|
||||
19
node_modules/chromium-bidi/lib/cjs/utils/CdpErrorConstants.js
generated
vendored
Normal file
19
node_modules/chromium-bidi/lib/cjs/utils/CdpErrorConstants.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=CdpErrorConstants.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/CdpErrorConstants.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/CdpErrorConstants.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"CdpErrorConstants.js","sourceRoot":"","sources":["../../../src/utils/CdpErrorConstants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}
|
||||
26
node_modules/chromium-bidi/lib/cjs/utils/DefaultMap.d.ts
generated
vendored
Normal file
26
node_modules/chromium-bidi/lib/cjs/utils/DefaultMap.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* A subclass of Map whose functionality is almost the same as its parent
|
||||
* except for the fact that DefaultMap never returns undefined. It provides a
|
||||
* default value for keys that do not exist.
|
||||
*/
|
||||
export declare class DefaultMap<K, V> extends Map<K, V> {
|
||||
#private;
|
||||
constructor(getDefaultValue: (key: K) => V, entries?: readonly (readonly [K, V])[] | null);
|
||||
get(key: K): V;
|
||||
}
|
||||
40
node_modules/chromium-bidi/lib/cjs/utils/DefaultMap.js
generated
vendored
Normal file
40
node_modules/chromium-bidi/lib/cjs/utils/DefaultMap.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DefaultMap = void 0;
|
||||
/**
|
||||
* A subclass of Map whose functionality is almost the same as its parent
|
||||
* except for the fact that DefaultMap never returns undefined. It provides a
|
||||
* default value for keys that do not exist.
|
||||
*/
|
||||
class DefaultMap extends Map {
|
||||
/** The default value to return whenever a key is not present in the map. */
|
||||
#getDefaultValue;
|
||||
constructor(getDefaultValue, entries) {
|
||||
super(entries);
|
||||
this.#getDefaultValue = getDefaultValue;
|
||||
}
|
||||
get(key) {
|
||||
if (!this.has(key)) {
|
||||
this.set(key, this.#getDefaultValue(key));
|
||||
}
|
||||
return super.get(key);
|
||||
}
|
||||
}
|
||||
exports.DefaultMap = DefaultMap;
|
||||
//# sourceMappingURL=DefaultMap.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/DefaultMap.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/DefaultMap.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"DefaultMap.js","sourceRoot":"","sources":["../../../src/utils/DefaultMap.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;;;GAIG;AACH,MAAa,UAAiB,SAAQ,GAAS;IAC7C,4EAA4E;IAC5E,gBAAgB,CAAgB;IAEhC,YACE,eAA8B,EAC9B,OAA6C;QAE7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC;IAEQ,GAAG,CAAC,GAAM;QACjB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC;IACzB,CAAC;CACF;AAlBD,gCAkBC"}
|
||||
28
node_modules/chromium-bidi/lib/cjs/utils/Deferred.d.ts
generated
vendored
Normal file
28
node_modules/chromium-bidi/lib/cjs/utils/Deferred.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare class Deferred<T> implements Promise<T> {
|
||||
#private;
|
||||
get isFinished(): boolean;
|
||||
get result(): T;
|
||||
constructor();
|
||||
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
||||
catch<TResult = never>(onRejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
|
||||
resolve(value: T): void;
|
||||
reject(reason: Error): void;
|
||||
finally(onFinally?: (() => void) | null): Promise<T>;
|
||||
[Symbol.toStringTag]: string;
|
||||
}
|
||||
71
node_modules/chromium-bidi/lib/cjs/utils/Deferred.js
generated
vendored
Normal file
71
node_modules/chromium-bidi/lib/cjs/utils/Deferred.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Deferred = void 0;
|
||||
class Deferred {
|
||||
#isFinished = false;
|
||||
#promise;
|
||||
#result;
|
||||
#resolve;
|
||||
#reject;
|
||||
get isFinished() {
|
||||
return this.#isFinished;
|
||||
}
|
||||
get result() {
|
||||
if (!this.#isFinished) {
|
||||
throw new Error('Deferred is not finished yet');
|
||||
}
|
||||
return this.#result;
|
||||
}
|
||||
constructor() {
|
||||
this.#promise = new Promise((resolve, reject) => {
|
||||
this.#resolve = resolve;
|
||||
this.#reject = reject;
|
||||
});
|
||||
// Needed to avoid `Uncaught (in promise)`. The promises returned by `then`
|
||||
// and `catch` will be rejected anyway.
|
||||
this.#promise.catch((_error) => {
|
||||
// Intentionally empty.
|
||||
});
|
||||
}
|
||||
then(onFulfilled, onRejected) {
|
||||
return this.#promise.then(onFulfilled, onRejected);
|
||||
}
|
||||
catch(onRejected) {
|
||||
return this.#promise.catch(onRejected);
|
||||
}
|
||||
resolve(value) {
|
||||
this.#result = value;
|
||||
if (!this.#isFinished) {
|
||||
this.#isFinished = true;
|
||||
this.#resolve(value);
|
||||
}
|
||||
}
|
||||
reject(reason) {
|
||||
if (!this.#isFinished) {
|
||||
this.#isFinished = true;
|
||||
this.#reject(reason);
|
||||
}
|
||||
}
|
||||
finally(onFinally) {
|
||||
return this.#promise.finally(onFinally);
|
||||
}
|
||||
[Symbol.toStringTag] = 'Promise';
|
||||
}
|
||||
exports.Deferred = Deferred;
|
||||
//# sourceMappingURL=Deferred.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/Deferred.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/Deferred.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Deferred.js","sourceRoot":"","sources":["../../../src/utils/Deferred.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,MAAa,QAAQ;IACnB,WAAW,GAAG,KAAK,CAAC;IACpB,QAAQ,CAAa;IACrB,OAAO,CAAgB;IACvB,QAAQ,CAAsB;IAC9B,OAAO,CAA2B;IAElC,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,CAAC,OAAQ,CAAC;IACvB,CAAC;IAED;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,2EAA2E;QAC3E,uCAAuC;QACvC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7B,uBAAuB;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CACF,WAAqE,EACrE,UAA2E;QAE3E,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CACH,UAAyE;QAEzE,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,CAAC,KAAQ;QACd,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAa;QAClB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,SAA+B;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C,CAAC;IAED,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;CAClC;AA/DD,4BA+DC"}
|
||||
14
node_modules/chromium-bidi/lib/cjs/utils/DistinctValues.d.ts
generated
vendored
Normal file
14
node_modules/chromium-bidi/lib/cjs/utils/DistinctValues.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Returns an array of distinct values. Order is not guaranteed.
|
||||
* @param values - The values to filter. Should be JSON-serializable.
|
||||
* @return - An array of distinct values.
|
||||
*/
|
||||
export declare function distinctValues<T>(values: T[]): T[];
|
||||
/**
|
||||
* Returns a stringified version of the object with keys sorted. This is required to
|
||||
* ensure that the stringified version of an object is deterministic independent of the
|
||||
* order of keys.
|
||||
* @param obj
|
||||
* @return {string}
|
||||
*/
|
||||
export declare function deterministicJSONStringify(obj: unknown): string;
|
||||
58
node_modules/chromium-bidi/lib/cjs/utils/DistinctValues.js
generated
vendored
Normal file
58
node_modules/chromium-bidi/lib/cjs/utils/DistinctValues.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
/*
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.distinctValues = distinctValues;
|
||||
exports.deterministicJSONStringify = deterministicJSONStringify;
|
||||
/**
|
||||
* Returns an array of distinct values. Order is not guaranteed.
|
||||
* @param values - The values to filter. Should be JSON-serializable.
|
||||
* @return - An array of distinct values.
|
||||
*/
|
||||
function distinctValues(values) {
|
||||
const map = new Map();
|
||||
for (const value of values) {
|
||||
map.set(deterministicJSONStringify(value), value);
|
||||
}
|
||||
return Array.from(map.values());
|
||||
}
|
||||
/**
|
||||
* Returns a stringified version of the object with keys sorted. This is required to
|
||||
* ensure that the stringified version of an object is deterministic independent of the
|
||||
* order of keys.
|
||||
* @param obj
|
||||
* @return {string}
|
||||
*/
|
||||
function deterministicJSONStringify(obj) {
|
||||
return JSON.stringify(normalizeObject(obj));
|
||||
}
|
||||
function normalizeObject(obj) {
|
||||
if (obj === undefined ||
|
||||
obj === null ||
|
||||
Array.isArray(obj) ||
|
||||
typeof obj !== 'object') {
|
||||
return obj;
|
||||
}
|
||||
// Copy the original object key and values to a new object in sorted order.
|
||||
const newObj = {};
|
||||
for (const key of Object.keys(obj).sort()) {
|
||||
const value = obj[key];
|
||||
newObj[key] = normalizeObject(value); // Recursively sort nested objects
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
//# sourceMappingURL=DistinctValues.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/DistinctValues.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/DistinctValues.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"DistinctValues.js","sourceRoot":"","sources":["../../../src/utils/DistinctValues.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAOH,wCAMC;AASD,gEAEC;AAtBD;;;;GAIG;AACH,SAAgB,cAAc,CAAI,MAAW;IAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAa,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,GAAG,CAAC,GAAG,CAAC,0BAA0B,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,0BAA0B,CAAC,GAAY;IACrD,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,eAAe,CAAC,GAAQ;IAC/B,IACE,GAAG,KAAK,SAAS;QACjB,GAAG,KAAK,IAAI;QACZ,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAClB,OAAO,GAAG,KAAK,QAAQ,EACvB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,2EAA2E;IAC3E,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,kCAAkC;IAC1E,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
||||
58
node_modules/chromium-bidi/lib/cjs/utils/EventEmitter.d.ts
generated
vendored
Normal file
58
node_modules/chromium-bidi/lib/cjs/utils/EventEmitter.d.ts
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { type EventType, type Handler, type WildcardHandler } from 'mitt';
|
||||
export declare class EventEmitter<Events extends Record<EventType, unknown>> {
|
||||
#private;
|
||||
/**
|
||||
* Binds an event listener to fire when an event occurs.
|
||||
* @param event The event type you'd like to listen to. Can be a string or symbol.
|
||||
* @param handler The function to be called when the event occurs.
|
||||
* @return `this` to enable chaining method calls.
|
||||
*/
|
||||
on(type: '*', handler: WildcardHandler<Events>): this;
|
||||
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): this;
|
||||
/**
|
||||
* Like `on` but the listener will only be fired once and then it will be removed.
|
||||
* @param event The event you'd like to listen to
|
||||
* @param handler The handler function to run when the event occurs
|
||||
* @return `this` to enable chaining method calls.
|
||||
*/
|
||||
once(event: EventType, handler: Handler): this;
|
||||
/**
|
||||
* Removes an event listener from firing.
|
||||
* @param event The event type you'd like to stop listening to.
|
||||
* @param handler The function that should be removed.
|
||||
* @return `this` to enable chaining method calls.
|
||||
*/
|
||||
off(type: '*', handler: WildcardHandler<Events>): this;
|
||||
off<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): EventEmitter<Events>;
|
||||
/**
|
||||
* Emits an event and call any associated listeners.
|
||||
*
|
||||
* @param event The event to emit.
|
||||
* @param eventData Any data to emit with the event.
|
||||
* @return `true` if there are any listeners, `false` otherwise.
|
||||
*/
|
||||
emit<Key extends keyof Events>(event: Key, eventData: Events[Key]): void;
|
||||
/**
|
||||
* Removes all listeners. If given an event argument, it will remove only
|
||||
* listeners for that event.
|
||||
* @param event - the event to remove listeners for.
|
||||
* @returns `this` to enable you to chain method calls.
|
||||
*/
|
||||
removeAllListeners(event?: EventType): this;
|
||||
}
|
||||
74
node_modules/chromium-bidi/lib/cjs/utils/EventEmitter.js
generated
vendored
Normal file
74
node_modules/chromium-bidi/lib/cjs/utils/EventEmitter.js
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.EventEmitter = void 0;
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const mitt_1 = __importDefault(require("mitt"));
|
||||
class EventEmitter {
|
||||
#emitter = (0, mitt_1.default)();
|
||||
on(type, handler) {
|
||||
this.#emitter.on(type, handler);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Like `on` but the listener will only be fired once and then it will be removed.
|
||||
* @param event The event you'd like to listen to
|
||||
* @param handler The handler function to run when the event occurs
|
||||
* @return `this` to enable chaining method calls.
|
||||
*/
|
||||
once(event, handler) {
|
||||
const onceHandler = (eventData) => {
|
||||
handler(eventData);
|
||||
this.off(event, onceHandler);
|
||||
};
|
||||
return this.on(event, onceHandler);
|
||||
}
|
||||
off(type, handler) {
|
||||
this.#emitter.off(type, handler);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Emits an event and call any associated listeners.
|
||||
*
|
||||
* @param event The event to emit.
|
||||
* @param eventData Any data to emit with the event.
|
||||
* @return `true` if there are any listeners, `false` otherwise.
|
||||
*/
|
||||
emit(event, eventData) {
|
||||
this.#emitter.emit(event, eventData);
|
||||
}
|
||||
/**
|
||||
* Removes all listeners. If given an event argument, it will remove only
|
||||
* listeners for that event.
|
||||
* @param event - the event to remove listeners for.
|
||||
* @returns `this` to enable you to chain method calls.
|
||||
*/
|
||||
removeAllListeners(event) {
|
||||
if (event) {
|
||||
this.#emitter.all.delete(event);
|
||||
}
|
||||
else {
|
||||
this.#emitter.all.clear();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
exports.EventEmitter = EventEmitter;
|
||||
//# sourceMappingURL=EventEmitter.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/EventEmitter.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/EventEmitter.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"EventEmitter.js","sourceRoot":"","sources":["../../../src/utils/EventEmitter.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,gDAKc;AAEd,MAAa,YAAY;IACvB,QAAQ,GAAoB,IAAA,cAAI,GAAE,CAAC;IAUnC,EAAE,CAAC,IAAS,EAAE,OAAY;QACxB,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAgB,EAAE,OAAgB;QACrC,MAAM,WAAW,GAAY,CAAC,SAAS,EAAE,EAAE;YACzC,OAAO,CAAC,SAAS,CAAC,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAC/B,CAAC,CAAC;QACF,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACrC,CAAC;IAaD,GAAG,CAAC,IAAS,EAAE,OAAY;QACzB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CAA2B,KAAU,EAAE,SAAsB;QAC/D,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACH,kBAAkB,CAAC,KAAiB;QAClC,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvED,oCAuEC"}
|
||||
9
node_modules/chromium-bidi/lib/cjs/utils/GraphemeTools.d.ts
generated
vendored
Normal file
9
node_modules/chromium-bidi/lib/cjs/utils/GraphemeTools.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Check if the given string is a single complex grapheme. A complex grapheme is one that
|
||||
* is made up of multiple characters.
|
||||
*/
|
||||
export declare function isSingleComplexGrapheme(value: string): boolean;
|
||||
/**
|
||||
* Check if the given string is a single grapheme.
|
||||
*/
|
||||
export declare function isSingleGrapheme(value: string): boolean;
|
||||
38
node_modules/chromium-bidi/lib/cjs/utils/GraphemeTools.js
generated
vendored
Normal file
38
node_modules/chromium-bidi/lib/cjs/utils/GraphemeTools.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
/*
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isSingleComplexGrapheme = isSingleComplexGrapheme;
|
||||
exports.isSingleGrapheme = isSingleGrapheme;
|
||||
/**
|
||||
* Check if the given string is a single complex grapheme. A complex grapheme is one that
|
||||
* is made up of multiple characters.
|
||||
*/
|
||||
function isSingleComplexGrapheme(value) {
|
||||
return isSingleGrapheme(value) && value.length > 1;
|
||||
}
|
||||
/**
|
||||
* Check if the given string is a single grapheme.
|
||||
*/
|
||||
function isSingleGrapheme(value) {
|
||||
// Theoretically there can be some strings considered a grapheme in some locales, like
|
||||
// slovak "ch" digraph. Use english locale for consistency.
|
||||
// https://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries
|
||||
const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
|
||||
return [...segmenter.segment(value)].length === 1;
|
||||
}
|
||||
//# sourceMappingURL=GraphemeTools.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/GraphemeTools.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/GraphemeTools.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GraphemeTools.js","sourceRoot":"","sources":["../../../src/utils/GraphemeTools.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAMH,0DAEC;AAKD,4CAMC;AAjBD;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,KAAa;IACnD,OAAO,gBAAgB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,sFAAsF;IACtF,2DAA2D;IAC3D,oEAAoE;IACpE,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,EAAC,WAAW,EAAE,UAAU,EAAC,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACpD,CAAC"}
|
||||
24
node_modules/chromium-bidi/lib/cjs/utils/IdWrapper.d.ts
generated
vendored
Normal file
24
node_modules/chromium-bidi/lib/cjs/utils/IdWrapper.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Creates an object with a positive unique incrementing id.
|
||||
*/
|
||||
export declare class IdWrapper {
|
||||
#private;
|
||||
constructor();
|
||||
get id(): number;
|
||||
}
|
||||
34
node_modules/chromium-bidi/lib/cjs/utils/IdWrapper.js
generated
vendored
Normal file
34
node_modules/chromium-bidi/lib/cjs/utils/IdWrapper.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.IdWrapper = void 0;
|
||||
/**
|
||||
* Creates an object with a positive unique incrementing id.
|
||||
*/
|
||||
class IdWrapper {
|
||||
static #counter = 0;
|
||||
#id;
|
||||
constructor() {
|
||||
this.#id = ++IdWrapper.#counter;
|
||||
}
|
||||
get id() {
|
||||
return this.#id;
|
||||
}
|
||||
}
|
||||
exports.IdWrapper = IdWrapper;
|
||||
//# sourceMappingURL=IdWrapper.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/IdWrapper.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/IdWrapper.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IdWrapper.js","sourceRoot":"","sources":["../../../src/utils/IdWrapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;GAEG;AACH,MAAa,SAAS;IACpB,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC;IACX,GAAG,CAAS;IAErB;QACE,IAAI,CAAC,GAAG,GAAG,EAAE,SAAS,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;;AAVH,8BAWC"}
|
||||
29
node_modules/chromium-bidi/lib/cjs/utils/Mutex.d.ts
generated
vendored
Normal file
29
node_modules/chromium-bidi/lib/cjs/utils/Mutex.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Copyright 2022 The Chromium Authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export type ReleaseFunction = () => void;
|
||||
/**
|
||||
* Use Mutex class to coordinate local concurrent operations.
|
||||
* Once `acquire` promise resolves, you hold the lock and must
|
||||
* call `release` function returned by `acquire` to release the
|
||||
* lock. Failing to `release` the lock may lead to deadlocks.
|
||||
*/
|
||||
export declare class Mutex {
|
||||
#private;
|
||||
acquire(): Promise<ReleaseFunction>;
|
||||
run<T>(action: () => Promise<T>): Promise<T>;
|
||||
}
|
||||
68
node_modules/chromium-bidi/lib/cjs/utils/Mutex.js
generated
vendored
Normal file
68
node_modules/chromium-bidi/lib/cjs/utils/Mutex.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Copyright 2022 The Chromium Authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Mutex = void 0;
|
||||
/**
|
||||
* Use Mutex class to coordinate local concurrent operations.
|
||||
* Once `acquire` promise resolves, you hold the lock and must
|
||||
* call `release` function returned by `acquire` to release the
|
||||
* lock. Failing to `release` the lock may lead to deadlocks.
|
||||
*/
|
||||
class Mutex {
|
||||
#locked = false;
|
||||
#acquirers = [];
|
||||
// This is FIFO.
|
||||
acquire() {
|
||||
const state = { resolved: false };
|
||||
if (this.#locked) {
|
||||
return new Promise((resolve) => {
|
||||
this.#acquirers.push(() => resolve(this.#release.bind(this, state)));
|
||||
});
|
||||
}
|
||||
this.#locked = true;
|
||||
return Promise.resolve(this.#release.bind(this, state));
|
||||
}
|
||||
#release(state) {
|
||||
if (state.resolved) {
|
||||
throw new Error('Cannot release more than once.');
|
||||
}
|
||||
state.resolved = true;
|
||||
const resolve = this.#acquirers.shift();
|
||||
if (!resolve) {
|
||||
this.#locked = false;
|
||||
return;
|
||||
}
|
||||
resolve();
|
||||
}
|
||||
async run(action) {
|
||||
const release = await this.acquire();
|
||||
try {
|
||||
// Note we need to await here because we want the await to release AFTER
|
||||
// that await happens. Returning action() will trigger the release
|
||||
// immediately which is counter to what we want.
|
||||
const result = await action();
|
||||
return result;
|
||||
}
|
||||
finally {
|
||||
release();
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Mutex = Mutex;
|
||||
//# sourceMappingURL=Mutex.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/Mutex.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/Mutex.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Mutex.js","sourceRoot":"","sources":["../../../src/utils/Mutex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAIH;;;;;GAKG;AACH,MAAa,KAAK;IAChB,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,GAAmB,EAAE,CAAC;IAEhC,gBAAgB;IAChB,OAAO;QACL,MAAM,KAAK,GAAG,EAAC,QAAQ,EAAE,KAAK,EAAC,CAAC;QAChC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC7B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;YACvE,CAAC,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,QAAQ,CAAC,KAA0B;QACjC,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;QACD,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEtB,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QACxC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YACrB,OAAO;QACT,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,GAAG,CAAI,MAAwB;QACnC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC;YACH,wEAAwE;YACxE,kEAAkE;YAClE,gDAAgD;YAChD,MAAM,MAAM,GAAG,MAAM,MAAM,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC;QAChB,CAAC;gBAAS,CAAC;YACT,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AA1CD,sBA0CC"}
|
||||
24
node_modules/chromium-bidi/lib/cjs/utils/ProcessingQueue.d.ts
generated
vendored
Normal file
24
node_modules/chromium-bidi/lib/cjs/utils/ProcessingQueue.d.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { type LoggerFn } from './log.js';
|
||||
import type { Result } from './result.js';
|
||||
export declare class ProcessingQueue<T> {
|
||||
#private;
|
||||
static readonly LOGGER_PREFIX: "debug:queue";
|
||||
constructor(processor: (arg: T) => Promise<void>, logger?: LoggerFn);
|
||||
add(entry: Promise<Result<T>>, name: string): void;
|
||||
}
|
||||
67
node_modules/chromium-bidi/lib/cjs/utils/ProcessingQueue.js
generated
vendored
Normal file
67
node_modules/chromium-bidi/lib/cjs/utils/ProcessingQueue.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ProcessingQueue = void 0;
|
||||
const log_js_1 = require("./log.js");
|
||||
class ProcessingQueue {
|
||||
static LOGGER_PREFIX = `${log_js_1.LogType.debug}:queue`;
|
||||
#logger;
|
||||
#processor;
|
||||
#queue = [];
|
||||
// Flag to keep only 1 active processor.
|
||||
#isProcessing = false;
|
||||
constructor(processor, logger) {
|
||||
this.#processor = processor;
|
||||
this.#logger = logger;
|
||||
}
|
||||
add(entry, name) {
|
||||
this.#queue.push([entry, name]);
|
||||
// No need in waiting. Just initialize processor if needed.
|
||||
void this.#processIfNeeded();
|
||||
}
|
||||
async #processIfNeeded() {
|
||||
if (this.#isProcessing) {
|
||||
return;
|
||||
}
|
||||
this.#isProcessing = true;
|
||||
while (this.#queue.length > 0) {
|
||||
const arrayEntry = this.#queue.shift();
|
||||
if (!arrayEntry) {
|
||||
continue;
|
||||
}
|
||||
const [entryPromise, name] = arrayEntry;
|
||||
this.#logger?.(_a.LOGGER_PREFIX, 'Processing event:', name);
|
||||
await entryPromise
|
||||
.then((entry) => {
|
||||
if (entry.kind === 'error') {
|
||||
this.#logger?.(log_js_1.LogType.debugError, 'Event threw before sending:', entry.error.message, entry.error.stack);
|
||||
return;
|
||||
}
|
||||
return this.#processor(entry.value);
|
||||
})
|
||||
.catch((error) => {
|
||||
this.#logger?.(log_js_1.LogType.debugError, 'Event was not processed:', error?.message);
|
||||
});
|
||||
}
|
||||
this.#isProcessing = false;
|
||||
}
|
||||
}
|
||||
exports.ProcessingQueue = ProcessingQueue;
|
||||
_a = ProcessingQueue;
|
||||
//# sourceMappingURL=ProcessingQueue.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/ProcessingQueue.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/ProcessingQueue.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ProcessingQueue.js","sourceRoot":"","sources":["../../../src/utils/ProcessingQueue.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;AAEH,qCAAgD;AAGhD,MAAa,eAAe;IAC1B,MAAM,CAAU,aAAa,GAAG,GAAG,gBAAO,CAAC,KAAK,QAAiB,CAAC;IAEzD,OAAO,CAAY;IACnB,UAAU,CAA4B;IACtC,MAAM,GAAmC,EAAE,CAAC;IAErD,wCAAwC;IACxC,aAAa,GAAG,KAAK,CAAC;IAEtB,YAAY,SAAoC,EAAE,MAAiB;QACjE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,GAAG,CAAC,KAAyB,EAAE,IAAY;QACzC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;QAChC,2DAA2D;QAC3D,KAAK,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACvC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChB,SAAS;YACX,CAAC;YACD,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC;YACxC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAe,CAAC,aAAa,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;YAEzE,MAAM,YAAY;iBACf,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;gBACd,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;oBAC3B,IAAI,CAAC,OAAO,EAAE,CACZ,gBAAO,CAAC,UAAU,EAClB,6BAA6B,EAC7B,KAAK,CAAC,KAAK,CAAC,OAAO,EACnB,KAAK,CAAC,KAAK,CAAC,KAAK,CAClB,CAAC;oBACF,OAAO;gBACT,CAAC;gBACD,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACtC,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBACf,IAAI,CAAC,OAAO,EAAE,CACZ,gBAAO,CAAC,UAAU,EAClB,0BAA0B,EAC1B,KAAK,EAAE,OAAO,CACf,CAAC;YACJ,CAAC,CAAC,CAAC;QACP,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;;AAzDH,0CA0DC"}
|
||||
8
node_modules/chromium-bidi/lib/cjs/utils/UrlHelpers.d.ts
generated
vendored
Normal file
8
node_modules/chromium-bidi/lib/cjs/utils/UrlHelpers.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* A URL matches about:blank if its scheme is "about", its path contains a single string
|
||||
* "blank", its username and password are the empty string, and its host is null.
|
||||
* https://html.spec.whatwg.org/multipage/urls-and-fetching.html#matches-about:blank
|
||||
* @param {string} url
|
||||
* @return {boolean}
|
||||
*/
|
||||
export declare function urlMatchesAboutBlank(url: string): boolean;
|
||||
52
node_modules/chromium-bidi/lib/cjs/utils/UrlHelpers.js
generated
vendored
Normal file
52
node_modules/chromium-bidi/lib/cjs/utils/UrlHelpers.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
/*
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.urlMatchesAboutBlank = urlMatchesAboutBlank;
|
||||
/**
|
||||
* A URL matches about:blank if its scheme is "about", its path contains a single string
|
||||
* "blank", its username and password are the empty string, and its host is null.
|
||||
* https://html.spec.whatwg.org/multipage/urls-and-fetching.html#matches-about:blank
|
||||
* @param {string} url
|
||||
* @return {boolean}
|
||||
*/
|
||||
function urlMatchesAboutBlank(url) {
|
||||
// An empty string is a special case, and considered to be about:blank.
|
||||
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-open-steps
|
||||
if (url === '') {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
const parsedUrl = new URL(url);
|
||||
const schema = parsedUrl.protocol.replace(/:$/, '');
|
||||
return (schema.toLowerCase() === 'about' &&
|
||||
parsedUrl.pathname.toLowerCase() === 'blank' &&
|
||||
parsedUrl.username === '' &&
|
||||
parsedUrl.password === '' &&
|
||||
parsedUrl.host === '');
|
||||
}
|
||||
catch (err) {
|
||||
// Wrong URL considered do not match about:blank.
|
||||
if (err instanceof TypeError) {
|
||||
return false;
|
||||
}
|
||||
// Re-throw other unexpected errors.
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=UrlHelpers.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/UrlHelpers.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/UrlHelpers.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"UrlHelpers.js","sourceRoot":"","sources":["../../../src/utils/UrlHelpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;AASH,oDAyBC;AAhCD;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,uEAAuE;IACvE,iFAAiF;IACjF,IAAI,GAAG,KAAK,EAAE,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACpD,OAAO,CACL,MAAM,CAAC,WAAW,EAAE,KAAK,OAAO;YAChC,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,OAAO;YAC5C,SAAS,CAAC,QAAQ,KAAK,EAAE;YACzB,SAAS,CAAC,QAAQ,KAAK,EAAE;YACzB,SAAS,CAAC,IAAI,KAAK,EAAE,CACtB,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,iDAAiD;QACjD,IAAI,GAAG,YAAY,SAAS,EAAE,CAAC;YAC7B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,oCAAoC;QACpC,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
||||
25
node_modules/chromium-bidi/lib/cjs/utils/WebsocketTransport.d.ts
generated
vendored
Normal file
25
node_modules/chromium-bidi/lib/cjs/utils/WebsocketTransport.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright 2021 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type WebSocket from 'ws';
|
||||
import type { Transport } from './transport.js';
|
||||
export declare class WebSocketTransport implements Transport {
|
||||
#private;
|
||||
constructor(websocket: WebSocket);
|
||||
setOnMessage(onMessage: (message: string) => void): void;
|
||||
sendMessage(message: string): void;
|
||||
close(): void;
|
||||
}
|
||||
41
node_modules/chromium-bidi/lib/cjs/utils/WebsocketTransport.js
generated
vendored
Normal file
41
node_modules/chromium-bidi/lib/cjs/utils/WebsocketTransport.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2021 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WebSocketTransport = void 0;
|
||||
class WebSocketTransport {
|
||||
#onMessage = null;
|
||||
#websocket;
|
||||
constructor(websocket) {
|
||||
this.#websocket = websocket;
|
||||
this.#websocket.on('message', (message) => {
|
||||
this.#onMessage?.(message);
|
||||
});
|
||||
}
|
||||
setOnMessage(onMessage) {
|
||||
this.#onMessage = onMessage;
|
||||
}
|
||||
sendMessage(message) {
|
||||
this.#websocket.send(message);
|
||||
}
|
||||
close() {
|
||||
this.#onMessage = null;
|
||||
this.#websocket.close();
|
||||
}
|
||||
}
|
||||
exports.WebSocketTransport = WebSocketTransport;
|
||||
//# sourceMappingURL=WebsocketTransport.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/WebsocketTransport.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/WebsocketTransport.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"WebsocketTransport.js","sourceRoot":"","sources":["../../../src/utils/WebsocketTransport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAMH,MAAa,kBAAkB;IAC7B,UAAU,GAAuC,IAAI,CAAC;IAEtD,UAAU,CAAY;IAEtB,YAAY,SAAoB;QAC9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAE5B,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAe,EAAE,EAAE;YAChD,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,YAAY,CAAC,SAAoC;QAC/C,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED,WAAW,CAAC,OAAe;QACzB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;CACF;AAzBD,gDAyBC"}
|
||||
17
node_modules/chromium-bidi/lib/cjs/utils/assert.d.ts
generated
vendored
Normal file
17
node_modules/chromium-bidi/lib/cjs/utils/assert.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare function assert<T>(predicate: T, message?: string): asserts predicate;
|
||||
25
node_modules/chromium-bidi/lib/cjs/utils/assert.js
generated
vendored
Normal file
25
node_modules/chromium-bidi/lib/cjs/utils/assert.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.assert = assert;
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
function assert(predicate, message) {
|
||||
if (!predicate) {
|
||||
throw new Error(message ?? 'Internal assertion failed.');
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=assert.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/assert.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/assert.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../src/utils/assert.ts"],"names":[],"mappings":";;AAgBA,wBAIC;AApBD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,MAAM,CAAI,SAAY,EAAE,OAAgB;IACtD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,4BAA4B,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
||||
25
node_modules/chromium-bidi/lib/cjs/utils/log.d.ts
generated
vendored
Normal file
25
node_modules/chromium-bidi/lib/cjs/utils/log.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright 2021 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare enum LogType {
|
||||
bidi = "bidi",
|
||||
cdp = "cdp",
|
||||
debug = "debug",
|
||||
debugError = "debug:error",
|
||||
debugInfo = "debug:info"
|
||||
}
|
||||
export type LogPrefix = LogType | `${LogType}:${string}`;
|
||||
export type LoggerFn = (type: LogPrefix, ...messages: unknown[]) => void;
|
||||
30
node_modules/chromium-bidi/lib/cjs/utils/log.js
generated
vendored
Normal file
30
node_modules/chromium-bidi/lib/cjs/utils/log.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2021 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LogType = void 0;
|
||||
var LogType;
|
||||
(function (LogType) {
|
||||
// keep-sorted start
|
||||
LogType["bidi"] = "bidi";
|
||||
LogType["cdp"] = "cdp";
|
||||
LogType["debug"] = "debug";
|
||||
LogType["debugError"] = "debug:error";
|
||||
LogType["debugInfo"] = "debug:info";
|
||||
// keep-sorted end
|
||||
})(LogType || (exports.LogType = LogType = {}));
|
||||
//# sourceMappingURL=log.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/log.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/log.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/utils/log.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,IAAY,OAQX;AARD,WAAY,OAAO;IACjB,oBAAoB;IACpB,wBAAa,CAAA;IACb,sBAAW,CAAA;IACX,0BAAe,CAAA;IACf,qCAA0B,CAAA;IAC1B,mCAAwB,CAAA;IACxB,kBAAkB;AACpB,CAAC,EARW,OAAO,uBAAP,OAAO,QAQlB"}
|
||||
23
node_modules/chromium-bidi/lib/cjs/utils/result.d.ts
generated
vendored
Normal file
23
node_modules/chromium-bidi/lib/cjs/utils/result.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export type Result<T, E = Error> = {
|
||||
kind: 'success';
|
||||
value: T;
|
||||
} | {
|
||||
kind: 'error';
|
||||
error: E;
|
||||
};
|
||||
19
node_modules/chromium-bidi/lib/cjs/utils/result.js
generated
vendored
Normal file
19
node_modules/chromium-bidi/lib/cjs/utils/result.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2022 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=result.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/result.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/result.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/utils/result.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}
|
||||
17
node_modules/chromium-bidi/lib/cjs/utils/time.d.ts
generated
vendored
Normal file
17
node_modules/chromium-bidi/lib/cjs/utils/time.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export declare function getTimestamp(): number;
|
||||
27
node_modules/chromium-bidi/lib/cjs/utils/time.js
generated
vendored
Normal file
27
node_modules/chromium-bidi/lib/cjs/utils/time.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getTimestamp = getTimestamp;
|
||||
function getTimestamp() {
|
||||
// `timestamp` from the event is MonotonicTime, not real time, so
|
||||
// the best Mapper can do is to set the timestamp to the epoch time
|
||||
// of the event arrived.
|
||||
// https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-MonotonicTime
|
||||
return new Date().getTime();
|
||||
}
|
||||
//# sourceMappingURL=time.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/time.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/time.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/utils/time.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,oCAMC;AAND,SAAgB,YAAY;IAC1B,iEAAiE;IACjE,mEAAmE;IACnE,wBAAwB;IACxB,qFAAqF;IACrF,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAC9B,CAAC"}
|
||||
25
node_modules/chromium-bidi/lib/cjs/utils/transport.d.ts
generated
vendored
Normal file
25
node_modules/chromium-bidi/lib/cjs/utils/transport.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright 2021 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Represents a low-level transport mechanism for raw text messages like
|
||||
* a WebSocket, pipe, or Window binding.
|
||||
*/
|
||||
export interface Transport {
|
||||
setOnMessage: (handler: (message: string) => Promise<void> | void) => void;
|
||||
sendMessage: (message: string) => Promise<void> | void;
|
||||
close(): void;
|
||||
}
|
||||
19
node_modules/chromium-bidi/lib/cjs/utils/transport.js
generated
vendored
Normal file
19
node_modules/chromium-bidi/lib/cjs/utils/transport.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2021 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=transport.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/transport.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/transport.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../src/utils/transport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG"}
|
||||
18
node_modules/chromium-bidi/lib/cjs/utils/unitConversions.d.ts
generated
vendored
Normal file
18
node_modules/chromium-bidi/lib/cjs/utils/unitConversions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/** @return Given an input in cm, convert it to inches. */
|
||||
export declare function inchesFromCm(cm: number): number;
|
||||
24
node_modules/chromium-bidi/lib/cjs/utils/unitConversions.js
generated
vendored
Normal file
24
node_modules/chromium-bidi/lib/cjs/utils/unitConversions.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.inchesFromCm = inchesFromCm;
|
||||
/** @return Given an input in cm, convert it to inches. */
|
||||
function inchesFromCm(cm) {
|
||||
return cm / 2.54;
|
||||
}
|
||||
//# sourceMappingURL=unitConversions.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/unitConversions.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/unitConversions.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"unitConversions.js","sourceRoot":"","sources":["../../../src/utils/unitConversions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAGH,oCAEC;AAHD,0DAA0D;AAC1D,SAAgB,YAAY,CAAC,EAAU;IACrC,OAAO,EAAE,GAAG,IAAI,CAAC;AACnB,CAAC"}
|
||||
25
node_modules/chromium-bidi/lib/cjs/utils/uuid.d.ts
generated
vendored
Normal file
25
node_modules/chromium-bidi/lib/cjs/utils/uuid.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/**
|
||||
* Generates a random v4 UUID, as specified in RFC4122.
|
||||
*
|
||||
* Uses the native Web Crypto API if available, otherwise falls back to a
|
||||
* polyfill.
|
||||
*
|
||||
* Example: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
|
||||
*/
|
||||
export declare function uuidv4(): `${string}-${string}-${string}-${string}-${string}`;
|
||||
64
node_modules/chromium-bidi/lib/cjs/utils/uuid.js
generated
vendored
Normal file
64
node_modules/chromium-bidi/lib/cjs/utils/uuid.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.uuidv4 = uuidv4;
|
||||
function bytesToHex(bytes) {
|
||||
return bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0'), '');
|
||||
}
|
||||
/**
|
||||
* Generates a random v4 UUID, as specified in RFC4122.
|
||||
*
|
||||
* Uses the native Web Crypto API if available, otherwise falls back to a
|
||||
* polyfill.
|
||||
*
|
||||
* Example: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'
|
||||
*/
|
||||
function uuidv4() {
|
||||
// Available only in secure contexts
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API
|
||||
if ('crypto' in globalThis && 'randomUUID' in globalThis.crypto) {
|
||||
// Node with
|
||||
// https://nodejs.org/dist/latest-v20.x/docs/api/globals.html#crypto_1 or
|
||||
// secure browser context.
|
||||
return globalThis.crypto.randomUUID();
|
||||
}
|
||||
const randomValues = new Uint8Array(16);
|
||||
if ('crypto' in globalThis && 'getRandomValues' in globalThis.crypto) {
|
||||
// Node (>=18) with
|
||||
// https://nodejs.org/dist/latest-v20.x/docs/api/globals.html#crypto_1 or
|
||||
// browser.
|
||||
globalThis.crypto.getRandomValues(randomValues);
|
||||
}
|
||||
else {
|
||||
// Node (<=16) without
|
||||
// https://nodejs.org/dist/latest-v20.x/docs/api/globals.html#crypto_1.
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
require('crypto').webcrypto.getRandomValues(randomValues);
|
||||
}
|
||||
// Set version (4) and variant (RFC4122) bits.
|
||||
randomValues[6] = (randomValues[6] & 0x0f) | 0x40;
|
||||
randomValues[8] = (randomValues[8] & 0x3f) | 0x80;
|
||||
return [
|
||||
bytesToHex(randomValues.subarray(0, 4)),
|
||||
bytesToHex(randomValues.subarray(4, 6)),
|
||||
bytesToHex(randomValues.subarray(6, 8)),
|
||||
bytesToHex(randomValues.subarray(8, 10)),
|
||||
bytesToHex(randomValues.subarray(10, 16)),
|
||||
].join('-');
|
||||
}
|
||||
//# sourceMappingURL=uuid.js.map
|
||||
1
node_modules/chromium-bidi/lib/cjs/utils/uuid.js.map
generated
vendored
Normal file
1
node_modules/chromium-bidi/lib/cjs/utils/uuid.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../../src/utils/uuid.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAiBH,wBAmCC;AAlDD,SAAS,UAAU,CAAC,KAAiB;IACnC,OAAO,KAAK,CAAC,MAAM,CACjB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EACvD,EAAE,CACH,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,MAAM;IACpB,oCAAoC;IACpC,kEAAkE;IAClE,IAAI,QAAQ,IAAI,UAAU,IAAI,YAAY,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QAChE,YAAY;QACZ,yEAAyE;QACzE,0BAA0B;QAC1B,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAExC,IAAI,QAAQ,IAAI,UAAU,IAAI,iBAAiB,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;QACrE,mBAAmB;QACnB,yEAAyE;QACzE,WAAW;QACX,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,sBAAsB;QACtB,uEAAuE;QACvE,iEAAiE;QACjE,OAAO,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAC5D,CAAC;IAED,8CAA8C;IAC9C,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACnD,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEnD,OAAO;QACL,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;KAC1C,CAAC,IAAI,CAAC,GAAG,CAAwD,CAAC;AACrE,CAAC"}
|
||||
Reference in New Issue
Block a user