!function(n,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(n,t)}):"object"==typeof exports?e(n,require("jquery")):e(n,n.jQuery||n.Zepto)}(this,function(t,s){"use strict";var o,r,d="remodal",i=t.REMODAL_GLOBALS&&t.REMODAL_GLOBALS.NAMESPACE||d,c=s.map(["animationstart","webkitAnimationStart","MSAnimationStart","oAnimationStart"],function(t){return t+"."+i}).join(" "),l=s.map(["animationend","webkitAnimationEnd","MSAnimationEnd","oAnimationEnd"],function(t){return t+"."+i}).join(" "),p=s.extend({hashTracking:!0,closeOnConfirm:!0,closeOnCancel:!0,closeOnEscape:!0,closeOnOutsideClick:!0,modifier:"",appendTo:null},t.REMODAL_GLOBALS&&t.REMODAL_GLOBALS.DEFAULTS),m={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened"},u="confirmation",f="cancellation",g=void 0!==(t=document.createElement("div").style).animationName||void 0!==t.WebkitAnimationName||void 0!==t.MozAnimationName||void 0!==t.msAnimationName||void 0!==t.OAnimationName,h=/iPad|iPhone|iPod/.test(navigator.platform);function v(t){if(g&&"none"===t.css("animation-name")&&"none"===t.css("-webkit-animation-name")&&"none"===t.css("-moz-animation-name")&&"none"===t.css("-o-animation-name")&&"none"===t.css("-ms-animation-name"))return 0;for(var n,e=t.css("animation-duration")||t.css("-webkit-animation-duration")||t.css("-moz-animation-duration")||t.css("-o-animation-duration")||t.css("-ms-animation-duration")||"0s",a=t.css("animation-delay")||t.css("-webkit-animation-delay")||t.css("-moz-animation-delay")||t.css("-o-animation-delay")||t.css("-ms-animation-delay")||"0s",i=t.css("animation-iteration-count")||t.css("-webkit-animation-iteration-count")||t.css("-moz-animation-iteration-count")||t.css("-o-animation-iteration-count")||t.css("-ms-animation-iteration-count")||"1",e=e.split(", "),a=a.split(", "),i=i.split(", "),o=0,s=e.length,r=Number.NEGATIVE_INFINITY;o").addClass(E("overlay")+" "+E("is",m.CLOSED)).hide(),e.append(a.$overlay)),a.$bg=s("."+E("bg")).addClass(E("is",m.CLOSED)),a.$modal=t.addClass(i+" "+E("is-initialized")+" "+a.settings.modifier+" "+E("is",m.CLOSED)).attr("tabindex","-1"),a.$wrapper=s("
").addClass(E("wrapper")+" "+a.settings.modifier+" "+E("is",m.CLOSED)).hide().append(a.$modal),e.append(a.$wrapper),a.$wrapper.on("click."+i,"[data-"+d+'-action="close"]',function(t){t.preventDefault(),a.close()}),a.$wrapper.on("click."+i,"[data-"+d+'-action="cancel"]',function(t){t.preventDefault(),a.$modal.trigger(f),a.settings.closeOnCancel&&a.close(f)}),a.$wrapper.on("click."+i,"[data-"+d+'-action="confirm"]',function(t){t.preventDefault(),a.$modal.trigger(u),a.settings.closeOnConfirm&&a.close(u)}),a.$wrapper.on("click."+i,function(t){s(t.target).hasClass(E("wrapper"))&&a.settings.closeOnOutsideClick&&a.close()})}w.prototype.open=function(){var t,n,e,a,i=this;i.state!==m.OPENING&&i.state!==m.CLOSING&&((a=i.$modal.attr("data-"+d+"-id"))&&i.settings.hashTracking&&(r=s(window).scrollTop(),location.hash=a),o&&o!==i&&O(o),o=i,h||(a=s("html"),t=E("is-locked"),a.hasClass(t))||(e=s(document.body),n=parseInt(e.css("padding-right"),10)+$(),e.css("padding-right",n+"px"),a.addClass(t)),i.$bg.addClass(i.settings.modifier),i.$overlay.addClass(i.settings.modifier).show(),i.$wrapper.show().scrollTop(0),i.$modal.focus(),y(function(){C(i,m.OPENING)},function(){C(i,m.OPENED)},i))},w.prototype.close=function(t){var n=this;n.state!==m.OPENING&&n.state!==m.CLOSING&&(n.settings.hashTracking&&n.$modal.attr("data-"+d+"-id")===location.hash.substr(1)&&(location.hash="",s(window).scrollTop(r)),y(function(){C(n,m.CLOSING,!1,t)},function(){n.$bg.removeClass(n.settings.modifier),n.$overlay.removeClass(n.settings.modifier).hide(),n.$wrapper.hide(),a(),C(n,m.CLOSED,!1,t)},n))},w.prototype.getState=function(){return this.state},w.prototype.destroy=function(){var t=s[d].lookup;O(this),this.$wrapper.remove(),delete t[this.index],0===s.grep(t,function(t){return!!t}).length&&(this.$overlay.remove(),this.$bg.removeClass(E("is",m.CLOSING)+" "+E("is",m.OPENING)+" "+E("is",m.CLOSED)+" "+E("is",m.OPENED)))},s[d]={lookup:[]},s.fn[d]=function(e){var a,i;return this.each(function(t,n){null==(i=s(n)).data(d)?(a=new w(i,e),i.data(d,a.index),a.settings.hashTracking&&i.attr("data-"+d+"-id")===location.hash.substr(1)&&a.open()):a=s[d].lookup[i.data(d)]}),a},s(document).ready(function(){s(document).on("click","[data-"+d+"-target]",function(t){t.preventDefault();t=t.currentTarget.getAttribute("data-"+d+"-target"),t=s("[data-"+d+'-id="'+t+'"]');s[d].lookup[t.data(d)].open()}),s(document).find("."+i).each(function(t,n){var n=s(n),e=n.data(d+"-options");e?("string"==typeof e||e instanceof String)&&(e=function(t){for(var n,e,a={},i=0,o=(n=(t=t.replace(/\s*:\s*/g,":").replace(/\s*,\s*/g,",")).split(",")).length;i