/*
    *
    * Wijmo Library 5.20183.550
    * http://wijmo.com/
    *
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    *
    * Licensed under the GrapeCity Commercial License.
    * sales@wijmo.com
    * wijmo.com/products/wijmo-5/license/
    *
    */
import*as wjcCore from"wijmo/wijmo";var __glob="undefined"!=typeof window?window:self;import{Component,EventEmitter,NgModule,ViewChild,ComponentFactoryResolver}from"@angular/core";import{ElementRef,Injector,Directive,ViewContainerRef,Optional,forwardRef}from"@angular/core";import{Input,Inject,SkipSelf}from"@angular/core";import*as ngCore from"@angular/core";import{CommonModule}from"@angular/common";import{WjDirectiveBehavior,WjDirectiveBaseModule}from"wijmo/wijmo.angular2.directiveBase";export var wjTooltipMeta={selector:"[wjTooltip]",inputs:[],outputs:["initialized"],exportAs:"wjTooltip",providers:[]};export class WjTooltip{constructor(e,t,o){this.isInitialized=!1;this._wjBehaviour=WjDirectiveBehavior.attach(this,e,t,o);this._elRef=e,WjTooltip._toolTip||(WjTooltip._toolTip=new wjcCore.Tooltip),this.created()}created(){}ngOnInit(){this._wjBehaviour.ngOnInit()}ngAfterViewInit(){this._wjBehaviour.ngAfterViewInit()}ngOnDestroy(){this._wjBehaviour.ngOnDestroy(),this.wjTooltip=null}get wjTooltip(){return this._toolTipText}set wjTooltip(e){this._toolTipText!=e&&(this._toolTipText,WjTooltip._toolTip.setTooltip(this._elRef.nativeElement,e))}};WjTooltip.meta={outputs:wjTooltipMeta.outputs},WjTooltip.decorators=[{type:Directive,args:[{selector:wjTooltipMeta.selector,inputs:wjTooltipMeta.inputs,outputs:wjTooltipMeta.outputs,exportAs:wjTooltipMeta.exportAs,providers:[{provide:"WjComponent",useExisting:forwardRef(()=>WjTooltip)},...wjTooltipMeta.providers]}]}],WjTooltip.ctorParameters=(()=>[{type:ElementRef,decorators:[{type:Inject,args:[ElementRef]}]},{type:Injector,decorators:[{type:Inject,args:[Injector]}]},{type:void 0,decorators:[{type:Inject,args:["WjComponent"]},{type:SkipSelf},{type:Optional}]}]),WjTooltip.propDecorators={wjTooltip:[{type:Input}]};export class WjComponentLoader{constructor(e,t){this._cmpResolver=e,this._elementRef=t,this._isInit=!1,this.propertiesChange=new ngCore.EventEmitter}get component(){return this._component}set component(e){this._component!==e&&(this._component=e,this._createComponent())}get properties(){return this._properties}set properties(e){this._properties=e,this._updateProperties()}ngOnInit(){this._isInit=!0,this._createComponent()}_createComponent(){if(this._isInit){this._cmpRef&&(this._cmpRef.destroy(),this._cmpRef=null);let e=this._component;e&&this._anchor&&(this._cmpRef=this._anchor.createComponent(this._cmpResolver.resolveComponentFactory(e)),this._updateProperties())}}_updateProperties(){let e=this._cmpRef&&this._cmpRef.instance,t=this.properties;if(e&&t){let o=Object.getOwnPropertyNames(t);for(let r of o){e[r]=t[r];let o=e[r+"Change"];o instanceof EventEmitter&&this._addPropListener(e,r,o)}}}_addPropListener(e,t,o){o.subscribe(o=>{this.properties[t]=this.properties[t]=e[t],this.propertiesChange.next(this.properties)})}};WjComponentLoader.decorators=[{type:Component,args:[{selector:"wj-component-loader",template:`<div #anchor></div>`,inputs:["component","properties"],outputs:["propertiesChange"]}]}],WjComponentLoader.ctorParameters=(()=>[{type:ComponentFactoryResolver,decorators:[{type:Inject,args:[ComponentFactoryResolver]}]},{type:ElementRef,decorators:[{type:Inject,args:[ElementRef]}]}]),WjComponentLoader.propDecorators={_anchor:[{type:ViewChild,args:["anchor",{read:ViewContainerRef}]}]};let moduleExports=[WjTooltip,WjComponentLoader];export class WjCoreModule{};WjCoreModule.decorators=[{type:NgModule,args:[{imports:[WjDirectiveBaseModule,CommonModule],declarations:[...moduleExports],exports:[...moduleExports]}]}],WjCoreModule.ctorParameters=(()=>[]);