"use strict";var __extends=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__assign.apply(this,arguments)},__createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__rest=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.createReactComponent=void 0;var react_1=__importStar(require("react")),utils_1=require("./utils"),createReactComponent=function(e,t,r,n){void 0!==n&&n();var o=(0,utils_1.dashToPascalCase)(e),i=function(t){function n(e){var r=t.call(this,e)||this;return r.setComponentElRef=function(e){r.componentEl=e},r}return __extends(n,t),n.prototype.componentDidMount=function(){this.componentDidUpdate(this.props)},n.prototype.componentDidUpdate=function(e){(0,utils_1.attachProps)(this.componentEl,this.props,e)},n.prototype.render=function(){var t=this.props,n=t.children,o=t.forwardedRef,i=t.style,s=(t.className,t.ref,__rest(t,["children","forwardedRef","style","className","ref"])),a=Object.keys(s).reduce(function(e,t){var r=s[t];if(0===t.indexOf("on")&&t[2]===t[2].toUpperCase()){var n=t.substring(2).toLowerCase();"undefined"!=typeof document&&(0,utils_1.isCoveredByReact)(n)&&(e[t]=r)}else{var o=typeof r;"string"!==o&&"boolean"!==o&&"number"!==o||(e[(0,utils_1.camelToDashCase)(t)]=r)}return e},{});r&&(a=r(this.props,a));var c=__assign(__assign({},a),{ref:(0,utils_1.mergeRefs)(o,this.setComponentElRef),style:i});return(0,react_1.createElement)(e,c,n)},Object.defineProperty(n,"displayName",{get:function(){return o},enumerable:!1,configurable:!0}),n}(react_1.default.Component);return t&&(i.contextType=t),(0,utils_1.createForwardRef)(i,o)};exports.createReactComponent=createReactComponent;