nodality
Version:
A lightweight library for declarative UI elements.
2 lines • 256 kB
JavaScript
/*! For license information please see elementMapper.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 n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||n(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=n(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}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 s,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,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw s}}}}function n(t,e){if(t){if("string"==typeof t)return o(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)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(e){var r=function(e){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}var l=function(){return t=function t(){var e,r,n,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=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="",n="",o="",s="",a="",l="",c="",u="",d="";if(0!==e.values.length){e.values.forEach((function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(n=t.replace("ty:","")),t.startsWith("tz:")?o=t.replace("tz:",""):t.startsWith("scale(")?s=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(")?u=t:t.startsWith("opacity:")&&(d=t.replace("opacity:",""))})),r=i.setDefault(r),n=i.setDefault(n),o=i.setDefault(o);var h="";if("0px"!=n&&"0px"!=r&&"0px"!=o?h+="translate3d(".concat(r,", ").concat(n,", ").concat(o,")"):"0px"==n&&"0px"==r||(h+="translate(".concat(r,", ").concat(n,")")),s&&(h+=" ".concat(s)),l&&(h+=" ".concat(l)),a&&(h+=" ".concat(a)),c&&(h+=" ".concat(c)),u&&(h+=" ".concat(u)),h){if(t.op.transform.duration){var f=t.op.transform.duration.replace(/^(\d+)(s)-/,(function(t,e,r){return e/2+r+" "})),p="transform ".concat(f,", opacity ").concat(f);i.res.style.transition=p}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=h,i.res.style.opacity=d}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 n=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||n()}));else{var o=1e3*parseFloat(e.duration),s=e.closeAfter?e.closeAfter:0;setTimeout((function(){e.keep||n()}),o/2+s)}e.hardCSS&&(i.res.style.transform=e.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block"),console.log("INVALID BLOCKA"),console.log(t)},(r=a(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}},n=[{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 n=t[r].breakpoint;window.matchMedia("(min-width: ".concat(e.getPX(n))).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 n=t[r].breakpoint;window.matchMedia("(max-width: ".concat(e.getPX(n))).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 n=this.res.style[r];this.prevStyles[n]=this.res.style[n],console.log("kio")}var i=function(){for(var r in e.prevStyles)e.res.style[r]=e.prevStyles[r];console.log("mkio");for(var n=0;n<t.length;n++){var i=t[n].breakpoint,o="(max-width: ".concat(i,")");if(console.log("testing media query:",o,window.matchMedia(o).matches),window.matchMedia(o).matches)for(var s in t[n])"breakpoint"!==s&&(console.log("ukio"),e.res.style[s]=t[n][s])}};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]),n=0;n<r.length;n++)for(var i=r[n],o=t[e][i],s=0;s<i.length;s++)switch(i[s]){case"a":this.res.style.padding=this.isNumber(o)?"".concat(o,"px"):o;break;case"t":this.res.style.paddingTop=this.isNumber(o)?"".concat(o,"px"):o;break;case"l":this.res.style.paddingLeft=this.isNumber(o)?"".concat(o,"px"):o;break;case"r":this.res.style.paddingRight=this.isNumber(o)?"".concat(o,"px"):o;break;case"b":this.res.style.paddingBottom=this.isNumber(o)?"".concat(o,"px"):o}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]),n=0;n<r.length;n++)for(var i=r[n],o=t[e][i],s=0;s<i.length;s++){switch(i[s]){case"a":this.res.style.margin=this.isNumber(o)?"".concat(o,"px"):o;break;case"t":this.res.style.marginTop=this.isNumber(o)?"".concat(o,"px"):o;break;case"l":this.res.style.marginLeft=this.isNumber(o)?"".concat(o,"px"):o;break;case"r":this.res.style.marginRight=this.isNumber(o)?"".concat(o,"px"):o;break;case"b":this.res.style.marginBottom=this.isNumber(o)?"".concat(o,"px"):o}"auto"===i[s]&&(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 n=(t-e.min)/(e.max-e.min);e.min>e.max&&(n=(t-e.max)/(e.min-e.max));var i=(r.min-r.max)*n-r.min;if(i=Math.abs(i),r.min<r.max){var o=(r.max+Math.abs(r.min))*n;i=r.min+o}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 n=document.createTextNode(this.text);this.res.appendChild(n),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 o=document.createTextNode(this.text);this.res.appendChild(o),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 s=document.createTextNode(this.text);this.res.appendChild(s),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,n,i){var o=this;console.log("0P"),this.ap=!1,this.cta=0,this.once=!1;var s,a=r(t);try{for(a.s();!(s=a.n()).done;){var l=s.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(s){var a=window.visualViewport.width,l=[],c=[];o.resCopy=o.res,o.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var u,d=r(t);try{for(d.s();!(u=d.n()).done;){var h=u.value;o.counterIndex++;var f=e(h.range,2),p=f[0],y=f[1],m=parseInt(p),v=parseInt(y),g=!0;if(h.target){g=!1;for(var b=0;b<h.target.length;b++)h.target[b]===n&&(g=!0)}a>=m&&a<=v&&g&&(l.push(h.log),c.push(h),h.op&&h.op.margin&&(o.useMargin=h.op.margin))}}catch(t){d.e(t)}finally{d.f()}if(i&&!i.includes("background")&&(o.res.style.background="",o.res.style.backgroundColor=""),o.res.style.textShadow="",i&&!i.includes("border")&&(o.res.style.border=""),i&&!i.includes("margin")&&(o.res.style.margin=""),o.res.style["-webkit-text-fill-color"]="",o.res.style["-webkit-text-stroke-color"]="",o.res.style["-webkit-text-stroke-width"]="",o.res.style.filter="",o.options.background&&(console.log(o.options.background),o.res.style.background=o.options.background),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(o.res.style.position="relative"),l.includes("blast")){var w,k=c.filter((function(t){return"blast"===t.log}))[0].op.color,x=null!==(w=c.filter((function(t){return"blast"===t.log}))[0].op.width)&&void 0!==w?w:"1px";"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()?(o.res.style.border="".concat("number"==typeof x?x+"px":x," solid orange"),o.res.style.display="inline-block","FlexRowLayoutElement"===o.getType()&&(o.res.style.display="flex"),o.res.style.boxSizing="border-box",o.res.style.transformOrigin="center",o.blastTarget=o.res):(o.text&&(o.res.textContent=o.text),o.res.style["-webkit-text-fill-color"]="transparent",o.res.style["-webkit-text-stroke-color"]=k,o.res.style["-webkit-text-stroke-width"]="".concat(x))}if(l.includes("filter")){var S=c.filter((function(t){return"filter"===t.log}))[0].op.filter;o.res.style.filter=S}if(l.includes("background")&&(o.res.style.backgroundColor="green"),l.includes("gradient")&&("LayoutWrapperElement"!==o.getType()&&"FlexRowLayoutElement"!==o.getType()&&(o.res.style["-webkit-text-fill-color"]="transparent"),o.res.style.background=o.globalGradient,"LayoutWrapperElement"!==o.getType()&&"FlexRowLayoutElement"!==o.getType()&&(o.res.style["background-clip"]="text")),l.includes("shadow")){var O,j="",C=0;for(b=0;b<o.options.shadow.op.steps;b++){var E;j+="drop-shadow(".concat(C+=3,"px ").concat(C,"px ").concat(C,"px ").concat(null!==(E=o.options.shadow.color)&&void 0!==E?E:"gray",") ")}"FlexRowLayoutElement"===o.getType()||"LayoutWrapperElement"===o.getType()?o.res.style.boxShadow="".concat(C,"px ").concat(C,"px ").concat(C,"px ").concat(null!==(O=o.options.shadow.color)&&void 0!==O?O:"gray"):o.res.style.filter=j}if(l.includes("margin"))for(b=0;b<t.length;b++)if(t[b].op){var P=t[b].op.offsets;P&&void 0!==o.index&&(o.res.style.margin=P[Number(o.index)]+"px")}if(l.includes("spana")||l.includes("span")){if(o.res=o.resCopy,o.options.span){var T;for(T=Array.isArray(o.options.span)?o.options.span.filter((function(t){return"span"===t.op.name}))[0]:o.options.span,o.res.textContent="",b=0;b<T.op.parts.length;b++){var A=T.op.parts[b].style,R=new o.constructor(T.op.parts[b].text).setup({type:"span"}).set(A).render();o.res.appendChild(R)}}}else{var L=new o.constructor(o.prevText).set({}).render();o.prevText&&o.prevText.length>0&&s&&o.res.appendChild(L)}if(l.includes("animation")){if(o.options.animation&&!o.hasAnimated&&!o.options.animation.op.fireAt){console.warn(o.openTag),o.hasAnimated=!0;var z=o.options.animation.op;window.addEventListener("sidebar:open",(function(){o.res.animate(z.keyframesOpen,z.openOptions)})),window.addEventListener("sidebar:closed",(function(){o.res.animate(z.keyframesClose,z.closeOptions)})),o.res.animate(z.keyframesClose,{duration:0,fill:"forwards"}),o.openTag&&o.closeTag&&(window.addEventListener(o.openTag,(function(){o.res.animate(z.keyframesOpen,z.openOptions)})),window.addEventListener(o.closeTag,(function(){o.res.animate(z.keyframesClose,z.closeOptions)})))}if(o.options.animation&&o.options.animation.op.fireAt&&o.options.animation.op.fireAt.endsWith("px")){var M=o.options.animation.op;o.res.animate(M.keyframesClose,{duration:0,fill:"forwards"});var I=function(){window.scrollY>parseFloat(M.fireAt)&&(o.res.animate(M.keyframesOpen,M.openOptions),window.removeEventListener("scroll",I))};window.addEventListener("scroll",I)}if(o.options.animation&&o.options.animation.op.fireAt&&"inview"===o.options.animation.op.fireAt){var _=o.options.animation.op;o.res.animate(_.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(t,e){t.forEach((function(t){t.isIntersecting&&(o.res.animate(_.keyframesOpen,_.openOptions),e.disconnect())}))})).observe(o.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}}],n&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}();function c(t){return c="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},c(t)}function u(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 n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||d(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 d(t,e){if(t){if("string"==typeof t)return h(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)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,p(n.key),n)}}function p(t){var e=function(t){if("object"!=c(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}function m(t,e,r,n){var i=v(g(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function v(){return v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=g(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},v.apply(null,arguments)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},g(t)}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}var w=function(){function t(e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(t,e,r){return e=g(e),function(t,e){if(e&&("object"==c(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,y()?Reflect.construct(e,r||[],g(t).constructor):e.apply(t,r))}(this,t)).text=e,n.res=null,n.setup(r),n.code=[],n.elCSS=[],n.html=[],n.react=[],n.code.push('new Text("'.concat(n.text,'")')),console.log("AAAAA"),n}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&&b(t,e)}(t,l),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=u(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 n=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=n.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 n=r.op;if(r.point){var i=function(){window.matchMedia("(min-width: ".concat(r.range[0],") and (max-width: ").concat(r.range[1],")")).matches&&(n.color?e.res.style["-webkit-text-stroke"]="".concat(n.width?n.width:"1px"," ").concat(n.color):e.res.style["-webkit-text-stroke"]="1px orange",e.res.style["-webkit-text-fill-color"]="transparent")};i(),window.addEventListener("resize",i)}else n.color&&(this.res.style["-webkit-text-stroke"]="".concat(n.width?n.width:"1px"," ").concat(n.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,m(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&&m(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.preffersId&&(this.preffersId=e.preffersId),m(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),m(t,"setID",this,3)([this.options.id]),this.options.class&&this.res.setAttribute("class",this.options.class),m(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&&m(t,"setAny",this,3)([{globalBlast:"".concat(e.stroke.op.width," ").concat(e.stroke.op.color)}]),e.span&&(e.span.prevText=this.text);var n=[e.stroke,e.gradient,e.animation,e.span,e.backgroundOp,e.layout,e.marginOp,e.shadow,e.animation,e.filtera,e.transform];n=n.filter((function(t){return null!=t}));for(var i=0;i<n.length;i++)r.push({range:n[i].range,log:n[i].op.name,target:n[i].target,op:n[i].op});var o=[];e.borderObj&&o.push("border"),e.background&&o.push("background"),e.mar&&o.push("margin"),e.animation&&o.push("animation"),e.span&&o.push("span"),console.log("ARA IS "),console.log(r),this.chainReact(r,this.options.id,o)}}},{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,n=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=d(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},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 i,o=!0,s=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw i}}}}(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,o=u(i.range,2),s=o[0],a=o[1],l=parseInt(s),c=parseInt(a);r>=l&&r<=c&&"animation"===i.log&&this.res.animate([{opacity:0,transform:"translateY(100px)"},{opacity:1,transform:"translateY(0)"}],{duration:1e3,easing:"ease"})}}catch(t){n.e(t)}finally{n.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 n=document.createTextNode(this.text);this.res.appendChild(n),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 n=document.createTextNode(this.text);this.res.appendChild(n),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 o=document.createTextNode(this.text);this.res.appendChild(o),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 s=document.createTextNode(this.text);this.res.appendChild(s),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,n){return(t||e||r||n)&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=r,this.res.style.paddingBottom=n),e||r||n||(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,n=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(n.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=[],n=(this.res.style,function(n){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 o=t[i],s=window.matchMedia("(min-width: ".concat(o.min,"px) and (max-width: ").concat(o.max,"px)"));r.push(s),r[i].addListener(n)}return n(),this}},{key:"apply",value:function(t){var e=this,r=this.res.styles,n=function(){for(var n=0;n<t.length;n++){var i=t[n];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 n(),window.addEventListener("resize",n),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&&f(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function k(t){return k="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},k(t)}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,O(n.key),n)}}function O(t){var e=function(t){if("object"!=k(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=k(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==k(e)?e:e+""}function j(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(j=function(){return!!t})()}function C(t,e,r,n){var i=E(P(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function E(){return E="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=P(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},E.apply(null,arguments)}function P(t){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},P(t)}function T(t,e){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},T(t,e)}var A=function(){function t(e,r,n,i){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(o=function(t,e,r){return e=P(e),function(t,e){if(e&&("object"==k(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,j()?Reflect.construct(e,r||[],P(t).constructor):e.apply(t,r))}(this,t)).url=e,o.res=null,o.code=[],o}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&&T(t,e)}(t,l),e=t,r=[{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"setType",value:function(t){t.url;var e=t.type,r=t.mode;if(this.code=[],"exact"===e){var n='new Image("'.concat(this.url,'", "exact")');this.code.push(n)}else if("uncover"===e){var i='new Image("'.concat(this.url,'", "uncover")');this.code.push(i)}else this.code.push("new Image('".concat(this.url,"')"));return this.image(this.url,r,e),this}},{key:"flexOne",value:function(){return this.res.style.flex="1",this}},{key:"hand",value:function(){return this.res.style.cursor="hand",this}},{key:"setGridWithoutCode",value:function(){return this.res.style.border="1px solid white",this}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"getHeight",value:function(){return this.res.height}},{key:"getWidth",value:function(){return this.res.width}},{key:"getType",value:function(){return"HTMLImageElement"}},{key:"toCode",value:function(){var t=this.options;this.res.style.border&&(t.border=this.res.style.border);var e=Object.fromEntries(Object.entries(t).filter((function(t){var e=function(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 n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return x(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)?x(t,e):void 0}}(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.")}()}(t,2);return e[0],null!==e[1]})));return["new Image().set(".concat(JSON.stringify(e,null,2).replace(/"(\w+)"\s*:/g,"$1:"),")")]}},{key:"formatObj",value:function(t){return JSON.stringify(t,null,2).replace(/"(\w+)"\s*:/g,"$1:")}},{key:"set",value:function(e){var r="";this.options=e;var n=e.isFull;if(n?this.image(e.url,"exact",n,"a"):this.setup(),e.url&&this.res.setAttribute("src",e.url),"exact"===n?'new Image("'.concat(this.url,'", "exact")'):"uncover"===n&&'new Image("'.concat(this.url,'", "uncover")'),e.vtn&&(this.res.style.viewTransitionName=e.vtn),this.vtn=e.vtn,e.minHeight&&(this.res.style.minHeight=e.minHeight),e.index&&C(t,"setIndex",this,3)([e.index]),e.index&&(this.index=e.index),e.index&&(r+='\n index: "'.concat(e.index,'",')),e.centerSelf&&(this.res.style.marginRight="auto",this.res.style.marginLeft="auto"),e.fitContent&&(this.res.style.width="100%",this.res.style.height="100%",this.res.style.marginRight="auto",this.res.style.marginTop="auto",this.res.style.objectFit="cover"),e.objectFit&&(this.res.style.objectFit=e.objectFit),e.objectFit&&(r+='\n objectFit: "'.concat(e.objectFit,'",')),e.as&&this.as(e.as),e.onScroll&&this.onScroll(e.onScroll),e.class&&this.res.setAttribute("class",e.class),e.gpos&&(this.gposObject=e.gpos),e.gpos&&(this.res.style.gridColumn=e.gpos.col,this.res.style.gridRow=e.gpos.row,r+="\n gpos: ".concat(this.removeQuotesFromFirstWord(JSON.stringify(e.gpos)),", ")),e.filtera){var i;i=Array.isArray(e.filtera)?c.filtera.filter((function(t){return"filter"===t.op.name}))[0]:e.filtera;var o=this.removeQuotesFromFirstWord(JSON.stringify(i));r+="\n filtera: ".concat(o,", \n")}if(e.keySet&&this.keySet(e.keySet),e.stype&&this.setType(e.stype),e.isBackground&&(this.isBackground=e.isBackground),e.zIndex&&(this.res.style.zIndex=e.zIndex),e.zIndex&&(r+='\n zIndex: "'.concat(e.zIndex,'", \n')),e.id&&this.res.setAttribute("id",e.id),e.id&&(r+=' id: "'.concat(e.id,'", \n')),this.id=e.id,e.area&&this.setArea(e.area),e.area&&(r+='area: "'.concat(e.area,'", \n')),e.opacity&&(this.res.style.opacity=e.opacity),e.width&&(this.res.style.width=e.width),e.width&&(r+='width: "'.concat(e.width,'", ')),e.maxWidth&&(this.res.style.maxWidth=e.maxWidth),e.maxWidth&&(r+='maxWidth: "'.concat(e.maxWidth,'", ')),e.height&&(this.res.style.height=e.height),e.height&&(r+='height: "'.concat(e.height,'", ')),e.multimargin&&this.makeMultiMargin(e.multimargin),e.multimargin&&(r+="multimargin: [ \n"),e.arrayMargin&&this.arrayMargin(e.arrayMargin.sides,e.arrayMargin.value),e.multimargin){for(var s=0;s<e.multimargin.length;s++){var a=e.multimargin[s];r+='{side: "'.concat(a.side,'", value: "').concat(a.value,'"}, \n')}r+="], \n"}if(e.maxWidth&&this.maxWidth(e.maxWidth),e.maxWidth&&(r+='maxWidth: "'.concat(e.maxWidth,'"