aboutsummaryrefslogtreecommitdiff
path: root/ShareGuard.Web/wwwroot/beer.js
diff options
context:
space:
mode:
Diffstat (limited to 'ShareGuard.Web/wwwroot/beer.js')
-rw-r--r--ShareGuard.Web/wwwroot/beer.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/ShareGuard.Web/wwwroot/beer.js b/ShareGuard.Web/wwwroot/beer.js
new file mode 100644
index 0000000..518efbb
--- /dev/null
+++ b/ShareGuard.Web/wwwroot/beer.js
@@ -0,0 +1 @@
+const V=[],Z=new WeakSet,P=navigator.userAgent.includes("Chrome");navigator.userAgent.includes("Firefox");navigator.userAgent.includes("Safari");navigator.userAgent.includes("Windows");const G=navigator.userAgent.includes("Macintosh");navigator.userAgent.includes("Linux");navigator.userAgent.includes("Android");const Q=/iPad|iPhone|iPod/.test(navigator.userAgent);function bt(){return window==null?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches}async function J(t){await new Promise(n=>setTimeout(n,t))}function kt(){return"fxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16|0;return(t==="x"?n:n&3|8).toString(16)})}function h(t,n){try{return typeof t=="string"?(n??document).querySelector(t):t}catch{return null}}function a(t,n){try{return typeof t=="string"?(n??document).querySelectorAll(t):t??V}catch{return V}}function u(t,n){return(t==null?void 0:t.classList.contains(n))??!1}function y(t,n){var e;return((e=t==null?void 0:t.tagName)==null?void 0:e.toLowerCase())===n}function w(t,n){var e;return((e=t==null?void 0:t.type)==null?void 0:e.toLowerCase())===n}function g(t,n){if(t instanceof NodeList)for(let e=0;e<t.length;e++)t[e].classList.add(n);else t==null||t.classList.add(n)}function p(t,n){if(t instanceof NodeList)for(let e=0;e<t.length;e++)t[e].classList.remove(n);else t==null||t.classList.remove(n)}function C(t,n,e,i=!0){t!=null&&t.addEventListener&&t.addEventListener(n,e,i)}function r(t,n,e,i=!0){Tt(t),C(t,n,e,i)}function I(t,n,e,i=!0){t!=null&&t.removeEventListener&&t.removeEventListener(n,e,i)}function xt(t,n){var e;(e=n==null?void 0:n.parentNode)==null||e.insertBefore(t,n)}function F(t){return t==null?void 0:t.previousElementSibling}function $(t){return t==null?void 0:t.nextElementSibling}function T(t){return t==null?void 0:t.parentElement}function mt(t){const n=document.createElement("div");for(let e=0,i=Object.keys(t),s=i.length;e<s;e++){const c=i[e],o=t[c];n.setAttribute(c,o)}return n}function z(){var t;(t=document.activeElement)==null||t.blur()}function At(t){return a('[data-ui="#'+t+'"]')}function wt(t){return h('[data-ui="#'+t+'"]')}function Ct(t){t.id&&u(t,"page")&&(t=wt(t.id)??t);const n=T(t);if(!u(n,"tabs")&&!u(n,"tabbed")&&!y(n,"nav"))return;const e=a("a",n);for(let i=0;i<e.length;i++)p(e[i],"active");!y(t,"button")&&!u(t,"button")&&!u(t,"chip")&&g(t,"active")}function Tt(t){Z.has(t)||Z.add(t)}function tt(){const t=getComputedStyle(document.documentElement).getPropertyValue("--size")||"16px";return t.includes("%")?parseInt(t)*16/100:t.includes("em")?parseInt(t)*16:parseInt(t)}function nt(t){t.placeholder||(t.placeholder=" ")}function Lt(t){const n=t.currentTarget,e=T(n),i=h("input:not([type=file], [type=checkbox], [type=radio]), select, textarea",e);i&&i.focus()}function N(t){const n=t.currentTarget;L(n)}function q(t){const n=t.currentTarget;L(n)}function Et(t){const n=t.currentTarget;R(n)}function St(t){const n=t.currentTarget;W(n)}function Pt(t){const n=t.currentTarget;R(n,t)}function It(t){const n=t.currentTarget;W(n,t)}function Dt(t){var i;const n=t.currentTarget,e=h("input",T(n));e&&((i=n.textContent)!=null&&i.includes("visibility"))&&(e.type=e.type==="password"?"text":"password")}function Mt(t){const n=t.currentTarget;et(n)}function _t(){const t=a(".field > label");for(let n=0;n<t.length;n++)r(t[n],"click",Lt)}function Ot(){const t=a(".field > input:not([type=file], [type=color], [type=range])");for(let n=0;n<t.length;n++)r(t[n],"focus",N),r(t[n],"blur",q),L(t[n])}function Ft(){const t=a(".field > select");for(let n=0;n<t.length;n++)r(t[n],"focus",N),r(t[n],"blur",q)}function $t(){const t=a(".field > input[type=file]");for(let n=0;n<t.length;n++)r(t[n],"change",Et),R(t[n])}function zt(){const t=a(".field > input[type=color]");for(let n=0;n<t.length;n++)r(t[n],"change",St),W(t[n])}function Nt(){if(P&&!G&&!Q)return;const t=a(".field > textarea");for(let n=0;n<t.length;n++)r(t[n],"focus",N),r(t[n],"blur",q),r(t[n],"input",Mt),et(t[n])}function qt(){const t=a("input[type=password] ~ :is(i, a)");for(let n=0;n<t.length;n++)r(t[n],"click",Dt)}function L(t){w(t,"number")&&!t.value&&(t.value=""),nt(t)}function R(t,n){if((n==null?void 0:n.key)==="Enter"){const i=F(t);if(!w(i,"file"))return;i.click();return}const e=$(t);w(e,"text")&&(e.value=t.files?Array.from(t.files).map(i=>i.name).join(", "):"",e.readOnly=!0,r(e,"keydown",Pt,!1),L(e))}function W(t,n){if((n==null?void 0:n.key)==="Enter"){const i=F(t);if(!w(i,"color"))return;i.click();return}const e=$(t);w(e,"text")&&(e.readOnly=!0,e.value=t.value,r(e,"keydown",It,!1),L(e))}function et(t){if(nt(t),t.hasAttribute("rows"))return;const n=tt();t.style.blockSize="auto",t.style.blockSize=`${t.scrollHeight-n}px`}function Rt(){_t(),Ot(),Ft(),$t(),zt(),Nt(),qt()}function H(t){const n=t.target;!y(n,"input")&&!y(n,"select")||(n.type==="range"?(n.focus(),ot(n)):it())}function Wt(t){const n=t.target;requestAnimationFrame(()=>n.blur())}function it(){const t=document.body,n=a(".slider > input[type=range]");n.length?C(t,"input",H,!1):I(t,"input",H,!1);for(let e=0;e<n.length;e++)ot(n[e])}function ot(t){r(t,"change",Wt);const n=T(t),e=h("span",n),i=a("input",n);if(!i.length||!e)return;const s=tt(),c=u(n,"max")?0:.25*s*100/i[0].offsetWidth,o=[],l=[];for(let b=0,gt=i.length;b<gt;b++){const B=parseFloat(i[b].min)||0,ht=parseFloat(i[b].max)||100,K=parseFloat(i[b].value)||0,U=(K-B)*100/(ht-B),vt=c/2-c*U/100;o.push(U+vt),l.push(K)}let f=o[0],v=0,E=100-v-f,k=l[0],m=l[1]||0;i.length>1&&(f=Math.abs(o[1]-o[0]),v=o[1]>o[0]?o[0]:o[1],E=100-v-f,m>k&&(k=l[1]||0,m=l[0])),n.style.setProperty("--_start",`${v}%`),n.style.setProperty("--_end",`${E}%`),n.style.setProperty("--_value1",`'${k}'`),n.style.setProperty("--_value2",`'${m}'`)}function jt(){it()}const d={light:"",dark:""};function O(){var t;return(t=document==null?void 0:document.body)!=null&&t.classList.contains("dark")?"dark":"light"}function Bt(){if(d.light&&d.dark)return d;const t=document.body,n=document.createElement("body");n.className="light",t.appendChild(n);const e=document.createElement("body");e.className="dark",t.appendChild(e);const i=getComputedStyle(n),s=getComputedStyle(e),c=["--primary","--on-primary","--primary-container","--on-primary-container","--secondary","--on-secondary","--secondary-container","--on-secondary-container","--tertiary","--on-tertiary","--tertiary-container","--on-tertiary-container","--error","--on-error","--error-container","--on-error-container","--background","--on-background","--surface","--on-surface","--surface-variant","--on-surface-variant","--outline","--outline-variant","--shadow","--scrim","--inverse-surface","--inverse-on-surface","--inverse-primary","--surface-dim","--surface-bright","--surface-container-lowest","--surface-container-low","--surface-container","--surface-container-high","--surface-container-highest"];for(let o=0,l=c.length;o<l;o++)d.light+=c[o]+":"+i.getPropertyValue(c[o])+";",d.dark+=c[o]+":"+s.getPropertyValue(c[o])+";";return t.removeChild(n),t.removeChild(e),d}function Kt(t){const n=globalThis,e=document.body;if(!t||!n.materialDynamicColors)return Bt();const i=O();return t.light&&t.dark?(d.light=t.light,d.dark=t.dark,e.setAttribute("style",t[i]),t):n.materialDynamicColors(t).then(s=>{const c=o=>{let l="";for(let f=0,v=Object.keys(o),E=v.length;f<E;f++){const k=v[f],m=o[k],b=k.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase();l+="--"+b+":"+m+";"}return l};return d.light=c(s.light),d.dark=c(s.dark),e.setAttribute("style",d[i]),d})}function rt(t){const n=globalThis,e=document.body;if(!e)return t;if(!t)return O();t==="auto"&&(t=bt()?"dark":"light"),e.classList.remove("light","dark"),e.classList.add(t);const i=t==="light"?d.light:d.dark;return n.materialDynamicColors&&e.setAttribute("style",i),O()}const S=[];function ct(t){if(t.key==="Escape"){const n=t.currentTarget;st(n,n)}}function Ut(t){(h("[autofocus]",t)??t).focus()}function at(t,n){p(At(t.id),"active"),p(t,"active"),p(n,"active"),t.close(),S.pop();const e=S[S.length-1];e&&e.focus()}async function Vt(t,n,e,i){!y(i,"button")&&!u(i,"button")&&!u(i,"chip")&&g(i,"active"),g(n,"active"),g(t,"active"),e?t.showModal():t.show(),await J(90),e||C(t,"keydown",ct,!1),S.push(t),Ut(t)}function Zt(t){const n=t.currentTarget,e=$(n);y(e,"dialog")&&at(e,n)}async function st(t,n){z();let e=F(n);const i=u(n,"active")||n.open,s=u(n,"modal");s||I(n,"keydown",ct,!1),u(e,"overlay")||(e=mt({class:"overlay"}),xt(e,n),await J(90)),s||r(e,"click",Zt,!1),i?at(n,e):Vt(n,e,s,t)}let D;function ut(t){I(document.body,"click",ut);const n=t.target,e=a("menu.active");for(let i=0;i<e.length;i++)lt(n,e[i],t)}function Ht(t){setTimeout(()=>{const n=h(".field > input",t);n?n.focus():t.focus()},90)}function lt(t,n,e){D&&clearTimeout(D),D=setTimeout(()=>{C(document.body,"click",ut),y(document.activeElement,"input")||z();const i=u(n,"active"),s=(e==null?void 0:e.target)===t,c=!!t.closest("menu");if(!i&&c||i&&s){p(n,"active");return}p(a("menu.active"),"active"),g(n,"active"),Ht(n)},90)}let A;function Xt(t){const n=t.currentTarget;p(n,"active"),A&&clearTimeout(A)}function Yt(t,n){z();const e=a(".snackbar.active");for(let i=0;i<e.length;i++)p(e[i],"active");g(t,"active"),r(t,"click",Xt),A&&clearTimeout(A),n!==-1&&(A=setTimeout(()=>{p(t,"active")},n??6e3))}function Gt(t){const n=T(t);n&&p(a(":scope > .page",n),"active"),g(t,"active")}function Qt(t){Jt(t)}function Jt(t){const n=t.currentTarget,e=n.getBoundingClientRect(),i=Math.max(e.width,e.height),s=i/2,c=t.clientX-e.left-s,o=t.clientY-e.top-s,l=document.createElement("div");l.className="ripple-js";const f=document.createElement("div");f.style.inlineSize=f.style.blockSize=`${i}px`,f.style.left=`${c}px`,f.style.top=`${o}px`,f.addEventListener("animationend",()=>{l.remove()}),l.appendChild(f),n.appendChild(l)}function tn(){const t=a(".slow-ripple, .ripple, .fast-ripple");for(let n=0;n<t.length;n++)r(t[n],"pointerdown",Qt)}function X(t){const n=t.target;y(n,"progress")?ft(n):dt()}function ft(t){if(!t.hasAttribute("value")&&!t.hasAttribute("max")){const n=u(t,"circle")?"50":"100";t.style.setProperty("--_value",n),t.setAttribute("value",n),t.setAttribute("max","100"),t.classList.add("indeterminate")}else t.style.setProperty("--_value",String(t.value))}function dt(){if(P&&!G&&!Q)return;const t=document.body,n=a("progress");n.length?C(t,"input",X,!1):I(t,"input",X,!1);for(let e=0;e<n.length;e++)ft(n[e])}const x=globalThis;let M,_;function Y(){M&&clearTimeout(M),M=setTimeout(async()=>await yt(),180)}async function j(t,n,e,i){if(!n&&(n=h(t.getAttribute("data-ui")),!n)){t.classList.toggle("active");return}if(Ct(t),y(n,"dialog")){await st(t,n);return}if(y(n,"menu")){lt(t,n,i);return}if(u(n,"snackbar")){Yt(n,e);return}if(u(n,"page")){Gt(n);return}if(u(n,"active")){p(t,"active"),p(n,"active");return}g(n,"active")}function nn(t){j(t.currentTarget,null,null,t)}function en(t){t.key==="Enter"&&j(t.currentTarget,null,null,t)}function pt(){x.ui||_||!x.MutationObserver||(_=new MutationObserver(Y),_.observe(document.body,{childList:!0,subtree:!0}),Y())}function on(){const t=a("[data-ui]");for(let n=0,e=t.length;n<e;n++)r(t[n],"click",nn),y(t[n],"a")&&!t[n].getAttribute("href")&&r(t[n],"keydown",en)}function yt(t,n){if(t){if(t==="setup"){pt();return}if(t==="guid")return kt();if(t==="mode")return rt(n);if(t==="theme")return Kt(n);const e=h(t);if(!e)return;j(e,e,n)}on(),Rt(),jt(),tn(),dt()}function rn(){var n;if(x.ui)return;const t=(n=x.document)==null?void 0:n.body;t&&!t.classList.contains("dark")&&!t.classList.contains("light")&&rt("auto"),pt(),x.ui=yt}rn();const cn=x.ui;export{cn as default,cn as ui};