UNPKG

@codegouvfr/react-dsfr

Version:

French State Design System React integration library

2 lines 269 kB
/*! DSFR v1.12.1 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */ !function(){"use strict";var t=function(){this.modules={}},e={isActive:{configurable:!0},isLegacy:{configurable:!0}};t.prototype.create=function(t){var e=new t;this.modules[e.type]=e},t.prototype.getModule=function(t){return this.modules[t]},t.prototype.add=function(t,e){this.modules[t].add(e)},t.prototype.remove=function(t,e){this.modules[t].remove(e)},e.isActive.get=function(){return this._isActive},e.isActive.set=function(t){var e=this;if(t!==this._isActive){this._isActive=t;var r=Object.keys(this.modules).map((function(t){return e.modules[t]}));if(t)for(var n=0,i=r;n<i.length;n+=1){i[n].activate()}else for(var o=0,s=r;o<s.length;o+=1){s[o].deactivate()}}},e.isLegacy.get=function(){return this._isLegacy},e.isLegacy.set=function(t){t!==this._isLegacy&&(this._isLegacy=t)},Object.defineProperties(t.prototype,e);var r=new t,n="fr",i="dsfr",o="@gouvfr",s="1.12.1",a=function(t,e,r,n){switch(this.level=t,this.light=e,this.dark=r,n){case"warn":this.logger=console.warn;break;case"error":this.logger=console.error;break;default:this.logger=console.log}},c={color:{configurable:!0}};a.prototype.log=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var r=new l(i),n=0,o=t;n<o.length;n+=1){var s=o[n];r.add(s)}this.print(r)},a.prototype.print=function(t){t.setColor(this.color),this.logger.apply(console,t.getMessage())},c.color.get=function(){return window.matchMedia("(prefers-color-scheme: dark)").matches?this.dark:this.light},Object.defineProperties(a.prototype,c);var l=function(t){this.inputs=["%c"],this.styles=["font-family:Marianne","line-height: 1.5"],this.objects=[],t&&this.add(t+" :")};l.prototype.add=function(t){switch(typeof t){case"object":case"function":this.inputs.push("%o "),this.objects.push(t);break;default:this.inputs.push(t+" ")}},l.prototype.setColor=function(t){this.styles.push("color:"+t)},l.prototype.getMessage=function(){return[this.inputs.join(""),this.styles.join(";")].concat(this.objects)};var u={log:new a(0,"#616161","#989898"),debug:new a(1,"#000091","#8B8BFF"),info:new a(2,"#007c3b","#00ed70"),warn:new a(3,"#ba4500","#fa5c00","warn"),error:new a(4,"#D80600","#FF4641","error")},p=function(){var t=this;this.level=2;var e=function(e){var r=u[e];t[e]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];t.level<=r.level&&r.log.apply(r,e)},t[e].print=r.print.bind(r)};for(var r in u)e(r)};p.prototype.state=function(){var t=new l;t.add(r),this.log.print(t)},p.prototype.tree=function(){var t=r.getModule("stage");if(t){var e=new l;this._branch(t.root,0,e),this.log.print(e)}},p.prototype._branch=function(t,e,r){var n="";if(e>0){for(var i="",o=0;o<e;o++)i+=" ";n+=i+"└─ "}n+="["+t.id+"] "+t.html,r.add(n),r.add({"@":t}),r.add("\n");for(var s=0,a=t.children;s<a.length;s+=1){var c=a[s];n+=this._branch(c,e+1,r)}};var h=new p,f=function(t){"loading"!==document.readyState?window.requestAnimationFrame(t):document.addEventListener("DOMContentLoaded",t)},d={AUTO:"auto",MANUAL:"manual",RUNTIME:"runtime",LOADED:"loaded",VUE:"vue",ANGULAR:"angular",REACT:"react"},y=function(){this._mode=d.AUTO,this.isStarted=!1,this.starting=this.start.bind(this),this.preventManipulation=!1},b={mode:{configurable:!0}};y.prototype.configure=function(t,e,r){void 0===t&&(t={}),this.startCallback=e;var n=t.production&&(!r||"false"!==r.production);switch(!0){case r&&!isNaN(r.level):h.level=Number(r.level);break;case r&&r.verbose&&("true"===r.verbose||1===r.verbose):h.level=0;break;case n:h.level=999;break;case t.verbose:h.level=0}h.info("version "+s),this.mode=t.mode||d.AUTO},b.mode.set=function(t){switch(t){case d.AUTO:this.preventManipulation=!1,e=this.starting,f(e);break;case d.LOADED:this.preventManipulation=!1,f(this.starting);break;case d.RUNTIME:this.preventManipulation=!1,this.start();break;case d.MANUAL:this.preventManipulation=!1;break;case d.VUE:case d.ANGULAR:case d.REACT:this.preventManipulation=!0;break;default:return void h.error("Illegal mode")}var e;this._mode=t,h.info("mode set to "+t)},b.mode.get=function(){return this._mode},y.prototype.start=function(){h.info("start"),this.startCallback()},Object.defineProperties(y.prototype,b);var g=new y,v=function(){this._collection=[]},m={length:{configurable:!0},collection:{configurable:!0}};v.prototype.forEach=function(t){this._collection.forEach(t)},v.prototype.map=function(t){return this._collection.map(t)},m.length.get=function(){return this._collection.length},v.prototype.add=function(t){return!(this._collection.indexOf(t)>-1)&&(this._collection.push(t),this.onAdd&&this.onAdd(),this.onPopulate&&1===this._collection.length&&this.onPopulate(),!0)},v.prototype.remove=function(t){var 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()},v.prototype.execute=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var r=0,n=this._collection;r<n.length;r+=1){var i=n[r];i&&i.apply(null,t)}},v.prototype.clear=function(){this._collection.length=0},v.prototype.clone=function(){var t=new v;return t._collection=this._collection.slice(),t},m.collection.get=function(){return this._collection},Object.defineProperties(v.prototype,m);var _=function(t){function e(e){t.call(this),this.type=e,this.isActive=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(v),w=function(t){return n+"-"+t};w.selector=function(t,e){return void 0===e&&(e="."),""+e+w(t)},(w.attr=function(t){return"data-"+w(t)}).selector=function(t,e){var r=w.attr(t);return void 0!==e&&(r+='="'+e+'"'),"["+r+"]"},w.event=function(t){return i+"."+t},w.emission=function(t,e){return"emission:"+t+"."+e};var S=function(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))},E=function(t,e){var r=t.parentElement;return r.matches(e)?r:r===document.documentElement?null:E(r,e)},O=function(t,e,r){this.selector=t,this.InstanceClass=e,this.creator=r,this.instances=new v,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);var n=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=w.attr("js-"+n)},j={instanceClassName:{configurable:!0},instanceClassNames:{configurable:!0},property:{configurable:!0},attribute:{configurable:!0}};O.prototype.getInstanceClassNames=function(t){var e=Object.getPrototypeOf(t);return e&&"Instance"!==e.instanceClassName?this.getInstanceClassNames(e).concat([t.instanceClassName]):[t.instanceClassName]},O.prototype.hasInstanceClassName=function(t){return this._instanceClassNames.indexOf(t)>-1},O.prototype.introduce=function(){this.isIntroduced||(this.isIntroduced=!0,r.getModule("stage").parse(document.documentElement,this))},O.prototype.parse=function(t,e){var r=[];return t.matches&&t.matches(this.selector)&&r.push(t),!e&&t.querySelectorAll&&t.querySelector(this.selector)&&r.push.apply(r,S(t,this.selector)),r},O.prototype.create=function(t){if(t.node.matches(this.selector)){var e=new this.InstanceClass;return this.instances.add(e),e}},O.prototype.remove=function(t){this.instances.remove(t)},O.prototype.dispose=function(){for(var t=this.instances.collection,e=t.length-1;e>-1;e--)t[e]._dispose();this.creator=null},j.instanceClassName.get=function(){return this._instanceClassName},j.instanceClassNames.get=function(){return this._instanceClassNames},j.property.get=function(){return this._property},j.attribute.get=function(){return this._attribute},Object.defineProperties(O.prototype,j);var T=function(t){function e(){t.call(this,"register")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.register=function(t,e,n){var i=new O(t,e,n);return this.add(i),r.isActive&&i.introduce(),i},e.prototype.activate=function(){for(var t=0,e=this.collection;t<e.length;t+=1){e[t].introduce()}},e.prototype.remove=function(e){e.dispose(),t.prototype.remove.call(this,e)},e}(_),P=0,A=function(t,e){e?this.id=e:(P++,this.id=P),this.node=t,this.attributeNames=[],this.instances=[],this._children=[],this._parent=null,this._projects=[]},N={proxy:{configurable:!0},html:{configurable:!0},parent:{configurable:!0},ascendants:{configurable:!0},children:{configurable:!0},descendants:{configurable:!0}};N.proxy.get=function(){var 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((function(t){return t.proxy}))}};for(var e=0,r=this.instances;e<r.length;e+=1){var n=r[e];this._proxy[n.registration.property]=n.proxy}}return this._proxy},N.html.get=function(){if(!this.node||!this.node.outerHTML)return"";var t=this.node.outerHTML.indexOf(">");return this.node.outerHTML.substring(0,t+1)},A.prototype.project=function(t){-1===this._projects.indexOf(t)&&this._projects.push(t)},A.prototype.populate=function(){var t=this._projects.slice();this._projects.length=0;for(var e=0,r=t;e<r.length;e+=1){var n=r[e];this.create(n)}},A.prototype.create=function(t){if(!this.hasInstance(t.instanceClassName)){h.debug("create instance of "+t.instanceClassName+" on element ["+this.id+"]");var e=t.create(this);this.instances.push(e),e._config(this,t),this._proxy&&(this._proxy[t.property]=e.proxy)}},A.prototype.remove=function(t){var e=this.instances.indexOf(t);e>-1&&this.instances.splice(e,1),this._proxy&&delete this._proxy[t.registration.property]},N.parent.get=function(){return this._parent},N.ascendants.get=function(){return[this.parent].concat(this.parent.ascendants)},N.children.get=function(){return this._children},N.descendants.get=function(){var t=[].concat(this._children);return this._children.forEach((function(e){return t.push.apply(t,e.descendants)})),t},A.prototype.addChild=function(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)},A.prototype.removeChild=function(t){var e=this._children.indexOf(t);if(-1===e)return null;t._parent=null,this._children.splice(e,1)},A.prototype.emit=function(t,e){for(var n=[],i=0,o=r.getModule("stage").collection;i<o.length;i+=1){var s=o[i];n.push.apply(n,s._emit(t,e))}return n},A.prototype._emit=function(t,e){for(var r=[],n=0,i=this.instances;n<i.length;n+=1){var o=i[n];r.push.apply(r,o._emitter.emit(t,e))}return r},A.prototype.ascend=function(t,e){return this._parent?this._parent._ascend(t,e):[]},A.prototype._ascend=function(t,e){for(var r=[],n=0,i=this.instances;n<i.length;n+=1){var o=i[n];r.push.apply(r,o._ascent.emit(t,e))}return this._parent&&r.push.apply(r,this._parent._ascend(t,e)),r},A.prototype.descend=function(t,e){for(var r=[],n=0,i=this._children;n<i.length;n+=1){var o=i[n];r.push.apply(r,o._descend(t,e))}return r},A.prototype._descend=function(t,e){for(var r=[],n=0,i=this.instances;n<i.length;n+=1){var o=i[n];r.push.apply(r,o._descent.emit(t,e))}for(var s=0,a=this._children;s<a.length;s+=1){var c=a[s];r.push.apply(r,c._descend(t,e))}return r},A.prototype.getInstance=function(t){for(var e=0,r=this.instances;e<r.length;e+=1){var n=r[e];if(n.registration.hasInstanceClassName(t))return n}return null},A.prototype.hasInstance=function(t){return null!==this.getInstance(t)},A.prototype.getDescendantInstances=function(t,e,r){if(!t)return[];for(var n=[],i=0,o=this._children;i<o.length;i+=1){var s=o[i],a=s.getInstance(t);a&&(n.push(a),r)||(e&&s.hasInstance(e)||!s.children.length||n.push.apply(n,s.getDescendantInstances(t,e,r)))}return n},A.prototype.getAscendantInstance=function(t,e){if(!t||!this._parent)return null;var r=this._parent.getInstance(t);return r||(e&&this._parent.hasInstance(e)?null:this._parent.getAscendantInstance(t,e))},A.prototype.dispose=function(){for(var t=this.instances.length-1;t>=0;t--){var e=this.instances[t];e&&e._dispose()}this.instances.length=0,r.remove("stage",this),this.parent.removeChild(this),this._children.length=0,h.debug("remove element ["+this.id+"] "+this.html)},A.prototype.prepare=function(t){-1===this.attributeNames.indexOf(t)&&this.attributeNames.push(t)},A.prototype.examine=function(){var t=this.attributeNames.slice();this.attributeNames.length=0;for(var e=this.instances.length-1;e>-1;e--)this.instances[e].examine(t)},Object.defineProperties(A.prototype,N);var C={CLICK:w.emission("root","click"),KEYDOWN:w.emission("root","keydown"),KEYUP:w.emission("root","keyup")},I={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}},L=function(t){return Object.values(I).filter((function(e){return e.value===t}))[0]},M=function(t){function e(){t.call(this,document.documentElement,"root"),this.node.setAttribute(w.attr("js"),!0),this.listen()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.listen=function(){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})},e.prototype.click=function(t){this.emit(C.CLICK,t.target)},e.prototype.keydown=function(t){this.emit(C.KEYDOWN,L(t.keyCode))},e.prototype.keyup=function(t){this.emit(C.KEYUP,L(t.keyCode))},e}(A),D=function(t){function e(){t.call(this,"stage"),this.root=new M,t.prototype.add.call(this,this.root),this.observer=new MutationObserver(this.mutate.bind(this)),this.modifications=[],this.willModify=!1,this.modifying=this.modify.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasElement=function(t){for(var e=0,r=this.collection;e<r.length;e+=1){if(r[e].node===t)return!0}return!1},e.prototype.getElement=function(t){for(var e=0,r=this.collection;e<r.length;e+=1){var n=r[e];if(n.node===t)return n}var i=new A(t);return this.add(i),h.debug("add element ["+i.id+"] "+i.html),i},e.prototype.getProxy=function(t){return this.hasElement(t)?this.getElement(t).proxy:null},e.prototype.add=function(e){t.prototype.add.call(this,e),this.put(e,this.root)},e.prototype.put=function(t,e){for(var r=0,n=e.children.length-1;n>-1;n--){var i=e.children[n],o=t.node.compareDocumentPosition(i.node);if(o&Node.DOCUMENT_POSITION_CONTAINS)return void this.put(t,i);if(o&Node.DOCUMENT_POSITION_CONTAINED_BY)e.removeChild(i),t.addChild(i,0);else if(o&Node.DOCUMENT_POSITION_PRECEDING){r=n+1;break}}e.addChild(t,r)},e.prototype.activate=function(){this.observer.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})},e.prototype.deactivate=function(){this.observer.disconnect()},e.prototype.mutate=function(t){var e=this,r=[];t.forEach((function(t){switch(t.type){case"childList":t.removedNodes.forEach((function(t){return e.dispose(t)})),t.addedNodes.forEach((function(t){return e.parse(t)}));break;case"attributes":if(e.hasElement(t.target)){var n=e.getElement(t.target);n.prepare(t.attributeName),-1===r.indexOf(n)&&r.push(n);for(var i=0,o=n.descendants;i<o.length;i+=1){var s=o[i];-1===r.indexOf(s)&&r.push(s)}}-1===e.modifications.indexOf(t.target)&&e.modifications.push(t.target)}})),r.forEach((function(t){return t.examine()})),this.modifications.length&&!this.willModify&&(this.willModify=!0,window.requestAnimationFrame(this.modifying))},e.prototype.modify=function(){this.willModify=!1;var t=this.modifications.slice();this.modifications.length=0;for(var e=0,r=t;e<r.length;e+=1){var n=r[e];document.documentElement.contains(n)&&this.parse(n)}},e.prototype.dispose=function(t){var e=[];this.forEach((function(r){t.contains(r.node)&&e.push(r)}));for(var r=0,n=e;r<n.length;r+=1){var i=n[r];i.dispose(),this.remove(i)}},e.prototype.parse=function(t,e,n){for(var i=[],o=0,s=e?[e]:r.getModule("register").collection;o<s.length;o+=1)for(var a=s[o],c=0,l=a.parse(t,n);c<l.length;c+=1){var u=l[c],p=this.getElement(u);p.project(a),-1===i.indexOf(p)&&i.push(p)}for(var h=0,f=i;h<f.length;h+=1){f[h].populate()}},e}(_),x=function(t){function e(){t.call(this,"render"),this.rendering=this.render.bind(this),this.nexts=new v}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){window.requestAnimationFrame(this.rendering)},e.prototype.request=function(t){this.nexts.add(t)},e.prototype.render=function(){if(r.isActive&&(window.requestAnimationFrame(this.rendering),this.forEach((function(t){return t.render()})),this.nexts.length)){var t=this.nexts.clone();this.nexts.clear(),t.forEach((function(t){return t.next()}))}},e}(_),R=function(t){function e(){t.call(this,"resize"),this.requireResize=!1,this.resizing=this.resize.bind(this);var e=this.request.bind(this);document.fonts&&document.fonts.ready.then(e),window.addEventListener("resize",e),window.addEventListener("orientationchange",e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){this.request()},e.prototype.request=function(){this.requireResize||(this.requireResize=!0,window.requestAnimationFrame(this.resizing))},e.prototype.resize=function(){this.requireResize&&(this.forEach((function(t){return t.resize()})),this.requireResize=!1)},e}(_),k=function(t){function e(){t.call(this,"lock"),this._isLocked=!1,this._scrollY=0,this.onPopulate=this.lock.bind(this),this.onEmpty=this.unlock.bind(this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={isLocked:{configurable:!0}};return r.isLocked.get=function(){return this._isLocked},e.prototype.lock=function(){if(!this._isLocked){this._isLocked=!0,this._scrollY=window.scrollY;var t=window.innerWidth-document.documentElement.clientWidth;document.documentElement.setAttribute(w.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")}},e.prototype.unlock=function(){this._isLocked&&(this._isLocked=!1,document.documentElement.removeAttribute(w.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"))},e.prototype.move=function(t){this._isLocked?(this._scrollY+=t,document.body.style.top=-this._scrollY+"px"):window.scrollTo(0,window.scrollY+t)},Object.defineProperties(e.prototype,r),e}(_),H=function(t){function e(){t.call(this,"load"),this.loading=this.load.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){window.addEventListener("load",this.loading)},e.prototype.load=function(){this.forEach((function(t){return t.load()}))},e}(_),G=["Marianne","Spectral"],$=function(t){function e(){t.call(this,"font-swap"),this.swapping=this.swap.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){document.fonts&&document.fonts.addEventListener("loadingdone",this.swapping)},e.prototype.swap=function(){var t=G.filter((function(t){return document.fonts.check("16px "+t)}));this.forEach((function(e){return e.swapFont(t)}))},e}(_),F=function(t){function e(){t.call(this,"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)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.listen=function(){this._isMoving||(this._isMoving=!0,this.requireMove=!1,document.documentElement.addEventListener("mousemove",this.requesting))},e.prototype.unlisten=function(){this._isMoving&&(this._isMoving=!1,this.requireMove=!1,document.documentElement.removeEventListener("mousemove",this.requesting))},e.prototype.request=function(t){this._isMoving&&(this.point={x:t.clientX,y:t.clientY},this.requireMove||(this.requireMove=!0,window.requestAnimationFrame(this.moving)))},e.prototype.move=function(){var t=this;this.requireMove&&(this.forEach((function(e){return e.mouseMove(t.point)})),this.requireMove=!1)},e}(_),U=function(t){function e(){t.call(this,"hash"),this.handling=this.handle.bind(this),this.getLocationHash()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={hash:{configurable:!0}};return e.prototype.activate=function(){window.addEventListener("hashchange",this.handling)},e.prototype.deactivate=function(){window.removeEventListener("hashchange",this.handling)},e.prototype._sanitize=function(t){return"#"===t.charAt(0)?t.substring(1):t},r.hash.set=function(t){var e=this._sanitize(t);this._hash!==e&&(window.location.hash=e)},r.hash.get=function(){return this._hash},e.prototype.getLocationHash=function(){var t=window.location.hash;this._hash=this._sanitize(t)},e.prototype.handle=function(t){var e=this;this.getLocationHash(),this.forEach((function(r){return r.handleHash(e._hash,t)}))},Object.defineProperties(e.prototype,r),e}(_),z=function(){r.create(T),r.create(D),r.create(x),r.create(R),r.create(k),r.create(H),r.create($),r.create(F),r.create(U);var t=r.getModule("register");this.register=t.register.bind(t)},B={isActive:{configurable:!0}};B.isActive.get=function(){return r.isActive},z.prototype.start=function(){h.debug("START"),r.isActive=!0},z.prototype.stop=function(){h.debug("STOP"),r.isActive=!1},Object.defineProperties(z.prototype,B);var W=new z,q=function(){};q.prototype.getColor=function(t,e,r,n){void 0===n&&(n={});var i="--"+t+"-"+e+"-"+r+V(n);return getComputedStyle(document.documentElement).getPropertyValue(i).trim()||null};var V=function(t){switch(!0){case t.hover:return"-hover";case t.active:return"-active";default:return""}},K=new q,Y=function(t){return"."===t.charAt(0)?t.substr(1):t},X=function(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=function(t,e,r){e=Y(e);var n=X(t),i=n.indexOf(e);!0===r?i>-1&&n.splice(i,1):-1===i&&n.push(e),t.className=n.join(" ")},J=function(t,e){return Q(t,e)},Z=function(t,e){return Q(t,e,!0)},tt=function(t,e){return X(t).indexOf(Y(e))>-1},et=['[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(),rt=function(t){return t.querySelectorAll(et)},nt=0,it=function(t){if(!document.getElementById(t))return t;for(var e=!0,r=t;e;)t=r+"-"+ ++nt,e=document.getElementById(t);return t},ot={addClass:J,hasClass:tt,removeClass:Z,queryParentSelector:E,querySelectorAllArray:S,queryActions:rt,uniqueId:it},st=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this._content=""},at={width:{configurable:!0},height:{configurable:!0},content:{configurable:!0}};at.width.get=function(){return this._width},at.width.set=function(t){this._width=t},at.height.get=function(){return this._height},at.height.set=function(t){this._height=t},at.content.get=function(){return this._content},at.content.set=function(t){this._content=t},st.prototype.getDataURI=function(t){void 0===t&&(t=!1);var 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=(e=(e=(e=e.replace(/</gi,"%3C")).replace(/>/gi,"%3E")).replace(/"/gi,"'")).replace(/{/gi,"%7B")).replace(/}/gi,"%7D")),"data:image/svg+xml;charset=utf8,"+e},Object.defineProperties(st.prototype,at);var ct={DataURISVG:st},lt={supportLocalStorage:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}},supportAspectRatio:function(){return!!window.CSS&&CSS.supports("aspect-ratio: 16 / 9")}},ut={TransitionSelector:{NONE:w.selector("transition-none")}},pt=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return e.forEach((function(e){var r=Object.keys(e).reduce((function(t,r){return t[r]=Object.getOwnPropertyDescriptor(e,r),t}),{});Object.getOwnPropertySymbols(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);n.enumerable&&(r[t]=n)})),Object.defineProperties(t,r)})),t},ht={completeAssign:pt},ft={},dt={};Object.defineProperty(dt,"isLegacy",{get:function(){return r.isLegacy}}),dt.setLegacy=function(){r.isLegacy=!0},ft.legacy=dt,ft.dom=ot,ft.image=ct,ft.support=lt,ft.motion=ut,ft.property=ht,ft.ns=w,ft.register=W.register,ft.state=r,ft.query=function(t){if(t&&t.search){var e=new URLSearchParams(window.location.search).entries();return Object.fromEntries(e)}return null}(window.location),Object.defineProperty(ft,"preventManipulation",{get:function(){return g.preventManipulation}}),Object.defineProperty(ft,"stage",{get:function(){return r.getModule("stage")}});var yt=function(t){return r.getModule("stage").getProxy(t)};yt.version=s,yt.prefix=n,yt.organisation=o,yt.Modes=d,Object.defineProperty(yt,"mode",{set:function(t){g.mode=t},get:function(){return g.mode}}),yt.internals=ft,yt.version=s,yt.start=W.start,yt.stop=W.stop,yt.inspector=h,yt.colors=K;var bt=window[i];yt.internals.configuration=bt,g.configure(bt,yt.start,yt.internals.query),window[i]=yt;var gt=function(){this.emissions={}};gt.prototype.add=function(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)},gt.prototype.remove=function(t,e){if(this.emissions[t])if(e){var r=this.emissions[t].indexOf(e);r>-1&&this.emissions[t].splice(r)}else delete this.emissions[t]},gt.prototype.emit=function(t,e){if(!this.emissions[t])return[];for(var r=[],n=0,i=this.emissions[t];n<i.length;n+=1){var o=i[n];o&&r.push(o(e))}return r},gt.prototype.dispose=function(){this.emissions=null};var vt=function(t,e){this.id=t,this.minWidth=e};vt.prototype.test=function(){return window.matchMedia("(min-width: "+this.minWidth+"em)").matches};var mt={XS:new vt("xs",0),SM:new vt("sm",36),MD:new vt("md",48),LG:new vt("lg",62),XL:new vt("xl",78)},_t=function(t){void 0===t&&(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 gt,this._ascent=new gt,this._descent=new gt,this._registrations=[],this._nexts=[]},wt={proxy:{configurable:!0},hash:{configurable:!0},isEnabled:{configurable:!0},isRendering:{configurable:!0},isResizing:{configurable:!0},isScrollLocked:{configurable:!0},isLoading:{configurable:!0},isSwappingFont:{configurable:!0},isMouseMoving:{configurable:!0},isDisposed:{configurable:!0},style:{configurable:!0},classNames:{configurable:!0},hasFocus:{configurable:!0},isLegacy:{configurable:!0}},St={instanceClassName:{configurable:!0}};St.instanceClassName.get=function(){return"Instance"},_t.prototype._config=function(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()},_t.prototype.init=function(){},wt.proxy.get=function(){var t=this;return pt({render:function(){return t.render()},resize:function(){return t.resize()}},{get node(){return this.node},get isEnabled(){return t.isEnabled},set isEnabled(e){t.isEnabled=e}})},_t.prototype.log=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.log.apply(h,t)},_t.prototype.debug=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.debug.apply(h,t)},_t.prototype.info=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.info.apply(h,t)},_t.prototype.warn=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.warn.apply(h,t)},_t.prototype.error=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.error.apply(h,t)},_t.prototype.register=function(t,e){var n=r.getModule("register").register(t,e,this);this._registrations.push(n)},_t.prototype.getRegisteredInstances=function(t){for(var e=0,r=this._registrations;e<r.length;e+=1){var n=r[e];if(n.hasInstanceClassName(t))return n.instances.collection}return[]},_t.prototype.dispatch=function(t,e,r,n){var i=new CustomEvent(t,{detail:e,bubble:!0===r,cancelable:!0===n});this.node.dispatchEvent(i)},_t.prototype.listen=function(t,e,r){this._listeners[t]||(this._listeners[t]=[]);var n=this._listeners[t],i=new Ot(this.node,t,e,r);n.push(i),i.listen()},_t.prototype.unlisten=function(t,e,r){var n=this;if(t){var i=this._listeners[t];if(i)if(e){var o=i.filter((function(t){return t.closure===e&&t.matchOptions(r)}));o.forEach((function(t){return t.unlisten()})),this._listeners[t]=i.filter((function(t){return-1===o.indexOf(t)}))}else i.forEach((function(e){return n.unlisten(t,e.closure)}))}else for(var s in this._listeners)this.unlisten(s)},_t.prototype.listenClick=function(t){this.listen("click",this._handlingClick,t)},_t.prototype.unlistenClick=function(t){this.unlisten("click",this._handlingClick,t)},_t.prototype.handleClick=function(t){},wt.hash.set=function(t){r.getModule("hash").hash=t},wt.hash.get=function(){return r.getModule("hash").hash},_t.prototype.listenHash=function(t,e){if(this._hashes){0===this._hashes.length&&r.add("hash",this);var n=new Tt(t,e);this._hashes=this._hashes.filter((function(e){return e.hash!==t})),this._hashes.push(n)}},_t.prototype.unlistenHash=function(t){this._hashes&&(this._hashes=this._hashes.filter((function(e){return e.hash!==t})),0===this._hashes.length&&r.remove("hash",this))},_t.prototype.handleHash=function(t,e){if(this._hashes)for(var r=0,n=this._hashes;r<n.length;r+=1){n[r].handle(t,e)}},_t.prototype.listenKey=function(t,e,r,n,i){void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i="down"),-1===this._keyListenerTypes.indexOf(i)&&(this.listen("key"+i,this.handlingKey),this._keyListenerTypes.push(i)),this._keys.push(new Et(i,t,e,r,n))},_t.prototype.unlistenKey=function(t,e){var r=this;this._keys=this._keys.filter((function(r){return r.code!==t||r.closure!==e})),this._keyListenerTypes.forEach((function(t){r._keys.some((function(e){return e.type===t}))||r.unlisten("key"+t,r.handlingKey)}))},_t.prototype.handleKey=function(t){for(var e=0,r=this._keys;e<r.length;e+=1){r[e].handle(t)}},wt.isEnabled.get=function(){return this._isEnabled},wt.isEnabled.set=function(t){this._isEnabled=t},wt.isRendering.get=function(){return this._isRendering},wt.isRendering.set=function(t){this._isRendering!==t&&(t?r.add("render",this):r.remove("render",this),this._isRendering=t)},_t.prototype.render=function(){},_t.prototype.request=function(t){this._nexts.push(t),r.getModule("render").request(this)},_t.prototype.next=function(){var t=this._nexts.slice();this._nexts.length=0;for(var e=0,r=t;e<r.length;e+=1){var n=r[e];n&&n()}},wt.isResizing.get=function(){return this._isResizing},wt.isResizing.set=function(t){this._isResizing!==t&&(t?(r.add("resize",this),this.resize()):r.remove("resize",this),this._isResizing=t)},_t.prototype.resize=function(){},_t.prototype.isBreakpoint=function(t){return!0==("string"==typeof t)?mt[t.toUpperCase()].test():t.test()},wt.isScrollLocked.get=function(){return this._isScrollLocked},wt.isScrollLocked.set=function(t){this._isScrollLocked!==t&&(t?r.add("lock",this):r.remove("lock",this),this._isScrollLocked=t)},wt.isLoading.get=function(){return this._isLoading},wt.isLoading.set=function(t){this._isLoading!==t&&(t?r.add("load",this):r.remove("load",this),this._isLoading=t)},_t.prototype.load=function(){},wt.isSwappingFont.get=function(){return this._isSwappingFont},wt.isSwappingFont.set=function(t){this._isSwappingFont!==t&&(t?r.add("font-swap",this):r.remove("font-swap",this),this._isSwappingFont=t)},_t.prototype.swapFont=function(){},wt.isMouseMoving.get=function(){return this._isMouseMoving},wt.isMouseMoving.set=function(t){this._isMouseMoving!==t&&(t?r.add("mouse-move",this):r.remove("mouse-move",this),this._isMouseMoving=t)},_t.prototype.mouseMove=function(t){},_t.prototype.examine=function(t){this.node.matches(this.registration.selector)?this.mutate(t):this._dispose()},_t.prototype.mutate=function(t){},_t.prototype.retrieveNodeId=function(t,e){if(t.id)return t.id;var r=it(this.id+"-"+e);return this.warn("add id '"+r+"' to "+e),t.setAttribute("id",r),r},wt.isDisposed.get=function(){return this._isDisposed},_t.prototype._dispose=function(){this.debug("dispose instance of "+this.registration.instanceClassName+" on element ["+this.element.id+"]"),this.removeAttribute(this.registration.attribute),this.unlisten(),r.remove("hash",this),this._hashes=null,this._keys=null,this.isRendering=!1,this.isResizing=!1,this._nexts=null,r.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(var t=0,e=this._registrations;t<e.length;t+=1){var n=e[t];r.remove("register",n)}this._registrations=null,this.registration.remove(this),this._isDisposed=!0,this.dispose()},_t.prototype.dispose=function(){},_t.prototype.emit=function(t,e){return this.element.emit(t,e)},_t.prototype.addEmission=function(t,e){this._emitter.add(t,e)},_t.prototype.removeEmission=function(t,e){this._emitter.remove(t,e)},_t.prototype.ascend=function(t,e){return this.element.ascend(t,e)},_t.prototype.addAscent=function(t,e){this._ascent.add(t,e)},_t.prototype.removeAscent=function(t,e){this._ascent.remove(t,e)},_t.prototype.descend=function(t,e){return this.element.descend(t,e)},_t.prototype.addDescent=function(t,e){this._descent.add(t,e)},_t.prototype.removeDescent=function(t,e){this._descent.remove(t,e)},wt.style.get=function(){return this.node.style},_t.prototype.addClass=function(t){J(this.node,t)},_t.prototype.removeClass=function(t){Z(this.node,t)},_t.prototype.hasClass=function(t){return tt(this.node,t)},wt.classNames.get=function(){return X(this.node)},_t.prototype.remove=function(){this.node.parentNode.removeChild(this.node)},_t.prototype.setAttribute=function(t,e){this.node.setAttribute(t,e)},_t.prototype.getAttribute=function(t){return this.node.getAttribute(t)},_t.prototype.hasAttribute=function(t){return this.node.hasAttribute(t)},_t.prototype.removeAttribute=function(t){this.node.removeAttribute(t)},_t.prototype.setProperty=function(t,e){this.node.style.setProperty(t,e)},_t.prototype.removeProperty=function(t){this.node.style.removeProperty(t)},_t.prototype.focus=function(){this.node.focus()},_t.prototype.blur=function(){this.node.blur()},_t.prototype.focusClosest=function(){var t=this._focusClosest(this.node.parentNode);t&&t.focus()},_t.prototype._focusClosest=function(t){if(!t)return null;var e=[].concat(rt(t));if(e.length<=1)return this._focusClosest(t.parentNode);var r=e.indexOf(this.node);return e[r+(r<e.length-1?1:-1)]},wt.hasFocus.get=function(){return this.node===document.activeElement},_t.prototype.scrollIntoView=function(){var t=this.getRect(),e=r.getModule("lock");t.top<0&&e.move(t.top-50),t.bottom>window.innerHeight&&e.move(t.bottom-window.innerHeight+50)},_t.prototype.matches=function(t){return this.node.matches(t)},_t.prototype.querySelector=function(t){return this.node.querySelector(t)},_t.prototype.querySelectorAll=function(t){return S(this.node,t)},_t.prototype.queryParentSelector=function(t){return E(this.node,t)},_t.prototype.getRect=function(){var t=this.node.getBoundingClientRect();return t.center=t.left+.5*t.width,t.middle=t.top+.5*t.height,t},wt.isLegacy.get=function(){return r.isLegacy},Object.defineProperties(_t.prototype,wt),Object.defineProperties(_t,St);var Et=function(t,e,r,n,i){this.type=t,this.eventType="key"+t,this.keyCode=e,this.closure=r,this.preventDefault=!0===n,this.stopPropagation=!0===i};Et.prototype.handle=function(t){t.type===this.eventType&&t.keyCode===this.keyCode.value&&(this.closure(t),this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation())};var Ot=function(t,e,r,n){this._node=t,this._type=e,this._closure=r,this._options=n},jt={closure:{configurable:!0}};jt.closure.get=function(){return this._closure},Ot.prototype.listen=function(){this._node.addEventListener(this._type,this._closure,this._options)},Ot.prototype.matchOptions=function(t){var e=this;switch(void 0===t&&(t=null),!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((function(r){return e._options[r]===t[r]})):return!0}return!1},Ot.prototype.unlisten=function(){this._node.removeEventListener(this._type,this._closure,this._options)},Object.defineProperties(Ot.prototype,jt);var Tt=function(t,e){this.hash=t,this.add=e};Tt.prototype.handle=function(t,e){this.hash===t&&this.add(e)};var Pt={DISCLOSE:w.event("disclose"),CONCEAL:w.event("conceal")},At={RESET:w.emission("disclosure","reset"),ADDED:w.emission("disclosure","added"),RETRIEVE:w.emission("disclosure","retrieve"),REMOVED:w.emission("disclosure","removed"),GROUP:w.emission("disclosure","group"),UNGROUP:w.emission("disclosure","ungroup"),SPOTLIGHT:w.emission("disclosure","spotlight")},Nt=function(t){function e(e,r,n,i){t.call(this),this.type=e,this._selector=r,this.DisclosureButtonInstanceClass=n,this.disclosuresGroupInstanceClassName=i,this.modifier=this._selector+"--"+this.type.id,this._isPristine=!0,this._isRetrievingPrimaries=!1,this._hasRetrieved=!1,this._primaryButtons=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={isEnabled:{configurable:!0},isPristine:{configurable:!0},proxy:{configurable:!0},buttons:{configurable:!0},group:{configurable:!0},isDisclosed:{configurable:!0},isInitiallyDisclosed:{configurable:!0},buttonHasFocus:{configurable:!0},hasFocus:{configurable:!0},primaryButtons:{configurable:!0}},n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"Disclosure"},e.prototype.init=function(){this.addDescent(At.RESET,this.reset.bind(this)),this.addDescent(At.GROUP,this.update.bind(this)),this.addDescent(At.UNGROUP,this.update.bind(this)),this.addAscent(At.SPOTLIGHT,this.disclose.bind(this)),this.register('[aria-controls="'+this.id+'"]',this.DisclosureButtonInstanceClass),this.ascend(At.ADDED),this.listenHash(this.id,this._spotlight.bind(this)),this.update()},r.isEnabled.get=function(){return t.prototype.isEnabled},r.isEnabled.set=function(e){this.isEnabled!==e&&(t.prototype.isEnabled=e,e?this.ascend(At.ADDED):this.ascend(At.REMOVED))},r.isPristine.get=function(){return this._isPristine},r.proxy.get=function(){var e=this,r=Object.assign.call(this,t.prototype.proxy,{disclose:e.disclose.bind(e),focus:e.focus.bind(e)});return this.type.canConceal&&(r.conceal=e.conceal.bind(e)),pt(r,{get buttons(){return e.buttons.map((function(t){return t.proxy}))},get group(){var t=e.group;return t?t.proxy:null},get isDisclosed(){return e.isDisclosed}})},r.buttons.get=function(){return this.getRegisteredInstances(this.DisclosureButtonInstanceClass.instanceClassName)},e.prototype.update=function(){this.getGroup(),this.retrievePrimaries()},e.prototype.getGroup=function(){if(this.disclosuresGroupInstanceClassName){var t=this.element.getAscendantInstance(this.disclosuresGroupInstanceClassName,this.constructor.instanceClassName);t&&t.validate(this)?this._group=t:this._group=null}else this._group=null},r.group.get=function(){return this._group},e.prototype.disclose=function(t){return!(!0===this.isDisclosed||!this.isEnabled)&&(this._isPristine=!1,this.isDisclosed=!0,!t&&this.group&&(this.group.current=this),!0)},e.prototype.conceal=function(t,e){return void 0===e&&(e=!0),!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(At.RESET),!0))},r.isDisclosed.get=function(){return this._isDisclosed},r.isDisclosed.set=function(t){if(this._isDisclosed!==t&&(this.isEnabled||!0!==t)){this.dispatch(t?Pt.DISCLOSE:Pt.CONCEAL,this.type),this._isDisclosed=t,t?this.addClass(this.modifier):this.removeClass(this.modifier);for(var e=0;e<this.buttons.length;e++)this.buttons[e].apply(t)}},r.isInitiallyDisclosed.get=function(){return this.primaryButtons.some((function(t){return t.isInitiallyDisclosed}))},e.prototype.hasRetrieved=function(){return this._hasRetrieved},e.prototype.reset=function(){},e.prototype.toggle=function(t){if(this.type.canConceal)switch(!0){case!t:case this.isDisclosed:this.conceal(!1,!1);break;default:this.disclose()}else this.disclose()},r.buttonHasFocus.get=function(){return this.buttons.some((function(t){return t.hasFocus}))},r.hasFocus.get=function(){return!!t.prototype.hasFocus||(!!this.buttonHasFocus||this.querySelectorAll(":focus").length>0)},e.prototype.focus=function(){this._primaryButtons.length>0&&this._primaryButtons[0].focus()},r.primaryButtons.get=function(){return this._primaryButtons},e.prototype.retrievePrimaries=function(){this._isRetrievingPrimaries||(this._isRetrievingPrimaries=!0,this.request(this._retrievePrimaries.bind(this)))},e.prototype._retrievePrimaries=function(){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()}},e.prototype.retrieved=function(){},e.prototype._spotlight=function(){var t=this;this.disclose(),this.request((function(){t.ascend(At.SPOTLIGHT)}))},e.prototype._electPrimaries=function(t){var e=this;return t.filter((function(t){return t.canDisclose&&!e.node.contains(t.node)}))},e.prototype.applyAbility=function(t){void 0===t&&(t=!1);var e=!this._primaryButtons.every((function(t){return t.isDisabled}));this.isEnabled!==e&&(this.isEnabled=e,t||(!this.isEnabled&&this.isDisclosed&&(this.group?this.ascend(At.REMOVED):this.type.canConceal&&this.conceal()),this.isEnabled&&(this.group&&this.ascend(At.ADDED),this.hash===this.id&&this._spotlight())))},e.prototype.dispose=function(){this._group=null,this._primaryButtons=null,t.prototype.dispose.call(this),this.ascend(At.REMOVED)},Object.defineProperties(e.prototype,r),Object.defineProperties(e,n),e}(_t),Ct=function(t){function e(e){t.call(this),this.type=e,this.attributeName=e.ariaState?"aria-"+e.id:w.attr(e.id),this._canDisclose=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={isPrimary:{configurable:!0},canDisclose:{configurable:!0},isDisabled:{configurable:!0},proxy:{configurable:!0},isDisclosed:{configurable:!0},isInitiallyDisclosed:{configurable:!0},dx:{configurable:!0},dy:{configurable:!0}},n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"DisclosureButton"},r.isPrimary.get=function(){return this.registration.creator.primaryButtons.includes(this)},r.canDisclose.get=function(){return this._canDisclose},r.isDisabled.get=function(){return this.type.canDisable&&this.hasAttribute("disabled")},e.prototype.init=function(){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()},r.proxy.get=function(){return Object.assign.call(this,t.prototype.proxy,{focus:this.focus.bind(this)})},e.prototype.handleClick=function(t){this.registration.creator&&this.registration.creator.toggle(this.canDisclose)},e.prototype.mutate=function(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())},e.prototype.apply=function(t){var e=this;this.canDisclose&&(this._isApplying=!0,this.setAttribute(this.attributeName,t),this.request((function(){e._isApplying=!1})))},r.isDisclosed.get=function(){return"true"===this.getAttribute(this.attributeName)},r.isInitiallyDisclosed.get=function(){return this._isInitiallyDisclosed},e.prototype.focus=function(){t.prototype.focus.call(this),this.scrollIntoView()},e.prototype.measure=function(t){var e=this.rect;this._dx=t.x-e.x,this._dy=t.y-e.y},r.dx.get=function(){return this._dx},r.dy.get=function(){return this._dy},Object.defineProperties(e.prototype,r),Object.defineProperties(e,n),e}(_t),It={PREVENT_CONCEAL:w.attr.selector("prevent-conceal"),GROUP:w.attr("group")},Lt=function(t){function e(e,r){t.call(this,r),this.disclosureInstanceClassName=e,this._members=[],this._index=-1,this._isRetrieving=!1,this._hasRetrieved=!1,this._isGrouped=!0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={proxy:{configurable:!0},members:{configurable:!0},length:{configurable:!0},index:{configurable:!0},current:{configurable:!0},hasFocus:{configurable:!0},isGrouped:{configurable:!0},canUngroup:{configurable:!0}},n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"DisclosuresGroup"},e.prototype.init=function(){this.addAscent(At.ADDED,this.update.bind(this)),this.addAscent(At.RETRIEVE,this.retrieve.bind(this)),this.addAscent(At.REMOVED,this.update.bind(this)),this.descend(At.GROUP),this._isGrouped="false"!==this.getAttribute(It.GROUP),this.update()},r.proxy.get=function(){var e=this,r={set index(t){e.index=t},get index(){return e.index},get length(){return e.length},get current(){var t=e.current;return t?t.proxy:null},get members(){return e.members.map((function(t){return t.proxy}))},get hasFocus(){return e.hasFocus},set isGrouped(t){e.isGrouped=t},get isGrouped(){return e.isGrouped}};return pt.call(this,t.prototype.proxy,r)},e.prototype.validate=function(t){return!0},e.prototype.getMembers=function(){var t=this,e=this.element.getDescendantInstances(this.disclosureInstanceClassName,this.constructor.instanceClassName,!0);this._members=e.filter(this.validate.bind(this)).filter((function(t){return t.isEnabled})),e.filter((function(e){return!t._members.includes(e)})).forEach((function(t){return t.conceal()}))},e.prototype.retrieve=function(t){void 0===t&&(t=!1),this._isRetrieving||this._hasRetrieved&&!t||(this._isRetrieving=!0,this.request(this._retrieve.bind(this)))},e.prototype._retrieve=function(){var t=this;if(this.getMembers(),this._isRetrieving=!1,this._hasRetrieved=!0,this.hash)for(var e=0;e<this.length;e++){var r=this.members[e];if(this.hash===r.id)return this.index=e,this.request((function(){t.ascend(At.SPOTLIGHT)})),e}for(var n=0;n<this.length;n++){if(this.members[n].isInitiallyDisclosed)return this.index=n,n}return this.getIndex()},e.prototype.update=function(){this.getMembers(),this._hasRetrieved&&this.getIndex()},r.members.get=function(){return this._members},r.length.get=function(){return this.members?this.members.length:0},e.prototype.getIndex=function(t){void 0===t&&(t=-1),this._index=void 0;for(var e=t,r=0;r<this.length;r++)if(this.members[r].isDisclosed){e=r;break}return this.index=e,e},r.index.get=function(){return this._index},r.index.set=function(t){if(!(t<-1||t>=this.length||t===this._index)){this._index=t;for(var e=0;e<this.length;e++){var r=this.members[e];t===e?r.isDisclosed||r.disclose(!0):!this.isGrouped&&this.canUngroup||!r.isDisclosed||r.conceal(!0)}this.apply()}},r.current.get=function(){return-1===this._index||isNaN(this._index)?null:this._members[this._index]||null},r.current.set=function(t){this.index=this.members.indexOf(t)},r.hasFocus.get=function(){var t=this.current;return!!t&&t.hasFocus},r.isGrouped.set=function(t){var e=!!t;this._isGrouped!==e&&(this._isGrouped=e,this.setAttribute(It.GROUP,!!t),this.update())},r.isGrouped.get=function(){return this._isGrouped},r.canUngroup.get=function(){return!1},e.prototype.mutate=function(t){t.includes(It.GROUP)&&(this.isGrouped="false"!==this.getAttribute(It.GROUP))},e.prototype.apply=function(){},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.descend(At.UNGROUP),this._members=null},Object.defineProperties(e.prototype,r),Object.defineProperties(e,n),e}(_t),Mt={EXPAND:{id:"expanded",ariaState:!0,ariaControls:!0,canConceal:!0,canDisable:!0},SELECT:{id:"selected",ariaState:!0,ariaControls:!0,canConceal:!1,canDis