/*! bxs-vue-ui v3.3.0 */
'use strict';

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

var entryVirtual = require('../utils/entry-virtual.js');
var normalizeComponent = require('../utils/normalize-component.js');
require('../utils/object-create.js');
require('../utils/html.js');
var es_number_constructor = require('../utils/es.number.constructor.js');
require('../utils/es.object.to-string.js');
require('../utils/array-iteration.js');
require('../utils/sloppy-array-method.js');
var forEach = require('../utils/for-each.js');
var indexOf = require('../utils/index-of.js');
require('../utils/string-trim.js');
require('../utils/slice.js');
var _extends = require('../utils/extends.js');
require('../utils/env.js');
require('../icon/index.js');
var trim$1 = require('../utils/trim.js');
require('../utils/emitter.js');
require('../utils/includes.js');
var input = require('../input/index.js');
var keys = require('../utils/keys.js');
var setTimeout = require('../utils/set-timeout.js');

var trim = es_number_constructor.require$$0.trim;


var nativeParseFloat = normalizeComponent.global.parseFloat;
var FORCED = 1 / nativeParseFloat(es_number_constructor.whitespaces + '-0') !== -Infinity;

// `parseFloat` method
// https://tc39.github.io/ecma262/#sec-parsefloat-string
var _parseFloat = FORCED ? function parseFloat(string) {
  var trimmedString = trim(String(string));
  var result = nativeParseFloat(trimmedString);
  return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
} : nativeParseFloat;

// `parseFloat` method
// https://tc39.github.io/ecma262/#sec-parsefloat-string
normalizeComponent.$({ global: true, forced: parseFloat != _parseFloat }, {
  parseFloat: _parseFloat
});

var ITERATOR = normalizeComponent.wellKnownSymbol$1('iterator');

var nativeUrl = !entryVirtual.fails(function () {
  var url = new URL('b?a=1&b=2&c=3', 'http://a');
  var searchParams = url.searchParams;
  var result = '';
  url.pathname = 'c%20d';
  searchParams.forEach(function (value, key) {
    searchParams['delete']('b');
    result += key + value;
  });
  return (normalizeComponent.IS_PURE$1 && !url.toJSON)
    || !searchParams.sort
    || url.href !== 'http://a/c%20d?a=1&c=3'
    || searchParams.get('c') !== '3'
    || String(new URLSearchParams('?a=1')) !== 'a=1'
    || !searchParams[ITERATOR]
    // throws in Edge
    || new URL('https://a@b').username !== 'a'
    || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
    // not punycoded in Edge
    || new URL('http://тест').host !== 'xn--e1aybc'
    // not escaped in Chrome 62-
    || new URL('http://a#б').hash !== '#%D0%B1'
    // fails in Chrome 66-
    || result !== 'a1c3'
    // throws in Safari
    || new URL('http://x', undefined).host !== 'x';
});

// `Array.from` method implementation
// https://tc39.github.io/ecma262/#sec-array.from
var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  var O = normalizeComponent.toObject(arrayLike);
  var C = typeof this == 'function' ? this : Array;
  var argumentsLength = arguments.length;
  var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
  var mapping = mapfn !== undefined;
  var index = 0;
  var iteratorMethod = normalizeComponent.getIteratorMethod(O);
  var length, result, step, iterator, next;
  if (mapping) mapfn = entryVirtual.bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
  // if the target is not iterable or it's an array with the default iterator - use a simple case
  if (iteratorMethod != undefined && !(C == Array && normalizeComponent.isArrayIteratorMethod(iteratorMethod))) {
    iterator = iteratorMethod.call(O);
    next = iterator.next;
    result = new C();
    for (;!(step = next.call(iterator)).done; index++) {
      normalizeComponent.createProperty(result, index, mapping
        ? normalizeComponent.callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true)
        : step.value
      );
    }
  } else {
    length = entryVirtual.toLength(O.length);
    result = new C(length);
    for (;length > index; index++) {
      normalizeComponent.createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
    }
  }
  result.length = index;
  return result;
};

// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128; // 0x80
var delimiter = '-'; // '\x2D'
var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
var baseMinusTMin = base - tMin;
var floor = Math.floor;
var stringFromCharCode = String.fromCharCode;

/**
 * Creates an array containing the numeric code points of each Unicode
 * character in the string. While JavaScript uses UCS-2 internally,
 * this function will convert a pair of surrogate halves (each of which
 * UCS-2 exposes as separate characters) into a single code point,
 * matching UTF-16.
 */
var ucs2decode = function (string) {
  var output = [];
  var counter = 0;
  var length = string.length;
  while (counter < length) {
    var value = string.charCodeAt(counter++);
    if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
      // It's a high surrogate, and there is a next character.
      var extra = string.charCodeAt(counter++);
      if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
        output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
      } else {
        // It's an unmatched surrogate; only append this code unit, in case the
        // next code unit is the high surrogate of a surrogate pair.
        output.push(value);
        counter--;
      }
    } else {
      output.push(value);
    }
  }
  return output;
};

/**
 * Converts a digit/integer into a basic code point.
 */
var digitToBasic = function (digit) {
  //  0..25 map to ASCII a..z or A..Z
  // 26..35 map to ASCII 0..9
  return digit + 22 + 75 * (digit < 26);
};

/**
 * Bias adaptation function as per section 3.4 of RFC 3492.
 * https://tools.ietf.org/html/rfc3492#section-3.4
 */
var adapt = function (delta, numPoints, firstTime) {
  var k = 0;
  delta = firstTime ? floor(delta / damp) : delta >> 1;
  delta += floor(delta / numPoints);
  for (; delta > baseMinusTMin * tMax >> 1; k += base) {
    delta = floor(delta / baseMinusTMin);
  }
  return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};

/**
 * Converts a string of Unicode symbols (e.g. a domain name label) to a
 * Punycode string of ASCII-only symbols.
 */
// eslint-disable-next-line  max-statements
var encode = function (input) {
  var output = [];

  // Convert the input in UCS-2 to an array of Unicode code points.
  input = ucs2decode(input);

  // Cache the length.
  var inputLength = input.length;

  // Initialize the state.
  var n = initialN;
  var delta = 0;
  var bias = initialBias;
  var i, currentValue;

  // Handle the basic code points.
  for (i = 0; i < input.length; i++) {
    currentValue = input[i];
    if (currentValue < 0x80) {
      output.push(stringFromCharCode(currentValue));
    }
  }

  var basicLength = output.length; // number of basic code points.
  var handledCPCount = basicLength; // number of code points that have been handled;

  // Finish the basic string with a delimiter unless it's empty.
  if (basicLength) {
    output.push(delimiter);
  }

  // Main encoding loop:
  while (handledCPCount < inputLength) {
    // All non-basic code points < n have been handled already. Find the next larger one:
    var m = maxInt;
    for (i = 0; i < input.length; i++) {
      currentValue = input[i];
      if (currentValue >= n && currentValue < m) {
        m = currentValue;
      }
    }

    // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
    var handledCPCountPlusOne = handledCPCount + 1;
    if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
      throw RangeError(OVERFLOW_ERROR);
    }

    delta += (m - n) * handledCPCountPlusOne;
    n = m;

    for (i = 0; i < input.length; i++) {
      currentValue = input[i];
      if (currentValue < n && ++delta > maxInt) {
        throw RangeError(OVERFLOW_ERROR);
      }
      if (currentValue == n) {
        // Represent delta as a generalized variable-length integer.
        var q = delta;
        for (var k = base; /* no condition */; k += base) {
          var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
          if (q < t) break;
          var qMinusT = q - t;
          var baseMinusT = base - t;
          output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
          q = floor(qMinusT / baseMinusT);
        }

        output.push(stringFromCharCode(digitToBasic(q)));
        bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
        delta = 0;
        ++handledCPCount;
      }
    }

    ++delta;
    ++n;
  }
  return output.join('');
};

var punycodeToAscii = function (input) {
  var encoded = [];
  var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
  var i, label;
  for (i = 0; i < labels.length; i++) {
    label = labels[i];
    encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
  }
  return encoded.join('.');
};

var getIterator = function (it) {
  var iteratorMethod = normalizeComponent.getIteratorMethod(it);
  if (typeof iteratorMethod != 'function') {
    throw TypeError(String(it) + ' is not iterable');
  } return entryVirtual.anObject(iteratorMethod.call(it));
};

// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`





















var $fetch = normalizeComponent.getBuiltIn$1('fetch');
var Headers = normalizeComponent.getBuiltIn$1('Headers');
var ITERATOR$1 = normalizeComponent.wellKnownSymbol$1('iterator');
var URL_SEARCH_PARAMS = 'URLSearchParams';
var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
var setInternalState = normalizeComponent.InternalStateModule$1.set;
var getInternalParamsState = normalizeComponent.InternalStateModule$1.getterFor(URL_SEARCH_PARAMS);
var getInternalIteratorState = normalizeComponent.InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR);

