From f140bafedd5ff4fcc210727697eccfabf01ed2f7 Mon Sep 17 00:00:00 2001 From: Daniel Tonon Date: Tue, 16 Jul 2019 21:54:45 +1000 Subject: [PATCH 1/2] #3 - Removing prevent_user_select function Preventing user select is actually cusing a worse UX in Safari and Firefox. Removing it improves the funcitonality. --- core/helpers/prevent_user_select.js | 7 ------- index.js | 3 --- 2 files changed, 10 deletions(-) delete mode 100644 core/helpers/prevent_user_select.js diff --git a/core/helpers/prevent_user_select.js b/core/helpers/prevent_user_select.js deleted file mode 100644 index c6744b9..0000000 --- a/core/helpers/prevent_user_select.js +++ /dev/null @@ -1,7 +0,0 @@ - -module.exports = function prevent_user_select ($input) { - $input.style.msUserSelect = "none"; - $input.style.mozUserSelect = "none"; - $input.style.webkitUserSelect = "none"; - $input.style.userSelect = "none"; -} diff --git a/index.js b/index.js index a79c242..d377ff3 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,4 @@ -var prevent_user_select = require('./core/helpers/prevent_user_select'); var apply_default = require('./core/setters/apply_default'); var update_time = require('./core/setters/update_time'); var set_data_attribute = require('./core/setters/set_data_attribute'); @@ -16,8 +15,6 @@ function TimePolyfill($input) { $input.setAttribute('autocomplete','off'); - prevent_user_select($input); - // Prevent screen reader from announcing the default stuff $input.setAttribute('aria-hidden', true); From 915a40188d6fd9185dfa553ea78aba05da857061 Mon Sep 17 00:00:00 2001 From: Daniel Tonon Date: Tue, 16 Jul 2019 21:58:44 +1000 Subject: [PATCH 2/2] Bumping version to 1.0.6 (recompiling prod files) --- README.md | 12 ++++----- auto.js | 2 +- dist/time-input-polyfill.auto.min.js | 4 +-- dist/time-input-polyfill.auto.min.js.map | 2 +- dist/time-input-polyfill.min.js | 4 +-- dist/time-input-polyfill.min.js.map | 2 +- docs/index.html | 6 ++--- docs/scripts/main.js | 2 +- docs/scripts/main.js.map | 2 +- package-lock.json | 34 ++++++++++++------------ package.json | 2 +- 11 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 1269b71..7f20dcf 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ An accessible polyfill for `` elements. Demo available here: https://dan503.github.io/time-input-polyfill/ -**Note:** If the recommended version in this documentation is out of sync with the npm version, this is because npm only allows readme edits to be committed through full releases. To prevent needless cache invalidation, I'll only update the recommended version number when there are actual changes to the polyfill code. The current recommended version is `1.0.5`. As long as you are using a version that is equal to or higher than that, you are using the latest version of the polyfill. +**Note:** If the recommended version in this documentation is out of sync with the npm version, this is because npm only allows readme edits to be committed through full releases. To prevent needless cache invalidation, I'll only update the recommended version number when there are actual changes to the polyfill code. The current recommended version is `1.0.6`. As long as you are using a version that is equal to or higher than that, you are using the latest version of the polyfill. ## Fastest and easiest way to implement Add the following script element to your page: ```html - + ``` Alternatively you can download it via npm and use it through commonJS or an ES6 import statement. @@ -47,7 +47,7 @@ You didn't load the actual polyfill onto the page, you loaded a much smaller aut 1. The initialiser checks if the browser supports `input[type="time"]` elements. 2. If it **does**, it skips the rest of the functionality. 3. If it does **not**, it will: - 1. load `https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.5/dist/time-input-polyfill.min.js` (the actual polyfill). + 1. load `https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.6/dist/time-input-polyfill.min.js` (the actual polyfill). 2. Collect all existing `input[type="time"]` elements on the page. 3. Loop through each `input[type="time"]` element and apply the polyfill to it. @@ -90,7 +90,7 @@ if (!supportsTime) { First check for `input[type="time"]` support. ```html - + ``` ```js if (!supportsTime) { @@ -101,8 +101,8 @@ if (!supportsTime) { Then gather a list of all `input[type="time"]` elements on the page, and loop through them to apply the polyfill. ```html - - + + ``` ```js if (!supportsTime) { diff --git a/auto.js b/auto.js index 0d7363e..d2ea438 100644 --- a/auto.js +++ b/auto.js @@ -4,7 +4,7 @@ var loadJS = require('./core/helpers/loadJS'); document.addEventListener("DOMContentLoaded", function() { if (!supports_time) { - loadJS('https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.5/dist/time-input-polyfill.min.js', function(){ + loadJS('https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.6/dist/time-input-polyfill.min.js', function(){ var $inputs = [].slice.call(document.querySelectorAll('input[type="time"]')); $inputs.forEach(function($input) { new TimePolyfill($input); diff --git a/dist/time-input-polyfill.auto.min.js b/dist/time-input-polyfill.auto.min.js index c40dae7..49cac29 100644 --- a/dist/time-input-polyfill.auto.min.js +++ b/dist/time-input-polyfill.auto.min.js @@ -3,7 +3,7 @@ // If not supported, it will load the real polyfill, then apply it to all input[type=time] elements. // The actual polyfill is found here: -// https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.5/dist/time-input-polyfill.min.js +// https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.6/dist/time-input-polyfill.min.js -!function(){function e(t,r,n){function o(u,c){if(!r[u]){if(!t[u]){var l="function"==typeof require&&require;if(!c&&l)return l(u,!0);if(i)return i(u,!0);var p=new Error("Cannot find module '"+u+"'");throw p.code="MODULE_NOT_FOUND",p}var a=r[u]={exports:{}};t[u][0].call(a.exports,function(e){var r=t[u][1][e];return o(r||e)},a,a.exports,e,t,r,n)}return r[u].exports}for(var i="function"==typeof require&&require,u=0;u"+l.join("

")+"

";v=v.replace(/\$label/g,e.polyfill.label),v=v.replace(/\$segmentName/g,c),v=v.replace(/\$segmentValue/g,i),v=v.replace(/\$fullValue/g,_),e.polyfill.$a11y.innerHTML=v},1)}},{"../getters/get_current_segment":14,"../getters/get_values":17}],3:[function(e,t,r){t.exports=function(e){return e<=12?0===e?12:e:e-12}},{}],4:[function(e,t,r){t.exports=function(e){return isNaN(e)?e:parseInt(e)}},{}],5:[function(e,t,r){var n=e("./convert_number"),s=e("./convert_hours_to_12hr_time"),a=e("./leading_zero");t.exports=function(e){if(""===e)return"--:-- --";var t=/([0-9]{2})\:([0-9]{2})/,r=t.exec(e),o=n(r[1]),i=r[2],c=s(o),u=o>12,l=u?"PM":"AM";return[a(c),":",i," ",l].join("")}},{"./convert_hours_to_12hr_time":3,"./convert_number":4,"./leading_zero":7}],6:[function(e,t,r){var n=e("./leading_zero");t.exports=function(e){if(/-/.test(e))return"";var t,r=e.indexOf("PM")>-1,s=/^([0-9]{2})/.exec(e),a=s?parseInt(s[1]):"";t=12===a?r?12:0:r?a+12:a;var o=24===t?0:t,i=/^[0-9]{2}:([0-9]{2}) (AM|PM)/;return e.replace(i,n(o)+":$1")}},{"./leading_zero":7}],7:[function(e,t,r){t.exports=function(e){if(isNaN(e))return e;var t=parseInt(e);return t<10?"0"+t:e}},{}],8:[function(e,t,r){function n(e){e.polyfill.autoSwap&&(p(e,24),setTimeout(function(){p(e,12)},1))}var s=e("../helpers/values"),a=e("../selectors/select_segment"),o=e("../selectors/next_segment"),i=e("../selectors/prev_segment"),c=e("../selectors/select_cursor_segment"),u=e("../getters/get_current_segment"),l=e("../setters/reset"),_=e("../setters/manual_number_entry"),v=e("../setters/clear_segment"),f=e("../setters/increment_current_segment"),g=e("../setters/decrement_current_segment"),m=e("../setters/set_mode"),p=e("../setters/switch_times"),d=e("../events/handle_tab"),h=e("../static-values/all_number_keys"),b=e("../static-values/named_keys"),x=e("../accessibility/update_a11y");t.exports=function(e){var t="",r=!1;document.addEventListener("keydown",function(e){r=e.shiftKey}),document.addEventListener("keyup",function(e){r=e.shiftKey}),e.form&&e.form.addEventListener("submit",function(){n(e)});var p=!1;e.addEventListener("mousedown",function(){p=!0}),e.addEventListener("mouseup",function(){setTimeout(function(){""===e.value&&l(e)},1)}),e.addEventListener("click",function(t){c(e)}),e.addEventListener("blur",function(){var r=e.dataset.value;r!==t&&(t=r),p=!1}),e.addEventListener("focus",function(t){if(!p){t.preventDefault();var n=r?"mode":"hrs";a(e,n)}x(e,["initial","select"])}),e.addEventListener("keydown",function(t){var r=13===t.which;if(r)return!0;var n=h.indexOf(t.which)>-1,a=s(b).indexOf(t.which)>-1,c=[b.ArrowDown,b.ArrowRight,b.ArrowUp,b.ArrowLeft].indexOf(t.which)>-1,p=[b.a,b.p].indexOf(t.which)>-1,x=[b.Delete,b.Backspace].indexOf(t.which)>-1;if((!a||c||n||p||x)&&t.preventDefault(),n&&_(e,t.which),x){var y=u(e);v(e,y)}switch(t.which){case b.ArrowRight:o(e);break;case b.ArrowLeft:i(e);break;case b.ArrowUp:f(e);break;case b.ArrowDown:g(e);break;case b.Escape:l(e);break;case b.a:m(e,"AM");break;case b.p:m(e,"PM");break;case b.Tab:d(e,t)}})}},{"../accessibility/update_a11y":2,"../events/handle_tab":10,"../getters/get_current_segment":14,"../helpers/values":20,"../selectors/next_segment":21,"../selectors/prev_segment":22,"../selectors/select_cursor_segment":23,"../selectors/select_segment":24,"../setters/clear_segment":27,"../setters/decrement_current_segment":29,"../setters/increment_current_segment":31,"../setters/manual_number_entry":32,"../setters/reset":34,"../setters/set_mode":36,"../setters/switch_times":40,"../static-values/all_number_keys":43,"../static-values/named_keys":44}],9:[function(e,t,r){t.exports=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}},{}],10:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("../selectors/prev_segment"),a=e("../selectors/next_segment");t.exports=function(e,t){var r=n(e),o=t.shiftKey&&"hrs"===r,i=!t.shiftKey&&"mode"===r;o||i||(t.preventDefault(),t.shiftKey?s(e):a(e))}},{"../getters/get_current_segment":14,"../selectors/next_segment":21,"../selectors/prev_segment":22}],11:[function(e,t,r){var n=e("./trigger_event");t.exports=function(e){n(e,"input"),n(e,"change")}},{"./trigger_event":12}],12:[function(e,t,r){function n(e){return!/--/.test(e.value)}var s=e("./create_event"),a=s("input"),o=s("change");t.exports=function(e,t){var r={input:a,change:o}[t];n(e)&&e.dispatchEvent(r)}},{"./create_event":9}],13:[function(e,t,r){t.exports=function(e,t){for(var r=e,n=[];r;){n.push(r);var s=r.msMatchesSelector?r.msMatchesSelector(t):r.matches(t);if(s)return n;r=r.parentElement}return n}},{}],14:[function(e,t,r){var n=e("../static-values/ranges"),s=e("./get_selected_range");t.exports=function(e){var t=s(e);for(var r in n){var a=n[r],o=a.start<=t.start,i=a.end>=t.end;if(o&&i)return r}return"hrs"}},{"../static-values/ranges":45,"./get_selected_range":16}],15:[function(e,t,r){function n(e){var t=e.getAttribute("aria-labelledby");if(t){var r=document.getElementById(t);if(r)return r.textContent}return!1}function s(e){var t=e.getAttribute("aria-label");return!!t&&t}function a(e){if(e.id){var t=document.querySelector('label[for="'+e.id+'"]');if(t)return t.textContent}return!1}function o(e){var t=c(e,"label"),r=t[t.length-1];return"LABEL"==r.nodeName&&r.textContent}function i(e){var t=e.getAttribute("title");return!!t&&t}var c=e("./get_ancestors");t.exports=function(e){var t=n(e)||s(e)||a(e)||o(e)||i(e);if(t)return t;throw console.error("Label text for input not found.",e),new Error("Cannot polyfill time input due to a missing label.")}},{"./get_ancestors":13}],16:[function(e,t,r){t.exports=function(e){return{start:e.selectionStart,end:e.selectionEnd}}},{}],17:[function(e,t,r){var n=e("../converters/convert_number");t.exports=function(e,t){var r=t?t:e.value,s=/([0-9-]{1,2})\:([0-9-]{1,2})\s?(AM|PM|\-\-)?/,a=s.exec(r);return{hrs:n(a[1]),min:n(a[2]),mode:a[3]}}},{"../converters/convert_number":4}],18:[function(e,t,r){function n(){o=[]}function s(e){o.push(e)}function a(){return o}var o=[];t.exports={items:a,clear:n,add:s}},{}],19:[function(e,t,r){t.exports=function(e){e.style.msUserSelect="none",e.style.mozUserSelect="none",e.style.webkitUserSelect="none",e.style.userSelect="none"}},{}],20:[function(e,t,r){t.exports=function(e){var t=[];for(var r in e)t.push(e[r]);return t}},{}],21:[function(e,t,r){var n=e("./traverse");t.exports=function(e){n(e,"next")}},{"./traverse":25}],22:[function(e,t,r){var n=e("./traverse");t.exports=function(e){n(e,"prev")}},{"./traverse":25}],23:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("./select_segment");t.exports=function(e){var t=n(e);s(e,t)}},{"../getters/get_current_segment":14,"./select_segment":24}],24:[function(e,t,r){t.exports=function(e,t){function r(){var r="mode"===t?"text":"tel";e.setAttribute("type",r)}function n(t,r){return function(){e.setSelectionRange(t,r)}}r();var s={hrs:n(0,2),min:n(3,5),mode:n(6,8)};s[t](e)}},{}],25:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("../selectors/select_segment"),a=e("../helpers/manual_entry_log"),o=e("../static-values/segments"),i=e("../accessibility/update_a11y");t.exports=function(e,t){var r=n(e),c="next"===t?1:-1,u=o.indexOf(r)+c,l={next:o[u]||"mode",prev:u<0?"hrs":o[u]}[t];s(e,l),a.clear(),i(e,["select"])}},{"../accessibility/update_a11y":2,"../getters/get_current_segment":14,"../helpers/manual_entry_log":18,"../selectors/select_segment":24,"../static-values/segments":46}],26:[function(e,t,r){var n=e("../setters/set_data_attribute"),s=e("../events/trigger_both_events");t.exports=function(e){e.value="--:-- --",n(e,""),s(e)}},{"../events/trigger_both_events":11,"../setters/set_data_attribute":35}],27:[function(e,t,r){var n=e("./set_segment"),s=e("../accessibility/update_a11y");t.exports=function(e,t){n(e,t,"--"),s(e,["update"])}},{"../accessibility/update_a11y":2,"./set_segment":37}],28:[function(e,t,r){var n=e("./switch_mode"),s=e("./nudge_time_segment"),a=e("../accessibility/update_a11y");t.exports=function(e,t){"mode"===t?n(e,"PM"):s(e,t,"down"),a(e,["update"])}},{"../accessibility/update_a11y":2,"./nudge_time_segment":33,"./switch_mode":39}],29:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("../setters/decrement");t.exports=function(e){var t=n(e);s(e,t)}},{"../getters/get_current_segment":14,"../setters/decrement":28}],30:[function(e,t,r){var n=e("./switch_mode"),s=e("./nudge_time_segment"),a=e("../accessibility/update_a11y");t.exports=function(e,t){"mode"===t?n(e,"AM"):s(e,t,"up"),a(e,["update"])}},{"../accessibility/update_a11y":2,"./nudge_time_segment":33,"./switch_mode":39}],31:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("../setters/increment");t.exports=function(e){var t=n(e);s(e,t)}},{"../getters/get_current_segment":14,"../setters/increment":30}],32:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("./set_segment"),a=e("../selectors/next_segment"),o=e("../helpers/manual_entry_log"),i=e("../static-values/sorted_number_keys");t.exports=function(e,t){var r=i[t],c=n(e);if("mode"!==c){var u=o.items().length,l={hrs:[1,2],min:[5,9]},_=l[c][u];u<2&&o.add(r);var v=parseInt(l[c].join("")),f=parseInt(o.items().join(""));v>=f&&s(e,c,f);var g=r>_||2===o.items().length;g&&a(e)}}},{"../getters/get_current_segment":14,"../helpers/manual_entry_log":18,"../selectors/next_segment":21,"../static-values/sorted_number_keys":47,"./set_segment":37}],33:[function(e,t,r){var n=e("../getters/get_values"),s=e("../converters/convert_hours_to_12hr_time"),a=e("../converters/leading_zero"),o=e("./set_segment");t.exports=function(e,t,r){var i,c=n(e),u="up"===r?1:-1;if("--"===c[t]){var l=new Date;i={hrs:s(l.getHours()),min:l.getMinutes()}}else{var _={up:c.min<59?c.min+u:0,down:0===c.min?59:c.min+u};i={hrs:s(c.hrs+u),min:_[r]}}o(e,t,a(i[t]))}},{"../converters/convert_hours_to_12hr_time":3,"../converters/leading_zero":7,"../getters/get_values":17,"./set_segment":37}],34:[function(e,t,r){var n=e("./apply_default"),s=e("../selectors/select_segment");t.exports=function(e){n(e),s(e,"hrs")}},{"../selectors/select_segment":24,"./apply_default":26}],35:[function(e,t,r){var n=e("../converters/convert_to_24hr_time");t.exports=function(e,t){var r=t.indexOf("-")>-1?"":t,s=n(r);e.setAttribute("data-value",s)}},{"../converters/convert_to_24hr_time":6}],36:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("./set_segment");t.exports=function(e,t){var r=n(e);"mode"===r&&s(e,r,t)}},{"../getters/get_current_segment":14,"./set_segment":37}],37:[function(e,t,r){var n=e("../getters/get_values"),s=e("../converters/leading_zero"),a=e("../selectors/select_segment"),o=e("./set_data_attribute"),i=e("../events/trigger_both_events");t.exports=function(e,t,r){var c=n(e);c[t]=r;var u=[s(c.hrs),":",s(c.min)," ",c.mode].join("");e.value=u,a(e,t),o(e,u),i(e)}},{"../converters/leading_zero":7,"../events/trigger_both_events":11,"../getters/get_values":17,"../selectors/select_segment":24,"./set_data_attribute":35}],38:[function(e,t,r){var n=e("../converters/convert_to_12hr_time"),s=e("../setters/set_data_attribute");t.exports=function(e,t){var r=n(t);e.value=r,s(e,t)}},{"../converters/convert_to_12hr_time":5,"../setters/set_data_attribute":35}],39:[function(e,t,r){var n=e("../getters/get_values"),s=e("./set_segment");t.exports=function(e,t){t=t||"AM";var r=n(e).mode,a={"--":t,AM:"PM",PM:"AM"}[r];s(e,"mode",a)}},{"../getters/get_values":17,"./set_segment":37}],40:[function(e,t,r){var n=e("./switch_to_data_value"),s=e("./set_time");t.exports=function(e,t){var r=/\s/.test(e.value);12!=t&&24!=t&&(t=r?24:12);var a={12:function(){r||s(e,e.dataset.value)},24:function(){r&&n(e)}};a[t]()}},{"./set_time":38,"./switch_to_data_value":41}],41:[function(e,t,r){t.exports=function(e){var t=e.dataset.value;e.value=t}},{}],42:[function(e,t,r){var n=e("../setters/set_time");t.exports=function(e){return n(e,e.value),e}},{"../setters/set_time":38}],43:[function(e,t,r){var n=[48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105];t.exports=n},{}],44:[function(e,t,r){var n={ArrowDown:40,ArrowRight:39,ArrowUp:38,ArrowLeft:37,Backspace:8,Delete:46,Tab:9,Shift:16,Escape:27,a:65,p:80};t.exports=n},{}],45:[function(e,t,r){var n={hrs:{start:0,end:2},min:{start:3,end:5},mode:{start:6,end:8}};t.exports=n},{}],46:[function(e,t,r){var n=e("./ranges"),s=Object.keys(n);t.exports=s},{"./ranges":45}],47:[function(e,t,r){var n=e("./all_number_keys"),s={};n.forEach(function(e,t){var r=t>9?t-10:t;s[e]=r}),t.exports=s},{"./all_number_keys":43}],48:[function(e,t,r){function n(e){e.setAttribute("autocomplete","off"),a(e),e.setAttribute("aria-hidden",!0),f||(s=v(),f=!0);var t=_(e);e.polyfill={$a11y:s,label:t,autoSwap:!0,update:function(){i(e)},swap:function(t){l(e,t)}},""===e.value||/--/.test(e.value)?(o(e),c(e,"")):(i(e),c(e,e.value)),u(e)}var s,a=e("./core/helpers/prevent_user_select"),o=e("./core/setters/apply_default"),i=e("./core/setters/update_time"),c=e("./core/setters/set_data_attribute"),u=e("./core/events/bind_events"),l=e("./core/setters/switch_times"),_=e("./core/getters/get_label"),v=e("./core/accessibility/create_a11y_block"),f=!1;window&&(window.TimePolyfill=n),t&&(t.exports=n)},{"./core/accessibility/create_a11y_block":1,"./core/events/bind_events":8,"./core/getters/get_label":15,"./core/helpers/prevent_user_select":19,"./core/setters/apply_default":26,"./core/setters/set_data_attribute":35,"./core/setters/switch_times":40,"./core/setters/update_time":42}]},{},[48]); +!function(){function e(t,r,n){function s(o,i){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!i&&c)return c(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var _=r[o]={exports:{}};t[o][0].call(_.exports,function(e){var r=t[o][1][e];return s(r||e)},_,_.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o"+_.join("

")+"

";v=v.replace(/\$label/g,e.polyfill.label),v=v.replace(/\$segmentName/g,c),v=v.replace(/\$segmentValue/g,i),v=v.replace(/\$fullValue/g,l),e.polyfill.$a11y.innerHTML=v},1)}},{"../getters/get_current_segment":14,"../getters/get_values":17}],3:[function(e,t,r){t.exports=function(e){return e<=12?0===e?12:e:e-12}},{}],4:[function(e,t,r){t.exports=function(e){return isNaN(e)?e:parseInt(e)}},{}],5:[function(e,t,r){var n=e("./convert_number"),s=e("./convert_hours_to_12hr_time"),a=e("./leading_zero");t.exports=function(e){if(""===e)return"--:-- --";var t=/([0-9]{2})\:([0-9]{2})/,r=t.exec(e),o=n(r[1]),i=r[2],c=s(o),u=o>12,_=u?"PM":"AM";return[a(c),":",i," ",_].join("")}},{"./convert_hours_to_12hr_time":3,"./convert_number":4,"./leading_zero":7}],6:[function(e,t,r){var n=e("./leading_zero");t.exports=function(e){if(/-/.test(e))return"";var t,r=e.indexOf("PM")>-1,s=/^([0-9]{2})/.exec(e),a=s?parseInt(s[1]):"";t=12===a?r?12:0:r?a+12:a;var o=24===t?0:t,i=/^[0-9]{2}:([0-9]{2}) (AM|PM)/;return e.replace(i,n(o)+":$1")}},{"./leading_zero":7}],7:[function(e,t,r){t.exports=function(e){if(isNaN(e))return e;var t=parseInt(e);return t<10?"0"+t:e}},{}],8:[function(e,t,r){function n(e){e.polyfill.autoSwap&&(d(e,24),setTimeout(function(){d(e,12)},1))}var s=e("../helpers/values"),a=e("../selectors/select_segment"),o=e("../selectors/next_segment"),i=e("../selectors/prev_segment"),c=e("../selectors/select_cursor_segment"),u=e("../getters/get_current_segment"),_=e("../setters/reset"),l=e("../setters/manual_number_entry"),v=e("../setters/clear_segment"),f=e("../setters/increment_current_segment"),g=e("../setters/decrement_current_segment"),m=e("../setters/set_mode"),d=e("../setters/switch_times"),p=e("../events/handle_tab"),h=e("../static-values/all_number_keys"),b=e("../static-values/named_keys"),x=e("../accessibility/update_a11y");t.exports=function(e){var t="",r=!1;document.addEventListener("keydown",function(e){r=e.shiftKey}),document.addEventListener("keyup",function(e){r=e.shiftKey}),e.form&&e.form.addEventListener("submit",function(){n(e)});var d=!1;e.addEventListener("mousedown",function(){d=!0}),e.addEventListener("mouseup",function(){setTimeout(function(){""===e.value&&_(e)},1)}),e.addEventListener("click",function(t){c(e)}),e.addEventListener("blur",function(){var r=e.dataset.value;r!==t&&(t=r),d=!1}),e.addEventListener("focus",function(t){if(!d){t.preventDefault();var n=r?"mode":"hrs";a(e,n)}x(e,["initial","select"])}),e.addEventListener("keydown",function(t){var r=13===t.which;if(r)return!0;var n=h.indexOf(t.which)>-1,a=s(b).indexOf(t.which)>-1,c=[b.ArrowDown,b.ArrowRight,b.ArrowUp,b.ArrowLeft].indexOf(t.which)>-1,d=[b.a,b.p].indexOf(t.which)>-1,x=[b.Delete,b.Backspace].indexOf(t.which)>-1;if((!a||c||n||d||x)&&t.preventDefault(),n&&l(e,t.which),x){var y=u(e);v(e,y)}switch(t.which){case b.ArrowRight:o(e);break;case b.ArrowLeft:i(e);break;case b.ArrowUp:f(e);break;case b.ArrowDown:g(e);break;case b.Escape:_(e);break;case b.a:m(e,"AM");break;case b.p:m(e,"PM");break;case b.Tab:p(e,t)}})}},{"../accessibility/update_a11y":2,"../events/handle_tab":10,"../getters/get_current_segment":14,"../helpers/values":19,"../selectors/next_segment":20,"../selectors/prev_segment":21,"../selectors/select_cursor_segment":22,"../selectors/select_segment":23,"../setters/clear_segment":26,"../setters/decrement_current_segment":28,"../setters/increment_current_segment":30,"../setters/manual_number_entry":31,"../setters/reset":33,"../setters/set_mode":35,"../setters/switch_times":39,"../static-values/all_number_keys":42,"../static-values/named_keys":43}],9:[function(e,t,r){t.exports=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}},{}],10:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("../selectors/prev_segment"),a=e("../selectors/next_segment");t.exports=function(e,t){var r=n(e),o=t.shiftKey&&"hrs"===r,i=!t.shiftKey&&"mode"===r;o||i||(t.preventDefault(),t.shiftKey?s(e):a(e))}},{"../getters/get_current_segment":14,"../selectors/next_segment":20,"../selectors/prev_segment":21}],11:[function(e,t,r){var n=e("./trigger_event");t.exports=function(e){n(e,"input"),n(e,"change")}},{"./trigger_event":12}],12:[function(e,t,r){function n(e){return!/--/.test(e.value)}var s=e("./create_event"),a=s("input"),o=s("change");t.exports=function(e,t){var r={input:a,change:o}[t];n(e)&&e.dispatchEvent(r)}},{"./create_event":9}],13:[function(e,t,r){t.exports=function(e,t){for(var r=e,n=[];r;){n.push(r);var s=r.msMatchesSelector?r.msMatchesSelector(t):r.matches(t);if(s)return n;r=r.parentElement}return n}},{}],14:[function(e,t,r){var n=e("../static-values/ranges"),s=e("./get_selected_range");t.exports=function(e){var t=s(e);for(var r in n){var a=n[r],o=a.start<=t.start,i=a.end>=t.end;if(o&&i)return r}return"hrs"}},{"../static-values/ranges":44,"./get_selected_range":16}],15:[function(e,t,r){function n(e){var t=e.getAttribute("aria-labelledby");if(t){var r=document.getElementById(t);if(r)return r.textContent}return!1}function s(e){var t=e.getAttribute("aria-label");return!!t&&t}function a(e){if(e.id){var t=document.querySelector('label[for="'+e.id+'"]');if(t)return t.textContent}return!1}function o(e){var t=c(e,"label"),r=t[t.length-1];return"LABEL"==r.nodeName&&r.textContent}function i(e){var t=e.getAttribute("title");return!!t&&t}var c=e("./get_ancestors");t.exports=function(e){var t=n(e)||s(e)||a(e)||o(e)||i(e);if(t)return t;throw console.error("Label text for input not found.",e),new Error("Cannot polyfill time input due to a missing label.")}},{"./get_ancestors":13}],16:[function(e,t,r){t.exports=function(e){return{start:e.selectionStart,end:e.selectionEnd}}},{}],17:[function(e,t,r){var n=e("../converters/convert_number");t.exports=function(e,t){var r=t?t:e.value,s=/([0-9-]{1,2})\:([0-9-]{1,2})\s?(AM|PM|\-\-)?/,a=s.exec(r);return{hrs:n(a[1]),min:n(a[2]),mode:a[3]}}},{"../converters/convert_number":4}],18:[function(e,t,r){function n(){o=[]}function s(e){o.push(e)}function a(){return o}var o=[];t.exports={items:a,clear:n,add:s}},{}],19:[function(e,t,r){t.exports=function(e){var t=[];for(var r in e)t.push(e[r]);return t}},{}],20:[function(e,t,r){var n=e("./traverse");t.exports=function(e){n(e,"next")}},{"./traverse":24}],21:[function(e,t,r){var n=e("./traverse");t.exports=function(e){n(e,"prev")}},{"./traverse":24}],22:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("./select_segment");t.exports=function(e){var t=n(e);s(e,t)}},{"../getters/get_current_segment":14,"./select_segment":23}],23:[function(e,t,r){t.exports=function(e,t){function r(){var r="mode"===t?"text":"tel";e.setAttribute("type",r)}function n(t,r){return function(){e.setSelectionRange(t,r)}}r();var s={hrs:n(0,2),min:n(3,5),mode:n(6,8)};s[t](e)}},{}],24:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("../selectors/select_segment"),a=e("../helpers/manual_entry_log"),o=e("../static-values/segments"),i=e("../accessibility/update_a11y");t.exports=function(e,t){var r=n(e),c="next"===t?1:-1,u=o.indexOf(r)+c,_={next:o[u]||"mode",prev:u<0?"hrs":o[u]}[t];s(e,_),a.clear(),i(e,["select"])}},{"../accessibility/update_a11y":2,"../getters/get_current_segment":14,"../helpers/manual_entry_log":18,"../selectors/select_segment":23,"../static-values/segments":45}],25:[function(e,t,r){var n=e("../setters/set_data_attribute"),s=e("../events/trigger_both_events");t.exports=function(e){e.value="--:-- --",n(e,""),s(e)}},{"../events/trigger_both_events":11,"../setters/set_data_attribute":34}],26:[function(e,t,r){var n=e("./set_segment"),s=e("../accessibility/update_a11y");t.exports=function(e,t){n(e,t,"--"),s(e,["update"])}},{"../accessibility/update_a11y":2,"./set_segment":36}],27:[function(e,t,r){var n=e("./switch_mode"),s=e("./nudge_time_segment"),a=e("../accessibility/update_a11y");t.exports=function(e,t){"mode"===t?n(e,"PM"):s(e,t,"down"),a(e,["update"])}},{"../accessibility/update_a11y":2,"./nudge_time_segment":32,"./switch_mode":38}],28:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("../setters/decrement");t.exports=function(e){var t=n(e);s(e,t)}},{"../getters/get_current_segment":14,"../setters/decrement":27}],29:[function(e,t,r){var n=e("./switch_mode"),s=e("./nudge_time_segment"),a=e("../accessibility/update_a11y");t.exports=function(e,t){"mode"===t?n(e,"AM"):s(e,t,"up"),a(e,["update"])}},{"../accessibility/update_a11y":2,"./nudge_time_segment":32,"./switch_mode":38}],30:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("../setters/increment");t.exports=function(e){var t=n(e);s(e,t)}},{"../getters/get_current_segment":14,"../setters/increment":29}],31:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("./set_segment"),a=e("../selectors/next_segment"),o=e("../helpers/manual_entry_log"),i=e("../static-values/sorted_number_keys");t.exports=function(e,t){var r=i[t],c=n(e);if("mode"!==c){var u=o.items().length,_={hrs:[1,2],min:[5,9]},l=_[c][u];u<2&&o.add(r);var v=parseInt(_[c].join("")),f=parseInt(o.items().join(""));v>=f&&s(e,c,f);var g=r>l||2===o.items().length;g&&a(e)}}},{"../getters/get_current_segment":14,"../helpers/manual_entry_log":18,"../selectors/next_segment":20,"../static-values/sorted_number_keys":46,"./set_segment":36}],32:[function(e,t,r){var n=e("../getters/get_values"),s=e("../converters/convert_hours_to_12hr_time"),a=e("../converters/leading_zero"),o=e("./set_segment");t.exports=function(e,t,r){var i,c=n(e),u="up"===r?1:-1;if("--"===c[t]){var _=new Date;i={hrs:s(_.getHours()),min:_.getMinutes()}}else{var l={up:c.min<59?c.min+u:0,down:0===c.min?59:c.min+u};i={hrs:s(c.hrs+u),min:l[r]}}o(e,t,a(i[t]))}},{"../converters/convert_hours_to_12hr_time":3,"../converters/leading_zero":7,"../getters/get_values":17,"./set_segment":36}],33:[function(e,t,r){var n=e("./apply_default"),s=e("../selectors/select_segment");t.exports=function(e){n(e),s(e,"hrs")}},{"../selectors/select_segment":23,"./apply_default":25}],34:[function(e,t,r){var n=e("../converters/convert_to_24hr_time");t.exports=function(e,t){var r=t.indexOf("-")>-1?"":t,s=n(r);e.setAttribute("data-value",s)}},{"../converters/convert_to_24hr_time":6}],35:[function(e,t,r){var n=e("../getters/get_current_segment"),s=e("./set_segment");t.exports=function(e,t){var r=n(e);"mode"===r&&s(e,r,t)}},{"../getters/get_current_segment":14,"./set_segment":36}],36:[function(e,t,r){var n=e("../getters/get_values"),s=e("../converters/leading_zero"),a=e("../selectors/select_segment"),o=e("./set_data_attribute"),i=e("../events/trigger_both_events");t.exports=function(e,t,r){var c=n(e);c[t]=r;var u=[s(c.hrs),":",s(c.min)," ",c.mode].join("");e.value=u,a(e,t),o(e,u),i(e)}},{"../converters/leading_zero":7,"../events/trigger_both_events":11,"../getters/get_values":17,"../selectors/select_segment":23,"./set_data_attribute":34}],37:[function(e,t,r){var n=e("../converters/convert_to_12hr_time"),s=e("../setters/set_data_attribute");t.exports=function(e,t){var r=n(t);e.value=r,s(e,t)}},{"../converters/convert_to_12hr_time":5,"../setters/set_data_attribute":34}],38:[function(e,t,r){var n=e("../getters/get_values"),s=e("./set_segment");t.exports=function(e,t){t=t||"AM";var r=n(e).mode,a={"--":t,AM:"PM",PM:"AM"}[r];s(e,"mode",a)}},{"../getters/get_values":17,"./set_segment":36}],39:[function(e,t,r){var n=e("./switch_to_data_value"),s=e("./set_time");t.exports=function(e,t){var r=/\s/.test(e.value);12!=t&&24!=t&&(t=r?24:12);var a={12:function(){r||s(e,e.dataset.value)},24:function(){r&&n(e)}};a[t]()}},{"./set_time":37,"./switch_to_data_value":40}],40:[function(e,t,r){t.exports=function(e){var t=e.dataset.value;e.value=t}},{}],41:[function(e,t,r){var n=e("../setters/set_time");t.exports=function(e){return n(e,e.value),e}},{"../setters/set_time":37}],42:[function(e,t,r){var n=[48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105];t.exports=n},{}],43:[function(e,t,r){var n={ArrowDown:40,ArrowRight:39,ArrowUp:38,ArrowLeft:37,Backspace:8,Delete:46,Tab:9,Shift:16,Escape:27,a:65,p:80};t.exports=n},{}],44:[function(e,t,r){var n={hrs:{start:0,end:2},min:{start:3,end:5},mode:{start:6,end:8}};t.exports=n},{}],45:[function(e,t,r){var n=e("./ranges"),s=Object.keys(n);t.exports=s},{"./ranges":44}],46:[function(e,t,r){var n=e("./all_number_keys"),s={};n.forEach(function(e,t){var r=t>9?t-10:t;s[e]=r}),t.exports=s},{"./all_number_keys":42}],47:[function(e,t,r){function n(e){e.setAttribute("autocomplete","off"),e.setAttribute("aria-hidden",!0),v||(s=l(),v=!0);var t=_(e);e.polyfill={$a11y:s,label:t,autoSwap:!0,update:function(){o(e)},swap:function(t){u(e,t)}},""===e.value||/--/.test(e.value)?(a(e),i(e,"")):(o(e),i(e,e.value)),c(e)}var s,a=e("./core/setters/apply_default"),o=e("./core/setters/update_time"),i=e("./core/setters/set_data_attribute"),c=e("./core/events/bind_events"),u=e("./core/setters/switch_times"),_=e("./core/getters/get_label"),l=e("./core/accessibility/create_a11y_block"),v=!1;window&&(window.TimePolyfill=n),t&&(t.exports=n)},{"./core/accessibility/create_a11y_block":1,"./core/events/bind_events":8,"./core/getters/get_label":15,"./core/setters/apply_default":25,"./core/setters/set_data_attribute":34,"./core/setters/switch_times":39,"./core/setters/update_time":41}]},{},[47]); //# sourceMappingURL=time-input-polyfill.min.js.map diff --git a/dist/time-input-polyfill.min.js.map b/dist/time-input-polyfill.min.js.map index 9741a3a..98b5000 100644 --- a/dist/time-input-polyfill.min.js.map +++ b/dist/time-input-polyfill.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browser-pack/_prelude.js","core/accessibility/create_a11y_block.js","index.js","core/accessibility/update_a11y.js","core/converters/convert_hours_to_12hr_time.js","core/converters/convert_number.js","core/converters/convert_to_12hr_time.js","core/converters/convert_to_24hr_time.js","core/converters/leading_zero.js","core/events/bind_events.js","core/events/create_event.js","core/events/handle_tab.js","core/events/trigger_both_events.js","core/events/trigger_event.js","core/getters/get_ancestors.js","core/getters/get_current_segment.js","core/getters/get_label.js","core/getters/get_selected_range.js","core/getters/get_values.js","core/helpers/manual_entry_log.js","core/helpers/prevent_user_select.js","core/helpers/values.js","core/selectors/next_segment.js","core/selectors/prev_segment.js","core/selectors/select_cursor_segment.js","core/selectors/select_segment.js","core/selectors/traverse.js","core/setters/apply_default.js","core/setters/clear_segment.js","core/setters/decrement.js","core/setters/decrement_current_segment.js","core/setters/increment.js","core/setters/increment_current_segment.js","core/setters/manual_number_entry.js","core/setters/nudge_time_segment.js","core/setters/reset.js","core/setters/set_data_attribute.js","core/setters/set_mode.js","core/setters/set_segment.js","core/setters/set_time.js","core/setters/switch_mode.js","core/setters/switch_times.js","core/setters/switch_to_data_value.js","core/setters/update_time.js","core/static-values/all_number_keys.js","core/static-values/named_keys.js","core/static-values/ranges.js","core/static-values/segments.js","core/static-values/sorted_number_keys.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","$block","document","createElement","setAttribute","classList","add","querySelector","appendChild","2","get_current_segment","get_values","$input","announcementArray","setTimeout","current_segment","values","value","finalValue","segmentName","hrs","min","mode","announcements","initial","select","update","textArray","map","providedString","fullValue","replace","html","join","polyfill","label","$a11y","innerHTML","../getters/get_current_segment","../getters/get_values","3","hours","4","number","isNaN","parseInt","5","convert_number","convert_hours_to_12hr_time","leading_zero","timeString_24hr","twentyFour_regex","result","exec","hrs_24","hrs_12","isPM","./convert_hours_to_12hr_time","./convert_number","./leading_zero","6","timeString_12hr","test","newHrs","indexOf","timeResult","finalHrs","timeRegEx","7","purified","8","auto_swap","autoSwap","switch_times","select_segment","next_segment","prev_segment","select_cursor_segment","reset","manual_number_entry","clear_segment","increment_current_segment","decrement_current_segment","set_mode","handle_tab","all_number_keys","named_keys","update_a11y","prev_value","shiftKey","addEventListener","form","focused_via_click","current_value","dataset","preventDefault","segment","is_enter_key","which","is_number_key","is_named_key","is_arrow_key","ArrowDown","ArrowRight","ArrowUp","ArrowLeft","is_mode_key","is_delete_key","Delete","Backspace","Escape","Tab","../accessibility/update_a11y","../events/handle_tab","../helpers/values","../selectors/next_segment","../selectors/prev_segment","../selectors/select_cursor_segment","../selectors/select_segment","../setters/clear_segment","../setters/decrement_current_segment","../setters/increment_current_segment","../setters/manual_number_entry","../setters/reset","../setters/set_mode","../setters/switch_times","../static-values/all_number_keys","../static-values/named_keys","9","eventName","event","createEvent","initEvent","10","backwards_and_first","forwards_and_last","11","trigger_event","./trigger_event","12","can_trigger_change","create_event","inputEvent","changeEvent","input","change","dispatchEvent","./create_event","13","selectorString","$elem","ancestors","push","matchesSelector","msMatchesSelector","matches","parentElement","14","ranges","get_selected_range","selection","range","aboveMin","start","belowMax","end","../static-values/ranges","./get_selected_range","15","aria_labelledby","ariaLabelByID","getAttribute","$ariaLabelBy","getElementById","textContent","aria_label","ariaLabel","for_attribute","id","$forLabel","label_wrapper_element","get_ancestors","$parentLabel","nodeName","title_attribute","titleLabel","labelText","console","error","./get_ancestors","16","selectionStart","selectionEnd","17","timeString","regEx","../converters/convert_number","18","clear","manual_entry_log","entry","items","19","style","msUserSelect","mozUserSelect","webkitUserSelect","userSelect","20","obj","key_values","key","21","traverse","./traverse","22","23","./select_segment","24","set_input_type","type","setSelectionRange","actions","25","segments","direction","modifier","next_segment_index","next","prev","../helpers/manual_entry_log","../static-values/segments","26","set_data_attribute","trigger_both_events","../events/trigger_both_events","../setters/set_data_attribute","27","set_segment","./set_segment","28","switch_mode","nudge_time_segment","./nudge_time_segment","./switch_mode","29","decrement","../setters/decrement","30","31","increment","../setters/increment","32","sorted_number_keys","key_value","entry_count","upper_limits","limit","full_limit","full_entry","at_limit","../static-values/sorted_number_keys","33","time","current_values","current_time","Date","getHours","getMinutes","minutes","up","down","../converters/convert_hours_to_12hr_time","../converters/leading_zero","34","apply_default","./apply_default","35","convert_to_24hr_time","filteredString","time24hr","../converters/convert_to_24hr_time","36","37","newInputVal","./set_data_attribute","38","convert_to_12hr_time","time_string_24hr","twelveHr","../converters/convert_to_12hr_time","39","default_mode","current_mode","new_mode","--","AM","PM","40","switch_to_data_value","set_time","format","is12hr","./set_time","./switch_to_data_value","41","replacementVal","42","../setters/set_time","43","44","Shift","45","46","Object","keys","./ranges","47","forEach","index","number_val","./all_number_keys","48","TimePolyfill","prevent_user_select","accessibility_block_created","create_a11y_block","get_label","update_time","swap","forcedFormat","bind_events","window","./core/accessibility/create_a11y_block","./core/events/bind_events","./core/getters/get_label","./core/helpers/prevent_user_select","./core/setters/apply_default","./core/setters/set_data_attribute","./core/setters/switch_times","./core/setters/update_time"],"mappings":";;;;;;;;CAAA,WAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GA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AAEC,2BAA2B,GAAGC,qCAAqC,GAAGC,+BAA+B,GAAGC,oCAAoC,GAAGC,8BAA8B,GAAGC,6BAA6B,UAAU","file":"time-input-polyfill.min.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i

