-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfs-check.min.js
8 lines (5 loc) · 101 KB
/
fs-check.min.js
1
2
3
4
5
6
7
8
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.FSCheck=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"birthBeforeParentsBirth",type:"problem",signature:"parents",help:["nonexactDates","addingAndCorrecting"],check:function(person,parents){var birthBeforeParentBirth=[],birth=person.$getBirth(),addParent=function(parent){birthBeforeParentBirth.push({id:parent.id,name:parent.$getDisplayName(),birth:parent.$getDisplayBirthDate()})};if(!birth||!birth.date){return}var birthFormal=utils.getFormalDate(birth);if(!birthFormal||!utils.isFullDate(birthFormal)){return}for(var i=0;i<parents.length;i++){var parentBirth=parents[i].$getBirth();if(parentBirth){var parentBirthDate=utils.getFormalDate(parentBirth);if(parentBirthDate&&utils.isFullDate(parentBirthDate)&&utils.compareFormalDates(birthFormal,parentBirthDate)===-1){addParent(parents[i])}}}if(birthBeforeParentBirth.length>0){var template={pid:person.id,personName:person.$getDisplayName(),personBirth:person.$getDisplayBirthDate(),parents:birthBeforeParentBirth};return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],2:[function(_dereq_,module,exports){var utils=_dereq_("../util"),GedcomXDate=_dereq_("gedcomx-date");module.exports={id:"childBeforeMarriage",type:"problem",signature:"relationships",help:["addingAndCorrecting","parentRelationshipType"],check:function(person,relationships,persons){var marriages=relationships.getSpouseRelationships(),childrenBeforeMarriage=[];if(marriages.length===0){return}for(var i=0;i<marriages.length;i++){var marriage=marriages[i],marriageFacts=marriage.$getFacts(),marriageDates=[];for(var j=0;j<marriageFacts.length;j++){var fact=marriageFacts[j];if(fact.type==="http://gedcomx.org/Marriage"){var date=utils.getFormalDate(fact);if(date){date=new GedcomXDate(date);utils.ensureFullDate(date,1,1);marriageDates.push(date)}}}if(marriageDates.length===0){continue}marriageDates.sort(utils.compareFormalDates);var marriageDate=marriageDates[0];var children=relationships.getChildRelationshipsOf(marriage.$getSpouseId(person.id));if(children.length===0){continue}for(var j=0;j<children.length;j++){var rel=children[j],childId=rel.$getChildId(),child=persons[childId];if(!child){continue}if(!utils.isBiologicalChildAndParents(rel)){continue}var birth=child.$getBirth();if(!birth){continue}var birthDate=utils.getFormalDate(birth);if(!birthDate){continue}birthDate=new GedcomXDate(birthDate);utils.ensureFullDate(birthDate,12,31);if(utils.compareFormalDates(marriageDate,birthDate)===1){childrenBeforeMarriage.push({marriage:marriage,child:child,birthDate:birthDate})}}}if(childrenBeforeMarriage.length>0){var children=[];for(var i=0;i<childrenBeforeMarriage.length;i++){var data=childrenBeforeMarriage[i],spouseId=data.marriage.$getSpouseId(person.id),spouse=persons[spouseId],child=data.child;children.push({spouseName:spouse.$getDisplayName(),spouseId:spouseId,childName:child.$getDisplayName(),childId:child.id})}var template={pid:person.id,name:person.$getDisplayName(),children:children};return utils.createOpportunity(this,person,template)}}}},{"../util":41,"gedcomx-date":48}],3:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"childrenTooClose",type:"problem",signature:"children",help:[],check:function(person,children){if(person.gender.type!=="http://gedcomx.org/Female"){return}if(children.length===0){return}var compareList=[];for(var i=0;i<children.length;i++){var child=children[i],birth=child.$getBirth();if(!birth||!birth.date){continue}var newFormalDate=utils.getFormalDate(birth);if(newFormalDate&&utils.isFullDate(newFormalDate)){compareList.push({id:child.id,date:newFormalDate,name:child.$getDisplayName()})}}compareList.sort(function(a,b){return utils.compareFormalDates(a.date,b.date)});var problemPairs=[];for(var i=1;i<compareList.length;i++){var previous=compareList[i-1],current=compareList[i],previousGedcomXDate=new utils.GedcomXDate(previous.date),currentGedcomXDate=new utils.GedcomXDate(current.date);if(utils.compareFormalDates(previousGedcomXDate,currentGedcomXDate)!==0){var birthDuration=utils.GedcomXDate.getDuration(previousGedcomXDate,currentGedcomXDate);if(!birthDuration.getYears()&&birthDuration.getMonths()<9){problemPairs.push({firstName:previous.name,id1:previous.id,secondName:current.name,id2:current.id})}}}if(problemPairs.length===0){return}var template={pid:person.id,name:person.$getDisplayName(),pairs:problemPairs};return utils.createOpportunity(this,person,template)}};function formalDatesEqual(date1,date2){if(date1===date2){}}},{"../util.js":41}],4:[function(_dereq_,module,exports){var utils=_dereq_("../util"),GedcomXDate=_dereq_("gedcomx-date");module.exports={id:"deathBeforeBirth",type:"problem",signature:"person",help:["addingAndCorrecting","nonexactDates"],check:function(person){var birth=person.$getBirth(),death=person.$getDeath();if(!birth||!birth.date){return}if(!death||!death.date){return}if(!birth.$getFormalDate()||!death.$getFormalDate()){var birthYear=utils.getFactYear(birth),deathYear=utils.getFactYear(death);if(!birthYear||!deathYear||birthYear<=deathYear){return}}else{var birthGedx=new GedcomXDate(utils.getFormalDate(birth)),deathGedx=new GedcomXDate(utils.getFormalDate(death));utils.ensureFullDate(birthGedx,1,1);utils.ensureFullDate(deathGedx,12,31);if(utils.compareFormalDates(birthGedx,deathGedx)!==1){return}}var template={pid:person.id,name:person.$getDisplayName()};return utils.createOpportunity(this,person,template)}}},{"../util":41,"gedcomx-date":48}],5:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"duplicateNames",type:"cleanup",signature:"person",help:["addingAndCorrecting","customEvents"],check:function(person){var names=person.$getNames(),simplified={},duplicates=[];for(var i=0;i<names.length;i++){var name=names[i],fullText=name.$getFullText();if(fullText){var simple=fullText.toLowerCase().replace(/[\W]/g,"");if(simplified[simple]){simplified[simple].push(fullText)}else{simplified[simple]=[fullText]}}}for(var s in simplified){if(simplified[s].length>1){duplicates.push(simplified[s])}}if(duplicates.length>0){var template={pid:person.id,name:person.$getDisplayName(),duplicates:duplicates};return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],6:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"manyAlternateNames",type:"cleanup",signature:"person",help:["addingAndCorrecting","customEvents"],check:function(person){var names=person.$getNames();if(names&&names.length>=6){var alternates=[];for(var i=0;i<names.length;i++){if(!names[i].preferred){alternates.push(names[i].$getFullText())}}var template={pid:person.id,names:alternates};return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],7:[function(_dereq_,module,exports){var utils=_dereq_("../util.js"),GedcomXDate=_dereq_("gedcomx-date");module.exports={id:"marriageAfterDeath",type:"problem",signature:"relationships",help:[],check:function(person,relationships,people){var death=person.$getDeath(),spouseIds=relationships.getSpouseIds(),problemMarriages=[];if(!death||spouseIds.length==0){return}var formalDeathDate=utils.getFormalDate(death,true);if(!formalDeathDate){return}var formalDeathGedx=new GedcomXDate(formalDeathDate);utils.ensureFullDate(formalDeathGedx,12,31);for(var i=0;i<spouseIds.length;i++){var coupleRelationship=relationships.getSpouseRelationship(spouseIds[i]),coupleFacts=coupleRelationship.$getFacts(),problemMarriage=false;for(var j=0;!problemMarriage&&j<coupleFacts.length;j++){var fact=coupleFacts[j];if(!fact.date){continue}var formalMarriageDate=utils.getFormalDate(fact);if(formalMarriageDate){var formalMarriageGedx=new GedcomXDate(formalMarriageDate);utils.ensureFullDate(formalMarriageGedx);if(utils.compareFormalDates(formalMarriageGedx,formalDeathGedx)===1){problemMarriage=true;problemMarriages.push({spouseId:spouseIds[i],coupleId:coupleRelationship.id,fact:fact,formalDate:formalMarriageDate})}}}}if(problemMarriages.length>0){var spouses=[];for(var i=0;i<problemMarriages.length;i++){var spouseId=problemMarriages[i].spouseId;spouses.push({spouseName:people[spouseId].$getDisplayName(),coupleId:problemMarriages[i].coupleId})}var template={pid:person.id,name:person.$getDisplayName(),spouses:spouses};return utils.createOpportunity(this,person,template)}}}},{"../util.js":41,"gedcomx-date":48}],8:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"marriageWithNoChildren",type:"family",signature:"relationships",help:[],check:function(person,relationships,people){var allSpouseIds=relationships.getSpouseIds(),spouseIdsWithoutChildren=[];if(allSpouseIds.length==0){return}for(var i=0;i<allSpouseIds.length;i++){if(relationships.getChildRelationshipsOf(allSpouseIds[i]).length===0){spouseIdsWithoutChildren.push(allSpouseIds[i])}}if(spouseIdsWithoutChildren.length>0){var spouses=[];for(var i=0;i<spouseIdsWithoutChildren.length;i++){spouses.push({id:relationships.getSpouseRelationship(spouseIdsWithoutChildren[i]).id,name:people[spouseIdsWithoutChildren[i]].$getDisplayName()})}var template={pid:person.id,name:person.$getDisplayName(),multipleSpouses:spouses.length>1,spouse:spouses[0],spouses:spouses};return utils.createOpportunity(this,person,template)}}}},{"../util.js":41}],9:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingBirth",type:"person",signature:"person",help:[],check:function(person){var birth=person.$getBirth();if(birth){if(utils.getFactPlace(birth)!==undefined||utils.getFactYear(birth)!==undefined){return}}var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template,utils.gensearchPerson(person))}}},{"../util.js":41}],10:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingBirthDate",type:"person",signature:"person",help:[],check:function(person){var birth=person.$getBirth();if(!birth){return}if(utils.getFactYear(birth)!==undefined){return}var place=utils.getFactPlace(birth);if(place===undefined){return}var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template,utils.gensearchPerson(person))}}},{"../util.js":41}],11:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingBirthPlace",type:"person",signature:"person",help:[],check:function(person){var birth=person.$getBirth();if(!birth){return}if(utils.getFactPlace(birth)!==undefined){return}var year=utils.getFactYear(birth);if(year===undefined){return}var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template,utils.gensearchPerson(person))}}},{"../util.js":41}],12:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingBirthSource",type:"source",signature:"personSource",help:[],check:function(person,sourceRefs){var birth=person.$getBirth();if(!birth){return}var year=utils.getFactYear(birth),place=utils.getFactPlace(birth);if(year===undefined||place===undefined){return}var sourceArr=sourceRefs.getSourceRefs(),tagged=false;for(var x in sourceArr){if(sourceArr[x].$getTags().indexOf("http://gedcomx.org/Birth")!==-1){tagged=true}}if(!tagged){var findarecord={tags:["birth"],from:year?year-3:undefined,to:year?year+3:undefined,place:place};var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template,utils.gensearchPerson(person))}}}},{"../util.js":41}],13:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingDeath",type:"person",signature:"person",help:[],check:function(person){var death=person.$getDeath();if(death){if(utils.getFactPlace(death)!==undefined||utils.getFactYear(death)!==undefined){return}}var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template,utils.gensearchPerson(person))}}},{"../util.js":41}],14:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingDeathDate",type:"person",signature:"person",help:[],check:function(person){var death=person.$getDeath();if(!death){return}if(utils.getFactYear(death)!==undefined){return}var place=utils.getFactPlace(death);if(place===undefined){return}var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template,utils.gensearchPerson(person))}}},{"../util.js":41}],15:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingDeathPlace",type:"person",signature:"person",help:[],check:function(person){var death=person.$getDeath();if(!death){return}if(utils.getFactPlace(death)!==undefined){return}var year=utils.getFactYear(death);if(year===undefined){return}var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template,utils.gensearchPerson(person))}}},{"../util.js":41}],16:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingDeathSource",type:"source",signature:"personSource",help:[],check:function(person,sourceRefs){var death=person.$getDeath();if(!death){return}var year=utils.getFactYear(death),place=utils.getFactPlace(death);if(year===undefined||place==undefined){return}var sourceArr=sourceRefs.getSourceRefs(),tagged=false;for(var x in sourceArr){if(sourceArr[x].$getTags().indexOf("http://gedcomx.org/Death")!==-1){tagged=true}}if(!tagged){var findarecord={tags:["death"],from:year?year-3:undefined,to:year?year+3:undefined,place:place};var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template,utils.gensearchPerson(person))}}}},{"../util.js":41}],17:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingFather",type:"family",signature:"child",help:[],check:function(child,mother,father,childRelationship){if(!father){var birth=child.$getBirth(),birthYear,birthPlace;if(birth){birthYear=utils.getFactYear(birth);birthPlace=utils.getFactPlace(birth)}var template={mothername:mother.$getDisplayName(),mid:mother.id,name:child.$getDisplayName(),pid:child.id};var gensearch={givenName:child.$getGivenName(),familyName:child.$getSurname(),birthPlace:birthPlace,birthDate:birthYear+"",motherGivenName:mother.$getGivenName(),motherFamilyName:mother.$getSurname()};return utils.createOpportunity(this,child,template,gensearch)}}}},{"../util.js":41}],18:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"missingGivenName",type:"person",signature:"person",help:["addingAndCorrecting","customEvents"],check:function(person){var givenName=person.$getGivenName(),surname=person.$getSurname();if(surname&&(givenName===undefined||givenName==="")){return utils.createOpportunity(this,person,{},utils.gensearchPerson(person))}}}},{"../help":39,"../util":41}],19:[function(_dereq_,module,exports){var utils=_dereq_("../util");module.exports={id:"missingMarriageDate",type:"family",signature:"marriage",help:[],check:function(wife,husband,marriage){if(!wife||!husband){return}var facts=marriage.$getFacts(),count=0;for(var x in facts){if(facts[x].type=="http://gedcomx.org/Marriage"){count++}}if(count!=1){return}var marriageFact=marriage.$getMarriageFact();if(utils.getFactYear(marriageFact)!==undefined){return}var place=utils.getFactPlace(marriageFact);if(place===undefined){return}var template={crid:marriage.id,wid:wife.id,hid:husband.id,wifeName:wife.$getDisplayName(),husbandName:husband.$getDisplayName()};var gensearch=utils.gensearchPerson(wife);gensearch.marriagePlace=place;gensearch.spouseGivenName=husband.$getGivenName();gensearch.spouseFamilyName=husband.$getSurname();return utils.createOpportunity(this,wife,template,gensearch)}}},{"../util":41}],20:[function(_dereq_,module,exports){var utils=_dereq_("../util");module.exports={id:"missingMarriageFact",type:"family",signature:"marriage",help:[],check:function(wife,husband,marriage){if(!wife||!husband){return}var facts=marriage.$getFacts(),count=0;for(var x in facts){if(facts[x].type=="http://gedcomx.org/Marriage"){count++}}if(count>1){return}var marriageFact=marriage.$getMarriageFact();if(marriageFact&&(utils.getFactYear(marriageFact)!==undefined||utils.getFactPlace(marriageFact)!==undefined)){return}var template={crid:marriage.id,wid:wife.id,hid:husband.id,wifeName:wife.$getDisplayName(),husbandName:husband.$getDisplayName()};var gensearch=utils.gensearchPerson(wife);gensearch.spouseGivenName=husband.$getGivenName();gensearch.spouseFamilyName=husband.$getSurname();return utils.createOpportunity(this,wife,template,gensearch)}}},{"../util":41}],21:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingMarriagePlace",type:"family",signature:"marriage",help:[],check:function(wife,husband,marriage){if(!wife||!husband){return}var facts=marriage.$getFacts(),count=0;for(var x in facts){if(facts[x].type=="http://gedcomx.org/Marriage"){count++}}if(count!=1){return}var marriageFact=marriage.$getMarriageFact();if(utils.getFactPlace(marriageFact)!==undefined){return}var date=utils.getFactYear(marriageFact);if(date===undefined){return}var template={crid:marriage.id,wid:wife.id,hid:husband.id,wifeName:wife.$getDisplayName(),husbandName:husband.$getDisplayName()};var gensearch=utils.gensearchPerson(wife);gensearch.marriageDate=date+"";gensearch.spouseGivenName=husband.$getGivenName();gensearch.spouseFamilyName=husband.$getSurname();return utils.createOpportunity(this,wife,template,gensearch)}}},{"../util.js":41}],22:[function(_dereq_,module,exports){var utils=_dereq_("../util");module.exports={id:"missingMarriageSource",type:"source",signature:"marriageSource",help:[],check:function(wife,husband,marriage,sourceRefs){var marriageFact=marriage.$getMarriageFact();if(!marriageFact){return}var person=wife,spouse=husband;if(!person){return}var facts=marriage.$getFacts(),count=0;for(var x in facts){if(facts[x].type=="http://gedcomx.org/Marriage"){count++}}if(count!=1){return}var marriageYear=utils.getFactYear(marriageFact),marriagePlace=utils.getFactPlace(marriageFact);if(marriageYear==undefined||marriagePlace==undefined){return}if(sourceRefs.length>0){return}var template={cid:marriage.id,couple:wife.$getDisplayName()+" and "+husband.$getDisplayName(),wifeName:wife.$getDisplayName(),husbandName:husband.$getDisplayName(),wid:wife.id,hid:husband.id};var gensearch=utils.gensearchPerson(person);gensearch.marriageDate=marriageYear+"";gensearch.marriagePlace=marriagePlace;if(spouse!==undefined){gensearch.spouseGivenName=spouse.$getGivenName();gensearch.spouseFamilyName=spouse.$getSurname()}return utils.createOpportunity(this,person,template,gensearch)}}},{"../util":41}],23:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingMother",type:"family",signature:"child",help:[],check:function(child,mother,father,childRelationship){if(!mother){var birth=child.$getBirth(),birthYear,birthPlace;if(birth){birthYear=utils.getFactYear(birth);birthPlace=utils.getFactPlace(birth)}var template={fathername:father.$getDisplayName(),fid:father.id,name:child.$getDisplayName(),pid:child.id};var gensearch={givenName:child.$getGivenName(),familyName:child.$getSurname(),birthPlace:birthPlace,birthDate:birthYear+"",fatherGivenName:father.$getGivenName(),fatherFamilyName:father.$getSurname()};return utils.createOpportunity(this,child,template,gensearch)}}}},{"../util.js":41}],24:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"missingName",type:"person",signature:"person",help:["addingAndCorrecting","customEvents"],check:function(person){if(!person.names||person.names.length===0){return utils.createOpportunity(this,person,{},utils.gensearchPerson(person))}}}},{"../help":39,"../util":41}],25:[function(_dereq_,module,exports){var utils=_dereq_("../util.js");module.exports={id:"missingParents",type:"family",signature:"parents",help:[],check:function(child,parents){if(!parents||parents.length===0){var birth=child.$getBirth(),birthYear,birthPlace;if(birth){birthYear=utils.getFactYear(birth);birthPlace=utils.getFactPlace(birth)}var template={name:child.$getDisplayName(),pid:child.id};return utils.createOpportunity(this,child,template,utils.gensearchPerson(child))}}}},{"../util.js":41}],26:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"missingSurname",type:"person",signature:"person",help:["addingAndCorrecting","customEvents"],check:function(person){var givenName=person.$getGivenName(),surname=person.$getSurname();if(givenName&&(surname===undefined||surname==="")){return utils.createOpportunity(this,person,{},utils.gensearchPerson(person))}}}},{"../help":39,"../util":41}],27:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"multipleMarriageFacts",type:"cleanup",signature:"marriage",help:["addingAndCorrecting"],check:function(wife,husband,marriage){if(!wife||!husband){return}var facts=marriage.$getFacts(),count=0;for(var x in facts){if(facts[x].type==="http://gedcomx.org/Marriage"){count++}}if(count<2){return}var template={crid:marriage.id,wifeName:wife.$getDisplayName(),husbandName:husband.$getDisplayName()};return utils.createOpportunity(this,wife,template,utils.gensearchPerson(wife))}}},{"../help":39,"../util":41}],28:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"multipleParents",type:"family",signature:"relationships",help:["addingAndCorrecting","parentRelationshipType"],check:function(person,relationships,people){var parentRelationships=relationships.getParentRelationships();if(parentRelationships.length<2){return}var biologicalParentIds={};for(var i=0;i<parentRelationships.length;i++){var relationship=parentRelationships[i],fatherId=relationship.$getFatherId(),motherId=relationship.$getMotherId(),fatherFacts=relationship.$getFatherFacts(),motherFacts=relationship.$getMotherFacts();if(fatherId&&fatherFacts){for(var j=0;j<fatherFacts.length;j++){if(fatherFacts[j].type==="http://gedcomx.org/BiologicalParent"){biologicalParentIds[fatherId]=true}}}if(motherId&&motherFacts){for(var j=0;j<motherFacts.length;j++){if(motherFacts[j].type==="http://gedcomx.org/BiologicalParent"){biologicalParentIds[motherId]=true}}}}if(Object.keys(biologicalParentIds).length>2){var template={name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],29:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help"),regex=/ or /;module.exports={id:"orInName",type:"cleanup",signature:"person",help:["addingAndCorrecting","customEvents"],check:function(person){var name=person.$getPreferredName(),nameText=name&&name.$getFullText()?name.$getFullText():"",nameMatches=nameText.match(regex),template={pid:person.id};if(nameMatches){template.preferred=true;return utils.createOpportunity(this,person,template)}else if(person.$getNames().length>1){var names=person.$getNames(),badNames=[];for(var i=0;i<names.length;i++){var name=names[i],fullText=name.$getFullText();if(name.preferred)continue;if(fullText&&fullText.match(regex)!==null){badNames.push(fullText)}}if(badNames.length>0){template.badNames=badNames;template.preferred=false;return utils.createOpportunity(this,person,template)}}}}},{"../help":39,"../util":41}],30:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"possibleDuplicates",type:"problem",signature:"duplicates",help:["mergingDuplicates"],check:function(person,matches){var count=matches.getResultsCount();if(count===0){return}var goodMatches=0,results=matches.getSearchResults();for(var i=0;i<results.length;i++){if(results[i].confidence>=3){goodMatches++}}if(goodMatches===0){return}var template={pid:person.id,name:person.$getDisplayName(),count:goodMatches,singular:goodMatches===1};return utils.createOpportunity(this,person,template)}}},{"../help":39,"../util":41}],31:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"recordHints",type:"source",signature:"recordHints",help:["recordHints"],check:function(person,matches){var count=matches.getResultsCount();if(count===0){return}var results=matches.getSearchResults(),titles=[];for(var i=0;i<results.length;i++){titles.push(results[i].title)}var template={titles:titles,name:person.$getDisplayName(),pid:person.id};return utils.createOpportunity(this,person,template)}}},{"../help":39,"../util":41}],32:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"standardizeBirthDate",type:"cleanup",signature:"person",help:["standardizing"],check:function(person){var birth=person.$getBirth();if(!birth){return}if(birth.$getDate()!==undefined&&birth.$getNormalizedDate()===undefined){var template={pid:person.id,name:person.$getDisplayName(),date:birth.$getDate()};return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],33:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"standardizeBirthPlace",type:"cleanup",signature:"person",help:["standardizing"],check:function(person){var birth=person.$getBirth();if(!birth){return}if(birth.$getPlace()!==undefined&&birth.$getNormalizedPlace()===undefined){var template={pid:person.id,name:person.$getDisplayName(),place:birth.$getPlace()};return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],34:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"standardizeDeathDate",type:"cleanup",signature:"person",help:["standardizing"],check:function(person){var death=person.$getDeath();if(!death){return}if(death.$getDate()!==undefined&&death.$getNormalizedDate()===undefined){var template={pid:person.id,name:person.$getDisplayName(),date:death.$getDate()};return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],35:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"standardizeDeathPlace",type:"cleanup",signature:"person",help:["standardizing"],check:function(person){var death=person.$getDeath();if(!death){return}if(death.$getPlace()!==undefined&&death.$getNormalizedPlace()===undefined){var template={pid:person.id,name:person.$getDisplayName(),place:death.$getPlace()};return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],36:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"standardizeMarriageDate",type:"cleanup",signature:"marriage",help:["standardizing"],check:function(wife,husband,marriage){if(!wife||!husband){return}var marriageFact=marriage.$getMarriageFact();var facts=marriage.$getFacts(),count=0;for(var x in facts){if(facts[x].type=="http://gedcomx.org/Marriage"){count++}}if(count!=1){return}if(marriageFact.$getDate()!==undefined&&marriageFact.$getNormalizedDate()===undefined){var template={crid:marriage.id,wifeName:wife.$getDisplayName(),husbandName:husband.$getDisplayName(),date:facts[0].$getDate()};return utils.createOpportunity(this,wife,template)}}}},{"../help":39,"../util":41}],37:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help");module.exports={id:"standardizeMarriagePlace",type:"cleanup",signature:"marriage",help:["standardizing"],check:function(wife,husband,marriage){if(!wife||!husband){return}var marriageFact=marriage.$getMarriageFact();var facts=marriage.$getFacts(),count=0;for(var x in facts){if(facts[x].type=="http://gedcomx.org/Marriage"){count++}}if(count!=1){return}if(marriageFact.$getPlace()!==undefined&&marriageFact.$getNormalizedPlace()===undefined){var template={crid:marriage.id,wifeName:wife.$getDisplayName(),husbandName:husband.$getDisplayName(),place:marriageFact.$getPlace()};return utils.createOpportunity(this,wife,template)}}}},{"../help":39,"../util":41}],38:[function(_dereq_,module,exports){var utils=_dereq_("../util"),help=_dereq_("../help"),badChars=/[\{\}\[\]\(\)\<\>\!\@\#\$\%\^\&\*\+\=\/\|\\\?\_]/g;module.exports={id:"unusualCharactersInName",type:"cleanup",signature:"person",help:["addingAndCorrecting","customEvents"],check:function(person){var name=person.$getPreferredName(),nameText=name&&name.$getFullText()?name.$getFullText():"",nameMatches=nameText.match(badChars),template;if(nameMatches){template={chars:"`"+nameMatches.join("`, `")+"`",pid:person.id,brackets:nameText.match(/(\([^\)]*\))|(\{[^\}]*\})|(\[[^\]]*\])|(\<[^\>]*\>)/)!==null,preferred:true}}else if(person.$getNames().length>1){var names=person.$getNames(),badNames=[];for(var i=0;i<names.length;i++){var name=names[i],fullText=name.$getFullText();if(name.preferred)continue;if(fullText&&fullText.match(badChars)!==null){badNames.push(fullText)}}if(badNames.length>0){template={badNames:badNames,pid:person.id,preferred:false}}}if(template){return utils.createOpportunity(this,person,template)}}}},{"../help":39,"../util":41}],39:[function(_dereq_,module,exports){module.exports={addingAndCorrecting:"https://familysearch.org/ask/salesforce/viewArticle?urlname=Adding-and-Correcting-Information-about-People-and-Relationships",customEvents:"https://familysearch.org/ask/salesforce/viewArticle?urlname=Adding-a-Custom-Event-or-Fact-to-a-Person",deletingInformation:"https://familysearch.org/ask/salesforce/viewArticle?urlname=Deleting-a-Person-from-the-System",mergingDuplicates:"https://familysearch.org/ask/salesforce/viewArticle?urlname=Merging-Duplicate-Records-in-Family-Tree-1381814853391",nonexactDates:"https://familysearch.org/ask/salesforce/viewArticle?urlname=Do-not-know-exact-birth-date-or-death-date",recordHints:"https://familysearch.org/ask/salesforce/viewArticle?urlname=Record-Hints",standardizing:"https://familysearch.org/ask/salesforce/viewArticle?urlname=Entering-Standardized-Dates-and-Places",parentRelationshipType:"https://familysearch.org/ask/salesforce/viewArticle?urlname=Adding-Changing-and-Deleting-Relationship-Types-between-Parents-and-Children"}},{}],40:[function(_dereq_,module,exports){var utils=_dereq_("./util"),help=_dereq_("./help");var ids={};var signatures={};var types={};var languages={};module.exports={all:function(){return checks},id:function(checkId){return ids[checkId]},signature:function(signature){return signatures[signature]},signatures:function(){var list=[];for(var s in signatures){list.push(s)}return list},type:function(type){return types[type]},types:function(){var list=[];for(var t in types){list.push(t)}return list},add:function(check,templates){ids[check.id]=check;var signature=check.signature;if(!signatures[signature]){signatures[signature]=[]}signatures[signature].push(check);var type=check.type;if(!types[type]){types[type]=[]}types[type].push(check);if(templates){for(var lang in templates){if(!languages[lang]){languages[lang]={code:lang,help:{},checks:{}}}languages[lang].checks[check.id]=templates[lang]}}},remove:function(checkId){var check=ids[checkId];
if(check){delete ids[checkId];var signature=check.signature;for(var i=0;i<signatures[signature].length;i++){if(signatures[signature][i].id===checkId){signatures[signature].splice(i,1);break}}if(signatures[signature].length===0){delete signatures[signature]}var type=check.type;for(var i=0;i<types[type].length;i++){if(types[type][i].id===checkId){types[type].splice(i,1);break}}if(types[type].length===0){delete types[type]}for(var lang in languages){delete languages[lang].checks[checkId]}}},language:function(data){languages[data.code]=data},translate:function(opportunity,lang){if(!lang){throw new Error("Second parameter `lang` is required")}if(!languages[lang]){throw new Error("The given language is not defined: "+lang)}if(languages[lang]){var translation=languages[lang].checks[opportunity.checkId];if(translation){opportunity.title=translation.title;opportunity.description=utils.markdown(translation.description,opportunity.template,languages[lang].partials)}}},title:function(checkId,lang){if(!lang){throw new Error("Second parameter `lang` is required")}if(!languages[lang]){throw new Error("The given language is not defined: "+lang)}if(languages[lang]&&languages[lang].checks[checkId]){return languages[lang].checks[checkId].title}},help:function(helpId,lang){if(!lang){throw new Error("Second parameter `lang` is required")}if(!languages[lang]){throw new Error("The given language is not defined: "+lang)}if(Array.isArray(helpId)){var links=[];for(var i=0;i<helpId.length;i++){links.push(_help(helpId[i],lang))}return links}else{return _help(helpId,lang)}},utils:{getFactYear:utils.getFactYear,getFactPlace:utils.getFactPlace,gensearchPerson:utils.gensearchPerson,gedcomxDate:_dereq_("gedcomx-date")}};var checks=[_dereq_("./checks/birthBeforeParentsBirth"),_dereq_("./checks/childBeforeMarriage"),_dereq_("./checks/childrenTooClose"),_dereq_("./checks/deathBeforeBirth"),_dereq_("./checks/duplicateNames"),_dereq_("./checks/manyAlternateNames"),_dereq_("./checks/marriageAfterDeath"),_dereq_("./checks/marriageWithNoChildren"),_dereq_("./checks/missingBirth"),_dereq_("./checks/missingBirthDate"),_dereq_("./checks/missingBirthPlace"),_dereq_("./checks/missingBirthSource"),_dereq_("./checks/missingDeath"),_dereq_("./checks/missingDeathDate"),_dereq_("./checks/missingDeathPlace"),_dereq_("./checks/missingDeathSource"),_dereq_("./checks/missingFather"),_dereq_("./checks/missingGivenName"),_dereq_("./checks/missingMarriageDate"),_dereq_("./checks/missingMarriageFact"),_dereq_("./checks/missingMarriagePlace"),_dereq_("./checks/missingMarriageSource"),_dereq_("./checks/missingMother"),_dereq_("./checks/missingName"),_dereq_("./checks/missingParents"),_dereq_("./checks/missingSurname"),_dereq_("./checks/multipleMarriageFacts"),_dereq_("./checks/multipleParents"),_dereq_("./checks/orInName"),_dereq_("./checks/possibleDuplicates"),_dereq_("./checks/recordHints"),_dereq_("./checks/standardizeBirthDate"),_dereq_("./checks/standardizeBirthPlace"),_dereq_("./checks/standardizeDeathDate"),_dereq_("./checks/standardizeDeathPlace"),_dereq_("./checks/standardizeMarriageDate"),_dereq_("./checks/standardizeMarriagePlace"),_dereq_("./checks/unusualCharactersInName")];for(var i=0;i<checks.length;i++){module.exports.add(checks[i])}function _help(helpId,lang){if(languages[lang]&&languages[lang].help[helpId]){return{title:languages[lang].help[helpId],url:help[helpId]}}}},{"./checks/birthBeforeParentsBirth":1,"./checks/childBeforeMarriage":2,"./checks/childrenTooClose":3,"./checks/deathBeforeBirth":4,"./checks/duplicateNames":5,"./checks/manyAlternateNames":6,"./checks/marriageAfterDeath":7,"./checks/marriageWithNoChildren":8,"./checks/missingBirth":9,"./checks/missingBirthDate":10,"./checks/missingBirthPlace":11,"./checks/missingBirthSource":12,"./checks/missingDeath":13,"./checks/missingDeathDate":14,"./checks/missingDeathPlace":15,"./checks/missingDeathSource":16,"./checks/missingFather":17,"./checks/missingGivenName":18,"./checks/missingMarriageDate":19,"./checks/missingMarriageFact":20,"./checks/missingMarriagePlace":21,"./checks/missingMarriageSource":22,"./checks/missingMother":23,"./checks/missingName":24,"./checks/missingParents":25,"./checks/missingSurname":26,"./checks/multipleMarriageFacts":27,"./checks/multipleParents":28,"./checks/orInName":29,"./checks/possibleDuplicates":30,"./checks/recordHints":31,"./checks/standardizeBirthDate":32,"./checks/standardizeBirthPlace":33,"./checks/standardizeDeathDate":34,"./checks/standardizeDeathPlace":35,"./checks/standardizeMarriageDate":36,"./checks/standardizeMarriagePlace":37,"./checks/unusualCharactersInName":38,"./help":39,"./util":41,"gedcomx-date":48}],41:[function(_dereq_,module,exports){var GedcomXDate=_dereq_("gedcomx-date"),marked=_dereq_("marked"),renderer=new marked.Renderer,mustache=_dereq_("mustache");var utils=module.exports={GedcomXDate:GedcomXDate};renderer.heading=function(text,level){return"<h"+level+">"+text+"</h"+level+">\n"};utils.getFactYear=function(fact){if(fact.$getFormalDate()){var simple=utils.getSimpleFormalDate(fact.$getFormalDate());if(simple){return simple.getYear()}}else if(fact.$getDate()){return utils.extractYearFromDateString(fact.$getDate())}};utils.getFactPlace=function(fact){if(fact.$getNormalizedPlace()){return fact.$getNormalizedPlace()}else if(fact.$getPlace()){return fact.$getPlace()}};utils.getFormalDate=function(fact){if(fact.$getFormalDate()){var date=utils.getSimpleFormalDate(fact.$getFormalDate());if(date){return date.toFormalString()}}else if(fact.$getDate()){if(/^\d{4}$/.test(fact.$getDate())){return"+"+fact.$getDate()}else{var date=new Date(fact.$getDate());if(isNaN(date.getTime())){return}else{return GedcomXDate.fromJSDate(date).toFormalString().substring(0,11)}}}};utils.getSimpleFormalDate=function(formalDateString){var date=new GedcomXDate(formalDateString);if(date.getType()!="single"){if(date.getStart()&&!date.getEnd()){date=date.getStart()}else if(!date.getStart()&&date.getEnd()){date=date.getEnd()}else{var start=date.getStart(),duration=date.getDuration(),halfDuration=GedcomXDate.multiplyDuration(duration,.5);date=GedcomXDate.addDuration(start,halfDuration)}}return date};utils.extractYearFromDateString=function(date){if(/^\d{4}$/.test(date)){return date}else{var year=new Date(date).getFullYear();if(parseInt(year)==year){return year}}};utils.markdown=function(text,data,partials){return marked(mustache.render(text,data,partials),{renderer:renderer})};utils.gensearchPerson=function(person){var gensearch={};var givenName=person.$getGivenName();if(givenName){gensearch.givenName=givenName}var familyName=person.$getSurname();if(familyName){gensearch.familyName=familyName}var birth=person.$getBirth();if(birth!==undefined){var birthPlace=utils.getFactPlace(birth);if(birthPlace){gensearch.birthPlace=birthPlace}var birthDate=utils.getFactYear(birth);if(birthDate){gensearch.birthDate=birthDate+""}}var death=person.$getDeath();if(death!==undefined){var deathPlace=utils.getFactPlace(death);if(deathPlace){gensearch.deathPlace=deathPlace}var deathDate=utils.getFactYear(death);if(deathDate){gensearch.deathDate=deathDate+""}}return gensearch};utils.compareFormalDates=function(date1,date2){return GedcomXDate.compare(date1,date2)};utils.createOpportunity=function(check,person,template,gensearch){return{id:check.id+":"+person.id,type:check.type,checkId:check.id,personId:person.id,person:person,gensearch:gensearch,template:template}};utils.isFullDate=function(date){if(isString(date)){return date.length>=11}else{try{if(isUndefined(date.getYear())||isUndefined(date.getMonth())||isUndefined(date.getDay())){return false}else{return true}}catch(e){throw new Error("Expected either a formal date string or a GedcomXDate simple object.")}}};utils.ensureFullDate=function(date,newMonth,newDay){try{if(!newMonth){newMonth=1}if(newMonth>12){newMonth=12}if(!newDay){newDay=1}if(isUndefined(date.getMonth())){date._month=newMonth}if(isUndefined(date.getDay())){var validDayMax=GedcomXDate.daysInMonth(date.getMonth(),date.getYear());if(newDay>validDayMax){newDay=validDayMax}date._day=newDay}}catch(e){throw new Error("Expected date to be a GedcomXDate object.")}};utils.isBiologicalChildAndParents=function(childAndParents){var fatherFacts=childAndParents.$getFatherFacts(),motherFacts=childAndParents.$getMotherFacts();if(childAndParents.$getFatherId()){if(!fatherFacts||!containsBiologicalParentFact(fatherFacts)){return false}}if(childAndParents.$getMotherId()){if(!motherFacts||!containsBiologicalParentFact(motherFacts)){return false}}return true};function containsBiologicalParentFact(facts){for(var i=0;i<facts.length;i++){if(facts[i].type==="http://gedcomx.org/BiologicalParent"){return true}}return false}if(!Array.isArray){Array.isArray=function(arg){return Object.prototype.toString.call(arg)==="[object Array]"}}function isString(obj){return typeof obj==="string"||obj instanceof String}function isUndefined(obj){return typeof obj==="undefined"}},{"gedcomx-date":48,marked:54,mustache:55}],42:[function(_dereq_,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}if(canPost){var queue=[];window.addEventListener("message",function(ev){var source=ev.source;if((source===window||source===null)&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];function noop(){}process.on=noop;process.once=noop;process.off=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],43:[function(_dereq_,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],44:[function(_dereq_,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],45:[function(_dereq_,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=_dereq_("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=_dereq_("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,_dereq_("/home/ubuntu/workspace/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":44,"/home/ubuntu/workspace/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":42,inherits:43}],46:[function(_dereq_,module,exports){var util=_dereq_("util"),Simple=_dereq_("./simple.js");function Approximate(){if(arguments.length>0){if(arguments[0].length<1||arguments[0].charAt(0)!="A"){throw new Error("Invalid Approximate Date")}try{Simple.call(this,arguments[0].substr(1))}catch(e){throw new Error(e.message+" in Approximate Date")}}else{Simple.call(this)}}util.inherits(Approximate,Simple);Approximate.prototype.isApproximate=function(){return true};Approximate.prototype.toFormalString=function(){return"A"+Approximate.super_.prototype.toFormalString.call(this)};module.exports=Approximate},{"./simple.js":51,util:45}],47:[function(_dereq_,module,exports){function Duration(str){if(str.length<1||str.charAt(0)!="P"){throw new Error("Invalid Duration")}var duration=str.substr(1);if(duration.length<1){throw new Error("Invalid Duration")}if(/\s/.test(duration)){throw new Error("Non normalized durations not implemented")}else{this._parseNormalized(duration)}}Duration.prototype._parseNormalized=function(str){var duration=str.split(""),currentNum="",inTime=false,seen=[],valid=["Y","Mo","D","T","H","Mi","S"];for(var x in duration){var character=duration[x];if(/[0-9]/.test(character)){currentNum+=character+"";continue}switch(character){case"Y":if(currentNum.length<1){throw new Error("Invalid Duration: invalid years")}if(seen.indexOf("Y")!=-1){throw new Error("Invalid Duration: duplicate years")}if(valid.indexOf("Y")==-1){throw new Error("Invalid Duration: years out of order")}this._years=parseInt(currentNum,10);seen.push("Y");valid=valid.slice(valid.indexOf("Y")+1);currentNum="";break;case"M":if(inTime){if(currentNum.length<1){throw new Error("Invalid Duration: invalid minutes")}if(seen.indexOf("Mi")!=-1){throw new Error("Invalid Duration: duplicate minutes")}if(valid.indexOf("Mi")==-1){throw new Error("Invalid Duration: minutes out of order")}this._minutes=parseInt(currentNum,10);seen.push("Mi");valid=valid.slice(valid.indexOf("Mi")+1);currentNum=""}else{if(currentNum.length<1){throw new Error("Invalid Duration: invalid months")}if(seen.indexOf("Mo")!=-1){throw new Error("Invalid Duration: duplicate months")}if(valid.indexOf("Mo")==-1){throw new Error("Invalid Duration: months out of order")}this._months=parseInt(currentNum,10);valid=valid.slice(valid.indexOf("Mo")+1);seen.push("Mo");currentNum=""}break;case"D":if(currentNum.length<1){throw new Error("Invalid Duration: invalid days")}if(seen.indexOf("D")!=-1){throw new Error("Invalid Duration: duplicate days")}if(valid.indexOf("D")==-1){throw new Error("Invalid Duration: days out of order")}this._days=parseInt(currentNum,10);seen.push("D");valid=valid.slice(valid.indexOf("D")+1);currentNum="";break;case"H":if(!inTime){throw new Error("Invalid Duration: Missing T before hours")}if(currentNum.length<1){throw new Error("Invalid Duration: invalid hours")}if(seen.indexOf("H")!=-1){throw new Error("Invalid Duration: duplicate hours")}if(valid.indexOf("H")==-1){throw new Error("Invalid Duration: hours out of order")}this._hours=parseInt(currentNum,10);seen.push("H");valid=valid.slice(valid.indexOf("H")+1);currentNum="";break;case"S":if(!inTime){throw new Error("Invalid Duration: Missing T before seconds")}if(currentNum.length<1){throw new Error("Invalid Duration: invalid seconds")}if(seen.indexOf("S")!=-1){throw new Error("Invalid Duration: duplicate seconds")}this._seconds=parseInt(currentNum,10);seen.push("S");valid=[];currentNum="";break;case"T":if(seen.indexOf("T")!=-1){throw new Error("Invalid Duration: duplicate T")}inTime=true;seen.push("T");valid=valid.slice(valid.indexOf("T")+1);break;default:throw new Error("Invalid Duration: Unknown Letter "+character)}}if(currentNum!=""){throw new Error("Invalid Duration: No letter after "+currentNum)}};Duration.prototype.getType=function(){return"duration"};Duration.prototype.isApproximate=function(){return false};Duration.prototype.getYears=function(){return this._years};Duration.prototype.getMonths=function(){return this._months};Duration.prototype.getDays=function(){return this._days};Duration.prototype.getHours=function(){return this._hours};Duration.prototype.getMinutes=function(){return this._minutes};Duration.prototype.getSeconds=function(){return this._seconds};Duration.prototype.toFormalString=function(){var duration="P";if(this._years){duration+=this._years+"Y"}if(this._months){duration+=this._months+"M"}if(this._days){duration+=this._days+"D"}if(this._hours||this._minutes||this._seconds){duration+="T";if(this._hours){duration+=this._hours+"H"}if(this._minutes){duration+=this._minutes+"M"}if(this._seconds){duration+=this._seconds+"S"}}return duration};module.exports=Duration},{}],48:[function(_dereq_,module,exports){var GedUtil=_dereq_("./util.js"),Simple=_dereq_("./simple.js"),Approximate=_dereq_("./approximate.js"),Recurring=_dereq_("./recurring.js"),Range=_dereq_("./range.js");function GedcomXDate(str){if(str==""){throw new Error("Invalid Date")}if(str.charAt(0)=="R"){return new Recurring(str)}else if(/\//.test(str)){return new Range(str)}else if(str.charAt(0)=="A"){return new Approximate(str)}else{return new Simple(str)}}GedcomXDate.version="0.3.2";GedcomXDate.addDuration=GedUtil.addDuration;GedcomXDate.multiplyDuration=GedUtil.multiplyDuration;GedcomXDate.getDuration=GedUtil.getDuration;GedcomXDate.daysInMonth=GedUtil.daysInMonth;GedcomXDate.now=GedUtil.now;GedcomXDate.fromJSDate=GedUtil.fromJSDate;GedcomXDate.compare=GedUtil.compare;module.exports=GedcomXDate},{"./approximate.js":46,"./range.js":49,"./recurring.js":50,"./simple.js":51,"./util.js":53}],49:[function(_dereq_,module,exports){var GedUtil=_dereq_("./util.js"),Simple=_dereq_("./simple.js"),Duration=_dereq_("./duration.js"),Approximate=_dereq_("./approximate.js");function Range(str){var range=str;if(range.charAt(0)=="A"){this._approximate=true;range=str.substr(1)}var parts=range.split("/");if(parts.length!=2||!parts[0]&&!parts[1]){throw new Error("Invalid Date Range")}if(parts[0]){try{this.start=new Simple(parts[0])}catch(e){throw new Error(e.message+" in Range Start Date")}}if(parts[1]){if(parts[1].charAt(0)=="P"){if(!this.start){throw new Error("A Range may not end with a duration if missing a start date")}try{this.duration=new Duration(parts[1])}catch(e){throw new Error(e.message+" in Range End Date")}this.end=GedUtil.addDuration(this.start,this.duration)}else{try{this.end=new Simple(parts[1])}catch(e){throw new Error(e.message+" in Range End Date")}if(this.start){this.duration=GedUtil.getDuration(this.start,this.end)}}}}Range.prototype.getType=function(){return"range"};Range.prototype.isApproximate=function(){if(this._approximate){return true}else{return false}};Range.prototype.getStart=function(){return this.start};Range.prototype.getDuration=function(){return this.duration};Range.prototype.getEnd=function(){return this.end};Range.prototype.toFormalString=function(){var range="";if(this._approximate){range+="A"}if(this.start){range+=this.start.toFormalString()}range+="/";if(this.duration){range+=this.duration.toFormalString()}else if(this.end){range+=this.end.toFormalString()}return range};module.exports=Range},{"./approximate.js":46,"./duration.js":47,"./simple.js":51,"./util.js":53}],50:[function(_dereq_,module,exports){var util=_dereq_("util"),GedUtil=_dereq_("./util.js"),Range=_dereq_("./range.js");function Recurring(str){var parts=str.split("/");if(str.charAt(0)!="R"||parts.length!=3){throw new Error("Invalid Recurring Date")}if(!parts[1]||!parts[2]){throw new Error("Recurring must have a start and end")}var countNum=parts[0].substr(1);if(countNum){if(!/^[0-9]+$/.test(countNum)){throw new Error("Invalid recurrence count: not a number")}this.count=parseInt(countNum,10);if(this.count<0)throw new Error("Invalid recurrence count")}Range.call(this,parts[1]+"/"+parts[2]);delete this.end;if(this.count){this.end=this.getNth(this.count)}}util.inherits(Recurring,Range);Recurring.prototype.getType=function(){return"recurring"};Recurring.prototype.getCount=function(){if(this.count==undefined){return Infinity}else{return this.count}};Recurring.prototype.getNth=function(multiplier){var duration=GedUtil.multiplyDuration(this.duration,multiplier);return GedUtil.addDuration(this.start,duration)};Recurring.prototype.toFormalString=function(){var range=Recurring.super_.prototype.toFormalString.call(this);if(this.count){return"R"+this.count+"/"+range}else{return"R/"+range}};module.exports=Recurring},{"./range.js":49,"./util.js":53,util:45}],51:[function(_dereq_,module,exports){var GlobalUtil=_dereq_("./util-global.js");function Simple(){if(arguments.length>0){this._parse(arguments[0])}else{var date=new Date;this._year=date.getUTCFullYear();this._month=date.getUTCMonth();this._day=date.getUTCDay();this._hours=date.getUTCHours();this._minutes=date.getUTCMinutes();this._seconds=date.getUTCSeconds();this._tzHours=0;this._tzMinutes=0}}Simple.prototype._parse=function(str){var end=str.length,offset=0;if(str.length<5)throw new Error("Invalid Date");var year=str.substr(offset,5);if(year.match(/^[+-][0-9]{4}$/)===null){throw new Error("Invalid Date: Malformed year")}this._year=parseInt(year,10);offset+=5;if(offset==end){return}if(str.charAt(offset)=="T"){return this._parseTime(str.substr(offset+1))}if(str.charAt(offset)!="-"){throw new Error("Invalid Date: Malformed year-month separator")}if(end-offset<3){throw new Error("Invalid Date: Malformed month")}var month=str.substr(offset+1,2);if(month.match(/^(0[1-9]|1[0-2])$/)===null){throw new Error("Invalid Date: Malformed month")}this._month=parseInt(month,10);offset+=3;if(offset==end){return}if(str.charAt(offset)=="T"){return this._parseTime(str.substr(offset+1))}if(str.charAt(offset)!="-"){throw new Error("Invalid Date: Malformed month-day separator")}if(end-offset<3){throw new Error("Invalid Date: Malformed day")}var day=str.substr(offset+1,2);var daysInMonth=GlobalUtil.daysInMonth(this._month,this._year);switch(daysInMonth){case 31:if(day.match(/^(0[1-9]|[1-2][0-9]|3[0-1])$/)===null){throw new Error("Invalid Date: Malformed day (31 in month "+this._month+")")}break;case 30:if(day.match(/^(0[1-9]|[1-2][0-9]|30)$/)===null){throw new Error("Invalid Date: Malformed day (30 in month "+this._month+")")}break;case 29:if(day.match(/^(0[1-9]|1[0-9]|2[0-9])$/)===null){throw new Error("Invalid Date: Malformed day (29 in month "+this._month+" - leapyear)")}break;case 28:if(day.match(/^(0[1-9]|1[0-9]|2[0-8])$/)===null){throw new Error("Invalid Date: Malformed day (28 in month "+this._month+")")}break}this._day=parseInt(day,10);offset+=3;if(offset==end)return;if(str.charAt(offset)=="T"){return this._parseTime(str.substr(offset+1))}else{throw new Error("Invalid Date")}};Simple.prototype._parseTime=function(str){var offset=0,end=str.length,flag24=false;var tempDate=new Date,tempOffset=tempDate.getTimezoneOffset();this._tzHours=tempOffset/60;this._tzMinutes=tempOffset%60;if(str.length<2)throw new Error("Invalid Date: Malformed hours");var hours=str.substr(offset,2);if(hours.match(/^([0-1][0-9]|2[0-3])$/)===null){if(hours=="24"){flag24=true}else{throw new Error("Invalid Date: Malformed hours")}}this._hours=parseInt(hours,10);offset+=2;if(offset==end){return}if(str.charAt(offset)=="+"||str.charAt(offset)=="-"||str.charAt(offset)=="Z"){return this._parseTimezone(str.substr(offset))}if(str.charAt(offset)!=":"){throw new Error("Invalid Date: Malformed hour-minute separator")}if(end-offset<3){throw new Error("Invalid Date: Malformed minutes")}var minutes=str.substr(offset+1,2);if(minutes.match(/^[0-5][0-9]$/)===null){throw new Error("Invalid Date: Malformed minutes")}if(flag24&&minutes!="00"){throw new Error("Invalid Date: Hour of 24 requires 00 minutes")}this._minutes=parseInt(minutes,10);offset+=3;if(offset==end){return}if(str.charAt(offset)=="+"||str.charAt(offset)=="-"||str.charAt(offset)=="Z"){return this._parseTimezone(str.substr(offset))}if(str.charAt(offset)!=":"){throw new Error("Invalid Date: Malformed minute-second separator");
}if(end-offset<3){throw new Error("Invalid Date: Malformed seconds")}var seconds=str.substr(offset+1,2);if(seconds.match(/^[0-5][0-9]$/)===null){throw new Error("Invalid Date: Malformed seconds")}if(flag24&&seconds!="00"){throw new Error("Invalid Date: Hour of 24 requires 00 seconds")}this._seconds=parseInt(seconds,10);offset+=3;if(offset==end){return}if(str.charAt(offset)=="+"||str.charAt(offset)=="-"||str.charAt(offset)=="Z"){return this._parseTimezone(str.substr(offset))}else{throw new Error("Invalid Date: Malformed Time")}};Simple.prototype._parseTimezone=function(str){var offset=0,end=str.length;if(str.charAt(0)=="Z"){if(str.length==1){this._tzHours=0;this._tzMinutes=0;return}else{throw new Error("Invalid Date: malformed timezone")}}if(end-offset<3){throw new Error("Invalid Date: Malformed timezone")}var tzHours=str.substr(offset,3);if(tzHours.match(/^[+-]([0-1][0-9]|2[0-3])$/)===null){throw new Error("Invalid Date: Malformed timezone hours")}this._tzHours=parseInt(tzHours,10);this._tzMinutes=0;offset+=3;if(offset==end){return}if(str.charAt(offset)!=":"){throw new Error("Invalid Date: Malformed timezone hour-minute separator")}if(end-offset<3){throw new Error("Invalid Date: Malformed timezone minutes")}var tzMinutes=str.substr(offset+1,2);if(tzMinutes.match(/^[0-5][0-9]$/)===null){throw new Error("Invalid Date: Malformed timezone minutes")}this._tzMinutes=parseInt(tzMinutes,10);offset+=3;if(offset==end){return}else{throw new Error("Invalid Date: Malformed timezone")}};Simple.prototype.getType=function(){return"single"};Simple.prototype.isApproximate=function(){return false};Simple.prototype.getYear=function(){return this._year};Simple.prototype.getMonth=function(){return this._month};Simple.prototype.getDay=function(){return this._day};Simple.prototype.getHours=function(){return this._hours};Simple.prototype.getMinutes=function(){return this._minutes};Simple.prototype.getSeconds=function(){return this._seconds};Simple.prototype.getTZHours=function(){return this._tzHours};Simple.prototype.getTZMinutes=function(){return this._tzMinutes};Simple.prototype.toFormalString=function(){var simple="";if(this._year>=0){simple+="+"+("0000"+this._year).substr(-4,4)}else{simple+="-"+("0000"+Math.abs(this._year)).substr(-4,4)}if(this._month){simple+="-"+("00"+this._month).substr(-2,2)}if(this._day){simple+="-"+("00"+this._day).substr(-2,2)}if(this._hours!=undefined||this._minutes!=undefined||this._seconds!=undefined){simple+="T"}if(this._hours!=undefined){simple+=("00"+this._hours).substr(-2,2)}if(this._minutes!=undefined){simple+=":"+("00"+this._minutes).substr(-2,2)}if(this._seconds!=undefined){simple+=":"+("00"+this._seconds).substr(-2,2)}if(this._hours!=undefined||this._minutes!=undefined||this._seconds!=undefined){if(this._tzHours===0||this._tzMinutes===0){simple+="Z"}else{if(this._tzHours!=undefined){if(this._tzHours>=0){simple+="+"}else{simple+="-"}simple+=("00"+Math.abs(this._tzHours)).substr(-2,2)}if(this._tzMinutes!=undefined){simple+=":"+("00"+this._tzMinutes).substr(-2,2)}}}return simple};module.exports=Simple},{"./util-global.js":52}],52:[function(_dereq_,module,exports){module.exports={daysInMonth:daysInMonth};function daysInMonth(month,year){switch(month){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return 31;case 4:case 6:case 9:case 11:return 30;case 2:var leapyear;if(year%4!=0){leapyear=false}else if(year%100!=0){leapyear=true}else if(year%400!=0){leapyear=false}else{leapyear=true}if(leapyear){return 29}else{return 28}default:throw new Error("Unknown Month")}}},{}],53:[function(_dereq_,module,exports){var GlobalUtil=_dereq_("./util-global.js"),Duration=_dereq_("./duration.js"),Simple=_dereq_("./simple.js"),Approximate=_dereq_("./approximate.js");module.exports={getDuration:getDuration,daysInMonth:GlobalUtil.daysInMonth,addDuration:addDuration,multiplyDuration:multiplyDuration,now:now,fromJSDate:fromJSDate,compare:compare};function multiplyDuration(startDuration,multiplier){if(!isFinite(multiplier)||multiplier<=0){throw new Error("Invalid Multiplier")}var newDuration={},hasTime=false,duration="";if(startDuration.getSeconds()){newDuration.seconds=Math.round(startDuration.getSeconds()*multiplier)}if(startDuration.getMinutes()){newDuration.minutes=Math.round(startDuration.getMinutes()*multiplier)}if(startDuration.getHours()){newDuration.hours=Math.round(startDuration.getHours()*multiplier)}if(startDuration.getDays()){newDuration.days=Math.round(startDuration.getDays()*multiplier)}if(startDuration.getMonths()){newDuration.months=Math.round(startDuration.getMonths()*multiplier)}if(startDuration.getYears()){newDuration.years=Math.round(startDuration.getYears()*multiplier)}if(newDuration.seconds){hasTime=true;duration=newDuration.seconds+"S"+duration}if(newDuration.minutes){hasTime=true;duration=newDuration.minutes+"M"+duration}if(newDuration.hours){hasTime=true;duration=newDuration.hours+"H"+duration}if(hasTime){duration="T"+duration}if(newDuration.days){duration=newDuration.days+"D"+duration}if(newDuration.months){duration=newDuration.months+"M"+duration}if(newDuration.years){duration=newDuration.years+"Y"+duration}if(!duration){throw new Error("Invalid Duration Multiplier")}return new Duration("P"+duration)}function addDuration(startDate,duration){var end=getObjFromDate(startDate,false),endString="";zipDuration(end,duration);if(startDate.getTZHours()!=undefined){if(startDate.getTZHours()<0){endString+="-"}else{endString+="+"}endString+=("00"+Math.abs(startDate.getTZHours())).substr(-2,2);endString+=":"+("00"+Math.abs(startDate.getTZMinutes())).substr(-2,2)}if(duration.getSeconds()){end.seconds+=duration.getSeconds()}while(end.seconds&&end.seconds>=60){end.seconds-=60;end.minutes+=1}if(end.seconds!=undefined){endString=":"+("00"+end.seconds).substr(-2,2)+endString}if(duration.getMinutes()){end.minutes+=duration.getMinutes()}while(end.minutes&&end.minutes>=60){end.minutes-=60;end.hours+=1}if(end.minutes!=undefined){endString=":"+("00"+end.minutes).substr(-2,2)+endString}if(duration.getHours()){end.hours+=duration.getHours()}while(end.hours&&end.hours>=24){end.hours-=24;end.day+=1}if(end.hours!=undefined){endString="T"+("00"+end.hours).substr(-2,2)+endString}if(duration.getDays()){end.day+=duration.getDays()}while(end.day&&end.day>GlobalUtil.daysInMonth(end.month,end.year)){end.day-=GlobalUtil.daysInMonth(end.month,end.year);end.month+=1;if(end.month>12){end.month-=12;end.year+=1}}if(duration.getMonths()){end.month+=duration.getMonths()}while(end.month&&end.month>12){end.month-=12;end.year+=1}if(end.day&&end.day>GlobalUtil.daysInMonth(end.month,end.year)){end.day=end.day-GlobalUtil.daysInMonth(end.month,end.year);end.month+=1;if(end.month>12){end.month-=12;end.year+=1}}if(end.day!=undefined){endString="-"+("00"+end.day).substr(-2,2)+endString}if(end.month!=undefined){endString="-"+("00"+end.month).substr(-2,2)+endString}if(duration.getYears()){end.year+=duration.getYears()}if(end.year!=undefined){endString=("0000"+Math.abs(end.year)).substr(-4,4)+endString;if(end.year<0){endString="-"+endString}else{endString="+"+endString}}if(end.year>9999){throw new Error("New date out of range")}if(startDate.isApproximate()){endString="A"+endString;return new Approximate(endString)}else{return new Simple(endString)}}function getDuration(startDate,endDate){if(!(startDate instanceof Simple&&endDate instanceof Simple)){throw new Error("Start and end dates must be simple dates")}var start=getObjFromDate(startDate,true),end=getObjFromDate(endDate,true),hasTime=false,duration="";zipDates(start,end);if(end.seconds!=undefined){while(end.seconds-start.seconds<0){end.minutes-=1;end.seconds+=60}if(end.seconds-start.seconds>0){hasTime=true;duration=("00"+(end.seconds-start.seconds)).substr(-2,2)+"S"+duration}}if(end.minutes!=undefined){while(end.minutes-start.minutes<0){end.hours-=1;end.minutes+=60}if(end.minutes-start.minutes>0){hasTime=true;duration=("00"+(end.minutes-start.minutes)).substr(-2,2)+"M"+duration}}if(end.hours!=undefined){while(end.hours-start.hours<0){end.day-=1;end.hours+=24}if(end.hours-start.hours>0){hasTime=true;duration=("00"+(end.hours-start.hours)).substr(-2,2)+"H"+duration}}if(hasTime){duration="T"+duration}if(end.day!=undefined){while(end.day-start.day<0){end.month-=1;if(end.month<1){end.year-=1;end.month+=12}end.day+=GlobalUtil.daysInMonth(end.month,end.year)}if(end.day-start.day>0){duration=("00"+(end.day-start.day)).substr(-2,2)+"D"+duration}}if(end.month!=undefined){while(end.month-start.month<0){end.year-=1;end.month+=12}if(end.month-start.month>0){duration=("00"+(end.month-start.month)).substr(-2,2)+"M"+duration}}if(end.year-start.year>0){duration=("0000"+(end.year-start.year)).substr(-4,4)+"Y"+duration}if(end.year-start.year<0||duration==""){throw new Error("Start Date must be less than End Date")}return new Duration("P"+duration)}function zipDates(start,end){if(start.month!=undefined&&end.month==undefined){end.month=1}if(start.month==undefined&&end.month!=undefined){start.month=1}if(start.day!=undefined&&end.day==undefined){end.day=1}if(start.day==undefined&&end.day!=undefined){start.day=1}if(start.hours!=undefined&&end.hours==undefined){end.hours=0}if(start.hours==undefined&&end.hours!=undefined){start.hours=0}if(start.minutes!=undefined&&end.minutes==undefined){end.minutes=0}if(start.minutes==undefined&&end.minutes!=undefined){start.minutes=0}if(start.seconds!=undefined&&end.seconds==undefined){end.seconds=0}if(start.seconds==undefined&&end.seconds!=undefined){start.seconds=0}}function zipDuration(date,duration){var toSet={};if(duration.getSeconds()){toSet={seconds:true,minutes:true,hours:true,days:true,months:true}}else if(duration.getMinutes()){toSet={minutes:true,hours:true,days:true,months:true}}else if(duration.getHours()){toSet={hours:true,days:true,months:true}}else if(duration.getDays()){toSet={days:true,months:true}}else if(duration.getMonths()){toSet={months:true}}else{return}if(toSet.seconds&&date.seconds==undefined){date.seconds=0}if(toSet.minutes&&date.minutes==undefined){date.minutes=0}if(toSet.hours&&date.hours==undefined){date.hours=0}if(toSet.days&&date.day==undefined){date.day=1}if(toSet.months&&date.month==undefined){date.month=1}}function getObjFromDate(date,adjustTimezone){var obj={year:date.getYear(),month:date.getMonth(),day:date.getDay(),hours:date.getHours(),minutes:date.getMinutes(),seconds:date.getSeconds()};if(adjustTimezone){if(obj.minutes!=undefined&&date.getTZMinutes()!=undefined){obj.minutes+=date.getTZMinutes()}if(obj.hours!=undefined&&date.getTZHours()!=undefined){obj.hours+=date.getTZHours()}}return obj}function now(){return fromJSDate(new Date)}function fromJSDate(date){return new Simple("+"+date.toISOString().replace(/\.\d{3}/,""))}function compare(date1,date2){if(isString(date1)){try{if(date1[0]==="A"){date1=new Approximate(date1)}else{date1=new Simple(date1)}}catch(e){throw new Error(date1+" is not a simple date. Can only compare simple dates.")}}if(isString(date2)){try{if(date2[0]==="A"){date2=new Approximate(date2)}else{date2=new Simple(date2)}}catch(e){throw new Error(date2+" is not a simple date. Can only compare simple dates.")}}if(!(date1 instanceof Simple)||!(date2 instanceof Simple)){throw new Error("Bad input. Can only compare simple dates.")}var parts=["_year","_month","_day","_hours","_minutes","_seconds"];for(var i=0;i<parts.length;i++){var part=parts[i];if(date1[part]===date2[part]){continue}if(typeof date1[part]==="undefined"||typeof date2[part]==="undefined"){throw new Error("Unable to compare dates with different specificities.")}if(date1[part]>date2[part]){return 1}else{return-1}}return 0}function isString(obj){return typeof obj==="string"||obj instanceof String}},{"./approximate.js":46,"./duration.js":47,"./simple.js":51,"./util-global.js":52}],54:[function(_dereq_,module,exports){(function(global){(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].split(/ *\| */)}this.tokens.push(item);continue}if(cap=this.rules.lheading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[2]==="="?1:2,text:cap[1]});continue}if(cap=this.rules.hr.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"hr"});continue}if(cap=this.rules.blockquote.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"blockquote_start"});cap=cap[0].replace(/^ *> ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i<l;i++){item=cap[i];space=item.length;item=item.replace(/^ *([*+-]|\d+\.) +/,"");if(~item.indexOf("\n ")){space-=item.length;item=!this.options.pedantic?item.replace(new RegExp("^ {1,"+space+"}","gm"),""):item.replace(/^ {1,4}/gm,"")}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(cap[i+1])[0];if(bull!==b&&!(bull.length>1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */)}this.tokens.push(item);continue}if(top&&(cap=this.rules.paragraph.exec(src))){src=src.substring(cap[0].length);this.tokens.push({type:"paragraph",text:cap[1].charAt(cap[1].length-1)==="\n"?cap[1].slice(0,-1):cap[1]});continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"text",text:cap[0]});continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return this.tokens};var inline={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};inline._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;inline._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^<a /i.test(cap[0])){this.inLink=true}else if(this.inLink&&/^<\/a>/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i<l;i++){ch=text.charCodeAt(i);if(Math.random()>.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"<pre><code>"+(escaped?code:escape(code,true))+"\n</code></pre>"}return'<pre><code class="'+this.options.langPrefix+escape(lang,true)+'">'+(escaped?code:escape(code,true))+"\n</code></pre>\n"};Renderer.prototype.blockquote=function(quote){return"<blockquote>\n"+quote+"</blockquote>\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"<h"+level+' id="'+this.options.headerPrefix+raw.toLowerCase().replace(/[^\w]+/g,"-")+'">'+text+"</h"+level+">\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"</"+type+">\n"};Renderer.prototype.listitem=function(text){return"<li>"+text+"</li>\n"};Renderer.prototype.paragraph=function(text){return"<p>"+text+"</p>\n"};Renderer.prototype.table=function(header,body){return"<table>\n"+"<thead>\n"+header+"</thead>\n"+"<tbody>\n"+body+"</tbody>\n"+"</table>\n"};Renderer.prototype.tablerow=function(content){return"<tr>\n"+content+"</tr>\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"</"+type+">\n"};Renderer.prototype.strong=function(text){return"<strong>"+text+"</strong>"};Renderer.prototype.em=function(text){return"<em>"+text+"</em>"};Renderer.prototype.codespan=function(text){return"<code>"+text+"</code>"};Renderer.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"};Renderer.prototype.del=function(text){return"<del>"+text+"</del>"};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='<a href="'+href+'"';if(title){out+=' title="'+title+'"'}out+=">"+text+"</a>";return out};Renderer.prototype.image=function(href,title,text){var out='<img src="'+href+'" alt="'+text+'"';if(title){out+=' title="'+title+'"'}out+=this.options.xhtml?"/>":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i<this.token.header.length;i++){flags={header:true,align:this.token.align[i]};cell+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]})}header+=this.renderer.tablerow(cell);for(i=0;i<this.token.cells.length;i++){row=this.token.cells[i];cell="";for(j=0;j<row.length;j++){cell+=this.renderer.tablecell(this.inline.output(row[j]),{header:false,align:this.token.align[j]})}body+=this.renderer.tablerow(cell)}return this.renderer.table(header,body)}case"blockquote_start":{var body="";while(this.next().type!=="blockquote_end"){body+=this.tok()}return this.renderer.blockquote(body)}case"list_start":{var body="",ordered=this.token.ordered;while(this.next().type!=="list_end"){body+=this.tok()}return this.renderer.list(body,ordered)}case"list_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.token.type==="text"?this.parseText():this.tok()}return this.renderer.listitem(body)}case"loose_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.tok()}return this.renderer.listitem(body)}case"html":{var html=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(html)}case"paragraph":{return this.renderer.paragraph(this.inline.output(this.token.text))}case"text":{return this.renderer.paragraph(this.parseText())}}};function escape(html,encode){return html.replace(!encode?/&(?!#?\w+;)/g:/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;i<arguments.length;i++){target=arguments[i];for(key in target){if(Object.prototype.hasOwnProperty.call(target,key)){obj[key]=target[key]}}}return obj}function marked(src,opt,callback){if(callback||typeof opt==="function"){if(!callback){callback=opt;opt=null}opt=merge({},marked.defaults,opt||{});var highlight=opt.highlight,tokens,pending,i=0;try{tokens=Lexer.lex(src,opt)}catch(e){return callback(e)}pending=tokens.length;var done=function(err){if(err){opt.highlight=highlight;return callback(err)}var out;try{out=Parser.parse(tokens,opt)}catch(e){err=e}opt.highlight=highlight;return err?callback(err):callback(null,out)};if(!highlight||highlight.length<3){return done()}delete opt.highlight;if(!pending)return done();for(;i<tokens.length;i++){(function(token){if(token.type!=="code"){return--pending||done()}return highlight(token.text,token.lang,function(err,code){if(err)return done(err);if(code==null||code===token.text){return--pending||done()}token.text=code;token.escaped=true;--pending||done()})})(tokens[i])}return}try{if(opt)opt=merge({},marked.defaults,opt);return Parser.parse(Lexer.lex(src,opt),opt)}catch(e){e.message+="\nPlease report this to https://github.com/chjj/marked.";if((opt||marked.defaults).silent){return"<p>An error occured:</p><pre>"+escape(e.message+"",true)+"</pre>"}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}())}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],55:[function(_dereq_,module,exports){(function(global,factory){if(typeof exports==="object"&&exports){factory(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],factory)}else{factory(global.Mustache={})}})(this,function(mustache){var Object_toString=Object.prototype.toString;var isArray=Array.isArray||function(object){return Object_toString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var RegExp_test=RegExp.prototype.test;function testRegExp(re,string){return RegExp_test.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escapeHtml(string){return String(string).replace(/[&<>"'\/]/g,function(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;
function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tags){if(typeof tags==="string")tags=tags.split(spaceRe,2);if(!isArray(tags)||tags.length!==2)throw new Error("Invalid tags: "+tags);openingTagRe=new RegExp(escapeRegExp(tags[0])+"\\s*");closingTagRe=new RegExp("\\s*"+escapeRegExp(tags[1]));closingCurlyRe=new RegExp("\\s*"+escapeRegExp("}"+tags[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i<valueLength;++i){chr=value.charAt(i);if(isWhitespace(chr)){spaces.push(tokens.length)}else{nonSpace=true}tokens.push(["text",chr,start,start+1]);start+=1;if(chr==="\n")stripSpace()}}if(!scanner.scan(openingTagRe))break;hasTag=true;type=scanner.scan(tagRe)||"name";scanner.scan(whiteRe);if(type==="="){value=scanner.scanUntil(equalsRe);scanner.scan(equalsRe);scanner.scanUntil(closingTagRe)}else if(type==="{"){value=scanner.scanUntil(closingCurlyRe);scanner.scan(curlyRe);scanner.scanUntil(closingTagRe);type="&"}else{value=scanner.scanUntil(closingTagRe)}if(!scanner.scan(closingTagRe))throw new Error("Unclosed tag at "+scanner.pos);token=[type,value,start,scanner.pos];tokens.push(token);if(type==="#"||type==="^"){sections.push(token)}else if(type==="/"){openSection=sections.pop();if(!openSection)throw new Error('Unopened section "'+value+'" at '+start);if(openSection[1]!==value)throw new Error('Unclosed section "'+openSection[1]+'" at '+start)}else if(type==="name"||type==="{"||type==="&"){nonSpace=true}else if(type==="="){compileTags(value)}}openSection=sections.pop();if(openSection)throw new Error('Unclosed section "'+openSection[1]+'" at '+scanner.pos);return nestTokens(squashTokens(tokens))}function squashTokens(tokens){var squashedTokens=[];var token,lastToken;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];if(token){if(token[0]==="text"&&lastToken&&lastToken[0]==="text"){lastToken[1]+=token[1];lastToken[3]=token[3]}else{squashedTokens.push(token);lastToken=token}}}return squashedTokens}function nestTokens(tokens){var nestedTokens=[];var collector=nestedTokens;var sections=[];var token,section;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];switch(token[0]){case"#":case"^":collector.push(token);sections.push(token);collector=token[4]=[];break;case"/":section=sections.pop();section[5]=token[2];collector=sections.length>0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function(){return this.tail===""};Scanner.prototype.scan=function(re){var match=this.tail.match(re);if(!match||match.index!==0)return"";var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view==null?{}:view;this.cache={".":this.view};this.parent=parentContext}Context.prototype.push=function(view){return new Context(view,this)};Context.prototype.lookup=function(name){var cache=this.cache;var value;if(name in cache){value=cache[name]}else{var context=this,names,index;while(context){if(name.indexOf(".")>0){value=context.view;names=name.split(".");index=0;while(value!=null&&index<names.length)value=value[names[index++]]}else if(typeof context.view=="object"){value=context.view[name]}if(value!=null)break;context=context.parent}cache[name]=value}if(isFunction(value))value=value.call(this.view);return value};function Writer(){this.cache={}}Writer.prototype.clearCache=function(){this.cache={}};Writer.prototype.parse=function(template,tags){var cache=this.cache;var tokens=cache[template];if(tokens==null)tokens=cache[template]=parseTemplate(template,tags);return tokens};Writer.prototype.render=function(template,view,partials){var tokens=this.parse(template);var context=view instanceof Context?view:new Context(view);return this.renderTokens(tokens,context,partials,template)};Writer.prototype.renderTokens=function(tokens,context,partials,originalTemplate){var buffer="";var token,symbol,value;for(var i=0,numTokens=tokens.length;i<numTokens;++i){value=undefined;token=tokens[i];symbol=token[0];if(symbol==="#")value=this._renderSection(token,context,partials,originalTemplate);else if(symbol==="^")value=this._renderInverted(token,context,partials,originalTemplate);else if(symbol===">")value=this._renderPartial(token,context,partials,originalTemplate);else if(symbol==="&")value=this._unescapedValue(token,context);else if(symbol==="name")value=this._escapedValue(token,context);else if(symbol==="text")value=this._rawValue(token);if(value!==undefined)buffer+=value}return buffer};Writer.prototype._renderSection=function(token,context,partials,originalTemplate){var self=this;var buffer="";var value=context.lookup(token[1]);function subRender(template){return self.render(template,context,partials)}if(!value)return;if(isArray(value)){for(var j=0,valueLength=value.length;j<valueLength;++j){buffer+=this.renderTokens(token[4],context.push(value[j]),partials,originalTemplate)}}else if(typeof value==="object"||typeof value==="string"){buffer+=this.renderTokens(token[4],context.push(value),partials,originalTemplate)}else if(isFunction(value)){if(typeof originalTemplate!=="string")throw new Error("Cannot use higher-order sections without the original template");value=value.call(context.view,originalTemplate.slice(token[3],token[5]),subRender);if(value!=null)buffer+=value}else{buffer+=this.renderTokens(token[4],context,partials,originalTemplate)}return buffer};Writer.prototype._renderInverted=function(token,context,partials,originalTemplate){var value=context.lookup(token[1]);if(!value||isArray(value)&&value.length===0)return this.renderTokens(token[4],context,partials,originalTemplate)};Writer.prototype._renderPartial=function(token,context,partials){if(!partials)return;var value=isFunction(partials)?partials(token[1]):partials[token[1]];if(value!=null)return this.renderTokens(this.parse(value),context,partials,value)};Writer.prototype._unescapedValue=function(token,context){var value=context.lookup(token[1]);if(value!=null)return value};Writer.prototype._escapedValue=function(token,context){var value=context.lookup(token[1]);if(value!=null)return mustache.escape(value)};Writer.prototype._rawValue=function(token){return token[1]};mustache.name="mustache.js";mustache.version="1.1.0";mustache.tags=["{{","}}"];var defaultWriter=new Writer;mustache.clearCache=function(){return defaultWriter.clearCache()};mustache.parse=function(template,tags){return defaultWriter.parse(template,tags)};mustache.render=function(template,view,partials){return defaultWriter.render(template,view,partials)};mustache.to_html=function(template,view,partials,send){var result=mustache.render(template,view,partials);if(isFunction(send)){send(result)}else{return result}};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context;mustache.Writer=Writer})},{}]},{},[40])(40)});
//# sourceMappingURL=fs-check.min.js.map