diff --git a/assets/index-B2PobF-h.js b/assets/index-B2PobF-h.js new file mode 100644 index 0000000..b23cb90 --- /dev/null +++ b/assets/index-B2PobF-h.js @@ -0,0 +1 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function l(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=l(s);fetch(s.href,i)}})();const ve=(e,t)=>e===t,K={equals:ve};let we=ee;const w=1,T=2,J={owned:null,cleanups:null,context:null,owner:null};var p=null;let O=null,ye=null,u=null,d=null,v=null,B=0;function Se(e,t){const l=u,n=p,s=e.length===0,i=t===void 0?n:t,o=s?J:{owned:null,cleanups:null,context:i?i.context:null,owner:i},r=s?e:()=>e(()=>P(()=>_(o)));p=o,u=null;try{return E(r,!0)}finally{u=l,p=n}}function m(e,t){t=t?Object.assign({},K,t):K;const l={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},n=s=>(typeof s=="function"&&(s=s(l.value)),Z(l,s));return[$e.bind(l),n]}function C(e,t,l){const n=_e(e,t,!1,w);D(n)}function P(e){if(u===null)return e();const t=u;u=null;try{return e()}finally{u=t}}function $e(){if(this.sources&&this.state)if(this.state===w)D(this);else{const e=d;d=null,E(()=>k(this),!1),d=e}if(u){const e=this.observers?this.observers.length:0;u.sources?(u.sources.push(this),u.sourceSlots.push(e)):(u.sources=[this],u.sourceSlots=[e]),this.observers?(this.observers.push(u),this.observerSlots.push(u.sources.length-1)):(this.observers=[u],this.observerSlots=[u.sources.length-1])}return this.value}function Z(e,t,l){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&E(()=>{for(let s=0;s1e6)throw d=[],new Error},!1)),t}function D(e){if(!e.fn)return;_(e);const t=B;Ce(e,e.value,t)}function Ce(e,t,l){let n;const s=p,i=u;u=p=e;try{n=e.fn(t)}catch(o){return e.pure&&(e.state=w,e.owned&&e.owned.forEach(_),e.owned=null),e.updatedAt=l+1,le(o)}finally{u=i,p=s}(!e.updatedAt||e.updatedAt<=l)&&(e.updatedAt!=null&&"observers"in e?Z(e,n):e.value=n,e.updatedAt=l)}function _e(e,t,l,n=w,s){const i={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:p,context:p?p.context:null,pure:l};return p===null||p!==J&&(p.owned?p.owned.push(i):p.owned=[i]),i}function z(e){if(e.state===0)return;if(e.state===T)return k(e);if(e.suspense&&P(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;l--)if(e=t[l],e.state===w)D(e);else if(e.state===T){const n=d;d=null,E(()=>k(e,t[0]),!1),d=n}}function E(e,t){if(d)return e();let l=!1;t||(d=[]),v?l=!0:v=[],B++;try{const n=e();return Ee(l),n}catch(n){l||(v=null),d=null,le(n)}}function Ee(e){if(d&&(ee(d),d=null),e)return;const t=v;v=null,t.length&&E(()=>we(t),!1)}function ee(e){for(let t=0;t=0;t--)_(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)_(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Ae(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function le(e,t=p){throw Ae(e)}function se(e,t){return P(()=>e(t||{}))}function Te(e,t,l){let n=l.length,s=t.length,i=n,o=0,r=0,c=t[s-1].nextSibling,a=null;for(;of-r){const A=t[o];for(;r{s=i,t===document?e():$(t,e(),t.firstChild?null:void 0,l)},n.owner),()=>{s(),t.textContent=""}}function ie(e,t,l){let n;const s=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},i=()=>(n||(n=s())).cloneNode(!0);return i.cloneNode=i,i}function Ne(e,t=window.document){const l=t[Q]||(t[Q]=new Set);for(let n=0,s=e.length;nN(e,t(),s,l),n)}function Be(e){let t=e.target;const l=`$$${e.type}`,n=e.target,s=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:!0,value:c}),o=()=>{const c=t[l];if(c&&!t.disabled){const a=t[`${l}Data`];if(a!==void 0?c.call(t,a,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),!0},r=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const c=e.composedPath();i(c[0]);for(let a=0;a{let r=t();for(;typeof r=="function";)r=r();l=N(e,r,l,n)}),()=>l;if(Array.isArray(t)){const r=[],c=l&&Array.isArray(l);if(L(r,t,l,s))return C(()=>l=N(e,r,l,n,!0)),()=>l;if(r.length===0){if(l=y(e,l,n),o)return l}else c?l.length===0?X(e,r,n):Te(e,l,r):(l&&y(e),X(e,r));l=r}else if(t.nodeType){if(Array.isArray(l)){if(o)return l=y(e,l,n,t);y(e,l,null,t)}else l==null||l===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);l=t}}return l}function L(e,t,l,n){let s=!1;for(let i=0,o=t.length;i=0;o--){const r=t[o];if(s!==r){const c=r.parentNode===e;!i&&!o?c?e.replaceChild(s,r):e.insertBefore(s,l):c&&r.remove()}else i=!0}}else e.insertBefore(s,l);return[s]}var Oe=ie('

Electric bill calculator

Simple yet comprehensive bill calculator for your electricity bills, no matter the provider or country. No ads, no tracking, no nonsense. Open-source and free to use.');function Le(){return Oe()}const Pe={name:"Malaysia",currency:"MYR",providers:{tnb:{name:"Tenaga Nasional Berhad",rates:[{range:[1,200],rate:.218},{range:[201,300],rate:.334},{range:[301,600],rate:.516},{range:[601,900],rate:.546},{range:[900,1e5],rate:.571}],charges:{service:.08,late:.01}}}},S={malaysia:Pe};function De(e,t,l,n){if(console.log(e,t,l,n),!S[t]||!S[t].providers||!S[t].providers[l])throw new Error(`Invalid country (${t}) or provider (${l}) combination`);let s=0,i=0,o=S[t].providers[l].rates,r=S[t].providers[l].charges.service,c=S[t].providers[l].charges.late;for(let a=0;af){let x=0;e>=f&&e<=h?x=(e-f)*g:e>h&&(x=(h-f)*g),s+=x}}if(e>600){e-=600;for(let a=0;a=f&&e<=h?x+=(e-f)*g*r:x+=(h-f)*g*r,i+=x}}return n==!0&&(s+=s*c),{bill:s,service:i,total:s+i}}var Me=ie(`

bille

Country

Provider


Usage (kWh)

Total Due

MYR

Service Charge

MYR

Current Bill

MYR

Apply late payment fee

Calculation`);function Fe(){const[e,t]=m(0),[l,n]=m(0),[s,i]=m(0),[o,r]=m(0),[c,a]=m("malaysia"),[f,h]=m("tnb"),[g,x]=m(!1);return(()=>{var A=Me(),ne=A.firstChild,M=ne.nextSibling,F=M.firstChild,re=F.nextSibling,oe=re.nextSibling,ae=oe.firstChild,U=ae.nextSibling,ce=U.firstChild,fe=ce.firstChild,R=fe.nextSibling,I=U.nextSibling,j=I.firstChild,ue=j.firstChild,Y=ue.nextSibling;Y.firstChild;var q=j.nextSibling,de=q.firstChild,G=de.nextSibling;G.firstChild;var he=q.nextSibling,pe=he.firstChild,H=pe.nextSibling;H.firstChild;var ge=I.nextSibling,V=ge.firstChild,xe=V.nextSibling,be=xe.firstChild,me=be.nextSibling,W=me.firstChild;return $(M,se(Le,{}),F),R.$$input=b=>r(b.target.value),$(Y,()=>e().toFixed(2),null),$(G,()=>l().toFixed(2),null),$(H,()=>s().toFixed(2),null),V.$$click=()=>{const b=De(o(),c(),f(),g());t(b.total),n(b.service),i(b.bill)},W.addEventListener("change",b=>x(b.target.checked)),C(()=>R.value=o()),C(()=>W.checked=g()),A})()}Ne(["input","click"]);const Ue=document.getElementById("root");ke(()=>se(Fe,{}),Ue); diff --git a/assets/index-B8w7dqQP.js b/assets/index-B8w7dqQP.js deleted file mode 100644 index 491fde4..0000000 --- a/assets/index-B8w7dqQP.js +++ /dev/null @@ -1 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function l(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=l(i);fetch(i.href,s)}})();let F=D;const b=1,m=2,B={owned:null,cleanups:null,context:null,owner:null};var u=null;let E=null,G=null,p=null,d=null,g=null,v=0;function H(e,t){const l=p,n=u,i=e.length===0,s=t===void 0?n:t,o=i?B:{owned:null,cleanups:null,context:s?s.context:null,owner:s},r=i?e:()=>e(()=>_(()=>w(o)));u=o,p=null;try{return S(r,!0)}finally{p=l,u=n}}function A(e,t,l){const n=q(e,t,!1,b);L(n)}function _(e){if(p===null)return e();const t=p;p=null;try{return e()}finally{p=t}}function V(e,t,l){let n=e.value;return(!e.comparator||!e.comparator(n,t))&&(e.value=t,e.observers&&e.observers.length&&S(()=>{for(let i=0;i1e6)throw d=[],new Error},!1)),t}function L(e){if(!e.fn)return;w(e);const t=v;W(e,e.value,t)}function W(e,t,l){let n;const i=u,s=p;p=u=e;try{n=e.fn(t)}catch(o){return e.pure&&(e.state=b,e.owned&&e.owned.forEach(w),e.owned=null),e.updatedAt=l+1,U(o)}finally{p=s,u=i}(!e.updatedAt||e.updatedAt<=l)&&(e.updatedAt!=null&&"observers"in e?V(e,n):e.value=n,e.updatedAt=l)}function q(e,t,l,n=b,i){const s={fn:e,state:n,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:u,context:u?u.context:null,pure:l};return u===null||u!==B&&(u.owned?u.owned.push(s):u.owned=[s]),s}function P(e){if(e.state===0)return;if(e.state===m)return $(e);if(e.suspense&&_(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;l--)if(e=t[l],e.state===b)L(e);else if(e.state===m){const n=d;d=null,S(()=>$(e,t[0]),!1),d=n}}function S(e,t){if(d)return e();let l=!1;t||(d=[]),g?l=!0:g=[],v++;try{const n=e();return K(l),n}catch(n){l||(g=null),d=null,U(n)}}function K(e){if(d&&(D(d),d=null),e)return;const t=g;g=null,t.length&&S(()=>F(t),!1)}function D(e){for(let t=0;t=0;t--)w(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)w(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Q(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function U(e,t=u){throw Q(e)}function R(e,t){return _(()=>e(t||{}))}function X(e,t,l){let n=l.length,i=t.length,s=n,o=0,r=0,f=t[i-1].nextSibling,c=null;for(;oa-r){const Y=t[o];for(;r{i=s,t===document?e():j(t,e(),t.firstChild?null:void 0,l)},n.owner),()=>{i(),t.textContent=""}}function I(e,t,l){let n;const i=()=>{const o=document.createElement("template");return o.innerHTML=e,o.content.firstChild},s=()=>(n||(n=i())).cloneNode(!0);return s.cloneNode=s,s}function Z(e,t=window.document){const l=t[N]||(t[N]=new Set);for(let n=0,i=e.length;ny(e,t(),i,l),n)}function z(e){let t=e.target;const l=`$$${e.type}`,n=e.target,i=e.currentTarget,s=f=>Object.defineProperty(e,"target",{configurable:!0,value:f}),o=()=>{const f=t[l];if(f&&!t.disabled){const c=t[`${l}Data`];if(c!==void 0?f.call(t,c,e):f.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),!0},r=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){const f=e.composedPath();s(f[0]);for(let c=0;c{let r=t();for(;typeof r=="function";)r=r();l=y(e,r,l,n)}),()=>l;if(Array.isArray(t)){const r=[],f=l&&Array.isArray(l);if(T(r,t,l,i))return A(()=>l=y(e,r,l,n,!0)),()=>l;if(r.length===0){if(l=x(e,l,n),o)return l}else f?l.length===0?O(e,r,n):X(e,l,r):(l&&x(e),O(e,r));l=r}else if(t.nodeType){if(Array.isArray(l)){if(o)return l=x(e,l,n,t);x(e,l,null,t)}else l==null||l===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);l=t}}return l}function T(e,t,l,n){let i=!1;for(let s=0,o=t.length;s=0;o--){const r=t[o];if(i!==r){const f=r.parentNode===e;!s&&!o?f?e.replaceChild(i,r):e.insertBefore(i,l):f&&r.remove()}else s=!0}}else e.insertBefore(i,l);return[i]}var ee=I('

Electric bill calculator

Simple yet comprehensive bill calculator for your electricity bills, no matter the provider or country. No ads, no tracking, no nonsense. Open-source and free to use.');function te(){return ee()}var le=I(`

bille

Country

Provider


Usage (kWh)

Total Due

MYR 1,580.65

Service Charge

MYR 125.86 (8%)

Current Bill

MYR 1243.00

Enable 1% late payment fee

Calculation`);function se(){return(()=>{var e=le(),t=e.firstChild,l=t.nextSibling,n=l.firstChild,i=n.nextSibling,s=i.nextSibling,o=s.firstChild,r=o.nextSibling,f=r.nextSibling,c=f.nextSibling,a=c.firstChild;return j(l,R(te,{}),n),a.$$click=()=>{},e})()}Z(["click"]);const ie=document.getElementById("root");J(()=>R(se,{}),ie); diff --git a/index.html b/index.html index 02b0f14..1aa69c3 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Solid App - +