mirror of https://github.com/twbs/bootstrap.git
7 lines
56 KiB
JavaScript
7 lines
56 KiB
JavaScript
/*!
|
|
* 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)
|
|
*/
|
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e(t.Popper)}(this,function(t){"use strict";function e(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const i=e(t),s=new Map,n={set(t,e,i){s.has(t)||s.set(t,new Map);const n=s.get(t);n.has(e)||0===n.size?n.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(t,e)=>s.has(t)&&s.get(t).get(e)||null,remove(t,e){if(!s.has(t))return;const i=s.get(t);i.delete(e),0===i.size&&s.delete(t)}},o=/[^.]*(?=\..*)\.|.*/,r=/\..*/,a=/::\d+$/,l={};let c=1;const h={mouseenter:"mouseover",mouseleave:"mouseout"},d=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 u(t,e){return e&&`${e}::${c++}`||t.uidEvent||c++}function _(t){const e=u(t);return t.uidEvent=e,l[e]=l[e]||{},l[e]}function g(t,e,i=null){return Object.values(t).find(t=>t.callable===e&&t.delegationSelector===i)}function m(t,e,i){const s="string"==typeof e,n=s?i:e||i;let o=(a=(a=t).replace(r,""),h[a]||a);var a;return d.has(o)||(o=t),[s,n,o]}function p(t,e,i,s,n){if("string"!=typeof e||!t)return;let[r,a,l]=m(e,i,s);if(e in h){const t=t=>function(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};a=t(a)}const c=_(t),d=c[l]||(c[l]={}),p=g(d,a,r?i:null);if(p)return void(p.oneOff=p.oneOff&&n);const f=u(a,e.replace(o,"")),b=r?function(t,e,i){return function s(n){const o=t.querySelectorAll(e);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return y(n,{delegateTarget:r}),s.oneOff&&v.off(t,n.type,e,i),i.apply(r,[n])}}(t,i,a):function(t,e){return function i(s){return y(s,{delegateTarget:t}),i.oneOff&&v.off(t,s.type,e),e.apply(t,[s])}}(t,a);b.delegationSelector=r?i:null,b.callable=a,b.oneOff=n,b.uidEvent=f,d[f]=b,t.addEventListener(l,b,r)}function f(t,e,i,s,n){const o=g(e[i],s,n);o&&(t.removeEventListener(i,o,Boolean(n)),delete e[i][o.uidEvent])}function b(t,e,i,s){const n=e[i]||{};for(const[o,r]of Object.entries(n))o.includes(s)&&f(t,e,i,r.callable,r.delegationSelector)}const v={on(t,e,i,s){p(t,e,i,s,!1)},one(t,e,i,s){p(t,e,i,s,!0)},off(t,e,i,s){if("string"!=typeof e||!t)return;const[n,o,r]=m(e,i,s),l=r!==e,c=_(t),h=c[r]||{},d=e.startsWith(".");if(void 0===o){if(d)for(const i of Object.keys(c))b(t,c,i,e.slice(1));for(const[i,s]of Object.entries(h)){const n=i.replace(a,"");l&&!e.includes(n)||f(t,c,r,s.callable,s.delegationSelector)}}else{if(!Object.keys(h).length)return;f(t,c,r,o,n?i:null)}},trigger(t,e,i){if("string"!=typeof e||!t)return null;const s=y(new Event(e,{bubbles:!0,cancelable:!0}),i);return t.dispatchEvent(s),s}};function y(t,e={}){for(const[i,s]of Object.entries(e))try{t[i]=s}catch(e){Object.defineProperty(t,i,{configurable:!0,get:()=>s})}return t}function w(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 A(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}const E={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${A(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${A(e)}`)},getDataAttributes(t){if(!t)return{};const e={},i=Object.keys(t.dataset).filter(t=>t.startsWith("bs")&&!t.startsWith("bsConfig"));for(const s of i){let i=s.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),e[i]=w(t.dataset[s])}return e},getDataAttribute:(t,e)=>w(t.getAttribute(`data-bs-${A(e)}`))},T="transitionend",C=t=>(t&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(t,e)=>`#${CSS.escape(e)}`)),t),k=t=>null==t?`${t}`:Object.prototype.toString.call(t).match(/\s([a-z]+)/i)[1].toLowerCase(),S=t=>{t.dispatchEvent(new Event(T))},L=t=>!(!t||"object"!=typeof t)&&void 0!==t.nodeType,$=t=>L(t)?t:"string"==typeof t&&t.length>0?document.querySelector(C(t)):null,O=t=>{if(!L(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},D=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),N=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?N(t.parentNode):null},I=()=>{},P=t=>{t.offsetHeight},x=()=>"rtl"===document.documentElement.dir,M=(t,e=[],i=t)=>"function"==typeof t?t.call(...e):i,F=(t,e,i=!0)=>{if(!i)return void M(t);const s=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const s=Number.parseFloat(e),n=Number.parseFloat(i);return s||n?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(e)+5;let n=!1;const o=({target:i})=>{i===e&&(n=!0,e.removeEventListener(T,o),M(t))};e.addEventListener(T,o),setTimeout(()=>{n||S(e)},s)},j=(t,e,i,s)=>{const n=t.length;let o=t.indexOf(e);return-1===o?!i&&s?t[n-1]:t[0]:(o+=i?1:-1,s&&(o=(o+n)%n),t[Math.max(0,Math.min(o,n-1))])};class z{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=L(e)?E.getDataAttribute(e,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...L(e)?E.getDataAttributes(e):{},..."object"==typeof t?t:{}}}_typeCheckConfig(t,e=this.constructor.DefaultType){for(const[i,s]of Object.entries(e)){const e=t[i],n=L(e)?"element":k(e);if(!new RegExp(s).test(n))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${n}" but expected type "${s}".`)}}}class H extends z{constructor(t,e){super(),(t=$(t))&&(this._element=t,this._config=this._getConfig(e),n.set(this._element,this.constructor.DATA_KEY,this))}dispose(){n.remove(this._element,this.constructor.DATA_KEY),v.off(this._element,this.constructor.EVENT_KEY);for(const t of Object.getOwnPropertyNames(this))this[t]=null}_queueCallback(t,e,i=!0){F(t,e,i)}_getConfig(t){return t=this._mergeConfigObj(t,this._element),t=this._configAfterMerge(t),this._typeCheckConfig(t),t}static getInstance(t){return n.get($(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 B=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=>C(t)).join(","):null},q={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 s=t.parentNode.closest(e);for(;s;)i.push(s),s=s.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=>!D(t)&&O(t))},getSelectorFromElement(t){const e=B(t);return e&&q.findOne(e)?e:null},getElementFromSelector(t){const e=B(t);return e?q.findOne(e):null},getMultipleElementsFromSelector(t){const e=B(t);return e?q.find(e):[]}},R=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,s=t.NAME;v.on(document,i,`[data-bs-dismiss="${s}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),D(this))return;const n=q.getElementFromSelector(this)||this.closest(`.${s}`);t.getOrCreateInstance(n)[e]()})},W=".bs.alert",K=`close${W}`,V=`closed${W}`;class X extends H{static get NAME(){return"alert"}close(){if(v.trigger(this._element,K).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(),v.trigger(this._element,V),this.dispose()}}R(X,"close");const Y='[data-bs-toggle="button"]';class U extends H{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}}v.on(document,"click.bs.button.data-api",Y,t=>{t.preventDefault();const e=t.target.closest(Y);U.getOrCreateInstance(e).toggle()});const G=".bs.swipe",J=`touchstart${G}`,Z=`touchmove${G}`,Q=`touchend${G}`,tt=`pointerdown${G}`,et=`pointerup${G}`,it={endCallback:null,leftCallback:null,rightCallback:null},st={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class nt extends z{constructor(t,e){super(),this._element=t,t&&nt.isSupported()&&(this._config=this._getConfig(e),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return it}static get DefaultType(){return st}static get NAME(){return"swipe"}dispose(){v.off(this._element,G)}_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(),M(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&&M(e>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(v.on(this._element,tt,t=>this._start(t)),v.on(this._element,et,t=>this._end(t)),this._element.classList.add("pointer-event")):(v.on(this._element,J,t=>this._start(t)),v.on(this._element,Z,t=>this._move(t)),v.on(this._element,Q,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 ot=".bs.carousel",rt=".data-api",at="ArrowLeft",lt="ArrowRight",ct="next",ht="prev",dt="left",ut="right",_t=`slide${ot}`,gt=`slid${ot}`,mt=`keydown${ot}`,pt=`mouseenter${ot}`,ft=`mouseleave${ot}`,bt=`dragstart${ot}`,vt=`load${ot}${rt}`,yt=`click${ot}${rt}`,wt="carousel",At="active",Et=".active",Tt=".carousel-item",Ct=Et+Tt,kt={[at]:ut,[lt]:dt},St={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Lt={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class $t extends H{constructor(t,e){super(t,e),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=q.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===wt&&this.cycle()}static get Default(){return St}static get DefaultType(){return Lt}static get NAME(){return"carousel"}next(){this._slide(ct)}nextWhenVisible(){!document.hidden&&O(this._element)&&this.next()}prev(){this._slide(ht)}pause(){this._isSliding&&S(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?v.one(this._element,gt,()=>this.cycle()):this.cycle())}to(t){const e=this._getItems();if(t>e.length-1||t<0)return;if(this._isSliding)return void v.one(this._element,gt,()=>this.to(t));const i=this._getItemIndex(this._getActive());if(i===t)return;const s=t>i?ct:ht;this._slide(s,e[t])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(t){return t.defaultInterval=t.interval,t}_addEventListeners(){this._config.keyboard&&v.on(this._element,mt,t=>this._keydown(t)),"hover"===this._config.pause&&(v.on(this._element,pt,()=>this.pause()),v.on(this._element,ft,()=>this._maybeEnableCycle())),this._config.touch&&nt.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const t of q.find(".carousel-item img",this._element))v.on(t,bt,t=>t.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(dt)),rightCallback:()=>this._slide(this._directionToOrder(ut)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new nt(this._element,t)}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=kt[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=q.findOne(Et,this._indicatorsElement);e.classList.remove(At),e.removeAttribute("aria-current");const i=q.findOne(`[data-bs-slide-to="${t}"]`,this._indicatorsElement);i&&(i.classList.add(At),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(),s=t===ct,n=e||j(this._getItems(),i,s,this._config.wrap);if(n===i)return;const o=this._getItemIndex(n),r=e=>v.trigger(this._element,e,{relatedTarget:n,direction:this._orderToDirection(t),from:this._getItemIndex(i),to:o});if(r(_t).defaultPrevented)return;if(!i||!n)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=n;const l=s?"carousel-item-start":"carousel-item-end",c=s?"carousel-item-next":"carousel-item-prev";n.classList.add(c),P(n),i.classList.add(l),n.classList.add(l),this._queueCallback(()=>{n.classList.remove(l,c),n.classList.add(At),i.classList.remove(At,c,l),this._isSliding=!1,r(gt)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return q.findOne(Ct,this._element)}_getItems(){return q.find(Tt,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(t){return x()?t===dt?ht:ct:t===dt?ct:ht}_orderToDirection(t){return x()?t===ht?dt:ut:t===ht?ut:dt}}v.on(document,yt,"[data-bs-slide], [data-bs-slide-to]",function(t){const e=q.getElementFromSelector(this);if(!e||!e.classList.contains(wt))return;t.preventDefault();const i=$t.getOrCreateInstance(e),s=this.getAttribute("data-bs-slide-to");return s?(i.to(s),void i._maybeEnableCycle()):"next"===E.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),v.on(window,vt,()=>{const t=q.find('[data-bs-ride="carousel"]');for(const e of t)$t.getOrCreateInstance(e)});const Ot=".bs.collapse",Dt=`show${Ot}`,Nt=`shown${Ot}`,It=`hide${Ot}`,Pt=`hidden${Ot}`,xt=`click${Ot}.data-api`,Mt="show",Ft="collapse",jt="collapsing",zt=`:scope .${Ft} .${Ft}`,Ht='[data-bs-toggle="collapse"]',Bt={parent:null,toggle:!0},qt={parent:"(null|element)",toggle:"boolean"};class Rt extends H{constructor(t,e){super(t,e),this._isTransitioning=!1,this._triggerArray=[];const i=q.find(Ht);for(const t of i){const e=q.getSelectorFromElement(t),i=q.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 Bt}static get DefaultType(){return qt}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=>Rt.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning)return;if(v.trigger(this._element,Dt).defaultPrevented)return;for(const e of t)e.hide();const e=this._getDimension();this._element.classList.remove(Ft),this._element.classList.add(jt),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(jt),this._element.classList.add(Ft,Mt),this._element.style[e]="",v.trigger(this._element,Nt)},this._element,!0),this._element.style[e]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(v.trigger(this._element,It).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,P(this._element),this._element.classList.add(jt),this._element.classList.remove(Ft,Mt);for(const t of this._triggerArray){const e=q.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(jt),this._element.classList.add(Ft),v.trigger(this._element,Pt)},this._element,!0)}_isShown(t=this._element){return t.classList.contains(Mt)}_configAfterMerge(t){return t.toggle=Boolean(t.toggle),t.parent=$(t.parent),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=this._getFirstLevelChildren(Ht);for(const e of t){const t=q.getElementFromSelector(e);t&&this._addAriaAndCollapsedClass([e],this._isShown(t))}}_getFirstLevelChildren(t){const e=q.find(zt,this._config.parent);return q.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)}}v.on(document,xt,Ht,function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();for(const t of q.getMultipleElementsFromSelector(this))Rt.getOrCreateInstance(t,{toggle:!1}).toggle()});const Wt="dropdown",Kt=".bs.dropdown",Vt=".data-api",Xt="ArrowUp",Yt="ArrowDown",Ut=`hide${Kt}`,Gt=`hidden${Kt}`,Jt=`show${Kt}`,Zt=`shown${Kt}`,Qt=`click${Kt}${Vt}`,te=`keydown${Kt}${Vt}`,ee=`keyup${Kt}${Vt}`,ie="show",se='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ne=`${se}.${ie}`,oe=".dropdown-menu",re=x()?"top-end":"top-start",ae=x()?"top-start":"top-end",le=x()?"bottom-end":"bottom-start",ce=x()?"bottom-start":"bottom-end",he=x()?"left-start":"right-start",de=x()?"right-start":"left-start",ue={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},_e={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class ge extends H{constructor(t,e){super(t,e),this._popper=null,this._parent=this._element.parentNode,this._menu=q.next(this._element,oe)[0]||q.prev(this._element,oe)[0]||q.findOne(oe,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return ue}static get DefaultType(){return _e}static get NAME(){return Wt}toggle(){return this._isShown()?this.hide():this.show()}show(){if(D(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!v.trigger(this._element,Jt,t).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const t of[].concat(...document.body.children))v.on(t,"mouseover",I);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ie),this._element.classList.add(ie),v.trigger(this._element,Zt,t)}}hide(){if(D(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(!v.trigger(this._element,Ut,t).defaultPrevented){if("ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))v.off(t,"mouseover",I);this._popper&&this._popper.destroy(),this._menu.classList.remove(ie),this._element.classList.remove(ie),this._element.setAttribute("aria-expanded","false"),E.removeDataAttribute(this._menu,"popper"),v.trigger(this._element,Gt,t)}}_getConfig(t){if("object"==typeof(t=super._getConfig(t)).reference&&!L(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Wt.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(){if(void 0===i)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:L(this._config.reference)?t=$(this._config.reference):"object"==typeof this._config.reference&&(t=this._config.reference);const e=this._getPopperConfig();this._popper=i.createPopper(t,this._menu,e)}_isShown(){return this._menu.classList.contains(ie)}_getPlacement(){const t=this._parent;if(t.classList.contains("dropend"))return he;if(t.classList.contains("dropstart"))return de;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?ae:re:e?ce:le}_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)&&(E.setDataAttribute(this._menu,"popper","static"),t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,...M(this._config.popperConfig,[void 0,t])}}_selectMenuItem({key:t,target:e}){const i=q.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(t=>O(t));i.length&&j(i,e,t===Yt,!i.includes(e)).focus()}static clearMenus(t){if(2===t.button||"keyup"===t.type&&"Tab"!==t.key)return;const e=q.find(ne);for(const i of e){const e=ge.getInstance(i);if(!e||!1===e._config.autoClose)continue;const s=t.composedPath(),n=s.includes(e._menu);if(s.includes(e._element)||"inside"===e._config.autoClose&&!n||"outside"===e._config.autoClose&&n)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,s=[Xt,Yt].includes(t.key);if(!s&&!i)return;if(e&&!i)return;t.preventDefault();const n=this.matches(se)?this:q.prev(this,se)[0]||q.next(this,se)[0]||q.findOne(se,t.delegateTarget.parentNode),o=ge.getOrCreateInstance(n);if(s)return t.stopPropagation(),o.show(),void o._selectMenuItem(t);o._isShown()&&(t.stopPropagation(),o.hide(),n.focus())}}v.on(document,te,se,ge.dataApiKeydownHandler),v.on(document,te,oe,ge.dataApiKeydownHandler),v.on(document,Qt,ge.clearMenus),v.on(document,ee,ge.clearMenus),v.on(document,Qt,se,function(t){t.preventDefault(),ge.getOrCreateInstance(this).toggle()});const me="backdrop",pe="show",fe=`mousedown.bs.${me}`,be={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},ve={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class ye extends z{constructor(t){super(),this._config=this._getConfig(t),this._isAppended=!1,this._element=null}static get Default(){return be}static get DefaultType(){return ve}static get NAME(){return me}show(t){if(!this._config.isVisible)return void M(t);this._append();const e=this._getElement();this._config.isAnimated&&P(e),e.classList.add(pe),this._emulateAnimation(()=>{M(t)})}hide(t){this._config.isVisible?(this._getElement().classList.remove(pe),this._emulateAnimation(()=>{this.dispose(),M(t)})):M(t)}dispose(){this._isAppended&&(v.off(this._element,fe),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=$(t.rootElement),t}_append(){if(this._isAppended)return;const t=this._getElement();this._config.rootElement.append(t),v.on(t,fe,()=>{M(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(t){F(t,this._getElement(),this._config.isAnimated)}}const we=".bs.focustrap",Ae=`focusin${we}`,Ee=`keydown.tab${we}`,Te="backward",Ce={autofocus:!0,trapElement:null},ke={autofocus:"boolean",trapElement:"element"};class Se extends z{constructor(t){super(),this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Ce}static get DefaultType(){return ke}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),v.off(document,we),v.on(document,Ae,t=>this._handleFocusin(t)),v.on(document,Ee,t=>this._handleKeydown(t)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,v.off(document,we))}_handleFocusin(t){const{trapElement:e}=this._config;if(t.target===document||t.target===e||e.contains(t.target))return;const i=q.focusableChildren(e);0===i.length?e.focus():this._lastTabNavDirection===Te?i[i.length-1].focus():i[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?Te:"forward")}}const Le=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",$e=".sticky-top",Oe="padding-right",De="margin-right";class Ne{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,Oe,e=>e+t),this._setElementAttributes(Le,Oe,e=>e+t),this._setElementAttributes($e,De,e=>e-t)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,Oe),this._resetElementAttributes(Le,Oe),this._resetElementAttributes($e,De)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const s=this.getWidth();this._applyManipulationCallback(t,t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+s)return;this._saveInitialAttribute(t,e);const n=window.getComputedStyle(t).getPropertyValue(e);t.style.setProperty(e,`${i(Number.parseFloat(n))}px`)})}_saveInitialAttribute(t,e){const i=t.style.getPropertyValue(e);i&&E.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,t=>{const i=E.getDataAttribute(t,e);null!==i?(E.removeDataAttribute(t,e),t.style.setProperty(e,i)):t.style.removeProperty(e)})}_applyManipulationCallback(t,e){if(L(t))e(t);else for(const i of q.find(t,this._element))e(i)}}const Ie=".bs.modal",Pe=`hide${Ie}`,xe=`hidePrevented${Ie}`,Me=`hidden${Ie}`,Fe=`show${Ie}`,je=`shown${Ie}`,ze=`resize${Ie}`,He=`click.dismiss${Ie}`,Be=`mousedown.dismiss${Ie}`,qe=`keydown.dismiss${Ie}`,Re=`click${Ie}.data-api`,We="modal-open",Ke="show",Ve="modal-static",Xe={backdrop:!0,focus:!0,keyboard:!0},Ye={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Ue extends H{constructor(t,e){super(t,e),this._dialog=q.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new Ne,this._addEventListeners()}static get Default(){return Xe}static get DefaultType(){return Ye}static get NAME(){return"modal"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||v.trigger(this._element,Fe,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(We),this._adjustDialog(),this._backdrop.show(()=>this._showElement(t)))}hide(){this._isShown&&!this._isTransitioning&&(v.trigger(this._element,Pe).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Ke),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){v.off(window,Ie),v.off(this._dialog,Ie),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new ye({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Se({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=q.findOne(".modal-body",this._dialog);e&&(e.scrollTop=0),P(this._element),this._element.classList.add(Ke),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,v.trigger(this._element,je,{relatedTarget:t})},this._dialog,this._isAnimated())}_addEventListeners(){v.on(this._element,qe,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),v.on(window,ze,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),v.on(this._element,Be,t=>{v.one(this._element,He,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(We),this._resetAdjustments(),this._scrollBar.reset(),v.trigger(this._element,Me)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(v.trigger(this._element,xe).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._element.style.overflowY;"hidden"===e||this._element.classList.contains(Ve)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Ve),this._queueCallback(()=>{this._element.classList.remove(Ve),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=x()?"paddingLeft":"paddingRight";this._element.style[t]=`${e}px`}if(!i&&t){const t=x()?"paddingRight":"paddingLeft";this._element.style[t]=`${e}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}}v.on(document,Re,'[data-bs-toggle="modal"]',function(t){const e=q.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),v.one(e,Fe,t=>{t.defaultPrevented||v.one(e,Me,()=>{O(this)&&this.focus()})});const i=q.findOne(".modal.show");i&&Ue.getInstance(i).hide(),Ue.getOrCreateInstance(e).toggle(this)}),R(Ue);const Ge=".bs.offcanvas",Je=".data-api",Ze=`load${Ge}${Je}`,Qe="show",ti="showing",ei="hiding",ii=".offcanvas.show",si=`show${Ge}`,ni=`shown${Ge}`,oi=`hide${Ge}`,ri=`hidePrevented${Ge}`,ai=`hidden${Ge}`,li=`resize${Ge}`,ci=`click${Ge}${Je}`,hi=`keydown.dismiss${Ge}`,di={backdrop:!0,keyboard:!0,scroll:!1},ui={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class _i extends H{constructor(t,e){super(t,e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return di}static get DefaultType(){return ui}static get NAME(){return"offcanvas"}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||v.trigger(this._element,si,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Ne).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ti),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(Qe),this._element.classList.remove(ti),v.trigger(this._element,ni,{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&(v.trigger(this._element,oi).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(ei),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(Qe,ei),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new Ne).reset(),v.trigger(this._element,ai)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const t=Boolean(this._config.backdrop);return new ye({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?()=>{"static"!==this._config.backdrop?this.hide():v.trigger(this._element,ri)}:null})}_initializeFocusTrap(){return new Se({trapElement:this._element})}_addEventListeners(){v.on(this._element,hi,t=>{"Escape"===t.key&&(this._config.keyboard?this.hide():v.trigger(this._element,ri))})}}v.on(document,ci,'[data-bs-toggle="offcanvas"]',function(t){const e=q.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),D(this))return;v.one(e,ai,()=>{O(this)&&this.focus()});const i=q.findOne(ii);i&&i!==e&&_i.getInstance(i).hide(),_i.getOrCreateInstance(e).toggle(this)}),v.on(window,Ze,()=>{for(const t of q.find(ii))_i.getOrCreateInstance(t).show()}),v.on(window,li,()=>{for(const t of q.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(t).position&&_i.getOrCreateInstance(t).hide()}),R(_i);const gi={"*":["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:[]},mi=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),pi=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,fi=(t,e)=>{const i=t.nodeName.toLowerCase();return e.includes(i)?!mi.has(i)||Boolean(pi.test(t.nodeValue)):e.filter(t=>t instanceof RegExp).some(t=>t.test(i))},bi={allowList:gi,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},vi={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},yi={entry:"(string|element|function|null)",selector:"(string|element)"};class wi extends z{constructor(t){super(),this._config=this._getConfig(t)}static get Default(){return bi}static get DefaultType(){return vi}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},yi)}_setContent(t,e,i){const s=q.findOne(i,t);s&&((e=this._resolvePossibleFunction(e))?L(e)?this._putElementInTemplate($(e),s):this._config.html?s.innerHTML=this._maybeSanitize(e):s.textContent=e:s.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 s=(new window.DOMParser).parseFromString(t,"text/html"),n=[].concat(...s.body.querySelectorAll("*"));for(const t of n){const i=t.nodeName.toLowerCase();if(!Object.keys(e).includes(i)){t.remove();continue}const s=[].concat(...t.attributes),n=[].concat(e["*"]||[],e[i]||[]);for(const e of s)fi(e,n)||t.removeAttribute(e.nodeName)}return s.body.innerHTML}(t,this._config.allowList,this._config.sanitizeFn):t}_resolvePossibleFunction(t){return M(t,[void 0,this])}_putElementInTemplate(t,e){if(this._config.html)return e.innerHTML="",void e.append(t);e.textContent=t.textContent}}const Ai=new Set(["sanitize","allowList","sanitizeFn"]),Ei="fade",Ti="show",Ci=".tooltip-inner",ki=".modal",Si="hide.bs.modal",Li="hover",$i="focus",Oi="click",Di={AUTO:"auto",TOP:"top",RIGHT:x()?"left":"right",BOTTOM:"bottom",LEFT:x()?"right":"left"},Ni={allowList:gi,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:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},Ii={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 Pi extends H{constructor(t,e){if(void 0===i)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 Ni}static get DefaultType(){return Ii}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),v.off(this._element.closest(ki),Si,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=v.trigger(this._element,this.constructor.eventName("show")),e=(N(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:s}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(s.append(i),v.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(Ti),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))v.on(t,"mouseover",I);this._queueCallback(()=>{v.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!v.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Ti),"ontouchstart"in document.documentElement)for(const t of[].concat(...document.body.children))v.off(t,"mouseover",I);this._activeTrigger[Oi]=!1,this._activeTrigger[$i]=!1,this._activeTrigger[Li]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),v.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(Ei,Ti),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(Ei),e}setContent(t){this._newContent=t,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(t){return this._templateFactory?this._templateFactory.changeContent(t):this._templateFactory=new wi({...this._config,content:t,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[Ci]: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(Ei)}_isShown(){return this.tip&&this.tip.classList.contains(Ti)}_createPopper(t){const e=M(this._config.placement,[this,t,this._element]),s=Di[e.toUpperCase()];return i.createPopper(this._element,t,this._getPopperConfig(s))}_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 M(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,...M(this._config.popperConfig,[void 0,e])}}_setListeners(){const t=this._config.trigger.split(" ");for(const e of t)if("click"===e)v.on(this._element,this.constructor.eventName("click"),this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger[Oi]=!(e._isShown()&&e._activeTrigger[Oi]),e.toggle()});else if("manual"!==e){const t=e===Li?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=e===Li?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");v.on(this._element,t,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusin"===t.type?$i:Li]=!0,e._enter()}),v.on(this._element,i,this._config.selector,t=>{const e=this._initializeOnDelegatedTarget(t);e._activeTrigger["focusout"===t.type?$i:Li]=e._element.contains(t.relatedTarget),e._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},v.on(this._element.closest(ki),Si,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=E.getDataAttributes(this._element);for(const t of Object.keys(e))Ai.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:$(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)}}const xi=".popover-header",Mi=".popover-body",Fi={...Pi.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},ji={...Pi.DefaultType,content:"(null|string|element|function)"},zi=".bs.scrollspy",Hi=`activate${zi}`,Bi=`click${zi}`,qi=`load${zi}.data-api`,Ri="active",Wi="[href]",Ki=".nav-link",Vi=`${Ki}, .nav-item > ${Ki}, .list-group-item`,Xi={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Yi={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class Ui extends H{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 Xi}static get DefaultType(){return Yi}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=$(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&&(v.off(this._config.target,Bi),v.on(this._config.target,Bi,Wi,t=>{const e=this._observableSections.get(t.target.hash);if(e){t.preventDefault();const i=this._rootElement||window,s=e.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:s,behavior:"smooth"});i.scrollTop=s}}))}_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))},s=(this._rootElement||document.documentElement).scrollTop,n=s>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=s;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(n&&t){if(i(o),!s)return}else n||t||i(o)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const t=q.find(Wi,this._config.target);for(const e of t){if(!e.hash||D(e))continue;const t=q.findOne(decodeURI(e.hash),this._element);O(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(Ri),this._activateParents(t),v.trigger(this._element,Hi,{relatedTarget:t}))}_activateParents(t){if(t.classList.contains("dropdown-item"))q.findOne(".dropdown-toggle",t.closest(".dropdown")).classList.add(Ri);else for(const e of q.parents(t,".nav, .list-group"))for(const t of q.prev(e,Vi))t.classList.add(Ri)}_clearActiveClass(t){t.classList.remove(Ri);const e=q.find(`${Wi}.${Ri}`,t);for(const t of e)t.classList.remove(Ri)}}v.on(window,qi,()=>{for(const t of q.find('[data-bs-spy="scroll"]'))Ui.getOrCreateInstance(t)});const Gi=".bs.tab",Ji=`hide${Gi}`,Zi=`hidden${Gi}`,Qi=`show${Gi}`,ts=`shown${Gi}`,es=`click${Gi}`,is=`keydown${Gi}`,ss=`load${Gi}`,ns="ArrowLeft",os="ArrowRight",rs="ArrowUp",as="ArrowDown",ls="Home",cs="End",hs="active",ds="fade",us="show",_s=".dropdown-toggle",gs=`:not(${_s})`,ms='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',ps=`.nav-link${gs}, .list-group-item${gs}, [role="tab"]${gs}, ${ms}`,fs=`.${hs}[data-bs-toggle="tab"], .${hs}[data-bs-toggle="pill"], .${hs}[data-bs-toggle="list"]`;class bs extends H{constructor(t){super(t),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),v.on(this._element,is,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?v.trigger(e,Ji,{relatedTarget:t}):null;v.trigger(t,Qi,{relatedTarget:e}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(e,t),this._activate(t,e))}_activate(t,e){t&&(t.classList.add(hs),this._activate(q.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.removeAttribute("tabindex"),t.setAttribute("aria-selected",!0),this._toggleDropDown(t,!0),v.trigger(t,ts,{relatedTarget:e})):t.classList.add(us)},t,t.classList.contains(ds)))}_deactivate(t,e){t&&(t.classList.remove(hs),t.blur(),this._deactivate(q.getElementFromSelector(t)),this._queueCallback(()=>{"tab"===t.getAttribute("role")?(t.setAttribute("aria-selected",!1),t.setAttribute("tabindex","-1"),this._toggleDropDown(t,!1),v.trigger(t,Zi,{relatedTarget:e})):t.classList.remove(us)},t,t.classList.contains(ds)))}_keydown(t){if(![ns,os,rs,as,ls,cs].includes(t.key))return;t.stopPropagation(),t.preventDefault();const e=this._getChildren().filter(t=>!D(t));let i;if([ls,cs].includes(t.key))i=e[t.key===ls?0:e.length-1];else{const s=[os,as].includes(t.key);i=j(e,t.target,s,!0)}i&&(i.focus({preventScroll:!0}),bs.getOrCreateInstance(i).show())}_getChildren(){return q.find(ps,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=q.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 s=(t,s)=>{const n=q.findOne(t,i);n&&n.classList.toggle(s,e)};s(_s,hs),s(".dropdown-menu",us),i.setAttribute("aria-expanded",e)}_setAttributeIfNotExists(t,e,i){t.hasAttribute(e)||t.setAttribute(e,i)}_elemIsActive(t){return t.classList.contains(hs)}_getInnerElement(t){return t.matches(ps)?t:q.findOne(ps,t)}_getOuterElement(t){return t.closest(".nav-item, .list-group-item")||t}}v.on(document,es,ms,function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),D(this)||bs.getOrCreateInstance(this).show()}),v.on(window,ss,()=>{for(const t of q.find(fs))bs.getOrCreateInstance(t)});const vs=".bs.toast",ys=`mouseover${vs}`,ws=`mouseout${vs}`,As=`focusin${vs}`,Es=`focusout${vs}`,Ts=`hide${vs}`,Cs=`hidden${vs}`,ks=`show${vs}`,Ss=`shown${vs}`,Ls="hide",$s="show",Os="showing",Ds={animation:"boolean",autohide:"boolean",delay:"number"},Ns={animation:!0,autohide:!0,delay:5e3};class Is extends H{constructor(t,e){super(t,e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Ns}static get DefaultType(){return Ds}static get NAME(){return"toast"}show(){v.trigger(this._element,ks).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(Ls),P(this._element),this._element.classList.add($s,Os),this._queueCallback(()=>{this._element.classList.remove(Os),v.trigger(this._element,Ss),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(v.trigger(this._element,Ts).defaultPrevented||(this._element.classList.add(Os),this._queueCallback(()=>{this._element.classList.add(Ls),this._element.classList.remove(Os,$s),v.trigger(this._element,Cs)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove($s),super.dispose()}isShown(){return this._element.classList.contains($s)}_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(){v.on(this._element,ys,t=>this._onInteraction(t,!0)),v.on(this._element,ws,t=>this._onInteraction(t,!1)),v.on(this._element,As,t=>this._onInteraction(t,!0)),v.on(this._element,Es,t=>this._onInteraction(t,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}}return R(Is),{Alert:X,Button:U,Carousel:$t,Collapse:Rt,Dropdown:ge,Modal:Ue,Offcanvas:_i,Popover:class extends Pi{static get Default(){return Fi}static get DefaultType(){return ji}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[xi]:this._getTitle(),[Mi]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}},ScrollSpy:Ui,Tab:bs,Toast:Is,Tooltip:Pi}});
|
|
//# sourceMappingURL=bootstrap.min.js.map
|