UNPKG

web2app-spa

Version:

This template is primarily designed to easily convert HTML pages and URLs into a Capacitor/Cordova based iOS/Android app that can be used as Single-page application (SPA).

1 lines 27.7 kB
!function(){"use strict";const t={};window.basic=t,t.startTime=Date.now(),t.ACTION_COLOR="#689BD2",t.ACTION2_COLOR="cadetblue",t.WARNING_COLOR="tomato",t.ALERT_COLOR="gold",t.CANCEL_COLOR="lightgray",t.TEXT_COLOR="rgba(0, 0, 0, 0.8)",t.BACKGROUND_COLOR="whitesmoke",t.DARK_BACKGROUND_COLOR="#141414",t.FONT_SIZE=20,t.BUTTON_WIDTH=130,t.BUTTON_HEIGHT=50,t.BUTTON_COLOR=t.ACTION_COLOR,t.BUTTON_TEXT_COLOR="rgba(0, 0, 0, 0.65)",t.TEXTBOX_WIDTH=270,t.TEXTBOX_HEIGHT=50,t.gunler=["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],t.days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],t.aylar=["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],t.months=["January","February","March","April","May","June","July","August","September","October","November","December"],window.that=null,window.previousThat=null,window.prevThat=null;let e,n,o=null;const i={objectAndFunctionList:[]},s={WITH_MOTION_TIME:50,DONT_MOTION_TIME:40};t.start=function(){window.page=new l,page.containerBox=null,setDefaultContainerBox(page),page.bodyElement.style.margin="0px",page.bodyElement.style.overflow="hidden",page.mainBox=createBox(0,0,page.width,page.height),page.mainBox.containerBox=null,that.element.style.position="fixed",that.color="transparent",page.onResize((function(){"function"==typeof page.refreshSize&&page.refreshSize()})),"function"==typeof start&&(start(),t.afterStart()),"function"==typeof loop&&(n||setLoopTimer(1e3))},t.afterStart=function(){},window.println=function(t,e="log"){console[e](t)},window.random=function(t,e){let n=0;return null!=e?e<t?println("basic.js: random(): The second parameter (number) must be greater than the first.","error"):n=t+Math.round(Math.random()*(e-t)):println("basic.js: random(): Two parameters (numbers) must be sent.","error"),n},window.num=function(t,e="float"){if("float"==e){const e=parseFloat(t);return Math.round(100*e)/100}if("integer"==e||"int"==e)return parseInt(t)},window.str=function(t){return String(t)},window.isMobile=function(){let t=0,e=navigator.userAgent||navigator.vendor||window.opera;return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t=1),t},window.go=function(t,e="_self"){return window.open(t,e)},window.twoDigitFormat=function(t){return t<=9&&(t="0"+t),t},window.storage={save(t,e){window.localStorage.setItem(t,JSON.stringify(e))},load:t=>JSON.parse(window.localStorage.getItem(t)),remove(t){window.localStorage.removeItem(t)}},window.clock={get hour(){return(new Date).getHours()},get minute(){return(new Date).getMinutes()},get second(){return(new Date).getSeconds()},get milisecond(){return(new Date).getMilliseconds()}},window.date={get year(){return(new Date).getFullYear()},get monthNumber(){let t=(new Date).getMonth();return t++,t},get ayAdi(){return t.aylar[this.monthNumber-1]},get monthName(){return t.months[this.monthNumber-1]},get dayNumber(){return(new Date).getDay()},get gunAdi(){return t.gunler[this.dayNumber]},get dayName(){return t.days[this.dayNumber]},get today(){return(new Date).getDate()},get now(){return Date.now()}};class r{constructor(t){this._type=t,this._visible=1,this._displayType="block",this._opacity=1,this._rotate=0,this._motionString="none",this._clickable=0,this._eventFuncList=[]}get parentBox(){return this._containerBox}set parentBox(t){this._containerBox=t}get containerBox(){return this._containerBox}set containerBox(t){this._containerBox=t}get left(){return"absolute"==this.position?parseFloat(this.contElement.style.left):this.contElement.offsetLeft}set left(t){this.contElement.style.right="",this.contElement.style.left=parseFloat(t)+"px"}get top(){return"absolute"==this.position?parseFloat(this.contElement.style.top):this.contElement.offsetTop}set top(t){this.contElement.style.bottom="",this.contElement.style.top=parseFloat(t)+"px"}get right(){return parseFloat(this.contElement.style.right)}set right(t){this.contElement.style.left="",this.contElement.style.right=parseFloat(t)+"px"}get bottom(){return parseFloat(this.contElement.style.bottom)}set bottom(t){this.contElement.style.top="",this.contElement.style.bottom=parseFloat(t)+"px"}get totalLeft(){return p(this.contElement,"Left")}get totalTop(){return p(this.contElement,"Top")}get width(){return"string"!=typeof this._width?this._width||0:this.contElement.offsetWidth}set width(t){this._width=t,this.contElement.style.width="string"!=typeof t?parseFloat(t)+"px":t}get height(){return"string"!=typeof this._height?this._height||0:this.contElement.offsetHeight}set height(t){this._height=t,this.contElement.style.height="string"!=typeof t?parseFloat(t)+"px":t}get rotate(){return this._rotate}set rotate(t){this._rotate=parseInt(t),this.contElement.style.transform="rotate("+t+"deg)"}get visible(){return this._visible}set visible(t){this._visible=t,this.contElement.style.display&&"none"!=this.contElement.style.display&&(this._displayType=this.contElement.style.display),this.contElement.style.display=1==t?this._displayType:"none"}get clickable(){return this._clickable}set clickable(t){this._clickable=t,this.contElement.style.pointerEvents=1==t?"auto":"none"}get opacity(){return this._opacity}set opacity(t){this._opacity=t,this.contElement.style.opacity=t}get color(){return this._backgroundColor}set color(t){this._backgroundColor=t,this.contElement.style.backgroundColor=t}get border(){return this._border}set border(t){this._border=t,this.contElement.style.borderWidth=t+"px"}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t,this.contElement.style.borderColor=t}get round(){return this._round}set round(t){this._round=t,this.contElement.style.borderRadius=t+"px"}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.element.style.fontSize=t+"px"}get textSize(){return this._fontSize}set textSize(t){this._fontSize=t,this.element.style.fontSize=t+"px"}get textColor(){return this._textColor}set textColor(t){this._textColor=t,this.element.style.color=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t,this.element.style.textAlign=t}get position(){return this.contElement.style.position?this.contElement.style.position:"absolute"}set position(t){this.contElement.style.position=t,"relative"==t&&(this.left=0,this.top=0)}center(t){g(this,t)}centerBy(t,e){b(this,t,e)}aline(t,e,n=0,o){f(this,t,e,n,o)}remove(){this.contElement.remove()}props(t,e,n){d(this,t,e,n)}_addEventListener(t,e,n){let o=this;const i=function(t){e(o,t)};n.addEventListener(t,i);const s={};s.eventName=t,s.originalFunc=e,s.func=i,s.element=n,this._eventFuncList.push(s)}_removeEventListener(t,e,n){let o=null;for(let t=0;t<this._eventFuncList.length;t++)if(this._eventFuncList[t].originalFunc==e){o=this._eventFuncList[t].func,this._eventFuncList.splice(t,1);break}o&&n.removeEventListener(t,o)}on(t,e,n=!1){const o="textbox"==this._type?this.inputElement:this.elem;return this.clickable=1,o.addEventListener(t,e,n),function(){o.removeEventListener(t,e)}}off(t,e){("textbox"==this._type?this.inputElement:this.elem).removeEventListener(t,e)}onResize(t){i.onResize(this,t)}remove_onResize(t){i.remove_onResize(this.element,t)}setMotion(t){const e=this;setTimeout((function(){e.setMotionNow(t)}),s.DONT_MOTION_TIME)}getMotion(){return this._motionString}setMotionNow(t){this._motionString=t,this.contElement.style.transition=t}withMotion(t){const e=this;setTimeout((function(){e.canMotionNow(),t(e)}),s.WITH_MOTION_TIME)}dontMotion(){this.contElement.style.transition="none";const t=this;setTimeout((function(){t.contElement.style.transition=t._motionString}),s.DONT_MOTION_TIME)}canMotionNow(){this.contElement.style.transition=this._motionString}}class l{constructor(){this._bodyElement=document.getElementsByTagName("BODY")[0],this._element=this._bodyElement,this._backgroundColor="white",this._zoom=1}get elem(){return this._element}get element(){return this._element}get contElement(){return this._element}get bodyElement(){return this._bodyElement}get mainBox(){return this._box}set mainBox(t){this._box=t,this._element=this._box.element}get width(){let t;return t=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,withPageZoom(t)}get height(){let t;return t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,withPageZoom(t)}get html(){return this._box.element.innerHTML}set html(t){this._box.element.innerHTML=t}get zoom(){return this._zoom}set zoom(t){this._zoom=t,this.bodyElement.style.transformOrigin="top left",this.bodyElement.style.transform="scale("+t+")",page.refreshSize()}get color(){return this._backgroundColor}set color(t){this._backgroundColor=t,this.bodyElement.style.backgroundColor=t}fit(t=document.body.clientWidth,e){page.zoom=1;let n=page.width;e=e||t,page.zoom=n>e?e/t:n/t}fitAuto(t,e){page.zoom=1;const n=t/e;let o=0;o=page.width/page.height<=n?page.width:page.height*n,page.fit(t,o)}refreshSize(){page.mainBox.width=page.width,page.mainBox.height=page.height}onClick(t){this._box._addEventListener("click",t,window)}remove_onClick(t){this._box._removeEventListener("click",t,window)}onResize(t){this._box._addEventListener("resize",t,window)}remove_onResize(t){this._box._removeEventListener("resize",t,window)}add(t){t.containerBox!=this&&(t.containerBox=this,this.element.appendChild(t.contElement))}}class a extends r{constructor(t=-1e3,e=-1e3,n=100,i=100){super("box"),this._backgroundColor="whitesmoke",this._border=0,this._borderColor="rgba(0, 0, 0, 0.6)",this._round=0,this._fontSize=16,this._textColor="rgba(0, 0, 0, 0.8)",this._textAlign="left";const s=document.createElement("DIV");s.classList.add("basic_box"),s.style.left=t+"px",s.style.top=e+"px",this._element=s,this._containerBox=o,null!=o?o.element.appendChild(this._element):println("basic.js: The library is not yet ready for use. Put your code in window.onload","error"),this.width=n,this.height=i,"flex"==o.element.style.display&&(this.position="relative"),makeBasicObject(this)}get elem(){return this._element}get element(){return this._element}get contElement(){return this._element}get text(){return this.element.innerHTML}set text(t){this.element.innerHTML=t}get html(){return this.element.innerHTML}set html(t){this.element.innerHTML=t}get scrollX(){return"auto"==this.contElement.style.overflowX?1:0}get scrollY(){return"auto"==this.contElement.style.overflowY?1:0}set scrollX(t){this.contElement.style.overflowX="hidden",1==t&&(this.clickable=1,this.contElement.style.overflowX="auto")}set scrollY(t){this.contElement.style.overflowY="hidden",1==t&&(this.clickable=1,this.contElement.style.overflowY="auto")}onClick(t){this.clickable=1,this._addEventListener("click",t,this.contElement)}remove_onClick(t){this._removeEventListener("click",t,this.contElement)}add(t){t.containerBox=this,this.element.appendChild(t.contElement)}in(t){const e=getDefaultContainerBox();setDefaultContainerBox(this),t(this),setDefaultContainerBox(e)}}window.createBox=function(t,e,n,o){return new a(t,e,n,o)};class c extends r{constructor(e=-1e3,n=-1e3,i=t.BUTTON_WIDTH,s=t.BUTTON_HEIGHT){super("button"),this._backgroundColor=t.BUTTON_COLOR,this._border=1,this._borderColor="rgba(0, 0, 0, 0.40)",this._round=4,this._fontSize=20,this._textColor=t.BUTTON_TEXT_COLOR,this._textAlign="center",this._clickable=1;const r=document.createElement("BUTTON");r.innerHTML="Button",r.classList.add("basic_button"),r.setAttribute("type","button"),r.style.left=e+"px",r.style.top=n+"px",this._element=r,this._containerBox=o,o.element.appendChild(this._element),this.width=i,this.height=s,"flex"==o.element.style.display&&(this.position="relative"),makeBasicObject(this)}get elem(){return this._element}get element(){return this._element}get contElement(){return this._element}get buttonElement(){return this._element}get text(){return this.buttonElement.innerHTML}set text(t){this.buttonElement.innerHTML=t}get value(){return this.buttonElement.value}set value(t){this.buttonElement.value=t}get enabled(){return this.buttonElement.disabled?0:1}set enabled(t){this.buttonElement.disabled=t?0:1}get minimal(){return this.buttonElement.classList.contains("minimal")?1:0}set minimal(t){t?this.buttonElement.classList.add("minimal"):this.buttonElement.classList.remove("minimal")}get spaceX(){return parseInt(this.contElement.style.paddingLeft)||0}set spaceX(t){this.contElement.style.paddingLeft=t+"px",this.contElement.style.paddingRight=t+"px"}onClick(t){this.clickable=1,this._addEventListener("click",t,this.buttonElement)}remove_onClick(t){this._removeEventListener("click",t,this.buttonElement)}add(t){println("basic.js: add(): Insertion cannot be made inside the Button object.","error")}}window.createButton=function(t,e,n,o){return new c(t,e,n,o)};class h extends r{constructor(e=-1e3,n=-1e3,i=t.TEXTBOX_WIDTH,s=t.TEXTBOX_HEIGHT){super("textbox"),this._backgroundColor="white",this._border=1,this._borderColor="#4A4A4A",this._round=4,this._fontSize=20,this._textColor="#4A4A4A",this._textAlign="left",this._clickable=1;const r=document.createElement("DIV");r.classList.add("basic_textbox-main"),this._mainElement=r;const l=document.createElement("DIV");l.classList.add("basic_textbox-title"),l.innerHTML="",this._titleElement=l;const a=document.createElement("INPUT");a.value="",a.classList.add("basic_textbox"),a.setAttribute("type","text"),a.style.width="100%",a.style.height="100%",this._element=a,r.style.left=e+"px",r.style.top=n+"px",r.appendChild(this._titleElement),r.appendChild(this._element),this._containerBox=o,o.element.appendChild(this._mainElement),this.width=i,this.height=s,"flex"==o.element.style.display&&(this.position="relative"),makeBasicObject(this)}get elem(){return this._mainElement}get element(){return this._mainElement}get inputElement(){return this._element}get contElement(){return this._mainElement}get titleElement(){return this._titleElement}get text(){return this.inputElement.value}set text(t){this.inputElement.value=t.toString()}get color(){return super.color}set color(t){this._backgroundColor=t,this.inputElement.style.backgroundColor=t}get title(){return this.titleElement.innerHTML}set title(t){this.titleElement.innerHTML=t}get enabled(){return this.inputElement.disabled?0:1}set enabled(t){this.inputElement.disabled=t?0:1}set border(t){this._border=t,this.inputElement.style.borderWidth=t+"px"}get border(){return super.border}get borderColor(){return super.borderColor}set borderColor(t){this._borderColor=t,this.inputElement.style.borderColor=t}set round(t){this._round=t,this.inputElement.style.borderRadius=t+"px"}get round(){return super.round}get clickable(){return super.clickable}set clickable(t){this._clickable=t,this.inputElement.style.pointerEvents=1==t?"auto":"none"}get fontSize(){return super.fontSize}set fontSize(t){this._fontSize=t,this.inputElement.style.fontSize=t+"px"}get textSize(){return super.textSize}set textSize(t){this._fontSize=t,this.inputElement.style.fontSize=t+"px"}get textColor(){return super.textColor}set textColor(t){this._textColor=t,this.inputElement.style.color=t}get textAlign(){return super.textAlign}set textAlign(t){this._textAlign=t,this.inputElement.style.textAlign=t}get minimal(){return this.inputElement.classList.contains("minimal")?1:0}set minimal(t){t?this.inputElement.classList.add("minimal"):this.inputElement.classList.remove("minimal")}onChange(t){this._addEventListener("input",t,this.inputElement)}remove_onChange(t){this._removeEventListener("input",t,this.inputElement)}add(t){println("basic.js: add(): Insertion cannot be made inside the TextBox object.","error")}}window.createTextBox=function(t,e,n,o){return new h(t,e,n,o)},window.createInput=function(t,e,n,o){return new h(t,e,n,o)};class m extends r{constructor(t=-1e3,e=-1e3,n="auto",i="auto"){super("label"),this._backgroundColor="transparent",this._border=0,this._borderColor="rgba(0, 0, 0, 0.6)",this._round=0,this._fontSize=20,this._textColor="rgba(0, 0, 0, 0.8)",this._textAlign="left";const s=document.createElement("DIV");s.classList.add("basic_label"),s.style.left=t+"px",s.style.top=e+"px",this._element=s,this._containerBox=o,o.element.appendChild(this._element),this.width=n,this.height=i,"flex"==o.element.style.display&&(this.position="relative"),makeBasicObject(this)}get elem(){return this._element}get element(){return this._element}get contElement(){return this._element}get text(){return this.element.innerHTML}set text(t){this.element.innerHTML=t}get space(){return parseInt(this.contElement.style.padding)||0}set space(t){this.contElement.style.padding=t+"px"}get spaceX(){return parseInt(this.contElement.style.paddingLeft)||0}set spaceX(t){this.contElement.style.paddingLeft=t+"px",this.contElement.style.paddingRight=t+"px"}get spaceY(){return parseInt(this.contElement.style.paddingTop)||0}set spaceY(t){this.contElement.style.paddingTop=t+"px",this.contElement.style.paddingBottom=t+"px"}onClick(t){this.clickable=1,this._addEventListener("click",t,this.contElement)}remove_onClick(t){this._removeEventListener("click",t,this.contElement)}add(t){println("basic.js: add(): Insertion cannot be made inside the Label object.","error")}}window.createLabel=function(t,e,n,o){return new m(t,e,n,o)};class u extends r{constructor(t=-1e3,e=-1e3,n=0,i=0){super("image"),this._autoSize=1,this._space=0,this._backgroundColor="transparent",this._border=0,this._borderColor="rgba(0, 0, 0, 0.6)",this._round=0;const s=document.createElement("IMG");s.classList.add("basic_image"),s.style.left=t+"px",s.style.top=e+"px",this._element=s,this._containerBox=o,o.element.appendChild(this._element),super.width=n,super.height=i;const r=this;(n||i)&&(this.autoSize=0),s.addEventListener("load",(function(){if(r.autoSize>0){const t=r.autoSize;r.width=parseInt(r.naturalWidth/t)+"px",r.height=parseInt(r.naturalHeight/t)+"px"}})),"flex"==o.element.style.display&&(this.position="relative"),makeBasicObject(this)}get elem(){return this._element}get element(){return this._element}get imageElement(){return this._element}get contElement(){return this._element}get width(){return super.width}set width(t){this.autoSize=0,super.width=t}get height(){return super.height}set height(t){this.autoSize=0,super.height=t}get naturalWidth(){return this.imageElement.naturalWidth}get naturalHeight(){return this.imageElement.naturalHeight}get autoSize(){return this._autoSize}set autoSize(t){this._autoSize=t}get space(){return this._space}set space(t){t>50&&(t=50),t<0&&(t=0),this._space=t;const e=parseInt(this.width/100*t),n=parseInt(this.height/100*t);this.contElement.style.paddingLeft=e+"px",this.contElement.style.paddingRight=e+"px",this.contElement.style.paddingTop=n+"px",this.contElement.style.paddingBottom=n+"px"}onClick(t){this.clickable=1,this._addEventListener("click",t,this.contElement)}remove_onClick(t){this._removeEventListener("click",t,this.contElement)}onLoad(t){this._addEventListener("load",t,this.imageElement)}remove_onLoad(t){this._removeEventListener("load",t,this.imageElement)}load(t){this.imageElement.setAttribute("src",t)}add(t){println("basic.js: add(): Insertion cannot be made inside the BImage object.","error")}}window.createImage=function(t,e,n,o){return new u(t,e,n,o)},window.createIcon=function(t,e,n,o){return new u(t,e,n,o)};const p=function(t,e){let n=0,o=t;for(;o.offsetParent;)n+=o["offset"+e],o=o.offsetParent;return n},d=function(t,e=[],n=[],o=[]){let i={};for(let t in e)i[t]=e[t];for(let t in n)i[t]=n[t];for(let t in o)i[t]=o[t];for(let e in i)t[e]=i[e]},g=function(t,e){if("left"==e||!e){const e=t.containerBox.width-2*(t.containerBox.border||0);t.left=parseInt((e-t.width)/2)}if("top"==e||!e){const e=t.containerBox.height-2*(t.containerBox.border||0);t.top=parseInt((e-t.height)/2)}},b=function(t,e,n){if("left"==n||!n){const o=e.width;t.left=parseInt((o-t.width)/2)+e.left,n&&(t.top=e.top)}if("top"==n||!n){const o=e.height;t.top=parseInt((o-t.height)/2)+e.top,n&&(t.left=e.left)}},f=function(t,e,n,o,i){if("left"==n?(isNaN(e.left)?isNaN(e.right)||(t.right=parseInt(e.right+e.width+o)):t.left=parseInt(e.left-t.width-o),isNaN(e.top)?t.bottom=parseInt(e.bottom):t.top=parseInt(e.top)):"top"==n?(isNaN(e.top)?isNaN(e.bottom)||(t.bottom=parseInt(e.bottom+e.height+o)):t.top=parseInt(e.top-t.height-o),isNaN(e.left)?t.right=parseInt(e.right):t.left=parseInt(e.left)):"right"==n?(isNaN(e.left)?isNaN(e.right)||(t.right=parseInt(e.right-t.width-o)):t.left=parseInt(e.left+e.width+o),isNaN(e.top)?t.bottom=parseInt(e.bottom):t.top=parseInt(e.top)):"bottom"==n?(isNaN(e.top)?isNaN(e.bottom)||(t.bottom=parseInt(e.bottom-t.height-o)):t.top=parseInt(e.top+e.height+o),isNaN(e.left)?t.right=parseInt(e.right):t.left=parseInt(e.left)):(isNaN(e.top)?isNaN(e.bottom)||(t.bottom=parseInt(e.bottom)):t.top=parseInt(e.top),isNaN(e.left)?isNaN(e.right)||(t.right=parseInt(e.right)):t.left=parseInt(e.left)),"left"==n||"right"==n){const n=e.height-t.height;switch(i){case"top":isNaN(e.top)&&(isNaN(e.bottom)||(t.bottom+=parseInt(n)));break;case"bottom":isNaN(e.top)?isNaN(e.bottom):t.top+=parseInt(n);break;case"center":isNaN(e.top)?isNaN(e.bottom)||(t.bottom+=parseInt(n/2)):t.top+=parseInt(n/2);break}}else if("top"==n||"bottom"==n){const n=e.width-t.width;switch(i){case"left":isNaN(e.left)&&(isNaN(e.right)||(t.right=parseInt(e.right+n)));break;case"right":isNaN(e.left)?isNaN(e.right):t.left+=parseInt(n);break;case"center":isNaN(e.left)?isNaN(e.right)||(t.right+=parseInt(n/2)):t.left+=parseInt(n/2);break}}};window.withPageZoom=function(t){return parseFloat(t*(1/page.zoom))},window.setLoopTimer=function(t){"function"==typeof loop&&(n&&(n=clearInterval(n)),0==t||(n=setInterval(loop,t)))},window.setDefaultContainerBox=function(t){e=o||page,o=t},window.restoreDefaultContainerBox=function(){o=e||page},window.getDefaultContainerBox=function(){return o},window.makeBasicObject=function(t){previousThat=that,prevThat=previousThat,that=t},i.onResize=function(t,e){const n={};n.obj=t,n.elem=t.element,n.func=e,i.objectAndFunctionList.push(n),i.whenDetected.observe(t.element)},i.remove_onResize=function(t,e){for(let n=i.objectAndFunctionList.length-1;n>=0;n--)i.objectAndFunctionList[n].elem==t&&i.objectAndFunctionList[n].func==e&&i.objectAndFunctionList.splice(n,1);i.whenDetected.unobserve(t)},i.whenDetected=new ResizeObserver((function(t){const e=i;for(let n=0;n<t.length;n++)for(let o=0;o<e.objectAndFunctionList.length;o++)t[n].target==e.objectAndFunctionList[o].elem&&e.objectAndFunctionList[o].func(e.objectAndFunctionList[o].obj)}));let _=[],w=null;const y=function(){w&&clearTimeout(w),w=setTimeout((function(){const t=_.length-1;t>0&&println("basic.js: Some started boxes were not ended. Count: "+t,"warn")}),100)};window.startFlexBox=function(t={},e,n,o,i){let s={},r=null;"object"==typeof t?(r=createBox(0,0,"100%","100%"),s=t):"object"==typeof e?(r=createBox(t,0,"100%","100%"),s=e):"object"==typeof n?(r=createBox(t,e,"100%","100%"),s=n):"object"==typeof o?(r=createBox(t,e,n,"100%"),s=o):"object"==typeof i?(r=createBox(t,e,n,o),s=i):r=createBox(t,e,n,o);const l={flexDirection:"row",flexWrap:"nowrap",alignContent:"center",justifyContent:"center",alignItems:"center",gap:"0px"};that.element.style.display="flex",r.props({color:"transparent"},l,s);for(let t in l)r.element.style[t]=r[t];return 0==_.length&&_.push(getDefaultContainerBox()),setDefaultContainerBox(r),_.push(r),y(),r},window.startBox=function(t={},e,n,o,i){let s={},r=null;return"object"==typeof t?(r=createBox(),s=t):"object"==typeof e?(r=createBox(t),s=e):"object"==typeof n?(r=createBox(t,e),s=n):"object"==typeof o?(r=createBox(t,e,n),s=o):"object"==typeof i?(r=createBox(t,e,n,o),s=i):r=createBox(t,e,n,o),r.props(s),0==_.length&&_.push(getDefaultContainerBox()),setDefaultContainerBox(r),_.push(r),y(),r},window.endBox=function(){_.length>1&&_.pop(),setDefaultContainerBox(_[_.length-1]),1==_.length&&(_=[])},window.endFlexBox=window.endBox;let x=null,E=null;window.saveCurrentThat=function(){x=that,E=previousThat},window.restoreThatFromSaved=function(){that=x,previousThat=E,prevThat=previousThat},window.Label=function(t,e,n,o,i){let s={},r=null;return"object"==typeof t?(r=createLabel(),s=t):"object"==typeof e?(r=createLabel(t),s=e):"object"==typeof n?(r=createLabel(t,e),s=n):"object"==typeof o?(r=createLabel(t,e,n),s=o):"object"==typeof i?(r=createLabel(t,e,n,o),s=i):r=createLabel(t,e,n,o),r.props(s),r},window.Input=function(t,e,n,o,i){let s={},r=null;return"object"==typeof t?(r=createTextBox(),s=t):"object"==typeof e?(r=createTextBox(t),s=e):"object"==typeof n?(r=createTextBox(t,e),s=n):"object"==typeof o?(r=createTextBox(t,e,n),s=o):"object"==typeof i?(r=createTextBox(t,e,n,o),s=i):r=createTextBox(t,e,n,o),r.props(s),r},window.Icon=function(t,e,n,o,i){let s={},r=null;return"object"==typeof t?(r=createImage(),s=t):"object"==typeof e?(r=createImage(t),s=e):"object"==typeof n?(r=createImage(t,e),s=n):"object"==typeof o?(r=createImage(t,e,n),s=o):"object"==typeof i?(r=createImage(t,e,n,o),s=i):r=createImage(t,e,n,o),r.props(s),r},window.Box=function(t,e,n,o,i){let s={},r=null;return"object"==typeof t?(r=createBox(),s=t):"object"==typeof e?(r=createBox(t),s=e):"object"==typeof n?(r=createBox(t,e),s=n):"object"==typeof o?(r=createBox(t,e,n),s=o):"object"==typeof i?(r=createBox(t,e,n,o),s=i):r=createBox(t,e,n,o),r.props(s),r},window.Button=function(t,e,n,o,i){let s={},r=null;return"object"==typeof t?(r=createButton(),s=t):"object"==typeof e?(r=createButton(t),s=e):"object"==typeof n?(r=createButton(t,e),s=n):"object"==typeof o?(r=createButton(t,e,n),s=o):"object"==typeof i?(r=createButton(t,e,n,o),s=i):r=createButton(t,e,n,o),r.props(s),r},window.startObject=function(){return saveCurrentThat(),startBox({color:"transparent"})},window.endObject=function(t){return endBox(),restoreThatFromSaved(),makeBasicObject(t),t},window.addEventListener("load",(function(){t.start()}))}();