{"version":3,"file":"elements.mjs","sources":["../../../../../../packages/elements/src/utils.ts","../../../../../../packages/elements/src/extract-projectable-nodes.ts","../../../../../../packages/elements/src/component-factory-strategy.ts","../../../../../../packages/elements/src/create-custom-element.ts","../../../../../../packages/elements/src/version.ts","../../../../../../packages/elements/public_api.ts","../../../../../../packages/elements/index.ts","../../../../../../packages/elements/elements.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {ComponentFactoryResolver, Injector, Type} from '@angular/core';\n\n/**\n * Provide methods for scheduling the execution of a callback.\n */\nexport const scheduler = {\n  /**\n   * Schedule a callback to be called after some delay.\n   *\n   * Returns a function that when executed will cancel the scheduled function.\n   */\n  schedule(taskFn: () => void, delay: number): () => void {\n    const id = setTimeout(taskFn, delay);\n    return () => clearTimeout(id);\n  },\n\n  /**\n   * Schedule a callback to be called before the next render.\n   * (If `window.requestAnimationFrame()` is not available, use `scheduler.schedule()` instead.)\n   *\n   * Returns a function that when executed will cancel the scheduled function.\n   */\n  scheduleBeforeRender(taskFn: () => void): () => void {\n    // TODO(gkalpak): Implement a better way of accessing `requestAnimationFrame()`\n    //                (e.g. accounting for vendor prefix, SSR-compatibility, etc).\n    if (typeof window === 'undefined') {\n      // For SSR just schedule immediately.\n      return scheduler.schedule(taskFn, 0);\n    }\n\n    if (typeof window.requestAnimationFrame === 'undefined') {\n      const frameMs = 16;\n      return scheduler.schedule(taskFn, frameMs);\n    }\n\n    const id = window.requestAnimationFrame(taskFn);\n    return () => window.cancelAnimationFrame(id);\n  },\n};\n\n/**\n * Convert a camelCased string to kebab-cased.\n */\nexport function camelToDashCase(input: string): string {\n  return input.replace(/[A-Z]/g, char => `-${char.toLowerCase()}`);\n}\n\n/**\n * Check whether the input is an `Element`.\n */\nexport function isElement(node: Node|null): node is Element {\n  return !!node && node.nodeType === Node.ELEMENT_NODE;\n}\n\n/**\n * Check whether the input is a function.\n */\nexport function isFunction(value: any): value is Function {\n  return typeof value === 'function';\n}\n\n/**\n * Convert a kebab-cased string to camelCased.\n */\nexport function kebabToCamelCase(input: string): string {\n  return input.replace(/-([a-z\\d])/g, (_, char) => char.toUpperCase());\n}\n\nlet _matches: (this: any, selector: string) => boolean;\n\n/**\n * Check whether an `Element` matches a CSS selector.\n * NOTE: this is duplicated from @angular/upgrade, and can\n * be consolidated in the future\n */\nexport function matchesSelector(el: any, selector: string): boolean {\n  if (!_matches) {\n    const elProto = <any>Element.prototype;\n    _matches = elProto.matches || elProto.matchesSelector || elProto.mozMatchesSelector ||\n        elProto.msMatchesSelector || elProto.oMatchesSelector || elProto.webkitMatchesSelector;\n  }\n  return el.nodeType === Node.ELEMENT_NODE ? _matches.call(el, selector) : false;\n}\n\n/**\n * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n */\nexport function strictEquals(value1: any, value2: any): boolean {\n  return value1 === value2 || (value1 !== value1 && value2 !== value2);\n}\n\n/** Gets a map of default set of attributes to observe and the properties they affect. */\nexport function getDefaultAttributeToPropertyInputs(\n    inputs: {propName: string, templateName: string, transform?: (value: any) => any}[]) {\n  const attributeToPropertyInputs:\n      {[key: string]: [propName: string, transform: ((value: any) => any)|undefined]} = {};\n  inputs.forEach(({propName, templateName, transform}) => {\n    attributeToPropertyInputs[camelToDashCase(templateName)] = [propName, transform];\n  });\n\n  return attributeToPropertyInputs;\n}\n\n/**\n * Gets a component's set of inputs. Uses the injector to get the component factory where the inputs\n * are defined.\n */\nexport function getComponentInputs(component: Type<any>, injector: Injector): {\n  propName: string,\n  templateName: string,\n  transform?: (value: any) => any,\n}[] {\n  const componentFactoryResolver = injector.get(ComponentFactoryResolver);\n  const componentFactory = componentFactoryResolver.resolveComponentFactory(component);\n  return componentFactory.inputs;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// NOTE: This is a (slightly improved) version of what is used in ngUpgrade's\n//       `DowngradeComponentAdapter`.\n// TODO(gkalpak): Investigate if it makes sense to share the code.\n\nimport {isElement, matchesSelector} from './utils';\n\nexport function extractProjectableNodes(host: HTMLElement, ngContentSelectors: string[]): Node[][] {\n  const nodes = host.childNodes;\n  const projectableNodes: Node[][] = ngContentSelectors.map(() => []);\n  let wildcardIndex = -1;\n\n  ngContentSelectors.some((selector, i) => {\n    if (selector === '*') {\n      wildcardIndex = i;\n      return true;\n    }\n    return false;\n  });\n\n  for (let i = 0, ii = nodes.length; i < ii; ++i) {\n    const node = nodes[i];\n    const ngContentIndex = findMatchingIndex(node, ngContentSelectors, wildcardIndex);\n\n    if (ngContentIndex !== -1) {\n      projectableNodes[ngContentIndex].push(node);\n    }\n  }\n\n  return projectableNodes;\n}\n\nfunction findMatchingIndex(node: Node, selectors: string[], defaultIndex: number): number {\n  let matchingIndex = defaultIndex;\n\n  if (isElement(node)) {\n    selectors.some((selector, i) => {\n      if ((selector !== '*') && matchesSelector(node, selector)) {\n        matchingIndex = i;\n        return true;\n      }\n      return false;\n    });\n  }\n\n  return matchingIndex;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ComponentRef, EventEmitter, Injector, NgZone, OnChanges, SimpleChange, SimpleChanges, Type} from '@angular/core';\nimport {merge, Observable, ReplaySubject} from 'rxjs';\nimport {map, switchMap} from 'rxjs/operators';\n\nimport {NgElementStrategy, NgElementStrategyEvent, NgElementStrategyFactory} from './element-strategy';\nimport {extractProjectableNodes} from './extract-projectable-nodes';\nimport {isFunction, scheduler, strictEquals} from './utils';\n\n/** Time in milliseconds to wait before destroying the component ref when disconnected. */\nconst DESTROY_DELAY = 10;\n\n/**\n * Factory that creates new ComponentNgElementStrategy instance. Gets the component factory with the\n * constructor's injector's factory resolver and passes that factory to each strategy.\n */\nexport class ComponentNgElementStrategyFactory implements NgElementStrategyFactory {\n  componentFactory: ComponentFactory<any>;\n\n  constructor(component: Type<any>, injector: Injector) {\n    this.componentFactory =\n        injector.get(ComponentFactoryResolver).resolveComponentFactory(component);\n  }\n\n  create(injector: Injector) {\n    return new ComponentNgElementStrategy(this.componentFactory, injector);\n  }\n}\n\n/**\n * Creates and destroys a component ref using a component factory and handles change detection\n * in response to input changes.\n */\nexport class ComponentNgElementStrategy implements NgElementStrategy {\n  // Subject of `NgElementStrategyEvent` observables corresponding to the component's outputs.\n  private eventEmitters = new ReplaySubject<Observable<NgElementStrategyEvent>[]>(1);\n\n  /** Merged stream of the component's output events. */\n  readonly events = this.eventEmitters.pipe(switchMap(emitters => merge(...emitters)));\n\n  /** Reference to the component that was created on connect. */\n  private componentRef: ComponentRef<any>|null = null;\n\n  /** Reference to the component view's `ChangeDetectorRef`. */\n  private viewChangeDetectorRef: ChangeDetectorRef|null = null;\n\n  /**\n   * Changes that have been made to component inputs since the last change detection run.\n   * (NOTE: These are only recorded if the component implements the `OnChanges` interface.)\n   */\n  private inputChanges: SimpleChanges|null = null;\n\n  /** Whether changes have been made to component inputs since the last change detection run. */\n  private hasInputChanges = false;\n\n  /** Whether the created component implements the `OnChanges` interface. */\n  private implementsOnChanges = false;\n\n  /** Whether a change detection has been scheduled to run on the component. */\n  private scheduledChangeDetectionFn: (() => void)|null = null;\n\n  /** Callback function that when called will cancel a scheduled destruction on the component. */\n  private scheduledDestroyFn: (() => void)|null = null;\n\n  /** Initial input values that were set before the component was created. */\n  private readonly initialInputValues = new Map<string, any>();\n\n  /**\n   * Set of component inputs that have not yet changed, i.e. for which `recordInputChange()` has not\n   * fired.\n   * (This helps detect the first change of an input, even if it is explicitly set to `undefined`.)\n   */\n  private readonly unchangedInputs: Set<string>;\n\n  /** Service for setting zone context. */\n  private readonly ngZone: NgZone;\n\n  /** The zone the element was created in or `null` if Zone.js is not loaded. */\n  private readonly elementZone: Zone|null;\n\n\n  constructor(private componentFactory: ComponentFactory<any>, private injector: Injector) {\n    this.unchangedInputs =\n        new Set<string>(this.componentFactory.inputs.map(({propName}) => propName));\n    this.ngZone = this.injector.get<NgZone>(NgZone);\n    this.elementZone = (typeof Zone === 'undefined') ? null : this.ngZone.run(() => Zone.current);\n  }\n\n  /**\n   * Initializes a new component if one has not yet been created and cancels any scheduled\n   * destruction.\n   */\n  connect(element: HTMLElement) {\n    this.runInZone(() => {\n      // If the element is marked to be destroyed, cancel the task since the component was\n      // reconnected\n      if (this.scheduledDestroyFn !== null) {\n        this.scheduledDestroyFn();\n        this.scheduledDestroyFn = null;\n        return;\n      }\n\n      if (this.componentRef === null) {\n        this.initializeComponent(element);\n      }\n    });\n  }\n\n  /**\n   * Schedules the component to be destroyed after some small delay in case the element is just\n   * being moved across the DOM.\n   */\n  disconnect() {\n    this.runInZone(() => {\n      // Return if there is no componentRef or the component is already scheduled for destruction\n      if (this.componentRef === null || this.scheduledDestroyFn !== null) {\n        return;\n      }\n\n      // Schedule the component to be destroyed after a small timeout in case it is being\n      // moved elsewhere in the DOM\n      this.scheduledDestroyFn = scheduler.schedule(() => {\n        if (this.componentRef !== null) {\n          this.componentRef.destroy();\n          this.componentRef = null;\n          this.viewChangeDetectorRef = null;\n        }\n      }, DESTROY_DELAY);\n    });\n  }\n\n  /**\n   * Returns the component property value. If the component has not yet been created, the value is\n   * retrieved from the cached initialization values.\n   */\n  getInputValue(property: string): any {\n    return this.runInZone(() => {\n      if (this.componentRef === null) {\n        return this.initialInputValues.get(property);\n      }\n\n      return this.componentRef.instance[property];\n    });\n  }\n\n  /**\n   * Sets the input value for the property. If the component has not yet been created, the value is\n   * cached and set when the component is created.\n   */\n  setInputValue(property: string, value: any, transform?: (value: any) => any): void {\n    this.runInZone(() => {\n      if (transform) {\n        value = transform.call(this.componentRef?.instance, value);\n      }\n\n      if (this.componentRef === null) {\n        this.initialInputValues.set(property, value);\n        return;\n      }\n\n      // Ignore the value if it is strictly equal to the current value, except if it is `undefined`\n      // and this is the first change to the value (because an explicit `undefined` _is_ strictly\n      // equal to not having a value set at all, but we still need to record this as a change).\n      if (strictEquals(value, this.getInputValue(property)) &&\n          !((value === undefined) && this.unchangedInputs.has(property))) {\n        return;\n      }\n\n      // Record the changed value and update internal state to reflect the fact that this input has\n      // changed.\n      this.recordInputChange(property, value);\n      this.unchangedInputs.delete(property);\n      this.hasInputChanges = true;\n\n      // Update the component instance and schedule change detection.\n      this.componentRef.instance[property] = value;\n      this.scheduleDetectChanges();\n    });\n  }\n\n  /**\n   * Creates a new component through the component factory with the provided element host and\n   * sets up its initial inputs, listens for outputs changes, and runs an initial change detection.\n   */\n  protected initializeComponent(element: HTMLElement) {\n    const childInjector = Injector.create({providers: [], parent: this.injector});\n    const projectableNodes =\n        extractProjectableNodes(element, this.componentFactory.ngContentSelectors);\n    this.componentRef = this.componentFactory.create(childInjector, projectableNodes, element);\n    this.viewChangeDetectorRef = this.componentRef.injector.get(ChangeDetectorRef);\n\n    this.implementsOnChanges = isFunction((this.componentRef.instance as OnChanges).ngOnChanges);\n\n    this.initializeInputs();\n    this.initializeOutputs(this.componentRef);\n\n    this.detectChanges();\n\n    const applicationRef = this.injector.get<ApplicationRef>(ApplicationRef);\n    applicationRef.attachView(this.componentRef.hostView);\n  }\n\n  /** Set any stored initial inputs on the component's properties. */\n  protected initializeInputs(): void {\n    this.componentFactory.inputs.forEach(({propName, transform}) => {\n      if (this.initialInputValues.has(propName)) {\n        // Call `setInputValue()` now that the component has been instantiated to update its\n        // properties and fire `ngOnChanges()`.\n        this.setInputValue(propName, this.initialInputValues.get(propName), transform);\n      }\n    });\n\n    this.initialInputValues.clear();\n  }\n\n  /** Sets up listeners for the component's outputs so that the events stream emits the events. */\n  protected initializeOutputs(componentRef: ComponentRef<any>): void {\n    const eventEmitters: Observable<NgElementStrategyEvent>[] =\n        this.componentFactory.outputs.map(({propName, templateName}) => {\n          const emitter: EventEmitter<any> = componentRef.instance[propName];\n          return emitter.pipe(map(value => ({name: templateName, value})));\n        });\n\n    this.eventEmitters.next(eventEmitters);\n  }\n\n  /** Calls ngOnChanges with all the inputs that have changed since the last call. */\n  protected callNgOnChanges(componentRef: ComponentRef<any>): void {\n    if (!this.implementsOnChanges || this.inputChanges === null) {\n      return;\n    }\n\n    // Cache the changes and set inputChanges to null to capture any changes that might occur\n    // during ngOnChanges.\n    const inputChanges = this.inputChanges;\n    this.inputChanges = null;\n    (componentRef.instance as OnChanges).ngOnChanges(inputChanges);\n  }\n\n  /**\n   * Marks the component view for check, if necessary.\n   * (NOTE: This is required when the `ChangeDetectionStrategy` is set to `OnPush`.)\n   */\n  protected markViewForCheck(viewChangeDetectorRef: ChangeDetectorRef): void {\n    if (this.hasInputChanges) {\n      this.hasInputChanges = false;\n      viewChangeDetectorRef.markForCheck();\n    }\n  }\n\n  /**\n   * Schedules change detection to run on the component.\n   * Ignores subsequent calls if already scheduled.\n   */\n  protected scheduleDetectChanges(): void {\n    if (this.scheduledChangeDetectionFn) {\n      return;\n    }\n\n    this.scheduledChangeDetectionFn = scheduler.scheduleBeforeRender(() => {\n      this.scheduledChangeDetectionFn = null;\n      this.detectChanges();\n    });\n  }\n\n  /**\n   * Records input changes so that the component receives SimpleChanges in its onChanges function.\n   */\n  protected recordInputChange(property: string, currentValue: any): void {\n    // Do not record the change if the component does not implement `OnChanges`.\n    if (!this.implementsOnChanges) {\n      return;\n    }\n\n    if (this.inputChanges === null) {\n      this.inputChanges = {};\n    }\n\n    // If there already is a change, modify the current value to match but leave the values for\n    // `previousValue` and `isFirstChange`.\n    const pendingChange = this.inputChanges[property];\n    if (pendingChange) {\n      pendingChange.currentValue = currentValue;\n      return;\n    }\n\n    const isFirstChange = this.unchangedInputs.has(property);\n    const previousValue = isFirstChange ? undefined : this.getInputValue(property);\n    this.inputChanges[property] = new SimpleChange(previousValue, currentValue, isFirstChange);\n  }\n\n  /** Runs change detection on the component. */\n  protected detectChanges(): void {\n    if (this.componentRef === null) {\n      return;\n    }\n\n    this.callNgOnChanges(this.componentRef);\n    this.markViewForCheck(this.viewChangeDetectorRef!);\n    this.componentRef.changeDetectorRef.detectChanges();\n  }\n\n  /** Runs in the angular zone, if present. */\n  private runInZone(fn: () => unknown) {\n    return (this.elementZone && Zone.current !== this.elementZone) ? this.ngZone.run(fn) : fn();\n  }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, Type} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {ComponentNgElementStrategyFactory} from './component-factory-strategy';\nimport {NgElementStrategy, NgElementStrategyFactory} from './element-strategy';\nimport {getComponentInputs, getDefaultAttributeToPropertyInputs} from './utils';\n\n/**\n * Prototype for a class constructor based on an Angular component\n * that can be used for custom element registration. Implemented and returned\n * by the {@link createCustomElement createCustomElement() function}.\n *\n * @see [Angular Elements Overview](guide/elements \"Turning Angular components into custom elements\")\n *\n * @publicApi\n */\nexport interface NgElementConstructor<P> {\n  /**\n   * An array of observed attribute names for the custom element,\n   * derived by transforming input property names from the source component.\n   */\n  readonly observedAttributes: string[];\n\n  /**\n   * Initializes a constructor instance.\n   * @param injector If provided, overrides the configured injector.\n   */\n  new(injector?: Injector): NgElement&WithProperties<P>;\n}\n\n/**\n * Implements the functionality needed for a custom element.\n *\n * @publicApi\n */\nexport abstract class NgElement extends HTMLElement {\n  /**\n   * The strategy that controls how a component is transformed in a custom element.\n   */\n  protected abstract ngElementStrategy: NgElementStrategy;\n  /**\n   * A subscription to change, connect, and disconnect events in the custom element.\n   */\n  protected ngElementEventsSubscription: Subscription|null = null;\n\n  /**\n   * Prototype for a handler that responds to a change in an observed attribute.\n   * @param attrName The name of the attribute that has changed.\n   * @param oldValue The previous value of the attribute.\n   * @param newValue The new value of the attribute.\n   * @param namespace The namespace in which the attribute is defined.\n   * @returns Nothing.\n   */\n  abstract attributeChangedCallback(\n      attrName: string, oldValue: string|null, newValue: string, namespace?: string): void;\n  /**\n   * Prototype for a handler that responds to the insertion of the custom element in the DOM.\n   * @returns Nothing.\n   */\n  abstract connectedCallback(): void;\n  /**\n   * Prototype for a handler that responds to the deletion of the custom element from the DOM.\n   * @returns Nothing.\n   */\n  abstract disconnectedCallback(): void;\n}\n\n/**\n * Additional type information that can be added to the NgElement class,\n * for properties that are added based\n * on the inputs and methods of the underlying component.\n *\n * @publicApi\n */\nexport type WithProperties<P> = {\n  [property in keyof P]: P[property]\n};\n\n/**\n * A configuration that initializes an NgElementConstructor with the\n * dependencies and strategy it needs to transform a component into\n * a custom element class.\n *\n * @publicApi\n */\nexport interface NgElementConfig {\n  /**\n   * The injector to use for retrieving the component's factory.\n   */\n  injector: Injector;\n  /**\n   * An optional custom strategy factory to use instead of the default.\n   * The strategy controls how the transformation is performed.\n   */\n  strategyFactory?: NgElementStrategyFactory;\n}\n\n/**\n *  @description Creates a custom element class based on an Angular component.\n *\n * Builds a class that encapsulates the functionality of the provided component and\n * uses the configuration information to provide more context to the class.\n * Takes the component factory's inputs and outputs to convert them to the proper\n * custom element API and add hooks to input changes.\n *\n * The configuration's injector is the initial injector set on the class,\n * and used by default for each created instance.This behavior can be overridden with the\n * static property to affect all newly created instances, or as a constructor argument for\n * one-off creations.\n *\n * @see [Angular Elements Overview](guide/elements \"Turning Angular components into custom elements\")\n *\n * @param component The component to transform.\n * @param config A configuration that provides initialization information to the created class.\n * @returns The custom-element construction class, which can be registered with\n * a browser's `CustomElementRegistry`.\n *\n * @publicApi\n */\nexport function createCustomElement<P>(\n    component: Type<any>, config: NgElementConfig): NgElementConstructor<P> {\n  const inputs = getComponentInputs(component, config.injector);\n\n  const strategyFactory =\n      config.strategyFactory || new ComponentNgElementStrategyFactory(component, config.injector);\n\n  const attributeToPropertyInputs = getDefaultAttributeToPropertyInputs(inputs);\n\n  class NgElementImpl extends NgElement {\n    // Work around a bug in closure typed optimizations(b/79557487) where it is not honoring static\n    // field externs. So using quoted access to explicitly prevent renaming.\n    static readonly['observedAttributes'] = Object.keys(attributeToPropertyInputs);\n\n    protected override get ngElementStrategy(): NgElementStrategy {\n      // TODO(andrewseguin): Add e2e tests that cover cases where the constructor isn't called. For\n      // now this is tested using a Google internal test suite.\n      if (!this._ngElementStrategy) {\n        const strategy = this._ngElementStrategy =\n            strategyFactory.create(this.injector || config.injector);\n\n        // Re-apply pre-existing input values (set as properties on the element) through the\n        // strategy.\n        inputs.forEach(({propName, transform}) => {\n          if (!this.hasOwnProperty(propName)) {\n            // No pre-existing value for `propName`.\n            return;\n          }\n\n          // Delete the property from the instance and re-apply it through the strategy.\n          const value = (this as any)[propName];\n          delete (this as any)[propName];\n          strategy.setInputValue(propName, value, transform);\n        });\n      }\n\n      return this._ngElementStrategy!;\n    }\n\n    private _ngElementStrategy?: NgElementStrategy;\n\n    constructor(private readonly injector?: Injector) {\n      super();\n    }\n\n    override attributeChangedCallback(\n        attrName: string, oldValue: string|null, newValue: string, namespace?: string): void {\n      const [propName, transform] = attributeToPropertyInputs[attrName]!;\n      this.ngElementStrategy.setInputValue(propName, newValue, transform);\n    }\n\n    override connectedCallback(): void {\n      // For historical reasons, some strategies may not have initialized the `events` property\n      // until after `connect()` is run. Subscribe to `events` if it is available before running\n      // `connect()` (in order to capture events emitted during initialization), otherwise subscribe\n      // afterwards.\n      //\n      // TODO: Consider deprecating/removing the post-connect subscription in a future major version\n      //       (e.g. v11).\n\n      let subscribedToEvents = false;\n\n      if (this.ngElementStrategy.events) {\n        // `events` are already available: Subscribe to it asap.\n        this.subscribeToEvents();\n        subscribedToEvents = true;\n      }\n\n      this.ngElementStrategy.connect(this);\n\n      if (!subscribedToEvents) {\n        // `events` were not initialized before running `connect()`: Subscribe to them now.\n        // The events emitted during the component initialization have been missed, but at least\n        // future events will be captured.\n        this.subscribeToEvents();\n      }\n    }\n\n    override disconnectedCallback(): void {\n      // Not using `this.ngElementStrategy` to avoid unnecessarily creating the `NgElementStrategy`.\n      if (this._ngElementStrategy) {\n        this._ngElementStrategy.disconnect();\n      }\n\n      if (this.ngElementEventsSubscription) {\n        this.ngElementEventsSubscription.unsubscribe();\n        this.ngElementEventsSubscription = null;\n      }\n    }\n\n    private subscribeToEvents(): void {\n      // Listen for events from the strategy and dispatch them as custom events.\n      this.ngElementEventsSubscription = this.ngElementStrategy.events.subscribe(e => {\n        const customEvent = new CustomEvent(e.name, {detail: e.value});\n        this.dispatchEvent(customEvent);\n      });\n    }\n  }\n\n  // Add getters and setters to the prototype for each property input.\n  inputs.forEach(({propName, transform}) => {\n    Object.defineProperty(NgElementImpl.prototype, propName, {\n      get(): any {\n        return this.ngElementStrategy.getInputValue(propName);\n      },\n      set(newValue: any): void {\n        this.ngElementStrategy.setInputValue(propName, newValue, transform);\n      },\n      configurable: true,\n      enumerable: true,\n    });\n  });\n\n  return (NgElementImpl as any) as NgElementConstructor<P>;\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('17.0.5');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the `elements` package.\n */\nexport {createCustomElement, NgElement, NgElementConfig, NgElementConstructor, WithProperties} from './src/create-custom-element';\nexport {NgElementStrategy, NgElementStrategyEvent, NgElementStrategyFactory} from './src/element-strategy';\nexport {VERSION} from './src/version';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Gener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