function HL(n,t,i,r,u,f){xwiCW.HL(n,t,i,r,u,f)}function HLMin(n,t,i,r,u,f,e){xwiCW.HLMin(n,t,i,r,u,f,e)}function validateNYT(n){n===void 0&&(n=0);var t="nytauth",u="valid",r="IsValid",f="invalid",i={expires:0,IsValid:!1};return(n===0?t="nytsess":i.expires=n,Cookies.get(t)===u)?(validateNYT[r]=!0,console.log("NYT validated via ".concat(t," cookie.")),$(this).promise()):$.ajax({url:"https://www.nytimes.com/svc/crosswords/v2/puzzle/daily-2019-01-11.puz",accepts:{puzType:"application/x-crossword"},converters:{"text puzType":function(){return"xwi"}},dataType:"puzType",xhrFields:{withCredentials:!0},success:function(n,f){console.log("SUCCESS: NYT returns ".concat(f));validateNYT[r]=!0;i.IsValid=!0;Cookies.set(t,u,i)},error:function(n,e,o){console.log("ERROR: NYT returns code ".concat(n.status," : ").concat(e," : ").concat(o));n.status===200?(console.log("Logged in."),i.IsValid=!0,validateNYT[r]=!0,Cookies.set(t,u,i)):(console.warn("NOT logged in."),validateNYT[r]=!1,Cookies.set(t,f,i))}})}var paypal,Cookies,Modernizr,xwiTT;!function(n,t,i){function tt(n){var t=e.className,i=r._config.classPrefix||"",u;(c&&(t=t.baseVal),r._config.enableJSClass)&&(u=new RegExp("(^|\\s)"+i+"no-js(\\s|$)"),t=t.replace(u,"$1"+i+"js$2"));r._config.enableClasses&&(t+=" "+i+n.join(" "+i),c?e.className.baseVal=t:e.className=t)}function s(n,t){return typeof n===t}function it(){var i,n,u,f,e,o,t;for(var c in h)if(h.hasOwnProperty(c)){if(i=[],n=h[c],n.name&&(i.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(u=0;u<n.options.aliases.length;u++)i.push(n.options.aliases[u].toLowerCase());for(f=s(n.fn,"function")?n.fn():n.fn,e=0;e<i.length;e++)o=i[e],t=o.split("."),1===t.length?r[t[0]]=f:(!r[t[0]]||r[t[0]]instanceof Boolean||(r[t[0]]=new Boolean(r[t[0]])),r[t[0]][t[1]]=f),g.push((f?"":"no-")+t.join("-"))}}function o(){return"function"!=typeof t.createElement?t.createElement(arguments[0]):c?t.createElementNS.call(t,"http://www.w3.org/2000/svg",arguments[0]):t.createElement.apply(t,arguments)}function rt(n,t){return!!~(""+n).indexOf(t)}function ut(n){return n.replace(/([a-z])-([a-z])/g,function(n,t,i){return t+i.toUpperCase()}).replace(/^-/,"")}function ft(n,t){return function(){return n.apply(t,arguments)}}function et(n,t,i){var r;for(var u in n)if(n[u]in t)return i===!1?n[u]:(r=t[n[u]],s(r,"function")?ft(r,i||t):r);return!1}function b(n){return n.replace(/([A-Z])/g,function(n,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function ot(t,i,r){var u,f,e;return"getComputedStyle"in n?(u=getComputedStyle.call(n,t,i),f=n.console,null!==u?r&&(u=u.getPropertyValue(r)):f&&(e=f.error?"error":"log",f[e].call(f,"getComputedStyle returning null, its possible modernizr test results are inaccurate"))):u=!i&&t.currentStyle&&t.currentStyle[r],u}function st(){var n=t.body;return n||(n=o(c?"svg":"body"),n.fake=!0),n}function ht(n,i,r,u){var s,a,c,v,l="modernizr",h=o("div"),f=st();if(parseInt(r,10))for(;r--;)c=o("div"),c.id=u?u[r]:l+(r+1),h.appendChild(c);return s=o("style"),s.type="text/css",s.id="s"+l,(f.fake?f:h).appendChild(s),f.appendChild(h),s.styleSheet?s.styleSheet.cssText=n:s.appendChild(t.createTextNode(n)),h.id=l,f.fake&&(f.style.background="",f.style.overflow="hidden",v=e.style.overflow,e.style.overflow="hidden",e.appendChild(f)),a=i(h,n),f.fake?(f.parentNode.removeChild(f),e.style.overflow=v,e.offsetHeight):h.parentNode.removeChild(h),!!a}function ct(t,r){var f=t.length,u;if("CSS"in n&&"supports"in n.CSS){for(;f--;)if(n.CSS.supports(b(t[f]),r))return!0;return!1}if("CSSSupportsRule"in n){for(u=[];f--;)u.push("("+b(t[f])+":"+r+")");return u=u.join(" or "),ht("@supports ("+u+") { #modernizr { position: absolute; } }",function(n){return"absolute"==ot(n,null,"position")})}return i}function k(n,t,r,f){function c(){v&&(delete u.style,delete u.modElem)}var l,v,h,y,e,p,a;if((f=s(f,"undefined")?!1:f,!s(r,"undefined"))&&(l=ct(n,r),!s(l,"undefined")))return l;for(a=["modernizr","tspan","samp"];!u.style&&a.length;)v=!0,u.modElem=o(a.shift()),u.style=u.modElem.style;for(y=n.length,h=0;y>h;h++)if(e=n[h],p=u.style[e],rt(e,"-")&&(e=ut(e)),u.style[e]!==i){if(f||s(r,"undefined"))return c(),"pfx"==t?e:!0;try{u.style[e]=r}catch(w){}if(u.style[e]!=p)return c(),"pfx"==t?e:!0}return c(),!1}function d(n,t,i,r,u){var f=n.charAt(0).toUpperCase()+n.slice(1),e=(n+" "+y.join(f+" ")+f).split(" ");return s(t,"string")||s(t,"undefined")?k(e,t,r,u):(e=(n+" "+p.join(f+" ")+f).split(" "),et(e,t,i))}function l(n,t,r){return d(n,i,i,t,r)}var g=[],h=[],f={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(n,t){var i=this;setTimeout(function(){t(i[n])},0)},addTest:function(n,t,i){h.push({name:n,fn:t,options:i})},addAsyncTest:function(n){h.push({name:null,fn:n})}},r=function(){},e,c,v,y,p,w,u,nt,a;for(r.prototype=f,r=new r,r.addTest("localstorage",function(){var n="modernizr";try{return localStorage.setItem(n,n),localStorage.removeItem(n),!0}catch(t){return!1}}),r.addTest("sessionstorage",function(){var n="modernizr";try{return sessionStorage.setItem(n,n),sessionStorage.removeItem(n),!0}catch(t){return!1}}),e=t.documentElement,c="svg"===e.nodeName.toLowerCase(),r.addTest("audio",function(){var t=o("audio"),n=!1;try{n=!!t.canPlayType;n&&(n=new Boolean(n),n.ogg=t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=t.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,""),n.opus=t.canPlayType('audio/ogg; codecs="opus"')||t.canPlayType('audio/webm; codecs="opus"').replace(/^no$/,""),n.wav=t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(i){}return n}),r.addTest("canvas",function(){var n=o("canvas");return!(!n.getContext||!n.getContext("2d"))}),r.addTest("adownload",!n.externalHost&&"download"in o("a")),v="Moz O ms Webkit",y=f._config.usePrefixes?v.split(" "):[],f._cssomPrefixes=y,p=f._config.usePrefixes?v.toLowerCase().split(" "):[],f._domPrefixes=p,w={elem:o("modernizr")},r._q.push(function(){delete w.elem}),u={style:w.elem.style},r._q.unshift(function(){delete u.style}),nt=f.testProp=function(n,t,r){return k([n],i,t,r)},r.addTest("textshadow",nt("textShadow","1px 1px")),f.testAllProps=d,f.testAllProps=l,r.addTest("cssgridlegacy",l("grid-columns","10px",!0)),r.addTest("cssgrid",l("grid-template-rows","none",!0)),r.addTest("flexbox",l("flexBasis","1px",!0)),r.addTest("fetch","fetch"in n),it(),tt(g),delete f.addTest,delete f.addAsyncTest,a=0;a<r._q.length;a++)r._q[a]();n.Modernizr=r}(window,document),function(n){var t,r,i;typeof define=="function"&&define.amd&&(define(n),t=!0);typeof exports=="object"&&(module.exports=n(),t=!0);t||(r=window.Cookies,i=window.Cookies=n(),i.noConflict=function(){return window.Cookies=r,i})}(function(){function n(){for(var n=0,r={},t,i;n<arguments.length;n++){t=arguments[n];for(i in t)r[i]=t[i]}return r}function t(n){return n.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function i(r){function u(){}function f(t,i,f){var s,o,e;if(typeof document!="undefined"){f=n({path:"/"},u.defaults,f);typeof f.expires=="number"&&(f.expires=new Date(new Date*1+f.expires*864e5));f.expires=f.expires?f.expires.toUTCString():"";try{s=JSON.stringify(i);/^[\{\[]/.test(s)&&(i=s)}catch(h){}i=r.write?r.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);o="";for(e in f)f[e]&&(o+="; "+e,f[e]!==!0)&&(o+="="+f[e].split(";")[0]);return document.cookie=t+"="+i+o}}function e(n,i){var s,u,f;if(typeof document!="undefined"){for(var e={},h=document.cookie?document.cookie.split("; "):[],o=0;o<h.length;o++){s=h[o].split("=");u=s.slice(1).join("=");i||u.charAt(0)!=='"'||(u=u.slice(1,-1));try{if(f=t(s[0]),u=(r.read||r)(u,f)||t(u),i)try{u=JSON.parse(u)}catch(c){}if(e[f]=u,n===f)break}catch(c){}}return n?e[n]:e}}return u.set=f,u.get=function(n){return e(n,!1)},u.getJSON=function(n){return e(n,!0)},u.remove=function(t,i){f(t,"",n(i,{expires:-1}))},u.defaults={},u.withConverter=i,u}return i(function(){})});$.fn.setCursorPosition=function(n){var t="character";return this.each(function(i,r){if(r.setSelectionRange)r.setSelectionRange(n,n);else if(r.createTextRange){var u=r.createTextRange();u.collapse(!0);u.moveEnd(t,n);u.moveStart(t,n);u.select()}}),this};var xwi=function(){function n(n,t){t===void 0&&(t="Info");$.post("/JSON/nLog.ashx",{Info:n,Level:t})}function s(t){var h=t.buttons||"#PayPalDiv",r=t.id||"",l=r!=="",v="XWord Info ".concat(l?"renewal":"account"),y=l?"/Account/Renewal.aspx":"/Account/ThankYou.aspx",p=$(".buttons",h),i=$(".ppComment",h),a="Error",c=t.amount||"20.0",s="unknown";i.html("").hide();paypal.Buttons({createOrder:function(n,t){i.html("Creating order...").show();var u=$("input:checked",h),r=u.val().split(":");return s=r[0],c=r[1],t.order.create({purchase_units:[{amount:{value:c},description:v}]})},onApprove:function(t,h){return h.order.capture().then(function(h){i.html("Processing...").show();var l={payerID:t.payerID,orderID:t.orderID,amount:c,level:s,xwiName:r,email:h.payer.email_address,firstName:h.payer.name.given_name,lastName:h.payer.name.surname,width:screen.availWidth,height:screen.availHeight,ua:navigator!=null?navigator.userAgent:null};return n("Transaction approved for [".concat(l.firstName," ").concat(l.lastName,"] as ").concat(s)),Cookies.set(f,t.payerID,{expires:14}),Cookies.set(e,t.orderID,{expires:14}),Cookies.set(o,s,{expires:14}),$.post("/Account/Checkout.aspx",$.param($.extend(h,l)),function(n){var t=$.extend(l,n);window.location.href=y+"?"+$.param(t)},"json").fail(function(t){n('Checkout post for "'.concat(r,'" failed: ').concat(t.statusText).concat(u),a);i.html("FAIL: ".concat(t.statusText)).show()})})},onCancel:function(){n("PayPal transaction [canceled]");i.html("Transaction canceled").show()},onError:function(t){t.indexOf("navigated")===-1&&(n('Create order for "'.concat(r,'" failed: ').concat(t),a),i.html(t+u).show())}}).render(p[0])}function h(n,t,i){var r=$(".nytStatus");n?r.html("You're special. Your XWord Info account bypasses the standard NYT check."):validateNYT(1).always(function(){validateNYT.IsValid?r.html("You are logged in to your NYT Games Subscription. You can access NYT Solve and PDF links from XWord Info."):r.html("You do not appear to be logged in to your NYT Games Subscription.")});$(".nytStatusDlg").dialog({position:{my:t,at:i,of:".nytStatusLink"},buttons:[{text:"OK",click:function(){$(this).dialog("close")}}]})}var t="ckSynd",i="true",f="payerID",e="orderID",o="level",r="wv",u="<div>Please <a href='mailto:support@xwordinfo.com?subject=PayPal issue'>contact us<\/a>.<\/div>";return{isSyndMode:function(){return Cookies.get(t)===i},setSyndMode:function(){Cookies.set(t,i)},clearSyndMode:function(){Cookies.remove(t)},tooltipsEnabled:function(){return Cookies.get("gridtt")!=="false"},isLocalHost:function(){var n=location.hostname;return n==="localhost"},LoadImg:function(){$("img[data-src]").each(function(){$(this).attr({src:$(this).attr("data-src")})})},supportsDragAndDropFileUpload:function(){var n=document.createElement("div");return("draggable"in n||"ondragstart"in n&&"ondrop"in n)&&"FormData"in window&&"FileReader"in window},nLog:function(t,i){n(t,i)},MakeRoom:function(n){if(n===void 0&&(n=250),Modernizr.localstorage){console.log("xwi.MakeRoom(".concat(n,") called"));var i=[],r=0,t;try{for(t in window.localStorage)if(window.localStorage.hasOwnProperty(t)&&t.charCodeAt(0)>="0".charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)&&(i[r++]=t,n!==-1&&r>=n))break}catch(u){window.localStorage.clear()}for(t in i)i.hasOwnProperty(t)&&window.localStorage.removeItem(i[t])}},nytStatus:function(n,t,i){return t===void 0&&(t="center bottom"),i===void 0&&(i="right top"),h(n,t,i)},PayPal:function(n){s(n)},FAQ:function(n){var t="open",i=$("div.A");Cookies.get(n)===t?i.show():(i.delay(1e3).show(600),Cookies.set(n,t))},winVer:function(){var n=Cookies.get(r);n||(n=-1,navigator.userAgentData&&navigator.userAgentData.getHighEntropyValues(["platformVersion"]).then(function(t){if(navigator.userAgentData.platform==="Windows"){var i=parseInt(t.platformVersion.split(".")[0]);n=i>=13?11:i>0?10:0}Cookies.set(r,n)}))},unWrap:function(n,t){var i,r,u;t===void 0&&(t=!1);i="";for(r in n)n.hasOwnProperty(r)&&(i.length>0&&(i+=" ~ "),i+="".concat(r,"=").concat(n[r]));t?console.log("unWrap: ".concat(i)):(u=$("#explode"),u[0]?u.html(i):alert(i))}}}(),xwiFinder=function(){return{Go:function(){$(".wordbox").first().setCursorPosition(100).focus();xwi.winVer();xwiTT.Grid("a[href*='date=']",".XTab2");var n=$.connection.finderHub;$.connection.hub.start().done(function(){n.server.requestCount()});n.client.getCount=function(n){var t=$(".odometer"),f=t.text(),i=n.toLocaleString(),r="slide",e="backgroundColor",u;f!==i&&(u=t.hide(r,{direction:"down"},200),u.promise().done(function(){var n=t.text(i).show(r,{direction:"up"},300);n.promise().done(function(){t.css(e,"lawngreen").animate({backgroundColor:"white"},600)})}))}},InstBut:function(){$("#instbut").hide();$.getJSON("/JSON/FinderHelp.ashx",function(n){$("#inst").html(n.Data).show(500)})},Clean:function(){var n=window.location.toString(),t;n.indexOf("?")>0&&(t=n.substring(0,n.indexOf("?")),window.history.replaceState({},document.title,t))}}}(),LZString=function(){function r(n,t){if(!i[n]){i[n]={};for(var r=0;r<n.length;r++)i[n][n.charAt(r)]=r}return i[n][t]}var t=String.fromCharCode,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={},n={compressToBase64:function(t){if(null==t)return"";var i=n._compress(t,6,function(n){return u.charAt(n)});switch(i.length%4){default:case 0:return i;case 1:return i+"===";case 2:return i+"==";case 3:return i+"="}},decompressFromBase64:function(t){return null==t?"":""==t?null:n._decompress(t.length,32,function(n){return r(u,t.charAt(n))})},compressToUTF16:function(i){return null==i?"":n._compress(i,15,function(n){return t(n+32)})+" "},decompressFromUTF16:function(t){return null==t?"":""==t?null:n._decompress(t.length,16384,function(n){return t.charCodeAt(n)-32})},compressToUint8Array:function(t){for(var f,r=n.compress(t),u=new Uint8Array(2*r.length),i=0,e=r.length;e>i;i++)f=r.charCodeAt(i),u[2*i]=f>>>8,u[2*i+1]=f%256;return u},decompressFromUint8Array:function(i){var f;if(null===i||void 0===i)return n.decompress(i);for(var u=new Array(i.length/2),r=0,e=u.length;e>r;r++)u[r]=256*i[2*r]+i[2*r+1];return f=[],u.forEach(function(n){f.push(t(n))}),n.decompress(f.join(""))},compressToEncodedURIComponent:function(t){return null==t?"":n._compress(t,6,function(n){return f.charAt(n)})},decompressFromEncodedURIComponent:function(t){return null==t?"":""==t?null:(t=t.replace(/ /g,"+"),n._decompress(t.length,32,function(n){return r(f,t.charAt(n))}))},compress:function(i){return n._compress(i,16,function(n){return t(n)})},_compress:function(n,t,i){if(null==n)return"";for(var f,e,l={},v={},a="",p="",o="",c=2,w=3,s=2,h=[],r=0,u=0,y=0;y<n.length;y+=1)if(a=n.charAt(y),Object.prototype.hasOwnProperty.call(l,a)||(l[a]=w++,v[a]=!0),p=o+a,Object.prototype.hasOwnProperty.call(l,p))o=p;else{if(Object.prototype.hasOwnProperty.call(v,o)){if(o.charCodeAt(0)<256){for(f=0;s>f;f++)r<<=1,u==t-1?(u=0,h.push(i(r)),r=0):u++;for(e=o.charCodeAt(0),f=0;8>f;f++)r=r<<1|1&e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e>>=1}else{for(e=1,f=0;s>f;f++)r=r<<1|e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e=0;for(e=o.charCodeAt(0),f=0;16>f;f++)r=r<<1|1&e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e>>=1}c--;0==c&&(c=Math.pow(2,s),s++);delete v[o]}else for(e=l[o],f=0;s>f;f++)r=r<<1|1&e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e>>=1;c--;0==c&&(c=Math.pow(2,s),s++);l[p]=w++;o=String(a)}if(""!==o){if(Object.prototype.hasOwnProperty.call(v,o)){if(o.charCodeAt(0)<256){for(f=0;s>f;f++)r<<=1,u==t-1?(u=0,h.push(i(r)),r=0):u++;for(e=o.charCodeAt(0),f=0;8>f;f++)r=r<<1|1&e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e>>=1}else{for(e=1,f=0;s>f;f++)r=r<<1|e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e=0;for(e=o.charCodeAt(0),f=0;16>f;f++)r=r<<1|1&e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e>>=1}c--;0==c&&(c=Math.pow(2,s),s++);delete v[o]}else for(e=l[o],f=0;s>f;f++)r=r<<1|1&e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e>>=1;c--;0==c&&(c=Math.pow(2,s),s++)}for(e=2,f=0;s>f;f++)r=r<<1|1&e,u==t-1?(u=0,h.push(i(r)),r=0):u++,e>>=1;for(;;){if(r<<=1,u==t-1){h.push(i(r));break}u++}return h.join("")},decompress:function(t){return null==t?"":""==t?null:n._decompress(t.length,32768,function(n){return t.charCodeAt(n)})},_decompress:function(n,i,r){for(var k,y,e,o,s,f,h,c=[],l=4,a=4,p=3,w="",b=[],u={val:r(0),position:i,index:1},v=0;3>v;v+=1)c[v]=v;for(e=0,s=Math.pow(2,2),f=1;f!=s;)o=u.val&u.position,u.position>>=1,0==u.position&&(u.position=i,u.val=r(u.index++)),e|=(o>0?1:0)*f,f<<=1;switch(k=e){case 0:for(e=0,s=Math.pow(2,8),f=1;f!=s;)o=u.val&u.position,u.position>>=1,0==u.position&&(u.position=i,u.val=r(u.index++)),e|=(o>0?1:0)*f,f<<=1;h=t(e);break;case 1:for(e=0,s=Math.pow(2,16),f=1;f!=s;)o=u.val&u.position,u.position>>=1,0==u.position&&(u.position=i,u.val=r(u.index++)),e|=(o>0?1:0)*f,f<<=1;h=t(e);break;case 2:return""}for(c[3]=h,y=h,b.push(h);;){if(u.index>n)return"";for(e=0,s=Math.pow(2,p),f=1;f!=s;)o=u.val&u.position,u.position>>=1,0==u.position&&(u.position=i,u.val=r(u.index++)),e|=(o>0?1:0)*f,f<<=1;switch(h=e){case 0:for(e=0,s=Math.pow(2,8),f=1;f!=s;)o=u.val&u.position,u.position>>=1,0==u.position&&(u.position=i,u.val=r(u.index++)),e|=(o>0?1:0)*f,f<<=1;c[a++]=t(e);h=a-1;l--;break;case 1:for(e=0,s=Math.pow(2,16),f=1;f!=s;)o=u.val&u.position,u.position>>=1,0==u.position&&(u.position=i,u.val=r(u.index++)),e|=(o>0?1:0)*f,f<<=1;c[a++]=t(e);h=a-1;l--;break;case 2:return b.join("")}if(0==l&&(l=Math.pow(2,p),p++),c[h])w=c[h];else{if(h!==a)return null;w=y+y.charAt(0)}b.push(w);c[a++]=y+w.charAt(0);l--;y=w;0==l&&(l=Math.pow(2,p),p++)}}};return n}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString);xwiTT=function(){"use strict";function k(n,t){var i=n.replace(/>.</g,"><").replace(/'rebus'/g,"").replace(/background-color/g,"x");return t&&(i=i.replace(/dblack/g,"").replace(/shape/g,"").replace(/2px solid/g,"1px solid")),i}function d(n){return LZString.decompressFromUTF16(n)}function g(n){return LZString.compressToUTF16(n)}function nt(n){return LZString.decompressFromEncodedURIComponent(n)}function o(r,u,o){if(f){var v=null,a={my:i,at:t,hide:!1};if(typeof o===e?(a=o,v=u):typeof u===e?a=u:typeof u===l&&(v=u),a)a.my||(a.my=i),a.at||(a.at=t);else return;$(r,v).tooltip({items:"a",classes:{"ui-tooltip":"ttGrid"},position:{my:a.my,at:a.at},show:{duration:200,delay:200},hide:100,content:function(t){function e(n){var i="data-".concat(n),t;return r=l.attr(i),r||(t=l.parent(),t&&(r=t.attr(i))),!!r}function wt(n){var t="<\/caption>",i="thumb";return rt?(tt=!0,i+=" modPdf",n=n.replace(t," - PDF".concat(t))):o?(tt=!0,i+=" modNytSolve",n=n.replace(t," - Solve".concat(t))):v&&(tt=!0),tt&&(i+=" empty",n=k(n,f)),n.replace("thumb",i)}var l=$(this),tt=a.hide,i,ct,u,lt,ot,ut,st,at,vt,ht;if(Cookies.get("gridans")==="false"&&(tt=!0),i=l.attr("href"),!i)return"";i=i.toLowerCase().replace("#","&");var r,yt,p=null,y,it=!1,f=!1,rt=!1,pt=!1,o=!1,v=!1;if(e("date")||(e("SolveDate")?v=!0:e("VarDate")?f=!0:e("VarSolveDate")?(v=!0,f=!0):e("AcrDate")?(it=!0,f=!0,v=!0):e("PdfDate")?(o=!0,rt=!0):e("PdfVarDate")?(o=!0,rt=!0,f=!0):e("PdfAcrDate")?(o=!0,rt=!0,f=!0,it=!0):e("NytDate")?(o=!0,v=!0):e("NytVarDate")?(o=!0,v=!0,f=!0):e("NytAcrDate")&&(o=!0,v=!0,f=!0,it=!0)),!r&&(i.indexOf(".pdf")>0?(o=!0,rt=!0):i.indexOf("acrostic")>-1?(f=!0,it=!0):i.indexOf("var")>0||i.indexOf("type")>0?f=!0:i.indexOf(".2.p")>0||i.indexOf("bonus")>0?(f=!0,i=i.replace(".2","")):i.indexOf("daily")>0&&(o=!0,v=!0),ct=i.indexOf("date="),u=i.indexOf(".p"),ct>-1&&(r=i.substring(ct+5),lt=r.indexOf("&"),lt!==-1&&(r=r.substring(0,lt))),!r)){var w=void 0,ft=void 0,et=void 0;if(i.indexOf("bonus")>-1||i.indexOf("daily")>-1||i.indexOf("variety")>-1)w=parseInt(i.substring(u-10,u-6)),ft=parseInt(i.substring(u-5,u-3)),et=parseInt(i.substring(u-2,u)),r=ft+"/"+et+"/"+w;else if(u>-1){for(var bt=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],kt=i.substring(u-7,u-4),b=void 0,b=0;b<12;b+=1)if(kt===bt[b])break;if(b>=12)return l.tooltip({classes:{"ui-tooltip":"ttError"}}),"Can't parse date";ft=b+1;et=parseInt(i.substring(u-4,u-2),10);w=parseInt(i.substring(u-2,u),10);w+=w>50?1900:2e3;r=ft+"/"+et+"/"+w}}if(r)p=r,f&&(p+="v"),ot=r.split("/"),yt=new Date(parseInt(ot[2]),parseInt(ot[0])-1,parseInt(ot[1])),pt=yt<c;else return l.tooltip({classes:{"ui-tooltip":"ttError"}}),"no grid found";if(ut="ttGrid",pt?ut+=" ttPSGrid":o&&(ut+=" ttNytGrid"),h&&(st="version",at=0,window.localStorage[st]&&(at=Number(window.localStorage[st])),at!==s&&(xwi.MakeRoom(-1),window.localStorage[st]=s),window.localStorage[p]&&(y=window.localStorage[p],y&&y.length>20&&(vt=d(y),vt.toLowerCase().indexOf("error")===-1))))return l.tooltip({classes:{"ui-tooltip":ut}}),wt(vt);ht={date:r,type:""};it?ht.type="a":f&&(ht.type="v");l.addClass(n);$.getJSON("/JSON/ThumbData.ashx",ht,function(i){if(l.removeClass(n),!i){console.log("no thumbData for date ".concat(r));return}if(!i.grid||i.grid.length===0){console.log("*** invalid data from /ThumbData.ashx for ".concat(r," : ").concat(i.grid));return}var u=nt(i.grid);if(h){y=g(u);try{window.localStorage[p]=y}catch(f){xwi.MakeRoom();window.localStorage[p]=y}}l.tooltip({classes:{"ui-tooltip":ut+" ttAjaxGrid"}});t(wt(u))})}}).click(function(){$(this).tooltip("close")})}}function tt(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function r(n,t,i){return n.replace(new RegExp(tt(t),"g"),i)}function it(n,t){for(var i=0;i<t.length;i++)n=r(n,t.charAt(i),"");return n}function a(n){return n=r(n,"é","e"),n=r(n,"%c3%a9","e"),n=r(n,"ñ","n"),n=r(n,"%c3%b1","n"),it(n,"+ .'")+".jpg"}function v(n,r){f&&$(n,r).tooltip({items:"a",classes:{"ui-tooltip":"ttCon"},show:{duration:200,delay:100},hide:100,position:{my:i,at:t},content:function(){var n=this.href.indexOf("author=");return n<0?"?":'<img src="/images/cons/'.concat(a(this.href.substring(n+7)),'" />')}}).click(function(){$(this).tooltip("close")})}function y(r,e){!f||$(document).width()<435||$(r,e).tooltip({items:"a",classes:{"ui-tooltip":"ttCard"},show:{duration:200,delay:100},hide:100,position:{my:i,at:t},content:function(t){var s=this.href.indexOf("author="),f=$(this),i,e,o,r;if(s<0)return"?";if(i=this.href.substring(s+7),i.toLowerCase()==="unknown"||i.indexOf("+and+")>0)return"";if(e="tt"+i,u&&(o=window.sessionStorage[e],o))return o;f.addClass(n);$.getJSON("/JSON/BBCardData.ashx",{author:i},function(i){if(f.removeClass(n),u)try{window.sessionStorage[e]=i.BBCard}catch(r){}t(i.BBCard)});r=i.replace(/\+/g," ");r=decodeURIComponent(r);var h=r.length>21?"bbName2":"bbName",c="<div class='".concat(h,"'>").concat(r,"<\/div>"),l=f.hasClass("hasphoto")?a(r):"unknown.jpg",v="<div class='photo'><img src='/images/cons/".concat(l,"' /><\/div>");return"<div class='bbCard bbTemp'><div class='bbInfo'>".concat(c).concat("<div class='wait'><img src='/images/ajax-loader3.gif' /><\/div>","<\/div>").concat(v,"<\/div>")}}).click(function(){$(this).tooltip("close")})}function rt(t,r){$(t,r).tooltip({items:"a",classes:{"ui-tooltip":"ginfo"},show:{duration:200,delay:100},hide:100,position:{my:i,at:"right+1 top-1"},content:function(t){var o=$(this),l=new Date,s=l.getTime(),e,i=this.href.indexOf("name="),r,f,h,c;if(i<0)return"?";if(r=this.href.substring(i+5),u&&window.sessionStorage[r]){if(f=window.sessionStorage[r],i=f.indexOf("~"),i<0)return"??";if(h=parseInt(f.substring(0,i)),c=(s-h)/1e3,c<b)return f.substring(i+1)}o.addClass(n);$.getJSON("/JSON/InfoGrid.ashx",{name:r},function(i){(o.removeClass(n),i)&&(e=i.InfoGrid,u&&(window.sessionStorage[r]=s+"~"+e),t(e))})}}).click(function(){$(this).tooltip("close")})}function p(){var n=$("[data-tdate], [data-vdate], [data-adate]");n.hover(function(){$("body").css("cursor","pointer")},function(){$("body").css("cursor","default")});n.click(function(){var r=$(this).attr("data-vdate"),u=$(this).attr("data-adate"),f=$(this).attr("data-tdate"),t,n,i,e;if(r)n=r,t="/Variety";else if(u)n=u,t="/Acrostic";else if(f)n=f,i=n.split("/"),e=new Date(parseInt(i[2]),parseInt(i[0])-1,parseInt(i[1])),t=e<c?"/PS":"/Crossword";else return;document.location.href="".concat(t,"?date=").concat(n)})}function w(n,r,u){if(p(),f){var o={my:i,at:t},s=null,h=!1;typeof u===e?(s=r,o=u,h=!0):typeof r===e?(o=r,h=!0):typeof r===l&&(s=r);$(n,s).tooltip({items:"table,img,a",classes:{"ui-tooltip":"ttLite gold"},show:{duration:200,delay:100},hide:100,content:function(){var n=$(this),i,r,u,f,e;return(h?(i=o.my,r=o.at):(i=n.is("table")?"right-1 bottom+4":n.is("img")?"right bottom+2":"left-4 bottom+4",r=t),n.tooltip({position:{my:i,at:r,collision:"flipfit"}}),u=n.attr("data-ttCon"),u)?u:(f=n.attr("title"),f)?f:(e=n.attr("alt"),e?e:void 0)}}).click(function(){$(this).tooltip("close")})}}function ut(n){$(n).tooltip({items:"div",classes:{"ui-tooltip":"gen"},show:{duration:200,delay:100},hide:100,content:function(){var t=$(this),n;return t.tooltip({position:{my:"center bottom",at:"center top-4",collision:"flipfit"}}),n=t.attr("data-Gen"),n?"<div>".concat(n,"<\/div>"):void 0}}).click(function(){$(this).tooltip("close")})}var s=25,h=Modernizr.localstorage,u=Modernizr.sessionstorage,f=xwi.tooltipsEnabled(),c=new Date(1993,10,21),l="string",e="object",b=60,n="waiting",t="right top",i="left bottom";return{Grid:function(n,t,i){o(n,t,i)},BBCard:function(n,t){y(n,t)},ConPhoto:function(n,t){v(n,t)},Title:function(n,t,i){w(n,t,i)},Gen:function(n){ut(n)},TDates:function(){return p()},Expand:function(n){return LZString.decompressFromEncodedURIComponent(n)},InfoGrid:function(n,t){rt(n,t)},GoThumbs:function(){o("a.dtlink");o("a.hidelink",{hide:!0});o("a[href*='?date']");w("table.thumb");v("a.hasphoto");y("a[href*='?author']",".bio");$("div.thumbs:has(div.notepad)").css("margin","0");$("p",".notepad").each(function(){$(this).text().length===0&&$(this).hide()})}}}()