Comparing version 2.1.7 to 2.2.0
{ | ||
"name": "hc-sticky", | ||
"version": "2.1.7", | ||
"description": "Cross-browser plugin that makes any element on your page visible while you scroll", | ||
"version": "2.2.0", | ||
"description": "Dependency free javascript library that makes elements on your page visible while you scroll", | ||
"homepage": "https://github.com/somewebmedia/hc-sticky", | ||
@@ -10,3 +10,12 @@ "authors": [ | ||
"license": "MIT", | ||
"main": "dist/hc-sticky.js" | ||
"main": "dist/hc-sticky.js", | ||
"keywords": [ | ||
"sticky", | ||
"fixed", | ||
"affix", | ||
"scroll", | ||
"sidebar", | ||
"jquery", | ||
"plugin" | ||
] | ||
} |
@@ -1,1 +0,1 @@ | ||
!function o(i,s,a){function f(n,t){if(!s[n]){if(!i[n]){var e="function"==typeof require&&require;if(!t&&e)return e(n,!0);if(u)return u(n,!0);throw new Error("Cannot find module '"+n+"'")}var r=s[n]={exports:{}};i[n][0].call(r.exports,function(t){var e=i[n][1][t];return f(e||t)},r,r.exports,o,i,s,a)}return s[n].exports}for(var u="function"==typeof require&&require,t=0;t<a.length;t++)f(a[t]);return f}({1:[function(u,t,e){(function(t,e,n,r,o,i,s,a,f){"use strict";new(u("../../dist/hc-sticky.js"))("aside",{stickTo:"main",queries:{980:{disable:!0}}})}).call(this,u("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},u("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_54b52e06.js","/")},{"../../dist/hc-sticky.js":2,buffer:4,rH1JPG:6}],2:[function(t,u,e){(function(t,e,n,r,o,i,s,a,f){!function(t,e){"use strict";if("object"==typeof u&&"object"==typeof u.exports){if(!t.document)throw new Error("HC-Sticky requires a browser to run.");u.exports=e(t)}else"function"==typeof define&&define.amd?define("hcSticky",[],e(t)):e(t)}("undefined"!=typeof window?window:this,function(R){"use strict";var q={top:0,bottom:0,bottomEnd:0,innerTop:0,innerSticker:null,stickyClass:"sticky",stickTo:null,followScroll:!0,queries:null,queryFlow:"down",onStart:null,onStop:null,onBeforeResize:null,onResize:null,resizeDebounce:100,disable:!1},J=R.document,G=function(o,c){if("string"==typeof o&&(o=J.querySelector(o)),!o)return!1;var d={},h=G.Helpers,i=o.parentNode;"static"===h.getStyle(i,"position")&&(i.style.position="relative");var p=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h.isEmptyObject(t)&&!h.isEmptyObject(d)||(d=Object.assign({},q,d,t))},t=function(){return d.disable},e=function(){if(d.queries){var t=R.innerWidth,e=d.queryFlow,n=d.queries;if(l=c,d=Object.assign({},q,l||{}),"up"===e)for(var r in n)r<=t&&!h.isEmptyObject(n[r])&&p(n[r]);else{var o=[];for(var i in d.queries){var s={};s[i]=n[i],o.push(s)}for(var a=o.length-1;0<=a;a--){var f=o[a],u=Object.keys(f)[0];t<=u&&!h.isEmptyObject(f[u])&&p(f[u])}}}var l},s={css:{},position:null,stick:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h.hasClass(o,d.stickyClass)||(!1===a.isAttached&&a.attach(),s.position="fixed",o.style.position="fixed",o.style.left=a.offsetLeft+"px",o.style.width=a.width,void 0===t.bottom?o.style.bottom="auto":o.style.bottom=t.bottom+"px",void 0===t.top?o.style.top="auto":o.style.top=t.top+"px",o.classList?o.classList.add(d.stickyClass):o.className+=" "+d.stickyClass,d.onStart&&d.onStart.call(o,d))},release:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(t.stop=t.stop||!1,!0===t.stop||"fixed"===s.position||null===s.position||!(void 0===t.top&&void 0===t.bottom||void 0!==t.top&&(parseInt(h.getStyle(o,"top"))||0)===t.top||void 0!==t.bottom&&(parseInt(h.getStyle(o,"bottom"))||0)===t.bottom)){!0===t.stop?!0===a.isAttached&&a.detach():!1===a.isAttached&&a.attach();var e=t.position||s.css.position;s.position=e,o.style.position=e,o.style.left=!0===t.stop?s.css.left:a.positionLeft+"px",o.style.width="absolute"!==e?s.css.width:a.width,void 0===t.bottom?o.style.bottom=!0===t.stop?"":"auto":o.style.bottom=t.bottom+"px",void 0===t.top?o.style.top=!0===t.stop?"":"auto":o.style.top=t.top+"px",o.classList?o.classList.remove(d.stickyClass):o.className=o.className.replace(new RegExp("(^|\\b)"+d.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),d.onStop&&d.onStop.call(o,d)}}},a={el:J.createElement("div"),offsetLeft:null,positionLeft:null,width:null,isAttached:!1,init:function(){for(var t in s.css)a.el.style[t]=s.css[t];a.el.style["z-index"]="-1";var e=h.getStyle(o);a.offsetLeft=h.offset(o).left-(parseInt(e.marginLeft)||0),a.positionLeft=h.position(o).left,a.width=h.getStyle(o,"width")},attach:function(){i.insertBefore(a.el,o),a.isAttached=!0},detach:function(){a.el=i.removeChild(a.el),a.isAttached=!1}},f=void 0,u=void 0,l=void 0,g=void 0,y=void 0,b=void 0,m=void 0,v=void 0,w=void 0,E=void 0,I=void 0,L=void 0,S=void 0,B=void 0,A=void 0,k=void 0,T=void 0,x=void 0,C=R.pageYOffset||J.documentElement.scrollTop,U=0,N=void 0,j=function(){A=x(),g=T(),S=y+g-v-I,B=m<A;var t=R.pageYOffset||J.documentElement.scrollTop,e=Math.round(h.offset(o).top),n=e-t,r=void 0;N=t<C?"up":"down",U=t-C,L<(C=t)?S+v+(B?w:0)-(d.followScroll&&B?0:v)<=t+A-E-(m-(L-E)<A-E&&d.followScroll&&0<(r=A-m-E)?r:0)?s.release({position:"absolute",bottom:b+i.offsetHeight-S-v}):B&&d.followScroll?"down"===N?Math.floor(n+A+w)<=m?s.stick({bottom:w}):"fixed"===s.position&&s.release({position:"absolute",top:e-v-L-U+E}):Math.ceil(n+E)<0&&"fixed"===s.position?s.release({position:"absolute",top:e-v-L+E-U}):t+v-E<=e&&s.stick({top:v-E}):s.stick({top:v-E}):s.release({stop:!0})},_=!1,n=!1,M=function(){_&&(h.event.unbind(R,"scroll",j),_=!1)},r=function(){var t,e,n,r;null!==o.offsetParent&&"none"!==h.getStyle(o,"display")?(s.css=(t=o,e=h.getCascadedStyle(t),n=h.getStyle(t),r={height:t.offsetHeight+"px",left:e.left,right:e.right,top:e.top,bottom:e.bottom,position:n.position,display:n.display,verticalAlign:n.verticalAlign,boxSizing:n.boxSizing,marginLeft:e.marginLeft,marginRight:e.marginRight,marginTop:e.marginTop,marginBottom:e.marginBottom,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight},e.float&&(r.float=e.float||"none"),e.cssFloat&&(r.cssFloat=e.cssFloat||"none"),n.MozBoxSizing&&(r.MozBoxSizing=n.MozBoxSizing),r.width="auto"!==e.width?e.width:"border-box"===r.boxSizing||"border-box"===r.MozBoxSizing?t.offsetWidth+"px":n.width,r),a.init(),f=!(!d.stickTo||!("document"===d.stickTo||d.stickTo.nodeType&&9===d.stickTo.nodeType||"object"==typeof d.stickTo&&d.stickTo instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document))),u=d.stickTo?f?J:"string"==typeof d.stickTo?J.querySelector(d.stickTo):d.stickTo:i,A=(x=function(){var t=o.offsetHeight+(parseInt(s.css.marginTop)||0)+(parseInt(s.css.marginBottom)||0),e=(A||0)-t;return-1<=e&&e<=1?A:t})(),g=(T=function(){return f?Math.max(J.documentElement.clientHeight,J.body.scrollHeight,J.documentElement.scrollHeight,J.body.offsetHeight,J.documentElement.offsetHeight):u.offsetHeight})(),y=f?0:h.offset(u).top,b=d.stickTo?f?0:h.offset(i).top:y,m=R.innerHeight,k=o.offsetTop-(parseInt(s.css.marginTop)||0),l=d.innerSticker?"string"==typeof d.innerSticker?J.querySelector(d.innerSticker):d.innerSticker:null,v=isNaN(d.top)&&-1<d.top.indexOf("%")?parseFloat(d.top)/100*m:d.top,w=isNaN(d.bottom)&&-1<d.bottom.indexOf("%")?parseFloat(d.bottom)/100*m:d.bottom,E=l?l.offsetTop:d.innerTop?d.innerTop:0,I=isNaN(d.bottomEnd)&&-1<d.bottomEnd.indexOf("%")?parseFloat(d.bottomEnd)/100*m:d.bottomEnd,L=y-v+E+k,g<=A?M():(j(),_||(h.event.bind(R,"scroll",j),_=!0))):M()},O=function(){o.style.position="",o.style.left="",o.style.top="",o.style.bottom="",o.style.width="",o.classList?o.classList.remove(d.stickyClass):o.className=o.className.replace(new RegExp("(^|\\b)"+d.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),s.css={},!(s.position=null)===a.isAttached&&a.detach()},H=function(){O(),e(),t()?M():r()},z=function(){d.onBeforeResize&&d.onBeforeResize.call(o,d),H(),d.onResize&&d.onResize.call(o,d)},F=d.resizeDebounce?h.debounce(z,d.resizeDebounce):z,P=function(){n&&(h.event.unbind(R,"resize",F),n=!1),M()},D=function(){n||(h.event.bind(R,"resize",F),n=!0),e(),t()?M():r()};this.options=function(t){return t?d.option||null:Object.assign({},d)},this.reinit=H,this.update=function(t){p(t),c=Object.assign({},c,t||{}),H()},this.attach=D,this.detach=P,this.destroy=function(){P(),O()},p(c),D(),h.event.bind(R,"load",H)};if(void 0!==R.jQuery){var r=R.jQuery;r.fn.extend({hcSticky:function(n){return this.length?this.each(function(){var t="hcSticky",e=r.data(this,t);e?e.update(n):(e=new G(this,n),r.data(this,t,e))}):this}})}return R.hcSticky=R.hcSticky||G,G}),function(u){"use strict";var t=u.hcSticky,l=u.document;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o)for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])}return n},writable:!0,configurable:!0}),Array.prototype.forEach||(Array.prototype.forEach=function(t){var e,n;if(null==this)throw new TypeError("this is null or not defined");var r=Object(this),o=r.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(1<arguments.length&&(e=arguments[1]),n=0;n<o;){var i;n in r&&(i=r[n],t.call(e,i,n,r)),n++}});var e=function(){var t=l.documentElement,e=function(){};function r(t){var e=u.event;return e.target=e.target||e.srcElement||t,e}t.addEventListener?e=function(t,e,n){t.addEventListener(e,n,!1)}:t.attachEvent&&(e=function(e,t,n){e[t+n]=n.handleEvent?function(){var t=r(e);n.handleEvent.call(n,t)}:function(){var t=r(e);n.call(e,t)},e.attachEvent("on"+t,e[t+n])});var n=function(){};return t.removeEventListener?n=function(t,e,n){t.removeEventListener(e,n,!1)}:t.detachEvent&&(n=function(e,n,r){e.detachEvent("on"+n,e[n+r]);try{delete e[n+r]}catch(t){e[n+r]=void 0}}),{bind:e,unbind:n}}(),s=function(t,e){return u.getComputedStyle?e?l.defaultView.getComputedStyle(t,null).getPropertyValue(e):l.defaultView.getComputedStyle(t,null):t.currentStyle?e?t.currentStyle[e.replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]:t.currentStyle:void 0},a=function(t){var e=t.getBoundingClientRect(),n=u.pageYOffset||l.documentElement.scrollTop,r=u.pageXOffset||l.documentElement.scrollLeft;return{top:e.top+n,left:e.left+r}};t.Helpers={isEmptyObject:function(t){for(var e in t)return!1;return!0},debounce:function(r,o,i){var s=void 0;return function(){var t=this,e=arguments,n=i&&!s;clearTimeout(s),s=setTimeout(function(){s=null,i||r.apply(t,e)},o),n&&r.apply(t,e)}},hasClass:function(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},offset:a,position:function(t){var e=t.offsetParent,n=a(e),r=a(t),o=s(e),i=s(t);return n.top+=parseInt(o.borderTopWidth)||0,n.left+=parseInt(o.borderLeftWidth)||0,{top:r.top-n.top-(parseInt(i.marginTop)||0),left:r.left-n.left-(parseInt(i.marginLeft)||0)}},getStyle:s,getCascadedStyle:function(t){var e=t.cloneNode(!0);e.style.display="none",Array.prototype.slice.call(e.querySelectorAll('input[type="radio"]')).forEach(function(t){t.removeAttribute("name")}),t.parentNode.insertBefore(e,t.nextSibling);var n=void 0;e.currentStyle?n=e.currentStyle:u.getComputedStyle&&(n=l.defaultView.getComputedStyle(e,null));var r={};for(var o in n)!isNaN(o)||"string"!=typeof n[o]&&"number"!=typeof n[o]||(r[o]=n[o]);if(Object.keys(r).length<3)for(var i in r={},n)isNaN(i)||(r[n[i].replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]=n.getPropertyValue(n[i]));if(r.margin||"auto"!==r.marginLeft?r.margin||r.marginLeft!==r.marginRight||r.marginLeft!==r.marginTop||r.marginLeft!==r.marginBottom||(r.margin=r.marginLeft):r.margin="auto",!r.margin&&"0px"===r.marginLeft&&"0px"===r.marginRight){var s=t.offsetLeft-t.parentNode.offsetLeft,a=s-(parseInt(r.left)||0)-(parseInt(r.right)||0),f=t.parentNode.offsetWidth-t.offsetWidth-s-(parseInt(r.right)||0)+(parseInt(r.left)||0)-a;0!==f&&1!==f||(r.margin="auto")}return e.parentNode.removeChild(e),e=null,r},event:e}}(window)}).call(this,t("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../dist/hc-sticky.js","/../../dist")},{buffer:4,rH1JPG:6}],3:[function(t,e,u){(function(t,e,n,r,o,i,s,a,f){!function(t){"use strict";var l="undefined"!=typeof Uint8Array?Uint8Array:Array,n="+".charCodeAt(0),r="/".charCodeAt(0),o="0".charCodeAt(0),i="a".charCodeAt(0),s="A".charCodeAt(0),a="-".charCodeAt(0),f="_".charCodeAt(0);function c(t){var e=t.charCodeAt(0);return e===n||e===a?62:e===r||e===f?63:e<o?-1:e<o+10?e-o+26+26:e<s+26?e-s:e<i+26?e-i+26:void 0}t.toByteArray=function(t){var e,n,r,o,i,s;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var a=t.length;i="="===t.charAt(a-2)?2:"="===t.charAt(a-1)?1:0,s=new l(3*t.length/4-i),r=0<i?t.length-4:t.length;var f=0;function u(t){s[f++]=t}for(n=e=0;e<r;e+=4,n+=3)u((16711680&(o=c(t.charAt(e))<<18|c(t.charAt(e+1))<<12|c(t.charAt(e+2))<<6|c(t.charAt(e+3))))>>16),u((65280&o)>>8),u(255&o);return 2===i?u(255&(o=c(t.charAt(e))<<2|c(t.charAt(e+1))>>4)):1===i&&(u((o=c(t.charAt(e))<<10|c(t.charAt(e+1))<<4|c(t.charAt(e+2))>>2)>>8&255),u(255&o)),s},t.fromByteArray=function(t){var e,n,r,o,i=t.length%3,s="";function a(t){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)}for(e=0,r=t.length-i;e<r;e+=3)n=(t[e]<<16)+(t[e+1]<<8)+t[e+2],s+=a((o=n)>>18&63)+a(o>>12&63)+a(o>>6&63)+a(63&o);switch(i){case 1:s+=a((n=t[t.length-1])>>2),s+=a(n<<4&63),s+="==";break;case 2:s+=a((n=(t[t.length-2]<<8)+t[t.length-1])>>10),s+=a(n>>4&63),s+=a(n<<2&63),s+="="}return s}}(void 0===u?this.base64js={}:u)}).call(this,t("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/base64-js/lib/b64.js","/../../node_modules/base64-js/lib")},{buffer:4,rH1JPG:6}],4:[function(z,t,F){(function(t,e,y,n,r,o,i,s,a){var f=z("base64-js"),u=z("ieee754");function y(t,e,n){if(!(this instanceof y))return new y(t,e,n);var r,o,i,s,a,f=typeof t;if("base64"===e&&"string"===f)for(t=(r=t).trim?r.trim():r.replace(/^\s+|\s+$/g,"");t.length%4!=0;)t+="=";if("number"===f)o=k(t);else if("string"===f)o=y.byteLength(t,e);else{if("object"!==f)throw new Error("First argument needs to be a number, array or string.");o=k(t.length)}if(y._useTypedArrays?i=y._augment(new Uint8Array(o)):((i=this).length=o,i._isBuffer=!0),y._useTypedArrays&&"number"==typeof t.byteLength)i._set(t);else if(T(a=t)||y.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length)for(s=0;s<o;s++)y.isBuffer(t)?i[s]=t.readUInt8(s):i[s]=t[s];else if("string"===f)i.write(t,0,e);else if("number"===f&&!y._useTypedArrays&&!n)for(s=0;s<o;s++)i[s]=0;return i}function b(t,e,n,r){return y._charsWritten=N(function(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function l(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;o++)r+=String.fromCharCode(t[o]);return r}function c(t,e,n,r){r||(H("boolean"==typeof n,"missing or invalid endian"),H(null!=e,"missing offset"),H(e+1<t.length,"Trying to read beyond buffer length"));var o,i=t.length;if(!(i<=e))return n?(o=t[e],e+1<i&&(o|=t[e+1]<<8)):(o=t[e]<<8,e+1<i&&(o|=t[e+1])),o}function d(t,e,n,r){r||(H("boolean"==typeof n,"missing or invalid endian"),H(null!=e,"missing offset"),H(e+3<t.length,"Trying to read beyond buffer length"));var o,i=t.length;if(!(i<=e))return n?(e+2<i&&(o=t[e+2]<<16),e+1<i&&(o|=t[e+1]<<8),o|=t[e],e+3<i&&(o+=t[e+3]<<24>>>0)):(e+1<i&&(o=t[e+1]<<16),e+2<i&&(o|=t[e+2]<<8),e+3<i&&(o|=t[e+3]),o+=t[e]<<24>>>0),o}function h(t,e,n,r){if(r||(H("boolean"==typeof n,"missing or invalid endian"),H(null!=e,"missing offset"),H(e+1<t.length,"Trying to read beyond buffer length")),!(t.length<=e)){var o=c(t,e,n,!0);return 32768&o?-1*(65535-o+1):o}}function p(t,e,n,r){if(r||(H("boolean"==typeof n,"missing or invalid endian"),H(null!=e,"missing offset"),H(e+3<t.length,"Trying to read beyond buffer length")),!(t.length<=e)){var o=d(t,e,n,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function g(t,e,n,r){return r||(H("boolean"==typeof n,"missing or invalid endian"),H(e+3<t.length,"Trying to read beyond buffer length")),u.read(t,e,n,23,4)}function m(t,e,n,r){return r||(H("boolean"==typeof n,"missing or invalid endian"),H(e+7<t.length,"Trying to read beyond buffer length")),u.read(t,e,n,52,8)}function v(t,e,n,r,o){o||(H(null!=e,"missing value"),H("boolean"==typeof r,"missing or invalid endian"),H(null!=n,"missing offset"),H(n+1<t.length,"trying to write beyond buffer length"),_(e,65535));var i=t.length;if(!(i<=n))for(var s=0,a=Math.min(i-n,2);s<a;s++)t[n+s]=(e&255<<8*(r?s:1-s))>>>8*(r?s:1-s)}function w(t,e,n,r,o){o||(H(null!=e,"missing value"),H("boolean"==typeof r,"missing or invalid endian"),H(null!=n,"missing offset"),H(n+3<t.length,"trying to write beyond buffer length"),_(e,4294967295));var i=t.length;if(!(i<=n))for(var s=0,a=Math.min(i-n,4);s<a;s++)t[n+s]=e>>>8*(r?s:3-s)&255}function E(t,e,n,r,o){o||(H(null!=e,"missing value"),H("boolean"==typeof r,"missing or invalid endian"),H(null!=n,"missing offset"),H(n+1<t.length,"Trying to write beyond buffer length"),M(e,32767,-32768)),t.length<=n||v(t,0<=e?e:65535+e+1,n,r,o)}function I(t,e,n,r,o){o||(H(null!=e,"missing value"),H("boolean"==typeof r,"missing or invalid endian"),H(null!=n,"missing offset"),H(n+3<t.length,"Trying to write beyond buffer length"),M(e,2147483647,-2147483648)),t.length<=n||w(t,0<=e?e:4294967295+e+1,n,r,o)}function L(t,e,n,r,o){o||(H(null!=e,"missing value"),H("boolean"==typeof r,"missing or invalid endian"),H(null!=n,"missing offset"),H(n+3<t.length,"Trying to write beyond buffer length"),O(e,34028234663852886e22,-34028234663852886e22)),t.length<=n||u.write(t,e,n,r,23,4)}function S(t,e,n,r,o){o||(H(null!=e,"missing value"),H("boolean"==typeof r,"missing or invalid endian"),H(null!=n,"missing offset"),H(n+7<t.length,"Trying to write beyond buffer length"),O(e,17976931348623157e292,-17976931348623157e292)),t.length<=n||u.write(t,e,n,r,52,8)}F.Buffer=y,F.SlowBuffer=y,F.INSPECT_MAX_BYTES=50,y.poolSize=8192,y._useTypedArrays=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),y.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.isBuffer=function(t){return!(null==t||!t._isBuffer)},y.byteLength=function(t,e){var n;switch(t+="",e||"utf8"){case"hex":n=t.length/2;break;case"utf8":case"utf-8":n=C(t).length;break;case"ascii":case"binary":case"raw":n=t.length;break;case"base64":n=U(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;default:throw new Error("Unknown encoding")}return n},y.concat=function(t,e){if(H(T(t),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===t.length)return new y(0);if(1===t.length)return t[0];var n;if("number"!=typeof e)for(n=e=0;n<t.length;n++)e+=t[n].length;var r=new y(e),o=0;for(n=0;n<t.length;n++){var i=t[n];i.copy(r,o),o+=i.length}return r},y.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var o=r;r=e,e=n,n=o}e=Number(e)||0;var i,s,a,f,u,l,c,d,h,p,g=this.length-e;switch(n?g<(n=Number(n))&&(n=g):n=g,r=String(r||"utf8").toLowerCase()){case"hex":i=function(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?o<(r=Number(r))&&(r=o):r=o;var i=e.length;H(i%2==0,"Invalid hex string"),i/2<r&&(r=i/2);for(var s=0;s<r;s++){var a=parseInt(e.substr(2*s,2),16);H(!isNaN(a),"Invalid hex string"),t[n+s]=a}return y._charsWritten=2*s,s}(this,t,e,n);break;case"utf8":case"utf-8":d=this,h=e,p=n,i=y._charsWritten=N(C(t),d,h,p);break;case"ascii":i=b(this,t,e,n);break;case"binary":i=b(this,t,e,n);break;case"base64":u=this,l=e,c=n,i=y._charsWritten=N(U(t),u,l,c);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":s=this,a=e,f=n,i=y._charsWritten=N(function(t){for(var e,n,r,o=[],i=0;i<t.length;i++)e=t.charCodeAt(i),n=e>>8,r=e%256,o.push(r),o.push(n);return o}(t),s,a,f);break;default:throw new Error("Unknown encoding")}return i},y.prototype.toString=function(t,e,n){var r,o,i,s,a=this;if(t=String(t||"utf8").toLowerCase(),e=Number(e)||0,(n=void 0!==n?Number(n):n=a.length)===e)return"";switch(t){case"hex":r=function(t,e,n){var r=t.length;(!e||e<0)&&(e=0);(!n||n<0||r<n)&&(n=r);for(var o="",i=e;i<n;i++)o+=x(t[i]);return o}(a,e,n);break;case"utf8":case"utf-8":r=function(t,e,n){var r="",o="";n=Math.min(t.length,n);for(var i=e;i<n;i++)t[i]<=127?(r+=j(o)+String.fromCharCode(t[i]),o=""):o+="%"+t[i].toString(16);return r+j(o)}(a,e,n);break;case"ascii":r=l(a,e,n);break;case"binary":r=l(a,e,n);break;case"base64":o=a,s=n,r=0===(i=e)&&s===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(i,s));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=function(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}(a,e,n);break;default:throw new Error("Unknown encoding")}return r},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},y.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e||(e=0),r!==n&&0!==t.length&&0!==this.length){H(n<=r,"sourceEnd < sourceStart"),H(0<=e&&e<t.length,"targetStart out of bounds"),H(0<=n&&n<this.length,"sourceStart out of bounds"),H(0<=r&&r<=this.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o=r-n;if(o<100||!y._useTypedArrays)for(var i=0;i<o;i++)t[i+e]=this[i+n];else t._set(this.subarray(n,n+o),e)}},y.prototype.slice=function(t,e){var n=this.length;if(t=A(t,n,0),e=A(e,n,n),y._useTypedArrays)return y._augment(this.subarray(t,e));for(var r=e-t,o=new y(r,void 0,!0),i=0;i<r;i++)o[i]=this[i+t];return o},y.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},y.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},y.prototype.readUInt8=function(t,e){if(e||(H(null!=t,"missing offset"),H(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length))return this[t]},y.prototype.readUInt16LE=function(t,e){return c(this,t,!0,e)},y.prototype.readUInt16BE=function(t,e){return c(this,t,!1,e)},y.prototype.readUInt32LE=function(t,e){return d(this,t,!0,e)},y.prototype.readUInt32BE=function(t,e){return d(this,t,!1,e)},y.prototype.readInt8=function(t,e){if(e||(H(null!=t,"missing offset"),H(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length))return 128&this[t]?-1*(255-this[t]+1):this[t]},y.prototype.readInt16LE=function(t,e){return h(this,t,!0,e)},y.prototype.readInt16BE=function(t,e){return h(this,t,!1,e)},y.prototype.readInt32LE=function(t,e){return p(this,t,!0,e)},y.prototype.readInt32BE=function(t,e){return p(this,t,!1,e)},y.prototype.readFloatLE=function(t,e){return g(this,t,!0,e)},y.prototype.readFloatBE=function(t,e){return g(this,t,!1,e)},y.prototype.readDoubleLE=function(t,e){return m(this,t,!0,e)},y.prototype.readDoubleBE=function(t,e){return m(this,t,!1,e)},y.prototype.writeUInt8=function(t,e,n){n||(H(null!=t,"missing value"),H(null!=e,"missing offset"),H(e<this.length,"trying to write beyond buffer length"),_(t,255)),e>=this.length||(this[e]=t)},y.prototype.writeUInt16LE=function(t,e,n){v(this,t,e,!0,n)},y.prototype.writeUInt16BE=function(t,e,n){v(this,t,e,!1,n)},y.prototype.writeUInt32LE=function(t,e,n){w(this,t,e,!0,n)},y.prototype.writeUInt32BE=function(t,e,n){w(this,t,e,!1,n)},y.prototype.writeInt8=function(t,e,n){n||(H(null!=t,"missing value"),H(null!=e,"missing offset"),H(e<this.length,"Trying to write beyond buffer length"),M(t,127,-128)),e>=this.length||(0<=t?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n))},y.prototype.writeInt16LE=function(t,e,n){E(this,t,e,!0,n)},y.prototype.writeInt16BE=function(t,e,n){E(this,t,e,!1,n)},y.prototype.writeInt32LE=function(t,e,n){I(this,t,e,!0,n)},y.prototype.writeInt32BE=function(t,e,n){I(this,t,e,!1,n)},y.prototype.writeFloatLE=function(t,e,n){L(this,t,e,!0,n)},y.prototype.writeFloatBE=function(t,e,n){L(this,t,e,!1,n)},y.prototype.writeDoubleLE=function(t,e,n){S(this,t,e,!0,n)},y.prototype.writeDoubleBE=function(t,e,n){S(this,t,e,!1,n)},y.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),H("number"==typeof t&&!isNaN(t),"value is not a number"),H(e<=n,"end < start"),n!==e&&0!==this.length){H(0<=e&&e<this.length,"start out of bounds"),H(0<=n&&n<=this.length,"end out of bounds");for(var r=e;r<n;r++)this[r]=t}},y.prototype.inspect=function(){for(var t=[],e=this.length,n=0;n<e;n++)if(t[n]=x(this[n]),n===F.INSPECT_MAX_BYTES){t[n+1]="...";break}return"<Buffer "+t.join(" ")+">"},y.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(y._useTypedArrays)return new y(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;e<n;e+=1)t[e]=this[e];return t.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var B=y.prototype;function A(t,e,n){return"number"!=typeof t?n:e<=(t=~~t)?e:0<=t?t:0<=(t+=e)?t:0}function k(t){return(t=~~Math.ceil(+t))<0?0:t}function T(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function x(t){return t<16?"0"+t.toString(16):t.toString(16)}function C(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(t.charCodeAt(n));else{var o=n;55296<=r&&r<=57343&&n++;for(var i=encodeURIComponent(t.slice(o,n+1)).substr(1).split("%"),s=0;s<i.length;s++)e.push(parseInt(i[s],16))}}return e}function U(t){return f.toByteArray(t)}function N(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);o++)e[o+n]=t[o];return o}function j(t){try{return decodeURIComponent(t)}catch(t){return String.fromCharCode(65533)}}function _(t,e){H("number"==typeof t,"cannot write a non-number as a number"),H(0<=t,"specified a negative value for writing an unsigned value"),H(t<=e,"value is larger than maximum value for type"),H(Math.floor(t)===t,"value has a fractional component")}function M(t,e,n){H("number"==typeof t,"cannot write a non-number as a number"),H(t<=e,"value larger than maximum allowed value"),H(n<=t,"value smaller than minimum allowed value"),H(Math.floor(t)===t,"value has a fractional component")}function O(t,e,n){H("number"==typeof t,"cannot write a non-number as a number"),H(t<=e,"value larger than maximum allowed value"),H(n<=t,"value smaller than minimum allowed value")}function H(t,e){if(!t)throw new Error(e||"Failed assertion")}y._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=B.get,t.set=B.set,t.write=B.write,t.toString=B.toString,t.toLocaleString=B.toString,t.toJSON=B.toJSON,t.copy=B.copy,t.slice=B.slice,t.readUInt8=B.readUInt8,t.readUInt16LE=B.readUInt16LE,t.readUInt16BE=B.readUInt16BE,t.readUInt32LE=B.readUInt32LE,t.readUInt32BE=B.readUInt32BE,t.readInt8=B.readInt8,t.readInt16LE=B.readInt16LE,t.readInt16BE=B.readInt16BE,t.readInt32LE=B.readInt32LE,t.readInt32BE=B.readInt32BE,t.readFloatLE=B.readFloatLE,t.readFloatBE=B.readFloatBE,t.readDoubleLE=B.readDoubleLE,t.readDoubleBE=B.readDoubleBE,t.writeUInt8=B.writeUInt8,t.writeUInt16LE=B.writeUInt16LE,t.writeUInt16BE=B.writeUInt16BE,t.writeUInt32LE=B.writeUInt32LE,t.writeUInt32BE=B.writeUInt32BE,t.writeInt8=B.writeInt8,t.writeInt16LE=B.writeInt16LE,t.writeInt16BE=B.writeInt16BE,t.writeInt32LE=B.writeInt32LE,t.writeInt32BE=B.writeInt32BE,t.writeFloatLE=B.writeFloatLE,t.writeFloatBE=B.writeFloatBE,t.writeDoubleLE=B.writeDoubleLE,t.writeDoubleBE=B.writeDoubleBE,t.fill=B.fill,t.inspect=B.inspect,t.toArrayBuffer=B.toArrayBuffer,t}}).call(this,z("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},z("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/buffer/index.js","/../../node_modules/buffer")},{"base64-js":3,buffer:4,ieee754:5,rH1JPG:6}],5:[function(t,e,u){(function(t,e,n,r,o,i,s,a,f){u.read=function(t,e,n,r,o){var i,s,a=8*o-r-1,f=(1<<a)-1,u=f>>1,l=-7,c=n?o-1:0,d=n?-1:1,h=t[e+c];for(c+=d,i=h&(1<<-l)-1,h>>=-l,l+=a;0<l;i=256*i+t[e+c],c+=d,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;0<l;s=256*s+t[e+c],c+=d,l-=8);if(0===i)i=1-u;else{if(i===f)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),i-=u}return(h?-1:1)*s*Math.pow(2,i-r)},u.write=function(t,e,n,r,o,i){var s,a,f,u=8*i-o-1,l=(1<<u)-1,c=l>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),2<=(e+=1<=s+c?d/f:d*Math.pow(2,1-c))*f&&(s++,f/=2),l<=s+c?(a=0,s=l):1<=s+c?(a=(e*f-1)*Math.pow(2,o),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,o),s=0));8<=o;t[n+h]=255&a,h+=p,a/=256,o-=8);for(s=s<<o|a,u+=o;0<u;t[n+h]=255&s,h+=p,s/=256,u-=8);t[n+h-p]|=128*g}}).call(this,t("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/ieee754/index.js","/../../node_modules/ieee754")},{buffer:4,rH1JPG:6}],6:[function(t,l,e){(function(t,e,n,r,o,i,s,a,f){function u(){}(t=l.exports={}).nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;e!==window&&null!==e||"process-tick"!==t.data||(t.stopPropagation(),0<n.length&&n.shift()())},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),t.title="browser",t.browser=!0,t.env={},t.argv=[],t.on=u,t.addListener=u,t.once=u,t.off=u,t.removeListener=u,t.removeAllListeners=u,t.emit=u,t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")}}).call(this,t("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/process/browser.js","/../../node_modules/process")},{buffer:4,rH1JPG:6}]},{},[1]); | ||
!function o(i,s,a){function f(n,t){if(!s[n]){if(!i[n]){var e="function"==typeof require&&require;if(!t&&e)return e(n,!0);if(l)return l(n,!0);throw new Error("Cannot find module '"+n+"'")}var r=s[n]={exports:{}};i[n][0].call(r.exports,function(t){var e=i[n][1][t];return f(e||t)},r,r.exports,o,i,s,a)}return s[n].exports}for(var l="function"==typeof require&&require,t=0;t<a.length;t++)f(a[t]);return f}({1:[function(l,t,e){(function(t,e,n,r,o,i,s,a,f){"use strict";new(l("../../dist/hc-sticky.js"))("aside",{stickTo:"main",responsive:{980:{disable:!0}}})}).call(this,l("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},l("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_588ca9bd.js","/")},{"../../dist/hc-sticky.js":2,buffer:4,rH1JPG:6}],2:[function(t,l,e){(function(t,e,n,r,o,i,s,a,f){!function(t,e){"use strict";if("object"==typeof l&&"object"==typeof l.exports){if(!t.document)throw new Error("HC-Sticky requires a browser to run.");l.exports=e(t)}else"function"==typeof define&&define.amd?define("hcSticky",[],e(t)):e(t)}("undefined"!=typeof window?window:this,function(R){"use strict";var J={top:0,bottom:0,bottomEnd:0,innerTop:0,innerSticker:null,stickyClass:"sticky",stickTo:null,followScroll:!0,responsive:null,mobileFirst:!1,onStart:null,onStop:null,onBeforeResize:null,onResize:null,resizeDebounce:100,disable:!1,queries:null,queryFlow:"down"},G=function(t,e,n){console.log("%c! HC Sticky:%c "+t+"%c "+n+" is now deprecated and will be removed. Use%c "+e+"%c instead.","color: red","color: darkviolet","color: black","color: darkviolet","color: black")},W=R.document,V=function(o,u){var n=this;if("string"==typeof o&&(o=W.querySelector(o)),!o)return!1;u.queries&&G("queries","responsive","option"),u.queryFlow&&G("queryFlow","mobileFirst","option");var c={},d=V.Helpers,i=o.parentNode;"static"===d.getStyle(i,"position")&&(i.style.position="relative");var h=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};d.isEmptyObject(t)&&!d.isEmptyObject(c)||(c=Object.assign({},J,c,t))},t=function(){return c.disable},e=function(){if(c.queries){var t=R.innerWidth,e=c.responsive||c.queries;if(l=u,(c=Object.assign({},J,l||{})).mobileFirst)for(var n in e)n<=t&&!d.isEmptyObject(e[n])&&h(e[n]);else{var r=[];for(var o in c.queries){var i={};i[o]=e[o],r.push(i)}for(var s=r.length-1;0<=s;s--){var a=r[s],f=Object.keys(a)[0];t<=f&&!d.isEmptyObject(a[f])&&h(a[f])}}}var l},s={css:{},position:null,stick:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};d.hasClass(o,c.stickyClass)||(!1===a.isAttached&&a.attach(),s.position="fixed",o.style.position="fixed",o.style.left=a.offsetLeft+"px",o.style.width=a.width,void 0===t.bottom?o.style.bottom="auto":o.style.bottom=t.bottom+"px",void 0===t.top?o.style.top="auto":o.style.top=t.top+"px",o.classList?o.classList.add(c.stickyClass):o.className+=" "+c.stickyClass,c.onStart&&c.onStart.call(o,Object.assign({},c)))},release:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(t.stop=t.stop||!1,!0===t.stop||"fixed"===s.position||null===s.position||!(void 0===t.top&&void 0===t.bottom||void 0!==t.top&&(parseInt(d.getStyle(o,"top"))||0)===t.top||void 0!==t.bottom&&(parseInt(d.getStyle(o,"bottom"))||0)===t.bottom)){!0===t.stop?!0===a.isAttached&&a.detach():!1===a.isAttached&&a.attach();var e=t.position||s.css.position;s.position=e,o.style.position=e,o.style.left=!0===t.stop?s.css.left:a.positionLeft+"px",o.style.width="absolute"!==e?s.css.width:a.width,void 0===t.bottom?o.style.bottom=!0===t.stop?"":"auto":o.style.bottom=t.bottom+"px",void 0===t.top?o.style.top=!0===t.stop?"":"auto":o.style.top=t.top+"px",o.classList?o.classList.remove(c.stickyClass):o.className=o.className.replace(new RegExp("(^|\\b)"+c.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),c.onStop&&c.onStop.call(o,Object.assign({},c))}}},a={el:W.createElement("div"),offsetLeft:null,positionLeft:null,width:null,isAttached:!1,init:function(){for(var t in s.css)a.el.style[t]=s.css[t];a.el.style["z-index"]="-1";var e=d.getStyle(o);a.offsetLeft=d.offset(o).left-(parseInt(e.marginLeft)||0),a.positionLeft=d.position(o).left,a.width=d.getStyle(o,"width")},attach:function(){i.insertBefore(a.el,o),a.isAttached=!0},detach:function(){a.el=i.removeChild(a.el),a.isAttached=!1}},f=void 0,l=void 0,p=void 0,g=void 0,y=void 0,b=void 0,m=void 0,v=void 0,w=void 0,E=void 0,I=void 0,L=void 0,S=void 0,B=void 0,k=void 0,A=void 0,T=void 0,x=void 0,C=R.pageYOffset||W.documentElement.scrollTop,U=0,j=void 0,N=function(){k=x(),g=T(),S=y+g-v-I,B=m<k;var t=R.pageYOffset||W.documentElement.scrollTop,e=Math.round(d.offset(o).top),n=e-t,r=void 0;j=t<C?"up":"down",U=t-C,L<(C=t)?S+v+(B?w:0)-(c.followScroll&&B?0:v)<=t+k-E-(m-(L-E)<k-E&&c.followScroll&&0<(r=k-m-E)?r:0)?s.release({position:"absolute",bottom:b+i.offsetHeight-S-v}):B&&c.followScroll?"down"===j?Math.floor(n+k+w)<=m?s.stick({bottom:w}):"fixed"===s.position&&s.release({position:"absolute",top:e-v-L-U+E}):Math.ceil(n+E)<0&&"fixed"===s.position?s.release({position:"absolute",top:e-v-L+E-U}):t+v-E<=e&&s.stick({top:v-E}):s.stick({top:v-E}):s.release({stop:!0})},M=!1,r=!1,_=function(){M&&(d.event.unbind(R,"scroll",N),M=!1)},O=function(){var t,e,n,r;null!==o.offsetParent&&"none"!==d.getStyle(o,"display")?(s.css=(t=o,e=d.getCascadedStyle(t),n=d.getStyle(t),r={height:t.offsetHeight+"px",left:e.left,right:e.right,top:e.top,bottom:e.bottom,position:n.position,display:n.display,verticalAlign:n.verticalAlign,boxSizing:n.boxSizing,marginLeft:e.marginLeft,marginRight:e.marginRight,marginTop:e.marginTop,marginBottom:e.marginBottom,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight},e.float&&(r.float=e.float||"none"),e.cssFloat&&(r.cssFloat=e.cssFloat||"none"),n.MozBoxSizing&&(r.MozBoxSizing=n.MozBoxSizing),r.width="auto"!==e.width?e.width:"border-box"===r.boxSizing||"border-box"===r.MozBoxSizing?t.offsetWidth+"px":n.width,r),a.init(),f=!(!c.stickTo||!("document"===c.stickTo||c.stickTo.nodeType&&9===c.stickTo.nodeType||"object"==typeof c.stickTo&&c.stickTo instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document))),l=c.stickTo?f?W:"string"==typeof c.stickTo?W.querySelector(c.stickTo):c.stickTo:i,k=(x=function(){var t=o.offsetHeight+(parseInt(s.css.marginTop)||0)+(parseInt(s.css.marginBottom)||0),e=(k||0)-t;return-1<=e&&e<=1?k:t})(),g=(T=function(){return f?Math.max(W.documentElement.clientHeight,W.body.scrollHeight,W.documentElement.scrollHeight,W.body.offsetHeight,W.documentElement.offsetHeight):l.offsetHeight})(),y=f?0:d.offset(l).top,b=c.stickTo?f?0:d.offset(i).top:y,m=R.innerHeight,A=o.offsetTop-(parseInt(s.css.marginTop)||0),p=c.innerSticker?"string"==typeof c.innerSticker?W.querySelector(c.innerSticker):c.innerSticker:null,v=isNaN(c.top)&&-1<c.top.indexOf("%")?parseFloat(c.top)/100*m:c.top,w=isNaN(c.bottom)&&-1<c.bottom.indexOf("%")?parseFloat(c.bottom)/100*m:c.bottom,E=p?p.offsetTop:c.innerTop?c.innerTop:0,I=isNaN(c.bottomEnd)&&-1<c.bottomEnd.indexOf("%")?parseFloat(c.bottomEnd)/100*m:c.bottomEnd,L=y-v+E+A,g<=k?_():(N(),M||(d.event.bind(R,"scroll",N),M=!0))):_()},F=function(){o.style.position="",o.style.left="",o.style.top="",o.style.bottom="",o.style.width="",o.classList?o.classList.remove(c.stickyClass):o.className=o.className.replace(new RegExp("(^|\\b)"+c.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),s.css={},!(s.position=null)===a.isAttached&&a.detach()},H=function(){F(),e(),t()?_():O()},z=function(){c.onBeforeResize&&c.onBeforeResize.call(o,Object.assign({},c)),H(),c.onResize&&c.onResize.call(o,Object.assign({},c))},P=c.resizeDebounce?d.debounce(z,c.resizeDebounce):z,q=function(){r&&(d.event.unbind(R,"resize",P),r=!1),_()},D=function(){r||(d.event.bind(R,"resize",P),r=!0),e(),t()?_():O()};this.options=function(t){return t?c[t]:Object.assign({},c)},this.refresh=H,this.update=function(t){h(t),u=Object.assign({},u,t||{}),H()},this.attach=D,this.detach=q,this.destroy=function(){q(),F()},this.triggerMethod=function(t,e){"function"==typeof n[t]&&n[t](e)},this.reinit=function(){G("reinit","refresh","method"),H()},h(u),D(),d.event.bind(R,"load",H)};if(void 0!==R.jQuery){var r=R.jQuery,o="hcSticky";r.fn.extend({hcSticky:function(e,n){return this.length?"options"===e?r.data(this.get(0),o).options():this.each(function(){var t=r.data(this,o);t?t.triggerMethod(e,n):(t=new V(this,e),r.data(this,o,t))}):this}})}return R.hcSticky=R.hcSticky||V,V}),function(l){"use strict";var t=l.hcSticky,u=l.document;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o)for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])}return n},writable:!0,configurable:!0}),Array.prototype.forEach||(Array.prototype.forEach=function(t){var e,n;if(null==this)throw new TypeError("this is null or not defined");var r=Object(this),o=r.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(1<arguments.length&&(e=arguments[1]),n=0;n<o;){var i;n in r&&(i=r[n],t.call(e,i,n,r)),n++}});var e=function(){var t=u.documentElement,e=function(){};function r(t){var e=l.event;return e.target=e.target||e.srcElement||t,e}t.addEventListener?e=function(t,e,n){t.addEventListener(e,n,!1)}:t.attachEvent&&(e=function(e,t,n){e[t+n]=n.handleEvent?function(){var t=r(e);n.handleEvent.call(n,t)}:function(){var t=r(e);n.call(e,t)},e.attachEvent("on"+t,e[t+n])});var n=function(){};return t.removeEventListener?n=function(t,e,n){t.removeEventListener(e,n,!1)}:t.detachEvent&&(n=function(e,n,r){e.detachEvent("on"+n,e[n+r]);try{delete e[n+r]}catch(t){e[n+r]=void 0}}),{bind:e,unbind:n}}(),s=function(t,e){return l.getComputedStyle?e?u.defaultView.getComputedStyle(t,null).getPropertyValue(e):u.defaultView.getComputedStyle(t,null):t.currentStyle?e?t.currentStyle[e.replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]:t.currentStyle:void 0},a=function(t){var e=t.getBoundingClientRect(),n=l.pageYOffset||u.documentElement.scrollTop,r=l.pageXOffset||u.documentElement.scrollLeft;return{top:e.top+n,left:e.left+r}};t.Helpers={isEmptyObject:function(t){for(var e in t)return!1;return!0},debounce:function(r,o,i){var s=void 0;return function(){var t=this,e=arguments,n=i&&!s;clearTimeout(s),s=setTimeout(function(){s=null,i||r.apply(t,e)},o),n&&r.apply(t,e)}},hasClass:function(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},offset:a,position:function(t){var e=t.offsetParent,n=a(e),r=a(t),o=s(e),i=s(t);return n.top+=parseInt(o.borderTopWidth)||0,n.left+=parseInt(o.borderLeftWidth)||0,{top:r.top-n.top-(parseInt(i.marginTop)||0),left:r.left-n.left-(parseInt(i.marginLeft)||0)}},getStyle:s,getCascadedStyle:function(t){var e=t.cloneNode(!0);e.style.display="none",Array.prototype.slice.call(e.querySelectorAll('input[type="radio"]')).forEach(function(t){t.removeAttribute("name")}),t.parentNode.insertBefore(e,t.nextSibling);var n=void 0;e.currentStyle?n=e.currentStyle:l.getComputedStyle&&(n=u.defaultView.getComputedStyle(e,null));var r={};for(var o in n)!isNaN(o)||"string"!=typeof n[o]&&"number"!=typeof n[o]||(r[o]=n[o]);if(Object.keys(r).length<3)for(var i in r={},n)isNaN(i)||(r[n[i].replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]=n.getPropertyValue(n[i]));if(r.margin||"auto"!==r.marginLeft?r.margin||r.marginLeft!==r.marginRight||r.marginLeft!==r.marginTop||r.marginLeft!==r.marginBottom||(r.margin=r.marginLeft):r.margin="auto",!r.margin&&"0px"===r.marginLeft&&"0px"===r.marginRight){var s=t.offsetLeft-t.parentNode.offsetLeft,a=s-(parseInt(r.left)||0)-(parseInt(r.right)||0),f=t.parentNode.offsetWidth-t.offsetWidth-s-(parseInt(r.right)||0)+(parseInt(r.left)||0)-a;0!==f&&1!==f||(r.margin="auto")}return e.parentNode.removeChild(e),e=null,r},event:e}}(window)}).call(this,t("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../dist/hc-sticky.js","/../../dist")},{buffer:4,rH1JPG:6}],3:[function(t,e,l){(function(t,e,n,r,o,i,s,a,f){!function(t){"use strict";var u="undefined"!=typeof Uint8Array?Uint8Array:Array,n="+".charCodeAt(0),r="/".charCodeAt(0),o="0".charCodeAt(0),i="a".charCodeAt(0),s="A".charCodeAt(0),a="-".charCodeAt(0),f="_".charCodeAt(0);function c(t){var e=t.charCodeAt(0);return e===n||e===a?62:e===r||e===f?63:e<o?-1:e<o+10?e-o+26+26:e<s+26?e-s:e<i+26?e-i+26:void 0}t.toByteArray=function(t){var e,n,r,o,i,s;if(0<t.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var a=t.length;i="="===t.charAt(a-2)?2:"="===t.charAt(a-1)?1:0,s=new u(3*t.length/4-i),r=0<i?t.length-4:t.length;var f=0;function l(t){s[f++]=t}for(n=e=0;e<r;e+=4,n+=3)l((16711680&(o=c(t.charAt(e))<<18|c(t.charAt(e+1))<<12|c(t.charAt(e+2))<<6|c(t.charAt(e+3))))>>16),l((65280&o)>>8),l(255&o);return 2===i?l(255&(o=c(t.charAt(e))<<2|c(t.charAt(e+1))>>4)):1===i&&(l((o=c(t.charAt(e))<<10|c(t.charAt(e+1))<<4|c(t.charAt(e+2))>>2)>>8&255),l(255&o)),s},t.fromByteArray=function(t){var e,n,r,o,i=t.length%3,s="";function a(t){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)}for(e=0,r=t.length-i;e<r;e+=3)n=(t[e]<<16)+(t[e+1]<<8)+t[e+2],s+=a((o=n)>>18&63)+a(o>>12&63)+a(o>>6&63)+a(63&o);switch(i){case 1:s+=a((n=t[t.length-1])>>2),s+=a(n<<4&63),s+="==";break;case 2:s+=a((n=(t[t.length-2]<<8)+t[t.length-1])>>10),s+=a(n>>4&63),s+=a(n<<2&63),s+="="}return s}}(void 0===l?this.base64js={}:l)}).call(this,t("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/base64-js/lib/b64.js","/../../node_modules/base64-js/lib")},{buffer:4,rH1JPG:6}],4:[function(H,t,z){(function(t,e,y,n,r,o,i,s,a){var f=H("base64-js"),l=H("ieee754");function y(t,e,n){if(!(this instanceof y))return new y(t,e,n);var r,o,i,s,a,f=typeof t;if("base64"===e&&"string"===f)for(t=(r=t).trim?r.trim():r.replace(/^\s+|\s+$/g,"");t.length%4!=0;)t+="=";if("number"===f)o=A(t);else if("string"===f)o=y.byteLength(t,e);else{if("object"!==f)throw new Error("First argument needs to be a number, array or string.");o=A(t.length)}if(y._useTypedArrays?i=y._augment(new Uint8Array(o)):((i=this).length=o,i._isBuffer=!0),y._useTypedArrays&&"number"==typeof t.byteLength)i._set(t);else if(T(a=t)||y.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length)for(s=0;s<o;s++)y.isBuffer(t)?i[s]=t.readUInt8(s):i[s]=t[s];else if("string"===f)i.write(t,0,e);else if("number"===f&&!y._useTypedArrays&&!n)for(s=0;s<o;s++)i[s]=0;return i}function b(t,e,n,r){return y._charsWritten=j(function(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function u(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;o++)r+=String.fromCharCode(t[o]);return r}function c(t,e,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(null!=e,"missing offset"),F(e+1<t.length,"Trying to read beyond buffer length"));var o,i=t.length;if(!(i<=e))return n?(o=t[e],e+1<i&&(o|=t[e+1]<<8)):(o=t[e]<<8,e+1<i&&(o|=t[e+1])),o}function d(t,e,n,r){r||(F("boolean"==typeof n,"missing or invalid endian"),F(null!=e,"missing offset"),F(e+3<t.length,"Trying to read beyond buffer length"));var o,i=t.length;if(!(i<=e))return n?(e+2<i&&(o=t[e+2]<<16),e+1<i&&(o|=t[e+1]<<8),o|=t[e],e+3<i&&(o+=t[e+3]<<24>>>0)):(e+1<i&&(o=t[e+1]<<16),e+2<i&&(o|=t[e+2]<<8),e+3<i&&(o|=t[e+3]),o+=t[e]<<24>>>0),o}function h(t,e,n,r){if(r||(F("boolean"==typeof n,"missing or invalid endian"),F(null!=e,"missing offset"),F(e+1<t.length,"Trying to read beyond buffer length")),!(t.length<=e)){var o=c(t,e,n,!0);return 32768&o?-1*(65535-o+1):o}}function p(t,e,n,r){if(r||(F("boolean"==typeof n,"missing or invalid endian"),F(null!=e,"missing offset"),F(e+3<t.length,"Trying to read beyond buffer length")),!(t.length<=e)){var o=d(t,e,n,!0);return 2147483648&o?-1*(4294967295-o+1):o}}function g(t,e,n,r){return r||(F("boolean"==typeof n,"missing or invalid endian"),F(e+3<t.length,"Trying to read beyond buffer length")),l.read(t,e,n,23,4)}function m(t,e,n,r){return r||(F("boolean"==typeof n,"missing or invalid endian"),F(e+7<t.length,"Trying to read beyond buffer length")),l.read(t,e,n,52,8)}function v(t,e,n,r,o){o||(F(null!=e,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(null!=n,"missing offset"),F(n+1<t.length,"trying to write beyond buffer length"),M(e,65535));var i=t.length;if(!(i<=n))for(var s=0,a=Math.min(i-n,2);s<a;s++)t[n+s]=(e&255<<8*(r?s:1-s))>>>8*(r?s:1-s)}function w(t,e,n,r,o){o||(F(null!=e,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(null!=n,"missing offset"),F(n+3<t.length,"trying to write beyond buffer length"),M(e,4294967295));var i=t.length;if(!(i<=n))for(var s=0,a=Math.min(i-n,4);s<a;s++)t[n+s]=e>>>8*(r?s:3-s)&255}function E(t,e,n,r,o){o||(F(null!=e,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(null!=n,"missing offset"),F(n+1<t.length,"Trying to write beyond buffer length"),_(e,32767,-32768)),t.length<=n||v(t,0<=e?e:65535+e+1,n,r,o)}function I(t,e,n,r,o){o||(F(null!=e,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(null!=n,"missing offset"),F(n+3<t.length,"Trying to write beyond buffer length"),_(e,2147483647,-2147483648)),t.length<=n||w(t,0<=e?e:4294967295+e+1,n,r,o)}function L(t,e,n,r,o){o||(F(null!=e,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(null!=n,"missing offset"),F(n+3<t.length,"Trying to write beyond buffer length"),O(e,34028234663852886e22,-34028234663852886e22)),t.length<=n||l.write(t,e,n,r,23,4)}function S(t,e,n,r,o){o||(F(null!=e,"missing value"),F("boolean"==typeof r,"missing or invalid endian"),F(null!=n,"missing offset"),F(n+7<t.length,"Trying to write beyond buffer length"),O(e,17976931348623157e292,-17976931348623157e292)),t.length<=n||l.write(t,e,n,r,52,8)}z.Buffer=y,z.SlowBuffer=y,z.INSPECT_MAX_BYTES=50,y.poolSize=8192,y._useTypedArrays=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray}catch(t){return!1}}(),y.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.isBuffer=function(t){return!(null==t||!t._isBuffer)},y.byteLength=function(t,e){var n;switch(t+="",e||"utf8"){case"hex":n=t.length/2;break;case"utf8":case"utf-8":n=C(t).length;break;case"ascii":case"binary":case"raw":n=t.length;break;case"base64":n=U(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;default:throw new Error("Unknown encoding")}return n},y.concat=function(t,e){if(F(T(t),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===t.length)return new y(0);if(1===t.length)return t[0];var n;if("number"!=typeof e)for(n=e=0;n<t.length;n++)e+=t[n].length;var r=new y(e),o=0;for(n=0;n<t.length;n++){var i=t[n];i.copy(r,o),o+=i.length}return r},y.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var o=r;r=e,e=n,n=o}e=Number(e)||0;var i,s,a,f,l,u,c,d,h,p,g=this.length-e;switch(n?g<(n=Number(n))&&(n=g):n=g,r=String(r||"utf8").toLowerCase()){case"hex":i=function(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?o<(r=Number(r))&&(r=o):r=o;var i=e.length;F(i%2==0,"Invalid hex string"),i/2<r&&(r=i/2);for(var s=0;s<r;s++){var a=parseInt(e.substr(2*s,2),16);F(!isNaN(a),"Invalid hex string"),t[n+s]=a}return y._charsWritten=2*s,s}(this,t,e,n);break;case"utf8":case"utf-8":d=this,h=e,p=n,i=y._charsWritten=j(C(t),d,h,p);break;case"ascii":i=b(this,t,e,n);break;case"binary":i=b(this,t,e,n);break;case"base64":l=this,u=e,c=n,i=y._charsWritten=j(U(t),l,u,c);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":s=this,a=e,f=n,i=y._charsWritten=j(function(t){for(var e,n,r,o=[],i=0;i<t.length;i++)e=t.charCodeAt(i),n=e>>8,r=e%256,o.push(r),o.push(n);return o}(t),s,a,f);break;default:throw new Error("Unknown encoding")}return i},y.prototype.toString=function(t,e,n){var r,o,i,s,a=this;if(t=String(t||"utf8").toLowerCase(),e=Number(e)||0,(n=void 0!==n?Number(n):n=a.length)===e)return"";switch(t){case"hex":r=function(t,e,n){var r=t.length;(!e||e<0)&&(e=0);(!n||n<0||r<n)&&(n=r);for(var o="",i=e;i<n;i++)o+=x(t[i]);return o}(a,e,n);break;case"utf8":case"utf-8":r=function(t,e,n){var r="",o="";n=Math.min(t.length,n);for(var i=e;i<n;i++)t[i]<=127?(r+=N(o)+String.fromCharCode(t[i]),o=""):o+="%"+t[i].toString(16);return r+N(o)}(a,e,n);break;case"ascii":r=u(a,e,n);break;case"binary":r=u(a,e,n);break;case"base64":o=a,s=n,r=0===(i=e)&&s===o.length?f.fromByteArray(o):f.fromByteArray(o.slice(i,s));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=function(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}(a,e,n);break;default:throw new Error("Unknown encoding")}return r},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},y.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e||(e=0),r!==n&&0!==t.length&&0!==this.length){F(n<=r,"sourceEnd < sourceStart"),F(0<=e&&e<t.length,"targetStart out of bounds"),F(0<=n&&n<this.length,"sourceStart out of bounds"),F(0<=r&&r<=this.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o=r-n;if(o<100||!y._useTypedArrays)for(var i=0;i<o;i++)t[i+e]=this[i+n];else t._set(this.subarray(n,n+o),e)}},y.prototype.slice=function(t,e){var n=this.length;if(t=k(t,n,0),e=k(e,n,n),y._useTypedArrays)return y._augment(this.subarray(t,e));for(var r=e-t,o=new y(r,void 0,!0),i=0;i<r;i++)o[i]=this[i+t];return o},y.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},y.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},y.prototype.readUInt8=function(t,e){if(e||(F(null!=t,"missing offset"),F(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length))return this[t]},y.prototype.readUInt16LE=function(t,e){return c(this,t,!0,e)},y.prototype.readUInt16BE=function(t,e){return c(this,t,!1,e)},y.prototype.readUInt32LE=function(t,e){return d(this,t,!0,e)},y.prototype.readUInt32BE=function(t,e){return d(this,t,!1,e)},y.prototype.readInt8=function(t,e){if(e||(F(null!=t,"missing offset"),F(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length))return 128&this[t]?-1*(255-this[t]+1):this[t]},y.prototype.readInt16LE=function(t,e){return h(this,t,!0,e)},y.prototype.readInt16BE=function(t,e){return h(this,t,!1,e)},y.prototype.readInt32LE=function(t,e){return p(this,t,!0,e)},y.prototype.readInt32BE=function(t,e){return p(this,t,!1,e)},y.prototype.readFloatLE=function(t,e){return g(this,t,!0,e)},y.prototype.readFloatBE=function(t,e){return g(this,t,!1,e)},y.prototype.readDoubleLE=function(t,e){return m(this,t,!0,e)},y.prototype.readDoubleBE=function(t,e){return m(this,t,!1,e)},y.prototype.writeUInt8=function(t,e,n){n||(F(null!=t,"missing value"),F(null!=e,"missing offset"),F(e<this.length,"trying to write beyond buffer length"),M(t,255)),e>=this.length||(this[e]=t)},y.prototype.writeUInt16LE=function(t,e,n){v(this,t,e,!0,n)},y.prototype.writeUInt16BE=function(t,e,n){v(this,t,e,!1,n)},y.prototype.writeUInt32LE=function(t,e,n){w(this,t,e,!0,n)},y.prototype.writeUInt32BE=function(t,e,n){w(this,t,e,!1,n)},y.prototype.writeInt8=function(t,e,n){n||(F(null!=t,"missing value"),F(null!=e,"missing offset"),F(e<this.length,"Trying to write beyond buffer length"),_(t,127,-128)),e>=this.length||(0<=t?this.writeUInt8(t,e,n):this.writeUInt8(255+t+1,e,n))},y.prototype.writeInt16LE=function(t,e,n){E(this,t,e,!0,n)},y.prototype.writeInt16BE=function(t,e,n){E(this,t,e,!1,n)},y.prototype.writeInt32LE=function(t,e,n){I(this,t,e,!0,n)},y.prototype.writeInt32BE=function(t,e,n){I(this,t,e,!1,n)},y.prototype.writeFloatLE=function(t,e,n){L(this,t,e,!0,n)},y.prototype.writeFloatBE=function(t,e,n){L(this,t,e,!1,n)},y.prototype.writeDoubleLE=function(t,e,n){S(this,t,e,!0,n)},y.prototype.writeDoubleBE=function(t,e,n){S(this,t,e,!1,n)},y.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),F("number"==typeof t&&!isNaN(t),"value is not a number"),F(e<=n,"end < start"),n!==e&&0!==this.length){F(0<=e&&e<this.length,"start out of bounds"),F(0<=n&&n<=this.length,"end out of bounds");for(var r=e;r<n;r++)this[r]=t}},y.prototype.inspect=function(){for(var t=[],e=this.length,n=0;n<e;n++)if(t[n]=x(this[n]),n===z.INSPECT_MAX_BYTES){t[n+1]="...";break}return"<Buffer "+t.join(" ")+">"},y.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(y._useTypedArrays)return new y(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;e<n;e+=1)t[e]=this[e];return t.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var B=y.prototype;function k(t,e,n){return"number"!=typeof t?n:e<=(t=~~t)?e:0<=t?t:0<=(t+=e)?t:0}function A(t){return(t=~~Math.ceil(+t))<0?0:t}function T(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function x(t){return t<16?"0"+t.toString(16):t.toString(16)}function C(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<=127)e.push(t.charCodeAt(n));else{var o=n;55296<=r&&r<=57343&&n++;for(var i=encodeURIComponent(t.slice(o,n+1)).substr(1).split("%"),s=0;s<i.length;s++)e.push(parseInt(i[s],16))}}return e}function U(t){return f.toByteArray(t)}function j(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);o++)e[o+n]=t[o];return o}function N(t){try{return decodeURIComponent(t)}catch(t){return String.fromCharCode(65533)}}function M(t,e){F("number"==typeof t,"cannot write a non-number as a number"),F(0<=t,"specified a negative value for writing an unsigned value"),F(t<=e,"value is larger than maximum value for type"),F(Math.floor(t)===t,"value has a fractional component")}function _(t,e,n){F("number"==typeof t,"cannot write a non-number as a number"),F(t<=e,"value larger than maximum allowed value"),F(n<=t,"value smaller than minimum allowed value"),F(Math.floor(t)===t,"value has a fractional component")}function O(t,e,n){F("number"==typeof t,"cannot write a non-number as a number"),F(t<=e,"value larger than maximum allowed value"),F(n<=t,"value smaller than minimum allowed value")}function F(t,e){if(!t)throw new Error(e||"Failed assertion")}y._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=B.get,t.set=B.set,t.write=B.write,t.toString=B.toString,t.toLocaleString=B.toString,t.toJSON=B.toJSON,t.copy=B.copy,t.slice=B.slice,t.readUInt8=B.readUInt8,t.readUInt16LE=B.readUInt16LE,t.readUInt16BE=B.readUInt16BE,t.readUInt32LE=B.readUInt32LE,t.readUInt32BE=B.readUInt32BE,t.readInt8=B.readInt8,t.readInt16LE=B.readInt16LE,t.readInt16BE=B.readInt16BE,t.readInt32LE=B.readInt32LE,t.readInt32BE=B.readInt32BE,t.readFloatLE=B.readFloatLE,t.readFloatBE=B.readFloatBE,t.readDoubleLE=B.readDoubleLE,t.readDoubleBE=B.readDoubleBE,t.writeUInt8=B.writeUInt8,t.writeUInt16LE=B.writeUInt16LE,t.writeUInt16BE=B.writeUInt16BE,t.writeUInt32LE=B.writeUInt32LE,t.writeUInt32BE=B.writeUInt32BE,t.writeInt8=B.writeInt8,t.writeInt16LE=B.writeInt16LE,t.writeInt16BE=B.writeInt16BE,t.writeInt32LE=B.writeInt32LE,t.writeInt32BE=B.writeInt32BE,t.writeFloatLE=B.writeFloatLE,t.writeFloatBE=B.writeFloatBE,t.writeDoubleLE=B.writeDoubleLE,t.writeDoubleBE=B.writeDoubleBE,t.fill=B.fill,t.inspect=B.inspect,t.toArrayBuffer=B.toArrayBuffer,t}}).call(this,H("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},H("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/buffer/index.js","/../../node_modules/buffer")},{"base64-js":3,buffer:4,ieee754:5,rH1JPG:6}],5:[function(t,e,l){(function(t,e,n,r,o,i,s,a,f){l.read=function(t,e,n,r,o){var i,s,a=8*o-r-1,f=(1<<a)-1,l=f>>1,u=-7,c=n?o-1:0,d=n?-1:1,h=t[e+c];for(c+=d,i=h&(1<<-u)-1,h>>=-u,u+=a;0<u;i=256*i+t[e+c],c+=d,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=r;0<u;s=256*s+t[e+c],c+=d,u-=8);if(0===i)i=1-l;else{if(i===f)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,r),i-=l}return(h?-1:1)*s*Math.pow(2,i-r)},l.write=function(t,e,n,r,o,i){var s,a,f,l=8*i-o-1,u=(1<<l)-1,c=u>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),2<=(e+=1<=s+c?d/f:d*Math.pow(2,1-c))*f&&(s++,f/=2),u<=s+c?(a=0,s=u):1<=s+c?(a=(e*f-1)*Math.pow(2,o),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,o),s=0));8<=o;t[n+h]=255&a,h+=p,a/=256,o-=8);for(s=s<<o|a,l+=o;0<l;t[n+h]=255&s,h+=p,s/=256,l-=8);t[n+h-p]|=128*g}}).call(this,t("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/ieee754/index.js","/../../node_modules/ieee754")},{buffer:4,rH1JPG:6}],6:[function(t,u,e){(function(t,e,n,r,o,i,s,a,f){function l(){}(t=u.exports={}).nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;e!==window&&null!==e||"process-tick"!==t.data||(t.stopPropagation(),0<n.length&&n.shift()())},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),t.title="browser",t.browser=!0,t.env={},t.argv=[],t.on=l,t.addListener=l,t.once=l,t.off=l,t.removeListener=l,t.removeAllListeners=l,t.emit=l,t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")}}).call(this,t("rH1JPG"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/process/browser.js","/../../node_modules/process")},{buffer:4,rH1JPG:6}]},{},[1]); |
'use strict'; | ||
// it should actually be loaded like this: | ||
// it should actually be loaded as a dependency like this | ||
// const hcSticky = require('hc-sticky'); | ||
const hcSticky = require('../../dist/hc-sticky.js'); | ||
@@ -9,3 +10,3 @@ | ||
stickTo: 'main', | ||
queries: { | ||
responsive: { | ||
980: { | ||
@@ -12,0 +13,0 @@ disable: true |
/*! | ||
* HC-Sticky | ||
* ========= | ||
* Version: 2.1.7 | ||
* Version: 2.2.0 | ||
* Author: Some Web Media | ||
@@ -11,2 +11,2 @@ * Author URL: http://somewebmedia.com | ||
*/ | ||
!function(t,e){"use strict";if("object"==typeof module&&"object"==typeof module.exports){if(!t.document)throw new Error("HC-Sticky requires a browser to run.");module.exports=e(t)}else"function"==typeof define&&define.amd?define("hcSticky",[],e(t)):e(t)}("undefined"!=typeof window?window:this,function(V){"use strict";var Y={top:0,bottom:0,bottomEnd:0,innerTop:0,innerSticker:null,stickyClass:"sticky",stickTo:null,followScroll:!0,queries:null,queryFlow:"down",onStart:null,onStop:null,onBeforeResize:null,onResize:null,resizeDebounce:100,disable:!1},$=V.document,Q=function(i,p){if("string"==typeof i&&(i=$.querySelector(i)),!i)return!1;var u={},d=Q.Helpers,s=i.parentNode;"static"===d.getStyle(s,"position")&&(s.style.position="relative");var g=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};d.isEmptyObject(t)&&!d.isEmptyObject(u)||(u=Object.assign({},Y,u,t))},t=function(){return u.disable},e=function(){if(u.queries){var t=V.innerWidth,e=u.queryFlow,o=u.queries;if(f=p,u=Object.assign({},Y,f||{}),"up"===e)for(var n in o)n<=t&&!d.isEmptyObject(o[n])&&g(o[n]);else{var i=[];for(var s in u.queries){var r={};r[s]=o[s],i.push(r)}for(var l=i.length-1;0<=l;l--){var a=i[l],c=Object.keys(a)[0];t<=c&&!d.isEmptyObject(a[c])&&g(a[c])}}}var f},r={css:{},position:null,stick:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};d.hasClass(i,u.stickyClass)||(!1===l.isAttached&&l.attach(),r.position="fixed",i.style.position="fixed",i.style.left=l.offsetLeft+"px",i.style.width=l.width,void 0===t.bottom?i.style.bottom="auto":i.style.bottom=t.bottom+"px",void 0===t.top?i.style.top="auto":i.style.top=t.top+"px",i.classList?i.classList.add(u.stickyClass):i.className+=" "+u.stickyClass,u.onStart&&u.onStart.call(i,u))},release:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(t.stop=t.stop||!1,!0===t.stop||"fixed"===r.position||null===r.position||!(void 0===t.top&&void 0===t.bottom||void 0!==t.top&&(parseInt(d.getStyle(i,"top"))||0)===t.top||void 0!==t.bottom&&(parseInt(d.getStyle(i,"bottom"))||0)===t.bottom)){!0===t.stop?!0===l.isAttached&&l.detach():!1===l.isAttached&&l.attach();var e=t.position||r.css.position;r.position=e,i.style.position=e,i.style.left=!0===t.stop?r.css.left:l.positionLeft+"px",i.style.width="absolute"!==e?r.css.width:l.width,void 0===t.bottom?i.style.bottom=!0===t.stop?"":"auto":i.style.bottom=t.bottom+"px",void 0===t.top?i.style.top=!0===t.stop?"":"auto":i.style.top=t.top+"px",i.classList?i.classList.remove(u.stickyClass):i.className=i.className.replace(new RegExp("(^|\\b)"+u.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),u.onStop&&u.onStop.call(i,u)}}},l={el:$.createElement("div"),offsetLeft:null,positionLeft:null,width:null,isAttached:!1,init:function(){for(var t in r.css)l.el.style[t]=r.css[t];l.el.style["z-index"]="-1";var e=d.getStyle(i);l.offsetLeft=d.offset(i).left-(parseInt(e.marginLeft)||0),l.positionLeft=d.position(i).left,l.width=d.getStyle(i,"width")},attach:function(){s.insertBefore(l.el,i),l.isAttached=!0},detach:function(){l.el=s.removeChild(l.el),l.isAttached=!1}},a=void 0,c=void 0,f=void 0,m=void 0,y=void 0,h=void 0,v=void 0,b=void 0,S=void 0,w=void 0,E=void 0,k=void 0,x=void 0,L=void 0,T=void 0,j=void 0,O=void 0,C=void 0,o=function(){var t,e,o,n;r.css=(t=i,e=d.getCascadedStyle(t),o=d.getStyle(t),n={height:t.offsetHeight+"px",left:e.left,right:e.right,top:e.top,bottom:e.bottom,position:o.position,display:o.display,verticalAlign:o.verticalAlign,boxSizing:o.boxSizing,marginLeft:e.marginLeft,marginRight:e.marginRight,marginTop:e.marginTop,marginBottom:e.marginBottom,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight},e.float&&(n.float=e.float||"none"),e.cssFloat&&(n.cssFloat=e.cssFloat||"none"),o.MozBoxSizing&&(n.MozBoxSizing=o.MozBoxSizing),n.width="auto"!==e.width?e.width:"border-box"===n.boxSizing||"border-box"===n.MozBoxSizing?t.offsetWidth+"px":o.width,n),l.init(),a=!(!u.stickTo||!("document"===u.stickTo||u.stickTo.nodeType&&9===u.stickTo.nodeType||"object"==typeof u.stickTo&&u.stickTo instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document))),c=u.stickTo?a?$:"string"==typeof u.stickTo?$.querySelector(u.stickTo):u.stickTo:s,T=(C=function(){var t=i.offsetHeight+(parseInt(r.css.marginTop)||0)+(parseInt(r.css.marginBottom)||0),e=(T||0)-t;return-1<=e&&e<=1?T:t})(),m=(O=function(){return a?Math.max($.documentElement.clientHeight,$.body.scrollHeight,$.documentElement.scrollHeight,$.body.offsetHeight,$.documentElement.offsetHeight):c.offsetHeight})(),y=a?0:d.offset(c).top,h=u.stickTo?a?0:d.offset(s).top:y,v=V.innerHeight,j=i.offsetTop-(parseInt(r.css.marginTop)||0),f=u.innerSticker?"string"==typeof u.innerSticker?$.querySelector(u.innerSticker):u.innerSticker:null,b=isNaN(u.top)&&-1<u.top.indexOf("%")?parseFloat(u.top)/100*v:u.top,S=isNaN(u.bottom)&&-1<u.bottom.indexOf("%")?parseFloat(u.bottom)/100*v:u.bottom,w=f?f.offsetTop:u.innerTop?u.innerTop:0,E=isNaN(u.bottomEnd)&&-1<u.bottomEnd.indexOf("%")?parseFloat(u.bottomEnd)/100*v:u.bottomEnd,k=y-b+w+j},z=V.pageYOffset||$.documentElement.scrollTop,N=0,R=void 0,n=function(){T=C(),m=O(),x=y+m-b-E,L=v<T;var t=V.pageYOffset||$.documentElement.scrollTop,e=Math.round(d.offset(i).top),o=e-t,n=void 0;R=t<z?"up":"down",N=t-z,k<(z=t)?x+b+(L?S:0)-(u.followScroll&&L?0:b)<=t+T-w-(v-(k-w)<T-w&&u.followScroll&&0<(n=T-v-w)?n:0)?r.release({position:"absolute",bottom:h+s.offsetHeight-x-b}):L&&u.followScroll?"down"===R?Math.floor(o+T+S)<=v?r.stick({bottom:S}):"fixed"===r.position&&r.release({position:"absolute",top:e-b-k-N+w}):Math.ceil(o+w)<0&&"fixed"===r.position?r.release({position:"absolute",top:e-b-k+w-N}):t+b-w<=e&&r.stick({top:b-w}):r.stick({top:b-w}):r.release({stop:!0})},H=!1,A=!1,B=function(){H&&(d.event.unbind(V,"scroll",n),H=!1)},I=function(){null!==i.offsetParent&&"none"!==d.getStyle(i,"display")?(o(),m<=T?B():(n(),H||(d.event.bind(V,"scroll",n),H=!0))):B()},q=function(){i.style.position="",i.style.left="",i.style.top="",i.style.bottom="",i.style.width="",i.classList?i.classList.remove(u.stickyClass):i.className=i.className.replace(new RegExp("(^|\\b)"+u.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),r.css={},!(r.position=null)===l.isAttached&&l.detach()},M=function(){q(),e(),t()?B():I()},F=function(){u.onBeforeResize&&u.onBeforeResize.call(i,u),M(),u.onResize&&u.onResize.call(i,u)},D=u.resizeDebounce?d.debounce(F,u.resizeDebounce):F,P=function(){A&&(d.event.unbind(V,"resize",D),A=!1),B()},W=function(){A||(d.event.bind(V,"resize",D),A=!0),e(),t()?B():I()};this.options=function(t){return t?u.option||null:Object.assign({},u)},this.reinit=M,this.update=function(t){g(t),p=Object.assign({},p,t||{}),M()},this.attach=W,this.detach=P,this.destroy=function(){P(),q()},g(p),W(),d.event.bind(V,"load",M)};if(void 0!==V.jQuery){var n=V.jQuery;n.fn.extend({hcSticky:function(o){return this.length?this.each(function(){var t="hcSticky",e=n.data(this,t);e?e.update(o):(e=new Q(this,o),n.data(this,t,e))}):this}})}return V.hcSticky=V.hcSticky||Q,Q}),function(c){"use strict";var t=c.hcSticky,f=c.document;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(o[s]=i[s])}return o},writable:!0,configurable:!0}),Array.prototype.forEach||(Array.prototype.forEach=function(t){var e,o;if(null==this)throw new TypeError("this is null or not defined");var n=Object(this),i=n.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(1<arguments.length&&(e=arguments[1]),o=0;o<i;){var s;o in n&&(s=n[o],t.call(e,s,o,n)),o++}});var e=function(){var t=f.documentElement,e=function(){};function n(t){var e=c.event;return e.target=e.target||e.srcElement||t,e}t.addEventListener?e=function(t,e,o){t.addEventListener(e,o,!1)}:t.attachEvent&&(e=function(e,t,o){e[t+o]=o.handleEvent?function(){var t=n(e);o.handleEvent.call(o,t)}:function(){var t=n(e);o.call(e,t)},e.attachEvent("on"+t,e[t+o])});var o=function(){};return t.removeEventListener?o=function(t,e,o){t.removeEventListener(e,o,!1)}:t.detachEvent&&(o=function(e,o,n){e.detachEvent("on"+o,e[o+n]);try{delete e[o+n]}catch(t){e[o+n]=void 0}}),{bind:e,unbind:o}}(),r=function(t,e){return c.getComputedStyle?e?f.defaultView.getComputedStyle(t,null).getPropertyValue(e):f.defaultView.getComputedStyle(t,null):t.currentStyle?e?t.currentStyle[e.replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]:t.currentStyle:void 0},l=function(t){var e=t.getBoundingClientRect(),o=c.pageYOffset||f.documentElement.scrollTop,n=c.pageXOffset||f.documentElement.scrollLeft;return{top:e.top+o,left:e.left+n}};t.Helpers={isEmptyObject:function(t){for(var e in t)return!1;return!0},debounce:function(n,i,s){var r=void 0;return function(){var t=this,e=arguments,o=s&&!r;clearTimeout(r),r=setTimeout(function(){r=null,s||n.apply(t,e)},i),o&&n.apply(t,e)}},hasClass:function(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},offset:l,position:function(t){var e=t.offsetParent,o=l(e),n=l(t),i=r(e),s=r(t);return o.top+=parseInt(i.borderTopWidth)||0,o.left+=parseInt(i.borderLeftWidth)||0,{top:n.top-o.top-(parseInt(s.marginTop)||0),left:n.left-o.left-(parseInt(s.marginLeft)||0)}},getStyle:r,getCascadedStyle:function(t){var e=t.cloneNode(!0);e.style.display="none",Array.prototype.slice.call(e.querySelectorAll('input[type="radio"]')).forEach(function(t){t.removeAttribute("name")}),t.parentNode.insertBefore(e,t.nextSibling);var o=void 0;e.currentStyle?o=e.currentStyle:c.getComputedStyle&&(o=f.defaultView.getComputedStyle(e,null));var n={};for(var i in o)!isNaN(i)||"string"!=typeof o[i]&&"number"!=typeof o[i]||(n[i]=o[i]);if(Object.keys(n).length<3)for(var s in n={},o)isNaN(s)||(n[o[s].replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]=o.getPropertyValue(o[s]));if(n.margin||"auto"!==n.marginLeft?n.margin||n.marginLeft!==n.marginRight||n.marginLeft!==n.marginTop||n.marginLeft!==n.marginBottom||(n.margin=n.marginLeft):n.margin="auto",!n.margin&&"0px"===n.marginLeft&&"0px"===n.marginRight){var r=t.offsetLeft-t.parentNode.offsetLeft,l=r-(parseInt(n.left)||0)-(parseInt(n.right)||0),a=t.parentNode.offsetWidth-t.offsetWidth-r-(parseInt(n.right)||0)+(parseInt(n.left)||0)-l;0!==a&&1!==a||(n.margin="auto")}return e.parentNode.removeChild(e),e=null,n},event:e}}(window); | ||
!function(t,e){"use strict";if("object"==typeof module&&"object"==typeof module.exports){if(!t.document)throw new Error("HC-Sticky requires a browser to run.");module.exports=e(t)}else"function"==typeof define&&define.amd?define("hcSticky",[],e(t)):e(t)}("undefined"!=typeof window?window:this,function(U){"use strict";var Y={top:0,bottom:0,bottomEnd:0,innerTop:0,innerSticker:null,stickyClass:"sticky",stickTo:null,followScroll:!0,responsive:null,mobileFirst:!1,onStart:null,onStop:null,onBeforeResize:null,onResize:null,resizeDebounce:100,disable:!1,queries:null,queryFlow:"down"},$=function(t,e,o){console.log("%c! HC Sticky:%c "+t+"%c "+o+" is now deprecated and will be removed. Use%c "+e+"%c instead.","color: red","color: darkviolet","color: black","color: darkviolet","color: black")},Q=U.document,X=function(n,f){var o=this;if("string"==typeof n&&(n=Q.querySelector(n)),!n)return!1;f.queries&&$("queries","responsive","option"),f.queryFlow&&$("queryFlow","mobileFirst","option");var p={},d=X.Helpers,s=n.parentNode;"static"===d.getStyle(s,"position")&&(s.style.position="relative");var u=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};d.isEmptyObject(t)&&!d.isEmptyObject(p)||(p=Object.assign({},Y,p,t))},t=function(){return p.disable},e=function(){if(p.queries){var t=U.innerWidth,e=p.responsive||p.queries;if(c=f,(p=Object.assign({},Y,c||{})).mobileFirst)for(var o in e)o<=t&&!d.isEmptyObject(e[o])&&u(e[o]);else{var i=[];for(var n in p.queries){var s={};s[n]=e[n],i.push(s)}for(var r=i.length-1;0<=r;r--){var l=i[r],a=Object.keys(l)[0];t<=a&&!d.isEmptyObject(l[a])&&u(l[a])}}}var c},r={css:{},position:null,stick:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};d.hasClass(n,p.stickyClass)||(!1===l.isAttached&&l.attach(),r.position="fixed",n.style.position="fixed",n.style.left=l.offsetLeft+"px",n.style.width=l.width,void 0===t.bottom?n.style.bottom="auto":n.style.bottom=t.bottom+"px",void 0===t.top?n.style.top="auto":n.style.top=t.top+"px",n.classList?n.classList.add(p.stickyClass):n.className+=" "+p.stickyClass,p.onStart&&p.onStart.call(n,Object.assign({},p)))},release:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(t.stop=t.stop||!1,!0===t.stop||"fixed"===r.position||null===r.position||!(void 0===t.top&&void 0===t.bottom||void 0!==t.top&&(parseInt(d.getStyle(n,"top"))||0)===t.top||void 0!==t.bottom&&(parseInt(d.getStyle(n,"bottom"))||0)===t.bottom)){!0===t.stop?!0===l.isAttached&&l.detach():!1===l.isAttached&&l.attach();var e=t.position||r.css.position;r.position=e,n.style.position=e,n.style.left=!0===t.stop?r.css.left:l.positionLeft+"px",n.style.width="absolute"!==e?r.css.width:l.width,void 0===t.bottom?n.style.bottom=!0===t.stop?"":"auto":n.style.bottom=t.bottom+"px",void 0===t.top?n.style.top=!0===t.stop?"":"auto":n.style.top=t.top+"px",n.classList?n.classList.remove(p.stickyClass):n.className=n.className.replace(new RegExp("(^|\\b)"+p.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),p.onStop&&p.onStop.call(n,Object.assign({},p))}}},l={el:Q.createElement("div"),offsetLeft:null,positionLeft:null,width:null,isAttached:!1,init:function(){for(var t in r.css)l.el.style[t]=r.css[t];l.el.style["z-index"]="-1";var e=d.getStyle(n);l.offsetLeft=d.offset(n).left-(parseInt(e.marginLeft)||0),l.positionLeft=d.position(n).left,l.width=d.getStyle(n,"width")},attach:function(){s.insertBefore(l.el,n),l.isAttached=!0},detach:function(){l.el=s.removeChild(l.el),l.isAttached=!1}},a=void 0,c=void 0,g=void 0,m=void 0,h=void 0,v=void 0,y=void 0,b=void 0,S=void 0,w=void 0,k=void 0,E=void 0,x=void 0,L=void 0,T=void 0,j=void 0,O=void 0,C=void 0,i=function(){var t,e,o,i;r.css=(t=n,e=d.getCascadedStyle(t),o=d.getStyle(t),i={height:t.offsetHeight+"px",left:e.left,right:e.right,top:e.top,bottom:e.bottom,position:o.position,display:o.display,verticalAlign:o.verticalAlign,boxSizing:o.boxSizing,marginLeft:e.marginLeft,marginRight:e.marginRight,marginTop:e.marginTop,marginBottom:e.marginBottom,paddingLeft:e.paddingLeft,paddingRight:e.paddingRight},e.float&&(i.float=e.float||"none"),e.cssFloat&&(i.cssFloat=e.cssFloat||"none"),o.MozBoxSizing&&(i.MozBoxSizing=o.MozBoxSizing),i.width="auto"!==e.width?e.width:"border-box"===i.boxSizing||"border-box"===i.MozBoxSizing?t.offsetWidth+"px":o.width,i),l.init(),a=!(!p.stickTo||!("document"===p.stickTo||p.stickTo.nodeType&&9===p.stickTo.nodeType||"object"==typeof p.stickTo&&p.stickTo instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document))),c=p.stickTo?a?Q:"string"==typeof p.stickTo?Q.querySelector(p.stickTo):p.stickTo:s,T=(C=function(){var t=n.offsetHeight+(parseInt(r.css.marginTop)||0)+(parseInt(r.css.marginBottom)||0),e=(T||0)-t;return-1<=e&&e<=1?T:t})(),m=(O=function(){return a?Math.max(Q.documentElement.clientHeight,Q.body.scrollHeight,Q.documentElement.scrollHeight,Q.body.offsetHeight,Q.documentElement.offsetHeight):c.offsetHeight})(),h=a?0:d.offset(c).top,v=p.stickTo?a?0:d.offset(s).top:h,y=U.innerHeight,j=n.offsetTop-(parseInt(r.css.marginTop)||0),g=p.innerSticker?"string"==typeof p.innerSticker?Q.querySelector(p.innerSticker):p.innerSticker:null,b=isNaN(p.top)&&-1<p.top.indexOf("%")?parseFloat(p.top)/100*y:p.top,S=isNaN(p.bottom)&&-1<p.bottom.indexOf("%")?parseFloat(p.bottom)/100*y:p.bottom,w=g?g.offsetTop:p.innerTop?p.innerTop:0,k=isNaN(p.bottomEnd)&&-1<p.bottomEnd.indexOf("%")?parseFloat(p.bottomEnd)/100*y:p.bottomEnd,E=h-b+w+j},z=U.pageYOffset||Q.documentElement.scrollTop,N=0,H=void 0,R=function(){T=C(),m=O(),x=h+m-b-k,L=y<T;var t=U.pageYOffset||Q.documentElement.scrollTop,e=Math.round(d.offset(n).top),o=e-t,i=void 0;H=t<z?"up":"down",N=t-z,E<(z=t)?x+b+(L?S:0)-(p.followScroll&&L?0:b)<=t+T-w-(y-(E-w)<T-w&&p.followScroll&&0<(i=T-y-w)?i:0)?r.release({position:"absolute",bottom:v+s.offsetHeight-x-b}):L&&p.followScroll?"down"===H?Math.floor(o+T+S)<=y?r.stick({bottom:S}):"fixed"===r.position&&r.release({position:"absolute",top:e-b-E-N+w}):Math.ceil(o+w)<0&&"fixed"===r.position?r.release({position:"absolute",top:e-b-E+w-N}):t+b-w<=e&&r.stick({top:b-w}):r.stick({top:b-w}):r.release({stop:!0})},q=!1,A=!1,B=function(){q&&(d.event.unbind(U,"scroll",R),q=!1)},I=function(){null!==n.offsetParent&&"none"!==d.getStyle(n,"display")?(i(),m<=T?B():(R(),q||(d.event.bind(U,"scroll",R),q=!0))):B()},F=function(){n.style.position="",n.style.left="",n.style.top="",n.style.bottom="",n.style.width="",n.classList?n.classList.remove(p.stickyClass):n.className=n.className.replace(new RegExp("(^|\\b)"+p.stickyClass.split(" ").join("|")+"(\\b|$)","gi")," "),r.css={},!(r.position=null)===l.isAttached&&l.detach()},M=function(){F(),e(),t()?B():I()},D=function(){p.onBeforeResize&&p.onBeforeResize.call(n,Object.assign({},p)),M(),p.onResize&&p.onResize.call(n,Object.assign({},p))},P=p.resizeDebounce?d.debounce(D,p.resizeDebounce):D,W=function(){A&&(d.event.unbind(U,"resize",P),A=!1),B()},V=function(){A||(d.event.bind(U,"resize",P),A=!0),e(),t()?B():I()};this.options=function(t){return t?p[t]:Object.assign({},p)},this.refresh=M,this.update=function(t){u(t),f=Object.assign({},f,t||{}),M()},this.attach=V,this.detach=W,this.destroy=function(){W(),F()},this.triggerMethod=function(t,e){"function"==typeof o[t]&&o[t](e)},this.reinit=function(){$("reinit","refresh","method"),M()},u(f),V(),d.event.bind(U,"load",M)};if(void 0!==U.jQuery){var i=U.jQuery,n="hcSticky";i.fn.extend({hcSticky:function(e,o){return this.length?"options"===e?i.data(this.get(0),n).options():this.each(function(){var t=i.data(this,n);t?t.triggerMethod(e,o):(t=new X(this,e),i.data(this,n,t))}):this}})}return U.hcSticky=U.hcSticky||X,X}),function(c){"use strict";var t=c.hcSticky,f=c.document;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(o[s]=n[s])}return o},writable:!0,configurable:!0}),Array.prototype.forEach||(Array.prototype.forEach=function(t){var e,o;if(null==this)throw new TypeError("this is null or not defined");var i=Object(this),n=i.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(1<arguments.length&&(e=arguments[1]),o=0;o<n;){var s;o in i&&(s=i[o],t.call(e,s,o,i)),o++}});var e=function(){var t=f.documentElement,e=function(){};function i(t){var e=c.event;return e.target=e.target||e.srcElement||t,e}t.addEventListener?e=function(t,e,o){t.addEventListener(e,o,!1)}:t.attachEvent&&(e=function(e,t,o){e[t+o]=o.handleEvent?function(){var t=i(e);o.handleEvent.call(o,t)}:function(){var t=i(e);o.call(e,t)},e.attachEvent("on"+t,e[t+o])});var o=function(){};return t.removeEventListener?o=function(t,e,o){t.removeEventListener(e,o,!1)}:t.detachEvent&&(o=function(e,o,i){e.detachEvent("on"+o,e[o+i]);try{delete e[o+i]}catch(t){e[o+i]=void 0}}),{bind:e,unbind:o}}(),r=function(t,e){return c.getComputedStyle?e?f.defaultView.getComputedStyle(t,null).getPropertyValue(e):f.defaultView.getComputedStyle(t,null):t.currentStyle?e?t.currentStyle[e.replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]:t.currentStyle:void 0},l=function(t){var e=t.getBoundingClientRect(),o=c.pageYOffset||f.documentElement.scrollTop,i=c.pageXOffset||f.documentElement.scrollLeft;return{top:e.top+o,left:e.left+i}};t.Helpers={isEmptyObject:function(t){for(var e in t)return!1;return!0},debounce:function(i,n,s){var r=void 0;return function(){var t=this,e=arguments,o=s&&!r;clearTimeout(r),r=setTimeout(function(){r=null,s||i.apply(t,e)},n),o&&i.apply(t,e)}},hasClass:function(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)},offset:l,position:function(t){var e=t.offsetParent,o=l(e),i=l(t),n=r(e),s=r(t);return o.top+=parseInt(n.borderTopWidth)||0,o.left+=parseInt(n.borderLeftWidth)||0,{top:i.top-o.top-(parseInt(s.marginTop)||0),left:i.left-o.left-(parseInt(s.marginLeft)||0)}},getStyle:r,getCascadedStyle:function(t){var e=t.cloneNode(!0);e.style.display="none",Array.prototype.slice.call(e.querySelectorAll('input[type="radio"]')).forEach(function(t){t.removeAttribute("name")}),t.parentNode.insertBefore(e,t.nextSibling);var o=void 0;e.currentStyle?o=e.currentStyle:c.getComputedStyle&&(o=f.defaultView.getComputedStyle(e,null));var i={};for(var n in o)!isNaN(n)||"string"!=typeof o[n]&&"number"!=typeof o[n]||(i[n]=o[n]);if(Object.keys(i).length<3)for(var s in i={},o)isNaN(s)||(i[o[s].replace(/-\w/g,function(t){return t.toUpperCase().replace("-","")})]=o.getPropertyValue(o[s]));if(i.margin||"auto"!==i.marginLeft?i.margin||i.marginLeft!==i.marginRight||i.marginLeft!==i.marginTop||i.marginLeft!==i.marginBottom||(i.margin=i.marginLeft):i.margin="auto",!i.margin&&"0px"===i.marginLeft&&"0px"===i.marginRight){var r=t.offsetLeft-t.parentNode.offsetLeft,l=r-(parseInt(i.left)||0)-(parseInt(i.right)||0),a=t.parentNode.offsetWidth-t.offsetWidth-r-(parseInt(i.right)||0)+(parseInt(i.left)||0)-l;0!==a&&1!==a||(i.margin="auto")}return e.parentNode.removeChild(e),e=null,i},event:e}}(window); |
@@ -67,7 +67,2 @@ const gulp = require('gulp'); | ||
return gulp.src(demos) | ||
.pipe(template({ | ||
style_path: 'demos.css', | ||
sticky_path: '../../dist/hc-sticky.js', | ||
browserify_path: 'browserify.js' | ||
})) | ||
.pipe(gulp.dest(demo_dest)); | ||
@@ -93,2 +88,7 @@ }); | ||
gulp.task('demo-js', ['demo-browserify'], () => { | ||
return gulp.src(['./dist/hc-sticky.js']) | ||
.pipe(gulp.dest(demo_dest)); | ||
}); | ||
const compileHtml = (openHtml) => { | ||
@@ -126,3 +126,2 @@ openHtml = openHtml || false; | ||
const template_options = { | ||
style_path: 'style.css', | ||
demos: `<ul>${demos_content}</ul>` | ||
@@ -154,9 +153,9 @@ }; | ||
gulp.task('default', ['js', 'demo-sass', 'demo-html', 'demo-browserify', 'open-html']); | ||
gulp.task('default', ['js', 'demo-sass', 'demo-html', 'demo-js', 'open-html']); | ||
gulp.task('watch', ['js', 'demo-sass', 'demo-html', 'demo-browserify', 'open-html'], () => { | ||
gulp.watch(['./src/*.js'], ['js', 'demo-browserify']); | ||
gulp.watch(['./demo/src/*.js'], ['demo-browserify']); | ||
gulp.task('watch', ['js', 'demo-sass', 'demo-html', 'demo-js', 'open-html'], () => { | ||
gulp.watch(['./src/*.js'], ['js', 'demo-js']); | ||
gulp.watch(['./demo/src/*.js'], ['demo-js']); | ||
gulp.watch(['./demo/src/*.scss'], ['demo-sass']); | ||
gulp.watch(['./demo/src/*.html'], ['demo-html', 'main-html']); | ||
}); |
{ | ||
"name": "hc-sticky", | ||
"version": "2.1.7", | ||
"description": "Cross-browser plugin that makes any element on your page visible while you scroll", | ||
"version": "2.2.0", | ||
"description": "Dependency free javascript library that makes elements on your page visible while you scroll", | ||
"main": "dist/hc-sticky.js", | ||
"author": "Some Web Media", | ||
"author": { | ||
"name": "Some Web Media", | ||
"url": "http://somewebmedia.com" | ||
}, | ||
"license": "MIT", | ||
@@ -8,0 +11,0 @@ "repository": { |
HC-Sticky | ||
========= | ||
Cross-browser plugin that makes any element on your page visible while you scroll. | ||
Dependency free javascript library that makes any element on your page visible while you scroll. | ||
Check out the [demos](http://somewebmedia.com/hc-sticky). | ||
@@ -40,2 +41,4 @@ | ||
#### Vanilla JS | ||
```js | ||
@@ -72,3 +75,4 @@ var Sticky = new hcSticky('#element', { | ||
| *`stickyClass`* | 'sticky' | string | HTML class that will be applied to sticky element while it is attached. | | ||
| *`queries`* | null | object | Object containing responsive breakpoints, on which you can tell HC Sticky what to do. | | ||
| *`responsive`* | null | object | Object containing responsive breakpoints, on which you can tell HC Sticky what to do. | | ||
| *`mobileFirst`* | null | boolean | Direction of the responsive queries. | | ||
| *`onStart`* | null | function | Callback function fired when the element becomes attached. | | ||
@@ -85,4 +89,13 @@ | *`onStop`* | null | function | Callback function fired when the element stops floating. | | ||
Example: | ||
| Method | Accepts | Description | | ||
|---------|---------|--------------| | ||
| *`options`* | string | Returns current settings, or a specific setting if you specify it. | | ||
| *`update`* | object | Updates the settings with the new ones. | | ||
| *`refresh`* | N/A | Recalculates sticky size and position. Useful after altering DOM elements inside sticky. | | ||
| *`detach`* | N/A | Detaches the HC-Sticky from element, preventing it from running. | | ||
| *`attach`* | N/A | Attaches the HC-Sticky back to the element. | | ||
| *`destroy`* | N/A | Completely destroys HC-Sticky and reverts element to original state. | | ||
#### Vanilla JS | ||
```js | ||
@@ -98,14 +111,19 @@ var Sticky = new hcSticky('#element', { | ||
| Method | Accepts | Description | | ||
|---------|---------|--------------| | ||
| *`options`* | string | Returns current settings, or a specific setting if you specify it. | | ||
| *`update`* | object | Updates the settings with the new ones. | | ||
| *`reinit`* | N/A | Recalculates sticky size and position. Useful after altering DOM elements inside sticky. | | ||
| *`detach`* | N/A | Detaches the HC-Sticky from element, preventing it from running. | | ||
| *`attach`* | N/A | Attaches the HC-Sticky back to the element. | | ||
| *`destroy`* | N/A | Completely destroys HC-Sticky and reverts element to original state. | | ||
#### jQuery | ||
```js | ||
var $sticky = $('#element'); | ||
## Building | ||
$sticky.hcSticky({ | ||
stickTo: '#content' | ||
}); | ||
$sticky.hcSticky('update', { | ||
top: 20 | ||
}); | ||
``` | ||
## Dev Building | ||
This package comes with [Gulp](https://gulpjs.com/). The following tasks are available: | ||
@@ -121,2 +139,2 @@ | ||
The code and the documentation are released under the MIT License. | ||
The code and the documentation are released under the MIT License. |
/*! | ||
* HC-Sticky | ||
* ========= | ||
* Version: 2.1.7 | ||
* Version: 2.2.0 | ||
* Author: Some Web Media | ||
@@ -41,4 +41,4 @@ * Author URL: http://somewebmedia.com | ||
followScroll: true, | ||
queries: null, | ||
queryFlow: 'down', | ||
responsive: null, | ||
mobileFirst: false, | ||
onStart: null, | ||
@@ -49,5 +49,13 @@ onStop: null, | ||
resizeDebounce: 100, | ||
disable: false | ||
disable: false, | ||
// deprecated | ||
queries: null, | ||
queryFlow: 'down' | ||
}; | ||
const deprecated = (what, instead, type) => { | ||
console.log('%c! HC Sticky:' + '%c '+what + '%c '+type+' is now deprecated and will be removed. Use' + '%c '+instead + '%c instead.', 'color: red', 'color: darkviolet', 'color: black', 'color: darkviolet', 'color: black'); | ||
}; | ||
const document = window.document; | ||
@@ -66,2 +74,10 @@ | ||
if (userSettings.queries) { | ||
deprecated('queries', 'responsive', 'option'); | ||
} | ||
if (userSettings.queryFlow) { | ||
deprecated('queryFlow', 'mobileFirst', 'option'); | ||
} | ||
let STICKY_OPTIONS = {}; | ||
@@ -91,3 +107,3 @@ const Helpers = hcSticky.Helpers; | ||
const getOptions = (option) => { | ||
return option ? (STICKY_OPTIONS.option || null) : Object.assign({}, STICKY_OPTIONS); | ||
return option ? STICKY_OPTIONS[option] : Object.assign({}, STICKY_OPTIONS); | ||
}; | ||
@@ -102,4 +118,3 @@ | ||
const window_width = window.innerWidth; | ||
const queryFlow = STICKY_OPTIONS.queryFlow; | ||
const queries = STICKY_OPTIONS.queries; | ||
const queries = STICKY_OPTIONS.responsive || STICKY_OPTIONS.queries; | ||
@@ -109,3 +124,3 @@ // reset settings | ||
if (queryFlow === 'up') { | ||
if (STICKY_OPTIONS.mobileFirst) { | ||
for (const width in queries) { | ||
@@ -225,3 +240,3 @@ if (window_width >= width && !Helpers.isEmptyObject(queries[width])) { | ||
if (STICKY_OPTIONS.onStart) { | ||
STICKY_OPTIONS.onStart.call(elem, STICKY_OPTIONS); | ||
STICKY_OPTIONS.onStart.call(elem, Object.assign({}, STICKY_OPTIONS)); | ||
} | ||
@@ -288,3 +303,3 @@ }, | ||
if (STICKY_OPTIONS.onStop) { | ||
STICKY_OPTIONS.onStop.call(elem, STICKY_OPTIONS); | ||
STICKY_OPTIONS.onStop.call(elem, Object.assign({}, STICKY_OPTIONS)); | ||
} | ||
@@ -602,3 +617,3 @@ } | ||
if (STICKY_OPTIONS.onBeforeResize) { | ||
STICKY_OPTIONS.onBeforeResize.call(elem, STICKY_OPTIONS); | ||
STICKY_OPTIONS.onBeforeResize.call(elem, Object.assign({}, STICKY_OPTIONS)); | ||
} | ||
@@ -611,3 +626,3 @@ | ||
if (STICKY_OPTIONS.onResize) { | ||
STICKY_OPTIONS.onResize.call(elem, STICKY_OPTIONS); | ||
STICKY_OPTIONS.onResize.call(elem, Object.assign({}, STICKY_OPTIONS)); | ||
} | ||
@@ -661,3 +676,3 @@ }; | ||
this.options = getOptions; | ||
this.reinit = reinitSticky; | ||
this.refresh = reinitSticky; | ||
this.update = Update; | ||
@@ -668,2 +683,14 @@ this.attach = Attach; | ||
// jQuery methods | ||
this.triggerMethod = (method, options) => { | ||
if (typeof this[method] === 'function') { | ||
this[method](options); | ||
} | ||
}; | ||
this.reinit = () => { | ||
deprecated('reinit', 'refresh', 'method'); | ||
reinitSticky(); | ||
}; | ||
// init settings | ||
@@ -682,21 +709,24 @@ setOptions(userSettings); | ||
const $ = window.jQuery; | ||
const namespace = 'hcSticky'; | ||
$.fn.extend({ | ||
hcSticky: function(options) { | ||
hcSticky: function(args, update) { | ||
// check if selected element exist | ||
if (!this.length) { | ||
return this; | ||
if (!this.length) return this; | ||
// we need to return options | ||
if (args === 'options') { | ||
return $.data(this.get(0), namespace).options(); | ||
} | ||
return this.each(function() { | ||
const namespace = 'hcSticky'; | ||
let instance = $.data(this, namespace); | ||
if (instance) { | ||
// already created | ||
instance.update(options); | ||
// already created, trigger method | ||
instance.triggerMethod(args, update); | ||
} | ||
else { | ||
// create new instance | ||
instance = new hcSticky(this, options); | ||
instance = new hcSticky(this, args); | ||
$.data(this, namespace, instance); | ||
@@ -703,0 +733,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150726
33
1068
135