"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.Variant1 = void 0;

var _react = require("react");

var _TopologySelectorModal = require("./TopologySelectorModal");

var _jsxRuntime = require("react/jsx-runtime");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var _default = {
  title: "TopologySelectorModal",
  component: _TopologySelectorModal.TopologySelectorModal
};
exports.default = _default;
var data = [{
  name: "cluster",
  id: "017e83b4-719a-4217-abee-4c57f45905d2",
  icon: "kubernetes",
  components: [{
    name: "nodes",
    id: "017e83c0-2b1e-bad9-6085-f5a5b32a23a2",
    icon: "server",
    status: "healthy",
    summary: {
      healthy: 3
    },
    components: [{
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }, {
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }, {
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }],
    created_at: "2022-01-22T21:45:16.317433",
    updated_at: "2022-01-23T07:21:23.44984"
  }],
  properties: [{
    name: "dns",
    text: "canary.lab.flanksource.com"
  }, {
    name: "id",
    type: "hidden",
    text: "arn:aws:eks:eu-west-2:745897381572:cluster/flanksource-canary-cluster"
  }, {
    name: "name",
    text: "flanksource-canary-cluster"
  }, {
    name: "account",
    text: "745897381572"
  }, {
    name: "region",
    text: "eu-west-2"
  }, {
    name: "RPS",
    text: "165/s",
    headline: true
  }, {
    name: "Errors",
    text: "0.1%",
    headline: true
  }, {
    name: "Latency",
    text: "225ms",
    headline: true
  }],
  summary: {},
  status: "healthy",
  created_at: "2022-01-22T21:32:27.921212",
  updated_at: "2022-01-23T07:21:23.44703",
  external_id: "arn:aws:eks:eu-west-2:745897381572:cluster/flanksource-canary-cluster"
}, {
  name: "cluster",
  id: "017e83b4-719a-4217-abee-4c57f335905d22",
  icon: "kubernetes",
  components: [{
    name: "nodes",
    id: "017e83c0-2b1e-bad9-6085-f5a5b32a23a2",
    icon: "server",
    status: "healthy",
    summary: {
      healthy: 3
    },
    components: [{
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }, {
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }, {
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }],
    created_at: "2022-01-22T21:45:16.317433",
    updated_at: "2022-01-23T07:21:23.44984"
  }],
  properties: [{
    name: "dns",
    text: "canary.lab.flanksource.com"
  }, {
    name: "id",
    type: "hidden",
    text: "arn:aws:eks:eu-west-2:745897381572:cluster/flanksource-canary-cluster"
  }, {
    name: "name",
    text: "flanksource-canary-cluster"
  }, {
    name: "account",
    text: "745897381572"
  }, {
    name: "region",
    text: "eu-west-2"
  }, {
    name: "RPS",
    text: "165/s",
    headline: true
  }, {
    name: "Errors",
    text: "0.1%",
    headline: true
  }, {
    name: "Latency",
    text: "225ms",
    headline: true
  }],
  summary: {},
  status: "healthy",
  created_at: "2022-01-22T21:32:27.921212",
  updated_at: "2022-01-23T07:21:23.44703",
  external_id: "arn:aws:eks:eu-west-2:745897381572:cluster/flanksource-canary-cluster"
}, {
  name: "cluster",
  id: "017443b4-719a-4217-abee-4c57f45905d2",
  icon: "kubernetes",
  components: [{
    name: "nodes",
    id: "017e83c0-2b1e-bad9-6085-f5a5b32a23a2",
    icon: "server",
    status: "healthy",
    summary: {
      healthy: 3
    },
    components: [{
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }, {
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }, {
      name: "ip-10-0-6-82.eu-west-2.compute.internal",
      id: "017e83c8-c74c-c6b3-0bdb-8a6cc43982c5",
      icon: "server",
      status: "healthy",
      type: "KubernetesNode",
      summary: {},
      properties: [{
        name: "cpu",
        value: 630,
        unit: "millicores",
        max: 3920
      }, {
        name: "memory",
        value: 13940244480,
        unit: "bytes",
        max: 15554052096
      }, {
        name: "ephemeral-storage",
        unit: "bytes",
        max: 76224326324
      }, {
        name: "instance-type",
        text: "t3.xlarge"
      }, {
        name: "zone",
        text: "eu-west-2c"
      }, {
        name: "ami"
      }, {
        name: "operatingSystem",
        text: "linux"
      }, {
        name: "kernelVersion",
        text: "5.4.129-63.229.amzn2.x86_64"
      }, {
        name: "osImage",
        text: "Amazon Linux 2"
      }, {
        name: "containerRuntimeVersion",
        text: "docker://19.3.13"
      }, {
        name: "kubeProxyVersion",
        text: "v1.20.4-eks-6b7464"
      }, {
        name: "architecture",
        text: "amd64"
      }, {
        name: "kubeletVersion",
        text: "v1.20.4-eks-6b7464"
      }],
      created_at: "2022-01-22T21:54:40.587458",
      updated_at: "2022-01-23T07:21:23.452554",
      external_id: "eu-west-2c/ip-10-0-6-82.eu-west-2.compute.internal"
    }],
    created_at: "2022-01-22T21:45:16.317433",
    updated_at: "2022-01-23T07:21:23.44984"
  }],
  properties: [{
    name: "dns",
    text: "canary.lab.flanksource.com"
  }, {
    name: "id",
    type: "hidden",
    text: "arn:aws:eks:eu-west-2:745897381572:cluster/flanksource-canary-cluster"
  }, {
    name: "name",
    text: "flanksource-canary-cluster"
  }, {
    name: "account",
    text: "745897381572"
  }, {
    name: "region",
    text: "eu-west-2"
  }, {
    name: "RPS",
    text: "165/s",
    headline: true
  }, {
    name: "Errors",
    text: "0.1%",
    headline: true
  }, {
    name: "Latency",
    text: "225ms",
    headline: true
  }],
  summary: {},
  status: "healthy",
  created_at: "2022-01-22T21:32:27.921212",
  updated_at: "2022-01-23T07:21:23.44703",
  external_id: "arn:aws:eks:eu-west-2:745897381572:cluster/flanksource-canary-cluster"
}];

var Template = function Template(arg) {
  var _useState = (0, _react.useState)(false),
      _useState2 = _slicedToArray(_useState, 2),
      isOpen = _useState2[0],
      setIsOpen = _useState2[1];

  var handleClose = function handleClose() {
    return setIsOpen(false);
  };

  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
    children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
      className: "btn-primary",
      type: "button",
      onClick: function onClick() {
        return setIsOpen(true);
      },
      children: "show modal"
    }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TopologySelectorModal.TopologySelectorModal, _objectSpread({
      isOpen: isOpen,
      handleModalClose: handleClose
    }, arg))]
  });
};

var Variant1 = Template.bind({});
exports.Variant1 = Variant1;
Variant1.args = {
  topologies: data,
  title: "Add Card",
  submitButtonTitle: "Add",
  // eslint-disable-next-line no-alert
  onSubmit: function onSubmit() {
    return alert("submit");
  },
  defaultChecked: [data[0].id]
};