'use strict';

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

var normalizeComponent = require('./normalize-component-6fa50395.js');
var browser = require('./browser-ae6cec24.js');
require('./_rollupPluginBabelHelpers-745a2ea0.js');
var VInput = require('./VInput.js');

//

var script = {
  name: 'VPassword',
  inheritAttrs: false,
  props: {
    value: {
      type: String,
      default: null
    },
    // If true, the password is shown to the user
    visible: {
      type: Boolean,
      default: false
    },
    error: {
      type: String,
      default: null
    }
  },
  data: function data() {
    return {
      isVisible: this.visible
    };
  },
  computed: {
    inputType: function inputType() {
      return this.isVisible ? 'text' : 'password';
    }
  },
  methods: {
    toggleVisible: function toggleVisible() {
      this.isVisible = !this.isVisible;
    }
  },
  components: {
    VInput: VInput.default
  }
};

var __$_require_img_eye_svg__ = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"8\" height=\"8\" viewBox=\"0 0 8 8\">\n  <path d=\"M4.03 0c-2.53 0-4.03 3-4.03 3s1.5 3 4.03 3c2.47 0 3.97-3 3.97-3s-1.5-3-3.97-3zm-.03 1c1.11 0 2 .9 2 2 0 1.11-.89 2-2 2-1.1 0-2-.89-2-2 0-1.1.9-2 2-2zm0 1c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1c0-.1-.04-.19-.06-.28-.08.16-.24.28-.44.28-.28 0-.5-.22-.5-.5 0-.2.12-.36.28-.44-.09-.03-.18-.06-.28-.06z\"\n  transform=\"translate(0 1)\" />\n</svg>";

/* script */
const __vue_script__ = script;
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('v-input',_vm._b({attrs:{"type":_vm.inputType,"value":_vm.value,"error":_vm.error,"autocomplete":"current-password"},on:{"input":function($event){return _vm.$emit('input', $event)},"blur":function($event){return _vm.$emit('blur', $event)}}},'v-input',_vm.$attrs,false),[_c('a',{attrs:{"slot":"icon"},on:{"click":_vm.toggleVisible},slot:"icon"},[_c('span',{staticClass:"icon is-small is-right",domProps:{"innerHTML":_vm._s(__$_require_img_eye_svg__)}})])])};
var __vue_staticRenderFns__ = [];

  /* style */
  const __vue_inject_styles__ = function (inject) {
    if (!inject) return
    inject("data-v-4ff6d73b_0", { source: ".control.has-icons-left .icon,.control.has-icons-right .icon{pointer-events:initial}", map: undefined, media: undefined });

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

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

exports.default = VPassword;