var plus = /\+/g;
var sequences = Array(4);

var percentSequence = function (bytes) {
  return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
};

var percentDecode = function (sequence) {
  try {
    return decodeURIComponent(sequence);
  } catch (error) {
    return sequence;
  }
};

var deserialize = function (it) {
  var result = it.replace(plus, ' ');
  var bytes = 4;
  try {
    return decodeURIComponent(result);
  } catch (error) {
    while (bytes) {
      result = result.replace(percentSequence(bytes--), percentDecode);
    }
    return result;
  }
};

var find = /[!'()~]|%20/g;

var replace = {
  '!': '%21',
  "'": '%27',
  '(': '%28',
  ')': '%29',
  '~': '%7E',
  '%20': '+'
};

var replacer = function (match) {
  return replace[match];
};

var serialize = function (it) {
  return encodeURIComponent(it).replace(find, replacer);
};

var parseSearchParams = function (result, query) {
  if (query) {
    var attributes = query.split('&');
    var index = 0;
    var attribute, entry;
    while (index < attributes.length) {
      attribute = attributes[index++];
      if (attribute.length) {
        entry = attribute.split('=');
        result.push({
          key: deserialize(entry.shift()),
          value: deserialize(entry.join('='))
        });
      }
    }
  }
};

var updateSearchParams = function (query) {
  this.entries.length = 0;
  parseSearchParams(this.entries, query);
};

var validateArgumentsLength = function (passed, required) {
  if (passed < required) throw TypeError('Not enough arguments');
};

var URLSearchParamsIterator = normalizeComponent.createIteratorConstructor(function Iterator(params, kind) {
  setInternalState(this, {
    type: URL_SEARCH_PARAMS_ITERATOR,
    iterator: getIterator(getInternalParamsState(params).entries),
    kind: kind
  });
}, 'Iterator', function next() {
  var state = getInternalIteratorState(this);
  var kind = state.kind;
  var step = state.iterator.next();
  var entry = step.value;
  if (!step.done) {
    step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
  } return step;
});

// `URLSearchParams` constructor
// https://url.spec.whatwg.org/#interface-urlsearchparams
var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
  normalizeComponent.anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
  var init = arguments.length > 0 ? arguments[0] : undefined;
  var that = this;
  var entries = [];
  var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;

  setInternalState(that, {
    type: URL_SEARCH_PARAMS,
    entries: entries,
    updateURL: function () { /* empty */ },
    updateSearchParams: updateSearchParams
  });

  if (init !== undefined) {
    if (entryVirtual.isObject(init)) {
      iteratorMethod = normalizeComponent.getIteratorMethod(init);
      if (typeof iteratorMethod === 'function') {
        iterator = iteratorMethod.call(init);
        next = iterator.next;
        while (!(step = next.call(iterator)).done) {
          entryIterator = getIterator(entryVirtual.anObject(step.value));
          entryNext = entryIterator.next;
          if (
            (first = entryNext.call(entryIterator)).done ||
            (second = entryNext.call(entryIterator)).done ||
            !entryNext.call(entryIterator).done
          ) throw TypeError('Expected sequence with length 2');
          entries.push({ key: first.value + '', value: second.value + '' });
        }
      } else for (key in init) if (entryVirtual.has(init, key)) entries.push({ key: key, value: init[key] + '' });
    } else {
      parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
    }
  }
};

var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;

normalizeComponent.redefineAll(URLSearchParamsPrototype, {
  // `URLSearchParams.prototype.appent` method
  // https://url.spec.whatwg.org/#dom-urlsearchparams-append
  append: function append(name, value) {
    validateArgumentsLength(arguments.length, 2);
    var state = getInternalParamsState(this);
    state.entries.push({ key: name + '', value: value + '' });
    state.updateURL();
  },
  // `URLSearchParams.prototype.delete` method
  // https://url.spec.whatwg.org/#dom-urlsearchparams-delete
  'delete': function (name) {
    validateArgumentsLength(arguments.length, 1);
    var state = getInternalParamsState(this);
    var entries = state.entries;
    var key = name + '';
    var index = 0;
    while (index < entries.length) {
      if (entries[index].key === key) entries.splice(index, 1);
      else index++;
    }
    state.updateURL();
  },
  // `URLSearchParams.prototype.get` method
  // https://url.spec.whatwg.org/#dom-urlsearchparams-get
  get: function get(name) {
    validateArgumentsLength(arguments.length, 1);
    var entries = getInternalParamsState(this).entries;
    var key = name + '';
    var index = 0;
    for (; index < entries.length; index++) {
      if (entries[index].key === key) return entries[index].value;
    }
    return null;
  },
  // `URLSearchParams.prototype.getAll` method
  // https://url.spec.whatwg.org/#dom-urlsearchparams-getall
  getAll: function getAll(name) {
    validateArgumentsLength(arguments.length, 1);
    var entries = getInternalParamsState(this).entries;
    var key = name + '';
    var result = [];
    var index = 0;
    for (; index < entries.length; index++) {
      if (entries[index].key === key) result.push(entries[index].value);
    }
    return result;
  },
  // `URLSearchParams.prototype.has` method
  // https://url.spec.whatwg.org/#dom-urlsearchparams-has
  has: function has(name) {
    validateArgumentsLength(arguments.length, 1);
    var entries = getInternalParamsState(this).entries;
    var key = name + '';
    var index = 0;
    while (index < entries.length) {
      if (entries[index++].key === key) return true;
    }
    return false;
  },
  // `URLSearchParams.prototype.set` method
  // https://url.spec.whatwg.org/#dom-urlsearchparams-set
  set: function set(name, value) {
    validateArgumentsLength(arguments.length, 1);
    var state = getInternalParamsState(this);
    var entries = state.entries;
    var found = false;
    var key = name + '';
    var val = value + '';
    var index = 0;
    var entry;
    for (; index < entries.length; index++) {
      entry = entries[index];
      if (entry.key === key) {
        if (found) entries.splice(index--, 1);
        else {
          found = true;
          entry.value = val;
        }
      }
    }
    if (!found) entries.push({ key: key, value: val });
    state.updateURL();
  },
  // `URLSearchParams.prototype.sort` method
  // https://url.spec.whatwg.org/#dom-urlsearchparams-sort
  sort: function sort() {
    var state = getInternalParamsState(this);
    var entries = state.entries;
    // Array#sort is not stable in some engines
    var slice = entries.slice();
    var entry, entriesIndex, sliceIndex;
    entries.length = 0;
    for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
      entry = slice[sliceIndex];
      for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
        if (entries[entriesIndex].key > entry.key) {
          entries.splice(entriesIndex, 0, entry);
          break;
        }
      }
      if (entriesIndex === sliceIndex) entries.push(entry);
    }
    state.updateURL();
  },
  // `URLSearchParams.prototype.forEach` method
  forEach: function forEach(callback /* , thisArg */) {
    var entries = getInternalParamsState(this).entries;
    var boundFunction = entryVirtual.bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
    var index = 0;
    var entry;
    while (index < entries.length) {
      entry = entries[index++];
      boundFunction(entry.value, entry.key, this);
    }
  },
  // `URLSearchParams.prototype.keys` method
  keys: function keys() {
    return new URLSearchParamsIterator(this, 'keys');
  },
  // `URLSearchParams.prototype.values` method
  values: function values() {
    return new URLSearchParamsIterator(this, 'values');
  },
  // `URLSearchParams.prototype.entries` method
  entries: function entries() {
    return new URLSearchParamsIterator(this, 'entries');
  }
}, { enumerable: true });

// `URLSearchParams.prototype[@@iterator]` method
normalizeComponent.redefine$1(URLSearchParamsPrototype, ITERATOR$1, URLSearchParamsPrototype.entries);

// `URLSearchParams.prototype.toString` method
// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
normalizeComponent.redefine$1(URLSearchParamsPrototype, 'toString', function toString() {
  var entries = getInternalParamsState(this).entries;
  var result = [];
  var index = 0;
  var entry;
  while (index < entries.length) {
    entry = entries[index++];
    result.push(serialize(entry.key) + '=' + serialize(entry.value));
  } return result.join('&');
}, { enumerable: true });

normalizeComponent.setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);

entryVirtual.$({ global: true, forced: !nativeUrl }, {
  URLSearchParams: URLSearchParamsConstructor
});

