text: define([],function(){"use strict";var a={options:{rootUrl:null,selectedUrl:null,resultKey:null,selected:null,webspace:null,locale:null,actionOnGhost:!1,instanceNamePrefix:"smart-content-",selectCallback:function(a){}},templates:{columnNavigationContainer:"<div/>"}},b={responsive:!1,actionIcon:"fa-check",linkedName:"linked",typeName:"type",hasSubName:"hasChildren",showOptions:!1,sortable:!1,showStatus:!0},c="smart-content.datasource.";return{defaults:a,events:{names:{setSelected:{postFix:"set-selected",type:"on"}},namespace:c},initialize:function(){this.selected=this.options.selected,this.render(),this.columnNavigationOptions=this.sandbox.util.extend(!0,{},b,{el:this.$columnNavigationElement,instanceName:this.options.instanceNamePrefix+this.options.instanceName,url:this.getUrl(this.selected),fallbackUrl:this.getUrl(),actionOnGhost:this.options.actionOnGhost,resultKey:this.options.resultKey,selected:this.selected,actionCallback:function(a){this.selected=a.id,this.options.selectCallback(a.id,a.path,a.title,a)}.bind(this)}),this.startColumnNavigation(this.columnNavigationOptions).then(this.bindCustomEvents.bind(this))},getUrl:function(a){return a?this.prepareUrl(this.options.selectedUrl,a):this.prepareUrl(this.options.rootUrl)},prepareUrl:function(a,b){return a=a.replace("{locale}",this.options.locale),a=a.replace("{webspace}",this.options.webspace),a=a.replace("/{datasource}","/"+b||"")},startColumnNavigation:function(a){return this.sandbox.start([{name:"column-navigation@husky",options:a}])},render:function(){this.$columnNavigationElement&&this.sandbox.stop(this.$columnNavigationElement),this.$columnNavigationElement=this.sandbox.dom.createElement(this.templates.columnNavigationContainer()),this.html(this.$columnNavigationElement)},setSelected:function(a){this.selected=a,this.sandbox.emit("husky.column-navigation.smart-content-"+this.options.instanceName+".set-options",{selected:a,url:this.getUrl(a)})},bindCustomEvents:function(){this.events.setSelected(this.setSelected.bind(this))}}});