/*! bxs-vue-ui v3.3.0 */
import '../utils/entry-virtual.js';
import { C as create, G as assert, H as updateApp, _ as __vue_normalize__ } from '../utils/normalize-component.js';
import '../utils/object-create.js';
import '../utils/html.js';
import '../utils/es.number.constructor.js';
import '../utils/sloppy-array-method.js';
import '../utils/index-of.js';
import '../utils/string-trim.js';
import '../utils/slice.js';
import '../utils/extends.js';
import '../utils/env.js';
import '../icon/index.js';
import { _ as _trimInstanceProperty } from '../utils/trim.js';
import '../utils/emitter.js';
import '../utils/includes.js';
import Input from '../input/index.js';

var _components;
var _window = window,
    appBridge = _window.appBridge;
var script = create({
  name: 'crm-input',
  props: {
    value: {
      type: [String, Number],
      default: ''
    },
    iconColor: {
      type: String,
      default: '#FF6722'
    },
    iconSize: {
      type: String,
      default: '24px'
    },
    label: {
      type: String,
      default: '姓名'
    },
    placeholder: {
      type: String,
      default: '请输入姓名'
    },
    clearable: {
      type: Boolean,
      default: true
    },
    error: {
      type: Boolean,
      default: false
    },
    errorMessage: {
      type: String,
      default: ''
    }
  },
  computed: {
    currentValue: {
      get: function get() {
        return this.value;
      },
      set: function set(val) {
        this.$emit('input', val);
      }
    }
  },
  methods: {
    clickIcon: function clickIcon() {
      var self = this;
      assert(appBridge, 'crm-input requires appBridge');

      if (appBridge && appBridge.checkAppFeature('CRM_IMPORT')) {
        appBridge.importContact('recipient');
        appBridge.onContactImport(function (contactInfo) {
          self.$emit('crmInfo', contactInfo);
        });
      } else {
        updateApp();
      }
    },
    onFocus: function onFocus(event) {
      this.$emit('focus', event);
    },
    onBlur: function onBlur(event) {
      this.$emit('blur', event);
    }
  },
  components: (_components = {}, _components[Input.name] = Input, _components)
});

var __vue_script__ = script;
/* template */

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c('bxs-input', {
    attrs: {
      "label": _vm.label,
      "placeholder": _vm.placeholder,
      "clearable": _vm.clearable,
      "right-icon": "contact",
      "error": _vm.error,
      "error-message": _vm.errorMessage,
      "icon-size": _vm.iconSize,
      "icon-color": _vm.iconColor
    },
    on: {
      "click-icon": _vm.clickIcon,
      "focu": _vm.onFocus,
      "blur": _vm.onBlur
    },
    model: {
      value: _vm.currentValue,
      callback: function callback($$v) {
        _vm.currentValue = typeof $$v === 'string' ? _trimInstanceProperty($$v).call($$v) : $$v;
      },
      expression: "currentValue"
    }
  });
};

var __vue_staticRenderFns__ = [];
/* style */

var __vue_inject_styles__ = undefined;
/* scoped */

var __vue_scope_id__ = undefined;
/* module identifier */

var __vue_module_identifier__ = undefined;
/* functional template */

var __vue_is_functional_template__ = false;
/* style inject */

/* style inject SSR */

var index = __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);

export default index;