// Wrap `fetch` for correct work with polyfilled `URLSearchParams`
// https://github.com/zloirock/core-js/issues/674
if (!nativeUrl && typeof $fetch == 'function' && typeof Headers == 'function') {
  entryVirtual.$({ global: true, enumerable: true, forced: true }, {
    fetch: function fetch(input /* , init */) {
      var args = [input];
      var init, body, headers;
      if (arguments.length > 1) {
        init = arguments[1];
        if (entryVirtual.isObject(init)) {
          body = init.body;
          if (normalizeComponent.classof$1(body) === URL_SEARCH_PARAMS) {
            headers = init.headers ? new Headers(init.headers) : new Headers();
            if (!headers.has('content-type')) {
              headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
            }
            init = normalizeComponent.create$1(init, {
              body: entryVirtual.createPropertyDescriptor(0, String(body)),
              headers: entryVirtual.createPropertyDescriptor(0, headers)
            });
          }
        }
        args.push(init);
      } return $fetch.apply(this, args);
    }
  });
}

var web_urlSearchParams = {
  URLSearchParams: URLSearchParamsConstructor,
  getState: getInternalParamsState
};

// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`











var codeAt = normalizeComponent.require$$1$1.codeAt;





var NativeURL = entryVirtual.global.URL;
var URLSearchParams$1 = web_urlSearchParams.URLSearchParams;
var getInternalSearchParamsState = web_urlSearchParams.getState;
var setInternalState$1 = normalizeComponent.InternalStateModule$1.set;
var getInternalURLState = normalizeComponent.InternalStateModule$1.getterFor('URL');
var floor$1 = Math.floor;
var pow = Math.pow;

var INVALID_AUTHORITY = 'Invalid authority';
var INVALID_SCHEME = 'Invalid scheme';
var INVALID_HOST = 'Invalid host';
var INVALID_PORT = 'Invalid port';

var ALPHA = /[A-Za-z]/;
var ALPHANUMERIC = /[\d+\-.A-Za-z]/;
var DIGIT = /\d/;
var HEX_START = /^(0x|0X)/;
var OCT = /^[0-7]+$/;
var DEC = /^\d+$/;
var HEX = /^[\dA-Fa-f]+$/;
// eslint-disable-next-line no-control-regex
var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/;
// eslint-disable-next-line no-control-regex
var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/;
// eslint-disable-next-line no-control-regex
var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
// eslint-disable-next-line no-control-regex
var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
var EOF;

var parseHost = function (url, input) {
  var result, codePoints, index;
  if (input.charAt(0) == '[') {
    if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
    result = parseIPv6(input.slice(1, -1));
    if (!result) return INVALID_HOST;
    url.host = result;
  // opaque host
  } else if (!isSpecial(url)) {
    if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
    result = '';
    codePoints = arrayFrom(input);
    for (index = 0; index < codePoints.length; index++) {
      result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
    }
    url.host = result;
  } else {
    input = punycodeToAscii(input);
    if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
    result = parseIPv4(input);
    if (result === null) return INVALID_HOST;
    url.host = result;
  }
};

var parseIPv4 = function (input) {
  var parts = input.split('.');
  var partsLength, numbers, index, part, radix, number, ipv4;
  if (parts.length && parts[parts.length - 1] == '') {
    parts.pop();
  }
  partsLength = parts.length;
  if (partsLength > 4) return input;
  numbers = [];
  for (index = 0; index < partsLength; index++) {
    part = parts[index];
    if (part == '') return input;
    radix = 10;
    if (part.length > 1 && part.charAt(0) == '0') {
      radix = HEX_START.test(part) ? 16 : 8;
      part = part.slice(radix == 8 ? 1 : 2);
    }
    if (part === '') {
      number = 0;
    } else {
      if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
      number = parseInt(part, radix);
    }
    numbers.push(number);
  }
  for (index = 0; index < partsLength; index++) {
    number = numbers[index];
    if (index == partsLength - 1) {
      if (number >= pow(256, 5 - partsLength)) return null;
    } else if (number > 255) return null;
  }
  ipv4 = numbers.pop();
  for (index = 0; index < numbers.length; index++) {
    ipv4 += numbers[index] * pow(256, 3 - index);
  }
  return ipv4;
};

// eslint-disable-next-line max-statements
var parseIPv6 = function (input) {
  var address = [0, 0, 0, 0, 0, 0, 0, 0];
  var pieceIndex = 0;
  var compress = null;
  var pointer = 0;
  var value, length, numbersSeen, ipv4Piece, number, swaps, swap;

  var char = function () {
    return input.charAt(pointer);
  };

  if (char() == ':') {
    if (input.charAt(1) != ':') return;
    pointer += 2;
    pieceIndex++;
    compress = pieceIndex;
  }
  while (char()) {
    if (pieceIndex == 8) return;
    if (char() == ':') {
      if (compress !== null) return;
      pointer++;
      pieceIndex++;
      compress = pieceIndex;
      continue;
    }
    value = length = 0;
    while (length < 4 && HEX.test(char())) {
      value = value * 16 + parseInt(char(), 16);
      pointer++;
      length++;
    }
    if (char() == '.') {
      if (length == 0) return;
      pointer -= length;
      if (pieceIndex > 6) return;
      numbersSeen = 0;
      while (char()) {
        ipv4Piece = null;
        if (numbersSeen > 0) {
          if (char() == '.' && numbersSeen < 4) pointer++;
          else return;
        }
        if (!DIGIT.test(char())) return;
        while (DIGIT.test(char())) {
          number = parseInt(char(), 10);
          if (ipv4Piece === null) ipv4Piece = number;
          else if (ipv4Piece == 0) return;
          else ipv4Piece = ipv4Piece * 10 + number;
          if (ipv4Piece > 255) return;
          pointer++;
        }
        address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
        numbersSeen++;
        if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
      }
      if (numbersSeen != 4) return;
      break;
    } else if (char() == ':') {
      pointer++;
      if (!char()) return;
    } else if (char()) return;
    address[pieceIndex++] = value;
  }
  if (compress !== null) {
    swaps = pieceIndex - compress;
    pieceIndex = 7;
    while (pieceIndex != 0 && swaps > 0) {
      swap = address[pieceIndex];
      address[pieceIndex--] = address[compress + swaps - 1];
      address[compress + --swaps] = swap;
    }
  } else if (pieceIndex != 8) return;
  return address;
};

var findLongestZeroSequence = function (ipv6) {
  var maxIndex = null;
  var maxLength = 1;
  var currStart = null;
  var currLength = 0;
  var index = 0;
  for (; index < 8; index++) {
    if (ipv6[index] !== 0) {
      if (currLength > maxLength) {
        maxIndex = currStart;
        maxLength = currLength;
      }
      currStart = null;
      currLength = 0;
    } else {
      if (currStart === null) currStart = index;
      ++currLength;
    }
  }
  if (currLength > maxLength) {
    maxIndex = currStart;
    maxLength = currLength;
  }
  return maxIndex;
};

var serializeHost = function (host) {
  var result, index, compress, ignore0;
  // ipv4
  if (typeof host == 'number') {
    result = [];
    for (index = 0; index < 4; index++) {
      result.unshift(host % 256);
      host = floor$1(host / 256);
    } return result.join('.');
  // ipv6
  } else if (typeof host == 'object') {
    result = '';
    compress = findLongestZeroSequence(host);
    for (index = 0; index < 8; index++) {
      if (ignore0 && host[index] === 0) continue;
      if (ignore0) ignore0 = false;
      if (compress === index) {
        result += index ? ':' : '::';
        ignore0 = true;
      } else {
        result += host[index].toString(16);
        if (index < 7) result += ':';
      }
    }
    return '[' + result + ']';
  } return host;
};

var C0ControlPercentEncodeSet = {};
var fragmentPercentEncodeSet = _extends.assign({}, C0ControlPercentEncodeSet, {
  ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
});
var pathPercentEncodeSet = _extends.assign({}, fragmentPercentEncodeSet, {
  '#': 1, '?': 1, '{': 1, '}': 1
});
var userinfoPercentEncodeSet = _extends.assign({}, pathPercentEncodeSet, {
  '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
});

var percentEncode = function (char, set) {
  var code = codeAt(char, 0);
  return code > 0x20 && code < 0x7F && !entryVirtual.has(set, char) ? char : encodeURIComponent(char);
};

var specialSchemes = {
  ftp: 21,
  file: null,
  http: 80,
  https: 443,
  ws: 80,
  wss: 443
};

var isSpecial = function (url) {
  return entryVirtual.has(specialSchemes, url.scheme);
};

var includesCredentials = function (url) {
  return url.username != '' || url.password != '';
};

var cannotHaveUsernamePasswordPort = function (url) {
  return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
};

var isWindowsDriveLetter = function (string, normalized) {
  var second;
  return string.length == 2 && ALPHA.test(string.charAt(0))
    && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
};

var startsWithWindowsDriveLetter = function (string) {
  var third;
  return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
    string.length == 2 ||
    ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
  );
};

var shortenURLsPath = function (url) {
  var path = url.path;
  var pathSize = path.length;
  if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
    path.pop();
  }
};

