/*! grafana - v4.2.0 - 2017-03-24
 * Copyright (c) 2017 Torkel Ödegaard; Licensed Apache-2.0 */

System.register(["lodash","./variable"],function(a,b){"use strict";var c,d,e;b&&b.id;return{setters:[function(a){c=a},function(a){d=a}],execute:function(){e=function(){function a(a){this.model=a,this.defaults={type:"adhoc",name:"",label:"",hide:0,datasource:null,filters:[]},d.assignModelProperties(this,a,this.defaults)}return a.$inject=["model"],a.prototype.setValue=function(a){return Promise.resolve()},a.prototype.getSaveModel=function(){return d.assignModelProperties(this.model,this,this.defaults),this.model},a.prototype.updateOptions=function(){return Promise.resolve()},a.prototype.dependsOn=function(a){return!1},a.prototype.setValueFromUrl=function(a){return c.default.isArray(a)||(a=[a]),this.filters=a.map(function(a){var b=a.split("|");return{key:b[0],operator:b[1],value:b[2]}}),Promise.resolve()},a.prototype.getValueForUrl=function(){return this.filters.map(function(a){return a.key+"|"+a.operator+"|"+a.value})},a.prototype.setFilters=function(a){this.filters=a},a}(),a("AdhocVariable",e),d.variableTypes.adhoc={name:"Ad hoc filters",ctor:e,description:"Add key/value filters on the fly"}}}});