Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
71 lines
No EOL
1.8 KiB
Text
71 lines
No EOL
1.8 KiB
Text
/**
|
|
* @license
|
|
* Copyright 2023 Google Inc.
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
import { JSHandle } from '../api/JSHandle.js';
|
|
import { UnsupportedOperation } from '../common/Errors.js';
|
|
import { BidiDeserializer } from './Deserializer.js';
|
|
/**
|
|
* @internal
|
|
*/
|
|
export class BidiJSHandle extends JSHandle {
|
|
static from(value, realm) {
|
|
return new BidiJSHandle(value, realm);
|
|
}
|
|
#remoteValue;
|
|
realm;
|
|
#disposed = false;
|
|
constructor(value, realm) {
|
|
super();
|
|
this.#remoteValue = value;
|
|
this.realm = realm;
|
|
}
|
|
get disposed() {
|
|
return this.#disposed;
|
|
}
|
|
async jsonValue() {
|
|
return await this.evaluate(value => {
|
|
return value;
|
|
});
|
|
}
|
|
asElement() {
|
|
return null;
|
|
}
|
|
async dispose() {
|
|
if (this.#disposed) {
|
|
return;
|
|
}
|
|
this.#disposed = true;
|
|
await this.realm.destroyHandles([this]);
|
|
}
|
|
get isPrimitiveValue() {
|
|
switch (this.#remoteValue.type) {
|
|
case 'string':
|
|
case 'number':
|
|
case 'bigint':
|
|
case 'boolean':
|
|
case 'undefined':
|
|
case 'null':
|
|
return true;
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
toString() {
|
|
if (this.isPrimitiveValue) {
|
|
return 'JSHandle:' + BidiDeserializer.deserialize(this.#remoteValue);
|
|
}
|
|
return 'JSHandle@' + this.#remoteValue.type;
|
|
}
|
|
get id() {
|
|
return 'handle' in this.#remoteValue ? this.#remoteValue.handle : undefined;
|
|
}
|
|
remoteValue() {
|
|
return this.#remoteValue;
|
|
}
|
|
remoteObject() {
|
|
throw new UnsupportedOperation('Not available in WebDriver BiDi');
|
|
}
|
|
}
|
|
//# sourceMappingURL=JSHandle.js.map |