var isSingleDot = function (segment) {
  return segment === '.' || segment.toLowerCase() === '%2e';
};

var isDoubleDot = function (segment) {
  segment = segment.toLowerCase();
  return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
};

// States:
var SCHEME_START = {};
var SCHEME = {};
var NO_SCHEME = {};
var SPECIAL_RELATIVE_OR_AUTHORITY = {};
var PATH_OR_AUTHORITY = {};
var RELATIVE = {};
var RELATIVE_SLASH = {};
var SPECIAL_AUTHORITY_SLASHES = {};
var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
var AUTHORITY = {};
var HOST = {};
var HOSTNAME = {};
var PORT = {};
var FILE = {};
var FILE_SLASH = {};
var FILE_HOST = {};
var PATH_START = {};
var PATH = {};
var CANNOT_BE_A_BASE_URL_PATH = {};
var QUERY = {};
var FRAGMENT = {};

// eslint-disable-next-line max-statements
var parseURL = function (url, input, stateOverride, base) {
  var state = stateOverride || SCHEME_START;
  var pointer = 0;
  var buffer = '';
  var seenAt = false;
  var seenBracket = false;
  var seenPasswordToken = false;
  var codePoints, char, bufferCodePoints, failure;

  if (!stateOverride) {
    url.scheme = '';
    url.username = '';
    url.password = '';
    url.host = null;
    url.port = null;
    url.path = [];
    url.query = null;
    url.fragment = null;
    url.cannotBeABaseURL = false;
    input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
  }

  input = input.replace(TAB_AND_NEW_LINE, '');

  codePoints = arrayFrom(input);

  while (pointer <= codePoints.length) {
    char = codePoints[pointer];
    switch (state) {
      case SCHEME_START:
        if (char && ALPHA.test(char)) {
          buffer += char.toLowerCase();
          state = SCHEME;
        } else if (!stateOverride) {
          state = NO_SCHEME;
          continue;
        } else return INVALID_SCHEME;
        break;

      case SCHEME:
        if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
          buffer += char.toLowerCase();
        } else if (char == ':') {
          if (stateOverride && (
            (isSpecial(url) != entryVirtual.has(specialSchemes, buffer)) ||
            (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
            (url.scheme == 'file' && !url.host)
          )) return;
          url.scheme = buffer;
          if (stateOverride) {
            if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
            return;
          }
          buffer = '';
          if (url.scheme == 'file') {
            state = FILE;
          } else if (isSpecial(url) && base && base.scheme == url.scheme) {
            state = SPECIAL_RELATIVE_OR_AUTHORITY;
          } else if (isSpecial(url)) {
            state = SPECIAL_AUTHORITY_SLASHES;
          } else if (codePoints[pointer + 1] == '/') {
            state = PATH_OR_AUTHORITY;
            pointer++;
          } else {
            url.cannotBeABaseURL = true;
            url.path.push('');
            state = CANNOT_BE_A_BASE_URL_PATH;
          }
        } else if (!stateOverride) {
          buffer = '';
          state = NO_SCHEME;
          pointer = 0;
          continue;
        } else return INVALID_SCHEME;
        break;

      case NO_SCHEME:
        if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
        if (base.cannotBeABaseURL && char == '#') {
          url.scheme = base.scheme;
          url.path = base.path.slice();
          url.query = base.query;
          url.fragment = '';
          url.cannotBeABaseURL = true;
          state = FRAGMENT;
          break;
        }
        state = base.scheme == 'file' ? FILE : RELATIVE;
        continue;

      case SPECIAL_RELATIVE_OR_AUTHORITY:
        if (char == '/' && codePoints[pointer + 1] == '/') {
          state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
          pointer++;
        } else {
          state = RELATIVE;
          continue;
        } break;

      case PATH_OR_AUTHORITY:
        if (char == '/') {
          state = AUTHORITY;
          break;
        } else {
          state = PATH;
          continue;
        }

      case RELATIVE:
        url.scheme = base.scheme;
        if (char == EOF) {
          url.username = base.username;
          url.password = base.password;
          url.host = base.host;
          url.port = base.port;
          url.path = base.path.slice();
          url.query = base.query;
        } else if (char == '/' || (char == '\\' && isSpecial(url))) {
          state = RELATIVE_SLASH;
        } else if (char == '?') {
          url.username = base.username;
          url.password = base.password;
          url.host = base.host;
          url.port = base.port;
          url.path = base.path.slice();
          url.query = '';
          state = QUERY;
        } else if (char == '#') {
          url.username = base.username;
          url.password = base.password;
          url.host = base.host;
          url.port = base.port;
          url.path = base.path.slice();
          url.query = base.query;
          url.fragment = '';
          state = FRAGMENT;
        } else {
          url.username = base.username;
          url.password = base.password;
          url.host = base.host;
          url.port = base.port;
          url.path = base.path.slice();
          url.path.pop();
          state = PATH;
          continue;
        } break;

      case RELATIVE_SLASH:
        if (isSpecial(url) && (char == '/' || char == '\\')) {
          state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
        } else if (char == '/') {
          state = AUTHORITY;
        } else {
          url.username = base.username;
          url.password = base.password;
          url.host = base.host;
          url.port = base.port;
          state = PATH;
          continue;
        } break;

      case SPECIAL_AUTHORITY_SLASHES:
        state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
        if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
        pointer++;
        break;

      case SPECIAL_AUTHORITY_IGNORE_SLASHES:
        if (char != '/' && char != '\\') {
          state = AUTHORITY;
          continue;
        } break;

      case AUTHORITY:
        if (char == '@') {
          if (seenAt) buffer = '%40' + buffer;
          seenAt = true;
          bufferCodePoints = arrayFrom(buffer);
          for (var i = 0; i < bufferCodePoints.length; i++) {
            var codePoint = bufferCodePoints[i];
            if (codePoint == ':' && !seenPasswordToken) {
              seenPasswordToken = true;
              continue;
            }
            var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
            if (seenPasswordToken) url.password += encodedCodePoints;
            else url.username += encodedCodePoints;
          }
          buffer = '';
        } else if (
          char == EOF || char == '/' || char == '?' || char == '#' ||
          (char == '\\' && isSpecial(url))
        ) {
          if (seenAt && buffer == '') return INVALID_AUTHORITY;
          pointer -= arrayFrom(buffer).length + 1;
          buffer = '';
          state = HOST;
        } else buffer += char;
        break;

      case HOST:
      case HOSTNAME:
        if (stateOverride && url.scheme == 'file') {
          state = FILE_HOST;
          continue;
        } else if (char == ':' && !seenBracket) {
          if (buffer == '') return INVALID_HOST;
          failure = parseHost(url, buffer);
          if (failure) return failure;
          buffer = '';
          state = PORT;
          if (stateOverride == HOSTNAME) return;
        } else if (
          char == EOF || char == '/' || char == '?' || char == '#' ||
          (char == '\\' && isSpecial(url))
        ) {
          if (isSpecial(url) && buffer == '') return INVALID_HOST;
          if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
          failure = parseHost(url, buffer);
          if (failure) return failure;
          buffer = '';
          state = PATH_START;
          if (stateOverride) return;
          continue;
        } else {
          if (char == '[') seenBracket = true;
          else if (char == ']') seenBracket = false;
          buffer += char;
        } break;

      case PORT:
        if (DIGIT.test(char)) {
          buffer += char;
        } else if (
          char == EOF || char == '/' || char == '?' || char == '#' ||
          (char == '\\' && isSpecial(url)) ||
          stateOverride
        ) {
          if (buffer != '') {
            var port = parseInt(buffer, 10);
            if (port > 0xFFFF) return INVALID_PORT;
            url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
            buffer = '';
          }
          if (stateOverride) return;
          state = PATH_START;
          continue;
        } else return INVALID_PORT;
        break;

      case FILE:
        url.scheme = 'file';
        if (char == '/' || char == '\\') state = FILE_SLASH;
        else if (base && base.scheme == 'file') {
          if (char == EOF) {
            url.host = base.host;
            url.path = base.path.slice();
            url.query = base.query;
          } else if (char == '?') {
            url.host = base.host;
            url.path = base.path.slice();
            url.query = '';
            state = QUERY;
          } else if (char == '#') {
            url.host = base.host;
            url.path = base.path.slice();
            url.query = base.query;
            url.fragment = '';
            state = FRAGMENT;
          } else {
            if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
              url.host = base.host;
              url.path = base.path.slice();
              shortenURLsPath(url);
            }
            state = PATH;
            continue;
          }
        } else {
          state = PATH;
          continue;
        } break;

      case FILE_SLASH:
        if (char == '/' || char == '\\') {
          state = FILE_HOST;
          break;
        }
        if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
          if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
          else url.host = base.host;
        }
        state = PATH;
        continue;

      case FILE_HOST:
        if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
          if (!stateOverride && isWindowsDriveLetter(buffer)) {
            state = PATH;
          } else if (buffer == '') {
            url.host = '';
            if (stateOverride) return;
            state = PATH_START;
          } else {
            failure = parseHost(url, buffer);
            if (failure) return failure;
            if (url.host == 'localhost') url.host = '';
            if (stateOverride) return;
            buffer = '';
            state = PATH_START;
          } continue;
        } else buffer += char;
        break;

      case PATH_START:
        if (isSpecial(url)) {
          state = PATH;
          if (char != '/' && char != '\\') continue;
        } else if (!stateOverride && char == '?') {
          url.query = '';
          state = QUERY;
        } else if (!stateOverride && char == '#') {
          url.fragment = '';
          state = FRAGMENT;
        } else if (char != EOF) {
          state = PATH;
          if (char != '/') continue;
        } break;

      case PATH:
        if (
          char == EOF || char == '/' ||
          (char == '\\' && isSpecial(url)) ||
          (!stateOverride && (char == '?' || char == '#'))
        ) {
          if (isDoubleDot(buffer)) {
            shortenURLsPath(url);
            if (char != '/' && !(char == '\\' && isSpecial(url))) {
              url.path.push('');
            }
          } else if (isSingleDot(buffer)) {
            if (char != '/' && !(char == '\\' && isSpecial(url))) {
              url.path.push('');
            }
          } else {
            if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
              if (url.host) url.host = '';
              buffer = buffer.charAt(0) + ':'; // normalize windows drive letter
            }
            url.path.push(buffer);
          }
          buffer = '';
          if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
            while (url.path.length > 1 && url.path[0] === '') {
              url.path.shift();
            }
          }
          if (char == '?') {
            url.query = '';
            state = QUERY;
          } else if (char == '#') {
            url.fragment = '';
            state = FRAGMENT;
          }
        } else {
          buffer += percentEncode(char, pathPercentEncodeSet);
        } break;

      case CANNOT_BE_A_BASE_URL_PATH:
        if (char == '?') {
          url.query = '';
          state = QUERY;
        } else if (char == '#') {
          url.fragment = '';
          state = FRAGMENT;
        } else if (char != EOF) {
          url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
        } break;

      case QUERY:
        if (!stateOverride && char == '#') {
          url.fragment = '';
          state = FRAGMENT;
        } else if (char != EOF) {
          if (char == "'" && isSpecial(url)) url.query += '%27';
          else if (char == '#') url.query += '%23';
          else url.query += percentEncode(char, C0ControlPercentEncodeSet);
        } break;

      case FRAGMENT:
        if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
        break;
    }

    pointer++;
  }
};