') + '

';\r\n\t\thtml = html.replace(/\\$label/g, $input.polyfill.label);\r\n\t\thtml = html.replace(/\\$segmentName/g, segmentName);\r\n\t\thtml = html.replace(/\\$segmentValue/g, finalValue);\r\n\t\thtml = html.replace(/\\$fullValue/g, fullValue);\r\n\r\n\t\t$input.polyfill.$a11y.innerHTML = html;\r\n\t}, 1);\r\n}\r\n","\r\nmodule.exports = function convert_hours_to_12hr_time (hours) {\r\n\treturn hours <= 12 ? hours === 0 ? 12 : hours : hours - 12;\r\n}\r\n","\r\nmodule.exports = function convert_number (number) {\r\n\treturn isNaN(number) ? number : parseInt(number);\r\n}\r\n","\r\nvar convert_number = require('./convert_number');\r\nvar convert_hours_to_12hr_time = require('./convert_hours_to_12hr_time');\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_12hr_time (timeString_24hr) {\r\n\tif (timeString_24hr === '') return '--:-- --';\r\n\tvar twentyFour_regex = /([0-9]{2})\\:([0-9]{2})/;\r\n\tvar result = twentyFour_regex.exec(timeString_24hr);\r\n\tvar hrs_24 = convert_number(result[1]);\r\n\tvar min = result[2];\r\n\tvar hrs_12 = convert_hours_to_12hr_time(hrs_24);\r\n\tvar isPM = hrs_24 > 12;\r\n\tvar mode = isPM ? 'PM' : 'AM';\r\n\treturn [leading_zero(hrs_12), ':', min, ' ', mode].join('');\r\n}\r\n","\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_24hr_time (timeString_12hr) {\r\n\tif (/-/.test(timeString_12hr)) return '';\r\n\tvar isPM = timeString_12hr.indexOf('PM') > -1;\r\n\tvar timeResult = /^([0-9]{2})/.exec(timeString_12hr);\r\n\tvar hrs = timeResult ? parseInt(timeResult[1]) : '';\r\n\tvar newHrs;\r\n\tif (hrs === 12) {\r\n\t\tnewHrs = isPM ? 12 : 00;\r\n\t} else {\r\n\t\tnewHrs = isPM ? hrs + 12 : hrs;\r\n\t}\r\n\tvar finalHrs = newHrs === 24 ? 0 : newHrs;\r\n\tvar timeRegEx = /^[0-9]{2}:([0-9]{2}) (AM|PM)/;\r\n\treturn timeString_12hr.replace(timeRegEx, leading_zero(finalHrs)+':$1');\r\n}\r\n","\r\nmodule.exports = function leading_zero (number) {\r\n\tif (isNaN(number)) return number;\r\n\tvar purified = parseInt(number);\r\n\treturn purified < 10 ? '0' + purified : number;\r\n}\r\n","\r\nvar values = require('../helpers/values');\r\n\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar next_segment = require('../selectors/next_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar select_cursor_segment = require('../selectors/select_cursor_segment');\r\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\n\r\nvar reset = require('../setters/reset');\r\nvar manual_number_entry = require('../setters/manual_number_entry');\r\nvar clear_segment = require('../setters/clear_segment');\r\nvar increment_current_segment = require('../setters/increment_current_segment');\r\nvar decrement_current_segment = require('../setters/decrement_current_segment');\r\nvar set_mode = require('../setters/set_mode');\r\nvar switch_times = require('../setters/switch_times');\r\n\r\nvar handle_tab = require('../events/handle_tab');\r\n\r\nvar all_number_keys = require('../static-values/all_number_keys');\r\nvar named_keys = require('../static-values/named_keys');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function bind_events ($input) {\r\n\r\n\tvar prev_value = '';\r\n\r\n\tvar shiftKey = false;\r\n\r\n\tdocument.addEventListener('keydown', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\tdocument.addEventListener('keyup', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\r\n\tif ($input.form) {\r\n\t\t$input.form.addEventListener('submit', function(){\r\n\t\t\tauto_swap($input);\r\n\t\t})\r\n\t}\r\n\r\n\tvar focused_via_click = false;\r\n\r\n\t$input.addEventListener('mousedown', function(){\r\n\t\tfocused_via_click = true;\r\n\t});\r\n\r\n\t// Turns the IE clear button into a reset button\r\n\t$input.addEventListener('mouseup', function(){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif ($input.value === '') reset($input);\r\n\t\t}, 1)\r\n\t});\r\n\r\n\t$input.addEventListener('click', function(e){\r\n\t\tselect_cursor_segment($input);\r\n\t});\r\n\r\n\t$input.addEventListener('blur', function(){\r\n\t\tvar current_value = $input.dataset.value;\r\n\t\tif (current_value !== prev_value) {\r\n\t\t\tprev_value = current_value;\r\n\t\t}\r\n\t\tfocused_via_click = false;\r\n\t});\r\n\r\n\t$input.addEventListener('focus', function(e){\r\n\t\tif (!focused_via_click) {\r\n\t\t\te.preventDefault();\r\n\t\t\tvar segment = shiftKey ? 'mode' : 'hrs';\r\n\t\t\tselect_segment($input, segment);\r\n\t\t}\r\n\t\tupdate_a11y($input, [\r\n\t\t\t'initial',\r\n\t\t\t'select'\r\n\t\t])\r\n\t});\r\n\r\n\t$input.addEventListener('keydown', function(e) {\r\n\t\tvar is_enter_key = e.which === 13;\r\n\t\tif (is_enter_key) return true;\r\n\r\n\t\tvar is_number_key = all_number_keys.indexOf(e.which) > -1;\r\n\t\tvar is_named_key = values(named_keys).indexOf(e.which) > -1;\r\n\t\tvar is_arrow_key = [named_keys.ArrowDown, named_keys.ArrowRight, named_keys.ArrowUp, named_keys.ArrowLeft].indexOf(e.which) > -1;\r\n\t\tvar is_mode_key = [named_keys.a, named_keys.p].indexOf(e.which) > -1;\r\n\t\tvar is_delete_key = [named_keys.Delete, named_keys.Backspace].indexOf(e.which) > -1;\r\n\r\n\t\tif (!is_named_key || is_arrow_key || is_number_key || is_mode_key || is_delete_key) { e.preventDefault(); }\r\n\r\n\t\tif (is_number_key) {\r\n\t\t\tmanual_number_entry($input, e.which);\r\n\t\t}\r\n\r\n\t\tif (is_delete_key) {\r\n\t\t\tvar segment = get_current_segment($input);\r\n\t\t\tclear_segment($input, segment);\r\n\t\t}\r\n\r\n\t\tswitch (e.which) {\r\n\t\t\tcase named_keys.ArrowRight: next_segment($input); break;\r\n\t\t\tcase named_keys.ArrowLeft: prev_segment($input); break;\r\n\t\t\tcase named_keys.ArrowUp: increment_current_segment($input); break;\r\n\t\t\tcase named_keys.ArrowDown: decrement_current_segment($input); break;\r\n\t\t\tcase named_keys.Escape: reset($input); break;\r\n\t\t\tcase named_keys.a: set_mode($input, 'AM'); break;\r\n\t\t\tcase named_keys.p: set_mode($input, 'PM'); break;\r\n\t\t\tcase named_keys.Tab: handle_tab($input, e); break;\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction auto_swap($input) {\r\n\tif ($input.polyfill.autoSwap) {\r\n\t\tswitch_times($input, 24);\r\n\t\tsetTimeout(function(){\r\n\t\t\tswitch_times($input, 12);\r\n\t\t}, 1);\r\n\t}\r\n}\r\n","\r\nmodule.exports = function create_event(eventName){\r\n\tvar event = document.createEvent('Event');\r\n\tevent.initEvent(eventName, true, true);\r\n\treturn event;\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nmodule.exports = function handle_tab($input, e) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tvar backwards_and_first = e.shiftKey && current_segment === 'hrs';\r\n\tvar forwards_and_last = !e.shiftKey && current_segment === 'mode';\r\n\r\n\tif (!backwards_and_first && !forwards_and_last) {\r\n\t\te.preventDefault();\r\n\t\tif (e.shiftKey) {\r\n\t\t\tprev_segment($input);\r\n\t\t} else {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar trigger_event = require('./trigger_event');\r\n\r\n// It seems that oninput and onchange are treated the same way by browsers :/\r\nmodule.exports = function trigger_both_events($input) {\r\n\t// the event only ever fires if there is a full valid value available\r\n\ttrigger_event($input, 'input');\r\n\ttrigger_event($input,'change');\r\n}\r\n","\r\nvar create_event = require('./create_event');\r\n\r\nvar inputEvent = create_event('input');\r\nvar changeEvent = create_event('change');\r\n\r\nmodule.exports = function trigger_event($input, eventName) {\r\n\tvar event = {\r\n\t\tinput: inputEvent,\r\n\t\tchange: changeEvent,\r\n\t}[eventName];\r\n\r\n\tif (can_trigger_change($input)) {\r\n\t\t$input.dispatchEvent(event);\r\n\t}\r\n}\r\n\r\n// Browsers only send out input and change events if the time element has a full valid value\r\nfunction can_trigger_change ($input) {\r\n\treturn !/--/.test($input.value);\r\n}\r\n","// selector is optional, it allows for an early exit\r\nmodule.exports = function ($input, selectorString) {\r\n\tvar $elem = $input;\r\n\r\n\t// https://stackoverflow.com/a/8729274/1611058\r\n\tvar ancestors = [];\r\n\twhile ($elem) {\r\n\t\tancestors.push($elem);\r\n\t\tvar matchesSelector = $elem.msMatchesSelector ?\r\n\t\t\t$elem.msMatchesSelector(selectorString) :\r\n\t\t\t$elem.matches(selectorString);\r\n\t\tif (matchesSelector) {\r\n\t\t\treturn ancestors;\r\n\t\t}\r\n\t\t$elem = $elem.parentElement;\r\n\t}\r\n\r\n\treturn ancestors;\r\n}\r\n","\r\nvar ranges = require('../static-values/ranges');\r\nvar get_selected_range = require('./get_selected_range');\r\n\r\nmodule.exports = function get_current_segment ($input) {\r\n\tvar selection = get_selected_range($input);\r\n\tfor (var segment in ranges) {\r\n\t\tvar range = ranges[segment];\r\n\t\tvar aboveMin = range.start <= selection.start;\r\n\t\tvar belowMax = range.end >= selection.end;\r\n\t\tif (aboveMin && belowMax) {\r\n\t\t\treturn segment;\r\n\t\t}\r\n\t}\r\n\treturn 'hrs';\r\n}\r\n","\r\nvar get_ancestors = require('./get_ancestors');\r\n\r\nmodule.exports = function get_label ($input) {\r\n\r\n\tvar labelText =\r\n\t\taria_labelledby($input) ||\r\n\t\taria_label($input) ||\r\n\t\tfor_attribute($input) ||\r\n\t\tlabel_wrapper_element($input) ||\r\n\t\ttitle_attribute($input);\r\n\r\n\tif (labelText) return labelText;\r\n\r\n\tconsole.error('Label text for input not found.', $input);\r\n\tthrow new Error('Cannot polyfill time input due to a missing label.');\r\n}\r\n\r\nfunction aria_labelledby($input){\r\n\tvar ariaLabelByID = $input.getAttribute('aria-labelledby');\r\n\tif (ariaLabelByID) {\r\n\t\tvar $ariaLabelBy = document.getElementById(ariaLabelByID);\r\n\t\tif ($ariaLabelBy) return $ariaLabelBy.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction aria_label($input){\r\n\tvar ariaLabel = $input.getAttribute('aria-label');\r\n\tif (ariaLabel) return ariaLabel;\r\n\treturn false;\r\n}\r\n\r\nfunction for_attribute($input){\r\n\tif ($input.id) {\r\n\t\tvar $forLabel = document.querySelector('label[for=\"'+$input.id+'\"]');\r\n\t\tif ($forLabel) return $forLabel.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction label_wrapper_element($input){\r\n\tvar ancestors = get_ancestors($input, 'label');\r\n\tvar $parentLabel = ancestors[ancestors.length - 1];\r\n\tif ($parentLabel.nodeName == 'LABEL') return $parentLabel.textContent;\r\n\treturn false\r\n}\r\n\r\nfunction title_attribute($input){\r\n\tvar titleLabel = $input.getAttribute('title');\r\n\tif (titleLabel) return titleLabel;\r\n\treturn false\r\n}\r\n","\r\nmodule.exports = function get_selected_range ($input) {\r\n\treturn { start: $input.selectionStart, end: $input.selectionEnd };\r\n}\r\n","\r\nvar convert_number = require('../converters/convert_number');\r\n\r\nmodule.exports = function get_values ($input, timeString) {\r\n\tvar value = timeString ? timeString : $input.value;\r\n\tvar regEx = /([0-9-]{1,2})\\:([0-9-]{1,2})\\s?(AM|PM|\\-\\-)?/;\r\n\tvar result = regEx.exec(value);\r\n\r\n\treturn {\r\n\t\thrs: convert_number(result[1]),\r\n\t\tmin: convert_number(result[2]),\r\n\t\tmode: result[3],\r\n\t}\r\n}\r\n","\r\nvar manual_entry_log = [];\r\n\r\nfunction clear () {\r\n\tmanual_entry_log = [];\r\n}\r\n\r\nfunction add (entry) {\r\n\tmanual_entry_log.push(entry);\r\n}\r\n\r\nfunction items(){\r\n\treturn manual_entry_log;\r\n}\r\n\r\nmodule.exports = {\r\n\titems: items,\r\n\tclear: clear,\r\n\tadd: add,\r\n}\r\n","\r\nmodule.exports = function prevent_user_select ($input) {\r\n\t$input.style.msUserSelect = \"none\";\r\n\t$input.style.mozUserSelect = \"none\";\r\n\t$input.style.webkitUserSelect = \"none\";\r\n\t$input.style.userSelect = \"none\";\r\n}\r\n","\r\n// IE11 doesn't support Object.values()\r\nmodule.exports = function values (obj) {\r\n\tvar key_values = [];\r\n\tfor (var key in obj) {\r\n\t\tkey_values.push(obj[key]);\r\n\t}\r\n\treturn key_values;\r\n}\r\n","\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function next_segment ($input) {\r\n\ttraverse($input, 'next');\r\n}\r\n","\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function prev_segment ($input) {\r\n\ttraverse($input, 'prev');\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('./select_segment');\r\n\r\nmodule.exports = function select_cursor_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tselect_segment($input, current_segment);\r\n}\r\n","\r\nmodule.exports = function select_segment ($input, segment) {\r\n\r\n\tset_input_type();\r\n\r\n\tvar actions = {\r\n\t\thrs: select(0, 2),\r\n\t\tmin: select(3, 5),\r\n\t\tmode: select(6, 8),\r\n\t};\r\n\r\n\tactions[segment]($input);\r\n\r\n\tfunction set_input_type() {\r\n\t\tvar type = segment === 'mode' ? 'text' : 'tel';\r\n\t\t$input.setAttribute('type', type);\r\n\t}\r\n\r\n\tfunction select (start, end) {\r\n\t\treturn function () {\r\n\t\t\t$input.setSelectionRange(start, end);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar segments = require('../static-values/segments');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function traverse ($input, direction) {\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tvar modifier = direction === 'next' ? 1 : -1;\r\n\tvar next_segment_index = segments.indexOf(segment) + modifier;\r\n\r\n\tvar next_segment = {\r\n\t\tnext: segments[next_segment_index] || 'mode',\r\n\t\tprev: next_segment_index < 0 ? 'hrs' : segments[next_segment_index],\r\n\t}[direction];\r\n\r\n\tselect_segment($input, next_segment);\r\n\tmanual_entry_log.clear();\r\n\tupdate_a11y($input, ['select'])\r\n}\r\n","\r\n// I need to keep this separate from reset so that\r\n// I can reset without attracting focus\r\n\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function apply_default ($input) {\r\n\t$input.value = '--:-- --';\r\n\tset_data_attribute($input, '');\r\n\ttrigger_both_events($input);\r\n}\r\n","\r\nvar set_segment = require('./set_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function clear_segment ($input, segment) {\r\n\tset_segment($input, segment, '--');\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n","\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function decrement ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'PM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'down');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar decrement = require('../setters/decrement');\r\n\r\nmodule.exports = function decrement_current_segment ($input){\r\n\tvar current_segment = get_current_segment($input);\r\n\tdecrement($input, current_segment);\r\n}\r\n","\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function increment ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'AM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'up');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar increment = require('../setters/increment');\r\n\r\nmodule.exports = function increment_current_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tincrement($input, current_segment);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar sorted_number_keys = require('../static-values/sorted_number_keys');\r\n\r\nmodule.exports = function manual_number_entry($input, key) {\r\n\tvar key_value = sorted_number_keys[key];\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tif (segment !== 'mode') {\r\n\t\tvar entry_count = manual_entry_log.items().length;\r\n\r\n\t\tvar upper_limits = {\r\n\t\t\thrs: [1,2],\r\n\t\t\tmin: [5,9],\r\n\t\t}\r\n\t\tvar limit = upper_limits[segment][entry_count];\r\n\r\n\t\tif (entry_count < 2) {\r\n\t\t\tmanual_entry_log.add(key_value);\r\n\t\t}\r\n\r\n\t\tvar full_limit = parseInt(upper_limits[segment].join(''));\r\n\t\tvar full_entry = parseInt(manual_entry_log.items().join(''));\r\n\r\n\t\tif (full_limit >= full_entry) {\r\n\t\t\tset_segment($input, segment, full_entry);\r\n\t\t}\r\n\r\n\t\tvar at_limit = key_value > limit || manual_entry_log.items().length === 2;\r\n\r\n\t\tif (at_limit) {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar convert_hours_to_12hr_time = require('../converters/convert_hours_to_12hr_time');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function nudge_time_segment ($input, segment, direction) {\r\n\tvar current_values = get_values($input);\r\n\tvar time;\r\n\r\n\tvar modifier = direction === 'up' ? 1 : -1;\r\n\r\n\tif (current_values[segment] === '--') {\r\n\t\tvar current_time = new Date();\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_time.getHours()),\r\n\t\t\tmin: current_time.getMinutes(),\r\n\t\t}\r\n\t} else {\r\n\t\tvar minutes = {\r\n\t\t\tup : current_values.min < 59 ? current_values.min + modifier : 0,\r\n\t\t\tdown : current_values.min === 0 ? 59 : current_values.min + modifier,\r\n\t\t}\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_values.hrs + modifier),\r\n\t\t\tmin: minutes[direction],\r\n\t\t}\r\n\t}\r\n\r\n\tset_segment($input, segment, leading_zero(time[segment]) );\r\n}\r\n","\r\nvar apply_default = require('./apply_default');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nmodule.exports = function reset ($input) {\r\n\tapply_default($input);\r\n\tselect_segment($input, 'hrs');\r\n}\r\n","\r\nvar convert_to_24hr_time = require('../converters/convert_to_24hr_time')\r\n\r\nmodule.exports = function set_data_attribute($input, timeString_12hr){\r\n\tvar filteredString = timeString_12hr.indexOf('-') > -1 ? '' : timeString_12hr;\r\n\tvar time24hr = convert_to_24hr_time(filteredString);\r\n\t$input.setAttribute('data-value', time24hr);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function set_mode ($input, type) {\r\n\tvar segment = get_current_segment($input);\r\n\tif (segment === 'mode') {\r\n\t\tset_segment($input, segment, type);\r\n\t}\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar select_segment = require('../selectors/select_segment');\r\nvar set_data_attribute = require('./set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function set_segment ($input, segment, value) {\r\n\tvar values = get_values($input);\r\n\tvalues[segment] = value;\r\n\tvar newInputVal = [\r\n\t\tleading_zero(values.hrs),':',\r\n\t\tleading_zero(values.min),' ',\r\n\t\tvalues.mode\r\n\t].join('');\r\n\t$input.value = newInputVal;\r\n\tselect_segment($input, segment);\r\n\tset_data_attribute($input, newInputVal);\r\n\ttrigger_both_events($input);\r\n}\r\n","\r\nvar convert_to_12hr_time = require('../converters/convert_to_12hr_time');\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\n\r\nmodule.exports = function set_time($input, time_string_24hr) {\r\n\tvar twelveHr = convert_to_12hr_time(time_string_24hr);\r\n\t$input.value = twelveHr;\r\n\tset_data_attribute($input, time_string_24hr);\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function switch_mode ($input, default_mode) {\r\n\tdefault_mode = default_mode || 'AM';\r\n\tvar current_mode = get_values($input).mode;\r\n\tvar new_mode = {\r\n\t\t'--' : default_mode,\r\n\t\t'AM' : 'PM',\r\n\t\t'PM' : 'AM',\r\n\t}[current_mode];\r\n\tset_segment($input, 'mode', new_mode);\r\n}\r\n","\r\nvar switch_to_data_value = require('./switch_to_data_value');\r\nvar set_time = require('./set_time');\r\n\r\nmodule.exports = function switch_times ($input, format) {\r\n\tvar is12hr = /\\s/.test($input.value);\r\n\r\n\tif (format != 12 && format != 24) {\r\n\t\tformat = is12hr ? 24 : 12;\r\n\t}\r\n\r\n\tvar actions = {\r\n\t\t12: function(){\r\n\t\t\tif (!is12hr) {\r\n\t\t\t\tset_time($input, $input.dataset.value);\r\n\t\t\t}\r\n\t\t},\r\n\t\t24: function(){\r\n\t\t\tif (is12hr) {\r\n\t\t\t\tswitch_to_data_value($input);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tactions[format]();\r\n}\r\n","\r\nmodule.exports = function($input) {\r\n\tvar replacementVal = $input.dataset.value;\r\n\t$input.value = replacementVal;\r\n}\r\n","\r\nvar set_time = require('../setters/set_time');\r\n\r\nmodule.exports = function update_time($input) {\r\n\tset_time($input, $input.value);\r\n\treturn $input;\r\n}\r\n","var all_number_keys = [\r\n // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\r\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,\r\n 96, 97, 98, 99,100,101,102,103,104,105\r\n];\r\n\r\nmodule.exports = all_number_keys;\r\n","var named_keys = {\r\n\tArrowDown: 40,\r\n\tArrowRight: 39,\r\n\tArrowUp: 38,\r\n\tArrowLeft: 37,\r\n\tBackspace: 8,\r\n\tDelete: 46,\r\n\tTab: 9,\r\n\tShift: 16,\r\n\tEscape: 27,\r\n\ta: 65,\r\n\tp: 80,\r\n}\r\n\r\nmodule.exports = named_keys;\r\n","\r\nvar ranges = {\r\n\thrs : { start: 0, end: 2 },\r\n\tmin : { start: 3, end: 5 },\r\n\tmode : { start: 6, end: 8 },\r\n}\r\n\r\nmodule.exports = ranges;\r\n","\r\nvar ranges = require('./ranges');\r\n\r\nvar segments = Object.keys(ranges);\r\n\r\nmodule.exports = segments;\r\n","\r\nvar all_number_keys = require('./all_number_keys');\r\n\r\nvar sorted_number_keys = {};\r\n// sorted_number_keys = { 48: 0, 49: 1, 96: 0, 97: 1, ... };\r\nall_number_keys.forEach(function(key, index) {\r\n\tvar number_val = index > 9 ? index - 10 : index;\r\n\tsorted_number_keys[key] = number_val;\r\n});\r\n\r\nmodule.exports = sorted_number_keys;\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","core/accessibility/create_a11y_block.js","index.js","core/accessibility/update_a11y.js","core/converters/convert_hours_to_12hr_time.js","core/converters/convert_number.js","core/converters/convert_to_12hr_time.js","core/converters/convert_to_24hr_time.js","core/converters/leading_zero.js","core/events/bind_events.js","core/events/create_event.js","core/events/handle_tab.js","core/events/trigger_both_events.js","core/events/trigger_event.js","core/getters/get_ancestors.js","core/getters/get_current_segment.js","core/getters/get_label.js","core/getters/get_selected_range.js","core/getters/get_values.js","core/helpers/manual_entry_log.js","core/helpers/values.js","core/selectors/next_segment.js","core/selectors/prev_segment.js","core/selectors/select_cursor_segment.js","core/selectors/select_segment.js","core/selectors/traverse.js","core/setters/apply_default.js","core/setters/clear_segment.js","core/setters/decrement.js","core/setters/decrement_current_segment.js","core/setters/increment.js","core/setters/increment_current_segment.js","core/setters/manual_number_entry.js","core/setters/nudge_time_segment.js","core/setters/reset.js","core/setters/set_data_attribute.js","core/setters/set_mode.js","core/setters/set_segment.js","core/setters/set_time.js","core/setters/switch_mode.js","core/setters/switch_times.js","core/setters/switch_to_data_value.js","core/setters/update_time.js","core/static-values/all_number_keys.js","core/static-values/named_keys.js","core/static-values/ranges.js","core/static-values/segments.js","core/static-values/sorted_number_keys.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","$block","document","createElement","setAttribute","classList","add","querySelector","appendChild","2","get_current_segment","get_values","$input","announcementArray","setTimeout","current_segment","values","value","finalValue","segmentName","hrs","min","mode","announcements","initial","select","update","textArray","map","providedString","fullValue","replace","html","join","polyfill","label","$a11y","innerHTML","../getters/get_current_segment","../getters/get_values","3","hours","4","number","isNaN","parseInt","5","convert_number","convert_hours_to_12hr_time","leading_zero","timeString_24hr","twentyFour_regex","result","exec","hrs_24","hrs_12","isPM","./convert_hours_to_12hr_time","./convert_number","./leading_zero","6","timeString_12hr","test","newHrs","indexOf","timeResult","finalHrs","timeRegEx","7","purified","8","auto_swap","autoSwap","switch_times","select_segment","next_segment","prev_segment","select_cursor_segment","reset","manual_number_entry","clear_segment","increment_current_segment","decrement_current_segment","set_mode","handle_tab","all_number_keys","named_keys","update_a11y","prev_value","shiftKey","addEventListener","form","focused_via_click","current_value","dataset","preventDefault","segment","is_enter_key","which","is_number_key","is_named_key","is_arrow_key","ArrowDown","ArrowRight","ArrowUp","ArrowLeft","is_mode_key","is_delete_key","Delete","Backspace","Escape","Tab","../accessibility/update_a11y","../events/handle_tab","../helpers/values","../selectors/next_segment","../selectors/prev_segment","../selectors/select_cursor_segment","../selectors/select_segment","../setters/clear_segment","../setters/decrement_current_segment","../setters/increment_current_segment","../setters/manual_number_entry","../setters/reset","../setters/set_mode","../setters/switch_times","../static-values/all_number_keys","../static-values/named_keys","9","eventName","event","createEvent","initEvent","10","backwards_and_first","forwards_and_last","11","trigger_event","./trigger_event","12","can_trigger_change","create_event","inputEvent","changeEvent","input","change","dispatchEvent","./create_event","13","selectorString","$elem","ancestors","push","matchesSelector","msMatchesSelector","matches","parentElement","14","ranges","get_selected_range","selection","range","aboveMin","start","belowMax","end","../static-values/ranges","./get_selected_range","15","aria_labelledby","ariaLabelByID","getAttribute","$ariaLabelBy","getElementById","textContent","aria_label","ariaLabel","for_attribute","id","$forLabel","label_wrapper_element","get_ancestors","$parentLabel","nodeName","title_attribute","titleLabel","labelText","console","error","./get_ancestors","16","selectionStart","selectionEnd","17","timeString","regEx","../converters/convert_number","18","clear","manual_entry_log","entry","items","19","obj","key_values","key","20","traverse","./traverse","21","22","./select_segment","23","set_input_type","type","setSelectionRange","actions","24","segments","direction","modifier","next_segment_index","next","prev","../helpers/manual_entry_log","../static-values/segments","25","set_data_attribute","trigger_both_events","../events/trigger_both_events","../setters/set_data_attribute","26","set_segment","./set_segment","27","switch_mode","nudge_time_segment","./nudge_time_segment","./switch_mode","28","decrement","../setters/decrement","29","30","increment","../setters/increment","31","sorted_number_keys","key_value","entry_count","upper_limits","limit","full_limit","full_entry","at_limit","../static-values/sorted_number_keys","32","time","current_values","current_time","Date","getHours","getMinutes","minutes","up","down","../converters/convert_hours_to_12hr_time","../converters/leading_zero","33","apply_default","./apply_default","34","convert_to_24hr_time","filteredString","time24hr","../converters/convert_to_24hr_time","35","36","newInputVal","./set_data_attribute","37","convert_to_12hr_time","time_string_24hr","twelveHr","../converters/convert_to_12hr_time","38","default_mode","current_mode","new_mode","--","AM","PM","39","switch_to_data_value","set_time","format","is12hr","./set_time","./switch_to_data_value","40","replacementVal","41","../setters/set_time","42","43","Shift","44","45","Object","keys","./ranges","46","forEach","index","number_val","./all_number_keys","47","TimePolyfill","accessibility_block_created","create_a11y_block","get_label","update_time","swap","forcedFormat","bind_events","window","./core/accessibility/create_a11y_block","./core/events/bind_events","./core/getters/get_label","./core/setters/apply_default","./core/setters/set_data_attribute","./core/setters/switch_times","./core/setters/update_time"],"mappings":";;;;;;;;CAAA,WAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,GAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAS,QAAA,IAAA,GAAAL,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAa,OAAAX,IAAAD,EAAAD,EAAAE,GAAA,OAAAD,GAAA,MAAAJ,OAAAiB,GAAA,SAAAT,EAAAU,EAAAJ,GCCAI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A1P,EAAA7D,EAAAuT,KAIA,KAAAvT,EAAAK,OAAA,KAAA6C,KAAAlD,EAAAK,QACA4P,EAAAjQ,GACAuN,EAAAvN,EAAA,MAEAqT,EAAArT,GACAuN,EAAAvN,EAAAA,EAAAK,QAGAmT,EAAAxT,GA9CA,GAUAwB,GAVAyO,EAAAvR,EAAA,gCACA2U,EAAA3U,EAAA,8BACA6O,EAAA7O,EAAA,qCACA8U,EAAA9U,EAAA,6BACAmF,EAAAnF,EAAA,+BACA0U,EAAA1U,EAAA,4BAEAyU,EAAAzU,EAAA,0CAEAwU,GAAA,CAwCAO,UAAAA,OAAAR,aAAAA,GACA7T,IAAAA,EAAAJ,QAAAiU,KA81BGS,yCAAyC,EAAEC,4BAA4B,EAAEC,2BAA2B,GAAGC,+BAA+B,GAAGC,oCAAoC,GAAGC,8BAA8B,GAAGC,6BAA6B,UAAU","file":"time-input-polyfill.min.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i

') + '

';\r\n\t\thtml = html.replace(/\\$label/g, $input.polyfill.label);\r\n\t\thtml = html.replace(/\\$segmentName/g, segmentName);\r\n\t\thtml = html.replace(/\\$segmentValue/g, finalValue);\r\n\t\thtml = html.replace(/\\$fullValue/g, fullValue);\r\n\r\n\t\t$input.polyfill.$a11y.innerHTML = html;\r\n\t}, 1);\r\n}\r\n","\r\nmodule.exports = function convert_hours_to_12hr_time (hours) {\r\n\treturn hours <= 12 ? hours === 0 ? 12 : hours : hours - 12;\r\n}\r\n","\r\nmodule.exports = function convert_number (number) {\r\n\treturn isNaN(number) ? number : parseInt(number);\r\n}\r\n","\r\nvar convert_number = require('./convert_number');\r\nvar convert_hours_to_12hr_time = require('./convert_hours_to_12hr_time');\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_12hr_time (timeString_24hr) {\r\n\tif (timeString_24hr === '') return '--:-- --';\r\n\tvar twentyFour_regex = /([0-9]{2})\\:([0-9]{2})/;\r\n\tvar result = twentyFour_regex.exec(timeString_24hr);\r\n\tvar hrs_24 = convert_number(result[1]);\r\n\tvar min = result[2];\r\n\tvar hrs_12 = convert_hours_to_12hr_time(hrs_24);\r\n\tvar isPM = hrs_24 > 12;\r\n\tvar mode = isPM ? 'PM' : 'AM';\r\n\treturn [leading_zero(hrs_12), ':', min, ' ', mode].join('');\r\n}\r\n","\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_24hr_time (timeString_12hr) {\r\n\tif (/-/.test(timeString_12hr)) return '';\r\n\tvar isPM = timeString_12hr.indexOf('PM') > -1;\r\n\tvar timeResult = /^([0-9]{2})/.exec(timeString_12hr);\r\n\tvar hrs = timeResult ? parseInt(timeResult[1]) : '';\r\n\tvar newHrs;\r\n\tif (hrs === 12) {\r\n\t\tnewHrs = isPM ? 12 : 00;\r\n\t} else {\r\n\t\tnewHrs = isPM ? hrs + 12 : hrs;\r\n\t}\r\n\tvar finalHrs = newHrs === 24 ? 0 : newHrs;\r\n\tvar timeRegEx = /^[0-9]{2}:([0-9]{2}) (AM|PM)/;\r\n\treturn timeString_12hr.replace(timeRegEx, leading_zero(finalHrs)+':$1');\r\n}\r\n","\r\nmodule.exports = function leading_zero (number) {\r\n\tif (isNaN(number)) return number;\r\n\tvar purified = parseInt(number);\r\n\treturn purified < 10 ? '0' + purified : number;\r\n}\r\n","\r\nvar values = require('../helpers/values');\r\n\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar next_segment = require('../selectors/next_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar select_cursor_segment = require('../selectors/select_cursor_segment');\r\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\n\r\nvar reset = require('../setters/reset');\r\nvar manual_number_entry = require('../setters/manual_number_entry');\r\nvar clear_segment = require('../setters/clear_segment');\r\nvar increment_current_segment = require('../setters/increment_current_segment');\r\nvar decrement_current_segment = require('../setters/decrement_current_segment');\r\nvar set_mode = require('../setters/set_mode');\r\nvar switch_times = require('../setters/switch_times');\r\n\r\nvar handle_tab = require('../events/handle_tab');\r\n\r\nvar all_number_keys = require('../static-values/all_number_keys');\r\nvar named_keys = require('../static-values/named_keys');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function bind_events ($input) {\r\n\r\n\tvar prev_value = '';\r\n\r\n\tvar shiftKey = false;\r\n\r\n\tdocument.addEventListener('keydown', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\tdocument.addEventListener('keyup', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\r\n\tif ($input.form) {\r\n\t\t$input.form.addEventListener('submit', function(){\r\n\t\t\tauto_swap($input);\r\n\t\t})\r\n\t}\r\n\r\n\tvar focused_via_click = false;\r\n\r\n\t$input.addEventListener('mousedown', function(){\r\n\t\tfocused_via_click = true;\r\n\t});\r\n\r\n\t// Turns the IE clear button into a reset button\r\n\t$input.addEventListener('mouseup', function(){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif ($input.value === '') reset($input);\r\n\t\t}, 1)\r\n\t});\r\n\r\n\t$input.addEventListener('click', function(e){\r\n\t\tselect_cursor_segment($input);\r\n\t});\r\n\r\n\t$input.addEventListener('blur', function(){\r\n\t\tvar current_value = $input.dataset.value;\r\n\t\tif (current_value !== prev_value) {\r\n\t\t\tprev_value = current_value;\r\n\t\t}\r\n\t\tfocused_via_click = false;\r\n\t});\r\n\r\n\t$input.addEventListener('focus', function(e){\r\n\t\tif (!focused_via_click) {\r\n\t\t\te.preventDefault();\r\n\t\t\tvar segment = shiftKey ? 'mode' : 'hrs';\r\n\t\t\tselect_segment($input, segment);\r\n\t\t}\r\n\t\tupdate_a11y($input, [\r\n\t\t\t'initial',\r\n\t\t\t'select'\r\n\t\t])\r\n\t});\r\n\r\n\t$input.addEventListener('keydown', function(e) {\r\n\t\tvar is_enter_key = e.which === 13;\r\n\t\tif (is_enter_key) return true;\r\n\r\n\t\tvar is_number_key = all_number_keys.indexOf(e.which) > -1;\r\n\t\tvar is_named_key = values(named_keys).indexOf(e.which) > -1;\r\n\t\tvar is_arrow_key = [named_keys.ArrowDown, named_keys.ArrowRight, named_keys.ArrowUp, named_keys.ArrowLeft].indexOf(e.which) > -1;\r\n\t\tvar is_mode_key = [named_keys.a, named_keys.p].indexOf(e.which) > -1;\r\n\t\tvar is_delete_key = [named_keys.Delete, named_keys.Backspace].indexOf(e.which) > -1;\r\n\r\n\t\tif (!is_named_key || is_arrow_key || is_number_key || is_mode_key || is_delete_key) { e.preventDefault(); }\r\n\r\n\t\tif (is_number_key) {\r\n\t\t\tmanual_number_entry($input, e.which);\r\n\t\t}\r\n\r\n\t\tif (is_delete_key) {\r\n\t\t\tvar segment = get_current_segment($input);\r\n\t\t\tclear_segment($input, segment);\r\n\t\t}\r\n\r\n\t\tswitch (e.which) {\r\n\t\t\tcase named_keys.ArrowRight: next_segment($input); break;\r\n\t\t\tcase named_keys.ArrowLeft: prev_segment($input); break;\r\n\t\t\tcase named_keys.ArrowUp: increment_current_segment($input); break;\r\n\t\t\tcase named_keys.ArrowDown: decrement_current_segment($input); break;\r\n\t\t\tcase named_keys.Escape: reset($input); break;\r\n\t\t\tcase named_keys.a: set_mode($input, 'AM'); break;\r\n\t\t\tcase named_keys.p: set_mode($input, 'PM'); break;\r\n\t\t\tcase named_keys.Tab: handle_tab($input, e); break;\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction auto_swap($input) {\r\n\tif ($input.polyfill.autoSwap) {\r\n\t\tswitch_times($input, 24);\r\n\t\tsetTimeout(function(){\r\n\t\t\tswitch_times($input, 12);\r\n\t\t}, 1);\r\n\t}\r\n}\r\n","\r\nmodule.exports = function create_event(eventName){\r\n\tvar event = document.createEvent('Event');\r\n\tevent.initEvent(eventName, true, true);\r\n\treturn event;\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nmodule.exports = function handle_tab($input, e) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tvar backwards_and_first = e.shiftKey && current_segment === 'hrs';\r\n\tvar forwards_and_last = !e.shiftKey && current_segment === 'mode';\r\n\r\n\tif (!backwards_and_first && !forwards_and_last) {\r\n\t\te.preventDefault();\r\n\t\tif (e.shiftKey) {\r\n\t\t\tprev_segment($input);\r\n\t\t} else {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar trigger_event = require('./trigger_event');\r\n\r\n// It seems that oninput and onchange are treated the same way by browsers :/\r\nmodule.exports = function trigger_both_events($input) {\r\n\t// the event only ever fires if there is a full valid value available\r\n\ttrigger_event($input, 'input');\r\n\ttrigger_event($input,'change');\r\n}\r\n","\r\nvar create_event = require('./create_event');\r\n\r\nvar inputEvent = create_event('input');\r\nvar changeEvent = create_event('change');\r\n\r\nmodule.exports = function trigger_event($input, eventName) {\r\n\tvar event = {\r\n\t\tinput: inputEvent,\r\n\t\tchange: changeEvent,\r\n\t}[eventName];\r\n\r\n\tif (can_trigger_change($input)) {\r\n\t\t$input.dispatchEvent(event);\r\n\t}\r\n}\r\n\r\n// Browsers only send out input and change events if the time element has a full valid value\r\nfunction can_trigger_change ($input) {\r\n\treturn !/--/.test($input.value);\r\n}\r\n","// selector is optional, it allows for an early exit\r\nmodule.exports = function ($input, selectorString) {\r\n\tvar $elem = $input;\r\n\r\n\t// https://stackoverflow.com/a/8729274/1611058\r\n\tvar ancestors = [];\r\n\twhile ($elem) {\r\n\t\tancestors.push($elem);\r\n\t\tvar matchesSelector = $elem.msMatchesSelector ?\r\n\t\t\t$elem.msMatchesSelector(selectorString) :\r\n\t\t\t$elem.matches(selectorString);\r\n\t\tif (matchesSelector) {\r\n\t\t\treturn ancestors;\r\n\t\t}\r\n\t\t$elem = $elem.parentElement;\r\n\t}\r\n\r\n\treturn ancestors;\r\n}\r\n","\r\nvar ranges = require('../static-values/ranges');\r\nvar get_selected_range = require('./get_selected_range');\r\n\r\nmodule.exports = function get_current_segment ($input) {\r\n\tvar selection = get_selected_range($input);\r\n\tfor (var segment in ranges) {\r\n\t\tvar range = ranges[segment];\r\n\t\tvar aboveMin = range.start <= selection.start;\r\n\t\tvar belowMax = range.end >= selection.end;\r\n\t\tif (aboveMin && belowMax) {\r\n\t\t\treturn segment;\r\n\t\t}\r\n\t}\r\n\treturn 'hrs';\r\n}\r\n","\r\nvar get_ancestors = require('./get_ancestors');\r\n\r\nmodule.exports = function get_label ($input) {\r\n\r\n\tvar labelText =\r\n\t\taria_labelledby($input) ||\r\n\t\taria_label($input) ||\r\n\t\tfor_attribute($input) ||\r\n\t\tlabel_wrapper_element($input) ||\r\n\t\ttitle_attribute($input);\r\n\r\n\tif (labelText) return labelText;\r\n\r\n\tconsole.error('Label text for input not found.', $input);\r\n\tthrow new Error('Cannot polyfill time input due to a missing label.');\r\n}\r\n\r\nfunction aria_labelledby($input){\r\n\tvar ariaLabelByID = $input.getAttribute('aria-labelledby');\r\n\tif (ariaLabelByID) {\r\n\t\tvar $ariaLabelBy = document.getElementById(ariaLabelByID);\r\n\t\tif ($ariaLabelBy) return $ariaLabelBy.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction aria_label($input){\r\n\tvar ariaLabel = $input.getAttribute('aria-label');\r\n\tif (ariaLabel) return ariaLabel;\r\n\treturn false;\r\n}\r\n\r\nfunction for_attribute($input){\r\n\tif ($input.id) {\r\n\t\tvar $forLabel = document.querySelector('label[for=\"'+$input.id+'\"]');\r\n\t\tif ($forLabel) return $forLabel.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction label_wrapper_element($input){\r\n\tvar ancestors = get_ancestors($input, 'label');\r\n\tvar $parentLabel = ancestors[ancestors.length - 1];\r\n\tif ($parentLabel.nodeName == 'LABEL') return $parentLabel.textContent;\r\n\treturn false\r\n}\r\n\r\nfunction title_attribute($input){\r\n\tvar titleLabel = $input.getAttribute('title');\r\n\tif (titleLabel) return titleLabel;\r\n\treturn false\r\n}\r\n","\r\nmodule.exports = function get_selected_range ($input) {\r\n\treturn { start: $input.selectionStart, end: $input.selectionEnd };\r\n}\r\n","\r\nvar convert_number = require('../converters/convert_number');\r\n\r\nmodule.exports = function get_values ($input, timeString) {\r\n\tvar value = timeString ? timeString : $input.value;\r\n\tvar regEx = /([0-9-]{1,2})\\:([0-9-]{1,2})\\s?(AM|PM|\\-\\-)?/;\r\n\tvar result = regEx.exec(value);\r\n\r\n\treturn {\r\n\t\thrs: convert_number(result[1]),\r\n\t\tmin: convert_number(result[2]),\r\n\t\tmode: result[3],\r\n\t}\r\n}\r\n","\r\nvar manual_entry_log = [];\r\n\r\nfunction clear () {\r\n\tmanual_entry_log = [];\r\n}\r\n\r\nfunction add (entry) {\r\n\tmanual_entry_log.push(entry);\r\n}\r\n\r\nfunction items(){\r\n\treturn manual_entry_log;\r\n}\r\n\r\nmodule.exports = {\r\n\titems: items,\r\n\tclear: clear,\r\n\tadd: add,\r\n}\r\n","\r\n// IE11 doesn't support Object.values()\r\nmodule.exports = function values (obj) {\r\n\tvar key_values = [];\r\n\tfor (var key in obj) {\r\n\t\tkey_values.push(obj[key]);\r\n\t}\r\n\treturn key_values;\r\n}\r\n","\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function next_segment ($input) {\r\n\ttraverse($input, 'next');\r\n}\r\n","\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function prev_segment ($input) {\r\n\ttraverse($input, 'prev');\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('./select_segment');\r\n\r\nmodule.exports = function select_cursor_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tselect_segment($input, current_segment);\r\n}\r\n","\r\nmodule.exports = function select_segment ($input, segment) {\r\n\r\n\tset_input_type();\r\n\r\n\tvar actions = {\r\n\t\thrs: select(0, 2),\r\n\t\tmin: select(3, 5),\r\n\t\tmode: select(6, 8),\r\n\t};\r\n\r\n\tactions[segment]($input);\r\n\r\n\tfunction set_input_type() {\r\n\t\tvar type = segment === 'mode' ? 'text' : 'tel';\r\n\t\t$input.setAttribute('type', type);\r\n\t}\r\n\r\n\tfunction select (start, end) {\r\n\t\treturn function () {\r\n\t\t\t$input.setSelectionRange(start, end);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar segments = require('../static-values/segments');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function traverse ($input, direction) {\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tvar modifier = direction === 'next' ? 1 : -1;\r\n\tvar next_segment_index = segments.indexOf(segment) + modifier;\r\n\r\n\tvar next_segment = {\r\n\t\tnext: segments[next_segment_index] || 'mode',\r\n\t\tprev: next_segment_index < 0 ? 'hrs' : segments[next_segment_index],\r\n\t}[direction];\r\n\r\n\tselect_segment($input, next_segment);\r\n\tmanual_entry_log.clear();\r\n\tupdate_a11y($input, ['select'])\r\n}\r\n","\r\n// I need to keep this separate from reset so that\r\n// I can reset without attracting focus\r\n\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function apply_default ($input) {\r\n\t$input.value = '--:-- --';\r\n\tset_data_attribute($input, '');\r\n\ttrigger_both_events($input);\r\n}\r\n","\r\nvar set_segment = require('./set_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function clear_segment ($input, segment) {\r\n\tset_segment($input, segment, '--');\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n","\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function decrement ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'PM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'down');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar decrement = require('../setters/decrement');\r\n\r\nmodule.exports = function decrement_current_segment ($input){\r\n\tvar current_segment = get_current_segment($input);\r\n\tdecrement($input, current_segment);\r\n}\r\n","\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function increment ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'AM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'up');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar increment = require('../setters/increment');\r\n\r\nmodule.exports = function increment_current_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tincrement($input, current_segment);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar sorted_number_keys = require('../static-values/sorted_number_keys');\r\n\r\nmodule.exports = function manual_number_entry($input, key) {\r\n\tvar key_value = sorted_number_keys[key];\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tif (segment !== 'mode') {\r\n\t\tvar entry_count = manual_entry_log.items().length;\r\n\r\n\t\tvar upper_limits = {\r\n\t\t\thrs: [1,2],\r\n\t\t\tmin: [5,9],\r\n\t\t}\r\n\t\tvar limit = upper_limits[segment][entry_count];\r\n\r\n\t\tif (entry_count < 2) {\r\n\t\t\tmanual_entry_log.add(key_value);\r\n\t\t}\r\n\r\n\t\tvar full_limit = parseInt(upper_limits[segment].join(''));\r\n\t\tvar full_entry = parseInt(manual_entry_log.items().join(''));\r\n\r\n\t\tif (full_limit >= full_entry) {\r\n\t\t\tset_segment($input, segment, full_entry);\r\n\t\t}\r\n\r\n\t\tvar at_limit = key_value > limit || manual_entry_log.items().length === 2;\r\n\r\n\t\tif (at_limit) {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar convert_hours_to_12hr_time = require('../converters/convert_hours_to_12hr_time');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function nudge_time_segment ($input, segment, direction) {\r\n\tvar current_values = get_values($input);\r\n\tvar time;\r\n\r\n\tvar modifier = direction === 'up' ? 1 : -1;\r\n\r\n\tif (current_values[segment] === '--') {\r\n\t\tvar current_time = new Date();\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_time.getHours()),\r\n\t\t\tmin: current_time.getMinutes(),\r\n\t\t}\r\n\t} else {\r\n\t\tvar minutes = {\r\n\t\t\tup : current_values.min < 59 ? current_values.min + modifier : 0,\r\n\t\t\tdown : current_values.min === 0 ? 59 : current_values.min + modifier,\r\n\t\t}\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_values.hrs + modifier),\r\n\t\t\tmin: minutes[direction],\r\n\t\t}\r\n\t}\r\n\r\n\tset_segment($input, segment, leading_zero(time[segment]) );\r\n}\r\n","\r\nvar apply_default = require('./apply_default');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nmodule.exports = function reset ($input) {\r\n\tapply_default($input);\r\n\tselect_segment($input, 'hrs');\r\n}\r\n","\r\nvar convert_to_24hr_time = require('../converters/convert_to_24hr_time')\r\n\r\nmodule.exports = function set_data_attribute($input, timeString_12hr){\r\n\tvar filteredString = timeString_12hr.indexOf('-') > -1 ? '' : timeString_12hr;\r\n\tvar time24hr = convert_to_24hr_time(filteredString);\r\n\t$input.setAttribute('data-value', time24hr);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function set_mode ($input, type) {\r\n\tvar segment = get_current_segment($input);\r\n\tif (segment === 'mode') {\r\n\t\tset_segment($input, segment, type);\r\n\t}\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar select_segment = require('../selectors/select_segment');\r\nvar set_data_attribute = require('./set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function set_segment ($input, segment, value) {\r\n\tvar values = get_values($input);\r\n\tvalues[segment] = value;\r\n\tvar newInputVal = [\r\n\t\tleading_zero(values.hrs),':',\r\n\t\tleading_zero(values.min),' ',\r\n\t\tvalues.mode\r\n\t].join('');\r\n\t$input.value = newInputVal;\r\n\tselect_segment($input, segment);\r\n\tset_data_attribute($input, newInputVal);\r\n\ttrigger_both_events($input);\r\n}\r\n","\r\nvar convert_to_12hr_time = require('../converters/convert_to_12hr_time');\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\n\r\nmodule.exports = function set_time($input, time_string_24hr) {\r\n\tvar twelveHr = convert_to_12hr_time(time_string_24hr);\r\n\t$input.value = twelveHr;\r\n\tset_data_attribute($input, time_string_24hr);\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function switch_mode ($input, default_mode) {\r\n\tdefault_mode = default_mode || 'AM';\r\n\tvar current_mode = get_values($input).mode;\r\n\tvar new_mode = {\r\n\t\t'--' : default_mode,\r\n\t\t'AM' : 'PM',\r\n\t\t'PM' : 'AM',\r\n\t}[current_mode];\r\n\tset_segment($input, 'mode', new_mode);\r\n}\r\n","\r\nvar switch_to_data_value = require('./switch_to_data_value');\r\nvar set_time = require('./set_time');\r\n\r\nmodule.exports = function switch_times ($input, format) {\r\n\tvar is12hr = /\\s/.test($input.value);\r\n\r\n\tif (format != 12 && format != 24) {\r\n\t\tformat = is12hr ? 24 : 12;\r\n\t}\r\n\r\n\tvar actions = {\r\n\t\t12: function(){\r\n\t\t\tif (!is12hr) {\r\n\t\t\t\tset_time($input, $input.dataset.value);\r\n\t\t\t}\r\n\t\t},\r\n\t\t24: function(){\r\n\t\t\tif (is12hr) {\r\n\t\t\t\tswitch_to_data_value($input);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tactions[format]();\r\n}\r\n","\r\nmodule.exports = function($input) {\r\n\tvar replacementVal = $input.dataset.value;\r\n\t$input.value = replacementVal;\r\n}\r\n","\r\nvar set_time = require('../setters/set_time');\r\n\r\nmodule.exports = function update_time($input) {\r\n\tset_time($input, $input.value);\r\n\treturn $input;\r\n}\r\n","var all_number_keys = [\r\n // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\r\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,\r\n 96, 97, 98, 99,100,101,102,103,104,105\r\n];\r\n\r\nmodule.exports = all_number_keys;\r\n","var named_keys = {\r\n\tArrowDown: 40,\r\n\tArrowRight: 39,\r\n\tArrowUp: 38,\r\n\tArrowLeft: 37,\r\n\tBackspace: 8,\r\n\tDelete: 46,\r\n\tTab: 9,\r\n\tShift: 16,\r\n\tEscape: 27,\r\n\ta: 65,\r\n\tp: 80,\r\n}\r\n\r\nmodule.exports = named_keys;\r\n","\r\nvar ranges = {\r\n\thrs : { start: 0, end: 2 },\r\n\tmin : { start: 3, end: 5 },\r\n\tmode : { start: 6, end: 8 },\r\n}\r\n\r\nmodule.exports = ranges;\r\n","\r\nvar ranges = require('./ranges');\r\n\r\nvar segments = Object.keys(ranges);\r\n\r\nmodule.exports = segments;\r\n","\r\nvar all_number_keys = require('./all_number_keys');\r\n\r\nvar sorted_number_keys = {};\r\n// sorted_number_keys = { 48: 0, 49: 1, 96: 0, 97: 1, ... };\r\nall_number_keys.forEach(function(key, index) {\r\n\tvar number_val = index > 9 ? index - 10 : index;\r\n\tsorted_number_keys[key] = number_val;\r\n});\r\n\r\nmodule.exports = sorted_number_keys;\r\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 1ec7127..76fdec1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -44,7 +44,7 @@

Time Input Polyfill

-

v1.0.5

+

v1.0.6

Fork me on GitHub

The demos on this page have been applied manually in order to demonstrate the difference between a real time input and a polyfill time input in modern browsers.

@@ -83,8 +83,8 @@

Download via npm:

Download via CDN:

-
<script src="https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.5"></script>
-

https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.5

+
<script src="https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.6"></script>
+

https://cdn.jsdelivr.net/npm/time-input-polyfill@1.0.6

View documentation:

diff --git a/docs/scripts/main.js b/docs/scripts/main.js index 7ba4557..70a19f7 100644 --- a/docs/scripts/main.js +++ b/docs/scripts/main.js @@ -1,2 +1,2 @@ -!function(){function e(t,n,r){function s(a,i){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!i&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a"+l.join("

")+"

";v=v.replace(/\$label/g,e.polyfill.label),v=v.replace(/\$segmentName/g,c),v=v.replace(/\$segmentValue/g,i),v=v.replace(/\$fullValue/g,_),e.polyfill.$a11y.innerHTML=v},1)}},{"../getters/get_current_segment":15,"../getters/get_values":18}],3:[function(e,t,n){t.exports=function(e){return e<=12?0===e?12:e:e-12}},{}],4:[function(e,t,n){t.exports=function(e){return isNaN(e)?e:parseInt(e)}},{}],5:[function(e,t,n){var r=e("./convert_number"),s=e("./convert_hours_to_12hr_time"),o=e("./leading_zero");t.exports=function(e){if(""===e)return"--:-- --";var t=/([0-9]{2})\:([0-9]{2})/,n=t.exec(e),a=r(n[1]),i=n[2],c=s(a),u=a>12,l=u?"PM":"AM";return[o(c),":",i," ",l].join("")}},{"./convert_hours_to_12hr_time":3,"./convert_number":4,"./leading_zero":7}],6:[function(e,t,n){var r=e("./leading_zero");t.exports=function(e){if(/-/.test(e))return"";var t,n=e.indexOf("PM")>-1,s=/^([0-9]{2})/.exec(e),o=s?parseInt(s[1]):"";t=12===o?n?12:0:n?o+12:o;var a=24===t?0:t,i=/^[0-9]{2}:([0-9]{2}) (AM|PM)/;return e.replace(i,r(a)+":$1")}},{"./leading_zero":7}],7:[function(e,t,n){t.exports=function(e){if(isNaN(e))return e;var t=parseInt(e);return t<10?"0"+t:e}},{}],8:[function(e,t,n){t.exports=function(e){return Array.prototype.slice.call(e,0)}},{}],9:[function(e,t,n){function r(e){e.polyfill.autoSwap&&(d(e,24),setTimeout(function(){d(e,12)},1))}var s=e("../helpers/values"),o=e("../selectors/select_segment"),a=e("../selectors/next_segment"),i=e("../selectors/prev_segment"),c=e("../selectors/select_cursor_segment"),u=e("../getters/get_current_segment"),l=e("../setters/reset"),_=e("../setters/manual_number_entry"),v=e("../setters/clear_segment"),f=e("../setters/increment_current_segment"),g=e("../setters/decrement_current_segment"),m=e("../setters/set_mode"),d=e("../setters/switch_times"),p=e("../events/handle_tab"),h=e("../static-values/all_number_keys"),b=e("../static-values/named_keys"),y=e("../accessibility/update_a11y");t.exports=function(e){var t="",n=!1;document.addEventListener("keydown",function(e){n=e.shiftKey}),document.addEventListener("keyup",function(e){n=e.shiftKey}),e.form&&e.form.addEventListener("submit",function(){r(e)});var d=!1;e.addEventListener("mousedown",function(){d=!0}),e.addEventListener("mouseup",function(){setTimeout(function(){""===e.value&&l(e)},1)}),e.addEventListener("click",function(t){c(e)}),e.addEventListener("blur",function(){var n=e.dataset.value;n!==t&&(t=n),d=!1}),e.addEventListener("focus",function(t){if(!d){t.preventDefault();var r=n?"mode":"hrs";o(e,r)}y(e,["initial","select"])}),e.addEventListener("keydown",function(t){var n=13===t.which;if(n)return!0;var r=h.indexOf(t.which)>-1,o=s(b).indexOf(t.which)>-1,c=[b.ArrowDown,b.ArrowRight,b.ArrowUp,b.ArrowLeft].indexOf(t.which)>-1,d=[b.a,b.p].indexOf(t.which)>-1,y=[b.Delete,b.Backspace].indexOf(t.which)>-1;if((!o||c||r||d||y)&&t.preventDefault(),r&&_(e,t.which),y){var x=u(e);v(e,x)}switch(t.which){case b.ArrowRight:a(e);break;case b.ArrowLeft:i(e);break;case b.ArrowUp:f(e);break;case b.ArrowDown:g(e);break;case b.Escape:l(e);break;case b.a:m(e,"AM");break;case b.p:m(e,"PM");break;case b.Tab:p(e,t)}})}},{"../accessibility/update_a11y":2,"../events/handle_tab":11,"../getters/get_current_segment":15,"../helpers/values":21,"../selectors/next_segment":23,"../selectors/prev_segment":24,"../selectors/select_cursor_segment":25,"../selectors/select_segment":26,"../setters/clear_segment":29,"../setters/decrement_current_segment":31,"../setters/increment_current_segment":33,"../setters/manual_number_entry":34,"../setters/reset":36,"../setters/set_mode":38,"../setters/switch_times":42,"../static-values/all_number_keys":45,"../static-values/named_keys":46}],10:[function(e,t,n){t.exports=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}},{}],11:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("../selectors/prev_segment"),o=e("../selectors/next_segment");t.exports=function(e,t){var n=r(e),a=t.shiftKey&&"hrs"===n,i=!t.shiftKey&&"mode"===n;a||i||(t.preventDefault(),t.shiftKey?s(e):o(e))}},{"../getters/get_current_segment":15,"../selectors/next_segment":23,"../selectors/prev_segment":24}],12:[function(e,t,n){var r=e("./trigger_event");t.exports=function(e){r(e,"input"),r(e,"change")}},{"./trigger_event":13}],13:[function(e,t,n){function r(e){return!/--/.test(e.value)}var s=e("./create_event"),o=s("input"),a=s("change");t.exports=function(e,t){var n={input:o,change:a}[t];r(e)&&e.dispatchEvent(n)}},{"./create_event":10}],14:[function(e,t,n){t.exports=function(e,t){for(var n=e,r=[];n;){r.push(n);var s=n.msMatchesSelector?n.msMatchesSelector(t):n.matches(t);if(s)return r;n=n.parentElement}return r}},{}],15:[function(e,t,n){var r=e("../static-values/ranges"),s=e("./get_selected_range");t.exports=function(e){var t=s(e);for(var n in r){var o=r[n],a=o.start<=t.start,i=o.end>=t.end;if(a&&i)return n}return"hrs"}},{"../static-values/ranges":47,"./get_selected_range":17}],16:[function(e,t,n){function r(e){var t=e.getAttribute("aria-labelledby");if(t){var n=document.getElementById(t);if(n)return n.textContent}return!1}function s(e){var t=e.getAttribute("aria-label");return!!t&&t}function o(e){if(e.id){var t=document.querySelector('label[for="'+e.id+'"]');if(t)return t.textContent}return!1}function a(e){var t=c(e,"label"),n=t[t.length-1];return"LABEL"==n.nodeName&&n.textContent}function i(e){var t=e.getAttribute("title");return!!t&&t}var c=e("./get_ancestors");t.exports=function(e){var t=r(e)||s(e)||o(e)||a(e)||i(e);if(t)return t;throw console.error("Label text for input not found.",e),new Error("Cannot polyfill time input due to a missing label.")}},{"./get_ancestors":14}],17:[function(e,t,n){t.exports=function(e){return{start:e.selectionStart,end:e.selectionEnd}}},{}],18:[function(e,t,n){var r=e("../converters/convert_number");t.exports=function(e,t){var n=t?t:e.value,s=/([0-9-]{1,2})\:([0-9-]{1,2})\s?(AM|PM|\-\-)?/,o=s.exec(n);return{hrs:r(o[1]),min:r(o[2]),mode:o[3]}}},{"../converters/convert_number":4}],19:[function(e,t,n){function r(){a=[]}function s(e){a.push(e)}function o(){return a}var a=[];t.exports={items:o,clear:r,add:s}},{}],20:[function(e,t,n){t.exports=function(e){e.style.msUserSelect="none",e.style.mozUserSelect="none",e.style.webkitUserSelect="none",e.style.userSelect="none"}},{}],21:[function(e,t,n){t.exports=function(e){var t=[];for(var n in e)t.push(e[n]);return t}},{}],22:[function(e,t,n){var r=e("../converters/toArray");t.exports=function(e){var t=document.querySelectorAll(e);return r(t)}},{"../converters/toArray":8}],23:[function(e,t,n){var r=e("./traverse");t.exports=function(e){r(e,"next")}},{"./traverse":27}],24:[function(e,t,n){var r=e("./traverse");t.exports=function(e){r(e,"prev")}},{"./traverse":27}],25:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("./select_segment");t.exports=function(e){var t=r(e);s(e,t)}},{"../getters/get_current_segment":15,"./select_segment":26}],26:[function(e,t,n){t.exports=function(e,t){function n(){var n="mode"===t?"text":"tel";e.setAttribute("type",n)}function r(t,n){return function(){e.setSelectionRange(t,n)}}n();var s={hrs:r(0,2),min:r(3,5),mode:r(6,8)};s[t](e)}},{}],27:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("../selectors/select_segment"),o=e("../helpers/manual_entry_log"),a=e("../static-values/segments"),i=e("../accessibility/update_a11y");t.exports=function(e,t){var n=r(e),c="next"===t?1:-1,u=a.indexOf(n)+c,l={next:a[u]||"mode",prev:u<0?"hrs":a[u]}[t];s(e,l),o.clear(),i(e,["select"])}},{"../accessibility/update_a11y":2,"../getters/get_current_segment":15,"../helpers/manual_entry_log":19,"../selectors/select_segment":26,"../static-values/segments":48}],28:[function(e,t,n){var r=e("../setters/set_data_attribute"),s=e("../events/trigger_both_events");t.exports=function(e){e.value="--:-- --",r(e,""),s(e)}},{"../events/trigger_both_events":12,"../setters/set_data_attribute":37}],29:[function(e,t,n){var r=e("./set_segment"),s=e("../accessibility/update_a11y");t.exports=function(e,t){r(e,t,"--"),s(e,["update"])}},{"../accessibility/update_a11y":2,"./set_segment":39}],30:[function(e,t,n){var r=e("./switch_mode"),s=e("./nudge_time_segment"),o=e("../accessibility/update_a11y");t.exports=function(e,t){"mode"===t?r(e,"PM"):s(e,t,"down"),o(e,["update"])}},{"../accessibility/update_a11y":2,"./nudge_time_segment":35,"./switch_mode":41}],31:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("../setters/decrement");t.exports=function(e){var t=r(e);s(e,t)}},{"../getters/get_current_segment":15,"../setters/decrement":30}],32:[function(e,t,n){var r=e("./switch_mode"),s=e("./nudge_time_segment"),o=e("../accessibility/update_a11y");t.exports=function(e,t){"mode"===t?r(e,"AM"):s(e,t,"up"),o(e,["update"])}},{"../accessibility/update_a11y":2,"./nudge_time_segment":35,"./switch_mode":41}],33:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("../setters/increment");t.exports=function(e){var t=r(e);s(e,t)}},{"../getters/get_current_segment":15,"../setters/increment":32}],34:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("./set_segment"),o=e("../selectors/next_segment"),a=e("../helpers/manual_entry_log"),i=e("../static-values/sorted_number_keys");t.exports=function(e,t){var n=i[t],c=r(e);if("mode"!==c){var u=a.items().length,l={hrs:[1,2],min:[5,9]},_=l[c][u];u<2&&a.add(n);var v=parseInt(l[c].join("")),f=parseInt(a.items().join(""));v>=f&&s(e,c,f);var g=n>_||2===a.items().length;g&&o(e)}}},{"../getters/get_current_segment":15,"../helpers/manual_entry_log":19,"../selectors/next_segment":23,"../static-values/sorted_number_keys":49,"./set_segment":39}],35:[function(e,t,n){var r=e("../getters/get_values"),s=e("../converters/convert_hours_to_12hr_time"),o=e("../converters/leading_zero"),a=e("./set_segment");t.exports=function(e,t,n){var i,c=r(e),u="up"===n?1:-1;if("--"===c[t]){var l=new Date;i={hrs:s(l.getHours()),min:l.getMinutes()}}else{var _={up:c.min<59?c.min+u:0,down:0===c.min?59:c.min+u};i={hrs:s(c.hrs+u),min:_[n]}}a(e,t,o(i[t]))}},{"../converters/convert_hours_to_12hr_time":3,"../converters/leading_zero":7,"../getters/get_values":18,"./set_segment":39}],36:[function(e,t,n){var r=e("./apply_default"),s=e("../selectors/select_segment");t.exports=function(e){r(e),s(e,"hrs")}},{"../selectors/select_segment":26,"./apply_default":28}],37:[function(e,t,n){var r=e("../converters/convert_to_24hr_time");t.exports=function(e,t){var n=t.indexOf("-")>-1?"":t,s=r(n);e.setAttribute("data-value",s)}},{"../converters/convert_to_24hr_time":6}],38:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("./set_segment");t.exports=function(e,t){var n=r(e);"mode"===n&&s(e,n,t)}},{"../getters/get_current_segment":15,"./set_segment":39}],39:[function(e,t,n){var r=e("../getters/get_values"),s=e("../converters/leading_zero"),o=e("../selectors/select_segment"),a=e("./set_data_attribute"),i=e("../events/trigger_both_events");t.exports=function(e,t,n){var c=r(e);c[t]=n;var u=[s(c.hrs),":",s(c.min)," ",c.mode].join("");e.value=u,o(e,t),a(e,u),i(e)}},{"../converters/leading_zero":7,"../events/trigger_both_events":12,"../getters/get_values":18,"../selectors/select_segment":26,"./set_data_attribute":37}],40:[function(e,t,n){var r=e("../converters/convert_to_12hr_time"),s=e("../setters/set_data_attribute");t.exports=function(e,t){var n=r(t);e.value=n,s(e,t)}},{"../converters/convert_to_12hr_time":5,"../setters/set_data_attribute":37}],41:[function(e,t,n){var r=e("../getters/get_values"),s=e("./set_segment");t.exports=function(e,t){t=t||"AM";var n=r(e).mode,o={"--":t,AM:"PM",PM:"AM"}[n];s(e,"mode",o)}},{"../getters/get_values":18,"./set_segment":39}],42:[function(e,t,n){var r=e("./switch_to_data_value"),s=e("./set_time");t.exports=function(e,t){var n=/\s/.test(e.value);12!=t&&24!=t&&(t=n?24:12);var o={12:function(){n||s(e,e.dataset.value)},24:function(){n&&r(e)}};o[t]()}},{"./set_time":40,"./switch_to_data_value":43}],43:[function(e,t,n){t.exports=function(e){var t=e.dataset.value;e.value=t}},{}],44:[function(e,t,n){var r=e("../setters/set_time");t.exports=function(e){return r(e,e.value),e}},{"../setters/set_time":40}],45:[function(e,t,n){var r=[48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105];t.exports=r},{}],46:[function(e,t,n){var r={ArrowDown:40,ArrowRight:39,ArrowUp:38,ArrowLeft:37,Backspace:8,Delete:46,Tab:9,Shift:16,Escape:27,a:65,p:80};t.exports=r},{}],47:[function(e,t,n){var r={hrs:{start:0,end:2},min:{start:3,end:5},mode:{start:6,end:8}};t.exports=r},{}],48:[function(e,t,n){var r=e("./ranges"),s=Object.keys(r);t.exports=s},{"./ranges":47}],49:[function(e,t,n){var r=e("./all_number_keys"),s={};r.forEach(function(e,t){var n=t>9?t-10:t;s[e]=n}),t.exports=s},{"./all_number_keys":45}],50:[function(e,t,n){function r(e){e.setAttribute("autocomplete","off"),o(e),e.setAttribute("aria-hidden",!0),f||(s=v(),f=!0);var t=_(e);e.polyfill={$a11y:s,label:t,autoSwap:!0,update:function(){i(e)},swap:function(t){l(e,t)}},""===e.value||/--/.test(e.value)?(a(e),c(e,"")):(i(e),c(e,e.value)),u(e)}var s,o=e("./core/helpers/prevent_user_select"),a=e("./core/setters/apply_default"),i=e("./core/setters/update_time"),c=e("./core/setters/set_data_attribute"),u=e("./core/events/bind_events"),l=e("./core/setters/switch_times"),_=e("./core/getters/get_label"),v=e("./core/accessibility/create_a11y_block"),f=!1;window&&(window.TimePolyfill=r),t&&(t.exports=r)},{"./core/accessibility/create_a11y_block":1,"./core/events/bind_events":9,"./core/getters/get_label":16,"./core/helpers/prevent_user_select":20,"./core/setters/apply_default":28,"./core/setters/set_data_attribute":37,"./core/setters/switch_times":42,"./core/setters/update_time":44}],51:[function(e,t,n){t.exports=function(e,t){var n=e.querySelector(".result__list"),r=e.querySelector(".result__close"),s="";for(var o in t){var a=t[o].replace(/^$/,'blank');s+=['
','
',o,"
",'
"',a,'"
',"
"].join("")}n.innerHTML=s,e.classList.add("-visible"),r.onclick=function(){e.classList.remove("-visible")}}},{}],52:[function(e,t,n){t.exports=function(e,t){if("undefined"!=typeof gtag)t?gtag("event",e,{event_category:t[0],event_label:t[1],value:t[2]}):gtag("event",e);else{t={};var n={action:e,event_category:t.category||"general",event_label:t.label||"(not set)",value:t.value};console.log("GA event =",n,"* = required")}}},{}],53:[function(e,t,n){"use strict";var r=e("../../index"),s=e("../../core/selectors/_$$"),o=e("../../core/converters/toArray"),a=e("../_modules/result/result"),i=e("./_helpers/gtag");document.addEventListener("DOMContentLoaded",function(){var e=s("input.time");e.forEach(function(e){new r(e),e.oninput=function(){console.log("input",e.dataset.value)},e.onchange=function(){console.log("change",e.dataset.value)},e.addEventListener("change",function(){console.log("listener change")}),e.addEventListener("input",function(){console.log("listener input")})}),document.querySelector("form").onsubmit=function(e){function t(e){var t=[];return o(e.children).forEach(function(e){var n=e.querySelector("label");n&&t.push(n.textContent)}),t}function n(e,t){var n={};return o(e.elements).forEach(function(e,r){"INPUT"===e.nodeName&&(n[t[r]]=e.value)}),n}e.preventDefault();var r=t(this),s=n(this,r),c=document.querySelector(".result");i("form submit"),a(c,s),c.focus()}})},{"../../core/converters/toArray":8,"../../core/selectors/_$$":22,"../../index":50,"../_modules/result/result":51,"./_helpers/gtag":52}]},{},[53]); +!function(){function e(t,n,r){function s(a,i){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!i&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return s(n||e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a"+l.join("

")+"

";v=v.replace(/\$label/g,e.polyfill.label),v=v.replace(/\$segmentName/g,c),v=v.replace(/\$segmentValue/g,i),v=v.replace(/\$fullValue/g,_),e.polyfill.$a11y.innerHTML=v},1)}},{"../getters/get_current_segment":15,"../getters/get_values":18}],3:[function(e,t,n){t.exports=function(e){return e<=12?0===e?12:e:e-12}},{}],4:[function(e,t,n){t.exports=function(e){return isNaN(e)?e:parseInt(e)}},{}],5:[function(e,t,n){var r=e("./convert_number"),s=e("./convert_hours_to_12hr_time"),o=e("./leading_zero");t.exports=function(e){if(""===e)return"--:-- --";var t=/([0-9]{2})\:([0-9]{2})/,n=t.exec(e),a=r(n[1]),i=n[2],c=s(a),u=a>12,l=u?"PM":"AM";return[o(c),":",i," ",l].join("")}},{"./convert_hours_to_12hr_time":3,"./convert_number":4,"./leading_zero":7}],6:[function(e,t,n){var r=e("./leading_zero");t.exports=function(e){if(/-/.test(e))return"";var t,n=e.indexOf("PM")>-1,s=/^([0-9]{2})/.exec(e),o=s?parseInt(s[1]):"";t=12===o?n?12:0:n?o+12:o;var a=24===t?0:t,i=/^[0-9]{2}:([0-9]{2}) (AM|PM)/;return e.replace(i,r(a)+":$1")}},{"./leading_zero":7}],7:[function(e,t,n){t.exports=function(e){if(isNaN(e))return e;var t=parseInt(e);return t<10?"0"+t:e}},{}],8:[function(e,t,n){t.exports=function(e){return Array.prototype.slice.call(e,0)}},{}],9:[function(e,t,n){function r(e){e.polyfill.autoSwap&&(d(e,24),setTimeout(function(){d(e,12)},1))}var s=e("../helpers/values"),o=e("../selectors/select_segment"),a=e("../selectors/next_segment"),i=e("../selectors/prev_segment"),c=e("../selectors/select_cursor_segment"),u=e("../getters/get_current_segment"),l=e("../setters/reset"),_=e("../setters/manual_number_entry"),v=e("../setters/clear_segment"),f=e("../setters/increment_current_segment"),g=e("../setters/decrement_current_segment"),m=e("../setters/set_mode"),d=e("../setters/switch_times"),p=e("../events/handle_tab"),h=e("../static-values/all_number_keys"),b=e("../static-values/named_keys"),y=e("../accessibility/update_a11y");t.exports=function(e){var t="",n=!1;document.addEventListener("keydown",function(e){n=e.shiftKey}),document.addEventListener("keyup",function(e){n=e.shiftKey}),e.form&&e.form.addEventListener("submit",function(){r(e)});var d=!1;e.addEventListener("mousedown",function(){d=!0}),e.addEventListener("mouseup",function(){setTimeout(function(){""===e.value&&l(e)},1)}),e.addEventListener("click",function(t){c(e)}),e.addEventListener("blur",function(){var n=e.dataset.value;n!==t&&(t=n),d=!1}),e.addEventListener("focus",function(t){if(!d){t.preventDefault();var r=n?"mode":"hrs";o(e,r)}y(e,["initial","select"])}),e.addEventListener("keydown",function(t){var n=13===t.which;if(n)return!0;var r=h.indexOf(t.which)>-1,o=s(b).indexOf(t.which)>-1,c=[b.ArrowDown,b.ArrowRight,b.ArrowUp,b.ArrowLeft].indexOf(t.which)>-1,d=[b.a,b.p].indexOf(t.which)>-1,y=[b.Delete,b.Backspace].indexOf(t.which)>-1;if((!o||c||r||d||y)&&t.preventDefault(),r&&_(e,t.which),y){var x=u(e);v(e,x)}switch(t.which){case b.ArrowRight:a(e);break;case b.ArrowLeft:i(e);break;case b.ArrowUp:f(e);break;case b.ArrowDown:g(e);break;case b.Escape:l(e);break;case b.a:m(e,"AM");break;case b.p:m(e,"PM");break;case b.Tab:p(e,t)}})}},{"../accessibility/update_a11y":2,"../events/handle_tab":11,"../getters/get_current_segment":15,"../helpers/values":20,"../selectors/next_segment":22,"../selectors/prev_segment":23,"../selectors/select_cursor_segment":24,"../selectors/select_segment":25,"../setters/clear_segment":28,"../setters/decrement_current_segment":30,"../setters/increment_current_segment":32,"../setters/manual_number_entry":33,"../setters/reset":35,"../setters/set_mode":37,"../setters/switch_times":41,"../static-values/all_number_keys":44,"../static-values/named_keys":45}],10:[function(e,t,n){t.exports=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}},{}],11:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("../selectors/prev_segment"),o=e("../selectors/next_segment");t.exports=function(e,t){var n=r(e),a=t.shiftKey&&"hrs"===n,i=!t.shiftKey&&"mode"===n;a||i||(t.preventDefault(),t.shiftKey?s(e):o(e))}},{"../getters/get_current_segment":15,"../selectors/next_segment":22,"../selectors/prev_segment":23}],12:[function(e,t,n){var r=e("./trigger_event");t.exports=function(e){r(e,"input"),r(e,"change")}},{"./trigger_event":13}],13:[function(e,t,n){function r(e){return!/--/.test(e.value)}var s=e("./create_event"),o=s("input"),a=s("change");t.exports=function(e,t){var n={input:o,change:a}[t];r(e)&&e.dispatchEvent(n)}},{"./create_event":10}],14:[function(e,t,n){t.exports=function(e,t){for(var n=e,r=[];n;){r.push(n);var s=n.msMatchesSelector?n.msMatchesSelector(t):n.matches(t);if(s)return r;n=n.parentElement}return r}},{}],15:[function(e,t,n){var r=e("../static-values/ranges"),s=e("./get_selected_range");t.exports=function(e){var t=s(e);for(var n in r){var o=r[n],a=o.start<=t.start,i=o.end>=t.end;if(a&&i)return n}return"hrs"}},{"../static-values/ranges":46,"./get_selected_range":17}],16:[function(e,t,n){function r(e){var t=e.getAttribute("aria-labelledby");if(t){var n=document.getElementById(t);if(n)return n.textContent}return!1}function s(e){var t=e.getAttribute("aria-label");return!!t&&t}function o(e){if(e.id){var t=document.querySelector('label[for="'+e.id+'"]');if(t)return t.textContent}return!1}function a(e){var t=c(e,"label"),n=t[t.length-1];return"LABEL"==n.nodeName&&n.textContent}function i(e){var t=e.getAttribute("title");return!!t&&t}var c=e("./get_ancestors");t.exports=function(e){var t=r(e)||s(e)||o(e)||a(e)||i(e);if(t)return t;throw console.error("Label text for input not found.",e),new Error("Cannot polyfill time input due to a missing label.")}},{"./get_ancestors":14}],17:[function(e,t,n){t.exports=function(e){return{start:e.selectionStart,end:e.selectionEnd}}},{}],18:[function(e,t,n){var r=e("../converters/convert_number");t.exports=function(e,t){var n=t?t:e.value,s=/([0-9-]{1,2})\:([0-9-]{1,2})\s?(AM|PM|\-\-)?/,o=s.exec(n);return{hrs:r(o[1]),min:r(o[2]),mode:o[3]}}},{"../converters/convert_number":4}],19:[function(e,t,n){function r(){a=[]}function s(e){a.push(e)}function o(){return a}var a=[];t.exports={items:o,clear:r,add:s}},{}],20:[function(e,t,n){t.exports=function(e){var t=[];for(var n in e)t.push(e[n]);return t}},{}],21:[function(e,t,n){var r=e("../converters/toArray");t.exports=function(e){var t=document.querySelectorAll(e);return r(t)}},{"../converters/toArray":8}],22:[function(e,t,n){var r=e("./traverse");t.exports=function(e){r(e,"next")}},{"./traverse":26}],23:[function(e,t,n){var r=e("./traverse");t.exports=function(e){r(e,"prev")}},{"./traverse":26}],24:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("./select_segment");t.exports=function(e){var t=r(e);s(e,t)}},{"../getters/get_current_segment":15,"./select_segment":25}],25:[function(e,t,n){t.exports=function(e,t){function n(){var n="mode"===t?"text":"tel";e.setAttribute("type",n)}function r(t,n){return function(){e.setSelectionRange(t,n)}}n();var s={hrs:r(0,2),min:r(3,5),mode:r(6,8)};s[t](e)}},{}],26:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("../selectors/select_segment"),o=e("../helpers/manual_entry_log"),a=e("../static-values/segments"),i=e("../accessibility/update_a11y");t.exports=function(e,t){var n=r(e),c="next"===t?1:-1,u=a.indexOf(n)+c,l={next:a[u]||"mode",prev:u<0?"hrs":a[u]}[t];s(e,l),o.clear(),i(e,["select"])}},{"../accessibility/update_a11y":2,"../getters/get_current_segment":15,"../helpers/manual_entry_log":19,"../selectors/select_segment":25,"../static-values/segments":47}],27:[function(e,t,n){var r=e("../setters/set_data_attribute"),s=e("../events/trigger_both_events");t.exports=function(e){e.value="--:-- --",r(e,""),s(e)}},{"../events/trigger_both_events":12,"../setters/set_data_attribute":36}],28:[function(e,t,n){var r=e("./set_segment"),s=e("../accessibility/update_a11y");t.exports=function(e,t){r(e,t,"--"),s(e,["update"])}},{"../accessibility/update_a11y":2,"./set_segment":38}],29:[function(e,t,n){var r=e("./switch_mode"),s=e("./nudge_time_segment"),o=e("../accessibility/update_a11y");t.exports=function(e,t){"mode"===t?r(e,"PM"):s(e,t,"down"),o(e,["update"])}},{"../accessibility/update_a11y":2,"./nudge_time_segment":34,"./switch_mode":40}],30:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("../setters/decrement");t.exports=function(e){var t=r(e);s(e,t)}},{"../getters/get_current_segment":15,"../setters/decrement":29}],31:[function(e,t,n){var r=e("./switch_mode"),s=e("./nudge_time_segment"),o=e("../accessibility/update_a11y");t.exports=function(e,t){"mode"===t?r(e,"AM"):s(e,t,"up"),o(e,["update"])}},{"../accessibility/update_a11y":2,"./nudge_time_segment":34,"./switch_mode":40}],32:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("../setters/increment");t.exports=function(e){var t=r(e);s(e,t)}},{"../getters/get_current_segment":15,"../setters/increment":31}],33:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("./set_segment"),o=e("../selectors/next_segment"),a=e("../helpers/manual_entry_log"),i=e("../static-values/sorted_number_keys");t.exports=function(e,t){var n=i[t],c=r(e);if("mode"!==c){var u=a.items().length,l={hrs:[1,2],min:[5,9]},_=l[c][u];u<2&&a.add(n);var v=parseInt(l[c].join("")),f=parseInt(a.items().join(""));v>=f&&s(e,c,f);var g=n>_||2===a.items().length;g&&o(e)}}},{"../getters/get_current_segment":15,"../helpers/manual_entry_log":19,"../selectors/next_segment":22,"../static-values/sorted_number_keys":48,"./set_segment":38}],34:[function(e,t,n){var r=e("../getters/get_values"),s=e("../converters/convert_hours_to_12hr_time"),o=e("../converters/leading_zero"),a=e("./set_segment");t.exports=function(e,t,n){var i,c=r(e),u="up"===n?1:-1;if("--"===c[t]){var l=new Date;i={hrs:s(l.getHours()),min:l.getMinutes()}}else{var _={up:c.min<59?c.min+u:0,down:0===c.min?59:c.min+u};i={hrs:s(c.hrs+u),min:_[n]}}a(e,t,o(i[t]))}},{"../converters/convert_hours_to_12hr_time":3,"../converters/leading_zero":7,"../getters/get_values":18,"./set_segment":38}],35:[function(e,t,n){var r=e("./apply_default"),s=e("../selectors/select_segment");t.exports=function(e){r(e),s(e,"hrs")}},{"../selectors/select_segment":25,"./apply_default":27}],36:[function(e,t,n){var r=e("../converters/convert_to_24hr_time");t.exports=function(e,t){var n=t.indexOf("-")>-1?"":t,s=r(n);e.setAttribute("data-value",s)}},{"../converters/convert_to_24hr_time":6}],37:[function(e,t,n){var r=e("../getters/get_current_segment"),s=e("./set_segment");t.exports=function(e,t){var n=r(e);"mode"===n&&s(e,n,t)}},{"../getters/get_current_segment":15,"./set_segment":38}],38:[function(e,t,n){var r=e("../getters/get_values"),s=e("../converters/leading_zero"),o=e("../selectors/select_segment"),a=e("./set_data_attribute"),i=e("../events/trigger_both_events");t.exports=function(e,t,n){var c=r(e);c[t]=n;var u=[s(c.hrs),":",s(c.min)," ",c.mode].join("");e.value=u,o(e,t),a(e,u),i(e)}},{"../converters/leading_zero":7,"../events/trigger_both_events":12,"../getters/get_values":18,"../selectors/select_segment":25,"./set_data_attribute":36}],39:[function(e,t,n){var r=e("../converters/convert_to_12hr_time"),s=e("../setters/set_data_attribute");t.exports=function(e,t){var n=r(t);e.value=n,s(e,t)}},{"../converters/convert_to_12hr_time":5,"../setters/set_data_attribute":36}],40:[function(e,t,n){var r=e("../getters/get_values"),s=e("./set_segment");t.exports=function(e,t){t=t||"AM";var n=r(e).mode,o={"--":t,AM:"PM",PM:"AM"}[n];s(e,"mode",o)}},{"../getters/get_values":18,"./set_segment":38}],41:[function(e,t,n){var r=e("./switch_to_data_value"),s=e("./set_time");t.exports=function(e,t){var n=/\s/.test(e.value);12!=t&&24!=t&&(t=n?24:12);var o={12:function(){n||s(e,e.dataset.value)},24:function(){n&&r(e)}};o[t]()}},{"./set_time":39,"./switch_to_data_value":42}],42:[function(e,t,n){t.exports=function(e){var t=e.dataset.value;e.value=t}},{}],43:[function(e,t,n){var r=e("../setters/set_time");t.exports=function(e){return r(e,e.value),e}},{"../setters/set_time":39}],44:[function(e,t,n){var r=[48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105];t.exports=r},{}],45:[function(e,t,n){var r={ArrowDown:40,ArrowRight:39,ArrowUp:38,ArrowLeft:37,Backspace:8,Delete:46,Tab:9,Shift:16,Escape:27,a:65,p:80};t.exports=r},{}],46:[function(e,t,n){var r={hrs:{start:0,end:2},min:{start:3,end:5},mode:{start:6,end:8}};t.exports=r},{}],47:[function(e,t,n){var r=e("./ranges"),s=Object.keys(r);t.exports=s},{"./ranges":46}],48:[function(e,t,n){var r=e("./all_number_keys"),s={};r.forEach(function(e,t){var n=t>9?t-10:t;s[e]=n}),t.exports=s},{"./all_number_keys":44}],49:[function(e,t,n){function r(e){e.setAttribute("autocomplete","off"),e.setAttribute("aria-hidden",!0),v||(s=_(),v=!0);var t=l(e);e.polyfill={$a11y:s,label:t,autoSwap:!0,update:function(){a(e)},swap:function(t){u(e,t)}},""===e.value||/--/.test(e.value)?(o(e),i(e,"")):(a(e),i(e,e.value)),c(e)}var s,o=e("./core/setters/apply_default"),a=e("./core/setters/update_time"),i=e("./core/setters/set_data_attribute"),c=e("./core/events/bind_events"),u=e("./core/setters/switch_times"),l=e("./core/getters/get_label"),_=e("./core/accessibility/create_a11y_block"),v=!1;window&&(window.TimePolyfill=r),t&&(t.exports=r)},{"./core/accessibility/create_a11y_block":1,"./core/events/bind_events":9,"./core/getters/get_label":16,"./core/setters/apply_default":27,"./core/setters/set_data_attribute":36,"./core/setters/switch_times":41,"./core/setters/update_time":43}],50:[function(e,t,n){t.exports=function(e,t){var n=e.querySelector(".result__list"),r=e.querySelector(".result__close"),s="";for(var o in t){var a=t[o].replace(/^$/,'blank');s+=['
','
',o,"
",'
"',a,'"
',"
"].join("")}n.innerHTML=s,e.classList.add("-visible"),r.onclick=function(){e.classList.remove("-visible")}}},{}],51:[function(e,t,n){t.exports=function(e,t){if("undefined"!=typeof gtag)t?gtag("event",e,{event_category:t[0],event_label:t[1],value:t[2]}):gtag("event",e);else{t={};var n={action:e,event_category:t.category||"general",event_label:t.label||"(not set)",value:t.value};console.log("GA event =",n,"* = required")}}},{}],52:[function(e,t,n){"use strict";var r=e("../../index"),s=e("../../core/selectors/_$$"),o=e("../../core/converters/toArray"),a=e("../_modules/result/result"),i=e("./_helpers/gtag");document.addEventListener("DOMContentLoaded",function(){var e=s("input.time");e.forEach(function(e){new r(e),e.oninput=function(){console.log("input",e.dataset.value)},e.onchange=function(){console.log("change",e.dataset.value)},e.addEventListener("change",function(){console.log("listener change")}),e.addEventListener("input",function(){console.log("listener input")})}),document.querySelector("form").onsubmit=function(e){function t(e){var t=[];return o(e.children).forEach(function(e){var n=e.querySelector("label");n&&t.push(n.textContent)}),t}function n(e,t){var n={};return o(e.elements).forEach(function(e,r){"INPUT"===e.nodeName&&(n[t[r]]=e.value)}),n}e.preventDefault();var r=t(this),s=n(this,r),c=document.querySelector(".result");i("form submit"),a(c,s),c.focus()}})},{"../../core/converters/toArray":8,"../../core/selectors/_$$":21,"../../index":49,"../_modules/result/result":50,"./_helpers/gtag":51}]},{},[52]); //# sourceMappingURL=main.js.map diff --git a/docs/scripts/main.js.map b/docs/scripts/main.js.map index 3d69166..eb3985f 100644 --- a/docs/scripts/main.js.map +++ b/docs/scripts/main.js.map @@ -1 +1 @@ -{"version":3,"sources":["src/_scripts/node_modules/browser-pack/_prelude.js","src/_scripts/core/accessibility/create_a11y_block.js","src/_scripts/main.js","src/_scripts/core/accessibility/update_a11y.js","src/_scripts/core/converters/convert_hours_to_12hr_time.js","src/_scripts/core/converters/convert_number.js","src/_scripts/core/converters/convert_to_12hr_time.js","src/_scripts/core/converters/convert_to_24hr_time.js","src/_scripts/core/converters/leading_zero.js","src/_scripts/core/converters/toArray.js","src/_scripts/core/events/bind_events.js","src/_scripts/core/events/create_event.js","src/_scripts/core/events/handle_tab.js","src/_scripts/core/events/trigger_both_events.js","src/_scripts/core/events/trigger_event.js","src/_scripts/core/getters/get_ancestors.js","src/_scripts/core/getters/get_current_segment.js","src/_scripts/core/getters/get_label.js","src/_scripts/core/getters/get_selected_range.js","src/_scripts/core/getters/get_values.js","src/_scripts/core/helpers/manual_entry_log.js","src/_scripts/core/helpers/prevent_user_select.js","src/_scripts/core/helpers/values.js","src/_scripts/core/selectors/_$$.js","src/_scripts/core/selectors/next_segment.js","src/_scripts/core/selectors/prev_segment.js","src/_scripts/core/selectors/select_cursor_segment.js","src/_scripts/core/selectors/select_segment.js","src/_scripts/core/selectors/traverse.js","src/_scripts/core/setters/apply_default.js","src/_scripts/core/setters/clear_segment.js","src/_scripts/core/setters/decrement.js","src/_scripts/core/setters/decrement_current_segment.js","src/_scripts/core/setters/increment.js","src/_scripts/core/setters/increment_current_segment.js","src/_scripts/core/setters/manual_number_entry.js","src/_scripts/core/setters/nudge_time_segment.js","src/_scripts/core/setters/reset.js","src/_scripts/core/setters/set_data_attribute.js","src/_scripts/core/setters/set_mode.js","src/_scripts/core/setters/set_segment.js","src/_scripts/core/setters/set_time.js","src/_scripts/core/setters/switch_mode.js","src/_scripts/core/setters/switch_times.js","src/_scripts/core/setters/switch_to_data_value.js","src/_scripts/core/setters/update_time.js","src/_scripts/core/static-values/all_number_keys.js","src/_scripts/core/static-values/named_keys.js","src/_scripts/core/static-values/ranges.js","src/_scripts/core/static-values/segments.js","src/_scripts/core/static-values/sorted_number_keys.js","src/_scripts/index.js","src/_scripts/src/_modules/result/result.js","src/_scripts/src/_scripts/_helpers/gtag.js","src/_scripts/src/_scripts/main.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","$block","document","createElement","setAttribute","classList","add","querySelector","appendChild","2","get_current_segment","get_values","$input","announcementArray","setTimeout","current_segment","values","value","finalValue","segmentName","hrs","min","mode","announcements","initial","select","update","textArray","map","providedString","fullValue","replace","html","join","polyfill","label","$a11y","innerHTML","../getters/get_current_segment","../getters/get_values","3","hours","4","number","isNaN","parseInt","5","convert_number","convert_hours_to_12hr_time","leading_zero","timeString_24hr","twentyFour_regex","result","exec","hrs_24","hrs_12","isPM","./convert_hours_to_12hr_time","./convert_number","./leading_zero","6","timeString_12hr","test","newHrs","indexOf","timeResult","finalHrs","timeRegEx","7","purified","8","array","Array","prototype","slice","9","auto_swap","autoSwap","switch_times","select_segment","next_segment","prev_segment","select_cursor_segment","reset","manual_number_entry","clear_segment","increment_current_segment","decrement_current_segment","set_mode","handle_tab","all_number_keys","named_keys","update_a11y","prev_value","shiftKey","addEventListener","form","focused_via_click","current_value","dataset","preventDefault","segment","is_enter_key","which","is_number_key","is_named_key","is_arrow_key","ArrowDown","ArrowRight","ArrowUp","ArrowLeft","is_mode_key","is_delete_key","Delete","Backspace","Escape","Tab","../accessibility/update_a11y","../events/handle_tab","../helpers/values","../selectors/next_segment","../selectors/prev_segment","../selectors/select_cursor_segment","../selectors/select_segment","../setters/clear_segment","../setters/decrement_current_segment","../setters/increment_current_segment","../setters/manual_number_entry","../setters/reset","../setters/set_mode","../setters/switch_times","../static-values/all_number_keys","../static-values/named_keys","10","eventName","event","createEvent","initEvent","11","backwards_and_first","forwards_and_last","12","trigger_event","./trigger_event","13","can_trigger_change","create_event","inputEvent","changeEvent","input","change","dispatchEvent","./create_event","14","selectorString","$elem","ancestors","push","matchesSelector","msMatchesSelector","matches","parentElement","15","ranges","get_selected_range","selection","range","aboveMin","start","belowMax","end","../static-values/ranges","./get_selected_range","16","aria_labelledby","ariaLabelByID","getAttribute","$ariaLabelBy","getElementById","textContent","aria_label","ariaLabel","for_attribute","id","$forLabel","label_wrapper_element","get_ancestors","$parentLabel","nodeName","title_attribute","titleLabel","labelText","console","error","./get_ancestors","17","selectionStart","selectionEnd","18","timeString","regEx","../converters/convert_number","19","clear","manual_entry_log","entry","items","20","style","msUserSelect","mozUserSelect","webkitUserSelect","userSelect","21","obj","key_values","key","22","toArray","selector","elements","querySelectorAll","../converters/toArray","23","traverse","./traverse","24","25","./select_segment","26","set_input_type","type","setSelectionRange","actions","27","segments","direction","modifier","next_segment_index","next","prev","../helpers/manual_entry_log","../static-values/segments","28","set_data_attribute","trigger_both_events","../events/trigger_both_events","../setters/set_data_attribute","29","set_segment","./set_segment","30","switch_mode","nudge_time_segment","./nudge_time_segment","./switch_mode","31","decrement","../setters/decrement","32","33","increment","../setters/increment","34","sorted_number_keys","key_value","entry_count","upper_limits","limit","full_limit","full_entry","at_limit","../static-values/sorted_number_keys","35","time","current_values","current_time","Date","getHours","getMinutes","minutes","up","down","../converters/convert_hours_to_12hr_time","../converters/leading_zero","36","apply_default","./apply_default","37","convert_to_24hr_time","filteredString","time24hr","../converters/convert_to_24hr_time","38","39","newInputVal","./set_data_attribute","40","convert_to_12hr_time","time_string_24hr","twelveHr","../converters/convert_to_12hr_time","41","default_mode","current_mode","new_mode","--","AM","PM","42","switch_to_data_value","set_time","format","is12hr","./set_time","./switch_to_data_value","43","replacementVal","44","../setters/set_time","45","46","Shift","47","48","Object","keys","./ranges","49","forEach","index","number_val","./all_number_keys","50","TimePolyfill","prevent_user_select","accessibility_block_created","create_a11y_block","get_label","update_time","swap","forcedFormat","bind_events","window","./core/accessibility/create_a11y_block","./core/events/bind_events","./core/getters/get_label","./core/helpers/prevent_user_select","./core/setters/apply_default","./core/setters/set_data_attribute","./core/setters/switch_times","./core/setters/update_time","51","$result","$list","$close","onclick","remove","52","action","categoryLabelValue","gtag","event_category","event_label","data","category","log","53","_$$","ga","$$timeInputs","element","oninput","onchange","onsubmit","get_labels","labelList","children","$label","labels","valuesList","this","focus","../../core/converters/toArray","../../core/selectors/_$$","../../index","../_modules/result/result","./_helpers/gtag"],"mappings":"CAAA,WAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,GAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAS,QAAA,IAAA,GAAAL,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAa,OAAAX,IAAAD,EAAAD,EAAAE,GAAA,OAAAD,GAA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AA,QAAA+W,SAAA,SAAAvY,GAWA,QAAAwY,GAAAvR,GACA,GAAAwR,KAOA,OANA9J,GAAA1H,EAAAyR,UAAAhD,QAAA,SAAA0C,GACA,GAAAO,GAAAP,EAAA5W,cAAA,QACAmX,IACAF,EAAA3N,KAAA6N,EAAAvM,eAGAqM,EAGA,QAAA7W,GAAAqF,EAAA2R,GACA,GAAAC,KAMA,OALAlK,GAAA1H,EAAA4H,UAAA6G,QAAA,SAAA0C,EAAAhY,GACA,UAAAgY,EAAAvL,WACAgM,EAAAD,EAAAxY,IAAAgY,EAAAlW,SAGA2W,EA5BA7Y,EAAAqH,gBACA,IAAAuR,GAAAJ,EAAAM,MACA7W,EAAAL,EAAAkX,KAAAF,GACA1B,EAAA/V,SAAAK,cAAA,UAEA0W,GAAA,eAEA7T,EAAA6S,EAAAjV,GACAiV,EAAA6B,apD6/BGC,gCAAgC,EAAEC,2BAA2B,GAAGC,cAAc,GAAGC,4BAA4B,GAAGC,kBAAkB,UAAU","file":"scripts/main.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i

') + '

';\r\n\t\thtml = html.replace(/\\$label/g, $input.polyfill.label);\r\n\t\thtml = html.replace(/\\$segmentName/g, segmentName);\r\n\t\thtml = html.replace(/\\$segmentValue/g, finalValue);\r\n\t\thtml = html.replace(/\\$fullValue/g, fullValue);\r\n\r\n\t\t$input.polyfill.$a11y.innerHTML = html;\r\n\t}, 1);\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../getters/get_values\":18}],3:[function(require,module,exports){\n\r\nmodule.exports = function convert_hours_to_12hr_time (hours) {\r\n\treturn hours <= 12 ? hours === 0 ? 12 : hours : hours - 12;\r\n}\r\n\n},{}],4:[function(require,module,exports){\n\r\nmodule.exports = function convert_number (number) {\r\n\treturn isNaN(number) ? number : parseInt(number);\r\n}\r\n\n},{}],5:[function(require,module,exports){\n\r\nvar convert_number = require('./convert_number');\r\nvar convert_hours_to_12hr_time = require('./convert_hours_to_12hr_time');\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_12hr_time (timeString_24hr) {\r\n\tif (timeString_24hr === '') return '--:-- --';\r\n\tvar twentyFour_regex = /([0-9]{2})\\:([0-9]{2})/;\r\n\tvar result = twentyFour_regex.exec(timeString_24hr);\r\n\tvar hrs_24 = convert_number(result[1]);\r\n\tvar min = result[2];\r\n\tvar hrs_12 = convert_hours_to_12hr_time(hrs_24);\r\n\tvar isPM = hrs_24 > 12;\r\n\tvar mode = isPM ? 'PM' : 'AM';\r\n\treturn [leading_zero(hrs_12), ':', min, ' ', mode].join('');\r\n}\r\n\n},{\"./convert_hours_to_12hr_time\":3,\"./convert_number\":4,\"./leading_zero\":7}],6:[function(require,module,exports){\n\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_24hr_time (timeString_12hr) {\r\n\tif (/-/.test(timeString_12hr)) return '';\r\n\tvar isPM = timeString_12hr.indexOf('PM') > -1;\r\n\tvar timeResult = /^([0-9]{2})/.exec(timeString_12hr);\r\n\tvar hrs = timeResult ? parseInt(timeResult[1]) : '';\r\n\tvar newHrs;\r\n\tif (hrs === 12) {\r\n\t\tnewHrs = isPM ? 12 : 00;\r\n\t} else {\r\n\t\tnewHrs = isPM ? hrs + 12 : hrs;\r\n\t}\r\n\tvar finalHrs = newHrs === 24 ? 0 : newHrs;\r\n\tvar timeRegEx = /^[0-9]{2}:([0-9]{2}) (AM|PM)/;\r\n\treturn timeString_12hr.replace(timeRegEx, leading_zero(finalHrs)+':$1');\r\n}\r\n\n},{\"./leading_zero\":7}],7:[function(require,module,exports){\n\r\nmodule.exports = function leading_zero (number) {\r\n\tif (isNaN(number)) return number;\r\n\tvar purified = parseInt(number);\r\n\treturn purified < 10 ? '0' + purified : number;\r\n}\r\n\n},{}],8:[function(require,module,exports){\n\r\nmodule.exports = function(array){\r\n\treturn Array.prototype.slice.call(array, 0);\r\n}\r\n\n},{}],9:[function(require,module,exports){\n\r\nvar values = require('../helpers/values');\r\n\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar next_segment = require('../selectors/next_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar select_cursor_segment = require('../selectors/select_cursor_segment');\r\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\n\r\nvar reset = require('../setters/reset');\r\nvar manual_number_entry = require('../setters/manual_number_entry');\r\nvar clear_segment = require('../setters/clear_segment');\r\nvar increment_current_segment = require('../setters/increment_current_segment');\r\nvar decrement_current_segment = require('../setters/decrement_current_segment');\r\nvar set_mode = require('../setters/set_mode');\r\nvar switch_times = require('../setters/switch_times');\r\n\r\nvar handle_tab = require('../events/handle_tab');\r\n\r\nvar all_number_keys = require('../static-values/all_number_keys');\r\nvar named_keys = require('../static-values/named_keys');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function bind_events ($input) {\r\n\r\n\tvar prev_value = '';\r\n\r\n\tvar shiftKey = false;\r\n\r\n\tdocument.addEventListener('keydown', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\tdocument.addEventListener('keyup', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\r\n\tif ($input.form) {\r\n\t\t$input.form.addEventListener('submit', function(){\r\n\t\t\tauto_swap($input);\r\n\t\t})\r\n\t}\r\n\r\n\tvar focused_via_click = false;\r\n\r\n\t$input.addEventListener('mousedown', function(){\r\n\t\tfocused_via_click = true;\r\n\t});\r\n\r\n\t// Turns the IE clear button into a reset button\r\n\t$input.addEventListener('mouseup', function(){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif ($input.value === '') reset($input);\r\n\t\t}, 1)\r\n\t});\r\n\r\n\t$input.addEventListener('click', function(e){\r\n\t\tselect_cursor_segment($input);\r\n\t});\r\n\r\n\t$input.addEventListener('blur', function(){\r\n\t\tvar current_value = $input.dataset.value;\r\n\t\tif (current_value !== prev_value) {\r\n\t\t\tprev_value = current_value;\r\n\t\t}\r\n\t\tfocused_via_click = false;\r\n\t});\r\n\r\n\t$input.addEventListener('focus', function(e){\r\n\t\tif (!focused_via_click) {\r\n\t\t\te.preventDefault();\r\n\t\t\tvar segment = shiftKey ? 'mode' : 'hrs';\r\n\t\t\tselect_segment($input, segment);\r\n\t\t}\r\n\t\tupdate_a11y($input, [\r\n\t\t\t'initial',\r\n\t\t\t'select'\r\n\t\t])\r\n\t});\r\n\r\n\t$input.addEventListener('keydown', function(e) {\r\n\t\tvar is_enter_key = e.which === 13;\r\n\t\tif (is_enter_key) return true;\r\n\r\n\t\tvar is_number_key = all_number_keys.indexOf(e.which) > -1;\r\n\t\tvar is_named_key = values(named_keys).indexOf(e.which) > -1;\r\n\t\tvar is_arrow_key = [named_keys.ArrowDown, named_keys.ArrowRight, named_keys.ArrowUp, named_keys.ArrowLeft].indexOf(e.which) > -1;\r\n\t\tvar is_mode_key = [named_keys.a, named_keys.p].indexOf(e.which) > -1;\r\n\t\tvar is_delete_key = [named_keys.Delete, named_keys.Backspace].indexOf(e.which) > -1;\r\n\r\n\t\tif (!is_named_key || is_arrow_key || is_number_key || is_mode_key || is_delete_key) { e.preventDefault(); }\r\n\r\n\t\tif (is_number_key) {\r\n\t\t\tmanual_number_entry($input, e.which);\r\n\t\t}\r\n\r\n\t\tif (is_delete_key) {\r\n\t\t\tvar segment = get_current_segment($input);\r\n\t\t\tclear_segment($input, segment);\r\n\t\t}\r\n\r\n\t\tswitch (e.which) {\r\n\t\t\tcase named_keys.ArrowRight: next_segment($input); break;\r\n\t\t\tcase named_keys.ArrowLeft: prev_segment($input); break;\r\n\t\t\tcase named_keys.ArrowUp: increment_current_segment($input); break;\r\n\t\t\tcase named_keys.ArrowDown: decrement_current_segment($input); break;\r\n\t\t\tcase named_keys.Escape: reset($input); break;\r\n\t\t\tcase named_keys.a: set_mode($input, 'AM'); break;\r\n\t\t\tcase named_keys.p: set_mode($input, 'PM'); break;\r\n\t\t\tcase named_keys.Tab: handle_tab($input, e); break;\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction auto_swap($input) {\r\n\tif ($input.polyfill.autoSwap) {\r\n\t\tswitch_times($input, 24);\r\n\t\tsetTimeout(function(){\r\n\t\t\tswitch_times($input, 12);\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\n},{\"../accessibility/update_a11y\":2,\"../events/handle_tab\":11,\"../getters/get_current_segment\":15,\"../helpers/values\":21,\"../selectors/next_segment\":23,\"../selectors/prev_segment\":24,\"../selectors/select_cursor_segment\":25,\"../selectors/select_segment\":26,\"../setters/clear_segment\":29,\"../setters/decrement_current_segment\":31,\"../setters/increment_current_segment\":33,\"../setters/manual_number_entry\":34,\"../setters/reset\":36,\"../setters/set_mode\":38,\"../setters/switch_times\":42,\"../static-values/all_number_keys\":45,\"../static-values/named_keys\":46}],10:[function(require,module,exports){\n\r\nmodule.exports = function create_event(eventName){\r\n\tvar event = document.createEvent('Event');\r\n\tevent.initEvent(eventName, true, true);\r\n\treturn event;\r\n}\r\n\n},{}],11:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nmodule.exports = function handle_tab($input, e) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tvar backwards_and_first = e.shiftKey && current_segment === 'hrs';\r\n\tvar forwards_and_last = !e.shiftKey && current_segment === 'mode';\r\n\r\n\tif (!backwards_and_first && !forwards_and_last) {\r\n\t\te.preventDefault();\r\n\t\tif (e.shiftKey) {\r\n\t\t\tprev_segment($input);\r\n\t\t} else {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../selectors/next_segment\":23,\"../selectors/prev_segment\":24}],12:[function(require,module,exports){\n\r\nvar trigger_event = require('./trigger_event');\r\n\r\n// It seems that oninput and onchange are treated the same way by browsers :/\r\nmodule.exports = function trigger_both_events($input) {\r\n\t// the event only ever fires if there is a full valid value available\r\n\ttrigger_event($input, 'input');\r\n\ttrigger_event($input,'change');\r\n}\r\n\n},{\"./trigger_event\":13}],13:[function(require,module,exports){\n\r\nvar create_event = require('./create_event');\r\n\r\nvar inputEvent = create_event('input');\r\nvar changeEvent = create_event('change');\r\n\r\nmodule.exports = function trigger_event($input, eventName) {\r\n\tvar event = {\r\n\t\tinput: inputEvent,\r\n\t\tchange: changeEvent,\r\n\t}[eventName];\r\n\r\n\tif (can_trigger_change($input)) {\r\n\t\t$input.dispatchEvent(event);\r\n\t}\r\n}\r\n\r\n// Browsers only send out input and change events if the time element has a full valid value\r\nfunction can_trigger_change ($input) {\r\n\treturn !/--/.test($input.value);\r\n}\r\n\n},{\"./create_event\":10}],14:[function(require,module,exports){\n// selector is optional, it allows for an early exit\r\nmodule.exports = function ($input, selectorString) {\r\n\tvar $elem = $input;\r\n\r\n\t// https://stackoverflow.com/a/8729274/1611058\r\n\tvar ancestors = [];\r\n\twhile ($elem) {\r\n\t\tancestors.push($elem);\r\n\t\tvar matchesSelector = $elem.msMatchesSelector ?\r\n\t\t\t$elem.msMatchesSelector(selectorString) :\r\n\t\t\t$elem.matches(selectorString);\r\n\t\tif (matchesSelector) {\r\n\t\t\treturn ancestors;\r\n\t\t}\r\n\t\t$elem = $elem.parentElement;\r\n\t}\r\n\r\n\treturn ancestors;\r\n}\r\n\n},{}],15:[function(require,module,exports){\n\r\nvar ranges = require('../static-values/ranges');\r\nvar get_selected_range = require('./get_selected_range');\r\n\r\nmodule.exports = function get_current_segment ($input) {\r\n\tvar selection = get_selected_range($input);\r\n\tfor (var segment in ranges) {\r\n\t\tvar range = ranges[segment];\r\n\t\tvar aboveMin = range.start <= selection.start;\r\n\t\tvar belowMax = range.end >= selection.end;\r\n\t\tif (aboveMin && belowMax) {\r\n\t\t\treturn segment;\r\n\t\t}\r\n\t}\r\n\treturn 'hrs';\r\n}\r\n\n},{\"../static-values/ranges\":47,\"./get_selected_range\":17}],16:[function(require,module,exports){\n\r\nvar get_ancestors = require('./get_ancestors');\r\n\r\nmodule.exports = function get_label ($input) {\r\n\r\n\tvar labelText =\r\n\t\taria_labelledby($input) ||\r\n\t\taria_label($input) ||\r\n\t\tfor_attribute($input) ||\r\n\t\tlabel_wrapper_element($input) ||\r\n\t\ttitle_attribute($input);\r\n\r\n\tif (labelText) return labelText;\r\n\r\n\tconsole.error('Label text for input not found.', $input);\r\n\tthrow new Error('Cannot polyfill time input due to a missing label.');\r\n}\r\n\r\nfunction aria_labelledby($input){\r\n\tvar ariaLabelByID = $input.getAttribute('aria-labelledby');\r\n\tif (ariaLabelByID) {\r\n\t\tvar $ariaLabelBy = document.getElementById(ariaLabelByID);\r\n\t\tif ($ariaLabelBy) return $ariaLabelBy.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction aria_label($input){\r\n\tvar ariaLabel = $input.getAttribute('aria-label');\r\n\tif (ariaLabel) return ariaLabel;\r\n\treturn false;\r\n}\r\n\r\nfunction for_attribute($input){\r\n\tif ($input.id) {\r\n\t\tvar $forLabel = document.querySelector('label[for=\"'+$input.id+'\"]');\r\n\t\tif ($forLabel) return $forLabel.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction label_wrapper_element($input){\r\n\tvar ancestors = get_ancestors($input, 'label');\r\n\tvar $parentLabel = ancestors[ancestors.length - 1];\r\n\tif ($parentLabel.nodeName == 'LABEL') return $parentLabel.textContent;\r\n\treturn false\r\n}\r\n\r\nfunction title_attribute($input){\r\n\tvar titleLabel = $input.getAttribute('title');\r\n\tif (titleLabel) return titleLabel;\r\n\treturn false\r\n}\r\n\n},{\"./get_ancestors\":14}],17:[function(require,module,exports){\n\r\nmodule.exports = function get_selected_range ($input) {\r\n\treturn { start: $input.selectionStart, end: $input.selectionEnd };\r\n}\r\n\n},{}],18:[function(require,module,exports){\n\r\nvar convert_number = require('../converters/convert_number');\r\n\r\nmodule.exports = function get_values ($input, timeString) {\r\n\tvar value = timeString ? timeString : $input.value;\r\n\tvar regEx = /([0-9-]{1,2})\\:([0-9-]{1,2})\\s?(AM|PM|\\-\\-)?/;\r\n\tvar result = regEx.exec(value);\r\n\r\n\treturn {\r\n\t\thrs: convert_number(result[1]),\r\n\t\tmin: convert_number(result[2]),\r\n\t\tmode: result[3],\r\n\t}\r\n}\r\n\n},{\"../converters/convert_number\":4}],19:[function(require,module,exports){\n\r\nvar manual_entry_log = [];\r\n\r\nfunction clear () {\r\n\tmanual_entry_log = [];\r\n}\r\n\r\nfunction add (entry) {\r\n\tmanual_entry_log.push(entry);\r\n}\r\n\r\nfunction items(){\r\n\treturn manual_entry_log;\r\n}\r\n\r\nmodule.exports = {\r\n\titems: items,\r\n\tclear: clear,\r\n\tadd: add,\r\n}\r\n\n},{}],20:[function(require,module,exports){\n\r\nmodule.exports = function prevent_user_select ($input) {\r\n\t$input.style.msUserSelect = \"none\";\r\n\t$input.style.mozUserSelect = \"none\";\r\n\t$input.style.webkitUserSelect = \"none\";\r\n\t$input.style.userSelect = \"none\";\r\n}\r\n\n},{}],21:[function(require,module,exports){\n\r\n// IE11 doesn't support Object.values()\r\nmodule.exports = function values (obj) {\r\n\tvar key_values = [];\r\n\tfor (var key in obj) {\r\n\t\tkey_values.push(obj[key]);\r\n\t}\r\n\treturn key_values;\r\n}\r\n\n},{}],22:[function(require,module,exports){\n\r\nvar toArray = require('../converters/toArray');\r\n\r\nmodule.exports = function _$$ (selector) {\r\n\tvar elements = document.querySelectorAll(selector);\r\n\treturn toArray(elements);\r\n}\r\n\n},{\"../converters/toArray\":8}],23:[function(require,module,exports){\n\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function next_segment ($input) {\r\n\ttraverse($input, 'next');\r\n}\r\n\n},{\"./traverse\":27}],24:[function(require,module,exports){\n\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function prev_segment ($input) {\r\n\ttraverse($input, 'prev');\r\n}\r\n\n},{\"./traverse\":27}],25:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('./select_segment');\r\n\r\nmodule.exports = function select_cursor_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tselect_segment($input, current_segment);\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"./select_segment\":26}],26:[function(require,module,exports){\n\r\nmodule.exports = function select_segment ($input, segment) {\r\n\r\n\tset_input_type();\r\n\r\n\tvar actions = {\r\n\t\thrs: select(0, 2),\r\n\t\tmin: select(3, 5),\r\n\t\tmode: select(6, 8),\r\n\t};\r\n\r\n\tactions[segment]($input);\r\n\r\n\tfunction set_input_type() {\r\n\t\tvar type = segment === 'mode' ? 'text' : 'tel';\r\n\t\t$input.setAttribute('type', type);\r\n\t}\r\n\r\n\tfunction select (start, end) {\r\n\t\treturn function () {\r\n\t\t\t$input.setSelectionRange(start, end);\r\n\t\t}\r\n\t}\r\n}\r\n\n},{}],27:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar segments = require('../static-values/segments');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function traverse ($input, direction) {\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tvar modifier = direction === 'next' ? 1 : -1;\r\n\tvar next_segment_index = segments.indexOf(segment) + modifier;\r\n\r\n\tvar next_segment = {\r\n\t\tnext: segments[next_segment_index] || 'mode',\r\n\t\tprev: next_segment_index < 0 ? 'hrs' : segments[next_segment_index],\r\n\t}[direction];\r\n\r\n\tselect_segment($input, next_segment);\r\n\tmanual_entry_log.clear();\r\n\tupdate_a11y($input, ['select'])\r\n}\r\n\n},{\"../accessibility/update_a11y\":2,\"../getters/get_current_segment\":15,\"../helpers/manual_entry_log\":19,\"../selectors/select_segment\":26,\"../static-values/segments\":48}],28:[function(require,module,exports){\n\r\n// I need to keep this separate from reset so that\r\n// I can reset without attracting focus\r\n\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function apply_default ($input) {\r\n\t$input.value = '--:-- --';\r\n\tset_data_attribute($input, '');\r\n\ttrigger_both_events($input);\r\n}\r\n\n},{\"../events/trigger_both_events\":12,\"../setters/set_data_attribute\":37}],29:[function(require,module,exports){\n\r\nvar set_segment = require('./set_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function clear_segment ($input, segment) {\r\n\tset_segment($input, segment, '--');\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\n},{\"../accessibility/update_a11y\":2,\"./set_segment\":39}],30:[function(require,module,exports){\n\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function decrement ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'PM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'down');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\n},{\"../accessibility/update_a11y\":2,\"./nudge_time_segment\":35,\"./switch_mode\":41}],31:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar decrement = require('../setters/decrement');\r\n\r\nmodule.exports = function decrement_current_segment ($input){\r\n\tvar current_segment = get_current_segment($input);\r\n\tdecrement($input, current_segment);\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../setters/decrement\":30}],32:[function(require,module,exports){\n\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function increment ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'AM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'up');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\r\n\n},{\"../accessibility/update_a11y\":2,\"./nudge_time_segment\":35,\"./switch_mode\":41}],33:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar increment = require('../setters/increment');\r\n\r\nmodule.exports = function increment_current_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tincrement($input, current_segment);\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../setters/increment\":32}],34:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar sorted_number_keys = require('../static-values/sorted_number_keys');\r\n\r\nmodule.exports = function manual_number_entry($input, key) {\r\n\tvar key_value = sorted_number_keys[key];\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tif (segment !== 'mode') {\r\n\t\tvar entry_count = manual_entry_log.items().length;\r\n\r\n\t\tvar upper_limits = {\r\n\t\t\thrs: [1,2],\r\n\t\t\tmin: [5,9],\r\n\t\t}\r\n\t\tvar limit = upper_limits[segment][entry_count];\r\n\r\n\t\tif (entry_count < 2) {\r\n\t\t\tmanual_entry_log.add(key_value);\r\n\t\t}\r\n\r\n\t\tvar full_limit = parseInt(upper_limits[segment].join(''));\r\n\t\tvar full_entry = parseInt(manual_entry_log.items().join(''));\r\n\r\n\t\tif (full_limit >= full_entry) {\r\n\t\t\tset_segment($input, segment, full_entry);\r\n\t\t}\r\n\r\n\t\tvar at_limit = key_value > limit || manual_entry_log.items().length === 2;\r\n\r\n\t\tif (at_limit) {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../helpers/manual_entry_log\":19,\"../selectors/next_segment\":23,\"../static-values/sorted_number_keys\":49,\"./set_segment\":39}],35:[function(require,module,exports){\n\r\nvar get_values = require('../getters/get_values');\r\nvar convert_hours_to_12hr_time = require('../converters/convert_hours_to_12hr_time');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function nudge_time_segment ($input, segment, direction) {\r\n\tvar current_values = get_values($input);\r\n\tvar time;\r\n\r\n\tvar modifier = direction === 'up' ? 1 : -1;\r\n\r\n\tif (current_values[segment] === '--') {\r\n\t\tvar current_time = new Date();\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_time.getHours()),\r\n\t\t\tmin: current_time.getMinutes(),\r\n\t\t}\r\n\t} else {\r\n\t\tvar minutes = {\r\n\t\t\tup : current_values.min < 59 ? current_values.min + modifier : 0,\r\n\t\t\tdown : current_values.min === 0 ? 59 : current_values.min + modifier,\r\n\t\t}\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_values.hrs + modifier),\r\n\t\t\tmin: minutes[direction],\r\n\t\t}\r\n\t}\r\n\r\n\tset_segment($input, segment, leading_zero(time[segment]) );\r\n}\r\n\n},{\"../converters/convert_hours_to_12hr_time\":3,\"../converters/leading_zero\":7,\"../getters/get_values\":18,\"./set_segment\":39}],36:[function(require,module,exports){\n\r\nvar apply_default = require('./apply_default');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nmodule.exports = function reset ($input) {\r\n\tapply_default($input);\r\n\tselect_segment($input, 'hrs');\r\n}\r\n\n},{\"../selectors/select_segment\":26,\"./apply_default\":28}],37:[function(require,module,exports){\n\r\nvar convert_to_24hr_time = require('../converters/convert_to_24hr_time')\r\n\r\nmodule.exports = function set_data_attribute($input, timeString_12hr){\r\n\tvar filteredString = timeString_12hr.indexOf('-') > -1 ? '' : timeString_12hr;\r\n\tvar time24hr = convert_to_24hr_time(filteredString);\r\n\t$input.setAttribute('data-value', time24hr);\r\n}\r\n\n},{\"../converters/convert_to_24hr_time\":6}],38:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function set_mode ($input, type) {\r\n\tvar segment = get_current_segment($input);\r\n\tif (segment === 'mode') {\r\n\t\tset_segment($input, segment, type);\r\n\t}\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"./set_segment\":39}],39:[function(require,module,exports){\n\r\nvar get_values = require('../getters/get_values');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar select_segment = require('../selectors/select_segment');\r\nvar set_data_attribute = require('./set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function set_segment ($input, segment, value) {\r\n\tvar values = get_values($input);\r\n\tvalues[segment] = value;\r\n\tvar newInputVal = [\r\n\t\tleading_zero(values.hrs),':',\r\n\t\tleading_zero(values.min),' ',\r\n\t\tvalues.mode\r\n\t].join('');\r\n\t$input.value = newInputVal;\r\n\tselect_segment($input, segment);\r\n\tset_data_attribute($input, newInputVal);\r\n\ttrigger_both_events($input);\r\n}\r\n\n},{\"../converters/leading_zero\":7,\"../events/trigger_both_events\":12,\"../getters/get_values\":18,\"../selectors/select_segment\":26,\"./set_data_attribute\":37}],40:[function(require,module,exports){\n\r\nvar convert_to_12hr_time = require('../converters/convert_to_12hr_time');\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\n\r\nmodule.exports = function set_time($input, time_string_24hr) {\r\n\tvar twelveHr = convert_to_12hr_time(time_string_24hr);\r\n\t$input.value = twelveHr;\r\n\tset_data_attribute($input, time_string_24hr);\r\n}\r\n\n},{\"../converters/convert_to_12hr_time\":5,\"../setters/set_data_attribute\":37}],41:[function(require,module,exports){\n\r\nvar get_values = require('../getters/get_values');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function switch_mode ($input, default_mode) {\r\n\tdefault_mode = default_mode || 'AM';\r\n\tvar current_mode = get_values($input).mode;\r\n\tvar new_mode = {\r\n\t\t'--' : default_mode,\r\n\t\t'AM' : 'PM',\r\n\t\t'PM' : 'AM',\r\n\t}[current_mode];\r\n\tset_segment($input, 'mode', new_mode);\r\n}\r\n\n},{\"../getters/get_values\":18,\"./set_segment\":39}],42:[function(require,module,exports){\n\r\nvar switch_to_data_value = require('./switch_to_data_value');\r\nvar set_time = require('./set_time');\r\n\r\nmodule.exports = function switch_times ($input, format) {\r\n\tvar is12hr = /\\s/.test($input.value);\r\n\r\n\tif (format != 12 && format != 24) {\r\n\t\tformat = is12hr ? 24 : 12;\r\n\t}\r\n\r\n\tvar actions = {\r\n\t\t12: function(){\r\n\t\t\tif (!is12hr) {\r\n\t\t\t\tset_time($input, $input.dataset.value);\r\n\t\t\t}\r\n\t\t},\r\n\t\t24: function(){\r\n\t\t\tif (is12hr) {\r\n\t\t\t\tswitch_to_data_value($input);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tactions[format]();\r\n}\r\n\n},{\"./set_time\":40,\"./switch_to_data_value\":43}],43:[function(require,module,exports){\n\r\nmodule.exports = function($input) {\r\n\tvar replacementVal = $input.dataset.value;\r\n\t$input.value = replacementVal;\r\n}\r\n\n},{}],44:[function(require,module,exports){\n\r\nvar set_time = require('../setters/set_time');\r\n\r\nmodule.exports = function update_time($input) {\r\n\tset_time($input, $input.value);\r\n\treturn $input;\r\n}\r\n\n},{\"../setters/set_time\":40}],45:[function(require,module,exports){\nvar all_number_keys = [\r\n // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\r\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,\r\n 96, 97, 98, 99,100,101,102,103,104,105\r\n];\r\n\r\nmodule.exports = all_number_keys;\r\n\n},{}],46:[function(require,module,exports){\nvar named_keys = {\r\n\tArrowDown: 40,\r\n\tArrowRight: 39,\r\n\tArrowUp: 38,\r\n\tArrowLeft: 37,\r\n\tBackspace: 8,\r\n\tDelete: 46,\r\n\tTab: 9,\r\n\tShift: 16,\r\n\tEscape: 27,\r\n\ta: 65,\r\n\tp: 80,\r\n}\r\n\r\nmodule.exports = named_keys;\r\n\n},{}],47:[function(require,module,exports){\n\r\nvar ranges = {\r\n\thrs : { start: 0, end: 2 },\r\n\tmin : { start: 3, end: 5 },\r\n\tmode : { start: 6, end: 8 },\r\n}\r\n\r\nmodule.exports = ranges;\r\n\n},{}],48:[function(require,module,exports){\n\r\nvar ranges = require('./ranges');\r\n\r\nvar segments = Object.keys(ranges);\r\n\r\nmodule.exports = segments;\r\n\n},{\"./ranges\":47}],49:[function(require,module,exports){\n\r\nvar all_number_keys = require('./all_number_keys');\r\n\r\nvar sorted_number_keys = {};\r\n// sorted_number_keys = { 48: 0, 49: 1, 96: 0, 97: 1, ... };\r\nall_number_keys.forEach(function(key, index) {\r\n\tvar number_val = index > 9 ? index - 10 : index;\r\n\tsorted_number_keys[key] = number_val;\r\n});\r\n\r\nmodule.exports = sorted_number_keys;\r\n\n},{\"./all_number_keys\":45}],50:[function(require,module,exports){\n\r\nvar prevent_user_select = require('./core/helpers/prevent_user_select');\r\nvar apply_default = require('./core/setters/apply_default');\r\nvar update_time = require('./core/setters/update_time');\r\nvar set_data_attribute = require('./core/setters/set_data_attribute');\r\nvar bind_events = require('./core/events/bind_events');\r\nvar switch_times = require('./core/setters/switch_times');\r\nvar get_label = require('./core/getters/get_label');\r\n\r\nvar create_a11y_block = require('./core/accessibility/create_a11y_block');\r\n\r\nvar accessibility_block_created = false;\r\nvar $a11y;\r\n\r\nfunction TimePolyfill($input) {\r\n\r\n\t$input.setAttribute('autocomplete','off');\r\n\r\n\tprevent_user_select($input);\r\n\r\n\t// Prevent screen reader from announcing the default stuff\r\n\t$input.setAttribute('aria-hidden', true);\r\n\r\n\tif (!accessibility_block_created) {\r\n\t\t$a11y = create_a11y_block();\r\n\t\taccessibility_block_created = true;\r\n\t}\r\n\r\n\tvar label = get_label($input);\r\n\r\n\t$input.polyfill = {\r\n\t\t$a11y: $a11y,\r\n\t\tlabel: label,\r\n\t\tautoSwap: true,\r\n\t\tupdate: function() {\r\n\t\t\tupdate_time($input);\r\n\t\t},\r\n\t\tswap: function(forcedFormat) {\r\n\t\t\tswitch_times($input, forcedFormat);\r\n\t\t}\r\n\t}\r\n\r\n\tif ($input.value === '' || /--/.test($input.value)) {\r\n\t\tapply_default($input);\r\n\t\tset_data_attribute($input, '');\r\n\t} else {\r\n\t\tupdate_time($input);\r\n\t\tset_data_attribute($input, $input.value);\r\n\t}\r\n\r\n\tbind_events($input);\r\n}\r\n\r\nif (window) window.TimePolyfill = TimePolyfill;\r\nif (module) module.exports = TimePolyfill;\r\n\n},{\"./core/accessibility/create_a11y_block\":1,\"./core/events/bind_events\":9,\"./core/getters/get_label\":16,\"./core/helpers/prevent_user_select\":20,\"./core/setters/apply_default\":28,\"./core/setters/set_data_attribute\":37,\"./core/setters/switch_times\":42,\"./core/setters/update_time\":44}],51:[function(require,module,exports){\n\r\nmodule.exports = function($result, values){\r\n\tvar $list = $result.querySelector('.result__list');\r\n\tvar $close = $result.querySelector('.result__close');\r\n\r\n\tvar html = '';\r\n\tfor (var label in values) {\r\n\t\tvar value = values[label].replace(/^$/,'blank');\r\n\t\thtml = html + [\r\n\t\t\t'
',\r\n\t\t\t\t'
',label,'
',\r\n\t\t\t\t'
\"',value,'\"
',\r\n\t\t\t'
'\r\n\t\t].join('');\r\n\t}\r\n\t$list.innerHTML = html;\r\n\t$result.classList.add('-visible');\r\n\r\n\t$close.onclick = function(){\r\n\t\t$result.classList.remove('-visible');\r\n\t}\r\n}\r\n\n},{}],52:[function(require,module,exports){\n\r\n//Code for tracking Google Analytics events\r\nmodule.exports = function GA_trackEvent(action, categoryLabelValue) {\r\n\r\n\tif (typeof gtag !== 'undefined') {\r\n\r\n\t\tif (categoryLabelValue) {\r\n\t\t\tgtag('event', action, {\r\n\t\t\t\tevent_category: categoryLabelValue[0],\r\n\t\t\t\tevent_label: categoryLabelValue[1],\r\n\t\t\t\tvalue: categoryLabelValue[2],\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tgtag('event', action);\r\n\t\t}\r\n\r\n\t} else {\r\n\t\tcategoryLabelValue = {};\r\n\t\tvar data = {\r\n\t\t\taction: action,\r\n\t\t\tevent_category: categoryLabelValue.category || 'general',\r\n\t\t\tevent_label: categoryLabelValue.label || '(not set)',\r\n\t\t\tvalue: categoryLabelValue.value\r\n\t\t}\r\n\r\n\t\tconsole.log(\"GA event =\", data, '* = required');\r\n\t}\r\n}\r\n\n},{}],53:[function(require,module,exports){\n// Main javascript entry point\r\n// Should handle bootstrapping/starting application\r\n\r\n'use strict';\r\n\r\n// Time input polyfill\r\nvar TimePolyfill = require('../../index');\r\nvar _$$ = require('../../core/selectors/_$$');\r\nvar toArray = require('../../core/converters/toArray');\r\n\r\nvar result = require('../_modules/result/result');\r\n\r\nvar ga = require('./_helpers/gtag');\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function() {\r\n\t// var $$timeInputs = _$$('input[type=\"time\"]');\r\n\tvar $$timeInputs = _$$('input.time');\r\n\t$$timeInputs.forEach(function (element) {\r\n\t\tnew TimePolyfill(element);\r\n\r\n\t\t// Disable auto swap\r\n\t\t// element.polyfill.autoSwap = false;\r\n\r\n\t\telement.oninput = function(){\r\n\t\t\tconsole.log('input', element.dataset.value);\r\n\t\t}\r\n\t\telement.onchange = function(){\r\n\t\t\tconsole.log('change', element.dataset.value);\r\n\t\t}\r\n\r\n\t\telement.addEventListener('change', function(){\r\n\t\t\tconsole.log('listener change');\r\n\t\t});\r\n\t\telement.addEventListener('input', function(){\r\n\t\t\tconsole.log('listener input');\r\n\t\t});\r\n\t});\r\n\r\n\tdocument.querySelector('form').onsubmit = function(e){\r\n\t\te.preventDefault();\r\n\t\tvar labels = get_labels(this);\r\n\t\tvar values = get_values(this, labels);\r\n\t\tvar $result = document.querySelector('.result');\r\n\r\n\t\tga('form submit');\r\n\r\n\t\tresult($result, values);\r\n\t\t$result.focus();\r\n\r\n\t\tfunction get_labels (form) {\r\n\t\t\tvar labelList = [];\r\n\t\t\ttoArray(form.children).forEach(function(element){\r\n\t\t\t\tvar $label = element.querySelector('label');\r\n\t\t\t\tif ($label) {\r\n\t\t\t\t\tlabelList.push($label.textContent);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\treturn labelList;\r\n\t\t}\r\n\r\n\t\tfunction get_values (form, labels) {\r\n\t\t\tvar valuesList = {};\r\n\t\t\ttoArray(form.elements).forEach(function(element, i){\r\n\t\t\t\tif (element.nodeName === 'INPUT') {\r\n\t\t\t\t\tvaluesList[labels[i]] = element.value\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\treturn valuesList;\r\n\t\t}\r\n\t}\r\n\r\n});\r\n\n},{\"../../core/converters/toArray\":8,\"../../core/selectors/_$$\":22,\"../../index\":50,\"../_modules/result/result\":51,\"./_helpers/gtag\":52}]},{},[53])\n\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar get_values = require('../getters/get_values');\r\n\r\nmodule.exports = function update_a11y ($input, announcementArray) {\r\n\t// Timeout helps ensure that the input has stabilized\r\n\tsetTimeout(function(){\r\n\t\tvar current_segment = get_current_segment($input);\r\n\t\tvar values = get_values($input);\r\n\t\tvar value = values[current_segment];\r\n\t\tvar finalValue = value == '--' ? 'blank' : value;\r\n\r\n\t\tvar segmentName = {\r\n\t\t\thrs: 'Hours',\r\n\t\t\tmin: 'Minutes',\r\n\t\t\tmode: 'AM/PM'\r\n\t\t}[current_segment];\r\n\r\n\t\tvar announcements = {\r\n\t\t\tinitial: '$label grouping $fullValue.',\r\n\t\t\tselect: '$segmentName spin button $segmentValue.',\r\n\t\t\tupdate: '$segmentValue.',\r\n\t\t}\r\n\r\n\t\tvar textArray = announcementArray.map(function(providedString){\r\n\t\t\tif (announcements[providedString]) {\r\n\t\t\t\treturn announcements[providedString];\r\n\t\t\t}\r\n\t\t\treturn providedString;\r\n\t\t});\r\n\r\n\t\tvar fullValue = $input.value.replace(/--/g,'blank');\r\n\r\n\t\tvar html = '

' + textArray.join('

') + '

';\r\n\t\thtml = html.replace(/\\$label/g, $input.polyfill.label);\r\n\t\thtml = html.replace(/\\$segmentName/g, segmentName);\r\n\t\thtml = html.replace(/\\$segmentValue/g, finalValue);\r\n\t\thtml = html.replace(/\\$fullValue/g, fullValue);\r\n\r\n\t\t$input.polyfill.$a11y.innerHTML = html;\r\n\t}, 1);\r\n}\r\n","\r\nmodule.exports = function convert_hours_to_12hr_time (hours) {\r\n\treturn hours <= 12 ? hours === 0 ? 12 : hours : hours - 12;\r\n}\r\n","\r\nmodule.exports = function convert_number (number) {\r\n\treturn isNaN(number) ? number : parseInt(number);\r\n}\r\n","\r\nvar convert_number = require('./convert_number');\r\nvar convert_hours_to_12hr_time = require('./convert_hours_to_12hr_time');\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_12hr_time (timeString_24hr) {\r\n\tif (timeString_24hr === '') return '--:-- --';\r\n\tvar twentyFour_regex = /([0-9]{2})\\:([0-9]{2})/;\r\n\tvar result = twentyFour_regex.exec(timeString_24hr);\r\n\tvar hrs_24 = convert_number(result[1]);\r\n\tvar min = result[2];\r\n\tvar hrs_12 = convert_hours_to_12hr_time(hrs_24);\r\n\tvar isPM = hrs_24 > 12;\r\n\tvar mode = isPM ? 'PM' : 'AM';\r\n\treturn [leading_zero(hrs_12), ':', min, ' ', mode].join('');\r\n}\r\n","\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_24hr_time (timeString_12hr) {\r\n\tif (/-/.test(timeString_12hr)) return '';\r\n\tvar isPM = timeString_12hr.indexOf('PM') > -1;\r\n\tvar timeResult = /^([0-9]{2})/.exec(timeString_12hr);\r\n\tvar hrs = timeResult ? parseInt(timeResult[1]) : '';\r\n\tvar newHrs;\r\n\tif (hrs === 12) {\r\n\t\tnewHrs = isPM ? 12 : 00;\r\n\t} else {\r\n\t\tnewHrs = isPM ? hrs + 12 : hrs;\r\n\t}\r\n\tvar finalHrs = newHrs === 24 ? 0 : newHrs;\r\n\tvar timeRegEx = /^[0-9]{2}:([0-9]{2}) (AM|PM)/;\r\n\treturn timeString_12hr.replace(timeRegEx, leading_zero(finalHrs)+':$1');\r\n}\r\n","\r\nmodule.exports = function leading_zero (number) {\r\n\tif (isNaN(number)) return number;\r\n\tvar purified = parseInt(number);\r\n\treturn purified < 10 ? '0' + purified : number;\r\n}\r\n","\r\nmodule.exports = function(array){\r\n\treturn Array.prototype.slice.call(array, 0);\r\n}\r\n","\r\nvar values = require('../helpers/values');\r\n\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar next_segment = require('../selectors/next_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar select_cursor_segment = require('../selectors/select_cursor_segment');\r\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\n\r\nvar reset = require('../setters/reset');\r\nvar manual_number_entry = require('../setters/manual_number_entry');\r\nvar clear_segment = require('../setters/clear_segment');\r\nvar increment_current_segment = require('../setters/increment_current_segment');\r\nvar decrement_current_segment = require('../setters/decrement_current_segment');\r\nvar set_mode = require('../setters/set_mode');\r\nvar switch_times = require('../setters/switch_times');\r\n\r\nvar handle_tab = require('../events/handle_tab');\r\n\r\nvar all_number_keys = require('../static-values/all_number_keys');\r\nvar named_keys = require('../static-values/named_keys');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function bind_events ($input) {\r\n\r\n\tvar prev_value = '';\r\n\r\n\tvar shiftKey = false;\r\n\r\n\tdocument.addEventListener('keydown', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\tdocument.addEventListener('keyup', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\r\n\tif ($input.form) {\r\n\t\t$input.form.addEventListener('submit', function(){\r\n\t\t\tauto_swap($input);\r\n\t\t})\r\n\t}\r\n\r\n\tvar focused_via_click = false;\r\n\r\n\t$input.addEventListener('mousedown', function(){\r\n\t\tfocused_via_click = true;\r\n\t});\r\n\r\n\t// Turns the IE clear button into a reset button\r\n\t$input.addEventListener('mouseup', function(){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif ($input.value === '') reset($input);\r\n\t\t}, 1)\r\n\t});\r\n\r\n\t$input.addEventListener('click', function(e){\r\n\t\tselect_cursor_segment($input);\r\n\t});\r\n\r\n\t$input.addEventListener('blur', function(){\r\n\t\tvar current_value = $input.dataset.value;\r\n\t\tif (current_value !== prev_value) {\r\n\t\t\tprev_value = current_value;\r\n\t\t}\r\n\t\tfocused_via_click = false;\r\n\t});\r\n\r\n\t$input.addEventListener('focus', function(e){\r\n\t\tif (!focused_via_click) {\r\n\t\t\te.preventDefault();\r\n\t\t\tvar segment = shiftKey ? 'mode' : 'hrs';\r\n\t\t\tselect_segment($input, segment);\r\n\t\t}\r\n\t\tupdate_a11y($input, [\r\n\t\t\t'initial',\r\n\t\t\t'select'\r\n\t\t])\r\n\t});\r\n\r\n\t$input.addEventListener('keydown', function(e) {\r\n\t\tvar is_enter_key = e.which === 13;\r\n\t\tif (is_enter_key) return true;\r\n\r\n\t\tvar is_number_key = all_number_keys.indexOf(e.which) > -1;\r\n\t\tvar is_named_key = values(named_keys).indexOf(e.which) > -1;\r\n\t\tvar is_arrow_key = [named_keys.ArrowDown, named_keys.ArrowRight, named_keys.ArrowUp, named_keys.ArrowLeft].indexOf(e.which) > -1;\r\n\t\tvar is_mode_key = [named_keys.a, named_keys.p].indexOf(e.which) > -1;\r\n\t\tvar is_delete_key = [named_keys.Delete, named_keys.Backspace].indexOf(e.which) > -1;\r\n\r\n\t\tif (!is_named_key || is_arrow_key || is_number_key || is_mode_key || is_delete_key) { e.preventDefault(); }\r\n\r\n\t\tif (is_number_key) {\r\n\t\t\tmanual_number_entry($input, e.which);\r\n\t\t}\r\n\r\n\t\tif (is_delete_key) {\r\n\t\t\tvar segment = get_current_segment($input);\r\n\t\t\tclear_segment($input, segment);\r\n\t\t}\r\n\r\n\t\tswitch (e.which) {\r\n\t\t\tcase named_keys.ArrowRight: next_segment($input); break;\r\n\t\t\tcase named_keys.ArrowLeft: prev_segment($input); break;\r\n\t\t\tcase named_keys.ArrowUp: increment_current_segment($input); break;\r\n\t\t\tcase named_keys.ArrowDown: decrement_current_segment($input); break;\r\n\t\t\tcase named_keys.Escape: reset($input); break;\r\n\t\t\tcase named_keys.a: set_mode($input, 'AM'); break;\r\n\t\t\tcase named_keys.p: set_mode($input, 'PM'); break;\r\n\t\t\tcase named_keys.Tab: handle_tab($input, e); break;\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction auto_swap($input) {\r\n\tif ($input.polyfill.autoSwap) {\r\n\t\tswitch_times($input, 24);\r\n\t\tsetTimeout(function(){\r\n\t\t\tswitch_times($input, 12);\r\n\t\t}, 1);\r\n\t}\r\n}\r\n","\r\nmodule.exports = function create_event(eventName){\r\n\tvar event = document.createEvent('Event');\r\n\tevent.initEvent(eventName, true, true);\r\n\treturn event;\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nmodule.exports = function handle_tab($input, e) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tvar backwards_and_first = e.shiftKey && current_segment === 'hrs';\r\n\tvar forwards_and_last = !e.shiftKey && current_segment === 'mode';\r\n\r\n\tif (!backwards_and_first && !forwards_and_last) {\r\n\t\te.preventDefault();\r\n\t\tif (e.shiftKey) {\r\n\t\t\tprev_segment($input);\r\n\t\t} else {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar trigger_event = require('./trigger_event');\r\n\r\n// It seems that oninput and onchange are treated the same way by browsers :/\r\nmodule.exports = function trigger_both_events($input) {\r\n\t// the event only ever fires if there is a full valid value available\r\n\ttrigger_event($input, 'input');\r\n\ttrigger_event($input,'change');\r\n}\r\n","\r\nvar create_event = require('./create_event');\r\n\r\nvar inputEvent = create_event('input');\r\nvar changeEvent = create_event('change');\r\n\r\nmodule.exports = function trigger_event($input, eventName) {\r\n\tvar event = {\r\n\t\tinput: inputEvent,\r\n\t\tchange: changeEvent,\r\n\t}[eventName];\r\n\r\n\tif (can_trigger_change($input)) {\r\n\t\t$input.dispatchEvent(event);\r\n\t}\r\n}\r\n\r\n// Browsers only send out input and change events if the time element has a full valid value\r\nfunction can_trigger_change ($input) {\r\n\treturn !/--/.test($input.value);\r\n}\r\n","// selector is optional, it allows for an early exit\r\nmodule.exports = function ($input, selectorString) {\r\n\tvar $elem = $input;\r\n\r\n\t// https://stackoverflow.com/a/8729274/1611058\r\n\tvar ancestors = [];\r\n\twhile ($elem) {\r\n\t\tancestors.push($elem);\r\n\t\tvar matchesSelector = $elem.msMatchesSelector ?\r\n\t\t\t$elem.msMatchesSelector(selectorString) :\r\n\t\t\t$elem.matches(selectorString);\r\n\t\tif (matchesSelector) {\r\n\t\t\treturn ancestors;\r\n\t\t}\r\n\t\t$elem = $elem.parentElement;\r\n\t}\r\n\r\n\treturn ancestors;\r\n}\r\n","\r\nvar ranges = require('../static-values/ranges');\r\nvar get_selected_range = require('./get_selected_range');\r\n\r\nmodule.exports = function get_current_segment ($input) {\r\n\tvar selection = get_selected_range($input);\r\n\tfor (var segment in ranges) {\r\n\t\tvar range = ranges[segment];\r\n\t\tvar aboveMin = range.start <= selection.start;\r\n\t\tvar belowMax = range.end >= selection.end;\r\n\t\tif (aboveMin && belowMax) {\r\n\t\t\treturn segment;\r\n\t\t}\r\n\t}\r\n\treturn 'hrs';\r\n}\r\n","\r\nvar get_ancestors = require('./get_ancestors');\r\n\r\nmodule.exports = function get_label ($input) {\r\n\r\n\tvar labelText =\r\n\t\taria_labelledby($input) ||\r\n\t\taria_label($input) ||\r\n\t\tfor_attribute($input) ||\r\n\t\tlabel_wrapper_element($input) ||\r\n\t\ttitle_attribute($input);\r\n\r\n\tif (labelText) return labelText;\r\n\r\n\tconsole.error('Label text for input not found.', $input);\r\n\tthrow new Error('Cannot polyfill time input due to a missing label.');\r\n}\r\n\r\nfunction aria_labelledby($input){\r\n\tvar ariaLabelByID = $input.getAttribute('aria-labelledby');\r\n\tif (ariaLabelByID) {\r\n\t\tvar $ariaLabelBy = document.getElementById(ariaLabelByID);\r\n\t\tif ($ariaLabelBy) return $ariaLabelBy.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction aria_label($input){\r\n\tvar ariaLabel = $input.getAttribute('aria-label');\r\n\tif (ariaLabel) return ariaLabel;\r\n\treturn false;\r\n}\r\n\r\nfunction for_attribute($input){\r\n\tif ($input.id) {\r\n\t\tvar $forLabel = document.querySelector('label[for=\"'+$input.id+'\"]');\r\n\t\tif ($forLabel) return $forLabel.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction label_wrapper_element($input){\r\n\tvar ancestors = get_ancestors($input, 'label');\r\n\tvar $parentLabel = ancestors[ancestors.length - 1];\r\n\tif ($parentLabel.nodeName == 'LABEL') return $parentLabel.textContent;\r\n\treturn false\r\n}\r\n\r\nfunction title_attribute($input){\r\n\tvar titleLabel = $input.getAttribute('title');\r\n\tif (titleLabel) return titleLabel;\r\n\treturn false\r\n}\r\n","\r\nmodule.exports = function get_selected_range ($input) {\r\n\treturn { start: $input.selectionStart, end: $input.selectionEnd };\r\n}\r\n","\r\nvar convert_number = require('../converters/convert_number');\r\n\r\nmodule.exports = function get_values ($input, timeString) {\r\n\tvar value = timeString ? timeString : $input.value;\r\n\tvar regEx = /([0-9-]{1,2})\\:([0-9-]{1,2})\\s?(AM|PM|\\-\\-)?/;\r\n\tvar result = regEx.exec(value);\r\n\r\n\treturn {\r\n\t\thrs: convert_number(result[1]),\r\n\t\tmin: convert_number(result[2]),\r\n\t\tmode: result[3],\r\n\t}\r\n}\r\n","\r\nvar manual_entry_log = [];\r\n\r\nfunction clear () {\r\n\tmanual_entry_log = [];\r\n}\r\n\r\nfunction add (entry) {\r\n\tmanual_entry_log.push(entry);\r\n}\r\n\r\nfunction items(){\r\n\treturn manual_entry_log;\r\n}\r\n\r\nmodule.exports = {\r\n\titems: items,\r\n\tclear: clear,\r\n\tadd: add,\r\n}\r\n","\r\nmodule.exports = function prevent_user_select ($input) {\r\n\t$input.style.msUserSelect = \"none\";\r\n\t$input.style.mozUserSelect = \"none\";\r\n\t$input.style.webkitUserSelect = \"none\";\r\n\t$input.style.userSelect = \"none\";\r\n}\r\n","\r\n// IE11 doesn't support Object.values()\r\nmodule.exports = function values (obj) {\r\n\tvar key_values = [];\r\n\tfor (var key in obj) {\r\n\t\tkey_values.push(obj[key]);\r\n\t}\r\n\treturn key_values;\r\n}\r\n","\r\nvar toArray = require('../converters/toArray');\r\n\r\nmodule.exports = function _$$ (selector) {\r\n\tvar elements = document.querySelectorAll(selector);\r\n\treturn toArray(elements);\r\n}\r\n","\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function next_segment ($input) {\r\n\ttraverse($input, 'next');\r\n}\r\n","\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function prev_segment ($input) {\r\n\ttraverse($input, 'prev');\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('./select_segment');\r\n\r\nmodule.exports = function select_cursor_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tselect_segment($input, current_segment);\r\n}\r\n","\r\nmodule.exports = function select_segment ($input, segment) {\r\n\r\n\tset_input_type();\r\n\r\n\tvar actions = {\r\n\t\thrs: select(0, 2),\r\n\t\tmin: select(3, 5),\r\n\t\tmode: select(6, 8),\r\n\t};\r\n\r\n\tactions[segment]($input);\r\n\r\n\tfunction set_input_type() {\r\n\t\tvar type = segment === 'mode' ? 'text' : 'tel';\r\n\t\t$input.setAttribute('type', type);\r\n\t}\r\n\r\n\tfunction select (start, end) {\r\n\t\treturn function () {\r\n\t\t\t$input.setSelectionRange(start, end);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar segments = require('../static-values/segments');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function traverse ($input, direction) {\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tvar modifier = direction === 'next' ? 1 : -1;\r\n\tvar next_segment_index = segments.indexOf(segment) + modifier;\r\n\r\n\tvar next_segment = {\r\n\t\tnext: segments[next_segment_index] || 'mode',\r\n\t\tprev: next_segment_index < 0 ? 'hrs' : segments[next_segment_index],\r\n\t}[direction];\r\n\r\n\tselect_segment($input, next_segment);\r\n\tmanual_entry_log.clear();\r\n\tupdate_a11y($input, ['select'])\r\n}\r\n","\r\n// I need to keep this separate from reset so that\r\n// I can reset without attracting focus\r\n\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function apply_default ($input) {\r\n\t$input.value = '--:-- --';\r\n\tset_data_attribute($input, '');\r\n\ttrigger_both_events($input);\r\n}\r\n","\r\nvar set_segment = require('./set_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function clear_segment ($input, segment) {\r\n\tset_segment($input, segment, '--');\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n","\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function decrement ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'PM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'down');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar decrement = require('../setters/decrement');\r\n\r\nmodule.exports = function decrement_current_segment ($input){\r\n\tvar current_segment = get_current_segment($input);\r\n\tdecrement($input, current_segment);\r\n}\r\n","\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function increment ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'AM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'up');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar increment = require('../setters/increment');\r\n\r\nmodule.exports = function increment_current_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tincrement($input, current_segment);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar sorted_number_keys = require('../static-values/sorted_number_keys');\r\n\r\nmodule.exports = function manual_number_entry($input, key) {\r\n\tvar key_value = sorted_number_keys[key];\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tif (segment !== 'mode') {\r\n\t\tvar entry_count = manual_entry_log.items().length;\r\n\r\n\t\tvar upper_limits = {\r\n\t\t\thrs: [1,2],\r\n\t\t\tmin: [5,9],\r\n\t\t}\r\n\t\tvar limit = upper_limits[segment][entry_count];\r\n\r\n\t\tif (entry_count < 2) {\r\n\t\t\tmanual_entry_log.add(key_value);\r\n\t\t}\r\n\r\n\t\tvar full_limit = parseInt(upper_limits[segment].join(''));\r\n\t\tvar full_entry = parseInt(manual_entry_log.items().join(''));\r\n\r\n\t\tif (full_limit >= full_entry) {\r\n\t\t\tset_segment($input, segment, full_entry);\r\n\t\t}\r\n\r\n\t\tvar at_limit = key_value > limit || manual_entry_log.items().length === 2;\r\n\r\n\t\tif (at_limit) {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar convert_hours_to_12hr_time = require('../converters/convert_hours_to_12hr_time');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function nudge_time_segment ($input, segment, direction) {\r\n\tvar current_values = get_values($input);\r\n\tvar time;\r\n\r\n\tvar modifier = direction === 'up' ? 1 : -1;\r\n\r\n\tif (current_values[segment] === '--') {\r\n\t\tvar current_time = new Date();\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_time.getHours()),\r\n\t\t\tmin: current_time.getMinutes(),\r\n\t\t}\r\n\t} else {\r\n\t\tvar minutes = {\r\n\t\t\tup : current_values.min < 59 ? current_values.min + modifier : 0,\r\n\t\t\tdown : current_values.min === 0 ? 59 : current_values.min + modifier,\r\n\t\t}\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_values.hrs + modifier),\r\n\t\t\tmin: minutes[direction],\r\n\t\t}\r\n\t}\r\n\r\n\tset_segment($input, segment, leading_zero(time[segment]) );\r\n}\r\n","\r\nvar apply_default = require('./apply_default');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nmodule.exports = function reset ($input) {\r\n\tapply_default($input);\r\n\tselect_segment($input, 'hrs');\r\n}\r\n","\r\nvar convert_to_24hr_time = require('../converters/convert_to_24hr_time')\r\n\r\nmodule.exports = function set_data_attribute($input, timeString_12hr){\r\n\tvar filteredString = timeString_12hr.indexOf('-') > -1 ? '' : timeString_12hr;\r\n\tvar time24hr = convert_to_24hr_time(filteredString);\r\n\t$input.setAttribute('data-value', time24hr);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function set_mode ($input, type) {\r\n\tvar segment = get_current_segment($input);\r\n\tif (segment === 'mode') {\r\n\t\tset_segment($input, segment, type);\r\n\t}\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar select_segment = require('../selectors/select_segment');\r\nvar set_data_attribute = require('./set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function set_segment ($input, segment, value) {\r\n\tvar values = get_values($input);\r\n\tvalues[segment] = value;\r\n\tvar newInputVal = [\r\n\t\tleading_zero(values.hrs),':',\r\n\t\tleading_zero(values.min),' ',\r\n\t\tvalues.mode\r\n\t].join('');\r\n\t$input.value = newInputVal;\r\n\tselect_segment($input, segment);\r\n\tset_data_attribute($input, newInputVal);\r\n\ttrigger_both_events($input);\r\n}\r\n","\r\nvar convert_to_12hr_time = require('../converters/convert_to_12hr_time');\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\n\r\nmodule.exports = function set_time($input, time_string_24hr) {\r\n\tvar twelveHr = convert_to_12hr_time(time_string_24hr);\r\n\t$input.value = twelveHr;\r\n\tset_data_attribute($input, time_string_24hr);\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function switch_mode ($input, default_mode) {\r\n\tdefault_mode = default_mode || 'AM';\r\n\tvar current_mode = get_values($input).mode;\r\n\tvar new_mode = {\r\n\t\t'--' : default_mode,\r\n\t\t'AM' : 'PM',\r\n\t\t'PM' : 'AM',\r\n\t}[current_mode];\r\n\tset_segment($input, 'mode', new_mode);\r\n}\r\n","\r\nvar switch_to_data_value = require('./switch_to_data_value');\r\nvar set_time = require('./set_time');\r\n\r\nmodule.exports = function switch_times ($input, format) {\r\n\tvar is12hr = /\\s/.test($input.value);\r\n\r\n\tif (format != 12 && format != 24) {\r\n\t\tformat = is12hr ? 24 : 12;\r\n\t}\r\n\r\n\tvar actions = {\r\n\t\t12: function(){\r\n\t\t\tif (!is12hr) {\r\n\t\t\t\tset_time($input, $input.dataset.value);\r\n\t\t\t}\r\n\t\t},\r\n\t\t24: function(){\r\n\t\t\tif (is12hr) {\r\n\t\t\t\tswitch_to_data_value($input);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tactions[format]();\r\n}\r\n","\r\nmodule.exports = function($input) {\r\n\tvar replacementVal = $input.dataset.value;\r\n\t$input.value = replacementVal;\r\n}\r\n","\r\nvar set_time = require('../setters/set_time');\r\n\r\nmodule.exports = function update_time($input) {\r\n\tset_time($input, $input.value);\r\n\treturn $input;\r\n}\r\n","var all_number_keys = [\r\n // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\r\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,\r\n 96, 97, 98, 99,100,101,102,103,104,105\r\n];\r\n\r\nmodule.exports = all_number_keys;\r\n","var named_keys = {\r\n\tArrowDown: 40,\r\n\tArrowRight: 39,\r\n\tArrowUp: 38,\r\n\tArrowLeft: 37,\r\n\tBackspace: 8,\r\n\tDelete: 46,\r\n\tTab: 9,\r\n\tShift: 16,\r\n\tEscape: 27,\r\n\ta: 65,\r\n\tp: 80,\r\n}\r\n\r\nmodule.exports = named_keys;\r\n","\r\nvar ranges = {\r\n\thrs : { start: 0, end: 2 },\r\n\tmin : { start: 3, end: 5 },\r\n\tmode : { start: 6, end: 8 },\r\n}\r\n\r\nmodule.exports = ranges;\r\n","\r\nvar ranges = require('./ranges');\r\n\r\nvar segments = Object.keys(ranges);\r\n\r\nmodule.exports = segments;\r\n","\r\nvar all_number_keys = require('./all_number_keys');\r\n\r\nvar sorted_number_keys = {};\r\n// sorted_number_keys = { 48: 0, 49: 1, 96: 0, 97: 1, ... };\r\nall_number_keys.forEach(function(key, index) {\r\n\tvar number_val = index > 9 ? index - 10 : index;\r\n\tsorted_number_keys[key] = number_val;\r\n});\r\n\r\nmodule.exports = sorted_number_keys;\r\n","\r\nvar prevent_user_select = require('./core/helpers/prevent_user_select');\r\nvar apply_default = require('./core/setters/apply_default');\r\nvar update_time = require('./core/setters/update_time');\r\nvar set_data_attribute = require('./core/setters/set_data_attribute');\r\nvar bind_events = require('./core/events/bind_events');\r\nvar switch_times = require('./core/setters/switch_times');\r\nvar get_label = require('./core/getters/get_label');\r\n\r\nvar create_a11y_block = require('./core/accessibility/create_a11y_block');\r\n\r\nvar accessibility_block_created = false;\r\nvar $a11y;\r\n\r\nfunction TimePolyfill($input) {\r\n\r\n\t$input.setAttribute('autocomplete','off');\r\n\r\n\tprevent_user_select($input);\r\n\r\n\t// Prevent screen reader from announcing the default stuff\r\n\t$input.setAttribute('aria-hidden', true);\r\n\r\n\tif (!accessibility_block_created) {\r\n\t\t$a11y = create_a11y_block();\r\n\t\taccessibility_block_created = true;\r\n\t}\r\n\r\n\tvar label = get_label($input);\r\n\r\n\t$input.polyfill = {\r\n\t\t$a11y: $a11y,\r\n\t\tlabel: label,\r\n\t\tautoSwap: true,\r\n\t\tupdate: function() {\r\n\t\t\tupdate_time($input);\r\n\t\t},\r\n\t\tswap: function(forcedFormat) {\r\n\t\t\tswitch_times($input, forcedFormat);\r\n\t\t}\r\n\t}\r\n\r\n\tif ($input.value === '' || /--/.test($input.value)) {\r\n\t\tapply_default($input);\r\n\t\tset_data_attribute($input, '');\r\n\t} else {\r\n\t\tupdate_time($input);\r\n\t\tset_data_attribute($input, $input.value);\r\n\t}\r\n\r\n\tbind_events($input);\r\n}\r\n\r\nif (window) window.TimePolyfill = TimePolyfill;\r\nif (module) module.exports = TimePolyfill;\r\n","\r\nmodule.exports = function($result, values){\r\n\tvar $list = $result.querySelector('.result__list');\r\n\tvar $close = $result.querySelector('.result__close');\r\n\r\n\tvar html = '';\r\n\tfor (var label in values) {\r\n\t\tvar value = values[label].replace(/^$/,'blank');\r\n\t\thtml = html + [\r\n\t\t\t'
',\r\n\t\t\t\t'
',label,'
',\r\n\t\t\t\t'
\"',value,'\"
',\r\n\t\t\t'
'\r\n\t\t].join('');\r\n\t}\r\n\t$list.innerHTML = html;\r\n\t$result.classList.add('-visible');\r\n\r\n\t$close.onclick = function(){\r\n\t\t$result.classList.remove('-visible');\r\n\t}\r\n}\r\n","\r\n//Code for tracking Google Analytics events\r\nmodule.exports = function GA_trackEvent(action, categoryLabelValue) {\r\n\r\n\tif (typeof gtag !== 'undefined') {\r\n\r\n\t\tif (categoryLabelValue) {\r\n\t\t\tgtag('event', action, {\r\n\t\t\t\tevent_category: categoryLabelValue[0],\r\n\t\t\t\tevent_label: categoryLabelValue[1],\r\n\t\t\t\tvalue: categoryLabelValue[2],\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tgtag('event', action);\r\n\t\t}\r\n\r\n\t} else {\r\n\t\tcategoryLabelValue = {};\r\n\t\tvar data = {\r\n\t\t\taction: action,\r\n\t\t\tevent_category: categoryLabelValue.category || 'general',\r\n\t\t\tevent_label: categoryLabelValue.label || '(not set)',\r\n\t\t\tvalue: categoryLabelValue.value\r\n\t\t}\r\n\r\n\t\tconsole.log(\"GA event =\", data, '* = required');\r\n\t}\r\n}\r\n","// Main javascript entry point\r\n// Should handle bootstrapping/starting application\r\n\r\n'use strict';\r\n\r\n// Time input polyfill\r\nvar TimePolyfill = require('../../index');\r\nvar _$$ = require('../../core/selectors/_$$');\r\nvar toArray = require('../../core/converters/toArray');\r\n\r\nvar result = require('../_modules/result/result');\r\n\r\nvar ga = require('./_helpers/gtag');\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function() {\r\n\t// var $$timeInputs = _$$('input[type=\"time\"]');\r\n\tvar $$timeInputs = _$$('input.time');\r\n\t$$timeInputs.forEach(function (element) {\r\n\t\tnew TimePolyfill(element);\r\n\r\n\t\t// Disable auto swap\r\n\t\t// element.polyfill.autoSwap = false;\r\n\r\n\t\telement.oninput = function(){\r\n\t\t\tconsole.log('input', element.dataset.value);\r\n\t\t}\r\n\t\telement.onchange = function(){\r\n\t\t\tconsole.log('change', element.dataset.value);\r\n\t\t}\r\n\r\n\t\telement.addEventListener('change', function(){\r\n\t\t\tconsole.log('listener change');\r\n\t\t});\r\n\t\telement.addEventListener('input', function(){\r\n\t\t\tconsole.log('listener input');\r\n\t\t});\r\n\t});\r\n\r\n\tdocument.querySelector('form').onsubmit = function(e){\r\n\t\te.preventDefault();\r\n\t\tvar labels = get_labels(this);\r\n\t\tvar values = get_values(this, labels);\r\n\t\tvar $result = document.querySelector('.result');\r\n\r\n\t\tga('form submit');\r\n\r\n\t\tresult($result, values);\r\n\t\t$result.focus();\r\n\r\n\t\tfunction get_labels (form) {\r\n\t\t\tvar labelList = [];\r\n\t\t\ttoArray(form.children).forEach(function(element){\r\n\t\t\t\tvar $label = element.querySelector('label');\r\n\t\t\t\tif ($label) {\r\n\t\t\t\t\tlabelList.push($label.textContent);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\treturn labelList;\r\n\t\t}\r\n\r\n\t\tfunction get_values (form, labels) {\r\n\t\t\tvar valuesList = {};\r\n\t\t\ttoArray(form.elements).forEach(function(element, i){\r\n\t\t\t\tif (element.nodeName === 'INPUT') {\r\n\t\t\t\t\tvaluesList[labels[i]] = element.value\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\treturn valuesList;\r\n\t\t}\r\n\t}\r\n\r\n});\r\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["src/_scripts/node_modules/browser-pack/_prelude.js","src/_scripts/core/accessibility/create_a11y_block.js","src/_scripts/main.js","src/_scripts/core/accessibility/update_a11y.js","src/_scripts/core/converters/convert_hours_to_12hr_time.js","src/_scripts/core/converters/convert_number.js","src/_scripts/core/converters/convert_to_12hr_time.js","src/_scripts/core/converters/convert_to_24hr_time.js","src/_scripts/core/converters/leading_zero.js","src/_scripts/core/converters/toArray.js","src/_scripts/core/events/bind_events.js","src/_scripts/core/events/create_event.js","src/_scripts/core/events/handle_tab.js","src/_scripts/core/events/trigger_both_events.js","src/_scripts/core/events/trigger_event.js","src/_scripts/core/getters/get_ancestors.js","src/_scripts/core/getters/get_current_segment.js","src/_scripts/core/getters/get_label.js","src/_scripts/core/getters/get_selected_range.js","src/_scripts/core/getters/get_values.js","src/_scripts/core/helpers/manual_entry_log.js","src/_scripts/core/helpers/values.js","src/_scripts/core/selectors/_$$.js","src/_scripts/core/selectors/next_segment.js","src/_scripts/core/selectors/prev_segment.js","src/_scripts/core/selectors/select_cursor_segment.js","src/_scripts/core/selectors/select_segment.js","src/_scripts/core/selectors/traverse.js","src/_scripts/core/setters/apply_default.js","src/_scripts/core/setters/clear_segment.js","src/_scripts/core/setters/decrement.js","src/_scripts/core/setters/decrement_current_segment.js","src/_scripts/core/setters/increment.js","src/_scripts/core/setters/increment_current_segment.js","src/_scripts/core/setters/manual_number_entry.js","src/_scripts/core/setters/nudge_time_segment.js","src/_scripts/core/setters/reset.js","src/_scripts/core/setters/set_data_attribute.js","src/_scripts/core/setters/set_mode.js","src/_scripts/core/setters/set_segment.js","src/_scripts/core/setters/set_time.js","src/_scripts/core/setters/switch_mode.js","src/_scripts/core/setters/switch_times.js","src/_scripts/core/setters/switch_to_data_value.js","src/_scripts/core/setters/update_time.js","src/_scripts/core/static-values/all_number_keys.js","src/_scripts/core/static-values/named_keys.js","src/_scripts/core/static-values/ranges.js","src/_scripts/core/static-values/segments.js","src/_scripts/core/static-values/sorted_number_keys.js","src/_scripts/index.js","src/_scripts/src/_modules/result/result.js","src/_scripts/src/_scripts/_helpers/gtag.js","src/_scripts/src/_scripts/main.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","$block","document","createElement","setAttribute","classList","add","querySelector","appendChild","2","get_current_segment","get_values","$input","announcementArray","setTimeout","current_segment","values","value","finalValue","segmentName","hrs","min","mode","announcements","initial","select","update","textArray","map","providedString","fullValue","replace","html","join","polyfill","label","$a11y","innerHTML","../getters/get_current_segment","../getters/get_values","3","hours","4","number","isNaN","parseInt","5","convert_number","convert_hours_to_12hr_time","leading_zero","timeString_24hr","twentyFour_regex","result","exec","hrs_24","hrs_12","isPM","./convert_hours_to_12hr_time","./convert_number","./leading_zero","6","timeString_12hr","test","newHrs","indexOf","timeResult","finalHrs","timeRegEx","7","purified","8","array","Array","prototype","slice","9","auto_swap","autoSwap","switch_times","select_segment","next_segment","prev_segment","select_cursor_segment","reset","manual_number_entry","clear_segment","increment_current_segment","decrement_current_segment","set_mode","handle_tab","all_number_keys","named_keys","update_a11y","prev_value","shiftKey","addEventListener","form","focused_via_click","current_value","dataset","preventDefault","segment","is_enter_key","which","is_number_key","is_named_key","is_arrow_key","ArrowDown","ArrowRight","ArrowUp","ArrowLeft","is_mode_key","is_delete_key","Delete","Backspace","Escape","Tab","../accessibility/update_a11y","../events/handle_tab","../helpers/values","../selectors/next_segment","../selectors/prev_segment","../selectors/select_cursor_segment","../selectors/select_segment","../setters/clear_segment","../setters/decrement_current_segment","../setters/increment_current_segment","../setters/manual_number_entry","../setters/reset","../setters/set_mode","../setters/switch_times","../static-values/all_number_keys","../static-values/named_keys","10","eventName","event","createEvent","initEvent","11","backwards_and_first","forwards_and_last","12","trigger_event","./trigger_event","13","can_trigger_change","create_event","inputEvent","changeEvent","input","change","dispatchEvent","./create_event","14","selectorString","$elem","ancestors","push","matchesSelector","msMatchesSelector","matches","parentElement","15","ranges","get_selected_range","selection","range","aboveMin","start","belowMax","end","../static-values/ranges","./get_selected_range","16","aria_labelledby","ariaLabelByID","getAttribute","$ariaLabelBy","getElementById","textContent","aria_label","ariaLabel","for_attribute","id","$forLabel","label_wrapper_element","get_ancestors","$parentLabel","nodeName","title_attribute","titleLabel","labelText","console","error","./get_ancestors","17","selectionStart","selectionEnd","18","timeString","regEx","../converters/convert_number","19","clear","manual_entry_log","entry","items","20","obj","key_values","key","21","toArray","selector","elements","querySelectorAll","../converters/toArray","22","traverse","./traverse","23","24","./select_segment","25","set_input_type","type","setSelectionRange","actions","26","segments","direction","modifier","next_segment_index","next","prev","../helpers/manual_entry_log","../static-values/segments","27","set_data_attribute","trigger_both_events","../events/trigger_both_events","../setters/set_data_attribute","28","set_segment","./set_segment","29","switch_mode","nudge_time_segment","./nudge_time_segment","./switch_mode","30","decrement","../setters/decrement","31","32","increment","../setters/increment","33","sorted_number_keys","key_value","entry_count","upper_limits","limit","full_limit","full_entry","at_limit","../static-values/sorted_number_keys","34","time","current_values","current_time","Date","getHours","getMinutes","minutes","up","down","../converters/convert_hours_to_12hr_time","../converters/leading_zero","35","apply_default","./apply_default","36","convert_to_24hr_time","filteredString","time24hr","../converters/convert_to_24hr_time","37","38","newInputVal","./set_data_attribute","39","convert_to_12hr_time","time_string_24hr","twelveHr","../converters/convert_to_12hr_time","40","default_mode","current_mode","new_mode","--","AM","PM","41","switch_to_data_value","set_time","format","is12hr","./set_time","./switch_to_data_value","42","replacementVal","43","../setters/set_time","44","45","Shift","46","47","Object","keys","./ranges","48","forEach","index","number_val","./all_number_keys","49","TimePolyfill","accessibility_block_created","create_a11y_block","get_label","update_time","swap","forcedFormat","bind_events","window","./core/accessibility/create_a11y_block","./core/events/bind_events","./core/getters/get_label","./core/setters/apply_default","./core/setters/set_data_attribute","./core/setters/switch_times","./core/setters/update_time","50","$result","$list","$close","onclick","remove","51","action","categoryLabelValue","gtag","event_category","event_label","data","category","log","52","_$$","ga","$$timeInputs","element","oninput","onchange","onsubmit","get_labels","labelList","children","$label","labels","valuesList","this","focus","../../core/converters/toArray","../../core/selectors/_$$","../../index","../_modules/result/result","./_helpers/gtag"],"mappings":"CAAA,WAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,GAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG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AAApW,cAAA,QACA2W,IACAF,EAAAnN,KAAAqN,EAAA/L,eAGA6L,EAGA,QAAArW,GAAAqF,EAAAmR,GACA,GAAAC,KAMA,OALAhK,GAAApH,EAAAsH,UAAA6G,QAAA,SAAAwC,EAAAxX,GACA,UAAAwX,EAAA/K,WACAwL,EAAAD,EAAAhY,IAAAwX,EAAA1V,SAGAmW,EA5BArY,EAAAqH,gBACA,IAAA+Q,GAAAJ,EAAAM,MACArW,EAAAL,EAAA0W,KAAAF,GACA1B,EAAAvV,SAAAK,cAAA,UAEAkW,GAAA,eAEArT,EAAAqS,EAAAzU,GACAyU,EAAA6B,anDi/BGC,gCAAgC,EAAEC,2BAA2B,GAAGC,cAAc,GAAGC,4BAA4B,GAAGC,kBAAkB,UAAU","file":"scripts/main.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i

') + '

';\r\n\t\thtml = html.replace(/\\$label/g, $input.polyfill.label);\r\n\t\thtml = html.replace(/\\$segmentName/g, segmentName);\r\n\t\thtml = html.replace(/\\$segmentValue/g, finalValue);\r\n\t\thtml = html.replace(/\\$fullValue/g, fullValue);\r\n\r\n\t\t$input.polyfill.$a11y.innerHTML = html;\r\n\t}, 1);\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../getters/get_values\":18}],3:[function(require,module,exports){\n\r\nmodule.exports = function convert_hours_to_12hr_time (hours) {\r\n\treturn hours <= 12 ? hours === 0 ? 12 : hours : hours - 12;\r\n}\r\n\n},{}],4:[function(require,module,exports){\n\r\nmodule.exports = function convert_number (number) {\r\n\treturn isNaN(number) ? number : parseInt(number);\r\n}\r\n\n},{}],5:[function(require,module,exports){\n\r\nvar convert_number = require('./convert_number');\r\nvar convert_hours_to_12hr_time = require('./convert_hours_to_12hr_time');\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_12hr_time (timeString_24hr) {\r\n\tif (timeString_24hr === '') return '--:-- --';\r\n\tvar twentyFour_regex = /([0-9]{2})\\:([0-9]{2})/;\r\n\tvar result = twentyFour_regex.exec(timeString_24hr);\r\n\tvar hrs_24 = convert_number(result[1]);\r\n\tvar min = result[2];\r\n\tvar hrs_12 = convert_hours_to_12hr_time(hrs_24);\r\n\tvar isPM = hrs_24 > 12;\r\n\tvar mode = isPM ? 'PM' : 'AM';\r\n\treturn [leading_zero(hrs_12), ':', min, ' ', mode].join('');\r\n}\r\n\n},{\"./convert_hours_to_12hr_time\":3,\"./convert_number\":4,\"./leading_zero\":7}],6:[function(require,module,exports){\n\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_24hr_time (timeString_12hr) {\r\n\tif (/-/.test(timeString_12hr)) return '';\r\n\tvar isPM = timeString_12hr.indexOf('PM') > -1;\r\n\tvar timeResult = /^([0-9]{2})/.exec(timeString_12hr);\r\n\tvar hrs = timeResult ? parseInt(timeResult[1]) : '';\r\n\tvar newHrs;\r\n\tif (hrs === 12) {\r\n\t\tnewHrs = isPM ? 12 : 00;\r\n\t} else {\r\n\t\tnewHrs = isPM ? hrs + 12 : hrs;\r\n\t}\r\n\tvar finalHrs = newHrs === 24 ? 0 : newHrs;\r\n\tvar timeRegEx = /^[0-9]{2}:([0-9]{2}) (AM|PM)/;\r\n\treturn timeString_12hr.replace(timeRegEx, leading_zero(finalHrs)+':$1');\r\n}\r\n\n},{\"./leading_zero\":7}],7:[function(require,module,exports){\n\r\nmodule.exports = function leading_zero (number) {\r\n\tif (isNaN(number)) return number;\r\n\tvar purified = parseInt(number);\r\n\treturn purified < 10 ? '0' + purified : number;\r\n}\r\n\n},{}],8:[function(require,module,exports){\n\r\nmodule.exports = function(array){\r\n\treturn Array.prototype.slice.call(array, 0);\r\n}\r\n\n},{}],9:[function(require,module,exports){\n\r\nvar values = require('../helpers/values');\r\n\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar next_segment = require('../selectors/next_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar select_cursor_segment = require('../selectors/select_cursor_segment');\r\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\n\r\nvar reset = require('../setters/reset');\r\nvar manual_number_entry = require('../setters/manual_number_entry');\r\nvar clear_segment = require('../setters/clear_segment');\r\nvar increment_current_segment = require('../setters/increment_current_segment');\r\nvar decrement_current_segment = require('../setters/decrement_current_segment');\r\nvar set_mode = require('../setters/set_mode');\r\nvar switch_times = require('../setters/switch_times');\r\n\r\nvar handle_tab = require('../events/handle_tab');\r\n\r\nvar all_number_keys = require('../static-values/all_number_keys');\r\nvar named_keys = require('../static-values/named_keys');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function bind_events ($input) {\r\n\r\n\tvar prev_value = '';\r\n\r\n\tvar shiftKey = false;\r\n\r\n\tdocument.addEventListener('keydown', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\tdocument.addEventListener('keyup', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\r\n\tif ($input.form) {\r\n\t\t$input.form.addEventListener('submit', function(){\r\n\t\t\tauto_swap($input);\r\n\t\t})\r\n\t}\r\n\r\n\tvar focused_via_click = false;\r\n\r\n\t$input.addEventListener('mousedown', function(){\r\n\t\tfocused_via_click = true;\r\n\t});\r\n\r\n\t// Turns the IE clear button into a reset button\r\n\t$input.addEventListener('mouseup', function(){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif ($input.value === '') reset($input);\r\n\t\t}, 1)\r\n\t});\r\n\r\n\t$input.addEventListener('click', function(e){\r\n\t\tselect_cursor_segment($input);\r\n\t});\r\n\r\n\t$input.addEventListener('blur', function(){\r\n\t\tvar current_value = $input.dataset.value;\r\n\t\tif (current_value !== prev_value) {\r\n\t\t\tprev_value = current_value;\r\n\t\t}\r\n\t\tfocused_via_click = false;\r\n\t});\r\n\r\n\t$input.addEventListener('focus', function(e){\r\n\t\tif (!focused_via_click) {\r\n\t\t\te.preventDefault();\r\n\t\t\tvar segment = shiftKey ? 'mode' : 'hrs';\r\n\t\t\tselect_segment($input, segment);\r\n\t\t}\r\n\t\tupdate_a11y($input, [\r\n\t\t\t'initial',\r\n\t\t\t'select'\r\n\t\t])\r\n\t});\r\n\r\n\t$input.addEventListener('keydown', function(e) {\r\n\t\tvar is_enter_key = e.which === 13;\r\n\t\tif (is_enter_key) return true;\r\n\r\n\t\tvar is_number_key = all_number_keys.indexOf(e.which) > -1;\r\n\t\tvar is_named_key = values(named_keys).indexOf(e.which) > -1;\r\n\t\tvar is_arrow_key = [named_keys.ArrowDown, named_keys.ArrowRight, named_keys.ArrowUp, named_keys.ArrowLeft].indexOf(e.which) > -1;\r\n\t\tvar is_mode_key = [named_keys.a, named_keys.p].indexOf(e.which) > -1;\r\n\t\tvar is_delete_key = [named_keys.Delete, named_keys.Backspace].indexOf(e.which) > -1;\r\n\r\n\t\tif (!is_named_key || is_arrow_key || is_number_key || is_mode_key || is_delete_key) { e.preventDefault(); }\r\n\r\n\t\tif (is_number_key) {\r\n\t\t\tmanual_number_entry($input, e.which);\r\n\t\t}\r\n\r\n\t\tif (is_delete_key) {\r\n\t\t\tvar segment = get_current_segment($input);\r\n\t\t\tclear_segment($input, segment);\r\n\t\t}\r\n\r\n\t\tswitch (e.which) {\r\n\t\t\tcase named_keys.ArrowRight: next_segment($input); break;\r\n\t\t\tcase named_keys.ArrowLeft: prev_segment($input); break;\r\n\t\t\tcase named_keys.ArrowUp: increment_current_segment($input); break;\r\n\t\t\tcase named_keys.ArrowDown: decrement_current_segment($input); break;\r\n\t\t\tcase named_keys.Escape: reset($input); break;\r\n\t\t\tcase named_keys.a: set_mode($input, 'AM'); break;\r\n\t\t\tcase named_keys.p: set_mode($input, 'PM'); break;\r\n\t\t\tcase named_keys.Tab: handle_tab($input, e); break;\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction auto_swap($input) {\r\n\tif ($input.polyfill.autoSwap) {\r\n\t\tswitch_times($input, 24);\r\n\t\tsetTimeout(function(){\r\n\t\t\tswitch_times($input, 12);\r\n\t\t}, 1);\r\n\t}\r\n}\r\n\n},{\"../accessibility/update_a11y\":2,\"../events/handle_tab\":11,\"../getters/get_current_segment\":15,\"../helpers/values\":20,\"../selectors/next_segment\":22,\"../selectors/prev_segment\":23,\"../selectors/select_cursor_segment\":24,\"../selectors/select_segment\":25,\"../setters/clear_segment\":28,\"../setters/decrement_current_segment\":30,\"../setters/increment_current_segment\":32,\"../setters/manual_number_entry\":33,\"../setters/reset\":35,\"../setters/set_mode\":37,\"../setters/switch_times\":41,\"../static-values/all_number_keys\":44,\"../static-values/named_keys\":45}],10:[function(require,module,exports){\n\r\nmodule.exports = function create_event(eventName){\r\n\tvar event = document.createEvent('Event');\r\n\tevent.initEvent(eventName, true, true);\r\n\treturn event;\r\n}\r\n\n},{}],11:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nmodule.exports = function handle_tab($input, e) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tvar backwards_and_first = e.shiftKey && current_segment === 'hrs';\r\n\tvar forwards_and_last = !e.shiftKey && current_segment === 'mode';\r\n\r\n\tif (!backwards_and_first && !forwards_and_last) {\r\n\t\te.preventDefault();\r\n\t\tif (e.shiftKey) {\r\n\t\t\tprev_segment($input);\r\n\t\t} else {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../selectors/next_segment\":22,\"../selectors/prev_segment\":23}],12:[function(require,module,exports){\n\r\nvar trigger_event = require('./trigger_event');\r\n\r\n// It seems that oninput and onchange are treated the same way by browsers :/\r\nmodule.exports = function trigger_both_events($input) {\r\n\t// the event only ever fires if there is a full valid value available\r\n\ttrigger_event($input, 'input');\r\n\ttrigger_event($input,'change');\r\n}\r\n\n},{\"./trigger_event\":13}],13:[function(require,module,exports){\n\r\nvar create_event = require('./create_event');\r\n\r\nvar inputEvent = create_event('input');\r\nvar changeEvent = create_event('change');\r\n\r\nmodule.exports = function trigger_event($input, eventName) {\r\n\tvar event = {\r\n\t\tinput: inputEvent,\r\n\t\tchange: changeEvent,\r\n\t}[eventName];\r\n\r\n\tif (can_trigger_change($input)) {\r\n\t\t$input.dispatchEvent(event);\r\n\t}\r\n}\r\n\r\n// Browsers only send out input and change events if the time element has a full valid value\r\nfunction can_trigger_change ($input) {\r\n\treturn !/--/.test($input.value);\r\n}\r\n\n},{\"./create_event\":10}],14:[function(require,module,exports){\n// selector is optional, it allows for an early exit\r\nmodule.exports = function ($input, selectorString) {\r\n\tvar $elem = $input;\r\n\r\n\t// https://stackoverflow.com/a/8729274/1611058\r\n\tvar ancestors = [];\r\n\twhile ($elem) {\r\n\t\tancestors.push($elem);\r\n\t\tvar matchesSelector = $elem.msMatchesSelector ?\r\n\t\t\t$elem.msMatchesSelector(selectorString) :\r\n\t\t\t$elem.matches(selectorString);\r\n\t\tif (matchesSelector) {\r\n\t\t\treturn ancestors;\r\n\t\t}\r\n\t\t$elem = $elem.parentElement;\r\n\t}\r\n\r\n\treturn ancestors;\r\n}\r\n\n},{}],15:[function(require,module,exports){\n\r\nvar ranges = require('../static-values/ranges');\r\nvar get_selected_range = require('./get_selected_range');\r\n\r\nmodule.exports = function get_current_segment ($input) {\r\n\tvar selection = get_selected_range($input);\r\n\tfor (var segment in ranges) {\r\n\t\tvar range = ranges[segment];\r\n\t\tvar aboveMin = range.start <= selection.start;\r\n\t\tvar belowMax = range.end >= selection.end;\r\n\t\tif (aboveMin && belowMax) {\r\n\t\t\treturn segment;\r\n\t\t}\r\n\t}\r\n\treturn 'hrs';\r\n}\r\n\n},{\"../static-values/ranges\":46,\"./get_selected_range\":17}],16:[function(require,module,exports){\n\r\nvar get_ancestors = require('./get_ancestors');\r\n\r\nmodule.exports = function get_label ($input) {\r\n\r\n\tvar labelText =\r\n\t\taria_labelledby($input) ||\r\n\t\taria_label($input) ||\r\n\t\tfor_attribute($input) ||\r\n\t\tlabel_wrapper_element($input) ||\r\n\t\ttitle_attribute($input);\r\n\r\n\tif (labelText) return labelText;\r\n\r\n\tconsole.error('Label text for input not found.', $input);\r\n\tthrow new Error('Cannot polyfill time input due to a missing label.');\r\n}\r\n\r\nfunction aria_labelledby($input){\r\n\tvar ariaLabelByID = $input.getAttribute('aria-labelledby');\r\n\tif (ariaLabelByID) {\r\n\t\tvar $ariaLabelBy = document.getElementById(ariaLabelByID);\r\n\t\tif ($ariaLabelBy) return $ariaLabelBy.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction aria_label($input){\r\n\tvar ariaLabel = $input.getAttribute('aria-label');\r\n\tif (ariaLabel) return ariaLabel;\r\n\treturn false;\r\n}\r\n\r\nfunction for_attribute($input){\r\n\tif ($input.id) {\r\n\t\tvar $forLabel = document.querySelector('label[for=\"'+$input.id+'\"]');\r\n\t\tif ($forLabel) return $forLabel.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction label_wrapper_element($input){\r\n\tvar ancestors = get_ancestors($input, 'label');\r\n\tvar $parentLabel = ancestors[ancestors.length - 1];\r\n\tif ($parentLabel.nodeName == 'LABEL') return $parentLabel.textContent;\r\n\treturn false\r\n}\r\n\r\nfunction title_attribute($input){\r\n\tvar titleLabel = $input.getAttribute('title');\r\n\tif (titleLabel) return titleLabel;\r\n\treturn false\r\n}\r\n\n},{\"./get_ancestors\":14}],17:[function(require,module,exports){\n\r\nmodule.exports = function get_selected_range ($input) {\r\n\treturn { start: $input.selectionStart, end: $input.selectionEnd };\r\n}\r\n\n},{}],18:[function(require,module,exports){\n\r\nvar convert_number = require('../converters/convert_number');\r\n\r\nmodule.exports = function get_values ($input, timeString) {\r\n\tvar value = timeString ? timeString : $input.value;\r\n\tvar regEx = /([0-9-]{1,2})\\:([0-9-]{1,2})\\s?(AM|PM|\\-\\-)?/;\r\n\tvar result = regEx.exec(value);\r\n\r\n\treturn {\r\n\t\thrs: convert_number(result[1]),\r\n\t\tmin: convert_number(result[2]),\r\n\t\tmode: result[3],\r\n\t}\r\n}\r\n\n},{\"../converters/convert_number\":4}],19:[function(require,module,exports){\n\r\nvar manual_entry_log = [];\r\n\r\nfunction clear () {\r\n\tmanual_entry_log = [];\r\n}\r\n\r\nfunction add (entry) {\r\n\tmanual_entry_log.push(entry);\r\n}\r\n\r\nfunction items(){\r\n\treturn manual_entry_log;\r\n}\r\n\r\nmodule.exports = {\r\n\titems: items,\r\n\tclear: clear,\r\n\tadd: add,\r\n}\r\n\n},{}],20:[function(require,module,exports){\n\r\n// IE11 doesn't support Object.values()\r\nmodule.exports = function values (obj) {\r\n\tvar key_values = [];\r\n\tfor (var key in obj) {\r\n\t\tkey_values.push(obj[key]);\r\n\t}\r\n\treturn key_values;\r\n}\r\n\n},{}],21:[function(require,module,exports){\n\r\nvar toArray = require('../converters/toArray');\r\n\r\nmodule.exports = function _$$ (selector) {\r\n\tvar elements = document.querySelectorAll(selector);\r\n\treturn toArray(elements);\r\n}\r\n\n},{\"../converters/toArray\":8}],22:[function(require,module,exports){\n\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function next_segment ($input) {\r\n\ttraverse($input, 'next');\r\n}\r\n\n},{\"./traverse\":26}],23:[function(require,module,exports){\n\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function prev_segment ($input) {\r\n\ttraverse($input, 'prev');\r\n}\r\n\n},{\"./traverse\":26}],24:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('./select_segment');\r\n\r\nmodule.exports = function select_cursor_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tselect_segment($input, current_segment);\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"./select_segment\":25}],25:[function(require,module,exports){\n\r\nmodule.exports = function select_segment ($input, segment) {\r\n\r\n\tset_input_type();\r\n\r\n\tvar actions = {\r\n\t\thrs: select(0, 2),\r\n\t\tmin: select(3, 5),\r\n\t\tmode: select(6, 8),\r\n\t};\r\n\r\n\tactions[segment]($input);\r\n\r\n\tfunction set_input_type() {\r\n\t\tvar type = segment === 'mode' ? 'text' : 'tel';\r\n\t\t$input.setAttribute('type', type);\r\n\t}\r\n\r\n\tfunction select (start, end) {\r\n\t\treturn function () {\r\n\t\t\t$input.setSelectionRange(start, end);\r\n\t\t}\r\n\t}\r\n}\r\n\n},{}],26:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar segments = require('../static-values/segments');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function traverse ($input, direction) {\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tvar modifier = direction === 'next' ? 1 : -1;\r\n\tvar next_segment_index = segments.indexOf(segment) + modifier;\r\n\r\n\tvar next_segment = {\r\n\t\tnext: segments[next_segment_index] || 'mode',\r\n\t\tprev: next_segment_index < 0 ? 'hrs' : segments[next_segment_index],\r\n\t}[direction];\r\n\r\n\tselect_segment($input, next_segment);\r\n\tmanual_entry_log.clear();\r\n\tupdate_a11y($input, ['select'])\r\n}\r\n\n},{\"../accessibility/update_a11y\":2,\"../getters/get_current_segment\":15,\"../helpers/manual_entry_log\":19,\"../selectors/select_segment\":25,\"../static-values/segments\":47}],27:[function(require,module,exports){\n\r\n// I need to keep this separate from reset so that\r\n// I can reset without attracting focus\r\n\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function apply_default ($input) {\r\n\t$input.value = '--:-- --';\r\n\tset_data_attribute($input, '');\r\n\ttrigger_both_events($input);\r\n}\r\n\n},{\"../events/trigger_both_events\":12,\"../setters/set_data_attribute\":36}],28:[function(require,module,exports){\n\r\nvar set_segment = require('./set_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function clear_segment ($input, segment) {\r\n\tset_segment($input, segment, '--');\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\n},{\"../accessibility/update_a11y\":2,\"./set_segment\":38}],29:[function(require,module,exports){\n\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function decrement ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'PM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'down');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\n},{\"../accessibility/update_a11y\":2,\"./nudge_time_segment\":34,\"./switch_mode\":40}],30:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar decrement = require('../setters/decrement');\r\n\r\nmodule.exports = function decrement_current_segment ($input){\r\n\tvar current_segment = get_current_segment($input);\r\n\tdecrement($input, current_segment);\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../setters/decrement\":29}],31:[function(require,module,exports){\n\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function increment ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'AM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'up');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\r\n\n},{\"../accessibility/update_a11y\":2,\"./nudge_time_segment\":34,\"./switch_mode\":40}],32:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar increment = require('../setters/increment');\r\n\r\nmodule.exports = function increment_current_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tincrement($input, current_segment);\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../setters/increment\":31}],33:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar sorted_number_keys = require('../static-values/sorted_number_keys');\r\n\r\nmodule.exports = function manual_number_entry($input, key) {\r\n\tvar key_value = sorted_number_keys[key];\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tif (segment !== 'mode') {\r\n\t\tvar entry_count = manual_entry_log.items().length;\r\n\r\n\t\tvar upper_limits = {\r\n\t\t\thrs: [1,2],\r\n\t\t\tmin: [5,9],\r\n\t\t}\r\n\t\tvar limit = upper_limits[segment][entry_count];\r\n\r\n\t\tif (entry_count < 2) {\r\n\t\t\tmanual_entry_log.add(key_value);\r\n\t\t}\r\n\r\n\t\tvar full_limit = parseInt(upper_limits[segment].join(''));\r\n\t\tvar full_entry = parseInt(manual_entry_log.items().join(''));\r\n\r\n\t\tif (full_limit >= full_entry) {\r\n\t\t\tset_segment($input, segment, full_entry);\r\n\t\t}\r\n\r\n\t\tvar at_limit = key_value > limit || manual_entry_log.items().length === 2;\r\n\r\n\t\tif (at_limit) {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"../helpers/manual_entry_log\":19,\"../selectors/next_segment\":22,\"../static-values/sorted_number_keys\":48,\"./set_segment\":38}],34:[function(require,module,exports){\n\r\nvar get_values = require('../getters/get_values');\r\nvar convert_hours_to_12hr_time = require('../converters/convert_hours_to_12hr_time');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function nudge_time_segment ($input, segment, direction) {\r\n\tvar current_values = get_values($input);\r\n\tvar time;\r\n\r\n\tvar modifier = direction === 'up' ? 1 : -1;\r\n\r\n\tif (current_values[segment] === '--') {\r\n\t\tvar current_time = new Date();\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_time.getHours()),\r\n\t\t\tmin: current_time.getMinutes(),\r\n\t\t}\r\n\t} else {\r\n\t\tvar minutes = {\r\n\t\t\tup : current_values.min < 59 ? current_values.min + modifier : 0,\r\n\t\t\tdown : current_values.min === 0 ? 59 : current_values.min + modifier,\r\n\t\t}\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_values.hrs + modifier),\r\n\t\t\tmin: minutes[direction],\r\n\t\t}\r\n\t}\r\n\r\n\tset_segment($input, segment, leading_zero(time[segment]) );\r\n}\r\n\n},{\"../converters/convert_hours_to_12hr_time\":3,\"../converters/leading_zero\":7,\"../getters/get_values\":18,\"./set_segment\":38}],35:[function(require,module,exports){\n\r\nvar apply_default = require('./apply_default');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nmodule.exports = function reset ($input) {\r\n\tapply_default($input);\r\n\tselect_segment($input, 'hrs');\r\n}\r\n\n},{\"../selectors/select_segment\":25,\"./apply_default\":27}],36:[function(require,module,exports){\n\r\nvar convert_to_24hr_time = require('../converters/convert_to_24hr_time')\r\n\r\nmodule.exports = function set_data_attribute($input, timeString_12hr){\r\n\tvar filteredString = timeString_12hr.indexOf('-') > -1 ? '' : timeString_12hr;\r\n\tvar time24hr = convert_to_24hr_time(filteredString);\r\n\t$input.setAttribute('data-value', time24hr);\r\n}\r\n\n},{\"../converters/convert_to_24hr_time\":6}],37:[function(require,module,exports){\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function set_mode ($input, type) {\r\n\tvar segment = get_current_segment($input);\r\n\tif (segment === 'mode') {\r\n\t\tset_segment($input, segment, type);\r\n\t}\r\n}\r\n\n},{\"../getters/get_current_segment\":15,\"./set_segment\":38}],38:[function(require,module,exports){\n\r\nvar get_values = require('../getters/get_values');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar select_segment = require('../selectors/select_segment');\r\nvar set_data_attribute = require('./set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function set_segment ($input, segment, value) {\r\n\tvar values = get_values($input);\r\n\tvalues[segment] = value;\r\n\tvar newInputVal = [\r\n\t\tleading_zero(values.hrs),':',\r\n\t\tleading_zero(values.min),' ',\r\n\t\tvalues.mode\r\n\t].join('');\r\n\t$input.value = newInputVal;\r\n\tselect_segment($input, segment);\r\n\tset_data_attribute($input, newInputVal);\r\n\ttrigger_both_events($input);\r\n}\r\n\n},{\"../converters/leading_zero\":7,\"../events/trigger_both_events\":12,\"../getters/get_values\":18,\"../selectors/select_segment\":25,\"./set_data_attribute\":36}],39:[function(require,module,exports){\n\r\nvar convert_to_12hr_time = require('../converters/convert_to_12hr_time');\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\n\r\nmodule.exports = function set_time($input, time_string_24hr) {\r\n\tvar twelveHr = convert_to_12hr_time(time_string_24hr);\r\n\t$input.value = twelveHr;\r\n\tset_data_attribute($input, time_string_24hr);\r\n}\r\n\n},{\"../converters/convert_to_12hr_time\":5,\"../setters/set_data_attribute\":36}],40:[function(require,module,exports){\n\r\nvar get_values = require('../getters/get_values');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function switch_mode ($input, default_mode) {\r\n\tdefault_mode = default_mode || 'AM';\r\n\tvar current_mode = get_values($input).mode;\r\n\tvar new_mode = {\r\n\t\t'--' : default_mode,\r\n\t\t'AM' : 'PM',\r\n\t\t'PM' : 'AM',\r\n\t}[current_mode];\r\n\tset_segment($input, 'mode', new_mode);\r\n}\r\n\n},{\"../getters/get_values\":18,\"./set_segment\":38}],41:[function(require,module,exports){\n\r\nvar switch_to_data_value = require('./switch_to_data_value');\r\nvar set_time = require('./set_time');\r\n\r\nmodule.exports = function switch_times ($input, format) {\r\n\tvar is12hr = /\\s/.test($input.value);\r\n\r\n\tif (format != 12 && format != 24) {\r\n\t\tformat = is12hr ? 24 : 12;\r\n\t}\r\n\r\n\tvar actions = {\r\n\t\t12: function(){\r\n\t\t\tif (!is12hr) {\r\n\t\t\t\tset_time($input, $input.dataset.value);\r\n\t\t\t}\r\n\t\t},\r\n\t\t24: function(){\r\n\t\t\tif (is12hr) {\r\n\t\t\t\tswitch_to_data_value($input);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tactions[format]();\r\n}\r\n\n},{\"./set_time\":39,\"./switch_to_data_value\":42}],42:[function(require,module,exports){\n\r\nmodule.exports = function($input) {\r\n\tvar replacementVal = $input.dataset.value;\r\n\t$input.value = replacementVal;\r\n}\r\n\n},{}],43:[function(require,module,exports){\n\r\nvar set_time = require('../setters/set_time');\r\n\r\nmodule.exports = function update_time($input) {\r\n\tset_time($input, $input.value);\r\n\treturn $input;\r\n}\r\n\n},{\"../setters/set_time\":39}],44:[function(require,module,exports){\nvar all_number_keys = [\r\n // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\r\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,\r\n 96, 97, 98, 99,100,101,102,103,104,105\r\n];\r\n\r\nmodule.exports = all_number_keys;\r\n\n},{}],45:[function(require,module,exports){\nvar named_keys = {\r\n\tArrowDown: 40,\r\n\tArrowRight: 39,\r\n\tArrowUp: 38,\r\n\tArrowLeft: 37,\r\n\tBackspace: 8,\r\n\tDelete: 46,\r\n\tTab: 9,\r\n\tShift: 16,\r\n\tEscape: 27,\r\n\ta: 65,\r\n\tp: 80,\r\n}\r\n\r\nmodule.exports = named_keys;\r\n\n},{}],46:[function(require,module,exports){\n\r\nvar ranges = {\r\n\thrs : { start: 0, end: 2 },\r\n\tmin : { start: 3, end: 5 },\r\n\tmode : { start: 6, end: 8 },\r\n}\r\n\r\nmodule.exports = ranges;\r\n\n},{}],47:[function(require,module,exports){\n\r\nvar ranges = require('./ranges');\r\n\r\nvar segments = Object.keys(ranges);\r\n\r\nmodule.exports = segments;\r\n\n},{\"./ranges\":46}],48:[function(require,module,exports){\n\r\nvar all_number_keys = require('./all_number_keys');\r\n\r\nvar sorted_number_keys = {};\r\n// sorted_number_keys = { 48: 0, 49: 1, 96: 0, 97: 1, ... };\r\nall_number_keys.forEach(function(key, index) {\r\n\tvar number_val = index > 9 ? index - 10 : index;\r\n\tsorted_number_keys[key] = number_val;\r\n});\r\n\r\nmodule.exports = sorted_number_keys;\r\n\n},{\"./all_number_keys\":44}],49:[function(require,module,exports){\n\r\nvar apply_default = require('./core/setters/apply_default');\r\nvar update_time = require('./core/setters/update_time');\r\nvar set_data_attribute = require('./core/setters/set_data_attribute');\r\nvar bind_events = require('./core/events/bind_events');\r\nvar switch_times = require('./core/setters/switch_times');\r\nvar get_label = require('./core/getters/get_label');\r\n\r\nvar create_a11y_block = require('./core/accessibility/create_a11y_block');\r\n\r\nvar accessibility_block_created = false;\r\nvar $a11y;\r\n\r\nfunction TimePolyfill($input) {\r\n\r\n\t$input.setAttribute('autocomplete','off');\r\n\r\n\t// Prevent screen reader from announcing the default stuff\r\n\t$input.setAttribute('aria-hidden', true);\r\n\r\n\tif (!accessibility_block_created) {\r\n\t\t$a11y = create_a11y_block();\r\n\t\taccessibility_block_created = true;\r\n\t}\r\n\r\n\tvar label = get_label($input);\r\n\r\n\t$input.polyfill = {\r\n\t\t$a11y: $a11y,\r\n\t\tlabel: label,\r\n\t\tautoSwap: true,\r\n\t\tupdate: function() {\r\n\t\t\tupdate_time($input);\r\n\t\t},\r\n\t\tswap: function(forcedFormat) {\r\n\t\t\tswitch_times($input, forcedFormat);\r\n\t\t}\r\n\t}\r\n\r\n\tif ($input.value === '' || /--/.test($input.value)) {\r\n\t\tapply_default($input);\r\n\t\tset_data_attribute($input, '');\r\n\t} else {\r\n\t\tupdate_time($input);\r\n\t\tset_data_attribute($input, $input.value);\r\n\t}\r\n\r\n\tbind_events($input);\r\n}\r\n\r\nif (window) window.TimePolyfill = TimePolyfill;\r\nif (module) module.exports = TimePolyfill;\r\n\n},{\"./core/accessibility/create_a11y_block\":1,\"./core/events/bind_events\":9,\"./core/getters/get_label\":16,\"./core/setters/apply_default\":27,\"./core/setters/set_data_attribute\":36,\"./core/setters/switch_times\":41,\"./core/setters/update_time\":43}],50:[function(require,module,exports){\n\r\nmodule.exports = function($result, values){\r\n\tvar $list = $result.querySelector('.result__list');\r\n\tvar $close = $result.querySelector('.result__close');\r\n\r\n\tvar html = '';\r\n\tfor (var label in values) {\r\n\t\tvar value = values[label].replace(/^$/,'blank');\r\n\t\thtml = html + [\r\n\t\t\t'
',\r\n\t\t\t\t'
',label,'
',\r\n\t\t\t\t'
\"',value,'\"
',\r\n\t\t\t'
'\r\n\t\t].join('');\r\n\t}\r\n\t$list.innerHTML = html;\r\n\t$result.classList.add('-visible');\r\n\r\n\t$close.onclick = function(){\r\n\t\t$result.classList.remove('-visible');\r\n\t}\r\n}\r\n\n},{}],51:[function(require,module,exports){\n\r\n//Code for tracking Google Analytics events\r\nmodule.exports = function GA_trackEvent(action, categoryLabelValue) {\r\n\r\n\tif (typeof gtag !== 'undefined') {\r\n\r\n\t\tif (categoryLabelValue) {\r\n\t\t\tgtag('event', action, {\r\n\t\t\t\tevent_category: categoryLabelValue[0],\r\n\t\t\t\tevent_label: categoryLabelValue[1],\r\n\t\t\t\tvalue: categoryLabelValue[2],\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tgtag('event', action);\r\n\t\t}\r\n\r\n\t} else {\r\n\t\tcategoryLabelValue = {};\r\n\t\tvar data = {\r\n\t\t\taction: action,\r\n\t\t\tevent_category: categoryLabelValue.category || 'general',\r\n\t\t\tevent_label: categoryLabelValue.label || '(not set)',\r\n\t\t\tvalue: categoryLabelValue.value\r\n\t\t}\r\n\r\n\t\tconsole.log(\"GA event =\", data, '* = required');\r\n\t}\r\n}\r\n\n},{}],52:[function(require,module,exports){\n// Main javascript entry point\r\n// Should handle bootstrapping/starting application\r\n\r\n'use strict';\r\n\r\n// Time input polyfill\r\nvar TimePolyfill = require('../../index');\r\nvar _$$ = require('../../core/selectors/_$$');\r\nvar toArray = require('../../core/converters/toArray');\r\n\r\nvar result = require('../_modules/result/result');\r\n\r\nvar ga = require('./_helpers/gtag');\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function() {\r\n\t// var $$timeInputs = _$$('input[type=\"time\"]');\r\n\tvar $$timeInputs = _$$('input.time');\r\n\t$$timeInputs.forEach(function (element) {\r\n\t\tnew TimePolyfill(element);\r\n\r\n\t\t// Disable auto swap\r\n\t\t// element.polyfill.autoSwap = false;\r\n\r\n\t\telement.oninput = function(){\r\n\t\t\tconsole.log('input', element.dataset.value);\r\n\t\t}\r\n\t\telement.onchange = function(){\r\n\t\t\tconsole.log('change', element.dataset.value);\r\n\t\t}\r\n\r\n\t\telement.addEventListener('change', function(){\r\n\t\t\tconsole.log('listener change');\r\n\t\t});\r\n\t\telement.addEventListener('input', function(){\r\n\t\t\tconsole.log('listener input');\r\n\t\t});\r\n\t});\r\n\r\n\tdocument.querySelector('form').onsubmit = function(e){\r\n\t\te.preventDefault();\r\n\t\tvar labels = get_labels(this);\r\n\t\tvar values = get_values(this, labels);\r\n\t\tvar $result = document.querySelector('.result');\r\n\r\n\t\tga('form submit');\r\n\r\n\t\tresult($result, values);\r\n\t\t$result.focus();\r\n\r\n\t\tfunction get_labels (form) {\r\n\t\t\tvar labelList = [];\r\n\t\t\ttoArray(form.children).forEach(function(element){\r\n\t\t\t\tvar $label = element.querySelector('label');\r\n\t\t\t\tif ($label) {\r\n\t\t\t\t\tlabelList.push($label.textContent);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\treturn labelList;\r\n\t\t}\r\n\r\n\t\tfunction get_values (form, labels) {\r\n\t\t\tvar valuesList = {};\r\n\t\t\ttoArray(form.elements).forEach(function(element, i){\r\n\t\t\t\tif (element.nodeName === 'INPUT') {\r\n\t\t\t\t\tvaluesList[labels[i]] = element.value\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\treturn valuesList;\r\n\t\t}\r\n\t}\r\n\r\n});\r\n\n},{\"../../core/converters/toArray\":8,\"../../core/selectors/_$$\":21,\"../../index\":49,\"../_modules/result/result\":50,\"./_helpers/gtag\":51}]},{},[52])\n\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar get_values = require('../getters/get_values');\r\n\r\nmodule.exports = function update_a11y ($input, announcementArray) {\r\n\t// Timeout helps ensure that the input has stabilized\r\n\tsetTimeout(function(){\r\n\t\tvar current_segment = get_current_segment($input);\r\n\t\tvar values = get_values($input);\r\n\t\tvar value = values[current_segment];\r\n\t\tvar finalValue = value == '--' ? 'blank' : value;\r\n\r\n\t\tvar segmentName = {\r\n\t\t\thrs: 'Hours',\r\n\t\t\tmin: 'Minutes',\r\n\t\t\tmode: 'AM/PM'\r\n\t\t}[current_segment];\r\n\r\n\t\tvar announcements = {\r\n\t\t\tinitial: '$label grouping $fullValue.',\r\n\t\t\tselect: '$segmentName spin button $segmentValue.',\r\n\t\t\tupdate: '$segmentValue.',\r\n\t\t}\r\n\r\n\t\tvar textArray = announcementArray.map(function(providedString){\r\n\t\t\tif (announcements[providedString]) {\r\n\t\t\t\treturn announcements[providedString];\r\n\t\t\t}\r\n\t\t\treturn providedString;\r\n\t\t});\r\n\r\n\t\tvar fullValue = $input.value.replace(/--/g,'blank');\r\n\r\n\t\tvar html = '

' + textArray.join('

') + '

';\r\n\t\thtml = html.replace(/\\$label/g, $input.polyfill.label);\r\n\t\thtml = html.replace(/\\$segmentName/g, segmentName);\r\n\t\thtml = html.replace(/\\$segmentValue/g, finalValue);\r\n\t\thtml = html.replace(/\\$fullValue/g, fullValue);\r\n\r\n\t\t$input.polyfill.$a11y.innerHTML = html;\r\n\t}, 1);\r\n}\r\n","\r\nmodule.exports = function convert_hours_to_12hr_time (hours) {\r\n\treturn hours <= 12 ? hours === 0 ? 12 : hours : hours - 12;\r\n}\r\n","\r\nmodule.exports = function convert_number (number) {\r\n\treturn isNaN(number) ? number : parseInt(number);\r\n}\r\n","\r\nvar convert_number = require('./convert_number');\r\nvar convert_hours_to_12hr_time = require('./convert_hours_to_12hr_time');\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_12hr_time (timeString_24hr) {\r\n\tif (timeString_24hr === '') return '--:-- --';\r\n\tvar twentyFour_regex = /([0-9]{2})\\:([0-9]{2})/;\r\n\tvar result = twentyFour_regex.exec(timeString_24hr);\r\n\tvar hrs_24 = convert_number(result[1]);\r\n\tvar min = result[2];\r\n\tvar hrs_12 = convert_hours_to_12hr_time(hrs_24);\r\n\tvar isPM = hrs_24 > 12;\r\n\tvar mode = isPM ? 'PM' : 'AM';\r\n\treturn [leading_zero(hrs_12), ':', min, ' ', mode].join('');\r\n}\r\n","\r\nvar leading_zero = require('./leading_zero');\r\n\r\nmodule.exports = function convert_to_24hr_time (timeString_12hr) {\r\n\tif (/-/.test(timeString_12hr)) return '';\r\n\tvar isPM = timeString_12hr.indexOf('PM') > -1;\r\n\tvar timeResult = /^([0-9]{2})/.exec(timeString_12hr);\r\n\tvar hrs = timeResult ? parseInt(timeResult[1]) : '';\r\n\tvar newHrs;\r\n\tif (hrs === 12) {\r\n\t\tnewHrs = isPM ? 12 : 00;\r\n\t} else {\r\n\t\tnewHrs = isPM ? hrs + 12 : hrs;\r\n\t}\r\n\tvar finalHrs = newHrs === 24 ? 0 : newHrs;\r\n\tvar timeRegEx = /^[0-9]{2}:([0-9]{2}) (AM|PM)/;\r\n\treturn timeString_12hr.replace(timeRegEx, leading_zero(finalHrs)+':$1');\r\n}\r\n","\r\nmodule.exports = function leading_zero (number) {\r\n\tif (isNaN(number)) return number;\r\n\tvar purified = parseInt(number);\r\n\treturn purified < 10 ? '0' + purified : number;\r\n}\r\n","\r\nmodule.exports = function(array){\r\n\treturn Array.prototype.slice.call(array, 0);\r\n}\r\n","\r\nvar values = require('../helpers/values');\r\n\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar next_segment = require('../selectors/next_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar select_cursor_segment = require('../selectors/select_cursor_segment');\r\n\r\nvar get_current_segment = require('../getters/get_current_segment');\r\n\r\nvar reset = require('../setters/reset');\r\nvar manual_number_entry = require('../setters/manual_number_entry');\r\nvar clear_segment = require('../setters/clear_segment');\r\nvar increment_current_segment = require('../setters/increment_current_segment');\r\nvar decrement_current_segment = require('../setters/decrement_current_segment');\r\nvar set_mode = require('../setters/set_mode');\r\nvar switch_times = require('../setters/switch_times');\r\n\r\nvar handle_tab = require('../events/handle_tab');\r\n\r\nvar all_number_keys = require('../static-values/all_number_keys');\r\nvar named_keys = require('../static-values/named_keys');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function bind_events ($input) {\r\n\r\n\tvar prev_value = '';\r\n\r\n\tvar shiftKey = false;\r\n\r\n\tdocument.addEventListener('keydown', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\tdocument.addEventListener('keyup', function(e){\r\n\t\tshiftKey = e.shiftKey;\r\n\t})\r\n\r\n\tif ($input.form) {\r\n\t\t$input.form.addEventListener('submit', function(){\r\n\t\t\tauto_swap($input);\r\n\t\t})\r\n\t}\r\n\r\n\tvar focused_via_click = false;\r\n\r\n\t$input.addEventListener('mousedown', function(){\r\n\t\tfocused_via_click = true;\r\n\t});\r\n\r\n\t// Turns the IE clear button into a reset button\r\n\t$input.addEventListener('mouseup', function(){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif ($input.value === '') reset($input);\r\n\t\t}, 1)\r\n\t});\r\n\r\n\t$input.addEventListener('click', function(e){\r\n\t\tselect_cursor_segment($input);\r\n\t});\r\n\r\n\t$input.addEventListener('blur', function(){\r\n\t\tvar current_value = $input.dataset.value;\r\n\t\tif (current_value !== prev_value) {\r\n\t\t\tprev_value = current_value;\r\n\t\t}\r\n\t\tfocused_via_click = false;\r\n\t});\r\n\r\n\t$input.addEventListener('focus', function(e){\r\n\t\tif (!focused_via_click) {\r\n\t\t\te.preventDefault();\r\n\t\t\tvar segment = shiftKey ? 'mode' : 'hrs';\r\n\t\t\tselect_segment($input, segment);\r\n\t\t}\r\n\t\tupdate_a11y($input, [\r\n\t\t\t'initial',\r\n\t\t\t'select'\r\n\t\t])\r\n\t});\r\n\r\n\t$input.addEventListener('keydown', function(e) {\r\n\t\tvar is_enter_key = e.which === 13;\r\n\t\tif (is_enter_key) return true;\r\n\r\n\t\tvar is_number_key = all_number_keys.indexOf(e.which) > -1;\r\n\t\tvar is_named_key = values(named_keys).indexOf(e.which) > -1;\r\n\t\tvar is_arrow_key = [named_keys.ArrowDown, named_keys.ArrowRight, named_keys.ArrowUp, named_keys.ArrowLeft].indexOf(e.which) > -1;\r\n\t\tvar is_mode_key = [named_keys.a, named_keys.p].indexOf(e.which) > -1;\r\n\t\tvar is_delete_key = [named_keys.Delete, named_keys.Backspace].indexOf(e.which) > -1;\r\n\r\n\t\tif (!is_named_key || is_arrow_key || is_number_key || is_mode_key || is_delete_key) { e.preventDefault(); }\r\n\r\n\t\tif (is_number_key) {\r\n\t\t\tmanual_number_entry($input, e.which);\r\n\t\t}\r\n\r\n\t\tif (is_delete_key) {\r\n\t\t\tvar segment = get_current_segment($input);\r\n\t\t\tclear_segment($input, segment);\r\n\t\t}\r\n\r\n\t\tswitch (e.which) {\r\n\t\t\tcase named_keys.ArrowRight: next_segment($input); break;\r\n\t\t\tcase named_keys.ArrowLeft: prev_segment($input); break;\r\n\t\t\tcase named_keys.ArrowUp: increment_current_segment($input); break;\r\n\t\t\tcase named_keys.ArrowDown: decrement_current_segment($input); break;\r\n\t\t\tcase named_keys.Escape: reset($input); break;\r\n\t\t\tcase named_keys.a: set_mode($input, 'AM'); break;\r\n\t\t\tcase named_keys.p: set_mode($input, 'PM'); break;\r\n\t\t\tcase named_keys.Tab: handle_tab($input, e); break;\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction auto_swap($input) {\r\n\tif ($input.polyfill.autoSwap) {\r\n\t\tswitch_times($input, 24);\r\n\t\tsetTimeout(function(){\r\n\t\t\tswitch_times($input, 12);\r\n\t\t}, 1);\r\n\t}\r\n}\r\n","\r\nmodule.exports = function create_event(eventName){\r\n\tvar event = document.createEvent('Event');\r\n\tevent.initEvent(eventName, true, true);\r\n\treturn event;\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar prev_segment = require('../selectors/prev_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nmodule.exports = function handle_tab($input, e) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tvar backwards_and_first = e.shiftKey && current_segment === 'hrs';\r\n\tvar forwards_and_last = !e.shiftKey && current_segment === 'mode';\r\n\r\n\tif (!backwards_and_first && !forwards_and_last) {\r\n\t\te.preventDefault();\r\n\t\tif (e.shiftKey) {\r\n\t\t\tprev_segment($input);\r\n\t\t} else {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar trigger_event = require('./trigger_event');\r\n\r\n// It seems that oninput and onchange are treated the same way by browsers :/\r\nmodule.exports = function trigger_both_events($input) {\r\n\t// the event only ever fires if there is a full valid value available\r\n\ttrigger_event($input, 'input');\r\n\ttrigger_event($input,'change');\r\n}\r\n","\r\nvar create_event = require('./create_event');\r\n\r\nvar inputEvent = create_event('input');\r\nvar changeEvent = create_event('change');\r\n\r\nmodule.exports = function trigger_event($input, eventName) {\r\n\tvar event = {\r\n\t\tinput: inputEvent,\r\n\t\tchange: changeEvent,\r\n\t}[eventName];\r\n\r\n\tif (can_trigger_change($input)) {\r\n\t\t$input.dispatchEvent(event);\r\n\t}\r\n}\r\n\r\n// Browsers only send out input and change events if the time element has a full valid value\r\nfunction can_trigger_change ($input) {\r\n\treturn !/--/.test($input.value);\r\n}\r\n","// selector is optional, it allows for an early exit\r\nmodule.exports = function ($input, selectorString) {\r\n\tvar $elem = $input;\r\n\r\n\t// https://stackoverflow.com/a/8729274/1611058\r\n\tvar ancestors = [];\r\n\twhile ($elem) {\r\n\t\tancestors.push($elem);\r\n\t\tvar matchesSelector = $elem.msMatchesSelector ?\r\n\t\t\t$elem.msMatchesSelector(selectorString) :\r\n\t\t\t$elem.matches(selectorString);\r\n\t\tif (matchesSelector) {\r\n\t\t\treturn ancestors;\r\n\t\t}\r\n\t\t$elem = $elem.parentElement;\r\n\t}\r\n\r\n\treturn ancestors;\r\n}\r\n","\r\nvar ranges = require('../static-values/ranges');\r\nvar get_selected_range = require('./get_selected_range');\r\n\r\nmodule.exports = function get_current_segment ($input) {\r\n\tvar selection = get_selected_range($input);\r\n\tfor (var segment in ranges) {\r\n\t\tvar range = ranges[segment];\r\n\t\tvar aboveMin = range.start <= selection.start;\r\n\t\tvar belowMax = range.end >= selection.end;\r\n\t\tif (aboveMin && belowMax) {\r\n\t\t\treturn segment;\r\n\t\t}\r\n\t}\r\n\treturn 'hrs';\r\n}\r\n","\r\nvar get_ancestors = require('./get_ancestors');\r\n\r\nmodule.exports = function get_label ($input) {\r\n\r\n\tvar labelText =\r\n\t\taria_labelledby($input) ||\r\n\t\taria_label($input) ||\r\n\t\tfor_attribute($input) ||\r\n\t\tlabel_wrapper_element($input) ||\r\n\t\ttitle_attribute($input);\r\n\r\n\tif (labelText) return labelText;\r\n\r\n\tconsole.error('Label text for input not found.', $input);\r\n\tthrow new Error('Cannot polyfill time input due to a missing label.');\r\n}\r\n\r\nfunction aria_labelledby($input){\r\n\tvar ariaLabelByID = $input.getAttribute('aria-labelledby');\r\n\tif (ariaLabelByID) {\r\n\t\tvar $ariaLabelBy = document.getElementById(ariaLabelByID);\r\n\t\tif ($ariaLabelBy) return $ariaLabelBy.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction aria_label($input){\r\n\tvar ariaLabel = $input.getAttribute('aria-label');\r\n\tif (ariaLabel) return ariaLabel;\r\n\treturn false;\r\n}\r\n\r\nfunction for_attribute($input){\r\n\tif ($input.id) {\r\n\t\tvar $forLabel = document.querySelector('label[for=\"'+$input.id+'\"]');\r\n\t\tif ($forLabel) return $forLabel.textContent;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction label_wrapper_element($input){\r\n\tvar ancestors = get_ancestors($input, 'label');\r\n\tvar $parentLabel = ancestors[ancestors.length - 1];\r\n\tif ($parentLabel.nodeName == 'LABEL') return $parentLabel.textContent;\r\n\treturn false\r\n}\r\n\r\nfunction title_attribute($input){\r\n\tvar titleLabel = $input.getAttribute('title');\r\n\tif (titleLabel) return titleLabel;\r\n\treturn false\r\n}\r\n","\r\nmodule.exports = function get_selected_range ($input) {\r\n\treturn { start: $input.selectionStart, end: $input.selectionEnd };\r\n}\r\n","\r\nvar convert_number = require('../converters/convert_number');\r\n\r\nmodule.exports = function get_values ($input, timeString) {\r\n\tvar value = timeString ? timeString : $input.value;\r\n\tvar regEx = /([0-9-]{1,2})\\:([0-9-]{1,2})\\s?(AM|PM|\\-\\-)?/;\r\n\tvar result = regEx.exec(value);\r\n\r\n\treturn {\r\n\t\thrs: convert_number(result[1]),\r\n\t\tmin: convert_number(result[2]),\r\n\t\tmode: result[3],\r\n\t}\r\n}\r\n","\r\nvar manual_entry_log = [];\r\n\r\nfunction clear () {\r\n\tmanual_entry_log = [];\r\n}\r\n\r\nfunction add (entry) {\r\n\tmanual_entry_log.push(entry);\r\n}\r\n\r\nfunction items(){\r\n\treturn manual_entry_log;\r\n}\r\n\r\nmodule.exports = {\r\n\titems: items,\r\n\tclear: clear,\r\n\tadd: add,\r\n}\r\n","\r\n// IE11 doesn't support Object.values()\r\nmodule.exports = function values (obj) {\r\n\tvar key_values = [];\r\n\tfor (var key in obj) {\r\n\t\tkey_values.push(obj[key]);\r\n\t}\r\n\treturn key_values;\r\n}\r\n","\r\nvar toArray = require('../converters/toArray');\r\n\r\nmodule.exports = function _$$ (selector) {\r\n\tvar elements = document.querySelectorAll(selector);\r\n\treturn toArray(elements);\r\n}\r\n","\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function next_segment ($input) {\r\n\ttraverse($input, 'next');\r\n}\r\n","\r\nvar traverse = require('./traverse');\r\n\r\nmodule.exports = function prev_segment ($input) {\r\n\ttraverse($input, 'prev');\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('./select_segment');\r\n\r\nmodule.exports = function select_cursor_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tselect_segment($input, current_segment);\r\n}\r\n","\r\nmodule.exports = function select_segment ($input, segment) {\r\n\r\n\tset_input_type();\r\n\r\n\tvar actions = {\r\n\t\thrs: select(0, 2),\r\n\t\tmin: select(3, 5),\r\n\t\tmode: select(6, 8),\r\n\t};\r\n\r\n\tactions[segment]($input);\r\n\r\n\tfunction set_input_type() {\r\n\t\tvar type = segment === 'mode' ? 'text' : 'tel';\r\n\t\t$input.setAttribute('type', type);\r\n\t}\r\n\r\n\tfunction select (start, end) {\r\n\t\treturn function () {\r\n\t\t\t$input.setSelectionRange(start, end);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar segments = require('../static-values/segments');\r\n\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function traverse ($input, direction) {\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tvar modifier = direction === 'next' ? 1 : -1;\r\n\tvar next_segment_index = segments.indexOf(segment) + modifier;\r\n\r\n\tvar next_segment = {\r\n\t\tnext: segments[next_segment_index] || 'mode',\r\n\t\tprev: next_segment_index < 0 ? 'hrs' : segments[next_segment_index],\r\n\t}[direction];\r\n\r\n\tselect_segment($input, next_segment);\r\n\tmanual_entry_log.clear();\r\n\tupdate_a11y($input, ['select'])\r\n}\r\n","\r\n// I need to keep this separate from reset so that\r\n// I can reset without attracting focus\r\n\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function apply_default ($input) {\r\n\t$input.value = '--:-- --';\r\n\tset_data_attribute($input, '');\r\n\ttrigger_both_events($input);\r\n}\r\n","\r\nvar set_segment = require('./set_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function clear_segment ($input, segment) {\r\n\tset_segment($input, segment, '--');\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n","\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function decrement ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'PM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'down');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar decrement = require('../setters/decrement');\r\n\r\nmodule.exports = function decrement_current_segment ($input){\r\n\tvar current_segment = get_current_segment($input);\r\n\tdecrement($input, current_segment);\r\n}\r\n","\r\nvar switch_mode = require('./switch_mode');\r\nvar nudge_time_segment = require('./nudge_time_segment');\r\nvar update_a11y = require('../accessibility/update_a11y');\r\n\r\nmodule.exports = function increment ($input, segment) {\r\n\tif (segment === 'mode') {\r\n\t\tswitch_mode($input, 'AM')\r\n\t} else {\r\n\t\tnudge_time_segment($input, segment, 'up');\r\n\t}\r\n\tupdate_a11y($input, ['update']);\r\n}\r\n\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar increment = require('../setters/increment');\r\n\r\nmodule.exports = function increment_current_segment ($input) {\r\n\tvar current_segment = get_current_segment($input);\r\n\tincrement($input, current_segment);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\nvar next_segment = require('../selectors/next_segment');\r\n\r\nvar manual_entry_log = require('../helpers/manual_entry_log');\r\nvar sorted_number_keys = require('../static-values/sorted_number_keys');\r\n\r\nmodule.exports = function manual_number_entry($input, key) {\r\n\tvar key_value = sorted_number_keys[key];\r\n\tvar segment = get_current_segment($input);\r\n\r\n\tif (segment !== 'mode') {\r\n\t\tvar entry_count = manual_entry_log.items().length;\r\n\r\n\t\tvar upper_limits = {\r\n\t\t\thrs: [1,2],\r\n\t\t\tmin: [5,9],\r\n\t\t}\r\n\t\tvar limit = upper_limits[segment][entry_count];\r\n\r\n\t\tif (entry_count < 2) {\r\n\t\t\tmanual_entry_log.add(key_value);\r\n\t\t}\r\n\r\n\t\tvar full_limit = parseInt(upper_limits[segment].join(''));\r\n\t\tvar full_entry = parseInt(manual_entry_log.items().join(''));\r\n\r\n\t\tif (full_limit >= full_entry) {\r\n\t\t\tset_segment($input, segment, full_entry);\r\n\t\t}\r\n\r\n\t\tvar at_limit = key_value > limit || manual_entry_log.items().length === 2;\r\n\r\n\t\tif (at_limit) {\r\n\t\t\tnext_segment($input);\r\n\t\t}\r\n\t}\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar convert_hours_to_12hr_time = require('../converters/convert_hours_to_12hr_time');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function nudge_time_segment ($input, segment, direction) {\r\n\tvar current_values = get_values($input);\r\n\tvar time;\r\n\r\n\tvar modifier = direction === 'up' ? 1 : -1;\r\n\r\n\tif (current_values[segment] === '--') {\r\n\t\tvar current_time = new Date();\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_time.getHours()),\r\n\t\t\tmin: current_time.getMinutes(),\r\n\t\t}\r\n\t} else {\r\n\t\tvar minutes = {\r\n\t\t\tup : current_values.min < 59 ? current_values.min + modifier : 0,\r\n\t\t\tdown : current_values.min === 0 ? 59 : current_values.min + modifier,\r\n\t\t}\r\n\t\ttime = {\r\n\t\t\thrs: convert_hours_to_12hr_time(current_values.hrs + modifier),\r\n\t\t\tmin: minutes[direction],\r\n\t\t}\r\n\t}\r\n\r\n\tset_segment($input, segment, leading_zero(time[segment]) );\r\n}\r\n","\r\nvar apply_default = require('./apply_default');\r\nvar select_segment = require('../selectors/select_segment');\r\n\r\nmodule.exports = function reset ($input) {\r\n\tapply_default($input);\r\n\tselect_segment($input, 'hrs');\r\n}\r\n","\r\nvar convert_to_24hr_time = require('../converters/convert_to_24hr_time')\r\n\r\nmodule.exports = function set_data_attribute($input, timeString_12hr){\r\n\tvar filteredString = timeString_12hr.indexOf('-') > -1 ? '' : timeString_12hr;\r\n\tvar time24hr = convert_to_24hr_time(filteredString);\r\n\t$input.setAttribute('data-value', time24hr);\r\n}\r\n","\r\nvar get_current_segment = require('../getters/get_current_segment');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function set_mode ($input, type) {\r\n\tvar segment = get_current_segment($input);\r\n\tif (segment === 'mode') {\r\n\t\tset_segment($input, segment, type);\r\n\t}\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar leading_zero = require('../converters/leading_zero');\r\nvar select_segment = require('../selectors/select_segment');\r\nvar set_data_attribute = require('./set_data_attribute');\r\nvar trigger_both_events = require('../events/trigger_both_events');\r\n\r\nmodule.exports = function set_segment ($input, segment, value) {\r\n\tvar values = get_values($input);\r\n\tvalues[segment] = value;\r\n\tvar newInputVal = [\r\n\t\tleading_zero(values.hrs),':',\r\n\t\tleading_zero(values.min),' ',\r\n\t\tvalues.mode\r\n\t].join('');\r\n\t$input.value = newInputVal;\r\n\tselect_segment($input, segment);\r\n\tset_data_attribute($input, newInputVal);\r\n\ttrigger_both_events($input);\r\n}\r\n","\r\nvar convert_to_12hr_time = require('../converters/convert_to_12hr_time');\r\nvar set_data_attribute = require('../setters/set_data_attribute');\r\n\r\nmodule.exports = function set_time($input, time_string_24hr) {\r\n\tvar twelveHr = convert_to_12hr_time(time_string_24hr);\r\n\t$input.value = twelveHr;\r\n\tset_data_attribute($input, time_string_24hr);\r\n}\r\n","\r\nvar get_values = require('../getters/get_values');\r\nvar set_segment = require('./set_segment');\r\n\r\nmodule.exports = function switch_mode ($input, default_mode) {\r\n\tdefault_mode = default_mode || 'AM';\r\n\tvar current_mode = get_values($input).mode;\r\n\tvar new_mode = {\r\n\t\t'--' : default_mode,\r\n\t\t'AM' : 'PM',\r\n\t\t'PM' : 'AM',\r\n\t}[current_mode];\r\n\tset_segment($input, 'mode', new_mode);\r\n}\r\n","\r\nvar switch_to_data_value = require('./switch_to_data_value');\r\nvar set_time = require('./set_time');\r\n\r\nmodule.exports = function switch_times ($input, format) {\r\n\tvar is12hr = /\\s/.test($input.value);\r\n\r\n\tif (format != 12 && format != 24) {\r\n\t\tformat = is12hr ? 24 : 12;\r\n\t}\r\n\r\n\tvar actions = {\r\n\t\t12: function(){\r\n\t\t\tif (!is12hr) {\r\n\t\t\t\tset_time($input, $input.dataset.value);\r\n\t\t\t}\r\n\t\t},\r\n\t\t24: function(){\r\n\t\t\tif (is12hr) {\r\n\t\t\t\tswitch_to_data_value($input);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tactions[format]();\r\n}\r\n","\r\nmodule.exports = function($input) {\r\n\tvar replacementVal = $input.dataset.value;\r\n\t$input.value = replacementVal;\r\n}\r\n","\r\nvar set_time = require('../setters/set_time');\r\n\r\nmodule.exports = function update_time($input) {\r\n\tset_time($input, $input.value);\r\n\treturn $input;\r\n}\r\n","var all_number_keys = [\r\n // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\r\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,\r\n 96, 97, 98, 99,100,101,102,103,104,105\r\n];\r\n\r\nmodule.exports = all_number_keys;\r\n","var named_keys = {\r\n\tArrowDown: 40,\r\n\tArrowRight: 39,\r\n\tArrowUp: 38,\r\n\tArrowLeft: 37,\r\n\tBackspace: 8,\r\n\tDelete: 46,\r\n\tTab: 9,\r\n\tShift: 16,\r\n\tEscape: 27,\r\n\ta: 65,\r\n\tp: 80,\r\n}\r\n\r\nmodule.exports = named_keys;\r\n","\r\nvar ranges = {\r\n\thrs : { start: 0, end: 2 },\r\n\tmin : { start: 3, end: 5 },\r\n\tmode : { start: 6, end: 8 },\r\n}\r\n\r\nmodule.exports = ranges;\r\n","\r\nvar ranges = require('./ranges');\r\n\r\nvar segments = Object.keys(ranges);\r\n\r\nmodule.exports = segments;\r\n","\r\nvar all_number_keys = require('./all_number_keys');\r\n\r\nvar sorted_number_keys = {};\r\n// sorted_number_keys = { 48: 0, 49: 1, 96: 0, 97: 1, ... };\r\nall_number_keys.forEach(function(key, index) {\r\n\tvar number_val = index > 9 ? index - 10 : index;\r\n\tsorted_number_keys[key] = number_val;\r\n});\r\n\r\nmodule.exports = sorted_number_keys;\r\n","\r\nvar apply_default = require('./core/setters/apply_default');\r\nvar update_time = require('./core/setters/update_time');\r\nvar set_data_attribute = require('./core/setters/set_data_attribute');\r\nvar bind_events = require('./core/events/bind_events');\r\nvar switch_times = require('./core/setters/switch_times');\r\nvar get_label = require('./core/getters/get_label');\r\n\r\nvar create_a11y_block = require('./core/accessibility/create_a11y_block');\r\n\r\nvar accessibility_block_created = false;\r\nvar $a11y;\r\n\r\nfunction TimePolyfill($input) {\r\n\r\n\t$input.setAttribute('autocomplete','off');\r\n\r\n\t// Prevent screen reader from announcing the default stuff\r\n\t$input.setAttribute('aria-hidden', true);\r\n\r\n\tif (!accessibility_block_created) {\r\n\t\t$a11y = create_a11y_block();\r\n\t\taccessibility_block_created = true;\r\n\t}\r\n\r\n\tvar label = get_label($input);\r\n\r\n\t$input.polyfill = {\r\n\t\t$a11y: $a11y,\r\n\t\tlabel: label,\r\n\t\tautoSwap: true,\r\n\t\tupdate: function() {\r\n\t\t\tupdate_time($input);\r\n\t\t},\r\n\t\tswap: function(forcedFormat) {\r\n\t\t\tswitch_times($input, forcedFormat);\r\n\t\t}\r\n\t}\r\n\r\n\tif ($input.value === '' || /--/.test($input.value)) {\r\n\t\tapply_default($input);\r\n\t\tset_data_attribute($input, '');\r\n\t} else {\r\n\t\tupdate_time($input);\r\n\t\tset_data_attribute($input, $input.value);\r\n\t}\r\n\r\n\tbind_events($input);\r\n}\r\n\r\nif (window) window.TimePolyfill = TimePolyfill;\r\nif (module) module.exports = TimePolyfill;\r\n","\r\nmodule.exports = function($result, values){\r\n\tvar $list = $result.querySelector('.result__list');\r\n\tvar $close = $result.querySelector('.result__close');\r\n\r\n\tvar html = '';\r\n\tfor (var label in values) {\r\n\t\tvar value = values[label].replace(/^$/,'blank');\r\n\t\thtml = html + [\r\n\t\t\t'
',\r\n\t\t\t\t'
',label,'
',\r\n\t\t\t\t'
\"',value,'\"
',\r\n\t\t\t'
'\r\n\t\t].join('');\r\n\t}\r\n\t$list.innerHTML = html;\r\n\t$result.classList.add('-visible');\r\n\r\n\t$close.onclick = function(){\r\n\t\t$result.classList.remove('-visible');\r\n\t}\r\n}\r\n","\r\n//Code for tracking Google Analytics events\r\nmodule.exports = function GA_trackEvent(action, categoryLabelValue) {\r\n\r\n\tif (typeof gtag !== 'undefined') {\r\n\r\n\t\tif (categoryLabelValue) {\r\n\t\t\tgtag('event', action, {\r\n\t\t\t\tevent_category: categoryLabelValue[0],\r\n\t\t\t\tevent_label: categoryLabelValue[1],\r\n\t\t\t\tvalue: categoryLabelValue[2],\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tgtag('event', action);\r\n\t\t}\r\n\r\n\t} else {\r\n\t\tcategoryLabelValue = {};\r\n\t\tvar data = {\r\n\t\t\taction: action,\r\n\t\t\tevent_category: categoryLabelValue.category || 'general',\r\n\t\t\tevent_label: categoryLabelValue.label || '(not set)',\r\n\t\t\tvalue: categoryLabelValue.value\r\n\t\t}\r\n\r\n\t\tconsole.log(\"GA event =\", data, '* = required');\r\n\t}\r\n}\r\n","// Main javascript entry point\r\n// Should handle bootstrapping/starting application\r\n\r\n'use strict';\r\n\r\n// Time input polyfill\r\nvar TimePolyfill = require('../../index');\r\nvar _$$ = require('../../core/selectors/_$$');\r\nvar toArray = require('../../core/converters/toArray');\r\n\r\nvar result = require('../_modules/result/result');\r\n\r\nvar ga = require('./_helpers/gtag');\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", function() {\r\n\t// var $$timeInputs = _$$('input[type=\"time\"]');\r\n\tvar $$timeInputs = _$$('input.time');\r\n\t$$timeInputs.forEach(function (element) {\r\n\t\tnew TimePolyfill(element);\r\n\r\n\t\t// Disable auto swap\r\n\t\t// element.polyfill.autoSwap = false;\r\n\r\n\t\telement.oninput = function(){\r\n\t\t\tconsole.log('input', element.dataset.value);\r\n\t\t}\r\n\t\telement.onchange = function(){\r\n\t\t\tconsole.log('change', element.dataset.value);\r\n\t\t}\r\n\r\n\t\telement.addEventListener('change', function(){\r\n\t\t\tconsole.log('listener change');\r\n\t\t});\r\n\t\telement.addEventListener('input', function(){\r\n\t\t\tconsole.log('listener input');\r\n\t\t});\r\n\t});\r\n\r\n\tdocument.querySelector('form').onsubmit = function(e){\r\n\t\te.preventDefault();\r\n\t\tvar labels = get_labels(this);\r\n\t\tvar values = get_values(this, labels);\r\n\t\tvar $result = document.querySelector('.result');\r\n\r\n\t\tga('form submit');\r\n\r\n\t\tresult($result, values);\r\n\t\t$result.focus();\r\n\r\n\t\tfunction get_labels (form) {\r\n\t\t\tvar labelList = [];\r\n\t\t\ttoArray(form.children).forEach(function(element){\r\n\t\t\t\tvar $label = element.querySelector('label');\r\n\t\t\t\tif ($label) {\r\n\t\t\t\t\tlabelList.push($label.textContent);\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\treturn labelList;\r\n\t\t}\r\n\r\n\t\tfunction get_values (form, labels) {\r\n\t\t\tvar valuesList = {};\r\n\t\t\ttoArray(form.elements).forEach(function(element, i){\r\n\t\t\t\tif (element.nodeName === 'INPUT') {\r\n\t\t\t\t\tvaluesList[labels[i]] = element.value\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\treturn valuesList;\r\n\t\t}\r\n\t}\r\n\r\n});\r\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 543e62c..269896a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -437,7 +437,7 @@ "dev": true, "requires": { "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", + "escape-string-regexp": "^1.0.6", "supports-color": "^5.3.0" } }, @@ -808,7 +808,7 @@ "async-each-series": "^0.1.1", "browser-sync-client": "^2.3.3", "browser-sync-ui": "^0.5.16", - "bs-recipes": "^1.0.5", + "bs-recipes": "^1.0.6", "chokidar": "1.4.1", "connect": "^3.4.0", "dev-ip": "^1.0.1", @@ -3348,8 +3348,8 @@ "dev": true }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.6.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, @@ -3776,7 +3776,7 @@ "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { - "escape-string-regexp": "^1.0.5", + "escape-string-regexp": "^1.0.6", "object-assign": "^4.1.0" }, "dependencies": { @@ -5548,7 +5548,7 @@ "dev": true, "requires": { "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", + "escape-string-regexp": "^1.0.6", "supports-color": "^5.3.0" } }, @@ -5880,7 +5880,7 @@ "dev": true, "requires": { "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", + "escape-string-regexp": "^1.0.6", "supports-color": "^5.3.0" } }, @@ -9500,7 +9500,7 @@ "integrity": "sha1-ZjFBfV8OkJo9fsJrJMio0eT5bks=", "dev": true, "requires": { - "colormin": "^1.0.5", + "colormin": "^1.0.6", "postcss": "^5.0.13", "postcss-value-parser": "^3.2.3" } @@ -9622,8 +9622,8 @@ "dev": true }, "postcss-minify-font-values": { - "version": "1.0.5", - "resolved": "http://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz", + "version": "1.0.6", + "resolved": "http://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-1.0.6.tgz", "integrity": "sha1-S1jttWZB66fIR0qzUmyv17vey2k=", "dev": true, "requires": { @@ -9641,8 +9641,8 @@ } }, "postcss-minify-gradients": { - "version": "1.0.5", - "resolved": "http://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz", + "version": "1.0.6", + "resolved": "http://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-1.0.6.tgz", "integrity": "sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE=", "dev": true, "requires": { @@ -10762,7 +10762,7 @@ "aws-sign2": "~0.7.0", "aws4": "^1.6.0", "caseless": "~0.12.0", - "combined-stream": "~1.0.5", + "combined-stream": "~1.0.6", "extend": "~3.0.1", "forever-agent": "~0.6.1", "form-data": "~2.3.1", @@ -10828,7 +10828,7 @@ "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "dev": true, "requires": { - "path-parse": "^1.0.5" + "path-parse": "^1.0.6" } }, "resolve-dir": { @@ -11063,8 +11063,8 @@ } }, "seek-bzip": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", "integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=", "dev": true, "requires": { @@ -11800,7 +11800,7 @@ "dev": true, "requires": { "commander": "^2.2.0", - "limiter": "^1.0.5" + "limiter": "^1.0.6" } }, "strict-uri-encode": { diff --git a/package.json b/package.json index ebd618b..40002a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "time-input-polyfill", "description": "An accessible polyfill for `` elements modeled after the Chrome & Firefox desktop implementations.", - "version": "1.0.5", + "version": "1.0.6", "main": "index.js", "jsdelivr": "dist/time-input-polyfill.auto.min.js", "dependencies": {},