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B,WAAW,EAAI,EACjB,EACA,iBAAkB,SAA0B,EAAI,GAC9C,WAAW,EAAI,EACjB,EACA,OAAQ,SAAgB,GACtB,SAAS,KAAK,YAAY,EAAG,OAC/B,GAGE,QAAU,SAAiB,GAC7B,EAAI,UAAU,YAAa,UAC7B,EAEsB,oBAAX,QAA0B,OAAO,KAC1C,OAAO,IAAI,IAAI,SAGjB,UAAU,QAAU,QAEpB,OAAO,QAAU","file":"/npm/vue-input-autowidth@1.0.11/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/vue-input-autowidth@1.0.11/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nrequire('es6-object-assign/auto');\n\nfunction checkWidth (el, binding) {\n  var mirror = document.querySelector(\".vue-input-autowidth-mirror-\".concat(el.dataset.uuid));\n  var defaults = {\n    maxWidth: \"none\",\n    minWidth: \"none\",\n    comfortZone: 0\n  };\n  var options = Object.assign({}, defaults, binding.value);\n  el.style.maxWidth = options.maxWidth;\n  el.style.minWidth = options.minWidth;\n  var val = el.value;\n\n  if (!val) {\n    val = el.placeholder || \"\";\n  }\n\n  while (mirror.childNodes.length) {\n    mirror.removeChild(mirror.childNodes[0]);\n  }\n\n  mirror.appendChild(document.createTextNode(val));\n  var newWidth = mirror.scrollWidth + options.comfortZone + 2;\n\n  if (newWidth != el.scrollWidth) {\n    el.style.width = \"\".concat(newWidth, \"px\");\n  }\n}\n\nvar directive = {\n  bind: function bind(el) {\n    if (el.tagName.toLocaleUpperCase() !== \"INPUT\") {\n      throw new Error(\"v-input-autowidth can only be used on input elements.\");\n    }\n\n    el.dataset.uuid = Math.random().toString(36).slice(-5);\n    el.style.boxSizing = \"content-box\";\n  },\n  inserted: function inserted(el, binding) {\n    var styles = window.getComputedStyle(el);\n    el.mirror = document.createElement(\"span\");\n    Object.assign(el.mirror.style, {\n      position: \"absolute\",\n      top: \"0\",\n      left: \"0\",\n      visibility: \"hidden\",\n      height: \"0\",\n      overflow: \"hidden\",\n      whiteSpace: \"pre\",\n      fontSize: styles.fontSize,\n      fontFamily: styles.fontFamily,\n      fontWeight: styles.fontWeight,\n      fontStyle: styles.fontStyle,\n      letterSpacing: styles.letterSpacing,\n      textTransform: styles.textTransform\n    });\n    el.mirror.classList.add(\"vue-input-autowidth-mirror-\".concat(el.dataset.uuid));\n    el.mirror.setAttribute(\"aria-hidden\", \"true\");\n    document.body.appendChild(el.mirror);\n    checkWidth(el, binding);\n  },\n  componentUpdated: function componentUpdated(el, binding) {\n    checkWidth(el, binding);\n  },\n  unbind: function unbind(el) {\n    document.body.removeChild(el.mirror);\n  }\n};\n\nvar install = function install(Vue) {\n  Vue.directive(\"autowidth\", directive);\n};\n\nif (typeof window !== \"undefined\" && window.Vue) {\n  window.Vue.use(install);\n}\n\ndirective.install = install;\n\nmodule.exports = directive;\n"]}