20 | function r(e,r,t,n){return new(t||(t=Promise))((function(o,i){function s(e){try{u(n.next(e))}catch(e){i(e)}}function a(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):function r(e){return e instanceof t?e:new t((function(r){r(e)}))}(e.value).then(s,a)}u((n=n.apply(e,r||[])).next())}))}function t(e,r){var t,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function u(i){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=r.call(e,s)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function n(e,r){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,o,i=t.call(e),s=[];try{for(;(void 0===r||r-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}function o(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(n(arguments[r]));return e}
|
35 | var u=[{replace:/\./g,with:"\\."},{replace:/\+/g,with:"\\+"},{replace:/\*/g,with:"[^/]*"}],c=o(u,[{replace:/\?/g,with:"[^/]"}]),f=o(u,[{replace:/\?/g,with:"\\?"}]);function l(e,r){void 0===r&&(r=!1);for(var t=r?f:c,n=e.split("/").reverse(),o="";n.length>0;){var i=n.pop();"**"===i?o+=n.length>0?"(?:.+\\/)?":".*":(o+=t.reduce((function(e,r){return e.replace(r.replace,r.with)}),i),n.length>0&&(o+="\\/"))}return o}var p=["/**","!/**/*.*","!/**/*__*","!/**/*__*/**"],h=function(){function e(e,r){this.fs=e,this.baseHref=r}return e.prototype.process=function(e){return r(this,void 0,void 0,(function(){var r,n;return t(this,(function(t){switch(t.label){case 0:return[4,this.processAssetGroups(e,r={})];case 1:return n=t.sent(),[2,{configVersion:1,timestamp:Date.now(),appData:e.appData,index:v(this.baseHref,e.index),assetGroups:n,dataGroups:this.processDataGroups(e),hashTable:(s=r,a={},Object.keys(s).sort().forEach((function(e){return a[e]=s[e]})),a),navigationUrls:(o=this.baseHref,i=e.navigationUrls,void 0===i&&(i=p),i.map((function(e){var r=!e.startsWith("!");return{positive:r,regex:"^"+d(e=r?e:e.substr(1),o)+"$"}})))}]}var o,i,s,a}))}))},e.prototype.processAssetGroups=function(e,n){return r(this,void 0,void 0,(function(){var o,i=this;return t(this,(function(s){return o=new Set,[2,Promise.all((e.assetGroups||[]).map((function(e){return r(i,void 0,void 0,(function(){var i,s,a,u=this;return t(this,(function(c){switch(c.label){case 0:if(e.resources.versionedFiles)throw new Error("Asset-group '"+e.name+"' in 'ngsw-config.json' uses the 'versionedFiles' option, which is no longer supported. Use 'files' instead.");return i=function f(e){var r=e.map((function(e){return e.startsWith("!")?{positive:!1,regex:new RegExp("^"+l(e.substr(1))+"$")}:{positive:!0,regex:new RegExp("^"+l(e)+"$")}}));return function(e){return function t(e,r){return r.reduce((function(r,t){return t.positive?r||t.regex.test(e):r&&!t.regex.test(e)}),!1)}(e,r)}}(e.resources.files||[]),[4,this.fs.list("/")];case 1:return s=c.sent(),(a=s.filter(i).filter((function(e){return!o.has(e)})).sort()).forEach((function(e){return o.add(e)})),[4,a.reduce((function(e,o){return r(u,void 0,void 0,(function(){var r;return t(this,(function(t){switch(t.label){case 0:return[4,e];case 1:return t.sent(),[4,this.fs.hash(o)];case 2:return r=t.sent(),n[v(this.baseHref,o)]=r,[2]}}))}))}),Promise.resolve())];case 2:return c.sent(),[2,{name:e.name,installMode:e.installMode||"prefetch",updateMode:e.updateMode||e.installMode||"prefetch",cacheQueryOptions:g(e.cacheQueryOptions),urls:a.map((function(e){return v(u.baseHref,e)})),patterns:(e.resources.urls||[]).map((function(e){return d(e,u.baseHref,!0)}))}]}}))}))})))]}))}))},e.prototype.processDataGroups=function(e){var r=this;return(e.dataGroups||[]).map((function(e){return{name:e.name,patterns:e.urls.map((function(e){return d(e,r.baseHref,!0)})),strategy:e.cacheConfig.strategy||"performance",maxSize:e.cacheConfig.maxSize,maxAge:a(e.cacheConfig.maxAge),timeoutMs:e.cacheConfig.timeout&&a(e.cacheConfig.timeout),cacheQueryOptions:g(e.cacheQueryOptions),version:void 0!==e.version?e.version:1}}))},e}();function d(e,r,t){return e.startsWith("/")||-1!==e.indexOf("://")||(e=v(r.replace(/^\.(?=\/)/,""),e)),l(e,t)}function v(e,r){return e.endsWith("/")&&r.startsWith("/")?e+r.substr(1):e.endsWith("/")||r.startsWith("/")?e+r:e+"/"+r}function g(e){return Object.assign({ignoreVary:!0},e)}
|