diff --git a/dist/bootstrap-native-v4.js b/dist/bootstrap-native-v4.js index 9581113a..af48b3b0 100644 --- a/dist/bootstrap-native-v4.js +++ b/dist/bootstrap-native-v4.js @@ -261,8 +261,12 @@ }, styleTip = function(link,element,position,parent) { // both popovers and tooltips (target,tooltip,placement,elementToAppendTo) var elementDimensions = { w : element[offsetWidth], h: element[offsetHeight] }, - windowWidth = (HTML[clientWidth] || DOC[body][clientWidth]), - windowHeight = (HTML[clientHeight] || DOC[body][clientHeight]), + 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], rect = link[getBoundingClientRect](), scroll = parent === DOC[body] ? getScroll() : { x: parent[offsetLeft] + parent[scrollLeft], y: parent[offsetTop] + parent[scrollTop] }, linkDimensions = { w: rect[right] - rect[left], h: rect[bottom] - rect[top] }, @@ -327,8 +331,8 @@ 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; - arrowLeft = elementDimensions.w/2 - arrowWidth/2; + 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 ); } } diff --git a/dist/bootstrap-native-v4.min.js b/dist/bootstrap-native-v4.min.js index 35b57150..ffcdd102 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",r="delay",s="target",c="animation",d="onmouseleave"in e?["mouseenter","mouseleave"]:["mouseover","mouseout"],u={start:"touchstart",end:"touchend",move:"touchmove"},h="getAttribute",f="setAttribute",p="parentNode",m="length",g="Transition",v="Webkit",w="style",b="push",T="active",y="left",k="top",A=/\b(top|bottom|left|right)+/,C=0,x=v+g in i[w]||g.toLowerCase()in i[w],E=v+g in i[w]?v.toLowerCase()+g+"End":g.toLowerCase()+"end",L=v+"Duration"in i[w]?v.toLowerCase()+g+"Duration":g.toLowerCase()+"Duration",N=function(t){t.focus?t.focus():t.setActive()},I=function(t,e){t.classList.add(e)},D=function(t,e){t.classList.remove(e)},H=function(t,e){return t.classList.contains(e)},B=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])&&H(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)},R=function(t,e,i,n){n=n||!1,t.removeEventListener(e,i,n)},P=function(t,e,i,n){W(t,e,function o(a){i(a),R(t,e,o,n)},n)},O=function(){var e=!1;try{var i=Object.defineProperty({},"passive",{get:function(){e=!0}});P(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)?P(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}},F=function(t,o,a,l){var r,s,c,d,u,h,f={w:o.offsetWidth,h:o.offsetHeight},p=i.clientWidth||e[n].clientWidth,m=i.clientHeight||e[n].clientHeight,g=t.getBoundingClientRect(),v=l===e[n]?q():{x:l.offsetLeft+l.scrollLeft,y:l.offsetTop+l.scrollTop},b={w:g.right-g[y],h:g.bottom-g[k]},T=H(o,"popover"),C=M(".arrow",o),x=g[k]+b.h/2-f.h/2<0,E=g[y]+b.w/2-f.w/2<0,L=g[y]+f.w/2+b.w/2>=p,N=g[k]+f.h/2+b.h/2>=m,I=g[k]-f.h<0,D=g[y]-f.w<0,B=g[k]+f.h+b.h>=m,S=g[y]+f.w+b.w>=p;a=(a===y||"right"===a)&&D&&S?k:a,a=a===k&&I?"bottom":a,a="bottom"===a&&B?k:a,a=a===y&&D?"right":a,a="right"===a&&S?y:a,-1===o.className.indexOf(a)&&(o.className=o.className.replace(A,a)),u=C.offsetWidth,h=C.offsetHeight,a===y||"right"===a?(s=a===y?g[y]+v.x-f.w-(T?u:0):g[y]+v.x+b.w,x?(r=g[k]+v.y,c=b.h/2-u):N?(r=g[k]+v.y-f.h+b.h,c=f.h-b.h/2-u):(r=g[k]+v.y-f.h/2+b.h/2,c=f.h/2-(T?.9*h:h/2))):a!==k&&"bottom"!==a||(r=a===k?g[k]+v.y-f.h-(T?h:0):g[k]+v.y+b.h,E?(s=0,d=g[y]+b.w/2-u):L?(s=p-1.01*f.w,d=f.w-(p-g[y])+b.w/2-u/2):(s=g[y]+v.x-f.w/2+b.w/2,d=f.w/2-u/2)),o[w][k]=r+"px",o[w][y]=s+"px",c&&(C[w][k]=c+"px"),d&&(C[w][y]=d+"px")};o.version="2.0.27";var Y=function(t){t=M(t);var e=this,i=S(t,".alert"),n=function(){H(i,"fade")?X(i,a):a()},o=function(n){i=S(n[s],".alert"),(t=M('[data-dismiss="alert"]',i))&&i&&(t===n[s]||t.contains(n[s]))&&e.close()},a=function(){U.call(i,"closed","alert"),R(t,"click",o),i[p].removeChild(i)};this.close=function(){i&&t&&H(i,"show")&&(U.call(i,"close","alert"),D(i,"show"),i&&n())},"Alert"in t||W(t,"click",o),t.Alert=e};a[b](["Alert",Y,'[data-dismiss="alert"]']);var G=function(t){t=M(t);var i=!1,n="checked",o=function(t){32===(t.which||t.keyCode)&&t[s]===e.activeElement&&l(t)},a=function(t){32===(t.which||t.keyCode)&&t.preventDefault()},l=function(e){var o="LABEL"===e[s].tagName?e[s]:"LABEL"===e[s][p].tagName?e[s][p]:null;if(o){var a=e[s],l=B(a[p],"btn"),r=o.getElementsByTagName("INPUT")[0];if(r){if("checkbox"===r.type&&(r[n]?(D(o,T),r[h](n),r.removeAttribute(n),r[n]=!1):(I(o,T),r[h](n),r[f](n,n),r[n]=!0),i||(i=!0,U.call(r,"change","button"),U.call(t,"change","button"))),"radio"===r.type&&!i&&!r[n]){I(o,T),r[f](n,n),r[n]=!0,U.call(r,"change","button"),U.call(t,"change","button"),i=!0;for(var c=0,d=l[m];c1?(t.preventDefault(),!1):void 0):void t.preventDefault()},$=function(t){if(b&&!w&&(E=C||parseInt(t.touches[0].pageX),b)){if((!n.contains(t[s])||!n.contains(t.relatedTarget))&&Math.abs(A-E)<75)return!1;CA&&g--,b=!1,p.slideTo(g),Q(R)}},_=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[m];et||o===N-1&&0===t)&&(S=p.direction="right"),t<0?t=N-1:t>=N&&(t=0),g=t,i=S===y?"next":"prev",U.call(n,"slide","carousel",L[t]),w=!0,clearInterval(v),v=null,tt(t),x&&H(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[s]!==L[t]?1e3*a.elapsedTime+100:20;w&&setTimeout(function(){w=!1,I(L[t],T),D(L[o],T),D(L[t],"carousel-item-"+i),D(L[t],"carousel-item-"+S),D(L[o],"carousel-item-"+S),U.call(n,"slid","carousel",L[t]),e.hidden||!p.interval||H(n,"paused")||p.cycle()},l)})):(I(L[t],T),L[t].offsetWidth,D(L[o],T),setTimeout(function(){w=!1,p.interval&&!H(n,"paused")&&p.cycle(),U.call(n,"slid","carousel",L[t])},100)))}},this.getActiveIndex=function(){return L.indexOf(B(n,"carousel-item active")[0])||0},"Carousel"in n||(p.pause&&p.interval&&(W(n,d[0],F),W(n,d[1],Y),W(n,u.start,F,z),W(n,u.end,Y,z)),L[m]>1&&W(n,u.start,V,z),O&&W(O,"click",J),P&&W(P,"click",J),j&&W(j,"click",G),p.keyboard&&W(t,"keydown",K)),p.getActiveIndex()<0&&(L[m]&&I(L[0],T),q[m]&&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,r=t[h]("data-parent"),s=function(t,e){U.call(t,"show","collapse"),t.isAnimating=!0,I(t,"collapsing"),D(t,"collapse"),t[w].height=t.scrollHeight+"px",X(t,function(){t.isAnimating=!1,t[f]("aria-expanded","true"),e[f]("aria-expanded","true"),D(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",D(t,"collapse"),D(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"),D(t,"collapsing"),I(t,"collapse"),t[w].height="",U.call(t,"hidden","collapse")})};this.toggle=function(t){t.preventDefault(),H(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")),s(a,t),D(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)||r&&S(t,r),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,r=M(".dropdown-menu",o),c=function(){for(var t=r.children,e=[],i=0;i1?s-1:0:40===o&&s×',b=M(o.container),T=M(g),y=S(i,".modal"),A=S(i,".fixed-top"),C=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[r]=parseInt(o[r]||m)||200,this.dismissible=!(!o.dismissible&&"true"!==p),this.container=b||(T||(A||(C||(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,B=0,P=this.placement,O=function(t){null!==N&&t[s]===M(".close",N)&&x.hide()},j=function(){x.container.removeChild(N),B=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-"+P+" "+x[c])},Y=function(){!H(N,"show")&&I(N,"show")},G=function(){F(i,N,P,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(R),j(),U.call(i,"hidden","popover")};this.toggle=function(){null===N?x.show():x.hide()},this.show=function(){clearTimeout(B),B=setTimeout(function(){null===N&&(P=x.placement,q(),G(),Y(),U.call(i,"show","popover"),x[c]?X(N,K):K())},20)},this.hide=function(){clearTimeout(B),B=setTimeout(function(){N&&null!==N&&H(N,"show")&&(U.call(i,"hide","popover"),D(N,"show"),x[c]?X(N,Q):Q())},x[r])},"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[s]||n){for(var a,l=this,r=i[s]&&M(i[s])||n,c=r&&r.getElementsByTagName("A"),d=parseInt(i.offset||o)||10,u=[],f=[],g=e.offsetHeight=c&&h>a;if(!s&&m)H(i,T)||(I(i,T),l&&!H(l,T)&&I(l,T),U.call(e,"activate","scrollspy",u[t]));else if(m){if(!m&&!s||s&&m)return}else H(i,T)&&(D(i,T),l&&H(l,T)&&!B(i[p],T).length&&D(l,T))},E=function(){a=v?q().y:e.scrollTop;for(var t=0,i=u[m];t1&&(t=e[e[m]-1]):t=e[0],t},E=function(){return M(C()[h]("href"))},L=function(t){t.preventDefault(),n=t.currentTarget,!u.isAnimating&&!H(n,T)&&d.show()};this.show=function(){n=n||t,l=M(n[h]("href")),o=C(),a=E(),u.isAnimating=!0,D(o,T),o[f]("aria-selected","false"),I(n,T),n[f]("aria-selected","true"),v&&(H(t[p],"dropdown-menu")?H(v,T)||I(v,T):H(v,T)&&D(v,T)),U.call(o,"hide","tab",n),H(a,"fade")?(D(a,"show"),X(a,A)):A()},"Tab"in t||W(t,"click",L),d.height&&(g=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[r]=parseInt(e[r]||o)||500;var a=this,l=0,s=S(t,".toast"),c=function(){D(s,"showing"),I(s,"show"),U.call(s,"shown","toast"),a.autohide&&a.hide()},d=function(){I(s,"hide"),U.call(s,"hidden","toast")},u=function(){D(s,"show"),a.animation?X(s,d):d()},f=function(){clearTimeout(l),l=null,I(s,"hide"),R(t,"click",a.hide),t.Toast=null,t=null,s=null};this.show=function(){s&&(U.call(s,"show","toast"),a.animation&&I(s,"fade"),D(s,"hide"),I(s,"showing"),a.animation?X(s,c):c())},this.hide=function(t){s&&H(s,"show")&&(U.call(s,"hide","toast"),t?u():l=setTimeout(u,a[r]))},this.dispose=function(){s&&H(s,"show")&&(D(s,"show"),a.animation?X(s,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"),s=i[h]("data-delay"),u=i[h]("data-container"),p=M(o.container),m=M(u),g=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[r]=parseInt(o[r]||s)||200,this.container=p||(m||(v||(w||(g||e[n]))));var b=this,T=0,y=this.placement,A=null,C=i[h]("title")||i[h]("data-title")||i[h]("data-original-title");if(C&&""!=C){var x=function(){b.container.removeChild(A),A=null,T=null},E=function(){if(!(C=i[h]("title")||i[h]("data-title")||i[h]("data-original-title"))||""==C)return!1;A=e.createElement("div"),A[f]("role","tooltip");var t=e.createElement("div");t[f]("class","arrow"),A.appendChild(t);var n=e.createElement("div");n[f]("class","tooltip-inner"),A.appendChild(n),n.innerHTML=C,b.container.appendChild(A),A[f]("class","tooltip bs-tooltip-"+y+" "+b[c])},L=function(){F(i,A,y,b.container)},N=function(){!H(A,"show")&&I(A,"show")},B=function(){W(t,"resize",b.hide,z),U.call(i,"shown","tooltip")},P=function(){R(t,"resize",b.hide,z),x(),U.call(i,"hidden","tooltip")};this.show=function(){clearTimeout(T),T=setTimeout(function(){if(null===A){if(y=b.placement,0==E())return;L(),N(),U.call(i,"show","tooltip"),b[c]?X(A,B):B()}},20)},this.hide=function(){clearTimeout(T),T=setTimeout(function(){A&&H(A,"show")&&(U.call(i,"hide","tooltip"),D(A,"show"),b[c]?X(A,P):P())},b[r])},this.toggle=function(){A?b.hide():b.show()},"Tooltip"in i||(i[f]("data-original-title",C),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[m];i=T,W=x[k]+m.h/2+L.h/2>=A,R=x[k]-m.h<0,P=x[y]-m.w<0,O=x[k]+m.h+L.h>=A,z=x[y]+m.w+L.w>=T;l=(l===y||"right"===l)&&P&&z?k:l,l=l===k&&R?"bottom":l,l="bottom"===l&&O?k:l,l=l===y&&P?"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-m.w-(H?h:0):x[y]+E.x+L.w,N?(r=x[k]+E.y,d=L.h/2-h):W?(r=x[k]+E.y-m.h+L.h,d=m.h-L.h/2-h):(r=x[k]+E.y-m.h/2+L.h/2,d=m.h/2-(H?.9*f:f/2))):l!==k&&"bottom"!==l||(r=l===k?x[k]+E.y-m.h-(H?f:0):x[k]+E.y+L.h,B?(c=0,u=x[y]+L.w/2-h):S?(c=T-1.01*m.w,u=m.w-(T-x[y])+L.w/2-h/2):(c=x[y]+E.x-m.w/2+L.w/2+(!H&&b&&g?h/2:0),u=m.w/2-(H?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 Y=function(t){t=M(t);var e=this,i=S(t,".alert"),n=function(){D(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"),R(t,"click",o),i[p].removeChild(i)};this.close=function(){i&&t&&D(i,"show")&&(U.call(i,"close","alert"),N(i,"show"),i&&n())},"Alert"in t||W(t,"click",o),t.Alert=e};a[b](["Alert",Y,'[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=e[r],l=B(a[p],"btn"),s=o.getElementsByTagName("INPUT")[0];if(s){if("checkbox"===s.type&&(s[n]?(N(o,T),s[h](n),s.removeAttribute(n),s[n]=!1):(I(o,T),s[h](n),s[f](n,n),s[n]=!0),i||(i=!0,U.call(s,"change","button"),U.call(t,"change","button"))),"radio"===s.type&&!i&&!s[n]){I(o,T),s[f](n,n),s[n]=!0,U.call(s,"change","button"),U.call(t,"change","button"),i=!0;for(var c=0,d=l[m];c1?(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&&g--,b=!1,p.slideTo(g),Q(R)}},_=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[m];et||o===H-1&&0===t)&&(S=p.direction="right"),t<0?t=H-1:t>=H&&(t=0),g=t,i=S===y?"next":"prev",U.call(n,"slide","carousel",L[t]),w=!0,clearInterval(v),v=null,tt(t),x&&D(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),N(L[o],T),N(L[t],"carousel-item-"+i),N(L[t],"carousel-item-"+S),N(L[o],"carousel-item-"+S),U.call(n,"slid","carousel",L[t]),e.hidden||!p.interval||D(n,"paused")||p.cycle()},l)})):(I(L[t],T),L[t].offsetWidth,N(L[o],T),setTimeout(function(){w=!1,p.interval&&!D(n,"paused")&&p.cycle(),U.call(n,"slid","carousel",L[t])},100)))}},this.getActiveIndex=function(){return L.indexOf(B(n,"carousel-item active")[0])||0},"Carousel"in n||(p.pause&&p.interval&&(W(n,d[0],F),W(n,d[1],Y),W(n,u.start,F,z),W(n,u.end,Y,z)),L[m]>1&&W(n,u.start,V,z),O&&W(O,"click",J),P&&W(P,"click",J),j&&W(j,"click",G),p.keyboard&&W(t,"keydown",K)),p.getActiveIndex()<0&&(L[m]&&I(L[0],T),q[m]&&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"),N(t,"collapse"),t[w].height=t.scrollHeight+"px",X(t,function(){t.isAnimating=!1,t[f]("aria-expanded","true"),e[f]("aria-expanded","true"),N(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",N(t,"collapse"),N(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"),N(t,"collapsing"),I(t,"collapse"),t[w].height="",U.call(t,"hidden","collapse")})};this.toggle=function(t){t.preventDefault(),D(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),N(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(g),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]||m)||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 H=null,B=0,P=this.placement,O=function(t){null!==H&&t[r]===M(".close",H)&&x.hide()},j=function(){x.container.removeChild(H),B=null,H=null},q=function(){E=o.title||i[h]("data-title"),L=o.content||i[h]("data-content"),L=L?L.trim():null,H=e.createElement("div");var t=e.createElement("div");if(t[f]("class","arrow"),H.appendChild(t),null!==L&&null===x.template){if(H[f]("role","tooltip"),null!==E){var n=e.createElement("h3");n[f]("class","popover-header"),n.innerHTML=x.dismissible?E+v:E,H.appendChild(n)}var a=e.createElement("div");a[f]("class","popover-body"),a.innerHTML=x.dismissible&&null===E?L+v:L,H.appendChild(a)}else{var l=e.createElement("div");x.template=x.template.trim(),l.innerHTML=x.template,H.innerHTML=l.firstChild.innerHTML}x.container.appendChild(H),H[w].display="block",H[f]("class","popover bs-popover-"+P+" "+x[c])},Y=function(){!D(H,"show")&&I(H,"show")},G=function(){F(i,H,P,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(R),j(),U.call(i,"hidden","popover")};this.toggle=function(){null===H?x.show():x.hide()},this.show=function(){clearTimeout(B),B=setTimeout(function(){null===H&&(P=x.placement,q(),G(),Y(),U.call(i,"show","popover"),x[c]?X(H,K):K())},20)},this.hide=function(){clearTimeout(B),B=setTimeout(function(){H&&null!==H&&D(H,"show")&&(U.call(i,"hide","popover"),N(H,"show"),x[c]?X(H,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=[],g=e.offsetHeight=c&&h>a;if(!r&&m)D(i,T)||(I(i,T),l&&!D(l,T)&&I(l,T),U.call(e,"activate","scrollspy",u[t]));else if(m){if(!m&&!r||r&&m)return}else D(i,T)&&(N(i,T),l&&D(l,T)&&!B(i[p],T).length&&N(l,T))},E=function(){a=v?q().y:e.scrollTop;for(var t=0,i=u[m];t1&&(t=e[e[m]-1]):t=e[0],t},E=function(){return M(A()[h]("href"))},L=function(t){t.preventDefault(),n=t.currentTarget,!u.isAnimating&&!D(n,T)&&d.show()};this.show=function(){n=n||t,l=M(n[h]("href")),o=A(),a=E(),u.isAnimating=!0,N(o,T),o[f]("aria-selected","false"),I(n,T),n[f]("aria-selected","true"),v&&(D(t[p],"dropdown-menu")?D(v,T)||I(v,T):D(v,T)&&N(v,T)),U.call(o,"hide","tab",n),D(a,"fade")?(N(a,"show"),X(a,C)):C()},"Tab"in t||W(t,"click",L),d.height&&(g=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(){N(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(){N(r,"show"),a.animation?X(r,d):d()},f=function(){clearTimeout(l),l=null,I(r,"hide"),R(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"),N(r,"hide"),I(r,"showing"),a.animation?X(r,c):c())},this.hide=function(t){r&&D(r,"show")&&(U.call(r,"hide","toast"),t?u():l=setTimeout(u,a[s]))},this.dispose=function(){r&&D(r,"show")&&(N(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),m=M(u),g=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||(m||(v||(w||(g||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(){F(i,C,y,b.container)},H=function(){!D(C,"show")&&I(C,"show")},B=function(){W(t,"resize",b.hide,z),U.call(i,"shown","tooltip")},P=function(){R(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(),H(),U.call(i,"show","tooltip"),b[c]?X(C,B):B()}},20)},this.hide=function(){clearTimeout(T),T=setTimeout(function(){C&&D(C,"show")&&(U.call(i,"hide","tooltip"),N(C,"show"),b[c]?X(C,P):P())},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[m];i