| 249 | private _slots?: Record<string, Node[]> |
| 250 | |
| 251 | constructor( |
| 252 | /** |
| 253 | * Component def - note this may be an AsyncWrapper, and this._def will |
| 254 | * be overwritten by the inner component when resolved. |
| 255 | */ |
| 256 | private _def: InnerComponentDef, |
| 257 | private _props: Record<string, any> = {}, |
| 258 | private _createApp: CreateAppFunction<Element> = createApp, |
| 259 | ) { |
| 260 | super() |
| 261 | if (this.shadowRoot && _createApp !== createApp) { |
| 262 | this._root = this.shadowRoot |
| 263 | } else { |
| 264 | if (__DEV__ && this.shadowRoot) { |
| 265 | warn( |
| 266 | `Custom element has pre-rendered declarative shadow root but is not ` + |
| 267 | `defined as hydratable. Use \`defineSSRCustomElement\`.`, |
| 268 | ) |
| 269 | } |
| 270 | if (_def.shadowRoot !== false) { |
| 271 | this.attachShadow( |
| 272 | extend({}, _def.shadowRootOptions, { |
| 273 | mode: 'open', |
| 274 | }) as ShadowRootInit, |
| 275 | ) |
| 276 | this._root = this.shadowRoot! |
| 277 | } else { |
| 278 | this._root = this |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | connectedCallback(): void { |
| 284 | // avoid resolving component if it's not connected |