From 217b38849f124d73d7a3c9decdc9e95c1a37e327 Mon Sep 17 00:00:00 2001 From: AI Engineer Date: Sat, 30 May 2026 09:41:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=20bindDarkMode=20?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=B9=B6=E8=A1=A5=E5=85=A8=E8=89=B2=E5=BD=A9?= =?UTF-8?q?=E5=8F=98=E9=87=8F=20(by=20AI)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/bootstrap.js | 50 ++++++++++-------------- dist/bootstrap.min.js | 4 +- src/index.js | 88 ++++++++++++++++--------------------------- test/index.html | 2 +- 4 files changed, 55 insertions(+), 89 deletions(-) diff --git a/dist/bootstrap.js b/dist/bootstrap.js index 28255cf..5cef29f 100644 --- a/dist/bootstrap.js +++ b/dist/bootstrap.js @@ -2120,7 +2120,7 @@ url("data:font/woff;base64,d09GRgABAAAAAsBAAAsAAAAHavgAAQAAAAAAAAAAAAAAAAAAAAAAA console.error("vite-plugin-css-injected-by-js", e); } })(); -import { LocalStorage, Hash, RefreshState } from "@web/state"; +import "@web/state"; var top = "top"; var bottom = "bottom"; var right = "right"; @@ -7176,53 +7176,41 @@ const bootstrap = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro Toast, Tooltip }, Symbol.toStringTag, { value: "Module" })); -const GlobalStates = { Hash, LocalStorage }; const Bootstrap = { // 原始 Bootstrap 实例引用 ...bootstrap, /** - * 绑定暗色模式到 State 路径 - * @param {string|Object} stateOrPath 例如 'LocalStorage.darkMode' 或某个 NewState 对象 - * @param {string} [key] 如果第一个参数是对象,则需要指定 key + * 绑定暗色模式 + * @param {Object} state NewState 对象 (如 LocalStorage) + * @param {string} key 键名 (如 'darkMode') */ - bindDarkMode: (stateOrPath, key) => { + bindDarkMode: (state, key) => { if (typeof document === "undefined") return; const htmlNode = document.documentElement; const updateTheme = (val) => { - const theme = val ? "dark" : "light"; - htmlNode.setAttribute("data-bs-theme", theme); - htmlNode.setAttribute("$data-bs-theme", theme); + htmlNode.setAttribute("data-bs-theme", val ? "dark" : "light"); }; - let state, finalKey; - if (typeof stateOrPath === "string") { - const parts = stateOrPath.split("."); - state = GlobalStates[parts[0]]; - finalKey = parts[1]; - } else { - state = stateOrPath; - finalKey = key; + if (state && key) { + state.__watch(key, updateTheme); + updateTheme(state[key]); } - if (!state || !finalKey) return console.warn("Bootstrap.bindDarkMode: Invalid state or key"); - state.__watch(finalKey, (val) => { - updateTheme(val); - RefreshState(htmlNode); - }); - updateTheme(state[finalKey]); }, /** - * 动态配置主题 + * 动态配置主题变量 * @param {Object} config { primary: '#6366f1', ... } */ config: (config = {}) => { if (typeof document === "undefined") return; const root = document.documentElement; - if (config.primary) { - root.style.setProperty("--bs-primary", config.primary); - const rgb = Bootstrap._hexToRgb(config.primary); - if (rgb) root.style.setProperty("--bs-primary-rgb", `${rgb.r}, ${rgb.g}, ${rgb.b}`); - } - if (config.success) root.style.setProperty("--bs-success", config.success); - if (config.danger) root.style.setProperty("--bs-danger", config.danger); + const colors = ["primary", "secondary", "success", "info", "warning", "danger", "light", "dark"]; + colors.forEach((name) => { + const hex = config[name]; + if (hex) { + root.style.setProperty(`--bs-${name}`, hex); + const rgb = Bootstrap._hexToRgb(hex); + if (rgb) root.style.setProperty(`--bs-${name}-rgb`, `${rgb.r}, ${rgb.g}, ${rgb.b}`); + } + }); }, _hexToRgb: (hex) => { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); diff --git a/dist/bootstrap.min.js b/dist/bootstrap.min.js index e4eab5b..391e35f 100644 --- a/dist/bootstrap.min.js +++ b/dist/bootstrap.min.js @@ -2120,9 +2120,9 @@ url("data:font/woff;base64,d09GRgABAAAAAsBAAAsAAAAHavgAAQAAAAAAAAAAAAAAAAAAAAAAA console.error("vite-plugin-css-injected-by-js", e); } })(); -import{LocalStorage as t,Hash as e,RefreshState as i}from"@web/state";var n="top",s="bottom",o="right",r="left",a="auto",l=[n,s,o,r],c="start",h="end",d="clippingParents",u="viewport",f="popper",p="reference",m=l.reduce(function(t,e){return t.concat([e+"-"+c,e+"-"+h])},[]),g=[].concat(l,[a]).reduce(function(t,e){return t.concat([e,e+"-"+c,e+"-"+h])},[]),_="beforeRead",b="read",v="afterRead",y="beforeMain",w="main",A="afterMain",E="beforeWrite",T="write",C="afterWrite",O=[_,b,v,y,w,A,E,T,C];function x(t){return t?(t.nodeName||"").toLowerCase():null}function k(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function L(t){return t instanceof k(t).Element||t instanceof Element}function S(t){return t instanceof k(t).HTMLElement||t instanceof HTMLElement}function $(t){return"undefined"!=typeof ShadowRoot&&(t instanceof k(t).ShadowRoot||t instanceof ShadowRoot)}const D={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];S(s)&&x(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});S(n)&&x(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function I(t){return t.split("-")[0]}var N=Math.max,P=Math.min,M=Math.round;function j(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function F(){return!/^((?!chrome|android).)*safari/i.test(j())}function H(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&S(t)&&(s=t.offsetWidth>0&&M(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&M(n.height)/t.offsetHeight||1);var r=(L(t)?k(t):window).visualViewport,a=!F()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function W(t){var e=H(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function B(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&$(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function z(t){return k(t).getComputedStyle(t)}function R(t){return["table","td","th"].indexOf(x(t))>=0}function q(t){return((L(t)?t.ownerDocument:t.document)||window.document).documentElement}function V(t){return"html"===x(t)?t:t.assignedSlot||t.parentNode||($(t)?t.host:null)||q(t)}function K(t){return S(t)&&"fixed"!==z(t).position?t.offsetParent:null}function Q(t){for(var e=k(t),i=K(t);i&&R(i)&&"static"===z(i).position;)i=K(i);return i&&("html"===x(i)||"body"===x(i)&&"static"===z(i).position)?e:i||function(t){var e=/firefox/i.test(j());if(/Trident/i.test(j())&&S(t)&&"fixed"===z(t).position)return null;var i=V(t);for($(i)&&(i=i.host);S(i)&&["html","body"].indexOf(x(i))<0;){var n=z(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function X(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Y(t,e,i){return N(t,P(e,i))}function U(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function G(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}const J={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,a=t.name,c=t.options,h=i.elements.arrow,d=i.modifiersData.popperOffsets,u=I(i.placement),f=X(u),p=[r,o].indexOf(u)>=0?"height":"width";if(h&&d){var m=function(t,e){return U("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:G(t,l))}(c.padding,i),g=W(h),_="y"===f?n:r,b="y"===f?s:o,v=i.rects.reference[p]+i.rects.reference[f]-d[f]-i.rects.popper[p],y=d[f]-i.rects.reference[f],w=Q(h),A=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,E=v/2-y/2,T=m[_],C=A-g[p]-m[b],O=A/2-g[p]/2+E,x=Y(T,O,C),k=f;i.modifiersData[a]=((e={})[k]=x,e.centerOffset=x-O,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&B(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Z(t){return t.split("-")[1]}var tt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function et(t){var e,i=t.popper,a=t.popperRect,l=t.placement,c=t.variation,d=t.offsets,u=t.position,f=t.gpuAcceleration,p=t.adaptive,m=t.roundOffsets,g=t.isFixed,_=d.x,b=void 0===_?0:_,v=d.y,y=void 0===v?0:v,w="function"==typeof m?m({x:b,y:y}):{x:b,y:y};b=w.x,y=w.y;var A=d.hasOwnProperty("x"),E=d.hasOwnProperty("y"),T=r,C=n,O=window;if(p){var x=Q(i),L="clientHeight",S="clientWidth";if(x===k(i)&&"static"!==z(x=q(i)).position&&"absolute"===u&&(L="scrollHeight",S="scrollWidth"),l===n||(l===r||l===o)&&c===h)C=s,y-=(g&&x===O&&O.visualViewport?O.visualViewport.height:x[L])-a.height,y*=f?1:-1;if(l===r||(l===n||l===s)&&c===h)T=o,b-=(g&&x===O&&O.visualViewport?O.visualViewport.width:x[S])-a.width,b*=f?1:-1}var $,D=Object.assign({position:u},p&&tt),I=!0===m?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:M(i*s)/s||0,y:M(n*s)/s||0}}({x:b,y:y},k(i)):{x:b,y:y};return b=I.x,y=I.y,f?Object.assign({},D,(($={})[C]=E?"0":"",$[T]=A?"0":"",$.transform=(O.devicePixelRatio||1)<=1?"translate("+b+"px, "+y+"px)":"translate3d("+b+"px, "+y+"px, 0)",$)):Object.assign({},D,((e={})[C]=E?y+"px":"",e[T]=A?b+"px":"",e.transform="",e))}const it={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:I(e.placement),variation:Z(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,et(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,et(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var nt={passive:!0};const st={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=k(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,nt)}),a&&l.addEventListener("resize",i.update,nt),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,nt)}),a&&l.removeEventListener("resize",i.update,nt)}},data:{}};var ot={left:"right",right:"left",bottom:"top",top:"bottom"};function rt(t){return t.replace(/left|right|bottom|top/g,function(t){return ot[t]})}var at={start:"end",end:"start"};function lt(t){return t.replace(/start|end/g,function(t){return at[t]})}function ct(t){var e=k(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ht(t){return H(q(t)).left+ct(t).scrollLeft}function dt(t){var e=z(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function ut(t){return["html","body","#document"].indexOf(x(t))>=0?t.ownerDocument.body:S(t)&&dt(t)?t:ut(V(t))}function ft(t,e){var i;void 0===e&&(e=[]);var n=ut(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=k(n),r=s?[o].concat(o.visualViewport||[],dt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(ft(V(r)))}function pt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function mt(t,e,i){return e===u?pt(function(t,e){var i=k(t),n=q(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=F();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+ht(t),y:l}}(t,i)):L(e)?function(t,e){var i=H(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):pt(function(t){var e,i=q(t),n=ct(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=N(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=N(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+ht(t),l=-n.scrollTop;return"rtl"===z(s||i).direction&&(a+=N(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(q(t)))}function gt(t,e,i,n){var s="clippingParents"===e?function(t){var e=ft(V(t)),i=["absolute","fixed"].indexOf(z(t).position)>=0&&S(t)?Q(t):t;return L(i)?e.filter(function(t){return L(t)&&B(t,i)&&"body"!==x(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=mt(t,i,n);return e.top=N(s.top,e.top),e.right=P(s.right,e.right),e.bottom=P(s.bottom,e.bottom),e.left=N(s.left,e.left),e},mt(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function _t(t){var e,i=t.reference,a=t.element,l=t.placement,d=l?I(l):null,u=l?Z(l):null,f=i.x+i.width/2-a.width/2,p=i.y+i.height/2-a.height/2;switch(d){case n:e={x:f,y:i.y-a.height};break;case s:e={x:f,y:i.y+i.height};break;case o:e={x:i.x+i.width,y:p};break;case r:e={x:i.x-a.width,y:p};break;default:e={x:i.x,y:i.y}}var m=d?X(d):null;if(null!=m){var g="y"===m?"height":"width";switch(u){case c:e[m]=e[m]-(i[g]/2-a[g]/2);break;case h:e[m]=e[m]+(i[g]/2-a[g]/2)}}return e}function bt(t,e){void 0===e&&(e={});var i=e,r=i.placement,a=void 0===r?t.placement:r,c=i.strategy,h=void 0===c?t.strategy:c,m=i.boundary,g=void 0===m?d:m,_=i.rootBoundary,b=void 0===_?u:_,v=i.elementContext,y=void 0===v?f:v,w=i.altBoundary,A=void 0!==w&&w,E=i.padding,T=void 0===E?0:E,C=U("number"!=typeof T?T:G(T,l)),O=y===f?p:f,x=t.rects.popper,k=t.elements[A?O:y],S=gt(L(k)?k:k.contextElement||q(t.elements.popper),g,b,h),$=H(t.elements.reference),D=_t({reference:$,element:x,placement:a}),I=pt(Object.assign({},x,D)),N=y===f?I:$,P={top:S.top-N.top+C.top,bottom:N.bottom-S.bottom+C.bottom,left:S.left-N.left+C.left,right:N.right-S.right+C.right},M=t.modifiersData.offset;if(y===f&&M){var j=M[a];Object.keys(P).forEach(function(t){var e=[o,s].indexOf(t)>=0?1:-1,i=[n,s].indexOf(t)>=0?"y":"x";P[t]+=j[i]*e})}return P}const vt={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,h=t.name;if(!e.modifiersData[h]._skip){for(var d=i.mainAxis,u=void 0===d||d,f=i.altAxis,p=void 0===f||f,_=i.fallbackPlacements,b=i.padding,v=i.boundary,y=i.rootBoundary,w=i.altBoundary,A=i.flipVariations,E=void 0===A||A,T=i.allowedAutoPlacements,C=e.options.placement,O=I(C),x=_||(O===C||!E?[rt(C)]:function(t){if(I(t)===a)return[];var e=rt(t);return[lt(t),e,lt(e)]}(C)),k=[C].concat(x).reduce(function(t,i){return t.concat(I(i)===a?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,c=i.allowedAutoPlacements,h=void 0===c?g:c,d=Z(n),u=d?a?m:m.filter(function(t){return Z(t)===d}):l,f=u.filter(function(t){return h.indexOf(t)>=0});0===f.length&&(f=u);var p=f.reduce(function(e,i){return e[i]=bt(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[I(i)],e},{});return Object.keys(p).sort(function(t,e){return p[t]-p[e]})}(e,{placement:i,boundary:v,rootBoundary:y,padding:b,flipVariations:E,allowedAutoPlacements:T}):i)},[]),L=e.rects.reference,S=e.rects.popper,$=new Map,D=!0,N=k[0],P=0;P=0,W=H?"width":"height",B=bt(e,{placement:M,boundary:v,rootBoundary:y,altBoundary:w,padding:b}),z=H?F?o:r:F?s:n;L[W]>S[W]&&(z=rt(z));var R=rt(z),q=[];if(u&&q.push(B[j]<=0),p&&q.push(B[z]<=0,B[R]<=0),q.every(function(t){return t})){N=M,D=!1;break}$.set(M,q)}if(D)for(var V=function(t){var e=k.find(function(e){var i=$.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return N=e,"break"},K=E?3:1;K>0;K--){if("break"===V(K))break}e.placement!==N&&(e.modifiersData[h]._skip=!0,e.placement=N,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function yt(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function wt(t){return[n,o,s,r].some(function(e){return t[e]>=0})}const At={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=bt(e,{elementContext:"reference"}),a=bt(e,{altBoundary:!0}),l=yt(r,n),c=yt(a,s,o),h=wt(l),d=wt(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}};const Et={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,s=t.name,a=i.offset,l=void 0===a?[0,0]:a,c=g.reduce(function(t,i){return t[i]=function(t,e,i){var s=I(t),a=[r,n].indexOf(s)>=0?-1:1,l="function"==typeof i?i(Object.assign({},e,{placement:t})):i,c=l[0],h=l[1];return c=c||0,h=(h||0)*a,[r,o].indexOf(s)>=0?{x:h,y:c}:{x:c,y:h}}(i,e.rects,l),t},{}),h=c[e.placement],d=h.x,u=h.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=d,e.modifiersData.popperOffsets.y+=u),e.modifiersData[s]=c}};const Tt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=_t({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}};const Ct={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,a=t.name,l=i.mainAxis,h=void 0===l||l,d=i.altAxis,u=void 0!==d&&d,f=i.boundary,p=i.rootBoundary,m=i.altBoundary,g=i.padding,_=i.tether,b=void 0===_||_,v=i.tetherOffset,y=void 0===v?0:v,w=bt(e,{boundary:f,rootBoundary:p,padding:g,altBoundary:m}),A=I(e.placement),E=Z(e.placement),T=!E,C=X(A),O="x"===C?"y":"x",x=e.modifiersData.popperOffsets,k=e.rects.reference,L=e.rects.popper,S="function"==typeof y?y(Object.assign({},e.rects,{placement:e.placement})):y,$="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(x){if(h){var j,F="y"===C?n:r,H="y"===C?s:o,B="y"===C?"height":"width",z=x[C],R=z+w[F],q=z-w[H],V=b?-L[B]/2:0,K=E===c?k[B]:L[B],U=E===c?-L[B]:-k[B],G=e.elements.arrow,J=b&&G?W(G):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[F],it=tt[H],nt=Y(0,k[B],J[B]),st=T?k[B]/2-V-nt-et-$.mainAxis:K-nt-et-$.mainAxis,ot=T?-k[B]/2+V+nt+it+$.mainAxis:U+nt+it+$.mainAxis,rt=e.elements.arrow&&Q(e.elements.arrow),at=rt?"y"===C?rt.clientTop||0:rt.clientLeft||0:0,lt=null!=(j=null==D?void 0:D[C])?j:0,ct=z+ot-lt,ht=Y(b?P(R,z+st-lt-at):R,z,b?N(q,ct):q);x[C]=ht,M[C]=ht-z}if(u){var dt,ut="x"===C?n:r,ft="x"===C?s:o,pt=x[O],mt="y"===O?"height":"width",gt=pt+w[ut],_t=pt-w[ft],vt=-1!==[n,r].indexOf(A),yt=null!=(dt=null==D?void 0:D[O])?dt:0,wt=vt?gt:pt-k[mt]-L[mt]-yt+$.altAxis,At=vt?pt+k[mt]+L[mt]-yt-$.altAxis:_t,Et=b&&vt?(Ct=Y(wt,pt,Tt=At))>Tt?Tt:Ct:Y(b?wt:gt,pt,b?At:_t);x[O]=Et,M[O]=Et-pt}var Tt,Ct;e.modifiersData[a]=M}},requiresIfExists:["offset"]};function Ot(t,e,i){void 0===i&&(i=!1);var n,s,o=S(e),r=S(e)&&function(t){var e=t.getBoundingClientRect(),i=M(e.width)/t.offsetWidth||1,n=M(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=q(e),l=H(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==x(e)||dt(a))&&(c=(n=e)!==k(n)&&S(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:ct(n)),S(e)?((h=H(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=ht(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function xt(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var kt={placement:"bottom",modifiers:[],strategy:"absolute"};function Lt(){for(var t=arguments.length,e=new Array(t),i=0;iIt.has(t)&&It.get(t).get(e)||null,remove(t,e){if(!It.has(t))return;const i=It.get(t);i.delete(e),0===i.size&&It.delete(t)}},Pt="transitionend",Mt=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(t,e)=>`#${CSS.escape(e)}`)),t),jt=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),Ft=t=>{t.dispatchEvent(new Event(Pt))},Ht=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),Wt=t=>Ht(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(Mt(t)):null,Bt=t=>{if(!Ht(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},zt=t=>!t||t.nodeType!==Node.ELEMENT_NODE||(!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled"))),Rt=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?Rt(t.parentNode):null},qt=()=>{},Vt=t=>{t.offsetHeight},Kt=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Qt=[],Xt=()=>"rtl"===document.documentElement.dir,Yt=t=>{var e;e=()=>{const e=Kt();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(Qt.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of Qt)t()}),Qt.push(e)):e()},Ut=(t,e=[],i=t)=>"function"==typeof t?t.call(...e):i,Gt=(t,e,i=!0)=>{if(!i)return void Ut(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let s=!1;const o=({target:i})=>{i===e&&(s=!0,e.removeEventListener(Pt,o),Ut(t))};e.addEventListener(Pt,o),setTimeout(()=>{s||Ft(e)},n)},Jt=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},Zt=/[^.]*(?=\..*)\.|.*/,te=/\..*/,ee=/::\d+$/,ie={}; +import"@web/state";var t="top",e="bottom",i="right",n="left",s="auto",o=[t,e,i,n],r="start",a="end",l="clippingParents",c="viewport",h="popper",d="reference",u=o.reduce(function(t,e){return t.concat([e+"-"+r,e+"-"+a])},[]),f=[].concat(o,[s]).reduce(function(t,e){return t.concat([e,e+"-"+r,e+"-"+a])},[]),p="beforeRead",m="read",g="afterRead",_="beforeMain",b="main",v="afterMain",y="beforeWrite",w="write",A="afterWrite",E=[p,m,g,_,b,v,y,w,A];function T(t){return t?(t.nodeName||"").toLowerCase():null}function C(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function O(t){return t instanceof C(t).Element||t instanceof Element}function x(t){return t instanceof C(t).HTMLElement||t instanceof HTMLElement}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof C(t).ShadowRoot||t instanceof ShadowRoot)}const L={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];x(s)&&T(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce(function(t,e){return t[e]="",t},{});x(n)&&T(n)&&(Object.assign(n.style,o),Object.keys(s).forEach(function(t){n.removeAttribute(t)}))})}},requires:["computeStyles"]};function S(t){return t.split("-")[0]}var $=Math.max,D=Math.min,I=Math.round;function N(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function P(){return!/^((?!chrome|android).)*safari/i.test(N())}function j(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=t.getBoundingClientRect(),s=1,o=1;e&&x(t)&&(s=t.offsetWidth>0&&I(n.width)/t.offsetWidth||1,o=t.offsetHeight>0&&I(n.height)/t.offsetHeight||1);var r=(O(t)?C(t):window).visualViewport,a=!P()&&i,l=(n.left+(a&&r?r.offsetLeft:0))/s,c=(n.top+(a&&r?r.offsetTop:0))/o,h=n.width/s,d=n.height/o;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function M(t){var e=j(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function F(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&k(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function H(t){return C(t).getComputedStyle(t)}function W(t){return["table","td","th"].indexOf(T(t))>=0}function B(t){return((O(t)?t.ownerDocument:t.document)||window.document).documentElement}function z(t){return"html"===T(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||B(t)}function R(t){return x(t)&&"fixed"!==H(t).position?t.offsetParent:null}function q(t){for(var e=C(t),i=R(t);i&&W(i)&&"static"===H(i).position;)i=R(i);return i&&("html"===T(i)||"body"===T(i)&&"static"===H(i).position)?e:i||function(t){var e=/firefox/i.test(N());if(/Trident/i.test(N())&&x(t)&&"fixed"===H(t).position)return null;var i=z(t);for(k(i)&&(i=i.host);x(i)&&["html","body"].indexOf(T(i))<0;){var n=H(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function V(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function K(t,e,i){return $(t,D(e,i))}function Q(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce(function(e,i){return e[i]=t,e},{})}const Y={name:"arrow",enabled:!0,phase:"main",fn:function(s){var r,a=s.state,l=s.name,c=s.options,h=a.elements.arrow,d=a.modifiersData.popperOffsets,u=S(a.placement),f=V(u),p=[n,i].indexOf(u)>=0?"height":"width";if(h&&d){var m=function(t,e){return Q("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,o))}(c.padding,a),g=M(h),_="y"===f?t:n,b="y"===f?e:i,v=a.rects.reference[p]+a.rects.reference[f]-d[f]-a.rects.popper[p],y=d[f]-a.rects.reference[f],w=q(h),A=w?"y"===f?w.clientHeight||0:w.clientWidth||0:0,E=v/2-y/2,T=m[_],C=A-g[p]-m[b],O=A/2-g[p]/2+E,x=K(T,O,C),k=f;a.modifiersData[l]=((r={})[k]=x,r.centerOffset=x-O,r)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&F(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function U(t){return t.split("-")[1]}var G={top:"auto",right:"auto",bottom:"auto",left:"auto"};function J(s){var o,r=s.popper,l=s.popperRect,c=s.placement,h=s.variation,d=s.offsets,u=s.position,f=s.gpuAcceleration,p=s.adaptive,m=s.roundOffsets,g=s.isFixed,_=d.x,b=void 0===_?0:_,v=d.y,y=void 0===v?0:v,w="function"==typeof m?m({x:b,y:y}):{x:b,y:y};b=w.x,y=w.y;var A=d.hasOwnProperty("x"),E=d.hasOwnProperty("y"),T=n,O=t,x=window;if(p){var k=q(r),L="clientHeight",S="clientWidth";if(k===C(r)&&"static"!==H(k=B(r)).position&&"absolute"===u&&(L="scrollHeight",S="scrollWidth"),c===t||(c===n||c===i)&&h===a)O=e,y-=(g&&k===x&&x.visualViewport?x.visualViewport.height:k[L])-l.height,y*=f?1:-1;if(c===n||(c===t||c===e)&&h===a)T=i,b-=(g&&k===x&&x.visualViewport?x.visualViewport.width:k[S])-l.width,b*=f?1:-1}var $,D=Object.assign({position:u},p&&G),N=!0===m?function(t,e){var i=t.x,n=t.y,s=e.devicePixelRatio||1;return{x:I(i*s)/s||0,y:I(n*s)/s||0}}({x:b,y:y},C(r)):{x:b,y:y};return b=N.x,y=N.y,f?Object.assign({},D,(($={})[O]=E?"0":"",$[T]=A?"0":"",$.transform=(x.devicePixelRatio||1)<=1?"translate("+b+"px, "+y+"px)":"translate3d("+b+"px, "+y+"px, 0)",$)):Object.assign({},D,((o={})[O]=E?y+"px":"",o[T]=A?b+"px":"",o.transform="",o))}const Z={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:S(e.placement),variation:U(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,J(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,J(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var tt={passive:!0};const et={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=C(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(t){t.addEventListener("scroll",i.update,tt)}),a&&l.addEventListener("resize",i.update,tt),function(){o&&c.forEach(function(t){t.removeEventListener("scroll",i.update,tt)}),a&&l.removeEventListener("resize",i.update,tt)}},data:{}};var it={left:"right",right:"left",bottom:"top",top:"bottom"};function nt(t){return t.replace(/left|right|bottom|top/g,function(t){return it[t]})}var st={start:"end",end:"start"};function ot(t){return t.replace(/start|end/g,function(t){return st[t]})}function rt(t){var e=C(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function at(t){return j(B(t)).left+rt(t).scrollLeft}function lt(t){var e=H(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function ct(t){return["html","body","#document"].indexOf(T(t))>=0?t.ownerDocument.body:x(t)&<(t)?t:ct(z(t))}function ht(t,e){var i;void 0===e&&(e=[]);var n=ct(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=C(n),r=s?[o].concat(o.visualViewport||[],lt(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(ht(z(r)))}function dt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ut(t,e,i){return e===c?dt(function(t,e){var i=C(t),n=B(t),s=i.visualViewport,o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;var c=P();(c||!c&&"fixed"===e)&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a+at(t),y:l}}(t,i)):O(e)?function(t,e){var i=j(t,!1,"fixed"===e);return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}(e,i):dt(function(t){var e,i=B(t),n=rt(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=$(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=$(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+at(t),l=-n.scrollTop;return"rtl"===H(s||i).direction&&(a+=$(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(B(t)))}function ft(t,e,i,n){var s="clippingParents"===e?function(t){var e=ht(z(t)),i=["absolute","fixed"].indexOf(H(t).position)>=0&&x(t)?q(t):t;return O(i)?e.filter(function(t){return O(t)&&F(t,i)&&"body"!==T(t)}):[]}(t):[].concat(e),o=[].concat(s,[i]),r=o[0],a=o.reduce(function(e,i){var s=ut(t,i,n);return e.top=$(s.top,e.top),e.right=D(s.right,e.right),e.bottom=D(s.bottom,e.bottom),e.left=$(s.left,e.left),e},ut(t,r,n));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function pt(s){var o,l=s.reference,c=s.element,h=s.placement,d=h?S(h):null,u=h?U(h):null,f=l.x+l.width/2-c.width/2,p=l.y+l.height/2-c.height/2;switch(d){case t:o={x:f,y:l.y-c.height};break;case e:o={x:f,y:l.y+l.height};break;case i:o={x:l.x+l.width,y:p};break;case n:o={x:l.x-c.width,y:p};break;default:o={x:l.x,y:l.y}}var m=d?V(d):null;if(null!=m){var g="y"===m?"height":"width";switch(u){case r:o[m]=o[m]-(l[g]/2-c[g]/2);break;case a:o[m]=o[m]+(l[g]/2-c[g]/2)}}return o}function mt(n,s){void 0===s&&(s={});var r=s,a=r.placement,u=void 0===a?n.placement:a,f=r.strategy,p=void 0===f?n.strategy:f,m=r.boundary,g=void 0===m?l:m,_=r.rootBoundary,b=void 0===_?c:_,v=r.elementContext,y=void 0===v?h:v,w=r.altBoundary,A=void 0!==w&&w,E=r.padding,T=void 0===E?0:E,C=Q("number"!=typeof T?T:X(T,o)),x=y===h?d:h,k=n.rects.popper,L=n.elements[A?x:y],S=ft(O(L)?L:L.contextElement||B(n.elements.popper),g,b,p),$=j(n.elements.reference),D=pt({reference:$,element:k,placement:u}),I=dt(Object.assign({},k,D)),N=y===h?I:$,P={top:S.top-N.top+C.top,bottom:N.bottom-S.bottom+C.bottom,left:S.left-N.left+C.left,right:N.right-S.right+C.right},M=n.modifiersData.offset;if(y===h&&M){var F=M[u];Object.keys(P).forEach(function(n){var s=[i,e].indexOf(n)>=0?1:-1,o=[t,e].indexOf(n)>=0?"y":"x";P[n]+=F[o]*s})}return P}const gt={name:"flip",enabled:!0,phase:"main",fn:function(a){var l=a.state,c=a.options,h=a.name;if(!l.modifiersData[h]._skip){for(var d=c.mainAxis,p=void 0===d||d,m=c.altAxis,g=void 0===m||m,_=c.fallbackPlacements,b=c.padding,v=c.boundary,y=c.rootBoundary,w=c.altBoundary,A=c.flipVariations,E=void 0===A||A,T=c.allowedAutoPlacements,C=l.options.placement,O=S(C),x=_||(O===C||!E?[nt(C)]:function(t){if(S(t)===s)return[];var e=nt(t);return[ot(t),e,ot(e)]}(C)),k=[C].concat(x).reduce(function(t,e){return t.concat(S(e)===s?function(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,r=i.rootBoundary,a=i.padding,l=i.flipVariations,c=i.allowedAutoPlacements,h=void 0===c?f:c,d=U(n),p=d?l?u:u.filter(function(t){return U(t)===d}):o,m=p.filter(function(t){return h.indexOf(t)>=0});0===m.length&&(m=p);var g=m.reduce(function(e,i){return e[i]=mt(t,{placement:i,boundary:s,rootBoundary:r,padding:a})[S(i)],e},{});return Object.keys(g).sort(function(t,e){return g[t]-g[e]})}(l,{placement:e,boundary:v,rootBoundary:y,padding:b,flipVariations:E,allowedAutoPlacements:T}):e)},[]),L=l.rects.reference,$=l.rects.popper,D=new Map,I=!0,N=k[0],P=0;P=0,W=H?"width":"height",B=mt(l,{placement:j,boundary:v,rootBoundary:y,altBoundary:w,padding:b}),z=H?F?i:n:F?e:t;L[W]>$[W]&&(z=nt(z));var R=nt(z),q=[];if(p&&q.push(B[M]<=0),g&&q.push(B[z]<=0,B[R]<=0),q.every(function(t){return t})){N=j,I=!1;break}D.set(j,q)}if(I)for(var V=function(t){var e=k.find(function(e){var i=D.get(e);if(i)return i.slice(0,t).every(function(t){return t})});if(e)return N=e,"break"},K=E?3:1;K>0;K--){if("break"===V(K))break}l.placement!==N&&(l.modifiersData[h]._skip=!0,l.placement=N,l.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function _t(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function bt(s){return[t,i,e,n].some(function(t){return s[t]>=0})}const vt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=mt(e,{elementContext:"reference"}),a=mt(e,{altBoundary:!0}),l=_t(r,n),c=_t(a,s,o),h=bt(l),d=bt(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}};const yt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var s=e.state,o=e.options,r=e.name,a=o.offset,l=void 0===a?[0,0]:a,c=f.reduce(function(e,o){return e[o]=function(e,s,o){var r=S(e),a=[n,t].indexOf(r)>=0?-1:1,l="function"==typeof o?o(Object.assign({},s,{placement:e})):o,c=l[0],h=l[1];return c=c||0,h=(h||0)*a,[n,i].indexOf(r)>=0?{x:h,y:c}:{x:c,y:h}}(o,s.rects,l),e},{}),h=c[s.placement],d=h.x,u=h.y;null!=s.modifiersData.popperOffsets&&(s.modifiersData.popperOffsets.x+=d,s.modifiersData.popperOffsets.y+=u),s.modifiersData[r]=c}};const wt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=pt({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}};const At={name:"preventOverflow",enabled:!0,phase:"main",fn:function(s){var o=s.state,a=s.options,l=s.name,c=a.mainAxis,h=void 0===c||c,d=a.altAxis,u=void 0!==d&&d,f=a.boundary,p=a.rootBoundary,m=a.altBoundary,g=a.padding,_=a.tether,b=void 0===_||_,v=a.tetherOffset,y=void 0===v?0:v,w=mt(o,{boundary:f,rootBoundary:p,padding:g,altBoundary:m}),A=S(o.placement),E=U(o.placement),T=!E,C=V(A),O="x"===C?"y":"x",x=o.modifiersData.popperOffsets,k=o.rects.reference,L=o.rects.popper,I="function"==typeof y?y(Object.assign({},o.rects,{placement:o.placement})):y,N="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),P=o.modifiersData.offset?o.modifiersData.offset[o.placement]:null,j={x:0,y:0};if(x){if(h){var F,H="y"===C?t:n,W="y"===C?e:i,B="y"===C?"height":"width",z=x[C],R=z+w[H],Q=z-w[W],X=b?-L[B]/2:0,Y=E===r?k[B]:L[B],G=E===r?-L[B]:-k[B],J=o.elements.arrow,Z=b&&J?M(J):{width:0,height:0},tt=o.modifiersData["arrow#persistent"]?o.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},et=tt[H],it=tt[W],nt=K(0,k[B],Z[B]),st=T?k[B]/2-X-nt-et-N.mainAxis:Y-nt-et-N.mainAxis,ot=T?-k[B]/2+X+nt+it+N.mainAxis:G+nt+it+N.mainAxis,rt=o.elements.arrow&&q(o.elements.arrow),at=rt?"y"===C?rt.clientTop||0:rt.clientLeft||0:0,lt=null!=(F=null==P?void 0:P[C])?F:0,ct=z+ot-lt,ht=K(b?D(R,z+st-lt-at):R,z,b?$(Q,ct):Q);x[C]=ht,j[C]=ht-z}if(u){var dt,ut="x"===C?t:n,ft="x"===C?e:i,pt=x[O],gt="y"===O?"height":"width",_t=pt+w[ut],bt=pt-w[ft],vt=-1!==[t,n].indexOf(A),yt=null!=(dt=null==P?void 0:P[O])?dt:0,wt=vt?_t:pt-k[gt]-L[gt]-yt+N.altAxis,At=vt?pt+k[gt]+L[gt]-yt-N.altAxis:bt,Et=b&&vt?(Ct=K(wt,pt,Tt=At))>Tt?Tt:Ct:K(b?wt:_t,pt,b?At:bt);x[O]=Et,j[O]=Et-pt}var Tt,Ct;o.modifiersData[l]=j}},requiresIfExists:["offset"]};function Et(t,e,i){void 0===i&&(i=!1);var n,s,o=x(e),r=x(e)&&function(t){var e=t.getBoundingClientRect(),i=I(e.width)/t.offsetWidth||1,n=I(e.height)/t.offsetHeight||1;return 1!==i||1!==n}(e),a=B(e),l=j(t,r,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(o||!o&&!i)&&(("body"!==T(e)||lt(a))&&(c=(n=e)!==C(n)&&x(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:rt(n)),x(e)?((h=j(e,!0)).x+=e.clientLeft,h.y+=e.clientTop):a&&(h.x=at(a))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function Tt(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}}),n.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){i.has(t.name)||s(t)}),n}var Ct={placement:"bottom",modifiers:[],strategy:"absolute"};function Ot(){for(var t=arguments.length,e=new Array(t),i=0;iSt.has(t)&&St.get(t).get(e)||null,remove(t,e){if(!St.has(t))return;const i=St.get(t);i.delete(e),0===i.size&&St.delete(t)}},Dt="transitionend",It=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(t,e)=>`#${CSS.escape(e)}`)),t),Nt=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),Pt=t=>{t.dispatchEvent(new Event(Dt))},jt=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),Mt=t=>jt(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(It(t)):null,Ft=t=>{if(!jt(t)||0===t.getClientRects().length)return!1;const e="visible"===getComputedStyle(t).getPropertyValue("visibility"),i=t.closest("details:not([open])");if(!i)return e;if(i!==t){const e=t.closest("summary");if(e&&e.parentNode!==i)return!1;if(null===e)return!1}return e},Ht=t=>!t||t.nodeType!==Node.ELEMENT_NODE||(!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled"))),Wt=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?Wt(t.parentNode):null},Bt=()=>{},zt=t=>{t.offsetHeight},Rt=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,qt=[],Vt=()=>"rtl"===document.documentElement.dir,Kt=t=>{var e;e=()=>{const e=Rt();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(qt.length||document.addEventListener("DOMContentLoaded",()=>{for(const t of qt)t()}),qt.push(e)):e()},Qt=(t,e=[],i=t)=>"function"==typeof t?t.call(...e):i,Xt=(t,e,i=!0)=>{if(!i)return void Qt(t);const n=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let s=!1;const o=({target:i})=>{i===e&&(s=!0,e.removeEventListener(Dt,o),Qt(t))};e.addEventListener(Dt,o),setTimeout(()=>{s||Pt(e)},n)},Yt=(t,e,i,n)=>{const s=t.length;let o=t.indexOf(e);return-1===o?!i&&n?t[s-1]:t[0]:(o+=i?1:-1,n&&(o=(o+s)%s),t[Math.max(0,Math.min(o,s-1))])},Ut=/[^.]*(?=\..*)\.|.*/,Gt=/\..*/,Jt=/::\d+$/,Zt={}; /*! * Bootstrap v5.3.8 (https://getbootstrap.com/) * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) - */let ne=1;const se={mouseenter:"mouseover",mouseleave:"mouseout"},oe=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function re(t,e){return e&&`${e}::${ne++}`||t.uidEvent||ne++}function ae(t){const e=re(t);return t.uidEvent=e,ie[e]=ie[e]||{},ie[e]}function le(t,e,i=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===i)}function ce(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=fe(t);return oe.has(o)||(o=t),[n,s,o]}function he(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=ce(e,i,n);if(e in se){r=(t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)})(r)}const l=ae(t),c=l[a]||(l[a]={}),h=le(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=re(r,e.replace(Zt,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return me(s,{delegateTarget:r}),n.oneOff&&pe.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return me(n,{delegateTarget:t}),i.oneOff&&pe.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function de(t,e,i,n,s){const o=le(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function ue(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&de(t,e,i,r.callable,r.delegationSelector)}function fe(t){return t=t.replace(te,""),se[t]||t}const pe={on(t,e,i,n){he(t,e,i,n,!1)},one(t,e,i,n){he(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=ce(e,i,n),a=r!==e,l=ae(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))ue(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(ee,"");a&&!e.includes(s)||de(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;de(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=Kt();let s=null,o=!0,r=!0,a=!1;e!==fe(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=me(new Event(e,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function me(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function ge(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function _e(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const be={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${_e(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${_e(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=ge(t.dataset[n])}return e},getDataAttribute:(t,e)=>ge(t.getAttribute(`data-bs-${_e(e)}`))};class ve{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=Ht(e)?be.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...Ht(e)?be.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[i,n]of Object.entries(e)){const e=t[i],s=Ht(e)?"element":jt(e);if(!new RegExp(n).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${n}".`)}}}class ye extends ve{constructor(t,e){super(),(t=Wt(t))&&(this._element=t,this._config=this._getConfig(e),Nt.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Nt.remove(this._element,this.constructor.DATA_KEY),pe.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){Gt(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return Nt.get(Wt(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const we=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e?e.split(",").map(t=>Mt(t)).join(","):null},Ae={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter(t=>t.matches(e)),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(t=>!zt(t)&&Bt(t))},getSelectorFromElement(t){const e=we(t);return e&&Ae.findOne(e)?e:null},getElementFromSelector(t){const e=we(t);return e?Ae.findOne(e):null},getMultipleElementsFromSelector(t){const e=we(t);return e?Ae.find(e):[]}},Ee=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;pe.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),zt(this))return;const s=Ae.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()})},Te=".bs.alert",Ce=`close${Te}`,Oe=`closed${Te}`;class xe extends ye{static get NAME(){return"alert"}close(){if(pe.trigger(this._element,Ce).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),pe.trigger(this._element,Oe),this.dispose()}static jQueryInterface(t){return this.each(function(){const e=xe.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}Ee(xe,"close"),Yt(xe);const ke='[data-bs-toggle="button"]';class Le extends ye{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each(function(){const e=Le.getOrCreateInstance(this);"toggle"===t&&e[t]()})}}pe.on(document,"click.bs.button.data-api",ke,t=>{t.preventDefault();const e=t.target.closest(ke);Le.getOrCreateInstance(e).toggle()}),Yt(Le);const Se=".bs.swipe",$e=`touchstart${Se}`,De=`touchmove${Se}`,Ie=`touchend${Se}`,Ne=`pointerdown${Se}`,Pe=`pointerup${Se}`,Me={endCallback:null,leftCallback:null,rightCallback:null},je={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Fe extends ve{constructor(t,e){super(),this._element=t,t&&Fe.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Me}static get DefaultType(){return je}static get NAME(){return"swipe"}dispose(){pe.off(this._element,Se)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),Ut(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&Ut(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(pe.on(this._element,Ne,t=>this._start(t)),pe.on(this._element,Pe,t=>this._end(t)),this._element.classList.add("pointer-event")):(pe.on(this._element,$e,t=>this._start(t)),pe.on(this._element,De,t=>this._move(t)),pe.on(this._element,Ie,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const He=".bs.carousel",We=".data-api",Be="ArrowLeft",ze="ArrowRight",Re="next",qe="prev",Ve="left",Ke="right",Qe=`slide${He}`,Xe=`slid${He}`,Ye=`keydown${He}`,Ue=`mouseenter${He}`,Ge=`mouseleave${He}`,Je=`dragstart${He}`,Ze=`load${He}${We}`,ti=`click${He}${We}`,ei="carousel",ii="active",ni=".active",si=".carousel-item",oi=ni+si,ri={[Be]:Ke,[ze]:Ve},ai={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},li={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class ci extends ye{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=Ae.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===ei&&this.cycle()}static get Default(){return ai}static get DefaultType(){return li}static get NAME(){return"carousel"}next(){this._slide(Re)}nextWhenVisible(){!document.hidden&&Bt(this._element)&&this.next()}prev(){this._slide(qe)}pause(){this._isSliding&&Ft(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?pe.one(this._element,Xe,()=>this.cycle()):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void pe.one(this._element,Xe,()=>this.to(t));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?Re:qe;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&pe.on(this._element,Ye,t=>this._keydown(t)),"hover"===this._config.pause&&(pe.on(this._element,Ue,()=>this.pause()),pe.on(this._element,Ge,()=>this._maybeEnableCycle())),this._config.touch&&Fe.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of Ae.find(".carousel-item img",this._element))pe.on(t,Je,t=>t.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(Ve)),rightCallback:()=>this._slide(this._directionToOrder(Ke)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new Fe(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=ri[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=Ae.findOne(ni,this._indicatorsElement);e.classList.remove(ii),e.removeAttribute("aria-current");const i=Ae.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(ii),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===Re,s=e||Jt(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>pe.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(Qe).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),Vt(s),i.classList.add(l),s.classList.add(l);this._queueCallback(()=>{s.classList.remove(l,c),s.classList.add(ii),i.classList.remove(ii,c,l),this._isSliding=!1,r(Xe)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return Ae.findOne(oi,this._element)}_getItems(){return Ae.find(si,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return Xt()?t===Ve?qe:Re:t===Ve?Re:qe}_orderToDirection(t){return Xt()?t===qe?Ve:Ke:t===qe?Ke:Ve}static jQueryInterface(t){return this.each(function(){const e=ci.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)})}}pe.on(document,ti,"[data-bs-slide], [data-bs-slide-to]",function(t){const e=Ae.getElementFromSelector(this);if(!e||!e.classList.contains(ei))return;t.preventDefault();const i=ci.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===be.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),pe.on(window,Ze,()=>{const t=Ae.find('[data-bs-ride="carousel"]');for(const e of t)ci.getOrCreateInstance(e)}),Yt(ci);const hi=".bs.collapse",di=`show${hi}`,ui=`shown${hi}`,fi=`hide${hi}`,pi=`hidden${hi}`,mi=`click${hi}.data-api`,gi="show",_i="collapse",bi="collapsing",vi=`:scope .${_i} .${_i}`,yi='[data-bs-toggle="collapse"]',wi={parent:null,toggle:!0},Ai={parent:"(null|element)",toggle:"boolean"};class Ei extends ye{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=Ae.find(yi);for(const t of i){const e=Ae.getSelectorFromElement(t),i=Ae.find(e).filter(t=>t===this._element);null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return wi}static get DefaultType(){return Ai}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(t=>t!==this._element).map(t=>Ei.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning)return;if(pe.trigger(this._element,di).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(_i),this._element.classList.add(bi),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(bi),this._element.classList.add(_i,gi),this._element.style[e]="",pe.trigger(this._element,ui)},this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(pe.trigger(this._element,fi).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,Vt(this._element),this._element.classList.add(bi),this._element.classList.remove(_i,gi);for(const t of this._triggerArray){const e=Ae.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(bi),this._element.classList.add(_i),pe.trigger(this._element,pi)},this._element,!0)}_isShown(t=this._element){return t.classList.contains(gi)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=Wt(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(yi);for(const e of t){const t=Ae.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=Ae.find(vi,this._config.parent);return Ae.find(t,this._config.parent).filter(t=>!e.includes(t))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each(function(){const i=Ei.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}})}}pe.on(document,mi,yi,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of Ae.getMultipleElementsFromSelector(this))Ei.getOrCreateInstance(t,{toggle:!1}).toggle()}),Yt(Ei);const Ti="dropdown",Ci=".bs.dropdown",Oi=".data-api",xi="ArrowUp",ki="ArrowDown",Li=`hide${Ci}`,Si=`hidden${Ci}`,$i=`show${Ci}`,Di=`shown${Ci}`,Ii=`click${Ci}${Oi}`,Ni=`keydown${Ci}${Oi}`,Pi=`keyup${Ci}${Oi}`,Mi="show",ji='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Fi=`${ji}.${Mi}`,Hi=".dropdown-menu",Wi=Xt()?"top-end":"top-start",Bi=Xt()?"top-start":"top-end",zi=Xt()?"bottom-end":"bottom-start",Ri=Xt()?"bottom-start":"bottom-end",qi=Xt()?"left-start":"right-start",Vi=Xt()?"right-start":"left-start",Ki={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Qi={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Xi extends ye{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=Ae.next(this._element,Hi)[0]||Ae.prev(this._element,Hi)[0]||Ae.findOne(Hi,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Ki}static get DefaultType(){return Qi}static get NAME(){return Ti}toggle(){return this._isShown()?this.hide():this.show()}show(){if(zt(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!pe.trigger(this._element,$i,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))pe.on(t,"mouseover",qt);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Mi),this._element.classList.add(Mi),pe.trigger(this._element,Di,t)}}hide(){if(zt(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!pe.trigger(this._element,Li,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))pe.off(t,"mouseover",qt);this._popper&&this._popper.destroy(),this._menu.classList.remove(Mi),this._element.classList.remove(Mi),this._element.setAttribute("aria-expanded","false"),be.removeDataAttribute(this._menu,"popper"),pe.trigger(this._element,Si,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!Ht(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Ti.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===Dt)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let t=this._element;"parent"===this._config.reference?t=this._parent:Ht(this._config.reference)?t=Wt(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=$t(t,this._menu,e)}_isShown(){return this._menu.classList.contains(Mi)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return qi;if(t.classList.contains("dropstart"))return Vi;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?Bi:Wi:e?Ri:zi}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(be.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...Ut(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const i=Ae.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(t=>Bt(t));i.length&&Jt(i,e,t===ki,!i.includes(e)).focus()}static jQueryInterface(t){return this.each(function(){const e=Xi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=Ae.find(Fi);for(const i of e){const e=Xi.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[xi,ki].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(ji)?this:Ae.prev(this,ji)[0]||Ae.next(this,ji)[0]||Ae.findOne(ji,t.delegateTarget.parentNode),o=Xi.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}pe.on(document,Ni,ji,Xi.dataApiKeydownHandler),pe.on(document,Ni,Hi,Xi.dataApiKeydownHandler),pe.on(document,Ii,Xi.clearMenus),pe.on(document,Pi,Xi.clearMenus),pe.on(document,Ii,ji,function(t){t.preventDefault(),Xi.getOrCreateInstance(this).toggle()}),Yt(Xi);const Yi="backdrop",Ui="show",Gi=`mousedown.bs.${Yi}`,Ji={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Zi={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class tn extends ve{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Ji}static get DefaultType(){return Zi}static get NAME(){return Yi}show(t){if(!this._config.isVisible)return void Ut(t);this._append();const e=this._getElement();this._config.isAnimated&&Vt(e),e.classList.add(Ui),this._emulateAnimation(()=>{Ut(t)})}hide(t){this._config.isVisible?(this._getElement().classList.remove(Ui),this._emulateAnimation(()=>{this.dispose(),Ut(t)})):Ut(t)}dispose(){this._isAppended&&(pe.off(this._element,Gi),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=Wt(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),pe.on(t,Gi,()=>{Ut(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){Gt(t,this._getElement(),this._config.isAnimated)}}const en=".bs.focustrap",nn=`focusin${en}`,sn=`keydown.tab${en}`,on="backward",rn={autofocus:!0,trapElement:null},an={autofocus:"boolean",trapElement:"element"};class ln extends ve{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return rn}static get DefaultType(){return an}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),pe.off(document,en),pe.on(document,nn,t=>this._handleFocusin(t)),pe.on(document,sn,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,pe.off(document,en))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=Ae.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===on?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?on:"forward")}}const cn=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",hn=".sticky-top",dn="padding-right",un="margin-right";class fn{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,dn,e=>e+t),this._setElementAttributes(cn,dn,e=>e+t),this._setElementAttributes(hn,un,e=>e-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,dn),this._resetElementAttributes(cn,dn),this._resetElementAttributes(hn,un)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)})}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&be.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,t=>{const i=be.getDataAttribute(t,e);null!==i?(be.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)})}_applyManipulationCallback(t,e){if(Ht(t))e(t);else for(const i of Ae.find(t,this._element))e(i)}}const pn=".bs.modal",mn=`hide${pn}`,gn=`hidePrevented${pn}`,_n=`hidden${pn}`,bn=`show${pn}`,vn=`shown${pn}`,yn=`resize${pn}`,wn=`click.dismiss${pn}`,An=`mousedown.dismiss${pn}`,En=`keydown.dismiss${pn}`,Tn=`click${pn}.data-api`,Cn="modal-open",On="show",xn="modal-static",kn={backdrop:!0,focus:!0,keyboard:!0},Ln={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Sn extends ye{constructor(t,e){super(t,e),this._dialog=Ae.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new fn,this._addEventListeners()}static get Default(){return kn}static get DefaultType(){return Ln}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown||this._isTransitioning)return;pe.trigger(this._element,bn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Cn),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){if(!this._isShown||this._isTransitioning)return;pe.trigger(this._element,mn).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(On),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){pe.off(window,pn),pe.off(this._dialog,pn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new tn({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ln({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=Ae.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),Vt(this._element),this._element.classList.add(On);this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,pe.trigger(this._element,vn,{relatedTarget:t})},this._dialog,this._isAnimated())}_addEventListeners(){pe.on(this._element,En,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),pe.on(window,yn,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),pe.on(this._element,An,t=>{pe.one(this._element,wn,e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Cn),this._resetAdjustments(),this._scrollBar.reset(),pe.trigger(this._element,_n)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(pe.trigger(this._element,gn).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(xn)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(xn),this._queueCallback(()=>{this._element.classList.remove(xn),this._queueCallback(()=>{this._element.style.overflowY=e},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=Xt()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=Xt()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each(function(){const i=Sn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}})}}pe.on(document,Tn,'[data-bs-toggle="modal"]',function(t){const e=Ae.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),pe.one(e,bn,t=>{t.defaultPrevented||pe.one(e,_n,()=>{Bt(this)&&this.focus()})});const i=Ae.findOne(".modal.show");i&&Sn.getInstance(i).hide();Sn.getOrCreateInstance(e).toggle(this)}),Ee(Sn),Yt(Sn);const $n=".bs.offcanvas",Dn=".data-api",In=`load${$n}${Dn}`,Nn="show",Pn="showing",Mn="hiding",jn=".offcanvas.show",Fn=`show${$n}`,Hn=`shown${$n}`,Wn=`hide${$n}`,Bn=`hidePrevented${$n}`,zn=`hidden${$n}`,Rn=`resize${$n}`,qn=`click${$n}${Dn}`,Vn=`keydown.dismiss${$n}`,Kn={backdrop:!0,keyboard:!0,scroll:!1},Qn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Xn extends ye{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Kn}static get DefaultType(){return Qn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown)return;if(pe.trigger(this._element,Fn,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new fn).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Pn);this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Nn),this._element.classList.remove(Pn),pe.trigger(this._element,Hn,{relatedTarget:t})},this._element,!0)}hide(){if(!this._isShown)return;if(pe.trigger(this._element,Wn).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Mn),this._backdrop.hide();this._queueCallback(()=>{this._element.classList.remove(Nn,Mn),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new fn).reset(),pe.trigger(this._element,zn)},this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new tn({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():pe.trigger(this._element,Bn)}:null})}_initializeFocusTrap(){return new ln({trapElement:this._element})}_addEventListeners(){pe.on(this._element,Vn,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():pe.trigger(this._element,Bn))})}static jQueryInterface(t){return this.each(function(){const e=Xn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}pe.on(document,qn,'[data-bs-toggle="offcanvas"]',function(t){const e=Ae.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),zt(this))return;pe.one(e,zn,()=>{Bt(this)&&this.focus()});const i=Ae.findOne(jn);i&&i!==e&&Xn.getInstance(i).hide();Xn.getOrCreateInstance(e).toggle(this)}),pe.on(window,In,()=>{for(const t of Ae.find(jn))Xn.getOrCreateInstance(t).show()}),pe.on(window,Rn,()=>{for(const t of Ae.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Xn.getOrCreateInstance(t).hide()}),Ee(Xn),Yt(Xn);const Yn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Un=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Gn=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Jn=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Un.has(i)||Boolean(Gn.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(i))};const Zn={allowList:Yn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},ts={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},es={entry:"(string|element|function|null)",selector:"(string|element)"};class is extends ve{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Zn}static get DefaultType(){return ts}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},es)}_setContent(t,e,i){const n=Ae.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?Ht(e)?this._putElementInTemplate(Wt(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Jn(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return Ut(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const ns=new Set(["sanitize","allowList","sanitizeFn"]),ss="fade",os="show",rs=".tooltip-inner",as=".modal",ls="hide.bs.modal",cs="hover",hs="focus",ds="click",us={AUTO:"auto",TOP:"top",RIGHT:Xt()?"left":"right",BOTTOM:"bottom",LEFT:Xt()?"right":"left"},fs={allowList:Yn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},ps={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class ms extends ye{constructor(t,e){if(void 0===Dt)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return fs}static get DefaultType(){return ps}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),pe.off(this._element.closest(as),ls,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=pe.trigger(this._element,this.constructor.eventName("show")),e=(Rt(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),pe.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(os),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))pe.on(t,"mouseover",qt);this._queueCallback(()=>{pe.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(pe.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(os),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))pe.off(t,"mouseover",qt);this._activeTrigger[ds]=!1,this._activeTrigger[hs]=!1,this._activeTrigger[cs]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),pe.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(ss,os),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(ss),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new is({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[rs]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(ss)}_isShown(){return this.tip&&this.tip.classList.contains(os)}_createPopper(t){const e=Ut(this._config.placement,[this,t,this._element]),i=us[e.toUpperCase()];return $t(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return Ut(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...Ut(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)pe.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[ds]=!(e._isShown()&&e._activeTrigger[ds]),e.toggle()});else if("manual"!==e){const t=e===cs?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===cs?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");pe.on(this._element,t,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?hs:cs]=!0,e._enter()}),pe.on(this._element,i,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?hs:cs]=e._element.contains(t.relatedTarget),e._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},pe.on(this._element.closest(as),ls,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=be.getDataAttributes(this._element);for(const t of Object.keys(e))ns.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:Wt(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const e=ms.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}Yt(ms);const gs=".popover-header",_s=".popover-body",bs={...ms.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},vs={...ms.DefaultType,content:"(null|string|element|function)"};class ys extends ms{static get Default(){return bs}static get DefaultType(){return vs}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[gs]:this._getTitle(),[_s]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){const e=ys.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}Yt(ys);const ws=".bs.scrollspy",As=`activate${ws}`,Es=`click${ws}`,Ts=`load${ws}.data-api`,Cs="active",Os="[href]",xs=".nav-link",ks=`${xs}, .nav-item > ${xs}, .list-group-item`,Ls={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ss={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class $s extends ye{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Ls}static get DefaultType(){return Ss}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=Wt(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map(t=>Number.parseFloat(t))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(pe.off(this._config.target,Es),pe.on(this._config.target,Es,Os,t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=Ae.find(Os,this._config.target);for(const e of t){if(!e.hash||zt(e))continue;const t=Ae.findOne(decodeURI(e.hash),this._element);Bt(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(Cs),this._activateParents(t),pe.trigger(this._element,As,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))Ae.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(Cs);else for(const e of Ae.parents(t,".nav, .list-group"))for(const t of Ae.prev(e,ks))t.classList.add(Cs)}_clearActiveClass(t){t.classList.remove(Cs);const e=Ae.find(`${Os}.${Cs}`,t);for(const t of e)t.classList.remove(Cs)}static jQueryInterface(t){return this.each(function(){const e=$s.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}pe.on(window,Ts,()=>{for(const t of Ae.find('[data-bs-spy="scroll"]'))$s.getOrCreateInstance(t)}),Yt($s);const Ds=".bs.tab",Is=`hide${Ds}`,Ns=`hidden${Ds}`,Ps=`show${Ds}`,Ms=`shown${Ds}`,js=`click${Ds}`,Fs=`keydown${Ds}`,Hs=`load${Ds}`,Ws="ArrowLeft",Bs="ArrowRight",zs="ArrowUp",Rs="ArrowDown",qs="Home",Vs="End",Ks="active",Qs="fade",Xs="show",Ys=".dropdown-toggle",Us=`:not(${Ys})`,Gs='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Js=`${`.nav-link${Us}, .list-group-item${Us}, [role="tab"]${Us}`}, ${Gs}`,Zs=`.${Ks}[data-bs-toggle="tab"], .${Ks}[data-bs-toggle="pill"], .${Ks}[data-bs-toggle="list"]`;class to extends ye{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),pe.on(this._element,Fs,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?pe.trigger(e,Is,{relatedTarget:t}):null;pe.trigger(t,Ps,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){if(!t)return;t.classList.add(Ks),this._activate(Ae.getElementFromSelector(t));this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),pe.trigger(t,Ms,{relatedTarget:e})):t.classList.add(Xs)},t,t.classList.contains(Qs))}_deactivate(t,e){if(!t)return;t.classList.remove(Ks),t.blur(),this._deactivate(Ae.getElementFromSelector(t));this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),pe.trigger(t,Ns,{relatedTarget:e})):t.classList.remove(Xs)},t,t.classList.contains(Qs))}_keydown(t){if(![Ws,Bs,zs,Rs,qs,Vs].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter(t=>!zt(t));let i;if([qs,Vs].includes(t.key))i=e[t.key===qs?0:e.length-1];else{const n=[Bs,Rs].includes(t.key);i=Jt(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),to.getOrCreateInstance(i).show())}_getChildren(){return Ae.find(Js,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=Ae.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=Ae.findOne(t,i);s&&s.classList.toggle(n,e)};n(Ys,Ks),n(".dropdown-menu",Xs),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(Ks)}_getInnerElement(t){return t.matches(Js)?t:Ae.findOne(Js,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each(function(){const e=to.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}pe.on(document,js,Gs,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),zt(this)||to.getOrCreateInstance(this).show()}),pe.on(window,Hs,()=>{for(const t of Ae.find(Zs))to.getOrCreateInstance(t)}),Yt(to);const eo=".bs.toast",io=`mouseover${eo}`,no=`mouseout${eo}`,so=`focusin${eo}`,oo=`focusout${eo}`,ro=`hide${eo}`,ao=`hidden${eo}`,lo=`show${eo}`,co=`shown${eo}`,ho="hide",uo="show",fo="showing",po={animation:"boolean",autohide:"boolean",delay:"number"},mo={animation:!0,autohide:!0,delay:5e3};class go extends ye{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return mo}static get DefaultType(){return po}static get NAME(){return"toast"}show(){if(pe.trigger(this._element,lo).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(ho),Vt(this._element),this._element.classList.add(uo,fo),this._queueCallback(()=>{this._element.classList.remove(fo),pe.trigger(this._element,co),this._maybeScheduleHide()},this._element,this._config.animation)}hide(){if(!this.isShown())return;if(pe.trigger(this._element,ro).defaultPrevented)return;this._element.classList.add(fo),this._queueCallback(()=>{this._element.classList.add(ho),this._element.classList.remove(fo,uo),pe.trigger(this._element,ao)},this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(uo),super.dispose()}isShown(){return this._element.classList.contains(uo)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){pe.on(this._element,io,t=>this._onInteraction(t,!0)),pe.on(this._element,no,t=>this._onInteraction(t,!1)),pe.on(this._element,so,t=>this._onInteraction(t,!0)),pe.on(this._element,oo,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){const e=go.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}})}}Ee(go),Yt(go);const _o=Object.freeze(Object.defineProperty({__proto__:null,Alert:xe,Button:Le,Carousel:ci,Collapse:Ei,Dropdown:Xi,Modal:Sn,Offcanvas:Xn,Popover:ys,ScrollSpy:$s,Tab:to,Toast:go,Tooltip:ms},Symbol.toStringTag,{value:"Module"})),bo={Hash:e,LocalStorage:t},vo={..._o,bindDarkMode:(t,e)=>{if("undefined"==typeof document)return;const n=document.documentElement,s=t=>{const e=t?"dark":"light";n.setAttribute("data-bs-theme",e),n.setAttribute("$data-bs-theme",e)};let o,r;if("string"==typeof t){const e=t.split(".");o=bo[e[0]],r=e[1]}else o=t,r=e;if(!o||!r)return console.warn("Bootstrap.bindDarkMode: Invalid state or key");o.__watch(r,t=>{s(t),i(n)}),s(o[r])},config:(t={})=>{if("undefined"==typeof document)return;const e=document.documentElement;if(t.primary){e.style.setProperty("--bs-primary",t.primary);const i=vo._hexToRgb(t.primary);i&&e.style.setProperty("--bs-primary-rgb",`${i.r}, ${i.g}, ${i.b}`)}t.success&&e.style.setProperty("--bs-success",t.success),t.danger&&e.style.setProperty("--bs-danger",t.danger)},_hexToRgb:t=>{const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}};export{vo as Bootstrap,vo as default}; + */let te=1;const ee={mouseenter:"mouseover",mouseleave:"mouseout"},ie=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function ne(t,e){return e&&`${e}::${te++}`||t.uidEvent||te++}function se(t){const e=ne(t);return t.uidEvent=e,Zt[e]=Zt[e]||{},Zt[e]}function oe(t,e,i=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===i)}function re(t,e,i){const n="string"==typeof e,s=n?i:e||i;let o=he(t);return ie.has(o)||(o=t),[n,s,o]}function ae(t,e,i,n,s){if("string"!=typeof e||!t)return;let[o,r,a]=re(e,i,n);if(e in ee){r=(t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)})(r)}const l=se(t),c=l[a]||(l[a]={}),h=oe(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=ne(r,e.replace(Ut,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return ue(s,{delegateTarget:r}),n.oneOff&&de.off(t,s.type,e,i),i.apply(r,[s])}}(t,i,r):function(t,e){return function i(n){return ue(n,{delegateTarget:t}),i.oneOff&&de.off(t,n.type,e),e.apply(t,[n])}}(t,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function le(t,e,i,n,s){const o=oe(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function ce(t,e,i,n){const s=e[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&le(t,e,i,r.callable,r.delegationSelector)}function he(t){return t=t.replace(Gt,""),ee[t]||t}const de={on(t,e,i,n){ae(t,e,i,n,!1)},one(t,e,i,n){ae(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=re(e,i,n),a=r!==e,l=se(t),c=l[r]||{},h=e.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))ce(t,l,i,e.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(Jt,"");a&&!e.includes(s)||le(t,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;le(t,l,r,o,s?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=Rt();let s=null,o=!0,r=!0,a=!1;e!==he(e)&&n&&(s=n.Event(e,i),n(t).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=ue(new Event(e,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&t.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function ue(t,e={}){for(const[i,n]of Object.entries(e))try{t[i]=n}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>n})}return t}function fe(t){if("true"===t)return!0;if("false"===t)return!1;if(t===Number(t).toString())return Number(t);if(""===t||"null"===t)return null;if("string"!=typeof t)return t;try{return JSON.parse(decodeURIComponent(t))}catch(e){return t}}function pe(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const me={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${pe(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${pe(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=fe(t.dataset[n])}return e},getDataAttribute:(t,e)=>fe(t.getAttribute(`data-bs-${pe(e)}`))};class ge{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(t){return t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t}_mergeConfigObj(t,e){const i=jt(e)?me.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...jt(e)?me.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[i,n]of Object.entries(e)){const e=t[i],s=jt(e)?"element":Nt(e);if(!new RegExp(n).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${n}".`)}}}class _e extends ge{constructor(t,e){super(),(t=Mt(t))&&(this._element=t,this._config=this._getConfig(e),$t.set(this._element,this.constructor.DATA_KEY,this))}dispose(){$t.remove(this._element,this.constructor.DATA_KEY),de.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){Xt(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return $t.get(Mt(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.3.8"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(t){return`${t}${this.EVENT_KEY}`}}const be=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e?e.split(",").map(t=>It(t)).join(","):null},ve={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter(t=>t.matches(e)),parents(t,e){const i=[];let n=t.parentNode.closest(e);for(;n;)i.push(n),n=n.parentNode.closest(e);return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,t).filter(t=>!Ht(t)&&Ft(t))},getSelectorFromElement(t){const e=be(t);return e&&ve.findOne(e)?e:null},getElementFromSelector(t){const e=be(t);return e?ve.findOne(e):null},getMultipleElementsFromSelector(t){const e=be(t);return e?ve.find(e):[]}},ye=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,n=t.NAME;de.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),Ht(this))return;const s=ve.getElementFromSelector(this)||this.closest(`.${n}`);t.getOrCreateInstance(s)[e]()})},we=".bs.alert",Ae=`close${we}`,Ee=`closed${we}`;class Te extends _e{static get NAME(){return"alert"}close(){if(de.trigger(this._element,Ae).defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),de.trigger(this._element,Ee),this.dispose()}static jQueryInterface(t){return this.each(function(){const e=Te.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}ye(Te,"close"),Kt(Te);const Ce='[data-bs-toggle="button"]';class Oe extends _e{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each(function(){const e=Oe.getOrCreateInstance(this);"toggle"===t&&e[t]()})}}de.on(document,"click.bs.button.data-api",Ce,t=>{t.preventDefault();const e=t.target.closest(Ce);Oe.getOrCreateInstance(e).toggle()}),Kt(Oe);const xe=".bs.swipe",ke=`touchstart${xe}`,Le=`touchmove${xe}`,Se=`touchend${xe}`,$e=`pointerdown${xe}`,De=`pointerup${xe}`,Ie={endCallback:null,leftCallback:null,rightCallback:null},Ne={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Pe extends ge{constructor(t,e){super(),this._element=t,t&&Pe.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Ie}static get DefaultType(){return Ne}static get NAME(){return"swipe"}dispose(){de.off(this._element,xe)}_start(t){this._supportPointerEvents?this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX):this._deltaX=t.touches[0].clientX}_end(t){this._eventIsPointerPenTouch(t)&&(this._deltaX=t.clientX-this._deltaX),this._handleSwipe(),Qt(this._config.endCallback)}_move(t){this._deltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this._deltaX}_handleSwipe(){const t=Math.abs(this._deltaX);if(t<=40)return;const e=t/this._deltaX;this._deltaX=0,e&&Qt(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(de.on(this._element,$e,t=>this._start(t)),de.on(this._element,De,t=>this._end(t)),this._element.classList.add("pointer-event")):(de.on(this._element,ke,t=>this._start(t)),de.on(this._element,Le,t=>this._move(t)),de.on(this._element,Se,t=>this._end(t)))}_eventIsPointerPenTouch(t){return this._supportPointerEvents&&("pen"===t.pointerType||"touch"===t.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const je=".bs.carousel",Me=".data-api",Fe="ArrowLeft",He="ArrowRight",We="next",Be="prev",ze="left",Re="right",qe=`slide${je}`,Ve=`slid${je}`,Ke=`keydown${je}`,Qe=`mouseenter${je}`,Xe=`mouseleave${je}`,Ye=`dragstart${je}`,Ue=`load${je}${Me}`,Ge=`click${je}${Me}`,Je="carousel",Ze="active",ti=".active",ei=".carousel-item",ii=ti+ei,ni={[Fe]:Re,[He]:ze},si={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},oi={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class ri extends _e{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=ve.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===Je&&this.cycle()}static get Default(){return si}static get DefaultType(){return oi}static get NAME(){return"carousel"}next(){this._slide(We)}nextWhenVisible(){!document.hidden&&Ft(this._element)&&this.next()}prev(){this._slide(Be)}pause(){this._isSliding&&Pt(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?de.one(this._element,Ve,()=>this.cycle()):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void de.one(this._element,Ve,()=>this.to(t));const i=this._getItemIndex(this._getActive());if(i===t)return;const n=t>i?We:Be;this._slide(n,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&de.on(this._element,Ke,t=>this._keydown(t)),"hover"===this._config.pause&&(de.on(this._element,Qe,()=>this.pause()),de.on(this._element,Xe,()=>this._maybeEnableCycle())),this._config.touch&&Pe.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of ve.find(".carousel-item img",this._element))de.on(t,Ye,t=>t.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(ze)),rightCallback:()=>this._slide(this._directionToOrder(Re)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new Pe(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=ni[t.key];e&&(t.preventDefault(),this._slide(this._directionToOrder(e)))}_getItemIndex(t){return this._getItems().indexOf(t)}_setActiveIndicatorElement(t){if(!this._indicatorsElement)return;const e=ve.findOne(ti,this._indicatorsElement);e.classList.remove(Ze),e.removeAttribute("aria-current");const i=ve.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(Ze),i.setAttribute("aria-current","true"))}_updateInterval(){const t=this._activeElement||this._getActive();if(!t)return;const e=Number.parseInt(t.getAttribute("data-bs-interval"),10);this._config.interval=e||this._config.defaultInterval}_slide(t,e=null){if(this._isSliding)return;const i=this._getActive(),n=t===We,s=e||Yt(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=e=>de.trigger(this._element,e,{relatedTarget:s,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(qe).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),zt(s),i.classList.add(l),s.classList.add(l);this._queueCallback(()=>{s.classList.remove(l,c),s.classList.add(Ze),i.classList.remove(Ze,c,l),this._isSliding=!1,r(Ve)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return ve.findOne(ii,this._element)}_getItems(){return ve.find(ei,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return Vt()?t===ze?Be:We:t===ze?We:Be}_orderToDirection(t){return Vt()?t===Be?ze:Re:t===Be?Re:ze}static jQueryInterface(t){return this.each(function(){const e=ri.getOrCreateInstance(this,t);if("number"!=typeof t){if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}}else e.to(t)})}}de.on(document,Ge,"[data-bs-slide], [data-bs-slide-to]",function(t){const e=ve.getElementFromSelector(this);if(!e||!e.classList.contains(Je))return;t.preventDefault();const i=ri.getOrCreateInstance(e),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===me.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),de.on(window,Ue,()=>{const t=ve.find('[data-bs-ride="carousel"]');for(const e of t)ri.getOrCreateInstance(e)}),Kt(ri);const ai=".bs.collapse",li=`show${ai}`,ci=`shown${ai}`,hi=`hide${ai}`,di=`hidden${ai}`,ui=`click${ai}.data-api`,fi="show",pi="collapse",mi="collapsing",gi=`:scope .${pi} .${pi}`,_i='[data-bs-toggle="collapse"]',bi={parent:null,toggle:!0},vi={parent:"(null|element)",toggle:"boolean"};class yi extends _e{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=ve.find(_i);for(const t of i){const e=ve.getSelectorFromElement(t),i=ve.find(e).filter(t=>t===this._element);null!==e&&i.length&&this._triggerArray.push(t)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return bi}static get DefaultType(){return vi}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(t=>t!==this._element).map(t=>yi.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning)return;if(de.trigger(this._element,li).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(pi),this._element.classList.add(mi),this._element.style[e]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${e[0].toUpperCase()+e.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(mi),this._element.classList.add(pi,fi),this._element.style[e]="",de.trigger(this._element,ci)},this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(de.trigger(this._element,hi).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,zt(this._element),this._element.classList.add(mi),this._element.classList.remove(pi,fi);for(const t of this._triggerArray){const e=ve.getElementFromSelector(t);e&&!this._isShown(e)&&this._addAriaAndCollapsedClass([t],!1)}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove(mi),this._element.classList.add(pi),de.trigger(this._element,di)},this._element,!0)}_isShown(t=this._element){return t.classList.contains(fi)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=Mt(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(_i);for(const e of t){const t=ve.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=ve.find(gi,this._config.parent);return ve.find(t,this._config.parent).filter(t=>!e.includes(t))}_addAriaAndCollapsedClass(t,e){if(t.length)for(const i of t)i.classList.toggle("collapsed",!e),i.setAttribute("aria-expanded",e)}static jQueryInterface(t){const e={};return"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1),this.each(function(){const i=yi.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}})}}de.on(document,ui,_i,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of ve.getMultipleElementsFromSelector(this))yi.getOrCreateInstance(t,{toggle:!1}).toggle()}),Kt(yi);const wi="dropdown",Ai=".bs.dropdown",Ei=".data-api",Ti="ArrowUp",Ci="ArrowDown",Oi=`hide${Ai}`,xi=`hidden${Ai}`,ki=`show${Ai}`,Li=`shown${Ai}`,Si=`click${Ai}${Ei}`,$i=`keydown${Ai}${Ei}`,Di=`keyup${Ai}${Ei}`,Ii="show",Ni='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',Pi=`${Ni}.${Ii}`,ji=".dropdown-menu",Mi=Vt()?"top-end":"top-start",Fi=Vt()?"top-start":"top-end",Hi=Vt()?"bottom-end":"bottom-start",Wi=Vt()?"bottom-start":"bottom-end",Bi=Vt()?"left-start":"right-start",zi=Vt()?"right-start":"left-start",Ri={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},qi={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Vi extends _e{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=ve.next(this._element,ji)[0]||ve.prev(this._element,ji)[0]||ve.findOne(ji,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Ri}static get DefaultType(){return qi}static get NAME(){return wi}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Ht(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!de.trigger(this._element,ki,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))de.on(t,"mouseover",Bt);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Ii),this._element.classList.add(Ii),de.trigger(this._element,Li,t)}}hide(){if(Ht(this._element)||!this._isShown())return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){if(!de.trigger(this._element,Oi,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))de.off(t,"mouseover",Bt);this._popper&&this._popper.destroy(),this._menu.classList.remove(Ii),this._element.classList.remove(Ii),this._element.setAttribute("aria-expanded","false"),me.removeDataAttribute(this._menu,"popper"),de.trigger(this._element,xi,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!jt(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${wi.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===Lt)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)");let t=this._element;"parent"===this._config.reference?t=this._parent:jt(this._config.reference)?t=Mt(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=kt(t,this._menu,e)}_isShown(){return this._menu.classList.contains(Ii)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return Bi;if(t.classList.contains("dropstart"))return zi;if(t.classList.contains("dropup-center"))return"top";if(t.classList.contains("dropdown-center"))return"bottom";const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?Fi:Mi:e?Wi:Hi}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(me.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...Qt(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const i=ve.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(t=>Ft(t));i.length&&Yt(i,e,t===Ci,!i.includes(e)).focus()}static jQueryInterface(t){return this.each(function(){const e=Vi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=ve.find(Pi);for(const i of e){const e=Vi.getInstance(i);if(!e||!1===e._config.autoClose)continue;const n=t.composedPath(),s=n.includes(e._menu);if(n.includes(e._element)||"inside"===e._config.autoClose&&!s||"outside"===e._config.autoClose&&s)continue;if(e._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)))continue;const o={relatedTarget:e._element};"click"===t.type&&(o.clickEvent=t),e._completeHide(o)}}static dataApiKeydownHandler(t){const e=/input|textarea/i.test(t.target.tagName),i="Escape"===t.key,n=[Ti,Ci].includes(t.key);if(!n&&!i)return;if(e&&!i)return;t.preventDefault();const s=this.matches(Ni)?this:ve.prev(this,Ni)[0]||ve.next(this,Ni)[0]||ve.findOne(Ni,t.delegateTarget.parentNode),o=Vi.getOrCreateInstance(s);if(n)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),s.focus())}}de.on(document,$i,Ni,Vi.dataApiKeydownHandler),de.on(document,$i,ji,Vi.dataApiKeydownHandler),de.on(document,Si,Vi.clearMenus),de.on(document,Di,Vi.clearMenus),de.on(document,Si,Ni,function(t){t.preventDefault(),Vi.getOrCreateInstance(this).toggle()}),Kt(Vi);const Ki="backdrop",Qi="show",Xi=`mousedown.bs.${Ki}`,Yi={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Ui={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Gi extends ge{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return Yi}static get DefaultType(){return Ui}static get NAME(){return Ki}show(t){if(!this._config.isVisible)return void Qt(t);this._append();const e=this._getElement();this._config.isAnimated&&zt(e),e.classList.add(Qi),this._emulateAnimation(()=>{Qt(t)})}hide(t){this._config.isVisible?(this._getElement().classList.remove(Qi),this._emulateAnimation(()=>{this.dispose(),Qt(t)})):Qt(t)}dispose(){this._isAppended&&(de.off(this._element,Xi),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_configAfterMerge(t){return t.rootElement=Mt(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),de.on(t,Xi,()=>{Qt(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){Xt(t,this._getElement(),this._config.isAnimated)}}const Ji=".bs.focustrap",Zi=`focusin${Ji}`,tn=`keydown.tab${Ji}`,en="backward",nn={autofocus:!0,trapElement:null},sn={autofocus:"boolean",trapElement:"element"};class on extends ge{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return nn}static get DefaultType(){return sn}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),de.off(document,Ji),de.on(document,Zi,t=>this._handleFocusin(t)),de.on(document,tn,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,de.off(document,Ji))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=ve.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===en?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?en:"forward")}}const rn=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",an=".sticky-top",ln="padding-right",cn="margin-right";class hn{constructor(){this._element=document.body}getWidth(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const t=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,ln,e=>e+t),this._setElementAttributes(rn,ln,e=>e+t),this._setElementAttributes(an,cn,e=>e-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,ln),this._resetElementAttributes(rn,ln),this._resetElementAttributes(an,cn)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(s))}px`)})}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&me.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,t=>{const i=me.getDataAttribute(t,e);null!==i?(me.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)})}_applyManipulationCallback(t,e){if(jt(t))e(t);else for(const i of ve.find(t,this._element))e(i)}}const dn=".bs.modal",un=`hide${dn}`,fn=`hidePrevented${dn}`,pn=`hidden${dn}`,mn=`show${dn}`,gn=`shown${dn}`,_n=`resize${dn}`,bn=`click.dismiss${dn}`,vn=`mousedown.dismiss${dn}`,yn=`keydown.dismiss${dn}`,wn=`click${dn}.data-api`,An="modal-open",En="show",Tn="modal-static",Cn={backdrop:!0,focus:!0,keyboard:!0},On={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class xn extends _e{constructor(t,e){super(t,e),this._dialog=ve.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new hn,this._addEventListeners()}static get Default(){return Cn}static get DefaultType(){return On}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown||this._isTransitioning)return;de.trigger(this._element,mn,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(An),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){if(!this._isShown||this._isTransitioning)return;de.trigger(this._element,un).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(En),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){de.off(window,dn),de.off(this._dialog,dn),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Gi({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new on({trapElement:this._element})}_showElement(t){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const e=ve.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),zt(this._element),this._element.classList.add(En);this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,de.trigger(this._element,gn,{relatedTarget:t})},this._dialog,this._isAnimated())}_addEventListeners(){de.on(this._element,yn,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),de.on(window,_n,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),de.on(this._element,vn,t=>{de.one(this._element,bn,e=>{this._element===t.target&&this._element===e.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(An),this._resetAdjustments(),this._scrollBar.reset(),de.trigger(this._element,pn)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(de.trigger(this._element,fn).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(Tn)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Tn),this._queueCallback(()=>{this._element.classList.remove(Tn),this._queueCallback(()=>{this._element.style.overflowY=e},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;if(i&&!t){const t=Vt()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=Vt()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each(function(){const i=xn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}})}}de.on(document,wn,'[data-bs-toggle="modal"]',function(t){const e=ve.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),de.one(e,mn,t=>{t.defaultPrevented||de.one(e,pn,()=>{Ft(this)&&this.focus()})});const i=ve.findOne(".modal.show");i&&xn.getInstance(i).hide();xn.getOrCreateInstance(e).toggle(this)}),ye(xn),Kt(xn);const kn=".bs.offcanvas",Ln=".data-api",Sn=`load${kn}${Ln}`,$n="show",Dn="showing",In="hiding",Nn=".offcanvas.show",Pn=`show${kn}`,jn=`shown${kn}`,Mn=`hide${kn}`,Fn=`hidePrevented${kn}`,Hn=`hidden${kn}`,Wn=`resize${kn}`,Bn=`click${kn}${Ln}`,zn=`keydown.dismiss${kn}`,Rn={backdrop:!0,keyboard:!0,scroll:!1},qn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Vn extends _e{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Rn}static get DefaultType(){return qn}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){if(this._isShown)return;if(de.trigger(this._element,Pn,{relatedTarget:t}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||(new hn).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Dn);this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add($n),this._element.classList.remove(Dn),de.trigger(this._element,jn,{relatedTarget:t})},this._element,!0)}hide(){if(!this._isShown)return;if(de.trigger(this._element,Mn).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(In),this._backdrop.hide();this._queueCallback(()=>{this._element.classList.remove($n,In),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new hn).reset(),de.trigger(this._element,Hn)},this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new Gi({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():de.trigger(this._element,Fn)}:null})}_initializeFocusTrap(){return new on({trapElement:this._element})}_addEventListeners(){de.on(this._element,zn,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():de.trigger(this._element,Fn))})}static jQueryInterface(t){return this.each(function(){const e=Vn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}})}}de.on(document,Bn,'[data-bs-toggle="offcanvas"]',function(t){const e=ve.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),Ht(this))return;de.one(e,Hn,()=>{Ft(this)&&this.focus()});const i=ve.findOne(Nn);i&&i!==e&&Vn.getInstance(i).hide();Vn.getOrCreateInstance(e).toggle(this)}),de.on(window,Sn,()=>{for(const t of ve.find(Nn))Vn.getOrCreateInstance(t).show()}),de.on(window,Wn,()=>{for(const t of ve.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&Vn.getOrCreateInstance(t).hide()}),ye(Vn),Kt(Vn);const Kn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Qn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Xn=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Yn=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!Qn.has(i)||Boolean(Xn.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(i))};const Un={allowList:Kn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
"},Gn={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Jn={entry:"(string|element|function|null)",selector:"(string|element)"};class Zn extends ge{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return Un}static get DefaultType(){return Gn}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(t=>this._resolvePossibleFunction(t)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(t){return this._checkContent(t),this._config.content={...this._config.content,...t},this}toHtml(){const t=document.createElement("div");t.innerHTML=this._maybeSanitize(this._config.template);for(const[e,i]of Object.entries(this._config.content))this._setContent(t,i,e);const e=t.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&e.classList.add(...i.split(" ")),e}_typeCheckConfig(t){super._typeCheckConfig(t),this._checkContent(t.content)}_checkContent(t){for(const[e,i]of Object.entries(t))super._typeCheckConfig({selector:e,entry:i},Jn)}_setContent(t,e,i){const n=ve.findOne(i,t);n&&((e=this._resolvePossibleFunction(e))?jt(e)?this._putElementInTemplate(Mt(e),n):this._config.html?n.innerHTML=this._maybeSanitize(e):n.textContent=e:n.remove())}_maybeSanitize(t){return this._config.sanitize?function(t,e,i){if(!t.length)return t;if(i&&"function"==typeof i)return i(t);const n=(new window.DOMParser).parseFromString(t,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const t of s){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const n=[].concat(...t.attributes),s=[].concat(e["*"]||[],e[i]||[]);for(const e of n)Yn(e,s)||t.removeAttribute(e.nodeName)}return n.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return Qt(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const ts=new Set(["sanitize","allowList","sanitizeFn"]),es="fade",is="show",ns=".tooltip-inner",ss=".modal",os="hide.bs.modal",rs="hover",as="focus",ls="click",cs={AUTO:"auto",TOP:"top",RIGHT:Vt()?"left":"right",BOTTOM:"bottom",LEFT:Vt()?"right":"left"},hs={allowList:Kn,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'',title:"",trigger:"hover focus"},ds={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class us extends _e{constructor(t,e){if(void 0===Lt)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org/docs/v2/)");super(t,e),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return hs}static get DefaultType(){return ds}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),de.off(this._element.closest(ss),os,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const t=de.trigger(this._element,this.constructor.eventName("show")),e=(Wt(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(t.defaultPrevented||!e)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),de.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(is),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))de.on(t,"mouseover",Bt);this._queueCallback(()=>{de.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(!this._isShown())return;if(de.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)return;if(this._getTipElement().classList.remove(is),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))de.off(t,"mouseover",Bt);this._activeTrigger[ls]=!1,this._activeTrigger[as]=!1,this._activeTrigger[rs]=!1,this._isHovered=null;this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),de.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(t){const e=this._getTemplateFactory(t).toHtml();if(!e)return null;e.classList.remove(es,is),e.classList.add(`bs-${this.constructor.NAME}-auto`);const i=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME).toString();return e.setAttribute("id",i),this._isAnimated()&&e.classList.add(es),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new Zn({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[ns]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(t){return this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(es)}_isShown(){return this.tip&&this.tip.classList.contains(is)}_createPopper(t){const e=Qt(this._config.placement,[this,t,this._element]),i=cs[e.toUpperCase()];return kt(this._element,t,this._getPopperConfig(i))}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map(t=>Number.parseInt(t,10)):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return Qt(t,[this._element,this._element])}_getPopperConfig(t){const e={placement:t,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:t=>{this._getTipElement().setAttribute("data-popper-placement",t.state.placement)}}]};return{...e,...Qt(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)de.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[ls]=!(e._isShown()&&e._activeTrigger[ls]),e.toggle()});else if("manual"!==e){const t=e===rs?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===rs?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");de.on(this._element,t,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?as:rs]=!0,e._enter()}),de.on(this._element,i,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?as:rs]=e._element.contains(t.relatedTarget),e._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},de.on(this._element.closest(ss),os,this._hideModalHandler)}_fixTitle(){const t=this._element.getAttribute("title");t&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",t),this._element.setAttribute("data-bs-original-title",t),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(t,e){clearTimeout(this._timeout),this._timeout=setTimeout(t,e)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(t){const e=me.getDataAttributes(this._element);for(const t of Object.keys(e))ts.has(t)&&delete e[t];return t={...e,..."object"==typeof t&&t?t:{}},t=this._mergeConfigObj(t),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}_configAfterMerge(t){return t.container=!1===t.container?document.body:Mt(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),t}_getDelegateConfig(){const t={};for(const[e,i]of Object.entries(this._config))this.constructor.Default[e]!==i&&(t[e]=i);return t.selector=!1,t.trigger="manual",t}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(t){return this.each(function(){const e=us.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}Kt(us);const fs=".popover-header",ps=".popover-body",ms={...us.Default,content:"",offset:[0,8],placement:"right",template:'',trigger:"click"},gs={...us.DefaultType,content:"(null|string|element|function)"};class _s extends us{static get Default(){return ms}static get DefaultType(){return gs}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[fs]:this._getTitle(),[ps]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(t){return this.each(function(){const e=_s.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}})}}Kt(_s);const bs=".bs.scrollspy",vs=`activate${bs}`,ys=`click${bs}`,ws=`load${bs}.data-api`,As="active",Es="[href]",Ts=".nav-link",Cs=`${Ts}, .nav-item > ${Ts}, .list-group-item`,Os={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},xs={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class ks extends _e{constructor(t,e){super(t,e),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Os}static get DefaultType(){return xs}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const t of this._observableSections.values())this._observer.observe(t)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(t){return t.target=Mt(t.target)||document.body,t.rootMargin=t.offset?`${t.offset}px 0px -30%`:t.rootMargin,"string"==typeof t.threshold&&(t.threshold=t.threshold.split(",").map(t=>Number.parseFloat(t))),t}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(de.off(this._config.target,ys),de.on(this._config.target,ys,Es,t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,n=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),t)}_observerCallback(t){const e=t=>this._targetLinks.get(`#${t.target.id}`),i=t=>{this._previousScrollData.visibleEntryTop=t.target.offsetTop,this._process(e(t))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const o of t){if(!o.isIntersecting){this._activeTarget=null,this._clearActiveClass(e(o));continue}const t=o.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&t){if(i(o),!n)return}else s||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=ve.find(Es,this._config.target);for(const e of t){if(!e.hash||Ht(e))continue;const t=ve.findOne(decodeURI(e.hash),this._element);Ft(t)&&(this._targetLinks.set(decodeURI(e.hash),e),this._observableSections.set(e.hash,t))}}_process(t){this._activeTarget!==t&&(this._clearActiveClass(this._config.target),this._activeTarget=t,t.classList.add(As),this._activateParents(t),de.trigger(this._element,vs,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))ve.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(As);else for(const e of ve.parents(t,".nav, .list-group"))for(const t of ve.prev(e,Cs))t.classList.add(As)}_clearActiveClass(t){t.classList.remove(As);const e=ve.find(`${Es}.${As}`,t);for(const t of e)t.classList.remove(As)}static jQueryInterface(t){return this.each(function(){const e=ks.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}de.on(window,ws,()=>{for(const t of ve.find('[data-bs-spy="scroll"]'))ks.getOrCreateInstance(t)}),Kt(ks);const Ls=".bs.tab",Ss=`hide${Ls}`,$s=`hidden${Ls}`,Ds=`show${Ls}`,Is=`shown${Ls}`,Ns=`click${Ls}`,Ps=`keydown${Ls}`,js=`load${Ls}`,Ms="ArrowLeft",Fs="ArrowRight",Hs="ArrowUp",Ws="ArrowDown",Bs="Home",zs="End",Rs="active",qs="fade",Vs="show",Ks=".dropdown-toggle",Qs=`:not(${Ks})`,Xs='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ys=`${`.nav-link${Qs}, .list-group-item${Qs}, [role="tab"]${Qs}`}, ${Xs}`,Us=`.${Rs}[data-bs-toggle="tab"], .${Rs}[data-bs-toggle="pill"], .${Rs}[data-bs-toggle="list"]`;class Gs extends _e{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),de.on(this._element,Ps,t=>this._keydown(t)))}static get NAME(){return"tab"}show(){const t=this._element;if(this._elemIsActive(t))return;const e=this._getActiveElem(),i=e?de.trigger(e,Ss,{relatedTarget:t}):null;de.trigger(t,Ds,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){if(!t)return;t.classList.add(Rs),this._activate(ve.getElementFromSelector(t));this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),de.trigger(t,Is,{relatedTarget:e})):t.classList.add(Vs)},t,t.classList.contains(qs))}_deactivate(t,e){if(!t)return;t.classList.remove(Rs),t.blur(),this._deactivate(ve.getElementFromSelector(t));this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),de.trigger(t,$s,{relatedTarget:e})):t.classList.remove(Vs)},t,t.classList.contains(qs))}_keydown(t){if(![Ms,Fs,Hs,Ws,Bs,zs].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter(t=>!Ht(t));let i;if([Bs,zs].includes(t.key))i=e[t.key===Bs?0:e.length-1];else{const n=[Fs,Ws].includes(t.key);i=Yt(e,t.target,n,!0)}i&&(i.focus({preventScroll:!0}),Gs.getOrCreateInstance(i).show())}_getChildren(){return ve.find(Ys,this._parent)}_getActiveElem(){return this._getChildren().find(t=>this._elemIsActive(t))||null}_setInitialAttributes(t,e){this._setAttributeIfNotExists(t,"role","tablist");for(const t of e)this._setInitialAttributesOnChild(t)}_setInitialAttributesOnChild(t){t=this._getInnerElement(t);const e=this._elemIsActive(t),i=this._getOuterElement(t);t.setAttribute("aria-selected",e),i!==t&&this._setAttributeIfNotExists(i,"role","presentation"),e||t.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(t,"role","tab"),this._setInitialAttributesOnTargetPanel(t)}_setInitialAttributesOnTargetPanel(t){const e=ve.getElementFromSelector(t);e&&(this._setAttributeIfNotExists(e,"role","tabpanel"),t.id&&this._setAttributeIfNotExists(e,"aria-labelledby",`${t.id}`))}_toggleDropDown(t,e){const i=this._getOuterElement(t);if(!i.classList.contains("dropdown"))return;const n=(t,n)=>{const s=ve.findOne(t,i);s&&s.classList.toggle(n,e)};n(Ks,Rs),n(".dropdown-menu",Vs),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(Rs)}_getInnerElement(t){return t.matches(Ys)?t:ve.findOne(Ys,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}static jQueryInterface(t){return this.each(function(){const e=Gs.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t]()}})}}de.on(document,Ns,Xs,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),Ht(this)||Gs.getOrCreateInstance(this).show()}),de.on(window,js,()=>{for(const t of ve.find(Us))Gs.getOrCreateInstance(t)}),Kt(Gs);const Js=".bs.toast",Zs=`mouseover${Js}`,to=`mouseout${Js}`,eo=`focusin${Js}`,io=`focusout${Js}`,no=`hide${Js}`,so=`hidden${Js}`,oo=`show${Js}`,ro=`shown${Js}`,ao="hide",lo="show",co="showing",ho={animation:"boolean",autohide:"boolean",delay:"number"},uo={animation:!0,autohide:!0,delay:5e3};class fo extends _e{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return uo}static get DefaultType(){return ho}static get NAME(){return"toast"}show(){if(de.trigger(this._element,oo).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(ao),zt(this._element),this._element.classList.add(lo,co),this._queueCallback(()=>{this._element.classList.remove(co),de.trigger(this._element,ro),this._maybeScheduleHide()},this._element,this._config.animation)}hide(){if(!this.isShown())return;if(de.trigger(this._element,no).defaultPrevented)return;this._element.classList.add(co),this._queueCallback(()=>{this._element.classList.add(ao),this._element.classList.remove(co,lo),de.trigger(this._element,so)},this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(lo),super.dispose()}isShown(){return this._element.classList.contains(lo)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){de.on(this._element,Zs,t=>this._onInteraction(t,!0)),de.on(this._element,to,t=>this._onInteraction(t,!1)),de.on(this._element,eo,t=>this._onInteraction(t,!0)),de.on(this._element,io,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each(function(){const e=fo.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}})}}ye(fo),Kt(fo);const po={...Object.freeze(Object.defineProperty({__proto__:null,Alert:Te,Button:Oe,Carousel:ri,Collapse:yi,Dropdown:Vi,Modal:xn,Offcanvas:Vn,Popover:_s,ScrollSpy:ks,Tab:Gs,Toast:fo,Tooltip:us},Symbol.toStringTag,{value:"Module"})),bindDarkMode:(t,e)=>{if("undefined"==typeof document)return;const i=document.documentElement,n=t=>{i.setAttribute("data-bs-theme",t?"dark":"light")};t&&e&&(t.__watch(e,n),n(t[e]))},config:(t={})=>{if("undefined"==typeof document)return;const e=document.documentElement;["primary","secondary","success","info","warning","danger","light","dark"].forEach(i=>{const n=t[i];if(n){e.style.setProperty(`--bs-${i}`,n);const t=po._hexToRgb(n);t&&e.style.setProperty(`--bs-${i}-rgb`,`${t.r}, ${t.g}, ${t.b}`)}})},_hexToRgb:t=>{const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}};export{po as Bootstrap,po as default}; diff --git a/src/index.js b/src/index.js index 3d6806a..c11e5ed 100644 --- a/src/index.js +++ b/src/index.js @@ -13,63 +13,41 @@ const GlobalStates = { Hash, LocalStorage } const Bootstrap = { // 原始 Bootstrap 实例引用 ...bootstrap, +/** + * 绑定暗色模式 + * @param {Object} state NewState 对象 (如 LocalStorage) + * @param {string} key 键名 (如 'darkMode') + */ +bindDarkMode: (state, key) => { + if (typeof document === 'undefined') return + const htmlNode = document.documentElement + const updateTheme = (val) => { + htmlNode.setAttribute('data-bs-theme', val ? 'dark' : 'light') + } + if (state && key) { + state.__watch(key, updateTheme) + updateTheme(state[key]) + } +}, - /** - * 绑定暗色模式到 State 路径 - * @param {string|Object} stateOrPath 例如 'LocalStorage.darkMode' 或某个 NewState 对象 - * @param {string} [key] 如果第一个参数是对象,则需要指定 key - */ - bindDarkMode: (stateOrPath, key) => { - if (typeof document === 'undefined') return - - const htmlNode = document.documentElement - const updateTheme = (val) => { - const theme = val ? 'dark' : 'light' - htmlNode.setAttribute('data-bs-theme', theme) - htmlNode.setAttribute('$data-bs-theme', theme) +/** + * 动态配置主题变量 + * @param {Object} config { primary: '#6366f1', ... } + */ +config: (config = {}) => { + if (typeof document === 'undefined') return + const root = document.documentElement + const colors = ['primary', 'secondary', 'success', 'info', 'warning', 'danger', 'light', 'dark'] + + colors.forEach(name => { + const hex = config[name] + if (hex) { + root.style.setProperty(`--bs-${name}`, hex) + const rgb = Bootstrap._hexToRgb(hex) + if (rgb) root.style.setProperty(`--bs-${name}-rgb`, `${rgb.r}, ${rgb.g}, ${rgb.b}`) } - - let state, finalKey; - if (typeof stateOrPath === 'string') { - const parts = stateOrPath.split('.') - state = GlobalStates[parts[0]] - finalKey = parts[1] - } else { - state = stateOrPath - finalKey = key - } - - if (!state || !finalKey) return console.warn('Bootstrap.bindDarkMode: Invalid state or key') - - // 监听状态变化 - state.__watch(finalKey, (val) => { - updateTheme(val) - RefreshState(htmlNode) - }) - - // 初始值同步 - updateTheme(state[finalKey]) - }, - - /** - * 动态配置主题 - * @param {Object} config { primary: '#6366f1', ... } - */ - config: (config = {}) => { - if (typeof document === 'undefined') return - const root = document.documentElement - - if (config.primary) { - root.style.setProperty('--bs-primary', config.primary) - // 简单计算 RGB 供一些需要透明度的组件使用 - const rgb = Bootstrap._hexToRgb(config.primary) - if (rgb) root.style.setProperty('--bs-primary-rgb', `${rgb.r}, ${rgb.g}, ${rgb.b}`) - } - - if (config.success) root.style.setProperty('--bs-success', config.success) - if (config.danger) root.style.setProperty('--bs-danger', config.danger) - // ... 其他颜色变量 - }, + }) +}, _hexToRgb: (hex) => { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) diff --git a/test/index.html b/test/index.html index 43c6bc3..90d7aea 100644 --- a/test/index.html +++ b/test/index.html @@ -27,7 +27,7 @@ // 初始化 LocalStorage.darkMode = false; - Bootstrap.bindDarkMode('LocalStorage.darkMode'); + Bootstrap.bindDarkMode(LocalStorage, 'darkMode'); document.getElementById('toggle-btn').onclick = () => { LocalStorage.darkMode = !LocalStorage.darkMode;