diff --git a/README.md b/README.md index 1a4baa6..2b2abb5 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ const application = Application.start() import { RailsuiClipboard, RailsuiCountUp, + RailsuiCombobox, RailsuiDateRangePicker, RailsuiDropdown, RailsuiModal, @@ -52,6 +53,7 @@ import { application.register('railsui-clipboard', RailsuiClipboard) application.register('railsui-count-up', RailsuiCountUp) +application.register('railsui-combobox', RailsuiCombobox) application.register('railsui-date-range-picker', RailsuiDateRangePicker) application.register('railsui-dropdown', RailsuiDropdown) application.register('railsui-modal', RailsuiModal) @@ -68,6 +70,7 @@ application.register('railsui-tooltip', RailsuiTooltip) - [Clipboard](docs/clipboard.md) - [Count up](docs/count_up.md) +- [Combobox](docs/combobox.md) - [Date range picker](docs/date_range_picker.md) - [Dropdown](docs/dropdown.md) - [Modal](docs/modal.md) diff --git a/dist/railsui-stimulus.cjs b/dist/railsui-stimulus.cjs index 17213ba..f6318bb 100644 --- a/dist/railsui-stimulus.cjs +++ b/dist/railsui-stimulus.cjs @@ -1,5 +1,5 @@ -var ln=Object.defineProperty;var vi=Object.getOwnPropertyDescriptor;var bi=Object.getOwnPropertyNames;var yi=Object.prototype.hasOwnProperty;var wi=(t,n,e)=>n in t?ln(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var xi=(t,n)=>{for(var e in n)ln(t,e,{get:n[e],enumerable:!0})},Di=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of bi(n))!yi.call(t,a)&&a!==e&&ln(t,a,{get:()=>n[a],enumerable:!(o=vi(n,a))||o.enumerable});return t};var Ei=t=>Di(ln({},"__esModule",{value:!0}),t);var K=(t,n,e)=>(wi(t,typeof n!="symbol"?n+"":n,e),e);var Vo={};xi(Vo,{RailsuiClipboard:()=>qt,RailsuiCountUp:()=>zt,RailsuiDateRangePicker:()=>It,RailsuiDropdown:()=>Gt,RailsuiModal:()=>Qt,RailsuiRange:()=>Zt,RailsuiReadMore:()=>Ft,RailsuiSelectAll:()=>en,RailsuiTabs:()=>tn,RailsuiToast:()=>nn,RailsuiToggle:()=>rn,RailsuiTooltip:()=>on});module.exports=Ei(Vo);var Wr=require("@hotwired/stimulus");var Q="top",ie="bottom",ne="right",Z="left",un="auto",rt=[Q,ie,ne,Z],Je="start",pt="end",or="clippingParents",fn="viewport",Ot="popper",ar="reference",kn=rt.reduce(function(t,n){return t.concat([n+"-"+Je,n+"-"+pt])},[]),dn=[].concat(rt,[un]).reduce(function(t,n){return t.concat([n,n+"-"+Je,n+"-"+pt])},[]),Ci="beforeRead",Ti="read",Oi="afterRead",Mi="beforeMain",Ai="main",Pi="afterMain",Si="beforeWrite",ki="write",Ni="afterWrite",sr=[Ci,Ti,Oi,Mi,Ai,Pi,Si,ki,Ni];function se(t){return t?(t.nodeName||"").toLowerCase():null}function G(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function Me(t){var n=G(t).Element;return t instanceof n||t instanceof Element}function oe(t){var n=G(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function Mt(t){if(typeof ShadowRoot>"u")return!1;var n=G(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function Li(t){var n=t.state;Object.keys(n.elements).forEach(function(e){var o=n.styles[e]||{},a=n.attributes[e]||{},c=n.elements[e];!oe(c)||!se(c)||(Object.assign(c.style,o),Object.keys(a).forEach(function(d){var p=a[d];p===!1?c.removeAttribute(d):c.setAttribute(d,p===!0?"":p)}))})}function Ii(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach(function(o){var a=n.elements[o],c=n.attributes[o]||{},d=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:e[o]),p=d.reduce(function(u,b){return u[b]="",u},{});!oe(a)||!se(a)||(Object.assign(a.style,p),Object.keys(c).forEach(function(u){a.removeAttribute(u)}))})}}var Rt={name:"applyStyles",enabled:!0,phase:"write",fn:Li,effect:Ii,requires:["computeStyles"]};function ce(t){return t.split("-")[0]}var je=Math.max,mt=Math.min,Ge=Math.round;function At(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function _t(){return!/^((?!chrome|android).)*safari/i.test(At())}function Ae(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);var o=t.getBoundingClientRect(),a=1,c=1;n&&oe(t)&&(a=t.offsetWidth>0&&Ge(o.width)/t.offsetWidth||1,c=t.offsetHeight>0&&Ge(o.height)/t.offsetHeight||1);var d=Me(t)?G(t):window,p=d.visualViewport,u=!_t()&&e,b=(o.left+(u&&p?p.offsetLeft:0))/a,h=(o.top+(u&&p?p.offsetTop:0))/c,O=o.width/a,T=o.height/c;return{width:O,height:T,top:h,right:b+O,bottom:h+T,left:b,x:b,y:h}}function ht(t){var n=Ae(t),e=t.offsetWidth,o=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:o}}function Ht(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&Mt(e)){var o=n;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function be(t){return G(t).getComputedStyle(t)}function Nn(t){return["table","td","th"].indexOf(se(t))>=0}function de(t){return((Me(t)?t.ownerDocument:t.document)||window.document).documentElement}function Qe(t){return se(t)==="html"?t:t.assignedSlot||t.parentNode||(Mt(t)?t.host:null)||de(t)}function cr(t){return!oe(t)||be(t).position==="fixed"?null:t.offsetParent}function Fi(t){var n=/firefox/i.test(At()),e=/Trident/i.test(At());if(e&&oe(t)){var o=be(t);if(o.position==="fixed")return null}var a=Qe(t);for(Mt(a)&&(a=a.host);oe(a)&&["html","body"].indexOf(se(a))<0;){var c=be(a);if(c.transform!=="none"||c.perspective!=="none"||c.contain==="paint"||["transform","perspective"].indexOf(c.willChange)!==-1||n&&c.willChange==="filter"||n&&c.filter&&c.filter!=="none")return a;a=a.parentNode}return null}function Re(t){for(var n=G(t),e=cr(t);e&&Nn(e)&&be(e).position==="static";)e=cr(e);return e&&(se(e)==="html"||se(e)==="body"&&be(e).position==="static")?n:e||Fi(t)||n}function gt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function vt(t,n,e){return je(t,mt(n,e))}function lr(t,n,e){var o=vt(t,n,e);return o>e?e:o}function Vt(){return{top:0,right:0,bottom:0,left:0}}function Bt(t){return Object.assign({},Vt(),t)}function Wt(t,n){return n.reduce(function(e,o){return e[o]=t,e},{})}var ji=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,Bt(typeof n!="number"?n:Wt(n,rt))};function Ri(t){var n,e=t.state,o=t.name,a=t.options,c=e.elements.arrow,d=e.modifiersData.popperOffsets,p=ce(e.placement),u=gt(p),b=[Z,ne].indexOf(p)>=0,h=b?"height":"width";if(!(!c||!d)){var O=ji(a.padding,e),T=ht(c),E=u==="y"?Q:Z,k=u==="y"?ie:ne,w=e.rects.reference[h]+e.rects.reference[u]-d[u]-e.rects.popper[h],P=d[u]-e.rects.reference[u],V=Re(c),I=V?u==="y"?V.clientHeight||0:V.clientWidth||0:0,_=w/2-P/2,l=O[E],F=I-T[h]-O[k],x=I/2-T[h]/2+_,H=vt(l,x,F),Y=u;e.modifiersData[o]=(n={},n[Y]=H,n.centerOffset=H-x,n)}}function _i(t){var n=t.state,e=t.options,o=e.element,a=o===void 0?"[data-popper-arrow]":o;a!=null&&(typeof a=="string"&&(a=n.elements.popper.querySelector(a),!a)||Ht(n.elements.popper,a)&&(n.elements.arrow=a))}var ur={name:"arrow",enabled:!0,phase:"main",fn:Ri,effect:_i,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pe(t){return t.split("-")[1]}var Hi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Vi(t,n){var e=t.x,o=t.y,a=n.devicePixelRatio||1;return{x:Ge(e*a)/a||0,y:Ge(o*a)/a||0}}function fr(t){var n,e=t.popper,o=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,u=t.gpuAcceleration,b=t.adaptive,h=t.roundOffsets,O=t.isFixed,T=d.x,E=T===void 0?0:T,k=d.y,w=k===void 0?0:k,P=typeof h=="function"?h({x:E,y:w}):{x:E,y:w};E=P.x,w=P.y;var V=d.hasOwnProperty("x"),I=d.hasOwnProperty("y"),_=Z,l=Q,F=window;if(b){var x=Re(e),H="clientHeight",Y="clientWidth";if(x===G(e)&&(x=de(e),be(x).position!=="static"&&p==="absolute"&&(H="scrollHeight",Y="scrollWidth")),x=x,a===Q||(a===Z||a===ne)&&c===pt){l=ie;var A=O&&x===F&&F.visualViewport?F.visualViewport.height:x[H];w-=A-o.height,w*=u?1:-1}if(a===Z||(a===Q||a===ie)&&c===pt){_=ne;var N=O&&x===F&&F.visualViewport?F.visualViewport.width:x[Y];E-=N-o.width,E*=u?1:-1}}var z=Object.assign({position:p},b&&Hi),B=h===!0?Vi({x:E,y:w},G(e)):{x:E,y:w};if(E=B.x,w=B.y,u){var j;return Object.assign({},z,(j={},j[l]=I?"0":"",j[_]=V?"0":"",j.transform=(F.devicePixelRatio||1)<=1?"translate("+E+"px, "+w+"px)":"translate3d("+E+"px, "+w+"px, 0)",j))}return Object.assign({},z,(n={},n[l]=I?w+"px":"",n[_]=V?E+"px":"",n.transform="",n))}function Bi(t){var n=t.state,e=t.options,o=e.gpuAcceleration,a=o===void 0?!0:o,c=e.adaptive,d=c===void 0?!0:c,p=e.roundOffsets,u=p===void 0?!0:p,b={placement:ce(n.placement),variation:Pe(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:a,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,fr(Object.assign({},b,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:d,roundOffsets:u})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,fr(Object.assign({},b,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}var dr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Bi,data:{}};var pn={passive:!0};function Wi(t){var n=t.state,e=t.instance,o=t.options,a=o.scroll,c=a===void 0?!0:a,d=o.resize,p=d===void 0?!0:d,u=G(n.elements.popper),b=[].concat(n.scrollParents.reference,n.scrollParents.popper);return c&&b.forEach(function(h){h.addEventListener("scroll",e.update,pn)}),p&&u.addEventListener("resize",e.update,pn),function(){c&&b.forEach(function(h){h.removeEventListener("scroll",e.update,pn)}),p&&u.removeEventListener("resize",e.update,pn)}}var pr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Wi,data:{}};var Yi={left:"right",right:"left",bottom:"top",top:"bottom"};function Pt(t){return t.replace(/left|right|bottom|top/g,function(n){return Yi[n]})}var $i={start:"end",end:"start"};function mn(t){return t.replace(/start|end/g,function(n){return $i[n]})}function bt(t){var n=G(t),e=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:e,scrollTop:o}}function yt(t){return Ae(de(t)).left+bt(t).scrollLeft}function Ln(t,n){var e=G(t),o=de(t),a=e.visualViewport,c=o.clientWidth,d=o.clientHeight,p=0,u=0;if(a){c=a.width,d=a.height;var b=_t();(b||!b&&n==="fixed")&&(p=a.offsetLeft,u=a.offsetTop)}return{width:c,height:d,x:p+yt(t),y:u}}function In(t){var n,e=de(t),o=bt(t),a=(n=t.ownerDocument)==null?void 0:n.body,c=je(e.scrollWidth,e.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),d=je(e.scrollHeight,e.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),p=-o.scrollLeft+yt(t),u=-o.scrollTop;return be(a||e).direction==="rtl"&&(p+=je(e.clientWidth,a?a.clientWidth:0)-c),{width:c,height:d,x:p,y:u}}function wt(t){var n=be(t),e=n.overflow,o=n.overflowX,a=n.overflowY;return/auto|scroll|overlay|hidden/.test(e+a+o)}function hn(t){return["html","body","#document"].indexOf(se(t))>=0?t.ownerDocument.body:oe(t)&&wt(t)?t:hn(Qe(t))}function it(t,n){var e;n===void 0&&(n=[]);var o=hn(t),a=o===((e=t.ownerDocument)==null?void 0:e.body),c=G(o),d=a?[c].concat(c.visualViewport||[],wt(o)?o:[]):o,p=n.concat(d);return a?p:p.concat(it(Qe(d)))}function St(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Ui(t,n){var e=Ae(t,!1,n==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function mr(t,n,e){return n===fn?St(Ln(t,e)):Me(n)?Ui(n,e):St(In(de(t)))}function qi(t){var n=it(Qe(t)),e=["absolute","fixed"].indexOf(be(t).position)>=0,o=e&&oe(t)?Re(t):t;return Me(o)?n.filter(function(a){return Me(a)&&Ht(a,o)&&se(a)!=="body"}):[]}function Fn(t,n,e,o){var a=n==="clippingParents"?qi(t):[].concat(n),c=[].concat(a,[e]),d=c[0],p=c.reduce(function(u,b){var h=mr(t,b,o);return u.top=je(h.top,u.top),u.right=mt(h.right,u.right),u.bottom=mt(h.bottom,u.bottom),u.left=je(h.left,u.left),u},mr(t,d,o));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function Yt(t){var n=t.reference,e=t.element,o=t.placement,a=o?ce(o):null,c=o?Pe(o):null,d=n.x+n.width/2-e.width/2,p=n.y+n.height/2-e.height/2,u;switch(a){case Q:u={x:d,y:n.y-e.height};break;case ie:u={x:d,y:n.y+n.height};break;case ne:u={x:n.x+n.width,y:p};break;case Z:u={x:n.x-e.width,y:p};break;default:u={x:n.x,y:n.y}}var b=a?gt(a):null;if(b!=null){var h=b==="y"?"height":"width";switch(c){case Je:u[b]=u[b]-(n[h]/2-e[h]/2);break;case pt:u[b]=u[b]+(n[h]/2-e[h]/2);break;default:}}return u}function _e(t,n){n===void 0&&(n={});var e=n,o=e.placement,a=o===void 0?t.placement:o,c=e.strategy,d=c===void 0?t.strategy:c,p=e.boundary,u=p===void 0?or:p,b=e.rootBoundary,h=b===void 0?fn:b,O=e.elementContext,T=O===void 0?Ot:O,E=e.altBoundary,k=E===void 0?!1:E,w=e.padding,P=w===void 0?0:w,V=Bt(typeof P!="number"?P:Wt(P,rt)),I=T===Ot?ar:Ot,_=t.rects.popper,l=t.elements[k?I:T],F=Fn(Me(l)?l:l.contextElement||de(t.elements.popper),u,h,d),x=Ae(t.elements.reference),H=Yt({reference:x,element:_,strategy:"absolute",placement:a}),Y=St(Object.assign({},_,H)),A=T===Ot?Y:x,N={top:F.top-A.top+V.top,bottom:A.bottom-F.bottom+V.bottom,left:F.left-A.left+V.left,right:A.right-F.right+V.right},z=t.modifiersData.offset;if(T===Ot&&z){var B=z[a];Object.keys(N).forEach(function(j){var le=[ne,ie].indexOf(j)>=0?1:-1,ae=[Q,ie].indexOf(j)>=0?"y":"x";N[j]+=B[ae]*le})}return N}function jn(t,n){n===void 0&&(n={});var e=n,o=e.placement,a=e.boundary,c=e.rootBoundary,d=e.padding,p=e.flipVariations,u=e.allowedAutoPlacements,b=u===void 0?dn:u,h=Pe(o),O=h?p?kn:kn.filter(function(k){return Pe(k)===h}):rt,T=O.filter(function(k){return b.indexOf(k)>=0});T.length===0&&(T=O);var E=T.reduce(function(k,w){return k[w]=_e(t,{placement:w,boundary:a,rootBoundary:c,padding:d})[ce(w)],k},{});return Object.keys(E).sort(function(k,w){return E[k]-E[w]})}function zi(t){if(ce(t)===un)return[];var n=Pt(t);return[mn(t),n,mn(n)]}function Xi(t){var n=t.state,e=t.options,o=t.name;if(!n.modifiersData[o]._skip){for(var a=e.mainAxis,c=a===void 0?!0:a,d=e.altAxis,p=d===void 0?!0:d,u=e.fallbackPlacements,b=e.padding,h=e.boundary,O=e.rootBoundary,T=e.altBoundary,E=e.flipVariations,k=E===void 0?!0:E,w=e.allowedAutoPlacements,P=n.options.placement,V=ce(P),I=V===P,_=u||(I||!k?[Pt(P)]:zi(P)),l=[P].concat(_).reduce(function(ke,ue){return ke.concat(ce(ue)===un?jn(n,{placement:ue,boundary:h,rootBoundary:O,padding:b,flipVariations:k,allowedAutoPlacements:w}):ue)},[]),F=n.rects.reference,x=n.rects.popper,H=new Map,Y=!0,A=l[0],N=0;N=0,ae=le?"width":"height",J=_e(n,{placement:z,boundary:h,rootBoundary:O,altBoundary:T,padding:b}),q=le?j?ne:Z:j?ie:Q;F[ae]>x[ae]&&(q=Pt(q));var ee=Pt(q),De=[];if(c&&De.push(J[B]<=0),p&&De.push(J[q]<=0,J[ee]<=0),De.every(function(ke){return ke})){A=z,Y=!1;break}H.set(z,De)}if(Y)for(var Te=k?3:1,Se=function(ue){var Ee=l.find(function(Ne){var fe=H.get(Ne);if(fe)return fe.slice(0,ue).every(function(Le){return Le})});if(Ee)return A=Ee,"break"},Oe=Te;Oe>0;Oe--){var $e=Se(Oe);if($e==="break")break}n.placement!==A&&(n.modifiersData[o]._skip=!0,n.placement=A,n.reset=!0)}}var hr={name:"flip",enabled:!0,phase:"main",fn:Xi,requiresIfExists:["offset"],data:{_skip:!1}};function gr(t,n,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function vr(t){return[Q,ne,ie,Z].some(function(n){return t[n]>=0})}function Ki(t){var n=t.state,e=t.name,o=n.rects.reference,a=n.rects.popper,c=n.modifiersData.preventOverflow,d=_e(n,{elementContext:"reference"}),p=_e(n,{altBoundary:!0}),u=gr(d,o),b=gr(p,a,c),h=vr(u),O=vr(b);n.modifiersData[e]={referenceClippingOffsets:u,popperEscapeOffsets:b,isReferenceHidden:h,hasPopperEscaped:O},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":O})}var br={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ki};function Ji(t,n,e){var o=ce(t),a=[Z,Q].indexOf(o)>=0?-1:1,c=typeof e=="function"?e(Object.assign({},n,{placement:t})):e,d=c[0],p=c[1];return d=d||0,p=(p||0)*a,[Z,ne].indexOf(o)>=0?{x:p,y:d}:{x:d,y:p}}function Gi(t){var n=t.state,e=t.options,o=t.name,a=e.offset,c=a===void 0?[0,0]:a,d=dn.reduce(function(h,O){return h[O]=Ji(O,n.rects,c),h},{}),p=d[n.placement],u=p.x,b=p.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=u,n.modifiersData.popperOffsets.y+=b),n.modifiersData[o]=d}var yr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Gi};function Qi(t){var n=t.state,e=t.name;n.modifiersData[e]=Yt({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}var wr={name:"popperOffsets",enabled:!0,phase:"read",fn:Qi,data:{}};function Rn(t){return t==="x"?"y":"x"}function Zi(t){var n=t.state,e=t.options,o=t.name,a=e.mainAxis,c=a===void 0?!0:a,d=e.altAxis,p=d===void 0?!1:d,u=e.boundary,b=e.rootBoundary,h=e.altBoundary,O=e.padding,T=e.tether,E=T===void 0?!0:T,k=e.tetherOffset,w=k===void 0?0:k,P=_e(n,{boundary:u,rootBoundary:b,padding:O,altBoundary:h}),V=ce(n.placement),I=Pe(n.placement),_=!I,l=gt(V),F=Rn(l),x=n.modifiersData.popperOffsets,H=n.rects.reference,Y=n.rects.popper,A=typeof w=="function"?w(Object.assign({},n.rects,{placement:n.placement})):w,N=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),z=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,B={x:0,y:0};if(x){if(c){var j,le=l==="y"?Q:Z,ae=l==="y"?ie:ne,J=l==="y"?"height":"width",q=x[l],ee=q+P[le],De=q-P[ae],Te=E?-Y[J]/2:0,Se=I===Je?H[J]:Y[J],Oe=I===Je?-Y[J]:-H[J],$e=n.elements.arrow,ke=E&&$e?ht($e):{width:0,height:0},ue=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:Vt(),Ee=ue[le],Ne=ue[ae],fe=vt(0,H[J],ke[J]),Le=_?H[J]/2-Te-fe-Ee-N.mainAxis:Se-fe-Ee-N.mainAxis,Ve=_?-H[J]/2+Te+fe+Ne+N.mainAxis:Oe+fe+Ne+N.mainAxis,Ue=n.elements.arrow&&Re(n.elements.arrow),qe=Ue?l==="y"?Ue.clientTop||0:Ue.clientLeft||0:0,ct=(j=z?.[l])!=null?j:0,Dt=q+Le-ct-qe,lt=q+Ve-ct,ut=vt(E?mt(ee,Dt):ee,q,E?je(De,lt):De);x[l]=ut,B[l]=ut-q}if(p){var et,ft=l==="x"?Q:Z,ze=l==="x"?ie:ne,Ie=x[F],Be=F==="y"?"height":"width",tt=Ie+P[ft],Fe=Ie-P[ze],nt=[Q,Z].indexOf(V)!==-1,Xe=(et=z?.[F])!=null?et:0,Et=nt?tt:Ie-H[Be]-Y[Be]-Xe+N.altAxis,dt=nt?Ie+H[Be]+Y[Be]-Xe-N.altAxis:Fe,Ct=E&&nt?lr(Et,Ie,dt):vt(E?Et:tt,Ie,E?dt:Fe);x[F]=Ct,B[F]=Ct-Ie}n.modifiersData[o]=B}}var xr={name:"preventOverflow",enabled:!0,phase:"main",fn:Zi,requiresIfExists:["offset"]};function _n(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Hn(t){return t===G(t)||!oe(t)?bt(t):_n(t)}function eo(t){var n=t.getBoundingClientRect(),e=Ge(n.width)/t.offsetWidth||1,o=Ge(n.height)/t.offsetHeight||1;return e!==1||o!==1}function Vn(t,n,e){e===void 0&&(e=!1);var o=oe(n),a=oe(n)&&eo(n),c=de(n),d=Ae(t,a,e),p={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!e)&&((se(n)!=="body"||wt(c))&&(p=Hn(n)),oe(n)?(u=Ae(n,!0),u.x+=n.clientLeft,u.y+=n.clientTop):c&&(u.x=yt(c))),{x:d.left+p.scrollLeft-u.x,y:d.top+p.scrollTop-u.y,width:d.width,height:d.height}}function to(t){var n=new Map,e=new Set,o=[];t.forEach(function(c){n.set(c.name,c)});function a(c){e.add(c.name);var d=[].concat(c.requires||[],c.requiresIfExists||[]);d.forEach(function(p){if(!e.has(p)){var u=n.get(p);u&&a(u)}}),o.push(c)}return t.forEach(function(c){e.has(c.name)||a(c)}),o}function Bn(t){var n=to(t);return sr.reduce(function(e,o){return e.concat(n.filter(function(a){return a.phase===o}))},[])}function Wn(t){var n;return function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(t())})})),n}}function Yn(t){var n=t.reduce(function(e,o){var a=e[o.name];return e[o.name]=a?Object.assign({},a,o,{options:Object.assign({},a.options,o.options),data:Object.assign({},a.data,o.data)}):o,e},{});return Object.keys(n).map(function(e){return n[e]})}var Dr={placement:"bottom",modifiers:[],strategy:"absolute"};function Er(){for(var t=arguments.length,n=new Array(t),e=0;e-1}function _r(t,n){return typeof t=="function"?t.apply(void 0,n):t}function Tr(t,n){if(n===0)return t;var e;return function(o){clearTimeout(e),e=setTimeout(function(){t(o)},n)}}function oo(t){return t.split(/\s+/).filter(Boolean)}function kt(t){return[].concat(t)}function Or(t,n){t.indexOf(n)===-1&&t.push(n)}function ao(t){return t.filter(function(n,e){return t.indexOf(n)===e})}function so(t){return t.split("-")[0]}function vn(t){return[].slice.call(t)}function Mr(t){return Object.keys(t).reduce(function(n,e){return t[e]!==void 0&&(n[e]=t[e]),n},{})}function $t(){return document.createElement("div")}function bn(t){return["Element","Fragment"].some(function(n){return Gn(t,n)})}function co(t){return Gn(t,"NodeList")}function lo(t){return Gn(t,"MouseEvent")}function uo(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function fo(t){return bn(t)?[t]:co(t)?vn(t):Array.isArray(t)?t:vn(document.querySelectorAll(t))}function qn(t,n){t.forEach(function(e){e&&(e.style.transitionDuration=n+"ms")})}function Ar(t,n){t.forEach(function(e){e&&e.setAttribute("data-state",n)})}function po(t){var n,e=kt(t),o=e[0];return o!=null&&(n=o.ownerDocument)!=null&&n.body?o.ownerDocument:document}function mo(t,n){var e=n.clientX,o=n.clientY;return t.every(function(a){var c=a.popperRect,d=a.popperState,p=a.props,u=p.interactiveBorder,b=so(d.placement),h=d.modifiersData.offset;if(!h)return!0;var O=b==="bottom"?h.top.y:0,T=b==="top"?h.bottom.y:0,E=b==="right"?h.left.x:0,k=b==="left"?h.right.x:0,w=c.top-o+O>u,P=o-c.bottom-T>u,V=c.left-e+E>u,I=e-c.right-k>u;return w||P||V||I})}function zn(t,n,e){var o=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(a){t[o](a,e)})}function Pr(t,n){for(var e=n;e;){var o;if(t.contains(e))return!0;e=e.getRootNode==null||(o=e.getRootNode())==null?void 0:o.host}return!1}var Ye={isTouch:!1},Sr=0;function ho(){Ye.isTouch||(Ye.isTouch=!0,window.performance&&document.addEventListener("mousemove",Hr))}function Hr(){var t=performance.now();t-Sr<20&&(Ye.isTouch=!1,document.removeEventListener("mousemove",Hr)),Sr=t}function go(){var t=document.activeElement;if(uo(t)){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}function vo(){document.addEventListener("touchstart",ho,xt),window.addEventListener("blur",go)}var bo=typeof window<"u"&&typeof document<"u",yo=bo?!!window.msCrypto:!1;var wo={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xo={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},He=Object.assign({appendTo:Rr,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},wo,xo),Do=Object.keys(He),Eo=function(n){var e=Object.keys(n);e.forEach(function(o){He[o]=n[o]})};function Vr(t){var n=t.plugins||[],e=n.reduce(function(o,a){var c=a.name,d=a.defaultValue;if(c){var p;o[c]=t[c]!==void 0?t[c]:(p=He[c])!=null?p:d}return o},{});return Object.assign({},t,e)}function Co(t,n){var e=n?Object.keys(Vr(Object.assign({},He,{plugins:n}))):Do,o=e.reduce(function(a,c){var d=(t.getAttribute("data-tippy-"+c)||"").trim();if(!d)return a;if(c==="content")a[c]=d;else try{a[c]=JSON.parse(d)}catch{a[c]=d}return a},{});return o}function kr(t,n){var e=Object.assign({},n,{content:_r(n.content,[t])},n.ignoreAttributes?{}:Co(t,n.plugins));return e.aria=Object.assign({},He.aria,e.aria),e.aria={expanded:e.aria.expanded==="auto"?n.interactive:e.aria.expanded,content:e.aria.content==="auto"?n.interactive?null:"describedby":e.aria.content},e}var To=function(){return"innerHTML"};function Kn(t,n){t[To()]=n}function Nr(t){var n=$t();return t===!0?n.className=Fr:(n.className=jr,bn(t)?n.appendChild(t):Kn(n,t)),n}function Lr(t,n){bn(n.content)?(Kn(t,""),t.appendChild(n.content)):typeof n.content!="function"&&(n.allowHTML?Kn(t,n.content):t.textContent=n.content)}function Jn(t){var n=t.firstElementChild,e=vn(n.children);return{box:n,content:e.find(function(o){return o.classList.contains(Ir)}),arrow:e.find(function(o){return o.classList.contains(Fr)||o.classList.contains(jr)}),backdrop:e.find(function(o){return o.classList.contains(io)})}}function Br(t){var n=$t(),e=$t();e.className=ro,e.setAttribute("data-state","hidden"),e.setAttribute("tabindex","-1");var o=$t();o.className=Ir,o.setAttribute("data-state","hidden"),Lr(o,t.props),n.appendChild(e),e.appendChild(o),a(t.props,t.props);function a(c,d){var p=Jn(n),u=p.box,b=p.content,h=p.arrow;d.theme?u.setAttribute("data-theme",d.theme):u.removeAttribute("data-theme"),typeof d.animation=="string"?u.setAttribute("data-animation",d.animation):u.removeAttribute("data-animation"),d.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof d.maxWidth=="number"?d.maxWidth+"px":d.maxWidth,d.role?u.setAttribute("role",d.role):u.removeAttribute("role"),(c.content!==d.content||c.allowHTML!==d.allowHTML)&&Lr(b,t.props),d.arrow?h?c.arrow!==d.arrow&&(u.removeChild(h),u.appendChild(Nr(d.arrow))):u.appendChild(Nr(d.arrow)):h&&u.removeChild(h)}return{popper:n,onUpdate:a}}Br.$$tippy=!0;var Oo=1,gn=[],Xn=[];function Mo(t,n){var e=kr(t,Object.assign({},He,Vr(Mr(n)))),o,a,c,d=!1,p=!1,u=!1,b=!1,h,O,T,E=[],k=Tr(Dt,e.interactiveDebounce),w,P=Oo++,V=null,I=ao(e.plugins),_={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},l={id:P,reference:t,popper:$t(),popperInstance:V,props:e,state:_,plugins:I,clearDelayTimeouts:Et,setProps:dt,setContent:Ct,show:an,hide:Mn,hideWithInteractivity:An,enable:nt,disable:Xe,unmount:sn,destroy:Pn};if(!e.render)return l;var F=e.render(l),x=F.popper,H=F.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+l.id,l.popper=x,t._tippy=l,x._tippy=l;var Y=I.map(function(m){return m.fn(l)}),A=t.hasAttribute("aria-expanded");return Ue(),Te(),q(),ee("onCreate",[l]),e.showOnCreate&&tt(),x.addEventListener("mouseenter",function(){l.props.interactive&&l.state.isVisible&&l.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){l.props.interactive&&l.props.trigger.indexOf("mouseenter")>=0&&le().addEventListener("mousemove",k)}),l;function N(){var m=l.props.touch;return Array.isArray(m)?m:[m,0]}function z(){return N()[0]==="hold"}function B(){var m;return!!((m=l.props.render)!=null&&m.$$tippy)}function j(){return w||t}function le(){var m=j().parentNode;return m?po(m):document}function ae(){return Jn(x)}function J(m){return l.state.isMounted&&!l.state.isVisible||Ye.isTouch||h&&h.type==="focus"?0:Un(l.props.delay,m?0:1,He.delay)}function q(m){m===void 0&&(m=!1),x.style.pointerEvents=l.props.interactive&&!m?"":"none",x.style.zIndex=""+l.props.zIndex}function ee(m,v,M){if(M===void 0&&(M=!0),Y.forEach(function(W){W[m]&&W[m].apply(W,v)}),M){var $;($=l.props)[m].apply($,v)}}function De(){var m=l.props.aria;if(m.content){var v="aria-"+m.content,M=x.id,$=kt(l.props.triggerTarget||t);$.forEach(function(W){var te=W.getAttribute(v);if(l.state.isVisible)W.setAttribute(v,te?te+" "+M:M);else{var pe=te&&te.replace(M,"").trim();pe?W.setAttribute(v,pe):W.removeAttribute(v)}})}}function Te(){if(!(A||!l.props.aria.expanded)){var m=kt(l.props.triggerTarget||t);m.forEach(function(v){l.props.interactive?v.setAttribute("aria-expanded",l.state.isVisible&&v===j()?"true":"false"):v.removeAttribute("aria-expanded")})}}function Se(){le().removeEventListener("mousemove",k),gn=gn.filter(function(m){return m!==k})}function Oe(m){if(!(Ye.isTouch&&(u||m.type==="mousedown"))){var v=m.composedPath&&m.composedPath()[0]||m.target;if(!(l.props.interactive&&Pr(x,v))){if(kt(l.props.triggerTarget||t).some(function(M){return Pr(M,v)})){if(Ye.isTouch||l.state.isVisible&&l.props.trigger.indexOf("click")>=0)return}else ee("onClickOutside",[l,m]);l.props.hideOnClick===!0&&(l.clearDelayTimeouts(),l.hide(),p=!0,setTimeout(function(){p=!1}),l.state.isMounted||Ee())}}}function $e(){u=!0}function ke(){u=!1}function ue(){var m=le();m.addEventListener("mousedown",Oe,!0),m.addEventListener("touchend",Oe,xt),m.addEventListener("touchstart",ke,xt),m.addEventListener("touchmove",$e,xt)}function Ee(){var m=le();m.removeEventListener("mousedown",Oe,!0),m.removeEventListener("touchend",Oe,xt),m.removeEventListener("touchstart",ke,xt),m.removeEventListener("touchmove",$e,xt)}function Ne(m,v){Le(m,function(){!l.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&v()})}function fe(m,v){Le(m,v)}function Le(m,v){var M=ae().box;function $(W){W.target===M&&(zn(M,"remove",$),v())}if(m===0)return v();zn(M,"remove",O),zn(M,"add",$),O=$}function Ve(m,v,M){M===void 0&&(M=!1);var $=kt(l.props.triggerTarget||t);$.forEach(function(W){W.addEventListener(m,v,M),E.push({node:W,eventType:m,handler:v,options:M})})}function Ue(){z()&&(Ve("touchstart",ct,{passive:!0}),Ve("touchend",lt,{passive:!0})),oo(l.props.trigger).forEach(function(m){if(m!=="manual")switch(Ve(m,ct),m){case"mouseenter":Ve("mouseleave",lt);break;case"focus":Ve(yo?"focusout":"blur",ut);break;case"focusin":Ve("focusout",ut);break}})}function qe(){E.forEach(function(m){var v=m.node,M=m.eventType,$=m.handler,W=m.options;v.removeEventListener(M,$,W)}),E=[]}function ct(m){var v,M=!1;if(!(!l.state.isEnabled||et(m)||p)){var $=((v=h)==null?void 0:v.type)==="focus";h=m,w=m.currentTarget,Te(),!l.state.isVisible&&lo(m)&&gn.forEach(function(W){return W(m)}),m.type==="click"&&(l.props.trigger.indexOf("mouseenter")<0||d)&&l.props.hideOnClick!==!1&&l.state.isVisible?M=!0:tt(m),m.type==="click"&&(d=!M),M&&!$&&Fe(m)}}function Dt(m){var v=m.target,M=j().contains(v)||x.contains(v);if(!(m.type==="mousemove"&&M)){var $=Be().concat(x).map(function(W){var te,pe=W._tippy,me=(te=pe.popperInstance)==null?void 0:te.state;return me?{popperRect:W.getBoundingClientRect(),popperState:me,props:e}:null}).filter(Boolean);mo($,m)&&(Se(),Fe(m))}}function lt(m){var v=et(m)||l.props.trigger.indexOf("click")>=0&&d;if(!v){if(l.props.interactive){l.hideWithInteractivity(m);return}Fe(m)}}function ut(m){l.props.trigger.indexOf("focusin")<0&&m.target!==j()||l.props.interactive&&m.relatedTarget&&x.contains(m.relatedTarget)||Fe(m)}function et(m){return Ye.isTouch?z()!==m.type.indexOf("touch")>=0:!1}function ft(){ze();var m=l.props,v=m.popperOptions,M=m.placement,$=m.offset,W=m.getReferenceClientRect,te=m.moveTransition,pe=B()?Jn(x).arrow:null,me=W?{getBoundingClientRect:W,contextElement:W.contextElement||j()}:t,cn={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(i){var s=i.state;if(B()){var f=ae(),g=f.box;["placement","reference-hidden","escaped"].forEach(function(y){y==="placement"?g.setAttribute("data-placement",s.placement):s.attributes.popper["data-popper-"+y]?g.setAttribute("data-"+y,""):g.removeAttribute("data-"+y)}),s.attributes.popper={}}}},Ke=[{name:"offset",options:{offset:$}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!te}},cn];B()&&pe&&Ke.push({name:"arrow",options:{element:pe,padding:3}}),Ke.push.apply(Ke,v?.modifiers||[]),l.popperInstance=$n(me,x,Object.assign({},v,{placement:M,onFirstUpdate:T,modifiers:Ke}))}function ze(){l.popperInstance&&(l.popperInstance.destroy(),l.popperInstance=null)}function Ie(){var m=l.props.appendTo,v,M=j();l.props.interactive&&m===Rr||m==="parent"?v=M.parentNode:v=_r(m,[M]),v.contains(x)||v.appendChild(x),l.state.isMounted=!0,ft()}function Be(){return vn(x.querySelectorAll("[data-tippy-root]"))}function tt(m){l.clearDelayTimeouts(),m&&ee("onTrigger",[l,m]),ue();var v=J(!0),M=N(),$=M[0],W=M[1];Ye.isTouch&&$==="hold"&&W&&(v=W),v?o=setTimeout(function(){l.show()},v):l.show()}function Fe(m){if(l.clearDelayTimeouts(),ee("onUntrigger",[l,m]),!l.state.isVisible){Ee();return}if(!(l.props.trigger.indexOf("mouseenter")>=0&&l.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(m.type)>=0&&d)){var v=J(!1);v?a=setTimeout(function(){l.state.isVisible&&l.hide()},v):c=requestAnimationFrame(function(){l.hide()})}}function nt(){l.state.isEnabled=!0}function Xe(){l.hide(),l.state.isEnabled=!1}function Et(){clearTimeout(o),clearTimeout(a),cancelAnimationFrame(c)}function dt(m){if(!l.state.isDestroyed){ee("onBeforeUpdate",[l,m]),qe();var v=l.props,M=kr(t,Object.assign({},v,Mr(m),{ignoreAttributes:!0}));l.props=M,Ue(),v.interactiveDebounce!==M.interactiveDebounce&&(Se(),k=Tr(Dt,M.interactiveDebounce)),v.triggerTarget&&!M.triggerTarget?kt(v.triggerTarget).forEach(function($){$.removeAttribute("aria-expanded")}):M.triggerTarget&&t.removeAttribute("aria-expanded"),Te(),q(),H&&H(v,M),l.popperInstance&&(ft(),Be().forEach(function($){requestAnimationFrame($._tippy.popperInstance.forceUpdate)})),ee("onAfterUpdate",[l,m])}}function Ct(m){l.setProps({content:m})}function an(){var m=l.state.isVisible,v=l.state.isDestroyed,M=!l.state.isEnabled,$=Ye.isTouch&&!l.props.touch,W=Un(l.props.duration,0,He.duration);if(!(m||v||M||$)&&!j().hasAttribute("disabled")&&(ee("onShow",[l],!1),l.props.onShow(l)!==!1)){if(l.state.isVisible=!0,B()&&(x.style.visibility="visible"),q(),ue(),l.state.isMounted||(x.style.transition="none"),B()){var te=ae(),pe=te.box,me=te.content;qn([pe,me],0)}T=function(){var Ke;if(!(!l.state.isVisible||b)){if(b=!0,x.offsetHeight,x.style.transition=l.props.moveTransition,B()&&l.props.animation){var r=ae(),i=r.box,s=r.content;qn([i,s],W),Ar([i,s],"visible")}De(),Te(),Or(Xn,l),(Ke=l.popperInstance)==null||Ke.forceUpdate(),ee("onMount",[l]),l.props.animation&&B()&&fe(W,function(){l.state.isShown=!0,ee("onShown",[l])})}},Ie()}}function Mn(){var m=!l.state.isVisible,v=l.state.isDestroyed,M=!l.state.isEnabled,$=Un(l.props.duration,1,He.duration);if(!(m||v||M)&&(ee("onHide",[l],!1),l.props.onHide(l)!==!1)){if(l.state.isVisible=!1,l.state.isShown=!1,b=!1,d=!1,B()&&(x.style.visibility="hidden"),Se(),Ee(),q(!0),B()){var W=ae(),te=W.box,pe=W.content;l.props.animation&&(qn([te,pe],$),Ar([te,pe],"hidden"))}De(),Te(),l.props.animation?B()&&Ne($,l.unmount):l.unmount()}}function An(m){le().addEventListener("mousemove",k),Or(gn,k),k(m)}function sn(){l.state.isVisible&&l.hide(),l.state.isMounted&&(ze(),Be().forEach(function(m){m._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Xn=Xn.filter(function(m){return m!==l}),l.state.isMounted=!1,ee("onHidden",[l]))}function Pn(){l.state.isDestroyed||(l.clearDelayTimeouts(),l.unmount(),qe(),delete t._tippy,l.state.isDestroyed=!0,ee("onDestroy",[l]))}}function Ut(t,n){n===void 0&&(n={});var e=He.plugins.concat(n.plugins||[]);vo();var o=Object.assign({},n,{plugins:e}),a=fo(t);if(0)var c,d;var p=a.reduce(function(u,b){var h=b&&Mo(b,o);return h&&u.push(h),u},[]);return bn(t)?p[0]:p}Ut.defaultProps=He;Ut.setDefaultProps=Eo;Ut.currentInput=Ye;var _l=Object.assign({},Rt,{effect:function(n){var e=n.state,o={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,o.popper),e.styles=o,e.elements.arrow&&Object.assign(e.elements.arrow.style,o.arrow)}});Ut.setDefaultProps({render:Br});var yn=Ut;var qt=class extends Wr.Controller{copy(t){t.preventDefault(),navigator.clipboard.writeText(this.textToCopy),this.showFeedback(t.currentTarget,"Copied!")}get textToCopy(){let{value:t,innerText:n}=this.contentTarget;return t||n}showFeedback(t,n){yn(t,{content:n,showOnCreate:!0,onHidden:e=>{e.destroy()}})}};K(qt,"targets",["content"]);var Yr=require("@hotwired/stimulus");var zt=class extends Yr.Controller{connect(){this.createObserver()}createObserver(){let t={root:null,rootMargin:"0px",threshold:.1};this.observer=new IntersectionObserver(this.handleIntersect.bind(this),t),this.observer.observe(this.element)}handleIntersect(t){t.forEach(n=>{n.isIntersecting&&(this.animateCountUp(),this.observer.unobserve(this.element))})}animateCountUp(){let n=this.targetValue,e=this.durationValue,o=60,a=Math.round(e/1e3*o),c=(n-0)/a,d=0,p=0,u=setInterval(()=>{d+=c,p++,p>=a&&(clearInterval(u),d=n),this.updateDisplay(d)},1e3/o)}updateDisplay(t){this.hasPercentage()?this.element.textContent=`${t.toFixed(1)}%`:this.element.textContent=this.formatNumber(t)}hasPercentage(){return this.element.dataset.railsuiCountUp&&this.element.dataset.railsuiCountUp.includes("%")}formatNumber(t){return Math.round(t).toLocaleString()}};K(zt,"values",{target:Number,duration:{type:Number,default:2e3}});var Jr=require("@hotwired/stimulus");var wn=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ot={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return typeof console<"u"&&console.warn(t)},getWeek:function(t){var n=new Date(t.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var e=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var xn={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var n=t%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Dn=xn;var he=function(t,n){return n===void 0&&(n=2),("000"+t).slice(n*-1)},ye=function(t){return t===!0?1:0};function Qn(t,n){var e;return function(){var o=this,a=arguments;clearTimeout(e),e=setTimeout(function(){return t.apply(o,a)},n)}}var En=function(t){return t instanceof Array?t:[t]};function ge(t,n,e){if(e===!0)return t.classList.add(n);t.classList.remove(n)}function U(t,n,e){var o=window.document.createElement(t);return n=n||"",e=e||"",o.className=n,e!==void 0&&(o.textContent=e),o}function Xt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Zn(t,n){if(n(t))return t;if(t.parentNode)return Zn(t.parentNode,n)}function Kt(t,n){var e=U("div","numInputWrapper"),o=U("input","numInput "+t),a=U("span","arrowUp"),c=U("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?o.type="number":(o.type="text",o.pattern="\\d*"),n!==void 0)for(var d in n)o.setAttribute(d,n[d]);return e.appendChild(o),e.appendChild(a),e.appendChild(c),e}function we(t){try{if(typeof t.composedPath=="function"){var n=t.composedPath();return n[0]}return t.target}catch{return t.target}}var er=function(){},Jt=function(t,n,e){return e.months[n?"shorthand":"longhand"][t]},$r={D:er,F:function(t,n,e){t.setMonth(e.months.longhand.indexOf(n))},G:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},H:function(t,n){t.setHours(parseFloat(n))},J:function(t,n){t.setDate(parseFloat(n))},K:function(t,n,e){t.setHours(t.getHours()%12+12*ye(new RegExp(e.amPM[1],"i").test(n)))},M:function(t,n,e){t.setMonth(e.months.shorthand.indexOf(n))},S:function(t,n){t.setSeconds(parseFloat(n))},U:function(t,n){return new Date(parseFloat(n)*1e3)},W:function(t,n,e){var o=parseInt(n),a=new Date(t.getFullYear(),0,2+(o-1)*7,0,0,0,0);return a.setDate(a.getDate()-a.getDay()+e.firstDayOfWeek),a},Y:function(t,n){t.setFullYear(parseFloat(n))},Z:function(t,n){return new Date(n)},d:function(t,n){t.setDate(parseFloat(n))},h:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},i:function(t,n){t.setMinutes(parseFloat(n))},j:function(t,n){t.setDate(parseFloat(n))},l:er,m:function(t,n){t.setMonth(parseFloat(n)-1)},n:function(t,n){t.setMonth(parseFloat(n)-1)},s:function(t,n){t.setSeconds(parseFloat(n))},u:function(t,n){return new Date(parseFloat(n))},w:er,y:function(t,n){t.setFullYear(2e3+parseFloat(n))}},Ze={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Nt={Z:function(t){return t.toISOString()},D:function(t,n,e){return n.weekdays.shorthand[Nt.w(t,n,e)]},F:function(t,n,e){return Jt(Nt.n(t,n,e)-1,!1,n)},G:function(t,n,e){return he(Nt.h(t,n,e))},H:function(t){return he(t.getHours())},J:function(t,n){return n.ordinal!==void 0?t.getDate()+n.ordinal(t.getDate()):t.getDate()},K:function(t,n){return n.amPM[ye(t.getHours()>11)]},M:function(t,n){return Jt(t.getMonth(),!0,n)},S:function(t){return he(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,n,e){return e.getWeek(t)},Y:function(t){return he(t.getFullYear(),4)},d:function(t){return he(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return he(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,n){return n.weekdays.longhand[t.getDay()]},m:function(t){return he(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}};var tr=function(t){var n=t.config,e=n===void 0?ot:n,o=t.l10n,a=o===void 0?xn:o,c=t.isMobile,d=c===void 0?!1:c;return function(p,u,b){var h=b||a;return e.formatDate!==void 0&&!d?e.formatDate(p,u,h):u.split("").map(function(O,T,E){return Nt[O]&&E[T-1]!=="\\"?Nt[O](p,h,e):O!=="\\"?O:""}).join("")}},Cn=function(t){var n=t.config,e=n===void 0?ot:n,o=t.l10n,a=o===void 0?xn:o;return function(c,d,p,u){if(!(c!==0&&!c)){var b=u||a,h,O=c;if(c instanceof Date)h=new Date(c.getTime());else if(typeof c!="string"&&c.toFixed!==void 0)h=new Date(c);else if(typeof c=="string"){var T=d||(e||ot).dateFormat,E=String(c).trim();if(E==="today")h=new Date,p=!0;else if(e&&e.parseDate)h=e.parseDate(c,T);else if(/Z$/.test(E)||/GMT$/.test(E))h=new Date(c);else{for(var k=void 0,w=[],P=0,V=0,I="";PMath.min(n,e)&&t=0?new Date:new Date(e.config.minDate.getTime()),s=On(e.config);i.setHours(s.hours,s.minutes,s.seconds,i.getMilliseconds()),e.selectedDates=[i],e.latestSelectedDateObj=i}r!==void 0&&r.type!=="blur"&&Ke(r);var f=e._input.value;O(),me(),e._input.value!==f&&e._debouncedChange()}function b(r,i){return r%12+12*ye(i===e.l10n.amPM[1])}function h(r){switch(r%24){case 0:case 12:return 12;default:return r%12}}function O(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var r=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(e.minuteElement.value,10)||0)%60,s=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(r=b(r,e.amPM.textContent));var f=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&xe(e.latestSelectedDateObj,e.config.minDate,!0)===0,g=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&xe(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var y=Tn(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),L=Tn(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),C=Tn(r,i,s);if(C>L&&C=12)]),e.secondElement!==void 0&&(e.secondElement.value=he(s)))}function k(r){var i=we(r),s=parseInt(i.value)+(r.delta||0);(s/1e3>1||r.key==="Enter"&&!/[^\d]/.test(s.toString()))&&Ne(s)}function w(r,i,s,f){if(i instanceof Array)return i.forEach(function(g){return w(r,g,s,f)});if(r instanceof Array)return r.forEach(function(g){return w(g,i,s,f)});r.addEventListener(i,s,f),e._handlers.push({remove:function(){return r.removeEventListener(i,s,f)}})}function P(){v("onChange")}function V(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(s){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+s+"]"),function(f){return w(f,"click",e[s])})}),e.isMobile){Pn();return}var r=Qn(ct,50);if(e._debouncedChange=Qn(P,Ao),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&w(e.daysContainer,"mouseover",function(s){e.config.mode==="range"&&qe(we(s))}),w(e._input,"keydown",Ue),e.calendarContainer!==void 0&&w(e.calendarContainer,"keydown",Ue),!e.config.inline&&!e.config.static&&w(window,"resize",r),window.ontouchstart!==void 0?w(window.document,"touchstart",Ee):w(window.document,"mousedown",Ee),w(window.document,"focus",Ee,{capture:!0}),e.config.clickOpens===!0&&(w(e._input,"focus",e.open),w(e._input,"click",e.open)),e.daysContainer!==void 0&&(w(e.monthNav,"click",cn),w(e.monthNav,["keyup","increment"],k),w(e.daysContainer,"click",nt)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var i=function(s){return we(s).select()};w(e.timeContainer,["increment"],u),w(e.timeContainer,"blur",u,{capture:!0}),w(e.timeContainer,"click",_),w([e.hourElement,e.minuteElement],["focus","click"],i),e.secondElement!==void 0&&w(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&w(e.amPM,"click",function(s){u(s)})}e.config.allowInput&&w(e._input,"blur",Ve)}function I(r,i){var s=r!==void 0?e.parseDate(r):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate1),e.calendarContainer.appendChild(r);var g=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!g&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var y=U("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(y,e.element),y.appendChild(e.element),e.altInput&&y.appendChild(e.altInput),y.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function x(r,i,s,f){var g=fe(i,!0),y=U("span",r,i.getDate().toString());return y.dateObj=i,y.$i=f,y.setAttribute("aria-label",e.formatDate(i,e.config.ariaDateFormat)),r.indexOf("hidden")===-1&&xe(i,e.now)===0&&(e.todayDateElem=y,y.classList.add("today"),y.setAttribute("aria-current","date")),g?(y.tabIndex=-1,$(i)&&(y.classList.add("selected"),e.selectedDateElem=y,e.config.mode==="range"&&(ge(y,"startRange",e.selectedDates[0]&&xe(i,e.selectedDates[0],!0)===0),ge(y,"endRange",e.selectedDates[1]&&xe(i,e.selectedDates[1],!0)===0),r==="nextMonthDay"&&y.classList.add("inRange")))):y.classList.add("flatpickr-disabled"),e.config.mode==="range"&&W(i)&&!$(i)&&y.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&r!=="prevMonthDay"&&f%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend",""+e.config.getWeek(i)+""),v("onDayCreate",y),y}function H(r){r.focus(),e.config.mode==="range"&&qe(r)}function Y(r){for(var i=r>0?0:e.config.showMonths-1,s=r>0?e.config.showMonths:-1,f=i;f!=s;f+=r)for(var g=e.daysContainer.children[f],y=r>0?0:g.children.length-1,L=r>0?g.children.length:-1,C=y;C!=L;C+=r){var R=g.children[C];if(R.className.indexOf("hidden")===-1&&fe(R.dateObj))return R}}function A(r,i){for(var s=r.className.indexOf("Month")===-1?r.dateObj.getMonth():e.currentMonth,f=i>0?e.config.showMonths:-1,g=i>0?1:-1,y=s-e.currentMonth;y!=f;y+=g)for(var L=e.daysContainer.children[y],C=s-e.currentMonth===y?r.$i+i:i<0?L.children.length-1:0,R=L.children.length,D=C;D>=0&&D0?R:-1);D+=g){var S=L.children[D];if(S.className.indexOf("hidden")===-1&&fe(S.dateObj)&&Math.abs(r.$i-D)>=Math.abs(i))return H(S)}e.changeMonth(g),N(Y(g),0)}function N(r,i){var s=c(),f=Le(s||document.body),g=r!==void 0?r:f?s:e.selectedDateElem!==void 0&&Le(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&Le(e.todayDateElem)?e.todayDateElem:Y(i>0?1:-1);g===void 0?e._input.focus():f?A(g,i):H(g)}function z(r,i){for(var s=(new Date(r,i,1).getDay()-e.l10n.firstDayOfWeek+7)%7,f=e.utils.getDaysInMonth((i-1+12)%12,r),g=e.utils.getDaysInMonth(i,r),y=window.document.createDocumentFragment(),L=e.config.showMonths>1,C=L?"prevMonthDay hidden":"prevMonthDay",R=L?"nextMonthDay hidden":"nextMonthDay",D=f+1-s,S=0;D<=f;D++,S++)y.appendChild(x("flatpickr-day "+C,new Date(r,i-1,D),D,S));for(D=1;D<=g;D++,S++)y.appendChild(x("flatpickr-day",new Date(r,i,D),D,S));for(var X=g+1;X<=42-s&&(e.config.showMonths===1||S%7!==0);X++,S++)y.appendChild(x("flatpickr-day "+R,new Date(r,i+1,X%g),X,S));var We=U("div","dayContainer");return We.appendChild(y),We}function B(){if(e.daysContainer!==void 0){Xt(e.daysContainer),e.weekNumbers&&Xt(e.weekNumbers);for(var r=document.createDocumentFragment(),i=0;i1||e.config.monthSelectorType!=="dropdown")){var r=function(f){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&fe.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var i=0;i<12;i++)if(r(i)){var s=U("option","flatpickr-monthDropdown-month");s.value=new Date(e.currentYear,i).getMonth().toString(),s.textContent=Jt(i,e.config.shorthandCurrentMonth,e.l10n),s.tabIndex=-1,e.currentMonth===i&&(s.selected=!0),e.monthsDropdownContainer.appendChild(s)}}}function le(){var r=U("div","flatpickr-month"),i=window.document.createDocumentFragment(),s;e.config.showMonths>1||e.config.monthSelectorType==="static"?s=U("span","cur-month"):(e.monthsDropdownContainer=U("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),w(e.monthsDropdownContainer,"change",function(L){var C=we(L),R=parseInt(C.value,10);e.changeMonth(R-e.currentMonth),v("onMonthChange")}),j(),s=e.monthsDropdownContainer);var f=Kt("cur-year",{tabindex:"-1"}),g=f.getElementsByTagName("input")[0];g.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&g.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(g.setAttribute("max",e.config.maxDate.getFullYear().toString()),g.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var y=U("div","flatpickr-current-month");return y.appendChild(s),y.appendChild(f),i.appendChild(y),r.appendChild(i),{container:r,yearElement:g,monthElement:s}}function ae(){Xt(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var r=e.config.showMonths;r--;){var i=le();e.yearElements.push(i.yearElement),e.monthElements.push(i.monthElement),e.monthNav.appendChild(i.container)}e.monthNav.appendChild(e.nextMonthNav)}function J(){return e.monthNav=U("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=U("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=U("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,ae(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(r){e.__hidePrevMonthArrow!==r&&(ge(e.prevMonthNav,"flatpickr-disabled",r),e.__hidePrevMonthArrow=r)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(r){e.__hideNextMonthArrow!==r&&(ge(e.nextMonthNav,"flatpickr-disabled",r),e.__hideNextMonthArrow=r)}}),e.currentYearElement=e.yearElements[0],te(),e.monthNav}function q(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var r=On(e.config);e.timeContainer=U("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var i=U("span","flatpickr-time-separator",":"),s=Kt("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=s.getElementsByTagName("input")[0];var f=Kt("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=f.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=he(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?r.hours:h(r.hours)),e.minuteElement.value=he(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():r.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(s),e.timeContainer.appendChild(i),e.timeContainer.appendChild(f),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var g=Kt("flatpickr-second");e.secondElement=g.getElementsByTagName("input")[0],e.secondElement.value=he(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():r.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(U("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(g)}return e.config.time_24hr||(e.amPM=U("span","flatpickr-am-pm",e.l10n.amPM[ye((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function ee(){e.weekdayContainer?Xt(e.weekdayContainer):e.weekdayContainer=U("div","flatpickr-weekdays");for(var r=e.config.showMonths;r--;){var i=U("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(i)}return De(),e.weekdayContainer}function De(){if(e.weekdayContainer){var r=e.l10n.firstDayOfWeek,i=Xr(e.l10n.weekdays.shorthand);r>0&&rn in t?un(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var Ci=(t,n)=>{for(var e in n)un(t,e,{get:n[e],enumerable:!0})},Ei=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of wi(n))!xi.call(t,a)&&a!==e&&un(t,a,{get:()=>n[a],enumerable:!(o=yi(n,a))||o.enumerable});return t};var Ti=t=>Ei(un({},"__esModule",{value:!0}),t);var X=(t,n,e)=>(Di(t,typeof n!="symbol"?n+"":n,e),e);var Wo={};Ci(Wo,{RailsuiClipboard:()=>zt,RailsuiCombobox:()=>It,RailsuiCountUp:()=>Xt,RailsuiDateRangePicker:()=>Ft,RailsuiDropdown:()=>Qt,RailsuiModal:()=>Zt,RailsuiRange:()=>en,RailsuiReadMore:()=>jt,RailsuiSelectAll:()=>tn,RailsuiTabs:()=>nn,RailsuiToast:()=>rn,RailsuiToggle:()=>on,RailsuiTooltip:()=>an});module.exports=Ti(Wo);var Yr=require("@hotwired/stimulus");var Q="top",ie="bottom",ne="right",Z="left",fn="auto",it=[Q,ie,ne,Z],Ge="start",pt="end",ar="clippingParents",dn="viewport",Ot="popper",sr="reference",In=it.reduce(function(t,n){return t.concat([n+"-"+Ge,n+"-"+pt])},[]),pn=[].concat(it,[fn]).reduce(function(t,n){return t.concat([n,n+"-"+Ge,n+"-"+pt])},[]),Oi="beforeRead",Mi="read",Ai="afterRead",Si="beforeMain",Pi="main",ki="afterMain",Ii="beforeWrite",Li="write",Ni="afterWrite",cr=[Oi,Mi,Ai,Si,Pi,ki,Ii,Li,Ni];function se(t){return t?(t.nodeName||"").toLowerCase():null}function G(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function Me(t){var n=G(t).Element;return t instanceof n||t instanceof Element}function oe(t){var n=G(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function Mt(t){if(typeof ShadowRoot>"u")return!1;var n=G(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function Fi(t){var n=t.state;Object.keys(n.elements).forEach(function(e){var o=n.styles[e]||{},a=n.attributes[e]||{},c=n.elements[e];!oe(c)||!se(c)||(Object.assign(c.style,o),Object.keys(a).forEach(function(d){var p=a[d];p===!1?c.removeAttribute(d):c.setAttribute(d,p===!0?"":p)}))})}function ji(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach(function(o){var a=n.elements[o],c=n.attributes[o]||{},d=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:e[o]),p=d.reduce(function(u,b){return u[b]="",u},{});!oe(a)||!se(a)||(Object.assign(a.style,p),Object.keys(c).forEach(function(u){a.removeAttribute(u)}))})}}var _t={name:"applyStyles",enabled:!0,phase:"write",fn:Fi,effect:ji,requires:["computeStyles"]};function ce(t){return t.split("-")[0]}var je=Math.max,mt=Math.min,Qe=Math.round;function At(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function Vt(){return!/^((?!chrome|android).)*safari/i.test(At())}function Ae(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);var o=t.getBoundingClientRect(),a=1,c=1;n&&oe(t)&&(a=t.offsetWidth>0&&Qe(o.width)/t.offsetWidth||1,c=t.offsetHeight>0&&Qe(o.height)/t.offsetHeight||1);var d=Me(t)?G(t):window,p=d.visualViewport,u=!Vt()&&e,b=(o.left+(u&&p?p.offsetLeft:0))/a,h=(o.top+(u&&p?p.offsetTop:0))/c,O=o.width/a,T=o.height/c;return{width:O,height:T,top:h,right:b+O,bottom:h+T,left:b,x:b,y:h}}function ht(t){var n=Ae(t),e=t.offsetWidth,o=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:o}}function Ht(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&Mt(e)){var o=n;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function be(t){return G(t).getComputedStyle(t)}function Ln(t){return["table","td","th"].indexOf(se(t))>=0}function de(t){return((Me(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ze(t){return se(t)==="html"?t:t.assignedSlot||t.parentNode||(Mt(t)?t.host:null)||de(t)}function lr(t){return!oe(t)||be(t).position==="fixed"?null:t.offsetParent}function Ri(t){var n=/firefox/i.test(At()),e=/Trident/i.test(At());if(e&&oe(t)){var o=be(t);if(o.position==="fixed")return null}var a=Ze(t);for(Mt(a)&&(a=a.host);oe(a)&&["html","body"].indexOf(se(a))<0;){var c=be(a);if(c.transform!=="none"||c.perspective!=="none"||c.contain==="paint"||["transform","perspective"].indexOf(c.willChange)!==-1||n&&c.willChange==="filter"||n&&c.filter&&c.filter!=="none")return a;a=a.parentNode}return null}function Re(t){for(var n=G(t),e=lr(t);e&&Ln(e)&&be(e).position==="static";)e=lr(e);return e&&(se(e)==="html"||se(e)==="body"&&be(e).position==="static")?n:e||Ri(t)||n}function gt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function vt(t,n,e){return je(t,mt(n,e))}function ur(t,n,e){var o=vt(t,n,e);return o>e?e:o}function Bt(){return{top:0,right:0,bottom:0,left:0}}function Wt(t){return Object.assign({},Bt(),t)}function Yt(t,n){return n.reduce(function(e,o){return e[o]=t,e},{})}var _i=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,Wt(typeof n!="number"?n:Yt(n,it))};function Vi(t){var n,e=t.state,o=t.name,a=t.options,c=e.elements.arrow,d=e.modifiersData.popperOffsets,p=ce(e.placement),u=gt(p),b=[Z,ne].indexOf(p)>=0,h=b?"height":"width";if(!(!c||!d)){var O=_i(a.padding,e),T=ht(c),C=u==="y"?Q:Z,k=u==="y"?ie:ne,w=e.rects.reference[h]+e.rects.reference[u]-d[u]-e.rects.popper[h],S=d[u]-e.rects.reference[u],H=Re(c),N=H?u==="y"?H.clientHeight||0:H.clientWidth||0:0,_=w/2-S/2,l=O[C],F=N-T[h]-O[k],x=N/2-T[h]/2+_,V=vt(l,x,F),Y=u;e.modifiersData[o]=(n={},n[Y]=V,n.centerOffset=V-x,n)}}function Hi(t){var n=t.state,e=t.options,o=e.element,a=o===void 0?"[data-popper-arrow]":o;a!=null&&(typeof a=="string"&&(a=n.elements.popper.querySelector(a),!a)||Ht(n.elements.popper,a)&&(n.elements.arrow=a))}var fr={name:"arrow",enabled:!0,phase:"main",fn:Vi,effect:Hi,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Se(t){return t.split("-")[1]}var Bi={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wi(t,n){var e=t.x,o=t.y,a=n.devicePixelRatio||1;return{x:Qe(e*a)/a||0,y:Qe(o*a)/a||0}}function dr(t){var n,e=t.popper,o=t.popperRect,a=t.placement,c=t.variation,d=t.offsets,p=t.position,u=t.gpuAcceleration,b=t.adaptive,h=t.roundOffsets,O=t.isFixed,T=d.x,C=T===void 0?0:T,k=d.y,w=k===void 0?0:k,S=typeof h=="function"?h({x:C,y:w}):{x:C,y:w};C=S.x,w=S.y;var H=d.hasOwnProperty("x"),N=d.hasOwnProperty("y"),_=Z,l=Q,F=window;if(b){var x=Re(e),V="clientHeight",Y="clientWidth";if(x===G(e)&&(x=de(e),be(x).position!=="static"&&p==="absolute"&&(V="scrollHeight",Y="scrollWidth")),x=x,a===Q||(a===Z||a===ne)&&c===pt){l=ie;var A=O&&x===F&&F.visualViewport?F.visualViewport.height:x[V];w-=A-o.height,w*=u?1:-1}if(a===Z||(a===Q||a===ie)&&c===pt){_=ne;var I=O&&x===F&&F.visualViewport?F.visualViewport.width:x[Y];C-=I-o.width,C*=u?1:-1}}var z=Object.assign({position:p},b&&Bi),B=h===!0?Wi({x:C,y:w},G(e)):{x:C,y:w};if(C=B.x,w=B.y,u){var j;return Object.assign({},z,(j={},j[l]=N?"0":"",j[_]=H?"0":"",j.transform=(F.devicePixelRatio||1)<=1?"translate("+C+"px, "+w+"px)":"translate3d("+C+"px, "+w+"px, 0)",j))}return Object.assign({},z,(n={},n[l]=N?w+"px":"",n[_]=H?C+"px":"",n.transform="",n))}function Yi(t){var n=t.state,e=t.options,o=e.gpuAcceleration,a=o===void 0?!0:o,c=e.adaptive,d=c===void 0?!0:c,p=e.roundOffsets,u=p===void 0?!0:p,b={placement:ce(n.placement),variation:Se(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:a,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,dr(Object.assign({},b,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:d,roundOffsets:u})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,dr(Object.assign({},b,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}var pr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Yi,data:{}};var mn={passive:!0};function $i(t){var n=t.state,e=t.instance,o=t.options,a=o.scroll,c=a===void 0?!0:a,d=o.resize,p=d===void 0?!0:d,u=G(n.elements.popper),b=[].concat(n.scrollParents.reference,n.scrollParents.popper);return c&&b.forEach(function(h){h.addEventListener("scroll",e.update,mn)}),p&&u.addEventListener("resize",e.update,mn),function(){c&&b.forEach(function(h){h.removeEventListener("scroll",e.update,mn)}),p&&u.removeEventListener("resize",e.update,mn)}}var mr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$i,data:{}};var Ui={left:"right",right:"left",bottom:"top",top:"bottom"};function St(t){return t.replace(/left|right|bottom|top/g,function(n){return Ui[n]})}var qi={start:"end",end:"start"};function hn(t){return t.replace(/start|end/g,function(n){return qi[n]})}function bt(t){var n=G(t),e=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:e,scrollTop:o}}function yt(t){return Ae(de(t)).left+bt(t).scrollLeft}function Nn(t,n){var e=G(t),o=de(t),a=e.visualViewport,c=o.clientWidth,d=o.clientHeight,p=0,u=0;if(a){c=a.width,d=a.height;var b=Vt();(b||!b&&n==="fixed")&&(p=a.offsetLeft,u=a.offsetTop)}return{width:c,height:d,x:p+yt(t),y:u}}function Fn(t){var n,e=de(t),o=bt(t),a=(n=t.ownerDocument)==null?void 0:n.body,c=je(e.scrollWidth,e.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),d=je(e.scrollHeight,e.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),p=-o.scrollLeft+yt(t),u=-o.scrollTop;return be(a||e).direction==="rtl"&&(p+=je(e.clientWidth,a?a.clientWidth:0)-c),{width:c,height:d,x:p,y:u}}function wt(t){var n=be(t),e=n.overflow,o=n.overflowX,a=n.overflowY;return/auto|scroll|overlay|hidden/.test(e+a+o)}function gn(t){return["html","body","#document"].indexOf(se(t))>=0?t.ownerDocument.body:oe(t)&&wt(t)?t:gn(Ze(t))}function ot(t,n){var e;n===void 0&&(n=[]);var o=gn(t),a=o===((e=t.ownerDocument)==null?void 0:e.body),c=G(o),d=a?[c].concat(c.visualViewport||[],wt(o)?o:[]):o,p=n.concat(d);return a?p:p.concat(ot(Ze(d)))}function Pt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function zi(t,n){var e=Ae(t,!1,n==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function hr(t,n,e){return n===dn?Pt(Nn(t,e)):Me(n)?zi(n,e):Pt(Fn(de(t)))}function Xi(t){var n=ot(Ze(t)),e=["absolute","fixed"].indexOf(be(t).position)>=0,o=e&&oe(t)?Re(t):t;return Me(o)?n.filter(function(a){return Me(a)&&Ht(a,o)&&se(a)!=="body"}):[]}function jn(t,n,e,o){var a=n==="clippingParents"?Xi(t):[].concat(n),c=[].concat(a,[e]),d=c[0],p=c.reduce(function(u,b){var h=hr(t,b,o);return u.top=je(h.top,u.top),u.right=mt(h.right,u.right),u.bottom=mt(h.bottom,u.bottom),u.left=je(h.left,u.left),u},hr(t,d,o));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function $t(t){var n=t.reference,e=t.element,o=t.placement,a=o?ce(o):null,c=o?Se(o):null,d=n.x+n.width/2-e.width/2,p=n.y+n.height/2-e.height/2,u;switch(a){case Q:u={x:d,y:n.y-e.height};break;case ie:u={x:d,y:n.y+n.height};break;case ne:u={x:n.x+n.width,y:p};break;case Z:u={x:n.x-e.width,y:p};break;default:u={x:n.x,y:n.y}}var b=a?gt(a):null;if(b!=null){var h=b==="y"?"height":"width";switch(c){case Ge:u[b]=u[b]-(n[h]/2-e[h]/2);break;case pt:u[b]=u[b]+(n[h]/2-e[h]/2);break;default:}}return u}function _e(t,n){n===void 0&&(n={});var e=n,o=e.placement,a=o===void 0?t.placement:o,c=e.strategy,d=c===void 0?t.strategy:c,p=e.boundary,u=p===void 0?ar:p,b=e.rootBoundary,h=b===void 0?dn:b,O=e.elementContext,T=O===void 0?Ot:O,C=e.altBoundary,k=C===void 0?!1:C,w=e.padding,S=w===void 0?0:w,H=Wt(typeof S!="number"?S:Yt(S,it)),N=T===Ot?sr:Ot,_=t.rects.popper,l=t.elements[k?N:T],F=jn(Me(l)?l:l.contextElement||de(t.elements.popper),u,h,d),x=Ae(t.elements.reference),V=$t({reference:x,element:_,strategy:"absolute",placement:a}),Y=Pt(Object.assign({},_,V)),A=T===Ot?Y:x,I={top:F.top-A.top+H.top,bottom:A.bottom-F.bottom+H.bottom,left:F.left-A.left+H.left,right:A.right-F.right+H.right},z=t.modifiersData.offset;if(T===Ot&&z){var B=z[a];Object.keys(I).forEach(function(j){var le=[ne,ie].indexOf(j)>=0?1:-1,ae=[Q,ie].indexOf(j)>=0?"y":"x";I[j]+=B[ae]*le})}return I}function Rn(t,n){n===void 0&&(n={});var e=n,o=e.placement,a=e.boundary,c=e.rootBoundary,d=e.padding,p=e.flipVariations,u=e.allowedAutoPlacements,b=u===void 0?pn:u,h=Se(o),O=h?p?In:In.filter(function(k){return Se(k)===h}):it,T=O.filter(function(k){return b.indexOf(k)>=0});T.length===0&&(T=O);var C=T.reduce(function(k,w){return k[w]=_e(t,{placement:w,boundary:a,rootBoundary:c,padding:d})[ce(w)],k},{});return Object.keys(C).sort(function(k,w){return C[k]-C[w]})}function Ki(t){if(ce(t)===fn)return[];var n=St(t);return[hn(t),n,hn(n)]}function Ji(t){var n=t.state,e=t.options,o=t.name;if(!n.modifiersData[o]._skip){for(var a=e.mainAxis,c=a===void 0?!0:a,d=e.altAxis,p=d===void 0?!0:d,u=e.fallbackPlacements,b=e.padding,h=e.boundary,O=e.rootBoundary,T=e.altBoundary,C=e.flipVariations,k=C===void 0?!0:C,w=e.allowedAutoPlacements,S=n.options.placement,H=ce(S),N=H===S,_=u||(N||!k?[St(S)]:Ki(S)),l=[S].concat(_).reduce(function(ke,ue){return ke.concat(ce(ue)===fn?Rn(n,{placement:ue,boundary:h,rootBoundary:O,padding:b,flipVariations:k,allowedAutoPlacements:w}):ue)},[]),F=n.rects.reference,x=n.rects.popper,V=new Map,Y=!0,A=l[0],I=0;I=0,ae=le?"width":"height",J=_e(n,{placement:z,boundary:h,rootBoundary:O,altBoundary:T,padding:b}),q=le?j?ne:Z:j?ie:Q;F[ae]>x[ae]&&(q=St(q));var ee=St(q),De=[];if(c&&De.push(J[B]<=0),p&&De.push(J[q]<=0,J[ee]<=0),De.every(function(ke){return ke})){A=z,Y=!1;break}V.set(z,De)}if(Y)for(var Te=k?3:1,Pe=function(ue){var Ce=l.find(function(Ie){var fe=V.get(Ie);if(fe)return fe.slice(0,ue).every(function(Le){return Le})});if(Ce)return A=Ce,"break"},Oe=Te;Oe>0;Oe--){var Ue=Pe(Oe);if(Ue==="break")break}n.placement!==A&&(n.modifiersData[o]._skip=!0,n.placement=A,n.reset=!0)}}var gr={name:"flip",enabled:!0,phase:"main",fn:Ji,requiresIfExists:["offset"],data:{_skip:!1}};function vr(t,n,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function br(t){return[Q,ne,ie,Z].some(function(n){return t[n]>=0})}function Gi(t){var n=t.state,e=t.name,o=n.rects.reference,a=n.rects.popper,c=n.modifiersData.preventOverflow,d=_e(n,{elementContext:"reference"}),p=_e(n,{altBoundary:!0}),u=vr(d,o),b=vr(p,a,c),h=br(u),O=br(b);n.modifiersData[e]={referenceClippingOffsets:u,popperEscapeOffsets:b,isReferenceHidden:h,hasPopperEscaped:O},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":O})}var yr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Gi};function Qi(t,n,e){var o=ce(t),a=[Z,Q].indexOf(o)>=0?-1:1,c=typeof e=="function"?e(Object.assign({},n,{placement:t})):e,d=c[0],p=c[1];return d=d||0,p=(p||0)*a,[Z,ne].indexOf(o)>=0?{x:p,y:d}:{x:d,y:p}}function Zi(t){var n=t.state,e=t.options,o=t.name,a=e.offset,c=a===void 0?[0,0]:a,d=pn.reduce(function(h,O){return h[O]=Qi(O,n.rects,c),h},{}),p=d[n.placement],u=p.x,b=p.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=u,n.modifiersData.popperOffsets.y+=b),n.modifiersData[o]=d}var wr={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Zi};function eo(t){var n=t.state,e=t.name;n.modifiersData[e]=$t({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}var xr={name:"popperOffsets",enabled:!0,phase:"read",fn:eo,data:{}};function _n(t){return t==="x"?"y":"x"}function to(t){var n=t.state,e=t.options,o=t.name,a=e.mainAxis,c=a===void 0?!0:a,d=e.altAxis,p=d===void 0?!1:d,u=e.boundary,b=e.rootBoundary,h=e.altBoundary,O=e.padding,T=e.tether,C=T===void 0?!0:T,k=e.tetherOffset,w=k===void 0?0:k,S=_e(n,{boundary:u,rootBoundary:b,padding:O,altBoundary:h}),H=ce(n.placement),N=Se(n.placement),_=!N,l=gt(H),F=_n(l),x=n.modifiersData.popperOffsets,V=n.rects.reference,Y=n.rects.popper,A=typeof w=="function"?w(Object.assign({},n.rects,{placement:n.placement})):w,I=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),z=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,B={x:0,y:0};if(x){if(c){var j,le=l==="y"?Q:Z,ae=l==="y"?ie:ne,J=l==="y"?"height":"width",q=x[l],ee=q+S[le],De=q-S[ae],Te=C?-Y[J]/2:0,Pe=N===Ge?V[J]:Y[J],Oe=N===Ge?-Y[J]:-V[J],Ue=n.elements.arrow,ke=C&&Ue?ht(Ue):{width:0,height:0},ue=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:Bt(),Ce=ue[le],Ie=ue[ae],fe=vt(0,V[J],ke[J]),Le=_?V[J]/2-Te-fe-Ce-I.mainAxis:Pe-fe-Ce-I.mainAxis,He=_?-V[J]/2+Te+fe+Ie+I.mainAxis:Oe+fe+Ie+I.mainAxis,qe=n.elements.arrow&&Re(n.elements.arrow),ze=qe?l==="y"?qe.clientTop||0:qe.clientLeft||0:0,ct=(j=z?.[l])!=null?j:0,Dt=q+Le-ct-ze,lt=q+He-ct,ut=vt(C?mt(ee,Dt):ee,q,C?je(De,lt):De);x[l]=ut,B[l]=ut-q}if(p){var tt,ft=l==="x"?Q:Z,Xe=l==="x"?ie:ne,Ne=x[F],Be=F==="y"?"height":"width",nt=Ne+S[ft],Fe=Ne-S[Xe],rt=[Q,Z].indexOf(H)!==-1,Ke=(tt=z?.[F])!=null?tt:0,Ct=rt?nt:Ne-V[Be]-Y[Be]-Ke+I.altAxis,dt=rt?Ne+V[Be]+Y[Be]-Ke-I.altAxis:Fe,Et=C&&rt?ur(Ct,Ne,dt):vt(C?Ct:nt,Ne,C?dt:Fe);x[F]=Et,B[F]=Et-Ne}n.modifiersData[o]=B}}var Dr={name:"preventOverflow",enabled:!0,phase:"main",fn:to,requiresIfExists:["offset"]};function Vn(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function Hn(t){return t===G(t)||!oe(t)?bt(t):Vn(t)}function no(t){var n=t.getBoundingClientRect(),e=Qe(n.width)/t.offsetWidth||1,o=Qe(n.height)/t.offsetHeight||1;return e!==1||o!==1}function Bn(t,n,e){e===void 0&&(e=!1);var o=oe(n),a=oe(n)&&no(n),c=de(n),d=Ae(t,a,e),p={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!e)&&((se(n)!=="body"||wt(c))&&(p=Hn(n)),oe(n)?(u=Ae(n,!0),u.x+=n.clientLeft,u.y+=n.clientTop):c&&(u.x=yt(c))),{x:d.left+p.scrollLeft-u.x,y:d.top+p.scrollTop-u.y,width:d.width,height:d.height}}function ro(t){var n=new Map,e=new Set,o=[];t.forEach(function(c){n.set(c.name,c)});function a(c){e.add(c.name);var d=[].concat(c.requires||[],c.requiresIfExists||[]);d.forEach(function(p){if(!e.has(p)){var u=n.get(p);u&&a(u)}}),o.push(c)}return t.forEach(function(c){e.has(c.name)||a(c)}),o}function Wn(t){var n=ro(t);return cr.reduce(function(e,o){return e.concat(n.filter(function(a){return a.phase===o}))},[])}function Yn(t){var n;return function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(t())})})),n}}function $n(t){var n=t.reduce(function(e,o){var a=e[o.name];return e[o.name]=a?Object.assign({},a,o,{options:Object.assign({},a.options,o.options),data:Object.assign({},a.data,o.data)}):o,e},{});return Object.keys(n).map(function(e){return n[e]})}var Cr={placement:"bottom",modifiers:[],strategy:"absolute"};function Er(){for(var t=arguments.length,n=new Array(t),e=0;e-1}function Vr(t,n){return typeof t=="function"?t.apply(void 0,n):t}function Or(t,n){if(n===0)return t;var e;return function(o){clearTimeout(e),e=setTimeout(function(){t(o)},n)}}function so(t){return t.split(/\s+/).filter(Boolean)}function kt(t){return[].concat(t)}function Mr(t,n){t.indexOf(n)===-1&&t.push(n)}function co(t){return t.filter(function(n,e){return t.indexOf(n)===e})}function lo(t){return t.split("-")[0]}function bn(t){return[].slice.call(t)}function Ar(t){return Object.keys(t).reduce(function(n,e){return t[e]!==void 0&&(n[e]=t[e]),n},{})}function Ut(){return document.createElement("div")}function yn(t){return["Element","Fragment"].some(function(n){return Qn(t,n)})}function uo(t){return Qn(t,"NodeList")}function fo(t){return Qn(t,"MouseEvent")}function po(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function mo(t){return yn(t)?[t]:uo(t)?bn(t):Array.isArray(t)?t:bn(document.querySelectorAll(t))}function zn(t,n){t.forEach(function(e){e&&(e.style.transitionDuration=n+"ms")})}function Sr(t,n){t.forEach(function(e){e&&e.setAttribute("data-state",n)})}function ho(t){var n,e=kt(t),o=e[0];return o!=null&&(n=o.ownerDocument)!=null&&n.body?o.ownerDocument:document}function go(t,n){var e=n.clientX,o=n.clientY;return t.every(function(a){var c=a.popperRect,d=a.popperState,p=a.props,u=p.interactiveBorder,b=lo(d.placement),h=d.modifiersData.offset;if(!h)return!0;var O=b==="bottom"?h.top.y:0,T=b==="top"?h.bottom.y:0,C=b==="right"?h.left.x:0,k=b==="left"?h.right.x:0,w=c.top-o+O>u,S=o-c.bottom-T>u,H=c.left-e+C>u,N=e-c.right-k>u;return w||S||H||N})}function Xn(t,n,e){var o=n+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(a){t[o](a,e)})}function Pr(t,n){for(var e=n;e;){var o;if(t.contains(e))return!0;e=e.getRootNode==null||(o=e.getRootNode())==null?void 0:o.host}return!1}var Ye={isTouch:!1},kr=0;function vo(){Ye.isTouch||(Ye.isTouch=!0,window.performance&&document.addEventListener("mousemove",Hr))}function Hr(){var t=performance.now();t-kr<20&&(Ye.isTouch=!1,document.removeEventListener("mousemove",Hr)),kr=t}function bo(){var t=document.activeElement;if(po(t)){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}function yo(){document.addEventListener("touchstart",vo,xt),window.addEventListener("blur",bo)}var wo=typeof window<"u"&&typeof document<"u",xo=wo?!!window.msCrypto:!1;var Do={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Co={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ve=Object.assign({appendTo:_r,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Do,Co),Eo=Object.keys(Ve),To=function(n){var e=Object.keys(n);e.forEach(function(o){Ve[o]=n[o]})};function Br(t){var n=t.plugins||[],e=n.reduce(function(o,a){var c=a.name,d=a.defaultValue;if(c){var p;o[c]=t[c]!==void 0?t[c]:(p=Ve[c])!=null?p:d}return o},{});return Object.assign({},t,e)}function Oo(t,n){var e=n?Object.keys(Br(Object.assign({},Ve,{plugins:n}))):Eo,o=e.reduce(function(a,c){var d=(t.getAttribute("data-tippy-"+c)||"").trim();if(!d)return a;if(c==="content")a[c]=d;else try{a[c]=JSON.parse(d)}catch{a[c]=d}return a},{});return o}function Ir(t,n){var e=Object.assign({},n,{content:Vr(n.content,[t])},n.ignoreAttributes?{}:Oo(t,n.plugins));return e.aria=Object.assign({},Ve.aria,e.aria),e.aria={expanded:e.aria.expanded==="auto"?n.interactive:e.aria.expanded,content:e.aria.content==="auto"?n.interactive?null:"describedby":e.aria.content},e}var Mo=function(){return"innerHTML"};function Jn(t,n){t[Mo()]=n}function Lr(t){var n=Ut();return t===!0?n.className=jr:(n.className=Rr,yn(t)?n.appendChild(t):Jn(n,t)),n}function Nr(t,n){yn(n.content)?(Jn(t,""),t.appendChild(n.content)):typeof n.content!="function"&&(n.allowHTML?Jn(t,n.content):t.textContent=n.content)}function Gn(t){var n=t.firstElementChild,e=bn(n.children);return{box:n,content:e.find(function(o){return o.classList.contains(Fr)}),arrow:e.find(function(o){return o.classList.contains(jr)||o.classList.contains(Rr)}),backdrop:e.find(function(o){return o.classList.contains(ao)})}}function Wr(t){var n=Ut(),e=Ut();e.className=oo,e.setAttribute("data-state","hidden"),e.setAttribute("tabindex","-1");var o=Ut();o.className=Fr,o.setAttribute("data-state","hidden"),Nr(o,t.props),n.appendChild(e),e.appendChild(o),a(t.props,t.props);function a(c,d){var p=Gn(n),u=p.box,b=p.content,h=p.arrow;d.theme?u.setAttribute("data-theme",d.theme):u.removeAttribute("data-theme"),typeof d.animation=="string"?u.setAttribute("data-animation",d.animation):u.removeAttribute("data-animation"),d.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof d.maxWidth=="number"?d.maxWidth+"px":d.maxWidth,d.role?u.setAttribute("role",d.role):u.removeAttribute("role"),(c.content!==d.content||c.allowHTML!==d.allowHTML)&&Nr(b,t.props),d.arrow?h?c.arrow!==d.arrow&&(u.removeChild(h),u.appendChild(Lr(d.arrow))):u.appendChild(Lr(d.arrow)):h&&u.removeChild(h)}return{popper:n,onUpdate:a}}Wr.$$tippy=!0;var Ao=1,vn=[],Kn=[];function So(t,n){var e=Ir(t,Object.assign({},Ve,Br(Ar(n)))),o,a,c,d=!1,p=!1,u=!1,b=!1,h,O,T,C=[],k=Or(Dt,e.interactiveDebounce),w,S=Ao++,H=null,N=co(e.plugins),_={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},l={id:S,reference:t,popper:Ut(),popperInstance:H,props:e,state:_,plugins:N,clearDelayTimeouts:Ct,setProps:dt,setContent:Et,show:sn,hide:An,hideWithInteractivity:Sn,enable:rt,disable:Ke,unmount:cn,destroy:Pn};if(!e.render)return l;var F=e.render(l),x=F.popper,V=F.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+l.id,l.popper=x,t._tippy=l,x._tippy=l;var Y=N.map(function(m){return m.fn(l)}),A=t.hasAttribute("aria-expanded");return qe(),Te(),q(),ee("onCreate",[l]),e.showOnCreate&&nt(),x.addEventListener("mouseenter",function(){l.props.interactive&&l.state.isVisible&&l.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){l.props.interactive&&l.props.trigger.indexOf("mouseenter")>=0&&le().addEventListener("mousemove",k)}),l;function I(){var m=l.props.touch;return Array.isArray(m)?m:[m,0]}function z(){return I()[0]==="hold"}function B(){var m;return!!((m=l.props.render)!=null&&m.$$tippy)}function j(){return w||t}function le(){var m=j().parentNode;return m?ho(m):document}function ae(){return Gn(x)}function J(m){return l.state.isMounted&&!l.state.isVisible||Ye.isTouch||h&&h.type==="focus"?0:qn(l.props.delay,m?0:1,Ve.delay)}function q(m){m===void 0&&(m=!1),x.style.pointerEvents=l.props.interactive&&!m?"":"none",x.style.zIndex=""+l.props.zIndex}function ee(m,v,M){if(M===void 0&&(M=!0),Y.forEach(function(W){W[m]&&W[m].apply(W,v)}),M){var $;($=l.props)[m].apply($,v)}}function De(){var m=l.props.aria;if(m.content){var v="aria-"+m.content,M=x.id,$=kt(l.props.triggerTarget||t);$.forEach(function(W){var te=W.getAttribute(v);if(l.state.isVisible)W.setAttribute(v,te?te+" "+M:M);else{var pe=te&&te.replace(M,"").trim();pe?W.setAttribute(v,pe):W.removeAttribute(v)}})}}function Te(){if(!(A||!l.props.aria.expanded)){var m=kt(l.props.triggerTarget||t);m.forEach(function(v){l.props.interactive?v.setAttribute("aria-expanded",l.state.isVisible&&v===j()?"true":"false"):v.removeAttribute("aria-expanded")})}}function Pe(){le().removeEventListener("mousemove",k),vn=vn.filter(function(m){return m!==k})}function Oe(m){if(!(Ye.isTouch&&(u||m.type==="mousedown"))){var v=m.composedPath&&m.composedPath()[0]||m.target;if(!(l.props.interactive&&Pr(x,v))){if(kt(l.props.triggerTarget||t).some(function(M){return Pr(M,v)})){if(Ye.isTouch||l.state.isVisible&&l.props.trigger.indexOf("click")>=0)return}else ee("onClickOutside",[l,m]);l.props.hideOnClick===!0&&(l.clearDelayTimeouts(),l.hide(),p=!0,setTimeout(function(){p=!1}),l.state.isMounted||Ce())}}}function Ue(){u=!0}function ke(){u=!1}function ue(){var m=le();m.addEventListener("mousedown",Oe,!0),m.addEventListener("touchend",Oe,xt),m.addEventListener("touchstart",ke,xt),m.addEventListener("touchmove",Ue,xt)}function Ce(){var m=le();m.removeEventListener("mousedown",Oe,!0),m.removeEventListener("touchend",Oe,xt),m.removeEventListener("touchstart",ke,xt),m.removeEventListener("touchmove",Ue,xt)}function Ie(m,v){Le(m,function(){!l.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&v()})}function fe(m,v){Le(m,v)}function Le(m,v){var M=ae().box;function $(W){W.target===M&&(Xn(M,"remove",$),v())}if(m===0)return v();Xn(M,"remove",O),Xn(M,"add",$),O=$}function He(m,v,M){M===void 0&&(M=!1);var $=kt(l.props.triggerTarget||t);$.forEach(function(W){W.addEventListener(m,v,M),C.push({node:W,eventType:m,handler:v,options:M})})}function qe(){z()&&(He("touchstart",ct,{passive:!0}),He("touchend",lt,{passive:!0})),so(l.props.trigger).forEach(function(m){if(m!=="manual")switch(He(m,ct),m){case"mouseenter":He("mouseleave",lt);break;case"focus":He(xo?"focusout":"blur",ut);break;case"focusin":He("focusout",ut);break}})}function ze(){C.forEach(function(m){var v=m.node,M=m.eventType,$=m.handler,W=m.options;v.removeEventListener(M,$,W)}),C=[]}function ct(m){var v,M=!1;if(!(!l.state.isEnabled||tt(m)||p)){var $=((v=h)==null?void 0:v.type)==="focus";h=m,w=m.currentTarget,Te(),!l.state.isVisible&&fo(m)&&vn.forEach(function(W){return W(m)}),m.type==="click"&&(l.props.trigger.indexOf("mouseenter")<0||d)&&l.props.hideOnClick!==!1&&l.state.isVisible?M=!0:nt(m),m.type==="click"&&(d=!M),M&&!$&&Fe(m)}}function Dt(m){var v=m.target,M=j().contains(v)||x.contains(v);if(!(m.type==="mousemove"&&M)){var $=Be().concat(x).map(function(W){var te,pe=W._tippy,me=(te=pe.popperInstance)==null?void 0:te.state;return me?{popperRect:W.getBoundingClientRect(),popperState:me,props:e}:null}).filter(Boolean);go($,m)&&(Pe(),Fe(m))}}function lt(m){var v=tt(m)||l.props.trigger.indexOf("click")>=0&&d;if(!v){if(l.props.interactive){l.hideWithInteractivity(m);return}Fe(m)}}function ut(m){l.props.trigger.indexOf("focusin")<0&&m.target!==j()||l.props.interactive&&m.relatedTarget&&x.contains(m.relatedTarget)||Fe(m)}function tt(m){return Ye.isTouch?z()!==m.type.indexOf("touch")>=0:!1}function ft(){Xe();var m=l.props,v=m.popperOptions,M=m.placement,$=m.offset,W=m.getReferenceClientRect,te=m.moveTransition,pe=B()?Gn(x).arrow:null,me=W?{getBoundingClientRect:W,contextElement:W.contextElement||j()}:t,ln={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(i){var s=i.state;if(B()){var f=ae(),g=f.box;["placement","reference-hidden","escaped"].forEach(function(y){y==="placement"?g.setAttribute("data-placement",s.placement):s.attributes.popper["data-popper-"+y]?g.setAttribute("data-"+y,""):g.removeAttribute("data-"+y)}),s.attributes.popper={}}}},Je=[{name:"offset",options:{offset:$}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!te}},ln];B()&&pe&&Je.push({name:"arrow",options:{element:pe,padding:3}}),Je.push.apply(Je,v?.modifiers||[]),l.popperInstance=Un(me,x,Object.assign({},v,{placement:M,onFirstUpdate:T,modifiers:Je}))}function Xe(){l.popperInstance&&(l.popperInstance.destroy(),l.popperInstance=null)}function Ne(){var m=l.props.appendTo,v,M=j();l.props.interactive&&m===_r||m==="parent"?v=M.parentNode:v=Vr(m,[M]),v.contains(x)||v.appendChild(x),l.state.isMounted=!0,ft()}function Be(){return bn(x.querySelectorAll("[data-tippy-root]"))}function nt(m){l.clearDelayTimeouts(),m&&ee("onTrigger",[l,m]),ue();var v=J(!0),M=I(),$=M[0],W=M[1];Ye.isTouch&&$==="hold"&&W&&(v=W),v?o=setTimeout(function(){l.show()},v):l.show()}function Fe(m){if(l.clearDelayTimeouts(),ee("onUntrigger",[l,m]),!l.state.isVisible){Ce();return}if(!(l.props.trigger.indexOf("mouseenter")>=0&&l.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(m.type)>=0&&d)){var v=J(!1);v?a=setTimeout(function(){l.state.isVisible&&l.hide()},v):c=requestAnimationFrame(function(){l.hide()})}}function rt(){l.state.isEnabled=!0}function Ke(){l.hide(),l.state.isEnabled=!1}function Ct(){clearTimeout(o),clearTimeout(a),cancelAnimationFrame(c)}function dt(m){if(!l.state.isDestroyed){ee("onBeforeUpdate",[l,m]),ze();var v=l.props,M=Ir(t,Object.assign({},v,Ar(m),{ignoreAttributes:!0}));l.props=M,qe(),v.interactiveDebounce!==M.interactiveDebounce&&(Pe(),k=Or(Dt,M.interactiveDebounce)),v.triggerTarget&&!M.triggerTarget?kt(v.triggerTarget).forEach(function($){$.removeAttribute("aria-expanded")}):M.triggerTarget&&t.removeAttribute("aria-expanded"),Te(),q(),V&&V(v,M),l.popperInstance&&(ft(),Be().forEach(function($){requestAnimationFrame($._tippy.popperInstance.forceUpdate)})),ee("onAfterUpdate",[l,m])}}function Et(m){l.setProps({content:m})}function sn(){var m=l.state.isVisible,v=l.state.isDestroyed,M=!l.state.isEnabled,$=Ye.isTouch&&!l.props.touch,W=qn(l.props.duration,0,Ve.duration);if(!(m||v||M||$)&&!j().hasAttribute("disabled")&&(ee("onShow",[l],!1),l.props.onShow(l)!==!1)){if(l.state.isVisible=!0,B()&&(x.style.visibility="visible"),q(),ue(),l.state.isMounted||(x.style.transition="none"),B()){var te=ae(),pe=te.box,me=te.content;zn([pe,me],0)}T=function(){var Je;if(!(!l.state.isVisible||b)){if(b=!0,x.offsetHeight,x.style.transition=l.props.moveTransition,B()&&l.props.animation){var r=ae(),i=r.box,s=r.content;zn([i,s],W),Sr([i,s],"visible")}De(),Te(),Mr(Kn,l),(Je=l.popperInstance)==null||Je.forceUpdate(),ee("onMount",[l]),l.props.animation&&B()&&fe(W,function(){l.state.isShown=!0,ee("onShown",[l])})}},Ne()}}function An(){var m=!l.state.isVisible,v=l.state.isDestroyed,M=!l.state.isEnabled,$=qn(l.props.duration,1,Ve.duration);if(!(m||v||M)&&(ee("onHide",[l],!1),l.props.onHide(l)!==!1)){if(l.state.isVisible=!1,l.state.isShown=!1,b=!1,d=!1,B()&&(x.style.visibility="hidden"),Pe(),Ce(),q(!0),B()){var W=ae(),te=W.box,pe=W.content;l.props.animation&&(zn([te,pe],$),Sr([te,pe],"hidden"))}De(),Te(),l.props.animation?B()&&Ie($,l.unmount):l.unmount()}}function Sn(m){le().addEventListener("mousemove",k),Mr(vn,k),k(m)}function cn(){l.state.isVisible&&l.hide(),l.state.isMounted&&(Xe(),Be().forEach(function(m){m._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x),Kn=Kn.filter(function(m){return m!==l}),l.state.isMounted=!1,ee("onHidden",[l]))}function Pn(){l.state.isDestroyed||(l.clearDelayTimeouts(),l.unmount(),ze(),delete t._tippy,l.state.isDestroyed=!0,ee("onDestroy",[l]))}}function qt(t,n){n===void 0&&(n={});var e=Ve.plugins.concat(n.plugins||[]);yo();var o=Object.assign({},n,{plugins:e}),a=mo(t);if(0)var c,d;var p=a.reduce(function(u,b){var h=b&&So(b,o);return h&&u.push(h),u},[]);return yn(t)?p[0]:p}qt.defaultProps=Ve;qt.setDefaultProps=To;qt.currentInput=Ye;var Hl=Object.assign({},_t,{effect:function(n){var e=n.state,o={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,o.popper),e.styles=o,e.elements.arrow&&Object.assign(e.elements.arrow.style,o.arrow)}});qt.setDefaultProps({render:Wr});var wn=qt;var zt=class extends Yr.Controller{copy(t){t.preventDefault(),navigator.clipboard.writeText(this.textToCopy),this.showFeedback(t.currentTarget,"Copied!")}get textToCopy(){let{value:t,innerText:n}=this.contentTarget;return t||n}showFeedback(t,n){wn(t,{content:n,showOnCreate:!0,onHidden:e=>{e.destroy()}})}};X(zt,"targets",["content"]);var $r=require("@hotwired/stimulus");var Xt=class extends $r.Controller{connect(){this.createObserver()}createObserver(){let t={root:null,rootMargin:"0px",threshold:.1};this.observer=new IntersectionObserver(this.handleIntersect.bind(this),t),this.observer.observe(this.element)}handleIntersect(t){t.forEach(n=>{n.isIntersecting&&(this.animateCountUp(),this.observer.unobserve(this.element))})}animateCountUp(){let n=this.targetValue,e=this.durationValue,o=60,a=Math.round(e/1e3*o),c=(n-0)/a,d=0,p=0,u=setInterval(()=>{d+=c,p++,p>=a&&(clearInterval(u),d=n),this.updateDisplay(d)},1e3/o)}updateDisplay(t){this.hasPercentage()?this.element.textContent=`${t.toFixed(1)}%`:this.element.textContent=this.formatNumber(t)}hasPercentage(){return this.element.dataset.railsuiCountUp&&this.element.dataset.railsuiCountUp.includes("%")}formatNumber(t){return Math.round(t).toLocaleString()}};X(Xt,"values",{target:Number,duration:{type:Number,default:2e3}});var qr=require("@hotwired/stimulus");var tr=require("@hotwired/stimulus");var Po=(t,n,e)=>{let o=t;return e===!0?o=`${n.identifier}:${t}`:typeof e=="string"&&(o=`${e}:${t}`),o},ko=(t,n,e)=>{let{bubbles:o,cancelable:a,composed:c}=n||{bubbles:!0,cancelable:!0,composed:!0};return n&&Object.assign(e,{originalEvent:n}),new CustomEvent(t,{bubbles:o,cancelable:a,composed:c,detail:e})};function Io(t){let n=t.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,o=window.innerWidth||document.documentElement.clientWidth,a=n.top<=e&&n.top+n.height>0,c=n.left<=o&&n.left+n.width>0;return a&&c}var Lo={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},Ur=(t,n={})=>{let e=t,{onlyVisible:o,dispatchEvent:a,events:c,eventPrefix:d}=Object.assign({},Lo,n),p=O=>{let T=n?.element||e.element;if(!(T.contains(O.target)||!Io(T)&&o)&&(e.clickOutside&&e.clickOutside(O),a)){let C=Po("click:outside",e,d),k=ko(C,O,{controller:e});T.dispatchEvent(k)}},u=()=>{c?.forEach(O=>{window.addEventListener(O,p,!0)})},b=()=>{c?.forEach(O=>{window.removeEventListener(O,p,!0)})},h=e.disconnect.bind(e);return Object.assign(e,{disconnect(){b(),h()}}),u(),[u,b]};var Zn=class extends tr.Controller{};Zn.debounces=[];var er=class extends tr.Controller{};er.throttles=[];var No={enterFromClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveFromClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},Fo={transitioned:!1,hiddenClass:"hidden",preserveOriginalClass:!0,removeToClasses:!0},$e=(t,n={})=>{var e,o,a;let c=t,d=c.element.dataset.transitionTarget,p;d&&(p=c[`${d}Target`]);let u=n?.element||p||c.element;if(!(u instanceof HTMLElement||u instanceof SVGElement))return;let b=u.dataset,h=parseInt(b.leaveAfter||"")||n.leaveAfter||0,{transitioned:O,hiddenClass:T,preserveOriginalClass:C,removeToClasses:k}=Object.assign({},Fo,n),w=(e=c.enter)===null||e===void 0?void 0:e.bind(c),S=(o=c.leave)===null||o===void 0?void 0:o.bind(c),H=(a=c.toggleTransition)===null||a===void 0?void 0:a.bind(c);async function N(A){if(c.transitioned)return;c.transitioned=!0,w&&w(A);let I=at("enterFrom",n,b),z=at("enterActive",n,b),B=at("enterTo",n,b),j=at("leaveTo",n,b);T&&u.classList.remove(T),k||Y(u,j),await F(u,I,z,B,T,C,k),h>0&&setTimeout(()=>{_(A)},h)}async function _(A){if(!c.transitioned)return;c.transitioned=!1,S&&S(A);let I=at("leaveFrom",n,b),z=at("leaveActive",n,b),B=at("leaveTo",n,b),j=at("enterTo",n,b);k||Y(u,j),await F(u,I,z,B,T,C,k),T&&u.classList.add(T)}function l(A){H&&H(A),c.transitioned?_():N()}async function F(A,I,z,B,j,le,ae){let J=[];le&&(I.forEach(q=>A.classList.contains(q)&&q!==j&&J.push(q)),z.forEach(q=>A.classList.contains(q)&&q!==j&&J.push(q)),B.forEach(q=>A.classList.contains(q)&&q!==j&&J.push(q))),V(A,I),Y(A,J),V(A,z),await Ro(),Y(A,I),V(A,B),await jo(A),Y(A,z),ae&&Y(A,B),V(A,J)}function x(){c.transitioned=O,O?(T&&u.classList.remove(T),N()):(T&&u.classList.add(T),_())}function V(A,I){I.length>0&&A.classList.add(...I)}function Y(A,I){I.length>0&&A.classList.remove(...I)}return x(),Object.assign(c,{enter:N,leave:_,toggleTransition:l}),[N,_,l]};function at(t,n,e){let o=`transition${t[0].toUpperCase()}${t.substr(1)}`,a=No[t],c=n[t]||e[o]||e[a]||" ";return _o(c)?[]:c.split(" ")}async function jo(t){return new Promise(n=>{let e=Number(getComputedStyle(t).transitionDuration.split(",")[0].replace("s",""))*1e3;setTimeout(()=>{n(e)},e)})}async function Ro(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function _o(t){return t.length===0||!t.trim()}var It=class extends qr.Controller{connect(){$e(this,{element:this.listTarget}),this.isOpen=!1,this.activeIndex=-1,this.updateTabIndices()}toggleDropdown(t){(t.target===this.boxTarget||this.boxTarget.contains(t.target))&&(this.isOpen?this.hideDropdown():this.showDropdown())}showDropdown(){this.enter(),this.boxTarget.setAttribute("aria-expanded","true"),this.listTarget.setAttribute("aria-expanded","true"),this.isOpen=!0,this.activeIndex===-1&&this.getVisibleOptions().length>0&&(this.activeIndex=0,this.updateActiveDescendant()),this.inputTarget.focus(),this.updateTabIndices()}hideDropdown(){this.leave(),this.boxTarget.setAttribute("aria-expanded","false"),this.listTarget.setAttribute("aria-expanded","false"),this.isOpen=!1,this.updateActiveDescendant(),this.updateTabIndices()}handleOutsideClick(t){this.element.contains(t.target)||this.hideDropdown()}filter(t){let n=t.target.value.toLowerCase(),e=!1;this.optionTargets.forEach(a=>{let d=a.textContent.toLowerCase().includes(n);a.style.display=d?"flex":"none",d&&(e=!0)}),this.hasNoresultsTarget&&this.noresultsTarget.classList.toggle("hidden",e);let o=this.getVisibleOptions();this.activeIndex>=o.length&&(this.activeIndex=o.length-1),this.activeIndex<0&&o.length>0&&(this.activeIndex=0),this.updateActiveDescendant(),this.updateTabIndices()}handleKeydown(t){switch(t.key){case"ArrowDown":t.preventDefault(),this.setActiveIndex(this.activeIndex+1);break;case"ArrowUp":t.preventDefault(),this.setActiveIndex(this.activeIndex-1);break;case"Enter":t.preventDefault(),this.activeIndex>=0&&this.selectOptionByIndex(this.activeIndex);break;case"Escape":this.hideDropdown();break}}setActiveIndex(t){let n=this.getVisibleOptions();n.length!==0&&(t<0&&(t=n.length-1),t>=n.length&&(t=0),this.activeIndex=t,this.updateActiveDescendant())}updateActiveDescendant(){let t=this.getVisibleOptions();t.forEach((n,e)=>{let o=e===this.activeIndex;this.toggleClassesAndAria(n,o)}),this.activeIndex>=0&&t[this.activeIndex]?this.inputTarget.setAttribute("aria-activedescendant",t[this.activeIndex].id):this.inputTarget.removeAttribute("aria-activedescendant")}toggleClassesAndAria(t,n){let e=n?this.activeClassValue:this.inactiveClassValue,o=n?this.inactiveClassValue:this.activeClassValue;t.classList.add(...e.split(" ")),t.classList.remove(...o.split(" ")),t.setAttribute("aria-selected",n?"true":"false");let a=t.querySelector("[data-railsui-combobox-target='checkmark']");a&&a.classList.toggle("hidden",!n)}selectOption(t){let n=t.currentTarget,o=this.getVisibleOptions().indexOf(n);o!==-1&&(this.activeIndex=o),this.updateDisplay(n.textContent.trim())}selectOptionByIndex(t){let e=this.getVisibleOptions()[t];this.updateDisplay(e.textContent.trim())}updateDisplay(t){this.textTarget.textContent=t,this.hideDropdown(),this.hiddenInputTarget.value=t}getVisibleOptions(){return this.optionTargets.filter(t=>t.style.display!=="none")}updateTabIndices(){let t=this.getVisibleOptions();this.optionTargets.forEach(n=>{n.setAttribute("tabindex",t.includes(n)?"0":"-1")})}};X(It,"targets",["input","list","option","box","text","hiddenInput","checkmark","noresults"]),X(It,"values",{activeClass:String,inactiveClass:String});var Zr=require("@hotwired/stimulus");var xn=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],st={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return typeof console<"u"&&console.warn(t)},getWeek:function(t){var n=new Date(t.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var e=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1};var Dn={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var n=t%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Cn=Dn;var he=function(t,n){return n===void 0&&(n=2),("000"+t).slice(n*-1)},ye=function(t){return t===!0?1:0};function nr(t,n){var e;return function(){var o=this,a=arguments;clearTimeout(e),e=setTimeout(function(){return t.apply(o,a)},n)}}var En=function(t){return t instanceof Array?t:[t]};function ge(t,n,e){if(e===!0)return t.classList.add(n);t.classList.remove(n)}function U(t,n,e){var o=window.document.createElement(t);return n=n||"",e=e||"",o.className=n,e!==void 0&&(o.textContent=e),o}function Kt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function rr(t,n){if(n(t))return t;if(t.parentNode)return rr(t.parentNode,n)}function Jt(t,n){var e=U("div","numInputWrapper"),o=U("input","numInput "+t),a=U("span","arrowUp"),c=U("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?o.type="number":(o.type="text",o.pattern="\\d*"),n!==void 0)for(var d in n)o.setAttribute(d,n[d]);return e.appendChild(o),e.appendChild(a),e.appendChild(c),e}function we(t){try{if(typeof t.composedPath=="function"){var n=t.composedPath();return n[0]}return t.target}catch{return t.target}}var ir=function(){},Gt=function(t,n,e){return e.months[n?"shorthand":"longhand"][t]},zr={D:ir,F:function(t,n,e){t.setMonth(e.months.longhand.indexOf(n))},G:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},H:function(t,n){t.setHours(parseFloat(n))},J:function(t,n){t.setDate(parseFloat(n))},K:function(t,n,e){t.setHours(t.getHours()%12+12*ye(new RegExp(e.amPM[1],"i").test(n)))},M:function(t,n,e){t.setMonth(e.months.shorthand.indexOf(n))},S:function(t,n){t.setSeconds(parseFloat(n))},U:function(t,n){return new Date(parseFloat(n)*1e3)},W:function(t,n,e){var o=parseInt(n),a=new Date(t.getFullYear(),0,2+(o-1)*7,0,0,0,0);return a.setDate(a.getDate()-a.getDay()+e.firstDayOfWeek),a},Y:function(t,n){t.setFullYear(parseFloat(n))},Z:function(t,n){return new Date(n)},d:function(t,n){t.setDate(parseFloat(n))},h:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},i:function(t,n){t.setMinutes(parseFloat(n))},j:function(t,n){t.setDate(parseFloat(n))},l:ir,m:function(t,n){t.setMonth(parseFloat(n)-1)},n:function(t,n){t.setMonth(parseFloat(n)-1)},s:function(t,n){t.setSeconds(parseFloat(n))},u:function(t,n){return new Date(parseFloat(n))},w:ir,y:function(t,n){t.setFullYear(2e3+parseFloat(n))}},et={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Lt={Z:function(t){return t.toISOString()},D:function(t,n,e){return n.weekdays.shorthand[Lt.w(t,n,e)]},F:function(t,n,e){return Gt(Lt.n(t,n,e)-1,!1,n)},G:function(t,n,e){return he(Lt.h(t,n,e))},H:function(t){return he(t.getHours())},J:function(t,n){return n.ordinal!==void 0?t.getDate()+n.ordinal(t.getDate()):t.getDate()},K:function(t,n){return n.amPM[ye(t.getHours()>11)]},M:function(t,n){return Gt(t.getMonth(),!0,n)},S:function(t){return he(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,n,e){return e.getWeek(t)},Y:function(t){return he(t.getFullYear(),4)},d:function(t){return he(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return he(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,n){return n.weekdays.longhand[t.getDay()]},m:function(t){return he(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}};var or=function(t){var n=t.config,e=n===void 0?st:n,o=t.l10n,a=o===void 0?Dn:o,c=t.isMobile,d=c===void 0?!1:c;return function(p,u,b){var h=b||a;return e.formatDate!==void 0&&!d?e.formatDate(p,u,h):u.split("").map(function(O,T,C){return Lt[O]&&C[T-1]!=="\\"?Lt[O](p,h,e):O!=="\\"?O:""}).join("")}},Tn=function(t){var n=t.config,e=n===void 0?st:n,o=t.l10n,a=o===void 0?Dn:o;return function(c,d,p,u){if(!(c!==0&&!c)){var b=u||a,h,O=c;if(c instanceof Date)h=new Date(c.getTime());else if(typeof c!="string"&&c.toFixed!==void 0)h=new Date(c);else if(typeof c=="string"){var T=d||(e||st).dateFormat,C=String(c).trim();if(C==="today")h=new Date,p=!0;else if(e&&e.parseDate)h=e.parseDate(c,T);else if(/Z$/.test(C)||/GMT$/.test(C))h=new Date(c);else{for(var k=void 0,w=[],S=0,H=0,N="";SMath.min(n,e)&&t=0?new Date:new Date(e.config.minDate.getTime()),s=Mn(e.config);i.setHours(s.hours,s.minutes,s.seconds,i.getMilliseconds()),e.selectedDates=[i],e.latestSelectedDateObj=i}r!==void 0&&r.type!=="blur"&&Je(r);var f=e._input.value;O(),me(),e._input.value!==f&&e._debouncedChange()}function b(r,i){return r%12+12*ye(i===e.l10n.amPM[1])}function h(r){switch(r%24){case 0:case 12:return 12;default:return r%12}}function O(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var r=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(e.minuteElement.value,10)||0)%60,s=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(r=b(r,e.amPM.textContent));var f=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&xe(e.latestSelectedDateObj,e.config.minDate,!0)===0,g=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&xe(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var y=On(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),L=On(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),E=On(r,i,s);if(E>L&&E=12)]),e.secondElement!==void 0&&(e.secondElement.value=he(s)))}function k(r){var i=we(r),s=parseInt(i.value)+(r.delta||0);(s/1e3>1||r.key==="Enter"&&!/[^\d]/.test(s.toString()))&&Ie(s)}function w(r,i,s,f){if(i instanceof Array)return i.forEach(function(g){return w(r,g,s,f)});if(r instanceof Array)return r.forEach(function(g){return w(g,i,s,f)});r.addEventListener(i,s,f),e._handlers.push({remove:function(){return r.removeEventListener(i,s,f)}})}function S(){v("onChange")}function H(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(s){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+s+"]"),function(f){return w(f,"click",e[s])})}),e.isMobile){Pn();return}var r=nr(ct,50);if(e._debouncedChange=nr(S,Vo),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&w(e.daysContainer,"mouseover",function(s){e.config.mode==="range"&&ze(we(s))}),w(e._input,"keydown",qe),e.calendarContainer!==void 0&&w(e.calendarContainer,"keydown",qe),!e.config.inline&&!e.config.static&&w(window,"resize",r),window.ontouchstart!==void 0?w(window.document,"touchstart",Ce):w(window.document,"mousedown",Ce),w(window.document,"focus",Ce,{capture:!0}),e.config.clickOpens===!0&&(w(e._input,"focus",e.open),w(e._input,"click",e.open)),e.daysContainer!==void 0&&(w(e.monthNav,"click",ln),w(e.monthNav,["keyup","increment"],k),w(e.daysContainer,"click",rt)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var i=function(s){return we(s).select()};w(e.timeContainer,["increment"],u),w(e.timeContainer,"blur",u,{capture:!0}),w(e.timeContainer,"click",_),w([e.hourElement,e.minuteElement],["focus","click"],i),e.secondElement!==void 0&&w(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&w(e.amPM,"click",function(s){u(s)})}e.config.allowInput&&w(e._input,"blur",He)}function N(r,i){var s=r!==void 0?e.parseDate(r):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate1),e.calendarContainer.appendChild(r);var g=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!g&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var y=U("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(y,e.element),y.appendChild(e.element),e.altInput&&y.appendChild(e.altInput),y.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function x(r,i,s,f){var g=fe(i,!0),y=U("span",r,i.getDate().toString());return y.dateObj=i,y.$i=f,y.setAttribute("aria-label",e.formatDate(i,e.config.ariaDateFormat)),r.indexOf("hidden")===-1&&xe(i,e.now)===0&&(e.todayDateElem=y,y.classList.add("today"),y.setAttribute("aria-current","date")),g?(y.tabIndex=-1,$(i)&&(y.classList.add("selected"),e.selectedDateElem=y,e.config.mode==="range"&&(ge(y,"startRange",e.selectedDates[0]&&xe(i,e.selectedDates[0],!0)===0),ge(y,"endRange",e.selectedDates[1]&&xe(i,e.selectedDates[1],!0)===0),r==="nextMonthDay"&&y.classList.add("inRange")))):y.classList.add("flatpickr-disabled"),e.config.mode==="range"&&W(i)&&!$(i)&&y.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&r!=="prevMonthDay"&&f%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend",""+e.config.getWeek(i)+""),v("onDayCreate",y),y}function V(r){r.focus(),e.config.mode==="range"&&ze(r)}function Y(r){for(var i=r>0?0:e.config.showMonths-1,s=r>0?e.config.showMonths:-1,f=i;f!=s;f+=r)for(var g=e.daysContainer.children[f],y=r>0?0:g.children.length-1,L=r>0?g.children.length:-1,E=y;E!=L;E+=r){var R=g.children[E];if(R.className.indexOf("hidden")===-1&&fe(R.dateObj))return R}}function A(r,i){for(var s=r.className.indexOf("Month")===-1?r.dateObj.getMonth():e.currentMonth,f=i>0?e.config.showMonths:-1,g=i>0?1:-1,y=s-e.currentMonth;y!=f;y+=g)for(var L=e.daysContainer.children[y],E=s-e.currentMonth===y?r.$i+i:i<0?L.children.length-1:0,R=L.children.length,D=E;D>=0&&D0?R:-1);D+=g){var P=L.children[D];if(P.className.indexOf("hidden")===-1&&fe(P.dateObj)&&Math.abs(r.$i-D)>=Math.abs(i))return V(P)}e.changeMonth(g),I(Y(g),0)}function I(r,i){var s=c(),f=Le(s||document.body),g=r!==void 0?r:f?s:e.selectedDateElem!==void 0&&Le(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&Le(e.todayDateElem)?e.todayDateElem:Y(i>0?1:-1);g===void 0?e._input.focus():f?A(g,i):V(g)}function z(r,i){for(var s=(new Date(r,i,1).getDay()-e.l10n.firstDayOfWeek+7)%7,f=e.utils.getDaysInMonth((i-1+12)%12,r),g=e.utils.getDaysInMonth(i,r),y=window.document.createDocumentFragment(),L=e.config.showMonths>1,E=L?"prevMonthDay hidden":"prevMonthDay",R=L?"nextMonthDay hidden":"nextMonthDay",D=f+1-s,P=0;D<=f;D++,P++)y.appendChild(x("flatpickr-day "+E,new Date(r,i-1,D),D,P));for(D=1;D<=g;D++,P++)y.appendChild(x("flatpickr-day",new Date(r,i,D),D,P));for(var K=g+1;K<=42-s&&(e.config.showMonths===1||P%7!==0);K++,P++)y.appendChild(x("flatpickr-day "+R,new Date(r,i+1,K%g),K,P));var We=U("div","dayContainer");return We.appendChild(y),We}function B(){if(e.daysContainer!==void 0){Kt(e.daysContainer),e.weekNumbers&&Kt(e.weekNumbers);for(var r=document.createDocumentFragment(),i=0;i1||e.config.monthSelectorType!=="dropdown")){var r=function(f){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&fe.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var i=0;i<12;i++)if(r(i)){var s=U("option","flatpickr-monthDropdown-month");s.value=new Date(e.currentYear,i).getMonth().toString(),s.textContent=Gt(i,e.config.shorthandCurrentMonth,e.l10n),s.tabIndex=-1,e.currentMonth===i&&(s.selected=!0),e.monthsDropdownContainer.appendChild(s)}}}function le(){var r=U("div","flatpickr-month"),i=window.document.createDocumentFragment(),s;e.config.showMonths>1||e.config.monthSelectorType==="static"?s=U("span","cur-month"):(e.monthsDropdownContainer=U("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),w(e.monthsDropdownContainer,"change",function(L){var E=we(L),R=parseInt(E.value,10);e.changeMonth(R-e.currentMonth),v("onMonthChange")}),j(),s=e.monthsDropdownContainer);var f=Jt("cur-year",{tabindex:"-1"}),g=f.getElementsByTagName("input")[0];g.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&g.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(g.setAttribute("max",e.config.maxDate.getFullYear().toString()),g.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var y=U("div","flatpickr-current-month");return y.appendChild(s),y.appendChild(f),i.appendChild(y),r.appendChild(i),{container:r,yearElement:g,monthElement:s}}function ae(){Kt(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var r=e.config.showMonths;r--;){var i=le();e.yearElements.push(i.yearElement),e.monthElements.push(i.monthElement),e.monthNav.appendChild(i.container)}e.monthNav.appendChild(e.nextMonthNav)}function J(){return e.monthNav=U("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=U("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=U("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,ae(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(r){e.__hidePrevMonthArrow!==r&&(ge(e.prevMonthNav,"flatpickr-disabled",r),e.__hidePrevMonthArrow=r)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(r){e.__hideNextMonthArrow!==r&&(ge(e.nextMonthNav,"flatpickr-disabled",r),e.__hideNextMonthArrow=r)}}),e.currentYearElement=e.yearElements[0],te(),e.monthNav}function q(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var r=Mn(e.config);e.timeContainer=U("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var i=U("span","flatpickr-time-separator",":"),s=Jt("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=s.getElementsByTagName("input")[0];var f=Jt("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=f.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=he(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?r.hours:h(r.hours)),e.minuteElement.value=he(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():r.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(s),e.timeContainer.appendChild(i),e.timeContainer.appendChild(f),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var g=Jt("flatpickr-second");e.secondElement=g.getElementsByTagName("input")[0],e.secondElement.value=he(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():r.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(U("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(g)}return e.config.time_24hr||(e.amPM=U("span","flatpickr-am-pm",e.l10n.amPM[ye((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function ee(){e.weekdayContainer?Kt(e.weekdayContainer):e.weekdayContainer=U("div","flatpickr-weekdays");for(var r=e.config.showMonths;r--;){var i=U("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(i)}return De(),e.weekdayContainer}function De(){if(e.weekdayContainer){var r=e.l10n.firstDayOfWeek,i=Gr(e.l10n.weekdays.shorthand);r>0&&r `+i.join("")+` - `}}function Te(){e.calendarContainer.classList.add("hasWeeks");var r=U("div","flatpickr-weekwrapper");r.appendChild(U("span","flatpickr-weekday",e.l10n.weekAbbreviation));var i=U("div","flatpickr-weeks");return r.appendChild(i),{weekWrapper:r,weekNumbers:i}}function Se(r,i){i===void 0&&(i=!0);var s=i?r:r-e.currentMonth;s<0&&e._hidePrevMonthArrow===!0||s>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=s,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,v("onYearChange"),j()),B(),v("onMonthChange"),te())}function Oe(r,i){if(r===void 0&&(r=!0),i===void 0&&(i=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,i===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var s=On(e.config),f=s.hours,g=s.minutes,y=s.seconds;E(f,g,y)}e.redraw(),r&&v("onChange")}function $e(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),v("onClose")}function ke(){e.config!==void 0&&v("onDestroy");for(var r=e._handlers.length;r--;)e._handlers[r].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var i=e.calendarContainer.parentNode;if(i.lastChild&&i.removeChild(i.lastChild),i.parentNode){for(;i.firstChild;)i.parentNode.insertBefore(i.firstChild,i);i.parentNode.removeChild(i)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(s){try{delete e[s]}catch{}})}function ue(r){return e.calendarContainer.contains(r)}function Ee(r){if(e.isOpen&&!e.config.inline){var i=we(r),s=ue(i),f=i===e.input||i===e.altInput||e.element.contains(i)||r.path&&r.path.indexOf&&(~r.path.indexOf(e.input)||~r.path.indexOf(e.altInput)),g=!f&&!s&&!ue(r.relatedTarget),y=!e.config.ignoredFocusElements.some(function(L){return L.contains(i)});g&&y&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&u(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function Ne(r){if(!(!r||e.config.minDate&&re.config.maxDate.getFullYear())){var i=r,s=e.currentYear!==i;e.currentYear=i||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),s&&(e.redraw(),v("onYearChange"),j())}}function fe(r,i){var s;i===void 0&&(i=!0);var f=e.parseDate(r,void 0,i);if(e.config.minDate&&f&&xe(f,e.config.minDate,i!==void 0?i:!e.minDateHasTime)<0||e.config.maxDate&&f&&xe(f,e.config.maxDate,i!==void 0?i:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(f===void 0)return!1;for(var g=!!e.config.enable,y=(s=e.config.enable)!==null&&s!==void 0?s:e.config.disable,L=0,C=void 0;L=C.from.getTime()&&f.getTime()<=C.to.getTime())return g}return!g}function Le(r){return e.daysContainer!==void 0?r.className.indexOf("hidden")===-1&&r.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(r):!1}function Ve(r){var i=r.target===e._input,s=e._input.value.trimEnd()!==pe();i&&s&&!(r.relatedTarget&&ue(r.relatedTarget))&&e.setDate(e._input.value,!0,r.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function Ue(r){var i=we(r),s=e.config.wrap?t.contains(i):i===e._input,f=e.config.allowInput,g=e.isOpen&&(!f||!s),y=e.config.inline&&s&&!f;if(r.keyCode===13&&s){if(f)return e.setDate(e._input.value,!0,i===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),i.blur();e.open()}else if(ue(i)||g||y){var L=!!e.timeContainer&&e.timeContainer.contains(i);switch(r.keyCode){case 13:L?(r.preventDefault(),u(),Fe()):nt(r);break;case 27:r.preventDefault(),Fe();break;case 8:case 46:s&&!e.config.allowInput&&(r.preventDefault(),e.clear());break;case 37:case 39:if(!L&&!s){r.preventDefault();var C=c();if(e.daysContainer!==void 0&&(f===!1||C&&Le(C))){var R=r.keyCode===39?1:-1;r.ctrlKey?(r.stopPropagation(),Se(R),N(Y(1),0)):N(void 0,R)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:r.preventDefault();var D=r.keyCode===40?1:-1;e.daysContainer&&i.$i!==void 0||i===e.input||i===e.altInput?r.ctrlKey?(r.stopPropagation(),Ne(e.currentYear-D),N(Y(1),0)):L||N(void 0,D*7):i===e.currentYearElement?Ne(e.currentYear-D):e.config.enableTime&&(!L&&e.hourElement&&e.hourElement.focus(),u(r),e._debouncedChange());break;case 9:if(L){var S=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ce){return Ce}),X=S.indexOf(i);if(X!==-1){var We=S[X+(r.shiftKey?-1:1)];r.preventDefault(),(We||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(i)&&r.shiftKey&&(r.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&i===e.amPM)switch(r.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],O(),me();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],O(),me();break}(s||ue(i))&&v("onKeyDown",r)}function qe(r,i){if(i===void 0&&(i="flatpickr-day"),!(e.selectedDates.length!==1||r&&(!r.classList.contains(i)||r.classList.contains("flatpickr-disabled")))){for(var s=r?r.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),f=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),g=Math.min(s,e.selectedDates[0].getTime()),y=Math.max(s,e.selectedDates[0].getTime()),L=!1,C=0,R=0,D=g;Dg&&DC)?C=D:D>f&&(!R||D ."+i));S.forEach(function(X){var We=X.dateObj,Ce=We.getTime(),jt=C>0&&Ce0&&Ce>R;if(jt){X.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Tt){X.classList.remove(Tt)});return}else if(L&&!jt)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Tt){X.classList.remove(Tt)}),r!==void 0&&(r.classList.add(s<=e.selectedDates[0].getTime()?"startRange":"endRange"),fs&&Ce===f&&X.classList.add("endRange"),Ce>=C&&(R===0||Ce<=R)&&Ur(Ce,f,s)&&X.classList.add("inRange"))})}}function ct(){e.isOpen&&!e.config.static&&!e.config.inline&&ze()}function Dt(r,i){if(i===void 0&&(i=e._positionElement),e.isMobile===!0){if(r){r.preventDefault();var s=we(r);s&&s.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),v("onOpen");return}else if(e._input.disabled||e.config.inline)return;var f=e.isOpen;e.isOpen=!0,f||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),v("onOpen"),ze(i)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(r===void 0||!e.timeContainer.contains(r.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function lt(r){return function(i){var s=e.config["_"+r+"Date"]=e.parseDate(i,e.config.dateFormat),f=e.config["_"+(r==="min"?"max":"min")+"Date"];s!==void 0&&(e[r==="min"?"minDateHasTime":"maxDateHasTime"]=s.getHours()>0||s.getMinutes()>0||s.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(g){return fe(g)}),!e.selectedDates.length&&r==="min"&&T(s),me()),e.daysContainer&&(tt(),s!==void 0?e.currentYearElement[r]=s.getFullYear().toString():e.currentYearElement.removeAttribute(r),e.currentYearElement.disabled=!!f&&s!==void 0&&f.getFullYear()===s.getFullYear())}}function ut(){var r=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=ve(ve({},JSON.parse(JSON.stringify(t.dataset||{}))),n),s={};e.config.parseDate=i.parseDate,e.config.formatDate=i.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(S){e.config._enable=an(S)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(S){e.config._disable=an(S)}});var f=i.mode==="time";if(!i.dateFormat&&(i.enableTime||f)){var g=re.defaultConfig.dateFormat||ot.dateFormat;s.dateFormat=i.noCalendar||f?"H:i"+(i.enableSeconds?":S":""):g+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||f)&&!i.altFormat){var y=re.defaultConfig.altFormat||ot.altFormat;s.altFormat=i.noCalendar||f?"h:i"+(i.enableSeconds?":S K":" K"):y+(" h:i"+(i.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:lt("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:lt("max")});var L=function(S){return function(X){e.config[S==="min"?"_minTime":"_maxTime"]=e.parseDate(X,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:L("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:L("max")}),i.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,s,i);for(var C=0;C-1?e.config[D]=En(R[D]).map(d).concat(e.config[D]):typeof i[D]>"u"&&(e.config[D]=R[D])}i.altInputClass||(e.config.altInputClass=et().className+" "+e.config.altInputClass),v("onParseConfig")}function et(){return e.config.wrap?t.querySelector("[data-input]"):t}function ft(){typeof e.config.locale!="object"&&typeof re.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=ve(ve({},re.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?re.l10ns[e.config.locale]:void 0),Ze.D="("+e.l10n.weekdays.shorthand.join("|")+")",Ze.l="("+e.l10n.weekdays.longhand.join("|")+")",Ze.M="("+e.l10n.months.shorthand.join("|")+")",Ze.F="("+e.l10n.months.longhand.join("|")+")",Ze.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var r=ve(ve({},n),JSON.parse(JSON.stringify(t.dataset||{})));r.time_24hr===void 0&&re.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=tr(e),e.parseDate=Cn({config:e.config,l10n:e.l10n})}function ze(r){if(typeof e.config.position=="function")return void e.config.position(e,r);if(e.calendarContainer!==void 0){v("onPreCalendarPosition");var i=r||e._positionElement,s=Array.prototype.reduce.call(e.calendarContainer.children,function(hi,gi){return hi+gi.offsetHeight},0),f=e.calendarContainer.offsetWidth,g=e.config.position.split(" "),y=g[0],L=g.length>1?g[1]:null,C=i.getBoundingClientRect(),R=window.innerHeight-C.bottom,D=y==="above"||y!=="below"&&Rs,S=window.pageYOffset+C.top+(D?-s-2:i.offsetHeight+2);if(ge(e.calendarContainer,"arrowTop",!D),ge(e.calendarContainer,"arrowBottom",D),!e.config.inline){var X=window.pageXOffset+C.left,We=!1,Ce=!1;L==="center"?(X-=(f-C.width)/2,We=!0):L==="right"&&(X-=f-C.width,Ce=!0),ge(e.calendarContainer,"arrowLeft",!We&&!Ce),ge(e.calendarContainer,"arrowCenter",We),ge(e.calendarContainer,"arrowRight",Ce);var jt=window.document.body.offsetWidth-(window.pageXOffset+C.right),Tt=X+f>window.document.body.offsetWidth,ci=jt+f>window.document.body.offsetWidth;if(ge(e.calendarContainer,"rightMost",Tt),!e.config.static)if(e.calendarContainer.style.top=S+"px",!Tt)e.calendarContainer.style.left=X+"px",e.calendarContainer.style.right="auto";else if(!ci)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=jt+"px";else{var Sn=Ie();if(Sn===void 0)return;var li=window.document.body.offsetWidth,ui=Math.max(0,li/2-f/2),fi=".flatpickr-calendar.centerMost:before",di=".flatpickr-calendar.centerMost:after",pi=Sn.cssRules.length,mi="{left:"+C.left+"px;right:auto;}";ge(e.calendarContainer,"rightMost",!1),ge(e.calendarContainer,"centerMost",!0),Sn.insertRule(fi+","+di+mi,pi),e.calendarContainer.style.left=ui+"px",e.calendarContainer.style.right="auto"}}}}function Ie(){for(var r=null,i=0;ie.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=f,e.config.mode==="single")e.selectedDates=[g];else if(e.config.mode==="multiple"){var L=$(g);L?e.selectedDates.splice(parseInt(L),1):e.selectedDates.push(g)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=g,e.selectedDates.push(g),xe(g,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(S,X){return S.getTime()-X.getTime()}));if(O(),y){var C=e.currentYear!==g.getFullYear();e.currentYear=g.getFullYear(),e.currentMonth=g.getMonth(),C&&(v("onYearChange"),j()),v("onMonthChange")}if(te(),B(),me(),!y&&e.config.mode!=="range"&&e.config.showMonths===1?H(f):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var R=e.config.mode==="single"&&!e.config.enableTime,D=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(R||D)&&Fe()}P()}}var Xe={locale:[ft,De],showMonths:[ae,p,ee],minDate:[I],maxDate:[I],positionElement:[sn],clickOpens:[function(){e.config.clickOpens===!0?(w(e._input,"focus",e.open),w(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Et(r,i){if(r!==null&&typeof r=="object"){Object.assign(e.config,r);for(var s in r)Xe[s]!==void 0&&Xe[s].forEach(function(f){return f()})}else e.config[r]=i,Xe[r]!==void 0?Xe[r].forEach(function(f){return f()}):wn.indexOf(r)>-1&&(e.config[r]=En(i));e.redraw(),me(!0)}function dt(r,i){var s=[];if(r instanceof Array)s=r.map(function(f){return e.parseDate(f,i)});else if(r instanceof Date||typeof r=="number")s=[e.parseDate(r,i)];else if(typeof r=="string")switch(e.config.mode){case"single":case"time":s=[e.parseDate(r,i)];break;case"multiple":s=r.split(e.config.conjunction).map(function(f){return e.parseDate(f,i)});break;case"range":s=r.split(e.l10n.rangeSeparator).map(function(f){return e.parseDate(f,i)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(r)));e.selectedDates=e.config.allowInvalidPreload?s:s.filter(function(f){return f instanceof Date&&fe(f,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(f,g){return f.getTime()-g.getTime()})}function Ct(r,i,s){if(i===void 0&&(i=!1),s===void 0&&(s=e.config.dateFormat),r!==0&&!r||r instanceof Array&&r.length===0)return e.clear(i);dt(r,s),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),I(void 0,i),T(),e.selectedDates.length===0&&e.clear(!1),me(i),i&&v("onChange")}function an(r){return r.slice().map(function(i){return typeof i=="string"||typeof i=="number"||i instanceof Date?e.parseDate(i,void 0,!0):i&&typeof i=="object"&&i.from&&i.to?{from:e.parseDate(i.from,void 0),to:e.parseDate(i.to,void 0)}:i}).filter(function(i){return i})}function Mn(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var r=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);r&&dt(r,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function An(){if(e.input=et(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=U(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),sn()}function sn(){e._positionElement=e.config.positionElement||e._input}function Pn(){var r=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=U("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=r,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=r==="datetime-local"?"Y-m-d\\TH:i:S":r==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}w(e.mobileInput,"change",function(i){e.setDate(we(i).value,!1,e.mobileFormatStr),v("onChange"),v("onClose")})}function m(r){if(e.isOpen===!0)return e.close();e.open(r)}function v(r,i){if(e.config!==void 0){var s=e.config[r];if(s!==void 0&&s.length>0)for(var f=0;s[f]&&f=0&&xe(r,e.selectedDates[1])<=0}function te(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(r,i){var s=new Date(e.currentYear,e.currentMonth,1);s.setMonth(e.currentMonth+i),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[i].textContent=Jt(s.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=s.getMonth().toString(),r.value=s.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYeare.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function pe(r){var i=r||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(s){return e.formatDate(s,i)}).filter(function(s,f,g){return e.config.mode!=="range"||e.config.enableTime||g.indexOf(s)===f}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function me(r){r===void 0&&(r=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=pe(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=pe(e.config.altFormat)),r!==!1&&v("onValueUpdate")}function cn(r){var i=we(r),s=e.prevMonthNav.contains(i),f=e.nextMonthNav.contains(i);s||f?Se(s?-1:1):e.yearElements.indexOf(i)>=0?i.select():i.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):i.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function Ke(r){r.preventDefault();var i=r.type==="keydown",s=we(r),f=s;e.amPM!==void 0&&s===e.amPM&&(e.amPM.textContent=e.l10n.amPM[ye(e.amPM.textContent===e.l10n.amPM[0])]);var g=parseFloat(f.getAttribute("min")),y=parseFloat(f.getAttribute("max")),L=parseFloat(f.getAttribute("step")),C=parseInt(f.value,10),R=r.delta||(i?r.which===38?1:-1:0),D=C+L*R;if(typeof f.value<"u"&&f.value.length===2){var S=f===e.hourElement,X=f===e.minuteElement;Dy&&(D=f===e.hourElement?D-y-ye(!e.amPM):g,X&&l(void 0,1,e.hourElement)),e.amPM&&S&&(L===1?D+C===23:Math.abs(D-C)>L)&&(e.amPM.textContent=e.l10n.amPM[ye(e.amPM.textContent===e.l10n.amPM[0])]),f.value=he(D)}}return a(),e}function Lt(t,n){for(var e=Array.prototype.slice.call(t).filter(function(d){return d instanceof HTMLElement}),o=[],a=0;anew Date(e));let t=this,n=Kr(this.element,{mode:this.modeValue,minDate:this.minDateValue,dateFormat:this.dateFormatValue,defaultDate:this.rangeValue,onChange:function(e,o,a){t.setCurrentRange(a)}});this.setCurrentRange(n)}setCurrentRange(t){let n=o=>{let a={month:"short",day:"numeric"};return o.toLocaleDateString("en-US",a)},e=t.selectedDates.map(n).join(" - ");this.hasLabelTarget&&(this.labelTarget.textContent=e,this.inputTarget.value=t.selectedDates)}};K(It,"targets",["label","input"]),K(It,"values",{mode:{type:String,default:"range"},minDate:{type:String,default:"today"},dateFormat:{type:String,default:"Y-m-d"},range:{type:Array,default:[Gr,So]}});var Zr=require("@hotwired/stimulus");var ir=require("@hotwired/stimulus");var ko=(t,n,e)=>{let o=t;return e===!0?o=`${n.identifier}:${t}`:typeof e=="string"&&(o=`${e}:${t}`),o},No=(t,n,e)=>{let{bubbles:o,cancelable:a,composed:c}=n||{bubbles:!0,cancelable:!0,composed:!0};return n&&Object.assign(e,{originalEvent:n}),new CustomEvent(t,{bubbles:o,cancelable:a,composed:c,detail:e})};function Lo(t){let n=t.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,o=window.innerWidth||document.documentElement.clientWidth,a=n.top<=e&&n.top+n.height>0,c=n.left<=o&&n.left+n.width>0;return a&&c}var Io={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},Qr=(t,n={})=>{let e=t,{onlyVisible:o,dispatchEvent:a,events:c,eventPrefix:d}=Object.assign({},Io,n),p=O=>{let T=n?.element||e.element;if(!(T.contains(O.target)||!Lo(T)&&o)&&(e.clickOutside&&e.clickOutside(O),a)){let E=ko("click:outside",e,d),k=No(E,O,{controller:e});T.dispatchEvent(k)}},u=()=>{c?.forEach(O=>{window.addEventListener(O,p,!0)})},b=()=>{c?.forEach(O=>{window.removeEventListener(O,p,!0)})},h=e.disconnect.bind(e);return Object.assign(e,{disconnect(){b(),h()}}),u(),[u,b]};var nr=class extends ir.Controller{};nr.debounces=[];var rr=class extends ir.Controller{};rr.throttles=[];var Fo={enterFromClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveFromClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},jo={transitioned:!1,hiddenClass:"hidden",preserveOriginalClass:!0,removeToClasses:!0},st=(t,n={})=>{var e,o,a;let c=t,d=c.element.dataset.transitionTarget,p;d&&(p=c[`${d}Target`]);let u=n?.element||p||c.element;if(!(u instanceof HTMLElement||u instanceof SVGElement))return;let b=u.dataset,h=parseInt(b.leaveAfter||"")||n.leaveAfter||0,{transitioned:O,hiddenClass:T,preserveOriginalClass:E,removeToClasses:k}=Object.assign({},jo,n),w=(e=c.enter)===null||e===void 0?void 0:e.bind(c),P=(o=c.leave)===null||o===void 0?void 0:o.bind(c),V=(a=c.toggleTransition)===null||a===void 0?void 0:a.bind(c);async function I(A){if(c.transitioned)return;c.transitioned=!0,w&&w(A);let N=at("enterFrom",n,b),z=at("enterActive",n,b),B=at("enterTo",n,b),j=at("leaveTo",n,b);T&&u.classList.remove(T),k||Y(u,j),await F(u,N,z,B,T,E,k),h>0&&setTimeout(()=>{_(A)},h)}async function _(A){if(!c.transitioned)return;c.transitioned=!1,P&&P(A);let N=at("leaveFrom",n,b),z=at("leaveActive",n,b),B=at("leaveTo",n,b),j=at("enterTo",n,b);k||Y(u,j),await F(u,N,z,B,T,E,k),T&&u.classList.add(T)}function l(A){V&&V(A),c.transitioned?_():I()}async function F(A,N,z,B,j,le,ae){let J=[];le&&(N.forEach(q=>A.classList.contains(q)&&q!==j&&J.push(q)),z.forEach(q=>A.classList.contains(q)&&q!==j&&J.push(q)),B.forEach(q=>A.classList.contains(q)&&q!==j&&J.push(q))),H(A,N),Y(A,J),H(A,z),await _o(),Y(A,N),H(A,B),await Ro(A),Y(A,z),ae&&Y(A,B),H(A,J)}function x(){c.transitioned=O,O?(T&&u.classList.remove(T),I()):(T&&u.classList.add(T),_())}function H(A,N){N.length>0&&A.classList.add(...N)}function Y(A,N){N.length>0&&A.classList.remove(...N)}return x(),Object.assign(c,{enter:I,leave:_,toggleTransition:l}),[I,_,l]};function at(t,n,e){let o=`transition${t[0].toUpperCase()}${t.substr(1)}`,a=Fo[t],c=n[t]||e[o]||e[a]||" ";return Ho(c)?[]:c.split(" ")}async function Ro(t){return new Promise(n=>{let e=Number(getComputedStyle(t).transitionDuration.split(",")[0].replace("s",""))*1e3;setTimeout(()=>{n(e)},e)})}async function _o(){return new Promise(t=>{requestAnimationFrame(()=>{requestAnimationFrame(t)})})}function Ho(t){return t.length===0||!t.trim()}var Gt=class extends Zr.Controller{connect(){st(this,{element:this.menuTarget})}toggle(){this.toggleTransition()}hide(t){!this.element.contains(t.target)&&!this.menuTarget.classList.contains("hidden")&&this.leave()}};K(Gt,"targets",["menu","trigger"]);var ei=require("@hotwired/stimulus");var Qt=class extends ei.Controller{connect(){st(this,{element:this.contentTarget}),Qr(this,{element:this.contentTarget})}open(t){t.preventDefault(),this.enableAppearance(),this.toggleTransition()}close(t){t.preventDefault(),this.leave(),this.disableAppearance()}clickOutside(t){let n=t.target.dataset.action;n=="click->modal#open"||n=="click->modal#open:prevent"||this.close(t)}closeWithEsc(t){t.keyCode===27&&!this.containerTarget.classList.contains("hidden")&&this.close(t)}enableAppearance(){this.containerTarget.classList.add("bg-black/80"),this.containerTarget.classList.remove("hidden")}disableAppearance(){this.containerTarget.classList.add("hidden"),this.containerTarget.classList.remove("bg-black/80")}disconnect(){this.toggleTransition()}};K(Qt,"targets",["container","content"]);var ti=require("@hotwired/stimulus");var Zt=class extends ti.Controller{connect(){this.updateTrack()}updateTrack(){let t=(this.rangeTarget.value-this.rangeTarget.min)/(this.rangeTarget.max-this.rangeTarget.min)*100;this.rangeTarget.style.setProperty("--range-fill",`${t}%`)}onInput(){this.updateTrack()}};K(Zt,"targets",["range"]);var ni=require("@hotwired/stimulus");var Ft=class extends ni.Controller{connect(){this.originalText=this.contentTarget.textContent,this.truncate()}truncate(){if(this.originalText.length<=this.maxLengthValue){this.buttonTarget.classList.add("hidden");return}this.expanded||(this.contentTarget.textContent=this.originalText.slice(0,this.maxLengthValue)+"...",this.buttonTarget.textContent=this.moreTextValue)}toggle(){this.expanded=!this.expanded,this.expanded?(this.contentTarget.textContent=this.originalText,this.buttonTarget.textContent=this.lessTextValue):this.truncate()}};K(Ft,"targets",["content","button"]),K(Ft,"values",{maxLength:{type:Number,default:100},moreText:{type:String,default:"Read more"},lessText:{type:String,default:"Read less"}});var ri=require("@hotwired/stimulus");var en=class extends ri.Controller{connect(){this.selectAllTarget.addEventListener("change",this.selectAll.bind(this)),this.checkboxTargets.forEach(t=>{t.addEventListener("change",this.updateSelectAllState.bind(this))}),this.updateSelectAllState()}selectAll(){let t=this.selectAllTarget.checked;this.checkboxTargets.forEach(n=>{n.checked=t})}updateSelectAllState(){let t=this.checkboxTargets.filter(n=>n.checked).length;t===0?(this.selectAllTarget.checked=!1,this.selectAllTarget.indeterminate=!1):t===this.checkboxTargets.length?(this.selectAllTarget.checked=!0,this.selectAllTarget.indeterminate=!1):(this.selectAllTarget.checked=!1,this.selectAllTarget.indeterminate=!0)}};K(en,"targets",["checkbox","selectAll"]);var ii=require("@hotwired/stimulus");var tn=class extends ii.Controller{connect(){this.activeTabClasses=(this.data.get("activeTab")||"active").split(" "),this.inactiveTabClasses=(this.data.get("inactiveTab")||"inactive").split(" "),this.anchor&&(this.index=this.tabTargets.findIndex(t=>t.id===this.anchor)),this.showTab()}change(t){t.preventDefault(),t.currentTarget.dataset.index?this.index=t.currentTarget.dataset.index:t.currentTarget.dataset.id?this.index=this.tabTargets.findIndex(n=>n.id==t.currentTarget.dataset.id):this.index=this.tabTargets.indexOf(t.currentTarget),window.dispatchEvent(new CustomEvent("tsc:tab-change"))}showTab(){this.tabTargets.forEach((t,n)=>{let e=this.panelTargets[n];n===this.index?(e.classList.remove("hidden"),t.classList.remove(...this.inactiveTabClasses),t.classList.add(...this.activeTabClasses),t.id&&(location.hash=t.id)):(e.classList.add("hidden"),t.classList.remove(...this.activeTabClasses),t.classList.add(...this.inactiveTabClasses))})}get index(){return parseInt(this.data.get("index")||0)}set index(t){this.data.set("index",t>=0?t:0),this.showTab()}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};K(tn,"targets",["tab","panel"]);var oi=require("@hotwired/stimulus");var nn=class extends oi.Controller{connect(){st(this,{element:this.element}),this.triggerOnLoadValue&&this.toggleTransition()}toggle(){this.toggleTransition()}hide(){this.leave()}disconnect(){this.leave()}};K(nn,"values",{triggerOnLoad:{type:Boolean,default:!1}});var ai=require("@hotwired/stimulus");var rn=class extends ai.Controller{connect(){st(this,{element:this.toggleableTarget})}toggle(){this.toggleTransition()}};K(rn,"targets",["toggleable"]);var si=require("@hotwired/stimulus");var on=class extends si.Controller{connect(){let t={};this.hasContentValue&&(t.content=this.contentValue),this.hasAllowHtmlValue&&(t.allowHTML=this.allowHtmlValue),this.tippy=yn(this.element,t)}disconnect(){this.tippy.destroy()}};K(on,"values",{content:String,allowHtml:{type:Boolean,default:!1}}); + `}}function Te(){e.calendarContainer.classList.add("hasWeeks");var r=U("div","flatpickr-weekwrapper");r.appendChild(U("span","flatpickr-weekday",e.l10n.weekAbbreviation));var i=U("div","flatpickr-weeks");return r.appendChild(i),{weekWrapper:r,weekNumbers:i}}function Pe(r,i){i===void 0&&(i=!0);var s=i?r:r-e.currentMonth;s<0&&e._hidePrevMonthArrow===!0||s>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=s,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,v("onYearChange"),j()),B(),v("onMonthChange"),te())}function Oe(r,i){if(r===void 0&&(r=!0),i===void 0&&(i=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,i===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var s=Mn(e.config),f=s.hours,g=s.minutes,y=s.seconds;C(f,g,y)}e.redraw(),r&&v("onChange")}function Ue(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),v("onClose")}function ke(){e.config!==void 0&&v("onDestroy");for(var r=e._handlers.length;r--;)e._handlers[r].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var i=e.calendarContainer.parentNode;if(i.lastChild&&i.removeChild(i.lastChild),i.parentNode){for(;i.firstChild;)i.parentNode.insertBefore(i.firstChild,i);i.parentNode.removeChild(i)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(s){try{delete e[s]}catch{}})}function ue(r){return e.calendarContainer.contains(r)}function Ce(r){if(e.isOpen&&!e.config.inline){var i=we(r),s=ue(i),f=i===e.input||i===e.altInput||e.element.contains(i)||r.path&&r.path.indexOf&&(~r.path.indexOf(e.input)||~r.path.indexOf(e.altInput)),g=!f&&!s&&!ue(r.relatedTarget),y=!e.config.ignoredFocusElements.some(function(L){return L.contains(i)});g&&y&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&u(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function Ie(r){if(!(!r||e.config.minDate&&re.config.maxDate.getFullYear())){var i=r,s=e.currentYear!==i;e.currentYear=i||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),s&&(e.redraw(),v("onYearChange"),j())}}function fe(r,i){var s;i===void 0&&(i=!0);var f=e.parseDate(r,void 0,i);if(e.config.minDate&&f&&xe(f,e.config.minDate,i!==void 0?i:!e.minDateHasTime)<0||e.config.maxDate&&f&&xe(f,e.config.maxDate,i!==void 0?i:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(f===void 0)return!1;for(var g=!!e.config.enable,y=(s=e.config.enable)!==null&&s!==void 0?s:e.config.disable,L=0,E=void 0;L=E.from.getTime()&&f.getTime()<=E.to.getTime())return g}return!g}function Le(r){return e.daysContainer!==void 0?r.className.indexOf("hidden")===-1&&r.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(r):!1}function He(r){var i=r.target===e._input,s=e._input.value.trimEnd()!==pe();i&&s&&!(r.relatedTarget&&ue(r.relatedTarget))&&e.setDate(e._input.value,!0,r.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function qe(r){var i=we(r),s=e.config.wrap?t.contains(i):i===e._input,f=e.config.allowInput,g=e.isOpen&&(!f||!s),y=e.config.inline&&s&&!f;if(r.keyCode===13&&s){if(f)return e.setDate(e._input.value,!0,i===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),i.blur();e.open()}else if(ue(i)||g||y){var L=!!e.timeContainer&&e.timeContainer.contains(i);switch(r.keyCode){case 13:L?(r.preventDefault(),u(),Fe()):rt(r);break;case 27:r.preventDefault(),Fe();break;case 8:case 46:s&&!e.config.allowInput&&(r.preventDefault(),e.clear());break;case 37:case 39:if(!L&&!s){r.preventDefault();var E=c();if(e.daysContainer!==void 0&&(f===!1||E&&Le(E))){var R=r.keyCode===39?1:-1;r.ctrlKey?(r.stopPropagation(),Pe(R),I(Y(1),0)):I(void 0,R)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:r.preventDefault();var D=r.keyCode===40?1:-1;e.daysContainer&&i.$i!==void 0||i===e.input||i===e.altInput?r.ctrlKey?(r.stopPropagation(),Ie(e.currentYear-D),I(Y(1),0)):L||I(void 0,D*7):i===e.currentYearElement?Ie(e.currentYear-D):e.config.enableTime&&(!L&&e.hourElement&&e.hourElement.focus(),u(r),e._debouncedChange());break;case 9:if(L){var P=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(Ee){return Ee}),K=P.indexOf(i);if(K!==-1){var We=P[K+(r.shiftKey?-1:1)];r.preventDefault(),(We||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(i)&&r.shiftKey&&(r.preventDefault(),e._input.focus());break;default:break}}if(e.amPM!==void 0&&i===e.amPM)switch(r.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],O(),me();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],O(),me();break}(s||ue(i))&&v("onKeyDown",r)}function ze(r,i){if(i===void 0&&(i="flatpickr-day"),!(e.selectedDates.length!==1||r&&(!r.classList.contains(i)||r.classList.contains("flatpickr-disabled")))){for(var s=r?r.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),f=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),g=Math.min(s,e.selectedDates[0].getTime()),y=Math.max(s,e.selectedDates[0].getTime()),L=!1,E=0,R=0,D=g;Dg&&DE)?E=D:D>f&&(!R||D ."+i));P.forEach(function(K){var We=K.dateObj,Ee=We.getTime(),Rt=E>0&&Ee0&&Ee>R;if(Rt){K.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Tt){K.classList.remove(Tt)});return}else if(L&&!Rt)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Tt){K.classList.remove(Tt)}),r!==void 0&&(r.classList.add(s<=e.selectedDates[0].getTime()?"startRange":"endRange"),fs&&Ee===f&&K.classList.add("endRange"),Ee>=E&&(R===0||Ee<=R)&&Xr(Ee,f,s)&&K.classList.add("inRange"))})}}function ct(){e.isOpen&&!e.config.static&&!e.config.inline&&Xe()}function Dt(r,i){if(i===void 0&&(i=e._positionElement),e.isMobile===!0){if(r){r.preventDefault();var s=we(r);s&&s.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),v("onOpen");return}else if(e._input.disabled||e.config.inline)return;var f=e.isOpen;e.isOpen=!0,f||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),v("onOpen"),Xe(i)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(r===void 0||!e.timeContainer.contains(r.relatedTarget))&&setTimeout(function(){return e.hourElement.select()},50)}function lt(r){return function(i){var s=e.config["_"+r+"Date"]=e.parseDate(i,e.config.dateFormat),f=e.config["_"+(r==="min"?"max":"min")+"Date"];s!==void 0&&(e[r==="min"?"minDateHasTime":"maxDateHasTime"]=s.getHours()>0||s.getMinutes()>0||s.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(g){return fe(g)}),!e.selectedDates.length&&r==="min"&&T(s),me()),e.daysContainer&&(nt(),s!==void 0?e.currentYearElement[r]=s.getFullYear().toString():e.currentYearElement.removeAttribute(r),e.currentYearElement.disabled=!!f&&s!==void 0&&f.getFullYear()===s.getFullYear())}}function ut(){var r=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=ve(ve({},JSON.parse(JSON.stringify(t.dataset||{}))),n),s={};e.config.parseDate=i.parseDate,e.config.formatDate=i.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(P){e.config._enable=sn(P)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(P){e.config._disable=sn(P)}});var f=i.mode==="time";if(!i.dateFormat&&(i.enableTime||f)){var g=re.defaultConfig.dateFormat||st.dateFormat;s.dateFormat=i.noCalendar||f?"H:i"+(i.enableSeconds?":S":""):g+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||f)&&!i.altFormat){var y=re.defaultConfig.altFormat||st.altFormat;s.altFormat=i.noCalendar||f?"h:i"+(i.enableSeconds?":S K":" K"):y+(" h:i"+(i.enableSeconds?":S":"")+" K")}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:lt("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:lt("max")});var L=function(P){return function(K){e.config[P==="min"?"_minTime":"_maxTime"]=e.parseDate(K,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:L("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:L("max")}),i.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,s,i);for(var E=0;E-1?e.config[D]=En(R[D]).map(d).concat(e.config[D]):typeof i[D]>"u"&&(e.config[D]=R[D])}i.altInputClass||(e.config.altInputClass=tt().className+" "+e.config.altInputClass),v("onParseConfig")}function tt(){return e.config.wrap?t.querySelector("[data-input]"):t}function ft(){typeof e.config.locale!="object"&&typeof re.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=ve(ve({},re.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?re.l10ns[e.config.locale]:void 0),et.D="("+e.l10n.weekdays.shorthand.join("|")+")",et.l="("+e.l10n.weekdays.longhand.join("|")+")",et.M="("+e.l10n.months.shorthand.join("|")+")",et.F="("+e.l10n.months.longhand.join("|")+")",et.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")";var r=ve(ve({},n),JSON.parse(JSON.stringify(t.dataset||{})));r.time_24hr===void 0&&re.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=or(e),e.parseDate=Tn({config:e.config,l10n:e.l10n})}function Xe(r){if(typeof e.config.position=="function")return void e.config.position(e,r);if(e.calendarContainer!==void 0){v("onPreCalendarPosition");var i=r||e._positionElement,s=Array.prototype.reduce.call(e.calendarContainer.children,function(vi,bi){return vi+bi.offsetHeight},0),f=e.calendarContainer.offsetWidth,g=e.config.position.split(" "),y=g[0],L=g.length>1?g[1]:null,E=i.getBoundingClientRect(),R=window.innerHeight-E.bottom,D=y==="above"||y!=="below"&&Rs,P=window.pageYOffset+E.top+(D?-s-2:i.offsetHeight+2);if(ge(e.calendarContainer,"arrowTop",!D),ge(e.calendarContainer,"arrowBottom",D),!e.config.inline){var K=window.pageXOffset+E.left,We=!1,Ee=!1;L==="center"?(K-=(f-E.width)/2,We=!0):L==="right"&&(K-=f-E.width,Ee=!0),ge(e.calendarContainer,"arrowLeft",!We&&!Ee),ge(e.calendarContainer,"arrowCenter",We),ge(e.calendarContainer,"arrowRight",Ee);var Rt=window.document.body.offsetWidth-(window.pageXOffset+E.right),Tt=K+f>window.document.body.offsetWidth,ui=Rt+f>window.document.body.offsetWidth;if(ge(e.calendarContainer,"rightMost",Tt),!e.config.static)if(e.calendarContainer.style.top=P+"px",!Tt)e.calendarContainer.style.left=K+"px",e.calendarContainer.style.right="auto";else if(!ui)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=Rt+"px";else{var kn=Ne();if(kn===void 0)return;var fi=window.document.body.offsetWidth,di=Math.max(0,fi/2-f/2),pi=".flatpickr-calendar.centerMost:before",mi=".flatpickr-calendar.centerMost:after",hi=kn.cssRules.length,gi="{left:"+E.left+"px;right:auto;}";ge(e.calendarContainer,"rightMost",!1),ge(e.calendarContainer,"centerMost",!0),kn.insertRule(pi+","+mi+gi,hi),e.calendarContainer.style.left=di+"px",e.calendarContainer.style.right="auto"}}}}function Ne(){for(var r=null,i=0;ie.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=f,e.config.mode==="single")e.selectedDates=[g];else if(e.config.mode==="multiple"){var L=$(g);L?e.selectedDates.splice(parseInt(L),1):e.selectedDates.push(g)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=g,e.selectedDates.push(g),xe(g,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(P,K){return P.getTime()-K.getTime()}));if(O(),y){var E=e.currentYear!==g.getFullYear();e.currentYear=g.getFullYear(),e.currentMonth=g.getMonth(),E&&(v("onYearChange"),j()),v("onMonthChange")}if(te(),B(),me(),!y&&e.config.mode!=="range"&&e.config.showMonths===1?V(f):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var R=e.config.mode==="single"&&!e.config.enableTime,D=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(R||D)&&Fe()}S()}}var Ke={locale:[ft,De],showMonths:[ae,p,ee],minDate:[N],maxDate:[N],positionElement:[cn],clickOpens:[function(){e.config.clickOpens===!0?(w(e._input,"focus",e.open),w(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Ct(r,i){if(r!==null&&typeof r=="object"){Object.assign(e.config,r);for(var s in r)Ke[s]!==void 0&&Ke[s].forEach(function(f){return f()})}else e.config[r]=i,Ke[r]!==void 0?Ke[r].forEach(function(f){return f()}):xn.indexOf(r)>-1&&(e.config[r]=En(i));e.redraw(),me(!0)}function dt(r,i){var s=[];if(r instanceof Array)s=r.map(function(f){return e.parseDate(f,i)});else if(r instanceof Date||typeof r=="number")s=[e.parseDate(r,i)];else if(typeof r=="string")switch(e.config.mode){case"single":case"time":s=[e.parseDate(r,i)];break;case"multiple":s=r.split(e.config.conjunction).map(function(f){return e.parseDate(f,i)});break;case"range":s=r.split(e.l10n.rangeSeparator).map(function(f){return e.parseDate(f,i)});break;default:break}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(r)));e.selectedDates=e.config.allowInvalidPreload?s:s.filter(function(f){return f instanceof Date&&fe(f,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(f,g){return f.getTime()-g.getTime()})}function Et(r,i,s){if(i===void 0&&(i=!1),s===void 0&&(s=e.config.dateFormat),r!==0&&!r||r instanceof Array&&r.length===0)return e.clear(i);dt(r,s),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),N(void 0,i),T(),e.selectedDates.length===0&&e.clear(!1),me(i),i&&v("onChange")}function sn(r){return r.slice().map(function(i){return typeof i=="string"||typeof i=="number"||i instanceof Date?e.parseDate(i,void 0,!0):i&&typeof i=="object"&&i.from&&i.to?{from:e.parseDate(i.from,void 0),to:e.parseDate(i.to,void 0)}:i}).filter(function(i){return i})}function An(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var r=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);r&&dt(r,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function Sn(){if(e.input=tt(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=U(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),cn()}function cn(){e._positionElement=e.config.positionElement||e._input}function Pn(){var r=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=U("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=r,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=r==="datetime-local"?"Y-m-d\\TH:i:S":r==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}w(e.mobileInput,"change",function(i){e.setDate(we(i).value,!1,e.mobileFormatStr),v("onChange"),v("onClose")})}function m(r){if(e.isOpen===!0)return e.close();e.open(r)}function v(r,i){if(e.config!==void 0){var s=e.config[r];if(s!==void 0&&s.length>0)for(var f=0;s[f]&&f=0&&xe(r,e.selectedDates[1])<=0}function te(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(r,i){var s=new Date(e.currentYear,e.currentMonth,1);s.setMonth(e.currentMonth+i),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[i].textContent=Gt(s.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=s.getMonth().toString(),r.value=s.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYeare.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function pe(r){var i=r||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(s){return e.formatDate(s,i)}).filter(function(s,f,g){return e.config.mode!=="range"||e.config.enableTime||g.indexOf(s)===f}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function me(r){r===void 0&&(r=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=pe(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=pe(e.config.altFormat)),r!==!1&&v("onValueUpdate")}function ln(r){var i=we(r),s=e.prevMonthNav.contains(i),f=e.nextMonthNav.contains(i);s||f?Pe(s?-1:1):e.yearElements.indexOf(i)>=0?i.select():i.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):i.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function Je(r){r.preventDefault();var i=r.type==="keydown",s=we(r),f=s;e.amPM!==void 0&&s===e.amPM&&(e.amPM.textContent=e.l10n.amPM[ye(e.amPM.textContent===e.l10n.amPM[0])]);var g=parseFloat(f.getAttribute("min")),y=parseFloat(f.getAttribute("max")),L=parseFloat(f.getAttribute("step")),E=parseInt(f.value,10),R=r.delta||(i?r.which===38?1:-1:0),D=E+L*R;if(typeof f.value<"u"&&f.value.length===2){var P=f===e.hourElement,K=f===e.minuteElement;Dy&&(D=f===e.hourElement?D-y-ye(!e.amPM):g,K&&l(void 0,1,e.hourElement)),e.amPM&&P&&(L===1?D+E===23:Math.abs(D-E)>L)&&(e.amPM.textContent=e.l10n.amPM[ye(e.amPM.textContent===e.l10n.amPM[0])]),f.value=he(D)}}return a(),e}function Nt(t,n){for(var e=Array.prototype.slice.call(t).filter(function(d){return d instanceof HTMLElement}),o=[],a=0;anew Date(e));let t=this,n=Qr(this.element,{mode:this.modeValue,minDate:this.minDateValue,dateFormat:this.dateFormatValue,defaultDate:this.rangeValue,onChange:function(e,o,a){t.setCurrentRange(a)}});this.setCurrentRange(n)}setCurrentRange(t){let n=o=>{let a={month:"short",day:"numeric"};return o.toLocaleDateString("en-US",a)},e=t.selectedDates.map(n).join(" - ");this.hasLabelTarget&&(this.labelTarget.textContent=e,this.inputTarget.value=t.selectedDates)}};X(Ft,"targets",["label","input"]),X(Ft,"values",{mode:{type:String,default:"range"},minDate:{type:String,default:"today"},dateFormat:{type:String,default:"Y-m-d"},range:{type:Array,default:[ei,Bo]}});var ti=require("@hotwired/stimulus");var Qt=class extends ti.Controller{connect(){$e(this,{element:this.menuTarget})}toggle(){this.toggleTransition()}hide(t){!this.element.contains(t.target)&&!this.menuTarget.classList.contains("hidden")&&this.leave()}};X(Qt,"targets",["menu","trigger"]);var ni=require("@hotwired/stimulus");var Zt=class extends ni.Controller{connect(){$e(this,{element:this.contentTarget}),Ur(this,{element:this.contentTarget})}open(t){t.preventDefault(),this.enableAppearance(),this.toggleTransition()}close(t){t.preventDefault(),this.leave(),this.disableAppearance()}clickOutside(t){let n=t.target.dataset.action;n=="click->modal#open"||n=="click->modal#open:prevent"||this.close(t)}closeWithEsc(t){t.keyCode===27&&!this.containerTarget.classList.contains("hidden")&&this.close(t)}enableAppearance(){this.containerTarget.classList.add("bg-black/80"),this.containerTarget.classList.remove("hidden")}disableAppearance(){this.containerTarget.classList.add("hidden"),this.containerTarget.classList.remove("bg-black/80")}disconnect(){this.toggleTransition()}};X(Zt,"targets",["container","content"]);var ri=require("@hotwired/stimulus");var en=class extends ri.Controller{connect(){this.updateTrack()}updateTrack(){let t=(this.rangeTarget.value-this.rangeTarget.min)/(this.rangeTarget.max-this.rangeTarget.min)*100;this.rangeTarget.style.setProperty("--range-fill",`${t}%`)}onInput(){this.updateTrack()}};X(en,"targets",["range"]);var ii=require("@hotwired/stimulus");var jt=class extends ii.Controller{connect(){this.originalText=this.contentTarget.textContent,this.truncate()}truncate(){if(this.originalText.length<=this.maxLengthValue){this.buttonTarget.classList.add("hidden");return}this.expanded||(this.contentTarget.textContent=this.originalText.slice(0,this.maxLengthValue)+"...",this.buttonTarget.textContent=this.moreTextValue)}toggle(){this.expanded=!this.expanded,this.expanded?(this.contentTarget.textContent=this.originalText,this.buttonTarget.textContent=this.lessTextValue):this.truncate()}};X(jt,"targets",["content","button"]),X(jt,"values",{maxLength:{type:Number,default:100},moreText:{type:String,default:"Read more"},lessText:{type:String,default:"Read less"}});var oi=require("@hotwired/stimulus");var tn=class extends oi.Controller{connect(){this.selectAllTarget.addEventListener("change",this.selectAll.bind(this)),this.checkboxTargets.forEach(t=>{t.addEventListener("change",this.updateSelectAllState.bind(this))}),this.updateSelectAllState()}selectAll(){let t=this.selectAllTarget.checked;this.checkboxTargets.forEach(n=>{n.checked=t})}updateSelectAllState(){let t=this.checkboxTargets.filter(n=>n.checked).length;t===0?(this.selectAllTarget.checked=!1,this.selectAllTarget.indeterminate=!1):t===this.checkboxTargets.length?(this.selectAllTarget.checked=!0,this.selectAllTarget.indeterminate=!1):(this.selectAllTarget.checked=!1,this.selectAllTarget.indeterminate=!0)}};X(tn,"targets",["checkbox","selectAll"]);var ai=require("@hotwired/stimulus");var nn=class extends ai.Controller{connect(){this.activeTabClasses=(this.data.get("activeTab")||"active").split(" "),this.inactiveTabClasses=(this.data.get("inactiveTab")||"inactive").split(" "),this.anchor&&(this.index=this.tabTargets.findIndex(t=>t.id===this.anchor)),this.showTab()}change(t){t.preventDefault(),t.currentTarget.dataset.index?this.index=t.currentTarget.dataset.index:t.currentTarget.dataset.id?this.index=this.tabTargets.findIndex(n=>n.id==t.currentTarget.dataset.id):this.index=this.tabTargets.indexOf(t.currentTarget),window.dispatchEvent(new CustomEvent("tsc:tab-change"))}showTab(){this.tabTargets.forEach((t,n)=>{let e=this.panelTargets[n];n===this.index?(e.classList.remove("hidden"),t.classList.remove(...this.inactiveTabClasses),t.classList.add(...this.activeTabClasses),t.id&&(location.hash=t.id)):(e.classList.add("hidden"),t.classList.remove(...this.activeTabClasses),t.classList.add(...this.inactiveTabClasses))})}get index(){return parseInt(this.data.get("index")||0)}set index(t){this.data.set("index",t>=0?t:0),this.showTab()}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};X(nn,"targets",["tab","panel"]);var si=require("@hotwired/stimulus");var rn=class extends si.Controller{connect(){$e(this,{element:this.element}),this.triggerOnLoadValue&&this.toggleTransition()}toggle(){this.toggleTransition()}hide(){this.leave()}disconnect(){this.leave()}};X(rn,"values",{triggerOnLoad:{type:Boolean,default:!1}});var ci=require("@hotwired/stimulus");var on=class extends ci.Controller{connect(){$e(this,{element:this.toggleableTarget})}toggle(){this.toggleTransition()}};X(on,"targets",["toggleable"]);var li=require("@hotwired/stimulus");var an=class extends li.Controller{connect(){let t={};this.hasContentValue&&(t.content=this.contentValue),this.hasAllowHtmlValue&&(t.allowHTML=this.allowHtmlValue),this.tippy=wn(this.element,t)}disconnect(){this.tippy.destroy()}};X(an,"values",{content:String,allowHtml:{type:Boolean,default:!1}}); diff --git a/dist/railsui-stimulus.cjs.map b/dist/railsui-stimulus.cjs.map index 3bd3559..254c19a 100644 --- a/dist/railsui-stimulus.cjs.map +++ b/dist/railsui-stimulus.cjs.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../src/index.js", "../src/railsui_clipboard.js", "../node_modules/@popperjs/core/lib/enums.js", "../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../node_modules/@popperjs/core/lib/utils/math.js", "../node_modules/@popperjs/core/lib/utils/userAgent.js", "../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../node_modules/@popperjs/core/lib/utils/within.js", "../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../node_modules/@popperjs/core/lib/utils/getVariation.js", "../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../node_modules/@popperjs/core/lib/modifiers/flip.js", "../node_modules/@popperjs/core/lib/modifiers/hide.js", "../node_modules/@popperjs/core/lib/modifiers/offset.js", "../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../node_modules/@popperjs/core/lib/utils/debounce.js", "../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../node_modules/@popperjs/core/lib/createPopper.js", "../node_modules/@popperjs/core/lib/popper.js", "../node_modules/tippy.js/src/constants.ts", "../node_modules/tippy.js/src/utils.ts", "../node_modules/tippy.js/src/dom-utils.ts", "../node_modules/tippy.js/src/bindGlobalEventListeners.ts", "../node_modules/tippy.js/src/browser.ts", "../node_modules/tippy.js/src/validation.ts", "../node_modules/tippy.js/src/props.ts", "../node_modules/tippy.js/src/template.ts", "../node_modules/tippy.js/src/createTippy.ts", "../node_modules/tippy.js/src/index.ts", "../node_modules/tippy.js/src/addons/createSingleton.ts", "../node_modules/tippy.js/src/addons/delegate.ts", "../node_modules/tippy.js/src/plugins/animateFill.ts", "../node_modules/tippy.js/src/plugins/followCursor.ts", "../node_modules/tippy.js/src/plugins/inlinePositioning.ts", "../node_modules/tippy.js/src/plugins/sticky.ts", "../node_modules/tippy.js/build/base.js", "../src/railsui_count_up.js", "../src/railsui_date_range_picker.js", "../node_modules/flatpickr/dist/esm/types/options.js", "../node_modules/flatpickr/dist/esm/l10n/default.js", "../node_modules/flatpickr/dist/esm/utils/index.js", "../node_modules/flatpickr/dist/esm/utils/dom.js", "../node_modules/flatpickr/dist/esm/utils/formatting.js", "../node_modules/flatpickr/dist/esm/utils/dates.js", "../node_modules/flatpickr/dist/esm/utils/polyfills.js", "../node_modules/flatpickr/dist/esm/index.js", "../src/railsui_dropdown.js", "../node_modules/stimulus-use/dist/index.js", "../src/railsui_modal.js", "../src/railsui_range.js", "../src/railsui_read_more.js", "../src/railsui_select_all.js", "../src/railsui_tabs.js", "../src/railsui_toast.js", "../src/railsui_toggle.js", "../src/railsui_tooltip.js"], - "sourcesContent": ["export { default as RailsuiClipboard } from './railsui_clipboard'\nexport { default as RailsuiCountUp } from './railsui_count_up'\nexport { default as RailsuiDateRangePicker } from './railsui_date_range_picker'\nexport { default as RailsuiDropdown } from './railsui_dropdown'\nexport { default as RailsuiModal } from './railsui_modal'\nexport { default as RailsuiRange } from './railsui_range'\nexport { default as RailsuiReadMore } from './railsui_read_more'\nexport { default as RailsuiSelectAll } from './railsui_select_all'\nexport { default as RailsuiTabs } from './railsui_tabs'\nexport { default as RailsuiToast } from './railsui_toast'\nexport { default as RailsuiToggle } from './railsui_toggle'\nexport { default as RailsuiTooltip } from './railsui_tooltip'\n", "import { Controller } from '@hotwired/stimulus'\nimport tippy from 'tippy.js'\n\nexport default class extends Controller {\n static targets = ['content']\n\n copy(event) {\n event.preventDefault()\n navigator.clipboard.writeText(this.textToCopy)\n this.showFeedback(event.currentTarget, 'Copied!')\n }\n\n get textToCopy() {\n const { value, innerText } = this.contentTarget\n return value || innerText\n }\n\n showFeedback(element, message) {\n tippy(element, {\n content: message,\n showOnCreate: true,\n onHidden: instance => {\n instance.destroy()\n },\n })\n }\n}\n", "export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];", "export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}", "export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}", "import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };", "import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};", "import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}", "export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;", "export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}", "import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}", "import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}", "import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}", "import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}", "import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}", "import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}", "import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}", "import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}", "export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}", "import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}", "export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}", "import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}", "export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};", "export default function getVariation(placement) {\n return placement.split('-')[1];\n}", "import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};", "import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};", "var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}", "var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}", "import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}", "import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}", "import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}", "import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}", "import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}", "export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}", "import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}", "import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}", "import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}", "import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}", "import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases \u2013 research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};", "import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};", "import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};", "export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}", "import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};", "export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}", "import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}", "export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}", "export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}", "import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update \u2013 it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update \u2013 it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";", "export const ROUND_ARROW =\n '';\n\nexport const BOX_CLASS = `__NAMESPACE_PREFIX__-box`;\nexport const CONTENT_CLASS = `__NAMESPACE_PREFIX__-content`;\nexport const BACKDROP_CLASS = `__NAMESPACE_PREFIX__-backdrop`;\nexport const ARROW_CLASS = `__NAMESPACE_PREFIX__-arrow`;\nexport const SVG_ARROW_CLASS = `__NAMESPACE_PREFIX__-svg-arrow`;\n\nexport const TOUCH_OPTIONS = {passive: true, capture: true};\n\nexport const TIPPY_DEFAULT_APPEND_TO = () => document.body;\n", "import {BasePlacement, Placement} from './types';\n\nexport function hasOwnProperty(\n obj: Record,\n key: string\n): boolean {\n return {}.hasOwnProperty.call(obj, key);\n}\n\nexport function getValueAtIndexOrReturn(\n value: T | [T | null, T | null],\n index: number,\n defaultValue: T | [T, T]\n): T {\n if (Array.isArray(value)) {\n const v = value[index];\n return v == null\n ? Array.isArray(defaultValue)\n ? defaultValue[index]\n : defaultValue\n : v;\n }\n\n return value;\n}\n\nexport function isType(value: any, type: string): boolean {\n const str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(`${type}]`) > -1;\n}\n\nexport function invokeWithArgsOrReturn(value: any, args: any[]): any {\n return typeof value === 'function' ? value(...args) : value;\n}\n\nexport function debounce(\n fn: (arg: T) => void,\n ms: number\n): (arg: T) => void {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n let timeout: any;\n\n return (arg): void => {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n fn(arg);\n }, ms);\n };\n}\n\nexport function removeProperties(obj: T, keys: string[]): Partial {\n const clone = {...obj};\n keys.forEach((key) => {\n delete (clone as any)[key];\n });\n return clone;\n}\n\nexport function splitBySpaces(value: string): string[] {\n return value.split(/\\s+/).filter(Boolean);\n}\n\nexport function normalizeToArray(value: T | T[]): T[] {\n return ([] as T[]).concat(value);\n}\n\nexport function pushIfUnique(arr: T[], value: T): void {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n}\n\nexport function appendPxIfNumber(value: string | number): string {\n return typeof value === 'number' ? `${value}px` : value;\n}\n\nexport function unique(arr: T[]): T[] {\n return arr.filter((item, index) => arr.indexOf(item) === index);\n}\n\nexport function getNumber(value: string | number): number {\n return typeof value === 'number' ? value : parseFloat(value);\n}\n\nexport function getBasePlacement(placement: Placement): BasePlacement {\n return placement.split('-')[0] as BasePlacement;\n}\n\nexport function arrayFrom(value: ArrayLike): any[] {\n return [].slice.call(value);\n}\n\nexport function removeUndefinedProps(\n obj: Record\n): Partial> {\n return Object.keys(obj).reduce((acc, key) => {\n if (obj[key] !== undefined) {\n (acc as any)[key] = obj[key];\n }\n\n return acc;\n }, {});\n}\n", "import {ReferenceElement, Targets} from './types';\nimport {PopperTreeData} from './types-internal';\nimport {arrayFrom, isType, normalizeToArray, getBasePlacement} from './utils';\n\nexport function div(): HTMLDivElement {\n return document.createElement('div');\n}\n\nexport function isElement(value: unknown): value is Element | DocumentFragment {\n return ['Element', 'Fragment'].some((type) => isType(value, type));\n}\n\nexport function isNodeList(value: unknown): value is NodeList {\n return isType(value, 'NodeList');\n}\n\nexport function isMouseEvent(value: unknown): value is MouseEvent {\n return isType(value, 'MouseEvent');\n}\n\nexport function isReferenceElement(value: any): value is ReferenceElement {\n return !!(value && value._tippy && value._tippy.reference === value);\n}\n\nexport function getArrayOfElements(value: Targets): Element[] {\n if (isElement(value)) {\n return [value];\n }\n\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return arrayFrom(document.querySelectorAll(value));\n}\n\nexport function setTransitionDuration(\n els: (HTMLDivElement | null)[],\n value: number\n): void {\n els.forEach((el) => {\n if (el) {\n el.style.transitionDuration = `${value}ms`;\n }\n });\n}\n\nexport function setVisibilityState(\n els: (HTMLDivElement | null)[],\n state: 'visible' | 'hidden'\n): void {\n els.forEach((el) => {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\n\nexport function getOwnerDocument(\n elementOrElements: Element | Element[]\n): Document {\n const [element] = normalizeToArray(elementOrElements);\n\n // Elements created via a