@rainbow-robotics/plugin-ui 0.1.2-dev.9 → 1.0.1
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.
- package/README.md +236 -75
- package/build-dist.mjs +55 -17
- package/dist/host-ui.d.ts +49 -0
- package/dist/host-ui.d.ts.map +1 -0
- package/dist/host-ui.js +33 -0
- package/dist/host-ui.js.map +7 -0
- package/dist/manifest.d.ts +20 -4
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +1 -1
- package/dist/manifest.js.map +2 -2
- package/dist/pluginData.d.ts +62 -0
- package/dist/pluginData.d.ts.map +1 -0
- package/dist/react.d.ts +3436 -36
- package/dist/react.js +5 -54
- package/dist/react.js.map +2 -2
- package/dist/sdk.d.ts +38 -2
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +29 -4
- package/dist/sdk.js.map +2 -2
- package/dist/viteHost.d.ts +46 -0
- package/dist/viteHost.d.ts.map +1 -0
- package/dist/viteHost.js +262 -0
- package/dist/viteHost.js.map +7 -0
- package/dist/ws.d.ts +53 -0
- package/dist/ws.d.ts.map +1 -1
- package/dist/ws.js +141 -0
- package/dist/ws.js.map +7 -0
- package/package.json +45 -21
- package/src/host-ui.ts +80 -0
- package/src/host.tsx +229 -308
- package/src/index.d.ts +1 -0
- package/src/manifest.ts +25 -4
- package/src/pluginData.tsx +232 -0
- package/src/react.tsx +9 -127
- package/src/sdk.ts +81 -13
- package/src/viteHost.ts +309 -0
- package/src/ws.ts +127 -20
- package/build-browser.mjs +0 -84
- package/dist/connect.d.ts +0 -11
- package/dist/connect.d.ts.map +0 -1
- package/dist/connect.js +0 -34
- package/dist/connect.js.map +0 -7
- package/dist/elements.d.ts +0 -195
- package/dist/elements.d.ts.map +0 -1
- package/dist/elements.js +0 -115
- package/dist/elements.js.map +0 -7
- package/dist/react.d.ts.map +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/chunks/chunk-37HVFFJB.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/chunks/chunk-4MGSRUAS.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/chunks/chunk-Q6XGCIPE.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/connect.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/elements.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/react.js +0 -1
- package/dist-browser/@rainbow-robotics/plugin-ui/sdk.js +0 -1
- package/dist-browser/vendor/react-dom-client.js +0 -1
- package/dist-browser/vendor/react-jsx-dev-runtime.js +0 -1
- package/dist-browser/vendor/react-jsx-runtime.js +0 -1
- package/dist-browser/vendor/react-runtime.js +0 -65
- package/dist-browser/vendor/react.js +0 -1
- package/src/connect.ts +0 -62
- package/src/elements.ts +0 -257
package/dist/elements.d.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* rb-* remote element contract — shared by the sandbox (plugin author) and the
|
|
3
|
-
* nexus host. This is the *stable* surface: it must only ever grow additively
|
|
4
|
-
* (new elements / new optional properties), never break existing shapes.
|
|
5
|
-
*
|
|
6
|
-
* Verified against @remote-dom/core@1.11.x:
|
|
7
|
-
* - `RemoteElement` lives in `@remote-dom/core/elements`
|
|
8
|
-
* - static `remoteProperties` (data) + static `remoteEvents` (callbacks)
|
|
9
|
-
*/
|
|
10
|
-
import { RemoteElement } from "@remote-dom/core/elements";
|
|
11
|
-
type RbNoMethods = Record<never, never>;
|
|
12
|
-
type RbNoSlots = Record<never, never>;
|
|
13
|
-
type RbNoEvents = Record<never, never>;
|
|
14
|
-
export interface RbSliderProps {
|
|
15
|
-
value?: number;
|
|
16
|
-
min?: number;
|
|
17
|
-
max?: number;
|
|
18
|
-
step?: number;
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface RbButtonProps {
|
|
22
|
-
label?: string;
|
|
23
|
-
variant?: string;
|
|
24
|
-
size?: string;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export interface RbIconButtonProps {
|
|
28
|
-
icon?: string;
|
|
29
|
-
variant?: string;
|
|
30
|
-
size?: string;
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export type RbTextProps = Record<never, never>;
|
|
34
|
-
export interface RbTextInputProps {
|
|
35
|
-
value?: string;
|
|
36
|
-
placeholder?: string;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export interface RbSwitchProps {
|
|
40
|
-
checked?: boolean;
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
}
|
|
43
|
-
/** Option shape carried by `rb-select`'s `options` property. */
|
|
44
|
-
export interface RbSelectOption {
|
|
45
|
-
value: string;
|
|
46
|
-
label: string;
|
|
47
|
-
}
|
|
48
|
-
export interface RbSelectProps {
|
|
49
|
-
value?: string;
|
|
50
|
-
options?: RbSelectOption[];
|
|
51
|
-
placeholder?: string;
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface RbSliderEvents {
|
|
55
|
-
change(detail: number): void;
|
|
56
|
-
}
|
|
57
|
-
export interface RbPressEvents {
|
|
58
|
-
press(): void;
|
|
59
|
-
}
|
|
60
|
-
export interface RbTextInputEvents {
|
|
61
|
-
input(detail: string): void;
|
|
62
|
-
}
|
|
63
|
-
export interface RbSwitchEvents {
|
|
64
|
-
change(detail: boolean): void;
|
|
65
|
-
}
|
|
66
|
-
export interface RbSelectEvents {
|
|
67
|
-
change(detail: string): void;
|
|
68
|
-
}
|
|
69
|
-
/** Slider → host renders RBSlider (Radix array value, single-thumb contract). */
|
|
70
|
-
export declare class RbSliderElement extends RemoteElement<RbSliderProps, RbNoMethods, RbNoSlots, RbSliderEvents> {
|
|
71
|
-
static get remoteProperties(): {
|
|
72
|
-
value: {
|
|
73
|
-
type: NumberConstructor;
|
|
74
|
-
};
|
|
75
|
-
min: {
|
|
76
|
-
type: NumberConstructor;
|
|
77
|
-
};
|
|
78
|
-
max: {
|
|
79
|
-
type: NumberConstructor;
|
|
80
|
-
};
|
|
81
|
-
step: {
|
|
82
|
-
type: NumberConstructor;
|
|
83
|
-
};
|
|
84
|
-
disabled: {
|
|
85
|
-
type: BooleanConstructor;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
static get remoteEvents(): readonly ["change"];
|
|
89
|
-
}
|
|
90
|
-
/** Button → host renders RBLabelButton. */
|
|
91
|
-
export declare class RbButtonElement extends RemoteElement<RbButtonProps, RbNoMethods, RbNoSlots, RbPressEvents> {
|
|
92
|
-
static get remoteProperties(): {
|
|
93
|
-
label: {
|
|
94
|
-
type: StringConstructor;
|
|
95
|
-
};
|
|
96
|
-
variant: {
|
|
97
|
-
type: StringConstructor;
|
|
98
|
-
};
|
|
99
|
-
size: {
|
|
100
|
-
type: StringConstructor;
|
|
101
|
-
};
|
|
102
|
-
disabled: {
|
|
103
|
-
type: BooleanConstructor;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
static get remoteEvents(): readonly ["press"];
|
|
107
|
-
}
|
|
108
|
-
/** Icon button → host renders RBIconButton with an icon resolved from RBIcons. */
|
|
109
|
-
export declare class RbIconButtonElement extends RemoteElement<RbIconButtonProps, RbNoMethods, RbNoSlots, RbPressEvents> {
|
|
110
|
-
static get remoteProperties(): {
|
|
111
|
-
icon: {
|
|
112
|
-
type: StringConstructor;
|
|
113
|
-
};
|
|
114
|
-
variant: {
|
|
115
|
-
type: StringConstructor;
|
|
116
|
-
};
|
|
117
|
-
size: {
|
|
118
|
-
type: StringConstructor;
|
|
119
|
-
};
|
|
120
|
-
disabled: {
|
|
121
|
-
type: BooleanConstructor;
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
static get remoteEvents(): readonly ["press"];
|
|
125
|
-
}
|
|
126
|
-
/** Plain text — renders its children as text on the host. */
|
|
127
|
-
export declare class RbTextElement extends RemoteElement<RbTextProps, RbNoMethods, RbNoSlots, RbNoEvents> {
|
|
128
|
-
static get remoteProperties(): {};
|
|
129
|
-
}
|
|
130
|
-
/** Text input → host renders RBTextInput. */
|
|
131
|
-
export declare class RbTextInputElement extends RemoteElement<RbTextInputProps, RbNoMethods, RbNoSlots, RbTextInputEvents> {
|
|
132
|
-
static get remoteProperties(): {
|
|
133
|
-
value: {
|
|
134
|
-
type: StringConstructor;
|
|
135
|
-
};
|
|
136
|
-
placeholder: {
|
|
137
|
-
type: StringConstructor;
|
|
138
|
-
};
|
|
139
|
-
disabled: {
|
|
140
|
-
type: BooleanConstructor;
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
static get remoteEvents(): readonly ["input"];
|
|
144
|
-
}
|
|
145
|
-
/** Switch → host renders RBSwitch. */
|
|
146
|
-
export declare class RbSwitchElement extends RemoteElement<RbSwitchProps, RbNoMethods, RbNoSlots, RbSwitchEvents> {
|
|
147
|
-
static get remoteProperties(): {
|
|
148
|
-
checked: {
|
|
149
|
-
type: BooleanConstructor;
|
|
150
|
-
};
|
|
151
|
-
disabled: {
|
|
152
|
-
type: BooleanConstructor;
|
|
153
|
-
};
|
|
154
|
-
};
|
|
155
|
-
static get remoteEvents(): readonly ["change"];
|
|
156
|
-
}
|
|
157
|
-
/** Select → host renders RBSelectBox. `options` is `[{value,label}]`. */
|
|
158
|
-
export declare class RbSelectElement extends RemoteElement<RbSelectProps, RbNoMethods, RbNoSlots, RbSelectEvents> {
|
|
159
|
-
static get remoteProperties(): {
|
|
160
|
-
value: {
|
|
161
|
-
type: StringConstructor;
|
|
162
|
-
};
|
|
163
|
-
options: {
|
|
164
|
-
type: ArrayConstructor;
|
|
165
|
-
};
|
|
166
|
-
placeholder: {
|
|
167
|
-
type: StringConstructor;
|
|
168
|
-
};
|
|
169
|
-
disabled: {
|
|
170
|
-
type: BooleanConstructor;
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
static get remoteEvents(): readonly ["change"];
|
|
174
|
-
}
|
|
175
|
-
/** Custom element tag names in the contract. */
|
|
176
|
-
export declare const RB_ELEMENT_NAMES: readonly ["rb-slider", "rb-button", "rb-icon-button", "rb-text", "rb-text-input", "rb-switch", "rb-select"];
|
|
177
|
-
export type RbElementName = (typeof RB_ELEMENT_NAMES)[number];
|
|
178
|
-
declare global {
|
|
179
|
-
interface HTMLElementTagNameMap {
|
|
180
|
-
"rb-slider": RbSliderElement;
|
|
181
|
-
"rb-button": RbButtonElement;
|
|
182
|
-
"rb-icon-button": RbIconButtonElement;
|
|
183
|
-
"rb-text": RbTextElement;
|
|
184
|
-
"rb-text-input": RbTextInputElement;
|
|
185
|
-
"rb-switch": RbSwitchElement;
|
|
186
|
-
"rb-select": RbSelectElement;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Registers the rb-* custom elements. Safe to call multiple times; only the
|
|
191
|
-
* first call defines anything (subsequent calls are a no-op).
|
|
192
|
-
*/
|
|
193
|
-
export declare function defineElements(): void;
|
|
194
|
-
export {};
|
|
195
|
-
//# sourceMappingURL=elements.d.ts.map
|
package/dist/elements.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,KAAK,WAAW,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxC,KAAK,SAAS,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACtC,KAAK,UAAU,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,gEAAgE;AAChE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,iFAAiF;AACjF,qBAAa,eAAgB,SAAQ,aAAa,CAChD,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,CACf;IACC,MAAM,KAAK,gBAAgB;;;;;;;;;;;;;;;;MAQ1B;IACD,MAAM,KAAK,YAAY,wBAEtB;CACF;AAED,2CAA2C;AAC3C,qBAAa,eAAgB,SAAQ,aAAa,CAChD,aAAa,EACb,WAAW,EACX,SAAS,EACT,aAAa,CACd;IACC,MAAM,KAAK,gBAAgB;;;;;;;;;;;;;MAO1B;IACD,MAAM,KAAK,YAAY,uBAEtB;CACF;AAED,kFAAkF;AAClF,qBAAa,mBAAoB,SAAQ,aAAa,CACpD,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,aAAa,CACd;IACC,MAAM,KAAK,gBAAgB;;;;;;;;;;;;;MAO1B;IACD,MAAM,KAAK,YAAY,uBAEtB;CACF;AAED,6DAA6D;AAC7D,qBAAa,aAAc,SAAQ,aAAa,CAC9C,WAAW,EACX,WAAW,EACX,SAAS,EACT,UAAU,CACX;IACC,MAAM,KAAK,gBAAgB,OAE1B;CACF;AAED,6CAA6C;AAC7C,qBAAa,kBAAmB,SAAQ,aAAa,CACnD,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,iBAAiB,CAClB;IACC,MAAM,KAAK,gBAAgB;;;;;;;;;;MAM1B;IACD,MAAM,KAAK,YAAY,uBAEtB;CACF;AAED,sCAAsC;AACtC,qBAAa,eAAgB,SAAQ,aAAa,CAChD,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,CACf;IACC,MAAM,KAAK,gBAAgB;;;;;;;MAK1B;IACD,MAAM,KAAK,YAAY,wBAEtB;CACF;AAED,yEAAyE;AACzE,qBAAa,eAAgB,SAAQ,aAAa,CAChD,aAAa,EACb,WAAW,EACX,SAAS,EACT,cAAc,CACf;IACC,MAAM,KAAK,gBAAgB;;;;;;;;;;;;;MAO1B;IACD,MAAM,KAAK,YAAY,wBAEtB;CACF;AAED,gDAAgD;AAChD,eAAO,MAAM,gBAAgB,6GAQnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,eAAe,CAAC;QAC7B,WAAW,EAAE,eAAe,CAAC;QAC7B,gBAAgB,EAAE,mBAAmB,CAAC;QACtC,SAAS,EAAE,aAAa,CAAC;QACzB,eAAe,EAAE,kBAAkB,CAAC;QACpC,WAAW,EAAE,eAAe,CAAC;QAC7B,WAAW,EAAE,eAAe,CAAC;KAC9B;CACF;AAID;;;GAGG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAYrC"}
|
package/dist/elements.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { RemoteElement } from "@remote-dom/core/elements";
|
|
2
|
-
class RbSliderElement extends RemoteElement {
|
|
3
|
-
static get remoteProperties() {
|
|
4
|
-
return {
|
|
5
|
-
value: { type: Number },
|
|
6
|
-
min: { type: Number },
|
|
7
|
-
max: { type: Number },
|
|
8
|
-
step: { type: Number },
|
|
9
|
-
disabled: { type: Boolean }
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
static get remoteEvents() {
|
|
13
|
-
return ["change"];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
class RbButtonElement extends RemoteElement {
|
|
17
|
-
static get remoteProperties() {
|
|
18
|
-
return {
|
|
19
|
-
label: { type: String },
|
|
20
|
-
variant: { type: String },
|
|
21
|
-
size: { type: String },
|
|
22
|
-
disabled: { type: Boolean }
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
static get remoteEvents() {
|
|
26
|
-
return ["press"];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
class RbIconButtonElement extends RemoteElement {
|
|
30
|
-
static get remoteProperties() {
|
|
31
|
-
return {
|
|
32
|
-
icon: { type: String },
|
|
33
|
-
variant: { type: String },
|
|
34
|
-
size: { type: String },
|
|
35
|
-
disabled: { type: Boolean }
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
static get remoteEvents() {
|
|
39
|
-
return ["press"];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
class RbTextElement extends RemoteElement {
|
|
43
|
-
static get remoteProperties() {
|
|
44
|
-
return {};
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
class RbTextInputElement extends RemoteElement {
|
|
48
|
-
static get remoteProperties() {
|
|
49
|
-
return {
|
|
50
|
-
value: { type: String },
|
|
51
|
-
placeholder: { type: String },
|
|
52
|
-
disabled: { type: Boolean }
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
static get remoteEvents() {
|
|
56
|
-
return ["input"];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
class RbSwitchElement extends RemoteElement {
|
|
60
|
-
static get remoteProperties() {
|
|
61
|
-
return {
|
|
62
|
-
checked: { type: Boolean },
|
|
63
|
-
disabled: { type: Boolean }
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
static get remoteEvents() {
|
|
67
|
-
return ["change"];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
class RbSelectElement extends RemoteElement {
|
|
71
|
-
static get remoteProperties() {
|
|
72
|
-
return {
|
|
73
|
-
value: { type: String },
|
|
74
|
-
options: { type: Array },
|
|
75
|
-
placeholder: { type: String },
|
|
76
|
-
disabled: { type: Boolean }
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
static get remoteEvents() {
|
|
80
|
-
return ["change"];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
const RB_ELEMENT_NAMES = [
|
|
84
|
-
"rb-slider",
|
|
85
|
-
"rb-button",
|
|
86
|
-
"rb-icon-button",
|
|
87
|
-
"rb-text",
|
|
88
|
-
"rb-text-input",
|
|
89
|
-
"rb-switch",
|
|
90
|
-
"rb-select"
|
|
91
|
-
];
|
|
92
|
-
let defined = false;
|
|
93
|
-
function defineElements() {
|
|
94
|
-
if (defined || typeof customElements === "undefined") return;
|
|
95
|
-
defined = true;
|
|
96
|
-
customElements.define("rb-slider", RbSliderElement);
|
|
97
|
-
customElements.define("rb-button", RbButtonElement);
|
|
98
|
-
customElements.define("rb-icon-button", RbIconButtonElement);
|
|
99
|
-
customElements.define("rb-text", RbTextElement);
|
|
100
|
-
customElements.define("rb-text-input", RbTextInputElement);
|
|
101
|
-
customElements.define("rb-switch", RbSwitchElement);
|
|
102
|
-
customElements.define("rb-select", RbSelectElement);
|
|
103
|
-
}
|
|
104
|
-
export {
|
|
105
|
-
RB_ELEMENT_NAMES,
|
|
106
|
-
RbButtonElement,
|
|
107
|
-
RbIconButtonElement,
|
|
108
|
-
RbSelectElement,
|
|
109
|
-
RbSliderElement,
|
|
110
|
-
RbSwitchElement,
|
|
111
|
-
RbTextElement,
|
|
112
|
-
RbTextInputElement,
|
|
113
|
-
defineElements
|
|
114
|
-
};
|
|
115
|
-
//# sourceMappingURL=elements.js.map
|
package/dist/elements.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/elements.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * rb-* remote element contract \u2014 shared by the sandbox (plugin author) and the\n * nexus host. This is the *stable* surface: it must only ever grow additively\n * (new elements / new optional properties), never break existing shapes.\n *\n * Verified against @remote-dom/core@1.11.x:\n * - `RemoteElement` lives in `@remote-dom/core/elements`\n * - static `remoteProperties` (data) + static `remoteEvents` (callbacks)\n */\nimport { RemoteElement } from \"@remote-dom/core/elements\";\n\ntype RbNoMethods = Record<never, never>;\ntype RbNoSlots = Record<never, never>;\ntype RbNoEvents = Record<never, never>;\n\nexport interface RbSliderProps {\n value?: number;\n min?: number;\n max?: number;\n step?: number;\n disabled?: boolean;\n}\n\nexport interface RbButtonProps {\n label?: string;\n variant?: string;\n size?: string;\n disabled?: boolean;\n}\n\nexport interface RbIconButtonProps {\n icon?: string;\n variant?: string;\n size?: string;\n disabled?: boolean;\n}\n\nexport type RbTextProps = Record<never, never>;\n\nexport interface RbTextInputProps {\n value?: string;\n placeholder?: string;\n disabled?: boolean;\n}\n\nexport interface RbSwitchProps {\n checked?: boolean;\n disabled?: boolean;\n}\n\n/** Option shape carried by `rb-select`'s `options` property. */\nexport interface RbSelectOption {\n value: string;\n label: string;\n}\n\nexport interface RbSelectProps {\n value?: string;\n options?: RbSelectOption[];\n placeholder?: string;\n disabled?: boolean;\n}\n\nexport interface RbSliderEvents {\n change(detail: number): void;\n}\n\nexport interface RbPressEvents {\n press(): void;\n}\n\nexport interface RbTextInputEvents {\n input(detail: string): void;\n}\n\nexport interface RbSwitchEvents {\n change(detail: boolean): void;\n}\n\nexport interface RbSelectEvents {\n change(detail: string): void;\n}\n\n/** Slider \u2192 host renders RBSlider (Radix array value, single-thumb contract). */\nexport class RbSliderElement extends RemoteElement<\n RbSliderProps,\n RbNoMethods,\n RbNoSlots,\n RbSliderEvents\n> {\n static get remoteProperties() {\n return {\n value: { type: Number },\n min: { type: Number },\n max: { type: Number },\n step: { type: Number },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"change\"] as const;\n }\n}\n\n/** Button \u2192 host renders RBLabelButton. */\nexport class RbButtonElement extends RemoteElement<\n RbButtonProps,\n RbNoMethods,\n RbNoSlots,\n RbPressEvents\n> {\n static get remoteProperties() {\n return {\n label: { type: String },\n variant: { type: String },\n size: { type: String },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"press\"] as const;\n }\n}\n\n/** Icon button \u2192 host renders RBIconButton with an icon resolved from RBIcons. */\nexport class RbIconButtonElement extends RemoteElement<\n RbIconButtonProps,\n RbNoMethods,\n RbNoSlots,\n RbPressEvents\n> {\n static get remoteProperties() {\n return {\n icon: { type: String },\n variant: { type: String },\n size: { type: String },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"press\"] as const;\n }\n}\n\n/** Plain text \u2014 renders its children as text on the host. */\nexport class RbTextElement extends RemoteElement<\n RbTextProps,\n RbNoMethods,\n RbNoSlots,\n RbNoEvents\n> {\n static get remoteProperties() {\n return {};\n }\n}\n\n/** Text input \u2192 host renders RBTextInput. */\nexport class RbTextInputElement extends RemoteElement<\n RbTextInputProps,\n RbNoMethods,\n RbNoSlots,\n RbTextInputEvents\n> {\n static get remoteProperties() {\n return {\n value: { type: String },\n placeholder: { type: String },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"input\"] as const;\n }\n}\n\n/** Switch \u2192 host renders RBSwitch. */\nexport class RbSwitchElement extends RemoteElement<\n RbSwitchProps,\n RbNoMethods,\n RbNoSlots,\n RbSwitchEvents\n> {\n static get remoteProperties() {\n return {\n checked: { type: Boolean },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"change\"] as const;\n }\n}\n\n/** Select \u2192 host renders RBSelectBox. `options` is `[{value,label}]`. */\nexport class RbSelectElement extends RemoteElement<\n RbSelectProps,\n RbNoMethods,\n RbNoSlots,\n RbSelectEvents\n> {\n static get remoteProperties() {\n return {\n value: { type: String },\n options: { type: Array },\n placeholder: { type: String },\n disabled: { type: Boolean },\n };\n }\n static get remoteEvents() {\n return [\"change\"] as const;\n }\n}\n\n/** Custom element tag names in the contract. */\nexport const RB_ELEMENT_NAMES = [\n \"rb-slider\",\n \"rb-button\",\n \"rb-icon-button\",\n \"rb-text\",\n \"rb-text-input\",\n \"rb-switch\",\n \"rb-select\",\n] as const;\n\nexport type RbElementName = (typeof RB_ELEMENT_NAMES)[number];\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"rb-slider\": RbSliderElement;\n \"rb-button\": RbButtonElement;\n \"rb-icon-button\": RbIconButtonElement;\n \"rb-text\": RbTextElement;\n \"rb-text-input\": RbTextInputElement;\n \"rb-switch\": RbSwitchElement;\n \"rb-select\": RbSelectElement;\n }\n}\n\nlet defined = false;\n\n/**\n * Registers the rb-* custom elements. Safe to call multiple times; only the\n * first call defines anything (subsequent calls are a no-op).\n */\nexport function defineElements(): void {\n if (defined || typeof customElements === \"undefined\") return;\n\n defined = true;\n\n customElements.define(\"rb-slider\", RbSliderElement);\n customElements.define(\"rb-button\", RbButtonElement);\n customElements.define(\"rb-icon-button\", RbIconButtonElement);\n customElements.define(\"rb-text\", RbTextElement);\n customElements.define(\"rb-text-input\", RbTextInputElement);\n customElements.define(\"rb-switch\", RbSwitchElement);\n customElements.define(\"rb-select\", RbSelectElement);\n}\n"],
|
|
5
|
-
"mappings": "AASA,SAAS,qBAAqB;AA2EvB,MAAM,wBAAwB,cAKnC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,KAAK,EAAE,MAAM,OAAO;AAAA,MACpB,KAAK,EAAE,MAAM,OAAO;AAAA,MACpB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW,eAAe;AACxB,WAAO,CAAC,QAAQ;AAAA,EAClB;AACF;AAGO,MAAM,wBAAwB,cAKnC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW,eAAe;AACxB,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;AAGO,MAAM,4BAA4B,cAKvC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,SAAS,EAAE,MAAM,OAAO;AAAA,MACxB,MAAM,EAAE,MAAM,OAAO;AAAA,MACrB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW,eAAe;AACxB,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;AAGO,MAAM,sBAAsB,cAKjC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO,CAAC;AAAA,EACV;AACF;AAGO,MAAM,2BAA2B,cAKtC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW,eAAe;AACxB,WAAO,CAAC,OAAO;AAAA,EACjB;AACF;AAGO,MAAM,wBAAwB,cAKnC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,SAAS,EAAE,MAAM,QAAQ;AAAA,MACzB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW,eAAe;AACxB,WAAO,CAAC,QAAQ;AAAA,EAClB;AACF;AAGO,MAAM,wBAAwB,cAKnC;AAAA,EACA,WAAW,mBAAmB;AAC5B,WAAO;AAAA,MACL,OAAO,EAAE,MAAM,OAAO;AAAA,MACtB,SAAS,EAAE,MAAM,MAAM;AAAA,MACvB,aAAa,EAAE,MAAM,OAAO;AAAA,MAC5B,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC5B;AAAA,EACF;AAAA,EACA,WAAW,eAAe;AACxB,WAAO,CAAC,QAAQ;AAAA,EAClB;AACF;AAGO,MAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAgBA,IAAI,UAAU;AAMP,SAAS,iBAAuB;AACrC,MAAI,WAAW,OAAO,mBAAmB,YAAa;AAEtD,YAAU;AAEV,iBAAe,OAAO,aAAa,eAAe;AAClD,iBAAe,OAAO,aAAa,eAAe;AAClD,iBAAe,OAAO,kBAAkB,mBAAmB;AAC3D,iBAAe,OAAO,WAAW,aAAa;AAC9C,iBAAe,OAAO,iBAAiB,kBAAkB;AACzD,iBAAe,OAAO,aAAa,eAAe;AAClD,iBAAe,OAAO,aAAa,eAAe;AACpD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/react.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAcpB,KAAK,YAAY,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAEzC,KAAK,2BAA2B,CAC9B,OAAO,EACP,KAAK,EACL,UAAU,GAAG,YAAY,IACvB,KAAK,GACP,UAAU,GAAG;IACX,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEJ,KAAK,sBAAsB,CACzB,OAAO,EACP,KAAK,EACL,UAAU,GAAG,YAAY,IACvB,aAAa,CAAC,2BAA2B,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;AAE3E,MAAM,MAAM,mBAAmB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,gBAAgB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAClD,MAAM,MAAM,mBAAmB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AACtD,MAAM,MAAM,mBAAmB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC7C;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,MAAM,EAId,sBAAsB,CAAC,eAAe,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAChF,eAAO,MAAM,MAAM,EAId,sBAAsB,CAAC,eAAe,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;AAC/E,eAAO,MAAM,UAAU,EAIlB,sBAAsB,CACzB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,CAClB,CAAC;AACF,eAAO,MAAM,IAAI,EAGZ,sBAAsB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AACxD,eAAO,MAAM,SAAS,EAIjB,sBAAsB,CACzB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,CACtB,CAAC;AACF,eAAO,MAAM,MAAM,EAId,sBAAsB,CAAC,eAAe,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAChF,eAAO,MAAM,MAAM,EAId,sBAAsB,CAAC,eAAe,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAEhF,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACjD,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var f=Object.defineProperty;var g=a=>{throw TypeError(a)};var h=(a,b,c)=>b in a?f(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c;var i=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0})};var j=(a,b,c)=>h(a,typeof b!="symbol"?b+"":b,c),d=(a,b,c)=>b.has(a)||g("Cannot "+c);var k=(a,b,c)=>(d(a,b,"read from private field"),c?c.call(a):b.get(a)),l=(a,b,c)=>b.has(a)?g("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),m=(a,b,c,e)=>(d(a,b,"write to private field"),e?e.call(a,c):b.set(a,c),c),n=(a,b,c)=>(d(a,b,"access private method"),c);export{i as a,j as b,k as c,l as d,m as e,n as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as v,c as P,d as Q,e as ee}from"./chunk-37HVFFJB.js";var M=class extends CustomEvent{respondWith(t){this.response=t}};var g=new WeakMap;var B=new WeakMap,ce=0;function y(e){let t=B.get(e);return t==null&&(t=String(ce++),k(e,t)),t}function k(e,t){B.set(e,t)}var L=new WeakMap;function S(e){return L.get(e)}var I=new WeakMap;function ae(e){let t=I.get(e);if(t!=null)return t;if(!(!(e instanceof Element)||e.tagName.includes("-"))){t={};for(let{name:r,value:n}of e.attributes)t[r]=n;return t}}var z=new WeakMap;function Y(e){return z.get(e)}function _(e,t,r){let n=L.get(e);if(n==null&&(n={},L.set(e,n)),n[t]===r)return;n[t]=r;let o=g.get(e);o?.mutate([[3,y(e),t,r,1]])}function A(e,t,r){let n=I.get(e);if(n==null&&(n={},I.set(e,n)),n[t]===r)return;r==null?delete n[t]:n[t]=String(r);let o=g.get(e);o?.mutate([[3,y(e),t,r,2]])}function j(e,t,r){let n=z.get(e);if(n==null&&(n={},z.set(e,n)),n[t]===r)return;r==null?delete n[t]:n[t]=r;let o=g.get(e);o?.mutate([[3,y(e),t,r,3]])}function D(e,t){if(g.get(e)!==t&&(g.set(e,t),e.childNodes))for(let n=0;n<e.childNodes.length;n++)D(e.childNodes[n],t)}function O(e){if(g.get(e)!=null&&(g.delete(e),e.childNodes))for(let r=0;r<e.childNodes.length;r++)O(e.childNodes[r])}function T(e){let{nodeType:t}=e;switch(t){case 1:return{id:y(e),type:t,element:e.localName,properties:w(S(e)),attributes:w(ae(e)),eventListeners:w(Y(e)),children:Array.from(e.childNodes).map(T)};case 3:case 8:return{id:y(e),type:t,data:e.data};default:throw new Error(`Cannot serialize node of type ${e.nodeType} (${typeof e.nodeType})`)}}function w(e){return e?{...e}:void 0}function te(e,t,...r){let n=B.get(e),o=g.get(e);if(n==null||o==null)throw new Error(`Cannot call method ${t} on an unconnected node`);return o.call(n,t,...r)}var U=Object.freeze({});var p=class extends HTMLElement{static get observedAttributes(){return this.finalize().__observedAttributes}static get remotePropertyDefinitions(){return this.finalize().__remotePropertyDefinitions}static get remoteAttributeDefinitions(){return this.finalize().__remoteAttributeDefinitions}static get remoteEventDefinitions(){return this.finalize().__remoteEventDefinitions}static get remoteSlotDefinitions(){return this.finalize().__remoteSlotDefinitions}static createProperty(t,r){F(t,r,this.observedAttributes,this.remotePropertyDefinitions,this.__attributeToPropertyMap,this.__eventToPropertyMap)}static finalize(){if(this.hasOwnProperty("__finalized"))return this;this.__finalized=!0;let{slottable:t,remoteSlots:r,remoteProperties:n,remoteAttributes:o,remoteEvents:i,remoteMethods:s}=this,c=Object.getPrototypeOf(this),a=new Set;t&&a.add("slot");let u=new Map,d=new Map,f=new Map,h=new Map,b=new Map,E=new Map;if(typeof c.finalize=="function"&&(c.finalize(),c.observedAttributes.forEach(l=>{a.add(l)}),c.remotePropertyDefinitions.forEach((l,m)=>{h.set(m,l)}),c.remoteAttributeDefinitions.forEach((l,m)=>{b.set(m,l)}),c.remoteEventDefinitions.forEach((l,m)=>{E.set(m,l)}),c.remoteSlotDefinitions.forEach((l,m)=>{f.set(m,l)})),r!=null&&(Array.isArray(r)?r:Object.keys(r)).forEach(m=>{f.set(m,U)}),n!=null&&(Array.isArray(n)?n.forEach(l=>{F(l,void 0,a,h,u,d)}):Object.keys(n).forEach(l=>{F(l,n[l],a,h,u,d)})),o?.forEach(l=>{b.set(l,U),a.add(l)}),i!=null&&(Array.isArray(i)?i.forEach(l=>{E.set(l,U)}):Object.keys(i).forEach(l=>{E.set(l,i[l])})),s!=null)if(Array.isArray(s))for(let l of s)this.prototype[l]=function(...m){return this.callRemoteMethod(l,...m)};else Object.assign(this,s);return Object.defineProperties(this,{__observedAttributes:{value:[...a],enumerable:!1},__remoteSlotDefinitions:{value:f,enumerable:!1},__remotePropertyDefinitions:{value:h,enumerable:!1},__remoteAttributeDefinitions:{value:b,enumerable:!1},__remoteEventDefinitions:{value:E,enumerable:!1},__attributeToPropertyMap:{value:u,enumerable:!1},__eventToPropertyMap:{value:d,enumerable:!1}}),this}constructor(){super(),this.constructor.finalize();let t={},r={},n=Object.getPrototypeOf(this),o=this.constructor;for(let[i,s]of o.remotePropertyDefinitions.entries()){let c=s.name;if(n.hasOwnProperty(i))continue;i===c&&(r[i]=s.default);let a={configurable:!0,enumerable:i===c,get:()=>S(this)?.[c],set:u=>{_(this,c,u)}};t[i]=a}for(let[i,s]of o.remoteEventDefinitions.entries()){let c=s.property??!0;if(!c)continue;let a=c===!0?`on${i}`:c;t[a]={configurable:!0,enumerable:!0,get:()=>N(this).properties.get(a)??null,set:u=>{let d=N(this),f=d.properties.get(a);if(typeof u=="function"){let h=function(...b){return u.call(this,...b)};d.properties.set(a,h),this.addEventListener(i,h)}else d.properties.delete(a);f&&this.removeEventListener(i,f)}}}Object.defineProperties(this,t),Object.assign(this,r)}attributeChangedCallback(t,r,n){if(t==="slot"&&this.constructor.slottable){A(this,t,n?String(n):void 0);return}let{remotePropertyDefinitions:o,remoteAttributeDefinitions:i,__attributeToPropertyMap:s}=this.constructor;if(i.has(t)){A(this,t,n);return}let c=s.get(t),a=c==null?c:o.get(c);a!=null&&(this[c]=ue(n,a.type))}connectedCallback(){for(let[t,r]of this.constructor.remoteEventDefinitions.entries())r.bubbles&&this.addEventListener(t,ne)}disconnectedCallback(){for(let[t,r]of this.constructor.remoteEventDefinitions.entries())r.bubbles&&this.removeEventListener(t,ne)}addEventListener(t,r,n){let{remoteEventDefinitions:o,__eventToPropertyMap:i}=this.constructor,s=o.get(t),c=i.get(t);if(s==null&&c==null)return super.addEventListener(t,r,n);let a=N(this),u=le.call(this,t,{property:c,definition:s}),d=typeof n=="object"&&n?.once?(...h)=>{let b=typeof r=="object"?r.handleEvent(...h):r.call(this,...h);return W.call(this,t,r,f),b}:r,f=[d,u];u.listeners.add(r),a.listeners.set(r,f),super.addEventListener(t,d,n),typeof n=="object"&&n.signal&&n.signal.addEventListener("abort",()=>{W.call(this,t,r,f)},{once:!0}),s?j(this,t,u.dispatch):_(this,c,u.dispatch)}removeEventListener(t,r,n){let o=$.get(this)?.listeners.get(r),i=o?o[0]:r;super.removeEventListener(t,i,n),o!=null&&W.call(this,t,r,o)}updateRemoteProperty(t,r){_(this,t,r)}updateRemoteAttribute(t,r){A(this,t,r)}callRemoteMethod(t,...r){return te(this,t,...r)}};v(p,"slottable",!0),v(p,"__finalized",!0),v(p,"__observedAttributes",[]),v(p,"__attributeToPropertyMap",new Map),v(p,"__eventToPropertyMap",new Map),v(p,"__remotePropertyDefinitions",new Map),v(p,"__remoteAttributeDefinitions",new Map),v(p,"__remoteEventDefinitions",new Map),v(p,"__remoteSlotDefinitions",new Map);var $=new WeakMap;function N(e){let t=$.get(e);return t||(t={events:new Map,properties:new Map,listeners:new WeakMap},$.set(e,t),t)}function le(e,{property:t,definition:r}){let n=N(this),o=n.events.get(e);return o==null&&(o={name:e,property:t,definition:r,listeners:new Set,dispatch:(...i)=>{let s=r?.dispatchEvent?.apply(this,i)??new M(e,{detail:i[0],bubbles:r?.bubbles});return this.dispatchEvent(s),s.response}},n.events.set(e,o)),o}function W(e,t,r){let n=N(this),o=r[1];o.listeners.delete(t),n.listeners.delete(t),!(o.listeners.size>0)&&(n.events.delete(e),o.property?S(this)?.[o.property]===o.dispatch&&_(this,o.property,void 0):Y(this)?.[e]===o.dispatch&&j(this,e,void 0))}function F(e,t,r,n,o,i){if(n.has(e))return n.get(e);let s=e[0]==="o"&&e[1]==="n",c=t??{},{alias:a}=c,{type:u=s?Function:String,attribute:d=u!==Function,event:f=s,default:h=u===Boolean?!1:void 0}=c;if(a==null){let m=e.toLowerCase();m!==e&&(a=[m]),s&&(a??(a=[]),a.unshift(`_${e}`))}let b;d===!0?b=re(e):typeof d=="string"&&(b=d),b&&(Array.isArray(r)?r.push(b):r.add(b),o.set(b,e));let E;f===!0?E=re(s?e.slice(2):e):typeof f=="string"&&(E=f),E&&i.set(E,e);let l={name:e,type:u,alias:a,event:E,attribute:b,default:h};if(n.set(e,l),a)for(let m of a)n.set(m,l);return l}function ue(e,t){if(e!=null)switch(t){case Boolean:return e!=null&&e!=="false";case Object:case Array:try{return JSON.parse(e)}catch{return}case String:return String(e);case Number:return Number.parseFloat(e);case Function:return;default:return t.parse?.(e)}}function re(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ne(){}var R,H=class extends MutationObserver{constructor(r){super(n=>{let o=[],i=[];for(let s of n){let c=y(s.target);if(s.type==="childList"){let a=s.previousSibling?pe(s.previousSibling,s.target.childNodes)+1:0;s.removedNodes.forEach(u=>{O(u),i.push([1,c,a])}),s.addedNodes.forEach((u,d)=>{o.some(f=>f===u||f.contains(u))||(o.push(u),D(u,r),i.push([0,c,T(u),a+d]))})}else s.type==="characterData"?i.push([2,c,s.target.textContent??""]):s.type==="attributes"&&s.attributeName!=null&&s.target instanceof Element&&!s.target.tagName.includes("-")&&i.push([3,c,s.attributeName,s.target.getAttribute(s.attributeName)])}r.mutate(i)});Q(this,R);this.connection=r,ee(this,R,new Set)}observe(r,n){let o=n?.id??"~";if(k(r,o),P(this,R).add(r),n?.initial!==!1&&r.childNodes.length>0){if(o!=="~")this.connection.mutate([[0,"~",T(r),P(this,R).size-1]]);else if(r.childNodes.length>0){let i=[];for(let s=0;s<r.childNodes.length;s++){let c=r.childNodes[s];D(c,this.connection),i.push([0,"~",T(c),s])}this.connection.mutate(i)}}super.observe(r,{subtree:!0,childList:!0,attributes:!0,characterData:!0,...n})}disconnect({empty:r=!1}={}){if(r&&P(this,R).size>0){let n=[];for(let o of P(this,R)){O(o);let i=y(o);if(i==="~")for(let s=0;s<o.childNodes.length;s++)n.push([1,i,0]);else n.push([1,"~",0])}this.connection.mutate(n)}P(this,R).clear(),super.disconnect()}};R=new WeakMap;function pe(e,t){for(let r=0;r<t.length;r++)if(t[r]===e)return r;return-1}var V=class extends p{static get remoteProperties(){return{value:{type:Number},min:{type:Number},max:{type:Number},step:{type:Number},disabled:{type:Boolean}}}static get remoteEvents(){return["change"]}},J=class extends p{static get remoteProperties(){return{label:{type:String},variant:{type:String},size:{type:String},disabled:{type:Boolean}}}static get remoteEvents(){return["press"]}},K=class extends p{static get remoteProperties(){return{icon:{type:String},variant:{type:String},size:{type:String},disabled:{type:Boolean}}}static get remoteEvents(){return["press"]}},X=class extends p{static get remoteProperties(){return{}}},Z=class extends p{static get remoteProperties(){return{value:{type:String},placeholder:{type:String},disabled:{type:Boolean}}}static get remoteEvents(){return["input"]}},q=class extends p{static get remoteProperties(){return{checked:{type:Boolean},disabled:{type:Boolean}}}static get remoteEvents(){return["change"]}},G=class extends p{static get remoteProperties(){return{value:{type:String},options:{type:Array},placeholder:{type:String},disabled:{type:Boolean}}}static get remoteEvents(){return["change"]}},De=["rb-slider","rb-button","rb-icon-button","rb-text","rb-text-input","rb-switch","rb-select"],ie=!1;function Oe(){ie||typeof customElements>"u"||(ie=!0,customElements.define("rb-slider",V),customElements.define("rb-button",J),customElements.define("rb-icon-button",K),customElements.define("rb-text",X),customElements.define("rb-text-input",Z),customElements.define("rb-switch",q),customElements.define("rb-select",G))}export{H as a,V as b,J as c,K as d,X as e,Z as f,q as g,G as h,De as i,Oe as j};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createContext as e,useContext as a}from"react";var t={pub:async(o,n)=>{console.warn("[plugin-ui] rb.pub called outside of a host context")},sub:async(o,n)=>(console.warn("[plugin-ui] rb.sub called outside of a host context"),{undeclare:async()=>{}}),action:async(o,n)=>{console.warn("[plugin-ui] rb.action called outside of a host context")},serve:async(o,n)=>(console.warn("[plugin-ui] rb.serve called outside of a host context"),{undeclare:async()=>{}}),toast:o=>{console.warn("[plugin-ui] rb.toast (no host):",o)}},r=e(t);function i(){return a(r)}export{r as a,i as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as Xt}from"./chunks/chunk-Q6XGCIPE.js";import{a as jt,j as Jt}from"./chunks/chunk-4MGSRUAS.js";import{a as Pe,b as T,c as l,d as _,e as Y,f as m}from"./chunks/chunk-37HVFFJB.js";var At=Symbol.for("quilt.threads.serialize"),$t=Symbol.for("quilt.threads.transferable");var G=class extends AbortController{constructor(...t){super();let e=t.find(r=>r.aborted);if(e)this.abort(e.reason);else{let r=i=>this.abort(i.target.reason),n={signal:this.signal};for(let i of t)i.addEventListener("abort",r,n)}}};var j=class extends Error{constructor(){super("You attempted to call a function on a closed thread.")}};var Ie="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";function at(s=21){let t="",e=crypto.getRandomValues(new Uint8Array(s));for(let r=0;r<s;r++)t+=Ie[63&e[r]];return t}var F,B,q,J,ht,Qt,ct=class{constructor(){_(this,ht);_(this,F,new Map);_(this,B,new Map);_(this,q,new Map);_(this,J,new WeakMap)}get(t){return l(this,B).get(t)}release(t){let e=l(this,B).get(t);return e&&(l(this,B).delete(t),l(this,F).delete(e)),!!e}serialize(t){let e=l(this,F).get(t);return e==null&&(e=at(),l(this,F).set(t,e),l(this,B).set(e,t)),e}deserialize(t,e){let r=l(this,q).get(t)?.deref();return r||(r=(...n)=>{if(!l(this,q).has(t))throw new Error("You attempted to call a function that was already revoked.");return e.call((i,o,c)=>{e.messages.send([3,i,t,o],c)},n)},m(this,ht,Qt).call(this,e)?.register(r,t),l(this,q).set(t,new WeakRef(r)),r)}};F=new WeakMap,B=new WeakMap,q=new WeakMap,J=new WeakMap,ht=new WeakSet,Qt=function(t){let e=l(this,J).get(t);if(!(typeof FinalizationRegistry>"u"))return e||(e=new FinalizationRegistry(r=>{t.messages.send([5,r])}),l(this,J).set(t,e)),e};function Zt(s){return s!=null&&(Symbol.asyncIterator in s||Symbol.iterator in s)&&typeof s.next=="function"}function Rt(s){if(s==null||typeof s!="object")return!1;let t=Object.getPrototypeOf(s);return t==null||t===Object.prototype}var vt="_@f",te="_@i",U,D,b,ft,v,ut=class{constructor(t){_(this,b);_(this,U);_(this,D);Y(this,U,t?.serialize),Y(this,D,t?.deserialize)}serialize(t,e,r){return m(this,b,ft).call(this,t,e,r)}deserialize(t,e){return m(this,b,v).call(this,t,e)}};U=new WeakMap,D=new WeakMap,b=new WeakSet,ft=function(t,e,r,n=new Map,i=!1){if(t==null)return t;if(n.has(t))return n.get(t);if(n.set(t,void 0),typeof t=="object"){if(l(this,U)&&!i){let a=l(this,U).call(this,t,u=>m(this,b,ft).call(this,u,e,r,n,!0),e,r);if(a!==void 0)return n.set(t,a),a}if(t[$t])return r?.push(t),n.set(t,t),t;let o=a=>m(this,b,ft).call(this,a,e,r,n);if(typeof t[At]=="function"){let a=t[At]({serialize:o});return n.set(t,a),a}if(Array.isArray(t)){let a=t.map(u=>o(u));return n.set(t,a),a}if(t instanceof Map){let a=[...t.entries()].map(([f,d])=>[o(f),o(d)]),u=new Map(a);return n.set(t,u),u}if(t instanceof Set){let a=[...t].map(f=>o(f)),u=new Set(a);return n.set(t,u),u}let c=Zt(t);if(Rt(t)||c){let a={};for(let u of Object.keys(t))a[u]=o(t[u]);return c&&(a.next??(a.next=o(t.next.bind(t))),a.return??(a.return=o(t.return.bind(t))),a.throw??(a.throw=o(t.throw.bind(t))),a[te]=!0),n.set(t,a),a}}if(typeof t=="function"){let o=e.functions.serialize(t,e,r),c={[vt]:o};return n.set(t,c),c}return n.set(t,t),t},v=function(t,e,r=!1){if(t==null)return t;if(typeof t=="object"){if(l(this,D)&&!r){let i=l(this,D).call(this,t,o=>m(this,b,v).call(this,o,e,!0),e);if(i!==void 0)return i}if(t==null)return t;if(Array.isArray(t))return t.map(i=>m(this,b,v).call(this,i,e));if(t instanceof Map)return new Map([...t].map(([i,o])=>[m(this,b,v).call(this,i,e),m(this,b,v).call(this,o,e)]));if(t instanceof Set)return new Set([...t].map(i=>m(this,b,v).call(this,i,e)));if(vt in t)return e.functions.deserialize(t[vt],e);if(!Rt(t))return t;let n={};for(let i of Object.keys(t))i===te?n[Symbol.asyncIterator]=()=>n:n[i]=m(this,b,v).call(this,t[i],e);return n}return t};var P,C,E,Ct,ee,Ot,re,lt=class{constructor(t,{imports:e,exports:r,functions:n=new ct,serialization:i=new ut,signal:o}={}){_(this,E);_(this,P);_(this,C,new Map);this.messages=t,Y(this,P,o?new G(o):new AbortController),this.exports=r??{},this.imports=ze(m(this,E,ee).bind(this),e),this.functions=n,this.serialization=i,this.functions.start?.(this),this.serialization.start?.(this),this.signal.addEventListener("abort",()=>{for(let c of l(this,C).keys())m(this,E,Ot).call(this,c,void 0,new j);l(this,C).clear()},{once:!0}),t.listen(async c=>{if(!(Array.isArray(c)&&typeof c[0]=="number"))return;let u=c;switch(u[0]){case 1:{let[,f,d,k]=u,xt=this.exports[d]??(()=>{throw new Error(`No '${d}' method is exported from this thread`)});await m(this,E,Ct).call(this,xt,k,(kt,Tt,St)=>{this.messages.send([2,f,kt,Tt],St)});break}case 3:{let[,f,d,k]=u,xt=this.functions.get(d,this)??He;await m(this,E,Ct).call(this,xt,k,(kt,Tt,St)=>{this.messages.send([4,f,kt,Tt],St)});break}case 2:case 4:{m(this,E,Ot).call(this,...u.slice(1));break}case 5:{let f=u[1];this.functions.release(f,this);break}}},{signal:this.signal})}get signal(){return l(this,P).signal}get closed(){return l(this,P).signal.aborted}close(){l(this,P).abort()}call(t,e){if(this.closed)return Promise.reject(new j);let r=[],n=this.serialization.serialize(e,this,r),i=at(),o=m(this,E,re).call(this,i);return t(i,n,r),o}};P=new WeakMap,C=new WeakMap,E=new WeakSet,Ct=async function(t,e,r){try{let n=this.functions.call?await this.functions.call(t,e,this):await t(...this.serialization.deserialize(e,this)),i=[],o=this.serialization.serialize(n,this,i);r(o,void 0,i)}catch(n){r(void 0,this.serialization.serialize(n,this))}},ee=function(t){return(...e)=>{try{if(typeof t!="string"&&typeof t!="number")throw new Error(`Can\u2019t call a symbol method on a thread: ${t.toString()}`);return this.call((r,n,i)=>{this.messages.send([1,r,t,n],i)},e)}catch(r){return Promise.reject(r)}}},Ot=function(...t){let e=t[0],r=l(this,C).get(e);r&&(r(...t),l(this,C).delete(e))},re=function(t){let e=new Promise((r,n)=>{l(this,C).set(t,(i,o,c)=>{c==null?r(this.serialization.deserialize(o,this)):n(this.serialization.deserialize(c,this))})});return Object.defineProperty(e,Symbol.asyncIterator,{async*value(){let r=await e;Object.defineProperty(r,Symbol.asyncIterator,{value:()=>r}),yield*r}}),e};function ze(s,t){let e;if(t==null){if(typeof Proxy!="function")throw new Error("You must pass an array of callable methods in environments without Proxies.");let r=new Map;e=new Proxy({},{get(n,i){if(r.has(i))return r.get(i);let o=s(i);return r.set(i,o),o}})}else{e={};for(let r of t)Object.defineProperty(e,r,{value:s(r),writable:!1,configurable:!0,enumerable:!0})}return e}function He(){throw new Error("You attempted to call a function that is not stored. It may have already been released.")}var y=class y extends lt{static from(t,e){return new y(t,e)}static import(t,e){return new y(t,e).imports}static export(t,e,r){new y(t,{...r,exports:e})}constructor(t,{targetOrigin:e="*",...r}={}){super(Ve(t,{targetOrigin:e}),r),this.window=t}};T(y,"iframe",Object.assign((t,e)=>y.from(Bt(t),e),{import:(t,e)=>y.import(Bt(t),e),export:(t,e,r)=>y.export(Bt(t),e,r)})),T(y,"parent",Object.assign(t=>y.from(Lt(),t),{import:t=>y.import(Lt(),t),export:(t,e)=>y.export(Lt(),t,e)})),T(y,"opener",Object.assign(t=>y.from(Nt(),t),{import:t=>y.import(Nt(),t),export:(t,e)=>y.export(Nt(),t,e)}));var X=y;function Nt(){if(typeof window>"u"||window.opener==null)throw new Error("No opener window found");return window.opener}function Lt(){if(typeof window>"u"||window.parent==null||window.parent===window)throw new Error("No parent window found");return window.parent}function Bt(s){if(s.contentWindow==null)throw new Error("No content window found");return s.contentWindow}function Ve(s,{targetOrigin:t="*"}={}){let e=function(n,i){s.postMessage(n,t,i)};return{send(r,n){return e(r,n)},listen(r,{signal:n}){self.addEventListener("message",i=>{i.source===s&&r(i.data)},{signal:n})}}}import{createElement as Be}from"react";import{createRoot as dr}from"react-dom/client";var x=Object.create(null);x.open="0";x.close="1";x.ping="2";x.pong="3";x.message="4";x.upgrade="5";x.noop="6";var $=Object.create(null);Object.keys(x).forEach(s=>{$[x[s]]=s});var Q={type:"error",data:"parser error"};var ie=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",oe=typeof ArrayBuffer=="function",ae=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Z=({type:s,data:t},e,r)=>ie&&t instanceof Blob?e?r(t):se(t,r):oe&&(t instanceof ArrayBuffer||ae(t))?e?r(t):se(new Blob([t]),r):r(x[s]+(t||"")),se=(s,t)=>{let e=new FileReader;return e.onload=function(){let r=e.result.split(",")[1];t("b"+(r||""))},e.readAsDataURL(s)};function ne(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var Pt;function ce(s,t){if(ie&&s.data instanceof Blob)return s.data.arrayBuffer().then(ne).then(t);if(oe&&(s.data instanceof ArrayBuffer||ae(s.data)))return t(ne(s.data));Z(s,!1,e=>{Pt||(Pt=new TextEncoder),t(Pt.encode(e))})}var he="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",tt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<he.length;s++)tt[he.charCodeAt(s)]=s;var fe=s=>{let t=s.length*.75,e=s.length,r,n=0,i,o,c,a;s[s.length-1]==="="&&(t--,s[s.length-2]==="="&&t--);let u=new ArrayBuffer(t),f=new Uint8Array(u);for(r=0;r<e;r+=4)i=tt[s.charCodeAt(r)],o=tt[s.charCodeAt(r+1)],c=tt[s.charCodeAt(r+2)],a=tt[s.charCodeAt(r+3)],f[n++]=i<<2|o>>4,f[n++]=(o&15)<<4|c>>2,f[n++]=(c&3)<<6|a&63;return u};var We=typeof ArrayBuffer=="function",et=(s,t)=>{if(typeof s!="string")return{type:"message",data:ue(s,t)};let e=s.charAt(0);return e==="b"?{type:"message",data:Ke(s.substring(1),t)}:$[e]?s.length>1?{type:$[e],data:s.substring(1)}:{type:$[e]}:Q},Ke=(s,t)=>{if(We){let e=fe(s);return ue(e,t)}else return{base64:!0,data:s}},ue=(s,t)=>{switch(t){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}};var le="",pe=(s,t)=>{let e=s.length,r=new Array(e),n=0;s.forEach((i,o)=>{Z(i,!1,c=>{r[o]=c,++n===e&&t(r.join(le))})})},de=(s,t)=>{let e=s.split(le),r=[];for(let n=0;n<e.length;n++){let i=et(e[n],t);if(r.push(i),i.type==="error")break}return r};function me(){return new TransformStream({transform(s,t){ce(s,e=>{let r=e.length,n;if(r<126)n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,r);else if(r<65536){n=new Uint8Array(3);let i=new DataView(n.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{n=new Uint8Array(9);let i=new DataView(n.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}s.data&&typeof s.data!="string"&&(n[0]|=128),t.enqueue(n),t.enqueue(e)})}})}var It;function pt(s){return s.reduce((t,e)=>t+e.length,0)}function dt(s,t){if(s[0].length===t)return s.shift();let e=new Uint8Array(t),r=0;for(let n=0;n<t;n++)e[n]=s[0][r++],r===s[0].length&&(s.shift(),r=0);return s.length&&r<s[0].length&&(s[0]=s[0].slice(r)),e}function ye(s,t){It||(It=new TextDecoder);let e=[],r=0,n=-1,i=!1;return new TransformStream({transform(o,c){for(e.push(o);;){if(r===0){if(pt(e)<1)break;let a=dt(e,1);i=(a[0]&128)===128,n=a[0]&127,n<126?r=3:n===126?r=1:r=2}else if(r===1){if(pt(e)<2)break;let a=dt(e,2);n=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),r=3}else if(r===2){if(pt(e)<8)break;let a=dt(e,8),u=new DataView(a.buffer,a.byteOffset,a.length),f=u.getUint32(0);if(f>Math.pow(2,21)-1){c.enqueue(Q);break}n=f*Math.pow(2,32)+u.getUint32(4),r=3}else{if(pt(e)<n)break;let a=dt(e,n);c.enqueue(et(i?a:It.decode(a),t)),r=0}if(n===0||n>s){c.enqueue(Q);break}}}})}var Mt=4;function p(s){if(s)return Ye(s)}function Ye(s){for(var t in p.prototype)s[t]=p.prototype[t];return s}p.prototype.on=p.prototype.addEventListener=function(s,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(t),this};p.prototype.once=function(s,t){function e(){this.off(s,e),t.apply(this,arguments)}return e.fn=t,this.on(s,e),this};p.prototype.off=p.prototype.removeListener=p.prototype.removeAllListeners=p.prototype.removeEventListener=function(s,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var e=this._callbacks["$"+s];if(!e)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var r,n=0;n<e.length;n++)if(r=e[n],r===t||r.fn===t){e.splice(n,1);break}return e.length===0&&delete this._callbacks["$"+s],this};p.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),e=this._callbacks["$"+s],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(e){e=e.slice(0);for(var r=0,n=e.length;r<n;++r)e[r].apply(this,t)}return this};p.prototype.emitReserved=p.prototype.emit;p.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};p.prototype.hasListeners=function(s){return!!this.listeners(s).length};var S=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,e)=>e(t,0),g=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ge="arraybuffer";function mt(s,...t){return t.reduce((e,r)=>(s.hasOwnProperty(r)&&(e[r]=s[r]),e),{})}var Ge=g.setTimeout,je=g.clearTimeout;function A(s,t){t.useNativeTimers?(s.setTimeoutFn=Ge.bind(g),s.clearTimeoutFn=je.bind(g)):(s.setTimeoutFn=g.setTimeout.bind(g),s.clearTimeoutFn=g.clearTimeout.bind(g))}var Je=1.33;function _e(s){return typeof s=="string"?Xe(s):Math.ceil((s.byteLength||s.size)*Je)}function Xe(s){let t=0,e=0;for(let r=0,n=s.length;r<n;r++)t=s.charCodeAt(r),t<128?e+=1:t<2048?e+=2:t<55296||t>=57344?e+=3:(r++,e+=4);return e}function yt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function be(s){let t="";for(let e in s)s.hasOwnProperty(e)&&(t.length&&(t+="&"),t+=encodeURIComponent(e)+"="+encodeURIComponent(s[e]));return t}function we(s){let t={},e=s.split("&");for(let r=0,n=e.length;r<n;r++){let i=e[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}var gt=class extends Error{constructor(t,e,r){super(t),this.description=e,this.context=r,this.type="TransportError"}},R=class extends p{constructor(t){super(),this.writable=!1,A(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,e,r){return super.emitReserved("error",new gt(t,e,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let e=et(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){let e=be(t);return e.length?"?"+e:""}};var rt=class extends R{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let e=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||e()})),this.writable||(r++,this.once("drain",function(){--r||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let e=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};de(t,this.socket.binaryType).forEach(e),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,pe(t,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",e=this.query||{};return this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=yt()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.createUri(t,e)}};var Ee=!1;try{Ee=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var xe=Ee;function $e(){}var Ft=class extends rt{constructor(t){if(super(t),typeof location<"u"){let e=location.protocol==="https:",r=location.port;r||(r=e?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,e){let r=this.request({method:"POST",data:t});r.on("success",e),r.on("error",(n,i)=>{this.onError("xhr post error",n,i)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(e,r)=>{this.onError("xhr poll error",e,r)}),this.pollXhr=t}},O=class s extends p{constructor(t,e,r){super(),this.createRequest=t,A(this,r),this._opts=r,this._method=r.method||"GET",this._uri=e,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;let e=mt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(e);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var n;r.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=$e,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};O.requestsCount=0;O.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ke);else if(typeof addEventListener=="function"){let s="onpagehide"in g?"pagehide":"unload";addEventListener(s,ke,!1)}}function ke(){for(let s in O.requests)O.requests.hasOwnProperty(s)&&O.requests[s].abort()}var Qe=(function(){let s=Te({xdomain:!1});return s&&s.responseType!==null})(),N=class extends Ft{constructor(t){super(t);let e=t&&t.forceBase64;this.supportsBinary=Qe&&!e}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new O(Te,this.uri(),t)}};function Te(s){let t=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||xe))return new XMLHttpRequest}catch{}if(!t)try{return new g[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Se=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Ut=class extends R{get name(){return"websocket"}doOpen(){let t=this.uri(),e=this.opts.protocols,r=Se?{}:mt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,e,r)}catch(n){return this.emitReserved("error",n)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let r=t[e],n=e===t.length-1;Z(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}n&&S(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=yt()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}},qt=g.WebSocket||g.MozWebSocket,L=class extends Ut{createSocket(t,e,r){return Se?new qt(t,e,r):e?new qt(t,e):new qt(t)}doWrite(t,e){this.ws.send(e)}};var z=class extends R{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{let e=ye(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(e).getReader(),n=me();n.readable.pipeTo(t.writable),this._writer=n.writable.getWriter();let i=()=>{r.read().then(({done:c,value:a})=>{c||(this.onPacket(a),i())}).catch(c=>{})};i();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let e=0;e<t.length;e++){let r=t[e],n=e===t.length-1;this._writer.write(r).then(()=>{n&&S(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var Dt={websocket:L,webtransport:z,polling:N};var Ze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,tr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function H(s){if(s.length>8e3)throw"URI too long";let t=s,e=s.indexOf("["),r=s.indexOf("]");e!=-1&&r!=-1&&(s=s.substring(0,e)+s.substring(e,r).replace(/:/g,";")+s.substring(r,s.length));let n=Ze.exec(s||""),i={},o=14;for(;o--;)i[tr[o]]=n[o]||"";return e!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=er(i,i.path),i.queryKey=rr(i,i.query),i}function er(s,t){let e=/\/{2,9}/g,r=t.replace(e,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function rr(s,t){let e={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,n,i){n&&(e[n]=i)}),e}var zt=typeof addEventListener=="function"&&typeof removeEventListener=="function",_t=[];zt&&addEventListener("offline",()=>{_t.forEach(s=>s())},!1);var I=class s extends p{constructor(t,e){if(super(),this.binaryType=ge,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(e=t,t=null),t){let r=H(t);e.hostname=r.host,e.secure=r.protocol==="https"||r.protocol==="wss",e.port=r.port,r.query&&(e.query=r.query)}else e.host&&(e.hostname=H(e.host).host);A(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(r=>{let n=r.prototype.name;this.transports.push(n),this._transportsByName[n]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=we(this.opts.query)),zt&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},_t.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let e=Object.assign({},this.opts.query);e.EIO=Mt,e.transport=t,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(t);e.open(),this.setTransport(e)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=new Error("server error");e.code=t.data,this._onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let r=0;r<this.writeBuffer.length;r++){let n=this.writeBuffer[r].data;if(n&&(e+=_e(n)),r>0&&e>this._maxPayload)return this.writeBuffer.slice(0,r);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,S(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,e,r){return this._sendPacket("message",t,e,r),this}send(t,e,r){return this._sendPacket("message",t,e,r),this}_sendPacket(t,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;let i={type:t,data:e,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),zt&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let r=_t.indexOf(this._offlineEventListener);r!==-1&&_t.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this._prevBufferLen=0}}};I.protocol=Mt;var bt=class extends I{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let e=this.createTransport(t),r=!1;I.priorWebsocketSuccess=!1;let n=()=>{r||(e.send([{type:"ping",data:"probe"}]),e.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;I.priorWebsocketSuccess=e.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(f(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{let k=new Error("probe error");k.transport=e.name,this.emitReserved("upgradeError",k)}}))};function i(){r||(r=!0,f(),e.close(),e=null)}let o=d=>{let k=new Error("probe error: "+d);k.transport=e.name,i(),this.emitReserved("upgradeError",k)};function c(){o("transport closed")}function a(){o("socket closed")}function u(d){e&&d.name!==e.name&&i()}let f=()=>{e.removeListener("open",n),e.removeListener("error",o),e.removeListener("close",c),this.off("close",a),this.off("upgrading",u)};e.once("open",n),e.once("error",o),e.once("close",c),this.once("close",a),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||e.open()},200):e.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let e=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&e.push(t[r]);return e}},V=class extends bt{constructor(t,e={}){let r=typeof t=="object"?t:e;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(n=>Dt[n]).filter(n=>!!n)),super(t,r)}};var Ks=V.protocol;function Ae(s,t="",e){let r=s;e=e||typeof location<"u"&&location,s==null&&(s=e.protocol+"//"+e.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=e.protocol+s:s=e.host+s),/^(https?|wss?):\/\//.test(s)||(typeof e<"u"?s=e.protocol+"//"+s:s="https://"+s),r=H(s)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";let i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(e&&e.port===r.port?"":":"+r.port),r}var Gt={};Pe(Gt,{Decoder:()=>Kt,Encoder:()=>Wt,PacketType:()=>h,isPacketValid:()=>ur,protocol:()=>Ne});var nr=typeof ArrayBuffer=="function",ir=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Re=Object.prototype.toString,or=typeof Blob=="function"||typeof Blob<"u"&&Re.call(Blob)==="[object BlobConstructor]",ar=typeof File=="function"||typeof File<"u"&&Re.call(File)==="[object FileConstructor]";function nt(s){return nr&&(s instanceof ArrayBuffer||ir(s))||or&&s instanceof Blob||ar&&s instanceof File}function st(s,t){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let e=0,r=s.length;e<r;e++)if(st(s[e]))return!0;return!1}if(nt(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return st(s.toJSON(),!0);for(let e in s)if(Object.prototype.hasOwnProperty.call(s,e)&&st(s[e]))return!0;return!1}function ve(s){let t=[],e=s.data,r=s;return r.data=Ht(e,t),r.attachments=t.length,{packet:r,buffers:t}}function Ht(s,t){if(!s)return s;if(nt(s)){let e={_placeholder:!0,num:t.length};return t.push(s),e}else if(Array.isArray(s)){let e=new Array(s.length);for(let r=0;r<s.length;r++)e[r]=Ht(s[r],t);return e}else if(typeof s=="object"&&!(s instanceof Date)){let e={};for(let r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=Ht(s[r],t));return e}return s}function Ce(s,t){return s.data=Vt(s.data,t),delete s.attachments,s}function Vt(s,t){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<t.length)return t[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let e=0;e<s.length;e++)s[e]=Vt(s[e],t);else if(typeof s=="object")for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(s[e]=Vt(s[e],t));return s}var Oe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Ne=5,h;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(h||(h={}));var Wt=class{constructor(t){this.replacer=t}encode(t){return(t.type===h.EVENT||t.type===h.ACK)&&st(t)?this.encodeAsBinary({type:t.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let e=""+t.type;return(t.type===h.BINARY_EVENT||t.type===h.BINARY_ACK)&&(e+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(e+=t.nsp+","),t.id!=null&&(e+=t.id),t.data!=null&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){let e=ve(t),r=this.encodeAsString(e.packet),n=e.buffers;return n.unshift(r),n}},Kt=class s extends p{constructor(t){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof t=="function"?{reviver:t}:t)}add(t){let e;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);let r=e.type===h.BINARY_EVENT;r||e.type===h.BINARY_ACK?(e.type=r?h.EVENT:h.ACK,this.reconstructor=new Yt(e),e.attachments===0&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else if(nt(t)||t.base64)if(this.reconstructor)e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let e=0,r={type:Number(t.charAt(0))};if(h[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===h.BINARY_EVENT||r.type===h.BINARY_ACK){let i=e+1;for(;t.charAt(++e)!=="-"&&e!=t.length;);let o=t.substring(i,e);if(o!=Number(o)||t.charAt(e)!=="-")throw new Error("Illegal attachments");let c=Number(o);if(!Le(c)||c<0)throw new Error("Illegal attachments");if(c>this.opts.maxAttachments)throw new Error("too many attachments");r.attachments=c}if(t.charAt(e+1)==="/"){let i=e+1;for(;++e&&!(t.charAt(e)===","||e===t.length););r.nsp=t.substring(i,e)}else r.nsp="/";let n=t.charAt(e+1);if(n!==""&&Number(n)==n){let i=e+1;for(;++e;){let o=t.charAt(e);if(o==null||Number(o)!=o){--e;break}if(e===t.length)break}r.id=Number(t.substring(i,e+1))}if(t.charAt(++e)){let i=this.tryParse(t.substr(e));if(s.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.opts.reviver)}catch{return!1}}static isPayloadValid(t,e){switch(t){case h.CONNECT:return wt(e);case h.DISCONNECT:return e===void 0;case h.CONNECT_ERROR:return typeof e=="string"||wt(e);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Oe.indexOf(e[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Yt=class{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){let e=Ce(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function cr(s){return typeof s=="string"}var Le=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s};function hr(s){return s===void 0||Le(s)}function wt(s){return Object.prototype.toString.call(s)==="[object Object]"}function fr(s,t){switch(s){case h.CONNECT:return t===void 0||wt(t);case h.DISCONNECT:return t===void 0;case h.EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Oe.indexOf(t[0])===-1);case h.ACK:return Array.isArray(t);case h.CONNECT_ERROR:return typeof t=="string"||wt(t);default:return!1}}function ur(s){return cr(s.nsp)&&hr(s.id)&&fr(s.type,s.data)}function w(s,t,e){return s.on(t,e),function(){s.off(t,e)}}var lr=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),W=class extends p{constructor(t,e,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[w(t,"open",this.onopen.bind(this)),w(t,"packet",this.onpacket.bind(this)),w(t,"error",this.onerror.bind(this)),w(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){var r,n,i;if(lr.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;let o={type:h.EVENT,data:e};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){let f=this.ids++,d=e.pop();this._registerAckCallback(f,d),o.id=f}let c=(n=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||n===void 0?void 0:n.writable,a=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,e){var r;let n=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(n===void 0){this.acks[t]=e;return}let i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===t&&this.sendBuffer.splice(c,1);e.call(this,new Error("operation has timed out"))},n),o=(...c)=>{this.io.clearTimeoutFn(i),e.apply(this,c)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...e){return new Promise((r,n)=>{let i=(o,c)=>o?n(o):r(c);i.withError=!0,e.push(i),this.emit(t,...e)})}_addToQueue(t){let e;typeof t[t.length-1]=="function"&&(e=t.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((n,...i)=>(this._queue[0],n!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(n)):(this._queue.shift(),e&&e(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){let r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case h.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(t);break;case h.ACK:case h.BINARY_ACK:this.onack(t);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){let e=t.data||[];t.id!=null&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let e=this._anyListeners.slice();for(let r of e)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){let e=this,r=!1;return function(...n){r||(r=!0,e.packet({type:h.ACK,id:t,data:n}))}}onack(t){let e=this.acks[t.id];typeof e=="function"&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let e=this._anyListeners;for(let r=0;r<e.length;r++)if(t===e[r])return e.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let e=this._anyOutgoingListeners;for(let r=0;r<e.length;r++)if(t===e[r])return e.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let e=this._anyOutgoingListeners.slice();for(let r of e)r.apply(this,t.data)}}};function M(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}M.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),e=Math.floor(t*this.jitter*s);s=(Math.floor(t*10)&1)==0?s-e:s+e}return Math.min(s,this.max)|0};M.prototype.reset=function(){this.attempts=0};M.prototype.setMin=function(s){this.ms=s};M.prototype.setMax=function(s){this.max=s};M.prototype.setJitter=function(s){this.jitter=s};var K=class extends p{constructor(t,e){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,A(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((r=e.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new M({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=t;let n=e.parser||Gt;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(e=this.backoff)===null||e===void 0||e.setMin(t),this)}randomizationFactor(t){var e;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(e=this.backoff)===null||e===void 0||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(e=this.backoff)===null||e===void 0||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new V(this.uri,this.opts);let e=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=w(e,"open",function(){r.onopen(),t&&t()}),i=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),t?t(c):this.maybeReconnectOnOpen()},o=w(e,"error",i);if(this._timeout!==!1){let c=this._timeout,a=this.setTimeoutFn(()=>{n(),i(new Error("timeout")),e.close()},c);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(n),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(w(t,"ping",this.onping.bind(this)),w(t,"data",this.ondata.bind(this)),w(t,"error",this.onerror.bind(this)),w(t,"close",this.onclose.bind(this)),w(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(e){this.onclose("parse error",e)}}ondecoded(t){S(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new W(this,t,e),this.nsps[t]=r),r}_destroy(t){let e=Object.keys(this.nsps);for(let r of e)if(this.nsps[r].active)return;this._close()}_packet(t){let e=this.encoder.encode(t);for(let r=0;r<e.length;r++)this.engine.write(e[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,e){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let e=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(n=>{n?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",n)):t.onreconnect()}))},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var it={};function ot(s,t){typeof s=="object"&&(t=s,s=void 0),t=t||{};let e=Ae(s,t.path||"/socket.io"),r=e.source,n=e.id,i=e.path,o=it[n]&&i in it[n].nsps,c=t.forceNew||t["force new connection"]||t.multiplex===!1||o,a;return c?a=new K(r,t):(it[n]||(it[n]=new K(r,t)),a=it[n]),e.query&&!t.query&&(t.query=e.queryKey),a.socket(e.path,t)}Object.assign(ot,{Manager:K,Socket:W,io:ot,connect:ot});function pr(s,t){return t.startsWith("/")?t.slice(1):`plugin/${s}/${t}`}var Et=class s{constructor(t,e){T(this,"_socket");T(this,"_pluginId");T(this,"_subHandlers",new Map);T(this,"_serveHandlers",new Map);this._socket=t,this._pluginId=e,t.on("msg",({topic:r,payload:n})=>{this._subHandlers.get(r)?.forEach(i=>i(n))}),t.on("serve_call",async({id:r,topic:n,payload:i})=>{let o=this._serveHandlers.get(n),c=o?await o(i):void 0;t.emit("serve_reply",{id:r,payload:c})})}static connect(t,e){return new Promise((r,n)=>{let i=ot(t,{transports:["websocket"]}),o=()=>{a(),r(new s(i,e))},c=u=>{a(),n(u)},a=()=>{i.off("connect",o),i.off("connect_error",c)};i.once("connect",o),i.once("connect_error",c)})}_key(t){return pr(this._pluginId,t)}async pub(t,e){this._socket.emit("pub",{topic:this._key(t),payload:e})}async sub(t,e){let r=this._key(t);this._subHandlers.has(r)||(this._subHandlers.set(r,new Set),this._socket.emit("sub",{topic:r}));let n=e;return this._subHandlers.get(r).add(n),{undeclare:()=>{let i=this._subHandlers.get(r);i&&(i.delete(n),i.size===0&&(this._subHandlers.delete(r),this._socket.emit("unsub",{topic:r})))}}}async action(t,e){return new Promise(r=>{this._socket.timeout(1e4).emit("action",{topic:this._key(t),payload:e},(n,i)=>{r(n?void 0:i)})})}async serve(t,e){let r=this._key(t);return this._serveHandlers.set(r,e),this._socket.emit("serve_register",{topic:r}),{undeclare:()=>{this._serveHandlers.delete(r),this._socket.emit("serve_unregister",{topic:r})}}}close(){this._socket.disconnect()}};function Hn(s){Jt(),X.parent.import({targetOrigin:"*"}).connect().then(async({connection:e,toast:r,socketUrl:n,pluginId:i})=>{let o=await Et.connect(n,i),c={pub:(f,d)=>o.pub(f,d),sub:(f,d)=>o.sub(f,d),action:(f,d)=>o.action(f,d),serve:(f,d)=>o.serve(f,d),toast:(f,d)=>r(f,d)},a=document.createElement("remote-root");document.body.append(a),new jt(e).observe(a),dr(a).render(Be(Xt.Provider,{value:c},Be(s)))})}export{Hn as connect};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunks/chunk-4MGSRUAS.js";import"./chunks/chunk-37HVFFJB.js";export{h as RB_ELEMENT_NAMES,b as RbButtonElement,c as RbIconButtonElement,g as RbSelectElement,a as RbSliderElement,f as RbSwitchElement,d as RbTextElement,e as RbTextInputElement,i as defineElements};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as A}from"./chunks/chunk-Q6XGCIPE.js";import{b as d,c as x,d as h,e as S,f as C,g as y,h as g}from"./chunks/chunk-4MGSRUAS.js";import"./chunks/chunk-37HVFFJB.js";import{forwardRef as L,useRef as T,isValidElement as k,cloneElement as M,createElement as I,useLayoutEffect as O}from"react";function o(n,w=customElements.get(n),{slotProps:m=!0,eventProps:B={}}={}){let N=!!m,c=(typeof m=="object"?m.wrapper:void 0)??!0,E=typeof c=="string"?c:c?"remote-fragment":!1,u=L(function(l,i){let a=T(),v=T(),r={},R=V(l.children);for(let e in l){let t=l[e];if(e==="slot"){r.slot=t;continue}if(N&&w.remoteSlotDefinitions.has(e)&&k(t)){E?R.push(I(E,{slot:e},t)):R.push(M(t,{slot:e}));continue}r[e]=t}return O(()=>{let e=a.current;if(e!=null){for(let t in r){if(t==="children")continue;let b=v.current?.[t],s=r[t];if(b===s)continue;let P=B[t];if(P){let f=P.event;b&&e.removeEventListener(f,b),s&&e.addEventListener(f,s);continue}if(t in e){e[t]=r[t];continue}s==null?e.removeAttribute(t):e.setAttribute(t,String(s))}v.current=r}}),I(n,{ref:e=>{a.current=e,typeof i=="function"?i(e):i!=null&&(i.current=e)}},...R)});return u.displayName=`RemoteComponent(${n})`,u}function V(n){return n==null?[]:Array.isArray(n)?[...n]:[n]}var p=n=>({eventProps:n}),G=o("rb-slider",d,p({onChange:{event:"change"}})),H=o("rb-button",x,p({onPress:{event:"press"}})),J=o("rb-icon-button",h,p({onPress:{event:"press"}})),K=o("rb-text",S),Q=o("rb-text-input",C,p({onInput:{event:"input"}})),U=o("rb-switch",y,p({onChange:{event:"change"}})),X=o("rb-select",g,p({onChange:{event:"change"}}));export{H as Button,J as IconButton,X as Select,G as Slider,U as Switch,K as Text,Q as TextInput,A as useRb};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunks/chunk-Q6XGCIPE.js";import"./chunks/chunk-37HVFFJB.js";export{a as RbContext,b as useRb};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./react-runtime.js"; export { default } from "./react-runtime.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./react-runtime.js"; export { default } from "./react-runtime.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./react-runtime.js"; export { default } from "./react-runtime.js";
|