/* Copyright © 2020 Splunk Inc.
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
in part without a valid written license from Splunk Inc. is PROHIBITED. */
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/TestHelpers.ts
var TestHelpers_exports = {};
__export(TestHelpers_exports, {
  ast: () => ast,
  chessDSL: () => chessDSL,
  context: () => context,
  defconDSL: () => defconDSL,
  dslEncoding: () => dslEncoding,
  dynamicOptions: () => dynamicOptions,
  expr0: () => expr0,
  expr1: () => expr1,
  expr2: () => expr2,
  optionsAST: () => optionsAST,
  svDynamicOptions: () => svDynamicOptions,
  svDynamicOptions2: () => svDynamicOptions2,
  testThemeRegistry: () => testThemeRegistry,
  valueExprs1: () => valueExprs1
});
module.exports = __toCommonJS(TestHelpers_exports);

// esm-externals:@splunk/visualization-themes/helper
var helper_exports = {};
__export(helper_exports, {
  default: () => helper_default
});
var defaultImport = __toESM(require("@splunk/visualization-themes/helper"));
__reExport(helper_exports, require("@splunk/visualization-themes/helper"));
var helper_default = "default" in defaultImport ? defaultImport.default : defaultImport;

// src/TestHelpers.ts
var expr0 = { type: "identifier", v: "WOPR" };
var expr1 = {
  type: "method",
  name: "print",
  args: [
    { type: "string", v: "how" },
    { type: "string", v: "about" },
    { type: "string", v: "a" },
    { type: "string", v: "nice" },
    { type: "string", v: "game" }
  ]
};
var expr2 = {
  type: "method",
  name: "println",
  args: [
    { type: "string", v: "OF" },
    { type: "string", v: "CHESS" }
  ]
};
var valueExprs1 = [expr0, expr1, expr2];
var chessDSL = "WOPR|print('how','about','a','nice','game')|println('OF','CHESS')";
var defconDSL = "WOPR|defenseCondition(0)|prefix('xxx')|rangeValue(ranges)|matchValue(matches)";
var ast = {
  context: {
    defconColors: {
      colors: ["red", "orange", "yellow", "blue", "green"]
    }
  },
  dimensions: {
    warGames: {
      value: valueExprs1
    },
    conclusion: {
      value: [
        {
          type: "identifier",
          v: "WOPR"
        },
        { type: "method", name: "defenseCondition", args: [{ type: "number", v: 0 }] },
        { type: "method", name: "prefix", args: [{ type: "string", v: "xxx" }] },
        { type: "method", name: "rangeValue", args: [{ type: "identifier", v: "ranges" }] },
        { type: "method", name: "matchValue", args: [{ type: "identifier", v: "matches" }] }
      ]
    }
  }
};
var dslEncoding = {
  context: {
    defconColors: {
      colors: ["red", "orange", "yellow", "blue", "green"]
    }
  },
  dimensions: {
    warGames: {
      value: chessDSL
    },
    conclusion: {
      value: defconDSL
    }
  }
};
var dynamicOptions = {
  options: {
    aNumber: 42,
    aString: "a string",
    aColor: "#FF0000",
    aTime: /* @__PURE__ */ new Date("Thu Jul 16 2020 19:47:12 GMT-0700 (PDT)"),
    expression1: "  > `aString`",
    expression2: ">primary|last() ",
    expression3: `>${chessDSL}`,
    expression4: `>${defconDSL}`
  },
  context: {
    foo: "FOO",
    bar: "BAR",
    nest: {
      nestFoo: "NESTFOO",
      nestBar: "NESTBAR"
    }
  }
};
var optionsAST = {
  simpleOptions: {
    aNumber: 42,
    aString: "a string",
    aColor: "#FF0000",
    aTime: /* @__PURE__ */ new Date("Thu Jul 16 2020 19:47:12 GMT-0700 (PDT)")
  },
  expressions: {
    expression1: [{ type: "string", v: "aString" }],
    expression2: [
      { type: "identifier", v: "primary" },
      { type: "method", name: "last", args: [] }
    ],
    expression3: valueExprs1,
    expression4: [
      {
        type: "identifier",
        v: "WOPR"
      },
      { type: "method", name: "defenseCondition", args: [{ type: "number", v: 0 }] },
      { type: "method", name: "prefix", args: [{ type: "string", v: "xxx" }] },
      { type: "method", name: "rangeValue", args: [{ type: "identifier", v: "ranges" }] },
      { type: "method", name: "matchValue", args: [{ type: "identifier", v: "matches" }] }
    ]
  },
  context: {
    foo: "FOO",
    bar: "BAR",
    nest: {
      nestFoo: "NESTFOO",
      nestBar: "NESTBAR"
    }
  }
};
var context = {
  majorThreshold: [
    {
      from: 3,
      value: "#A52A2A"
    },
    {
      from: 2,
      to: 3,
      value: "#FFFF00"
    },
    {
      from: 1,
      to: 2,
      value: "#800080"
    },
    {
      to: 1,
      value: "#0000FF"
    }
  ],
  deltaThreshold: [
    {
      from: 3,
      value: "white"
    },
    {
      from: 2,
      to: 3,
      value: "brown"
    },
    {
      from: 1,
      to: 2,
      value: "gray"
    },
    {
      to: 1,
      value: "black"
    }
  ],
  backgroundThreshold: [
    {
      from: 3,
      value: "yellow"
    },
    {
      from: 2,
      to: 3,
      value: "green"
    },
    {
      from: 1,
      to: 2,
      value: "blue"
    },
    {
      to: 1,
      value: "red"
    }
  ]
};
var svDynamicOptions = {
  context,
  options: {
    sparkline: "> primary|seriesByType('number')",
    major: "> sparkline|lastPoint()",
    majorColor: "> major|rangeValue(majorThreshold)",
    delta: "> sparkline|delta(-2)",
    deltaColor: "> delta|rangeValue(deltaThreshold)",
    backgroundColor: "> delta|rangeValue(backgroundThreshold)",
    notBasedOnData: ">42",
    xColor: ">themes.x",
    yColor: ">themes.y",
    zColor: "blue",
    aNumber: 42,
    aColor: ">2|rangeValue(majorThreshold)",
    aFormattedTheme: ">themes.aNumber|rangeValue(majorThreshold)",
    singleSeries: "> seriesByIndex(0)",
    multiSeries: "> frameBySeriesIndexRange(0, 2)",
    singleSeriesFieldName: ">singleSeries|getField()",
    multiSeriesFieldName: ">multiSeries|getField()"
  }
};
var svDynamicOptions2 = {
  context,
  options: {
    meh: "> primary | prefix('$')",
    sparkline: "> primary | seriesByType('string') | prefix('$')",
    major: "> primary | seriesByType('string') | lastPoint()"
  }
};
var testThemeRegistry = (0, helper_exports.createThemeRegistry)("@splunk/foobar", "BazViz");
testThemeRegistry.addDefaultTheme("enterprise", {
  x: "red",
  y: "green",
  aNumber: 2
});
//# sourceMappingURL=TestHelpers.js.map
