/**
 * @license lucide-solid v0.572.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */

'use strict';

var web = require('solid-js/web');
var solidJs = require('solid-js');
var defaultAttributes = require('./defaultAttributes.js');
var hasA11yProp = require('./shared/src/utils/hasA11yProp.js');
var mergeClasses = require('./shared/src/utils/mergeClasses.js');
var toKebabCase = require('./shared/src/utils/toKebabCase.js');
var toPascalCase = require('./shared/src/utils/toPascalCase.js');

var _tmpl$ = /*#__PURE__*/web.template(`<svg>`);
const Icon = props => {
  const [localProps, rest] = solidJs.splitProps(props, ['color', 'size', 'strokeWidth', 'children', 'class', 'name', 'iconNode', 'absoluteStrokeWidth']);
  return (() => {
    var _el$ = _tmpl$();
    web.spread(_el$, web.mergeProps(defaultAttributes, {
      get width() {
        return localProps.size ?? defaultAttributes.width;
      },
      get height() {
        return localProps.size ?? defaultAttributes.height;
      },
      get stroke() {
        return localProps.color ?? defaultAttributes.stroke;
      },
      get ["stroke-width"]() {
        return web.memo(() => !!localProps.absoluteStrokeWidth)() ? Number(localProps.strokeWidth ?? defaultAttributes['stroke-width']) * 24 / Number(localProps.size) : Number(localProps.strokeWidth ?? defaultAttributes['stroke-width']);
      },
      get ["class"]() {
        return mergeClasses.mergeClasses('lucide', 'lucide-icon', ...(localProps.name != null ? [`lucide-${toKebabCase.toKebabCase(toPascalCase.toPascalCase(localProps.name))}`, `lucide-${toKebabCase.toKebabCase(localProps.name)}`] : []), localProps.class != null ? localProps.class : '');
      },
      get ["aria-hidden"]() {
        return !localProps.children && !hasA11yProp.hasA11yProp(rest) ? 'true' : undefined;
      }
    }, rest), true, true);
    web.insert(_el$, web.createComponent(solidJs.For, {
      get each() {
        return localProps.iconNode;
      },
      children: ([elementName, attrs]) => {
        return web.createComponent(web.Dynamic, web.mergeProps({
          component: elementName
        }, attrs));
      }
    }));
    return _el$;
  })();
};

module.exports = Icon;
//# sourceMappingURL=Icon.js.map