// `URL` constructor
// https://url.spec.whatwg.org/#url-class
var URLConstructor = function URL(url /* , base */) {
  var that = normalizeComponent.anInstance(this, URLConstructor, 'URL');
  var base = arguments.length > 1 ? arguments[1] : undefined;
  var urlString = String(url);
  var state = setInternalState$1(that, { type: 'URL' });
  var baseState, failure;
  if (base !== undefined) {
    if (base instanceof URLConstructor) baseState = getInternalURLState(base);
    else {
      failure = parseURL(baseState = {}, String(base));
      if (failure) throw TypeError(failure);
    }
  }
  failure = parseURL(state, urlString, null, baseState);
  if (failure) throw TypeError(failure);
  var searchParams = state.searchParams = new URLSearchParams$1();
  var searchParamsState = getInternalSearchParamsState(searchParams);
  searchParamsState.updateSearchParams(state.query);
  searchParamsState.updateURL = function () {
    state.query = String(searchParams) || null;
  };
  if (!entryVirtual.DESCRIPTORS) {
    that.href = serializeURL.call(that);
    that.origin = getOrigin.call(that);
    that.protocol = getProtocol.call(that);
    that.username = getUsername.call(that);
    that.password = getPassword.call(that);
    that.host = getHost.call(that);
    that.hostname = getHostname.call(that);
    that.port = getPort.call(that);
    that.pathname = getPathname.call(that);
    that.search = getSearch.call(that);
    that.searchParams = getSearchParams.call(that);
    that.hash = getHash.call(that);
  }
};

var URLPrototype = URLConstructor.prototype;

var serializeURL = function () {
  var url = getInternalURLState(this);
  var scheme = url.scheme;
  var username = url.username;
  var password = url.password;
  var host = url.host;
  var port = url.port;
  var path = url.path;
  var query = url.query;
  var fragment = url.fragment;
  var output = scheme + ':';
  if (host !== null) {
    output += '//';
    if (includesCredentials(url)) {
      output += username + (password ? ':' + password : '') + '@';
    }
    output += serializeHost(host);
    if (port !== null) output += ':' + port;
  } else if (scheme == 'file') output += '//';
  output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
  if (query !== null) output += '?' + query;
  if (fragment !== null) output += '#' + fragment;
  return output;
};

var getOrigin = function () {
  var url = getInternalURLState(this);
  var scheme = url.scheme;
  var port = url.port;
  if (scheme == 'blob') try {
    return new URL(scheme.path[0]).origin;
  } catch (error) {
    return 'null';
  }
  if (scheme == 'file' || !isSpecial(url)) return 'null';
  return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
};

var getProtocol = function () {
  return getInternalURLState(this).scheme + ':';
};

var getUsername = function () {
  return getInternalURLState(this).username;
};

var getPassword = function () {
  return getInternalURLState(this).password;
};

var getHost = function () {
  var url = getInternalURLState(this);
  var host = url.host;
  var port = url.port;
  return host === null ? ''
    : port === null ? serializeHost(host)
    : serializeHost(host) + ':' + port;
};

var getHostname = function () {
  var host = getInternalURLState(this).host;
  return host === null ? '' : serializeHost(host);
};

var getPort = function () {
  var port = getInternalURLState(this).port;
  return port === null ? '' : String(port);
};

var getPathname = function () {
  var url = getInternalURLState(this);
  var path = url.path;
  return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
};

var getSearch = function () {
  var query = getInternalURLState(this).query;
  return query ? '?' + query : '';
};

var getSearchParams = function () {
  return getInternalURLState(this).searchParams;
};

var getHash = function () {
  var fragment = getInternalURLState(this).fragment;
  return fragment ? '#' + fragment : '';
};

var accessorDescriptor = function (getter, setter) {
  return { get: getter, set: setter, configurable: true, enumerable: true };
};

if (entryVirtual.DESCRIPTORS) {
  normalizeComponent.defineProperties(URLPrototype, {
    // `URL.prototype.href` accessors pair
    // https://url.spec.whatwg.org/#dom-url-href
    href: accessorDescriptor(serializeURL, function (href) {
      var url = getInternalURLState(this);
      var urlString = String(href);
      var failure = parseURL(url, urlString);
      if (failure) throw TypeError(failure);
      getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
    }),
    // `URL.prototype.origin` getter
    // https://url.spec.whatwg.org/#dom-url-origin
    origin: accessorDescriptor(getOrigin),
    // `URL.prototype.protocol` accessors pair
    // https://url.spec.whatwg.org/#dom-url-protocol
    protocol: accessorDescriptor(getProtocol, function (protocol) {
      var url = getInternalURLState(this);
      parseURL(url, String(protocol) + ':', SCHEME_START);
    }),
    // `URL.prototype.username` accessors pair
    // https://url.spec.whatwg.org/#dom-url-username
    username: accessorDescriptor(getUsername, function (username) {
      var url = getInternalURLState(this);
      var codePoints = arrayFrom(String(username));
      if (cannotHaveUsernamePasswordPort(url)) return;
      url.username = '';
      for (var i = 0; i < codePoints.length; i++) {
        url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
      }
    }),
    // `URL.prototype.password` accessors pair
    // https://url.spec.whatwg.org/#dom-url-password
    password: accessorDescriptor(getPassword, function (password) {
      var url = getInternalURLState(this);
      var codePoints = arrayFrom(String(password));
      if (cannotHaveUsernamePasswordPort(url)) return;
      url.password = '';
      for (var i = 0; i < codePoints.length; i++) {
        url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
      }
    }),
    // `URL.prototype.host` accessors pair
    // https://url.spec.whatwg.org/#dom-url-host
    host: accessorDescriptor(getHost, function (host) {
      var url = getInternalURLState(this);
      if (url.cannotBeABaseURL) return;
      parseURL(url, String(host), HOST);
    }),
    // `URL.prototype.hostname` accessors pair
    // https://url.spec.whatwg.org/#dom-url-hostname
    hostname: accessorDescriptor(getHostname, function (hostname) {
      var url = getInternalURLState(this);
      if (url.cannotBeABaseURL) return;
      parseURL(url, String(hostname), HOSTNAME);
    }),
    // `URL.prototype.port` accessors pair
    // https://url.spec.whatwg.org/#dom-url-port
    port: accessorDescriptor(getPort, function (port) {
      var url = getInternalURLState(this);
      if (cannotHaveUsernamePasswordPort(url)) return;
      port = String(port);
      if (port == '') url.port = null;
      else parseURL(url, port, PORT);
    }),
    // `URL.prototype.pathname` accessors pair
    // https://url.spec.whatwg.org/#dom-url-pathname
    pathname: accessorDescriptor(getPathname, function (pathname) {
      var url = getInternalURLState(this);
      if (url.cannotBeABaseURL) return;
      url.path = [];
      parseURL(url, pathname + '', PATH_START);
    }),
    // `URL.prototype.search` accessors pair
    // https://url.spec.whatwg.org/#dom-url-search
    search: accessorDescriptor(getSearch, function (search) {
      var url = getInternalURLState(this);
      search = String(search);
      if (search == '') {
        url.query = null;
      } else {
        if ('?' == search.charAt(0)) search = search.slice(1);
        url.query = '';
        parseURL(url, search, QUERY);
      }
      getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
    }),
    // `URL.prototype.searchParams` getter
    // https://url.spec.whatwg.org/#dom-url-searchparams
    searchParams: accessorDescriptor(getSearchParams),
    // `URL.prototype.hash` accessors pair
    // https://url.spec.whatwg.org/#dom-url-hash
    hash: accessorDescriptor(getHash, function (hash) {
      var url = getInternalURLState(this);
      hash = String(hash);
      if (hash == '') {
        url.fragment = null;
        return;
      }
      if ('#' == hash.charAt(0)) hash = hash.slice(1);
      url.fragment = '';
      parseURL(url, hash, FRAGMENT);
    })
  });
}

