function sendCartDetails(e){TeePublic.ProductPage.Legacy.sendJSON(e,"/add_to_cart",(function(e){return e.success?(window.location="/cart",!0):(alert(e.message),!1)}))}function removeCartItem(e){var t=new Object;t.cart_item_id=e,window.TeePublic.Cart.removeItemFromData(e,"cartRemoveItemHead"),TeePublic.ProductPage.Legacy.sendJSON(t,"/remove_from_cart",(function(e){return e.success?(window.location=window.location,!0):(alert(e.errors[0]),!1)}))}!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=pe.type(e);return"function"!==n&&!pe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function i(e,t,n){if(pe.isFunction(t))return pe.grep(e,(function(e,i){return!!t.call(e,i,e)!==n}));if(t.nodeType)return pe.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(Se.test(t))return pe.filter(t,e,n);t=pe.filter(t,e)}return pe.grep(e,(function(e){return pe.inArray(e,t)>-1!==n}))}function s(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}function o(e){var t={};return pe.each(e.match(Ie)||[],(function(e,n){t[n]=!0})),t}function r(){ie.addEventListener?(ie.removeEventListener("DOMContentLoaded",a),e.removeEventListener("load",a)):(ie.detachEvent("onreadystatechange",a),e.detachEvent("onload",a))}function a(){(ie.addEventListener||"load"===e.event.type||"complete"===ie.readyState)&&(r(),pe.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(je,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Ne.test(n)?pe.parseJSON(n):n)}catch(e){}pe.data(e,t,n)}else n=void 0}return n}function c(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function d(e,t,n,i){if($e(e)){var s,o,r=pe.expando,a=e.nodeType,l=a?pe.cache:e,c=a?e[r]:e[r]&&r;if(c&&l[c]&&(i||l[c].data)||void 0!==n||"string"!=typeof t)return c||(c=a?e[r]=ne.pop()||pe.guid++:r),l[c]||(l[c]=a?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(i?l[c]=pe.extend(l[c],t):l[c].data=pe.extend(l[c].data,t)),o=l[c],i||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[pe.camelCase(t)]=n),"string"==typeof t?null==(s=o[t])&&(s=o[pe.camelCase(t)]):s=o,s}}function u(e,t,n){if($e(e)){var i,s,o=e.nodeType,r=o?pe.cache:e,a=o?e[pe.expando]:pe.expando;if(r[a]){if(t&&(i=n?r[a]:r[a].data)){s=(t=pe.isArray(t)?t.concat(pe.map(t,pe.camelCase)):t in i||(t=pe.camelCase(t))in i?[t]:t.split(" ")).length;for(;s--;)delete i[t[s]];if(n?!c(i):!pe.isEmptyObject(i))return}(n||(delete r[a].data,c(r[a])))&&(o?pe.cleanData([e],!0):ue.deleteExpando||r!=r.window?delete r[a]:r[a]=void 0)}}}function h(e,t,n,i){var s,o=1,r=20,a=i?function(){return i.cur()}:function(){return pe.css(e,t,"")},l=a(),c=n&&n[3]||(pe.cssNumber[t]?"":"px"),d=(pe.cssNumber[t]||"px"!==c&&+l)&&He.exec(pe.css(e,t));if(d&&d[3]!==c){c=c||d[3],n=n||[],d=+l||1;do{d/=o=o||".5",pe.style(e,t,d+c)}while(o!==(o=a()/l)&&1!==o&&--r)}return n&&(d=+d||+l||0,s=n[1]?d+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=d,i.end=s)),s}function p(e){var t=Ge.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function f(e,t){var n,i,s=0,o=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(i=n[s]);s++)!t||pe.nodeName(i,t)?o.push(i):pe.merge(o,f(i,t));return void 0===t||t&&pe.nodeName(e,t)?pe.merge([e],o):o}function m(e,t){for(var n,i=0;null!=(n=e[i]);i++)pe._data(n,"globalEval",!t||pe._data(t[i],"globalEval"))}function _(e){Ue.test(e.type)&&(e.defaultChecked=e.checked)}function g(e,t,n,i,s){for(var o,r,a,l,c,d,u,h=e.length,g=p(t),v=[],y=0;y"!==u[1]||Je.test(r)?0:l:l.firstChild)&&r.childNodes.length;o--;)pe.nodeName(d=r.childNodes[o],"tbody")&&!d.childNodes.length&&r.removeChild(d);for(pe.merge(v,l.childNodes),l.textContent="";l.firstChild;)l.removeChild(l.firstChild);l=g.lastChild}else v.push(t.createTextNode(r));for(l&&g.removeChild(l),ue.appendChecked||pe.grep(f(v,"input"),_),y=0;r=v[y++];)if(i&&pe.inArray(r,i)>-1)s&&s.push(r);else if(a=pe.contains(r.ownerDocument,r),l=f(g.appendChild(r),"script"),a&&m(l),n)for(o=0;r=l[o++];)We.test(r.type||"")&&n.push(r);return l=null,g}function v(){return!0}function y(){return!1}function C(){try{return ie.activeElement}catch(e){}}function b(e,t,n,i,s,o){var r,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)b(e,a,n,i,t[a],o);return e}if(null==i&&null==s?(s=n,i=n=void 0):null==s&&("string"==typeof n?(s=i,i=void 0):(s=i,i=n,n=void 0)),!1===s)s=y;else if(!s)return e;return 1===o&&(r=s,s=function(e){return pe().off(e),r.apply(this,arguments)},s.guid=r.guid||(r.guid=pe.guid++)),e.each((function(){pe.event.add(this,t,s,i,n)}))}function E(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function S(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function T(e){var t=at.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,i,s,o=pe._data(e),r=pe._data(t,o),a=o.events;if(a)for(n in delete r.handle,r.events={},a)for(i=0,s=a[n].length;i1&&"string"==typeof p&&!ue.checkClone&&rt.test(p))return e.each((function(s){var o=e.eq(s);m&&(t[0]=p.call(this,s,o.html())),L(o,t,n,i)}));if(u&&(s=(c=g(t,e[0].ownerDocument,!1,e,i)).firstChild,1===c.childNodes.length&&(c=s),s||i)){for(r=(a=pe.map(f(c,"script"),S)).length;d")).appendTo(t.documentElement))[0].contentWindow||dt[0].contentDocument).document).write(),t.close(),n=P(e,t),dt.detach()),ut[e]=n),n}function A(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function $(e){if(e in kt)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=wt.length;n--;)if((e=wt[n]+t)in kt)return e}function N(e,t){for(var n,i,s,o=[],r=0,a=e.length;r=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!de.call(e,"constructor")&&!de.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(!ue.ownFirst)for(t in e)return de.call(e,t);for(t in e);return void 0===t||de.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?le[ce.call(e)]||"object":typeof e},globalEval:function(t){t&&pe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(me,"ms-").replace(_e,ge)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var i,s=0;if(n(e))for(i=e.length;sE.cacheLength&&delete e[t.shift()],e[n+" "]=i}var t=[];return e}function i(e){return e[H]=!0,e}function s(e){var t=$.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),i=n.length;i--;)E.attrHandle[n[i]]=t}function r(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i((function(t){return t=+t,i((function(n,i){for(var s,o=e([],n.length,t),r=o.length;r--;)n[s=o[r]]&&(n[s]=!(i[s]=n[s]))}))}))}function d(e){return e&&void 0!==e.getElementsByTagName&&e}function u(){}function h(e){for(var t=0,n=e.length,i="";t1?function(t,n,i){for(var s=e.length;s--;)if(!e[s](t,n,i))return!1;return!0}:e[0]}function m(e,n,i){for(var s=0,o=n.length;s-1&&(i[c]=!(r[c]=u))}}else y=_(y===r?y.splice(f,y.length):y),o?o(null,r,y,l):Y.apply(r,y)}))}function v(e){for(var t,n,i,s=e.length,o=E.relative[e[0].type],r=o||E.relative[" "],a=o?1:0,l=p((function(e){return e===t}),r,!0),c=p((function(e){return ee(t,e)>-1}),r,!0),d=[function(e,n,i){var s=!o&&(i||n!==x)||((t=n).nodeType?l(e,n,i):c(e,n,i));return t=null,s}];a1&&f(d),a>1&&h(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(ae,"$1"),n,a0,o=e.length>0,r=function(i,r,a,l,c){var d,u,h,p=0,f="0",m=i&&[],g=[],v=x,y=i||o&&E.find.TAG("*",c),C=B+=null==v?1:Math.random()||.1,b=y.length;for(c&&(x=r===$||r||c);f!==b&&null!=(d=y[f]);f++){if(o&&d){for(u=0,r||d.ownerDocument===$||(A(d),a=!j);h=e[u++];)if(h(d,r||$,a)){l.push(d);break}c&&(B=C)}s&&((d=!h&&d)&&p--,i&&m.push(d))}if(p+=f,s&&f!==p){for(u=0;h=n[u++];)h(m,g,r,a);if(i){if(p>0)for(;f--;)m[f]||g[f]||(g[f]=J.call(l));g=_(g)}Y.apply(l,g),c&&!i&&g.length>0&&p+n.length>1&&t.uniqueSort(l)}return c&&(B=C,x=v),m};return s?i(r):r}var C,b,E,S,T,w,k,L,x,P,I,A,$,N,j,D,O,R,M,H="sizzle"+1*new Date,F=e.document,B=0,q=0,U=n(),z=n(),W=n(),V=function(e,t){return e===t&&(I=!0),0},G=1<<31,X={}.hasOwnProperty,Q=[],J=Q.pop,K=Q.push,Y=Q.push,Z=Q.slice,ee=function(e,t){for(var n=0,i=e.length;n+~]|"+ne+")"+ne+"*"),de=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),ue=new RegExp(oe),he=new RegExp("^"+ie+"$"),pe={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+se),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},fe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,_e=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,ye=/'|\\/g,Ce=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),be=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},Ee=function(){A()};try{Y.apply(Q=Z.call(F.childNodes),F.childNodes),Q[F.childNodes.length].nodeType}catch(e){Y={apply:Q.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}for(C in b=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},A=t.setDocument=function(e){var t,n,i=e?e.ownerDocument||e:F;return i!==$&&9===i.nodeType&&i.documentElement?(N=($=i).documentElement,j=!T($),(n=$.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Ee,!1):n.attachEvent&&n.attachEvent("onunload",Ee)),b.attributes=s((function(e){return e.className="i",!e.getAttribute("className")})),b.getElementsByTagName=s((function(e){return e.appendChild($.createComment("")),!e.getElementsByTagName("*").length})),b.getElementsByClassName=_e.test($.getElementsByClassName),b.getById=s((function(e){return N.appendChild(e).id=H,!$.getElementsByName||!$.getElementsByName(H).length})),b.getById?(E.find.ID=function(e,t){if(void 0!==t.getElementById&&j){var n=t.getElementById(e);return n?[n]:[]}},E.filter.ID=function(e){var t=e.replace(Ce,be);return function(e){return e.getAttribute("id")===t}}):(delete E.find.ID,E.filter.ID=function(e){var t=e.replace(Ce,be);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),E.find.TAG=b.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):b.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],s=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[s++];)1===n.nodeType&&i.push(n);return i}return o},E.find.CLASS=b.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&j)return t.getElementsByClassName(e)},O=[],D=[],(b.qsa=_e.test($.querySelectorAll))&&(s((function(e){N.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&D.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||D.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+H+"-]").length||D.push("~="),e.querySelectorAll(":checked").length||D.push(":checked"),e.querySelectorAll("a#"+H+"+*").length||D.push(".#.+[+~]")})),s((function(e){var t=$.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&D.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||D.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),D.push(",.*:")}))),(b.matchesSelector=_e.test(R=N.matches||N.webkitMatchesSelector||N.mozMatchesSelector||N.oMatchesSelector||N.msMatchesSelector))&&s((function(e){b.disconnectedMatch=R.call(e,"div"),R.call(e,"[s!='']:x"),O.push("!=",oe)})),D=D.length&&new RegExp(D.join("|")),O=O.length&&new RegExp(O.join("|")),t=_e.test(N.compareDocumentPosition),M=t||_e.test(N.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},V=t?function(e,t){if(e===t)return I=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!b.sortDetached&&t.compareDocumentPosition(e)===n?e===$||e.ownerDocument===F&&M(F,e)?-1:t===$||t.ownerDocument===F&&M(F,t)?1:P?ee(P,e)-ee(P,t):0:4&n?-1:1)}:function(e,t){if(e===t)return I=!0,0;var n,i=0,s=e.parentNode,o=t.parentNode,a=[e],l=[t];if(!s||!o)return e===$?-1:t===$?1:s?-1:o?1:P?ee(P,e)-ee(P,t):0;if(s===o)return r(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;a[i]===l[i];)i++;return i?r(a[i],l[i]):a[i]===F?-1:l[i]===F?1:0},$):$},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==$&&A(e),n=n.replace(de,"='$1']"),b.matchesSelector&&j&&!W[n+" "]&&(!O||!O.test(n))&&(!D||!D.test(n)))try{var i=R.call(e,n);if(i||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return t(n,$,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==$&&A(e),M(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==$&&A(e);var n=E.attrHandle[t.toLowerCase()],i=n&&X.call(E.attrHandle,t.toLowerCase())?n(e,t,!j):void 0;return void 0!==i?i:b.attributes||!j?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],i=0,s=0;if(I=!b.detectDuplicates,P=!b.sortStable&&e.slice(0),e.sort(V),I){for(;t=e[s++];)t===e[s]&&(i=n.push(s));for(;i--;)e.splice(n[i],1)}return P=null,e},S=t.getText=function(e){var t,n="",i=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=S(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[i++];)n+=S(t);return n},E=t.selectors={cacheLength:50,createPseudo:i,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Ce,be),e[3]=(e[3]||e[4]||e[5]||"").replace(Ce,be),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ue.test(n)&&(t=w(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Ce,be).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&U(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,n,i){return function(s){var o=t.attr(s,e);return null==o?"!="===n:!n||(o+="","="===n?o===i:"!="===n?o!==i:"^="===n?i&&0===o.indexOf(i):"*="===n?i&&o.indexOf(i)>-1:"$="===n?i&&o.slice(-i.length)===i:"~="===n?(" "+o.replace(re," ")+" ").indexOf(i)>-1:"|="===n&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,n,i,s){var o="nth"!==e.slice(0,3),r="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===s?function(e){return!!e.parentNode}:function(t,n,l){var c,d,u,h,p,f,m=o!==r?"nextSibling":"previousSibling",_=t.parentNode,g=a&&t.nodeName.toLowerCase(),v=!l&&!a,y=!1;if(_){if(o){for(;m;){for(h=t;h=h[m];)if(a?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[r?_.firstChild:_.lastChild],r&&v){for(y=(p=(c=(d=(u=(h=_)[H]||(h[H]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]||[])[0]===B&&c[1])&&c[2],h=p&&_.childNodes[p];h=++p&&h&&h[m]||(y=p=0)||f.pop();)if(1===h.nodeType&&++y&&h===t){d[e]=[B,p,y];break}}else if(v&&(y=p=(c=(d=(u=(h=t)[H]||(h[H]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]||[])[0]===B&&c[1]),!1===y)for(;(h=++p&&h&&h[m]||(y=p=0)||f.pop())&&((a?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++y||(v&&((d=(u=h[H]||(h[H]={}))[h.uniqueID]||(u[h.uniqueID]={}))[e]=[B,y]), h!==t)););return(y-=s)===i||y%i==0&&y/i>=0}}},PSEUDO:function(e,n){var s,o=E.pseudos[e]||E.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[H]?o(n):o.length>1?(s=[e,e,"",n],E.setFilters.hasOwnProperty(e.toLowerCase())?i((function(e,t){for(var i,s=o(e,n),r=s.length;r--;)e[i=ee(e,s[r])]=!(t[i]=s[r])})):function(e){return o(e,0,s)}):o}},pseudos:{not:i((function(e){var t=[],n=[],s=k(e.replace(ae,"$1"));return s[H]?i((function(e,t,n,i){for(var o,r=s(e,null,i,[]),a=e.length;a--;)(o=r[a])&&(e[a]=!(t[a]=o))})):function(e,i,o){return t[0]=e,s(t,null,o,n),t[0]=null,!n.pop()}})),has:i((function(e){return function(n){return t(e,n).length>0}})),contains:i((function(e){return e=e.replace(Ce,be),function(t){return(t.textContent||t.innerText||S(t)).indexOf(e)>-1}})),lang:i((function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(Ce,be).toLowerCase(),function(t){var n;do{if(n=j?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===N},focus:function(e){return e===$.activeElement&&(!$.hasFocus||$.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!E.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return fe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c((function(){return[0]})),last:c((function(e,t){return[t-1]})),eq:c((function(e,t,n){return[n<0?n+t:n]})),even:c((function(e,t){for(var n=0;n=0;)e.push(i);return e})),gt:c((function(e,t,n){for(var i=n<0?n+t:n;++i2&&"ID"===(r=o[0]).type&&b.getById&&9===t.nodeType&&j&&E.relative[o[1].type]){if(!(t=(E.find.ID(r.matches[0].replace(Ce,be),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(s=pe.needsContext.test(e)?0:o.length;s--&&(r=o[s],!E.relative[a=r.type]);)if((l=E.find[a])&&(i=l(r.matches[0].replace(Ce,be),ve.test(o[0].type)&&d(t.parentNode)||t))){if(o.splice(s,1),!(e=i.length&&h(o)))return Y.apply(n,i),n;break}}return(c||k(e,u))(i,t,!j,n,!t||ve.test(e)&&d(t.parentNode)||t),n},b.sortStable=H.split("").sort(V).join("")===H,b.detectDuplicates=!!I,A(),b.sortDetached=s((function(e){return 1&e.compareDocumentPosition($.createElement("div"))})),s((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||o("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),b.attributes&&s((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||o("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),s((function(e){return null==e.getAttribute("disabled")}))||o(te,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),t}(e);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var ye=function(e,t,n){for(var i=[],s=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(s&&pe(e).is(n))break;i.push(e)}return i},Ce=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},be=pe.expr.match.needsContext,Ee=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Se=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?pe.find.matchesSelector(i,e)?[i]:[]:pe.find.matches(e,pe.grep(t,(function(e){return 1===e.nodeType})))},pe.fn.extend({find:function(e){var t,n=[],i=this,s=i.length;if("string"!=typeof e)return this.pushStack(pe(e).filter((function(){for(t=0;t1?pe.unique(n):n)).selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,"string"==typeof e&&be.test(e)?pe(e):e||[],!1).length}});var Te,we=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(pe.fn.init=function(e,t,n){var i,s;if(!e)return this;if(n=n||Te,"string"==typeof e){if(!(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:we.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:ie,!0)),Ee.test(i[1])&&pe.isPlainObject(t))for(i in t)pe.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}if((s=ie.getElementById(i[2]))&&s.parentNode){if(s.id!==i[2])return Te.find(e);this.length=1,this[0]=s}return this.context=ie,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?void 0!==n.ready?n.ready(e):e(pe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this))}).prototype=pe.fn,Te=pe(ie);var ke=/^(?:parents|prev(?:Until|All))/,Le={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),i=n.length;return this.filter((function(){for(t=0;t-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ye(e,"parentNode")},parentsUntil:function(e,t,n){return ye(e,"parentNode",n)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return ye(e,"nextSibling")},prevAll:function(e){return ye(e,"previousSibling")},nextUntil:function(e,t,n){return ye(e,"nextSibling",n)},prevUntil:function(e,t,n){return ye(e,"previousSibling",n)},siblings:function(e){return Ce((e.parentNode||{}).firstChild,e)},children:function(e){return Ce(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},(function(e,t){pe.fn[e]=function(n,i){var s=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(s=pe.filter(i,s)),this.length>1&&(Le[e]||(s=pe.uniqueSort(s)),ke.test(e)&&(s=s.reverse())),this.pushStack(s)}}));var xe,Pe,Ie=/\S+/g;for(Pe in pe.Callbacks=function(e){e="string"==typeof e?o(e):pe.extend({},e);var t,n,i,s,r=[],a=[],l=-1,c=function(){for(s=e.once,i=t=!0;a.length;l=-1)for(n=a.shift();++l-1;)r.splice(n,1),n<=l&&l--})),this},has:function(e){return e?pe.inArray(e,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return s=a=[],r=n="",this},disabled:function(){return!r},lock:function(){return s=!0,n||d.disable(),this},locked:function(){return!!s},fireWith:function(e,n){return s||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||c()),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!i}};return d},pe.extend({Deferred:function(e){var t=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return pe.Deferred((function(n){pe.each(t,(function(t,o){var r=pe.isFunction(e[t])&&e[t];s[o[1]]((function(){var e=r&&r.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===i?n.promise():this,r?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?pe.extend(e,i):i}},s={};return i.pipe=i.then,pe.each(t,(function(e,o){var r=o[2],a=o[3];i[o[1]]=r.add,a&&r.add((function(){n=a}),t[1^e][2].disable,t[2][2].lock),s[o[0]]=function(){return s[o[0]+"With"](this===s?i:this,arguments),this},s[o[0]+"With"]=r.fireWith})),i.promise(s),e&&e.call(s,s),s},when:function(e){var t,n,i,s=0,o=se.call(arguments),r=o.length,a=1!==r||e&&pe.isFunction(e.promise)?r:0,l=1===a?e:pe.Deferred(),c=function(e,n,i){return function(s){n[e]=this,i[e]=arguments.length>1?se.call(arguments):s,i===t?l.notifyWith(n,i):--a||l.resolveWith(n,i)}};if(r>1)for(t=new Array(r),n=new Array(r),i=new Array(r);s0||(xe.resolveWith(ie,[pe]),pe.fn.triggerHandler&&(pe(ie).triggerHandler("ready"),pe(ie).off("ready"))))}}),pe.ready.promise=function(t){if(!xe)if(xe=pe.Deferred(),"complete"===ie.readyState||"loading"!==ie.readyState&&!ie.documentElement.doScroll)e.setTimeout(pe.ready);else if(ie.addEventListener)ie.addEventListener("DOMContentLoaded",a),e.addEventListener("load",a);else{ie.attachEvent("onreadystatechange",a),e.attachEvent("onload",a);var n=!1;try{n=null==e.frameElement&&ie.documentElement}catch(e){}n&&n.doScroll&&function t(){if(!pe.isReady){try{n.doScroll("left")}catch(n){return e.setTimeout(t,50)}r(),pe.ready()}}()}return xe.promise(t)},pe.ready.promise(),pe(ue))break;ue.ownFirst="0"===Pe,ue.inlineBlockNeedsLayout=!1,pe((function(){var e,t,n,i;(n=ie.getElementsByTagName("body")[0])&&n.style&&(t=ie.createElement("div"),(i=ie.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),void 0!==t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",ue.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(i))})),function(){var e=ie.createElement("div");ue.deleteExpando=!0;try{delete e.test}catch(e){ue.deleteExpando=!1}e=null}();var Ae,$e=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)},Ne=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,je=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando])&&!c(e)},data:function(e,t,n){return d(e,t,n)},removeData:function(e,t){return u(e,t)},_data:function(e,t,n){return d(e,t,n,!0)},_removeData:function(e,t){return u(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,i,s,o=this[0],r=o&&o.attributes;if(void 0===e){if(this.length&&(s=pe.data(o),1===o.nodeType&&!pe._data(o,"parsedAttrs"))){for(n=r.length;n--;)r[n]&&0===(i=r[n].name).indexOf("data-")&&l(o,i=pe.camelCase(i.slice(5)),s[i]);pe._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each((function(){pe.data(this,e)})):arguments.length>1?this.each((function(){pe.data(this,e,t)})):o?l(o,e,pe.data(o,e)):void 0},removeData:function(e){return this.each((function(){pe.removeData(this,e)}))}}),pe.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=pe._data(e,t),n&&(!i||pe.isArray(n)?i=pe._data(e,t,pe.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),i=n.length,s=n.shift(),o=pe._queueHooks(e,t),r=function(){pe.dequeue(e,t)};"inprogress"===s&&(s=n.shift(),i--),s&&("fx"===t&&n.unshift("inprogress"),delete o.stop,s.call(e,r,o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add((function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)}))})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
a",ue.leadingWhitespace=3===De.firstChild.nodeType,ue.tbody=!De.getElementsByTagName("tbody").length,ue.htmlSerialize=!!De.getElementsByTagName("link").length,ue.html5Clone="<:nav>"!==ie.createElement("nav").cloneNode(!0).outerHTML,Re.type="checkbox",Re.checked=!0,Oe.appendChild(Re),ue.appendChecked=Re.checked,De.innerHTML="",ue.noCloneChecked=!!De.cloneNode(!0).lastChild.defaultValue,Oe.appendChild(De),(Re=ie.createElement("input")).setAttribute("type","radio"),Re.setAttribute("checked","checked"),Re.setAttribute("name","t"),De.appendChild(Re),ue.checkClone=De.cloneNode(!0).cloneNode(!0).lastChild.checked,ue.noCloneEvent=!!De.addEventListener,De[pe.expando]=1,ue.attributes=!De.getAttribute(pe.expando);var Xe={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:ue.htmlSerialize?[0,"",""]:[1,"X
","
"]};Xe.optgroup=Xe.option,Xe.tbody=Xe.tfoot=Xe.colgroup=Xe.caption=Xe.thead,Xe.th=Xe.td;var Qe=/<|&#?\w+;/,Je=/-1&&(f=p.split("."),p=f.shift(),f.sort()),r=p.indexOf(":")<0&&"on"+p,(t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=f.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:pe.makeArray(n,[t]),c=pe.event.special[p]||{},s||!c.trigger||!1!==c.trigger.apply(i,n))){if(!s&&!c.noBubble&&!pe.isWindow(i)){for(l=c.delegateType||p,et.test(l+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),d=a;d===(i.ownerDocument||ie)&&h.push(d.defaultView||d.parentWindow||e)}for(u=0;(a=h[u++])&&!t.isPropagationStopped();)t.type=u>1?l:c.bindType||p,(o=(pe._data(a,"events")||{})[t.type]&&pe._data(a,"handle"))&&o.apply(a,n),(o=r&&a[r])&&o.apply&&$e(a)&&(t.result=o.apply(a,n),!1===t.result&&t.preventDefault());if(t.type=p,!s&&!t.isDefaultPrevented()&&(!c._default||!1===c._default.apply(h.pop(),n))&&$e(i)&&r&&i[p]&&!pe.isWindow(i)){(d=i[r])&&(i[r]=null),pe.event.triggered=p;try{i[p]()}catch(e){}pe.event.triggered=void 0,d&&(i[r]=d)}return t.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,i,s,o,r=[],a=se.call(arguments),l=(pe._data(this,"events")||{})[e.type]||[],c=pe.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(r=pe.event.handlers.call(this,e,l),t=0;(s=r[t++])&&!e.isPropagationStopped();)for(e.currentTarget=s.elem,n=0;(o=s.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,void 0!==(i=((pe.event.special[o.origType]||{}).handle||o.handler).apply(s.elem,a))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,s,o,r=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],n=0;n-1:pe.find(s,this,null,[l]).length),i[s]&&i.push(o);i.length&&r.push({elem:l,handlers:i})}return a]","i"),st=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ot=/\s*$/g,ct=p(ie).appendChild(ie.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(st,"<$1>")},clone:function(e,t,n){var i,s,o,r,a,l=pe.contains(e.ownerDocument,e);if(ue.html5Clone||pe.isXMLDoc(e)||!it.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(ct.innerHTML=e.outerHTML,ct.removeChild(o=ct.firstChild)),!(ue.noCloneEvent&&ue.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(i=f(o),a=f(e),r=0;null!=(s=a[r]);++r)i[r]&&k(s,i[r]);if(t)if(n)for(a=a||f(e),i=i||f(o),r=0;null!=(s=a[r]);r++)w(s,i[r]);else w(e,o);return(i=f(o,"script")).length>0&&m(i,!l&&f(e,"script")),i=a=s=null,o},cleanData:function(e,t){for(var n,i,s,o,r=0,a=pe.expando,l=pe.cache,c=ue.attributes,d=pe.event.special;null!=(n=e[r]);r++)if((t||$e(n))&&(o=(s=n[a])&&l[s])){if(o.events)for(i in o.events)d[i]?pe.event.remove(n,i):pe.removeEvent(n,i,o.handle);l[s]&&(delete l[s],c||void 0===n.removeAttribute?n[a]=void 0:n.removeAttribute(a),ne.push(s))}}}),pe.fn.extend({domManip:L,detach:function(e){return x(this,e,!0)},remove:function(e){return x(this,e)},text:function(e){return qe(this,(function(e){return void 0===e?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||ie).createTextNode(e))}),null,e,arguments.length)},append:function(){return L(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||E(this,e).appendChild(e)}))},prepend:function(){return L(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=E(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return L(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return L(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(f(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return pe.clone(this,e,t)}))},html:function(e){return qe(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(nt,""):void 0;if("string"==typeof e&&!ot.test(e)&&(ue.htmlSerialize||!it.test(e))&&(ue.leadingWhitespace||!Ve.test(e))&&!Xe[(ze.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;nt",c.childNodes[0].style.borderCollapse="separate",(t=c.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(o=0===t[0].offsetHeight)&&(t[0].style.display="",t[1].style.display="none",o=0===t[0].offsetHeight)),u.removeChild(l)}var n,i,s,o,r,a,l=ie.createElement("div"),c=ie.createElement("div");c.style&&(c.style.cssText="float:left;opacity:.5",ue.opacity="0.5"===c.style.opacity,ue.cssFloat=!!c.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",ue.clearCloneStyle="content-box"===c.style.backgroundClip,(l=ie.createElement("div")).style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",c.innerHTML="",l.appendChild(c),ue.boxSizing=""===c.style.boxSizing||""===c.style.MozBoxSizing||""===c.style.WebkitBoxSizing,pe.extend(ue,{reliableHiddenOffsets:function(){return null==n&&t(),o},boxSizingReliable:function(){return null==n&&t(),s},pixelMarginRight:function(){return null==n&&t(),i},pixelPosition:function(){return null==n&&t(),n},reliableMarginRight:function(){return null==n&&t(),r},reliableMarginLeft:function(){return null==n&&t(),a}}))}();var _t,gt,vt=/^(top|right|bottom|left)$/;e.getComputedStyle?(_t=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},gt=function(e,t,n){var i,s,o,r,a=e.style;return""!==(r=(n=n||_t(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==r||pe.contains(e.ownerDocument,e)||(r=pe.style(e,t)),n&&!ue.pixelMarginRight()&&pt.test(r)&&ht.test(t)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=n.width,a.width=i,a.minWidth=s,a.maxWidth=o),void 0===r?r:r+""}):mt.currentStyle&&(_t=function(e){return e.currentStyle},gt=function(e,t,n){var i,s,o,r,a=e.style;return null==(r=(n=n||_t(e))?n[t]:void 0)&&a&&a[t]&&(r=a[t]),pt.test(r)&&!vt.test(t)&&(i=a.left,(o=(s=e.runtimeStyle)&&s.left)&&(s.left=e.currentStyle.left),a.left="fontSize"===t?"1em":r,r=a.pixelLeft+"px",a.left=i,o&&(s.left=o)),void 0===r?r:r+""||"auto"});var yt=/alpha\([^)]*\)/i,Ct=/opacity\s*=\s*([^)]*)/i,bt=/^(none|table(?!-c[ea]).+)/,Et=new RegExp("^("+Me+")(.*)$","i"),St={position:"absolute",visibility:"hidden",display:"block"},Tt={letterSpacing:"0",fontWeight:"400"},wt=["Webkit","O","Moz","ms"],kt=ie.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=gt(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:ue.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var s,o,r,a=pe.camelCase(t),l=e.style;if(t=pe.cssProps[a]||(pe.cssProps[a]=$(a)||a),r=pe.cssHooks[t]||pe.cssHooks[a],void 0===n)return r&&"get"in r&&void 0!==(s=r.get(e,!1,i))?s:l[t];if(!("string"===(o=typeof n)&&(s=He.exec(n))&&s[1]&&(n=h(e,t,s),o="number"),null==n||n!=n||("number"===o&&(n+=s&&s[3]||(pe.cssNumber[a]?"":"px")),ue.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),r&&"set"in r&&void 0===(n=r.set(e,n,i)))))try{l[t]=n}catch(e){}}},css:function(e,t,n,i){var s,o,r,a=pe.camelCase(t);return t=pe.cssProps[a]||(pe.cssProps[a]=$(a)||a),(r=pe.cssHooks[t]||pe.cssHooks[a])&&"get"in r&&(o=r.get(e,!0,n)),void 0===o&&(o=gt(e,t,i)),"normal"===o&&t in Tt&&(o=Tt[t]),""===n||n?(s=parseFloat(o),!0===n||isFinite(s)?s||0:o):o}}),pe.each(["height","width"],(function(e,t){pe.cssHooks[t]={get:function(e,n,i){if(n)return bt.test(pe.css(e,"display"))&&0===e.offsetWidth?ft(e,St,(function(){return O(e,t,i)})):O(e,t,i)},set:function(e,n,i){var s=i&&_t(e);return j(e,n,i?D(e,t,i,ue.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,s),s):0)}}})),ue.opacity||(pe.cssHooks.opacity={get:function(e,t){return Ct.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,i=e.currentStyle,s=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=i&&i.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===pe.trim(o.replace(yt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||i&&!i.filter)||(n.filter=yt.test(o)?o.replace(yt,s):o+" "+s)}}),pe.cssHooks.marginRight=A(ue.reliableMarginRight,(function(e,t){if(t)return ft(e,{display:"inline-block"},gt,[e,"marginRight"])})),pe.cssHooks.marginLeft=A(ue.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(gt(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-ft(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})):0))+"px"})),pe.each({margin:"",padding:"",border:"Width"},(function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var i=0,s={},o="string"==typeof n?n.split(" "):[n];i<4;i++)s[e+Fe[i]+t]=o[i]||o[i-2]||o[0];return s}},ht.test(e)||(pe.cssHooks[e+t].set=j)})),pe.fn.extend({css:function(e,t){return qe(this,(function(e,t,n){var i,s,o={},r=0;if(pe.isArray(t)){for(i=_t(e),s=t.length;r1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){Be(this)?pe(this).show():pe(this).hide()}))}}),pe.Tween=R,R.prototype={constructor:R,init:function(e,t,n,i,s,o){this.elem=e,this.prop=n,this.easing=s||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=R.propHooks[this.prop];return e&&e.get?e.get(this):R.propHooks._default.get(this)},run:function(e){var t,n=R.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):R.propHooks._default.set(this),this}},R.prototype.init.prototype=R.prototype,R.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},R.propHooks.scrollTop=R.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=R.prototype.init,pe.fx.step={};var Lt,xt,Pt=/^(?:toggle|show|hide)$/,It=/queueHooks$/;pe.Animation=pe.extend(U,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return h(n.elem,e,He.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(Ie);for(var n,i=0,s=e.length;i
a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),(e=n.getElementsByTagName("a")[0]).style.cssText="top:1px",ue.getSetAttribute="t"!==n.className,ue.style=/top/.test(e.getAttribute("style")),ue.hrefNormalized="/a"===e.getAttribute("href"),ue.checkOn=!!t.value,ue.optSelected=s.selected,ue.enctype=!!ie.createElement("form").enctype,i.disabled=!0,ue.optDisabled=!s.disabled,(t=ie.createElement("input")).setAttribute("value",""),ue.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),ue.radioValue="t"===t.value}();var At=/\r/g,$t=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(e){var t,n,i,s=this[0];return arguments.length?(i=pe.isFunction(e),this.each((function(n){var s;1===this.nodeType&&(null==(s=i?e.call(this,n,pe(this).val()):e)?s="":"number"==typeof s?s+="":pe.isArray(s)&&(s=pe.map(s,(function(e){return null==e?"":e+""}))),(t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,s,"value")||(this.value=s))}))):s?(t=pe.valHooks[s.type]||pe.valHooks[s.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(s,"value"))?n:"string"==typeof(n=s.value)?n.replace(At,""):null==n?"":n:void 0}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace($t," ")}},select:{get:function(e){for(var t,n,i=e.options,s=e.selectedIndex,o="select-one"===e.type||s<0,r=o?null:[],a=o?s+1:i.length,l=s<0?a:o?s:0;l-1)try{i.selected=n=!0}catch(e){i.scrollHeight}else i.selected=!1;return n||(e.selectedIndex=-1),s}}}}),pe.each(["radio","checkbox"],(function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},ue.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Nt,jt,Dt=pe.expr.attrHandle,Ot=/^(?:checked|selected)$/i,Rt=ue.getSetAttribute,Mt=ue.input;pe.fn.extend({attr:function(e,t){return qe(this,pe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){pe.removeAttr(this,e)}))}}),pe.extend({attr:function(e,t,n){var i,s,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(t=t.toLowerCase(),s=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?jt:Nt)),void 0!==n?null===n?void pe.removeAttr(e,t):s&&"set"in s&&void 0!==(i=s.set(e,n,t))?i:(e.setAttribute(t,n+""),n):s&&"get"in s&&null!==(i=s.get(e,t))?i:null==(i=pe.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!ue.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i,s=0,o=t&&t.match(Ie);if(o&&1===e.nodeType)for(;n=o[s++];)i=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Mt&&Rt||!Ot.test(n)?e[i]=!1:e[pe.camelCase("default-"+n)]=e[i]=!1:pe.attr(e,n,""),e.removeAttribute(Rt?n:i)}}),jt={set:function(e,t,n){return!1===t?pe.removeAttr(e,n):Mt&&Rt||!Ot.test(n)?e.setAttribute(!Rt&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=Dt[t]||pe.find.attr;Mt&&Rt||!Ot.test(t)?Dt[t]=function(e,t,i){var s,o;return i||(o=Dt[t],Dt[t]=s,s=null!=n(e,t,i)?t.toLowerCase():null,Dt[t]=o),s}:Dt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}})),Mt&&Rt||(pe.attrHooks.value={set:function(e,t,n){if(!pe.nodeName(e,"input"))return Nt&&Nt.set(e,t,n);e.defaultValue=t}}),Rt||(Nt={set:function(e,t,n){var i=e.getAttributeNode(n);if(i||e.setAttributeNode(i=e.ownerDocument.createAttribute(n)),i.value=t+="","value"===n||t===e.getAttribute(n))return t}},Dt.id=Dt.name=Dt.coords=function(e,t,n){var i;if(!n)return(i=e.getAttributeNode(t))&&""!==i.value?i.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:Nt.set},pe.attrHooks.contenteditable={set:function(e,t,n){Nt.set(e,""!==t&&t,n)}},pe.each(["width","height"],(function(e,t){pe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}}))),ue.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ht=/^(?:input|select|textarea|button|object)$/i,Ft=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return qe(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=pe.propFix[e]||e,this.each((function(){try{this[e]=void 0,delete this[e]}catch(e){}}))}}),pe.extend({prop:function(e,t,n){var i,s,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,s=pe.propHooks[t]),void 0!==n?s&&"set"in s&&void 0!==(i=s.set(e,n,t))?i:e[t]=n:s&&"get"in s&&null!==(i=s.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):Ht.test(e.nodeName)||Ft.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ue.hrefNormalized||pe.each(["href","src"],(function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),ue.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){pe.propFix[this.toLowerCase()]=this})),ue.enctype||(pe.propFix.enctype="encoding");var Bt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(e){var t,n,i,s,o,r,a,l=0;if(pe.isFunction(e))return this.each((function(t){pe(this).addClass(e.call(this,t,z(this)))}));if("string"==typeof e&&e)for(t=e.match(Ie)||[];n=this[l++];)if(s=z(n),i=1===n.nodeType&&(" "+s+" ").replace(Bt," ")){for(r=0;o=t[r++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");s!==(a=pe.trim(i))&&pe.attr(n,"class",a)}return this},removeClass:function(e){var t,n,i,s,o,r,a,l=0;if(pe.isFunction(e))return this.each((function(t){pe(this).removeClass(e.call(this,t,z(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Ie)||[];n=this[l++];)if(s=z(n),i=1===n.nodeType&&(" "+s+" ").replace(Bt," ")){for(r=0;o=t[r++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");s!==(a=pe.trim(i))&&pe.attr(n,"class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each((function(n){pe(this).toggleClass(e.call(this,n,z(this),t),t)})):this.each((function(){var t,i,s,o;if("string"===n)for(i=0,s=pe(this),o=e.match(Ie)||[];t=o[i++];)s.hasClass(t)?s.removeClass(t):s.addClass(t);else void 0!==e&&"boolean"!==n||((t=z(this))&&pe._data(this,"__className__",t),pe.attr(this,"class",t||!1===e?"":pe._data(this,"__className__")||""))}))},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+z(n)+" ").replace(Bt," ").indexOf(t)>-1)return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var qt=e.location,Ut=pe.now(),zt=/\?/,Wt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,i=null,s=pe.trim(t+"");return s&&!pe.trim(s.replace(Wt,(function(e,t,s,o){return n&&t&&(i=0),0===i?e:(n=s||t,i+=!o-!s,"")})))?Function("return "+s)():pe.error("Invalid JSON: "+t)},pe.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{e.DOMParser?n=(new e.DOMParser).parseFromString(t,"text/xml"):((n=new e.ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var Vt=/#.*$/,Gt=/([?&])_=[^&]*/,Xt=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Qt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Jt=/^(?:GET|HEAD)$/,Kt=/^\/\//,Yt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Zt={},en={},tn="*/".concat("*"),nn=qt.href,sn=Yt.exec(nn.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:nn,type:"GET",isLocal:Qt.test(sn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":tn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?G(G(e,pe.ajaxSettings),t):G(pe.ajaxSettings,e)},ajaxPrefilter:W(Zt),ajaxTransport:W(en),ajax:function(t,n){function i(t,n,i,s){var o,u,v,y,b,S=n;2!==C&&(C=2,l&&e.clearTimeout(l),d=void 0,a=s||"",E.readyState=t>0?4:0,o=t>=200&&t<300||304===t,i&&(y=X(h,E,i)),y=Q(h,y,E,o),o?(h.ifModified&&((b=E.getResponseHeader("Last-Modified"))&&(pe.lastModified[r]=b),(b=E.getResponseHeader("etag"))&&(pe.etag[r]=b)),204===t||"HEAD"===h.type?S="nocontent":304===t?S="notmodified":(S=y.state,u=y.data,o=!(v=y.error))):(v=S,!t&&S||(S="error",t<0&&(t=0))),E.status=t,E.statusText=(n||S)+"",o?m.resolveWith(p,[u,S,E]):m.rejectWith(p,[E,S,v]),E.statusCode(g),g=void 0,c&&f.trigger(o?"ajaxSuccess":"ajaxError",[E,h,o?u:v]),_.fireWith(p,[E,S]),c&&(f.trigger("ajaxComplete",[E,h]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var s,o,r,a,l,c,d,u,h=pe.ajaxSetup({},n),p=h.context||h,f=h.context&&(p.nodeType||p.jquery)?pe(p):pe.event,m=pe.Deferred(),_=pe.Callbacks("once memory"),g=h.statusCode||{},v={},y={},C=0,b="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(2===C){if(!u)for(u={};t=Xt.exec(a);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===C?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return C||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return C||(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(C<2)for(t in e)g[t]=[g[t],e[t]];else E.always(e[E.status]);return this},abort:function(e){var t=e||b;return d&&d.abort(t),i(0,t),this}};if(m.promise(E).complete=_.add,E.success=E.done,E.error=E.fail,h.url=((t||h.url||nn)+"").replace(Vt,"").replace(Kt,sn[1]+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=pe.trim(h.dataType||"*").toLowerCase().match(Ie)||[""],null==h.crossDomain&&(s=Yt.exec(h.url.toLowerCase()),h.crossDomain=!(!s||s[1]===sn[1]&&s[2]===sn[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(sn[3]||("http:"===sn[1]?"80":"443")))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=pe.param(h.data,h.traditional)),V(Zt,h,n,E),2===C)return E;for(o in(c=pe.event&&h.global)&&0==pe.active++&&pe.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Jt.test(h.type),r=h.url,h.hasContent||(h.data&&(r=h.url+=(zt.test(r)?"&":"?")+h.data,delete h.data),!1===h.cache&&(h.url=Gt.test(r)?r.replace(Gt,"$1_="+Ut++):r+(zt.test(r)?"&":"?")+"_="+Ut++)),h.ifModified&&(pe.lastModified[r]&&E.setRequestHeader("If-Modified-Since",pe.lastModified[r]),pe.etag[r]&&E.setRequestHeader("If-None-Match",pe.etag[r])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+tn+"; q=0.01":""):h.accepts["*"]),h.headers)E.setRequestHeader(o,h.headers[o]);if(h.beforeSend&&(!1===h.beforeSend.call(p,E,h)||2===C))return E.abort();for(o in b="abort",{success:1,error:1,complete:1})E[o](h[o]);if(d=V(en,h,n,E)){if(E.readyState=1,c&&f.trigger("ajaxSend",[E,h]),2===C)return E;h.async&&h.timeout>0&&(l=e.setTimeout((function(){E.abort("timeout")}),h.timeout));try{C=1,d.send(v,i)}catch(e){if(!(C<2))throw e;i(-1,e)}}else i(-1,"No Transport");return E},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],(function(e,t){pe[t]=function(e,n,i,s){return pe.isFunction(n)&&(s=s||i,i=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:s,data:n,success:i},pe.isPlainObject(e)&&e))}})),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},pe.fn.extend({wrapAll:function(e){if(pe.isFunction(e))return this.each((function(t){pe(this).wrapAll(e.call(this,t))}));if(this[0]){var t=pe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e})).append(this)}return this},wrapInner:function(e){return pe.isFunction(e)?this.each((function(t){pe(this).wrapInner(e.call(this,t))})):this.each((function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=pe.isFunction(e);return this.each((function(n){pe(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)})).end()}}),pe.expr.filters.hidden=function(e){return ue.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:K(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var on=/%20/g,rn=/\[\]$/,an=/\r?\n/g,ln=/^(?:submit|button|image|reset|file)$/i,cn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,i=[],s=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,(function(){s(this.name,this.value)}));else for(n in e)Y(n,e[n],t,s);return i.join("&").replace(on,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&cn.test(this.nodeName)&&!ln.test(e)&&(this.checked||!Ue.test(e))})).map((function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,(function(e){return{name:t.name,value:e.replace(an,"\r\n")}})):{name:t.name,value:n.replace(an,"\r\n")}})).get()}}),pe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?ee():ie.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||ee()}:Z;var dn=0,un={},hn=pe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",(function(){for(var e in un)un[e](void 0,!0)})),ue.cors=!!hn&&"withCredentials"in hn,(hn=ue.ajax=!!hn)&&pe.ajaxTransport((function(t){var n;if(!t.crossDomain||ue.cors)return{send:function(i,s){var o,r=t.xhr(),a=++dn;if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)r[o]=t.xhrFields[o];for(o in t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)void 0!==i[o]&&r.setRequestHeader(o,i[o]+"");r.send(t.hasContent&&t.data||null),n=function(e,i){var o,l,c;if(n&&(i||4===r.readyState))if(delete un[a],n=void 0,r.onreadystatechange=pe.noop,i)4!==r.readyState&&r.abort();else{c={},o=r.status,"string"==typeof r.responseText&&(c.text=r.responseText);try{l=r.statusText}catch(e){l=""}o||!t.isLocal||t.crossDomain?1223===o&&(o=204):o=c.text?200:404}c&&s(o,l,c,r.getAllResponseHeaders())},t.async?4===r.readyState?e.setTimeout(n):r.onreadystatechange=un[a]=n:n()},abort:function(){n&&n(void 0,!0)}}})),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)})),pe.ajaxTransport("script",(function(e){if(e.crossDomain){var t,n=ie.head||pe("head")[0]||ie.documentElement;return{send:function(i,s){(t=ie.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||s(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}}));var pn=[],fn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=pn.pop()||pe.expando+"_"+Ut++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",(function(t,n,i){var s,o,r,a=!1!==t.jsonp&&(fn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&fn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return s=t.jsonpCallback=pe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(fn,"$1"+s):!1!==t.jsonp&&(t.url+=(zt.test(t.url)?"&":"?")+t.jsonp+"="+s),t.converters["script json"]=function(){return r||pe.error(s+" was not called"),r[0]},t.dataTypes[0]="json",o=e[s],e[s]=function(){r=arguments},i.always((function(){void 0===o?pe(e).removeProp(s):e[s]=o,t[s]&&(t.jsonpCallback=n.jsonpCallback,pn.push(s)),r&&pe.isFunction(o)&&o(r[0]),r=o=void 0})),"script"})),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||ie;var i=Ee.exec(e),s=!n&&[];return i?[t.createElement(i[1])]:(i=g([e],t,s),s&&s.length&&pe(s).remove(),pe.merge([],i.childNodes))};var mn=pe.fn.load;pe.fn.load=function(e,t,n){if("string"!=typeof e&&mn)return mn.apply(this,arguments);var i,s,o,r=this,a=e.indexOf(" ");return a>-1&&(i=pe.trim(e.slice(a,e.length)),e=e.slice(0,a)),pe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(s="POST"),r.length>0&&pe.ajax({url:e,type:s||"GET",dataType:"html",data:t}).done((function(e){o=arguments,r.html(i?pe("
").append(pe.parseHTML(e)).find(i):e)})).always(n&&function(e,t){r.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){pe.fn[t]=function(e){return this.on(t,e)}})),pe.expr.filters.animated=function(e){return pe.grep(pe.timers,(function(t){return e===t.elem})).length},pe.offset={setOffset:function(e,t,n){var i,s,o,r,a,l,c=pe.css(e,"position"),d=pe(e),u={};"static"===c&&(e.style.position="relative"),a=d.offset(),o=pe.css(e,"top"),l=pe.css(e,"left"),("absolute"===c||"fixed"===c)&&pe.inArray("auto",[o,l])>-1?(r=(i=d.position()).top,s=i.left):(r=parseFloat(o)||0,s=parseFloat(l)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},a))),null!=t.top&&(u.top=t.top-a.top+r),null!=t.left&&(u.left=t.left-a.left+s),"using"in t?t.using.call(e,u):d.css(u)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){pe.offset.setOffset(this,e,t)}));var t,n,i={top:0,left:0},s=this[0],o=s&&s.ownerDocument;return o?(t=o.documentElement,pe.contains(t,s)?(void 0!==s.getBoundingClientRect&&(i=s.getBoundingClientRect()),n=te(o),{top:i.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):i):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},i=this[0];return"fixed"===pe.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(i,"marginTop",!0),left:t.left-n.left-pe.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||mt}))}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n=/Y/.test(t);pe.fn[e]=function(i){return qe(this,(function(e,i,s){var o=te(e);if(void 0===s)return o?t in o?o[t]:o.document.documentElement[i]:e[i];o?o.scrollTo(n?pe(o).scrollLeft():s,n?s:pe(o).scrollTop()):e[i]=s}),e,i,arguments.length,null)}})),pe.each(["top","left"],(function(e,t){pe.cssHooks[t]=A(ue.pixelPosition,(function(e,n){if(n)return n=gt(e,t),pt.test(n)?pe(e).position()[t]+"px":n}))})),pe.each({Height:"height",Width:"width"},(function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,i){pe.fn[i]=function(i,s){var o=arguments.length&&(n||"boolean"!=typeof i),r=n||(!0===i||!0===s?"margin":"border");return qe(this,(function(t,n,i){var s;return pe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===i?pe.css(t,n,r):pe.style(t,n,i,r)}),t,o?i:void 0,o,null)}}))})),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],(function(){return pe}));var _n=e.jQuery,gn=e.$;return pe.noConflict=function(t){return e.$===pe&&(e.$=gn),t&&e.jQuery===pe&&(e.jQuery=_n),pe}, t||(e.jQuery=e.$=pe),pe})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}((function(e){"use strict";return e.ui=e.ui||{},e.ui.version="1.13.0"})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./version"],e):e(jQuery)}((function(e){"use strict";return e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./version"],e):e(jQuery)}((function(e){"use strict";var t,n=0,i=Array.prototype.hasOwnProperty,s=Array.prototype.slice;return e.cleanData=(t=e.cleanData,function(n){var i,s,o;for(o=0;null!=(s=n[o]);o++)(i=e._data(s,"events"))&&i.remove&&e(s).triggerHandler("remove");t(n)}),e.widget=function(t,n,i){var s,o,r,a={},l=t.split(".")[0],c=l+"-"+(t=t.split(".")[1]);return i||(i=n,n=e.Widget),Array.isArray(i)&&(i=e.extend.apply(null,[{}].concat(i))),e.expr.pseudos[c.toLowerCase()]=function(t){return!!e.data(t,c)},e[l]=e[l]||{},s=e[l][t],o=e[l][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),(r=new n).options=e.widget.extend({},r.options),e.each(i,(function(e,t){a[e]="function"==typeof t?function(){function i(){return n.prototype[e].apply(this,arguments)}function s(t){return n.prototype[e].apply(this,t)}return function(){var e,n=this._super,o=this._superApply;return this._super=i,this._superApply=s,e=t.apply(this,arguments),this._super=n,this._superApply=o,e}}():t})),o.prototype=e.widget.extend(r,{widgetEventPrefix:s&&r.widgetEventPrefix||t},a,{constructor:o,namespace:l,widgetName:t,widgetFullName:c}),s?(e.each(s._childConstructors,(function(t,n){var i=n.prototype;e.widget(i.namespace+"."+i.widgetName,o,n._proto)})),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var n,o,r=s.call(arguments,1),a=0,l=r.length;a",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,n){t._removeClass(n,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var i,s,o,r=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(r={},i=t.split("."),t=i.shift(),i.length){for(s=r[t]=e.widget.extend({},this.options[t]),o=0;o=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./version"],e):e(jQuery)}((function(e){"use strict";return e.extend(e.expr.pseudos,{data:e.expr.createPseudo?e.expr.createPseudo((function(t){return function(n){return!!e.data(n,t)}})):function(t,n,i){return!!e.data(t,i[3])}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./version"],e):e(jQuery)}((function(e){"use strict";return e.fn.scrollParent=function(t){var n=this.css("position"),i="absolute"===n,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter((function(){var t=e(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))})).eq(0);return"fixed"!==n&&o.length?o:e(this[0].ownerDocument||document)}})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","../data","../ie","../scroll-parent","../version","../widget"],e):e(jQuery)}((function(e){"use strict";return e.widget("ui.sortable",e.ui.mouse,{version:"1.13.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,n){return e>=t&&e=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,n){var i=null,s=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),e(t.target).parents().each((function(){if(e.data(this,o.widgetName+"-item")===o)return i=e(this),!1})),e.data(t.target,o.widgetName+"-item")===o&&(i=e(t.target)),!!i&&(!(this.options.handle&&!n&&(e(this.options.handle,i).find("*").addBack().each((function(){this===t.target&&(s=!0)})),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,n,i){var s,o,r=this.options;if(this.currentContainer=this,this.refreshPositions(),this.appendTo=e("parent"!==r.appendTo?r.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),e.extend(this.offset,{parent:this._getParentOffset()}),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",r.cursor),this.storedStylesheet=e("").appendTo(o)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!r.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(e){var t=this.options,n=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;n--)if(s=(i=this.items[n]).item[0],(o=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===s||e.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],s))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var i=this,s=this.placeholder.offset(),o=this.options.axis,r={};o&&"x"!==o||(r.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(r.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(r,parseInt(this.options.revert,10)||500,(function(){i._clear(t)}))}else this._clear(t,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new e.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e(n).each((function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&i.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))})),!i.length&&t.key&&i.push(t.key+"="),i.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},n.each((function(){i.push(e(t.item||this).attr(t.attribute||"id")||"")})),i},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,i=this.positionAbs.top,s=i+this.helperProportions.height,o=e.left,r=o+e.width,a=e.top,l=a+e.height,c=this.offset.click.top,d=this.offset.click.left,u="x"===this.options.axis||i+c>a&&i+co&&t+de[this.floating?"width":"height"]?p:o0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function n(){a.push(this)}var i,s,o,r,a=[],l=[],c=this._connectWith();if(c&&t)for(i=c.length-1;i>=0;i--)for(s=(o=e(c[i],this.document[0])).length-1;s>=0;s--)(r=e.data(o[s],this.widgetFullName))&&r!==this&&!r.options.disabled&&l.push(["function"==typeof r.options.items?r.options.items.call(r.element):e(r.options.items,r.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),r]);for(l.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=l.length-1;i>=0;i--)l[i][0].each(n);return e(a)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,(function(e){for(var n=0;n=0;n--)for(i=(s=e(h[n],this.document[0])).length-1;i>=0;i--)(o=e.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&(u.push(["function"==typeof o.options.items?o.options.items.call(o.element[0],t,{item:this.currentItem}):e(o.options.items,o.element),o]),this.containers.push(o));for(n=u.length-1;n>=0;n--)for(r=u[n][1],i=0,c=(a=u[n][0]).length;i=0;n--)i=this.items[n],this.currentContainer&&i.instance!==this.currentContainer&&i.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?e(this.options.toleranceElement,i.item):i.item,t||(i.width=s.outerWidth(),i.height=s.outerHeight()),o=s.offset(),i.left=o.left,i.top=o.top)},refreshPositions:function(e){var t,n;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),null!==this.innermostContainer&&this._refreshItemPositions(e),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(t=this.containers.length-1;t>=0;t--)n=this.containers[t].element.offset(),this.containers[t].containerCache.left=n.left,this.containers[t].containerCache.top=n.top,this.containers[t].containerCache.width=this.containers[t].element.outerWidth(),this.containers[t].containerCache.height=this.containers[t].element.outerHeight();return this},_createPlaceholder:function(t){var n,i,s=(t=t||this).options;s.placeholder&&s.placeholder.constructor!==String||(n=s.placeholder,i=t.currentItem[0].nodeName.toLowerCase(),s.placeholder={element:function(){var s=e("<"+i+">",t.document[0]);return t._addClass(s,"ui-sortable-placeholder",n||t.currentItem[0].className)._removeClass(s,"ui-sortable-helper"),"tbody"===i?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("",t.document[0]).appendTo(s)):"tr"===i?t._createTrPlaceholder(t.currentItem,s):"img"===i&&s.attr("src",t.currentItem.attr("src")),n||s.css("visibility","hidden"),s},update:function(e,o){n&&!s.forcePlaceholderSize||(o.height()&&(!s.forcePlaceholderSize||"tbody"!==i&&"tr"!==i)||o.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,n){var i=this;t.children().each((function(){e(" ",i.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}))},_contactContainers:function(t){var n,i,s,o,r,a,l,c,d,u,h=null,p=null;for(n=this.containers.length-1;n>=0;n--)if(!e.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(h&&e.contains(this.containers[n].element[0],h.element[0]))continue;h=this.containers[n],p=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0);if(this.innermostContainer=h,h)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(s=1e4,o=null,r=(d=h.floating||this._isFloating(this.currentItem))?"left":"top",a=d?"width":"height",u=d?"pageX":"pageY",i=this.items.length-1;i>=0;i--)e.contains(this.containers[p].element[0],this.items[i].item[0])&&this.items[i].item[0]!==this.currentItem[0]&&(l=this.items[i].item.offset()[r],c=!1,t[u]-l>this.items[i][a]/2&&(c=!0),Math.abs(t[u]-l)this.containment[2]&&(o=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),s.grid&&(n=this.originalPageY+Math.round((r-this.originalPageY)/s.grid[1])*s.grid[1],r=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-s.grid[1]:n+s.grid[1]:n,i=this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0],o=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-s.grid[0]:i+s.grid[0]:i)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:a.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:a.scrollLeft())}},_rearrange:function(e,t,n,i){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var s=this.counter;this._delay((function(){s===this.counter&&this.refreshPositions(!i)}))},_clear:function(e,t){function n(e,t,n){return function(i){n._trigger(e,i,t._uiHash(t))}}this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&s.push((function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))})),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||s.push((function(e){this._trigger("update",e,this._uiHash())})),this!==this.currentContainer&&(t||(s.push((function(e){this._trigger("remove",e,this._uiHash())})),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)t||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(i=0;i",{size:1}).attr("size")&&e.attrFn,a=e.attr,l=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},d=/^(?:input|button)$/i,u=/^[238]$/,h=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,p=/^(?:checked|selected)$/i;s(e,"attrFn",r||{},"jQuery.attrFn is deprecated"),e.attr=function(t,s,o,l){var c=s.toLowerCase(),f=t&&t.nodeType;return l&&(4>a.length&&i("jQuery.fn.attr( props, pass ) is deprecated"),t&&!u.test(f)&&(r?s in r:e.isFunction(e.fn[s])))?e(t)[s](o):("type"===s&&o!==n&&d.test(t.nodeName)&&t.parentNode&&i("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&h.test(c)&&(e.attrHooks[c]={get:function(t,i){var s,o=e.prop(t,i);return!0===o||"boolean"!=typeof o&&(s=t.getAttributeNode(i))&&!1!==s.nodeValue?i.toLowerCase():n},set:function(t,n,i){var s;return!1===n?e.removeAttr(t,i):((s=e.propFix[i]||i)in t&&(t[s]=!0),t.setAttribute(i,i.toLowerCase())),i}},p.test(c)&&i("jQuery.fn.attr('"+c+"') may use property instead of attribute")),a.call(e,t,s,o))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?l.apply(this,arguments):("input"!==n&&"option"!==n&&i("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var s=(e.nodeName||"").toLowerCase();return"button"===s?c.apply(this,arguments):("input"!==s&&"option"!==s&&i("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var f,m,_=e.fn.init,g=e.parseJSON,v=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,s){var o;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(o=v.exec(e.trim(t)))&&o[0]&&("<"!==t.charAt(0)&&i("$(html) HTML strings must start with '<' character"),o[3]&&i("$(html) HTML text after last tag is ignored"),"#"===o[0].charAt(0)&&(i("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?_.call(this,e.parseHTML(o[2],n,!0),n,s):_.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?g.apply(this,arguments):(i("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(m={},(f=e.uaMatch(navigator.userAgent)).browser&&(m[f.browser]=!0,m.version=f.version),m.chrome?m.webkit=!0:m.webkit&&(m.safari=!0),e.browser=m),s(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(i,s){return s&&s instanceof e&&!(s instanceof t)&&(s=t(s)),e.fn.init.call(this,i,s,n)},t.fn.init.prototype=t.fn;var n=t(document);return i("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var y=e.fn.data;e.fn.data=function(t){var s,o,r=this[0];return!r||"events"!==t||1!==arguments.length||(s=e.data(r,t),o=e._data(r,t),s!==n&&s!==o||o===n)?y.apply(this,arguments):(i("Use of jQuery.fn.data('events') is deprecated"),o)};var C=/\/(java|ecma)script/i,b=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return i("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),b.apply(this,arguments)},e.clean||(e.clean=function(t,s,o,r){s=(s=!(s=s||document).nodeType&&s[0]||s).ownerDocument||s,i("jQuery.clean() is deprecated");var a,l,c,d,u=[];if(e.merge(u,e.buildFragment(t,s).childNodes),o)for(c=function(e){return!e.type||C.test(e.type)?r?r.push(e.parentNode?e.parentNode.removeChild(e):e):o.appendChild(e):n},a=0;null!=(l=u[a]);a++)e.nodeName(l,"script")&&c(l)||(o.appendChild(l),l.getElementsByTagName!==n&&(d=e.grep(e.merge([],l.getElementsByTagName("script")),c),u.splice.apply(u,[a+1,0].concat(d)),a+=d.length));return u});var E=e.event.add,S=e.event.remove,T=e.event.trigger,w=e.fn.toggle,k=e.fn.live,L=e.fn.die,x="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",P=RegExp("\\b(?:"+x+")\\b"),I=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(I.test(t)&&i("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(I,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&s(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,s,o){e!==document&&P.test(t)&&i("AJAX events should be attached to document: "+t),E.call(this,e,A(t||""),n,s,o)},e.event.remove=function(e,t,n,i,s){S.call(this,e,A(t)||"",n,i,s)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return i("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return w.apply(this,arguments);i("jQuery.fn.toggle(handler, handler...) is deprecated");var s=arguments,o=t.guid||e.guid++,r=0,a=function(n){var i=(e._data(this,"lastToggle"+t.guid)||0)%r;return e._data(this,"lastToggle"+t.guid,i+1),n.preventDefault(),s[i].apply(this,arguments)||!1};for(a.guid=o;s.length>r;)s[r++].guid=o;return this.click(a)},e.fn.live=function(t,n,s){return i("jQuery.fn.live() is deprecated"),k?k.apply(this,arguments):(e(this.context).on(t,this.selector,n,s),this)},e.fn.die=function(t,n){return i("jQuery.fn.die() is deprecated"),L?L.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,s){return n||P.test(e)||i("Global events are undocumented and deprecated"),T.call(this,e,t,n||document,s)},e.each(x.split("|"),(function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,(function(){e.event.trigger(n,null,t,!0)})),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}}))}(jQuery,window),function(){"use strict";var e=function(e,t){var n;e.rails!==t&&e.error("jquery-ujs has already been loaded!");var i=e(document);e.rails=n={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form:not([data-turbo=true])",formInputClickSelector:"form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]), textarea[name][required]:not([disabled])",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",csrfToken:function(){return e("meta[name=csrf-token]").attr("content")},csrfParam:function(){return e("meta[name=csrf-param]").attr("content")},CSRFProtection:function(e){var t=n.csrfToken();t&&e.setRequestHeader("X-CSRF-Token",t)},refreshCSRFTokens:function(){e('form input[name="'+n.csrfParam()+'"]').val(n.csrfToken())},fire:function(t,n,i){var s=e.Event(n);return t.trigger(s,i),!1!==s.result},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e[0].href},isRemote:function(e){return e.data("remote")!==t&&!1!==e.data("remote")},handleRemote:function(i){var s,o,r,a,l,c;if(n.fire(i,"ajax:before")){if(a=i.data("with-credentials")||null,l=i.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType,i.is("form")){s=i.data("ujs:submit-button-formmethod")||i.attr("method"),o=i.data("ujs:submit-button-formaction")||i.attr("action"),r=e(i[0]).serializeArray();var d=i.data("ujs:submit-button");d&&(r.push(d),i.data("ujs:submit-button",null)),i.data("ujs:submit-button-formmethod",null),i.data("ujs:submit-button-formaction",null)}else i.is(n.inputChangeSelector)?(s=i.data("method"),o=i.data("url"),r=i.serialize(),i.data("params")&&(r=r+"&"+i.data("params"))):i.is(n.buttonClickSelector)?(s=i.data("method")||"get",o=i.data("url"),r=i.serialize(),i.data("params")&&(r=r+"&"+i.data("params"))):(s=i.data("method"),o=n.href(i),r=i.data("params")||null);return c={type:s||"GET",data:r,dataType:l,beforeSend:function(e,s){if(s.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+s.accepts.script),!n.fire(i,"ajax:beforeSend",[e,s]))return!1;i.trigger("ajax:send",e)},success:function(e,t,n){i.trigger("ajax:success",[e,t,n])},complete:function(e,t){i.trigger("ajax:complete",[e,t])},error:function(e,t,n){i.trigger("ajax:error",[e,t,n])},crossDomain:n.isCrossDomain(o)},a&&(c.xhrFields={withCredentials:a}),o&&(c.url=o),n.ajax(c)}return!1},isCrossDomain:function(e){var t=document.createElement("a");t.href=location.href;var n=document.createElement("a");try{return n.href=e,n.href=n.href,!((!n.protocol||":"===n.protocol)&&!n.host||t.protocol+"//"+t.host==n.protocol+"//"+n.host)}catch(e){return!0}},handleMethod:function(i){var s=n.href(i),o=i.data("method"),r=i.attr("target"),a=n.csrfToken(),l=n.csrfParam(),c=e('
'),d='';l===t||a===t||n.isCrossDomain(s)||(d+=''),r&&c.attr("target",r),c.hide().append(d).appendTo("body"),c.submit()},formElements:function(t,n){return t.is("form")?e(t[0].elements).filter(n):t.find(n)},disableFormElements:function(t){n.formElements(t,n.disableSelector).each((function(){n.disableFormElement(e(this))}))},disableFormElement:function(e){var n,i;n=e.is("button")?"html":"val",(i=e.data("disable-with"))!==t&&(e.data("ujs:enable-with",e[n]()),e[n](i)),e.prop("disabled",!0),e.data("ujs:disabled",!0)},enableFormElements:function(t){n.formElements(t,n.enableSelector).each((function(){n.enableFormElement(e(this))}))},enableFormElement:function(e){var n=e.is("button")?"html":"val";e.data("ujs:enable-with")!==t&&(e[n](e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.prop("disabled",!1),e.removeData("ujs:disabled")},allowAction:function(e){var t,i=e.data("confirm"),s=!1;if(!i)return!0;if(n.fire(e,"confirm")){try{s=n.confirm(i)}catch(e){(console.error||console.log).call(console,e.stack||e)}t=n.fire(e,"confirm:complete",[s])}return s&&t},blankInputs:function(t,n,i){var s,o,r,a=e(),l=n||"input,textarea",c=t.find(l),d={};return c.each((function(){(s=e(this)).is("input[type=radio]")?(r=s.attr("name"),d[r]||(0===t.find('input[type=radio]:checked[name="'+r+'"]').length&&(o=t.find('input[type=radio][name="'+r+'"]'),a=a.add(o)),d[r]=r)):(s.is("input[type=checkbox],input[type=radio]")?s.is(":checked"):!!s.val())===i&&(a=a.add(s))})),!!a.length&&a},nonBlankInputs:function(e,t){return n.blankInputs(e,t,!0)},stopEverything:function(t){return e(t.target).trigger("ujs:everythingStopped"),t.stopImmediatePropagation(),!1},disableElement:function(e){var i=e.data("disable-with");i!==t&&(e.data("ujs:enable-with",e.html()),e.html(i)),e.on("click.railsDisable",(function(e){return n.stopEverything(e)})),e.data("ujs:disabled",!0)},enableElement:function(e){e.data("ujs:enable-with")!==t&&(e.html(e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.off("click.railsDisable"),e.removeData("ujs:disabled")}},n.fire(i,"rails:attachBindings")&&(e.ajaxPrefilter((function(e,t,i){e.crossDomain||n.CSRFProtection(i)})),e(window).on("pageshow.rails",(function(){e(e.rails.enableSelector).each((function(){var t=e(this);t.data("ujs:disabled")&&e.rails.enableFormElement(t)})),e(e.rails.linkDisableSelector).each((function(){var t=e(this);t.data("ujs:disabled")&&e.rails.enableElement(t)}))})),i.on("ajax:complete",n.linkDisableSelector,(function(){n.enableElement(e(this))})),i.on("ajax:complete",n.buttonDisableSelector,(function(){n.enableFormElement(e(this))})),i.on("click.rails",n.linkClickSelector,(function(t){var i=e(this),s=i.data("method"),o=i.data("params"),r=t.metaKey||t.ctrlKey;if(!n.allowAction(i))return n.stopEverything(t);if(!r&&i.is(n.linkDisableSelector)&&n.disableElement(i),n.isRemote(i)){if(r&&(!s||"GET"===s)&&!o)return!0;var a=n.handleRemote(i);return!1===a?n.enableElement(i):a.fail((function(){n.enableElement(i)})),!1}return s?(n.handleMethod(i),!1):void 0})),i.on("click.rails",n.buttonClickSelector,(function(t){var i=e(this);if(!n.allowAction(i)||!n.isRemote(i))return n.stopEverything(t);i.is(n.buttonDisableSelector)&&n.disableFormElement(i);var s=n.handleRemote(i);return!1===s?n.enableFormElement(i):s.fail((function(){n.enableFormElement(i)})),!1})),i.on("change.rails",n.inputChangeSelector,(function(t){var i=e(this);return n.allowAction(i)&&n.isRemote(i)?(n.handleRemote(i),!1):n.stopEverything(t)})),i.on("submit.rails",n.formSubmitSelector,(function(i){var s,o,r=e(this),a=n.isRemote(r);if(!n.allowAction(r))return n.stopEverything(i);if(r.attr("novalidate")===t)if(r.data("ujs:formnovalidate-button")===t){if((s=n.blankInputs(r,n.requiredInputSelector,!1))&&n.fire(r,"ajax:aborted:required",[s]))return n.stopEverything(i)}else r.data("ujs:formnovalidate-button",t);if(a){if(o=n.nonBlankInputs(r,n.fileInputSelector)){setTimeout((function(){n.disableFormElements(r)}),13);var l=n.fire(r,"ajax:aborted:file",[o]);return l||setTimeout((function(){n.enableFormElements(r)}),13),l}return n.handleRemote(r),!1}setTimeout((function(){n.disableFormElements(r)}),13)})),i.on("click.rails",n.formInputClickSelector,(function(t){var i=e(this);if(!n.allowAction(i))return n.stopEverything(t);var s=i.attr("name"),o=s?{name:s,value:i.val()}:null,r=i.closest("form");0===r.length&&(r=e("#"+i.attr("form"))),r.data("ujs:submit-button",o),r.data("ujs:formnovalidate-button",i.attr("formnovalidate")),r.data("ujs:submit-button-formaction",i.attr("formaction")),r.data("ujs:submit-button-formmethod",i.attr("formmethod"))})),i.on("ajax:send.rails",n.formSubmitSelector,(function(t){this===t.target&&n.disableFormElements(e(this))})),i.on("ajax:complete.rails",n.formSubmitSelector,(function(t){this===t.target&&n.enableFormElements(e(this))})),e((function(){n.refreshCSRFTokens()})))};window.jQuery?e(jQuery):"object"==typeof exports&&"object"==typeof module&&(module.exports=e)}(),function(e){var t=!1;if("function"==typeof define&&define.amd&&(define(e),t=!0),"object"==typeof exports&&(module.exports=e(),t=!0),!t){var n=window.Cookies,i=window.Cookies=e();i.noConflict=function(){return window.Cookies=n,i}}}((function(){function e(){for(var e=0,t={};e1){if("number"==typeof(o=e({path:"/"},i.defaults,o)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*o.expires),o.expires=a}o.expires=o.expires?o.expires.toUTCString():"";try{r=JSON.stringify(s),/^[\{\[]/.test(r)&&(s=r)}catch(e){}s=n.write?n.write(s,t):encodeURIComponent(String(s)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var l="";for(var c in o)o[c]&&(l+="; "+c,!0!==o[c]&&(l+="="+o[c]));return document.cookie=t+"="+s+l}t||(r={});for(var d=document.cookie?document.cookie.split("; "):[],u=/(%[0-9A-Z]{2})+/g,h=0;h35?String.fromCharCode(e+29):e.toString(36))},!"".replace(/^/,String)){for(;n--;)o[s(n)]=i[n]||s(n);i=[function(e){return o[e]}],s=function(){return"\\w+"},n=1}for(;n--;)i[n]&&(e=e.replace(new RegExp("\\b"+s(n)+"\\b","g"),i[n]));return e}("h.i['1a']=h.i['z'];h.O(h.i,{y:'D',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t').insertAfter(s)),s.bind("reveal:open",(function(){var c=parseInt(s.css("width"),10)/2*-1;l.unbind("click.modalEvent"),e("."+t.dismissmodalclass).unbind("click.modalEvent"),a||(i(),"fadeAndPop"==t.animation&&(s.css({top:e(document).scrollTop()-r,opacity:0,visibility:"visible",left:"50%"}),l.fadeIn(t.animationspeed/2),s.delay(t.animationspeed/2).animate({top:e(document).scrollTop()+o+"px",opacity:1},t.animationspeed,n())),"fade"==t.animation&&(s.css({opacity:0,visibility:"visible",top:e(document).scrollTop()+o,left:"50%","margin-left":c}),l.fadeIn(t.animationspeed/2),s.delay(t.animationspeed/2).animate({opacity:1},t.animationspeed,n())),"none"==t.animation&&(s.css({visibility:"visible",top:e(document).scrollTop()+o}),l.css({display:"block"}),n())),s.unbind("reveal:open")})),s.bind("reveal:close",(function(){a||(i(),"fadeAndPop"==t.animation&&(l.delay(t.animationspeed).fadeOut(t.animationspeed),s.animate({top:e(document).scrollTop()-r+"px",opacity:0},t.animationspeed/2,(function(){s.css({top:o,opacity:1,visibility:"hidden"}),n()}))),"fade"==t.animation&&(l.delay(t.animationspeed).fadeOut(t.animationspeed),s.animate({opacity:0},t.animationspeed,(function(){s.css({opacity:1,visibility:"hidden",top:o}),n()}))),"none"==t.animation&&(s.css({visibility:"hidden",top:o}),l.css({display:"none"}))),s.unbind("reveal:close")})),s.trigger("reveal:open");e("."+t.dismissmodalclass).bind("click.modalEvent",(function(){s.trigger("reveal:close")}));t.closeonbackgroundclick&&(l.css({cursor:"pointer"}),l.bind("click.modalEvent",(function(){s.trigger("reveal:close"),e("body").removeClass("modal-block__no-scroll")}))),e("body").keyup((function(e){27===e.which&&s.trigger("reveal:close")}))}))}}(jQuery),function(e){e.fn.unveil=function(t,n){function i(){var t=l.filter((function(){var t=e(this);if(!t.is(":hidden")){var n=o.scrollTop(),i=n+o.height(),s=t.offset().top;return s+t.height()>=n-r&&s<=i+r}}));s=t.trigger("unveil"),l=l.not(s)}var s,o=e(window),r=t||0,a=window.devicePixelRatio>1?"data-src-retina":"data-src",l=this;return this.one("unveil",(function(){var t=this.getAttribute(a),i=e(this).width()*window.devicePixelRatio,s=e(this).data("srcs");if(s){s=String(s);var o=null;e.each(s.split(","),(function(e,t){(t=parseInt(t))>i&&(!o||t',e,""].join(""),c.id=m,(d?c:u).innerHTML+=o,u.appendChild(c),d||(u.style.background="",u.style.overflow="hidden",l=f.style.overflow,f.style.overflow="hidden",f.appendChild(u)),r=n(c,e),d?c.parentNode.removeChild(c):(u.parentNode.removeChild(u),f.style.overflow=l),!!r},k={}.hasOwnProperty;for(var L in d=s(k,"undefined")||s(k.call,"undefined")?function(e,t){return t in e&&s(e.constructor.prototype[t],"undefined")}:function(e,t){return k.call(e,t)},Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError;var n=T.call(arguments,1),i=function(){if(this instanceof i){var s=function(){};s.prototype=t.prototype;var o=new s,r=t.apply(o,n.concat(T.call(arguments)));return Object(r)===r?r:o}return t.apply(e,n.concat(T.call(arguments)))};return i}),E.touch=function(){var n;return"ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch?n=!0:w(["@media (",v.join("touch-enabled),("),m,")","{#modernizr{top:9px;position:absolute}}"].join(""),(function(e){n=9===e.offsetTop})),n},E.csstransforms=function(){return!!l("transform")},E.csstransitions=function(){return l("transition")},E)d(E,L)&&(c=L.toLowerCase(),h[c]=E[L](),S.push((h[c]?"":"no-")+c));return h.addTest=function(e,t){if("object"==typeof e)for(var i in e)d(e,i)&&h.addTest(i,e[i]);else{if(e=e.toLowerCase(),h[e]!==n)return h;t="function"==typeof t?t():t,void 0!==p&&p&&(f.className+=" "+(t?"":"no-")+e),h[e]=t}return h},i(""),_=null,function(e,t){function n(e,t){var n=e.createElement("p"),i=e.getElementsByTagName("head")[0]||e.documentElement;return n.innerHTML="x",i.insertBefore(n.lastChild,i.firstChild)}function i(){var e=g.elements;return"string"==typeof e?e.split(" "):e}function s(e){var t=_[e[f]];return t||(t={},m++,e[f]=m,_[m]=t),t}function o(e,n,i){return n||(n=t),d?n.createElement(e):(i||(i=s(n)),(o=i.cache[e]?i.cache[e].cloneNode():p.test(e)?(i.cache[e]=i.createElem(e)).cloneNode():i.createElem(e)).canHaveChildren&&!h.test(e)?i.frag.appendChild(o):o);var o}function r(e,n){if(e||(e=t),d)return e.createDocumentFragment();for(var o=(n=n||s(e)).frag.cloneNode(),r=0,a=i(),l=a.length;r",c="hidden"in e,d=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return void 0===e.cloneNode||void 0===e.createDocumentFragment||void 0===e.createElement}()}catch(e){c=!0,d=!0}}();var g={elements:u.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:!1!==u.shivCSS,supportsUnknownElements:d,shivMethods:!1!==u.shivMethods,type:"default",shivDocument:l,createElement:o,createDocumentFragment:r};e.html5=g,l(t)}(this,t),h._version=u,h._prefixes=v,h._domPrefixes=b,h._cssomPrefixes=C,h.testProp=function(e){return r([e])},h.testAllProps=l,h.testStyles=w,h.prefixed=function(e,t,n){return t?l(e,t,n):l(e,"pfx")},f.className=f.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" js "+S.join(" "):""),h}(this,this.document),function(e,t,n){function i(e){return"[object Function]"==_.call(e)}function s(e){return"string"==typeof e}function o(){}function r(e){return!e||"loaded"==e||"complete"==e||"uninitialized"==e}function a(){var e=g.shift();v=1,e?e.t?f((function(){("c"==e.t?h.injectCss:h.injectJs)(e.s,0,e.a,e.x,e.e,1)}),0):(e(),a()):v=0}function l(e,n,i,s,o,l,c){function d(t){if(!p&&r(u.readyState)&&(y.r=p=1,!v&&a(),u.onload=u.onreadystatechange=null,t))for(var i in"img"!=e&&f((function(){b.removeChild(u)}),50),k[n])k[n].hasOwnProperty(i)&&k[n][i].onload()}c=c||h.errorTimeout;var u=t.createElement(e),p=0,_=0,y={t:i,s:n,e:o,a:l,x:c};1===k[n]&&(_=1,k[n]=[]),"object"==e?u.data=n:(u.src=n,u.type=e),u.width=u.height="0",u.onerror=u.onload=u.onreadystatechange=function(){d.call(this,_)},g.splice(s,0,y),"img"!=e&&(_||2===k[n]?(b.insertBefore(u,C?null:m),f(d,c)):k[n].push(u))}function c(e,t,n,i,o){return v=0,t=t||"j",s(e)?l("c"==t?S:E,e,t,this.i++,n,i,o):(g.splice(this.i++,0,e),1==g.length&&a()),this}function d(){var e=h;return e.loader={load:c,i:0},e}var u,h,p=t.documentElement,f=e.setTimeout,m=t.getElementsByTagName("script")[0],_={}.toString,g=[],v=0,y="MozAppearance"in p.style,C=y&&!!t.createRange().compareNode,b=C?p:m.parentNode,E=(p=e.opera&&"[object Opera]"==_.call(e.opera),p=!!t.attachEvent&&!p,y?"object":p?"script":"img"),S=p?"script":E,T=Array.isArray||function(e){return"[object Array]"==_.call(e)},w=[],k={},L={timeout:function(e,t){return t.length&&(e.timeout=t[0]),e}};h=function(e){function t(e){e=e.split("!");var t,n,i,s=w.length,o=e.pop(),r=e.length;o={url:o,origUrl:o,prefixes:e};for(n=0;n0&&r(t.children))}function a(t){var n=!0;void 0===t.widget&&void 0===t.widget||(n=t.widget||t.widget);var i={classConstructor:t.constructor||t.constructor,className:t.classAsString||t.classAsString,cssClass:t.cssClass||t.cssClass,widget:n,callbacks:[]};if(h.forEach((function(e){if(e.cssClass===i.cssClass)throw new Error("The provided cssClass has already been registered: "+e.cssClass);if(e.className===i.className)throw new Error("The provided className has already been registered")})),t.constructor.prototype.hasOwnProperty(f))throw new Error("MDL component classes must not have "+f+" defined as a property.");e(t.classAsString,i)||h.push(i)}function l(t,n){var i=e(t);i&&i.callbacks.push(n)}function c(){for(var e=0;e0&&this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)&&(e.keyCode===this.Keycodes_.UP_ARROW?(e.preventDefault(),t[t.length-1].focus()):e.keyCode===this.Keycodes_.DOWN_ARROW&&(e.preventDefault(),t[0].focus()))}},d.prototype.handleItemKeyboardEvent_=function(e){if(this.element_&&this.container_){var t=this.element_.querySelectorAll("."+this.CssClasses_.ITEM+":not([disabled])");if(t&&t.length>0&&this.container_.classList.contains(this.CssClasses_.IS_VISIBLE)){var n=Array.prototype.slice.call(t).indexOf(e.target);if(e.keyCode===this.Keycodes_.UP_ARROW)e.preventDefault(),n>0?t[n-1].focus():t[t.length-1].focus();else if(e.keyCode===this.Keycodes_.DOWN_ARROW)e.preventDefault(),t.length>n+1?t[n+1].focus():t[0].focus();else if(e.keyCode===this.Keycodes_.SPACE||e.keyCode===this.Keycodes_.ENTER){e.preventDefault();var i=new MouseEvent("mousedown");e.target.dispatchEvent(i),i=new MouseEvent("mouseup"),e.target.dispatchEvent(i),e.target.click()}else e.keyCode===this.Keycodes_.ESCAPE&&(e.preventDefault(),this.hide())}}},d.prototype.handleItemClick_=function(e){e.target.hasAttribute("disabled")?e.stopPropagation():(this.closing_=!0,window.setTimeout(function(){this.hide(),this.closing_=!1}.bind(this),this.Constant_.CLOSE_TIMEOUT))},d.prototype.applyClip_=function(e,t){this.element_.classList.contains(this.CssClasses_.UNALIGNED)?this.element_.style.clip="":this.element_.classList.contains(this.CssClasses_.BOTTOM_RIGHT)?this.element_.style.clip="rect(0 "+t+"px 0 "+t+"px)":this.element_.classList.contains(this.CssClasses_.TOP_LEFT)?this.element_.style.clip="rect("+e+"px 0 "+e+"px 0)":this.element_.classList.contains(this.CssClasses_.TOP_RIGHT)?this.element_.style.clip="rect("+e+"px "+t+"px "+e+"px "+t+"px)":this.element_.style.clip=""},d.prototype.removeAnimationEndListener_=function(e){e.target.classList.remove(d.prototype.CssClasses_.IS_ANIMATING)},d.prototype.addAnimationEndListener_=function(){this.element_.addEventListener("transitionend",this.removeAnimationEndListener_),this.element_.addEventListener("webkitTransitionEnd",this.removeAnimationEndListener_)},d.prototype.show=function(e){if(this.element_&&this.container_&&this.outline_){var t=this.element_.getBoundingClientRect().height,n=this.element_.getBoundingClientRect().width;this.container_.style.width=n+"px",this.container_.style.height=t+"px",this.outline_.style.width=n+"px",this.outline_.style.height=t+"px";for(var i=this.Constant_.TRANSITION_DURATION_SECONDS*this.Constant_.TRANSITION_DURATION_FRACTION,s=this.element_.querySelectorAll("."+this.CssClasses_.ITEM),o=0;o0&&this.showSnackbar(this.queuedNotifications_.shift())},f.prototype.cleanup_=function(){this.element_.classList.remove(this.cssClasses_.ACTIVE),setTimeout(function(){this.element_.setAttribute("aria-hidden","true"),this.textElement_.textContent="",Boolean(this.actionElement_.getAttribute("aria-hidden"))||(this.setActionHidden_(!0),this.actionElement_.textContent="",this.actionElement_.removeEventListener("click",this.actionHandler_)),this.actionHandler_=void 0,this.message_=void 0,this.actionText_=void 0,this.active=!1,this.checkQueue_()}.bind(this),this.Constant_.ANIMATION_LENGTH)},f.prototype.setActionHidden_=function(e){e?this.actionElement_.setAttribute("aria-hidden","true"):this.actionElement_.removeAttribute("aria-hidden")},n.register({constructor:f,classAsString:"MaterialSnackbar",cssClass:"mdl-js-snackbar",widget:!0});var m=function(e){this.element_=e,this.init()};window.MaterialSpinner=m,m.prototype.Constant_={MDL_SPINNER_LAYER_COUNT:4},m.prototype.CssClasses_={MDL_SPINNER_LAYER:"mdl-spinner__layer",MDL_SPINNER_CIRCLE_CLIPPER:"mdl-spinner__circle-clipper",MDL_SPINNER_CIRCLE:"mdl-spinner__circle",MDL_SPINNER_GAP_PATCH:"mdl-spinner__gap-patch",MDL_SPINNER_LEFT:"mdl-spinner__left",MDL_SPINNER_RIGHT:"mdl-spinner__right"},m.prototype.createLayer=function(e){var t=document.createElement("div");t.classList.add(this.CssClasses_.MDL_SPINNER_LAYER),t.classList.add(this.CssClasses_.MDL_SPINNER_LAYER+"-"+e);var n=document.createElement("div");n.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER),n.classList.add(this.CssClasses_.MDL_SPINNER_LEFT);var i=document.createElement("div");i.classList.add(this.CssClasses_.MDL_SPINNER_GAP_PATCH);var s=document.createElement("div");s.classList.add(this.CssClasses_.MDL_SPINNER_CIRCLE_CLIPPER),s.classList.add(this.CssClasses_.MDL_SPINNER_RIGHT);for(var o=[n,i,s],r=0;r=this.maxRows&&e.preventDefault()},v.prototype.onFocus_=function(){this.element_.classList.add(this.CssClasses_.IS_FOCUSED)},v.prototype.onBlur_=function(){this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},v.prototype.onReset_=function(){this.updateClasses_()},v.prototype.updateClasses_=function(){this.checkDisabled(),this.checkValidity(),this.checkDirty(),this.checkFocus()},v.prototype.checkDisabled=function(){this.input_.disabled?this.element_.classList.add(this.CssClasses_.IS_DISABLED):this.element_.classList.remove(this.CssClasses_.IS_DISABLED)},v.prototype.checkDisabled=v.prototype.checkDisabled,v.prototype.checkFocus=function(){Boolean(this.element_.querySelector(":focus"))?this.element_.classList.add(this.CssClasses_.IS_FOCUSED):this.element_.classList.remove(this.CssClasses_.IS_FOCUSED)},v.prototype.checkFocus=v.prototype.checkFocus,v.prototype.checkValidity=function(){this.input_.validity&&(this.input_.validity.valid?this.element_.classList.remove(this.CssClasses_.IS_INVALID):this.element_.classList.add(this.CssClasses_.IS_INVALID))},v.prototype.checkValidity=v.prototype.checkValidity,v.prototype.checkDirty=function(){this.input_.value&&this.input_.value.length>0?this.element_.classList.add(this.CssClasses_.IS_DIRTY):this.element_.classList.remove(this.CssClasses_.IS_DIRTY)},v.prototype.checkDirty=v.prototype.checkDirty,v.prototype.disable=function(){this.input_.disabled=!0,this.updateClasses_()},v.prototype.disable=v.prototype.disable,v.prototype.enable=function(){this.input_.disabled=!1,this.updateClasses_()},v.prototype.enable=v.prototype.enable,v.prototype.change=function(e){this.input_.value=e||"",this.updateClasses_()},v.prototype.change=v.prototype.change,v.prototype.init=function(){if(this.element_&&(this.label_=this.element_.querySelector("."+this.CssClasses_.LABEL),this.input_=this.element_.querySelector("."+this.CssClasses_.INPUT),this.input_)){this.input_.hasAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE)&&(this.maxRows=parseInt(this.input_.getAttribute(this.Constant_.MAX_ROWS_ATTRIBUTE),10),isNaN(this.maxRows)&&(this.maxRows=this.Constant_.NO_MAX_ROWS)),this.input_.hasAttribute("placeholder")&&this.element_.classList.add(this.CssClasses_.HAS_PLACEHOLDER),this.boundUpdateClassesHandler=this.updateClasses_.bind(this),this.boundFocusHandler=this.onFocus_.bind(this),this.boundBlurHandler=this.onBlur_.bind(this),this.boundResetHandler=this.onReset_.bind(this),this.input_.addEventListener("input",this.boundUpdateClassesHandler),this.input_.addEventListener("focus",this.boundFocusHandler),this.input_.addEventListener("blur",this.boundBlurHandler),this.input_.addEventListener("reset",this.boundResetHandler),this.maxRows!==this.Constant_.NO_MAX_ROWS&&(this.boundKeyDownHandler=this.onKeyDown_.bind(this),this.input_.addEventListener("keydown",this.boundKeyDownHandler));var e=this.element_.classList.contains(this.CssClasses_.IS_INVALID);this.updateClasses_(),this.element_.classList.add(this.CssClasses_.IS_UPGRADED),e&&this.element_.classList.add(this.CssClasses_.IS_INVALID),this.input_.hasAttribute("autofocus")&&(this.element_.focus(),this.checkFocus())}},n.register({constructor:v,classAsString:"MaterialTextfield",cssClass:"mdl-js-textfield",widget:!0});var y=function(e){this.element_=e,this.init()};window.MaterialTooltip=y,y.prototype.Constant_={},y.prototype.CssClasses_={IS_ACTIVE:"is-active",BOTTOM:"mdl-tooltip--bottom",LEFT:"mdl-tooltip--left",RIGHT:"mdl-tooltip--right",TOP:"mdl-tooltip--top"},y.prototype.handleMouseEnter_=function(e){var t=e.target.getBoundingClientRect(),n=t.left+t.width/2,i=t.top+t.height/2,s=this.element_.offsetWidth/2*-1,o=this.element_.offsetHeight/2*-1;this.element_.classList.contains(this.CssClasses_.LEFT)||this.element_.classList.contains(this.CssClasses_.RIGHT)?(n=t.width/2,i+o<0?(this.element_.style.top="0",this.element_.style.marginTop="0"):(this.element_.style.top=i+"px",this.element_.style.marginTop=o+"px")):n+s<0?(this.element_.style.left="0",this.element_.style.marginLeft="0"):(this.element_.style.left=n+"px",this.element_.style.marginLeft=s+"px"),this.element_.classList.contains(this.CssClasses_.TOP)?this.element_.style.top=t.top-this.element_.offsetHeight-10+"px":this.element_.classList.contains(this.CssClasses_.RIGHT)?this.element_.style.left=t.left+t.width+10+"px":this.element_.classList.contains(this.CssClasses_.LEFT)?this.element_.style.left=t.left-this.element_.offsetWidth-10+"px":this.element_.style.top=t.top+t.height+10+"px",this.element_.classList.add(this.CssClasses_.IS_ACTIVE)},y.prototype.hideTooltip_=function(){this.element_.classList.remove(this.CssClasses_.IS_ACTIVE)},y.prototype.init=function(){if(this.element_){var e=this.element_.getAttribute("for")||this.element_.getAttribute("data-mdl-for");e&&(this.forElement_=document.getElementById(e)),this.forElement_&&(this.forElement_.hasAttribute("tabindex")||this.forElement_.setAttribute("tabindex","0"),this.boundMouseEnterHandler=this.handleMouseEnter_.bind(this),this.boundMouseLeaveAndScrollHandler=this.hideTooltip_.bind(this),this.forElement_.addEventListener("mouseenter",this.boundMouseEnterHandler,!1),this.forElement_.addEventListener("touchend",this.boundMouseEnterHandler,!1),this.forElement_.addEventListener("mouseleave",this.boundMouseLeaveAndScrollHandler,!1),window.addEventListener("scroll",this.boundMouseLeaveAndScrollHandler,!0),window.addEventListener("touchstart",this.boundMouseLeaveAndScrollHandler))}},n.register({constructor:y,classAsString:"MaterialTooltip",cssClass:"mdl-tooltip"});var C=function(e){this.element_=e,this.init()};window.MaterialLayout=C,C.prototype.Constant_={MAX_WIDTH:"(max-width: 1024px)",TAB_SCROLL_PIXELS:100,RESIZE_TIMEOUT:100,MENU_ICON:"",CHEVRON_LEFT:"chevron_left",CHEVRON_RIGHT:"chevron_right"},C.prototype.Keycodes_={ENTER:13,ESCAPE:27,SPACE:32},C.prototype.Mode_={STANDARD:0,SEAMED:1,WATERFALL:2,SCROLL:3},C.prototype.CssClasses_={CONTAINER:"mdl-layout__container",HEADER:"mdl-layout__header",DRAWER:"mdl-layout__drawer",CONTENT:"mdl-layout__content",DRAWER_BTN:"mdl-layout__drawer-button",ICON:"material-icons",JS_RIPPLE_EFFECT:"mdl-js-ripple-effect",RIPPLE_CONTAINER:"mdl-layout__tab-ripple-container",RIPPLE:"mdl-ripple",RIPPLE_IGNORE_EVENTS:"mdl-js-ripple-effect--ignore-events",HEADER_SEAMED:"mdl-layout__header--seamed",HEADER_WATERFALL:"mdl-layout__header--waterfall",HEADER_SCROLL:"mdl-layout__header--scroll",FIXED_HEADER:"mdl-layout--fixed-header",OBFUSCATOR:"mdl-layout__obfuscator",TAB_BAR:"mdl-layout__tab-bar",TAB_CONTAINER:"mdl-layout__tab-bar-container",TAB:"mdl-layout__tab",TAB_BAR_BUTTON:"mdl-layout__tab-bar-button",TAB_BAR_LEFT_BUTTON:"mdl-layout__tab-bar-left-button",TAB_BAR_RIGHT_BUTTON:"mdl-layout__tab-bar-right-button",TAB_MANUAL_SWITCH:"mdl-layout__tab-manual-switch",PANEL:"mdl-layout__tab-panel",HAS_DRAWER:"has-drawer",HAS_TABS:"has-tabs",HAS_SCROLLING_HEADER:"has-scrolling-header",CASTING_SHADOW:"is-casting-shadow",IS_COMPACT:"is-compact",IS_SMALL_SCREEN:"is-small-screen",IS_DRAWER_OPEN:"is-visible",IS_ACTIVE:"is-active",IS_UPGRADED:"is-upgraded",IS_ANIMATING:"is-animating",ON_LARGE_SCREEN:"mdl-layout--large-screen-only",ON_SMALL_SCREEN:"mdl-layout--small-screen-only"},C.prototype.contentScrollHandler_=function(){if(!this.header_.classList.contains(this.CssClasses_.IS_ANIMATING)){var e=!this.element_.classList.contains(this.CssClasses_.IS_SMALL_SCREEN)||this.element_.classList.contains(this.CssClasses_.FIXED_HEADER);this.content_.scrollTop>0&&!this.header_.classList.contains(this.CssClasses_.IS_COMPACT)?(this.header_.classList.add(this.CssClasses_.CASTING_SHADOW),this.header_.classList.add(this.CssClasses_.IS_COMPACT),e&&this.header_.classList.add(this.CssClasses_.IS_ANIMATING)):this.content_.scrollTop<=0&&this.header_.classList.contains(this.CssClasses_.IS_COMPACT)&&(this.header_.classList.remove(this.CssClasses_.CASTING_SHADOW),this.header_.classList.remove(this.CssClasses_.IS_COMPACT),e&&this.header_.classList.add(this.CssClasses_.IS_ANIMATING))}},C.prototype.keyboardEventHandler_=function(e){e.keyCode===this.Keycodes_.ESCAPE&&this.drawer_.classList.contains(this.CssClasses_.IS_DRAWER_OPEN)&&this.toggleDrawer()},C.prototype.screenSizeHandler_=function(){this.screenSizeMediaQuery_.matches?this.element_.classList.add(this.CssClasses_.IS_SMALL_SCREEN):(this.element_.classList.remove(this.CssClasses_.IS_SMALL_SCREEN),this.drawer_&&(this.drawer_.classList.remove(this.CssClasses_.IS_DRAWER_OPEN),this.obfuscator_.classList.remove(this.CssClasses_.IS_DRAWER_OPEN)))},C.prototype.drawerToggleHandler_=function(e){if(e&&"keydown"===e.type){if(e.keyCode!==this.Keycodes_.SPACE&&e.keyCode!==this.Keycodes_.ENTER)return;e.preventDefault()}this.toggleDrawer()},C.prototype.headerTransitionEndHandler_=function(){this.header_.classList.remove(this.CssClasses_.IS_ANIMATING)},C.prototype.headerClickHandler_=function(){this.header_.classList.contains(this.CssClasses_.IS_COMPACT)&&(this.header_.classList.remove(this.CssClasses_.IS_COMPACT),this.header_.classList.add(this.CssClasses_.IS_ANIMATING))},C.prototype.resetTabState_=function(e){for(var t=0;t0?h.classList.add(this.CssClasses_.IS_ACTIVE):h.classList.remove(this.CssClasses_.IS_ACTIVE),this.tabBar_.scrollLeft0)return;this.setFrameCount(1);var n,i,s=e.currentTarget.getBoundingClientRect();if(0===e.clientX&&0===e.clientY)n=Math.round(s.width/2),i=Math.round(s.height/2);else{var o=void 0!==e.clientX?e.clientX:e.touches[0].clientX,r=void 0!==e.clientY?e.clientY:e.touches[0].clientY;n=Math.round(o-s.left),i=Math.round(r-s.top)}this.setRippleXY(n,i),this.setRippleStyles(!0),window.requestAnimationFrame(this.animFrameHandler.bind(this))}},E.prototype.upHandler_=function(e){e&&2!==e.detail&&window.setTimeout(function(){this.rippleElement_.classList.remove(this.CssClasses_.IS_VISIBLE)}.bind(this),0)},E.prototype.init=function(){if(this.element_){var e=this.element_.classList.contains(this.CssClasses_.RIPPLE_CENTER);this.element_.classList.contains(this.CssClasses_.RIPPLE_EFFECT_IGNORE_EVENTS)||(this.rippleElement_=this.element_.querySelector("."+this.CssClasses_.RIPPLE),this.frameCount_=0,this.rippleSize_=0,this.x_=0,this.y_=0,this.ignoringMouseDown_=!1,this.boundDownHandler=this.downHandler_.bind(this),this.element_.addEventListener("mousedown",this.boundDownHandler),this.element_.addEventListener("touchstart",this.boundDownHandler),this.boundUpHandler=this.upHandler_.bind(this),this.element_.addEventListener("mouseup",this.boundUpHandler),this.element_.addEventListener("mouseleave",this.boundUpHandler),this.element_.addEventListener("touchend",this.boundUpHandler),this.element_.addEventListener("blur",this.boundUpHandler),this.getFrameCount=function(){return this.frameCount_},this.setFrameCount=function(e){this.frameCount_=e},this.getRippleElement=function(){return this.rippleElement_},this.setRippleXY=function(e,t){this.x_=e,this.y_=t},this.setRippleStyles=function(t){if(null!==this.rippleElement_){var n,i,s="translate("+this.x_+"px, "+this.y_+"px)";t?(i=this.Constant_.INITIAL_SCALE,this.Constant_.INITIAL_SIZE):(i=this.Constant_.FINAL_SCALE,this.rippleSize_+"px",e&&(s="translate("+this.boundWidth/2+"px, "+this.boundHeight/2+"px)")),n="translate(-50%, -50%) "+s+i,this.rippleElement_.style.webkitTransform=n,this.rippleElement_.style.msTransform=n,this.rippleElement_.style.transform=n,t?this.rippleElement_.classList.remove(this.CssClasses_.IS_ANIMATING):this.rippleElement_.classList.add(this.CssClasses_.IS_ANIMATING)}},this.animFrameHandler=function(){this.frameCount_-- >0?window.requestAnimationFrame(this.animFrameHandler.bind(this)):this.setRippleStyles(!1)})}},n.register({constructor:E,classAsString:"MaterialRipple",cssClass:"mdl-js-ripple-effect",widget:!1})}();var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Utility:{getNested:function(e,t){if(e)return 1===(t=Array.isArray(t)?t:t.split(".")).length?e[t[0]]:e[t[0]]?TeePublic.Utility.getNested(e[t[0]],t.slice(1)):void 0},unveil_images:function(e){var t=$(e||"img");t.off("unveil"),t.unveil(200)},modal:function(e,t,n,i){$(e).on("click",(function(){n&&""===$(".modal-content",t).text()&&$(".custom-modal-content",t).load(n,i),TeePublic.Utility.modalReveal(t)}))},modalReveal:function(e){e.reveal({animation:"fade",animationspeed:250,dismissModalClass:"jsCloseModal"}),$(".custom-modal-content").removeClass("hidden"),$("body").addClass("modal-block__no-scroll")},preventDoubleSubmit:function(e){document.querySelectorAll(e).forEach((e=>{e.addEventListener("submit",(()=>{e.querySelector('input[type="submit"]').disabled=!0}))}))},isAppleIOS:function(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}}}),$(document).ready((function(){TeePublic.Components.Utilities.copier(".jsCopyText"),$(".jsCloseModal").on("click",(function(){$("body").removeClass("modal-block__no-scroll"),$(".custom-modal-content").addClass("hidden")}))}));var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{AjaxTooltips:function(){var e=function(e,t){function i(){var e={name:r.val()};$.post(t,e,(function(){}))}var s,o=300,r=$(e);r.on("keyup",(function(){clearTimeout(s),""!==r.val()&&(s=setTimeout(i,o))})),r.on("keydown",(function(){clearTimeout(s),n()}))},t=function(e){setTimeout((function(){$(e).fadeOut("500")}),1500)},n=function(){clearTimeout(t)};return{bindEvents:e,autoCloseTooltips:t,cancelAutoCloseTooltips:n}}()});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Cart:{Settings:{btEnv:"",btKey:"",paypalCheckoutPath:"",checkoutPath:"",paypal_label:"",gp_type:"plain"},addItemToData:function(e,t){var n=window.TeePublic._data.cart||[];n.push(t),window.TeePublic._data.cart=n;try{dataLayer.push({event:"addToCart",ecommerce:{currencyCode:""+e,add:{products:t}}})}catch(e){console.error(e)}},pushItemViewData:function(e){try{dataLayer.push({event:"productViewChange",products:e})}catch(e){console.error(e)}},removeItemFromData:function(e,t){var n=window.TeePublic._data.cart||[],i=n[e];if(window.TeePublic._data.cart=n.filter((function(t,n){return n!==e})),t)try{dataLayer.push({event:"removeFromCart",ecommerce:{remove:{products:i}}})}catch(e){console.error(e)}}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{CookiesAlert:{init:function(){var e=$(".jsCookiesAlert");$(".jsCookiesAlertClose").on("click",(function(){Cookies.set("cookiesAlert","all",{expires:365}),dataLayer.push({cookieSetting:"confirm-all",event:"cookie-setting"}),e.remove()}))}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{CookiesPreferences:function(){function e(e){Cookies.set("cookiesAlert",e,{expires:365})}function t(e){dataLayer.push({cookieSetting:e,event:"cookie-setting"})}return{init:function(){var n=$(".jsCookiePreferencesBtn"),i=$(".jsCookiePreferencesMssg"),s=$(".jsCookiePreferencesForm");n.on("click",(function(){var n=$("input[name=cookiePreferences]:checked").val();["all","functional"].indexOf(n)>-1&&(i.html("Preferences saved!"),e(n),t(n))})),s.on("change",(function(){i.html("")}))}}}()});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Coupon:{init:function(){$((function(){$("#btn-coupon-apply").click((function(){$(this).prop("disabled",!0),c(),e()})),$(".jsCouponCode").keypress((function(t){13==t.which&&(t.preventDefault,$("#btn-coupon-apply").prop("disabled",!0),c(),e())})),$("#btn-coupon-remove").click((function(){"/checkout"===window.location.pathname&&$.get("/coupon_codes/deactivation",{},(function(){l(),i()}))}))}));var e=function(){return $.get("/coupon_codes/validation/"+s(),(function(e){e.applicable?($(this).prop("disabled",!0),o(),t(e)):r(e.error)})),!0},t=function(e){n(e),"/checkout"===window.location.pathname&&i(),"/cart"===window.location.pathname&&location.reload()},n=function(e){"valid"!==e.message&&($(".jsCouponMessage").removeClass("hidden"),a(e.message||e.error))},i=function(){$.ajax({type:"PUT",data:$(".jsCheckoutForm").serialize(),url:"#{checkout_path}"})},s=function(){var e=$(".jsCouponCode").val().trim();return""===e?"nil":e},o=function(){$("#btn-coupon-apply").parent().addClass("hidden"),$("#btn-coupon-remove").parent().removeClass("hidden"),$(".jsCouponMessage").addClass("hidden"),$(".jsCouponEnter").removeAttr("disabled")},r=function(e){$(".jsCouponMessage").removeClass("hidden"),a(e),$(".jsCouponEnter").removeAttr("disabled")},a=function(e){$(".jsCouponMessage").html("

"+e+"

")},l=function(){$(".jsCouponCode").val(""),$(".jsCouponEnter").removeAttr("disabled"),$("#btn-coupon-remove").parent().addClass("hidden"),$("#btn-coupon-apply").removeAttr("disabled").parent().removeClass("hidden"),$(".jsCouponMessage").addClass("hidden")},c=function(){$(".jsCouponEnter").prop("disabled",!0),$(".jsCouponMessage").empty()}}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Designs:{ProductSelector:function(e,t,n,i){n=n||!1;var s=$("#campaign_id").length>0,o=function(e){var t=r(e),n=a(e);return n?t.sizes?t.sizes[n]:t[n]:t},r=function(e){var t=e.data("config");if(e.find("#gender_id").length){var n=c(e),i=l(e);hash=t[n].styles[i]}else if(e.find("#type_id").length)if(s=u(e),e.find("#style_id").length){i=l(e);hash=t[s].styles[i]}else hash=t[s];else if(e.find("#style_id").length){i=l(e);hash=t[i]}else if(e.find("#print_type_id").length){var s=l(e);hash=t[s]}else if(e.find("#device_id").length){var o=d(e),r=h(e);hash=t[o].case_styles[r]}else hash=t;return hash},a=function(e){var t=e.find("#size_id").val();return t||(t=e.find("#size_id option").eq(1).val()),t||(t=e.find("#print_size_id").val()),t||(t=e.find("#print_size_id option").eq(1).val()),t},l=function(e){var t=e.find("#style_id").val();return t||(t=e.find("#style_id option").eq(1).val()),t||(t=e.find("#print_type_id").val()),t||(t=e.find("#print_type_id option").eq(1).val()),t},c=function(e){var t=e.find("#gender_id").val();return t||(t=e.find("#gender_id option").eq(1).val()),t},d=function(){var e=$("#device_id").val();return e||(e=$("#device_id option").eq(1).val()),e},u=function(){var e=$("#type_id").val();return e||(e=$("#type_id option").eq(1).val()),e},h=function(){var e=$("#case_style_id").val();return e||(e=$("#case_style_id option").eq(1).val()),e},p=function(e){var t="";return e.gender_id&&(t+=e.gender_id+"G"),e.style_id&&(t+=e.style_id+"A"),e.type_id&&(t+=e.type_id+"A"),e.device_id&&(t+=e.device_id+"A"),e.print_type_id&&(t+=e.print_type_id+"A"),e.color_id&&(t+=e.color_id+"C"),e.print_size_id&&(t+=e.print_size_id+"S"),e.case_style_id&&(t+=e.case_style_id+"S"),e.type_id&&18==e.canvas_id&&(t+=e.type_id+"T"),e.size_id&&(t+=e.size_id+"S"),t},f=function(e){return TeePublic.ProductVendorHelper.init(),{quantity:e.quantity,price:TeePublic.ProductVendorHelper.currentProductPriceUsd(),price_usd:TeePublic.ProductVendorHelper.currentProductPriceUsd(),price_in_currency:TeePublic.ProductVendorHelper.currentProductPrice(),currency_iso:TeePublic.ProductVendorHelper.currencyIso(),design_color:$(".jsCartConfigColorName").text(),product_image:$(".mockup").attr("src"),variant_id:p(e)}},m=function(e){var t,n,i=e.find(".color_radio:checked").val(),s=r(e);if(s&&s.hasOwnProperty("Colors")){t=s.Colors,n=o(e).colors,TeePublic.color_swatch_template||(TeePublic.color_swatch_template=[]);var a=e.find("input")[0].name,l=/(.*oli\[\[)(.*?)(].*)/;key=a.replace(l,"$2"),TeePublic.color_swatch_template[key]||($el_clone=e.find(".jsCartConfigColors .jsCartConfigColor:first-child").clone(),TeePublic.color_swatch_template[key]=$el_clone),e.find(".jsCartConfigColors").html(""),$.each(t,(function(t,i){var s,o=i;if(n[o.id]&&(!TeePublic.ExcludeProducts||-1==$.inArray(n[o.id],TeePublic.ExcludeProducts))){var r=e.find("input")[0].name,a=/(.*oli\[\[)(.*?)(].*)/;key=r.replace(a,"$2"),e.find(".jsCartConfigColors").append(TeePublic.color_swatch_template[key].clone()),(s=e.find(".jsCartConfigColors .jsCartConfigColor:last-child")).find("label").attr("class","label-"+o.hex.replace("#","")),s.find("input").val(o.id).attr("id","color_id_"+o.id),s.find("span").remove(),s.find("label").append('=0?"white ":"")+(o.textured&&-1==o.name.indexOf("/")?"heathered ":"")+'" title="'+o.name+'">'),s.find("span").css("background-color",o.hex).data(o.images[0]),o.name.indexOf("/")>=0&&s.find("span").css("background-image",'url("'+TeePublic.Designs.AccentColors[o.id]+'")')}})),e.find("#color_id_"+i).val()?e.find("#color_id_"+i).click():e.find(".jsCartConfigColor label")[0]&&e.find(".jsCartConfigColor label")[0].click()}},_=function(e,t){var n=e.find(".jsCartConfigOption.size select").val();e.find(".jsCartConfigOption.size select").html(""),$.each(t,(function(t,n){e.find(".jsCartConfigOption.size select").append(""),e.find(".jsCartConfigOption.size select option").last().html(n.product.name).val(t)})),e.find('.jsCartConfigOption.size select option[value="'+n+'"]').prop("selected",!0)},g=function(e,t){var n=e.find(".jsCartConfigOption.style select").val();e.find(".jsCartConfigOption.style select").html("");var i={};$.each(t,(function(e,t){i[t.sort]=e})),$.each(i,(function(n,i){var s=t[i];e.find(".jsCartConfigOption.style select").append(""),e.find(".jsCartConfigOption.style select option").last().html(s.name).val(i)})),e.find('.jsCartConfigOption.style select option[value="'+n+'"]').prop("selected",!0)},v=function(e,t){var n=e.find(".jsCartConfigOption.case_styles select").val();e.find(".jsCartConfigOption.case_styles select").html(""),$.each(t,(function(t,n){e.find(".jsCartConfigOption.case_styles select").append(""),e.find(".jsCartConfigOption.case_styles select option").last().html(n.product.name).val(t)})),e.find('.jsCartConfigOption.case_styles select option[value="'+n+'"]').prop("selected",!0)},y=function(e){29==e?$(".material-nav .poster").click():30==e?$(".material-nav .art_canvas").click():$(".material-nav .art_print").click()},C=function(){var e=$(this).parents(".jsCartConfigOptions");if(m(e),hash=o(e),hash.product){var t,i=(hash.product.retail_price-hash.product.sale_price)/hash.product.retail_price*100,r=parseFloat(hash.product.retail_price).toFixed(2).replace(".00","");if(s?t=parseFloat(hash.product.campaign_price).toFixed(2):n?(t=parseFloat(hash.product.sale_price).toFixed(2),r=parseFloat(hash.product.retail_price).toFixed(2).replace(".00",""),$(".jsProductPriceOriginal").html("$"+r),$(".jsProductSaleSavings").html(Math.floor(i)+"%")):t=parseFloat(hash.product.retail_price).toFixed(2),t=String(t).replace(".00",""),$(".jsProductPrice").html("$"+t),hash.colors&&hash.colors[$(".color_radio:checked").val()])var a=b(hash.colors[$(".color_radio:checked").val()]);else a=b(parseFloat(hash.product.id));$(".jsGarmentDescription").html(a),$("#design-sale-savings").html(parseFloat(i).toFixed(0)+"%")}else $(".jsProductPrice").html("Unavailable")},b=function(e){e=parseInt(e);$parent=$(".jsCartConfigOptions");var t=$parent.data("descriptions"),n="";return t&&$.each(t,(function(t,i){$.inArray(e,i[1])>=0&&(n=i[0])})),n},E=function(){var e=$(this);e.parent().attr("style","");var t=e.parents(".jsCartConfigOptions"),n=t.data("config"),i=c(t);g(t,n[i].styles);var s=l(t);_(t,n[i].styles[s].sizes),n[i].Colors},S=function(){$(this).parent().attr("style",""),$parent=$(this).parents(".jsCartConfigOptions");var e=$parent.data("config"),t=d();v($parent,e[t].case_styles)},T=function(){$(this).parent().attr("style","");var e,t=$(this).parents(".jsCartConfigOptions"),n=t.data("config"),i=l(t),s=$(".jsSizerSliderCtrl");"79"===i?s.removeClass("hide"):s.addClass("hide"),t.find("#gender_id").length?(e=c(t),n[e].styles[i].Colors,_(t,n[e].styles[i].sizes)):t.find("#size_id").length&&(n[i].Colors,_(t,n[i].sizes))},w=function(){$(this).parent().attr("style",""),$parent=$(this).parents(".jsCartConfigOptions");$parent.data("config"),u($parent);hash=o($parent)},k=function(){$(this).parent().attr("style",""),$parent=$(this).parents(".jsCartConfigOptions");var e=$parent.data("config"),t=l($parent);y(t),_($parent,e[t].sizes)},L=function(){$("body").append(''),$(".jsCartConfigOptions").on("mouseover",".jsCartConfigColorImage",(function(){var e=$(this).data();for(var t in e)$(".jsPreload").append('')})),$(".gender_id").on("change",E),$(".device_id").on("change",S),$(".style_id").on("change",T),$(".type_id").on("change",w),$(".print_type_id").on("change",k),$(".size_id, .print_size_id, .gender_id, .print_type_id, .style_id, .device_id, .case_style_id, .type_id").on("change",C),$("#device_id, #case_style_id").on("change",(function(){$parent=$(this).parents(".jsCartConfigOptions");var e=o($parent);e.images.find((function(e){return"mockup"==e.type})),e.images.find((function(e){return"preview"==e.type}))})),$(document).on("change","#print_type_id, #print_size_id, #device_id, #case_style_id, #type_id, #style_id, #size_id",(function(){$(".jsCartConfigColors").length||($parent=$(this).parents(".jsCartConfigOptions"),gallery.swap_images(o($parent)))})),$(document).on("click",".jsCartConfigColor",(function(){var e=$(this);e.siblings().removeClass("active"),e.addClass("active").find("input").prop("checked",!0)})),$(".jsCartAdd").on("click",(function(e){var t=$(this).data("design"),n=$("#gender_id").val(),s=$("#jsProductPageQuantity").val()||1,o=$("#size_id").val(),r=$("#canvas_id").val(),a=$("#select-brand").val(),l=$("#style_id").val(),c=$("#print_type_id").val(),d=$("#print_size_id").val(),u=$("#device_id").val(),h=$("#case_style_id").val(),p=$("#type_id").val(),_=$("#campaign_id").val(),g=$(".color_radio:checked").val(),v=$(".color_radio").length>0;if(v){var y=g,C=$(this).parent().find(".jsCartConfigOptions");if(m(C),y!=(g=$(".color_radio:checked").val()))var b=!0}var E="";if($("#error_size, #error_gender, #error_quantity").hide(),$("#gender_id").parent().css("border",""),$("#select-quantity").parent().css("border",""),$("#size_id").parent().css("border",""),$("#style_id").parent().css("border",""),$("#case_style_id").parent().css("border",""),$("#device_id").parent().css("border",""),$("#select-gender, #select-quantity, #select-size").removeClass(".error"),""==n?(E="gender",$("#gender_id").parent().css("border","1px solid red"),alert("Select Gender")):""==s||"0"==s?(E="quant",$("#ns_textbox").parent().css("border","1px solid red"),alert("Select Quantity")):""==o?(E="size",$("#size_id").parent().css("border","1px solid red"),alert("Select Size")):""==l?(E="style",$("#style_id").parent().css("border","1px solid red"),alert("Select Style")):""==c?(E="print type",$("#print_type_id").parent().css("border","1px solid red"),alert("Select Print Type")):""==d?(E="print size",$("#print_size_id").parent().css("border","1px solid red"),alert("select Size")):""==u?(E="device",$("#device_id").parent().css("border","1px solid red"),alert("Select Device")):""==h?(E="case style",$("#case_style_id").parent().css("border","1px solid red"),alert("Select Case Style")):""==p?(E="type",$("#type_id").parent().css("border","1px solid red"),alert("Select Type")):v&&null==g?(E="color",alert("Select Color")):b&&(E="color",alert("The color you had selected is not available. We've updated the color options to what's currently available.")),""==E){var S={design_id:t,gender_id:n,quantity:s,size_id:o,color_id:g,canvas_id:r,brand_id:a,style_id:l,print_type_id:c,print_size_id:d,campaign_id:_,case_style_id:h,device_id:u,type_id:p,store_id:i};window.TeePublic.Cart.addItemToData(f(S)),sendCartDetails(S)}else console.log("Cart Error: "+E);return e.preventDefault(),!1})),$(".jsCartConfigColorImage").each((function(){var e=$(this),t=e.data("preview"),n=e.data("mockup");e.removeData(),e.data("mockup",n).data("preview",t)}))};TeePublic.ProductInfo.Sizechart.init_modal(),TeePublic.ProductInfo.Garment.init_modal(),null!=$("#gender_id").value&&C(),L()}}});var TeePublic=TeePublic||{},redirectAfterSignin,executeAfterSignin;$.extend(!0,TeePublic,{EditOrderHelper:function(){var e=function(e){var n=$(e).data("options"),i=".jsEditOrderItem_"+$(e).data("row-number"),s=$(e).data("oli-id"),o=$(e).data("initial-product-id"),r=null;n.CanvasOptions.hierarchy=t(n.CanvasOptions.hierarchy),TeePublic.ProductHelper.renderProductOptions({hierarchy:n.CanvasOptions.hierarchy,products:TeePublic.ProductHelper.sanitizeProducts(n),colors:n.CanvasOptions.colors,oosProducts:TeePublic.Oos,selectedOptions:{},container:i,lineItemKey:s,initialProductId:o,initialRender:!0,renderOptions:TeePublic.ProductHelper.optionsToRender(null,n.CanvasOptions.hierarchy)}),$(i).on("change","select, input",(function(e){var t=TeePublic.ProductHelper.collectSelections(i,n,!0);TeePublic.ProductHelper.renderProductOptions({hierarchy:n.CanvasOptions.hierarchy,products:TeePublic.ProductHelper.sanitizeProducts(n),colors:n.CanvasOptions.colors,oosProducts:TeePublic.Oos,selectedOptions:t,container:i,lineItemKey:s,initialProductId:null,initialRender:!1,renderOptions:TeePublic.ProductHelper.optionsToRender(e,n.CanvasOptions.hierarchy)}),t=TeePublic.ProductHelper.collectSelections(i,n,!0),r=TeePublic.ProductHelper.findProductFromSelections(TeePublic.ProductHelper.sanitizeProducts(n),t,n).id,$(i).find(".jsProductID input").val(r)}))},t=function(e){var t=[];return $.each(e,(function(e,n){n.is_preselected=!0,t.push(n)})),t};return{bindOrderEditEvents:e}}()});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{LoginModal:{init:function(e,t){var n=document.querySelector("#login-img");n.setAttribute("src",n.getAttribute("data-src")),$("#login-modal").show_login_options(e,t)}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Landing:{initLanding:function(){$(".jsSignUpEmail").on("keypress",(function(e){13===e.which&&$(".jsSignupBtn").click()})),TeePublic.Landing.signupBtns()},initSmoothScroll:function(){var e=$(".jsSmoothScrollInit a");$(e).on("click",(function(e){var t=this.hash;""!==t&&(e.preventDefault(),$("html, body").animate({scrollTop:$(t).offset().top},1e3,(function(){window.location.hash=t})))}))},signupBtns:function(){$(".jsSignupBtn").on("click",(function(){var e,t=$(this).data("accounttype");"designer"===t?e=$("#account-creation"):"affiliate"===t&&(e=$("#account-affiliate")),TeePublic.LoginModal.init(e,this.dataset?.source)}))}}}),function(e){function t(e){let t=document.querySelector('#new_registration input[name="source"]');if(t)return t.value=e;t=document.createElement("input"),t.type="hidden",t.name="source",t.value=e,document.querySelector("#new_registration").appendChild(t)}e.fn.show_login_options=function(n,i){var s=e(this),o={create:s.find("#account-creation"),login:s.find("#account-login"),password:s.find("#account-password"),confirmation:s.find("#account-confirmation"),affiliate:s.find("#account-affiliate"),mfa:s.find("#account-mfa")},r=e(".jsSignUpEmail");e(".jsCreateAccountEmail").val(r.val()),e.each(o,(function(e,t){t.hide()})),n.show(),e("#login-modal").secure_login_email(),i&&t(i),n.find("input.form-control").first().focus()},e.fn.secure_login_email=function(){var t=e(this).find("#session_email");""!=t.val()&&e.ajax({url:"/users/secure_login?email="+t.val()}),t.unbind("change"),t.change((function(){e.ajax({url:"/users/secure_login?email="+t.val()})}))}}(jQuery);var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{ProductInfo:{Sizechart:{init_modal:function(e){function t(){$("#sizechart-modal .modal-content").load("/sizechart?modal=true",(function(){var e=TeePublic.ProductHelper.collectSelections("form.jsConfigOptions",TeePublic.ProductOptions,!1);TeePublic.ProductInfo.Sizechart.init(e)})),$("#sizechart-modal").reveal({animation:"fade",dismissModalClass:"close-reveal-modal"})}e=e||".jsSizechartOpen",$(e).click(t)},init:function(e){var t=$("#sizechart");$(".subnavs > div > .male, .subnavs > div > .female",t).each((function(){$(this).children().first().click()})),$(".toggle-display").click((function(){$(".sizechart-toggle").toggle()})),$(".sizechart-nav a",t).click((function(){$(".sizechart-nav a").removeClass("selected"),$(this).addClass("selected");var e=$(this).data("canvas");$("#sizechart .charts > div").hide(),$("#sizechart .subnavs > div").hide(),$("#sizechart ."+e).show()})),$(".metric",t).click((function(){$("#sizechart .metric").hide(),$("#sizechart .imperial").show()})),$(".imperial",t).click((function(){$("#sizechart .imperial").hide(),$("#sizechart .metric").show()})),$(".male_or_female > div",t).click((function(){var e=$(this).data("gender");$("#sizechart .male_or_female > div").removeClass("selected"),$(this).addClass("selected"),$("#sizechart .male").hide(),$("#sizechart .female").hide(),$("#sizechart ."+e).show()})),$(".subnavs a",t).click((function(){var e=$(this).data("action");$(".subnavs a."+e).each((function(){var e=$(this);$(this).parent().find("a").removeClass("selected"),e.addClass("selected")})),$(".charts ."+e).each((function(){var e=$(this);$(this).parent().children().hide(),e.show()}))})),TeePublic.ProductInfo.Sizechart.default_options(e),$("#style-options").change((function(){var e=$("#garment-canvas").data("canvas")||"T-Shirt";if("T-Shirt"==e)$(".sizechart-nav a.tees").click(),"Tri-Blend T-Shirt (Extra Soft)"==(t=$("select#style_id option:selected").text())?$(".male a.tri").click():"V-Neck"==t?$(".male a.vee").click():"Missy Scoop Neck T-Shirt"==t?($(".mof_female").click(),$(".female a.scoop-neck").click()):"Dolman Triblend T-Shirt (Extra Soft)"==t?($(".mof_female").click(),$(".female a.dolman").click()):$(".male a.regular").click();else if("Kids"==e){$(".sizechart-nav a.kids").click(),"Juvenile (Ages 4-7)"==(t=$("select#style_id option:selected").text())?$(".male a.kids-juvenile").click():"Youth"==t?$(".male a.kids-youth").click():"Infant Snap"==t?$(".male a.kids-infant").click():$(".male a.kids-toddler").click()}else if("Long Sleeve T-Shirt"==e){$(".sizechart-nav a.longsleeve").click(),"Premium Long Sleeve Tee"==(t=$("select#style_id option:selected").text())?$(".male a.longsleeve-premium").click():"Scoop Neck Triblend (Extra Soft)"==t?($(".mof_female").click(),$(".female a.longsleeve-scoop").click()):$(".male a.longsleeve-regular").click()}else if("Tank"==e){$(".sizechart-nav a.tanks").click(),"Triblend (Extra Soft)"==(t=$("select#style_id option:selected").text())?$(".male a.tank-triblend").click():"Racerback (Female)"==t?($(".mof_female").click(),$(".female a.tank-racerback").click()):"Muscle"==t?($(".mof_female").click(),$(".female a.tank-muscle").click()):$(".male a.tank-regular").click()}else if("Crewneck"==e){$(".sizechart-nav a.crewnecks").click(),"Lightweight Crewneck Sweatshirt"==(t=$("select#style_id option:selected").text())?$(".male a.crewneck-lightweight").click():$(".male a.crewneck-regular").click()}else if("Hoodie"==e){var t;$(".sizechart-nav a.hoodies").click(),"Lightweight Hoodie"==(t=$("select#style_id option:selected").text())?$(".male a.hoodie-lightweight").click():"Lightweight Zip Hoodie"==t?$(".male a.hoodie-lightweight-zip").click():"Classic Zip Hoodie"==t?$(".male a.hoodie-zip").click():$(".male a.hoodie-regular").click()}else $(".sizechart-nav a.tees").click(),$(".subnavs a.regular").click()}))},default_options:function(e){if($("#sizechart .metric").hide(),$("#sizechart .imperial").show(),e){var t=parseInt(e.gender),n=parseInt(e.style);t?$(".male_or_female div").each((function(){var e=$(this),n=e.data("genderid");t===n&&e.click()})):$(".mof_male").click(),$(".sizechart-nav a").each((function(){var e=$(this),t=$(".jsSizeChartCanvasId").text();(t=parseInt(t))===e.data("canvasid")&&e.click()})),$(".subnavs a").each((function(){var e=$(this),t=e.data("attrid");n===t&&e.click()}))}else $(".mof_male").click(),$(".sizechart-nav a.tees").click(),$(".subnavs a.regular").click()}},Garment:{init_modal:function(){$(".jsGarmentInfoModalShow").click((function(){var e=$(this).data("canvas"),t=$("#type_id").val()||$("#style_id").val()||$("#print_type_id").val()||$(".style input:checked").val(),n=function(){$("#garment-modal").reveal({animation:"fade",dismissModalClass:"close-reveal-modal"})};$("#garment-modal .modal-content").load("/garment?canvas_type="+encodeURI(e)+"&magic_id="+encodeURI(t),(function(){TeePublic.ProductInfo.Garment.init(),n()}))}))},init:function(){$(document).on("click",".spec-nav a",(function(){$("#garment-modal .spec-nav a").removeClass("selected"),$(this).addClass("selected");var e=$(this).data("action");$("#garment-modal img").hide(),$("#garment-modal img."+e).show()}))}},CanvasSizeChart:{init_modal:function(){$(".jsSizeChartMerchOpen").click((function(){var e=$(this).data("canvas"),t={Pillow:"https://sizecharts.teepublic.com/sizechart/charts/homegoods-pillows.png",Tote:"https://sizecharts.teepublic.com/sizechart/charts/homegoods-totes.png"},n=function(){$(".jsSizeChartCanvasModal").reveal({animation:"fade",dismissModalClass:"close-reveal-modal"})};TeePublic.ProductInfo.CanvasSizeChart.init(e,t),n()}))},init:function(e,t){"Pillow"===e?$(".jsSizeChartCanvasModal").addClass("sizechart-canvas-modal__pillow"):"Tote"===e&&$(".jsSizeChartCanvasModal").addClass("sizechart-canvas-modal__tote"),$(".jsSizeChartCanvasModalContent img").attr("src",t[e])}}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{ProductVendorHelper:function(){var e,t=function(e){var t=$("#jsCanvasId").val(),n="";return e.gender&&(n+=e.gender+"G"),e.style&&(n+=e.style+"A"),e.type&&(n+=e.type+"A"),e.device&&(n+=e.device+"A"),e.print_type&&(n+=e.print_type+"A"),e.color&&(n+=e.color+"C"),e.print_size&&(n+=e.print_size+"S"),e.case_style&&(n+=e.case_style+"S"),e.type&&18==t&&(n+=e.type+"T"),e.size&&(n+=e.size+"S"),n},n=function(){return window.dataLayer[1].design__design_id+"D"+window.dataLayer[1].design__canvas_id+"V"},i=function(e,i,s,o,r){return{category:window.dataLayer[1].design__canvas,quantity:s.quantity?s.quantity:1,parent_id:n(),product_id:s.product_id,price:o,price_usd:r,name:window.dataLayer[1].design__design_title,id:window.dataLayer[1].design__design_id,brand:window.dataLayer[1].design__designer_name,design_color:$(".jsConfigColorName").text(),product_image:$(".mockup").attr("src"),variant_id:t(e),variant:JSON.stringify(i),design_owner_id:window.dataLayer[1].design__owner_id,design_primary_tag:window.dataLayer[1].design__primary_tag,design_on_sale:window.dataLayer[1].design__on_sale,dimension34:window.dataLayer[1].design__marketing_sku,dimension37:window.dataLayer[1].design__on_sale,dimension42:window.dataLayer[1].design__mock_image,dimension44:window.dataLayer[1].design__primary_tag,dimension46:window.dataLayer[1].design__owner_id,dimension47:window.dataLayer[1].design__owner_type}},s=function(){TeePublic.ProductOptions.CanvasOptions.hierarchy;var e=TeePublic.ProductHelper.sanitizeProducts(TeePublic.ProductOptions),t=TeePublic.ProductHelper.collectSelections("form.jsConfigOptions",TeePublic.ProductOptions,!1);return TeePublic.ProductHelper.findProductFromSelections(e,t,TeePublic.ProductOptions)},o=function(t){var n=t||s();if(!n)return;const i=TeePublic.ProductHelper.sanitizeProducts(TeePublic.ProductOptions),o=TeePublic.ProductHelper.productPrices(n,i);return 1==e?o.sale_price:0==e?o.retail_price:void 0},r=function(t){var n=t||s();if(!n)return;const i=TeePublic.ProductHelper.sanitizeProducts(TeePublic.ProductOptions),o=TeePublic.ProductHelper.productPrices(n,i);return 1==e?o.sale_price_usd:0==e?o.retail_price_usd:void 0},a=function(){return TeePublic.ProductOptions.CanvasOptions.currency.iso_code},l=function(e,t,n,s){const l=i(t,n,e,o(s),r(s));window.TeePublic.Cart.addItemToData(a(),l)},c=function(e,t){var n={quantity:1};window.TeePublic.Cart.pushItemViewData(i(e,t,n,o(),r()))};return{init:function(){$(".jsCanvasId").val(),$(".jsDesignId").text(),e="true"==$(".jsDesignOnSale").text()},currentProductPrice:o,currentProductPriceUsd:r,updateDataLayerProductView:c,updateDataLayerAddToCart:l,currencyIso:a}}()});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Scroller:function(){function e(e,n){return e=e.filter((function(e){if(!(e[1]+t{const{dataset:{active:t,filterTerm:n}}=e;new TeePublic.Search.PromotedFilter({promotedFilter:e,active:t,filterTerm:n}).init()}))}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{TabNav:{init:function(){$(".jsTabNavCtrl").on("click",(function(e){var t=$(this).data("tab"),n=$(t+".jsTabNavContent"),i=$(this),s=n.is(":visible");e.preventDefault(),$(".jsTabNavContent").hide(),$(".tab-nav__link").removeClass("tab-nav__link--active"),s||($(i).addClass("tab-nav__link--active"),n.show())}))}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Tiles:{init:function(e,t,n){this.initTags(),this.initTools(t,n),n&&this.initSort(e)},initTools:function(e,t){function n(e){Object.keys(e).forEach((function(n){var i=$(".jsDesignContainer[data-id="+n+"]");e[n].forEach((function(e){var s=i.find(".jsTile-"+e);"sort"==e&&t?$(".jsTilesDesigns").addClass("jsSortable"):"campaign"==e?s.attr("href","/new_campaign/"+n):"remove"==e&&s.data("toggle-action","remove").addClass("remove").html("- Merch Store"),s.show()}))}))}function i(){$(".jsDesignContainer").addClass("show-tags")}e?n(e):i()},initSort:function(e){function t(e){s(),$(".jsSortable").sortable({handle:".jsTile-sort"});document.querySelectorAll(".jsTile-sort").forEach((t=>{t.addEventListener("keyup",(s=>{n(t,s),i(e)}))})),$(".jsSortable").sortable().bind("sortupdate",(()=>{i(e)}))}function n(e,t){if(e.classList.contains("jsTile-first"))return;const n=document.querySelector(".jsSortable"),i=e.closest(".jsDesignContainer"),s=36,o=r(i);if("ArrowLeft"===t.key&&o>0){const e=i.previousElementSibling;n.insertBefore(i,e)}if("ArrowRight"===t.key&&o1&&(i+=n[1]),$.ajax({type:"PUT",url:i,data:{orders:t,id:e}})}function s(){$(".jsDesignContainer").each((function(e){$(this).attr("data-pos",e+o())}))}function o(){const e=document.querySelector(".page.current");if(!e)return 0;return 36*(parseInt(e.textContent,10)-1)}function r(e){return parseInt(e.dataset.pos,10)-o()}e&&t(e)},initTags:function(){function e(e){e.closest(".jsDesignContainer").classList.toggle("tags-on")}function t(t){t.forEach((t=>{t.addEventListener("click",(()=>e(t)))}))}t([...document.querySelectorAll(".jsTileTagClose"),...document.querySelectorAll(".jsTileTagsCtrl")])}}}),$((function(){$("html").on("click",".add_to_store, .jsTile-add, .jsMerchStoreCtrl",(function(){var e="",t="",n="",i=$(this),s=i.data("id"),o=i.data("toggle-action");$.ajax({type:"POST",url:"/store/toggle_store_design",data:{design_id:s,toggle_action:o},success:function(s){i.data("toggle-action",s.new_action);const o=document.querySelector(".jsPdpDesign");"add"==s.new_action?(e="+ Merch Store",t="btn--red",aria_label="Add this design to my Merch Store",o&&o.classList.remove("tp-affiliate-owner")):"remove"==s.new_action&&(e="\u2013 Merch Store",n="btn--red",aria_label="Remove design from my Merch Store",o&&o.classList.add("tp-affiliate-owner")),i.removeClass(t).addClass(n).html(e).attr("aria-label",aria_label)}})})),$("html").on("click",".jsMerchStoreMenuCtrlVC, .jsMerchStoreBtnVC",(function(e){function t(e,t){$(`.jsMerchStoreMenuCtrlVC[data-id="${t}"]`).each((function(){const t=$(this);t.data("toggle-action",e),t.attr("data-toggle-action",e),"add"===e?t.html(`\n ${TeePublic.icons.add_to_merch_primary}\n Add to Store\n `):t.html(`\n ${TeePublic.icons.remove_from_merch_primary}\n Remove from Store\n `)}))}function n(e,t){const n=$(`.jsMerchStoreBtnVC[data-id="${t}"]`),i=n.find(".teepublicon");n.data("toggle-action",e),"add"===e?(n.removeClass("btn--red"),i.replaceWith(TeePublic.icons.add_to_merch_light),n.data("aria","Add this design to my Merch Store")):(n.addClass("btn--red"),i.replaceWith(TeePublic.icons.remove_from_merch_light),n.data("aria","Remove this design from my Merch Store"))}e.preventDefault();const i=$(this),s=i.data("id"),o=i.data("toggle-action"),r=i.data("toggle-path");$.ajax({type:"POST",url:r,data:{design_id:s,toggle_action:o},success:function(e){const i=e.new_action;t(i,s),n(i,s)}})})),$("html").on("click",".jsTile-homepage",(function(){var e=$(this).data("path");$.ajax({type:"POST",url:e,success:function(){}})})),$("html").on("click",".jsFeatureOverlayClose",(function(){$(this).closest(".jsFeatureOverlay").remove()}))}));var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Toggler:{init:function(){$(".jsToggleCtrl").on("click",(function(e){e.preventDefault(),$($(this).data("toggle")).toggleClass("on").toggleClass("off")}))}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Checkout:{Actions:function(){var e=["#checkout_bill_country_id","#checkout_ship_country_id","#checkout_ship_state_code","#checkout_bill_state_code","#shipping-options input",".ship_to_billing_option"],t=function(){$((function(){$("#checkout_form").on("change",".ship_to_billing_option",(function(){TeePublic.Checkout.Validate.validate_group("billing"),1==$(this).val()?o():s()})),$("#checkout_form").on("change",".payment-radios input",(function(){TeePublic.Checkout.Validate.validate_group("billing"),"CreditCard"==$(this).val()?n():i()})),$("#checkout_form").on("keyup","#checkout_ship_zip",(function(){5==$(this).val().length&&l($(this).val())&&(f(),$(this).addClass("valid"))})),$("#checkout_form").on("change",e.join(","),f),$("body").on("click",".place-order-button, #paypal_button",(function(){TeePublic.Checkout.Validate.validate_all()&&$("#checkout_form").submit()})),$("#checkout_form").on("change, keyup","#checkout_ccnum",(function(){m()})),$("#checkout_form").on("change","#checkout_bill_country_id, #checkout_ship_country_id",(function(){g($(this))})),$(".checkout").on("click","#coupon-code-link",(function(){$("#coupon-code-interface").show()}))}))},n=function(){$(".paypal-payment-button").hide(),$(".place-order-button").show(),$("#creditcard-details").slideDown(300),$(".billing-header .cc").show(),$(".billing-header .pp").hide(),$(".shipping-information").show()},i=function(){$(".paypal-payment-button").show(),$(".place-order-button").hide(),$("#creditcard-details").slideUp(300),$(".billing-header .cc").hide(),$(".billing-header .pp").show(),$(".shipping-information").hide(),$("#checkout_ship_to_billing_1").click()},s=function(){$(".ship_panel").slideDown(300)},o=function(){$(".ship_panel").slideUp(300)},r=function(){return 223!=$("#checkout_"+c()+"_country_id").val()},a=function(){return!r()},l=function(e){return Math.floor(e)==e&&$.isNumeric(e)},c=function(){return"1"==$(".ship_to_billing_option:checked").val()?"bill":"ship"},d=function(e){return e.indexOf("_bill_")>=0?"bill":"ship"},u=function(e){return"Australia"==e?"State/Territory":"United States"==e?"State":"Province"},h=function(e){return"United States"==e?"Zip":"Postal Code"},p=function(e,t,n){var i;$.each(states,(function(e,n){t==n.id&&(i=n.active_states)})),i?($("#checkout_"+e+"_state_code").replaceWith(''),$("#checkout_"+e+"_state_code").append('"),$.each(i,(function(t,n){$("#checkout_"+e+"_state_code").append(""),$("#checkout_"+e+"_state_code option:last-child").html(n.name).val(n.code)})),$("#checkout_"+e+"_state_code").parent().addClass("field-holder-select")):($("#checkout_"+e+"_state_code").replaceWith(''),$("#checkout_"+e+"_state_code").parent().removeClass("field-holder-select"))},f=function(){$.ajax({type:"PUT",data:$("#checkout_form").serialize(),url:checkout_path})},m=function(){var e=$("#checkout_ccnum").val(),t=_(e);$(".cc_images img").addClass("dimmed"),""!=t&&TeePublic.Checkout.Validate.luhn_check(e)&&$(".cc_images ."+t).removeClass("dimmed")},_=function(e){var t=new RegExp("^4");return null!=e.match(t)?"visa":(t=new RegExp("^(34|37)"),null!=e.match(t)?"amex":(t=new RegExp("^5[1-5]"),null!=e.match(t)?"mastercard":(t=new RegExp("^6011"),null!=e.match(t)?"discover":"")))},g=function(e){var t=e.attr("id"),n=d(t),i=$("#checkout_"+n+"_country_id option:selected").html();$("#checkout_"+n+"_zip").parents(".field-holder").siblings("label").html(h(i)),$("#checkout_"+n+"_state_code").parents(".field-holder").siblings("label").html(u(i)),p(n,$("#checkout_"+n+"_country_id").val(),i),TeePublic.Checkout.Validate.validate_field($("#checkout_"+n+"_zip"))};return{update_checkout:f,shipping_key:c,ship_or_bill:d,is_international:r,is_usa:a,get_card_type:_,bind_events:t}}()}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Checkout:{ActionsBraintree:function(){function e(e,t){var n=document.querySelector(e);""==n.value&&(n.value=t)}function t(){$(".jsPaypalBtn").hide(),$(".jsPaypalComplete").show()}function n(){$(".jsPaypalComplete").hide(),$(".jsPaypalBtn").show()}var i=["#checkout_bill_country_id","#checkout_ship_country_id","#checkout_ship_state_code","#checkout_bill_state_code",".jsShipOptions input"],s=!1,o=document.querySelector("#address__unverified_address__address"),r=document.querySelector("#address__unverified_address__another_address"),a=document.querySelector(".m-account__address-info"),l=function(){var e=$(".jsCheckout"),t=e.find(".jsCheckoutForm"),n=document.querySelector(".jsDialogComponentWrapper");$((function(){function s(){var e;return{shippingErrors:TeePublic.Checkout.ValidateBraintree.validate_group("shipping"),shippingErrorContainer:$(".jsCheckoutShippingErrors"),errorDivs:e,country:$("#checkout_ship_country_id option:checked").text()}}TeePublic.Checkout.ValidateBraintree.validate_paypal_silently(),$(document).ready((function(){try{$(".jsPaymentOptions input:checked").change()}catch(e){}})),t.on("change",".jsPaymentOptions input",(function(){var e=$(this);"CreditCard"==e.val()?b():"Paypal"==e.val()?E():"ApplePay"==e.val()?S():"GooglePay"==e.val()&&T()})),t.on("keyup","#checkout_ship_zip",(function(){var e=$(this);5==e.val().length&&k(e.val())&&(e.addClass("valid"),$("#checkout_last_updated_field").val(e.attr("id")),N())})),t.on("blur","#checkout_ship_zip",(function(){var e=$("#checkout_bill_zip"),t=$("#checkout_ship_zip").val();""==e.val()&&e.val(t).blur()})),t.on("blur","#checkout_ship_firstname",(function(){""==$("#checkout_bill_firstname").val()&&$("#checkout_bill_firstname").val($("#checkout_ship_firstname").val()).blur()})),t.on("blur","#checkout_ship_lastname",(function(){""==$("#checkout_bill_lastname").val()&&$("#checkout_bill_lastname").val($("#checkout_ship_lastname").val()).blur()})),t.on("change",i.join(","),N),t.on("change","#checkout_ship_country_id",(function(){j($(this)),!w($("#checkout_ship_country_id"))&&w($("#checkout_bill_country_id"))&&$("#checkout_bill_country_id").val($("#checkout_ship_country_id").val()).change()})),t.on("change","#checkout_bill_country_id",(function(){223==$(this).val()?$("#bill-zip").slideDown(300):$("#bill-zip").slideUp(300)})),t.on("click","#checkout_copy_shipping_info",(function(){I()})),e.on("click",".jsCouponLink",(function(){$(".jsCheckoutCouponForm").toggleClass("active")})),e.on("click",".jsShowItemsLink",(function(){$(".jsCheckoutItems").toggleClass("active"),$(".jsCheckoutItems").hasClass("active")?$(this).text("Hide items"):$(this).text("Show items")})),e.on("click",".jsPaypalShade",(function(){TeePublic.Checkout.ValidateBraintree.validate_paypal()})),e.on("click",".jsEditShippingInfo",(function(){document.querySelector("#checkout_save_address")&&o&&$(this).hasClass("change")?(o.checked=!0,$(".jsShippingInfoFields").hide(),_(),rudderstackTracker.setCurrentStep()):(r&&(r.checked=!0),$(".jsShippingInfoFields").show(),rudderstackTracker.setCurrentStep());var e=$(".jsDialogSwitch").length>0;$(".jsShippingView").hide(),$(".jsShippingInfo").show(),f(),e&&y()})),e.on("click",".jsUseSavedAddress",(function(e){l(e)}));var l=async function(){await m(),$(".jsShippingInfoFields").hide();var{shippingErrors:e,shippingErrorContainer:t,errorDivs:n,country:i}=s();t.hide(),e.length>0||(f(),u(),d(),N(),c(i)&&a&&o.checked&&(addressInfo=JSON.parse(document.querySelector(".m-account__address-info").dataset.addressInfo),addressInfo.verified&&(v(),rudderstackTracker.setCurrentStep())))};e.on("click",".jsPaypalComplete",(function(e){e.preventDefault(),TeePublic.Checkout.ValidateBraintree.validate_paypal()&&1!=$(this).prop("disabled")&&($(".jsCheckoutForm").submit(),$(this).prop("disabled",!0))})),e.on("click",".jsDialogSwitch",(function(e){h(e)}));var h=async function(e){await m();var{shippingErrors:t,shippingErrorContainer:i,errorDivs:r,country:l}=s();e.preventDefault(),i.hide(),0==t.length?(f(),u(),d(),c(l)&&(a&&o.checked?(addressInfo=JSON.parse(document.querySelector(".m-account__address-info").dataset.addressInfo),addressInfo.verified?v():n.dialogComponent.triggerDialog(e)):n.dialogComponent.triggerDialog(e)),rudderstackTracker.advanceStep()):(i.html("").show(),r=$.map(t,(function(e){return"
"+e+"
"})),i.append(r),rudderstackTracker.state.errors.push(t))};$("html").on("click",".jsSubmitVerifiedAddress",(function(e){e.preventDefault();var t=$(".jsAddressVerificationRadio:checked").data("address");g(t),v(),n.dialogComponent.closeDialog()})),$("html").on("click",".jsSubmitVerifiedAddressRedesign",(function(e){e.preventDefault(),document.querySelector("#checkout_used_verified_address").value=!0,p(".jsVerifiedAddressData"),rudderstackTracker.advanceStep()})),$("html").on("click",".jsSubmitOriginalAddressRedesign",(function(e){e.preventDefault(),document.querySelector("#checkout_used_verified_address").value=!0,p(".jsOriginalAddressData"),rudderstackTracker.advanceStep()})),$("html").on("click",".jsReturnToEditAddressRedesign",(function(e){e.preventDefault(),p("edit")}));var p=function(e){"edit"!==e&&(g($(e).data("address")),v()),n.dialogComponent.closeDialog()};e.on("click",".jsCheckoutActions",(function(){rudderstackTracker.advanceStep()}))}))},c=function(e){return["United States","Canada"].indexOf(e)>=0},d=function(){var e=$("#checkout_ship_country_id option:checked").text();c(e)?($(".jsShippingInfo").addClass("updating"),$.ajax({type:"POST",url:"/checkout/verify_address",data:h(),complete:function(e){$("#checkout_verified_address").val(JSON.stringify(e.responseJSON.original_payload)),p(e.responseJSON)}})):v()},u=function(){var e=document.querySelector("#checkout_ship_address2");if(""!==e.value){var t=e.value.replace(/\s/g,""),n=/^[a-zA-Z]?([0-9])*[a-zA-Z]?$/;t.match(n)&&(e.value="#"+t)}},h=function(){return{line1:$("#checkout_ship_address1").val(),line2:$("#checkout_ship_address2").val(),city:$("#checkout_ship_city").val(),region:$("#checkout_ship_state_code").val(),countryId:$("#checkout_ship_country_id").val(),postalCode:$("#checkout_ship_zip").val()}},p=function(e){var t=e.validated_address,n=e.original_address,i=e.missing_apartment_unit,s=e.bad_address,o=$("#checkout_ship_firstname").val(),r=$("#checkout_ship_lastname").val();$(".jsAddressVerificationOptionVerified").show(),$(".jsAddressVerificationRadioVerified").click(),$(".jsVerificationError").hide(),$(".jsAnyVerificationErrorsRedesign").hide(),$(".jsBadAddressRedesign").hide(),$(".jsMissingApartmentUnitRedesign").hide(),$(".jsVerifiedAddressRedesign").show(),s?($(".jsBadAddress").show(),$(".jsAddressVerificationOptionVerified").hide(),$(".jsAddressVerificationRadioOriginal").click()):i&&$(".jsMissingApartmentUnit").show(),(s||i)&&($(".jsAnyVerificationErrorsRedesign").show(),$(".jsVerifiedAddressRedesign").hide()),s?$(".jsBadAddressRedesign").show():i&&$(".jsMissingApartmentUnitRedesign").show(),t.line1?($(".jsAddressVerificationRadioVerified").data("address",t),$(".jsAddressVerificationRadioOriginal").data("address",n),$(".jsVerifiedAddressData").data("address",t),$(".jsOriginalAddressData").data("address",n),$(".jsVerifiedShipName").html(o+" "+r),$(".jsVerifiedShipAddress1").html(t.line1),$(".jsVerifiedShipAddress2").html(t.line2),$(".jsVerifiedShipCity").html(t.city),t.region.length>0&&$(".jsVerifiedShipCity").append(","),$(".jsVerifiedShipRegion").html(t.region),$(".jsVerifiedShipPostalCode").html(t.postalCode),$(".jsVerifiedShipCountry").html(t.countryName),$(".jsOriginalShipName").html(o+" "+r),$(".jsOriginalShipAddress1").html(n.line1),$(".jsOriginalShipAddress2").html(n.line2),$(".jsOriginalShipCity").html(n.city),n.region.length>0&&$(".jsOriginalShipCity").append(","),$(".jsOriginalShipRegion").html(n.region),$(".jsOriginalShipPostalCode").html(n.postalCode),$(".jsOriginalShipCountry").html(n.countryName),$(".jsShippingInfo").removeClass("updating")):alert("There is something wrong with your entered address. Please contact customer support for help.")},f=function(){$(".jsDialogContent").addClass("m-checkout__order-ship-fields"),$(".jsDialogContent").addClass("jsShippingInfo")},m=function(){o&&o.checked&&(addressInfo=JSON.parse(document.querySelector(".m-account__address-info").dataset.addressInfo),document.querySelector("#checkout_save_address").value="true",document.querySelector("#checkout_ship_firstname").value=addressInfo.firstName,document.querySelector("#checkout_ship_lastname").value=addressInfo.lastName,g(addressInfo),e("#checkout_bill_firstname",addressInfo.firstName),e("#checkout_bill_lastname",addressInfo.lastName),e("#checkout_bill_zip",addressInfo.postalCode),TeePublic.Checkout.ValidateBraintree.validate_paypal_silently())},_=function(){document.querySelector("#checkout_ship_firstname").value="",document.querySelector("#checkout_ship_lastname").value="",document.querySelector("#checkout_ship_country_id").value=223,document.querySelector("#checkout_ship_state_code").value="",document.querySelector("#checkout_ship_city").value="",document.querySelector("#checkout_ship_zip").value="",document.querySelector("#checkout_ship_address1").value="",document.querySelector("#checkout_ship_address2").value=""},g=function(e){$("#checkout_ship_country_id").val(e.countryId),j($("#checkout_ship_country_id")),$("#checkout_ship_state_code").val(e.region),$("#checkout_ship_city").val(e.city),$("#checkout_ship_zip").val(e.postalCode),$("#checkout_ship_address1").val(e.line1),$("#checkout_ship_address2").val(e.line2)},v=function(){$(".jsDialogSwitch").hide(),$(".jsCheckoutBillingSection").show(),$("#nonce").val()?E():$(".jsOrderCC").show(),C()},y=function(){$(".jsDialogSwitch").show(),$(".jsCheckoutBillingSection").hide(),$(".jsOrderCC").hide()},C=function(){var e=$("#checkout_ship_firstname").val(),t=$("#checkout_ship_lastname").val(),n=$("#checkout_ship_address1").val(),i=$("#checkout_ship_address2").val(),o=$("#checkout_ship_city").val(),r=$("#checkout_ship_state_code").val(),a=$("#checkout_ship_zip").val(),l=$("#checkout_ship_country_id option:selected").text().toUpperCase(),c=$(".jsCheckoutLockedShippingAddress2").closest("div");$(".jsCheckoutLockedShippingFirstName").html(e),$(".jsCheckoutLockedShippingLastName").html(t),$(".jsCheckoutLockedShippingAddress1").html(n),$(".jsCheckoutLockedShippingAddress2").html(i),i.length>0?c.show():c.hide(),$(".jsCheckoutLockedCityStateZip").html(o+", "+r+" "+a),$(".jsCheckoutLockedShippingCountry").html(l),$(".jsShippingInfo").hide(),$(".jsShippingView").show(),s=!0},b=function(){s&&$(".jsShippingView").show(),$(".jsPaypal").hide(),$(".jsPaypalComplete").hide(),$(".jsOrderCC").removeClass("hidden"),$(".jsApplePay").hide(),$(".jsGooglePay").hide(),$(".jsCCInfo").slideDown(300),$(".jsShippingSection").slideDown(300)},E=async function(){await m(),$("#nonce").val()?t():n(),s&&$(".jsShippingView").show(),$(".jsPaypal").show(),$(".jsOrderCC").addClass("hidden"),$(".jsApplePay").hide(),$(".jsGooglePay").hide(),$(".jsCCInfo").slideUp(300),$(".jsShippingSection").slideDown(300)},S=function(){$(".jsPaypal").hide(),$(".jsOrderCC").addClass("hidden"),$(".jsShippingView").hide(),$(".jsApplePay").show(),$(".jsGooglePay").hide(),$(".jsCCInfo").slideUp(300),$(".jsShippingSection").slideUp(300)},T=function(){$(".jsPaypal").hide(),$(".jsOrderCC").addClass("hidden"),$(".jsShippingView").hide(),$(".jsApplePay").hide(),$(".jsGooglePay").show(),$(".jsCCInfo").slideUp(300),$(".jsShippingSection").slideUp(300)},w=function(e){return 223==e.val()},k=function(e){return Math.floor(e)==e&&$.isNumeric(e)},L=function(e){return e.indexOf("_bill_")>=0?"bill":"ship"},x=function(e){return"Australia"==e?"State/Territory":"United States"==e?"State":"Province"},P=function(e){return"United States"==e?"Zip":"Postal Code"},I=function(){var e=300;$(".jsBillingNameInfo, .jsBillingLocationInfo")[$("#checkout_copy_shipping_info").prop("checked")?"slideUp":"slideDown"](e)},A=function(e,t,n){var i;$.each(TeePublic.Checkout.Form.states,(function(e,n){t==n.id&&(i=n.active_states)})),i?($("#checkout_"+e+"_state_code").closest(".jsFieldHolder").html('
'),$("#checkout_"+e+"_state_code").append('"),$.each(i,(function(t,n){$("#checkout_"+e+"_state_code").append(""),$("#checkout_"+e+"_state_code option:last-child").html(n.name).val(n.code)}))):$("#checkout_"+e+"_state_code").closest(".jsFieldHolder").html('')},N=function(){window.TeePublic.features.checkoutUpdating&&$(".jsCheckoutUpdating").addClass("updating"),$.ajax({type:"PUT",data:$(".jsCheckoutForm").serialize(),url:TeePublic.Checkout.Form.checkout_path,error:function(){window.location="/checkout"}})},j=function(e){var t=e.attr("id"),n=L(t),i=$("#checkout_"+n+"_country_id option:selected").html();$("#checkout_"+n+"_zip").parents(".jsFieldHolder").siblings("label").html(P(i)),$("#checkout_"+n+"_state_code").parents(".jsFieldHolder").siblings("label").html(x(i)),A(n,$("#checkout_"+n+"_country_id").val(),i),TeePublic.Checkout.ValidateBraintree.validate_field($("#checkout_"+n+"_zip"))};return{update_checkout:N,ship_or_bill:L,is_usa:w,bind_events:l,useSavedAddress:m}}()}});var TeePublic=TeePublic||{},Cart=TeePublic.Cart||{};$.extend(!0,Cart,{CheckoutGooglePay:{init:function(){function e(){return null==m&&(m=new google.payments.api.PaymentsClient({environment:f.googlePayEnvironment,merchantInfo:{merchantId:f.googlePayMerchantId,merchantName:f.googlePayMerchantName},paymentDataCallbacks:{onPaymentAuthorized:t,onPaymentDataChanged:n}})),m}function t(e){return new Promise((function(t){p(e).then((function(){t({transactionState:"SUCCESS"}),TeePublic.Components.Utilities.loader(".jsThankyouPageLoader").toggle()})).catch((function(e){t({transactionState:"ERROR",error:{intent:"PAYMENT_AUTHORIZATION",message:e.message,reason:e.reason}})}))}))}function n(e){return new Promise((function(t){var n=e.shippingAddress,i=e.shippingOptionData,s={google_pay_address:n,google_pay_shipping_method:i};$.post("/cart/google-pay",s,(function(e){var n=e.default_shipping_method!==i.id;t(h(e,n))}))}))}function i(){return braintree.client.create({authorization:f.btKey})}function s(e){braintree.dataCollector.create({client:e},(function(e,t){g=t.deviceData}))}function o(e){return braintree.googlePayment.create({client:e,googlePayVersion:2})}function r(t){_=t;var n=e(),i=$.extend({},y,{allowedPaymentMethods:t.createPaymentDataRequest().allowedPaymentMethods,existingPaymentMethodRequired:!0});return n.isReadyToPay(i)}function a(){var t=e();$(".jsGooglePayCheckout").each((function(e,n){var i=$(n);if(!i.hasClass("loaded")){var s=t.createButton({buttonColor:"default",buttonSizeMode:"fill",buttonType:TeePublic.Cart.Settings.gp_type,buttonRadius:12,onClick:c});i.append(s),i.removeClass("hidden"),i.addClass("loaded")}}))}function l(){var t=_.createPaymentDataRequest({transactionInfo:{currencyCode:"USD",totalPriceStatus:"NOT_CURRENTLY_KNOWN"}});e().prefetchPaymentData(t)}function c(){m.loadPaymentData(v)}function d(){return new Promise((function(e){$.post("/cart/google-pay",{},(function(t){v=u(t),e()}))}))}function u(e){var t=_.createPaymentDataRequest({merchantInfo:{merchantId:f.googlePayMerchantId,merchantName:f.googlePayMerchantName},transactionInfo:{currencyCode:e.currencyCode,totalPriceStatus:"FINAL",totalPrice:parseFloat(e.total).toFixed(2)},shippingAddressRequired:!0,emailRequired:!0,shippingOptionRequired:!0,shippingOptionParameters:{shippingOptions:e.shipping_methods},callbackIntents:["PAYMENT_AUTHORIZATION","SHIPPING_ADDRESS","SHIPPING_OPTION"]}),n=t.allowedPaymentMethods[0];return n.parameters.billingAddressRequired=!0,n.parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:!0},t}function h(e,t){var n={newTransactionInfo:{currencyCode:e.currencyCode,totalPriceStatus:"FINAL",totalPrice:parseFloat(e.total).toFixed(2),totalPriceLabel:"Total"}};return t&&(n.newShippingOptionParameters={defaultSelectedOptionId:e.default_shipping_method,shippingOptions:e.shipping_methods}),n}function p(e){return new Promise((function(t,n){_.parseResponse(e).then((function(i){var s={google_pay_nonce:i.nonce,google_pay_address:JSON.stringify(e.shippingAddress),google_pay_shipping:JSON.stringify(e.shippingOptionData),email:e.email,"checkout[payment_option]":"GooglePay",device_data:g};$.post("/checkout/google-pay/validate",s,(function(e){e.valid?(TeePublic.Components.Utilities.instantForm("/checkout/google-pay",s),t()):n(e)}))})).catch((function(e){console.warn(e)}))}))}var f=TeePublic.Cart.Settings;if(!TeePublic.Utility.isAppleIOS()){var m,_,g,v,y={apiVersion:2,apiVersionMinor:0};i().then((function(e){s(e),o(e).then((function(e){r(e).then((function(e){e.result&&d().then((function(){a(),$(".jsGooglePayHidden").removeClass("hidden"),l(),$(window).on("lazyload",(function(){a()}))}))}))}))}))}}}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Checkout:{ValidateBraintree:function(){var e=["checkout_bill_firstname","checkout_bill_lastname","checkout_ship_firstname","checkout_ship_lastname","checkout_bill_country_id","checkout_ship_city"],t=["checkout_ship_zip"],n=["checkout_bill_zip"],i=["checkout_bill_phone"],s=["checkout_bill_email"],o=["checkout_ship_address1"],r=["checkout_ship_state_code"],a=["checkout_bill_firstname","checkout_bill_lastname","checkout_bill_country_id","checkout_bill_zip","checkout_bill_email","checkout_bill_phone"],l=["checkout_bill_email","checkout_bill_phone"],c=["checkout_bill_email","checkout_bill_phone"],d=["checkout_ship_firstname","checkout_ship_lastname","checkout_ship_address1","checkout_ship_address2","checkout_ship_city","checkout_ship_country_id","checkout_ship_zip","checkout_ship_state_code"],u=a.concat(d),h="checkout_copy_shipping_info",p=$(".jsCheckoutForm"),f=function(a,l){l=l||!1;var c=a.parents(".jsFieldHolder"),d=a.attr("id"),u=(a.val(),[]);return $.inArray(d,o)>=0&&u.push(k(a)),$.inArray(d,e)>=0&&u.push(L(a)),$.inArray(d,t)>=0&&u.push(x(a)),$.inArray(d,n)>=0&&u.push(P(a)),$.inArray(d,i)>=0&&u.push(N(a)),$.inArray(d,s)>=0&&u.push(I(a)),$.inArray(d,r)>=0&&u.push(j(a)),u=u.filter((function(e){return null!=e})),0==l&&c.removeClass("valid invalid").addClass(0==u.length?"valid":"invalid"),u},m=function(e,t){t=t||!1;var n=[],i=[];return"billing"==e&&(n=a),"billing_contact_fields"==e&&(n=l),"paypal_billing"==e&&(n=c),"shipping"==e&&(n=d),$.each(n,(function(e,n){i=i.concat(f($("#"+n),t))})),i},_=function(){return $(".jsShipOptions input:checked").val()?[]:"You do not have a shipping option selected. Please complete your address to pick a shipping option."},g=function(e){e=e||!1;var t=[];return t=(t=(t=t.concat(m("shipping",e))).concat(m("paypal_billing",e))).concat(_()),e?0==t.length:E(t)},v=function(){g(!0)?$(".jsPaypalShade").hide():$(".jsPaypalShade").show()},y=function(){TeePublic.Checkout.ActionsBraintree.useSavedAddress();var e=[];return e=(e=(e=(e=$("#"+h).prop("checked")?e.concat(m("billing_contact_fields")):e.concat(m("billing"))).concat(m("shipping"))).concat(w())).concat(_()),E(e)},C=function(){var e=[];return e=(e=e.concat(m("shipping"))).concat(_()),E(e)},b=function(){$.each(u,(function(e,t){$("#"+t).parents(".jsFieldHolder").is(".valid, .invalid")&&f($("#"+t))}))},E=function(e){return e.length>0?(S(e),!1):(T(),!0)},S=function(e){var t=$(".jsCheckoutErrors");t.html(""),$.each(e,(function(e,n){t.append("
"+n+"
"),rudderstackTracker.state.errors.push(n)})),t.show()},T=function(){var e=$(".jsCheckoutErrors");e.hide(),e.html("")},w=function(){return errors=[],$("#checkout_payment_option_creditcard").is(":checked")&&($("#card-number").hasClass("braintree-hosted-fields-valid")||errors.push("Credit Card number must be valid."),$("#expiration-date").hasClass("braintree-hosted-fields-valid")||errors.push("Credit Card expiration date must be valid."),$("#cvv").hasClass("braintree-hosted-fields-valid")||errors.push("Credit Card CVV number must be valid.")),errors},k=function(e){var t=e.val().trim(),n="pobox"==t.replace(/[^0-9a-z]/gi,"").toLowerCase().substr(0,5),i=$(".jsShipOptions input:checked").parents("label").find(".jsShipOptionText").html(),s=i&&"UPS"==i.replace(/[^0-9a-z]/gi,"").substr(0,3);return A(t)?e.data("name")+" cannot be an email address.":0==t.length?"Shipping Address must be entered.":n&&s?"UPS Orders cannot be shipped to PO Boxes":null},L=function(e){var t=e.val();return A(t)?e.data("name")+" cannot be an email address.":t.length>0?null:e.data("name")+" must be entered."},x=function(e){var t,n;return"United States"==(t=$("#checkout_ship_country_id option:selected").text())?n=/(^\d{5}$)|(^\d{5}-\d{4}$)/:"Canada"==t?n=/^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/:"United Kingdom"==t&&(n=/^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))\s?[0-9][A-Za-z]{2})$/),!n||n.test($.trim(e.val()))?null:e.data("name")+" must be valid."},P=function(e){return"United States"==$("#checkout_bill_country_id option:selected").text()?new RegExp("\\d{5}(-d{4})?").test(e.val())?null:e.data("name")+" must be valid.":null},I=function(e){e.val(e.val().trim());var t=e.val();return 1==A(t)?null:e.data("name")+" must be valid."},A=function(e){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},N=function(e){var t=e.val().replace(/\D/g,"");return"United States"==$("#checkout_ship_country_id option:selected").text()?t.length>=10||0==t.length?null:e.data("name")+" must be valid (at least 10 digits) or empty.":t.length>=8?null:e.data("name")+" must be valid (at least 8 digits)."},j=function(e){if("select"==e.prop("tagName").toLowerCase())return""==e.find("option:selected").val()?e.data("name")+" must be chosen.":null;var t=D(e).val();return-1==$.inArray(t,TeePublic.Checkout.Form.no_provinces)&&""==e.val()?e.data("name")+" must be entered.":null},D=function(e){ return-1!=e.prop("name").indexOf("ship")?$("#checkout_ship_country_id"):$("#checkout_bill_country_id")},O=function(){var e=$(".jsFreeShippingExclusion");"223"!==$("#checkout_ship_country_id").val()||R()?e.show():e.hide()},R=function(){var e=$("#checkout_ship_country_id").val(),t=$("#checkout_ship_state_code").val();return!("223"!==e||!t.match(/AK|HI/))};return p.on("blur","input, select",(function(){var e=$(this);e.is(":radio")&&e.is(".jsShipOption")||(f($(this)),v())})),p.on("keyup","input",(function(){$(this).parent(".jsFieldHolder").is(".valid, .invalid")&&(f($(this)),v())})),p.on("change","#checkout_ship_country_id, #checkout_bill_country_id",(function(){b(),v()})),p.on("change","#checkout_ship_country_id, #checkout_ship_state_code",(function(){O()})),{validate_field:f,validate_group:m,validate_all:y,validate_shipping_panel:C,validate_paypal:g,validate_paypal_silently:v,revalidate_validated:b,checkFreeShippingExclusion:O}}()}});var TeePublic=TeePublic||{};$.extend(!0,TeePublic,{Users:{initPaymentForm:function(){$(".jsSecureEdit").click((function(){$.post($(this).data("url"),null,null,"script"),$(this).prop("disabled",!0)}))},initUnsavedChangeAlert:function(){var e=!1,t=$(".jsAccountForm");(function(){t.find(":input").change((function(){e=!0})),t.find(".sortable").on("sortupdate",(function(){e=!0})),t.find(":submit, button").click((function(){e=!1}))})(),$(window).on("beforeunload",(function(){if(e)return""}))},initAlbumsForm:function(){$(".jsSortable").sortable({start:function(){},change:function(){},update:function(){var e=[],t=$(".jsSortPath").data("path");$(".m-account__albums .table-mock__row").each((function(){e.push($(this).data("id"))})),$.post(t,{designs:e})}})},initReferralForm:function(e){function t(){$(n).on("click",(function(){$(i).toggle(),$(s).empty(),$(".jsShareShorturlCopy").html("Copy")}))}var n="."+e.toggleClass,i="."+e.formClass,s="."+e.messagesClass;t()},initNav:function(){function e(){window.innerWidth>t?i.classList.remove("account-navigation--hidden"):n.classList.contains("nav-active")||i.classList.add("account-navigation--hidden")}const t=768,n=document.querySelector(".jsMAccountContent"),i=document.querySelector(".jsAccountNav");document.querySelectorAll(".jsNavCtrl").forEach((e=>{e.addEventListener("click",(function(e){if(window.innerWidth>t)return;const i=n.getBoundingClientRect().top+window.scrollY-15;e.currentTarget.classList.contains("jsNavClose")&&window.scrollTo({top:i,behavior:"smooth"})}))})),e(),window.addEventListener("resize",e)}}}),jQuery.fn.extend({propAttr:$.fn.prop||$.fn.attr});