@cfpb/cfpb-design-system 3.11.0 → 3.12.0
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 +75 -52
- 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 -1
- package/dist/components/cfpb-expandables/index.css.map +2 -2
- package/dist/components/cfpb-expandables/index.js +1 -1
- package/dist/components/cfpb-expandables/index.js.map +1 -1
- package/dist/components/cfpb-forms/index.css +1 -1
- package/dist/components/cfpb-forms/index.css.map +2 -2
- package/dist/components/cfpb-forms/index.js +1 -1
- package/dist/components/cfpb-forms/index.js.map +1 -1
- 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 -1
- package/dist/components/cfpb-tooltips/index.css.map +2 -2
- package/dist/components/cfpb-tooltips/index.js +1 -1
- package/dist/components/cfpb-tooltips/index.js.map +1 -1
- 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/index.css +1 -1
- package/dist/index.css.map +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utilities/index.css +1 -1
- package/dist/utilities/index.css.map +2 -2
- package/dist/utilities/index.js +1 -1
- package/dist/utilities/index.js.map +1 -1
- package/package.json +1 -1
- package/src/abstracts/vars.scss +40 -37
- package/src/components/cfpb-forms/form-alert.scss +8 -6
- package/src/components/cfpb-forms/form-field.scss +70 -154
- package/src/components/cfpb-forms/multiselect.scss +1 -1
- package/src/components/cfpb-forms/text-input.scss +34 -98
- package/src/utilities/utilities.scss +15 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var ct=Object.defineProperty;var lt=Object.getOwnPropertySymbols;var St=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var dt=(a,e,t)=>e in a?ct(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,_e=(a,e)=>{for(var t in e||(e={}))St.call(e,t)&&dt(a,t,e[t]);if(lt)for(var t of lt(e))Et.call(e,t)&&dt(a,t,e[t]);return a};var g=(a,e)=>{for(var t in e)ct(a,t,{get:e[t],enumerable:!0})};var we={};g(we,{default:()=>Dt});var Dt={};var ke={};g(ke,{default:()=>jt});var jt={};var Se={};g(Se,{default:()=>Ot});var Ot={};var Ee={};g(Ee,{default:()=>It});var It={};var Le={};g(Le,{default:()=>Mt});var Mt={};var De={};g(De,{default:()=>qt});var qt={};var Ae={};g(Ae,{default:()=>$t});var $t={};var je={};g(je,{default:()=>Ht});var Ht={};var Te={};g(Te,{default:()=>Gt});var Gt={};var Oe={};g(Oe,{default:()=>Ut});var Ut={};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 Pt(a,e){let t=a.min,i=a.max;ne()>0&&ne()!==16&&(t=t/16*ne(),i=i/16*ne());let r=t||0,s=i||Number.POSITIVE_INFINITY;return r<=e&&e<=s}function Xt(a){let e={};a=a||window.innerWidth;let t;for(t in ie)e[t]=Pt(ie[t],a);return e}var se="mobile",Kt="tablet",Jt="desktop";function ze(a){let e=!1,t=Xt();return(a===se&&t.bpXS||a===Kt&&t.bpSM||a===Jt&&(t.bpMED||t.bpLG||t.bpXL))&&(e=!0),e}var B="data-js-hook",le="behavior_",Ie="state_";function D(){let a={};function e(o,r){return{}.hasOwnProperty.call(a,o)?a[o].push(r):a[o]=[r],this}function t(o,r){if(!{}.hasOwnProperty.call(a,o))return this;let s=a[o].indexOf(r);return s!==-1&&a[o].splice(s,1),this}function i(o,r){if(!{}.hasOwnProperty.call(a,o))return this;r=r||{};let s=a[o];for(let d=0,c=s.length;d<c;d++)s[d].call(this,r);return this}return this.addEventListener=e,this.removeEventListener=t,this.dispatchEvent=i,this.getRegisteredEvents=()=>a,this}function Y(a,e){if(!a)return!1;let t=a.getAttribute(B);return t?(t=t.split(" "),t.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 t=a.getAttribute(B);return t!==null&&(e=t+" "+e),a.setAttribute(B,e),e}var Be=Ie+"atomic_init";function Yt(a,e){if(!a||!a.classList){let t=a+' is not valid. Check that element is a DOM node with class "'+e+'"';throw new Error(t)}return a}function Wt(a,e){let t=a.classList.contains(e)?a:a.querySelector("."+e);if(!t){let i=e+" not found on or in passed DOM node.";throw new Error(i)}return t}function q(a,e){return Yt(a,e),Wt(a,e)}function M(a){return Y(a,Be)?!1:(A(a,Be),!0)}function C(a,e,t,i={}){let r=(t||document).querySelectorAll(a),s=[],d,c;for(let p=0,m=r.length;p<m;p++)c=r[p],Y(c,Be)===!1&&(d=new e(c),d.init(i),s.push(d));return s}var Me={};g(Me,{default:()=>Qt});var Qt={};var Ne={};g(Ne,{default:()=>ta});var ta={};var qe={};g(qe,{default:()=>ra});var ra={};var Ce={};g(Ce,{default:()=>ia});var ia={};var $e={};g($e,{default:()=>sa});var sa={};var Z="o-expandable";function P(a){let e=q(a,Z),t,i,o,r,s;function d(){if(!M(e))return this;t=e.querySelector(`.${Z}__header`),i=e.querySelector(`.${Z}__content`),o=e.querySelector(`.${Z}__label`);let m=e.classList.contains(`${Z}--onload-open`);A(e,"behavior_flyout-menu"),A(t,"behavior_flyout-menu_trigger"),A(i,"behavior_flyout-menu_content");let f=m?I.CLASSES.MH_DEFAULT:I.CLASSES.MH_ZERO;return r=new I(i).init(f),s=new X(e),s.setTransition(r,r.maxHeightZero,r.maxHeightDefault),s.init(m),s.addEventListener("expandbegin",()=>{i.classList.remove("u-hidden"),this.dispatchEvent("expandbegin",{target:this})}),s.addEventListener("collapseend",()=>{i.classList.add("u-hidden")}),this}function c(){return o.textContent.trim()}this.init=d,this.expand=()=>s.expand(),this.collapse=()=>s.collapse(),this.isExpanded=()=>s.isExpanded(),this.refresh=()=>s.getTransition().refresh(),this.getLabelText=c;let p=new D;return this.addEventListener=p.addEventListener,this.removeEventListener=p.removeEventListener,this.dispatchEvent=p.dispatchEvent,this}P.BASE_CLASS=Z;P.init=a=>C(`.${P.BASE_CLASS}`,P,a);var de="o-expandable-group";function ce(a){let e=q(a,de),t=e.classList.contains(`${de}--accordion`),i,o;function r(d){let c=d.target;o&&o!==c&&o.collapse(),o=c}function s(d){return M(e)?(t&&(i=d,i.forEach(c=>{c.addEventListener("expandbegin",r)})),this):this}return this.init=s,this}ce.BASE_CLASS=de;ce.init=a=>{(a||document).querySelectorAll(`.${de}`).forEach(i=>{let o=C(`.${P.BASE_CLASS}`,P,i);new ce(i).init(o)})};var Q="o-summary";function me(a){let e=q(a,Q),t=e.classList.contains(`${Q}--mobile`),i=e.querySelector(`.${Q}__content`),o=e.querySelector(`.${Q}__btn`),r,s,d;function c(){return M(e)?(window.addEventListener("load",p),this):this}function p(){window.removeEventListener("load",p),d=!x(),A(e,"behavior_flyout-menu"),A(i,"behavior_flyout-menu_content"),A(o,"behavior_flyout-menu_trigger"),s=new X(e,!1),r=new I(i),r.init(d?I.CLASSES.MH_SUMMARY:I.CLASSES.MH_DEFAULT),s.setTransition(r,r.maxHeightSummary,r.maxHeightDefault),s.addEventListener("triggerclick",j),s.init(),v(),window.addEventListener("resize",v),"onorientationchange"in window&&window.addEventListener("orientationchange",v),e.addEventListener("focusin",m),i.addEventListener("click",f)}function m(b){!d&&b.target!==o&&(o.click(),e.removeEventListener("focusin",m))}function f(b){b.target.tagName!=="A"&&s.isExpanded()&&r.refresh()}function v(){x()?G():H()}function x(){return t&&!ze(se)||i.scrollHeight<=88}function j(){s.addEventListener("expandend",S)}function S(){T(),window.removeEventListener("resize",v),window.removeEventListener("orientationchange",v),s.removeEventListener("expandend",S),s.suspend(),r.remove()}function E(){o.classList.remove("u-hidden")}function T(){o.classList.add("u-hidden")}function H(){return d&&(s.collapse(),r.animateOn(),E(),d=!1),!d}function G(){return d||(r.animateOff(),s.expand(),T(),d=!0),d}let z=new D;return this.addEventListener=z.addEventListener,this.removeEventListener=z.removeEventListener,this.dispatchEvent=z.dispatchEvent,this.init=c,this}me.BASE_CLASS=Q;me.init=a=>C(`.${Q}`,me,a);var ee="o-summary-minimal";function he(a){let e=q(a,ee),t=e.querySelector(`.${ee}__content`),i=e.querySelector(`.${ee}__btn`),o,r;function s(){return M(e)?(A(e,"behavior_flyout-menu"),A(t,"behavior_flyout-menu_content"),A(i,"behavior_flyout-menu_trigger"),window.addEventListener("load",d),this):this}function d(){window.removeEventListener("load",d),r=new X(e,!1),o=new I(t),o.init(I.CLASSES.MH_SUMMARY),r.setTransition(o,o.maxHeightSummary,o.maxHeightDefault),r.init(),e.addEventListener("focusin",c),t.addEventListener("click",p),r.collapse(),o.animateOn()}function c(f){f.target!==i&&(i.click(),e.removeEventListener("focusin",c))}function p(f){f.target.tagName!=="A"&&r.isExpanded()&&o.refresh()}let m=new D;return this.addEventListener=m.addEventListener,this.removeEventListener=m.removeEventListener,this.dispatchEvent=m.dispatchEvent,this.init=s,this}he.BASE_CLASS=ee;he.init=a=>C(`.${ee}`,he,a);var Fe={};g(Fe,{default:()=>ca});var ca={};var He={};g(He,{default:()=>ha});var ha={};var Ve={};g(Ve,{default:()=>ua});var ua={};var Ge={};g(Ge,{default:()=>ga});var ga={};var Re={};g(Re,{default:()=>va});var va={};var Ue={};g(Ue,{default:()=>xa});var xa={};var Pe={};g(Pe,{default:()=>wa});var wa={};var Xe={};g(Xe,{default:()=>Sa});var Sa={};var Ke={};g(Ke,{default:()=>La});var La={};var Je={};g(Je,{default:()=>Aa});var Aa={};var Ye={};g(Ye,{default:()=>Ta});var Ta={};var We={};g(We,{default:()=>za});var za={};var Ze={};g(Ze,{default:()=>Ba});var Ba={};var Qe={};g(Qe,{default:()=>Na});var Na={};var et={};g(et,{default:()=>Ca});var Ca={};var tt={};g(tt,{default:()=>Fa});var Fa={};var at={};g(at,{default:()=>Va});var Va={};var rt={};g(rt,{default:()=>Ra});var Ra={};var ot={};g(ot,{default:()=>Pa});var Pa={};var it={};g(it,{default:()=>Ka});var Ka={};function pe(a,e){let t;if(Y(a,e))return t=a,t;if(a){let i="["+B+"="+e+"]";t=a.querySelector(i)}if(!t){let i=e+" behavior not found on passed DOM node!";throw new Error(i)}return t}var Ja=Object.prototype.toString;var Ya=Array.isArray||function(e){return Ja.call(e)==="[object Array]"};function nt(){return!!new RegExp(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i).test(navigator.userAgent)}var te=le+"flyout-menu",Wa="["+B+"="+te;function X(a,e=!0){let t=pe(a,te),i=H(a),o=pe(a,te+"_content"),r=0,s=0,d=1,c=2,p=3,m,f,v,x=W.bind(this),j=R.bind(this),S,E=!0,T=!1;function H(n){let l=[],h=n.querySelectorAll(`${Wa}_trigger]`),u,k,U;for(let V=h.length>>>0;V--;){for(U=!1,u=h[V],k=u.parentElement;k!==n;)k.getAttribute(B)&&k.getAttribute(B).split(" ").indexOf(te)!==-1?(U=!0,k=n):k=k.parentElement;U||l.unshift(h[V])}return l}function G(n=!1){return r=n?p:s,i.forEach(l=>{z("expanded",l,n),l.addEventListener("click",y.bind(this)),l.addEventListener("touchstart",b,{passive:!0}),l.addEventListener("mouseover",w.bind(this)),l.addEventListener("mouseout",L.bind(this))}),o.setAttribute("data-open",n?"true":"false"),e&&!n&&o.setAttribute("hidden",""),oe(),this}function z(n,l,h){let u=String(h);return l.setAttribute("aria-"+n,u),u}function b(){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(),r){case s:case d:this.expand();break;case c:case p:this.collapse();break}}function O(){if(m==null||m.halt(),r===c||r===p)return this;if(r=c,e&&o.removeAttribute("hidden"),this.dispatchEvent("expandbegin",{target:this,type:"expandbegin"}),!f||!v)return j(),this;let n=m==null?void 0:m.isAnimated();return n&&m.addEventListener(_.END_EVENT,j),f(),n||j(),this}function N(){if(m==null||m.halt(),r===d||r===s)return this;for(let l=0,h=i.length;l<h;l++)z("expanded",i[l],!1);if(o.setAttribute("data-open","false"),r=d,this.dispatchEvent("collapsebegin",{target:this,type:"collapsebegin"}),!v||!f)return x(),this;let n=m==null?void 0:m.isAnimated();return n&&m.addEventListener(_.END_EVENT,x),v(),n||x(),this}function R(){r=p,o.setAttribute("data-open","true"),m&&m.removeEventListener(_.END_EVENT,j),this.dispatchEvent("expandend",{target:this,type:"expandend"});for(let n=0,l=i.length;n<l;n++)z("expanded",i[n],!0)}function W(){r=s,e&&o.setAttribute("hidden",""),m&&m.removeEventListener(_.END_EVENT,x),this.dispatchEvent("collapseend",{target:this,type:"collapseend"})}function re(n,l,h){m=n,l&&l!==v&&(v=l),h&&h!==f&&(f=h)}function fe(){m&&m.remove();let n;m=n,f=n,v=n}function ve(){return{container:t,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=re,this.clearTransition=fe,this.getData=()=>S,this.getTransition=()=>m,this.getDom=ve,this.isAnimating=()=>r===c||r===d,this.isExpanded=()=>r===p,this.resume=oe,this.setData=xe,this.suspend=ye,X.BASE_CLASS=te,this}var ue={CSS_PROPERTY:"opacity",BASE_CLASS:"u-alpha-transition",ALPHA_100:"u-alpha-100",ALPHA_0:"u-alpha-0"};function ut(a){let e=new D,t=new _(a,ue,this);function i(s){return t.init(s),this}function o(){return t.applyClass(ue.ALPHA_100),this}function r(){return t.applyClass(ue.ALPHA_0),this}return this.addEventListener=e.addEventListener,this.dispatchEvent=e.dispatchEvent,this.removeEventListener=e.removeEventListener,this.animateOff=t.animateOff,this.animateOn=t.animateOn,this.halt=t.halt,this.isAnimated=t.isAnimated,this.remove=t.remove,this.setElement=t.setElement,this.fadeIn=o,this.fadeOut=r,this.init=i,this}ut.CLASSES=ue;function _(a,e,t){let i=e,o=a;if(!t)throw new Error("Child transition argument must be defined!");let r=t,s,d,c,p=!1,m=!1,f=!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(){d&&p?(o.addEventListener(d,c),r.dispatchEvent(_.BEGIN_EVENT,{target:r,type:_.BEGIN_EVENT}),o.classList.add(_.ANIMATING_CLASS),m=!0):(r.dispatchEvent(_.BEGIN_EVENT,{target:r,type:_.BEGIN_EVENT}),c())}function x(){o.removeEventListener(d,c)}function j(y){return y&&y.propertyName!==i.CSS_PROPERTY?!1:(x(),o.classList.remove(_.ANIMATING_CLASS),r.dispatchEvent(_.END_EVENT,{target:r,type:_.END_EVENT}),m=!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(){m&&(o.style.webkitTransitionDuration="0",o.style.mozTransitionDuration="0",o.style.oTransitionDuration="0",o.style.transitionDuration="0",o.removeEventListener(d,c),c(),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),p=!0}function G(){o.classList.add(_.NO_ANIMATION_CLASS),p=!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 b(y){T(),H(),o=y,o.classList.add(i.BASE_CLASS),d=z(o)}function w(y){if(p=!o.classList.contains(_.NO_ANIMATION_CLASS),c=j.bind(this),b(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 f||(S(),f=!0),o.classList.contains(y)?!1:(x(),o.classList.remove(s),s=y,v(),o.classList.add(s),!0)}return this.animateOff=G,this.animateOn=H,this.applyClass=L,this.halt=E,this.init=w,this.isAnimated=()=>p,this.remove=T,this.setElement=b,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,t=new _(a,ae,this),i=0;function o(){let v=a.scrollHeight+"px";a.style.maxHeight=v}function r(){window.removeEventListener("load",r),o()}function s(f){return t.init(f),window.addEventListener("load",r),window.addEventListener("resize",()=>{o()}),this}function d(){return o(),t.applyClass(ae.MH_DEFAULT),(!i||a.scrollHeight>i)&&(i=a.scrollHeight),this}function c(){return t.applyClass(ae.MH_SUMMARY),i=a.scrollHeight,this}function p(){return t.applyClass(ae.MH_ZERO),i=a.scrollHeight,this}function m(){return a.style.maxHeight="",t.remove()}return this.addEventListener=e.addEventListener,this.dispatchEvent=e.dispatchEvent,this.removeEventListener=e.removeEventListener,this.animateOff=t.animateOff,this.animateOn=t.animateOn,this.halt=t.halt,this.isAnimated=t.isAnimated,this.setElement=t.setElement,this.refresh=o,this.remove=m,this.init=s,this.maxHeightDefault=d,this.maxHeightSummary=c,this.maxHeightZero=p,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 bt(a){let e=new D,t=new _(a,K,this);function i(c){return t.init(c),this}function o(){return t.applyClass(K.MOVE_TO_ORIGIN),this}function r(c){c=c||1;let p=[K.MOVE_LEFT,K.MOVE_LEFT_2X,K.MOVE_LEFT_3X];return t.applyClass(p[c-1]),this}function s(){return t.applyClass(K.MOVE_RIGHT),this}function d(){return t.applyClass(K.MOVE_UP),this}return this.addEventListener=e.addEventListener,this.dispatchEvent=e.dispatchEvent,this.removeEventListener=e.removeEventListener,this.animateOff=t.animateOff,this.animateOn=t.animateOn,this.halt=t.halt,this.isAnimated=t.isAnimated,this.setElement=t.setElement,this.remove=t.remove,this.init=i,this.moveLeft=()=>r(1),this.moveLeft2=()=>r(2),this.moveLeft3=()=>r(3),this.moveRight=s,this.moveToOrigin=o,this.moveUp=d,this}bt.CLASSES=K;var Qa;function er(a){return a.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")}function tr(a,e){return RegExp(er(e.trim()),"i").test(a)}function ar(a,e,t){let i=a,o=e,r=(t==null?void 0:t.maxSelections)||5,s=[],d=[],c=[],p=[],m=-1;function f(b){return o+"-"+b.value.trim().replace(/\s+/g,"-").toLowerCase()}function v(){return d.length>=r}function x(b){let w,L=[],y=!1;for(let O=0,N=b.length;O<N;O++)w=b[O],y=v()?!1:w.defaultSelected,L.push({id:f(w),value:w.value,text:w.text,checked:y}),y&&d.push(O);return L}function j(){return s=x(i),this}function S(b){return s[b].checked=!s[b].checked,d.length<r&&s[b].checked?(d.push(b),d.sort(),!0):(s[b].checked=!1,d=d.filter(function(w){return w!==b}),!1)}function E(b,w,L,y){return tr(w.text,y)&&b.push(L),b}function T(b){return Object.prototype.toString.call(b)!=="[object String]"&&(b=""),p=c,s.length>0&&(c=s.reduce(function(w,L,y){return E(w,L,y,b)},[])),m=-1,c}function H(b){return s[b]}function G(b){let w=c.length,L=w===0?s.length:w;b<0?m=-1:b>=L?m=L-1:m=b}function z(){return m}return this.init=j,this.toggleOption=S,this.getSelectedIndices=function(){return d},this.isAtMaxSelections=v,this.filterIndices=T,this.clearFilter=function(){return c=p=[],Qa},this.getFilterIndices=function(){return c},this.getLastFilterIndices=function(){return p},this.getIndex=z,this.setIndex=G,this.resetIndex=function(){return m=-1,m},this.getOption=H,this}var gt=ar;function $(a,e,t){let i=document.createElement(a);return Object.keys(t).forEach(o=>{let r=t[o];o in i?i[o]=r:i.setAttribute(o,r)}),e&&e.appendChild(i),i}var ft='<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 sr=ft,F="o-multiselect",lr="a-checkbox",dr="a-text-input",vt="prev",be="next",st="Enter",cr=" ",yt="Escape",mr="ArrowUp",xt="ArrowDown",_t="Tab",wt={renderTags:!0,maxSelections:5};function ge(a){a.classList.add(F);let e=q(a,F),t=!1,i,o,r,s,d,c,p,m,f,v,x,j=[],S;function E(){x.classList.remove("u-no-results"),x.classList.add("u-filtered");let n=r.getLastFilterIndices();for(let l=0,h=n.length;l<h;l++)j[n[l]].classList.remove("u-filter-match");n=r.getFilterIndices();for(let l=0,h=n.length;l<h;l++)j[n[l]].classList.add("u-filter-match")}function T(){x.classList.remove("u-filtered","u-no-results");for(let n=0,l=x.children.length;n<l;n++)x.children[n].classList.remove("u-filter-match");r.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(),r.resetIndex();let l=r.filterIndices(n);G(l)}function b(){return c.classList.add("u-active"),v.classList.remove("u-invisible"),v.setAttribute("aria-hidden",!1),S.dispatchEvent("expandbegin",{target:S}),S}function w(){return c.classList.remove("u-active"),v.classList.add("u-invisible"),v.setAttribute("aria-hidden",!0),r.resetIndex(),S.dispatchEvent("collapsebegin",{target:S}),S}function L(n){n===be?r.setIndex(r.getIndex()+1):n===vt&&r.setIndex(r.getIndex()-1);let l=r.getIndex();if(l>-1){let h=l,u=r.getFilterIndices();u.length>0&&(h=u[l]);let U=r.getOption(h).value,kt=x.querySelector('[data-option="'+U+'"]').querySelector("input");t=!0,kt.focus()}else t=!1,f.focus()}function y(){f.value="",T()}function O(n){let l=n.target;l.tagName==="BUTTON"&&(n.preventDefault(),l.removeEventListener("click",O),l.querySelector("label").click())}function N(n){if(n.key===cr||n.key===st){let l=n.target.querySelector("label");x.querySelector("#"+l.getAttribute("for")).click()}}function R(n){return i+"-"+n.value.trim().replace(/[^\w]/g,"-").toLowerCase()}function W(n,l){let h=R(l),u=$("li",null,{"data-option":l.value}),k=$("button",u,{type:"button",class:"a-tag-filter",innerHTML:"<label for="+h+">"+l.text+sr+"</label>"});n.appendChild(u),k.addEventListener("click",O),k.addEventListener("keydown",N)}function re(n){let l=r.getOption(n)||r.getOption(r.getIndex());if(l){if(l.checked){x.classList.contains("u-max-selections")&&x.classList.remove("u-max-selections");let h='[data-option="'+l.value+'"]',u=p.querySelector(h);typeof u!="undefined"&&u&&(p==null||p.removeChild(u))}else d!=null&&d.renderTags&&p&&W(p,l);r.toggleOption(n),r.isAtMaxSelections()&&x.classList.add("u-max-selections"),S.dispatchEvent("selectionsupdated",{target:S})}r.resetIndex(),t=!1,v.getAttribute("aria-hidden")==="false"&&f.focus()}function fe(n){re(Number(n.target.getAttribute("data-index"))),y()}function ve(){m.addEventListener("mousemove",function(h){let u=h.target;h.offsetX>u.offsetWidth-35?u.style.cursor="pointer":u.style.cursor="auto"}),m.addEventListener("mouseup",function(h){let u=h.target;h.offsetX>u.offsetWidth-35&&v.offsetHeight===140&&f.blur()}),f.addEventListener("input",function(){z(this.value)}),f.addEventListener("focus",function(){v.getAttribute("aria-hidden")==="true"&&b()}),f.addEventListener("blur",function(){!t&&v.getAttribute("aria-hidden")==="false"&&w()}),f.addEventListener("keydown",function(h){let u=h.key;v.getAttribute("aria-hidden")==="true"&&u!==_t&&b(),u===st?(h.preventDefault(),L(be)):u===yt?(y(),w()):u===xt?L(be):u===_t&&!h.shiftKey&&v.getAttribute("aria-hidden")==="false"&&w()}),x.addEventListener("mousedown",function(){t=!0}),x.addEventListener("keydown",function(h){let u=h.key,k=h.target,U=k.checked;if(u===st){h.preventDefault(),k.checked=!U;let V=new Event("change",{bubbles:!1,cancelable:!0});k.dispatchEvent(V)}else u===yt?(f.focus(),w()):u===mr?L(vt):u===xt&&L(be)}),v.addEventListener("mousedown",function(h){h.target.tagName==="LABEL"&&(t=!0)});let n=x.querySelectorAll("input");for(let h=0,u=n.length;h<u;h++)n[h].addEventListener("change",fe);let l=p.querySelectorAll("button");for(let h=0,u=l.length;h<u;h++)l[h].addEventListener("click",O),l[h].addEventListener("keydown",N)}function oe(){c=document.createElement("div"),c.className=F,p=$("ul",null,{className:"m-tag-group"}),m=$("header",c,{className:F+"__header"}),f=$("input",m,{className:F+"__search "+dr,type:"text",placeholder:o||"Select up to five",id:e.id,autocomplete:"off"}),v=$("fieldset",c,{className:F+"__fieldset u-invisible","aria-hidden":"true"});let n=F+"__options";r.isAtMaxSelections()&&(n+=" u-max-selections"),x=$("ul",v,{className:n});let l,h,u;for(let k=0,U=s.length;k<U;k++){l=s[k],h=R(l),u=r.getOption(k).checked;let V=$("li",x,{"data-option":l.value,"data-cy":"multiselect-option",class:"m-form-field m-form-field--checkbox"});$("input",V,{id:h,type:"checkbox",value:l.value,name:i,class:lr+" "+F+"__checkbox",checked:u,"data-index":k}),$("label",V,{for:h,textContent:l.text,className:F+"__label a-label"}),j.push(V),u&&(d!=null&&d.renderTags)&&W(p,l)}return c.insertBefore(p,m),e.parentNode.insertBefore(c,e),c.appendChild(e),c}function ye(n=wt){if(!M(e))return this;if(nt())return this;if(S=this,i=e.name||e.id,o=e.getAttribute("placeholder"),s=e.options||[],d=_e(_e({},wt),n),s.length>0){r=new gt(s,i,d).init();let l=oe();e.parentNode.removeChild(e),e=l,M(e),ve()}return this}function xe(){return r}this.init=ye,this.expand=b,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=re,this.selectionClickHandler=O,this.selectionKeyDownHandler=N,this}ge.BASE_CLASS=F;ge.init=a=>C(`.${F}`,ge,void 0,a);})();
|
|
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);})();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|