'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var normalizeComponent = require('./normalize-component-6fa50395.js');
var ThemeMixin = require('./ThemeMixin-a2f817cd.js');

var script = {
  name: 'VContentSwitcher',
  props: {
    items: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    modelValue: {
      type: null,
      default: false
    }
  },
  data: function data() {
    return {
      focusedItem: null
    };
  },
  computed: {
    transformedItems: function transformedItems() {
      return this.items.map(function (item) {
        if (typeof item === 'string') {
          return {
            label: item,
            value: item
          };
        }

        if (!item || ThemeMixin._typeof(item) !== 'object') {
          throw new Error('VContentSwitcher item wrong type!');
        }

        if (item.value === undefined || item.label === undefined) {
          throw new Error('VContentSwitcher item wrong format!');
        }

        return item;
      });
    }
  },
  mixins: [ThemeMixin.ThemeMixin],
  model: {
    prop: 'modelValue',
    event: 'change'
  }
};

/* script */
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ul',{staticClass:"v-content-switcher",class:_vm.themeCssClass},_vm._l((_vm.transformedItems),function(item,index){return _c('li',{key:index,staticClass:"v-content-switcher-item",class:{
      'is-focused': _vm.focusedItem === item,
      'is-checked': _vm.modelValue === item.value,
    }},[_c('label',{staticClass:"v-content-switcher-label"},[_vm._v("\n      "+_vm._s(item.label)+"\n      "),_c('input',{staticClass:"v-content-switcher-control",attrs:{"type":"radio"},domProps:{"checked":_vm.modelValue === item.value,"value":item.value},on:{"change":function($event){return _vm.$emit('change', item.value)},"focus":function($event){_vm.focusedItem = item;},"blur":function($event){_vm.focusedItem = null;}}})])])}),0)};
var __vue_staticRenderFns__ = [];

  /* style */
  const __vue_inject_styles__ = undefined;
  /* scoped */
  const __vue_scope_id__ = undefined;
  /* module identifier */
  const __vue_module_identifier__ = undefined;
  /* functional template */
  const __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  

  
  var VContentSwitcher = normalizeComponent.__vue_normalize__(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    undefined,
    undefined
  );

exports.default = VContentSwitcher;