// `URL.prototype.toJSON` method
// https://url.spec.whatwg.org/#dom-url-tojson
normalizeComponent.redefine$1(URLPrototype, 'toJSON', function toJSON() {
  return serializeURL.call(this);
}, { enumerable: true });

// `URL.prototype.toString` method
// https://url.spec.whatwg.org/#URL-stringification-behavior
normalizeComponent.redefine$1(URLPrototype, 'toString', function toString() {
  return serializeURL.call(this);
}, { enumerable: true });

if (NativeURL) {
  var nativeCreateObjectURL = NativeURL.createObjectURL;
  var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
  // `URL.createObjectURL` method
  // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
  // eslint-disable-next-line no-unused-vars
  if (nativeCreateObjectURL) normalizeComponent.redefine$1(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
    return nativeCreateObjectURL.apply(NativeURL, arguments);
  });
  // `URL.revokeObjectURL` method
  // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
  // eslint-disable-next-line no-unused-vars
  if (nativeRevokeObjectURL) normalizeComponent.redefine$1(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
    return nativeRevokeObjectURL.apply(NativeURL, arguments);
  });
}

normalizeComponent.setToStringTag(URLConstructor, 'URL');

entryVirtual.$({ global: true, forced: !nativeUrl, sham: !entryVirtual.DESCRIPTORS }, {
  URL: URLConstructor
});

// empty

var web_url_toJson = /*#__PURE__*/Object.freeze({

});

entryVirtual.getCjsExportFromNamespace(web_url_toJson);

var url = entryVirtual.path.URL;

var url$1 = url;

var url$2 = url$1;

var defaultRequestParams = {
  headers: {
    'Content-Type': 'application/json'
  },
  timeout: 15000,
  withCredentials: true,
  async: true,
  params: undefined,
  method: 'GET'
};
function requestAjax(url, config) {
  return new normalizeComponent._Promise(function (resolve, reject) {
    var params = _extends._extends({}, defaultRequestParams, config);

    var xhr = new XMLHttpRequest();
    xhr.timeout = params.timeout;
    if (params.withCredentials) xhr.withCredentials = true;
    xhr.open(params.method, url, params.async);

    if (typeof params.headers === 'object' && params.headers !== null) {
      var _context;

      forEach._forEachInstanceProperty(_context = keys._Object$keys(params.headers)).call(_context, function (key) {
        xhr.setRequestHeader(key, params.headers[key]);
      });
    }

    xhr.onerror = function (event) {
      return reject(event);
    };

    xhr.onabort = function (event) {
      return reject(event);
    };

    xhr.ontimeout = function (event) {
      return reject(event);
    };

    xhr.onload = function (e) {
      if (e.currentTarget.status === 200) {
        try {
          var res = JSON.parse(xhr.responseText);
          if (res.success || +res.code === 200) resolve(res);
          reject(new Error(res.msg || res.info || res.message || '请求出错, 请重试'));
        } catch (error) {
          reject(error);
        }
      } else {
        reject(e);
      }
    };

    xhr.send(params.params || null);
  });
}

var sdkInitingKey = 'weiyi_alinvc_unique_initing';
var sdkInitedKey = 'weiyi_alinvc_unique_inited'; // 标识滑动验证是否成功

var sdkSlidingVerificationKey = 'weiyi_alinvc_sliding_verification'; // 默认滑动验证组件会放到 该 id 的 div 中

var renderToElementId = 'weiyi_alinvc_render_to_element_id';
if (window[sdkInitingKey] === undefined) window[sdkInitingKey] = false;
if (window[sdkInitingKey] === undefined) window[sdkInitingKey] = false;
if (window[sdkSlidingVerificationKey] === undefined) window[sdkSlidingVerificationKey] = false;

function startObserverDom(buttonEle, trackEle) {
  var observer = new MutationObserver(function (eles) {
    if (eles[0].attributeName === 'style') {
      var left = window.parseFloat(buttonEle.style.left);

      if (left <= 3) {
        trackEle.style.width = '0px'; // eslint-disable-line no-param-reassign

        buttonEle.style.left = "3px"; // eslint-disable-line no-param-reassign

        normalizeComponent.addClass(trackEle, 'force-width-zero');
      } else {
        trackEle.style.width = left + 46 + "px"; // eslint-disable-line no-param-reassign

        normalizeComponent.removeClass(trackEle, 'force-width-zero');
      }
    }
  });
  observer.observe(buttonEle, {
    attributes: true,
    subtree: false,
    characterData: true,
    attributeFilter: ['style']
  });
}

function getHourString() {
  var d = new Date();
  return "" + d.getFullYear() + (d.getMonth() + 1) + d.getDate() + d.getHours();
} // 用于检测 SDK 是否已加载, 且初始化完成


function heartCheckSureReady() {
  var _context;

  return typeof window.getNVCVal === 'function' && // eslint-disable-next-line no-underscore-dangle
  indexOf._indexOfInstanceProperty(_context = window.__nvc__umid).call(_context, 'defaultToken') < 0;
} // 加载 SDK 并确保 SDK 相关初始化已完成


function loadJSScriptAndCheck(jsUrl) {
  return new normalizeComponent._Promise(function (resolve, reject) {
    var existEl = document.querySelector('script#bxs-ali-sdk-nvc');

    if (existEl) {
      // 包含 3 种情况: 文件已经加载完成、文件正在加载、文件加载完成但sdk未初始化完成
      normalizeComponent.heartCheck(heartCheckSureReady).then(function () {
        return resolve();
      }).catch(function (err) {
        return reject(err);
      });
    } else {
      var el = document.createElement('script');
      el.setAttribute('id', 'bxs-ali-sdk-nvc');

      el.onload = function () {
        normalizeComponent.heartCheck(heartCheckSureReady).then(function () {
          return resolve();
        }).catch(function (err) {
          return reject(err);
        });
      };

      el.onerror = function (err) {
        return typeof el.remove === 'function' && el.remove() && reject(err);
      };

      el.src = jsUrl;
      document.head.appendChild(el);
    }
  });
}

