Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.130/page_editor/app/utils/convertRGBtoHex",["module","exports","require"],(function(t,e,r){window;{function n(t,e){n=function(t,e){return new a(t,void 0,e)};var r=u(RegExp),c=RegExp.prototype,i=new WeakMap;function a(t,e,n){var o=r.call(this,t,e);return i.set(o,n||i.get(t)),o}function p(t,e){var r=i.get(e);return Object.keys(r).reduce((function(e,n){return e[n]=t[r[n]],e}),Object.create(null))}return o(a,r),a.prototype.exec=function(t){var e=c.exec.call(this,t);return e&&(e.groups=p(e,this)),e},a.prototype[Symbol.replace]=function(t,e){if("string"==typeof e){var r=i.get(this);return c[Symbol.replace].call(this,t,e.replace(/\$<([^>]+)>/g,(function(t,e){return"$"+r[e]})))}if("function"==typeof e){var n=this;return c[Symbol.replace].call(this,t,(function(){var t=[];return t.push.apply(t,arguments),"object"!=typeof t[t.length-1]&&t.push(p(t,n)),e.apply(this,t)}))}return c[Symbol.replace].call(this,t,e)},n.apply(this,arguments)}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}function u(t){var e="function"==typeof Map?new Map:void 0;return(u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return i(t,arguments,p(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),a(n,t)})(t)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function i(t,e,r){return(i=c()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&a(o,r.prototype),o}).apply(null,arguments)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.convertRGBtoHex=function(e){var n,o;const u=(null===(n=e.match(t))||void 0===n?void 0:n.groups)||(null===(o=e.match(r))||void 0===o?void 0:o.groups)||{},c=parseFloat(u.alpha),i=parseInt(u.blue,10),a=parseInt(u.green,10),p=parseInt(u.red,10);if(isNaN(i)||isNaN(a)||isNaN(p))return e;const l=[p,a,i].map((t=>t.toString(16).padStart(2,"0").toUpperCase())).join("");if(isNaN(c))return"#".concat(l);return"#".concat(l).concat(parseInt("".concat(255*c),10).toString(16).padStart(2,"0").toUpperCase())};const t=n(/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)/,{red:1,green:2,blue:3}),r=n(/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((1|0(\.\d+)?))\)/,{red:1,green:2,blue:3,alpha:4})}}));
//# sourceMappingURL=convertRGBtoHex.js.map