@designbasekorea/wordpress-ui 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser.cjs +1 -1
- package/dist/browser.esm.js +1 -1
- package/dist/browser.iife.js +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.esm.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.esm.js +1 -1
- package/dist/styles/controls.css +1 -1
- package/dist/styles/shell.css +1 -1
- package/dist/styles.css +1 -1
- package/docs/WORDPRESS-ADMIN-GUIDE.md +5 -5
- package/package.json +2 -2
- package/wordpress-ui.php +6 -0
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={"arrow-bar-left":'<path fill="currentColor" d="M20.75 20h-1.5V4h1.5zM11.03 6.53l-4.72 4.72H16v1.5H6.31l4.72 4.72-1.06 1.06L3.44 12l6.53-6.53z"/>',"arrow-bar-right":'<path fill="currentColor" d="M4.75 20h-1.5V4h1.5zm15.81-8-6.53 6.53-1.06-1.06 4.72-4.72H8v-1.5h9.69l-4.72-4.72 1.06-1.06z"/>',award:'<path fill="currentColor" d="M11.753 15.5c-1.8 0-3.5-.7-4.77-1.98a6.74 6.74 0 0 1-1.98-4.77c0-1.8.7-3.5 1.98-4.77A6.74 6.74 0 0 1 11.753 2c1.8 0 3.5.7 4.77 1.98a6.74 6.74 0 0 1 1.98 4.77c0 1.8-.7 3.5-1.98 4.77a6.74 6.74 0 0 1-4.77 1.98m0-12c-1.4 0-2.72.55-3.71 1.54a5.22 5.22 0 0 0-1.54 3.71c0 1.4.55 2.72 1.54 3.71a5.22 5.22 0 0 0 3.71 1.54c1.4 0 2.72-.55 3.71-1.54a5.22 5.22 0 0 0 1.54-3.71c0-1.4-.55-2.72-1.54-3.71a5.22 5.22 0 0 0-3.71-1.54"/><path fill="currentColor" d="M15.313 21.5a.74.74 0 0 1-.64-.37l-3.56-5.96a.751.751 0 1 1 1.29-.77l2.86 4.8 1.06-2.07a.76.76 0 0 1 .72-.41l2.33.17-2.95-4.99a.76.76 0 0 1 .26-1.03c.36-.21.82-.09 1.03.26l3.68 6.22c.14.24.14.54 0 .78s-.4.37-.69.35l-3.27-.23-1.45 2.83c-.12.24-.37.4-.64.41h-.02z"/><path fill="currentColor" d="M8.193 21.5h-.02c-.27 0-.52-.17-.64-.41l-1.45-2.83-3.28.23a.75.75 0 0 1-.69-.35.73.73 0 0 1 0-.78l3.69-6.18c.21-.36.67-.47 1.03-.26s.47.67.26 1.03l-2.95 4.95 2.34-.17c.31-.01.58.14.72.41l1.06 2.07 2.86-4.8c.21-.36.67-.47 1.03-.26s.47.67.26 1.03l-3.56 5.96c-.14.23-.38.37-.64.37z"/>',apple:'<path fill="currentColor" fill-rule="evenodd" d="M18.644 18.648q-.807 1.15-1.316 1.592-.787.723-1.692.744-.649.001-1.562-.373-.914-.372-1.683-.371-.805-.001-1.73.371-.924.375-1.495.393-.866.038-1.729-.764-.55-.48-1.377-1.648-.885-1.245-1.455-2.891-.61-1.78-.611-3.447 0-1.91.826-3.292a4.86 4.86 0 0 1 1.73-1.751 4.65 4.65 0 0 1 2.34-.662q.69.001 1.81.422t1.436.422q.237 0 1.593-.498 1.279-.46 2.163-.384 2.4.192 3.6 1.895-2.145 1.301-2.123 3.637.02 1.82 1.317 3.023a4.3 4.3 0 0 0 1.315.863q-.159.46-.336.882a10.3 10.3 0 0 1-1.021 1.837M14.959 5.039c-.836.976-1.846 1.541-2.941 1.452a3 3 0 0 1-.021-.36c0-.913.396-1.889 1.103-2.688q.528-.607 1.343-1.009.813-.397 1.536-.435.02.192.019.381-.001 1.426-1.039 2.659" clip-rule="evenodd"/>',"play-store":'<path fill="currentColor" fill-rule="evenodd" d="M15.911 8.659 6.36 3.29c-.633-.342-1.226-.39-1.746-.016l8.34 8.34zm3.578 4.69c.6-.336.929-.812.929-1.34 0-.527-.329-1.004-.928-1.34l-2.783-1.563-3.133 3.132 2.841 2.84zM4 4.659v14.706c0 .38.084.709.236.97l8.097-8.098L4.1 4.002c-.064.197-.1.417-.1.658m.902 16.25q.232.09.495.09.47 0 .968-.275l9.255-5.197-2.666-2.67z" clip-rule="evenodd"/>',"arrow-right":'<path fill="currentColor" d="m20.06 12-7.53 7.53-1.06-1.06 5.72-5.72H4v-1.5h13.19l-5.72-5.72 1.06-1.06z"/>',star:'<path fill="currentColor" fill-rule="evenodd" d="M12 1.25a.75.75 0 0 1 .673.419l2.926 5.945 6.509.944a.75.75 0 0 1 .417 1.278l-4.718 4.624 1.132 6.511a.75.75 0 0 1-1.083.796L12 18.744l-5.856 3.023a.75.75 0 0 1-1.083-.796l1.133-6.511-4.719-4.624a.75.75 0 0 1 .417-1.278l6.51-.944 2.925-5.945A.75.75 0 0 1 12 1.25m0 2.449L9.573 8.63a.75.75 0 0 1-.565.411l-5.4.783 3.917 3.84a.75.75 0 0 1 .214.664l-.941 5.412 4.858-2.508a.75.75 0 0 1 .688 0l4.858 2.508-.94-5.412a.75.75 0 0 1 .213-.665l3.918-3.84-5.4-.782a.75.75 0 0 1-.566-.41z" clip-rule="evenodd"/>',"star-filled":'<path fill="currentColor" d="M23 9c-.1-.4-.4-.6-.8-.7l-6.4-.9-2.9-5.8c-.3-.7-1.5-.7-1.8 0L8.2 7.4l-6.4.9c-.4 0-.7.3-.8.7s0 .8.3 1l4.6 4.5-1.1 6.4c0 .4 0 .8.4 1 .3.2.7.3 1.1 0l5.7-3 5.7 3c.1 0 .3.1.5.1s.4 0 .6-.2c.3-.2.5-.6.4-1l-1.1-6.4 4.6-4.5c.3-.3.4-.7.3-1z"/>',"star-half":'<path fill="currentColor" d="M8.9 8.3 2 9.3l5 4.8L5.8 21l6.2-3.2V2z"/><path fill="currentColor" fill-rule="evenodd" d="M12 1.25a.75.75 0 0 1 .673.419l2.926 5.945 6.509.944a.75.75 0 0 1 .417 1.278l-4.718 4.624 1.132 6.511a.75.75 0 0 1-1.083.796L12 18.744l-5.856 3.023a.75.75 0 0 1-1.083-.796l1.133-6.511-4.719-4.624a.75.75 0 0 1 .417-1.278l6.51-.944 2.925-5.945A.75.75 0 0 1 12 1.25m0 2.449L9.573 8.63a.75.75 0 0 1-.565.411l-5.4.783 3.917 3.84a.75.75 0 0 1 .214.664l-.941 5.412 4.858-2.508a.75.75 0 0 1 .688 0l4.858 2.508-.94-5.412a.75.75 0 0 1 .213-.665l3.918-3.84-5.4-.782a.75.75 0 0 1-.566-.41z" clip-rule="evenodd"/>',"trending-up":'<path fill="currentColor" d="M22 11V5h-6"/><path fill="currentColor" fill-rule="evenodd" d="M21.53 6.53 13 15.06l-3-3-6.47 6.47-1.06-1.06L10 9.94l3 3 7.47-7.47z" clip-rule="evenodd"/>',cart:'<path fill="currentColor" d="M3 2.25c.945 0 1.714.75 1.747 1.688L4.94 6.25h16.899l-1.167 10.5h-2.093a2.75 2.75 0 1 1-3.156 0H9.578a2.75 2.75 0 1 1-3.156 0H4.31L3.253 4.063 3.25 4.03V4A.25.25 0 0 0 3 3.75H1v-1.5zm5 15.5a1.25 1.25 0 1 0-.001 2.499A1.25 1.25 0 0 0 8 17.75m9 0a1.25 1.25 0 1 0-.001 2.499A1.25 1.25 0 0 0 17 17.75m-11.31-2.5h13.64l.832-7.5H5.064z"/>',"bell-active":'<path fill="currentColor" fill-rule="evenodd" d="M6.75 10.015V13c0 1.445-.466 2.453-1.06 3.25h12.62c-.594-.797-1.06-1.805-1.06-3.25v-2.985c-.047-1.117-.55-2.449-1.465-3.497C14.879 5.479 13.6 4.75 12 4.75s-2.879.73-3.785 1.768c-.914 1.048-1.418 2.38-1.465 3.497m.335-4.483C8.229 4.221 9.9 3.25 12 3.25s3.771.97 4.915 2.282c1.132 1.298 1.777 2.96 1.834 4.44l.001.028v3c0 1.67.788 2.477 1.78 3.47a.75.75 0 0 1-.53 1.28H4a.75.75 0 0 1-.53-1.28c.992-.992 1.78-1.8 1.78-3.47V9.971c.057-1.48.703-3.141 1.835-4.439" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M9 16.25a.75.75 0 0 1 .75.75v1c0 1.286.964 2.25 2.25 2.25s2.25-.964 2.25-2.25v-1a.75.75 0 0 1 1.5 0v1c0 2.114-1.636 3.75-3.75 3.75S8.25 20.114 8.25 18v-1a.75.75 0 0 1 .75-.75M17.424 2.52a.75.75 0 0 1 1.056-.096c1.307 1.089 2.463 2.786 3.19 4.24a.75.75 0 1 1-1.34.671c-.673-1.345-1.717-2.848-2.81-3.759a.75.75 0 0 1-.096-1.056M6.576 2.52a.75.75 0 0 1-.096 1.056c-1.093.911-2.137 2.414-2.81 3.76a.75.75 0 0 1-1.34-.671c.727-1.455 1.883-3.152 3.19-4.241a.75.75 0 0 1 1.056.096M12 1.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75" clip-rule="evenodd"/>',"caret-down-filled":'<path fill="currentColor" d="m12 14.5 5-5H7z"/>',"caret-updown-filled":'<path fill="currentColor" fill-rule="evenodd" d="m7 10 5-5 5 5zM17 14l-5 5-5-5z" clip-rule="evenodd"/>',"chevron-down":'<path fill="currentColor" fill-rule="evenodd" d="m5.47 9.53 1.06-1.06L12 13.94l5.47-5.47 1.06 1.06L12 16.06z" clip-rule="evenodd"/>',"chevron-up":'<path fill="currentColor" fill-rule="evenodd" d="m12 7.94 6.53 6.53-1.06 1.06L12 10.06l-5.47 5.47-1.06-1.06z" clip-rule="evenodd"/>',"chevron-left":'<path fill="currentColor" fill-rule="evenodd" d="m10.06 12 5.47-5.47-1.06-1.06L7.94 12l6.53 6.53 1.06-1.06z" clip-rule="evenodd"/>',"chevron-right":'<path fill="currentColor" fill-rule="evenodd" d="M9.53 5.47 16.06 12l-6.53 6.53-1.06-1.06L13.94 12 8.47 6.53z" clip-rule="evenodd"/>',calendar:'<path fill="currentColor" fill-rule="evenodd" d="M16.25 8V2h1.5v6zM6.25 8V2h1.5v6zM21 11.75H3v-1.5h18z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75a.25.25 0 0 0-.25.25v14c0 .138.112.25.25.25h16a.25.25 0 0 0 .25-.25V6a.25.25 0 0 0-.25-.25zM2.25 6c0-.966.784-1.75 1.75-1.75h16c.966 0 1.75.784 1.75 1.75v14A1.75 1.75 0 0 1 20 21.75H4A1.75 1.75 0 0 1 2.25 20z" clip-rule="evenodd"/>',camera:'<path fill="currentColor" fill-rule="evenodd" d="M7.785 5.475A2.73 2.73 0 0 1 10.07 4.25h3.86c.907 0 1.773.452 2.285 1.225v.002l1.186 1.773H20A2.756 2.756 0 0 1 22.75 10v7A2.756 2.756 0 0 1 20 19.75H4A2.756 2.756 0 0 1 1.25 17v-7A2.756 2.756 0 0 1 4 7.25h2.6zm2.285.275c-.42 0-.804.206-1.034.553l-.002.004L7.4 8.75H4c-.686 0-1.25.564-1.25 1.25v7c0 .686.564 1.25 1.25 1.25h16c.686 0 1.25-.564 1.25-1.25v-7c0-.686-.564-1.25-1.25-1.25h-3.4l-1.636-2.447a1.24 1.24 0 0 0-1.034-.553z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 10.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M8.25 13a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0" clip-rule="evenodd"/>',clock:'<path fill="currentColor" fill-rule="evenodd" d="M12.75 11.25V6h-1.5v6.75H16v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12" clip-rule="evenodd"/>',bulb:'<path fill="currentColor" d="M15.5 17.5H8v-.75s-.02-1.79-1.06-3.21l-.29-.39C5.88 12.12 5 10.95 5 8.93 5 5.11 8.03 2 11.75 2s6.75 3.11 6.75 6.93c0 2-.87 3.17-1.65 4.2l-.29.39c-1.05 1.45-1.06 3.21-1.06 3.23zM9.44 16h4.62c.11-.81.42-2.16 1.29-3.36l.31-.41c.69-.93 1.35-1.8 1.35-3.31 0-2.99-2.36-5.43-5.25-5.43S6.5 5.93 6.5 8.93c0 1.52.66 2.4 1.35 3.32l.31.41c.86 1.19 1.17 2.53 1.28 3.34M15.75 20h-8v1.5h8z"/>',"circle-checked":'<path fill="currentColor" fill-rule="evenodd" d="m10.32 14.27 6.15-6.134 1.06 1.062-7.22 7.2L6.467 12.5l1.068-1.054z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M1.25 12C1.25 6.086 6.086 1.25 12 1.25S22.75 6.086 22.75 12 17.914 22.75 12 22.75 1.25 17.914 1.25 12M12 2.75c-5.086 0-9.25 4.164-9.25 9.25s4.164 9.25 9.25 9.25 9.25-4.164 9.25-9.25S17.086 2.75 12 2.75" clip-rule="evenodd"/>',"cloud-close":'<path fill="currentColor" fill-rule="evenodd" d="M5.23 9.323A7.75 7.75 0 0 1 12.5 4.25c3.782 0 6.923 2.71 7.606 6.291A4.74 4.74 0 0 1 23.25 15a4.75 4.75 0 0 1-4.75 4.75H6A5.25 5.25 0 0 1 .75 14.5c0-2.64 1.95-4.805 4.48-5.177M12.5 5.75a6.25 6.25 0 0 0-5.993 4.483l-.15.512-.534.025A3.74 3.74 0 0 0 2.25 14.5 3.75 3.75 0 0 0 6 18.25h12.5a3.243 3.243 0 0 0 .763-6.398l-.504-.122-.064-.514A6.25 6.25 0 0 0 12.5 5.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m14.47 15.53-5-5 1.06-1.06 5 5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m9.47 14.47 5-5 1.06 1.06-5 5z" clip-rule="evenodd"/>',close:'<path fill="currentColor" fill-rule="evenodd" d="m5.47 17.47 12-12 1.06 1.06-12 12z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m6.53 5.47 12 12-1.06 1.06-12-12z" clip-rule="evenodd"/>',done:'<path fill="currentColor" fill-rule="evenodd" d="M9.476 15.936 18.97 6.47l1.06 1.062L9.468 18.064l-5.502-5.58 1.068-1.053z" clip-rule="evenodd"/>',documentation:'<path fill="currentColor" fill-rule="evenodd" d="M2.25 4.25H9A3.75 3.75 0 0 1 12.75 8v13h-1.5A2.25 2.25 0 0 0 9 18.75H2.25zm9 13.75V8A2.25 2.25 0 0 0 9 5.75H3.75v11.5H9c.844 0 1.623.279 2.25.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 8A3.75 3.75 0 0 1 15 4.25h6.75v14.5H15A2.25 2.25 0 0 0 12.75 21h-1.5zm1.5 10c.627-.471 1.406-.75 2.25-.75h5.25V5.75H15A2.25 2.25 0 0 0 12.75 8z" clip-rule="evenodd"/>',"doughnut-chart":'<path fill="currentColor" d="M12 4.75A7.25 7.25 0 0 0 4.75 12 7.25 7.25 0 0 0 12 19.25c1.784 0 3.416-.644 4.68-1.713l.968 1.146A8.72 8.72 0 0 1 12 20.75 8.75 8.75 0 0 1 3.25 12 8.75 8.75 0 0 1 12 3.25zm6.743 1.673A8.72 8.72 0 0 1 20.75 12a8.72 8.72 0 0 1-1.851 5.382l-1.182-.923A7.22 7.22 0 0 0 19.25 12a7.22 7.22 0 0 0-1.663-4.62zM13.532 3.384a8.75 8.75 0 0 1 4.1 1.919l-.965 1.148A7.25 7.25 0 0 0 13.273 4.86z"/>',download:'<path fill="currentColor" fill-rule="evenodd" d="M2.25 15h1.5v4.25h16.5V15h1.5v5.75H2.25z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m6.47 11.53 1.06-1.06L12 14.94l4.47-4.47 1.06 1.06L12 17.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 16V3h1.5v13z" clip-rule="evenodd"/>',"error-filled":'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5M8.47 9.53l1.06-1.06L12 10.94l2.47-2.47 1.06 1.06L13.06 12l2.47 2.47-1.06 1.06L12 13.06l-2.47 2.47-1.06-1.06L10.94 12z" clip-rule="evenodd"/>',edit:'<path fill="currentColor" fill-rule="evenodd" d="M15.506 3.322a3.655 3.655 0 0 1 5.172 0 3.655 3.655 0 0 1 0 5.172L7.466 21.75H2.25v-5.215zm2.586.428c-.572 0-1.121.227-1.525.632l-.002.001L3.75 17.157v3.093h3.093L19.618 7.434a2.16 2.16 0 0 0-1.526-3.684" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M17.7 10.453 13.548 6.3l1.06-1.06 4.154 4.154z" clip-rule="evenodd"/>',eyedropper:'<path fill="currentColor" d="M17.889 11.615a.25.25 0 0 0 0-.353l-5.657-5.657a.25.25 0 0 0-.354 0l-1.414 1.414a.25.25 0 0 0 0 .354l5.657 5.656a.25.25 0 0 0 .354 0zm-.354 2.475a1.75 1.75 0 0 1-2.475 0L9.404 8.433a1.75 1.75 0 0 1 0-2.475l1.414-1.414a1.75 1.75 0 0 1 2.475 0l5.657 5.657a1.75 1.75 0 0 1 0 2.475z"/><path fill="currentColor" d="m15.951 12.86-7.077 7.076-.262.03-1.009.11-.453.454a2.85 2.85 0 0 1-4.03-4.03l.42-.42v-1.41l7.11-7.11zM5.04 15.291v1.41l-.86.86a1.35 1.35 0 0 0 1.91 1.909l.826-.826.262-.03 1.007-.111 5.644-5.644-3.18-3.178zM15.36 2.84a2.754 2.754 0 0 1 3.89 0l1.41 1.41a2.754 2.754 0 0 1 0 3.89l-2.94 2.941-5.3-5.3zm2.83 1.06a1.254 1.254 0 0 0-1.77 0l-1.88 1.88 3.18 3.18 1.88-1.88a1.255 1.255 0 0 0 0-1.77z"/><path fill="currentColor" d="m12.743 14.25-.006 1.5-8.46-.03.006-1.5z"/>',"file-new":'<path fill="currentColor" fill-rule="evenodd" d="M4.25 4c0-.966.784-1.75 1.75-1.75h7.31l6.44 6.44V20A1.75 1.75 0 0 1 18 21.75H6A1.75 1.75 0 0 1 4.25 20zM6 3.75a.25.25 0 0 0-.25.25v16c0 .138.112.25.25.25h12a.25.25 0 0 0 .25-.25V9.31l-5.56-5.56z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M13.75 8.25V3h-1.5v6.75H19v-1.5zM15 15.75H9v-1.5h6z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 18v-6h1.5v6z" clip-rule="evenodd"/>',"folder-open":'<path fill="currentColor" fill-rule="evenodd" d="M5 4.75c-.69 0-1.25.559-1.25 1.25v8.824l1.303-2.606c.296-.593.904-.968 1.565-.968H18.25V8c0-.69-.559-1.25-1.25-1.25h-6.311L9.056 5.116a1.25 1.25 0 0 0-.884-.366zm14.75 6.5h.632c1.3 0 2.147 1.368 1.565 2.533l-2.724 5.446a2.75 2.75 0 0 1-2.46 1.521H5A2.75 2.75 0 0 1 2.25 18V6A2.75 2.75 0 0 1 5 3.25h3.172c.729 0 1.429.29 1.944.806L11.311 5.25H17A2.75 2.75 0 0 1 19.75 8zM3.76 18.157l2.635-5.269a.25.25 0 0 1 .223-.138H20.382a.25.25 0 0 1 .223.361l-2.724 5.448a1.25 1.25 0 0 1-1.118.691H5c-.637 0-1.163-.476-1.24-1.093" clip-rule="evenodd"/>',gallery:'<path fill="currentColor" d="M7.5 11c.8 0 1.5-.7 1.5-1.5S8.3 8 7.5 8 6 8.7 6 9.5 6.7 11 7.5 11"/><path fill="currentColor" fill-rule="evenodd" d="m16.698 9.015 5.787 4.913-.97 1.144-4.813-4.087L5.487 20.57l-.974-1.14z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 4.75c-.69 0-1.25.56-1.25 1.25v12c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V6c0-.69-.56-1.25-1.25-1.25zM1.25 6A2.75 2.75 0 0 1 4 3.25h16A2.75 2.75 0 0 1 22.75 6v12A2.75 2.75 0 0 1 20 20.75H4A2.75 2.75 0 0 1 1.25 18z" clip-rule="evenodd"/>',hide:'<path fill="currentColor" fill-rule="evenodd" d="M8.343 11.2c.056-.27.147-.581.284-.842l1.328.696c-.047.09-.102.252-.145.454-.041.199-.06.381-.06.492A2.27 2.27 0 0 0 12 14.25c.284 0 .685-.056.983-.2l.65 1.352c-.57.274-1.217.348-1.633.348-2.056 0-3.75-1.694-3.75-3.75 0-.238.035-.527.093-.8" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.833 12c.477-.936 1.58-2.68 3.626-3.843l-.742-1.304c-2.695 1.534-3.975 3.906-4.4 4.835L1.176 12l.143.312c.685 1.5 3.5 6.438 10.682 6.438 1.62 0 3.026-.253 4.242-.667l-.484-1.42c-1.054.36-2.297.587-3.758.587-5.874 0-8.377-3.707-9.167-5.25M12 6.75c-.673 0-1.6.084-2.202.227l-.346-1.46c.746-.177 1.797-.267 2.548-.267 7.182 0 9.997 4.939 10.682 6.438l.143.312-.143.312a11.1 11.1 0 0 1-3.22 4.037l-.923-1.184A9.7 9.7 0 0 0 21.166 12c-.79-1.544-3.292-5.25-9.166-5.25" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m19.763 22.237-18-18 1.06-1.06 18 18z" clip-rule="evenodd"/>',globe:'<path fill="currentColor" d="M18.895 2.105a9.7 9.7 0 0 1 0 13.79 9.6 9.6 0 0 1-6.145 2.824v1.531H17v1.5H7v-1.5h4.25v-1.531a9.6 9.6 0 0 1-6.145-2.824l1.06-1.061a8 8 0 0 0 11.673 0 8 8 0 0 0 0-11.667l1.057-1.062zM12 2.625A6.375 6.375 0 0 1 18.375 9 6.375 6.375 0 0 1 12 15.375 6.375 6.375 0 0 1 5.625 9 6.375 6.375 0 0 1 12 2.625m0 1.5A4.875 4.875 0 0 0 7.125 9 4.875 4.875 0 0 0 12 13.875 4.875 4.875 0 0 0 16.875 9 4.875 4.875 0 0 0 12 4.125"/>',"info-filled":'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5m-.75 5h1.5v1.5h-1.5zm0 3h1.5v6.5h-1.5z" clip-rule="evenodd"/>',lock:'<path fill="currentColor" fill-rule="evenodd" d="M5 11.75a.25.25 0 0 0-.25.25v8c0 .138.112.25.25.25h14a.25.25 0 0 0 .25-.25v-8a.25.25 0 0 0-.25-.25zM3.25 12c0-.966.784-1.75 1.75-1.75h14c.966 0 1.75.784 1.75 1.75v8A1.75 1.75 0 0 1 19 21.75H5A1.75 1.75 0 0 1 3.25 20z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75A3.26 3.26 0 0 0 8.75 7v4h-1.5V7A4.76 4.76 0 0 1 12 2.25 4.76 4.76 0 0 1 16.75 7v4h-1.5V7A3.26 3.26 0 0 0 12 3.75" clip-rule="evenodd"/>',mail:'<path fill="currentColor" fill-rule="evenodd" d="m1.665 8.67.67-1.34L12 12.161l9.665-4.833.67 1.342L12 13.839z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V7c0-.69-.56-1.25-1.25-1.25zM1.25 7A2.75 2.75 0 0 1 4 4.25h16A2.75 2.75 0 0 1 22.75 7v10A2.75 2.75 0 0 1 20 19.75H4A2.75 2.75 0 0 1 1.25 17z" clip-rule="evenodd"/>',microphone:'<path fill="currentColor" fill-rule="evenodd" d="M12 2.75a2.25 2.25 0 0 0-1.59.66h-.001A2.25 2.25 0 0 0 9.75 5v5c0 .596.237 1.168.66 1.59v.001A2.248 2.248 0 0 0 14.25 10V5A2.254 2.254 0 0 0 12 2.75m-2.651-.402A3.75 3.75 0 0 1 15.75 5v5A3.754 3.754 0 0 1 12 13.75 3.75 3.75 0 0 1 8.25 10V5c0-.995.395-1.949 1.099-2.652" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M6.52 15.48A7.76 7.76 0 0 1 4.25 10h1.5c0 1.657.659 3.247 1.83 4.42m0 0A6.25 6.25 0 0 0 18.25 10h1.5a7.749 7.749 0 0 1-13.23 5.48M16 21.75H8v-1.5h8z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 21v-4h1.5v4z" clip-rule="evenodd"/>',minus:'<path fill="currentColor" fill-rule="evenodd" d="M6 10.75h12v1.5H6z" clip-rule="evenodd"/>',moon:'<path fill="currentColor" fill-rule="evenodd" d="M11.67 2.763a.75.75 0 0 1-.11.835c-.191.216-.414.406-.59.555l-.126.108a2.6 2.6 0 0 0-.512.568C10.043 5.28 9.75 6.113 9.75 8A6.207 6.207 0 0 0 16 14.25c1.706 0 3.214-.624 4.37-1.78a.75.75 0 0 1 1.277.596c-.433 4.878-4.25 8.684-9.647 8.684-5.435 0-9.75-4.757-9.75-9.75 0-4.976 3.784-9.211 8.684-9.647a.75.75 0 0 1 .736.41m-2.8 1.61C5.872 5.57 3.75 8.568 3.75 12c0 4.208 3.685 8.25 8.25 8.25 3.885 0 6.76-2.276 7.782-5.466-1.128.634-2.412.966-3.782.966A7.707 7.707 0 0 1 8.25 8c0-1.736.228-2.843.62-3.627" clip-rule="evenodd"/>',"more-vertical":'<path fill="currentColor" d="M11.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M11.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M11.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>',paperclip:'<path fill="currentColor" fill-rule="evenodd" d="M10.855 3.784c.874-.983 2.19-1.434 3.445-1.434 1.295 0 2.487.477 3.43 1.42a4.75 4.75 0 0 1 1.42 3.43 4.75 4.75 0 0 1-1.42 3.43l-.004.005-6.398 6.298c-.55.548-1.244.817-2.028.817-.786 0-1.48-.27-2.03-.82s-.82-1.244-.82-2.03.27-1.48.82-2.03l6.4-6.4 1.06 1.06-6.4 6.4c-.25.25-.38.556-.38.97 0 .415.13.72.38.97s.556.38.97.38.72-.13.97-.38l.004-.004 6.398-6.298A3.26 3.26 0 0 0 17.65 7.2c0-.905-.323-1.713-.98-2.37a3.26 3.26 0 0 0-2.37-.98c-.936 0-1.81.342-2.336.944l-.018.021-6.418 6.317C4.475 12.187 3.95 13.493 3.95 15c0 1.476.603 2.797 1.592 3.881a5.46 5.46 0 0 0 3.858 1.57c1.415 0 2.82-.531 3.87-1.581l.003-.004 7.6-7.5 1.054 1.068-7.597 7.496q0 .002-.002.002A6.96 6.96 0 0 1 9.4 21.95c-1.786 0-3.58-.67-4.93-2.02l-.012-.011-.01-.012C3.242 18.593 2.45 16.919 2.45 15c0-1.892.674-3.585 2.02-4.93l.004-.004z" clip-rule="evenodd"/>',pause:'<path fill="currentColor" fill-rule="evenodd" d="M8 6.75h2.5v10.5H8zm5.5 0H16v10.5h-2.5z" clip-rule="evenodd"/>',play:'<path fill="currentColor" fill-rule="evenodd" d="M9.5 7.21v9.58l7.5-4.79z" clip-rule="evenodd"/>',plus:'<path fill="currentColor" fill-rule="evenodd" d="M11.25 11.25v-7h1.5v7h7v1.5h-7v7h-1.5v-7h-7v-1.5z" clip-rule="evenodd"/>',copy:'<path fill="currentColor" fill-rule="evenodd" d="M8 3.75a.25.25 0 0 0-.25.25v12c0 .138.112.25.25.25h12a.25.25 0 0 0 .25-.25V4a.25.25 0 0 0-.25-.25zM6.25 4c0-.966.784-1.75 1.75-1.75h12c.966 0 1.75.784 1.75 1.75v12A1.75 1.75 0 0 1 20 17.75H8A1.75 1.75 0 0 1 6.25 16z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M3.75 9v9A2.25 2.25 0 0 0 6 20.25h9v1.5H6A3.75 3.75 0 0 1 2.25 18V9z" clip-rule="evenodd"/>',code:'<path fill="currentColor" fill-rule="evenodd" d="m6.47 7.47 1.06 1.06L4.06 12l3.47 3.47-1.06 1.06L1.94 12zM19.94 12l-3.47-3.47 1.06-1.06L22.06 12l-4.53 4.53-1.06-1.06zM8.31 18.705l6-14 1.38.59-6 14z" clip-rule="evenodd"/>',write:'<path fill="currentColor" fill-rule="evenodd" d="M3.056 6.056A2.75 2.75 0 0 1 5 5.25h3v1.5H5A1.25 1.25 0 0 0 3.75 8v11A1.25 1.25 0 0 0 5 20.25h11A1.25 1.25 0 0 0 17.25 19v-3h1.5v3A2.75 2.75 0 0 1 16 21.75H5A2.75 2.75 0 0 1 2.25 19V8c0-.73.29-1.429.806-1.944" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M16.885 3.084a2.85 2.85 0 0 1 4.03 4.03l-9.604 9.636H7.25v-4.061zm2.015.666a1.35 1.35 0 0 0-.955.395L8.75 13.311v1.939h1.939l9.166-9.195A1.35 1.35 0 0 0 18.9 3.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m18.47 8.53-3-3 1.06-1.06 3 3z" clip-rule="evenodd"/>',upload:'<path fill="currentColor" d="m12 2.94 5.53 5.53-1.06 1.06-3.72-3.72V17h-1.5V5.81L7.53 9.53 6.47 8.47z"/><path fill="currentColor" d="M2.25 15h1.5v4.25h16.5V15h1.5v5.75H2.25z"/>',video:'<path fill="currentColor" fill-rule="evenodd" d="M21.37 6.347a.75.75 0 0 1 .38.653v10a.75.75 0 0 1-1.136.643l-5-3a.75.75 0 1 1 .772-1.286l3.864 2.318v-7.35l-3.864 2.318a.75.75 0 1 1-.772-1.286l5-3a.75.75 0 0 1 .755-.01" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.25 6A.75.75 0 0 1 3 5.25h13a.75.75 0 0 1 .75.75v12a.75.75 0 0 1-.75.75H3a.75.75 0 0 1-.75-.75zm1.5.75v10.5h11.5V6.75z" clip-rule="evenodd"/>',"volume-up":'<path fill="currentColor" fill-rule="evenodd" d="M12.325 4.324A.75.75 0 0 1 12.75 5v14a.75.75 0 0 1-1.219.586L6.738 15.75H3a.75.75 0 0 1-.75-.75V9A.75.75 0 0 1 3 8.25h3.737l4.794-3.836a.75.75 0 0 1 .794-.09M11.25 6.56 7.469 9.586A.75.75 0 0 1 7 9.75H3.75v4.5H7a.75.75 0 0 1 .469.164l3.781 3.025zM17.57 4.37a.75.75 0 0 1 1.06 0c2.046 2.046 3.12 4.739 3.12 7.63 0 2.908-1.185 5.589-3.105 7.616a.75.75 0 1 1-1.09-1.032c1.68-1.773 2.695-4.092 2.695-6.584 0-2.508-.926-4.815-2.68-6.57a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M14.97 7.97a.75.75 0 0 1 1.06 0c1.025 1.025 1.72 2.51 1.72 4.03 0 1.485-.571 2.998-1.748 4.058a.75.75 0 1 1-1.004-1.115c.823-.741 1.252-1.828 1.252-2.943 0-1.08-.505-2.195-1.28-2.97a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/>',"mute-filled":'<path fill="currentColor" d="M12.3 4.1h.1c-.3-.2-.8 0-1.1.1L6.6 8H3c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h3.6l4.7 3.8c.2.1.4.2.6.2h.4c.3-.2.6-.5.6-.9V5q0-.6-.6-.9M21.9 9.7l-1.4-1.4-2.3 2.3-2.3-2.3-1.4 1.4 2.3 2.3-2.3 2.3 1.4 1.4 2.3-2.3 2.3 2.3 1.4-1.4-2.3-2.3z"/>',package:'<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M12 1.14 21.65 6.56v9.78L12 21.76 2.35 16.44V6.56zm-8.15 6.3v8.12L12 20.04l7.8-4.48V7.44L12 2.86z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M21.27 7.75 12.37 12.75l-.74-1.31 8.9-5z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M11.25 21v-8.9h1.5V21z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M3.47 6.35 12.37 11.45l-.75 1.3-8.9-5.1z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M7.23 8.85 16.13 3.85l.74 1.3-8.9 5z"/>',"delivery-filled":'<path fill="currentColor" d="M22.68 11.13 21.45 8.66A2.25 2.25 0 0 0 18.76 7H18a3 3 0 0 0-3-3H4a3 3 0 0 0-3 3v9c0 .87.39 1.67 1.02 2.23.14 1.54 1.43 2.77 3 2.77 1.3 0 2.4-.84 2.82-2h6.37c.42 1.16 1.52 2 2.82 2 1.65 0 3-1.35 3-3h1c1.1 0 2-.9 2-2v-3.53c0-.46-.11-.92-.32-1.34M5 19c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m12 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m4-3h-1.78c-.33-.37-.75-.65-1.22-.82V9h.76c.38 0 .73.21.9.55l1.24 2.47c.07.14.1.3.1.47z"/>',repeat:'<path fill="currentColor" fill-rule="evenodd" d="m18.94 6-3.47-3.47 1.06-1.06L21.06 6l-4.53 4.53-1.06-1.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M5.532 7.433c.587-.488 1.3-.783 1.968-.783h12.4v-1.5H7.5c-1.116 0-2.183.49-2.988 1.18l-.044.038-.037.044C3.757 7.197 3.25 8.164 3.25 9.3V11h1.5V9.3c0-.648.279-1.267.782-1.867M5.06 18l3.47-3.47-1.06-1.06L2.94 18l4.53 4.53 1.06-1.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M19.25 14.7V13h1.5v1.7c0 1.136-.508 2.103-1.18 2.888l-.038.044-.044.037c-.805.69-1.872 1.181-2.988 1.181H4v-1.5h12.5c.668 0 1.381-.295 1.968-.783.503-.6.782-1.22.782-1.867" clip-rule="evenodd"/>',settings:'<path fill="currentColor" fill-rule="evenodd" d="M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0M12 9.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M9.757 1.888a.75.75 0 0 1 .742-.639h3a.75.75 0 0 1 .742.639l.425 2.836q.303.11.594.244l2.304-1.703a.75.75 0 0 1 .976.073l2.121 2.12a.75.75 0 0 1 .073.977l-1.702 2.304q.134.291.244.594l2.835.425a.75.75 0 0 1 .639.742v3a.75.75 0 0 1-.639.742l-2.836.425q-.11.303-.243.594l1.702 2.304a.75.75 0 0 1-.073.976l-2.12 2.121a.75.75 0 0 1-.977.073l-2.304-1.702q-.291.134-.594.244l-.425 2.835a.75.75 0 0 1-.742.639h-3a.75.75 0 0 1-.742-.639l-.425-2.836a8 8 0 0 1-.594-.244l-2.304 1.703a.75.75 0 0 1-.976-.073l-2.121-2.12a.75.75 0 0 1-.073-.977l1.702-2.304a8 8 0 0 1-.244-.594l-2.835-.425a.75.75 0 0 1-.639-.742v-3a.75.75 0 0 1 .639-.742l2.836-.425q.11-.303.244-.594L3.264 6.435a.75.75 0 0 1 .073-.976l2.12-2.121a.75.75 0 0 1 .977-.073l2.304 1.702q.291-.134.594-.244zm1.388.861-.398 2.653a.75.75 0 0 1-.53.608 6 6 0 0 0-1.197.493.75.75 0 0 1-.804-.056L6.062 4.855 4.854 6.063l1.592 2.154a.75.75 0 0 1 .056.804 6.2 6.2 0 0 0-.493 1.2.75.75 0 0 1-.608.527l-2.653.398v1.708l2.653.398a.75.75 0 0 1 .608.53q.188.634.493 1.197a.75.75 0 0 1-.056.804l-1.592 2.154 1.208 1.208 2.154-1.592a.75.75 0 0 1 .804-.056q.562.304 1.2.493a.75.75 0 0 1 .527.608l.398 2.653h1.708l.398-2.653a.75.75 0 0 1 .53-.608q.634-.188 1.197-.493a.75.75 0 0 1 .804.056l2.154 1.592 1.208-1.208-1.592-2.154a.75.75 0 0 1-.056-.804q.304-.562.493-1.2a.75.75 0 0 1 .608-.527l2.653-.398v-1.708l-2.653-.398a.75.75 0 0 1-.608-.53 6 6 0 0 0-.493-1.197.75.75 0 0 1 .056-.804l1.592-2.154-1.208-1.208-2.154 1.592a.75.75 0 0 1-.804.056 6.2 6.2 0 0 0-1.2-.493.75.75 0 0 1-.527-.608l-.398-2.653z" clip-rule="evenodd"/>',refresh:'<path fill="currentColor" fill-rule="evenodd" d="M20.25 8.25V3h1.5v6.75H16v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75A8.25 8.25 0 0 0 3.75 12 8.25 8.25 0 0 0 12 20.25 8.25 8.25 0 0 0 20.25 12h1.5A9.75 9.75 0 0 1 12 21.75 9.75 9.75 0 0 1 2.25 12 9.75 9.75 0 0 1 12 2.25a9.75 9.75 0 0 1 8.628 5.205l.094.106.324.361.011.012.462.517a3 3 0 0 1 .098.123c.007.01.03.044.054.09l-1.342.671a.586.586 0 0 0 .068.11l.009.012-.021-.025q-.037-.043-.107-.12l-.335-.373-.013-.015-.494-.554-.05-.065a1 1 0 0 1-.05-.084l-.002-.004A8.25 8.25 0 0 0 12 3.75" clip-rule="evenodd"/>',expand:'<path fill="currentColor" fill-rule="evenodd" d="M17.25 6.75H12v-1.5h6.75V12h-1.5zM6.75 17.25V12h-1.5v6.75H12v-1.5z" clip-rule="evenodd"/>',shrink:'<path fill="currentColor" fill-rule="evenodd" d="M9.25 14.75H4v-1.5h6.75V20h-1.5zM13.75 10.25V5h-1.5v6.75H19v-1.5z" clip-rule="evenodd"/>',"grip-vertical":'<path fill="currentColor" d="M9.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>',"grip-horizontal":'<path fill="currentColor" d="M8 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M13.5 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M19 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M8 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M13.5 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M19 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"/>',search:'<path fill="currentColor" fill-rule="evenodd" d="M2.25 11c0-4.814 3.936-8.75 8.75-8.75s8.75 3.936 8.75 8.75-3.936 8.75-8.75 8.75S2.25 15.814 2.25 11M11 3.75c-3.986 0-7.25 3.264-7.25 7.25s3.264 7.25 7.25 7.25 7.25-3.264 7.25-7.25S14.986 3.75 11 3.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m17.13 16.07 4.4 4.4-1.06 1.06-4.4-4.4z" clip-rule="evenodd"/>',send:'<path fill="currentColor" fill-rule="evenodd" d="M1.298 4.736A.75.75 0 0 1 2 4.25h20a.75.75 0 0 1 .646 1.13l-10 17a.75.75 0 0 1-1.382-.233l-1.95-9.75-7.808-6.833a.75.75 0 0 1-.208-.828M3.996 5.75l6.498 5.686a.75.75 0 0 1 .241.417l1.615 8.073L20.689 5.75z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m22.378 5.648-12 7-.756-1.296 12-7z" clip-rule="evenodd"/>',"share-alt":'<path fill="currentColor" fill-rule="evenodd" d="M13.69 3.317a.75.75 0 0 1 .804.119l8 7a.75.75 0 0 1 0 1.128l-8 7A.75.75 0 0 1 13.25 18v-3.24c-1.925.051-3.579.315-5.062.932-1.659.692-3.157 1.85-4.588 3.758A.75.75 0 0 1 2.25 19c0-4.145 1.147-6.888 3.291-8.698 1.96-1.655 4.655-2.437 7.709-2.943V4a.75.75 0 0 1 .44-.683m1.06 2.336V8a.75.75 0 0 1-.638.742c-3.283.497-5.85 1.225-7.603 2.706-1.359 1.147-2.303 2.812-2.631 5.39 1.153-1.15 2.386-1.969 3.734-2.53 1.928-.804 4.04-1.058 6.388-1.058a.75.75 0 0 1 .75.75v2.347L20.861 11z" clip-rule="evenodd"/>',show:'<path fill="currentColor" fill-rule="evenodd" d="M8.25 12c0-2.055 1.695-3.75 3.75-3.75s3.75 1.694 3.75 3.75-1.694 3.75-3.75 3.75S8.25 14.056 8.25 12M12 9.75A2.27 2.27 0 0 0 9.75 12 2.27 2.27 0 0 0 12 14.25 2.27 2.27 0 0 0 14.25 12 2.27 2.27 0 0 0 12 9.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.833 12c.791 1.543 3.297 5.25 9.167 5.25 5.872 0 8.374-3.704 9.167-5.25-.791-1.543-3.297-5.25-9.167-5.25-5.871 0-8.374 3.704-9.167 5.25m-1.515-.312C2.006 10.183 4.823 5.25 12 5.25s9.997 4.938 10.682 6.438l.143.312-.143.312C21.994 13.817 19.177 18.75 12 18.75s-9.997-4.938-10.682-6.438L1.175 12z" clip-rule="evenodd"/>',sparkle:'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25 14.08 8 19.75 10l-5.67 2L12 17.75 9.92 12 4.25 10l5.67-2zm0 4.4-.9 2.49-2.45.86 2.45.86.9 2.49.9-2.49 2.45-.86-2.45-.86zM18.5 15.25l.88 2.37 2.37.88-2.37.88-.88 2.37-.88-2.37-2.37-.88 2.37-.88z" clip-rule="evenodd"/>',stop:'<path fill="currentColor" fill-rule="evenodd" d="M3.25 6A2.756 2.756 0 0 1 6 3.25h12A2.756 2.756 0 0 1 20.75 6v12A2.756 2.756 0 0 1 18 20.75H6A2.756 2.756 0 0 1 3.25 18zM6 4.75c-.686 0-1.25.564-1.25 1.25v12c0 .686.564 1.25 1.25 1.25h12c.686 0 1.25-.564 1.25-1.25V6c0-.686-.564-1.25-1.25-1.25z" clip-rule="evenodd"/>',sun:'<path fill="currentColor" fill-rule="evenodd" d="M12 7.75a4.25 4.25 0 1 0 0 8.5 4.25 4.25 0 0 0 0-8.5M6.25 12a5.75 5.75 0 1 1 11.5 0 5.75 5.75 0 0 1-11.5 0" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 5V2h1.5v3zm0 17v-3h1.5v3zm5.12-15.43 2.2-2.2 1.06 1.06-2.2 2.2zm-12.48 12.48 2.2-2.2 1.06 1.06-2.2 2.2zM19 11.25h3v1.5h-3zM2 11.25h3v1.5H2zm14.43 5.12 2.2 2.2-1.06 1.06-2.2-2.2zM4.37 6.57 6.57 4.37l1.06 1.06-2.2 2.2z" clip-rule="evenodd"/>',"thumb-down":'<path fill="currentColor" fill-rule="evenodd" d="M6.74 4.75a2.25 2.25 0 0 0-2.241 2.046l-.554 6.09A1.25 1.25 0 0 0 5.19 14.25H9a.75.75 0 0 1 .75.75v4c0 1.339 1.297 2.892 3.5 2.428V15a.75.75 0 0 1 .75-.75h1.25V7c0-.77-.235-1.314-.586-1.664-.35-.35-.895-.586-1.664-.586zm8.518-.861C14.632 3.46 13.855 3.25 13 3.25H6.74a3.75 3.75 0 0 0-3.735 3.41l-.554 6.091A2.75 2.75 0 0 0 5.19 15.75h3.06V19c0 2.462 2.501 4.874 5.987 3.712A.75.75 0 0 0 14.75 22v-6.25H21a.75.75 0 0 0 .75-.75V4a.75.75 0 0 0-.75-.75h-5a.75.75 0 0 0-.742.639m1.492.861v9.5h3.5v-9.5z" clip-rule="evenodd"/>',"thumb-up":'<path fill="currentColor" fill-rule="evenodd" d="M10.75 2.572V9a.75.75 0 0 1-.75.75H8.75V17c0 .77.235 1.314.586 1.664.35.35.895.586 1.664.586h6.26a2.25 2.25 0 0 0 2.241-2.046l.554-6.09A1.25 1.25 0 0 0 18.81 9.75H15a.75.75 0 0 1-.75-.75V5c0-1.339-1.296-2.891-3.5-2.428M7.25 19.25v-9.5h-3.5v9.5zM3 8.25a.75.75 0 0 0-.75.75v11c0 .414.336.75.75.75h5a.75.75 0 0 0 .742-.639c.627.428 1.403.639 2.258.639h6.26a3.75 3.75 0 0 0 3.735-3.41l.554-6.091A2.75 2.75 0 0 0 18.81 8.25h-3.06V5c0-2.462-2.501-4.874-5.987-3.712A.75.75 0 0 0 9.25 2v6.25z" clip-rule="evenodd"/>',trash:'<path fill="currentColor" fill-rule="evenodd" d="M6.75 6v13c0 .69.56 1.25 1.25 1.25h8c.69 0 1.25-.56 1.25-1.25V6h1.5v13A2.75 2.75 0 0 1 16 21.75H8A2.75 2.75 0 0 1 5.25 19V6z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M21 6.75H3v-1.5h18z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M7.25 4c0-.966.784-1.75 1.75-1.75h6c.966 0 1.75.784 1.75 1.75v2h-1.5V4a.25.25 0 0 0-.25-.25H9a.25.25 0 0 0-.25.25v2h-1.5zM9.25 16V9h1.5v7zM13.25 16V9h1.5v7z" clip-rule="evenodd"/>',user:'<path fill="currentColor" fill-rule="evenodd" d="M8.652 3.687C9.52 2.708 10.833 2.25 12 2.25c1.198 0 2.38.478 3.313 1.402.979.868 1.437 2.181 1.437 3.348 0 1.198-.477 2.38-1.402 3.313-.868.979-2.181 1.437-3.348 1.437-1.198 0-2.38-.477-3.313-1.402C7.715 9.488 7.25 8.277 7.25 7c0-1.198.478-2.38 1.402-3.313M12 3.75c-.826 0-1.703.336-2.236.944l-.016.019-.018.017c-.664.664-.98 1.475-.98 2.27 0 .915.329 1.697.944 2.236l.019.016.017.018c.664.664 1.475.98 2.27.98.826 0 1.703-.336 2.236-.944l.016-.019.018-.017c.664-.664.98-1.475.98-2.27 0-.826-.336-1.703-.944-2.236l-.019-.016-.017-.018c-.664-.664-1.475-.98-2.27-.98M8 15.75c-.795 0-1.606.317-2.27.98l-.017.018-.02.016c-.614.539-.943 1.321-.943 2.236v3h-1.5v-3c0-1.277.465-2.487 1.437-3.348.934-.925 2.115-1.402 3.313-1.402h8c1.277 0 2.487.465 3.348 1.437.925.934 1.402 2.115 1.402 3.313v3h-1.5v-3c0-.795-.317-1.606-.98-2.27l-.018-.017-.016-.02c-.539-.614-1.321-.943-2.236-.943z" clip-rule="evenodd"/>',"warning-filled":'<path fill="currentColor" fill-rule="evenodd" d="M10.34 3.78a1.9 1.9 0 0 1 3.32 0l8.06 14.5A1.9 1.9 0 0 1 20.06 21H3.94a1.9 1.9 0 0 1-1.66-2.72zm.91 5.47h1.5v5.5h-1.5zm0 7h1.5v1.5h-1.5z" clip-rule="evenodd"/>'};function isDbIconName(t){return Object.prototype.hasOwnProperty.call(e,t)}function getDbComponentIconSize(e){return"s"===e?12:"l"===e?20:16}function createDbIcon(t,s=16){const i=e[t]??e.sparkle,n=document.createElement("template");return n.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" width="${s}" height="${s}" aria-hidden="true" focusable="false" data-designbase-icon="${t}">${i}</svg>`,n.content.firstElementChild}class DbAccordion extends HTMLElement{constructor(){super(...arguments),this.expanded=new Set,this.isRendering=!1,this.suppressExpandedAttrCallback=!1}static get observedAttributes(){return["items","variant","size","allow-multiple","expand-mode","expanded-items","default-item-type"]}get items(){try{const e=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}get allowMultiple(){return this.hasAttribute("allow-multiple")}set allowMultiple(e){this.toggleAttribute("allow-multiple",e)}get expandedItems(){const e=(this.getAttribute("expanded-items")||"").trim();if(!e)return[];if("all"===e)return this.items.map((e,t)=>this.resolveItemKey(e,t));try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(e=>String(e).trim()).filter(Boolean)}catch{}return e.split(",").map(e=>e.trim()).filter(Boolean)}set expandedItems(e){Array.isArray(e)?this.setAttribute("expanded-items",e.join(",")):this.setAttribute("expanded-items",e)}connectedCallback(){this.syncExpandedFromAttributes(),this.render(),this.childObserver=new MutationObserver(e=>{this.isRendering||e.some(e=>Array.from(e.addedNodes).some(e=>e instanceof HTMLElement&&e.hasAttribute("slot")))&&this.render()}),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){this.childObserver?.disconnect()}attributeChangedCallback(e){if(this.isConnected){if("expanded-items"===e){if(this.suppressExpandedAttrCallback)return;return this.syncExpandedFromAttributes(),void this.syncExpandedState()}return"expand-mode"===e||"allow-multiple"===e?(this.syncExpandedFromAttributes(),void this.syncExpandedState()):"items"===e?(this.syncExpandedFromAttributes(),void this.render()):void this.render()}}resolveItemKey(e,t){return e.id??String(t)}getExpandMode(){const e=this.getAttribute("expand-mode");return"single"===e||"multiple"===e||"all"===e?e:(this.hasAttribute("allow-multiple"),"multiple")}syncExpandedFromAttributes(){const e=this.items.map((e,t)=>this.resolveItemKey(e,t)),t=this.expandedItems,s=this.getExpandMode();t.length>0?this.expanded=new Set(t.filter(t=>e.includes(t))):this.expanded="all"!==s?new Set:new Set(e)}iconSize(e){return"s"===e?16:"l"===e?24:20}collectPanelContent(){const e=new Map,register=(t,s)=>{if(!(t instanceof HTMLElement)||"SLOT"===t.tagName)return;e.has(s)||e.set(s,[]);const i=e.get(s);i.includes(t)||i.push(t)};return Array.from(this.children).forEach(e=>{const t=e.getAttribute("slot")?.match(/^content-(\d+)$/);t&®ister(e,Number(t[1]))}),this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach((e,t)=>{const s=e.querySelector(":scope > .designbase-wc-accordion__content > .designbase-wc-accordion__content-inner");s&&Array.from(s.children).forEach(e=>register(e,t))}),e}isItemExpanded(e,t){return this.expanded.has(this.resolveItemKey(e,t))}syncExpandedState(){const e=this.items;this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach((t,s)=>{const i=e[s];if(!i)return;const n=this.isItemExpanded(i,s);t.classList.toggle("designbase-wc-accordion__item--expanded",n),t.classList.toggle("designbase-wc-accordion__item--disabled",Boolean(i.disabled));const a=t.querySelector(".designbase-wc-accordion__trigger"),r=t.querySelector(".designbase-wc-accordion__content");a?.setAttribute("aria-expanded",String(n)),r?.setAttribute("aria-hidden",String(!n))})}render(){this.isRendering=!0;const e=this.collectPanelContent(),t=this.getAttribute("variant")||"default",s=this.getAttribute("size")||"m",i=this.getExpandMode(),n=this.getAttribute("default-item-type")||"none",a=this.items,r=this.iconSize(s);this.className=["designbase-wc-accordion",`designbase-wc-accordion--${t}`,`designbase-wc-accordion--${s}`,"multiple"===i&&"designbase-wc-accordion--multiple","single"===i&&"designbase-wc-accordion--single","all"===i&&"designbase-wc-accordion--all"].filter(Boolean).join(" "),this.setAttribute("role","region"),this.setAttribute("aria-label","아코디언"),this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach(e=>e.remove()),a.forEach((s,i)=>{const a=this.resolveItemKey(s,i),o=this.isItemExpanded(s,i),l=document.createElement("div");l.className=["designbase-wc-accordion__item",`designbase-wc-accordion__item--${t}`,o&&"designbase-wc-accordion__item--expanded",s.disabled&&"designbase-wc-accordion__item--disabled"].filter(Boolean).join(" "),l.dataset.itemKey=a;const d=document.createElement("button");d.type="button",d.className="designbase-wc-accordion__trigger",d.disabled=Boolean(s.disabled),d.setAttribute("aria-expanded",String(o)),d.setAttribute("aria-controls",`accordion-content-${a}`),d.addEventListener("click",()=>{s.disabled||this.toggle(a)});const h=s.itemType||n;if("number"===h){const e=document.createElement("div");e.className="designbase-wc-accordion__number",e.textContent=`${i+1}.`,d.append(e)}else if("question"===h){const e=document.createElement("div");e.className="designbase-wc-accordion__question",e.textContent="Q.",d.append(e)}else if("icon"===h&&s.icon){const e=document.createElement("div");e.className="designbase-wc-accordion__icon",e.append(createDbIcon(s.icon,r)),d.append(e)}const u=document.createElement("span");u.className="designbase-wc-accordion__title",u.textContent=s.title;const b=document.createElement("div");b.className="designbase-wc-accordion__chevron",b.append(createDbIcon("chevron-down",r)),d.append(u,b);const p=document.createElement("div");p.id=`accordion-content-${a}`,p.className="designbase-wc-accordion__content",p.setAttribute("aria-hidden",String(!o));const m=document.createElement("div");m.className="designbase-wc-accordion__content-inner";const g=e.get(i)||[];if(g.length>0)g.forEach(e=>{e.removeAttribute("slot"),m.append(e)});else if(s.content){const e=document.createElement("p");e.className="designbase-wc-accordion__content-text",e.textContent=s.content,m.append(e)}p.append(m),l.append(d,p),this.append(l)}),this.isRendering=!1}toggle(e){const t=this.getExpandMode();this.expanded.has(e)?this.expanded.delete(e):"single"===t?this.expanded=new Set([e]):this.expanded.add(e);const s=Array.from(this.expanded);this.syncExpandedState(),this.suppressExpandedAttrCallback=!0,this.expandedItems=s,this.suppressExpandedAttrCallback=!1,this.dispatchEvent(new CustomEvent("db-change",{detail:{expandedItems:s},bubbles:!0,composed:!0}))}}customElements.get("db-accordion")||customElements.define("db-accordion",DbAccordion);const t="designbase-wp-admin__shell",s="(max-width: 782px)";let i=0;function isElement(e){return e.nodeType===Node.ELEMENT_NODE}function isTag(e,t){return isElement(e)&&e.tagName.toLowerCase()===t}function isMeaningfulNode(e){return e.nodeType!==Node.TEXT_NODE||Boolean(e.textContent?.trim())}function parseJson(e,t){if(!e)return t;try{return JSON.parse(e)}catch{return t}}function stringify(e){try{return JSON.stringify(e??[])}catch{return"[]"}}class DbAdminShell extends HTMLElement{constructor(){super(...arguments),this.originalChildren=null,this.mediaQuery=null,this.mediaHandler=null,this.sidebarOpen=!1,this.toggleButton=null}static get observedAttributes(){return["title","brand","items","sections","sidebar-size","brand-size","sidebar-id","sidebar-aria-label","menu-label","close-label","content-size","content-padding","page-title","page-description","page-subtitle","page-variant","show-menu-button","default-sidebar-open"]}connectedCallback(){this.captureOriginalChildren(),this.render(),this.bindViewport()}disconnectedCallback(){this.mediaQuery&&this.mediaHandler&&(this.mediaQuery.removeEventListener?this.mediaQuery.removeEventListener("change",this.mediaHandler):this.mediaQuery.removeListener(this.mediaHandler)),this.mediaQuery=null,this.mediaHandler=null,this.toggleButton=null}attributeChangedCallback(){this.isConnected&&this.render()}captureOriginalChildren(){this.originalChildren||(this.originalChildren=Array.from(this.childNodes))}getOriginalElements(){return(this.originalChildren??[]).filter(isElement)}getBrandLabel(){return(this.getAttribute("brand")||this.getAttribute("title")||"").trim()}getSidebarItems(){return parseJson(this.getAttribute("items"),[])}getSidebarSections(){return parseJson(this.getAttribute("sections"),[])}resolveSidebarNav(){const e=this.getBrandLabel(),t=this.getSidebarItems(),s=this.getSidebarSections();return Array.isArray(s)&&0!==s.length?1!==s.length||s[0].title&&s[0].title!==e?{items:null,sections:s}:{items:s[0].items?.length?s[0].items:t,sections:null}:{items:t,sections:null}}createBrand(e){const t=this.getBrandLabel()||"관리자",s=document.createElement("div");return s.className="designbase-wp-admin__shell-brand",s.setAttribute("role","heading"),s.setAttribute("aria-level","2"),s.setAttribute("aria-label",t),s.dataset.dbwpShellBrand="",e.removeAttribute("slot"),s.append(e),s}createSidebar(e,t=!1){const s=e||document.createElement("db-sidebar"),i=this.getBrandLabel()||"관리자";if(s.setAttribute("size",this.getAttribute("sidebar-size")||"m"),s.setAttribute("collapsible","false"),s.setAttribute("full-height",""),s.setAttribute("aria-label",this.getAttribute("sidebar-aria-label")||`${i} 메뉴`),e)return s;i&&!t?(s.setAttribute("show-logo",""),s.setAttribute("logo-type","custom"),s.setAttribute("logo-text",i)):(s.setAttribute("show-logo","false"),s.removeAttribute("logo-type"),s.removeAttribute("logo-text"));const n=this.resolveSidebarNav();return n.sections?s.setAttribute("sections",stringify(n.sections)):(s.removeAttribute("sections"),s.setAttribute("items",stringify(n.items??[]))),s}createPageHeader(){const e=this.getAttribute("page-title");if(!e)return null;const t=document.createElement("db-page-header");t.setAttribute("title",e);const s=this.getAttribute("page-description"),i=this.getAttribute("page-subtitle"),n=this.getAttribute("page-variant");return s&&t.setAttribute("description",s),i&&t.setAttribute("subtitle",i),n&&t.setAttribute("variant",n),t}addHeaderToggle(e,t){if(!e||this.hasAttribute("show-menu-button")&&"false"===this.getAttribute("show-menu-button"))return;if(e.querySelector("[data-dbwp-shell-menu]"))return;let s=Array.from(e.children).find(e=>"meta"===e.getAttribute("slot"));s||(s=document.createElement("span"),s.setAttribute("slot","meta"),s.className="designbase-wp-admin__page-header-meta",e.append(s));const i=document.createElement("db-button");i.setAttribute("variant","tertiary"),i.setAttribute("size","s"),i.setAttribute("icon-only",""),i.setAttribute("start-icon","menu"),i.setAttribute("aria-controls",t),i.setAttribute("aria-label",this.getAttribute("menu-label")||"메뉴 열기"),i.setAttribute("aria-expanded","false"),i.dataset.dbwpShellMenu="",s.prepend(i),this.toggleButton=i,i.addEventListener("db-click",()=>this.setSidebarOpen(!this.sidebarOpen))}render(){this.captureOriginalChildren();const e=this.originalChildren??[],s=this.getOriginalElements(),n=s.find(e=>"sidebar"===e.getAttribute("slot")&&isTag(e,"db-sidebar")),a=s.find(e=>"brand"===e.getAttribute("slot")),r=s.find(e=>isTag(e,"db-page-header")),o=r||this.createPageHeader(),l=new Set([n,a,r].filter(Boolean)),d=e.filter(e=>!l.has(e)).filter(isMeaningfulNode);this.classList.add(t,`${t}--has-sidebar`),this.replaceChildren();const h=document.createElement("button");h.type="button",h.className=`${t}-backdrop`,h.setAttribute("aria-label",this.getAttribute("close-label")||"메뉴 닫기"),h.addEventListener("click",()=>this.setSidebarOpen(!1));const u=document.createElement("div");u.className=`${t}-sidebar`,u.setAttribute("aria-label",this.getAttribute("sidebar-aria-label")||this.getAttribute("title")||"관리자 메뉴");const b=this.getAttribute("sidebar-id")||(this.id?`${this.id}-sidebar`:"designbase-wp-admin-sidebar-"+ ++i);u.id=b,n&&n.removeAttribute("slot"),a&&u.append(this.createBrand(a)),u.append(this.createSidebar(n,Boolean(a)));const p=document.createElement("main");if(p.className=`${t}-main`,o&&(o.removeAttribute("slot"),p.append(o)),this.addHeaderToggle(o,b),d.length){const e=1===d.length&&isTag(d[0],"db-container")?d[0]:null,t=e||document.createElement("db-container");t.setAttribute("size",this.getAttribute("content-size")||"full"),t.setAttribute("padding",this.getAttribute("content-padding")||"l"),t.setAttribute("full-width",""),t.dataset.dbwpContentContainer="",e||t.append(...d),p.append(t)}this.append(h,u,p),this.setSidebarOpen(this.getInitialSidebarOpen())}getInitialSidebarOpen(){return this.hasAttribute("default-sidebar-open")?"false"!==this.getAttribute("default-sidebar-open"):!window.matchMedia?.(s).matches}setSidebarOpen(e){this.sidebarOpen=Boolean(e),this.classList.toggle("designbase-wp-admin__shell--sidebar-open",this.sidebarOpen),this.classList.toggle(`${t}--sidebar-collapsed`,!this.sidebarOpen),this.toggleButton&&(this.toggleButton.setAttribute("aria-expanded",String(this.sidebarOpen)),this.toggleButton.setAttribute("aria-label",this.sidebarOpen?this.getAttribute("close-label")||"메뉴 닫기":this.getAttribute("menu-label")||"메뉴 열기"))}bindViewport(){window.matchMedia&&(this.mediaQuery=window.matchMedia(s),this.mediaHandler=e=>this.setSidebarOpen(!e.matches),this.mediaQuery.addEventListener?this.mediaQuery.addEventListener("change",this.mediaHandler):this.mediaQuery.addListener(this.mediaHandler))}}customElements.get("db-admin-shell")||customElements.define("db-admin-shell",DbAdminShell);const n=["plasma","mesh-flow","fluid","radiant","ethereal"];function toLuminaSpeed(e){return Math.max(.1,e/3e3)}function toSpeedRate(e){return Math.max(.1,e/3e3)}function hexToRgb(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16)/255,parseInt(t[2],16)/255,parseInt(t[3],16)/255]:[0,0,0]}function padColors(e,t=5){return 0===e.length?["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"]:Array.from({length:t},(t,s)=>e[s%e.length])}const a=["#0d0221","#5b21b6","#db2777","#38bdf8","#e9d5ff"],r="data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E",o=[{id:"neon_dream",name:"Neon Dream",colors:["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"]},{id:"sunset_bliss",name:"Sunset Bliss",colors:["#FF9900","#FF00CC","#6600FF","#FF5500","#220055"]},{id:"deep_ocean",name:"Deep Ocean",colors:["#001133","#0044FF","#00DDFF","#00FFAA","#000066"]},{id:"forest_mist",name:"Forest Mist",colors:["#002200","#00FF44","#AAFF00","#006622","#CCFFCC"]},{id:"northern_lights",name:"Northern Lights",colors:["#000000","#00FF99","#AA00FF","#0044FF","#FFFFFF"]},{id:"monochrome_fog",name:"Monochrome Fog",colors:["#000000","#333333","#888888","#CCCCCC","#FFFFFF"]},{id:"cotton_candy",name:"Cotton Candy",colors:["#FFC0CB","#87CEFA","#E0FFFF","#DDA0DD","#FF69B4"]},{id:"cyber_glitch",name:"Cyber Glitch",colors:["#1A1A1D","#C3073F","#6F2232","#950740","#4E4E50"]},{id:"golden_hour",name:"Golden Hour",colors:["#FF4E50","#FC913A","#F9D423","#EDE574","#E1F5C4"]}];const l={graphite:{id:"graphite",colors:["#000000","#333333","#b3b3b3"],scale:1},abyss:{id:"abyss",colors:["#020617","#0f172a","#3b82f6"],scale:2.2},cherry:{id:"cherry",colors:["#1a0505","#4a0b1c","#e11d48"],scale:2.8},forest:{id:"forest",colors:["#021207","#064e3b","#10b981"],scale:2},sunset:{id:"sunset",colors:["#170500","#7c2d12","#f97316"],scale:3},amethyst:{id:"amethyst",colors:["#0f051a","#3b0764","#a855f7"],scale:2.4}},d=l.graphite.colors,h=Object.keys(l);function isGraphitePresetId(e){return Boolean(e&&e in l)}function getGraphitePreset(e){return l[e]}const u=["#ffffff","#f0f9ff","#e0f2fe"],b=["#ffb7c5","#ff91a4","#f8c8dc","#ffc0cb","#fda4af"],p=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#4caf50","#ffeb3b","#ffc107","#ff9800"];function createFallingParticle(e,t,s,i=!1){return{x:Math.random()*e,y:i?Math.random()*t:-20,size:Math.random()*(s.maxSize-s.minSize)+s.minSize,speedX:(Math.random()-.5)*s.wind,speedY:Math.random()*(s.maxSpeedY-s.minSpeedY)+s.minSpeedY,opacity:.5*Math.random()+.3,rotation:Math.random()*Math.PI*2,rotationSpeed:.05*(Math.random()-.5),color:s.colors[Math.floor(Math.random()*s.colors.length)]}}const m=["snow","flowers","confetti"];class CanvasAnimationController{constructor(e,t){this.raf=0,this.frameCount=0,this.mouse={x:-9999,y:-9999},this.particlesRef={current:[]},this.starsRef={current:[]},this.fallingRef={current:[]},this.tick=()=>{const e=this.canvas.getContext("2d");if(!e)return void(this.raf=requestAnimationFrame(this.tick));const t=window.devicePixelRatio||1,s=this.canvas.width/t,i=this.canvas.height/t,{type:n,colors:a,speed:r,particleCount:o,particleSize:l,starCount:d,starSize:h,clickable:u,wind:b,layerOpacity:p}=this.options;e.clearRect(0,0,s,i);const g=toSpeedRate(r),f=this.frameCount*g;switch(this.frameCount+=1,n){case"particles":((e,t,s,i,n)=>{const a=`${n.count}:${n.size}`;i.current.length===n.count&&i.spawnKey===a||(i.current=Array.from({length:n.count}).map(()=>({x:Math.random()*t,y:Math.random()*s,vx:1.5*(Math.random()-.5),vy:1.5*(Math.random()-.5),size:Math.random()*n.size+1,color:n.colors[Math.floor(Math.random()*n.colors.length)]})),i.spawnKey=a);const r=i.current,o=toSpeedRate(n.speed);r.forEach((i,a)=>{if(i.x+=i.vx*o,i.y+=i.vy*o,(i.x<0||i.x>t)&&(i.vx*=-1),(i.y<0||i.y>s)&&(i.vy*=-1),n.clickable){const e=n.mouse.x-i.x,t=n.mouse.y-i.y,s=Math.sqrt(e*e+t*t);if(s<150){const n=(150-s)/150;i.vx+=e/s*n*.5,i.vy+=t/s*n*.5}const a=3,r=Math.sqrt(i.vx*i.vx+i.vy*i.vy);r>a&&(i.vx=i.vx/r*a,i.vy=i.vy/r*a)}e.save(),e.globalAlpha=n.layerOpacity,e.beginPath(),e.arc(i.x,i.y,i.size,0,2*Math.PI),e.fillStyle=i.color,e.fill(),e.restore();for(let t=a+1;t<r.length;t++){const s=r[t],a=i.x-s.x,o=i.y-s.y,l=Math.sqrt(a*a+o*o);l<100&&(e.beginPath(),e.strokeStyle=i.color,e.globalAlpha=(1-l/100)*n.layerOpacity,e.lineWidth=.5,e.moveTo(i.x,i.y),e.lineTo(s.x,s.y),e.stroke(),e.globalAlpha=1)}})})(e,s,i,this.particlesRef,{count:o,colors:a,size:l,speed:r,mouse:this.mouse,clickable:u,layerOpacity:p});break;case"stars":((e,t,s,i,n)=>{const a=`${n.count}:${n.size}`;i.current.length===n.count&&i.spawnKey===a||(i.current=Array.from({length:n.count}).map(()=>({x:Math.random()*t,y:Math.random()*s,size:Math.random()*n.size,blinkSpeed:.05*Math.random()+.01,color:n.colors[Math.floor(Math.random()*n.colors.length)]})),i.spawnKey=a),i.current.forEach(t=>{t.y-=.05*n.speedRate,t.y<0&&(t.y=s);const i=(.5+.5*Math.sin(n.time*t.blinkSpeed))*n.layerOpacity;e.beginPath(),e.arc(t.x,t.y,t.size,0,2*Math.PI),e.fillStyle=t.color,e.globalAlpha=i,e.fill(),e.globalAlpha=1})})(e,s,i,this.starsRef,{count:d,colors:a,size:h,time:f,layerOpacity:p,speedRate:g});break;case"snow":case"flowers":case"confetti":(function isFallingType(e){return m.includes(e)})(n)&&((e,t,s,i,n,a)=>{const r=toSpeedRate(a.speed),o=Math.max(1,.5*a.size),l={minSize:o,maxSize:Math.max(o+.5,1.5*a.size),minSpeedY:.4*r,maxSpeedY:1.2*r,wind:a.wind*r,colors:a.colors},d=`${a.count}:${a.size}:${a.speed}:${a.wind}`;i.current.length===a.count&&i.spawnKey===d||(i.current=Array.from({length:a.count},()=>createFallingParticle(t,s,l,!0)),i.spawnKey=d),i.current.forEach(i=>{i.y+=i.speedY,i.x+=i.speedX+.5*Math.sin(i.y/50)*r,i.rotation+=i.rotationSpeed,i.y>s+20&&Object.assign(i,createFallingParticle(t,s,l)),i.x>t+20&&(i.x=-20),i.x<-20&&(i.x=t+20),e.save(),e.translate(i.x,i.y),e.rotate(i.rotation),e.fillStyle=i.color,e.globalAlpha=i.opacity*a.layerOpacity,function drawFallingParticleShape(e,t,s){"snow"===t?(e.beginPath(),e.arc(0,0,s,0,2*Math.PI),e.fill()):"flowers"===t?(e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(s,-s,2*s,s,0,2*s),e.bezierCurveTo(2*-s,s,-s,-s,0,0),e.fill()):e.fillRect(-s/2,-s/2,s,s)}(e,n,i.size),e.restore()}),e.globalAlpha=1})(e,s,i,this.fallingRef,n,{count:o,colors:a,size:l,speed:r,wind:b,layerOpacity:p})}this.raf=requestAnimationFrame(this.tick)},this.container=e,this.options=t,this.canvas=document.createElement("canvas"),this.canvas.className="designbase-wc-animation-background__canvas",e.appendChild(this.canvas),this.onResize=()=>this.resize(),this.onMouseMove=e=>{if("particles"!==this.options.type)return;const t=this.container.getBoundingClientRect();this.mouse={x:e.clientX-t.left,y:e.clientY-t.top}},this.onMouseLeave=()=>{this.mouse={x:-9999,y:-9999}},e.addEventListener("mousemove",this.onMouseMove),e.addEventListener("mouseleave",this.onMouseLeave),window.addEventListener("resize",this.onResize),this.particlesRef.current=[],this.starsRef.current=[],this.fallingRef.current=[],this.frameCount=0,this.resize(),this.tick()}updateOptions(e){this.options={...this.options,...e}}destroy(){cancelAnimationFrame(this.raf),this.container.removeEventListener("mousemove",this.onMouseMove),this.container.removeEventListener("mouseleave",this.onMouseLeave),window.removeEventListener("resize",this.onResize),this.canvas.remove()}resize(){const e=window.devicePixelRatio||1,t=this.container.getBoundingClientRect();this.canvas.width=t.width*e,this.canvas.height=t.height*e,this.canvas.style.width=`${t.width}px`,this.canvas.style.height=`${t.height}px`;const s=this.canvas.getContext("2d");s&&s.setTransform(e,0,0,e,0,0)}}function loadShader$1(e,t,s){const i=e.createShader(t);return i?(e.shaderSource(i,s),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)?i:(e.deleteShader(i),null)):null}class ShaderAnimationController{constructor(e,t){this.raf=0,this.startTime=performance.now(),this.render=()=>{const e=this.gl,t=this.program,s=this.positionBuffer;if(!e||!t||!s)return;const{colors:i,speed:n,blur:a,noise:r,zoom:o,variant:l}=this.options,{width:d,height:h}=this.resizeCanvas();if(0===d||0===h)return void(this.raf=requestAnimationFrame(this.render));e.viewport(0,0,d,h),e.useProgram(t);const u=e.getAttribLocation(t,"aVertexPosition"),b=e.getUniformLocation(t,"uResolution"),p=e.getUniformLocation(t,"uTime"),m=e.getUniformLocation(t,"uColors"),g=e.getUniformLocation(t,"uSpeed"),f=e.getUniformLocation(t,"uSoftness"),v=e.getUniformLocation(t,"uNoiseStrength"),w=e.getUniformLocation(t,"uZoom");e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.uniform2f(b,d,h);const A=padColors(i),y=toLuminaSpeed(n),E=function toLuminaSoftness(e){return Math.min(1,e/200)}(a),_=.6*y,C=function clampZoom(e){return Math.min(4,Math.max(.25,e))}(o),x=(performance.now()-this.startTime)/1e3;"mesh-flow"===l?(p&&e.uniform1f(p,x),g&&e.uniform1f(g,_),f&&e.uniform1f(f,E),w&&e.uniform1f(w,C)):(p&&e.uniform1f(p,x*y),f&&e.uniform1f(f,E),v&&e.uniform1f(v,r),w&&e.uniform1f(w,C));const S=new Float32Array(15);for(let e=0;e<5;e++){const t=hexToRgb(A[e]);S[3*e]=t[0],S[3*e+1]=t[1],S[3*e+2]=t[2]}m&&e.uniform3fv(m,S),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.raf=requestAnimationFrame(this.render)},this.container=e,this.options=t,this.canvas=document.createElement("canvas"),this.canvas.className="designbase-wc-animation-background__shader-canvas",e.appendChild(this.canvas),this.init()}updateOptions(e){this.options={...this.options,...e}}resizeCanvas(){const e=this.container.getBoundingClientRect(),t=window.devicePixelRatio||1;return this.canvas.width=Math.max(1,e.width*t),this.canvas.height=Math.max(1,e.height*t),this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`,{width:this.canvas.width,height:this.canvas.height}}init(){const e=this.canvas.getContext("webgl");if(!e)return;this.gl=e;const{variant:t}=this.options,s=function getLuminaFragmentShader(e){switch(e){case"mesh-flow":return"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uSpeed;\n uniform float uSoftness;\n uniform float uZoom;\n void main() {\n vec2 uv = gl_FragCoord.xy / uResolution.xy;\n float aspect = uResolution.x / uResolution.y;\n vec2 p = (uv - 0.5) / max(0.25, uZoom) + 0.5;\n p.x *= aspect;\n float t = uTime * uSpeed * 0.1;\n vec3 col = mix(uColors[0], uColors[4], uv.y * 0.6 + 0.2);\n for(int i = 1; i < 4; i++) {\n float fi = float(i);\n float offset = fi * 4.0;\n vec2 q = p;\n q.x += sin(q.y * 1.5 + t + offset) * 0.2;\n q.y += cos(q.x * 0.8 - t + offset) * 0.1;\n float waveCenterY = 0.5 + 0.3 * sin(q.x * 1.0 + t * 0.8 + offset);\n float thickness = 0.15 + 0.15 * sin(q.x * 2.5 + t * 1.2 + offset);\n float w = thickness * (1.0 + uSoftness * 3.0);\n float dist = abs(q.y - waveCenterY);\n float blurAmount = 0.1 + uSoftness * 0.4;\n float intensity = smoothstep(w + blurAmount, w - blurAmount, dist);\n intensity *= 0.7;\n vec3 bandColor = uColors[i];\n bandColor = mix(bandColor, uColors[i+1], sin(p.x + t)*0.2 + 0.2);\n col = mix(col, bandColor, intensity);\n }\n float noise = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453);\n col += (noise - 0.5) * 0.03;\n gl_FragColor = vec4(col, 1.0);\n }\n";case"radiant":return"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n uniform float uZoom;\n float random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n void main() {\n vec2 uv = gl_FragCoord.xy / uResolution.xy;\n float aspect = uResolution.x / uResolution.y;\n uv = (uv - 0.5) / max(0.25, uZoom) + 0.5;\n uv.x *= aspect;\n float t = uTime * 0.15;\n vec3 col = uColors[0];\n for(int i = 1; i < 5; i++) {\n float fi = float(i);\n vec2 pos = vec2(\n 0.5 * aspect + 0.4 * sin(t * (0.5 + fi * 0.2) + fi * 1.5),\n 0.5 + 0.4 * cos(t * (0.4 + fi * 0.15) + fi)\n );\n float d = length(uv - pos);\n float radius = 0.6 + uSoftness * 1.0;\n float intensity = smoothstep(radius, 0.0, d);\n col = mix(col, uColors[i], intensity * 0.7);\n }\n float grain = random(gl_FragCoord.xy + uTime);\n col += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(col, 1.0);\n }\n";case"ethereal":return"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n uniform float uZoom;\n float random (in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))*43758.5453123);\n }\n float noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n vec2 u = f*f*(3.0-2.0*f);\n return mix( mix( random( i + vec2(0.0,0.0) ),\n random( i + vec2(1.0,0.0) ), u.x),\n mix( random( i + vec2(0.0,1.0) ),\n random( i + vec2(1.0,1.0) ), u.x), u.y);\n }\n #define OCTAVES 5\n float fbm (in vec2 st) {\n float value = 0.0;\n float amplitude = 0.5;\n for (int i = 0; i < OCTAVES; i++) {\n value += amplitude * noise(st);\n st *= 2.0;\n amplitude *= 0.5;\n }\n return value;\n }\n void main() {\n vec2 uv = gl_FragCoord.xy/uResolution.xy;\n float aspect = uResolution.x/uResolution.y;\n uv = (uv - 0.5) / max(0.25, uZoom) + 0.5;\n uv.x *= aspect;\n float t = uTime * 0.8;\n float scale = 5.0 - uSoftness * 3.0;\n vec2 st = uv * scale;\n vec2 q = vec2(0.);\n q.x = fbm( st + 0.12*t );\n q.y = fbm( st + vec2(1.0) + 0.10*t );\n vec2 r = vec2(0.);\n r.x = fbm( st + 1.0*q + vec2(1.7,9.2)+ 0.30*t );\n r.y = fbm( st + 1.0*q + vec2(8.3,2.8)+ 0.26*t );\n float f = fbm(st + r);\n vec3 color = mix(uColors[0], uColors[1], clamp((f*f)*4.0,0.0,1.0));\n color = mix(color, uColors[2], clamp(length(q),0.0,1.0));\n color = mix(color, uColors[3], clamp(length(r.x),0.0,1.0));\n color = mix(color, uColors[4], clamp(r.y*r.y, 0.0, 1.0));\n float grain = random(gl_FragCoord.xy + uTime);\n color += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(color,1.0);\n }\n";default:return"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n uniform float uZoom;\n float random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n void main() {\n vec2 uv = (gl_FragCoord.xy - 0.5 * uResolution.xy) / min(uResolution.y, uResolution.x);\n float t = uTime * 0.2;\n float scale = mix(1.8, 0.45, uSoftness) / max(0.25, uZoom);\n vec2 p = uv * scale;\n for(float i = 1.0; i <= 4.0; i++){\n p.x += 0.6 / i * sin(i * 3.0 * p.y + t);\n p.y += 0.6 / i * cos(i * 3.0 * p.x + t);\n }\n float w1 = 0.5 + 0.5 * sin(p.x + t);\n float w2 = 0.5 + 0.5 * sin(p.y + t * 0.8);\n float w3 = 0.5 + 0.5 * sin(p.x + p.y);\n vec3 col = uColors[0];\n col = mix(col, uColors[1], smoothstep(0.1, 0.9, w1));\n col = mix(col, uColors[2], smoothstep(0.1, 0.9, w2));\n col = mix(col, uColors[3], smoothstep(0.1, 0.9, w3));\n float w4 = w1 * w2 * w3;\n col = mix(col, uColors[4], w4);\n float grain = random(gl_FragCoord.xy + uTime);\n col += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(col, 1.0);\n }\n"}}(t),i=e.createProgram();if(!i)return;const n=loadShader$1(e,e.VERTEX_SHADER,"\n attribute vec4 aVertexPosition;\n void main() {\n gl_Position = aVertexPosition;\n }\n"),a=loadShader$1(e,e.FRAGMENT_SHADER,s);if(!n||!a)return;if(e.attachShader(i,n),e.attachShader(i,a),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))return;this.program=i,this.vertexShader=n,this.fragmentShader=a;const r=e.createBuffer();r&&(this.positionBuffer=r,e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),this.observer=new ResizeObserver(()=>this.resizeCanvas()),this.observer.observe(this.container),this.startTime=performance.now(),this.render())}destroy(){cancelAnimationFrame(this.raf),this.observer?.disconnect();const e=this.gl;e&&this.program&&(this.vertexShader&&e.deleteShader(this.vertexShader),this.fragmentShader&&e.deleteShader(this.fragmentShader),this.positionBuffer&&e.deleteBuffer(this.positionBuffer),e.deleteProgram(this.program)),this.canvas.remove()}}const g=.05;function loadShader(e,t,s){const i=e.createShader(t);return i?(e.shaderSource(i,s),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)?i:(e.deleteShader(i),null)):null}function lerp(e,t,s){return e+(t-e)*s}function lerpRgb(e,t,s){return[lerp(e[0],t[0],s),lerp(e[1],t[1],s),lerp(e[2],t[2],s)]}class GraphiteShaderController{constructor(e,t){this.raf=0,this.startTime=performance.now(),this.current={shaderSpeed:0,shaderIntensity:0,grain:0,scale:0,warp:0,color1:[0,0,0],color2:[0,0,0],color3:[0,0,0]},this.render=()=>{const e=this.gl,t=this.program,s=this.positionBuffer;if(!e||!t||!s)return;this.tickLerp();const{width:i,height:n}=this.resizeCanvas();if(0===i||0===n)return void(this.raf=requestAnimationFrame(this.render));e.viewport(0,0,i,n),e.useProgram(t);const a=e.getAttribLocation(t,"aVertexPosition"),r=e.getUniformLocation(t,"uResolution"),o=e.getUniformLocation(t,"uTime"),l=e.getUniformLocation(t,"uSpeed"),d=e.getUniformLocation(t,"uIntensity"),h=e.getUniformLocation(t,"uGrain"),u=e.getUniformLocation(t,"uScale"),b=e.getUniformLocation(t,"uWarp"),p=e.getUniformLocation(t,"uColor1"),m=e.getUniformLocation(t,"uColor2"),g=e.getUniformLocation(t,"uColor3");e.enableVertexAttribArray(a),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0);const f=(performance.now()-this.startTime)/1e3;r&&e.uniform2f(r,i,n),o&&e.uniform1f(o,f),l&&e.uniform1f(l,this.current.shaderSpeed),d&&e.uniform1f(d,this.current.shaderIntensity),h&&e.uniform1f(h,this.current.grain),u&&e.uniform1f(u,this.current.scale),b&&e.uniform1f(b,this.current.warp),p&&e.uniform3fv(p,this.current.color1),m&&e.uniform3fv(m,this.current.color2),g&&e.uniform3fv(g,this.current.color3),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.raf=requestAnimationFrame(this.render)},this.container=e,this.options=t,this.canvas=document.createElement("canvas"),this.canvas.className="designbase-wc-animation-background__shader-canvas",e.appendChild(this.canvas),this.syncCurrentImmediate(t),this.init()}updateOptions(e){this.options={...this.options,...e}}syncCurrentImmediate(e){const[t,s,i]=this.resolveColors(e.colors);this.current={shaderSpeed:e.shaderSpeed,shaderIntensity:e.shaderIntensity,grain:e.grain,scale:e.scale,warp:e.warp,color1:hexToRgb(t),color2:hexToRgb(s),color3:hexToRgb(i)}}resolveColors(e){return[e[0]??"#000000",e[1]??"#333333",e[2]??"#b3b3b3"]}resizeCanvas(){const e=this.container.getBoundingClientRect(),t=window.devicePixelRatio||1;return this.canvas.width=Math.max(1,e.width*t),this.canvas.height=Math.max(1,e.height*t),this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`,{width:this.canvas.width,height:this.canvas.height}}init(){const e=this.canvas.getContext("webgl");if(!e)return;this.gl=e;const t=e.createProgram();if(!t)return;const s=loadShader(e,e.VERTEX_SHADER,"\n attribute vec4 aVertexPosition;\n void main() {\n gl_Position = aVertexPosition;\n }\n"),i=loadShader(e,e.FRAGMENT_SHADER,"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform float uSpeed;\n uniform float uIntensity;\n uniform float uGrain;\n uniform float uScale;\n uniform float uWarp;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n\n vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\n vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\n vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}\n\n float cnoise(vec3 P){\n vec3 Pi0 = floor(P);\n vec3 Pi1 = Pi0 + vec3(1.0);\n Pi0 = mod(Pi0, 289.0);\n Pi1 = mod(Pi1, 289.0);\n vec3 Pf0 = fract(P);\n vec3 Pf1 = Pf0 - vec3(1.0);\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 / 7.0;\n vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 / 7.0;\n vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n }\n\n void main() {\n vec2 p = gl_FragCoord.xy / uResolution.xy;\n float base = p.x * 0.5 + p.y * 0.5;\n\n float n = cnoise(vec3(p * uScale, uTime * uSpeed)) * 0.5 + 0.5;\n float n2 = cnoise(vec3(p * (uScale * 1.5) - (n * uWarp), uTime * (uSpeed * 1.2))) * 0.5 + 0.5;\n\n float mask = (base * 0.2 + n * 0.5 + n2 * 0.3) * uIntensity;\n\n vec3 color = mix(uColor1, uColor2, smoothstep(0.1, 0.6, mask));\n color = mix(color, uColor3, smoothstep(0.5, 0.9, mask));\n\n float grain = fract(sin(dot(p + fract(uTime), vec2(12.9898, 78.233))) * 43758.5453);\n color += (grain - 0.5) * uGrain;\n\n gl_FragColor = vec4(color, 1.0);\n }\n");if(!s||!i)return;if(e.attachShader(t,s),e.attachShader(t,i),e.linkProgram(t),!e.getProgramParameter(t,e.LINK_STATUS))return;this.program=t,this.vertexShader=s,this.fragmentShader=i;const n=e.createBuffer();n&&(this.positionBuffer=n,e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),this.observer=new ResizeObserver(()=>this.resizeCanvas()),this.observer.observe(this.container),this.startTime=performance.now(),this.render())}tickLerp(){const{colors:e,shaderSpeed:t,shaderIntensity:s,grain:i,scale:n,warp:a}=this.options,[r,o,l]=this.resolveColors(e),d=hexToRgb(r),h=hexToRgb(o),u=hexToRgb(l);this.current.shaderSpeed=lerp(this.current.shaderSpeed,t,g),this.current.shaderIntensity=lerp(this.current.shaderIntensity,s,g),this.current.grain=lerp(this.current.grain,i,g),this.current.scale=lerp(this.current.scale,n,g),this.current.warp=lerp(this.current.warp,a,g),this.current.color1=lerpRgb(this.current.color1,d,g),this.current.color2=lerpRgb(this.current.color2,h,g),this.current.color3=lerpRgb(this.current.color3,u,g)}destroy(){cancelAnimationFrame(this.raf),this.observer?.disconnect();const e=this.gl;e&&this.program&&(this.vertexShader&&e.deleteShader(this.vertexShader),this.fragmentShader&&e.deleteShader(this.fragmentShader),this.positionBuffer&&e.deleteBuffer(this.positionBuffer),e.deleteProgram(this.program)),this.canvas.remove()}}const f="designbase-wc-animation-background",v=new Set(["particles","stars","snow","flowers","confetti","aurora","plasma","mesh-flow","fluid","radiant","ethereal","graphite","prism"]);function parseColors(e,t){if(!e)return t;try{const s=JSON.parse(e);return Array.isArray(s)&&s.length?s:t}catch{return e.split(",").map(e=>e.trim()).filter(Boolean)}}function resolveColors(e){const{type:t,preset:s,colors:i}=e;if("prism"===t)return i;if("graphite"===t)return s&&isGraphitePresetId(s)?[...getGraphitePreset(s).colors]:i.length>=3?i.slice(0,3):[...d];if(s&&!isGraphitePresetId(s))return function getLuminaPresetColors(e){const t=o.find(t=>t.id===e);return t?.colors??o[0].colors}(s);if("fluid"===t&&i.length<5)return a;if("snow"===t||"flowers"===t||"confetti"===t){const e=function getFallingParticleDefaults(e){switch(e){case"snow":default:return u;case"flowers":return b;case"confetti":return p}}(t);return 3===i.length&&"#667eea"===i[0]&&"#764ba2"===i[1]?e:i}return i}function createLuminaOverlays(e,t){const s=document.createDocumentFragment();if(e>0){const t=document.createElement("div");t.className=`${f}__lumina-noise`,t.style.backgroundImage=`url("${r}")`,t.style.opacity=String(e),s.appendChild(t)}if(t){const e=document.createElement("div");e.className=`${f}__lumina-vignette`,s.appendChild(e)}return s}function mountAnimationLayers(e,t){const s=resolveColors(t);let i={};if(t.disabled)return i;switch(t.type){case"particles":case"stars":case"snow":case"flowers":case"confetti":{const n=document.createElement("div");n.className=`${f}__canvas-layer`,e.appendChild(n);const a=new CanvasAnimationController(n,{type:t.type,colors:s,speed:t.speed,particleCount:t.particleCount,particleSize:t.particleSize,starCount:t.starCount,starSize:t.starSize,clickable:t.clickable,wind:t.wind,layerOpacity:t.opacity});i={destroy:()=>a.destroy(),update:e=>{const t=resolveColors(e);a.updateOptions({colors:t,speed:e.speed,particleCount:e.particleCount,particleSize:e.particleSize,starCount:e.starCount,starSize:e.starSize,clickable:e.clickable,wind:e.wind,layerOpacity:e.opacity})}};break}case"aurora":e.appendChild(function createMeshAuroraLayer(e,t,s,i,n){const a=document.createElement("div");a.className=`${f}__aurora-mesh`;const r="subtle"===i?.3:"medium"===i?.6:.8,o=function toAnimationDurationSec(e,t=3,s=.75){const i=3e3*t/Math.max(500,e);return Math.max(s,i)}(t,5,1.25),l=e.length>=3?e:["#4f46e5","#ec4899","#06b6d4","#8b5cf6"],d="dark"===n?"screen":"multiply",h=`blur(${s}px)`,u=`${f}__aurora-blob`,b=[{backgroundColor:l[0],top:"-10%",left:"-10%",animationDuration:`${o}s`,animationDelay:"0s"},{backgroundColor:l[1],top:"-10%",right:"-10%",animationDuration:1.2*o+"s",animationDelay:"2s"},{backgroundColor:l[2],bottom:"-20%",left:"20%",animationDuration:1.5*o+"s",animationDelay:"4s"}];l[3]&&b.push({backgroundColor:l[3],bottom:"-10%",right:"-10%",animationDuration:1.1*o+"s",animationDelay:"1s"}),b.forEach(e=>{const t=document.createElement("div");t.className=u,Object.assign(t.style,{filter:h,opacity:String(r),mixBlendMode:d,...e}),a.appendChild(t)});const p=document.createElement("div");return p.className=`${f}__aurora-noise`,p.style.opacity="dark"===n?"0.03":"0.05",p.style.backgroundImage="url(\"data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E\")",a.appendChild(p),a}(s,t.speed,t.blur,t.intensity,t.theme));break;case"plasma":e.appendChild(function createPlasmaLayer(e,t,s){const i=document.createElement("div");i.className=`${f}__plasma`;const n=Math.random().toString(36).slice(2,11),a=padColors(e),c=e=>a[e%a.length],r=60/toLuminaSpeed(t),o=document.createElement("style");o.textContent=`\n @keyframes designbase-wc-plasma-move-1-${n} {\n 0% { transform: translate(0, 0) rotate(0deg) scale(1); }\n 25% { transform: translate(10%, 10%) rotate(90deg) scale(1.2); }\n 50% { transform: translate(0, 20%) rotate(180deg) scale(1); }\n 75% { transform: translate(-10%, 10%) rotate(270deg) scale(0.9); }\n 100% { transform: translate(0, 0) rotate(360deg) scale(1); }\n }\n @keyframes designbase-wc-plasma-move-2-${n} {\n 0% { transform: translate(0, 0) rotate(0deg) scale(1.2); }\n 33% { transform: translate(-20%, 0) rotate(120deg) scale(1); }\n 66% { transform: translate(20%, -10%) rotate(240deg) scale(0.8); }\n 100% { transform: translate(0, 0) rotate(360deg) scale(1.2); }\n }\n @keyframes designbase-wc-plasma-move-3-${n} {\n 0% { transform: translate(0, 0) scale(0.8); }\n 50% { transform: translate(15%, -15%) scale(1.4); }\n 100% { transform: translate(0, 0) scale(0.8); }\n }\n @keyframes designbase-wc-plasma-rotate-${n} {\n 0% { transform: rotate(0deg) scale(1.5); }\n 50% { transform: rotate(180deg) scale(2.0); }\n 100% { transform: rotate(360deg) scale(1.5); }\n }`,i.appendChild(o);const l=document.createElement("div");return l.className=`${f}__plasma-base`,l.style.backgroundColor=c(0),i.appendChild(l),[{top:"-10%",left:"-10%",width:"70%",height:"70%",background:`radial-gradient(circle, ${c(1)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-move-1-${n} ${r}s infinite linear`},{bottom:"-20%",right:"-10%",width:"80%",height:"80%",background:`radial-gradient(circle, ${c(2)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-move-2-${n} ${r}s infinite linear`},{top:"20%",left:"20%",width:"60%",height:"60%",background:`radial-gradient(circle, ${c(3)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-rotate-${n} ${r}s infinite linear`,extraClass:`${f}__plasma-blob--exclusion`},{top:"40%",right:"20%",width:"40%",height:"40%",background:c(4),animation:`designbase-wc-plasma-move-3-${n} ${r}s infinite ease-in-out`,extraClass:`${f}__plasma-blob--accent`,filter:`blur(${s}px)`,opacity:"0.6"}].forEach(e=>{const t=document.createElement("div");t.className=`${f}__plasma-blob${e.extraClass?` ${e.extraClass}`:""}`,Object.assign(t.style,{filter:e.filter||`blur(${s}px)`,opacity:e.opacity||"0.9",...e}),i.appendChild(t)}),i}(s,t.speed,t.blur)),e.appendChild(createLuminaOverlays(t.noise,t.showVignette));break;case"prism":e.appendChild(function createPrismLayer(e,t,s){const i=document.createElement("div");i.className=`${f}__prism`;const n=Math.random().toString(36).slice(2,11),a=e.length?`conic-gradient(from 0deg at 50% 50%, ${e.map((t,s)=>`${t} ${Math.round(360/e.length*s)}deg`).join(", ")}, ${e[0]} 360deg)`:"var(--db-prism-gradient)",r=60/toLuminaSpeed(t),o=Math.min(56,Math.max(14,.4*s)),l=document.createElement("style");l.textContent=`\n @keyframes designbase-wc-prism-drift-1-${n} {\n 0% { transform: rotate(0deg) translate(0, 0) scale(1); }\n 50% { transform: rotate(180deg) translate(6%, 4%) scale(1.12); }\n 100% { transform: rotate(360deg) translate(0, 0) scale(1); }\n }\n @keyframes designbase-wc-prism-drift-2-${n} {\n 0% { transform: rotate(360deg) translate(0, 0) scale(1.05); }\n 50% { transform: rotate(180deg) translate(-8%, 5%) scale(0.92); }\n 100% { transform: rotate(0deg) translate(0, 0) scale(1.05); }\n }\n @keyframes designbase-wc-prism-drift-3-${n} {\n 0% { transform: rotate(0deg) translate(0, 0) scale(1.1); }\n 50% { transform: rotate(-180deg) translate(4%, -6%) scale(1.28); }\n 100% { transform: rotate(-360deg) translate(0, 0) scale(1.1); }\n }`,i.appendChild(l);const d=document.createElement("div");d.className=`${f}__prism-base`,d.style.background="var(--db-prism-dome)",i.appendChild(d);const h=[{size:"95%",top:"-34%",left:"-14%",opacity:.4,blur:o,anim:`designbase-wc-prism-drift-1-${n} ${r}s linear infinite`},{size:"80%",top:"38%",left:"58%",opacity:.3,blur:1.35*o,anim:`designbase-wc-prism-drift-2-${n} ${1.6*r}s linear infinite`},{size:"110%",top:"18%",left:"20%",opacity:.2,blur:1.9*o,anim:`designbase-wc-prism-drift-3-${n} ${2.4*r}s linear infinite`}];for(const e of h){const t=document.createElement("div");t.className=`${f}__prism-disc`,t.style.width=e.size,t.style.top=e.top,t.style.left=e.left,t.style.background=a,t.style.filter=`blur(${Math.round(e.blur)}px)`,t.style.opacity=String(e.opacity),t.style.animation=e.anim,i.appendChild(t)}return i}(s,t.speed,t.blur,t.theme)),e.appendChild(createLuminaOverlays(t.noise,t.showVignette));break;case"mesh-flow":case"fluid":case"radiant":case"ethereal":{const n=document.createElement("div");n.className=`${f}__shader-layer`,e.appendChild(n);const a=new ShaderAnimationController(n,{variant:t.type,colors:s,speed:t.speed,blur:t.blur,noise:t.noise,zoom:t.zoom});e.appendChild(createLuminaOverlays(t.noise,t.showVignette)),i={destroy:()=>a.destroy(),update:e=>{const t=resolveColors(e);a.updateOptions({colors:t,speed:e.speed,blur:e.blur,noise:e.noise,zoom:e.zoom})}};break}case"graphite":{const n=document.createElement("div");n.className=`${f}__shader-layer`,e.appendChild(n);const a=new GraphiteShaderController(n,{colors:s,shaderSpeed:t.shaderSpeed,shaderIntensity:t.shaderIntensity,grain:t.noise,scale:t.zoom,warp:t.warp});i={destroy:()=>a.destroy(),update:e=>{const t=resolveColors(e);a.updateOptions({colors:t,shaderSpeed:e.shaderSpeed,shaderIntensity:e.shaderIntensity,grain:e.noise,scale:e.zoom,warp:e.warp})}};break}}return i}function applyContainerStyles(e,t){const s=function isLuminaType(e){return n.includes(e)}(t.type),i="graphite"===t.type,a=s||i?"#000000":"dark"===t.theme?"var(--db-surface-base, #0f172a)":"var(--db-surface-base, #ffffff)";e.style.position="relative",e.style.overflow="hidden",e.style.backgroundColor=a,e.style.border="none"}const w=3e3,A={speed:{attr:"speed",label:"Speed (×)",kind:"range",min:500,max:12e3,step:100,default:w,display:{min:.2,max:4,step:.1,fixed:1,fromAttr:e=>{const t=Math.min(12e3,Math.max(500,e));return Math.round(t/w*10)/10},toAttr:e=>{const t=Math.min(4,Math.max(.2,e));return Math.round(t*w)}}},blur:{attr:"blur",label:"Blur",kind:"range",min:0,max:200,step:2,default:80},opacity:{attr:"opacity",label:"Opacity",kind:"range",min:0,max:1,step:.05,default:1,fixed:2},noise:{attr:"noise",label:"Noise",kind:"range",min:0,max:.4,step:.01,default:.05,fixed:2},zoom:{attr:"zoom",label:"Zoom",kind:"range",min:.5,max:3,step:.1,default:1,fixed:1},particleCount:{attr:"particle-count",label:"Particle Count",kind:"range",min:10,max:250,step:5,default:50},particleCountParticles:{attr:"particle-count",label:"Particle Count",kind:"range",min:10,max:250,step:5,default:15},particleSize:{attr:"particle-size",label:"Particle Size",kind:"range",min:1,max:10,step:.5,default:2,fixed:1},starCount:{attr:"star-count",label:"Star Count",kind:"range",min:20,max:500,step:10,default:100},starSize:{attr:"star-size",label:"Star Size",kind:"range",min:.5,max:6,step:.5,default:1.5,fixed:1},wind:{attr:"wind",label:"Wind",kind:"range",min:0,max:3,step:.1,default:.5,fixed:1},direction:{attr:"direction",label:"Direction",kind:"select",options:["left","right","up","down","diagonal","radial"],default:"left"},intensity:{attr:"intensity",label:"Intensity",kind:"select",options:["subtle","medium","vivid"],default:"subtle"},theme:{attr:"theme",label:"Theme",kind:"select",options:["dark","light"],default:"dark"},preset:{attr:"preset",label:"Preset",kind:"select",options:["(none)","neon_dream","sunset_bliss","deep_ocean","forest_mist","northern_lights","monochrome_fog","cotton_candy","cyber_glitch","golden_hour"],default:"(none)"},showVignette:{attr:"show-vignette",label:"Vignette",kind:"toggle",default:!0},shaderSpeed:{attr:"shader-speed",label:"Speed",kind:"range",min:0,max:3,step:.01,default:.4,fixed:2},shaderIntensity:{attr:"shader-intensity",label:"Intensity",kind:"range",min:.1,max:3,step:.01,default:1.2,fixed:2},grain:{attr:"noise",label:"Grain",kind:"range",min:0,max:.5,step:.01,default:.1,fixed:2},scale:{attr:"zoom",label:"Scale",kind:"range",min:.5,max:5,step:.1,default:1,fixed:1},warp:{attr:"warp",label:"Warp",kind:"range",min:0,max:2,step:.05,default:1.4,fixed:2},graphiteTheme:{attr:"preset",label:"Theme",kind:"select",options:[...h],default:"graphite"}};function colors(e){return{attr:"colors",label:"Colors",kind:"colors",default:e}}const y={particles:[A.particleCountParticles,A.particleSize,A.speed,A.opacity,colors(["#60a5fa","#a78bfa","#f472b6"])],stars:[A.starCount,A.starSize,A.speed,A.opacity,colors(["#ffffff","#e0e7ff","#c7d2fe"])],snow:[A.particleCount,A.particleSize,A.speed,A.wind,colors(["#ffffff","#f0f9ff","#e0f2fe"])],flowers:[A.particleCount,A.particleSize,A.speed,A.wind,colors(["#ffb7c5","#ff91a4","#f8c8dc","#ffc0cb"])],confetti:[A.particleCount,A.particleSize,A.speed,A.wind,colors(["#f44336","#e91e63","#9c27b0","#2196f3","#4caf50","#ffeb3b"])],aurora:[A.intensity,A.blur,A.speed,A.theme,colors(["#4f46e5","#ec4899","#06b6d4","#8b5cf6"])],plasma:[A.speed,A.blur,A.noise,A.showVignette,A.preset,colors(["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"])],"mesh-flow":[A.speed,A.blur,A.noise,A.zoom,colors(["#4f46e5","#ec4899","#06b6d4","#8b5cf6","#22d3ee"])],fluid:[A.speed,A.blur,A.noise,A.zoom,colors(["#001133","#0044FF","#00DDFF","#00FFAA","#000066"])],radiant:[A.speed,A.blur,A.noise,A.zoom,colors(["#FF4E50","#FC913A","#F9D423","#EDE574","#E1F5C4"])],ethereal:[A.speed,A.blur,A.noise,A.zoom,colors(["#7000FF","#FF00AA","#00FFFF","#FFFFFF","#3300FF"])],prism:[A.speed,A.blur,A.noise,A.showVignette,colors([])],graphite:[A.shaderSpeed,A.shaderIntensity,A.grain,A.scale,A.warp,A.graphiteTheme,colors(["#000000","#333333","#b3b3b3"])]};function getControlsForType(e){return y[e]??y.graphite}function writeControlAttribute(e,t,s){"colors"!==t.kind?"toggle"!==t.kind?"select"!==t.kind?e.setAttribute(t.attr,String(s)):"(none)"===s?e.removeAttribute(t.attr):e.setAttribute(t.attr,String(s)):e.setAttribute(t.attr,s?"true":"false"):e.setAttribute(t.attr,JSON.stringify(s))}const E=f,_=["particles","stars","snow","flowers","confetti","mesh-flow","fluid","radiant","ethereal","graphite"],C=["mesh-flow","fluid","radiant","ethereal"];class DbAnimationBackground extends HTMLElement{constructor(){super(...arguments),this.panelOpen=!1,this.controlInputs=new Map,this.syncingControls=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.panelOpen&&(e.preventDefault(),this.panelOpen=!1,this.syncPanelState())}}static get observedAttributes(){return["type","theme","intensity","blur","speed","direction","colors","width","height","border-radius","opacity","blend-mode","particle-count","particle-size","star-count","star-size","wind","clickable","disabled","noise","show-vignette","preset","zoom","show-controls","shader-speed","shader-intensity","warp"]}connectedCallback(){this.style.display="block",this.render(),document.addEventListener("keydown",this.handleDocumentKeyDown)}disconnectedCallback(){document.removeEventListener("keydown",this.handleDocumentKeyDown),this.teardownLayers(),this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0)}attributeChangedCallback(e,t,s){this.isConnected&&t!==s&&("show-controls"!==e?this.syncingControls||("type"===e&&this.getBool("show-controls",!1)&&this.rebuildControlInputs(),this.applyConfig(),this.getBool("show-controls",!1)&&this.syncControlInputs()):this.syncControlsVisibility())}getBool(e,t=!1){return this.hasAttribute(e)?"false"!==this.getAttribute(e):t}getSizeStyle(e){if(!e)return;const t=Number(e);return Number.isFinite(t)?`${t}px`:e}getConfig(){return function parseAnimationBackgroundConfig(e){const t=function normalizeAnimationType(e){return e&&"gradient"!==e&&v.has(e)?e:"graphite"}(e.getAttribute("type")),s="light"===e.getAttribute("theme")?"light":"dark",i=e.getAttribute("intensity")||"subtle",n=e.getAttribute("preset")||void 0,a=e.getAttribute("zoom"),r="graphite"===t;let o=Number(a||1);r&&null===a&&(o=getGraphitePreset(isGraphitePresetId(n)?n:"graphite").scale);return{type:t,theme:s,intensity:i,blur:Number(e.getAttribute("blur")||80),speed:Number(e.getAttribute("speed")||3e3),direction:e.getAttribute("direction")||"left",colors:parseColors(e.getAttribute("colors"),"prism"===t?[]:r?[...d]:["#667eea","#764ba2","#f093fb"]),opacity:Number(e.getAttribute("opacity")||1),particleCount:Number(e.getAttribute("particle-count")||("particles"===t?15:50)),particleSize:Number(e.getAttribute("particle-size")||2),starCount:Number(e.getAttribute("star-count")||100),starSize:Number(e.getAttribute("star-size")||1.5),clickable:e.hasAttribute("clickable")&&"false"!==e.getAttribute("clickable"),wind:Number(e.getAttribute("wind")||.5),noise:Number(e.getAttribute("noise")??(r?.1:.05)),showVignette:!e.hasAttribute("show-vignette")||"false"!==e.getAttribute("show-vignette"),preset:n||(r?"graphite":void 0),zoom:o,shaderSpeed:Number(e.getAttribute("shader-speed")||.4),shaderIntensity:Number(e.getAttribute("shader-intensity")||1.2),warp:Number(e.getAttribute("warp")||1.4),disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")}}(this)}teardownLayers(){this.layerHandle?.destroy?.(),this.layerHandle=void 0,this.mountedType=void 0,this.layersEl&&this.layersEl.replaceChildren()}remountLayers(e){this.layersEl&&(this.teardownLayers(),this.layerHandle=mountAnimationLayers(this.layersEl,e),this.mountedType=e.type)}canLiveUpdate(e){return this.mountedType===e.type&&_.includes(e.type)&&"function"==typeof this.layerHandle?.update}applyConfig(){const e=this.getConfig();this.className=[E,`${E}--${e.type}`,e.clickable&&!e.disabled&&`${E}--clickable`,e.disabled&&`${E}--disabled`,this.getBool("show-controls",!1)&&`${E}--show-controls`].filter(Boolean).join(" "),applyContainerStyles(this,e);const t=this.getSizeStyle(this.getAttribute("width")),s=this.getSizeStyle(this.getAttribute("height")),i=this.getSizeStyle(this.getAttribute("border-radius"));t&&(this.style.width=t),s&&(this.style.height=s),this.style.borderRadius=i||"0",this.style.border="none",this.style.opacity="",this.layersEl&&(this.layersEl.style.opacity=String(e.opacity));const n=this.getAttribute("blend-mode");if(n&&(this.style.mixBlendMode=n),e.disabled)return this.teardownLayers(),void this.syncClickable(e);this.canLiveUpdate(e)?(this.layerHandle?.update?.(e),this.layersEl&&C.includes(e.type)&&function syncLuminaOverlays(e,t,s){let i=e.querySelector(`.${f}__lumina-noise`),n=e.querySelector(`.${f}__lumina-vignette`);t>0?(i||(i=document.createElement("div"),i.className=`${f}__lumina-noise`,i.style.backgroundImage=`url("${r}")`,i.style.mixBlendMode="overlay",e.appendChild(i)),i.style.opacity=String(t)):i?.remove(),s?n||(n=document.createElement("div"),n.className=`${f}__lumina-vignette`,e.appendChild(n)):n?.remove()}(this.layersEl,e.noise,e.showVignette)):this.remountLayers(e),this.syncClickable(e)}syncClickable(e){this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0),e.clickable&&!e.disabled&&(this.clickHandler=()=>{this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.addEventListener("click",this.clickHandler))}render(){if(!this.layersEl){this.layersEl=document.createElement("div"),this.layersEl.className=`${E}__layers`,Object.assign(this.layersEl.style,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"0"}),this.contentEl=document.createElement("div"),this.contentEl.className=`${E}__content`,Object.assign(this.contentEl.style,{position:"relative",zIndex:"10",width:"100%",height:"100%"});const e=document.createElement("slot");this.contentEl.appendChild(e),this.append(this.layersEl,this.contentEl)}this.ensureControlsShell(),this.applyConfig(),this.syncControlsVisibility()}ensureControlsShell(){if(this.controlsRootEl)return;const e=document.createElement("div");e.className=`${E}__controls-root`,e.hidden=!0;const t=this.createIconButton("settings","컨트롤 열기",()=>{this.panelOpen=!this.panelOpen,this.syncPanelState()});t.setAttribute("variant","secondary"),t.className=`${E}__controls-gear`;const s=document.createElement("div");s.className=`${E}__controls-panel`,s.setAttribute("role","dialog"),s.setAttribute("aria-modal","false"),s.hidden=!0,s.addEventListener("click",e=>e.stopPropagation());const i=document.createElement("div");i.className=`${E}__controls-head`;const n=document.createElement("span");n.className=`${E}__controls-title`,n.append(createDbIcon("settings",14),document.createTextNode(" Controls"));const a=this.createIconButton("refresh","기본값으로 초기화",()=>{const e=this.getConfig(),t=getControlsForType(e.type);if(this.syncingControls=!0,function resetControlsToDefaults(e,t){t.forEach(t=>{const s=t.default;"select"!==t.kind||s!==t.default?writeControlAttribute(e,t,Array.isArray(s)?[...s]:s):"(none)"===s?e.removeAttribute(t.attr):writeControlAttribute(e,t,s)})}(this,t),"graphite"===e.type){const e=getGraphitePreset("graphite");this.setAttribute("zoom",String(e.scale)),this.setAttribute("colors",JSON.stringify(e.colors))}this.syncingControls=!1,this.applyConfig(),this.syncControlInputs()});a.className=`${E}__controls-icon-btn`,i.append(n,a),s.append(i),e.append(t,s),this.appendChild(e),this.controlsRootEl=e,this.panelEl=s}syncControlsVisibility(){if(!this.controlsRootEl)return;const e=this.getBool("show-controls",!1);this.controlsRootEl.hidden=!e,e?this.rebuildControlInputs():(this.panelOpen=!1,this.syncPanelState())}syncPanelState(){if(!this.controlsRootEl||!this.panelEl)return;const e=this.controlsRootEl.querySelector(`.${E}__controls-gear`);e&&(e.dataset.open=this.panelOpen?"true":"false",e.setAttribute("aria-expanded",this.panelOpen?"true":"false")),this.panelEl.hidden=!this.panelOpen}createIconButton(e,t,s){const i=document.createElement("db-button");return i.setAttribute("variant","tertiary"),i.setAttribute("size","s"),i.setAttribute("icon-only",""),i.setAttribute("start-icon",e),i.setAttribute("aria-label",t),i.addEventListener("click",e=>{e.stopPropagation(),s()}),i}rebuildControlInputs(){if(!this.panelEl)return;this.panelEl.querySelectorAll(`.${E}__controls-field`).forEach(e=>e.remove()),this.controlInputs.clear();const e=this.getConfig(),t=getControlsForType(e.type),s=this.panelEl.querySelector(`.${E}__controls-title`);s&&(s.lastChild?.remove(),s.append(document.createTextNode(` ${e.type}`))),t.forEach(e=>{const t=this.createControlField(e);this.panelEl?.appendChild(t)}),this.syncControlInputs()}createControlField(e){const t=document.createElement("div");if(t.className=`${E}__controls-field`,t.dataset.attr=e.attr,"range"===e.kind){const s=function getControlSliderBounds(e){return e.display?{min:e.display.min,max:e.display.max,step:e.display.step,fixed:e.display.fixed}:{min:e.min??0,max:e.max??100,step:e.step??1,fixed:e.fixed}}(e),i=document.createElement("db-range-slider");return i.className=`${E}__controls-range`,i.setAttribute("size","s"),i.setAttribute("full-width",""),i.setAttribute("show-label",""),i.setAttribute("label",e.label),i.setAttribute("show-value",""),i.setAttribute("value-position","top"),i.setAttribute("show-thumb-tooltip",""),i.setAttribute("min",String(s.min)),i.setAttribute("max",String(s.max)),i.setAttribute("step",String(s.step)),null!=s.fixed&&i.setAttribute("value-fixed",String(s.fixed)),i.addEventListener("db-change",t=>{const s=t.detail;null!=s.value&&this.commitControlValue(e,function controlSliderToAttr(e,t){return e.display?e.display.toAttr(t):t}(e,s.value))}),t.appendChild(i),this.controlInputs.set(e.attr,i),t}if("select"===e.kind){const s=document.createElement("div");s.className=`${E}__controls-label`,s.textContent=e.label;const i=e.options??[];if(i.length>4){const n=document.createElement("db-select");n.className=`${E}__controls-select`,n.setAttribute("size","s"),n.setAttribute("full-width",""),n.setAttribute("options",JSON.stringify(i.map(e=>({value:e,label:e})))),n.addEventListener("db-change",t=>{const s=t.detail;null!=s.value&&this.commitControlValue(e,s.value)}),t.append(s,n),this.controlInputs.set(e.attr,n)}else{const n=document.createElement("db-segment-control");n.className=`${E}__controls-seg`,n.setAttribute("size","s"),n.setAttribute("full-width",""),n.setAttribute("options",JSON.stringify(i.map(e=>({value:e,label:e})))),n.addEventListener("db-change",t=>{const s=t.detail;null!=s.value&&this.commitControlValue(e,s.value)}),t.append(s,n),this.controlInputs.set(e.attr,n)}return t}if("toggle"===e.kind){const s=document.createElement("div");s.className=`${E}__controls-toggle`;const i=document.createElement("span");i.textContent=e.label;const n=document.createElement("db-toggle");return n.setAttribute("size","s"),n.addEventListener("db-change",t=>{const s=t.detail;this.commitControlValue(e,Boolean(s.checked))}),s.append(i,n),t.appendChild(s),this.controlInputs.set(e.attr,n),t}const s=document.createElement("div");s.className=`${E}__controls-label`,s.textContent=e.label;const i=document.createElement("div");return i.className=`${E}__controls-colors`,t.append(s,i),this.controlInputs.set(e.attr,i),t}commitControlValue(e,t){if(this.syncingControls=!0,writeControlAttribute(this,e,t),"preset"===e.attr&&"graphite"===this.getConfig().type&&"string"==typeof t&&isGraphitePresetId(t)){const e=getGraphitePreset(t);this.setAttribute("zoom",String(e.scale)),this.setAttribute("colors",JSON.stringify(e.colors))}this.syncingControls=!1,this.applyConfig()}syncControlInputs(){getControlsForType(this.getConfig().type).forEach(e=>{const t=function readControlValue(e,t){const s=e.getAttribute(t.attr);if("colors"===t.kind){if(!s)return[...t.default];try{const e=JSON.parse(s);return Array.isArray(e)&&e.length?[...e]:[...t.default]}catch{const e=s.split(",").map(e=>e.trim()).filter(Boolean);return e.length?e:[...t.default]}}if("toggle"===t.kind)return null===s?t.default:"false"!==s;if("select"===t.kind)return s||t.default;if(null===s||""===s)return t.default;const i=Number(s);return Number.isFinite(i)?i:t.default}(this,e),s=this.controlInputs.get(e.attr);if(s)if("range"===e.kind&&function isRangeSlider(e){return"DB-RANGE-SLIDER"===e.tagName}(s)){const i=Number(t);s.setAttribute("value",String(function controlAttrToSlider(e,t){return e.display?e.display.fromAttr(t):t}(e,i)))}else"select"===e.kind?s.setAttribute("value",String(t)):"toggle"===e.kind?Boolean(t)?s.setAttribute("checked",""):s.removeAttribute("checked"):"colors"===e.kind&&this.renderColorInputs(s,e,t)})}renderColorInputs(e,t,s){const i=[...s];e.replaceChildren();const commitStructuralChange=s=>{this.commitControlValue(t,s),this.renderColorInputs(e,t,s)};if(i.forEach((s,n)=>{const a=document.createElement("div");a.className=`${E}__controls-color`;const r=document.createElement("db-color-picker");if(r.className=`${E}__controls-color-picker`,r.setAttribute("size","s"),r.setAttribute("full-width",""),r.setAttribute("show-alpha","false"),r.setAttribute("show-eyedropper","false"),r.setAttribute("value",s),r.addEventListener("db-change",e=>{const s=e.detail,a=s?.value;"string"==typeof a&&a&&(i[n]=a,this.commitControlValue(t,[...i]))}),a.appendChild(r),i.length>1){const e=this.createIconButton("trash","색상 제거",()=>{commitStructuralChange(i.filter((e,t)=>t!==n))});e.className=`${E}__controls-color-remove`,a.appendChild(e)}e.appendChild(a)}),i.length<8){const t=this.createIconButton("plus","색상 추가",()=>{commitStructuralChange([...i,i[i.length-1]??"#ffffff"])});t.className=`${E}__controls-color-add`,e.appendChild(t)}}}customElements.get("db-animation-background")||customElements.define("db-animation-background",DbAnimationBackground);const x=["s","m","l"],S=["xs","s","m","l","xl"];function coerceToContract(e,t,s){return e&&t.includes(e)?e:s}const k=["primary","secondary","tertiary","destructive","ghost","accent"],N={danger:"destructive"},L=x,z=["none","s","m","l","pill"],I=["solid","gradient","backlight","outline","prism"],M=x,D=["text","email","password","url","search","tel","number"],T=["primary","secondary","info","success","warning","danger"],B=x,F=["dot","number","text","outlined"],P=["xs","s","m","l","xl","2xl"],$=["default","primary","success","warning","danger","info"],O=["online","offline","away","busy"],H=["default","primary","success","warning","danger","info","neutral"],V=x,R=S,j=["circular","dots","bars","pulse","ripple"],q=x,U=x,J=x,K=["default","info","success","warning","danger"],W=["s","m","l","xl","full"],G=["default","pills"],Q=x,Y=["horizontal","vertical"],Z=x,X=["bottom","top"],ee=x,te=["vertical","horizontal"],se=["text","circular","rectangular","rounded"],ie=S,ne=["s","m","l","xl","full"],ae=["none","s","m","l","xl"],re=["left","right","top","bottom"],oe=["s","m","l","xl","full"],le=x,ce=["bottom-left","bottom-right","top-left","top-right"],de=["primary","secondary","tertiary","danger","ghost"],he=["default","minimal"],ue=["center","left"],be=x,pe=x,me=["default","dark","light"],ge=["default","wrapper"],fe=["left","right"],ve=["auto","adjacent","replace"],we=["nav-top","nav","nav-bottom"],Ae=x,ye=["default","striped","hoverable"],Ee=x,_e=["disabled","loading","icon-only","full-width"];class DbButton extends HTMLElement{constructor(){super(...arguments),this.handleClick=e=>{if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation();this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.disabled||this.loading||this.classList.add("designbase-wc-button--pressed"),this.click())},this.handleKeyUp=e=>{"Enter"!==e.key&&" "!==e.key||this.classList.remove("designbase-wc-button--pressed")},this.handlePointerDown=()=>{this.disabled||this.loading||this.classList.add("designbase-wc-button--pressed")},this.handlePointerUp=()=>{this.classList.remove("designbase-wc-button--pressed")}}static get observedAttributes(){return["variant","size","radius","accent-style","type","loading-text","start-icon","end-icon",..._e]}get variant(){return function coerceWithAliases(e,t,s,i){return e&&!t.includes(e)&&e in s?s[e]:coerceToContract(e,t,i)}(this.getAttribute("variant"),k,N,"primary")}set variant(e){this.setAttribute("variant",e)}get size(){return coerceToContract(this.getAttribute("size"),L,"m")}set size(e){this.setAttribute("size",e)}get radius(){const e=this.getAttribute("radius");return e?coerceToContract(e,z,z[0]):""}set radius(e){e?this.setAttribute("radius",e):this.removeAttribute("radius")}get accentStyle(){return coerceToContract(this.getAttribute("accent-style"),I,"solid")}set accentStyle(e){e?this.setAttribute("accent-style",e):this.removeAttribute("accent-style")}get type(){return this.getAttribute("type")||"button"}set type(e){this.setAttribute("type",e)}get loadingText(){return this.getAttribute("loading-text")||""}set loadingText(e){e?this.setAttribute("loading-text",e):this.removeAttribute("loading-text")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}get loading(){return this.hasAttribute("loading")}set loading(e){this.toggleAttribute("loading",e)}get iconOnly(){return this.hasAttribute("icon-only")}set iconOnly(e){this.toggleAttribute("icon-only",e)}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(e){this.toggleAttribute("full-width",e)}connectedCallback(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("keyup",this.handleKeyUp),this.addEventListener("pointerdown",this.handlePointerDown),this.addEventListener("pointerup",this.handlePointerUp),this.addEventListener("pointerleave",this.handlePointerUp),this.addEventListener("pointercancel",this.handlePointerUp),this.syncAttributes()}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("keyup",this.handleKeyUp),this.removeEventListener("pointerdown",this.handlePointerDown),this.removeEventListener("pointerup",this.handlePointerUp),this.removeEventListener("pointerleave",this.handlePointerUp),this.removeEventListener("pointercancel",this.handlePointerUp)}attributeChangedCallback(){this.syncAttributes()}syncAttributes(){this.classList.add("designbase-wc-button"),this.setAttribute("role","button"),this.setAttribute("aria-disabled",String(this.disabled||this.loading)),this.loading?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this.disabled||this.loading?this.removeAttribute("tabindex"):this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.syncModifier("variant",this.variant),this.syncModifier("size",this.size),this.syncRadius(),this.syncAccentStyle(),this.syncAccentField(),this.syncAccentRing(),this.syncBooleanModifier("disabled"),this.syncBooleanModifier("icon-only"),this.syncBooleanModifier("full-width"),this.syncLoadingVisual(),this.loading?(this.querySelector(":scope > .designbase-wc-button__start-icon")?.remove(),this.querySelector(":scope > .designbase-wc-button__end-icon")?.remove()):this.syncIcons()}getIconSize(){return"s"===this.size?16:"l"===this.size?24:20}resolveIconName(e){if(e&&isDbIconName(e))return e}isManagedIconNode(e){return e instanceof HTMLElement&&(e.classList.contains("designbase-wc-button__start-icon")||e.classList.contains("designbase-wc-button__end-icon")||e.classList.contains("designbase-wc-button__spinner")||e.classList.contains("designbase-wc-button__accent-field")||e.classList.contains("designbase-wc-button__accent-glass")||e.classList.contains("designbase-wc-button__accent-orb")||e.classList.contains("designbase-wc-button__accent-ring"))}syncIcons(){const e=this.resolveIconName(this.getAttribute("start-icon")),t=this.resolveIconName(this.getAttribute("end-icon")),s=this.getIconSize();let i=this.querySelector(":scope > .designbase-wc-button__start-icon");if(e){if(!i){i=document.createElement("span"),i.className="designbase-wc-button__start-icon",i.setAttribute("aria-hidden","true");const e=Array.from(this.childNodes).find(e=>!this.isManagedIconNode(e));e?this.insertBefore(i,e):this.append(i)}i.replaceChildren(createDbIcon(e,s))}else i?.remove();let n=this.querySelector(":scope > .designbase-wc-button__end-icon");t?(n||(n=document.createElement("span"),n.className="designbase-wc-button__end-icon",n.setAttribute("aria-hidden","true")),n.replaceChildren(createDbIcon(t,s)),this.append(n)):n?.remove()}getDefaultRadiusClass(){if(z.includes(this.radius))return`designbase-wc-button--radius-${this.radius}`;const e=L.includes(this.size)?this.size:"m";return`designbase-wc-button--radius-${"s"===e||"l"===e?e:"m"}`}syncRadius(){z.forEach(e=>this.classList.remove(`designbase-wc-button--radius-${e}`)),this.classList.add(this.getDefaultRadiusClass())}syncAccentStyle(){if(I.forEach(e=>this.classList.remove(`designbase-wc-button--accent-${e}`)),"accent"!==this.variant)return;const e=this.accentStyle,t=I.includes(e)?e:"solid";this.classList.add(`designbase-wc-button--accent-${t}`)}syncAccentRing(){const e="accent"===this.variant&&"outline"===this.accentStyle,t=this.querySelector(":scope > .designbase-wc-button__accent-ring");if(!e)return void t?.remove();if(t)return;const s=document.createElement("span");s.className="designbase-wc-button__accent-ring",s.setAttribute("aria-hidden","true");const i=document.createElement("span");i.className="designbase-wc-button__accent-ring-spin",s.appendChild(i),this.insertBefore(s,this.firstChild)}syncAccentField(){const e="accent"===this.variant&&"gradient"===this.accentStyle,t=this.querySelector(":scope > .designbase-wc-button__accent-field"),s=this.querySelector(":scope > .designbase-wc-button__accent-glass");if(!e)return t?.remove(),void s?.remove();let i=t;if(!i){i=document.createElement("span"),i.className="designbase-wc-button__accent-field",i.setAttribute("aria-hidden","true");for(let e=1;e<=5;e+=1){const t=document.createElement("span");t.className=`designbase-wc-button__accent-orb designbase-wc-button__accent-orb--${e}`,i.appendChild(t)}this.insertBefore(i,this.firstChild)}if(!s){const e=document.createElement("span");e.className="designbase-wc-button__accent-glass",e.setAttribute("aria-hidden","true"),i.insertAdjacentElement("afterend",e)}}syncModifier(e,t){Array.from(this.classList).filter(t=>t.startsWith(`designbase-wc-button--${e}-`)).forEach(e=>this.classList.remove(e)),("variant"===e||"size"===e)&&(("variant"===e?k:L).forEach(e=>this.classList.remove(`designbase-wc-button--${e}`)),this.classList.add(`designbase-wc-button--${t}`))}syncBooleanModifier(e){const t=`designbase-wc-button--${e}`;this.classList.toggle(t,this.hasAttribute(e))}getSpinnerSize(){return L.includes(this.size)?this.size:"m"}syncLoadingVisual(){this.classList.toggle("designbase-wc-button--loading",this.loading);const e=this.querySelector(":scope > .designbase-wc-button__spinner");if(!this.loading)return void e?.remove();const t=`designbase-wc-button__spinner designbase-wc-spinner designbase-wc-spinner--circular designbase-wc-spinner--${this.getSpinnerSize()}`;if(e)return e.className=t,void e.setAttribute("aria-hidden","true");const s=document.createElement("span");s.className=t,s.setAttribute("aria-hidden","true"),s.innerHTML='<svg class="designbase-wc-spinner__circular" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle class="designbase-wc-spinner__circular-track" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"></circle><circle class="designbase-wc-spinner__circular-indicator" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"></circle></svg>',this.insertBefore(s,this.firstChild)}}customElements.get("db-button")||customElements.define("db-button",DbButton);const Ce="designbase-wc-alert";class DbAlert extends HTMLElement{static get observedAttributes(){return["title","message","variant","size","show-icon","closable","action-label","action-variant","action-buttons"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getIconName(e){return"success"===e?"circle-checked":"warning"===e?"warning-filled":"danger"===e?"error-filled":"info-filled"}parseActionButtons(){const e=this.getAttribute("action-buttons");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}render(){const e=this.getAttribute("variant")||"default",t=this.getAttribute("size")||"m",s="false"!==this.getAttribute("show-icon"),i="false"!==this.getAttribute("closable"),n=this.getAttribute("title")?.trim()||"",a=this.getAttribute("message")?.trim()||"",r=this.getAttribute("action-label"),o=this.getAttribute("action-variant")||"tertiary",l=this.parseActionButtons(),d=Boolean(a),h=Boolean(n),u=h&&!d||!h&&d,b=l.length>0?l:r?[{label:r,variant:o}]:[];this.className=[Ce,`${Ce}--${e}`,`${Ce}--${t}`,s&&`${Ce}--with-icon`,i&&`${Ce}--closable`,u&&`${Ce}--text-single`,b.length>0&&`${Ce}--has-actions`].filter(Boolean).join(" "),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),this.querySelector(`.${Ce}__content`)?.remove(),this.querySelector(`.${Ce}__actions`)?.remove(),Array.from(this.childNodes).forEach(e=>{e.nodeType===Node.TEXT_NODE&&e.remove()});const p=document.createElement("div");if(p.className=`${Ce}__content`,s){const s=document.createElement("div");s.className=`${Ce}__icon`,s.append(createDbIcon(this.getIconName(e),"s"===t?16:"l"===t?24:20)),p.append(s)}const m=document.createElement("div");if(m.className=`${Ce}__body`,h){const e=document.createElement("div");e.className=`${Ce}__title`,e.textContent=n,m.append(e)}if(d){const e=document.createElement("div");e.className=`${Ce}__message`,e.textContent=a,m.append(e)}if(p.append(m),b.length>0){const e=document.createElement("div");e.className=`${Ce}__actions`;const s=document.createElement("div");s.className=`${Ce}__action-buttons`,b.forEach((e,i)=>{const n=document.createElement("db-button");n.setAttribute("variant",e.variant||"tertiary"),n.setAttribute("size",e.size||t),n.textContent=e.label,e.disabled&&n.setAttribute("disabled",""),n.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0,detail:{index:i,label:e.label}}))}),s.append(n)}),e.append(s),p.append(e)}if(i){const e=document.createElement("button");e.type="button",e.className=`${Ce}__close`,e.setAttribute("aria-label","알림 닫기"),e.append(createDbIcon("close",20)),e.addEventListener("click",()=>{this.hidden=!0,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}),p.append(e)}this.replaceChildren(p)}}customElements.get("db-alert")||customElements.define("db-alert",DbAlert);const xe=["#E3F2FD","#F3E5F5","#E8F5E8","#FFF3E0","#FCE4EC","#E0F2F1","#FFF8E1","#F1F8E9","#E8EAF6","#FFEBEE"],Se=["#1976D2","#7B1FA2","#388E3C","#F57C00","#C2185B","#00796B","#F9A825","#689F38","#3F51B5","#D32F2F"];class DbAvatar extends HTMLElement{constructor(){super(...arguments),this.imageFailed=!1,this.imageLoaded=!1,this.handleClick=()=>{!this.hasAttribute("disabled")&&this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=e=>{this.hasAttribute("clickable")&&!this.hasAttribute("disabled")&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick()))}}static get observedAttributes(){return["src","alt","initials","size","variant","status","disabled","clickable","badge","badge-max-count","badge-variant","badge-type","badge-text"]}connectedCallback(){this.render(),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(e){"src"===e&&(this.imageFailed=!1,this.imageLoaded=!1),this.render()}render(){const e=P.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",t=$.includes(this.getAttribute("variant")||"default")&&this.getAttribute("variant")||"default",s=this.hasAttribute("disabled"),i=this.hasAttribute("clickable"),n=this.getAttribute("src"),a=this.getAttribute("initials")||"",r=Boolean(n&&!this.imageFailed),o=r&&!this.imageLoaded;if(this.className=["designbase-wc-avatar",`designbase-wc-avatar--${e}`,`designbase-wc-avatar--${t}`,i&&"designbase-wc-avatar--clickable",s&&"designbase-wc-avatar--disabled",o&&"designbase-wc-avatar--loading"].filter(Boolean).join(" "),i&&!s?(this.setAttribute("role","button"),this.tabIndex=0):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.toggleAttribute("aria-disabled",s),this.replaceChildren(),o){const e=document.createElement("div");e.className="designbase-wc-avatar__loading";const t=document.createElement("div");t.className="designbase-wc-avatar__skeleton",e.append(t),this.append(e)}if(r){const e=document.createElement("img");e.className="designbase-wc-avatar__image",e.src=n,e.alt=this.getAttribute("alt")||"아바타 이미지",e.loading="lazy",e.addEventListener("load",()=>{this.imageLoaded=!0,this.classList.remove("designbase-wc-avatar--loading"),this.querySelector(".designbase-wc-avatar__loading")?.remove()}),e.addEventListener("error",()=>{this.imageFailed=!0,this.imageLoaded=!1,this.render()}),this.append(e)}else if(a){const e=document.createElement("div");if(e.className="designbase-wc-avatar__initials","default"===t){const t=function initialsColor(e){let t=0;for(let s=0;s<e.length;s++)t=e.charCodeAt(s)+((t<<5)-t);const s=Math.abs(t)%xe.length;return{backgroundColor:xe[s],color:Se[s]}}(a);e.style.backgroundColor=t.backgroundColor,e.style.color=t.color}e.textContent=a.charAt(0).toUpperCase(),this.append(e)}else{const t=document.createElement("div");t.className="designbase-wc-avatar__icon",t.append(createDbIcon("user",function iconSize(e){return"xs"===e?12:"s"===e?16:"m"===e?20:"l"===e?24:"xl"===e?32:40}(e))),this.append(t)}const l=this.getAttribute("status")||"";if(O.includes(l)){const e=document.createElement("span");e.className=`designbase-wc-avatar__status designbase-wc-avatar__status--${l}`,this.append(e)}if(this.hasAttribute("badge")){const t=document.createElement("div");t.className="designbase-wc-avatar__badge";const s=document.createElement("db-badge");s.setAttribute("count",this.getAttribute("badge")||"0");const i=this.getAttribute("badge-type")||"number";s.setAttribute("type",i),this.hasAttribute("badge-max-count")&&s.setAttribute("max-count",this.getAttribute("badge-max-count")),s.setAttribute("variant",this.getAttribute("badge-variant")||"danger"),this.hasAttribute("badge-text")&&(s.textContent=this.getAttribute("badge-text"));const n="xl"===e||"2xl"===e?"m":"s";s.setAttribute("size",n),t.append(s),this.append(t)}}}customElements.get("db-avatar")||customElements.define("db-avatar",DbAvatar);const ke="designbase-wc-badge";class DbBadge extends HTMLElement{static get observedAttributes(){return["variant","size","type","count","max-count","disabled"]}get variant(){return this.getAttribute("variant")||"primary"}set variant(e){this.setAttribute("variant",e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}get type(){return this.getAttribute("type")||"text"}set type(e){this.setAttribute("type",e)}get count(){const e=this.getAttribute("count");return null===e?void 0:Number(e)}set count(e){void 0===e?this.removeAttribute("count"):this.setAttribute("count",String(e))}get maxCount(){return Number(this.getAttribute("max-count")||99)}set maxCount(e){this.setAttribute("max-count",String(e))}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}connectedCallback(){this.syncAttributes()}attributeChangedCallback(e,t,s){"count"!==e&&"max-count"!==e&&"type"!==e||this.syncContent(),this.syncAttributes()}syncAttributes(){this.classList.add(ke),this.setAttribute("aria-disabled",String(this.disabled)),this.syncEnum("variant",this.variant,T),this.syncEnum("size",this.size,B),this.syncEnum("type",this.type,F),this.classList.toggle(`${ke}--disabled`,this.disabled),this.syncContent()}syncContent(){"number"!==this.type||void 0===this.count?"dot"===this.type&&(this.textContent=""):this.textContent=this.count>this.maxCount?`${this.maxCount}+`:String(this.count)}syncEnum(e,t,s){s.forEach(e=>this.classList.remove(`${ke}--${e}`)),s.includes(t)?this.classList.add(`${ke}--${t}`):"type"===e&&this.classList.add(`${ke}--text`)}}customElements.get("db-badge")||customElements.define("db-badge",DbBadge);const Ne={primary:"primary",secondary:"secondary",outline:"tertiary",ghost:"ghost"},Le={s:"s",sm:"s",m:"m",md:"m",l:"l",lg:"l"};class DbBanner extends HTMLElement{static get observedAttributes(){return["title","description","icon","image","image-alt","actions","size","variant","background-image","href","target","clickable","closable","close-label"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}parseActions(){const e=this.getAttribute("actions");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}getIconSize(e){return"s"===e?16:"l"===e?24:20}getActionIconSize(e){return"s"===e?16:"l"===e?20:18}resolveIconName(e){if(e)return e in{close:1,"info-filled":1}?e:void 0}createActionControl(e,t,s,i){const n=this.resolveIconName(e.icon),a=Boolean(e.iconOnly&&n);if(e.href){const t=document.createElement("a");return t.className=`designbase-wc-button designbase-wc-button--${s} designbase-wc-button--${i}`,a&&t.classList.add("designbase-wc-button--icon-only"),t.href=e.href,t.setAttribute("aria-label",e.text),t.addEventListener("click",e=>e.stopPropagation()),a&&n?t.append(createDbIcon(n,this.getActionIconSize(i))):t.textContent=e.text,e.external&&(t.target="_blank",t.rel="noopener noreferrer"),t}const r=document.createElement("db-button");return r.setAttribute("variant",s),r.setAttribute("size",i),a?(r.setAttribute("icon-only",""),r.setAttribute("aria-label",e.text),n&&r.append(createDbIcon(n,this.getActionIconSize(i)))):r.textContent=e.text,(s=>{s.addEventListener("click",e=>e.stopPropagation()),s.addEventListener("db-click",s=>{s.stopPropagation(),this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0,detail:{index:t,action:e}}))})})(r),r}render(){const e=this.getAttribute("title")||"",t=this.getAttribute("description")||"",s=this.getAttribute("icon"),i=this.getAttribute("image"),n=this.getAttribute("image-alt")||e||"Banner image",a=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"primary",o=this.getAttribute("background-image"),l=this.parseActions(),d=this.getAttribute("href"),h=this.hasAttribute("clickable")||Boolean(d),u=this.hasAttribute("closable");if(this.className=["designbase-wc-banner",`designbase-wc-banner--${a}`,`designbase-wc-banner--${r}`,h&&"designbase-wc-banner--clickable"].filter(Boolean).join(" "),this.replaceChildren(),this.setupInteractivity(h,d),"image"===r&&o){const e=document.createElement("div");e.className="designbase-wc-banner__background",e.style.backgroundImage=`url(${o})`,e.style.backgroundSize="cover",e.style.backgroundPosition="center",e.style.backgroundRepeat="no-repeat",this.append(e);const t=document.createElement("div");t.className="designbase-wc-banner__overlay",this.append(t)}const b=document.createElement("div");if(b.className="designbase-wc-banner__container",s){const e=document.createElement("div");e.className="designbase-wc-banner__icon",e.append(createDbIcon(s,this.getIconSize(a))),b.append(e)}if(i){const e=document.createElement("div");e.className="designbase-wc-banner__image";const t=document.createElement("img");t.src=i,t.alt=n,e.append(t),b.append(e)}const p=document.createElement("div");if(p.className="designbase-wc-banner__content",e){const t=document.createElement("h3");t.className="designbase-wc-banner__title",t.textContent=e,p.append(t)}if(t){const e=document.createElement("p");e.className="designbase-wc-banner__description",e.textContent=t,p.append(e)}if(b.append(p),l.length>0){const e=document.createElement("div");e.className="designbase-wc-banner__actions",l.forEach((t,s)=>{const i=Ne[t.variant||"primary"]||"primary",n=Le[t.size||"sm"]||"s";e.append(this.createActionControl(t,s,i,n))}),b.append(e)}u&&b.append(this.createCloseButton(a)),this.append(b)}createCloseButton(e){const t=this.getAttribute("close-label")||"Close",s=document.createElement("button");return s.type="button",s.className="designbase-wc-banner__close",s.setAttribute("aria-label",t),s.append(createDbIcon("close","l"===e?20:16)),s.addEventListener("click",e=>{e.stopPropagation(),this.handleClose()}),s}handleClose(){const e=new CustomEvent("db-close",{bubbles:!0,composed:!0,cancelable:!0,detail:{}});this.dispatchEvent(e)&&this.remove()}setupInteractivity(e,t){if(this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0),this.keydownHandler&&(this.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=void 0),!e)return this.removeAttribute("role"),void this.removeAttribute("tabindex");this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const activate=()=>{const e=this.getAttribute("target")||"_self";this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0,detail:{href:t}})),t&&("_blank"===e?window.open(t,"_blank","noopener,noreferrer"):window.location.assign(t))};this.clickHandler=()=>activate(),this.keydownHandler=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),activate())},this.addEventListener("click",this.clickHandler),this.addEventListener("keydown",this.keydownHandler)}}customElements.get("db-banner")||customElements.define("db-banner",DbBanner);const ze={s:12,m:14,l:16};class DbBreadcrumbs extends HTMLElement{constructor(){super(...arguments),this.openMenuId=null,this.onDocumentMouseDown=null,this.onDocumentKeyDown=null}static get observedAttributes(){return["items","size","variant","breadcrumb-style","max-items","menu-dropdown","max-label-length"]}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}connectedCallback(){this.render()}disconnectedCallback(){this.removeGlobalListeners()}attributeChangedCallback(){this.isConnected&&(this.openMenuId=null,this.render())}get menuDropdown(){return this.hasAttribute("menu-dropdown")}get maxLabelLength(){const e=Number(this.getAttribute("max-label-length"));return Number.isFinite(e)&&e>0?e:12}get resolvedVariant(){return this.getAttribute("variant")||this.getAttribute("breadcrumb-style")||"default"}itemId(e,t){return e.id||`item-${t}`}menuItemId(e,t){return e.id||`menu-${t}`}visibleItems(){const e=this.items,t=Number(this.getAttribute("max-items")||0);if(!t||e.length<=t)return e;const s=e[0],i=e[e.length-1],n=e.slice(1,-1),a=t-2;if(a<=0)return[s,i];const r=Math.floor(n.length/2)-Math.floor(a/2);return[s,...n.slice(r,r+a),i]}shouldUseDropdown(e){return this.menuDropdown&&Boolean(e.menu?.length)}closeMenu(){this.openMenuId&&(this.openMenuId=null,this.removeGlobalListeners(),this.updateDropdownStates())}openMenu(e){this.openMenuId=e,this.addGlobalListeners(),this.updateDropdownStates()}toggleMenu(e){this.openMenuId===e?this.closeMenu():this.openMenu(e)}addGlobalListeners(){this.onDocumentMouseDown||(this.onDocumentMouseDown=e=>{this.contains(e.target)||this.closeMenu()},this.onDocumentKeyDown=e=>{"Escape"===e.key&&this.closeMenu()},document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("keydown",this.onDocumentKeyDown))}removeGlobalListeners(){this.onDocumentMouseDown&&(document.removeEventListener("mousedown",this.onDocumentMouseDown),this.onDocumentMouseDown=null),this.onDocumentKeyDown&&(document.removeEventListener("keydown",this.onDocumentKeyDown),this.onDocumentKeyDown=null)}updateDropdownStates(){this.querySelectorAll("[data-breadcrumb-dropdown]").forEach(e=>{const t=e.dataset.breadcrumbDropdown||"",s=this.openMenuId===t;e.classList.toggle("designbase-wc-breadcrumbs__dropdown--open",s);const i=e.querySelector(".designbase-wc-breadcrumbs__trigger");i&&i.setAttribute("aria-expanded",String(s))})}createLabel(e){const t=function formatBreadcrumbLabel(e,t){return!t||e.length<=t?{text:e,full:e,truncated:!1}:{text:`${e.slice(0,t)}...`,full:e,truncated:!0}}(e,this.maxLabelLength),s=document.createElement("span");return s.className="designbase-wc-breadcrumbs__label",s.textContent=t.text,t.truncated&&s.setAttribute("title",t.full),s}createMenuItem(e,t,s){const i=e.href&&!e.disabled?document.createElement("a"):document.createElement("button");if(i.className=["designbase-wc-breadcrumbs__menu-item",e.active&&"designbase-wc-breadcrumbs__menu-item--active",e.disabled&&"designbase-wc-breadcrumbs__menu-item--disabled"].filter(Boolean).join(" "),i.setAttribute("role","menuitem"),i instanceof HTMLButtonElement?(i.type="button",i.disabled=Boolean(e.disabled)):i.href=e.href||"#",e.icon){const t=document.createElement("span");t.className="designbase-wc-breadcrumbs__icon",t.append(createDbIcon(e.icon,16)),i.append(t)}return i.append(this.createLabel(e.label)),i.addEventListener("click",i=>{e.disabled?i.preventDefault():(this.closeMenu(),this.dispatchEvent(new CustomEvent("db-menu-click",{detail:{menuItem:{...e,id:this.menuItemId(e,t)},parentItem:s},bubbles:!0,composed:!0})))}),i}createDropdownItem(e,t,s,i){const n=this.itemId(e,t),a=this.openMenuId===n,r=document.createElement("div");r.className=["designbase-wc-breadcrumbs__dropdown",a&&"designbase-wc-breadcrumbs__dropdown--open"].filter(Boolean).join(" "),r.dataset.breadcrumbDropdown=n;const o=document.createElement("button");if(o.type="button",o.className=["designbase-wc-breadcrumbs__trigger",(s||e.active)&&"designbase-wc-breadcrumbs__trigger--active",e.disabled&&"designbase-wc-breadcrumbs__trigger--disabled"].filter(Boolean).join(" "),o.setAttribute("aria-haspopup","menu"),o.setAttribute("aria-expanded",String(a)),o.disabled=Boolean(e.disabled),e.icon){const t=document.createElement("span");t.className="designbase-wc-breadcrumbs__icon",t.append(createDbIcon(e.icon,16)),o.append(t)}o.append(this.createLabel(e.label));const l=document.createElement("span");l.className="designbase-wc-breadcrumbs__chevron",l.setAttribute("aria-hidden","true"),l.append(createDbIcon("chevron-down",i)),o.append(l),o.addEventListener("click",t=>{t.stopPropagation(),e.disabled||this.toggleMenu(n)}),r.append(o);const d=document.createElement("div");return d.className="designbase-wc-breadcrumbs__menu",d.setAttribute("role","menu"),e.menu?.forEach((t,s)=>{d.append(this.createMenuItem(t,s,e))}),r.append(d),r}createStandardItem(e,t,s){const i=!e.href||s||e.disabled?document.createElement("span"):document.createElement("a");if(i.className=i instanceof HTMLAnchorElement?["designbase-wc-breadcrumbs__link",e.active&&"designbase-wc-breadcrumbs__link--active",e.disabled&&"designbase-wc-breadcrumbs__link--disabled"].filter(Boolean).join(" "):["designbase-wc-breadcrumbs__text",s&&"designbase-wc-breadcrumbs__text--active",e.disabled&&"designbase-wc-breadcrumbs__text--disabled"].filter(Boolean).join(" "),e.icon){const t=document.createElement("span");t.className="designbase-wc-breadcrumbs__icon",t.append(createDbIcon(e.icon,16)),i.append(t)}return i.append(this.createLabel(e.label)),i instanceof HTMLAnchorElement&&(i.href=e.href||"#"),i.addEventListener("click",t=>{(e.disabled||e.active||s)&&t.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{detail:{item:e},bubbles:!0,composed:!0}))}),i}render(){const e=this.getAttribute("size")||"m",t=this.resolvedVariant,s=this.visibleItems(),i=s.length<this.items.length,n=ze[e]||14;this.className=["designbase-wc-breadcrumbs",`designbase-wc-breadcrumbs--${e}`,`designbase-wc-breadcrumbs--${t}`,i&&"designbase-wc-breadcrumbs--collapsed"].filter(Boolean).join(" "),this.setAttribute("role","navigation"),this.setAttribute("aria-label","브레드크럼 네비게이션"),this.replaceChildren();const a=document.createElement("ol");a.className="designbase-wc-breadcrumbs__list",s.forEach((e,t)=>{const i=t===s.length-1,r=document.createElement("li");if(r.className="designbase-wc-breadcrumbs__item",this.shouldUseDropdown(e)?r.append(this.createDropdownItem(e,t,i,n)):r.append(this.createStandardItem(e,t,i)),!i){const e=document.createElement("span");e.className="designbase-wc-breadcrumbs__separator",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("chevron-right",16)),r.append(e)}a.append(r)}),this.append(a)}}customElements.get("db-breadcrumbs")||customElements.define("db-breadcrumbs",DbBreadcrumbs);class CleanupBag{constructor(){this.items=[]}add(e){this.items.push(e)}listen(e,t,s,i){e.addEventListener(t,s,i),this.items.push(()=>e.removeEventListener(t,s,i))}timeout(e,t){const s=window.setTimeout(e,t);return this.items.push(()=>window.clearTimeout(s)),s}interval(e,t){const s=window.setInterval(e,t);return this.items.push(()=>window.clearInterval(s)),s}observe(e){return this.items.push(()=>e.disconnect()),e}run(){const e=this.items;this.items=[];for(const t of e)try{t()}catch{}}}class DbCheckbox extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.userInteracted=!1,this.cleanups=new CleanupBag,this.handleChange=()=>{if(!this.input)return;this.userInteracted=!0;const e=this.input.checked;this.toggleAttribute("checked",e),this.indeterminate&&(this.removeAttribute("indeterminate"),this.input.indeterminate=!1),this.syncVisual(),this.syncClasses(),this.syncValidity(),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:e,selected:e},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","indeterminate","size","disabled","readonly","required","name","value","has-label"]}get checked(){return this.input?.checked??(this.hasAttribute("checked")||this.hasAttribute("selected"))}set checked(e){this.toggleAttribute("checked",e),this.input&&(this.input.checked=e,this.syncVisual(),this.syncClasses())}get indeterminate(){return this.hasAttribute("indeterminate")}set indeterminate(e){this.toggleAttribute("indeterminate",e),this.input&&(this.input.indeterminate=e,this.syncVisual(),this.syncClasses())}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e),this.input&&(this.input.disabled=e),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(e){this.toggleAttribute("readonly",e),this.input&&(this.input.readOnly=e),this.syncClasses()}get required(){return this.hasAttribute("required")}set required(e){this.toggleAttribute("required",e),this.input&&(this.input.required=e)}get size(){return coerceToContract(this.getAttribute("size"),U,"m")}set size(e){this.setAttribute("size",e)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState();const e=this.input?.form;e&&this.cleanups.listen(e,"reset",()=>{window.setTimeout(()=>this.syncAfterReset(),0)})}disconnectedCallback(){this.cleanups.run()}syncAfterReset(){this.input&&(this.toggleAttribute("checked",this.input.checked),this.removeAttribute("selected"),this.syncVisual(),this.syncClasses())}attributeChangedCallback(e){if(this.built)return"checked"===e||"selected"===e?(this.input&&(this.input.checked=this.hasAttribute("checked")||this.hasAttribute("selected")),this.syncVisual(),void this.syncClasses()):void this.syncState()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}build(){for(this.root=document.createElement("label"),this.root.className="designbase-wc-checkbox",this.input=document.createElement("input"),this.input.type="checkbox",this.input.className="designbase-wc-checkbox__input",this.visual=document.createElement("span"),this.visual.className="designbase-wc-checkbox__visual",this.visual.setAttribute("aria-hidden","true"),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-checkbox__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(this.input,this.visual,this.labelEl),this.appendChild(this.root),this.input.addEventListener("change",this.handleChange),this.built=!0}syncValidity(){if(!this.input)return;const e=!this.input.checkValidity();this.input.setAttribute("aria-invalid",String(e)),this.classList.toggle("designbase-wc-checkbox--invalid",e)}syncState(){if(!this.root||!this.input||!this.visual)return;const e=this.hasAttribute("checked")||this.hasAttribute("selected")||!this.userInteracted&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected")),t=this.hasAttribute("indeterminate");this.input.checked=e,this.input.defaultChecked=this.hasAttribute("default-checked")||this.hasAttribute("default-selected")||this.hasAttribute("checked")||this.hasAttribute("selected"),this.input.indeterminate=t,this.input.disabled=this.disabled,this.input.readOnly=this.readOnly,this.input.required=this.required,this.input.name=this.getAttribute("name")||"",this.input.value=this.getAttribute("value")||"",this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncVisual(),this.syncClasses()}syncVisual(){if(this.visual&&this.input){if(this.visual.replaceChildren(),this.input.indeterminate){const e=document.createElement("span");return e.className="designbase-wc-checkbox__indeterminate-icon",e.appendChild(createDbIcon("minus",16)),void this.visual.appendChild(e)}if(this.input.checked){const e=document.createElement("span");e.className="designbase-wc-checkbox__check-icon",e.appendChild(createDbIcon("done",16)),this.visual.appendChild(e)}}}syncClasses(){if(!this.root||!this.input)return;const e=U.includes(this.size)?this.size:"m",t=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim());this.root.className=["designbase-wc-checkbox",`designbase-wc-checkbox--${e}`,this.input.checked&&"designbase-wc-checkbox--selected",this.input.indeterminate&&"designbase-wc-checkbox--indeterminate",this.disabled&&"designbase-wc-checkbox--disabled",this.readOnly&&"designbase-wc-checkbox--readonly",!t&&"designbase-wc-checkbox--no-label"].filter(Boolean).join(" ")}}customElements.get("db-checkbox")||customElements.define("db-checkbox",DbCheckbox);class DbChip extends HTMLElement{static get observedAttributes(){return["label","size","variant","deletable","disabled","selected","full-width","clickable","start-icon","end-icon"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}iconSize(e){return"s"===e?12:"l"===e?20:16}render(){const e=this.getAttribute("label")||this.textContent?.trim()||"",t=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default",i=this.hasAttribute("disabled"),n=this.hasAttribute("deletable"),a=this.hasAttribute("selected"),r=this.hasAttribute("full-width"),o=this.hasAttribute("clickable"),l=this.getAttribute("start-icon"),d=this.getAttribute("end-icon"),h=V.includes(t)?t:"m",u=H.includes(s)?s:"default",b=this.iconSize(h);if(this.className=["designbase-wc-chip",`designbase-wc-chip--${h}`,`designbase-wc-chip--${u}`,n&&"designbase-wc-chip--deletable",i&&"designbase-wc-chip--disabled",a&&"designbase-wc-chip--selected",o&&"designbase-wc-chip--clickable",r&&"designbase-wc-chip--full-width"].filter(Boolean).join(" "),this.replaceChildren(),o&&!i?(this.setAttribute("role","button"),this.tabIndex=0,this.setAttribute("aria-pressed",String(a))):(this.removeAttribute("role"),this.removeAttribute("tabindex"),this.removeAttribute("aria-pressed")),l&&isDbIconName(l)){const e=document.createElement("span");e.className="designbase-wc-chip__start-icon",e.append(createDbIcon(l,b)),this.append(e)}const p=document.createElement("span");if(p.className="designbase-wc-chip__label",p.textContent=e,this.append(p),d&&isDbIconName(d)&&!n){const e=document.createElement("span");e.className="designbase-wc-chip__end-icon",e.append(createDbIcon(d,b)),this.append(e)}if(n){const t=document.createElement("button");t.type="button",t.className="designbase-wc-chip__delete-button",t.disabled=i,t.setAttribute("aria-label",`${e} 삭제`),t.append(createDbIcon("close",b)),t.addEventListener("click",e=>{e.stopPropagation(),i||this.dispatchEvent(new CustomEvent("db-delete",{bubbles:!0,composed:!0}))}),this.append(t)}this.onclick=()=>{!i&&o&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.onkeydown=e=>{"Enter"!==e.key&&" "!==e.key||i||!o||(e.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})))}}}customElements.get("db-chip")||customElements.define("db-chip",DbChip);class DbContainer extends HTMLElement{static get observedAttributes(){return["size","padding","max-width","full-width"]}connectedCallback(){this.syncClasses()}attributeChangedCallback(){this.syncClasses()}syncClasses(){const e=this.getAttribute("size")||"l",t=this.getAttribute("padding")||"m",s=this.getAttribute("max-width");this.className=["designbase-wc-container",`designbase-wc-container--size-${ne.includes(e)?e:"l"}`,ae.includes(t)&&`designbase-wc-container--padding-${t}`,this.hasAttribute("full-width")&&"designbase-wc-container--full-width"].filter(Boolean).join(" "),this.hasAttribute("full-width")?this.style.maxWidth="100%":s?this.style.maxWidth=s.includes("px")||s.includes("%")?s:`${s}px`:this.style.removeProperty("max-width")}}customElements.get("db-container")||customElements.define("db-container",DbContainer);const Ie=["a[href]","area[href]","button","input","select","textarea","details > summary:first-of-type","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function isTabbable(e){return!(!(e instanceof HTMLElement)||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-hidden")||e.tabIndex<0||"function"==typeof e.closest&&e.closest("[inert]")||e.hidden||!e.offsetParent&&"fixed"!==getComputedStyle(e).position||"hidden"===getComputedStyle(e).visibility)}function getTabbables(e){return Array.from(e.querySelectorAll(Ie)).filter(isTabbable)}function createFocusTrap(e,t={}){let s=!1,i=null;const handleKeyDown=t=>{if("Tab"!==t.key||!s)return;const i=getTabbables(e);if(0===i.length)return t.preventDefault(),void e.focus();const n=i[0],a=i[i.length-1],r=document.activeElement;if(!r||!e.contains(r))return t.preventDefault(),void(t.shiftKey?a:n).focus();t.shiftKey&&r===n?(t.preventDefault(),a.focus()):t.shiftKey||r!==a||(t.preventDefault(),n.focus())},handleFocusIn=t=>{if(!s)return;const i=t.target;i&&e.contains(i)||(getTabbables(e)[0]||e).focus()};return{get active(){return s},activate(){s||(s=!0,i=t.returnFocus??document.activeElement,e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),document.addEventListener("keydown",handleKeyDown,!0),document.addEventListener("focusin",handleFocusIn,!0),((()=>{const{initialFocus:s}=t;if("function"==typeof s)return s();if(s)return s;const i=e.querySelector("[autofocus]");return i&&isTabbable(i)?i:getTabbables(e)[0]||null})()||e).focus())},deactivate(){s&&(s=!1,document.removeEventListener("keydown",handleKeyDown,!0),document.removeEventListener("focusin",handleFocusIn,!0),!1!==t.restoreFocus&&(i&&i.isConnected&&"function"==typeof i.focus&&i.focus(),i=null))}}}let Me=0,De="",Te="";function lockScroll(){if("undefined"==typeof document)return;if(Me+=1,Me>1)return;const{body:e}=document;De=e.style.overflow,Te=e.style.paddingRight;const t=function scrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth}();if(t>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+t}px`}e.style.overflow="hidden"}function unlockScroll(){if("undefined"==typeof document)return;if(0===Me)return;if(Me-=1,Me>0)return;const{body:e}=document;e.style.overflow=De,e.style.paddingRight=Te,De="",Te=""}class DbDrawer extends HTMLElement{constructor(){super(...arguments),this.isMounted=!1,this.isActive=!1,this.scrollLocked=!1,this.keyHandler=null}static get observedAttributes(){return["open","title","position","size","show-close-button","close-on-backdrop-click","close-on-escape","animation-duration","show-overlay","overlay-closable","z-index","trap-focus","drawer-id"]}connectedCallback(){this.style.display="contents",this.render(),this.syncOpenState()}disconnectedCallback(){this.clearTimers(),this.detachEscape(),this.focusTrap?.deactivate(),this.focusTrap=void 0,this.root?.remove(),this.root=void 0,this.releaseScrollLock()}releaseScrollLock(){this.scrollLocked&&(this.scrollLocked=!1,unlockScroll())}attributeChangedCallback(e){this.isConnected&&("open"!==e?(this.render(),this.isMounted&&this.syncActiveClasses()):this.syncOpenState())}isOpenRequested(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}clearTimers(){null!=this.enterFrame&&(cancelAnimationFrame(this.enterFrame),this.enterFrame=void 0),this.exitTimer&&(clearTimeout(this.exitTimer),this.exitTimer=void 0)}attachEscape(){this.keyHandler||(this.keyHandler=e=>{"Escape"===e.key&&"false"!==this.getAttribute("close-on-escape")&&this.close()},document.addEventListener("keydown",this.keyHandler))}detachEscape(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}close(){this.setAttribute("open","false"),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}collectChildren(){return Array.from(this.children).filter(e=>!e.hasAttribute("data-wc-internal"))}syncOpenState(){const e=this.isOpenRequested(),t=Number(this.getAttribute("animation-duration")||300);if(this.clearTimers(),e)return this.render(),this.isMounted=!0,this.isActive=!1,this.syncActiveClasses(),this.root&&!this.root.isConnected&&document.body.append(this.root),this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=void 0,this.isActive=!0,this.syncActiveClasses(),"false"!==this.getAttribute("trap-focus")&&this.container&&(this.focusTrap=createFocusTrap(this.container),this.focusTrap.activate())})}),this.scrollLocked||(lockScroll(),this.scrollLocked=!0),void this.attachEscape();this.isActive=!1,this.syncActiveClasses(),this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,this.isMounted=!1,this.syncActiveClasses(),this.root?.remove(),this.releaseScrollLock(),this.detachEscape(),this.focusTrap?.deactivate(),this.focusTrap=void 0},t),this.detachEscape()}syncActiveClasses(){this.root&&(this.root.classList.toggle("designbase-wc-drawer--open",this.isActive),this.root.classList.toggle("designbase-wc-drawer--closing",this.isMounted&&!this.isActive),this.overlay?.classList.toggle("designbase-wc-drawer__overlay--open",this.isActive),this.container?.classList.toggle("designbase-wc-drawer__container--open",this.isActive))}render(){const e=re.includes(this.getAttribute("position")||"right")&&this.getAttribute("position")||"right",t=oe.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",s=this.getAttribute("title"),i="false"!==this.getAttribute("show-close-button"),n="false"!==this.getAttribute("show-overlay"),a=this.getAttribute("animation-duration")||"300",r=this.getAttribute("z-index")||"1000",o=this.getAttribute("drawer-id")||"drawer",l=this.collectChildren();if(this.root||(this.root=document.createElement("div"),this.root.setAttribute("data-wc-internal",""),this.overlay=document.createElement("div"),this.overlay.className="designbase-wc-drawer__overlay",this.overlay.setAttribute("aria-hidden","true"),this.overlay.addEventListener("click",e=>{if(e.target!==this.overlay)return;const t="false"!==this.getAttribute("overlay-closable"),s="false"!==this.getAttribute("close-on-backdrop-click");t&&s&&this.close()}),this.container=document.createElement("div"),this.container.className=`designbase-wc-drawer__container designbase-wc-drawer__container--${e}`,this.container.setAttribute("role","dialog"),this.container.setAttribute("aria-modal","true"),this.container.tabIndex=-1,this.container.addEventListener("click",e=>e.stopPropagation()),this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-drawer__content",this.container.append(this.contentEl)),this.root.className=["designbase-wc-drawer",`designbase-wc-drawer--${e}`,`designbase-wc-drawer--${t}`].join(" "),this.root.style.setProperty("--drawer-animation-duration",`${a}ms`),this.root.style.setProperty("--drawer-z-index",r),this.container.className=`designbase-wc-drawer__container designbase-wc-drawer__container--${e}`,this.container.id=o,s?this.container.setAttribute("aria-labelledby",`${o}-title`):this.container.removeAttribute("aria-labelledby"),this.contentEl.id=`${o}-content`,this.root.replaceChildren(),n&&this.overlay&&this.root.append(this.overlay),Boolean(s)||i){const e=document.createElement("div");if(e.className="designbase-wc-drawer__header",s){const t=document.createElement("h2");t.className="designbase-wc-drawer__title",t.id=`${o}-title`,t.textContent=s,e.append(t)}if(i){const t=document.createElement("db-button");t.className="designbase-wc-drawer__close-button",t.setAttribute("variant","ghost"),t.setAttribute("size","s"),t.setAttribute("icon-only",""),t.setAttribute("start-icon","close"),t.setAttribute("aria-label","닫기"),t.addEventListener("db-click",e=>{e.stopPropagation(),this.close()}),e.append(t)}this.container.replaceChildren(e,this.contentEl)}else this.container.replaceChildren(this.contentEl);this.contentEl.replaceChildren(...l),this.root.append(this.container),this.isMounted&&!this.root.isConnected&&document.body.append(this.root)}}customElements.get("db-drawer")||customElements.define("db-drawer",DbDrawer);class DbDropdown extends HTMLElement{constructor(){super(...arguments),this.focusedIndex=-1,this.onTriggerActivate=null,this.lastTriggerSignature="",this.handleTriggerKeyDown=e=>{if(("Enter"===e.key||" "===e.key||"ArrowDown"===e.key)&&!this.open)return e.preventDefault(),this.open=!0,requestAnimationFrame(()=>this.focusItem(0)),void this.render();"Escape"===e.key&&this.open&&(e.preventDefault(),this.open=!1,this.render())},this.handleDocumentKeyDown=e=>{if(!this.open)return;if("Escape"===e.key)return e.preventDefault(),this.open=!1,this.render(),void this.triggerWrap?.querySelector("[aria-haspopup]")?.focus();const t=this.enabledItems();if(!t.length)return;const s=t.findIndex(e=>this.parsedItems.indexOf(e)===this.focusedIndex);switch(e.key){case"ArrowDown":e.preventDefault(),this.focusItem(s<0?0:this.parsedItems.indexOf(t[(s+1)%t.length]));break;case"ArrowUp":e.preventDefault(),this.focusItem(s<0?0:this.parsedItems.indexOf(t[(s-1+t.length)%t.length]));break;case"Home":e.preventDefault(),this.focusItem(this.parsedItems.indexOf(t[0]));break;case"End":e.preventDefault(),this.focusItem(this.parsedItems.indexOf(t[t.length-1]));break;case"Enter":case" ":{e.preventDefault();const t=this.parsedItems[this.focusedIndex];!t||t.divider||t.disabled||this.selectItem(t);break}}},this.handleDocumentMouseDown=e=>{this.open&&(this.contains(e.target)||(this.open=!1,this.render()))}}static get observedAttributes(){return["options","items","placeholder","label","value","size","placement","full-width","disabled","open","trigger-variant","trigger-icon","icon-only"]}get parsedItems(){const e=this.getAttribute("items");if(e)try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return(this.getAttribute("options")||"").split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({id:`option-${t}`,label:e}))}get options(){return this.parsedItems.map(e=>e.label||e.id)}set options(e){this.setAttribute("options",Array.isArray(e)?e.join(","):e)}get items(){return this.parsedItems}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}get value(){return this.getAttribute("value")||""}set value(e){e?this.setAttribute("value",e):this.removeAttribute("value")}get open(){return this.hasAttribute("open")}set open(e){const t=this.open;this.toggleAttribute("open",e),t!==e&&this.dispatchEvent(new CustomEvent("db-open",{detail:{open:e},bubbles:!0,composed:!0}))}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}get placement(){return this.getAttribute("placement")||"bottom-left"}set placement(e){this.setAttribute("placement",e)}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(e){e?this.setAttribute("placeholder",e):this.removeAttribute("placeholder")}get label(){return this.getAttribute("label")||""}set label(e){e?this.setAttribute("label",e):this.removeAttribute("label")}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(e){this.toggleAttribute("full-width",e)}connectedCallback(){requestAnimationFrame(()=>this.render()),document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown)}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindTrigger()}attributeChangedCallback(e){this.isConnected&&("open"!==e||this.open||(this.focusedIndex=-1),this.render())}resolvedSize(){return le.includes(this.size)?this.size:"m"}resolvedPlacement(){return ce.includes(this.placement)?this.placement:"bottom-left"}menuItemIconSize(){const e=this.resolvedSize();return"s"===e?14:"l"===e?18:16}triggerLabel(){return this.label?this.label:this.placeholder?this.placeholder:this.value?this.value:"메뉴"}enabledItems(){return this.parsedItems.filter(e=>!e.disabled&&!e.divider)}collectTriggerChildren(){const isInternalNode=e=>e.hasAttribute("data-wc-internal")||e===this.triggerWrap||e===this.menu||e===this.defaultTrigger,e=Array.from(this.children).filter(e=>!isInternalNode(e));return e.length>0?e:Array.from(this.triggerWrap?.children||[]).filter(e=>!isInternalNode(e))}hasCustomTrigger(){return this.collectTriggerChildren().length>0}bindTrigger(){this.triggerWrap&&(this.unbindTrigger(),this.onTriggerActivate=e=>{this.disabled||(e.preventDefault(),e.stopPropagation(),this.toggleOpen())},this.triggerWrap.addEventListener("click",this.onTriggerActivate),this.triggerWrap.addEventListener("keydown",this.handleTriggerKeyDown))}unbindTrigger(){this.triggerWrap&&this.onTriggerActivate&&this.triggerWrap.removeEventListener("click",this.onTriggerActivate),this.triggerWrap&&this.triggerWrap.removeEventListener("keydown",this.handleTriggerKeyDown),this.onTriggerActivate=null}toggleOpen(){this.disabled||(this.open=!this.open,this.open&&requestAnimationFrame(()=>this.focusItem(0)),this.render())}triggerSignature(){return[this.resolvedSize(),this.getAttribute("trigger-variant")||"tertiary",this.hasAttribute("icon-only")?"1":"0",this.getAttribute("trigger-icon")||"",this.fullWidth?"1":"0"].join("|")}renderDefaultTrigger(){const e=this.resolvedSize(),t=this.getAttribute("trigger-variant")||"tertiary",s=de.includes(t)?t:"tertiary",i=this.hasAttribute("icon-only"),n=this.getAttribute("trigger-icon"),a=document.createElement("db-button");if(a.setAttribute("type","button"),a.setAttribute("variant",s),a.setAttribute("size",e),a.className="designbase-wc-dropdown__trigger",a.setAttribute("aria-haspopup","menu"),a.setAttribute("aria-label",this.triggerLabel()),this.fullWidth&&a.setAttribute("full-width",""),i)a.setAttribute("icon-only",""),a.setAttribute("start-icon",n&&isDbIconName(n)?n:"edit"),a.removeAttribute("end-icon");else{a.removeAttribute("icon-only"),n&&isDbIconName(n)?a.setAttribute("start-icon",n):a.removeAttribute("start-icon");const e=document.createElement("span");e.className="designbase-wc-dropdown__trigger-label",e.textContent=this.triggerLabel(),a.append(e),a.setAttribute("end-icon","chevron-down")}return a}syncDefaultTriggerState(e){e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-label",this.triggerLabel()),e.classList.toggle("designbase-wc-dropdown__trigger--open",this.open),this.disabled?e.setAttribute("disabled",""):e.removeAttribute("disabled");const t=e.querySelector(".designbase-wc-dropdown__trigger-label");t&&(t.textContent=this.triggerLabel())}ensureStructure(){this.triggerWrap||(this.triggerWrap=document.createElement("div"),this.triggerWrap.className="designbase-wc-dropdown__trigger-wrap",this.triggerWrap.setAttribute("data-wc-internal","")),this.menu||(this.menu=document.createElement("div"),this.menu.className="designbase-wc-dropdown__menu",this.menu.setAttribute("data-wc-internal",""),this.menu.setAttribute("role","menu"));const e=this.triggerWrap,t=this.menu;e&&t&&(this.contains(e)||this.append(e),e.contains(t)||e.append(t),Array.from(this.children).forEach(s=>{s===e||s.hasAttribute("data-wc-internal")||e.insertBefore(s,t)}))}renderTrigger(){const e=this.triggerWrap,t=this.menu;if(!e||!t)return;const s=this.collectTriggerChildren();s.length>0?(this.defaultTrigger?.remove(),this.defaultTrigger=void 0,Array.from(e.children).filter(e=>e!==t&&e!==this.defaultTrigger).forEach(e=>e.remove()),s.forEach(s=>{s.setAttribute("aria-haspopup","menu"),s.setAttribute("aria-expanded",String(this.open)),s.classList.toggle("designbase-wc-dropdown__trigger--open",this.open),e.insertBefore(s,t)})):(Array.from(e.children).filter(e=>e!==t&&e!==this.defaultTrigger).forEach(e=>e.remove()),this.defaultTrigger&&this.triggerSignature()===this.lastTriggerSignature||(this.defaultTrigger?.remove(),this.defaultTrigger=this.renderDefaultTrigger(),this.lastTriggerSignature=this.triggerSignature(),e.insertBefore(this.defaultTrigger,t)),this.defaultTrigger&&this.syncDefaultTriggerState(this.defaultTrigger)),this.bindTrigger()}renderMenu(){const e=this.resolvedPlacement();this.menu.className=`designbase-wc-dropdown__menu designbase-wc-dropdown__menu--${e}${this.open?" designbase-wc-dropdown__menu--open":""}`,this.menu.setAttribute("aria-hidden",String(!this.open)),this.menu.setAttribute("aria-label",this.triggerLabel()),this.menu.replaceChildren();const t=this.menuItemIconSize();this.parsedItems.forEach((e,s)=>{if(e.divider){const e=document.createElement("div");return e.className="designbase-wc-dropdown__divider",e.setAttribute("role","separator"),void this.menu?.append(e)}e.id||e.label||String(s);const i=e.label||e.id,n=Boolean(e.disabled||this.disabled),a=this.focusedIndex===s,r=document.createElement("button");if(r.type="button",r.className=["designbase-wc-dropdown__item",n&&"designbase-wc-dropdown__item--disabled",a&&"designbase-wc-dropdown__item--focused"].filter(Boolean).join(" "),r.setAttribute("role","menuitem"),r.disabled=n,r.tabIndex=a?0:-1,r.dataset.index=String(s),e.icon){const s=createDbIcon(e.icon,t);s.classList.add("designbase-wc-dropdown__item-icon"),r.append(s)}const o=document.createElement("span");o.className="designbase-wc-dropdown__item-label",o.textContent=i,r.append(o),r.addEventListener("click",t=>{t.stopPropagation(),this.selectItem(e)}),this.menu?.append(r)})}render(){const e=this.resolvedSize();this.className=["designbase-wc-dropdown",`designbase-wc-dropdown--${e}`,this.open&&"designbase-wc-dropdown--open",this.fullWidth&&"designbase-wc-dropdown--full-width",this.disabled&&"designbase-wc-dropdown--disabled"].filter(Boolean).join(" "),this.ensureStructure(),this.renderTrigger(),this.renderMenu()}selectItem(e){e.disabled||e.divider||(this.open=!1,this.focusedIndex=-1,this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e.label||e.id,id:e.id,item:e},bubbles:!0,composed:!0})),this.render(),this.triggerWrap?.querySelector("[aria-haspopup]")?.focus())}focusItem(e){const t=this.enabledItems();if(!t.length)return;const s=t[Math.max(0,Math.min(e,t.length-1))],i=this.parsedItems.indexOf(s);this.focusedIndex=i,Array.from(this.menu?.querySelectorAll(".designbase-wc-dropdown__item")||[]).forEach(e=>{const t=Number(e.dataset.index)===i;e.classList.toggle("designbase-wc-dropdown__item--focused",t),e.tabIndex=t?0:-1,t&&e.focus()})}}customElements.get("db-dropdown")||customElements.define("db-dropdown",DbDropdown);class DbEmptyState extends HTMLElement{static get observedAttributes(){return["variant","size","title","description","action-text","secondary-action-text","image","image-alt"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getIconName(e){return"no-results"===e?"search":"no-access"===e?"user":"error"===e?"cloud-close":"onboarding"===e?"bulb":"plus"}render(){const e=this.getAttribute("variant")||"no-data",t=this.getAttribute("size")||"m",s=this.getAttribute("title")||"",i=this.getAttribute("description")||"",n=this.getAttribute("action-text"),a=this.getAttribute("secondary-action-text"),r=this.getAttribute("image"),o=this.getAttribute("image-alt")||s,l="s"===t?24:"l"===t?48:32;this.className=`designbase-wc-empty-state designbase-wc-empty-state--${e} designbase-wc-empty-state--${t}`,this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.replaceChildren();const d=document.createElement("div");if(d.className="designbase-wc-empty-state__content",r){const e=document.createElement("div");e.className="designbase-wc-empty-state__image";const t=document.createElement("img");t.className="designbase-wc-empty-state__image-element",t.src=r,t.alt=o,e.append(t),d.append(e)}else{const t=document.createElement("div");t.className="designbase-wc-empty-state__icon",t.append(createDbIcon(this.getIconName(e),l)),d.append(t)}const h=document.createElement("h3");if(h.className="designbase-wc-empty-state__title",h.textContent=s,d.append(h),i){const e=document.createElement("p");e.className="designbase-wc-empty-state__description",e.textContent=i,d.append(e)}if(n||a){const e=document.createElement("div");if(e.className="designbase-wc-empty-state__actions",n){const s=document.createElement("db-button");s.setAttribute("variant","primary"),s.setAttribute("size",t),s.textContent=n,s.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0}))}),e.append(s)}if(a){const s=document.createElement("db-button");s.setAttribute("variant","tertiary"),s.setAttribute("size",t),s.textContent=a,s.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-secondary-action",{bubbles:!0,composed:!0}))}),e.append(s)}d.append(e)}this.append(d)}}customElements.get("db-empty-state")||customElements.define("db-empty-state",DbEmptyState);const Be={weak:"약함",fair:"보통",good:"강함","very-strong":"아주 강함"};function getPasswordScore(e){switch(e){case"weak":return 1;case"fair":return 2;case"good":return 3;case"very-strong":return 4;default:return 0}}function getStepDecimalPlaces(e){const t=String(e),s=t.indexOf(".");return-1===s?0:t.length-s-1}function readNumericAttribute(e,t){const s=e.getAttribute(t);if(null===s||""===s)return;const i=Number(s);return Number.isFinite(i)?i:void 0}function attachNumberScrub(e,t){let s=null;const endScrub=()=>{s=null,t.onScrubStateChange?.(!1),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},handlePointerDown=i=>{if(!t.isEnabled()||!t.isInteractive()||0!==i.button)return;const n=function parseScrubNumericValue(e){const t=e.trim();if(""===t)return 0;const s=Number(t);return Number.isFinite(s)?s:null}(t.getValue());null!==n&&(s={pointerId:i.pointerId,startX:i.clientX,startValue:n,moved:!1},e.setPointerCapture(i.pointerId))},handlePointerMove=e=>{if(!s||s.pointerId!==e.pointerId)return;const i=e.clientX-s.startX;!s.moved&&Math.abs(i)<3||(s.moved||(s.moved=!0,t.onScrubStateChange?.(!0),document.body.style.cursor="ew-resize",document.body.style.userSelect="none"),e.preventDefault(),((e,i)=>{if(!s)return;const n=e-s.startX,a=t.getStep(),r=function computeScrubValue(e,t,s,i,n,a,r){const o=i*(n.shiftKey?10:n.altKey?.1:1);let l=e+Math.round(t/s)*o;void 0!==a&&(l=Math.max(a,l)),void 0!==r&&(l=Math.min(r,l));const d=getStepDecimalPlaces(o);return l=d>0?Number(l.toFixed(d)):Math.round(l),l}(s.startValue,n,t.getSensitivity(),a,i,t.getMin(),t.getMax());t.onValueChange(function formatScrubValue(e,t){const s=getStepDecimalPlaces(t);return s>0?e.toFixed(s):String(Math.round(e))}(r,a))})(e.clientX,e))},handlePointerEnd=t=>{s&&s.pointerId===t.pointerId&&(s.moved&&t.preventDefault(),e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId),endScrub())};return e.addEventListener("pointerdown",handlePointerDown),e.addEventListener("pointermove",handlePointerMove),e.addEventListener("pointerup",handlePointerEnd),e.addEventListener("pointercancel",handlePointerEnd),()=>{endScrub(),e.removeEventListener("pointerdown",handlePointerDown),e.removeEventListener("pointermove",handlePointerMove),e.removeEventListener("pointerup",handlePointerEnd),e.removeEventListener("pointercancel",handlePointerEnd)}}let Fe=0;function dbUid(e="db"){Fe+=1;const t="undefined"!=typeof globalThis?globalThis.crypto:void 0;return`${e}-${t&&"function"==typeof t.randomUUID?t.randomUUID().slice(0,8):Math.floor(4294967295*Math.random()).toString(36)}-${Fe}`}const Pe={close:"닫기","modal.close":"모달 닫기","drawer.close":"드로어 닫기","dialog.close":"대화상자 닫기","toast.close":"알림 닫기",clear:"지우기",clearAll:"모든 값 지우기",loading:"로딩 중",required:"필수",optional:"선택",error:"오류",success:"성공",warning:"경고",info:"안내",previous:"이전",next:"다음","select.placeholder":"선택하세요","select.noResults":"결과 없음","tabs.label":"탭 목록","pagination.label":"페이지 번호","search.label":"검색","media.play":"재생","media.pause":"일시정지","media.mute":"음소거","media.unmute":"음소거 해제","media.settings":"설정","media.shuffle":"셔플","media.repeat":"반복","media.previous":"이전 트랙","media.next":"다음 트랙","media.fullscreen":"전체화면","carousel.previous":"이전 슬라이드","carousel.next":"다음 슬라이드","breadcrumbs.expand":"생략된 경로 펼치기","input.showPassword":"비밀번호 보기","input.hidePassword":"비밀번호 숨기기","input.clearSearch":"검색어 지우기","verify.done":"인증 완료","verify.phoneDone":"휴대폰 번호 인증이 완료되었습니다."};let $e={};function t$2(e,t){return e in $e?$e[e]:e in Pe?Pe[e]:t??e}function labelFrom(e,t,s){return e.getAttribute(t)||t$2(s)}const Oe=new Set(["arrow-bar-left","arrow-bar-right","caret-down-filled","chevron-down","chevron-left","chevron-right","circle-checked","close","error-filled","edit","hide","info-filled","lock","mail","plus","search","share-alt","show","sparkle","trash","user","warning-filled"]);class DbInput extends HTMLElement{constructor(){super(...arguments),this.shapeKey="",this.passwordVisible=!1,this.isFocused=!1,this.touched=!1,this.isScrubbing=!1,this.handleInput=e=>{e.stopPropagation();const t=e.target;this.updateDynamicUI(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:t.value,nativeEvent:e},bubbles:!0,composed:!0}))},this.handleChange=e=>{e.stopPropagation();const t=e.target;this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t.value,nativeEvent:e},bubbles:!0,composed:!0}))},this.handleFocus=e=>{this.isFocused=!0,this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-focus",{detail:{nativeEvent:e},bubbles:!0,composed:!0}))},this.handleBlur=e=>{this.isFocused=!1,this.touched=!0,this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-blur",{detail:{nativeEvent:e},bubbles:!0,composed:!0}))},this.handlePasswordToggle=()=>{this.passwordVisible=!this.passwordVisible,this.render()},this.handleSearchClear=()=>{this.input&&(this.input.value="",this.setAttribute("value",""),this.input.focus(),this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:"",nativeEvent:null},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-clear",{bubbles:!0,composed:!0})))}}static get observedAttributes(){return["type","label","placeholder","value","default-value","size","disabled","readonly","required","error","error-message","helper-text","full-width","name","start-icon","end-icon","validate","validation-visibility","validate-on-blur","password-min-length","scrubbable","scrub-step","scrub-sensitivity","min","max","step"]}get value(){return this.input?.value??this.getAttribute("value")??""}set value(e){this.setAttribute("value",e),this.input&&(this.input.value=e),this.updateDynamicUI()}get type(){return this.getAttribute("type")||"text"}set type(e){this.setAttribute("type",e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}get readOnly(){return this.hasAttribute("readonly")}set readOnly(e){this.toggleAttribute("readonly",e)}connectedCallback(){this.render()}disconnectedCallback(){this.detachScrub?.(),this.detachScrub=void 0}attributeChangedCallback(e){if("value"!==e||!this.isScrubbing){if("value"===e&&this.input){const e=this.getAttribute("value")??"";return this.input.value!==e&&(this.input.value=e),void this.updateDynamicUI()}this.render()}}focus(){this.input?.focus()}get passwordMinLength(){return Number(this.getAttribute("password-min-length")||8)}get validationVisibility(){return this.getAttribute("validation-visibility")||"focus"}get validateOnBlur(){return!this.hasAttribute("validate-on-blur")||"false"!==this.getAttribute("validate-on-blur")}get isValidationEnabled(){return this.hasAttribute("validate")}getIconSize(){return getDbComponentIconSize(this.size)}resolveIconName(e){const t=this.getAttribute(e);if(t&&Oe.has(t))return t}resolveStartIcon(){return this.resolveIconName("start-icon")||("search"===this.type?"search":void 0)}getCurrentValue(){return this.input?.value??this.getAttribute("value")??this.getAttribute("default-value")??""}buildStructure(e){const make=(e,t)=>{const s=document.createElement(e);return s.className=t,s},t=[];if(e.label){const s=document.createElement("label");s.className="designbase-wc-input__label",s.htmlFor=e.fieldId,t.push(s)}const s=make("span","designbase-wc-input__wrapper");if(e.startIcon){const e=make("span","designbase-wc-input__start-icon");e.setAttribute("aria-hidden","true"),s.append(e)}const i=document.createElement("input");if(i.className="designbase-wc-input__field",i.id=e.fieldId,s.append(i),e.isPassword){const e=document.createElement("button");e.type="button",e.className="designbase-wc-input__password-toggle",s.append(e)}if(e.isSearch){const e=document.createElement("button");e.type="button",e.className="designbase-wc-input__clear-button",e.hidden=!0,s.append(e)}if(e.endIcon&&!e.isPassword&&!e.isSearch){const e=make("span","designbase-wc-input__end-icon");e.setAttribute("aria-hidden","true"),s.append(e)}if(t.push(s),this.isValidationEnabled&&e.isPassword){const s=make("div","designbase-wc-input__validation-slot");s.id=e.validationId,t.push(s)}const n=make("p","designbase-wc-input__helper-text");n.id=e.helperId;const a=make("p","designbase-wc-input__error-message");a.id=e.errorId,t.push(n,a),this.replaceChildren(...t)}render(){const e=this.getCurrentValue(),t=D.includes(this.type)?this.type:"text",s="search"===t,i="password"===t,n=i&&this.passwordVisible||s?"text":t,a=this.getAttribute("label")||"",r=this.getAttribute("helper-text")||"",o=this.getAttribute("error-message")||"",l=this.hasAttribute("error"),d=this.resolveStartIcon(),h=this.resolveIconName("end-icon");this.classList.add("designbase-wc-input"),M.forEach(e=>this.classList.remove(`designbase-wc-input--${e}`)),this.classList.add(`designbase-wc-input--${M.includes(this.size)?this.size:"m"}`),this.classList.toggle("designbase-wc-input--error",l),this.classList.toggle("designbase-wc-input--disabled",this.disabled),this.classList.toggle("designbase-wc-input--readonly",this.readOnly),this.classList.toggle("designbase-wc-input--full-width",this.hasAttribute("full-width")),this.classList.toggle("designbase-wc-input--with-start-icon",Boolean(d));const u=s&&e.length>0&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--with-end-icon",Boolean(h&&!i&&!s)||i||u),this.classList.toggle("designbase-wc-input--with-password-toggle",i),this.classList.toggle("designbase-wc-input--with-search-clear",u);const b=this.hasAttribute("scrubbable")&&"number"===t&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--scrubbable",b),this.classList.toggle("designbase-wc-input--scrubbing",this.isScrubbing);const p=this.getAttribute("id")||dbUid("db-input");this.hasAttribute("id")||this.setAttribute("id",p);const m=`${p}-field`,g=`${p}-helper`,f=`${p}-error`,v=`${p}-validation`,w=this.getAttribute("min"),A=this.getAttribute("max"),y=this.getAttribute("step"),E=[a?"L":"",d?"S":"",!h||i||s?"":"E",i?"P":"",s?"C":"",this.isValidationEnabled&&i?"V":""].join("");this.shapeKey===E&&this.input?.isConnected||(this.buildStructure({label:a,fieldId:m,helperId:g,errorId:f,validationId:v,startIcon:d,endIcon:h,isPassword:i,isSearch:s}),this.shapeKey=E);const _=this.querySelector(".designbase-wc-input__label");if(_&&(_.htmlFor=m,_.textContent=a,this.hasAttribute("required"))){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.textContent=" *",_.append(e)}const C=this.querySelector("input.designbase-wc-input__field");if(C){C.id=m,C.type!==n&&(C.type=n),C.placeholder=this.getAttribute("placeholder")||"",C.disabled=this.disabled,C.readOnly=this.readOnly,C.required=this.hasAttribute("required"),C.name=this.getAttribute("name")||"",C.setAttribute("aria-invalid",String(l)),s?C.setAttribute("role","searchbox"):C.removeAttribute("role");for(const[e,t]of[["min",w],["max",A],["step",y]])null!==t?C.setAttribute(e,t):C.removeAttribute(e)}const x=this.querySelector(".designbase-wc-input__password-toggle");x&&(x.disabled=this.disabled,x.setAttribute("aria-label",t$2(this.passwordVisible?"input.hidePassword":"input.showPassword"))),this.querySelector(".designbase-wc-input__clear-button")?.setAttribute("aria-label",t$2("input.clearSearch"));const S=this.querySelector(".designbase-wc-input__helper-text");S&&(S.id=g,S.textContent=r,S.hidden=!r||l);const k=this.querySelector(".designbase-wc-input__error-message");k&&(k.id=f,k.textContent=o,k.hidden=!l||!o),this.querySelector(".designbase-wc-input__validation-slot")?.setAttribute("id",v),this.mountIcons(d,!h||i||s?void 0:h,i);const N=this.querySelector("input.designbase-wc-input__field")||void 0;N&&(N.value!==e&&(N.value=e),N!==this.input&&(N.addEventListener("input",this.handleInput),N.addEventListener("change",this.handleChange),N.addEventListener("focus",this.handleFocus),N.addEventListener("blur",this.handleBlur))),this.input=N;const L=this.querySelector(".designbase-wc-input__password-toggle");L&&!L.dataset.wcBound&&(L.dataset.wcBound="true",L.addEventListener("click",this.handlePasswordToggle));const z=this.querySelector(".designbase-wc-input__clear-button");z&&!z.dataset.wcBound&&(z.dataset.wcBound="true",z.addEventListener("click",this.handleSearchClear)),this.detachScrub?.(),this.detachScrub=void 0,b&&this.input&&(this.detachScrub=attachNumberScrub(this.input,{isEnabled:()=>this.hasAttribute("scrubbable")&&"number"===this.type,isInteractive:()=>!this.disabled&&!this.readOnly,getValue:()=>this.getCurrentValue(),getStep:()=>readNumericAttribute(this,"scrub-step")??readNumericAttribute(this,"step")??1,getMin:()=>readNumericAttribute(this,"min"),getMax:()=>readNumericAttribute(this,"max"),getSensitivity:()=>readNumericAttribute(this,"scrub-sensitivity")??4,onValueChange:e=>this.applyScrubValue(e),onScrubStateChange:e=>{this.isScrubbing=e,this.classList.toggle("designbase-wc-input--scrubbing",e),!e&&this.input&&this.dispatchEvent(new CustomEvent("db-change",{detail:{value:this.input.value,nativeEvent:null},bubbles:!0,composed:!0}))}})),this.updateDynamicUI()}mountIcons(e,t,s=!1){const i=this.getIconSize();if(e){const t=this.querySelector(".designbase-wc-input__start-icon");t?.replaceChildren(createDbIcon(e,i))}if(t){const e=this.querySelector(".designbase-wc-input__end-icon");e?.replaceChildren(createDbIcon(t,i))}if(s){const e=this.querySelector(".designbase-wc-input__password-toggle");e?.replaceChildren(createDbIcon(this.passwordVisible?"hide":"show",i))}const n=this.querySelector(".designbase-wc-input__clear-button");n?.replaceChildren(createDbIcon("close",i))}shouldShowPasswordValidation(e){return!(!this.isValidationEnabled||"password"!==this.type)&&"never"!==this.validationVisibility&&("always"===this.validationVisibility||this.isFocused||e.length>0)}renderValidationMarkup(e){const t=function getPasswordValidation(e,t=8){const s=[{id:"length",label:`최소 ${t}자 이상`,met:e.length>=t},{id:"lowercase",label:"소문자 포함",met:/[a-z]/.test(e)},{id:"uppercase",label:"대문자 포함",met:/[A-Z]/.test(e)},{id:"number",label:"숫자 포함",met:/\d/.test(e)},{id:"special",label:"특수문자 포함",met:/[!@#$%^&*(),.?":{}|<>]/.test(e)}],i=function getPasswordStrengthLevel(e,t){return!t||e<=1?"weak":2===e?"fair":3===e?"good":"very-strong"}(s.filter(e=>e.met).length,e.length>0);return{requirements:s,score:getPasswordScore(i),level:i,levelLabel:Be[i],isValid:s.every(e=>e.met),isStrongEnough:"good"===i||"very-strong"===i}}(e,this.passwordMinLength),s=Array.from({length:4},(e,s)=>`<span class="designbase-wc-input__password-strength-segment${s<t.score?` designbase-wc-input__password-strength-segment--${t.level}`:""}"></span>`).join(""),i=t.requirements.map(e=>`<li class="designbase-wc-input__password-requirement${e.met?" designbase-wc-input__password-requirement--met":""}">${e.met?'<span class="designbase-wc-input__password-requirement-icon" aria-hidden="true"></span>':'<span class="designbase-wc-input__password-requirement-icon" aria-hidden="true"><span class="designbase-wc-input__password-requirement-dot"></span></span>'}<span class="designbase-wc-input__password-requirement-label">${this.escape(e.label)}</span></li>`).join("");return`\n <div class="designbase-wc-input__validation" aria-live="polite">\n <div class="designbase-wc-input__password-strength">\n <div class="designbase-wc-input__password-strength-bar" role="progressbar" aria-valuemin="0" aria-valuemax="4" aria-valuenow="${t.score}" aria-label="비밀번호 강도">${s}</div>\n <span class="designbase-wc-input__password-strength-label designbase-wc-input__password-strength-label--${t.level}">${t.levelLabel}</span>\n </div>\n <ul class="designbase-wc-input__password-requirements">${i}</ul>\n </div>\n `}updateDynamicUI(){const e=this.getCurrentValue(),t="search"===this.type&&e.length>0&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--with-search-clear",t);const s=this.querySelector(".designbase-wc-input__clear-button");s&&(s.hidden=!t,s.replaceChildren(createDbIcon("close",this.getIconSize())));const i=this.querySelector(".designbase-wc-input__validation-slot");if(i&&(this.shouldShowPasswordValidation(e)?(i.innerHTML=this.renderValidationMarkup(e),i.querySelectorAll(".designbase-wc-input__password-requirement--met .designbase-wc-input__password-requirement-icon").forEach(e=>{e.replaceChildren(createDbIcon("circle-checked",12))})):i.innerHTML=""),this.input){const t=`${this.getAttribute("id")}-helper`,s=`${this.getAttribute("id")}-error`,i=`${this.getAttribute("id")}-validation`,n=this.getAttribute("helper-text")||"",a=this.getAttribute("error-message")||"",r=this.hasAttribute("error"),o=[n&&!r?t:"",this.shouldShowPasswordValidation(e)?i:"",r&&a?s:""].filter(Boolean).join(" ")||void 0;o?this.input.setAttribute("aria-describedby",o):this.input.removeAttribute("aria-describedby")}}applyScrubValue(e){this.input&&(this.input.value=e,this.setAttribute("value",e),this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:e,nativeEvent:null},bubbles:!0,composed:!0})))}escape(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]||e))}}customElements.get("db-input")||customElements.define("db-input",DbInput);const He={xs:{width:96,height:20,markSize:19},s:{width:125,height:26,markSize:25},m:{width:193,height:40,markSize:38},l:{width:256,height:53,markSize:50},xl:{width:320,height:66,markSize:63}};class DbLogo extends HTMLElement{static get observedAttributes(){return["type","text","src","alt","size","variant","clickable","href","target","full-width"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}handleClick(e){(this.hasAttribute("clickable")||this.getAttribute("href"))&&(e.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})))}renderLogoContent(e){const t=this.getAttribute("type")||"designbase",s=this.getAttribute("text")||"Logo",i=this.getAttribute("src"),n=this.getAttribute("alt")||s,a=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"default",{width:o,height:l,markSize:d}=function getLogoDimensions(e){return He[e]||He.m}(a),h=function getLogoColor(e){return"original"===e||"dark"===e?"#000000":"light"===e||"white"===e?"#ffffff":"primary"===e?"var(--db-brand-primary)":"secondary"===e?"var(--db-text-secondary)":"var(--db-text-primary)"}(r);if("designbase"===t){const t=document.createElement("div");return t.className="designbase-wc-logo__svg",t.append(function createDesignBaseLogoSvg(e,t,s,i){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width",String(e)),n.setAttribute("height",String(t)),n.setAttribute("viewBox","0 0 386 40"),n.setAttribute("fill","none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("aria-label","DesignBase Logo"),i&&n.setAttribute("class",i);const a=document.createElementNS("http://www.w3.org/2000/svg","g");return a.setAttribute("fill",s||"currentColor"),a.innerHTML='\n<polygon points="58.4,23.6 77.3,23.6 77.3,16.2 58.4,16.2 58.4,7.7 79.4,7.7 79.4,0.4 49.5,0.4 49.5,39.6 80,39.6 80,32.3 58.4,32.3"/>\n<path d="M95.6,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3c-4.5-2.8-9.6-4.2-14.9-4.2c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.2,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C116.5,13.9,95.6,18,95.6,10.8z"/>\n<rect x="122.7" y="0.4" width="8.8" height="39.2"/>\n<path d="M158.8,7.8c4,0.1,7.8,1.7,10.8,4.4l5-6.3c-4.4-3.7-10-5.7-15.7-5.7c-12.2,0-21.4,8.5-21.4,19.9s9,20,20.9,20 c5.7-0.1,11.2-1.9,15.9-5.1V19.8h-7.6v10.3c-2.4,1.3-5,2-7.7,2.1h-0.4c-6.7-0.1-12.1-5.6-12-12.3v-0.4 C146.7,13,152.2,7.7,158.8,7.8z"/>\n<polygon points="209.1,25.6 190.1,0.4 182,0.4 182,39.6 190.5,39.6 190.5,14.5 209.5,39.6 217.5,39.6 217.5,0.4 209.1,0.4"/>\n<path d="M263.3,18.8c4-0.9,6.9-4.5,6.8-8.6c0-6-5.4-9.8-14-9.8h-24.5v6.5l6.4,1v31.8h18.7c9.1,0,14.8-4.2,14.8-10.9 C271.7,23.8,268.2,19.5,263.3,18.8z M246.9,7.6h8.7c3.4-0.1,5.4,1.5,5.4,4.2s-2,4.4-5.4,4.4h-8.7V7.6z M255.7,32.4h-8.7v-9.3h8.7 c4.1,0,6.7,1.7,6.7,4.5C262.4,30.6,259.8,32.4,255.7,32.4z"/>\n<path d="M290.5,0.4l-17,39.2h9.1l3.1-7.6h18.2l3,7.6h9.5L299.6,0.4H290.5z M288.6,24.9l6.2-15.2l6.2,15.2L288.6,24.9z"/>\n<path d="M328.9,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3C345,1.4,339.9,0,334.6,0c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.1,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C349.8,13.9,328.9,18,328.9,10.8z"/>\n<polygon points="364.4,32.3 364.4,23.6 383.3,23.6 383.3,16.2 364.4,16.2 364.4,7.7 385.4,7.7 385.4,0.4 355.5,0.4 355.5,39.6 386,39.6 386,32.3"/>\n<path d="M23.1,0.4H0v6.5l6.5,1v31.8h16.3c12.4,0,21-8.1,21-19.6S35.2,0.4,23.1,0.4z M34.7,20.1c0,7.2-4.8,12.1-11.4,12.1h-8V7.8H23 C29.8,7.8,34.8,12.8,34.7,20.1L34.7,20.1z"/>\n',n.append(a),n}(o,l,h)),void e.append(t)}if("designbase-mark"===t){const t=document.createElement("div");return t.className="designbase-wc-logo__svg",t.append(function createDesignBaseLogoMarkSvg(e,t,s){const i=.95*e,n=e,a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("width",String(i)),a.setAttribute("height",String(n)),a.setAttribute("viewBox","0 0 95 100"),a.setAttribute("fill","none"),a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("aria-label","DesignBase Mark"),s&&a.setAttribute("class",s);const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("fill",t||"currentColor"),r.setAttribute("d","M45,0H0V8l10,2V90L0,92v8H45A50,50,0,0,0,45,0ZM43.12,90H20V10H38.33a15,15,0,0,1,0,30H30.11V50h13a20,20,0,0,1,0,40ZM71.4,80A30,30,0,0,0,55.83,42.83,24.93,24.93,0,0,0,60.27,13,40,40,0,0,1,71.4,80Z"),a.append(r),a}(d,h)),void e.append(t)}if(i){const t=document.createElement("img");return t.className="designbase-wc-logo__image",t.src=i,t.alt=n,void e.append(t)}const u=document.createElement("span");u.className="designbase-wc-logo__text",u.textContent=s,e.append(u)}render(){const e=this.getAttribute("type")||"designbase",t=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default",i=this.hasAttribute("clickable")||Boolean(this.getAttribute("href")),n=this.hasAttribute("full-width"),a=this.getAttribute("href"),r=this.getAttribute("target")||"_self";this.className="",this.replaceChildren();const o=document.createElement("div");if(o.className=["designbase-wc-logo",`designbase-wc-logo--${t}`,s?`designbase-wc-logo--${s}`:"",i?"designbase-wc-logo--clickable":"",n?"designbase-wc-logo--full-width":"","custom"!==e?"designbase-wc-logo--svg":""].filter(Boolean).join(" "),i&&(o.addEventListener("click",e=>this.handleClick(e)),a||o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick(e))})),this.renderLogoContent(o),a){const e=document.createElement("a");return e.className="designbase-wc-logo__link",e.href=a,e.target=r,"_blank"===r&&(e.rel="noopener noreferrer"),e.append(o),void this.append(e)}this.append(o)}}customElements.get("db-logo")||customElements.define("db-logo",DbLogo);class DbMenuItem extends HTMLElement{static get observedAttributes(){return["label","href","icon","active","disabled","badge","badge-color","size","variant","type","menu-style","expanded","expandable","sub-items","depth"]}get subItems(){try{return JSON.parse(this.getAttribute("sub-items")||"[]")}catch{return[]}}set subItems(e){this.setAttribute("sub-items","string"==typeof e?e:JSON.stringify(e))}get expanded(){return this.hasAttribute("expanded")}set expanded(e){this.toggleAttribute("expanded",e)}connectedCallback(){this.render()}iconSize(e){return"s"===e?16:"l"===e?24:16}render(){const e=this.getAttribute("label")||"",t=this.getAttribute("href")||"",s=this.getAttribute("icon"),i=this.getAttribute("size")||"m",n=this.getAttribute("variant")||"default",a=this.getAttribute("type")||"block",r=this.getAttribute("menu-style")||"accordion",o=Number(this.getAttribute("depth")||0),l=this.hasAttribute("active"),d=this.hasAttribute("disabled"),h=this.getAttribute("badge")||"",u=this.getAttribute("badge-color")||"primary",b=this.subItems,p=b.length>0,m=this.hasAttribute("expandable")||p,g=this.expanded,f=this.iconSize(i),v="accordion"===r&&p;this.className=["designbase-wc-menu-item",`designbase-wc-menu-item--${a}`,`designbase-wc-menu-item--${i}`,`designbase-wc-menu-item--${n}`,`designbase-wc-menu-item--${r}`,`designbase-wc-menu-item--depth-${o}`,l&&"designbase-wc-menu-item--active",d&&"designbase-wc-menu-item--disabled",m&&"designbase-wc-menu-item--expandable",g&&"designbase-wc-menu-item--expanded",p&&"designbase-wc-menu-item--with-children",h&&"designbase-wc-menu-item--with-badge",s&&"designbase-wc-menu-item--with-icon"].filter(Boolean).join(" "),this.replaceChildren();const w=document.createElement("div");if(w.className=["designbase-wc-menu-item__content","designbase-wc-menu-item__content--clickable"].join(" "),s){const e=document.createElement("div");e.className=["designbase-wc-menu-item__icon",`designbase-wc-menu-item__icon--${n}`,l&&"designbase-wc-menu-item__icon--active",d&&"designbase-wc-menu-item__icon--disabled"].filter(Boolean).join(" "),e.append(createDbIcon(s,f)),w.append(e)}const A=document.createElement("span");if(A.className="designbase-wc-menu-item__label",A.textContent=e,w.append(A),h){const e=document.createElement("db-badge");e.setAttribute("size","s"),e.setAttribute("variant",u),e.setAttribute("type","number"),e.setAttribute("count",h),w.append(e)}if(p){const e=document.createElement("div");e.className="designbase-wc-menu-item__expand-icon",e.append(createDbIcon(g?"chevron-up":"chevron-down",16)),w.append(e)}if(w.addEventListener("click",s=>{d||(p&&m?(s.preventDefault(),this.expanded=!this.expanded):t&&(window.location.href=t),this.dispatchEvent(new CustomEvent("db-click",{detail:{label:e,href:t,expanded:this.expanded},bubbles:!0,composed:!0})))}),this.append(w),p&&(g||v)){const e=document.createElement("div");e.className=`designbase-wc-menu-item__children designbase-wc-menu-item__children--${r}`,v&&e.setAttribute("aria-hidden",g?"false":"true"),b.forEach(t=>{const s=document.createElement("db-menu-item");s.setAttribute("label",t.label),s.setAttribute("type","block"),s.setAttribute("menu-style",r),s.setAttribute("size",i),s.setAttribute("depth",String(o+1)),t.href&&s.setAttribute("href",t.href),t.icon&&s.setAttribute("icon",t.icon),t.active&&s.setAttribute("active",""),t.disabled&&s.setAttribute("disabled",""),void 0!==t.badge&&s.setAttribute("badge",String(t.badge)),t.badgeColor&&s.setAttribute("badge-color",t.badgeColor),t.variant&&s.setAttribute("variant",t.variant),s.addEventListener("db-click",e=>{e.stopPropagation(),t.disabled||this.dispatchEvent(new CustomEvent("db-child-click",{detail:{child:t},bubbles:!0,composed:!0}))}),e.append(s)}),this.append(e)}}attributeChangedCallback(e){this.isConnected&&("expanded"!==e||"accordion"!==this.getAttribute("menu-style")?this.render():this.syncExpandedState())}syncExpandedState(){const e=this.expanded;this.classList.toggle("designbase-wc-menu-item--expanded",e);const t=this.querySelector(".designbase-wc-menu-item__expand-icon");t&&t.replaceChildren(createDbIcon(e?"chevron-up":"chevron-down",16));const s=this.querySelector(".designbase-wc-menu-item__children--accordion");s?s.setAttribute("aria-hidden",e?"false":"true"):e&&this.subItems.length&&this.render()}}customElements.get("db-menu-item")||customElements.define("db-menu-item",DbMenuItem);const Ve=["default","tabs","segment"],Re=["s","m","l"];class DbModal extends HTMLElement{constructor(){super(...arguments),this.titleId=dbUid("db-modal-title"),this.isMounted=!1,this.internalTabId="",this.internalSegment="",this.exitTimerId=null,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&"false"!==this.getAttribute("close-on-escape")&&(e.preventDefault(),this.close())}}static get observedAttributes(){return["open","title","size","header-variant","tabs","segments","selected-tab-id","default-selected-tab-id","segment-value","default-segment-value","nav-size","segment-full-width","close-on-outside-click","close-on-escape","show-close-button","role","describedby","label-close"]}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(e){e?this.setAttribute("open","true"):this.removeAttribute("open")}connectedCallback(){this.classList.add("designbase-wc-modal-host"),document.addEventListener("keydown",this.handleDocumentKeyDown),this.childObserver=new MutationObserver(()=>{this.open&&this.render()}),this.childObserver.observe(this,{childList:!0}),this.syncOpenState()}disconnectedCallback(){this.childObserver?.disconnect(),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.exitTimerId&&clearTimeout(this.exitTimerId),this.teardown()}attributeChangedCallback(e){if(this.isConnected)if("open"!==e){if("selected-tab-id"===e||"segment-value"===e){const e=this.getClassifiedChildren();return this.renderBodyContent(e.body),void this.renderHeader(e.header)}this.render(),this.isMounted&&this.syncVisibility()}else this.syncOpenState()}resolvedSize(){return W.includes(this.size)?this.size:"m"}get size(){return coerceToContract(this.getAttribute("size"),W,"m")}set size(e){e?this.setAttribute("size",e):this.removeAttribute("size")}resolvedHeaderVariant(){const e=this.getAttribute("header-variant")||"default";return Ve.includes(e)?e:"default"}parsedTabs(){const e=this.getAttribute("tabs");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}parsedSegments(){const e=this.getAttribute("segments");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}usesIntegratedNav(){const e=this.resolvedHeaderVariant();return"tabs"===e&&this.parsedTabs().length>0||"segment"===e&&this.parsedSegments().length>0}closeIconSize(){const e=this.resolvedSize();return"s"===e?16:"l"===e?20:"xl"===e?24:18}activeTabId(){return this.getAttribute("selected-tab-id")||this.internalTabId||this.getAttribute("default-selected-tab-id")||this.parsedTabs()[0]?.id||""}activeSegmentValue(){return this.getAttribute("segment-value")||this.internalSegment||this.getAttribute("default-segment-value")||this.parsedSegments()[0]?.value||""}collectUserChildren(){return Array.from(this.children).filter(e=>!e.hasAttribute("data-wc-internal"))}classifyChildren(e){const t=e.filter(e=>this.isHeaderPart(e)),s=e.filter(e=>this.isFooterPart(e)),i=e.filter(e=>this.isBodyPart(e)),n=e.filter(e=>!t.includes(e)&&!s.includes(e)&&!i.includes(e));return{header:t,body:[...i,...n],footer:s}}getClassifiedChildren(){const e=this.classifyChildren(this.collectUserChildren());return e.header.length||e.body.length||e.footer.length?e:{header:Array.from(this.headerEl?.children||[]).filter(e=>e!==this.closeButton&&!e.classList.contains("designbase-wc-modal__header-row")&&("header"===e.getAttribute("data-modal-part")||e.classList.contains("designbase-wc-modal__header"))),body:this.collectContentParts("body"),footer:this.collectContentParts("footer")}}isHeaderPart(e){return e.classList.contains("designbase-wc-modal__header")||"header"===e.getAttribute("data-modal-part")}isBodyPart(e){return e.classList.contains("designbase-wc-modal__body")||"body"===e.getAttribute("data-modal-part")}isFooterContainer(e){return!(!e.classList.contains("designbase-wc-modal__footer")&&"footer"!==e.getAttribute("data-modal-part"))||"footer"===e.getAttribute("slot")&&("div"===e.localName||"footer"===e.localName)}isFooterPart(e){return this.isFooterContainer(e)||"footer"===e.getAttribute("slot")}collectContentParts(e){if(!this.contentEl)return[];const t=Array.from(this.contentEl.children).filter(t=>"body"===e?this.isBodyPart(t):this.isFooterPart(t));if(t.length>0)return t;const s="footer"===e?Array.from(this.contentEl.querySelectorAll(':scope > [data-wc-part="footer"] > [slot="footer"]')):[];return s.length>0?s:Array.from(this.children).filter(t=>"body"===e?this.isBodyPart(t):this.isFooterPart(t))}footerAnchor(){return this.contentEl?.querySelector(':scope > .designbase-wc-modal__footer, :scope > [data-modal-part="footer"], :scope > [data-wc-part="footer"]')||null}ensurePartShell(e){if(!this.contentEl)return null;const t=this.contentEl.querySelector(`:scope > [data-wc-part="${e}"]`);if(t)return t;const s=document.createElement("div");return s.className=`designbase-wc-modal__${e}`,s.setAttribute("data-modal-part",e),s.setAttribute("data-wc-part",e),s.setAttribute("data-wc-internal",""),"footer"===e?this.contentEl.append(s):this.contentEl.insertBefore(s,this.footerAnchor()),s}placeBodyParts(e){const t=this.contentEl;if(!t)return;const s=e.filter(e=>this.isBodyPart(e)),i=e.filter(e=>!this.isBodyPart(e)&&!this.isFooterPart(e));if(s.length>0){const e=t.querySelector(':scope > [data-wc-part="body"]');return s.forEach(e=>{e.parentElement!==t&&t.insertBefore(e,this.footerAnchor())}),void(e&&!s.includes(e)&&e.remove())}if(0===i.length)return;const n=this.ensurePartShell("body");n&&i.forEach(e=>{e.parentElement!==n&&n.append(e)})}placeFooterParts(e){const t=this.contentEl;if(!t)return;const s=e.filter(e=>this.isFooterContainer(e)),i=e.filter(e=>!this.isFooterContainer(e)&&"footer"===e.getAttribute("slot"));if(s.length>0){const e=t.querySelector(':scope > [data-wc-part="footer"]');return s.forEach(e=>{e.classList.add("designbase-wc-modal__footer"),e.hasAttribute("data-modal-part")||e.setAttribute("data-modal-part","footer"),e.parentElement!==t&&t.append(e)}),void(e&&!s.includes(e)&&e.remove())}if(0===i.length)return;const n=this.ensurePartShell("footer");n&&i.forEach(e=>{e.parentElement!==n&&n.append(e)})}restorePartsToHost(){this.contentEl&&(this.contentEl.querySelectorAll("[data-wc-part]").forEach(e=>{for(;e.firstChild;)this.append(e.firstChild)}),Array.from(this.contentEl.children).filter(e=>!e.classList.contains("designbase-wc-modal__integrated-content")&&!e.hasAttribute("data-wc-internal")).forEach(e=>{e.parentElement!==this&&this.append(e)}))}bindFooterActions(){if(!this.contentEl||"true"===this.contentEl.dataset.modalActionsBound)return;this.contentEl.dataset.modalActionsBound="true";const handleClose=e=>{const t=e.target?.closest("[data-modal-close]");t&&this.contentEl?.contains(t)&&this.close()};this.contentEl.addEventListener("click",handleClose),this.contentEl.addEventListener("db-click",handleClose)}ensureStructure(){this.root||(this.root=document.createElement("div"),this.root.className="designbase-wc-modal__overlay",this.root.setAttribute("data-wc-internal",""),this.root.addEventListener("click",e=>{e.target===this.root&&"false"!==this.getAttribute("close-on-outside-click")&&this.close()}),this.panel=document.createElement("div"),this.panel.className="designbase-wc-modal",this.panel.setAttribute("role",this.dialogRole()),this.panel.setAttribute("aria-modal","true"),this.panel.addEventListener("click",e=>e.stopPropagation()),this.headerEl=document.createElement("div"),this.headerEl.className="designbase-wc-modal__header",this.headerContentEl=document.createElement("div"),this.headerContentEl.className="designbase-wc-modal__header-content",this.titleEl=document.createElement("h2"),this.titleEl.className="designbase-wc-modal__title",this.titleEl.id=this.titleId,this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.className="designbase-wc-modal__close-button",this.closeButton.setAttribute("aria-label",labelFrom(this,"label-close","modal.close")),this.closeButton.addEventListener("click",()=>this.close()),this.navEl=document.createElement("div"),this.navEl.className="designbase-wc-modal__header-nav",this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-modal__content",this.panel.append(this.headerEl,this.contentEl),this.root.append(this.panel))}renderCloseButton(){if(!this.closeButton)return;const e=createDbIcon("close",this.closeIconSize());e.setAttribute("aria-hidden","true"),this.closeButton.replaceChildren(e),this.closeButton.setAttribute("aria-label",labelFrom(this,"label-close","modal.close")),this.closeButton.hidden="false"===this.getAttribute("show-close-button")}renderDefaultHeader(e){if(!(this.headerEl&&this.headerContentEl&&this.titleEl&&this.closeButton))return;if(this.headerEl.className="designbase-wc-modal__header",this.headerEl.replaceChildren(),e.length>0)return e.forEach(e=>this.headerEl.append(e)),void("false"!==this.getAttribute("show-close-button")&&this.headerEl.append(this.closeButton));const t=this.getAttribute("title")||"";this.titleEl.textContent=t,this.titleEl.hidden=!t,this.headerContentEl.replaceChildren(),t&&this.headerContentEl.append(this.titleEl),this.renderCloseButton(),this.headerEl.append(this.headerContentEl),"false"!==this.getAttribute("show-close-button")&&this.headerEl.append(this.closeButton),this.panel&&(t?this.panel.setAttribute("aria-labelledby",this.titleId):this.panel.removeAttribute("aria-labelledby"),this.panel.setAttribute("role",this.dialogRole()),this.syncDescribedBy())}renderNavHeader(){if(!(this.headerEl&&this.headerContentEl&&this.titleEl&&this.closeButton&&this.navEl))return;const e=this.resolvedHeaderVariant(),t=this.parsedTabs(),s=this.parsedSegments(),i=Re.includes(this.getAttribute("nav-size")||"m")?this.getAttribute("nav-size")||"m":"s";this.headerEl.className=["designbase-wc-modal__header","tabs"===e&&"designbase-wc-modal__header--tabs","segment"===e&&"designbase-wc-modal__header--segment"].filter(Boolean).join(" ");const n=this.getAttribute("title")||"";this.titleEl.textContent=n,this.titleEl.hidden=!n,this.headerContentEl.replaceChildren(),n&&this.headerContentEl.append(this.titleEl),this.renderCloseButton();const a=document.createElement("div");if(a.className="designbase-wc-modal__header-row",a.append(this.headerContentEl),"false"!==this.getAttribute("show-close-button")&&a.append(this.closeButton),this.headerEl.replaceChildren(a),this.navEl.replaceChildren(),"tabs"===e&&t.length>0){const e=document.createElement("db-tabs");e.setAttribute("size",i),e.setAttribute("items",JSON.stringify(t.map(e=>({id:e.id,label:e.label,disabled:e.disabled})))),e.setAttribute("selected-id",this.activeTabId()),e.addEventListener("db-change",e=>{const t=e.detail?.id;t&&(this.hasAttribute("selected-tab-id")||(this.internalTabId=t),this.dispatchEvent(new CustomEvent("db-tab-change",{detail:{tabId:t},bubbles:!0,composed:!0})),this.renderBodyContent(this.getClassifiedChildren().body))}),this.tabsEl=e,this.navEl.append(e),this.headerEl.append(this.navEl)}if("segment"===e&&s.length>0){const e=document.createElement("db-segment-control");e.setAttribute("size",i),e.setAttribute("options",JSON.stringify(s.map(e=>({value:e.value,label:e.label,disabled:e.disabled})))),e.setAttribute("value",this.activeSegmentValue()),"false"!==this.getAttribute("segment-full-width")&&e.setAttribute("full-width",""),e.addEventListener("db-change",e=>{const t=e.detail?.value;t&&(this.hasAttribute("segment-value")||(this.internalSegment=t),this.dispatchEvent(new CustomEvent("db-segment-change",{detail:{value:t},bubbles:!0,composed:!0})),this.renderBodyContent(this.getClassifiedChildren().body))}),this.segmentEl=e,this.navEl.append(e),this.headerEl.append(this.navEl)}this.panel&&(n?this.panel.setAttribute("aria-labelledby",this.titleId):this.panel.removeAttribute("aria-labelledby"))}renderHeader(e){if(this.headerEl)return e.length>0?(this.headerEl.hidden=!1,void this.renderDefaultHeader(e)):this.usesIntegratedNav()?(this.headerEl.hidden=!1,void this.renderNavHeader()):void(this.getAttribute("title")?(this.headerEl.hidden=!1,this.renderDefaultHeader([])):this.headerEl.hidden=!0)}renderBodyContent(e=[]){if(!this.contentEl)return;let t=this.contentEl.querySelector(":scope > .designbase-wc-modal__integrated-content"),s="";if(this.usesIntegratedNav()){const e=this.resolvedHeaderVariant();if("tabs"===e){const e=this.parsedTabs().find(e=>e.id===this.activeTabId());s=e?.content||""}if("segment"===e){const e=this.parsedSegments().find(e=>e.value===this.activeSegmentValue());s=e?.content||""}}s?(t||(t=document.createElement("div"),t.className="designbase-wc-modal__integrated-content designbase-wc-modal__body",this.contentEl.insertBefore(t,this.contentEl.firstChild)),t.textContent=s):t?.remove(),this.placeBodyParts(e)}renderFooter(e){this.contentEl&&(this.placeFooterParts(e),e.forEach(e=>{e instanceof HTMLElement&&(e.hidden=!1)}),this.bindFooterActions())}render(){this.ensureStructure();const{header:e,body:t,footer:s}=this.getClassifiedChildren();W.forEach(e=>this.panel?.classList.remove(`designbase-wc-modal--${e}`)),this.panel?.classList.add(`designbase-wc-modal--${this.resolvedSize()}`),this.renderHeader(e),this.renderBodyContent(t),this.renderFooter(s)}syncVisibility(){if(this.root&&this.panel){if(this.open)return this.root.setAttribute("data-state","entering"),this.panel.setAttribute("data-state","entering"),void requestAnimationFrame(()=>{this.panel,requestAnimationFrame(()=>{this.open&&this.root&&this.panel&&(this.root.setAttribute("data-state","entered"),this.panel.setAttribute("data-state","entered"))})});this.root.setAttribute("data-state","exiting"),this.panel.setAttribute("data-state","exiting")}}syncOpenState(){if(this.open)return this.render(),this.root&&!this.root.isConnected&&(this.closest(".designbase-wp-admin")||document.body).append(this.root),this.isMounted||lockScroll(),this.isMounted=!0,this.syncVisibility(),void this.activateFocusTrap();this.isMounted&&(this.syncVisibility(),this.focusTrap?.deactivate(),this.focusTrap=void 0,this.exitTimerId&&clearTimeout(this.exitTimerId),this.exitTimerId=window.setTimeout(()=>{this.open||this.teardown()},200))}activateFocusTrap(){this.panel&&!this.focusTrap&&(this.focusTrap=createFocusTrap(this.panel,{initialFocus:()=>this.panel?.querySelector("[autofocus]")||null}),this.focusTrap.activate())}teardown(){this.focusTrap?.deactivate(),this.focusTrap=void 0,this.restorePartsToHost(),this.root?.remove(),this.isMounted&&unlockScroll(),this.isMounted=!1}dialogRole(){return"alertdialog"===this.getAttribute("role")?"alertdialog":"dialog"}syncDescribedBy(){if(!this.panel)return;const e=this.getAttribute("describedby");e?this.panel.setAttribute("aria-describedby",e):this.contentEl&&(this.contentEl.textContent||"").trim()?(this.contentEl.id||(this.contentEl.id=dbUid("db-modal-desc")),this.panel.setAttribute("aria-describedby",this.contentEl.id)):this.panel.removeAttribute("aria-describedby")}close(){this.open=!1,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}}customElements.get("db-modal")||customElements.define("db-modal",DbModal);class DbPageHeader extends HTMLElement{constructor(){super(...arguments),this.internalTabId="",this.isRendering=!1,this.handleBack=()=>{const e=new CustomEvent("db-back",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||function navigatePageHeaderBack(e="/"){if("undefined"==typeof window)return;const t=window.history.state?.idx;"number"==typeof t&&t>0||(()=>{try{return!!document.referrer&&new URL(document.referrer).origin===window.location.origin}catch{return!1}})()||window.history.length>1?window.history.back():window.location.assign(e)}(this.getAttribute("back-fallback-href")||"/")},this.handleTabChange=e=>{const t=e.detail,s=t?.selectedId??this.parseTabs()[t?.index??0]?.id??String(t?.index??0);this.hasAttribute("selected-tab-id")||(this.internalTabId=s),this.dispatchEvent(new CustomEvent("db-tab-change",{bubbles:!0,composed:!0,detail:{tabId:s}}))}}static get observedAttributes(){return["title","subtitle","description","breadcrumbs","variant","show-back-button","back-fallback-href","back-label","tabs","selected-tab-id","default-selected-tab-id","align"]}connectedCallback(){this.syncDefaultTab(),this.render(),this.childObserver=new MutationObserver(()=>{this.isRendering||this.hasPendingSlottedChildren()&&this.render()}),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){this.childObserver?.disconnect()}attributeChangedCallback(e){this.isConnected&&("default-selected-tab-id"!==e&&"tabs"!==e||this.syncDefaultTab(),this.render())}hasPendingSlottedChildren(){return Array.from(this.children).some(e=>{const t=e.getAttribute("slot");return"actions"===t||"meta"===t||"description"===t})}syncDefaultTab(){if(this.internalTabId)return;const e=this.parseTabs(),t=this.getAttribute("default-selected-tab-id");this.internalTabId=t||e[0]?.id||""}parseTabs(){try{const e=JSON.parse(this.getAttribute("tabs")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseBreadcrumbs(){try{const e=JSON.parse(this.getAttribute("breadcrumbs")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}getActiveTabId(){return this.getAttribute("selected-tab-id")||this.internalTabId}getVariant(){const e=this.getAttribute("variant")||"default";return he.includes(e)?e:"default"}getAlign(){const e=this.getAttribute("align")||"center";return ue.includes(e)?e:"center"}collectActions(){const e=Array.from(this.querySelectorAll(':scope > [slot="actions"]'));if(e.length)return e;const t=this.querySelector(".designbase-wc-page-header__cta");if(t?.children.length)return Array.from(t.children);const s=this.querySelector(".designbase-wc-page-header__actions");return s?.children.length?Array.from(s.children):[]}collectMeta(){const e=Array.from(this.querySelectorAll(':scope > [slot="meta"]'));if(e.length)return e;const t=this.querySelector(".designbase-wc-page-header__meta");return t?.children.length?Array.from(t.children):[]}renderMinimalAside(e,t){if(!e.length&&!t.length)return null;const s=document.createElement("div");if(s.className="designbase-wc-page-header__aside",e.length){const t=document.createElement("div");t.className="designbase-wc-page-header__meta",e.forEach(e=>t.append(e)),s.append(t)}if(t.length){const e=document.createElement("div");e.className="designbase-wc-page-header__cta",t.forEach(t=>e.append(t)),s.append(e)}return s}collectDescriptionSlot(){const e=this.querySelector(':scope > [slot="description"]');if(e)return e;const t=this.querySelector(":scope .designbase-wc-page-header__description"),s=t?.firstElementChild;return s||null}renderTitleBlock(e){const t=document.createDocumentFragment(),s=this.getAttribute("title")||"",i=this.getAttribute("subtitle"),n=document.createElement("h1");if(n.className="designbase-wc-page-header__title",n.textContent=s,t.append(n),i){const e=document.createElement("h2");e.className="designbase-wc-page-header__subtitle",e.textContent=i,t.append(e)}const a=this.getAttribute("description");if(e||a){const s=document.createElement("div");s.className="designbase-wc-page-header__description",e?s.append(e):s.textContent=a,t.append(s)}return t}render(){this.isRendering=!0;const e=this.collectActions(),t=this.collectMeta(),s=this.collectDescriptionSlot(),i="minimal"===this.getVariant(),n=this.getAlign(),a=this.parseBreadcrumbs(),r=this.parseTabs(),o=r.length>0,l=this.hasAttribute("show-back-button");if(this.className=["designbase-wc-page-header",i?"designbase-wc-page-header--minimal":`designbase-wc-page-header--${n}`,i&&o?"designbase-wc-page-header--has-tabs":""].filter(Boolean).join(" "),this.replaceChildren(),a.length){const e=document.createElement("div");e.className="designbase-wc-page-header__breadcrumbs";const t=document.createElement("db-breadcrumbs");t.setAttribute("size","s"),t.setAttribute("items",JSON.stringify(a)),e.append(t),this.append(e)}const d=document.createElement("div");d.className="designbase-wc-page-header__main";const h=document.createElement("div");if(h.className="designbase-wc-page-header__content",i&&l){const e=document.createElement("div");e.className="designbase-wc-page-header__title-row";const t=document.createElement("db-button");t.className="designbase-wc-page-header__back-button",t.setAttribute("variant","tertiary"),t.setAttribute("size","m"),t.setAttribute("icon-only",""),t.setAttribute("start-icon","chevron-left"),t.setAttribute("aria-label",this.getAttribute("back-label")||"뒤로가기"),t.setAttribute("tooltip",this.getAttribute("back-label")||"뒤로가기"),t.addEventListener("db-click",this.handleBack),e.append(t);const i=document.createElement("div");i.className="designbase-wc-page-header__title-group",i.append(this.renderTitleBlock(s)),e.append(i),h.append(e)}else h.append(this.renderTitleBlock(s));if(d.append(h),i){const s=this.renderMinimalAside(t,e);s&&d.append(s)}if(this.append(d),!i&&e.length){const t=document.createElement("div");t.className="designbase-wc-page-header__actions",e.forEach(e=>t.append(e)),this.append(t)}this.renderMinimalTabs(i,o,r),queueMicrotask(()=>{this.isRendering=!1})}renderMinimalTabs(e,t,s){if(!e||!t)return;const i=document.createElement("div");i.className="designbase-wc-page-header__toolbar";const n=document.createElement("div");n.className="designbase-wc-page-header__tabs";const a=document.createElement("db-tabs");a.setAttribute("size","m"),a.setAttribute("items",JSON.stringify(s)),a.setAttribute("selected-id",this.getActiveTabId()),a.addEventListener("db-change",this.handleTabChange),n.append(a),i.append(n),this.append(i)}}customElements.get("db-page-header")||customElements.define("db-page-header",DbPageHeader);class DbPagination extends HTMLElement{static get observedAttributes(){return["current-page","total-pages","total-items","page-size","page-size-options","size","variant","alignment","show-first-last","show-previous-next","show-page-size-selector","show-total","sibling-count","boundary-count","disabled","full-width"]}get currentPage(){return Number(this.getAttribute("current-page")||1)}set currentPage(e){this.setAttribute("current-page",String(e))}get totalPages(){return Number(this.getAttribute("total-pages")||1)}set totalPages(e){this.setAttribute("total-pages",String(e))}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}iconSize(){const e=this.getAttribute("size")||"m";return"s"===e?12:"l"===e?16:14}render(){const e=this.getAttribute("size")||"m",t=this.getAttribute("variant")||"default",s=this.getAttribute("alignment")||"center",i=this.hasAttribute("disabled"),n=this.hasAttribute("show-first-last"),a="false"!==this.getAttribute("show-previous-next"),r=this.hasAttribute("show-page-size-selector"),o=this.hasAttribute("show-total"),l=this.hasAttribute("full-width")||r||o,d=Number(this.getAttribute("total-items")||0),h=Number(this.getAttribute("page-size")||10),u=this.currentPage,b=this.totalPages,p=u<=1,m=u>=b;this.className=["designbase-wc-pagination",`designbase-wc-pagination--${e}`,`designbase-wc-pagination--${t}`,`designbase-wc-pagination--${s}`,i&&"designbase-wc-pagination--disabled",l&&"designbase-wc-pagination--full-width"].filter(Boolean).join(" "),this.setAttribute("role","navigation"),this.setAttribute("aria-label","페이지 네비게이션"),this.replaceChildren();const g=document.createElement("div");if(g.className=["designbase-wc-pagination__container",l&&"designbase-wc-pagination__container--full-width"].filter(Boolean).join(" "),o&&d>0){const e=document.createElement("div");e.className="designbase-wc-pagination__total",e.textContent=this.getTotalLabel(d,h,u),g.append(e)}const f=document.createElement("nav");f.className="designbase-wc-pagination__nav",f.setAttribute("aria-label","페이지 네비게이션");const v=document.createElement("ul");v.className="designbase-wc-pagination__list",n&&!p&&v.append(this.createIconButton("arrow-bar-left",1,"첫 페이지로 이동","first")),a&&!p&&v.append(this.createIconButton("chevron-left",u-1,"이전 페이지로 이동","previous")),this.getPageNumbers().forEach((e,t)=>{if("..."===e){const e=document.createElement("li");e.className="designbase-wc-pagination__ellipsis";const t=document.createElement("span");return t.className="designbase-wc-pagination__ellipsis-text",t.textContent="...",e.append(t),void v.append(e)}"number"==typeof e&&v.append(this.createPageButton(e,i))}),a&&!m&&v.append(this.createIconButton("chevron-right",u+1,"다음 페이지로 이동","next")),n&&!m&&v.append(this.createIconButton("arrow-bar-right",b,"마지막 페이지로 이동","last")),f.append(v),g.append(f),r&&g.append(this.createPageSizeSelector(e,h,i)),this.append(g)}getPageSizeOptions(){const e=this.getAttribute("page-size-options");if(!e)return[10,20,50,100];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(e=>Number(e)).filter(e=>!Number.isNaN(e))}catch{}return[10,20,50,100]}getTotalLabel(e,t,s){return`${(s-1)*t+1}-${Math.min(s*t,e)} / ${e}개`}createPageSizeSelector(e,t,s){const i=document.createElement("div");i.className="designbase-wc-pagination__page-size";const n=document.createElement("label");n.className="designbase-wc-pagination__page-size-label";const a=document.createElement("span");a.className="designbase-wc-pagination__page-size-text",a.textContent="페이지당";const r=document.createElement("db-select");return r.className="designbase-wc-pagination__page-size-select",r.setAttribute("size",e),r.setAttribute("show-clear-button","false"),r.setAttribute("searchable","false"),r.setAttribute("options",JSON.stringify(this.getPageSizeOptions().map(e=>({value:String(e),label:String(e)})))),r.setAttribute("value",String(t)),s&&r.setAttribute("disabled",""),r.addEventListener("db-change",e=>{const s=e.detail,i=Number(s?.value);Number.isNaN(i)||i===t||(this.setAttribute("page-size",String(i)),this.dispatchEvent(new CustomEvent("db-page-size-change",{detail:{pageSize:i},bubbles:!0,composed:!0})))}),n.append(a,r),i.append(n),i}getPageNumbers(){const e=Number(this.getAttribute("sibling-count")||1),t=Number(this.getAttribute("boundary-count")||1),s=this.totalPages,i=this.currentPage;if(s<=2*e+3+2)return Array.from({length:s},(e,t)=>t+1);const n=Math.max(i-e,t),a=Math.min(i+e,s-t+1),r=n>t+2,o=a<s-t-1;if(!r&&o){const t=3+2*e;return[...Array.from({length:t},(e,t)=>t+1),"...",s]}if(r&&!o){const t=3+2*e;return[1,"...",...Array.from({length:t},(e,i)=>s-t+i+1)]}return r&&o?[1,"...",...Array.from({length:a-n+1},(e,t)=>n+t),"...",s]:Array.from({length:s},(e,t)=>t+1)}createPageButton(e,t){const s=e===this.currentPage,i=document.createElement("li");i.className="designbase-wc-pagination__item";const n=document.createElement("button");return n.type="button",n.className=["designbase-wc-pagination__button",s&&"designbase-wc-pagination__button--active"].filter(Boolean).join(" "),n.textContent=String(e),n.disabled=t,s&&n.setAttribute("aria-current","page"),n.setAttribute("aria-label",`페이지 ${e}로 이동`),n.addEventListener("click",()=>this.select(e)),i.append(n),i}createIconButton(e,t,s,i){const n=document.createElement("li");n.className="designbase-wc-pagination__item";const a=document.createElement("button");return a.type="button",a.className=`designbase-wc-pagination__button designbase-wc-pagination__button--${i}`,a.disabled=this.hasAttribute("disabled"),a.setAttribute("aria-label",s),a.append(createDbIcon(e,this.iconSize())),a.addEventListener("click",()=>this.select(t)),n.append(a),n}select(e){this.hasAttribute("disabled")||e===this.currentPage||e<1||e>this.totalPages||(this.currentPage=e,this.dispatchEvent(new CustomEvent("db-change",{detail:{page:e},bubbles:!0,composed:!0})))}}customElements.get("db-pagination")||customElements.define("db-pagination",DbPagination);class DbRadio extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.userInteracted=!1,this.handleChange=()=>{if(!this.input||this.disabled||this.readOnly)return;this.userInteracted=!0;const e=this.input.checked;this.toggleAttribute("checked",e),this.syncVisual(),this.syncClasses(),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:e,selected:e,value:this.getAttribute("value")||""},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","size","disabled","readonly","required","name","value","has-label"]}get checked(){return this.input?.checked??(this.hasAttribute("checked")||this.hasAttribute("selected"))}set checked(e){this.toggleAttribute("checked",e),this.input&&(this.input.checked=e,this.syncVisual(),this.syncClasses())}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e),this.input&&(this.input.disabled=e),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(e){this.toggleAttribute("readonly",e),this.input&&(this.input.readOnly=e),this.syncClasses()}get required(){return this.hasAttribute("required")}set required(e){this.toggleAttribute("required",e),this.input&&(this.input.required=e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState()}attributeChangedCallback(e){if(this.built)return"checked"===e||"selected"===e?(this.input&&(this.input.checked=this.hasAttribute("checked")||this.hasAttribute("selected")),this.syncVisual(),void this.syncClasses()):void this.syncState()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}build(){for(this.root=document.createElement("label"),this.root.className="designbase-wc-radio",this.input=document.createElement("input"),this.input.type="radio",this.input.className="designbase-wc-radio__input",this.visual=document.createElement("span"),this.visual.className="designbase-wc-radio__visual",this.visual.setAttribute("aria-hidden","true"),this.dot=document.createElement("span"),this.dot.className="designbase-wc-radio__dot",this.visual.appendChild(this.dot),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-radio__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(this.input,this.visual,this.labelEl),this.appendChild(this.root),this.input.addEventListener("change",this.handleChange),this.built=!0}syncState(){if(!this.root||!this.input||!this.visual)return;const e=this.hasAttribute("checked")||this.hasAttribute("selected")||!this.userInteracted&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected"));this.input.checked=e,this.input.disabled=this.disabled,this.input.readOnly=this.readOnly,this.input.required=this.required,this.input.name=this.getAttribute("name")||"",this.input.value=this.getAttribute("value")||"",this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncVisual(),this.syncClasses()}syncVisual(){}syncClasses(){if(!this.root||!this.input)return;const e=J.includes(this.size)?this.size:"m",t=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim());this.root.className=["designbase-wc-radio",`designbase-wc-radio--${e}`,this.input.checked&&"designbase-wc-radio--selected",this.disabled&&"designbase-wc-radio--disabled",this.readOnly&&"designbase-wc-radio--readonly",!t&&"designbase-wc-radio--no-label"].filter(Boolean).join(" ")}}customElements.get("db-radio")||customElements.define("db-radio",DbRadio);class DbSearchBar extends HTMLElement{constructor(){super(...arguments),this.recentSearches=[],this.isFocused=!1,this.currentSuggestion=0,this.scrollParents=[]}static get observedAttributes(){return["value","default-value","placeholder","size","appearance","disabled","readonly","full-width","show-shortcut","shortcut-label","enable-recent-searches","recent-searches-key","recent-searches-layout","suggested-searches","suggestion-rolling-interval","categories","selected-category","search-results","empty-state-message"]}getResolvedSize(){const e=this.getAttribute("size")||"m";return ee.includes(e)?e:"m"}getIconPx(){return getDbComponentIconSize(this.getResolvedSize())}syncIcons(){const e=this.getIconPx();this.querySelector(".designbase-wc-search-bar__search-icon")?.replaceChildren(createDbIcon("search",e)),this.clearButton?.replaceChildren(createDbIcon("close",e))}hasInputValue(){return Boolean((this.input?.value??this.getAttribute("value")??"").trim())}get value(){return this.input?.value??this.getAttribute("value")??""}set value(e){this.setAttribute("value",e),this.input&&(this.input.value=e)}connectedCallback(){this.loadRecentSearches(),this.render(),this.bindGlobalShortcut()}disconnectedCallback(){this.clearSuggestionInterval(),this.unbindGlobalShortcut(),this.detachDropdownPortal(),this.blurTimer&&clearTimeout(this.blurTimer)}attributeChangedCallback(e){if(this.isConnected)return"value"===e&&this.input?(this.input.value=this.getAttribute("value")||"",this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),void this.syncSuggestionRolling()):"disabled"===e||"readonly"===e||"placeholder"===e||"show-shortcut"===e||"shortcut-label"===e||"selected-category"===e||"search-results"===e||"empty-state-message"===e||"suggested-searches"===e?(this.syncAttributes(),this.syncPlaceholder(),this.updateDropdown(),void this.syncSuggestionRolling()):"enable-recent-searches"===e||"recent-searches-key"===e?(this.loadRecentSearches(),void this.updateDropdown()):void("categories"!==e&&"recent-searches-layout"!==e?this.render():this.updateDropdown())}focus(){this.input?.focus()}parseJsonArray(e){try{const t=JSON.parse(this.getAttribute(e)||"[]");return Array.isArray(t)?t:[]}catch{return[]}}getRecentSearchesKey(){return this.getAttribute("recent-searches-key")||"searchbar-recent-searches"}loadRecentSearches(){if(this.hasAttribute("enable-recent-searches"))try{const e=localStorage.getItem(this.getRecentSearchesKey());this.recentSearches=e?JSON.parse(e):[],Array.isArray(this.recentSearches)||(this.recentSearches=[])}catch{this.recentSearches=[]}else this.recentSearches=[]}saveRecentSearches(){try{localStorage.setItem(this.getRecentSearchesKey(),JSON.stringify(this.recentSearches))}catch{}}clearSuggestionInterval(){this.suggestionInterval&&(clearInterval(this.suggestionInterval),this.suggestionInterval=void 0)}syncSuggestionRolling(){this.clearSuggestionInterval();const e=this.parseJsonArray("suggested-searches"),t=this.hasInputValue(),s=Number(this.getAttribute("suggestion-rolling-interval")||5e3);e.length>0&&!t&&(this.suggestionInterval=setInterval(()=>{this.currentSuggestion=(this.currentSuggestion+1)%e.length,this.syncPlaceholder(),this.updateDropdown()},s))}syncPlaceholder(){if(!this.input)return;const e=this.parseJsonArray("suggested-searches"),t=this.hasInputValue(),s=this.getAttribute("placeholder")||"검색...";e.length>0&&!t?this.input.placeholder=e[this.currentSuggestion]||s:this.input.placeholder=s}syncValueState(){const e=this.hasInputValue();this.classList.toggle("designbase-wc-search-bar--has-value",e),this.clearButton&&(this.clearButton.hidden=!e||this.hasAttribute("disabled")||this.hasAttribute("readonly")),this.shortcutBadge&&(this.shortcutBadge.hidden=!this.hasAttribute("show-shortcut")||e||this.hasAttribute("disabled")||this.hasAttribute("readonly")),this.syncIcons()}syncAttributes(){const e=this.getAttribute("size")||"m",t=this.hasAttribute("disabled"),s=this.hasAttribute("readonly"),i=this.hasAttribute("show-shortcut");this.className=["designbase-wc-search-bar",`designbase-wc-search-bar--${ee.includes(e)?e:"m"}`,"pill"===this.getAttribute("appearance")&&"designbase-wc-search-bar--appearance-pill",t&&"designbase-wc-search-bar--disabled",s&&"designbase-wc-search-bar--readonly",this.hasAttribute("full-width")&&"designbase-wc-search-bar--full-width",Boolean(this.hasInputValue())&&"designbase-wc-search-bar--has-value"].filter(Boolean).join(" "),this.input&&(this.input.disabled=t,this.input.readOnly=s),this.shortcutBadge&&(this.shortcutBadge.hidden=!i||this.hasInputValue()||t||s,this.shortcutBadge.textContent=this.getAttribute("shortcut-label")||"⌘K"),this.syncValueState()}bindGlobalShortcut(){this.unbindGlobalShortcut(),!this.hasAttribute("show-shortcut")||this.hasAttribute("disabled")||this.hasAttribute("readonly")||(this.globalKeyHandler=e=>{const t=e.metaKey||e.ctrlKey;let s="k";const i=(this.getAttribute("shortcut-label")||"⌘K").slice(-1).toLowerCase();i&&(s=i),t&&e.key.toLowerCase()===s&&(e.preventDefault(),this.focus())},window.addEventListener("keydown",this.globalKeyHandler))}unbindGlobalShortcut(){this.globalKeyHandler&&(window.removeEventListener("keydown",this.globalKeyHandler),this.globalKeyHandler=void 0)}positionDropdown(){if(!this.dropdown||this.dropdown.hidden)return;const e=this.getBoundingClientRect(),t=this.input?.getBoundingClientRect(),s=t??e;this.dropdown.style.top=`${s.bottom+4}px`,this.dropdown.style.left=`${e.left}px`,this.dropdown.style.width=`${e.width}px`,this.dropdown.style.right="auto"}bindRepositionListeners(){if(this.repositionHandler)return;this.repositionHandler=()=>{requestAnimationFrame(()=>this.positionDropdown())},window.addEventListener("scroll",this.repositionHandler,{capture:!0,passive:!0}),window.addEventListener("resize",this.repositionHandler),this.scrollParents=[];let e=this.parentElement;for(;e&&e!==document.body;){const t=getComputedStyle(e),s=/(auto|scroll|overlay)/.test(t.overflowY),i=/(auto|scroll|overlay)/.test(t.overflow);(s||i)&&e.scrollHeight>e.clientHeight&&(e.addEventListener("scroll",this.repositionHandler,{passive:!0}),this.scrollParents.push(e)),e=e.parentElement}}unbindRepositionListeners(){this.repositionHandler&&(window.removeEventListener("scroll",this.repositionHandler,!0),window.removeEventListener("resize",this.repositionHandler),this.scrollParents.forEach(e=>e.removeEventListener("scroll",this.repositionHandler)),this.scrollParents=[],this.repositionHandler=void 0)}attachDropdownPortal(){this.dropdown&&!this.dropdown.hidden&&(this.dropdown.classList.add("designbase-wc-search-bar__dropdown--portal"),this.dropdown.parentElement!==document.body&&document.body.append(this.dropdown),requestAnimationFrame(()=>this.positionDropdown()),this.repositionHandler||this.bindRepositionListeners())}detachDropdownPortal(){this.unbindRepositionListeners(),this.dropdown&&(this.dropdown.classList.remove("designbase-wc-search-bar__dropdown--portal"),this.dropdown.style.top="",this.dropdown.style.left="",this.dropdown.style.width="",this.dropdown.style.right="",this.dropdown.parentElement===document.body&&this.isConnected&&this.append(this.dropdown))}shouldShowDropdown(){const e=this.hasInputValue(),t=this.parseJsonArray("categories"),s=this.parseJsonArray("suggested-searches"),i=this.getAttribute("search-results"),n=this.getAttribute("empty-state-message");return this.isFocused&&(t.length>0||this.hasAttribute("enable-recent-searches")&&this.recentSearches.length>0&&!e||s.length>0&&!e||null!==i&&e||Boolean(n)&&!e&&(!this.hasAttribute("enable-recent-searches")||0===this.recentSearches.length)&&0===s.length)}formatSearchResult(e){if("string"==typeof e||"number"==typeof e)return String(e);if(e&&"object"==typeof e){const t=e;if("string"==typeof t.title)return t.title;if("string"==typeof t.label)return t.label}return String(e)}handleSearch(e){const t=(e??this.value).trim();t&&(this.dispatchEvent(new CustomEvent("db-search",{detail:{value:t},bubbles:!0,composed:!0})),this.hasAttribute("enable-recent-searches")&&(this.recentSearches=[t,...this.recentSearches.filter(e=>e!==t)].slice(0,10),this.saveRecentSearches(),this.updateDropdown()))}updateDropdown(){if(!this.dropdown)return;const e=this.shouldShowDropdown();if(this.dropdown.hidden=!e,this.classList.toggle("designbase-wc-search-bar--dropdown-open",e),!e)return this.dropdown.replaceChildren(),void this.detachDropdownPortal();this.dropdown.replaceChildren();const t=this.hasInputValue(),s=this.parseJsonArray("categories"),i=this.parseJsonArray("suggested-searches"),n=this.getAttribute("selected-category")||"",a=this.parseJsonArray("search-results"),r=this.getAttribute("empty-state-message"),o=te.includes(this.getAttribute("recent-searches-layout")||"vertical")&&this.getAttribute("recent-searches-layout")||"vertical";if(s.length>0){const e=document.createElement("div");e.className="designbase-wc-search-bar__categories",s.forEach(t=>{const s=document.createElement("db-chip");s.setAttribute("label",t),s.setAttribute("size","s"),s.setAttribute("variant",t===n?"primary":"default"),s.setAttribute("clickable",""),s.addEventListener("mousedown",e=>{e.preventDefault(),this.setAttribute("selected-category",t),this.dispatchEvent(new CustomEvent("db-category-change",{detail:{category:t},bubbles:!0,composed:!0})),this.updateDropdown()}),e.append(s)}),this.dropdown.append(e)}if(t&&this.hasAttribute("search-results")){const e=document.createElement("div");if(e.className="designbase-wc-search-bar__results",a.length>0){const t=document.createElement("ul");t.className="designbase-wc-search-bar__results-list",a.forEach((e,s)=>{const i=document.createElement("li");i.className="designbase-wc-search-bar__result-item",i.textContent=this.formatSearchResult(e),i.addEventListener("mousedown",t=>{t.preventDefault(),this.isFocused=!1,this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-search-result-click",{detail:{result:e,index:s},bubbles:!0,composed:!0}))}),t.append(i)}),e.append(t)}else{const t=document.createElement("div");t.className="designbase-wc-search-bar__results-empty",t.textContent="검색 결과가 없습니다.",e.append(t)}return this.dropdown.append(e),void this.attachDropdownPortal()}if(this.hasAttribute("enable-recent-searches")&&!t&&this.recentSearches.length>0){const e=document.createElement("div");e.className=`designbase-wc-search-bar__recent-searches designbase-wc-search-bar__recent-searches--${o}`;const t=document.createElement("div");t.className="designbase-wc-search-bar__recent-header";const s=document.createElement("span");s.className="designbase-wc-search-bar__recent-title",s.textContent="최근 검색어";const i=document.createElement("button");i.type="button",i.className="designbase-wc-search-bar__clear-all-button",i.setAttribute("aria-label","모든 최근 검색어 삭제"),i.textContent="전체 삭제",i.addEventListener("mousedown",e=>{e.preventDefault(),this.recentSearches=[];try{localStorage.removeItem(this.getRecentSearchesKey())}catch{}this.updateDropdown()}),t.append(s,i);const n=document.createElement("div");n.className="designbase-wc-search-bar__recent-list",this.recentSearches.forEach(e=>{const t=document.createElement("div");t.className="designbase-wc-search-bar__recent-item";const s=document.createElement("button");s.type="button",s.className="designbase-wc-search-bar__recent-search-button",s.textContent=e,s.addEventListener("mousedown",t=>{if(t.preventDefault(),!this.input)return;this.input.value=e,this.setAttribute("value",e),this.syncValueState(),this.syncPlaceholder(),this.handleSearch(e);const s={value:e};this.dispatchEvent(new CustomEvent("db-input",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:s,bubbles:!0,composed:!0})),this.isFocused=!1,this.updateDropdown()});const i=document.createElement("button");i.type="button",i.className="designbase-wc-search-bar__recent-remove-button",i.setAttribute("aria-label",`${e} 삭제`),i.append(createDbIcon("close",getDbComponentIconSize("s"))),i.addEventListener("mousedown",t=>{t.preventDefault(),this.recentSearches=this.recentSearches.filter(t=>t!==e),this.saveRecentSearches(),this.updateDropdown()}),t.append(s,i),n.append(t)}),e.append(t,n),this.dropdown.append(e)}if(i.length>0&&!t){const e=document.createElement("div");e.className="designbase-wc-search-bar__suggestions";const t=document.createElement("div");t.className="designbase-wc-search-bar__suggestions-header";const s=document.createElement("span");s.className="designbase-wc-search-bar__suggestions-title",s.textContent="추천 검색어",t.append(s);const n=document.createElement("div");n.className="designbase-wc-search-bar__suggestions-list",i.forEach((e,t)=>{const s=document.createElement("button");s.type="button",s.className=["designbase-wc-search-bar__suggestion-item",t===this.currentSuggestion&&"designbase-wc-search-bar__suggestion-item--active"].filter(Boolean).join(" "),s.textContent=e,s.addEventListener("mousedown",t=>{if(t.preventDefault(),!this.input)return;this.clearSuggestionInterval(),this.input.value=e,this.setAttribute("value",e),this.syncValueState(),this.syncPlaceholder(),this.handleSearch(e);const s={value:e};this.dispatchEvent(new CustomEvent("db-input",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:s,bubbles:!0,composed:!0})),this.isFocused=!1,this.updateDropdown()}),n.append(s)}),e.append(t,n),this.dropdown.append(e)}if(r&&!t&&(!this.hasAttribute("enable-recent-searches")||0===this.recentSearches.length)&&0===i.length){const e=document.createElement("div");e.className="designbase-wc-search-bar__empty-state",e.textContent=r,this.dropdown.append(e)}this.attachDropdownPortal()}render(){const e=this.getAttribute("size")||"m",t=this.hasAttribute("disabled"),s=this.hasAttribute("readonly"),i=this.hasAttribute("full-width"),n=this.hasAttribute("show-shortcut"),a=this.getAttribute("value")??this.getAttribute("default-value")??"",r=Boolean(a.trim()),o=this.getIconPx();this.className=["designbase-wc-search-bar",`designbase-wc-search-bar--${ee.includes(e)?e:"m"}`,"pill"===this.getAttribute("appearance")&&"designbase-wc-search-bar--appearance-pill",t&&"designbase-wc-search-bar--disabled",s&&"designbase-wc-search-bar--readonly",i&&"designbase-wc-search-bar--full-width",r&&"designbase-wc-search-bar--has-value",this.shouldShowDropdown()&&"designbase-wc-search-bar--dropdown-open"].filter(Boolean).join(" "),this.setAttribute("role","search"),this.clearSuggestionInterval(),this.detachDropdownPortal(),this.replaceChildren();const l=document.createElement("div");l.className="designbase-wc-search-bar__container";const d=document.createElement("div");d.className="designbase-wc-search-bar__search-icon",d.setAttribute("aria-hidden","true"),d.append(createDbIcon("search",o));const h=document.createElement("input");if(h.type="text",h.className="designbase-wc-search-bar__input",h.value=a,h.disabled=t,h.readOnly=s,h.setAttribute("aria-label","검색어 입력"),this.input=h,n){const i=document.createElement("db-badge");i.className="designbase-wc-search-bar__shortcut-badge",i.setAttribute("size","l"===e?"m":"s"),i.setAttribute("variant","secondary"),i.setAttribute("type","text"),i.setAttribute("aria-hidden","true"),i.textContent=this.getAttribute("shortcut-label")||"⌘K",i.hidden=r||t||s,this.shortcutBadge=i,l.append(d,h,i)}else l.append(d,h);const u=document.createElement("button");u.type="button",u.className="designbase-wc-search-bar__clear-button",u.setAttribute("aria-label","검색어 지우기"),u.hidden=!r||t||s,u.append(createDbIcon("close",o)),this.clearButton=u,l.append(u);const b=document.createElement("div");b.className="designbase-wc-search-bar__dropdown",b.hidden=!0,b.addEventListener("mousedown",e=>{e.preventDefault()}),this.dropdown=b,h.addEventListener("input",()=>{this.setAttribute("value",h.value),this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),this.syncSuggestionRolling();const e={value:h.value};this.dispatchEvent(new CustomEvent("db-input",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:e,bubbles:!0,composed:!0}))}),h.addEventListener("keydown",e=>{"Enter"===e.key&&this.handleSearch()}),h.addEventListener("focus",()=>{this.isFocused=!0,this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-focus",{bubbles:!0,composed:!0}))}),h.addEventListener("blur",()=>{this.isFocused=!1,this.blurTimer&&clearTimeout(this.blurTimer),this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-blur",{bubbles:!0,composed:!0}))}),u.addEventListener("click",()=>{h.value="",this.setAttribute("value",""),this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),this.syncSuggestionRolling(),h.focus(),this.dispatchEvent(new CustomEvent("db-clear",{bubbles:!0,composed:!0}));const e={value:""};this.dispatchEvent(new CustomEvent("db-input",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:e,bubbles:!0,composed:!0}))}),this.append(l,b),this.syncIcons(),this.syncPlaceholder(),this.syncSuggestionRolling(),this.bindGlobalShortcut(),this.updateDropdown()}}customElements.get("db-search-bar")||customElements.define("db-search-bar",DbSearchBar);class DbSection extends HTMLElement{constructor(){super(...arguments),this.contentId=dbUid("db-section"),this.internalExpanded=!0,this.internalTabId="",this.handleToggle=()=>{if(!this.isCollapsible())return;const e=!this.isExpanded();this.hasAttribute("expanded")||(this.internalExpanded=e),this.dispatchEvent(new CustomEvent("db-expanded-change",{bubbles:!0,composed:!0,detail:{expanded:e}})),this.hasAttribute("expanded")||(this.syncHostClasses(),this.syncCollapsibleState())},this.handleTabChange=e=>{const t=e.detail,s=t?.id??this.parseTabs()[t?.index??0]?.id??String(t?.index??0);this.internalTabId=s,this.tabsEl?.setAttribute("selected-id",s),this.dispatchEvent(new CustomEvent("db-tab-change",{bubbles:!0,composed:!0,detail:{tabId:s}}))}}static get observedAttributes(){return["title","subtitle","description","size","collapsible","default-expanded","expanded","no-padding","full-width","full-height","overflow-visible","tabs","selected-tab-id","default-selected-tab-id"]}connectedCallback(){this.internalExpanded="false"!==this.getAttribute("default-expanded"),this.syncDefaultTab(),this.ensureStructure(),this.sync(),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this,{childList:!0})}disconnectedCallback(){this.observer?.disconnect()}attributeChangedCallback(e){if(this.isConnected){if("default-expanded"!==e||this.hasAttribute("expanded")||(this.internalExpanded="false"!==this.getAttribute("default-expanded")),"default-selected-tab-id"!==e&&"tabs"!==e||this.syncDefaultTab(),"selected-tab-id"===e){const e=this.getAttribute("selected-tab-id");e&&(this.internalTabId=e)}this.sync()}}syncDefaultTab(){if(this.internalTabId)return;const e=this.parseTabs(),t=this.getAttribute("default-selected-tab-id")||"";this.internalTabId=t||e[0]?.id||""}parseTabs(){try{const e=JSON.parse(this.getAttribute("tabs")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}getActiveTabId(){const e=this.getAttribute("selected-tab-id");return e&&this.internalTabId&&e!==this.internalTabId?this.internalTabId:e||this.internalTabId||this.tabsEl?.getAttribute("selected-id")||""}hasHeaderTabs(){return this.parseTabs().length>0&&!this.isCollapsible()}isCollapsible(){return this.hasAttribute("collapsible")}isExpanded(){return!this.isCollapsible()||(this.hasAttribute("expanded")?"false"!==this.getAttribute("expanded"):this.internalExpanded)}isUserNode(e){return!e.hasAttribute("data-wc-internal")}collectSlotted(e){const t=Array.from(this.querySelectorAll(`:scope > [slot="${e}"]`)).filter(this.isUserNode);if(t.length)return t;if("actions"===e&&this.actionsHostEl)return Array.from(this.actionsHostEl.children);if("footer"===e&&this.footerEl)return Array.from(this.footerEl.children);if("header"===e){const e=this.headerEl?.querySelector(".designbase-wc-section__header-main");return e?Array.from(e.children):[]}if("description"===e){const e=this.headerEl?.querySelector(".designbase-wc-section__description"),t=e?.firstElementChild;return t?[t]:[]}return[]}collectContentNodes(){const e=Array.from(this.children).filter(e=>{if(!this.isUserNode(e))return!1;const t=e.getAttribute("slot");return!t||"default"===t});return e.length?e:this.contentEl?Array.from(this.contentEl.children):[]}ensureStructure(){this.headerEl||(this.headerEl=document.createElement("div"),this.headerEl.className="designbase-wc-section__header",this.headerEl.setAttribute("data-wc-internal","")),this.bodyEl||(this.bodyEl=document.createElement("div"),this.bodyEl.className="designbase-wc-section__body",this.bodyEl.id=this.contentId,this.bodyEl.setAttribute("data-wc-internal",""),this.bodyInnerEl=document.createElement("div"),this.bodyInnerEl.className="designbase-wc-section__body-inner",this.bodyInnerEl.setAttribute("data-wc-internal",""),this.bodyEl.append(this.bodyInnerEl)),this.contentEl||(this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-section__content",this.contentEl.setAttribute("data-wc-internal","")),this.footerEl||(this.footerEl=document.createElement("div"),this.footerEl.className="designbase-wc-section__footer",this.footerEl.setAttribute("data-wc-internal","")),this.headerEl.isConnected||this.append(this.headerEl)}mountBody(){const e=this.collectContentNodes(),t=this.collectSlotted("footer");if(this.contentEl.replaceChildren(...e),this.footerEl.replaceChildren(...t),this.footerEl.hidden=0===t.length,this.isCollapsible())return this.bodyInnerEl.replaceChildren(this.contentEl,this.footerEl),void(this.bodyEl.isConnected||this.append(this.bodyEl));this.bodyEl?.remove(),this.contentEl.isConnected||this.append(this.contentEl),t.length?this.footerEl.isConnected||this.append(this.footerEl):this.footerEl.remove()}getChevronSize(){const e=this.getAttribute("size")||"m";return"s"===e?16:"l"===e?24:20}createTitleArea(){const e=this.getAttribute("title"),t=this.getAttribute("subtitle"),s=this.getAttribute("description"),i=this.collectSlotted("description")[0];if(!(e||t||s||i))return null;const n=document.createElement("div");if(n.className="designbase-wc-section__title-area",e){const t=document.createElement("h2");t.className="designbase-wc-section__title",t.textContent=e,n.append(t)}if(t){const e=document.createElement("h3");e.className="designbase-wc-section__subtitle",e.textContent=t,n.append(e)}if(i){const e=document.createElement("p");e.className="designbase-wc-section__description",e.append(i),n.append(e)}else if(s){const e=document.createElement("p");e.className="designbase-wc-section__description",e.textContent=s,n.append(e)}return n}createChevron(){const e=document.createElement("span");return e.className="designbase-wc-section__chevron",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("chevron-down",this.getChevronSize())),e}renderHeader(){if(!this.headerEl)return;const e=this.collectSlotted("header")[0],t=this.collectSlotted("actions"),s=this.createTitleArea(),i=this.hasHeaderTabs(),n=Boolean(e||s||t.length);if(this.headerEl.replaceChildren(),this.headerEl.hidden=!n&&!i,this.headerEl.classList.toggle("designbase-wc-section__header--with-tabs",i),!n&&!i)return;if(this.isCollapsible()){if(e){const t=document.createElement("button");t.type="button",t.className="designbase-wc-section__header-trigger",t.setAttribute("aria-expanded",String(this.isExpanded())),t.setAttribute("aria-controls",this.contentId),t.addEventListener("click",this.handleToggle);const s=document.createElement("div");s.className="designbase-wc-section__header-main",s.append(e),t.append(s,this.createChevron()),this.headerEl.append(t)}else{const e=document.createElement("button");e.type="button",e.className="designbase-wc-section__header-trigger",e.setAttribute("aria-expanded",String(this.isExpanded())),e.setAttribute("aria-controls",this.contentId),e.addEventListener("click",this.handleToggle),s&&e.append(s),e.append(this.createChevron()),this.headerEl.append(e),t.length&&(this.actionsHostEl=document.createElement("div"),this.actionsHostEl.className="designbase-wc-section__actions",this.actionsHostEl.addEventListener("click",e=>e.stopPropagation()),t.forEach(e=>this.actionsHostEl.append(e)),this.headerEl.append(this.actionsHostEl))}return}const appendHeaderMain=i=>{e?i.append(e):(s&&i.append(s),t.length&&(this.actionsHostEl=document.createElement("div"),this.actionsHostEl.className="designbase-wc-section__actions",t.forEach(e=>this.actionsHostEl.append(e)),i.append(this.actionsHostEl)))};if(i){const e=document.createElement("div");e.className="designbase-wc-section__header-row",appendHeaderMain(e),this.headerEl.append(e);const t=document.createElement("div");return t.className="designbase-wc-section__header-tabs",this.tabsEl||(this.tabsEl=document.createElement("db-tabs"),this.tabsEl.setAttribute("size","m"),this.tabsEl.addEventListener("db-change",this.handleTabChange)),this.tabsEl.setAttribute("items",JSON.stringify(this.parseTabs())),this.tabsEl.setAttribute("selected-id",this.getActiveTabId()),t.append(this.tabsEl),void this.headerEl.append(t)}appendHeaderMain(this.headerEl)}syncHostClasses(){const e=this.getAttribute("size")||"m",t=be.includes(e)?e:"m",s=this.isExpanded();this.className=["designbase-wc-section",`designbase-wc-section--size-${t}`,this.hasAttribute("no-padding")&&"designbase-wc-section--no-padding",this.hasHeaderTabs()&&"designbase-wc-section--has-header-tabs",this.hasAttribute("full-width")&&"designbase-wc-section--full-width",this.hasAttribute("full-height")&&"designbase-wc-section--full-height",this.hasAttribute("overflow-visible")&&"designbase-wc-section--overflow-visible",this.isCollapsible()&&"designbase-wc-section--collapsible",this.isCollapsible()&&s&&"designbase-wc-section--expanded",this.isCollapsible()&&!s&&"designbase-wc-section--collapsed"].filter(Boolean).join(" ")}syncCollapsibleState(){if(!this.isCollapsible()||!this.bodyEl)return;const e=this.isExpanded();this.bodyEl.setAttribute("aria-hidden",String(!e));const t=this.headerEl?.querySelector(".designbase-wc-section__header-trigger");t?.setAttribute("aria-expanded",String(e))}sync(){this.ensureStructure(),this.syncHostClasses(),this.renderHeader(),this.mountBody(),this.syncCollapsibleState()}}customElements.get("db-section")||customElements.define("db-section",DbSection);const je="designbase-wc-segment-control",qe={bar:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="12" width="4" height="8"/><rect x="10" y="8" width="4" height="12"/><rect x="17" y="4" width="4" height="16"/></svg>',line:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 16 9 10 14 13 20 6"/></svg>',pie:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v10l8.66 5"/><circle cx="12" cy="12" r="10"/></svg>',donut:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="3"/></svg>',radar:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 20 8 17 20 7 20 4 8"/></svg>'};class DbSegmentControl extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.indicatorEl=null,this.segmentButtons=[],this.focusedIndex=-1,this.boundKeyDown=e=>this.handleKeyDown(e),this.boundResize=()=>this.updateIndicator(),this.resizeObserver=null}static get observedAttributes(){return["options","value","default-value","size","variant","appearance","full-width","disabled"]}connectedCallback(){this.built||(this.built=!0),this.render(),this.addEventListener("keydown",this.boundKeyDown),window.addEventListener("resize",this.boundResize),this.resizeObserver=new ResizeObserver(()=>this.updateIndicator()),this.resizeObserver.observe(this)}disconnectedCallback(){this.removeEventListener("keydown",this.boundKeyDown),window.removeEventListener("resize",this.boundResize),this.resizeObserver?.disconnect(),this.resizeObserver=null}attributeChangedCallback(e){this.built&&("value"!==e?this.render():this.updateSelection())}get options(){return this.parseOptions(this.getAttribute("options"))}set options(e){const t="string"==typeof e?e:JSON.stringify(e);this.getAttribute("options")!==t&&this.setAttribute("options",t)}get value(){return this.getAttribute("value")||this.getAttribute("default-value")||this.options[0]?.value||""}set value(e){this.setAttribute("value",e)}parseOptions(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}render(){const e=this.getAttribute("size")||"m",t=this.getAttribute("variant")||"default",s=this.getAttribute("appearance")||"default",i=this.hasAttribute("disabled"),n=this.options,a=this.value;this.className=[je,`${je}--${e}`,`${je}--${t}`,"pill"===s&&`${je}--appearance-pill`,"rounded"===s&&`${je}--appearance-rounded`,this.hasAttribute("full-width")&&`${je}--full-width`,i&&`${je}--disabled`].filter(Boolean).join(" "),this.setAttribute("role","tablist"),this.setAttribute("aria-label","세그먼트 컨트롤"),this.replaceChildren(),this.segmentButtons=[],n.forEach((e,s)=>{const n=e.value===a,r=Boolean(i||e.disabled),o=document.createElement("button");if(o.type="button",o.className=[`${je}__segment`,n&&`${je}__segment--selected`,r&&`${je}__segment--disabled`].filter(Boolean).join(" "),o.setAttribute("role","tab"),o.setAttribute("aria-selected",String(n)),o.setAttribute("aria-disabled",String(r)),o.setAttribute("tabindex",n?"0":"-1"),o.disabled=r,e.icon&&qe[e.icon]){const t=document.createElement("span");t.className=`${je}__segment-icon`,t.innerHTML=qe[e.icon],o.appendChild(t)}const l=document.createElement("span");l.className=`${je}__segment-label`,l.textContent=e.label,"icon-only"===t&&l.setAttribute("aria-label",e.label),o.appendChild(l),o.addEventListener("click",()=>this.select(e.value)),o.addEventListener("focus",()=>{this.focusedIndex=s,o.classList.add(`${je}__segment--focused`)}),o.addEventListener("blur",()=>{this.focusedIndex=-1,o.classList.remove(`${je}__segment--focused`)}),this.appendChild(o),this.segmentButtons.push(o)}),this.indicatorEl=document.createElement("div"),this.indicatorEl.className=`${je}__indicator`,this.appendChild(this.indicatorEl),this.updateSelection()}updateSelection(){const e=this.options,t=this.value,s=e.findIndex(e=>e.value===t);this.segmentButtons.forEach((s,i)=>{const n=e[i],a=n?.value===t;s.classList.toggle(`${je}__segment--selected`,a),s.setAttribute("aria-selected",String(a)),s.setAttribute("tabindex",a?"0":"-1")}),this.indicatorEl&&e.length>0&&s>=0&&requestAnimationFrame(()=>this.updateIndicator())}updateIndicator(){const e=this.options.findIndex(e=>e.value===this.value),t=this.segmentButtons[e];this.indicatorEl&&t&&(this.indicatorEl.style.width=`${t.offsetWidth}px`,this.indicatorEl.style.transform=`translateX(${t.offsetLeft}px)`)}select(e){if(this.hasAttribute("disabled"))return;const t=this.options.find(t=>t.value===e);t&&!t.disabled&&(this.setAttribute("value",e),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e},bubbles:!0,composed:!0})))}handleKeyDown(e){if(this.hasAttribute("disabled"))return;const t=this.options,s=t.findIndex(e=>e.value===this.value);if(-1===s)return;let i=s;switch(e.key){case"ArrowLeft":e.preventDefault(),i=s>0?s-1:t.length-1;break;case"ArrowRight":e.preventDefault(),i=s<t.length-1?s+1:0;break;case"Home":e.preventDefault(),i=0;break;case"End":e.preventDefault(),i=t.length-1;break;case"Enter":case" ":return e.preventDefault(),void this.select(t[i]?.value??this.value);default:return}for(;i!==s;){const s=t[i];if(s&&!s.disabled){this.segmentButtons[i]?.focus();break}i="ArrowLeft"===e.key||"Home"===e.key?i>0?i-1:t.length-1:i<t.length-1?i+1:0}}}customElements.get("db-segment-control")||customElements.define("db-segment-control",DbSegmentControl);class DbSelect extends HTMLElement{constructor(){super(...arguments),this.internals=this.attachInternals(),this.built=!1,this.searchTerm="",this.focusedIndex=-1,this.handleTriggerClick=()=>{this.hasAttribute("disabled")||this.hasAttribute("readonly")||(this.open=!this.open,this.open&&this.searchable&&setTimeout(()=>this.searchInput?.focus(),0))},this.handleTriggerFocus=()=>{this.trigger?.classList.add("designbase-wc-select__trigger--focused")},this.handleTriggerBlur=()=>{this.trigger?.classList.remove("designbase-wc-select__trigger--focused")},this.handleClear=e=>{e.stopPropagation();const t=[];this.setSelectedValues(t),this.syncTrigger(),this.syncOptions(),this.dispatchChange(t)},this.handleSearchInput=()=>{this.searchTerm=this.searchInput?.value||"",this.focusedIndex=-1,this.syncOptions()},this.handleDocumentMouseDown=e=>{this.contains(e.target)||(this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1,this.syncOptions())},this.handleDocumentKeyDown=e=>{if(!this.contains(document.activeElement))return;if(!this.open)return void("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.open=!0));const t=this.getFilteredOptions();switch(e.key){case"Escape":e.preventDefault(),this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1,this.syncOptions();break;case"ArrowDown":e.preventDefault(),this.focusedIndex=Math.min(this.focusedIndex+1,t.length-1),this.syncOptions();break;case"ArrowUp":e.preventDefault(),this.focusedIndex=Math.max(this.focusedIndex-1,0),this.syncOptions();break;case"Enter":e.preventDefault(),this.focusedIndex>=0&&t[this.focusedIndex]&&this.selectOption(t[this.focusedIndex])}}}static get observedAttributes(){return["options","value","placeholder","label","size","full-width","disabled","readonly","required","error","error-message","helper-text","multiple","searchable","show-clear-button","open","max-height","position","dropdown-width","name"]}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get open(){return this.hasAttribute("open")}set open(e){this.toggleAttribute("open",e),this.syncOpenState()}get value(){return this.getAttribute("value")||""}set value(e){e?this.setAttribute("value",e):this.removeAttribute("value"),this.syncTrigger(),this.syncOptions(),this.syncFormValue()}connectedCallback(){this.built||this.build(),this.syncState(),queueMicrotask(()=>{this.isConnected&&this.syncFormValue()}),document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown)}formAssociatedCallback(){this.syncFormValue()}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}formResetCallback(){this.removeAttribute("value"),this.internals.setFormValue(null),this.built&&(this.syncTrigger(),this.syncOptions(),this.syncFormValue())}formDisabledCallback(e){this.toggleAttribute("disabled",e)}attributeChangedCallback(e){if(this.built){if("open"!==e)return"value"===e?(this.syncTrigger(),this.syncOptions(),void this.syncFormValue()):void this.syncState();this.syncOpenState()}}get multiple(){return this.hasAttribute("multiple")}set multiple(e){this.toggleAttribute("multiple",Boolean(e))}get searchable(){return this.hasAttribute("searchable")}set searchable(e){this.toggleAttribute("searchable",Boolean(e))}get showClearButton(){return!this.hasAttribute("show-clear-button")||"false"!==this.getAttribute("show-clear-button")}parseOptions(){const e=this.getAttribute("options")||"[]";try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return e.split(",").map(e=>e.trim()).filter(Boolean).map(e=>({value:e,label:e}))}}parseSelectedValues(){const e=this.getAttribute("value")||"";if(!e)return[];if(this.multiple)try{const t=JSON.parse(e);return Array.isArray(t)?t.map(String):[]}catch{return e.split(",").map(e=>e.trim()).filter(Boolean)}return e?[e]:[]}setSelectedValues(e){this.multiple?e.length?this.setAttribute("value",JSON.stringify(e)):this.removeAttribute("value"):e[0]?this.setAttribute("value",e[0]):this.removeAttribute("value")}syncFormValue(){const e=this.parseSelectedValues();if(this.multiple){const t=new FormData;return e.forEach(e=>t.append(this.name||"select",e)),void this.internals.setFormValue(e.length?t:null)}this.internals.setFormValue(e[0]||null)}getIconSize(){const e=this.getAttribute("size")||"m";return getDbComponentIconSize(Z.includes(e)?e:"m")}syncIndicatorIcons(){const e=this.getIconSize();this.clearButton?.replaceChildren(createDbIcon("close",e)),this.chevronEl&&this.chevronEl.replaceChildren(createDbIcon(this.open?"chevron-up":"chevron-down",e))}build(){const e=this.getAttribute("id")||dbUid("db-select"),t=`${e}-listbox`;this.hasAttribute("id")||this.setAttribute("id",e),this.labelEl=document.createElement("label"),this.labelEl.className="designbase-wc-select__label",this.trigger=document.createElement("div"),this.trigger.className="designbase-wc-select__trigger",this.trigger.tabIndex=0,this.trigger.setAttribute("role","combobox"),this.trigger.setAttribute("aria-haspopup","listbox"),this.trigger.setAttribute("aria-controls",t),this.trigger.addEventListener("click",this.handleTriggerClick),this.trigger.addEventListener("focus",this.handleTriggerFocus),this.trigger.addEventListener("blur",this.handleTriggerBlur),this.valueEl=document.createElement("div"),this.valueEl.className="designbase-wc-select__value",this.indicatorsEl=document.createElement("div"),this.indicatorsEl.className="designbase-wc-select__indicators",this.clearButton=document.createElement("button"),this.clearButton.type="button",this.clearButton.className="designbase-wc-select__clear-button",this.clearButton.setAttribute("aria-label",labelFrom(this,"label-clear","clearAll")),this.clearButton.hidden=!0,this.clearButton.appendChild(createDbIcon("close",this.getIconSize())),this.clearButton.addEventListener("click",this.handleClear),this.chevronEl=document.createElement("div"),this.chevronEl.className="designbase-wc-select__chevron",this.indicatorsEl.append(this.clearButton,this.chevronEl),this.trigger.append(this.valueEl,this.indicatorsEl),this.dropdown=document.createElement("div"),this.dropdown.className="designbase-wc-select__dropdown",this.searchWrap=document.createElement("div"),this.searchWrap.className="designbase-wc-select__search",this.searchWrap.hidden=!0,this.searchInput=document.createElement("input"),this.searchInput.type="text",this.searchInput.className="designbase-wc-select__search-input",this.searchInput.placeholder=labelFrom(this,"label-search","search.label"),this.searchInput.addEventListener("input",this.handleSearchInput),this.searchInput.addEventListener("mousedown",e=>e.stopPropagation()),this.searchInput.addEventListener("click",e=>e.stopPropagation()),this.searchWrap.appendChild(this.searchInput),this.optionsEl=document.createElement("div"),this.optionsEl.className="designbase-wc-select__options",this.optionsEl.id=t,this.optionsEl.setAttribute("role","listbox"),this.dropdown.append(this.searchWrap,this.optionsEl),this.helperEl=document.createElement("p"),this.helperEl.className="designbase-wc-select__helper-text",this.errorEl=document.createElement("p"),this.errorEl.className="designbase-wc-select__error-message",this.append(this.labelEl,this.trigger,this.dropdown,this.helperEl,this.errorEl),this.built=!0}getFilteredOptions(){const e=this.parseOptions();if(!this.searchable||!this.searchTerm)return e;const t=this.searchTerm.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(t))}selectOption(e){if(e.disabled)return;const t=this.parseSelectedValues();let s;this.multiple?s=t.includes(e.value)?t.filter(t=>t!==e.value):[...t,e.value]:(s=[e.value],this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1),this.setSelectedValues(s),this.syncTrigger(),this.syncOptions(),this.dispatchChange(s)}dispatchChange(e){const t=this.parseOptions();if(this.multiple)return this.syncFormValue(),this.dispatchEvent(new Event("change",{bubbles:!0})),void this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e,labels:e.map(e=>t.find(t=>t.value===e)?.label||e)},bubbles:!0,composed:!0}));const s=e[0]||"",i=t.find(e=>e.value===s)?.label||"";this.syncFormValue(),this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:s,label:i},bubbles:!0,composed:!0}))}syncAccessibleName(e){if(!this.trigger)return;if(e&&this.labelEl)return this.labelEl.id||(this.labelEl.id=dbUid("db-select-label")),this.trigger.setAttribute("aria-labelledby",this.labelEl.id),void this.trigger.removeAttribute("aria-label");this.trigger.removeAttribute("aria-labelledby");const t=this.getAttribute("aria-label")||this.getAttribute("placeholder")||t$2("select.placeholder");this.trigger.setAttribute("aria-label",t)}syncState(){if(!this.trigger||!this.dropdown||!this.optionsEl)return;const e=coerceToContract(this.getAttribute("size"),Z,"m"),t=coerceToContract(this.getAttribute("position"),X,"bottom"),s="full"===this.getAttribute("dropdown-width")?"full":"auto",i=Number(this.getAttribute("max-height")||200),n=this.getAttribute("label")||"",a=this.getAttribute("helper-text")||"",r=this.getAttribute("error-message")||"",o=this.hasAttribute("error"),l=this.getAttribute("id")||"";this.className=["designbase-wc-select",`designbase-wc-select--${e}`,this.open&&"designbase-wc-select--open",o&&"designbase-wc-select--error",this.hasAttribute("disabled")&&"designbase-wc-select--disabled",this.hasAttribute("readonly")&&"designbase-wc-select--readonly",this.hasAttribute("full-width")&&"designbase-wc-select--full-width",this.multiple&&"designbase-wc-select--multiple",this.searchable&&"designbase-wc-select--searchable"].filter(Boolean).join(" ");const d=this.parseSelectedValues();if(this.classList.toggle("designbase-wc-select--has-value",d.length>0),this.labelEl){const e=this.hasAttribute("required")?'<span class="designbase-wc-select__required" aria-hidden="true">*</span>':"";this.labelEl.innerHTML=n?`${this.escape(n)}${e}`:"",this.labelEl.hidden=!n}this.syncAccessibleName(n),this.dropdown.className=["designbase-wc-select__dropdown",`designbase-wc-select__dropdown--${s}`,`designbase-wc-select__dropdown--${t}`,this.open&&"designbase-wc-select__dropdown--open"].filter(Boolean).join(" "),this.optionsEl.style.maxHeight=`${i}px`,this.searchWrap&&(this.searchWrap.hidden=!this.searchable);const h=`${l}-helper`,u=`${l}-error`;o&&r?(this.errorEl.id=u,this.errorEl.textContent=r,this.errorEl.hidden=!1,this.helperEl.hidden=!0,this.trigger.setAttribute("aria-describedby",u),this.trigger.setAttribute("aria-invalid","true")):a?(this.helperEl.id=h,this.helperEl.textContent=a,this.helperEl.hidden=!1,this.errorEl.hidden=!0,this.trigger.setAttribute("aria-describedby",h),this.trigger.removeAttribute("aria-invalid")):(this.helperEl.hidden=!0,this.errorEl.hidden=!0,this.trigger.removeAttribute("aria-describedby"),this.trigger.removeAttribute("aria-invalid")),this.hasAttribute("disabled")||this.hasAttribute("readonly")?this.trigger.tabIndex=-1:this.trigger.tabIndex=0,this.syncOpenState(),this.syncTrigger(),this.syncOptions(),this.syncFormValue(),this.syncIndicatorIcons()}syncOpenState(){this.trigger&&this.dropdown&&this.chevronEl&&(this.trigger.setAttribute("aria-expanded",String(this.open)),this.classList.toggle("designbase-wc-select--open",this.open),this.dropdown.classList.toggle("designbase-wc-select__dropdown--open",this.open),this.syncIndicatorIcons())}syncTrigger(){if(!this.valueEl||!this.clearButton)return;const e=this.parseOptions(),t=this.parseSelectedValues(),s=this.getAttribute("placeholder")||t$2("select.placeholder"),i=t.length>0,n=i&&this.showClearButton&&!this.hasAttribute("disabled")&&!this.hasAttribute("readonly");if(this.valueEl.replaceChildren(),this.multiple)if(0===t.length){const e=document.createElement("span");e.className="designbase-wc-select__placeholder",e.textContent=s,this.valueEl.appendChild(e)}else{const s=document.createElement("div");s.className="designbase-wc-select__tags",t.forEach(i=>{const n=e.find(e=>e.value===i),a=document.createElement("span");a.className="designbase-wc-select__tag";const r=document.createElement("span");r.className="designbase-wc-select__tag-label",r.textContent=n?.label||i;const o=document.createElement("button");o.type="button",o.className="designbase-wc-select__tag-remove",o.setAttribute("aria-label",`${n?.label||i} 제거`),o.appendChild(createDbIcon("close",12)),o.addEventListener("click",e=>{e.stopPropagation();const s=t.filter(e=>e!==i);this.setSelectedValues(s),this.syncTrigger(),this.syncOptions(),this.dispatchChange(s)}),a.append(r,o),s.appendChild(a)}),this.valueEl.appendChild(s)}else{const n=document.createElement("span");n.className="designbase-wc-select__single-value";const a=e.find(e=>e.value===t[0]);n.textContent=i?a?.label||t[0]:s,i||n.classList.add("designbase-wc-select__placeholder"),this.valueEl.appendChild(n)}this.clearButton.hidden=!n,this.clearButton.setAttribute("aria-hidden",n?"false":"true"),this.classList.toggle("designbase-wc-select--has-value",i)}syncOptions(){if(!this.optionsEl)return;const e=this.getFilteredOptions(),t=this.parseSelectedValues(),s=this.getAttribute("id")||"db-select";if(this.optionsEl.replaceChildren(),0===e.length){const e=document.createElement("div");return e.className="designbase-wc-select__no-options",e.textContent=this.searchTerm?labelFrom(this,"label-no-results","select.noResults"):labelFrom(this,"label-empty","select.noResults"),void this.optionsEl.appendChild(e)}e.forEach((e,i)=>{const n=t.includes(e.value),a=i===this.focusedIndex,r=document.createElement("div");if(r.className=["designbase-wc-select__option",n&&"designbase-wc-select__option--selected",a&&"designbase-wc-select__option--focused",e.disabled&&"designbase-wc-select__option--disabled"].filter(Boolean).join(" "),r.id=`${s}-option-${i}`,r.setAttribute("role","option"),r.setAttribute("aria-selected",String(n)),r.addEventListener("click",()=>this.selectOption(e)),this.multiple){const t=document.createElement("div");t.className="designbase-wc-select__checkbox";const s=document.createElement("db-checkbox");s.setAttribute("size","s"),s.setAttribute("has-label","false"),n&&s.setAttribute("checked",""),e.disabled&&s.setAttribute("disabled",""),t.appendChild(s),r.appendChild(t)}const o=document.createElement("span");o.className="designbase-wc-select__option-label",o.textContent=e.label,r.appendChild(o),this.optionsEl.appendChild(r)}),this.focusedIndex>=0?this.trigger?.setAttribute("aria-activedescendant",`${s}-option-${this.focusedIndex}`):this.trigger?.removeAttribute("aria-activedescendant")}escape(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]||e))}}DbSelect.formAssociated=!0,customElements.get("db-select")||customElements.define("db-select",DbSelect);const Ue="240px";class DbSidebar extends HTMLElement{constructor(){super(...arguments),this.expandedItems=new Set,this.userMenuOpen=!1,this.projectMenuOpen=!1,this.flyoutItemId=null,this.userFlyoutItemId=null,this.flyoutCloseTimer=null,this.userFlyoutCloseTimer=null,this.outsideHandler=null,this.panelMediaQuery=null,this.panelMediaHandler=null,this.resolvedPanelMode="adjacent"}collectCustomNavSlots(){const e=new Map;return we.forEach(t=>{const s=Array.from(this.children).filter(e=>e instanceof HTMLElement&&e.getAttribute("slot")===t),i=Array.from(this.querySelectorAll(`[data-sidebar-slot="${t}"]`)).flatMap(e=>Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.getAttribute("slot")===t));e.set(t,[...new Set([...s,...i])])}),e}createCustomNavSlot(e){const t=document.createElement("div");return t.className=["designbase-wc-sidebar__custom-slot",`designbase-wc-sidebar__custom-slot--${e}`].join(" "),t.dataset.sidebarSlot=e,t}projectCustomNavSlots(e){we.forEach(t=>{const s=this.querySelector(`[data-sidebar-slot="${t}"]`),i=e.get(t)??[];s&&0!==i.length?s.append(...i):s?.remove()})}static get observedAttributes(){return["items","sections","user-menu-items","user-profile","default-expanded-ids","projects","selected-project-id","project-manage-label","project-manage-href","project-section-label","project-empty-label","project-empty-trigger-label","bottom-items","bottom-sections","promo-banner","update-banner","header-type","back-label","back-href","panels","settings-sections","active-panel","panel-mode","panel-width","panel-breakpoint","size","theme","variant","position","collapsed","collapsible","show-logo","logo-type","logo-text","full-height","shadow"]}connectedCallback(){this.seedExpanded(),this.bindPanelMediaQuery(),this.render(),this.bindOutsideClick()}disconnectedCallback(){this.unbindOutsideClick(),this.unbindPanelMediaQuery(),this.cancelFlyoutClose(),this.cancelUserFlyoutClose()}attributeChangedCallback(e,t,s){if(this.isConnected&&t!==s&&("default-expanded-ids"===e&&this.seedExpanded(),"collapsed"===e&&this.hasAttribute("collapsed")&&(this.userMenuOpen=!1,this.projectMenuOpen=!1,this.flyoutItemId=null,this.userFlyoutItemId=null,this.cancelFlyoutClose(),this.cancelUserFlyoutClose()),"panel-mode"!==e&&"panel-breakpoint"!==e||this.bindPanelMediaQuery(),this.render(),"active-panel"===e)){const e=this.getActivePanelConfig();this.dispatchEvent(new CustomEvent("db-panel-change",{bubbles:!0,composed:!0,detail:{panel:e?.id??"main",panelConfig:e,mode:this.resolvedPanelMode}}))}}bindPanelMediaQuery(){this.unbindPanelMediaQuery();const e=this.panelMode;if("auto"!==e)return void(this.resolvedPanelMode=e);if("undefined"==typeof window||"function"!=typeof window.matchMedia)return void(this.resolvedPanelMode="adjacent");const t=window.matchMedia(`(min-width: ${this.panelBreakpoint}px)`);this.panelMediaQuery=t,this.resolvedPanelMode=t.matches?"adjacent":"replace",this.panelMediaHandler=e=>{const t=e.matches?"adjacent":"replace";t!==this.resolvedPanelMode&&(this.resolvedPanelMode=t,this.render(),this.dispatchEvent(new CustomEvent("db-panel-mode-change",{bubbles:!0,composed:!0,detail:{mode:t}})))},t.addEventListener("change",this.panelMediaHandler)}unbindPanelMediaQuery(){this.panelMediaQuery&&this.panelMediaHandler&&this.panelMediaQuery.removeEventListener("change",this.panelMediaHandler),this.panelMediaQuery=null,this.panelMediaHandler=null}seedExpanded(){try{const e=JSON.parse(this.getAttribute("default-expanded-ids")||"[]");Array.isArray(e)&&(this.expandedItems=new Set(e))}catch{this.expandedItems=new Set}}get items(){try{const e=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}get sections(){return this.parseSections()}set sections(e){this.setAttribute("sections","string"==typeof e?e:JSON.stringify(e))}get userMenuItems(){return this.parseUserMenuItems()}set userMenuItems(e){this.setAttribute("user-menu-items","string"==typeof e?e:JSON.stringify(e))}get userProfile(){return this.parseUserProfile()}set userProfile(e){null==e?this.removeAttribute("user-profile"):this.setAttribute("user-profile","string"==typeof e?e:JSON.stringify(e))}get projects(){return this.parseProjects()}set projects(e){this.setAttribute("projects","string"==typeof e?e:JSON.stringify(e))}get selectedProjectId(){return this.getAttribute("selected-project-id")||""}set selectedProjectId(e){e?this.setAttribute("selected-project-id",e):this.removeAttribute("selected-project-id")}get projectManageLabel(){return this.getAttribute("project-manage-label")||"프로젝트 관리"}set projectManageLabel(e){this.setAttribute("project-manage-label",e)}get projectManageHref(){return this.getAttribute("project-manage-href")||""}set projectManageHref(e){e?this.setAttribute("project-manage-href",e):this.removeAttribute("project-manage-href")}get projectSectionLabel(){return this.getAttribute("project-section-label")||"프로젝트"}set projectSectionLabel(e){this.setAttribute("project-section-label",e)}get projectEmptyLabel(){return this.getAttribute("project-empty-label")||"프로젝트를 추가해 주세요"}set projectEmptyLabel(e){this.setAttribute("project-empty-label",e)}get projectEmptyTriggerLabel(){return this.getAttribute("project-empty-trigger-label")||"프로젝트 추가"}set projectEmptyTriggerLabel(e){this.setAttribute("project-empty-trigger-label",e)}get bottomItems(){return this.parseBottomItems()}set bottomItems(e){this.setAttribute("bottom-items","string"==typeof e?e:JSON.stringify(e))}get bottomSections(){return this.parseBottomSections()}set bottomSections(e){this.setAttribute("bottom-sections","string"==typeof e?e:JSON.stringify(e))}get promoBanner(){return this.parsePromoBanner()}set promoBanner(e){null==e?this.removeAttribute("promo-banner"):this.setAttribute("promo-banner","string"==typeof e?e:JSON.stringify(e))}get updateBanner(){return this.parseUpdateBanner()}set updateBanner(e){null==e?this.removeAttribute("update-banner"):this.setAttribute("update-banner","string"==typeof e?e:JSON.stringify(e))}get headerType(){return"back"===this.getAttribute("header-type")?"back":"default"}set headerType(e){this.setAttribute("header-type",e)}get backLabel(){return this.getAttribute("back-label")||"뒤로가기"}set backLabel(e){this.setAttribute("back-label",e)}get backHref(){return this.getAttribute("back-href")||""}set backHref(e){e?this.setAttribute("back-href",e):this.removeAttribute("back-href")}get panels(){return this.parsePanels()}set panels(e){this.setAttribute("panels","string"==typeof e?e:JSON.stringify(e))}get settingsSections(){return this.parseSettingsSections()}set settingsSections(e){this.setAttribute("settings-sections","string"==typeof e?e:JSON.stringify(e))}get activePanel(){const e=this.getAttribute("active-panel")||"main";return"main"===e?"main":this.findPanel(e)?e:"main"}set activePanel(e){const t=e&&"main"!==e&&this.findPanel(e)?e:"main";this.setAttribute("active-panel",t)}get panelMode(){const e=this.getAttribute("panel-mode")||"auto";return ve.includes(e)?e:"auto"}set panelMode(e){this.setAttribute("panel-mode",ve.includes(e)?e:"auto")}get panelWidth(){return this.normalizeCssLength(this.getAttribute("panel-width")||Ue)}set panelWidth(e){this.setAttribute("panel-width",this.normalizeCssLength(e))}get panelBreakpoint(){const e=Number(this.getAttribute("panel-breakpoint"));return Number.isFinite(e)&&e>0?e:1024}set panelBreakpoint(e){const t=Number.isFinite(e)&&e>0?Math.round(e):1024;this.setAttribute("panel-breakpoint",String(t))}normalizeCssLength(e){if("number"==typeof e)return`${Math.max(0,e)}px`;const t=String(e??"").trim();return t?/^-?\d+(?:\.\d+)?$/.test(t)?`${Math.max(0,Number(t))}px`:t:Ue}parseSettingsSections(){try{const e=JSON.parse(this.getAttribute("settings-sections")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parsePanels(){let e=[];const t=this.getAttribute("panels");if(t)try{const s=JSON.parse(t);Array.isArray(s)&&(e=s.filter(e=>Boolean(e&&"string"==typeof e.id&&e.id.trim())).map(e=>({...e,id:e.id.trim(),title:String(e.title||e.id).trim(),sections:Array.isArray(e.sections)?e.sections:[]})))}catch{e=[]}const s=this.parseSettingsSections();return s.length&&!e.some(e=>"settings"===e.id)&&e.push({id:"settings",title:"Settings",backLabel:this.backLabel,sections:s}),e}hasPanels(){return this.parsePanels().length>0}findPanel(e){return e&&"main"!==e?this.parsePanels().find(t=>t.id===e)??null:null}getActivePanelConfig(){return this.findPanel(this.getAttribute("active-panel")||"main")}parseSections(){const e=this.getAttribute("sections");if(e)try{const t=JSON.parse(e);if(Array.isArray(t)&&t.length)return t}catch{}try{const e=JSON.parse(this.getAttribute("items")||"[]");return[{id:"main",items:Array.isArray(e)?e:[]}]}catch{return[{id:"main",items:[]}]}}parseUserMenuItems(){try{const e=JSON.parse(this.getAttribute("user-menu-items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseUserProfile(){const e=this.getAttribute("user-profile");if(!e)return null;try{return JSON.parse(e)}catch{return null}}parseProjects(){try{const e=JSON.parse(this.getAttribute("projects")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseBottomItems(){try{const e=JSON.parse(this.getAttribute("bottom-items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseBottomSections(){const e=this.getAttribute("bottom-sections");if(e)try{const t=JSON.parse(e);if(Array.isArray(t)&&t.length)return t}catch{}const t=this.parseBottomItems();return t.length?[{id:"bottom",items:t}]:[]}parsePromoBanner(){const e=this.getAttribute("promo-banner");if(!e)return null;try{return JSON.parse(e)}catch{return null}}parseUpdateBanner(){const e=this.getAttribute("update-banner");if(!e)return null;try{return JSON.parse(e)}catch{return null}}getSelectedProject(){const e=this.parseProjects();if(!e.length)return null;const t=this.selectedProjectId;return e.find(e=>e.id===t)||e[0]}bindOutsideClick(){this.outsideHandler||(this.outsideHandler=e=>{const t=e.target;if(this.contains(t))return;let s=!1;this.userMenuOpen&&(this.userMenuOpen=!1,this.userFlyoutItemId=null,s=!0),this.projectMenuOpen&&(this.projectMenuOpen=!1,s=!0),s&&this.render()},document.addEventListener("mousedown",this.outsideHandler))}closeOverlayMenus(){const e=this.projectMenuOpen,t=this.userMenuOpen;if(!e&&!t)return!1;this.projectMenuOpen=!1,this.userMenuOpen=!1,this.userFlyoutItemId=null,this.cancelUserFlyoutClose(),this.classList.remove("designbase-wc-sidebar--user-menu-open"),this.querySelector(".designbase-wc-sidebar__project-dropdown")?.remove(),this.querySelector(".designbase-wc-sidebar__project-selector")?.classList.remove("designbase-wc-sidebar__project-selector--open");const s=this.querySelector(".designbase-wc-sidebar__project-trigger");s?.setAttribute("aria-expanded","false");const i=this.querySelector(".designbase-wc-sidebar__user-dropdown");return i&&(i.hidden=!0),this.querySelector(".designbase-wc-sidebar__user-info")?.setAttribute("aria-expanded","false"),this.querySelector(".designbase-wc-sidebar__user-collapsed")?.setAttribute("aria-expanded","false"),this.querySelector(".designbase-wc-sidebar__user-collapsed")?.classList.remove("designbase-wc-sidebar__user-collapsed--open"),!0}syncExclusiveAccordion(e){[...Array.from(this.querySelectorAll(".designbase-wc-sidebar__nav-list > .designbase-wc-sidebar__item > db-menu-item")),...Array.from(this.querySelectorAll(".designbase-wc-sidebar__bottom-nav .designbase-wc-sidebar__nav-list > .designbase-wc-sidebar__item > db-menu-item"))].forEach(t=>{const s=t.getAttribute("data-item-id");s&&(e&&s===e?t.setAttribute("expanded",""):t.removeAttribute("expanded"))})}unbindOutsideClick(){this.outsideHandler&&(document.removeEventListener("mousedown",this.outsideHandler),this.outsideHandler=null)}cancelFlyoutClose(){this.flyoutCloseTimer&&(clearTimeout(this.flyoutCloseTimer),this.flyoutCloseTimer=null)}showFlyout(e){this.cancelFlyoutClose(),this.flyoutItemId!==e&&(this.flyoutItemId=e,this.renderNav(),this.renderBottomNav())}scheduleFlyoutClose(){this.cancelFlyoutClose(),this.flyoutCloseTimer=setTimeout(()=>{this.flyoutCloseTimer=null,this.flyoutItemId=null,this.renderNav(),this.renderBottomNav()},120)}cancelUserFlyoutClose(){this.userFlyoutCloseTimer&&(clearTimeout(this.userFlyoutCloseTimer),this.userFlyoutCloseTimer=null)}setUserFlyout(e){this.cancelUserFlyoutClose(),this.userFlyoutItemId=e,this.querySelectorAll(".designbase-wc-sidebar__user-menu-item").forEach(t=>{const s=Boolean(e&&t.dataset.itemId===e);t.classList.toggle("designbase-wc-sidebar__user-menu-item--flyout-active",s),t.querySelector(".designbase-wc-sidebar__user-menu-trigger")?.setAttribute("aria-expanded",String(s));const i=t.querySelector(".designbase-wc-sidebar__user-flyout");i&&(i.hidden=!s)})}scheduleUserFlyoutClose(){this.cancelUserFlyoutClose(),this.userFlyoutCloseTimer=setTimeout(()=>{this.userFlyoutCloseTimer=null,this.setUserFlyout(null)},120)}syncHostClasses(){const e=this.getAttribute("size")||"m",t=this.getAttribute("theme")||"default",s=this.getAttribute("variant")||"default",i=this.getAttribute("position")||"left",n=this.getActivePanelConfig(),a=Boolean(n),r=this.panelWidth;this.style.setProperty("--db-sidebar-panel-width",r),this.className=["designbase-wc-sidebar",`designbase-wc-sidebar--${pe.includes(e)?e:"m"}`,`designbase-wc-sidebar--${me.includes(t)?t:"default"}`,`designbase-wc-sidebar--${fe.includes(i)?i:"left"}`,`designbase-wc-sidebar--panel-${this.resolvedPanelMode}`,ge.includes(s)&&"wrapper"===s&&"designbase-wc-sidebar--wrapper",this.hasAttribute("collapsed")&&"designbase-wc-sidebar--collapsed",this.hasAttribute("full-height")&&"designbase-wc-sidebar--full-height",this.hasAttribute("shadow")&&"designbase-wc-sidebar--shadow",this.userMenuOpen&&"designbase-wc-sidebar--user-menu-open",("back"===this.headerType||a&&"replace"===this.resolvedPanelMode)&&"designbase-wc-sidebar--header-back",a&&"designbase-wc-sidebar--panel-open",this.hasPanels()&&"designbase-wc-sidebar--has-panels"].filter(Boolean).join(" ")}navigateToPanel(e){const t="main"!==e&&e?this.findPanel(e)?.id:"main";t&&this.activePanel!==t&&("main"!==t&&"replace"===this.resolvedPanelMode&&this.hasAttribute("collapsed")&&this.removeAttribute("collapsed"),this.setAttribute("active-panel",t))}dispatchItemClick(e){this.dispatchEvent(new CustomEvent("db-item-click",{bubbles:!0,composed:!0,detail:{item:e}}))}dispatchUserMenuItemClick(e){this.dispatchEvent(new CustomEvent("db-user-menu-item-click",{bubbles:!0,composed:!0,detail:{item:e}}))}dispatchBackClick(){const e=this.getActivePanelConfig();e&&this.navigateToPanel("main");const t=new CustomEvent("db-back-click",{bubbles:!0,composed:!0,cancelable:!0,detail:{label:e?.backLabel||this.backLabel,href:this.backHref,panel:e}});this.dispatchEvent(t),t.defaultPrevented||e||!this.backHref||"back"!==this.headerType||window.location.assign(this.backHref)}dispatchProjectChange(e){this.dispatchEvent(new CustomEvent("db-project-change",{bubbles:!0,composed:!0,detail:{project:e}}))}dispatchProjectManage(){this.dispatchEvent(new CustomEvent("db-project-manage",{bubbles:!0,composed:!0,detail:{}}))}dispatchPromoCtaClick(e){this.dispatchEvent(new CustomEvent("db-promo-cta-click",{bubbles:!0,composed:!0,detail:{banner:e}}))}dispatchUpdateCtaClick(e){this.dispatchEvent(new CustomEvent("db-update-cta-click",{bubbles:!0,composed:!0,detail:{banner:e}}))}createProjectAvatar(e,t="s"){const s=document.createElement("db-avatar");if(s.className="designbase-wc-sidebar__project-avatar",s.setAttribute("size",t),s.setAttribute("initials",(e.label||"?").trim()),s.setAttribute("alt",e.label),e.color){const applyColor=()=>{const t=s.querySelector(".designbase-wc-avatar__initials");return!!t&&(t.style.backgroundColor=e.color,t.style.color="#fff",!0)},t=new MutationObserver(()=>{applyColor()&&t.disconnect()});t.observe(s,{childList:!0,subtree:!0}),queueMicrotask(()=>{applyColor()&&t.disconnect()})}return s}createProjectEmptyMark(e="s"){const t=document.createElement("span");return t.className=["designbase-wc-sidebar__project-mark",`designbase-wc-sidebar__project-mark--${e}`,"designbase-wc-sidebar__project-mark--empty"].join(" "),t.setAttribute("aria-hidden","true"),t.append(createDbIcon("plus","m"===e?16:14)),t}createProjectBadge(e){if(!e.badge)return null;const t=document.createElement("db-badge");return t.className="designbase-wc-sidebar__project-badge",t.setAttribute("size","s"),t.setAttribute("variant",e.badgeColor||"warning"),t.setAttribute("type","text"),t.textContent=e.badge,t}createProjectSelector(e){if(!this.hasAttribute("projects"))return null;const t=this.parseProjects(),s=0===t.length,i=this.getSelectedProject(),n=document.createElement("div");n.className=["designbase-wc-sidebar__project-selector",e&&"designbase-wc-sidebar__project-selector--collapsed",this.projectMenuOpen&&"designbase-wc-sidebar__project-selector--open",s&&"designbase-wc-sidebar__project-selector--empty"].filter(Boolean).join(" ");const a=this.getAttribute("project-section-label");if(!e&&a&&a.trim()){const e=document.createElement("div");e.className="designbase-wc-sidebar__project-section-label",e.textContent=a.trim(),n.append(e)}const r=document.createElement("button");if(r.type="button",r.className="designbase-wc-sidebar__project-trigger",r.setAttribute("aria-haspopup","menu"),r.setAttribute("aria-expanded",String(this.projectMenuOpen)),s||!i){if(r.setAttribute("aria-label",this.projectEmptyTriggerLabel),r.append(this.createProjectEmptyMark(e?"m":"s")),!e){const e=document.createElement("span");e.className="designbase-wc-sidebar__project-label",e.textContent=this.projectEmptyTriggerLabel,r.append(e)}}else if(r.setAttribute("aria-label",i.label),r.append(this.createProjectAvatar(i,e?"m":"s")),!e){const e=document.createElement("span");e.className="designbase-wc-sidebar__project-label",e.textContent=i.label,r.append(e)}const o=document.createElement("span");if(o.className="designbase-wc-sidebar__project-chevron",o.setAttribute("aria-hidden","true"),o.append(createDbIcon("chevron-down",14)),r.append(o),r.addEventListener("click",()=>{this.projectMenuOpen=!this.projectMenuOpen,this.userMenuOpen=!1,this.render()}),n.append(r),this.projectMenuOpen){const e=document.createElement("div");if(e.className="designbase-wc-sidebar__project-dropdown",e.setAttribute("role","menu"),e.setAttribute("aria-label",this.projectSectionLabel),s){const t=document.createElement("div");t.className="designbase-wc-sidebar__project-empty",t.setAttribute("role","presentation");const s=document.createElement("p");s.className="designbase-wc-sidebar__project-empty-text",s.textContent=this.projectEmptyLabel,t.append(s),e.append(t)}else{const s=document.createElement("ul");s.className="designbase-wc-sidebar__project-list",t.forEach(e=>{const t=document.createElement("li");t.className="designbase-wc-sidebar__project-option";const n=document.createElement("button");n.type="button",n.className=["designbase-wc-sidebar__project-option-btn",i&&e.id===i.id&&"designbase-wc-sidebar__project-option-btn--active"].filter(Boolean).join(" "),n.setAttribute("role","menuitem"),n.append(this.createProjectAvatar(e,"s"));const a=document.createElement("span");a.className="designbase-wc-sidebar__project-option-label",a.textContent=e.label,n.append(a);const r=this.createProjectBadge(e);r&&n.append(r),n.addEventListener("click",()=>{this.projectMenuOpen=!1,this.setAttribute("selected-project-id",e.id),this.dispatchProjectChange(e),this.render()}),t.append(n),s.append(t)}),e.append(s)}const a=document.createElement("button");a.type="button",a.className="designbase-wc-sidebar__project-manage",a.setAttribute("role","menuitem"),a.append(createDbIcon("plus",14));const r=document.createElement("span");r.textContent=this.projectManageLabel,a.append(r),a.addEventListener("click",()=>{this.projectMenuOpen=!1;const e=this.projectManageHref;e&&window.location.assign(e),this.dispatchProjectManage(),this.render()}),e.append(a),n.append(e)}return n}createFlyout(e,t){const s=this.getAttribute("position")||"left",i=document.createElement("div");i.className=["designbase-wc-sidebar__flyout","right"===s&&"designbase-wc-sidebar__flyout--align-left"].filter(Boolean).join(" "),i.setAttribute("role","menu"),i.setAttribute("aria-label",`${e.label} 하위 메뉴`),i.addEventListener("mouseenter",()=>this.cancelFlyoutClose()),i.addEventListener("mouseleave",()=>this.scheduleFlyoutClose());const n=document.createElement("div");n.className="designbase-wc-sidebar__flyout-title",n.textContent=e.label,i.append(n);const a=document.createElement("ul");return a.className="designbase-wc-sidebar__flyout-list",(e.children||[]).forEach(e=>{const s=document.createElement("li");s.className="designbase-wc-sidebar__flyout-item";const i=document.createElement("db-menu-item");i.setAttribute("label",e.label),i.setAttribute("type","block"),i.setAttribute("menu-style","dropdown"),i.setAttribute("size",t),e.href&&i.setAttribute("href",e.href),e.active&&i.setAttribute("active",""),e.disabled&&i.setAttribute("disabled",""),void 0!==e.badge&&i.setAttribute("badge",String(e.badge)),e.badgeColor&&i.setAttribute("badge-color",e.badgeColor),i.addEventListener("db-click",()=>{e.disabled||(this.flyoutItemId=null,this.dispatchItemClick(e),this.renderNav(),this.renderBottomNav())}),s.append(i),a.append(s)}),i.append(a),i}createSidebarMenuItem(e,t,s=0){const i=Boolean(e.children?.length),n=this.expandedItems.has(e.id),a=this.hasAttribute("collapsed"),r=a&&i,o=document.createElement("li");o.className=["designbase-wc-sidebar__item",r&&this.flyoutItemId===e.id&&"designbase-wc-sidebar__item--flyout-active"].filter(Boolean).join(" "),r&&(o.addEventListener("mouseenter",()=>this.showFlyout(e.id)),o.addEventListener("mouseleave",()=>this.scheduleFlyoutClose()));const l=document.createElement("db-menu-item");if(l.setAttribute("data-item-id",e.id),l.setAttribute("label",e.label),l.setAttribute("type","block"),l.setAttribute("menu-style","accordion"),l.setAttribute("size",t),l.setAttribute("depth",String(s)),e.href&&l.setAttribute("href",e.href),e.icon&&l.setAttribute("icon",e.icon),(e.active||e.openPanel&&e.openPanel===this.activePanel)&&l.setAttribute("active",""),e.disabled&&l.setAttribute("disabled",""),void 0!==e.badge&&l.setAttribute("badge",String(e.badge)),e.badgeColor&&l.setAttribute("badge-color",e.badgeColor),i&&!r&&(l.setAttribute("expandable",""),l.subItems=(e.children||[]).map(e=>({id:e.id,label:e.label,href:e.href,active:e.active,disabled:e.disabled,badge:e.badge,badgeColor:e.badgeColor})),n&&!a&&l.setAttribute("expanded","")),l.addEventListener("db-click",t=>{if(!e.disabled){if(i&&!a){const s=t.detail?.expanded??!this.expandedItems.has(e.id);return this.closeOverlayMenus(),void(s?(this.expandedItems.clear(),this.expandedItems.add(e.id),this.syncExclusiveAccordion(e.id)):(this.expandedItems.delete(e.id),this.syncExclusiveAccordion(null)))}if(r)return this.closeOverlayMenus(),void this.showFlyout(e.id);if(this.closeOverlayMenus(),e.openPanel&&this.findPanel(e.openPanel))return this.dispatchItemClick(e),void this.navigateToPanel(e.openPanel);this.dispatchItemClick(e)}}),l.addEventListener("db-child-click",e=>{const t=e.detail;this.dispatchItemClick(t.child)}),o.append(l),a&&void 0!==e.badge&&null!==e.badge&&""!==e.badge){const t=e.badgeColor||"primary",s=document.createElement("span");s.className=["designbase-wc-sidebar__collapsed-badge-dot",`designbase-wc-sidebar__collapsed-badge-dot--${t}`].join(" "),s.setAttribute("aria-hidden","true"),o.append(s)}if(a&&!i){const t=document.createElement("span");t.className="designbase-wc-sidebar__item-tooltip",t.textContent=e.label,t.setAttribute("role","tooltip"),o.append(t)}return r&&this.flyoutItemId===e.id&&o.append(this.createFlyout(e,t)),o}renderSectionList(e,t,s){const i=document.createDocumentFragment();return e.forEach(e=>{const n=document.createElement("div");if(n.className=["designbase-wc-sidebar__section",e.gap&&`designbase-wc-sidebar__section--gap-${e.gap}`].filter(Boolean).join(" "),!s&&e.title){const t=document.createElement("div");t.className="designbase-wc-sidebar__section-title",t.textContent=e.title,n.append(t)}const a=document.createElement("ul");a.className="designbase-wc-sidebar__nav-list",e.items.forEach(e=>a.append(this.createSidebarMenuItem(e,t))),n.append(a),i.append(n)}),i}renderNav(){const e=this.getAttribute("size")||"m",t=this.hasAttribute("collapsed"),s=this.querySelector('.designbase-wc-sidebar__nav[data-panel-nav="main"]');s&&s.replaceChildren(this.renderSectionList(this.parseSections(),e,t),this.createCustomNavSlot("nav"));const i=this.getActivePanelConfig(),n=this.querySelector('.designbase-wc-sidebar__nav[data-panel-nav="panel"]');n&&i&&n.replaceChildren(this.renderSectionList(i.sections,e,!1))}renderBottomNav(){const e=this.querySelector(".designbase-wc-sidebar__bottom-nav");if(!e)return;const t=this.getAttribute("size")||"m",s=this.hasAttribute("collapsed");e.replaceChildren(this.renderSectionList(this.parseBottomSections(),t,s))}createUserDropdown(e,t=!1){if(!e.length)return null;const s=this.getAttribute("position")||"left",i=document.createElement("div");i.className=["designbase-wc-sidebar__user-dropdown",t&&"designbase-wc-sidebar__user-dropdown--collapsed"].filter(Boolean).join(" "),i.setAttribute("role","menu"),i.setAttribute("aria-label","사용자 메뉴"),i.hidden=!this.userMenuOpen,i.addEventListener("keydown",e=>{"Escape"===e.key&&(e.stopPropagation(),this.userFlyoutItemId?this.setUserFlyout(null):(this.userMenuOpen=!1,this.render()))});const n=document.createElement("ul");return n.className="designbase-wc-sidebar__user-menu",e.forEach(e=>{const t=Boolean(e.children?.length),i=document.createElement("li");i.dataset.itemId=e.id,i.className=["designbase-wc-sidebar__user-menu-item",e.dividerBefore&&"designbase-wc-sidebar__user-menu-item--divider",e.disabled&&"designbase-wc-sidebar__user-menu-item--disabled",t&&"designbase-wc-sidebar__user-menu-item--has-children"].filter(Boolean).join(" ");const a=document.createElement("button");if(a.type="button",a.className="designbase-wc-sidebar__user-menu-trigger",a.setAttribute("role","menuitem"),a.disabled=Boolean(e.disabled),e.icon&&isDbIconName(e.icon)){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-menu-icon",t.setAttribute("aria-hidden","true"),t.append(createDbIcon(e.icon,16)),a.append(t)}const r=document.createElement("span");if(r.className="designbase-wc-sidebar__user-menu-label",r.textContent=e.label,a.append(r),e.value){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-menu-value",t.textContent=e.value,a.append(t)}if(t){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-menu-chevron",t.setAttribute("aria-hidden","true"),t.append(createDbIcon("right"===s?"chevron-left":"chevron-right",16)),a.append(t),a.setAttribute("aria-haspopup","menu"),a.setAttribute("aria-expanded",String(this.userFlyoutItemId===e.id));const openFlyout=()=>this.setUserFlyout(e.id);i.addEventListener("mouseenter",openFlyout),i.addEventListener("mouseleave",()=>this.scheduleUserFlyoutClose()),i.addEventListener("focusin",openFlyout),i.addEventListener("focusout",e=>{const t=e.relatedTarget;t&&i.contains(t)||this.scheduleUserFlyoutClose()}),a.addEventListener("click",openFlyout);const n=document.createElement("div");n.className=["designbase-wc-sidebar__user-flyout","right"===s&&"designbase-wc-sidebar__user-flyout--align-left"].filter(Boolean).join(" "),n.setAttribute("role","menu"),n.setAttribute("aria-label",`${e.label} 하위 메뉴`),n.hidden=this.userFlyoutItemId!==e.id,n.addEventListener("mouseenter",()=>this.cancelUserFlyoutClose()),n.addEventListener("mouseleave",()=>this.scheduleUserFlyoutClose());const r=document.createElement("ul");r.className="designbase-wc-sidebar__user-flyout-list",(e.children||[]).forEach(e=>{const t=document.createElement("li");t.className="designbase-wc-sidebar__user-flyout-item";const s=document.createElement("button");if(s.type="button",s.className=["designbase-wc-sidebar__user-menu-trigger","designbase-wc-sidebar__user-flyout-trigger",e.selected&&"designbase-wc-sidebar__user-flyout-trigger--selected"].filter(Boolean).join(" "),s.setAttribute("role","menuitemradio"),s.setAttribute("aria-checked",String(Boolean(e.selected))),s.disabled=Boolean(e.disabled),e.icon&&isDbIconName(e.icon)){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-menu-icon",t.setAttribute("aria-hidden","true"),t.append(createDbIcon(e.icon,16)),s.append(t)}const i=document.createElement("span");if(i.className="designbase-wc-sidebar__user-menu-label",i.textContent=e.label,s.append(i),e.selected){const e=document.createElement("span");e.className="designbase-wc-sidebar__user-menu-check",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("done",16)),s.append(e)}s.addEventListener("click",()=>{e.disabled||(this.userFlyoutItemId=null,this.userMenuOpen=!1,this.dispatchUserMenuItemClick(e),e.href&&window.location.assign(e.href),this.render())}),t.append(s),r.append(t)}),n.append(r),i.append(a,n)}else a.addEventListener("click",()=>{e.disabled||(this.userFlyoutItemId=null,this.userMenuOpen=!1,this.dispatchUserMenuItemClick(e),e.href&&window.location.assign(e.href),this.render())}),i.append(a);n.append(i)}),i.append(n),i}createUpdateBanner(e){if("back"===this.headerType)return null;const t=this.parseUpdateBanner();if(!t)return null;if(e)return null;const s=document.createElement("div");s.className="designbase-wc-sidebar__update";const i=document.createElement("db-banner");return i.className="designbase-wc-sidebar__update-banner",i.setAttribute("size","s"),i.setAttribute("variant",t.variant||"outline"),i.setAttribute("title",t.title),t.description&&i.setAttribute("description",t.description),t.icon&&i.setAttribute("icon",t.icon),i.setAttribute("clickable",""),i.setAttribute("aria-label",t.ctaLabel||t.title),i.addEventListener("db-click",()=>{t.ctaHref&&window.location.assign(t.ctaHref),this.dispatchUpdateCtaClick(t)}),s.append(i),s}createPromoBanner(e){if("back"===this.headerType)return null;const t=this.parsePromoBanner();if(!t)return null;if(e){const e=document.createElement("button");e.type="button",e.className="designbase-wc-sidebar__promo-collapsed",e.setAttribute("aria-label",t.ctaLabel||t.title);const s=document.createElement("db-animation-background");s.className="designbase-wc-sidebar__promo-bg",s.setAttribute("type","aurora"),s.setAttribute("theme","light"),s.setAttribute("intensity","subtle"),s.setAttribute("blur","40"),s.setAttribute("speed","4000"),s.setAttribute("colors",JSON.stringify(["#c7d2fe","#ddd6fe","#fbcfe8"])),e.append(s),e.append(createDbIcon(t.icon&&isDbIconName(t.icon)?t.icon:"sparkle",18)),e.addEventListener("click",()=>this.dispatchPromoCtaClick(t));const i=document.createElement("span");i.className="designbase-wc-sidebar__item-tooltip",i.textContent=t.title,i.setAttribute("role","tooltip");const n=document.createElement("div");return n.className="designbase-wc-sidebar__promo-collapsed-wrap",n.append(e,i),n}const s=document.createElement("div");s.className="designbase-wc-sidebar__promo";const i=document.createElement("db-animation-background");i.className="designbase-wc-sidebar__promo-bg",i.setAttribute("type","aurora"),i.setAttribute("theme","light"),i.setAttribute("intensity","subtle"),i.setAttribute("blur","60"),i.setAttribute("speed","5000"),i.setAttribute("colors",JSON.stringify(["#c7d2fe","#ddd6fe","#fbcfe8","#bfdbfe"])),s.append(i);const n=document.createElement("div");n.className="designbase-wc-sidebar__promo-content";const a=document.createElement("div");a.className="designbase-wc-sidebar__promo-title-row";const r=document.createElement("span");r.className="designbase-wc-sidebar__promo-icon",r.setAttribute("aria-hidden","true"),r.append(createDbIcon(t.icon&&isDbIconName(t.icon)?t.icon:"sparkle",16));const o=document.createElement("div");if(o.className="designbase-wc-sidebar__promo-title",o.textContent=t.title,a.append(r,o),n.append(a),t.description){const e=document.createElement("div");e.className="designbase-wc-sidebar__promo-desc",e.textContent=t.description,n.append(e)}if(t.ctaLabel){const e=document.createElement("db-button");e.className="designbase-wc-sidebar__promo-action",e.setAttribute("variant","secondary"),e.setAttribute("size","s"),e.setAttribute("full-width",""),e.textContent=t.ctaLabel,e.addEventListener("db-click",()=>{t.ctaHref&&window.location.assign(t.ctaHref),this.dispatchPromoCtaClick(t)}),n.append(e)}return s.append(n),s}createMainHeader(e){const{size:t,collapsible:s,showLogo:i,collapsed:n}=e,a="back"===this.headerType,r="l"===t?"m":"s"===t?"xs":"s";if(!a&&!s&&(!i||n))return null;const o=document.createElement("div");if(o.className=["designbase-wc-sidebar__header",(n||!i)&&!a&&"designbase-wc-sidebar__header--collapsed-only",a&&"designbase-wc-sidebar__header--back"].filter(Boolean).join(" "),a){const e=document.createElement("button");if(e.type="button",e.className=["designbase-wc-sidebar__back",n&&"designbase-wc-sidebar__back--collapsed"].filter(Boolean).join(" "),e.setAttribute("aria-label",this.backLabel),e.append(createDbIcon("chevron-left",18)),!n){const t=document.createElement("span");t.textContent=this.backLabel,e.append(t)}e.addEventListener("click",()=>this.dispatchBackClick()),o.append(e)}else if(!n&&i){const e=document.createElement("div");e.className="designbase-wc-sidebar__logo";const t=this.getAttribute("logo-type")||"designbase",s=this.getAttribute("logo-text")||"";if("custom"===t&&s){const t=document.createElement("span");t.className="designbase-wc-sidebar__logo-text",t.textContent=s,e.append(t)}else{const i=document.createElement("db-logo");i.setAttribute("type",t),i.setAttribute("size",r),s&&i.setAttribute("text",s),e.append(i)}e.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-logo-click",{bubbles:!0,composed:!0}))}),o.append(e)}if(s&&!a){const e=document.createElement("db-button");e.className="designbase-wc-sidebar__toggle",e.setAttribute("variant","tertiary"),e.setAttribute("size","s"),e.setAttribute("icon-only",""),e.setAttribute("start-icon",n?"arrow-bar-right":"arrow-bar-left"),e.setAttribute("aria-label",n?"사이드바 펼치기":"사이드바 접기"),e.addEventListener("db-click",()=>{const e=!this.hasAttribute("collapsed");e?this.setAttribute("collapsed",""):this.removeAttribute("collapsed"),this.dispatchEvent(new CustomEvent("db-toggle",{bubbles:!0,composed:!0,detail:{collapsed:e}}))}),o.append(e)}return o}createPanelHeader(e){const t="replace"===this.resolvedPanelMode,s=document.createElement("div");if(s.className=["designbase-wc-sidebar__panel-header",t&&"designbase-wc-sidebar__panel-header--replace"].filter(Boolean).join(" "),t){const t=document.createElement("button");t.type="button",t.className="designbase-wc-sidebar__panel-back",t.setAttribute("aria-label",e.backLabel||this.backLabel),t.append(createDbIcon("chevron-left",18)),t.addEventListener("click",()=>this.dispatchBackClick()),s.append(t)}const i=document.createElement("div");i.className="designbase-wc-sidebar__panel-heading";const n=document.createElement("div");if(n.className="designbase-wc-sidebar__panel-title",n.textContent=e.title,i.append(n),e.description){const t=document.createElement("div");t.className="designbase-wc-sidebar__panel-description",t.textContent=e.description,i.append(t)}return s.append(i),s}createNavWrapper(e){const{mode:t,collapsed:s,includeProjects:i,includeBottom:n,panel:a}=e,r=document.createElement("div");if(r.className="designbase-wc-sidebar__nav-wrapper",i){const e=this.createProjectSelector(s);e&&r.append(e)}"main"===t&&r.append(this.createCustomNavSlot("nav-top"));const o=document.createElement("nav");if(o.className="designbase-wc-sidebar__nav",o.setAttribute("data-panel-nav",t),a&&(o.dataset.panelId=a.id),o.setAttribute("aria-label",a?.ariaLabel||a?.title||"주 메뉴"),r.append(o),"main"===t&&r.append(this.createCustomNavSlot("nav-bottom")),n){const e=document.createElement("nav");e.className="designbase-wc-sidebar__bottom-nav",e.setAttribute("aria-label","하단 메뉴"),r.append(e)}return r}createFooter(e){const{collapsed:t,userProfile:s,userMenuItems:i}=e,n=document.createElement("div");n.className="designbase-wc-sidebar__footer";const a=this.createUpdateBanner(t);a&&n.append(a);const r=this.createPromoBanner(t);if(r&&n.append(r),s&&!t){const e=document.createElement("div");e.className="designbase-wc-sidebar__user";const t=this.createUserDropdown(i);t&&e.append(t);const a=document.createElement("div");a.className="designbase-wc-sidebar__user-info",a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.setAttribute("aria-expanded",String(this.userMenuOpen));const r=document.createElement("db-avatar");r.className="designbase-wc-sidebar__user-avatar",r.setAttribute("size","s"),r.setAttribute("initials",s.name),r.setAttribute("alt",s.name),s.avatar&&r.setAttribute("src",s.avatar);const o=document.createElement("div");o.className="designbase-wc-sidebar__user-details";const l=document.createElement("div");if(l.className="designbase-wc-sidebar__user-name",l.textContent=s.name,o.append(l),s.email){const e=document.createElement("div");e.className="designbase-wc-sidebar__user-email",e.textContent=s.email,o.append(e)}if(a.append(r,o),i.length){const e=document.createElement("span");e.className="designbase-wc-sidebar__user-more",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("more-vertical",16)),a.append(e),a.setAttribute("aria-haspopup","menu")}a.addEventListener("click",()=>{i.length&&(this.userMenuOpen=!this.userMenuOpen,this.userFlyoutItemId=null,this.cancelUserFlyoutClose(),this.projectMenuOpen=!1,this.render())}),a.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a.click())}),e.append(a),n.append(e)}else if(s&&t){const e=document.createElement("div");e.className=["designbase-wc-sidebar__user-collapsed",this.userMenuOpen&&"designbase-wc-sidebar__user-collapsed--open"].filter(Boolean).join(" "),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",s.name),e.setAttribute("aria-expanded",String(this.userMenuOpen)),i.length&&e.setAttribute("aria-haspopup","menu");const t=document.createElement("db-avatar");if(t.className="designbase-wc-sidebar__user-avatar-collapsed",t.setAttribute("size","s"),t.setAttribute("initials",s.name),t.setAttribute("alt",s.name),s.avatar&&t.setAttribute("src",s.avatar),e.append(t),!this.userMenuOpen){const t=document.createElement("span");t.className="designbase-wc-sidebar__item-tooltip",t.textContent=s.name,t.setAttribute("role","tooltip"),e.append(t)}const a=this.createUserDropdown(i,!0);a&&e.append(a),e.addEventListener("click",e=>{i.length&&(e.target.closest(".designbase-wc-sidebar__user-dropdown")||(this.userMenuOpen=!this.userMenuOpen,this.userFlyoutItemId=null,this.cancelUserFlyoutClose(),this.projectMenuOpen=!1,this.render()))}),e.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.click())}),n.append(e)}return n}render(){const e=this.getActivePanelConfig();this.syncHostClasses(),this.setAttribute("role","complementary"),this.setAttribute("aria-label","사이드바 네비게이션");const t=this.getAttribute("size")||"m",s="false"!==this.getAttribute("collapsible"),i="false"!==this.getAttribute("show-logo"),n=this.hasAttribute("collapsed"),a=this.parseUserProfile(),r=this.parseUserMenuItems(),o=this.parseBottomSections(),l=this.collectCustomNavSlots(),d=Boolean(e),h="replace"===this.resolvedPanelMode;this.replaceChildren();const u=document.createElement("div");u.className="designbase-wc-sidebar__container";const b=document.createElement("div");b.className="designbase-wc-sidebar__panel-viewport";const p=document.createElement("div");p.className="designbase-wc-sidebar__panel-track",p.dataset.active=d&&h?"main":d?"panel":"main";const m=document.createElement("div");m.className=["designbase-wc-sidebar__panel-slide","designbase-wc-sidebar__panel-slide--main"].join(" "),m.dataset.panel="main";const g=d&&h;m.toggleAttribute("inert",g),m.setAttribute("aria-hidden",String(g));const f=this.createMainHeader({size:t,collapsible:s,showLogo:i,collapsed:n});if(f&&m.append(f),m.append(this.createNavWrapper({mode:"main",collapsed:n,includeProjects:"back"!==this.headerType,includeBottom:o.length>0})),m.append(this.createFooter({collapsed:n,userProfile:a,userMenuItems:r})),p.append(m),e){const t=document.createElement("div");t.className=["designbase-wc-sidebar__panel-slide","designbase-wc-sidebar__panel-slide--secondary"].join(" "),t.dataset.panel=e.id,t.setAttribute("aria-hidden","false"),t.append(this.createPanelHeader(e)),t.append(this.createNavWrapper({mode:"panel",collapsed:!1,includeProjects:!1,includeBottom:!1,panel:e})),p.append(t)}b.append(p),u.append(b),this.append(u),this.renderNav(),this.renderBottomNav(),this.projectCustomNavSlots(l),d&&h&&requestAnimationFrame(()=>{this.isConnected&&this.activePanel===e?.id&&(p.dataset.active="panel")})}}function getDefaultSize(e,t){if("circular"===e)switch(t){case"xs":return"16px";case"s":return"24px";case"l":return"48px";case"xl":return"64px";default:return"32px"}switch(t){case"xs":return"12px";case"s":return"16px";case"l":return"24px";case"xl":return"32px";default:return"20px"}}function toCssSize(e){return/^\d+$/.test(e)?`${e}px`:e}customElements.get("db-sidebar")||customElements.define("db-sidebar",DbSidebar);class DbSkeleton extends HTMLElement{static get observedAttributes(){return["variant","size","width","height","animation","lines","line-spacing","last-line-width","aria-label"]}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}render(){const e=this.getAttribute("variant")||"text",t=this.getAttribute("size")||"m",s=this.getAttribute("animation")||"pulse",i=Number(this.getAttribute("lines")||1),n=this.getAttribute("width"),a=this.getAttribute("height"),r=this.getAttribute("line-spacing")||"8px",o=this.getAttribute("last-line-width")||"60%",l=se.includes(e)?e:"text",d=ie.includes(t)?t:"m",h=["designbase-wc-skeleton",`designbase-wc-skeleton--${l}`,`designbase-wc-skeleton--${d}`,`designbase-wc-skeleton--${s}`,(n||a)&&"designbase-wc-skeleton--custom-size"].filter(Boolean).join(" ");this.className!==h&&(this.className=h);const u=this.getAttribute("aria-label")??`${l} 스켈레톤 로딩 중`;if(this.getAttribute("aria-label")!==u&&this.setAttribute("aria-label",u),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.replaceChildren(),this.style.width=n?toCssSize(n):"circular"===l?getDefaultSize(l,d):"100%",this.style.height=a?toCssSize(a):"circular"===l?getDefaultSize(l,d):function getTextLineHeight(e){switch(e){case"xs":return"12px";case"s":return"16px";case"l":return"24px";case"xl":return"32px";default:return"20px"}}(d),"text"===l&&i>1)for(let e=1;e<i;e+=1){const t=document.createElement("div");t.className="designbase-wc-skeleton__line",t.style.marginTop=toCssSize(r),e===i-1&&(t.style.width=toCssSize(o)),this.append(t)}}}customElements.get("db-skeleton")||customElements.define("db-skeleton",DbSkeleton);class DbSpinner extends HTMLElement{static get observedAttributes(){return["type","size","color","speed","label","show-label"]}get type(){return this.getAttribute("type")||"circular"}set type(e){this.setAttribute("type",e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}get color(){return this.getAttribute("color")||""}set color(e){e?this.setAttribute("color",e):this.removeAttribute("color")}get speed(){return Number(this.getAttribute("speed")||1)}set speed(e){this.setAttribute("speed",String(e))}get label(){return this.getAttribute("label")||"로딩 중..."}set label(e){this.setAttribute("label",e)}get showLabel(){return this.hasAttribute("show-label")}set showLabel(e){this.toggleAttribute("show-label",e)}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){this.className=Array.from(this.classList).filter(e=>!e.startsWith("designbase-wc-spinner")).join(" "),this.classList.add("designbase-wc-spinner"),this.classList.add(`designbase-wc-spinner--${j.includes(this.type)?this.type:"circular"}`),this.classList.add(`designbase-wc-spinner--${R.includes(this.size)?this.size:"m"}`),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-busy","true"),this.showLabel&&this.setAttribute("aria-label",this.label),this.style.setProperty("--spinner-speed",`${this.speed}s`),this.color?this.style.setProperty("--spinner-color",this.color):this.style.removeProperty("--spinner-color");const e=j.includes(this.type)?this.type:"circular";if(this.renderedType!==e||!this.graphicEl?.isConnected){const t=document.createElement("template");t.innerHTML=this.renderSpinner(),this.graphicEl=t.content.firstElementChild,this.renderedType=e,this.labelEl=void 0,this.replaceChildren(this.graphicEl)}Boolean(this.showLabel&&this.label)?(this.labelEl?.isConnected||(this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-spinner__label",this.labelEl.setAttribute("aria-hidden","true"),this.append(this.labelEl)),this.labelEl.textContent=this.label):(this.labelEl?.remove(),this.labelEl=void 0)}renderSpinner(){switch(this.type){case"dots":return'<span class="designbase-wc-spinner__dots" aria-hidden="true"><span class="designbase-wc-spinner__dot"></span><span class="designbase-wc-spinner__dot"></span><span class="designbase-wc-spinner__dot"></span></span>';case"bars":return'<span class="designbase-wc-spinner__bars" aria-hidden="true"><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span></span>';case"pulse":return'<span class="designbase-wc-spinner__pulse" aria-hidden="true"></span>';case"ripple":return'<span class="designbase-wc-spinner__ripple" aria-hidden="true"><span class="designbase-wc-spinner__ripple-circle"></span><span class="designbase-wc-spinner__ripple-circle"></span></span>';default:return'<svg class="designbase-wc-spinner__circular" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle class="designbase-wc-spinner__circular-track" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"></circle><circle class="designbase-wc-spinner__circular-indicator" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"></circle></svg>'}}escape(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]||e))}}customElements.get("db-spinner")||customElements.define("db-spinner",DbSpinner);class DbTable extends HTMLElement{constructor(){super(...arguments),this.internalSelectedRows=[],this.internalSortDirection=null,this.internalPage=1}static get observedAttributes(){return["columns","data","title","size","variant","empty-message","sortable","sort-column","sort-direction","selectable","multi-select","selected-rows","row-key","loading","pagination","page","page-size","total-items","show-count-badge","clickable"]}get columns(){try{return JSON.parse(this.getAttribute("columns")||"[]")}catch{return[]}}set columns(e){this.setAttribute("columns","string"==typeof e?e:JSON.stringify(e))}get data(){try{return JSON.parse(this.getAttribute("data")||"[]")}catch{return[]}}set data(e){this.setAttribute("data","string"==typeof e?e:JSON.stringify(e))}connectedCallback(){this.render()}attributeChangedCallback(e){"selected-rows"===e&&this.syncSelectedRowsFromAttribute(),"sort-column"!==e&&"sort-direction"!==e||this.syncSortFromAttributes(),"page"===e&&(this.internalPage=Number(this.getAttribute("page")||1)),this.render()}syncSelectedRowsFromAttribute(){try{this.internalSelectedRows=JSON.parse(this.getAttribute("selected-rows")||"[]")}catch{this.internalSelectedRows=[]}}syncSortFromAttributes(){const e=this.getAttribute("sort-column"),t=this.getAttribute("sort-direction");this.internalSortColumn=e||void 0,this.internalSortDirection="asc"===t||"desc"===t?t:null}getRowKey(e,t){const s=e[this.getAttribute("row-key")||"id"];return String(null!=s?s:t)}getSortedData(){const e=this.data,t=this.getAttribute("sort-column")||this.internalSortColumn,s=this.getAttribute("sort-direction")||this.internalSortDirection;if(!t||!s)return e;const i=this.columns.find(e=>e.key===t);return i?.sortable?[...e].sort((e,i)=>{const n=e[t],a=i[t];return n===a?0:null==n?1:null==a?-1:n<a?"asc"===s?-1:1:"asc"===s?1:-1}):e}handleSort(e){if(!this.hasAttribute("sortable")||!e.sortable)return;let t="asc";this.internalSortColumn===e.key&&("asc"===this.internalSortDirection?t="desc":"desc"===this.internalSortDirection&&(t=null)),this.internalSortColumn=t?e.key:void 0,this.internalSortDirection=t,this.dispatchEvent(new CustomEvent("db-sort-change",{bubbles:!0,composed:!0,detail:{column:e.key,direction:t}})),this.render()}handleRowSelect(e,t,s){let i;s?.stopPropagation(),i=this.hasAttribute("multi-select")?t?[...this.internalSelectedRows,e]:this.internalSelectedRows.filter(t=>t!==e):t?[e]:[],this.internalSelectedRows=i,this.dispatchEvent(new CustomEvent("db-selection-change",{bubbles:!0,composed:!0,detail:{selectedRows:i}})),this.render()}handleSelectAll(e){const t=e?this.data.map((e,t)=>this.getRowKey(e,t)):[];this.internalSelectedRows=t,this.dispatchEvent(new CustomEvent("db-selection-change",{bubbles:!0,composed:!0,detail:{selectedRows:t}})),this.render()}getPaginatedData(){const e=this.getSortedData();if(!this.hasAttribute("pagination"))return e;const t=Number(this.getAttribute("page-size")||10),s=Number(this.getAttribute("total-items")||e.length),i=Math.max(1,Math.ceil(s/t)),n=(Math.min(this.internalPage,i)-1)*t;return e.slice(n,n+t)}createSortIcon(e){const t=document.createElement("span");if(t.className="designbase-wc-table__sort-icon",this.internalSortColumn!==e.key||!Boolean(this.internalSortDirection)){t.classList.add("designbase-wc-table__sort-icon--idle");const e=document.createElement("span");return e.className="designbase-wc-table__sort-icon-stack",e.append(createDbIcon("chevron-up",10),createDbIcon("chevron-down",10)),t.append(e),t}return t.classList.add("asc"===this.internalSortDirection?"designbase-wc-table__sort-icon--asc":"designbase-wc-table__sort-icon--desc"),t.append(createDbIcon("asc"===this.internalSortDirection?"chevron-up":"chevron-down",14)),t}createCheckbox(e){const t=document.createElement("db-checkbox");return t.setAttribute("size","s"),t.setAttribute("has-label","false"),e.checked&&t.setAttribute("checked",""),e.indeterminate&&t.setAttribute("indeterminate",""),e.stopPropagation&&t.addEventListener("click",e=>e.stopPropagation()),t.addEventListener("db-change",t=>{const s=t.detail;e.onChange?.(s.checked)}),t}render(){const e=this.getAttribute("size")||"m",t=this.getAttribute("variant")||"default",s=Ae.includes(e)?e:"m",i=ye.includes(t)?t:"default",n=this.columns,a=this.getPaginatedData(),r=this.getSortedData(),o=this.hasAttribute("loading");o?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy");const l=this.hasAttribute("selectable"),d=this.hasAttribute("sortable"),h=this.getAttribute("empty-message")||"데이터가 없습니다.";if(this.className=["designbase-wc-table",`designbase-wc-table--${s}`,`designbase-wc-table--${i}`,l&&"designbase-wc-table--selectable",d&&"designbase-wc-table--sortable",o&&"designbase-wc-table--loading"].filter(Boolean).join(" "),this.replaceChildren(),o){const e=document.createElement("div");e.className="designbase-wc-table__loading";const t=document.createElement("div");t.className="designbase-wc-table__loading-spinner";const s=document.createElement("span");return s.textContent="로딩 중...",e.append(t,s),void this.append(e)}const u=this.getAttribute("title"),b=this.hasAttribute("show-count-badge");if(u||b){const e=document.createElement("div");e.className="designbase-wc-table__header";const t=document.createElement("div");if(t.className="designbase-wc-table__header-left",u){const e=document.createElement("h3");e.className="designbase-wc-table__title",e.textContent=u,t.append(e)}if(b){const e=document.createElement("db-badge");e.setAttribute("count",String(this.data.length)),e.setAttribute("type","number"),e.setAttribute("variant","primary"),e.setAttribute("size","s"),t.append(e)}e.append(t),this.append(e)}const p=document.createElement("div");p.className="designbase-wc-table__container";const m=document.createElement("table");m.className="designbase-wc-table__table";const g=document.createElement("thead");g.className="designbase-wc-table__thead";const f=document.createElement("tr");f.className="designbase-wc-table__tr";const v=a.map((e,t)=>this.getRowKey(e,t)),w=v.filter(e=>this.internalSelectedRows.includes(e)),A=this.hasAttribute("clickable");if(l){const e=document.createElement("th");e.className="designbase-wc-table__th designbase-wc-table__th--checkbox";const t=this.createCheckbox({checked:v.length>0&&w.length===v.length,indeterminate:w.length>0&&w.length<v.length,onChange:e=>this.handleSelectAll(e)});e.append(t),f.append(e)}n.forEach(e=>{const t=document.createElement("th");t.className=["designbase-wc-table__th",`designbase-wc-table__th--${e.align||"left"}`,d&&e.sortable&&"designbase-wc-table__th--sortable",this.internalSortColumn===e.key&&this.internalSortDirection&&"designbase-wc-table__th--sorted"].filter(Boolean).join(" "),e.width&&(t.style.width="number"==typeof e.width?`${e.width}px`:e.width);const s=document.createElement("div");s.className="designbase-wc-table__th-content";const i=document.createElement("span");i.className="designbase-wc-table__th-text",i.textContent=e.header,s.append(i),d&&e.sortable&&s.append(this.createSortIcon(e)),t.append(s),d&&e.sortable&&t.addEventListener("click",()=>this.handleSort(e)),f.append(t)}),g.append(f);const y=document.createElement("tbody");if(y.className="designbase-wc-table__tbody",0===r.length){const e=document.createElement("tr");e.className="designbase-wc-table__tr";const t=document.createElement("td");t.className="designbase-wc-table__td designbase-wc-table__td--empty",t.colSpan=Math.max(n.length+(l?1:0),1);const s=document.createElement("db-empty-state");s.setAttribute("title","데이터가 없습니다"),s.setAttribute("description",h),s.setAttribute("variant","no-data"),s.setAttribute("size","m"),t.append(s),e.append(t),y.append(e)}else a.forEach((e,t)=>{const s=this.getRowKey(e,t),i=this.internalSelectedRows.includes(s),a=document.createElement("tr");if(a.className=["designbase-wc-table__tr",A&&"designbase-wc-table__tr--clickable",i&&"designbase-wc-table__tr--selected"].filter(Boolean).join(" "),A&&a.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-row-click",{detail:{item:e,index:t},bubbles:!0,composed:!0}))}),l){const e=document.createElement("td");e.className="designbase-wc-table__td designbase-wc-table__td--checkbox";const t=this.createCheckbox({checked:i,stopPropagation:!0,onChange:e=>this.handleRowSelect(s,e)});e.append(t),a.append(e)}n.forEach(t=>{const s=document.createElement("td");s.className=["designbase-wc-table__td",`designbase-wc-table__td--${t.align||"left"}`].join(" "),s.textContent=String(e[t.key]??""),a.append(s)}),y.append(a)});if(m.append(g,y),p.append(m),this.append(p),this.hasAttribute("pagination")){const e=Number(this.getAttribute("page-size")||10),t=Number(this.getAttribute("total-items")||r.length),i=Math.max(1,Math.ceil(t/e)),n=document.createElement("div");n.className="designbase-wc-table__footer";const a=document.createElement("db-pagination");a.setAttribute("current-page",String(this.internalPage)),a.setAttribute("total-pages",String(i)),a.setAttribute("size",s),a.setAttribute("show-first-last",""),a.addEventListener("db-change",e=>{const t=Number(e.detail?.page||1);this.internalPage=t,this.dispatchEvent(new CustomEvent("db-page-change",{bubbles:!0,composed:!0,detail:{page:t}})),this.render()}),n.append(a),this.append(n)}}}customElements.get("db-table")||customElements.define("db-table",DbTable);class DbTabs extends HTMLElement{constructor(){super(...arguments),this.tabButtons=[],this.inactivePanels=document.createDocumentFragment(),this.isRendering=!1,this.handleResize=()=>{this.resizeRaf&&cancelAnimationFrame(this.resizeRaf),this.resizeRaf=requestAnimationFrame(()=>{this.isRendering||(this.handleListScroll(),this.updateIndicator(!1))})},this.handleListScroll=()=>{if(!this.list)return;const e=this.list.scrollWidth>this.list.clientWidth,t=this.list.scrollLeft+this.list.clientWidth>=this.list.scrollWidth-5;this.list.classList.toggle("designbase-wc-tabs__list--show-gradient",e&&!t&&"horizontal"===this.orientation)}}static get observedAttributes(){return["labels","items","active-index","selected-id","orientation","size","variant","full-width"]}get labels(){const e=this.tabItems.map(e=>e.label);return e.length?e:(this.getAttribute("labels")||"").split(",").map(e=>e.trim()).filter(Boolean)}set labels(e){this.setAttribute("labels",Array.isArray(e)?e.join(","):e)}get tabItems(){try{const e=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}get items(){return this.tabItems}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}set tabItems(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}get activeIndex(){const e=this.getAttribute("selected-id");if(e){const t=this.tabItems.findIndex((t,s)=>(t.id||String(s))===e);if(t>=0)return t}return Number(this.getAttribute("active-index")||0)}set activeIndex(e){this.setAttribute("active-index",String(e))}get orientation(){return coerceToContract(this.getAttribute("orientation"),Y,"horizontal")}set orientation(e){this.setAttribute("orientation",e)}get size(){return coerceToContract(this.getAttribute("size"),Q,"m")}set size(e){this.setAttribute("size",e)}get variant(){return coerceToContract(this.getAttribute("variant"),G,"default")}set variant(e){this.setAttribute("variant",e)}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(e){this.toggleAttribute("full-width",Boolean(e))}connectedCallback(){this.render(),this.list?.addEventListener("scroll",this.handleListScroll,{passive:!0}),window.addEventListener("resize",this.handleResize),this.resizeObserver=new ResizeObserver(()=>this.handleResize()),this.resizeObserver.observe(this),this.childObserver=new MutationObserver(e=>{this.isRendering||e.some(e=>Array.from(e.addedNodes).some(e=>e instanceof HTMLElement&&(e.hasAttribute("slot")||void 0!==e.dataset.panelIndex)))&&this.render()}),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){this.list?.removeEventListener("scroll",this.handleListScroll),window.removeEventListener("resize",this.handleResize),this.resizeObserver?.disconnect(),this.resizeRaf&&cancelAnimationFrame(this.resizeRaf),this.childObserver?.disconnect()}attributeChangedCallback(){this.isConnected&&this.render()}collectPanelContent(){const e=new Map,register=(t,s)=>{if(!(t instanceof HTMLElement)||"SLOT"===t.tagName)return;e.has(s)||e.set(s,[]);const i=e.get(s);i.includes(t)||i.push(t)};return Array.from(this.children).forEach(e=>{const t=e.getAttribute("slot")?.match(/^panel-(\d+)$/);if(t)return void register(e,Number(t[1]));const s=e.dataset.panelIndex;void 0!==s&®ister(e,Number(s))}),this.panel?.querySelectorAll(":scope > .designbase-wc-tabs__panel-inner > [data-panel-index]").forEach(e=>{e instanceof HTMLElement&®ister(e,Number(e.dataset.panelIndex))}),Array.from(this.inactivePanels.children).forEach(e=>{e instanceof HTMLElement&&void 0!==e.dataset.panelIndex&®ister(e,Number(e.dataset.panelIndex))}),e}render(){this.isRendering=!0;const e=this.collectPanelContent(),t=this.labels,s=this.tabItems,i=Math.min(Math.max(this.activeIndex,0),Math.max(t.length-1,0)),n=this.size,a=this.orientation,r=this.variant,o="default"===r;this.className=["designbase-wc-tabs",`designbase-wc-tabs--${a}`,`designbase-wc-tabs--${n}`,`designbase-wc-tabs--${r}`,this.fullWidth&&"designbase-wc-tabs--full-width"].filter(Boolean).join(" "),this.querySelectorAll(":scope > .designbase-wc-tabs__list, :scope > .designbase-wc-tabs__panel").forEach(e=>e.remove()),this.list=document.createElement("div"),this.list.className=["designbase-wc-tabs__list",`designbase-wc-tabs__list--${a}`,this.fullWidth&&"designbase-wc-tabs__list--full-width"].filter(Boolean).join(" "),this.list.setAttribute("role","tablist"),this.list.setAttribute("aria-orientation",a),this.list.setAttribute("aria-label",labelFrom(this,"label-tablist","tabs.label")),this.tabButtons=[],t.forEach((e,t)=>{const a=s[t],r=Boolean(a?.disabled),o=t===i,l=document.createElement("button");if(l.type="button",l.className=["designbase-wc-tabs__tab",o&&"designbase-wc-tabs__tab--selected",r&&"designbase-wc-tabs__tab--disabled"].filter(Boolean).join(" "),l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(o)),l.setAttribute("aria-controls",`panel-${t}`),l.id=`tab-${t}`,l.tabIndex=o?0:-1,l.disabled=r,a?.icon){const e=document.createElement("span");e.className="designbase-wc-tabs__tab-icon";const t="s"===n?16:"l"===n?20:18;e.setAttribute("aria-hidden","true"),e.append(createDbIcon(a.icon,t)),l.append(e)}const d=document.createElement("span");d.className="designbase-wc-tabs__tab-label",d.textContent=e,l.append(d),l.addEventListener("click",()=>this.select(t)),l.addEventListener("keydown",e=>this.handleKeyDown(e,t)),this.list?.append(l),this.tabButtons.push(l)}),o?(this.indicator=document.createElement("span"),this.indicator.className="designbase-wc-tabs__indicator designbase-wc-tabs__indicator--no-transition",this.list.append(this.indicator),requestAnimationFrame(()=>this.updateIndicator(!1))):this.indicator=void 0,this.panel=document.createElement("div"),this.panel.className="designbase-wc-tabs__panel",this.panel.setAttribute("role","tabpanel"),this.panel.id=`panel-${i}`,this.panel.setAttribute("aria-labelledby",`tab-${i}`),this.panel.tabIndex=0;const l=document.createElement("div");l.className="designbase-wc-tabs__panel-inner",e.forEach((e,t)=>{e.forEach(e=>{e.removeAttribute("slot"),e.dataset.panelIndex=String(t),t===i?l.append(e):this.inactivePanels.append(e)})}),this.panel.append(l),this.append(this.list,this.panel),requestAnimationFrame(()=>{this.handleListScroll(),o&&this.updateIndicator(!1)}),this.isRendering=!1}select(e){const t=this.labels,s=this.tabItems;if(!t[e]||s[e]?.disabled)return;this.activeIndex=e;const i=s[e]?.id||String(e);this.setAttribute("selected-id",i),this.dispatchEvent(new CustomEvent("db-change",{detail:{index:e,label:t[e],id:i},bubbles:!0,composed:!0})),this.render()}handleKeyDown(e,t){const s=this.labels,i=this.tabItems;let n=t;if("ArrowRight"===e.key||"ArrowDown"===e.key)n=(t+1)%s.length;else if("ArrowLeft"===e.key||"ArrowUp"===e.key)n=(t-1+s.length)%s.length;else if("Home"===e.key)n=0;else{if("End"!==e.key)return"Enter"===e.key||" "===e.key?(e.preventDefault(),void this.select(t)):void 0;n=s.length-1}e.preventDefault();let a=0;for(;i[n]?.disabled&&a<s.length;)n="ArrowLeft"===e.key||"ArrowUp"===e.key?(n-1+s.length)%s.length:(n+1)%s.length,a+=1;this.tabButtons[n]?.focus()}updateIndicator(e=!1){const t=this.list?.querySelector(".designbase-wc-tabs__tab--selected");if(!t||!this.indicator)return;const s="vertical"===this.orientation;this.indicator.classList.toggle("designbase-wc-tabs__indicator--no-transition",!e),this.indicator.classList.add(s?"designbase-wc-tabs__indicator--vertical":"designbase-wc-tabs__indicator--horizontal"),this.indicator.classList.add("designbase-wc-tabs__indicator--ready"),s?(this.indicator.style.width="2px",this.indicator.style.height=`${t.offsetHeight}px`,this.indicator.style.transform=`translate3d(0, ${t.offsetTop}px, 0)`):(this.indicator.style.width=`${t.offsetWidth}px`,this.indicator.style.height="2px",this.indicator.style.transform=`translate3d(${t.offsetLeft}px, 0, 0)`)}}customElements.get("db-tabs")||customElements.define("db-tabs",DbTabs);class DbTextarea extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.handleInput=e=>{e.stopPropagation(),this.field&&(this.updateCharacterCount(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:this.field.value,nativeEvent:e},bubbles:!0,composed:!0})))},this.handleChange=e=>{if(e.stopPropagation(),!this.field)return;const t=this.field.value;this.getAttribute("value")!==t&&this.setAttribute("value",t),this.updateCharacterCount(),this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t,nativeEvent:e},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["label","placeholder","value","default-value","name","size","rows","max-length","show-character-count","character-count-position","disabled","readonly","required","error","error-message","helper-text","full-width","resizable"]}get value(){return this.field?.value??this.getAttribute("value")??""}set value(e){this.setAttribute("value",e),this.field&&(this.field.value=e,this.updateCharacterCount())}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}connectedCallback(){this.built||this.build(),this.syncState()}attributeChangedCallback(e){if(this.built){if("value"===e&&this.field){const e=this.getAttribute("value")||"";return this.field.value!==e&&(this.field.value=e),void this.updateCharacterCount()}this.syncState()}}focus(){this.field?.focus()}get showCharacterCount(){return this.hasAttribute("show-character-count")}get characterCountPosition(){return this.getAttribute("character-count-position")||"bottom"}build(){const e=this.getAttribute("id")||dbUid("db-textarea");this.hasAttribute("id")||this.setAttribute("id",e),this.labelEl=document.createElement("label"),this.labelEl.className="designbase-wc-textarea__label",this.labelEl.htmlFor=e,this.countTop=document.createElement("div"),this.countTop.className="designbase-wc-textarea__character-count designbase-wc-textarea__character-count--top",this.countTop.hidden=!0;const t=document.createElement("div");t.className="designbase-wc-textarea__wrapper",this.field=document.createElement("textarea"),this.field.id=e,this.field.className="designbase-wc-textarea__field",this.field.addEventListener("input",this.handleInput),this.field.addEventListener("change",this.handleChange),t.appendChild(this.field),this.footerEl=document.createElement("div"),this.footerEl.className="designbase-wc-textarea__footer",this.errorEl=document.createElement("div"),this.errorEl.className="designbase-wc-textarea__error-message",this.errorEl.setAttribute("role","alert"),this.helperEl=document.createElement("div"),this.helperEl.className="designbase-wc-textarea__helper-text",this.countBottom=document.createElement("div"),this.countBottom.className="designbase-wc-textarea__character-count designbase-wc-textarea__character-count--bottom",this.countBottom.hidden=!0,this.footerEl.append(this.errorEl,this.helperEl,this.countBottom),this.append(this.labelEl,this.countTop,t,this.footerEl),this.built=!0}syncState(){if(!this.field)return;const e=Ee.includes(this.size)?this.size:"m",t=this.getAttribute("label")||"",s=this.getAttribute("helper-text")||"",i=this.getAttribute("error-message")||"",n=this.hasAttribute("error"),a=this.getAttribute("value")??this.getAttribute("default-value")??"";if(this.className=["designbase-wc-textarea",`designbase-wc-textarea--${e}`,n&&"designbase-wc-textarea--error",this.hasAttribute("disabled")&&"designbase-wc-textarea--disabled",this.hasAttribute("readonly")&&"designbase-wc-textarea--readonly",this.hasAttribute("full-width")&&"designbase-wc-textarea--full-width",this.hasAttribute("resizable")?"":"designbase-wc-textarea--not-resizable"].filter(Boolean).join(" "),this.labelEl){const e=this.hasAttribute("required")?'<span aria-hidden="true"> *</span>':"";this.labelEl.innerHTML=t?`${this.escape(t)}${e}`:"",this.labelEl.hidden=!t}this.field.placeholder=this.getAttribute("placeholder")||"",this.field.name=this.getAttribute("name")||"",this.field.value!==a&&(this.field.value=a),this.field.rows=Number(this.getAttribute("rows")||4),this.field.disabled=this.hasAttribute("disabled"),this.field.readOnly=this.hasAttribute("readonly"),this.field.required=this.hasAttribute("required"),this.field.setAttribute("aria-invalid",String(n));const r=this.getAttribute("max-length");r?this.field.maxLength=Number(r):this.field.removeAttribute("maxLength");const o=`${this.getAttribute("id")}-helper`,l=`${this.getAttribute("id")}-error`;n&&i?(this.errorEl.id=l,this.errorEl.textContent=i,this.errorEl.hidden=!1,this.helperEl.hidden=!0,this.field.setAttribute("aria-describedby",l)):s?(this.helperEl.id=o,this.helperEl.textContent=s,this.helperEl.hidden=!1,this.errorEl.hidden=!0,this.field.setAttribute("aria-describedby",o)):(this.helperEl.hidden=!0,this.errorEl.hidden=!0,this.field.removeAttribute("aria-describedby")),this.updateCharacterCount()}updateCharacterCount(){if(!this.field||!this.countTop||!this.countBottom)return;const e=this.field.value.length,t=this.getAttribute("max-length"),s=Boolean(t&&e>Number(t)),i=`${e}${t?` / ${t}`:""}`,renderCount=e=>{let t=e.querySelector(".designbase-wc-textarea__character-count-text");t||(t=document.createElement("span"),e.replaceChildren(t)),t.className="designbase-wc-textarea__character-count-text",t.classList.toggle("designbase-wc-textarea__character-count-text--error",s),t.textContent=i};this.showCharacterCount&&"top"===this.characterCountPosition?(renderCount(this.countTop),this.countTop.hidden=!1,this.countBottom.hidden=!0):this.showCharacterCount?(renderCount(this.countBottom),this.countBottom.hidden=!1,this.countTop.hidden=!0):(this.countTop.hidden=!0,this.countBottom.hidden=!0)}escape(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]||e))}}customElements.get("db-textarea")||customElements.define("db-textarea",DbTextarea);class DbToast extends HTMLElement{constructor(){super(...arguments),this.timeoutId=null,this.progressInterval=null,this.closeTimerId=null,this.closed=!1,this.cleanups=new CleanupBag,this.elapsedBeforePause=0,this.runStartedAt=0,this.paused=!1,this.pauseTimers=()=>{this.paused||this.closed||(this.paused=!0,this.elapsedBeforePause+=Date.now()-this.runStartedAt,this.clearTimers())},this.resumeTimers=()=>{this.paused&&!this.closed&&(this.paused=!1,this.startTimers())}}static get observedAttributes(){return["toast-id","variant","title","description","duration","show-close","show-progress","auto-remove"]}connectedCallback(){this.closed=!1,this.elapsedBeforePause=0,this.render(),this.startTimers(),requestAnimationFrame(()=>this.classList.add("designbase-wc-toast--visible")),this.cleanups.listen(this,"pointerenter",this.pauseTimers),this.cleanups.listen(this,"pointerleave",this.resumeTimers),this.cleanups.listen(this,"focusin",this.pauseTimers),this.cleanups.listen(this,"focusout",this.resumeTimers)}disconnectedCallback(){this.cleanups.run(),this.clearTimers(),this.closeTimerId&&clearTimeout(this.closeTimerId),this.closeTimerId=null}attributeChangedCallback(e){if(!this.isConnected||this.closed)return;const t=this.classList.contains("designbase-wc-toast--visible");this.render(),t&&requestAnimationFrame(()=>this.classList.add("designbase-wc-toast--visible")),"duration"!==e&&"show-progress"!==e||(this.clearTimers(),this.startTimers())}clearTimers(){this.timeoutId&&clearTimeout(this.timeoutId),this.progressInterval&&clearInterval(this.progressInterval),this.timeoutId=null,this.progressInterval=null}startTimers(){const e=Number(this.getAttribute("duration")??"5000");if(!Number.isFinite(e)||e<=0)return;const t=Math.max(0,e-this.elapsedBeforePause);if(this.runStartedAt=Date.now(),0!==t){if("false"!==this.getAttribute("show-progress")&&this.hasAttribute("show-progress")){const t=this.querySelector(".designbase-wc-toast__progress-bar");t&&(t.style.width="0%");const s=Date.now();return void(this.progressInterval=setInterval(()=>{const i=this.elapsedBeforePause+(Date.now()-s),n=Math.min(100,i/e*100);t&&(t.style.width=`${n}%`),n>=100&&this.close()},16))}this.timeoutId=setTimeout(()=>this.close(),t)}else this.close()}close(){this.closed||(this.closed=!0,this.clearTimers(),this.classList.remove("designbase-wc-toast--visible"),this.classList.add("designbase-wc-toast--closing"),this.closeTimerId&&clearTimeout(this.closeTimerId),this.closeTimerId=setTimeout(()=>{this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0,detail:{id:this.getAttribute("toast-id")||""}})),("true"===this.getAttribute("auto-remove")||this.hasAttribute("auto-remove")&&"false"!==this.getAttribute("auto-remove"))&&this.remove()},300))}iconForVariant(e){return"success"===e?"circle-checked":"warning"===e?"warning-filled":"danger"===e?"error-filled":"info-filled"}render(){const e=coerceToContract(this.getAttribute("variant"),K,"info"),t=this.getAttribute("title")||"",s=this.getAttribute("description")||"",i="false"!==this.getAttribute("show-close"),n="false"!==this.getAttribute("show-progress")&&this.hasAttribute("show-progress");this.className=["designbase-wc-toast",`designbase-wc-toast--${e}`,this.closed&&"designbase-wc-toast--closing"].filter(Boolean).join(" ");const a=function politenessForTone(e){return"danger"===e||"warning"===e?"assertive":"polite"}(e);if(this.setAttribute("role","assertive"===a?"alert":"status"),this.setAttribute("aria-live",a),this.setAttribute("aria-atomic","true"),this.replaceChildren(),n){const e=document.createElement("div");e.className="designbase-wc-toast__progress";const t=document.createElement("div");t.className="designbase-wc-toast__progress-bar",t.style.width="0%",e.append(t),this.append(e)}const r=document.createElement("div");r.className=`designbase-wc-toast__icon designbase-wc-toast__icon--${e}`,r.setAttribute("aria-hidden","true"),r.append(createDbIcon(this.iconForVariant(e),20));const o=document.createElement("div");o.className="designbase-wc-toast__content";const l=document.createElement("div");if(l.className="designbase-wc-toast__title",l.textContent=t,o.append(l),s){const e=document.createElement("div");e.className="designbase-wc-toast__description",e.textContent=s,o.append(e)}if(this.append(r,o),i){const e=document.createElement("button");e.type="button",e.className="designbase-wc-toast__close-button",e.setAttribute("aria-label",labelFrom(this,"label-close","toast.close"));const t=createDbIcon("close",20);t.setAttribute("aria-hidden","true"),e.append(t),e.addEventListener("click",()=>this.close()),this.append(e)}}}customElements.get("db-toast")||customElements.define("db-toast",DbToast);class DbToggle extends HTMLElement{constructor(){super(...arguments),this.internals=this.attachInternals(),this.built=!1,this.userInteracted=!1,this.handleClick=()=>{if(this.disabled||this.readOnly)return;const e=!this.checked;this.userInteracted=!0,this.toggleAttribute("checked",e),this.syncFormValue(),this.syncState(),this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:e,selected:e},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","size","disabled","readonly","has-label","name","value"]}get checked(){return!(!this.hasAttribute("checked")&&!this.hasAttribute("selected"))||!this.userInteracted&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected"))}set checked(e){this.toggleAttribute("checked",e),this.syncFormValue(),this.syncClasses()}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e),this.root&&(this.root.disabled=e),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(e){this.toggleAttribute("readonly",e),this.syncClasses()}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState()}attributeChangedCallback(){this.built&&this.syncState()}formResetCallback(){this.userInteracted=!1;const e=this.hasAttribute("default-checked")||this.hasAttribute("default-selected");this.toggleAttribute("checked",e),this.syncFormValue(),this.syncState()}formDisabledCallback(e){this.toggleAttribute("disabled",e),this.root&&(this.root.disabled=e),this.syncClasses()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}syncFormValue(){const e=this.hasAttribute("checked")||this.hasAttribute("selected");this.internals.setFormValue(e?this.getAttribute("value")||"on":null)}build(){this.root=document.createElement("button"),this.root.type="button",this.root.className="designbase-wc-toggle";const e=document.createElement("span");e.className="designbase-wc-toggle__track",e.setAttribute("aria-hidden","true");const t=document.createElement("span");for(t.className="designbase-wc-toggle__thumb",e.appendChild(t),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-toggle__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(e,this.labelEl),this.appendChild(this.root),this.root.addEventListener("click",this.handleClick),this.built=!0}syncState(){this.root&&(this.root.disabled=this.disabled,this.root.setAttribute("role","switch"),this.root.setAttribute("aria-checked",String(this.checked)),this.readOnly?this.root.setAttribute("aria-readonly","true"):this.root.removeAttribute("aria-readonly"),this.syncFormValue(),this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncClasses())}syncClasses(){if(!this.root)return;const e=q.includes(this.size)?this.size:"m",t=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim()),s=this.checked;this.root.className=["designbase-wc-toggle",`designbase-wc-toggle--${e}`,s&&"designbase-wc-toggle--selected",this.disabled&&"designbase-wc-toggle--disabled",this.readOnly&&"designbase-wc-toggle--readonly",!t&&"designbase-wc-toggle--no-label"].filter(Boolean).join(" "),this.root.setAttribute("aria-pressed",String(s))}}DbToggle.formAssociated=!0,customElements.get("db-toggle")||customElements.define("db-toggle",DbToggle);const Je=[DbAccordion,DbAdminShell,DbAnimationBackground,DbAlert,DbAvatar,DbBadge,DbBanner,DbBreadcrumbs,DbButton,DbCheckbox,DbChip,DbDrawer,DbDropdown,DbContainer,DbEmptyState,DbInput,DbLogo,DbMenuItem,DbModal,DbPageHeader,DbPagination,DbRadio,DbSearchBar,DbSection,DbSegmentControl,DbSelect,DbSidebar,DbSkeleton,DbSpinner,DbTable,DbTabs,DbTextarea,DbToast,DbToggle];exports.DbAccordion=DbAccordion,exports.DbAdminShell=DbAdminShell,exports.DbAlert=DbAlert,exports.DbAnimationBackground=DbAnimationBackground,exports.DbAvatar=DbAvatar,exports.DbBadge=DbBadge,exports.DbBanner=DbBanner,exports.DbBreadcrumbs=DbBreadcrumbs,exports.DbButton=DbButton,exports.DbCheckbox=DbCheckbox,exports.DbChip=DbChip,exports.DbContainer=DbContainer,exports.DbDrawer=DbDrawer,exports.DbDropdown=DbDropdown,exports.DbEmptyState=DbEmptyState,exports.DbInput=DbInput,exports.DbLogo=DbLogo,exports.DbMenuItem=DbMenuItem,exports.DbModal=DbModal,exports.DbPageHeader=DbPageHeader,exports.DbPagination=DbPagination,exports.DbRadio=DbRadio,exports.DbSearchBar=DbSearchBar,exports.DbSection=DbSection,exports.DbSegmentControl=DbSegmentControl,exports.DbSelect=DbSelect,exports.DbSidebar=DbSidebar,exports.DbSkeleton=DbSkeleton,exports.DbSpinner=DbSpinner,exports.DbTable=DbTable,exports.DbTabs=DbTabs,exports.DbTextarea=DbTextarea,exports.DbToast=DbToast,exports.DbToggle=DbToggle,exports.REGISTERED_COMPONENTS=Je,exports.WORDPRESS_UI_VERSION="0.1.7";
|
|
1
|
+
"use strict";const e={"arrow-bar-left":'<path fill="currentColor" d="M20.75 20h-1.5V4h1.5zM11.03 6.53l-4.72 4.72H16v1.5H6.31l4.72 4.72-1.06 1.06L3.44 12l6.53-6.53z"/>',"arrow-bar-right":'<path fill="currentColor" d="M4.75 20h-1.5V4h1.5zm15.81-8-6.53 6.53-1.06-1.06 4.72-4.72H8v-1.5h9.69l-4.72-4.72 1.06-1.06z"/>',award:'<path fill="currentColor" d="M11.753 15.5c-1.8 0-3.5-.7-4.77-1.98a6.74 6.74 0 0 1-1.98-4.77c0-1.8.7-3.5 1.98-4.77A6.74 6.74 0 0 1 11.753 2c1.8 0 3.5.7 4.77 1.98a6.74 6.74 0 0 1 1.98 4.77c0 1.8-.7 3.5-1.98 4.77a6.74 6.74 0 0 1-4.77 1.98m0-12c-1.4 0-2.72.55-3.71 1.54a5.22 5.22 0 0 0-1.54 3.71c0 1.4.55 2.72 1.54 3.71a5.22 5.22 0 0 0 3.71 1.54c1.4 0 2.72-.55 3.71-1.54a5.22 5.22 0 0 0 1.54-3.71c0-1.4-.55-2.72-1.54-3.71a5.22 5.22 0 0 0-3.71-1.54"/><path fill="currentColor" d="M15.313 21.5a.74.74 0 0 1-.64-.37l-3.56-5.96a.751.751 0 1 1 1.29-.77l2.86 4.8 1.06-2.07a.76.76 0 0 1 .72-.41l2.33.17-2.95-4.99a.76.76 0 0 1 .26-1.03c.36-.21.82-.09 1.03.26l3.68 6.22c.14.24.14.54 0 .78s-.4.37-.69.35l-3.27-.23-1.45 2.83c-.12.24-.37.4-.64.41h-.02z"/><path fill="currentColor" d="M8.193 21.5h-.02c-.27 0-.52-.17-.64-.41l-1.45-2.83-3.28.23a.75.75 0 0 1-.69-.35.73.73 0 0 1 0-.78l3.69-6.18c.21-.36.67-.47 1.03-.26s.47.67.26 1.03l-2.95 4.95 2.34-.17c.31-.01.58.14.72.41l1.06 2.07 2.86-4.8c.21-.36.67-.47 1.03-.26s.47.67.26 1.03l-3.56 5.96c-.14.23-.38.37-.64.37z"/>',apple:'<path fill="currentColor" fill-rule="evenodd" d="M18.644 18.648q-.807 1.15-1.316 1.592-.787.723-1.692.744-.649.001-1.562-.373-.914-.372-1.683-.371-.805-.001-1.73.371-.924.375-1.495.393-.866.038-1.729-.764-.55-.48-1.377-1.648-.885-1.245-1.455-2.891-.61-1.78-.611-3.447 0-1.91.826-3.292a4.86 4.86 0 0 1 1.73-1.751 4.65 4.65 0 0 1 2.34-.662q.69.001 1.81.422t1.436.422q.237 0 1.593-.498 1.279-.46 2.163-.384 2.4.192 3.6 1.895-2.145 1.301-2.123 3.637.02 1.82 1.317 3.023a4.3 4.3 0 0 0 1.315.863q-.159.46-.336.882a10.3 10.3 0 0 1-1.021 1.837M14.959 5.039c-.836.976-1.846 1.541-2.941 1.452a3 3 0 0 1-.021-.36c0-.913.396-1.889 1.103-2.688q.528-.607 1.343-1.009.813-.397 1.536-.435.02.192.019.381-.001 1.426-1.039 2.659" clip-rule="evenodd"/>',"play-store":'<path fill="currentColor" fill-rule="evenodd" d="M15.911 8.659 6.36 3.29c-.633-.342-1.226-.39-1.746-.016l8.34 8.34zm3.578 4.69c.6-.336.929-.812.929-1.34 0-.527-.329-1.004-.928-1.34l-2.783-1.563-3.133 3.132 2.841 2.84zM4 4.659v14.706c0 .38.084.709.236.97l8.097-8.098L4.1 4.002c-.064.197-.1.417-.1.658m.902 16.25q.232.09.495.09.47 0 .968-.275l9.255-5.197-2.666-2.67z" clip-rule="evenodd"/>',"arrow-right":'<path fill="currentColor" d="m20.06 12-7.53 7.53-1.06-1.06 5.72-5.72H4v-1.5h13.19l-5.72-5.72 1.06-1.06z"/>',star:'<path fill="currentColor" fill-rule="evenodd" d="M12 1.25a.75.75 0 0 1 .673.419l2.926 5.945 6.509.944a.75.75 0 0 1 .417 1.278l-4.718 4.624 1.132 6.511a.75.75 0 0 1-1.083.796L12 18.744l-5.856 3.023a.75.75 0 0 1-1.083-.796l1.133-6.511-4.719-4.624a.75.75 0 0 1 .417-1.278l6.51-.944 2.925-5.945A.75.75 0 0 1 12 1.25m0 2.449L9.573 8.63a.75.75 0 0 1-.565.411l-5.4.783 3.917 3.84a.75.75 0 0 1 .214.664l-.941 5.412 4.858-2.508a.75.75 0 0 1 .688 0l4.858 2.508-.94-5.412a.75.75 0 0 1 .213-.665l3.918-3.84-5.4-.782a.75.75 0 0 1-.566-.41z" clip-rule="evenodd"/>',"star-filled":'<path fill="currentColor" d="M23 9c-.1-.4-.4-.6-.8-.7l-6.4-.9-2.9-5.8c-.3-.7-1.5-.7-1.8 0L8.2 7.4l-6.4.9c-.4 0-.7.3-.8.7s0 .8.3 1l4.6 4.5-1.1 6.4c0 .4 0 .8.4 1 .3.2.7.3 1.1 0l5.7-3 5.7 3c.1 0 .3.1.5.1s.4 0 .6-.2c.3-.2.5-.6.4-1l-1.1-6.4 4.6-4.5c.3-.3.4-.7.3-1z"/>',"star-half":'<path fill="currentColor" d="M8.9 8.3 2 9.3l5 4.8L5.8 21l6.2-3.2V2z"/><path fill="currentColor" fill-rule="evenodd" d="M12 1.25a.75.75 0 0 1 .673.419l2.926 5.945 6.509.944a.75.75 0 0 1 .417 1.278l-4.718 4.624 1.132 6.511a.75.75 0 0 1-1.083.796L12 18.744l-5.856 3.023a.75.75 0 0 1-1.083-.796l1.133-6.511-4.719-4.624a.75.75 0 0 1 .417-1.278l6.51-.944 2.925-5.945A.75.75 0 0 1 12 1.25m0 2.449L9.573 8.63a.75.75 0 0 1-.565.411l-5.4.783 3.917 3.84a.75.75 0 0 1 .214.664l-.941 5.412 4.858-2.508a.75.75 0 0 1 .688 0l4.858 2.508-.94-5.412a.75.75 0 0 1 .213-.665l3.918-3.84-5.4-.782a.75.75 0 0 1-.566-.41z" clip-rule="evenodd"/>',"trending-up":'<path fill="currentColor" d="M22 11V5h-6"/><path fill="currentColor" fill-rule="evenodd" d="M21.53 6.53 13 15.06l-3-3-6.47 6.47-1.06-1.06L10 9.94l3 3 7.47-7.47z" clip-rule="evenodd"/>',cart:'<path fill="currentColor" d="M3 2.25c.945 0 1.714.75 1.747 1.688L4.94 6.25h16.899l-1.167 10.5h-2.093a2.75 2.75 0 1 1-3.156 0H9.578a2.75 2.75 0 1 1-3.156 0H4.31L3.253 4.063 3.25 4.03V4A.25.25 0 0 0 3 3.75H1v-1.5zm5 15.5a1.25 1.25 0 1 0-.001 2.499A1.25 1.25 0 0 0 8 17.75m9 0a1.25 1.25 0 1 0-.001 2.499A1.25 1.25 0 0 0 17 17.75m-11.31-2.5h13.64l.832-7.5H5.064z"/>',"bell-active":'<path fill="currentColor" fill-rule="evenodd" d="M6.75 10.015V13c0 1.445-.466 2.453-1.06 3.25h12.62c-.594-.797-1.06-1.805-1.06-3.25v-2.985c-.047-1.117-.55-2.449-1.465-3.497C14.879 5.479 13.6 4.75 12 4.75s-2.879.73-3.785 1.768c-.914 1.048-1.418 2.38-1.465 3.497m.335-4.483C8.229 4.221 9.9 3.25 12 3.25s3.771.97 4.915 2.282c1.132 1.298 1.777 2.96 1.834 4.44l.001.028v3c0 1.67.788 2.477 1.78 3.47a.75.75 0 0 1-.53 1.28H4a.75.75 0 0 1-.53-1.28c.992-.992 1.78-1.8 1.78-3.47V9.971c.057-1.48.703-3.141 1.835-4.439" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M9 16.25a.75.75 0 0 1 .75.75v1c0 1.286.964 2.25 2.25 2.25s2.25-.964 2.25-2.25v-1a.75.75 0 0 1 1.5 0v1c0 2.114-1.636 3.75-3.75 3.75S8.25 20.114 8.25 18v-1a.75.75 0 0 1 .75-.75M17.424 2.52a.75.75 0 0 1 1.056-.096c1.307 1.089 2.463 2.786 3.19 4.24a.75.75 0 1 1-1.34.671c-.673-1.345-1.717-2.848-2.81-3.759a.75.75 0 0 1-.096-1.056M6.576 2.52a.75.75 0 0 1-.096 1.056c-1.093.911-2.137 2.414-2.81 3.76a.75.75 0 0 1-1.34-.671c.727-1.455 1.883-3.152 3.19-4.241a.75.75 0 0 1 1.056.096M12 1.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75" clip-rule="evenodd"/>',"caret-down-filled":'<path fill="currentColor" d="m12 14.5 5-5H7z"/>',"caret-updown-filled":'<path fill="currentColor" fill-rule="evenodd" d="m7 10 5-5 5 5zM17 14l-5 5-5-5z" clip-rule="evenodd"/>',"chevron-down":'<path fill="currentColor" fill-rule="evenodd" d="m5.47 9.53 1.06-1.06L12 13.94l5.47-5.47 1.06 1.06L12 16.06z" clip-rule="evenodd"/>',"chevron-up":'<path fill="currentColor" fill-rule="evenodd" d="m12 7.94 6.53 6.53-1.06 1.06L12 10.06l-5.47 5.47-1.06-1.06z" clip-rule="evenodd"/>',"chevron-left":'<path fill="currentColor" fill-rule="evenodd" d="m10.06 12 5.47-5.47-1.06-1.06L7.94 12l6.53 6.53 1.06-1.06z" clip-rule="evenodd"/>',"chevron-right":'<path fill="currentColor" fill-rule="evenodd" d="M9.53 5.47 16.06 12l-6.53 6.53-1.06-1.06L13.94 12 8.47 6.53z" clip-rule="evenodd"/>',calendar:'<path fill="currentColor" fill-rule="evenodd" d="M16.25 8V2h1.5v6zM6.25 8V2h1.5v6zM21 11.75H3v-1.5h18z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75a.25.25 0 0 0-.25.25v14c0 .138.112.25.25.25h16a.25.25 0 0 0 .25-.25V6a.25.25 0 0 0-.25-.25zM2.25 6c0-.966.784-1.75 1.75-1.75h16c.966 0 1.75.784 1.75 1.75v14A1.75 1.75 0 0 1 20 21.75H4A1.75 1.75 0 0 1 2.25 20z" clip-rule="evenodd"/>',camera:'<path fill="currentColor" fill-rule="evenodd" d="M7.785 5.475A2.73 2.73 0 0 1 10.07 4.25h3.86c.907 0 1.773.452 2.285 1.225v.002l1.186 1.773H20A2.756 2.756 0 0 1 22.75 10v7A2.756 2.756 0 0 1 20 19.75H4A2.756 2.756 0 0 1 1.25 17v-7A2.756 2.756 0 0 1 4 7.25h2.6zm2.285.275c-.42 0-.804.206-1.034.553l-.002.004L7.4 8.75H4c-.686 0-1.25.564-1.25 1.25v7c0 .686.564 1.25 1.25 1.25h16c.686 0 1.25-.564 1.25-1.25v-7c0-.686-.564-1.25-1.25-1.25h-3.4l-1.636-2.447a1.24 1.24 0 0 0-1.034-.553z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 10.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5M8.25 13a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0" clip-rule="evenodd"/>',clock:'<path fill="currentColor" fill-rule="evenodd" d="M12.75 11.25V6h-1.5v6.75H16v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12" clip-rule="evenodd"/>',bulb:'<path fill="currentColor" d="M15.5 17.5H8v-.75s-.02-1.79-1.06-3.21l-.29-.39C5.88 12.12 5 10.95 5 8.93 5 5.11 8.03 2 11.75 2s6.75 3.11 6.75 6.93c0 2-.87 3.17-1.65 4.2l-.29.39c-1.05 1.45-1.06 3.21-1.06 3.23zM9.44 16h4.62c.11-.81.42-2.16 1.29-3.36l.31-.41c.69-.93 1.35-1.8 1.35-3.31 0-2.99-2.36-5.43-5.25-5.43S6.5 5.93 6.5 8.93c0 1.52.66 2.4 1.35 3.32l.31.41c.86 1.19 1.17 2.53 1.28 3.34M15.75 20h-8v1.5h8z"/>',"circle-checked":'<path fill="currentColor" fill-rule="evenodd" d="m10.32 14.27 6.15-6.134 1.06 1.062-7.22 7.2L6.467 12.5l1.068-1.054z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M1.25 12C1.25 6.086 6.086 1.25 12 1.25S22.75 6.086 22.75 12 17.914 22.75 12 22.75 1.25 17.914 1.25 12M12 2.75c-5.086 0-9.25 4.164-9.25 9.25s4.164 9.25 9.25 9.25 9.25-4.164 9.25-9.25S17.086 2.75 12 2.75" clip-rule="evenodd"/>',"cloud-close":'<path fill="currentColor" fill-rule="evenodd" d="M5.23 9.323A7.75 7.75 0 0 1 12.5 4.25c3.782 0 6.923 2.71 7.606 6.291A4.74 4.74 0 0 1 23.25 15a4.75 4.75 0 0 1-4.75 4.75H6A5.25 5.25 0 0 1 .75 14.5c0-2.64 1.95-4.805 4.48-5.177M12.5 5.75a6.25 6.25 0 0 0-5.993 4.483l-.15.512-.534.025A3.74 3.74 0 0 0 2.25 14.5 3.75 3.75 0 0 0 6 18.25h12.5a3.243 3.243 0 0 0 .763-6.398l-.504-.122-.064-.514A6.25 6.25 0 0 0 12.5 5.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m14.47 15.53-5-5 1.06-1.06 5 5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m9.47 14.47 5-5 1.06 1.06-5 5z" clip-rule="evenodd"/>',close:'<path fill="currentColor" fill-rule="evenodd" d="m5.47 17.47 12-12 1.06 1.06-12 12z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m6.53 5.47 12 12-1.06 1.06-12-12z" clip-rule="evenodd"/>',done:'<path fill="currentColor" fill-rule="evenodd" d="M9.476 15.936 18.97 6.47l1.06 1.062L9.468 18.064l-5.502-5.58 1.068-1.053z" clip-rule="evenodd"/>',documentation:'<path fill="currentColor" fill-rule="evenodd" d="M2.25 4.25H9A3.75 3.75 0 0 1 12.75 8v13h-1.5A2.25 2.25 0 0 0 9 18.75H2.25zm9 13.75V8A2.25 2.25 0 0 0 9 5.75H3.75v11.5H9c.844 0 1.623.279 2.25.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 8A3.75 3.75 0 0 1 15 4.25h6.75v14.5H15A2.25 2.25 0 0 0 12.75 21h-1.5zm1.5 10c.627-.471 1.406-.75 2.25-.75h5.25V5.75H15A2.25 2.25 0 0 0 12.75 8z" clip-rule="evenodd"/>',"doughnut-chart":'<path fill="currentColor" d="M12 4.75A7.25 7.25 0 0 0 4.75 12 7.25 7.25 0 0 0 12 19.25c1.784 0 3.416-.644 4.68-1.713l.968 1.146A8.72 8.72 0 0 1 12 20.75 8.75 8.75 0 0 1 3.25 12 8.75 8.75 0 0 1 12 3.25zm6.743 1.673A8.72 8.72 0 0 1 20.75 12a8.72 8.72 0 0 1-1.851 5.382l-1.182-.923A7.22 7.22 0 0 0 19.25 12a7.22 7.22 0 0 0-1.663-4.62zM13.532 3.384a8.75 8.75 0 0 1 4.1 1.919l-.965 1.148A7.25 7.25 0 0 0 13.273 4.86z"/>',download:'<path fill="currentColor" fill-rule="evenodd" d="M2.25 15h1.5v4.25h16.5V15h1.5v5.75H2.25z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m6.47 11.53 1.06-1.06L12 14.94l4.47-4.47 1.06 1.06L12 17.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 16V3h1.5v13z" clip-rule="evenodd"/>',"error-filled":'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5M8.47 9.53l1.06-1.06L12 10.94l2.47-2.47 1.06 1.06L13.06 12l2.47 2.47-1.06 1.06L12 13.06l-2.47 2.47-1.06-1.06L10.94 12z" clip-rule="evenodd"/>',edit:'<path fill="currentColor" fill-rule="evenodd" d="M15.506 3.322a3.655 3.655 0 0 1 5.172 0 3.655 3.655 0 0 1 0 5.172L7.466 21.75H2.25v-5.215zm2.586.428c-.572 0-1.121.227-1.525.632l-.002.001L3.75 17.157v3.093h3.093L19.618 7.434a2.16 2.16 0 0 0-1.526-3.684" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M17.7 10.453 13.548 6.3l1.06-1.06 4.154 4.154z" clip-rule="evenodd"/>',eyedropper:'<path fill="currentColor" d="M17.889 11.615a.25.25 0 0 0 0-.353l-5.657-5.657a.25.25 0 0 0-.354 0l-1.414 1.414a.25.25 0 0 0 0 .354l5.657 5.656a.25.25 0 0 0 .354 0zm-.354 2.475a1.75 1.75 0 0 1-2.475 0L9.404 8.433a1.75 1.75 0 0 1 0-2.475l1.414-1.414a1.75 1.75 0 0 1 2.475 0l5.657 5.657a1.75 1.75 0 0 1 0 2.475z"/><path fill="currentColor" d="m15.951 12.86-7.077 7.076-.262.03-1.009.11-.453.454a2.85 2.85 0 0 1-4.03-4.03l.42-.42v-1.41l7.11-7.11zM5.04 15.291v1.41l-.86.86a1.35 1.35 0 0 0 1.91 1.909l.826-.826.262-.03 1.007-.111 5.644-5.644-3.18-3.178zM15.36 2.84a2.754 2.754 0 0 1 3.89 0l1.41 1.41a2.754 2.754 0 0 1 0 3.89l-2.94 2.941-5.3-5.3zm2.83 1.06a1.254 1.254 0 0 0-1.77 0l-1.88 1.88 3.18 3.18 1.88-1.88a1.255 1.255 0 0 0 0-1.77z"/><path fill="currentColor" d="m12.743 14.25-.006 1.5-8.46-.03.006-1.5z"/>',"file-new":'<path fill="currentColor" fill-rule="evenodd" d="M4.25 4c0-.966.784-1.75 1.75-1.75h7.31l6.44 6.44V20A1.75 1.75 0 0 1 18 21.75H6A1.75 1.75 0 0 1 4.25 20zM6 3.75a.25.25 0 0 0-.25.25v16c0 .138.112.25.25.25h12a.25.25 0 0 0 .25-.25V9.31l-5.56-5.56z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M13.75 8.25V3h-1.5v6.75H19v-1.5zM15 15.75H9v-1.5h6z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 18v-6h1.5v6z" clip-rule="evenodd"/>',"folder-open":'<path fill="currentColor" fill-rule="evenodd" d="M5 4.75c-.69 0-1.25.559-1.25 1.25v8.824l1.303-2.606c.296-.593.904-.968 1.565-.968H18.25V8c0-.69-.559-1.25-1.25-1.25h-6.311L9.056 5.116a1.25 1.25 0 0 0-.884-.366zm14.75 6.5h.632c1.3 0 2.147 1.368 1.565 2.533l-2.724 5.446a2.75 2.75 0 0 1-2.46 1.521H5A2.75 2.75 0 0 1 2.25 18V6A2.75 2.75 0 0 1 5 3.25h3.172c.729 0 1.429.29 1.944.806L11.311 5.25H17A2.75 2.75 0 0 1 19.75 8zM3.76 18.157l2.635-5.269a.25.25 0 0 1 .223-.138H20.382a.25.25 0 0 1 .223.361l-2.724 5.448a1.25 1.25 0 0 1-1.118.691H5c-.637 0-1.163-.476-1.24-1.093" clip-rule="evenodd"/>',gallery:'<path fill="currentColor" d="M7.5 11c.8 0 1.5-.7 1.5-1.5S8.3 8 7.5 8 6 8.7 6 9.5 6.7 11 7.5 11"/><path fill="currentColor" fill-rule="evenodd" d="m16.698 9.015 5.787 4.913-.97 1.144-4.813-4.087L5.487 20.57l-.974-1.14z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 4.75c-.69 0-1.25.56-1.25 1.25v12c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V6c0-.69-.56-1.25-1.25-1.25zM1.25 6A2.75 2.75 0 0 1 4 3.25h16A2.75 2.75 0 0 1 22.75 6v12A2.75 2.75 0 0 1 20 20.75H4A2.75 2.75 0 0 1 1.25 18z" clip-rule="evenodd"/>',hide:'<path fill="currentColor" fill-rule="evenodd" d="M8.343 11.2c.056-.27.147-.581.284-.842l1.328.696c-.047.09-.102.252-.145.454-.041.199-.06.381-.06.492A2.27 2.27 0 0 0 12 14.25c.284 0 .685-.056.983-.2l.65 1.352c-.57.274-1.217.348-1.633.348-2.056 0-3.75-1.694-3.75-3.75 0-.238.035-.527.093-.8" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.833 12c.477-.936 1.58-2.68 3.626-3.843l-.742-1.304c-2.695 1.534-3.975 3.906-4.4 4.835L1.176 12l.143.312c.685 1.5 3.5 6.438 10.682 6.438 1.62 0 3.026-.253 4.242-.667l-.484-1.42c-1.054.36-2.297.587-3.758.587-5.874 0-8.377-3.707-9.167-5.25M12 6.75c-.673 0-1.6.084-2.202.227l-.346-1.46c.746-.177 1.797-.267 2.548-.267 7.182 0 9.997 4.939 10.682 6.438l.143.312-.143.312a11.1 11.1 0 0 1-3.22 4.037l-.923-1.184A9.7 9.7 0 0 0 21.166 12c-.79-1.544-3.292-5.25-9.166-5.25" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m19.763 22.237-18-18 1.06-1.06 18 18z" clip-rule="evenodd"/>',globe:'<path fill="currentColor" d="M18.895 2.105a9.7 9.7 0 0 1 0 13.79 9.6 9.6 0 0 1-6.145 2.824v1.531H17v1.5H7v-1.5h4.25v-1.531a9.6 9.6 0 0 1-6.145-2.824l1.06-1.061a8 8 0 0 0 11.673 0 8 8 0 0 0 0-11.667l1.057-1.062zM12 2.625A6.375 6.375 0 0 1 18.375 9 6.375 6.375 0 0 1 12 15.375 6.375 6.375 0 0 1 5.625 9 6.375 6.375 0 0 1 12 2.625m0 1.5A4.875 4.875 0 0 0 7.125 9 4.875 4.875 0 0 0 12 13.875 4.875 4.875 0 0 0 16.875 9 4.875 4.875 0 0 0 12 4.125"/>',"info-filled":'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5m-.75 5h1.5v1.5h-1.5zm0 3h1.5v6.5h-1.5z" clip-rule="evenodd"/>',lock:'<path fill="currentColor" fill-rule="evenodd" d="M5 11.75a.25.25 0 0 0-.25.25v8c0 .138.112.25.25.25h14a.25.25 0 0 0 .25-.25v-8a.25.25 0 0 0-.25-.25zM3.25 12c0-.966.784-1.75 1.75-1.75h14c.966 0 1.75.784 1.75 1.75v8A1.75 1.75 0 0 1 19 21.75H5A1.75 1.75 0 0 1 3.25 20z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75A3.26 3.26 0 0 0 8.75 7v4h-1.5V7A4.76 4.76 0 0 1 12 2.25 4.76 4.76 0 0 1 16.75 7v4h-1.5V7A3.26 3.26 0 0 0 12 3.75" clip-rule="evenodd"/>',mail:'<path fill="currentColor" fill-rule="evenodd" d="m1.665 8.67.67-1.34L12 12.161l9.665-4.833.67 1.342L12 13.839z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V7c0-.69-.56-1.25-1.25-1.25zM1.25 7A2.75 2.75 0 0 1 4 4.25h16A2.75 2.75 0 0 1 22.75 7v10A2.75 2.75 0 0 1 20 19.75H4A2.75 2.75 0 0 1 1.25 17z" clip-rule="evenodd"/>',menu:'<path fill="currentColor" d="M3.75 6.25h16.5v1.5H3.75zm0 5h16.5v1.5H3.75zm0 5h16.5v1.5H3.75z"/>',microphone:'<path fill="currentColor" fill-rule="evenodd" d="M12 2.75a2.25 2.25 0 0 0-1.59.66h-.001A2.25 2.25 0 0 0 9.75 5v5c0 .596.237 1.168.66 1.59v.001A2.248 2.248 0 0 0 14.25 10V5A2.254 2.254 0 0 0 12 2.75m-2.651-.402A3.75 3.75 0 0 1 15.75 5v5A3.754 3.754 0 0 1 12 13.75 3.75 3.75 0 0 1 8.25 10V5c0-.995.395-1.949 1.099-2.652" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M6.52 15.48A7.76 7.76 0 0 1 4.25 10h1.5c0 1.657.659 3.247 1.83 4.42m0 0A6.25 6.25 0 0 0 18.25 10h1.5a7.749 7.749 0 0 1-13.23 5.48M16 21.75H8v-1.5h8z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 21v-4h1.5v4z" clip-rule="evenodd"/>',minus:'<path fill="currentColor" fill-rule="evenodd" d="M6 10.75h12v1.5H6z" clip-rule="evenodd"/>',moon:'<path fill="currentColor" fill-rule="evenodd" d="M11.67 2.763a.75.75 0 0 1-.11.835c-.191.216-.414.406-.59.555l-.126.108a2.6 2.6 0 0 0-.512.568C10.043 5.28 9.75 6.113 9.75 8A6.207 6.207 0 0 0 16 14.25c1.706 0 3.214-.624 4.37-1.78a.75.75 0 0 1 1.277.596c-.433 4.878-4.25 8.684-9.647 8.684-5.435 0-9.75-4.757-9.75-9.75 0-4.976 3.784-9.211 8.684-9.647a.75.75 0 0 1 .736.41m-2.8 1.61C5.872 5.57 3.75 8.568 3.75 12c0 4.208 3.685 8.25 8.25 8.25 3.885 0 6.76-2.276 7.782-5.466-1.128.634-2.412.966-3.782.966A7.707 7.707 0 0 1 8.25 8c0-1.736.228-2.843.62-3.627" clip-rule="evenodd"/>',"more-vertical":'<path fill="currentColor" d="M11.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M11.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M11.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>',paperclip:'<path fill="currentColor" fill-rule="evenodd" d="M10.855 3.784c.874-.983 2.19-1.434 3.445-1.434 1.295 0 2.487.477 3.43 1.42a4.75 4.75 0 0 1 1.42 3.43 4.75 4.75 0 0 1-1.42 3.43l-.004.005-6.398 6.298c-.55.548-1.244.817-2.028.817-.786 0-1.48-.27-2.03-.82s-.82-1.244-.82-2.03.27-1.48.82-2.03l6.4-6.4 1.06 1.06-6.4 6.4c-.25.25-.38.556-.38.97 0 .415.13.72.38.97s.556.38.97.38.72-.13.97-.38l.004-.004 6.398-6.298A3.26 3.26 0 0 0 17.65 7.2c0-.905-.323-1.713-.98-2.37a3.26 3.26 0 0 0-2.37-.98c-.936 0-1.81.342-2.336.944l-.018.021-6.418 6.317C4.475 12.187 3.95 13.493 3.95 15c0 1.476.603 2.797 1.592 3.881a5.46 5.46 0 0 0 3.858 1.57c1.415 0 2.82-.531 3.87-1.581l.003-.004 7.6-7.5 1.054 1.068-7.597 7.496q0 .002-.002.002A6.96 6.96 0 0 1 9.4 21.95c-1.786 0-3.58-.67-4.93-2.02l-.012-.011-.01-.012C3.242 18.593 2.45 16.919 2.45 15c0-1.892.674-3.585 2.02-4.93l.004-.004z" clip-rule="evenodd"/>',pause:'<path fill="currentColor" fill-rule="evenodd" d="M8 6.75h2.5v10.5H8zm5.5 0H16v10.5h-2.5z" clip-rule="evenodd"/>',play:'<path fill="currentColor" fill-rule="evenodd" d="M9.5 7.21v9.58l7.5-4.79z" clip-rule="evenodd"/>',plus:'<path fill="currentColor" fill-rule="evenodd" d="M11.25 11.25v-7h1.5v7h7v1.5h-7v7h-1.5v-7h-7v-1.5z" clip-rule="evenodd"/>',copy:'<path fill="currentColor" fill-rule="evenodd" d="M8 3.75a.25.25 0 0 0-.25.25v12c0 .138.112.25.25.25h12a.25.25 0 0 0 .25-.25V4a.25.25 0 0 0-.25-.25zM6.25 4c0-.966.784-1.75 1.75-1.75h12c.966 0 1.75.784 1.75 1.75v12A1.75 1.75 0 0 1 20 17.75H8A1.75 1.75 0 0 1 6.25 16z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M3.75 9v9A2.25 2.25 0 0 0 6 20.25h9v1.5H6A3.75 3.75 0 0 1 2.25 18V9z" clip-rule="evenodd"/>',code:'<path fill="currentColor" fill-rule="evenodd" d="m6.47 7.47 1.06 1.06L4.06 12l3.47 3.47-1.06 1.06L1.94 12zM19.94 12l-3.47-3.47 1.06-1.06L22.06 12l-4.53 4.53-1.06-1.06zM8.31 18.705l6-14 1.38.59-6 14z" clip-rule="evenodd"/>',write:'<path fill="currentColor" fill-rule="evenodd" d="M3.056 6.056A2.75 2.75 0 0 1 5 5.25h3v1.5H5A1.25 1.25 0 0 0 3.75 8v11A1.25 1.25 0 0 0 5 20.25h11A1.25 1.25 0 0 0 17.25 19v-3h1.5v3A2.75 2.75 0 0 1 16 21.75H5A2.75 2.75 0 0 1 2.25 19V8c0-.73.29-1.429.806-1.944" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M16.885 3.084a2.85 2.85 0 0 1 4.03 4.03l-9.604 9.636H7.25v-4.061zm2.015.666a1.35 1.35 0 0 0-.955.395L8.75 13.311v1.939h1.939l9.166-9.195A1.35 1.35 0 0 0 18.9 3.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m18.47 8.53-3-3 1.06-1.06 3 3z" clip-rule="evenodd"/>',upload:'<path fill="currentColor" d="m12 2.94 5.53 5.53-1.06 1.06-3.72-3.72V17h-1.5V5.81L7.53 9.53 6.47 8.47z"/><path fill="currentColor" d="M2.25 15h1.5v4.25h16.5V15h1.5v5.75H2.25z"/>',video:'<path fill="currentColor" fill-rule="evenodd" d="M21.37 6.347a.75.75 0 0 1 .38.653v10a.75.75 0 0 1-1.136.643l-5-3a.75.75 0 1 1 .772-1.286l3.864 2.318v-7.35l-3.864 2.318a.75.75 0 1 1-.772-1.286l5-3a.75.75 0 0 1 .755-.01" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.25 6A.75.75 0 0 1 3 5.25h13a.75.75 0 0 1 .75.75v12a.75.75 0 0 1-.75.75H3a.75.75 0 0 1-.75-.75zm1.5.75v10.5h11.5V6.75z" clip-rule="evenodd"/>',"volume-up":'<path fill="currentColor" fill-rule="evenodd" d="M12.325 4.324A.75.75 0 0 1 12.75 5v14a.75.75 0 0 1-1.219.586L6.738 15.75H3a.75.75 0 0 1-.75-.75V9A.75.75 0 0 1 3 8.25h3.737l4.794-3.836a.75.75 0 0 1 .794-.09M11.25 6.56 7.469 9.586A.75.75 0 0 1 7 9.75H3.75v4.5H7a.75.75 0 0 1 .469.164l3.781 3.025zM17.57 4.37a.75.75 0 0 1 1.06 0c2.046 2.046 3.12 4.739 3.12 7.63 0 2.908-1.185 5.589-3.105 7.616a.75.75 0 1 1-1.09-1.032c1.68-1.773 2.695-4.092 2.695-6.584 0-2.508-.926-4.815-2.68-6.57a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M14.97 7.97a.75.75 0 0 1 1.06 0c1.025 1.025 1.72 2.51 1.72 4.03 0 1.485-.571 2.998-1.748 4.058a.75.75 0 1 1-1.004-1.115c.823-.741 1.252-1.828 1.252-2.943 0-1.08-.505-2.195-1.28-2.97a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/>',"mute-filled":'<path fill="currentColor" d="M12.3 4.1h.1c-.3-.2-.8 0-1.1.1L6.6 8H3c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h3.6l4.7 3.8c.2.1.4.2.6.2h.4c.3-.2.6-.5.6-.9V5q0-.6-.6-.9M21.9 9.7l-1.4-1.4-2.3 2.3-2.3-2.3-1.4 1.4 2.3 2.3-2.3 2.3 1.4 1.4 2.3-2.3 2.3 2.3 1.4-1.4-2.3-2.3z"/>',package:'<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M12 1.14 21.65 6.56v9.78L12 21.76 2.35 16.44V6.56zm-8.15 6.3v8.12L12 20.04l7.8-4.48V7.44L12 2.86z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M21.27 7.75 12.37 12.75l-.74-1.31 8.9-5z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M11.25 21v-8.9h1.5V21z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M3.47 6.35 12.37 11.45l-.75 1.3-8.9-5.1z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M7.23 8.85 16.13 3.85l.74 1.3-8.9 5z"/>',"delivery-filled":'<path fill="currentColor" d="M22.68 11.13 21.45 8.66A2.25 2.25 0 0 0 18.76 7H18a3 3 0 0 0-3-3H4a3 3 0 0 0-3 3v9c0 .87.39 1.67 1.02 2.23.14 1.54 1.43 2.77 3 2.77 1.3 0 2.4-.84 2.82-2h6.37c.42 1.16 1.52 2 2.82 2 1.65 0 3-1.35 3-3h1c1.1 0 2-.9 2-2v-3.53c0-.46-.11-.92-.32-1.34M5 19c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m12 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m4-3h-1.78c-.33-.37-.75-.65-1.22-.82V9h.76c.38 0 .73.21.9.55l1.24 2.47c.07.14.1.3.1.47z"/>',repeat:'<path fill="currentColor" fill-rule="evenodd" d="m18.94 6-3.47-3.47 1.06-1.06L21.06 6l-4.53 4.53-1.06-1.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M5.532 7.433c.587-.488 1.3-.783 1.968-.783h12.4v-1.5H7.5c-1.116 0-2.183.49-2.988 1.18l-.044.038-.037.044C3.757 7.197 3.25 8.164 3.25 9.3V11h1.5V9.3c0-.648.279-1.267.782-1.867M5.06 18l3.47-3.47-1.06-1.06L2.94 18l4.53 4.53 1.06-1.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M19.25 14.7V13h1.5v1.7c0 1.136-.508 2.103-1.18 2.888l-.038.044-.044.037c-.805.69-1.872 1.181-2.988 1.181H4v-1.5h12.5c.668 0 1.381-.295 1.968-.783.503-.6.782-1.22.782-1.867" clip-rule="evenodd"/>',settings:'<path fill="currentColor" fill-rule="evenodd" d="M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0M12 9.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M9.757 1.888a.75.75 0 0 1 .742-.639h3a.75.75 0 0 1 .742.639l.425 2.836q.303.11.594.244l2.304-1.703a.75.75 0 0 1 .976.073l2.121 2.12a.75.75 0 0 1 .073.977l-1.702 2.304q.134.291.244.594l2.835.425a.75.75 0 0 1 .639.742v3a.75.75 0 0 1-.639.742l-2.836.425q-.11.303-.243.594l1.702 2.304a.75.75 0 0 1-.073.976l-2.12 2.121a.75.75 0 0 1-.977.073l-2.304-1.702q-.291.134-.594.244l-.425 2.835a.75.75 0 0 1-.742.639h-3a.75.75 0 0 1-.742-.639l-.425-2.836a8 8 0 0 1-.594-.244l-2.304 1.703a.75.75 0 0 1-.976-.073l-2.121-2.12a.75.75 0 0 1-.073-.977l1.702-2.304a8 8 0 0 1-.244-.594l-2.835-.425a.75.75 0 0 1-.639-.742v-3a.75.75 0 0 1 .639-.742l2.836-.425q.11-.303.244-.594L3.264 6.435a.75.75 0 0 1 .073-.976l2.12-2.121a.75.75 0 0 1 .977-.073l2.304 1.702q.291-.134.594-.244zm1.388.861-.398 2.653a.75.75 0 0 1-.53.608 6 6 0 0 0-1.197.493.75.75 0 0 1-.804-.056L6.062 4.855 4.854 6.063l1.592 2.154a.75.75 0 0 1 .056.804 6.2 6.2 0 0 0-.493 1.2.75.75 0 0 1-.608.527l-2.653.398v1.708l2.653.398a.75.75 0 0 1 .608.53q.188.634.493 1.197a.75.75 0 0 1-.056.804l-1.592 2.154 1.208 1.208 2.154-1.592a.75.75 0 0 1 .804-.056q.562.304 1.2.493a.75.75 0 0 1 .527.608l.398 2.653h1.708l.398-2.653a.75.75 0 0 1 .53-.608q.634-.188 1.197-.493a.75.75 0 0 1 .804.056l2.154 1.592 1.208-1.208-1.592-2.154a.75.75 0 0 1-.056-.804q.304-.562.493-1.2a.75.75 0 0 1 .608-.527l2.653-.398v-1.708l-2.653-.398a.75.75 0 0 1-.608-.53 6 6 0 0 0-.493-1.197.75.75 0 0 1 .056-.804l1.592-2.154-1.208-1.208-2.154 1.592a.75.75 0 0 1-.804.056 6.2 6.2 0 0 0-1.2-.493.75.75 0 0 1-.527-.608l-.398-2.653z" clip-rule="evenodd"/>',refresh:'<path fill="currentColor" fill-rule="evenodd" d="M20.25 8.25V3h1.5v6.75H16v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75A8.25 8.25 0 0 0 3.75 12 8.25 8.25 0 0 0 12 20.25 8.25 8.25 0 0 0 20.25 12h1.5A9.75 9.75 0 0 1 12 21.75 9.75 9.75 0 0 1 2.25 12 9.75 9.75 0 0 1 12 2.25a9.75 9.75 0 0 1 8.628 5.205l.094.106.324.361.011.012.462.517a3 3 0 0 1 .098.123c.007.01.03.044.054.09l-1.342.671a.586.586 0 0 0 .068.11l.009.012-.021-.025q-.037-.043-.107-.12l-.335-.373-.013-.015-.494-.554-.05-.065a1 1 0 0 1-.05-.084l-.002-.004A8.25 8.25 0 0 0 12 3.75" clip-rule="evenodd"/>',expand:'<path fill="currentColor" fill-rule="evenodd" d="M17.25 6.75H12v-1.5h6.75V12h-1.5zM6.75 17.25V12h-1.5v6.75H12v-1.5z" clip-rule="evenodd"/>',shrink:'<path fill="currentColor" fill-rule="evenodd" d="M9.25 14.75H4v-1.5h6.75V20h-1.5zM13.75 10.25V5h-1.5v6.75H19v-1.5z" clip-rule="evenodd"/>',"grip-vertical":'<path fill="currentColor" d="M9.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>',"grip-horizontal":'<path fill="currentColor" d="M8 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M13.5 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M19 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M8 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M13.5 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M19 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"/>',search:'<path fill="currentColor" fill-rule="evenodd" d="M2.25 11c0-4.814 3.936-8.75 8.75-8.75s8.75 3.936 8.75 8.75-3.936 8.75-8.75 8.75S2.25 15.814 2.25 11M11 3.75c-3.986 0-7.25 3.264-7.25 7.25s3.264 7.25 7.25 7.25 7.25-3.264 7.25-7.25S14.986 3.75 11 3.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m17.13 16.07 4.4 4.4-1.06 1.06-4.4-4.4z" clip-rule="evenodd"/>',send:'<path fill="currentColor" fill-rule="evenodd" d="M1.298 4.736A.75.75 0 0 1 2 4.25h20a.75.75 0 0 1 .646 1.13l-10 17a.75.75 0 0 1-1.382-.233l-1.95-9.75-7.808-6.833a.75.75 0 0 1-.208-.828M3.996 5.75l6.498 5.686a.75.75 0 0 1 .241.417l1.615 8.073L20.689 5.75z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m22.378 5.648-12 7-.756-1.296 12-7z" clip-rule="evenodd"/>',"share-alt":'<path fill="currentColor" fill-rule="evenodd" d="M13.69 3.317a.75.75 0 0 1 .804.119l8 7a.75.75 0 0 1 0 1.128l-8 7A.75.75 0 0 1 13.25 18v-3.24c-1.925.051-3.579.315-5.062.932-1.659.692-3.157 1.85-4.588 3.758A.75.75 0 0 1 2.25 19c0-4.145 1.147-6.888 3.291-8.698 1.96-1.655 4.655-2.437 7.709-2.943V4a.75.75 0 0 1 .44-.683m1.06 2.336V8a.75.75 0 0 1-.638.742c-3.283.497-5.85 1.225-7.603 2.706-1.359 1.147-2.303 2.812-2.631 5.39 1.153-1.15 2.386-1.969 3.734-2.53 1.928-.804 4.04-1.058 6.388-1.058a.75.75 0 0 1 .75.75v2.347L20.861 11z" clip-rule="evenodd"/>',show:'<path fill="currentColor" fill-rule="evenodd" d="M8.25 12c0-2.055 1.695-3.75 3.75-3.75s3.75 1.694 3.75 3.75-1.694 3.75-3.75 3.75S8.25 14.056 8.25 12M12 9.75A2.27 2.27 0 0 0 9.75 12 2.27 2.27 0 0 0 12 14.25 2.27 2.27 0 0 0 14.25 12 2.27 2.27 0 0 0 12 9.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.833 12c.791 1.543 3.297 5.25 9.167 5.25 5.872 0 8.374-3.704 9.167-5.25-.791-1.543-3.297-5.25-9.167-5.25-5.871 0-8.374 3.704-9.167 5.25m-1.515-.312C2.006 10.183 4.823 5.25 12 5.25s9.997 4.938 10.682 6.438l.143.312-.143.312C21.994 13.817 19.177 18.75 12 18.75s-9.997-4.938-10.682-6.438L1.175 12z" clip-rule="evenodd"/>',sparkle:'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25 14.08 8 19.75 10l-5.67 2L12 17.75 9.92 12 4.25 10l5.67-2zm0 4.4-.9 2.49-2.45.86 2.45.86.9 2.49.9-2.49 2.45-.86-2.45-.86zM18.5 15.25l.88 2.37 2.37.88-2.37.88-.88 2.37-.88-2.37-2.37-.88 2.37-.88z" clip-rule="evenodd"/>',stop:'<path fill="currentColor" fill-rule="evenodd" d="M3.25 6A2.756 2.756 0 0 1 6 3.25h12A2.756 2.756 0 0 1 20.75 6v12A2.756 2.756 0 0 1 18 20.75H6A2.756 2.756 0 0 1 3.25 18zM6 4.75c-.686 0-1.25.564-1.25 1.25v12c0 .686.564 1.25 1.25 1.25h12c.686 0 1.25-.564 1.25-1.25V6c0-.686-.564-1.25-1.25-1.25z" clip-rule="evenodd"/>',sun:'<path fill="currentColor" fill-rule="evenodd" d="M12 7.75a4.25 4.25 0 1 0 0 8.5 4.25 4.25 0 0 0 0-8.5M6.25 12a5.75 5.75 0 1 1 11.5 0 5.75 5.75 0 0 1-11.5 0" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M11.25 5V2h1.5v3zm0 17v-3h1.5v3zm5.12-15.43 2.2-2.2 1.06 1.06-2.2 2.2zm-12.48 12.48 2.2-2.2 1.06 1.06-2.2 2.2zM19 11.25h3v1.5h-3zM2 11.25h3v1.5H2zm14.43 5.12 2.2 2.2-1.06 1.06-2.2-2.2zM4.37 6.57 6.57 4.37l1.06 1.06-2.2 2.2z" clip-rule="evenodd"/>',"thumb-down":'<path fill="currentColor" fill-rule="evenodd" d="M6.74 4.75a2.25 2.25 0 0 0-2.241 2.046l-.554 6.09A1.25 1.25 0 0 0 5.19 14.25H9a.75.75 0 0 1 .75.75v4c0 1.339 1.297 2.892 3.5 2.428V15a.75.75 0 0 1 .75-.75h1.25V7c0-.77-.235-1.314-.586-1.664-.35-.35-.895-.586-1.664-.586zm8.518-.861C14.632 3.46 13.855 3.25 13 3.25H6.74a3.75 3.75 0 0 0-3.735 3.41l-.554 6.091A2.75 2.75 0 0 0 5.19 15.75h3.06V19c0 2.462 2.501 4.874 5.987 3.712A.75.75 0 0 0 14.75 22v-6.25H21a.75.75 0 0 0 .75-.75V4a.75.75 0 0 0-.75-.75h-5a.75.75 0 0 0-.742.639m1.492.861v9.5h3.5v-9.5z" clip-rule="evenodd"/>',"thumb-up":'<path fill="currentColor" fill-rule="evenodd" d="M10.75 2.572V9a.75.75 0 0 1-.75.75H8.75V17c0 .77.235 1.314.586 1.664.35.35.895.586 1.664.586h6.26a2.25 2.25 0 0 0 2.241-2.046l.554-6.09A1.25 1.25 0 0 0 18.81 9.75H15a.75.75 0 0 1-.75-.75V5c0-1.339-1.296-2.891-3.5-2.428M7.25 19.25v-9.5h-3.5v9.5zM3 8.25a.75.75 0 0 0-.75.75v11c0 .414.336.75.75.75h5a.75.75 0 0 0 .742-.639c.627.428 1.403.639 2.258.639h6.26a3.75 3.75 0 0 0 3.735-3.41l.554-6.091A2.75 2.75 0 0 0 18.81 8.25h-3.06V5c0-2.462-2.501-4.874-5.987-3.712A.75.75 0 0 0 9.25 2v6.25z" clip-rule="evenodd"/>',trash:'<path fill="currentColor" fill-rule="evenodd" d="M6.75 6v13c0 .69.56 1.25 1.25 1.25h8c.69 0 1.25-.56 1.25-1.25V6h1.5v13A2.75 2.75 0 0 1 16 21.75H8A2.75 2.75 0 0 1 5.25 19V6z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M21 6.75H3v-1.5h18z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M7.25 4c0-.966.784-1.75 1.75-1.75h6c.966 0 1.75.784 1.75 1.75v2h-1.5V4a.25.25 0 0 0-.25-.25H9a.25.25 0 0 0-.25.25v2h-1.5zM9.25 16V9h1.5v7zM13.25 16V9h1.5v7z" clip-rule="evenodd"/>',user:'<path fill="currentColor" fill-rule="evenodd" d="M8.652 3.687C9.52 2.708 10.833 2.25 12 2.25c1.198 0 2.38.478 3.313 1.402.979.868 1.437 2.181 1.437 3.348 0 1.198-.477 2.38-1.402 3.313-.868.979-2.181 1.437-3.348 1.437-1.198 0-2.38-.477-3.313-1.402C7.715 9.488 7.25 8.277 7.25 7c0-1.198.478-2.38 1.402-3.313M12 3.75c-.826 0-1.703.336-2.236.944l-.016.019-.018.017c-.664.664-.98 1.475-.98 2.27 0 .915.329 1.697.944 2.236l.019.016.017.018c.664.664 1.475.98 2.27.98.826 0 1.703-.336 2.236-.944l.016-.019.018-.017c.664-.664.98-1.475.98-2.27 0-.826-.336-1.703-.944-2.236l-.019-.016-.017-.018c-.664-.664-1.475-.98-2.27-.98M8 15.75c-.795 0-1.606.317-2.27.98l-.017.018-.02.016c-.614.539-.943 1.321-.943 2.236v3h-1.5v-3c0-1.277.465-2.487 1.437-3.348.934-.925 2.115-1.402 3.313-1.402h8c1.277 0 2.487.465 3.348 1.437.925.934 1.402 2.115 1.402 3.313v3h-1.5v-3c0-.795-.317-1.606-.98-2.27l-.018-.017-.016-.02c-.539-.614-1.321-.943-2.236-.943z" clip-rule="evenodd"/>',"warning-filled":'<path fill="currentColor" fill-rule="evenodd" d="M10.34 3.78a1.9 1.9 0 0 1 3.32 0l8.06 14.5A1.9 1.9 0 0 1 20.06 21H3.94a1.9 1.9 0 0 1-1.66-2.72zm.91 5.47h1.5v5.5h-1.5zm0 7h1.5v1.5h-1.5z" clip-rule="evenodd"/>'};function isDbIconName(t){return Object.prototype.hasOwnProperty.call(e,t)}function getDbComponentIconSize(e){return"s"===e?12:"l"===e?20:16}function createDbIcon(t,s=16){const i=e[t]??e.sparkle,n=document.createElement("template");return n.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" width="${s}" height="${s}" aria-hidden="true" focusable="false" data-designbase-icon="${t}">${i}</svg>`,n.content.firstElementChild}class DbAccordion extends HTMLElement{constructor(){super(...arguments),this.expanded=new Set,this.isRendering=!1,this.suppressExpandedAttrCallback=!1}static get observedAttributes(){return["items","variant","size","allow-multiple","expand-mode","expanded-items","default-item-type"]}get items(){try{const e=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}get allowMultiple(){return this.hasAttribute("allow-multiple")}set allowMultiple(e){this.toggleAttribute("allow-multiple",e)}get expandedItems(){const e=(this.getAttribute("expanded-items")||"").trim();if(!e)return[];if("all"===e)return this.items.map((e,t)=>this.resolveItemKey(e,t));try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(e=>String(e).trim()).filter(Boolean)}catch{}return e.split(",").map(e=>e.trim()).filter(Boolean)}set expandedItems(e){Array.isArray(e)?this.setAttribute("expanded-items",e.join(",")):this.setAttribute("expanded-items",e)}connectedCallback(){this.syncExpandedFromAttributes(),this.render(),this.childObserver=new MutationObserver(e=>{this.isRendering||e.some(e=>Array.from(e.addedNodes).some(e=>e instanceof HTMLElement&&e.hasAttribute("slot")))&&this.render()}),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){this.childObserver?.disconnect()}attributeChangedCallback(e){if(this.isConnected){if("expanded-items"===e){if(this.suppressExpandedAttrCallback)return;return this.syncExpandedFromAttributes(),void this.syncExpandedState()}return"expand-mode"===e||"allow-multiple"===e?(this.syncExpandedFromAttributes(),void this.syncExpandedState()):"items"===e?(this.syncExpandedFromAttributes(),void this.render()):void this.render()}}resolveItemKey(e,t){return e.id??String(t)}getExpandMode(){const e=this.getAttribute("expand-mode");return"single"===e||"multiple"===e||"all"===e?e:(this.hasAttribute("allow-multiple"),"multiple")}syncExpandedFromAttributes(){const e=this.items.map((e,t)=>this.resolveItemKey(e,t)),t=this.expandedItems,s=this.getExpandMode();t.length>0?this.expanded=new Set(t.filter(t=>e.includes(t))):this.expanded="all"!==s?new Set:new Set(e)}iconSize(e){return"s"===e?16:"l"===e?24:20}collectPanelContent(){const e=new Map,register=(t,s)=>{if(!(t instanceof HTMLElement)||"SLOT"===t.tagName)return;e.has(s)||e.set(s,[]);const i=e.get(s);i.includes(t)||i.push(t)};return Array.from(this.children).forEach(e=>{const t=e.getAttribute("slot")?.match(/^content-(\d+)$/);t&®ister(e,Number(t[1]))}),this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach((e,t)=>{const s=e.querySelector(":scope > .designbase-wc-accordion__content > .designbase-wc-accordion__content-inner");s&&Array.from(s.children).forEach(e=>register(e,t))}),e}isItemExpanded(e,t){return this.expanded.has(this.resolveItemKey(e,t))}syncExpandedState(){const e=this.items;this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach((t,s)=>{const i=e[s];if(!i)return;const n=this.isItemExpanded(i,s);t.classList.toggle("designbase-wc-accordion__item--expanded",n),t.classList.toggle("designbase-wc-accordion__item--disabled",Boolean(i.disabled));const a=t.querySelector(".designbase-wc-accordion__trigger"),r=t.querySelector(".designbase-wc-accordion__content");a?.setAttribute("aria-expanded",String(n)),r?.setAttribute("aria-hidden",String(!n))})}render(){this.isRendering=!0;const e=this.collectPanelContent(),t=this.getAttribute("variant")||"default",s=this.getAttribute("size")||"m",i=this.getExpandMode(),n=this.getAttribute("default-item-type")||"none",a=this.items,r=this.iconSize(s);this.className=["designbase-wc-accordion",`designbase-wc-accordion--${t}`,`designbase-wc-accordion--${s}`,"multiple"===i&&"designbase-wc-accordion--multiple","single"===i&&"designbase-wc-accordion--single","all"===i&&"designbase-wc-accordion--all"].filter(Boolean).join(" "),this.setAttribute("role","region"),this.setAttribute("aria-label","아코디언"),this.querySelectorAll(":scope > .designbase-wc-accordion__item").forEach(e=>e.remove()),a.forEach((s,i)=>{const a=this.resolveItemKey(s,i),o=this.isItemExpanded(s,i),l=document.createElement("div");l.className=["designbase-wc-accordion__item",`designbase-wc-accordion__item--${t}`,o&&"designbase-wc-accordion__item--expanded",s.disabled&&"designbase-wc-accordion__item--disabled"].filter(Boolean).join(" "),l.dataset.itemKey=a;const d=document.createElement("button");d.type="button",d.className="designbase-wc-accordion__trigger",d.disabled=Boolean(s.disabled),d.setAttribute("aria-expanded",String(o)),d.setAttribute("aria-controls",`accordion-content-${a}`),d.addEventListener("click",()=>{s.disabled||this.toggle(a)});const h=s.itemType||n;if("number"===h){const e=document.createElement("div");e.className="designbase-wc-accordion__number",e.textContent=`${i+1}.`,d.append(e)}else if("question"===h){const e=document.createElement("div");e.className="designbase-wc-accordion__question",e.textContent="Q.",d.append(e)}else if("icon"===h&&s.icon){const e=document.createElement("div");e.className="designbase-wc-accordion__icon",e.append(createDbIcon(s.icon,r)),d.append(e)}const u=document.createElement("span");u.className="designbase-wc-accordion__title",u.textContent=s.title;const b=document.createElement("div");b.className="designbase-wc-accordion__chevron",b.append(createDbIcon("chevron-down",r)),d.append(u,b);const p=document.createElement("div");p.id=`accordion-content-${a}`,p.className="designbase-wc-accordion__content",p.setAttribute("aria-hidden",String(!o));const m=document.createElement("div");m.className="designbase-wc-accordion__content-inner";const g=e.get(i)||[];if(g.length>0)g.forEach(e=>{e.removeAttribute("slot"),m.append(e)});else if(s.content){const e=document.createElement("p");e.className="designbase-wc-accordion__content-text",e.textContent=s.content,m.append(e)}p.append(m),l.append(d,p),this.append(l)}),this.isRendering=!1}toggle(e){const t=this.getExpandMode();this.expanded.has(e)?this.expanded.delete(e):"single"===t?this.expanded=new Set([e]):this.expanded.add(e);const s=Array.from(this.expanded);this.syncExpandedState(),this.suppressExpandedAttrCallback=!0,this.expandedItems=s,this.suppressExpandedAttrCallback=!1,this.dispatchEvent(new CustomEvent("db-change",{detail:{expandedItems:s},bubbles:!0,composed:!0}))}}customElements.get("db-accordion")||customElements.define("db-accordion",DbAccordion);const t="designbase-wp-admin__shell",s="(max-width: 782px)";let i=0;function isElement(e){return e.nodeType===Node.ELEMENT_NODE}function isTag(e,t){return isElement(e)&&e.tagName.toLowerCase()===t}function isMeaningfulNode(e){return e.nodeType!==Node.TEXT_NODE||Boolean(e.textContent?.trim())}function parseJson(e,t){if(!e)return t;try{return JSON.parse(e)}catch{return t}}function stringify(e){try{return JSON.stringify(e??[])}catch{return"[]"}}class DbAdminShell extends HTMLElement{constructor(){super(...arguments),this.originalChildren=null,this.mediaQuery=null,this.mediaHandler=null,this.sidebarOpen=!1,this.toggleButton=null}static get observedAttributes(){return["title","brand","items","sections","sidebar-size","brand-size","sidebar-id","sidebar-aria-label","menu-label","close-label","content-size","content-padding","page-title","page-description","page-subtitle","page-variant","show-menu-button","default-sidebar-open"]}connectedCallback(){this.captureOriginalChildren(),this.render(),this.bindViewport()}disconnectedCallback(){this.mediaQuery&&this.mediaHandler&&(this.mediaQuery.removeEventListener?this.mediaQuery.removeEventListener("change",this.mediaHandler):this.mediaQuery.removeListener(this.mediaHandler)),this.mediaQuery=null,this.mediaHandler=null,this.toggleButton=null}attributeChangedCallback(){this.isConnected&&this.render()}captureOriginalChildren(){this.originalChildren||(this.originalChildren=Array.from(this.childNodes))}getOriginalElements(){return(this.originalChildren??[]).filter(isElement)}getBrandLabel(){return(this.getAttribute("brand")||this.getAttribute("title")||"").trim()}getSidebarItems(){return parseJson(this.getAttribute("items"),[])}getSidebarSections(){return parseJson(this.getAttribute("sections"),[])}resolveSidebarNav(){const e=this.getBrandLabel(),t=this.getSidebarItems(),s=this.getSidebarSections();return Array.isArray(s)&&0!==s.length?1!==s.length||s[0].title&&s[0].title!==e?{items:null,sections:s}:{items:s[0].items?.length?s[0].items:t,sections:null}:{items:t,sections:null}}createBrand(e){const t=this.getBrandLabel()||"관리자",s=document.createElement("div");return s.className="designbase-wp-admin__shell-brand",s.setAttribute("role","heading"),s.setAttribute("aria-level","2"),s.setAttribute("aria-label",t),s.dataset.dbwpShellBrand="",e.removeAttribute("slot"),s.append(e),s}createSidebar(e,t=!1){const s=e||document.createElement("db-sidebar"),i=this.getBrandLabel()||"관리자";if(s.setAttribute("size",this.getAttribute("sidebar-size")||"m"),s.setAttribute("collapsible","false"),s.setAttribute("full-height",""),s.setAttribute("aria-label",this.getAttribute("sidebar-aria-label")||`${i} 메뉴`),e)return s;i&&!t?(s.setAttribute("show-logo",""),s.setAttribute("logo-type","custom"),s.setAttribute("logo-text",i)):(s.setAttribute("show-logo","false"),s.removeAttribute("logo-type"),s.removeAttribute("logo-text"));const n=this.resolveSidebarNav();return n.sections?s.setAttribute("sections",stringify(n.sections)):(s.removeAttribute("sections"),s.setAttribute("items",stringify(n.items??[]))),s}createPageHeader(){const e=this.getAttribute("page-title");if(!e)return null;const t=document.createElement("db-page-header");t.setAttribute("title",e);const s=this.getAttribute("page-description"),i=this.getAttribute("page-subtitle"),n=this.getAttribute("page-variant");return s&&t.setAttribute("description",s),i&&t.setAttribute("subtitle",i),n&&t.setAttribute("variant",n),t}addHeaderToggle(e,t){if(!e||this.hasAttribute("show-menu-button")&&"false"===this.getAttribute("show-menu-button"))return;if(e.querySelector("[data-dbwp-shell-menu]"))return;let s=Array.from(e.children).find(e=>"leading"===e.getAttribute("slot"));s||(s=document.createElement("span"),s.setAttribute("slot","leading"),s.className="designbase-wp-admin__page-header-leading",e.append(s));const i=document.createElement("db-button");i.setAttribute("variant","tertiary"),i.setAttribute("size","m"),i.setAttribute("icon-only",""),i.setAttribute("start-icon","menu"),i.setAttribute("aria-controls",t),i.setAttribute("aria-label",this.getAttribute("menu-label")||"메뉴 열기"),i.setAttribute("aria-expanded","false"),i.dataset.dbwpShellMenu="",s.prepend(i),this.toggleButton=i,i.addEventListener("db-click",()=>this.setSidebarOpen(!this.sidebarOpen))}render(){this.captureOriginalChildren();const e=this.originalChildren??[],s=this.getOriginalElements(),n=s.find(e=>"sidebar"===e.getAttribute("slot")&&isTag(e,"db-sidebar")),a=s.find(e=>"brand"===e.getAttribute("slot")),r=s.find(e=>isTag(e,"db-page-header")),o=r||this.createPageHeader(),l=new Set([n,a,r].filter(Boolean)),d=e.filter(e=>!l.has(e)).filter(isMeaningfulNode);this.classList.add(t,`${t}--has-sidebar`),this.replaceChildren();const h=document.createElement("button");h.type="button",h.className=`${t}-backdrop`,h.setAttribute("aria-label",this.getAttribute("close-label")||"메뉴 닫기"),h.addEventListener("click",()=>this.setSidebarOpen(!1));const u=document.createElement("div");u.className=`${t}-sidebar`,u.setAttribute("aria-label",this.getAttribute("sidebar-aria-label")||this.getAttribute("title")||"관리자 메뉴");const b=this.getAttribute("sidebar-id")||(this.id?`${this.id}-sidebar`:"designbase-wp-admin-sidebar-"+ ++i);u.id=b,n&&n.removeAttribute("slot"),a&&u.append(this.createBrand(a)),u.append(this.createSidebar(n,Boolean(a)));const p=document.createElement("main");if(p.className=`${t}-main`,o&&(o.removeAttribute("slot"),p.append(o)),this.addHeaderToggle(o,b),d.length){const e=1===d.length&&isTag(d[0],"db-container")?d[0]:null,t=e||document.createElement("db-container");t.setAttribute("size",this.getAttribute("content-size")||"full"),t.setAttribute("padding",this.getAttribute("content-padding")||"l"),t.setAttribute("full-width",""),t.dataset.dbwpContentContainer="",e||t.append(...d),p.append(t)}this.append(h,u,p),this.setSidebarOpen(this.getInitialSidebarOpen())}getInitialSidebarOpen(){return this.hasAttribute("default-sidebar-open")?"false"!==this.getAttribute("default-sidebar-open"):!window.matchMedia?.(s).matches}setSidebarOpen(e){this.sidebarOpen=Boolean(e),this.classList.toggle("designbase-wp-admin__shell--sidebar-open",this.sidebarOpen),this.classList.toggle(`${t}--sidebar-collapsed`,!this.sidebarOpen);const s=this.querySelector(`.${t}-backdrop`);s&&(s.hidden=!this.sidebarOpen,s.setAttribute("aria-hidden",String(!this.sidebarOpen))),this.querySelector("db-sidebar")?.classList.toggle("designbase-wc-sidebar--mobile-open",this.sidebarOpen),this.toggleButton&&(this.toggleButton.setAttribute("start-icon",this.sidebarOpen?"close":"menu"),this.toggleButton.setAttribute("aria-expanded",String(this.sidebarOpen)),this.toggleButton.setAttribute("aria-label",this.sidebarOpen?this.getAttribute("close-label")||"메뉴 닫기":this.getAttribute("menu-label")||"메뉴 열기"))}bindViewport(){window.matchMedia&&(this.mediaQuery=window.matchMedia(s),this.mediaHandler=e=>this.setSidebarOpen(!e.matches),this.mediaQuery.addEventListener?this.mediaQuery.addEventListener("change",this.mediaHandler):this.mediaQuery.addListener(this.mediaHandler))}}customElements.get("db-admin-shell")||customElements.define("db-admin-shell",DbAdminShell);const n=["plasma","mesh-flow","fluid","radiant","ethereal"];function toLuminaSpeed(e){return Math.max(.1,e/3e3)}function toSpeedRate(e){return Math.max(.1,e/3e3)}function hexToRgb(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16)/255,parseInt(t[2],16)/255,parseInt(t[3],16)/255]:[0,0,0]}function padColors(e,t=5){return 0===e.length?["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"]:Array.from({length:t},(t,s)=>e[s%e.length])}const a=["#0d0221","#5b21b6","#db2777","#38bdf8","#e9d5ff"],r="data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E",o=[{id:"neon_dream",name:"Neon Dream",colors:["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"]},{id:"sunset_bliss",name:"Sunset Bliss",colors:["#FF9900","#FF00CC","#6600FF","#FF5500","#220055"]},{id:"deep_ocean",name:"Deep Ocean",colors:["#001133","#0044FF","#00DDFF","#00FFAA","#000066"]},{id:"forest_mist",name:"Forest Mist",colors:["#002200","#00FF44","#AAFF00","#006622","#CCFFCC"]},{id:"northern_lights",name:"Northern Lights",colors:["#000000","#00FF99","#AA00FF","#0044FF","#FFFFFF"]},{id:"monochrome_fog",name:"Monochrome Fog",colors:["#000000","#333333","#888888","#CCCCCC","#FFFFFF"]},{id:"cotton_candy",name:"Cotton Candy",colors:["#FFC0CB","#87CEFA","#E0FFFF","#DDA0DD","#FF69B4"]},{id:"cyber_glitch",name:"Cyber Glitch",colors:["#1A1A1D","#C3073F","#6F2232","#950740","#4E4E50"]},{id:"golden_hour",name:"Golden Hour",colors:["#FF4E50","#FC913A","#F9D423","#EDE574","#E1F5C4"]}];const l={graphite:{id:"graphite",colors:["#000000","#333333","#b3b3b3"],scale:1},abyss:{id:"abyss",colors:["#020617","#0f172a","#3b82f6"],scale:2.2},cherry:{id:"cherry",colors:["#1a0505","#4a0b1c","#e11d48"],scale:2.8},forest:{id:"forest",colors:["#021207","#064e3b","#10b981"],scale:2},sunset:{id:"sunset",colors:["#170500","#7c2d12","#f97316"],scale:3},amethyst:{id:"amethyst",colors:["#0f051a","#3b0764","#a855f7"],scale:2.4}},d=l.graphite.colors,h=Object.keys(l);function isGraphitePresetId(e){return Boolean(e&&e in l)}function getGraphitePreset(e){return l[e]}const u=["#ffffff","#f0f9ff","#e0f2fe"],b=["#ffb7c5","#ff91a4","#f8c8dc","#ffc0cb","#fda4af"],p=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#4caf50","#ffeb3b","#ffc107","#ff9800"];function createFallingParticle(e,t,s,i=!1){return{x:Math.random()*e,y:i?Math.random()*t:-20,size:Math.random()*(s.maxSize-s.minSize)+s.minSize,speedX:(Math.random()-.5)*s.wind,speedY:Math.random()*(s.maxSpeedY-s.minSpeedY)+s.minSpeedY,opacity:.5*Math.random()+.3,rotation:Math.random()*Math.PI*2,rotationSpeed:.05*(Math.random()-.5),color:s.colors[Math.floor(Math.random()*s.colors.length)]}}const m=["snow","flowers","confetti"];class CanvasAnimationController{constructor(e,t){this.raf=0,this.frameCount=0,this.mouse={x:-9999,y:-9999},this.particlesRef={current:[]},this.starsRef={current:[]},this.fallingRef={current:[]},this.tick=()=>{const e=this.canvas.getContext("2d");if(!e)return void(this.raf=requestAnimationFrame(this.tick));const t=window.devicePixelRatio||1,s=this.canvas.width/t,i=this.canvas.height/t,{type:n,colors:a,speed:r,particleCount:o,particleSize:l,starCount:d,starSize:h,clickable:u,wind:b,layerOpacity:p}=this.options;e.clearRect(0,0,s,i);const g=toSpeedRate(r),f=this.frameCount*g;switch(this.frameCount+=1,n){case"particles":((e,t,s,i,n)=>{const a=`${n.count}:${n.size}`;i.current.length===n.count&&i.spawnKey===a||(i.current=Array.from({length:n.count}).map(()=>({x:Math.random()*t,y:Math.random()*s,vx:1.5*(Math.random()-.5),vy:1.5*(Math.random()-.5),size:Math.random()*n.size+1,color:n.colors[Math.floor(Math.random()*n.colors.length)]})),i.spawnKey=a);const r=i.current,o=toSpeedRate(n.speed);r.forEach((i,a)=>{if(i.x+=i.vx*o,i.y+=i.vy*o,(i.x<0||i.x>t)&&(i.vx*=-1),(i.y<0||i.y>s)&&(i.vy*=-1),n.clickable){const e=n.mouse.x-i.x,t=n.mouse.y-i.y,s=Math.sqrt(e*e+t*t);if(s<150){const n=(150-s)/150;i.vx+=e/s*n*.5,i.vy+=t/s*n*.5}const a=3,r=Math.sqrt(i.vx*i.vx+i.vy*i.vy);r>a&&(i.vx=i.vx/r*a,i.vy=i.vy/r*a)}e.save(),e.globalAlpha=n.layerOpacity,e.beginPath(),e.arc(i.x,i.y,i.size,0,2*Math.PI),e.fillStyle=i.color,e.fill(),e.restore();for(let t=a+1;t<r.length;t++){const s=r[t],a=i.x-s.x,o=i.y-s.y,l=Math.sqrt(a*a+o*o);l<100&&(e.beginPath(),e.strokeStyle=i.color,e.globalAlpha=(1-l/100)*n.layerOpacity,e.lineWidth=.5,e.moveTo(i.x,i.y),e.lineTo(s.x,s.y),e.stroke(),e.globalAlpha=1)}})})(e,s,i,this.particlesRef,{count:o,colors:a,size:l,speed:r,mouse:this.mouse,clickable:u,layerOpacity:p});break;case"stars":((e,t,s,i,n)=>{const a=`${n.count}:${n.size}`;i.current.length===n.count&&i.spawnKey===a||(i.current=Array.from({length:n.count}).map(()=>({x:Math.random()*t,y:Math.random()*s,size:Math.random()*n.size,blinkSpeed:.05*Math.random()+.01,color:n.colors[Math.floor(Math.random()*n.colors.length)]})),i.spawnKey=a),i.current.forEach(t=>{t.y-=.05*n.speedRate,t.y<0&&(t.y=s);const i=(.5+.5*Math.sin(n.time*t.blinkSpeed))*n.layerOpacity;e.beginPath(),e.arc(t.x,t.y,t.size,0,2*Math.PI),e.fillStyle=t.color,e.globalAlpha=i,e.fill(),e.globalAlpha=1})})(e,s,i,this.starsRef,{count:d,colors:a,size:h,time:f,layerOpacity:p,speedRate:g});break;case"snow":case"flowers":case"confetti":(function isFallingType(e){return m.includes(e)})(n)&&((e,t,s,i,n,a)=>{const r=toSpeedRate(a.speed),o=Math.max(1,.5*a.size),l={minSize:o,maxSize:Math.max(o+.5,1.5*a.size),minSpeedY:.4*r,maxSpeedY:1.2*r,wind:a.wind*r,colors:a.colors},d=`${a.count}:${a.size}:${a.speed}:${a.wind}`;i.current.length===a.count&&i.spawnKey===d||(i.current=Array.from({length:a.count},()=>createFallingParticle(t,s,l,!0)),i.spawnKey=d),i.current.forEach(i=>{i.y+=i.speedY,i.x+=i.speedX+.5*Math.sin(i.y/50)*r,i.rotation+=i.rotationSpeed,i.y>s+20&&Object.assign(i,createFallingParticle(t,s,l)),i.x>t+20&&(i.x=-20),i.x<-20&&(i.x=t+20),e.save(),e.translate(i.x,i.y),e.rotate(i.rotation),e.fillStyle=i.color,e.globalAlpha=i.opacity*a.layerOpacity,function drawFallingParticleShape(e,t,s){"snow"===t?(e.beginPath(),e.arc(0,0,s,0,2*Math.PI),e.fill()):"flowers"===t?(e.beginPath(),e.moveTo(0,0),e.bezierCurveTo(s,-s,2*s,s,0,2*s),e.bezierCurveTo(2*-s,s,-s,-s,0,0),e.fill()):e.fillRect(-s/2,-s/2,s,s)}(e,n,i.size),e.restore()}),e.globalAlpha=1})(e,s,i,this.fallingRef,n,{count:o,colors:a,size:l,speed:r,wind:b,layerOpacity:p})}this.raf=requestAnimationFrame(this.tick)},this.container=e,this.options=t,this.canvas=document.createElement("canvas"),this.canvas.className="designbase-wc-animation-background__canvas",e.appendChild(this.canvas),this.onResize=()=>this.resize(),this.onMouseMove=e=>{if("particles"!==this.options.type)return;const t=this.container.getBoundingClientRect();this.mouse={x:e.clientX-t.left,y:e.clientY-t.top}},this.onMouseLeave=()=>{this.mouse={x:-9999,y:-9999}},e.addEventListener("mousemove",this.onMouseMove),e.addEventListener("mouseleave",this.onMouseLeave),window.addEventListener("resize",this.onResize),this.particlesRef.current=[],this.starsRef.current=[],this.fallingRef.current=[],this.frameCount=0,this.resize(),this.tick()}updateOptions(e){this.options={...this.options,...e}}destroy(){cancelAnimationFrame(this.raf),this.container.removeEventListener("mousemove",this.onMouseMove),this.container.removeEventListener("mouseleave",this.onMouseLeave),window.removeEventListener("resize",this.onResize),this.canvas.remove()}resize(){const e=window.devicePixelRatio||1,t=this.container.getBoundingClientRect();this.canvas.width=t.width*e,this.canvas.height=t.height*e,this.canvas.style.width=`${t.width}px`,this.canvas.style.height=`${t.height}px`;const s=this.canvas.getContext("2d");s&&s.setTransform(e,0,0,e,0,0)}}function loadShader$1(e,t,s){const i=e.createShader(t);return i?(e.shaderSource(i,s),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)?i:(e.deleteShader(i),null)):null}class ShaderAnimationController{constructor(e,t){this.raf=0,this.startTime=performance.now(),this.render=()=>{const e=this.gl,t=this.program,s=this.positionBuffer;if(!e||!t||!s)return;const{colors:i,speed:n,blur:a,noise:r,zoom:o,variant:l}=this.options,{width:d,height:h}=this.resizeCanvas();if(0===d||0===h)return void(this.raf=requestAnimationFrame(this.render));e.viewport(0,0,d,h),e.useProgram(t);const u=e.getAttribLocation(t,"aVertexPosition"),b=e.getUniformLocation(t,"uResolution"),p=e.getUniformLocation(t,"uTime"),m=e.getUniformLocation(t,"uColors"),g=e.getUniformLocation(t,"uSpeed"),f=e.getUniformLocation(t,"uSoftness"),v=e.getUniformLocation(t,"uNoiseStrength"),w=e.getUniformLocation(t,"uZoom");e.enableVertexAttribArray(u),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(u,2,e.FLOAT,!1,0,0),e.uniform2f(b,d,h);const A=padColors(i),y=toLuminaSpeed(n),E=function toLuminaSoftness(e){return Math.min(1,e/200)}(a),_=.6*y,C=function clampZoom(e){return Math.min(4,Math.max(.25,e))}(o),x=(performance.now()-this.startTime)/1e3;"mesh-flow"===l?(p&&e.uniform1f(p,x),g&&e.uniform1f(g,_),f&&e.uniform1f(f,E),w&&e.uniform1f(w,C)):(p&&e.uniform1f(p,x*y),f&&e.uniform1f(f,E),v&&e.uniform1f(v,r),w&&e.uniform1f(w,C));const S=new Float32Array(15);for(let e=0;e<5;e++){const t=hexToRgb(A[e]);S[3*e]=t[0],S[3*e+1]=t[1],S[3*e+2]=t[2]}m&&e.uniform3fv(m,S),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.raf=requestAnimationFrame(this.render)},this.container=e,this.options=t,this.canvas=document.createElement("canvas"),this.canvas.className="designbase-wc-animation-background__shader-canvas",e.appendChild(this.canvas),this.init()}updateOptions(e){this.options={...this.options,...e}}resizeCanvas(){const e=this.container.getBoundingClientRect(),t=window.devicePixelRatio||1;return this.canvas.width=Math.max(1,e.width*t),this.canvas.height=Math.max(1,e.height*t),this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`,{width:this.canvas.width,height:this.canvas.height}}init(){const e=this.canvas.getContext("webgl");if(!e)return;this.gl=e;const{variant:t}=this.options,s=function getLuminaFragmentShader(e){switch(e){case"mesh-flow":return"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uSpeed;\n uniform float uSoftness;\n uniform float uZoom;\n void main() {\n vec2 uv = gl_FragCoord.xy / uResolution.xy;\n float aspect = uResolution.x / uResolution.y;\n vec2 p = (uv - 0.5) / max(0.25, uZoom) + 0.5;\n p.x *= aspect;\n float t = uTime * uSpeed * 0.1;\n vec3 col = mix(uColors[0], uColors[4], uv.y * 0.6 + 0.2);\n for(int i = 1; i < 4; i++) {\n float fi = float(i);\n float offset = fi * 4.0;\n vec2 q = p;\n q.x += sin(q.y * 1.5 + t + offset) * 0.2;\n q.y += cos(q.x * 0.8 - t + offset) * 0.1;\n float waveCenterY = 0.5 + 0.3 * sin(q.x * 1.0 + t * 0.8 + offset);\n float thickness = 0.15 + 0.15 * sin(q.x * 2.5 + t * 1.2 + offset);\n float w = thickness * (1.0 + uSoftness * 3.0);\n float dist = abs(q.y - waveCenterY);\n float blurAmount = 0.1 + uSoftness * 0.4;\n float intensity = smoothstep(w + blurAmount, w - blurAmount, dist);\n intensity *= 0.7;\n vec3 bandColor = uColors[i];\n bandColor = mix(bandColor, uColors[i+1], sin(p.x + t)*0.2 + 0.2);\n col = mix(col, bandColor, intensity);\n }\n float noise = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453);\n col += (noise - 0.5) * 0.03;\n gl_FragColor = vec4(col, 1.0);\n }\n";case"radiant":return"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n uniform float uZoom;\n float random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n void main() {\n vec2 uv = gl_FragCoord.xy / uResolution.xy;\n float aspect = uResolution.x / uResolution.y;\n uv = (uv - 0.5) / max(0.25, uZoom) + 0.5;\n uv.x *= aspect;\n float t = uTime * 0.15;\n vec3 col = uColors[0];\n for(int i = 1; i < 5; i++) {\n float fi = float(i);\n vec2 pos = vec2(\n 0.5 * aspect + 0.4 * sin(t * (0.5 + fi * 0.2) + fi * 1.5),\n 0.5 + 0.4 * cos(t * (0.4 + fi * 0.15) + fi)\n );\n float d = length(uv - pos);\n float radius = 0.6 + uSoftness * 1.0;\n float intensity = smoothstep(radius, 0.0, d);\n col = mix(col, uColors[i], intensity * 0.7);\n }\n float grain = random(gl_FragCoord.xy + uTime);\n col += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(col, 1.0);\n }\n";case"ethereal":return"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n uniform float uZoom;\n float random (in vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233)))*43758.5453123);\n }\n float noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n vec2 u = f*f*(3.0-2.0*f);\n return mix( mix( random( i + vec2(0.0,0.0) ),\n random( i + vec2(1.0,0.0) ), u.x),\n mix( random( i + vec2(0.0,1.0) ),\n random( i + vec2(1.0,1.0) ), u.x), u.y);\n }\n #define OCTAVES 5\n float fbm (in vec2 st) {\n float value = 0.0;\n float amplitude = 0.5;\n for (int i = 0; i < OCTAVES; i++) {\n value += amplitude * noise(st);\n st *= 2.0;\n amplitude *= 0.5;\n }\n return value;\n }\n void main() {\n vec2 uv = gl_FragCoord.xy/uResolution.xy;\n float aspect = uResolution.x/uResolution.y;\n uv = (uv - 0.5) / max(0.25, uZoom) + 0.5;\n uv.x *= aspect;\n float t = uTime * 0.8;\n float scale = 5.0 - uSoftness * 3.0;\n vec2 st = uv * scale;\n vec2 q = vec2(0.);\n q.x = fbm( st + 0.12*t );\n q.y = fbm( st + vec2(1.0) + 0.10*t );\n vec2 r = vec2(0.);\n r.x = fbm( st + 1.0*q + vec2(1.7,9.2)+ 0.30*t );\n r.y = fbm( st + 1.0*q + vec2(8.3,2.8)+ 0.26*t );\n float f = fbm(st + r);\n vec3 color = mix(uColors[0], uColors[1], clamp((f*f)*4.0,0.0,1.0));\n color = mix(color, uColors[2], clamp(length(q),0.0,1.0));\n color = mix(color, uColors[3], clamp(length(r.x),0.0,1.0));\n color = mix(color, uColors[4], clamp(r.y*r.y, 0.0, 1.0));\n float grain = random(gl_FragCoord.xy + uTime);\n color += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(color,1.0);\n }\n";default:return"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform vec3 uColors[5];\n uniform float uNoiseStrength;\n uniform float uSoftness;\n uniform float uZoom;\n float random(vec2 st) {\n return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);\n }\n void main() {\n vec2 uv = (gl_FragCoord.xy - 0.5 * uResolution.xy) / min(uResolution.y, uResolution.x);\n float t = uTime * 0.2;\n float scale = mix(1.8, 0.45, uSoftness) / max(0.25, uZoom);\n vec2 p = uv * scale;\n for(float i = 1.0; i <= 4.0; i++){\n p.x += 0.6 / i * sin(i * 3.0 * p.y + t);\n p.y += 0.6 / i * cos(i * 3.0 * p.x + t);\n }\n float w1 = 0.5 + 0.5 * sin(p.x + t);\n float w2 = 0.5 + 0.5 * sin(p.y + t * 0.8);\n float w3 = 0.5 + 0.5 * sin(p.x + p.y);\n vec3 col = uColors[0];\n col = mix(col, uColors[1], smoothstep(0.1, 0.9, w1));\n col = mix(col, uColors[2], smoothstep(0.1, 0.9, w2));\n col = mix(col, uColors[3], smoothstep(0.1, 0.9, w3));\n float w4 = w1 * w2 * w3;\n col = mix(col, uColors[4], w4);\n float grain = random(gl_FragCoord.xy + uTime);\n col += (grain - 0.5) * uNoiseStrength;\n gl_FragColor = vec4(col, 1.0);\n }\n"}}(t),i=e.createProgram();if(!i)return;const n=loadShader$1(e,e.VERTEX_SHADER,"\n attribute vec4 aVertexPosition;\n void main() {\n gl_Position = aVertexPosition;\n }\n"),a=loadShader$1(e,e.FRAGMENT_SHADER,s);if(!n||!a)return;if(e.attachShader(i,n),e.attachShader(i,a),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))return;this.program=i,this.vertexShader=n,this.fragmentShader=a;const r=e.createBuffer();r&&(this.positionBuffer=r,e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),this.observer=new ResizeObserver(()=>this.resizeCanvas()),this.observer.observe(this.container),this.startTime=performance.now(),this.render())}destroy(){cancelAnimationFrame(this.raf),this.observer?.disconnect();const e=this.gl;e&&this.program&&(this.vertexShader&&e.deleteShader(this.vertexShader),this.fragmentShader&&e.deleteShader(this.fragmentShader),this.positionBuffer&&e.deleteBuffer(this.positionBuffer),e.deleteProgram(this.program)),this.canvas.remove()}}const g=.05;function loadShader(e,t,s){const i=e.createShader(t);return i?(e.shaderSource(i,s),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)?i:(e.deleteShader(i),null)):null}function lerp(e,t,s){return e+(t-e)*s}function lerpRgb(e,t,s){return[lerp(e[0],t[0],s),lerp(e[1],t[1],s),lerp(e[2],t[2],s)]}class GraphiteShaderController{constructor(e,t){this.raf=0,this.startTime=performance.now(),this.current={shaderSpeed:0,shaderIntensity:0,grain:0,scale:0,warp:0,color1:[0,0,0],color2:[0,0,0],color3:[0,0,0]},this.render=()=>{const e=this.gl,t=this.program,s=this.positionBuffer;if(!e||!t||!s)return;this.tickLerp();const{width:i,height:n}=this.resizeCanvas();if(0===i||0===n)return void(this.raf=requestAnimationFrame(this.render));e.viewport(0,0,i,n),e.useProgram(t);const a=e.getAttribLocation(t,"aVertexPosition"),r=e.getUniformLocation(t,"uResolution"),o=e.getUniformLocation(t,"uTime"),l=e.getUniformLocation(t,"uSpeed"),d=e.getUniformLocation(t,"uIntensity"),h=e.getUniformLocation(t,"uGrain"),u=e.getUniformLocation(t,"uScale"),b=e.getUniformLocation(t,"uWarp"),p=e.getUniformLocation(t,"uColor1"),m=e.getUniformLocation(t,"uColor2"),g=e.getUniformLocation(t,"uColor3");e.enableVertexAttribArray(a),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0);const f=(performance.now()-this.startTime)/1e3;r&&e.uniform2f(r,i,n),o&&e.uniform1f(o,f),l&&e.uniform1f(l,this.current.shaderSpeed),d&&e.uniform1f(d,this.current.shaderIntensity),h&&e.uniform1f(h,this.current.grain),u&&e.uniform1f(u,this.current.scale),b&&e.uniform1f(b,this.current.warp),p&&e.uniform3fv(p,this.current.color1),m&&e.uniform3fv(m,this.current.color2),g&&e.uniform3fv(g,this.current.color3),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.raf=requestAnimationFrame(this.render)},this.container=e,this.options=t,this.canvas=document.createElement("canvas"),this.canvas.className="designbase-wc-animation-background__shader-canvas",e.appendChild(this.canvas),this.syncCurrentImmediate(t),this.init()}updateOptions(e){this.options={...this.options,...e}}syncCurrentImmediate(e){const[t,s,i]=this.resolveColors(e.colors);this.current={shaderSpeed:e.shaderSpeed,shaderIntensity:e.shaderIntensity,grain:e.grain,scale:e.scale,warp:e.warp,color1:hexToRgb(t),color2:hexToRgb(s),color3:hexToRgb(i)}}resolveColors(e){return[e[0]??"#000000",e[1]??"#333333",e[2]??"#b3b3b3"]}resizeCanvas(){const e=this.container.getBoundingClientRect(),t=window.devicePixelRatio||1;return this.canvas.width=Math.max(1,e.width*t),this.canvas.height=Math.max(1,e.height*t),this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`,{width:this.canvas.width,height:this.canvas.height}}init(){const e=this.canvas.getContext("webgl");if(!e)return;this.gl=e;const t=e.createProgram();if(!t)return;const s=loadShader(e,e.VERTEX_SHADER,"\n attribute vec4 aVertexPosition;\n void main() {\n gl_Position = aVertexPosition;\n }\n"),i=loadShader(e,e.FRAGMENT_SHADER,"\n precision highp float;\n uniform vec2 uResolution;\n uniform float uTime;\n uniform float uSpeed;\n uniform float uIntensity;\n uniform float uGrain;\n uniform float uScale;\n uniform float uWarp;\n uniform vec3 uColor1;\n uniform vec3 uColor2;\n uniform vec3 uColor3;\n\n vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}\n vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}\n vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}\n\n float cnoise(vec3 P){\n vec3 Pi0 = floor(P);\n vec3 Pi1 = Pi0 + vec3(1.0);\n Pi0 = mod(Pi0, 289.0);\n Pi1 = mod(Pi1, 289.0);\n vec3 Pf0 = fract(P);\n vec3 Pf1 = Pf0 - vec3(1.0);\n vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);\n vec4 iy = vec4(Pi0.yy, Pi1.yy);\n vec4 iz0 = Pi0.zzzz;\n vec4 iz1 = Pi1.zzzz;\n\n vec4 ixy = permute(permute(ix) + iy);\n vec4 ixy0 = permute(ixy + iz0);\n vec4 ixy1 = permute(ixy + iz1);\n\n vec4 gx0 = ixy0 / 7.0;\n vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5;\n gx0 = fract(gx0);\n vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0);\n vec4 sz0 = step(gz0, vec4(0.0));\n gx0 -= sz0 * (step(0.0, gx0) - 0.5);\n gy0 -= sz0 * (step(0.0, gy0) - 0.5);\n\n vec4 gx1 = ixy1 / 7.0;\n vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5;\n gx1 = fract(gx1);\n vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1);\n vec4 sz1 = step(gz1, vec4(0.0));\n gx1 -= sz1 * (step(0.0, gx1) - 0.5);\n gy1 -= sz1 * (step(0.0, gy1) - 0.5);\n\n vec3 g000 = vec3(gx0.x,gy0.x,gz0.x);\n vec3 g100 = vec3(gx0.y,gy0.y,gz0.y);\n vec3 g010 = vec3(gx0.z,gy0.z,gz0.z);\n vec3 g110 = vec3(gx0.w,gy0.w,gz0.w);\n vec3 g001 = vec3(gx1.x,gy1.x,gz1.x);\n vec3 g101 = vec3(gx1.y,gy1.y,gz1.y);\n vec3 g011 = vec3(gx1.z,gy1.z,gz1.z);\n vec3 g111 = vec3(gx1.w,gy1.w,gz1.w);\n\n vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110)));\n g000 *= norm0.x;\n g010 *= norm0.y;\n g100 *= norm0.z;\n g110 *= norm0.w;\n vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111)));\n g001 *= norm1.x;\n g011 *= norm1.y;\n g101 *= norm1.z;\n g111 *= norm1.w;\n\n float n000 = dot(g000, Pf0);\n float n100 = dot(g100, vec3(Pf1.x, Pf0.yz));\n float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z));\n float n110 = dot(g110, vec3(Pf1.xy, Pf0.z));\n float n001 = dot(g001, vec3(Pf0.xy, Pf1.z));\n float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z));\n float n011 = dot(g011, vec3(Pf0.x, Pf1.yz));\n float n111 = dot(g111, Pf1);\n\n vec3 fade_xyz = fade(Pf0);\n vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z);\n vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y);\n float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x);\n return 2.2 * n_xyz;\n }\n\n void main() {\n vec2 p = gl_FragCoord.xy / uResolution.xy;\n float base = p.x * 0.5 + p.y * 0.5;\n\n float n = cnoise(vec3(p * uScale, uTime * uSpeed)) * 0.5 + 0.5;\n float n2 = cnoise(vec3(p * (uScale * 1.5) - (n * uWarp), uTime * (uSpeed * 1.2))) * 0.5 + 0.5;\n\n float mask = (base * 0.2 + n * 0.5 + n2 * 0.3) * uIntensity;\n\n vec3 color = mix(uColor1, uColor2, smoothstep(0.1, 0.6, mask));\n color = mix(color, uColor3, smoothstep(0.5, 0.9, mask));\n\n float grain = fract(sin(dot(p + fract(uTime), vec2(12.9898, 78.233))) * 43758.5453);\n color += (grain - 0.5) * uGrain;\n\n gl_FragColor = vec4(color, 1.0);\n }\n");if(!s||!i)return;if(e.attachShader(t,s),e.attachShader(t,i),e.linkProgram(t),!e.getProgramParameter(t,e.LINK_STATUS))return;this.program=t,this.vertexShader=s,this.fragmentShader=i;const n=e.createBuffer();n&&(this.positionBuffer=n,e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,1]),e.STATIC_DRAW),this.observer=new ResizeObserver(()=>this.resizeCanvas()),this.observer.observe(this.container),this.startTime=performance.now(),this.render())}tickLerp(){const{colors:e,shaderSpeed:t,shaderIntensity:s,grain:i,scale:n,warp:a}=this.options,[r,o,l]=this.resolveColors(e),d=hexToRgb(r),h=hexToRgb(o),u=hexToRgb(l);this.current.shaderSpeed=lerp(this.current.shaderSpeed,t,g),this.current.shaderIntensity=lerp(this.current.shaderIntensity,s,g),this.current.grain=lerp(this.current.grain,i,g),this.current.scale=lerp(this.current.scale,n,g),this.current.warp=lerp(this.current.warp,a,g),this.current.color1=lerpRgb(this.current.color1,d,g),this.current.color2=lerpRgb(this.current.color2,h,g),this.current.color3=lerpRgb(this.current.color3,u,g)}destroy(){cancelAnimationFrame(this.raf),this.observer?.disconnect();const e=this.gl;e&&this.program&&(this.vertexShader&&e.deleteShader(this.vertexShader),this.fragmentShader&&e.deleteShader(this.fragmentShader),this.positionBuffer&&e.deleteBuffer(this.positionBuffer),e.deleteProgram(this.program)),this.canvas.remove()}}const f="designbase-wc-animation-background",v=new Set(["particles","stars","snow","flowers","confetti","aurora","plasma","mesh-flow","fluid","radiant","ethereal","graphite","prism"]);function parseColors(e,t){if(!e)return t;try{const s=JSON.parse(e);return Array.isArray(s)&&s.length?s:t}catch{return e.split(",").map(e=>e.trim()).filter(Boolean)}}function resolveColors(e){const{type:t,preset:s,colors:i}=e;if("prism"===t)return i;if("graphite"===t)return s&&isGraphitePresetId(s)?[...getGraphitePreset(s).colors]:i.length>=3?i.slice(0,3):[...d];if(s&&!isGraphitePresetId(s))return function getLuminaPresetColors(e){const t=o.find(t=>t.id===e);return t?.colors??o[0].colors}(s);if("fluid"===t&&i.length<5)return a;if("snow"===t||"flowers"===t||"confetti"===t){const e=function getFallingParticleDefaults(e){switch(e){case"snow":default:return u;case"flowers":return b;case"confetti":return p}}(t);return 3===i.length&&"#667eea"===i[0]&&"#764ba2"===i[1]?e:i}return i}function createLuminaOverlays(e,t){const s=document.createDocumentFragment();if(e>0){const t=document.createElement("div");t.className=`${f}__lumina-noise`,t.style.backgroundImage=`url("${r}")`,t.style.opacity=String(e),s.appendChild(t)}if(t){const e=document.createElement("div");e.className=`${f}__lumina-vignette`,s.appendChild(e)}return s}function mountAnimationLayers(e,t){const s=resolveColors(t);let i={};if(t.disabled)return i;switch(t.type){case"particles":case"stars":case"snow":case"flowers":case"confetti":{const n=document.createElement("div");n.className=`${f}__canvas-layer`,e.appendChild(n);const a=new CanvasAnimationController(n,{type:t.type,colors:s,speed:t.speed,particleCount:t.particleCount,particleSize:t.particleSize,starCount:t.starCount,starSize:t.starSize,clickable:t.clickable,wind:t.wind,layerOpacity:t.opacity});i={destroy:()=>a.destroy(),update:e=>{const t=resolveColors(e);a.updateOptions({colors:t,speed:e.speed,particleCount:e.particleCount,particleSize:e.particleSize,starCount:e.starCount,starSize:e.starSize,clickable:e.clickable,wind:e.wind,layerOpacity:e.opacity})}};break}case"aurora":e.appendChild(function createMeshAuroraLayer(e,t,s,i,n){const a=document.createElement("div");a.className=`${f}__aurora-mesh`;const r="subtle"===i?.3:"medium"===i?.6:.8,o=function toAnimationDurationSec(e,t=3,s=.75){const i=3e3*t/Math.max(500,e);return Math.max(s,i)}(t,5,1.25),l=e.length>=3?e:["#4f46e5","#ec4899","#06b6d4","#8b5cf6"],d="dark"===n?"screen":"multiply",h=`blur(${s}px)`,u=`${f}__aurora-blob`,b=[{backgroundColor:l[0],top:"-10%",left:"-10%",animationDuration:`${o}s`,animationDelay:"0s"},{backgroundColor:l[1],top:"-10%",right:"-10%",animationDuration:1.2*o+"s",animationDelay:"2s"},{backgroundColor:l[2],bottom:"-20%",left:"20%",animationDuration:1.5*o+"s",animationDelay:"4s"}];l[3]&&b.push({backgroundColor:l[3],bottom:"-10%",right:"-10%",animationDuration:1.1*o+"s",animationDelay:"1s"}),b.forEach(e=>{const t=document.createElement("div");t.className=u,Object.assign(t.style,{filter:h,opacity:String(r),mixBlendMode:d,...e}),a.appendChild(t)});const p=document.createElement("div");return p.className=`${f}__aurora-noise`,p.style.opacity="dark"===n?"0.03":"0.05",p.style.backgroundImage="url(\"data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E\")",a.appendChild(p),a}(s,t.speed,t.blur,t.intensity,t.theme));break;case"plasma":e.appendChild(function createPlasmaLayer(e,t,s){const i=document.createElement("div");i.className=`${f}__plasma`;const n=Math.random().toString(36).slice(2,11),a=padColors(e),c=e=>a[e%a.length],r=60/toLuminaSpeed(t),o=document.createElement("style");o.textContent=`\n @keyframes designbase-wc-plasma-move-1-${n} {\n 0% { transform: translate(0, 0) rotate(0deg) scale(1); }\n 25% { transform: translate(10%, 10%) rotate(90deg) scale(1.2); }\n 50% { transform: translate(0, 20%) rotate(180deg) scale(1); }\n 75% { transform: translate(-10%, 10%) rotate(270deg) scale(0.9); }\n 100% { transform: translate(0, 0) rotate(360deg) scale(1); }\n }\n @keyframes designbase-wc-plasma-move-2-${n} {\n 0% { transform: translate(0, 0) rotate(0deg) scale(1.2); }\n 33% { transform: translate(-20%, 0) rotate(120deg) scale(1); }\n 66% { transform: translate(20%, -10%) rotate(240deg) scale(0.8); }\n 100% { transform: translate(0, 0) rotate(360deg) scale(1.2); }\n }\n @keyframes designbase-wc-plasma-move-3-${n} {\n 0% { transform: translate(0, 0) scale(0.8); }\n 50% { transform: translate(15%, -15%) scale(1.4); }\n 100% { transform: translate(0, 0) scale(0.8); }\n }\n @keyframes designbase-wc-plasma-rotate-${n} {\n 0% { transform: rotate(0deg) scale(1.5); }\n 50% { transform: rotate(180deg) scale(2.0); }\n 100% { transform: rotate(360deg) scale(1.5); }\n }`,i.appendChild(o);const l=document.createElement("div");return l.className=`${f}__plasma-base`,l.style.backgroundColor=c(0),i.appendChild(l),[{top:"-10%",left:"-10%",width:"70%",height:"70%",background:`radial-gradient(circle, ${c(1)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-move-1-${n} ${r}s infinite linear`},{bottom:"-20%",right:"-10%",width:"80%",height:"80%",background:`radial-gradient(circle, ${c(2)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-move-2-${n} ${r}s infinite linear`},{top:"20%",left:"20%",width:"60%",height:"60%",background:`radial-gradient(circle, ${c(3)} 0%, transparent 70%)`,animation:`designbase-wc-plasma-rotate-${n} ${r}s infinite linear`,extraClass:`${f}__plasma-blob--exclusion`},{top:"40%",right:"20%",width:"40%",height:"40%",background:c(4),animation:`designbase-wc-plasma-move-3-${n} ${r}s infinite ease-in-out`,extraClass:`${f}__plasma-blob--accent`,filter:`blur(${s}px)`,opacity:"0.6"}].forEach(e=>{const t=document.createElement("div");t.className=`${f}__plasma-blob${e.extraClass?` ${e.extraClass}`:""}`,Object.assign(t.style,{filter:e.filter||`blur(${s}px)`,opacity:e.opacity||"0.9",...e}),i.appendChild(t)}),i}(s,t.speed,t.blur)),e.appendChild(createLuminaOverlays(t.noise,t.showVignette));break;case"prism":e.appendChild(function createPrismLayer(e,t,s){const i=document.createElement("div");i.className=`${f}__prism`;const n=Math.random().toString(36).slice(2,11),a=e.length?`conic-gradient(from 0deg at 50% 50%, ${e.map((t,s)=>`${t} ${Math.round(360/e.length*s)}deg`).join(", ")}, ${e[0]} 360deg)`:"var(--db-prism-gradient)",r=60/toLuminaSpeed(t),o=Math.min(56,Math.max(14,.4*s)),l=document.createElement("style");l.textContent=`\n @keyframes designbase-wc-prism-drift-1-${n} {\n 0% { transform: rotate(0deg) translate(0, 0) scale(1); }\n 50% { transform: rotate(180deg) translate(6%, 4%) scale(1.12); }\n 100% { transform: rotate(360deg) translate(0, 0) scale(1); }\n }\n @keyframes designbase-wc-prism-drift-2-${n} {\n 0% { transform: rotate(360deg) translate(0, 0) scale(1.05); }\n 50% { transform: rotate(180deg) translate(-8%, 5%) scale(0.92); }\n 100% { transform: rotate(0deg) translate(0, 0) scale(1.05); }\n }\n @keyframes designbase-wc-prism-drift-3-${n} {\n 0% { transform: rotate(0deg) translate(0, 0) scale(1.1); }\n 50% { transform: rotate(-180deg) translate(4%, -6%) scale(1.28); }\n 100% { transform: rotate(-360deg) translate(0, 0) scale(1.1); }\n }`,i.appendChild(l);const d=document.createElement("div");d.className=`${f}__prism-base`,d.style.background="var(--db-prism-dome)",i.appendChild(d);const h=[{size:"95%",top:"-34%",left:"-14%",opacity:.4,blur:o,anim:`designbase-wc-prism-drift-1-${n} ${r}s linear infinite`},{size:"80%",top:"38%",left:"58%",opacity:.3,blur:1.35*o,anim:`designbase-wc-prism-drift-2-${n} ${1.6*r}s linear infinite`},{size:"110%",top:"18%",left:"20%",opacity:.2,blur:1.9*o,anim:`designbase-wc-prism-drift-3-${n} ${2.4*r}s linear infinite`}];for(const e of h){const t=document.createElement("div");t.className=`${f}__prism-disc`,t.style.width=e.size,t.style.top=e.top,t.style.left=e.left,t.style.background=a,t.style.filter=`blur(${Math.round(e.blur)}px)`,t.style.opacity=String(e.opacity),t.style.animation=e.anim,i.appendChild(t)}return i}(s,t.speed,t.blur,t.theme)),e.appendChild(createLuminaOverlays(t.noise,t.showVignette));break;case"mesh-flow":case"fluid":case"radiant":case"ethereal":{const n=document.createElement("div");n.className=`${f}__shader-layer`,e.appendChild(n);const a=new ShaderAnimationController(n,{variant:t.type,colors:s,speed:t.speed,blur:t.blur,noise:t.noise,zoom:t.zoom});e.appendChild(createLuminaOverlays(t.noise,t.showVignette)),i={destroy:()=>a.destroy(),update:e=>{const t=resolveColors(e);a.updateOptions({colors:t,speed:e.speed,blur:e.blur,noise:e.noise,zoom:e.zoom})}};break}case"graphite":{const n=document.createElement("div");n.className=`${f}__shader-layer`,e.appendChild(n);const a=new GraphiteShaderController(n,{colors:s,shaderSpeed:t.shaderSpeed,shaderIntensity:t.shaderIntensity,grain:t.noise,scale:t.zoom,warp:t.warp});i={destroy:()=>a.destroy(),update:e=>{const t=resolveColors(e);a.updateOptions({colors:t,shaderSpeed:e.shaderSpeed,shaderIntensity:e.shaderIntensity,grain:e.noise,scale:e.zoom,warp:e.warp})}};break}}return i}function applyContainerStyles(e,t){const s=function isLuminaType(e){return n.includes(e)}(t.type),i="graphite"===t.type,a=s||i?"#000000":"dark"===t.theme?"var(--db-surface-base, #0f172a)":"var(--db-surface-base, #ffffff)";e.style.position="relative",e.style.overflow="hidden",e.style.backgroundColor=a,e.style.border="none"}const w=3e3,A={speed:{attr:"speed",label:"Speed (×)",kind:"range",min:500,max:12e3,step:100,default:w,display:{min:.2,max:4,step:.1,fixed:1,fromAttr:e=>{const t=Math.min(12e3,Math.max(500,e));return Math.round(t/w*10)/10},toAttr:e=>{const t=Math.min(4,Math.max(.2,e));return Math.round(t*w)}}},blur:{attr:"blur",label:"Blur",kind:"range",min:0,max:200,step:2,default:80},opacity:{attr:"opacity",label:"Opacity",kind:"range",min:0,max:1,step:.05,default:1,fixed:2},noise:{attr:"noise",label:"Noise",kind:"range",min:0,max:.4,step:.01,default:.05,fixed:2},zoom:{attr:"zoom",label:"Zoom",kind:"range",min:.5,max:3,step:.1,default:1,fixed:1},particleCount:{attr:"particle-count",label:"Particle Count",kind:"range",min:10,max:250,step:5,default:50},particleCountParticles:{attr:"particle-count",label:"Particle Count",kind:"range",min:10,max:250,step:5,default:15},particleSize:{attr:"particle-size",label:"Particle Size",kind:"range",min:1,max:10,step:.5,default:2,fixed:1},starCount:{attr:"star-count",label:"Star Count",kind:"range",min:20,max:500,step:10,default:100},starSize:{attr:"star-size",label:"Star Size",kind:"range",min:.5,max:6,step:.5,default:1.5,fixed:1},wind:{attr:"wind",label:"Wind",kind:"range",min:0,max:3,step:.1,default:.5,fixed:1},direction:{attr:"direction",label:"Direction",kind:"select",options:["left","right","up","down","diagonal","radial"],default:"left"},intensity:{attr:"intensity",label:"Intensity",kind:"select",options:["subtle","medium","vivid"],default:"subtle"},theme:{attr:"theme",label:"Theme",kind:"select",options:["dark","light"],default:"dark"},preset:{attr:"preset",label:"Preset",kind:"select",options:["(none)","neon_dream","sunset_bliss","deep_ocean","forest_mist","northern_lights","monochrome_fog","cotton_candy","cyber_glitch","golden_hour"],default:"(none)"},showVignette:{attr:"show-vignette",label:"Vignette",kind:"toggle",default:!0},shaderSpeed:{attr:"shader-speed",label:"Speed",kind:"range",min:0,max:3,step:.01,default:.4,fixed:2},shaderIntensity:{attr:"shader-intensity",label:"Intensity",kind:"range",min:.1,max:3,step:.01,default:1.2,fixed:2},grain:{attr:"noise",label:"Grain",kind:"range",min:0,max:.5,step:.01,default:.1,fixed:2},scale:{attr:"zoom",label:"Scale",kind:"range",min:.5,max:5,step:.1,default:1,fixed:1},warp:{attr:"warp",label:"Warp",kind:"range",min:0,max:2,step:.05,default:1.4,fixed:2},graphiteTheme:{attr:"preset",label:"Theme",kind:"select",options:[...h],default:"graphite"}};function colors(e){return{attr:"colors",label:"Colors",kind:"colors",default:e}}const y={particles:[A.particleCountParticles,A.particleSize,A.speed,A.opacity,colors(["#60a5fa","#a78bfa","#f472b6"])],stars:[A.starCount,A.starSize,A.speed,A.opacity,colors(["#ffffff","#e0e7ff","#c7d2fe"])],snow:[A.particleCount,A.particleSize,A.speed,A.wind,colors(["#ffffff","#f0f9ff","#e0f2fe"])],flowers:[A.particleCount,A.particleSize,A.speed,A.wind,colors(["#ffb7c5","#ff91a4","#f8c8dc","#ffc0cb"])],confetti:[A.particleCount,A.particleSize,A.speed,A.wind,colors(["#f44336","#e91e63","#9c27b0","#2196f3","#4caf50","#ffeb3b"])],aurora:[A.intensity,A.blur,A.speed,A.theme,colors(["#4f46e5","#ec4899","#06b6d4","#8b5cf6"])],plasma:[A.speed,A.blur,A.noise,A.showVignette,A.preset,colors(["#7000FF","#FF00AA","#3300FF","#FFCC00","#00FFFF"])],"mesh-flow":[A.speed,A.blur,A.noise,A.zoom,colors(["#4f46e5","#ec4899","#06b6d4","#8b5cf6","#22d3ee"])],fluid:[A.speed,A.blur,A.noise,A.zoom,colors(["#001133","#0044FF","#00DDFF","#00FFAA","#000066"])],radiant:[A.speed,A.blur,A.noise,A.zoom,colors(["#FF4E50","#FC913A","#F9D423","#EDE574","#E1F5C4"])],ethereal:[A.speed,A.blur,A.noise,A.zoom,colors(["#7000FF","#FF00AA","#00FFFF","#FFFFFF","#3300FF"])],prism:[A.speed,A.blur,A.noise,A.showVignette,colors([])],graphite:[A.shaderSpeed,A.shaderIntensity,A.grain,A.scale,A.warp,A.graphiteTheme,colors(["#000000","#333333","#b3b3b3"])]};function getControlsForType(e){return y[e]??y.graphite}function writeControlAttribute(e,t,s){"colors"!==t.kind?"toggle"!==t.kind?"select"!==t.kind?e.setAttribute(t.attr,String(s)):"(none)"===s?e.removeAttribute(t.attr):e.setAttribute(t.attr,String(s)):e.setAttribute(t.attr,s?"true":"false"):e.setAttribute(t.attr,JSON.stringify(s))}const E=f,_=["particles","stars","snow","flowers","confetti","mesh-flow","fluid","radiant","ethereal","graphite"],C=["mesh-flow","fluid","radiant","ethereal"];class DbAnimationBackground extends HTMLElement{constructor(){super(...arguments),this.panelOpen=!1,this.controlInputs=new Map,this.syncingControls=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.panelOpen&&(e.preventDefault(),this.panelOpen=!1,this.syncPanelState())}}static get observedAttributes(){return["type","theme","intensity","blur","speed","direction","colors","width","height","border-radius","opacity","blend-mode","particle-count","particle-size","star-count","star-size","wind","clickable","disabled","noise","show-vignette","preset","zoom","show-controls","shader-speed","shader-intensity","warp"]}connectedCallback(){this.style.display="block",this.render(),document.addEventListener("keydown",this.handleDocumentKeyDown)}disconnectedCallback(){document.removeEventListener("keydown",this.handleDocumentKeyDown),this.teardownLayers(),this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0)}attributeChangedCallback(e,t,s){this.isConnected&&t!==s&&("show-controls"!==e?this.syncingControls||("type"===e&&this.getBool("show-controls",!1)&&this.rebuildControlInputs(),this.applyConfig(),this.getBool("show-controls",!1)&&this.syncControlInputs()):this.syncControlsVisibility())}getBool(e,t=!1){return this.hasAttribute(e)?"false"!==this.getAttribute(e):t}getSizeStyle(e){if(!e)return;const t=Number(e);return Number.isFinite(t)?`${t}px`:e}getConfig(){return function parseAnimationBackgroundConfig(e){const t=function normalizeAnimationType(e){return e&&"gradient"!==e&&v.has(e)?e:"graphite"}(e.getAttribute("type")),s="light"===e.getAttribute("theme")?"light":"dark",i=e.getAttribute("intensity")||"subtle",n=e.getAttribute("preset")||void 0,a=e.getAttribute("zoom"),r="graphite"===t;let o=Number(a||1);r&&null===a&&(o=getGraphitePreset(isGraphitePresetId(n)?n:"graphite").scale);return{type:t,theme:s,intensity:i,blur:Number(e.getAttribute("blur")||80),speed:Number(e.getAttribute("speed")||3e3),direction:e.getAttribute("direction")||"left",colors:parseColors(e.getAttribute("colors"),"prism"===t?[]:r?[...d]:["#667eea","#764ba2","#f093fb"]),opacity:Number(e.getAttribute("opacity")||1),particleCount:Number(e.getAttribute("particle-count")||("particles"===t?15:50)),particleSize:Number(e.getAttribute("particle-size")||2),starCount:Number(e.getAttribute("star-count")||100),starSize:Number(e.getAttribute("star-size")||1.5),clickable:e.hasAttribute("clickable")&&"false"!==e.getAttribute("clickable"),wind:Number(e.getAttribute("wind")||.5),noise:Number(e.getAttribute("noise")??(r?.1:.05)),showVignette:!e.hasAttribute("show-vignette")||"false"!==e.getAttribute("show-vignette"),preset:n||(r?"graphite":void 0),zoom:o,shaderSpeed:Number(e.getAttribute("shader-speed")||.4),shaderIntensity:Number(e.getAttribute("shader-intensity")||1.2),warp:Number(e.getAttribute("warp")||1.4),disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")}}(this)}teardownLayers(){this.layerHandle?.destroy?.(),this.layerHandle=void 0,this.mountedType=void 0,this.layersEl&&this.layersEl.replaceChildren()}remountLayers(e){this.layersEl&&(this.teardownLayers(),this.layerHandle=mountAnimationLayers(this.layersEl,e),this.mountedType=e.type)}canLiveUpdate(e){return this.mountedType===e.type&&_.includes(e.type)&&"function"==typeof this.layerHandle?.update}applyConfig(){const e=this.getConfig();this.className=[E,`${E}--${e.type}`,e.clickable&&!e.disabled&&`${E}--clickable`,e.disabled&&`${E}--disabled`,this.getBool("show-controls",!1)&&`${E}--show-controls`].filter(Boolean).join(" "),applyContainerStyles(this,e);const t=this.getSizeStyle(this.getAttribute("width")),s=this.getSizeStyle(this.getAttribute("height")),i=this.getSizeStyle(this.getAttribute("border-radius"));t&&(this.style.width=t),s&&(this.style.height=s),this.style.borderRadius=i||"0",this.style.border="none",this.style.opacity="",this.layersEl&&(this.layersEl.style.opacity=String(e.opacity));const n=this.getAttribute("blend-mode");if(n&&(this.style.mixBlendMode=n),e.disabled)return this.teardownLayers(),void this.syncClickable(e);this.canLiveUpdate(e)?(this.layerHandle?.update?.(e),this.layersEl&&C.includes(e.type)&&function syncLuminaOverlays(e,t,s){let i=e.querySelector(`.${f}__lumina-noise`),n=e.querySelector(`.${f}__lumina-vignette`);t>0?(i||(i=document.createElement("div"),i.className=`${f}__lumina-noise`,i.style.backgroundImage=`url("${r}")`,i.style.mixBlendMode="overlay",e.appendChild(i)),i.style.opacity=String(t)):i?.remove(),s?n||(n=document.createElement("div"),n.className=`${f}__lumina-vignette`,e.appendChild(n)):n?.remove()}(this.layersEl,e.noise,e.showVignette)):this.remountLayers(e),this.syncClickable(e)}syncClickable(e){this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0),e.clickable&&!e.disabled&&(this.clickHandler=()=>{this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.addEventListener("click",this.clickHandler))}render(){if(!this.layersEl){this.layersEl=document.createElement("div"),this.layersEl.className=`${E}__layers`,Object.assign(this.layersEl.style,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"0"}),this.contentEl=document.createElement("div"),this.contentEl.className=`${E}__content`,Object.assign(this.contentEl.style,{position:"relative",zIndex:"10",width:"100%",height:"100%"});const e=document.createElement("slot");this.contentEl.appendChild(e),this.append(this.layersEl,this.contentEl)}this.ensureControlsShell(),this.applyConfig(),this.syncControlsVisibility()}ensureControlsShell(){if(this.controlsRootEl)return;const e=document.createElement("div");e.className=`${E}__controls-root`,e.hidden=!0;const t=this.createIconButton("settings","컨트롤 열기",()=>{this.panelOpen=!this.panelOpen,this.syncPanelState()});t.setAttribute("variant","secondary"),t.className=`${E}__controls-gear`;const s=document.createElement("div");s.className=`${E}__controls-panel`,s.setAttribute("role","dialog"),s.setAttribute("aria-modal","false"),s.hidden=!0,s.addEventListener("click",e=>e.stopPropagation());const i=document.createElement("div");i.className=`${E}__controls-head`;const n=document.createElement("span");n.className=`${E}__controls-title`,n.append(createDbIcon("settings",14),document.createTextNode(" Controls"));const a=this.createIconButton("refresh","기본값으로 초기화",()=>{const e=this.getConfig(),t=getControlsForType(e.type);if(this.syncingControls=!0,function resetControlsToDefaults(e,t){t.forEach(t=>{const s=t.default;"select"!==t.kind||s!==t.default?writeControlAttribute(e,t,Array.isArray(s)?[...s]:s):"(none)"===s?e.removeAttribute(t.attr):writeControlAttribute(e,t,s)})}(this,t),"graphite"===e.type){const e=getGraphitePreset("graphite");this.setAttribute("zoom",String(e.scale)),this.setAttribute("colors",JSON.stringify(e.colors))}this.syncingControls=!1,this.applyConfig(),this.syncControlInputs()});a.className=`${E}__controls-icon-btn`,i.append(n,a),s.append(i),e.append(t,s),this.appendChild(e),this.controlsRootEl=e,this.panelEl=s}syncControlsVisibility(){if(!this.controlsRootEl)return;const e=this.getBool("show-controls",!1);this.controlsRootEl.hidden=!e,e?this.rebuildControlInputs():(this.panelOpen=!1,this.syncPanelState())}syncPanelState(){if(!this.controlsRootEl||!this.panelEl)return;const e=this.controlsRootEl.querySelector(`.${E}__controls-gear`);e&&(e.dataset.open=this.panelOpen?"true":"false",e.setAttribute("aria-expanded",this.panelOpen?"true":"false")),this.panelEl.hidden=!this.panelOpen}createIconButton(e,t,s){const i=document.createElement("db-button");return i.setAttribute("variant","tertiary"),i.setAttribute("size","s"),i.setAttribute("icon-only",""),i.setAttribute("start-icon",e),i.setAttribute("aria-label",t),i.addEventListener("click",e=>{e.stopPropagation(),s()}),i}rebuildControlInputs(){if(!this.panelEl)return;this.panelEl.querySelectorAll(`.${E}__controls-field`).forEach(e=>e.remove()),this.controlInputs.clear();const e=this.getConfig(),t=getControlsForType(e.type),s=this.panelEl.querySelector(`.${E}__controls-title`);s&&(s.lastChild?.remove(),s.append(document.createTextNode(` ${e.type}`))),t.forEach(e=>{const t=this.createControlField(e);this.panelEl?.appendChild(t)}),this.syncControlInputs()}createControlField(e){const t=document.createElement("div");if(t.className=`${E}__controls-field`,t.dataset.attr=e.attr,"range"===e.kind){const s=function getControlSliderBounds(e){return e.display?{min:e.display.min,max:e.display.max,step:e.display.step,fixed:e.display.fixed}:{min:e.min??0,max:e.max??100,step:e.step??1,fixed:e.fixed}}(e),i=document.createElement("db-range-slider");return i.className=`${E}__controls-range`,i.setAttribute("size","s"),i.setAttribute("full-width",""),i.setAttribute("show-label",""),i.setAttribute("label",e.label),i.setAttribute("show-value",""),i.setAttribute("value-position","top"),i.setAttribute("show-thumb-tooltip",""),i.setAttribute("min",String(s.min)),i.setAttribute("max",String(s.max)),i.setAttribute("step",String(s.step)),null!=s.fixed&&i.setAttribute("value-fixed",String(s.fixed)),i.addEventListener("db-change",t=>{const s=t.detail;null!=s.value&&this.commitControlValue(e,function controlSliderToAttr(e,t){return e.display?e.display.toAttr(t):t}(e,s.value))}),t.appendChild(i),this.controlInputs.set(e.attr,i),t}if("select"===e.kind){const s=document.createElement("div");s.className=`${E}__controls-label`,s.textContent=e.label;const i=e.options??[];if(i.length>4){const n=document.createElement("db-select");n.className=`${E}__controls-select`,n.setAttribute("size","s"),n.setAttribute("full-width",""),n.setAttribute("options",JSON.stringify(i.map(e=>({value:e,label:e})))),n.addEventListener("db-change",t=>{const s=t.detail;null!=s.value&&this.commitControlValue(e,s.value)}),t.append(s,n),this.controlInputs.set(e.attr,n)}else{const n=document.createElement("db-segment-control");n.className=`${E}__controls-seg`,n.setAttribute("size","s"),n.setAttribute("full-width",""),n.setAttribute("options",JSON.stringify(i.map(e=>({value:e,label:e})))),n.addEventListener("db-change",t=>{const s=t.detail;null!=s.value&&this.commitControlValue(e,s.value)}),t.append(s,n),this.controlInputs.set(e.attr,n)}return t}if("toggle"===e.kind){const s=document.createElement("div");s.className=`${E}__controls-toggle`;const i=document.createElement("span");i.textContent=e.label;const n=document.createElement("db-toggle");return n.setAttribute("size","s"),n.addEventListener("db-change",t=>{const s=t.detail;this.commitControlValue(e,Boolean(s.checked))}),s.append(i,n),t.appendChild(s),this.controlInputs.set(e.attr,n),t}const s=document.createElement("div");s.className=`${E}__controls-label`,s.textContent=e.label;const i=document.createElement("div");return i.className=`${E}__controls-colors`,t.append(s,i),this.controlInputs.set(e.attr,i),t}commitControlValue(e,t){if(this.syncingControls=!0,writeControlAttribute(this,e,t),"preset"===e.attr&&"graphite"===this.getConfig().type&&"string"==typeof t&&isGraphitePresetId(t)){const e=getGraphitePreset(t);this.setAttribute("zoom",String(e.scale)),this.setAttribute("colors",JSON.stringify(e.colors))}this.syncingControls=!1,this.applyConfig()}syncControlInputs(){getControlsForType(this.getConfig().type).forEach(e=>{const t=function readControlValue(e,t){const s=e.getAttribute(t.attr);if("colors"===t.kind){if(!s)return[...t.default];try{const e=JSON.parse(s);return Array.isArray(e)&&e.length?[...e]:[...t.default]}catch{const e=s.split(",").map(e=>e.trim()).filter(Boolean);return e.length?e:[...t.default]}}if("toggle"===t.kind)return null===s?t.default:"false"!==s;if("select"===t.kind)return s||t.default;if(null===s||""===s)return t.default;const i=Number(s);return Number.isFinite(i)?i:t.default}(this,e),s=this.controlInputs.get(e.attr);if(s)if("range"===e.kind&&function isRangeSlider(e){return"DB-RANGE-SLIDER"===e.tagName}(s)){const i=Number(t);s.setAttribute("value",String(function controlAttrToSlider(e,t){return e.display?e.display.fromAttr(t):t}(e,i)))}else"select"===e.kind?s.setAttribute("value",String(t)):"toggle"===e.kind?Boolean(t)?s.setAttribute("checked",""):s.removeAttribute("checked"):"colors"===e.kind&&this.renderColorInputs(s,e,t)})}renderColorInputs(e,t,s){const i=[...s];e.replaceChildren();const commitStructuralChange=s=>{this.commitControlValue(t,s),this.renderColorInputs(e,t,s)};if(i.forEach((s,n)=>{const a=document.createElement("div");a.className=`${E}__controls-color`;const r=document.createElement("db-color-picker");if(r.className=`${E}__controls-color-picker`,r.setAttribute("size","s"),r.setAttribute("full-width",""),r.setAttribute("show-alpha","false"),r.setAttribute("show-eyedropper","false"),r.setAttribute("value",s),r.addEventListener("db-change",e=>{const s=e.detail,a=s?.value;"string"==typeof a&&a&&(i[n]=a,this.commitControlValue(t,[...i]))}),a.appendChild(r),i.length>1){const e=this.createIconButton("trash","색상 제거",()=>{commitStructuralChange(i.filter((e,t)=>t!==n))});e.className=`${E}__controls-color-remove`,a.appendChild(e)}e.appendChild(a)}),i.length<8){const t=this.createIconButton("plus","색상 추가",()=>{commitStructuralChange([...i,i[i.length-1]??"#ffffff"])});t.className=`${E}__controls-color-add`,e.appendChild(t)}}}customElements.get("db-animation-background")||customElements.define("db-animation-background",DbAnimationBackground);const x=["s","m","l"],S=["xs","s","m","l","xl"];function coerceToContract(e,t,s){return e&&t.includes(e)?e:s}const k=["primary","secondary","tertiary","destructive","ghost","accent"],N={danger:"destructive"},L=x,z=["none","s","m","l","pill"],I=["solid","gradient","backlight","outline","prism"],M=x,D=["text","email","password","url","search","tel","number"],T=["primary","secondary","info","success","warning","danger"],B=x,F=["dot","number","text","outlined"],P=["xs","s","m","l","xl","2xl"],$=["default","primary","success","warning","danger","info"],O=["online","offline","away","busy"],H=["default","primary","success","warning","danger","info","neutral"],V=x,R=S,q=["circular","dots","bars","pulse","ripple"],j=x,U=x,J=x,K=["default","info","success","warning","danger"],W=["s","m","l","xl","full"],G=["default","pills"],Q=x,Y=["horizontal","vertical"],Z=x,X=["bottom","top"],ee=x,te=["vertical","horizontal"],se=["text","circular","rectangular","rounded"],ie=S,ne=["s","m","l","xl","full"],ae=["none","s","m","l","xl"],re=["left","right","top","bottom"],oe=["s","m","l","xl","full"],le=x,ce=["bottom-left","bottom-right","top-left","top-right"],de=["primary","secondary","tertiary","danger","ghost"],he=["default","minimal"],ue=["center","left"],be=x,pe=x,me=["default","dark","light"],ge=["default","wrapper"],fe=["left","right"],ve=["auto","adjacent","replace"],we=["nav-top","nav","nav-bottom"],Ae=x,ye=["default","striped","hoverable"],Ee=x,_e=["disabled","loading","icon-only","full-width"];class DbButton extends HTMLElement{constructor(){super(...arguments),this.handleClick=e=>{if(this.disabled||this.loading)return e.preventDefault(),void e.stopPropagation();this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.disabled||this.loading||this.classList.add("designbase-wc-button--pressed"),this.click())},this.handleKeyUp=e=>{"Enter"!==e.key&&" "!==e.key||this.classList.remove("designbase-wc-button--pressed")},this.handlePointerDown=()=>{this.disabled||this.loading||this.classList.add("designbase-wc-button--pressed")},this.handlePointerUp=()=>{this.classList.remove("designbase-wc-button--pressed")}}static get observedAttributes(){return["variant","size","radius","accent-style","type","loading-text","start-icon","end-icon",..._e]}get variant(){return function coerceWithAliases(e,t,s,i){return e&&!t.includes(e)&&e in s?s[e]:coerceToContract(e,t,i)}(this.getAttribute("variant"),k,N,"primary")}set variant(e){this.setAttribute("variant",e)}get size(){return coerceToContract(this.getAttribute("size"),L,"m")}set size(e){this.setAttribute("size",e)}get radius(){const e=this.getAttribute("radius");return e?coerceToContract(e,z,z[0]):""}set radius(e){e?this.setAttribute("radius",e):this.removeAttribute("radius")}get accentStyle(){return coerceToContract(this.getAttribute("accent-style"),I,"solid")}set accentStyle(e){e?this.setAttribute("accent-style",e):this.removeAttribute("accent-style")}get type(){return this.getAttribute("type")||"button"}set type(e){this.setAttribute("type",e)}get loadingText(){return this.getAttribute("loading-text")||""}set loadingText(e){e?this.setAttribute("loading-text",e):this.removeAttribute("loading-text")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}get loading(){return this.hasAttribute("loading")}set loading(e){this.toggleAttribute("loading",e)}get iconOnly(){return this.hasAttribute("icon-only")}set iconOnly(e){this.toggleAttribute("icon-only",e)}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(e){this.toggleAttribute("full-width",e)}connectedCallback(){this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("keyup",this.handleKeyUp),this.addEventListener("pointerdown",this.handlePointerDown),this.addEventListener("pointerup",this.handlePointerUp),this.addEventListener("pointerleave",this.handlePointerUp),this.addEventListener("pointercancel",this.handlePointerUp),this.syncAttributes()}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("keyup",this.handleKeyUp),this.removeEventListener("pointerdown",this.handlePointerDown),this.removeEventListener("pointerup",this.handlePointerUp),this.removeEventListener("pointerleave",this.handlePointerUp),this.removeEventListener("pointercancel",this.handlePointerUp)}attributeChangedCallback(){this.syncAttributes()}syncAttributes(){this.classList.add("designbase-wc-button"),this.setAttribute("role","button"),this.setAttribute("aria-disabled",String(this.disabled||this.loading)),this.loading?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this.disabled||this.loading?this.removeAttribute("tabindex"):this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.syncModifier("variant",this.variant),this.syncModifier("size",this.size),this.syncRadius(),this.syncAccentStyle(),this.syncAccentField(),this.syncAccentRing(),this.syncBooleanModifier("disabled"),this.syncBooleanModifier("icon-only"),this.syncBooleanModifier("full-width"),this.syncLoadingVisual(),this.loading?(this.querySelector(":scope > .designbase-wc-button__start-icon")?.remove(),this.querySelector(":scope > .designbase-wc-button__end-icon")?.remove()):this.syncIcons()}getIconSize(){return"s"===this.size?16:"l"===this.size?24:20}resolveIconName(e){if(e&&isDbIconName(e))return e}isManagedIconNode(e){return e instanceof HTMLElement&&(e.classList.contains("designbase-wc-button__start-icon")||e.classList.contains("designbase-wc-button__end-icon")||e.classList.contains("designbase-wc-button__spinner")||e.classList.contains("designbase-wc-button__accent-field")||e.classList.contains("designbase-wc-button__accent-glass")||e.classList.contains("designbase-wc-button__accent-orb")||e.classList.contains("designbase-wc-button__accent-ring"))}syncIcons(){const e=this.resolveIconName(this.getAttribute("start-icon")),t=this.resolveIconName(this.getAttribute("end-icon")),s=this.getIconSize();let i=this.querySelector(":scope > .designbase-wc-button__start-icon");if(e){if(!i){i=document.createElement("span"),i.className="designbase-wc-button__start-icon",i.setAttribute("aria-hidden","true");const e=Array.from(this.childNodes).find(e=>!this.isManagedIconNode(e));e?this.insertBefore(i,e):this.append(i)}i.replaceChildren(createDbIcon(e,s))}else i?.remove();let n=this.querySelector(":scope > .designbase-wc-button__end-icon");t?(n||(n=document.createElement("span"),n.className="designbase-wc-button__end-icon",n.setAttribute("aria-hidden","true")),n.replaceChildren(createDbIcon(t,s)),this.append(n)):n?.remove()}getDefaultRadiusClass(){if(z.includes(this.radius))return`designbase-wc-button--radius-${this.radius}`;const e=L.includes(this.size)?this.size:"m";return`designbase-wc-button--radius-${"s"===e||"l"===e?e:"m"}`}syncRadius(){z.forEach(e=>this.classList.remove(`designbase-wc-button--radius-${e}`)),this.classList.add(this.getDefaultRadiusClass())}syncAccentStyle(){if(I.forEach(e=>this.classList.remove(`designbase-wc-button--accent-${e}`)),"accent"!==this.variant)return;const e=this.accentStyle,t=I.includes(e)?e:"solid";this.classList.add(`designbase-wc-button--accent-${t}`)}syncAccentRing(){const e="accent"===this.variant&&"outline"===this.accentStyle,t=this.querySelector(":scope > .designbase-wc-button__accent-ring");if(!e)return void t?.remove();if(t)return;const s=document.createElement("span");s.className="designbase-wc-button__accent-ring",s.setAttribute("aria-hidden","true");const i=document.createElement("span");i.className="designbase-wc-button__accent-ring-spin",s.appendChild(i),this.insertBefore(s,this.firstChild)}syncAccentField(){const e="accent"===this.variant&&"gradient"===this.accentStyle,t=this.querySelector(":scope > .designbase-wc-button__accent-field"),s=this.querySelector(":scope > .designbase-wc-button__accent-glass");if(!e)return t?.remove(),void s?.remove();let i=t;if(!i){i=document.createElement("span"),i.className="designbase-wc-button__accent-field",i.setAttribute("aria-hidden","true");for(let e=1;e<=5;e+=1){const t=document.createElement("span");t.className=`designbase-wc-button__accent-orb designbase-wc-button__accent-orb--${e}`,i.appendChild(t)}this.insertBefore(i,this.firstChild)}if(!s){const e=document.createElement("span");e.className="designbase-wc-button__accent-glass",e.setAttribute("aria-hidden","true"),i.insertAdjacentElement("afterend",e)}}syncModifier(e,t){Array.from(this.classList).filter(t=>t.startsWith(`designbase-wc-button--${e}-`)).forEach(e=>this.classList.remove(e)),("variant"===e||"size"===e)&&(("variant"===e?k:L).forEach(e=>this.classList.remove(`designbase-wc-button--${e}`)),this.classList.add(`designbase-wc-button--${t}`))}syncBooleanModifier(e){const t=`designbase-wc-button--${e}`;this.classList.toggle(t,this.hasAttribute(e))}getSpinnerSize(){return L.includes(this.size)?this.size:"m"}syncLoadingVisual(){this.classList.toggle("designbase-wc-button--loading",this.loading);const e=this.querySelector(":scope > .designbase-wc-button__spinner");if(!this.loading)return void e?.remove();const t=`designbase-wc-button__spinner designbase-wc-spinner designbase-wc-spinner--circular designbase-wc-spinner--${this.getSpinnerSize()}`;if(e)return e.className=t,void e.setAttribute("aria-hidden","true");const s=document.createElement("span");s.className=t,s.setAttribute("aria-hidden","true"),s.innerHTML='<svg class="designbase-wc-spinner__circular" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle class="designbase-wc-spinner__circular-track" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"></circle><circle class="designbase-wc-spinner__circular-indicator" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"></circle></svg>',this.insertBefore(s,this.firstChild)}}customElements.get("db-button")||customElements.define("db-button",DbButton);const Ce="designbase-wc-alert";class DbAlert extends HTMLElement{static get observedAttributes(){return["title","message","variant","size","show-icon","closable","action-label","action-variant","action-buttons"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getIconName(e){return"success"===e?"circle-checked":"warning"===e?"warning-filled":"danger"===e?"error-filled":"info-filled"}parseActionButtons(){const e=this.getAttribute("action-buttons");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}render(){const e=this.getAttribute("variant")||"default",t=this.getAttribute("size")||"m",s="false"!==this.getAttribute("show-icon"),i="false"!==this.getAttribute("closable"),n=this.getAttribute("title")?.trim()||"",a=this.getAttribute("message")?.trim()||"",r=this.getAttribute("action-label"),o=this.getAttribute("action-variant")||"tertiary",l=this.parseActionButtons(),d=Boolean(a),h=Boolean(n),u=h&&!d||!h&&d,b=l.length>0?l:r?[{label:r,variant:o}]:[];this.className=[Ce,`${Ce}--${e}`,`${Ce}--${t}`,s&&`${Ce}--with-icon`,i&&`${Ce}--closable`,u&&`${Ce}--text-single`,b.length>0&&`${Ce}--has-actions`].filter(Boolean).join(" "),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),this.querySelector(`.${Ce}__content`)?.remove(),this.querySelector(`.${Ce}__actions`)?.remove(),Array.from(this.childNodes).forEach(e=>{e.nodeType===Node.TEXT_NODE&&e.remove()});const p=document.createElement("div");if(p.className=`${Ce}__content`,s){const s=document.createElement("div");s.className=`${Ce}__icon`,s.append(createDbIcon(this.getIconName(e),"s"===t?16:"l"===t?24:20)),p.append(s)}const m=document.createElement("div");if(m.className=`${Ce}__body`,h){const e=document.createElement("div");e.className=`${Ce}__title`,e.textContent=n,m.append(e)}if(d){const e=document.createElement("div");e.className=`${Ce}__message`,e.textContent=a,m.append(e)}if(p.append(m),b.length>0){const e=document.createElement("div");e.className=`${Ce}__actions`;const s=document.createElement("div");s.className=`${Ce}__action-buttons`,b.forEach((e,i)=>{const n=document.createElement("db-button");n.setAttribute("variant",e.variant||"tertiary"),n.setAttribute("size",e.size||t),n.textContent=e.label,e.disabled&&n.setAttribute("disabled",""),n.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0,detail:{index:i,label:e.label}}))}),s.append(n)}),e.append(s),p.append(e)}if(i){const e=document.createElement("button");e.type="button",e.className=`${Ce}__close`,e.setAttribute("aria-label","알림 닫기"),e.append(createDbIcon("close",20)),e.addEventListener("click",()=>{this.hidden=!0,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}),p.append(e)}this.replaceChildren(p)}}customElements.get("db-alert")||customElements.define("db-alert",DbAlert);const xe=["#E3F2FD","#F3E5F5","#E8F5E8","#FFF3E0","#FCE4EC","#E0F2F1","#FFF8E1","#F1F8E9","#E8EAF6","#FFEBEE"],Se=["#1976D2","#7B1FA2","#388E3C","#F57C00","#C2185B","#00796B","#F9A825","#689F38","#3F51B5","#D32F2F"];class DbAvatar extends HTMLElement{constructor(){super(...arguments),this.imageFailed=!1,this.imageLoaded=!1,this.handleClick=()=>{!this.hasAttribute("disabled")&&this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=e=>{this.hasAttribute("clickable")&&!this.hasAttribute("disabled")&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick()))}}static get observedAttributes(){return["src","alt","initials","size","variant","status","disabled","clickable","badge","badge-max-count","badge-variant","badge-type","badge-text"]}connectedCallback(){this.render(),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(e){"src"===e&&(this.imageFailed=!1,this.imageLoaded=!1),this.render()}render(){const e=P.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",t=$.includes(this.getAttribute("variant")||"default")&&this.getAttribute("variant")||"default",s=this.hasAttribute("disabled"),i=this.hasAttribute("clickable"),n=this.getAttribute("src"),a=this.getAttribute("initials")||"",r=Boolean(n&&!this.imageFailed),o=r&&!this.imageLoaded;if(this.className=["designbase-wc-avatar",`designbase-wc-avatar--${e}`,`designbase-wc-avatar--${t}`,i&&"designbase-wc-avatar--clickable",s&&"designbase-wc-avatar--disabled",o&&"designbase-wc-avatar--loading"].filter(Boolean).join(" "),i&&!s?(this.setAttribute("role","button"),this.tabIndex=0):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.toggleAttribute("aria-disabled",s),this.replaceChildren(),o){const e=document.createElement("div");e.className="designbase-wc-avatar__loading";const t=document.createElement("div");t.className="designbase-wc-avatar__skeleton",e.append(t),this.append(e)}if(r){const e=document.createElement("img");e.className="designbase-wc-avatar__image",e.src=n,e.alt=this.getAttribute("alt")||"아바타 이미지",e.loading="lazy",e.addEventListener("load",()=>{this.imageLoaded=!0,this.classList.remove("designbase-wc-avatar--loading"),this.querySelector(".designbase-wc-avatar__loading")?.remove()}),e.addEventListener("error",()=>{this.imageFailed=!0,this.imageLoaded=!1,this.render()}),this.append(e)}else if(a){const e=document.createElement("div");if(e.className="designbase-wc-avatar__initials","default"===t){const t=function initialsColor(e){let t=0;for(let s=0;s<e.length;s++)t=e.charCodeAt(s)+((t<<5)-t);const s=Math.abs(t)%xe.length;return{backgroundColor:xe[s],color:Se[s]}}(a);e.style.backgroundColor=t.backgroundColor,e.style.color=t.color}e.textContent=a.charAt(0).toUpperCase(),this.append(e)}else{const t=document.createElement("div");t.className="designbase-wc-avatar__icon",t.append(createDbIcon("user",function iconSize(e){return"xs"===e?12:"s"===e?16:"m"===e?20:"l"===e?24:"xl"===e?32:40}(e))),this.append(t)}const l=this.getAttribute("status")||"";if(O.includes(l)){const e=document.createElement("span");e.className=`designbase-wc-avatar__status designbase-wc-avatar__status--${l}`,this.append(e)}if(this.hasAttribute("badge")){const t=document.createElement("div");t.className="designbase-wc-avatar__badge";const s=document.createElement("db-badge");s.setAttribute("count",this.getAttribute("badge")||"0");const i=this.getAttribute("badge-type")||"number";s.setAttribute("type",i),this.hasAttribute("badge-max-count")&&s.setAttribute("max-count",this.getAttribute("badge-max-count")),s.setAttribute("variant",this.getAttribute("badge-variant")||"danger"),this.hasAttribute("badge-text")&&(s.textContent=this.getAttribute("badge-text"));const n="xl"===e||"2xl"===e?"m":"s";s.setAttribute("size",n),t.append(s),this.append(t)}}}customElements.get("db-avatar")||customElements.define("db-avatar",DbAvatar);const ke="designbase-wc-badge";class DbBadge extends HTMLElement{static get observedAttributes(){return["variant","size","type","count","max-count","disabled"]}get variant(){return this.getAttribute("variant")||"primary"}set variant(e){this.setAttribute("variant",e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}get type(){return this.getAttribute("type")||"text"}set type(e){this.setAttribute("type",e)}get count(){const e=this.getAttribute("count");return null===e?void 0:Number(e)}set count(e){void 0===e?this.removeAttribute("count"):this.setAttribute("count",String(e))}get maxCount(){return Number(this.getAttribute("max-count")||99)}set maxCount(e){this.setAttribute("max-count",String(e))}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}connectedCallback(){this.syncAttributes()}attributeChangedCallback(e,t,s){"count"!==e&&"max-count"!==e&&"type"!==e||this.syncContent(),this.syncAttributes()}syncAttributes(){this.classList.add(ke),this.setAttribute("aria-disabled",String(this.disabled)),this.syncEnum("variant",this.variant,T),this.syncEnum("size",this.size,B),this.syncEnum("type",this.type,F),this.classList.toggle(`${ke}--disabled`,this.disabled),this.syncContent()}syncContent(){"number"!==this.type||void 0===this.count?"dot"===this.type&&(this.textContent=""):this.textContent=this.count>this.maxCount?`${this.maxCount}+`:String(this.count)}syncEnum(e,t,s){s.forEach(e=>this.classList.remove(`${ke}--${e}`)),s.includes(t)?this.classList.add(`${ke}--${t}`):"type"===e&&this.classList.add(`${ke}--text`)}}customElements.get("db-badge")||customElements.define("db-badge",DbBadge);const Ne={primary:"primary",secondary:"secondary",outline:"tertiary",ghost:"ghost"},Le={s:"s",sm:"s",m:"m",md:"m",l:"l",lg:"l"};class DbBanner extends HTMLElement{static get observedAttributes(){return["title","description","icon","image","image-alt","actions","size","variant","background-image","href","target","clickable","closable","close-label"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}parseActions(){const e=this.getAttribute("actions");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}getIconSize(e){return"s"===e?16:"l"===e?24:20}getActionIconSize(e){return"s"===e?16:"l"===e?20:18}resolveIconName(e){if(e)return e in{close:1,"info-filled":1}?e:void 0}createActionControl(e,t,s,i){const n=this.resolveIconName(e.icon),a=Boolean(e.iconOnly&&n);if(e.href){const t=document.createElement("a");return t.className=`designbase-wc-button designbase-wc-button--${s} designbase-wc-button--${i}`,a&&t.classList.add("designbase-wc-button--icon-only"),t.href=e.href,t.setAttribute("aria-label",e.text),t.addEventListener("click",e=>e.stopPropagation()),a&&n?t.append(createDbIcon(n,this.getActionIconSize(i))):t.textContent=e.text,e.external&&(t.target="_blank",t.rel="noopener noreferrer"),t}const r=document.createElement("db-button");return r.setAttribute("variant",s),r.setAttribute("size",i),a?(r.setAttribute("icon-only",""),r.setAttribute("aria-label",e.text),n&&r.append(createDbIcon(n,this.getActionIconSize(i)))):r.textContent=e.text,(s=>{s.addEventListener("click",e=>e.stopPropagation()),s.addEventListener("db-click",s=>{s.stopPropagation(),this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0,detail:{index:t,action:e}}))})})(r),r}render(){const e=this.getAttribute("title")||"",t=this.getAttribute("description")||"",s=this.getAttribute("icon"),i=this.getAttribute("image"),n=this.getAttribute("image-alt")||e||"Banner image",a=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"primary",o=this.getAttribute("background-image"),l=this.parseActions(),d=this.getAttribute("href"),h=this.hasAttribute("clickable")||Boolean(d),u=this.hasAttribute("closable");if(this.className=["designbase-wc-banner",`designbase-wc-banner--${a}`,`designbase-wc-banner--${r}`,h&&"designbase-wc-banner--clickable"].filter(Boolean).join(" "),this.replaceChildren(),this.setupInteractivity(h,d),"image"===r&&o){const e=document.createElement("div");e.className="designbase-wc-banner__background",e.style.backgroundImage=`url(${o})`,e.style.backgroundSize="cover",e.style.backgroundPosition="center",e.style.backgroundRepeat="no-repeat",this.append(e);const t=document.createElement("div");t.className="designbase-wc-banner__overlay",this.append(t)}const b=document.createElement("div");if(b.className="designbase-wc-banner__container",s){const e=document.createElement("div");e.className="designbase-wc-banner__icon",e.append(createDbIcon(s,this.getIconSize(a))),b.append(e)}if(i){const e=document.createElement("div");e.className="designbase-wc-banner__image";const t=document.createElement("img");t.src=i,t.alt=n,e.append(t),b.append(e)}const p=document.createElement("div");if(p.className="designbase-wc-banner__content",e){const t=document.createElement("h3");t.className="designbase-wc-banner__title",t.textContent=e,p.append(t)}if(t){const e=document.createElement("p");e.className="designbase-wc-banner__description",e.textContent=t,p.append(e)}if(b.append(p),l.length>0){const e=document.createElement("div");e.className="designbase-wc-banner__actions",l.forEach((t,s)=>{const i=Ne[t.variant||"primary"]||"primary",n=Le[t.size||"sm"]||"s";e.append(this.createActionControl(t,s,i,n))}),b.append(e)}u&&b.append(this.createCloseButton(a)),this.append(b)}createCloseButton(e){const t=this.getAttribute("close-label")||"Close",s=document.createElement("button");return s.type="button",s.className="designbase-wc-banner__close",s.setAttribute("aria-label",t),s.append(createDbIcon("close","l"===e?20:16)),s.addEventListener("click",e=>{e.stopPropagation(),this.handleClose()}),s}handleClose(){const e=new CustomEvent("db-close",{bubbles:!0,composed:!0,cancelable:!0,detail:{}});this.dispatchEvent(e)&&this.remove()}setupInteractivity(e,t){if(this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0),this.keydownHandler&&(this.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=void 0),!e)return this.removeAttribute("role"),void this.removeAttribute("tabindex");this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const activate=()=>{const e=this.getAttribute("target")||"_self";this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0,detail:{href:t}})),t&&("_blank"===e?window.open(t,"_blank","noopener,noreferrer"):window.location.assign(t))};this.clickHandler=()=>activate(),this.keydownHandler=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),activate())},this.addEventListener("click",this.clickHandler),this.addEventListener("keydown",this.keydownHandler)}}customElements.get("db-banner")||customElements.define("db-banner",DbBanner);const ze={s:12,m:14,l:16};class DbBreadcrumbs extends HTMLElement{constructor(){super(...arguments),this.openMenuId=null,this.onDocumentMouseDown=null,this.onDocumentKeyDown=null}static get observedAttributes(){return["items","size","variant","breadcrumb-style","max-items","menu-dropdown","max-label-length"]}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}connectedCallback(){this.render()}disconnectedCallback(){this.removeGlobalListeners()}attributeChangedCallback(){this.isConnected&&(this.openMenuId=null,this.render())}get menuDropdown(){return this.hasAttribute("menu-dropdown")}get maxLabelLength(){const e=Number(this.getAttribute("max-label-length"));return Number.isFinite(e)&&e>0?e:12}get resolvedVariant(){return this.getAttribute("variant")||this.getAttribute("breadcrumb-style")||"default"}itemId(e,t){return e.id||`item-${t}`}menuItemId(e,t){return e.id||`menu-${t}`}visibleItems(){const e=this.items,t=Number(this.getAttribute("max-items")||0);if(!t||e.length<=t)return e;const s=e[0],i=e[e.length-1],n=e.slice(1,-1),a=t-2;if(a<=0)return[s,i];const r=Math.floor(n.length/2)-Math.floor(a/2);return[s,...n.slice(r,r+a),i]}shouldUseDropdown(e){return this.menuDropdown&&Boolean(e.menu?.length)}closeMenu(){this.openMenuId&&(this.openMenuId=null,this.removeGlobalListeners(),this.updateDropdownStates())}openMenu(e){this.openMenuId=e,this.addGlobalListeners(),this.updateDropdownStates()}toggleMenu(e){this.openMenuId===e?this.closeMenu():this.openMenu(e)}addGlobalListeners(){this.onDocumentMouseDown||(this.onDocumentMouseDown=e=>{this.contains(e.target)||this.closeMenu()},this.onDocumentKeyDown=e=>{"Escape"===e.key&&this.closeMenu()},document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("keydown",this.onDocumentKeyDown))}removeGlobalListeners(){this.onDocumentMouseDown&&(document.removeEventListener("mousedown",this.onDocumentMouseDown),this.onDocumentMouseDown=null),this.onDocumentKeyDown&&(document.removeEventListener("keydown",this.onDocumentKeyDown),this.onDocumentKeyDown=null)}updateDropdownStates(){this.querySelectorAll("[data-breadcrumb-dropdown]").forEach(e=>{const t=e.dataset.breadcrumbDropdown||"",s=this.openMenuId===t;e.classList.toggle("designbase-wc-breadcrumbs__dropdown--open",s);const i=e.querySelector(".designbase-wc-breadcrumbs__trigger");i&&i.setAttribute("aria-expanded",String(s))})}createLabel(e){const t=function formatBreadcrumbLabel(e,t){return!t||e.length<=t?{text:e,full:e,truncated:!1}:{text:`${e.slice(0,t)}...`,full:e,truncated:!0}}(e,this.maxLabelLength),s=document.createElement("span");return s.className="designbase-wc-breadcrumbs__label",s.textContent=t.text,t.truncated&&s.setAttribute("title",t.full),s}createMenuItem(e,t,s){const i=e.href&&!e.disabled?document.createElement("a"):document.createElement("button");if(i.className=["designbase-wc-breadcrumbs__menu-item",e.active&&"designbase-wc-breadcrumbs__menu-item--active",e.disabled&&"designbase-wc-breadcrumbs__menu-item--disabled"].filter(Boolean).join(" "),i.setAttribute("role","menuitem"),i instanceof HTMLButtonElement?(i.type="button",i.disabled=Boolean(e.disabled)):i.href=e.href||"#",e.icon){const t=document.createElement("span");t.className="designbase-wc-breadcrumbs__icon",t.append(createDbIcon(e.icon,16)),i.append(t)}return i.append(this.createLabel(e.label)),i.addEventListener("click",i=>{e.disabled?i.preventDefault():(this.closeMenu(),this.dispatchEvent(new CustomEvent("db-menu-click",{detail:{menuItem:{...e,id:this.menuItemId(e,t)},parentItem:s},bubbles:!0,composed:!0})))}),i}createDropdownItem(e,t,s,i){const n=this.itemId(e,t),a=this.openMenuId===n,r=document.createElement("div");r.className=["designbase-wc-breadcrumbs__dropdown",a&&"designbase-wc-breadcrumbs__dropdown--open"].filter(Boolean).join(" "),r.dataset.breadcrumbDropdown=n;const o=document.createElement("button");if(o.type="button",o.className=["designbase-wc-breadcrumbs__trigger",(s||e.active)&&"designbase-wc-breadcrumbs__trigger--active",e.disabled&&"designbase-wc-breadcrumbs__trigger--disabled"].filter(Boolean).join(" "),o.setAttribute("aria-haspopup","menu"),o.setAttribute("aria-expanded",String(a)),o.disabled=Boolean(e.disabled),e.icon){const t=document.createElement("span");t.className="designbase-wc-breadcrumbs__icon",t.append(createDbIcon(e.icon,16)),o.append(t)}o.append(this.createLabel(e.label));const l=document.createElement("span");l.className="designbase-wc-breadcrumbs__chevron",l.setAttribute("aria-hidden","true"),l.append(createDbIcon("chevron-down",i)),o.append(l),o.addEventListener("click",t=>{t.stopPropagation(),e.disabled||this.toggleMenu(n)}),r.append(o);const d=document.createElement("div");return d.className="designbase-wc-breadcrumbs__menu",d.setAttribute("role","menu"),e.menu?.forEach((t,s)=>{d.append(this.createMenuItem(t,s,e))}),r.append(d),r}createStandardItem(e,t,s){const i=!e.href||s||e.disabled?document.createElement("span"):document.createElement("a");if(i.className=i instanceof HTMLAnchorElement?["designbase-wc-breadcrumbs__link",e.active&&"designbase-wc-breadcrumbs__link--active",e.disabled&&"designbase-wc-breadcrumbs__link--disabled"].filter(Boolean).join(" "):["designbase-wc-breadcrumbs__text",s&&"designbase-wc-breadcrumbs__text--active",e.disabled&&"designbase-wc-breadcrumbs__text--disabled"].filter(Boolean).join(" "),e.icon){const t=document.createElement("span");t.className="designbase-wc-breadcrumbs__icon",t.append(createDbIcon(e.icon,16)),i.append(t)}return i.append(this.createLabel(e.label)),i instanceof HTMLAnchorElement&&(i.href=e.href||"#"),i.addEventListener("click",t=>{(e.disabled||e.active||s)&&t.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{detail:{item:e},bubbles:!0,composed:!0}))}),i}render(){const e=this.getAttribute("size")||"m",t=this.resolvedVariant,s=this.visibleItems(),i=s.length<this.items.length,n=ze[e]||14;this.className=["designbase-wc-breadcrumbs",`designbase-wc-breadcrumbs--${e}`,`designbase-wc-breadcrumbs--${t}`,i&&"designbase-wc-breadcrumbs--collapsed"].filter(Boolean).join(" "),this.setAttribute("role","navigation"),this.setAttribute("aria-label","브레드크럼 네비게이션"),this.replaceChildren();const a=document.createElement("ol");a.className="designbase-wc-breadcrumbs__list",s.forEach((e,t)=>{const i=t===s.length-1,r=document.createElement("li");if(r.className="designbase-wc-breadcrumbs__item",this.shouldUseDropdown(e)?r.append(this.createDropdownItem(e,t,i,n)):r.append(this.createStandardItem(e,t,i)),!i){const e=document.createElement("span");e.className="designbase-wc-breadcrumbs__separator",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("chevron-right",16)),r.append(e)}a.append(r)}),this.append(a)}}customElements.get("db-breadcrumbs")||customElements.define("db-breadcrumbs",DbBreadcrumbs);class CleanupBag{constructor(){this.items=[]}add(e){this.items.push(e)}listen(e,t,s,i){e.addEventListener(t,s,i),this.items.push(()=>e.removeEventListener(t,s,i))}timeout(e,t){const s=window.setTimeout(e,t);return this.items.push(()=>window.clearTimeout(s)),s}interval(e,t){const s=window.setInterval(e,t);return this.items.push(()=>window.clearInterval(s)),s}observe(e){return this.items.push(()=>e.disconnect()),e}run(){const e=this.items;this.items=[];for(const t of e)try{t()}catch{}}}class DbCheckbox extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.userInteracted=!1,this.cleanups=new CleanupBag,this.handleChange=()=>{if(!this.input)return;this.userInteracted=!0;const e=this.input.checked;this.toggleAttribute("checked",e),this.indeterminate&&(this.removeAttribute("indeterminate"),this.input.indeterminate=!1),this.syncVisual(),this.syncClasses(),this.syncValidity(),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:e,selected:e},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","indeterminate","size","disabled","readonly","required","name","value","has-label"]}get checked(){return this.input?.checked??(this.hasAttribute("checked")||this.hasAttribute("selected"))}set checked(e){this.toggleAttribute("checked",e),this.input&&(this.input.checked=e,this.syncVisual(),this.syncClasses())}get indeterminate(){return this.hasAttribute("indeterminate")}set indeterminate(e){this.toggleAttribute("indeterminate",e),this.input&&(this.input.indeterminate=e,this.syncVisual(),this.syncClasses())}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e),this.input&&(this.input.disabled=e),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(e){this.toggleAttribute("readonly",e),this.input&&(this.input.readOnly=e),this.syncClasses()}get required(){return this.hasAttribute("required")}set required(e){this.toggleAttribute("required",e),this.input&&(this.input.required=e)}get size(){return coerceToContract(this.getAttribute("size"),U,"m")}set size(e){this.setAttribute("size",e)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState();const e=this.input?.form;e&&this.cleanups.listen(e,"reset",()=>{window.setTimeout(()=>this.syncAfterReset(),0)})}disconnectedCallback(){this.cleanups.run()}syncAfterReset(){this.input&&(this.toggleAttribute("checked",this.input.checked),this.removeAttribute("selected"),this.syncVisual(),this.syncClasses())}attributeChangedCallback(e){if(this.built)return"checked"===e||"selected"===e?(this.input&&(this.input.checked=this.hasAttribute("checked")||this.hasAttribute("selected")),this.syncVisual(),void this.syncClasses()):void this.syncState()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}build(){for(this.root=document.createElement("label"),this.root.className="designbase-wc-checkbox",this.input=document.createElement("input"),this.input.type="checkbox",this.input.className="designbase-wc-checkbox__input",this.visual=document.createElement("span"),this.visual.className="designbase-wc-checkbox__visual",this.visual.setAttribute("aria-hidden","true"),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-checkbox__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(this.input,this.visual,this.labelEl),this.appendChild(this.root),this.input.addEventListener("change",this.handleChange),this.built=!0}syncValidity(){if(!this.input)return;const e=!this.input.checkValidity();this.input.setAttribute("aria-invalid",String(e)),this.classList.toggle("designbase-wc-checkbox--invalid",e)}syncState(){if(!this.root||!this.input||!this.visual)return;const e=this.hasAttribute("checked")||this.hasAttribute("selected")||!this.userInteracted&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected")),t=this.hasAttribute("indeterminate");this.input.checked=e,this.input.defaultChecked=this.hasAttribute("default-checked")||this.hasAttribute("default-selected")||this.hasAttribute("checked")||this.hasAttribute("selected"),this.input.indeterminate=t,this.input.disabled=this.disabled,this.input.readOnly=this.readOnly,this.input.required=this.required,this.input.name=this.getAttribute("name")||"",this.input.value=this.getAttribute("value")||"",this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncVisual(),this.syncClasses()}syncVisual(){if(this.visual&&this.input){if(this.visual.replaceChildren(),this.input.indeterminate){const e=document.createElement("span");return e.className="designbase-wc-checkbox__indeterminate-icon",e.appendChild(createDbIcon("minus",16)),void this.visual.appendChild(e)}if(this.input.checked){const e=document.createElement("span");e.className="designbase-wc-checkbox__check-icon",e.appendChild(createDbIcon("done",16)),this.visual.appendChild(e)}}}syncClasses(){if(!this.root||!this.input)return;const e=U.includes(this.size)?this.size:"m",t=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim());this.root.className=["designbase-wc-checkbox",`designbase-wc-checkbox--${e}`,this.input.checked&&"designbase-wc-checkbox--selected",this.input.indeterminate&&"designbase-wc-checkbox--indeterminate",this.disabled&&"designbase-wc-checkbox--disabled",this.readOnly&&"designbase-wc-checkbox--readonly",!t&&"designbase-wc-checkbox--no-label"].filter(Boolean).join(" ")}}customElements.get("db-checkbox")||customElements.define("db-checkbox",DbCheckbox);class DbChip extends HTMLElement{static get observedAttributes(){return["label","size","variant","deletable","disabled","selected","full-width","clickable","start-icon","end-icon"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}iconSize(e){return"s"===e?12:"l"===e?20:16}render(){const e=this.getAttribute("label")||this.textContent?.trim()||"",t=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default",i=this.hasAttribute("disabled"),n=this.hasAttribute("deletable"),a=this.hasAttribute("selected"),r=this.hasAttribute("full-width"),o=this.hasAttribute("clickable"),l=this.getAttribute("start-icon"),d=this.getAttribute("end-icon"),h=V.includes(t)?t:"m",u=H.includes(s)?s:"default",b=this.iconSize(h);if(this.className=["designbase-wc-chip",`designbase-wc-chip--${h}`,`designbase-wc-chip--${u}`,n&&"designbase-wc-chip--deletable",i&&"designbase-wc-chip--disabled",a&&"designbase-wc-chip--selected",o&&"designbase-wc-chip--clickable",r&&"designbase-wc-chip--full-width"].filter(Boolean).join(" "),this.replaceChildren(),o&&!i?(this.setAttribute("role","button"),this.tabIndex=0,this.setAttribute("aria-pressed",String(a))):(this.removeAttribute("role"),this.removeAttribute("tabindex"),this.removeAttribute("aria-pressed")),l&&isDbIconName(l)){const e=document.createElement("span");e.className="designbase-wc-chip__start-icon",e.append(createDbIcon(l,b)),this.append(e)}const p=document.createElement("span");if(p.className="designbase-wc-chip__label",p.textContent=e,this.append(p),d&&isDbIconName(d)&&!n){const e=document.createElement("span");e.className="designbase-wc-chip__end-icon",e.append(createDbIcon(d,b)),this.append(e)}if(n){const t=document.createElement("button");t.type="button",t.className="designbase-wc-chip__delete-button",t.disabled=i,t.setAttribute("aria-label",`${e} 삭제`),t.append(createDbIcon("close",b)),t.addEventListener("click",e=>{e.stopPropagation(),i||this.dispatchEvent(new CustomEvent("db-delete",{bubbles:!0,composed:!0}))}),this.append(t)}this.onclick=()=>{!i&&o&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.onkeydown=e=>{"Enter"!==e.key&&" "!==e.key||i||!o||(e.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})))}}}customElements.get("db-chip")||customElements.define("db-chip",DbChip);class DbContainer extends HTMLElement{static get observedAttributes(){return["size","padding","max-width","full-width"]}connectedCallback(){this.syncClasses()}attributeChangedCallback(){this.syncClasses()}syncClasses(){const e=this.getAttribute("size")||"l",t=this.getAttribute("padding")||"m",s=this.getAttribute("max-width");this.className=["designbase-wc-container",`designbase-wc-container--size-${ne.includes(e)?e:"l"}`,ae.includes(t)&&`designbase-wc-container--padding-${t}`,this.hasAttribute("full-width")&&"designbase-wc-container--full-width"].filter(Boolean).join(" "),this.hasAttribute("full-width")?this.style.maxWidth="100%":s?this.style.maxWidth=s.includes("px")||s.includes("%")?s:`${s}px`:this.style.removeProperty("max-width")}}customElements.get("db-container")||customElements.define("db-container",DbContainer);const Ie=["a[href]","area[href]","button","input","select","textarea","details > summary:first-of-type","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function isTabbable(e){return!(!(e instanceof HTMLElement)||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-hidden")||e.tabIndex<0||"function"==typeof e.closest&&e.closest("[inert]")||e.hidden||!e.offsetParent&&"fixed"!==getComputedStyle(e).position||"hidden"===getComputedStyle(e).visibility)}function getTabbables(e){return Array.from(e.querySelectorAll(Ie)).filter(isTabbable)}function createFocusTrap(e,t={}){let s=!1,i=null;const handleKeyDown=t=>{if("Tab"!==t.key||!s)return;const i=getTabbables(e);if(0===i.length)return t.preventDefault(),void e.focus();const n=i[0],a=i[i.length-1],r=document.activeElement;if(!r||!e.contains(r))return t.preventDefault(),void(t.shiftKey?a:n).focus();t.shiftKey&&r===n?(t.preventDefault(),a.focus()):t.shiftKey||r!==a||(t.preventDefault(),n.focus())},handleFocusIn=t=>{if(!s)return;const i=t.target;i&&e.contains(i)||(getTabbables(e)[0]||e).focus()};return{get active(){return s},activate(){s||(s=!0,i=t.returnFocus??document.activeElement,e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),document.addEventListener("keydown",handleKeyDown,!0),document.addEventListener("focusin",handleFocusIn,!0),((()=>{const{initialFocus:s}=t;if("function"==typeof s)return s();if(s)return s;const i=e.querySelector("[autofocus]");return i&&isTabbable(i)?i:getTabbables(e)[0]||null})()||e).focus())},deactivate(){s&&(s=!1,document.removeEventListener("keydown",handleKeyDown,!0),document.removeEventListener("focusin",handleFocusIn,!0),!1!==t.restoreFocus&&(i&&i.isConnected&&"function"==typeof i.focus&&i.focus(),i=null))}}}let Me=0,De="",Te="";function lockScroll(){if("undefined"==typeof document)return;if(Me+=1,Me>1)return;const{body:e}=document;De=e.style.overflow,Te=e.style.paddingRight;const t=function scrollbarWidth(){return window.innerWidth-document.documentElement.clientWidth}();if(t>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+t}px`}e.style.overflow="hidden"}function unlockScroll(){if("undefined"==typeof document)return;if(0===Me)return;if(Me-=1,Me>0)return;const{body:e}=document;e.style.overflow=De,e.style.paddingRight=Te,De="",Te=""}class DbDrawer extends HTMLElement{constructor(){super(...arguments),this.isMounted=!1,this.isActive=!1,this.scrollLocked=!1,this.keyHandler=null}static get observedAttributes(){return["open","title","position","size","show-close-button","close-on-backdrop-click","close-on-escape","animation-duration","show-overlay","overlay-closable","z-index","trap-focus","drawer-id"]}connectedCallback(){this.style.display="contents",this.render(),this.syncOpenState()}disconnectedCallback(){this.clearTimers(),this.detachEscape(),this.focusTrap?.deactivate(),this.focusTrap=void 0,this.root?.remove(),this.root=void 0,this.releaseScrollLock()}releaseScrollLock(){this.scrollLocked&&(this.scrollLocked=!1,unlockScroll())}attributeChangedCallback(e){this.isConnected&&("open"!==e?(this.render(),this.isMounted&&this.syncActiveClasses()):this.syncOpenState())}isOpenRequested(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}clearTimers(){null!=this.enterFrame&&(cancelAnimationFrame(this.enterFrame),this.enterFrame=void 0),this.exitTimer&&(clearTimeout(this.exitTimer),this.exitTimer=void 0)}attachEscape(){this.keyHandler||(this.keyHandler=e=>{"Escape"===e.key&&"false"!==this.getAttribute("close-on-escape")&&this.close()},document.addEventListener("keydown",this.keyHandler))}detachEscape(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}close(){this.setAttribute("open","false"),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}collectChildren(){return Array.from(this.children).filter(e=>!e.hasAttribute("data-wc-internal"))}syncOpenState(){const e=this.isOpenRequested(),t=Number(this.getAttribute("animation-duration")||300);if(this.clearTimers(),e)return this.render(),this.isMounted=!0,this.isActive=!1,this.syncActiveClasses(),this.root&&!this.root.isConnected&&document.body.append(this.root),this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=void 0,this.isActive=!0,this.syncActiveClasses(),"false"!==this.getAttribute("trap-focus")&&this.container&&(this.focusTrap=createFocusTrap(this.container),this.focusTrap.activate())})}),this.scrollLocked||(lockScroll(),this.scrollLocked=!0),void this.attachEscape();this.isActive=!1,this.syncActiveClasses(),this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,this.isMounted=!1,this.syncActiveClasses(),this.root?.remove(),this.releaseScrollLock(),this.detachEscape(),this.focusTrap?.deactivate(),this.focusTrap=void 0},t),this.detachEscape()}syncActiveClasses(){this.root&&(this.root.classList.toggle("designbase-wc-drawer--open",this.isActive),this.root.classList.toggle("designbase-wc-drawer--closing",this.isMounted&&!this.isActive),this.overlay?.classList.toggle("designbase-wc-drawer__overlay--open",this.isActive),this.container?.classList.toggle("designbase-wc-drawer__container--open",this.isActive))}render(){const e=re.includes(this.getAttribute("position")||"right")&&this.getAttribute("position")||"right",t=oe.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",s=this.getAttribute("title"),i="false"!==this.getAttribute("show-close-button"),n="false"!==this.getAttribute("show-overlay"),a=this.getAttribute("animation-duration")||"300",r=this.getAttribute("z-index")||"1000",o=this.getAttribute("drawer-id")||"drawer",l=this.collectChildren();if(this.root||(this.root=document.createElement("div"),this.root.setAttribute("data-wc-internal",""),this.overlay=document.createElement("div"),this.overlay.className="designbase-wc-drawer__overlay",this.overlay.setAttribute("aria-hidden","true"),this.overlay.addEventListener("click",e=>{if(e.target!==this.overlay)return;const t="false"!==this.getAttribute("overlay-closable"),s="false"!==this.getAttribute("close-on-backdrop-click");t&&s&&this.close()}),this.container=document.createElement("div"),this.container.className=`designbase-wc-drawer__container designbase-wc-drawer__container--${e}`,this.container.setAttribute("role","dialog"),this.container.setAttribute("aria-modal","true"),this.container.tabIndex=-1,this.container.addEventListener("click",e=>e.stopPropagation()),this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-drawer__content",this.container.append(this.contentEl)),this.root.className=["designbase-wc-drawer",`designbase-wc-drawer--${e}`,`designbase-wc-drawer--${t}`].join(" "),this.root.style.setProperty("--drawer-animation-duration",`${a}ms`),this.root.style.setProperty("--drawer-z-index",r),this.container.className=`designbase-wc-drawer__container designbase-wc-drawer__container--${e}`,this.container.id=o,s?this.container.setAttribute("aria-labelledby",`${o}-title`):this.container.removeAttribute("aria-labelledby"),this.contentEl.id=`${o}-content`,this.root.replaceChildren(),n&&this.overlay&&this.root.append(this.overlay),Boolean(s)||i){const e=document.createElement("div");if(e.className="designbase-wc-drawer__header",s){const t=document.createElement("h2");t.className="designbase-wc-drawer__title",t.id=`${o}-title`,t.textContent=s,e.append(t)}if(i){const t=document.createElement("db-button");t.className="designbase-wc-drawer__close-button",t.setAttribute("variant","ghost"),t.setAttribute("size","s"),t.setAttribute("icon-only",""),t.setAttribute("start-icon","close"),t.setAttribute("aria-label","닫기"),t.addEventListener("db-click",e=>{e.stopPropagation(),this.close()}),e.append(t)}this.container.replaceChildren(e,this.contentEl)}else this.container.replaceChildren(this.contentEl);this.contentEl.replaceChildren(...l),this.root.append(this.container),this.isMounted&&!this.root.isConnected&&document.body.append(this.root)}}customElements.get("db-drawer")||customElements.define("db-drawer",DbDrawer);class DbDropdown extends HTMLElement{constructor(){super(...arguments),this.focusedIndex=-1,this.onTriggerActivate=null,this.lastTriggerSignature="",this.handleTriggerKeyDown=e=>{if(("Enter"===e.key||" "===e.key||"ArrowDown"===e.key)&&!this.open)return e.preventDefault(),this.open=!0,requestAnimationFrame(()=>this.focusItem(0)),void this.render();"Escape"===e.key&&this.open&&(e.preventDefault(),this.open=!1,this.render())},this.handleDocumentKeyDown=e=>{if(!this.open)return;if("Escape"===e.key)return e.preventDefault(),this.open=!1,this.render(),void this.triggerWrap?.querySelector("[aria-haspopup]")?.focus();const t=this.enabledItems();if(!t.length)return;const s=t.findIndex(e=>this.parsedItems.indexOf(e)===this.focusedIndex);switch(e.key){case"ArrowDown":e.preventDefault(),this.focusItem(s<0?0:this.parsedItems.indexOf(t[(s+1)%t.length]));break;case"ArrowUp":e.preventDefault(),this.focusItem(s<0?0:this.parsedItems.indexOf(t[(s-1+t.length)%t.length]));break;case"Home":e.preventDefault(),this.focusItem(this.parsedItems.indexOf(t[0]));break;case"End":e.preventDefault(),this.focusItem(this.parsedItems.indexOf(t[t.length-1]));break;case"Enter":case" ":{e.preventDefault();const t=this.parsedItems[this.focusedIndex];!t||t.divider||t.disabled||this.selectItem(t);break}}},this.handleDocumentMouseDown=e=>{this.open&&(this.contains(e.target)||(this.open=!1,this.render()))}}static get observedAttributes(){return["options","items","placeholder","label","value","size","placement","full-width","disabled","open","trigger-variant","trigger-icon","icon-only"]}get parsedItems(){const e=this.getAttribute("items");if(e)try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return(this.getAttribute("options")||"").split(",").map(e=>e.trim()).filter(Boolean).map((e,t)=>({id:`option-${t}`,label:e}))}get options(){return this.parsedItems.map(e=>e.label||e.id)}set options(e){this.setAttribute("options",Array.isArray(e)?e.join(","):e)}get items(){return this.parsedItems}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}get value(){return this.getAttribute("value")||""}set value(e){e?this.setAttribute("value",e):this.removeAttribute("value")}get open(){return this.hasAttribute("open")}set open(e){const t=this.open;this.toggleAttribute("open",e),t!==e&&this.dispatchEvent(new CustomEvent("db-open",{detail:{open:e},bubbles:!0,composed:!0}))}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}get placement(){return this.getAttribute("placement")||"bottom-left"}set placement(e){this.setAttribute("placement",e)}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(e){e?this.setAttribute("placeholder",e):this.removeAttribute("placeholder")}get label(){return this.getAttribute("label")||""}set label(e){e?this.setAttribute("label",e):this.removeAttribute("label")}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(e){this.toggleAttribute("full-width",e)}connectedCallback(){requestAnimationFrame(()=>this.render()),document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown)}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.unbindTrigger()}attributeChangedCallback(e){this.isConnected&&("open"!==e||this.open||(this.focusedIndex=-1),this.render())}resolvedSize(){return le.includes(this.size)?this.size:"m"}resolvedPlacement(){return ce.includes(this.placement)?this.placement:"bottom-left"}menuItemIconSize(){const e=this.resolvedSize();return"s"===e?14:"l"===e?18:16}triggerLabel(){return this.label?this.label:this.placeholder?this.placeholder:this.value?this.value:"메뉴"}enabledItems(){return this.parsedItems.filter(e=>!e.disabled&&!e.divider)}collectTriggerChildren(){const isInternalNode=e=>e.hasAttribute("data-wc-internal")||e===this.triggerWrap||e===this.menu||e===this.defaultTrigger,e=Array.from(this.children).filter(e=>!isInternalNode(e));return e.length>0?e:Array.from(this.triggerWrap?.children||[]).filter(e=>!isInternalNode(e))}hasCustomTrigger(){return this.collectTriggerChildren().length>0}bindTrigger(){this.triggerWrap&&(this.unbindTrigger(),this.onTriggerActivate=e=>{this.disabled||(e.preventDefault(),e.stopPropagation(),this.toggleOpen())},this.triggerWrap.addEventListener("click",this.onTriggerActivate),this.triggerWrap.addEventListener("keydown",this.handleTriggerKeyDown))}unbindTrigger(){this.triggerWrap&&this.onTriggerActivate&&this.triggerWrap.removeEventListener("click",this.onTriggerActivate),this.triggerWrap&&this.triggerWrap.removeEventListener("keydown",this.handleTriggerKeyDown),this.onTriggerActivate=null}toggleOpen(){this.disabled||(this.open=!this.open,this.open&&requestAnimationFrame(()=>this.focusItem(0)),this.render())}triggerSignature(){return[this.resolvedSize(),this.getAttribute("trigger-variant")||"tertiary",this.hasAttribute("icon-only")?"1":"0",this.getAttribute("trigger-icon")||"",this.fullWidth?"1":"0"].join("|")}renderDefaultTrigger(){const e=this.resolvedSize(),t=this.getAttribute("trigger-variant")||"tertiary",s=de.includes(t)?t:"tertiary",i=this.hasAttribute("icon-only"),n=this.getAttribute("trigger-icon"),a=document.createElement("db-button");if(a.setAttribute("type","button"),a.setAttribute("variant",s),a.setAttribute("size",e),a.className="designbase-wc-dropdown__trigger",a.setAttribute("aria-haspopup","menu"),a.setAttribute("aria-label",this.triggerLabel()),this.fullWidth&&a.setAttribute("full-width",""),i)a.setAttribute("icon-only",""),a.setAttribute("start-icon",n&&isDbIconName(n)?n:"edit"),a.removeAttribute("end-icon");else{a.removeAttribute("icon-only"),n&&isDbIconName(n)?a.setAttribute("start-icon",n):a.removeAttribute("start-icon");const e=document.createElement("span");e.className="designbase-wc-dropdown__trigger-label",e.textContent=this.triggerLabel(),a.append(e),a.setAttribute("end-icon","chevron-down")}return a}syncDefaultTriggerState(e){e.setAttribute("aria-expanded",String(this.open)),e.setAttribute("aria-label",this.triggerLabel()),e.classList.toggle("designbase-wc-dropdown__trigger--open",this.open),this.disabled?e.setAttribute("disabled",""):e.removeAttribute("disabled");const t=e.querySelector(".designbase-wc-dropdown__trigger-label");t&&(t.textContent=this.triggerLabel())}ensureStructure(){this.triggerWrap||(this.triggerWrap=document.createElement("div"),this.triggerWrap.className="designbase-wc-dropdown__trigger-wrap",this.triggerWrap.setAttribute("data-wc-internal","")),this.menu||(this.menu=document.createElement("div"),this.menu.className="designbase-wc-dropdown__menu",this.menu.setAttribute("data-wc-internal",""),this.menu.setAttribute("role","menu"));const e=this.triggerWrap,t=this.menu;e&&t&&(this.contains(e)||this.append(e),e.contains(t)||e.append(t),Array.from(this.children).forEach(s=>{s===e||s.hasAttribute("data-wc-internal")||e.insertBefore(s,t)}))}renderTrigger(){const e=this.triggerWrap,t=this.menu;if(!e||!t)return;const s=this.collectTriggerChildren();s.length>0?(this.defaultTrigger?.remove(),this.defaultTrigger=void 0,Array.from(e.children).filter(e=>e!==t&&e!==this.defaultTrigger).forEach(e=>e.remove()),s.forEach(s=>{s.setAttribute("aria-haspopup","menu"),s.setAttribute("aria-expanded",String(this.open)),s.classList.toggle("designbase-wc-dropdown__trigger--open",this.open),e.insertBefore(s,t)})):(Array.from(e.children).filter(e=>e!==t&&e!==this.defaultTrigger).forEach(e=>e.remove()),this.defaultTrigger&&this.triggerSignature()===this.lastTriggerSignature||(this.defaultTrigger?.remove(),this.defaultTrigger=this.renderDefaultTrigger(),this.lastTriggerSignature=this.triggerSignature(),e.insertBefore(this.defaultTrigger,t)),this.defaultTrigger&&this.syncDefaultTriggerState(this.defaultTrigger)),this.bindTrigger()}renderMenu(){const e=this.resolvedPlacement();this.menu.className=`designbase-wc-dropdown__menu designbase-wc-dropdown__menu--${e}${this.open?" designbase-wc-dropdown__menu--open":""}`,this.menu.setAttribute("aria-hidden",String(!this.open)),this.menu.setAttribute("aria-label",this.triggerLabel()),this.menu.replaceChildren();const t=this.menuItemIconSize();this.parsedItems.forEach((e,s)=>{if(e.divider){const e=document.createElement("div");return e.className="designbase-wc-dropdown__divider",e.setAttribute("role","separator"),void this.menu?.append(e)}e.id||e.label||String(s);const i=e.label||e.id,n=Boolean(e.disabled||this.disabled),a=this.focusedIndex===s,r=document.createElement("button");if(r.type="button",r.className=["designbase-wc-dropdown__item",n&&"designbase-wc-dropdown__item--disabled",a&&"designbase-wc-dropdown__item--focused"].filter(Boolean).join(" "),r.setAttribute("role","menuitem"),r.disabled=n,r.tabIndex=a?0:-1,r.dataset.index=String(s),e.icon){const s=createDbIcon(e.icon,t);s.classList.add("designbase-wc-dropdown__item-icon"),r.append(s)}const o=document.createElement("span");o.className="designbase-wc-dropdown__item-label",o.textContent=i,r.append(o),r.addEventListener("click",t=>{t.stopPropagation(),this.selectItem(e)}),this.menu?.append(r)})}render(){const e=this.resolvedSize();this.className=["designbase-wc-dropdown",`designbase-wc-dropdown--${e}`,this.open&&"designbase-wc-dropdown--open",this.fullWidth&&"designbase-wc-dropdown--full-width",this.disabled&&"designbase-wc-dropdown--disabled"].filter(Boolean).join(" "),this.ensureStructure(),this.renderTrigger(),this.renderMenu()}selectItem(e){e.disabled||e.divider||(this.open=!1,this.focusedIndex=-1,this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e.label||e.id,id:e.id,item:e},bubbles:!0,composed:!0})),this.render(),this.triggerWrap?.querySelector("[aria-haspopup]")?.focus())}focusItem(e){const t=this.enabledItems();if(!t.length)return;const s=t[Math.max(0,Math.min(e,t.length-1))],i=this.parsedItems.indexOf(s);this.focusedIndex=i,Array.from(this.menu?.querySelectorAll(".designbase-wc-dropdown__item")||[]).forEach(e=>{const t=Number(e.dataset.index)===i;e.classList.toggle("designbase-wc-dropdown__item--focused",t),e.tabIndex=t?0:-1,t&&e.focus()})}}customElements.get("db-dropdown")||customElements.define("db-dropdown",DbDropdown);class DbEmptyState extends HTMLElement{static get observedAttributes(){return["variant","size","title","description","action-text","secondary-action-text","image","image-alt"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getIconName(e){return"no-results"===e?"search":"no-access"===e?"user":"error"===e?"cloud-close":"onboarding"===e?"bulb":"plus"}render(){const e=this.getAttribute("variant")||"no-data",t=this.getAttribute("size")||"m",s=this.getAttribute("title")||"",i=this.getAttribute("description")||"",n=this.getAttribute("action-text"),a=this.getAttribute("secondary-action-text"),r=this.getAttribute("image"),o=this.getAttribute("image-alt")||s,l="s"===t?24:"l"===t?48:32;this.className=`designbase-wc-empty-state designbase-wc-empty-state--${e} designbase-wc-empty-state--${t}`,this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.replaceChildren();const d=document.createElement("div");if(d.className="designbase-wc-empty-state__content",r){const e=document.createElement("div");e.className="designbase-wc-empty-state__image";const t=document.createElement("img");t.className="designbase-wc-empty-state__image-element",t.src=r,t.alt=o,e.append(t),d.append(e)}else{const t=document.createElement("div");t.className="designbase-wc-empty-state__icon",t.append(createDbIcon(this.getIconName(e),l)),d.append(t)}const h=document.createElement("h3");if(h.className="designbase-wc-empty-state__title",h.textContent=s,d.append(h),i){const e=document.createElement("p");e.className="designbase-wc-empty-state__description",e.textContent=i,d.append(e)}if(n||a){const e=document.createElement("div");if(e.className="designbase-wc-empty-state__actions",n){const s=document.createElement("db-button");s.setAttribute("variant","primary"),s.setAttribute("size",t),s.textContent=n,s.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0}))}),e.append(s)}if(a){const s=document.createElement("db-button");s.setAttribute("variant","tertiary"),s.setAttribute("size",t),s.textContent=a,s.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-secondary-action",{bubbles:!0,composed:!0}))}),e.append(s)}d.append(e)}this.append(d)}}customElements.get("db-empty-state")||customElements.define("db-empty-state",DbEmptyState);const Be={weak:"약함",fair:"보통",good:"강함","very-strong":"아주 강함"};function getPasswordScore(e){switch(e){case"weak":return 1;case"fair":return 2;case"good":return 3;case"very-strong":return 4;default:return 0}}function getStepDecimalPlaces(e){const t=String(e),s=t.indexOf(".");return-1===s?0:t.length-s-1}function readNumericAttribute(e,t){const s=e.getAttribute(t);if(null===s||""===s)return;const i=Number(s);return Number.isFinite(i)?i:void 0}function attachNumberScrub(e,t){let s=null;const endScrub=()=>{s=null,t.onScrubStateChange?.(!1),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},handlePointerDown=i=>{if(!t.isEnabled()||!t.isInteractive()||0!==i.button)return;const n=function parseScrubNumericValue(e){const t=e.trim();if(""===t)return 0;const s=Number(t);return Number.isFinite(s)?s:null}(t.getValue());null!==n&&(s={pointerId:i.pointerId,startX:i.clientX,startValue:n,moved:!1},e.setPointerCapture(i.pointerId))},handlePointerMove=e=>{if(!s||s.pointerId!==e.pointerId)return;const i=e.clientX-s.startX;!s.moved&&Math.abs(i)<3||(s.moved||(s.moved=!0,t.onScrubStateChange?.(!0),document.body.style.cursor="ew-resize",document.body.style.userSelect="none"),e.preventDefault(),((e,i)=>{if(!s)return;const n=e-s.startX,a=t.getStep(),r=function computeScrubValue(e,t,s,i,n,a,r){const o=i*(n.shiftKey?10:n.altKey?.1:1);let l=e+Math.round(t/s)*o;void 0!==a&&(l=Math.max(a,l)),void 0!==r&&(l=Math.min(r,l));const d=getStepDecimalPlaces(o);return l=d>0?Number(l.toFixed(d)):Math.round(l),l}(s.startValue,n,t.getSensitivity(),a,i,t.getMin(),t.getMax());t.onValueChange(function formatScrubValue(e,t){const s=getStepDecimalPlaces(t);return s>0?e.toFixed(s):String(Math.round(e))}(r,a))})(e.clientX,e))},handlePointerEnd=t=>{s&&s.pointerId===t.pointerId&&(s.moved&&t.preventDefault(),e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId),endScrub())};return e.addEventListener("pointerdown",handlePointerDown),e.addEventListener("pointermove",handlePointerMove),e.addEventListener("pointerup",handlePointerEnd),e.addEventListener("pointercancel",handlePointerEnd),()=>{endScrub(),e.removeEventListener("pointerdown",handlePointerDown),e.removeEventListener("pointermove",handlePointerMove),e.removeEventListener("pointerup",handlePointerEnd),e.removeEventListener("pointercancel",handlePointerEnd)}}let Fe=0;function dbUid(e="db"){Fe+=1;const t="undefined"!=typeof globalThis?globalThis.crypto:void 0;return`${e}-${t&&"function"==typeof t.randomUUID?t.randomUUID().slice(0,8):Math.floor(4294967295*Math.random()).toString(36)}-${Fe}`}const Pe={close:"닫기","modal.close":"모달 닫기","drawer.close":"드로어 닫기","dialog.close":"대화상자 닫기","toast.close":"알림 닫기",clear:"지우기",clearAll:"모든 값 지우기",loading:"로딩 중",required:"필수",optional:"선택",error:"오류",success:"성공",warning:"경고",info:"안내",previous:"이전",next:"다음","select.placeholder":"선택하세요","select.noResults":"결과 없음","tabs.label":"탭 목록","pagination.label":"페이지 번호","search.label":"검색","media.play":"재생","media.pause":"일시정지","media.mute":"음소거","media.unmute":"음소거 해제","media.settings":"설정","media.shuffle":"셔플","media.repeat":"반복","media.previous":"이전 트랙","media.next":"다음 트랙","media.fullscreen":"전체화면","carousel.previous":"이전 슬라이드","carousel.next":"다음 슬라이드","breadcrumbs.expand":"생략된 경로 펼치기","input.showPassword":"비밀번호 보기","input.hidePassword":"비밀번호 숨기기","input.clearSearch":"검색어 지우기","verify.done":"인증 완료","verify.phoneDone":"휴대폰 번호 인증이 완료되었습니다."};let $e={};function t$2(e,t){return e in $e?$e[e]:e in Pe?Pe[e]:t??e}function labelFrom(e,t,s){return e.getAttribute(t)||t$2(s)}const Oe=new Set(["arrow-bar-left","arrow-bar-right","caret-down-filled","chevron-down","chevron-left","chevron-right","circle-checked","close","error-filled","edit","hide","info-filled","lock","mail","plus","search","share-alt","show","sparkle","trash","user","warning-filled"]);class DbInput extends HTMLElement{constructor(){super(...arguments),this.shapeKey="",this.passwordVisible=!1,this.isFocused=!1,this.touched=!1,this.isScrubbing=!1,this.handleInput=e=>{e.stopPropagation();const t=e.target;this.updateDynamicUI(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:t.value,nativeEvent:e},bubbles:!0,composed:!0}))},this.handleChange=e=>{e.stopPropagation();const t=e.target;this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t.value,nativeEvent:e},bubbles:!0,composed:!0}))},this.handleFocus=e=>{this.isFocused=!0,this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-focus",{detail:{nativeEvent:e},bubbles:!0,composed:!0}))},this.handleBlur=e=>{this.isFocused=!1,this.touched=!0,this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-blur",{detail:{nativeEvent:e},bubbles:!0,composed:!0}))},this.handlePasswordToggle=()=>{this.passwordVisible=!this.passwordVisible,this.render()},this.handleSearchClear=()=>{this.input&&(this.input.value="",this.setAttribute("value",""),this.input.focus(),this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:"",nativeEvent:null},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-clear",{bubbles:!0,composed:!0})))}}static get observedAttributes(){return["type","label","placeholder","value","default-value","size","disabled","readonly","required","error","error-message","helper-text","full-width","name","start-icon","end-icon","validate","validation-visibility","validate-on-blur","password-min-length","scrubbable","scrub-step","scrub-sensitivity","min","max","step"]}get value(){return this.input?.value??this.getAttribute("value")??""}set value(e){this.setAttribute("value",e),this.input&&(this.input.value=e),this.updateDynamicUI()}get type(){return this.getAttribute("type")||"text"}set type(e){this.setAttribute("type",e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e)}get readOnly(){return this.hasAttribute("readonly")}set readOnly(e){this.toggleAttribute("readonly",e)}connectedCallback(){this.render()}disconnectedCallback(){this.detachScrub?.(),this.detachScrub=void 0}attributeChangedCallback(e){if("value"!==e||!this.isScrubbing){if("value"===e&&this.input){const e=this.getAttribute("value")??"";return this.input.value!==e&&(this.input.value=e),void this.updateDynamicUI()}this.render()}}focus(){this.input?.focus()}get passwordMinLength(){return Number(this.getAttribute("password-min-length")||8)}get validationVisibility(){return this.getAttribute("validation-visibility")||"focus"}get validateOnBlur(){return!this.hasAttribute("validate-on-blur")||"false"!==this.getAttribute("validate-on-blur")}get isValidationEnabled(){return this.hasAttribute("validate")}getIconSize(){return getDbComponentIconSize(this.size)}resolveIconName(e){const t=this.getAttribute(e);if(t&&Oe.has(t))return t}resolveStartIcon(){return this.resolveIconName("start-icon")||("search"===this.type?"search":void 0)}getCurrentValue(){return this.input?.value??this.getAttribute("value")??this.getAttribute("default-value")??""}buildStructure(e){const make=(e,t)=>{const s=document.createElement(e);return s.className=t,s},t=[];if(e.label){const s=document.createElement("label");s.className="designbase-wc-input__label",s.htmlFor=e.fieldId,t.push(s)}const s=make("span","designbase-wc-input__wrapper");if(e.startIcon){const e=make("span","designbase-wc-input__start-icon");e.setAttribute("aria-hidden","true"),s.append(e)}const i=document.createElement("input");if(i.className="designbase-wc-input__field",i.id=e.fieldId,s.append(i),e.isPassword){const e=document.createElement("button");e.type="button",e.className="designbase-wc-input__password-toggle",s.append(e)}if(e.isSearch){const e=document.createElement("button");e.type="button",e.className="designbase-wc-input__clear-button",e.hidden=!0,s.append(e)}if(e.endIcon&&!e.isPassword&&!e.isSearch){const e=make("span","designbase-wc-input__end-icon");e.setAttribute("aria-hidden","true"),s.append(e)}if(t.push(s),this.isValidationEnabled&&e.isPassword){const s=make("div","designbase-wc-input__validation-slot");s.id=e.validationId,t.push(s)}const n=make("p","designbase-wc-input__helper-text");n.id=e.helperId;const a=make("p","designbase-wc-input__error-message");a.id=e.errorId,t.push(n,a),this.replaceChildren(...t)}render(){const e=this.getCurrentValue(),t=D.includes(this.type)?this.type:"text",s="search"===t,i="password"===t,n=i&&this.passwordVisible||s?"text":t,a=this.getAttribute("label")||"",r=this.getAttribute("helper-text")||"",o=this.getAttribute("error-message")||"",l=this.hasAttribute("error"),d=this.resolveStartIcon(),h=this.resolveIconName("end-icon");this.classList.add("designbase-wc-input"),M.forEach(e=>this.classList.remove(`designbase-wc-input--${e}`)),this.classList.add(`designbase-wc-input--${M.includes(this.size)?this.size:"m"}`),this.classList.toggle("designbase-wc-input--error",l),this.classList.toggle("designbase-wc-input--disabled",this.disabled),this.classList.toggle("designbase-wc-input--readonly",this.readOnly),this.classList.toggle("designbase-wc-input--full-width",this.hasAttribute("full-width")),this.classList.toggle("designbase-wc-input--with-start-icon",Boolean(d));const u=s&&e.length>0&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--with-end-icon",Boolean(h&&!i&&!s)||i||u),this.classList.toggle("designbase-wc-input--with-password-toggle",i),this.classList.toggle("designbase-wc-input--with-search-clear",u);const b=this.hasAttribute("scrubbable")&&"number"===t&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--scrubbable",b),this.classList.toggle("designbase-wc-input--scrubbing",this.isScrubbing);const p=this.getAttribute("id")||dbUid("db-input");this.hasAttribute("id")||this.setAttribute("id",p);const m=`${p}-field`,g=`${p}-helper`,f=`${p}-error`,v=`${p}-validation`,w=this.getAttribute("min"),A=this.getAttribute("max"),y=this.getAttribute("step"),E=[a?"L":"",d?"S":"",!h||i||s?"":"E",i?"P":"",s?"C":"",this.isValidationEnabled&&i?"V":""].join("");this.shapeKey===E&&this.input?.isConnected||(this.buildStructure({label:a,fieldId:m,helperId:g,errorId:f,validationId:v,startIcon:d,endIcon:h,isPassword:i,isSearch:s}),this.shapeKey=E);const _=this.querySelector(".designbase-wc-input__label");if(_&&(_.htmlFor=m,_.textContent=a,this.hasAttribute("required"))){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.textContent=" *",_.append(e)}const C=this.querySelector("input.designbase-wc-input__field");if(C){C.id=m,C.type!==n&&(C.type=n),C.placeholder=this.getAttribute("placeholder")||"",C.disabled=this.disabled,C.readOnly=this.readOnly,C.required=this.hasAttribute("required"),C.name=this.getAttribute("name")||"",C.setAttribute("aria-invalid",String(l)),s?C.setAttribute("role","searchbox"):C.removeAttribute("role");for(const[e,t]of[["min",w],["max",A],["step",y]])null!==t?C.setAttribute(e,t):C.removeAttribute(e)}const x=this.querySelector(".designbase-wc-input__password-toggle");x&&(x.disabled=this.disabled,x.setAttribute("aria-label",t$2(this.passwordVisible?"input.hidePassword":"input.showPassword"))),this.querySelector(".designbase-wc-input__clear-button")?.setAttribute("aria-label",t$2("input.clearSearch"));const S=this.querySelector(".designbase-wc-input__helper-text");S&&(S.id=g,S.textContent=r,S.hidden=!r||l);const k=this.querySelector(".designbase-wc-input__error-message");k&&(k.id=f,k.textContent=o,k.hidden=!l||!o),this.querySelector(".designbase-wc-input__validation-slot")?.setAttribute("id",v),this.mountIcons(d,!h||i||s?void 0:h,i);const N=this.querySelector("input.designbase-wc-input__field")||void 0;N&&(N.value!==e&&(N.value=e),N!==this.input&&(N.addEventListener("input",this.handleInput),N.addEventListener("change",this.handleChange),N.addEventListener("focus",this.handleFocus),N.addEventListener("blur",this.handleBlur))),this.input=N;const L=this.querySelector(".designbase-wc-input__password-toggle");L&&!L.dataset.wcBound&&(L.dataset.wcBound="true",L.addEventListener("click",this.handlePasswordToggle));const z=this.querySelector(".designbase-wc-input__clear-button");z&&!z.dataset.wcBound&&(z.dataset.wcBound="true",z.addEventListener("click",this.handleSearchClear)),this.detachScrub?.(),this.detachScrub=void 0,b&&this.input&&(this.detachScrub=attachNumberScrub(this.input,{isEnabled:()=>this.hasAttribute("scrubbable")&&"number"===this.type,isInteractive:()=>!this.disabled&&!this.readOnly,getValue:()=>this.getCurrentValue(),getStep:()=>readNumericAttribute(this,"scrub-step")??readNumericAttribute(this,"step")??1,getMin:()=>readNumericAttribute(this,"min"),getMax:()=>readNumericAttribute(this,"max"),getSensitivity:()=>readNumericAttribute(this,"scrub-sensitivity")??4,onValueChange:e=>this.applyScrubValue(e),onScrubStateChange:e=>{this.isScrubbing=e,this.classList.toggle("designbase-wc-input--scrubbing",e),!e&&this.input&&this.dispatchEvent(new CustomEvent("db-change",{detail:{value:this.input.value,nativeEvent:null},bubbles:!0,composed:!0}))}})),this.updateDynamicUI()}mountIcons(e,t,s=!1){const i=this.getIconSize();if(e){const t=this.querySelector(".designbase-wc-input__start-icon");t?.replaceChildren(createDbIcon(e,i))}if(t){const e=this.querySelector(".designbase-wc-input__end-icon");e?.replaceChildren(createDbIcon(t,i))}if(s){const e=this.querySelector(".designbase-wc-input__password-toggle");e?.replaceChildren(createDbIcon(this.passwordVisible?"hide":"show",i))}const n=this.querySelector(".designbase-wc-input__clear-button");n?.replaceChildren(createDbIcon("close",i))}shouldShowPasswordValidation(e){return!(!this.isValidationEnabled||"password"!==this.type)&&"never"!==this.validationVisibility&&("always"===this.validationVisibility||this.isFocused||e.length>0)}renderValidationMarkup(e){const t=function getPasswordValidation(e,t=8){const s=[{id:"length",label:`최소 ${t}자 이상`,met:e.length>=t},{id:"lowercase",label:"소문자 포함",met:/[a-z]/.test(e)},{id:"uppercase",label:"대문자 포함",met:/[A-Z]/.test(e)},{id:"number",label:"숫자 포함",met:/\d/.test(e)},{id:"special",label:"특수문자 포함",met:/[!@#$%^&*(),.?":{}|<>]/.test(e)}],i=function getPasswordStrengthLevel(e,t){return!t||e<=1?"weak":2===e?"fair":3===e?"good":"very-strong"}(s.filter(e=>e.met).length,e.length>0);return{requirements:s,score:getPasswordScore(i),level:i,levelLabel:Be[i],isValid:s.every(e=>e.met),isStrongEnough:"good"===i||"very-strong"===i}}(e,this.passwordMinLength),s=Array.from({length:4},(e,s)=>`<span class="designbase-wc-input__password-strength-segment${s<t.score?` designbase-wc-input__password-strength-segment--${t.level}`:""}"></span>`).join(""),i=t.requirements.map(e=>`<li class="designbase-wc-input__password-requirement${e.met?" designbase-wc-input__password-requirement--met":""}">${e.met?'<span class="designbase-wc-input__password-requirement-icon" aria-hidden="true"></span>':'<span class="designbase-wc-input__password-requirement-icon" aria-hidden="true"><span class="designbase-wc-input__password-requirement-dot"></span></span>'}<span class="designbase-wc-input__password-requirement-label">${this.escape(e.label)}</span></li>`).join("");return`\n <div class="designbase-wc-input__validation" aria-live="polite">\n <div class="designbase-wc-input__password-strength">\n <div class="designbase-wc-input__password-strength-bar" role="progressbar" aria-valuemin="0" aria-valuemax="4" aria-valuenow="${t.score}" aria-label="비밀번호 강도">${s}</div>\n <span class="designbase-wc-input__password-strength-label designbase-wc-input__password-strength-label--${t.level}">${t.levelLabel}</span>\n </div>\n <ul class="designbase-wc-input__password-requirements">${i}</ul>\n </div>\n `}updateDynamicUI(){const e=this.getCurrentValue(),t="search"===this.type&&e.length>0&&!this.disabled&&!this.readOnly;this.classList.toggle("designbase-wc-input--with-search-clear",t);const s=this.querySelector(".designbase-wc-input__clear-button");s&&(s.hidden=!t,s.replaceChildren(createDbIcon("close",this.getIconSize())));const i=this.querySelector(".designbase-wc-input__validation-slot");if(i&&(this.shouldShowPasswordValidation(e)?(i.innerHTML=this.renderValidationMarkup(e),i.querySelectorAll(".designbase-wc-input__password-requirement--met .designbase-wc-input__password-requirement-icon").forEach(e=>{e.replaceChildren(createDbIcon("circle-checked",12))})):i.innerHTML=""),this.input){const t=`${this.getAttribute("id")}-helper`,s=`${this.getAttribute("id")}-error`,i=`${this.getAttribute("id")}-validation`,n=this.getAttribute("helper-text")||"",a=this.getAttribute("error-message")||"",r=this.hasAttribute("error"),o=[n&&!r?t:"",this.shouldShowPasswordValidation(e)?i:"",r&&a?s:""].filter(Boolean).join(" ")||void 0;o?this.input.setAttribute("aria-describedby",o):this.input.removeAttribute("aria-describedby")}}applyScrubValue(e){this.input&&(this.input.value=e,this.setAttribute("value",e),this.updateDynamicUI(),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:e,nativeEvent:null},bubbles:!0,composed:!0})))}escape(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]||e))}}customElements.get("db-input")||customElements.define("db-input",DbInput);const He={xs:{width:96,height:20,markSize:19},s:{width:125,height:26,markSize:25},m:{width:193,height:40,markSize:38},l:{width:256,height:53,markSize:50},xl:{width:320,height:66,markSize:63}};class DbLogo extends HTMLElement{static get observedAttributes(){return["type","text","src","alt","size","variant","clickable","href","target","full-width"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}handleClick(e){(this.hasAttribute("clickable")||this.getAttribute("href"))&&(e.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})))}renderLogoContent(e){const t=this.getAttribute("type")||"designbase",s=this.getAttribute("text")||"Logo",i=this.getAttribute("src"),n=this.getAttribute("alt")||s,a=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"default",{width:o,height:l,markSize:d}=function getLogoDimensions(e){return He[e]||He.m}(a),h=function getLogoColor(e){return"original"===e||"dark"===e?"#000000":"light"===e||"white"===e?"#ffffff":"primary"===e?"var(--db-brand-primary)":"secondary"===e?"var(--db-text-secondary)":"var(--db-text-primary)"}(r);if("designbase"===t){const t=document.createElement("div");return t.className="designbase-wc-logo__svg",t.append(function createDesignBaseLogoSvg(e,t,s,i){const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width",String(e)),n.setAttribute("height",String(t)),n.setAttribute("viewBox","0 0 386 40"),n.setAttribute("fill","none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("aria-label","DesignBase Logo"),i&&n.setAttribute("class",i);const a=document.createElementNS("http://www.w3.org/2000/svg","g");return a.setAttribute("fill",s||"currentColor"),a.innerHTML='\n<polygon points="58.4,23.6 77.3,23.6 77.3,16.2 58.4,16.2 58.4,7.7 79.4,7.7 79.4,0.4 49.5,0.4 49.5,39.6 80,39.6 80,32.3 58.4,32.3"/>\n<path d="M95.6,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3c-4.5-2.8-9.6-4.2-14.9-4.2c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.2,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C116.5,13.9,95.6,18,95.6,10.8z"/>\n<rect x="122.7" y="0.4" width="8.8" height="39.2"/>\n<path d="M158.8,7.8c4,0.1,7.8,1.7,10.8,4.4l5-6.3c-4.4-3.7-10-5.7-15.7-5.7c-12.2,0-21.4,8.5-21.4,19.9s9,20,20.9,20 c5.7-0.1,11.2-1.9,15.9-5.1V19.8h-7.6v10.3c-2.4,1.3-5,2-7.7,2.1h-0.4c-6.7-0.1-12.1-5.6-12-12.3v-0.4 C146.7,13,152.2,7.7,158.8,7.8z"/>\n<polygon points="209.1,25.6 190.1,0.4 182,0.4 182,39.6 190.5,39.6 190.5,14.5 209.5,39.6 217.5,39.6 217.5,0.4 209.1,0.4"/>\n<path d="M263.3,18.8c4-0.9,6.9-4.5,6.8-8.6c0-6-5.4-9.8-14-9.8h-24.5v6.5l6.4,1v31.8h18.7c9.1,0,14.8-4.2,14.8-10.9 C271.7,23.8,268.2,19.5,263.3,18.8z M246.9,7.6h8.7c3.4-0.1,5.4,1.5,5.4,4.2s-2,4.4-5.4,4.4h-8.7V7.6z M255.7,32.4h-8.7v-9.3h8.7 c4.1,0,6.7,1.7,6.7,4.5C262.4,30.6,259.8,32.4,255.7,32.4z"/>\n<path d="M290.5,0.4l-17,39.2h9.1l3.1-7.6h18.2l3,7.6h9.5L299.6,0.4H290.5z M288.6,24.9l6.2-15.2l6.2,15.2L288.6,24.9z"/>\n<path d="M328.9,10.8c0-2.1,2-3.2,5-3.2s8.1,1.6,12.2,4l3.4-7.3C345,1.4,339.9,0,334.6,0c-9.1,0-15.2,4.5-15.2,11.6 c0,13.9,20.9,9.6,20.9,17c0,2.4-2.2,3.8-5.8,3.8c-4.1,0-9.9-2.3-13.9-5.9l-3.5,7.2c4.9,4,11,6.2,17.3,6.2c8.7,0,15.4-4.1,15.4-11.8 C349.8,13.9,328.9,18,328.9,10.8z"/>\n<polygon points="364.4,32.3 364.4,23.6 383.3,23.6 383.3,16.2 364.4,16.2 364.4,7.7 385.4,7.7 385.4,0.4 355.5,0.4 355.5,39.6 386,39.6 386,32.3"/>\n<path d="M23.1,0.4H0v6.5l6.5,1v31.8h16.3c12.4,0,21-8.1,21-19.6S35.2,0.4,23.1,0.4z M34.7,20.1c0,7.2-4.8,12.1-11.4,12.1h-8V7.8H23 C29.8,7.8,34.8,12.8,34.7,20.1L34.7,20.1z"/>\n',n.append(a),n}(o,l,h)),void e.append(t)}if("designbase-mark"===t){const t=document.createElement("div");return t.className="designbase-wc-logo__svg",t.append(function createDesignBaseLogoMarkSvg(e,t,s){const i=.95*e,n=e,a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("width",String(i)),a.setAttribute("height",String(n)),a.setAttribute("viewBox","0 0 95 100"),a.setAttribute("fill","none"),a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("aria-label","DesignBase Mark"),s&&a.setAttribute("class",s);const r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("fill",t||"currentColor"),r.setAttribute("d","M45,0H0V8l10,2V90L0,92v8H45A50,50,0,0,0,45,0ZM43.12,90H20V10H38.33a15,15,0,0,1,0,30H30.11V50h13a20,20,0,0,1,0,40ZM71.4,80A30,30,0,0,0,55.83,42.83,24.93,24.93,0,0,0,60.27,13,40,40,0,0,1,71.4,80Z"),a.append(r),a}(d,h)),void e.append(t)}if(i){const t=document.createElement("img");return t.className="designbase-wc-logo__image",t.src=i,t.alt=n,void e.append(t)}const u=document.createElement("span");u.className="designbase-wc-logo__text",u.textContent=s,e.append(u)}render(){const e=this.getAttribute("type")||"designbase",t=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default",i=this.hasAttribute("clickable")||Boolean(this.getAttribute("href")),n=this.hasAttribute("full-width"),a=this.getAttribute("href"),r=this.getAttribute("target")||"_self";this.className="",this.replaceChildren();const o=document.createElement("div");if(o.className=["designbase-wc-logo",`designbase-wc-logo--${t}`,s?`designbase-wc-logo--${s}`:"",i?"designbase-wc-logo--clickable":"",n?"designbase-wc-logo--full-width":"","custom"!==e?"designbase-wc-logo--svg":""].filter(Boolean).join(" "),i&&(o.addEventListener("click",e=>this.handleClick(e)),a||o.setAttribute("role","button"),o.setAttribute("tabindex","0"),o.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick(e))})),this.renderLogoContent(o),a){const e=document.createElement("a");return e.className="designbase-wc-logo__link",e.href=a,e.target=r,"_blank"===r&&(e.rel="noopener noreferrer"),e.append(o),void this.append(e)}this.append(o)}}customElements.get("db-logo")||customElements.define("db-logo",DbLogo);class DbMenuItem extends HTMLElement{static get observedAttributes(){return["label","href","icon","active","disabled","badge","badge-color","size","variant","type","menu-style","expanded","expandable","sub-items","depth"]}get subItems(){try{return JSON.parse(this.getAttribute("sub-items")||"[]")}catch{return[]}}set subItems(e){this.setAttribute("sub-items","string"==typeof e?e:JSON.stringify(e))}get expanded(){return this.hasAttribute("expanded")}set expanded(e){this.toggleAttribute("expanded",e)}connectedCallback(){this.render()}iconSize(e){return"s"===e?16:"l"===e?24:16}render(){const e=this.getAttribute("label")||"",t=this.getAttribute("href")||"",s=this.getAttribute("icon"),i=this.getAttribute("size")||"m",n=this.getAttribute("variant")||"default",a=this.getAttribute("type")||"block",r=this.getAttribute("menu-style")||"accordion",o=Number(this.getAttribute("depth")||0),l=this.hasAttribute("active"),d=this.hasAttribute("disabled"),h=this.getAttribute("badge")||"",u=this.getAttribute("badge-color")||"primary",b=this.subItems,p=b.length>0,m=this.hasAttribute("expandable")||p,g=this.expanded,f=this.iconSize(i),v="accordion"===r&&p;this.className=["designbase-wc-menu-item",`designbase-wc-menu-item--${a}`,`designbase-wc-menu-item--${i}`,`designbase-wc-menu-item--${n}`,`designbase-wc-menu-item--${r}`,`designbase-wc-menu-item--depth-${o}`,l&&"designbase-wc-menu-item--active",d&&"designbase-wc-menu-item--disabled",m&&"designbase-wc-menu-item--expandable",g&&"designbase-wc-menu-item--expanded",p&&"designbase-wc-menu-item--with-children",h&&"designbase-wc-menu-item--with-badge",s&&"designbase-wc-menu-item--with-icon"].filter(Boolean).join(" "),this.replaceChildren();const w=document.createElement("div");if(w.className=["designbase-wc-menu-item__content","designbase-wc-menu-item__content--clickable"].join(" "),s){const e=document.createElement("div");e.className=["designbase-wc-menu-item__icon",`designbase-wc-menu-item__icon--${n}`,l&&"designbase-wc-menu-item__icon--active",d&&"designbase-wc-menu-item__icon--disabled"].filter(Boolean).join(" "),e.append(createDbIcon(s,f)),w.append(e)}const A=document.createElement("span");if(A.className="designbase-wc-menu-item__label",A.textContent=e,w.append(A),h){const e=document.createElement("db-badge");e.setAttribute("size","s"),e.setAttribute("variant",u),e.setAttribute("type","number"),e.setAttribute("count",h),w.append(e)}if(p){const e=document.createElement("div");e.className="designbase-wc-menu-item__expand-icon",e.append(createDbIcon(g?"chevron-up":"chevron-down",16)),w.append(e)}if(w.addEventListener("click",s=>{d||(p&&m?(s.preventDefault(),this.expanded=!this.expanded):t&&(window.location.href=t),this.dispatchEvent(new CustomEvent("db-click",{detail:{label:e,href:t,expanded:this.expanded},bubbles:!0,composed:!0})))}),this.append(w),p&&(g||v)){const e=document.createElement("div");e.className=`designbase-wc-menu-item__children designbase-wc-menu-item__children--${r}`,v&&e.setAttribute("aria-hidden",g?"false":"true"),b.forEach(t=>{const s=document.createElement("db-menu-item");s.setAttribute("label",t.label),s.setAttribute("type","block"),s.setAttribute("menu-style",r),s.setAttribute("size",i),s.setAttribute("depth",String(o+1)),t.href&&s.setAttribute("href",t.href),t.icon&&s.setAttribute("icon",t.icon),t.active&&s.setAttribute("active",""),t.disabled&&s.setAttribute("disabled",""),void 0!==t.badge&&s.setAttribute("badge",String(t.badge)),t.badgeColor&&s.setAttribute("badge-color",t.badgeColor),t.variant&&s.setAttribute("variant",t.variant),s.addEventListener("db-click",e=>{e.stopPropagation(),t.disabled||this.dispatchEvent(new CustomEvent("db-child-click",{detail:{child:t},bubbles:!0,composed:!0}))}),e.append(s)}),this.append(e)}}attributeChangedCallback(e){this.isConnected&&("expanded"!==e||"accordion"!==this.getAttribute("menu-style")?this.render():this.syncExpandedState())}syncExpandedState(){const e=this.expanded;this.classList.toggle("designbase-wc-menu-item--expanded",e);const t=this.querySelector(".designbase-wc-menu-item__expand-icon");t&&t.replaceChildren(createDbIcon(e?"chevron-up":"chevron-down",16));const s=this.querySelector(".designbase-wc-menu-item__children--accordion");s?s.setAttribute("aria-hidden",e?"false":"true"):e&&this.subItems.length&&this.render()}}customElements.get("db-menu-item")||customElements.define("db-menu-item",DbMenuItem);const Ve=["default","tabs","segment"],Re=["s","m","l"];class DbModal extends HTMLElement{constructor(){super(...arguments),this.titleId=dbUid("db-modal-title"),this.isMounted=!1,this.internalTabId="",this.internalSegment="",this.exitTimerId=null,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&"false"!==this.getAttribute("close-on-escape")&&(e.preventDefault(),this.close())}}static get observedAttributes(){return["open","title","size","header-variant","tabs","segments","selected-tab-id","default-selected-tab-id","segment-value","default-segment-value","nav-size","segment-full-width","close-on-outside-click","close-on-escape","show-close-button","role","describedby","label-close"]}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(e){e?this.setAttribute("open","true"):this.removeAttribute("open")}connectedCallback(){this.classList.add("designbase-wc-modal-host"),document.addEventListener("keydown",this.handleDocumentKeyDown),this.childObserver=new MutationObserver(()=>{this.open&&this.render()}),this.childObserver.observe(this,{childList:!0}),this.syncOpenState()}disconnectedCallback(){this.childObserver?.disconnect(),document.removeEventListener("keydown",this.handleDocumentKeyDown),this.exitTimerId&&clearTimeout(this.exitTimerId),this.teardown()}attributeChangedCallback(e){if(this.isConnected)if("open"!==e){if("selected-tab-id"===e||"segment-value"===e){const e=this.getClassifiedChildren();return this.renderBodyContent(e.body),void this.renderHeader(e.header)}this.render(),this.isMounted&&this.syncVisibility()}else this.syncOpenState()}resolvedSize(){return W.includes(this.size)?this.size:"m"}get size(){return coerceToContract(this.getAttribute("size"),W,"m")}set size(e){e?this.setAttribute("size",e):this.removeAttribute("size")}resolvedHeaderVariant(){const e=this.getAttribute("header-variant")||"default";return Ve.includes(e)?e:"default"}parsedTabs(){const e=this.getAttribute("tabs");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}parsedSegments(){const e=this.getAttribute("segments");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}usesIntegratedNav(){const e=this.resolvedHeaderVariant();return"tabs"===e&&this.parsedTabs().length>0||"segment"===e&&this.parsedSegments().length>0}closeIconSize(){const e=this.resolvedSize();return"s"===e?16:"l"===e?20:"xl"===e?24:18}activeTabId(){return this.getAttribute("selected-tab-id")||this.internalTabId||this.getAttribute("default-selected-tab-id")||this.parsedTabs()[0]?.id||""}activeSegmentValue(){return this.getAttribute("segment-value")||this.internalSegment||this.getAttribute("default-segment-value")||this.parsedSegments()[0]?.value||""}collectUserChildren(){return Array.from(this.children).filter(e=>!e.hasAttribute("data-wc-internal"))}classifyChildren(e){const t=e.filter(e=>this.isHeaderPart(e)),s=e.filter(e=>this.isFooterPart(e)),i=e.filter(e=>this.isBodyPart(e)),n=e.filter(e=>!t.includes(e)&&!s.includes(e)&&!i.includes(e));return{header:t,body:[...i,...n],footer:s}}getClassifiedChildren(){const e=this.classifyChildren(this.collectUserChildren());return e.header.length||e.body.length||e.footer.length?e:{header:Array.from(this.headerEl?.children||[]).filter(e=>e!==this.closeButton&&!e.classList.contains("designbase-wc-modal__header-row")&&("header"===e.getAttribute("data-modal-part")||e.classList.contains("designbase-wc-modal__header"))),body:this.collectContentParts("body"),footer:this.collectContentParts("footer")}}isHeaderPart(e){return e.classList.contains("designbase-wc-modal__header")||"header"===e.getAttribute("data-modal-part")}isBodyPart(e){return e.classList.contains("designbase-wc-modal__body")||"body"===e.getAttribute("data-modal-part")}isFooterContainer(e){return!(!e.classList.contains("designbase-wc-modal__footer")&&"footer"!==e.getAttribute("data-modal-part"))||"footer"===e.getAttribute("slot")&&("div"===e.localName||"footer"===e.localName)}isFooterPart(e){return this.isFooterContainer(e)||"footer"===e.getAttribute("slot")}collectContentParts(e){if(!this.contentEl)return[];const t=Array.from(this.contentEl.children).filter(t=>"body"===e?this.isBodyPart(t):this.isFooterPart(t));if(t.length>0)return t;const s="footer"===e?Array.from(this.contentEl.querySelectorAll(':scope > [data-wc-part="footer"] > [slot="footer"]')):[];return s.length>0?s:Array.from(this.children).filter(t=>"body"===e?this.isBodyPart(t):this.isFooterPart(t))}footerAnchor(){return this.contentEl?.querySelector(':scope > .designbase-wc-modal__footer, :scope > [data-modal-part="footer"], :scope > [data-wc-part="footer"]')||null}ensurePartShell(e){if(!this.contentEl)return null;const t=this.contentEl.querySelector(`:scope > [data-wc-part="${e}"]`);if(t)return t;const s=document.createElement("div");return s.className=`designbase-wc-modal__${e}`,s.setAttribute("data-modal-part",e),s.setAttribute("data-wc-part",e),s.setAttribute("data-wc-internal",""),"footer"===e?this.contentEl.append(s):this.contentEl.insertBefore(s,this.footerAnchor()),s}placeBodyParts(e){const t=this.contentEl;if(!t)return;const s=e.filter(e=>this.isBodyPart(e)),i=e.filter(e=>!this.isBodyPart(e)&&!this.isFooterPart(e));if(s.length>0){const e=t.querySelector(':scope > [data-wc-part="body"]');return s.forEach(e=>{e.parentElement!==t&&t.insertBefore(e,this.footerAnchor())}),void(e&&!s.includes(e)&&e.remove())}if(0===i.length)return;const n=this.ensurePartShell("body");n&&i.forEach(e=>{e.parentElement!==n&&n.append(e)})}placeFooterParts(e){const t=this.contentEl;if(!t)return;const s=e.filter(e=>this.isFooterContainer(e)),i=e.filter(e=>!this.isFooterContainer(e)&&"footer"===e.getAttribute("slot"));if(s.length>0){const e=t.querySelector(':scope > [data-wc-part="footer"]');return s.forEach(e=>{e.classList.add("designbase-wc-modal__footer"),e.hasAttribute("data-modal-part")||e.setAttribute("data-modal-part","footer"),e.parentElement!==t&&t.append(e)}),void(e&&!s.includes(e)&&e.remove())}if(0===i.length)return;const n=this.ensurePartShell("footer");n&&i.forEach(e=>{e.parentElement!==n&&n.append(e)})}restorePartsToHost(){this.contentEl&&(this.contentEl.querySelectorAll("[data-wc-part]").forEach(e=>{for(;e.firstChild;)this.append(e.firstChild)}),Array.from(this.contentEl.children).filter(e=>!e.classList.contains("designbase-wc-modal__integrated-content")&&!e.hasAttribute("data-wc-internal")).forEach(e=>{e.parentElement!==this&&this.append(e)}))}bindFooterActions(){if(!this.contentEl||"true"===this.contentEl.dataset.modalActionsBound)return;this.contentEl.dataset.modalActionsBound="true";const handleClose=e=>{const t=e.target?.closest("[data-modal-close]");t&&this.contentEl?.contains(t)&&this.close()};this.contentEl.addEventListener("click",handleClose),this.contentEl.addEventListener("db-click",handleClose)}ensureStructure(){this.root||(this.root=document.createElement("div"),this.root.className="designbase-wc-modal__overlay",this.root.setAttribute("data-wc-internal",""),this.root.addEventListener("click",e=>{e.target===this.root&&"false"!==this.getAttribute("close-on-outside-click")&&this.close()}),this.panel=document.createElement("div"),this.panel.className="designbase-wc-modal",this.panel.setAttribute("role",this.dialogRole()),this.panel.setAttribute("aria-modal","true"),this.panel.addEventListener("click",e=>e.stopPropagation()),this.headerEl=document.createElement("div"),this.headerEl.className="designbase-wc-modal__header",this.headerContentEl=document.createElement("div"),this.headerContentEl.className="designbase-wc-modal__header-content",this.titleEl=document.createElement("h2"),this.titleEl.className="designbase-wc-modal__title",this.titleEl.id=this.titleId,this.closeButton=document.createElement("button"),this.closeButton.type="button",this.closeButton.className="designbase-wc-modal__close-button",this.closeButton.setAttribute("aria-label",labelFrom(this,"label-close","modal.close")),this.closeButton.addEventListener("click",()=>this.close()),this.navEl=document.createElement("div"),this.navEl.className="designbase-wc-modal__header-nav",this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-modal__content",this.panel.append(this.headerEl,this.contentEl),this.root.append(this.panel))}renderCloseButton(){if(!this.closeButton)return;const e=createDbIcon("close",this.closeIconSize());e.setAttribute("aria-hidden","true"),this.closeButton.replaceChildren(e),this.closeButton.setAttribute("aria-label",labelFrom(this,"label-close","modal.close")),this.closeButton.hidden="false"===this.getAttribute("show-close-button")}renderDefaultHeader(e){if(!(this.headerEl&&this.headerContentEl&&this.titleEl&&this.closeButton))return;if(this.headerEl.className="designbase-wc-modal__header",this.headerEl.replaceChildren(),e.length>0)return e.forEach(e=>this.headerEl.append(e)),void("false"!==this.getAttribute("show-close-button")&&this.headerEl.append(this.closeButton));const t=this.getAttribute("title")||"";this.titleEl.textContent=t,this.titleEl.hidden=!t,this.headerContentEl.replaceChildren(),t&&this.headerContentEl.append(this.titleEl),this.renderCloseButton(),this.headerEl.append(this.headerContentEl),"false"!==this.getAttribute("show-close-button")&&this.headerEl.append(this.closeButton),this.panel&&(t?this.panel.setAttribute("aria-labelledby",this.titleId):this.panel.removeAttribute("aria-labelledby"),this.panel.setAttribute("role",this.dialogRole()),this.syncDescribedBy())}renderNavHeader(){if(!(this.headerEl&&this.headerContentEl&&this.titleEl&&this.closeButton&&this.navEl))return;const e=this.resolvedHeaderVariant(),t=this.parsedTabs(),s=this.parsedSegments(),i=Re.includes(this.getAttribute("nav-size")||"m")?this.getAttribute("nav-size")||"m":"s";this.headerEl.className=["designbase-wc-modal__header","tabs"===e&&"designbase-wc-modal__header--tabs","segment"===e&&"designbase-wc-modal__header--segment"].filter(Boolean).join(" ");const n=this.getAttribute("title")||"";this.titleEl.textContent=n,this.titleEl.hidden=!n,this.headerContentEl.replaceChildren(),n&&this.headerContentEl.append(this.titleEl),this.renderCloseButton();const a=document.createElement("div");if(a.className="designbase-wc-modal__header-row",a.append(this.headerContentEl),"false"!==this.getAttribute("show-close-button")&&a.append(this.closeButton),this.headerEl.replaceChildren(a),this.navEl.replaceChildren(),"tabs"===e&&t.length>0){const e=document.createElement("db-tabs");e.setAttribute("size",i),e.setAttribute("items",JSON.stringify(t.map(e=>({id:e.id,label:e.label,disabled:e.disabled})))),e.setAttribute("selected-id",this.activeTabId()),e.addEventListener("db-change",e=>{const t=e.detail?.id;t&&(this.hasAttribute("selected-tab-id")||(this.internalTabId=t),this.dispatchEvent(new CustomEvent("db-tab-change",{detail:{tabId:t},bubbles:!0,composed:!0})),this.renderBodyContent(this.getClassifiedChildren().body))}),this.tabsEl=e,this.navEl.append(e),this.headerEl.append(this.navEl)}if("segment"===e&&s.length>0){const e=document.createElement("db-segment-control");e.setAttribute("size",i),e.setAttribute("options",JSON.stringify(s.map(e=>({value:e.value,label:e.label,disabled:e.disabled})))),e.setAttribute("value",this.activeSegmentValue()),"false"!==this.getAttribute("segment-full-width")&&e.setAttribute("full-width",""),e.addEventListener("db-change",e=>{const t=e.detail?.value;t&&(this.hasAttribute("segment-value")||(this.internalSegment=t),this.dispatchEvent(new CustomEvent("db-segment-change",{detail:{value:t},bubbles:!0,composed:!0})),this.renderBodyContent(this.getClassifiedChildren().body))}),this.segmentEl=e,this.navEl.append(e),this.headerEl.append(this.navEl)}this.panel&&(n?this.panel.setAttribute("aria-labelledby",this.titleId):this.panel.removeAttribute("aria-labelledby"))}renderHeader(e){if(this.headerEl)return e.length>0?(this.headerEl.hidden=!1,void this.renderDefaultHeader(e)):this.usesIntegratedNav()?(this.headerEl.hidden=!1,void this.renderNavHeader()):void(this.getAttribute("title")?(this.headerEl.hidden=!1,this.renderDefaultHeader([])):this.headerEl.hidden=!0)}renderBodyContent(e=[]){if(!this.contentEl)return;let t=this.contentEl.querySelector(":scope > .designbase-wc-modal__integrated-content"),s="";if(this.usesIntegratedNav()){const e=this.resolvedHeaderVariant();if("tabs"===e){const e=this.parsedTabs().find(e=>e.id===this.activeTabId());s=e?.content||""}if("segment"===e){const e=this.parsedSegments().find(e=>e.value===this.activeSegmentValue());s=e?.content||""}}s?(t||(t=document.createElement("div"),t.className="designbase-wc-modal__integrated-content designbase-wc-modal__body",this.contentEl.insertBefore(t,this.contentEl.firstChild)),t.textContent=s):t?.remove(),this.placeBodyParts(e)}renderFooter(e){this.contentEl&&(this.placeFooterParts(e),e.forEach(e=>{e instanceof HTMLElement&&(e.hidden=!1)}),this.bindFooterActions())}render(){this.ensureStructure();const{header:e,body:t,footer:s}=this.getClassifiedChildren();W.forEach(e=>this.panel?.classList.remove(`designbase-wc-modal--${e}`)),this.panel?.classList.add(`designbase-wc-modal--${this.resolvedSize()}`),this.renderHeader(e),this.renderBodyContent(t),this.renderFooter(s)}syncVisibility(){if(this.root&&this.panel){if(this.open)return this.root.setAttribute("data-state","entering"),this.panel.setAttribute("data-state","entering"),void requestAnimationFrame(()=>{this.panel,requestAnimationFrame(()=>{this.open&&this.root&&this.panel&&(this.root.setAttribute("data-state","entered"),this.panel.setAttribute("data-state","entered"))})});this.root.setAttribute("data-state","exiting"),this.panel.setAttribute("data-state","exiting")}}syncOpenState(){if(this.open)return this.render(),this.root&&!this.root.isConnected&&(this.closest(".designbase-wp-admin")||document.body).append(this.root),this.isMounted||lockScroll(),this.isMounted=!0,this.syncVisibility(),void this.activateFocusTrap();this.isMounted&&(this.syncVisibility(),this.focusTrap?.deactivate(),this.focusTrap=void 0,this.exitTimerId&&clearTimeout(this.exitTimerId),this.exitTimerId=window.setTimeout(()=>{this.open||this.teardown()},200))}activateFocusTrap(){this.panel&&!this.focusTrap&&(this.focusTrap=createFocusTrap(this.panel,{initialFocus:()=>this.panel?.querySelector("[autofocus]")||null}),this.focusTrap.activate())}teardown(){this.focusTrap?.deactivate(),this.focusTrap=void 0,this.restorePartsToHost(),this.root?.remove(),this.isMounted&&unlockScroll(),this.isMounted=!1}dialogRole(){return"alertdialog"===this.getAttribute("role")?"alertdialog":"dialog"}syncDescribedBy(){if(!this.panel)return;const e=this.getAttribute("describedby");e?this.panel.setAttribute("aria-describedby",e):this.contentEl&&(this.contentEl.textContent||"").trim()?(this.contentEl.id||(this.contentEl.id=dbUid("db-modal-desc")),this.panel.setAttribute("aria-describedby",this.contentEl.id)):this.panel.removeAttribute("aria-describedby")}close(){this.open=!1,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}}customElements.get("db-modal")||customElements.define("db-modal",DbModal);class DbPageHeader extends HTMLElement{constructor(){super(...arguments),this.internalTabId="",this.isRendering=!1,this.handleBack=()=>{const e=new CustomEvent("db-back",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||function navigatePageHeaderBack(e="/"){if("undefined"==typeof window)return;const t=window.history.state?.idx;"number"==typeof t&&t>0||(()=>{try{return!!document.referrer&&new URL(document.referrer).origin===window.location.origin}catch{return!1}})()||window.history.length>1?window.history.back():window.location.assign(e)}(this.getAttribute("back-fallback-href")||"/")},this.handleTabChange=e=>{const t=e.detail,s=t?.selectedId??this.parseTabs()[t?.index??0]?.id??String(t?.index??0);this.hasAttribute("selected-tab-id")||(this.internalTabId=s),this.dispatchEvent(new CustomEvent("db-tab-change",{bubbles:!0,composed:!0,detail:{tabId:s}}))}}static get observedAttributes(){return["title","subtitle","description","breadcrumbs","variant","show-back-button","back-fallback-href","back-label","tabs","selected-tab-id","default-selected-tab-id","align"]}connectedCallback(){this.syncDefaultTab(),this.render(),this.childObserver=new MutationObserver(()=>{this.isRendering||this.hasPendingSlottedChildren()&&this.render()}),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){this.childObserver?.disconnect()}attributeChangedCallback(e){this.isConnected&&("default-selected-tab-id"!==e&&"tabs"!==e||this.syncDefaultTab(),this.render())}hasPendingSlottedChildren(){return Array.from(this.children).some(e=>{const t=e.getAttribute("slot");return"actions"===t||"meta"===t||"description"===t||"leading"===t})}syncDefaultTab(){if(this.internalTabId)return;const e=this.parseTabs(),t=this.getAttribute("default-selected-tab-id");this.internalTabId=t||e[0]?.id||""}parseTabs(){try{const e=JSON.parse(this.getAttribute("tabs")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseBreadcrumbs(){try{const e=JSON.parse(this.getAttribute("breadcrumbs")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}getActiveTabId(){return this.getAttribute("selected-tab-id")||this.internalTabId}getVariant(){const e=this.getAttribute("variant")||"default";return he.includes(e)?e:"default"}getAlign(){const e=this.getAttribute("align")||"center";return ue.includes(e)?e:"center"}collectLeading(){const e=Array.from(this.querySelectorAll(':scope > [slot="leading"]'));if(e.length)return e;const t=this.querySelector(".designbase-wc-page-header__leading");return t?.children.length?Array.from(t.children):[]}collectActions(){const e=Array.from(this.querySelectorAll(':scope > [slot="actions"]'));if(e.length)return e;const t=this.querySelector(".designbase-wc-page-header__cta");if(t?.children.length)return Array.from(t.children);const s=this.querySelector(".designbase-wc-page-header__actions");return s?.children.length?Array.from(s.children):[]}collectMeta(){const e=Array.from(this.querySelectorAll(':scope > [slot="meta"]'));if(e.length)return e;const t=this.querySelector(".designbase-wc-page-header__meta");return t?.children.length?Array.from(t.children):[]}renderMinimalAside(e,t){if(!e.length&&!t.length)return null;const s=document.createElement("div");if(s.className="designbase-wc-page-header__aside",e.length){const t=document.createElement("div");t.className="designbase-wc-page-header__meta",e.forEach(e=>t.append(e)),s.append(t)}if(t.length){const e=document.createElement("div");e.className="designbase-wc-page-header__cta",t.forEach(t=>e.append(t)),s.append(e)}return s}collectDescriptionSlot(){const e=this.querySelector(':scope > [slot="description"]');if(e)return e;const t=this.querySelector(":scope .designbase-wc-page-header__description"),s=t?.firstElementChild;return s||null}renderTitleBlock(e){const t=document.createDocumentFragment(),s=this.getAttribute("title")||"",i=this.getAttribute("subtitle"),n=document.createElement("h1");if(n.className="designbase-wc-page-header__title",n.textContent=s,t.append(n),i){const e=document.createElement("h2");e.className="designbase-wc-page-header__subtitle",e.textContent=i,t.append(e)}const a=this.getAttribute("description");if(e||a){const s=document.createElement("div");s.className="designbase-wc-page-header__description",e?s.append(e):s.textContent=a,t.append(s)}return t}render(){this.isRendering=!0;const e=this.collectActions(),t=this.collectMeta(),s=this.collectLeading(),i=this.collectDescriptionSlot(),n="minimal"===this.getVariant(),a=this.getAlign(),r=this.parseBreadcrumbs(),o=this.parseTabs(),l=o.length>0,d=this.hasAttribute("show-back-button");if(this.className=["designbase-wc-page-header",n?"designbase-wc-page-header--minimal":`designbase-wc-page-header--${a}`,n&&l?"designbase-wc-page-header--has-tabs":""].filter(Boolean).join(" "),this.replaceChildren(),r.length){const e=document.createElement("div");e.className="designbase-wc-page-header__breadcrumbs";const t=document.createElement("db-breadcrumbs");t.setAttribute("size","s"),t.setAttribute("items",JSON.stringify(r)),e.append(t),this.append(e)}const h=document.createElement("div");h.className="designbase-wc-page-header__main";const u=document.createElement("div");if(u.className="designbase-wc-page-header__content",n&&(d||s.length)){const e=document.createElement("div");if(e.className="designbase-wc-page-header__title-row",s.length){const t=document.createElement("div");t.className="designbase-wc-page-header__leading",s.forEach(e=>t.append(e)),e.append(t)}if(d){const t=document.createElement("db-button");t.className="designbase-wc-page-header__back-button",t.setAttribute("variant","tertiary"),t.setAttribute("size","m"),t.setAttribute("icon-only",""),t.setAttribute("start-icon","chevron-left"),t.setAttribute("aria-label",this.getAttribute("back-label")||"뒤로가기"),t.setAttribute("tooltip",this.getAttribute("back-label")||"뒤로가기"),t.addEventListener("db-click",this.handleBack),e.append(t)}const t=document.createElement("div");t.className="designbase-wc-page-header__title-group",t.append(this.renderTitleBlock(i)),e.append(t),u.append(e)}else u.append(this.renderTitleBlock(i));if(h.append(u),n){const s=this.renderMinimalAside(t,e);s&&h.append(s)}if(this.append(h),!n&&e.length){const t=document.createElement("div");t.className="designbase-wc-page-header__actions",e.forEach(e=>t.append(e)),this.append(t)}this.renderMinimalTabs(n,l,o),queueMicrotask(()=>{this.isRendering=!1})}renderMinimalTabs(e,t,s){if(!e||!t)return;const i=document.createElement("div");i.className="designbase-wc-page-header__toolbar";const n=document.createElement("div");n.className="designbase-wc-page-header__tabs";const a=document.createElement("db-tabs");a.setAttribute("size","m"),a.setAttribute("items",JSON.stringify(s)),a.setAttribute("selected-id",this.getActiveTabId()),a.addEventListener("db-change",this.handleTabChange),n.append(a),i.append(n),this.append(i)}}customElements.get("db-page-header")||customElements.define("db-page-header",DbPageHeader);class DbPagination extends HTMLElement{static get observedAttributes(){return["current-page","total-pages","total-items","page-size","page-size-options","size","variant","alignment","show-first-last","show-previous-next","show-page-size-selector","show-total","sibling-count","boundary-count","disabled","full-width"]}get currentPage(){return Number(this.getAttribute("current-page")||1)}set currentPage(e){this.setAttribute("current-page",String(e))}get totalPages(){return Number(this.getAttribute("total-pages")||1)}set totalPages(e){this.setAttribute("total-pages",String(e))}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}iconSize(){const e=this.getAttribute("size")||"m";return"s"===e?12:"l"===e?16:14}render(){const e=this.getAttribute("size")||"m",t=this.getAttribute("variant")||"default",s=this.getAttribute("alignment")||"center",i=this.hasAttribute("disabled"),n=this.hasAttribute("show-first-last"),a="false"!==this.getAttribute("show-previous-next"),r=this.hasAttribute("show-page-size-selector"),o=this.hasAttribute("show-total"),l=this.hasAttribute("full-width")||r||o,d=Number(this.getAttribute("total-items")||0),h=Number(this.getAttribute("page-size")||10),u=this.currentPage,b=this.totalPages,p=u<=1,m=u>=b;this.className=["designbase-wc-pagination",`designbase-wc-pagination--${e}`,`designbase-wc-pagination--${t}`,`designbase-wc-pagination--${s}`,i&&"designbase-wc-pagination--disabled",l&&"designbase-wc-pagination--full-width"].filter(Boolean).join(" "),this.setAttribute("role","navigation"),this.setAttribute("aria-label","페이지 네비게이션"),this.replaceChildren();const g=document.createElement("div");if(g.className=["designbase-wc-pagination__container",l&&"designbase-wc-pagination__container--full-width"].filter(Boolean).join(" "),o&&d>0){const e=document.createElement("div");e.className="designbase-wc-pagination__total",e.textContent=this.getTotalLabel(d,h,u),g.append(e)}const f=document.createElement("nav");f.className="designbase-wc-pagination__nav",f.setAttribute("aria-label","페이지 네비게이션");const v=document.createElement("ul");v.className="designbase-wc-pagination__list",n&&!p&&v.append(this.createIconButton("arrow-bar-left",1,"첫 페이지로 이동","first")),a&&!p&&v.append(this.createIconButton("chevron-left",u-1,"이전 페이지로 이동","previous")),this.getPageNumbers().forEach((e,t)=>{if("..."===e){const e=document.createElement("li");e.className="designbase-wc-pagination__ellipsis";const t=document.createElement("span");return t.className="designbase-wc-pagination__ellipsis-text",t.textContent="...",e.append(t),void v.append(e)}"number"==typeof e&&v.append(this.createPageButton(e,i))}),a&&!m&&v.append(this.createIconButton("chevron-right",u+1,"다음 페이지로 이동","next")),n&&!m&&v.append(this.createIconButton("arrow-bar-right",b,"마지막 페이지로 이동","last")),f.append(v),g.append(f),r&&g.append(this.createPageSizeSelector(e,h,i)),this.append(g)}getPageSizeOptions(){const e=this.getAttribute("page-size-options");if(!e)return[10,20,50,100];try{const t=JSON.parse(e);if(Array.isArray(t))return t.map(e=>Number(e)).filter(e=>!Number.isNaN(e))}catch{}return[10,20,50,100]}getTotalLabel(e,t,s){return`${(s-1)*t+1}-${Math.min(s*t,e)} / ${e}개`}createPageSizeSelector(e,t,s){const i=document.createElement("div");i.className="designbase-wc-pagination__page-size";const n=document.createElement("label");n.className="designbase-wc-pagination__page-size-label";const a=document.createElement("span");a.className="designbase-wc-pagination__page-size-text",a.textContent="페이지당";const r=document.createElement("db-select");return r.className="designbase-wc-pagination__page-size-select",r.setAttribute("size",e),r.setAttribute("show-clear-button","false"),r.setAttribute("searchable","false"),r.setAttribute("options",JSON.stringify(this.getPageSizeOptions().map(e=>({value:String(e),label:String(e)})))),r.setAttribute("value",String(t)),s&&r.setAttribute("disabled",""),r.addEventListener("db-change",e=>{const s=e.detail,i=Number(s?.value);Number.isNaN(i)||i===t||(this.setAttribute("page-size",String(i)),this.dispatchEvent(new CustomEvent("db-page-size-change",{detail:{pageSize:i},bubbles:!0,composed:!0})))}),n.append(a,r),i.append(n),i}getPageNumbers(){const e=Number(this.getAttribute("sibling-count")||1),t=Number(this.getAttribute("boundary-count")||1),s=this.totalPages,i=this.currentPage;if(s<=2*e+3+2)return Array.from({length:s},(e,t)=>t+1);const n=Math.max(i-e,t),a=Math.min(i+e,s-t+1),r=n>t+2,o=a<s-t-1;if(!r&&o){const t=3+2*e;return[...Array.from({length:t},(e,t)=>t+1),"...",s]}if(r&&!o){const t=3+2*e;return[1,"...",...Array.from({length:t},(e,i)=>s-t+i+1)]}return r&&o?[1,"...",...Array.from({length:a-n+1},(e,t)=>n+t),"...",s]:Array.from({length:s},(e,t)=>t+1)}createPageButton(e,t){const s=e===this.currentPage,i=document.createElement("li");i.className="designbase-wc-pagination__item";const n=document.createElement("button");return n.type="button",n.className=["designbase-wc-pagination__button",s&&"designbase-wc-pagination__button--active"].filter(Boolean).join(" "),n.textContent=String(e),n.disabled=t,s&&n.setAttribute("aria-current","page"),n.setAttribute("aria-label",`페이지 ${e}로 이동`),n.addEventListener("click",()=>this.select(e)),i.append(n),i}createIconButton(e,t,s,i){const n=document.createElement("li");n.className="designbase-wc-pagination__item";const a=document.createElement("button");return a.type="button",a.className=`designbase-wc-pagination__button designbase-wc-pagination__button--${i}`,a.disabled=this.hasAttribute("disabled"),a.setAttribute("aria-label",s),a.append(createDbIcon(e,this.iconSize())),a.addEventListener("click",()=>this.select(t)),n.append(a),n}select(e){this.hasAttribute("disabled")||e===this.currentPage||e<1||e>this.totalPages||(this.currentPage=e,this.dispatchEvent(new CustomEvent("db-change",{detail:{page:e},bubbles:!0,composed:!0})))}}customElements.get("db-pagination")||customElements.define("db-pagination",DbPagination);class DbRadio extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.userInteracted=!1,this.handleChange=()=>{if(!this.input||this.disabled||this.readOnly)return;this.userInteracted=!0;const e=this.input.checked;this.toggleAttribute("checked",e),this.syncVisual(),this.syncClasses(),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:e,selected:e,value:this.getAttribute("value")||""},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","size","disabled","readonly","required","name","value","has-label"]}get checked(){return this.input?.checked??(this.hasAttribute("checked")||this.hasAttribute("selected"))}set checked(e){this.toggleAttribute("checked",e),this.input&&(this.input.checked=e,this.syncVisual(),this.syncClasses())}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e),this.input&&(this.input.disabled=e),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(e){this.toggleAttribute("readonly",e),this.input&&(this.input.readOnly=e),this.syncClasses()}get required(){return this.hasAttribute("required")}set required(e){this.toggleAttribute("required",e),this.input&&(this.input.required=e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState()}attributeChangedCallback(e){if(this.built)return"checked"===e||"selected"===e?(this.input&&(this.input.checked=this.hasAttribute("checked")||this.hasAttribute("selected")),this.syncVisual(),void this.syncClasses()):void this.syncState()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}build(){for(this.root=document.createElement("label"),this.root.className="designbase-wc-radio",this.input=document.createElement("input"),this.input.type="radio",this.input.className="designbase-wc-radio__input",this.visual=document.createElement("span"),this.visual.className="designbase-wc-radio__visual",this.visual.setAttribute("aria-hidden","true"),this.dot=document.createElement("span"),this.dot.className="designbase-wc-radio__dot",this.visual.appendChild(this.dot),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-radio__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(this.input,this.visual,this.labelEl),this.appendChild(this.root),this.input.addEventListener("change",this.handleChange),this.built=!0}syncState(){if(!this.root||!this.input||!this.visual)return;const e=this.hasAttribute("checked")||this.hasAttribute("selected")||!this.userInteracted&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected"));this.input.checked=e,this.input.disabled=this.disabled,this.input.readOnly=this.readOnly,this.input.required=this.required,this.input.name=this.getAttribute("name")||"",this.input.value=this.getAttribute("value")||"",this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncVisual(),this.syncClasses()}syncVisual(){}syncClasses(){if(!this.root||!this.input)return;const e=J.includes(this.size)?this.size:"m",t=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim());this.root.className=["designbase-wc-radio",`designbase-wc-radio--${e}`,this.input.checked&&"designbase-wc-radio--selected",this.disabled&&"designbase-wc-radio--disabled",this.readOnly&&"designbase-wc-radio--readonly",!t&&"designbase-wc-radio--no-label"].filter(Boolean).join(" ")}}customElements.get("db-radio")||customElements.define("db-radio",DbRadio);class DbSearchBar extends HTMLElement{constructor(){super(...arguments),this.recentSearches=[],this.isFocused=!1,this.currentSuggestion=0,this.scrollParents=[]}static get observedAttributes(){return["value","default-value","placeholder","size","appearance","disabled","readonly","full-width","show-shortcut","shortcut-label","enable-recent-searches","recent-searches-key","recent-searches-layout","suggested-searches","suggestion-rolling-interval","categories","selected-category","search-results","empty-state-message"]}getResolvedSize(){const e=this.getAttribute("size")||"m";return ee.includes(e)?e:"m"}getIconPx(){return getDbComponentIconSize(this.getResolvedSize())}syncIcons(){const e=this.getIconPx();this.querySelector(".designbase-wc-search-bar__search-icon")?.replaceChildren(createDbIcon("search",e)),this.clearButton?.replaceChildren(createDbIcon("close",e))}hasInputValue(){return Boolean((this.input?.value??this.getAttribute("value")??"").trim())}get value(){return this.input?.value??this.getAttribute("value")??""}set value(e){this.setAttribute("value",e),this.input&&(this.input.value=e)}connectedCallback(){this.loadRecentSearches(),this.render(),this.bindGlobalShortcut()}disconnectedCallback(){this.clearSuggestionInterval(),this.unbindGlobalShortcut(),this.detachDropdownPortal(),this.blurTimer&&clearTimeout(this.blurTimer)}attributeChangedCallback(e){if(this.isConnected)return"value"===e&&this.input?(this.input.value=this.getAttribute("value")||"",this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),void this.syncSuggestionRolling()):"disabled"===e||"readonly"===e||"placeholder"===e||"show-shortcut"===e||"shortcut-label"===e||"selected-category"===e||"search-results"===e||"empty-state-message"===e||"suggested-searches"===e?(this.syncAttributes(),this.syncPlaceholder(),this.updateDropdown(),void this.syncSuggestionRolling()):"enable-recent-searches"===e||"recent-searches-key"===e?(this.loadRecentSearches(),void this.updateDropdown()):void("categories"!==e&&"recent-searches-layout"!==e?this.render():this.updateDropdown())}focus(){this.input?.focus()}parseJsonArray(e){try{const t=JSON.parse(this.getAttribute(e)||"[]");return Array.isArray(t)?t:[]}catch{return[]}}getRecentSearchesKey(){return this.getAttribute("recent-searches-key")||"searchbar-recent-searches"}loadRecentSearches(){if(this.hasAttribute("enable-recent-searches"))try{const e=localStorage.getItem(this.getRecentSearchesKey());this.recentSearches=e?JSON.parse(e):[],Array.isArray(this.recentSearches)||(this.recentSearches=[])}catch{this.recentSearches=[]}else this.recentSearches=[]}saveRecentSearches(){try{localStorage.setItem(this.getRecentSearchesKey(),JSON.stringify(this.recentSearches))}catch{}}clearSuggestionInterval(){this.suggestionInterval&&(clearInterval(this.suggestionInterval),this.suggestionInterval=void 0)}syncSuggestionRolling(){this.clearSuggestionInterval();const e=this.parseJsonArray("suggested-searches"),t=this.hasInputValue(),s=Number(this.getAttribute("suggestion-rolling-interval")||5e3);e.length>0&&!t&&(this.suggestionInterval=setInterval(()=>{this.currentSuggestion=(this.currentSuggestion+1)%e.length,this.syncPlaceholder(),this.updateDropdown()},s))}syncPlaceholder(){if(!this.input)return;const e=this.parseJsonArray("suggested-searches"),t=this.hasInputValue(),s=this.getAttribute("placeholder")||"검색...";e.length>0&&!t?this.input.placeholder=e[this.currentSuggestion]||s:this.input.placeholder=s}syncValueState(){const e=this.hasInputValue();this.classList.toggle("designbase-wc-search-bar--has-value",e),this.clearButton&&(this.clearButton.hidden=!e||this.hasAttribute("disabled")||this.hasAttribute("readonly")),this.shortcutBadge&&(this.shortcutBadge.hidden=!this.hasAttribute("show-shortcut")||e||this.hasAttribute("disabled")||this.hasAttribute("readonly")),this.syncIcons()}syncAttributes(){const e=this.getAttribute("size")||"m",t=this.hasAttribute("disabled"),s=this.hasAttribute("readonly"),i=this.hasAttribute("show-shortcut");this.className=["designbase-wc-search-bar",`designbase-wc-search-bar--${ee.includes(e)?e:"m"}`,"pill"===this.getAttribute("appearance")&&"designbase-wc-search-bar--appearance-pill",t&&"designbase-wc-search-bar--disabled",s&&"designbase-wc-search-bar--readonly",this.hasAttribute("full-width")&&"designbase-wc-search-bar--full-width",Boolean(this.hasInputValue())&&"designbase-wc-search-bar--has-value"].filter(Boolean).join(" "),this.input&&(this.input.disabled=t,this.input.readOnly=s),this.shortcutBadge&&(this.shortcutBadge.hidden=!i||this.hasInputValue()||t||s,this.shortcutBadge.textContent=this.getAttribute("shortcut-label")||"⌘K"),this.syncValueState()}bindGlobalShortcut(){this.unbindGlobalShortcut(),!this.hasAttribute("show-shortcut")||this.hasAttribute("disabled")||this.hasAttribute("readonly")||(this.globalKeyHandler=e=>{const t=e.metaKey||e.ctrlKey;let s="k";const i=(this.getAttribute("shortcut-label")||"⌘K").slice(-1).toLowerCase();i&&(s=i),t&&e.key.toLowerCase()===s&&(e.preventDefault(),this.focus())},window.addEventListener("keydown",this.globalKeyHandler))}unbindGlobalShortcut(){this.globalKeyHandler&&(window.removeEventListener("keydown",this.globalKeyHandler),this.globalKeyHandler=void 0)}positionDropdown(){if(!this.dropdown||this.dropdown.hidden)return;const e=this.getBoundingClientRect(),t=this.input?.getBoundingClientRect(),s=t??e;this.dropdown.style.top=`${s.bottom+4}px`,this.dropdown.style.left=`${e.left}px`,this.dropdown.style.width=`${e.width}px`,this.dropdown.style.right="auto"}bindRepositionListeners(){if(this.repositionHandler)return;this.repositionHandler=()=>{requestAnimationFrame(()=>this.positionDropdown())},window.addEventListener("scroll",this.repositionHandler,{capture:!0,passive:!0}),window.addEventListener("resize",this.repositionHandler),this.scrollParents=[];let e=this.parentElement;for(;e&&e!==document.body;){const t=getComputedStyle(e),s=/(auto|scroll|overlay)/.test(t.overflowY),i=/(auto|scroll|overlay)/.test(t.overflow);(s||i)&&e.scrollHeight>e.clientHeight&&(e.addEventListener("scroll",this.repositionHandler,{passive:!0}),this.scrollParents.push(e)),e=e.parentElement}}unbindRepositionListeners(){this.repositionHandler&&(window.removeEventListener("scroll",this.repositionHandler,!0),window.removeEventListener("resize",this.repositionHandler),this.scrollParents.forEach(e=>e.removeEventListener("scroll",this.repositionHandler)),this.scrollParents=[],this.repositionHandler=void 0)}attachDropdownPortal(){this.dropdown&&!this.dropdown.hidden&&(this.dropdown.classList.add("designbase-wc-search-bar__dropdown--portal"),this.dropdown.parentElement!==document.body&&document.body.append(this.dropdown),requestAnimationFrame(()=>this.positionDropdown()),this.repositionHandler||this.bindRepositionListeners())}detachDropdownPortal(){this.unbindRepositionListeners(),this.dropdown&&(this.dropdown.classList.remove("designbase-wc-search-bar__dropdown--portal"),this.dropdown.style.top="",this.dropdown.style.left="",this.dropdown.style.width="",this.dropdown.style.right="",this.dropdown.parentElement===document.body&&this.isConnected&&this.append(this.dropdown))}shouldShowDropdown(){const e=this.hasInputValue(),t=this.parseJsonArray("categories"),s=this.parseJsonArray("suggested-searches"),i=this.getAttribute("search-results"),n=this.getAttribute("empty-state-message");return this.isFocused&&(t.length>0||this.hasAttribute("enable-recent-searches")&&this.recentSearches.length>0&&!e||s.length>0&&!e||null!==i&&e||Boolean(n)&&!e&&(!this.hasAttribute("enable-recent-searches")||0===this.recentSearches.length)&&0===s.length)}formatSearchResult(e){if("string"==typeof e||"number"==typeof e)return String(e);if(e&&"object"==typeof e){const t=e;if("string"==typeof t.title)return t.title;if("string"==typeof t.label)return t.label}return String(e)}handleSearch(e){const t=(e??this.value).trim();t&&(this.dispatchEvent(new CustomEvent("db-search",{detail:{value:t},bubbles:!0,composed:!0})),this.hasAttribute("enable-recent-searches")&&(this.recentSearches=[t,...this.recentSearches.filter(e=>e!==t)].slice(0,10),this.saveRecentSearches(),this.updateDropdown()))}updateDropdown(){if(!this.dropdown)return;const e=this.shouldShowDropdown();if(this.dropdown.hidden=!e,this.classList.toggle("designbase-wc-search-bar--dropdown-open",e),!e)return this.dropdown.replaceChildren(),void this.detachDropdownPortal();this.dropdown.replaceChildren();const t=this.hasInputValue(),s=this.parseJsonArray("categories"),i=this.parseJsonArray("suggested-searches"),n=this.getAttribute("selected-category")||"",a=this.parseJsonArray("search-results"),r=this.getAttribute("empty-state-message"),o=te.includes(this.getAttribute("recent-searches-layout")||"vertical")&&this.getAttribute("recent-searches-layout")||"vertical";if(s.length>0){const e=document.createElement("div");e.className="designbase-wc-search-bar__categories",s.forEach(t=>{const s=document.createElement("db-chip");s.setAttribute("label",t),s.setAttribute("size","s"),s.setAttribute("variant",t===n?"primary":"default"),s.setAttribute("clickable",""),s.addEventListener("mousedown",e=>{e.preventDefault(),this.setAttribute("selected-category",t),this.dispatchEvent(new CustomEvent("db-category-change",{detail:{category:t},bubbles:!0,composed:!0})),this.updateDropdown()}),e.append(s)}),this.dropdown.append(e)}if(t&&this.hasAttribute("search-results")){const e=document.createElement("div");if(e.className="designbase-wc-search-bar__results",a.length>0){const t=document.createElement("ul");t.className="designbase-wc-search-bar__results-list",a.forEach((e,s)=>{const i=document.createElement("li");i.className="designbase-wc-search-bar__result-item",i.textContent=this.formatSearchResult(e),i.addEventListener("mousedown",t=>{t.preventDefault(),this.isFocused=!1,this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-search-result-click",{detail:{result:e,index:s},bubbles:!0,composed:!0}))}),t.append(i)}),e.append(t)}else{const t=document.createElement("div");t.className="designbase-wc-search-bar__results-empty",t.textContent="검색 결과가 없습니다.",e.append(t)}return this.dropdown.append(e),void this.attachDropdownPortal()}if(this.hasAttribute("enable-recent-searches")&&!t&&this.recentSearches.length>0){const e=document.createElement("div");e.className=`designbase-wc-search-bar__recent-searches designbase-wc-search-bar__recent-searches--${o}`;const t=document.createElement("div");t.className="designbase-wc-search-bar__recent-header";const s=document.createElement("span");s.className="designbase-wc-search-bar__recent-title",s.textContent="최근 검색어";const i=document.createElement("button");i.type="button",i.className="designbase-wc-search-bar__clear-all-button",i.setAttribute("aria-label","모든 최근 검색어 삭제"),i.textContent="전체 삭제",i.addEventListener("mousedown",e=>{e.preventDefault(),this.recentSearches=[];try{localStorage.removeItem(this.getRecentSearchesKey())}catch{}this.updateDropdown()}),t.append(s,i);const n=document.createElement("div");n.className="designbase-wc-search-bar__recent-list",this.recentSearches.forEach(e=>{const t=document.createElement("div");t.className="designbase-wc-search-bar__recent-item";const s=document.createElement("button");s.type="button",s.className="designbase-wc-search-bar__recent-search-button",s.textContent=e,s.addEventListener("mousedown",t=>{if(t.preventDefault(),!this.input)return;this.input.value=e,this.setAttribute("value",e),this.syncValueState(),this.syncPlaceholder(),this.handleSearch(e);const s={value:e};this.dispatchEvent(new CustomEvent("db-input",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:s,bubbles:!0,composed:!0})),this.isFocused=!1,this.updateDropdown()});const i=document.createElement("button");i.type="button",i.className="designbase-wc-search-bar__recent-remove-button",i.setAttribute("aria-label",`${e} 삭제`),i.append(createDbIcon("close",getDbComponentIconSize("s"))),i.addEventListener("mousedown",t=>{t.preventDefault(),this.recentSearches=this.recentSearches.filter(t=>t!==e),this.saveRecentSearches(),this.updateDropdown()}),t.append(s,i),n.append(t)}),e.append(t,n),this.dropdown.append(e)}if(i.length>0&&!t){const e=document.createElement("div");e.className="designbase-wc-search-bar__suggestions";const t=document.createElement("div");t.className="designbase-wc-search-bar__suggestions-header";const s=document.createElement("span");s.className="designbase-wc-search-bar__suggestions-title",s.textContent="추천 검색어",t.append(s);const n=document.createElement("div");n.className="designbase-wc-search-bar__suggestions-list",i.forEach((e,t)=>{const s=document.createElement("button");s.type="button",s.className=["designbase-wc-search-bar__suggestion-item",t===this.currentSuggestion&&"designbase-wc-search-bar__suggestion-item--active"].filter(Boolean).join(" "),s.textContent=e,s.addEventListener("mousedown",t=>{if(t.preventDefault(),!this.input)return;this.clearSuggestionInterval(),this.input.value=e,this.setAttribute("value",e),this.syncValueState(),this.syncPlaceholder(),this.handleSearch(e);const s={value:e};this.dispatchEvent(new CustomEvent("db-input",{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:s,bubbles:!0,composed:!0})),this.isFocused=!1,this.updateDropdown()}),n.append(s)}),e.append(t,n),this.dropdown.append(e)}if(r&&!t&&(!this.hasAttribute("enable-recent-searches")||0===this.recentSearches.length)&&0===i.length){const e=document.createElement("div");e.className="designbase-wc-search-bar__empty-state",e.textContent=r,this.dropdown.append(e)}this.attachDropdownPortal()}render(){const e=this.getAttribute("size")||"m",t=this.hasAttribute("disabled"),s=this.hasAttribute("readonly"),i=this.hasAttribute("full-width"),n=this.hasAttribute("show-shortcut"),a=this.getAttribute("value")??this.getAttribute("default-value")??"",r=Boolean(a.trim()),o=this.getIconPx();this.className=["designbase-wc-search-bar",`designbase-wc-search-bar--${ee.includes(e)?e:"m"}`,"pill"===this.getAttribute("appearance")&&"designbase-wc-search-bar--appearance-pill",t&&"designbase-wc-search-bar--disabled",s&&"designbase-wc-search-bar--readonly",i&&"designbase-wc-search-bar--full-width",r&&"designbase-wc-search-bar--has-value",this.shouldShowDropdown()&&"designbase-wc-search-bar--dropdown-open"].filter(Boolean).join(" "),this.setAttribute("role","search"),this.clearSuggestionInterval(),this.detachDropdownPortal(),this.replaceChildren();const l=document.createElement("div");l.className="designbase-wc-search-bar__container";const d=document.createElement("div");d.className="designbase-wc-search-bar__search-icon",d.setAttribute("aria-hidden","true"),d.append(createDbIcon("search",o));const h=document.createElement("input");if(h.type="text",h.className="designbase-wc-search-bar__input",h.value=a,h.disabled=t,h.readOnly=s,h.setAttribute("aria-label","검색어 입력"),this.input=h,n){const i=document.createElement("db-badge");i.className="designbase-wc-search-bar__shortcut-badge",i.setAttribute("size","l"===e?"m":"s"),i.setAttribute("variant","secondary"),i.setAttribute("type","text"),i.setAttribute("aria-hidden","true"),i.textContent=this.getAttribute("shortcut-label")||"⌘K",i.hidden=r||t||s,this.shortcutBadge=i,l.append(d,h,i)}else l.append(d,h);const u=document.createElement("button");u.type="button",u.className="designbase-wc-search-bar__clear-button",u.setAttribute("aria-label","검색어 지우기"),u.hidden=!r||t||s,u.append(createDbIcon("close",o)),this.clearButton=u,l.append(u);const b=document.createElement("div");b.className="designbase-wc-search-bar__dropdown",b.hidden=!0,b.addEventListener("mousedown",e=>{e.preventDefault()}),this.dropdown=b,h.addEventListener("input",()=>{this.setAttribute("value",h.value),this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),this.syncSuggestionRolling();const e={value:h.value};this.dispatchEvent(new CustomEvent("db-input",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:e,bubbles:!0,composed:!0}))}),h.addEventListener("keydown",e=>{"Enter"===e.key&&this.handleSearch()}),h.addEventListener("focus",()=>{this.isFocused=!0,this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-focus",{bubbles:!0,composed:!0}))}),h.addEventListener("blur",()=>{this.isFocused=!1,this.blurTimer&&clearTimeout(this.blurTimer),this.updateDropdown(),this.dispatchEvent(new CustomEvent("db-blur",{bubbles:!0,composed:!0}))}),u.addEventListener("click",()=>{h.value="",this.setAttribute("value",""),this.syncValueState(),this.syncPlaceholder(),this.updateDropdown(),this.syncSuggestionRolling(),h.focus(),this.dispatchEvent(new CustomEvent("db-clear",{bubbles:!0,composed:!0}));const e={value:""};this.dispatchEvent(new CustomEvent("db-input",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:e,bubbles:!0,composed:!0}))}),this.append(l,b),this.syncIcons(),this.syncPlaceholder(),this.syncSuggestionRolling(),this.bindGlobalShortcut(),this.updateDropdown()}}customElements.get("db-search-bar")||customElements.define("db-search-bar",DbSearchBar);class DbSection extends HTMLElement{constructor(){super(...arguments),this.contentId=dbUid("db-section"),this.internalExpanded=!0,this.internalTabId="",this.handleToggle=()=>{if(!this.isCollapsible())return;const e=!this.isExpanded();this.hasAttribute("expanded")||(this.internalExpanded=e),this.dispatchEvent(new CustomEvent("db-expanded-change",{bubbles:!0,composed:!0,detail:{expanded:e}})),this.hasAttribute("expanded")||(this.syncHostClasses(),this.syncCollapsibleState())},this.handleTabChange=e=>{const t=e.detail,s=t?.id??this.parseTabs()[t?.index??0]?.id??String(t?.index??0);this.internalTabId=s,this.tabsEl?.setAttribute("selected-id",s),this.dispatchEvent(new CustomEvent("db-tab-change",{bubbles:!0,composed:!0,detail:{tabId:s}}))}}static get observedAttributes(){return["title","subtitle","description","size","collapsible","default-expanded","expanded","no-padding","full-width","full-height","overflow-visible","tabs","selected-tab-id","default-selected-tab-id"]}connectedCallback(){this.internalExpanded="false"!==this.getAttribute("default-expanded"),this.syncDefaultTab(),this.ensureStructure(),this.sync(),this.observer=new MutationObserver(()=>this.sync()),this.observer.observe(this,{childList:!0})}disconnectedCallback(){this.observer?.disconnect()}attributeChangedCallback(e){if(this.isConnected){if("default-expanded"!==e||this.hasAttribute("expanded")||(this.internalExpanded="false"!==this.getAttribute("default-expanded")),"default-selected-tab-id"!==e&&"tabs"!==e||this.syncDefaultTab(),"selected-tab-id"===e){const e=this.getAttribute("selected-tab-id");e&&(this.internalTabId=e)}this.sync()}}syncDefaultTab(){if(this.internalTabId)return;const e=this.parseTabs(),t=this.getAttribute("default-selected-tab-id")||"";this.internalTabId=t||e[0]?.id||""}parseTabs(){try{const e=JSON.parse(this.getAttribute("tabs")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}getActiveTabId(){const e=this.getAttribute("selected-tab-id");return e&&this.internalTabId&&e!==this.internalTabId?this.internalTabId:e||this.internalTabId||this.tabsEl?.getAttribute("selected-id")||""}hasHeaderTabs(){return this.parseTabs().length>0&&!this.isCollapsible()}isCollapsible(){return this.hasAttribute("collapsible")}isExpanded(){return!this.isCollapsible()||(this.hasAttribute("expanded")?"false"!==this.getAttribute("expanded"):this.internalExpanded)}isUserNode(e){return!e.hasAttribute("data-wc-internal")}collectSlotted(e){const t=Array.from(this.querySelectorAll(`:scope > [slot="${e}"]`)).filter(this.isUserNode);if(t.length)return t;if("actions"===e&&this.actionsHostEl)return Array.from(this.actionsHostEl.children);if("footer"===e&&this.footerEl)return Array.from(this.footerEl.children);if("header"===e){const e=this.headerEl?.querySelector(".designbase-wc-section__header-main");return e?Array.from(e.children):[]}if("description"===e){const e=this.headerEl?.querySelector(".designbase-wc-section__description"),t=e?.firstElementChild;return t?[t]:[]}return[]}collectContentNodes(){const e=Array.from(this.children).filter(e=>{if(!this.isUserNode(e))return!1;const t=e.getAttribute("slot");return!t||"default"===t});return e.length?e:this.contentEl?Array.from(this.contentEl.children):[]}ensureStructure(){this.headerEl||(this.headerEl=document.createElement("div"),this.headerEl.className="designbase-wc-section__header",this.headerEl.setAttribute("data-wc-internal","")),this.bodyEl||(this.bodyEl=document.createElement("div"),this.bodyEl.className="designbase-wc-section__body",this.bodyEl.id=this.contentId,this.bodyEl.setAttribute("data-wc-internal",""),this.bodyInnerEl=document.createElement("div"),this.bodyInnerEl.className="designbase-wc-section__body-inner",this.bodyInnerEl.setAttribute("data-wc-internal",""),this.bodyEl.append(this.bodyInnerEl)),this.contentEl||(this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-section__content",this.contentEl.setAttribute("data-wc-internal","")),this.footerEl||(this.footerEl=document.createElement("div"),this.footerEl.className="designbase-wc-section__footer",this.footerEl.setAttribute("data-wc-internal","")),this.headerEl.isConnected||this.append(this.headerEl)}mountBody(){const e=this.collectContentNodes(),t=this.collectSlotted("footer");if(this.contentEl.replaceChildren(...e),this.footerEl.replaceChildren(...t),this.footerEl.hidden=0===t.length,this.isCollapsible())return this.bodyInnerEl.replaceChildren(this.contentEl,this.footerEl),void(this.bodyEl.isConnected||this.append(this.bodyEl));this.bodyEl?.remove(),this.contentEl.isConnected||this.append(this.contentEl),t.length?this.footerEl.isConnected||this.append(this.footerEl):this.footerEl.remove()}getChevronSize(){const e=this.getAttribute("size")||"m";return"s"===e?16:"l"===e?24:20}createTitleArea(){const e=this.getAttribute("title"),t=this.getAttribute("subtitle"),s=this.getAttribute("description"),i=this.collectSlotted("description")[0];if(!(e||t||s||i))return null;const n=document.createElement("div");if(n.className="designbase-wc-section__title-area",e){const t=document.createElement("h2");t.className="designbase-wc-section__title",t.textContent=e,n.append(t)}if(t){const e=document.createElement("h3");e.className="designbase-wc-section__subtitle",e.textContent=t,n.append(e)}if(i){const e=document.createElement("p");e.className="designbase-wc-section__description",e.append(i),n.append(e)}else if(s){const e=document.createElement("p");e.className="designbase-wc-section__description",e.textContent=s,n.append(e)}return n}createChevron(){const e=document.createElement("span");return e.className="designbase-wc-section__chevron",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("chevron-down",this.getChevronSize())),e}renderHeader(){if(!this.headerEl)return;const e=this.collectSlotted("header")[0],t=this.collectSlotted("actions"),s=this.createTitleArea(),i=this.hasHeaderTabs(),n=Boolean(e||s||t.length);if(this.headerEl.replaceChildren(),this.headerEl.hidden=!n&&!i,this.headerEl.classList.toggle("designbase-wc-section__header--with-tabs",i),!n&&!i)return;if(this.isCollapsible()){if(e){const t=document.createElement("button");t.type="button",t.className="designbase-wc-section__header-trigger",t.setAttribute("aria-expanded",String(this.isExpanded())),t.setAttribute("aria-controls",this.contentId),t.addEventListener("click",this.handleToggle);const s=document.createElement("div");s.className="designbase-wc-section__header-main",s.append(e),t.append(s,this.createChevron()),this.headerEl.append(t)}else{const e=document.createElement("button");e.type="button",e.className="designbase-wc-section__header-trigger",e.setAttribute("aria-expanded",String(this.isExpanded())),e.setAttribute("aria-controls",this.contentId),e.addEventListener("click",this.handleToggle),s&&e.append(s),e.append(this.createChevron()),this.headerEl.append(e),t.length&&(this.actionsHostEl=document.createElement("div"),this.actionsHostEl.className="designbase-wc-section__actions",this.actionsHostEl.addEventListener("click",e=>e.stopPropagation()),t.forEach(e=>this.actionsHostEl.append(e)),this.headerEl.append(this.actionsHostEl))}return}const appendHeaderMain=i=>{e?i.append(e):(s&&i.append(s),t.length&&(this.actionsHostEl=document.createElement("div"),this.actionsHostEl.className="designbase-wc-section__actions",t.forEach(e=>this.actionsHostEl.append(e)),i.append(this.actionsHostEl)))};if(i){const e=document.createElement("div");e.className="designbase-wc-section__header-row",appendHeaderMain(e),this.headerEl.append(e);const t=document.createElement("div");return t.className="designbase-wc-section__header-tabs",this.tabsEl||(this.tabsEl=document.createElement("db-tabs"),this.tabsEl.setAttribute("size","m"),this.tabsEl.addEventListener("db-change",this.handleTabChange)),this.tabsEl.setAttribute("items",JSON.stringify(this.parseTabs())),this.tabsEl.setAttribute("selected-id",this.getActiveTabId()),t.append(this.tabsEl),void this.headerEl.append(t)}appendHeaderMain(this.headerEl)}syncHostClasses(){const e=this.getAttribute("size")||"m",t=be.includes(e)?e:"m",s=this.isExpanded();this.className=["designbase-wc-section",`designbase-wc-section--size-${t}`,this.hasAttribute("no-padding")&&"designbase-wc-section--no-padding",this.hasHeaderTabs()&&"designbase-wc-section--has-header-tabs",this.hasAttribute("full-width")&&"designbase-wc-section--full-width",this.hasAttribute("full-height")&&"designbase-wc-section--full-height",this.hasAttribute("overflow-visible")&&"designbase-wc-section--overflow-visible",this.isCollapsible()&&"designbase-wc-section--collapsible",this.isCollapsible()&&s&&"designbase-wc-section--expanded",this.isCollapsible()&&!s&&"designbase-wc-section--collapsed"].filter(Boolean).join(" ")}syncCollapsibleState(){if(!this.isCollapsible()||!this.bodyEl)return;const e=this.isExpanded();this.bodyEl.setAttribute("aria-hidden",String(!e));const t=this.headerEl?.querySelector(".designbase-wc-section__header-trigger");t?.setAttribute("aria-expanded",String(e))}sync(){this.ensureStructure(),this.syncHostClasses(),this.renderHeader(),this.mountBody(),this.syncCollapsibleState()}}customElements.get("db-section")||customElements.define("db-section",DbSection);const qe="designbase-wc-segment-control",je={bar:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="12" width="4" height="8"/><rect x="10" y="8" width="4" height="12"/><rect x="17" y="4" width="4" height="16"/></svg>',line:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 16 9 10 14 13 20 6"/></svg>',pie:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v10l8.66 5"/><circle cx="12" cy="12" r="10"/></svg>',donut:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="8"/><circle cx="12" cy="12" r="3"/></svg>',radar:'<svg aria-hidden="true" focusable="false" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 20 8 17 20 7 20 4 8"/></svg>'};class DbSegmentControl extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.indicatorEl=null,this.segmentButtons=[],this.focusedIndex=-1,this.boundKeyDown=e=>this.handleKeyDown(e),this.boundResize=()=>this.updateIndicator(),this.resizeObserver=null}static get observedAttributes(){return["options","value","default-value","size","variant","appearance","full-width","disabled"]}connectedCallback(){this.built||(this.built=!0),this.render(),this.addEventListener("keydown",this.boundKeyDown),window.addEventListener("resize",this.boundResize),this.resizeObserver=new ResizeObserver(()=>this.updateIndicator()),this.resizeObserver.observe(this)}disconnectedCallback(){this.removeEventListener("keydown",this.boundKeyDown),window.removeEventListener("resize",this.boundResize),this.resizeObserver?.disconnect(),this.resizeObserver=null}attributeChangedCallback(e){this.built&&("value"!==e?this.render():this.updateSelection())}get options(){return this.parseOptions(this.getAttribute("options"))}set options(e){const t="string"==typeof e?e:JSON.stringify(e);this.getAttribute("options")!==t&&this.setAttribute("options",t)}get value(){return this.getAttribute("value")||this.getAttribute("default-value")||this.options[0]?.value||""}set value(e){this.setAttribute("value",e)}parseOptions(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}render(){const e=this.getAttribute("size")||"m",t=this.getAttribute("variant")||"default",s=this.getAttribute("appearance")||"default",i=this.hasAttribute("disabled"),n=this.options,a=this.value;this.className=[qe,`${qe}--${e}`,`${qe}--${t}`,"pill"===s&&`${qe}--appearance-pill`,"rounded"===s&&`${qe}--appearance-rounded`,this.hasAttribute("full-width")&&`${qe}--full-width`,i&&`${qe}--disabled`].filter(Boolean).join(" "),this.setAttribute("role","tablist"),this.setAttribute("aria-label","세그먼트 컨트롤"),this.replaceChildren(),this.segmentButtons=[],n.forEach((e,s)=>{const n=e.value===a,r=Boolean(i||e.disabled),o=document.createElement("button");if(o.type="button",o.className=[`${qe}__segment`,n&&`${qe}__segment--selected`,r&&`${qe}__segment--disabled`].filter(Boolean).join(" "),o.setAttribute("role","tab"),o.setAttribute("aria-selected",String(n)),o.setAttribute("aria-disabled",String(r)),o.setAttribute("tabindex",n?"0":"-1"),o.disabled=r,e.icon&&je[e.icon]){const t=document.createElement("span");t.className=`${qe}__segment-icon`,t.innerHTML=je[e.icon],o.appendChild(t)}const l=document.createElement("span");l.className=`${qe}__segment-label`,l.textContent=e.label,"icon-only"===t&&l.setAttribute("aria-label",e.label),o.appendChild(l),o.addEventListener("click",()=>this.select(e.value)),o.addEventListener("focus",()=>{this.focusedIndex=s,o.classList.add(`${qe}__segment--focused`)}),o.addEventListener("blur",()=>{this.focusedIndex=-1,o.classList.remove(`${qe}__segment--focused`)}),this.appendChild(o),this.segmentButtons.push(o)}),this.indicatorEl=document.createElement("div"),this.indicatorEl.className=`${qe}__indicator`,this.appendChild(this.indicatorEl),this.updateSelection()}updateSelection(){const e=this.options,t=this.value,s=e.findIndex(e=>e.value===t);this.segmentButtons.forEach((s,i)=>{const n=e[i],a=n?.value===t;s.classList.toggle(`${qe}__segment--selected`,a),s.setAttribute("aria-selected",String(a)),s.setAttribute("tabindex",a?"0":"-1")}),this.indicatorEl&&e.length>0&&s>=0&&requestAnimationFrame(()=>this.updateIndicator())}updateIndicator(){const e=this.options.findIndex(e=>e.value===this.value),t=this.segmentButtons[e];this.indicatorEl&&t&&(this.indicatorEl.style.width=`${t.offsetWidth}px`,this.indicatorEl.style.transform=`translateX(${t.offsetLeft}px)`)}select(e){if(this.hasAttribute("disabled"))return;const t=this.options.find(t=>t.value===e);t&&!t.disabled&&(this.setAttribute("value",e),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e},bubbles:!0,composed:!0})))}handleKeyDown(e){if(this.hasAttribute("disabled"))return;const t=this.options,s=t.findIndex(e=>e.value===this.value);if(-1===s)return;let i=s;switch(e.key){case"ArrowLeft":e.preventDefault(),i=s>0?s-1:t.length-1;break;case"ArrowRight":e.preventDefault(),i=s<t.length-1?s+1:0;break;case"Home":e.preventDefault(),i=0;break;case"End":e.preventDefault(),i=t.length-1;break;case"Enter":case" ":return e.preventDefault(),void this.select(t[i]?.value??this.value);default:return}for(;i!==s;){const s=t[i];if(s&&!s.disabled){this.segmentButtons[i]?.focus();break}i="ArrowLeft"===e.key||"Home"===e.key?i>0?i-1:t.length-1:i<t.length-1?i+1:0}}}customElements.get("db-segment-control")||customElements.define("db-segment-control",DbSegmentControl);class DbSelect extends HTMLElement{constructor(){super(...arguments),this.internals=this.attachInternals(),this.built=!1,this.searchTerm="",this.focusedIndex=-1,this.handleTriggerClick=()=>{this.hasAttribute("disabled")||this.hasAttribute("readonly")||(this.open=!this.open,this.open&&this.searchable&&setTimeout(()=>this.searchInput?.focus(),0))},this.handleTriggerFocus=()=>{this.trigger?.classList.add("designbase-wc-select__trigger--focused")},this.handleTriggerBlur=()=>{this.trigger?.classList.remove("designbase-wc-select__trigger--focused")},this.handleClear=e=>{e.stopPropagation();const t=[];this.setSelectedValues(t),this.syncTrigger(),this.syncOptions(),this.dispatchChange(t)},this.handleSearchInput=()=>{this.searchTerm=this.searchInput?.value||"",this.focusedIndex=-1,this.syncOptions()},this.handleDocumentMouseDown=e=>{this.contains(e.target)||(this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1,this.syncOptions())},this.handleDocumentKeyDown=e=>{if(!this.contains(document.activeElement))return;if(!this.open)return void("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.open=!0));const t=this.getFilteredOptions();switch(e.key){case"Escape":e.preventDefault(),this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1,this.syncOptions();break;case"ArrowDown":e.preventDefault(),this.focusedIndex=Math.min(this.focusedIndex+1,t.length-1),this.syncOptions();break;case"ArrowUp":e.preventDefault(),this.focusedIndex=Math.max(this.focusedIndex-1,0),this.syncOptions();break;case"Enter":e.preventDefault(),this.focusedIndex>=0&&t[this.focusedIndex]&&this.selectOption(t[this.focusedIndex])}}}static get observedAttributes(){return["options","value","placeholder","label","size","full-width","disabled","readonly","required","error","error-message","helper-text","multiple","searchable","show-clear-button","open","max-height","position","dropdown-width","name"]}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get open(){return this.hasAttribute("open")}set open(e){this.toggleAttribute("open",e),this.syncOpenState()}get value(){return this.getAttribute("value")||""}set value(e){e?this.setAttribute("value",e):this.removeAttribute("value"),this.syncTrigger(),this.syncOptions(),this.syncFormValue()}connectedCallback(){this.built||this.build(),this.syncState(),queueMicrotask(()=>{this.isConnected&&this.syncFormValue()}),document.addEventListener("mousedown",this.handleDocumentMouseDown),document.addEventListener("keydown",this.handleDocumentKeyDown)}formAssociatedCallback(){this.syncFormValue()}disconnectedCallback(){document.removeEventListener("mousedown",this.handleDocumentMouseDown),document.removeEventListener("keydown",this.handleDocumentKeyDown)}formResetCallback(){this.removeAttribute("value"),this.internals.setFormValue(null),this.built&&(this.syncTrigger(),this.syncOptions(),this.syncFormValue())}formDisabledCallback(e){this.toggleAttribute("disabled",e)}attributeChangedCallback(e){if(this.built){if("open"!==e)return"value"===e?(this.syncTrigger(),this.syncOptions(),void this.syncFormValue()):void this.syncState();this.syncOpenState()}}get multiple(){return this.hasAttribute("multiple")}set multiple(e){this.toggleAttribute("multiple",Boolean(e))}get searchable(){return this.hasAttribute("searchable")}set searchable(e){this.toggleAttribute("searchable",Boolean(e))}get showClearButton(){return!this.hasAttribute("show-clear-button")||"false"!==this.getAttribute("show-clear-button")}parseOptions(){const e=this.getAttribute("options")||"[]";try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return e.split(",").map(e=>e.trim()).filter(Boolean).map(e=>({value:e,label:e}))}}parseSelectedValues(){const e=this.getAttribute("value")||"";if(!e)return[];if(this.multiple)try{const t=JSON.parse(e);return Array.isArray(t)?t.map(String):[]}catch{return e.split(",").map(e=>e.trim()).filter(Boolean)}return e?[e]:[]}setSelectedValues(e){this.multiple?e.length?this.setAttribute("value",JSON.stringify(e)):this.removeAttribute("value"):e[0]?this.setAttribute("value",e[0]):this.removeAttribute("value")}syncFormValue(){const e=this.parseSelectedValues();if(this.multiple){const t=new FormData;return e.forEach(e=>t.append(this.name||"select",e)),void this.internals.setFormValue(e.length?t:null)}this.internals.setFormValue(e[0]||null)}getIconSize(){const e=this.getAttribute("size")||"m";return getDbComponentIconSize(Z.includes(e)?e:"m")}syncIndicatorIcons(){const e=this.getIconSize();this.clearButton?.replaceChildren(createDbIcon("close",e)),this.chevronEl&&this.chevronEl.replaceChildren(createDbIcon(this.open?"chevron-up":"chevron-down",e))}build(){const e=this.getAttribute("id")||dbUid("db-select"),t=`${e}-listbox`;this.hasAttribute("id")||this.setAttribute("id",e),this.labelEl=document.createElement("label"),this.labelEl.className="designbase-wc-select__label",this.trigger=document.createElement("div"),this.trigger.className="designbase-wc-select__trigger",this.trigger.tabIndex=0,this.trigger.setAttribute("role","combobox"),this.trigger.setAttribute("aria-haspopup","listbox"),this.trigger.setAttribute("aria-controls",t),this.trigger.addEventListener("click",this.handleTriggerClick),this.trigger.addEventListener("focus",this.handleTriggerFocus),this.trigger.addEventListener("blur",this.handleTriggerBlur),this.valueEl=document.createElement("div"),this.valueEl.className="designbase-wc-select__value",this.indicatorsEl=document.createElement("div"),this.indicatorsEl.className="designbase-wc-select__indicators",this.clearButton=document.createElement("button"),this.clearButton.type="button",this.clearButton.className="designbase-wc-select__clear-button",this.clearButton.setAttribute("aria-label",labelFrom(this,"label-clear","clearAll")),this.clearButton.hidden=!0,this.clearButton.appendChild(createDbIcon("close",this.getIconSize())),this.clearButton.addEventListener("click",this.handleClear),this.chevronEl=document.createElement("div"),this.chevronEl.className="designbase-wc-select__chevron",this.indicatorsEl.append(this.clearButton,this.chevronEl),this.trigger.append(this.valueEl,this.indicatorsEl),this.dropdown=document.createElement("div"),this.dropdown.className="designbase-wc-select__dropdown",this.searchWrap=document.createElement("div"),this.searchWrap.className="designbase-wc-select__search",this.searchWrap.hidden=!0,this.searchInput=document.createElement("input"),this.searchInput.type="text",this.searchInput.className="designbase-wc-select__search-input",this.searchInput.placeholder=labelFrom(this,"label-search","search.label"),this.searchInput.addEventListener("input",this.handleSearchInput),this.searchInput.addEventListener("mousedown",e=>e.stopPropagation()),this.searchInput.addEventListener("click",e=>e.stopPropagation()),this.searchWrap.appendChild(this.searchInput),this.optionsEl=document.createElement("div"),this.optionsEl.className="designbase-wc-select__options",this.optionsEl.id=t,this.optionsEl.setAttribute("role","listbox"),this.dropdown.append(this.searchWrap,this.optionsEl),this.helperEl=document.createElement("p"),this.helperEl.className="designbase-wc-select__helper-text",this.errorEl=document.createElement("p"),this.errorEl.className="designbase-wc-select__error-message",this.append(this.labelEl,this.trigger,this.dropdown,this.helperEl,this.errorEl),this.built=!0}getFilteredOptions(){const e=this.parseOptions();if(!this.searchable||!this.searchTerm)return e;const t=this.searchTerm.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(t))}selectOption(e){if(e.disabled)return;const t=this.parseSelectedValues();let s;this.multiple?s=t.includes(e.value)?t.filter(t=>t!==e.value):[...t,e.value]:(s=[e.value],this.open=!1,this.searchTerm="",this.searchInput&&(this.searchInput.value=""),this.focusedIndex=-1),this.setSelectedValues(s),this.syncTrigger(),this.syncOptions(),this.dispatchChange(s)}dispatchChange(e){const t=this.parseOptions();if(this.multiple)return this.syncFormValue(),this.dispatchEvent(new Event("change",{bubbles:!0})),void this.dispatchEvent(new CustomEvent("db-change",{detail:{value:e,labels:e.map(e=>t.find(t=>t.value===e)?.label||e)},bubbles:!0,composed:!0}));const s=e[0]||"",i=t.find(e=>e.value===s)?.label||"";this.syncFormValue(),this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:s,label:i},bubbles:!0,composed:!0}))}syncAccessibleName(e){if(!this.trigger)return;if(e&&this.labelEl)return this.labelEl.id||(this.labelEl.id=dbUid("db-select-label")),this.trigger.setAttribute("aria-labelledby",this.labelEl.id),void this.trigger.removeAttribute("aria-label");this.trigger.removeAttribute("aria-labelledby");const t=this.getAttribute("aria-label")||this.getAttribute("placeholder")||t$2("select.placeholder");this.trigger.setAttribute("aria-label",t)}syncState(){if(!this.trigger||!this.dropdown||!this.optionsEl)return;const e=coerceToContract(this.getAttribute("size"),Z,"m"),t=coerceToContract(this.getAttribute("position"),X,"bottom"),s="full"===this.getAttribute("dropdown-width")?"full":"auto",i=Number(this.getAttribute("max-height")||200),n=this.getAttribute("label")||"",a=this.getAttribute("helper-text")||"",r=this.getAttribute("error-message")||"",o=this.hasAttribute("error"),l=this.getAttribute("id")||"";this.className=["designbase-wc-select",`designbase-wc-select--${e}`,this.open&&"designbase-wc-select--open",o&&"designbase-wc-select--error",this.hasAttribute("disabled")&&"designbase-wc-select--disabled",this.hasAttribute("readonly")&&"designbase-wc-select--readonly",this.hasAttribute("full-width")&&"designbase-wc-select--full-width",this.multiple&&"designbase-wc-select--multiple",this.searchable&&"designbase-wc-select--searchable"].filter(Boolean).join(" ");const d=this.parseSelectedValues();if(this.classList.toggle("designbase-wc-select--has-value",d.length>0),this.labelEl){const e=this.hasAttribute("required")?'<span class="designbase-wc-select__required" aria-hidden="true">*</span>':"";this.labelEl.innerHTML=n?`${this.escape(n)}${e}`:"",this.labelEl.hidden=!n}this.syncAccessibleName(n),this.dropdown.className=["designbase-wc-select__dropdown",`designbase-wc-select__dropdown--${s}`,`designbase-wc-select__dropdown--${t}`,this.open&&"designbase-wc-select__dropdown--open"].filter(Boolean).join(" "),this.optionsEl.style.maxHeight=`${i}px`,this.searchWrap&&(this.searchWrap.hidden=!this.searchable);const h=`${l}-helper`,u=`${l}-error`;o&&r?(this.errorEl.id=u,this.errorEl.textContent=r,this.errorEl.hidden=!1,this.helperEl.hidden=!0,this.trigger.setAttribute("aria-describedby",u),this.trigger.setAttribute("aria-invalid","true")):a?(this.helperEl.id=h,this.helperEl.textContent=a,this.helperEl.hidden=!1,this.errorEl.hidden=!0,this.trigger.setAttribute("aria-describedby",h),this.trigger.removeAttribute("aria-invalid")):(this.helperEl.hidden=!0,this.errorEl.hidden=!0,this.trigger.removeAttribute("aria-describedby"),this.trigger.removeAttribute("aria-invalid")),this.hasAttribute("disabled")||this.hasAttribute("readonly")?this.trigger.tabIndex=-1:this.trigger.tabIndex=0,this.syncOpenState(),this.syncTrigger(),this.syncOptions(),this.syncFormValue(),this.syncIndicatorIcons()}syncOpenState(){this.trigger&&this.dropdown&&this.chevronEl&&(this.trigger.setAttribute("aria-expanded",String(this.open)),this.classList.toggle("designbase-wc-select--open",this.open),this.dropdown.classList.toggle("designbase-wc-select__dropdown--open",this.open),this.syncIndicatorIcons())}syncTrigger(){if(!this.valueEl||!this.clearButton)return;const e=this.parseOptions(),t=this.parseSelectedValues(),s=this.getAttribute("placeholder")||t$2("select.placeholder"),i=t.length>0,n=i&&this.showClearButton&&!this.hasAttribute("disabled")&&!this.hasAttribute("readonly");if(this.valueEl.replaceChildren(),this.multiple)if(0===t.length){const e=document.createElement("span");e.className="designbase-wc-select__placeholder",e.textContent=s,this.valueEl.appendChild(e)}else{const s=document.createElement("div");s.className="designbase-wc-select__tags",t.forEach(i=>{const n=e.find(e=>e.value===i),a=document.createElement("span");a.className="designbase-wc-select__tag";const r=document.createElement("span");r.className="designbase-wc-select__tag-label",r.textContent=n?.label||i;const o=document.createElement("button");o.type="button",o.className="designbase-wc-select__tag-remove",o.setAttribute("aria-label",`${n?.label||i} 제거`),o.appendChild(createDbIcon("close",12)),o.addEventListener("click",e=>{e.stopPropagation();const s=t.filter(e=>e!==i);this.setSelectedValues(s),this.syncTrigger(),this.syncOptions(),this.dispatchChange(s)}),a.append(r,o),s.appendChild(a)}),this.valueEl.appendChild(s)}else{const n=document.createElement("span");n.className="designbase-wc-select__single-value";const a=e.find(e=>e.value===t[0]);n.textContent=i?a?.label||t[0]:s,i||n.classList.add("designbase-wc-select__placeholder"),this.valueEl.appendChild(n)}this.clearButton.hidden=!n,this.clearButton.setAttribute("aria-hidden",n?"false":"true"),this.classList.toggle("designbase-wc-select--has-value",i)}syncOptions(){if(!this.optionsEl)return;const e=this.getFilteredOptions(),t=this.parseSelectedValues(),s=this.getAttribute("id")||"db-select";if(this.optionsEl.replaceChildren(),0===e.length){const e=document.createElement("div");return e.className="designbase-wc-select__no-options",e.textContent=this.searchTerm?labelFrom(this,"label-no-results","select.noResults"):labelFrom(this,"label-empty","select.noResults"),void this.optionsEl.appendChild(e)}e.forEach((e,i)=>{const n=t.includes(e.value),a=i===this.focusedIndex,r=document.createElement("div");if(r.className=["designbase-wc-select__option",n&&"designbase-wc-select__option--selected",a&&"designbase-wc-select__option--focused",e.disabled&&"designbase-wc-select__option--disabled"].filter(Boolean).join(" "),r.id=`${s}-option-${i}`,r.setAttribute("role","option"),r.setAttribute("aria-selected",String(n)),r.addEventListener("click",()=>this.selectOption(e)),this.multiple){const t=document.createElement("div");t.className="designbase-wc-select__checkbox";const s=document.createElement("db-checkbox");s.setAttribute("size","s"),s.setAttribute("has-label","false"),n&&s.setAttribute("checked",""),e.disabled&&s.setAttribute("disabled",""),t.appendChild(s),r.appendChild(t)}const o=document.createElement("span");o.className="designbase-wc-select__option-label",o.textContent=e.label,r.appendChild(o),this.optionsEl.appendChild(r)}),this.focusedIndex>=0?this.trigger?.setAttribute("aria-activedescendant",`${s}-option-${this.focusedIndex}`):this.trigger?.removeAttribute("aria-activedescendant")}escape(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]||e))}}DbSelect.formAssociated=!0,customElements.get("db-select")||customElements.define("db-select",DbSelect);const Ue="240px";class DbSidebar extends HTMLElement{constructor(){super(...arguments),this.expandedItems=new Set,this.userMenuOpen=!1,this.projectMenuOpen=!1,this.flyoutItemId=null,this.userFlyoutItemId=null,this.flyoutCloseTimer=null,this.userFlyoutCloseTimer=null,this.outsideHandler=null,this.panelMediaQuery=null,this.panelMediaHandler=null,this.resolvedPanelMode="adjacent"}collectCustomNavSlots(){const e=new Map;return we.forEach(t=>{const s=Array.from(this.children).filter(e=>e instanceof HTMLElement&&e.getAttribute("slot")===t),i=Array.from(this.querySelectorAll(`[data-sidebar-slot="${t}"]`)).flatMap(e=>Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.getAttribute("slot")===t));e.set(t,[...new Set([...s,...i])])}),e}createCustomNavSlot(e){const t=document.createElement("div");return t.className=["designbase-wc-sidebar__custom-slot",`designbase-wc-sidebar__custom-slot--${e}`].join(" "),t.dataset.sidebarSlot=e,t}projectCustomNavSlots(e){we.forEach(t=>{const s=this.querySelector(`[data-sidebar-slot="${t}"]`),i=e.get(t)??[];s&&0!==i.length?s.append(...i):s?.remove()})}static get observedAttributes(){return["items","sections","user-menu-items","user-profile","default-expanded-ids","projects","selected-project-id","project-manage-label","project-manage-href","project-section-label","project-empty-label","project-empty-trigger-label","bottom-items","bottom-sections","promo-banner","update-banner","header-type","back-label","back-href","panels","settings-sections","active-panel","panel-mode","panel-width","panel-breakpoint","size","theme","variant","position","collapsed","collapsible","show-logo","logo-type","logo-text","full-height","shadow"]}connectedCallback(){this.seedExpanded(),this.bindPanelMediaQuery(),this.render(),this.bindOutsideClick()}disconnectedCallback(){this.unbindOutsideClick(),this.unbindPanelMediaQuery(),this.cancelFlyoutClose(),this.cancelUserFlyoutClose()}attributeChangedCallback(e,t,s){if(this.isConnected&&t!==s&&("default-expanded-ids"===e&&this.seedExpanded(),"collapsed"===e&&this.hasAttribute("collapsed")&&(this.userMenuOpen=!1,this.projectMenuOpen=!1,this.flyoutItemId=null,this.userFlyoutItemId=null,this.cancelFlyoutClose(),this.cancelUserFlyoutClose()),"panel-mode"!==e&&"panel-breakpoint"!==e||this.bindPanelMediaQuery(),this.render(),"active-panel"===e)){const e=this.getActivePanelConfig();this.dispatchEvent(new CustomEvent("db-panel-change",{bubbles:!0,composed:!0,detail:{panel:e?.id??"main",panelConfig:e,mode:this.resolvedPanelMode}}))}}bindPanelMediaQuery(){this.unbindPanelMediaQuery();const e=this.panelMode;if("auto"!==e)return void(this.resolvedPanelMode=e);if("undefined"==typeof window||"function"!=typeof window.matchMedia)return void(this.resolvedPanelMode="adjacent");const t=window.matchMedia(`(min-width: ${this.panelBreakpoint}px)`);this.panelMediaQuery=t,this.resolvedPanelMode=t.matches?"adjacent":"replace",this.panelMediaHandler=e=>{const t=e.matches?"adjacent":"replace";t!==this.resolvedPanelMode&&(this.resolvedPanelMode=t,this.render(),this.dispatchEvent(new CustomEvent("db-panel-mode-change",{bubbles:!0,composed:!0,detail:{mode:t}})))},t.addEventListener("change",this.panelMediaHandler)}unbindPanelMediaQuery(){this.panelMediaQuery&&this.panelMediaHandler&&this.panelMediaQuery.removeEventListener("change",this.panelMediaHandler),this.panelMediaQuery=null,this.panelMediaHandler=null}seedExpanded(){try{const e=JSON.parse(this.getAttribute("default-expanded-ids")||"[]");Array.isArray(e)&&(this.expandedItems=new Set(e))}catch{this.expandedItems=new Set}}get items(){try{const e=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}get sections(){return this.parseSections()}set sections(e){this.setAttribute("sections","string"==typeof e?e:JSON.stringify(e))}get userMenuItems(){return this.parseUserMenuItems()}set userMenuItems(e){this.setAttribute("user-menu-items","string"==typeof e?e:JSON.stringify(e))}get userProfile(){return this.parseUserProfile()}set userProfile(e){null==e?this.removeAttribute("user-profile"):this.setAttribute("user-profile","string"==typeof e?e:JSON.stringify(e))}get projects(){return this.parseProjects()}set projects(e){this.setAttribute("projects","string"==typeof e?e:JSON.stringify(e))}get selectedProjectId(){return this.getAttribute("selected-project-id")||""}set selectedProjectId(e){e?this.setAttribute("selected-project-id",e):this.removeAttribute("selected-project-id")}get projectManageLabel(){return this.getAttribute("project-manage-label")||"프로젝트 관리"}set projectManageLabel(e){this.setAttribute("project-manage-label",e)}get projectManageHref(){return this.getAttribute("project-manage-href")||""}set projectManageHref(e){e?this.setAttribute("project-manage-href",e):this.removeAttribute("project-manage-href")}get projectSectionLabel(){return this.getAttribute("project-section-label")||"프로젝트"}set projectSectionLabel(e){this.setAttribute("project-section-label",e)}get projectEmptyLabel(){return this.getAttribute("project-empty-label")||"프로젝트를 추가해 주세요"}set projectEmptyLabel(e){this.setAttribute("project-empty-label",e)}get projectEmptyTriggerLabel(){return this.getAttribute("project-empty-trigger-label")||"프로젝트 추가"}set projectEmptyTriggerLabel(e){this.setAttribute("project-empty-trigger-label",e)}get bottomItems(){return this.parseBottomItems()}set bottomItems(e){this.setAttribute("bottom-items","string"==typeof e?e:JSON.stringify(e))}get bottomSections(){return this.parseBottomSections()}set bottomSections(e){this.setAttribute("bottom-sections","string"==typeof e?e:JSON.stringify(e))}get promoBanner(){return this.parsePromoBanner()}set promoBanner(e){null==e?this.removeAttribute("promo-banner"):this.setAttribute("promo-banner","string"==typeof e?e:JSON.stringify(e))}get updateBanner(){return this.parseUpdateBanner()}set updateBanner(e){null==e?this.removeAttribute("update-banner"):this.setAttribute("update-banner","string"==typeof e?e:JSON.stringify(e))}get headerType(){return"back"===this.getAttribute("header-type")?"back":"default"}set headerType(e){this.setAttribute("header-type",e)}get backLabel(){return this.getAttribute("back-label")||"뒤로가기"}set backLabel(e){this.setAttribute("back-label",e)}get backHref(){return this.getAttribute("back-href")||""}set backHref(e){e?this.setAttribute("back-href",e):this.removeAttribute("back-href")}get panels(){return this.parsePanels()}set panels(e){this.setAttribute("panels","string"==typeof e?e:JSON.stringify(e))}get settingsSections(){return this.parseSettingsSections()}set settingsSections(e){this.setAttribute("settings-sections","string"==typeof e?e:JSON.stringify(e))}get activePanel(){const e=this.getAttribute("active-panel")||"main";return"main"===e?"main":this.findPanel(e)?e:"main"}set activePanel(e){const t=e&&"main"!==e&&this.findPanel(e)?e:"main";this.setAttribute("active-panel",t)}get panelMode(){const e=this.getAttribute("panel-mode")||"auto";return ve.includes(e)?e:"auto"}set panelMode(e){this.setAttribute("panel-mode",ve.includes(e)?e:"auto")}get panelWidth(){return this.normalizeCssLength(this.getAttribute("panel-width")||Ue)}set panelWidth(e){this.setAttribute("panel-width",this.normalizeCssLength(e))}get panelBreakpoint(){const e=Number(this.getAttribute("panel-breakpoint"));return Number.isFinite(e)&&e>0?e:1024}set panelBreakpoint(e){const t=Number.isFinite(e)&&e>0?Math.round(e):1024;this.setAttribute("panel-breakpoint",String(t))}normalizeCssLength(e){if("number"==typeof e)return`${Math.max(0,e)}px`;const t=String(e??"").trim();return t?/^-?\d+(?:\.\d+)?$/.test(t)?`${Math.max(0,Number(t))}px`:t:Ue}parseSettingsSections(){try{const e=JSON.parse(this.getAttribute("settings-sections")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parsePanels(){let e=[];const t=this.getAttribute("panels");if(t)try{const s=JSON.parse(t);Array.isArray(s)&&(e=s.filter(e=>Boolean(e&&"string"==typeof e.id&&e.id.trim())).map(e=>({...e,id:e.id.trim(),title:String(e.title||e.id).trim(),sections:Array.isArray(e.sections)?e.sections:[]})))}catch{e=[]}const s=this.parseSettingsSections();return s.length&&!e.some(e=>"settings"===e.id)&&e.push({id:"settings",title:"Settings",backLabel:this.backLabel,sections:s}),e}hasPanels(){return this.parsePanels().length>0}findPanel(e){return e&&"main"!==e?this.parsePanels().find(t=>t.id===e)??null:null}getActivePanelConfig(){return this.findPanel(this.getAttribute("active-panel")||"main")}parseSections(){const e=this.getAttribute("sections");if(e)try{const t=JSON.parse(e);if(Array.isArray(t)&&t.length)return t}catch{}try{const e=JSON.parse(this.getAttribute("items")||"[]");return[{id:"main",items:Array.isArray(e)?e:[]}]}catch{return[{id:"main",items:[]}]}}parseUserMenuItems(){try{const e=JSON.parse(this.getAttribute("user-menu-items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseUserProfile(){const e=this.getAttribute("user-profile");if(!e)return null;try{return JSON.parse(e)}catch{return null}}parseProjects(){try{const e=JSON.parse(this.getAttribute("projects")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseBottomItems(){try{const e=JSON.parse(this.getAttribute("bottom-items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseBottomSections(){const e=this.getAttribute("bottom-sections");if(e)try{const t=JSON.parse(e);if(Array.isArray(t)&&t.length)return t}catch{}const t=this.parseBottomItems();return t.length?[{id:"bottom",items:t}]:[]}parsePromoBanner(){const e=this.getAttribute("promo-banner");if(!e)return null;try{return JSON.parse(e)}catch{return null}}parseUpdateBanner(){const e=this.getAttribute("update-banner");if(!e)return null;try{return JSON.parse(e)}catch{return null}}getSelectedProject(){const e=this.parseProjects();if(!e.length)return null;const t=this.selectedProjectId;return e.find(e=>e.id===t)||e[0]}bindOutsideClick(){this.outsideHandler||(this.outsideHandler=e=>{const t=e.target;if(this.contains(t))return;let s=!1;this.userMenuOpen&&(this.userMenuOpen=!1,this.userFlyoutItemId=null,s=!0),this.projectMenuOpen&&(this.projectMenuOpen=!1,s=!0),s&&this.render()},document.addEventListener("mousedown",this.outsideHandler))}closeOverlayMenus(){const e=this.projectMenuOpen,t=this.userMenuOpen;if(!e&&!t)return!1;this.projectMenuOpen=!1,this.userMenuOpen=!1,this.userFlyoutItemId=null,this.cancelUserFlyoutClose(),this.classList.remove("designbase-wc-sidebar--user-menu-open"),this.querySelector(".designbase-wc-sidebar__project-dropdown")?.remove(),this.querySelector(".designbase-wc-sidebar__project-selector")?.classList.remove("designbase-wc-sidebar__project-selector--open");const s=this.querySelector(".designbase-wc-sidebar__project-trigger");s?.setAttribute("aria-expanded","false");const i=this.querySelector(".designbase-wc-sidebar__user-dropdown");return i&&(i.hidden=!0),this.querySelector(".designbase-wc-sidebar__user-info")?.setAttribute("aria-expanded","false"),this.querySelector(".designbase-wc-sidebar__user-collapsed")?.setAttribute("aria-expanded","false"),this.querySelector(".designbase-wc-sidebar__user-collapsed")?.classList.remove("designbase-wc-sidebar__user-collapsed--open"),!0}syncExclusiveAccordion(e){[...Array.from(this.querySelectorAll(".designbase-wc-sidebar__nav-list > .designbase-wc-sidebar__item > db-menu-item")),...Array.from(this.querySelectorAll(".designbase-wc-sidebar__bottom-nav .designbase-wc-sidebar__nav-list > .designbase-wc-sidebar__item > db-menu-item"))].forEach(t=>{const s=t.getAttribute("data-item-id");s&&(e&&s===e?t.setAttribute("expanded",""):t.removeAttribute("expanded"))})}unbindOutsideClick(){this.outsideHandler&&(document.removeEventListener("mousedown",this.outsideHandler),this.outsideHandler=null)}cancelFlyoutClose(){this.flyoutCloseTimer&&(clearTimeout(this.flyoutCloseTimer),this.flyoutCloseTimer=null)}showFlyout(e){this.cancelFlyoutClose(),this.flyoutItemId!==e&&(this.flyoutItemId=e,this.renderNav(),this.renderBottomNav())}scheduleFlyoutClose(){this.cancelFlyoutClose(),this.flyoutCloseTimer=setTimeout(()=>{this.flyoutCloseTimer=null,this.flyoutItemId=null,this.renderNav(),this.renderBottomNav()},120)}cancelUserFlyoutClose(){this.userFlyoutCloseTimer&&(clearTimeout(this.userFlyoutCloseTimer),this.userFlyoutCloseTimer=null)}setUserFlyout(e){this.cancelUserFlyoutClose(),this.userFlyoutItemId=e,this.querySelectorAll(".designbase-wc-sidebar__user-menu-item").forEach(t=>{const s=Boolean(e&&t.dataset.itemId===e);t.classList.toggle("designbase-wc-sidebar__user-menu-item--flyout-active",s),t.querySelector(".designbase-wc-sidebar__user-menu-trigger")?.setAttribute("aria-expanded",String(s));const i=t.querySelector(".designbase-wc-sidebar__user-flyout");i&&(i.hidden=!s)})}scheduleUserFlyoutClose(){this.cancelUserFlyoutClose(),this.userFlyoutCloseTimer=setTimeout(()=>{this.userFlyoutCloseTimer=null,this.setUserFlyout(null)},120)}syncHostClasses(){const e=this.getAttribute("size")||"m",t=this.getAttribute("theme")||"default",s=this.getAttribute("variant")||"default",i=this.getAttribute("position")||"left",n=this.getActivePanelConfig(),a=Boolean(n),r=this.panelWidth;this.style.setProperty("--db-sidebar-panel-width",r),this.className=["designbase-wc-sidebar",`designbase-wc-sidebar--${pe.includes(e)?e:"m"}`,`designbase-wc-sidebar--${me.includes(t)?t:"default"}`,`designbase-wc-sidebar--${fe.includes(i)?i:"left"}`,`designbase-wc-sidebar--panel-${this.resolvedPanelMode}`,ge.includes(s)&&"wrapper"===s&&"designbase-wc-sidebar--wrapper",this.hasAttribute("collapsed")&&"designbase-wc-sidebar--collapsed",this.hasAttribute("full-height")&&"designbase-wc-sidebar--full-height",this.hasAttribute("shadow")&&"designbase-wc-sidebar--shadow",this.userMenuOpen&&"designbase-wc-sidebar--user-menu-open",("back"===this.headerType||a&&"replace"===this.resolvedPanelMode)&&"designbase-wc-sidebar--header-back",a&&"designbase-wc-sidebar--panel-open",this.hasPanels()&&"designbase-wc-sidebar--has-panels"].filter(Boolean).join(" ")}navigateToPanel(e){const t="main"!==e&&e?this.findPanel(e)?.id:"main";t&&this.activePanel!==t&&("main"!==t&&"replace"===this.resolvedPanelMode&&this.hasAttribute("collapsed")&&this.removeAttribute("collapsed"),this.setAttribute("active-panel",t))}dispatchItemClick(e){this.dispatchEvent(new CustomEvent("db-item-click",{bubbles:!0,composed:!0,detail:{item:e}}))}dispatchUserMenuItemClick(e){this.dispatchEvent(new CustomEvent("db-user-menu-item-click",{bubbles:!0,composed:!0,detail:{item:e}}))}dispatchBackClick(){const e=this.getActivePanelConfig();e&&this.navigateToPanel("main");const t=new CustomEvent("db-back-click",{bubbles:!0,composed:!0,cancelable:!0,detail:{label:e?.backLabel||this.backLabel,href:this.backHref,panel:e}});this.dispatchEvent(t),t.defaultPrevented||e||!this.backHref||"back"!==this.headerType||window.location.assign(this.backHref)}dispatchProjectChange(e){this.dispatchEvent(new CustomEvent("db-project-change",{bubbles:!0,composed:!0,detail:{project:e}}))}dispatchProjectManage(){this.dispatchEvent(new CustomEvent("db-project-manage",{bubbles:!0,composed:!0,detail:{}}))}dispatchPromoCtaClick(e){this.dispatchEvent(new CustomEvent("db-promo-cta-click",{bubbles:!0,composed:!0,detail:{banner:e}}))}dispatchUpdateCtaClick(e){this.dispatchEvent(new CustomEvent("db-update-cta-click",{bubbles:!0,composed:!0,detail:{banner:e}}))}createProjectAvatar(e,t="s"){const s=document.createElement("db-avatar");if(s.className="designbase-wc-sidebar__project-avatar",s.setAttribute("size",t),s.setAttribute("initials",(e.label||"?").trim()),s.setAttribute("alt",e.label),e.color){const applyColor=()=>{const t=s.querySelector(".designbase-wc-avatar__initials");return!!t&&(t.style.backgroundColor=e.color,t.style.color="#fff",!0)},t=new MutationObserver(()=>{applyColor()&&t.disconnect()});t.observe(s,{childList:!0,subtree:!0}),queueMicrotask(()=>{applyColor()&&t.disconnect()})}return s}createProjectEmptyMark(e="s"){const t=document.createElement("span");return t.className=["designbase-wc-sidebar__project-mark",`designbase-wc-sidebar__project-mark--${e}`,"designbase-wc-sidebar__project-mark--empty"].join(" "),t.setAttribute("aria-hidden","true"),t.append(createDbIcon("plus","m"===e?16:14)),t}createProjectBadge(e){if(!e.badge)return null;const t=document.createElement("db-badge");return t.className="designbase-wc-sidebar__project-badge",t.setAttribute("size","s"),t.setAttribute("variant",e.badgeColor||"warning"),t.setAttribute("type","text"),t.textContent=e.badge,t}createProjectSelector(e){if(!this.hasAttribute("projects"))return null;const t=this.parseProjects(),s=0===t.length,i=this.getSelectedProject(),n=document.createElement("div");n.className=["designbase-wc-sidebar__project-selector",e&&"designbase-wc-sidebar__project-selector--collapsed",this.projectMenuOpen&&"designbase-wc-sidebar__project-selector--open",s&&"designbase-wc-sidebar__project-selector--empty"].filter(Boolean).join(" ");const a=this.getAttribute("project-section-label");if(!e&&a&&a.trim()){const e=document.createElement("div");e.className="designbase-wc-sidebar__project-section-label",e.textContent=a.trim(),n.append(e)}const r=document.createElement("button");if(r.type="button",r.className="designbase-wc-sidebar__project-trigger",r.setAttribute("aria-haspopup","menu"),r.setAttribute("aria-expanded",String(this.projectMenuOpen)),s||!i){if(r.setAttribute("aria-label",this.projectEmptyTriggerLabel),r.append(this.createProjectEmptyMark(e?"m":"s")),!e){const e=document.createElement("span");e.className="designbase-wc-sidebar__project-label",e.textContent=this.projectEmptyTriggerLabel,r.append(e)}}else if(r.setAttribute("aria-label",i.label),r.append(this.createProjectAvatar(i,e?"m":"s")),!e){const e=document.createElement("span");e.className="designbase-wc-sidebar__project-label",e.textContent=i.label,r.append(e)}const o=document.createElement("span");if(o.className="designbase-wc-sidebar__project-chevron",o.setAttribute("aria-hidden","true"),o.append(createDbIcon("chevron-down",14)),r.append(o),r.addEventListener("click",()=>{this.projectMenuOpen=!this.projectMenuOpen,this.userMenuOpen=!1,this.render()}),n.append(r),this.projectMenuOpen){const e=document.createElement("div");if(e.className="designbase-wc-sidebar__project-dropdown",e.setAttribute("role","menu"),e.setAttribute("aria-label",this.projectSectionLabel),s){const t=document.createElement("div");t.className="designbase-wc-sidebar__project-empty",t.setAttribute("role","presentation");const s=document.createElement("p");s.className="designbase-wc-sidebar__project-empty-text",s.textContent=this.projectEmptyLabel,t.append(s),e.append(t)}else{const s=document.createElement("ul");s.className="designbase-wc-sidebar__project-list",t.forEach(e=>{const t=document.createElement("li");t.className="designbase-wc-sidebar__project-option";const n=document.createElement("button");n.type="button",n.className=["designbase-wc-sidebar__project-option-btn",i&&e.id===i.id&&"designbase-wc-sidebar__project-option-btn--active"].filter(Boolean).join(" "),n.setAttribute("role","menuitem"),n.append(this.createProjectAvatar(e,"s"));const a=document.createElement("span");a.className="designbase-wc-sidebar__project-option-label",a.textContent=e.label,n.append(a);const r=this.createProjectBadge(e);r&&n.append(r),n.addEventListener("click",()=>{this.projectMenuOpen=!1,this.setAttribute("selected-project-id",e.id),this.dispatchProjectChange(e),this.render()}),t.append(n),s.append(t)}),e.append(s)}const a=document.createElement("button");a.type="button",a.className="designbase-wc-sidebar__project-manage",a.setAttribute("role","menuitem"),a.append(createDbIcon("plus",14));const r=document.createElement("span");r.textContent=this.projectManageLabel,a.append(r),a.addEventListener("click",()=>{this.projectMenuOpen=!1;const e=this.projectManageHref;e&&window.location.assign(e),this.dispatchProjectManage(),this.render()}),e.append(a),n.append(e)}return n}createFlyout(e,t){const s=this.getAttribute("position")||"left",i=document.createElement("div");i.className=["designbase-wc-sidebar__flyout","right"===s&&"designbase-wc-sidebar__flyout--align-left"].filter(Boolean).join(" "),i.setAttribute("role","menu"),i.setAttribute("aria-label",`${e.label} 하위 메뉴`),i.addEventListener("mouseenter",()=>this.cancelFlyoutClose()),i.addEventListener("mouseleave",()=>this.scheduleFlyoutClose());const n=document.createElement("div");n.className="designbase-wc-sidebar__flyout-title",n.textContent=e.label,i.append(n);const a=document.createElement("ul");return a.className="designbase-wc-sidebar__flyout-list",(e.children||[]).forEach(e=>{const s=document.createElement("li");s.className="designbase-wc-sidebar__flyout-item";const i=document.createElement("db-menu-item");i.setAttribute("label",e.label),i.setAttribute("type","block"),i.setAttribute("menu-style","dropdown"),i.setAttribute("size",t),e.href&&i.setAttribute("href",e.href),e.active&&i.setAttribute("active",""),e.disabled&&i.setAttribute("disabled",""),void 0!==e.badge&&i.setAttribute("badge",String(e.badge)),e.badgeColor&&i.setAttribute("badge-color",e.badgeColor),i.addEventListener("db-click",()=>{e.disabled||(this.flyoutItemId=null,this.dispatchItemClick(e),this.renderNav(),this.renderBottomNav())}),s.append(i),a.append(s)}),i.append(a),i}createSidebarMenuItem(e,t,s=0){const i=Boolean(e.children?.length),n=this.expandedItems.has(e.id),a=this.hasAttribute("collapsed"),r=a&&i,o=document.createElement("li");o.className=["designbase-wc-sidebar__item",r&&this.flyoutItemId===e.id&&"designbase-wc-sidebar__item--flyout-active"].filter(Boolean).join(" "),r&&(o.addEventListener("mouseenter",()=>this.showFlyout(e.id)),o.addEventListener("mouseleave",()=>this.scheduleFlyoutClose()));const l=document.createElement("db-menu-item");if(l.setAttribute("data-item-id",e.id),l.setAttribute("label",e.label),l.setAttribute("type","block"),l.setAttribute("menu-style","accordion"),l.setAttribute("size",t),l.setAttribute("depth",String(s)),e.href&&l.setAttribute("href",e.href),e.icon&&l.setAttribute("icon",e.icon),(e.active||e.openPanel&&e.openPanel===this.activePanel)&&l.setAttribute("active",""),e.disabled&&l.setAttribute("disabled",""),void 0!==e.badge&&l.setAttribute("badge",String(e.badge)),e.badgeColor&&l.setAttribute("badge-color",e.badgeColor),i&&!r&&(l.setAttribute("expandable",""),l.subItems=(e.children||[]).map(e=>({id:e.id,label:e.label,href:e.href,active:e.active,disabled:e.disabled,badge:e.badge,badgeColor:e.badgeColor})),n&&!a&&l.setAttribute("expanded","")),l.addEventListener("db-click",t=>{if(!e.disabled){if(i&&!a){const s=t.detail?.expanded??!this.expandedItems.has(e.id);return this.closeOverlayMenus(),void(s?(this.expandedItems.clear(),this.expandedItems.add(e.id),this.syncExclusiveAccordion(e.id)):(this.expandedItems.delete(e.id),this.syncExclusiveAccordion(null)))}if(r)return this.closeOverlayMenus(),void this.showFlyout(e.id);if(this.closeOverlayMenus(),e.openPanel&&this.findPanel(e.openPanel))return this.dispatchItemClick(e),void this.navigateToPanel(e.openPanel);this.dispatchItemClick(e)}}),l.addEventListener("db-child-click",e=>{const t=e.detail;this.dispatchItemClick(t.child)}),o.append(l),a&&void 0!==e.badge&&null!==e.badge&&""!==e.badge){const t=e.badgeColor||"primary",s=document.createElement("span");s.className=["designbase-wc-sidebar__collapsed-badge-dot",`designbase-wc-sidebar__collapsed-badge-dot--${t}`].join(" "),s.setAttribute("aria-hidden","true"),o.append(s)}if(a&&!i){const t=document.createElement("span");t.className="designbase-wc-sidebar__item-tooltip",t.textContent=e.label,t.setAttribute("role","tooltip"),o.append(t)}return r&&this.flyoutItemId===e.id&&o.append(this.createFlyout(e,t)),o}renderSectionList(e,t,s){const i=document.createDocumentFragment();return e.forEach(e=>{const n=document.createElement("div");if(n.className=["designbase-wc-sidebar__section",e.gap&&`designbase-wc-sidebar__section--gap-${e.gap}`].filter(Boolean).join(" "),!s&&e.title){const t=document.createElement("div");t.className="designbase-wc-sidebar__section-title",t.textContent=e.title,n.append(t)}const a=document.createElement("ul");a.className="designbase-wc-sidebar__nav-list",e.items.forEach(e=>a.append(this.createSidebarMenuItem(e,t))),n.append(a),i.append(n)}),i}renderNav(){const e=this.getAttribute("size")||"m",t=this.hasAttribute("collapsed"),s=this.querySelector('.designbase-wc-sidebar__nav[data-panel-nav="main"]');s&&s.replaceChildren(this.renderSectionList(this.parseSections(),e,t),this.createCustomNavSlot("nav"));const i=this.getActivePanelConfig(),n=this.querySelector('.designbase-wc-sidebar__nav[data-panel-nav="panel"]');n&&i&&n.replaceChildren(this.renderSectionList(i.sections,e,!1))}renderBottomNav(){const e=this.querySelector(".designbase-wc-sidebar__bottom-nav");if(!e)return;const t=this.getAttribute("size")||"m",s=this.hasAttribute("collapsed");e.replaceChildren(this.renderSectionList(this.parseBottomSections(),t,s))}createUserDropdown(e,t=!1){if(!e.length)return null;const s=this.getAttribute("position")||"left",i=document.createElement("div");i.className=["designbase-wc-sidebar__user-dropdown",t&&"designbase-wc-sidebar__user-dropdown--collapsed"].filter(Boolean).join(" "),i.setAttribute("role","menu"),i.setAttribute("aria-label","사용자 메뉴"),i.hidden=!this.userMenuOpen,i.addEventListener("keydown",e=>{"Escape"===e.key&&(e.stopPropagation(),this.userFlyoutItemId?this.setUserFlyout(null):(this.userMenuOpen=!1,this.render()))});const n=document.createElement("ul");return n.className="designbase-wc-sidebar__user-menu",e.forEach(e=>{const t=Boolean(e.children?.length),i=document.createElement("li");i.dataset.itemId=e.id,i.className=["designbase-wc-sidebar__user-menu-item",e.dividerBefore&&"designbase-wc-sidebar__user-menu-item--divider",e.disabled&&"designbase-wc-sidebar__user-menu-item--disabled",t&&"designbase-wc-sidebar__user-menu-item--has-children"].filter(Boolean).join(" ");const a=document.createElement("button");if(a.type="button",a.className="designbase-wc-sidebar__user-menu-trigger",a.setAttribute("role","menuitem"),a.disabled=Boolean(e.disabled),e.icon&&isDbIconName(e.icon)){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-menu-icon",t.setAttribute("aria-hidden","true"),t.append(createDbIcon(e.icon,16)),a.append(t)}const r=document.createElement("span");if(r.className="designbase-wc-sidebar__user-menu-label",r.textContent=e.label,a.append(r),e.value){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-menu-value",t.textContent=e.value,a.append(t)}if(t){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-menu-chevron",t.setAttribute("aria-hidden","true"),t.append(createDbIcon("right"===s?"chevron-left":"chevron-right",16)),a.append(t),a.setAttribute("aria-haspopup","menu"),a.setAttribute("aria-expanded",String(this.userFlyoutItemId===e.id));const openFlyout=()=>this.setUserFlyout(e.id);i.addEventListener("mouseenter",openFlyout),i.addEventListener("mouseleave",()=>this.scheduleUserFlyoutClose()),i.addEventListener("focusin",openFlyout),i.addEventListener("focusout",e=>{const t=e.relatedTarget;t&&i.contains(t)||this.scheduleUserFlyoutClose()}),a.addEventListener("click",openFlyout);const n=document.createElement("div");n.className=["designbase-wc-sidebar__user-flyout","right"===s&&"designbase-wc-sidebar__user-flyout--align-left"].filter(Boolean).join(" "),n.setAttribute("role","menu"),n.setAttribute("aria-label",`${e.label} 하위 메뉴`),n.hidden=this.userFlyoutItemId!==e.id,n.addEventListener("mouseenter",()=>this.cancelUserFlyoutClose()),n.addEventListener("mouseleave",()=>this.scheduleUserFlyoutClose());const r=document.createElement("ul");r.className="designbase-wc-sidebar__user-flyout-list",(e.children||[]).forEach(e=>{const t=document.createElement("li");t.className="designbase-wc-sidebar__user-flyout-item";const s=document.createElement("button");if(s.type="button",s.className=["designbase-wc-sidebar__user-menu-trigger","designbase-wc-sidebar__user-flyout-trigger",e.selected&&"designbase-wc-sidebar__user-flyout-trigger--selected"].filter(Boolean).join(" "),s.setAttribute("role","menuitemradio"),s.setAttribute("aria-checked",String(Boolean(e.selected))),s.disabled=Boolean(e.disabled),e.icon&&isDbIconName(e.icon)){const t=document.createElement("span");t.className="designbase-wc-sidebar__user-menu-icon",t.setAttribute("aria-hidden","true"),t.append(createDbIcon(e.icon,16)),s.append(t)}const i=document.createElement("span");if(i.className="designbase-wc-sidebar__user-menu-label",i.textContent=e.label,s.append(i),e.selected){const e=document.createElement("span");e.className="designbase-wc-sidebar__user-menu-check",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("done",16)),s.append(e)}s.addEventListener("click",()=>{e.disabled||(this.userFlyoutItemId=null,this.userMenuOpen=!1,this.dispatchUserMenuItemClick(e),e.href&&window.location.assign(e.href),this.render())}),t.append(s),r.append(t)}),n.append(r),i.append(a,n)}else a.addEventListener("click",()=>{e.disabled||(this.userFlyoutItemId=null,this.userMenuOpen=!1,this.dispatchUserMenuItemClick(e),e.href&&window.location.assign(e.href),this.render())}),i.append(a);n.append(i)}),i.append(n),i}createUpdateBanner(e){if("back"===this.headerType)return null;const t=this.parseUpdateBanner();if(!t)return null;if(e)return null;const s=document.createElement("div");s.className="designbase-wc-sidebar__update";const i=document.createElement("db-banner");return i.className="designbase-wc-sidebar__update-banner",i.setAttribute("size","s"),i.setAttribute("variant",t.variant||"outline"),i.setAttribute("title",t.title),t.description&&i.setAttribute("description",t.description),t.icon&&i.setAttribute("icon",t.icon),i.setAttribute("clickable",""),i.setAttribute("aria-label",t.ctaLabel||t.title),i.addEventListener("db-click",()=>{t.ctaHref&&window.location.assign(t.ctaHref),this.dispatchUpdateCtaClick(t)}),s.append(i),s}createPromoBanner(e){if("back"===this.headerType)return null;const t=this.parsePromoBanner();if(!t)return null;if(e){const e=document.createElement("button");e.type="button",e.className="designbase-wc-sidebar__promo-collapsed",e.setAttribute("aria-label",t.ctaLabel||t.title);const s=document.createElement("db-animation-background");s.className="designbase-wc-sidebar__promo-bg",s.setAttribute("type","aurora"),s.setAttribute("theme","light"),s.setAttribute("intensity","subtle"),s.setAttribute("blur","40"),s.setAttribute("speed","4000"),s.setAttribute("colors",JSON.stringify(["#c7d2fe","#ddd6fe","#fbcfe8"])),e.append(s),e.append(createDbIcon(t.icon&&isDbIconName(t.icon)?t.icon:"sparkle",18)),e.addEventListener("click",()=>this.dispatchPromoCtaClick(t));const i=document.createElement("span");i.className="designbase-wc-sidebar__item-tooltip",i.textContent=t.title,i.setAttribute("role","tooltip");const n=document.createElement("div");return n.className="designbase-wc-sidebar__promo-collapsed-wrap",n.append(e,i),n}const s=document.createElement("div");s.className="designbase-wc-sidebar__promo";const i=document.createElement("db-animation-background");i.className="designbase-wc-sidebar__promo-bg",i.setAttribute("type","aurora"),i.setAttribute("theme","light"),i.setAttribute("intensity","subtle"),i.setAttribute("blur","60"),i.setAttribute("speed","5000"),i.setAttribute("colors",JSON.stringify(["#c7d2fe","#ddd6fe","#fbcfe8","#bfdbfe"])),s.append(i);const n=document.createElement("div");n.className="designbase-wc-sidebar__promo-content";const a=document.createElement("div");a.className="designbase-wc-sidebar__promo-title-row";const r=document.createElement("span");r.className="designbase-wc-sidebar__promo-icon",r.setAttribute("aria-hidden","true"),r.append(createDbIcon(t.icon&&isDbIconName(t.icon)?t.icon:"sparkle",16));const o=document.createElement("div");if(o.className="designbase-wc-sidebar__promo-title",o.textContent=t.title,a.append(r,o),n.append(a),t.description){const e=document.createElement("div");e.className="designbase-wc-sidebar__promo-desc",e.textContent=t.description,n.append(e)}if(t.ctaLabel){const e=document.createElement("db-button");e.className="designbase-wc-sidebar__promo-action",e.setAttribute("variant","secondary"),e.setAttribute("size","s"),e.setAttribute("full-width",""),e.textContent=t.ctaLabel,e.addEventListener("db-click",()=>{t.ctaHref&&window.location.assign(t.ctaHref),this.dispatchPromoCtaClick(t)}),n.append(e)}return s.append(n),s}createMainHeader(e){const{size:t,collapsible:s,showLogo:i,collapsed:n}=e,a="back"===this.headerType,r="l"===t?"m":"s"===t?"xs":"s";if(!a&&!s&&(!i||n))return null;const o=document.createElement("div");if(o.className=["designbase-wc-sidebar__header",(n||!i)&&!a&&"designbase-wc-sidebar__header--collapsed-only",a&&"designbase-wc-sidebar__header--back"].filter(Boolean).join(" "),a){const e=document.createElement("button");if(e.type="button",e.className=["designbase-wc-sidebar__back",n&&"designbase-wc-sidebar__back--collapsed"].filter(Boolean).join(" "),e.setAttribute("aria-label",this.backLabel),e.append(createDbIcon("chevron-left",18)),!n){const t=document.createElement("span");t.textContent=this.backLabel,e.append(t)}e.addEventListener("click",()=>this.dispatchBackClick()),o.append(e)}else if(!n&&i){const e=document.createElement("div");e.className="designbase-wc-sidebar__logo";const t=this.getAttribute("logo-type")||"designbase",s=this.getAttribute("logo-text")||"";if("custom"===t&&s){const t=document.createElement("span");t.className="designbase-wc-sidebar__logo-text",t.textContent=s,e.append(t)}else{const i=document.createElement("db-logo");i.setAttribute("type",t),i.setAttribute("size",r),s&&i.setAttribute("text",s),e.append(i)}e.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-logo-click",{bubbles:!0,composed:!0}))}),o.append(e)}if(s&&!a){const e=document.createElement("db-button");e.className="designbase-wc-sidebar__toggle",e.setAttribute("variant","tertiary"),e.setAttribute("size","s"),e.setAttribute("icon-only",""),e.setAttribute("start-icon",n?"arrow-bar-right":"arrow-bar-left"),e.setAttribute("aria-label",n?"사이드바 펼치기":"사이드바 접기"),e.addEventListener("db-click",()=>{const e=!this.hasAttribute("collapsed");e?this.setAttribute("collapsed",""):this.removeAttribute("collapsed"),this.dispatchEvent(new CustomEvent("db-toggle",{bubbles:!0,composed:!0,detail:{collapsed:e}}))}),o.append(e)}return o}createPanelHeader(e){const t="replace"===this.resolvedPanelMode,s=document.createElement("div");if(s.className=["designbase-wc-sidebar__panel-header",t&&"designbase-wc-sidebar__panel-header--replace"].filter(Boolean).join(" "),t){const t=document.createElement("button");t.type="button",t.className="designbase-wc-sidebar__panel-back",t.setAttribute("aria-label",e.backLabel||this.backLabel),t.append(createDbIcon("chevron-left",18)),t.addEventListener("click",()=>this.dispatchBackClick()),s.append(t)}const i=document.createElement("div");i.className="designbase-wc-sidebar__panel-heading";const n=document.createElement("div");if(n.className="designbase-wc-sidebar__panel-title",n.textContent=e.title,i.append(n),e.description){const t=document.createElement("div");t.className="designbase-wc-sidebar__panel-description",t.textContent=e.description,i.append(t)}return s.append(i),s}createNavWrapper(e){const{mode:t,collapsed:s,includeProjects:i,includeBottom:n,panel:a}=e,r=document.createElement("div");if(r.className="designbase-wc-sidebar__nav-wrapper",i){const e=this.createProjectSelector(s);e&&r.append(e)}"main"===t&&r.append(this.createCustomNavSlot("nav-top"));const o=document.createElement("nav");if(o.className="designbase-wc-sidebar__nav",o.setAttribute("data-panel-nav",t),a&&(o.dataset.panelId=a.id),o.setAttribute("aria-label",a?.ariaLabel||a?.title||"주 메뉴"),r.append(o),"main"===t&&r.append(this.createCustomNavSlot("nav-bottom")),n){const e=document.createElement("nav");e.className="designbase-wc-sidebar__bottom-nav",e.setAttribute("aria-label","하단 메뉴"),r.append(e)}return r}createFooter(e){const{collapsed:t,userProfile:s,userMenuItems:i}=e,n=document.createElement("div");n.className="designbase-wc-sidebar__footer";const a=this.createUpdateBanner(t);a&&n.append(a);const r=this.createPromoBanner(t);if(r&&n.append(r),s&&!t){const e=document.createElement("div");e.className="designbase-wc-sidebar__user";const t=this.createUserDropdown(i);t&&e.append(t);const a=document.createElement("div");a.className="designbase-wc-sidebar__user-info",a.setAttribute("role","button"),a.setAttribute("tabindex","0"),a.setAttribute("aria-expanded",String(this.userMenuOpen));const r=document.createElement("db-avatar");r.className="designbase-wc-sidebar__user-avatar",r.setAttribute("size","s"),r.setAttribute("initials",s.name),r.setAttribute("alt",s.name),s.avatar&&r.setAttribute("src",s.avatar);const o=document.createElement("div");o.className="designbase-wc-sidebar__user-details";const l=document.createElement("div");if(l.className="designbase-wc-sidebar__user-name",l.textContent=s.name,o.append(l),s.email){const e=document.createElement("div");e.className="designbase-wc-sidebar__user-email",e.textContent=s.email,o.append(e)}if(a.append(r,o),i.length){const e=document.createElement("span");e.className="designbase-wc-sidebar__user-more",e.setAttribute("aria-hidden","true"),e.append(createDbIcon("more-vertical",16)),a.append(e),a.setAttribute("aria-haspopup","menu")}a.addEventListener("click",()=>{i.length&&(this.userMenuOpen=!this.userMenuOpen,this.userFlyoutItemId=null,this.cancelUserFlyoutClose(),this.projectMenuOpen=!1,this.render())}),a.addEventListener("keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a.click())}),e.append(a),n.append(e)}else if(s&&t){const e=document.createElement("div");e.className=["designbase-wc-sidebar__user-collapsed",this.userMenuOpen&&"designbase-wc-sidebar__user-collapsed--open"].filter(Boolean).join(" "),e.setAttribute("role","button"),e.setAttribute("tabindex","0"),e.setAttribute("aria-label",s.name),e.setAttribute("aria-expanded",String(this.userMenuOpen)),i.length&&e.setAttribute("aria-haspopup","menu");const t=document.createElement("db-avatar");if(t.className="designbase-wc-sidebar__user-avatar-collapsed",t.setAttribute("size","s"),t.setAttribute("initials",s.name),t.setAttribute("alt",s.name),s.avatar&&t.setAttribute("src",s.avatar),e.append(t),!this.userMenuOpen){const t=document.createElement("span");t.className="designbase-wc-sidebar__item-tooltip",t.textContent=s.name,t.setAttribute("role","tooltip"),e.append(t)}const a=this.createUserDropdown(i,!0);a&&e.append(a),e.addEventListener("click",e=>{i.length&&(e.target.closest(".designbase-wc-sidebar__user-dropdown")||(this.userMenuOpen=!this.userMenuOpen,this.userFlyoutItemId=null,this.cancelUserFlyoutClose(),this.projectMenuOpen=!1,this.render()))}),e.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.click())}),n.append(e)}return n}render(){const e=this.getActivePanelConfig();this.syncHostClasses(),this.setAttribute("role","complementary"),this.setAttribute("aria-label","사이드바 네비게이션");const t=this.getAttribute("size")||"m",s="false"!==this.getAttribute("collapsible"),i="false"!==this.getAttribute("show-logo"),n=this.hasAttribute("collapsed"),a=this.parseUserProfile(),r=this.parseUserMenuItems(),o=this.parseBottomSections(),l=this.collectCustomNavSlots(),d=Boolean(e),h="replace"===this.resolvedPanelMode;this.replaceChildren();const u=document.createElement("div");u.className="designbase-wc-sidebar__container";const b=document.createElement("div");b.className="designbase-wc-sidebar__panel-viewport";const p=document.createElement("div");p.className="designbase-wc-sidebar__panel-track",p.dataset.active=d&&h?"main":d?"panel":"main";const m=document.createElement("div");m.className=["designbase-wc-sidebar__panel-slide","designbase-wc-sidebar__panel-slide--main"].join(" "),m.dataset.panel="main";const g=d&&h;m.toggleAttribute("inert",g),m.setAttribute("aria-hidden",String(g));const f=this.createMainHeader({size:t,collapsible:s,showLogo:i,collapsed:n});if(f&&m.append(f),m.append(this.createNavWrapper({mode:"main",collapsed:n,includeProjects:"back"!==this.headerType,includeBottom:o.length>0})),m.append(this.createFooter({collapsed:n,userProfile:a,userMenuItems:r})),p.append(m),e){const t=document.createElement("div");t.className=["designbase-wc-sidebar__panel-slide","designbase-wc-sidebar__panel-slide--secondary"].join(" "),t.dataset.panel=e.id,t.setAttribute("aria-hidden","false"),t.append(this.createPanelHeader(e)),t.append(this.createNavWrapper({mode:"panel",collapsed:!1,includeProjects:!1,includeBottom:!1,panel:e})),p.append(t)}b.append(p),u.append(b),this.append(u),this.renderNav(),this.renderBottomNav(),this.projectCustomNavSlots(l),d&&h&&requestAnimationFrame(()=>{this.isConnected&&this.activePanel===e?.id&&(p.dataset.active="panel")})}}function getDefaultSize(e,t){if("circular"===e)switch(t){case"xs":return"16px";case"s":return"24px";case"l":return"48px";case"xl":return"64px";default:return"32px"}switch(t){case"xs":return"12px";case"s":return"16px";case"l":return"24px";case"xl":return"32px";default:return"20px"}}function toCssSize(e){return/^\d+$/.test(e)?`${e}px`:e}customElements.get("db-sidebar")||customElements.define("db-sidebar",DbSidebar);class DbSkeleton extends HTMLElement{static get observedAttributes(){return["variant","size","width","height","animation","lines","line-spacing","last-line-width","aria-label"]}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}render(){const e=this.getAttribute("variant")||"text",t=this.getAttribute("size")||"m",s=this.getAttribute("animation")||"pulse",i=Number(this.getAttribute("lines")||1),n=this.getAttribute("width"),a=this.getAttribute("height"),r=this.getAttribute("line-spacing")||"8px",o=this.getAttribute("last-line-width")||"60%",l=se.includes(e)?e:"text",d=ie.includes(t)?t:"m",h=["designbase-wc-skeleton",`designbase-wc-skeleton--${l}`,`designbase-wc-skeleton--${d}`,`designbase-wc-skeleton--${s}`,(n||a)&&"designbase-wc-skeleton--custom-size"].filter(Boolean).join(" ");this.className!==h&&(this.className=h);const u=this.getAttribute("aria-label")??`${l} 스켈레톤 로딩 중`;if(this.getAttribute("aria-label")!==u&&this.setAttribute("aria-label",u),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.replaceChildren(),this.style.width=n?toCssSize(n):"circular"===l?getDefaultSize(l,d):"100%",this.style.height=a?toCssSize(a):"circular"===l?getDefaultSize(l,d):function getTextLineHeight(e){switch(e){case"xs":return"12px";case"s":return"16px";case"l":return"24px";case"xl":return"32px";default:return"20px"}}(d),"text"===l&&i>1)for(let e=1;e<i;e+=1){const t=document.createElement("div");t.className="designbase-wc-skeleton__line",t.style.marginTop=toCssSize(r),e===i-1&&(t.style.width=toCssSize(o)),this.append(t)}}}customElements.get("db-skeleton")||customElements.define("db-skeleton",DbSkeleton);class DbSpinner extends HTMLElement{static get observedAttributes(){return["type","size","color","speed","label","show-label"]}get type(){return this.getAttribute("type")||"circular"}set type(e){this.setAttribute("type",e)}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}get color(){return this.getAttribute("color")||""}set color(e){e?this.setAttribute("color",e):this.removeAttribute("color")}get speed(){return Number(this.getAttribute("speed")||1)}set speed(e){this.setAttribute("speed",String(e))}get label(){return this.getAttribute("label")||"로딩 중..."}set label(e){this.setAttribute("label",e)}get showLabel(){return this.hasAttribute("show-label")}set showLabel(e){this.toggleAttribute("show-label",e)}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}render(){this.className=Array.from(this.classList).filter(e=>!e.startsWith("designbase-wc-spinner")).join(" "),this.classList.add("designbase-wc-spinner"),this.classList.add(`designbase-wc-spinner--${q.includes(this.type)?this.type:"circular"}`),this.classList.add(`designbase-wc-spinner--${R.includes(this.size)?this.size:"m"}`),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-busy","true"),this.showLabel&&this.setAttribute("aria-label",this.label),this.style.setProperty("--spinner-speed",`${this.speed}s`),this.color?this.style.setProperty("--spinner-color",this.color):this.style.removeProperty("--spinner-color");const e=q.includes(this.type)?this.type:"circular";if(this.renderedType!==e||!this.graphicEl?.isConnected){const t=document.createElement("template");t.innerHTML=this.renderSpinner(),this.graphicEl=t.content.firstElementChild,this.renderedType=e,this.labelEl=void 0,this.replaceChildren(this.graphicEl)}Boolean(this.showLabel&&this.label)?(this.labelEl?.isConnected||(this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-spinner__label",this.labelEl.setAttribute("aria-hidden","true"),this.append(this.labelEl)),this.labelEl.textContent=this.label):(this.labelEl?.remove(),this.labelEl=void 0)}renderSpinner(){switch(this.type){case"dots":return'<span class="designbase-wc-spinner__dots" aria-hidden="true"><span class="designbase-wc-spinner__dot"></span><span class="designbase-wc-spinner__dot"></span><span class="designbase-wc-spinner__dot"></span></span>';case"bars":return'<span class="designbase-wc-spinner__bars" aria-hidden="true"><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span><span class="designbase-wc-spinner__bar"></span></span>';case"pulse":return'<span class="designbase-wc-spinner__pulse" aria-hidden="true"></span>';case"ripple":return'<span class="designbase-wc-spinner__ripple" aria-hidden="true"><span class="designbase-wc-spinner__ripple-circle"></span><span class="designbase-wc-spinner__ripple-circle"></span></span>';default:return'<svg class="designbase-wc-spinner__circular" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle class="designbase-wc-spinner__circular-track" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"></circle><circle class="designbase-wc-spinner__circular-indicator" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"></circle></svg>'}}escape(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]||e))}}customElements.get("db-spinner")||customElements.define("db-spinner",DbSpinner);class DbTable extends HTMLElement{constructor(){super(...arguments),this.internalSelectedRows=[],this.internalSortDirection=null,this.internalPage=1}static get observedAttributes(){return["columns","data","title","size","variant","empty-message","sortable","sort-column","sort-direction","selectable","multi-select","selected-rows","row-key","loading","pagination","page","page-size","total-items","show-count-badge","clickable"]}get columns(){try{return JSON.parse(this.getAttribute("columns")||"[]")}catch{return[]}}set columns(e){this.setAttribute("columns","string"==typeof e?e:JSON.stringify(e))}get data(){try{return JSON.parse(this.getAttribute("data")||"[]")}catch{return[]}}set data(e){this.setAttribute("data","string"==typeof e?e:JSON.stringify(e))}connectedCallback(){this.render()}attributeChangedCallback(e){"selected-rows"===e&&this.syncSelectedRowsFromAttribute(),"sort-column"!==e&&"sort-direction"!==e||this.syncSortFromAttributes(),"page"===e&&(this.internalPage=Number(this.getAttribute("page")||1)),this.render()}syncSelectedRowsFromAttribute(){try{this.internalSelectedRows=JSON.parse(this.getAttribute("selected-rows")||"[]")}catch{this.internalSelectedRows=[]}}syncSortFromAttributes(){const e=this.getAttribute("sort-column"),t=this.getAttribute("sort-direction");this.internalSortColumn=e||void 0,this.internalSortDirection="asc"===t||"desc"===t?t:null}getRowKey(e,t){const s=e[this.getAttribute("row-key")||"id"];return String(null!=s?s:t)}getSortedData(){const e=this.data,t=this.getAttribute("sort-column")||this.internalSortColumn,s=this.getAttribute("sort-direction")||this.internalSortDirection;if(!t||!s)return e;const i=this.columns.find(e=>e.key===t);return i?.sortable?[...e].sort((e,i)=>{const n=e[t],a=i[t];return n===a?0:null==n?1:null==a?-1:n<a?"asc"===s?-1:1:"asc"===s?1:-1}):e}handleSort(e){if(!this.hasAttribute("sortable")||!e.sortable)return;let t="asc";this.internalSortColumn===e.key&&("asc"===this.internalSortDirection?t="desc":"desc"===this.internalSortDirection&&(t=null)),this.internalSortColumn=t?e.key:void 0,this.internalSortDirection=t,this.dispatchEvent(new CustomEvent("db-sort-change",{bubbles:!0,composed:!0,detail:{column:e.key,direction:t}})),this.render()}handleRowSelect(e,t,s){let i;s?.stopPropagation(),i=this.hasAttribute("multi-select")?t?[...this.internalSelectedRows,e]:this.internalSelectedRows.filter(t=>t!==e):t?[e]:[],this.internalSelectedRows=i,this.dispatchEvent(new CustomEvent("db-selection-change",{bubbles:!0,composed:!0,detail:{selectedRows:i}})),this.render()}handleSelectAll(e){const t=e?this.data.map((e,t)=>this.getRowKey(e,t)):[];this.internalSelectedRows=t,this.dispatchEvent(new CustomEvent("db-selection-change",{bubbles:!0,composed:!0,detail:{selectedRows:t}})),this.render()}getPaginatedData(){const e=this.getSortedData();if(!this.hasAttribute("pagination"))return e;const t=Number(this.getAttribute("page-size")||10),s=Number(this.getAttribute("total-items")||e.length),i=Math.max(1,Math.ceil(s/t)),n=(Math.min(this.internalPage,i)-1)*t;return e.slice(n,n+t)}createSortIcon(e){const t=document.createElement("span");if(t.className="designbase-wc-table__sort-icon",this.internalSortColumn!==e.key||!Boolean(this.internalSortDirection)){t.classList.add("designbase-wc-table__sort-icon--idle");const e=document.createElement("span");return e.className="designbase-wc-table__sort-icon-stack",e.append(createDbIcon("chevron-up",10),createDbIcon("chevron-down",10)),t.append(e),t}return t.classList.add("asc"===this.internalSortDirection?"designbase-wc-table__sort-icon--asc":"designbase-wc-table__sort-icon--desc"),t.append(createDbIcon("asc"===this.internalSortDirection?"chevron-up":"chevron-down",14)),t}createCheckbox(e){const t=document.createElement("db-checkbox");return t.setAttribute("size","s"),t.setAttribute("has-label","false"),e.checked&&t.setAttribute("checked",""),e.indeterminate&&t.setAttribute("indeterminate",""),e.stopPropagation&&t.addEventListener("click",e=>e.stopPropagation()),t.addEventListener("db-change",t=>{const s=t.detail;e.onChange?.(s.checked)}),t}render(){const e=this.getAttribute("size")||"m",t=this.getAttribute("variant")||"default",s=Ae.includes(e)?e:"m",i=ye.includes(t)?t:"default",n=this.columns,a=this.getPaginatedData(),r=this.getSortedData(),o=this.hasAttribute("loading");o?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy");const l=this.hasAttribute("selectable"),d=this.hasAttribute("sortable"),h=this.getAttribute("empty-message")||"데이터가 없습니다.";if(this.className=["designbase-wc-table",`designbase-wc-table--${s}`,`designbase-wc-table--${i}`,l&&"designbase-wc-table--selectable",d&&"designbase-wc-table--sortable",o&&"designbase-wc-table--loading"].filter(Boolean).join(" "),this.replaceChildren(),o){const e=document.createElement("div");e.className="designbase-wc-table__loading";const t=document.createElement("div");t.className="designbase-wc-table__loading-spinner";const s=document.createElement("span");return s.textContent="로딩 중...",e.append(t,s),void this.append(e)}const u=this.getAttribute("title"),b=this.hasAttribute("show-count-badge");if(u||b){const e=document.createElement("div");e.className="designbase-wc-table__header";const t=document.createElement("div");if(t.className="designbase-wc-table__header-left",u){const e=document.createElement("h3");e.className="designbase-wc-table__title",e.textContent=u,t.append(e)}if(b){const e=document.createElement("db-badge");e.setAttribute("count",String(this.data.length)),e.setAttribute("type","number"),e.setAttribute("variant","primary"),e.setAttribute("size","s"),t.append(e)}e.append(t),this.append(e)}const p=document.createElement("div");p.className="designbase-wc-table__container";const m=document.createElement("table");m.className="designbase-wc-table__table";const g=document.createElement("thead");g.className="designbase-wc-table__thead";const f=document.createElement("tr");f.className="designbase-wc-table__tr";const v=a.map((e,t)=>this.getRowKey(e,t)),w=v.filter(e=>this.internalSelectedRows.includes(e)),A=this.hasAttribute("clickable");if(l){const e=document.createElement("th");e.className="designbase-wc-table__th designbase-wc-table__th--checkbox";const t=this.createCheckbox({checked:v.length>0&&w.length===v.length,indeterminate:w.length>0&&w.length<v.length,onChange:e=>this.handleSelectAll(e)});e.append(t),f.append(e)}n.forEach(e=>{const t=document.createElement("th");t.className=["designbase-wc-table__th",`designbase-wc-table__th--${e.align||"left"}`,d&&e.sortable&&"designbase-wc-table__th--sortable",this.internalSortColumn===e.key&&this.internalSortDirection&&"designbase-wc-table__th--sorted"].filter(Boolean).join(" "),e.width&&(t.style.width="number"==typeof e.width?`${e.width}px`:e.width);const s=document.createElement("div");s.className="designbase-wc-table__th-content";const i=document.createElement("span");i.className="designbase-wc-table__th-text",i.textContent=e.header,s.append(i),d&&e.sortable&&s.append(this.createSortIcon(e)),t.append(s),d&&e.sortable&&t.addEventListener("click",()=>this.handleSort(e)),f.append(t)}),g.append(f);const y=document.createElement("tbody");if(y.className="designbase-wc-table__tbody",0===r.length){const e=document.createElement("tr");e.className="designbase-wc-table__tr";const t=document.createElement("td");t.className="designbase-wc-table__td designbase-wc-table__td--empty",t.colSpan=Math.max(n.length+(l?1:0),1);const s=document.createElement("db-empty-state");s.setAttribute("title","데이터가 없습니다"),s.setAttribute("description",h),s.setAttribute("variant","no-data"),s.setAttribute("size","m"),t.append(s),e.append(t),y.append(e)}else a.forEach((e,t)=>{const s=this.getRowKey(e,t),i=this.internalSelectedRows.includes(s),a=document.createElement("tr");if(a.className=["designbase-wc-table__tr",A&&"designbase-wc-table__tr--clickable",i&&"designbase-wc-table__tr--selected"].filter(Boolean).join(" "),A&&a.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("db-row-click",{detail:{item:e,index:t},bubbles:!0,composed:!0}))}),l){const e=document.createElement("td");e.className="designbase-wc-table__td designbase-wc-table__td--checkbox";const t=this.createCheckbox({checked:i,stopPropagation:!0,onChange:e=>this.handleRowSelect(s,e)});e.append(t),a.append(e)}n.forEach(t=>{const s=document.createElement("td");s.className=["designbase-wc-table__td",`designbase-wc-table__td--${t.align||"left"}`].join(" "),s.textContent=String(e[t.key]??""),a.append(s)}),y.append(a)});if(m.append(g,y),p.append(m),this.append(p),this.hasAttribute("pagination")){const e=Number(this.getAttribute("page-size")||10),t=Number(this.getAttribute("total-items")||r.length),i=Math.max(1,Math.ceil(t/e)),n=document.createElement("div");n.className="designbase-wc-table__footer";const a=document.createElement("db-pagination");a.setAttribute("current-page",String(this.internalPage)),a.setAttribute("total-pages",String(i)),a.setAttribute("size",s),a.setAttribute("show-first-last",""),a.addEventListener("db-change",e=>{const t=Number(e.detail?.page||1);this.internalPage=t,this.dispatchEvent(new CustomEvent("db-page-change",{bubbles:!0,composed:!0,detail:{page:t}})),this.render()}),n.append(a),this.append(n)}}}customElements.get("db-table")||customElements.define("db-table",DbTable);class DbTabs extends HTMLElement{constructor(){super(...arguments),this.tabButtons=[],this.inactivePanels=document.createDocumentFragment(),this.isRendering=!1,this.handleResize=()=>{this.resizeRaf&&cancelAnimationFrame(this.resizeRaf),this.resizeRaf=requestAnimationFrame(()=>{this.isRendering||(this.handleListScroll(),this.updateIndicator(!1))})},this.handleListScroll=()=>{if(!this.list)return;const e=this.list.scrollWidth>this.list.clientWidth,t=this.list.scrollLeft+this.list.clientWidth>=this.list.scrollWidth-5;this.list.classList.toggle("designbase-wc-tabs__list--show-gradient",e&&!t&&"horizontal"===this.orientation)}}static get observedAttributes(){return["labels","items","active-index","selected-id","orientation","size","variant","full-width"]}get labels(){const e=this.tabItems.map(e=>e.label);return e.length?e:(this.getAttribute("labels")||"").split(",").map(e=>e.trim()).filter(Boolean)}set labels(e){this.setAttribute("labels",Array.isArray(e)?e.join(","):e)}get tabItems(){try{const e=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}get items(){return this.tabItems}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}set tabItems(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}get activeIndex(){const e=this.getAttribute("selected-id");if(e){const t=this.tabItems.findIndex((t,s)=>(t.id||String(s))===e);if(t>=0)return t}return Number(this.getAttribute("active-index")||0)}set activeIndex(e){this.setAttribute("active-index",String(e))}get orientation(){return coerceToContract(this.getAttribute("orientation"),Y,"horizontal")}set orientation(e){this.setAttribute("orientation",e)}get size(){return coerceToContract(this.getAttribute("size"),Q,"m")}set size(e){this.setAttribute("size",e)}get variant(){return coerceToContract(this.getAttribute("variant"),G,"default")}set variant(e){this.setAttribute("variant",e)}get fullWidth(){return this.hasAttribute("full-width")}set fullWidth(e){this.toggleAttribute("full-width",Boolean(e))}connectedCallback(){this.render(),this.list?.addEventListener("scroll",this.handleListScroll,{passive:!0}),window.addEventListener("resize",this.handleResize),this.resizeObserver=new ResizeObserver(()=>this.handleResize()),this.resizeObserver.observe(this),this.childObserver=new MutationObserver(e=>{this.isRendering||e.some(e=>Array.from(e.addedNodes).some(e=>e instanceof HTMLElement&&(e.hasAttribute("slot")||void 0!==e.dataset.panelIndex)))&&this.render()}),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){this.list?.removeEventListener("scroll",this.handleListScroll),window.removeEventListener("resize",this.handleResize),this.resizeObserver?.disconnect(),this.resizeRaf&&cancelAnimationFrame(this.resizeRaf),this.childObserver?.disconnect()}attributeChangedCallback(){this.isConnected&&this.render()}collectPanelContent(){const e=new Map,register=(t,s)=>{if(!(t instanceof HTMLElement)||"SLOT"===t.tagName)return;e.has(s)||e.set(s,[]);const i=e.get(s);i.includes(t)||i.push(t)};return Array.from(this.children).forEach(e=>{const t=e.getAttribute("slot")?.match(/^panel-(\d+)$/);if(t)return void register(e,Number(t[1]));const s=e.dataset.panelIndex;void 0!==s&®ister(e,Number(s))}),this.panel?.querySelectorAll(":scope > .designbase-wc-tabs__panel-inner > [data-panel-index]").forEach(e=>{e instanceof HTMLElement&®ister(e,Number(e.dataset.panelIndex))}),Array.from(this.inactivePanels.children).forEach(e=>{e instanceof HTMLElement&&void 0!==e.dataset.panelIndex&®ister(e,Number(e.dataset.panelIndex))}),e}render(){this.isRendering=!0;const e=this.collectPanelContent(),t=this.labels,s=this.tabItems,i=Math.min(Math.max(this.activeIndex,0),Math.max(t.length-1,0)),n=this.size,a=this.orientation,r=this.variant,o="default"===r;this.className=["designbase-wc-tabs",`designbase-wc-tabs--${a}`,`designbase-wc-tabs--${n}`,`designbase-wc-tabs--${r}`,this.fullWidth&&"designbase-wc-tabs--full-width"].filter(Boolean).join(" "),this.querySelectorAll(":scope > .designbase-wc-tabs__list, :scope > .designbase-wc-tabs__panel").forEach(e=>e.remove()),this.list=document.createElement("div"),this.list.className=["designbase-wc-tabs__list",`designbase-wc-tabs__list--${a}`,this.fullWidth&&"designbase-wc-tabs__list--full-width"].filter(Boolean).join(" "),this.list.setAttribute("role","tablist"),this.list.setAttribute("aria-orientation",a),this.list.setAttribute("aria-label",labelFrom(this,"label-tablist","tabs.label")),this.tabButtons=[],t.forEach((e,t)=>{const a=s[t],r=Boolean(a?.disabled),o=t===i,l=document.createElement("button");if(l.type="button",l.className=["designbase-wc-tabs__tab",o&&"designbase-wc-tabs__tab--selected",r&&"designbase-wc-tabs__tab--disabled"].filter(Boolean).join(" "),l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(o)),l.setAttribute("aria-controls",`panel-${t}`),l.id=`tab-${t}`,l.tabIndex=o?0:-1,l.disabled=r,a?.icon){const e=document.createElement("span");e.className="designbase-wc-tabs__tab-icon";const t="s"===n?16:"l"===n?20:18;e.setAttribute("aria-hidden","true"),e.append(createDbIcon(a.icon,t)),l.append(e)}const d=document.createElement("span");d.className="designbase-wc-tabs__tab-label",d.textContent=e,l.append(d),l.addEventListener("click",()=>this.select(t)),l.addEventListener("keydown",e=>this.handleKeyDown(e,t)),this.list?.append(l),this.tabButtons.push(l)}),o?(this.indicator=document.createElement("span"),this.indicator.className="designbase-wc-tabs__indicator designbase-wc-tabs__indicator--no-transition",this.list.append(this.indicator),requestAnimationFrame(()=>this.updateIndicator(!1))):this.indicator=void 0,this.panel=document.createElement("div"),this.panel.className="designbase-wc-tabs__panel",this.panel.setAttribute("role","tabpanel"),this.panel.id=`panel-${i}`,this.panel.setAttribute("aria-labelledby",`tab-${i}`),this.panel.tabIndex=0;const l=document.createElement("div");l.className="designbase-wc-tabs__panel-inner",e.forEach((e,t)=>{e.forEach(e=>{e.removeAttribute("slot"),e.dataset.panelIndex=String(t),t===i?l.append(e):this.inactivePanels.append(e)})}),this.panel.append(l),this.append(this.list,this.panel),requestAnimationFrame(()=>{this.handleListScroll(),o&&this.updateIndicator(!1)}),this.isRendering=!1}select(e){const t=this.labels,s=this.tabItems;if(!t[e]||s[e]?.disabled)return;this.activeIndex=e;const i=s[e]?.id||String(e);this.setAttribute("selected-id",i),this.dispatchEvent(new CustomEvent("db-change",{detail:{index:e,label:t[e],id:i},bubbles:!0,composed:!0})),this.render()}handleKeyDown(e,t){const s=this.labels,i=this.tabItems;let n=t;if("ArrowRight"===e.key||"ArrowDown"===e.key)n=(t+1)%s.length;else if("ArrowLeft"===e.key||"ArrowUp"===e.key)n=(t-1+s.length)%s.length;else if("Home"===e.key)n=0;else{if("End"!==e.key)return"Enter"===e.key||" "===e.key?(e.preventDefault(),void this.select(t)):void 0;n=s.length-1}e.preventDefault();let a=0;for(;i[n]?.disabled&&a<s.length;)n="ArrowLeft"===e.key||"ArrowUp"===e.key?(n-1+s.length)%s.length:(n+1)%s.length,a+=1;this.tabButtons[n]?.focus()}updateIndicator(e=!1){const t=this.list?.querySelector(".designbase-wc-tabs__tab--selected");if(!t||!this.indicator)return;const s="vertical"===this.orientation;this.indicator.classList.toggle("designbase-wc-tabs__indicator--no-transition",!e),this.indicator.classList.add(s?"designbase-wc-tabs__indicator--vertical":"designbase-wc-tabs__indicator--horizontal"),this.indicator.classList.add("designbase-wc-tabs__indicator--ready"),s?(this.indicator.style.width="2px",this.indicator.style.height=`${t.offsetHeight}px`,this.indicator.style.transform=`translate3d(0, ${t.offsetTop}px, 0)`):(this.indicator.style.width=`${t.offsetWidth}px`,this.indicator.style.height="2px",this.indicator.style.transform=`translate3d(${t.offsetLeft}px, 0, 0)`)}}customElements.get("db-tabs")||customElements.define("db-tabs",DbTabs);class DbTextarea extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.handleInput=e=>{e.stopPropagation(),this.field&&(this.updateCharacterCount(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-input",{detail:{value:this.field.value,nativeEvent:e},bubbles:!0,composed:!0})))},this.handleChange=e=>{if(e.stopPropagation(),!this.field)return;const t=this.field.value;this.getAttribute("value")!==t&&this.setAttribute("value",t),this.updateCharacterCount(),this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{value:t,nativeEvent:e},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["label","placeholder","value","default-value","name","size","rows","max-length","show-character-count","character-count-position","disabled","readonly","required","error","error-message","helper-text","full-width","resizable"]}get value(){return this.field?.value??this.getAttribute("value")??""}set value(e){this.setAttribute("value",e),this.field&&(this.field.value=e,this.updateCharacterCount())}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}connectedCallback(){this.built||this.build(),this.syncState()}attributeChangedCallback(e){if(this.built){if("value"===e&&this.field){const e=this.getAttribute("value")||"";return this.field.value!==e&&(this.field.value=e),void this.updateCharacterCount()}this.syncState()}}focus(){this.field?.focus()}get showCharacterCount(){return this.hasAttribute("show-character-count")}get characterCountPosition(){return this.getAttribute("character-count-position")||"bottom"}build(){const e=this.getAttribute("id")||dbUid("db-textarea");this.hasAttribute("id")||this.setAttribute("id",e),this.labelEl=document.createElement("label"),this.labelEl.className="designbase-wc-textarea__label",this.labelEl.htmlFor=e,this.countTop=document.createElement("div"),this.countTop.className="designbase-wc-textarea__character-count designbase-wc-textarea__character-count--top",this.countTop.hidden=!0;const t=document.createElement("div");t.className="designbase-wc-textarea__wrapper",this.field=document.createElement("textarea"),this.field.id=e,this.field.className="designbase-wc-textarea__field",this.field.addEventListener("input",this.handleInput),this.field.addEventListener("change",this.handleChange),t.appendChild(this.field),this.footerEl=document.createElement("div"),this.footerEl.className="designbase-wc-textarea__footer",this.errorEl=document.createElement("div"),this.errorEl.className="designbase-wc-textarea__error-message",this.errorEl.setAttribute("role","alert"),this.helperEl=document.createElement("div"),this.helperEl.className="designbase-wc-textarea__helper-text",this.countBottom=document.createElement("div"),this.countBottom.className="designbase-wc-textarea__character-count designbase-wc-textarea__character-count--bottom",this.countBottom.hidden=!0,this.footerEl.append(this.errorEl,this.helperEl,this.countBottom),this.append(this.labelEl,this.countTop,t,this.footerEl),this.built=!0}syncState(){if(!this.field)return;const e=Ee.includes(this.size)?this.size:"m",t=this.getAttribute("label")||"",s=this.getAttribute("helper-text")||"",i=this.getAttribute("error-message")||"",n=this.hasAttribute("error"),a=this.getAttribute("value")??this.getAttribute("default-value")??"";if(this.className=["designbase-wc-textarea",`designbase-wc-textarea--${e}`,n&&"designbase-wc-textarea--error",this.hasAttribute("disabled")&&"designbase-wc-textarea--disabled",this.hasAttribute("readonly")&&"designbase-wc-textarea--readonly",this.hasAttribute("full-width")&&"designbase-wc-textarea--full-width",this.hasAttribute("resizable")?"":"designbase-wc-textarea--not-resizable"].filter(Boolean).join(" "),this.labelEl){const e=this.hasAttribute("required")?'<span aria-hidden="true"> *</span>':"";this.labelEl.innerHTML=t?`${this.escape(t)}${e}`:"",this.labelEl.hidden=!t}this.field.placeholder=this.getAttribute("placeholder")||"",this.field.name=this.getAttribute("name")||"",this.field.value!==a&&(this.field.value=a),this.field.rows=Number(this.getAttribute("rows")||4),this.field.disabled=this.hasAttribute("disabled"),this.field.readOnly=this.hasAttribute("readonly"),this.field.required=this.hasAttribute("required"),this.field.setAttribute("aria-invalid",String(n));const r=this.getAttribute("max-length");r?this.field.maxLength=Number(r):this.field.removeAttribute("maxLength");const o=`${this.getAttribute("id")}-helper`,l=`${this.getAttribute("id")}-error`;n&&i?(this.errorEl.id=l,this.errorEl.textContent=i,this.errorEl.hidden=!1,this.helperEl.hidden=!0,this.field.setAttribute("aria-describedby",l)):s?(this.helperEl.id=o,this.helperEl.textContent=s,this.helperEl.hidden=!1,this.errorEl.hidden=!0,this.field.setAttribute("aria-describedby",o)):(this.helperEl.hidden=!0,this.errorEl.hidden=!0,this.field.removeAttribute("aria-describedby")),this.updateCharacterCount()}updateCharacterCount(){if(!this.field||!this.countTop||!this.countBottom)return;const e=this.field.value.length,t=this.getAttribute("max-length"),s=Boolean(t&&e>Number(t)),i=`${e}${t?` / ${t}`:""}`,renderCount=e=>{let t=e.querySelector(".designbase-wc-textarea__character-count-text");t||(t=document.createElement("span"),e.replaceChildren(t)),t.className="designbase-wc-textarea__character-count-text",t.classList.toggle("designbase-wc-textarea__character-count-text--error",s),t.textContent=i};this.showCharacterCount&&"top"===this.characterCountPosition?(renderCount(this.countTop),this.countTop.hidden=!1,this.countBottom.hidden=!0):this.showCharacterCount?(renderCount(this.countBottom),this.countBottom.hidden=!1,this.countTop.hidden=!0):(this.countTop.hidden=!0,this.countBottom.hidden=!0)}escape(e){return e.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]||e))}}customElements.get("db-textarea")||customElements.define("db-textarea",DbTextarea);class DbToast extends HTMLElement{constructor(){super(...arguments),this.timeoutId=null,this.progressInterval=null,this.closeTimerId=null,this.closed=!1,this.cleanups=new CleanupBag,this.elapsedBeforePause=0,this.runStartedAt=0,this.paused=!1,this.pauseTimers=()=>{this.paused||this.closed||(this.paused=!0,this.elapsedBeforePause+=Date.now()-this.runStartedAt,this.clearTimers())},this.resumeTimers=()=>{this.paused&&!this.closed&&(this.paused=!1,this.startTimers())}}static get observedAttributes(){return["toast-id","variant","title","description","duration","show-close","show-progress","auto-remove"]}connectedCallback(){this.closed=!1,this.elapsedBeforePause=0,this.render(),this.startTimers(),requestAnimationFrame(()=>this.classList.add("designbase-wc-toast--visible")),this.cleanups.listen(this,"pointerenter",this.pauseTimers),this.cleanups.listen(this,"pointerleave",this.resumeTimers),this.cleanups.listen(this,"focusin",this.pauseTimers),this.cleanups.listen(this,"focusout",this.resumeTimers)}disconnectedCallback(){this.cleanups.run(),this.clearTimers(),this.closeTimerId&&clearTimeout(this.closeTimerId),this.closeTimerId=null}attributeChangedCallback(e){if(!this.isConnected||this.closed)return;const t=this.classList.contains("designbase-wc-toast--visible");this.render(),t&&requestAnimationFrame(()=>this.classList.add("designbase-wc-toast--visible")),"duration"!==e&&"show-progress"!==e||(this.clearTimers(),this.startTimers())}clearTimers(){this.timeoutId&&clearTimeout(this.timeoutId),this.progressInterval&&clearInterval(this.progressInterval),this.timeoutId=null,this.progressInterval=null}startTimers(){const e=Number(this.getAttribute("duration")??"5000");if(!Number.isFinite(e)||e<=0)return;const t=Math.max(0,e-this.elapsedBeforePause);if(this.runStartedAt=Date.now(),0!==t){if("false"!==this.getAttribute("show-progress")&&this.hasAttribute("show-progress")){const t=this.querySelector(".designbase-wc-toast__progress-bar");t&&(t.style.width="0%");const s=Date.now();return void(this.progressInterval=setInterval(()=>{const i=this.elapsedBeforePause+(Date.now()-s),n=Math.min(100,i/e*100);t&&(t.style.width=`${n}%`),n>=100&&this.close()},16))}this.timeoutId=setTimeout(()=>this.close(),t)}else this.close()}close(){this.closed||(this.closed=!0,this.clearTimers(),this.classList.remove("designbase-wc-toast--visible"),this.classList.add("designbase-wc-toast--closing"),this.closeTimerId&&clearTimeout(this.closeTimerId),this.closeTimerId=setTimeout(()=>{this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0,detail:{id:this.getAttribute("toast-id")||""}})),("true"===this.getAttribute("auto-remove")||this.hasAttribute("auto-remove")&&"false"!==this.getAttribute("auto-remove"))&&this.remove()},300))}iconForVariant(e){return"success"===e?"circle-checked":"warning"===e?"warning-filled":"danger"===e?"error-filled":"info-filled"}render(){const e=coerceToContract(this.getAttribute("variant"),K,"info"),t=this.getAttribute("title")||"",s=this.getAttribute("description")||"",i="false"!==this.getAttribute("show-close"),n="false"!==this.getAttribute("show-progress")&&this.hasAttribute("show-progress");this.className=["designbase-wc-toast",`designbase-wc-toast--${e}`,this.closed&&"designbase-wc-toast--closing"].filter(Boolean).join(" ");const a=function politenessForTone(e){return"danger"===e||"warning"===e?"assertive":"polite"}(e);if(this.setAttribute("role","assertive"===a?"alert":"status"),this.setAttribute("aria-live",a),this.setAttribute("aria-atomic","true"),this.replaceChildren(),n){const e=document.createElement("div");e.className="designbase-wc-toast__progress";const t=document.createElement("div");t.className="designbase-wc-toast__progress-bar",t.style.width="0%",e.append(t),this.append(e)}const r=document.createElement("div");r.className=`designbase-wc-toast__icon designbase-wc-toast__icon--${e}`,r.setAttribute("aria-hidden","true"),r.append(createDbIcon(this.iconForVariant(e),20));const o=document.createElement("div");o.className="designbase-wc-toast__content";const l=document.createElement("div");if(l.className="designbase-wc-toast__title",l.textContent=t,o.append(l),s){const e=document.createElement("div");e.className="designbase-wc-toast__description",e.textContent=s,o.append(e)}if(this.append(r,o),i){const e=document.createElement("button");e.type="button",e.className="designbase-wc-toast__close-button",e.setAttribute("aria-label",labelFrom(this,"label-close","toast.close"));const t=createDbIcon("close",20);t.setAttribute("aria-hidden","true"),e.append(t),e.addEventListener("click",()=>this.close()),this.append(e)}}}customElements.get("db-toast")||customElements.define("db-toast",DbToast);class DbToggle extends HTMLElement{constructor(){super(...arguments),this.internals=this.attachInternals(),this.built=!1,this.userInteracted=!1,this.handleClick=()=>{if(this.disabled||this.readOnly)return;const e=!this.checked;this.userInteracted=!0,this.toggleAttribute("checked",e),this.syncFormValue(),this.syncState(),this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("db-change",{detail:{checked:e,selected:e},bubbles:!0,composed:!0}))}}static get observedAttributes(){return["checked","selected","default-checked","default-selected","size","disabled","readonly","has-label","name","value"]}get checked(){return!(!this.hasAttribute("checked")&&!this.hasAttribute("selected"))||!this.userInteracted&&(this.hasAttribute("default-checked")||this.hasAttribute("default-selected"))}set checked(e){this.toggleAttribute("checked",e),this.syncFormValue(),this.syncClasses()}get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",e),this.root&&(this.root.disabled=e),this.syncClasses()}get readOnly(){return this.hasAttribute("readonly")}set readOnly(e){this.toggleAttribute("readonly",e),this.syncClasses()}get size(){return this.getAttribute("size")||"m"}set size(e){this.setAttribute("size",e)}connectedCallback(){this.style.display="contents",this.built||this.build(),this.syncState()}attributeChangedCallback(){this.built&&this.syncState()}formResetCallback(){this.userInteracted=!1;const e=this.hasAttribute("default-checked")||this.hasAttribute("default-selected");this.toggleAttribute("checked",e),this.syncFormValue(),this.syncState()}formDisabledCallback(e){this.toggleAttribute("disabled",e),this.root&&(this.root.disabled=e),this.syncClasses()}get hasLabel(){return!this.hasAttribute("has-label")||"false"!==this.getAttribute("has-label")}syncFormValue(){const e=this.hasAttribute("checked")||this.hasAttribute("selected");this.internals.setFormValue(e?this.getAttribute("value")||"on":null)}build(){this.root=document.createElement("button"),this.root.type="button",this.root.className="designbase-wc-toggle";const e=document.createElement("span");e.className="designbase-wc-toggle__track",e.setAttribute("aria-hidden","true");const t=document.createElement("span");for(t.className="designbase-wc-toggle__thumb",e.appendChild(t),this.labelEl=document.createElement("span"),this.labelEl.className="designbase-wc-toggle__label";this.firstChild;)this.labelEl.appendChild(this.firstChild);this.root.append(e,this.labelEl),this.appendChild(this.root),this.root.addEventListener("click",this.handleClick),this.built=!0}syncState(){this.root&&(this.root.disabled=this.disabled,this.root.setAttribute("role","switch"),this.root.setAttribute("aria-checked",String(this.checked)),this.readOnly?this.root.setAttribute("aria-readonly","true"):this.root.removeAttribute("aria-readonly"),this.syncFormValue(),this.hasLabel?this.labelEl?.removeAttribute("hidden"):this.labelEl?.setAttribute("hidden",""),this.syncClasses())}syncClasses(){if(!this.root)return;const e=j.includes(this.size)?this.size:"m",t=this.hasLabel&&Boolean(this.labelEl?.textContent?.trim()),s=this.checked;this.root.className=["designbase-wc-toggle",`designbase-wc-toggle--${e}`,s&&"designbase-wc-toggle--selected",this.disabled&&"designbase-wc-toggle--disabled",this.readOnly&&"designbase-wc-toggle--readonly",!t&&"designbase-wc-toggle--no-label"].filter(Boolean).join(" "),this.root.setAttribute("aria-pressed",String(s))}}DbToggle.formAssociated=!0,customElements.get("db-toggle")||customElements.define("db-toggle",DbToggle);const Je=[DbAccordion,DbAdminShell,DbAnimationBackground,DbAlert,DbAvatar,DbBadge,DbBanner,DbBreadcrumbs,DbButton,DbCheckbox,DbChip,DbDrawer,DbDropdown,DbContainer,DbEmptyState,DbInput,DbLogo,DbMenuItem,DbModal,DbPageHeader,DbPagination,DbRadio,DbSearchBar,DbSection,DbSegmentControl,DbSelect,DbSidebar,DbSkeleton,DbSpinner,DbTable,DbTabs,DbTextarea,DbToast,DbToggle];exports.DbAccordion=DbAccordion,exports.DbAdminShell=DbAdminShell,exports.DbAlert=DbAlert,exports.DbAnimationBackground=DbAnimationBackground,exports.DbAvatar=DbAvatar,exports.DbBadge=DbBadge,exports.DbBanner=DbBanner,exports.DbBreadcrumbs=DbBreadcrumbs,exports.DbButton=DbButton,exports.DbCheckbox=DbCheckbox,exports.DbChip=DbChip,exports.DbContainer=DbContainer,exports.DbDrawer=DbDrawer,exports.DbDropdown=DbDropdown,exports.DbEmptyState=DbEmptyState,exports.DbInput=DbInput,exports.DbLogo=DbLogo,exports.DbMenuItem=DbMenuItem,exports.DbModal=DbModal,exports.DbPageHeader=DbPageHeader,exports.DbPagination=DbPagination,exports.DbRadio=DbRadio,exports.DbSearchBar=DbSearchBar,exports.DbSection=DbSection,exports.DbSegmentControl=DbSegmentControl,exports.DbSelect=DbSelect,exports.DbSidebar=DbSidebar,exports.DbSkeleton=DbSkeleton,exports.DbSpinner=DbSpinner,exports.DbTable=DbTable,exports.DbTabs=DbTabs,exports.DbTextarea=DbTextarea,exports.DbToast=DbToast,exports.DbToggle=DbToggle,exports.REGISTERED_COMPONENTS=Je,exports.WORDPRESS_UI_VERSION="0.1.7";
|