nodality
Version:
A lightweight library for declarative UI elements.
2 lines • 42.7 kB
JavaScript
/*! For license information please see text.esm.js.LICENSE.txt */
function t(e){return t="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(e)}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var s,i,n,o,a=[],l=!0,c=!1;try{if(n=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(s=n.call(r)).done)&&(a.push(s.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}(t,e)||s(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=s(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,n=function(){};return{s:n,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}function s(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,s=Array(e);r<e;r++)s[r]=t[r];return s}function n(t,e){for(var r=0;r<e.length;r++){var s=e[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,o(s.key),s)}}function o(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,"string");if("object"!=t(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}var a=function(){return t=function t(){var e,r,s,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,s=function(t){if(console.log("LOBJO IS"),console.log(t),t.transform||t.op&&t.op.transform){var e=t.transform;t.transform||(e=t.op.transform),e.duration||(e.duration="3s-ease-in-out"),i.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var r=function(){var r="",s="",n="",o="",a="",l="",c="",h="",u="";if(0!==e.values.length){e.values.forEach((function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(s=t.replace("ty:","")),t.startsWith("tz:")?n=t.replace("tz:",""):t.startsWith("scale(")?o=t:t.startsWith("skew(")?a=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var r=e[1].split(",").map((function(t){return t.trim()}));return 1===r.length?"rotate(".concat(r[0],")"):2===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],")"):3===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],") rotate(").concat(r[2],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?h=t:t.startsWith("opacity:")&&(u=t.replace("opacity:",""))})),r=i.setDefault(r),s=i.setDefault(s),n=i.setDefault(n);var d="";if("0px"!=s&&"0px"!=r&&"0px"!=n?d+="translate3d(".concat(r,", ").concat(s,", ").concat(n,")"):"0px"==s&&"0px"==r||(d+="translate(".concat(r,", ").concat(s,")")),o&&(d+=" ".concat(o)),l&&(d+=" ".concat(l)),a&&(d+=" ".concat(a)),c&&(d+=" ".concat(c)),h&&(d+=" ".concat(h)),d){if(t.op.transform.duration){var y=t.op.transform.duration.replace(/^(\d+)(s)-/,(function(t,e,r){return e/2+r+" "})),f="transform ".concat(y,", opacity ").concat(y);i.res.style.transition=f}else i.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.transform.static&&(i.res.style.transition=""),(i.blastTarget||i.res).style.transform=d,i.res.style.opacity=u}else alert("OPE")}};e.on?i.res.addEventListener(e.on,(function(){e.delay?setTimeout((function(){r()}),e.delay):r()})):window.addEventListener("load",(function(){e.delay?setTimeout((function(){r()}),e.delay):r()}));var s=function(){var t="";e.values.forEach((function(e){e.startsWith("tx:")?t+="translateX(0) ":e.startsWith("ty:")?t+="translateY(0) ":e.startsWith("tz:")?t+="translateZ(0) ":e.startsWith("scale(")?t+="scale(1) ":e.startsWith("skew(")?t+="skew(0, 0) ":e.startsWith("rotate(")?t+="rotate(0) ":e.startsWith("perspective(")?t+="perspective(0) ":e.startsWith("matrix(")&&(t+="matrix(1, 0, 0, 1, 0, 0) "),i.res.style.opacity="1"})),t&&(i.res.style.transform=t.trim())};if(e.on)i.res.addEventListener("mouseout",(function(){e.keep||s()}));else{var n=1e3*parseFloat(e.duration),o=e.closeAfter?e.closeAfter:0;setTimeout((function(){e.keep||s()}),n/2+o)}e.hardCSS&&(i.res.style.transform=e.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block"),console.log("INVALID BLOCKA"),console.log(t)},(r=o(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[r]=s,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}},s=[{key:"keySet",value:function(t){return this.temporaryVal=1,this.res.style[t.key]=t.value,this}},{key:"onScroll",value:function(t){var e=this;"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value&&(this.res.style.transform="scale(".concat(t.valMax,")")),window.addEventListener("scroll",(function(){var r=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?e.res.style.opacity=r:"scale"===t.value&&(e.res.style.transform="scale(".concat(r,")"))}))}},{key:"setAny",value:function(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}},{key:"setID",value:function(t){this.id=t}},{key:"setPrevText",value:function(t){this.prevText=t}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}},{key:"respad",value:function(t){var e=this,r=function(){e.pad(t[0].values);for(var r=0;r<t.length;r++){var s=t[r].breakpoint;window.matchMedia("(min-width: ".concat(e.getPX(s))).matches&&e.pad(t[r].values)}};window.addEventListener("resize",r),r()}},{key:"resmar",value:function(t){var e=this,r=function(){e.mar(t[0].values);for(var r=0;r<t.length;r++){var s=t[r].breakpoint;window.matchMedia("(max-width: ".concat(e.getPX(s))).matches&&e.mar(t[r].values)}};window.addEventListener("resize",r),r()}},{key:"resprop",value:function(t){var e=this;console.log("RES STYLE"),console.log(t),this.prevStyles={};for(var r=0;r<this.res.style.length;r++){var s=this.res.style[r];this.prevStyles[s]=this.res.style[s],console.log("kio")}var i=function(){for(var r in e.prevStyles)e.res.style[r]=e.prevStyles[r];console.log("mkio");for(var s=0;s<t.length;s++){var i=t[s].breakpoint,n="(max-width: ".concat(i,")");if(console.log("testing media query:",n,window.matchMedia(n).matches),window.matchMedia(n).matches)for(var o in t[s])"breakpoint"!==o&&(console.log("ukio"),e.res.style[o]=t[s][o])}};window.addEventListener("resize",i),i()}},{key:"isNumber",value:function(t){return"number"==typeof t&&!isNaN(t)}},{key:"pad",value:function(t){for(var e=0;e<t.length;e++)for(var r=Object.keys(t[e]),s=0;s<r.length;s++)for(var i=r[s],n=t[e][i],o=0;o<i.length;o++)switch(i[o]){case"a":this.res.style.padding=this.isNumber(n)?"".concat(n,"px"):n;break;case"t":this.res.style.paddingTop=this.isNumber(n)?"".concat(n,"px"):n;break;case"l":this.res.style.paddingLeft=this.isNumber(n)?"".concat(n,"px"):n;break;case"r":this.res.style.paddingRight=this.isNumber(n)?"".concat(n,"px"):n;break;case"b":this.res.style.paddingBottom=this.isNumber(n)?"".concat(n,"px"):n}return this}},{key:"as",value:function(t){return this.res.style.alignSelf=t,this}},{key:"mar",value:function(t){for(var e=0;e<t.length;e++)for(var r=Object.keys(t[e]),s=0;s<r.length;s++)for(var i=r[s],n=t[e][i],o=0;o<i.length;o++){switch(i[o]){case"a":this.res.style.margin=this.isNumber(n)?"".concat(n,"px"):n;break;case"t":this.res.style.marginTop=this.isNumber(n)?"".concat(n,"px"):n;break;case"l":this.res.style.marginLeft=this.isNumber(n)?"".concat(n,"px"):n;break;case"r":this.res.style.marginRight=this.isNumber(n)?"".concat(n,"px"):n;break;case"b":this.res.style.marginBottom=this.isNumber(n)?"".concat(n,"px"):n}"auto"===i[o]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}return this}},{key:"smartRange",value:function(t,e,r){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var s=(t-e.min)/(e.max-e.min);e.min>e.max&&(s=(t-e.max)/(e.min-e.max));var i=(r.min-r.max)*s-r.min;if(i=Math.abs(i),r.min<r.max){var n=(r.max+Math.abs(r.min))*s;i=r.min+n}return i}},{key:"gpos",value:function(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}},{key:"fluidCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(t){this.index=t}},{key:"borderObj",value:function(t){var e,r=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(r," ").concat(t.color),this.res.style.borderRadius=t.radius,this}},{key:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"setTags",value:function(t){this.openTag=t.open,this.closeTag=t.close,console.log("TAGS SET"),console.log(t)}},{key:"chainReact",value:function(t,s,i){var n=this;console.log("0P"),this.ap=!1,this.cta=0,this.once=!1;var o,a=r(t);try{for(a.s();!(o=a.n()).done;){var l=o.value;l.range||(l.range=["0px","999999px"])}}catch(t){a.e(t)}finally{a.f()}t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var c=function(o){var a=window.visualViewport.width,l=[],c=[];n.resCopy=n.res,n.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var h,u=r(t);try{for(u.s();!(h=u.n()).done;){var d=h.value;n.counterIndex++;var y=e(d.range,2),f=y[0],p=y[1],m=parseInt(f),v=parseInt(p),g=!0;if(d.target){g=!1;for(var x=0;x<d.target.length;x++)d.target[x]===s&&(g=!0)}a>=m&&a<=v&&g&&(l.push(d.log),c.push(d),d.op&&d.op.margin&&(n.useMargin=d.op.margin))}}catch(t){u.e(t)}finally{u.f()}if(i&&!i.includes("background")&&(n.res.style.background="",n.res.style.backgroundColor=""),n.res.style.textShadow="",i&&!i.includes("border")&&(n.res.style.border=""),i&&!i.includes("margin")&&(n.res.style.margin=""),n.res.style["-webkit-text-fill-color"]="",n.res.style["-webkit-text-stroke-color"]="",n.res.style["-webkit-text-stroke-width"]="",n.res.style.filter="",n.options.background&&(console.log(n.options.background),n.res.style.background=n.options.background),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(n.res.style.position="relative"),l.includes("blast")){var w,b=c.filter((function(t){return"blast"===t.log}))[0].op.color,k=null!==(w=c.filter((function(t){return"blast"===t.log}))[0].op.width)&&void 0!==w?w:"1px";"FlexRowLayoutElement"===n.getType()||"LayoutWrapperElement"===n.getType()?(n.res.style.border="".concat("number"==typeof k?k+"px":k," solid orange"),n.res.style.display="inline-block","FlexRowLayoutElement"===n.getType()&&(n.res.style.display="flex"),n.res.style.boxSizing="border-box",n.res.style.transformOrigin="center",n.blastTarget=n.res):(n.text&&(n.res.textContent=n.text),n.res.style["-webkit-text-fill-color"]="transparent",n.res.style["-webkit-text-stroke-color"]=b,n.res.style["-webkit-text-stroke-width"]="".concat(k))}if(l.includes("filter")){var S=c.filter((function(t){return"filter"===t.log}))[0].op.filter;n.res.style.filter=S}if(l.includes("background")&&(n.res.style.backgroundColor="green"),l.includes("gradient")&&("LayoutWrapperElement"!==n.getType()&&"FlexRowLayoutElement"!==n.getType()&&(n.res.style["-webkit-text-fill-color"]="transparent"),n.res.style.background=n.globalGradient,"LayoutWrapperElement"!==n.getType()&&"FlexRowLayoutElement"!==n.getType()&&(n.res.style["background-clip"]="text")),l.includes("shadow")){var T,z="",E=0;for(x=0;x<n.options.shadow.op.steps;x++){var C;z+="drop-shadow(".concat(E+=3,"px ").concat(E,"px ").concat(E,"px ").concat(null!==(C=n.options.shadow.color)&&void 0!==C?C:"gray",") ")}"FlexRowLayoutElement"===n.getType()||"LayoutWrapperElement"===n.getType()?n.res.style.boxShadow="".concat(E,"px ").concat(E,"px ").concat(E,"px ").concat(null!==(T=n.options.shadow.color)&&void 0!==T?T:"gray"):n.res.style.filter=z}if(l.includes("margin"))for(x=0;x<t.length;x++)if(t[x].op){var O=t[x].op.offsets;O&&void 0!==n.index&&(n.res.style.margin=O[Number(n.index)]+"px")}if(l.includes("spana")||l.includes("span")){if(n.res=n.resCopy,n.options.span){var L;for(L=Array.isArray(n.options.span)?n.options.span.filter((function(t){return"span"===t.op.name}))[0]:n.options.span,n.res.textContent="",x=0;x<L.op.parts.length;x++){var A=L.op.parts[x].style,j=new n.constructor(L.op.parts[x].text).setup({type:"span"}).set(A).render();n.res.appendChild(j)}}}else{var R=new n.constructor(n.prevText).set({}).render();n.prevText&&n.prevText.length>0&&o&&n.res.appendChild(R)}if(l.includes("animation")){if(n.options.animation&&!n.hasAnimated&&!n.options.animation.op.fireAt){console.warn(n.openTag),n.hasAnimated=!0;var I=n.options.animation.op;window.addEventListener("sidebar:open",(function(){n.res.animate(I.keyframesOpen,I.openOptions)})),window.addEventListener("sidebar:closed",(function(){n.res.animate(I.keyframesClose,I.closeOptions)})),n.res.animate(I.keyframesClose,{duration:0,fill:"forwards"}),n.openTag&&n.closeTag&&(window.addEventListener(n.openTag,(function(){n.res.animate(I.keyframesOpen,I.openOptions)})),window.addEventListener(n.closeTag,(function(){n.res.animate(I.keyframesClose,I.closeOptions)})))}if(n.options.animation&&n.options.animation.op.fireAt&&n.options.animation.op.fireAt.endsWith("px")){var M=n.options.animation.op;n.res.animate(M.keyframesClose,{duration:0,fill:"forwards"});var W=function(){window.scrollY>parseFloat(M.fireAt)&&(n.res.animate(M.keyframesOpen,M.openOptions),window.removeEventListener("scroll",W))};window.addEventListener("scroll",W)}if(n.options.animation&&n.options.animation.op.fireAt&&"inview"===n.options.animation.op.fireAt){var N=n.options.animation.op;n.res.animate(N.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(t,e){t.forEach((function(t){t.isIntersecting&&(n.res.animate(N.keyframesOpen,N.openOptions),e.disconnect())}))})).observe(n.res)}}};this.options.animation||window.addEventListener("resize",(function(){return c()})),c()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}}],s&&n(t.prototype,s),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,s}();function l(t){return l="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},l(t)}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@"];if(null!=r){var s,i,n,o,a=[],l=!0,c=!1;try{if(n=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(s=n.call(r)).done)&&(a.push(s.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}(t,e)||h(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,s=Array(e);r<e;r++)s[r]=t[r];return s}function d(t,e){for(var r=0;r<e.length;r++){var s=e[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,y(s.key),s)}}function y(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@ must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(f=function(){return!!t})()}function p(t,e,r,s){var i=m(v(1&s?t.prototype:t),e,r);return 2&s&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var s=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=v(t)););return t}(t,e);if(s){var i=Object.getOwnPropertyDescriptor(s,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},m.apply(null,arguments)}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}var x=function(){function t(e,r){var s;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(s=function(t,e,r){return e=v(e),function(t,e){if(e&&("object"==l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,f()?Reflect.construct(e,r||[],v(t).constructor):e.apply(t,r))}(this,t)).text=e,s.res=null,s.setup(r),s.code=[],s.elCSS=[],s.html=[],s.react=[],s.code.push('new Text("'.concat(s.text,'")')),console.log("AAAAA"),s}return function(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}(t,a),e=t,r=[{key:"flexOne",value:function(){return this.res.style.flex="1",this}},{key:"setGridWithoutCode",value:function(){return this.res.style.border="1px solid white",this}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"toCodea",value:function(){return this.excludeFromCodeTrue&&(this.code=[""]),this.code}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options).filter((function(t){var e=c(t,2);return e[0],null!==e[1]}))),e=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:");return['new Text("'.concat(this.text,'").set(').concat(e,")")]}},{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"toElCSS",value:function(){return this.elCSS=this.elCSS.map((function(t){return" "+t})),this.preffersId?this.elCSS.unshift(this.res.id+" { \n"):this.elCSS.unshift("."+this.class+" { \n"),this.elCSS.push(" } \n \n"),this.elCSS}},{key:"getType",value:function(){return"S1"===this.options.fluidc?"HTMLHeaderElement":"HTMLParagraphElement"}},{key:"gradientOptions",value:function(t){var e=this;if(0===t.length)return this;var r=t.filter((function(t){return"gradient"===t.op.name}))[0];if(void 0===r)return this;var s=r.op;if(r.point){var i=function(){window.matchMedia("(min-width: ".concat(r.range[0],") and (max-width: ").concat(r.range[1],")")).matches&&(e.prevBackground=e.res.style.color.toString(),e.res.style.background=s.gradient,e.res.style.WebkitBackgroundClip="text")};i(),window.addEventListener("resize",i)}}},{key:"strokeOptions",value:function(t){var e=this;if(0===t.length)return this;var r=t.filter((function(t){return"blast"===t.op.name}))[0];if(void 0===r)return this;console.log("DEL");var s=r.op;if(r.point){var i=function(){window.matchMedia("(min-width: ".concat(r.range[0],") and (max-width: ").concat(r.range[1],")")).matches&&(s.color?e.res.style["-webkit-text-stroke"]="".concat(s.width?s.width:"1px"," ").concat(s.color):e.res.style["-webkit-text-stroke"]="1px orange",e.res.style["-webkit-text-fill-color"]="transparent")};i(),window.addEventListener("resize",i)}else s.color&&(this.res.style["-webkit-text-stroke"]="".concat(s.width?s.width:"1px"," ").concat(s.color)),this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"stroke",value:function(){return this.res.style["-webkit-text-stroke"]="3px orange",this}},{key:"fill",value:function(){return this.res.style["-webkit-text-fill-color"]="transparent",this}},{key:"rowCol",value:function(t,e){return this.res.style.gridRow=t,this.res.style.gridColumn=e,this}},{key:"setGridRow",value:function(t){return this.res.style.gridRow=t,this}},{key:"setGridCol",value:function(t){return this.res.style.gridColumn=t,this}},{key:"toHTML",value:function(){return this.res}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"setRandom",value:function(){for(var t="LAYOUT-",e=90;e>0;--e)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return t+=(new Date).getTime(),this.res.setAttribute("class",t),this}},{key:"styled",value:function(t){return this.set(t),this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"set",value:function(e){return this.resCopy=this.res,this.options=e,p(t,"setPrevText",this,3)([this.text]),e.top&&(this.res.style.top=e.top),e.left&&(this.res.style.left=e.left),e.flex&&(this.res.style.display="flex"),(e.left||e.top)&&(this.res.style.position="absolute"),e.maxWidth&&(this.res.style.maxWidth=e.maxWidth),e.cursor&&(this.res.style.cursor="hand"),e.gpos&&this.gpos(e.gpos),e.vtn&&(this.res.style.viewTransitionName=e.vtn),e.index&&p(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.preffersId&&(this.preffersId=e.preffersId),p(t,"setPref",this,3)([e.preffersId]),e.removeDecoration&&(this.res.style.textDecoration="none"),e.block&&(this.res.style.display="block"),e.area&&this.setArea(e.area),e.icon&&this.addIcon(e.icon),e.color&&this.color(e.color),e.color&&this.elCSS.push("color: ".concat(e.color,"; \n")),e.class&&this.setClass(e.class),e.size&&this.fluidCopy(e.size),e.fluidc&&this.fluidCopy(e.fluidc),e.initLetter&&this.initLetter(e.initLetter),e.onTap&&this.onTap(e.onTap),"S6"===e.fluidc?e.fluidc&&this.elCSS.push("font-size: calc(1.1rem + 2.075vw); \n"):e.fluidc&&this.elCSS.push("font-size: calc(1.625rem + 5.075vw); \n"),this.options.id&&this.res.setAttribute("id",this.options.id),p(t,"setID",this,3)([this.options.id]),this.options.class&&this.res.setAttribute("class",this.options.class),p(t,"setClass",this,3)([this.options.class]),e.clampc&&this.clampCopy(e.clampc),e.arrpad&&this.arrayPadding(e.arrpad.sides,e.arrpad.value),e.pad&&this.pad(e.pad),e.respad&&this.respad(e.respad),e.resmar&&this.resmar(e.resmar),e.mar&&this.mar(e.mar),e.exact&&(this.res.style.fontSize=e.exact),e.zIndex&&(this.res.style.zIndex=e.zIndex),e.absolute&&(this.res.style.position="absolute"),e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.em&&this.em(e.em),e.fluid&&this.fluid(e.fluid),e.font&&this.font(e.font),e.fluidc&&this.elCSS.push("font-family: ".concat(e.font,"; \n")),e.align&&(this.res.style.textAlign=e.align),e.weight&&(this.res.style.fontWeight=e.weight),e.padding&&this.padding(e.padding),e.breakWord&&(this.res.style.wordWrap="break-word"),e.center&&(this.res.style.marginRight="auto"),e.center&&(this.res.style.marginLeft="auto"),e.width&&(this.res.style.width=e.width),e.height&&(this.res.style.height=e.height),e.background&&(this.res.style.backgroundColor=e.background),e.radius&&(this.res.style.borderRadius=e.radius),e.resprop&&this.resprop(e.resprop),e.italic&&this.italic(),e.responsive&&this.responsive(),e.border&&(this.res.style.border="".concat(e.border)),e.onScroll&&this.onScroll(e.onScroll),e.keySet&&this.keySet(e.keySet),e.maxHeight&&(this.res.style.maxHeight=e.maxHeight),e.transform&&(console.warn("ARE DIFFERENT OBJS HERE?"),console.warn(e.transform)),e.transform&&this.reactOnTransform(e.transform),console.log("OGA"),console.log(e),this.callReact(e),this}},{key:"callReact",value:function(e){var r=[];if(e.stroke||e.gradient||e.span||e.backgroundOp||e.layout||e.shadow||e.animation||e.filtera||e.transform){e.gradient&&(this.globalGradient=e.gradient.op.gradient,"radial"===e.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),e.stroke&&p(t,"setAny",this,3)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var s=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,e.transform];s=s.filter((function(t){return null!=t}));for(var i=0;i<s.length;i++)r.push({range:s[i].range,log:s[i].op.name,target:s[i].target,op:s[i].op});var n=[];e.borderObj&&n.push("border"),e.background&&n.push("background"),e.mar&&n.push("margin"),e.animation&&n.push("animation"),e.span&&n.push("span"),console.log("ARA IS "),console.log(r),this.chainReact(r,this.options.id,n)}}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"addIcon",value:function(t){var e=document.createElement("img");return e.style.width="20px",e.style.marginLeft="10px",e.style.height="auto",e.setAttribute("src",t.url),this.res.appendChild(e),this}},{key:"checkForAnimation",value:function(t){t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var e,r=window.innerWidth,s=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=h(t))){e&&(t=e);var r=0,s=function(){};return{s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,o=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return n=t.done,t},e:function(t){o=!0,i=t},f:function(){try{n||null==e.return||e.return()}finally{if(o)throw i}}}}(t);try{for(s.s();!(e=s.n()).done;){var i=e.value,n=c(i.range,2),o=n[0],a=n[1],l=parseInt(o),u=parseInt(a);r>=l&&r<=u&&"animation"===i.log&&this.res.animate([{opacity:0,transform:"translateY(100px)"},{opacity:1,transform:"translateY(0)"}],{duration:1e3,easing:"ease"})}}catch(t){s.e(t)}finally{s.f()}}},{key:"resetSmall",value:function(){this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-fill-color"]=""}},{key:"resetGradient",value:function(){return this.res.style.WebkitBackgroundClip="text",this.res.style.background="transparent",this}},{key:"resetStroke",value:function(){this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-fill-color"]=""}},{key:"innerStroke",value:function(t){t.color?this.res.style["-webkit-text-stroke"]="".concat(t.width?t.width:"1px"," ").concat(t.color):this.res.style["-webkit-text-stroke"]="1px orange",this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"innerGradient",value:function(t){this.res.style.background="linear-gradient(45deg, #ff0000, #00ff00)",this.res.style["-webkit-background-clip"]="text"}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),e||(this.res.style.marginBottom=t),this}},{key:"clampExperiment",value:function(){return this.res.style.fontSize="clamp(1rem, calc(1rem * 10rem), 3rem)",this}},{key:"between",value:function(t){return"S1"===t&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===t&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===t&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===t&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===t&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===t&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"betweenCopy",value:function(t){return"S1"===t&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===t&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===t&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===t&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===t&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===t&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"stringGen",value:function(t){for(var e="",r=0;r<t;r++)e+="abcdefghijklmnopqrstuvwxyz".charAt(Math.floor(26*Math.random()));return e}},{key:"initLetter",value:function(t){var e=document.createElement("style");document.body.appendChild(e),Math.random();var r=this.stringGen(1e3);return this.res.setAttribute("id",r),document.styleSheets[0].insertRule("#".concat(r,"::first-letter { color: green; font-size: 3em; padding: 0.1em }"),0),this}},{key:"constant",value:function(t){return"S1"===t&&this.jumbotron(),"S2"===t&&this.large(),"S3"===t&&this.medium(),this}},{key:"minusMargin",value:function(){return this.res.style.marginRight="-3.1em",this}},{key:"fluid",value:function(t){if("S1"===t){this.res=document.createElement("h1");var e=document.createTextNode(this.text);this.res.appendChild(e),this.res.style.fontSize="calc(1.625rem + 4.3vw)"}if("S2"===t){this.res=document.createElement("h2");var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.525rem + 3.525vw)"}if("S3"===t){this.res=document.createElement("h3");var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.375rem + 2.75vw)"}if("S4"===t){this.res=document.createElement("h4");var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.275rem + 1.975vw)"}return"S5"===t&&(this.res.style.fontSize="calc(1.1rem + 1.2vw)"),this}},{key:"getClampValue",value:function(t){return"S7"===t?"clamp(1.45rem, 2vw + 1.5rem, 1.69rem)":"S6"===t?"clamp(2.25rem, 2vw+1.5rem, 3.25rem)":"S5"===t?"clamp(2.75rem, 2vw + 1.5rem, 3.25rem)":"S4"===t?"clamp(3.5rem, 2vw + 1.5rem, 3.25rem)":"S3"===t?"clamp(4.25rem, 2vw + 1.5rem, 3.25rem)":"S2"===t?"clamp(5rem, 2vw + 1.5rem, 3.25rem)":"S1"===t?"clamp(6rem, 2vw + 1.5rem, 3.25rem)":void 0}},{key:"clampCopy",value:function(t){return this.res.style.fontSize=this.getClampValue(t),this}},{key:"fluidCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.options&&!1===this.options.preffersId?this.html.push('<p class="'.concat(this.options.class,'">').concat(this.text,"</p> \n \n")):this.options&&this.options.id&&this.html.push('<p id="'.concat(this.options.id.substr(1),'">').concat(this.text,"</p> \n \n")),this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"toReactComponent",value:function(){return this.react.push("function Godzilla() { \n"),this.react.push('return <h1 class="'.concat(this.options.class,'">').concat(this.text,"</h1> \n")),this.react.push("} \n \n"),this.react}},{key:"myself",value:function(t){var e=this,r=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize=t.desktop:e.res.style.fontSize=t.phone};return r(),window.addEventListener("resize",r),this}},{key:"jumbotron",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="8rem":t.res.style.fontSize="6rem"};return e(),window.addEventListener("resize",e),this}},{key:"large",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="7rem":t.res.style.fontSize="5rem"};return e(),window.addEventListener("resize",e),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,this}},{key:"vw",value:function(t,e,r){}},{key:"responsive",value:function(t){var e=this;this.set=!1,this.setB=!1;var r=function(){window.innerWidth<t.minw?(e.setB=!1,e.set||(e.res.style.color="#3498db",e.res.style.fontSize="".concat(t.baseVW/100*window.innerWidth,"px"),e.set=!0)):window.innerWidth>t.maxw?(e.set=!1,e.setB||(e.res.style.color="orange",e.res.style.fontSize="".concat(t.baseVW/100*t.maxw,"px"),e.setB=!0)):(e.set=!1,e.setB=!1,e.res.style.color="black",e.res.style.fontSize="".concat(t.baseVW,"vw"))};return r(),window.addEventListener("resize",r),this}},{key:"xlarge",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="6.5rem":t.res.style.fontSize="8.5rem"};return e(),window.addEventListener("resize",e),this}},{key:"medium",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2.25rem":t.res.style.fontSize="1.5em"};return e(),window.addEventListener("resize",e),this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"small",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="1.5em":t.res.style.fontSize="1em"};return e(),window.addEventListener("resize",e),this}},{key:"sizes",value:function(t){var e=this;this.res.style.fontSize="".concat(t[0].size,"rem");var r=function(){for(var r=0;r<t.length;r++)t[r].width&&window.matchMedia("(min-width: ".concat(t[r].width,"px)")).matches&&(e.res.style.fontSize="".concat(t[r].size));window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.fontSize="".concat(t[t.length-1].mobile))};return r(),window.addEventListener("resize",r),this}},{key:"setup",value:function(t){var e;t?((e=document.createElement(t.type)).setAttribute("id",t.id),t.type):e=document.createElement("p");var r=document.createTextNode(this.text);return e.appendChild(r),this.res=e,this.res.style.padding=0,this.res.style.margin=0,this}},{key:"hide",value:function(){return this.res.style.visibility="hidden",this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"center",value:function(){return this.res.style.textAlign="center",this}},{key:"size",value:function(t){return this.res.style.fontSize=t,this}},{key:"em",value:function(t){return this.res.style.fontSize="".concat(t,"em"),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"align",value:function(t){return this.res.style.textAlign="".concat(t),this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"bold",value:function(){return this.res.style.fontWeight="bold",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"width",value:function(t,e){return this.res.style.width=t,e&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"offset",value:function(t){return this.res.style.gridRow=2,this.res.style.gridColumn=2,this.res.style.marginLeft="-60px",this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"padding",value:function(t,e,r,s){return(t||e||r||s)&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=r,this.res.style.paddingBottom=s),e||r||s||(this.res.style.padding=t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),e||(this.res.style.paddingBottom=t),this}},{key:"margin",value:function(t,e){return"top"==t?this.res.style.marginTop=e:"bottom"==t?this.res.style.marginBottom=e:"left"==t?this.res.style.marginLeft=e:"right"==t&&(this.res.style.marginRight=e),this}},{key:"headline",value:function(){return this.em(4),this.font("Arial"),this.bold(),this}},{key:"caption",value:function(){return this.bold(),this.res.style.fontFamily="Arial",this.color("gray"),this.padding("top",20),this.res.style.fontSize="1em",window.matchMedia("(max-device-width: 415px)").matches?this.res.style.fontSize="2em":this.res.style.fontSize="1em",this}},{key:"updating",value:function(t,e){var r=this.res,s=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(s.replace("$",t));r.replaceChild(e,r.childNodes[0])}}),this}},{key:"style",value:function(t){return this.res.style.color=t.styles.color,this.res.style.fontWeight=t.styles.fontWeight,this.res.style.paddingLeft=t.styles.padding[0],this.res.style.paddingTop=t.styles.padding[1],this.res.style.paddingRight=t.styles.padding[2],this.res.style.paddingBottom=t.styles.padding[3],this.res.style.marginLeft=t.styles.margin[0],this.res.style.paddingTop=t.styles.margin[1],this.res.style.paddingRight=t.styles.margin[2],this.res.style.paddingBottom=t.styles.margin[3],this.res.style.opacity=t.styles.opacity,this}},{key:"applyStyle",value:function(t,e){return window.matchMedia("(max-width: ".concat(t,"px)")).matches&&Object.assign(this.res.style,e.styles),this}},{key:"nextApply",value:function(t){for(var e=this,r=[],s=(this.res.style,function(s){r[0].matches?Object.assign(e.res.style,t[0].styles):r[1].matches?Object.assign(e.res.style,t[1].styles):Object.assign(e.res.style,t[t.length-1].styles)}),i=0;i<t.length;i++){var n=t[i],o=window.matchMedia("(min-width: ".concat(n.min,"px) and (max-width: ").concat(n.max,"px)"));r.push(o),r[i].addListener(s)}return s(),this}},{key:"apply",value:function(t){var e=this,r=this.res.styles,s=function(){for(var s=0;s<t.length;s++){var i=t[s];i.min&&i.max?window.matchMedia("(min-width: ".concat(i.min,"px) and (max-width: ").concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):(alert("YES min max, but does not match"),Object.assign(e.res.style,r)):window.matchMedia("(max-width: ".concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):(alert("NO min max, and does not match"),Object.assign(e.res.style,r))}};return s(),window.addEventListener("resize",s),this}},{key:"render",value:function(t){if(!t)return this.options&&!this.options.span&&(this.res.textContent=this.text),this.res;this.options&&this.options.id&&this.res.setAttribute("id",this.options.id),this.options&&!this.options.span&&(this.res.textContent=this.text),document.querySelector(t).appendChild(this.res)}}],r&&d(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();export{x as Text};