diff --git a/asset-manifest.json b/asset-manifest.json index b2792c7..f751e5d 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,8 +1,8 @@ { "files": { "main.css": "/IHearU-client/static/css/main.608d16a4.chunk.css", - "main.js": "/IHearU-client/static/js/main.7762834b.chunk.js", - "main.js.map": "/IHearU-client/static/js/main.7762834b.chunk.js.map", + "main.js": "/IHearU-client/static/js/main.6da336cb.chunk.js", + "main.js.map": "/IHearU-client/static/js/main.6da336cb.chunk.js.map", "runtime-main.js": "/IHearU-client/static/js/runtime-main.fac7497a.js", "runtime-main.js.map": "/IHearU-client/static/js/runtime-main.fac7497a.js.map", "static/js/2.92baf28a.chunk.js": "/IHearU-client/static/js/2.92baf28a.chunk.js", @@ -19,6 +19,6 @@ "static/js/runtime-main.fac7497a.js", "static/js/2.92baf28a.chunk.js", "static/css/main.608d16a4.chunk.css", - "static/js/main.7762834b.chunk.js" + "static/js/main.6da336cb.chunk.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index cfb6864..8e9fda2 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -IHearU
\ No newline at end of file +IHearU
\ No newline at end of file diff --git a/service-worker.js b/service-worker.js index 3bccc01..18ce902 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/IHearU-client/",n(n.s=7)}([function(e,t,n){e.exports=n(6)},function(e,t,n){"use strict";try{self["workbox:core:5.1.4"]&&_()}catch(r){}},function(e,t,n){"use strict";try{self["workbox:precaching:5.1.4"]&&_()}catch(r){}},function(e,t,n){"use strict";try{self["workbox:routing:5.1.4"]&&_()}catch(r){}},function(e,t,n){"use strict";try{self["workbox:strategies:5.1.4"]&&_()}catch(r){}},function(e,t,n){"use strict";try{self["workbox:expiration:5.1.4"]&&_()}catch(r){}},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(S){o=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new O(r||[]);return i._invoke=function(e,t,n){var r=h;return function(a,i){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===a)throw i;return U()}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=E(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var o=f(e,t,n);if("normal"===o.type){if(r=n.done?v:l,o.arg===d)continue;return{value:o.arg,done:n.done}}"throw"===o.type&&(r=v,n.method="throw",n.arg=o.arg)}}}(e,n,c),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(S){return{type:"throw",arg:S}}}e.wrap=s;var h="suspendedStart",l="suspendedYield",p="executing",v="completed",d={};function y(){}function m(){}function g(){}var x={};x[i]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(T([])));b&&b!==n&&r.call(b,i)&&(x=b);var k=g.prototype=y.prototype=Object.create(x);function _(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(a,i,c,u){var o=f(e[a],e,i);if("throw"!==o.type){var s=o.arg,h=s.value;return h&&"object"===typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,c,u)}),(function(e){n("throw",e,c,u)})):t.resolve(h).then((function(e){s.value=e,c(s)}),(function(e){return n("throw",e,c,u)}))}u(o.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,a){n(e,r,t,a)}))}return a=a?a.then(i,i):i()}}function E(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var a=f(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,d;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function q(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(e){if(e){var n=e[i];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var a=-1,c=function n(){for(;++a=0;--i){var c=this.tryEntries[i],u=c.completion;if("root"===c.tryLoc)return a("end");if(c.tryLoc<=this.prev){var o=r.call(c,"catchLoc"),s=r.call(c,"finallyLoc");if(o&&s){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=r}catch(a){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,u=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){o=!0,c=e},f:function(){try{u||null==n.return||n.return()}finally{if(o)throw c}}}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function l(e){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){return!t||"object"!==l(t)&&"function"!==typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){var t=h();return function(){var n,r=f(e);if(t){var a=f(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return p(this,n)}}function d(e,t,n){return(d=h()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&o(a,n.prototype),a}).apply(null,arguments)}function y(e){var t="function"===typeof Map?new Map:void 0;return(y=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,f(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,e)})(e)}var m=function(e){for(var t=e,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a0&&(t+=" :: ".concat(JSON.stringify(r))),t},g=function(e){s(n,e);var t=v(n);function n(e,r){var a;u(this,n);var i=m(e,r);return(a=t.call(this,i)).name=e,a.details=r,a}return n}(y(Error)),x=new Set;function w(e){x.add(e)}var b={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},k=function(e){return[b.prefix,e,b.suffix].filter((function(e){return e&&e.length>0})).join("-")},_=function(e){return e||k(b.precache)},R=function(e){return e||k(b.runtime)},E=n(0),L=n.n(E);function q(e,t,n,r,a,i,c){try{var u=e[i](c),o=u.value}catch(s){return void n(s)}u.done?t(o):Promise.resolve(o).then(r,a)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function c(e){q(i,r,a,c,u,"next",e)}function u(e){q(i,r,a,c,u,"throw",e)}c(void 0)}))}}function T(){return U.apply(this,arguments)}function U(){return(U=O(L.a.mark((function e(){var t,n,r;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0,t=c(x),e.prev=2,t.s();case 4:if((n=t.n()).done){e.next=11;break}return r=n.value,e.next=8,r();case 8:0;case 9:e.next=4;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:0;case 20:case"end":return e.stop()}}),e,null,[[2,13,16,19]])})))).apply(this,arguments)}var S,N=function(e){return new URL(String(e),location.href).href.replace(new RegExp("^".concat(location.origin)),"")},j=function(e,t){return e.filter((function(e){return t in e}))},A=function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.request,r=t.mode,a=t.plugins,i=j(void 0===a?[]:a,"cacheKeyWillBeUsed"),u=n,o=c(i),e.prev=4,o.s();case 6:if((s=o.n()).done){e.next=15;break}return f=s.value,e.next=10,f.cacheKeyWillBeUsed.call(f,{mode:r,request:u});case 10:"string"===typeof(u=e.sent)&&(u=new Request(u));case 13:e.next=6;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(4),o.e(e.t0);case 20:return e.prev=20,o.f(),e.finish(20);case 23:return e.abrupt("return",u);case 24:case"end":return e.stop()}}),e,null,[[4,17,20,23]])})));return function(t){return e.apply(this,arguments)}}(),M=function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f,h,l;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.request,r=t.response,a=t.event,i=t.plugins,u=r,o=!1,s=c(void 0===i?[]:i),e.prev=4,s.s();case 6:if((f=s.n()).done){e.next=19;break}if(!("cacheWillUpdate"in(h=f.value))){e.next=17;break}return o=!0,l=h.cacheWillUpdate,e.next=13,l.call(h,{request:n,response:u,event:a});case 13:if(u=e.sent){e.next=17;break}return e.abrupt("break",19);case 17:e.next=6;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(4),s.e(e.t0);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return o||(u=u&&200===u.status?u:void 0),e.abrupt("return",u||null);case 29:case"end":return e.stop()}}),e,null,[[4,21,24,27]])})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f,h,l,p,v,d;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.cacheName,r=t.request,a=t.event,i=t.matchOptions,u=t.plugins,o=void 0===u?[]:u,e.next=3,self.caches.open(n);case 3:return s=e.sent,e.next=6,A({plugins:o,request:r,mode:"read"});case 6:return f=e.sent,e.next=9,s.match(f,i);case 9:h=e.sent,l=c(o),e.prev=12,l.s();case 14:if((p=l.n()).done){e.next=24;break}if(!("cachedResponseWillBeUsed"in(v=p.value))){e.next=22;break}return d=v.cachedResponseWillBeUsed,e.next=20,d.call(v,{cacheName:n,event:a,matchOptions:i,cachedResponse:h,request:f});case 20:h=e.sent;case 22:e.next=14;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(12),l.e(e.t0);case 29:return e.prev=29,l.f(),e.finish(29);case 32:return e.abrupt("return",h);case 33:case"end":return e.stop()}}),e,null,[[12,26,29,32]])})));return function(t){return e.apply(this,arguments)}}(),K={put:function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f,h,l,p,v,d,y,m;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.cacheName,r=t.request,a=t.response,i=t.event,u=t.plugins,o=void 0===u?[]:u,s=t.matchOptions,e.next=4;break;case 4:return e.next=6,A({plugins:o,request:r,mode:"write"});case 6:if(f=e.sent,a){e.next=10;break}throw new g("cache-put-with-no-response",{url:N(f.url)});case 10:return e.next=12,M({event:i,plugins:o,response:a,request:f});case 12:if(h=e.sent){e.next=16;break}return e.abrupt("return");case 16:return e.next=18,self.caches.open(n);case 18:if(l=e.sent,!((p=j(o,"cacheDidUpdate")).length>0)){e.next=26;break}return e.next=23,C({cacheName:n,matchOptions:s,request:f});case 23:e.t0=e.sent,e.next=27;break;case 26:e.t0=null;case 27:return v=e.t0,e.prev=29,e.next=32,l.put(f,h);case 32:e.next=40;break;case 34:if(e.prev=34,e.t1=e.catch(29),"QuotaExceededError"!==e.t1.name){e.next=39;break}return e.next=39,T();case 39:throw e.t1;case 40:d=c(p),e.prev=41,d.s();case 43:if((y=d.n()).done){e.next=49;break}return m=y.value,e.next=47,m.cacheDidUpdate.call(m,{cacheName:n,event:i,oldResponse:v,newResponse:h,request:f});case 47:e.next=43;break;case 49:e.next=54;break;case 51:e.prev=51,e.t2=e.catch(41),d.e(e.t2);case 54:return e.prev=54,d.f(),e.finish(54);case 57:case"end":return e.stop()}}),e,null,[[29,34],[41,51,54,57]])})));return function(t){return e.apply(this,arguments)}}(),match:C};function P(){if(void 0===S){var e=new Response("");if("body"in e)try{new Response(e.body),S=!0}catch(t){S=!1}S=!1}return S}function I(e){e.then((function(){}))}function D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(r=(c=u.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(o){a=!0,i=o}finally{try{r||null==u.return||u.return()}finally{if(a)throw i}}return n}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},i=a.onupgradeneeded,c=a.onversionchange;u(this,e),this._db=null,this._name=t,this._version=n,this._onupgradeneeded=i,this._onversionchange=c||function(){return r.close()}}return F(e,[{key:"db",get:function(){return this._db}},{key:"open",value:function(){var e=O(L.a.mark((function e(){var t=this;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._db){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,new Promise((function(e,n){var r=!1;setTimeout((function(){r=!0,n(new Error("The open request was blocked and timed out"))}),t.OPEN_TIMEOUT);var a=indexedDB.open(t._name,t._version);a.onerror=function(){return n(a.error)},a.onupgradeneeded=function(e){r?(a.transaction.abort(),a.result.close()):"function"===typeof t._onupgradeneeded&&t._onupgradeneeded(e)},a.onsuccess=function(){var n=a.result;r?n.close():(n.onversionchange=t._onversionchange.bind(t),e(n))}}));case 4:return this._db=e.sent,e.abrupt("return",this);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getKey",value:function(){var e=O(L.a.mark((function e(t,n){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllKeys(t,n,1);case 2:return e.abrupt("return",e.sent[0]);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getAll",value:function(){var e=O(L.a.mark((function e(t,n,r){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllMatching(t,{query:n,count:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"getAllKeys",value:function(){var e=O(L.a.mark((function e(t,n,r){var a;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllMatching(t,{query:n,count:r,includeKeys:!0});case 2:return a=e.sent,e.abrupt("return",a.map((function(e){return e.key})));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"getAllMatching",value:function(){var e=O(L.a.mark((function e(t){var n,r,a,i,c,u,o,s,f,h=arguments;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.length>1&&void 0!==h[1]?h[1]:{},r=n.index,a=n.query,i=void 0===a?null:a,c=n.direction,u=void 0===c?"next":c,o=n.count,s=n.includeKeys,f=void 0!==s&&s,e.next=3,this.transaction([t],"readonly",(function(e,n){var a=e.objectStore(t),c=r?a.index(r):a,s=[],h=c.openCursor(i,u);h.onsuccess=function(){var e=h.result;e?(s.push(f?e:e.value),o&&s.length>=o?n(s):e.continue()):n(s)}}));case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"transaction",value:function(){var e=O(L.a.mark((function e(t,n,r){var a=this;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.open();case 2:return e.next=4,new Promise((function(e,i){var c=a._db.transaction(t,n);c.onabort=function(){return i(c.error)},c.oncomplete=function(){return e()},r(c,(function(t){return e(t)}))}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"_call",value:function(){var e=O(L.a.mark((function e(t,n,r){var a,i,c,u,o=arguments;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a=o.length,i=new Array(a>3?a-3:0),c=3;c1?a-1:0),c=1;c0?n.clone():null,e.prev=12,h=c(u),e.prev=14,h.s();case 16:if((l=h.n()).done){e.next=27;break}if(!("requestWillFetch"in(p=l.value))){e.next=25;break}return v=p.requestWillFetch,d=n.clone(),e.next=23,v.call(p,{request:d,event:a});case 23:n=e.sent;case 25:e.next=16;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(14),h.e(e.t0);case 32:return e.prev=32,h.f(),e.finish(32);case 35:e.next=40;break;case 37:throw e.prev=37,e.t1=e.catch(12),new g("plugin-error-request-will-fetch",{thrownError:e.t1});case 40:if(y=n.clone(),e.prev=41,"navigate"!==n.mode){e.next=48;break}return e.next=45,fetch(n);case 45:m=e.sent,e.next=51;break;case 48:return e.next=50,fetch(n,r);case 50:m=e.sent;case 51:0,x=c(u),e.prev=53,x.s();case 55:if((w=x.n()).done){e.next=64;break}if(!("fetchDidSucceed"in(b=w.value))){e.next=62;break}return e.next=60,b.fetchDidSucceed.call(b,{event:a,request:y,response:m});case 60:m=e.sent;case 62:e.next=55;break;case 64:e.next=69;break;case 66:e.prev=66,e.t2=e.catch(53),x.e(e.t2);case 69:return e.prev=69,x.f(),e.finish(69);case 72:return e.abrupt("return",m);case 75:e.prev=75,e.t3=e.catch(41),k=c(s),e.prev=79,k.s();case 81:if((_=k.n()).done){e.next=87;break}return R=_.value,e.next=85,R.fetchDidFail.call(R,{error:e.t3,event:a,originalRequest:f.clone(),request:y.clone()});case 85:e.next=81;break;case 87:e.next=92;break;case 89:e.prev=89,e.t4=e.catch(79),k.e(e.t4);case 92:return e.prev=92,k.f(),e.finish(92);case 95:throw e.t3;case 96:case"end":return e.stop()}}),e,null,[[12,37],[14,29,32,35],[41,75],[53,66,69,72],[79,89,92,95]])})));return function(t){return e.apply(this,arguments)}}()};function J(e,t){return V.apply(this,arguments)}function V(){return(V=O(L.a.mark((function e(t,n){var r,a,i,c;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.clone(),a={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},i=n?n(a):a,!P()){e.next=7;break}e.t0=r.body,e.next=10;break;case 7:return e.next=9,r.blob();case 9:e.t0=e.sent;case 10:return c=e.t0,e.abrupt("return",new Response(c,i));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}n(5);var z="cache-entries",X=function(e){var t=new URL(e,location.href);return t.hash="",t.href},Z=function(){function e(t){var n=this;u(this,e),this._cacheName=t,this._db=new H("workbox-expiration",1,{onupgradeneeded:function(e){return n._handleUpgrade(e)}})}return F(e,[{key:"_handleUpgrade",value:function(e){var t=e.target.result.createObjectStore(z,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1}),Y(this._cacheName)}},{key:"setTimestamp",value:function(){var e=O(L.a.mark((function e(t,n){var r;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=X(t),r={url:t,timestamp:n,cacheName:this._cacheName,id:this._getId(t)},e.next=4,this._db.put(z,r);case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getTimestamp",value:function(){var e=O(L.a.mark((function e(t){var n;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._db.get(z,this._getId(t));case 2:return n=e.sent,e.abrupt("return",n.timestamp);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"expireEntries",value:function(){var e=O(L.a.mark((function e(t,n){var r,a,i,u,o,s=this;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._db.transaction(z,"readwrite",(function(e,r){var a=e.objectStore(z).index("timestamp").openCursor(null,"prev"),i=[],c=0;a.onsuccess=function(){var e=a.result;if(e){var u=e.value;u.cacheName===s._cacheName&&(t&&u.timestamp=n?i.push(e.value):c++),e.continue()}else r(i)}}));case 2:r=e.sent,a=[],i=c(r),e.prev=5,i.s();case 7:if((u=i.n()).done){e.next=14;break}return o=u.value,e.next=11,this._db.delete(z,o.id);case 11:a.push(o.url);case 12:e.next=7;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),i.e(e.t0);case 19:return e.prev=19,i.f(),e.finish(19);case 22:return e.abrupt("return",a);case 23:case"end":return e.stop()}}),e,this,[[5,16,19,22]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_getId",value:function(e){return this._cacheName+"|"+X(e)}}]),e}(),ee=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=n.maxEntries,this._maxAgeSeconds=n.maxAgeSeconds,this._cacheName=t,this._timestampModel=new Z(t)}return F(e,[{key:"expireEntries",value:function(){var e=O(L.a.mark((function e(){var t,n,r,a,i,u;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isRunning){e.next=3;break}return this._rerunRequested=!0,e.abrupt("return");case 3:return this._isRunning=!0,t=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,e.next=7,this._timestampModel.expireEntries(t,this._maxEntries);case 7:return n=e.sent,e.next=10,self.caches.open(this._cacheName);case 10:r=e.sent,a=c(n),e.prev=12,a.s();case 14:if((i=a.n()).done){e.next=20;break}return u=i.value,e.next=18,r.delete(u);case 18:e.next=14;break;case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(12),a.e(e.t0);case 25:return e.prev=25,a.f(),e.finish(25);case 28:0,this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,I(this.expireEntries()));case 31:case"end":return e.stop()}}),e,this,[[12,22,25,28]])})));return function(){return e.apply(this,arguments)}}()},{key:"updateTimestamp",value:function(){var e=O(L.a.mark((function e(t){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,this._timestampModel.setTimestamp(t,Date.now());case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isURLExpired",value:function(){var e=O(L.a.mark((function e(t){var n,r;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._maxAgeSeconds){e.next=6;break}e.next=3;break;case 3:return e.abrupt("return",!1);case 6:return e.next=8,this._timestampModel.getTimestamp(t);case 8:return n=e.sent,r=Date.now()-1e3*this._maxAgeSeconds,e.abrupt("return",n0&&void 0!==arguments[0]?arguments[0]:{};u(this,e),this.cachedResponseWillBeUsed=function(){var e=O(L.a.mark((function e(n){var r,a,i,c,u,o,s;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.event,a=n.request,i=n.cacheName,c=n.cachedResponse){e.next=3;break}return e.abrupt("return",null);case 3:if(u=t._isResponseDateFresh(c),I((o=t._getCacheExpiration(i)).expireEntries()),s=o.updateTimestamp(a.url),r)try{r.waitUntil(s)}catch(f){0}return e.abrupt("return",u?c:null);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.cacheDidUpdate=function(){var e=O(L.a.mark((function e(n){var r,a,i;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.cacheName,a=n.request,i=t._getCacheExpiration(r),e.next=5,i.updateTimestamp(a.url);case 5:return e.next=7,i.expireEntries();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._config=n,this._maxAgeSeconds=n.maxAgeSeconds,this._cacheExpirations=new Map,n.purgeOnQuotaError&&w((function(){return t.deleteCacheAndMetadata()}))}return F(e,[{key:"_getCacheExpiration",value:function(e){if(e===R())throw new g("expire-custom-caches-only");var t=this._cacheExpirations.get(e);return t||(t=new ee(e,this._config),this._cacheExpirations.set(e,t)),t}},{key:"_isResponseDateFresh",value:function(e){if(!this._maxAgeSeconds)return!0;var t=this._getDateHeaderTimestamp(e);return null===t||t>=Date.now()-1e3*this._maxAgeSeconds}},{key:"_getDateHeaderTimestamp",value:function(e){if(!e.headers.has("date"))return null;var t=e.headers.get("date"),n=new Date(t).getTime();return isNaN(n)?null:n}},{key:"deleteCacheAndMetadata",value:function(){var e=O(L.a.mark((function e(){var t,n,r,a,i;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=c(this._cacheExpirations),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}return r=D(n.value,2),a=r[0],i=r[1],e.next=7,self.caches.delete(a);case 7:return e.next=9,i.delete();case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:this._cacheExpirations=new Map;case 20:case"end":return e.stop()}}),e,this,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}()}]),e}(),ne=(n(2),[]),re=function(){return ne};function ae(e){if(!e)throw new g("add-to-cache-list-unexpected-type",{entry:e});if("string"===typeof e){var t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}var n=e.revision,r=e.url;if(!r)throw new g("add-to-cache-list-unexpected-type",{entry:e});if(!n){var a=new URL(r,location.href);return{cacheKey:a.href,url:a.href}}var i=new URL(r,location.href),c=new URL(r,location.href);return i.searchParams.set("__WB_REVISION__",n),{cacheKey:i.href,url:c.href}}var ie,ce=function(){function e(t){u(this,e),this._cacheName=_(t),this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map}return F(e,[{key:"addToCacheList",value:function(e){var t,n=[],r=c(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;"string"===typeof a?n.push(a):a&&void 0===a.revision&&n.push(a.url);var i=ae(a),u=i.cacheKey,o=i.url,s="string"!==typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(o)&&this._urlsToCacheKeys.get(o)!==u)throw new g("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(o),secondEntry:u});if("string"!==typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(u)&&this._cacheKeysToIntegrities.get(u)!==a.integrity)throw new g("add-to-cache-list-conflicting-integrities",{url:o});this._cacheKeysToIntegrities.set(u,a.integrity)}if(this._urlsToCacheKeys.set(o,u),this._urlsToCacheModes.set(o,s),n.length>0){var f="Workbox is precaching URLs without revision "+"info: ".concat(n.join(", "),"\nThis is generally NOT safe. ")+"Learn more at https://bit.ly/wb-precache";console.warn(f)}}}catch(h){r.e(h)}finally{r.f()}}},{key:"install",value:function(){var e=O(L.a.mark((function e(){var t,n,r,a,i,u,o,s,f,h,l,p,v,d,y,m=this,g=arguments;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=g.length>0&&void 0!==g[0]?g[0]:{},n=t.event,r=t.plugins,a=[],i=[],e.next=6,self.caches.open(this._cacheName);case 6:return u=e.sent,e.next=9,u.keys();case 9:o=e.sent,s=new Set(o.map((function(e){return e.url}))),f=c(this._urlsToCacheKeys);try{for(f.s();!(h=f.n()).done;)l=D(h.value,2),p=l[0],v=l[1],s.has(v)?i.push(p):a.push({cacheKey:v,url:p})}catch(x){f.e(x)}finally{f.f()}return d=a.map((function(e){var t=e.cacheKey,a=e.url,i=m._cacheKeysToIntegrities.get(t),c=m._urlsToCacheModes.get(a);return m._addURLToCache({cacheKey:t,cacheMode:c,event:n,integrity:i,plugins:r,url:a})})),e.next=16,Promise.all(d);case 16:return y=a.map((function(e){return e.url})),e.abrupt("return",{updatedURLs:y,notUpdatedURLs:i});case 19:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"activate",value:function(){var e=O(L.a.mark((function e(){var t,n,r,a,i,u,o;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,self.caches.open(this._cacheName);case 2:return t=e.sent,e.next=5,t.keys();case 5:n=e.sent,r=new Set(this._urlsToCacheKeys.values()),a=[],i=c(n),e.prev=9,i.s();case 11:if((u=i.n()).done){e.next=19;break}if(o=u.value,r.has(o.url)){e.next=17;break}return e.next=16,t.delete(o);case 16:a.push(o.url);case 17:e.next=11;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(9),i.e(e.t0);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",{deletedURLs:a});case 29:case"end":return e.stop()}}),e,this,[[9,21,24,27]])})));return function(){return e.apply(this,arguments)}}()},{key:"_addURLToCache",value:function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f,h,l,p,v;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.cacheKey,r=t.url,a=t.cacheMode,i=t.event,u=t.plugins,o=t.integrity,s=new Request(r,{integrity:o,cache:a,credentials:"same-origin"}),e.next=4,$.fetch({event:i,plugins:u,request:s});case 4:f=e.sent,l=c(u||[]);try{for(l.s();!(p=l.n()).done;)"cacheWillUpdate"in(v=p.value)&&(h=v)}catch(d){l.e(d)}finally{l.f()}if(!h){e.next=13;break}return e.next=10,h.cacheWillUpdate({event:i,request:s,response:f});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0=f.status<400;case 14:if(e.t0){e.next=17;break}throw new g("bad-precaching-response",{url:r,status:f.status});case 17:if(!f.redirected){e.next=21;break}return e.next=20,J(f);case 20:f=e.sent;case 21:return e.next=23,K.put({event:i,plugins:u,response:f,request:n===r?s:new Request(n),cacheName:this._cacheName,matchOptions:{ignoreSearch:!0}});case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getURLsToCacheKeys",value:function(){return this._urlsToCacheKeys}},{key:"getCachedURLs",value:function(){return i(this._urlsToCacheKeys.keys())}},{key:"getCacheKeyForURL",value:function(e){var t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}},{key:"matchPrecache",value:function(){var e=O(L.a.mark((function e(t){var n,r,a;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t instanceof Request?t.url:t,!(r=this.getCacheKeyForURL(n))){e.next=7;break}return e.next=5,self.caches.open(this._cacheName);case 5:return a=e.sent,e.abrupt("return",a.match(r));case 7:return e.abrupt("return",void 0);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"createHandler",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(){var n=O(L.a.mark((function n(r){var a,i;return L.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=r.request,n.prev=1,n.next=4,e.matchPrecache(a);case 4:if(!(i=n.sent)){n.next=7;break}return n.abrupt("return",i);case 7:throw new g("missing-precache-entry",{cacheName:e._cacheName,url:a instanceof Request?a.url:a});case 10:if(n.prev=10,n.t0=n.catch(1),!t){n.next=15;break}return n.abrupt("return",fetch(a));case 15:throw n.t0;case 16:case"end":return n.stop()}}),n,null,[[1,10]])})));return function(e){return n.apply(this,arguments)}}()}},{key:"createHandlerBoundToURL",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getCacheKeyForURL(e);if(!n)throw new g("non-precached-url",{url:e});var r=this.createHandler(t),a=new Request(e);return function(){return r({request:a})}}}]),e}(),ue=function(){return ie||(ie=new ce),ie};function oe(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=function(){var n=a[r];t.some((function(e){return e.test(n)}))&&e.searchParams.delete(n)},r=0,a=i(e.searchParams.keys());r1&&void 0!==d[1]?d[1]:{},n=t.ignoreURLParametersMatching,r=t.directoryIndex,a=t.cleanURLs,i=t.urlManipulation,(u=new URL(e,location.href)).hash="",y.next=5,u.href;case 5:return o=oe(u,n),y.next=8,o.href;case 8:if(!r||!o.pathname.endsWith("/")){y.next=13;break}return(s=new URL(o.href)).pathname+=r,y.next=13,s.href;case 13:if(!a){y.next=18;break}return(f=new URL(o.href)).pathname+=".html",y.next=18,f.href;case 18:if(!i){y.next=37;break}h=i({url:u}),l=c(h),y.prev=21,l.s();case 23:if((p=l.n()).done){y.next=29;break}return v=p.value,y.next=27,v.href;case 27:y.next=23;break;case 29:y.next=34;break;case 31:y.prev=31,y.t0=y.catch(21),l.e(y.t0);case 34:return y.prev=34,l.f(),y.finish(34);case 37:case"end":return y.stop()}}),se,null,[[21,31,34,37]])}var he=function(e,t){var n,r=ue().getURLsToCacheKeys(),a=c(fe(e,t));try{for(a.s();!(n=a.n()).done;){var i=n.value,u=r.get(i);if(u)return u}}catch(o){a.e(o)}finally{a.f()}},le=!1;function pe(e){le||(!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignoreURLParametersMatching,n=void 0===t?[/^utm_/]:t,r=e.directoryIndex,a=void 0===r?"index.html":r,i=e.cleanURLs,c=void 0===i||i,u=e.urlManipulation,o=_();self.addEventListener("fetch",(function(e){var t=he(e.request.url,{cleanURLs:c,directoryIndex:a,ignoreURLParametersMatching:n,urlManipulation:u});if(t){var r=self.caches.open(o).then((function(e){return e.match(t)})).then((function(e){return e||fetch(t)}));e.respondWith(r)}}))}(e),le=!0)}var ve=function(e){var t=ue(),n=re();e.waitUntil(t.install({event:e,plugins:n}).catch((function(e){throw e})))},de=function(e){var t=ue();e.waitUntil(t.activate())};n(3);var ye,me=function(e){return e&&"object"===typeof e?e:{handle:e}},ge=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET";u(this,e),this.handler=me(n),this.match=t,this.method=r},xe=function(e){s(n,e);var t=v(n);function n(e,r,a){u(this,n);return t.call(this,(function(t){var n=t.url,r=e.exec(n.href);if(r&&(n.origin===location.origin||0===r.index))return r.slice(1)}),r,a)}return n}(ge),we=function(){function e(){u(this,e),this._routes=new Map}return F(e,[{key:"routes",get:function(){return this._routes}},{key:"addFetchListener",value:function(){var e=this;self.addEventListener("fetch",(function(t){var n=t.request,r=e.handleRequest({request:n,event:t});r&&t.respondWith(r)}))}},{key:"addCacheListener",value:function(){var e=this;self.addEventListener("message",(function(t){if(t.data&&"CACHE_URLS"===t.data.type){var n=t.data.payload;0;var r=Promise.all(n.urlsToCache.map((function(t){"string"===typeof t&&(t=[t]);var n=d(Request,i(t));return e.handleRequest({request:n})})));t.waitUntil(r),t.ports&&t.ports[0]&&r.then((function(){return t.ports[0].postMessage(!0)}))}}))}},{key:"handleRequest",value:function(e){var t=this,n=e.request,r=e.event;var a=new URL(n.url,location.href);if(a.protocol.startsWith("http")){var i=this.findMatchingRoute({url:a,request:n,event:r}),c=i.params,u=i.route,o=u&&u.handler;if(!o&&this._defaultHandler&&(o=this._defaultHandler),o){var s;0;try{s=o.handle({url:a,request:n,event:r,params:c})}catch(f){s=Promise.reject(f)}return s instanceof Promise&&this._catchHandler&&(s=s.catch((function(e){return t._catchHandler.handle({url:a,request:n,event:r})}))),s}}}},{key:"findMatchingRoute",value:function(e){var t=e.url,n=e.request,r=e.event;var a,i=c(this._routes.get(n.method)||[]);try{for(i.s();!(a=i.n()).done;){var u=a.value,o=void 0,s=u.match({url:t,request:n,event:r});if(s)return o=s,(Array.isArray(s)&&0===s.length||s.constructor===Object&&0===Object.keys(s).length||"boolean"===typeof s)&&(o=void 0),{route:u,params:o}}}catch(f){i.e(f)}finally{i.f()}return{}}},{key:"setDefaultHandler",value:function(e){this._defaultHandler=me(e)}},{key:"setCatchHandler",value:function(e){this._catchHandler=me(e)}},{key:"registerRoute",value:function(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}},{key:"unregisterRoute",value:function(e){if(!this._routes.has(e.method))throw new g("unregister-route-but-not-found-with-method",{method:e.method});var t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new g("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)}}]),e}(),be=function(){return ye||((ye=new we).addFetchListener(),ye.addCacheListener()),ye};function ke(e,t,n){var r;if("string"===typeof e){var a=new URL(e,location.href);r=new ge((function(e){return e.url.href===a.href}),t,n)}else if(e instanceof RegExp)r=new xe(e,t,n);else if("function"===typeof e)r=new ge(e,t,n);else{if(!(e instanceof ge))throw new g("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});r=e}return be().registerRoute(r),r}n(4);var _e,Re={cacheWillUpdate:function(){var e=O(L.a.mark((function e(t){var n;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(200!==(n=t.response).status&&0!==n.status){e.next=3;break}return e.abrupt("return",n);case 3:return e.abrupt("return",null);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},Ee=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(u(this,e),this._cacheName=R(t.cacheName),this._plugins=t.plugins||[],t.plugins){var n=t.plugins.some((function(e){return!!e.cacheWillUpdate}));this._plugins=n?t.plugins:[Re].concat(i(t.plugins))}else this._plugins=[Re];this._fetchOptions=t.fetchOptions,this._matchOptions=t.matchOptions}return F(e,[{key:"handle",value:function(){var e=O(L.a.mark((function e(t){var n,r,a,i,c;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.event,r=t.request,[],"string"===typeof r&&(r=new Request(r)),a=this._getFromNetwork({request:r,event:n}),e.next=7,K.match({cacheName:this._cacheName,request:r,event:n,matchOptions:this._matchOptions,plugins:this._plugins});case 7:if(!(i=e.sent)){e.next=13;break}if(n)try{n.waitUntil(a)}catch(c){0}e.next=23;break;case 13:return e.prev=14,e.next=17,a;case 17:i=e.sent,e.next=23;break;case 20:e.prev=20,e.t0=e.catch(14),c=e.t0;case 23:if(i){e.next=26;break}throw new g("no-response",{url:r.url,error:c});case 26:return e.abrupt("return",i);case 27:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_getFromNetwork",value:function(){var e=O(L.a.mark((function e(t){var n,r,a,i;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.request,r=t.event,e.next=3,$.fetch({request:n,event:r,fetchOptions:this._fetchOptions,plugins:this._plugins});case 3:if(a=e.sent,i=K.put({cacheName:this._cacheName,request:n,response:a.clone(),event:r,plugins:this._plugins}),r)try{r.waitUntil(i)}catch(c){0}return e.abrupt("return",a);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();self.addEventListener("activate",(function(){return self.clients.claim()})),function(e){ue().addToCacheList(e),e.length>0&&(self.addEventListener("install",ve),self.addEventListener("activate",de))}([{'revision':'27dffd1aafbace498fe62fbfdcdbee12','url':'/IHearU-client/index.html'},{'revision':null,'url':'/IHearU-client/static/css/main.608d16a4.chunk.css'},{'revision':null,'url':'/IHearU-client/static/js/2.92baf28a.chunk.js'},{'revision':null,'url':'/IHearU-client/static/js/3.3b501cb0.chunk.js'},{'revision':null,'url':'/IHearU-client/static/js/main.7762834b.chunk.js'},{'revision':null,'url':'/IHearU-client/static/js/runtime-main.fac7497a.js'}]),pe(_e);var Le,qe=new RegExp("/[^/?]+\\.[^/]+$");ke((function(e){var t=e.request,n=e.url;return"navigate"===t.mode&&(!n.pathname.startsWith("/_")&&!n.pathname.match(qe))}),(Le="/IHearU-client/index.html",ue().createHandlerBoundToURL(Le))),ke((function(e){var t=e.url;return t.origin===self.location.origin&&t.pathname.endsWith(".png")}),new Ee({cacheName:"images",plugins:[new te({maxEntries:50})]})),self.addEventListener("message",(function(e){e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}))}]); +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/IHearU-client/",n(n.s=7)}([function(e,t,n){e.exports=n(6)},function(e,t,n){"use strict";try{self["workbox:core:5.1.4"]&&_()}catch(r){}},function(e,t,n){"use strict";try{self["workbox:precaching:5.1.4"]&&_()}catch(r){}},function(e,t,n){"use strict";try{self["workbox:routing:5.1.4"]&&_()}catch(r){}},function(e,t,n){"use strict";try{self["workbox:strategies:5.1.4"]&&_()}catch(r){}},function(e,t,n){"use strict";try{self["workbox:expiration:5.1.4"]&&_()}catch(r){}},function(e,t,n){var r=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(S){o=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new O(r||[]);return i._invoke=function(e,t,n){var r=h;return function(a,i){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===a)throw i;return U()}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=E(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var o=f(e,t,n);if("normal"===o.type){if(r=n.done?v:l,o.arg===d)continue;return{value:o.arg,done:n.done}}"throw"===o.type&&(r=v,n.method="throw",n.arg=o.arg)}}}(e,n,c),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(S){return{type:"throw",arg:S}}}e.wrap=s;var h="suspendedStart",l="suspendedYield",p="executing",v="completed",d={};function y(){}function m(){}function g(){}var x={};x[i]=function(){return this};var w=Object.getPrototypeOf,b=w&&w(w(T([])));b&&b!==n&&r.call(b,i)&&(x=b);var k=g.prototype=y.prototype=Object.create(x);function _(e){["next","throw","return"].forEach((function(t){o(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(a,i,c,u){var o=f(e[a],e,i);if("throw"!==o.type){var s=o.arg,h=s.value;return h&&"object"===typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,c,u)}),(function(e){n("throw",e,c,u)})):t.resolve(h).then((function(e){s.value=e,c(s)}),(function(e){return n("throw",e,c,u)}))}u(o.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,a){n(e,r,t,a)}))}return a=a?a.then(i,i):i()}}function E(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var a=f(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,d;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function q(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function T(e){if(e){var n=e[i];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var a=-1,c=function n(){for(;++a=0;--i){var c=this.tryEntries[i],u=c.completion;if("root"===c.tryLoc)return a("end");if(c.tryLoc<=this.prev){var o=r.call(c,"catchLoc"),s=r.call(c,"finallyLoc");if(o&&s){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),q(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;q(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=r}catch(a){Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,u=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return u=e.done,e},e:function(e){o=!0,c=e},f:function(){try{u||null==n.return||n.return()}finally{if(o)throw c}}}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function l(e){return(l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){return!t||"object"!==l(t)&&"function"!==typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e){var t=h();return function(){var n,r=f(e);if(t){var a=f(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return p(this,n)}}function d(e,t,n){return(d=h()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&o(a,n.prototype),a}).apply(null,arguments)}function y(e){var t="function"===typeof Map?new Map:void 0;return(y=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,f(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,e)})(e)}var m=function(e){for(var t=e,n=arguments.length,r=new Array(n>1?n-1:0),a=1;a0&&(t+=" :: ".concat(JSON.stringify(r))),t},g=function(e){s(n,e);var t=v(n);function n(e,r){var a;u(this,n);var i=m(e,r);return(a=t.call(this,i)).name=e,a.details=r,a}return n}(y(Error)),x=new Set;function w(e){x.add(e)}var b={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},k=function(e){return[b.prefix,e,b.suffix].filter((function(e){return e&&e.length>0})).join("-")},_=function(e){return e||k(b.precache)},R=function(e){return e||k(b.runtime)},E=n(0),L=n.n(E);function q(e,t,n,r,a,i,c){try{var u=e[i](c),o=u.value}catch(s){return void n(s)}u.done?t(o):Promise.resolve(o).then(r,a)}function O(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function c(e){q(i,r,a,c,u,"next",e)}function u(e){q(i,r,a,c,u,"throw",e)}c(void 0)}))}}function T(){return U.apply(this,arguments)}function U(){return(U=O(L.a.mark((function e(){var t,n,r;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0,t=c(x),e.prev=2,t.s();case 4:if((n=t.n()).done){e.next=11;break}return r=n.value,e.next=8,r();case 8:0;case 9:e.next=4;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(2),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:0;case 20:case"end":return e.stop()}}),e,null,[[2,13,16,19]])})))).apply(this,arguments)}var S,N=function(e){return new URL(String(e),location.href).href.replace(new RegExp("^".concat(location.origin)),"")},j=function(e,t){return e.filter((function(e){return t in e}))},A=function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.request,r=t.mode,a=t.plugins,i=j(void 0===a?[]:a,"cacheKeyWillBeUsed"),u=n,o=c(i),e.prev=4,o.s();case 6:if((s=o.n()).done){e.next=15;break}return f=s.value,e.next=10,f.cacheKeyWillBeUsed.call(f,{mode:r,request:u});case 10:"string"===typeof(u=e.sent)&&(u=new Request(u));case 13:e.next=6;break;case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(4),o.e(e.t0);case 20:return e.prev=20,o.f(),e.finish(20);case 23:return e.abrupt("return",u);case 24:case"end":return e.stop()}}),e,null,[[4,17,20,23]])})));return function(t){return e.apply(this,arguments)}}(),M=function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f,h,l;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.request,r=t.response,a=t.event,i=t.plugins,u=r,o=!1,s=c(void 0===i?[]:i),e.prev=4,s.s();case 6:if((f=s.n()).done){e.next=19;break}if(!("cacheWillUpdate"in(h=f.value))){e.next=17;break}return o=!0,l=h.cacheWillUpdate,e.next=13,l.call(h,{request:n,response:u,event:a});case 13:if(u=e.sent){e.next=17;break}return e.abrupt("break",19);case 17:e.next=6;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(4),s.e(e.t0);case 24:return e.prev=24,s.f(),e.finish(24);case 27:return o||(u=u&&200===u.status?u:void 0),e.abrupt("return",u||null);case 29:case"end":return e.stop()}}),e,null,[[4,21,24,27]])})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f,h,l,p,v,d;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.cacheName,r=t.request,a=t.event,i=t.matchOptions,u=t.plugins,o=void 0===u?[]:u,e.next=3,self.caches.open(n);case 3:return s=e.sent,e.next=6,A({plugins:o,request:r,mode:"read"});case 6:return f=e.sent,e.next=9,s.match(f,i);case 9:h=e.sent,l=c(o),e.prev=12,l.s();case 14:if((p=l.n()).done){e.next=24;break}if(!("cachedResponseWillBeUsed"in(v=p.value))){e.next=22;break}return d=v.cachedResponseWillBeUsed,e.next=20,d.call(v,{cacheName:n,event:a,matchOptions:i,cachedResponse:h,request:f});case 20:h=e.sent;case 22:e.next=14;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(12),l.e(e.t0);case 29:return e.prev=29,l.f(),e.finish(29);case 32:return e.abrupt("return",h);case 33:case"end":return e.stop()}}),e,null,[[12,26,29,32]])})));return function(t){return e.apply(this,arguments)}}(),K={put:function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f,h,l,p,v,d,y,m;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.cacheName,r=t.request,a=t.response,i=t.event,u=t.plugins,o=void 0===u?[]:u,s=t.matchOptions,e.next=4;break;case 4:return e.next=6,A({plugins:o,request:r,mode:"write"});case 6:if(f=e.sent,a){e.next=10;break}throw new g("cache-put-with-no-response",{url:N(f.url)});case 10:return e.next=12,M({event:i,plugins:o,response:a,request:f});case 12:if(h=e.sent){e.next=16;break}return e.abrupt("return");case 16:return e.next=18,self.caches.open(n);case 18:if(l=e.sent,!((p=j(o,"cacheDidUpdate")).length>0)){e.next=26;break}return e.next=23,C({cacheName:n,matchOptions:s,request:f});case 23:e.t0=e.sent,e.next=27;break;case 26:e.t0=null;case 27:return v=e.t0,e.prev=29,e.next=32,l.put(f,h);case 32:e.next=40;break;case 34:if(e.prev=34,e.t1=e.catch(29),"QuotaExceededError"!==e.t1.name){e.next=39;break}return e.next=39,T();case 39:throw e.t1;case 40:d=c(p),e.prev=41,d.s();case 43:if((y=d.n()).done){e.next=49;break}return m=y.value,e.next=47,m.cacheDidUpdate.call(m,{cacheName:n,event:i,oldResponse:v,newResponse:h,request:f});case 47:e.next=43;break;case 49:e.next=54;break;case 51:e.prev=51,e.t2=e.catch(41),d.e(e.t2);case 54:return e.prev=54,d.f(),e.finish(54);case 57:case"end":return e.stop()}}),e,null,[[29,34],[41,51,54,57]])})));return function(t){return e.apply(this,arguments)}}(),match:C};function P(){if(void 0===S){var e=new Response("");if("body"in e)try{new Response(e.body),S=!0}catch(t){S=!1}S=!1}return S}function I(e){e.then((function(){}))}function D(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,a=!1,i=void 0;try{for(var c,u=e[Symbol.iterator]();!(r=(c=u.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(o){a=!0,i=o}finally{try{r||null==u.return||u.return()}finally{if(a)throw i}}return n}}(e,t)||a(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},i=a.onupgradeneeded,c=a.onversionchange;u(this,e),this._db=null,this._name=t,this._version=n,this._onupgradeneeded=i,this._onversionchange=c||function(){return r.close()}}return F(e,[{key:"db",get:function(){return this._db}},{key:"open",value:function(){var e=O(L.a.mark((function e(){var t=this;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._db){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,new Promise((function(e,n){var r=!1;setTimeout((function(){r=!0,n(new Error("The open request was blocked and timed out"))}),t.OPEN_TIMEOUT);var a=indexedDB.open(t._name,t._version);a.onerror=function(){return n(a.error)},a.onupgradeneeded=function(e){r?(a.transaction.abort(),a.result.close()):"function"===typeof t._onupgradeneeded&&t._onupgradeneeded(e)},a.onsuccess=function(){var n=a.result;r?n.close():(n.onversionchange=t._onversionchange.bind(t),e(n))}}));case 4:return this._db=e.sent,e.abrupt("return",this);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getKey",value:function(){var e=O(L.a.mark((function e(t,n){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllKeys(t,n,1);case 2:return e.abrupt("return",e.sent[0]);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getAll",value:function(){var e=O(L.a.mark((function e(t,n,r){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllMatching(t,{query:n,count:r});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"getAllKeys",value:function(){var e=O(L.a.mark((function e(t,n,r){var a;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAllMatching(t,{query:n,count:r,includeKeys:!0});case 2:return a=e.sent,e.abrupt("return",a.map((function(e){return e.key})));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"getAllMatching",value:function(){var e=O(L.a.mark((function e(t){var n,r,a,i,c,u,o,s,f,h=arguments;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.length>1&&void 0!==h[1]?h[1]:{},r=n.index,a=n.query,i=void 0===a?null:a,c=n.direction,u=void 0===c?"next":c,o=n.count,s=n.includeKeys,f=void 0!==s&&s,e.next=3,this.transaction([t],"readonly",(function(e,n){var a=e.objectStore(t),c=r?a.index(r):a,s=[],h=c.openCursor(i,u);h.onsuccess=function(){var e=h.result;e?(s.push(f?e:e.value),o&&s.length>=o?n(s):e.continue()):n(s)}}));case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"transaction",value:function(){var e=O(L.a.mark((function e(t,n,r){var a=this;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.open();case 2:return e.next=4,new Promise((function(e,i){var c=a._db.transaction(t,n);c.onabort=function(){return i(c.error)},c.oncomplete=function(){return e()},r(c,(function(t){return e(t)}))}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"_call",value:function(){var e=O(L.a.mark((function e(t,n,r){var a,i,c,u,o=arguments;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(a=o.length,i=new Array(a>3?a-3:0),c=3;c1?a-1:0),c=1;c0?n.clone():null,e.prev=12,h=c(u),e.prev=14,h.s();case 16:if((l=h.n()).done){e.next=27;break}if(!("requestWillFetch"in(p=l.value))){e.next=25;break}return v=p.requestWillFetch,d=n.clone(),e.next=23,v.call(p,{request:d,event:a});case 23:n=e.sent;case 25:e.next=16;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(14),h.e(e.t0);case 32:return e.prev=32,h.f(),e.finish(32);case 35:e.next=40;break;case 37:throw e.prev=37,e.t1=e.catch(12),new g("plugin-error-request-will-fetch",{thrownError:e.t1});case 40:if(y=n.clone(),e.prev=41,"navigate"!==n.mode){e.next=48;break}return e.next=45,fetch(n);case 45:m=e.sent,e.next=51;break;case 48:return e.next=50,fetch(n,r);case 50:m=e.sent;case 51:0,x=c(u),e.prev=53,x.s();case 55:if((w=x.n()).done){e.next=64;break}if(!("fetchDidSucceed"in(b=w.value))){e.next=62;break}return e.next=60,b.fetchDidSucceed.call(b,{event:a,request:y,response:m});case 60:m=e.sent;case 62:e.next=55;break;case 64:e.next=69;break;case 66:e.prev=66,e.t2=e.catch(53),x.e(e.t2);case 69:return e.prev=69,x.f(),e.finish(69);case 72:return e.abrupt("return",m);case 75:e.prev=75,e.t3=e.catch(41),k=c(s),e.prev=79,k.s();case 81:if((_=k.n()).done){e.next=87;break}return R=_.value,e.next=85,R.fetchDidFail.call(R,{error:e.t3,event:a,originalRequest:f.clone(),request:y.clone()});case 85:e.next=81;break;case 87:e.next=92;break;case 89:e.prev=89,e.t4=e.catch(79),k.e(e.t4);case 92:return e.prev=92,k.f(),e.finish(92);case 95:throw e.t3;case 96:case"end":return e.stop()}}),e,null,[[12,37],[14,29,32,35],[41,75],[53,66,69,72],[79,89,92,95]])})));return function(t){return e.apply(this,arguments)}}()};function J(e,t){return V.apply(this,arguments)}function V(){return(V=O(L.a.mark((function e(t,n){var r,a,i,c;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.clone(),a={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},i=n?n(a):a,!P()){e.next=7;break}e.t0=r.body,e.next=10;break;case 7:return e.next=9,r.blob();case 9:e.t0=e.sent;case 10:return c=e.t0,e.abrupt("return",new Response(c,i));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}n(5);var z="cache-entries",X=function(e){var t=new URL(e,location.href);return t.hash="",t.href},Z=function(){function e(t){var n=this;u(this,e),this._cacheName=t,this._db=new H("workbox-expiration",1,{onupgradeneeded:function(e){return n._handleUpgrade(e)}})}return F(e,[{key:"_handleUpgrade",value:function(e){var t=e.target.result.createObjectStore(z,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1}),Y(this._cacheName)}},{key:"setTimestamp",value:function(){var e=O(L.a.mark((function e(t,n){var r;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=X(t),r={url:t,timestamp:n,cacheName:this._cacheName,id:this._getId(t)},e.next=4,this._db.put(z,r);case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getTimestamp",value:function(){var e=O(L.a.mark((function e(t){var n;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._db.get(z,this._getId(t));case 2:return n=e.sent,e.abrupt("return",n.timestamp);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"expireEntries",value:function(){var e=O(L.a.mark((function e(t,n){var r,a,i,u,o,s=this;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._db.transaction(z,"readwrite",(function(e,r){var a=e.objectStore(z).index("timestamp").openCursor(null,"prev"),i=[],c=0;a.onsuccess=function(){var e=a.result;if(e){var u=e.value;u.cacheName===s._cacheName&&(t&&u.timestamp=n?i.push(e.value):c++),e.continue()}else r(i)}}));case 2:r=e.sent,a=[],i=c(r),e.prev=5,i.s();case 7:if((u=i.n()).done){e.next=14;break}return o=u.value,e.next=11,this._db.delete(z,o.id);case 11:a.push(o.url);case 12:e.next=7;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),i.e(e.t0);case 19:return e.prev=19,i.f(),e.finish(19);case 22:return e.abrupt("return",a);case 23:case"end":return e.stop()}}),e,this,[[5,16,19,22]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"_getId",value:function(e){return this._cacheName+"|"+X(e)}}]),e}(),ee=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=n.maxEntries,this._maxAgeSeconds=n.maxAgeSeconds,this._cacheName=t,this._timestampModel=new Z(t)}return F(e,[{key:"expireEntries",value:function(){var e=O(L.a.mark((function e(){var t,n,r,a,i,u;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isRunning){e.next=3;break}return this._rerunRequested=!0,e.abrupt("return");case 3:return this._isRunning=!0,t=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,e.next=7,this._timestampModel.expireEntries(t,this._maxEntries);case 7:return n=e.sent,e.next=10,self.caches.open(this._cacheName);case 10:r=e.sent,a=c(n),e.prev=12,a.s();case 14:if((i=a.n()).done){e.next=20;break}return u=i.value,e.next=18,r.delete(u);case 18:e.next=14;break;case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(12),a.e(e.t0);case 25:return e.prev=25,a.f(),e.finish(25);case 28:0,this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,I(this.expireEntries()));case 31:case"end":return e.stop()}}),e,this,[[12,22,25,28]])})));return function(){return e.apply(this,arguments)}}()},{key:"updateTimestamp",value:function(){var e=O(L.a.mark((function e(t){return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,this._timestampModel.setTimestamp(t,Date.now());case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"isURLExpired",value:function(){var e=O(L.a.mark((function e(t){var n,r;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._maxAgeSeconds){e.next=6;break}e.next=3;break;case 3:return e.abrupt("return",!1);case 6:return e.next=8,this._timestampModel.getTimestamp(t);case 8:return n=e.sent,r=Date.now()-1e3*this._maxAgeSeconds,e.abrupt("return",n0&&void 0!==arguments[0]?arguments[0]:{};u(this,e),this.cachedResponseWillBeUsed=function(){var e=O(L.a.mark((function e(n){var r,a,i,c,u,o,s;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.event,a=n.request,i=n.cacheName,c=n.cachedResponse){e.next=3;break}return e.abrupt("return",null);case 3:if(u=t._isResponseDateFresh(c),I((o=t._getCacheExpiration(i)).expireEntries()),s=o.updateTimestamp(a.url),r)try{r.waitUntil(s)}catch(f){0}return e.abrupt("return",u?c:null);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.cacheDidUpdate=function(){var e=O(L.a.mark((function e(n){var r,a,i;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.cacheName,a=n.request,i=t._getCacheExpiration(r),e.next=5,i.updateTimestamp(a.url);case 5:return e.next=7,i.expireEntries();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this._config=n,this._maxAgeSeconds=n.maxAgeSeconds,this._cacheExpirations=new Map,n.purgeOnQuotaError&&w((function(){return t.deleteCacheAndMetadata()}))}return F(e,[{key:"_getCacheExpiration",value:function(e){if(e===R())throw new g("expire-custom-caches-only");var t=this._cacheExpirations.get(e);return t||(t=new ee(e,this._config),this._cacheExpirations.set(e,t)),t}},{key:"_isResponseDateFresh",value:function(e){if(!this._maxAgeSeconds)return!0;var t=this._getDateHeaderTimestamp(e);return null===t||t>=Date.now()-1e3*this._maxAgeSeconds}},{key:"_getDateHeaderTimestamp",value:function(e){if(!e.headers.has("date"))return null;var t=e.headers.get("date"),n=new Date(t).getTime();return isNaN(n)?null:n}},{key:"deleteCacheAndMetadata",value:function(){var e=O(L.a.mark((function e(){var t,n,r,a,i;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=c(this._cacheExpirations),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}return r=D(n.value,2),a=r[0],i=r[1],e.next=7,self.caches.delete(a);case 7:return e.next=9,i.delete();case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:this._cacheExpirations=new Map;case 20:case"end":return e.stop()}}),e,this,[[1,13,16,19]])})));return function(){return e.apply(this,arguments)}}()}]),e}(),ne=(n(2),[]),re=function(){return ne};function ae(e){if(!e)throw new g("add-to-cache-list-unexpected-type",{entry:e});if("string"===typeof e){var t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}var n=e.revision,r=e.url;if(!r)throw new g("add-to-cache-list-unexpected-type",{entry:e});if(!n){var a=new URL(r,location.href);return{cacheKey:a.href,url:a.href}}var i=new URL(r,location.href),c=new URL(r,location.href);return i.searchParams.set("__WB_REVISION__",n),{cacheKey:i.href,url:c.href}}var ie,ce=function(){function e(t){u(this,e),this._cacheName=_(t),this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map}return F(e,[{key:"addToCacheList",value:function(e){var t,n=[],r=c(e);try{for(r.s();!(t=r.n()).done;){var a=t.value;"string"===typeof a?n.push(a):a&&void 0===a.revision&&n.push(a.url);var i=ae(a),u=i.cacheKey,o=i.url,s="string"!==typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(o)&&this._urlsToCacheKeys.get(o)!==u)throw new g("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(o),secondEntry:u});if("string"!==typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(u)&&this._cacheKeysToIntegrities.get(u)!==a.integrity)throw new g("add-to-cache-list-conflicting-integrities",{url:o});this._cacheKeysToIntegrities.set(u,a.integrity)}if(this._urlsToCacheKeys.set(o,u),this._urlsToCacheModes.set(o,s),n.length>0){var f="Workbox is precaching URLs without revision "+"info: ".concat(n.join(", "),"\nThis is generally NOT safe. ")+"Learn more at https://bit.ly/wb-precache";console.warn(f)}}}catch(h){r.e(h)}finally{r.f()}}},{key:"install",value:function(){var e=O(L.a.mark((function e(){var t,n,r,a,i,u,o,s,f,h,l,p,v,d,y,m=this,g=arguments;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=g.length>0&&void 0!==g[0]?g[0]:{},n=t.event,r=t.plugins,a=[],i=[],e.next=6,self.caches.open(this._cacheName);case 6:return u=e.sent,e.next=9,u.keys();case 9:o=e.sent,s=new Set(o.map((function(e){return e.url}))),f=c(this._urlsToCacheKeys);try{for(f.s();!(h=f.n()).done;)l=D(h.value,2),p=l[0],v=l[1],s.has(v)?i.push(p):a.push({cacheKey:v,url:p})}catch(x){f.e(x)}finally{f.f()}return d=a.map((function(e){var t=e.cacheKey,a=e.url,i=m._cacheKeysToIntegrities.get(t),c=m._urlsToCacheModes.get(a);return m._addURLToCache({cacheKey:t,cacheMode:c,event:n,integrity:i,plugins:r,url:a})})),e.next=16,Promise.all(d);case 16:return y=a.map((function(e){return e.url})),e.abrupt("return",{updatedURLs:y,notUpdatedURLs:i});case 19:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"activate",value:function(){var e=O(L.a.mark((function e(){var t,n,r,a,i,u,o;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,self.caches.open(this._cacheName);case 2:return t=e.sent,e.next=5,t.keys();case 5:n=e.sent,r=new Set(this._urlsToCacheKeys.values()),a=[],i=c(n),e.prev=9,i.s();case 11:if((u=i.n()).done){e.next=19;break}if(o=u.value,r.has(o.url)){e.next=17;break}return e.next=16,t.delete(o);case 16:a.push(o.url);case 17:e.next=11;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(9),i.e(e.t0);case 24:return e.prev=24,i.f(),e.finish(24);case 27:return e.abrupt("return",{deletedURLs:a});case 29:case"end":return e.stop()}}),e,this,[[9,21,24,27]])})));return function(){return e.apply(this,arguments)}}()},{key:"_addURLToCache",value:function(){var e=O(L.a.mark((function e(t){var n,r,a,i,u,o,s,f,h,l,p,v;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.cacheKey,r=t.url,a=t.cacheMode,i=t.event,u=t.plugins,o=t.integrity,s=new Request(r,{integrity:o,cache:a,credentials:"same-origin"}),e.next=4,$.fetch({event:i,plugins:u,request:s});case 4:f=e.sent,l=c(u||[]);try{for(l.s();!(p=l.n()).done;)"cacheWillUpdate"in(v=p.value)&&(h=v)}catch(d){l.e(d)}finally{l.f()}if(!h){e.next=13;break}return e.next=10,h.cacheWillUpdate({event:i,request:s,response:f});case 10:e.t0=e.sent,e.next=14;break;case 13:e.t0=f.status<400;case 14:if(e.t0){e.next=17;break}throw new g("bad-precaching-response",{url:r,status:f.status});case 17:if(!f.redirected){e.next=21;break}return e.next=20,J(f);case 20:f=e.sent;case 21:return e.next=23,K.put({event:i,plugins:u,response:f,request:n===r?s:new Request(n),cacheName:this._cacheName,matchOptions:{ignoreSearch:!0}});case 23:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getURLsToCacheKeys",value:function(){return this._urlsToCacheKeys}},{key:"getCachedURLs",value:function(){return i(this._urlsToCacheKeys.keys())}},{key:"getCacheKeyForURL",value:function(e){var t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}},{key:"matchPrecache",value:function(){var e=O(L.a.mark((function e(t){var n,r,a;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t instanceof Request?t.url:t,!(r=this.getCacheKeyForURL(n))){e.next=7;break}return e.next=5,self.caches.open(this._cacheName);case 5:return a=e.sent,e.abrupt("return",a.match(r));case 7:return e.abrupt("return",void 0);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"createHandler",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return function(){var n=O(L.a.mark((function n(r){var a,i;return L.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=r.request,n.prev=1,n.next=4,e.matchPrecache(a);case 4:if(!(i=n.sent)){n.next=7;break}return n.abrupt("return",i);case 7:throw new g("missing-precache-entry",{cacheName:e._cacheName,url:a instanceof Request?a.url:a});case 10:if(n.prev=10,n.t0=n.catch(1),!t){n.next=15;break}return n.abrupt("return",fetch(a));case 15:throw n.t0;case 16:case"end":return n.stop()}}),n,null,[[1,10]])})));return function(e){return n.apply(this,arguments)}}()}},{key:"createHandlerBoundToURL",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getCacheKeyForURL(e);if(!n)throw new g("non-precached-url",{url:e});var r=this.createHandler(t),a=new Request(e);return function(){return r({request:a})}}}]),e}(),ue=function(){return ie||(ie=new ce),ie};function oe(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=function(){var n=a[r];t.some((function(e){return e.test(n)}))&&e.searchParams.delete(n)},r=0,a=i(e.searchParams.keys());r1&&void 0!==d[1]?d[1]:{},n=t.ignoreURLParametersMatching,r=t.directoryIndex,a=t.cleanURLs,i=t.urlManipulation,(u=new URL(e,location.href)).hash="",y.next=5,u.href;case 5:return o=oe(u,n),y.next=8,o.href;case 8:if(!r||!o.pathname.endsWith("/")){y.next=13;break}return(s=new URL(o.href)).pathname+=r,y.next=13,s.href;case 13:if(!a){y.next=18;break}return(f=new URL(o.href)).pathname+=".html",y.next=18,f.href;case 18:if(!i){y.next=37;break}h=i({url:u}),l=c(h),y.prev=21,l.s();case 23:if((p=l.n()).done){y.next=29;break}return v=p.value,y.next=27,v.href;case 27:y.next=23;break;case 29:y.next=34;break;case 31:y.prev=31,y.t0=y.catch(21),l.e(y.t0);case 34:return y.prev=34,l.f(),y.finish(34);case 37:case"end":return y.stop()}}),se,null,[[21,31,34,37]])}var he=function(e,t){var n,r=ue().getURLsToCacheKeys(),a=c(fe(e,t));try{for(a.s();!(n=a.n()).done;){var i=n.value,u=r.get(i);if(u)return u}}catch(o){a.e(o)}finally{a.f()}},le=!1;function pe(e){le||(!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignoreURLParametersMatching,n=void 0===t?[/^utm_/]:t,r=e.directoryIndex,a=void 0===r?"index.html":r,i=e.cleanURLs,c=void 0===i||i,u=e.urlManipulation,o=_();self.addEventListener("fetch",(function(e){var t=he(e.request.url,{cleanURLs:c,directoryIndex:a,ignoreURLParametersMatching:n,urlManipulation:u});if(t){var r=self.caches.open(o).then((function(e){return e.match(t)})).then((function(e){return e||fetch(t)}));e.respondWith(r)}}))}(e),le=!0)}var ve=function(e){var t=ue(),n=re();e.waitUntil(t.install({event:e,plugins:n}).catch((function(e){throw e})))},de=function(e){var t=ue();e.waitUntil(t.activate())};n(3);var ye,me=function(e){return e&&"object"===typeof e?e:{handle:e}},ge=function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"GET";u(this,e),this.handler=me(n),this.match=t,this.method=r},xe=function(e){s(n,e);var t=v(n);function n(e,r,a){u(this,n);return t.call(this,(function(t){var n=t.url,r=e.exec(n.href);if(r&&(n.origin===location.origin||0===r.index))return r.slice(1)}),r,a)}return n}(ge),we=function(){function e(){u(this,e),this._routes=new Map}return F(e,[{key:"routes",get:function(){return this._routes}},{key:"addFetchListener",value:function(){var e=this;self.addEventListener("fetch",(function(t){var n=t.request,r=e.handleRequest({request:n,event:t});r&&t.respondWith(r)}))}},{key:"addCacheListener",value:function(){var e=this;self.addEventListener("message",(function(t){if(t.data&&"CACHE_URLS"===t.data.type){var n=t.data.payload;0;var r=Promise.all(n.urlsToCache.map((function(t){"string"===typeof t&&(t=[t]);var n=d(Request,i(t));return e.handleRequest({request:n})})));t.waitUntil(r),t.ports&&t.ports[0]&&r.then((function(){return t.ports[0].postMessage(!0)}))}}))}},{key:"handleRequest",value:function(e){var t=this,n=e.request,r=e.event;var a=new URL(n.url,location.href);if(a.protocol.startsWith("http")){var i=this.findMatchingRoute({url:a,request:n,event:r}),c=i.params,u=i.route,o=u&&u.handler;if(!o&&this._defaultHandler&&(o=this._defaultHandler),o){var s;0;try{s=o.handle({url:a,request:n,event:r,params:c})}catch(f){s=Promise.reject(f)}return s instanceof Promise&&this._catchHandler&&(s=s.catch((function(e){return t._catchHandler.handle({url:a,request:n,event:r})}))),s}}}},{key:"findMatchingRoute",value:function(e){var t=e.url,n=e.request,r=e.event;var a,i=c(this._routes.get(n.method)||[]);try{for(i.s();!(a=i.n()).done;){var u=a.value,o=void 0,s=u.match({url:t,request:n,event:r});if(s)return o=s,(Array.isArray(s)&&0===s.length||s.constructor===Object&&0===Object.keys(s).length||"boolean"===typeof s)&&(o=void 0),{route:u,params:o}}}catch(f){i.e(f)}finally{i.f()}return{}}},{key:"setDefaultHandler",value:function(e){this._defaultHandler=me(e)}},{key:"setCatchHandler",value:function(e){this._catchHandler=me(e)}},{key:"registerRoute",value:function(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}},{key:"unregisterRoute",value:function(e){if(!this._routes.has(e.method))throw new g("unregister-route-but-not-found-with-method",{method:e.method});var t=this._routes.get(e.method).indexOf(e);if(!(t>-1))throw new g("unregister-route-route-not-registered");this._routes.get(e.method).splice(t,1)}}]),e}(),be=function(){return ye||((ye=new we).addFetchListener(),ye.addCacheListener()),ye};function ke(e,t,n){var r;if("string"===typeof e){var a=new URL(e,location.href);r=new ge((function(e){return e.url.href===a.href}),t,n)}else if(e instanceof RegExp)r=new xe(e,t,n);else if("function"===typeof e)r=new ge(e,t,n);else{if(!(e instanceof ge))throw new g("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});r=e}return be().registerRoute(r),r}n(4);var _e,Re={cacheWillUpdate:function(){var e=O(L.a.mark((function e(t){var n;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(200!==(n=t.response).status&&0!==n.status){e.next=3;break}return e.abrupt("return",n);case 3:return e.abrupt("return",null);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},Ee=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(u(this,e),this._cacheName=R(t.cacheName),this._plugins=t.plugins||[],t.plugins){var n=t.plugins.some((function(e){return!!e.cacheWillUpdate}));this._plugins=n?t.plugins:[Re].concat(i(t.plugins))}else this._plugins=[Re];this._fetchOptions=t.fetchOptions,this._matchOptions=t.matchOptions}return F(e,[{key:"handle",value:function(){var e=O(L.a.mark((function e(t){var n,r,a,i,c;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.event,r=t.request,[],"string"===typeof r&&(r=new Request(r)),a=this._getFromNetwork({request:r,event:n}),e.next=7,K.match({cacheName:this._cacheName,request:r,event:n,matchOptions:this._matchOptions,plugins:this._plugins});case 7:if(!(i=e.sent)){e.next=13;break}if(n)try{n.waitUntil(a)}catch(c){0}e.next=23;break;case 13:return e.prev=14,e.next=17,a;case 17:i=e.sent,e.next=23;break;case 20:e.prev=20,e.t0=e.catch(14),c=e.t0;case 23:if(i){e.next=26;break}throw new g("no-response",{url:r.url,error:c});case 26:return e.abrupt("return",i);case 27:case"end":return e.stop()}}),e,this,[[14,20]])})));return function(t){return e.apply(this,arguments)}}()},{key:"_getFromNetwork",value:function(){var e=O(L.a.mark((function e(t){var n,r,a,i;return L.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.request,r=t.event,e.next=3,$.fetch({request:n,event:r,fetchOptions:this._fetchOptions,plugins:this._plugins});case 3:if(a=e.sent,i=K.put({cacheName:this._cacheName,request:n,response:a.clone(),event:r,plugins:this._plugins}),r)try{r.waitUntil(i)}catch(c){0}return e.abrupt("return",a);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();self.addEventListener("activate",(function(){return self.clients.claim()})),function(e){ue().addToCacheList(e),e.length>0&&(self.addEventListener("install",ve),self.addEventListener("activate",de))}([{'revision':'f2bc80641a435cffa6993c4cb020d6a1','url':'/IHearU-client/index.html'},{'revision':null,'url':'/IHearU-client/static/css/main.608d16a4.chunk.css'},{'revision':null,'url':'/IHearU-client/static/js/2.92baf28a.chunk.js'},{'revision':null,'url':'/IHearU-client/static/js/3.3b501cb0.chunk.js'},{'revision':null,'url':'/IHearU-client/static/js/main.6da336cb.chunk.js'},{'revision':null,'url':'/IHearU-client/static/js/runtime-main.fac7497a.js'}]),pe(_e);var Le,qe=new RegExp("/[^/?]+\\.[^/]+$");ke((function(e){var t=e.request,n=e.url;return"navigate"===t.mode&&(!n.pathname.startsWith("/_")&&!n.pathname.match(qe))}),(Le="/IHearU-client/index.html",ue().createHandlerBoundToURL(Le))),ke((function(e){var t=e.url;return t.origin===self.location.origin&&t.pathname.endsWith(".png")}),new Ee({cacheName:"images",plugins:[new te({maxEntries:50})]})),self.addEventListener("message",(function(e){e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}))}]); //# sourceMappingURL=service-worker.js.map \ No newline at end of file diff --git a/static/js/main.6da336cb.chunk.js b/static/js/main.6da336cb.chunk.js new file mode 100644 index 0000000..fb440ce --- /dev/null +++ b/static/js/main.6da336cb.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonpihearu-client"]=this["webpackJsonpihearu-client"]||[]).push([[0],{434:function(e,n,t){},441:function(e,n,t){},506:function(e,n){},507:function(e,n){},515:function(e,n){},525:function(e,n){},526:function(e,n){},527:function(e,n){},535:function(e,n){},624:function(e,n,t){"use strict";t.r(n);var a=t(17),r=t.n(a),c=t(75),o=t.n(c),i=(t(434),t(4)),s=t.n(i),l=t(11),u=t(5),d=t(132),h=(t(441),t(388)),f=t.n(h),p=t(422),j=t.n(p),b=t(423),g=t.n(b),m=t(187),v=t.n(m),O=t(249),x=t.n(O),w=t(424),k=t.n(w),y=t(396),S=t.n(y),C=t(389),A=t.n(C),H=t(395),W=t.n(H),N=t(391),T=t.n(N),U=t(392),I=t.n(U),L=t(390),P=t.n(L),F=t(394),E=t.n(F),R=t(260),B=t.n(R),D=t(294),z=t.n(D),J=t(195),M={settings:{threshold:85,showStats:!1,speakAlong:!0},sentence:{predictions:[],words:[],log:[]}},V=Object(J.b)({name:"settings",initialState:M.settings,reducers:{setThreshold:function(e,n){e.threshold=n.payload},setShowStats:function(e,n){e.showStats=n.payload},setSpeakAlong:function(e,n){e.speakAlong=n.payload}}}),$=Object(J.b)({name:"sentence",initialState:M.sentence,reducers:{addPrediction:function(e,n){e.predictions.push(n.payload)},addWord:function(e,n){e.predictions=[],e.words.push(n.payload)},logWords:function(e){e.log.unshift(e.words),e.words=[]}}}),q=(V.reducer,Object(J.a)({reducer:{settings:V.reducer,sentence:$.reducer}})),G=q.getState,K=q.dispatch,Q=t(393),X=t.n(Q),Y=t(39);function Z(e){return"".concat(e,"%")}function _(e){var n=e.open,t=e.handleClose,a=Object(d.c)((function(e){return e.settings})),r=Object(d.b)();return Object(Y.jsx)("div",{children:Object(Y.jsxs)(A.a,{fullWidth:!0,maxWidth:"sm",open:n,onClose:t,"aria-labelledby":"settings-dialog-title",children:[Object(Y.jsx)(P.a,{id:"settings-dialog-title",children:"Settings"}),Object(Y.jsx)(T.a,{children:Object(Y.jsx)(I.a,{children:Object(Y.jsxs)(X.a,{children:[Object(Y.jsx)(B.a,{control:Object(Y.jsx)(E.a,{value:a.threshold,getAriaValueText:Z,"aria-labelledby":"threshold-slider",valueLabelDisplay:"auto",step:5,marks:!0,min:50,max:99,onChange:function(e,n){return r(V.actions.setThreshold(n))}}),label:"Accuracy threshold",labelPlacement:"top"}),Object(Y.jsx)(B.a,{control:Object(Y.jsx)(z.a,{checked:a.showStats,onChange:function(e){return r(V.actions.setShowStats(e.target.checked))},name:"showStats",color:"primary"}),label:"Show Stats"}),Object(Y.jsx)(B.a,{control:Object(Y.jsx)(z.a,{checked:a.speakAlong,onChange:function(e){return r(V.actions.setSpeakAlong(e.target.checked))},name:"showStats",color:"primary"}),label:"Speak along signing"})]})})}),Object(Y.jsx)(W.a,{children:Object(Y.jsx)(S.a,{autoFocus:!0,onClick:t,color:"primary",children:"Close"})})]})})}var ee,ne=t(20),te=t(420),ae=t(419),re=t(296),ce=[],oe=[],ie=[],se=[],le=[],ue=new Array(63).fill(0),de=function(e){return e.reduce((function(e,n){return e.concat([n.x,n.y,n.z])}),[])};function he(){return fe.apply(this,arguments)}function fe(){return(fe=Object(l.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"/IHearU-client/model/model.json",e.next=3,re.a("/IHearU-client/model/model.json");case 3:ee=e.sent;case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pe(){return je.apply(this,arguments)}function je(){return(je=Object(l.a)(s.a.mark((function e(){var n,t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/IHearU-client/model.csv");case 2:return n=e.sent,e.next=5,n.text();case 5:t=e.sent,ce=t.split(",");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(e){return ge.apply(this,arguments)}function ge(){return(ge=Object(l.a)(s.a.mark((function e(n){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new ae.Hands({locateFile:function(e){return"/IHearU-client/hands/".concat(e)}})).setOptions({maxNumHands:2,minDetectionConfidence:.5,minTrackingConfidence:.5}),t.onResults(me),e.next=5,t.initialize();case 5:n&&new te.Camera(n,{onFrame:function(){var e=Object(l.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.send({image:n});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}).start();case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function me(e){if(function(e){if(e.multiHandLandmarks&&e.multiHandedness){for(var n=ue,t=ue,a=0;a=G().settings.threshold/100?(console.log(ce[r],a),ce[r]):null}(ie),t=n!==le[le.length-1],a=se.length>4&&n===(r=se).sort((function(e,n){return r.filter((function(n){return n===e})).length-r.filter((function(e){return e===n})).length})).pop();if(n&&(se.push(n),K($.actions.addPrediction(n))),n&&t&&a)if(le.push(n),se=[],K($.actions.addWord(n)),G().settings.speakAlong)try{new Audio("audio/".concat(n,".mp3")).play()}catch(c){}ie=[]}var r}function ve(){K($.actions.logWords()),le=[]}function Oe(e){return e.reduce((function(e,n){return n in e?e[n]++:e[n]=1,e}),{})}var xe=t(425),we=t.n(xe),ke=t(426),ye=t.n(ke),Se=t(259),Ce=t(421),Ae=t.n(Ce),He=Object(Se.createTheme)({palette:{primary:{light:"#ffce42",main:"#ffbd00",dark:"#bd8c00",contrastText:"#fff"}}});var We=function(){var e=Object(a.useRef)(null),n=r.a.useState(!1),t=Object(u.a)(n,2),c=t[0],o=t[1],i=r.a.useState(!0),h=Object(u.a)(i,2),p=h[0],b=h[1],m=Object(d.c)((function(e){return e.settings})),O=Object(d.c)((function(e){return e.sentence}));return Object(a.useEffect)((function(){(function(){var n=Object(l.a)(s.a.mark((function n(){var t,a;return s.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,pe();case 2:return n.next=4,he();case 4:if(!(null===(t=e.current)||void 0===t?void 0:t.video)){n.next=7;break}return n.next=7,be(null===(a=e.current)||void 0===a?void 0:a.video);case 7:b(!1);case 8:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}})()()}),[]),Object(Y.jsxs)(Se.ThemeProvider,{theme:He,children:[Object(Y.jsx)(j.a,{position:"static",children:Object(Y.jsxs)(g.a,{className:"appbar-toolbar",children:[Object(Y.jsxs)("div",{className:"appbar-toolbar--title",children:[Object(Y.jsx)("img",{src:"/favicon.ico",alt:"logo"}),Object(Y.jsx)(v.a,{variant:"h6",children:"IHearU"})]}),Object(Y.jsx)(x.a,{edge:"end","aria-label":"settings","aria-haspopup":"true",color:"inherit",onClick:function(){o(!0)},children:Object(Y.jsx)(k.a,{})})]})}),Object(Y.jsxs)("div",{className:"App-body",children:[!p&&m.showStats&&Object(Y.jsx)("div",{className:"stats",children:Object(Y.jsx)("div",{children:Object.keys(Oe(O.predictions)).map((function(e){return Object(Y.jsxs)("span",{children:[e,": ",Oe(O.predictions)[e]," "]},e)}))})}),Object(Y.jsx)(f.a,{ref:e,style:{display:p?"none":"block"}}),Object(Y.jsx)(_,{open:c,handleClose:function(){o(!1)}}),p&&Object(Y.jsxs)("div",{className:"loading-scrim",children:[Object(Y.jsx)("img",{src:"/logo192.png",alt:"IHearU Logo",className:"App-logo"}),Object(Y.jsx)("h3",{children:"Loading detection models"}),Object(Y.jsx)(we.a,{})]}),!p&&Object(Y.jsxs)("div",{className:"word-container",children:[Object(Y.jsxs)("div",{className:"typewriter-container",children:[Object(Y.jsx)(Ae.a,{typing:1,children:O.words.join(" ")}),Object(Y.jsx)(x.a,{edge:"end","aria-label":"settings","aria-haspopup":"true",color:"primary",onClick:ve,disabled:0===O.words.length,children:Object(Y.jsx)(ye.a,{})})]}),Object(Y.jsx)("div",{className:"word-log",children:O.log.map((function(e,n){return Object(Y.jsxs)("p",{children:[e.join(" ")," "]},"".concat(e,"-").concat(n))}))})]})]})]})},Ne=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function Te(e,n){navigator.serviceWorker.register(e).then((function(e){e.onupdatefound=function(){var t=e.installing;null!=t&&(t.onstatechange=function(){"installed"===t.state&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."),n&&n.onUpdate&&n.onUpdate(e)):(console.log("Content is cached for offline use."),n&&n.onSuccess&&n.onSuccess(e)))})}})).catch((function(e){console.error("Error during service worker registration:",e)}))}var Ue=function(e){e&&e instanceof Function&&t.e(3).then(t.bind(null,626)).then((function(n){var t=n.getCLS,a=n.getFID,r=n.getFCP,c=n.getLCP,o=n.getTTFB;t(e),a(e),r(e),c(e),o(e)}))};o.a.render(Object(Y.jsx)(d.a,{store:q,children:Object(Y.jsx)(We,{})}),document.getElementById("root")),function(e){if("serviceWorker"in navigator){if(new URL("/IHearU-client",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",(function(){var n="".concat("/IHearU-client","/service-worker.js");Ne?(!function(e,n){fetch(e,{headers:{"Service-Worker":"script"}}).then((function(t){var a=t.headers.get("content-type");404===t.status||null!=a&&-1===a.indexOf("javascript")?navigator.serviceWorker.ready.then((function(e){e.unregister().then((function(){window.location.reload()}))})):Te(e,n)})).catch((function(){console.log("No internet connection found. App is running in offline mode.")}))}(n,e),navigator.serviceWorker.ready.then((function(){console.log("This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA")}))):Te(n,e)}))}}(),Ue()}},[[624,1,2]]]); +//# sourceMappingURL=main.6da336cb.chunk.js.map \ No newline at end of file diff --git a/static/js/main.6da336cb.chunk.js.map b/static/js/main.6da336cb.chunk.js.map new file mode 100644 index 0000000..0e4e93c --- /dev/null +++ b/static/js/main.6da336cb.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["store.tsx","Settings.tsx","util.ts","App.tsx","serviceWorkerRegistration.ts","reportWebVitals.ts","index.tsx"],"names":["initialState","settings","threshold","showStats","speakAlong","sentence","predictions","words","log","settingsSlice","createSlice","name","reducers","setThreshold","state","action","payload","setShowStats","setSpeakAlong","sentenceSlice","addPrediction","push","addWord","logWords","unshift","store","configureStore","reducer","getState","dispatch","valuetext","value","SettingsDialog","props","open","handleClose","useSelector","useDispatch","fullWidth","maxWidth","onClose","id","control","getAriaValueText","valueLabelDisplay","step","marks","min","max","onChange","event","actions","label","labelPlacement","checked","target","color","autoFocus","onClick","model","keypoints","sequence","zeros","Array","fill","extractKeypoints","landmarks","reduce","accumulator","currentValue","concat","x","y","z","loadModel","a","tf","loadActions","fetch","response","text","data","split","loadVideoFeed","el","hands","Hands","locateFile","file","setOptions","maxNumHands","minDetectionConfidence","minTrackingConfidence","onResults","initialize","Camera","onFrame","send","image","start","results","multiHandLandmarks","multiHandedness","lh","rh","index","length","isRightHand","extractSequence","prediction","tensor","res","predict","dataSync","Math","argmax","indexOf","console","makePrediction","isNew","isStable","arr","sort","b","filter","v","pop","Audio","play","error","getCounts","counts","word","theme","createTheme","palette","primary","light","main","dark","contrastText","App","webcamRef","useRef","React","useState","settingsOpen","setSettingsOpen","loading","setLoading","useEffect","current","video","init","position","className","src","alt","variant","edge","Object","keys","map","ref","style","display","typing","join","disabled","i","isLocalhost","Boolean","window","location","hostname","match","registerValidSW","swUrl","config","navigator","serviceWorker","register","then","registration","onupdatefound","installingWorker","installing","onstatechange","controller","onUpdate","onSuccess","catch","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","document","getElementById","URL","process","href","origin","addEventListener","headers","contentType","get","status","ready","unregister","reload","checkValidServiceWorker","serviceWorkerRegistration"],"mappings":"4qBAUMA,EAAkH,CACtHC,SAAU,CACRC,UAAW,GACXC,WAAW,EACXC,YAAY,GAEdC,SAAU,CAACC,YAAa,GAAIC,MAAM,GAAIC,IAAK,KAIhCC,EAAgBC,YAAY,CACvCC,KAAM,WACNX,aAAcA,EAAaC,SAC3BW,SAAU,CACVC,aAAc,SAACC,EAAOC,GACpBD,EAAMZ,UAAYa,EAAOC,SAE3BC,aAAc,SAACH,EAAOC,GACpBD,EAAMX,UAAYY,EAAOC,SAE3BE,cAAe,SAACJ,EAAOC,GACrBD,EAAMV,WAAaW,EAAOC,YAKjBG,EAAgBT,YAAY,CACvCC,KAAM,WACNX,aAAaA,EAAaK,SAC1BO,SAAU,CACRQ,cAAe,SAACN,EAAOC,GACrBD,EAAMR,YAAYe,KAAKN,EAAOC,UAEhCM,QAAS,SAACR,EAAOC,GACfD,EAAMR,YAAc,GACpBQ,EAAMP,MAAMc,KAAKN,EAAOC,UAE1BO,SAAU,SAACT,GACTA,EAAMN,IAAIgB,Q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A8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCCdO,IAASC,OACP,cAAC,IAAD,CAAUhL,MAAOA,EAAjB,SACE,cAAC,GAAD,MAEFiL,SAASC,eAAe,SFWnB,SAAkBzB,GACvB,GAA6C,kBAAmBC,UAAW,CAGzE,GADkB,IAAIyB,IAAIC,iBAAwBjC,OAAOC,SAASiC,MACpDC,SAAWnC,OAAOC,SAASkC,OAIvC,OAGFnC,OAAOoC,iBAAiB,QAAQ,WAC9B,IAAM/B,EAAK,UAAM4B,iBAAN,sBAEPnC,KAgEV,SAAiCO,EAAeC,GAE9CpG,MAAMmG,EAAO,CACXgC,QAAS,CAAE,iBAAkB,YAE5B3B,MAAK,SAACvG,GAEL,IAAMmI,EAAcnI,EAASkI,QAAQE,IAAI,gBAEnB,MAApBpI,EAASqI,QACO,MAAfF,IAA8D,IAAvCA,EAAY9F,QAAQ,cAG5C+D,UAAUC,cAAciC,MAAM/B,MAAK,SAACC,GAClCA,EAAa+B,aAAahC,MAAK,WAC7BV,OAAOC,SAAS0C,eAKpBvC,GAAgBC,EAAOC,MAG1Ba,OAAM,WACL1E,QAAQ7G,IAAI,oEAtFVgN,CAAwBvC,EAAOC,GAI/BC,UAAUC,cAAciC,MAAM/B,MAAK,WACjCjE,QAAQ7G,IACN,+GAMJwK,GAAgBC,EAAOC,OEjC/BuC,GAKAzB,O","file":"static/js/main.6da336cb.chunk.js","sourcesContent":["import { configureStore } from '@reduxjs/toolkit'\n\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit'\n\ninterface SettingsState {\n threshold: number,\n showStats: boolean,\n speakAlong: boolean\n}\n\nconst initialState: { settings: SettingsState, sentence: { predictions: string[], words: string[], log: string[][]} } = {\n settings: {\n threshold: 85,\n showStats: false,\n speakAlong: true,\n },\n sentence: {predictions: [], words:[], log: []},\n \n}\n\nexport const settingsSlice = createSlice({\n name: 'settings',\n initialState: initialState.settings,\n reducers: {\n setThreshold: (state, action: PayloadAction) => {\n state.threshold = action.payload\n },\n setShowStats: (state, action: PayloadAction) => {\n state.showStats = action.payload\n },\n setSpeakAlong: (state, action: PayloadAction) => {\n state.speakAlong = action.payload\n },\n },\n})\n\nexport const sentenceSlice = createSlice({\n name: 'sentence',\n initialState:initialState.sentence,\n reducers: {\n addPrediction: (state, action: PayloadAction) => {\n state.predictions.push(action.payload);\n },\n addWord: (state, action: PayloadAction) => {\n state.predictions = [];\n state.words.push(action.payload);\n },\n logWords: (state) => {\n state.log.unshift(state.words);\n state.words = [];\n },\n },\n})\n\n\nexport default settingsSlice.reducer\nexport const store = configureStore({\n reducer: { settings: settingsSlice.reducer, sentence: sentenceSlice.reducer },\n})\n\n// Infer the `RootState` and `AppDispatch` types from the store itself\nexport type RootState = ReturnType\n// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}\nexport type AppDispatch = typeof store.dispatch\n\nexport const getState = store.getState;\nexport const dispatch = store.dispatch;","import React from 'react';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Slider from '@material-ui/core/Slider';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Switch from '@material-ui/core/Switch';\nimport { useSelector, useDispatch } from 'react-redux'\nimport { RootState, AppDispatch, settingsSlice } from './store';\nimport FormGroup from '@material-ui/core/FormGroup';\n\nfunction valuetext(value: number) {\n return `${value}%`;\n}\n\nexport default function SettingsDialog(props: { open: boolean, handleClose: () => void }) {\n const { open, handleClose } = props;\n const settings = useSelector((state: RootState) => state.settings)\n const dispatch: AppDispatch = useDispatch()\n\n return (\n
\n \n \n Settings\n \n \n \n \n dispatch(settingsSlice.actions.setThreshold(value as number))}\n />\n }\n label=\"Accuracy threshold\"\n labelPlacement=\"top\"\n />\n\n dispatch(settingsSlice.actions.setShowStats(event.target.checked))}\n name=\"showStats\"\n color=\"primary\"\n />\n }\n label=\"Show Stats\"\n />\n\n dispatch(settingsSlice.actions.setSpeakAlong(event.target.checked))}\n name=\"showStats\"\n color=\"primary\"\n />\n }\n label=\"Speak along signing\"\n />\n \n \n \n \n \n \n \n
\n );\n}","import { Camera } from \"@mediapipe/camera_utils\";\nimport { Hands, NormalizedLandmarkList, Results } from \"@mediapipe/hands\";\nimport * as tf from '@tensorflow/tfjs'\nimport { dispatch, getState, sentenceSlice } from \"./store\";\n\nvar model: tf.LayersModel;\n\nvar actions: string[] = [];\n// var franco: {[key:string]: string};\n\nvar keypoints = [];\nvar sequence: number[][] = [];\n\nvar predictions: string[] = [];\nvar words: string[] = [];\n\nconst zeros = new Array(63).fill(0);\nexport const extractKeypoints = (landmarks: NormalizedLandmarkList) => {\n return landmarks.reduce(\n function (accumulator, currentValue) {\n return accumulator.concat([currentValue.x, currentValue.y, currentValue.z])\n },\n [] as number[]\n )\n}\nexport function mode(arr: any[]) {\n return arr.sort((a, b) =>\n arr.filter(v => v === a).length\n - arr.filter(v => v === b).length\n ).pop();\n}\n\nfunction extractSequence(results: Results) {\n\n if (results.multiHandLandmarks && results.multiHandedness) {\n var lh = zeros;\n var rh = zeros;\n\n for (let index = 0; index < results.multiHandLandmarks.length; index++) {\n const classification = results.multiHandedness[index];\n const isRightHand = classification.label === 'Right';\n const landmarks = results.multiHandLandmarks[index];\n\n if (isRightHand) {\n rh = extractKeypoints(landmarks)\n }\n else {\n lh = extractKeypoints(landmarks)\n }\n }\n\n keypoints = [...lh, ...rh]\n sequence.push(keypoints)\n }\n\n}\n\nexport async function loadModel() {\n const modelURL = '/IHearU-client/model/model.json';\n model = await tf.loadLayersModel(modelURL);\n}\n\nexport async function loadActions() {\n const response = await fetch(\"/IHearU-client/model.csv\");\n const data = await response.text();\n actions = data.split(\",\");\n // await loadFranco();\n}\n\n// async function loadFranco() {\n// const response = await fetch(\"/franco.json\");\n// franco = await response.json();\n// }\n\nexport async function loadVideoFeed(el: HTMLVideoElement) {\n const hands = new Hands({\n locateFile: (file) => {\n return `/IHearU-client/hands/${file}`;\n }\n });\n hands.setOptions({\n maxNumHands: 2,\n minDetectionConfidence: 0.5,\n minTrackingConfidence: 0.5\n });\n hands.onResults(onResults);\n await hands.initialize()\n if (el) {\n new Camera(el, {\n onFrame: async () => {\n await hands.send({ image: el });\n },\n }).start()\n }\n\n}\nconst makePrediction = (sequence: number[][]) => {\n let tensor: tf.Tensor3D = tf.tensor([sequence]);\n let outputTensor = model.predict(tensor)\n let res = (outputTensor as tf.Tensor3D).dataSync()\n let max = Math.max(...res)\n let argmax = [...res].indexOf(max);\n\n const threshold = getState().settings.threshold / 100\n if (max >= threshold) {\n console.log(actions[argmax], max);\n return actions[argmax]\n }\n return null;\n\n}\n\nfunction onResults(results: Results) {\n extractSequence(results)\n if (sequence.length === 2) {\n const prediction = makePrediction(sequence);\n const isNew = prediction !== words[words.length - 1];\n const isStable = predictions.length > 4 && prediction === mode(predictions);\n\n if (prediction) {\n predictions.push(prediction);\n dispatch(sentenceSlice.actions.addPrediction(prediction))\n }\n\n if (prediction && isNew && isStable) {\n words.push(prediction);\n predictions = [];\n dispatch(sentenceSlice.actions.addWord(prediction));\n const speakAlong = getState().settings.speakAlong;\n if (speakAlong) try {\n // speechSynthesis.speak(new SpeechSynthesisUtterance(franco[prediction]));\n new Audio(`audio/${prediction}.mp3`).play();\n } catch (error) { } \n }\n sequence = []\n }\n\n}\n\nexport function logWords() {\n // const sentenceWords = getState().sentence.words;\n // const francoWords = sentenceWords.map(word => franco[word])\n // speechSynthesis.speak(new SpeechSynthesisUtterance(francoWords.join(\" \")));\n dispatch(sentenceSlice.actions.logWords());\n words = []\n}\n\nexport function getCounts(arr: string[]) {\n let countedWords = arr.reduce(function (counts, word) {\n if (word in counts) {\n counts[word]++\n }\n else {\n counts[word] = 1\n }\n return counts\n }, {} as { [key: string]: number })\n return countedWords;\n}\n\n","import React, { useEffect, useRef } from 'react';\nimport { useSelector } from 'react-redux'\nimport './App.css';\nimport Webcam from 'react-webcam';\nimport AppBar from '@material-ui/core/AppBar';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Typography from '@material-ui/core/Typography';\nimport IconButton from '@material-ui/core/IconButton';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport SettingsDialog from './Settings';\nimport { RootState } from './store';\nimport { getCounts, loadActions, loadModel, loadVideoFeed, logWords } from './util';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport RecordVoiceOverIcon from '@material-ui/icons/RecordVoiceOver';\nimport { ThemeProvider } from '@material-ui/core/styles';\nimport { createTheme } from '@material-ui/core/styles';\nimport TypeWriter from 'react-typewriter';\n\nconst theme = createTheme({\n palette: {\n primary: {\n light: '#ffce42',\n main: '#ffbd00',\n dark: '#bd8c00',\n contrastText: '#fff',\n },\n },\n});\n\nfunction App() {\n const webcamRef: React.Ref = useRef(null);\n const [settingsOpen, setSettingsOpen] = React.useState(false);\n const [loading, setLoading] = React.useState(true);\n const settings = useSelector((state: RootState) => state.settings)\n const sentence = useSelector((state: RootState) => state.sentence)\n\n const handleClickOpenSettings = () => {\n setSettingsOpen(true);\n };\n\n const handleCloseSettings = () => {\n setSettingsOpen(false);\n };\n\n useEffect(() => {\n const init = async () => {\n await loadActions()\n await loadModel();\n if (webcamRef.current?.video) await loadVideoFeed(webcamRef.current?.video)\n setLoading(false)\n }\n init()\n }, []);\n\n\n return (\n \n \n \n
\n \"logo\"\n IHearU\n
\n \n \n \n
\n
\n
\n {(!loading && settings.showStats) &&
\n {/*
Threshold: {settings.threshold}%
*/}\n
\n {Object.keys(getCounts(sentence.predictions)).map(word =>\n {word}: {getCounts(sentence.predictions)[word]} )}\n
\n
}\n \n \n {loading &&
\n \"IHearU\n

Loading detection models

\n
\n }\n {!loading &&
\n
\n {sentence.words.join(\" \")}\n \n \n \n
\n\n
\n {sentence.log.map((sentence, i) =>\n

{sentence.join(\" \")}

\n )}\n
\n
}\n
\n
\n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://cra.link/PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://cra.link/PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://cra.link/PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log('No internet connection found. App is running in offline mode.');\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then((registration) => {\n registration.unregister();\n })\n .catch((error) => {\n console.error(error.message);\n });\n }\n}\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorkerRegistration from './serviceWorkerRegistration';\nimport reportWebVitals from './reportWebVitals';\n\nimport { store } from './store'\nimport { Provider } from 'react-redux'\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://cra.link/PWA\nserviceWorkerRegistration.register();\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/main.7762834b.chunk.js b/static/js/main.7762834b.chunk.js deleted file mode 100644 index 929bb61..0000000 --- a/static/js/main.7762834b.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonpihearu-client"]=this["webpackJsonpihearu-client"]||[]).push([[0],{434:function(e,n,t){},441:function(e,n,t){},506:function(e,n){},507:function(e,n){},515:function(e,n){},525:function(e,n){},526:function(e,n){},527:function(e,n){},535:function(e,n){},624:function(e,n,t){"use strict";t.r(n);var a=t(17),r=t.n(a),c=t(75),o=t.n(c),i=(t(434),t(4)),s=t.n(i),l=t(11),u=t(5),d=t(132),h=(t(441),t(388)),f=t.n(h),p=t(422),j=t.n(p),b=t(423),g=t.n(b),m=t(187),v=t.n(m),O=t(249),x=t.n(O),w=t(424),k=t.n(w),y=t(396),S=t.n(y),C=t(389),A=t.n(C),W=t(395),N=t.n(W),H=t(391),T=t.n(H),L=t(392),P=t.n(L),F=t(390),U=t.n(F),I=t(394),E=t.n(I),R=t(260),B=t.n(R),D=t(294),z=t.n(D),J=t(195),M={settings:{threshold:85,showStats:!1,speakAlong:!0},sentence:{predictions:[],words:[],log:[]}},V=Object(J.b)({name:"settings",initialState:M.settings,reducers:{setThreshold:function(e,n){e.threshold=n.payload},setShowStats:function(e,n){e.showStats=n.payload},setSpeakAlong:function(e,n){e.speakAlong=n.payload}}}),$=Object(J.b)({name:"sentence",initialState:M.sentence,reducers:{addPrediction:function(e,n){e.predictions.push(n.payload)},addWord:function(e,n){e.predictions=[],e.words.push(n.payload)},logWords:function(e){e.log.unshift(e.words),e.words=[]}}}),q=(V.reducer,Object(J.a)({reducer:{settings:V.reducer,sentence:$.reducer}})),G=q.getState,K=q.dispatch,Q=t(393),X=t.n(Q),Y=t(39);function Z(e){return"".concat(e,"%")}function _(e){var n=e.open,t=e.handleClose,a=Object(d.c)((function(e){return e.settings})),r=Object(d.b)();return Object(Y.jsx)("div",{children:Object(Y.jsxs)(A.a,{fullWidth:!0,maxWidth:"sm",open:n,onClose:t,"aria-labelledby":"settings-dialog-title",children:[Object(Y.jsx)(U.a,{id:"settings-dialog-title",children:"Settings"}),Object(Y.jsx)(T.a,{children:Object(Y.jsx)(P.a,{children:Object(Y.jsxs)(X.a,{children:[Object(Y.jsx)(B.a,{control:Object(Y.jsx)(E.a,{value:a.threshold,getAriaValueText:Z,"aria-labelledby":"threshold-slider",valueLabelDisplay:"auto",step:5,marks:!0,min:50,max:99,onChange:function(e,n){return r(V.actions.setThreshold(n))}}),label:"Accuracy threshold",labelPlacement:"top"}),Object(Y.jsx)(B.a,{control:Object(Y.jsx)(z.a,{checked:a.showStats,onChange:function(e){return r(V.actions.setShowStats(e.target.checked))},name:"showStats",color:"primary"}),label:"Show Stats"}),Object(Y.jsx)(B.a,{control:Object(Y.jsx)(z.a,{checked:a.speakAlong,onChange:function(e){return r(V.actions.setSpeakAlong(e.target.checked))},name:"showStats",color:"primary"}),label:"Speak along signing"})]})})}),Object(Y.jsx)(N.a,{children:Object(Y.jsx)(S.a,{autoFocus:!0,onClick:t,color:"primary",children:"Close"})})]})})}var ee,ne=t(20),te=t(420),ae=t(419),re=t(296),ce=[],oe=[],ie=[],se=[],le=[],ue=new Array(63).fill(0),de=function(e){return e.reduce((function(e,n){return e.concat([n.x,n.y,n.z])}),[])};function he(){return fe.apply(this,arguments)}function fe(){return(fe=Object(l.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"model/model.json",e.next=3,re.a("model/model.json");case 3:ee=e.sent;case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pe(){return je.apply(this,arguments)}function je(){return(je=Object(l.a)(s.a.mark((function e(){var n,t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/model.csv");case 2:return n=e.sent,e.next=5,n.text();case 5:t=e.sent,ce=t.split(",");case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function be(e){return ge.apply(this,arguments)}function ge(){return(ge=Object(l.a)(s.a.mark((function e(n){var t;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(t=new ae.Hands({locateFile:function(e){return"/hands/".concat(e)}})).setOptions({maxNumHands:2,minDetectionConfidence:.5,minTrackingConfidence:.5}),t.onResults(me),e.next=5,t.initialize();case 5:n&&new te.Camera(n,{onFrame:function(){var e=Object(l.a)(s.a.mark((function e(){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.send({image:n});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}).start();case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function me(e){if(function(e){if(e.multiHandLandmarks&&e.multiHandedness){for(var n=ue,t=ue,a=0;a=G().settings.threshold/100?(console.log(ce[r],a),ce[r]):null}(ie),t=n!==le[le.length-1],a=se.length>4&&n===(r=se).sort((function(e,n){return r.filter((function(n){return n===e})).length-r.filter((function(e){return e===n})).length})).pop();if(n&&(se.push(n),K($.actions.addPrediction(n))),n&&t&&a)if(le.push(n),se=[],K($.actions.addWord(n)),G().settings.speakAlong)try{new Audio("/audio/".concat(n,".mp3")).play()}catch(c){}ie=[]}var r}function ve(){K($.actions.logWords()),le=[]}function Oe(e){return e.reduce((function(e,n){return n in e?e[n]++:e[n]=1,e}),{})}var xe=t(425),we=t.n(xe),ke=t(426),ye=t.n(ke),Se=t(259),Ce=t(421),Ae=t.n(Ce),We=Object(Se.createTheme)({palette:{primary:{light:"#ffce42",main:"#ffbd00",dark:"#bd8c00",contrastText:"#fff"}}});var Ne=function(){var e=Object(a.useRef)(null),n=r.a.useState(!1),t=Object(u.a)(n,2),c=t[0],o=t[1],i=r.a.useState(!0),h=Object(u.a)(i,2),p=h[0],b=h[1],m=Object(d.c)((function(e){return e.settings})),O=Object(d.c)((function(e){return e.sentence}));return Object(a.useEffect)((function(){(function(){var n=Object(l.a)(s.a.mark((function n(){var t,a;return s.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,pe();case 2:return n.next=4,he();case 4:if(!(null===(t=e.current)||void 0===t?void 0:t.video)){n.next=7;break}return n.next=7,be(null===(a=e.current)||void 0===a?void 0:a.video);case 7:b(!1);case 8:case"end":return n.stop()}}),n)})));return function(){return n.apply(this,arguments)}})()()}),[]),Object(Y.jsxs)(Se.ThemeProvider,{theme:We,children:[Object(Y.jsx)(j.a,{position:"static",children:Object(Y.jsxs)(g.a,{className:"appbar-toolbar",children:[Object(Y.jsxs)("div",{className:"appbar-toolbar--title",children:[Object(Y.jsx)("img",{src:"/favicon.ico",alt:"logo"}),Object(Y.jsx)(v.a,{variant:"h6",children:"IHearU"})]}),Object(Y.jsx)(x.a,{edge:"end","aria-label":"settings","aria-haspopup":"true",color:"inherit",onClick:function(){o(!0)},children:Object(Y.jsx)(k.a,{})})]})}),Object(Y.jsxs)("div",{className:"App-body",children:[!p&&m.showStats&&Object(Y.jsx)("div",{className:"stats",children:Object(Y.jsx)("div",{children:Object.keys(Oe(O.predictions)).map((function(e){return Object(Y.jsxs)("span",{children:[e,": ",Oe(O.predictions)[e]," "]},e)}))})}),Object(Y.jsx)(f.a,{ref:e,style:{display:p?"none":"block"}}),Object(Y.jsx)(_,{open:c,handleClose:function(){o(!1)}}),p&&Object(Y.jsxs)("div",{className:"loading-scrim",children:[Object(Y.jsx)("img",{src:"/logo192.png",alt:"IHearU Logo",className:"App-logo"}),Object(Y.jsx)("h3",{children:"Loading detection models"}),Object(Y.jsx)(we.a,{})]}),!p&&Object(Y.jsxs)("div",{className:"word-container",children:[Object(Y.jsxs)("div",{className:"typewriter-container",children:[Object(Y.jsx)(Ae.a,{typing:1,children:O.words.join(" ")}),Object(Y.jsx)(x.a,{edge:"end","aria-label":"settings","aria-haspopup":"true",color:"primary",onClick:ve,disabled:0===O.words.length,children:Object(Y.jsx)(ye.a,{})})]}),Object(Y.jsx)("div",{className:"word-log",children:O.log.map((function(e,n){return Object(Y.jsxs)("p",{children:[e.join(" ")," "]},"".concat(e,"-").concat(n))}))})]})]})]})},He=Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function Te(e,n){navigator.serviceWorker.register(e).then((function(e){e.onupdatefound=function(){var t=e.installing;null!=t&&(t.onstatechange=function(){"installed"===t.state&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."),n&&n.onUpdate&&n.onUpdate(e)):(console.log("Content is cached for offline use."),n&&n.onSuccess&&n.onSuccess(e)))})}})).catch((function(e){console.error("Error during service worker registration:",e)}))}var Le=function(e){e&&e instanceof Function&&t.e(3).then(t.bind(null,626)).then((function(n){var t=n.getCLS,a=n.getFID,r=n.getFCP,c=n.getLCP,o=n.getTTFB;t(e),a(e),r(e),c(e),o(e)}))};o.a.render(Object(Y.jsx)(d.a,{store:q,children:Object(Y.jsx)(Ne,{})}),document.getElementById("root")),function(e){if("serviceWorker"in navigator){if(new URL("/IHearU-client",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",(function(){var n="".concat("/IHearU-client","/service-worker.js");He?(!function(e,n){fetch(e,{headers:{"Service-Worker":"script"}}).then((function(t){var a=t.headers.get("content-type");404===t.status||null!=a&&-1===a.indexOf("javascript")?navigator.serviceWorker.ready.then((function(e){e.unregister().then((function(){window.location.reload()}))})):Te(e,n)})).catch((function(){console.log("No internet connection found. App is running in offline mode.")}))}(n,e),navigator.serviceWorker.ready.then((function(){console.log("This web app is being served cache-first by a service worker. To learn more, visit https://cra.link/PWA")}))):Te(n,e)}))}}(),Le()}},[[624,1,2]]]); -//# sourceMappingURL=main.7762834b.chunk.js.map \ No newline at end of file diff --git a/static/js/main.7762834b.chunk.js.map b/static/js/main.7762834b.chunk.js.map deleted file mode 100644 index 5e75938..0000000 --- a/static/js/main.7762834b.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["store.tsx","Settings.tsx","util.ts","App.tsx","serviceWorkerRegistration.ts","reportWebVitals.ts","index.tsx"],"names":["initialState","settings","threshold","showStats","speakAlong","sentence","predictions","words","log","settingsSlice","createSlice","name","reducers","setThreshold","state","action","payload","setShowStats","setSpeakAlong","sentenceSlice","addPrediction","push","addWord","logWords","unshift","store","configureStore","reducer","getState","dispatch","valuetext","value","SettingsDialog","props","open","handleClose","useSelector","useDispatch","fullWidth","maxWidth","onClose","id","control","getAriaValueText","valueLabelDisplay","step","marks","min","max","onChange","event","actions","label","labelPlacement","checked","target","color","autoFocus","onClick","model","keypoints","sequence","zeros","Array","fill","extractKeypoints","landmarks","reduce","accumulator","currentValue","concat","x","y","z","loadModel","a","tf","loadActions","fetch","response","text","data","split","loadVideoFeed","el","hands","Hands","locateFile","file","setOptions","maxNumHands","minDetectionConfidence","minTrackingConfidence","onResults","initialize","Camera","onFrame","send","image","start","results","multiHandLandmarks","multiHandedness","lh","rh","index","length","isRightHand","extractSequence","prediction","tensor","res","predict","dataSync","Math","argmax","indexOf","console","makePrediction","isNew","isStable","arr","sort","b","filter","v","pop","Audio","play","error","getCounts","counts","word","theme","createTheme","palette","primary","light","main","dark","contrastText","App","webcamRef","useRef","React","useState","settingsOpen","setSettingsOpen","loading","setLoading","useEffect","current","video","init","position","className","src","alt","variant","edge","Object","keys","map","ref","style","display","typing","join","disabled","i","isLocalhost","Boolean","window","location","hostname","match","registerValidSW","swUrl","config","navigator","serviceWorker","register","then","registration","onupdatefound","installingWorker","installing","onstatechange","controller","onUpdate","onSuccess","catch","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","document","getElementById","URL","process","href","origin","addEventListener","headers","contentType","get","status","ready","unregister","reload","checkValidServiceWorker","serviceWorkerRegistration"],"mappings":"4qBAUMA,EAAkH,CACtHC,SAAU,CACRC,UAAW,GACXC,WAAW,EACXC,YAAY,GAEdC,SAAU,CAACC,YAAa,GAAIC,MAAM,GAAIC,IAAK,KAIhCC,EAAgBC,YAAY,CACvCC,KAAM,WACNX,aAAcA,EAAaC,SAC3BW,SAAU,CACVC,aAAc,SAACC,EAAOC,GACpBD,EAAMZ,UAAYa,EAAOC,SAE3BC,aAAc,SAACH,EAAOC,GACpBD,EAAMX,UAAYY,EAAOC,SAE3BE,cAAe,SAACJ,EAAOC,GACrBD,EAAMV,WAAaW,EAAOC,YAKjBG,EAAgBT,YAAY,CACvCC,KAAM,WACNX,aAAaA,EAAaK,SAC1BO,SAAU,CACRQ,cAAe,SAACN,EAAOC,GACrBD,EAAMR,YAAYe,KAAKN,EAAOC,UAEhCM,QAAS,SAACR,EAAOC,GACfD,EAAMR,YAAc,GACpBQ,EAAMP,MAAMc,KAAKN,EAAOC,UAE1BO,SAAU,SAACT,GACTA,EAAMN,IAAIgB,QAAQV,EAAMP,OACxBO,EAAMP,MAAQ,OAOPkB,GADEhB,EAAf,QACqBiB,YAAe,CAClCC,QAAS,CAAE1B,SAAUQ,EAAckB,QAAStB,SAAUc,EAAcQ,YAQzDC,EAAWH,EAAMG,SACjBC,EAAWJ,EAAMI,S,0BCpD9B,SAASC,EAAUC,GACf,MAAM,GAAN,OAAUA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,cAAC,GAAD,MAEFiL,SAASC,eAAe,SFWnB,SAAkBzB,GACvB,GAA6C,kBAAmBC,UAAW,CAGzE,GADkB,IAAIyB,IAAIC,iBAAwBjC,OAAOC,SAASiC,MACpDC,SAAWnC,OAAOC,SAASkC,OAIvC,OAGFnC,OAAOoC,iBAAiB,QAAQ,WAC9B,IAAM/B,EAAK,UAAM4B,iBAAN,sBAEPnC,KAgEV,SAAiCO,EAAeC,GAE9CpG,MAAMmG,EAAO,CACXgC,QAAS,CAAE,iBAAkB,YAE5B3B,MAAK,SAACvG,GAEL,IAAMmI,EAAcnI,EAASkI,QAAQE,IAAI,gBAEnB,MAApBpI,EAASqI,QACO,MAAfF,IAA8D,IAAvCA,EAAY9F,QAAQ,cAG5C+D,UAAUC,cAAciC,MAAM/B,MAAK,SAACC,GAClCA,EAAa+B,aAAahC,MAAK,WAC7BV,OAAOC,SAAS0C,eAKpBvC,GAAgBC,EAAOC,MAG1Ba,OAAM,WACL1E,QAAQ7G,IAAI,oEAtFVgN,CAAwBvC,EAAOC,GAI/BC,UAAUC,cAAciC,MAAM/B,MAAK,WACjCjE,QAAQ7G,IACN,+GAMJwK,GAAgBC,EAAOC,OEjC/BuC,GAKAzB,O","file":"static/js/main.7762834b.chunk.js","sourcesContent":["import { configureStore } from '@reduxjs/toolkit'\n\nimport { createSlice, PayloadAction } from '@reduxjs/toolkit'\n\ninterface SettingsState {\n threshold: number,\n showStats: boolean,\n speakAlong: boolean\n}\n\nconst initialState: { settings: SettingsState, sentence: { predictions: string[], words: string[], log: string[][]} } = {\n settings: {\n threshold: 85,\n showStats: false,\n speakAlong: true,\n },\n sentence: {predictions: [], words:[], log: []},\n \n}\n\nexport const settingsSlice = createSlice({\n name: 'settings',\n initialState: initialState.settings,\n reducers: {\n setThreshold: (state, action: PayloadAction) => {\n state.threshold = action.payload\n },\n setShowStats: (state, action: PayloadAction) => {\n state.showStats = action.payload\n },\n setSpeakAlong: (state, action: PayloadAction) => {\n state.speakAlong = action.payload\n },\n },\n})\n\nexport const sentenceSlice = createSlice({\n name: 'sentence',\n initialState:initialState.sentence,\n reducers: {\n addPrediction: (state, action: PayloadAction) => {\n state.predictions.push(action.payload);\n },\n addWord: (state, action: PayloadAction) => {\n state.predictions = [];\n state.words.push(action.payload);\n },\n logWords: (state) => {\n state.log.unshift(state.words);\n state.words = [];\n },\n },\n})\n\n\nexport default settingsSlice.reducer\nexport const store = configureStore({\n reducer: { settings: settingsSlice.reducer, sentence: sentenceSlice.reducer },\n})\n\n// Infer the `RootState` and `AppDispatch` types from the store itself\nexport type RootState = ReturnType\n// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}\nexport type AppDispatch = typeof store.dispatch\n\nexport const getState = store.getState;\nexport const dispatch = store.dispatch;","import React from 'react';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Slider from '@material-ui/core/Slider';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Switch from '@material-ui/core/Switch';\nimport { useSelector, useDispatch } from 'react-redux'\nimport { RootState, AppDispatch, settingsSlice } from './store';\nimport FormGroup from '@material-ui/core/FormGroup';\n\nfunction valuetext(value: number) {\n return `${value}%`;\n}\n\nexport default function SettingsDialog(props: { open: boolean, handleClose: () => void }) {\n const { open, handleClose } = props;\n const settings = useSelector((state: RootState) => state.settings)\n const dispatch: AppDispatch = useDispatch()\n\n return (\n
\n \n \n Settings\n \n \n \n \n dispatch(settingsSlice.actions.setThreshold(value as number))}\n />\n }\n label=\"Accuracy threshold\"\n labelPlacement=\"top\"\n />\n\n dispatch(settingsSlice.actions.setShowStats(event.target.checked))}\n name=\"showStats\"\n color=\"primary\"\n />\n }\n label=\"Show Stats\"\n />\n\n dispatch(settingsSlice.actions.setSpeakAlong(event.target.checked))}\n name=\"showStats\"\n color=\"primary\"\n />\n }\n label=\"Speak along signing\"\n />\n \n \n \n \n \n \n \n
\n );\n}","import { Camera } from \"@mediapipe/camera_utils\";\nimport { Hands, NormalizedLandmarkList, Results } from \"@mediapipe/hands\";\nimport * as tf from '@tensorflow/tfjs'\nimport { dispatch, getState, sentenceSlice } from \"./store\";\n\nvar model: tf.LayersModel;\n\nvar actions: string[] = [];\n// var franco: {[key:string]: string};\n\nvar keypoints = [];\nvar sequence: number[][] = [];\n\nvar predictions: string[] = [];\nvar words: string[] = [];\n\nconst zeros = new Array(63).fill(0);\nexport const extractKeypoints = (landmarks: NormalizedLandmarkList) => {\n return landmarks.reduce(\n function (accumulator, currentValue) {\n return accumulator.concat([currentValue.x, currentValue.y, currentValue.z])\n },\n [] as number[]\n )\n}\nexport function mode(arr: any[]) {\n return arr.sort((a, b) =>\n arr.filter(v => v === a).length\n - arr.filter(v => v === b).length\n ).pop();\n}\n\nfunction extractSequence(results: Results) {\n\n if (results.multiHandLandmarks && results.multiHandedness) {\n var lh = zeros;\n var rh = zeros;\n\n for (let index = 0; index < results.multiHandLandmarks.length; index++) {\n const classification = results.multiHandedness[index];\n const isRightHand = classification.label === 'Right';\n const landmarks = results.multiHandLandmarks[index];\n\n if (isRightHand) {\n rh = extractKeypoints(landmarks)\n }\n else {\n lh = extractKeypoints(landmarks)\n }\n }\n\n keypoints = [...lh, ...rh]\n sequence.push(keypoints)\n }\n\n}\n\nexport async function loadModel() {\n const modelURL = 'model/model.json';\n model = await tf.loadLayersModel(modelURL);\n}\n\nexport async function loadActions() {\n const response = await fetch(\"/model.csv\");\n const data = await response.text();\n actions = data.split(\",\");\n // await loadFranco();\n}\n\n// async function loadFranco() {\n// const response = await fetch(\"/franco.json\");\n// franco = await response.json();\n// }\n\nexport async function loadVideoFeed(el: HTMLVideoElement) {\n const hands = new Hands({\n locateFile: (file) => {\n return `/hands/${file}`;\n }\n });\n hands.setOptions({\n maxNumHands: 2,\n minDetectionConfidence: 0.5,\n minTrackingConfidence: 0.5\n });\n hands.onResults(onResults);\n await hands.initialize()\n if (el) {\n new Camera(el, {\n onFrame: async () => {\n await hands.send({ image: el });\n },\n }).start()\n }\n\n}\nconst makePrediction = (sequence: number[][]) => {\n let tensor: tf.Tensor3D = tf.tensor([sequence]);\n let outputTensor = model.predict(tensor)\n let res = (outputTensor as tf.Tensor3D).dataSync()\n let max = Math.max(...res)\n let argmax = [...res].indexOf(max);\n\n const threshold = getState().settings.threshold / 100\n if (max >= threshold) {\n console.log(actions[argmax], max);\n return actions[argmax]\n }\n return null;\n\n}\n\nfunction onResults(results: Results) {\n extractSequence(results)\n if (sequence.length === 2) {\n const prediction = makePrediction(sequence);\n const isNew = prediction !== words[words.length - 1];\n const isStable = predictions.length > 4 && prediction === mode(predictions);\n\n if (prediction) {\n predictions.push(prediction);\n dispatch(sentenceSlice.actions.addPrediction(prediction))\n }\n\n if (prediction && isNew && isStable) {\n words.push(prediction);\n predictions = [];\n dispatch(sentenceSlice.actions.addWord(prediction));\n const speakAlong = getState().settings.speakAlong;\n if (speakAlong) try {\n // speechSynthesis.speak(new SpeechSynthesisUtterance(franco[prediction]));\n new Audio(`/audio/${prediction}.mp3`).play();\n } catch (error) { } \n }\n sequence = []\n }\n\n}\n\nexport function logWords() {\n // const sentenceWords = getState().sentence.words;\n // const francoWords = sentenceWords.map(word => franco[word])\n // speechSynthesis.speak(new SpeechSynthesisUtterance(francoWords.join(\" \")));\n dispatch(sentenceSlice.actions.logWords());\n words = []\n}\n\nexport function getCounts(arr: string[]) {\n let countedWords = arr.reduce(function (counts, word) {\n if (word in counts) {\n counts[word]++\n }\n else {\n counts[word] = 1\n }\n return counts\n }, {} as { [key: string]: number })\n return countedWords;\n}\n\n","import React, { useEffect, useRef } from 'react';\nimport { useSelector } from 'react-redux'\nimport './App.css';\nimport Webcam from 'react-webcam';\nimport AppBar from '@material-ui/core/AppBar';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport Typography from '@material-ui/core/Typography';\nimport IconButton from '@material-ui/core/IconButton';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport SettingsDialog from './Settings';\nimport { RootState } from './store';\nimport { getCounts, loadActions, loadModel, loadVideoFeed, logWords } from './util';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport RecordVoiceOverIcon from '@material-ui/icons/RecordVoiceOver';\nimport { ThemeProvider } from '@material-ui/core/styles';\nimport { createTheme } from '@material-ui/core/styles';\nimport TypeWriter from 'react-typewriter';\n\nconst theme = createTheme({\n palette: {\n primary: {\n light: '#ffce42',\n main: '#ffbd00',\n dark: '#bd8c00',\n contrastText: '#fff',\n },\n },\n});\n\nfunction App() {\n const webcamRef: React.Ref = useRef(null);\n const [settingsOpen, setSettingsOpen] = React.useState(false);\n const [loading, setLoading] = React.useState(true);\n const settings = useSelector((state: RootState) => state.settings)\n const sentence = useSelector((state: RootState) => state.sentence)\n\n const handleClickOpenSettings = () => {\n setSettingsOpen(true);\n };\n\n const handleCloseSettings = () => {\n setSettingsOpen(false);\n };\n\n useEffect(() => {\n const init = async () => {\n await loadActions()\n await loadModel();\n if (webcamRef.current?.video) await loadVideoFeed(webcamRef.current?.video)\n setLoading(false)\n }\n init()\n }, []);\n\n\n return (\n \n \n \n
\n \"logo\"\n IHearU\n
\n \n \n \n
\n
\n
\n {(!loading && settings.showStats) &&
\n {/*
Threshold: {settings.threshold}%
*/}\n
\n {Object.keys(getCounts(sentence.predictions)).map(word =>\n {word}: {getCounts(sentence.predictions)[word]} )}\n
\n
}\n \n \n {loading &&
\n \"IHearU\n

Loading detection models

\n
\n }\n {!loading &&
\n
\n {sentence.words.join(\" \")}\n \n \n \n
\n\n
\n {sentence.log.map((sentence, i) =>\n

{sentence.join(\" \")}

\n )}\n
\n
}\n
\n
\n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://cra.link/PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://cra.link/PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://cra.link/PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log('No internet connection found. App is running in offline mode.');\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then((registration) => {\n registration.unregister();\n })\n .catch((error) => {\n console.error(error.message);\n });\n }\n}\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorkerRegistration from './serviceWorkerRegistration';\nimport reportWebVitals from './reportWebVitals';\n\nimport { store } from './store'\nimport { Provider } from 'react-redux'\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://cra.link/PWA\nserviceWorkerRegistration.register();\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""} \ No newline at end of file