diff --git a/dist/bootstrap-native-v4.js b/dist/bootstrap-native-v4.js index 5d31fe7a..9b11abe3 100644 --- a/dist/bootstrap-native-v4.js +++ b/dist/bootstrap-native-v4.js @@ -84,7 +84,8 @@ clientWidth = 'clientWidth', clientHeight = 'clientHeight', offsetWidth = 'offsetWidth', offsetHeight = 'offsetHeight', innerWidth = 'innerWidth', innerHeight = 'innerHeight', - scrollHeight = 'scrollHeight', height = 'height', + scrollHeight = 'scrollHeight', scrollWidth = 'scrollWidth', + height = 'height', // aria ariaExpanded = 'aria-expanded', @@ -259,16 +260,18 @@ x : globalObject.pageXOffset || HTML[scrollLeft] } }, - styleTip = function(link,element,position,parent) { // both popovers and tooltips (target,tooltip,placement,elementToAppendTo) + styleTip = function(link, element, position, parentObject) { // both popovers and tooltips (target,tooltip,placement,elementToAppendTo) var elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] }, - windowOverflow = (HTML[offsetHeight] !== HTML.scrollHeight || HTML[offsetWidth] !== HTML.scrollWidth) - || (parent[offsetWidth] !== parent.scrollWidth || parent[offsetHeight] !== parent.scrollHeight), - parentStyle = globalObject[getComputedStyle](link[parentNode]), - parentIsCenterAligned = parentStyle.alignItems === 'center' && parentStyle.justifyContent === 'center' && parentStyle.display === 'flex', - windowWidth = HTML[offsetWidth], - windowHeight = HTML[offsetHeight], + parentIsBody = parentObject[parentNode] === DOC[body], + windowOverflow = parentIsBody ? (parentObject[parentNode+offsetHeight] !== parentObject[parentNode+clientHeight] || parentObject[parentNode+offsetWidth] !== parentObject[parentNode+clientWidth]) + : (parentObject[offsetHeight] !== parentObject[clientHeight] || parentObject[offsetWidth] !== parentObject[clientWidth]), + linkParentStyle = globalObject[getComputedStyle](link[parentNode]), + parentIsCenterAligned = linkParentStyle.alignItems === 'center' && linkParentStyle.justifyContent === 'center' && linkParentStyle.display === 'flex', + windowWidth = parentObject[parentNode+clientWidth], + windowHeight = parentObject[parentNode+clientHeight], rect = link[getBoundingClientRect](), - scroll = parent === DOC[body] ? getScroll() : { x: parent[offsetLeft] + parent[scrollLeft], y: parent[offsetTop] + parent[scrollTop] }, + scroll = parentIsBody ? getScroll() : { x: parentObject[offsetLeft] + parentObject[scrollLeft], + y: parentObject[offsetTop] + parentObject[scrollTop] }, linkDimensions = { w: rect[right] - rect[left], h: rect[bottom] - rect[top] }, isPopover = hasClass(element,'popover'), topPosition, leftPosition, @@ -331,7 +334,7 @@ leftPosition = windowWidth - elementDimensions.w*1.01; arrowLeft = elementDimensions.w - ( windowWidth - rect[left] ) + linkDimensions.w/2 - arrowWidth/2; } else { - leftPosition = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + ( !isPopover && parentIsCenterAligned && windowOverflow ? arrowWidth/2 : 0 ); + leftPosition = rect[left] + scroll.x - elementDimensions.w/2 + linkDimensions.w/2 + ( !isPopover && parentIsCenterAligned && !windowOverflow ? arrowWidth/2 : 0 ); arrowLeft = elementDimensions.w/2 - ( isPopover ? arrowWidth : arrowWidth/2 ); } } @@ -1357,7 +1360,7 @@ if ( !contentString && !this[template] ) return; // invalidate // constants, vars - var popover = null, timer = 0, placementSetting = this[placement], + var popover = null, timer = 0, placementSetting = this[placement], parentObject = {}, // handlers dismissibleHandler = function(e) { @@ -1388,6 +1391,21 @@ popover[setAttribute]('role','tooltip'); + // for some reason the parent dimensions are skewed when tooltip is shown + parentObject[parentNode] = self[container]; + parentObject[offsetLeft] = self[container][offsetLeft]; + parentObject[offsetTop] = self[container][offsetTop]; + parentObject[offsetWidth] = self[container][offsetWidth]; + parentObject[offsetHeight] = self[container][offsetHeight]; + parentObject[clientWidth] = self[container][clientWidth]; + parentObject[clientHeight] = self[container][clientHeight]; + parentObject[scrollLeft] = self[container][scrollLeft]; + parentObject[scrollTop] = self[container][scrollTop]; + parentObject[parentNode+offsetWidth] = HTML[offsetWidth]; + parentObject[parentNode+offsetHeight] = HTML[offsetHeight]; + parentObject[parentNode+clientWidth] = HTML[clientWidth]; + parentObject[parentNode+clientHeight] = HTML[clientHeight]; + if (titleString !== null) { var popoverTitle = DOC[createElement]('h3'); popoverTitle[setAttribute](classString,component+'-header'); @@ -1418,7 +1436,7 @@ !hasClass(popover,showClass) && ( addClass(popover,showClass) ); }, updatePopover = function() { - styleTip(element,popover,placementSetting,self[container]); + styleTip(element, popover, placementSetting, parentObject); }, // event toggle @@ -1882,8 +1900,8 @@ : modal ? modal : DOC[body]; // bind, event targets, title and constants - var self = this, timer = 0, placementSetting = this[placement], tooltip = null, - titleString = element[getAttribute](title) || element[getAttribute](dataTitle) || element[getAttribute](dataOriginalTitle); + var self = this, timer = 0, placementSetting = this[placement], tooltip = null, parentObject = {}, + titleString = element[getAttribute](title) || element[getAttribute](dataTitle) || element[getAttribute](dataOriginalTitle); if ( !titleString || titleString == "" ) return; // invalidate @@ -1894,25 +1912,42 @@ }, createToolTip = function() { titleString = element[getAttribute](title) || element[getAttribute](dataTitle) || element[getAttribute](dataOriginalTitle); // read the title again - if ( !titleString || titleString == "" ) return false; // invalidate - tooltip = DOC[createElement](div); - tooltip[setAttribute]('role',component); - - // tooltip arrow - var tooltipArrow = DOC[createElement](div); - tooltipArrow[setAttribute](classString,'arrow'); - tooltip[appendChild](tooltipArrow); - - var tooltipInner = DOC[createElement](div); - tooltipInner[setAttribute](classString,component+'-inner'); - tooltip[appendChild](tooltipInner); - tooltipInner[innerHTML] = titleString; - self[container][appendChild](tooltip); - tooltip[setAttribute](classString, component + ' bs-' + component+'-'+placementSetting + ' ' + self[animation]); + // for some reason the parent dimensions are skewed when tooltip is shown + parentObject[parentNode] = self[container]; + parentObject[offsetLeft] = self[container][offsetLeft]; + parentObject[offsetTop] = self[container][offsetTop]; + parentObject[offsetWidth] = self[container][offsetWidth]; + parentObject[offsetHeight] = self[container][offsetHeight]; + parentObject[clientWidth] = self[container][clientWidth]; + parentObject[clientHeight] = self[container][clientHeight]; + parentObject[scrollLeft] = self[container][scrollLeft]; + parentObject[scrollTop] = self[container][scrollTop]; + parentObject[parentNode+offsetWidth] = HTML[offsetWidth]; + parentObject[parentNode+offsetHeight] = HTML[offsetHeight]; + parentObject[parentNode+clientWidth] = HTML[clientWidth]; + parentObject[parentNode+clientHeight] = HTML[clientHeight]; + + if ( titleString && titleString !== "" ) { // invalidate, maybe markup changed + tooltip = DOC[createElement](div); + tooltip[setAttribute]('role',component); + + // tooltip arrow + var tooltipArrow = DOC[createElement](div); + tooltipArrow[setAttribute](classString,'arrow'); + tooltip[appendChild](tooltipArrow); + + var tooltipInner = DOC[createElement](div); + tooltipInner[setAttribute](classString,component+'-inner'); + tooltip[appendChild](tooltipInner); + tooltipInner[innerHTML] = titleString; + + self[container][appendChild](tooltip); + tooltip[setAttribute](classString, component + ' bs-' + component+'-'+placementSetting + ' ' + self[animation]); + } }, updateTooltip = function () { - styleTip(element,tooltip,placementSetting,self[container]); + styleTip(element, tooltip, placementSetting, parentObject); }, showTooltip = function () { !hasClass(tooltip,showClass) && ( addClass(tooltip,showClass) ); @@ -1934,11 +1969,13 @@ timer = setTimeout( function() { if (tooltip === null) { placementSetting = self[placement]; // we reset placement in all cases - if(createToolTip() == false) return; - updateTooltip(); - showTooltip(); - bootstrapCustomEvent.call(element, showEvent, component); - !!self[animation] ? emulateTransitionEnd(tooltip, showTrigger) : showTrigger(); + // if(createToolTip() == false) return; + if(createToolTip() !== false) { + updateTooltip(); + showTooltip(); + bootstrapCustomEvent.call(element, showEvent, component); + !!self[animation] ? emulateTransitionEnd(tooltip, showTrigger) : showTrigger(); + } } }, 20 ); }; diff --git a/dist/bootstrap-native-v4.min.js b/dist/bootstrap-native-v4.min.js index 304fb966..9cfc1924 100644 --- a/dist/bootstrap-native-v4.min.js +++ b/dist/bootstrap-native-v4.min.js @@ -1,2 +1,2 @@ // Native Javascript for Bootstrap 4 v2.0.27 | © dnp_theme | MIT-License -!function(t,e){if("function"==typeof define&&define.amd)define([],e);else if("object"==typeof module&&module.exports)module.exports=e();else{var i=e();t.Alert=i.Alert,t.Button=i.Button,t.Carousel=i.Carousel,t.Collapse=i.Collapse,t.Dropdown=i.Dropdown,t.Modal=i.Modal,t.Popover=i.Popover,t.ScrollSpy=i.ScrollSpy,t.Tab=i.Tab,t.Toast=i.Toast,t.Tooltip=i.Tooltip}}(this,function(){"use strict";var t="undefined"!=typeof global?global:this||window,e=document,i=e.documentElement,n="body",o=t.BSN={},a=o.supports=[],l="data-toggle",s="delay",r="target",c="animation",d="onmouseleave"in e?["mouseenter","mouseleave"]:["mouseover","mouseout"],u={start:"touchstart",end:"touchend",move:"touchmove"},h="getAttribute",f="setAttribute",p="parentNode",g="length",m="Transition",v="Webkit",w="style",b="push",T="active",y="left",k="top",C=/\b(top|bottom|left|right)+/,A=0,x=v+m in i[w]||m.toLowerCase()in i[w],E=v+m in i[w]?v.toLowerCase()+m+"End":m.toLowerCase()+"end",L=v+"Duration"in i[w]?v.toLowerCase()+m+"Duration":m.toLowerCase()+"Duration",N=function(t){t.focus?t.focus():t.setActive()},I=function(t,e){t.classList.add(e)},H=function(t,e){t.classList.remove(e)},B=function(t,e){return t.classList.contains(e)},D=function(t,e){return[].slice.call(t.getElementsByClassName(e))},M=function(t,i){var n=i||e;return"object"==typeof t?t:n.querySelector(t)},S=function(t,i){var n=i.charAt(0),o=i.substr(1);if("."===n){for(;t&&t!==e;t=t[p])if(null!==M(i,t[p])&&B(t,o))return t}else if("#"===n)for(;t&&t!==e;t=t[p])if(t.id===o)return t;return!1},W=function(t,e,i,n){n=n||!1,t.addEventListener(e,i,n)},P=function(t,e,i,n){n=n||!1,t.removeEventListener(e,i,n)},R=function(t,e,i,n){W(t,e,function o(a){i(a),P(t,e,o,n)},n)},O=function(){var e=!1;try{var i=Object.defineProperty({},"passive",{get:function(){e=!0}});R(t,"testPassive",null,i)}catch(t){}return e}(),z=!!O&&{passive:!0},j=function(e){var i=x?t.getComputedStyle(e)[L]:0;return i=parseFloat(i),i="number"!=typeof i||isNaN(i)?0:1e3*i},X=function(t,e){var i=0;j(t)?R(t,E,function(t){!i&&e(t),i=1}):setTimeout(function(){!i&&e(),i=1},17)},U=function(t,e,i){var n=new CustomEvent(t+".bs."+e);n.relatedTarget=i,this.dispatchEvent(n)},q=function(){return{y:t.pageYOffset||i.scrollTop,x:t.pageXOffset||i.scrollLeft}},Y=function(o,a,l,s){var r,c,d,u,h,f,g={w:a.offsetWidth,h:a.offsetHeight},m=i.offsetHeight!==i.scrollHeight||i.offsetWidth!==i.scrollWidth||s.offsetWidth!==s.scrollWidth||s.offsetHeight!==s.scrollHeight,v=t.getComputedStyle(o[p]),b="center"===v.alignItems&&"center"===v.justifyContent&&"flex"===v.display,T=i.offsetWidth,A=i.offsetHeight,x=o.getBoundingClientRect(),E=s===e[n]?q():{x:s.offsetLeft+s.scrollLeft,y:s.offsetTop+s.scrollTop},L={w:x.right-x[y],h:x.bottom-x[k]},N=B(a,"popover"),I=M(".arrow",a),H=x[k]+L.h/2-g.h/2<0,D=x[y]+L.w/2-g.w/2<0,S=x[y]+g.w/2+L.w/2>=T,W=x[k]+g.h/2+L.h/2>=A,P=x[k]-g.h<0,R=x[y]-g.w<0,O=x[k]+g.h+L.h>=A,z=x[y]+g.w+L.w>=T;l=(l===y||"right"===l)&&R&&z?k:l,l=l===k&&P?"bottom":l,l="bottom"===l&&O?k:l,l=l===y&&R?"right":l,l="right"===l&&z?y:l,-1===a.className.indexOf(l)&&(a.className=a.className.replace(C,l)),h=I.offsetWidth,f=I.offsetHeight,l===y||"right"===l?(c=l===y?x[y]+E.x-g.w-(N?h:0):x[y]+E.x+L.w,H?(r=x[k]+E.y,d=L.h/2-h):W?(r=x[k]+E.y-g.h+L.h,d=g.h-L.h/2-h):(r=x[k]+E.y-g.h/2+L.h/2,d=g.h/2-(N?.9*f:f/2))):l!==k&&"bottom"!==l||(r=l===k?x[k]+E.y-g.h-(N?f:0):x[k]+E.y+L.h,D?(c=0,u=x[y]+L.w/2-h):S?(c=T-1.01*g.w,u=g.w-(T-x[y])+L.w/2-h/2):(c=x[y]+E.x-g.w/2+L.w/2+(!N&&b&&m?h/2:0),u=g.w/2-(N?h:h/2))),a[w][k]=r+"px",a[w][y]=c+"px",d&&(I[w][k]=d+"px"),u&&(I[w][y]=u+"px")};o.version="2.0.27";var F=function(t){t=M(t);var e=this,i=S(t,".alert"),n=function(){B(i,"fade")?X(i,a):a()},o=function(n){i=S(n[r],".alert"),(t=M('[data-dismiss="alert"]',i))&&i&&(t===n[r]||t.contains(n[r]))&&e.close()},a=function(){U.call(i,"closed","alert"),P(t,"click",o),i[p].removeChild(i)};this.close=function(){i&&t&&B(i,"show")&&(U.call(i,"close","alert"),H(i,"show"),i&&n())},"Alert"in t||W(t,"click",o),t.Alert=e};a[b](["Alert",F,'[data-dismiss="alert"]']);var G=function(t){t=M(t);var i=!1,n="checked",o=function(t){32===(t.which||t.keyCode)&&t[r]===e.activeElement&&l(t)},a=function(t){32===(t.which||t.keyCode)&&t.preventDefault()},l=function(e){var o="LABEL"===e[r].tagName?e[r]:"LABEL"===e[r][p].tagName?e[r][p]:null;if(o){var a=D(o[p],"btn"),l=o.getElementsByTagName("INPUT")[0];if(l){if("checkbox"===l.type&&(l[n]?(H(o,T),l[h](n),l.removeAttribute(n),l[n]=!1):(I(o,T),l[h](n),l[f](n,n),l[n]=!0),i||(i=!0,U.call(l,"change","button"),U.call(t,"change","button"))),"radio"===l.type&&!i&&(!l[n]||0===e.screenX&&0==e.screenY)){I(o,T),I(o,"focus"),l[f](n,n),l[n]=!0,U.call(l,"change","button"),U.call(t,"change","button"),i=!0;for(var s=0,c=a[g];s1?(t.preventDefault(),!1):void 0):void t.preventDefault()},$=function(t){if(b&&!w&&(E=A||parseInt(t.touches[0].pageX),b)){if((!n.contains(t[r])||!n.contains(t.relatedTarget))&&Math.abs(C-E)<75)return!1;AC&&m--,b=!1,p.slideTo(m),Q(P)}},_=function(){var e=n.getBoundingClientRect(),o=t.innerHeight||i.clientHeight;return e[k]<=o&&e.bottom>=0},tt=function(t){for(var e=0,i=q[g];et||o===N-1&&0===t)&&(S=p.direction="right"),t<0?t=N-1:t>=N&&(t=0),m=t,i=S===y?"next":"prev",U.call(n,"slide","carousel",L[t]),w=!0,clearInterval(v),v=null,tt(t),x&&B(n,"slide")?(I(L[t],"carousel-item-"+i),L[t].offsetWidth,I(L[t],"carousel-item-"+S),I(L[o],"carousel-item-"+S),X(L[t],function(a){var l=a&&a[r]!==L[t]?1e3*a.elapsedTime+100:20;w&&setTimeout(function(){w=!1,I(L[t],T),H(L[o],T),H(L[t],"carousel-item-"+i),H(L[t],"carousel-item-"+S),H(L[o],"carousel-item-"+S),U.call(n,"slid","carousel",L[t]),e.hidden||!p.interval||B(n,"paused")||p.cycle()},l)})):(I(L[t],T),L[t].offsetWidth,H(L[o],T),setTimeout(function(){w=!1,p.interval&&!B(n,"paused")&&p.cycle(),U.call(n,"slid","carousel",L[t])},100)))}},this.getActiveIndex=function(){return L.indexOf(D(n,"carousel-item active")[0])||0},"Carousel"in n||(p.pause&&p.interval&&(W(n,d[0],Y),W(n,d[1],F),W(n,u.start,Y,z),W(n,u.end,F,z)),L[g]>1&&W(n,u.start,V,z),O&&W(O,"click",J),R&&W(R,"click",J),j&&W(j,"click",G),p.keyboard&&W(t,"keydown",K)),p.getActiveIndex()<0&&(L[g]&&I(L[0],T),q[g]&&tt(0)),p.interval&&p.cycle(),n.Carousel=p}};a[b](["Carousel",J,'[data-ride="carousel"]']);var K=function(t,e){t=M(t),e=e||{};var i,n,o=null,a=null,l=this,s=t[h]("data-parent"),r=function(t,e){U.call(t,"show","collapse"),t.isAnimating=!0,I(t,"collapsing"),H(t,"collapse"),t[w].height=t.scrollHeight+"px",X(t,function(){t.isAnimating=!1,t[f]("aria-expanded","true"),e[f]("aria-expanded","true"),H(t,"collapsing"),I(t,"collapse"),I(t,"show"),t[w].height="",U.call(t,"shown","collapse")})},c=function(t,e){U.call(t,"hide","collapse"),t.isAnimating=!0,t[w].height=t.scrollHeight+"px",H(t,"collapse"),H(t,"show"),I(t,"collapsing"),t.offsetWidth,t[w].height="0px",X(t,function(){t.isAnimating=!1,t[f]("aria-expanded","false"),e[f]("aria-expanded","false"),H(t,"collapsing"),I(t,"collapse"),t[w].height="",U.call(t,"hidden","collapse")})};this.toggle=function(t){t.preventDefault(),B(a,"show")?l.hide():l.show()},this.hide=function(){a.isAnimating||(c(a,t),I(t,"collapsed"))},this.show=function(){o&&(i=M(".collapse.show",o),n=i&&(M('[data-target="#'+i.id+'"]',o)||M('[href="#'+i.id+'"]',o))),(!a.isAnimating||i&&!i.isAnimating)&&(n&&i!==a&&(c(i,n),I(n,"collapsed")),r(a,t),H(t,"collapsed"))},"Collapse"in t||W(t,"click",l.toggle),a=function(){var e=t.href&&t[h]("href"),i=t[h]("data-target"),n=e||i&&"#"===i.charAt(0)&&i;return n&&M(n)}(),a.isAnimating=!1,o=M(e.parent)||s&&S(t,s),t.Collapse=l};a[b](["Collapse",K,'[data-toggle="collapse"]']);var Q=function(t,i){t=M(t),this.persist=!0===i||"true"===t[h]("data-persist")||!1;var n=this,o=t[p],a=null,s=M(".dropdown-menu",o),c=function(){for(var t=s.children,e=[],i=0;i1?r-1:0:40===o&&r×',b=M(o.container),T=M(m),y=S(i,".modal"),C=S(i,".fixed-top"),A=S(i,".fixed-bottom");this.template=o.template?o.template:null,this.trigger=o.trigger?o.trigger:a||"hover",this[c]=o[c]&&"fade"!==o[c]?o[c]:l||"fade",this.placement=o.placement?o.placement:u||k,this[s]=parseInt(o[s]||g)||200,this.dismissible=!(!o.dismissible&&"true"!==p),this.container=b||(T||(C||(A||(y||e[n]))));var x=this,E=o.title||i[h]("data-title")||null,L=o.content||i[h]("data-content")||null;if(L||this.template){var N=null,D=0,R=this.placement,O=function(t){null!==N&&t[r]===M(".close",N)&&x.hide()},j=function(){x.container.removeChild(N),D=null,N=null},q=function(){E=o.title||i[h]("data-title"),L=o.content||i[h]("data-content"),L=L?L.trim():null,N=e.createElement("div");var t=e.createElement("div");if(t[f]("class","arrow"),N.appendChild(t),null!==L&&null===x.template){if(N[f]("role","tooltip"),null!==E){var n=e.createElement("h3");n[f]("class","popover-header"),n.innerHTML=x.dismissible?E+v:E,N.appendChild(n)}var a=e.createElement("div");a[f]("class","popover-body"),a.innerHTML=x.dismissible&&null===E?L+v:L,N.appendChild(a)}else{var l=e.createElement("div");x.template=x.template.trim(),l.innerHTML=x.template,N.innerHTML=l.firstChild.innerHTML}x.container.appendChild(N),N[w].display="block",N[f]("class","popover bs-popover-"+R+" "+x[c])},F=function(){!B(N,"show")&&I(N,"show")},G=function(){Y(i,N,R,x.container)},J=function(n){"click"!=x.trigger&&"focus"!=x.trigger||!x.dismissible&&n(i,"blur",x.hide),x.dismissible&&n(e,"click",O),n(t,"resize",x.hide,z)},K=function(){J(W),U.call(i,"shown","popover")},Q=function(){J(P),j(),U.call(i,"hidden","popover")};this.toggle=function(){null===N?x.show():x.hide()},this.show=function(){clearTimeout(D),D=setTimeout(function(){null===N&&(R=x.placement,q(),G(),F(),U.call(i,"show","popover"),x[c]?X(N,K):K())},20)},this.hide=function(){clearTimeout(D),D=setTimeout(function(){N&&null!==N&&B(N,"show")&&(U.call(i,"hide","popover"),H(N,"show"),x[c]?X(N,Q):Q())},x[s])},"Popover"in i||("hover"===x.trigger?(W(i,d[0],x.show),x.dismissible||W(i,d[1],x.hide)):"click"!=x.trigger&&"focus"!=x.trigger||W(i,x.trigger,x.toggle)),i.Popover=x}};a[b](["Popover",Z,'[data-toggle="popover"]']);var $=function(e,i){e=M(e);var n=M(e[h]("data-target")),o=e[h]("data-offset");if(i=i||{},i[r]||n){for(var a,l=this,s=i[r]&&M(i[r])||n,c=s&&s.getElementsByTagName("A"),d=parseInt(i.offset||o)||10,u=[],f=[],m=e.offsetHeight=c&&h>a;if(!r&&g)B(i,T)||(I(i,T),l&&!B(l,T)&&I(l,T),U.call(e,"activate","scrollspy",u[t]));else if(g){if(!g&&!r||r&&g)return}else B(i,T)&&(H(i,T),l&&B(l,T)&&!D(i[p],T).length&&H(l,T))},E=function(){a=v?q().y:e.scrollTop;for(var t=0,i=u[g];t1&&(t=e[e[g]-1]):t=e[0],t},E=function(){return M(A()[h]("href"))},L=function(t){t.preventDefault(),n=t.currentTarget,!u.isAnimating&&!B(n,T)&&d.show()};this.show=function(){n=n||t,l=M(n[h]("href")),o=A(),a=E(),u.isAnimating=!0,H(o,T),o[f]("aria-selected","false"),I(n,T),n[f]("aria-selected","true"),v&&(B(t[p],"dropdown-menu")?B(v,T)||I(v,T):B(v,T)&&H(v,T)),U.call(o,"hide","tab",n),B(a,"fade")?(H(a,"show"),X(a,C)):C()},"Tab"in t||W(t,"click",L),d.height&&(m=E()[p]),t.Tab=d}};a[b](["Tab",_,'[data-toggle="tab"]']);var tt=function(t,e){t=M(t),e=e||{};var i=t[h]("data-animation"),n=t[h]("data-autohide"),o=t[h]("data-delay");this.animation=!1===e.animation||"false"===i?0:1,this.autohide=!1===e.autohide||"false"===n?0:1,this[s]=parseInt(e[s]||o)||500;var a=this,l=0,r=S(t,".toast"),c=function(){H(r,"showing"),I(r,"show"),U.call(r,"shown","toast"),a.autohide&&a.hide()},d=function(){I(r,"hide"),U.call(r,"hidden","toast")},u=function(){H(r,"show"),a.animation?X(r,d):d()},f=function(){clearTimeout(l),l=null,I(r,"hide"),P(t,"click",a.hide),t.Toast=null,t=null,r=null};this.show=function(){r&&(U.call(r,"show","toast"),a.animation&&I(r,"fade"),H(r,"hide"),I(r,"showing"),a.animation?X(r,c):c())},this.hide=function(t){r&&B(r,"show")&&(U.call(r,"hide","toast"),t?u():l=setTimeout(u,a[s]))},this.dispose=function(){r&&B(r,"show")&&(H(r,"show"),a.animation?X(r,f):f())},"Toast"in t||W(t,"click",a.hide),t.Toast=a};a[b](["Toast",tt,'[data-dismiss="toast"]']);var et=function(i,o){i=M(i),o=o||{};var a=i[h]("data-animation"),l=i[h]("data-placement"),r=i[h]("data-delay"),u=i[h]("data-container"),p=M(o.container),g=M(u),m=S(i,".modal"),v=S(i,".fixed-top"),w=S(i,".fixed-bottom");this[c]=o[c]&&"fade"!==o[c]?o[c]:a||"fade",this.placement=o.placement?o.placement:l||k,this[s]=parseInt(o[s]||r)||200,this.container=p||(g||(v||(w||(m||e[n]))));var b=this,T=0,y=this.placement,C=null,A=i[h]("title")||i[h]("data-title")||i[h]("data-original-title");if(A&&""!=A){var x=function(){b.container.removeChild(C),C=null,T=null},E=function(){if(!(A=i[h]("title")||i[h]("data-title")||i[h]("data-original-title"))||""==A)return!1;C=e.createElement("div"),C[f]("role","tooltip");var t=e.createElement("div");t[f]("class","arrow"),C.appendChild(t);var n=e.createElement("div");n[f]("class","tooltip-inner"),C.appendChild(n),n.innerHTML=A,b.container.appendChild(C),C[f]("class","tooltip bs-tooltip-"+y+" "+b[c])},L=function(){Y(i,C,y,b.container)},N=function(){!B(C,"show")&&I(C,"show")},D=function(){W(t,"resize",b.hide,z),U.call(i,"shown","tooltip")},R=function(){P(t,"resize",b.hide,z),x(),U.call(i,"hidden","tooltip")};this.show=function(){clearTimeout(T),T=setTimeout(function(){if(null===C){if(y=b.placement,0==E())return;L(),N(),U.call(i,"show","tooltip"),b[c]?X(C,D):D()}},20)},this.hide=function(){clearTimeout(T),T=setTimeout(function(){C&&B(C,"show")&&(U.call(i,"hide","tooltip"),H(C,"show"),b[c]?X(C,R):R())},b[s])},this.toggle=function(){C?b.hide():b.show()},"Tooltip"in i||(i[f]("data-original-title",A),i.removeAttribute("title"),W(i,d[0],b.show),W(i,d[1],b.hide)),i.Tooltip=b}};a[b](["Tooltip",et,'[data-toggle="tooltip"]']);var it=function(t,e){for(var i=0,n=e[g];i=y,P=H[A]+p.h/2+L.h/2>=k,R=H[A]-p.h<0,O=H[C]-p.w<0,z=H[A]+p.h+L.h>=k,j=H[C]+p.w+L.w>=y;a=(a===C||"right"===a)&&O&&j?A:a,a=a===A&&R?"bottom":a,a="bottom"===a&&z?A:a,a=a===C&&O?"right":a,a="right"===a&&j?C:a,-1===o.className.indexOf(a)&&(o.className=o.className.replace(x,a)),h=I[u],f=I.offsetHeight,a===C||"right"===a?(r=a===C?H[C]+N.x-p.w-(E?h:0):H[C]+N.x+L.w,B?(s=H[A]+N.y,c=L.h/2-h):P?(s=H[A]+N.y-p.h+L.h,c=p.h-L.h/2-h):(s=H[A]+N.y-p.h/2+L.h/2,c=p.h/2-(E?.9*f:f/2))):a!==A&&"bottom"!==a||(s=a===A?H[A]+N.y-p.h-(E?f:0):H[A]+N.y+L.h,D?(r=0,d=H[C]+L.w/2-h):S?(r=y-1.01*p.w,d=p.w-(y-H[C])+L.w/2-h/2):(r=H[C]+N.x-p.w/2+L.w/2+(E||!b||v?0:h/2),d=p.w/2-(E?h:h/2))),o[T][A]=s+"px",o[T][C]=r+"px",c&&(I[T][A]=c+"px"),d&&(I[T][C]=d+"px")};o.version="2.0.27";var J=function(t){t=W(t);var e=this,i=P(t,".alert"),n=function(){M(i,"fade")?q(i,a):a()},o=function(n){i=P(n[r],".alert"),(t=W('[data-dismiss="alert"]',i))&&i&&(t===n[r]||t.contains(n[r]))&&e.close()},a=function(){Y.call(i,"closed","alert"),O(t,"click",o),i[m].removeChild(i)};this.close=function(){i&&t&&M(i,"show")&&(Y.call(i,"close","alert"),D(i,"show"),i&&n())},"Alert"in t||R(t,"click",o),t.Alert=e};a[y](["Alert",J,'[data-dismiss="alert"]']);var K=function(t){t=W(t);var i=!1,n="checked",o=function(t){32===(t.which||t.keyCode)&&t[r]===e.activeElement&&l(t)},a=function(t){32===(t.which||t.keyCode)&&t.preventDefault()},l=function(e){var o="LABEL"===e[r].tagName?e[r]:"LABEL"===e[r][m].tagName?e[r][m]:null;if(o){var a=S(o[m],"btn"),l=o.getElementsByTagName("INPUT")[0];if(l){if("checkbox"===l.type&&(l[n]?(D(o,k),l[p](n),l.removeAttribute(n),l[n]=!1):(B(o,k),l[p](n),l[g](n,n),l[n]=!0),i||(i=!0,Y.call(l,"change","button"),Y.call(t,"change","button"))),"radio"===l.type&&!i&&(!l[n]||0===e.screenX&&0==e.screenY)){B(o,k),B(o,"focus"),l[g](n,n),l[n]=!0,Y.call(l,"change","button"),Y.call(t,"change","button"),i=!0;for(var s=0,c=a[v];s1?(t.preventDefault(),!1):void 0):void t.preventDefault()},_=function(t){if(T&&!b&&(H=x||parseInt(t.touches[0].pageX),T)){if((!n.contains(t[r])||!n.contains(t.relatedTarget))&&Math.abs(y-H)<75)return!1;xy&&m--,T=!1,g.slideTo(m),V(O)}},tt=function(){var e=n.getBoundingClientRect(),o=t.innerHeight||i.clientHeight;return e[A]<=o&&e.bottom>=0},et=function(t){for(var e=0,i=U[v];et||o===E-1&&0===t)&&(I=g.direction="right"),t<0?t=E-1:t>=E&&(t=0),m=t,i=I===C?"next":"prev",Y.call(n,"slide","carousel",L[t]),b=!0,clearInterval(w),w=null,et(t),N&&M(n,"slide")?(B(L[t],"carousel-item-"+i),L[t][u],B(L[t],"carousel-item-"+I),B(L[o],"carousel-item-"+I),q(L[t],function(a){var l=a&&a[r]!==L[t]?1e3*a.elapsedTime+100:20;b&&setTimeout(function(){b=!1,B(L[t],k),D(L[o],k),D(L[t],"carousel-item-"+i),D(L[t],"carousel-item-"+I),D(L[o],"carousel-item-"+I),Y.call(n,"slid","carousel",L[t]),e.hidden||!g.interval||M(n,"paused")||g.cycle()},l)})):(B(L[t],k),L[t][u],D(L[o],k),setTimeout(function(){b=!1,g.interval&&!M(n,"paused")&&g.cycle(),Y.call(n,"slid","carousel",L[t])},100)))}},this.getActiveIndex=function(){return L.indexOf(S(n,"carousel-item active")[0])||0},"Carousel"in n||(g.pause&&g.interval&&(R(n,h[0],F),R(n,h[1],G),R(n,f.start,F,X),R(n,f.end,G,X)),L[v]>1&&R(n,f.start,Z,X),z&&R(z,"click",K),P&&R(P,"click",K),j&&R(j,"click",J),g.keyboard&&R(t,"keydown",Q)),g.getActiveIndex()<0&&(L[v]&&B(L[0],k),U[v]&&et(0)),g.interval&&g.cycle(),n.Carousel=g}};a[y](["Carousel",Q,'[data-ride="carousel"]']);var V=function(t,e){t=W(t),e=e||{};var i,n,o=null,a=null,l=this,s=t[p]("data-parent"),r=function(t,e){Y.call(t,"show","collapse"),t.isAnimating=!0,B(t,"collapsing"),D(t,"collapse"),t[T].height=t.scrollHeight+"px",q(t,function(){t.isAnimating=!1,t[g]("aria-expanded","true"),e[g]("aria-expanded","true"),D(t,"collapsing"),B(t,"collapse"),B(t,"show"),t[T].height="",Y.call(t,"shown","collapse")})},c=function(t,e){Y.call(t,"hide","collapse"),t.isAnimating=!0,t[T].height=t.scrollHeight+"px",D(t,"collapse"),D(t,"show"),B(t,"collapsing"),t[u],t[T].height="0px",q(t,function(){t.isAnimating=!1,t[g]("aria-expanded","false"),e[g]("aria-expanded","false"),D(t,"collapsing"),B(t,"collapse"),t[T].height="",Y.call(t,"hidden","collapse")})};this.toggle=function(t){t.preventDefault(),M(a,"show")?l.hide():l.show()},this.hide=function(){a.isAnimating||(c(a,t),B(t,"collapsed"))},this.show=function(){o&&(i=W(".collapse.show",o),n=i&&(W('[data-target="#'+i.id+'"]',o)||W('[href="#'+i.id+'"]',o))),(!a.isAnimating||i&&!i.isAnimating)&&(n&&i!==a&&(c(i,n),B(n,"collapsed")),r(a,t),D(t,"collapsed"))},"Collapse"in t||R(t,"click",l.toggle),a=function(){var e=t.href&&t[p]("href"),i=t[p]("data-target"),n=e||i&&"#"===i.charAt(0)&&i;return n&&W(n)}(),a.isAnimating=!1,o=W(e.parent)||s&&P(t,s),t.Collapse=l};a[y](["Collapse",V,'[data-toggle="collapse"]']);var Z=function(t,i){t=W(t),this.persist=!0===i||"true"===t[p]("data-persist")||!1;var n=this,o=t[m],a=null,s=W(".dropdown-menu",o),c=function(){for(var t=s.children,e=[],i=0;i1?r-1:0:40===o&&r×',C=W(a[d]),x=W(y),H=P(o,".modal"),N=P(o,".fixed-top"),L=P(o,".fixed-bottom");this.template=a.template?a.template:null,this.trigger=a.trigger?a.trigger:l||"hover",this[c]=a[c]&&"fade"!==a[c]?a[c]:f||"fade",this.placement=a.placement?a.placement:v||A,this[s]=parseInt(a[s]||b)||200,this.dismissible=!(!a.dismissible&&"true"!==w),this[d]=C||(x||(N||(L||(H||e[n]))));var E=this,I=a.title||o[p]("data-title")||null,S=a.content||o[p]("data-content")||null;if(S||this.template){var z=null,j=0,U=this.placement,F={},J=function(t){null!==z&&t[r]===W(".close",z)&&E.hide()},K=function(){E[d].removeChild(z),j=null,z=null},Q=function(){I=a.title||o[p]("data-title"),S=a.content||o[p]("data-content"),S=S?S.trim():null,z=e.createElement("div");var t=e.createElement("div");if(t[g]("class","arrow"),z.appendChild(t),null!==S&&null===E.template){if(z[g]("role","tooltip"),F[m]=E[d],F.offsetLeft=E[d].offsetLeft,F.offsetTop=E[d].offsetTop,F[u]=E[d][u],F.offsetHeight=E[d].offsetHeight,F.clientWidth=E[d].clientWidth,F.clientHeight=E[d].clientHeight,F.scrollLeft=E[d].scrollLeft,F.scrollTop=E[d].scrollTop,F[m+u]=i[u],F.parentNodeoffsetHeight=i.offsetHeight,F.parentNodeclientWidth=i.clientWidth,F.parentNodeclientHeight=i.clientHeight,null!==I){var n=e.createElement("h3");n[g]("class","popover-header"),n.innerHTML=E.dismissible?I+k:I,z.appendChild(n)}var l=e.createElement("div");l[g]("class","popover-body"),l.innerHTML=E.dismissible&&null===I?S+k:S,z.appendChild(l)}else{var s=e.createElement("div");E.template=E.template.trim(),s.innerHTML=E.template,z.innerHTML=s.firstChild.innerHTML}E[d].appendChild(z),z[T].display="block",z[g]("class","popover bs-popover-"+U+" "+E[c])},V=function(){!M(z,"show")&&B(z,"show")},Z=function(){G(o,z,U,F)},$=function(i){"click"!=E.trigger&&"focus"!=E.trigger||!E.dismissible&&i(o,"blur",E.hide),E.dismissible&&i(e,"click",J),i(t,"resize",E.hide,X)},_=function(){$(R),Y.call(o,"shown","popover")},tt=function(){$(O),K(),Y.call(o,"hidden","popover")};this.toggle=function(){null===z?E.show():E.hide()},this.show=function(){clearTimeout(j),j=setTimeout(function(){null===z&&(U=E.placement,Q(),Z(),V(),Y.call(o,"show","popover"),E[c]?q(z,_):_())},20)},this.hide=function(){clearTimeout(j),j=setTimeout(function(){z&&null!==z&&M(z,"show")&&(Y.call(o,"hide","popover"),D(z,"show"),E[c]?q(z,tt):tt())},E[s])},"Popover"in o||("hover"===E.trigger?(R(o,h[0],E.show),E.dismissible||R(o,h[1],E.hide)):"click"!=E.trigger&&"focus"!=E.trigger||R(o,E.trigger,E.toggle)),o.Popover=E}};a[y](["Popover",_,'[data-toggle="popover"]']);var tt=function(e,i){e=W(e);var n=W(e[p]("data-target")),o=e[p]("data-offset");if(i=i||{},i[r]||n){for(var a,l=this,s=i[r]&&W(i[r])||n,c=s&&s.getElementsByTagName("A"),d=parseInt(i.offset||o)||10,u=[],h=[],f=e.offsetHeight=c&&f>a;if(!r&&p)M(i,k)||(B(i,k),l&&!M(l,k)&&B(l,k),Y.call(e,"activate","scrollspy",u[t]));else if(p){if(!p&&!r||r&&p)return}else M(i,k)&&(D(i,k),l&&M(l,k)&&!S(i[m],k).length&&D(l,k))},H=function(){a=g?F().y:e.scrollTop;for(var t=0,i=u[v];t1&&(t=e[e[v]-1]):t=e[0],t},H=function(){return W(x()[p]("href"))},L=function(t){t.preventDefault(),n=t.currentTarget,!h.isAnimating&&!M(n,k)&&d.show()};this.show=function(){n=n||t,l=W(n[p]("href")),o=x(),a=H(),h.isAnimating=!0,D(o,k),o[g]("aria-selected","false"),B(n,k),n[g]("aria-selected","true"),w&&(M(t[m],"dropdown-menu")?M(w,k)||B(w,k):M(w,k)&&D(w,k)),Y.call(o,"hide","tab",n),M(a,"fade")?(D(a,"show"),q(a,A)):A()},"Tab"in t||R(t,"click",L),d.height&&(f=H()[m]),t.Tab=d}};a[y](["Tab",et,'[data-toggle="tab"]']);var it=function(t,e){t=W(t),e=e||{};var i=t[p]("data-animation"),n=t[p]("data-autohide"),o=t[p]("data-delay");this.animation=!1===e.animation||"false"===i?0:1,this.autohide=!1===e.autohide||"false"===n?0:1,this[s]=parseInt(e[s]||o)||500;var a=this,l=0,r=P(t,".toast"),c=function(){D(r,"showing"),B(r,"show"),Y.call(r,"shown","toast"),a.autohide&&a.hide()},d=function(){B(r,"hide"),Y.call(r,"hidden","toast")},u=function(){D(r,"show"),a.animation?q(r,d):d()},h=function(){clearTimeout(l),l=null,B(r,"hide"),O(t,"click",a.hide),t.Toast=null,t=null,r=null};this.show=function(){r&&(Y.call(r,"show","toast"),a.animation&&B(r,"fade"),D(r,"hide"),B(r,"showing"),a.animation?q(r,c):c())},this.hide=function(t){r&&M(r,"show")&&(Y.call(r,"hide","toast"),t?u():l=setTimeout(u,a[s]))},this.dispose=function(){r&&M(r,"show")&&(D(r,"show"),a.animation?q(r,h):h())},"Toast"in t||R(t,"click",a.hide),t.Toast=a};a[y](["Toast",it,'[data-dismiss="toast"]']);var nt=function(o,a){o=W(o),a=a||{};var l=o[p]("data-animation"),r=o[p]("data-placement"),f=o[p]("data-delay"),v=o[p]("data-container"),w=W(a[d]),b=W(v),T=P(o,".modal"),y=P(o,".fixed-top"),k=P(o,".fixed-bottom");this[c]=a[c]&&"fade"!==a[c]?a[c]:l||"fade",this.placement=a.placement?a.placement:r||A,this[s]=parseInt(a[s]||f)||200,this[d]=w||(b||(y||(k||(T||e[n]))));var C=this,x=0,H=this.placement,N=null,L={},E=o[p]("title")||o[p]("data-title")||o[p]("data-original-title");if(E&&""!=E){var I=function(){C[d].removeChild(N),N=null,x=null},S=function(){if(E=o[p]("title")||o[p]("data-title")||o[p]("data-original-title"),L[m]=C[d],L.offsetLeft=C[d].offsetLeft,L.offsetTop=C[d].offsetTop,L[u]=C[d][u],L.offsetHeight=C[d].offsetHeight,L.clientWidth=C[d].clientWidth,L.clientHeight=C[d].clientHeight,L.scrollLeft=C[d].scrollLeft,L.scrollTop=C[d].scrollTop,L[m+u]=i[u],L.parentNodeoffsetHeight=i.offsetHeight,L.parentNodeclientWidth=i.clientWidth,L.parentNodeclientHeight=i.clientHeight,E&&""!==E){N=e.createElement("div"),N[g]("role","tooltip");var t=e.createElement("div");t[g]("class","arrow"),N.appendChild(t);var n=e.createElement("div");n[g]("class","tooltip-inner"),N.appendChild(n),n.innerHTML=E,C[d].appendChild(N),N[g]("class","tooltip bs-tooltip-"+H+" "+C[c])}},z=function(){G(o,N,H,L)},j=function(){!M(N,"show")&&B(N,"show")},U=function(){R(t,"resize",C.hide,X),Y.call(o,"shown","tooltip")},F=function(){O(t,"resize",C.hide,X),I(),Y.call(o,"hidden","tooltip")};this.show=function(){clearTimeout(x),x=setTimeout(function(){null===N&&(H=C.placement,!1!==S()&&(z(),j(),Y.call(o,"show","tooltip"),C[c]?q(N,U):U()))},20)},this.hide=function(){clearTimeout(x),x=setTimeout(function(){N&&M(N,"show")&&(Y.call(o,"hide","tooltip"),D(N,"show"),C[c]?q(N,F):F())},C[s])},this.toggle=function(){N?C.hide():C.show()},"Tooltip"in o||(o[g]("data-original-title",E),o.removeAttribute("title"),R(o,h[0],C.show),R(o,h[1],C.hide)),o.Tooltip=C}};a[y](["Tooltip",nt,'[data-toggle="tooltip"]']);var ot=function(t,e){for(var i=0,n=e[v];i