"use strict";function _classCallCheck(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function t(t,n){for(var a=0;a<n.length;a++){var i=n[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(n,a,i){return a&&t(n.prototype,a),i&&t(n,i),n}}();!function(){window.gl=window.gl||{},window.gl.LinkedTabs=function(){function t(n){var a=this;_classCallCheck(this,t),this.options=n||{},this.defaultAction=this.options.defaultAction,this.action=this.options.action||this.defaultAction,"show"===this.action&&(this.action=this.defaultAction),this.currentLocation=window.location;var i=this.options.parentEl+' a[data-toggle="tab"]';$(document).off("shown.bs.tab",i).on("shown.bs.tab",i,function(t){return a.tabShown(t)}),this.activateTab(this.action)}return _createClass(t,[{key:"tabShown",value:function(t){var n=t.target.getAttribute("href");return this.setCurrentAction(n)}},{key:"setCurrentAction",value:function(t){var n=t;n.replace(/\/+$/,"");var a=""+n+this.currentLocation.search+this.currentLocation.hash;return history.replaceState({turbolinks:!0,url:a},document.title,a),a}},{key:"activateTab",value:function(){return $(this.options.parentEl+" a[data-action='"+this.action+"']").tab("show")}}]),t}()}();