TP_JO2024/home/dist/core/core.module.min.js
2024-03-27 17:19:37 +01:00

3 lines
52 KiB
JavaScript

/*! DSFR v1.11.2 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
const t=new class{constructor(){this.modules={}}create(t){const e=new t;this.modules[e.type]=e}getModule(t){return this.modules[t]}add(t,e){this.modules[t].add(e)}remove(t,e){this.modules[t].remove(e)}get isActive(){return this._isActive}set isActive(t){if(t===this._isActive)return;this._isActive=t;const e=Object.keys(this.modules).map((t=>this.modules[t]));if(t)for(const t of e)t.activate();else for(const t of e)t.deactivate()}get isLegacy(){return this._isLegacy}set isLegacy(t){t!==this._isLegacy&&(this._isLegacy=t)}},e="fr",s="dsfr",i="@gouvfr",n="1.11.2";class r{constructor(t,e,s,i){switch(this.level=t,this.light=e,this.dark=s,i){case"warn":this.logger=console.warn;break;case"error":this.logger=console.error;break;default:this.logger=console.log}}log(...t){const e=new o(s);for(const s of t)e.add(s);this.print(e)}print(t){t.setColor(this.color),this.logger.apply(console,t.getMessage())}get color(){return window.matchMedia("(prefers-color-scheme: dark)").matches?this.dark:this.light}}class o{constructor(t){this.inputs=["%c"],this.styles=["font-family:Marianne","line-height: 1.5"],this.objects=[],t&&this.add(`${t} :`)}add(t){switch(typeof t){case"object":case"function":this.inputs.push("%o "),this.objects.push(t);break;default:this.inputs.push(`${t} `)}}setColor(t){this.styles.push(`color:${t}`)}getMessage(){return[this.inputs.join(""),this.styles.join(";"),...this.objects]}}const h={log:new r(0,"#616161","#989898"),debug:new r(1,"#000091","#8B8BFF"),info:new r(2,"#007c3b","#00ed70"),warn:new r(3,"#ba4500","#fa5c00","warn"),error:new r(4,"#D80600","#FF4641","error")};const a=new class{constructor(){this.level=2;for(const t in h){const e=h[t];this[t]=(...t)=>{this.level<=e.level&&e.log.apply(e,t)},this[t].print=e.print.bind(e)}}state(){const e=new o;e.add(t),this.log.print(e)}tree(){const e=t.getModule("stage");if(!e)return;const s=new o;this._branch(e.root,0,s),this.log.print(s)}_branch(t,e,s){let i="";if(e>0){let t="";for(let s=0;s<e;s++)t+=" ";i+=t+"└─ "}i+=`[${t.id}] ${t.html}`,s.add(i),s.add({"@":t}),s.add("\n");for(const n of t.children)i+=this._branch(n,e+1,s)}},c=t=>{"loading"!==document.readyState?window.requestAnimationFrame(t):document.addEventListener("DOMContentLoaded",t)},l={AUTO:"auto",MANUAL:"manual",RUNTIME:"runtime",LOADED:"loaded",VUE:"vue",ANGULAR:"angular",REACT:"react"};const d=new class{constructor(){this._mode=l.AUTO,this.isStarted=!1,this.starting=this.start.bind(this),this.preventManipulation=!1}configure(t={},e,s){this.startCallback=e;const i=t.production&&(!s||"false"!==s.production);switch(!0){case s&&!isNaN(s.level):a.level=Number(s.level);break;case s&&s.verbose&&("true"===s.verbose||1===s.verbose):a.level=0;break;case i:a.level=999;break;case t.verbose:a.level=0}a.info(`version ${n}`),this.mode=t.mode||l.AUTO}set mode(t){switch(t){case l.AUTO:this.preventManipulation=!1,e=this.starting,c(e);break;case l.LOADED:this.preventManipulation=!1,c(this.starting);break;case l.RUNTIME:this.preventManipulation=!1,this.start();break;case l.MANUAL:this.preventManipulation=!1;break;case l.VUE:case l.ANGULAR:case l.REACT:this.preventManipulation=!0;break;default:return void a.error("Illegal mode")}var e;this._mode=t,a.info(`mode set to ${t}`)}get mode(){return this._mode}start(){a.info("start"),this.startCallback()}};class u{constructor(){this._collection=[]}forEach(t){this._collection.forEach(t)}map(t){return this._collection.map(t)}get length(){return this._collection.length}add(t){return!(this._collection.indexOf(t)>-1)&&(this._collection.push(t),this.onAdd&&this.onAdd(),this.onPopulate&&1===this._collection.length&&this.onPopulate(),!0)}remove(t){const e=this._collection.indexOf(t);if(-1===e)return!1;this._collection.splice(e,1),this.onRemove&&this.onRemove(),this.onEmpty&&0===this._collection.length&&this.onEmpty()}execute(...t){for(const e of this._collection)e&&e.apply(null,t)}clear(){this._collection.length=0}clone(){const t=new u;return t._collection=this._collection.slice(),t}get collection(){return this._collection}}class g extends u{constructor(t){super(),this.type=t,this.isActive=!1}activate(){}deactivate(){}}const p=t=>`${e}-${t}`;p.selector=(t,e)=>(void 0===e&&(e="."),`${e}${p(t)}`),(p.attr=t=>`data-${p(t)}`).selector=(t,e)=>{let s=p.attr(t);return void 0!==e&&(s+=`="${e}"`),`[${s}]`},p.event=t=>`${s}.${t}`,p.emission=(t,e)=>`emission:${t}.${e}`;const m=(t,e)=>Array.prototype.slice.call(t.querySelectorAll(e)),f=(t,e)=>{const s=t.parentElement;return s.matches(e)?s:s===document.documentElement?null:f(s,e)};class _{constructor(t,e,s){this.selector=t,this.InstanceClass=e,this.creator=s,this.instances=new u,this.isIntroduced=!1,this._instanceClassName=this.InstanceClass.instanceClassName,this._instanceClassNames=this.getInstanceClassNames(this.InstanceClass),this._property=this._instanceClassName.substring(0,1).toLowerCase()+this._instanceClassName.substring(1);const i=this._instanceClassName.replace(/[^a-zA-Z0-9]+/g,"-").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([^0-9])/g,"$1-$2").replace(/([^0-9])([0-9])/g,"$1-$2").toLowerCase();this._attribute=p.attr(`js-${i}`)}getInstanceClassNames(t){const e=Object.getPrototypeOf(t);return e&&"Instance"!==e.instanceClassName?[...this.getInstanceClassNames(e),t.instanceClassName]:[t.instanceClassName]}hasInstanceClassName(t){return this._instanceClassNames.indexOf(t)>-1}introduce(){this.isIntroduced||(this.isIntroduced=!0,t.getModule("stage").parse(document.documentElement,this))}parse(t,e){const s=[];return t.matches&&t.matches(this.selector)&&s.push(t),!e&&t.querySelectorAll&&t.querySelector(this.selector)&&s.push.apply(s,m(t,this.selector)),s}create(t){if(!t.node.matches(this.selector))return;const e=new this.InstanceClass;return this.instances.add(e),e}remove(t){this.instances.remove(t)}dispose(){const t=this.instances.collection;for(let e=t.length-1;e>-1;e--)t[e]._dispose();this.creator=null}get instanceClassName(){return this._instanceClassName}get instanceClassNames(){return this._instanceClassNames}get property(){return this._property}get attribute(){return this._attribute}}class b extends g{constructor(){super("register")}register(e,s,i){const n=new _(e,s,i);return this.add(n),t.isActive&&n.introduce(),n}activate(){for(const t of this.collection)t.introduce()}remove(t){t.dispose(),super.remove(t)}}let y=0;class v{constructor(t,e){e?this.id=e:(y++,this.id=y),this.node=t,this.attributeNames=[],this.instances=[],this._children=[],this._parent=null,this._projects=[]}get proxy(){const t=this;if(!this._proxy){this._proxy={id:this.id,get parent(){return t.parent?t.parent.proxy:null},get children(){return t.children.map((t=>t.proxy))}};for(const t of this.instances)this._proxy[t.registration.property]=t.proxy}return this._proxy}get html(){if(!this.node||!this.node.outerHTML)return"";const t=this.node.outerHTML.indexOf(">");return this.node.outerHTML.substring(0,t+1)}project(t){-1===this._projects.indexOf(t)&&this._projects.push(t)}populate(){const t=this._projects.slice();this._projects.length=0;for(const e of t)this.create(e)}create(t){if(this.hasInstance(t.instanceClassName))return;a.debug(`create instance of ${t.instanceClassName} on element [${this.id}]`);const e=t.create(this);this.instances.push(e),e._config(this,t),this._proxy&&(this._proxy[t.property]=e.proxy)}remove(t){const e=this.instances.indexOf(t);e>-1&&this.instances.splice(e,1),this._proxy&&delete this._proxy[t.registration.property]}get parent(){return this._parent}get ascendants(){return[this.parent,...this.parent.ascendants]}get children(){return this._children}get descendants(){const t=[...this._children];return this._children.forEach((e=>t.push(...e.descendants))),t}addChild(t,e){return this._children.indexOf(t)>-1?null:(t._parent=this,!isNaN(e)&&e>-1&&e<this._children.length?this._children.splice(e,0,t):this._children.push(t),t)}removeChild(t){const e=this._children.indexOf(t);if(-1===e)return null;t._parent=null,this._children.splice(e,1)}emit(e,s){const i=t.getModule("stage").collection,n=[];for(const t of i)n.push(...t._emit(e,s));return n}_emit(t,e){const s=[];for(const i of this.instances)s.push(...i._emitter.emit(t,e));return s}ascend(t,e){return this._parent?this._parent._ascend(t,e):[]}_ascend(t,e){const s=[];for(const i of this.instances)s.push(...i._ascent.emit(t,e));return this._parent&&s.push(...this._parent._ascend(t,e)),s}descend(t,e){const s=[];for(const i of this._children)s.push(...i._descend(t,e));return s}_descend(t,e){const s=[];for(const i of this.instances)s.push(...i._descent.emit(t,e));for(const i of this._children)s.push(...i._descend(t,e));return s}getInstance(t){for(const e of this.instances)if(e.registration.hasInstanceClassName(t))return e;return null}hasInstance(t){return null!==this.getInstance(t)}getDescendantInstances(t,e,s){if(!t)return[];const i=[];for(const n of this._children){const r=n.getInstance(t);r&&(i.push(r),s)||(e&&n.hasInstance(e)||!n.children.length||i.push.apply(i,n.getDescendantInstances(t,e,s)))}return i}getAscendantInstance(t,e){if(!t||!this._parent)return null;const s=this._parent.getInstance(t);return s||(e&&this._parent.hasInstance(e)?null:this._parent.getAscendantInstance(t,e))}dispose(){for(let t=this.instances.length-1;t>=0;t--){const e=this.instances[t];e&&e._dispose()}this.instances.length=0,t.remove("stage",this),this.parent.removeChild(this),this._children.length=0,a.debug(`remove element [${this.id}] ${this.html}`)}prepare(t){-1===this.attributeNames.indexOf(t)&&this.attributeNames.push(t)}examine(){const t=this.attributeNames.slice();this.attributeNames.length=0;for(let e=this.instances.length-1;e>-1;e--)this.instances[e].examine(t)}}const E={CLICK:p.emission("root","click"),KEYDOWN:p.emission("root","keydown"),KEYUP:p.emission("root","keyup")},w={TAB:{id:"tab",value:9},ESCAPE:{id:"escape",value:27},END:{id:"end",value:35},HOME:{id:"home",value:36},LEFT:{id:"left",value:37},UP:{id:"up",value:38},RIGHT:{id:"right",value:39},DOWN:{id:"down",value:40}},A=t=>Object.values(w).filter((e=>e.value===t))[0];class C extends v{constructor(){super(document.documentElement,"root"),this.node.setAttribute(p.attr("js"),!0),this.listen()}listen(){document.documentElement.addEventListener("click",this.click.bind(this),{capture:!0}),document.documentElement.addEventListener("keydown",this.keydown.bind(this),{capture:!0}),document.documentElement.addEventListener("keyup",this.keyup.bind(this),{capture:!0})}click(t){this.emit(E.CLICK,t.target)}keydown(t){this.emit(E.KEYDOWN,A(t.keyCode))}keyup(t){this.emit(E.KEYUP,A(t.keyCode))}}class x extends g{constructor(){super("stage"),this.root=new C,super.add(this.root),this.observer=new MutationObserver(this.mutate.bind(this)),this.modifications=[],this.willModify=!1,this.modifying=this.modify.bind(this)}hasElement(t){for(const e of this.collection)if(e.node===t)return!0;return!1}getElement(t){for(const e of this.collection)if(e.node===t)return e;const e=new v(t);return this.add(e),a.debug(`add element [${e.id}] ${e.html}`),e}getProxy(t){if(!this.hasElement(t))return null;return this.getElement(t).proxy}add(t){super.add(t),this.put(t,this.root)}put(t,e){let s=0;for(let i=e.children.length-1;i>-1;i--){const n=e.children[i],r=t.node.compareDocumentPosition(n.node);if(r&Node.DOCUMENT_POSITION_CONTAINS)return void this.put(t,n);if(r&Node.DOCUMENT_POSITION_CONTAINED_BY)e.removeChild(n),t.addChild(n,0);else if(r&Node.DOCUMENT_POSITION_PRECEDING){s=i+1;break}}e.addChild(t,s)}activate(){this.observer.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}deactivate(){this.observer.disconnect()}mutate(t){const e=[];t.forEach((t=>{switch(t.type){case"childList":t.removedNodes.forEach((t=>this.dispose(t))),t.addedNodes.forEach((t=>this.parse(t)));break;case"attributes":if(this.hasElement(t.target)){const s=this.getElement(t.target);s.prepare(t.attributeName),-1===e.indexOf(s)&&e.push(s);for(const t of s.descendants)-1===e.indexOf(t)&&e.push(t)}-1===this.modifications.indexOf(t.target)&&this.modifications.push(t.target)}})),e.forEach((t=>t.examine())),this.modifications.length&&!this.willModify&&(this.willModify=!0,window.requestAnimationFrame(this.modifying))}modify(){this.willModify=!1;const t=this.modifications.slice();this.modifications.length=0;for(const e of t)document.documentElement.contains(e)&&this.parse(e)}dispose(t){const e=[];this.forEach((s=>{t.contains(s.node)&&e.push(s)}));for(const t of e)t.dispose(),this.remove(t)}parse(e,s,i){const n=s?[s]:t.getModule("register").collection,r=[];for(const t of n){const s=t.parse(e,i);for(const e of s){const s=this.getElement(e);s.project(t),-1===r.indexOf(s)&&r.push(s)}}for(const t of r)t.populate()}}class T extends g{constructor(){super("render"),this.rendering=this.render.bind(this),this.nexts=new u}activate(){window.requestAnimationFrame(this.rendering)}request(t){this.nexts.add(t)}render(){if(!t.isActive)return;if(window.requestAnimationFrame(this.rendering),this.forEach((t=>t.render())),!this.nexts.length)return;const e=this.nexts.clone();this.nexts.clear(),e.forEach((t=>t.next()))}}class R extends g{constructor(){super("resize"),this.requireResize=!1,this.resizing=this.resize.bind(this);const t=this.request.bind(this);document.fonts&&document.fonts.ready.then(t),window.addEventListener("resize",t),window.addEventListener("orientationchange",t)}activate(){this.request()}request(){this.requireResize||(this.requireResize=!0,window.requestAnimationFrame(this.resizing))}resize(){this.requireResize&&(this.forEach((t=>t.resize())),this.requireResize=!1)}}class N extends g{constructor(){super("lock"),this._isLocked=!1,this._scrollY=0,this.onPopulate=this.lock.bind(this),this.onEmpty=this.unlock.bind(this)}get isLocked(){return this._isLocked}lock(){if(!this._isLocked){this._isLocked=!0,this._scrollY=window.scrollY;const t=window.innerWidth-document.documentElement.clientWidth;document.documentElement.setAttribute(p.attr("scrolling"),"false"),document.body.style.top=-this._scrollY+"px",this.behavior=getComputedStyle(document.documentElement).getPropertyValue("scroll-behavior"),"smooth"===this.behavior&&(document.documentElement.style.scrollBehavior="auto"),t>0&&document.documentElement.style.setProperty("--scrollbar-width",`${t}px`)}}unlock(){this._isLocked&&(this._isLocked=!1,document.documentElement.removeAttribute(p.attr("scrolling")),document.body.style.top="",window.scrollTo(0,this._scrollY),"smooth"===this.behavior&&document.documentElement.style.removeProperty("scroll-behavior"),document.documentElement.style.removeProperty("--scrollbar-width"))}move(t){this._isLocked?(this._scrollY+=t,document.body.style.top=-this._scrollY+"px"):window.scrollTo(0,window.scrollY+t)}}class D extends g{constructor(){super("load"),this.loading=this.load.bind(this)}activate(){window.addEventListener("load",this.loading)}load(){this.forEach((t=>t.load()))}}const O=["Marianne","Spectral"];class L extends g{constructor(){super("font-swap"),this.swapping=this.swap.bind(this)}activate(){document.fonts&&document.fonts.addEventListener("loadingdone",this.swapping)}swap(){const t=O.filter((t=>document.fonts.check(`16px ${t}`)));this.forEach((e=>e.swapFont(t)))}}class S extends g{constructor(){super("mouse-move"),this.requireMove=!1,this._isMoving=!1,this.moving=this.move.bind(this),this.requesting=this.request.bind(this),this.onPopulate=this.listen.bind(this),this.onEmpty=this.unlisten.bind(this)}listen(){this._isMoving||(this._isMoving=!0,this.requireMove=!1,document.documentElement.addEventListener("mousemove",this.requesting))}unlisten(){this._isMoving&&(this._isMoving=!1,this.requireMove=!1,document.documentElement.removeEventListener("mousemove",this.requesting))}request(t){this._isMoving&&(this.point={x:t.clientX,y:t.clientY},this.requireMove||(this.requireMove=!0,window.requestAnimationFrame(this.moving)))}move(){this.requireMove&&(this.forEach((t=>t.mouseMove(this.point))),this.requireMove=!1)}}class k extends g{constructor(){super("hash"),this.handling=this.handle.bind(this),this.getLocationHash()}activate(){window.addEventListener("hashchange",this.handling)}deactivate(){window.removeEventListener("hashchange",this.handling)}_sanitize(t){return"#"===t.charAt(0)?t.substring(1):t}set hash(t){const e=this._sanitize(t);this._hash!==e&&(window.location.hash=e)}get hash(){return this._hash}getLocationHash(){const t=window.location.hash;this._hash=this._sanitize(t)}handle(t){this.getLocationHash(),this.forEach((e=>e.handleHash(this._hash,t)))}}const P=new class{constructor(){t.create(b),t.create(x),t.create(T),t.create(R),t.create(N),t.create(D),t.create(L),t.create(S),t.create(k);const e=t.getModule("register");this.register=e.register.bind(e)}get isActive(){return t.isActive}start(){a.debug("START"),t.isActive=!0}stop(){a.debug("STOP"),t.isActive=!1}};const I=t=>{switch(!0){case t.hover:return"-hover";case t.active:return"-active";default:return""}},M=new class{getColor(t,e,s,i={}){const n=`--${t}-${e}-${s}${I(i)}`;return getComputedStyle(document.documentElement).getPropertyValue(n).trim()||null}},$=t=>"."===t.charAt(0)?t.substr(1):t,G=t=>{switch(!0){case!t.className:return[];case"string"==typeof t.className:return t.className.split(" ");case"string"==typeof t.className.baseVal:return t.className.baseVal.split(" ")}return[]},q=(t,e,s)=>{e=$(e);const i=G(t),n=i.indexOf(e);!0===s?n>-1&&i.splice(n,1):-1===n&&i.push(e),t.className=i.join(" ")},j=(t,e)=>q(t,e),U=(t,e)=>q(t,e,!0),F=(t,e)=>G(t).indexOf($(e))>-1,H=['[tabindex]:not([tabindex="-1"])',"a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details","iframe"].join(),z=t=>t.querySelectorAll(H);let B=0;const V=t=>{if(!document.getElementById(t))return t;let e=!0;const s=t;for(;e;)B++,t=`${s}-${B}`,e=document.getElementById(t);return t},K={addClass:j,hasClass:F,removeClass:U,queryParentSelector:f,querySelectorAllArray:m,queryActions:z,uniqueId:V};const Y={DataURISVG:class{constructor(t=0,e=0){this._width=t,this._height=e,this._content=""}get width(){return this._width}set width(t){this._width=t}get height(){return this._height}set height(t){this._height=t}get content(){return this._content}set content(t){this._content=t}getDataURI(t=!1){let e=`<svg xmlns='http://www.w3.org/2000/svg' viewbox='0 0 ${this._width} ${this._height}' width='${this._width}px' height='${this._height}px'>${this._content}</svg>`;return e=e.replace(/#/gi,"%23"),t&&(e=e.replace(/</gi,"%3C"),e=e.replace(/>/gi,"%3E"),e=e.replace(/"/gi,"'"),e=e.replace(/{/gi,"%7B"),e=e.replace(/}/gi,"%7D")),`data:image/svg+xml;charset=utf8,${e}`}}},W={supportLocalStorage:()=>{try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}},supportAspectRatio:()=>!!window.CSS&&CSS.supports("aspect-ratio: 16 / 9")},X={TransitionSelector:{NONE:p.selector("transition-none")}},Z=(t,...e)=>(e.forEach((e=>{const s=Object.keys(e).reduce(((t,s)=>(t[s]=Object.getOwnPropertyDescriptor(e,s),t)),{});Object.getOwnPropertySymbols(e).forEach((t=>{const i=Object.getOwnPropertyDescriptor(e,t);i.enumerable&&(s[t]=i)})),Object.defineProperties(t,s)})),t),J={completeAssign:Z},Q={},tt={};Object.defineProperty(tt,"isLegacy",{get:()=>t.isLegacy}),tt.setLegacy=()=>{t.isLegacy=!0},Q.legacy=tt,Q.dom=K,Q.image=Y,Q.support=W,Q.motion=X,Q.property=J,Q.ns=p,Q.register=P.register,Q.state=t,Q.query=(t=>{if(t&&t.search){const t=new URLSearchParams(window.location.search).entries();return Object.fromEntries(t)}return null})(window.location),Object.defineProperty(Q,"preventManipulation",{get:()=>d.preventManipulation}),Object.defineProperty(Q,"stage",{get:()=>t.getModule("stage")});const et=e=>t.getModule("stage").getProxy(e);et.version=n,et.prefix=e,et.organisation=i,et.Modes=l,Object.defineProperty(et,"mode",{set:t=>{d.mode=t},get:()=>d.mode}),et.internals=Q,et.version=n,et.start=P.start,et.stop=P.stop,et.inspector=a,et.colors=M;const st=window[s];et.internals.configuration=st,d.configure(st,et.start,et.internals.query),window[s]=et;class it{constructor(){this.emissions={}}add(t,e){if("function"!=typeof e)throw new Error("closure must be a function");this.emissions[t]||(this.emissions[t]=[]),this.emissions[t].push(e)}remove(t,e){if(this.emissions[t])if(e){const s=this.emissions[t].indexOf(e);s>-1&&this.emissions[t].splice(s)}else delete this.emissions[t]}emit(t,e){if(!this.emissions[t])return[];const s=[];for(const i of this.emissions[t])i&&s.push(i(e));return s}dispose(){this.emissions=null}}class nt{constructor(t,e){this.id=t,this.minWidth=e}test(){return window.matchMedia(`(min-width: ${this.minWidth}em)`).matches}}const rt={XS:new nt("xs",0),SM:new nt("sm",36),MD:new nt("md",48),LG:new nt("lg",62),XL:new nt("xl",78)};class ot{constructor(t=!0){this.jsAttribute=t,this._isRendering=!1,this._isResizing=!1,this._isScrollLocked=!1,this._isLoading=!1,this._isSwappingFont=!1,this._isEnabled=!0,this._isDisposed=!1,this._listeners={},this._handlingClick=this.handleClick.bind(this),this._hashes=[],this._hash="",this._keyListenerTypes=[],this._keys=[],this.handlingKey=this.handleKey.bind(this),this._emitter=new it,this._ascent=new it,this._descent=new it,this._registrations=[],this._nexts=[]}static get instanceClassName(){return"Instance"}_config(t,e){this.element=t,this.registration=e,this.node=t.node,this.id=t.node.id,this.jsAttribute&&this.setAttribute(e.attribute,!0),this.init()}init(){}get proxy(){const t=this;return Z({render:()=>t.render(),resize:()=>t.resize()},{get node(){return this.node},get isEnabled(){return t.isEnabled},set isEnabled(e){t.isEnabled=e}})}log(...t){t.unshift(`${this.registration.instanceClassName} #${this.id} - `),a.log.apply(a,t)}debug(...t){t.unshift(`${this.registration.instanceClassName} #${this.id} - `),a.debug.apply(a,t)}info(...t){t.unshift(`${this.registration.instanceClassName} #${this.id} - `),a.info.apply(a,t)}warn(...t){t.unshift(`${this.registration.instanceClassName} #${this.id} - `),a.warn.apply(a,t)}error(...t){t.unshift(`${this.registration.instanceClassName} #${this.id} - `),a.error.apply(a,t)}register(e,s){const i=t.getModule("register").register(e,s,this);this._registrations.push(i)}getRegisteredInstances(t){for(const e of this._registrations)if(e.hasInstanceClassName(t))return e.instances.collection;return[]}dispatch(t,e,s,i){const n=new CustomEvent(t,{detail:e,bubble:!0===s,cancelable:!0===i});this.node.dispatchEvent(n)}listen(t,e,s){this._listeners[t]||(this._listeners[t]=[]);const i=this._listeners[t],n=new at(this.node,t,e,s);i.push(n),n.listen()}unlisten(t,e,s){if(!t){for(const t in this._listeners)this.unlisten(t);return}const i=this._listeners[t];if(!i)return;if(!e)return void i.forEach((e=>this.unlisten(t,e.closure)));const n=i.filter((t=>t.closure===e&&t.matchOptions(s)));n.forEach((t=>t.unlisten())),this._listeners[t]=i.filter((t=>-1===n.indexOf(t)))}listenClick(t){this.listen("click",this._handlingClick,t)}unlistenClick(t){this.unlisten("click",this._handlingClick,t)}handleClick(t){}set hash(e){t.getModule("hash").hash=e}get hash(){return t.getModule("hash").hash}listenHash(e,s){if(!this._hashes)return;0===this._hashes.length&&t.add("hash",this);const i=new ct(e,s);this._hashes=this._hashes.filter((t=>t.hash!==e)),this._hashes.push(i)}unlistenHash(e){this._hashes&&(this._hashes=this._hashes.filter((t=>t.hash!==e)),0===this._hashes.length&&t.remove("hash",this))}handleHash(t,e){if(this._hashes)for(const s of this._hashes)s.handle(t,e)}listenKey(t,e,s=!1,i=!1,n="down"){-1===this._keyListenerTypes.indexOf(n)&&(this.listen(`key${n}`,this.handlingKey),this._keyListenerTypes.push(n)),this._keys.push(new ht(n,t,e,s,i))}unlistenKey(t,e){this._keys=this._keys.filter((s=>s.code!==t||s.closure!==e)),this._keyListenerTypes.forEach((t=>{this._keys.some((e=>e.type===t))||this.unlisten(`key${t}`,this.handlingKey)}))}handleKey(t){for(const e of this._keys)e.handle(t)}get isEnabled(){return this._isEnabled}set isEnabled(t){this._isEnabled=t}get isRendering(){return this._isRendering}set isRendering(e){this._isRendering!==e&&(e?t.add("render",this):t.remove("render",this),this._isRendering=e)}render(){}request(e){this._nexts.push(e),t.getModule("render").request(this)}next(){const t=this._nexts.slice();this._nexts.length=0;for(const e of t)e&&e()}get isResizing(){return this._isResizing}set isResizing(e){this._isResizing!==e&&(e?(t.add("resize",this),this.resize()):t.remove("resize",this),this._isResizing=e)}resize(){}isBreakpoint(t){return!0==("string"==typeof t)?rt[t.toUpperCase()].test():t.test()}get isScrollLocked(){return this._isScrollLocked}set isScrollLocked(e){this._isScrollLocked!==e&&(e?t.add("lock",this):t.remove("lock",this),this._isScrollLocked=e)}get isLoading(){return this._isLoading}set isLoading(e){this._isLoading!==e&&(e?t.add("load",this):t.remove("load",this),this._isLoading=e)}load(){}get isSwappingFont(){return this._isSwappingFont}set isSwappingFont(e){this._isSwappingFont!==e&&(e?t.add("font-swap",this):t.remove("font-swap",this),this._isSwappingFont=e)}swapFont(){}get isMouseMoving(){return this._isMouseMoving}set isMouseMoving(e){this._isMouseMoving!==e&&(e?t.add("mouse-move",this):t.remove("mouse-move",this),this._isMouseMoving=e)}mouseMove(t){}examine(t){this.node.matches(this.registration.selector)?this.mutate(t):this._dispose()}mutate(t){}retrieveNodeId(t,e){if(t.id)return t.id;const s=V(`${this.id}-${e}`);return this.warn(`add id '${s}' to ${e}`),t.setAttribute("id",s),s}get isDisposed(){return this._isDisposed}_dispose(){this.debug(`dispose instance of ${this.registration.instanceClassName} on element [${this.element.id}]`),this.removeAttribute(this.registration.attribute),this.unlisten(),t.remove("hash",this),this._hashes=null,this._keys=null,this.isRendering=!1,this.isResizing=!1,this._nexts=null,t.getModule("render").nexts.remove(this),this.isScrollLocked=!1,this.isLoading=!1,this.isSwappingFont=!1,this.isMouseMoving=!1,this._emitter.dispose(),this._emitter=null,this._ascent.dispose(),this._ascent=null,this._descent.dispose(),this._descent=null,this.element.remove(this);for(const e of this._registrations)t.remove("register",e);this._registrations=null,this.registration.remove(this),this._isDisposed=!0,this.dispose()}dispose(){}emit(t,e){return this.element.emit(t,e)}addEmission(t,e){this._emitter.add(t,e)}removeEmission(t,e){this._emitter.remove(t,e)}ascend(t,e){return this.element.ascend(t,e)}addAscent(t,e){this._ascent.add(t,e)}removeAscent(t,e){this._ascent.remove(t,e)}descend(t,e){return this.element.descend(t,e)}addDescent(t,e){this._descent.add(t,e)}removeDescent(t,e){this._descent.remove(t,e)}get style(){return this.node.style}addClass(t){j(this.node,t)}removeClass(t){U(this.node,t)}hasClass(t){return F(this.node,t)}get classNames(){return G(this.node)}remove(){this.node.parentNode.removeChild(this.node)}setAttribute(t,e){this.node.setAttribute(t,e)}getAttribute(t){return this.node.getAttribute(t)}hasAttribute(t){return this.node.hasAttribute(t)}removeAttribute(t){this.node.removeAttribute(t)}setProperty(t,e){this.node.style.setProperty(t,e)}removeProperty(t){this.node.style.removeProperty(t)}focus(){this.node.focus()}blur(){this.node.blur()}focusClosest(){const t=this._focusClosest(this.node.parentNode);t&&t.focus()}_focusClosest(t){if(!t)return null;const e=[...z(t)];if(e.length<=1)return this._focusClosest(t.parentNode);{const t=e.indexOf(this.node);return e[t+(t<e.length-1?1:-1)]}}get hasFocus(){return this.node===document.activeElement}scrollIntoView(){const e=this.getRect(),s=t.getModule("lock");e.top<0&&s.move(e.top-50),e.bottom>window.innerHeight&&s.move(e.bottom-window.innerHeight+50)}matches(t){return this.node.matches(t)}querySelector(t){return this.node.querySelector(t)}querySelectorAll(t){return m(this.node,t)}queryParentSelector(t){return f(this.node,t)}getRect(){const t=this.node.getBoundingClientRect();return t.center=t.left+.5*t.width,t.middle=t.top+.5*t.height,t}get isLegacy(){return t.isLegacy}}class ht{constructor(t,e,s,i,n){this.type=t,this.eventType=`key${t}`,this.keyCode=e,this.closure=s,this.preventDefault=!0===i,this.stopPropagation=!0===n}handle(t){t.type===this.eventType&&t.keyCode===this.keyCode.value&&(this.closure(t),this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation())}}class at{constructor(t,e,s,i){this._node=t,this._type=e,this._closure=s,this._options=i}get closure(){return this._closure}listen(){this._node.addEventListener(this._type,this._closure,this._options)}matchOptions(t=null){switch(!0){case null===t:case"boolean"==typeof this._options&&"boolean"==typeof t&&this._options===t:return!0;case Object.keys(this._options).length!==Object.keys(t).length:return!1;case Object.keys(t).every((e=>this._options[e]===t[e])):return!0}return!1}unlisten(){this._node.removeEventListener(this._type,this._closure,this._options)}}class ct{constructor(t,e){this.hash=t,this.add=e}handle(t,e){this.hash===t&&this.add(e)}}const lt={DISCLOSE:p.event("disclose"),CONCEAL:p.event("conceal")},dt={RESET:p.emission("disclosure","reset"),ADDED:p.emission("disclosure","added"),RETRIEVE:p.emission("disclosure","retrieve"),REMOVED:p.emission("disclosure","removed"),GROUP:p.emission("disclosure","group"),UNGROUP:p.emission("disclosure","ungroup"),SPOTLIGHT:p.emission("disclosure","spotlight")};class ut extends ot{constructor(t,e,s,i){super(),this.type=t,this._selector=e,this.DisclosureButtonInstanceClass=s,this.disclosuresGroupInstanceClassName=i,this.modifier=this._selector+"--"+this.type.id,this._isPristine=!0,this._isRetrievingPrimaries=!1,this._hasRetrieved=!1,this._primaryButtons=[]}static get instanceClassName(){return"Disclosure"}init(){this.addDescent(dt.RESET,this.reset.bind(this)),this.addDescent(dt.GROUP,this.update.bind(this)),this.addDescent(dt.UNGROUP,this.update.bind(this)),this.addAscent(dt.SPOTLIGHT,this.disclose.bind(this)),this.register(`[aria-controls="${this.id}"]`,this.DisclosureButtonInstanceClass),this.ascend(dt.ADDED),this.listenHash(this.id,this._spotlight.bind(this)),this.update()}get isEnabled(){return super.isEnabled}set isEnabled(t){this.isEnabled!==t&&(super.isEnabled=t,t?this.ascend(dt.ADDED):this.ascend(dt.REMOVED))}get isPristine(){return this._isPristine}get proxy(){const t=this,e=Object.assign(super.proxy,{disclose:t.disclose.bind(t),focus:t.focus.bind(t)});this.type.canConceal&&(e.conceal=t.conceal.bind(t));return Z(e,{get buttons(){return t.buttons.map((t=>t.proxy))},get group(){const e=t.group;return e?e.proxy:null},get isDisclosed(){return t.isDisclosed}})}get buttons(){return this.getRegisteredInstances(this.DisclosureButtonInstanceClass.instanceClassName)}update(){this.getGroup(),this.retrievePrimaries()}getGroup(){if(!this.disclosuresGroupInstanceClassName)return void(this._group=null);const t=this.element.getAscendantInstance(this.disclosuresGroupInstanceClassName,this.constructor.instanceClassName);t&&t.validate(this)?this._group=t:this._group=null}get group(){return this._group}disclose(t){return!(!0===this.isDisclosed||!this.isEnabled)&&(this._isPristine=!1,this.isDisclosed=!0,!t&&this.group&&(this.group.current=this),!0)}conceal(t,e=!0){return!1!==this.isDisclosed&&(!(!this.type.canConceal&&this.group&&this.group.current===this)&&(this.isDisclosed=!1,!t&&this.group&&this.group.current===this&&(this.group.current=null),e||this.focus(),this._isPristine||this.descend(dt.RESET),!0))}get isDisclosed(){return this._isDisclosed}set isDisclosed(t){if(this._isDisclosed!==t&&(this.isEnabled||!0!==t)){this.dispatch(t?lt.DISCLOSE:lt.CONCEAL,this.type),this._isDisclosed=t,t?this.addClass(this.modifier):this.removeClass(this.modifier);for(let e=0;e<this.buttons.length;e++)this.buttons[e].apply(t)}}get isInitiallyDisclosed(){return this.primaryButtons.some((t=>t.isInitiallyDisclosed))}hasRetrieved(){return this._hasRetrieved}reset(){}toggle(t){if(this.type.canConceal)switch(!0){case!t:case this.isDisclosed:this.conceal(!1,!1);break;default:this.disclose()}else this.disclose()}get buttonHasFocus(){return this.buttons.some((t=>t.hasFocus))}get hasFocus(){return!!super.hasFocus||(!!this.buttonHasFocus||this.querySelectorAll(":focus").length>0)}focus(){this._primaryButtons.length>0&&this._primaryButtons[0].focus()}get primaryButtons(){return this._primaryButtons}retrievePrimaries(){this._isRetrievingPrimaries||(this._isRetrievingPrimaries=!0,this.request(this._retrievePrimaries.bind(this)))}_retrievePrimaries(){if(this._isRetrievingPrimaries=!1,this._primaryButtons=this._electPrimaries(this.buttons),!this._hasRetrieved&&0!==this._primaryButtons.length)if(this.retrieved(),this._hasRetrieved=!0,this.applyAbility(!0),this.group)this.group.retrieve();else if(this._isPristine&&this.isEnabled&&!this.group)switch(!0){case this.hash===this.id:this._spotlight();break;case this.isInitiallyDisclosed:this.disclose()}}retrieved(){}_spotlight(){this.disclose(),this.request((()=>{this.ascend(dt.SPOTLIGHT)}))}_electPrimaries(t){return t.filter((t=>t.canDisclose&&!this.node.contains(t.node)))}applyAbility(t=!1){const e=!this._primaryButtons.every((t=>t.isDisabled));this.isEnabled!==e&&(this.isEnabled=e,t||(!this.isEnabled&&this.isDisclosed&&(this.group?this.ascend(dt.REMOVED):this.type.canConceal&&this.conceal()),this.isEnabled&&(this.group&&this.ascend(dt.ADDED),this.hash===this.id&&this._spotlight())))}dispose(){this._group=null,this._primaryButtons=null,super.dispose(),this.ascend(dt.REMOVED)}}class gt extends ot{constructor(t){super(),this.type=t,this.attributeName=t.ariaState?"aria-"+t.id:p.attr(t.id),this._canDisclose=!1}static get instanceClassName(){return"DisclosureButton"}get isPrimary(){return this.registration.creator.primaryButtons.includes(this)}get canDisclose(){return this._canDisclose}get isDisabled(){return this.type.canDisable&&this.hasAttribute("disabled")}init(){this._canDisclose=this.hasAttribute(this.attributeName),this._isInitiallyDisclosed=this.isDisclosed,this._isContained=this.registration.creator.node.contains(this.node),this.controlsId=this.getAttribute("aria-controls"),this.registration.creator.retrievePrimaries(),this.listenClick()}get proxy(){return Object.assign(super.proxy,{focus:this.focus.bind(this)})}handleClick(t){this.registration.creator&&this.registration.creator.toggle(this.canDisclose)}mutate(t){this._canDisclose=this.hasAttribute(this.attributeName),this.registration.creator.applyAbility(),!this._isApplying&&this.isPrimary&&t.indexOf(this.attributeName)>-1&&this.registration.creator&&(this.isDisclosed?this.registration.creator.disclose():this.type.canConceal&&this.registration.creator.conceal())}apply(t){this.canDisclose&&(this._isApplying=!0,this.setAttribute(this.attributeName,t),this.request((()=>{this._isApplying=!1})))}get isDisclosed(){return"true"===this.getAttribute(this.attributeName)}get isInitiallyDisclosed(){return this._isInitiallyDisclosed}focus(){super.focus(),this.scrollIntoView()}measure(t){const e=this.rect;this._dx=t.x-e.x,this._dy=t.y-e.y}get dx(){return this._dx}get dy(){return this._dy}}const pt={PREVENT_CONCEAL:p.attr.selector("prevent-conceal"),GROUP:p.attr("group")};class mt extends ot{constructor(t,e){super(e),this.disclosureInstanceClassName=t,this._members=[],this._index=-1,this._isRetrieving=!1,this._hasRetrieved=!1,this._isGrouped=!0}static get instanceClassName(){return"DisclosuresGroup"}init(){this.addAscent(dt.ADDED,this.update.bind(this)),this.addAscent(dt.RETRIEVE,this.retrieve.bind(this)),this.addAscent(dt.REMOVED,this.update.bind(this)),this.descend(dt.GROUP),this._isGrouped="false"!==this.getAttribute(pt.GROUP),this.update()}get proxy(){const t=this,e={set index(e){t.index=e},get index(){return t.index},get length(){return t.length},get current(){const e=t.current;return e?e.proxy:null},get members(){return t.members.map((t=>t.proxy))},get hasFocus(){return t.hasFocus},set isGrouped(e){t.isGrouped=e},get isGrouped(){return t.isGrouped}};return Z(super.proxy,e)}validate(t){return!0}getMembers(){const t=this.element.getDescendantInstances(this.disclosureInstanceClassName,this.constructor.instanceClassName,!0);this._members=t.filter(this.validate.bind(this)).filter((t=>t.isEnabled));t.filter((t=>!this._members.includes(t))).forEach((t=>t.conceal()))}retrieve(t=!1){this._isRetrieving||this._hasRetrieved&&!t||(this._isRetrieving=!0,this.request(this._retrieve.bind(this)))}_retrieve(){if(this.getMembers(),this._isRetrieving=!1,this._hasRetrieved=!0,this.hash)for(let t=0;t<this.length;t++){const e=this.members[t];if(this.hash===e.id)return this.index=t,this.request((()=>{this.ascend(dt.SPOTLIGHT)})),t}for(let t=0;t<this.length;t++){if(this.members[t].isInitiallyDisclosed)return this.index=t,t}return this.getIndex()}update(){this.getMembers(),this._hasRetrieved&&this.getIndex()}get members(){return this._members}get length(){return this.members?this.members.length:0}getIndex(t=-1){this._index=void 0;let e=t;for(let t=0;t<this.length;t++)if(this.members[t].isDisclosed){e=t;break}return this.index=e,e}get index(){return this._index}set index(t){if(!(t<-1||t>=this.length||t===this._index)){this._index=t;for(let e=0;e<this.length;e++){const s=this.members[e];t===e?s.isDisclosed||s.disclose(!0):!this.isGrouped&&this.canUngroup||!s.isDisclosed||s.conceal(!0)}this.apply()}}get current(){return-1===this._index||isNaN(this._index)?null:this._members[this._index]||null}set current(t){this.index=this.members.indexOf(t)}get hasFocus(){const t=this.current;return!!t&&t.hasFocus}set isGrouped(t){const e=!!t;this._isGrouped!==e&&(this._isGrouped=e,this.setAttribute(pt.GROUP,!!t),this.update())}get isGrouped(){return this._isGrouped}get canUngroup(){return!1}mutate(t){t.includes(pt.GROUP)&&(this.isGrouped="false"!==this.getAttribute(pt.GROUP))}apply(){}dispose(){super.dispose(),this.descend(dt.UNGROUP),this._members=null}}const ft={EXPAND:{id:"expanded",ariaState:!0,ariaControls:!0,canConceal:!0,canDisable:!0},SELECT:{id:"selected",ariaState:!0,ariaControls:!0,canConceal:!1,canDisable:!0},OPENED:{id:"opened",ariaState:!1,ariaControls:!0,canConceal:!0,canDisable:!1}};class _t extends gt{constructor(){super(ft.EXPAND)}static get instanceClassName(){return"CollapseButton"}}const bt={COLLAPSE:p.selector("collapse"),COLLAPSING:p.selector("collapsing")};const yt={CHANGE:p("equisized")};const vt={TOGGLE:p.event("toggle")};const Et={INJECT_SVG:`[${p.attr("inject-svg")}]`};const wt={ARTWORK_USE:`${p.selector("artwork")} use`},At={ASSESS_FILE:`${p.attr.selector("assess-file")}`,DETAIL:`${p.attr.selector("assess-file")} [class$="__detail"], ${p.attr.selector("assess-file")} [class*="__detail "]`},Ct={UPDATE:p.emission("assess","update"),ADDED:p.emission("assess","added")};const xt=["32x9","16x9","3x2","4x3","1x1","3x4","2x3"],Tt=(t,e)=>e.map((e=>p.selector(`${t}--${e}`))).join(","),Rt=`${p.selector("responsive-img")}, ${Tt("responsive-img",xt)}, ${p.selector("responsive-vid")}, ${Tt("responsive-vid",["16x9","4x3","1x1"])}`,Nt={RATIO:`${p.selector("ratio")}, ${Tt("ratio",xt)}, ${Rt}`},Dt=window[s];const Ot={TOP:p.selector("placement--top"),RIGHT:p.selector("placement--right"),BOTTOM:p.selector("placement--bottom"),LEFT:p.selector("placement--left")},Lt={START:p.selector("placement--start"),CENTER:p.selector("placement--center"),END:p.selector("placement--end")},St={TOP:"place_top",RIGHT:"place_right",BOTTOM:"place_bottom",LEFT:"place_left"},kt={START:"align_start",CENTER:"align_center",END:"align_end"},Pt={AUTO:"placement_auto",MANUAL:"placement_manual"};et.core={Instance:ot,Breakpoints:rt,KeyCodes:w,Disclosure:ut,DisclosureButton:gt,DisclosuresGroup:mt,DisclosureType:ft,DisclosureEvent:lt,DisclosureSelector:pt,DisclosureEmission:dt,Collapse:class extends ut{constructor(){super(ft.EXPAND,bt.COLLAPSE,_t,"CollapsesGroup")}static get instanceClassName(){return"Collapse"}init(){super.init(),this.listen("transitionend",this.transitionend.bind(this))}transitionend(t){this.removeClass(bt.COLLAPSING),this.isDisclosed||(this.isLegacy?this.style.maxHeight="":this.style.removeProperty("--collapse-max-height"))}unbound(){this.isLegacy?this.style.maxHeight="none":this.style.setProperty("--collapse-max-height","none")}disclose(t){if(!0===this.isDisclosed||!this.isEnabled)return!1;this.unbound(),this.request((()=>{this.addClass(bt.COLLAPSING),this.adjust(),this.request((()=>{super.disclose(t)}))}))}conceal(t,e){if(!1===this.isDisclosed)return!1;this.request((()=>{this.addClass(bt.COLLAPSING),this.adjust(),this.request((()=>{super.conceal(t,e)}))}))}adjust(){this.setProperty("--collapser","none");const t=this.node.offsetHeight;this.setProperty("--collapse",-t+"px"),this.setProperty("--collapser","")}reset(){this.isPristine||(this.isDisclosed=!1)}_electPrimaries(t){const e=this.element.parent.instances.map((t=>t.collapsePrimary)).filter((e=>void 0!==e&&t.indexOf(e)>-1));if(1===e.length)return e;if(1===(t=super._electPrimaries(t)).length)return t;const s=t.filter((t=>t.dy>=0));if(s.length>0&&(t=s),1===t.length)return t;const i=Math.min(...t.map((t=>t.dy))),n=t.filter((t=>t.dy===i));return n.length>0&&(t=n),1===t.length||t.sort(((t,e)=>Math.abs(e.dx)-Math.abs(t.dx))),t}},CollapseButton:_t,CollapsesGroup:class extends mt{constructor(){super("Collapse")}static get instanceClassName(){return"CollapsesGroup"}get canUngroup(){return!0}},CollapseSelector:bt,RootSelector:{ROOT:":root"},RootEmission:E,Equisized:class extends ot{static get instanceClassName(){return"Equisized"}init(){this.ascend(yt.CHANGE)}measure(){return this.isLegacy&&(this.style.width="auto"),this.getRect().width}adjust(t){this.isLegacy&&(this.style.width=`${t}px`)}dispose(){this.ascend(yt.CHANGE)}},EquisizedEmission:yt,Toggle:class extends ot{static get instanceClassName(){return"Toggle"}init(){this.pressed="true"===this.pressed,this.listenClick()}handleClick(){this.toggle()}toggle(){this.pressed="true"!==this.pressed}get pressed(){return this.getAttribute("aria-pressed")}set pressed(t){this.setAttribute("aria-pressed",t?"true":"false"),this.dispatch(vt.TOGGLE,t)}get proxy(){const t=this,e=Object.assign(super.proxy,{toggle:t.toggle.bind(t)});return Z(e,{get pressed(){return t.pressed},set pressed(e){t.pressed=e}})}},EquisizedsGroup:class extends ot{static get instanceClassName(){return"EquisizedsGroup"}init(){this.isResizing=!0,this.isLoading=!0,this.addAscent(yt.CHANGE,this.resize.bind(this))}load(){this.resize()}resize(){const t=this.element.getDescendantInstances("Equisized");this.isLegacy||this.style.setProperty("--equisized-width","auto");const e=Math.max(...t.map((t=>t.measure())));this.isLegacy?t.forEach((t=>t.adjust(e))):this.style.setProperty("--equisized-width",`${e}px`)}},InjectSvg:class extends ot{static get instanceClassName(){return"InjectSvg"}init(){this.node&&(this.img=this.node.querySelector("img")),this.isLegacy||this.replace()}get proxy(){const t=this;return Object.assign(super.proxy,{replace:t.replace.bind(t),restore:t.restore.bind(t)})}fetch(){this.img&&(this.imgID=this.img.getAttribute("id"),this.imgClass=this.img.getAttribute("class"),this.imgURL=this.img.getAttribute("src"),fetch(this.imgURL).then((t=>t.text())).then((t=>{const e=(new DOMParser).parseFromString(t,"text/html");this.svg=e.querySelector("svg"),this.svg&&this.replace()})))}replace(){if(!this.svg)return void this.fetch();this.imgID&&void 0!==this.imgID&&this.svg.setAttribute("id",this.imgID);let t=this.imgURL.match(/[ \w-]+\./)[0];t&&(t=t.slice(0,-1),["dark","light","system"].includes(t)&&(this.svg.innerHTML=this.svg.innerHTML.replaceAll('id="artwork-',`id="${t}-artwork-`),this.svg.innerHTML=this.svg.innerHTML.replaceAll('"#artwork-',`"#${t}-artwork-`))),this.imgClass&&void 0!==this.imgClass&&this.svg.setAttribute("class",this.imgClass),this.svg.hasAttribute("xmlns:a")&&this.svg.removeAttribute("xmlns:a"),this.node.setAttribute("data-fr-inject-svg",!0);var e,s;e=this.svg,s={"aria-hidden":!0,focusable:!1},Object.keys(s).forEach((t=>e.setAttribute(t,s[t]))),this.node.replaceChild(this.svg,this.img)}restore(){this.img&&this.svg&&(this.node.setAttribute("data-fr-inject-svg",!1),this.node.replaceChild(this.img,this.svg))}},InjectSvgSelector:Et,Artwork:class extends ot{static get instanceClassName(){return"Artwork"}init(){this.isLegacy&&this.replace()}get proxy(){return Object.assign(super.proxy,{replace:this.replace.bind(this)})}fetch(){this.xlink=this.node.getAttribute("href");const t=this.xlink.split("#");this.svgUrl=t[0],this.svgName=t[1];const e=new XMLHttpRequest;e.onload=()=>{const t=(new DOMParser).parseFromString(e.responseText,"text/html");this.realSvgContent=t.getElementById(this.svgName),this.realSvgContent&&(this.realSvgContent.classList.add(this.node.classList),this.replace())},e.open("GET",this.svgUrl),e.send()}replace(){this.realSvgContent?this.node.parentNode.replaceChild(this.realSvgContent,this.node):this.fetch()}},ArtworkSelector:wt,AssessFile:class extends ot{static get instanceClassName(){return"AssessFile"}init(){this.lang=this.getLang(this.node),this.href=this.getAttribute("href"),this.hreflang=this.getAttribute("hreflang"),this.file={},this.gather(),this.addAscent(Ct.ADDED,this.update.bind(this)),this.addDescent(Ct.ADDED,this.update.bind(this))}getFileLength(){void 0!==this.href?fetch(this.href,{method:"HEAD",mode:"cors"}).then((t=>{this.length=t.headers.get("content-length")||-1,-1===this.length&&a.warn("File size unknown: "+this.href+'\nUnable to get HTTP header: "content-length"'),this.gather()})):this.length=-1}mutate(t){-1!==t.indexOf("href")&&(this.href=this.getAttribute("href"),this.getFileLength()),-1!==t.indexOf("hreflang")&&(this.hreflang=this.getAttribute("hreflang"),this.gather())}gather(){if(this.isLegacy&&(this.length=-1),this.length){if(this.details=[],this.href){const t=this.parseExtension(this.href);t&&this.details.push(t.toUpperCase())}-1!==this.length&&this.details.push(this.bytesToSize(this.length)),this.hreflang&&this.details.push(this.getLangDisplayName(this.hreflang)),this.update()}else this.getFileLength()}update(){this.details&&(this.descend(Ct.UPDATE,this.details),this.ascend(Ct.UPDATE,this.details))}getLang(t){return t.lang?t.lang:document.documentElement===t?window.navigator.language:this.getLang(t.parentElement)}parseExtension(t){return t.match(/\.(\w{1,9})(?:$|[?#])/)[0].replace(".","")}getLangDisplayName(t){if(this.isLegacy)return t;const e=new Intl.DisplayNames([this.lang],{type:"language"}).of(t);return e.charAt(0).toUpperCase()+e.slice(1)}bytesToSize(t){if(-1===t)return null;let e=["octets","ko","Mo","Go","To"];"bytes"===this.getAttribute(p.attr("assess-file"))&&(e=["bytes","KB","MB","GB","TB"]);const s=parseInt(Math.floor(Math.log(t)/Math.log(1e3)),10);if(0===s)return`${t} ${e[s]}`;const i=t/1e3**s,n=Math.round(100*(i+Number.EPSILON))/100;return`${String(n).replace(".",",")} ${e[s]}`}},AssessDetail:class extends ot{static get instanceClassName(){return"AssessDetail"}init(){this.addDescent(Ct.UPDATE,this.update.bind(this)),this.ascend(Ct.ADDED)}update(t){this.node.innerHTML=t.join(" - ")}},AssessEmission:Ct,AssessSelector:At,Ratio:class extends ot{static get instanceClassName(){return"Ratio"}init(){if(!Dt.internals.support.supportAspectRatio()){this.ratio=16/9;for(const t in this.classNames)if(this.registration.selector.indexOf(this.classNames[t])>0){const e=this.classNames[t].split("ratio-");e[1]&&(this.ratio=e[1].split("x")[0]/e[1].split("x")[1])}this.isRendering=!0,this.update()}}render(){this.getRect().width!==this.currentWidth&&this.update()}update(){this.currentWidth=this.getRect().width,this.style.height=this.currentWidth/this.ratio+"px"}},RatioSelector:Nt,Placement:class extends ot{constructor(t=Pt.AUTO,e=[St.BOTTOM,St.TOP,St.LEFT,St.RIGHT],s=[kt.CENTER,kt.START,kt.END],i=16){super(),this._mode=t,this._places=e,this._aligns=s,this._safeAreaMargin=i,this._isShown=!1}static get instanceClassName(){return"Placement"}init(){this.isResizing=!0}get proxy(){const t=this,e=Object.assign(super.proxy,{show:t.show.bind(t),hide:t.hide.bind(t)});return Z(e,{get mode(){return t.mode},set mode(e){t.mode=e},get place(){return t.place},set place(e){t.place=e},get align(){return t.align},set align(e){t.align=e},get isShown(){return t.isShown},set isShown(e){t.isShown=e}})}get mode(){return this._mode}set mode(t){this._mode=t}get place(){return this._place}set place(t){if(this._place!==t){switch(this._place){case St.TOP:this.removeClass(Ot.TOP);break;case St.RIGHT:this.removeClass(Ot.RIGHT);break;case St.BOTTOM:this.removeClass(Ot.BOTTOM);break;case St.LEFT:this.removeClass(Ot.LEFT)}switch(this._place=t,this._place){case St.TOP:this.addClass(Ot.TOP);break;case St.RIGHT:this.addClass(Ot.RIGHT);break;case St.BOTTOM:this.addClass(Ot.BOTTOM);break;case St.LEFT:this.addClass(Ot.LEFT)}}}get align(){return this._align}set align(t){if(this._align!==t){switch(this._align){case kt.START:this.removeClass(Lt.START);break;case kt.CENTER:this.removeClass(Lt.CENTER);break;case kt.END:this.removeClass(Lt.END)}switch(this._align=t,this._align){case kt.START:this.addClass(Lt.START);break;case kt.CENTER:this.addClass(Lt.CENTER);break;case kt.END:this.addClass(Lt.END)}}}show(){this.isShown=!0}hide(){this.isShown=!1}get isShown(){return this._isShown}set isShown(t){this._isShown!==t&&this.isEnabled&&(this.isRendering=t,this._isShown=t)}setReferent(t){this._referent=t}resize(){this.safeArea={top:this._safeAreaMargin,right:window.innerWidth-this._safeAreaMargin,bottom:window.innerHeight-this._safeAreaMargin,left:this._safeAreaMargin,center:.5*window.innerWidth,middle:.5*window.innerHeight}}render(){if(!this._referent)return;if(this.rect=this.getRect(),this.referentRect=this._referent.getRect(),this.mode===Pt.AUTO)switch(this.place=this.getPlace(),this.place){case St.TOP:case St.BOTTOM:this.align=this.getHorizontalAlign();break;case St.LEFT:case St.RIGHT:this.align=this.getVerticalAlign()}let t,e;switch(this.place){case St.TOP:e=this.referentRect.top-this.rect.height;break;case St.RIGHT:t=this.referentRect.right;break;case St.BOTTOM:e=this.referentRect.bottom;break;case St.LEFT:t=this.referentRect.left-this.rect.width}switch(this.place){case St.TOP:case St.BOTTOM:switch(this.align){case kt.CENTER:t=this.referentRect.center-.5*this.rect.width;break;case kt.START:t=this.referentRect.left;break;case kt.END:t=this.referentRect.right-this.rect.width}break;case St.RIGHT:case St.LEFT:switch(this.align){case kt.CENTER:e=this.referentRect.middle-.5*this.rect.height;break;case kt.START:e=this.referentRect.top;break;case kt.END:e=this.referentRect.bottom-this.rect.height}}this._x===t&&this._y===e||(this._x=t+.5|0,this._y=e+.5|0,this.node.style.transform=`translate(${this._x}px,${this._y}px)`)}getPlace(){for(const t of this._places)switch(t){case St.TOP:if(this.referentRect.top-this.rect.height>this.safeArea.top)return St.TOP;break;case St.RIGHT:if(this.referentRect.right+this.rect.width<this.safeArea.right)return St.RIGHT;break;case St.BOTTOM:if(this.referentRect.bottom+this.rect.height<this.safeArea.bottom)return St.BOTTOM;break;case St.LEFT:if(this.referentRect.left-this.rect.width>this.safeArea.left)return St.LEFT}return this._places[0]}getHorizontalAlign(){for(const t of this._aligns)switch(t){case kt.CENTER:if(this.referentRect.center-.5*this.rect.width>this.safeArea.left&&this.referentRect.center+.5*this.rect.width<this.safeArea.right)return kt.CENTER;break;case kt.START:if(this.referentRect.left+this.rect.width<this.safeArea.right)return kt.START;break;case kt.END:if(this.referentRect.right-this.rect.width>this.safeArea.left)return kt.END}return this._aligns[0]}getVerticalAlign(){for(const t of this._aligns)switch(t){case kt.CENTER:if(this.referentRect.middle-.5*this.rect.height>this.safeArea.top&&this.referentRect.middle+.5*this.rect.height<this.safeArea.bottom)return kt.CENTER;break;case kt.START:if(this.referentRect.top+this.rect.height<this.safeArea.bottom)return kt.START;break;case kt.END:if(this.referentRect.bottom-this.rect.height>this.safeArea.top)return kt.END}return this._aligns[0]}dispose(){this._referent=null,super.dispose()}},PlacementReferent:class extends ot{constructor(){super(),this._isShown=!1}static get instanceClassName(){return"PlacementReferent"}init(){this.registration.creator.setReferent(this),this._placement=this.registration.creator}get placement(){return this._placement}get isShown(){return this._isShown}set isShown(t){this._isShown!==t&&this.isEnabled&&(this._isShown=t,t?this.registration.creator.show():this.registration.creator.hide())}show(){this.isShown=!0}hide(){this.isShown=!1}},PlacementAlign:kt,PlacementPosition:St,PlacementMode:Pt},et.internals.register(et.core.CollapseSelector.COLLAPSE,et.core.Collapse),et.internals.register(et.core.InjectSvgSelector.INJECT_SVG,et.core.InjectSvg),et.internals.register(et.core.RatioSelector.RATIO,et.core.Ratio),et.internals.register(et.core.AssessSelector.ASSESS_FILE,et.core.AssessFile),et.internals.register(et.core.AssessSelector.DETAIL,et.core.AssessDetail);
//# sourceMappingURL=core.module.min.js.map