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["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@zag-js/auto-resize@1.31.1/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\nvar domQuery = require('@zag-js/dom-query');\n\n// src/autoresize-input.ts\nfunction getVisualStyles(node) {\n  if (!node) return;\n  const style = domQuery.getComputedStyle(node);\n  return \"box-sizing:\" + style.boxSizing + \";border-left:\" + style.borderLeftWidth + \" solid red;border-right:\" + style.borderRightWidth + \" solid red;font-family:\" + style.fontFamily + \";font-feature-settings:\" + style.fontFeatureSettings + \";font-kerning:\" + style.fontKerning + \";font-size:\" + style.fontSize + \";font-stretch:\" + style.fontStretch + \";font-style:\" + style.fontStyle + \";font-variant:\" + style.fontVariant + \";font-variant-caps:\" + style.fontVariantCaps + \";font-variant-ligatures:\" + style.fontVariantLigatures + \";font-variant-numeric:\" + style.fontVariantNumeric + \";font-weight:\" + style.fontWeight + \";letter-spacing:\" + style.letterSpacing + \";margin-left:\" + style.marginLeft + \";margin-right:\" + style.marginRight + \";padding-left:\" + style.paddingLeft + \";padding-right:\" + style.paddingRight + \";text-indent:\" + style.textIndent + \";text-transform:\" + style.textTransform;\n}\n\n// src/autoresize-input.ts\nfunction createGhostElement(doc) {\n  var el = doc.createElement(\"div\");\n  el.id = \"ghost\";\n  el.style.cssText = \"display:inline-block;height:0;overflow:hidden;position:absolute;top:0;visibility:hidden;white-space:nowrap;\";\n  doc.body.appendChild(el);\n  return el;\n}\nfunction autoResizeInput(input) {\n  if (!input) return;\n  const doc = domQuery.getDocument(input);\n  const win = domQuery.getWindow(input);\n  const ghost = createGhostElement(doc);\n  const cssText = getVisualStyles(input);\n  if (cssText) ghost.style.cssText += cssText;\n  function resize() {\n    win.requestAnimationFrame(() => {\n      ghost.innerHTML = input.value;\n      const rect = win.getComputedStyle(ghost);\n      input?.style.setProperty(\"width\", rect.width);\n    });\n  }\n  resize();\n  input?.addEventListener(\"input\", resize);\n  input?.addEventListener(\"change\", resize);\n  return () => {\n    doc.body.removeChild(ghost);\n    input?.removeEventListener(\"input\", resize);\n    input?.removeEventListener(\"change\", resize);\n  };\n}\nvar autoresizeTextarea = (el) => {\n  if (!el) return;\n  const style = domQuery.getComputedStyle(el);\n  const win = domQuery.getWindow(el);\n  const doc = domQuery.getDocument(el);\n  const resize = () => {\n    requestAnimationFrame(() => {\n      el.style.height = \"auto\";\n      let newHeight;\n      if (style.boxSizing === \"content-box\") {\n        newHeight = el.scrollHeight - (parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));\n      } else {\n        newHeight = el.scrollHeight + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n      }\n      if (style.maxHeight !== \"none\" && newHeight > parseFloat(style.maxHeight)) {\n        if (style.overflowY === \"hidden\") {\n          el.style.overflowY = \"scroll\";\n        }\n        newHeight = parseFloat(style.maxHeight);\n      } else if (style.overflowY !== \"hidden\") {\n        el.style.overflowY = \"hidden\";\n      }\n      el.style.height = `${newHeight}px`;\n    });\n  };\n  el.addEventListener(\"input\", resize);\n  el.form?.addEventListener(\"reset\", resize);\n  const elementPrototype = Object.getPrototypeOf(el);\n  const descriptor = Object.getOwnPropertyDescriptor(elementPrototype, \"value\");\n  Object.defineProperty(el, \"value\", {\n    ...descriptor,\n    set() {\n      descriptor?.set?.apply(this, arguments);\n      resize();\n    }\n  });\n  const resizeObserver = new win.ResizeObserver(() => {\n    requestAnimationFrame(() => resize());\n  });\n  resizeObserver.observe(el);\n  const attrObserver = new win.MutationObserver(() => resize());\n  attrObserver.observe(el, { attributes: true, attributeFilter: [\"rows\", \"placeholder\"] });\n  doc.fonts?.addEventListener(\"loadingdone\", resize);\n  return () => {\n    el.removeEventListener(\"input\", resize);\n    el.form?.removeEventListener(\"reset\", resize);\n    doc.fonts?.removeEventListener(\"loadingdone\", resize);\n    resizeObserver.disconnect();\n    attrObserver.disconnect();\n  };\n};\n\nexports.autoResizeInput = autoResizeInput;\nexports.autoresizeTextarea = autoresizeTextarea;\n"]}