nodality 1.0.0-beta.7 → 1.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{KeyframeAnim:()=>i});class i{constructor(t){return this.fromFirstImageFlag=!1,this.flag=0,this.flagValue=t.flagValue,this.data=t,this.mask=t.mask,this.maskData=t.maskData,this.id=t.id,this.halfHeight=t.halfHeight,void 0===this.data.type?this.type="default":this.type=this.data.type,this.stickData=t.stickData,this.targetHeight=this.data.targetHeight,this.html=document.body,this.res=document.createElement("div"),this.res.setAttribute("id",this.data.id),this.res.style.border="1px solid green",this.res.style.width="100%",this.res.style.display="grid",this.res.style.position="sticky",this.res.style.top=0,this.res.style.alignSelf="flex-start",this.res.style.justifyContent="center",this.res.style.alignItems="center",this.data.added||(this.res.style.marginTop=this.data.noAddedDistance),this.frameCount=100,this.lastScrollTop=window.scrollY,this.setupTopElement(),this.scrollFunction(),window.addEventListener("scroll",(()=>{this.scrollFunction()})),this.preloadImages(),this}marginTop(t){return this.res.style.marginTop=t,this}toCode(){return[""]}scrollFunction=()=>{void 0===this.flagValue&&(this.flagValue=0);const t=(this.html.scrollTop-this.flagValue)/(this.html.scrollHeight-window.innerHeight)*16;var e=Math.min(this.frameCount-1,Math.ceil(t*this.frameCount));isNaN(e)&&(e=1),e<0&&(e=0),this.data.limit?e<this.data.limit&&requestAnimationFrame((()=>this.updateImage(e+1))):requestAnimationFrame((()=>this.updateImage(e+1))),window.matchMedia("(max-device-width: 415px)")};currentFrame=t=>`${this.data.path}${t.toString().padStart(4,"0")}.${this.data.extension}`;preloadImages=()=>{for(let t=1;t<this.frameCount;t++)new Image,this.img.src=this.currentFrame(t)};updateImage=t=>{this.img.src=this.currentFrame(t)};drawImageProp(t,e,i,s,a,n,r,h){2===arguments.length&&(i=s=0,a=t.canvas.width,n=t.canvas.height),(r="number"==typeof r?r:.5)<0&&(r=0),(h="number"==typeof h?h:.5)<0&&(h=0),r>1&&(r=1),h>1&&(h=1);var l,o,d,c,m=e.width,g=e.height,p=Math.min(a/m,n/g),y=m*p,w=g*p,u=1;y<a&&(u=a/y),Math.abs(u-1)<1e-14&&w<n&&(u=n/w),(l=(m-(d=m/((y*=u)/a)))*r)<0&&(l=0),(o=(g-(c=g/((w*=u)/n)))*h)<0&&(o=0),d>m&&(d=m),c>g&&(c=g),console.log("WEIRD"),console.log(e),console.log(o),console.log(d),t.drawImage(e,l,o,d,c,i,s,a,n)}maska(t){return window.addEventListener("scroll",(()=>{this.innerMask(t)})),this}innerMask(t){if(t){let e=smartRange(window.scrollY,{min:t.start,max:t.end},{min:0,max:7}),i=smartRange(window.scrollY,{min:t.start,max:t.end},{min:37,max:37});this.res.style.clipPath=`inset(${e}% ${e}% round 0 0 ${i}px ${i}px)`}}setupTopElement(){console.warn("TOP INIT");let t=document.createElement("canvas");if(t.style.gridArea="1/1",t.zIndex=1,t.style.display="grid",t.style.gridTemplate="1fr/1fr",t.style.justifyContent="center",t.style.alignItems="center",t.style.marginLeft="auto",t.style.marginRight="auto",this.context=t.getContext("2d"),this.context.canvas.width=window.innerWidth,this.context.canvas.height=1.2*window.innerHeight,this.img=new Image,this.img.onload=()=>{this.data.halfHeight?this.drawImageProp(this.context,this.img,0,0,window.innerWidth,window.innerHeight/2):this.drawImageProp(this.context,this.img,0,0,window.innerWidth,1.2*window.innerHeight)},window.addEventListener("resize",(()=>{this.context.canvas.width=window.innerWidth,this.context.canvas.height=1.2*window.innerHeight,this.drawImageProp(this.context,this.img,0,0,window.innerWidth,1.2*window.innerHeight)})),this.res.appendChild(t),this.data.text){let t=document.createElement("div");t.style.gridArea="1/1";let i=this.data.text.render();if(this.h2a=i,t.appendChild(i),t.setAttribute("id","rem"),this.data.hasRect){let t=document.createElement("div");t.style.width="30px",t.style.height="30px",t.style.backgroundColor="orange"}else for(var e=0;e<this.res.children.length;e++)"rem"===this.res.children[e].id&&this.res.removeChild(this.res.children[e]);this.res.appendChild(t)}this.lastScrollTop=0,this.count=1,this.isUp=!1,this.done=!1,this.fireOnce=!0,this.dec=1,this.tdec=1,this.atdec=0,this.textOpacity=1,this.res.children[this.res.children.length-1].children[0].style.opacity=0,this.data.text&&window.addEventListener("scroll",(()=>{this.h2a.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.h2a.style.opacity=1})),window.addEventListener("scroll",(t=>{if(this.data.stickyData&&this.data.stickyData.top){const t=this.data.stickyData.top;this.data.uncomment&&(window.scrollY>t?(wrapDiv.style.background="pink",wrapDiv.style.position="relative",wrapDiv.style.top=t):(wrapDiv.style.background="orange",wrapDiv.style.top=0,wrapDiv.style.position="fixed"))}let e=window.scrollY||document.documentElement.scrollTop;if(e>this.lastScrollTop?this.isUp=!1:this.isUp=!0,this.lastScrollTop=e<=0?0:e,this.isUp&&this.textOpacity<.98&&(this.textOpacity+=.01),!1===this.isUp&&this.textOpacity>.02&&(this.textOpacity-=.01),this.data.mask){let t=this.res,e=smartRange(window.scrollY,{min:this.data.maskData.start,max:this.data.maskData.end},{min:0,max:7});if(t.style.clipPath=`inset(${e}% ${e}% round 20px)`,!this.hasH2){let e=document.createElement("div");e.style.background="#ecf0f1",e.style.width="86%",e.style.marginLeft="7%",e.style.borderRadius="1rem",this.hasH2=!0,e.appendChild(this.data.newSection.render()),t.parentElement.appendChild(e)}}this.data.targetHeight}))}setLazyText(t){return this.lazyText=t,window.addEventListener("scroll",(()=>{let t=smartRange(window.scrollY,{min:this.lazyText.start,max:this.lazyText.end},{min:0,max:200}),e=smartRange(window.scrollY,{min:this.lazyText.start,max:this.lazyText.end},{min:0,max:1});for(var i=0;i<this.h2a.children[0].children.length;i++)console.log("P"),this.h2a.children[0].children[i].style.transform=`matrix(1, 0, 0, 1, 0, -${t})`,this.h2a.children[0].children[i].style.opacity=""+(e-.2*i)})),this}setProps(t){return t.targetHeight&&(this.data.targetHeight=t.targetHeight),t.flagValue&&(this.flagValue=t.flagValue),this}fixedToRelative(t){this.data.uncomment=t}toSticky(){return this.res.style.position="sticky",this.res.style.top="0",this}setOpacityRange(t){return this.data.opacityRange=t.opacityRange,this.data.scaleRange=t.scaleRange,window.addEventListener("scroll",(()=>{let t=smartRange(window.scrollY,{min:this.data.opacityRange.start,max:this.data.opacityRange.end},{min:0,max:1});this.h2a.style.opacity=t;let e=smartRange(window.scrollY,{min:this.data.scaleRange.start,max:this.data.scaleRange.end},{min:3,max:1});window.matchMedia("(max-device-width: 415px)").matches||(this.h2a.children[0].style.transform=`scale(${e})`)})),this}stick(t){return t?(t.offset&&(null!=this.data.stickyData?this.data.stickyData.top=t.offset:this.data.stickyData={top:t.offset}),t.value?this.makeSticky():this.noSticky(),this):(this.makeSticky(),this)}to100vh(){this.res.style.height="100vh"}makeSticky(){return this.res.style.position="sticky",this.res.style.top=0,this}noSticky(){return this.res.style.position="",this}toOpacity(t){this.res.style.opacity=`${t}`}render(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}module.exports=e})();
@@ -0,0 +1 @@
1
+ var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{_:()=>i});class i{constructor(t){return this.fromFirstImageFlag=!1,this.flag=0,this.flagValue=t.flagValue,this.data=t,this.mask=t.mask,this.maskData=t.maskData,this.id=t.id,this.halfHeight=t.halfHeight,void 0===this.data.type?this.type="default":this.type=this.data.type,this.stickData=t.stickData,this.targetHeight=this.data.targetHeight,this.html=document.body,this.res=document.createElement("div"),this.res.setAttribute("id",this.data.id),this.res.style.border="1px solid green",this.res.style.width="100%",this.res.style.display="grid",this.res.style.position="sticky",this.res.style.top=0,this.res.style.alignSelf="flex-start",this.res.style.justifyContent="center",this.res.style.alignItems="center",this.data.added||(this.res.style.marginTop=this.data.noAddedDistance),this.frameCount=100,this.lastScrollTop=window.scrollY,this.setupTopElement(),this.scrollFunction(),window.addEventListener("scroll",(()=>{this.scrollFunction()})),this.preloadImages(),this}marginTop(t){return this.res.style.marginTop=t,this}toCode(){return[""]}scrollFunction=()=>{void 0===this.flagValue&&(this.flagValue=0);const t=(this.html.scrollTop-this.flagValue)/(this.html.scrollHeight-window.innerHeight)*16;var e=Math.min(this.frameCount-1,Math.ceil(t*this.frameCount));isNaN(e)&&(e=1),e<0&&(e=0),this.data.limit?e<this.data.limit&&requestAnimationFrame((()=>this.updateImage(e+1))):requestAnimationFrame((()=>this.updateImage(e+1))),window.matchMedia("(max-device-width: 415px)")};currentFrame=t=>`${this.data.path}${t.toString().padStart(4,"0")}.${this.data.extension}`;preloadImages=()=>{for(let t=1;t<this.frameCount;t++)new Image,this.img.src=this.currentFrame(t)};updateImage=t=>{this.img.src=this.currentFrame(t)};drawImageProp(t,e,i,s,a,n,r,h){2===arguments.length&&(i=s=0,a=t.canvas.width,n=t.canvas.height),(r="number"==typeof r?r:.5)<0&&(r=0),(h="number"==typeof h?h:.5)<0&&(h=0),r>1&&(r=1),h>1&&(h=1);var l,o,d,c,m=e.width,g=e.height,p=Math.min(a/m,n/g),y=m*p,w=g*p,u=1;y<a&&(u=a/y),Math.abs(u-1)<1e-14&&w<n&&(u=n/w),(l=(m-(d=m/((y*=u)/a)))*r)<0&&(l=0),(o=(g-(c=g/((w*=u)/n)))*h)<0&&(o=0),d>m&&(d=m),c>g&&(c=g),console.log("WEIRD"),console.log(e),console.log(o),console.log(d),t.drawImage(e,l,o,d,c,i,s,a,n)}maska(t){return window.addEventListener("scroll",(()=>{this.innerMask(t)})),this}innerMask(t){if(t){let e=smartRange(window.scrollY,{min:t.start,max:t.end},{min:0,max:7}),i=smartRange(window.scrollY,{min:t.start,max:t.end},{min:37,max:37});this.res.style.clipPath=`inset(${e}% ${e}% round 0 0 ${i}px ${i}px)`}}setupTopElement(){console.warn("TOP INIT");let t=document.createElement("canvas");if(t.style.gridArea="1/1",t.zIndex=1,t.style.display="grid",t.style.gridTemplate="1fr/1fr",t.style.justifyContent="center",t.style.alignItems="center",t.style.marginLeft="auto",t.style.marginRight="auto",this.context=t.getContext("2d"),this.context.canvas.width=window.innerWidth,this.context.canvas.height=1.2*window.innerHeight,this.img=new Image,this.img.onload=()=>{this.data.halfHeight?this.drawImageProp(this.context,this.img,0,0,window.innerWidth,window.innerHeight/2):this.drawImageProp(this.context,this.img,0,0,window.innerWidth,1.2*window.innerHeight)},window.addEventListener("resize",(()=>{this.context.canvas.width=window.innerWidth,this.context.canvas.height=1.2*window.innerHeight,this.drawImageProp(this.context,this.img,0,0,window.innerWidth,1.2*window.innerHeight)})),this.res.appendChild(t),this.data.text){let t=document.createElement("div");t.style.gridArea="1/1";let i=this.data.text.render();if(this.h2a=i,t.appendChild(i),t.setAttribute("id","rem"),this.data.hasRect){let t=document.createElement("div");t.style.width="30px",t.style.height="30px",t.style.backgroundColor="orange"}else for(var e=0;e<this.res.children.length;e++)"rem"===this.res.children[e].id&&this.res.removeChild(this.res.children[e]);this.res.appendChild(t)}this.lastScrollTop=0,this.count=1,this.isUp=!1,this.done=!1,this.fireOnce=!0,this.dec=1,this.tdec=1,this.atdec=0,this.textOpacity=1,this.res.children[this.res.children.length-1].children[0].style.opacity=0,this.data.text&&window.addEventListener("scroll",(()=>{this.h2a.style.backgroundColor="rgba(0, 0, 0, 0.8)",this.h2a.style.opacity=1})),window.addEventListener("scroll",(t=>{if(this.data.stickyData&&this.data.stickyData.top){const t=this.data.stickyData.top;this.data.uncomment&&(window.scrollY>t?(wrapDiv.style.background="pink",wrapDiv.style.position="relative",wrapDiv.style.top=t):(wrapDiv.style.background="orange",wrapDiv.style.top=0,wrapDiv.style.position="fixed"))}let e=window.scrollY||document.documentElement.scrollTop;if(e>this.lastScrollTop?this.isUp=!1:this.isUp=!0,this.lastScrollTop=e<=0?0:e,this.isUp&&this.textOpacity<.98&&(this.textOpacity+=.01),!1===this.isUp&&this.textOpacity>.02&&(this.textOpacity-=.01),this.data.mask){let t=this.res,e=smartRange(window.scrollY,{min:this.data.maskData.start,max:this.data.maskData.end},{min:0,max:7});if(t.style.clipPath=`inset(${e}% ${e}% round 20px)`,!this.hasH2){let e=document.createElement("div");e.style.background="#ecf0f1",e.style.width="86%",e.style.marginLeft="7%",e.style.borderRadius="1rem",this.hasH2=!0,e.appendChild(this.data.newSection.render()),t.parentElement.appendChild(e)}}this.data.targetHeight}))}setLazyText(t){return this.lazyText=t,window.addEventListener("scroll",(()=>{let t=smartRange(window.scrollY,{min:this.lazyText.start,max:this.lazyText.end},{min:0,max:200}),e=smartRange(window.scrollY,{min:this.lazyText.start,max:this.lazyText.end},{min:0,max:1});for(var i=0;i<this.h2a.children[0].children.length;i++)console.log("P"),this.h2a.children[0].children[i].style.transform=`matrix(1, 0, 0, 1, 0, -${t})`,this.h2a.children[0].children[i].style.opacity=""+(e-.2*i)})),this}setProps(t){return t.targetHeight&&(this.data.targetHeight=t.targetHeight),t.flagValue&&(this.flagValue=t.flagValue),this}fixedToRelative(t){this.data.uncomment=t}toSticky(){return this.res.style.position="sticky",this.res.style.top="0",this}setOpacityRange(t){return this.data.opacityRange=t.opacityRange,this.data.scaleRange=t.scaleRange,window.addEventListener("scroll",(()=>{let t=smartRange(window.scrollY,{min:this.data.opacityRange.start,max:this.data.opacityRange.end},{min:0,max:1});this.h2a.style.opacity=t;let e=smartRange(window.scrollY,{min:this.data.scaleRange.start,max:this.data.scaleRange.end},{min:3,max:1});window.matchMedia("(max-device-width: 415px)").matches||(this.h2a.children[0].style.transform=`scale(${e})`)})),this}stick(t){return t?(t.offset&&(null!=this.data.stickyData?this.data.stickyData.top=t.offset:this.data.stickyData={top:t.offset}),t.value?this.makeSticky():this.noSticky(),this):(this.makeSticky(),this)}to100vh(){this.res.style.height="100vh"}makeSticky(){return this.res.style.position="sticky",this.res.style.top=0,this}noSticky(){return this.res.style.position="",this}toOpacity(t){this.res.style.opacity=`${t}`}render(t){if(!t)return this.res;document.querySelector(t).appendChild(this.res)}}var s=e._;export{s as KeyframeAnim};
@@ -1 +1 @@
1
- class t{constructor(){this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}}keySet(t){return this.temporaryVal=1,this.res.style[t.key]=t.value,this}onScroll(t){"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value&&(this.res.style.transform=`scale(${t.valMax})`),window.addEventListener("scroll",(()=>{let e=this.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?this.res.style.opacity=e:"scale"===t.value&&(this.res.style.transform=`scale(${e})`)}))}setAny(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}setID(t){this.id=t}setPrevText(t){this.prevText=t}getCSS(){return this.css}getPX(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}respad(t){const e=()=>{this.pad(t[0].values);for(let e=0;e<t.length;e++){let s=t[e].breakpoint;window.matchMedia(`(min-width: ${this.getPX(s)}`).matches&&this.pad(t[e].values)}};window.addEventListener("resize",e),e()}resmar(t){const e=()=>{this.mar(t[0].values);for(let e=0;e<t.length;e++){let s=t[e].breakpoint;window.matchMedia(`(max-width: ${this.getPX(s)}`).matches&&this.mar(t[e].values)}};window.addEventListener("resize",e),e()}resprop(t){this.prevBackground=this.res.style.background,this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.prevBorder=this.res.style.border;const e=()=>{this.res.style.background=this.prevBackground,this.res.style.width=this.prevWidth,this.res.style.height=this.prevHeight,this.res.style.border=this.prevBorder;for(let e=0;e<t.length;e++){let s=t[e].breakpoint;if(window.matchMedia(`(max-width: ${this.getPX(s)}`).matches){const s={};for(const i in t[e])"breakpoint"!==i&&(s[i]=t[e][i]);this.set(s)}}};window.addEventListener("resize",e),e()}isNumber(t){return"number"==typeof t&&!isNaN(t)}pad(t){for(let e=0;e<t.length;e++){let s=Object.keys(t[e]);for(let i=0;i<s.length;i++){let r=s[i],a=t[e][r];for(let t=0;t<r.length;t++)switch(r[t]){case"a":this.res.style.padding=this.isNumber(a)?`${a}px`:a;break;case"t":this.res.style.paddingTop=this.isNumber(a)?`${a}px`:a;break;case"l":this.res.style.paddingLeft=this.isNumber(a)?`${a}px`:a;break;case"r":this.res.style.paddingRight=this.isNumber(a)?`${a}px`:a;break;case"b":this.res.style.paddingBottom=this.isNumber(a)?`${a}px`:a}}}return this}as(t){return this.res.style.alignSelf=t,this}mar(t){for(let e=0;e<t.length;e++){let s=Object.keys(t[e]);for(let i=0;i<s.length;i++){let r=s[i],a=t[e][r];for(let t=0;t<r.length;t++){switch(r[t]){case"a":this.res.style.margin=this.isNumber(a)?`${a}px`:a;break;case"t":this.res.style.marginTop=this.isNumber(a)?`${a}px`:a;break;case"l":this.res.style.marginLeft=this.isNumber(a)?`${a}px`:a;break;case"r":this.res.style.marginRight=this.isNumber(a)?`${a}px`:a;break;case"b":this.res.style.marginBottom=this.isNumber(a)?`${a}px`:a}"auto"===r[t]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}}}return this}smartRange(t,e,s){t<e.min&&(t=e.min),t>e.max&&(t=e.max);let i=(t-e.min)/(e.max-e.min);e.min>e.max&&(i=(t-e.max)/(e.min-e.max));let r=(s.min-s.max)*i-s.min;if(r=Math.abs(r),s.min<s.max){let t=(s.max+Math.abs(s.min))*i;r=s.min+t}return r}gpos(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}fluidCopy(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;let 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;let t=document.createTextNode(this.text);this.res.appendChild(t),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;let t=document.createTextNode(this.text);this.res.appendChild(t),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;let t=document.createTextNode(this.text);this.res.appendChild(t),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;let t=document.createTextNode(this.text);this.res.appendChild(t),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;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}setIndex(t){this.index=t}borderObj(t){let e=t.type??"solid";return this.res.style.border=`${t.width} ${e} ${t.color}`,this.res.style.borderRadius=t.radius,this}protoReact(t,e){t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const s=()=>{const s=window.innerWidth;let i="";this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const a of t){this.counterIndex++;const[t,n]=a.range,o=parseInt(t),l=parseInt(n);let h=!0;if(a.target){h=!1;for(var r=0;r<a.target.length;r++)a.target[r]===e&&(h=!0)}s>=o&&s<=l&&h&&("gradient"===a.log&&(i+="gradient"),"blast"===a.log&&(i+="blast"),"animation"===a.log&&(i+="animation"),"shadow"===a.log&&(i+="shadow"),"span"===a.log&&(i+="span"),"filter"===a.log&&(i+="filter"),"background"===a.log&&(i+="background"))}this.res.style.margin="";let a=this.res.style.color;for(t.map((t=>t.log)).filter((t=>null!=t)).includes("gradient")&&(this.res.style.WebkitBackgroundClip="",this.res.style.background=""),this.res.style["-webkit-text-stroke"]="",this.res.style.filter="",this.res.style.textShadow="",this.res.style.border="";this.res.firstChild;)this.res.removeChild(this.res.firstChild);if(this.res.textContent=this.text,""===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.color=a),"blast"===i){for(r=0;r<t.length;r++){const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}for(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke"]=this.globalBlast,r=0;r<t.length;r++){const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}}if("gradient"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style.border="1px solid orange"),"background"===i&&(this.res.style.background="orange"),"gradientblast"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style["-webkit-text-stroke"]=this.globalBlast),"gradientanimation"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text"),"gradientanimationshadow"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style.textShadow=this.globalShadow),"animationshadow"===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow=this.globalShadow),"shadow"===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow=this.globalShadow),"span"===i&&this.options.span){let t;for(t=Array.isArray(this.options.span)?this.options.span.filter((t=>"span"===t.op.name))[0]:this.options.span,this.res.textContent="",r=0;r<t.op.parts.length;r++){let e=t.op.parts[r].style,s=new Text(t.op.parts[r].text).setup({type:"span"}).set(e).render();this.res.appendChild(s)}}if("filter"===i){let t=this.options.filtera.op.filter;this.res.style.filter=t,this.res.style.border="8px solid orange"}};window.addEventListener("resize",s),s()}setPref(t){this.preffersId=t}setClass(t){this.class=t}betaReact(t,e){this.ap=!1,this.cta=0,this.once=!1,t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const s=()=>{const s=window.innerWidth;let i="";this.resCopy=this.res,this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const a of t){this.counterIndex++;const[t,n]=a.range,o=parseInt(t),l=parseInt(n);let h=!0;if(a.target){h=!1;for(var r=0;r<a.target.length;r++)a.target[r]===e&&(h=!0)}s>=o&&s<=l&&h&&("blast"===a.log&&(i+="blast"),"shadow"===a.log&&(i+="shadow"),"background"===a.log&&(i+="background"),"gradient"===a.log&&(i+="gradient"),"spana"===a.log&&(i+="spana"),"layout"===a.log&&(i+="layout"),"margin"===a.log&&(i+="margin"),a.op&&a.op.margin&&(this.useMargin=a.op.margin))}if(this.res.style.background="",this.res.style.backgroundColor="",this.res.style.textShadow="",this.res.style.border="",this.res.style.margin="",this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-stroke-width"]="","background"===i&&(this.res.style.backgroundColor="green"),"margin"===i)for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}if("blastbackgroundmargin"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}this.res.style.backgroundColor="green","FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}if("blastbackground"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}this.res.style.backgroundColor="green",this.useMargin?this.res.style.margin="1rem":this.res.setAttribute("id","iofhwoiefhoih"),"FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}if("layout"===i&&(this.res.style.alignSelf="start",this.res.style.border="1px solid purple"),"blast"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}"FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-background-clip"]="text",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}"blastgradientbackground"===i&&(this.res.style.border="1px solid yellow",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),"gradient"===i&&(this.res.style.background="linear-gradient(to left, #3498db, #1abc9c)","FlexRowLayoutElement"===this.getType()||(this.res.children[0]&&this.res.removeChild(this.res.children[0]),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-background-clip"]="text",this.res.textContent=this.text)),"shadow"===i&&("FlexRowLayoutElement"===this.getType()||(this.res.children[0]&&this.res.removeChild(this.res.children[0]),this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow="#1abc9cff -6px 6px , #1abc9c40 -12px 12px",this.res.textContent=this.text))};window.addEventListener("resize",s),s()}cssGen(t,e,s,i){return this.css=[""],[""]}chainReact(t,e,s){this.cssGen(t,e,this.class,void 0!==this.class),this.ap=!1,this.cta=0,this.once=!1;for(let e of t)e.range||(e.range=["0px","999999px"]);t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const i=()=>{const i=window.visualViewport.width;let r=[],a=[];this.resCopy=this.res,this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const s of t){this.counterIndex++;const[t,o]=s.range,l=parseInt(t),h=parseInt(o);let d=!0;if(s.target){d=!1;for(var n=0;n<s.target.length;n++)s.target[n]===e&&(d=!0)}i>=l&&i<=h&&d&&(r.push(s.log),a.push(s),s.op&&s.op.margin&&(this.useMargin=s.op.margin))}if(s&&!s.includes("background")&&(this.res.style.background="",this.res.style.backgroundColor=""),this.res.style.textShadow="",s&&!s.includes("border")&&(this.res.style.border=""),s&&!s.includes("margin")&&(this.res.style.margin=""),this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-stroke-color"]="",this.res.style["-webkit-text-stroke-width"]="",this.res.style.filter="",(r.includes("gradient")||r.includes("shadow"))&&(this.res.style.position="relative",this.res.style.zIndex=-1),r.includes("blast")){let t=a.filter((t=>"blast"===t.log))[0].op.color,e=a.filter((t=>"blast"===t.log))[0].op.width??"1px";"FlexRowLayoutElement"===this.getType()?this.res.style.border=`${e}px solid orange`:(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]=t,this.res.style["-webkit-text-stroke-width"]=`${e}`)}if(r.includes("filter")){let t=a.filter((t=>"filter"===t.log))[0].op.filter;this.res.style.filter=t}if(r.includes("background")&&(this.res.style.backgroundColor="green"),r.includes("gradient")&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["background-clip"]="text"),r.includes("shadow"))if("FlexRowLayoutElement"===this.getType());else{let t="",e=0;for(n=0;n<this.options.shadow.op.steps;n++)e+=3,t+=`drop-shadow(${e}px ${e}px ${e}px gray) `;this.res.style.filter=t}if(r.includes("margin"))for(n=0;n<t.length;n++){if(!t[n].op)continue;const e=t[n].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}if(r.includes("animation")){if(this.options.animation&&!this.hasAnimated&&!this.options.animation.op.fireAt){this.hasAnimated=!0;let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"}),this.res.animate(t.keyframesOpen,t.openOptions)}if(this.options.animation&&this.options.animation.op.fireAt&&this.options.animation.op.fireAt.endsWith("px")){let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"});const e=()=>{window.scrollY>parseFloat(t.fireAt)&&(this.res.animate(t.keyframesOpen,t.openOptions),window.removeEventListener("scroll",e))};window.addEventListener("scroll",e)}if(this.options.animation&&this.options.animation.op.fireAt&&"inview"===this.options.animation.op.fireAt){let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver(((e,s)=>{e.forEach((e=>{e.isIntersecting&&(this.res.animate(t.keyframesOpen,t.openOptions),s.disconnect())}))})).observe(this.res)}}};window.addEventListener("resize",i),i()}reactOnTransform=t=>{if(t.transform||t.op&&t.op.transform){let e=t.transform;t.transform||(e=t.op.transform),e.duration||(e.duration="3s-ease-in-out"),this.setDefault=(t,e="0px")=>0===t.length?e+" ":t;const s=t=>{const e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;const s=e[1].split(",").map((t=>t.trim()));return 1===s.length?`rotate(${s[0]})`:2===s.length?`rotateX(${s[0]}) rotateY(${s[1]})`:3===s.length?`rotateX(${s[0]}) rotateY(${s[1]}) rotate(${s[2]})`:t},i=()=>{let i="",r="",a="",n="",o="",l="",h="",d="",p="";if(0===e.values.length)return;e.values.forEach((t=>{t.startsWith("tx:")&&(i=t.replace("tx:","")),t.startsWith("ty:")&&(r=t.replace("ty:","")),t.startsWith("tz:")?a=t.replace("tz:",""):t.startsWith("scale(")?n=t:t.startsWith("skew(")?o=t:t.startsWith("rotate(")?l=s(t):t.startsWith("perspective(")?h=t:t.startsWith("matrix(")?d=t:t.startsWith("opacity:")&&(p=t.replace("opacity:",""))})),i=this.setDefault(i),r=this.setDefault(r),a=this.setDefault(a);let c="";if("0px"!=r&&"0px"!=i&&"0px"!=a?c+=`translate3d(${i}, ${r}, ${a})`:"0px"==r&&"0px"==i||(c+=`translate(${i}, ${r})`),n&&(c+=` ${n}`),l&&(c+=` ${l}`),o&&(c+=` ${o}`),h&&(c+=` ${h}`),d&&(c+=` ${d}`),c){if(t.op.transform.duration){let e=t.op.transform.duration.replace(/^(\d+)(s)-/,((t,e,s)=>e/2+s+" ")),s=`transform ${e}, opacity ${e}`;this.res.style.transition=s}else this.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";this.res.style.transform=c,this.res.style.opacity=p}};e.on?this.res.addEventListener(e.on,(()=>{e.delay?setTimeout((()=>{i()}),e.delay):i()})):window.addEventListener("load",(()=>{e.delay?setTimeout((()=>{i()}),e.delay):i()}));const r=()=>{let t="";e.values.forEach((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) "),this.res.style.opacity="1"})),t&&(this.res.style.transform=t.trim())};if(e.on)this.res.addEventListener("mouseout",(()=>{e.keep||r()}));else{let t=1e3*parseFloat(e.duration),s=e.closeAfter?e.closeAfter:0;setTimeout((()=>{e.keep||r()}),t/2+s)}}};maxWidth(t){return this.res.style.maxWidth=t,this}removeQuotesFromFirstWord(t){return t.replace(/"([^"]+)":/g,"$1:")}arrayMargin(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}navBarExpand(){return this.res.style.backgroundColor="green",this.res.animate([{transform:"scaleY(3.0)"}],{duration:2e3,iterations:1,fill:"both"}),this}scrollFade(t,e){return this.res.style.visibility="hidden",this.faden(t,e,"scroll"),this}expand(t){return!1===this.state.isExpanded?"click"===t.on?this.res.addEventListener("click",(()=>{this.innerExpand(t)})):this.innerExpand(t):this.innerExpandBack(t),this.state.isExpanded=!this.state.isExpanded,this}move(t){return"click"===t.on?this.res.addEventListener("click",(()=>{this.moveUpa(t)})):("up"===t.direction&&this.moveUpa(t),"down"===t.direction&&this.moveDowna(t),this.state.isMovedUp=!this.state.isMovedUp,"left"===t.direction&&this.moveLeft(t)),this}moveLeft(t){return this.res.animate([{transform:"translateX(0px)"},{transform:`translateX(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveUpa(t){return!1===this.state.isMovedUp?this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveDowna(t){return!1===this.state.isMovedDown?this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveUpaBack(t){return this.res.animate([{transform:"translateX(0px)"}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}innerExpandBack(t){this.res.animate([{width:this.prevWidth,height:this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"})}innerExpand(t){return this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.res.animate([{width:this.prevWidth,height:this.prevHeight},{width:t.width??this.prevWidth,height:t.height??this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"}),this}fade(t){return this.res.style.visibility="hidden",this.faden(t.duration,t.from,"load"),t.finalOpacity&&(this.finalOpacity=t.finalOpacity),this}faden(t,e,s){return this.res.style.visibility="hidden",this.scrolled=!1,window.addEventListener(s,(()=>{this.res.style.visibility="visible";var i=window.innerHeight;(this.res.getBoundingClientRect().top-i<=0||"load"==s)&&0==this.scrolled&&("left"==e&&this.res.animate([{transform:"translateX(-30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"right"==e&&this.res.animate([{transform:"translateX(30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"top"==e&&this.res.animate([{transform:"translateY(-30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),"bottom"==e&&this.res.animate([{transform:"translateY(30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),this.res.animate([{opacity:"0.0"},{opacity:"1.0"}],{duration:t,iterations:1}),this.scrolled=!0)})),this}}class e extends t{constructor(){super()}removeQuotesFromBoth(t){if(t)return t.replace(/"([^"]+)":\s*"([^"]+)"/g,"$1: $2")}removeQuotesFromFirstWord(t){if(t)return t.replace(/"([^"]+)":/g,"$1:")}toCode(){console.warn(this.items);let t=this.items.map((t=>t.toCode())).flatMap((t=>t));console.log("BAD CONV"),console.log(this.removeQuotesFromFirstWord(JSON.stringify(this.obj,null,4)));let e=this.removeQuotesFromFirstWord(JSON.stringify(this.obj));return console.log(e),console.log("REPL"),console.log(e),`new MobileBar().set({\nbackground: "${this.obj.background}",\nbrand: ${this.obj.brand.toCode()},\nmar: ${JSON.stringify(this.obj.mar)},\npad: ${JSON.stringify(this.obj.mar)},\nradius: ${JSON.stringify(this.obj.radius)},\n}).add([\n ${t.join(",")}\n\n ])`}set(t){return this.obj=t,console.log("After passing to set:"),console.log("OBJ IN SET"),this.obj=t,this.makeNavbar(t),t.mar&&super.mar(t.mar),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.radius&&(this.res.style.borderRadius=t.radius),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),this.setStyles(t),this}makeNavbar(t){console.log("OBJ IN SETA");const e=t.brand;this.navbar=document.createElement("nav"),this.navbar.classList.add("mobile-navbar"),this.navbarHeader=document.createElement("div"),this.navbarHeader.classList.add("navbar-header"),this.brand=document.createElement("div"),this.brand.classList.add("navbar-brand"),console.log("BRIS"),console.log("APPENDED-"),t.brand&&"function"==typeof e.render?(console.log("Appending brand:",e.render()),this.brand.appendChild(e.render())):console.warn("Brand does not have a valid render method:",t.brand),this.toggleButton=document.createElement("button"),this.toggleButton.classList.add("navbar-toggle"),this.toggleButton.innerHTML="&#9776;",this.navContent=document.createElement("div"),this.navContent.classList.add("navbar-content"),this.navbarHeader.appendChild(this.brand),this.navbarHeader.appendChild(this.toggleButton),this.navbar.appendChild(this.navbarHeader),this.navbar.appendChild(this.navContent),this.isMobileNavOpen=!1,this.toggleButton.addEventListener("click",(()=>{this.toggleMobileNav()})),this.res=this.navbar}setStyles(t){this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=t.background??"orange",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.toggleButton.style.background="none",this.toggleButton.style.border="none",this.toggleButton.style.color=this.hamburgerColour??"white",this.toggleButton.style.fontSize="1.5rem",this.toggleButton.style.cursor="pointer",this.navContent.style.display="none"}add(t){console.log(t),this.items=t;for(var e=0;e<t.length;e++){let s=t[e];this.navContent.appendChild(s.render())}return this}toggleMobileNav(){this.isMobileNavOpen=!this.isMobileNavOpen,this.navContent.style.display=this.isMobileNavOpen?"flex":"none",this.isMobileNavOpen?(this.navContent.style.flexDirection="column",this.navContent.style.gap="0.5rem",this.navContent.style.padding="1rem"):(this.navContent.style.flexDirection="",this.navContent.style.gap="",this.navContent.style.backgroundColor="",this.navContent.style.padding="")}render(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}export{e as MobileBar};
1
+ (()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{MobileBar:()=>i});class s{constructor(){this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}}keySet(t){return this.temporaryVal=1,this.res.style[t.key]=t.value,this}onScroll(t){"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value&&(this.res.style.transform=`scale(${t.valMax})`),window.addEventListener("scroll",(()=>{let e=this.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?this.res.style.opacity=e:"scale"===t.value&&(this.res.style.transform=`scale(${e})`)}))}setAny(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}setID(t){this.id=t}setPrevText(t){this.prevText=t}getCSS(){return this.css}getPX(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}respad(t){const e=()=>{this.pad(t[0].values);for(let e=0;e<t.length;e++){let s=t[e].breakpoint;window.matchMedia(`(min-width: ${this.getPX(s)}`).matches&&this.pad(t[e].values)}};window.addEventListener("resize",e),e()}resmar(t){const e=()=>{this.mar(t[0].values);for(let e=0;e<t.length;e++){let s=t[e].breakpoint;window.matchMedia(`(max-width: ${this.getPX(s)}`).matches&&this.mar(t[e].values)}};window.addEventListener("resize",e),e()}resprop(t){this.prevBackground=this.res.style.background,this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.prevBorder=this.res.style.border;const e=()=>{this.res.style.background=this.prevBackground,this.res.style.width=this.prevWidth,this.res.style.height=this.prevHeight,this.res.style.border=this.prevBorder;for(let e=0;e<t.length;e++){let s=t[e].breakpoint;if(window.matchMedia(`(max-width: ${this.getPX(s)}`).matches){const s={};for(const i in t[e])"breakpoint"!==i&&(s[i]=t[e][i]);this.set(s)}}};window.addEventListener("resize",e),e()}isNumber(t){return"number"==typeof t&&!isNaN(t)}pad(t){for(let e=0;e<t.length;e++){let s=Object.keys(t[e]);for(let i=0;i<s.length;i++){let r=s[i],a=t[e][r];for(let t=0;t<r.length;t++)switch(r[t]){case"a":this.res.style.padding=this.isNumber(a)?`${a}px`:a;break;case"t":this.res.style.paddingTop=this.isNumber(a)?`${a}px`:a;break;case"l":this.res.style.paddingLeft=this.isNumber(a)?`${a}px`:a;break;case"r":this.res.style.paddingRight=this.isNumber(a)?`${a}px`:a;break;case"b":this.res.style.paddingBottom=this.isNumber(a)?`${a}px`:a}}}return this}as(t){return this.res.style.alignSelf=t,this}mar(t){for(let e=0;e<t.length;e++){let s=Object.keys(t[e]);for(let i=0;i<s.length;i++){let r=s[i],a=t[e][r];for(let t=0;t<r.length;t++){switch(r[t]){case"a":this.res.style.margin=this.isNumber(a)?`${a}px`:a;break;case"t":this.res.style.marginTop=this.isNumber(a)?`${a}px`:a;break;case"l":this.res.style.marginLeft=this.isNumber(a)?`${a}px`:a;break;case"r":this.res.style.marginRight=this.isNumber(a)?`${a}px`:a;break;case"b":this.res.style.marginBottom=this.isNumber(a)?`${a}px`:a}"auto"===r[t]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}}}return this}smartRange(t,e,s){t<e.min&&(t=e.min),t>e.max&&(t=e.max);let i=(t-e.min)/(e.max-e.min);e.min>e.max&&(i=(t-e.max)/(e.min-e.max));let r=(s.min-s.max)*i-s.min;if(r=Math.abs(r),s.min<s.max){let t=(s.max+Math.abs(s.min))*i;r=s.min+t}return r}gpos(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}fluidCopy(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;let 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;let t=document.createTextNode(this.text);this.res.appendChild(t),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;let t=document.createTextNode(this.text);this.res.appendChild(t),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;let t=document.createTextNode(this.text);this.res.appendChild(t),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;let t=document.createTextNode(this.text);this.res.appendChild(t),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;let t=document.createTextNode(this.text);this.res.appendChild(t),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}setIndex(t){this.index=t}borderObj(t){let e=t.type??"solid";return this.res.style.border=`${t.width} ${e} ${t.color}`,this.res.style.borderRadius=t.radius,this}protoReact(t,e){t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const s=()=>{const s=window.innerWidth;let i="";this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const a of t){this.counterIndex++;const[t,n]=a.range,o=parseInt(t),l=parseInt(n);let h=!0;if(a.target){h=!1;for(var r=0;r<a.target.length;r++)a.target[r]===e&&(h=!0)}s>=o&&s<=l&&h&&("gradient"===a.log&&(i+="gradient"),"blast"===a.log&&(i+="blast"),"animation"===a.log&&(i+="animation"),"shadow"===a.log&&(i+="shadow"),"span"===a.log&&(i+="span"),"filter"===a.log&&(i+="filter"),"background"===a.log&&(i+="background"))}this.res.style.margin="";let a=this.res.style.color;for(t.map((t=>t.log)).filter((t=>null!=t)).includes("gradient")&&(this.res.style.WebkitBackgroundClip="",this.res.style.background=""),this.res.style["-webkit-text-stroke"]="",this.res.style.filter="",this.res.style.textShadow="",this.res.style.border="";this.res.firstChild;)this.res.removeChild(this.res.firstChild);if(this.res.textContent=this.text,""===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.color=a),"blast"===i){for(r=0;r<t.length;r++){const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}for(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke"]=this.globalBlast,r=0;r<t.length;r++){const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}}if("gradient"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style.border="1px solid orange"),"background"===i&&(this.res.style.background="orange"),"gradientblast"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style["-webkit-text-stroke"]=this.globalBlast),"gradientanimation"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text"),"gradientanimationshadow"===i&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["-webkit-background-clip"]="text",this.res.style.textShadow=this.globalShadow),"animationshadow"===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow=this.globalShadow),"shadow"===i&&(this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow=this.globalShadow),"span"===i&&this.options.span){let t;for(t=Array.isArray(this.options.span)?this.options.span.filter((t=>"span"===t.op.name))[0]:this.options.span,this.res.textContent="",r=0;r<t.op.parts.length;r++){let e=t.op.parts[r].style,s=new Text(t.op.parts[r].text).setup({type:"span"}).set(e).render();this.res.appendChild(s)}}if("filter"===i){let t=this.options.filtera.op.filter;this.res.style.filter=t,this.res.style.border="8px solid orange"}};window.addEventListener("resize",s),s()}setPref(t){this.preffersId=t}setClass(t){this.class=t}betaReact(t,e){this.ap=!1,this.cta=0,this.once=!1,t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const s=()=>{const s=window.innerWidth;let i="";this.resCopy=this.res,this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const a of t){this.counterIndex++;const[t,n]=a.range,o=parseInt(t),l=parseInt(n);let h=!0;if(a.target){h=!1;for(var r=0;r<a.target.length;r++)a.target[r]===e&&(h=!0)}s>=o&&s<=l&&h&&("blast"===a.log&&(i+="blast"),"shadow"===a.log&&(i+="shadow"),"background"===a.log&&(i+="background"),"gradient"===a.log&&(i+="gradient"),"spana"===a.log&&(i+="spana"),"layout"===a.log&&(i+="layout"),"margin"===a.log&&(i+="margin"),a.op&&a.op.margin&&(this.useMargin=a.op.margin))}if(this.res.style.background="",this.res.style.backgroundColor="",this.res.style.textShadow="",this.res.style.border="",this.res.style.margin="",this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-stroke-width"]="","background"===i&&(this.res.style.backgroundColor="green"),"margin"===i)for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}if("blastbackgroundmargin"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}this.res.style.backgroundColor="green","FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}if("blastbackground"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}this.res.style.backgroundColor="green",this.useMargin?this.res.style.margin="1rem":this.res.setAttribute("id","iofhwoiefhoih"),"FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}if("layout"===i&&(this.res.style.alignSelf="start",this.res.style.border="1px solid purple"),"blast"===i){for(r=0;r<t.length;r++){if(!t[r].op)continue;const e=t[r].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}"FlexRowLayoutElement"===this.getType()?this.res.style.border="1px solid orange":(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-background-clip"]="text",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"}"blastgradientbackground"===i&&(this.res.style.border="1px solid yellow",this.res.style["-webkit-text-stroke-color"]="orange",this.res.style["-webkit-text-stroke-width"]="1px"),"gradient"===i&&(this.res.style.background="linear-gradient(to left, #3498db, #1abc9c)","FlexRowLayoutElement"===this.getType()||(this.res.children[0]&&this.res.removeChild(this.res.children[0]),this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-background-clip"]="text",this.res.textContent=this.text)),"shadow"===i&&("FlexRowLayoutElement"===this.getType()||(this.res.children[0]&&this.res.removeChild(this.res.children[0]),this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-fill-color"]="",this.res.style.textShadow="#1abc9cff -6px 6px , #1abc9c40 -12px 12px",this.res.textContent=this.text))};window.addEventListener("resize",s),s()}cssGen(t,e,s,i){return this.css=[""],[""]}chainReact(t,e,s){this.cssGen(t,e,this.class,void 0!==this.class),this.ap=!1,this.cta=0,this.once=!1;for(let e of t)e.range||(e.range=["0px","999999px"]);t.sort(((t,e)=>parseInt(t.range[0])-parseInt(e.range[0])));const i=()=>{const i=window.visualViewport.width;let r=[],a=[];this.resCopy=this.res,this.storedQueries=t.map((t=>t.target)).filter((t=>null!=t));for(const s of t){this.counterIndex++;const[t,o]=s.range,l=parseInt(t),h=parseInt(o);let d=!0;if(s.target){d=!1;for(var n=0;n<s.target.length;n++)s.target[n]===e&&(d=!0)}i>=l&&i<=h&&d&&(r.push(s.log),a.push(s),s.op&&s.op.margin&&(this.useMargin=s.op.margin))}if(s&&!s.includes("background")&&(this.res.style.background="",this.res.style.backgroundColor=""),this.res.style.textShadow="",s&&!s.includes("border")&&(this.res.style.border=""),s&&!s.includes("margin")&&(this.res.style.margin=""),this.res.style["-webkit-text-fill-color"]="",this.res.style["-webkit-text-stroke-color"]="",this.res.style["-webkit-text-stroke-width"]="",this.res.style.filter="",(r.includes("gradient")||r.includes("shadow"))&&(this.res.style.position="relative",this.res.style.zIndex=-1),r.includes("blast")){let t=a.filter((t=>"blast"===t.log))[0].op.color,e=a.filter((t=>"blast"===t.log))[0].op.width??"1px";"FlexRowLayoutElement"===this.getType()?this.res.style.border=`${e}px solid orange`:(this.res.textContent=this.text,this.res.style["-webkit-text-fill-color"]="transparent",this.res.style["-webkit-text-stroke-color"]=t,this.res.style["-webkit-text-stroke-width"]=`${e}`)}if(r.includes("filter")){let t=a.filter((t=>"filter"===t.log))[0].op.filter;this.res.style.filter=t}if(r.includes("background")&&(this.res.style.backgroundColor="green"),r.includes("gradient")&&(this.res.style["-webkit-text-fill-color"]="transparent",this.res.style.background=this.globalGradient,this.res.style["background-clip"]="text"),r.includes("shadow"))if("FlexRowLayoutElement"===this.getType());else{let t="",e=0;for(n=0;n<this.options.shadow.op.steps;n++)e+=3,t+=`drop-shadow(${e}px ${e}px ${e}px gray) `;this.res.style.filter=t}if(r.includes("margin"))for(n=0;n<t.length;n++){if(!t[n].op)continue;const e=t[n].op.offsets;e&&void 0!==this.index&&(this.res.style.margin=e[Number(this.index)]+"px")}if(r.includes("animation")){if(this.options.animation&&!this.hasAnimated&&!this.options.animation.op.fireAt){this.hasAnimated=!0;let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"}),this.res.animate(t.keyframesOpen,t.openOptions)}if(this.options.animation&&this.options.animation.op.fireAt&&this.options.animation.op.fireAt.endsWith("px")){let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"});const e=()=>{window.scrollY>parseFloat(t.fireAt)&&(this.res.animate(t.keyframesOpen,t.openOptions),window.removeEventListener("scroll",e))};window.addEventListener("scroll",e)}if(this.options.animation&&this.options.animation.op.fireAt&&"inview"===this.options.animation.op.fireAt){let t=this.options.animation.op;this.res.animate(t.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver(((e,s)=>{e.forEach((e=>{e.isIntersecting&&(this.res.animate(t.keyframesOpen,t.openOptions),s.disconnect())}))})).observe(this.res)}}};window.addEventListener("resize",i),i()}reactOnTransform=t=>{if(t.transform||t.op&&t.op.transform){let e=t.transform;t.transform||(e=t.op.transform),e.duration||(e.duration="3s-ease-in-out"),this.setDefault=(t,e="0px")=>0===t.length?e+" ":t;const s=t=>{const e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;const s=e[1].split(",").map((t=>t.trim()));return 1===s.length?`rotate(${s[0]})`:2===s.length?`rotateX(${s[0]}) rotateY(${s[1]})`:3===s.length?`rotateX(${s[0]}) rotateY(${s[1]}) rotate(${s[2]})`:t},i=()=>{let i="",r="",a="",n="",o="",l="",h="",d="",p="";if(0===e.values.length)return;e.values.forEach((t=>{t.startsWith("tx:")&&(i=t.replace("tx:","")),t.startsWith("ty:")&&(r=t.replace("ty:","")),t.startsWith("tz:")?a=t.replace("tz:",""):t.startsWith("scale(")?n=t:t.startsWith("skew(")?o=t:t.startsWith("rotate(")?l=s(t):t.startsWith("perspective(")?h=t:t.startsWith("matrix(")?d=t:t.startsWith("opacity:")&&(p=t.replace("opacity:",""))})),i=this.setDefault(i),r=this.setDefault(r),a=this.setDefault(a);let c="";if("0px"!=r&&"0px"!=i&&"0px"!=a?c+=`translate3d(${i}, ${r}, ${a})`:"0px"==r&&"0px"==i||(c+=`translate(${i}, ${r})`),n&&(c+=` ${n}`),l&&(c+=` ${l}`),o&&(c+=` ${o}`),h&&(c+=` ${h}`),d&&(c+=` ${d}`),c){if(t.op.transform.duration){let e=t.op.transform.duration.replace(/^(\d+)(s)-/,((t,e,s)=>e/2+s+" ")),s=`transform ${e}, opacity ${e}`;this.res.style.transition=s}else this.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";this.res.style.transform=c,this.res.style.opacity=p}};e.on?this.res.addEventListener(e.on,(()=>{e.delay?setTimeout((()=>{i()}),e.delay):i()})):window.addEventListener("load",(()=>{e.delay?setTimeout((()=>{i()}),e.delay):i()}));const r=()=>{let t="";e.values.forEach((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) "),this.res.style.opacity="1"})),t&&(this.res.style.transform=t.trim())};if(e.on)this.res.addEventListener("mouseout",(()=>{e.keep||r()}));else{let t=1e3*parseFloat(e.duration),s=e.closeAfter?e.closeAfter:0;setTimeout((()=>{e.keep||r()}),t/2+s)}}};maxWidth(t){return this.res.style.maxWidth=t,this}removeQuotesFromFirstWord(t){return t.replace(/"([^"]+)":/g,"$1:")}arrayMargin(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}navBarExpand(){return this.res.style.backgroundColor="green",this.res.animate([{transform:"scaleY(3.0)"}],{duration:2e3,iterations:1,fill:"both"}),this}scrollFade(t,e){return this.res.style.visibility="hidden",this.faden(t,e,"scroll"),this}expand(t){return!1===this.state.isExpanded?"click"===t.on?this.res.addEventListener("click",(()=>{this.innerExpand(t)})):this.innerExpand(t):this.innerExpandBack(t),this.state.isExpanded=!this.state.isExpanded,this}move(t){return"click"===t.on?this.res.addEventListener("click",(()=>{this.moveUpa(t)})):("up"===t.direction&&this.moveUpa(t),"down"===t.direction&&this.moveDowna(t),this.state.isMovedUp=!this.state.isMovedUp,"left"===t.direction&&this.moveLeft(t)),this}moveLeft(t){return this.res.animate([{transform:"translateX(0px)"},{transform:`translateX(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveUpa(t){return!1===this.state.isMovedUp?this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveDowna(t){return!1===this.state.isMovedDown?this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play():this.res.animate([{transform:"translateX(0px)"},{transform:`translateY(-${t.distance})`}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}moveUpaBack(t){return this.res.animate([{transform:"translateX(0px)"}],{duration:900,iterations:t.iterations,fill:"both"}).play(),this}innerExpandBack(t){this.res.animate([{width:this.prevWidth,height:this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"})}innerExpand(t){return this.prevWidth=this.res.style.width,this.prevHeight=this.res.style.height,this.res.animate([{width:this.prevWidth,height:this.prevHeight},{width:t.width??this.prevWidth,height:t.height??this.prevHeight}],{duration:900,iterations:t.iterations,fill:"both"}),this}fade(t){return this.res.style.visibility="hidden",this.faden(t.duration,t.from,"load"),t.finalOpacity&&(this.finalOpacity=t.finalOpacity),this}faden(t,e,s){return this.res.style.visibility="hidden",this.scrolled=!1,window.addEventListener(s,(()=>{this.res.style.visibility="visible";var i=window.innerHeight;(this.res.getBoundingClientRect().top-i<=0||"load"==s)&&0==this.scrolled&&("left"==e&&this.res.animate([{transform:"translateX(-30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"right"==e&&this.res.animate([{transform:"translateX(30px)"},{transform:"translateX(0px)"}],{duration:t,iterations:1}),"top"==e&&this.res.animate([{transform:"translateY(-30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),"bottom"==e&&this.res.animate([{transform:"translateY(30px)"},{transform:"translateY(0px)"}],{duration:t,iterations:1}),this.res.animate([{opacity:"0.0"},{opacity:"1.0"}],{duration:t,iterations:1}),this.scrolled=!0)})),this}}class i extends s{constructor(){super()}removeQuotesFromBoth(t){if(t)return t.replace(/"([^"]+)":\s*"([^"]+)"/g,"$1: $2")}removeQuotesFromFirstWord(t){if(t)return t.replace(/"([^"]+)":/g,"$1:")}toCode(){console.warn(this.items);let t=this.items.map((t=>t.toCode())).flatMap((t=>t));console.log("BAD CONV"),console.log(this.removeQuotesFromFirstWord(JSON.stringify(this.obj,null,4)));let e=this.removeQuotesFromFirstWord(JSON.stringify(this.obj));return console.log(e),console.log("REPL"),console.log(e),`new MobileBar().set({\nbackground: "${this.obj.background}",\nbrand: ${this.obj.brand.toCode()},\nmar: ${JSON.stringify(this.obj.mar)},\npad: ${JSON.stringify(this.obj.mar)},\nradius: ${JSON.stringify(this.obj.radius)},\n}).add([\n ${t.join(",")}\n\n ])`}set(t){return this.obj=t,console.log("After passing to set:"),console.log("OBJ IN SET"),this.obj=t,this.makeNavbar(t),t.mar&&super.mar(t.mar),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.radius&&(this.res.style.borderRadius=t.radius),t.hamburgerColour&&(this.hamburgerColour=t.hamburgerColour),this.setStyles(t),this}makeNavbar(t){console.log("OBJ IN SETA");const e=t.brand;this.navbar=document.createElement("nav"),this.navbar.classList.add("mobile-navbar"),this.navbarHeader=document.createElement("div"),this.navbarHeader.classList.add("navbar-header"),this.brand=document.createElement("div"),this.brand.classList.add("navbar-brand"),console.log("BRIS"),console.log("APPENDED-"),t.brand&&"function"==typeof e.render?(console.log("Appending brand:",e.render()),this.brand.appendChild(e.render())):console.warn("Brand does not have a valid render method:",t.brand),this.toggleButton=document.createElement("button"),this.toggleButton.classList.add("navbar-toggle"),this.toggleButton.innerHTML="&#9776;",this.navContent=document.createElement("div"),this.navContent.classList.add("navbar-content"),this.navbarHeader.appendChild(this.brand),this.navbarHeader.appendChild(this.toggleButton),this.navbar.appendChild(this.navbarHeader),this.navbar.appendChild(this.navContent),this.isMobileNavOpen=!1,this.toggleButton.addEventListener("click",(()=>{this.toggleMobileNav()})),this.res=this.navbar}setStyles(t){this.navbar.style.display="flex",this.navbar.style.flexDirection="column",this.navbar.style.padding="1rem",this.navbar.style.backgroundColor=t.background??"orange",this.navbarHeader.style.display="flex",this.navbarHeader.style.alignItems="center",this.navbarHeader.style.justifyContent="space-between",this.navbarHeader.style.width="100%",this.brand.style.fontSize="1.5rem",this.toggleButton.style.background="none",this.toggleButton.style.border="none",this.toggleButton.style.color=this.hamburgerColour??"white",this.toggleButton.style.fontSize="1.5rem",this.toggleButton.style.cursor="pointer",this.navContent.style.display="none"}add(t){console.log(t),this.items=t;for(var e=0;e<t.length;e++){let s=t[e];this.navContent.appendChild(s.render())}return this}toggleMobileNav(){this.isMobileNavOpen=!this.isMobileNavOpen,this.navContent.style.display=this.isMobileNavOpen?"flex":"none",this.isMobileNavOpen?(this.navContent.style.flexDirection="column",this.navContent.style.gap="0.5rem",this.navContent.style.padding="1rem"):(this.navContent.style.flexDirection="",this.navContent.style.gap="",this.navContent.style.backgroundColor="",this.navContent.style.padding="")}render(t){return t&&document.querySelector(t).appendChild(this.navbar),this.navbar}}module.exports=e})();