/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@youwol/cdn-client@2.1.3/dist/@youwol/cdn-client.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("@youwol/cdn-client_APIv2",[],t):"object"==typeof exports?exports["@youwol/cdn-client_APIv2"]=t():e["@youwol/cdn-client_APIv2"]=t()}("undefined"!=typeof self?self:this,(()=>(()=>{var e={5295:(e,t,r)=>{"use strict";const n=r(7372),s=Symbol("max"),i=Symbol("length"),o=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),p=Symbol("noDisposeOnSet"),u=Symbol("lruList"),h=Symbol("cache"),d=Symbol("updateAgeOnGet"),m=()=>1,f=(e,t,r)=>{const n=e[h].get(t);if(n){const t=n.value;if(E(e,t)){if(v(e,n),!e[a])return}else r&&(e[d]&&(n.value.now=Date.now()),e[u].unshiftNode(n));return t.value}},E=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},g=e=>{if(e[i]>e[s])for(let t=e[u].tail;e[i]>e[s]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[i]-=r.length,e[h].delete(r.key),e[u].removeNode(t)}};class y{constructor(e,t,r,n,s){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=s||0}}const w=(e,t,r,n)=>{let s=r.value;E(e,s)&&(v(e,r),e[a]||(s=void 0)),s&&t.call(n,s.value,s.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[s]=e.max||1/0;const t=e.length||m;if(this[o]="function"!=typeof t?m:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[p]=e.noDisposeOnSet||!1,this[d]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[s]=e||1/0,g(this)}get max(){return this[s]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,g(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=m),e!==this[o]&&(this[o]=e,this[i]=0,this[u].forEach((e=>{e.length=this[o](e.value,e.key),this[i]+=e.length}))),g(this)}get lengthCalculator(){return this[o]}get length(){return this[i]}get itemCount(){return this[u].length}rforEach(e,t){t=t||this;for(let r=this[u].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[u].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[u].toArray().map((e=>e.key))}values(){return this[u].toArray().map((e=>e.value))}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[u]=new n,this[i]=0}dump(){return this[u].map((e=>!E(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[u]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[o](t,e);if(this[h].has(e)){if(a>this[s])return v(this,this[h].get(e)),!1;const o=this[h].get(e).value;return this[c]&&(this[p]||this[c](e,o.value)),o.now=n,o.maxAge=r,o.value=t,this[i]+=a-o.length,o.length=a,this.get(e),g(this),!0}const d=new y(e,t,a,n,r);return d.length>this[s]?(this[c]&&this[c](e,t),!1):(this[i]+=d.length,this[u].unshift(d),this[h].set(e,this[u].head),g(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!E(this,t)}get(e){return f(this,e,!0)}peek(e){return f(this,e,!1)}pop(){const e=this[u].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],s=n.e||0;if(0===s)this.set(n.k,n.v);else{const e=s-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[h].forEach(((e,t)=>f(this,t,!1)))}}},3134:(e,t,r)=>{const n=Symbol("SemVer ANY");class s{static get ANY(){return n}constructor(e,t){if(t=i(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new p(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new p(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new u(e.value,t).test(this.value):""===e.operator?""===e.value||new u(this.value,t).test(e.semver):!((t=i(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=s;const i=r(8716),{safeRe:o,t:a}=r(9022),l=r(5452),c=r(6830),p=r(9510),u=r(7374)},7374:(e,t,r)=>{class n{constructor(e,t){if(t=i(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!E(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&m)|(this.options.loose&&f))+":"+e,r=s.get(t);if(r)return r;const n=this.options.loose,i=n?c[p.HYPHENRANGELOOSE]:c[p.HYPHENRANGE];e=e.replace(i,b(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(c[p.COMPARATORTRIM],u),a("comparator trim",e),e=e.replace(c[p.TILDETRIM],h),a("tilde trim",e),e=e.replace(c[p.CARETTRIM],d),a("caret trim",e);let l=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>T(e,this.options)));n&&(l=l.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(c[p.COMPARATORLOOSE]))))),a("range list",l);const g=new Map,v=l.map((e=>new o(e,this.options)));for(const e of v){if(E(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const w=[...g.values()];return s.set(t,w),w}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>v(r,t)&&e.set.some((e=>v(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(A(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const s=new(r(5295))({max:1e3}),i=r(8716),o=r(3134),a=r(6830),l=r(9510),{safeRe:c,t:p,comparatorTrimReplace:u,tildeTrimReplace:h,caretTrimReplace:d}=r(9022),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:f}=r(39),E=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,v=(e,t)=>{let r=!0;const n=e.slice();let s=n.pop();for(;r&&n.length;)r=n.every((e=>s.intersects(e,t))),s=n.pop();return r},y=(e,t)=>(a("comp",e,t),e=I(e,t),a("caret",e),e=$(e,t),a("tildes",e),e=R(e,t),a("xrange",e),e=N(e,t),a("stars",e),e),w=e=>!e||"x"===e.toLowerCase()||"*"===e,$=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{const r=t.loose?c[p.TILDELOOSE]:c[p.TILDE];return e.replace(r,((t,r,n,s,i)=>{let o;return a("tilde",e,t,r,n,s,i),w(r)?o="":w(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:w(s)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(a("replaceTilde pr",i),o=`>=${r}.${n}.${s}-${i} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${s} <${r}.${+n+1}.0-0`,a("tilde return",o),o}))},I=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{a("caret",e,t);const r=t.loose?c[p.CARETLOOSE]:c[p.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,s,i,o)=>{let l;return a("caret",e,t,r,s,i,o),w(r)?l="":w(s)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:w(i)?l="0"===r?`>=${r}.${s}.0${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.0${n} <${+r+1}.0.0-0`:o?(a("replaceCaret pr",o),l="0"===r?"0"===s?`>=${r}.${s}.${i}-${o} <${r}.${s}.${+i+1}-0`:`>=${r}.${s}.${i}-${o} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${i}-${o} <${+r+1}.0.0-0`):(a("no pr"),l="0"===r?"0"===s?`>=${r}.${s}.${i}${n} <${r}.${s}.${+i+1}-0`:`>=${r}.${s}.${i}${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${i} <${+r+1}.0.0-0`),a("caret return",l),l}))},R=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>L(e,t))).join(" ")),L=(e,t)=>{e=e.trim();const r=t.loose?c[p.XRANGELOOSE]:c[p.XRANGE];return e.replace(r,((r,n,s,i,o,l)=>{a("xRange",e,r,n,s,i,o,l);const c=w(s),p=c||w(i),u=p||w(o),h=u;return"="===n&&h&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(p&&(i=0),o=0,">"===n?(n=">=",p?(s=+s+1,i=0,o=0):(i=+i+1,o=0)):"<="===n&&(n="<",p?s=+s+1:i=+i+1),"<"===n&&(l="-0"),r=`${n+s}.${i}.${o}${l}`):p?r=`>=${s}.0.0${l} <${+s+1}.0.0-0`:u&&(r=`>=${s}.${i}.0${l} <${s}.${+i+1}.0-0`),a("xRange return",r),r}))},N=(e,t)=>(a("replaceStars",e,t),e.trim().replace(c[p.STAR],"")),T=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?p.GTE0PRE:p.GTE0],"")),b=e=>(t,r,n,s,i,o,a,l,c,p,u,h,d)=>`${r=w(n)?"":w(s)?`>=${n}.0.0${e?"-0":""}`:w(i)?`>=${n}.${s}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=w(c)?"":w(p)?`<${+c+1}.0.0-0`:w(u)?`<${c}.${+p+1}.0-0`:h?`<=${c}.${p}.${u}-${h}`:e?`<${c}.${p}.${+u+1}-0`:`<=${l}`}`.trim(),A=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},9510:(e,t,r)=>{const n=r(6830),{MAX_LENGTH:s,MAX_SAFE_INTEGER:i}=r(39),{safeRe:o,t:a}=r(9022),l=r(8716),{compareIdentifiers:c}=r(8822);class p{constructor(e,t){if(t=l(t),e instanceof p){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>s)throw new TypeError(`version is longer than ${s} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof p)){if("string"==typeof e&&e===this.version)return 0;e=new p(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof p||(e=new p(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof p||(e=new p(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],s=e.prerelease[t];if(n("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return c(r,s)}while(++t)}compareBuild(e){e instanceof p||(e=new p(e,this.options));let t=0;do{const r=this.build[t],s=e.build[t];if(n("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return c(r,s)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=p},6457:(e,t,r)=>{const n=r(5692);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},5452:(e,t,r)=>{const n=r(8565),s=r(3328),i=r(2260),o=r(6579),a=r(290),l=r(5891);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return s(e,r,c);case">":return i(e,r,c);case">=":return o(e,r,c);case"<":return a(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},9469:(e,t,r)=>{const n=r(9510),s=r(5692),{safeRe:i,t:o}=r(9022);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=i[o.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),i[o.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[o.COERCERTL].lastIndex=-1}else r=e.match(i[o.COERCE]);return null===r?null:s(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},1868:(e,t,r)=>{const n=r(9510);e.exports=(e,t,r)=>{const s=new n(e,r),i=new n(t,r);return s.compare(i)||s.compareBuild(i)}},5919:(e,t,r)=>{const n=r(3992);e.exports=(e,t)=>n(e,t,!0)},3992:(e,t,r)=>{const n=r(9510);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},1007:(e,t,r)=>{const n=r(5692);e.exports=(e,t)=>{const r=n(e,null,!0),s=n(t,null,!0),i=r.compare(s);if(0===i)return null;const o=i>0,a=o?r:s,l=o?s:r,c=!!a.prerelease.length;if(l.prerelease.length&&!c)return l.patch||l.minor?a.patch?"patch":a.minor?"minor":"major":"major";const p=c?"pre":"";return r.major!==s.major?p+"major":r.minor!==s.minor?p+"minor":r.patch!==s.patch?p+"patch":"prerelease"}},8565:(e,t,r)=>{const n=r(3992);e.exports=(e,t,r)=>0===n(e,t,r)},2260:(e,t,r)=>{const n=r(3992);e.exports=(e,t,r)=>n(e,t,r)>0},6579:(e,t,r)=>{const n=r(3992);e.exports=(e,t,r)=>n(e,t,r)>=0},515:(e,t,r)=>{const n=r(9510);e.exports=(e,t,r,s,i)=>{"string"==typeof r&&(i=s,s=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,s,i).version}catch(e){return null}}},290:(e,t,r)=>{const n=r(3992);e.exports=(e,t,r)=>n(e,t,r)<0},5891:(e,t,r)=>{const n=r(3992);e.exports=(e,t,r)=>n(e,t,r)<=0},2611:(e,t,r)=>{const n=r(9510);e.exports=(e,t)=>new n(e,t).major},6319:(e,t,r)=>{const n=r(9510);e.exports=(e,t)=>new n(e,t).minor},3328:(e,t,r)=>{const n=r(3992);e.exports=(e,t,r)=>0!==n(e,t,r)},5692:(e,t,r)=>{const n=r(9510);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},7368:(e,t,r)=>{const n=r(9510);e.exports=(e,t)=>new n(e,t).patch},7794:(e,t,r)=>{const n=r(5692);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},9114:(e,t,r)=>{const n=r(3992);e.exports=(e,t,r)=>n(t,e,r)},3843:(e,t,r)=>{const n=r(1868);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},9845:(e,t,r)=>{const n=r(7374);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},8753:(e,t,r)=>{const n=r(1868);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},398:(e,t,r)=>{const n=r(5692);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},8873:(e,t,r)=>{const n=r(9022),s=r(39),i=r(9510),o=r(8822),a=r(5692),l=r(398),c=r(6457),p=r(515),u=r(1007),h=r(2611),d=r(6319),m=r(7368),f=r(7794),E=r(3992),g=r(9114),v=r(5919),y=r(1868),w=r(8753),$=r(3843),x=r(2260),I=r(290),S=r(8565),R=r(3328),L=r(6579),N=r(5891),T=r(5452),b=r(9469),A=r(3134),O=r(7374),P=r(9845),C=r(8384),D=r(6369),j=r(2663),G=r(75),M=r(9178),_=r(8365),k=r(8237),F=r(9860),U=r(8258),B=r(3607),W=r(2199);e.exports={parse:a,valid:l,clean:c,inc:p,diff:u,major:h,minor:d,patch:m,prerelease:f,compare:E,rcompare:g,compareLoose:v,compareBuild:y,sort:w,rsort:$,gt:x,lt:I,eq:S,neq:R,gte:L,lte:N,cmp:T,coerce:b,Comparator:A,Range:O,satisfies:P,toComparators:C,maxSatisfying:D,minSatisfying:j,minVersion:G,validRange:M,outside:_,gtr:k,ltr:F,intersects:U,simplifyRange:B,subset:W,SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:s.SEMVER_SPEC_VERSION,RELEASE_TYPES:s.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},39:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},6830:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},8822:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),s=t.test(r);return n&&s&&(e=+e,r=+r),e===r?0:n&&!s?-1:s&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},8716:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},9022:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:i}=r(39),o=r(6830),a=(t=e.exports={}).re=[],l=t.safeRe=[],c=t.src=[],p=t.t={};let u=0;const h="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[h,s]],m=(e,t,r)=>{const n=(e=>{for(const[t,r]of d)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),s=u++;o(e,s,t),p[e]=s,c[s]=t,a[s]=new RegExp(t,r?"g":void 0),l[s]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),m("MAINVERSION",`(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})\\.(${c[p.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})\\.(${c[p.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[p.NUMERICIDENTIFIER]}|${c[p.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[p.NUMERICIDENTIFIERLOOSE]}|${c[p.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${c[p.PRERELEASEIDENTIFIER]}(?:\\.${c[p.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[p.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${h}+`),m("BUILD",`(?:\\+(${c[p.BUILDIDENTIFIER]}(?:\\.${c[p.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[p.MAINVERSION]}${c[p.PRERELEASE]}?${c[p.BUILD]}?`),m("FULL",`^${c[p.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[p.MAINVERSIONLOOSE]}${c[p.PRERELEASELOOSE]}?${c[p.BUILD]}?`),m("LOOSE",`^${c[p.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[p.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:\\.(${c[p.XRANGEIDENTIFIER]})(?:${c[p.PRERELEASE]})?${c[p.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[p.XRANGEIDENTIFIERLOOSE]})(?:${c[p.PRERELEASELOOSE]})?${c[p.BUILD]}?)?)?`),m("XRANGE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[p.GTLT]}\\s*${c[p.XRANGEPLAINLOOSE]}$`),m("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),m("COERCERTL",c[p.COERCE],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[p.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[p.LONETILDE]}${c[p.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[p.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${c[p.LONECARET]}${c[p.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[p.LONECARET]}${c[p.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[p.GTLT]}\\s*(${c[p.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[p.GTLT]}\\s*(${c[p.LOOSEPLAIN]}|${c[p.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[p.XRANGEPLAIN]})\\s+-\\s+(${c[p.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[p.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},8237:(e,t,r)=>{const n=r(8365);e.exports=(e,t,r)=>n(e,t,">",r)},8258:(e,t,r)=>{const n=r(7374);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},9860:(e,t,r)=>{const n=r(8365);e.exports=(e,t,r)=>n(e,t,"<",r)},6369:(e,t,r)=>{const n=r(9510),s=r(7374);e.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&-1!==o.compare(e)||(i=e,o=new n(i,r)))})),i}},2663:(e,t,r)=>{const n=r(9510),s=r(7374);e.exports=(e,t,r)=>{let i=null,o=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&1!==o.compare(e)||(i=e,o=new n(i,r)))})),i}},75:(e,t,r)=>{const n=r(9510),s=r(7374),i=r(2260);e.exports=(e,t)=>{e=new s(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const s=e.set[t];let o=null;s.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!i(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||r&&!i(r,o)||(r=o)}return r&&e.test(r)?r:null}},8365:(e,t,r)=>{const n=r(9510),s=r(3134),{ANY:i}=s,o=r(7374),a=r(9845),l=r(2260),c=r(290),p=r(5891),u=r(6579);e.exports=(e,t,r,h)=>{let d,m,f,E,g;switch(e=new n(e,h),t=new o(t,h),r){case">":d=l,m=p,f=c,E=">",g=">=";break;case"<":d=c,m=u,f=l,E="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let o=null,a=null;if(n.forEach((e=>{e.semver===i&&(e=new s(">=0.0.0")),o=o||e,a=a||e,d(e.semver,o.semver,h)?o=e:f(e.semver,a.semver,h)&&(a=e)})),o.operator===E||o.operator===g)return!1;if((!a.operator||a.operator===E)&&m(e,a.semver))return!1;if(a.operator===g&&f(e,a.semver))return!1}return!0}},3607:(e,t,r)=>{const n=r(9845),s=r(3992);e.exports=(e,t,r)=>{const i=[];let o=null,a=null;const l=e.sort(((e,t)=>s(e,t,r)));for(const e of l)n(e,t,r)?(a=e,o||(o=e)):(a&&i.push([o,a]),a=null,o=null);o&&i.push([o,null]);const c=[];for(const[e,t]of i)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const p=c.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return p.length<u.length?p:t}},2199:(e,t,r)=>{const n=r(7374),s=r(3134),{ANY:i}=s,o=r(9845),a=r(3992),l=[new s(">=0.0.0-0")],c=[new s(">=0.0.0")],p=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=r.includePrerelease?l:c}if(1===t.length&&t[0].semver===i){if(r.includePrerelease)return!0;t=c}const n=new Set;let s,p,d,m,f,E,g;for(const t of e)">"===t.operator||">="===t.operator?s=u(s,t,r):"<"===t.operator||"<="===t.operator?p=h(p,t,r):n.add(t.semver);if(n.size>1)return null;if(s&&p){if(d=a(s.semver,p.semver,r),d>0)return null;if(0===d&&(">="!==s.operator||"<="!==p.operator))return null}for(const e of n){if(s&&!o(e,String(s),r))return null;if(p&&!o(e,String(p),r))return null;for(const n of t)if(!o(e,String(n),r))return!1;return!0}let v=!(!p||r.includePrerelease||!p.semver.prerelease.length)&&p.semver,y=!(!s||r.includePrerelease||!s.semver.prerelease.length)&&s.semver;v&&1===v.prerelease.length&&"<"===p.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,E=E||"<"===e.operator||"<="===e.operator,s)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(m=u(s,e,r),m===e&&m!==s)return!1}else if(">="===s.operator&&!o(s.semver,String(e),r))return!1;if(p)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(f=h(p,e,r),f===e&&f!==p)return!1}else if("<="===p.operator&&!o(p.semver,String(e),r))return!1;if(!e.operator&&(p||s)&&0!==d)return!1}return!(s&&E&&!p&&0!==d||p&&g&&!s&&0!==d||y||v)},u=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let s=!1;e:for(const n of e.set){for(const e of t.set){const t=p(n,e,r);if(s=s||null!==t,t)continue e}if(s)return!1}return!0}},8384:(e,t,r)=>{const n=r(7374);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},9178:(e,t,r)=>{const n=r(7374);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},9976:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},7372:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,s=arguments.length;r<s;r++)t.push(arguments[r]);return t}function s(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function i(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function o(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,s=this.head;null!==s;)r.push(e.call(t,s.value,this)),s=s.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,s=this.tail;null!==s;)r.push(e.call(t,s.value,this)),s=s.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var s=0;null!==n;s++)r=e(r,n.value,s),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var s=this.length-1;null!==n;s--)r=e(r,n.value,s),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=0,i=this.head;null!==i&&s<e;s++)i=i.next;for(;null!==i&&s<t;s++,i=i.next)r.push(i.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var s=this.length,i=this.tail;null!==i&&s>t;s--)i=i.prev;for(;null!==i&&s>e;s--,i=i.prev)r.push(i.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;null!==i&&n<e;n++)i=i.next;var o=[];for(n=0;i&&n<t;n++)o.push(i.value),i=this.removeNode(i);for(null===i&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev),n=0;n<r.length;n++)i=s(this,i,r[n]);return o},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(9976)(n)}catch(e){}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{CdnError:()=>E,CdnLoadingGraphErrorEvent:()=>m,CdnMessageEvent:()=>o,CircularDependencies:()=>I,Client:()=>ne,DefaultLoadingScreenOptions:()=>K,DependenciesError:()=>x,FetchErrors:()=>w,InstallDoneEvent:()=>f,LoadingGraphError:()=>g,LoadingScreenView:()=>J,Monitoring:()=>V,ParseErrorEvent:()=>d,SourceLoadedEvent:()=>c,SourceLoadingEvent:()=>l,SourceParsedEvent:()=>p,SourceParsingFailed:()=>$,StartEvent:()=>a,State:()=>H,TestUtilsTypes:()=>t,Unauthorized:()=>v,UnauthorizedEvent:()=>u,UrlNotFound:()=>y,UrlNotFoundEvent:()=>h,WorkersPoolTypes:()=>e,backendConfiguration:()=>se,errorFactory:()=>S,fetchScript:()=>ee,getAssetId:()=>P,getUrlBase:()=>C,install:()=>Z,installLoadingGraph:()=>te,installTestWorkersPoolModule:()=>oe,installWorkersPoolModule:()=>ie,isCdnEvent:()=>i,monitoring:()=>re,parseResourceId:()=>A,queryLoadingGraph:()=>Q,setup:()=>X,youwolSvgLogo:()=>T});var e={};r.r(e);var t={};r.r(t);var s={};function i(e){return["CdnMessageEvent","StartEvent","SourceLoadingEvent","SourceLoadedEvent","SourceParsedEvent","InstallDoneEvent","UnauthorizedEvent","UrlNotFoundEvent","ParseErrorEvent","CdnLoadingGraphErrorEvent"].includes(e.step)}r.r(s),r.d(s,{CdnError:()=>E,CdnLoadingGraphErrorEvent:()=>m,CdnMessageEvent:()=>o,CircularDependencies:()=>I,Client:()=>ne,DefaultLoadingScreenOptions:()=>K,DependenciesError:()=>x,FetchErrors:()=>w,InstallDoneEvent:()=>f,LoadingGraphError:()=>g,LoadingScreenView:()=>J,Monitoring:()=>V,ParseErrorEvent:()=>d,SourceLoadedEvent:()=>c,SourceLoadingEvent:()=>l,SourceParsedEvent:()=>p,SourceParsingFailed:()=>$,StartEvent:()=>a,State:()=>H,TestUtilsTypes:()=>t,Unauthorized:()=>v,UnauthorizedEvent:()=>u,UrlNotFound:()=>y,UrlNotFoundEvent:()=>h,WorkersPoolTypes:()=>e,backendConfiguration:()=>se,errorFactory:()=>S,fetchScript:()=>ee,getAssetId:()=>P,getUrlBase:()=>C,install:()=>Z,installLoadingGraph:()=>te,installTestWorkersPoolModule:()=>oe,installWorkersPoolModule:()=>ie,isCdnEvent:()=>i,monitoring:()=>re,parseResourceId:()=>A,queryLoadingGraph:()=>Q,youwolSvgLogo:()=>T});class o{constructor(e,t,r="None"){this.id=e,this.text=t,this.status=r,this.step="CdnMessageEvent"}}class a{constructor(e,t,r){this.targetName=e,this.assetId=t,this.url=r,this.step="StartEvent",this.status="Pending",this.id=e,this.text=`${e}: start importing`}}class l{constructor(e,t,r,n){this.targetName=e,this.assetId=t,this.url=r,this.progress=n,this.step="SourceLoadingEvent",this.status="Pending",this.id=e,this.text=`${e}: fetching over HTTP`}}class c{constructor(e,t,r,n){this.targetName=e,this.assetId=t,this.url=r,this.progress=n,this.step="SourceLoadedEvent",this.status="Pending",this.id=e,this.text=`${e}: source fetched`}}class p{constructor(e,t,r){this.targetName=e,this.assetId=t,this.url=r,this.step="SourceParsedEvent",this.status="Succeeded",this.id=e,this.text=`${e}: module/script imported`}}class u{constructor(e,t,r){this.targetName=e,this.assetId=t,this.url=r,this.step="UnauthorizedEvent",this.status="Failed",this.id=e,this.text=`${e}: unauthorized to access the resource`}}class h{constructor(e,t,r){this.targetName=e,this.assetId=t,this.url=r,this.step="UrlNotFoundEvent",this.status="Failed",this.id=e,this.text=`${e}: resource not found at ${r}`}}class d{constructor(e,t,r){this.targetName=e,this.assetId=t,this.url=r,this.step="ParseErrorEvent",this.status="Failed",this.id=e,this.text=`${e}: parsing the module/script failed`}}class m{constructor(e){this.error=e,this.id="loading-graph",this.step="CdnLoadingGraphErrorEvent",this.text="Failed to retrieve the loading graph",this.status="Failed"}}class f{constructor(){this.id="InstallDoneEvent",this.step="InstallDoneEvent",this.text="Installation successful",this.status="Succeeded"}}class E extends Error{}class g extends E{constructor(){super("Failed to retrieve the loading graph"),this.name="LoadingGraphError"}}class v extends E{constructor(e){super(),this.detail=e}static isInstance(e){return e.exceptionType==v.exceptionType}}v.exceptionType="Unauthorized";class y extends E{constructor(e){super(),this.detail=e}static isInstance(e){return e.exceptionType==y.exceptionType}}y.exceptionType="UrlNotFound";class w extends E{constructor(e){super(),this.detail=e}static isInstance(e){return e.exceptionType==w.exceptionType}}w.exceptionType="FetchErrors";class $ extends E{constructor(e){super(),this.detail=e}static isInstance(e){return e.exceptionType==$.exceptionType}}$.exceptionType="SourceParsingFailed";class x extends g{constructor(e){super(),this.detail=e}static isInstance(e){return e.exceptionType==x.exceptionType}}x.exceptionType="DependenciesError";class I extends g{constructor(e){super(),this.detail=e}static isInstance(e){return e.exceptionType==I.exceptionType}}function S(e){return I.isInstance(e)?new I(e.detail):x.isInstance(e)?new x(e.detail):v.isInstance(e)?new v(e.detail):"UpstreamResponseException"===e.exceptionType?S(e.detail):void 0}I.exceptionType="CircularDependencies";var R=r(8873);function L(e){return"cdn-client_"+e.replace("/","-").replace(".","-").replace("@","")}function N(e){e.style.setProperty("font-size","larger"),e.style.setProperty("color","orange")}function T(){return"<svg id='logo2bis' xmlns='http://www.w3.org/2000/svg' style='transform:translate(0px,-12px);margin: auto' viewBox='0 0 109.58 121.1' width='109px' height='121px'>\n        <defs><style>.cls-1{fill:#008000;}</style></defs>\n        <title>logo_YouWol_white</title>\n        <polygon class='cls-1' points='109.58 94.68 109.58 84.14 91.39 73.64 109.58 63.14 109.58 42.06 63.95 68.41 63.94 68.41 63.94 121.1 82.2 110.56 82.2 89.41 100.52 99.99 109.58 94.76 109.58 94.68'/>\n        <polygon class='cls-1' points='54.8 52.69 9.17 26.35 27.42 15.81 45.61 26.31 45.61 5.31 54.73 0.04 54.8 0 63.86 5.23 63.86 26.39 82.18 15.81 100.43 26.35 54.8 52.7 54.8 52.69'/>\n        <polygon class='cls-1' points='0.07 94.72 9.2 99.99 27.38 89.49 27.38 110.56 45.64 121.1 45.64 68.41 45.64 68.41 0.01 42.06 0.01 63.14 18.33 73.64 0 84.22 0 94.68 0.07 94.72'/>\n        </svg>\n        "}function b(e){return e.reduce(((e,t)=>[...e,"string"==typeof t?{name:t.includes("#")?t.split("#")[0]:t,version:t.includes("#")?t.split("#")[1]:"latest"}:t]),[])}function A(e){const t=e.split("#")[0],r=e.split("#")[1].split("~")[0],n=e.split("#")[1].split("~")[1];return{name:t,version:r,path:n,assetId:P(t),url:`${C(t,r)}/${n}`}}async function O(e,t,r){if(0==e.length)return;t=t||window;const n=e.map((({name:e,assetId:n,version:s,url:i,content:o,progressEvent:a,sideEffect:l})=>{const c=_(t)?function({url:e,assetId:t,version:r,name:n,content:s,executingWindow:i}){const o=document.getElementsByTagName("head")[0];if(i.document.getElementById(e))return i.document.getElementById(e);const a=document.createElement("script");a.id=e,null!=ne.FrontendConfiguration.crossOrigin&&(a.crossOrigin=ne.FrontendConfiguration.crossOrigin);const l=[t,n,r].map((e=>L(e)));a.classList.add(...l),a.innerHTML=s;const c=e=>(i.removeEventListener("error",c),e);return i.addEventListener("error",c),o.appendChild(a),i.removeEventListener("error",c),a}({url:i,assetId:n,version:s,name:e,content:o,executingWindow:t}):function({url:e}){const t="cdnClientImportedScriptUrls",r=self[t]||[];if(!r.includes(e))try{self.customImportScripts(e),self[t]=[...r,e]}catch(t){return console.error(`Failed to import script ${e} in WebWorker`,t),t}}({url:i});if(c instanceof Error||c instanceof ErrorEvent)throw console.error(`Failed to parse source code of ${e}#${s}: ${c.message}`),r?.(new d(e,n,i)),new $({assetId:n,name:e,url:i,message:c.message});if(r?.(new p(e,n,i)),l)return l({origin:{name:e,assetId:n,version:s,url:i,content:o,progressEvent:a},htmlScriptElement:c,executingWindow:t})})).filter((e=>null!=e));await Promise.all(n)}function P(e){return window.btoa(e)}function C(e,t){const r=P(e);return`${ne.BackendConfiguration.urlResource}/${r}/${t}`}function D(e,t){const r=q.getExportedSymbol(e,t);return`${r.symbol}_APIv${r.apiKey}`}function j(e,t){return D(e,t).replace("_APIv","#")}function G(e){const t=e.module.includes("#")?e.module.split("#")[0]:e.module;return Z({modules:[e.module],aliases:{installerModule:t}}).then((({installerModule:t})=>t.install(e.installInputs)))}function M(e,t){q.installAliases(e,t)}function _(e){return null!=e.document}const k={externals:{rxjs:"^6.5.5","@youwol/flux-view":"^1.1.0"},includedInBundle:{semver:"^7.3.4"}},F={rxjs:{apiKey:"6",exportedSymbol:"rxjs"},"@youwol/flux-view":{apiKey:"1",exportedSymbol:"@youwol/flux-view"}},U={entryFile:"./index.ts",loadDependencies:[]},B={workersPool:{entryFile:"./lib/workers-pool/index.ts",loadDependencies:["rxjs","@youwol/flux-view"],name:"workersPool"},testUtils:{entryFile:"./lib/test-utils/index.ts",loadDependencies:[],name:"testUtils"}},W={"@youwol/cdn-client":"./index.ts",...Object.values(B).reduce(((e,t)=>({...e,[`@youwol/cdn-client/${t.name}`]:t.entryFile})),{})},X={name:"@youwol/cdn-client",assetId:"QHlvdXdvbC9jZG4tY2xpZW50",version:"2.1.3",shortDescription:"Library for dynamic npm's libraries installation from YouWol's CDN.",developerDocumentation:"https://platform.youwol.com/applications/@youwol/cdn-explorer/latest?package=@youwol/cdn-client&tab=doc",npmPackage:"https://www.npmjs.com/package/@youwol/cdn-client",sourceGithub:"https://github.com/youwol/cdn-client",userGuide:"",apiVersion:"2",runTimeDependencies:k,externals:{rxjs:{commonjs:"rxjs",commonjs2:"rxjs",root:"rxjs_APIv6"},"@youwol/flux-view":{commonjs:"@youwol/flux-view",commonjs2:"@youwol/flux-view",root:"@youwol/flux-view_APIv1"},"rxjs/operators":{commonjs:"rxjs/operators",commonjs2:"rxjs/operators",root:["rxjs_APIv6","operators"]}},exportedSymbols:F,entries:W,secondaryEntries:B,getDependencySymbolExported:e=>`${F[e].exportedSymbol}_APIv${F[e].apiKey}`,installMainModule:({cdnClient:e,installParameters:t})=>{const r=t||{},n=r.scripts||[],s=[...r.modules||[],...U.loadDependencies.map((e=>`${e}#${k.externals[e]}`))];return e.install({...r,modules:s,scripts:n}).then((()=>window["@youwol/cdn-client_APIv2"]))},installAuxiliaryModule:({name:e,cdnClient:t,installParameters:r})=>{const n=B[e];if(!n)throw Error(`Can not find the secondary entry '${e}'. Referenced in template.py?`);const s=r||{},i=[...s.scripts||[],`@youwol/cdn-client#2.1.3~dist/@youwol/cdn-client/${n.name}.js`],o=[...s.modules||[],...n.loadDependencies.map((e=>`${e}#${k.externals[e]}`))];return t.install({...s,modules:o,scripts:i}).then((()=>window[`@youwol/cdn-client/${n.name}_APIv2`]))},getCdnDependencies(e){if(e&&!B[e])throw Error(`Can not find the secondary entry '${e}'. Referenced in template.py?`);return(e?B[e].loadDependencies:U.loadDependencies).map((e=>`${e}#${k.externals[e]}`))}};class V{constructor(){this.exportedSymbols={...q.getExportedSymbol},this.importedBundles=[...q.importedBundles.entries()].reduce(((e,[t,r])=>({...e,[t]:r})),{}),this.latestVersion=[...q.latestVersion.entries()].reduce(((e,[t,r])=>({...e,[t]:r})),{}),this.view=q.view()}}class H{static pinDependencies(e){q.pinDependencies(e)}static registerUrlPatcher(e){q.registerUrlPatcher(e)}static clear(e){q.clear(e)}}class q{static getExportedSymbol(e,t){const r=q.exportedSymbolsDict[`${e}#${t}`];return void 0===r.aliases?{...r,aliases:[]}:r}static updateExportedSymbolsDict(e){const t=e.reduce(((e,t)=>({...e,[`${t.name}#${t.version}`]:{symbol:t.exportedSymbol,apiKey:t.apiKey,aliases:t.aliases}})),{});q.exportedSymbolsDict={...q.exportedSymbolsDict,...t}}static isCompatibleVersionInstalled(e,t){if("@youwol/cdn-client"==e){const r=function(e,t){const r=(0,R.parse)(t);return`${e}_APIv${r.major}${0==r.major?r.minor:""}${0==r.major&&0==r.minor?r.patch:""}`}(e,t),n=window[r],s=n&&(0,R.gte)(n.setup.version,t);return null!=s&&s}if(!q.importedBundles.has(e))return!1;if(q.importedBundles.get(e).includes(t))return!0;const r=q.importedBundles.get(e).filter((r=>q.getExportedSymbol(e,r).apiKey==q.getExportedSymbol(e,t).apiKey)).find((e=>(0,R.gt)(e,t)));return r&&console.log(`${e}: a greater compatible version is already installed (${r}), skip install`,{libName:e,queriedVersion:t,compatibleVersion:r,apiKey:q.getExportedSymbol(e,t).apiKey}),null!=r}static installAliases(e,t){Object.entries(e).forEach((([e,r])=>{const n="string"==typeof r?t[r]:r(t);n?(t[e]=n,n.__yw_aliases__||(n.__yw_aliases__=new Set),n.__yw_aliases__.add(e)):console.warn("can not create alias",{alias:e,original:r})}))}static resetCache(){q.importedBundles=new Map,q.importedLoadingGraphs=new Map,q.importedScripts=new Map,q.latestVersion=new Map,q.exportedSymbolsDict={}}static clear(e){e=e||window,Array.from(q.importedBundles.entries()).map((([e,t])=>t.map((t=>[e,t])))).flat().map((([t,r])=>{const n=this.getExportedSymbol(t,r).symbol,s=e[n]?.__yw_aliases__||[];return[n,D(t,r),j(t,r),...s]})).flat().forEach((t=>{e[t]&&delete e[t]})),q.resetCache()}static registerImportedModules(e,t){e.forEach((({name:e,version:t})=>{const r=q.importedBundles.has(e)?q.importedBundles.get(e):[];q.importedBundles.set(e,[...r,t])})),q.updateLatestBundleVersion(e,t)}static updateLatestBundleVersion(e,t){e.filter((({name:e,version:t})=>!(q.latestVersion.has(e)&&q.latestVersion.get(e)==t))).forEach((({name:e,version:r})=>{if(q.latestVersion.has(e)&&(0,R.lt)(r,q.latestVersion.get(e)))return;const{symbol:n,aliases:s}=q.getExportedSymbol(e,r),i=D(e,r);if(t[i]||console.error(`Problem with package "${e}" & export symbol "${i}"`,{name:e,version:r,symbol:n,exportedName:i}),q.latestVersion.has(e)){const r=q.latestVersion.get(e),{symbol:n,aliases:s}=q.getExportedSymbol(e,r);[n,...s].forEach((e=>{delete t[e]}))}[n,...s].forEach((e=>{t[e]=t[i]})),q.latestVersion.set(e,r)}))}static getPinedDependencies(){return[...q.pinedDependencies]}static pinDependencies(e){q.pinedDependencies=[...q.pinedDependencies,...e]}static getPatchedUrl({name:e,version:t,assetId:r,url:n}){return q.urlPatcher({name:e,version:t,assetId:r,url:n})}static registerUrlPatcher(e){q.urlPatcher=e}static view(){return{class:"StateView",children:[{tag:"h5",innerText:`I'm ${X.name}#${X.version}`},{tag:"h3",innerText:"Modules installed"},{class:"px-3 py-2 container",children:[new Y({importedBundles:q.importedBundles})]},{tag:"h3",innerText:"Available symbols"},{class:"px-3 py-2 container",children:[new z({exportedSymbolsDict:q.exportedSymbolsDict})]}]}}}q.exportedSymbolsDict={[`${X.name}#${X.version}`]:{symbol:X.name,apiKey:X.apiVersion,aliases:["cdnClient"]}},q.importedBundles=new Map([[X.name,[X.version]]]),q.fetchedLoadingGraph=new Map,q.importedLoadingGraphs=new Map,q.importedScripts=new Map,q.latestVersion=new Map([[X.name,X.version]]),q.pinedDependencies=[],q.urlPatcher=({url:e})=>e;class Y{constructor({importedBundles:e}){this.children=Array.from(e.entries()).map((([e,t])=>({class:"d-flex align-items-center my-1 row",children:[{class:"col-sm",style:{fontWeight:"bolder"},innerText:e},{class:"d-flex align-items-center col",children:t.map((e=>({class:"border rounded p-1 mx-2 d-flex align-items-center",children:[{class:"fas fa-tag mx-1"},{innerText:e}]})))}]})))}}class z{constructor({exportedSymbolsDict:e}){this.children=Array.from(Object.entries(e)).map((([e,t])=>{const r=`${t.symbol}_APIv${t.apiKey}`;return{class:"d-flex align-items-center my-1 row",children:[{class:"col-sm",style:{fontWeight:"bolder"},innerText:e},{class:"d-flex align-items-center col",children:[r,...window[r]?.__yw_aliases__||new Set].map((e=>({class:"border rounded p-1 mx-2 d-flex align-items-center",children:[{innerText:e}]})))}]}}))}}class K{constructor(){this.id="loading-screen",this.logo="<svg id='logo2bis' xmlns='http://www.w3.org/2000/svg' style='transform:translate(0px,-12px);margin: auto' viewBox='0 0 109.58 121.1' width='109px' height='121px'>\n        <defs><style>.cls-1{fill:#008000;}</style></defs>\n        <title>logo_YouWol_white</title>\n        <polygon class='cls-1' points='109.58 94.68 109.58 84.14 91.39 73.64 109.58 63.14 109.58 42.06 63.95 68.41 63.94 68.41 63.94 121.1 82.2 110.56 82.2 89.41 100.52 99.99 109.58 94.76 109.58 94.68'/>\n        <polygon class='cls-1' points='54.8 52.69 9.17 26.35 27.42 15.81 45.61 26.31 45.61 5.31 54.73 0.04 54.8 0 63.86 5.23 63.86 26.39 82.18 15.81 100.43 26.35 54.8 52.7 54.8 52.69'/>\n        <polygon class='cls-1' points='0.07 94.72 9.2 99.99 27.38 89.49 27.38 110.56 45.64 121.1 45.64 68.41 45.64 68.41 0.01 42.06 0.01 63.14 18.33 73.64 0 84.22 0 94.68 0.07 94.72'/>\n        </svg>\n        ",this.fadingTimeout=500,this.wrapperStyle={position:"absolute",top:"0",left:"0",width:"100vw",height:"100vh",padding:"inherit","font-weight":"bolder"}}}class J{constructor(e={}){this.options=Object.assign(J.DefaultOptions,e),this.options.container=this.options.container||document.body;const t={...this.options.wrapperStyle,...e.wrapperStyle||{}};this.wrapperDiv=document.createElement("div"),Object.entries(t).forEach((([e,t])=>{this.wrapperDiv.style.setProperty(e,t)})),this.wrapperDiv.innerHTML=`\n        <div id='${this.options.id}' style='display: flex;justify-content: space-around; background-color: darkgrey;\n        color: green; font-family: monospace;font-size:small; width:100%; height:100%; opacity:1;\n        transition: opacity 1s;'>\n            <div style='margin-top: auto;margin-bottom: auto; padding:40px;\n            background-color: black; border-radius: 25px;min-width: 50%; max-height:75%; overflow: auto;\n            display: flex;'\n            >\n                <div  style='display: flex;justify-content: space-around;' >\n                    <div id='logo' style='white-space: pre-wrap; margin-top: auto; margin-bottom: auto; /*animation: spin 3s linear infinite*/'> \n                        ${this.options.logo}\n                    </div>   \n                </div> \n                <div  style='width: 50px; '>\n    \n                </div>\n                <div  class='screen-messages-container' style='margin-top: auto;margin-bottom: auto; '>\n    \n                </div>\n            </div>\n        </div>\n        `}next(e){if(i(e)&&"CdnLoadingGraphErrorEvent"==e.step&&function(e,t){N(e),t.error instanceof x&&e.appendChild(function(e){const t=document.createElement("div"),r=e.detail.errors.map((({query:e,fromPackage:t})=>`\n        <li> <b>${e}</b>: requested by ${t.name} with version ${t.version}</li>\n        `));return t.innerHTML=`Some dependencies do not exist in the CDN\n    ${r}\n    `,t}(t.error)),t.error instanceof I&&e.appendChild(function(e){const t=document.createElement("div"),r=Object.entries(e.detail.packages).map((([e,t])=>{return`\n        <li> <b>${e}</b>: problem with following dependencies \n        <ul>\n        ${r=t.map((e=>`${e.name}#${e.version}`)),r.map((e=>`<li> ${e}</li>`))}\n        </ul>\n        </li>\n        `;var r}));return t.innerHTML=`Circular dependencies found\n    ${r}\n    `,t}(t.error))}(this.contentDiv,e),i(e)&&"CdnMessageEvent"==e.step){let t=this.wrapperDiv.querySelector(`#${L(e.id)}`);return t&&(t.textContent="> "+e.text),void(t||(t=document.createElement("div"),t.id=L(e.id),t.textContent="> "+e.text,this.contentDiv.appendChild(t)))}const t=e.id,r=L(t);let n=this.wrapperDiv.querySelector(`#${r}`);n||(n=document.createElement("div"),n.id=r,this.contentDiv.appendChild(n)),function(e,t,r){r instanceof a&&(t.style.setProperty("color","lightgray"),t.textContent=`> ${e} ... loading: 0 kB`),r instanceof l&&(t.style.setProperty("color","lightgray"),t.textContent=`> ${e} ... loading: ${r.progress.loaded/1e3} kB`),r instanceof c&&(t.style.setProperty("color","green"),t.textContent=`> ${e} ${r.progress.loaded/1e3} kB`),r instanceof u&&(N(t),t.textContent=`> ${e} : You don't have permission to access this resource.`),r instanceof d&&(N(t),t.textContent=`> ${e} : an error occurred while parsing the source`)}(t,n,e)}render(){this.options.container.appendChild(this.wrapperDiv),this.contentDiv=this.wrapperDiv.querySelector(".screen-messages-container")}done(){this.wrapperDiv.style.setProperty("transition",`opacity ${this.options.fadingTimeout}ms`),this.wrapperDiv.style.setProperty("opacity","0"),setTimeout((()=>this.wrapperDiv.remove()),this.options.fadingTimeout)}}function Z(e){return(new ne).install(e)}function Q(e){return(new ne).queryLoadingGraph(e)}function ee(e){return(new ne).fetchScript(e)}function te(e){return(new ne).installLoadingGraph(e)}function re(){return new V}J.DefaultOptions=new K;class ne{constructor(e={}){if(this.headers={},this.headers={...ne.Headers,...e.headers||{}},void 0===ne.BackendConfiguration)throw new Error("Client.BackendConfiguration not configured")}async queryLoadingGraph(e){const t=JSON.stringify(e),r=e.usingDependencies||[],n={libraries:b(e.modules),using:r.reduce(((e,t)=>({...e,[t.split("#")[0]]:t.split("#")[1]})),{})},s=async()=>{const e=await ne.state.fetchedLoadingGraph[t];if(e.lock)return e;throw S(e)};if(ne.state.fetchedLoadingGraph[t])return s();const i=new Request(ne.BackendConfiguration.urlLoadingGraph,{method:"POST",body:JSON.stringify(n),headers:{...this.headers,"content-type":"application/json"}});return ne.state.fetchedLoadingGraph[t]=fetch(i).then((e=>e.json())),s()}async fetchScript(e){let{url:t,name:r}=e;const n=e.onEvent;t.startsWith(ne.BackendConfiguration.urlResource)||(t=t.startsWith("/")?t:`/${t}`,t=`${ne.BackendConfiguration.urlResource}${t}`);const s=t.substring(ne.BackendConfiguration.urlResource.length).split("/"),i=s[1],o=s[2];if(r=r||s[s.length-1],t=ne.state.getPatchedUrl({name:r,version:o,assetId:i,url:t}),ne.state.importedScripts[t]){const{progressEvent:e}=await ne.state.importedScripts[t];return n?.(new c(r,i,t,e)),ne.state.importedScripts[t]}return _(globalThis)?(ne.state.importedScripts[t]=new Promise(((e,s)=>{const p=new XMLHttpRequest;p.addEventListener("progress",(function(e){n?.(new l(r,i,t,e))}),!1),p.addEventListener("load",(function(a){!function(e,t,r,n,{url:s,name:i,assetId:o,version:a},l){if(200==e.status){const n=e.responseText+`\n//# sourceURL=${s.split("/").slice(0,-1).join("/")}/`;l?.(new c(i,o,s,t)),r({name:i,version:a,assetId:o,url:s,content:n,progressEvent:t})}if(401==e.status||403==e.status){const e=new u(i,o,s);l?.(e),n(new v({assetId:o,name:i,url:s}))}if(404==e.status){const e=new h(i,o,s);l?.(e),n(new y({assetId:o,name:i,url:s}))}}(p,a,e,s,{url:t,name:r,assetId:i,version:o},n)}),!1),p.open("GET",t),p.responseType="text",p.send(),n?.(new a(r,i,t))})),ne.state.importedScripts[t]):Promise.resolve({name:r,version:o,assetId:i,url:t,content:void 0,progressEvent:void 0})}install(e){const t=e.css||[],r=e.executingWindow||globalThis,n=e.aliases||{},s=e.displayLoadingScreen||!1,i=e.customInstallers||[];let o;s&&(o=new J,o.render());const a=t=>{o?.next(t),e.onEvent?.(t)},l=this.installModules({modules:e.modules,modulesSideEffects:e.modulesSideEffects,usingDependencies:e.usingDependencies,aliases:n,executingWindow:r,onEvent:a}),c=_(r)?this.installStyleSheets({css:t,renderingWindow:r}):Promise.resolve(),p=l.then((()=>this.installScripts({scripts:e.scripts||[],executingWindow:r,aliases:e.aliases}))),u=i.map((e=>G(e)));return Promise.all([p,c,...u]).then((()=>(a?.(new f),o?.done(),r)))}async installLoadingGraph(e){const t=e.executingWindow||window,r=e.customInstallers||[];ne.state.updateExportedSymbolsDict(e.loadingGraph.lock);const n=r.map((e=>G(e))),s=e.loadingGraph.definition.flat().map((([t,r])=>{const n=r.split("/")[1],s=e.loadingGraph.lock.find((e=>e.id==t&&e.version==n));return{assetId:t,url:`${ne.BackendConfiguration.urlResource}/${r}`,name:s.name,version:s.version}})).filter((({name:e,version:t})=>!ne.state.isCompatibleVersionInstalled(e,t))),i=[],o=s.map((({name:t,url:r})=>this.fetchScript({name:t,url:r,onEvent:e.onEvent}).catch((e=>{i.push(e)})))),a=await Promise.all([...n,...o]);if(i.length>0)throw new w({errors:i});const l=a.slice(n.length).filter((e=>null!=e)).map((e=>e)).map((r=>{const n=Object.entries(e.modulesSideEffects||{}).filter((([e,t])=>null!=t)).filter((([e,t])=>{const n=e.includes("#")?e:`${e}#*`;return n.split("#")[0]==r.name&&(0,R.satisfies)(r.version.replace("-wip",""),n.split("#")[1])})).map((([e,t])=>t));return{...r,sideEffect:async({htmlScriptElement:s})=>{await async function(e,t,r,n,s){const i=function(e,t){const r=(o=e.name,a=e.version,`${o}_APIv${q.getExportedSymbol(o,a).apiKey}`),n=D(e.name,e.version),s=q.getExportedSymbol(e.name,e.version).symbol,i=j(e.name,e.version);var o,a;if(t[r]||t[n]||t[s])return t[r]&&(t[n]=t[r]),t[r]||(console.warn("The export symbol of the package is deprecated",{deprecatedExportedName:n,name:e.name,version:e.version}),t[s]&&!t[n]&&console.warn(`Package "${e.name}#${e.version}" export symbol "${s}" with no API version`),window[r]=t[n]||t[i]||t[s]),t[i]=t[r],t[r]?t[r]:(console.log("applyModuleSideEffects error",{exportedName:r,symbolBase:s,aliasExportedName:i}),void console.warn(`Can not find exported symbol of library ${e.name}#${e.version} in current context`,{exportedName:r,aliasExportedName:i,symbolBase:s,contextKeys:Object.keys(window)}));console.warn(`Can not find exported symbol of library ${e.name}#${e.version} in current context`,{exportedName:n,aliasExportedName:i,symbolBase:s,contextKeys:Object.keys(t)})}(e,r);if(i){if(i.__yw_set_from_version__=e.version,q.registerImportedModules([e],r),"@youwol/cdn-client"==e.name){const e=i.Client;e.FrontendConfiguration=ne.FrontendConfiguration,e.BackendConfiguration=ne.BackendConfiguration}for(const o of n){const n={module:i,origin:e,htmlScriptElement:t,executingWindow:r,onEvent:s};"AsyncFunction"!==o.constructor.name?o(n):await o(n)}}}(r,s,t,n,e.onEvent)}}}));await O(l,t,e.onEvent),e.aliases&&M(e.aliases,t)}async installModules(e){const t=[...ne.state.getPinedDependencies(),...e.usingDependencies||[]];e.modules=e.modules||[];const r=function(e){const t=e=>{const t=e.split(" as ")[0].trim();if(!t.includes("#"))return t;let r=t.split("#")[1].trim();return"x"==r||"*"==r||"latest"==r?t.split("#")[0].trim():((r.startsWith("~")||r.startsWith("^"))&&(r=r.substring(1)),`${t.split("#")[0].trim()}_APIv${function(e){const t=(0,R.parse)(e);return`${t.major}${0==t.major?t.minor:""}${0==t.major&&0==t.minor?t.patch:""}`}(r)}`)},r=e=>e.split(" as ")[1].trim();return e.filter((e=>e.includes(" as "))).reduce(((e,n)=>({...e,[r(n)]:t(n)})),{})}(e.modules),n=e.modules.map((e=>e.split(" as ")[0])),s={modules:n,usingDependencies:t},i=b(n).reduce(((e,t)=>({...e,[`${t.name}#${t.version}`]:t.sideEffects})),e.modulesSideEffects||{});try{const t=await this.queryLoadingGraph(s);return await this.installLoadingGraph({loadingGraph:t,modulesSideEffects:i,executingWindow:e.executingWindow,onEvent:e.onEvent,aliases:{...r,...e.aliases}}),t}catch(t){throw e.onEvent?.(new m(t)),t}}async installScripts(e){const t=new ne,r=e.executingWindow||window,n=e.scripts.map((e=>"string"==typeof e?{location:e,sideEffects:void 0}:e)).map((e=>({...e,...A(e.location)}))).map((({name:r,url:n,sideEffects:s})=>t.fetchScript({name:r,url:n,onEvent:e.onEvent}).then((e=>({...e,sideEffects:s}))))),s=(await Promise.all(n)).filter((e=>!(e instanceof ErrorEvent)));return await O(s,e.executingWindow,e.onEvent),e.aliases&&M(e.aliases,r),s.map((({assetId:e,url:t,name:r,content:n})=>({assetId:e,url:t,assetName:r,src:n})))}installStyleSheets(e){const t=e.css,r=e.renderingWindow||window,n=t.map((e=>(e.resource&&(e=e.resource),"string"==typeof e?{location:e}:e))).map((e=>({...e,...A(e.location)}))).map((({assetId:e,version:t,name:r,url:n,sideEffects:s})=>({assetId:e,version:t,name:r,url:n=ne.state.getPatchedUrl({name:r,version:t,assetId:e,url:n}),sideEffects:s}))).filter((({url:e})=>!(e=>Array.from(r.document.head.querySelectorAll("link")).find((t=>t.href==ne.BackendConfiguration.origin+e)))(e))).map((({assetId:e,version:t,name:n,url:s,sideEffects:i})=>new Promise((o=>{const a=r.document.createElement("link");a.id=s,null!=ne.FrontendConfiguration.crossOrigin&&(a.crossOrigin=ne.FrontendConfiguration.crossOrigin);const l=[e,n,t].map((e=>L(e)));a.classList.add(...l),a.setAttribute("type","text/css"),a.href=s,a.rel="stylesheet",r.document.getElementsByTagName("head")[0].appendChild(a),a.onload=()=>{i?.({origin:{moduleName:n,version:t,assetId:e,url:s},htmlLinkElement:a,renderingWindow:r}),o(a)}}))));return Promise.all(n)}}function se({pathLoadingGraph:e,pathResource:t,origin:r,id:n}){return"string"!=typeof r&&(r=function(e){if(void 0===e)return"";const t=e.secure??"hostname"in e,r=e.hostname??"localhost",n=e.port??("hostname"in e?"":8080);return`http${t?"s":""}://${r}${n?":":""}${n}`}(r)),{id:n,origin:r,urlLoadingGraph:`${r}${e}`,urlResource:`${r}${t}`}}async function ie(){return await X.installAuxiliaryModule({name:"workersPool",cdnClient:s,installParameters:{executingWindow:window}}).then((e=>(function(e){let t={...ne.BackendConfiguration};""==t.origin&&(t=se({pathLoadingGraph:t.urlLoadingGraph,pathResource:t.urlResource,origin:"null"!=window.location.origin?window.location.origin:window.location.ancestorOrigins[0]})),e.WorkersPool.BackendConfiguration=t,e.WorkersPool.FrontendConfiguration=ne.FrontendConfiguration}(e),e)))}async function oe({onBeforeWorkerInstall:e,onAfterWorkerInstall:t}={}){return await Promise.all([ie(),X.installAuxiliaryModule({name:"testUtils",cdnClient:s,installParameters:{executingWindow:window}})]).then((([r,n])=>(r.WorkersPool.webWorkersProxy=new n.WebWorkersJest({globalEntryPoint:r.entryPointWorker,cdnClient:s,onBeforeWorkerInstall:e,onAfterWorkerInstall:t}),r)))}if(ne.state=q,ne.FrontendConfiguration={},ne.Headers={},ne.HostName="",globalThis.document&&globalThis.document.currentScript){const e=[...document.currentScript.getAttribute("src").split("/").slice(0,-1),"cdn-client.config.json"].join("/"),t=new XMLHttpRequest;t.open("GET",e,!1),t.send(null),ne.BackendConfiguration=se(JSON.parse(t.responseText));const r=document.currentScript.getAttribute("crossorigin");null!=r&&(ne.FrontendConfiguration={crossOrigin:r})}globalThis["@youwol/cdn-client"]||(globalThis["@youwol/cdn-client"]={...s,setup:X})})(),n})()));
//# sourceMappingURL=cdn-client.js.map