//>>built
(function(a){"object"===typeof module&&"object"===typeof module.exports?(a=a(require,exports),void 0!==a&&(module.exports=a)):"function"===typeof define&&define.amd&&define("require exports tslib ../widget-core/WidgetBase ../widget-core/d ../widget-core/decorators/diffProperty ./Link".split(" "),a)})(function(a,g){function h(a,b){void 0===a&&(a={});void 0===b&&(b={});return Object.keys(a).every(function(f){return a[f]===b[f]})}Object.defineProperty(g,"__esModule",{value:!0});var e=a("tslib"),k=a("../widget-core/WidgetBase"),
l=a("../widget-core/d"),m=a("../widget-core/decorators/diffProperty"),n=a("./Link");a=function(a){function b(){return null!==a&&a.apply(this,arguments)||this}e.__extends(b,a);b.prototype._renderLink=function(a){void 0===a&&(a=!1);var c=this.properties,f=c.activeClasses,d=c.classes,d=void 0===d?[]:d,c=e.__rest(c,["activeClasses","classes"]),d=Array.isArray(d)?d:[d];a&&(d=e.__spread(d,f));c=e.__assign({},c,{classes:d});return l.w(n.default,c,this.children)};b.prototype._onOutletPropertyChange=function(a,
c){var b=this,d=c.to;a=c.routerKey;a=this.registry.getInjector(void 0===a?"router":a);this._outletHandle&&(this._outletHandle.destroy(),this._outletHandle=void 0);a&&(this._outletHandle=a.injector().on("outlet",function(a){a.outlet.id===d&&b.invalidate()}))};b.prototype.render=function(){var a=this.properties,c=a.to,b=a.routerKey,a=a.params,b=this.registry.getInjector(void 0===b?"router":b);if(!b)return this._renderLink();c=(c=b.injector().getOutlet(c))&&h(a,c.params);return this._renderLink(c)};
e.__decorate([m.default("to")],b.prototype,"_onOutletPropertyChange",null);return b}(k.default);g.ActiveLink=a;g.default=a});