diff options
Diffstat (limited to 'src/dist/919.main.js')
-rw-r--r-- | src/dist/919.main.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/dist/919.main.js b/src/dist/919.main.js new file mode 100644 index 0000000..948cc6f --- /dev/null +++ b/src/dist/919.main.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwasm_app=self.webpackChunkwasm_app||[]).push([[919],{9:(e,t,n)=>{n.a(e,(async(e,i)=>{try{n.d(t,{Ws:()=>r.Ws});var o=n(407),r=n(987),a=e([o]);o=(a.then?(await a)():a)[0],(0,r.lI)(o),i()}catch(e){i(e)}}))},987:(e,t,n)=>{let i;function o(e){i=e}n.d(t,{RR:()=>p,Ws:()=>d,lI:()=>o}),e=n.hmd(e);let r=new("undefined"==typeof TextDecoder?(0,e.require)("util").TextDecoder:TextDecoder)("utf-8",{ignoreBOM:!0,fatal:!0});r.decode();let a=null;function c(){return null!==a&&0!==a.byteLength||(a=new Uint8Array(i.memory.buffer)),a}let s=0,u=new("undefined"==typeof TextEncoder?(0,e.require)("util").TextEncoder:TextEncoder)("utf-8");const l="function"==typeof u.encodeInto?function(e,t){return u.encodeInto(e,t)}:function(e,t){const n=u.encode(e);return t.set(n),{read:e.length,written:n.length}};function d(e){const t=function(e,t,n){if(void 0===n){const n=u.encode(e),i=t(n.length,1)>>>0;return c().subarray(i,i+n.length).set(n),s=n.length,i}let i=e.length,o=t(i,1)>>>0;const r=c();let a=0;for(;a<i;a++){const t=e.charCodeAt(a);if(t>127)break;r[o+a]=t}if(a!==i){0!==a&&(e=e.slice(a)),o=n(o,i,i=a+3*e.length,1)>>>0;const t=c().subarray(o+a,o+i);a+=l(e,t).written,o=n(o,i,a,1)>>>0}return s=a,o}(e,i.__wbindgen_malloc,i.__wbindgen_realloc),n=s;i.process_image(t,n)}function p(e,t){var n,i;alert((n=e,i=t,n>>>=0,r.decode(c().subarray(n,n+i))))}},208:(e,t,n)=>{n.d(t,{A:()=>L});var i=n(601),o=n.n(i),r=n(314),a=n.n(r),c=n(417),s=n.n(c),u=new URL(n(649),n.b),l=new URL(n(717),n.b),d=new URL(n(666),n.b),p=new URL(n(970),n.b),h=new URL(n(846),n.b),f=new URL(n(778),n.b),v=new URL(n(147),n.b),g=new URL(n(13),n.b),b=a()(o()),m=s()(u),y=s()(l),w=s()(d),x=s()(p),A=s()(h),k=s()(f),R=s()(v),T=s()(g);b.push([e.id,`.btn {\n width: 40px;\n height: 40px;\n}\n\n.btn-shot {\n background-size: cover;\n}\n.btn-shot.active {\n background-image: url(${m});\n}\n.btn-shot.non-active {\n background-image: url(${y});\n}\n\n.btn-pause {\n background-image: url(${w});\n background-size: cover;\n}\n.btn-play {\n background-image: url(${x});\n background-size: cover;\n}\n.btn-confirm {\n background-image: url(${A});\n background-size: cover;\n}\n.btn-log-del {\n background-image: url(${k});\n background-size: cover;\n}\n.btn-log-hide.active {\n background-image: url(${R});\n background-size: cover;\n}\n.btn-log-hide.non-active {\n background-image: url(${T});\n background-size: cover;\n}\n\n.content .output .overlay {\n /* 50% of view-port width/height */\n width: 50vw;\n height: 25vh;\n\n position: absolute;\n left: 25vw;\n top: 0;\n\n border: dotted green 1px;\n}\n.content .controls {\n display: flex;\n flex-direction: row;\n\n position: absolute;\n left: 25vw;\n /* This is but a start value, it will be changed at run time */\n top: 25vh;\n}\ndiv.output > img {\n z-index: 2;\n}\ndiv.output > video {\n z-index: 1;\n}\ndiv.output > canvas {\n z-index: -1; /* The canvas is only here for drawing the picture to show in img */\n}\n\n#console {\n position: absolute;\n /* This is but a start value, it will be changed at run time */\n top: 27vh;\n}\n`,""]);const L=b},314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,i,o,r){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(i)for(var c=0;c<this.length;c++){var s=this[c][0];null!=s&&(a[s]=!0)}for(var u=0;u<e.length;u++){var l=[].concat(e[u]);i&&a[l[0]]||(void 0!==r&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),o&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=o):l[4]="".concat(o)),t.push(l))}},t}},417:e=>{e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},601:e=>{e.exports=function(e){return e[1]}},72:e=>{var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var r={},a=[],c=0;c<e.length;c++){var s=e[c],u=i.base?s[0]+i.base:s[0],l=r[u]||0,d="".concat(u," ").concat(l);r[u]=l+1;var p=n(d),h={css:s[1],media:s[2],sourceMap:s[3],supports:s[4],layer:s[5]};if(-1!==p)t[p].references++,t[p].updater(h);else{var f=o(h,i);i.byIndex=c,t.splice(c,0,{identifier:d,updater:f,references:1})}a.push(d)}return a}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var r=i(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<r.length;a++){var c=n(r[a]);t[c].references--}for(var s=i(e,o),u=0;u<r.length;u++){var l=n(r[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}r=s}}},659:e=>{var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,o&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var r=n.sourceMap;r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},539:(e,t,n)=>{n.d(t,{O:()=>a,Y:()=>r});var i=n(173),o=n(272);function r(){const e=i.Ji.getContext("2d");e.fillStyle="#AAA",e.fillRect(0,0,i.Ji.width,i.Ji.height);const t=i.Ji.toDataURL("image/png");i.c.setAttribute("src",t),i.c.style["z-index"]=1}function a(){const e=(0,i.FA)();(0,o.Rm)(`w: ${i.MB}; h: ${e}`);const t=i.Ji.getContext("2d");i.Ji.width=i.MB,i.Ji.height=e,t.drawImage(i.Ki,0,0,i.MB,e);const n=i.Ji.toDataURL("image/png");i.c.setAttribute("src",n);const r=i.c.attributes;if((0,o.Rm)("Resulting attributes:"),0===r.length)(0,o.p6)("No attributes.");else for(let e=0;e<r.length;e++){const t=r[e];(0,o.p6)(`<${t.name}="${t.value}">`)}i.c.style["z-index"]=4}},173:(e,t,n)=>{n.d(t,{EI:()=>R,AX:()=>L,Ji:()=>M,ne:()=>b,FA:()=>N,KL:()=>A,jB:()=>k,Qf:()=>I,v7:()=>w,ZH:()=>y,Tj:()=>x,c:()=>T,Bw:()=>_,vh:()=>j,Ki:()=>$,MB:()=>B});var i=n(72),o=n.n(i),r=n(825),a=n.n(r),c=n(659),s=n.n(c),u=n(56),l=n.n(u),d=n(540),p=n.n(d),h=n(113),f=n.n(h),v=n(208),g={};g.styleTagTransform=f(),g.setAttributes=l(),g.insert=s().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=p(),o()(v.A,g),v.A&&v.A.locals&&v.A.locals;const b=document.querySelector(".controls"),m=[...b.querySelectorAll("button")],[y,w,x,A,k,R]=m,T=document.querySelector("#photo"),L=document.querySelector("#stream-input-select"),$=document.querySelector("#video"),M=document.querySelector("#canvas"),I=document.getElementById("console"),E=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),j=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0),B=.5*E;let S=0;function N(){return S}function _(e){S=e}},827:(e,t,n)=>{n.a(e,(async(e,i)=>{try{n.d(t,{v:()=>p});var o=n(173),r=n(272),a=n(539),c=n(729),s=n(9),u=e([c,s]);[c,s]=u.then?(await u)():u;let l=!1,d=!1;function p(){o.Ki.addEventListener("canplay",(e=>{d||((0,c.u)(),d=!0)}),!1),o.Tj.addEventListener("click",(e=>{if((0,r.Rm)("Clicked on screenshot.."),l)(0,r.p6)("Already taken a picture, clearing it.."),(0,a.Y)(),l=!1,o.Tj.classList.remove("non-active"),o.Tj.classList.add("active"),o.Tj.setAttribute("title","Take photo");else{(0,r.p6)("Taking a new picture...");try{(0,a.O)()}catch(e){(0,r.vV)(e)}l=!0,o.Tj.classList.add("non-active"),o.Tj.classList.remove("active"),o.Tj.setAttribute("title","Remove photo")}e.preventDefault()}),!1),o.v7.onclick=()=>{(0,r.Rm)("Clicked pause.."),o.Ki.pause()},o.KL.onclick=()=>{(0,r.Rm)("Clearing log..."),o.Qf.innerHTML="Log entries:"},o.jB.onclick=()=>{o.jB.classList.contains("active")?((0,r.Rm)("Log is shown, hiding it..."),o.jB.classList.add("non-active"),o.jB.classList.remove("active"),o.jB.setAttribute("title","Show the log"),o.Qf.style="display: None"):((0,r.Rm)("Unhiding the log..."),o.jB.classList.remove("non-active"),o.jB.classList.add("active"),o.jB.setAttribute("title","Hide the log"),o.Qf.style="display: Normal")},o.EI.onclick=()=>{(0,r.Rm)("Started to process image...");const e=o.c.getAttribute("src");if(!e)throw(0,r.vV)("No image is taken!"),"NoImageTaken";const t=s.Ws(e);(0,r.p6)("Got an output image; displaying it.."),o.c.setAttribute("src",t)},o.AX.onchange=()=>{(0,r.Rm)("Changed camereOptions.."),(0,c.u)(),d=!0},o.ZH.onclick=()=>{(0,r.Rm)("Clicked on play.."),d?((0,r.p6)("Stream already started, just starting video"),o.Ki.play()):((0,c.u)(),d=!0)}}i()}catch(h){i(h)}}))},98:(e,t,n)=>{n.a(e,(async(e,i)=>{try{n.r(t),n.d(t,{checkForApi:()=>u});var o=n(272),r=n(173),a=n(827),c=e([a]);a=(c.then?(await c)():c)[0];let s=!1;function u(){return!!s||("mediaDevices"in navigator&&"enumerateDevices"in navigator.mediaDevices?((0,o.Rm)("API check succeeded, all required functions are available!"),s=!0,!0):((0,o.Rm)("The needed api is not there. You probably need to re-access this website from a secure connection (https)"),!1))}async function l(){if(!u())throw"NotEnoughApi";const e=e=>{(0,o.wI)(`'${""===e.label?"No Label":e.label}' (${""===e.deviceId?"No Id":e.deviceId})`)},t=await navigator.mediaDevices.enumerateDevices();(0,o.p6)("Enumerated devices: ");for(let n=0;n<t.length;n++)e(t[n]);const n=t.filter((e=>"videoinput"===e.kind));if(0===n.length)throw(0,o.wI)("No video devices"),"NotEnoughDevices";(0,o.p6)("Enumerated _video_ devices: ");for(let t=0;t<n.length;t++)e(n[t]);(0,o.p6)("Resulting options: ");let i=0;const a=n.map((e=>{const t=`<option value="${e.deviceId}">${""===e.label?`${i} (No label)`:e.label}</option>`;return(0,o.wI)(t),i+=1,t}));r.AX.innerHTML=a.join(""),(0,o.p6)("Generated selection.")}l().catch((function(e){(0,o.vV)(`Encountered error: ${e}`)})),(0,a.v)(),i()}catch(d){i(d)}}))},272:(e,t,n)=>{n.d(t,{Rm:()=>a,p6:()=>c,vV:()=>r,wI:()=>s});var i=n(173);function o(e,t){const n=t+`-> ${e} [INFO]`,o=u(n);i.Qf.innerHTML=i.Qf.innerHTML+"<br>"+o,console.log(n)}function r(e){!function(e,t){const n=` -> ${e} [ERROR]`,o=u(n);i.Qf.innerHTML=i.Qf.innerHTML+"<br>"+o,console.error(n)}(e)}function a(e){o(e," ")}function c(e){o(e," ")}function s(e){o(e," ")}function u(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}},729:(e,t,n)=>{n.a(e,(async(e,i)=>{try{n.d(t,{u:()=>u});var o=n(173),r=n(272),a=n(98),c=e([a]);a=(c.then?(await c)():c)[0];const s={video:{facingMode:"user"},audio:!1};function u(){if((0,r.Rm)("Initializing the video stream"),!(0,a.checkForApi)())throw"NotEnoughApi";const e={...s,deviceId:{exact:o.AX.value}};navigator.mediaDevices.getUserMedia(e).then((e=>{(0,r.Rm)("Starting stream"),(0,r.p6)("Stream tracks are: "),e.getTracks().forEach((e=>{(0,r.wI)(`hint: '${e.contentHint}'; label: '${e.label}'; kind: '${e.kind}'.`)})),o.Ki.srcObject=e,o.Ki.play()})).catch((e=>{throw(0,r.vV)(`An error occurred: ${e}`),`Error: ${e}`}));let t=(0,o.FA)();t=o.Ki.videoHeight/(o.Ki.videoWidth/o.MB),(0,r.p6)(`With width: ${o.MB} and height: ${t}`),isNaN(t)&&(t=o.MB/(4/3),(0,r.p6)(`Height updated to: ${t}`)),o.ne.style.setProperty("top",`${t}px`),o.Qf.style.setProperty("top",`${t+.02*o.vh}px`),(0,o.Bw)(t),o.Ki.setAttribute("width",o.MB),o.Ki.setAttribute("height",t),o.Ji.setAttribute("width",o.MB),o.Ji.setAttribute("height",t),o.c.setAttribute("width",o.MB),o.c.setAttribute("height",t)}i()}catch(l){i(l)}}))},717:(e,t,n)=>{e.exports=n.p+"7dbefbfd70a575bc4e88.svg"},649:(e,t,n)=>{e.exports=n.p+"699d230654d2f7111166.svg"},846:(e,t,n)=>{e.exports=n.p+"b429fdfeed5479b1300f.svg"},778:(e,t,n)=>{e.exports=n.p+"b8dd0ce607bca97aa45c.svg"},147:(e,t,n)=>{e.exports=n.p+"9b252ac3c64df27e39dc.svg"},13:(e,t,n)=>{e.exports=n.p+"b1238fb7eda76106bcfa.svg"},666:(e,t,n)=>{e.exports=n.p+"2550f2a2ba04229047d1.svg"},970:(e,t,n)=>{e.exports=n.p+"7c595cc952560306ed09.svg"},407:(e,t,n)=>{var i=n(987);e.exports=n.v(t,e.id,"9d17ab5e13c8e97f7b64",{"./img_process_bg.js":{__wbg_alert_74f783bf17bc839f:i.RR}})}}]); \ No newline at end of file |