/* * renga v1.0.3 (https://github.com/l4nk332/renga) * Copyright (c) 2019 Ian Jabour * Licensed under MIT (https://github.com/l4nk332/renga/blob/master/LICENSE) */ var renga=function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){return u(t)||function(t,e){var n=[],r=!0,o=!1,u=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,u=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw u}}return n}(t,e)||a()}function o(t){return u(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||a()}function u(t){if(Array.isArray(t))return t}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance")} // TODO: Possibly need to remove the ^ and $ to make less strict var c=/^[a-z]+(-+[a-z]+)+$/i,i=/^[a-z]+([A-Z][a-z]*)+$/,l=/([A-Z][a-z]*)/g;function f(t){if(!function(t){return c.test(t)}(t))return t;var e=o(t.split("-")),n=e[0],r=e.slice(1).filter(function(t){return t.length}).map(function(t){return"".concat(t[0].toUpperCase()).concat(t.slice(1).toLowerCase())}).join("");return"".concat(n).concat(r)}function s(t){return function(t){return i.test(t)}(t)?t.split(l).filter(function(t){return t.length}).map(function(t){return t.toLowerCase()}).join("-"):t}var m="fragment",p="text";function y(t){return null===t||!1===t}function d(t){return n=t,["string","number"].some(function(t){return e(n)===t})||!1===t||null===t||b(t)&&"nodeName"in t&&"nodeType"in t;var n}function b(t){return"object"===e(t)&&!Array.isArray(t)&&null!==t}function v(t,e){Object.entries(e).filter(function(t){var e=r(t,2);e[0];return!1!==e[1]}).map(function(t){var e,n=r(t,2),o=n[0],u=n[1];return[s(o),(e=u,e&&"boolean"==typeof e?"":e)]}).forEach(function(e){var n=r(e,2),o=n[0],u=n[1];"events"===o&&b(u)?function(t,e){Object.entries(e).forEach(function(e){var n=r(e,2),o=n[0],u=n[1];t.addEventListener(o,u)})}(t,u):"style"===o&&b(u)?function(t,e){Object.entries(e).forEach(function(e){var n=r(e,2),o=n[0],u=n[1];t.style[s(o)]=u})}(t,u):t.setAttribute(o,u)})}function g(t,e){y(e)||t.appendChild("string"==typeof e?document.createTextNode(e):e)}function h(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;(function(t){return Array.isArray(t)?t.every(d):d(t)})(e)&&(n=e,e=null);var r=t===m?document.createDocumentFragment():t===p?document.createTextNode(y(n)?"":n):document.createElement(t);return![m,p].includes(t)&&e&&v(r,e),t!==p&&n&&function(t,e){Array.isArray(e)?e.forEach(function(e){return g(t,e)}):g(t,e)}(r,n),r}}var j=["a","abbr","address","area","article","aside","audio","base","bdi","bdo","blockquote","body","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template",p,"textarea","tfoot","th","thead","time","tr","track","u","ul","var","video",m].reduce(function(t,e){return function(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:"",r={},o=e.replace(/\.([a-z-_]+)/gi,function(e,o){var u=f(o),a=n?"__".concat(n):n,c="".concat(t,"__").concat(u).concat(a);return r[u]=c,".".concat(c)});return{classNames:r,styles:o}},t}({});