var cacheData = {};
function resetNvc(requestId) {
  window.nvcReset && window.nvcReset(); // eslint-disable-line

  window._nvc_nc && window._nvc_nc.reset(); // eslint-disable-line

  window._nvc_nc && window._nvc_nc.hide(); // eslint-disable-line

  if (requestId && cacheData[requestId].renderToWrapperId) {
    var wrapperEle = document.querySelector(cacheData[requestId].renderToWrapperId);

    if (wrapperEle) {
      var wrapperBox = wrapperEle.parentElement;
      wrapperBox.setAttribute('style', 'display: none');
    }
  }
}
function safeRequest(requestId, url, renderToWrapperId, nvcVal, sliderStartCb) {
  return new normalizeComponent._Promise(function (resolve, reject) {
    if (!requestId) reject(new Error('requestId 参数缺失'));
    if (!cacheData[requestId]) reject(new Error('请确保 requestId 初始化方法 initSdk 中的一致'));
    if (!window[sdkInitedKey]) reject(new Error('请先初始化人机验证 SDK: initSdk'));
    cacheData[requestId].url = url;
    cacheData[requestId].renderToWrapperId = renderToWrapperId;
    cacheData[requestId].nvcVal = nvcVal;
    var urlObj = new url$2(indexOf._indexOfInstanceProperty(url).call(url, 'http') !== 0 ? "" + window.location.protocol + url : url);
    urlObj.searchParams.append('nvcValue', nvcVal || window.getNVCVal());
    requestAjax(urlObj.toString()).then(function (res) {
      var nvcCode = res.nvcCode;
      var code = +nvcCode;
      delete res.nvcCode;

      var resolveWrapper = function resolveWrapper(resResolve) {
        resolve(resResolve);
      };

      if (code === 200) {
        // 无痕校验 - 成功通过
        resetNvc();
        resolveWrapper(res);
      } else if (code === 100) {
        // 二次验证 - 成功通过
        resetNvc();
        window[sdkSlidingVerificationKey] = true;
        resolveWrapper(res);
        var wrapperEle = document.querySelector(renderToWrapperId);
        var wrapperBox = wrapperEle.parentElement;
        wrapperBox.setAttribute('style', 'display: none');
      } else if (code === 400 || code === 600 || code === 700) {
        // 唤醒二次验证
        if (typeof sliderStartCb === 'function') sliderStartCb(); // 将真实的 renderTo DIV 元素移至 renderToWrapperId 内

        if (renderToWrapperId) {
          var _wrapperEle = document.querySelector(renderToWrapperId);

          if (_wrapperEle) {
            var _wrapperBox = _wrapperEle.parentElement;

            if (!_wrapperEle.querySelector("#" + renderToElementId)) {
              var ele = document.querySelector("#" + renderToElementId);

              _wrapperEle.appendChild(ele);

              _wrapperBox.setAttribute('style', 'display: block');

              normalizeComponent.heartCheck(function () {
                var _context2;

                var tempButtonEle = ele.querySelector('.button');
                return tempButtonEle && tempButtonEle.innerHTML && trim$1._trimInstanceProperty(_context2 = tempButtonEle.innerHTML).call(_context2);
              }, 100, 1000 * 60 * 5).then(function () {
                setTimeout._setTimeout(function () {
                  // TODO: why 为什么还需要延迟 500ms
                  startObserverDom(ele.querySelector('.stage1 .button'), ele.querySelector('.stage1 .track'));
                }, 500);
              }).catch(function (err) {
                console.error(err); // eslint-disable-line
              });
            }
          }
        } // TODO: 心跳检测二次验证的结果


        window.getNC().then(function () {
          window.NoCaptcha.setEnabled(true);
          window.NoCaptcha.upLang('cn', {
            LOADING: '加载中...',
            // 加载状态提示
            SLIDER_LABEL: '请向右滑动验证',
            // 等待滑动状态提示
            CHECK_Y: '验证通过',
            // 验证通过状态提示
            ERROR_TITLE: '验证未通过' // 验证失败触发拦截状态提示

          });

          window._nvc_nc.reset(); // eslint-disable-line


          setTimeout._setTimeout(function () {
            window._nvc_nc.reset(); // eslint-disable-line

          }, 100); // TODO: why 需要延迟 100ms

        }); // 5分钟内如果未通过, 则被认为是机器人

        normalizeComponent.heartCheck(function () {
          return window[sdkSlidingVerificationKey];
        }, 1000, 1000 * 60 * 5).then(function () {
          return resolveWrapper(res);
        }).catch(function (err) {
          return reject(err);
        });
      } else if (code === 800 || code === 900) {
        reject(new Error('系统检测为机器人操作'));
      }
    }).catch(function (err) {
      reject(err);
    });
  });
} // 获取人机验证配置对象: 无痕配置 && 滑动验证

function getConfig(requestId, appkey, scene, debugTrans) {
  if (!document.querySelector("#" + renderToElementId)) {
    var ele = document.createElement('div');
    ele.setAttribute('id', renderToElementId);
    document.body.appendChild(ele);
  }

  var opts = {
    appkey: appkey,
    scene: scene,
    isH5: true,
    popUp: false,
    renderTo: "#" + renderToElementId,
    nvcCallback: function nvcCallback(data) {
      safeRequest(requestId, cacheData[requestId].url, cacheData[requestId].renderToWrapperId, data);
    },
    language: 'cn',
    retryTimes: 5,
    // 允许服务器超时重复次数，默认5次。
    customWidth: 200,
    // 当唤醒滑动验证作为二次验证时，配置滑动验证组件的宽度
    token: new Date().getTime() + String(Math.random()).substring(2)
  };

  if (debugTrans) {
    opts.trans = debugTrans;
    opts.appkey = 'CF_APP_1';
    opts.scene = 'nvc_register_h5';
  }

  return opts;
}
/**
 * 人机认证 SDK 初始化入口, 步骤如下:
 *  1、请求配置信息: appkey、scene、sdk-url
 *  2、加载 sdk-url (确保 SDK 完全可用后再 resolve)
 * 额外说明: 支持重复调用
 */


function initSdk(requestId, debugTrans) {
  return new normalizeComponent._Promise(function (resolve, reject) {
    if (!requestId) reject(new Error('requestId 参数缺失'));
    if (cacheData[requestId]) reject(new Error("requestId (" + requestId + ") \u5DF2\u5B58\u5728"));

    function customResolve() {
      cacheData[requestId] = {
        debugTrans: debugTrans
      };
      resolve();
    }

    if (window[sdkInitedKey]) {
      // SDK 已初始化完成
      customResolve();
      return;
    }

    if (window[sdkInitingKey]) {
      // SDK 正在初始化的
      normalizeComponent.heartCheck(heartCheckSureReady).then(function () {
        return customResolve();
      }).catch(function (err) {
        return reject(err);
      });
      return;
    }

    window[sdkInitingKey] = true; // 开始初始化 SDK

    var url = '//third-api.winbaoxian.cn/afs/getAfsConfig';
    requestAjax(url).then(function (_ref) {
      var cfg = _ref.data;
      window.NVC_Opt = getConfig(requestId, cfg.appkey, cfg.scene, debugTrans);
      return loadJSScriptAndCheck(cfg.sdk + "?t=" + getHourString());
    }).then(function () {
      window[sdkInitingKey] = false;
      window[sdkInitedKey] = true;
      customResolve();
    }).catch(function (err) {
      window[sdkInitingKey] = false;
      window[sdkInitedKey] = false;
      reject(err);
    });
  });
}
function nvcRequest(requestId, url, renderId, debugTrans, sliderStartCb) {
  return initSdk(requestId, debugTrans).then(function () {
    return safeRequest(requestId, url, renderId, null, sliderStartCb);
  });
}

var _components;
var captchaSendUrl;
var captchaSendVoiceUrl;
var host = window.location.hostname;

if (/^.*\.wyins\.net$/.test(host)) {
  captchaSendUrl = '//third-api.wyins.net/captcha/send?mobile=';
  captchaSendVoiceUrl = '//third-api.wyins.net/captcha/sendVoice?mobile=';
} else if (/^.*\.wyins\.net.cn$/.test(host)) {
  captchaSendUrl = '//third-api.wyins.net.cn/captcha/send?mobile=';
  captchaSendVoiceUrl = '//third-api.wyins.net.cn/captcha/sendVoice?mobile=';
} else if (/^.*\.com$/.test(host) && host !== 'test.winbaoxian.com') {
  captchaSendUrl = '//third-api.winbaoxian.com/captcha/send?mobile=';
  captchaSendVoiceUrl = '//third-api.winbaoxian.com/captcha/sendVoice?mobile=';
} else {
  captchaSendUrl = '//third-api.winbaoxian.cn/captcha/send?mobile=';
  captchaSendVoiceUrl = '//third-api.winbaoxian.cn/captcha/sendVoice?mobile=';
}

