(function(n,t){typeof define=="function"&&define.amd?define(t):typeof exports=="object"?module.exports=t(require,exports,module):n.Tether=t()})(this,function(){return function(){var s,u,f,e,t,h,c,l,a,v,y,i,w,r,o,p,n,b={}.hasOwnProperty,k=[].indexOf||function(n){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===n)return t;return-1},d=[].slice;this.Tether==null&&(this.Tether={modules:[]});y=function(n){var i,r,f,t,u;if(r=getComputedStyle(n).position,r==="fixed")return n;for(f=void 0,i=n;i=i.parentNode;){try{t=getComputedStyle(i)}catch(e){}if(t==null||/(auto|scroll)/.test(t.overflow+t["overflow-y"]+t["overflow-x"])&&(r!=="absolute"||(u=t.position)==="relative"||u==="absolute"||u==="fixed"))return i}return document.body};o=function(){var n;return n=0,function(){return n++}}();n={};a=function(i){var u,e,r,h,s;if(r=i._tetherZeroElement,r==null&&(r=i.createElement("div"),r.setAttribute("data-tether-id",o()),t(r.style,{top:0,left:0,position:"absolute"}),i.body.appendChild(r),i._tetherZeroElement=r),u=r.getAttribute("data-tether-id"),n[u]==null){n[u]={};s=r.getBoundingClientRect();for(e in s)h=s[e],n[u][e]=h;f(function(){return n[u]=void 0})}return n[u]};w=null;c=function(n){var t,i,r,u,f,o,e;n===document?(i=document,n=document.documentElement):i=n.ownerDocument;r=i.documentElement;t={};e=n.getBoundingClientRect();for(u in e)o=e[u],t[u]=o;return f=a(i),t.top-=f.top,t.left-=f.left,t.width==null&&(t.width=document.body.scrollWidth-t.left-t.right),t.height==null&&(t.height=document.body.scrollHeight-t.top-t.bottom),t.top=t.top-r.clientTop,t.left=t.left-r.clientLeft,t.right=i.body.clientWidth-t.width-t.left,t.bottom=i.body.clientHeight-t.height-t.top,t};l=function(n){return n.offsetParent||document.documentElement};v=function(){var i,n,u,f,r;return i=document.createElement("div"),i.style.width="100%",i.style.height="200px",n=document.createElement("div"),t(n.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),n.appendChild(i),document.body.appendChild(n),f=i.offsetWidth,n.style.overflow="scroll",r=i.offsetWidth,f===r&&(r=n.clientWidth),document.body.removeChild(n),u=f-r,{width:u,height:u}};t=function(n){var u,i,t,e,r,o,f;for(n==null&&(n={}),u=[],Array.prototype.push.apply(u,arguments),f=u.slice(1),r=0,o=f.length;r<o;r++)if(t=f[r],t)for(i in t)b.call(t,i)&&(e=t[i],n[i]=e);return n};r=function(n,t){var r,i,e,u,f;if(n.classList!=null){for(u=t.split(" "),f=[],i=0,e=u.length;i<e;i++)r=u[i],r.trim()&&f.push(n.classList.remove(r));return f}return n.className=n.className.replace(new RegExp("(^| )"+t.split(" ").join("|")+"( |$)","gi")," ")};u=function(n,t){var u,i,o,f,e;if(n.classList!=null){for(f=t.split(" "),e=[],i=0,o=f.length;i<o;i++)u=f[i],u.trim()&&e.push(n.classList.add(u));return e}return r(n,t),n.className+=" "+t};i=function(n,t){return n.classList!=null?n.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(n.className)};p=function(n,t,f){for(var e,s,l,h,o=0,c=f.length;o<c;o++)e=f[o],k.call(t,e)<0&&i(n,e)&&r(n,e);for(h=[],s=0,l=t.length;s<l;s++)e=t[s],i(n,e)?h.push(void 0):h.push(u(n,e));return h};e=[];f=function(n){return e.push(n)};h=function(){for(var t,n=[];t=e.pop();)n.push(t());return n};s=function(){function n(){}return n.prototype.on=function(n,t,i,r){var u;return r==null&&(r=!1),this.bindings==null&&(this.bindings={}),(u=this.bindings)[n]==null&&(u[n]=[]),this.bindings[n].push({handler:t,ctx:i,once:r})},n.prototype.once=function(n,t,i){return this.on(n,t,i,!0)},n.prototype.off=function(n,t){var i,u,r;if(((u=this.bindings)!=null?u[n]:void 0)!=null){if(t==null)return delete this.bindings[n];for(i=0,r=[];i<this.bindings[n].length;)this.bindings[n][i].handler===t?r.push(this.bindings[n].splice(i,1)):r.push(i++);return r}},n.prototype.trigger=function(){var f,u,n,e,t,o,s,i,r;if(n=arguments[0],f=2<=arguments.length?d.call(arguments,1):[],(s=this.bindings)!=null?s[n]:void 0){for(t=0,r=[];t<this.bindings[n].length;)i=this.bindings[n][t],e=i.handler,u=i.ctx,o=i.once,e.apply(u!=null?u:this,f),o?r.push(this.bindings[n].splice(t,1)):r.push(t++);return r}},n}();this.Tether.Utils={getScrollParent:y,getBounds:c,getOffsetParent:l,extend:t,addClass:u,removeClass:r,hasClass:i,updateClasses:p,defer:f,flush:h,uniqueId:o,Evented:s,getScrollBarSize:v}}.call(this),function(){var nt,tt,l,i,u,a,v,it,e,o,y,r,s,et,p,rt,ot,h,f,w,b,k,d,t,c,g,ut,ft,n,st=[].slice,ht=function(n,t){return function(){return n.apply(t,arguments)}};if(this.Tether==null)throw new Error("You must include the utils.js file before tether.js");i=this.Tether;n=i.Utils;rt=n.getScrollParent;ot=n.getSize;et=n.getOuterSize;r=n.getBounds;s=n.getOffsetParent;o=n.extend;u=n.addClass;d=n.removeClass;g=n.updateClasses;e=n.defer;y=n.flush;p=n.getScrollBarSize;ut=function(n,t,i){return i==null&&(i=1),n+i>=t&&t>=n-i};c=function(){var r,t,n,u,i;for(r=document.createElement("div"),i=["transform","webkitTransform","OTransform","MozTransform","msTransform"],n=0,u=i.length;n<u;n++)if(t=i[n],r.style[t]!==void 0)return t}();t=[];k=function(){for(var i,n=0,r=t.length;n<r;n++)i=t[n],i.position(!1);return y()};h=function(){var n;return(n=typeof performance!="undefined"&&performance!==null?typeof performance.now=="function"?performance.now():void 0:void 0)!=null?n:+new Date},function(){var o,t,n,i,u,r,s,f,e;for(t=null,n=null,i=null,u=function(){if(n!=null&&n>16){n=Math.min(n-16,250);i=setTimeout(u,250);return}if(t==null||!(h()-t<10))return i!=null&&(clearTimeout(i),i=null),t=h(),k(),n=h()-t},f=["resize","scroll","touchmove"],e=[],r=0,s=f.length;r<s;r++)o=f[r],e.push(window.addEventListener(o,u));return e}();nt={center:"center",left:"right",right:"left"};tt={middle:"middle",top:"bottom",bottom:"top"};l={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"};it=function(n,t){var i,r;return i=n.left,r=n.top,i==="auto"&&(i=nt[t.left]),r==="auto"&&(r=tt[t.top]),{left:i,top:r}};v=function(n){var t,i;return{left:(t=l[n.left])!=null?t:n.left,top:(i=l[n.top])!=null?i:n.top}};a=function(){var n,u,i,t,r,e,f;for(u=1<=arguments.length?st.call(arguments,0):[],i={top:0,left:0},r=0,e=u.length;r<e;r++)f=u[r],t=f.top,n=f.left,typeof t=="string"&&(t=parseFloat(t,10)),typeof n=="string"&&(n=parseFloat(n,10)),i.top+=t,i.left+=n;return i};f=function(n,t){return typeof n.left=="string"&&n.left.indexOf("%")!==-1&&(n.left=parseFloat(n.left,10)/100*t.width),typeof n.top=="string"&&n.top.indexOf("%")!==-1&&(n.top=parseFloat(n.top,10)/100*t.height),n};w=b=function(n){var i,r,t;return t=n.split(" "),r=t[0],i=t[1],{top:r,left:i}};ft=function(){function n(n){this.position=ht(this.position,this);var f,r,e,u,o;for(t.push(this),this.history=[],this.setOptions(n,!1),u=i.modules,r=0,e=u.length;r<e;r++)f=u[r],(o=f.initialize)!=null&&o.call(this);this.position()}return n.modules=[],n.prototype.getClass=function(n){var t,i;return((t=this.options.classes)!=null?t[n]:void 0)?this.options.classes[n]:((i=this.options.classes)!=null?i[n]:void 0)!==!1?this.options.classPrefix?""+this.options.classPrefix+"-"+n:n:""},n.prototype.setOptions=function(n,t){var s,i,r,h,f,e;for(this.options=n,t==null&&(t=!0),s={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"},this.options=o(s,this.options),f=this.options,this.element=f.element,this.target=f.target,this.targetModifier=f.targetModifier,this.target==="viewport"?(this.target=document.body,this.targetModifier="visible"):this.target==="scroll-handle"&&(this.target=document.body,this.targetModifier="scroll-handle"),e=["element","target"],r=0,h=e.length;r<h;r++){if(i=e[r],this[i]==null)throw new Error("Tether Error: Both element and target must be defined");this[i].jquery!=null?this[i]=this[i][0]:typeof this[i]=="string"&&(this[i]=document.querySelector(this[i]))}if(u(this.element,this.getClass("element")),u(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");return this.targetAttachment=w(this.options.targetAttachment),this.attachment=w(this.options.attachment),this.offset=b(this.options.offset),this.targetOffset=b(this.options.targetOffset),this.scrollParent!=null&&this.disable(),this.scrollParent=this.targetModifier==="scroll-handle"?this.target:rt(this.target),this.options.enabled!==!1?this.enable(t):void 0},n.prototype.getTargetBounds=function(){var t,e,s,u,n,o,h,f,i;if(this.targetModifier!=null)switch(this.targetModifier){case"visible":return this.target===document.body?{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth}:(t=r(this.target),n={height:t.height,width:t.width,top:t.top,left:t.left},n.height=Math.min(n.height,t.height-(pageYOffset-t.top)),n.height=Math.min(n.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),n.height=Math.min(innerHeight,n.height),n.height-=2,n.width=Math.min(n.width,t.width-(pageXOffset-t.left)),n.width=Math.min(n.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),n.width=Math.min(innerWidth,n.width),n.width-=2,n.top<pageYOffset&&(n.top=pageYOffset),n.left<pageXOffset&&(n.left=pageXOffset),n);case"scroll-handle":return i=this.target,i===document.body?(i=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=r(i),f=getComputedStyle(i),s=i.scrollWidth>i.clientWidth||"scroll"===[f.overflow,f.overflowX]||this.target!==document.body,o=0,s&&(o=15),u=t.height-parseFloat(f.borderTopWidth)-parseFloat(f.borderBottomWidth)-o,n={width:15,height:u*.975*(u/i.scrollHeight),left:t.left+t.width-parseFloat(f.borderLeftWidth)-15},e=0,u<408&&this.target===document.body&&(e=-.00011*Math.pow(u,2)-.00727*u+22.58),this.target!==document.body&&(n.height=Math.max(n.height,24)),h=this.target.scrollTop/(i.scrollHeight-u),n.top=h*(u-n.height-e)+t.top+parseFloat(f.borderTopWidth),this.target===document.body&&(n.height=Math.max(n.height,24)),n}else return r(this.target)},n.prototype.clearCache=function(){return this._cache={}},n.prototype.cache=function(n,t){return this._cache==null&&(this._cache={}),this._cache[n]==null&&(this._cache[n]=t.call(this)),this._cache[n]},n.prototype.enable=function(n){return n==null&&(n=!0),u(this.target,this.getClass("enabled")),u(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParent!==document&&this.scrollParent.addEventListener("scroll",this.position),n?this.position():void 0},n.prototype.disable=function(){return d(this.target,this.getClass("enabled")),d(this.element,this.getClass("enabled")),this.enabled=!1,this.scrollParent!=null?this.scrollParent.removeEventListener("scroll",this.position):void 0},n.prototype.destroy=function(){var n,u,i,f,r;for(this.disable(),r=[],n=i=0,f=t.length;i<f;n=++i)if(u=t[n],u===this){t.splice(n,1);break}else r.push(void 0);return r},n.prototype.updateAttachClasses=function(n,t){var r,u,o,f,s,h,c,l,a,i=this;for(n==null&&(n=this.attachment),t==null&&(t=this.targetAttachment),f=["left","top","bottom","right","middle","center"],((a=this._addAttachClasses)!=null?a.length:void 0)&&this._addAttachClasses.splice(0,this._addAttachClasses.length),r=this._addAttachClasses!=null?this._addAttachClasses:this._addAttachClasses=[],n.top&&r.push(""+this.getClass("element-attached")+"-"+n.top),n.left&&r.push(""+this.getClass("element-attached")+"-"+n.left),t.top&&r.push(""+this.getClass("target-attached")+"-"+t.top),t.left&&r.push(""+this.getClass("target-attached")+"-"+t.left),u=[],s=0,c=f.length;s<c;s++)o=f[s],u.push(""+this.getClass("element-attached")+"-"+o);for(h=0,l=f.length;h<l;h++)o=f[h],u.push(""+this.getClass("target-attached")+"-"+o);return e(function(){if(i._addAttachClasses!=null)return g(i.element,i._addAttachClasses,u),g(i.target,i._addAttachClasses,u),i._addAttachClasses=void 0})},n.prototype.position=function(n){var nt,ri,e,c,et,ot,pt,t,w,o,d,st,wt,u,b,bt,kt,g,ht,tt,k,rt,ct,l,h,ut,ft,dt,gt,lt,at,ni,ti,ii,vt,yt=this;if(n==null&&(n=!0),this.enabled){for(this.clearCache(),tt=it(this.targetAttachment,this.attachment),this.updateAttachClasses(this.attachment,tt),nt=this.cache("element-bounds",function(){return r(yt.element)}),h=nt.width,e=nt.height,h===0&&e===0&&this.lastSize!=null?(lt=this.lastSize,h=lt.width,e=lt.height):this.lastSize={width:h,height:e},ct=rt=this.cache("target-bounds",function(){return yt.getTargetBounds()}),w=f(v(this.attachment),{width:h,height:e}),k=f(v(tt),ct),et=f(this.offset,{width:h,height:e}),ot=f(this.targetOffset,ct),w=a(w,et),k=a(k,ot),c=rt.left+k.left-w.left,l=rt.top+k.top-w.top,at=i.modules,ut=0,dt=at.length;ut<dt;ut++)if(pt=at[ut],b=pt.position.call(this,{left:c,top:l,targetAttachment:tt,targetPos:rt,attachment:this.attachment,elementPos:nt,offset:w,targetOffset:k,manualOffset:et,manualTargetOffset:ot,scrollbarSize:g}),b==null||typeof b!="object")continue;else{if(b===!1)return!1;l=b.top;c=b.left}if(t={page:{top:l,left:c},viewport:{top:l-pageYOffset,bottom:pageYOffset-l-e+innerHeight,left:c-pageXOffset,right:pageXOffset-c-h+innerWidth}},document.body.scrollWidth>window.innerWidth&&(g=this.cache("scrollbar-size",p),t.viewport.bottom-=g.height),document.body.scrollHeight>window.innerHeight&&(g=this.cache("scrollbar-size",p),t.viewport.right-=g.width),((ni=document.body.style.position)!==""&&ni!=="static"||(ti=document.body.parentElement.style.position)!==""&&ti!=="static")&&(t.page.bottom=document.body.scrollHeight-l-e,t.page.right=document.body.scrollWidth-c-h),((ii=this.options.optimizations)!=null?ii.moveElement:void 0)!==!1&&this.targetModifier==null){for(d=this.cache("target-offsetparent",function(){return s(yt.target)}),u=this.cache("target-offsetparent-bounds",function(){return r(d)}),wt=getComputedStyle(d),ri=getComputedStyle(this.element),st=u,o={},vt=["Top","Left","Bottom","Right"],ft=0,gt=vt.length;ft<gt;ft++)ht=vt[ft],o[ht.toLowerCase()]=parseFloat(wt["border"+ht+"Width"]);u.right=document.body.scrollWidth-u.left-st.width+o.right;u.bottom=document.body.scrollHeight-u.top-st.height+o.bottom;t.page.top>=u.top+o.top&&t.page.bottom>=u.bottom&&t.page.left>=u.left+o.left&&t.page.right>=u.right&&(kt=d.scrollTop,bt=d.scrollLeft,t.offset={top:t.page.top-u.top+kt-o.top,left:t.page.left-u.left+bt-o.left})}return this.move(t),this.history.unshift(t),this.history.length>3&&this.history.pop(),n&&y(),!0}},n.prototype.move=function(n){var t,h,y,r,p,w,g,i,l,u,a,b,k,v,nt,d,tt,f=this;if(this.element.parentNode!=null){i={};for(u in n){i[u]={};for(r in n[u]){for(y=!1,d=this.history,v=0,nt=d.length;v<nt;v++)if(g=d[v],!ut((tt=g[u])!=null?tt[r]:void 0,n[u][r])){y=!0;break}y||(i[u][r]=!0)}}t={top:"",left:"",right:"",bottom:""};l=function(n,i){var r,u,e;if(((e=f.options.optimizations)!=null?e.gpu:void 0)!==!1){if(n.top?(t.top=0,u=i.top):(t.bottom=0,u=-i.bottom),n.left?(t.left=0,r=i.left):(t.right=0,r=-i.right),t[c]="translateX("+Math.round(r)+"px) translateY("+Math.round(u)+"px)",c!=="msTransform")return t[c]+=" translateZ(0)"}else return n.top?t.top=""+i.top+"px":t.bottom=""+i.bottom+"px",n.left?t.left=""+i.left+"px":t.right=""+i.right+"px"};p=!1;(i.page.top||i.page.bottom)&&(i.page.left||i.page.right)?(t.position="absolute",l(i.page,n.page)):(i.viewport.top||i.viewport.bottom)&&(i.viewport.left||i.viewport.right)?(t.position="fixed",l(i.viewport,n.viewport)):i.offset!=null&&i.offset.top&&i.offset.left?(t.position="absolute",w=this.cache("target-offsetparent",function(){return s(f.target)}),s(this.element)!==w&&e(function(){return f.element.parentNode.removeChild(f.element),w.appendChild(f.element)}),l(i.offset,n.offset),p=!0):(t.position="absolute",l({top:!0,left:!0},n.page));p||this.element.parentNode.tagName==="BODY"||(this.element.parentNode.removeChild(this.element),document.body.appendChild(this.element));k={};b=!1;for(r in t)a=t[r],h=this.element.style[r],h!==""&&a!==""&&(r==="top"||r==="left"||r==="bottom"||r==="right")&&(h=parseFloat(h),a=parseFloat(a)),h!==a&&(b=!0,k[r]=t[r]);if(b)return e(function(){return o(f.element.style,k)})}},n}();i.position=k;this.Tether=o(ft,i)}.call(this),function(){var i,s,e,r,o,u,h,c,f,t,n=[].indexOf||function(n){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===n)return t;return-1};t=this.Tether.Utils;h=t.getOuterSize;u=t.getBounds;c=t.getSize;r=t.extend;f=t.updateClasses;e=t.defer;s={left:"right",right:"left",top:"bottom",bottom:"top",middle:"middle"};i=["left","top","right","bottom"];o=function(n,t){var f,e,r,o,s,h,c;if(t==="scrollParent"?t=n.scrollParent:t==="window"&&(t=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),t===document&&(t=t.documentElement),t.nodeType!=null)for(e=o=u(t),s=getComputedStyle(t),t=[e.left,e.top,o.width+e.left,o.height+e.top],f=h=0,c=i.length;h<c;f=++h)r=i[f],r=r[0].toUpperCase()+r.substr(1),r==="Top"||r==="Left"?t[f]+=parseFloat(s["border"+r+"Width"]):t[f]-=parseFloat(s["border"+r+"Width"]);return t};this.Tether.modules.push({position:function(t){var g,k,ut,a,nt,tt,ii,b,s,v,c,d,yt,ri,p,w,pt,vi,ft,h,ot,it,wt,rt,ui,l,y,st,ht,ct,lt,fi,ei,oi,si,hi,ci,at,vt,bt,kt,dt,gt,ni,ti,li,ai,et=this;if(l=t.top,c=t.left,ot=t.targetAttachment,!this.options.constraints)return!0;for(vi=function(n){var u,t,f,r;for(et.removeClass(n),r=[],t=0,f=i.length;t<f;t++)u=i[t],r.push(et.removeClass(""+n+"-"+u));return r},bt=this.cache("element-bounds",function(){return u(et.element)}),v=bt.height,y=bt.width,y===0&&v===0&&this.lastSize!=null&&(kt=this.lastSize,y=kt.width,v=kt.height),wt=this.cache("target-bounds",function(){return et.getTargetBounds()}),it=wt.height,rt=wt.width,h={},s={},k=[this.getClass("pinned"),this.getClass("out-of-bounds")],dt=this.options.constraints,st=0,fi=dt.length;st<fi;st++)b=dt[st],b.outOfBoundsClass&&k.push(b.outOfBoundsClass),b.pinnedClass&&k.push(b.pinnedClass);for(ht=0,ei=k.length;ht<ei;ht++)for(ii=k[ht],gt=["left","top","right","bottom"],ct=0,oi=gt.length;ct<oi;ct++)ft=gt[ct],k.push(""+ii+"-"+ft);for(g=[],h=r({},ot),s=r({},this.attachment),ni=this.options.constraints,lt=0,si=ni.length;lt<si;lt++){if(b=ni[lt],ui=b.to,ut=b.attachment,p=b.pin,ut==null&&(ut=""),n.call(ut," ")>=0?(ti=ut.split(" "),tt=ti[0],nt=ti[1]):nt=tt=ut,a=o(this,ui),(tt==="target"||tt==="both")&&(l<a[1]&&h.top==="top"&&(l+=it,h.top="bottom"),l+v>a[3]&&h.top==="bottom"&&(l-=it,h.top="top")),tt==="together"&&(l<a[1]&&h.top==="top"&&(s.top==="bottom"?(l+=it,h.top="bottom",l+=v,s.top="top"):s.top==="top"&&(l+=it,h.top="bottom",l-=v,s.top="bottom")),l+v>a[3]&&h.top==="bottom"&&(s.top==="top"?(l-=it,h.top="top",l-=v,s.top="bottom"):s.top==="bottom"&&(l-=it,h.top="top",l+=v,s.top="top")),h.top==="middle"&&(l+v>a[3]&&s.top==="top"?(l-=v,s.top="bottom"):l<a[1]&&s.top==="bottom"&&(l+=v,s.top="top"))),(nt==="target"||nt==="both")&&(c<a[0]&&h.left==="left"&&(c+=rt,h.left="right"),c+y>a[2]&&h.left==="right"&&(c-=rt,h.left="left")),nt==="together"&&(c<a[0]&&h.left==="left"?s.left==="right"?(c+=rt,h.left="right",c+=y,s.left="left"):s.left==="left"&&(c+=rt,h.left="right",c-=y,s.left="right"):c+y>a[2]&&h.left==="right"?s.left==="left"?(c-=rt,h.left="left",c-=y,s.left="right"):s.left==="right"&&(c-=rt,h.left="left",c+=y,s.left="left"):h.left==="center"&&(c+y>a[2]&&s.left==="left"?(c-=y,s.left="right"):c<a[0]&&s.left==="right"&&(c+=y,s.left="left"))),(tt==="element"||tt==="both")&&(l<a[1]&&s.top==="bottom"&&(l+=v,s.top="top"),l+v>a[3]&&s.top==="top"&&(l-=v,s.top="bottom")),(nt==="element"||nt==="both")&&(c<a[0]&&s.left==="right"&&(c+=y,s.left="left"),c+y>a[2]&&s.left==="left"&&(c-=y,s.left="right")),typeof p=="string"?p=function(){var r,n,t,i;for(t=p.split(","),i=[],n=0,r=t.length;n<r;n++)ri=t[n],i.push(ri.trim());return i}():p===!0&&(p=["top","left","right","bottom"]),p||(p=[]),w=[],d=[],l<a[1]&&(n.call(p,"top")>=0?(l=a[1],w.push("top")):d.push("top")),l+v>a[3]&&(n.call(p,"bottom")>=0?(l=a[3]-v,w.push("bottom")):d.push("bottom")),c<a[0]&&(n.call(p,"left")>=0?(c=a[0],w.push("left")):d.push("left")),c+y>a[2]&&(n.call(p,"right")>=0?(c=a[2]-y,w.push("right")):d.push("right")),w.length)for(pt=(li=this.options.pinnedClass)!=null?li:this.getClass("pinned"),g.push(pt),at=0,hi=w.length;at<hi;at++)ft=w[at],g.push(""+pt+"-"+ft);if(d.length)for(yt=(ai=this.options.outOfBoundsClass)!=null?ai:this.getClass("out-of-bounds"),g.push(yt),vt=0,ci=d.length;vt<ci;vt++)ft=d[vt],g.push(""+yt+"-"+ft);(n.call(w,"left")>=0||n.call(w,"right")>=0)&&(s.left=h.left=!1);(n.call(w,"top")>=0||n.call(w,"bottom")>=0)&&(s.top=h.top=!1);(h.top!==ot.top||h.left!==ot.left||s.top!==this.attachment.top||s.left!==this.attachment.left)&&this.updateAttachClasses(s,h)}return e(function(){return f(et.target,g,k),f(et.element,g,k)}),{top:l,left:c}}})}.call(this),function(){var i,r,t,n;n=this.Tether.Utils;r=n.getBounds;t=n.updateClasses;i=n.defer;this.Tether.modules.push({position:function(n){var e,o,s,p,tt,h,w,u,b,f,c,it,l,a,v,y,rt,ut,ft,et,k,d,ot,g,st,nt=this;if(c=n.top,h=n.left,k=this.cache("element-bounds",function(){return r(nt.element)}),tt=k.height,it=k.width,f=this.getTargetBounds(),p=c+tt,w=h+it,e=[],c<=f.bottom&&p>=f.top)for(d=["left","right"],l=0,rt=d.length;l<rt;l++)u=d[l],((ot=f[u])===h||ot===w)&&e.push(u);if(h<=f.right&&w>=f.left)for(g=["top","bottom"],a=0,ut=g.length;a<ut;a++)u=g[a],((st=f[u])===c||st===p)&&e.push(u);for(s=[],o=[],b=["left","top","right","bottom"],s.push(this.getClass("abutted")),v=0,ft=b.length;v<ft;v++)u=b[v],s.push(""+this.getClass("abutted")+"-"+u);for(e.length&&o.push(this.getClass("abutted")),y=0,et=e.length;y<et;y++)u=e[y],o.push(""+this.getClass("abutted")+"-"+u);return i(function(){return t(nt.target,o,s),t(nt.element,o,s)}),!0}})}.call(this),function(){this.Tether.modules.push({position:function(n){var u,o,t,i,r,f,e;if(f=n.top,u=n.left,this.options.shift)return o=function(n){return typeof n=="function"?n.call(this,{top:f,left:u}):n},t=o(this.options.shift),typeof t=="string"?(t=t.split(" "),t[1]||(t[1]=t[0]),r=t[0],i=t[1],r=parseFloat(r,10),i=parseFloat(i,10)):(e=[t.top,t.left],r=e[0],i=e[1]),f+=r,u+=i,{top:f,left:u}}})}.call(this),this.Tether})