@cfpb/cfpb-design-system 3.12.1 → 3.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -1
- package/dist/base/index.css +1 -1
- package/dist/base/index.css.map +2 -2
- package/dist/base/index.js +1 -1
- package/dist/base/index.js.map +1 -1
- package/dist/components/cfpb-buttons/index.css +1 -1
- package/dist/components/cfpb-buttons/index.css.map +2 -2
- package/dist/components/cfpb-buttons/index.js +1 -1
- package/dist/components/cfpb-buttons/index.js.map +1 -1
- package/dist/components/cfpb-expandables/index.css +1 -2
- package/dist/components/cfpb-expandables/index.css.map +3 -3
- package/dist/components/cfpb-expandables/index.js +1 -1
- package/dist/components/cfpb-expandables/index.js.map +4 -4
- package/dist/components/cfpb-forms/index.css +1 -2
- package/dist/components/cfpb-forms/index.css.map +3 -3
- package/dist/components/cfpb-forms/index.js +1 -1
- package/dist/components/cfpb-forms/index.js.map +4 -4
- package/dist/components/cfpb-icons/index.css +1 -1
- package/dist/components/cfpb-icons/index.css.map +2 -2
- package/dist/components/cfpb-icons/index.js +1 -1
- package/dist/components/cfpb-icons/index.js.map +1 -1
- package/dist/components/cfpb-layout/index.css +1 -1
- package/dist/components/cfpb-layout/index.css.map +2 -2
- package/dist/components/cfpb-layout/index.js +1 -1
- package/dist/components/cfpb-layout/index.js.map +1 -1
- package/dist/components/cfpb-notifications/index.css +1 -1
- package/dist/components/cfpb-notifications/index.css.map +2 -2
- package/dist/components/cfpb-notifications/index.js +1 -1
- package/dist/components/cfpb-notifications/index.js.map +1 -1
- package/dist/components/cfpb-pagination/index.css +1 -1
- package/dist/components/cfpb-pagination/index.css.map +2 -2
- package/dist/components/cfpb-pagination/index.js +1 -1
- package/dist/components/cfpb-pagination/index.js.map +1 -1
- package/dist/components/cfpb-tables/index.css +1 -1
- package/dist/components/cfpb-tables/index.css.map +2 -2
- package/dist/components/cfpb-tables/index.js +1 -1
- package/dist/components/cfpb-tables/index.js.map +1 -1
- package/dist/components/cfpb-tooltips/index.css +1 -2
- package/dist/components/cfpb-tooltips/index.css.map +3 -3
- package/dist/components/cfpb-tooltips/index.js +1 -1
- package/dist/components/cfpb-tooltips/index.js.map +4 -4
- package/dist/components/cfpb-typography/index.css +1 -1
- package/dist/components/cfpb-typography/index.css.map +2 -2
- package/dist/components/cfpb-typography/index.js +1 -1
- package/dist/components/cfpb-typography/index.js.map +1 -1
- package/dist/elements/cfpb-button/index.js +30 -0
- package/dist/elements/cfpb-button/index.js.map +7 -0
- package/dist/elements/cfpb-file-upload/index.js +39 -0
- package/dist/elements/cfpb-file-upload/index.js.map +7 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +2 -2
- package/dist/index.js +39 -1
- package/dist/index.js.map +4 -4
- package/dist/utilities/index.css +1 -2
- package/dist/utilities/index.css.map +3 -3
- package/dist/utilities/index.js +1 -1
- package/dist/utilities/index.js.map +4 -4
- package/package.json +1 -1
- package/src/components/cfpb-tooltips/index.js +1 -1
- package/src/elements/cfpb-button/cfpb-button.component.scss +8 -0
- package/src/elements/cfpb-button/index.js +54 -0
- package/src/elements/cfpb-file-upload/cfpb-file-upload.component.scss +14 -0
- package/src/elements/cfpb-file-upload/index.js +102 -0
- package/src/index.js +3 -0
- package/src/utilities/behavior/behavior.js +2 -1
- package/src/utilities/behavior/flyout-menu.js +4 -7
- package/src/utilities/transition/alpha-transition.js +2 -1
- package/src/utilities/transition/max-height-transition.js +2 -1
- package/src/utilities/transition/move-transition.js +2 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var sr=Object.defineProperty;var dr=Object.getOwnPropertySymbols;var Sr=Object.prototype.hasOwnProperty,Er=Object.prototype.propertyIsEnumerable;var cr=(a,e,r)=>e in a?sr(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r,_e=(a,e)=>{for(var r in e||(e={}))Sr.call(e,r)&&cr(a,r,e[r]);if(dr)for(var r of dr(e))Er.call(e,r)&&cr(a,r,e[r]);return a};var f=(a,e)=>{for(var r in e)sr(a,r,{get:e[r],enumerable:!0})};var we={};f(we,{default:()=>Dr});var Dr={};var ke={};f(ke,{default:()=>jr});var jr={};var Se={};f(Se,{default:()=>Or});var Or={};var Ee={};f(Ee,{default:()=>Ir});var Ir={};var Le={};f(Le,{default:()=>Mr});var Mr={};var De={};f(De,{default:()=>qr});var qr={};var Ae={};f(Ae,{default:()=>$r});var $r={};var je={};f(je,{default:()=>Hr});var Hr={};var Te={};f(Te,{default:()=>Gr});var Gr={};var Oe={};f(Oe,{default:()=>Ur});var Ur={};var ie={bpXS:{min:0,max:600},bpSM:{min:601,max:900},bpMED:{min:901,max:1020},bpLG:{min:1021,max:1200},bpXL:{min:1201}};function ne(){let a=getComputedStyle(document.body).fontSize;return a=a===""?-1:a,parseFloat(a)}function Pr(a,e){let r=a.min,i=a.max;ne()>0&&ne()!==16&&(r=r/16*ne(),i=i/16*ne());let t=r||0,l=i||Number.POSITIVE_INFINITY;return t<=e&&e<=l}function Xr(a){let e={};a=a||window.innerWidth;let r;for(r in ie)e[r]=Pr(ie[r],a);return e}var le="mobile",Kr="tablet",Jr="desktop";function ze(a){let e=!1,r=Xr();return(a===le&&r.bpXS||a===Kr&&r.bpSM||a===Jr&&(r.bpMED||r.bpLG||r.bpXL))&&(e=!0),e}var B="data-js-hook",de="behavior_",Ie="state_";function D(){let a={};function e(o,t){return{}.hasOwnProperty.call(a,o)?a[o].push(t):a[o]=[t],this}function r(o,t){if(!{}.hasOwnProperty.call(a,o))return this;let l=a[o].indexOf(t);return l!==-1&&a[o].splice(l,1),this}function i(o,t){if(!{}.hasOwnProperty.call(a,o))return this;t=t||{};let l=a[o];for(let c=0,s=l.length;c<s;c++)l[c].call(this,t);return this}return this.addEventListener=e,this.removeEventListener=r,this.dispatchEvent=i,this.getRegisteredEvents=()=>a,this}function Y(a,e){if(!a)return!1;let r=a.getAttribute(B);return r?(r=r.split(" "),r.indexOf(e)>-1):!1}function A(a,e){if(Y(a,e))return e;if(e.indexOf(" ")!==-1){let i=B+" values cannot contain spaces!";throw new Error(i)}let r=a.getAttribute(B);return r!==null&&(e=r+" "+e),a.setAttribute(B,e),e}var Be=Ie+"atomic_init";function Yr(a,e){if(!a||!a.classList){let r=a+' is not valid. Check that element is a DOM node with class "'+e+'"';throw new Error(r)}return a}function Wr(a,e){let r=a.classList.contains(e)?a:a.querySelector("."+e);if(!r){let i=e+" not found on or in passed DOM node.";throw new Error(i)}return r}function q(a,e){return Yr(a,e),Wr(a,e)}function M(a){return Y(a,Be)?!1:(A(a,Be),!0)}function C(a,e,r,i={}){let t=(r||document).querySelectorAll(a),l=[],c,s;for(let b=0,u=t.length;b<u;b++)s=t[b],Y(s,Be)===!1&&(c=new e(s),c.init(i),l.push(c));return l}var Me={};f(Me,{default:()=>Qr});var Qr={};var Ne={};f(Ne,{default:()=>ra});var ra={};var qe={};f(qe,{default:()=>ta});var ta={};var Ce={};f(Ce,{default:()=>ia});var ia={};var $e={};f($e,{default:()=>la});var la={};var Z="o-expandable";function P(a){let e=q(a,Z),r,i,o,t,l;function c(){if(!M(e))return this;r=e.querySelector(`.${Z}__header`),i=e.querySelector(`.${Z}__content`),o=e.querySelector(`.${Z}__label`);let u=e.classList.contains(`${Z}--onload-open`);A(e,"behavior_flyout-menu"),A(r,"behavior_flyout-menu_trigger"),A(i,"behavior_flyout-menu_content");let g=u?I.CLASSES.MH_DEFAULT:I.CLASSES.MH_ZERO;return t=new I(i).init(g),l=new X(e),l.setTransition(t,t.maxHeightZero,t.maxHeightDefault),l.init(u),l.addEventListener("expandbegin",()=>{i.classList.remove("u-hidden"),this.dispatchEvent("expandbegin",{target:this})}),l.addEventListener("collapseend",()=>{i.classList.add("u-hidden")}),this}function s(){return o.textContent.trim()}this.init=c,this.expand=()=>l.expand(),this.collapse=()=>l.collapse(),this.isExpanded=()=>l.isExpanded(),this.refresh=()=>l.getTransition().refresh(),this.getLabelText=s;let b=new D;return this.addEventListener=b.addEventListener,this.removeEventListener=b.removeEventListener,this.dispatchEvent=b.dispatchEvent,this}P.BASE_CLASS=Z;P.init=a=>C(`.${P.BASE_CLASS}`,P,a);var ce="o-expandable-group";function se(a){let e=q(a,ce),r=e.classList.contains(`${ce}--accordion`),i,o;function t(c){let s=c.target;o&&o!==s&&o.collapse(),o=s}function l(c){return M(e)?(r&&(i=c,i.forEach(s=>{s.addEventListener("expandbegin",t)})),this):this}return this.init=l,this}se.BASE_CLASS=ce;se.init=a=>{(a||document).querySelectorAll(`.${ce}`).forEach(i=>{let o=C(`.${P.BASE_CLASS}`,P,i);new se(i).init(o)})};var Q="o-summary";function ue(a){let e=q(a,Q),r=e.classList.contains(`${Q}--mobile`),i=e.querySelector(`.${Q}__content`),o=e.querySelector(`.${Q}__btn`),t,l,c;function s(){return M(e)?(window.addEventListener("load",b),this):this}function b(){window.removeEventListener("load",b),c=!x(),A(e,"behavior_flyout-menu"),A(i,"behavior_flyout-menu_content"),A(o,"behavior_flyout-menu_trigger"),l=new X(e,!1),t=new I(i),t.init(c?I.CLASSES.MH_SUMMARY:I.CLASSES.MH_DEFAULT),l.setTransition(t,t.maxHeightSummary,t.maxHeightDefault),l.addEventListener("triggerclick",j),l.init(),v(),window.addEventListener("resize",v),"onorientationchange"in window&&window.addEventListener("orientationchange",v),e.addEventListener("focusin",u),i.addEventListener("click",g)}function u(m){!c&&m.target!==o&&(o.click(),e.removeEventListener("focusin",u))}function g(m){m.target.tagName!=="A"&&l.isExpanded()&&t.refresh()}function v(){x()?G():H()}function x(){return r&&!ze(le)||i.scrollHeight<=88}function j(){l.addEventListener("expandend",S)}function S(){T(),window.removeEventListener("resize",v),window.removeEventListener("orientationchange",v),l.removeEventListener("expandend",S),l.suspend(),t.remove()}function E(){o.classList.remove("u-hidden")}function T(){o.classList.add("u-hidden")}function H(){return c&&(l.collapse(),t.animateOn(),E(),c=!1),!c}function G(){return c||(t.animateOff(),l.expand(),T(),c=!0),c}let z=new D;return this.addEventListener=z.addEventListener,this.removeEventListener=z.removeEventListener,this.dispatchEvent=z.dispatchEvent,this.init=s,this}ue.BASE_CLASS=Q;ue.init=a=>C(`.${Q}`,ue,a);var ee="o-summary-minimal";function he(a){let e=q(a,ee),r=e.querySelector(`.${ee}__content`),i=e.querySelector(`.${ee}__btn`),o,t;function l(){return M(e)?(A(e,"behavior_flyout-menu"),A(r,"behavior_flyout-menu_content"),A(i,"behavior_flyout-menu_trigger"),window.addEventListener("load",c),this):this}function c(){window.removeEventListener("load",c),t=new X(e,!1),o=new I(r),o.init(I.CLASSES.MH_SUMMARY),t.setTransition(o,o.maxHeightSummary,o.maxHeightDefault),t.init(),e.addEventListener("focusin",s),r.addEventListener("click",b),t.collapse(),o.animateOn()}function s(g){g.target!==i&&(i.click(),e.removeEventListener("focusin",s))}function b(g){g.target.tagName!=="A"&&t.isExpanded()&&o.refresh()}let u=new D;return this.addEventListener=u.addEventListener,this.removeEventListener=u.removeEventListener,this.dispatchEvent=u.dispatchEvent,this.init=l,this}he.BASE_CLASS=ee;he.init=a=>C(`.${ee}`,he,a);var Fe={};f(Fe,{default:()=>sa});var sa={};var He={};f(He,{default:()=>ha});var ha={};var Ve={};f(Ve,{default:()=>pa});var pa={};var Ge={};f(Ge,{default:()=>fa});var fa={};var Re={};f(Re,{default:()=>va});var va={};var Ue={};f(Ue,{default:()=>xa});var xa={};var Pe={};f(Pe,{default:()=>wa});var wa={};var Xe={};f(Xe,{default:()=>Sa});var Sa={};var Ke={};f(Ke,{default:()=>La});var La={};var Je={};f(Je,{default:()=>Aa});var Aa={};var Ye={};f(Ye,{default:()=>Ta});var Ta={};var We={};f(We,{default:()=>za});var za={};var Ze={};f(Ze,{default:()=>Ba});var Ba={};var Qe={};f(Qe,{default:()=>Na});var Na={};var er={};f(er,{default:()=>Ca});var Ca={};var rr={};f(rr,{default:()=>Fa});var Fa={};var ar={};f(ar,{default:()=>Va});var Va={};var tr={};f(tr,{default:()=>Ra});var Ra={};var or={};f(or,{default:()=>Pa});var Pa={};var ir={};f(ir,{default:()=>Ka});var Ka={};function be(a,e){let r;if(Y(a,e))return r=a,r;if(a){let i="["+B+"="+e+"]";r=a.querySelector(i)}if(!r){let i=e+" behavior not found on passed DOM node!";throw new Error(i)}return r}var Ja=Object.prototype.toString;var Ya=Array.isArray||function(e){return Ja.call(e)==="[object Array]"};function nr(){return!!new RegExp(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i).test(navigator.userAgent)}var re=de+"flyout-menu",Wa="["+B+"="+re;function X(a,e=!0){let r=be(a,re),i=H(a),o=be(a,re+"_content"),t=0,l=0,c=1,s=2,b=3,u,g,v,x=W.bind(this),j=R.bind(this),S,E=!0,T=!1;function H(n){let d=[],h=n.querySelectorAll(`${Wa}_trigger]`),p,k,U;for(let V=h.length>>>0;V--;){for(U=!1,p=h[V],k=p.parentElement;k!==n;)k.getAttribute(B)&&k.getAttribute(B).split(" ").indexOf(re)!==-1?(U=!0,k=n):k=k.parentElement;U||d.unshift(h[V])}return d}function G(n=!1){return t=n?b:l,i.forEach(d=>{z("expanded",d,n),d.addEventListener("click",y.bind(this)),d.addEventListener("touchstart",m,{passive:!0}),d.addEventListener("mouseover",w.bind(this)),d.addEventListener("mouseout",L.bind(this))}),o.setAttribute("data-open",n?"true":"false"),e&&!n&&o.setAttribute("hidden",""),oe(),this}function z(n,d,h){let p=String(h);return d.setAttribute("aria-"+n,p),p}function m(){T=!0}function w(n){E||(T||this.dispatchEvent("triggerover",{target:this,trigger:n.target,type:"triggerover"}),T=!1)}function L(n){E||this.dispatchEvent("triggerout",{target:this,trigger:n.target,type:"triggerout"})}function y(n){if(!E)switch(this.dispatchEvent("triggerclick",{target:this,trigger:n.target,type:"triggerclick"}),n.preventDefault(),t){case l:case c:this.expand();break;case s:case b:this.collapse();break}}function O(){if(u==null||u.halt(),t===s||t===b)return this;if(t=s,e&&o.removeAttribute("hidden"),this.dispatchEvent("expandbegin",{target:this,type:"expandbegin"}),!g||!v)return j(),this;let n=u==null?void 0:u.isAnimated();return n&&u.addEventListener(_.END_EVENT,j),g(),n||j(),this}function N(){if(u==null||u.halt(),t===c||t===l)return this;for(let d=0,h=i.length;d<h;d++)z("expanded",i[d],!1);if(o.setAttribute("data-open","false"),t=c,this.dispatchEvent("collapsebegin",{target:this,type:"collapsebegin"}),!v||!g)return x(),this;let n=u==null?void 0:u.isAnimated();return n&&u.addEventListener(_.END_EVENT,x),v(),n||x(),this}function R(){t=b,o.setAttribute("data-open","true"),u&&u.removeEventListener(_.END_EVENT,j),this.dispatchEvent("expandend",{target:this,type:"expandend"});for(let n=0,d=i.length;n<d;n++)z("expanded",i[n],!0)}function W(){t=l,e&&o.setAttribute("hidden",""),u&&u.removeEventListener(_.END_EVENT,x),this.dispatchEvent("collapseend",{target:this,type:"collapseend"})}function te(n,d,h){u=n,d&&d!==v&&(v=d),h&&h!==g&&(g=h)}function ge(){u&&u.remove();let n;u=n,g=n,v=n}function ve(){return{container:r,content:o,trigger:i}}function oe(){return E&&(E=!1),!E}function ye(){return E||(E=!0),E}function xe(n){return S=n,this}let J=new D;return this.addEventListener=J.addEventListener,this.removeEventListener=J.removeEventListener,this.dispatchEvent=J.dispatchEvent,this.init=G,this.expand=O,this.collapse=N,this.setTransition=te,this.clearTransition=ge,this.getData=()=>S,this.getTransition=()=>u,this.getDom=ve,this.isAnimating=()=>t===s||t===c,this.isExpanded=()=>t===b,this.resume=oe,this.setData=xe,this.suspend=ye,X.BASE_CLASS=re,this}var pe={CSS_PROPERTY:"opacity",BASE_CLASS:"u-alpha-transition",ALPHA_100:"u-alpha-100",ALPHA_0:"u-alpha-0"};function pr(a){let e=new D,r=new _(a,pe,this);function i(l){return r.init(l),this}function o(){return r.applyClass(pe.ALPHA_100),this}function t(){return r.applyClass(pe.ALPHA_0),this}return this.addEventListener=e.addEventListener,this.dispatchEvent=e.dispatchEvent,this.removeEventListener=e.removeEventListener,this.animateOff=r.animateOff,this.animateOn=r.animateOn,this.halt=r.halt,this.isAnimated=r.isAnimated,this.remove=r.remove,this.setElement=r.setElement,this.fadeIn=o,this.fadeOut=t,this.init=i,this}pr.CLASSES=pe;function _(a,e,r){let i=e,o=a;if(!r)throw new Error("Child transition argument must be defined!");let t=r,l,c,s,b=!1,u=!1,g=!1;if(typeof i.CSS_PROPERTY=="undefined"||typeof i.BASE_CLASS=="undefined")throw new Error("Transitions require CSS_PROPERTY and BASE_CLASS to be passed into BaseTransition.");function v(){c&&b?(o.addEventListener(c,s),t.dispatchEvent(_.BEGIN_EVENT,{target:t,type:_.BEGIN_EVENT}),o.classList.add(_.ANIMATING_CLASS),u=!0):(t.dispatchEvent(_.BEGIN_EVENT,{target:t,type:_.BEGIN_EVENT}),s())}function x(){o.removeEventListener(c,s)}function j(y){return y&&y.propertyName!==i.CSS_PROPERTY?!1:(x(),o.classList.remove(_.ANIMATING_CLASS),t.dispatchEvent(_.END_EVENT,{target:t,type:_.END_EVENT}),u=!1,!0)}function S(){let y;for(y in i)({}).hasOwnProperty.call(i,y)&&i[y]!==i.BASE_CLASS&&o.classList.contains(i[y])&&o.classList.remove(i[y])}function E(){u&&(o.style.webkitTransitionDuration="0",o.style.mozTransitionDuration="0",o.style.oTransitionDuration="0",o.style.transitionDuration="0",o.removeEventListener(c,s),s(),o.style.webkitTransitionDuration="",o.style.mozTransitionDuration="",o.style.oTransitionDuration="",o.style.transitionDuration="")}function T(){E(),S(),o.classList.remove(i.BASE_CLASS)}function H(){o.classList.remove(_.NO_ANIMATION_CLASS),b=!0}function G(){o.classList.add(_.NO_ANIMATION_CLASS),b=!1}function z(y){if(!y){let W="Element does not have TransitionEnd event. It may be null!";throw new Error(W)}let O,N={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},R;for(R in N)if({}.hasOwnProperty.call(N,R)&&typeof y.style[R]!="undefined"){O=N[R];break}return O}function m(y){T(),H(),o=y,o.classList.add(i.BASE_CLASS),c=z(o)}function w(y){if(b=!o.classList.contains(_.NO_ANIMATION_CLASS),s=j.bind(this),m(o),!y)throw new Error("Transition needs to be passed an initial CSS class on initialization!");return o.classList.add(y),this}function L(y){return g||(S(),g=!0),o.classList.contains(y)?!1:(x(),o.classList.remove(l),l=y,v(),o.classList.add(l),!0)}return this.animateOff=G,this.animateOn=H,this.applyClass=L,this.halt=E,this.init=w,this.isAnimated=()=>b,this.remove=T,this.setElement=m,this}_.BEGIN_EVENT="transitionbegin";_.END_EVENT="transitionend";_.NO_ANIMATION_CLASS="u-no-animation";_.ANIMATING_CLASS="u-is-animating";var ae={CSS_PROPERTY:"max-height",BASE_CLASS:"u-max-height-transition",MH_DEFAULT:"u-max-height-default",MH_SUMMARY:"u-max-height-summary",MH_ZERO:"u-max-height-zero"};function I(a){let e=new D,r=new _(a,ae,this),i=0;function o(){let v=a.scrollHeight+"px";a.style.maxHeight=v}function t(){window.removeEventListener("load",t),o()}function l(g){return r.init(g),window.addEventListener("load",t),window.addEventListener("resize",()=>{o()}),this}function c(){return o(),r.applyClass(ae.MH_DEFAULT),(!i||a.scrollHeight>i)&&(i=a.scrollHeight),this}function s(){return r.applyClass(ae.MH_SUMMARY),i=a.scrollHeight,this}function b(){return r.applyClass(ae.MH_ZERO),i=a.scrollHeight,this}function u(){return a.style.maxHeight="",r.remove()}return this.addEventListener=e.addEventListener,this.dispatchEvent=e.dispatchEvent,this.removeEventListener=e.removeEventListener,this.animateOff=r.animateOff,this.animateOn=r.animateOn,this.halt=r.halt,this.isAnimated=r.isAnimated,this.setElement=r.setElement,this.refresh=o,this.remove=u,this.init=l,this.maxHeightDefault=c,this.maxHeightSummary=s,this.maxHeightZero=b,this}I.CLASSES=ae;var K={CSS_PROPERTY:"transform",BASE_CLASS:"u-move-transition",MOVE_TO_ORIGIN:"u-move-to-origin",MOVE_LEFT:"u-move-left",MOVE_LEFT_2X:"u-move-left-2x",MOVE_LEFT_3X:"u-move-left-3x",MOVE_RIGHT:"u-move-right",MOVE_UP:"u-move-up"};function mr(a){let e=new D,r=new _(a,K,this);function i(s){return r.init(s),this}function o(){return r.applyClass(K.MOVE_TO_ORIGIN),this}function t(s){s=s||1;let b=[K.MOVE_LEFT,K.MOVE_LEFT_2X,K.MOVE_LEFT_3X];return r.applyClass(b[s-1]),this}function l(){return r.applyClass(K.MOVE_RIGHT),this}function c(){return r.applyClass(K.MOVE_UP),this}return this.addEventListener=e.addEventListener,this.dispatchEvent=e.dispatchEvent,this.removeEventListener=e.removeEventListener,this.animateOff=r.animateOff,this.animateOn=r.animateOn,this.halt=r.halt,this.isAnimated=r.isAnimated,this.setElement=r.setElement,this.remove=r.remove,this.init=i,this.moveLeft=()=>t(1),this.moveLeft2=()=>t(2),this.moveLeft3=()=>t(3),this.moveRight=l,this.moveToOrigin=o,this.moveUp=c,this}mr.CLASSES=K;var Qa;function et(a){return a.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")}function rt(a,e){return RegExp(et(e.trim()),"i").test(a)}function at(a,e,r){let i=a,o=e,t=(r==null?void 0:r.maxSelections)||5,l=[],c=[],s=[],b=[],u=-1;function g(m){return o+"-"+m.value.trim().replace(/\s+/g,"-").toLowerCase()}function v(){return c.length>=t}function x(m){let w,L=[],y=!1;for(let O=0,N=m.length;O<N;O++)w=m[O],y=v()?!1:w.defaultSelected,L.push({id:g(w),value:w.value,text:w.text,checked:y}),y&&c.push(O);return L}function j(){return l=x(i),this}function S(m){return l[m].checked=!l[m].checked,c.length<t&&l[m].checked?(c.push(m),c.sort(),!0):(l[m].checked=!1,c=c.filter(function(w){return w!==m}),!1)}function E(m,w,L,y){return rt(w.text,y)&&m.push(L),m}function T(m){return Object.prototype.toString.call(m)!=="[object String]"&&(m=""),b=s,l.length>0&&(s=l.reduce(function(w,L,y){return E(w,L,y,m)},[])),u=-1,s}function H(m){return l[m]}function G(m){let w=s.length,L=w===0?l.length:w;m<0?u=-1:m>=L?u=L-1:u=m}function z(){return u}return this.init=j,this.toggleOption=S,this.getSelectedIndices=function(){return c},this.isAtMaxSelections=v,this.filterIndices=T,this.clearFilter=function(){return s=b=[],Qa},this.getFilterIndices=function(){return s},this.getLastFilterIndices=function(){return b},this.getIndex=z,this.setIndex=G,this.resetIndex=function(){return u=-1,u},this.getOption=H,this}var fr=at;function $(a,e,r){let i=document.createElement(a);return Object.keys(r).forEach(o=>{let t=r[o];o in i?i[o]=t:i.setAttribute(o,t)}),e&&e.appendChild(i),i}var gr='<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="cf-icon-svg cf-icon-svg--error" viewBox="0 0 12 19"><path d="M11.383 13.644A1.03 1.03 0 0 1 9.928 15.1L6 11.172 2.072 15.1a1.03 1.03 0 1 1-1.455-1.456l3.928-3.928L.617 5.79a1.03 1.03 0 1 1 1.455-1.456L6 8.261l3.928-3.928a1.03 1.03 0 0 1 1.455 1.456L7.455 9.716z"/></svg>';var lt=gr,F="o-multiselect",dt="a-checkbox",ct="a-text-input",vr="prev",me="next",lr="Enter",st=" ",yr="Escape",ut="ArrowUp",xr="ArrowDown",_r="Tab",wr={renderTags:!0,maxSelections:5};function fe(a){a.classList.add(F);let e=q(a,F),r=!1,i,o,t,l,c,s,b,u,g,v,x,j=[],S;function E(){x.classList.remove("u-no-results"),x.classList.add("u-filtered");let n=t.getLastFilterIndices();for(let d=0,h=n.length;d<h;d++)j[n[d]].classList.remove("u-filter-match");n=t.getFilterIndices();for(let d=0,h=n.length;d<h;d++)j[n[d]].classList.add("u-filter-match")}function T(){x.classList.remove("u-filtered","u-no-results");for(let n=0,d=x.children.length;n<d;n++)x.children[n].classList.remove("u-filter-match");t.clearFilter()}function H(){x.classList.add("u-no-results"),x.classList.remove("u-filtered")}function G(n){return n.length>0?(E(),!0):(H(),!1)}function z(n){T(),t.resetIndex();let d=t.filterIndices(n);G(d)}function m(){return s.classList.add("u-active"),v.classList.remove("u-invisible"),v.setAttribute("aria-hidden",!1),S.dispatchEvent("expandbegin",{target:S}),S}function w(){return s.classList.remove("u-active"),v.classList.add("u-invisible"),v.setAttribute("aria-hidden",!0),t.resetIndex(),S.dispatchEvent("collapsebegin",{target:S}),S}function L(n){n===me?t.setIndex(t.getIndex()+1):n===vr&&t.setIndex(t.getIndex()-1);let d=t.getIndex();if(d>-1){let h=d,p=t.getFilterIndices();p.length>0&&(h=p[d]);let U=t.getOption(h).value,kr=x.querySelector('[data-option="'+U+'"]').querySelector("input");r=!0,kr.focus()}else r=!1,g.focus()}function y(){g.value="",T()}function O(n){let d=n.target;d.tagName==="BUTTON"&&(n.preventDefault(),d.removeEventListener("click",O),d.querySelector("label").click())}function N(n){if(n.key===st||n.key===lr){let d=n.target.querySelector("label");x.querySelector("#"+d.getAttribute("for")).click()}}function R(n){return i+"-"+n.value.trim().replace(/[^\w]/g,"-").toLowerCase()}function W(n,d){let h=R(d),p=$("li",null,{"data-option":d.value}),k=$("button",p,{type:"button",class:"a-tag-filter",innerHTML:"<label for="+h+">"+d.text+lt+"</label>"});n.appendChild(p),k.addEventListener("click",O),k.addEventListener("keydown",N)}function te(n){let d=t.getOption(n)||t.getOption(t.getIndex());if(d){if(d.checked){x.classList.contains("u-max-selections")&&x.classList.remove("u-max-selections");let h='[data-option="'+d.value+'"]',p=b.querySelector(h);typeof p!="undefined"&&p&&(b==null||b.removeChild(p))}else c!=null&&c.renderTags&&b&&W(b,d);t.toggleOption(n),t.isAtMaxSelections()&&x.classList.add("u-max-selections"),S.dispatchEvent("selectionsupdated",{target:S})}t.resetIndex(),r=!1,v.getAttribute("aria-hidden")==="false"&&g.focus()}function ge(n){te(Number(n.target.getAttribute("data-index"))),y()}function ve(){u.addEventListener("mousemove",function(h){let p=h.target;h.offsetX>p.offsetWidth-35?p.style.cursor="pointer":p.style.cursor="auto"}),u.addEventListener("mouseup",function(h){let p=h.target;h.offsetX>p.offsetWidth-35&&v.offsetHeight===140&&g.blur()}),g.addEventListener("input",function(){z(this.value)}),g.addEventListener("focus",function(){v.getAttribute("aria-hidden")==="true"&&m()}),g.addEventListener("blur",function(){!r&&v.getAttribute("aria-hidden")==="false"&&w()}),g.addEventListener("keydown",function(h){let p=h.key;v.getAttribute("aria-hidden")==="true"&&p!==_r&&m(),p===lr?(h.preventDefault(),L(me)):p===yr?(y(),w()):p===xr?L(me):p===_r&&!h.shiftKey&&v.getAttribute("aria-hidden")==="false"&&w()}),x.addEventListener("mousedown",function(){r=!0}),x.addEventListener("keydown",function(h){let p=h.key,k=h.target,U=k.checked;if(p===lr){h.preventDefault(),k.checked=!U;let V=new Event("change",{bubbles:!1,cancelable:!0});k.dispatchEvent(V)}else p===yr?(g.focus(),w()):p===ut?L(vr):p===xr&&L(me)}),v.addEventListener("mousedown",function(h){h.target.tagName==="LABEL"&&(r=!0)});let n=x.querySelectorAll("input");for(let h=0,p=n.length;h<p;h++)n[h].addEventListener("change",ge);let d=b.querySelectorAll("button");for(let h=0,p=d.length;h<p;h++)d[h].addEventListener("click",O),d[h].addEventListener("keydown",N)}function oe(){s=document.createElement("div"),s.className=F,b=$("ul",null,{className:"m-tag-group"}),u=$("header",s,{className:F+"__header"}),g=$("input",u,{className:F+"__search "+ct,type:"text",placeholder:o||"Select up to five",id:e.id,autocomplete:"off"}),v=$("fieldset",s,{className:F+"__fieldset u-invisible","aria-hidden":"true"});let n=F+"__options";t.isAtMaxSelections()&&(n+=" u-max-selections"),x=$("ul",v,{className:n});let d,h,p;for(let k=0,U=l.length;k<U;k++){d=l[k],h=R(d),p=t.getOption(k).checked;let V=$("li",x,{"data-option":d.value,"data-cy":"multiselect-option",class:"m-form-field m-form-field--checkbox"});$("input",V,{id:h,type:"checkbox",value:d.value,name:i,class:dt+" "+F+"__checkbox",checked:p,"data-index":k}),$("label",V,{for:h,textContent:d.text,className:F+"__label a-label"}),j.push(V),p&&(c!=null&&c.renderTags)&&W(b,d)}return s.insertBefore(b,u),e.parentNode.insertBefore(s,e),s.appendChild(e),s}function ye(n=wr){if(!M(e))return this;if(nr())return this;if(S=this,i=e.name||e.id,o=e.getAttribute("placeholder"),l=e.options||[],c=_e(_e({},wr),n),l.length>0){t=new fr(l,i,c).init();let d=oe();e.parentNode.removeChild(e),e=d,M(e),ve()}return this}function xe(){return t}this.init=ye,this.expand=m,this.collapse=w;let J=new D;return this.addEventListener=J.addEventListener,this.removeEventListener=J.removeEventListener,this.dispatchEvent=J.dispatchEvent,this.getModel=xe,this.updateSelections=te,this.selectionClickHandler=O,this.selectionKeyDownHandler=N,this}fe.BASE_CLASS=F;fe.init=a=>C(`.${F}`,fe,void 0,a);})();
|
|
1
|
+
(()=>{var ve=Object.defineProperty;var ge=Object.getOwnPropertySymbols;var Be=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var me=(t,r,e)=>r in t?ve(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,J=(t,r)=>{for(var e in r||(r={}))Be.call(r,e)&&me(t,e,r[e]);if(ge)for(var e of ge(r))Pe.call(r,e)&&me(t,e,r[e]);return t};var O=(t,r)=>{for(var e in r)ve(t,e,{get:r[e],enumerable:!0})};var W={};O(W,{default:()=>Fe});var Fe={};var Q={};O(Q,{default:()=>ze});var ze={};var ee={};O(ee,{default:()=>Ve});var Ve={};var te={};O(te,{default:()=>Ue});var Ue={};var re={};O(re,{default:()=>Ge});var Ge={};var ae={};O(ae,{default:()=>qe});var qe={};var oe={};O(oe,{default:()=>$e});var $e={};var ie={};O(ie,{default:()=>We});var We={};var ne={};O(ne,{default:()=>et});var et={};var le={};O(le,{default:()=>rt});var rt={};var N="data-js-hook",K="behavior_",ce="state_";function T(){let t={};function r(a,o){return{}.hasOwnProperty.call(t,a)?t[a].push(o):t[a]=[o],this}function e(a,o){if(!{}.hasOwnProperty.call(t,a))return this;let u=t[a].indexOf(o);return u!==-1&&t[a].splice(u,1),this}function n(a,o){if(!{}.hasOwnProperty.call(t,a))return this;o=o||{};let u=t[a];for(let s=0,d=u.length;s<d;s++)u[s].call(this,o);return this}return this.addEventListener=r,this.removeEventListener=e,this.dispatchEvent=n,this.getRegisteredEvents=()=>t,this}function R(t,r){if(!t)return!1;let e=t.getAttribute(N);return e?(e=e.split(" "),e.indexOf(r)>-1):!1}function de(t,r){if(R(t,r))return r;if(r.indexOf(" ")!==-1){let n=N+" values cannot contain spaces!";throw new Error(n)}let e=t.getAttribute(N);return e!==null&&(r=e+" "+r),t.setAttribute(N,r),r}var se=ce+"atomic_init";function at(t,r){if(!t||!t.classList){let e=t+' is not valid. Check that element is a DOM node with class "'+r+'"';throw new Error(e)}return t}function ot(t,r){let e=t.classList.contains(r)?t:t.querySelector("."+r);if(!e){let n=r+" not found on or in passed DOM node.";throw new Error(n)}return e}function ue(t,r){return at(t,r),ot(t,r)}function G(t){return R(t,se)?!1:(de(t,se),!0)}function fe(t,r,e,n={}){let o=(e||document).querySelectorAll(t),u=[],s,d;for(let h=0,x=o.length;h<x;h++)d=o[h],R(d,se)===!1&&(s=new r(d),s.init(n),u.push(s));return u}var it=Object.prototype.toString;var nt=Array.isArray||function(r){return it.call(r)==="[object Array]"};function pe(){return!!new RegExp(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i).test(navigator.userAgent)}function g(t,r,e){let n=r,a=t;if(!e)throw new Error("Child transition argument must be defined!");let o=e,u,s,d,h=!1,x=!1,w=!1;if(typeof n.CSS_PROPERTY=="undefined"||typeof n.BASE_CLASS=="undefined")throw new Error("Transitions require CSS_PROPERTY and BASE_CLASS to be passed into BaseTransition.");function y(){s&&h?(a.addEventListener(s,d),o.dispatchEvent(g.BEGIN_EVENT,{target:o,type:g.BEGIN_EVENT}),a.classList.add(g.ANIMATING_CLASS),x=!0):(o.dispatchEvent(g.BEGIN_EVENT,{target:o,type:g.BEGIN_EVENT}),d())}function m(){a.removeEventListener(s,d)}function C(b){return b&&b.propertyName!==n.CSS_PROPERTY?!1:(m(),a.classList.remove(g.ANIMATING_CLASS),o.dispatchEvent(g.END_EVENT,{target:o,type:g.END_EVENT}),x=!1,!0)}function k(){let b;for(b in n)({}).hasOwnProperty.call(n,b)&&n[b]!==n.BASE_CLASS&&a.classList.contains(n[b])&&a.classList.remove(n[b])}function P(){x&&(a.style.webkitTransitionDuration="0",a.style.mozTransitionDuration="0",a.style.oTransitionDuration="0",a.style.transitionDuration="0",a.removeEventListener(s,d),d(),a.style.webkitTransitionDuration="",a.style.mozTransitionDuration="",a.style.oTransitionDuration="",a.style.transitionDuration="")}function D(){P(),k(),a.classList.remove(n.BASE_CLASS)}function H(){a.classList.remove(g.NO_ANIMATION_CLASS),h=!0}function z(){a.classList.add(g.NO_ANIMATION_CLASS),h=!1}function j(b){if(!b){let U="Element does not have TransitionEnd event. It may be null!";throw new Error(U)}let L,I={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},B;for(B in I)if({}.hasOwnProperty.call(I,B)&&typeof b.style[B]!="undefined"){L=I[B];break}return L}function p(b){D(),H(),a=b,a.classList.add(n.BASE_CLASS),s=j(a)}function v(b){if(h=!a.classList.contains(g.NO_ANIMATION_CLASS),d=C.bind(this),p(a),!b)throw new Error("Transition needs to be passed an initial CSS class on initialization!");return a.classList.add(b),this}function _(b){return w||(k(),w=!0),a.classList.contains(b)?!1:(m(),a.classList.remove(u),u=b,y(),a.classList.add(u),!0)}return this.animateOff=z,this.animateOn=H,this.applyClass=_,this.halt=P,this.init=v,this.isAnimated=()=>h,this.remove=D,this.setElement=p,this}g.BEGIN_EVENT="transitionbegin";g.END_EVENT="transitionend";g.NO_ANIMATION_CLASS="u-no-animation";g.ANIMATING_CLASS="u-is-animating";var dt=K+"flyout-menu",Gt="["+N+"="+dt;var Y={CSS_PROPERTY:"opacity",BASE_CLASS:"u-alpha-transition",ALPHA_100:"u-alpha-100",ALPHA_0:"u-alpha-0"};function xe(t){let r=new T,e=new g(t,Y,this);function n(u){return e.init(u),this}function a(){return e.applyClass(Y.ALPHA_100),this}function o(){return e.applyClass(Y.ALPHA_0),this}return this.addEventListener=r.addEventListener,this.dispatchEvent=r.dispatchEvent,this.removeEventListener=r.removeEventListener,this.animateOff=e.animateOff,this.animateOn=e.animateOn,this.halt=e.halt,this.isAnimated=e.isAnimated,this.remove=e.remove,this.setElement=e.setElement,this.fadeIn=a,this.fadeOut=o,this.init=n,this}xe.CLASSES=Y;var X={CSS_PROPERTY:"max-height",BASE_CLASS:"u-max-height-transition",MH_DEFAULT:"u-max-height-default",MH_SUMMARY:"u-max-height-summary",MH_ZERO:"u-max-height-zero"};function ye(t){let r=new T,e=new g(t,X,this),n=0;function a(){let y=t.scrollHeight+"px";t.style.maxHeight=y}function o(){window.removeEventListener("load",o),a()}function u(w){return e.init(w),window.addEventListener("load",o),window.addEventListener("resize",()=>{a()}),this}function s(){return a(),e.applyClass(X.MH_DEFAULT),(!n||t.scrollHeight>n)&&(n=t.scrollHeight),this}function d(){return e.applyClass(X.MH_SUMMARY),n=t.scrollHeight,this}function h(){return e.applyClass(X.MH_ZERO),n=t.scrollHeight,this}function x(){return t.style.maxHeight="",e.remove()}return this.addEventListener=r.addEventListener,this.dispatchEvent=r.dispatchEvent,this.removeEventListener=r.removeEventListener,this.animateOff=e.animateOff,this.animateOn=e.animateOn,this.halt=e.halt,this.isAnimated=e.isAnimated,this.setElement=e.setElement,this.refresh=a,this.remove=x,this.init=u,this.maxHeightDefault=s,this.maxHeightSummary=d,this.maxHeightZero=h,this}ye.CLASSES=X;var M={CSS_PROPERTY:"transform",BASE_CLASS:"u-move-transition",MOVE_TO_ORIGIN:"u-move-to-origin",MOVE_LEFT:"u-move-left",MOVE_LEFT_2X:"u-move-left-2x",MOVE_LEFT_3X:"u-move-left-3x",MOVE_RIGHT:"u-move-right",MOVE_UP:"u-move-up"};function we(t){let r=new T,e=new g(t,M,this);function n(d){return e.init(d),this}function a(){return e.applyClass(M.MOVE_TO_ORIGIN),this}function o(d){d=d||1;let h=[M.MOVE_LEFT,M.MOVE_LEFT_2X,M.MOVE_LEFT_3X];return e.applyClass(h[d-1]),this}function u(){return e.applyClass(M.MOVE_RIGHT),this}function s(){return e.applyClass(M.MOVE_UP),this}return this.addEventListener=r.addEventListener,this.dispatchEvent=r.dispatchEvent,this.removeEventListener=r.removeEventListener,this.animateOff=e.animateOff,this.animateOn=e.animateOn,this.halt=e.halt,this.isAnimated=e.isAnimated,this.setElement=e.setElement,this.remove=e.remove,this.init=n,this.moveLeft=()=>o(1),this.moveLeft2=()=>o(2),this.moveLeft3=()=>o(3),this.moveRight=u,this.moveToOrigin=a,this.moveUp=s,this}we.CLASSES=M;var st;function ut(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")}function ft(t,r){return RegExp(ut(r.trim()),"i").test(t)}function pt(t,r,e){let n=t,a=r,o=(e==null?void 0:e.maxSelections)||5,u=[],s=[],d=[],h=[],x=-1;function w(p){return a+"-"+p.value.trim().replace(/\s+/g,"-").toLowerCase()}function y(){return s.length>=o}function m(p){let v,_=[],b=!1;for(let L=0,I=p.length;L<I;L++)v=p[L],b=y()?!1:v.defaultSelected,_.push({id:w(v),value:v.value,text:v.text,checked:b}),b&&s.push(L);return _}function C(){return u=m(n),this}function k(p){return u[p].checked=!u[p].checked,s.length<o&&u[p].checked?(s.push(p),s.sort(),!0):(u[p].checked=!1,s=s.filter(function(v){return v!==p}),!1)}function P(p,v,_,b){return ft(v.text,b)&&p.push(_),p}function D(p){return Object.prototype.toString.call(p)!=="[object String]"&&(p=""),h=d,u.length>0&&(d=u.reduce(function(v,_,b){return P(v,_,b,p)},[])),x=-1,d}function H(p){return u[p]}function z(p){let v=d.length,_=v===0?u.length:v;p<0?x=-1:p>=_?x=_-1:x=p}function j(){return x}return this.init=C,this.toggleOption=k,this.getSelectedIndices=function(){return s},this.isAtMaxSelections=y,this.filterIndices=D,this.clearFilter=function(){return d=h=[],st},this.getFilterIndices=function(){return d},this.getLastFilterIndices=function(){return h},this.getIndex=j,this.setIndex=z,this.resetIndex=function(){return x=-1,x},this.getOption=H,this}var _e=pt;function S(t,r,e){let n=document.createElement(t);return Object.keys(e).forEach(a=>{let o=e[a];a in n?n[a]=o:n.setAttribute(a,o)}),r&&r.appendChild(n),n}var ke='<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="cf-icon-svg cf-icon-svg--error" viewBox="0 0 12 19"><path d="M11.383 13.644A1.03 1.03 0 0 1 9.928 15.1L6 11.172 2.072 15.1a1.03 1.03 0 1 1-1.455-1.456l3.928-3.928L.617 5.79a1.03 1.03 0 1 1 1.455-1.456L6 8.261l3.928-3.928a1.03 1.03 0 0 1 1.455 1.456L7.455 9.716z"/></svg>';var vt=ke,A="o-multiselect",xt="a-checkbox",yt="a-text-input",Ee="prev",q="next",be="Enter",wt=" ",Le="Escape",_t="ArrowUp",Se="ArrowDown",Ae="Tab",Oe={renderTags:!0,maxSelections:5};function Z(t){t.classList.add(A);let r=ue(t,A),e=!1,n,a,o,u,s,d,h,x,w,y,m,C=[],k;function P(){m.classList.remove("u-no-results"),m.classList.add("u-filtered");let l=o.getLastFilterIndices();for(let i=0,c=l.length;i<c;i++)C[l[i]].classList.remove("u-filter-match");l=o.getFilterIndices();for(let i=0,c=l.length;i<c;i++)C[l[i]].classList.add("u-filter-match")}function D(){m.classList.remove("u-filtered","u-no-results");for(let l=0,i=m.children.length;l<i;l++)m.children[l].classList.remove("u-filter-match");o.clearFilter()}function H(){m.classList.add("u-no-results"),m.classList.remove("u-filtered")}function z(l){return l.length>0?(P(),!0):(H(),!1)}function j(l){D(),o.resetIndex();let i=o.filterIndices(l);z(i)}function p(){return d.classList.add("u-active"),y.classList.remove("u-invisible"),y.setAttribute("aria-hidden",!1),k.dispatchEvent("expandbegin",{target:k}),k}function v(){return d.classList.remove("u-active"),y.classList.add("u-invisible"),y.setAttribute("aria-hidden",!0),o.resetIndex(),k.dispatchEvent("collapsebegin",{target:k}),k}function _(l){l===q?o.setIndex(o.getIndex()+1):l===Ee&&o.setIndex(o.getIndex()-1);let i=o.getIndex();if(i>-1){let c=i,f=o.getFilterIndices();f.length>0&&(c=f[i]);let V=o.getOption(c).value,De=m.querySelector('[data-option="'+V+'"]').querySelector("input");e=!0,De.focus()}else e=!1,w.focus()}function b(){w.value="",D()}function L(l){let i=l.target;i.tagName==="BUTTON"&&(l.preventDefault(),i.removeEventListener("click",L),i.querySelector("label").click())}function I(l){if(l.key===wt||l.key===be){let i=l.target.querySelector("label");m.querySelector("#"+i.getAttribute("for")).click()}}function B(l){return n+"-"+l.value.trim().replace(/[^\w]/g,"-").toLowerCase()}function U(l,i){let c=B(i),f=S("li",null,{"data-option":i.value}),E=S("button",f,{type:"button",class:"a-tag-filter",innerHTML:"<label for="+c+">"+i.text+vt+"</label>"});l.appendChild(f),E.addEventListener("click",L),E.addEventListener("keydown",I)}function he(l){let i=o.getOption(l)||o.getOption(o.getIndex());if(i){if(i.checked){m.classList.contains("u-max-selections")&&m.classList.remove("u-max-selections");let c='[data-option="'+i.value+'"]',f=h.querySelector(c);typeof f!="undefined"&&f&&(h==null||h.removeChild(f))}else s!=null&&s.renderTags&&h&&U(h,i);o.toggleOption(l),o.isAtMaxSelections()&&m.classList.add("u-max-selections"),k.dispatchEvent("selectionsupdated",{target:k})}o.resetIndex(),e=!1,y.getAttribute("aria-hidden")==="false"&&w.focus()}function Te(l){he(Number(l.target.getAttribute("data-index"))),b()}function Ie(){x.addEventListener("mousemove",function(c){let f=c.target;c.offsetX>f.offsetWidth-35?f.style.cursor="pointer":f.style.cursor="auto"}),x.addEventListener("mouseup",function(c){let f=c.target;c.offsetX>f.offsetWidth-35&&y.offsetHeight===140&&w.blur()}),w.addEventListener("input",function(){j(this.value)}),w.addEventListener("focus",function(){y.getAttribute("aria-hidden")==="true"&&p()}),w.addEventListener("blur",function(){!e&&y.getAttribute("aria-hidden")==="false"&&v()}),w.addEventListener("keydown",function(c){let f=c.key;y.getAttribute("aria-hidden")==="true"&&f!==Ae&&p(),f===be?(c.preventDefault(),_(q)):f===Le?(b(),v()):f===Se?_(q):f===Ae&&!c.shiftKey&&y.getAttribute("aria-hidden")==="false"&&v()}),m.addEventListener("mousedown",function(){e=!0}),m.addEventListener("keydown",function(c){let f=c.key,E=c.target,V=E.checked;if(f===be){c.preventDefault(),E.checked=!V;let F=new Event("change",{bubbles:!1,cancelable:!0});E.dispatchEvent(F)}else f===Le?(w.focus(),v()):f===_t?_(Ee):f===Se&&_(q)}),y.addEventListener("mousedown",function(c){c.target.tagName==="LABEL"&&(e=!0)});let l=m.querySelectorAll("input");for(let c=0,f=l.length;c<f;c++)l[c].addEventListener("change",Te);let i=h.querySelectorAll("button");for(let c=0,f=i.length;c<f;c++)i[c].addEventListener("click",L),i[c].addEventListener("keydown",I)}function Ne(){d=document.createElement("div"),d.className=A,h=S("ul",null,{className:"m-tag-group"}),x=S("header",d,{className:A+"__header"}),w=S("input",x,{className:A+"__search "+yt,type:"text",placeholder:a||"Select up to five",id:r.id,autocomplete:"off"}),y=S("fieldset",d,{className:A+"__fieldset u-invisible","aria-hidden":"true"});let l=A+"__options";o.isAtMaxSelections()&&(l+=" u-max-selections"),m=S("ul",y,{className:l});let i,c,f;for(let E=0,V=u.length;E<V;E++){i=u[E],c=B(i),f=o.getOption(E).checked;let F=S("li",m,{"data-option":i.value,"data-cy":"multiselect-option",class:"m-form-field m-form-field--checkbox"});S("input",F,{id:c,type:"checkbox",value:i.value,name:n,class:xt+" "+A+"__checkbox",checked:f,"data-index":E}),S("label",F,{for:c,textContent:i.text,className:A+"__label a-label"}),C.push(F),f&&(s!=null&&s.renderTags)&&U(h,i)}return d.insertBefore(h,x),r.parentNode.insertBefore(d,r),d.appendChild(r),d}function Me(l=Oe){if(!G(r))return this;if(pe())return this;if(k=this,n=r.name||r.id,a=r.getAttribute("placeholder"),u=r.options||[],s=J(J({},Oe),l),u.length>0){o=new _e(u,n,s).init();let i=Ne();r.parentNode.removeChild(r),r=i,G(r),Ie()}return this}function Ce(){return o}this.init=Me,this.expand=p,this.collapse=v;let $=new T;return this.addEventListener=$.addEventListener,this.removeEventListener=$.removeEventListener,this.dispatchEvent=$.dispatchEvent,this.getModel=Ce,this.updateSelections=he,this.selectionClickHandler=L,this.selectionKeyDownHandler=I,this}Z.BASE_CLASS=A;Z.init=t=>fe(`.${A}`,Z,void 0,t);})();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|