var script = normalizeComponent.create({
  name: 'verify-code-input',
  model: {
    prop: 'cellphone',
    event: 'input'
  },
  props: {
    debugVoice: {
      type: Boolean,
      default: false
    },
    debugNvc: {
      type: Object,
      required: false
    },
    cellphone: {
      type: [String, Number],
      required: true
    },
    placeholder: {
      type: String,
      default: '请输入手机号码'
    },
    errorMessage: {
      type: String,
      default: ''
    }
  },
  components: (_components = {}, _components[input.default.name] = input.default, _components),
  data: function data() {
    return {
      requestId: '',
      // nvc 的请求 ID
      sliderId: '',
      // 随机生成的元素 id, 验证滑块会显示在该元素内
      errorCellphoneMsg: '',
      currentVerifyCode: '',
      // 用户输入的验证码
      sliderOpening: false,
      // 验证滑块是否正在显示
      btnText: '',
      btnTextClickable: true,
      gettingTimes: 0,
      // 验证码的请求次数
      idGettingCode: null,
      // 计时器
      texts: {
        initial: '获取验证码',
        noTraceVerify: '验证获取中',
        // 无痕验证中的文案
        again: '重新获取'
      },
      countDown: 59,
      // 倒计时数字
      voiceText: '语音验证',
      btnVoiceTextClickable: true,
      voiceSliderOpening: false,
      // 验证滑块是否正在显示
      voiceSendSuccess: false // 语音验证码是否成功发送

    };
  },
  computed: {
    currentCellphone: {
      get: function get() {
        return this.cellphone;
      },
      set: function set(val) {
        this.$emit('input', val);
      }
    }
  },
  created: function created() {
    this.sliderId = "slider-" + new Date().getTime() + Math.random().toString(32).substring(2);
    this.btnText = this.texts.initial;
  },
  methods: {
    getVerifyCode: function getVerifyCode() {
      return this.currentVerifyCode;
    },
    // 重置组件状态
    resetCountDown: function resetCountDown(resetTimesAndCode) {
      this.sliderOpening = false;

      if (resetTimesAndCode) {
        this.currentVerifyCode = '';
        this.errorCellphoneMsg = '';
        this.gettingTimes = 0;
        this.btnText = this.texts.initial;
      } else {
        this.btnText = this.texts.again;
      }

      this.countDown = 59;
      window.clearInterval(this.idGettingCode);
      this.idGettingCode = null;
      this.btnTextClickable = true; // 语音验证码相关

      this.btnVoiceTextClickable = true;
      this.voiceSendSuccess = false;
      this.voiceSliderOpening = false;
      this.voiceText = '语音验证';
    },
    validCellphone: function validCellphone() {
      // 手机号非空校验
      if (!this.currentCellphone) {
        this.errorCellphoneMsg = '请输入手机号';
        return false;
      } // 手机号 11 位数字校验


      if (!/^[0-9]{11}$/.test(String(this.currentCellphone))) {
        this.errorCellphoneMsg = '手机号必须为11位数字';
        return false;
      }

      this.errorCellphoneMsg = '';
      return true;
    },
    // 如果手机号改变了, 则重置组件状态
    cellphoneChange: function cellphoneChange() {
      this.validCellphone();
      this.resetCountDown(true);
      resetNvc(this.requestId);
    },
    startCountDown: function startCountDown() {
      var _this = this;

      this.btnTextClickable = false;
      this.btnText = "\u91CD\u53D1 (" + this.countDown + "s)";
      this.idGettingCode = window.setInterval(function () {
        if (_this.countDown <= 0) {
          _this.resetCountDown(false);

          return;
        }

        _this.countDown = _this.countDown - 1;
        _this.btnText = "\u91CD\u53D1 (" + _this.countDown + "s)";
      }, 1000);
    },
    // 获取短信验证码
    handlerGetVerifyCode: function handlerGetVerifyCode() {
      var _this2 = this;

      if (!this.btnTextClickable) return;
      if (!this.validCellphone()) return;
      if (window.appBridge) window.appBridge.showLoading(true);
      this.btnTextClickable = false;
      this.btnText = '验证获取中';
      this.gettingTimes = this.gettingTimes + 1;
      this.requestId = new Date().getTime() + Math.random().toString(32).substring(2);

      var sliderStartCb = function sliderStartCb() {
        _this2.sliderOpening = true;
        if (window.appBridge) window.appBridge.hideLoading();
      };

      nvcRequest(this.requestId, "" + captchaSendUrl + this.currentCellphone, "#" + this.sliderId, this.debugNvc, // { nvcCode: 400, key1: "code300" },
      sliderStartCb).then(function (res) {
        if (res.success === false) throw new Error(res.info);
        if (window.appBridge) window.appBridge.hideLoading();
        _this2.sliderOpening = false; // 手机号校验通过, 倒计时开始

        _this2.$toast(res.info || '验证码发送成功');

        _this2.startCountDown();

        _this2.$refs.inputVerifyCode.$el.querySelector('input').focus();
      }).catch(function (err) {
        if (window.appBridge) window.appBridge.hideLoading();

        _this2.$toast(err.message || '发送验证码失败，请稍后再试');

        _this2.startCountDown();

        _this2.sliderOpening = false;
      });
    },
    // 获取语音验证码
    handlerGetVerifyVoice: function handlerGetVerifyVoice() {
      var _this3 = this;

      if (!this.btnVoiceTextClickable) return;
      if (!this.validCellphone()) return;
      if (window.appBridge) window.appBridge.showLoading(true);
      this.btnVoiceTextClickable = false;
      this.voiceText = '验证获取中';
      this.requestId = new Date().getTime() + Math.random().toString(32).substring(2);

      var sliderStartCb = function sliderStartCb() {
        _this3.voiceSliderOpening = true;
        if (window.appBridge) window.appBridge.hideLoading();
      };

      nvcRequest(this.requestId, "" + captchaSendVoiceUrl + this.currentCellphone, "#" + this.sliderId, this.debugNvc, sliderStartCb).then(function (res) {
        if (res.success === false) throw new Error(res.info);
        if (window.appBridge) window.appBridge.hideLoading();
        _this3.voiceSliderOpening = false;
        _this3.voiceSendSuccess = true; // 手机号校验通过, 倒计时开始

        _this3.$toast(res.info || '请留意接听语音验证码');

        _this3.safeFocusInput();
      }).catch(function (err) {
        if (window.appBridge) window.appBridge.hideLoading();

        _this3.$toast(err.message || '发送验证码失败，请稍后再试');

        _this3.voiceText = '语音验证';
        _this3.btnVoiceTextClickable = true;
        _this3.voiceSliderOpening = false;
      });
    }
  },
  safeFocusInput: function safeFocusInput() {
    var inputEle = this.$refs.inputVerifyCode.$el.querySelector('input');

    if (inputEle) {
      inputEle.focus();
    }
  },
  beforeDestroy: function beforeDestroy() {
    window.clearInterval(this.idGettingCode);
  }
});

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('div', {
    staticClass: "bx-verify-code-input"
  }, [_c('div', {
    staticClass: "bx-hairline--bottom"
  }, [_c('bxs-input', {
    attrs: {
      "placeholder": _vm.placeholder,
      "label": "手机号",
      "type": "number",
      "error-message": _vm.errorCellphoneMsg
    },
    on: {
      "change": _vm.cellphoneChange
    },
    model: {
      value: _vm.currentCellphone,
      callback: function callback($$v) {
        _vm.currentCellphone = typeof $$v === 'string' ? trim$1._trimInstanceProperty($$v).call($$v) : $$v;
      },
      expression: "currentCellphone"
    }
  })], 1), _c('div', {
    staticClass: "bx-hairline--bottom"
  }, [_c('bxs-input', _vm._b({
    ref: "inputVerifyCode",
    class: {
      'has-error': _vm.errorMessage
    },
    attrs: {
      "placeholder": "请输入验证码",
      "error-message": _vm.errorMessage,
      "label": "验证码",
      "type": "text",
      "autocomplete": "one-time-code"
    },
    model: {
      value: _vm.currentVerifyCode,
      callback: function callback($$v) {
        _vm.currentVerifyCode = typeof $$v === 'string' ? trim$1._trimInstanceProperty($$v).call($$v) : $$v;
      },
      expression: "currentVerifyCode"
    }
  }, 'bxs-input', _vm.$attrs, false), [!_vm.sliderOpening ? _c('span', {
    staticClass: "bx-verify-code-input-button",
    class: {
      'bx-verify-code-input-button--getting': !this.btnTextClickable
    },
    attrs: {
      "slot": "button"
    },
    on: {
      "click": _vm.handlerGetVerifyCode
    },
    slot: "button"
  }, [_vm._v("\n        " + _vm._s(_vm.btnText) + "\n      ")]) : _vm._e()])], 1), _c('div', {
    staticClass: "bx-verify-code-input-slider"
  }, [_c('div', {
    staticClass: "bx-verify-code-input-tip"
  }, [_vm._v("\n      请滑动验证，获取验证码\n    ")]), _c('div', {
    attrs: {
      "id": _vm.sliderId
    }
  })]), (_vm.debugVoice || _vm.gettingTimes >= 2) && !_vm.voiceSliderOpening && !_vm.voiceSendSuccess ? _c('div', {
    staticClass: "bx-verify-code-input-voice",
    class: {
      'bx-verify-code-input-button--getting': !this.btnVoiceTextClickable
    }
  }, [_c('span', {
    on: {
      "click": _vm.handlerGetVerifyVoice
    }
  }, [_vm._v("\n      " + _vm._s(_vm.voiceText) + "\n    ")])]) : _vm._e()]);
};

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 = 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 = index;
