· 8 years ago · Apr 05, 2018, 08:12 PM
1<!doctype html>
2<!--[if lt IE 7]>
3<html class="no-js mode-ie mode-ie6 lt-ie8 lt-ie7 desktop " lang="pt-BR">
4 <![endif]-->
5 <!--[if IE 7]>
6 <html class="no-js mode-ie mode-ie7 lt-ie8 desktop " lang="pt-BR">
7 <![endif]-->
8 <!--[if IE 8]>
9 <html class="no-js mode-ie mode-ie8 desktop " lang="pt-BR">
10 <![endif]-->
11 <!--[if IE 9]>
12 <html class="no-js mode-ie mode-ie9 desktop " lang="pt-BR">
13 <![endif]-->
14 <!--[if gt IE 9]>
15 <!-->
16 <html class="no-js desktop " lang="pt-BR" >
17 <!--
18 <![endif]-->
19 <head>
20 <meta charset="utf-8" />
21 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
22 <title>Loja de Artigos Esportivos Online | Netshoes</title>
23 <meta name="robots" content="index,follow"/>
24 <meta name="apple-mobile-web-app-capable" content="yes" />
25 <meta name="apple-mobile-web-app-status-bar-style" content="black" />
26 <meta name="viewport" content="initial-scale=1,width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no" />
27 <meta name="referrer" content="always" />
28 <meta property="og:image" content="//static-hmg-netshoes-com-br.ns2online.com.br/dev/netshoesbr/images/share.png">
29 <meta property="og:image:type" content="image/png">
30 <link rel="dns-prefetch" href="//static-hmg-netshoes-com-br.ns2online.com.br"/>
31 <link rel="dns-prefetch" href="//fonts.googleapis.com"/>
32 <link rel="dns-prefetch" href="//www.google-analytics.com"/>
33 <link rel="dns-prefetch" href="//static.chaordicsystems.com"/>
34 <link rel="dns-prefetch" href="//www.googletagmanager.com"/>
35 <link rel="dns-prefetch" href="//www.google.com"/>
36 <link rel="dns-prefetch" href="//www.google.com.br"/>
37 <link rel="preconnect" href="//static-hmg-netshoes-com-br.ns2online.com.br" crossorigin/>
38 <link rel="preconnect" href="//fonts.googleapis.com" crossorigin/>
39 <link rel="preconnect" href="//www.google-analytics.com" crossorigin/>
40 <link rel="preconnect" href="//static.chaordicsystems.com" crossorigin/>
41 <link rel="preconnect" href="//www.googletagmanager.com" crossorigin/>
42 <link rel="preconnect" href="//www.google.com" crossorigin/>
43 <link rel="preconnect" href="//www.google.com.br" crossorigin/>
44 <link rel="icon" href="//static-hmg-netshoes-com-br.ns2online.com.br/dev/netshoesbr/images/favicon.ico" type="image/x-icon" />
45 <meta name="google-site-verification" content="HOMOLOGACAO" />
46 <meta name="google-site-verification" content="HOMOLOGACAO" />
47 <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800italic,800' rel='stylesheet' type='text/css'>
48 <link type="text/css" rel="stylesheet" href="//static-hmg-netshoes-com-br.ns2online.com.br/dev/netshoesbr/legacy2/css/login.min.css" />
49 <script type="text/javascript">(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){try {(i[r].q=i[r].q||[]).push(arguments)}catch(err){}},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','_ga');var createParamsGA = {"cookieDomain":"hmg-netshoes-com-br.ns2online.com.br"};_ga('create', 'UA-1776034-5', createParamsGA);_ga('require', 'GTM-NDZLBGS');;var pageGA='\/login';_ga('send', {"dimension16":"Account","dimension17":"/login","dimension18":"","dimension19":"Minha conta","dimension35":"","hitType":"pageview","page":pageGA});</script>
50 <script type='text/javascript'>window.NREUM||(NREUM={});NREUM.info = {"agent":"","beacon":"bam.nr-data.net","errorBeacon":"bam.nr-data.net","licenseKey":"91a76a6057","applicationID":"33413387","applicationTime":72.222445,"transactionName":"NANXZBMHWkYFBUELWA1JcEgRFFFGFwxGTXAmMhofDQlTXAo=","queueTime":0,"ttGuid":"aad48af2647878","agentToken":null}; window.NREUM||(NREUM={}),__nr_require=function(e,t,n){function r(n){if(!t[n]){var o=t[n]={exports:{}};e[n][0].call(o.exports,function(t){var o=e[n][1][t];return r(o||t)},o,o.exports)}return t[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o
51 <n.length;o++)r(n[o]);return r}({1:[function(e,t,n){function r(){}function o(e,t,n){return function(){return i(e,[f.now()].concat(u(arguments)),t?null:this,n),t?void 0:this}}var i=e("handle"),a=e(2),u=e(3),c=e("ee").get("tracer"),f=e("loader"),s=NREUM;"undefined"==typeof window.newrelic&&(newrelic=s);var p=["setPageViewName","setCustomAttribute","setErrorHandler","finished","addToTrace","inlineHit","addRelease"],d="api-",l=d+"ixn-";a(p,function(e,t){s[t]=o(d+t,!0,"api")}),s.addPageAction=o(d+"addPageAction",!0),s.setCurrentRouteName=o(d+"routeName",!0),t.exports=newrelic,s.interaction=function(){return(new r).get()};var m=r.prototype={createTracer:function(e,t){var n={},r=this,o="function"==typeof t;return i(l+"tracer",[f.now(),e,n],r),function(){if(c.emit((o?"":"no-")+"fn-start",[f.now(),r,o],n),o)try{return t.apply(this,arguments)}catch(e){throw c.emit("fn-err",[arguments,this,e],n),e}finally{c.emit("fn-end",[f.now()],n)}}}};a("setName,setAttribute,save,ignore,onEnd,getContext,end,get".split(","),function(e,t){m[t]=o(l+t)}),newrelic.noticeError=function(e){"string"==typeof e&&(e=new Error(e)),i("err",[e,f.now()])}},{}],2:[function(e,t,n){function r(e,t){var n=[],r="",i=0;for(r in e)o.call(e,r)&&(n[i]=t(r,e[r]),i+=1);return n}var o=Object.prototype.hasOwnProperty;t.exports=r},{}],3:[function(e,t,n){function r(e,t,n){t||(t=0),"undefined"==typeof n&&(n=e?e.length:0);for(var r=-1,o=n-t||0,i=Array(o
52 <0?0:o);++r
53 <o;)i[r]=e[t+r];return i}t.exports=r},{}],4:[function(e,t,n){t.exports={exists:"undefined"!=typeof window.performance&&window.performance.timing&&"undefined"!=typeof window.performance.timing.navigationStart}},{}],ee:[function(e,t,n){function r(){}function o(e){function t(e){return e&&e instanceof r?e:e?c(e,u,i):i()}function n(n,r,o,i){if(!d.aborted||i){e&&e(n,r,o);for(var a=t(o),u=m(n),c=u.length,f=0;f
54 <c;f++)u[f].apply(a,r);var p=s[y[n]];return p&&p.push([b,n,r,a]),a}}function l(e,t){v[e]=m(e).concat(t)}function m(e){return v[e]||[]}function w(e){return p[e]=p[e]||o(n)}function g(e,t){f(e,function(e,n){t=t||"feature",y[n]=t,t in s||(s[t]=[])})}var v={},y={},b={on:l,emit:n,get:w,listeners:m,context:t,buffer:g,abort:a,aborted:!1};return b}function i(){return new r}function a(){(s.api||s.feature)&&(d.aborted=!0,s=d.backlog={})}var u="nr@context",c=e("gos"),f=e(2),s={},p={},d=t.exports=o();d.backlog=s},{}],gos:[function(e,t,n){function r(e,t,n){if(o.call(e,t))return e[t];var r=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!1}),r}catch(i){}return e[t]=r,r}var o=Object.prototype.hasOwnProperty;t.exports=r},{}],handle:[function(e,t,n){function r(e,t,n,r){o.buffer([e],r),o.emit(e,t,n)}var o=e("ee").get("handle");t.exports=r,r.ee=o},{}],id:[function(e,t,n){function r(e){var t=typeof e;return!e||"object"!==t&&"function"!==t?-1:e===window?0:a(e,i,function(){return o++})}var o=1,i="nr@id",a=e("gos");t.exports=r},{}],loader:[function(e,t,n){function r(){if(!x++){var e=h.info=NREUM.info,t=d.getElementsByTagName("script")[0];if(setTimeout(s.abort,3e4),!(e&&e.licenseKey&&e.applicationID&&t))return s.abort();f(y,function(t,n){e[t]||(e[t]=n)}),c("mark",["onload",a()+h.offset],null,"api");var n=d.createElement("script");n.src="https://"+e.agent,t.parentNode.insertBefore(n,t)}}function o(){"complete"===d.readyState&&i()}function i(){c("mark",["domContent",a()+h.offset],null,"api")}function a(){return E.exists&&performance.now?Math.round(performance.now()):(u=Math.max((new Date).getTime(),u))-h.offset}var u=(new Date).getTime(),c=e("handle"),f=e(2),s=e("ee"),p=window,d=p.document,l="addEventListener",m="attachEvent",w=p.XMLHttpRequest,g=w&&w.prototype;NREUM.o={ST:setTimeout,SI:p.setImmediate,CT:clearTimeout,XHR:w,REQ:p.Request,EV:p.Event,PR:p.Promise,MO:p.MutationObserver};var v=""+location,y={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-1071.min.js"},b=w&&g&&g[l]&&!/CriOS/.test(navigator.userAgent),h=t.exports={offset:u,now:a,origin:v,features:{},xhrWrappable:b};e(1),d[l]?(d[l]("DOMContentLoaded",i,!1),p[l]("load",r,!1)):(d[m]("onreadystatechange",o),p[m]("onload",r)),c("mark",["firstbyte",u],null,"api");var x=0,E=e(4)},{}]},{},["loader"]);
55 </script>
56 <script type="text/javascript" id="polyfills">var freedom = freedom || {};
57
58freedom = (function (f, win, doc) {
59 'use strict';
60
61 f.isIe8 = !!doc.querySelector('html.lt-ie9');
62 f.isMobile = !!doc.querySelector('html.mobile');
63
64 f.isDate = function (date) {
65 // http://stackoverflow.com/a/643827/1064325
66 return typeof date.getMonth === 'function';
67 };
68
69 f.isString = function (string) {
70 return typeof string === 'string';
71 };
72
73 f.preventDefault = function (event) {
74 // TODO: DO NOT REMOVE IF THE IMPACT WASN'T ANALYSED AND FIXED
75 //if (event) {
76 if (event.preventDefault) {
77 event.preventDefault();
78 } else {
79 event.returnValue = false;
80 }
81 // } else {
82 // return false;
83 //}
84 };
85
86 f.replaceAll = function (str, find, replace) {
87 return str.replace(new RegExp(find, 'g'), replace);
88 };
89
90 f.stopPropagation = function (event) {
91 if (event) {
92 if (event.stopPropagation) {
93 event.stopPropagation();
94 } else {
95 event.returnValue = false;
96 }
97 }
98 };
99
100 f.objectSize = function (obj) {
101 var size = 0, key;
102 for (key in obj) {
103 if (obj.hasOwnProperty(key)) {
104 size++;
105 }
106 }
107 return size;
108 };
109
110 f.removeEvent = function (eventType, elem, handler) {
111 if (elem.removeEventListener) {
112 elem.removeEventListener(eventType, handler);
113 } else {
114 elem.detachEvent('on' + eventType, handler);
115 }
116 };
117
118 f.addEvent = function (eventType, elem, func, event) {
119 if (event) {
120 freedom.preventDefault(event);
121 }
122
123 // A diffent event fallback may be specified in eventType through an array, for example:
124 // freedom.addEvent(['change', 'click'], domElement, callbackHandler);
125 // freedom.addEventListenerByClass('my-class', ['change', 'click'], callbackHandler);
126 var primaryEventType = freedom.isString(eventType) ? eventType : eventType[0];
127 var fallbackEventType = freedom.isString(eventType) ? eventType : eventType[1];
128
129 if (elem) {
130 if (elem.addEventListener) { // W3C DOM
131 elem.removeEventListener(primaryEventType, func);
132 elem.addEventListener(primaryEventType, func, false);
133 } else if (elem.attachEvent) { // IE DOM
134 elem.detachEvent('on' + fallbackEventType, func);
135 elem.attachEvent('on' + fallbackEventType, func);
136 } else { // NO MUCH TO DO
137 elem[primaryEventType] = func;
138 }
139 }
140 };
141
142 f.addEventListenerByClass = function (className, eventType, fn, event) {
143 var list = doc.querySelectorAll('.' + className);
144 for (var i = 0, len = list.length; i < len; i++) {
145 freedom.addEvent(eventType, list[i], fn, event);
146 }
147 };
148
149 f.handleKeydownOnRadioLabel = function (event, elementTo, formName) {
150 // handle selection on enter or space
151 if (event.keyCode === 32 || event.keyCode === 13) {
152 elementTo.checked = true;
153 event.preventDefault();
154 }
155
156 // handle focus on arrow
157 if (event.keyCode === 37 || event.keyCode === 39) {
158 var radioGroup = document[formName][elementTo.name];
159 var currentIndex = undefined;
160 for (var r = 0; r < radioGroup.length; r++) {
161 if (elementTo === radioGroup[r]) {
162 currentIndex = r;
163 break;
164 }
165 }
166
167 // handle focus back on arrow left
168 if (event.keyCode === 37) {
169 if (currentIndex > 0) {
170 radioGroup.item(currentIndex).nextSibling.attributes.tabindex.value = -1;
171 radioGroup.item(currentIndex - 1).nextSibling.attributes.tabindex.value = 0;
172 radioGroup.item(currentIndex - 1).nextSibling.focus();
173 }
174 }
175
176 // handle focus back on arrow left
177 if (event.keyCode === 39) {
178 if (currentIndex < radioGroup.length - 1) {
179 radioGroup.item(currentIndex).nextSibling.attributes.tabindex.value = -1;
180 radioGroup.item(currentIndex + 1).nextSibling.attributes.tabindex.value = 0;
181 radioGroup.item(currentIndex + 1).nextSibling.focus();
182 }
183 }
184 }
185 };
186
187 f.propagateLabelEventsToForElement = function (eventsToPropagate, elementsToPropagate, formName) {
188 for (var evIdx = 0; evIdx < eventsToPropagate.length; evIdx++) {
189 var eventType = eventsToPropagate[evIdx];
190 for (var elIdx = 0; elIdx < elementsToPropagate.length; elIdx++) {
191 var propagationElements = elementsToPropagate[elIdx],
192 elementFrom = doc.getElementById(propagationElements);
193 freedom.addEvent(eventType, elementFrom, function (event) {
194 var elementTo = doc.getElementById(this.attributes.for.value);
195 if (elementTo && typeof elementTo.dispatchEvent === 'function' && event && event.type) {
196 try {
197 elementTo.dispatchEvent(new Event(event.type));
198 } catch (e) { };
199 if (event.type === 'keydown') {
200 freedom.handleKeydownOnRadioLabel(event, elementTo, formName);
201 }
202 }
203 });
204 }
205 }
206 };
207
208 f.getDataAttribute = function (elm, attr) {
209 var ret = elm.srcElement ? elm.srcElement.getAttribute('data-' + attr) : elm.getAttribute('data-' + attr);
210 if (!ret) {
211 // test if camel Case exists;
212 attr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
213 ret = elm.srcElement ? elm.srcElement.getAttribute('data-' + attr) : elm.getAttribute('data-' + attr);
214 }
215 return ret;
216 };
217
218 f.setDataAttribute = function (elm, attr, value) {
219 elm.setAttribute(attr, value);
220 };
221
222 f.getTarget = function (event) {
223 return (event.currentTarget) ? event.currentTarget : ((event.srcElement) ? event.srcElement : this);
224 };
225
226 f.hasClass = function (el, className) {
227 return el.classList ? el.classList.contains(className) : new RegExp('\\b' + className + '\\b').test(el.className);
228 };
229
230 f.addClass = function (el, className) {
231 if (el.classList) {
232 el.classList.add(className);
233 } else if (!hasClass(el, className)) {
234 el.className += ' ' + className;
235 }
236 };
237
238 f.removeClass = function (el, className) {
239 if (el && el.classList) {
240 if (f.hasClass(el, className)) {
241 el.classList.remove(className);
242 }
243 } else {
244 if (el && className) {
245 el.className = el.className.replace(new RegExp('\\b' + className + '\\b', 'g'), '');
246 }
247 }
248 };
249
250
251 f.toggleClass = function (el, className) {
252 if (f.hasClass(el, className)) {
253 f.removeClass(el, className);
254 return false;
255 } else {
256 f.addClass(el, className);
257 return true;
258 }
259 };
260
261 f.toggleClassTo = function (el, className, toBoolean) {
262 if (toBoolean === undefined || toBoolean === null) {
263 return f.toggleClass(el, className);
264 }
265
266 if (!!toBoolean) {
267 var hasClass = f.hasClass(el, className);
268 if (!hasClass) {
269 f.addClass(el, className);
270 }
271 return true;
272 } else {
273 f.removeClass(el, className);
274 return false;
275 }
276 };
277
278 f.toggleModal = function () {
279 var modal = doc.getElementById('nsModal'),
280 modalContent = doc.getElementById('nsModalContent'),
281 measure = modalContent.style.width.match(/[a-zA-Z]+|[0-9]+/g),
282 display = window.getComputedStyle(modal, null).display,
283 btnClose = modal.querySelector('.action-modal-close, .btn-modal-close');
284 modalContent.style.marginLeft = -(parseInt(measure[0]) / 2) + measure[1];
285
286 var closeModalStyle = function (e) {
287 e.preventDefault();
288 modal.style.display = 'none';
289 freedom.removeClass(doc.querySelector('html'), 'ns-modal-enabled');
290 };
291
292 var closeModal = function (e) {
293 if (e.target && e.target.id === 'nsModal') {
294 closeModalStyle(e);
295 }
296
297 if (e.keyCode && e.keyCode === 27) {
298 closeModalStyle(e);
299 }
300 };
301
302 if (display === 'block') {
303 modal.style.display = 'none';
304 freedom.removeClass(doc.querySelector('html'), 'ns-modal-enabled');
305 } else {
306 freedom.addClass(doc.querySelector('html'), 'ns-modal-enabled');
307 modal.style.display = 'block';
308
309 freedom.addEvent('click', btnClose, closeModalStyle);
310 freedom.addEvent('click', doc.querySelector('.ns-modal-enabled'), closeModal);
311 freedom.addEvent('keyup', doc.querySelector('html'), closeModal);
312 }
313 };
314
315 f.toggleDisplay = function (elm, selectorClassName, isTableRow) {
316 var component = document.getElementsByClassName(selectorClassName);
317 var displayElement = elm.style.display;
318 var displayType = isTableRow ? 'table-row' : 'block';
319 if (component && component.length > 0) {
320 var i = component.length;
321 while (i--) {
322 component[i].style.display = 'none';
323 }
324 elm.style.display = (displayElement === 'block' || displayElement === 'table-row') ? 'none' : displayType;
325 }
326 };
327
328 f.insertAfter = function (newNode, referenceNode) {
329 referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
330 };
331
332 f.extend = function (obj, src) {
333 for (var key in src) {
334 if (src.hasOwnProperty(key)) {
335 obj[key] = src[key];
336 }
337 }
338 return obj;
339 };
340
341 f.objectKeys = function (data) {
342 var r = [];
343 if (Object && Object.keys) {
344 r = Object.keys(data).map(function (key) {
345 return encodeURIComponent(key) + '=' + encodeURIComponent(data[key]);
346 });
347 } else {
348 for (var key in data) {
349 if (data.hasOwnProperty(key)) {
350 r.push(encodeURIComponent(key) + '=' + encodeURIComponent(data[key]));
351 }
352 }
353 }
354 return r;
355 };
356
357 f.ajax = {
358 request: function (method, url, data, then, error) {
359 var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
360 xhr.open(method, url);
361 xhr.onreadystatechange = function () {
362 var responseText = (xhr && xhr.responseText && typeof xhr.responseText === 'string') ? xhr.responseText : '{}';
363 try {
364 responseText = JSON.parse(responseText);
365 } catch (e) {
366 responseText = xhr.responseText;
367 }
368 if (xhr.readyState > 3 && xhr.status == 200) {
369 if (then && typeof then === 'function') {
370 then(responseText);
371 }
372 } else if (xhr.readyState > 3 && xhr.status) {
373 if (error && typeof error === 'function') {
374 error(responseText);
375 }
376 }
377 };
378 xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
379 if (method === 'POST' && data) {
380 var params = (typeof data === 'string') ? data : freedom.objectKeys(data).join('&');
381 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
382 xhr.send(params);
383 } else {
384 xhr.send();
385 }
386 return xhr;
387 },
388 post: function (url, data, then, error) {
389 freedom.ajax.request('POST', url, data, then, error);
390 },
391 get: function (url, then, error) {
392 freedom.ajax.request('GET', url, null, then, error);
393 }
394 };
395
396 f.getCookie = function (name) {
397 var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
398 return v ? v[2] : null;
399 };
400
401 f.live = function (selector, event, callback, context) {
402 f.addEvent(event, context || document, function (e) {
403 var found, el = e.target || e.srcElement;
404 while (el && el.matches && el !== context && !(found = el.matches(selector))) el = el.parentElement;
405 if (found) callback.call(el, e);
406 });
407 };
408
409 f.executeFunctionByName = function (name, context /*, args */) {
410 var args = [].slice.call(arguments).splice(2),
411 namespaces = name.split('.'),
412 func = namespaces.pop(),
413 i = 0, max;
414 for (i = 0, max = namespaces.length; i < max; i += 1) {
415 context = context[namespaces[i]];
416 }
417 return context[func].apply(context, args);
418 };
419
420 f.jumpPageToAnchor = function (anchor) {
421 if (anchor && !!document.getElementById(anchor)) {
422 var anchorIndex = location.href.indexOf("#");
423 var hasAnchor = anchorIndex > -1;
424 var locationToJump = '';
425 if (hasAnchor) {
426 locationToJump = location.href.substring(0, anchorIndex);
427 }
428 locationToJump += '#' + anchor;
429 location.href = locationToJump;
430 }
431 };
432
433 f.getParmsFromUrl = function (url) {
434 var parms = {}, pieces, parts, i;
435 var hash = url.lastIndexOf('#');
436 if (hash !== -1) {
437 // isolate just the hash value
438 url = url.slice(hash + 1);
439 }
440 var question = url.indexOf('?');
441 if (question !== -1) {
442 url = url.slice(question + 1);
443 pieces = url.split('&');
444 for (i = 0; i < pieces.length; i++) {
445 parts = pieces[i].split('=');
446 if (parts.length < 2) {
447 parts.push('');
448 }
449 parms[decodeURIComponent(parts[0])] = decodeURIComponent(parts[1]);
450 }
451 }
452 return parms;
453 };
454
455 f.getParamByName = function (name, url) {
456 if (!url) {
457 url = win.location.href;
458 }
459 return f.getParmsFromUrl(url)[name];
460 };
461
462 return f;
463
464}(freedom || {}, window, window.document));
465
466freedom.cookie = (function (win) {
467 'use strict';
468
469 function get(name) {
470 var v = win.document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
471 return v ? v[2] : null;
472 }
473
474 function del(name) {
475 win.document.cookie = name + '=;path=/;expires=' + -1;
476 }
477
478 function set(name, value, days) {
479 var expires = '';
480 if (days) {
481 var date = new Date();
482 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
483 expires = '; expires=' + date.toUTCString();
484 }
485 win.document.cookie = name + '=' + value + expires + '; path=/';
486 }
487
488
489 return {
490 'get': get,
491 'del': del,
492 'set': set
493 };
494
495} (window));
496
497// matches polyfill
498// https://plainjs.com/javascript/traversing/get-closest-element-by-selector-39/
499this.Element && function(ElementPrototype) {
500 ElementPrototype.matches = ElementPrototype.matches ||
501 ElementPrototype.matchesSelector ||
502 ElementPrototype.webkitMatchesSelector ||
503 ElementPrototype.msMatchesSelector ||
504 function(selector) {
505 var node = this, nodes = (node.parentNode || node.document).querySelectorAll(selector), i = -1;
506 while (nodes[++i] && nodes[i] != node);
507 return !!nodes[i];
508 };
509}(Element.prototype);
510
511// closest polyfill
512this.Element && function(ElementPrototype) {
513 ElementPrototype.closest = ElementPrototype.closest ||
514 function(selector) {
515 var el = this;
516 while (el.matches && !el.matches(selector)) el = el.parentNode;
517 return el.matches ? el : null;
518 };
519}(Element.prototype);
520
521if (!String.prototype.trim) {
522 String.prototype.trim = function () {
523 return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
524 };
525}
526
527freedom.polyfill = (function ($, win, doc) {
528 'use strict';
529
530 function consoleLog() {
531 var method,
532 noop = function () {},
533 methods = [
534 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
535 ],
536 length = methods.length,
537 console = (win.console = win.console || {});
538
539 while (length--) {
540 method = methods[length];
541
542 // Only stub undefined methods.
543 if (!console[method]) {
544 console[method] = noop;
545 }
546 }
547 }
548
549 function classList() {
550 if (typeof window.Element === 'undefined' || 'classList' in document.documentElement) return;
551
552 var prototype = Array.prototype,
553 push = prototype.push,
554 splice = prototype.splice,
555 join = prototype.join;
556
557 function DOMTokenList(el) {
558 this.el = el;
559 // The className needs to be trimmed and split on whitespace
560 // to retrieve a list of classes.
561 var classes = el.className.replace(/^\s+|\s+$/g,'').split(/\s+/);
562 for (var i = 0; i < classes.length; i++) {
563 push.call(this, classes[i]);
564 }
565 }
566
567 DOMTokenList.prototype = {
568 add: function(token) {
569 if(this.contains(token)) return;
570 push.call(this, token);
571 this.el.className = this.toString();
572 },
573 contains: function(token) {
574 return this.el.className.indexOf(token) != -1;
575 },
576 item: function(index) {
577 return this[index] || null;
578 },
579 remove: function(token) {
580 if (!this.contains(token)) return;
581 for (var i = 0; i < this.length; i++) {
582 if (this[i] == token) break;
583 }
584 splice.call(this, i, 1);
585 this.el.className = this.toString();
586 },
587 toString: function() {
588 return join.call(this, ' ');
589 },
590 toggle: function(token) {
591 if (!this.contains(token)) {
592 this.add(token);
593 } else {
594 this.remove(token);
595 }
596
597 return this.contains(token);
598 }
599 };
600
601 window.DOMTokenList = DOMTokenList;
602
603 function defineElementGetter (obj, prop, getter) {
604 if (Object.defineProperty) {
605 Object.defineProperty(obj, prop,{
606 get : getter
607 });
608 } else {
609 obj.__defineGetter__(prop, getter);
610 }
611 }
612
613 defineElementGetter(Element.prototype, 'classList', function () {
614 return new DOMTokenList(this);
615 });
616 }
617
618 function trim() {
619 if (!String.prototype.trim) {
620 String.prototype.trim = function () {
621 return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
622 };
623 }
624 }
625
626 function clearCartCookie() {
627 var now = new Date();
628 var time = now.getTime();
629 var minutes = 30;
630
631 time += 60000 * minutes;
632 now.setTime(time);
633 window.document.cookie =
634 'cart=' +
635 ';domain=.zattini.com.br' +
636 '; expires=' + now.toUTCString() +
637 '; path=/';
638 window.document.cookie =
639 'mi=' +
640 ';domain=.zattini.com.br' +
641 '; expires=' + now.toUTCString() +
642 '; path=/';
643 }
644
645 function init() {
646 consoleLog();
647 classList();
648 trim();
649 clearCartCookie();
650 }
651
652 return {
653 'init': init
654 };
655
656}(undefined, window, window.document)).init();
657
658freedom.featuretoggle = (function () {
659 'use strict';
660
661 function isEnabled(feature) {
662 freedom.restClient.request('/featuretoggle/' + feature, {
663 method: 'get',
664 success: function (response) {
665 return response.feature;
666 }
667 });
668 }
669
670 function isEnabledFeatureList(features, callback) {
671 freedom.restClient.request('/featuretoggle/toggleList', {
672 method: 'post',
673 data: {
674 features: features
675 },
676 success: function (response) {
677 if (typeof callback === 'function') {
678 callback(response.features);
679 }
680 }
681 });
682 }
683
684 return {
685 'isEnabled': isEnabled,
686 'isEnabledFeatureList': isEnabledFeatureList
687 };
688
689}());
690
691
692// json2.js
693// 2016-05-01
694// Public Domain.
695// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
696// See http://www.JSON.org/js.html
697// This code should be minified before deployment.
698// See http://javascript.crockford.com/jsmin.html
699
700// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
701// NOT CONTROL.
702
703// This file creates a global JSON object containing two methods: stringify
704// and parse. This file is provides the ES5 JSON capability to ES3 systems.
705// If a project might run on IE8 or earlier, then this file should be included.
706// This file does nothing on ES5 systems.
707
708// JSON.stringify(value, replacer, space)
709// value any JavaScript value, usually an object or array.
710// replacer an optional parameter that determines how object
711// values are stringified for objects. It can be a
712// function or an array of strings.
713// space an optional parameter that specifies the indentation
714// of nested structures. If it is omitted, the text will
715// be packed without extra whitespace. If it is a number,
716// it will specify the number of spaces to indent at each
717// level. If it is a string (such as "\t" or " "),
718// it contains the characters used to indent at each level.
719// This method produces a JSON text from a JavaScript value.
720// When an object value is found, if the object contains a toJSON
721// method, its toJSON method will be called and the result will be
722// stringified. A toJSON method does not serialize: it returns the
723// value represented by the name/value pair that should be serialized,
724// or undefined if nothing should be serialized. The toJSON method
725// will be passed the key associated with the value, and this will be
726// bound to the value.
727
728// For example, this would serialize Dates as ISO strings.
729
730// Date.prototype.toJSON = function (key) {
731// function f(n) {
732// // Format integers to have at least two digits.
733// return (n < 10)
734// ? "0" + n
735// : n;
736// }
737// return this.getUTCFullYear() + "-" +
738// f(this.getUTCMonth() + 1) + "-" +
739// f(this.getUTCDate()) + "T" +
740// f(this.getUTCHours()) + ":" +
741// f(this.getUTCMinutes()) + ":" +
742// f(this.getUTCSeconds()) + "Z";
743// };
744
745// You can provide an optional replacer method. It will be passed the
746// key and value of each member, with this bound to the containing
747// object. The value that is returned from your method will be
748// serialized. If your method returns undefined, then the member will
749// be excluded from the serialization.
750
751// If the replacer parameter is an array of strings, then it will be
752// used to select the members to be serialized. It filters the results
753// such that only members with keys listed in the replacer array are
754// stringified.
755
756// Values that do not have JSON representations, such as undefined or
757// functions, will not be serialized. Such values in objects will be
758// dropped; in arrays they will be replaced with null. You can use
759// a replacer function to replace those with JSON values.
760
761// JSON.stringify(undefined) returns undefined.
762
763// The optional space parameter produces a stringification of the
764// value that is filled with line breaks and indentation to make it
765// easier to read.
766
767// If the space parameter is a non-empty string, then that string will
768// be used for indentation. If the space parameter is a number, then
769// the indentation will be that many spaces.
770
771// Example:
772
773// text = JSON.stringify(["e", {pluribus: "unum"}]);
774// // text is '["e",{"pluribus":"unum"}]'
775
776// text = JSON.stringify(["e", {pluribus: "unum"}], null, "\t");
777// // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
778
779// text = JSON.stringify([new Date()], function (key, value) {
780// return this[key] instanceof Date
781// ? "Date(" + this[key] + ")"
782// : value;
783// });
784// // text is '["Date(---current time---)"]'
785
786// JSON.parse(text, reviver)
787// This method parses a JSON text to produce an object or array.
788// It can throw a SyntaxError exception.
789
790// The optional reviver parameter is a function that can filter and
791// transform the results. It receives each of the keys and values,
792// and its return value is used instead of the original value.
793// If it returns what it received, then the structure is not modified.
794// If it returns undefined then the member is deleted.
795
796// Example:
797
798// // Parse the text. Values that look like ISO date strings will
799// // be converted to Date objects.
800
801// myData = JSON.parse(text, function (key, value) {
802// var a;
803// if (typeof value === "string") {
804// a =
805// /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
806// if (a) {
807// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
808// +a[5], +a[6]));
809// }
810// }
811// return value;
812// });
813
814// myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
815// var d;
816// if (typeof value === "string" &&
817// value.slice(0, 5) === "Date(" &&
818// value.slice(-1) === ")") {
819// d = new Date(value.slice(5, -1));
820// if (d) {
821// return d;
822// }
823// }
824// return value;
825// });
826
827// This is a reference implementation. You are free to copy, modify, or
828// redistribute.
829
830/*jslint
831 eval, for, this
832*/
833
834/*property
835 JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
836 getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
837 lastIndex, length, parse, prototype, push, replace, slice, stringify,
838 test, toJSON, toString, valueOf
839*/
840
841
842// Create a JSON object only if one does not already exist. We create the
843// methods in a closure to avoid creating global variables.
844
845if (typeof JSON !== "object") {
846 JSON = {};
847}
848
849(function () {
850 "use strict";
851
852 var rx_one = /^[\],:{}\s]*$/;
853 var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
854 var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
855 var rx_four = /(?:^|:|,)(?:\s*\[)+/g;
856 var rx_escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
857 var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
858
859 function f(n) {
860 // Format integers to have at least two digits.
861 return n < 10
862 ? "0" + n
863 : n;
864 }
865
866 function this_value() {
867 return this.valueOf();
868 }
869
870 if (typeof Date.prototype.toJSON !== "function") {
871
872 Date.prototype.toJSON = function () {
873
874 return isFinite(this.valueOf())
875 ? this.getUTCFullYear() + "-" +
876 f(this.getUTCMonth() + 1) + "-" +
877 f(this.getUTCDate()) + "T" +
878 f(this.getUTCHours()) + ":" +
879 f(this.getUTCMinutes()) + ":" +
880 f(this.getUTCSeconds()) + "Z"
881 : null;
882 };
883
884 Boolean.prototype.toJSON = this_value;
885 Number.prototype.toJSON = this_value;
886 String.prototype.toJSON = this_value;
887 }
888
889 var gap;
890 var indent;
891 var meta;
892 var rep;
893
894
895 function quote(string) {
896
897// If the string contains no control characters, no quote characters, and no
898// backslash characters, then we can safely slap some quotes around it.
899// Otherwise we must also replace the offending characters with safe escape
900// sequences.
901
902 rx_escapable.lastIndex = 0;
903 return rx_escapable.test(string)
904 ? "\"" + string.replace(rx_escapable, function (a) {
905 var c = meta[a];
906 return typeof c === "string"
907 ? c
908 : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
909 }) + "\""
910 : "\"" + string + "\"";
911 }
912
913
914 function str(key, holder) {
915
916// Produce a string from holder[key].
917
918 var i; // The loop counter.
919 var k; // The member key.
920 var v; // The member value.
921 var length;
922 var mind = gap;
923 var partial;
924 var value = holder[key];
925
926// If the value has a toJSON method, call it to obtain a replacement value.
927
928 if (value && typeof value === "object" &&
929 typeof value.toJSON === "function") {
930 value = value.toJSON(key);
931 }
932
933// If we were called with a replacer function, then call the replacer to
934// obtain a replacement value.
935
936 if (typeof rep === "function") {
937 value = rep.call(holder, key, value);
938 }
939
940// What happens next depends on the value's type.
941
942 switch (typeof value) {
943 case "string":
944 return quote(value);
945
946 case "number":
947
948// JSON numbers must be finite. Encode non-finite numbers as null.
949
950 return isFinite(value)
951 ? String(value)
952 : "null";
953
954 case "boolean":
955 case "null":
956
957// If the value is a boolean or null, convert it to a string. Note:
958// typeof null does not produce "null". The case is included here in
959// the remote chance that this gets fixed someday.
960
961 return String(value);
962
963// If the type is "object", we might be dealing with an object or an array or
964// null.
965
966 case "object":
967
968// Due to a specification blunder in ECMAScript, typeof null is "object",
969// so watch out for that case.
970
971 if (!value) {
972 return "null";
973 }
974
975// Make an array to hold the partial results of stringifying this object value.
976
977 gap += indent;
978 partial = [];
979
980// Is the value an array?
981
982 if (Object.prototype.toString.apply(value) === "[object Array]") {
983
984// The value is an array. Stringify every element. Use null as a placeholder
985// for non-JSON values.
986
987 length = value.length;
988 for (i = 0; i < length; i += 1) {
989 partial[i] = str(i, value) || "null";
990 }
991
992// Join all of the elements together, separated with commas, and wrap them in
993// brackets.
994
995 v = partial.length === 0
996 ? "[]"
997 : gap
998 ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]"
999 : "[" + partial.join(",") + "]";
1000 gap = mind;
1001 return v;
1002 }
1003
1004// If the replacer is an array, use it to select the members to be stringified.
1005
1006 if (rep && typeof rep === "object") {
1007 length = rep.length;
1008 for (i = 0; i < length; i += 1) {
1009 if (typeof rep[i] === "string") {
1010 k = rep[i];
1011 v = str(k, value);
1012 if (v) {
1013 partial.push(quote(k) + (
1014 gap
1015 ? ": "
1016 : ":"
1017 ) + v);
1018 }
1019 }
1020 }
1021 } else {
1022
1023// Otherwise, iterate through all of the keys in the object.
1024
1025 for (k in value) {
1026 if (Object.prototype.hasOwnProperty.call(value, k)) {
1027 v = str(k, value);
1028 if (v) {
1029 partial.push(quote(k) + (
1030 gap
1031 ? ": "
1032 : ":"
1033 ) + v);
1034 }
1035 }
1036 }
1037 }
1038
1039// Join all of the member texts together, separated with commas,
1040// and wrap them in braces.
1041
1042 v = partial.length === 0
1043 ? "{}"
1044 : gap
1045 ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}"
1046 : "{" + partial.join(",") + "}";
1047 gap = mind;
1048 return v;
1049 }
1050 }
1051
1052// If the JSON object does not yet have a stringify method, give it one.
1053
1054 if (typeof JSON.stringify !== "function") {
1055 meta = { // table of character substitutions
1056 "\b": "\\b",
1057 "\t": "\\t",
1058 "\n": "\\n",
1059 "\f": "\\f",
1060 "\r": "\\r",
1061 "\"": "\\\"",
1062 "\\": "\\\\"
1063 };
1064 JSON.stringify = function (value, replacer, space) {
1065
1066// The stringify method takes a value and an optional replacer, and an optional
1067// space parameter, and returns a JSON text. The replacer can be a function
1068// that can replace values, or an array of strings that will select the keys.
1069// A default replacer method can be provided. Use of the space parameter can
1070// produce text that is more easily readable.
1071
1072 var i;
1073 gap = "";
1074 indent = "";
1075
1076// If the space parameter is a number, make an indent string containing that
1077// many spaces.
1078
1079 if (typeof space === "number") {
1080 for (i = 0; i < space; i += 1) {
1081 indent += " ";
1082 }
1083
1084// If the space parameter is a string, it will be used as the indent string.
1085
1086 } else if (typeof space === "string") {
1087 indent = space;
1088 }
1089
1090// If there is a replacer, it must be a function or an array.
1091// Otherwise, throw an error.
1092
1093 rep = replacer;
1094 if (replacer && typeof replacer !== "function" &&
1095 (typeof replacer !== "object" ||
1096 typeof replacer.length !== "number")) {
1097 throw new Error("JSON.stringify");
1098 }
1099
1100// Make a fake root object containing our value under the key of "".
1101// Return the result of stringifying the value.
1102
1103 return str("", {"": value});
1104 };
1105 }
1106
1107
1108// If the JSON object does not yet have a parse method, give it one.
1109
1110 if (typeof JSON.parse !== "function") {
1111 JSON.parse = function (text, reviver) {
1112
1113// The parse method takes a text and an optional reviver function, and returns
1114// a JavaScript value if the text is a valid JSON text.
1115
1116 var j;
1117
1118 function walk(holder, key) {
1119
1120// The walk method is used to recursively walk the resulting structure so
1121// that modifications can be made.
1122
1123 var k;
1124 var v;
1125 var value = holder[key];
1126 if (value && typeof value === "object") {
1127 for (k in value) {
1128 if (Object.prototype.hasOwnProperty.call(value, k)) {
1129 v = walk(value, k);
1130 if (v !== undefined) {
1131 value[k] = v;
1132 } else {
1133 delete value[k];
1134 }
1135 }
1136 }
1137 }
1138 return reviver.call(holder, key, value);
1139 }
1140
1141
1142// Parsing happens in four stages. In the first stage, we replace certain
1143// Unicode characters with escape sequences. JavaScript handles many characters
1144// incorrectly, either silently deleting them, or treating them as line endings.
1145
1146 text = String(text);
1147 rx_dangerous.lastIndex = 0;
1148 if (rx_dangerous.test(text)) {
1149 text = text.replace(rx_dangerous, function (a) {
1150 return "\\u" +
1151 ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
1152 });
1153 }
1154
1155// In the second stage, we run the text against regular expressions that look
1156// for non-JSON patterns. We are especially concerned with "()" and "new"
1157// because they can cause invocation, and "=" because it can cause mutation.
1158// But just to be safe, we want to reject all unexpected forms.
1159
1160// We split the second stage into 4 regexp operations in order to work around
1161// crippling inefficiencies in IE's and Safari's regexp engines. First we
1162// replace the JSON backslash pairs with "@" (a non-JSON character). Second, we
1163// replace all simple value tokens with "]" characters. Third, we delete all
1164// open brackets that follow a colon or comma or that begin the text. Finally,
1165// we look to see that the remaining characters are only whitespace or "]" or
1166// "," or ":" or "{" or "}". If that is so, then the text is safe for eval.
1167
1168 if (
1169 rx_one.test(
1170 text
1171 .replace(rx_two, "@")
1172 .replace(rx_three, "]")
1173 .replace(rx_four, "")
1174 )
1175 ) {
1176
1177// In the third stage we use the eval function to compile the text into a
1178// JavaScript structure. The "{" operator is subject to a syntactic ambiguity
1179// in JavaScript: it can begin a block or an object literal. We wrap the text
1180// in parens to eliminate the ambiguity.
1181
1182 j = eval("(" + text + ")");
1183
1184// In the optional fourth stage, we recursively walk the new structure, passing
1185// each name/value pair to a reviver function for possible transformation.
1186
1187 return (typeof reviver === "function")
1188 ? walk({"": j}, "")
1189 : j;
1190 }
1191
1192// If the text is not JSON parseable, then a SyntaxError is thrown.
1193
1194 throw new SyntaxError("JSON.parse");
1195 };
1196 }
1197}());
1198
1199/*!
1200 * modernizr v3.3.1
1201 * Build https://modernizr.com/download?-placeholder-addtest-hasevent-setclasses-shiv-dontmin
1202 *
1203 * Copyright (c)
1204 * Faruk Ates
1205 * Paul Irish
1206 * Alex Sexton
1207 * Ryan Seddon
1208 * Patrick Kettner
1209 * Stu Cox
1210 * Richard Herrera
1211
1212 * MIT License
1213 */
1214
1215/*
1216 * Modernizr tests which native CSS3 and HTML5 features are available in the
1217 * current UA and makes the results available to you in two ways: as properties on
1218 * a global `Modernizr` object, and as classes on the `
1219 <html>` element. This
1220 * information allows you to progressively enhance your pages with a granular level
1221 * of control over the experience.
1222*/
1223
1224;(function(window, document, undefined){
1225 var classes = [];
1226
1227
1228 var tests = [];
1229
1230
1231 /**
1232 *
1233 * ModernizrProto is the constructor for Modernizr
1234 *
1235 * @class
1236 * @access public
1237 */
1238
1239 var ModernizrProto = {
1240 // The current version, dummy
1241 _version: '3.3.1',
1242
1243 // Any settings that don't work as separate modules
1244 // can go in here as configuration.
1245 _config: {
1246 'classPrefix': '',
1247 'enableClasses': true,
1248 'enableJSClass': true,
1249 'usePrefixes': true
1250 },
1251
1252 // Queue of tests
1253 _q: [],
1254
1255 // Stub these for people who are listening
1256 on: function(test, cb) {
1257 // I don't really think people should do this, but we can
1258 // safe guard it a bit.
1259 // -- NOTE:: this gets WAY overridden in src/addTest for actual async tests.
1260 // This is in case people listen to synchronous tests. I would leave it out,
1261 // but the code to *disallow* sync tests in the real version of this
1262 // function is actually larger than this.
1263 var self = this;
1264 setTimeout(function() {
1265 cb(self[test]);
1266 }, 0);
1267 },
1268
1269 addTest: function(name, fn, options) {
1270 tests.push({name: name, fn: fn, options: options});
1271 },
1272
1273 addAsyncTest: function(fn) {
1274 tests.push({name: null, fn: fn});
1275 }
1276 };
1277
1278
1279
1280 // Fake some of Object.create so we can force non test results to be non "own" properties.
1281 var Modernizr = function() {};
1282 Modernizr.prototype = ModernizrProto;
1283
1284 // Leak modernizr globally when you `require` it rather than force it here.
1285 // Overwrite name so constructor name is nicer :D
1286 Modernizr = new Modernizr();
1287
1288
1289
1290 /**
1291 * is returns a boolean if the typeof an obj is exactly type.
1292 *
1293 * @access private
1294 * @function is
1295 * @param {*} obj - A thing we want to check the type of
1296 * @param {string} type - A string to compare the typeof against
1297 * @returns {boolean}
1298 */
1299
1300 function is(obj, type) {
1301 return typeof obj === type;
1302 }
1303 ;
1304
1305 /**
1306 * Run through all tests and detect their support in the current UA.
1307 *
1308 * @access private
1309 */
1310
1311 function testRunner() {
1312 var featureNames;
1313 var feature;
1314 var aliasIdx;
1315 var result;
1316 var nameIdx;
1317 var featureName;
1318 var featureNameSplit;
1319
1320 for (var featureIdx in tests) {
1321 if (tests.hasOwnProperty(featureIdx)) {
1322 featureNames = [];
1323 feature = tests[featureIdx];
1324 // run the test, throw the return value into the Modernizr,
1325 // then based on that boolean, define an appropriate className
1326 // and push it into an array of classes we'll join later.
1327 //
1328 // If there is no name, it's an 'async' test that is run,
1329 // but not directly added to the object. That should
1330 // be done with a post-run addTest call.
1331 if (feature.name) {
1332 featureNames.push(feature.name.toLowerCase());
1333
1334 if (feature.options && feature.options.aliases && feature.options.aliases.length) {
1335 // Add all the aliases into the names list
1336 for (aliasIdx = 0; aliasIdx < feature.options.aliases.length; aliasIdx++) {
1337 featureNames.push(feature.options.aliases[aliasIdx].toLowerCase());
1338 }
1339 }
1340 }
1341
1342 // Run the test, or use the raw value if it's not a function
1343 result = is(feature.fn, 'function') ? feature.fn() : feature.fn;
1344
1345
1346 // Set each of the names on the Modernizr object
1347 for (nameIdx = 0; nameIdx < featureNames.length; nameIdx++) {
1348 featureName = featureNames[nameIdx];
1349 // Support dot properties as sub tests. We don't do checking to make sure
1350 // that the implied parent tests have been added. You must call them in
1351 // order (either in the test, or make the parent test a dependency).
1352 //
1353 // Cap it to TWO to make the logic simple and because who needs that kind of subtesting
1354 // hashtag famous last words
1355 featureNameSplit = featureName.split('.');
1356
1357 if (featureNameSplit.length === 1) {
1358 Modernizr[featureNameSplit[0]] = result;
1359 } else {
1360 // cast to a Boolean, if not one already
1361 /* jshint -W053 */
1362 if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
1363 Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
1364 }
1365
1366 Modernizr[featureNameSplit[0]][featureNameSplit[1]] = result;
1367 }
1368
1369 classes.push((result ? '' : 'no-') + featureNameSplit.join('-'));
1370 }
1371 }
1372 }
1373 }
1374 ;
1375
1376 /**
1377 * docElement is a convenience wrapper to grab the root element of the document
1378 *
1379 * @access private
1380 * @returns {HTMLElement|SVGElement} The root element of the document
1381 */
1382
1383 var docElement = document.documentElement;
1384
1385
1386 /**
1387 * A convenience helper to check if the document we are running in is an SVG document
1388 *
1389 * @access private
1390 * @returns {boolean}
1391 */
1392
1393 var isSVG = docElement.nodeName.toLowerCase() === 'svg';
1394
1395
1396 /**
1397 * setClasses takes an array of class names and adds them to the root element
1398 *
1399 * @access private
1400 * @function setClasses
1401 * @param {string[]} classes - Array of class names
1402 */
1403
1404 // Pass in an and array of class names, e.g.:
1405 // ['no-webp', 'borderradius', ...]
1406 function setClasses(classes) {
1407 var className = docElement.className;
1408 var classPrefix = Modernizr._config.classPrefix || '';
1409
1410 if (isSVG) {
1411 className = className.baseVal;
1412 }
1413
1414 // Change `no-js` to `js` (independently of the `enableClasses` option)
1415 // Handle classPrefix on this too
1416 if (Modernizr._config.enableJSClass) {
1417 var reJS = new RegExp('(^|\\s)' + classPrefix + 'no-js(\\s|$)');
1418 className = className.replace(reJS, '$1' + classPrefix + 'js$2');
1419 }
1420
1421 if (Modernizr._config.enableClasses) {
1422 // Add the new classes
1423 className += ' ' + classPrefix + classes.join(' ' + classPrefix);
1424 isSVG ? docElement.className.baseVal = className : docElement.className = className;
1425 }
1426
1427 }
1428
1429 ;
1430
1431/**
1432 * @optionName html5shiv
1433 * @optionProp html5shiv
1434 */
1435
1436 // Take the html5 variable out of the html5shiv scope so we can return it.
1437 var html5;
1438 if (!isSVG) {
1439 /**
1440 * @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
1441 */
1442 ;(function(window, document) {
1443 /*jshint evil:true */
1444 /** version */
1445 var version = '3.7.3';
1446
1447 /** Preset options */
1448 var options = window.html5 || {};
1449
1450 /** Used to skip problem elements */
1451 var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
1452
1453 /** Not all elements can be cloned in IE **/
1454 var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
1455
1456 /** Detect whether the browser supports default html5 styles */
1457 var supportsHtml5Styles;
1458
1459 /** Name of the expando, to work with multiple documents or to re-shiv one document */
1460 var expando = '_html5shiv';
1461
1462 /** The id for the the documents expando */
1463 var expanID = 0;
1464
1465 /** Cached data for each document */
1466 var expandoData = {};
1467
1468 /** Detect whether the browser supports unknown elements */
1469 var supportsUnknownElements;
1470
1471 (function() {
1472 try {
1473 var a = document.createElement('a');
1474 a.innerHTML = '
1475 <xyz></xyz>';
1476 //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
1477 supportsHtml5Styles = ('hidden' in a);
1478
1479 supportsUnknownElements = a.childNodes.length == 1 || (function() {
1480 // assign a false positive if unable to shiv
1481 (document.createElement)('a');
1482 var frag = document.createDocumentFragment();
1483 return (
1484 typeof frag.cloneNode == 'undefined' ||
1485 typeof frag.createDocumentFragment == 'undefined' ||
1486 typeof frag.createElement == 'undefined'
1487 );
1488 }());
1489 } catch(e) {
1490 // assign a false positive if detection fails => unable to shiv
1491 supportsHtml5Styles = true;
1492 supportsUnknownElements = true;
1493 }
1494
1495 }());
1496
1497 /*--------------------------------------------------------------------------*/
1498
1499 /**
1500 * Creates a style sheet with the given CSS text and adds it to the document.
1501 * @private
1502 * @param {Document} ownerDocument The document.
1503 * @param {String} cssText The CSS text.
1504 * @returns {StyleSheet} The style element.
1505 */
1506 function addStyleSheet(ownerDocument, cssText) {
1507 var p = ownerDocument.createElement('p'),
1508 parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
1509
1510 p.innerHTML = 'x
1511 <style>' + cssText + '</style>';
1512 return parent.insertBefore(p.lastChild, parent.firstChild);
1513 }
1514
1515 /**
1516 * Returns the value of `html5.elements` as an array.
1517 * @private
1518 * @returns {Array} An array of shived element node names.
1519 */
1520 function getElements() {
1521 var elements = html5.elements;
1522 return typeof elements == 'string' ? elements.split(' ') : elements;
1523 }
1524
1525 /**
1526 * Extends the built-in list of html5 elements
1527 * @memberOf html5
1528 * @param {String|Array} newElements whitespace separated list or array of new element names to shiv
1529 * @param {Document} ownerDocument The context document.
1530 */
1531 function addElements(newElements, ownerDocument) {
1532 var elements = html5.elements;
1533 if(typeof elements != 'string'){
1534 elements = elements.join(' ');
1535 }
1536 if(typeof newElements != 'string'){
1537 newElements = newElements.join(' ');
1538 }
1539 html5.elements = elements +' '+ newElements;
1540 shivDocument(ownerDocument);
1541 }
1542
1543 /**
1544 * Returns the data associated to the given document
1545 * @private
1546 * @param {Document} ownerDocument The document.
1547 * @returns {Object} An object of data.
1548 */
1549 function getExpandoData(ownerDocument) {
1550 var data = expandoData[ownerDocument[expando]];
1551 if (!data) {
1552 data = {};
1553 expanID++;
1554 ownerDocument[expando] = expanID;
1555 expandoData[expanID] = data;
1556 }
1557 return data;
1558 }
1559
1560 /**
1561 * returns a shived element for the given nodeName and document
1562 * @memberOf html5
1563 * @param {String} nodeName name of the element
1564 * @param {Document|DocumentFragment} ownerDocument The context document.
1565 * @returns {Object} The shived element.
1566 */
1567 function createElement(nodeName, ownerDocument, data){
1568 if (!ownerDocument) {
1569 ownerDocument = document;
1570 }
1571 if(supportsUnknownElements){
1572 return ownerDocument.createElement(nodeName);
1573 }
1574 if (!data) {
1575 data = getExpandoData(ownerDocument);
1576 }
1577 var node;
1578
1579 if (data.cache[nodeName]) {
1580 node = data.cache[nodeName].cloneNode();
1581 } else if (saveClones.test(nodeName)) {
1582 node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
1583 } else {
1584 node = data.createElem(nodeName);
1585 }
1586
1587 // Avoid adding some elements to fragments in IE< 9 because
1588 // * Attributes like `name` or `type` cannot be set/changed once an element
1589 // is inserted into a document/fragment
1590 // * Link elements with `src` attributes that are inaccessible, as with
1591 // a 403 response, will cause the tab/window to crash
1592 // * Script elements appended to fragments will execute when their `src`
1593 // or `text` property is set
1594 return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
1595 }
1596
1597 /**
1598 * returns a shived DocumentFragment for the given document
1599 * @memberOf html5
1600 * @param {Document} ownerDocument The context document.
1601 * @returns {Object} The shived DocumentFragment.
1602 */
1603 function createDocumentFragment(ownerDocument, data){
1604 if (!ownerDocument) {
1605 ownerDocument = document;
1606 }
1607 if(supportsUnknownElements){
1608 return ownerDocument.createDocumentFragment();
1609 }
1610 data = data || getExpandoData(ownerDocument);
1611 var clone = data.frag.cloneNode(),
1612 i = 0,
1613 elems = getElements(),
1614 l = elems.length;
1615 for(;i
1616 <l;i++){
1617 clone.createElement(elems[i]);
1618 }
1619 return clone;
1620 }
1621
1622 /**
1623 * Shivs the `createElement` and `createDocumentFragment` methods of the document.
1624 * @private
1625 * @param {Document|DocumentFragment} ownerDocument The document.
1626 * @param {Object} data of the document.
1627 */
1628 function shivMethods(ownerDocument, data) {
1629 if (!data.cache) {
1630 data.cache = {};
1631 data.createElem = ownerDocument.createElement;
1632 data.createFrag = ownerDocument.createDocumentFragment;
1633 data.frag = data.createFrag();
1634 }
1635
1636
1637 ownerDocument.createElement = function(nodeName) {
1638 //abort shiv
1639 if (!html5.shivMethods) {
1640 return data.createElem(nodeName);
1641 }
1642 return createElement(nodeName, ownerDocument, data);
1643 };
1644
1645 ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
1646 'var n=f.cloneNode(),c=n.createElement;' +
1647 'h.shivMethods&&(' +
1648 // unroll the `createElement` calls
1649 getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
1650 data.createElem(nodeName);
1651 data.frag.createElement(nodeName);
1652 return 'c("' + nodeName + '")';
1653 }) +
1654 ');return n}'
1655 )(html5, data.frag);
1656 }
1657
1658 /*--------------------------------------------------------------------------*/
1659
1660 /**
1661 * Shivs the given document.
1662 * @memberOf html5
1663 * @param {Document} ownerDocument The document to shiv.
1664 * @returns {Document} The shived document.
1665 */
1666 function shivDocument(ownerDocument) {
1667 if (!ownerDocument) {
1668 ownerDocument = document;
1669 }
1670 var data = getExpandoData(ownerDocument);
1671
1672 if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
1673 data.hasCSS = !!addStyleSheet(ownerDocument,
1674 // corrects block display not defined in IE6/7/8/9
1675 'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
1676 // adds styling not present in IE6/7/8/9
1677 'mark{background:#FF0;color:#000}' +
1678 // hides non-rendered elements
1679 'template{display:none}'
1680 );
1681 }
1682 if (!supportsUnknownElements) {
1683 shivMethods(ownerDocument, data);
1684 }
1685 return ownerDocument;
1686 }
1687
1688 /*--------------------------------------------------------------------------*/
1689
1690 /**
1691 * The `html5` object is exposed so that more elements can be shived and
1692 * existing shiving can be detected on iframes.
1693 * @type Object
1694 * @example
1695 *
1696 * // options can be changed before the script is included
1697 * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
1698 */
1699 var html5 = {
1700
1701 /**
1702 * An array or space separated string of node names of the elements to shiv.
1703 * @memberOf html5
1704 * @type Array|String
1705 */
1706 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
1707
1708 /**
1709 * current version of html5shiv
1710 */
1711 'version': version,
1712
1713 /**
1714 * A flag to indicate that the HTML5 style sheet should be inserted.
1715 * @memberOf html5
1716 * @type Boolean
1717 */
1718 'shivCSS': (options.shivCSS !== false),
1719
1720 /**
1721 * Is equal to true if a browser supports creating unknown/HTML5 elements
1722 * @memberOf html5
1723 * @type boolean
1724 */
1725 'supportsUnknownElements': supportsUnknownElements,
1726
1727 /**
1728 * A flag to indicate that the document's `createElement` and `createDocumentFragment`
1729 * methods should be overwritten.
1730 * @memberOf html5
1731 * @type Boolean
1732 */
1733 'shivMethods': (options.shivMethods !== false),
1734
1735 /**
1736 * A string to describe the type of `html5` object ("default" or "default print").
1737 * @memberOf html5
1738 * @type String
1739 */
1740 'type': 'default',
1741
1742 // shivs the document according to the specified `html5` object options
1743 'shivDocument': shivDocument,
1744
1745 //creates a shived element
1746 createElement: createElement,
1747
1748 //creates a shived documentFragment
1749 createDocumentFragment: createDocumentFragment,
1750
1751 //extends list of elements
1752 addElements: addElements
1753 };
1754
1755 /*--------------------------------------------------------------------------*/
1756
1757 // expose html5
1758 window.html5 = html5;
1759
1760 // shiv the document
1761 shivDocument(document);
1762
1763 if(typeof module == 'object' && module.exports){
1764 module.exports = html5;
1765 }
1766
1767 }(typeof window !== "undefined" ? window : this, document));
1768 }
1769;
1770
1771 /**
1772 * hasOwnProp is a shim for hasOwnProperty that is needed for Safari 2.0 support
1773 *
1774 * @author kangax
1775 * @access private
1776 * @function hasOwnProp
1777 * @param {object} object - The object to check for a property
1778 * @param {string} property - The property to check for
1779 * @returns {boolean}
1780 */
1781
1782 // hasOwnProperty shim by kangax needed for Safari 2.0 support
1783 var hasOwnProp;
1784
1785 (function() {
1786 var _hasOwnProperty = ({}).hasOwnProperty;
1787 /* istanbul ignore else */
1788 /* we have no way of testing IE 5.5 or safari 2,
1789 * so just assume the else gets hit */
1790 if (!is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined')) {
1791 hasOwnProp = function(object, property) {
1792 return _hasOwnProperty.call(object, property);
1793 };
1794 }
1795 else {
1796 hasOwnProp = function(object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */
1797 return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
1798 };
1799 }
1800 })();
1801
1802
1803
1804
1805 // _l tracks listeners for async tests, as well as tests that execute after the initial run
1806 ModernizrProto._l = {};
1807
1808 /**
1809 * Modernizr.on is a way to listen for the completion of async tests. Being
1810 * asynchronous, they may not finish before your scripts run. As a result you
1811 * will get a possibly false negative `undefined` value.
1812 *
1813 * @memberof Modernizr
1814 * @name Modernizr.on
1815 * @access public
1816 * @function on
1817 * @param {string} feature - String name of the feature detect
1818 * @param {function} cb - Callback function returning a Boolean - true if feature is supported, false if not
1819 * @example
1820 *
1821 * ```js
1822 * Modernizr.on('flash', function( result ) {
1823 * if (result) {
1824 * // the browser has flash
1825 * } else {
1826 * // the browser does not have flash
1827 * }
1828 * });
1829 * ```
1830 */
1831
1832 ModernizrProto.on = function(feature, cb) {
1833 // Create the list of listeners if it doesn't exist
1834 if (!this._l[feature]) {
1835 this._l[feature] = [];
1836 }
1837
1838 // Push this test on to the listener list
1839 this._l[feature].push(cb);
1840
1841 // If it's already been resolved, trigger it on next tick
1842 if (Modernizr.hasOwnProperty(feature)) {
1843 // Next Tick
1844 setTimeout(function() {
1845 Modernizr._trigger(feature, Modernizr[feature]);
1846 }, 0);
1847 }
1848 };
1849
1850 /**
1851 * _trigger is the private function used to signal test completion and run any
1852 * callbacks registered through [Modernizr.on](#modernizr-on)
1853 *
1854 * @memberof Modernizr
1855 * @name Modernizr._trigger
1856 * @access private
1857 * @function _trigger
1858 * @param {string} feature - string name of the feature detect
1859 * @param {function|boolean} [res] - A feature detection function, or the boolean =
1860 * result of a feature detection function
1861 */
1862
1863 ModernizrProto._trigger = function(feature, res) {
1864 if (!this._l[feature]) {
1865 return;
1866 }
1867
1868 var cbs = this._l[feature];
1869
1870 // Force async
1871 setTimeout(function() {
1872 var i, cb;
1873 for (i = 0; i < cbs.length; i++) {
1874 cb = cbs[i];
1875 cb(res);
1876 }
1877 }, 0);
1878
1879 // Don't trigger these again
1880 delete this._l[feature];
1881 };
1882
1883 /**
1884 * addTest allows you to define your own feature detects that are not currently
1885 * included in Modernizr (under the covers it's the exact same code Modernizr
1886 * uses for its own [feature detections](https://github.com/Modernizr/Modernizr/tree/master/feature-detects)). Just like the offical detects, the result
1887 * will be added onto the Modernizr object, as well as an appropriate className set on
1888 * the html element when configured to do so
1889 *
1890 * @memberof Modernizr
1891 * @name Modernizr.addTest
1892 * @optionName Modernizr.addTest()
1893 * @optionProp addTest
1894 * @access public
1895 * @function addTest
1896 * @param {string|object} feature - The string name of the feature detect, or an
1897 * object of feature detect names and test
1898 * @param {function|boolean} test - Function returning true if feature is supported,
1899 * false if not. Otherwise a boolean representing the results of a feature detection
1900 * @example
1901 *
1902 * The most common way of creating your own feature detects is by calling
1903 * `Modernizr.addTest` with a string (preferably just lowercase, without any
1904 * punctuation), and a function you want executed that will return a boolean result
1905 *
1906 * ```js
1907 * Modernizr.addTest('itsTuesday', function() {
1908 * var d = new Date();
1909 * return d.getDay() === 2;
1910 * });
1911 * ```
1912 *
1913 * When the above is run, it will set Modernizr.itstuesday to `true` when it is tuesday,
1914 * and to `false` every other day of the week. One thing to notice is that the names of
1915 * feature detect functions are always lowercased when added to the Modernizr object. That
1916 * means that `Modernizr.itsTuesday` will not exist, but `Modernizr.itstuesday` will.
1917 *
1918 *
1919 * Since we only look at the returned value from any feature detection function,
1920 * you do not need to actually use a function. For simple detections, just passing
1921 * in a statement that will return a boolean value works just fine.
1922 *
1923 * ```js
1924 * Modernizr.addTest('hasJquery', 'jQuery' in window);
1925 * ```
1926 *
1927 * Just like before, when the above runs `Modernizr.hasjquery` will be true if
1928 * jQuery has been included on the page. Not using a function saves a small amount
1929 * of overhead for the browser, as well as making your code much more readable.
1930 *
1931 * Finally, you also have the ability to pass in an object of feature names and
1932 * their tests. This is handy if you want to add multiple detections in one go.
1933 * The keys should always be a string, and the value can be either a boolean or
1934 * function that returns a boolean.
1935 *
1936 * ```js
1937 * var detects = {
1938 * 'hasjquery': 'jQuery' in window,
1939 * 'itstuesday': function() {
1940 * var d = new Date();
1941 * return d.getDay() === 2;
1942 * }
1943 * }
1944 *
1945 * Modernizr.addTest(detects);
1946 * ```
1947 *
1948 * There is really no difference between the first methods and this one, it is
1949 * just a convenience to let you write more readable code.
1950 */
1951
1952 function addTest(feature, test) {
1953
1954 if (typeof feature == 'object') {
1955 for (var key in feature) {
1956 if (hasOwnProp(feature, key)) {
1957 addTest(key, feature[ key ]);
1958 }
1959 }
1960 } else {
1961
1962 feature = feature.toLowerCase();
1963 var featureNameSplit = feature.split('.');
1964 var last = Modernizr[featureNameSplit[0]];
1965
1966 // Again, we don't check for parent test existence. Get that right, though.
1967 if (featureNameSplit.length == 2) {
1968 last = last[featureNameSplit[1]];
1969 }
1970
1971 if (typeof last != 'undefined') {
1972 // we're going to quit if you're trying to overwrite an existing test
1973 // if we were to allow it, we'd do this:
1974 // var re = new RegExp("\\b(no-)?" + feature + "\\b");
1975 // docElement.className = docElement.className.replace( re, '' );
1976 // but, no rly, stuff 'em.
1977 return Modernizr;
1978 }
1979
1980 test = typeof test == 'function' ? test() : test;
1981
1982 // Set the value (this is the magic, right here).
1983 if (featureNameSplit.length == 1) {
1984 Modernizr[featureNameSplit[0]] = test;
1985 } else {
1986 // cast to a Boolean, if not one already
1987 /* jshint -W053 */
1988 if (Modernizr[featureNameSplit[0]] && !(Modernizr[featureNameSplit[0]] instanceof Boolean)) {
1989 Modernizr[featureNameSplit[0]] = new Boolean(Modernizr[featureNameSplit[0]]);
1990 }
1991
1992 Modernizr[featureNameSplit[0]][featureNameSplit[1]] = test;
1993 }
1994
1995 // Set a single class (either `feature` or `no-feature`)
1996 /* jshint -W041 */
1997 setClasses([(!!test && test != false ? '' : 'no-') + featureNameSplit.join('-')]);
1998 /* jshint +W041 */
1999
2000 // Trigger the event
2001 Modernizr._trigger(feature, test);
2002 }
2003
2004 return Modernizr; // allow chaining.
2005 }
2006
2007 // After all the tests are run, add self to the Modernizr prototype
2008 Modernizr._q.push(function() {
2009 ModernizrProto.addTest = addTest;
2010 });
2011
2012
2013
2014
2015 /**
2016 * createElement is a convenience wrapper around document.createElement. Since we
2017 * use createElement all over the place, this allows for (slightly) smaller code
2018 * as well as abstracting away issues with creating elements in contexts other than
2019 * HTML documents (e.g. SVG documents).
2020 *
2021 * @access private
2022 * @function createElement
2023 * @returns {HTMLElement|SVGElement} An HTML or SVG element
2024 */
2025
2026 function createElement() {
2027 if (typeof document.createElement !== 'function') {
2028 // This is the case in IE7, where the type of createElement is "object".
2029 // For this reason, we cannot call apply() as Object is not a Function.
2030 return document.createElement(arguments[0]);
2031 } else if (isSVG) {
2032 return document.createElementNS.call(document, 'http://www.w3.org/2000/svg', arguments[0]);
2033 } else {
2034 return document.createElement.apply(document, arguments);
2035 }
2036 }
2037
2038 ;
2039
2040 /**
2041 * Modernizr.hasEvent() detects support for a given event
2042 *
2043 * @memberof Modernizr
2044 * @name Modernizr.hasEvent
2045 * @optionName Modernizr.hasEvent()
2046 * @optionProp hasEvent
2047 * @access public
2048 * @function hasEvent
2049 * @param {string|*} eventName - the name of an event to test for (e.g. "resize")
2050 * @param {Element|string} [element=HTMLDivElement] - is the element|document|window|tagName to test on
2051 * @returns {boolean}
2052 * @example
2053 * `Modernizr.hasEvent` lets you determine if the browser supports a supplied event.
2054 * By default, it does this detection on a div element
2055 *
2056 * ```js
2057 * hasEvent('blur') // true;
2058 * ```
2059 *
2060 * However, you are able to give an object as a second argument to hasEvent to
2061 * detect an event on something other than a div.
2062 *
2063 * ```js
2064 * hasEvent('devicelight', window) // true;
2065 * ```
2066 *
2067 */
2068
2069 var hasEvent = (function() {
2070
2071 // Detect whether event support can be detected via `in`. Test on a DOM element
2072 // using the "blur" event b/c it should always exist. bit.ly/event-detection
2073 var needsFallback = !('onblur' in document.documentElement);
2074
2075 function inner(eventName, element) {
2076
2077 var isSupported;
2078 if (!eventName) { return false; }
2079 if (!element || typeof element === 'string') {
2080 element = createElement(element || 'div');
2081 }
2082
2083 // Testing via the `in` operator is sufficient for modern browsers and IE.
2084 // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and
2085 // "resize", whereas `in` "catches" those.
2086 eventName = 'on' + eventName;
2087 isSupported = eventName in element;
2088
2089 // Fallback technique for old Firefox - bit.ly/event-detection
2090 if (!isSupported && needsFallback) {
2091 if (!element.setAttribute) {
2092 // Switch to generic element if it lacks `setAttribute`.
2093 // It could be the `document`, `window`, or something else.
2094 element = createElement('div');
2095 }
2096
2097 element.setAttribute(eventName, '');
2098 isSupported = typeof element[eventName] === 'function';
2099
2100 if (element[eventName] !== undefined) {
2101 // If property was created, "remove it" by setting value to `undefined`.
2102 element[eventName] = undefined;
2103 }
2104 element.removeAttribute(eventName);
2105 }
2106
2107 return isSupported;
2108 }
2109 return inner;
2110 })();
2111
2112
2113 ModernizrProto.hasEvent = hasEvent;
2114
2115/*!
2116{
2117 "name": "placeholder attribute",
2118 "property": "placeholder",
2119 "tags": ["forms", "attribute"],
2120 "builderAliases": ["forms_placeholder"]
2121}
2122!*/
2123/* DOC
2124Tests for placeholder attribute in inputs and textareas
2125*/
2126
2127 Modernizr.addTest('placeholder', ('placeholder' in createElement('input') && 'placeholder' in createElement('textarea')));
2128
2129
2130 // Run each test
2131 testRunner();
2132
2133 // Remove the "no-js" class if it exists
2134 setClasses(classes);
2135
2136 delete ModernizrProto.addTest;
2137 delete ModernizrProto.addAsyncTest;
2138
2139 // Run the things that are supposed to run after the tests
2140 for (var i = 0; i < Modernizr._q.length; i++) {
2141 Modernizr._q[i]();
2142 }
2143
2144 // Leak Modernizr namespace
2145 window.Modernizr = Modernizr;
2146
2147
2148;
2149
2150})(window, document);
2151
2152var freedom = (function (f, win) {
2153 'use strict';
2154
2155 // f.ajax.post('/tracking', {
2156 // 'page': win.location.pathname
2157 // });
2158
2159 return f;
2160
2161} (freedom || {}, window));
2162
2163var freedom = (function (f, win) {
2164 'use strict';
2165
2166 f.i18n = {};
2167
2168 f.i18n.getMessage = function(key) {
2169 return f.i18n.messages[key];
2170 };
2171
2172 return f;
2173
2174} (freedom, window));
2175
2176// http://stackoverflow.com/a/26596324/1064325
2177// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
2178(function () {
2179 function CustomEvent ( event, params ) {
2180 params = params || { bubbles: false, cancelable: false, detail: undefined };
2181 var evt = document.createEvent( 'CustomEvent' );
2182 evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
2183 return evt;
2184 }
2185
2186 CustomEvent.prototype = window.Event.prototype;
2187
2188 window.Event = CustomEvent;
2189})();
2190
2191freedom.campaignCode = (function (win) {
2192 'use strict';
2193 function init() {
2194 setCampaign(getCampaing());
2195 }
2196 function getCampaing() {
2197 var queryString = win.location.href.split('?').length > 1 ? win.location.href.split('?')[1] : null;
2198 var arrParams = queryString ? queryString.split('&') : [];
2199 var indexParams = 0;
2200 var campaign = '';
2201 while(arrParams.length > indexParams) {
2202 if(arrParams[indexParams].indexOf('campaign=') === 0) {
2203 campaign = arrParams[indexParams].split('campaign=')[1];
2204 }
2205 indexParams++;
2206 }
2207 return campaign;
2208 }
2209
2210 function setCampaign(campaign) {
2211 if(!campaign) return;
2212 win.document.cookie = 'campaignCode='+campaign+'; path=/;';
2213 }
2214 return {
2215 'init': init
2216 };
2217}(window)).init();
2218
2219freedom.nsRequire = (function($, win, doc) {
2220 'use strict';
2221
2222 var topics = {};
2223
2224 function createTopic(topic) {
2225 topics[topic] = topics[topic] || {callbacks: [], loaded: false};
2226 }
2227
2228 function use(topic, callback) {
2229 createTopic(topic);
2230 if(topics[topic].loaded) {
2231 callback();
2232 } else {
2233 var callbacks = topics[topic].callbacks;
2234 callbacks.push(callback);
2235 }
2236 }
2237
2238 function load(topic) {
2239 createTopic(topic);
2240 if(!topics[topic].loaded) {
2241 for (var i = 0; i < topics[topic].callbacks.length; i++) {
2242 topics[topic].callbacks[i]();
2243 }
2244 }
2245 topics[topic].loaded = true;
2246 }
2247
2248 function isLoaded(topic) {
2249 createTopic(topic);
2250 return topics[topic].loaded;
2251 }
2252
2253 return {
2254 use: use,
2255 load: load,
2256 isLoaded: isLoaded
2257 };
2258
2259}(undefined, window, window.document));
2260
2261 </script>
2262 <script type="text/javascript" id="rest-client">/*!
2263 * Reqwest! A general purpose XHR connection manager
2264 * license MIT (c) Dustin Diaz 2015
2265 * https://github.com/ded/reqwest
2266 */
2267
2268!function (name, context, definition) {
2269 if (typeof module != 'undefined' && module.exports) module.exports = definition()
2270 else if (typeof define == 'function' && define.amd) define(definition)
2271 else context[name] = definition()
2272}('reqwest', this, function () {
2273
2274 var context = this
2275
2276 if ('window' in context) {
2277 var doc = document
2278 , byTag = 'getElementsByTagName'
2279 , head = doc[byTag]('head')[0]
2280 } else {
2281 var XHR2
2282 try {
2283 XHR2 = require('xhr2')
2284 } catch (ex) {
2285 throw new Error('Peer dependency `xhr2` required! Please npm install xhr2')
2286 }
2287 }
2288
2289
2290 var httpsRe = /^http/
2291 , protocolRe = /(^\w+):\/\//
2292 , twoHundo = /^(20\d|1223)$/ //http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request
2293 , readyState = 'readyState'
2294 , contentType = 'Content-Type'
2295 , requestedWith = 'X-Requested-With'
2296 , uniqid = 0
2297 , callbackPrefix = 'reqwest_' + (+new Date())
2298 , lastValue // data stored by the most recent JSONP callback
2299 , xmlHttpRequest = 'XMLHttpRequest'
2300 , xDomainRequest = 'XDomainRequest'
2301 , noop = function () {}
2302
2303 , isArray = typeof Array.isArray == 'function'
2304 ? Array.isArray
2305 : function (a) {
2306 return a instanceof Array
2307 }
2308
2309 , defaultHeaders = {
2310 'contentType': 'application/x-www-form-urlencoded'
2311 , 'requestedWith': xmlHttpRequest
2312 , 'accept': {
2313 '*': 'text/javascript, text/html, application/xml, text/xml, */*'
2314 , 'xml': 'application/xml, text/xml'
2315 , 'html': 'text/html'
2316 , 'text': 'text/plain'
2317 , 'json': 'application/json, text/javascript'
2318 , 'js': 'application/javascript, text/javascript'
2319 }
2320 }
2321
2322 , xhr = function(o) {
2323 // is it x-domain
2324 if (o['crossOrigin'] === true) {
2325 var xhr = context[xmlHttpRequest] ? new XMLHttpRequest() : null
2326 if (xhr && 'withCredentials' in xhr) {
2327 return xhr
2328 } else if (context[xDomainRequest]) {
2329 return new XDomainRequest()
2330 } else {
2331 throw new Error('Browser does not support cross-origin requests')
2332 }
2333 } else if (context[xmlHttpRequest]) {
2334 return new XMLHttpRequest()
2335 } else if (XHR2) {
2336 return new XHR2()
2337 } else {
2338 return new ActiveXObject('Microsoft.XMLHTTP')
2339 }
2340 }
2341 , globalSetupOptions = {
2342 dataFilter: function (data) {
2343 return data
2344 }
2345 }
2346
2347 function succeed(r) {
2348 var protocol = protocolRe.exec(r.url)
2349 protocol = (protocol && protocol[1]) || context.location.protocol
2350 return httpsRe.test(protocol) ? twoHundo.test(r.request.status) : !!r.request.response
2351 }
2352
2353 function handleReadyState(r, success, error) {
2354 return function () {
2355 // use _aborted to mitigate against IE err c00c023f
2356 // (can't read props on aborted request objects)
2357 if (r._aborted) return error(r.request)
2358 if (r._timedOut) return error(r.request, 'Request is aborted: timeout')
2359 if (r.request && r.request[readyState] == 4) {
2360 r.request.onreadystatechange = noop
2361 if (succeed(r)) success(r.request)
2362 else
2363 error(r.request)
2364 }
2365 }
2366 }
2367
2368 function setHeaders(http, o) {
2369 var headers = o['headers'] || {}
2370 , h
2371
2372 headers['Accept'] = headers['Accept']
2373 || defaultHeaders['accept'][o['type']]
2374 || defaultHeaders['accept']['*']
2375
2376 var isAFormData = typeof FormData !== 'undefined' && (o['data'] instanceof FormData);
2377 // breaks cross-origin requests with legacy browsers
2378 if (!o['crossOrigin'] && !headers[requestedWith]) headers[requestedWith] = defaultHeaders['requestedWith']
2379 if (!headers[contentType] && !isAFormData) headers[contentType] = o['contentType'] || defaultHeaders['contentType']
2380 for (h in headers)
2381 headers.hasOwnProperty(h) && 'setRequestHeader' in http && http.setRequestHeader(h, headers[h])
2382 }
2383
2384 function setCredentials(http, o) {
2385 if (typeof o['withCredentials'] !== 'undefined' && typeof http.withCredentials !== 'undefined') {
2386 http.withCredentials = !!o['withCredentials']
2387 }
2388 }
2389
2390 function generalCallback(data) {
2391 lastValue = data
2392 }
2393
2394 function urlappend (url, s) {
2395 return url + (/\?/.test(url) ? '&' : '?') + s
2396 }
2397
2398 function handleJsonp(o, fn, err, url) {
2399 var reqId = uniqid++
2400 , cbkey = o['jsonpCallback'] || 'callback' // the 'callback' key
2401 , cbval = o['jsonpCallbackName'] || reqwest.getcallbackPrefix(reqId)
2402 , cbreg = new RegExp('((^|\\?|&)' + cbkey + ')=([^&]+)')
2403 , match = url.match(cbreg)
2404 , script = doc.createElement('script')
2405 , loaded = 0
2406 , isIE10 = navigator.userAgent.indexOf('MSIE 10.0') !== -1
2407
2408 if (match) {
2409 if (match[3] === '?') {
2410 url = url.replace(cbreg, '$1=' + cbval) // wildcard callback func name
2411 } else {
2412 cbval = match[3] // provided callback func name
2413 }
2414 } else {
2415 url = urlappend(url, cbkey + '=' + cbval) // no callback details, add 'em
2416 }
2417
2418 context[cbval] = generalCallback
2419
2420 script.type = 'text/javascript'
2421 script.src = url
2422 script.async = true
2423 if (typeof script.onreadystatechange !== 'undefined' && !isIE10) {
2424 // need this for IE due to out-of-order onreadystatechange(), binding script
2425 // execution to an event listener gives us control over when the script
2426 // is executed. See http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html
2427 script.htmlFor = script.id = '_reqwest_' + reqId
2428 }
2429
2430 script.onload = script.onreadystatechange = function () {
2431 if ((script[readyState] && script[readyState] !== 'complete' && script[readyState] !== 'loaded') || loaded) {
2432 return false
2433 }
2434 script.onload = script.onreadystatechange = null
2435 script.onclick && script.onclick()
2436 // Call the user callback with the last value stored and clean up values and scripts.
2437 fn(lastValue)
2438 lastValue = undefined
2439 head.removeChild(script)
2440 loaded = 1
2441 }
2442
2443 // Add the script to the DOM head
2444 head.appendChild(script)
2445
2446 // Enable JSONP timeout
2447 return {
2448 abort: function () {
2449 script.onload = script.onreadystatechange = null
2450 err({}, 'Request is aborted: timeout', {})
2451 lastValue = undefined
2452 head.removeChild(script)
2453 loaded = 1
2454 }
2455 }
2456 }
2457
2458 function getRequest(fn, err) {
2459 var o = this.o
2460 , method = (o['method'] || 'GET').toUpperCase()
2461 , url = typeof o === 'string' ? o : o['url']
2462 // convert non-string objects to query-string form unless o['processData'] is false
2463 , data = (o['processData'] !== false && o['data'] && typeof o['data'] !== 'string')
2464 ? reqwest.toQueryString(o['data'])
2465 : (o['data'] || null)
2466 , http
2467 , sendWait = false
2468
2469 // if we're working on a GET request and we have data then we should append
2470 // query string to end of URL and not post data
2471 if ((o['type'] == 'jsonp' || method == 'GET') && data) {
2472 url = urlappend(url, data)
2473 data = null
2474 }
2475
2476 if (o['type'] == 'jsonp') return handleJsonp(o, fn, err, url)
2477
2478 // get the xhr from the factory if passed
2479 // if the factory returns null, fall-back to ours
2480 http = (o.xhr && o.xhr(o)) || xhr(o)
2481
2482 http.open(method, url, o['async'] === false ? false : true)
2483 setHeaders(http, o)
2484 setCredentials(http, o)
2485 if (context[xDomainRequest] && http instanceof context[xDomainRequest]) {
2486 http.onload = fn
2487 http.onerror = err
2488 // NOTE: see
2489 // http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/30ef3add-767c-4436-b8a9-f1ca19b4812e
2490 http.onprogress = function() {}
2491 sendWait = true
2492 } else {
2493 http.onreadystatechange = handleReadyState(this, fn, err)
2494 }
2495 o['before'] && o['before'](http)
2496 if (sendWait) {
2497 setTimeout(function () {
2498 http.send(data)
2499 }, 200)
2500 } else {
2501 http.send(data)
2502 }
2503 return http
2504 }
2505
2506 function Reqwest(o, fn) {
2507 this.o = o
2508 this.fn = fn
2509
2510 init.apply(this, arguments)
2511 }
2512
2513 function setType(header) {
2514 // json, javascript, text/plain, text/html, xml
2515 if (header === null) return undefined; //In case of no content-type.
2516 if (header.match('json')) return 'json'
2517 if (header.match('javascript')) return 'js'
2518 if (header.match('text')) return 'html'
2519 if (header.match('xml')) return 'xml'
2520 }
2521
2522 function init(o, fn) {
2523
2524 this.url = typeof o == 'string' ? o : o['url']
2525 this.timeout = null
2526
2527 // whether request has been fulfilled for purpose
2528 // of tracking the Promises
2529 this._fulfilled = false
2530 // success handlers
2531 this._successHandler = function(){}
2532 this._fulfillmentHandlers = []
2533 // error handlers
2534 this._errorHandlers = []
2535 // complete (both success and fail) handlers
2536 this._completeHandlers = []
2537 this._erred = false
2538 this._responseArgs = {}
2539
2540 var self = this
2541
2542 fn = fn || function () {}
2543
2544 if (o['timeout']) {
2545 this.timeout = setTimeout(function () {
2546 timedOut()
2547 }, o['timeout'])
2548 }
2549
2550 if (o['success']) {
2551 this._successHandler = function () {
2552 o['success'].apply(o, arguments)
2553 }
2554 }
2555
2556 if (o['error']) {
2557 this._errorHandlers.push(function () {
2558 o['error'].apply(o, arguments)
2559 })
2560 }
2561
2562 if (o['complete']) {
2563 this._completeHandlers.push(function () {
2564 o['complete'].apply(o, arguments)
2565 })
2566 }
2567
2568 function complete (resp) {
2569 o['timeout'] && clearTimeout(self.timeout)
2570 self.timeout = null
2571 while (self._completeHandlers.length > 0) {
2572 self._completeHandlers.shift()(resp)
2573 }
2574 }
2575
2576 function success (resp) {
2577 var type = o['type'] || resp && setType(resp.getResponseHeader('Content-Type')) // resp can be undefined in IE
2578 resp = (type !== 'jsonp') ? self.request : resp
2579 // use global data filter on response text
2580 var filteredResponse = globalSetupOptions.dataFilter(resp.responseText, type)
2581 , r = filteredResponse
2582 try {
2583 resp.responseText = r
2584 } catch (e) {
2585 // can't assign this in IE<=8, just ignore
2586 }
2587 if (r) {
2588 switch (type) {
2589 case 'json':
2590 try {
2591 resp = context.JSON ? context.JSON.parse(r) : eval('(' + r + ')')
2592 } catch (err) {
2593 return error(resp, 'Could not parse JSON in response', err)
2594 }
2595 break
2596 case 'js':
2597 resp = eval(r)
2598 break
2599 case 'html':
2600 resp = r
2601 break
2602 case 'xml':
2603 resp = resp.responseXML
2604 && resp.responseXML.parseError // IE trololo
2605 && resp.responseXML.parseError.errorCode
2606 && resp.responseXML.parseError.reason
2607 ? null
2608 : resp.responseXML
2609 break
2610 }
2611 }
2612
2613 self._responseArgs.resp = resp
2614 self._fulfilled = true
2615 fn(resp)
2616 self._successHandler(resp)
2617 while (self._fulfillmentHandlers.length > 0) {
2618 resp = self._fulfillmentHandlers.shift()(resp)
2619 }
2620
2621 complete(resp)
2622 }
2623
2624 function timedOut() {
2625 self._timedOut = true
2626 self.request.abort()
2627 }
2628
2629 function error(resp, msg, t) {
2630 resp = self.request
2631 self._responseArgs.resp = resp
2632 self._responseArgs.msg = msg
2633 self._responseArgs.t = t
2634 self._erred = true
2635 while (self._errorHandlers.length > 0) {
2636 self._errorHandlers.shift()(resp, msg, t)
2637 }
2638 complete(resp)
2639 }
2640
2641 this.request = getRequest.call(this, success, error)
2642 }
2643
2644 Reqwest.prototype = {
2645 abort: function () {
2646 this._aborted = true
2647 this.request.abort()
2648 }
2649
2650 , retry: function () {
2651 init.call(this, this.o, this.fn)
2652 }
2653
2654 /**
2655 * Small deviation from the Promises A CommonJs specification
2656 * http://wiki.commonjs.org/wiki/Promises/A
2657 */
2658
2659 /**
2660 * `then` will execute upon successful requests
2661 */
2662 , then: function (success, fail) {
2663 success = success || function () {}
2664 fail = fail || function () {}
2665 if (this._fulfilled) {
2666 this._responseArgs.resp = success(this._responseArgs.resp)
2667 } else if (this._erred) {
2668 fail(this._responseArgs.resp, this._responseArgs.msg, this._responseArgs.t)
2669 } else {
2670 this._fulfillmentHandlers.push(success)
2671 this._errorHandlers.push(fail)
2672 }
2673 return this
2674 }
2675
2676 /**
2677 * `always` will execute whether the request succeeds or fails
2678 */
2679 , always: function (fn) {
2680 if (this._fulfilled || this._erred) {
2681 fn(this._responseArgs.resp)
2682 } else {
2683 this._completeHandlers.push(fn)
2684 }
2685 return this
2686 }
2687
2688 /**
2689 * `fail` will execute when the request fails
2690 */
2691 , fail: function (fn) {
2692 if (this._erred) {
2693 fn(this._responseArgs.resp, this._responseArgs.msg, this._responseArgs.t)
2694 } else {
2695 this._errorHandlers.push(fn)
2696 }
2697 return this
2698 }
2699 , 'catch': function (fn) {
2700 return this.fail(fn)
2701 }
2702 }
2703
2704 function reqwest(o, fn) {
2705 return new Reqwest(o, fn)
2706 }
2707
2708 // normalize newline variants according to spec -> CRLF
2709 function normalize(s) {
2710 return s ? s.replace(/\r?\n/g, '\r\n') : ''
2711 }
2712
2713 function serial(el, cb) {
2714 var n = el.name
2715 , t = el.tagName.toLowerCase()
2716 , optCb = function (o) {
2717 // IE gives value="" even where there is no value attribute
2718 // 'specified' ref: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-862529273
2719 if (o && !o['disabled'])
2720 cb(n, normalize(o['attributes']['value'] && o['attributes']['value']['specified'] ? o['value'] : o['text']))
2721 }
2722 , ch, ra, val, i
2723
2724 // don't serialize elements that are disabled or without a name
2725 if (el.disabled || !n) return
2726
2727 switch (t) {
2728 case 'input':
2729 if (!/reset|button|image|file/i.test(el.type)) {
2730 ch = /checkbox/i.test(el.type)
2731 ra = /radio/i.test(el.type)
2732 val = el.value
2733 // WebKit gives us "" instead of "on" if a checkbox has no value, so correct it here
2734 ;(!(ch || ra) || el.checked) && cb(n, normalize(ch && val === '' ? 'on' : val))
2735 }
2736 break
2737 case 'textarea':
2738 cb(n, normalize(el.value))
2739 break
2740 case 'select':
2741 if (el.type.toLowerCase() === 'select-one') {
2742 optCb(el.selectedIndex >= 0 ? el.options[el.selectedIndex] : null)
2743 } else {
2744 for (i = 0; el.length && i < el.length; i++) {
2745 el.options[i].selected && optCb(el.options[i])
2746 }
2747 }
2748 break
2749 }
2750 }
2751
2752 // collect up all form elements found from the passed argument elements all
2753 // the way down to child elements; pass a '
2754 <form>' or form fields.
2755 // called with 'this'=callback to use for serial() on each element
2756 function eachFormElement() {
2757 var cb = this
2758 , e, i
2759 , serializeSubtags = function (e, tags) {
2760 var i, j, fa
2761 for (i = 0; i < tags.length; i++) {
2762 fa = e[byTag](tags[i])
2763 for (j = 0; j < fa.length; j++) serial(fa[j], cb)
2764 }
2765 }
2766
2767 for (i = 0; i < arguments.length; i++) {
2768 e = arguments[i]
2769 if (/input|select|textarea/i.test(e.tagName)) serial(e, cb)
2770 serializeSubtags(e, [ 'input', 'select', 'textarea' ])
2771 }
2772 }
2773
2774 // standard query string style serialization
2775 function serializeQueryString() {
2776 return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))
2777 }
2778
2779 // { 'name': 'value', ... } style serialization
2780 function serializeHash() {
2781 var hash = {}
2782 eachFormElement.apply(function (name, value) {
2783 if (name in hash) {
2784 hash[name] && !isArray(hash[name]) && (hash[name] = [hash[name]])
2785 hash[name].push(value)
2786 } else hash[name] = value
2787 }, arguments)
2788 return hash
2789 }
2790
2791 // [ { name: 'name', value: 'value' }, ... ] style serialization
2792 reqwest.serializeArray = function () {
2793 var arr = []
2794 eachFormElement.apply(function (name, value) {
2795 arr.push({name: name, value: value})
2796 }, arguments)
2797 return arr
2798 }
2799
2800 reqwest.serialize = function () {
2801 if (arguments.length === 0) return ''
2802 var opt, fn
2803 , args = Array.prototype.slice.call(arguments, 0)
2804
2805 opt = args.pop()
2806 opt && opt.nodeType && args.push(opt) && (opt = null)
2807 opt && (opt = opt.type)
2808
2809 if (opt == 'map') fn = serializeHash
2810 else if (opt == 'array') fn = reqwest.serializeArray
2811 else fn = serializeQueryString
2812
2813 return fn.apply(null, args)
2814 }
2815
2816 reqwest.toQueryString = function (o, trad) {
2817 var prefix, i
2818 , traditional = trad || false
2819 , s = []
2820 , enc = encodeURIComponent
2821 , add = function (key, value) {
2822 // If value is a function, invoke it and return its value
2823 value = ('function' === typeof value) ? value() : (value == null ? '' : value)
2824 s[s.length] = enc(key) + '=' + enc(value)
2825 }
2826 // If an array was passed in, assume that it is an array of form elements.
2827 if (isArray(o)) {
2828 for (i = 0; o && i < o.length; i++) add(o[i]['name'], o[i]['value'])
2829 } else {
2830 // If traditional, encode the "old" way (the way 1.3.2 or older
2831 // did it), otherwise encode params recursively.
2832 for (prefix in o) {
2833 if (o.hasOwnProperty(prefix)) buildParams(prefix, o[prefix], traditional, add)
2834 }
2835 }
2836
2837 // spaces should be + according to spec
2838 return s.join('&').replace(/%20/g, '+')
2839 }
2840
2841 function buildParams(prefix, obj, traditional, add) {
2842 var name, i, v
2843 , rbracket = /\[\]$/
2844
2845 if (isArray(obj)) {
2846 // Serialize array item.
2847 for (i = 0; obj && i < obj.length; i++) {
2848 v = obj[i]
2849 if (traditional || rbracket.test(prefix)) {
2850 // Treat each array item as a scalar.
2851 add(prefix, v)
2852 } else {
2853 buildParams(prefix + '[' + (typeof v === 'object' ? i : '') + ']', v, traditional, add)
2854 }
2855 }
2856 } else if (obj && obj.toString() === '[object Object]') {
2857 // Serialize object item.
2858 for (name in obj) {
2859 buildParams(prefix + '[' + name + ']', obj[name], traditional, add)
2860 }
2861
2862 } else {
2863 // Serialize scalar item.
2864 add(prefix, obj)
2865 }
2866 }
2867
2868 reqwest.getcallbackPrefix = function () {
2869 return callbackPrefix
2870 }
2871
2872 // jQuery and Zepto compatibility, differences can be remapped here so you can call
2873 // .ajax.compat(options, callback)
2874 reqwest.compat = function (o, fn) {
2875 if (o) {
2876 o['type'] && (o['method'] = o['type']) && delete o['type']
2877 o['dataType'] && (o['type'] = o['dataType'])
2878 o['jsonpCallback'] && (o['jsonpCallbackName'] = o['jsonpCallback']) && delete o['jsonpCallback']
2879 o['jsonp'] && (o['jsonpCallback'] = o['jsonp'])
2880 }
2881 return new Reqwest(o, fn)
2882 }
2883
2884 reqwest.ajaxSetup = function (options) {
2885 options = options || {}
2886 for (var k in options) {
2887 globalSetupOptions[k] = options[k]
2888 }
2889 }
2890
2891 return reqwest
2892});
2893
2894freedom.restClient = (function($, win, doc) {
2895 'use strict';
2896
2897 var DEBOUNCE_TIME = 100;
2898 var LOADING_TIME = 300;
2899
2900 function loading(options, action) {
2901 if (options.displayLoading && freedom.nsLoading) {
2902 freedom.nsLoading.init(options.loadingContext || 'body')[action]();
2903 }
2904 }
2905
2906 function getDebounceTime(options) {
2907 return options.disableDebounce ? 0 : DEBOUNCE_TIME;
2908 }
2909
2910 function initLoading(options) {
2911 options.reqStartTime = new Date().getTime();
2912 options.loadingTimeout = setTimeout(function () {
2913 loading(options, 'show');
2914 }, getDebounceTime(options));
2915 }
2916
2917 function hideLoading(options) {
2918 clearTimeout(options.loadingTimeout);
2919 options.reqEndTime = new Date().getTime();
2920 var reqSpentTime = options.reqEndTime - options.reqStartTime;
2921 var reqEstimatedLoadingTime = reqSpentTime - getDebounceTime(options);
2922
2923 if (reqEstimatedLoadingTime > 0 && reqEstimatedLoadingTime < LOADING_TIME) {
2924 var reqLoadingTimeToBeExecuted = LOADING_TIME - reqEstimatedLoadingTime;
2925
2926 setTimeout(function () {
2927 loading(options, 'hide');
2928 }, reqLoadingTimeToBeExecuted);
2929 } else {
2930 loading(options, 'hide');
2931 }
2932 }
2933
2934 function applyPlaceholder() {
2935 freedom.nsRequire.use('placeholder', function() {
2936 freedom.placeholder.applyPlaceholder();
2937 });
2938 }
2939
2940 function request(url, options) {
2941 initLoading(options);
2942
2943 try {
2944
2945 if (!options.headers) {
2946 options.headers = {};
2947 }
2948
2949 options.headers['Cache-Control'] =
2950 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0';
2951 options.headers['Expires'] = 0;
2952 options.headers['Pragma'] = 'no-cache';
2953
2954 var reqwestConfig = {
2955 url: url,
2956 headers: options.headers,
2957 data: options.data,
2958 method: options.method || 'get'
2959 };
2960
2961 reqwestConfig.success = function(res) {
2962 hideLoading(options);
2963 if (options.success) {
2964 options.success(res);
2965 applyPlaceholder();
2966 }
2967 };
2968
2969 reqwestConfig.error = function (res) {
2970 hideLoading(options);
2971 if (options.error) {
2972 options.error(res);
2973 applyPlaceholder();
2974 }
2975 if (res.status === 401) {
2976 if (typeof res.response === 'string') {
2977 var responseBody = JSON.parse(res.response);
2978 if (!options.preventRedirect && responseBody.url) {
2979 window.location = responseBody.url;
2980 }
2981 }
2982 }
2983 };
2984
2985 if (options.type) {
2986 reqwestConfig.type = options.type;
2987 }
2988
2989 if (options.complete) {
2990 reqwestConfig.complete = options.complete;
2991 }
2992
2993 var req = reqwest(reqwestConfig);
2994
2995 if ('always' in options) {
2996 req.always(options.always);
2997 }
2998
2999 } catch (e) {
3000 console.error("error on request " + url);
3001 console.error(e.stack);
3002 }
3003 }
3004
3005 return {
3006 'request': request
3007 };
3008
3009}(undefined, window, window.document));
3010
3011 </script>
3012 <script async type="text/javascript" src="//static-hmg-netshoes-com-br.ns2online.com.br/dev/netshoesbr/js/metadata.min.js"></script>
3013 <script type="text/javascript">var dataLayer=[{'site':{'name':'Netshoes','domain':'hmg-netshoes-com-br.ns2online.com.br','country':'BR','application':'desktop'},'page':{'pageID':'login','pageVersion':'', 'pageCategory':'Login','pageType':'Login','template':'/login/index','searchResults':1,'searchReferral':'', 'department':'', 'pageSeller': ''},'ecommerce':{'currencyCode':'BRL','campaign':''}}];</script>
3014 <script type="text/javascript">var freedom = freedom || {};freedom.nsRequire.use('metadata', function() { freedom.metadata.chaordic('login','netshoes-br','//static.chaordicsystems.com/static/loader.js', '{}');});</script>
3015 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-TKR935S');</script>
3016 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-KFL5KMX');</script>
3017 <script id="gtm-init" type="text/javascript">freedom.nsRequire.use('metadata', function() {freedom.nsRequire.load('gtm');});</script>
3018 <script>(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:522722,hjsv:5};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'//static.hotjar.com/c/hotjar-','.js?sv=');</script>
3019 </head>
3020 <body>
3021 <noscript>
3022 <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TKR935S" height="0" width="0" style="display:none;visibility:hidden"></iframe>
3023 </noscript>
3024 <noscript>
3025 <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KFL5KMX" height="0" width="0" style="display:none;visibility:hidden"></iframe>
3026 </noscript>
3027 <div id="root">
3028 <header id="site-header" class="breakpoint simple netshoes-mx">
3029 <div class="header-wrapper content desktop">
3030 <div class="header-wrapper-holder simple">
3031 <div class="header-wrapper-logo">
3032 <div class="logo-dimensions">
3033 <a href="/">
3034 <img class="logo" title="Loja de Artigos Esportivos Online | Netshoes" alt="Loja de Artigos Esportivos Online | Netshoes" src="//static-hmg-netshoes-com-br.ns2online.com.br/dev/netshoesbr/images/logo.png" />
3035 </a>
3036 </div>
3037 </div>
3038 </div>
3039 </header>
3040 <div id="content" class="content body-holder desktop" data-summary-content="true">
3041 <section class="login-block login-block-desktop">
3042 <div class="center">
3043 <div class="sign-in">
3044 <form action="#" method="post" name="login-account" id="login-account" data-error-500="Ocorreu um problema durante o login, tente novamente." data-error-401="Usuário ou senha inválidos" data-error-422-duplicatedProvider="Sua conta Netshoes já possui uma conta Facebook associada.">
3045 <h2>Já sou cliente</h2>
3046 <input name="redirect" value="/" type="hidden">
3047 <input id="clipping" type="hidden" value="092feb8cfcea3da40764138864d851fff52f5ffeae6761fbb847e94709b7f80571508a2678773a0aad794f1df46f0412" />
3048 <div class="field tooltip-item ever-display input-label">
3049 <input id="username" name="username" value="" type="email" class="full-size required" maxlength="100" autocomplete="off" autocorrect="off" autocapitalize="none" placeholder="E-mail, CPF ou CNPJ" title="E-mail, CPF ou CNPJ" data-hj-masked qa-automation="login-username"/>
3050 </div>
3051 <div class="field tooltip-item ever-display input-label">
3052 <input id="password" name="password" value="" type="password" class="full-size required" maxlength="15" autocomplete="off" autocorrect="off" autocapitalize="none" placeholder="Senha" title="Senha" data-hj-masked qa-automation="login-password" />
3053 <a href="#" class="view-password" data-texthide="esconder"data-textshow="mostrar" data-password="password">mostrar</a>
3054 </div>
3055 <div class="forgot-password-wrapper">
3056 <a href="/reset-password" id="reset-password-link" class="remember-password" qa-automation="login-reset-password">Esqueci minha senha</a>
3057 <div id="errors-wrapper" class="errors-wrapper "></div>
3058 </div>
3059 <div class="field tooltip-item ever-display">
3060 <div id="g-recaptcha" class="g-recaptcha" data-sitekey="6LeOFTkUAAAAAJ4ylM3O4WLnnJHAjYx5z0o9DbKG"></div>
3061 </div>
3062 <div class="button-wrapper">
3063 <button id="login-button" type="submit" qa-automation="login-button"class="button button-block button-rounded button-flat">Acessar conta</button>
3064 </div>
3065 </form>
3066 </div>
3067 <div class="line-behind-text" data-context-show="sign-up-input">
3068 <span class="text">ou</span>
3069 </div>
3070 <div class="sign-up">
3071 <form action="#" method="get" name="create-account" id="create-account" class="create-account">
3072 <h2>Criar conta</h2>
3073 <input name="redirect" value="/" type="hidden">
3074 <div id="sign-up-input" class="field tooltip-item ever-display input-label">
3075 <input id="sign-up-username" name="sign-up-username" value="" type="email" class="full-size" maxlength="100" autocomplete="off" autocorrect="off" autocapitalize="none" placeholder="Informe seu e-mail" title="Informe seu e-mail" data-senderror="Você já é cliente, acesse sua conta." qa-automation="login-create-field"/>
3076 </div>
3077 <div id="errors-wrapper-create-account" class="errors-wrapper "></div>
3078 <div class="button-wrapper">
3079 <button id="verify-email-button" type="submit" class="button button-block button-rounded button-flat" qa-automation="login-create-button">Prosseguir</button>
3080 </div>
3081 </form>
3082 <div id="wrapper-show-create-account" class="wrapper-show-create-account">
3083 <h2>Criar conta</h2>
3084 <div class="button-wrapper">
3085 <button type="button" class="button button-block button-rounded button-flat context-show" data-show="create-account" data-hide="wrapper-show-create-account">Criar conta</button>
3086 </div>
3087 </div>
3088 </div>
3089 </div>
3090 <div class="social-login-button">
3091 <div class="label">Acesse sua conta Netshoes através de suas redes sociais.</div>
3092 <div id="facebookLoginButton" class="button hide">
3093 <div class="logo">
3094 <span>f</span>
3095 </div>
3096 <div class="text">
3097 <span>Facebook</span>
3098 </div>
3099 </div>
3100 </div>
3101 </section>
3102 </div>
3103 <div id="modalHolder"></div>
3104 </div>
3105 <footer class="refactoring-new-footer">
3106 <div class="breakpoint wrapper desktop">
3107 <section class="line payment-flags certificate partners need-help">
3108 <div class="central-info">
3109 <div class="central-info-item central-info-title">Central de Relacionamento</div>
3110 <div class="central-info-item central-info-description">Preparada para esclarecer suas dúvidas.</div>
3111 <div class="central-info-item central-info-button-wrapper">
3112 <a href="/central-de-relacionamento" class="central-info-button" title="Tire suas dúvidas">Tire suas dúvidas</a>
3113 <a href="/institucional/politica-de-privacidade" class="central-info-text" title="PolÃtica de privacidade">PolÃtica de privacidade</a>
3114 </div>
3115 </div>
3116 <div class="need-help-item">
3117 <a href="/central-de-relacionamento" title="Precisa de Ajuda?">Precisa de Ajuda?</a>
3118 </div>
3119 <ul class="payment-flag-list">
3120 <li>
3121 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/ncard.svg" title="NCard" alt="NCard"/>
3122 </li>
3123 <li>
3124 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/visa.svg" title="Visa" alt="Visa"/>
3125 </li>
3126 <li>
3127 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/mastercard.svg" title="Mastercard" alt="Mastercard"/>
3128 </li>
3129 <li>
3130 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/amex.svg" title="American Express" alt="American Express"/>
3131 </li>
3132 <li>
3133 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/dinersclub.svg" title="Dinners Club" alt="Dinners Club"/>
3134 </li>
3135 <li>
3136 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/hipercard.svg" title="Hipercard" alt="Hipercard"/>
3137 </li>
3138 <li>
3139 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/elo.svg" title="Elo" alt="Elo"/>
3140 </li>
3141 <li>
3142 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/boleto.svg" title="Boleto" alt="Boleto"/>
3143 </li>
3144 <li>
3145 <img src="//static-hmg-netshoes-com-br.ns2online.com.br/hmg/netshoesbr//svg/payment-flags/paypal.svg" title="Paypal" alt="Paypal"/>
3146 </li>
3147 </ul>
3148 <div class="signs-br">
3149 <div class="security-signs">
3150 <i class="tag tag-certisign" title="Certisign" alt="Certisign"></i>
3151 </div>
3152 </div>
3153 </section>
3154 <section class="line disclaimer">Copyright ©2000 -2018 www.netshoes.com.br, TODOS OS DIREITOS RESERVADOS. Todo o conteúdo do site, todas as fotos, imagens, logotipos, marcas, dizeres, som, software, conjunto imagem, layout, trade dress, aqui veiculados são de propriedade exclusiva da NS2.COM Internet S.A. É vedada qualquer reprodução, total ou parcial, de qualquer elemento de identidade, sem expressa autorização. A violação de qualquer direito mencionado implicará na responsabilização cÃvel e criminal nos termos da Lei. NS2.Com Internet S/A - CNPJ: 09.339.936/0001-16 Rua Vergueiro, 943 - Liberdade - CEP01504-001 - São Paulo - SP</section>
3155 </div>
3156 </footer>
3157 <div id="fb-root"></div>
3158 <script>(function(d, s, id) {try {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.10&appId=1402800519978687";fjs.parentNode.insertBefore(js, fjs);} catch (e) {console.log("Error while loading facebook social plugin");console.log(e);}}(document, 'script', 'facebook-jssdk'));</script>
3159 <![if (!IE)|(gt IE 10)]>
3160 <script data-pin-build="parsePinBtns" async defer src="//assets.pinterest.com/js/pinit.js"></script>
3161 <![endif]>
3162 <script lang="pt-BR" async defer src="//apis.google.com/js/platform.js"></script>
3163 <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
3164 </body>
3165 <div id="fb-root"></div>
3166 <script>(function(d, s, id) {try {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&version=v2.10&appId=1402800519978687";fjs.parentNode.insertBefore(js, fjs);} catch (e) {console.log("Error while loading facebook social plugin");console.log(e);}}(document, 'script', 'facebook-jssdk'));</script>
3167 <script type="text/javascript">if (!freedom) {freedom = {};if (!freedom.i18n) {freedom.i18n = {};}}freedom.i18n.messages = {"required": "O campo %s é obrigatório.","matches": "Os campos %s e %s não são iguais.","default": "O campo %s ainda está configurado como padrão, por favor mude.","valid_email": "E-mail inválido.","valid_emails": "O campo %s precisa que todos os e-mails sejam válidos.","min_length": "O campo %s precisa ter pelo menos %s caracteres.","max_length": "O campo %s não deve exceder %s caracteres.","exact_length": "O campo %s precisa ter exatamente %s caracteres.","greater_than": "O campo %s precisa ser um número maior que %s.","less_than": "O campo %s precisa ser um número menor que %s.","alpha": "O campo %s precisa conter somente letras.","alpha_numeric": "O campo %s precisa conter somente letra ou número.","alpha_dash": "O campo %s precisa conter somente número, letra, traço e traço.inferior.","numeric": "O campo %s deve conter apenas números.","integer": "O campo %s deve conter apenasr valores inteiros.","decimal": "O campo %s deve cnoter apenas valores decimais.","is_natural": "O campo %s deve conter apenas números positivos.","is_natural_no_zero": "O campo %s deve conter um número maior que zero.","valid_ip": "O campo %s deve ser um IP válido.","valid_base64": "O campo %s deve conter um base64 válido.","valid_credit_card": "O campo %s deve ser um cartão de crédito válido.","is_file_type": "O campo %s deve conter apenas arquivos do(s) tipo(s) %s.","valid_url": "O campo %s deve ser uma URL válida.","greater_than_date": "O campo %s precisa ter uma data maior que %s.","less_than_date": "O campo %s precisa ter uma data menor que %s.","greater_than_or_equal_date": "O campo %s precisa ter uma data que é maior ou igual à %s.","less_than_or_equal_date": "O campo %s precisa ter uma data que é menor ou igual à %s.","alpha_and_space": "Digite um %s válido","oops_check_this_field": "Ops! Que tal verificar este campo","checkCPCode": "CEP inválido","oops_required_field": "Ops! Este campo é obrigatório","oops_fill_this_field": "Ops! Preecha corretamente este campo","invalid_date": "Data inválida","matches_password": "Ops! O valor do campo 'Confirmar nova senha' deve ser igual ao valor do campo 'Nova senha'","different_password": "Ops! A nova senha deve ser diferente da senha atual","different_email": "Ops! O novo e-mail deve ser diferente do e-mail atual","remember_password_username_required": "E-mail, CPF ou CNPJ deve ser preenchido","remember_password_username_invalid": "E-mail, CPF ou CNPJ inválido","remember_password_user_not_found": "Ops! Usuário não encontrado","remember_password_error": "Ocorreu um erro, por favor tente novamente em alguns instantes","remember_password_success": "Um link para recuperação de senha foi enviado para seu email.","click_and_collect_required": "Ops! Escolha um lugar para retirada","shipping_schedule_required": "Ops! É necessário selecionar uma data e um perÃodo para entrega.","one_click_buy_feedback_success": "Cartão excluido com sucesso","one_click_buy_feedback_error": "Erro ao excluir cartão","one_click_buy_feedback_undo": "Desfazer","one_click_buy_feedback_retry": "Tentar novamente"};</script>
3168 <script src='https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit&hl=pt-BR'async defer></script>
3169 <script type="text/javascript">var onloadCallback = function() {freedom.login.onloadRecaptchaCallback();};</script>
3170 <script type="text/javascript" src="//static-hmg-netshoes-com-br.ns2online.com.br/dev/netshoesbr/js/login.min.js"></script>
3171 </html>