1function saveScrollPos(){var e=$("#viewport div.sheet:visible");if(0==e.length)return!1;var t=e.attr("id");for(i in scrollGroups)for(j in scrollGroups[i].sheets)if(scrollGroups[i].sheets[j]==t)return scrollGroups[i].pos=document.getElementById("viewport").scrollTop,!0;scrollGroups.push({sheets:[t],pos:document.getElementById("viewport").scrollTop})}function loadScrollPos(){var e=$("#viewport div.sheet:visible");if(0==e.length)return!1;var t=e.attr("id");for(i in scrollGroups)for(j in scrollGroups[i].sheets)if(scrollGroups[i].sheets[j]==t)return document.getElementById("viewport").scrollTop=scrollGroups[i].pos,!0;document.getElementById("viewport").scrollTop=0}function setSelectionRange(e,t,o){if(e.setSelectionRange)e.focus(),e.setSelectionRange(t,o);else if(e.createTextRange){var n=e.createTextRange();n.collapse(!0),n.moveEnd("character",o),n.moveStart("character",t),n.select()}}function replaceSelection(e,t){if(e.setSelectionRange){var o=e.selectionStart,n=e.selectionEnd;e.value=e.value.substring(0,o)+t+e.value.substring(n),o!=n?setSelectionRange(e,o,o+t.length):setSelectionRange(e,o+t.length,o+t.length)}else if(document.selection){var a=document.selection.createRange();if(a.parentElement()==e){var i=""==a.text;a.text=t,i||(a.moveStart("character",-t.length),a.select())}}}function buildHash(){var e="#!",t=$("#menu div.active");e+=0==t.length?"home":t.attr("class").replace(/Item.*$/,"");var o=$("#top .submenu.active .active");return 0!=o.length&&(e+="/"+o.attr("id").replace(/SubItem$/,"")),e}function nav2(e,t){var o="#!"+e;window.location.hash=o,nav2Hash(),t||track()}function nav2Hash(){var e=window.location.hash.substr(2);if(e!==lastHash){lastHash=e,""==e&&(e="home"),"home"!=e&&(showMenu(),doResize()),e=e.split("/");var t=e[e.length-1];if(0==$("#"+t).length||1==$("#"+t+":visible").length)return!1;document.getElementById("viewport").scrollTop;saveScrollPos(),1==e.length?menuSelect(e[0],!0):(menuSelect(e[0],!0),submenuSelect(e[1],!0)),"wordvariety"==t?initWordVariety():"flow"==t?initFlow():"associator"==t?""==$("#associations").html()&&associate():"aggregate"==t?isAggregateInitialized||(drawCharts(),isAggregateInitialized=!0):"words"==t?isWordsInitialized||(drawWordCounts(),isWordsInitialized=!0):"phrases"==t&&(isPhrasesInitialized||(drawPhraseCounts(),isPhrasesInitialized=!0)),$("#viewport div.sheet").hide(),$("#"+t).show(),$("#"+t).hasClass("fullWidth")?$("#viewport > .horizSlot").addClass("fullWidth"):$("#viewport > .horizSlot").removeClass("fullWidth"),"edit"==t&&(blnMobile||""!=$("#paper").val()||$("#paper").focus()),doResize(),loadScrollPos()}}function initHelp(){$("#helpdoc .title").addClass("closed").click(function(){$(this).toggleClass("closed")})}function showMenu(){$("body").hasClass("noMenu")&&($("body").removeClass("noMenu"),doResize())}function findSentence(e){saveScrollPos(),nav2("critique/structure");var t=$("#sentence"+e);return highlight(t),document.getElementById("viewport").scrollTop=t.position().top,!1}function highlight(e){$("#structure > p > h").removeClass("highlight"),$(e).addClass("highlight")}function learnMore(e){var t,o,n,a,i,s,r=($("textarea:focus").length>0,$("#helpdoc").children());return"quickStats"==e||"critique"==e?(o="Key Statistics",n=$("#quickStats").html(),t='<h3 class="title"><i class="fa fa-chart-pie"></i>'+o+'<small><a class="more" onclick="nav2(\'stats/aggregate\'); learnLess();">More »</a></small></h3><div class="body">'+n+"</div>",$("#learnMore > .content").html(t),showLearnMore(),doResize(),!1):(s=r.find("#"+e+"Explanation"),0!=s.length&&(o=s.children(".title").html(),n=s.children(".body").html(),a='<h3 class="title"><i class="fa fa-comment"></i>'+o+"</h3>",i='<div class="body">'+n+"</div>",t=a+i,$("#learnMore > .content").html(t),showLearnMore()),!1)}function learnMoreMarking(e){for(var t,o,n,a,i,s,r,l,c,d="",u=$("#helpdoc").children(),p=e;"H"==p.tagName;)t=$(p).attr("class").replace(/ highlight\b/,""),o=u.find("#"+t+"Explanation"),0!=o.length&&(c=$(p).data("markingIndex"),n=o.children(".title").html(),a=o.children(".body").html(),i='<h3 class="title"><i class="fa fa-comment"></i>'+n+"</h3>",s='<div class="body">'+a+"</div>",d+=isDefined(c)?"<div onmouseover=\"$('h:eq("+c+")').addClass('attention')\" onmouseout=\"$('h:eq("+c+")').removeClass('attention')\">":"<div>",d+=i+s+"</div>"),p=$(p).parent().get(0);r=$(e).text(),l=r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),""!=l&&(d+='<div><h3 class="title"><i class="fa fa-search"></i>Quick lookup</h3><div class="body"><p><em>“'+l+"”</em></p>"+quickLookup(r)+"</div></div>"),$("#learnMore > .content").html(d),$("#learnMore .content > div:not(:eq(0))").addClass("closed"),$("#learnMore .content > div").click(function(){$(this).hasClass("closed")&&($(this).removeClass("closed"),$(this).siblings().addClass("closed"))}),showLearnMore()}function learnMoreSelection(){var e;mouseUp&&(e="getSelection"in window&&"function"==typeof window.getSelection?(""!=window.getSelection()?window.getSelection():document.getSelection()).toString():document.selection.createRange().htmlText,e=e.substr(0,200),""==e||e==lastSelection||blnMobile&&textareaHasFocus||toolbox(e),lastSelection=e)}function toolbox(e){e=e.trim();var t=(escape(e),e.split(" ").length,e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"));if(""!=t){var o='<div><h3 class="title"><i class="fa fa-search"></i>Quick lookup</h3><div class="body"><em>“'+t+"”</em></div>"+quickLookup(e)+"</div>";$("#learnMore > .content").html(o),showLearnMore()}}function quickLookup(e){e=e.trim();var t=escape(e),o=e.split(" ").length,n="<a onclick=\"nav2('associator'); associate('"+e.replace(/"/g,"").replace(/'/g,"\\'")+"');\">Associated words</a>",a='<a href="https://www.merriam-webster.com/dictionary/'+t+'" target="_blank" rel="noopener">Dictionary</a>',i='<a href="https://www.merriam-webster.com/thesaurus/'+t+'" target="_blank" rel="noopener">Thesaurus</a>',s='<a href="https://www.rhymezone.com/r/rhyme.cgi?Word='+t+'&typeofrhyme=perfect&org1=syl&org2=l&org3=y" target="_blank" rel="noopener">Rhyming dictionary</a>',r='<a href="https://www.urbandictionary.com/define.php?term='+t+'" target="_blank" rel="noopener">Urban Dictionary</a>',l='<a href="https://en.wikipedia.org/w/index.php?title=Special:Search&search='+t+'" target="_blank" rel="noopener">Wikipedia</a>',c='<a href="https://www.google.com/search?q='+t+'" target="_blank" rel="noopener">Google</a>';return'<p id="quickLookup">'+n+(1==o?a+i+s:"")+r+l+c}function showLearnMore(){$("#learnMore").addClass("pop"),resizeLearnMore()}function learnLess(){$("#learnMore").removeClass("pop")}function processingMsg(e){$("#shadeText").text(void 0==e?"reading...":e).show(),requestAnimationFrame(function(){$("#shade").show()})}function hideShade(){requestAnimationFrame(function(){$("#shade, #shadeText").hide()})}function demo(){return blnSubmitting=!0,$("#paper").val(""),$("#preset").val($("#preset option:eq(0)").val()).change(),$("#demo").val("1"),proofread(),!1}function resizeTextarea(e){if(0!=$("#edit:visible").length){var t=$("#paper");if(!(e&&Math.abs(t.val().length-intLastLength)<20)){intLastLength=t.val().length;var o,n,a,i=document.getElementById("viewport").scrollTop,s=$("#viewport").outerHeight(),r=$("#fakePaper"),l=$("#topSlot:visible").outerHeight(),c=blnMobile?0:$("#learnMore:visible").outerHeight(),d=$("#bottomCheckButtonWrapper"),u=d.outerHeight()+parseFloat(d.css("marginBottom"));r.text(t.val()+"\n\n"),o=s-3*parseFloat(t.parent().css("paddingTop"))-l-u-c,t.css("minHeight")!=o&&t.css("minHeight",o),n=t.width(),r.width!=n&&r.width(n);for(var p=0;2!=p;++p)a=r.height()+parseInt(t.css("paddingTop"))+parseInt(t.css("paddingBottom")),t.height!=a&&a>o?t.height(a):t.height("auto");document.getElementById("viewport").scrollTop!=i&&(document.getElementById("viewport").scrollTop=i)}}}function checkAll(e){var t=!!$(e).prop("checked"),o=$(e).closest(".optionContainer").find(".option input[type=checkbox]");o.prop("checked",t),""!=document.getElementById("paper").value&&showProofreadButton()}function toggleFunctionWords(e){return $(e).hasClass("active")?($
1(e).removeClass("active"),$("#wordStatsTable > thead > td").first().width($("#wordStatsTable > thead > td").first().width()),$("#wordStatsTable tr.function").hide()):($(e).addClass("active"),$("#wordStatsTable tr.function").show()),!1}function toggleUncommonWords(e){return $(e).hasClass("active")?($(e).removeClass("active"),$("#wordStatsTable > thead > td").first().width($("#wordStatsTable > thead > td").first().width()),$("#wordStatsTable tr.uncommon").hide()):($(e).addClass("active"),$("#wordStatsTable tr.uncommon").show()),!1}function loadPreset(e,t){var o=$("#preset").val();if("custom"!=o){var n=objPresets[o];$("input[type=checkbox], input[type=text]").each(function(){var e=$(this).attr("name");void 0==n.values[e]?"checkbox"==$(this).attr("type")&&$(this).prop("checked",!1):"checkbox"==$(this).attr("type")?$(this).prop("checked",!0):$(this).val(n.values[e])})}t=isDefined(t)?t:!0,t&&("honesty"==o?learnMore("honestypreset"):"justthestats"==o?learnMore("justthestatspreset"):learnLess()),updateSettingsCookies(),void 0!=e&&!e||""==document.getElementById("paper").value||showProofreadButton()}function updateSettingsCookies(){$("#settings .option input[type=checkbox]:checked, #preset").each(function(){setCookie($(this).attr("name"),this.value)}),$("#settings .option input[type=checkbox]:not(:checked)").each(function(){deleteCookie($(this).attr("name"))})}function loadSentenceStats(){var e;for(x=0;x<arrSentenceTable.length;++x)e=arrSentenceTable.eq(x).children("td"),arrSentenceStats[x]=[e.eq(3).text(),parseInt(e.eq(4).text()),parseFloat(e.eq(5).text())]}function drawFlowMeters(){flowInitialized||loadSentenceStats();var e=fltTmpSentenceLengthFlowPeak=fltWordLengthFlowPeak=fltTmpWordLengthFlowPeak=0;for(x=0;x<arrSentenceTable.length;++x)drawTypeFlowMeter(x,0,6),fltTmpSentenceLengthFlowPeak=calculateLengthFlow(x,1,-1),fltTmpSentenceLengthFlowPeak>e&&(e=fltTmpSentenceLengthFlowPeak),fltTmpWordLengthFlowPeak=calculateLengthFlow(x,2,1),fltTmpWordLengthFlowPeak>fltWordLengthFlowPeak&&(fltWordLengthFlowPeak=fltTmpWordLengthFlowPeak);for(arrSentenceTable.css("backgroundColor","transparent"),arrSentenceTable.find("div.sentencelength").removeClass("poorflow").removeClass("poorflow1").removeClass("poorflow2").removeClass("poorflow3").removeClass("poorflow4").removeClass("poorflowlong").removeClass("poorflowshort"),arrSentenceFlows=[],x=0;x<arrSentenceTable.length;++x)arrSentenceFlows.push(drawSentenceLengthFlowMeter(x,e,1,7)),drawWordLengthFlowMeter(x,fltWordLengthFlowPeak,2,8,1);flowInitialized=!0}function markFlowProblems(){var e,t,o=20,n=5,a=0,i=arrSentenceTable.find("div.sentencelength");for(arrSentenceTable.css("backgroundColor","transparent"),i.removeClass("poorflow").removeClass("poorflow1").removeClass("poorflow2").removeClass("poorflow3").removeClass("poorflow4").removeClass("poorflowlong").removeClass("poorflowshort"),e=o;e>n;--e){var s,r,l=[];for(r=0;r<arrSentenceFlows.length;++r)l.push(arrSentenceFlows[r]),r>1&&4==l.length&&(l.shift(),t=i.eq(r-1),t.hasClass("poorflow")||(++a,s=l[0]+(l[2]-l[0])/2,fltDeviation=l[1]-s,fltDeviation>e&&l[2]>l[0]?t.addClass("poorflow poorflow1"):fltDeviation<-e&&l[2]<l[0]?t.addClass("poorflow poorflow2"):fltDeviation>e&&l[2]<l[0]?t.addClass("poorflow poorflow3"):fltDeviation<-e&&l[2]>l[0]?t.addClass("poorflow poorflow4"):--a));if(a>.05*arrSentenceFlows.length)break}0!=a&&$("#viewport").animate({scrollTop:arrSentenceTable.find(".poorflow").offset().top-200},250),learnMore("flowSuggestions")}function drawTypeFlowMeter(e,t,o){var n=intSimple=intCompound=intComplex=intCompoundComplex=intSampleSize=0,a=objType=objTD=!1,s=e+intFlowLookaround>=arrSentenceTable.length?arrSentenceTable.length-1:e+intFlowLookaround,r=e-intFlowLookaround;for(i=s;i>0&&i>=r;--i)++intSampleSize,a=arrSentenceStats[i][t],"fragment"==a?++n:"simple"==a?++intSimple:"compound"==a?++intCompound:"complex"==a?++intComplex:++intCompoundComplex;var l=arrSentenceTable.eq(e).children("td").eq(o).children(".flow");objFragment=l.children().first(),objFragment.width(Math.round(n/intSampleSize*100)+"%"),objSimple=objFragment.next(),objSimple.width(Math.round(intSimple/intSampleSize*100)+"%"),objCompound=objSimple.next(),objCompound.width(Math.round(intCompound/intSampleSize*100)+"%"),objComplex=objCompound.next(),objComplex.width(Math.round(intComplex/intSampleSize*100)+"%"),blnMobile||(flowInitialized&&(objFragment.unbind("mouseover").unbind("mouseout"),objSimple.unbind("mouseover").unbind("mouseout"),objCompound.unbind("mouseover").unbind("mouseout"),objComplex.unbind("mouseover").unbind("mouseout"),l.unbind("mouseover").unbind("mouseout")),objFragment.data("percent",parseFloat(n/intSampleSize*100).toFixed(1)),objFragment.mouseover(function(e){mistakeoscopeMessage(e,l,"Fragment: "+$(this).data().percent+"%","fragment")}),objFragment.mouseout(function(){hideMistakeoscope()}),objSimple.data("percent",parseFloat(intSimple/intSampleSize*100).toFixed(1)),objSimple.mouseover(function(e){mistakeoscopeMessage(e,l,"Simple: "+$(this).data().percent+"%","simple")}),objSimple.mouseout(function(){hideMistakeoscope()}),objCompound.data("percent",parseFloat(intCompound/intSampleSize*100).toFixed(1)),objCompound.mouseover(function(e){mistakeoscopeMessage(e,l,"Compound: "+$(this).data().percent+"%","compound")}),objCompound.mouseout(function(){hideMistakeoscope()}),objComplex.data("percent",parseFloat(intComplex/intSampleSize*100).toFixed(1)),objComplex.mouseover(function(e){mistakeoscopeMessage(e,l,"Complex: "+$(this).data().percent+"%","complex")}),objComplex.mouseout(function(){hideMistakeoscope()}),l.data("percent",parseFloat(intCompoundComplex/intSampleSize*100).toFixed(1)),l.mouseover(function(e){1==$("#mistakeoscope").children().length&&mistakeoscopeMessage(e,l,"Compound-complex: "+$(this).data().percent+"%","compoundcomplex")}),l.mouseout(function(){hideMistakeoscope()}))}function drawSentenceLengthFlowMeter(e,t,o,n){var a=intLongSentences=intWords=intSentenceWords=0,s=e+intFlowLookaround>=arrSentenceTable.length?arrSentenceTable.length-1:e+intFlowLookaround,r=e-intFlowLookaround;for(i=s;i>0&&i>=r;--i)++a,intSentenceWords=arrSentenceStats[i][o],intWords+=intSentenceWords,intSentenceWords>=intLongSentenceLimit&&++intLongSentences;var l=arrSentenceTable.eq(e).children("td").eq(n).children(".flow"),c=intWords/a/t;l.children(".sentencelength").width(parseInt(100*c)+"%"),l.children(".overlay").text((intWords/a).toFixed(1));var d=l.children(".longsentence");return 0!=intLongSentences?(d.css("display","inline-block"),l.children(".longsentence").css("left",Math.round(intLongSentences/a*100-1)+"%"),blnMobile||(flowInitialized&&l.unbind("mouseover").unbind("mouseout"),l.data("percent",parseFloat(intLongSentences/a*100).toFixed(1)),l.mouseover(function(e){mistakeoscopeMessage(e,l,"Long: "+$(this).data().percent+"%","longsentence")}),l.mouseout(function(){hideMistakeoscope()}))):(d.hide(),!blnMobile&&flowInitialized&&l.unbind("mouseover").unbind("mouseout")),c}function highlightControlSentence(e){var t=-1;arrSentenceTable.css("backgroundColor","transparent");var o=arrSentenceTable.eq(e);
1if(0!=o.find("div.poorflow1").length?(t=e-intFlowLookaround,arrSentenceTable.eq(e-intFlowLookaround).css("backgroundColor","#cce6ff"),learnMore("flowSuggestion1")):0!=o.find("div.poorflow2").length?(t=e-intFlowLookaround,arrSentenceTable.eq(e-intFlowLookaround).css("backgroundColor","#cce6ff"),learnMore("flowSuggestion2")):0!=o.find("div.poorflow3").length?(t=e+intFlowLookaround,arrSentenceTable.eq(e+intFlowLookaround).css("backgroundColor","#cce6ff"),learnMore("flowSuggestion3")):0!=o.find("div.poorflow4").length?(t=e+intFlowLookaround,arrSentenceTable.eq(e+intFlowLookaround).css("backgroundColor","#cce6ff"),learnMore("flowSuggestion4")):(arrSentenceTable.eq(e-intFlowLookaround).css("backgroundColor","#cce6ff"),arrSentenceTable.eq(e+intFlowLookaround).css("backgroundColor","#cce6ff")),-1!=t){$("#viewport").scrollTop();$("#viewport").animate({scrollTop:"+="+(arrSentenceTable.eq(t).offset().top-arrSentenceTable.eq(e).offset().top)},250)}}function drawWordLengthFlowMeter(e,t,o,n,a){var s=intWeight=intTmpWeight=0,r=e+intFlowLookaround>=arrSentenceTable.length?arrSentenceTable.length-1:e+intFlowLookaround,l=e-intFlowLookaround;for(i=r;i>0&&i>=l;--i)intTmpWeight=-1!=a?arrSentenceStats[i][a]:1,intWeight+=intTmpWeight,s+=arrSentenceStats[i][o]*intTmpWeight;var c=arrSentenceTable.eq(e).children("td").eq(n).children(".flow");c.children(".wordlength").width(Math.round(s/intWeight/t*100)+"%"),c.children(".overlay").text((s/intWeight).toFixed(1))}function calculateLengthFlow(e,t,o){var n=intWeight=intTmpWeight=0,a=e+intFlowLookaround>=arrSentenceTable.length?arrSentenceTable.length-1:e+intFlowLookaround,s=e-intFlowLookaround;for(i=a;i>0&&i>=s;--i)intTmpWeight=-1!=o?arrSentenceStats[i][o]:1,intWeight+=intTmpWeight,n+=arrSentenceStats[i][t]*intTmpWeight;return n/intWeight}function mistakeoscopeMessage(e,t,o,n){var a='<div class="'+(void 0==n?"":n)+'">'+o+'</div><div class="triangle"></div>';mistakeoscope.html()!=a&&mistakeoscope.html(a),quickShowMistakeoscope();var i=viewport.width(),s=viewport.offset(),r=e.pageX,l=r-mistakeoscope.outerWidth()/2;l<s.left+4?l=s.left+4:l+mistakeoscope.outerWidth()>s.left+i-4&&(l=s.left+i-4-mistakeoscope.outerWidth()),mistakeoscope.offset({left:l,top:$(t).offset().top-mistakeoscope.outerHeight()-9}),mistakeoscope.children(".triangle").offset({left:r-mistakeoscope.children(".triangle").outerWidth()/2,top:mistakeoscope.offset().top+mistakeoscope.outerHeight()-1})}function hideMistakeoscope(){mistakeoscope.html('<div class="triangle"></div>'),mistakeoscope.stop(),quickHideMistakeoscope()}function toggleGraphs(e){var t=$("#sentenceStatsTable tr");return"Raw stats"==$(e).text()?($(e).text("Flow graph"),$("#sentenceStatsTable tr:gt(0) td").height($("#sentenceStatsTable tr:eq(1) > td").height()),t.children(".graph").hide(),t.children("td.raw").show(),$("#flow > p > span.graph").hide()):($(e).text("Raw stats"),t.children("td.raw").hide(),t.children(".graph").show(),$("#flow > p > span.graph").show()),!1}function updateLookaround(e){if(!isNaN(Math.abs(parseInt(e)))){var t=Math.abs(parseInt(e)),o=t!=intFlowLookaround;intFlowLookaround=t,o&&drawFlowMeters()}}function trimPaper(e){var t=$("#paper"),o="undefined"==typeof e?void 0:e.type,n="paste"==o||"cut"==o;(n||t.val()!=strLastPaper)&&(wordVarietyInitialized=!1,strLastPaper=t.val(),startStoreTextTimeout(),t.val().length>intSubmissionLimit&&(t.val(t.val().substring(0,intSubmissionLimit)),learnMore("submissionlimit")),(n||""!=t.val()&&0==$(".proofreadItem:visible").length)&&($(".demoItem").hide(),showProofreadButton()),resizeTextarea(!0),updateEditButtonAttention())}
1function updateEditButtonAttention(){var e=$("#paper").val(),t=$(".editItem a");""!=e&&e!=originalText&&t.hasClass("attention")&&t.removeClass("attention")}function checkCritique(){0==$("#critiquedialog:checked").length&&0==$("#critiquenotdialog:checked").length&&($("#critiquedialog").prop("checked",!0),$("#critiquenotdialog").prop("checked",!0))}function clearPaper(){var e=document.getElementById("paper");$(e).focus(),document.execCommand("selectAll"),document.execCommand("delete"),document.getElementById("viewport").scrollTop=0,afterExecCommand()}function undo(){var e=document.getElementById("paper");$(e).focus(),document.execCommand("undo"),afterExecCommand()}function redo(){var e=document.getElementById("paper");$(e).focus(),document.execCommand("redo"),afterExecCommand()}function afterExecCommand(){$(paper).change(),resizeTextarea(!0),storeText()}function proofread(){return processingMsg(),trimPaper(),storeText(),blnSubmitted&&persistStateToForm(),""==$("#paper").val()&&1!=$("#demo").val()?(nav2("edit"),$("#paper").focus(),learnMore("nodocument"),hideShade(),!1):(blnSubmitting=!0,$("#mainForm").attr("onsubmit",""),setTimeout(function(){$("#mainForm").submit()},1e3),!1)}function associate(e,t){return e?$("#associatorInput").val(e):e=$("#associatorInput").val(),e=e.substr(0,200),$("#associationQuery").html(""==e?"Mystery word!":e),$("#associations").fadeOut(50),$.post("associator/",{q:e},function(e){if(0==e.length)var o="I don't know that word yet. Try another.";else var o="";$("#associatedWords").show();for(i in e)o+='<div id="association'+i+'" class="association">',o+='<a onclick="associate($(this).text())" title="Find associations">'+e[i]+"</a>",o+='<a class="associationAction" onclick="toolbox($(\'#association'+i+' a:eq(0)\').text())" title="Look up word">?</a>',o+='<a class="associationAction" onclick="addAssociation($(\'#association'+i+' a:eq(0)\').text())" title="Add word">+</a>',o+="</div>";$("#associations").html(o).fadeIn(150),doResize(),"undefined"!=typeof t&&t()},"json"),""!=$("#associations").html()&&track(),!1}function addAssociation(e){$("#associatorInput").val($("#associatorInput").val()+" "+e),associate()}function clearAssociator(){$("#associatedWords").hide(),$("#associatorInput").val("").focus(),doResize()}function setCookie(e,t){var o=new Date;o.setTime(o.getTime()+15768e7),document.cookie=e+"="+t+"; expires="+o.toUTCString()}function getCookie(e,t){var o=document.cookie.match(/\b[\w\-]+=[^;]*;?/g);if(t=t||"",""==document.cookie)return t;for(i=0;i<o.length;++i)if(o[i].match(/[\w\-]+/)==e)return o[i].replace(/^.*=/,"").replace(/;$/,"")||t;return t}function deleteCookie(e){document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}
1function toggleHints(){setAutoHelp(!blnAutoHelp)}function vocabVariety(){text=originalText;var e=2*intVocabLookAround+1,t=text.replace(/( |[^\w'â])+/g," ").split(/ /g),o=text.toLowerCase().replace(/( |[^\w'â])+/g," ").split(/ /g);""==t[t.length-1]&&(t.pop(),o.pop());var n=text.match(/( |[^\w'â])+/g);n.unshift(""),n.length==t.length&&n.push("");var a,s=[],r=[],l=intUniqueRange=intStop=0,c=e+1,d=intG=intGradientR=intGradientG=0,u=intLastG=255,p=!1;if(out="",t.length>e){for(i=0;i<e;++i){for(p=!1,a=o[i],j=0;j<s.length;++j)if(a==s[j][0]){p=!0,++s[j][1];break}p||s.push([a,1])}for(i=e;i<=t.length;++i){for(a=o[i-e],j=0;j<s.length;++j)if(a==s[j][0]){1==s[j][1]?s.splice(j,1):--s[j][1];break}for(p=!1,a=o[i],j=0;j<s.length;++j)if(a==s[j][0]){p=!0,++s[j][1];break}p||s.push([a,1]),intUniqueCount=s.length,c=c>intUniqueCount?intUniqueCount:c,l=l<intUniqueCount?intUniqueCount:l,r.push(intUniqueCount)}for(minUniquesDefault=intVocabLookAround,maxUniquesDefault=intVocabLookAround+1+parseInt(.6*intVocabLookAround),c=c<minUniquesDefault?c:minUniquesDefault,l=l>maxUniquesDefault?l:maxUniquesDefault,intUniqueRange=l-c-1,intStop=t.length-intVocabLookAround-1,d=2*parseInt(255*(l-r[0])/intUniqueRange),d=parseInt((382.5+(d>255?255:d))/2.5),intG=2*parseInt(255-255*(l-r[0])/intUniqueRange),intG=parseInt((382.5+(intG>255?255:intG))/2.5),intB=parseInt(153),i=0;i<intVocabLookAround;++i)out+='<h style="background-color: rgb('+parseInt(d)+","+parseInt(intG)+","+intB+')">'+n[i]+'</h><h style="background-color: rgb('+d+","+intG+","+intB+')">'+t[i]+"</h>",i==intVocabLookAround-1&&(out+='<h style="background-color: rgb('+parseInt(d)+","+parseInt(intLastG)+","+intB+')">'+n[i]+"</h>");for(intB="77",i=intVocabLookAround;i<=intStop;++i)d=2*parseInt(255*(l-r[i-intVocabLookAround])/intUniqueRange),d=d>255?255:d,intG=2*parseInt(255-255*(l-r[i-intVocabLookAround])/intUniqueRange),intG=intG>255?255:intG,i!=intVocabLookAround&&(out+='<h style="background-color: rgb('+parseInt((d+u)/2)+","+parseInt((intG+intLastG)/2)+","+intB+')">'+n[i]+"</h>"),out+='<h class="vocabVarietyWord varietyWord_'+r[i-intVocabLookAround]+'" style="background-color: rgb('+d+","+intG+","+intB+')" onclick="showOverusedWords(this)" onmouseover="highlightNearbyWords(this, true)" onmouseout="highlightNearbyWords(this, false)">'+t[i]+"</h>",u=d,intLastG=intG;for(d=parseInt((382.5+d)/2.5),intG=parseInt((382.5+intG)/2.5),i=t.length-intVocabLookAround;i<t.length;++i)out+='<h style="background-color: rgb('+parseInt(d)+","+parseInt(intG)+","+intB+')">'+n[i]+'</h><h style="background-color: rgb('+d+","+intG+","+intB+')">'+t[i]+"</h>";out+=n[i],$("#wordvariety > p").html(out)}else{var h=e+1;$("#wordvarietySubItem").remove(),$("#wordvariety p").html("This feature requires at least <strong>"+h+"</strong> words to function. You need <strong>"+(h-t.length)+"</strong> more.")}}function showOverusedWords(e){var t,o,n=$(e),a=$prevElem=n,s=n.text(),r=[[s.toLowerCase(),1]],l=9;for(i=0;i<intVocabLookAround;++i){for(s=$prevElem.prev().text()+s,$prevElem=$prevElem.prev().prev(),s=$prevElem.text()+s,t=$prevElem.text().toLowerCase(),o=!1,j=0;j<r.length;++j)if(t==r[j][0]){o=!0,++r[j][1];break}for(o||(r[r.length]=[t,1]),s+=a.next().text(),a=a.next().next(),s+=a.text(),t=a.text().toLowerCase(),o=!1,j=0;j<r.length;++j)if(t==r[j][0]){o=!0,++r[j][1];break}o||(r[r.length]=[t,1])}r.sort(function(e,t){return e[1]>t[1]?-1:e[1]<t[1]?1:0});var c='<h3><i class="fa fa-comment"></i>Vocabulary variety: '+parseInt(r.length/(2*intVocabLookAround+1)*100)+'%</h3>The most common words in this selection are:<br><div class="varietyList">',d=r.length<l?r.length:l;for(i=0;i<d;++i)t=r[i][0],c+="<div><span>"+r[i][1]+"</span><a onclick=\"toolbox('"+t+"')\">"+t[0].toUpperCase()+t.substr(1)+"</a></div>";c+="</div></p>",$("#learnMore > .content").html(c),showLearnMore()}function highlightNearbyWords(e,t){var o,n,e;for(o=n=e=$(e),i=0;i<2*intVocabLookAround;++i)n=n.prev(),highlightNearbyWord(n,t),o=o.next(),highlightNearbyWord(o,t)}function highlightNearbyWord(e,t){t?(e.data("backgroundColor",e.css("backgroundColor")),e.css("backgroundColor","#aac8e2")):e.css("backgroundColor",e.data("backgroundColor"))}function initFlow(){if(flowInitialized)return!1;if(0!=objMarkings.length){processingMsg("writing..."),$("#sentenceStatsTable > tbody > tr > td > a").each(function(e){$(this).click(function(){return findSentence(e+1)})}),updateLookaround(intDefaultSmoothing);
1var e=$("#sentenceStatsTable div.flow");e.filter(".type").click(function(){learnMore("typeflow"),highlightControlSentence($(this).parents("tr").prevAll().length)}),e.filter(".sentence").click(function(){learnMore("sentencelengthflow"),highlightControlSentence($(this).parents("tr").prevAll().length)}),e.filter(".word").click(function(){learnMore("wordlengthflow"),highlightControlSentence($(this).parents("tr").prevAll().length)}),hideShade()}return!0}function initWordVariety(){return wordVarietyInitialized?!1:(processingMsg("writing..."),vocabVariety(),hideShade(),!0)}function track(){if(blnSubmitting)return!1;var e=window.location.hash.substr(2);return e=e.replace("/"," -> "),$.post("track.php",{action:e}),!0}function updateEditor(e,t){e!=originalText&&($("#paper").val(e),""!=document.getElementById("paper").value&&showProofreadButton())}function share(e){return"fb"==e?window.open("http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.slickwrite.com%2F&t=Slick+Write","_blank"):"twitter"==e?window.open("http://twitter.com/share?url=http%3A%2F%2Fwww.slickwrite.com","_blank"):"tumblr"==e?window.open("http://www.tumblr.com/share?v=3&u=http%3A%2F%2Fwww.slickwrite.com%2F&t=Slick+Write","_blank"):"linkedin"==e&&window.open("http://www.linkedin.com/shareArticle?mini=true&url=http%3A%2F%2Fwww.slickwrite.com%2F&title=Slick+Write","_blank"),!1}function addAds(){addAdScript(),addTopAd(),addBottomAd(),showAdblockNag()}function addAdScript(){var e='<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>';$("head").append(e)}function addTopAd(){var e='<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><!-- Top Responsive --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4960239590460029" data-ad-slot="7160981997" data-ad-format="auto"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>';blnSubmitted&&$("div.horizSlot.top:visible").append(e)}function addBottomAd(){adStuff='<!-- Bottom Responsive --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4960239590460029" data-ad-slot="2591181591" data-ad-format="auto"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>',$("div.horizSlot.bottom:visible").append(adStuff)}function menuSelect(e,t){$("#top .submenu, #menu div, #phoneMenu div").removeClass("active"),$("#menu ."+e+"Item, #phoneMenu ."+e+"Item").addClass("active"),$("#top #"+e+"Submenu").addClass("active"),t||(window.location.hash=buildHash(),track()),doResize()}function submenuSelect(e,t){var o="string"==typeof e?e:e.id.replace(/(Phone)?SubItem/,""),n=$("#"+o+"SubItem, #"+o+"PhoneSubItem");n.each(function(e,t){var o=$(t),n=o.parent();n.children().removeClass("active"),o.addClass("active")}),t||(window.location.hash=buildHash(),track()),doResize()}function tabSelect(e,t){var o=$(e),n=o.parent().parent().find(".tablet");o.siblings().removeClass("active"),o.addClass("active"),n.hide(),n.filter("#"+t+"Tablet").show()}function doResize(){detectMobile();var e=$("#viewport").outerHeight(),t=$("div.horizSlot:visible"),o=0;for(i=0;i!=t.length;++i)o+=t.filter(":eq("+i+")").outerHeight();resizeLearnMore();var n=e-o-$("#footer").outerHeight(),a=$("#viewport div.sheet");a.css("minHeight")!=n&&a.css("minHeight",n);var s=a.filter(":visible"),r=s.length?s:a.eq(0),l=parseInt(r.offset().left)+r.outerWidth()+15;$("#sideSlot").css("left",l+"px"),resizeSubmenu(),resizeSubmenu(),resizeTextarea()}function detectBrowser(){null!==navigator.userAgent.match(/firefox/i)?$("body").addClass("firefox"):null!==navigator.userAgent.match(/(trident|msie)/i)?$("body").addClass("ie"):null!==navigator.userAgent.match(/(edge)/i)&&$("body").addClass("edge")}function resizeSubmenu(){var e=$("#menu div:visible a i").first();submenus.each(function(){var t=$(this),o=Math.round((e.outerWidth()+parseInt(e.css("marginLeft"))+parseInt(e.css("marginRight"))+window.innerWidth-t.width())/2)+"px";t.css("left")!=o&&t.css("left",o)})}function resizeLearnMore(){var e,t,o=$("#learnMore");window.innerWidth>767?($("#learnLess").css("lineHeight",0),o.css("paddingLeft",$("#viewport").css("paddingLeft")),o.css("marginRight",$("#viewport").width()-$("#viewportInterior").width()+"px"),o.css("minHeight","initial"),o.find(".content").css("minHeight","initial")):(e=$("#mobileLearnLess"),t=o.find(".content"),o.css("paddingLeft",0),o.css("marginRight",0),o.css("minHeight",window.innerHeight+"px"),t.css("minHeight",window.innerHeight-e.outerHeight()-parseInt(t.css("marginBottom"))+"px"))}function requestFrame(e){void 0===window.requestAnimationFrame?setTimeout(e,1):window.requestAnimationFrame(e)}function submitMessage(e){processingMsg("sending..."),$.ajax({type:"POST",url:"feedback.php",data:$(e).serialize(),success:function(e){1==e?($("#contact").find("input[type=text], input[type=email], textarea").val(""),nav2("edit"),hideShade(),setTimeout(function(){alert("Thank y
1ou for your feedback.")},10)):(hideShade(),alert("There was a problem with your message. Please make sure that all required fields are filled out."))},error:function(){hideShade(),alert("We encountered an unexpected error. Please try again.")}})}function sendMessage(e){var t,o=!0;if(0==$(e).find(".humanYes:checked").length&&(o=!1,$(e).find(".humanYes").closest(".inputWrapper").addClass("invalid")),""==$(e).find(".msg").val()&&(o=!1,$(e).find(".msg").addClass("invalid")),o){if(""==$(e).find(".email").val()&&(t=confirm("We will be unable to contact you without your email address. Do you want to continue without providing one?"),!t))return $(e).find("email").focus(),!1;submitMessage(e)}else shake($(e).find(".invalid"));return!1}function shake(e){$(e).animate({left:"-4px"},50).animate({left:"4px"},50).animate({left:"-4px"},50).animate({left:"4px"},50).animate({left:"0"},50)}function setTheme(e){var t,o=document.body.className.split(/\s+/g);for(t in o)if(o[t].match(/^theme-/)){$("body").removeClass(o[t]);break}void 0!==e?($("body").addClass("theme-"+e),setCookie("theme",e)):setCookie("theme","")}function setFontSize(e){ 2var t,o=document.body.className.split(/\s+/g);for(t in o)if(o[t].match(/^fontSize-/)){$("body").removeClass(o[t]);break}void 0!==e?($("body").addClass("fontSize-"+e),setCookie("fontSize",e)):setCookie("fontSize",""),doResize()}function toggleFontSize(){var e,t,o=getCookie("fontSize");for(t=0;t<fontSizes.length;++t)if(fontSizes[t]==o)return o=fontSizes[t==fontSizes.length-1?0:t+1],setFontSize(o),e=$("#fontSizeToggle a").removeClass("active"),o=o?o:"default",void e.filter("."+o+"-fontSize").addClass("active")}function setHighVis(e){e?($("body").addClass("highVis"),setCookie("highVis","highVis")):($("body").removeClass("highVis"),setCookie("highVis",""))}function getRememberText(){var e=getCookie("rememberText");return"no"!=e||""==e}function setRememberText(e){"undefined"==typeof e?(e=$("#rememberText").prop("checked"),setToggleState(e?$(".default-rememberText").get(0):$(".no-rememberText").get(0))):$("#rememberText").prop("checked",e),e?(storeText(),setCookie("rememberText","")):(storeText(""),setCookie("rememberText","no"))}function setAutoHelp(e){var t,o=(e?"default":"no")+"-autoHelp";blnAutoHelp=e,e?(t=document.location.hash.replace(/^#!/,"").split("/").pop(),setCookie("autoHelp",""),learnMore(t),$("#hintToggle").addClass("active")):(setCookie("autoHelp","no"),learnLess(),$("#hintToggle").removeClass("active")),$("#autoHelpToggle a").removeClass("active"),$("."+o).addClass("active")}function storeText(e){getRememberText()&&("undefined"==typeof e?localStorage.setItem("paper",$("#paper").val()):localStorage.setItem("paper",""))}function startStoreTextTimeout(){clearTimeout(storeTextTimeout),storeTextTimeout=setTimeout(storeText,500)}function rememberText(){strLastPaper=localStorage.getItem("paper"),$("#paper").val(strLastPaper),$("#paper").val()&&showProofreadButton()}function setToggleState(e){var e=$(e);e.siblings().removeClass("active"),e.addClass("active")}
2function initToggles(){$("div.toggle").each(function(){var e=$(this),t=e.attr("id").replace(/Toggle$/,""),o=getCookie(t);o=o?o:"default",e.find("a").click(function(){setToggleState(this)}),e.find("."+o+"-"+t).click()})}function initPhoneSubmenu(){phoneSubmenus=$(".submenu").clone(),$("#phoneSubmenu").append(phoneSubmenus),phoneSubmenus.find("a").each(function(e,t){var o,n=$(t);n.attr("onclick")&&(o=n.attr("onclick").replace(/if\(blnAutoHelp\)[^;]+; /,""),n.attr("onclick",o))})}function secure(){var e=$(".b-freemium-editor, .fr-btn-hover-menu, .gr__tooltip, .fr-context-menu, .b-freemium-signin, .gr-btn-freemium, html > div:not(.nvtooltip), grammarly-card, .grammarly-disable-indicator, gbutton-popup, .gr_-editor");if(0!=e.length){$("body").removeClass("__gram").removeAttr("spellcheck"),$("html").removeClass("gr__slickwrite_com"),e.remove();var t=$("textarea");t.each(function(){var e=$(this);e.attr("style",String(e.attr("style")).replace(/background(-color)?: *transparent[^;]*;/gi,""))}),t.attr("spellcheck","true")}}function startWalkthrough(){$("body").hasClass("ie")||($().walkieTalkie(chooseWalkthrough()),learnLess())}function chooseWalkthrough(){var e=[{message:'<div id="walkthrough-message-body-icon"><i class="far fa-comment"></i></div><div>In this tutorial, we will give you a quick overview of Slick Write\'s most popular features. Click "Next" to begin.</div>',callbacks:{next:function(){$("#features h:eq(0)").click(),document.getElementById("viewport").scrollTo(0,150)}}},{focus:"#features h:eq(0)",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-highlighter"></i></div><div>This is the screen where you\'ll spend most of your time. Click an underlined word or phrase to see information about it, and find more items of the same type. You can also open the Quick Lookup by selecting a word or passage with your mouse.</div>',callbacks:{prev:function(){$("#features h.highlight").removeClass("highlight"),nav2("critique/features",!0),document.getElementById("viewport").scrollTo(0,0)},next:function(){$("#features h.highlight").removeClass("highlight"),nav2("critique/wordvariety",!0),document.getElementById("viewport").scrollTo(0,0)}}},{focus:"#wordvarietySubItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-highlighter"></i></div><div>The Vocabulary Variety screen helps you identify the passages in your document that have the least variety.</div>',callbacks:{prev:function(){nav2("critique/features",!0),$("#features h:eq(0)").click(),document.getElementById("viewport").scrollTo(0,150)},next:function(){$(".vocabVarietyWord:eq(55)").click()}}},{focus:"#learnMore .content",message:'<div id="walkthrough-message-body-icon"><i class="far fa-mouse-pointer"></i></div><div>Click a word to see the most common words around it.</div>',callbacks:{prev:function(){nav2("critique/features",!0),$("#features h:eq(0)").click()},next:function(){nav2("critique/features",!0),learnMore("quickStats")}}},{focus:"#learnMore .content",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-chart-pie"></i></div><div>The Key Statistics popup opens automatically after checking a document. It shows important information about your document...</div>',callbacks:{prev:function(){nav2("critique/wordvariety",!0),$(".vocabVarietyWord:eq(55)").click()},next:function(){nav2("stats/aggregate",!0),learnLess()}}},{focus:"#menu .statsItem",message:'<div id="walkthrough-message-body-icon"><i class="far fa-comment"></i></div><div>...but you can get even more information here.</div>',callbacks:{prev:function(){nav2("critique/features",!0),learnMore("quickStats")},next:function(){nav2("edit",!0)}}},{focus:"#menu .editItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-pencil"></i></div><div>Edit your document on this screen.</div>',callbacks:{prev:function(){nav2("stats/aggregate",!0),learnLess()},next:function(){$("#menu .proofreadItem").show()}}},{focus:"#menu .proofreadItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-check"></i></div><div>Click this button when you\'re ready to check your work again.</div>',callbacks:{next:function(){nav2("settings/analysis",!0)}}},{focus:"#menu .settingsItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-sliders-h"></i></div><div>Customize your settings to unlock Slick Write\'s power.</div>',callbacks:{prev:function(){nav2("edit",!0)},next:function(e){$("#associatorInput").val("grass blades"),nav2("associator",!0),associate(null,function(){e.redrawStep()})}}},{focus:"#menu .associatorItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-link"></i></div><div>
2The Associator helps you find connections between words.</div>',callbacks:{prev:function(){nav2("settings/analysis",!0)},next:function(){nav2("contact",!0)}}},{focus:"#menu .contactItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-envelope"></i></div><div>Suggest improvements and report bugs with the Contact form. Your feedback helps us improve Slick Write. Yes, we really do read your comments.</div>',callbacks:{prev:function(e){$("#associatorInput").val("grass blades"),nav2("associator",!0),associate(null,function(){e.redrawStep()})}}},{focus:"#hintToggle",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-lightbulb"></i></div><div>Hints can be turned on or off.</div>',callbacks:{prev:function(){nav2("contact",!0)}}},{focus:"#shr",message:'<div id="walkthrough-message-body-icon"><i class="far fa-comments"></i></div><div>Tell your friends about us.</div>',callbacks:{next:function(){nav2("edit",!0)}}},{message:'<div id="walkthrough-message-body-icon"><i class="far fa-thumbs-up"></i></div><div>Now you\'re ready to start writing. Good luck!</div>'}],t=[{message:'<div id="walkthrough-message-body-icon"><i class="far fa-comment"></i></div><div>In this tutorial, we will give you a quick overview of Slick Write\'s most popular features. Tap "Next" to begin.</div>'},{focus:"#features h:eq(0)",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-highlighter"></i></div><div>This is the screen where you\'ll spend most of your time. Tap an underlined word or phrase to learn more about it.</div>',callbacks:{prev:function(){nav2("critique/features",!0)},next:function(){$("#features h:eq(0)").click(),$("#learnMore .closed:eq(0)").click()}}},{focus:"#quickLookup",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-search"></i></div><div>The Quick Lookup has helpful links pertaining to the word or phrase that you tapped.</div>',callbacks:{prev:function(){learnLess()},next:function(){learnLess(),nav2("stats/aggregate",!0)}}},{focus:"#phoneMenu .statsItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-chart-pie"></i></div><div>Tap here to see your document\'s statistics.</div>',callbacks:{prev:function(){nav2("critique/features",!0),$("#features h:eq(0)").click()},next:function(){nav2("edit",!0)}}},{focus:"#phoneMenu .editItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-pencil"></i></div><div>Edit your document on this screen.</div>',callbacks:{prev:function(){nav2("stats/aggregate",!0)},next:function(){$("#phoneMenu .proofreadItem").show()}}},{focus:"#phoneMenu .proofreadItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-check"></i></div><div>Tap this button when you\'re ready to check your work again.</div>',callbacks:{next:function(){nav2("settings/analysis",!0)}}},{focus:"#phoneMenu .settingsItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-sliders-h"></i></div><div>Customize your settings to unlock Slick Write\'s power.</div>',callbacks:{prev:function(){nav2("edit",!0)},next:function(e){$("#associatorInput").val("grass blades"),nav2("associator",!0),associate(null,function(){e.redrawStep()})}}},{focus:"#phoneMenu .associatorItem",message:'<div id="walkthrough-message-body-icon"><i class="fa fa-link"></i></div><div>The Associator helps you find connections between words.</div>',callbacks:{prev:function(){nav2("settings/analysis",!0)},next:function(){nav2("edit",!0)}}},{message:'<div id="walkthrough-message-body-icon"><i class="far fa-comments"></i></div><div>Tell your friends about us.</div>',callbacks:{prev:function(){$("#associatorInput").val("grass blades"),nav2("associator",!0),associate(null,function(){walkthrough.redrawStep()})}}},{message:'<div id="walkthrough-message-body-icon"><i class="far fa-thumbs-up"></i></div><div>Now you\'re ready to start writing. Good luck!</div>'}];return blnMobile?t:e}function mouseOverMarking(e){for(i=0;i<arrNotices.length;++i)$(this).hasClass(arrNotices[i].name)&&0==mistakeoscope.children("."+arrNotices[i].name).length&&mistakeoscope.append('<h class="'+arrNotices[i].name+'">'+arrNotices[i].msg+"</h>");var t=$(this).attr("class"),o=t?t.split(" "):[];for(var n in o){var a=o[n].split("_");if(2==a.length&&"words"==a[1]&&0==mistakeoscope.children(".wordcount").length){mistakeoscope.append('<div class="wordcount">'+a[0]+" words</div>");break}}mistakeoscopeStatus||quickShowMistakeoscope();
2var s=viewport.width(),r=viewport.offset(),l=$(e.currentTarget).offset().left,c=$(e.currentTarget).offset().top,d=$(e.currentTarget).outerWidth(),u=l+(d-mistakeoscope.outerWidth())/2;u<r.left+4?u=r.left+4:u+mistakeoscope.outerWidth()>r.left+s-4&&(u=r.left+s-4-mistakeoscope.outerWidth()),mistakeoscope.offset({left:u,top:c-mistakeoscope.outerHeight()-9}),mistakeoscope.children(".triangle").offset({left:l+(d-mistakeoscope.children(".triangle").outerWidth())/2,top:mistakeoscope.offset().top+mistakeoscope.outerHeight()-1})}function mouseOutMarking(e){for(i=0;i<arrNotices.length;++i)$(e.currentTarget).hasClass(arrNotices[i].name)&&mistakeoscope.children("."+arrNotices[i].name).remove();mistakeoscope.children(".wordcount").remove();var t=viewport.width(),o=viewport.offset(),n=e.pageX,a=n-mistakeoscope.outerWidth()/2;a<o.left+4?a=o.left+4:a+mistakeoscope.outerWidth()>o.left+t-4&&(a=o.left+t-4-mistakeoscope.outerWidth()),mistakeoscope.offset({left:a,top:$(e.currentTarget).offset().top-mistakeoscope.outerHeight()-9}),mistakeoscope.children(".triangle").offset({left:n-mistakeoscope.children(".triangle").outerWidth()/2,top:mistakeoscope.offset().top+mistakeoscope.outerHeight()-1}),1==mistakeoscope.children().length&&mistakeoscopeStatus&&quickHideMistakeoscope()}function updateFeaturesMistakeoscopePosition(e){if(mistakeoscopeStatus){var t=viewport.width(),o=viewport.offset(),n=e.pageX-mistakeoscope.outerWidth()/2;n<o.left+4?n=o.left+4:n+mistakeoscope.outerWidth()>o.left+t-4&&(n=o.left+t-4-mistakeoscope.outerWidth()),mistakeoscope.offset({left:n,top:mistakeoscope.offset().top}),mistakeoscope.children(".triangle").offset({left:e.pageX-mistakeoscope.children(".triangle").outerWidth()/2,top:mistakeoscope.offset().top+mistakeoscope.outerHeight()-1})}}function quickShowMistakeoscope(){mistakeoscopeStatus=!0,mistakeoscope.show()}function quickHideMistakeoscope(){mistakeoscopeStatus=!1,mistakeoscope.hide()}function detectMacOS(){isMac=-1!=navigator.userAgent.indexOf("Mac")}function detectMobile(){blnMobile=window.innerWidth<=767}function setPlaceholder(){var e=$("#paper");blnMobile?e.attr("placeholder",'Copy (long press to select your text, and tap "Copy") and paste (long press, and tap "Paste"), or type your document here. Then tap the "Check" button.'):isMac?e.attr("placeholder",'Open a file, copy (highlight your text, and press Command-C) and paste (press Command-V), or type your document here. Then click the "Check" button.'):e.attr("placeholder",'Open a file, copy (highlight your text, and press Control+C) and paste (press Control+V), or type your document here. Then click the "Check" button.')}function save(){var e="slick_write_document.txt",t=new Blob([$("#paper").val()],{type:"text/plain;charset=utf-8"});saveAs(t,e)}function open(e){var t,o,n=e.currentTarget.files;0!=n.length&&(t=n[0],o=t.type,"text/plain"==o?openText(t):"text/html"==o?openHTML(t):"application/vnd.openxmlformats-officedocument.wordprocessingml.document"==o||"application/docx"==o||"application/wps-office.docx"==o?openDocx(t):alert("I don't know how to handle that type of file. Save a copy of it as .txt, .docx, .htm, or .html, and try again."))}function openText(e){var t=new FileReader;t.readAsText(e),t.onloadend=function(){t.readyState==t.DONE?($("#paper").val(t.result),proofread()):console.error(t.error.message)}}function openHTML(e){var t=new FileReader;t.readAsText(e),t.onloadend=function(){var e;t.readyState==t.DONE?(e=processHTML(t.result),$("#paper").val(e),proofread()):console.error(t.error.message)}}function processHTML(e){var t,o=["canvas","noscript","script","style","video"],n=["address","article","aside","blockquote","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h\\d","header","hgroup","li","main","nav","ol","output","p","pre","section","table","tfoot","ul","tr","title"],a=["td","th"],i=e.replace(/\r/g,"").replace(/<\!--[\s\S]*?-->/g,"").replace(new RegExp("<("+o.join("|")+")\\b[^>]*>[\\s\\S]*?</("+o.join("|")+")>","gi"),"").replace(new RegExp("<("+o.join("|")+")\\b[^>]*>","gi"),"").replace(new RegExp("(</("+a.join("|")+")>)\\s+(<("+a.join("|")+")\\b[^>]*>)","gi"),"$1").replace(new RegExp("(</("+a.join("|")+")>)","gi")," $1").replace(new RegExp("(</("+n.join("|")+")>)","gi"),"\n$1").replace(/<[^>]*>/g,"").replace(/(^\s+|\s+$)/gm,"\n").replace(/\n{3,}/g,"\n\n").replace(/(^\s*|\s*$)/g,"");return t=$("<div>"+i+"</div>").text()}function openDocx(e){var t=new FileReader;t.readAsBinaryString(e),t.onloadend=function(){var e;t.readyState==t.DONE?(e=processDocx(t.result),$("#paper").val(e),proofread()):console.error(t.error.message)}}function processDocx(e){var t,o,n,a,i;for(t=(new JSZip).load(e),o=Object.keys(t.files),i=0;i!=o.length;++i)n=t.files[o[i]].asText().replace(/<\/w:t><\/w:r><\/w:p>/g,"\n\n</w:t></w:r></w:p>").replace(/<w:br\b[^\/]*\/>/g,"<w:t>\n</w:t>").replace(/\n([^\n]*?<w:ilvl\b)/g,"$1"),t.file(o[i],n);return a=(new Docxtemplater).loadZip(t).getFullText()}function drawCharts(){drawVocabVarietyChart(),drawUncommonWordChart(),drawFunctionWordChart(),drawAdjectiveChart(),drawFilterWordChart(),drawAdverbChart(),drawPronounChart(),drawSentenceTypeChart(),drawLongSentenceChart(),drawPassiveChart(),drawPrepositionChart(),drawARIChart()}function drawVocabVarietyChart(){var e;isDefined(stats.wordCount)&&stats.wordCount&&isDefined(stats.uniqueWordCount)&&(e=[{label:"Repeated words",value:stats.wordCount-stats.uniqueWordCount},{label:"Unique words",value:stats.uniqueWordCount}],pieChart("#uniqueWordChart svg",e,{donut:!0}))}function drawAdverbChart(){var e;isDefined(stats.wordCount)&&stats.wordCount&&isDefined(stats.adverbCount)&&(e=[{label:"Other words",value:stats.wordCount-stats.adverbCount},{label:"Adverbs",value:stats.adverbCount}],pieChart("#adverbChart svg",e,{donut:!0}))}function drawAdjectiveChart(){var e;isDefined(stats.wordCount)&&stats.wordCount&&isDefined(stats.adjectiveCount)&&(e=[{label:"Other words",value:stats.wordCount-stats.adjectiveCount},{label:"Adjectives",value:stats.adjectiveCount}],pieChart("#adjectiveChart svg",e,{donut:!0}))}function drawPronounChart(){var e;isDefined(stats.wordCount)&&stats.wordCount&&isDefined(stats.pronounCount)&&(e=[{label:"Other words",value:stats.wordCount-stats.pronounCount},{label:"Pronouns",value:stats.pronounCount}],pieChart("#pronounChart svg",e,{donut:!0}))}function drawUncommonWordChart(){var e;isDefined(stats.wordCount)&&stats.wordCount&&isDefined(stats.uncommonWordCount)&&(e=[{label:"Common words",value:stats.wordCount-stats.uncommonWordCount},{label:"Uncommon words",value:stats.uncommonWordCount}],pieChart("#uncommonWordChart svg",e,{donut:!0}))}function drawFunctionWordChart(){var e;isDefined(stats.wordCount)&&stats.wordCount&&isDefined(stats.functionWordCount)&&(e=[{label:"Other words",value:stats.wordCount-stats.functionWordCount},{label:"Function words",value:stats.functionWordCount}],pieChart("#functionWordChart svg",e,{donut:!0}))}function drawFilterWordChart(){var e;isDefined(stats.wordCount)&&stats.wordCount&&isDefined(stats.filterWordCount)&&(e=[{label:"Other words",value:stats.wordCount-stats.filterWordCount},{label:"Filter words",value:stats.filterWordCount}],pieChart("#filterWordChart svg",e,{donut:!0}))}function drawSentenceTypeChart(){var e;isDefined(stats.fragmentCount)&&isDefined(stats.simpleCount)&&isDefined(stats.compoundCount)&&isDefined(stats.complexCount)&&isDefined(stats.compoundComplexCount)&&(e=[{label:"Fragment",value:stats.fragmentCount},{label:"Simple",value:stats.simpleCount},{label:"Compound",value:stats.compoundCount},{label:"Complex",value:stats.complexCount},{label:"Compound complex",value:stats.compoundComplexCount}],pieChart("#sentenceTypeChart svg",e,{donut:!0}))}function drawLongSentenceChart(){var e;isDefined(stats.sentenceCount)&&isDefined(stats.longCount)&&(e=[{label:"Normal",value:stats.sentenceCount-stats.longCount},{label:"Long",value:stats.longCount}],pieChart("#longSentenceChart svg",e,{donut:!0}))}function drawPassiveChart(){var e;isDefined(stats.passiveVoiceIndex)&&(e={ranges:[0,100,200],measures:[Math.min(stats.passiveVoiceIndex,200)]},bulletChart("#passiveChart svg",e))}function drawPrepositionChart(){var e;isDefined(stats.prepositionalPhraseIndex)&&(e={ranges:[0,100,200],measures:[Math.min(stats.prepositionalPhraseIndex,200)]},bulletChart("#prepositionChart svg",e))}function drawARIChart(){var e;isDefined(stats.automatedReadabilityIndex)&&(e={ranges:[0,9,20],measures:[Math.min(stats.automatedReadabilityIndex,20)]},bulletChart("#ARIChart svg",e))}function getARIGradeLevel(e){var t=Math.floor(e);return 0>=t?"Preschool":1==t?"Kindergarten":t>=14?"College":"Grade "+(t-1)}function drawARIGradeLevel(){isDefined(stats.automatedReadabilityIndex)&&$(".ARIGradeLevel").text(getARIGradeLevel(stats.automatedReadabilityIndex))}function pieChart(e,t,o){var n={showLabels:!0,showLegend:!1,labelThreshold:.05,labelType:"percent",donut:!1,donutRatio:.35,margin:{top:0,right:0,bottom:0,left:0}};"object"==typeof o&&extend(n,o),nv.addGraph(function(){var o=nv.models.pieChart().x(function(e){return e.label}).y(function(e){return e.value}).donut(n.donut).showLabels(n.showLabels).showLegend(n.showLegend
2).labelThreshold(n.labelThreshold).labelType(n.labelType).donutRatio(n.donutRatio).margin(n.margin);return d3.select(e).datum(t).transition().duration(350).call(o),nv.utils.windowResize(o.update),o})}function bulletChart(e,t,o){var n={margin:{top:0,right:0,bottom:0,left:0}};"object"==typeof o&&extend(n,o),nv.addGraph(function(){var o=nv.models.bulletChart().margin(n.margin);return d3.select(e).datum(t).transition().duration(350).call(o),o})}function showAdblockNag(){$(".adsbygoogle").length&&$(".adsbygoogle").is(":hidden")&&$("body").addClass("adsBlocked")}function drawWordCounts(){var e,t,o,n,a=$("#wordStatsTable > tbody");for(e=0;e<stats.wordFrequencies.length;++e)t=stats.wordFrequencies[e],o=$('<tr class="'+t.flags.join(" ")+'"></tr>'),n=$("<td></td>"),n.text(t.word),o.append(n),n=$("<td></td>"),n.text(t.count),o.append(n),n=$("<td></td>"),n.text((t.count/stats.wordCount).toFixed(2)),o.append(n),a.append(o)}function drawPhraseCounts(){var e,t,o,n,a,i,s,r,l,c=Object.keys(stats.commonPhrases),d=$("#phrases > .ribbon");for(s='<a id="words{{wordCount}}button" class="button" onclick="tabSelect(this, \'words{{wordCount}}\')">{{wordCount}} Words</a>',r='<div id="words{{wordCount}}Tablet" class="tablet" style="display: none"><table class="phraseStatsTable"><thead><tr><th>{{wordCount}} Words</th><th>Count</th></tr></thead><tbody></tbody></table></div>',e=0;e!=c.length;++e)i=$(s.replace(new RegExp("{{wordCount}}","g"),c[e])),d.prepend(i);for(d.find(".button:first-child").addClass("active"),e=0;e!=c.length;++e){for(l=$(r.replace(new RegExp("{{wordCount}}","g"),c[e])),tabletBody=l.find("tbody"),o=Object.keys(stats.commonPhrases[c[e]]),t=0;t!=o.length;++t)n=o[t],a=$("<tr><td></td><td></td></tr>"),a.find("td:eq(0)").text(n),a.find("td:eq(1)").text(stats.commonPhrases[c[e]][n]),tabletBody.append(a);$("#phrases").append(l)}$("#phrases > .tablet:last-child").show()}function showProofreadButton(){$(".proofreadItem").show(),resizeSubmenu()}function quickFixCritique(){nav2("settings/analysis"),requestAnimationFrame(function(){0==$("#settings .option input[type=checkbox]:checked").length?($("#preset").val($("#preset option:eq(0)").val()),loadPreset(!0)):$("#critiquenotdialog").prop("checked",!0),updateSettingsCookies(),showProofreadButton(),requestAnimationFrame(function(){alert("I enabled basic marking for you. Make any other settings changes you want, and click the Check button when you are ready.")})})}function scrollToMarking(e){var t,o=$(e).get(0).getClientRects()[0],n=$("#learnMore").get(0).getClientRects()[0],a=o.bottom>n.top;!blnMobile&&a&&(t=$("#viewport").scrollTop()+o.bottom-n.top+50,$("#viewport").animate({scrollTop:t},500))}function getPaper(){return $("#paper").val()||$("#features > p").text()}function encodedSubstr(e,t,o){var n,a,i=!1,s=e.length,r=void 0===o?s:t+o,l="",c=0;for(n=0;n!=s;++n){if(a=e[n],c>=t){if(!(r>c))break;l+=a}i?";"==a&&(i=!1):(++c,"&"==a&&(i=!0))}return l}function filterRanges(e,t){for(var o={},n=0;n!=t.length;++n){var a=t[n];e.hasOwnProperty(a)&&(o[a]=e[a])}return o}function sortFlatRanges(e){e.sort(function(e,t){return e[1]!=t[1]?e[1]-t[1]:t[2]-e[2]})}function flattenRanges(e){var t,o,n,a,i,s,r=[],l=Object.keys(e);for(t=0;t!=l.length;++t)for(n=l[t],a=e[n],o=0;o!=a.length;++o){if(i=a[o],!i||i.length<2){console.warn("Malformed range group: "+n);break}s=[n,i[0],i[1]],i.length>2&&s.push(i[2]),r.push(s)}return sortFlatRanges(r),r}function cullOverlappingRanges(e,t){var o,n,a,i,s,r,l,c={},d=[],u=e.length;for(r=0;r!=t.length;++r)c[t[r]]=r;for(r=0;r!=u;++r){for(o=e[r],a=c[o[0]],i=o[1],s=o[1]+o[2]-1,keep=!0,l=d.length-1;-1!=l&&(n=d[l],!(n[1]+n[2]-1<=i));--l)if(n[1]<i&&n[1]+n[2]-1<s&&c[n[0]]<=a){keep=!1;break}if(keep){for(l=r+1;l!=u&&(n=e[l],!(n[1]>=s));++l)if(n[1]>i&&n[1]+n[2]-1>s&&c[n[0]]<=a){keep=!1;break}keep&&d.push(o)}}return d}function markRanges(e,t,o,n){var a,i,s,r,l="",c=cullOverlappingRanges(flattenRanges(filterRanges(t,o)),o),d=c.length,u={},p={},h=e.length;for(a=0;a!=d;++a)s=c[a],u.hasOwnProperty(s[1])?u[s[1]].push(s):u[s[1]]=[s],r=s[1]+s[2]-1,p.hasOwnProperty(r)?p[r].push(s):p[r]=[s];for(a=0;a!=h;++a){if(u.hasOwnProperty(a))for(headList=u[a],i=0;i!=headList.length;++i)l+=n?n(headList[i],!0):'<h class="'+headList[i][0]+'">';if(l+=encodeChar(e[a]),p.hasOwnProperty(a))for(tailList=p[a],i=0;i!=tailList.length;++i)l+=n?n(tailList[i],!1):"</h>"}return l}function sentenceMarker(e,t){if(t){var o=e[3];return'<h class="'+e[0]+" "+o.words+"_words"+(o["long"]?" longsentence":"")+'">'}return"</h>"}function initQuotes(){return originalText&&ranges&&"quotation"in ranges?void $("#quotes > p").html(markRanges(originalText,ranges,["quotation"])):void $("#quotesSubItem").hide()}function clone(e){return JSON.parse(JSON.stringify(e))}function encodeChar(e){return e.match(/[a-z0-9\-'"\.,;?! \n\t\(\)]+/i)?e:"&#"+e.charCodeAt(0)+";"}function extend(e,t){var o,n=Object.keys(t);for(o=0;o!=n.length;++o)e[n[o]]=t[n[o]];return e}function isDefined(e){return"undefined"!=typeof e}function resume(e){"path"in e&&(location.hash=e.path,"scrollGroups"in e&&(scrollGroups=e.scrollGroups,loadScrollPos()))}function buildPersistedState(){return{path:window.location.hash,scrollGroups:scrollGroups}}function persistStateToForm(){saveScrollPos();var e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name","persistedState"),e.value=JSON.stringify(buildPersistedState()),$("#mainForm").append(e)}var arrSentenceTable=$("#sentenceStatsTable > tbody > tr"),arrSentenceStats=[],arrSentenceTypes=[],arrSentenceWords=[],arrSentenceWordLengths=[],arrSentenceFlows=[],intFlowLookaround,mistakeoscope=$("#mistakeoscope"),viewport=$("#viewport"),mistakeoscopeStatus=!1,flowInitialized=!1,wordVarietyInitialized=!1,mouseX=mouseY=yPos=0,sentenceTypeDetector=new RegExp(/\b(fragment|simple|compound|complex|compoundcomplex)\b/),intV
2ocabLookAround=50,objMarkings=[],blnSubmitting=!1,blnMobile=!1,blnAutoHelp="yes"!==getCookie("autoHelp","yes"),intLastLength=-1,strLastPaper="",fontSizes=["small","","large","xlarge"],submenus=$(".submenu"),phoneSubmenus,isAggregateInitialized=!1,isWordsInitialized=!1,isPhrasesInitialized=!1,isMac=!1,mouseUp=!0,storeTextTimeout,lastHash=null,lastSelection="",arrNotices=[{name:"cliche",msg:"Cliché / colloquialism"},{name:"weasel",msg:"Weasel word"},{name:"passive",msg:"Passive voice"},{name:"filterword",msg:"Filter word"},{name:"doubled",msg:"Double word"},{name:"samestart",msg:"Starting word recycled in paragraph"},{name:"capitalization",msg:"Capitalization"},{name:"misplacedconjunction",msg:"Misplaced conjunction"},{name:"misplacedpreposition",msg:"Misplaced preposition"},{name:"excessiveprepositions",msg:"Excessive prepositional phrases"},{name:"longsentence",msg:"Long sentence"},{name:"extraspace",msg:"Extra space"},{name:"hidden",msg:"Hidden verb"},{name:"abstract",msg:"Abstract word"},{name:"splitinf",msg:"Split infinitive"},{name:"wordy",msg:"Wordy or redundant phrase"},{name:"legal",msg:"Legalese"},{name:"overwriting",msg:"Overwriting"},{name:"bias",msg:"Bias language"},{name:"confused",msg:"Possible confused word"},{name:"slang",msg:"Slang"},{name:"profanity",msg:"Profanity"},{name:"linkingverbs",msg:"Recycled linking verbs in sentence"},{name:"doubleneg",msg:"Double negative"},{name:"adjective",msg:"Adjective"},{name:"adverb",msg:"Adverb"},{name:"contraction",msg:"Contraction"},{name:"gender",msg:"Gender-specific pronoun"},{name:"transition",msg:"Transition word / phrase"},{name:"simile",msg:"Simile"},{name:"saidreplacement",msg:'"Said" replacement'},{name:"weakdescription",msg:"Weak description"},{name:"thirdpronoun",msg:"Third person pronoun"},{name:"function",msg:"Function word"},{name:"compoundcomplex",msg:"Compound-complex sentence"},{name:"complex",msg:"Complex sentence"},{name:"compound",msg:"Compound sentence"},{name:"simple",msg:"Simple sentence"},{name:"fragment",msg:"Sentence fragment"},{name:"quotation",msg:"Quotation"}],sentenceTypes=["compoundcomplex","complex","compound","simple","fragment"],scrollGroups=[{sheets:["features","structure","quotes","wordvariety","edit"],pos:0}],featureRangePriority=["cliche","hidden","passive","linkingverbs","confused","splitinf","bias","weakdescription","abstract","wordy","legal","overwriting","slang","profanity","samestart","misplacedconjunction","misplacedpreposition","saidreplacement","extraspace","doubled","simile","excessiveprepositions","transition","adverb","adjective","weasel","doubleneg","contraction","gender","filterword","thirdpronoun","capitalization","function"],structureRangePriority=["compoundcomplex","complex","compound","simple","fragment"];$(function(){var e;initHelp(),detectMobile(),detectBrowser(),detectMacOS(),setPlaceholder(),initQuotes(),drawARIGradeLevel(),doResize(),menuSelect("home",!0),$("#analysis a").click(function(){return learnMore($(this).closest("div").children("input").attr("name"))}),$(document).mousemove(updateFeaturesMistakeoscopePosition),objMarkings=$("#features h, #structure h, #quotes h"),0!=objMarkings.length&&(e=$("#features h"),objMarkings.hover(mouseOverMarking,mouseOutMarking),$("#features").click(function(){$(this).find("h.highlight").removeClass("focus").removeClass("highlight")}),e.each(function(e){$(this).data("markingIndex",e)}),e.click(function(e){quickHideMistakeoscope(),learnMoreMarking(this),scrollToMarking(this),$(this).hasClass("highlight")||(objMarkings.filter(".highlight").removeClass("highlight"),objMarkings.filter("."+$(this).attr("class")).addClass("highlight")),objMarkings.filter(".focus").removeClass("focus"),$(this).addClass("focus"),e.stopPropagation()}),$("#structure h").click(function(e){highlight(this),blnMobile?mouseOverMarking(e):learnMore(sentenceTypeDetector.exec($(this).attr("class"))[1]),scrollToMarking(this)})),$("input[type=checkbox]").change(function(){$("#preset").val("custom"),updateSettingsCookies(),""!=document.getElementById("paper").value&&showProofreadButton()}),$("div.option input[type=text]").change(function(){$("#preset").val("custom")}).keydown(function(){$("#preset").val("custom")}),$(".metaOption input").change(function(e){checkAll(e.currentTarget)}),$("div.option > input[type=checkbox]").not("#critiquedialog, #critiquenotdialog").change(function(){checkCritique()}
2),$("#share").hover(function(){$("#top .submenu").addClass("dismiss")},function(){$("#top .submenu").removeClass("dismiss")}),$("#viewport").scroll(quickHideMistakeoscope);var t,o=persistedState&&"path"in persistedState?persistedState.path:null;blnSubmitted?blnCritique?(t="critique/features",persistedState?(persistedState.path="#!edit"==o||/^#!settings\b/.test(o)?"#!"+t:persistedState.path,resume(persistedState)):(nav2(t,!0),blnMobile||blnIntegrated||learnMore("quickStats"))):(t="stats/aggregate",persistedState?(persistedState.path="#!edit"==o||/^#!settings\b/.test(o)?"#!"+t:persistedState.path,resume(persistedState)):(nav2(t,!0),blnMobile||blnIntegrated||!blnAutoHelp||learnMore("stats"))):nav2("home",!0),$("#paper").on("input",trimPaper),setInterval("learnMoreSelection()",100),setInterval("secure()",50),$(window).on("hashchange",nav2Hash),$(document).on("mouseup click contextmenu",function(e){mouseUp=!0}),$(document).mousedown(function(e){mouseUp=!1}),$("#menu, #menu a").mouseover(function(){$("#menu").addClass("active")}),$("#menu").mouseout(function(){$("#menu").removeClass("active")}),$("#menu a").click(function(){$("#menu").removeClass("active")}),initPhoneSubmenu(),initToggles(),hideShade(),new Clipboard(".copyItem"),blnAutoHelp&&$("#hintToggle").addClass("active"),blnShowAds&&setTimeout("addAds()",0),track(),blnDemo&&startWalkthrough(),$("#fileSelector").change(open),$(window).resize(doResize)});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.