{ "version": 3, "sources": [ "node_modules/browser-pack/_prelude.js", "js/checkout.js", "js/checkout/promocode.js", "js/lib/alerts.js", "js/lib/bootstrap-affix.js", "js/lib/chosen.jquery.js", "js/lib/forms.js", "js/lib/intro.js", "js/lib/modernizr-custom.js", "js/lib/pikaday-i18n.js", "js/lib/tour.js", "js/lib/vouchers.js", "node_modules/moment/moment.js", "node_modules/pikaday/pikaday.js", "node_modules/remodal/dist/remodal.js" ], "names": [], "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACt1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1lEA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/2IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACptCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "generated.js", "sourceRoot": "/", "sourcesContent": [ "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o 1024) {\r\n\t\t\t\t$sidebar.css('top', 0);\r\n\t\t\t\t$sidebar.css('width', 'auto');\r\n\t\t\t\t$sidebar.css('width', $sidebar.outerWidth());\r\n\t\t\t\t$sidebar.affix({\r\n\t\t\t\t\toffset: {\r\n\t\t\t\t\t\ttop: $sidebar.offset().top,\r\n\t\t\t\t\t\tbottom: function() {\r\n\t\t\t\t\t\t\treturn (this.bottom = $('#site-footer').outerHeight(true) + 170);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t},\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t$sidebar.affix('destroy');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($(window).width() < 1025) {\r\n\t\t\t$('.tabs').each(function() {\r\n\t\t\t\tif(!$(this).find('.active').length)\r\n\t\t\t\t\treturn true;\r\n\r\n\t\t\t\tvar offset = $(this).find('.active').offset().left - $(this).offset().left;\r\n\t\t\t\t$(this).animate({scrollLeft: offset}, 400);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\thandleSummarySubmit: function() {\r\n\t\t'use strict';\r\n\r\n\t\tif($termsAccepted.prop('checked')) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif((!termsAlert || !termsAlert.open) && $(window).width() > 1024) {\r\n\t\t\ttermsAlert = window.snowdome.Alerts.showError('You have to agree to the Terms and Conditions before you continue');\r\n\t\t}\r\n\t},\r\n\r\n\tPayment: {\r\n\t\tinit: function() {\r\n\t\t\t'use strict';\r\n\r\n\t\t\t$('#card').change(function(e) {\r\n\t\t\t\tif(e.target.value === 'new') {\r\n\t\t\t\t\t$('.form__group--new-card').each(function() {\r\n\t\t\t\t\t\t$(this).show();\r\n\t\t\t\t\t\t$(this).children('.form__control').prop('disabled', false);\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$('.form__group--new-card').each(function() {\r\n\t\t\t\t\t\t$(this).hide();\r\n\t\t\t\t\t\t$(this).children('.form__control').prop('disabled', true);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$('#cvv, #checkout__pay').show();\r\n\t\t\t});\r\n\t\t},\r\n\t},\r\n\tcontract: {\r\n\t\tinit: function(){\r\n\t\t\tvar _self = this;\r\n\r\n\t\t\t_self.signature();\r\n\t\t\t_self.countdown();\r\n\t\t\tsetInterval( _self.countdown, 2000);\r\n\r\n\t\t},\r\n\t\tcountdown: function(){\r\n\t\t\tlet date = moment().format(\"HH:mm DD/MM/YY\");\r\n\t\t\t$('#customer-signature .time').text(date);\r\n\t\t},\r\n\t\tsignature: function() {\r\n\t\t\tvar $input = $('#fullname');\r\n\r\n\t\t\tif(!$input.length)\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t$('#customer-signature .signature').text($input[0].value);\r\n\r\n\t\t\t$input.on('keyup', function(e){\r\n\t\t\t\t$('#customer-signature .signature').text(this.value);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nrequire('./lib/bootstrap-affix.js');\r\nrequire('./lib/modernizr-custom.js');\r\nrequire('./lib/chosen.jquery.js');\r\nrequire('remodal');\r\nvar moment = require('moment');\r\n\r\nwindow.snowdome.pikadayi18n = require('./lib/pikaday-i18n.js');\r\nwindow.snowdome.Alerts = require('./lib/alerts.js');\r\nwindow.snowdome.Forms = require('./lib/forms.js');\r\nwindow.snowdome.tour = require('./lib/tour.js');\r\nwindow.snowdome.Checkout.Promocode = require('./checkout/promocode.js');\r\nwindow.snowdome.Vouchers = require('./lib/vouchers.js');\r\n\r\njQuery(document).ready(function() {\r\n\t'use strict';\r\n\twindow.$ = jQuery;\r\n\twindow.snowdome.Checkout.init();\r\n});\r\n", "/*globals module, snowdome */\r\n\r\nmodule.exports = {\r\n\t$modal: null,\r\n\ttotal: 0,\r\n\r\n\tinit: function() {\r\n\t\t'use strict';\r\n\r\n\t\tvar that = this;\r\n\r\n\t\tthis.total = snowdome.Checkout.total;\r\n\t\tthis.$modal = $('[data-remodal-id=coupon-redeem]').remodal({\r\n\t\t\thashTracking: false,\r\n\t\t});\r\n\r\n\t\t$('[data-coupon]').on('input', function() {\r\n\t\t\t$('[data-coupon-apply]').removeClass('btn--disabled');\r\n\t\t});\r\n\r\n\t\t$('[data-coupon-apply]').on('click', function() {\r\n\t\t\tvar code = $('[data-coupon]').val();\r\n\r\n\t\t\tif(!code) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tthat.getCoupon(code, function(coupon) {\r\n\t\t\t\tif(coupon) {\r\n\t\t\t\t\tthat.redeem(coupon);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\t$('[data-coupon-redeem]').click(function(e) {\r\n\t\t\te.preventDefault();\r\n\r\n\t\t\tthat.apply($('#modal-coupon').prop('coupon'), parseFloat($('[data-coupon-amount]').val()));\r\n\t\t\tthat.$modal.close();\r\n\t\t});\r\n\r\n\t\t$('[data-coupon-remove]').on('click', function() {\r\n\t\t\tthat.remove();\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * Retrieves the details of the coupon for the specified code, if any\r\n\t * @todo Validate/retrieve coupon details here\r\n\t * @param {String} code\r\n\t * @param {Function} callback which will be passed the retrieved coupon, or null if no coupon was found\r\n\t */\r\n\tgetCoupon: function(code, callback) {\r\n\t\t'use strict';\r\n\r\n\t\tcallback({\r\n\t\t\tcode: code,\r\n\t\t\tbalance: 96.35,\r\n\t\t\texpiry: new Date(2018, 11, 25),\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * Displays and populates the coupon modal, allowing the user to specify the amount to redeem\r\n\t * @param {Coupon} coupon\r\n\t */\r\n\tredeem: function(coupon) {\r\n\t\t'use strict';\r\n\r\n\t\t$('#modal-coupon').prop('coupon', coupon);\r\n\t\t$('#modal-coupon__code').text(coupon.code);\r\n\t\t$('#modal-coupon__balance').text('£' + coupon.balance.toFixed(2));\r\n\t\t$('#modal-coupon__expiry').text('Expires: ' + [\r\n\t\t\tcoupon.expiry.getDate(),\r\n\t\t\tcoupon.expiry.getMonth(),\r\n\t\t\tcoupon.expiry.getFullYear(),\r\n\t\t].join('/'));\r\n\r\n\t\tthis.$modal.open();\r\n\t},\r\n\r\n\t/**\r\n\t * Applies the specified amount of the given coupon to the current total\r\n\t * @param {Coupon} coupon\r\n\t * @param {Number} amount\r\n\t */\r\n\tapply: function(coupon, amount) {\r\n\t\t'use strict';\r\n\r\n\t\tamount = Math.max(Math.min(coupon.balance, amount), 0);\r\n\t\tamount = Math.min(this.total, amount);\r\n\r\n\t\tif(!amount) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$('[data-coupon-applied-code]').val(coupon.code);\r\n\t\t$('[data-coupon-applied-amount]').val(amount.toFixed(2));\r\n\t\t$('[data-coupon-apply]').prop('disabled', true);\r\n\r\n\t\t$('#summary-coupon').css('display', 'flex');\r\n\t\t$('#summary-coupon__code').text(coupon.code);\r\n\t\t$('#summary-coupon__amount').text('-£' + amount.toFixed(2));\r\n\r\n\t\t$('#sidebar-coupon').show();\r\n\t\t$('#sidebar-coupon__code').text(coupon.code);\r\n\t\t$('#sidebar-coupon__amount').text('-£' + amount.toFixed(2));\r\n\r\n\t\t$('#checkout__total').text('£' + (this.total - amount.toFixed(2)).toFixed(2));\r\n\t},\r\n\r\n\t/**\r\n\t * Removes any added coupon\r\n\t */\r\n\tremove: function() {\r\n\t\t'use strict';\r\n\r\n\t\t$('[data-coupon-applied-code]').val('');\r\n\t\t$('[data-coupon-applied-amount]').val(0);\r\n\r\n\t\t$('#summary-coupon').hide();\r\n\t\t$('#sidebar-coupon').hide();\r\n\t\t$('#checkout__total').text('£' + this.total.toFixed(2));\r\n\t\t$('[data-coupon-apply]').prop('disabled', false);\r\n\t},\r\n};\r\n", "/* globals module, snowdome */\r\n\r\nvar $alerts = null;\r\n\r\nmodule.exports = {\r\n\tinit: function() {\r\n\t\t\"use strict\";\r\n\r\n\t\t$alerts = $('#alerts');\r\n\t},\r\n\r\n\t/**\r\n\t * Show an error alert\r\n\t * @param content - Alert content\r\n\t * @param {String} content - Alert content\r\n\t * @param {boolean} html - If true, content will be added using innerHTML\r\n\t * @param {function} callback - If given, will add yes/no buttons that trigger the callback function.\r\n\t * @returns {*|Element}\r\n\t */\r\n\tshowError: function(content, html, callback, title) {\r\n\t\t\"use strict\";\r\n\r\n\t\tvar alert = this.createAlert('error', content, html, callback, title);\r\n\r\n\t\t$alerts.prepend(alert);\r\n\t\t$('body').addClass('alert-open');\r\n\r\n\t\treturn alert;\r\n\t},\r\n\r\n\t/**\r\n\t * Show an warning alert\r\n\t * @param content - Alert content\r\n\t * @param {String} content - Alert content\r\n\t * @param {boolean} html - If true, content will be added using innerHTML\r\n\t * @param {function} callback - If given, will add yes/no buttons that trigger the callback function.\r\n\t * @returns {*|Element}\r\n\t */\r\n\tshowWarning: function(content, html, callback, title) {\r\n\t\t\"use strict\";\r\n\r\n\t\tvar alert = this.createAlert('warning', content, html, callback, title);\r\n\t\t$alerts.prepend(alert);\r\n\t\t$('body').addClass('alert-open');\r\n\r\n\t\treturn alert;\r\n\t},\r\n\r\n\t/**\r\n\t * Show an success alert\r\n\t * @param content - Alert content\r\n\t * @param {String} content - Alert content\r\n\t * @param {boolean} html - If true, content will be added using innerHTML\r\n\t * @param {function} callback - If given, will add yes/no buttons that trigger the callback function.\r\n\t * @returns {*|Element}\r\n\t */\r\n\tshowSuccess: function(content, html, callback, title) {\r\n\t\t\"use strict\";\r\n\r\n\t\tvar alert = this.createAlert('warning', content, html, callback, title);\r\n\t\t$alerts.prepend(alert);\r\n\t\t$('body').addClass('alert-open');\r\n\r\n\t\treturn alert;\r\n\t},\r\n\r\n\t/**\r\n\t * Creates an alert\r\n\t * @param {string} type - Type of alert (error, success, warning)\r\n\t * @param {String} content - Alert content\r\n\t * @param {boolean} html - If true, content will be added using innerHTML\r\n\t * @param {function} callback - If given, will add yes/no buttons that trigger the callback function.\r\n\t * @returns {Element} The alert element\r\n\t */\r\n\tcreateAlert: function(type, content, html, callback, title) {\r\n\t\t\"use strict\";\r\n\r\n\t\tvar that = this,\r\n\t\t\talert = document.createElement('li'),\r\n\t\t\tclose = null,\r\n\t\t\tp = document.createElement('p'),\r\n\t\t\tok = null;\r\n\r\n\t\talert.className = 'alert alert--' + type;\r\n\t\talert.dataset.title = (typeof title !== 'undefined') ? title : 'Are you sure?';\r\n\t\talert.appendChild(p);\r\n\t\talert.open = true;\r\n\r\n\t\tif(html) {\r\n\t\t\tp.innerHTML = content;\r\n\t\t} else {\r\n\t\t\tp.innerText = content;\r\n\t\t}\r\n\t\t\r\n\t\tif(typeof callback === \"function\"){\r\n\t\t\tclose = document.createElement('div');\r\n\t\t\tclose.className = 'alert__options';\r\n\t\t\tclose.innerHTML = '\\\r\n\t\t\t\tYes\\\r\n\t\t\t\tNo\\\r\n\t\t\t';\r\n\t\t\t$(close).one('click', '.alert__yes', function(e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tcallback.call(alert, true);\r\n\t\t\t\tthat.closeAlert(alert);\r\n\t\t\t});\r\n\t\t\t$(close).one('click', '.alert__no', function(e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\tcallback.call(alert, false);\r\n\t\t\t\tthat.closeAlert(alert);\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tok = document.createElement('button');\r\n\t\t\tok.className = 'btn btn--primary';\r\n\t\t\tok.innerHTML = 'OK';\r\n\t\t\t$(ok).one('click', function(e) {\r\n\t\t\t\tthat.closeAlert(alert);\r\n\t\t\t});\r\n\t\t\talert.appendChild(ok);\r\n\r\n\t\t\tclose = document.createElement('button');\r\n\t\t\tclose.className = 'alert__close';\r\n\t\t\tclose.innerHTML = '';\r\n\t\t\t\r\n\t\t\t$(close).one('click', function() {\r\n\t\t\t\tthat.closeAlert(alert);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tsetTimeout(function() {\r\n\t\t\tthat.closeAlert(alert);\r\n\t\t}, 10000);\r\n\r\n\t\talert.appendChild(close);\r\n\r\n\t\treturn alert;\r\n\t},\r\n\r\n\t/**\r\n\t * Close an existing alert\r\n\t * @param {Element} alert - The alert to close\r\n\t */\r\n\tcloseAlert: function(alert) {\r\n\t\tvar parent = alert.parentNode;\r\n\r\n\t\t//TODO: Probably an animation here\r\n\t\talert.open = false;\r\n\t\t$(alert).remove();\r\n\r\n\t\tif(!parent.querySelectorAll(\".alert\").length){\r\n\t\t\t$('body').removeClass('alert-open');\r\n\t\t}\r\n\t}\r\n};\r\n", "/*!\r\n * Bootstrap v3.3.7 (http://getbootstrap.com)\r\n * Copyright 2011-2017 Twitter, Inc.\r\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\r\n */\r\n\r\n/*!\r\n * Generated using the Bootstrap Customizer (https://getbootstrap.com/docs/3.3/customize/?id=8bdc3b25dc23b34b689e713359af41be)\r\n * Config saved to config.json and https://gist.github.com/8bdc3b25dc23b34b689e713359af41be\r\n */\r\nif (typeof jQuery === 'undefined') {\r\n throw new Error('Bootstrap\\'s JavaScript requires jQuery')\r\n}\r\n+function ($) {\r\n 'use strict';\r\n var version = $.fn.jquery.split(' ')[0].split('.')\r\n if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {\r\n throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')\r\n }\r\n}(jQuery);\r\n\r\n/* ========================================================================\r\n * Bootstrap: affix.js v3.3.7\r\n * http://getbootstrap.com/javascript/#affix\r\n * ========================================================================\r\n * Copyright 2011-2016 Twitter, Inc.\r\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\r\n * ======================================================================== */\r\n\r\n\r\n+function ($) {\r\n 'use strict';\r\n\r\n // AFFIX CLASS DEFINITION\r\n // ======================\r\n\r\n var Affix = function (element, options) {\r\n this.options = $.extend({}, Affix.DEFAULTS, options)\r\n\r\n this.$target = $(this.options.target)\r\n .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))\r\n .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))\r\n\r\n this.$element = $(element)\r\n this.affixed = null\r\n this.unpin = null\r\n this.pinnedOffset = null\r\n\r\n this.checkPosition()\r\n }\r\n\r\n Affix.VERSION = '3.3.7'\r\n\r\n Affix.RESET = 'affix affix-top affix-bottom'\r\n\r\n Affix.DEFAULTS = {\r\n offset: 0,\r\n target: window\r\n }\r\n\r\n Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {\r\n var scrollTop = this.$target.scrollTop()\r\n var position = this.$element.offset()\r\n var targetHeight = this.$target.height()\r\n\r\n if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false\r\n\r\n if (this.affixed == 'bottom') {\r\n if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'\r\n return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'\r\n }\r\n\r\n var initializing = this.affixed == null\r\n var colliderTop = initializing ? scrollTop : position.top\r\n var colliderHeight = initializing ? targetHeight : height\r\n\r\n if (offsetTop != null && scrollTop <= offsetTop) return 'top'\r\n if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'\r\n\r\n return false\r\n }\r\n\r\n Affix.prototype.getPinnedOffset = function () {\r\n if (this.pinnedOffset) return this.pinnedOffset\r\n this.$element.removeClass(Affix.RESET).addClass('affix')\r\n var scrollTop = this.$target.scrollTop()\r\n var position = this.$element.offset()\r\n return (this.pinnedOffset = position.top - scrollTop)\r\n }\r\n\r\n Affix.prototype.checkPositionWithEventLoop = function () {\r\n setTimeout($.proxy(this.checkPosition, this), 1)\r\n };\r\n\r\n Affix.prototype.destroy = function() {\r\n\t this.$target\r\n\t\t .off('scroll.bs.affix.data-api')\r\n\t\t .off('click.bs.affix.data-api');\r\n\r\n\t this.$element.data('bs.affix', null);\r\n\t this.$element.css('top', '').removeClass(Affix.RESET);\r\n\r\n this.affixed = null;\r\n this.$element = null;\r\n this.$target = null;\r\n\t this.unpin = null;\r\n\t this.pinnedOffset = null;\r\n };\r\n\r\n Affix.prototype.checkPosition = function () {\r\n if (!this.$element.is(':visible')) return\r\n\r\n var height = this.$element.height()\r\n var offset = this.options.offset\r\n var offsetTop = offset.top\r\n var offsetBottom = offset.bottom\r\n var scrollHeight = Math.max($(document).height(), $(document.body).height())\r\n\r\n if (typeof offset != 'object') offsetBottom = offsetTop = offset\r\n if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)\r\n if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)\r\n\r\n var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)\r\n\r\n if (this.affixed != affix) {\r\n if (this.unpin != null) this.$element.css('top', '')\r\n\r\n var affixType = 'affix' + (affix ? '-' + affix : '')\r\n var e = $.Event(affixType + '.bs.affix')\r\n\r\n this.$element.trigger(e)\r\n\r\n if (e.isDefaultPrevented()) return\r\n\r\n this.affixed = affix\r\n this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null\r\n\r\n this.$element\r\n .removeClass(Affix.RESET)\r\n .addClass(affixType)\r\n .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')\r\n }\r\n\r\n if (affix == 'bottom') {\r\n this.$element.offset({\r\n top: scrollHeight - height - offsetBottom\r\n })\r\n }\r\n }\r\n\r\n\r\n // AFFIX PLUGIN DEFINITION\r\n // =======================\r\n\r\n function Plugin(option) {\r\n return this.each(function () {\r\n var $this = $(this)\r\n var data = $this.data('bs.affix')\r\n var options = typeof option == 'object' && option\r\n\r\n if (!data) $this.data('bs.affix', (data = new Affix(this, options)))\r\n if (typeof option == 'string') data[option]()\r\n })\r\n }\r\n\r\n var old = $.fn.affix\r\n\r\n $.fn.affix = Plugin\r\n $.fn.affix.Constructor = Affix\r\n\r\n\r\n // AFFIX NO CONFLICT\r\n // =================\r\n\r\n $.fn.affix.noConflict = function () {\r\n $.fn.affix = old\r\n return this\r\n }\r\n\r\n\r\n // AFFIX DATA-API\r\n // ==============\r\n\r\n $(window).on('load', function () {\r\n $('[data-spy=\"affix\"]').each(function () {\r\n var $spy = $(this)\r\n var data = $spy.data()\r\n\r\n data.offset = data.offset || {}\r\n\r\n if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom\r\n if (data.offsetTop != null) data.offset.top = data.offsetTop\r\n\r\n Plugin.call($spy, data)\r\n })\r\n })\r\n\r\n}(jQuery);\r\n", "/*!\r\nChosen, a Select Box Enhancer for jQuery and Prototype\r\nby Patrick Filler for Harvest, http://getharvest.com\r\n\r\nVersion 1.8.2\r\nFull source at https://github.com/harvesthq/chosen\r\nCopyright (c) 2011-2017 Harvest http://getharvest.com\r\n\r\nMIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md\r\nThis file is generated by `grunt build`, do not edit it by hand.\r\n*/\r\n\r\n(function() {\r\n var $, AbstractChosen, Chosen, SelectParser,\r\n bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\r\n extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\r\n hasProp = {}.hasOwnProperty;\r\n\r\n SelectParser = (function() {\r\n function SelectParser() {\r\n this.options_index = 0;\r\n this.parsed = [];\r\n }\r\n\r\n SelectParser.prototype.add_node = function(child) {\r\n if (child.nodeName.toUpperCase() === \"OPTGROUP\") {\r\n return this.add_group(child);\r\n } else {\r\n return this.add_option(child);\r\n }\r\n };\r\n\r\n SelectParser.prototype.add_group = function(group) {\r\n var group_position, i, len, option, ref, results1;\r\n group_position = this.parsed.length;\r\n this.parsed.push({\r\n array_index: group_position,\r\n group: true,\r\n label: group.label,\r\n title: group.title ? group.title : void 0,\r\n children: 0,\r\n disabled: group.disabled,\r\n classes: group.className\r\n });\r\n ref = group.childNodes;\r\n results1 = [];\r\n for (i = 0, len = ref.length; i < len; i++) {\r\n option = ref[i];\r\n results1.push(this.add_option(option, group_position, group.disabled));\r\n }\r\n return results1;\r\n };\r\n\r\n SelectParser.prototype.add_option = function(option, group_position, group_disabled) {\r\n if (option.nodeName.toUpperCase() === \"OPTION\") {\r\n if (option.text !== \"\") {\r\n if (group_position != null) {\r\n this.parsed[group_position].children += 1;\r\n }\r\n this.parsed.push({\r\n array_index: this.parsed.length,\r\n options_index: this.options_index,\r\n value: option.value,\r\n text: option.text,\r\n html: option.innerHTML,\r\n title: option.title ? option.title : void 0,\r\n selected: option.selected,\r\n disabled: group_disabled === true ? group_disabled : option.disabled,\r\n group_array_index: group_position,\r\n group_label: group_position != null ? this.parsed[group_position].label : null,\r\n classes: option.className,\r\n style: option.style.cssText\r\n });\r\n } else {\r\n this.parsed.push({\r\n array_index: this.parsed.length,\r\n options_index: this.options_index,\r\n empty: true\r\n });\r\n }\r\n return this.options_index += 1;\r\n }\r\n };\r\n\r\n return SelectParser;\r\n\r\n })();\r\n\r\n SelectParser.select_to_array = function(select) {\r\n var child, i, len, parser, ref;\r\n parser = new SelectParser();\r\n ref = select.childNodes;\r\n for (i = 0, len = ref.length; i < len; i++) {\r\n child = ref[i];\r\n parser.add_node(child);\r\n }\r\n return parser.parsed;\r\n };\r\n\r\n AbstractChosen = (function() {\r\n function AbstractChosen(form_field, options1) {\r\n this.form_field = form_field;\r\n this.options = options1 != null ? options1 : {};\r\n this.label_click_handler = bind(this.label_click_handler, this);\r\n if (!AbstractChosen.browser_is_supported()) {\r\n return;\r\n }\r\n this.is_multiple = this.form_field.multiple;\r\n this.set_default_text();\r\n this.set_default_values();\r\n this.setup();\r\n this.set_up_html();\r\n this.register_observers();\r\n this.on_ready();\r\n }\r\n\r\n AbstractChosen.prototype.set_default_values = function() {\r\n this.click_test_action = (function(_this) {\r\n return function(evt) {\r\n return _this.test_active_click(evt);\r\n };\r\n })(this);\r\n this.activate_action = (function(_this) {\r\n return function(evt) {\r\n return _this.activate_field(evt);\r\n };\r\n })(this);\r\n this.active_field = false;\r\n this.mouse_on_container = false;\r\n this.results_showing = false;\r\n this.result_highlighted = null;\r\n this.is_rtl = this.options.rtl || /\\bchosen-rtl\\b/.test(this.form_field.className);\r\n this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === \"\" ? this.options.allow_single_deselect : false;\r\n this.disable_search_threshold = this.options.disable_search_threshold || 0;\r\n this.disable_search = this.options.disable_search || false;\r\n this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;\r\n this.group_search = this.options.group_search != null ? this.options.group_search : true;\r\n this.search_contains = this.options.search_contains || false;\r\n this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;\r\n this.max_selected_options = this.options.max_selected_options || Infinity;\r\n this.inherit_select_classes = this.options.inherit_select_classes || false;\r\n this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;\r\n this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;\r\n this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;\r\n this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;\r\n this.case_sensitive_search = this.options.case_sensitive_search || false;\r\n return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;\r\n };\r\n\r\n AbstractChosen.prototype.set_default_text = function() {\r\n if (this.form_field.getAttribute(\"data-placeholder\")) {\r\n this.default_text = this.form_field.getAttribute(\"data-placeholder\");\r\n } else if (this.is_multiple) {\r\n this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;\r\n } else {\r\n this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;\r\n }\r\n this.default_text = this.escape_html(this.default_text);\r\n return this.results_none_found = this.form_field.getAttribute(\"data-no_results_text\") || this.options.no_results_text || AbstractChosen.default_no_result_text;\r\n };\r\n\r\n AbstractChosen.prototype.choice_label = function(item) {\r\n if (this.include_group_label_in_selected && (item.group_label != null)) {\r\n return \"\" + item.group_label + \"\" + item.html;\r\n } else {\r\n return item.html;\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.mouse_enter = function() {\r\n return this.mouse_on_container = true;\r\n };\r\n\r\n AbstractChosen.prototype.mouse_leave = function() {\r\n return this.mouse_on_container = false;\r\n };\r\n\r\n AbstractChosen.prototype.input_focus = function(evt) {\r\n if (this.is_multiple) {\r\n if (!this.active_field) {\r\n return setTimeout(((function(_this) {\r\n return function() {\r\n return _this.container_mousedown();\r\n };\r\n })(this)), 50);\r\n }\r\n } else {\r\n if (!this.active_field) {\r\n return this.activate_field();\r\n }\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.input_blur = function(evt) {\r\n if (!this.mouse_on_container) {\r\n this.active_field = false;\r\n return setTimeout(((function(_this) {\r\n return function() {\r\n return _this.blur_test();\r\n };\r\n })(this)), 100);\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.label_click_handler = function(evt) {\r\n if (this.is_multiple) {\r\n return this.container_mousedown(evt);\r\n } else {\r\n return this.activate_field();\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.results_option_build = function(options) {\r\n var content, data, data_content, i, len, ref, shown_results;\r\n content = '';\r\n shown_results = 0;\r\n ref = this.results_data;\r\n for (i = 0, len = ref.length; i < len; i++) {\r\n data = ref[i];\r\n data_content = '';\r\n if (data.group) {\r\n data_content = this.result_add_group(data);\r\n } else {\r\n data_content = this.result_add_option(data);\r\n }\r\n if (data_content !== '') {\r\n shown_results++;\r\n content += data_content;\r\n }\r\n if (options != null ? options.first : void 0) {\r\n if (data.selected && this.is_multiple) {\r\n this.choice_build(data);\r\n } else if (data.selected && !this.is_multiple) {\r\n this.single_set_selected_text(this.choice_label(data));\r\n }\r\n }\r\n if (shown_results >= this.max_shown_results) {\r\n break;\r\n }\r\n }\r\n return content;\r\n };\r\n\r\n AbstractChosen.prototype.result_add_option = function(option) {\r\n var classes, option_el;\r\n if (!option.search_match) {\r\n return '';\r\n }\r\n if (!this.include_option_in_results(option)) {\r\n return '';\r\n }\r\n classes = [];\r\n if (!option.disabled && !(option.selected && this.is_multiple)) {\r\n classes.push(\"active-result\");\r\n }\r\n if (option.disabled && !(option.selected && this.is_multiple)) {\r\n classes.push(\"disabled-result\");\r\n }\r\n if (option.selected) {\r\n classes.push(\"result-selected\");\r\n }\r\n if (option.group_array_index != null) {\r\n classes.push(\"group-option\");\r\n }\r\n if (option.classes !== \"\") {\r\n classes.push(option.classes);\r\n }\r\n option_el = document.createElement(\"li\");\r\n option_el.className = classes.join(\" \");\r\n option_el.style.cssText = option.style;\r\n option_el.setAttribute(\"data-option-array-index\", option.array_index);\r\n option_el.innerHTML = option.highlighted_html || option.html;\r\n if (option.title) {\r\n option_el.title = option.title;\r\n }\r\n return this.outerHTML(option_el);\r\n };\r\n\r\n AbstractChosen.prototype.result_add_group = function(group) {\r\n var classes, group_el;\r\n if (!(group.search_match || group.group_match)) {\r\n return '';\r\n }\r\n if (!(group.active_options > 0)) {\r\n return '';\r\n }\r\n classes = [];\r\n classes.push(\"group-result\");\r\n if (group.classes) {\r\n classes.push(group.classes);\r\n }\r\n group_el = document.createElement(\"li\");\r\n group_el.className = classes.join(\" \");\r\n group_el.innerHTML = group.highlighted_html || this.escape_html(group.label);\r\n if (group.title) {\r\n group_el.title = group.title;\r\n }\r\n return this.outerHTML(group_el);\r\n };\r\n\r\n AbstractChosen.prototype.results_update_field = function() {\r\n this.set_default_text();\r\n if (!this.is_multiple) {\r\n this.results_reset_cleanup();\r\n }\r\n this.result_clear_highlight();\r\n this.results_build();\r\n if (this.results_showing) {\r\n return this.winnow_results();\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.reset_single_select_options = function() {\r\n var i, len, ref, result, results1;\r\n ref = this.results_data;\r\n results1 = [];\r\n for (i = 0, len = ref.length; i < len; i++) {\r\n result = ref[i];\r\n if (result.selected) {\r\n results1.push(result.selected = false);\r\n } else {\r\n results1.push(void 0);\r\n }\r\n }\r\n return results1;\r\n };\r\n\r\n AbstractChosen.prototype.results_toggle = function() {\r\n if (this.results_showing) {\r\n return this.results_hide();\r\n } else {\r\n return this.results_show();\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.results_search = function(evt) {\r\n if (this.results_showing) {\r\n return this.winnow_results();\r\n } else {\r\n return this.results_show();\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.winnow_results = function() {\r\n var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;\r\n this.no_results_clear();\r\n results = 0;\r\n query = this.get_search_text();\r\n escapedQuery = query.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, \"\\\\$&\");\r\n regex = this.get_search_regex(escapedQuery);\r\n ref = this.results_data;\r\n for (i = 0, len = ref.length; i < len; i++) {\r\n option = ref[i];\r\n option.search_match = false;\r\n results_group = null;\r\n search_match = null;\r\n option.highlighted_html = '';\r\n if (this.include_option_in_results(option)) {\r\n if (option.group) {\r\n option.group_match = false;\r\n option.active_options = 0;\r\n }\r\n if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {\r\n results_group = this.results_data[option.group_array_index];\r\n if (results_group.active_options === 0 && results_group.search_match) {\r\n results += 1;\r\n }\r\n results_group.active_options += 1;\r\n }\r\n text = option.group ? option.label : option.text;\r\n if (!(option.group && !this.group_search)) {\r\n search_match = this.search_string_match(text, regex);\r\n option.search_match = search_match != null;\r\n if (option.search_match && !option.group) {\r\n results += 1;\r\n }\r\n if (option.search_match) {\r\n if (query.length) {\r\n startpos = search_match.index;\r\n prefix = text.slice(0, startpos);\r\n fix = text.slice(startpos, startpos + query.length);\r\n suffix = text.slice(startpos + query.length);\r\n option.highlighted_html = (this.escape_html(prefix)) + \"\" + (this.escape_html(fix)) + \"\" + (this.escape_html(suffix));\r\n }\r\n if (results_group != null) {\r\n results_group.group_match = true;\r\n }\r\n } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {\r\n option.search_match = true;\r\n }\r\n }\r\n }\r\n }\r\n this.result_clear_highlight();\r\n if (results < 1 && query.length) {\r\n this.update_results_content(\"\");\r\n return this.no_results(query);\r\n } else {\r\n this.update_results_content(this.results_option_build());\r\n return this.winnow_results_set_highlight();\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {\r\n var regex_flag, regex_string;\r\n regex_string = this.search_contains ? escaped_search_string : \"(^|\\\\s|\\\\b)\" + escaped_search_string + \"[^\\\\s]*\";\r\n if (!(this.enable_split_word_search || this.search_contains)) {\r\n regex_string = \"^\" + regex_string;\r\n }\r\n regex_flag = this.case_sensitive_search ? \"\" : \"i\";\r\n return new RegExp(regex_string, regex_flag);\r\n };\r\n\r\n AbstractChosen.prototype.search_string_match = function(search_string, regex) {\r\n var match;\r\n match = regex.exec(search_string);\r\n if (!this.search_contains && (match != null ? match[1] : void 0)) {\r\n match.index += 1;\r\n }\r\n return match;\r\n };\r\n\r\n AbstractChosen.prototype.choices_count = function() {\r\n var i, len, option, ref;\r\n if (this.selected_option_count != null) {\r\n return this.selected_option_count;\r\n }\r\n this.selected_option_count = 0;\r\n ref = this.form_field.options;\r\n for (i = 0, len = ref.length; i < len; i++) {\r\n option = ref[i];\r\n if (option.selected) {\r\n this.selected_option_count += 1;\r\n }\r\n }\r\n return this.selected_option_count;\r\n };\r\n\r\n AbstractChosen.prototype.choices_click = function(evt) {\r\n evt.preventDefault();\r\n this.activate_field();\r\n if (!(this.results_showing || this.is_disabled)) {\r\n return this.results_show();\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.keydown_checker = function(evt) {\r\n var ref, stroke;\r\n stroke = (ref = evt.which) != null ? ref : evt.keyCode;\r\n this.search_field_scale();\r\n if (stroke !== 8 && this.pending_backstroke) {\r\n this.clear_backstroke();\r\n }\r\n switch (stroke) {\r\n case 8:\r\n this.backstroke_length = this.get_search_field_value().length;\r\n break;\r\n case 9:\r\n if (this.results_showing && !this.is_multiple) {\r\n this.result_select(evt);\r\n }\r\n this.mouse_on_container = false;\r\n break;\r\n case 13:\r\n if (this.results_showing) {\r\n evt.preventDefault();\r\n }\r\n break;\r\n case 27:\r\n if (this.results_showing) {\r\n evt.preventDefault();\r\n }\r\n break;\r\n case 32:\r\n if (this.disable_search) {\r\n evt.preventDefault();\r\n }\r\n break;\r\n case 38:\r\n evt.preventDefault();\r\n this.keyup_arrow();\r\n break;\r\n case 40:\r\n evt.preventDefault();\r\n this.keydown_arrow();\r\n break;\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.keyup_checker = function(evt) {\r\n var ref, stroke;\r\n stroke = (ref = evt.which) != null ? ref : evt.keyCode;\r\n this.search_field_scale();\r\n switch (stroke) {\r\n case 8:\r\n if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {\r\n this.keydown_backstroke();\r\n } else if (!this.pending_backstroke) {\r\n this.result_clear_highlight();\r\n this.results_search();\r\n }\r\n break;\r\n case 13:\r\n evt.preventDefault();\r\n if (this.results_showing) {\r\n this.result_select(evt);\r\n }\r\n break;\r\n case 27:\r\n if (this.results_showing) {\r\n this.results_hide();\r\n }\r\n break;\r\n case 9:\r\n case 16:\r\n case 17:\r\n case 18:\r\n case 38:\r\n case 40:\r\n case 91:\r\n break;\r\n default:\r\n this.results_search();\r\n break;\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.clipboard_event_checker = function(evt) {\r\n if (this.is_disabled) {\r\n return;\r\n }\r\n return setTimeout(((function(_this) {\r\n return function() {\r\n return _this.results_search();\r\n };\r\n })(this)), 50);\r\n };\r\n\r\n AbstractChosen.prototype.container_width = function() {\r\n if (this.options.width != null) {\r\n return this.options.width;\r\n } else {\r\n return this.form_field.offsetWidth + \"px\";\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.include_option_in_results = function(option) {\r\n if (this.is_multiple && (!this.display_selected_options && option.selected)) {\r\n return false;\r\n }\r\n if (!this.display_disabled_options && option.disabled) {\r\n return false;\r\n }\r\n if (option.empty) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n\r\n AbstractChosen.prototype.search_results_touchstart = function(evt) {\r\n this.touch_started = true;\r\n return this.search_results_mouseover(evt);\r\n };\r\n\r\n AbstractChosen.prototype.search_results_touchmove = function(evt) {\r\n this.touch_started = false;\r\n return this.search_results_mouseout(evt);\r\n };\r\n\r\n AbstractChosen.prototype.search_results_touchend = function(evt) {\r\n if (this.touch_started) {\r\n return this.search_results_mouseup(evt);\r\n }\r\n };\r\n\r\n AbstractChosen.prototype.outerHTML = function(element) {\r\n var tmp;\r\n if (element.outerHTML) {\r\n return element.outerHTML;\r\n }\r\n tmp = document.createElement(\"div\");\r\n tmp.appendChild(element);\r\n return tmp.innerHTML;\r\n };\r\n\r\n AbstractChosen.prototype.get_single_html = function() {\r\n return \"\\n \" + this.default_text + \"\\n
\\n
\\n
\\n
\\n \\n
\\n \\n
\";\r\n };\r\n\r\n AbstractChosen.prototype.get_multi_html = function() {\r\n return \"\\n
\\n \\n
\";\r\n };\r\n\r\n AbstractChosen.prototype.get_no_results_html = function(terms) {\r\n return \"
  • \\n \" + this.results_none_found + \" \" + (this.escape_html(terms)) + \"\\n
  • \";\r\n };\r\n\r\n AbstractChosen.browser_is_supported = function() {\r\n if (\"Microsoft Internet Explorer\" === window.navigator.appName) {\r\n return document.documentMode >= 8;\r\n }\r\n if (window.innerWidth < 1025 || /iP(od|hone|ad)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n\r\n AbstractChosen.default_multiple_text = \"Select Some Options\";\r\n\r\n AbstractChosen.default_single_text = \"Select an Option\";\r\n\r\n AbstractChosen.default_no_result_text = \"No results match\";\r\n\r\n return AbstractChosen;\r\n\r\n })();\r\n\r\n $ = jQuery;\r\n\r\n $.fn.extend({\r\n chosen: function(options) {\r\n if (!AbstractChosen.browser_is_supported()) {\r\n this.each(function(idx, input_field) {\r\n var option = document.createElement(\"option\");\r\n option.text = input_field.dataset.placeholder;\r\n option.value = '';\r\n option.disabled = true;\r\n \r\n if(!input_field.options.length){\r\n input_field.add(option, 0);\r\n } else {\r\n if(typeof input_field.options[0].value === 'undefined' || input_field.options[0].value !== ''){\r\n input_field.add(option, 0);\r\n } else {\r\n input_field.options[0].text = input_field.dataset.placeholder;\r\n input_field.options[0].disabled = true;\r\n }\r\n }\r\n });\r\n return this;\r\n }\r\n return this.each(function(input_field) {\r\n var $this, chosen;\r\n $this = $(this);\r\n chosen = $this.data('chosen');\r\n if (options === 'destroy') {\r\n if (chosen instanceof Chosen) {\r\n chosen.destroy();\r\n }\r\n return;\r\n }\r\n if (!(chosen instanceof Chosen)) {\r\n $this.data('chosen', new Chosen(this, options));\r\n }\r\n });\r\n }\r\n });\r\n\r\n Chosen = (function(superClass) {\r\n extend(Chosen, superClass);\r\n\r\n function Chosen() {\r\n return Chosen.__super__.constructor.apply(this, arguments);\r\n }\r\n\r\n Chosen.prototype.setup = function() {\r\n this.form_field_jq = $(this.form_field);\r\n return this.current_selectedIndex = this.form_field.selectedIndex;\r\n };\r\n\r\n Chosen.prototype.set_up_html = function() {\r\n var container_classes, container_props;\r\n container_classes = [\"chosen-container\"];\r\n container_classes.push(\"chosen-container-\" + (this.is_multiple ? \"multi\" : \"single\"));\r\n if (this.inherit_select_classes && this.form_field.className) {\r\n container_classes.push(this.form_field.className);\r\n }\r\n if (this.is_rtl) {\r\n container_classes.push(\"chosen-rtl\");\r\n }\r\n container_props = {\r\n 'class': container_classes.join(' '),\r\n 'title': this.form_field.title\r\n };\r\n if (this.form_field.id.length) {\r\n container_props.id = this.form_field.id.replace(/[^\\w]/g, '_') + \"_chosen\";\r\n }\r\n this.container = $(\"
    \", container_props);\r\n this.container.width(this.container_width());\r\n if (this.is_multiple) {\r\n this.container.html(this.get_multi_html());\r\n } else {\r\n this.container.html(this.get_single_html());\r\n }\r\n this.form_field_jq.hide().after(this.container);\r\n this.dropdown = this.container.find('div.chosen-drop').first();\r\n this.search_field = this.container.find('input').first();\r\n this.search_results = this.container.find('ul.chosen-results').first();\r\n this.search_field_scale();\r\n this.search_no_results = this.container.find('li.no-results').first();\r\n if (this.is_multiple) {\r\n this.search_choices = this.container.find('ul.chosen-choices').first();\r\n this.search_container = this.container.find('li.search-field').first();\r\n } else {\r\n this.search_container = this.container.find('div.chosen-search').first();\r\n this.selected_item = this.container.find('.chosen-single').first();\r\n }\r\n this.results_build();\r\n this.set_tab_index();\r\n return this.set_label_behavior();\r\n };\r\n\r\n Chosen.prototype.on_ready = function() {\r\n return this.form_field_jq.trigger(\"chosen:ready\", {\r\n chosen: this\r\n });\r\n };\r\n\r\n Chosen.prototype.register_observers = function() {\r\n this.container.on('touchstart.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.container_mousedown(evt);\r\n };\r\n })(this));\r\n this.container.on('touchend.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.container_mouseup(evt);\r\n };\r\n })(this));\r\n this.container.on('mousedown.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.container_mousedown(evt);\r\n };\r\n })(this));\r\n this.container.on('mouseup.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.container_mouseup(evt);\r\n };\r\n })(this));\r\n this.container.on('mouseenter.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.mouse_enter(evt);\r\n };\r\n })(this));\r\n this.container.on('mouseleave.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.mouse_leave(evt);\r\n };\r\n })(this));\r\n this.search_results.on('mouseup.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.search_results_mouseup(evt);\r\n };\r\n })(this));\r\n this.search_results.on('mouseover.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.search_results_mouseover(evt);\r\n };\r\n })(this));\r\n this.search_results.on('mouseout.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.search_results_mouseout(evt);\r\n };\r\n })(this));\r\n this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.search_results_mousewheel(evt);\r\n };\r\n })(this));\r\n this.search_results.on('touchstart.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.search_results_touchstart(evt);\r\n };\r\n })(this));\r\n this.search_results.on('touchmove.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.search_results_touchmove(evt);\r\n };\r\n })(this));\r\n this.search_results.on('touchend.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.search_results_touchend(evt);\r\n };\r\n })(this));\r\n this.form_field_jq.on(\"chosen:updated.chosen\", (function(_this) {\r\n return function(evt) {\r\n _this.results_update_field(evt);\r\n };\r\n })(this));\r\n this.form_field_jq.on(\"chosen:activate.chosen\", (function(_this) {\r\n return function(evt) {\r\n _this.activate_field(evt);\r\n };\r\n })(this));\r\n this.form_field_jq.on(\"chosen:open.chosen\", (function(_this) {\r\n return function(evt) {\r\n _this.container_mousedown(evt);\r\n };\r\n })(this));\r\n this.form_field_jq.on(\"chosen:close.chosen\", (function(_this) {\r\n return function(evt) {\r\n _this.close_field(evt);\r\n };\r\n })(this));\r\n this.search_field.on('blur.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.input_blur(evt);\r\n };\r\n })(this));\r\n this.search_field.on('keyup.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.keyup_checker(evt);\r\n };\r\n })(this));\r\n this.search_field.on('keydown.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.keydown_checker(evt);\r\n };\r\n })(this));\r\n this.search_field.on('focus.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.input_focus(evt);\r\n };\r\n })(this));\r\n this.search_field.on('cut.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.clipboard_event_checker(evt);\r\n };\r\n })(this));\r\n this.search_field.on('paste.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.clipboard_event_checker(evt);\r\n };\r\n })(this));\r\n if (this.is_multiple) {\r\n return this.search_choices.on('click.chosen', (function(_this) {\r\n return function(evt) {\r\n _this.choices_click(evt);\r\n };\r\n })(this));\r\n } else {\r\n return this.container.on('click.chosen', function(evt) {\r\n evt.preventDefault();\r\n });\r\n }\r\n };\r\n\r\n Chosen.prototype.destroy = function() {\r\n $(this.container[0].ownerDocument).off('click.chosen', this.click_test_action);\r\n if (this.form_field_label.length > 0) {\r\n this.form_field_label.off('click.chosen');\r\n }\r\n if (this.search_field[0].tabIndex) {\r\n this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;\r\n }\r\n this.container.remove();\r\n this.form_field_jq.removeData('chosen');\r\n return this.form_field_jq.show();\r\n };\r\n\r\n Chosen.prototype.search_field_disabled = function() {\r\n this.is_disabled = this.form_field.disabled || this.form_field_jq.parents('fieldset').is(':disabled');\r\n this.container.toggleClass('chosen-disabled', this.is_disabled);\r\n this.search_field[0].disabled = this.is_disabled;\r\n if (!this.is_multiple) {\r\n this.selected_item.off('focus.chosen', this.activate_field);\r\n }\r\n if (this.is_disabled) {\r\n return this.close_field();\r\n } else if (!this.is_multiple) {\r\n return this.selected_item.on('focus.chosen', this.activate_field);\r\n }\r\n };\r\n\r\n Chosen.prototype.container_mousedown = function(evt) {\r\n var ref;\r\n if (this.is_disabled) {\r\n return;\r\n }\r\n if (evt && ((ref = evt.type) === 'mousedown' || ref === 'touchstart') && !this.results_showing) {\r\n evt.preventDefault();\r\n }\r\n if (!((evt != null) && ($(evt.target)).hasClass(\"search-choice-close\"))) {\r\n if (!this.active_field) {\r\n if (this.is_multiple) {\r\n this.search_field.val(\"\");\r\n }\r\n $(this.container[0].ownerDocument).on('click.chosen', this.click_test_action);\r\n this.results_show();\r\n } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents(\"a.chosen-single\").length)) {\r\n evt.preventDefault();\r\n this.results_toggle();\r\n }\r\n return this.activate_field();\r\n }\r\n };\r\n\r\n Chosen.prototype.container_mouseup = function(evt) {\r\n if (evt.target.nodeName === \"ABBR\" && !this.is_disabled) {\r\n return this.results_reset(evt);\r\n }\r\n };\r\n\r\n Chosen.prototype.search_results_mousewheel = function(evt) {\r\n var delta;\r\n if (evt.originalEvent) {\r\n delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;\r\n }\r\n if (delta != null) {\r\n evt.preventDefault();\r\n if (evt.type === 'DOMMouseScroll') {\r\n delta = delta * 40;\r\n }\r\n return this.search_results.scrollTop(delta + this.search_results.scrollTop());\r\n }\r\n };\r\n\r\n Chosen.prototype.blur_test = function(evt) {\r\n if (!this.active_field && this.container.hasClass(\"chosen-container-active\")) {\r\n return this.close_field();\r\n }\r\n };\r\n\r\n Chosen.prototype.close_field = function() {\r\n $(this.container[0].ownerDocument).off(\"click.chosen\", this.click_test_action);\r\n this.active_field = false;\r\n this.results_hide();\r\n this.container.removeClass(\"chosen-container-active\");\r\n this.clear_backstroke();\r\n this.show_search_field_default();\r\n this.search_field_scale();\r\n return this.search_field.blur();\r\n };\r\n\r\n Chosen.prototype.activate_field = function() {\r\n if (this.is_disabled) {\r\n return;\r\n }\r\n this.container.addClass(\"chosen-container-active\");\r\n this.active_field = true;\r\n this.search_field.val(this.search_field.val());\r\n return this.search_field.focus();\r\n };\r\n\r\n Chosen.prototype.test_active_click = function(evt) {\r\n var active_container;\r\n active_container = $(evt.target).closest('.chosen-container');\r\n if (active_container.length && this.container[0] === active_container[0]) {\r\n return this.active_field = true;\r\n } else {\r\n return this.close_field();\r\n }\r\n };\r\n\r\n Chosen.prototype.results_build = function() {\r\n this.parsing = true;\r\n this.selected_option_count = null;\r\n this.results_data = SelectParser.select_to_array(this.form_field);\r\n if (this.is_multiple) {\r\n this.search_choices.find(\"li.search-choice\").remove();\r\n } else if (!this.is_multiple) {\r\n this.single_set_selected_text();\r\n if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {\r\n this.search_field[0].readOnly = true;\r\n this.container.addClass(\"chosen-container-single-nosearch\");\r\n } else {\r\n this.search_field[0].readOnly = false;\r\n this.container.removeClass(\"chosen-container-single-nosearch\");\r\n }\r\n }\r\n this.update_results_content(this.results_option_build({\r\n first: true\r\n }));\r\n this.search_field_disabled();\r\n this.show_search_field_default();\r\n this.search_field_scale();\r\n return this.parsing = false;\r\n };\r\n\r\n Chosen.prototype.result_do_highlight = function(el) {\r\n var high_bottom, high_top, maxHeight, visible_bottom, visible_top;\r\n if (el.length) {\r\n this.result_clear_highlight();\r\n this.result_highlight = el;\r\n this.result_highlight.addClass(\"highlighted\");\r\n maxHeight = parseInt(this.search_results.css(\"maxHeight\"), 10);\r\n visible_top = this.search_results.scrollTop();\r\n visible_bottom = maxHeight + visible_top;\r\n high_top = this.result_highlight.position().top + this.search_results.scrollTop();\r\n high_bottom = high_top + this.result_highlight.outerHeight();\r\n if (high_bottom >= visible_bottom) {\r\n return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);\r\n } else if (high_top < visible_top) {\r\n return this.search_results.scrollTop(high_top);\r\n }\r\n }\r\n };\r\n\r\n Chosen.prototype.result_clear_highlight = function() {\r\n if (this.result_highlight) {\r\n this.result_highlight.removeClass(\"highlighted\");\r\n }\r\n return this.result_highlight = null;\r\n };\r\n\r\n Chosen.prototype.results_show = function() {\r\n if (this.is_multiple && this.max_selected_options <= this.choices_count()) {\r\n this.form_field_jq.trigger(\"chosen:maxselected\", {\r\n chosen: this\r\n });\r\n return false;\r\n }\r\n this.container.addClass(\"chosen-with-drop\");\r\n this.results_showing = true;\r\n this.search_field.focus();\r\n this.search_field.val(this.get_search_field_value());\r\n this.winnow_results();\r\n return this.form_field_jq.trigger(\"chosen:showing_dropdown\", {\r\n chosen: this\r\n });\r\n };\r\n\r\n Chosen.prototype.update_results_content = function(content) {\r\n return this.search_results.html(content);\r\n };\r\n\r\n Chosen.prototype.results_hide = function() {\r\n if (this.results_showing) {\r\n this.result_clear_highlight();\r\n this.container.removeClass(\"chosen-with-drop\");\r\n this.form_field_jq.trigger(\"chosen:hiding_dropdown\", {\r\n chosen: this\r\n });\r\n }\r\n return this.results_showing = false;\r\n };\r\n\r\n Chosen.prototype.set_tab_index = function(el) {\r\n var ti;\r\n if (this.form_field.tabIndex) {\r\n ti = this.form_field.tabIndex;\r\n this.form_field.tabIndex = -1;\r\n return this.search_field[0].tabIndex = ti;\r\n }\r\n };\r\n\r\n Chosen.prototype.set_label_behavior = function() {\r\n this.form_field_label = this.form_field_jq.parents(\"label\");\r\n if (!this.form_field_label.length && this.form_field.id.length) {\r\n this.form_field_label = $(\"label[for='\" + this.form_field.id + \"']\");\r\n }\r\n if (this.form_field_label.length > 0) {\r\n return this.form_field_label.on('click.chosen', this.label_click_handler);\r\n }\r\n };\r\n\r\n Chosen.prototype.show_search_field_default = function() {\r\n if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {\r\n this.search_field.val(this.default_text);\r\n return this.search_field.addClass(\"default\");\r\n } else {\r\n this.search_field.val(\"\");\r\n return this.search_field.removeClass(\"default\");\r\n }\r\n };\r\n\r\n Chosen.prototype.search_results_mouseup = function(evt) {\r\n var target;\r\n target = $(evt.target).hasClass(\"active-result\") ? $(evt.target) : $(evt.target).parents(\".active-result\").first();\r\n if (target.length) {\r\n this.result_highlight = target;\r\n this.result_select(evt);\r\n return this.search_field.focus();\r\n }\r\n };\r\n\r\n Chosen.prototype.search_results_mouseover = function(evt) {\r\n var target;\r\n target = $(evt.target).hasClass(\"active-result\") ? $(evt.target) : $(evt.target).parents(\".active-result\").first();\r\n if (target) {\r\n return this.result_do_highlight(target);\r\n }\r\n };\r\n\r\n Chosen.prototype.search_results_mouseout = function(evt) {\r\n if ($(evt.target).hasClass(\"active-result\") || $(evt.target).parents('.active-result').first()) {\r\n return this.result_clear_highlight();\r\n }\r\n };\r\n\r\n Chosen.prototype.choice_build = function(item) {\r\n var choice, close_link;\r\n choice = $('
  • ', {\r\n \"class\": \"search-choice\"\r\n }).html(\"\" + (this.choice_label(item)) + \"\");\r\n if (item.disabled) {\r\n choice.addClass('search-choice-disabled');\r\n } else {\r\n close_link = $('', {\r\n \"class\": 'search-choice-close',\r\n 'data-option-array-index': item.array_index\r\n });\r\n close_link.on('click.chosen', (function(_this) {\r\n return function(evt) {\r\n return _this.choice_destroy_link_click(evt);\r\n };\r\n })(this));\r\n choice.append(close_link);\r\n }\r\n return this.search_container.before(choice);\r\n };\r\n\r\n Chosen.prototype.choice_destroy_link_click = function(evt) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n if (!this.is_disabled) {\r\n return this.choice_destroy($(evt.target));\r\n }\r\n };\r\n\r\n Chosen.prototype.choice_destroy = function(link) {\r\n if (this.result_deselect(link[0].getAttribute(\"data-option-array-index\"))) {\r\n if (this.active_field) {\r\n this.search_field.focus();\r\n } else {\r\n this.show_search_field_default();\r\n }\r\n if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {\r\n this.results_hide();\r\n }\r\n link.parents('li').first().remove();\r\n return this.search_field_scale();\r\n }\r\n };\r\n\r\n Chosen.prototype.results_reset = function() {\r\n this.reset_single_select_options();\r\n this.form_field.options[0].selected = true;\r\n this.single_set_selected_text();\r\n this.show_search_field_default();\r\n this.results_reset_cleanup();\r\n this.trigger_form_field_change();\r\n if (this.active_field) {\r\n return this.results_hide();\r\n }\r\n };\r\n\r\n Chosen.prototype.results_reset_cleanup = function() {\r\n this.current_selectedIndex = this.form_field.selectedIndex;\r\n return this.selected_item.find(\"abbr\").remove();\r\n };\r\n\r\n Chosen.prototype.result_select = function(evt) {\r\n var high, item;\r\n if (this.result_highlight) {\r\n high = this.result_highlight;\r\n this.result_clear_highlight();\r\n if (this.is_multiple && this.max_selected_options <= this.choices_count()) {\r\n this.form_field_jq.trigger(\"chosen:maxselected\", {\r\n chosen: this\r\n });\r\n return false;\r\n }\r\n if (this.is_multiple) {\r\n high.removeClass(\"active-result\");\r\n } else {\r\n this.reset_single_select_options();\r\n }\r\n high.addClass(\"result-selected\");\r\n item = this.results_data[high[0].getAttribute(\"data-option-array-index\")];\r\n item.selected = true;\r\n this.form_field.options[item.options_index].selected = true;\r\n this.selected_option_count = null;\r\n this.search_field.val(\"\");\r\n if (this.is_multiple) {\r\n this.choice_build(item);\r\n } else {\r\n this.single_set_selected_text(this.choice_label(item));\r\n }\r\n if (this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey))) {\r\n this.winnow_results();\r\n } else {\r\n this.results_hide();\r\n this.show_search_field_default();\r\n }\r\n if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {\r\n this.trigger_form_field_change({\r\n selected: this.form_field.options[item.options_index].value\r\n });\r\n }\r\n this.current_selectedIndex = this.form_field.selectedIndex;\r\n evt.preventDefault();\r\n return this.search_field_scale();\r\n }\r\n };\r\n\r\n Chosen.prototype.single_set_selected_text = function(text) {\r\n if (text == null) {\r\n text = this.default_text;\r\n }\r\n if (text === this.default_text) {\r\n this.selected_item.addClass(\"chosen-default\");\r\n } else {\r\n this.single_deselect_control_build();\r\n this.selected_item.removeClass(\"chosen-default\");\r\n }\r\n return this.selected_item.find(\"span\").html(text);\r\n };\r\n\r\n Chosen.prototype.result_deselect = function(pos) {\r\n var result_data;\r\n result_data = this.results_data[pos];\r\n if (!this.form_field.options[result_data.options_index].disabled) {\r\n result_data.selected = false;\r\n this.form_field.options[result_data.options_index].selected = false;\r\n this.selected_option_count = null;\r\n this.result_clear_highlight();\r\n if (this.results_showing) {\r\n this.winnow_results();\r\n }\r\n this.trigger_form_field_change({\r\n deselected: this.form_field.options[result_data.options_index].value\r\n });\r\n this.search_field_scale();\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n Chosen.prototype.single_deselect_control_build = function() {\r\n if (!this.allow_single_deselect) {\r\n return;\r\n }\r\n if (!this.selected_item.find(\"abbr\").length) {\r\n this.selected_item.find(\"span\").first().after(\"\");\r\n }\r\n return this.selected_item.addClass(\"chosen-single-with-deselect\");\r\n };\r\n\r\n Chosen.prototype.get_search_field_value = function() {\r\n return this.search_field.val();\r\n };\r\n\r\n Chosen.prototype.get_search_text = function() {\r\n return $.trim(this.get_search_field_value());\r\n };\r\n\r\n Chosen.prototype.escape_html = function(text) {\r\n return $('
    ').text(text).html();\r\n };\r\n\r\n Chosen.prototype.winnow_results_set_highlight = function() {\r\n var do_high, selected_results;\r\n selected_results = !this.is_multiple ? this.search_results.find(\".result-selected.active-result\") : [];\r\n do_high = selected_results.length ? selected_results.first() : this.search_results.find(\".active-result\").first();\r\n if (do_high != null) {\r\n return this.result_do_highlight(do_high);\r\n }\r\n };\r\n\r\n Chosen.prototype.no_results = function(terms) {\r\n var no_results_html;\r\n no_results_html = this.get_no_results_html(terms);\r\n this.search_results.append(no_results_html);\r\n return this.form_field_jq.trigger(\"chosen:no_results\", {\r\n chosen: this\r\n });\r\n };\r\n\r\n Chosen.prototype.no_results_clear = function() {\r\n return this.search_results.find(\".no-results\").remove();\r\n };\r\n\r\n Chosen.prototype.keydown_arrow = function() {\r\n var next_sib;\r\n if (this.results_showing && this.result_highlight) {\r\n next_sib = this.result_highlight.nextAll(\"li.active-result\").first();\r\n if (next_sib) {\r\n return this.result_do_highlight(next_sib);\r\n }\r\n } else {\r\n return this.results_show();\r\n }\r\n };\r\n\r\n Chosen.prototype.keyup_arrow = function() {\r\n var prev_sibs;\r\n if (!this.results_showing && !this.is_multiple) {\r\n return this.results_show();\r\n } else if (this.result_highlight) {\r\n prev_sibs = this.result_highlight.prevAll(\"li.active-result\");\r\n if (prev_sibs.length) {\r\n return this.result_do_highlight(prev_sibs.first());\r\n } else {\r\n if (this.choices_count() > 0) {\r\n this.results_hide();\r\n }\r\n return this.result_clear_highlight();\r\n }\r\n }\r\n };\r\n\r\n Chosen.prototype.keydown_backstroke = function() {\r\n var next_available_destroy;\r\n if (this.pending_backstroke) {\r\n this.choice_destroy(this.pending_backstroke.find(\"a\").first());\r\n return this.clear_backstroke();\r\n } else {\r\n next_available_destroy = this.search_container.siblings(\"li.search-choice\").last();\r\n if (next_available_destroy.length && !next_available_destroy.hasClass(\"search-choice-disabled\")) {\r\n this.pending_backstroke = next_available_destroy;\r\n if (this.single_backstroke_delete) {\r\n return this.keydown_backstroke();\r\n } else {\r\n return this.pending_backstroke.addClass(\"search-choice-focus\");\r\n }\r\n }\r\n }\r\n };\r\n\r\n Chosen.prototype.clear_backstroke = function() {\r\n if (this.pending_backstroke) {\r\n this.pending_backstroke.removeClass(\"search-choice-focus\");\r\n }\r\n return this.pending_backstroke = null;\r\n };\r\n\r\n Chosen.prototype.search_field_scale = function() {\r\n var div, i, len, style, style_block, styles, width;\r\n if (!this.is_multiple) {\r\n return;\r\n }\r\n style_block = {\r\n position: 'absolute',\r\n left: '-1000px',\r\n top: '-1000px',\r\n display: 'none',\r\n whiteSpace: 'pre'\r\n };\r\n styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];\r\n for (i = 0, len = styles.length; i < len; i++) {\r\n style = styles[i];\r\n style_block[style] = this.search_field.css(style);\r\n }\r\n div = $('
    ').css(style_block);\r\n div.text(this.get_search_field_value());\r\n $('body').append(div);\r\n width = div.width() + 25;\r\n div.remove();\r\n if (this.container.is(':visible')) {\r\n width = Math.min(this.container.outerWidth() - 10, width);\r\n }\r\n return this.search_field.width(width);\r\n };\r\n\r\n Chosen.prototype.trigger_form_field_change = function(extra) {\r\n this.form_field_jq.trigger(\"input\", extra);\r\n return this.form_field_jq.trigger(\"change\", extra);\r\n };\r\n\r\n return Chosen;\r\n\r\n })(AbstractChosen);\r\n\r\n}).call(this);\r\n", "/* globals module, $ */\r\n\r\nmodule.exports = {\r\n\tinit: function() {\r\n\t\t\"use strict\";\r\n\r\n\t\tvar that = this;\r\n\r\n\t\t$('input, select, textarea').on('invalid', function() {\r\n\t\t\t$(this.form).addClass('form--invalid');\r\n\t\t}).on('input change', function() {\r\n\t\t\tif(this.type === 'radio' || !this.form) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvar $fieldset = $(this).closest('fieldset');\r\n\r\n\t\t\tif($fieldset.length && $fieldset[0].getAttribute('data-validate')) {\r\n\t\t\t\tthat.checkValidity($fieldset[0], false, false);\r\n\t\t\t} else {\r\n\t\t\t\tthat.checkValidity(this.form, false, false);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$('form').on('submit', function(e) {\r\n\t\t\t//If clicked button has a data-fieldset attribute, only validate that fieldset\r\n\t\t\tif(this.submitted && this.submitted.getAttribute('data-fieldset')) {\r\n\t\t\t\tvar fieldset = document.getElementById(this.submitted.getAttribute('data-fieldset'));\r\n\r\n\t\t\t\tif(!that.checkValidity(fieldset, true, true)) {\r\n\t\t\t\t\te.preventDefault();\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(!that.checkValidity(this, true, true)) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//Track button used to submit form\r\n\t\t$('button, input').on('click', function() {\r\n\t\t\tif(this.type === 'submit' && this.form) {\r\n\t\t\t\tthis.form.submitted = this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//Handle replaced with s due to \"ASP.net limitations\"\r\n\t\t$('[data-submit]').on('click', function() {\r\n\t\t\tvar $form = $(this).closest('form');\r\n\r\n\t\t\tif($form.length) {\r\n\t\t\t\t$form.prop('submitted', this);\r\n\t\t\t\t$form.submit();\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * Checks validity of the given form, and updates submit button states as needed\r\n\t *\r\n\t * If the form is invalid, buttons will be given a disabled appearance,\r\n\t * but will remain enabled to allow future validation/submission.\r\n\t *\r\n\t * If the form is valid, buttons will appear enabled.\r\n\t *\r\n\t * @param {HTMLFormElement} form The form to check\r\n\t * @param highlight - If true and the form is invalid, fields will be highlighted by adding the invalid classes\r\n\t * @param scroll - If true will scroll the page to the first invalid element when validation fails\r\n\t */\r\n\tcheckValidity: function(form, highlight, scroll) {\r\n\t\t\"use strict\";\r\n\r\n\t\tvar valid = true,\r\n\t\t\tbuttons = [],\r\n\t\t\tscrollTarget;\r\n\r\n\t\t$(form.elements).each(function() {\r\n\t\t\tif(this instanceof HTMLFieldSetElement) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(this instanceof HTMLButtonElement && this.type === 'submit') {\r\n\t\t\t\tbuttons.push(this);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif($(this).hasClass('quantity__input')) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Manually validate hidden inputs since the browser doesn't\r\n\t\t\tif(this.type === 'hidden') {\r\n\t\t\t\tif(this.required && !this.value) {\r\n\t\t\t\t\tvalid = false;\r\n\r\n\t\t\t\t\tif(highlight) {\r\n\t\t\t\t\t\t$(this).closest('.form__group').addClass('form__group--invalid');\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this).closest('.form__group').removeClass('form__group--invalid');\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(!this.validity.valid) {\r\n\t\t\t\tvalid = false;\r\n\r\n\t\t\t\t//Set scroll target to label for radio/checkbox inputs\r\n\t\t\t\tif(this.type === 'radio' || this.type === 'checkbox') {\r\n\t\t\t\t\tscrollTarget = this.nextElementSibling;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscrollTarget = this;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t//Add \"submit buttons\" used on checkout to button array because ASP.net\r\n\t\t$(form).find('a.btn').each(function() {\r\n\t\t\tif(this.hasAttribute('data-submit')) {\r\n\t\t\t\tbuttons.push(this);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(valid) {\r\n\t\t\t$(form).removeClass('form--invalid');\r\n\r\n\t\t\tbuttons.forEach(function(element) {\r\n\t\t\t\t$(element).removeClass('btn--disabled');\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tif(highlight) {\r\n\t\t\t\t$(form).addClass('form--invalid');\r\n\t\t\t}\r\n\r\n\t\t\tbuttons.forEach(function(element) {\r\n\t\t\t\t$(element).addClass('btn--disabled');\r\n\t\t\t});\r\n\r\n\t\t\tif(scroll && scrollTarget) {\r\n\t\t\t\tvar offset = $(scrollTarget).offset().top - ($(window).height() / 2);\r\n\r\n\t\t\t\t$(document.scrollingElement).animate({\r\n\t\t\t\t\tscrollTop: offset,\r\n\t\t\t\t}, 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn valid;\r\n\t}\r\n};\r\n", "/**\r\n * Intro.js v2.7.0\r\n * https://github.com/usablica/intro.js\r\n *\r\n * Copyright (C) 2017 Afshin Mehrabani (@afshinmeh)\r\n */\r\n\r\n(function (root, factory) {\r\n if (typeof exports === 'object') {\r\n // CommonJS\r\n factory(exports);\r\n } else if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module.\r\n define(['exports'], factory);\r\n } else {\r\n // Browser globals\r\n factory(root);\r\n }\r\n} (this, function (exports) {\r\n //Default config/variables\r\n var VERSION = '2.7.0';\r\n\r\n /**\r\n * IntroJs main class\r\n *\r\n * @class IntroJs\r\n */\r\n function IntroJs(obj) {\r\n this._targetElement = obj;\r\n this._introItems = [];\r\n\r\n this._options = {\r\n /* Next button label in tooltip box */\r\n nextLabel: 'Next →',\r\n /* Previous button label in tooltip box */\r\n prevLabel: '← Back',\r\n /* Skip button label in tooltip box */\r\n skipLabel: 'Skip',\r\n /* Done button label in tooltip box */\r\n doneLabel: 'Done',\r\n /* Hide previous button in the first step? Otherwise, it will be disabled button. */\r\n hidePrev: false,\r\n /* Hide next button in the last step? Otherwise, it will be disabled button. */\r\n hideNext: false,\r\n /* Default tooltip box position */\r\n tooltipPosition: 'bottom',\r\n /* Next CSS class for tooltip boxes */\r\n tooltipClass: '',\r\n /* CSS class that is added to the helperLayer */\r\n highlightClass: '',\r\n /* Close introduction when pressing Escape button? */\r\n exitOnEsc: true,\r\n /* Close introduction when clicking on overlay layer? */\r\n exitOnOverlayClick: true,\r\n /* Show step numbers in introduction? */\r\n showStepNumbers: true,\r\n /* Let user use keyboard to navigate the tour? */\r\n keyboardNavigation: true,\r\n /* Show tour control buttons? */\r\n showButtons: true,\r\n /* Show tour bullets? */\r\n showBullets: true,\r\n /* Show tour progress? */\r\n showProgress: false,\r\n /* Scroll to highlighted element? */\r\n scrollToElement: true,\r\n /*\r\n * Should we scroll the tooltip or target element?\r\n *\r\n * Options are: 'element' or 'tooltip'\r\n */\r\n scrollTo: 'element',\r\n /* Padding to add after scrolling when element is not in the viewport (in pixels) */\r\n scrollPadding: 30,\r\n /* Set the overlay opacity */\r\n overlayOpacity: 0.8,\r\n /* Precedence of positions, when auto is enabled */\r\n positionPrecedence: [\"bottom\", \"top\", \"right\", \"left\"],\r\n /* Disable an interaction with element? */\r\n disableInteraction: false,\r\n /* Default hint position */\r\n hintPosition: 'top-middle',\r\n /* Hint button label */\r\n hintButtonLabel: 'Got it',\r\n /* Adding animation to hints? */\r\n hintAnimation: true\r\n };\r\n }\r\n\r\n /**\r\n * Initiate a new introduction/guide from an element in the page\r\n *\r\n * @api private\r\n * @method _introForElement\r\n * @param {Object} targetElm\r\n * @returns {Boolean} Success or not?\r\n */\r\n function _introForElement(targetElm) {\r\n var introItems = [],\r\n self = this;\r\n\r\n if (this._options.steps) {\r\n //use steps passed programmatically\r\n for (var i = 0, stepsLength = this._options.steps.length; i < stepsLength; i++) {\r\n var currentItem = _cloneObject(this._options.steps[i]);\r\n\r\n //set the step\r\n currentItem.step = introItems.length + 1;\r\n\r\n //use querySelector function only when developer used CSS selector\r\n if (typeof (currentItem.element) === 'string') {\r\n //grab the element with given selector from the page\r\n currentItem.element = document.querySelector(currentItem.element);\r\n }\r\n\r\n //intro without element\r\n if (typeof (currentItem.element) === 'undefined' || currentItem.element == null) {\r\n var floatingElementQuery = document.querySelector(\".introjsFloatingElement\");\r\n\r\n if (floatingElementQuery == null) {\r\n floatingElementQuery = document.createElement('div');\r\n floatingElementQuery.className = 'introjsFloatingElement';\r\n\r\n document.body.appendChild(floatingElementQuery);\r\n }\r\n\r\n currentItem.element = floatingElementQuery;\r\n currentItem.position = 'floating';\r\n }\r\n\r\n currentItem.scrollTo = currentItem.scrollTo || this._options.scrollTo;\r\n\r\n if (typeof (currentItem.disableInteraction) === 'undefined') {\r\n currentItem.disableInteraction = this._options.disableInteraction;\r\n }\r\n\r\n if (currentItem.element != null) {\r\n introItems.push(currentItem);\r\n }\r\n }\r\n\r\n } else {\r\n //use steps from data-* annotations\r\n var allIntroSteps = targetElm.querySelectorAll('*[data-intro]');\r\n //if there's no element to intro\r\n if (allIntroSteps.length < 1) {\r\n return false;\r\n }\r\n\r\n //first add intro items with data-step\r\n for (var i = 0, elmsLength = allIntroSteps.length; i < elmsLength; i++) {\r\n var currentElement = allIntroSteps[i];\r\n\r\n // skip hidden elements\r\n if (currentElement.style.display == 'none') {\r\n continue;\r\n }\r\n\r\n var step = parseInt(currentElement.getAttribute('data-step'), 10);\r\n\r\n var disableInteraction = this._options.disableInteraction;\r\n\r\n if (typeof (currentElement.getAttribute('data-disable-interaction')) != 'undefined') {\r\n disableInteraction = !!currentElement.getAttribute('data-disable-interaction');\r\n }\r\n\r\n if (step > 0) {\r\n introItems[step - 1] = {\r\n element: currentElement,\r\n intro: currentElement.getAttribute('data-intro'),\r\n step: parseInt(currentElement.getAttribute('data-step'), 10),\r\n tooltipClass: currentElement.getAttribute('data-tooltipClass'),\r\n highlightClass: currentElement.getAttribute('data-highlightClass'),\r\n position: currentElement.getAttribute('data-position') || this._options.tooltipPosition,\r\n scrollTo: currentElement.getAttribute('data-scrollTo') || this._options.scrollTo,\r\n disableInteraction: disableInteraction\r\n };\r\n }\r\n }\r\n\r\n //next add intro items without data-step\r\n //todo: we need a cleanup here, two loops are redundant\r\n var nextStep = 0;\r\n for (var i = 0, elmsLength = allIntroSteps.length; i < elmsLength; i++) {\r\n var currentElement = allIntroSteps[i];\r\n\r\n if (currentElement.getAttribute('data-step') == null) {\r\n\r\n while (true) {\r\n if (typeof introItems[nextStep] == 'undefined') {\r\n break;\r\n } else {\r\n nextStep++;\r\n }\r\n }\r\n\r\n var disableInteraction = this._options.disableInteraction;\r\n\r\n if (typeof (currentElement.getAttribute('data-disable-interaction')) != 'undefined') {\r\n disableInteraction = !!currentElement.getAttribute('data-disable-interaction');\r\n }\r\n\r\n introItems[nextStep] = {\r\n element: currentElement,\r\n intro: currentElement.getAttribute('data-intro'),\r\n step: nextStep + 1,\r\n tooltipClass: currentElement.getAttribute('data-tooltipClass'),\r\n highlightClass: currentElement.getAttribute('data-highlightClass'),\r\n position: currentElement.getAttribute('data-position') || this._options.tooltipPosition,\r\n scrollTo: currentElement.getAttribute('data-scrollTo') || this._options.scrollTo,\r\n disableInteraction: disableInteraction\r\n };\r\n }\r\n }\r\n }\r\n\r\n //removing undefined/null elements\r\n var tempIntroItems = [];\r\n for (var z = 0; z < introItems.length; z++) {\r\n introItems[z] && tempIntroItems.push(introItems[z]); // copy non-empty values to the end of the array\r\n }\r\n\r\n introItems = tempIntroItems;\r\n\r\n //Ok, sort all items with given steps\r\n introItems.sort(function (a, b) {\r\n return a.step - b.step;\r\n });\r\n\r\n //set it to the introJs object\r\n self._introItems = introItems;\r\n\r\n //add overlay layer to the page\r\n if(_addOverlayLayer.call(self, targetElm)) {\r\n //then, start the show\r\n _nextStep.call(self);\r\n\r\n var skipButton = targetElm.querySelector('.introjs-skipbutton'),\r\n nextStepButton = targetElm.querySelector('.introjs-nextbutton');\r\n\r\n self._onKeyDown = function(e) {\r\n if (e.keyCode === 27 && self._options.exitOnEsc == true) {\r\n //escape key pressed, exit the intro\r\n //check if exit callback is defined\r\n _exitIntro.call(self, targetElm);\r\n } else if(e.keyCode === 37) {\r\n //left arrow\r\n _previousStep.call(self);\r\n } else if (e.keyCode === 39) {\r\n //right arrow\r\n _nextStep.call(self);\r\n } else if (e.keyCode === 13) {\r\n //srcElement === ie\r\n var target = e.target || e.srcElement;\r\n if (target && target.className.indexOf('introjs-prevbutton') > 0) {\r\n //user hit enter while focusing on previous button\r\n _previousStep.call(self);\r\n } else if (target && target.className.indexOf('introjs-skipbutton') > 0) {\r\n //user hit enter while focusing on skip button\r\n if (self._introItems.length - 1 == self._currentStep && typeof (self._introCompleteCallback) === 'function') {\r\n self._introCompleteCallback.call(self);\r\n }\r\n\r\n _exitIntro.call(self, targetElm);\r\n } else {\r\n //default behavior for responding to enter\r\n _nextStep.call(self);\r\n }\r\n\r\n //prevent default behaviour on hitting Enter, to prevent steps being skipped in some browsers\r\n if(e.preventDefault) {\r\n e.preventDefault();\r\n } else {\r\n e.returnValue = false;\r\n }\r\n }\r\n };\r\n\r\n self._onResize = function(e) {\r\n self.refresh.call(self);\r\n };\r\n\r\n if (window.addEventListener) {\r\n if (this._options.keyboardNavigation) {\r\n window.addEventListener('keydown', self._onKeyDown, true);\r\n }\r\n //for window resize\r\n window.addEventListener('resize', self._onResize, true);\r\n } else if (document.attachEvent) { //IE\r\n if (this._options.keyboardNavigation) {\r\n document.attachEvent('onkeydown', self._onKeyDown);\r\n }\r\n //for window resize\r\n document.attachEvent('onresize', self._onResize);\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n /*\r\n * makes a copy of the object\r\n * @api private\r\n * @method _cloneObject\r\n */\r\n function _cloneObject(object) {\r\n if (object == null || typeof (object) != 'object' || typeof (object.nodeType) != 'undefined') {\r\n return object;\r\n }\r\n var temp = {};\r\n for (var key in object) {\r\n if (typeof (jQuery) != 'undefined' && object[key] instanceof jQuery) {\r\n temp[key] = object[key];\r\n } else {\r\n temp[key] = _cloneObject(object[key]);\r\n }\r\n }\r\n return temp;\r\n }\r\n /**\r\n * Go to specific step of introduction\r\n *\r\n * @api private\r\n * @method _goToStep\r\n */\r\n function _goToStep(step) {\r\n //because steps starts with zero\r\n this._currentStep = step - 2;\r\n if (typeof (this._introItems) !== 'undefined') {\r\n _nextStep.call(this);\r\n }\r\n }\r\n\r\n /**\r\n * Go to the specific step of introduction with the explicit [data-step] number\r\n *\r\n * @api private\r\n * @method _goToStepNumber\r\n */\r\n function _goToStepNumber(step) {\r\n this._currentStepNumber = step;\r\n if (typeof (this._introItems) !== 'undefined') {\r\n _nextStep.call(this);\r\n }\r\n }\r\n\r\n /**\r\n * Go to next step on intro\r\n *\r\n * @api private\r\n * @method _nextStep\r\n */\r\n function _nextStep() {\r\n this._direction = 'forward';\r\n\r\n if (typeof (this._currentStepNumber) !== 'undefined') {\r\n for( var i = 0, len = this._introItems.length; i < len; i++ ) {\r\n var item = this._introItems[i];\r\n if( item.step === this._currentStepNumber ) {\r\n this._currentStep = i - 1;\r\n this._currentStepNumber = undefined;\r\n }\r\n }\r\n }\r\n\r\n if (typeof (this._currentStep) === 'undefined') {\r\n this._currentStep = 0;\r\n } else {\r\n ++this._currentStep;\r\n }\r\n\r\n if ((this._introItems.length) <= this._currentStep) {\r\n //end of the intro\r\n //check if any callback is defined\r\n if (typeof (this._introCompleteCallback) === 'function') {\r\n this._introCompleteCallback.call(this);\r\n }\r\n _exitIntro.call(this, this._targetElement);\r\n return;\r\n }\r\n\r\n var nextStep = this._introItems[this._currentStep];\r\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\r\n this._introBeforeChangeCallback.call(this, nextStep.element);\r\n }\r\n\r\n _showElement.call(this, nextStep);\r\n }\r\n\r\n /**\r\n * Go to previous step on intro\r\n *\r\n * @api private\r\n * @method _previousStep\r\n */\r\n function _previousStep() {\r\n this._direction = 'backward';\r\n\r\n if (this._currentStep === 0) {\r\n return false;\r\n }\r\n\r\n var nextStep = this._introItems[--this._currentStep];\r\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\r\n this._introBeforeChangeCallback.call(this, nextStep.element);\r\n }\r\n\r\n _showElement.call(this, nextStep);\r\n }\r\n\r\n /**\r\n * Update placement of the intro objects on the screen\r\n * @api private\r\n */\r\n function _refresh() {\r\n // re-align intros\r\n _setHelperLayerPosition.call(this, document.querySelector('.introjs-helperLayer'));\r\n _setHelperLayerPosition.call(this, document.querySelector('.introjs-tooltipReferenceLayer'));\r\n\r\n // re-align tooltip\r\n if(this._currentStep !== undefined && this._currentStep !== null) {\r\n var oldHelperNumberLayer = document.querySelector('.introjs-helperNumberLayer'),\r\n oldArrowLayer = document.querySelector('.introjs-arrow'),\r\n oldtooltipContainer = document.querySelector('.introjs-tooltip');\r\n _placeTooltip.call(this, this._introItems[this._currentStep].element, oldtooltipContainer, oldArrowLayer, oldHelperNumberLayer);\r\n }\r\n\r\n //re-align hints\r\n _reAlignHints.call(this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Exit from intro\r\n *\r\n * @api private\r\n * @method _exitIntro\r\n * @param {Object} targetElement\r\n * @param {Boolean} force - Setting to `true` will skip the result of beforeExit callback\r\n */\r\n function _exitIntro(targetElement, force) {\r\n var continueExit = true;\r\n\r\n // calling onbeforeexit callback\r\n // \r\n // If this callback return `false`, it would halt the process\r\n if (this._introBeforeExitCallback != undefined) {\r\n continueExit = this._introBeforeExitCallback.call(self);\r\n }\r\n\r\n // skip this check if `force` parameter is `true`\r\n // otherwise, if `onbeforeexit` returned `false`, don't exit the intro\r\n if (!force && continueExit === false) return;\r\n\r\n //remove overlay layers from the page\r\n var overlayLayers = targetElement.querySelectorAll('.introjs-overlay');\r\n\r\n if (overlayLayers && overlayLayers.length > 0) {\r\n for (var i = overlayLayers.length - 1; i >= 0; i--) {\r\n //for fade-out animation\r\n var overlayLayer = overlayLayers[i];\r\n overlayLayer.style.opacity = 0;\r\n setTimeout(function () {\r\n if (this.parentNode) {\r\n this.parentNode.removeChild(this);\r\n }\r\n }.bind(overlayLayer), 500);\r\n };\r\n }\r\n\r\n //remove all helper layers\r\n var helperLayer = targetElement.querySelector('.introjs-helperLayer');\r\n if (helperLayer) {\r\n helperLayer.parentNode.removeChild(helperLayer);\r\n }\r\n\r\n var referenceLayer = targetElement.querySelector('.introjs-tooltipReferenceLayer');\r\n if (referenceLayer) {\r\n referenceLayer.parentNode.removeChild(referenceLayer);\r\n }\r\n\r\n //remove disableInteractionLayer\r\n var disableInteractionLayer = targetElement.querySelector('.introjs-disableInteraction');\r\n if (disableInteractionLayer) {\r\n disableInteractionLayer.parentNode.removeChild(disableInteractionLayer);\r\n }\r\n\r\n //remove intro floating element\r\n var floatingElement = document.querySelector('.introjsFloatingElement');\r\n if (floatingElement) {\r\n floatingElement.parentNode.removeChild(floatingElement);\r\n }\r\n\r\n _removeShowElement();\r\n\r\n //remove `introjs-fixParent` class from the elements\r\n var fixParents = document.querySelectorAll('.introjs-fixParent');\r\n if (fixParents && fixParents.length > 0) {\r\n for (var i = fixParents.length - 1; i >= 0; i--) {\r\n fixParents[i].className = fixParents[i].className.replace(/introjs-fixParent/g, '').replace(/^\\s+|\\s+$/g, '');\r\n }\r\n }\r\n\r\n //clean listeners\r\n if (window.removeEventListener) {\r\n window.removeEventListener('keydown', this._onKeyDown, true);\r\n } else if (document.detachEvent) { //IE\r\n document.detachEvent('onkeydown', this._onKeyDown);\r\n }\r\n\r\n //check if any callback is defined\r\n if (this._introExitCallback != undefined) {\r\n this._introExitCallback.call(self);\r\n }\r\n\r\n //set the step to zero\r\n this._currentStep = undefined;\r\n }\r\n\r\n /**\r\n * Render tooltip box in the page\r\n *\r\n * @api private\r\n * @method _placeTooltip\r\n * @param {HTMLElement} targetElement\r\n * @param {HTMLElement} tooltipLayer\r\n * @param {HTMLElement} arrowLayer\r\n * @param {HTMLElement} helperNumberLayer\r\n * @param {Boolean} hintMode\r\n */\r\n function _placeTooltip(targetElement, tooltipLayer, arrowLayer, helperNumberLayer, hintMode) {\r\n var tooltipCssClass = '',\r\n currentStepObj,\r\n tooltipOffset,\r\n targetOffset,\r\n windowSize,\r\n currentTooltipPosition;\r\n\r\n hintMode = hintMode || false;\r\n\r\n //reset the old style\r\n tooltipLayer.style.top = null;\r\n tooltipLayer.style.right = null;\r\n tooltipLayer.style.bottom = null;\r\n tooltipLayer.style.left = null;\r\n tooltipLayer.style.marginLeft = null;\r\n tooltipLayer.style.marginTop = null;\r\n\r\n arrowLayer.style.display = 'inherit';\r\n\r\n if (typeof(helperNumberLayer) != 'undefined' && helperNumberLayer != null) {\r\n helperNumberLayer.style.top = null;\r\n helperNumberLayer.style.left = null;\r\n }\r\n\r\n //prevent error when `this._currentStep` is undefined\r\n if (!this._introItems[this._currentStep]) return;\r\n\r\n //if we have a custom css class for each step\r\n currentStepObj = this._introItems[this._currentStep];\r\n if (typeof (currentStepObj.tooltipClass) === 'string') {\r\n tooltipCssClass = currentStepObj.tooltipClass;\r\n } else {\r\n tooltipCssClass = this._options.tooltipClass;\r\n }\r\n\r\n tooltipLayer.className = ('introjs-tooltip ' + tooltipCssClass).replace(/^\\s+|\\s+$/g, '');\r\n\r\n currentTooltipPosition = this._introItems[this._currentStep].position;\r\n\r\n if (currentTooltipPosition != \"floating\") { // Floating is always valid, no point in calculating\r\n if (currentTooltipPosition === \"auto\") {\r\n currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer);\r\n } else {\r\n currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer, currentTooltipPosition);\r\n }\r\n }\r\n\r\n targetOffset = _getOffset(targetElement);\r\n tooltipOffset = _getOffset(tooltipLayer);\r\n windowSize = _getWinSize();\r\n\r\n switch (currentTooltipPosition) {\r\n case 'top':\r\n arrowLayer.className = 'introjs-arrow bottom';\r\n\r\n if (hintMode) {\r\n var tooltipLayerStyleLeft = 0;\r\n } else {\r\n var tooltipLayerStyleLeft = 15;\r\n }\r\n\r\n _checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer);\r\n tooltipLayer.style.bottom = (targetOffset.height + 20) + 'px';\r\n break;\r\n case 'right':\r\n tooltipLayer.style.left = (targetOffset.width + 20) + 'px';\r\n if (targetOffset.top + tooltipOffset.height > windowSize.height) {\r\n // In this case, right would have fallen below the bottom of the screen.\r\n // Modify so that the bottom of the tooltip connects with the target\r\n arrowLayer.className = \"introjs-arrow left-bottom\";\r\n tooltipLayer.style.top = \"-\" + (tooltipOffset.height - targetOffset.height - 20) + \"px\";\r\n } else {\r\n arrowLayer.className = 'introjs-arrow left';\r\n }\r\n break;\r\n case 'left':\r\n if (!hintMode && this._options.showStepNumbers == true) {\r\n tooltipLayer.style.top = '15px';\r\n }\r\n\r\n if (targetOffset.top + tooltipOffset.height > windowSize.height) {\r\n // In this case, left would have fallen below the bottom of the screen.\r\n // Modify so that the bottom of the tooltip connects with the target\r\n tooltipLayer.style.top = \"-\" + (tooltipOffset.height - targetOffset.height - 20) + \"px\";\r\n arrowLayer.className = 'introjs-arrow right-bottom';\r\n } else {\r\n arrowLayer.className = 'introjs-arrow right';\r\n }\r\n tooltipLayer.style.right = (targetOffset.width + 20) + 'px';\r\n\r\n break;\r\n case 'floating':\r\n arrowLayer.style.display = 'none';\r\n\r\n //we have to adjust the top and left of layer manually for intro items without element\r\n tooltipLayer.style.left = '50%';\r\n tooltipLayer.style.top = '50%';\r\n tooltipLayer.style.marginLeft = '-' + (tooltipOffset.width / 2) + 'px';\r\n tooltipLayer.style.marginTop = '-' + (tooltipOffset.height / 2) + 'px';\r\n\r\n if (typeof(helperNumberLayer) != 'undefined' && helperNumberLayer != null) {\r\n helperNumberLayer.style.left = '-' + ((tooltipOffset.width / 2) + 18) + 'px';\r\n helperNumberLayer.style.top = '-' + ((tooltipOffset.height / 2) + 18) + 'px';\r\n }\r\n\r\n break;\r\n case 'bottom-right-aligned':\r\n arrowLayer.className = 'introjs-arrow top-right';\r\n\r\n var tooltipLayerStyleRight = 0;\r\n _checkLeft(targetOffset, tooltipLayerStyleRight, tooltipOffset, tooltipLayer);\r\n tooltipLayer.style.top = (targetOffset.height + 20) + 'px';\r\n break;\r\n\r\n case 'bottom-middle-aligned':\r\n arrowLayer.className = 'introjs-arrow top-middle';\r\n\r\n var tooltipLayerStyleLeftRight = targetOffset.width / 2 - tooltipOffset.width / 2;\r\n\r\n // a fix for middle aligned hints\r\n if (hintMode) {\r\n tooltipLayerStyleLeftRight += 5;\r\n }\r\n\r\n if (_checkLeft(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, tooltipLayer)) {\r\n tooltipLayer.style.right = null;\r\n _checkRight(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, windowSize, tooltipLayer);\r\n }\r\n tooltipLayer.style.top = (targetOffset.height + 20) + 'px';\r\n break;\r\n\r\n case 'bottom-left-aligned':\r\n // Bottom-left-aligned is the same as the default bottom\r\n case 'bottom':\r\n // Bottom going to follow the default behavior\r\n default:\r\n arrowLayer.className = 'introjs-arrow top';\r\n\r\n var tooltipLayerStyleLeft = 0;\r\n _checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer);\r\n tooltipLayer.style.top = (targetOffset.height + 20) + 'px';\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Set tooltip left so it doesn't go off the right side of the window\r\n *\r\n * @return boolean true, if tooltipLayerStyleLeft is ok. false, otherwise.\r\n */\r\n function _checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer) {\r\n if (targetOffset.left + tooltipLayerStyleLeft + tooltipOffset.width > windowSize.width) {\r\n // off the right side of the window\r\n tooltipLayer.style.left = (windowSize.width - tooltipOffset.width - targetOffset.left) + 'px';\r\n return false;\r\n }\r\n tooltipLayer.style.left = tooltipLayerStyleLeft + 'px';\r\n return true;\r\n }\r\n\r\n /**\r\n * Set tooltip right so it doesn't go off the left side of the window\r\n *\r\n * @return boolean true, if tooltipLayerStyleRight is ok. false, otherwise.\r\n */\r\n function _checkLeft(targetOffset, tooltipLayerStyleRight, tooltipOffset, tooltipLayer) {\r\n if (targetOffset.left + targetOffset.width - tooltipLayerStyleRight - tooltipOffset.width < 0) {\r\n // off the left side of the window\r\n tooltipLayer.style.left = (-targetOffset.left) + 'px';\r\n return false;\r\n }\r\n tooltipLayer.style.right = tooltipLayerStyleRight + 'px';\r\n return true;\r\n }\r\n\r\n /**\r\n * Determines the position of the tooltip based on the position precedence and availability\r\n * of screen space.\r\n *\r\n * @param {Object} targetElement\r\n * @param {Object} tooltipLayer\r\n * @param {Object} desiredTooltipPosition\r\n *\r\n */\r\n function _determineAutoPosition(targetElement, tooltipLayer, desiredTooltipPosition) {\r\n // Take a clone of position precedence. These will be the available\r\n var possiblePositions = this._options.positionPrecedence.slice();\r\n\r\n var windowSize = _getWinSize();\r\n var tooltipHeight = _getOffset(tooltipLayer).height + 10;\r\n var tooltipWidth = _getOffset(tooltipLayer).width + 20;\r\n var targetOffset = _getOffset(targetElement);\r\n\r\n // If we check all the possible areas, and there are no valid places for the tooltip, the element\r\n // must take up most of the screen real estate. Show the tooltip floating in the middle of the screen.\r\n var calculatedPosition = \"floating\";\r\n\r\n // Check if the width of the tooltip + the starting point would spill off the right side of the screen\r\n // If no, neither bottom or top are valid\r\n if (targetOffset.left + tooltipWidth > windowSize.width || ((targetOffset.left + (targetOffset.width / 2)) - (tooltipWidth / 2)) < 0) {\r\n _removeEntry(possiblePositions, \"bottom\");\r\n _removeEntry(possiblePositions, \"top\");\r\n } else {\r\n // Check for space below\r\n if ((targetOffset.height + targetOffset.top + tooltipHeight) > windowSize.height) {\r\n _removeEntry(possiblePositions, \"bottom\");\r\n }\r\n\r\n // Check for space above\r\n if (targetOffset.top - tooltipHeight < 0) {\r\n _removeEntry(possiblePositions, \"top\");\r\n }\r\n }\r\n\r\n // Check for space to the right\r\n if (targetOffset.width + targetOffset.left + tooltipWidth > windowSize.width) {\r\n _removeEntry(possiblePositions, \"right\");\r\n }\r\n\r\n // Check for space to the left\r\n if (targetOffset.left - tooltipWidth < 0) {\r\n _removeEntry(possiblePositions, \"left\");\r\n }\r\n\r\n // At this point, our array only has positions that are valid. Pick the first one, as it remains in order\r\n if (possiblePositions.length > 0) {\r\n calculatedPosition = possiblePositions[0];\r\n }\r\n\r\n // If the requested position is in the list, replace our calculated choice with that\r\n if (desiredTooltipPosition && desiredTooltipPosition != \"auto\") {\r\n if (possiblePositions.indexOf(desiredTooltipPosition) > -1) {\r\n calculatedPosition = desiredTooltipPosition;\r\n }\r\n }\r\n\r\n return calculatedPosition;\r\n }\r\n\r\n /**\r\n * Remove an entry from a string array if it's there, does nothing if it isn't there.\r\n *\r\n * @param {Array} stringArray\r\n * @param {String} stringToRemove\r\n */\r\n function _removeEntry(stringArray, stringToRemove) {\r\n if (stringArray.indexOf(stringToRemove) > -1) {\r\n stringArray.splice(stringArray.indexOf(stringToRemove), 1);\r\n }\r\n }\r\n\r\n /**\r\n * Update the position of the helper layer on the screen\r\n *\r\n * @api private\r\n * @method _setHelperLayerPosition\r\n * @param {Object} helperLayer\r\n */\r\n function _setHelperLayerPosition(helperLayer) {\r\n if (helperLayer) {\r\n //prevent error when `this._currentStep` in undefined\r\n if (!this._introItems[this._currentStep]) return;\r\n\r\n var currentElement = this._introItems[this._currentStep],\r\n elementPosition = _getOffset(currentElement.element),\r\n widthHeightPadding = 10;\r\n\r\n // If the target element is fixed, the tooltip should be fixed as well.\r\n // Otherwise, remove a fixed class that may be left over from the previous\r\n // step.\r\n if (_isFixed(currentElement.element)) {\r\n helperLayer.className += ' introjs-fixedTooltip';\r\n } else {\r\n helperLayer.className = helperLayer.className.replace(' introjs-fixedTooltip', '');\r\n }\r\n\r\n if (currentElement.position == 'floating') {\r\n widthHeightPadding = 0;\r\n }\r\n\r\n //set new position to helper layer\r\n helperLayer.setAttribute('style', 'width: ' + (elementPosition.width + widthHeightPadding) + 'px; ' +\r\n 'height:' + (elementPosition.height + widthHeightPadding) + 'px; ' +\r\n 'top:' + (elementPosition.top - 5) + 'px;' +\r\n 'left: ' + (elementPosition.left - 5) + 'px;');\r\n\r\n }\r\n }\r\n\r\n /**\r\n * Add disableinteraction layer and adjust the size and position of the layer\r\n *\r\n * @api private\r\n * @method _disableInteraction\r\n */\r\n function _disableInteraction() {\r\n var disableInteractionLayer = document.querySelector('.introjs-disableInteraction');\r\n\r\n if (disableInteractionLayer === null) {\r\n disableInteractionLayer = document.createElement('div');\r\n disableInteractionLayer.className = 'introjs-disableInteraction';\r\n this._targetElement.appendChild(disableInteractionLayer);\r\n }\r\n\r\n _setHelperLayerPosition.call(this, disableInteractionLayer);\r\n }\r\n\r\n /**\r\n * Setting anchors to behave like buttons\r\n *\r\n * @api private\r\n * @method _setAnchorAsButton\r\n */\r\n function _setAnchorAsButton(anchor){\r\n anchor.setAttribute('role', 'button');\r\n anchor.tabIndex = 0;\r\n }\r\n\r\n /**\r\n * Show an element on the page\r\n *\r\n * @api private\r\n * @method _showElement\r\n * @param {Object} targetElement\r\n */\r\n function _showElement(targetElement) {\r\n if (typeof (this._introChangeCallback) !== 'undefined') {\r\n this._introChangeCallback.call(this, targetElement.element);\r\n }\r\n\r\n var self = this,\r\n oldHelperLayer = document.querySelector('.introjs-helperLayer'),\r\n oldReferenceLayer = document.querySelector('.introjs-tooltipReferenceLayer'),\r\n highlightClass = 'introjs-helperLayer',\r\n elementPosition = _getOffset(targetElement.element);\r\n\r\n //check for a current step highlight class\r\n if (typeof (targetElement.highlightClass) === 'string') {\r\n highlightClass += (' ' + targetElement.highlightClass);\r\n }\r\n //check for options highlight class\r\n if (typeof (this._options.highlightClass) === 'string') {\r\n highlightClass += (' ' + this._options.highlightClass);\r\n }\r\n\r\n if (oldHelperLayer != null) {\r\n var oldHelperNumberLayer = oldReferenceLayer.querySelector('.introjs-helperNumberLayer'),\r\n oldtooltipLayer = oldReferenceLayer.querySelector('.introjs-tooltiptext'),\r\n oldArrowLayer = oldReferenceLayer.querySelector('.introjs-arrow'),\r\n oldtooltipContainer = oldReferenceLayer.querySelector('.introjs-tooltip'),\r\n skipTooltipButton = oldReferenceLayer.querySelector('.introjs-skipbutton'),\r\n prevTooltipButton = oldReferenceLayer.querySelector('.introjs-prevbutton'),\r\n nextTooltipButton = oldReferenceLayer.querySelector('.introjs-nextbutton');\r\n\r\n //update or reset the helper highlight class\r\n oldHelperLayer.className = highlightClass;\r\n //hide the tooltip\r\n oldtooltipContainer.style.opacity = 0;\r\n oldtooltipContainer.style.display = \"none\";\r\n\r\n if (oldHelperNumberLayer != null) {\r\n var lastIntroItem = this._introItems[(targetElement.step - 2 >= 0 ? targetElement.step - 2 : 0)];\r\n\r\n if (lastIntroItem != null && (this._direction == 'forward' && lastIntroItem.position == 'floating') || (this._direction == 'backward' && targetElement.position == 'floating')) {\r\n oldHelperNumberLayer.style.opacity = 0;\r\n }\r\n }\r\n\r\n //set new position to helper layer\r\n _setHelperLayerPosition.call(self, oldHelperLayer);\r\n _setHelperLayerPosition.call(self, oldReferenceLayer);\r\n\r\n //remove `introjs-fixParent` class from the elements\r\n var fixParents = document.querySelectorAll('.introjs-fixParent');\r\n if (fixParents && fixParents.length > 0) {\r\n for (var i = fixParents.length - 1; i >= 0; i--) {\r\n fixParents[i].className = fixParents[i].className.replace(/introjs-fixParent/g, '').replace(/^\\s+|\\s+$/g, '');\r\n };\r\n }\r\n\r\n //remove old classes if the element still exist\r\n _removeShowElement();\r\n\r\n //we should wait until the CSS3 transition is competed (it's 0.3 sec) to prevent incorrect `height` and `width` calculation\r\n if (self._lastShowElementTimer) {\r\n clearTimeout(self._lastShowElementTimer);\r\n }\r\n\r\n self._lastShowElementTimer = setTimeout(function() {\r\n //set current step to the label\r\n if (oldHelperNumberLayer != null) {\r\n oldHelperNumberLayer.innerHTML = targetElement.step;\r\n }\r\n //set current tooltip text\r\n oldtooltipLayer.innerHTML = targetElement.intro;\r\n //set the tooltip position\r\n oldtooltipContainer.style.display = \"block\";\r\n _placeTooltip.call(self, targetElement.element, oldtooltipContainer, oldArrowLayer, oldHelperNumberLayer);\r\n\r\n //change active bullet\r\n if (self._options.showBullets) {\r\n oldReferenceLayer.querySelector('.introjs-bullets li > a.active').className = '';\r\n oldReferenceLayer.querySelector('.introjs-bullets li > a[data-stepnumber=\"' + targetElement.step + '\"]').className = 'active';\r\n }\r\n oldReferenceLayer.querySelector('.introjs-progress .introjs-progressbar').setAttribute('style', 'width:' + _getProgress.call(self) + '%;');\r\n\r\n //show the tooltip\r\n oldtooltipContainer.style.opacity = 1;\r\n if (oldHelperNumberLayer) oldHelperNumberLayer.style.opacity = 1;\r\n\r\n //reset button focus\r\n if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton != null && /introjs-donebutton/gi.test(skipTooltipButton.className)) {\r\n // skip button is now \"done\" button\r\n skipTooltipButton.focus();\r\n } else if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n //still in the tour, focus on next\r\n nextTooltipButton.focus();\r\n }\r\n\r\n // change the scroll of the window, if needed\r\n _scrollTo.call(self, targetElement.scrollTo, targetElement, oldtooltipLayer);\r\n }, 350);\r\n\r\n // end of old element if-else condition\r\n } else {\r\n var helperLayer = document.createElement('div'),\r\n referenceLayer = document.createElement('div'),\r\n arrowLayer = document.createElement('div'),\r\n tooltipLayer = document.createElement('div'),\r\n tooltipTextLayer = document.createElement('div'),\r\n bulletsLayer = document.createElement('div'),\r\n progressLayer = document.createElement('div'),\r\n buttonsLayer = document.createElement('div');\r\n\r\n helperLayer.className = highlightClass;\r\n referenceLayer.className = 'introjs-tooltipReferenceLayer';\r\n\r\n //set new position to helper layer\r\n _setHelperLayerPosition.call(self, helperLayer);\r\n _setHelperLayerPosition.call(self, referenceLayer);\r\n\r\n //add helper layer to target element\r\n this._targetElement.appendChild(helperLayer);\r\n this._targetElement.appendChild(referenceLayer);\r\n\r\n arrowLayer.className = 'introjs-arrow';\r\n\r\n tooltipTextLayer.className = 'introjs-tooltiptext';\r\n tooltipTextLayer.innerHTML = targetElement.intro;\r\n\r\n bulletsLayer.className = 'introjs-bullets';\r\n\r\n if (this._options.showBullets === false) {\r\n bulletsLayer.style.display = 'none';\r\n }\r\n\r\n var ulContainer = document.createElement('ul');\r\n\r\n for (var i = 0, stepsLength = this._introItems.length; i < stepsLength; i++) {\r\n var innerLi = document.createElement('li');\r\n var anchorLink = document.createElement('a');\r\n\r\n anchorLink.onclick = function() {\r\n self.goToStep(this.getAttribute('data-stepnumber'));\r\n };\r\n\r\n if (i === (targetElement.step-1)) anchorLink.className = 'active';\r\n\r\n _setAnchorAsButton(anchorLink);\r\n anchorLink.innerHTML = \" \";\r\n anchorLink.setAttribute('data-stepnumber', this._introItems[i].step);\r\n\r\n innerLi.appendChild(anchorLink);\r\n ulContainer.appendChild(innerLi);\r\n }\r\n\r\n bulletsLayer.appendChild(ulContainer);\r\n\r\n progressLayer.className = 'introjs-progress';\r\n\r\n if (this._options.showProgress === false) {\r\n progressLayer.style.display = 'none';\r\n }\r\n var progressBar = document.createElement('div');\r\n progressBar.className = 'introjs-progressbar';\r\n progressBar.setAttribute('style', 'width:' + _getProgress.call(this) + '%;');\r\n\r\n progressLayer.appendChild(progressBar);\r\n\r\n buttonsLayer.className = 'introjs-tooltipbuttons';\r\n if (this._options.showButtons === false) {\r\n buttonsLayer.style.display = 'none';\r\n }\r\n\r\n tooltipLayer.className = 'introjs-tooltip';\r\n tooltipLayer.appendChild(tooltipTextLayer);\r\n tooltipLayer.appendChild(bulletsLayer);\r\n tooltipLayer.appendChild(progressLayer);\r\n\r\n //add helper layer number\r\n if (this._options.showStepNumbers == true) {\r\n var helperNumberLayer = document.createElement('span');\r\n helperNumberLayer.className = 'introjs-helperNumberLayer';\r\n helperNumberLayer.innerHTML = targetElement.step;\r\n referenceLayer.appendChild(helperNumberLayer);\r\n }\r\n\r\n tooltipLayer.appendChild(arrowLayer);\r\n referenceLayer.appendChild(tooltipLayer);\r\n\r\n //next button\r\n var nextTooltipButton = document.createElement('a');\r\n\r\n nextTooltipButton.onclick = function() {\r\n if (self._introItems.length - 1 != self._currentStep) {\r\n _nextStep.call(self);\r\n }\r\n };\r\n\r\n _setAnchorAsButton(nextTooltipButton);\r\n nextTooltipButton.innerHTML = this._options.nextLabel;\r\n\r\n //previous button\r\n var prevTooltipButton = document.createElement('a');\r\n\r\n prevTooltipButton.onclick = function() {\r\n if (self._currentStep != 0) {\r\n _previousStep.call(self);\r\n }\r\n };\r\n\r\n _setAnchorAsButton(prevTooltipButton);\r\n prevTooltipButton.innerHTML = this._options.prevLabel;\r\n\r\n //skip button\r\n var skipTooltipButton = document.createElement('a');\r\n skipTooltipButton.className = 'introjs-button introjs-skipbutton';\r\n _setAnchorAsButton(skipTooltipButton);\r\n skipTooltipButton.innerHTML = this._options.skipLabel;\r\n\r\n skipTooltipButton.onclick = function() {\r\n if (self._introItems.length - 1 == self._currentStep && typeof (self._introCompleteCallback) === 'function') {\r\n self._introCompleteCallback.call(self);\r\n }\r\n\r\n _exitIntro.call(self, self._targetElement);\r\n };\r\n\r\n buttonsLayer.appendChild(skipTooltipButton);\r\n\r\n //in order to prevent displaying next/previous button always\r\n if (this._introItems.length > 1) {\r\n buttonsLayer.appendChild(prevTooltipButton);\r\n buttonsLayer.appendChild(nextTooltipButton);\r\n }\r\n\r\n tooltipLayer.appendChild(buttonsLayer);\r\n\r\n //set proper position\r\n _placeTooltip.call(self, targetElement.element, tooltipLayer, arrowLayer, helperNumberLayer);\r\n\r\n // change the scroll of the window, if needed\r\n _scrollTo.call(this, targetElement.scrollTo, targetElement, tooltipLayer);\r\n\r\n //end of new element if-else condition\r\n }\r\n\r\n // removing previous disable interaction layer\r\n var disableInteractionLayer = self._targetElement.querySelector('.introjs-disableInteraction');\r\n if (disableInteractionLayer) {\r\n disableInteractionLayer.parentNode.removeChild(disableInteractionLayer);\r\n }\r\n\r\n //disable interaction\r\n if (targetElement.disableInteraction) {\r\n _disableInteraction.call(self);\r\n }\r\n\r\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n nextTooltipButton.removeAttribute('tabIndex');\r\n }\r\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton != null) {\r\n prevTooltipButton.removeAttribute('tabIndex');\r\n }\r\n\r\n // when it's the first step of tour\r\n if (this._currentStep == 0 && this._introItems.length > 1) {\r\n if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton != null) {\r\n skipTooltipButton.className = 'introjs-button introjs-skipbutton';\r\n }\r\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n nextTooltipButton.className = 'introjs-button introjs-nextbutton';\r\n }\r\n\r\n if (this._options.hidePrev == true) {\r\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton != null) {\r\n prevTooltipButton.className = 'introjs-button introjs-prevbutton introjs-hidden';\r\n }\r\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n nextTooltipButton.className += ' introjs-fullbutton';\r\n }\r\n } else {\r\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton != null) {\r\n prevTooltipButton.className = 'introjs-button introjs-prevbutton introjs-disabled';\r\n }\r\n }\r\n\r\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton != null) {\r\n prevTooltipButton.tabIndex = '-1';\r\n }\r\n if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton != null) {\r\n skipTooltipButton.innerHTML = this._options.skipLabel;\r\n }\r\n } else if (this._introItems.length - 1 == this._currentStep || this._introItems.length == 1) {\r\n // last step of tour\r\n if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton != null) {\r\n skipTooltipButton.innerHTML = this._options.doneLabel;\r\n // adding donebutton class in addition to skipbutton\r\n skipTooltipButton.className += ' introjs-donebutton';\r\n }\r\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton != null) {\r\n prevTooltipButton.className = 'introjs-button introjs-prevbutton';\r\n }\r\n\r\n if (this._options.hideNext == true) {\r\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n nextTooltipButton.className = 'introjs-button introjs-nextbutton introjs-hidden';\r\n }\r\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton != null) {\r\n prevTooltipButton.className += ' introjs-fullbutton';\r\n }\r\n } else {\r\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n nextTooltipButton.className = 'introjs-button introjs-nextbutton introjs-disabled';\r\n }\r\n }\r\n\r\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n nextTooltipButton.tabIndex = '-1';\r\n }\r\n } else {\r\n // steps between start and end\r\n if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton != null) {\r\n skipTooltipButton.className = 'introjs-button introjs-skipbutton';\r\n }\r\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton != null) {\r\n prevTooltipButton.className = 'introjs-button introjs-prevbutton';\r\n }\r\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n nextTooltipButton.className = 'introjs-button introjs-nextbutton';\r\n }\r\n if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton != null) {\r\n skipTooltipButton.innerHTML = this._options.skipLabel;\r\n }\r\n }\r\n\r\n //Set focus on \"next\" button, so that hitting Enter always moves you onto the next step\r\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton != null) {\r\n nextTooltipButton.focus();\r\n }\r\n\r\n _setShowElement(targetElement);\r\n\r\n if (typeof (this._introAfterChangeCallback) !== 'undefined') {\r\n this._introAfterChangeCallback.call(this, targetElement.element);\r\n }\r\n }\r\n\r\n /**\r\n * To change the scroll of `window` after highlighting an element\r\n *\r\n * @api private\r\n * @method _scrollTo\r\n * @param {String} scrollTo\r\n * @param {Object} targetElement\r\n * @param {Object} tooltipLayer\r\n */\r\n function _scrollTo(scrollTo, targetElement, tooltipLayer) {\r\n if (!this._options.scrollToElement) return;\r\n\r\n if (scrollTo === 'tooltip') {\r\n var rect = tooltipLayer.getBoundingClientRect();\r\n } else {\r\n var rect = targetElement.element.getBoundingClientRect();\r\n }\r\n\r\n if (!_elementInViewport(targetElement.element)) {\r\n var winHeight = _getWinSize().height;\r\n var top = rect.bottom - (rect.bottom - rect.top);\r\n var bottom = rect.bottom - winHeight;\r\n\r\n // TODO (afshinm): do we need scroll padding now?\r\n // I have changed the scroll option and now it scrolls the window to\r\n // the center of the target element or tooltip.\r\n\r\n if (top < 0 || targetElement.element.clientHeight > winHeight) {\r\n window.scrollBy(0, rect.top - ((winHeight / 2) - (rect.height / 2)) - this._options.scrollPadding); // 30px padding from edge to look nice\r\n\r\n //Scroll down\r\n } else {\r\n window.scrollBy(0, rect.top - ((winHeight / 2) - (rect.height / 2)) + this._options.scrollPadding); // 30px padding from edge to look nice\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * To remove all show element(s)\r\n *\r\n * @api private\r\n * @method _removeShowElement\r\n */\r\n function _removeShowElement() {\r\n var elms = document.querySelectorAll('.introjs-showElement');\r\n\r\n for (var i = 0, l = elms.length; i < l; i++) {\r\n var elm = elms[i];\r\n _removeClass(elm, /introjs-[a-zA-Z]+/g);\r\n }\r\n }\r\n\r\n /**\r\n * To set the show element\r\n * This function set a relative (in most cases) position and changes the z-index\r\n *\r\n * @api private\r\n * @method _setShowElement\r\n * @param {Object} targetElement\r\n */\r\n function _setShowElement(targetElement) {\r\n // we need to add this show element class to the parent of SVG elements\r\n // because the SVG elements can't have independent z-index\r\n if (targetElement.element instanceof SVGElement) {\r\n var parentElm = targetElement.element.parentNode;\r\n\r\n while (targetElement.element.parentNode != null) {\r\n if (!parentElm.tagName || parentElm.tagName.toLowerCase() === 'body') break;\r\n\r\n if (parentElm.tagName.toLowerCase() === 'svg') {\r\n _setClass(parentElm, 'introjs-showElement introjs-relativePosition');\r\n }\r\n\r\n parentElm = parentElm.parentNode;\r\n }\r\n }\r\n\r\n _setClass(targetElement.element, 'introjs-showElement');\r\n\r\n var currentElementPosition = _getPropValue(targetElement.element, 'position');\r\n if (currentElementPosition !== 'absolute' &&\r\n currentElementPosition !== 'relative' &&\r\n currentElementPosition !== 'fixed') {\r\n //change to new intro item\r\n //targetElement.element.className += ' introjs-relativePosition';\r\n _setClass(targetElement.element, 'introjs-relativePosition')\r\n }\r\n\r\n var parentElm = targetElement.element.parentNode;\r\n while (parentElm != null) {\r\n if (!parentElm.tagName || parentElm.tagName.toLowerCase() === 'body') break;\r\n\r\n //fix The Stacking Context problem.\r\n //More detail: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context\r\n var zIndex = _getPropValue(parentElm, 'z-index');\r\n var opacity = parseFloat(_getPropValue(parentElm, 'opacity'));\r\n var transform = _getPropValue(parentElm, 'transform') || _getPropValue(parentElm, '-webkit-transform') || _getPropValue(parentElm, '-moz-transform') || _getPropValue(parentElm, '-ms-transform') || _getPropValue(parentElm, '-o-transform');\r\n if (/[0-9]+/.test(zIndex) || opacity < 1 || (transform !== 'none' && transform !== undefined)) {\r\n parentElm.className += ' introjs-fixParent';\r\n }\r\n\r\n parentElm = parentElm.parentNode;\r\n }\r\n }\r\n\r\n function _setClass(element, className) {\r\n if (element instanceof SVGElement) {\r\n var pre = element.getAttribute('class') || '';\r\n\r\n element.setAttribute('class', pre + ' ' + className);\r\n } else {\r\n element.className += ' ' + className;\r\n }\r\n }\r\n\r\n function _removeClass(element, classNameRegex) {\r\n if (element instanceof SVGElement) {\r\n var pre = element.getAttribute('class') || '';\r\n\r\n element.setAttribute('class', pre.replace(classNameRegex, '').replace(/^\\s+|\\s+$/g, ''));\r\n } else {\r\n element.className = element.className.replace(classNameRegex, '').replace(/^\\s+|\\s+$/g, '');\r\n }\r\n }\r\n\r\n /**\r\n * Get an element CSS property on the page\r\n * Thanks to JavaScript Kit: http://www.javascriptkit.com/dhtmltutors/dhtmlcascade4.shtml\r\n *\r\n * @api private\r\n * @method _getPropValue\r\n * @param {Object} element\r\n * @param {String} propName\r\n * @returns Element's property value\r\n */\r\n function _getPropValue (element, propName) {\r\n var propValue = '';\r\n if (element.currentStyle) { //IE\r\n propValue = element.currentStyle[propName];\r\n } else if (document.defaultView && document.defaultView.getComputedStyle) { //Others\r\n propValue = document.defaultView.getComputedStyle(element, null).getPropertyValue(propName);\r\n }\r\n\r\n //Prevent exception in IE\r\n if (propValue && propValue.toLowerCase) {\r\n return propValue.toLowerCase();\r\n } else {\r\n return propValue;\r\n }\r\n }\r\n\r\n /**\r\n * Checks to see if target element (or parents) position is fixed or not\r\n *\r\n * @api private\r\n * @method _isFixed\r\n * @param {Object} element\r\n * @returns Boolean\r\n */\r\n function _isFixed (element) {\r\n var p = element.parentNode;\r\n\r\n if (!p || p.nodeName === 'HTML') {\r\n return false;\r\n }\r\n\r\n if (_getPropValue(element, 'position') == 'fixed') {\r\n return true;\r\n }\r\n\r\n return _isFixed(p);\r\n }\r\n\r\n /**\r\n * Provides a cross-browser way to get the screen dimensions\r\n * via: http://stackoverflow.com/questions/5864467/internet-explorer-innerheight\r\n *\r\n * @api private\r\n * @method _getWinSize\r\n * @returns {Object} width and height attributes\r\n */\r\n function _getWinSize() {\r\n if (window.innerWidth != undefined) {\r\n return { width: window.innerWidth, height: window.innerHeight };\r\n } else {\r\n var D = document.documentElement;\r\n return { width: D.clientWidth, height: D.clientHeight };\r\n }\r\n }\r\n\r\n /**\r\n * Check to see if the element is in the viewport or not\r\n * http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport\r\n *\r\n * @api private\r\n * @method _elementInViewport\r\n * @param {Object} el\r\n */\r\n function _elementInViewport(el) {\r\n var rect = el.getBoundingClientRect();\r\n\r\n return (\r\n rect.top >= 0 &&\r\n rect.left >= 0 &&\r\n (rect.bottom+80) <= window.innerHeight && // add 80 to get the text right\r\n rect.right <= window.innerWidth\r\n );\r\n }\r\n\r\n /**\r\n * Add overlay layer to the page\r\n *\r\n * @api private\r\n * @method _addOverlayLayer\r\n * @param {Object} targetElm\r\n */\r\n function _addOverlayLayer(targetElm) {\r\n var overlayLayer = document.createElement('div'),\r\n styleText = '',\r\n self = this;\r\n\r\n //set css class name\r\n overlayLayer.className = 'introjs-overlay';\r\n\r\n //check if the target element is body, we should calculate the size of overlay layer in a better way\r\n if (!targetElm.tagName || targetElm.tagName.toLowerCase() === 'body') {\r\n styleText += 'top: 0;bottom: 0; left: 0;right: 0;position: fixed;';\r\n overlayLayer.setAttribute('style', styleText);\r\n } else {\r\n //set overlay layer position\r\n var elementPosition = _getOffset(targetElm);\r\n if (elementPosition) {\r\n styleText += 'width: ' + elementPosition.width + 'px; height:' + elementPosition.height + 'px; top:' + elementPosition.top + 'px;left: ' + elementPosition.left + 'px;';\r\n overlayLayer.setAttribute('style', styleText);\r\n }\r\n }\r\n\r\n targetElm.appendChild(overlayLayer);\r\n\r\n overlayLayer.onclick = function() {\r\n if (self._options.exitOnOverlayClick == true) {\r\n _exitIntro.call(self, targetElm);\r\n }\r\n };\r\n\r\n setTimeout(function() {\r\n styleText += 'opacity: ' + self._options.overlayOpacity.toString() + ';';\r\n overlayLayer.setAttribute('style', styleText);\r\n }, 10);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Removes open hint (tooltip hint)\r\n *\r\n * @api private\r\n * @method _removeHintTooltip\r\n */\r\n function _removeHintTooltip() {\r\n var tooltip = this._targetElement.querySelector('.introjs-hintReference');\r\n\r\n if (tooltip) {\r\n var step = tooltip.getAttribute('data-step');\r\n tooltip.parentNode.removeChild(tooltip);\r\n return step;\r\n }\r\n }\r\n\r\n /**\r\n * Start parsing hint items\r\n *\r\n * @api private\r\n * @param {Object} targetElm\r\n * @method _startHint\r\n */\r\n function _populateHints(targetElm) {\r\n var self = this;\r\n this._introItems = [];\r\n\r\n if (this._options.hints) {\r\n for (var i = 0, l = this._options.hints.length; i < l; i++) {\r\n var currentItem = _cloneObject(this._options.hints[i]);\r\n\r\n if (typeof(currentItem.element) === 'string') {\r\n //grab the element with given selector from the page\r\n currentItem.element = document.querySelector(currentItem.element);\r\n }\r\n\r\n currentItem.hintPosition = currentItem.hintPosition || this._options.hintPosition;\r\n currentItem.hintAnimation = currentItem.hintAnimation || this._options.hintAnimation;\r\n\r\n if (currentItem.element != null) {\r\n this._introItems.push(currentItem);\r\n }\r\n }\r\n } else {\r\n var hints = targetElm.querySelectorAll('*[data-hint]');\r\n\r\n if (hints.length < 1) {\r\n return false;\r\n }\r\n\r\n //first add intro items with data-step\r\n for (var i = 0, l = hints.length; i < l; i++) {\r\n var currentElement = hints[i];\r\n\r\n // hint animation\r\n var hintAnimation = currentElement.getAttribute('data-hintAnimation');\r\n\r\n if (hintAnimation) {\r\n hintAnimation = (hintAnimation == 'true');\r\n } else {\r\n hintAnimation = this._options.hintAnimation;\r\n }\r\n\r\n this._introItems.push({\r\n element: currentElement,\r\n hint: currentElement.getAttribute('data-hint'),\r\n hintPosition: currentElement.getAttribute('data-hintPosition') || this._options.hintPosition,\r\n hintAnimation: hintAnimation,\r\n tooltipClass: currentElement.getAttribute('data-tooltipClass'),\r\n position: currentElement.getAttribute('data-position') || this._options.tooltipPosition\r\n });\r\n }\r\n }\r\n\r\n _addHints.call(this);\r\n\r\n if (document.addEventListener) {\r\n document.addEventListener('click', _removeHintTooltip.bind(this), false);\r\n //for window resize\r\n window.addEventListener('resize', _reAlignHints.bind(this), true);\r\n } else if (document.attachEvent) { //IE\r\n //for window resize\r\n document.attachEvent('onclick', _removeHintTooltip.bind(this));\r\n document.attachEvent('onresize', _reAlignHints.bind(this));\r\n }\r\n }\r\n\r\n /**\r\n * Re-aligns all hint elements\r\n *\r\n * @api private\r\n * @method _reAlignHints\r\n */\r\n function _reAlignHints() {\r\n for (var i = 0, l = this._introItems.length; i < l; i++) {\r\n var item = this._introItems[i];\r\n\r\n if (typeof (item.targetElement) == 'undefined') continue;\r\n\r\n _alignHintPosition.call(this, item.hintPosition, item.element, item.targetElement)\r\n }\r\n }\r\n\r\n /**\r\n * Hide a hint\r\n *\r\n * @api private\r\n * @method _hideHint\r\n */\r\n function _hideHint(stepId) {\r\n _removeHintTooltip.call(this);\r\n var hint = this._targetElement.querySelector('.introjs-hint[data-step=\"' + stepId + '\"]');\r\n\r\n if (hint) {\r\n hint.className += ' introjs-hidehint';\r\n }\r\n\r\n // call the callback function (if any)\r\n if (typeof (this._hintCloseCallback) !== 'undefined') {\r\n this._hintCloseCallback.call(this, stepId);\r\n }\r\n }\r\n\r\n /**\r\n * Hide all hints\r\n *\r\n * @api private\r\n * @method _hideHints\r\n */\r\n function _hideHints() {\r\n var hints = this._targetElement.querySelectorAll('.introjs-hint');\r\n\r\n if (hints && hints.length > 0) {\r\n for (var i = 0; i < hints.length; i++) {\r\n _hideHint.call(this, hints[i].getAttribute('data-step'));\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Show all hints\r\n *\r\n * @api private\r\n * @method _showHints\r\n */\r\n function _showHints() {\r\n var hints = this._targetElement.querySelectorAll('.introjs-hint');\r\n\r\n if (hints && hints.length > 0) {\r\n for (var i = 0; i < hints.length; i++) {\r\n _showHint.call(this, hints[i].getAttribute('data-step'));\r\n }\r\n } else {\r\n _populateHints.call(this, this._targetElement);\r\n }\r\n };\r\n\r\n /**\r\n * Show a hint\r\n *\r\n * @api private\r\n * @method _showHint\r\n */\r\n function _showHint(stepId) {\r\n var hint = this._targetElement.querySelector('.introjs-hint[data-step=\"' + stepId + '\"]');\r\n\r\n if (hint) {\r\n hint.className = hint.className.replace(/introjs\\-hidehint/g, '');\r\n }\r\n };\r\n\r\n /**\r\n * Removes all hint elements on the page\r\n * Useful when you want to destroy the elements and add them again (e.g. a modal or popup)\r\n *\r\n * @api private\r\n * @method _removeHints\r\n */\r\n function _removeHints() {\r\n var hints = this._targetElement.querySelectorAll('.introjs-hint');\r\n\r\n if (hints && hints.length > 0) {\r\n for (var i = 0; i < hints.length; i++) {\r\n _removeHint.call(this, hints[i].getAttribute('data-step'));\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Remove one single hint element from the page\r\n * Useful when you want to destroy the element and add them again (e.g. a modal or popup)\r\n * Use removeHints if you want to remove all elements.\r\n *\r\n * @api private\r\n * @method _removeHint\r\n */\r\n function _removeHint(stepId) {\r\n var hint = this._targetElement.querySelector('.introjs-hint[data-step=\"' + stepId + '\"]');\r\n\r\n if (hint) {\r\n hint.parentNode.removeChild(hint);\r\n }\r\n };\r\n\r\n /**\r\n * Add all available hints to the page\r\n *\r\n * @api private\r\n * @method _addHints\r\n */\r\n function _addHints() {\r\n var self = this;\r\n\r\n var oldHintsWrapper = document.querySelector('.introjs-hints');\r\n\r\n if (oldHintsWrapper != null) {\r\n hintsWrapper = oldHintsWrapper;\r\n } else {\r\n var hintsWrapper = document.createElement('div');\r\n hintsWrapper.className = 'introjs-hints';\r\n }\r\n\r\n for (var i = 0, l = this._introItems.length; i < l; i++) {\r\n var item = this._introItems[i];\r\n\r\n // avoid append a hint twice\r\n if (document.querySelector('.introjs-hint[data-step=\"' + i + '\"]'))\r\n continue;\r\n\r\n var hint = document.createElement('a');\r\n _setAnchorAsButton(hint);\r\n\r\n (function (hint, item, i) {\r\n // when user clicks on the hint element\r\n hint.onclick = function(e) {\r\n var evt = e ? e : window.event;\r\n if (evt.stopPropagation) evt.stopPropagation();\r\n if (evt.cancelBubble != null) evt.cancelBubble = true;\r\n\r\n _showHintDialog.call(self, i);\r\n };\r\n }(hint, item, i));\r\n\r\n hint.className = 'introjs-hint';\r\n\r\n if (!item.hintAnimation) {\r\n hint.className += ' introjs-hint-no-anim';\r\n }\r\n\r\n // hint's position should be fixed if the target element's position is fixed\r\n if (_isFixed(item.element)) {\r\n hint.className += ' introjs-fixedhint';\r\n }\r\n\r\n var hintDot = document.createElement('div');\r\n hintDot.className = 'introjs-hint-dot';\r\n var hintPulse = document.createElement('div');\r\n hintPulse.className = 'introjs-hint-pulse';\r\n\r\n hint.appendChild(hintDot);\r\n hint.appendChild(hintPulse);\r\n hint.setAttribute('data-step', i);\r\n\r\n // we swap the hint element with target element\r\n // because _setHelperLayerPosition uses `element` property\r\n item.targetElement = item.element;\r\n item.element = hint;\r\n\r\n // align the hint position\r\n _alignHintPosition.call(this, item.hintPosition, hint, item.targetElement);\r\n\r\n hintsWrapper.appendChild(hint);\r\n }\r\n\r\n // adding the hints wrapper\r\n document.body.appendChild(hintsWrapper);\r\n\r\n // call the callback function (if any)\r\n if (typeof (this._hintsAddedCallback) !== 'undefined') {\r\n this._hintsAddedCallback.call(this);\r\n }\r\n }\r\n\r\n /**\r\n * Aligns hint position\r\n *\r\n * @api private\r\n * @method _alignHintPosition\r\n * @param {String} position\r\n * @param {Object} hint\r\n * @param {Object} element\r\n */\r\n function _alignHintPosition(position, hint, element) {\r\n // get/calculate offset of target element\r\n var offset = _getOffset.call(this, element);\r\n var iconWidth = 20;\r\n var iconHeight = 20;\r\n\r\n // align the hint element\r\n switch (position) {\r\n default:\r\n case 'top-left':\r\n hint.style.left = offset.left + 'px';\r\n hint.style.top = offset.top + 'px';\r\n break;\r\n case 'top-right':\r\n hint.style.left = (offset.left + offset.width - iconWidth) + 'px';\r\n hint.style.top = offset.top + 'px';\r\n break;\r\n case 'bottom-left':\r\n hint.style.left = offset.left + 'px';\r\n hint.style.top = (offset.top + offset.height - iconHeight) + 'px';\r\n break;\r\n case 'bottom-right':\r\n hint.style.left = (offset.left + offset.width - iconWidth) + 'px';\r\n hint.style.top = (offset.top + offset.height - iconHeight) + 'px';\r\n break;\r\n case 'middle-left':\r\n hint.style.left = offset.left + 'px';\r\n hint.style.top = (offset.top + (offset.height - iconHeight) / 2) + 'px';\r\n break;\r\n case 'middle-right':\r\n hint.style.left = (offset.left + offset.width - iconWidth) + 'px';\r\n hint.style.top = (offset.top + (offset.height - iconHeight) / 2) + 'px';\r\n break;\r\n case 'middle-middle':\r\n hint.style.left = (offset.left + (offset.width - iconWidth) / 2) + 'px';\r\n hint.style.top = (offset.top + (offset.height - iconHeight) / 2) + 'px';\r\n break;\r\n case 'bottom-middle':\r\n hint.style.left = (offset.left + (offset.width - iconWidth) / 2) + 'px';\r\n hint.style.top = (offset.top + offset.height - iconHeight) + 'px';\r\n break;\r\n case 'top-middle':\r\n hint.style.left = (offset.left + (offset.width - iconWidth) / 2) + 'px';\r\n hint.style.top = offset.top + 'px';\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Triggers when user clicks on the hint element\r\n *\r\n * @api private\r\n * @method _showHintDialog\r\n * @param {Number} stepId\r\n */\r\n function _showHintDialog(stepId) {\r\n var hintElement = document.querySelector('.introjs-hint[data-step=\"' + stepId + '\"]');\r\n var item = this._introItems[stepId];\r\n\r\n // call the callback function (if any)\r\n if (typeof (this._hintClickCallback) !== 'undefined') {\r\n this._hintClickCallback.call(this, hintElement, item, stepId);\r\n }\r\n\r\n // remove all open tooltips\r\n var removedStep = _removeHintTooltip.call(this);\r\n\r\n // to toggle the tooltip\r\n if (parseInt(removedStep, 10) == stepId) {\r\n return;\r\n }\r\n\r\n var tooltipLayer = document.createElement('div');\r\n var tooltipTextLayer = document.createElement('div');\r\n var arrowLayer = document.createElement('div');\r\n var referenceLayer = document.createElement('div');\r\n\r\n tooltipLayer.className = 'introjs-tooltip';\r\n\r\n tooltipLayer.onclick = function (e) {\r\n //IE9 & Other Browsers\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n //IE8 and Lower\r\n else {\r\n e.cancelBubble = true;\r\n }\r\n };\r\n\r\n tooltipTextLayer.className = 'introjs-tooltiptext';\r\n\r\n var tooltipWrapper = document.createElement('p');\r\n tooltipWrapper.innerHTML = item.hint;\r\n\r\n var closeButton = document.createElement('a');\r\n closeButton.className = 'introjs-button';\r\n closeButton.innerHTML = this._options.hintButtonLabel;\r\n closeButton.onclick = _hideHint.bind(this, stepId);\r\n\r\n tooltipTextLayer.appendChild(tooltipWrapper);\r\n tooltipTextLayer.appendChild(closeButton);\r\n\r\n arrowLayer.className = 'introjs-arrow';\r\n tooltipLayer.appendChild(arrowLayer);\r\n\r\n tooltipLayer.appendChild(tooltipTextLayer);\r\n\r\n // set current step for _placeTooltip function\r\n this._currentStep = hintElement.getAttribute('data-step');\r\n\r\n // align reference layer position\r\n referenceLayer.className = 'introjs-tooltipReferenceLayer introjs-hintReference';\r\n referenceLayer.setAttribute('data-step', hintElement.getAttribute('data-step'));\r\n _setHelperLayerPosition.call(this, referenceLayer);\r\n\r\n referenceLayer.appendChild(tooltipLayer);\r\n document.body.appendChild(referenceLayer);\r\n\r\n //set proper position\r\n _placeTooltip.call(this, hintElement, tooltipLayer, arrowLayer, null, true);\r\n }\r\n\r\n /**\r\n * Get an element position on the page\r\n * Thanks to `meouw`: http://stackoverflow.com/a/442474/375966\r\n *\r\n * @api private\r\n * @method _getOffset\r\n * @param {Object} element\r\n * @returns Element's position info\r\n */\r\n function _getOffset(element) {\r\n var elementPosition = {};\r\n\r\n var body = document.body;\r\n var docEl = document.documentElement;\r\n\r\n var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;\r\n var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;\r\n\r\n if (element instanceof SVGElement) {\r\n var x = element.getBoundingClientRect()\r\n elementPosition.top = x.top + scrollTop;\r\n elementPosition.width = x.width;\r\n elementPosition.height = x.height;\r\n elementPosition.left = x.left + scrollLeft;\r\n } else {\r\n //set width\r\n elementPosition.width = element.offsetWidth;\r\n\r\n //set height\r\n elementPosition.height = element.offsetHeight;\r\n\r\n //calculate element top and left\r\n var _x = 0;\r\n var _y = 0;\r\n while (element && !isNaN(element.offsetLeft) && !isNaN(element.offsetTop)) {\r\n _x += element.offsetLeft;\r\n _y += element.offsetTop;\r\n element = element.offsetParent;\r\n }\r\n //set top\r\n elementPosition.top = _y;\r\n //set left\r\n elementPosition.left = _x;\r\n }\r\n\r\n return elementPosition;\r\n }\r\n\r\n /**\r\n * Gets the current progress percentage\r\n *\r\n * @api private\r\n * @method _getProgress\r\n * @returns current progress percentage\r\n */\r\n function _getProgress() {\r\n // Steps are 0 indexed\r\n var currentStep = parseInt((this._currentStep + 1), 10);\r\n return ((currentStep / this._introItems.length) * 100);\r\n }\r\n\r\n /**\r\n * Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1\r\n * via: http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically\r\n *\r\n * @param obj1\r\n * @param obj2\r\n * @returns obj3 a new object based on obj1 and obj2\r\n */\r\n function _mergeOptions(obj1,obj2) {\r\n var obj3 = {};\r\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\r\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\r\n return obj3;\r\n }\r\n\r\n var introJs = function (targetElm) {\r\n if (typeof (targetElm) === 'object') {\r\n //Ok, create a new instance\r\n return new IntroJs(targetElm);\r\n\r\n } else if (typeof (targetElm) === 'string') {\r\n //select the target element with query selector\r\n var targetElement = document.querySelector(targetElm);\r\n\r\n if (targetElement) {\r\n return new IntroJs(targetElement);\r\n } else {\r\n throw new Error('There is no element with given selector.');\r\n }\r\n } else {\r\n return new IntroJs(document.body);\r\n }\r\n };\r\n\r\n /**\r\n * Current IntroJs version\r\n *\r\n * @property version\r\n * @type String\r\n */\r\n introJs.version = VERSION;\r\n\r\n //Prototype\r\n introJs.fn = IntroJs.prototype = {\r\n clone: function () {\r\n return new IntroJs(this);\r\n },\r\n setOption: function(option, value) {\r\n this._options[option] = value;\r\n return this;\r\n },\r\n setOptions: function(options) {\r\n this._options = _mergeOptions(this._options, options);\r\n return this;\r\n },\r\n start: function () {\r\n _introForElement.call(this, this._targetElement);\r\n return this;\r\n },\r\n goToStep: function(step) {\r\n _goToStep.call(this, step);\r\n return this;\r\n },\r\n addStep: function(options) {\r\n if (!this._options.steps) {\r\n this._options.steps = [];\r\n }\r\n\r\n this._options.steps.push(options);\r\n\r\n return this;\r\n },\r\n addSteps: function(steps) {\r\n if (!steps.length) return;\r\n\r\n for(var index = 0; index < steps.length; index++) {\r\n this.addStep(steps[index]);\r\n }\r\n\r\n return this;\r\n },\r\n goToStepNumber: function(step) {\r\n _goToStepNumber.call(this, step);\r\n\r\n return this;\r\n },\r\n nextStep: function() {\r\n _nextStep.call(this);\r\n return this;\r\n },\r\n previousStep: function() {\r\n _previousStep.call(this);\r\n return this;\r\n },\r\n exit: function(force) {\r\n _exitIntro.call(this, this._targetElement, force);\r\n return this;\r\n },\r\n refresh: function() {\r\n _refresh.call(this);\r\n return this;\r\n },\r\n onbeforechange: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._introBeforeChangeCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for onbeforechange was not a function');\r\n }\r\n return this;\r\n },\r\n onchange: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._introChangeCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for onchange was not a function.');\r\n }\r\n return this;\r\n },\r\n onafterchange: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._introAfterChangeCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for onafterchange was not a function');\r\n }\r\n return this;\r\n },\r\n oncomplete: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._introCompleteCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for oncomplete was not a function.');\r\n }\r\n return this;\r\n },\r\n onhintsadded: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._hintsAddedCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for onhintsadded was not a function.');\r\n }\r\n return this;\r\n },\r\n onhintclick: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._hintClickCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for onhintclick was not a function.');\r\n }\r\n return this;\r\n },\r\n onhintclose: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._hintCloseCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for onhintclose was not a function.');\r\n }\r\n return this;\r\n },\r\n onexit: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._introExitCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for onexit was not a function.');\r\n }\r\n return this;\r\n },\r\n onbeforeexit: function(providedCallback) {\r\n if (typeof (providedCallback) === 'function') {\r\n this._introBeforeExitCallback = providedCallback;\r\n } else {\r\n throw new Error('Provided callback for onbeforeexit was not a function.');\r\n }\r\n return this;\r\n },\r\n addHints: function() {\r\n _populateHints.call(this, this._targetElement);\r\n return this;\r\n },\r\n hideHint: function (stepId) {\r\n _hideHint.call(this, stepId);\r\n return this;\r\n },\r\n hideHints: function () {\r\n _hideHints.call(this);\r\n return this;\r\n },\r\n showHint: function (stepId) {\r\n _showHint.call(this, stepId);\r\n return this;\r\n },\r\n showHints: function () {\r\n _showHints.call(this);\r\n return this;\r\n },\r\n removeHints: function () {\r\n _removeHints.call(this);\r\n return this;\r\n },\r\n removeHint: function (stepId) {\r\n _removeHint.call(this, stepId);\r\n return this;\r\n },\r\n showHintDialog: function (stepId) {\r\n _showHintDialog.call(this, stepId);\r\n return this;\r\n }\r\n };\r\n\r\n exports.introJs = introJs;\r\n return introJs;\r\n}));\r\n", "/*! modernizr 3.5.0 (Custom Build) | MIT *\r\n * https://modernizr.com/download/?-cssanimations-csspositionsticky-prefixed-setclasses !*/\r\n!function(e,n,t){function r(e,n){return typeof e===n}function o(){var e,n,t,o,i,s,a;for(var l in _)if(_.hasOwnProperty(l)){if(e=[],n=_[l],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;tp;p++)if(m=e[p],y=k.style[m],l(m,\"-\")&&(m=s(m)),k.style[m]!==t){if(i||r(o,\"undefined\"))return f(),\"pfx\"==n?m:!0;try{k.style[m]=o}catch(h){}if(k.style[m]!=y)return f(),\"pfx\"==n?m:!0}return f(),!1}function g(e,n,t,o,i){var s=e.charAt(0).toUpperCase()+e.slice(1),a=(e+\" \"+z.join(s+\" \")+s).split(\" \");return r(n,\"string\")||r(n,\"undefined\")?y(a,n,o,i):(a=(e+\" \"+N.join(s+\" \")+s).split(\" \"),u(a,n,t))}function h(e,n,r){return g(e,t,t,n,r)}var C=[],_=[],x={_version:\"3.5.0\",_config:{classPrefix:\"\",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var t=this;setTimeout(function(){n(t[e])},0)},addTest:function(e,n,t){_.push({name:e,fn:n,options:t})},addAsyncTest:function(e){_.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=x,Modernizr=new Modernizr;var S=n.documentElement,w=\"svg\"===S.nodeName.toLowerCase(),b=x._config.usePrefixes?\" -webkit- -moz- -o- -ms- \".split(\" \"):[\"\",\"\"];x._prefixes=b,Modernizr.addTest(\"csspositionsticky\",function(){var e=\"position:\",n=\"sticky\",t=a(\"a\"),r=t.style;return r.cssText=e+b.join(n+\";\"+e).slice(0,-e.length),-1!==r.position.indexOf(n)});var P=\"Moz O ms Webkit\",z=x._config.usePrefixes?P.split(\" \"):[];x._cssomPrefixes=z;var E=function(n){var r,o=b.length,i=e.CSSRule;if(\"undefined\"==typeof i)return t;if(!n)return!1;if(n=n.replace(/^@/,\"\"),r=n.replace(/-/g,\"_\").toUpperCase()+\"_RULE\",r in i)return\"@\"+n;for(var s=0;o>s;s++){var a=b[s],l=a.toUpperCase()+\"_\"+r;if(l in i)return\"@-\"+a.toLowerCase()+\"-\"+n}return!1};x.atRule=E;var N=x._config.usePrefixes?P.toLowerCase().split(\" \"):[];x._domPrefixes=N;var T={elem:a(\"modernizr\")};Modernizr._q.push(function(){delete T.elem});var k={style:T.elem.style};Modernizr._q.unshift(function(){delete k.style}),x.testAllProps=g;x.prefixed=function(e,n,t){return 0===e.indexOf(\"@\")?E(e):(-1!=e.indexOf(\"-\")&&(e=s(e)),n?g(e,n,t):g(e,\"pfx\"))};x.testAllProps=h,Modernizr.addTest(\"cssanimations\",h(\"animationName\",\"a\",!0)),o(),i(C),delete x.addTest,delete x.addAsyncTest;for(var j=0;j 1024){\r\n\t\t\tvar $ele = $('[data-onload]').eq(0)\r\n\t\t\t , sessionItemName = (typeof $ele.attr('data-session-item-name') !== 'undefined') ? $ele.attr('data-session-item-name') : 'seenSidebarTour'\r\n\t\t\t , position = (typeof $ele.attr('data-position') !== 'undefined') ? $ele.attr('data-position') : 'left'\r\n\t\t\t , cssClass = (typeof $ele.attr('data-tooltip-class') !== 'undefined') ? $ele.attr('data-tooltip-class') : 'introjs-tooltip--right introjs-tooltip--quickbook-sidebar'\r\n\r\n\t\t\tif(!sessionStorage.getItem(sessionItemName)){\r\n\t\t\t\t_self.intro.setOption('tooltipPosition', position);\r\n\t\t\t\t_self.intro.setOption('scrollToElement', false);\r\n\t\t\t\t_self.intro.setOption('tooltipClass', cssClass);\r\n\t\t\t\t_self.intro.start();\r\n\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t$(window).on('scroll', function(){\r\n\t\t\t\t\t\tif(_self.intro !== null){\r\n\t\t\t\t\t\t\tsessionStorage.setItem(sessionItemName, true);\r\n\t\t\t\t\t\t\t_self.intro.nextStep();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}, 200);\r\n\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(_self.intro !== null){\r\n\t\t\t\t\t\tsessionStorage.setItem(sessionItemName, true);\r\n\t\t\t\t\t\t_self.intro.nextStep();\r\n\t\t\t\t\t}\r\n\t\t\t\t}, 8000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t_self.intro.onbeforeexit(function() {\r\n\t\t\t$('.group--tour-dummy').removeClass('group--tour-dummy');\r\n\t\t\t_self.intro = null;\r\n\t\t});\r\n\r\n\t\t_self.intro.onbeforechange(function(targetElement) {\r\n\t\t\tvar $ele = $(targetElement);\r\n\r\n\t\t\tif(typeof $ele.attr('data-intro') === 'undefined' || !$ele.attr('data-intro').length) {\r\n\t\t\t\t$('.introjs-tooltipReferenceLayer').addClass('force-hidden-tooltip');\r\n\t\t\t} else {\r\n\t\t\t\t$('.introjs-tooltipReferenceLayer').removeClass('force-hidden-tooltip');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t_self.intro.onchange(function(targetElement) {\r\n\t\t\tvar $ele = $(targetElement);\r\n\r\n\t\t\tif(!$ele.find('.datepicker-wrapper').length) {\r\n\t\t\t\t$ele.find('.group__dummy').click();\r\n\t\t\t\t$ele.find('.group__trigger').addClass('active');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t_self.intro.onafterchange(function(targetElement) {\r\n\t\t\tvar $ele = $(targetElement);\r\n\r\n\t\t\tif($ele.find('.datepicker-wrapper').length) {\r\n\t\t\t\t$('.introjs-tooltipReferenceLayer').addClass('introjs--hidden');\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$('.results-header select').on('chosen:showing_dropdown', function() {\r\n\t\t\t$('.introjs-tooltipReferenceLayer').addClass('introjs--hidden');\r\n\t\t}).on('chosen:hiding_dropdown', function() {\r\n\t\t\t$('.introjs-tooltipReferenceLayer').removeClass('introjs--hidden');\r\n\t\t});\r\n\t},\r\n\r\n\ttoggleIntroOverlay: function(nextStep) {\r\n\t\t'use strict';\r\n\r\n\t\tvar _self = this;\r\n\r\n\t\tif(typeof nextStep === 'undefined') {\r\n\t\t\tnextStep = false;\r\n\t\t}\r\n\r\n\t\t$('.introjs-tooltipReferenceLayer').toggleClass('introjs--hidden');\r\n\r\n\t\tif(nextStep) {\r\n\t\t\tif(window.snowdome.tour.intro !== null) {\r\n\t\t\t\t_self.intro.nextStep();\r\n\t\t\t\t$('.group--tour-dummy').removeClass('group--tour-dummy');\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};", "/* globals module, require */\r\n\r\nvar Pikaday = require('pikaday'),\r\n\tmoment = require('moment'),\r\n\t$otherAmount,\r\n\tselectedAmount,\r\n\t$cart;\r\n\r\nmodule.exports = {\r\n\tinit: function() {\r\n\t\t'use strict';\r\n\r\n\t\t$cart = $('.minicart');\r\n\t\t$otherAmount = $('#other-amount');\r\n\r\n\t\tvar _self = this,\r\n\t\t\tdeliveryDate = document.querySelector('[data-delivery-date]'),\r\n\t\t\tdeliveryDateInput = document.querySelector('[data-delivery-date-input]'),\r\n\r\n\t\t\tpicker = new Pikaday({\r\n\t\t\t\tfield: deliveryDate,\r\n\t\t\t\tcontainer: deliveryDate.nextElementSibling,\r\n\t\t\t\tminDate: new Date(),\r\n\t\t\t\ti18n: window.snowdome.pikadayi18n,\r\n\t\t\t\tformat: 'dddd Do MMMM',\r\n\t\t\t\tonSelect: function(date) {\r\n\t\t\t\t\tdeliveryDateInput.value = moment(date).format('YYYY-MM-DD');\r\n\t\t\t\t\t$(picker.el).addClass('completed');\r\n\t\t\t\t\t_self.checkSidebar();\r\n\t\t\t\t},\r\n\t\t\t\tonOpen: function() {\r\n\t\t\t\t\t$(picker.el).closest('.form__group').toggleClass('datepicker--open');\r\n\t\t\t\t},\r\n\t\t\t\tonClose: function() {\r\n\t\t\t\t\t$(picker.el).closest('.form__group').toggleClass('datepicker--open');\r\n\t\t\t\t},\r\n\t\t\t});\r\n\r\n\t\t$('[data-amount]').on('change', function() {\r\n\t\t\tif(this.checked) {\r\n\t\t\t\tselectedAmount = this;\r\n\t\t\t}\r\n\r\n\t\t\t_self.checkSidebar();\r\n\t\t});\r\n\r\n\t\t$('#voucher-info [name]').on('keyup', function() {\r\n\r\n\t\t\t_self.checkSidebar();\r\n\t\t});\r\n\t},\r\n\r\n\tcheckSidebar: function() {\r\n\t\t'use strict';\r\n\r\n\t\tvar _self = this\r\n\t\t , info = ''\r\n\t\t ,\textra = 0;\r\n\r\n\t\t$cart.find('.product--extra').remove();\r\n\r\n\t\tif(selectedAmount) {\r\n\t\t\t$cart.find('.product__name').text('Gift Voucher');\t\t\t\r\n\r\n\t\t\tif($('[name=\"amount\"]:checked').val() === 'other') {\r\n\t\t\t\t_self.enableOtherAmount();\r\n\t\t\t} else {\r\n\t\t\t\t_self.disableOtherAmount();\r\n\t\t\t}\r\n\r\n\t\t\t$('#voucher-info [name]').each(function(index, el) {\r\n\t\t\t\tvar $el = $(el);\r\n\r\n\t\t\t\tinfo += '
    ' + $el.prev('label').text() + '
    ';\r\n\t\t\t\tinfo += '
    ';\r\n\t\t\t\t\tinfo += (el.hasAttribute('data-delivery-date-input')) ? $el.next().val() : $el.val();\r\n\t\t\t\tinfo += '
    ';\r\n\t\t\t});\r\n\r\n\t\t\t$cart.find('dl').html(info);\r\n\r\n\t\t\tif(typeof $cart.attr('data-offer') !== 'undefined' && $cart.attr('data-offer') === 'yes'){\r\n\t\t\t\tvar amount = parseFloat(selectedAmount.value);\r\n\t\t\t\tif(!isNaN(amount) && amount >= 50) {\r\n\t\t\t\t\textra = this.checkDiscountBand(amount);\r\n\t\t\t\t\t$cart.find('.minicart__products').append('\\\r\n\t\t\t\t\t\t
  • \\\r\n\t\t\t\t\t\t\t

    Gift Voucher Offer

    \\\r\n\t\t\t\t\t\t\t -£' + extra.toFixed(2) + '\\\r\n\t\t\t\t\t\t\t

    Happy Holidays!

    \\\r\n\t\t\t\t\t\t
  • \\\r\n\t\t\t\t\t');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar price = parseFloat(selectedAmount.value);\r\n\r\n\t\t\tif(!isNaN(price)) {\r\n\t\t\t\t$cart.find('.product:not(.product--extra) .product__price').text('£' + Math.max(5, Math.min(1000, price + extra)).toFixed(2));\r\n\t\t\t\t$cart.find('h1').text('£' + Math.max(5, Math.min(1000, price)).toFixed(2));\r\n\t\t\t} else {\r\n\t\t\t\t$cart.find('h1, .product:not(.product--extra) .product__price').empty();\r\n\t\t\t}\r\n\r\n\t\t\t$cart.show();\r\n\t\t} else {\r\n\t\t\t$cart.hide();\r\n\t\t}\r\n\t},\r\n\r\n\tcheckDiscountBand: function(amount) {\r\n\t\tvar discount = 0;\r\n\t\tif(!isNaN(amount) && amount >= 50) {\r\n\t\t\tif(amount >= 50 && amount < 100){\r\n\t\t\t\tdiscount = 5.00;\r\n\t\t\t} else if(amount >= 100 && amount < 150){\r\n\t\t\t\tdiscount = 10.00;\r\n\t\t\t} else if(amount >= 150 && amount < 200){\r\n\t\t\t\tdiscount = 15.00;\r\n\t\t\t} else if(amount >= 200 && amount < 250){\r\n\t\t\t\tdiscount = 20.00;\r\n\t\t\t} else if(amount >= 250 && amount < 300){\r\n\t\t\t\tdiscount = 25.00;\r\n\t\t\t} else if(amount >= 300 && amount < 350){\r\n\t\t\t\tdiscount = 30.00;\r\n\t\t\t} else if(amount >= 350 && amount < 400){\r\n\t\t\t\tdiscount = 35.00;\r\n\t\t\t} else if(amount >= 400 && amount < 450){\r\n\t\t\t\tdiscount = 40.00;\r\n\t\t\t} else if(amount >= 450 && amount < 500){\r\n\t\t\t\tdiscount = 45.00;\r\n\t\t\t} else if(amount >= 500 && amount < 550){\r\n\t\t\t\tdiscount = 50.00;\r\n\t\t\t} else if(amount >= 550 && amount < 600){\r\n\t\t\t\tdiscount = 55.00;\r\n\t\t\t} else if(amount >= 600 && amount < 650){\r\n\t\t\t\tdiscount = 60.00;\r\n\t\t\t} else if(amount >= 650 && amount < 700){\r\n\t\t\t\tdiscount = 65.00;\r\n\t\t\t} else if(amount >= 700 && amount < 750){\r\n\t\t\t\tdiscount = 70.00;\r\n\t\t\t} else if(amount >= 750 && amount < 800){\r\n\t\t\t\tdiscount = 75.00;\r\n\t\t\t} else if(amount >= 800){\r\n\t\t\t\tdiscount = 80.00;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn discount;\r\n\t},\r\n\r\n\tenableOtherAmount: function() {\r\n\t\t'use strict';\r\n\t\tvar _self = this;\r\n\r\n\t\t$otherAmount.css('display', ($(window).width() > 1025) ? 'inline-block' : 'block');\r\n\r\n\t\t$('[data-custom-amount]').off('keyup');\r\n\t\t$('[data-custom-amount]').on('keyup', function() {\r\n\r\n\t\t\tif(this.value.length) {\r\n\t\t\t\tselectedAmount = this;\r\n\t\t\t}\r\n\r\n\t\t\t_self.checkSidebar();\r\n\t\t});\r\n\t},\r\n\r\n\tdisableOtherAmount: function() {\r\n\t\t'use strict';\r\n\r\n\t\t$cart.find('h1, .product__price').text('£' + parseFloat(selectedAmount.value).toFixed(2));\r\n\t\t$('[data-custom-amount]').off('keyup');\r\n\t\t$otherAmount.hide();\r\n\t},\r\n};\r\n", "//! moment.js\n//! version : 2.18.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n}(this, (function () { 'use strict';\n\nvar hookCallback;\n\nfunction hooks () {\n return hookCallback.apply(null, arguments);\n}\n\n// This is done to register the method called with moment()\n// without creating circular dependencies.\nfunction setHookCallback (callback) {\n hookCallback = callback;\n}\n\nfunction isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n}\n\nfunction isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n}\n\nfunction isObjectEmpty(obj) {\n var k;\n for (k in obj) {\n // even if its not own property I'd still call it non-empty\n return false;\n }\n return true;\n}\n\nfunction isUndefined(input) {\n return input === void 0;\n}\n\nfunction isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n}\n\nfunction isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n}\n\nfunction map(arr, fn) {\n var res = [], i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n}\n\nfunction hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n}\n\nfunction extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n}\n\nfunction createUTC (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n}\n\nfunction defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty : false,\n unusedTokens : [],\n unusedInput : [],\n overflow : -2,\n charsLeftOver : 0,\n nullInput : false,\n invalidMonth : null,\n invalidFormat : false,\n userInvalidated : false,\n iso : false,\n parsedDateParts : [],\n meridiem : null,\n rfc2822 : false,\n weekdayMismatch : false\n };\n}\n\nfunction getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n}\n\nvar some;\nif (Array.prototype.some) {\n some = Array.prototype.some;\n} else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n}\n\nvar some$1 = some;\n\nfunction isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some$1.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n var isNowValid = !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid = isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n }\n else {\n return isNowValid;\n }\n }\n return m._isValid;\n}\n\nfunction createInvalid (flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n }\n else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n}\n\n// Plugins that add properties should also add the key here (null value),\n// so we can properly clone ourselves.\nvar momentProperties = hooks.momentProperties = [];\n\nfunction copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n}\n\nvar updateInProgress = false;\n\n// Moment prototype object\nfunction Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n}\n\nfunction isMoment (obj) {\n return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);\n}\n\nfunction absFloor (number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n}\n\nfunction toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n}\n\n// compare two arrays, return the number of differences\nfunction compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n}\n\nfunction warn(msg) {\n if (hooks.suppressDeprecationWarnings === false &&\n (typeof console !== 'undefined') && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n}\n\nfunction deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [];\n var arg;\n for (var i = 0; i < arguments.length; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (var key in arguments[0]) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + (new Error()).stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n}\n\nvar deprecations = {};\n\nfunction deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n}\n\nhooks.suppressDeprecationWarnings = false;\nhooks.deprecationHandler = null;\n\nfunction isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n}\n\nfunction set (config) {\n var prop, i;\n for (i in config) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' + (/\\d{1,2}/).source);\n}\n\nfunction mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig), prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n}\n\nfunction Locale(config) {\n if (config != null) {\n this.set(config);\n }\n}\n\nvar keys;\n\nif (Object.keys) {\n keys = Object.keys;\n} else {\n keys = function (obj) {\n var i, res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n}\n\nvar keys$1 = keys;\n\nvar defaultCalendar = {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n};\n\nfunction calendar (key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n}\n\nvar defaultLongDateFormat = {\n LTS : 'h:mm:ss A',\n LT : 'h:mm A',\n L : 'MM/DD/YYYY',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY h:mm A',\n LLLL : 'dddd, MMMM D, YYYY h:mm A'\n};\n\nfunction longDateFormat (key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n}\n\nvar defaultInvalidDate = 'Invalid date';\n\nfunction invalidDate () {\n return this._invalidDate;\n}\n\nvar defaultOrdinal = '%d';\nvar defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\nfunction ordinal (number) {\n return this._ordinal.replace('%d', number);\n}\n\nvar defaultRelativeTime = {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n ss : '%d seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n};\n\nfunction relativeTime (number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return (isFunction(output)) ?\n output(number, withoutSuffix, string, isFuture) :\n output.replace(/%d/i, number);\n}\n\nfunction pastFuture (diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n}\n\nvar aliases = {};\n\nfunction addUnitAlias (unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n}\n\nfunction normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n}\n\nfunction normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n}\n\nvar priorities = {};\n\nfunction addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n}\n\nfunction getPrioritizedUnits(unitsObj) {\n var units = [];\n for (var u in unitsObj) {\n units.push({unit: u, priority: priorities[u]});\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n}\n\nfunction makeGetSet (unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n}\n\nfunction get (mom, unit) {\n return mom.isValid() ?\n mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;\n}\n\nfunction set$1 (mom, unit, value) {\n if (mom.isValid()) {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n}\n\n// MOMENTS\n\nfunction stringGet (units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n}\n\n\nfunction stringSet (units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units);\n for (var i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n}\n\nfunction zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n}\n\nvar formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;\n\nvar localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\nvar formatFunctions = {};\n\nvar formatTokenFunctions = {};\n\n// token: 'M'\n// padded: ['MM', 2]\n// ordinal: 'Mo'\n// callback: function () { this.month() + 1 }\nfunction addFormatToken (token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n}\n\nfunction removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n}\n\nfunction makeFormatFunction(format) {\n var array = format.match(formattingTokens), i, length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '', i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n}\n\n// format date using native date object\nfunction formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n}\n\nfunction expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n}\n\nvar match1 = /\\d/; // 0 - 9\nvar match2 = /\\d\\d/; // 00 - 99\nvar match3 = /\\d{3}/; // 000 - 999\nvar match4 = /\\d{4}/; // 0000 - 9999\nvar match6 = /[+-]?\\d{6}/; // -999999 - 999999\nvar match1to2 = /\\d\\d?/; // 0 - 99\nvar match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\nvar match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\nvar match1to3 = /\\d{1,3}/; // 0 - 999\nvar match1to4 = /\\d{1,4}/; // 0 - 9999\nvar match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\nvar matchUnsigned = /\\d+/; // 0 - inf\nvar matchSigned = /[+-]?\\d+/; // -inf - inf\n\nvar matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\nvar matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\nvar matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n// any word (or two) characters or numbers including two/three word month in arabic.\n// includes scottish gaelic two word and hyphenated months\nvar matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\n\nvar regexes = {};\n\nfunction addRegexToken (token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return (isStrict && strictRegex) ? strictRegex : regex;\n };\n}\n\nfunction getParseRegexForToken (token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n}\n\n// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\nfunction unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n}\n\nfunction regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n}\n\nvar tokens = {};\n\nfunction addParseToken (token, callback) {\n var i, func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n}\n\nfunction addWeekParseToken (token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n}\n\nfunction addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n}\n\nvar YEAR = 0;\nvar MONTH = 1;\nvar DATE = 2;\nvar HOUR = 3;\nvar MINUTE = 4;\nvar SECOND = 5;\nvar MILLISECOND = 6;\nvar WEEK = 7;\nvar WEEKDAY = 8;\n\nvar indexOf;\n\nif (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n} else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n}\n\nvar indexOf$1 = indexOf;\n\nfunction daysInMonth(year, month) {\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n}\n\n// FORMATTING\n\naddFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n});\n\naddFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n});\n\naddFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n});\n\n// ALIASES\n\naddUnitAlias('month', 'M');\n\n// PRIORITY\n\naddUnitPriority('month', 8);\n\n// PARSING\n\naddRegexToken('M', match1to2);\naddRegexToken('MM', match1to2, match2);\naddRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n});\naddRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n});\n\naddParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n});\n\naddParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n});\n\n// LOCALES\n\nvar MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/;\nvar defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\nfunction localeMonths (m, format) {\n if (!m) {\n return isArray(this._months) ? this._months :\n this._months['standalone'];\n }\n return isArray(this._months) ? this._months[m.month()] :\n this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n}\n\nvar defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\nfunction localeMonthsShort (m, format) {\n if (!m) {\n return isArray(this._monthsShort) ? this._monthsShort :\n this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] :\n this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n}\n\nfunction handleStrictParse(monthName, format, strict) {\n var i, ii, mom, llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n}\n\nfunction localeMonthsParse (monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n}\n\n// MOMENTS\n\nfunction setMonth (mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n}\n\nfunction getSetMonth (value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n}\n\nfunction getDaysInMonth () {\n return daysInMonth(this.year(), this.month());\n}\n\nvar defaultMonthsShortRegex = matchWord;\nfunction monthsShortRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict ?\n this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n}\n\nvar defaultMonthsRegex = matchWord;\nfunction monthsRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict ?\n this._monthsStrictRegex : this._monthsRegex;\n }\n}\n\nfunction computeMonthsParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n}\n\n// FORMATTING\n\naddFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? '' + y : '+' + y;\n});\n\naddFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n});\n\naddFormatToken(0, ['YYYY', 4], 0, 'year');\naddFormatToken(0, ['YYYYY', 5], 0, 'year');\naddFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n// ALIASES\n\naddUnitAlias('year', 'y');\n\n// PRIORITIES\n\naddUnitPriority('year', 1);\n\n// PARSING\n\naddRegexToken('Y', matchSigned);\naddRegexToken('YY', match1to2, match2);\naddRegexToken('YYYY', match1to4, match4);\naddRegexToken('YYYYY', match1to6, match6);\naddRegexToken('YYYYYY', match1to6, match6);\n\naddParseToken(['YYYYY', 'YYYYYY'], YEAR);\naddParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n});\naddParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n});\naddParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n});\n\n// HELPERS\n\nfunction daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nfunction isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n}\n\n// HOOKS\n\nhooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n};\n\n// MOMENTS\n\nvar getSetYear = makeGetSet('FullYear', true);\n\nfunction getIsLeapYear () {\n return isLeapYear(this.year());\n}\n\nfunction createDate (y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date = new Date(y, m, d, h, M, s, ms);\n\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n return date;\n}\n\nfunction createUTCDate (y) {\n var date = new Date(Date.UTC.apply(null, arguments));\n\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n return date;\n}\n\n// start-of-first-week - start-of-year\nfunction firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n}\n\n// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\nfunction dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear, resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n}\n\nfunction weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek, resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n}\n\nfunction weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n}\n\n// FORMATTING\n\naddFormatToken('w', ['ww', 2], 'wo', 'week');\naddFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n// ALIASES\n\naddUnitAlias('week', 'w');\naddUnitAlias('isoWeek', 'W');\n\n// PRIORITIES\n\naddUnitPriority('week', 5);\naddUnitPriority('isoWeek', 5);\n\n// PARSING\n\naddRegexToken('w', match1to2);\naddRegexToken('ww', match1to2, match2);\naddRegexToken('W', match1to2);\naddRegexToken('WW', match1to2, match2);\n\naddWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n});\n\n// HELPERS\n\n// LOCALES\n\nfunction localeWeek (mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n}\n\nvar defaultLocaleWeek = {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n};\n\nfunction localeFirstDayOfWeek () {\n return this._week.dow;\n}\n\nfunction localeFirstDayOfYear () {\n return this._week.doy;\n}\n\n// MOMENTS\n\nfunction getSetWeek (input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n}\n\nfunction getSetISOWeek (input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n}\n\n// FORMATTING\n\naddFormatToken('d', 0, 'do', 'day');\n\naddFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n});\n\naddFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n});\n\naddFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n});\n\naddFormatToken('e', 0, 0, 'weekday');\naddFormatToken('E', 0, 0, 'isoWeekday');\n\n// ALIASES\n\naddUnitAlias('day', 'd');\naddUnitAlias('weekday', 'e');\naddUnitAlias('isoWeekday', 'E');\n\n// PRIORITY\naddUnitPriority('day', 11);\naddUnitPriority('weekday', 11);\naddUnitPriority('isoWeekday', 11);\n\n// PARSING\n\naddRegexToken('d', match1to2);\naddRegexToken('e', match1to2);\naddRegexToken('E', match1to2);\naddRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n});\naddRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n});\naddRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n});\n\naddWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n});\n\naddWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n});\n\n// HELPERS\n\nfunction parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n}\n\nfunction parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n}\n\n// LOCALES\n\nvar defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\nfunction localeWeekdays (m, format) {\n if (!m) {\n return isArray(this._weekdays) ? this._weekdays :\n this._weekdays['standalone'];\n }\n return isArray(this._weekdays) ? this._weekdays[m.day()] :\n this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];\n}\n\nvar defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\nfunction localeWeekdaysShort (m) {\n return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n}\n\nvar defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\nfunction localeWeekdaysMin (m) {\n return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n}\n\nfunction handleStrictParse$1(weekdayName, format, strict) {\n var i, ii, mom, llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf$1.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n}\n\nfunction localeWeekdaysParse (weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n}\n\n// MOMENTS\n\nfunction getSetDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n}\n\nfunction getSetLocaleDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n}\n\nfunction getSetISODayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n}\n\nvar defaultWeekdaysRegex = matchWord;\nfunction weekdaysRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict ?\n this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n}\n\nvar defaultWeekdaysShortRegex = matchWord;\nfunction weekdaysShortRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict ?\n this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n}\n\nvar defaultWeekdaysMinRegex = matchWord;\nfunction weekdaysMinRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict ?\n this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n}\n\n\nfunction computeWeekdaysParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom, minp, shortp, longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = this.weekdaysMin(mom, '');\n shortp = this.weekdaysShort(mom, '');\n longp = this.weekdays(mom, '');\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n}\n\n// FORMATTING\n\nfunction hFormat() {\n return this.hours() % 12 || 12;\n}\n\nfunction kFormat() {\n return this.hours() || 24;\n}\n\naddFormatToken('H', ['HH', 2], 0, 'hour');\naddFormatToken('h', ['hh', 2], 0, hFormat);\naddFormatToken('k', ['kk', 2], 0, kFormat);\n\naddFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n});\n\naddFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n});\n\naddFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n});\n\naddFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n});\n\nfunction meridiem (token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n}\n\nmeridiem('a', true);\nmeridiem('A', false);\n\n// ALIASES\n\naddUnitAlias('hour', 'h');\n\n// PRIORITY\naddUnitPriority('hour', 13);\n\n// PARSING\n\nfunction matchMeridiem (isStrict, locale) {\n return locale._meridiemParse;\n}\n\naddRegexToken('a', matchMeridiem);\naddRegexToken('A', matchMeridiem);\naddRegexToken('H', match1to2);\naddRegexToken('h', match1to2);\naddRegexToken('k', match1to2);\naddRegexToken('HH', match1to2, match2);\naddRegexToken('hh', match1to2, match2);\naddRegexToken('kk', match1to2, match2);\n\naddRegexToken('hmm', match3to4);\naddRegexToken('hmmss', match5to6);\naddRegexToken('Hmm', match3to4);\naddRegexToken('Hmmss', match5to6);\n\naddParseToken(['H', 'HH'], HOUR);\naddParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n});\naddParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n});\naddParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n});\naddParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n});\naddParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n});\n\n// LOCALES\n\nfunction localeIsPM (input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return ((input + '').toLowerCase().charAt(0) === 'p');\n}\n\nvar defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\nfunction localeMeridiem (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n}\n\n\n// MOMENTS\n\n// Setting the hour should keep the time, because the user explicitly\n// specified which hour he wants. So trying to maintain the same hour (in\n// a new timezone) makes sense. Adding/subtracting hours does not follow\n// this rule.\nvar getSetHour = makeGetSet('Hours', true);\n\n// months\n// week\n// weekdays\n// meridiem\nvar baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse\n};\n\n// internal storage for locale config files\nvar locales = {};\nvar localeFamilies = {};\nvar globalLocale;\n\nfunction normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n}\n\n// pick the locale from the array\n// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\nfunction chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n}\n\nfunction loadLocale(name) {\n var oldLocale = null;\n // TODO: Find a better way to register and load all the locales in Node\n if (!locales[name] && (typeof module !== 'undefined') &&\n module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n require('./locale/' + name);\n // because defineLocale currently also sets the global locale, we\n // want to undo that for lazy loaded locales\n getSetGlobalLocale(oldLocale);\n } catch (e) { }\n }\n return locales[name];\n}\n\n// This function will load locale and then set the global locale. If\n// no arguments are passed in, it will simply return the current global\n// locale key.\nfunction getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}\n\nfunction defineLocale (name, config) {\n if (config !== null) {\n var parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple('defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n}\n\nfunction updateLocale(name, config) {\n if (config != null) {\n var locale, parentConfig = baseConfig;\n // MERGE\n if (locales[name] != null) {\n parentConfig = locales[name]._config;\n }\n config = mergeConfigs(parentConfig, config);\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n}\n\n// returns locale data\nfunction getLocale (key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n}\n\nfunction listLocales() {\n return keys$1(locales);\n}\n\nfunction checkOverflow (m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :\n a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :\n a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :\n a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n -1;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n}\n\n// iso 8601 regex\n// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\nvar extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\nvar basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n\nvar tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n\nvar isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n // YYYYMM is NOT allowed by the standard\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/]\n];\n\n// iso time formats and regexes\nvar isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/]\n];\n\nvar aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n// date from iso format\nfunction configFromISO(config) {\n var i, l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime, dateFormat, timeFormat, tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n}\n\n// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\nvar basicRfcRegex = /^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d?\\d\\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(?:\\d\\d)?\\d\\d\\s)(\\d\\d:\\d\\d)(\\:\\d\\d)?(\\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\\d{4}))$/;\n\n// date and time from ref 2822 format\nfunction configFromRFC2822(config) {\n var string, match, dayFormat,\n dateFormat, timeFormat, tzFormat;\n var timezones = {\n ' GMT': ' +0000',\n ' EDT': ' -0400',\n ' EST': ' -0500',\n ' CDT': ' -0500',\n ' CST': ' -0600',\n ' MDT': ' -0600',\n ' MST': ' -0700',\n ' PDT': ' -0700',\n ' PST': ' -0800'\n };\n var military = 'YXWVUTSRQPONZABCDEFGHIKLM';\n var timezone, timezoneIndex;\n\n string = config._i\n .replace(/\\([^\\)]*\\)|[\\n\\t]/g, ' ') // Remove comments and folding whitespace\n .replace(/(\\s\\s+)/g, ' ') // Replace multiple-spaces with a single space\n .replace(/^\\s|\\s$/g, ''); // Remove leading and trailing spaces\n match = basicRfcRegex.exec(string);\n\n if (match) {\n dayFormat = match[1] ? 'ddd' + ((match[1].length === 5) ? ', ' : ' ') : '';\n dateFormat = 'D MMM ' + ((match[2].length > 10) ? 'YYYY ' : 'YY ');\n timeFormat = 'HH:mm' + (match[4] ? ':ss' : '');\n\n // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.\n if (match[1]) { // day of week given\n var momentDate = new Date(match[2]);\n var momentDay = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][momentDate.getDay()];\n\n if (match[1].substr(0,3) !== momentDay) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return;\n }\n }\n\n switch (match[5].length) {\n case 2: // military\n if (timezoneIndex === 0) {\n timezone = ' +0000';\n } else {\n timezoneIndex = military.indexOf(match[5][1].toUpperCase()) - 12;\n timezone = ((timezoneIndex < 0) ? ' -' : ' +') +\n (('' + timezoneIndex).replace(/^-?/, '0')).match(/..$/)[0] + '00';\n }\n break;\n case 4: // Zone\n timezone = timezones[match[5]];\n break;\n default: // UT or +/-9999\n timezone = timezones[' GMT'];\n }\n match[5] = timezone;\n config._i = match.splice(1).join('');\n tzFormat = ' ZZ';\n config._f = dayFormat + dateFormat + timeFormat + tzFormat;\n configFromStringAndFormat(config);\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n}\n\n// date from iso format or fallback\nfunction configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n}\n\nhooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged and will be removed in an upcoming major release. Please refer to ' +\n 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n);\n\n// Pick the first defined of two or three arguments.\nfunction defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n}\n\nfunction currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n}\n\n// convert an array to a date.\n// the array should mirror the parameters below\n// note: all values past the year are optional and will default to the lowest possible value.\n// [year, month, day , hour, minute, second, millisecond]\nfunction configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n}\n\nfunction dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n var curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from begining of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to begining of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n}\n\n// constant that refers to the ISO standard\nhooks.ISO_8601 = function () {};\n\n// constant that refers to the RFC 2822 form\nhooks.RFC_2822 = function () {};\n\n// date from string and format string\nfunction configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n}\n\n\nfunction meridiemFixWrap (locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n}\n\n// date from string and array of format strings\nfunction configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n}\n\nfunction configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n\n configFromArray(config);\n}\n\nfunction createFromConfig (config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n}\n\nfunction prepareConfig (config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({nullInput: true});\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n}\n\nfunction configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n}\n\nfunction createLocalOrUTC (input, format, locale, strict, isUTC) {\n var c = {};\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if ((isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n}\n\nfunction createLocal (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n}\n\nvar prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n);\n\nvar prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n);\n\n// Pick a moment m from moments so that m[fn](other) is true for all\n// other. This relies on the function fn to be transitive.\n//\n// moments should either be an array of moment objects or an array, whose\n// first element is an array of moment objects.\nfunction pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n}\n\n// TODO: Use [].sort instead?\nfunction min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n}\n\nfunction max () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n}\n\nvar now = function () {\n return Date.now ? Date.now() : +(new Date());\n};\n\nvar ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\n\nfunction isDurationValid(m) {\n for (var key in m) {\n if (!(ordering.indexOf(key) !== -1 && (m[key] == null || !isNaN(m[key])))) {\n return false;\n }\n }\n\n var unitHasDecimal = false;\n for (var i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n}\n\nfunction isValid$1() {\n return this._isValid;\n}\n\nfunction createInvalid$1() {\n return createDuration(NaN);\n}\n\nfunction Duration (duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days +\n weeks * 7;\n // It is impossible translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months +\n quarters * 3 +\n years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n}\n\nfunction isDuration (obj) {\n return obj instanceof Duration;\n}\n\nfunction absRound (number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n}\n\n// FORMATTING\n\nfunction offset (token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n });\n}\n\noffset('Z', ':');\noffset('ZZ', '');\n\n// PARSING\n\naddRegexToken('Z', matchShortOffset);\naddRegexToken('ZZ', matchShortOffset);\naddParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n});\n\n// HELPERS\n\n// timezone chunker\n// '+10:00' > ['10', '00']\n// '-1530' > ['-15', '30']\nvar chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\nfunction offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher);\n\n if (matches === null) {\n return null;\n }\n\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ?\n 0 :\n parts[0] === '+' ? minutes : -minutes;\n}\n\n// Return a moment from input, that is local/utc/zone equivalent to model.\nfunction cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n}\n\nfunction getDateOffset (m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n}\n\n// HOOKS\n\n// This function will be called whenever a moment is mutated.\n// It is intended to keep the offset in sync with the timezone.\nhooks.updateOffset = function () {};\n\n// MOMENTS\n\n// keepLocalTime = true means only change the timezone, without\n// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n// +0200, so we adjust the time as needed, to be valid.\n//\n// Keeping the time actually adds/subtracts (one hour)\n// from the actual represented time. That is why we call updateOffset\n// a second time. In case it wants us to change the offset again\n// _changeInProgress == true case, then we have to adjust, because\n// there is no such time in the given timezone.\nfunction getSetOffset (input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n}\n\nfunction getSetZone (input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n}\n\nfunction setOffsetToUTC (keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n}\n\nfunction setOffsetToLocal (keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n}\n\nfunction setOffsetToParsedOffset () {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n }\n else {\n this.utcOffset(0, true);\n }\n }\n return this;\n}\n\nfunction hasAlignedHourOffset (input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n}\n\nfunction isDaylightSavingTime () {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n}\n\nfunction isDaylightSavingTimeShifted () {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {};\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() &&\n compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n}\n\nfunction isLocal () {\n return this.isValid() ? !this._isUTC : false;\n}\n\nfunction isUtcOffset () {\n return this.isValid() ? this._isUTC : false;\n}\n\nfunction isUtc () {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n}\n\n// ASP.NET json date format regex\nvar aspNetRegex = /^(\\-)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/;\n\n// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n// and further modified to allow for strings containing both week and day\nvar isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;\n\nfunction createDuration (input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms : input._milliseconds,\n d : input._days,\n M : input._months\n };\n } else if (isNumber(input)) {\n duration = {};\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : 0,\n d : toInt(match[DATE]) * sign,\n h : toInt(match[HOUR]) * sign,\n m : toInt(match[MINUTE]) * sign,\n s : toInt(match[SECOND]) * sign,\n ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n };\n } else if (!!(match = isoRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : parseIso(match[2], sign),\n M : parseIso(match[3], sign),\n w : parseIso(match[4], sign),\n d : parseIso(match[5], sign),\n h : parseIso(match[6], sign),\n m : parseIso(match[7], sign),\n s : parseIso(match[8], sign)\n };\n } else if (duration == null) {// checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n}\n\ncreateDuration.fn = Duration.prototype;\ncreateDuration.invalid = createInvalid$1;\n\nfunction parseIso (inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n}\n\nfunction positiveMomentsDifference(base, other) {\n var res = {milliseconds: 0, months: 0};\n\n res.months = other.month() - base.month() +\n (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n return res;\n}\n\nfunction momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return {milliseconds: 0, months: 0};\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n}\n\n// TODO: remove 'name' arg after deprecation is removed\nfunction createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n}\n\nfunction addSubtract (mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n}\n\nvar add = createAdder(1, 'add');\nvar subtract = createAdder(-1, 'subtract');\n\nfunction getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' :\n diff < -1 ? 'lastWeek' :\n diff < 0 ? 'lastDay' :\n diff < 1 ? 'sameDay' :\n diff < 2 ? 'nextDay' :\n diff < 7 ? 'nextWeek' : 'sameElse';\n}\n\nfunction calendar$1 (time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse';\n\n var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n}\n\nfunction clone () {\n return new Moment(this);\n}\n\nfunction isAfter (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n}\n\nfunction isBefore (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n}\n\nfunction isBetween (from, to, units, inclusivity) {\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&\n (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));\n}\n\nfunction isSame (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units || 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n}\n\nfunction isSameOrAfter (input, units) {\n return this.isSame(input, units) || this.isAfter(input,units);\n}\n\nfunction isSameOrBefore (input, units) {\n return this.isSame(input, units) || this.isBefore(input,units);\n}\n\nfunction diff (input, units, asFloat) {\n var that,\n zoneDelta,\n delta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n if (units === 'year' || units === 'month' || units === 'quarter') {\n output = monthDiff(this, that);\n if (units === 'quarter') {\n output = output / 3;\n } else if (units === 'year') {\n output = output / 12;\n }\n } else {\n delta = this - that;\n output = units === 'second' ? delta / 1e3 : // 1000\n units === 'minute' ? delta / 6e4 : // 1000 * 60\n units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n delta;\n }\n return asFloat ? output : absFloor(output);\n}\n\nfunction monthDiff (a, b) {\n // difference in months\n var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2, adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n}\n\nhooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\nhooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\nfunction toString () {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n}\n\nfunction toISOString() {\n if (!this.isValid()) {\n return null;\n }\n var m = this.clone().utc();\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n return this.toDate().toISOString();\n }\n return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n}\n\n/**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\nfunction inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n}\n\nfunction format (inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n}\n\nfunction from (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n}\n\nfunction fromNow (withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n}\n\nfunction to (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n}\n\nfunction toNow (withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n}\n\n// If passed a locale key, it will set the locale for this\n// instance. Otherwise, it will return the locale configuration\n// variables for this instance.\nfunction locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n}\n\nvar lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n);\n\nfunction localeData () {\n return this._locale;\n}\n\nfunction startOf (units) {\n units = normalizeUnits(units);\n // the following switch intentionally omits break keywords\n // to utilize falling through the cases.\n switch (units) {\n case 'year':\n this.month(0);\n /* falls through */\n case 'quarter':\n case 'month':\n this.date(1);\n /* falls through */\n case 'week':\n case 'isoWeek':\n case 'day':\n case 'date':\n this.hours(0);\n /* falls through */\n case 'hour':\n this.minutes(0);\n /* falls through */\n case 'minute':\n this.seconds(0);\n /* falls through */\n case 'second':\n this.milliseconds(0);\n }\n\n // weeks are a special case\n if (units === 'week') {\n this.weekday(0);\n }\n if (units === 'isoWeek') {\n this.isoWeekday(1);\n }\n\n // quarters are also special\n if (units === 'quarter') {\n this.month(Math.floor(this.month() / 3) * 3);\n }\n\n return this;\n}\n\nfunction endOf (units) {\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond') {\n return this;\n }\n\n // 'date' is an alias for 'day', so it should be considered as such.\n if (units === 'date') {\n units = 'day';\n }\n\n return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n}\n\nfunction valueOf () {\n return this._d.valueOf() - ((this._offset || 0) * 60000);\n}\n\nfunction unix () {\n return Math.floor(this.valueOf() / 1000);\n}\n\nfunction toDate () {\n return new Date(this.valueOf());\n}\n\nfunction toArray () {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n}\n\nfunction toObject () {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n}\n\nfunction toJSON () {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n}\n\nfunction isValid$2 () {\n return isValid(this);\n}\n\nfunction parsingFlags () {\n return extend({}, getParsingFlags(this));\n}\n\nfunction invalidAt () {\n return getParsingFlags(this).overflow;\n}\n\nfunction creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n}\n\n// FORMATTING\n\naddFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n});\n\naddFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n});\n\nfunction addWeekYearFormatToken (token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n}\n\naddWeekYearFormatToken('gggg', 'weekYear');\naddWeekYearFormatToken('ggggg', 'weekYear');\naddWeekYearFormatToken('GGGG', 'isoWeekYear');\naddWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n// ALIASES\n\naddUnitAlias('weekYear', 'gg');\naddUnitAlias('isoWeekYear', 'GG');\n\n// PRIORITY\n\naddUnitPriority('weekYear', 1);\naddUnitPriority('isoWeekYear', 1);\n\n\n// PARSING\n\naddRegexToken('G', matchSigned);\naddRegexToken('g', matchSigned);\naddRegexToken('GG', match1to2, match2);\naddRegexToken('gg', match1to2, match2);\naddRegexToken('GGGG', match1to4, match4);\naddRegexToken('gggg', match1to4, match4);\naddRegexToken('GGGGG', match1to6, match6);\naddRegexToken('ggggg', match1to6, match6);\n\naddWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n});\n\naddWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n});\n\n// MOMENTS\n\nfunction getSetWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy);\n}\n\nfunction getSetISOWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input, this.isoWeek(), this.isoWeekday(), 1, 4);\n}\n\nfunction getISOWeeksInYear () {\n return weeksInYear(this.year(), 1, 4);\n}\n\nfunction getWeeksInYear () {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n}\n\nfunction getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n}\n\nfunction setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n}\n\n// FORMATTING\n\naddFormatToken('Q', 0, 'Qo', 'quarter');\n\n// ALIASES\n\naddUnitAlias('quarter', 'Q');\n\n// PRIORITY\n\naddUnitPriority('quarter', 7);\n\n// PARSING\n\naddRegexToken('Q', match1);\naddParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n});\n\n// MOMENTS\n\nfunction getSetQuarter (input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n}\n\n// FORMATTING\n\naddFormatToken('D', ['DD', 2], 'Do', 'date');\n\n// ALIASES\n\naddUnitAlias('date', 'D');\n\n// PRIOROITY\naddUnitPriority('date', 9);\n\n// PARSING\n\naddRegexToken('D', match1to2);\naddRegexToken('DD', match1to2, match2);\naddRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict ?\n (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :\n locale._dayOfMonthOrdinalParseLenient;\n});\n\naddParseToken(['D', 'DD'], DATE);\naddParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0], 10);\n});\n\n// MOMENTS\n\nvar getSetDayOfMonth = makeGetSet('Date', true);\n\n// FORMATTING\n\naddFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n// ALIASES\n\naddUnitAlias('dayOfYear', 'DDD');\n\n// PRIORITY\naddUnitPriority('dayOfYear', 4);\n\n// PARSING\n\naddRegexToken('DDD', match1to3);\naddRegexToken('DDDD', match3);\naddParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n});\n\n// HELPERS\n\n// MOMENTS\n\nfunction getSetDayOfYear (input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n}\n\n// FORMATTING\n\naddFormatToken('m', ['mm', 2], 0, 'minute');\n\n// ALIASES\n\naddUnitAlias('minute', 'm');\n\n// PRIORITY\n\naddUnitPriority('minute', 14);\n\n// PARSING\n\naddRegexToken('m', match1to2);\naddRegexToken('mm', match1to2, match2);\naddParseToken(['m', 'mm'], MINUTE);\n\n// MOMENTS\n\nvar getSetMinute = makeGetSet('Minutes', false);\n\n// FORMATTING\n\naddFormatToken('s', ['ss', 2], 0, 'second');\n\n// ALIASES\n\naddUnitAlias('second', 's');\n\n// PRIORITY\n\naddUnitPriority('second', 15);\n\n// PARSING\n\naddRegexToken('s', match1to2);\naddRegexToken('ss', match1to2, match2);\naddParseToken(['s', 'ss'], SECOND);\n\n// MOMENTS\n\nvar getSetSecond = makeGetSet('Seconds', false);\n\n// FORMATTING\n\naddFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n});\n\naddFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n});\n\naddFormatToken(0, ['SSS', 3], 0, 'millisecond');\naddFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n});\naddFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n});\naddFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n});\naddFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n});\naddFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n});\naddFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n});\n\n\n// ALIASES\n\naddUnitAlias('millisecond', 'ms');\n\n// PRIORITY\n\naddUnitPriority('millisecond', 16);\n\n// PARSING\n\naddRegexToken('S', match1to3, match1);\naddRegexToken('SS', match1to3, match2);\naddRegexToken('SSS', match1to3, match3);\n\nvar token;\nfor (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n}\n\nfunction parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n}\n\nfor (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n}\n// MOMENTS\n\nvar getSetMillisecond = makeGetSet('Milliseconds', false);\n\n// FORMATTING\n\naddFormatToken('z', 0, 0, 'zoneAbbr');\naddFormatToken('zz', 0, 0, 'zoneName');\n\n// MOMENTS\n\nfunction getZoneAbbr () {\n return this._isUTC ? 'UTC' : '';\n}\n\nfunction getZoneName () {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n}\n\nvar proto = Moment.prototype;\n\nproto.add = add;\nproto.calendar = calendar$1;\nproto.clone = clone;\nproto.diff = diff;\nproto.endOf = endOf;\nproto.format = format;\nproto.from = from;\nproto.fromNow = fromNow;\nproto.to = to;\nproto.toNow = toNow;\nproto.get = stringGet;\nproto.invalidAt = invalidAt;\nproto.isAfter = isAfter;\nproto.isBefore = isBefore;\nproto.isBetween = isBetween;\nproto.isSame = isSame;\nproto.isSameOrAfter = isSameOrAfter;\nproto.isSameOrBefore = isSameOrBefore;\nproto.isValid = isValid$2;\nproto.lang = lang;\nproto.locale = locale;\nproto.localeData = localeData;\nproto.max = prototypeMax;\nproto.min = prototypeMin;\nproto.parsingFlags = parsingFlags;\nproto.set = stringSet;\nproto.startOf = startOf;\nproto.subtract = subtract;\nproto.toArray = toArray;\nproto.toObject = toObject;\nproto.toDate = toDate;\nproto.toISOString = toISOString;\nproto.inspect = inspect;\nproto.toJSON = toJSON;\nproto.toString = toString;\nproto.unix = unix;\nproto.valueOf = valueOf;\nproto.creationData = creationData;\n\n// Year\nproto.year = getSetYear;\nproto.isLeapYear = getIsLeapYear;\n\n// Week Year\nproto.weekYear = getSetWeekYear;\nproto.isoWeekYear = getSetISOWeekYear;\n\n// Quarter\nproto.quarter = proto.quarters = getSetQuarter;\n\n// Month\nproto.month = getSetMonth;\nproto.daysInMonth = getDaysInMonth;\n\n// Week\nproto.week = proto.weeks = getSetWeek;\nproto.isoWeek = proto.isoWeeks = getSetISOWeek;\nproto.weeksInYear = getWeeksInYear;\nproto.isoWeeksInYear = getISOWeeksInYear;\n\n// Day\nproto.date = getSetDayOfMonth;\nproto.day = proto.days = getSetDayOfWeek;\nproto.weekday = getSetLocaleDayOfWeek;\nproto.isoWeekday = getSetISODayOfWeek;\nproto.dayOfYear = getSetDayOfYear;\n\n// Hour\nproto.hour = proto.hours = getSetHour;\n\n// Minute\nproto.minute = proto.minutes = getSetMinute;\n\n// Second\nproto.second = proto.seconds = getSetSecond;\n\n// Millisecond\nproto.millisecond = proto.milliseconds = getSetMillisecond;\n\n// Offset\nproto.utcOffset = getSetOffset;\nproto.utc = setOffsetToUTC;\nproto.local = setOffsetToLocal;\nproto.parseZone = setOffsetToParsedOffset;\nproto.hasAlignedHourOffset = hasAlignedHourOffset;\nproto.isDST = isDaylightSavingTime;\nproto.isLocal = isLocal;\nproto.isUtcOffset = isUtcOffset;\nproto.isUtc = isUtc;\nproto.isUTC = isUtc;\n\n// Timezone\nproto.zoneAbbr = getZoneAbbr;\nproto.zoneName = getZoneName;\n\n// Deprecations\nproto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\nproto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\nproto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\nproto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\nproto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n\nfunction createUnix (input) {\n return createLocal(input * 1000);\n}\n\nfunction createInZone () {\n return createLocal.apply(null, arguments).parseZone();\n}\n\nfunction preParsePostFormat (string) {\n return string;\n}\n\nvar proto$1 = Locale.prototype;\n\nproto$1.calendar = calendar;\nproto$1.longDateFormat = longDateFormat;\nproto$1.invalidDate = invalidDate;\nproto$1.ordinal = ordinal;\nproto$1.preparse = preParsePostFormat;\nproto$1.postformat = preParsePostFormat;\nproto$1.relativeTime = relativeTime;\nproto$1.pastFuture = pastFuture;\nproto$1.set = set;\n\n// Month\nproto$1.months = localeMonths;\nproto$1.monthsShort = localeMonthsShort;\nproto$1.monthsParse = localeMonthsParse;\nproto$1.monthsRegex = monthsRegex;\nproto$1.monthsShortRegex = monthsShortRegex;\n\n// Week\nproto$1.week = localeWeek;\nproto$1.firstDayOfYear = localeFirstDayOfYear;\nproto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n// Day of Week\nproto$1.weekdays = localeWeekdays;\nproto$1.weekdaysMin = localeWeekdaysMin;\nproto$1.weekdaysShort = localeWeekdaysShort;\nproto$1.weekdaysParse = localeWeekdaysParse;\n\nproto$1.weekdaysRegex = weekdaysRegex;\nproto$1.weekdaysShortRegex = weekdaysShortRegex;\nproto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n// Hours\nproto$1.isPM = localeIsPM;\nproto$1.meridiem = localeMeridiem;\n\nfunction get$1 (format, index, field, setter) {\n var locale = getLocale();\n var utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n}\n\nfunction listMonthsImpl (format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n}\n\n// ()\n// (5)\n// (fmt, 5)\n// (fmt)\n// (true)\n// (true, 5)\n// (true, fmt, 5)\n// (true, fmt)\nfunction listWeekdaysImpl (localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n}\n\nfunction listMonths (format, index) {\n return listMonthsImpl(format, index, 'months');\n}\n\nfunction listMonthsShort (format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n}\n\nfunction listWeekdays (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n}\n\nfunction listWeekdaysShort (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n}\n\nfunction listWeekdaysMin (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n}\n\ngetSetGlobalLocale('en', {\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (toInt(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n }\n});\n\n// Side effect imports\nhooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\nhooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n\nvar mathAbs = Math.abs;\n\nfunction abs () {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n}\n\nfunction addSubtract$1 (duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n}\n\n// supports only 2.0-style add(1, 's') or add(duration)\nfunction add$1 (input, value) {\n return addSubtract$1(this, input, value, 1);\n}\n\n// supports only 2.0-style subtract(1, 's') or subtract(duration)\nfunction subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n}\n\nfunction absCeil (number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n}\n\nfunction bubble () {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0))) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n}\n\nfunction daysToMonths (days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n}\n\nfunction monthsToDays (months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n}\n\nfunction as (units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days;\n var months;\n var milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n return units === 'month' ? months : months / 12;\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week' : return days / 7 + milliseconds / 6048e5;\n case 'day' : return days + milliseconds / 864e5;\n case 'hour' : return days * 24 + milliseconds / 36e5;\n case 'minute' : return days * 1440 + milliseconds / 6e4;\n case 'second' : return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond': return Math.floor(days * 864e5) + milliseconds;\n default: throw new Error('Unknown unit ' + units);\n }\n }\n}\n\n// TODO: Use this.as('ms')?\nfunction valueOf$1 () {\n if (!this.isValid()) {\n return NaN;\n }\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n}\n\nfunction makeAs (alias) {\n return function () {\n return this.as(alias);\n };\n}\n\nvar asMilliseconds = makeAs('ms');\nvar asSeconds = makeAs('s');\nvar asMinutes = makeAs('m');\nvar asHours = makeAs('h');\nvar asDays = makeAs('d');\nvar asWeeks = makeAs('w');\nvar asMonths = makeAs('M');\nvar asYears = makeAs('y');\n\nfunction get$2 (units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n}\n\nfunction makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n}\n\nvar milliseconds = makeGetter('milliseconds');\nvar seconds = makeGetter('seconds');\nvar minutes = makeGetter('minutes');\nvar hours = makeGetter('hours');\nvar days = makeGetter('days');\nvar months = makeGetter('months');\nvar years = makeGetter('years');\n\nfunction weeks () {\n return absFloor(this.days() / 7);\n}\n\nvar round = Math.round;\nvar thresholds = {\n ss: 44, // a few seconds to seconds\n s : 45, // seconds to minute\n m : 45, // minutes to hour\n h : 22, // hours to day\n d : 26, // days to month\n M : 11 // months to year\n};\n\n// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\nfunction substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n}\n\nfunction relativeTime$1 (posNegDuration, withoutSuffix, locale) {\n var duration = createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n\n var a = seconds <= thresholds.ss && ['s', seconds] ||\n seconds < thresholds.s && ['ss', seconds] ||\n minutes <= 1 && ['m'] ||\n minutes < thresholds.m && ['mm', minutes] ||\n hours <= 1 && ['h'] ||\n hours < thresholds.h && ['hh', hours] ||\n days <= 1 && ['d'] ||\n days < thresholds.d && ['dd', days] ||\n months <= 1 && ['M'] ||\n months < thresholds.M && ['MM', months] ||\n years <= 1 && ['y'] || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n}\n\n// This function allows you to set the rounding function for relative time strings\nfunction getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n}\n\n// This function allows you to set a threshold for relative time strings\nfunction getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n}\n\nfunction humanize (withSuffix) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var locale = this.localeData();\n var output = relativeTime$1(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n}\n\nvar abs$1 = Math.abs;\n\nfunction toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000;\n var days = abs$1(this._days);\n var months = abs$1(this._months);\n var minutes, hours, years;\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds;\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n return (total < 0 ? '-' : '') +\n 'P' +\n (Y ? Y + 'Y' : '') +\n (M ? M + 'M' : '') +\n (D ? D + 'D' : '') +\n ((h || m || s) ? 'T' : '') +\n (h ? h + 'H' : '') +\n (m ? m + 'M' : '') +\n (s ? s + 'S' : '');\n}\n\nvar proto$2 = Duration.prototype;\n\nproto$2.isValid = isValid$1;\nproto$2.abs = abs;\nproto$2.add = add$1;\nproto$2.subtract = subtract$1;\nproto$2.as = as;\nproto$2.asMilliseconds = asMilliseconds;\nproto$2.asSeconds = asSeconds;\nproto$2.asMinutes = asMinutes;\nproto$2.asHours = asHours;\nproto$2.asDays = asDays;\nproto$2.asWeeks = asWeeks;\nproto$2.asMonths = asMonths;\nproto$2.asYears = asYears;\nproto$2.valueOf = valueOf$1;\nproto$2._bubble = bubble;\nproto$2.get = get$2;\nproto$2.milliseconds = milliseconds;\nproto$2.seconds = seconds;\nproto$2.minutes = minutes;\nproto$2.hours = hours;\nproto$2.days = days;\nproto$2.weeks = weeks;\nproto$2.months = months;\nproto$2.years = years;\nproto$2.humanize = humanize;\nproto$2.toISOString = toISOString$1;\nproto$2.toString = toISOString$1;\nproto$2.toJSON = toISOString$1;\nproto$2.locale = locale;\nproto$2.localeData = localeData;\n\n// Deprecations\nproto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\nproto$2.lang = lang;\n\n// Side effect imports\n\n// FORMATTING\n\naddFormatToken('X', 0, 0, 'unix');\naddFormatToken('x', 0, 0, 'valueOf');\n\n// PARSING\n\naddRegexToken('x', matchSigned);\naddRegexToken('X', matchTimestamp);\naddParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n});\naddParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n});\n\n// Side effect imports\n\n\nhooks.version = '2.18.1';\n\nsetHookCallback(createLocal);\n\nhooks.fn = proto;\nhooks.min = min;\nhooks.max = max;\nhooks.now = now;\nhooks.utc = createUTC;\nhooks.unix = createUnix;\nhooks.months = listMonths;\nhooks.isDate = isDate;\nhooks.locale = getSetGlobalLocale;\nhooks.invalid = createInvalid;\nhooks.duration = createDuration;\nhooks.isMoment = isMoment;\nhooks.weekdays = listWeekdays;\nhooks.parseZone = createInZone;\nhooks.localeData = getLocale;\nhooks.isDuration = isDuration;\nhooks.monthsShort = listMonthsShort;\nhooks.weekdaysMin = listWeekdaysMin;\nhooks.defineLocale = defineLocale;\nhooks.updateLocale = updateLocale;\nhooks.locales = listLocales;\nhooks.weekdaysShort = listWeekdaysShort;\nhooks.normalizeUnits = normalizeUnits;\nhooks.relativeTimeRounding = getSetRelativeTimeRounding;\nhooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\nhooks.calendarFormat = getCalendarFormat;\nhooks.prototype = proto;\n\nreturn hooks;\n\n})));\n", "/*!\n * Pikaday\n *\n * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday\n */\n\n(function (root, factory)\n{\n 'use strict';\n\n var moment;\n if (typeof exports === 'object') {\n // CommonJS module\n // Load moment.js as an optional dependency\n try { moment = require('moment'); } catch (e) {}\n module.exports = factory(moment);\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(function (req)\n {\n // Load moment.js as an optional dependency\n var id = 'moment';\n try { moment = req(id); } catch (e) {}\n return factory(moment);\n });\n } else {\n root.Pikaday = factory(root.moment);\n }\n}(this, function (moment)\n{\n 'use strict';\n\n /**\n * feature detection and helper functions\n */\n var hasMoment = typeof moment === 'function',\n\n hasEventListeners = !!window.addEventListener,\n\n document = window.document,\n\n sto = window.setTimeout,\n\n addEvent = function(el, e, callback, capture)\n {\n if (hasEventListeners) {\n el.addEventListener(e, callback, !!capture);\n } else {\n el.attachEvent('on' + e, callback);\n }\n },\n\n removeEvent = function(el, e, callback, capture)\n {\n if (hasEventListeners) {\n el.removeEventListener(e, callback, !!capture);\n } else {\n el.detachEvent('on' + e, callback);\n }\n },\n\n trim = function(str)\n {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g,'');\n },\n\n hasClass = function(el, cn)\n {\n return (' ' + el.className + ' ').indexOf(' ' + cn + ' ') !== -1;\n },\n\n addClass = function(el, cn)\n {\n if (!hasClass(el, cn)) {\n el.className = (el.className === '') ? cn : el.className + ' ' + cn;\n }\n },\n\n removeClass = function(el, cn)\n {\n el.className = trim((' ' + el.className + ' ').replace(' ' + cn + ' ', ' '));\n },\n\n isArray = function(obj)\n {\n return (/Array/).test(Object.prototype.toString.call(obj));\n },\n\n isDate = function(obj)\n {\n return (/Date/).test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime());\n },\n\n isWeekend = function(date)\n {\n var day = date.getDay();\n return day === 0 || day === 6;\n },\n\n isLeapYear = function(year)\n {\n // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n },\n\n getDaysInMonth = function(year, month)\n {\n return [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];\n },\n\n setToStartOfDay = function(date)\n {\n if (isDate(date)) date.setHours(0,0,0,0);\n },\n\n compareDates = function(a,b)\n {\n // weak date comparison (use setToStartOfDay(date) to ensure correct result)\n return a.getTime() === b.getTime();\n },\n\n extend = function(to, from, overwrite)\n {\n var prop, hasProp;\n for (prop in from) {\n hasProp = to[prop] !== undefined;\n if (hasProp && typeof from[prop] === 'object' && from[prop] !== null && from[prop].nodeName === undefined) {\n if (isDate(from[prop])) {\n if (overwrite) {\n to[prop] = new Date(from[prop].getTime());\n }\n }\n else if (isArray(from[prop])) {\n if (overwrite) {\n to[prop] = from[prop].slice(0);\n }\n } else {\n to[prop] = extend({}, from[prop], overwrite);\n }\n } else if (overwrite || !hasProp) {\n to[prop] = from[prop];\n }\n }\n return to;\n },\n\n fireEvent = function(el, eventName, data)\n {\n var ev;\n\n if (document.createEvent) {\n ev = document.createEvent('HTMLEvents');\n ev.initEvent(eventName, true, false);\n ev = extend(ev, data);\n el.dispatchEvent(ev);\n } else if (document.createEventObject) {\n ev = document.createEventObject();\n ev = extend(ev, data);\n el.fireEvent('on' + eventName, ev);\n }\n },\n\n adjustCalendar = function(calendar) {\n if (calendar.month < 0) {\n calendar.year -= Math.ceil(Math.abs(calendar.month)/12);\n calendar.month += 12;\n }\n if (calendar.month > 11) {\n calendar.year += Math.floor(Math.abs(calendar.month)/12);\n calendar.month -= 12;\n }\n return calendar;\n },\n\n /**\n * defaults and localisation\n */\n defaults = {\n\n // bind the picker to a form field\n field: null,\n\n // automatically show/hide the picker on `field` focus (default `true` if `field` is set)\n bound: undefined,\n\n // position of the datepicker, relative to the field (default to bottom & left)\n // ('bottom' & 'left' keywords are not used, 'top' & 'right' are modifier on the bottom/left position)\n position: 'bottom left',\n\n // automatically fit in the viewport even if it means repositioning from the position option\n reposition: true,\n\n // the default output format for `.toString()` and `field` value\n format: 'YYYY-MM-DD',\n\n // the toString function which gets passed a current date object and format\n // and returns a string\n toString: null,\n\n // used to create date object from current input string\n parse: null,\n\n // the initial date to view when first opened\n defaultDate: null,\n\n // make the `defaultDate` the initial selected value\n setDefaultDate: false,\n\n // first day of week (0: Sunday, 1: Monday etc)\n firstDay: 0,\n\n // the default flag for moment's strict date parsing\n formatStrict: false,\n\n // the minimum/earliest date that can be selected\n minDate: null,\n // the maximum/latest date that can be selected\n maxDate: null,\n\n // number of years either side, or array of upper/lower range\n yearRange: 10,\n\n // show week numbers at head of row\n showWeekNumber: false,\n\n // Week picker mode\n pickWholeWeek: false,\n\n // used internally (don't config outside)\n minYear: 0,\n maxYear: 9999,\n minMonth: undefined,\n maxMonth: undefined,\n\n startRange: null,\n endRange: null,\n\n isRTL: false,\n\n // Additional text to append to the year in the calendar title\n yearSuffix: '',\n\n // Render the month after year in the calendar title\n showMonthAfterYear: false,\n\n // Render days of the calendar grid that fall in the next or previous month\n showDaysInNextAndPreviousMonths: false,\n\n // Allows user to select days that fall in the next or previous month\n enableSelectionDaysInNextAndPreviousMonths: false,\n\n // how many months are visible\n numberOfMonths: 1,\n\n // when numberOfMonths is used, this will help you to choose where the main calendar will be (default `left`, can be set to `right`)\n // only used for the first display or when a selected date is not visible\n mainCalendar: 'left',\n\n // Specify a DOM element to render the calendar in\n container: undefined,\n\n // Blur field when date is selected\n blurFieldOnSelect : true,\n\n // internationalization\n i18n: {\n previousMonth : 'Previous Month',\n nextMonth : 'Next Month',\n months : ['January','February','March','April','May','June','July','August','September','October','November','December'],\n weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],\n weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']\n },\n\n // Theme Classname\n theme: null,\n\n // events array\n events: [],\n\n // callback function\n onSelect: null,\n onOpen: null,\n onClose: null,\n onDraw: null\n },\n\n\n /**\n * templating functions to abstract HTML rendering\n */\n renderDayName = function(opts, day, abbr)\n {\n day += opts.firstDay;\n while (day >= 7) {\n day -= 7;\n }\n return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];\n },\n\n renderDay = function(opts)\n {\n var arr = [];\n var ariaSelected = 'false';\n if (opts.isEmpty) {\n if (opts.showDaysInNextAndPreviousMonths) {\n arr.push('is-outside-current-month');\n\n if(!opts.enableSelectionDaysInNextAndPreviousMonths) {\n arr.push('is-selection-disabled');\n }\n\n } else {\n return '';\n }\n }\n if (opts.isDisabled) {\n arr.push('is-disabled');\n }\n if (opts.isToday) {\n arr.push('is-today');\n }\n if (opts.isSelected) {\n arr.push('is-selected');\n ariaSelected = 'true';\n }\n if (opts.hasEvent) {\n arr.push('has-event');\n }\n if (opts.isInRange) {\n arr.push('is-inrange');\n }\n if (opts.isStartRange) {\n arr.push('is-startrange');\n }\n if (opts.isEndRange) {\n arr.push('is-endrange');\n }\n return '' +\n '' +\n '';\n },\n\n renderWeek = function (d, m, y) {\n // Lifted from http://javascript.about.com/library/blweekyear.htm, lightly modified.\n var onejan = new Date(y, 0, 1),\n weekNum = Math.ceil((((new Date(y, m, d) - onejan) / 86400000) + onejan.getDay()+1)/7);\n return '' + weekNum + '';\n },\n\n renderRow = function(days, isRTL, pickWholeWeek, isRowSelected)\n {\n return '' + (isRTL ? days.reverse() : days).join('') + '';\n },\n\n renderBody = function(rows)\n {\n return '' + rows.join('') + '';\n },\n\n renderHead = function(opts)\n {\n var i, arr = [];\n if (opts.showWeekNumber) {\n arr.push('');\n }\n for (i = 0; i < 7; i++) {\n arr.push('' + renderDayName(opts, i, true) + '');\n }\n return '' + (opts.isRTL ? arr.reverse() : arr).join('') + '';\n },\n\n renderTitle = function(instance, c, year, month, refYear, randId)\n {\n var i, j, arr,\n opts = instance._o,\n isMinYear = year === opts.minYear,\n isMaxYear = year === opts.maxYear,\n html = '
    ',\n monthHtml,\n yearHtml,\n prev = true,\n next = true;\n\n for (arr = [], i = 0; i < 12; i++) {\n arr.push('');\n }\n\n monthHtml = '
    ' + opts.i18n.months[month] + '
    ';\n\n if (isArray(opts.yearRange)) {\n i = opts.yearRange[0];\n j = opts.yearRange[1] + 1;\n } else {\n i = year - opts.yearRange;\n j = 1 + year + opts.yearRange;\n }\n\n for (arr = []; i < j && i <= opts.maxYear; i++) {\n if (i >= opts.minYear) {\n arr.push('');\n }\n }\n yearHtml = '
    ' + year + opts.yearSuffix + '
    ';\n\n if (opts.showMonthAfterYear) {\n html += yearHtml + monthHtml;\n } else {\n html += monthHtml + yearHtml;\n }\n\n if (isMinYear && (month === 0 || opts.minMonth >= month)) {\n prev = false;\n }\n\n if (isMaxYear && (month === 11 || opts.maxMonth <= month)) {\n next = false;\n }\n\n if (c === 0) {\n html += '';\n }\n if (c === (instance._o.numberOfMonths - 1) ) {\n html += '';\n }\n\n return html += '
    ';\n },\n\n renderTable = function(opts, data, randId)\n {\n return '' + renderHead(opts) + renderBody(data) + '
    ';\n },\n\n\n /**\n * Pikaday constructor\n */\n Pikaday = function(options)\n {\n var self = this,\n opts = self.config(options);\n\n self._onMouseDown = function(e)\n {\n if (!self._v) {\n return;\n }\n e = e || window.event;\n var target = e.target || e.srcElement;\n if (!target) {\n return;\n }\n\n if (!hasClass(target, 'is-disabled')) {\n if (hasClass(target, 'pika-button') && !hasClass(target, 'is-empty') && !hasClass(target.parentNode, 'is-disabled')) {\n self.setDate(new Date(target.getAttribute('data-pika-year'), target.getAttribute('data-pika-month'), target.getAttribute('data-pika-day')));\n if (opts.bound) {\n sto(function() {\n self.hide();\n if (opts.blurFieldOnSelect && opts.field) {\n opts.field.blur();\n }\n }, 100);\n }\n }\n else if (hasClass(target, 'pika-prev')) {\n self.prevMonth();\n }\n else if (hasClass(target, 'pika-next')) {\n self.nextMonth();\n }\n }\n if (!hasClass(target, 'pika-select')) {\n // if this is touch event prevent mouse events emulation\n if (e.preventDefault) {\n e.preventDefault();\n } else {\n e.returnValue = false;\n return false;\n }\n } else {\n self._c = true;\n }\n };\n\n self._onChange = function(e)\n {\n e = e || window.event;\n var target = e.target || e.srcElement;\n if (!target) {\n return;\n }\n if (hasClass(target, 'pika-select-month')) {\n self.gotoMonth(target.value);\n }\n else if (hasClass(target, 'pika-select-year')) {\n self.gotoYear(target.value);\n }\n };\n\n self._onKeyChange = function(e)\n {\n e = e || window.event;\n\n if (self.isVisible()) {\n\n switch(e.keyCode){\n case 13:\n case 27:\n if (opts.field) {\n opts.field.blur();\n }\n break;\n case 37:\n e.preventDefault();\n self.adjustDate('subtract', 1);\n break;\n case 38:\n self.adjustDate('subtract', 7);\n break;\n case 39:\n self.adjustDate('add', 1);\n break;\n case 40:\n self.adjustDate('add', 7);\n break;\n }\n }\n };\n\n self._onInputChange = function(e)\n {\n var date;\n\n if (e.firedBy === self) {\n return;\n }\n if (opts.parse) {\n date = opts.parse(opts.field.value, opts.format);\n } else if (hasMoment) {\n date = moment(opts.field.value, opts.format, opts.formatStrict);\n date = (date && date.isValid()) ? date.toDate() : null;\n }\n else {\n date = new Date(Date.parse(opts.field.value));\n }\n if (isDate(date)) {\n self.setDate(date);\n }\n if (!self._v) {\n self.show();\n }\n };\n\n self._onInputFocus = function()\n {\n self.show();\n };\n\n self._onInputClick = function()\n {\n self.show();\n };\n\n self._onInputBlur = function()\n {\n // IE allows pika div to gain focus; catch blur the input field\n var pEl = document.activeElement;\n do {\n if (hasClass(pEl, 'pika-single')) {\n return;\n }\n }\n while ((pEl = pEl.parentNode));\n\n if (!self._c) {\n self._b = sto(function() {\n self.hide();\n }, 50);\n }\n self._c = false;\n };\n\n self._onClick = function(e)\n {\n e = e || window.event;\n var target = e.target || e.srcElement,\n pEl = target;\n if (!target) {\n return;\n }\n if (!hasEventListeners && hasClass(target, 'pika-select')) {\n if (!target.onchange) {\n target.setAttribute('onchange', 'return;');\n addEvent(target, 'change', self._onChange);\n }\n }\n do {\n if (hasClass(pEl, 'pika-single') || pEl === opts.trigger) {\n return;\n }\n }\n while ((pEl = pEl.parentNode));\n if (self._v && target !== opts.trigger && pEl !== opts.trigger) {\n self.hide();\n }\n };\n\n self.el = document.createElement('div');\n self.el.className = 'pika-single' + (opts.isRTL ? ' is-rtl' : '') + (opts.theme ? ' ' + opts.theme : '');\n\n addEvent(self.el, 'mousedown', self._onMouseDown, true);\n addEvent(self.el, 'touchend', self._onMouseDown, true);\n addEvent(self.el, 'change', self._onChange);\n addEvent(document, 'keydown', self._onKeyChange);\n\n if (opts.field) {\n if (opts.container) {\n opts.container.appendChild(self.el);\n } else if (opts.bound) {\n document.body.appendChild(self.el);\n } else {\n opts.field.parentNode.insertBefore(self.el, opts.field.nextSibling);\n }\n addEvent(opts.field, 'change', self._onInputChange);\n\n if (!opts.defaultDate) {\n if (hasMoment && opts.field.value) {\n opts.defaultDate = moment(opts.field.value, opts.format).toDate();\n } else {\n opts.defaultDate = new Date(Date.parse(opts.field.value));\n }\n opts.setDefaultDate = true;\n }\n }\n\n var defDate = opts.defaultDate;\n\n if (isDate(defDate)) {\n if (opts.setDefaultDate) {\n self.setDate(defDate, true);\n } else {\n self.gotoDate(defDate);\n }\n } else {\n self.gotoDate(new Date());\n }\n\n if (opts.bound) {\n this.hide();\n self.el.className += ' is-bound';\n addEvent(opts.trigger, 'click', self._onInputClick);\n addEvent(opts.trigger, 'focus', self._onInputFocus);\n addEvent(opts.trigger, 'blur', self._onInputBlur);\n } else {\n this.show();\n }\n };\n\n\n /**\n * public Pikaday API\n */\n Pikaday.prototype = {\n\n\n /**\n * configure functionality\n */\n config: function(options)\n {\n if (!this._o) {\n this._o = extend({}, defaults, true);\n }\n\n var opts = extend(this._o, options, true);\n\n opts.isRTL = !!opts.isRTL;\n\n opts.field = (opts.field && opts.field.nodeName) ? opts.field : null;\n\n opts.theme = (typeof opts.theme) === 'string' && opts.theme ? opts.theme : null;\n\n opts.bound = !!(opts.bound !== undefined ? opts.field && opts.bound : opts.field);\n\n opts.trigger = (opts.trigger && opts.trigger.nodeName) ? opts.trigger : opts.field;\n\n opts.disableWeekends = !!opts.disableWeekends;\n\n opts.disableDayFn = (typeof opts.disableDayFn) === 'function' ? opts.disableDayFn : null;\n\n var nom = parseInt(opts.numberOfMonths, 10) || 1;\n opts.numberOfMonths = nom > 4 ? 4 : nom;\n\n if (!isDate(opts.minDate)) {\n opts.minDate = false;\n }\n if (!isDate(opts.maxDate)) {\n opts.maxDate = false;\n }\n if ((opts.minDate && opts.maxDate) && opts.maxDate < opts.minDate) {\n opts.maxDate = opts.minDate = false;\n }\n if (opts.minDate) {\n this.setMinDate(opts.minDate);\n }\n if (opts.maxDate) {\n this.setMaxDate(opts.maxDate);\n }\n\n if (isArray(opts.yearRange)) {\n var fallback = new Date().getFullYear() - 10;\n opts.yearRange[0] = parseInt(opts.yearRange[0], 10) || fallback;\n opts.yearRange[1] = parseInt(opts.yearRange[1], 10) || fallback;\n } else {\n opts.yearRange = Math.abs(parseInt(opts.yearRange, 10)) || defaults.yearRange;\n if (opts.yearRange > 100) {\n opts.yearRange = 100;\n }\n }\n\n return opts;\n },\n\n /**\n * return a formatted string of the current selection (using Moment.js if available)\n */\n toString: function(format)\n {\n format = format || this._o.format;\n if (!isDate(this._d)) {\n return '';\n }\n if (this._o.toString) {\n return this._o.toString(this._d, format);\n }\n if (hasMoment) {\n return moment(this._d).format(format);\n }\n return this._d.toDateString();\n },\n\n /**\n * return a Moment.js object of the current selection (if available)\n */\n getMoment: function()\n {\n return hasMoment ? moment(this._d) : null;\n },\n\n /**\n * set the current selection from a Moment.js object (if available)\n */\n setMoment: function(date, preventOnSelect)\n {\n if (hasMoment && moment.isMoment(date)) {\n this.setDate(date.toDate(), preventOnSelect);\n }\n },\n\n /**\n * return a Date object of the current selection\n */\n getDate: function()\n {\n return isDate(this._d) ? new Date(this._d.getTime()) : null;\n },\n\n /**\n * set the current selection\n */\n setDate: function(date, preventOnSelect)\n {\n if (!date) {\n this._d = null;\n\n if (this._o.field) {\n this._o.field.value = '';\n fireEvent(this._o.field, 'change', { firedBy: this });\n }\n\n return this.draw();\n }\n if (typeof date === 'string') {\n date = new Date(Date.parse(date));\n }\n if (!isDate(date)) {\n return;\n }\n\n var min = this._o.minDate,\n max = this._o.maxDate;\n\n if (isDate(min) && date < min) {\n date = min;\n } else if (isDate(max) && date > max) {\n date = max;\n }\n\n this._d = new Date(date.getTime());\n setToStartOfDay(this._d);\n this.gotoDate(this._d);\n\n if (this._o.field) {\n this._o.field.value = this.toString();\n fireEvent(this._o.field, 'change', { firedBy: this });\n }\n if (!preventOnSelect && typeof this._o.onSelect === 'function') {\n this._o.onSelect.call(this, this.getDate());\n }\n },\n\n /**\n * change view to a specific date\n */\n gotoDate: function(date)\n {\n var newCalendar = true;\n\n if (!isDate(date)) {\n return;\n }\n\n if (this.calendars) {\n var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1),\n lastVisibleDate = new Date(this.calendars[this.calendars.length-1].year, this.calendars[this.calendars.length-1].month, 1),\n visibleDate = date.getTime();\n // get the end of the month\n lastVisibleDate.setMonth(lastVisibleDate.getMonth()+1);\n lastVisibleDate.setDate(lastVisibleDate.getDate()-1);\n newCalendar = (visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate);\n }\n\n if (newCalendar) {\n this.calendars = [{\n month: date.getMonth(),\n year: date.getFullYear()\n }];\n if (this._o.mainCalendar === 'right') {\n this.calendars[0].month += 1 - this._o.numberOfMonths;\n }\n }\n\n this.adjustCalendars();\n },\n\n adjustDate: function(sign, days) {\n\n var day = this.getDate() || new Date();\n var difference = parseInt(days)*24*60*60*1000;\n\n var newDay;\n\n if (sign === 'add') {\n newDay = new Date(day.valueOf() + difference);\n } else if (sign === 'subtract') {\n newDay = new Date(day.valueOf() - difference);\n }\n\n this.setDate(newDay);\n },\n\n adjustCalendars: function() {\n this.calendars[0] = adjustCalendar(this.calendars[0]);\n for (var c = 1; c < this._o.numberOfMonths; c++) {\n this.calendars[c] = adjustCalendar({\n month: this.calendars[0].month + c,\n year: this.calendars[0].year\n });\n }\n this.draw();\n },\n\n gotoToday: function()\n {\n this.gotoDate(new Date());\n },\n\n /**\n * change view to a specific month (zero-index, e.g. 0: January)\n */\n gotoMonth: function(month)\n {\n if (!isNaN(month)) {\n this.calendars[0].month = parseInt(month, 10);\n this.adjustCalendars();\n }\n },\n\n nextMonth: function()\n {\n this.calendars[0].month++;\n this.adjustCalendars();\n },\n\n prevMonth: function()\n {\n this.calendars[0].month--;\n this.adjustCalendars();\n },\n\n /**\n * change view to a specific full year (e.g. \"2012\")\n */\n gotoYear: function(year)\n {\n if (!isNaN(year)) {\n this.calendars[0].year = parseInt(year, 10);\n this.adjustCalendars();\n }\n },\n\n /**\n * change the minDate\n */\n setMinDate: function(value)\n {\n if(value instanceof Date) {\n setToStartOfDay(value);\n this._o.minDate = value;\n this._o.minYear = value.getFullYear();\n this._o.minMonth = value.getMonth();\n } else {\n this._o.minDate = defaults.minDate;\n this._o.minYear = defaults.minYear;\n this._o.minMonth = defaults.minMonth;\n this._o.startRange = defaults.startRange;\n }\n\n this.draw();\n },\n\n /**\n * change the maxDate\n */\n setMaxDate: function(value)\n {\n if(value instanceof Date) {\n setToStartOfDay(value);\n this._o.maxDate = value;\n this._o.maxYear = value.getFullYear();\n this._o.maxMonth = value.getMonth();\n } else {\n this._o.maxDate = defaults.maxDate;\n this._o.maxYear = defaults.maxYear;\n this._o.maxMonth = defaults.maxMonth;\n this._o.endRange = defaults.endRange;\n }\n\n this.draw();\n },\n\n setStartRange: function(value)\n {\n this._o.startRange = value;\n },\n\n setEndRange: function(value)\n {\n this._o.endRange = value;\n },\n\n /**\n * refresh the HTML\n */\n draw: function(force)\n {\n if (!this._v && !force) {\n return;\n }\n var opts = this._o,\n minYear = opts.minYear,\n maxYear = opts.maxYear,\n minMonth = opts.minMonth,\n maxMonth = opts.maxMonth,\n html = '',\n randId;\n\n if (this._y <= minYear) {\n this._y = minYear;\n if (!isNaN(minMonth) && this._m < minMonth) {\n this._m = minMonth;\n }\n }\n if (this._y >= maxYear) {\n this._y = maxYear;\n if (!isNaN(maxMonth) && this._m > maxMonth) {\n this._m = maxMonth;\n }\n }\n\n randId = 'pika-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2);\n\n for (var c = 0; c < opts.numberOfMonths; c++) {\n html += '
    ' + renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId) + '
    ';\n }\n\n this.el.innerHTML = html;\n\n if (opts.bound) {\n if(opts.field.type !== 'hidden') {\n sto(function() {\n opts.trigger.focus();\n }, 1);\n }\n }\n\n if (typeof this._o.onDraw === 'function') {\n this._o.onDraw(this);\n }\n\n if (opts.bound) {\n // let the screen reader user know to use arrow keys\n opts.field.setAttribute('aria-label', 'Use the arrow keys to pick a date');\n }\n },\n\n adjustPosition: function()\n {\n var field, pEl, width, height, viewportWidth, viewportHeight, scrollTop, left, top, clientRect;\n\n if (this._o.container) return;\n\n this.el.style.position = 'absolute';\n\n field = this._o.trigger;\n pEl = field;\n width = this.el.offsetWidth;\n height = this.el.offsetHeight;\n viewportWidth = window.innerWidth || document.documentElement.clientWidth;\n viewportHeight = window.innerHeight || document.documentElement.clientHeight;\n scrollTop = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;\n\n if (typeof field.getBoundingClientRect === 'function') {\n clientRect = field.getBoundingClientRect();\n left = clientRect.left + window.pageXOffset;\n top = clientRect.bottom + window.pageYOffset;\n } else {\n left = pEl.offsetLeft;\n top = pEl.offsetTop + pEl.offsetHeight;\n while((pEl = pEl.offsetParent)) {\n left += pEl.offsetLeft;\n top += pEl.offsetTop;\n }\n }\n\n // default position is bottom & left\n if ((this._o.reposition && left + width > viewportWidth) ||\n (\n this._o.position.indexOf('right') > -1 &&\n left - width + field.offsetWidth > 0\n )\n ) {\n left = left - width + field.offsetWidth;\n }\n if ((this._o.reposition && top + height > viewportHeight + scrollTop) ||\n (\n this._o.position.indexOf('top') > -1 &&\n top - height - field.offsetHeight > 0\n )\n ) {\n top = top - height - field.offsetHeight;\n }\n\n this.el.style.left = left + 'px';\n this.el.style.top = top + 'px';\n },\n\n /**\n * render HTML for a particular month\n */\n render: function(year, month, randId)\n {\n var opts = this._o,\n now = new Date(),\n days = getDaysInMonth(year, month),\n before = new Date(year, month, 1).getDay(),\n data = [],\n row = [];\n setToStartOfDay(now);\n if (opts.firstDay > 0) {\n before -= opts.firstDay;\n if (before < 0) {\n before += 7;\n }\n }\n var previousMonth = month === 0 ? 11 : month - 1,\n nextMonth = month === 11 ? 0 : month + 1,\n yearOfPreviousMonth = month === 0 ? year - 1 : year,\n yearOfNextMonth = month === 11 ? year + 1 : year,\n daysInPreviousMonth = getDaysInMonth(yearOfPreviousMonth, previousMonth);\n var cells = days + before,\n after = cells;\n while(after > 7) {\n after -= 7;\n }\n cells += 7 - after;\n var isWeekSelected = false;\n for (var i = 0, r = 0; i < cells; i++)\n {\n var day = new Date(year, month, 1 + (i - before)),\n isSelected = isDate(this._d) ? compareDates(day, this._d) : false,\n isToday = compareDates(day, now),\n hasEvent = opts.events.indexOf(day.toDateString()) !== -1 ? true : false,\n isEmpty = i < before || i >= (days + before),\n dayNumber = 1 + (i - before),\n monthNumber = month,\n yearNumber = year,\n isStartRange = opts.startRange && compareDates(opts.startRange, day),\n isEndRange = opts.endRange && compareDates(opts.endRange, day),\n isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange,\n isDisabled = (opts.minDate && day < opts.minDate) ||\n (opts.maxDate && day > opts.maxDate) ||\n (opts.disableWeekends && isWeekend(day)) ||\n (opts.disableDayFn && opts.disableDayFn(day));\n\n if (isEmpty) {\n if (i < before) {\n dayNumber = daysInPreviousMonth + dayNumber;\n monthNumber = previousMonth;\n yearNumber = yearOfPreviousMonth;\n } else {\n dayNumber = dayNumber - days;\n monthNumber = nextMonth;\n yearNumber = yearOfNextMonth;\n }\n }\n\n var dayConfig = {\n day: dayNumber,\n month: monthNumber,\n year: yearNumber,\n hasEvent: hasEvent,\n isSelected: isSelected,\n isToday: isToday,\n isDisabled: isDisabled,\n isEmpty: isEmpty,\n isStartRange: isStartRange,\n isEndRange: isEndRange,\n isInRange: isInRange,\n showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths,\n enableSelectionDaysInNextAndPreviousMonths: opts.enableSelectionDaysInNextAndPreviousMonths\n };\n\n if (opts.pickWholeWeek && isSelected) {\n isWeekSelected = true;\n }\n\n row.push(renderDay(dayConfig));\n\n if (++r === 7) {\n if (opts.showWeekNumber) {\n row.unshift(renderWeek(i - before, month, year));\n }\n data.push(renderRow(row, opts.isRTL, opts.pickWholeWeek, isWeekSelected));\n row = [];\n r = 0;\n isWeekSelected = false;\n }\n }\n return renderTable(opts, data, randId);\n },\n\n isVisible: function()\n {\n return this._v;\n },\n\n show: function()\n {\n if (!this.isVisible()) {\n this._v = true;\n this.draw();\n removeClass(this.el, 'is-hidden');\n if (this._o.bound) {\n addEvent(document, 'click', this._onClick);\n this.adjustPosition();\n }\n if (typeof this._o.onOpen === 'function') {\n this._o.onOpen.call(this);\n }\n }\n },\n\n hide: function()\n {\n var v = this._v;\n if (v !== false) {\n if (this._o.bound) {\n removeEvent(document, 'click', this._onClick);\n }\n this.el.style.position = 'static'; // reset\n this.el.style.left = 'auto';\n this.el.style.top = 'auto';\n addClass(this.el, 'is-hidden');\n this._v = false;\n if (v !== undefined && typeof this._o.onClose === 'function') {\n this._o.onClose.call(this);\n }\n }\n },\n\n /**\n * GAME OVER\n */\n destroy: function()\n {\n this.hide();\n removeEvent(this.el, 'mousedown', this._onMouseDown, true);\n removeEvent(this.el, 'touchend', this._onMouseDown, true);\n removeEvent(this.el, 'change', this._onChange);\n removeEvent(document, 'keydown', this._onKeyChange);\n if (this._o.field) {\n removeEvent(this._o.field, 'change', this._onInputChange);\n if (this._o.bound) {\n removeEvent(this._o.trigger, 'click', this._onInputClick);\n removeEvent(this._o.trigger, 'focus', this._onInputFocus);\n removeEvent(this._o.trigger, 'blur', this._onInputBlur);\n }\n }\n if (this.el.parentNode) {\n this.el.parentNode.removeChild(this.el);\n }\n }\n\n };\n\n return Pikaday;\n\n}));\n", "/*\n * Remodal - v1.1.1\n * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.\n * http://vodkabears.github.io/remodal/\n *\n * Made by Ilya Makarov\n * Under MIT License\n */\n\n!(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n define(['jquery'], function($) {\n return factory(root, $);\n });\n } else if (typeof exports === 'object') {\n factory(root, (typeof window !== \"undefined\" ? window['jQuery'] : typeof global !== \"undefined\" ? global['jQuery'] : null));\n } else {\n factory(root, root.jQuery || root.Zepto);\n }\n})(this, function(global, $) {\n\n 'use strict';\n\n /**\n * Name of the plugin\n * @private\n * @const\n * @type {String}\n */\n var PLUGIN_NAME = 'remodal';\n\n /**\n * Namespace for CSS and events\n * @private\n * @const\n * @type {String}\n */\n var NAMESPACE = global.REMODAL_GLOBALS && global.REMODAL_GLOBALS.NAMESPACE || PLUGIN_NAME;\n\n /**\n * Animationstart event with vendor prefixes\n * @private\n * @const\n * @type {String}\n */\n var ANIMATIONSTART_EVENTS = $.map(\n ['animationstart', 'webkitAnimationStart', 'MSAnimationStart', 'oAnimationStart'],\n\n function(eventName) {\n return eventName + '.' + NAMESPACE;\n }\n\n ).join(' ');\n\n /**\n * Animationend event with vendor prefixes\n * @private\n * @const\n * @type {String}\n */\n var ANIMATIONEND_EVENTS = $.map(\n ['animationend', 'webkitAnimationEnd', 'MSAnimationEnd', 'oAnimationEnd'],\n\n function(eventName) {\n return eventName + '.' + NAMESPACE;\n }\n\n ).join(' ');\n\n /**\n * Default settings\n * @private\n * @const\n * @type {Object}\n */\n var DEFAULTS = $.extend({\n hashTracking: true,\n closeOnConfirm: true,\n closeOnCancel: true,\n closeOnEscape: true,\n closeOnOutsideClick: true,\n modifier: '',\n appendTo: null\n }, global.REMODAL_GLOBALS && global.REMODAL_GLOBALS.DEFAULTS);\n\n /**\n * States of the Remodal\n * @private\n * @const\n * @enum {String}\n */\n var STATES = {\n CLOSING: 'closing',\n CLOSED: 'closed',\n OPENING: 'opening',\n OPENED: 'opened'\n };\n\n /**\n * Reasons of the state change.\n * @private\n * @const\n * @enum {String}\n */\n var STATE_CHANGE_REASONS = {\n CONFIRMATION: 'confirmation',\n CANCELLATION: 'cancellation'\n };\n\n /**\n * Is animation supported?\n * @private\n * @const\n * @type {Boolean}\n */\n var IS_ANIMATION = (function() {\n var style = document.createElement('div').style;\n\n return style.animationName !== undefined ||\n style.WebkitAnimationName !== undefined ||\n style.MozAnimationName !== undefined ||\n style.msAnimationName !== undefined ||\n style.OAnimationName !== undefined;\n })();\n\n /**\n * Is iOS?\n * @private\n * @const\n * @type {Boolean}\n */\n var IS_IOS = /iPad|iPhone|iPod/.test(navigator.platform);\n\n /**\n * Current modal\n * @private\n * @type {Remodal}\n */\n var current;\n\n /**\n * Scrollbar position\n * @private\n * @type {Number}\n */\n var scrollTop;\n\n /**\n * Returns an animation duration\n * @private\n * @param {jQuery} $elem\n * @returns {Number}\n */\n function getAnimationDuration($elem) {\n if (\n IS_ANIMATION &&\n $elem.css('animation-name') === 'none' &&\n $elem.css('-webkit-animation-name') === 'none' &&\n $elem.css('-moz-animation-name') === 'none' &&\n $elem.css('-o-animation-name') === 'none' &&\n $elem.css('-ms-animation-name') === 'none'\n ) {\n return 0;\n }\n\n var duration = $elem.css('animation-duration') ||\n $elem.css('-webkit-animation-duration') ||\n $elem.css('-moz-animation-duration') ||\n $elem.css('-o-animation-duration') ||\n $elem.css('-ms-animation-duration') ||\n '0s';\n\n var delay = $elem.css('animation-delay') ||\n $elem.css('-webkit-animation-delay') ||\n $elem.css('-moz-animation-delay') ||\n $elem.css('-o-animation-delay') ||\n $elem.css('-ms-animation-delay') ||\n '0s';\n\n var iterationCount = $elem.css('animation-iteration-count') ||\n $elem.css('-webkit-animation-iteration-count') ||\n $elem.css('-moz-animation-iteration-count') ||\n $elem.css('-o-animation-iteration-count') ||\n $elem.css('-ms-animation-iteration-count') ||\n '1';\n\n var max;\n var len;\n var num;\n var i;\n\n duration = duration.split(', ');\n delay = delay.split(', ');\n iterationCount = iterationCount.split(', ');\n\n // The 'duration' size is the same as the 'delay' size\n for (i = 0, len = duration.length, max = Number.NEGATIVE_INFINITY; i < len; i++) {\n num = parseFloat(duration[i]) * parseInt(iterationCount[i], 10) + parseFloat(delay[i]);\n\n if (num > max) {\n max = num;\n }\n }\n\n return max;\n }\n\n /**\n * Returns a scrollbar width\n * @private\n * @returns {Number}\n */\n function getScrollbarWidth() {\n if ($(document).height() <= $(window).height()) {\n return 0;\n }\n\n var outer = document.createElement('div');\n var inner = document.createElement('div');\n var widthNoScroll;\n var widthWithScroll;\n\n outer.style.visibility = 'hidden';\n outer.style.width = '100px';\n document.body.appendChild(outer);\n\n widthNoScroll = outer.offsetWidth;\n\n // Force scrollbars\n outer.style.overflow = 'scroll';\n\n // Add inner div\n inner.style.width = '100%';\n outer.appendChild(inner);\n\n widthWithScroll = inner.offsetWidth;\n\n // Remove divs\n outer.parentNode.removeChild(outer);\n\n return widthNoScroll - widthWithScroll;\n }\n\n /**\n * Locks the screen\n * @private\n */\n function lockScreen() {\n if (IS_IOS) {\n return;\n }\n\n var $html = $('html');\n var lockedClass = namespacify('is-locked');\n var paddingRight;\n var $body;\n\n if (!$html.hasClass(lockedClass)) {\n $body = $(document.body);\n\n // Zepto does not support '-=', '+=' in the `css` method\n paddingRight = parseInt($body.css('padding-right'), 10) + getScrollbarWidth();\n\n $body.css('padding-right', paddingRight + 'px');\n $html.addClass(lockedClass);\n }\n }\n\n /**\n * Unlocks the screen\n * @private\n */\n function unlockScreen() {\n if (IS_IOS) {\n return;\n }\n\n var $html = $('html');\n var lockedClass = namespacify('is-locked');\n var paddingRight;\n var $body;\n\n if ($html.hasClass(lockedClass)) {\n $body = $(document.body);\n\n // Zepto does not support '-=', '+=' in the `css` method\n paddingRight = parseInt($body.css('padding-right'), 10) - getScrollbarWidth();\n\n $body.css('padding-right', paddingRight + 'px');\n $html.removeClass(lockedClass);\n }\n }\n\n /**\n * Sets a state for an instance\n * @private\n * @param {Remodal} instance\n * @param {STATES} state\n * @param {Boolean} isSilent If true, Remodal does not trigger events\n * @param {String} Reason of a state change.\n */\n function setState(instance, state, isSilent, reason) {\n\n var newState = namespacify('is', state);\n var allStates = [namespacify('is', STATES.CLOSING),\n namespacify('is', STATES.OPENING),\n namespacify('is', STATES.CLOSED),\n namespacify('is', STATES.OPENED)].join(' ');\n\n instance.$bg\n .removeClass(allStates)\n .addClass(newState);\n\n instance.$overlay\n .removeClass(allStates)\n .addClass(newState);\n\n instance.$wrapper\n .removeClass(allStates)\n .addClass(newState);\n\n instance.$modal\n .removeClass(allStates)\n .addClass(newState);\n\n instance.state = state;\n !isSilent && instance.$modal.trigger({\n type: state,\n reason: reason\n }, [{ reason: reason }]);\n }\n\n /**\n * Synchronizes with the animation\n * @param {Function} doBeforeAnimation\n * @param {Function} doAfterAnimation\n * @param {Remodal} instance\n */\n function syncWithAnimation(doBeforeAnimation, doAfterAnimation, instance) {\n var runningAnimationsCount = 0;\n\n var handleAnimationStart = function(e) {\n if (e.target !== this) {\n return;\n }\n\n runningAnimationsCount++;\n };\n\n var handleAnimationEnd = function(e) {\n if (e.target !== this) {\n return;\n }\n\n if (--runningAnimationsCount === 0) {\n\n // Remove event listeners\n $.each(['$bg', '$overlay', '$wrapper', '$modal'], function(index, elemName) {\n instance[elemName].off(ANIMATIONSTART_EVENTS + ' ' + ANIMATIONEND_EVENTS);\n });\n\n doAfterAnimation();\n }\n };\n\n $.each(['$bg', '$overlay', '$wrapper', '$modal'], function(index, elemName) {\n instance[elemName]\n .on(ANIMATIONSTART_EVENTS, handleAnimationStart)\n .on(ANIMATIONEND_EVENTS, handleAnimationEnd);\n });\n\n doBeforeAnimation();\n\n // If the animation is not supported by a browser or its duration is 0\n if (\n getAnimationDuration(instance.$bg) === 0 &&\n getAnimationDuration(instance.$overlay) === 0 &&\n getAnimationDuration(instance.$wrapper) === 0 &&\n getAnimationDuration(instance.$modal) === 0\n ) {\n\n // Remove event listeners\n $.each(['$bg', '$overlay', '$wrapper', '$modal'], function(index, elemName) {\n instance[elemName].off(ANIMATIONSTART_EVENTS + ' ' + ANIMATIONEND_EVENTS);\n });\n\n doAfterAnimation();\n }\n }\n\n /**\n * Closes immediately\n * @private\n * @param {Remodal} instance\n */\n function halt(instance) {\n if (instance.state === STATES.CLOSED) {\n return;\n }\n\n $.each(['$bg', '$overlay', '$wrapper', '$modal'], function(index, elemName) {\n instance[elemName].off(ANIMATIONSTART_EVENTS + ' ' + ANIMATIONEND_EVENTS);\n });\n\n instance.$bg.removeClass(instance.settings.modifier);\n instance.$overlay.removeClass(instance.settings.modifier).hide();\n instance.$wrapper.hide();\n unlockScreen();\n setState(instance, STATES.CLOSED, true);\n }\n\n /**\n * Parses a string with options\n * @private\n * @param str\n * @returns {Object}\n */\n function parseOptions(str) {\n var obj = {};\n var arr;\n var len;\n var val;\n var i;\n\n // Remove spaces before and after delimiters\n str = str.replace(/\\s*:\\s*/g, ':').replace(/\\s*,\\s*/g, ',');\n\n // Parse a string\n arr = str.split(',');\n for (i = 0, len = arr.length; i < len; i++) {\n arr[i] = arr[i].split(':');\n val = arr[i][1];\n\n // Convert a string value if it is like a boolean\n if (typeof val === 'string' || val instanceof String) {\n val = val === 'true' || (val === 'false' ? false : val);\n }\n\n // Convert a string value if it is like a number\n if (typeof val === 'string' || val instanceof String) {\n val = !isNaN(val) ? +val : val;\n }\n\n obj[arr[i][0]] = val;\n }\n\n return obj;\n }\n\n /**\n * Generates a string separated by dashes and prefixed with NAMESPACE\n * @private\n * @param {...String}\n * @returns {String}\n */\n function namespacify() {\n var result = NAMESPACE;\n\n for (var i = 0; i < arguments.length; ++i) {\n result += '-' + arguments[i];\n }\n\n return result;\n }\n\n /**\n * Handles the hashchange event\n * @private\n * @listens hashchange\n */\n function handleHashChangeEvent() {\n var id = location.hash.replace('#', '');\n var instance;\n var $elem;\n\n if (!id) {\n\n // Check if we have currently opened modal and animation was completed\n if (current && current.state === STATES.OPENED && current.settings.hashTracking) {\n current.close();\n }\n } else {\n\n // Catch syntax error if your hash is bad\n try {\n $elem = $(\n '[data-' + PLUGIN_NAME + '-id=\"' + id + '\"]'\n );\n } catch (err) {}\n\n if ($elem && $elem.length) {\n instance = $[PLUGIN_NAME].lookup[$elem.data(PLUGIN_NAME)];\n\n if (instance && instance.settings.hashTracking) {\n instance.open();\n }\n }\n\n }\n }\n\n /**\n * Remodal constructor\n * @constructor\n * @param {jQuery} $modal\n * @param {Object} options\n */\n function Remodal($modal, options) {\n var $body = $(document.body);\n var $appendTo = $body;\n var remodal = this;\n\n remodal.settings = $.extend({}, DEFAULTS, options);\n remodal.index = $[PLUGIN_NAME].lookup.push(remodal) - 1;\n remodal.state = STATES.CLOSED;\n\n remodal.$overlay = $('.' + namespacify('overlay'));\n\n if (remodal.settings.appendTo !== null && remodal.settings.appendTo.length) {\n $appendTo = $(remodal.settings.appendTo);\n }\n\n if (!remodal.$overlay.length) {\n remodal.$overlay = $('
    ').addClass(namespacify('overlay') + ' ' + namespacify('is', STATES.CLOSED)).hide();\n $appendTo.append(remodal.$overlay);\n }\n\n remodal.$bg = $('.' + namespacify('bg')).addClass(namespacify('is', STATES.CLOSED));\n\n remodal.$modal = $modal\n .addClass(\n NAMESPACE + ' ' +\n namespacify('is-initialized') + ' ' +\n remodal.settings.modifier + ' ' +\n namespacify('is', STATES.CLOSED))\n .attr('tabindex', '-1');\n\n remodal.$wrapper = $('
    ')\n .addClass(\n namespacify('wrapper') + ' ' +\n remodal.settings.modifier + ' ' +\n namespacify('is', STATES.CLOSED))\n .hide()\n .append(remodal.$modal);\n $appendTo.append(remodal.$wrapper);\n\n // Add the event listener for the close button\n remodal.$wrapper.on('click.' + NAMESPACE, '[data-' + PLUGIN_NAME + '-action=\"close\"]', function(e) {\n e.preventDefault();\n\n remodal.close();\n });\n\n // Add the event listener for the cancel button\n remodal.$wrapper.on('click.' + NAMESPACE, '[data-' + PLUGIN_NAME + '-action=\"cancel\"]', function(e) {\n e.preventDefault();\n\n remodal.$modal.trigger(STATE_CHANGE_REASONS.CANCELLATION);\n\n if (remodal.settings.closeOnCancel) {\n remodal.close(STATE_CHANGE_REASONS.CANCELLATION);\n }\n });\n\n // Add the event listener for the confirm button\n remodal.$wrapper.on('click.' + NAMESPACE, '[data-' + PLUGIN_NAME + '-action=\"confirm\"]', function(e) {\n e.preventDefault();\n\n remodal.$modal.trigger(STATE_CHANGE_REASONS.CONFIRMATION);\n\n if (remodal.settings.closeOnConfirm) {\n remodal.close(STATE_CHANGE_REASONS.CONFIRMATION);\n }\n });\n\n // Add the event listener for the overlay\n remodal.$wrapper.on('click.' + NAMESPACE, function(e) {\n var $target = $(e.target);\n\n if (!$target.hasClass(namespacify('wrapper'))) {\n return;\n }\n\n if (remodal.settings.closeOnOutsideClick) {\n remodal.close();\n }\n });\n }\n\n /**\n * Opens a modal window\n * @public\n */\n Remodal.prototype.open = function() {\n var remodal = this;\n var id;\n\n // Check if the animation was completed\n if (remodal.state === STATES.OPENING || remodal.state === STATES.CLOSING) {\n return;\n }\n\n id = remodal.$modal.attr('data-' + PLUGIN_NAME + '-id');\n\n if (id && remodal.settings.hashTracking) {\n scrollTop = $(window).scrollTop();\n location.hash = id;\n }\n\n if (current && current !== remodal) {\n halt(current);\n }\n\n current = remodal;\n lockScreen();\n remodal.$bg.addClass(remodal.settings.modifier);\n remodal.$overlay.addClass(remodal.settings.modifier).show();\n remodal.$wrapper.show().scrollTop(0);\n remodal.$modal.focus();\n\n syncWithAnimation(\n function() {\n setState(remodal, STATES.OPENING);\n },\n\n function() {\n setState(remodal, STATES.OPENED);\n },\n\n remodal);\n };\n\n /**\n * Closes a modal window\n * @public\n * @param {String} reason\n */\n Remodal.prototype.close = function(reason) {\n var remodal = this;\n\n // Check if the animation was completed\n if (remodal.state === STATES.OPENING || remodal.state === STATES.CLOSING || remodal.state === STATES.CLOSED) {\n return;\n }\n\n if (\n remodal.settings.hashTracking &&\n remodal.$modal.attr('data-' + PLUGIN_NAME + '-id') === location.hash.substr(1)\n ) {\n location.hash = '';\n $(window).scrollTop(scrollTop);\n }\n\n syncWithAnimation(\n function() {\n setState(remodal, STATES.CLOSING, false, reason);\n },\n\n function() {\n remodal.$bg.removeClass(remodal.settings.modifier);\n remodal.$overlay.removeClass(remodal.settings.modifier).hide();\n remodal.$wrapper.hide();\n unlockScreen();\n\n setState(remodal, STATES.CLOSED, false, reason);\n },\n\n remodal);\n };\n\n /**\n * Returns a current state of a modal\n * @public\n * @returns {STATES}\n */\n Remodal.prototype.getState = function() {\n return this.state;\n };\n\n /**\n * Destroys a modal\n * @public\n */\n Remodal.prototype.destroy = function() {\n var lookup = $[PLUGIN_NAME].lookup;\n var instanceCount;\n\n halt(this);\n this.$wrapper.remove();\n\n delete lookup[this.index];\n instanceCount = $.grep(lookup, function(instance) {\n return !!instance;\n }).length;\n\n if (instanceCount === 0) {\n this.$overlay.remove();\n this.$bg.removeClass(\n namespacify('is', STATES.CLOSING) + ' ' +\n namespacify('is', STATES.OPENING) + ' ' +\n namespacify('is', STATES.CLOSED) + ' ' +\n namespacify('is', STATES.OPENED));\n }\n };\n\n /**\n * Special plugin object for instances\n * @public\n * @type {Object}\n */\n $[PLUGIN_NAME] = {\n lookup: []\n };\n\n /**\n * Plugin constructor\n * @constructor\n * @param {Object} options\n * @returns {JQuery}\n */\n $.fn[PLUGIN_NAME] = function(opts) {\n var instance;\n var $elem;\n\n this.each(function(index, elem) {\n $elem = $(elem);\n\n if ($elem.data(PLUGIN_NAME) == null) {\n instance = new Remodal($elem, opts);\n $elem.data(PLUGIN_NAME, instance.index);\n\n if (\n instance.settings.hashTracking &&\n $elem.attr('data-' + PLUGIN_NAME + '-id') === location.hash.substr(1)\n ) {\n instance.open();\n }\n } else {\n instance = $[PLUGIN_NAME].lookup[$elem.data(PLUGIN_NAME)];\n }\n });\n\n return instance;\n };\n\n $(document).ready(function() {\n\n // data-remodal-target opens a modal window with the special Id\n $(document).on('click', '[data-' + PLUGIN_NAME + '-target]', function(e) {\n e.preventDefault();\n\n var elem = e.currentTarget;\n var id = elem.getAttribute('data-' + PLUGIN_NAME + '-target');\n var $target = $('[data-' + PLUGIN_NAME + '-id=\"' + id + '\"]');\n\n $[PLUGIN_NAME].lookup[$target.data(PLUGIN_NAME)].open();\n });\n\n // Auto initialization of modal windows\n // They should have the 'remodal' class attribute\n // Also you can write the `data-remodal-options` attribute to pass params into the modal\n $(document).find('.' + NAMESPACE).each(function(i, container) {\n var $container = $(container);\n var options = $container.data(PLUGIN_NAME + '-options');\n\n if (!options) {\n options = {};\n } else if (typeof options === 'string' || options instanceof String) {\n options = parseOptions(options);\n }\n\n $container[PLUGIN_NAME](options);\n });\n\n // Handles the keydown event\n $(document).on('keydown.' + NAMESPACE, function(e) {\n if (current && current.settings.closeOnEscape && current.state === STATES.OPENED && e.keyCode === 27) {\n current.close();\n }\n });\n\n // Handles the hashchange event\n $(window).on('hashchange.' + NAMESPACE, handleHashChangeEvent);\n });\n});\n" ] }