read-gedcom
Version:
Gedcom file reader
2 lines • 50.5 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Gedcom",[],t):"object"==typeof exports?exports.Gedcom=t():e.Gedcom=t()}(self,(function(){return function(){"use strict";var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{ErrorDuplicatePointer:function(){return m},ErrorEmptyTree:function(){return p},ErrorGedcomBase:function(){return i},ErrorIndexing:function(){return A},ErrorInvalidConcatenation:function(){return h},ErrorInvalidFileType:function(){return l},ErrorInvalidNesting:function(){return d},ErrorInvalidRecordDefinition:function(){return g},ErrorParse:function(){return s},ErrorTokenization:function(){return u},ErrorTreeStructure:function(){return f},ErrorTreeSyntax:function(){return c},ErrorUnsupportedCharset:function(){return a},GedcomReadingPhase:function(){return $t},SelectionAddress:function(){return ee},SelectionAge:function(){return gt},SelectionAny:function(){return J},SelectionAssociation:function(){return yt},SelectionChanged:function(){return je},SelectionChildFamilyLink:function(){return Nt},SelectionCitationData:function(){return ze},SelectionCitationEvent:function(){return $e},SelectionCoordinates:function(){return ut},SelectionCorporation:function(){return ne},SelectionDataSource:function(){return Me},SelectionDate:function(){return ye},SelectionDateExact:function(){return xe},SelectionDatePeriod:function(){return Ft},SelectionDatePunctual:function(){return Vt},SelectionEvent:function(){return dt},SelectionEventsRecorded:function(){return Ot},SelectionFamilyEvent:function(){return pt},SelectionFamilyRecord:function(){return mt},SelectionFamilyReference:function(){return Et},SelectionFamilyReferenceAdoption:function(){return Rt},SelectionGedcom:function(){return jt},SelectionGedcomFile:function(){return q},SelectionGedcomForm:function(){return Z},SelectionGedcomSource:function(){return Pe},SelectionGedcomVersion:function(){return Q},SelectionHeader:function(){return Ue},SelectionIndividualAttribute:function(){return vt},SelectionIndividualEvent:function(){return St},SelectionIndividualEventFamily:function(){return Ct},SelectionIndividualEventFamilyAdoption:function(){return bt},SelectionIndividualRecord:function(){return Mt},SelectionIndividualReference:function(){return At},SelectionLatitude:function(){return ot},SelectionLongitude:function(){return at},SelectionMetaEvent:function(){return ke},SelectionMultimediaFile:function(){return Dt},SelectionMultimediaFormat:function(){return Pt},SelectionMultimediaRecord:function(){return It},SelectionMultimediaReference:function(){return He},SelectionName:function(){return et},SelectionNamePhonetization:function(){return Ze},SelectionNamePieces:function(){return Qe},SelectionNameRomanization:function(){return qe},SelectionNoteRecord:function(){return xt},SelectionNoteReferenceMixed:function(){return Le},SelectionPhonetization:function(){return nt},SelectionPlace:function(){return ct},SelectionRecord:function(){return Ge},SelectionReference:function(){return Fe},SelectionReferenceNumber:function(){return Be},SelectionRepositoryRecord:function(){return Bt},SelectionRepositoryReference:function(){return wt},SelectionRomanization:function(){return rt},SelectionSourceCitation:function(){return _e},SelectionSourceData:function(){return Lt},SelectionSourceRecord:function(){return Ut},SelectionSpouseEventDetails:function(){return ft},SelectionSpouseFamilyLink:function(){return Tt},SelectionSubmitterRecord:function(){return We},SelectionSubmitterReference:function(){return Oe},SelectionTime:function(){return Ie},SelectionWithAddressMixin:function(){return te},SelectionWithMultimediaMixin:function(){return Ve},SelectionWithNoteMixin:function(){return we},SelectionWithNoteSourceCitationMixin:function(){return Je},SelectionWithSourceCitationMixin:function(){return Ye},Tag:function(){return zt},TagNonStandard:function(){return _t},ValueAdoption:function(){return Yt},ValueCertainty:function(){return Jt},ValueCharacterEncoding:function(){return Kt},ValueEvent:function(){return Xt},ValueGedcomForm:function(){return Qt},ValueLanguage:function(){return Zt},ValueMediaType:function(){return qt},ValueMultimediaFormat:function(){return en},ValueNameType:function(){return tn},ValuePedigreeLinkageType:function(){return nn},ValuePhonetizationMethod:function(){return rn},ValueRole:function(){return sn},ValueRomanizationMethod:function(){return ln},ValueSex:function(){return on},ValueSourceCertainty:function(){return an},indexTree:function(){return B},nodeToString:function(){return n},parseAge:function(){return ht},parseDate:function(){return Ne},parseExactDate:function(){return Te},parseExactTime:function(){return De},parseGedcom:function(){return V},parseLatitude:function(){return st},parseLongitude:function(){return lt},parseNameParts:function(){return Xe},parsePlaceParts:function(){return tt},parseVersionParts:function(){return X},readGedcom:function(){return Gt},selectGedcom:function(){return Ht},toJsDate:function(){return Wt},toJsDateTime:function(){return kt}});const n=e=>{const t=[],n=(e,r)=>{const i=[e.tag,e.pointer,e.value?e.value.replace(/\n/g,"\\n").replace(/\r/g,"\\r"):e.value],s=r+i.filter((e=>e)).join(" ");t.push(s),e.children.map((t=>n(t,-1!==e.indexSource?r+" ":"")))};return n(e,""),t.join("\n")},r=(e,t)=>{const n=t.prototype;Object.setPrototypeOf?Object.setPrototypeOf(e,n):(void 0).__proto__=n};class i extends Error{constructor(e){super(e),r(this,new.target)}}class s extends i{constructor(e){super(e),this.message=e,r(this,new.target)}}class l extends s{}class o extends s{constructor(e,t){super(e),this.illegalCode=t,r(this,new.target)}}class a extends s{constructor(e,t){super(e),this.charset=t,r(this,new.target)}}class u extends s{constructor(e,t,n){super(e),this.lineNumber=t,this.line=n,r(this,new.target)}}class c extends s{constructor(e,t){super(e),this.lineNumber=t,r(this,new.target)}}class d extends c{constructor(e,t,n,i){super(e,t),this.lineNumber=t,this.currentLevel=n,this.level=i,r(this,new.target)}}class h extends c{constructor(e,t,n){super(e,t),this.lineNumber=t,this.kind=n,r(this,new.target)}}class g extends c{constructor(e,t){super(e,t),r(this,new.target)}}class f extends s{constructor(e){super(e),r(this,new.target)}}class p extends f{constructor(e){super(e),r(this,new.target)}}class A extends s{constructor(e){super(e),r(this,new.target)}}class m extends A{constructor(e,t,n,i){super(e),this.lineNumber=t,this.lineNumberOriginalDefinition=n,this.pointer=i,r(this,new.target)}}const S="@#(?:[A-Za-z0-9][A-Za-z0-9 ]*)@",E="(?:[^\\x00-\\x08\\x0A-\\x1F\\r\\n@]|@)*",C="@[A-Za-z0-9-_]+@",R=`([1-9][0-9]+|[0-9])(?: (${C}))? ([A-Za-z0-9]+|_[A-Za-z0-9_]+)(?: (${C}|(?:${S}|${E}|${S}[ ]${E})))?(\\r\\n?|\\n|$)`;class b{constructor(e,t){this.input=e,this.strict=t,this.rGedcomLines=new RegExp(`^${R}`,"gym"),this.linesRead=0,this.charactersRead=0}[Symbol.iterator](){return this}next(){const e=this.rGedcomLines.exec(this.input);if(null===e||0===e[5].length&&this.charactersRead+e[0].length!==this.input.length){null!==e&&(this.charactersRead+=e[0].length);const t=this.charactersRead===this.input.length;if(this.strict&&!t){const e=256,t=this.input.substring(this.charactersRead,Math.min(this.charactersRead+e,this.input.length)).split(/[\r\n]+/,1)[0];throw new u(`Invalid format for line ${this.linesRead+1}: "${t}"`,this.linesRead+1,t)}return{done:!0,value:null}}return this.charactersRead+=e[0].length,this.linesRead++,{done:!1,value:e}}}const v=(e,t=!0)=>new b(e,t),N=(e,t=!1,n=null)=>{n&&n(0);let r=0,i=0,s=-1;const l=[{tag:null,pointer:null,value:null,indexSource:-1,indexRelative:0,children:[]}];for(const o of e){const[e,a,u,c,f]=o,p=f?f.replace(/@@/g,"@"):f;i+=e.length;const A=parseInt(a),m=A<=s,S=A===s+1;if(A<0||!m&&!S)throw new d(`Illegal nesting level at line ${r+1} (current is ${s}, got ${A})`,r+1,s,A);const E=s-A+1;for(let e=0;e<E;e++)l.pop();const C=l[l.length-1],R=C.children;if("CONC"!==c||t)if("CONT"!==c||t){const e={tag:c,pointer:null!=u?u:null,value:null!=p?p:null,indexSource:r,indexRelative:C.children.length,children:[]};if(R.push(e),u&&A>0)throw new g(`Record must be a top-level definition at line ${r+1}`,r+1);l.push(e),s=A}else{if(u)throw new h(`Illegal continuation format at line ${r+1}`,r+1,"CONT");if(!C)throw new h(`Continuation with no parent at line ${r+1}`,r+1,"CONT");const e="\n";null==C.value&&(C.value=""),C.value+=e+(null!=p?p:""),s=A-1}else{if(u)throw new h(`Illegal concatenation format at line ${r+1}`,r+1,"CONC");if(!C)throw new h(`Concatenation with no parent at line ${r+1}`,r+1,"CONC");null==C.value&&(C.value=""),C.value+=null!=p?p:"",s=A-1}r++,n&&r%5e4==0&&n(i)}return n&&n(i),l[0]},T=2e5,y=[239,187,191],M=[254,255],P=M.slice().reverse(),D=[0,0,254,255],I=D.slice().reverse(),x="utf-8",F="utf-16be",O="utf-16le",L=(e,t,n)=>{n&&n(0);let r="";const i=new Uint8Array(e);for(let e=0;e<i.length;e+=2){const s=i[e],l=i[e+1],o=t?16*s+l:16*l+s;r+=String.fromCharCode(o),n&&(e+1)/2%T==0&&n(e)}return r},w=(e,t)=>{t&&t(0);const n=new Uint8Array(e),r=e=>{if(n.length<e.length)return!1;for(let t=0;t<e.length;t++)if(n[t]!==e[t])return!1;return!0},i=[[x,y],[F,M],[O,P]].map((([e,t])=>({charset:e,bom:t}))).find((({bom:e})=>r(e)));if([D,I].some((e=>r(e))))throw new a("Unsupported charset detected from BOM: 'utf-32'","utf-32");const s=void 0!==i?i.charset:null,l=void 0!==i?n.slice(i.bom.length):n,o=null!==s?s:x;let u;if(o===x)u=((e,t)=>{let n="";const r=new Uint8Array(e);let i=0;for(let e,t=r.length;i<t;i++)e=r[i],n+=String.fromCharCode(e>251&&e<254&&i+5<t?1073741824*(e-252)+(r[++i]-128<<24)+(r[++i]-128<<18)+(r[++i]-128<<12)+(r[++i]-128<<6)+r[++i]-128:e>247&&e<252&&i+4<t?(e-248<<24)+(r[++i]-128<<18)+(r[++i]-128<<12)+(r[++i]-128<<6)+r[++i]-128:e>239&&e<248&&i+3<t?(e-240<<18)+(r[++i]-128<<12)+(r[++i]-128<<6)+r[++i]-128:e>223&&e<240&&i+2<t?(e-224<<12)+(r[++i]-128<<6)+r[++i]-128:e>191&&e<224&&i+1<t?(e-192<<6)+r[++i]-128:e);return n})(l);else if(o===F)u=((e,t)=>L(e,!0,void 0))(l);else{if(o!==O)throw new Error;u=((e,t)=>L(e,!1,void 0))(l)}return t&&t(n.length),{output:u,bomCharset:s}};var U;!function(e){e.Utf8="UTF-8",e.Ansel="ANSEL",e.Cp1252="Cp1252",e.Macintosh="Macintosh",e.Cp850="Cp850",e.Utf16be="UTF-16be",e.Utf16le="UTF-16le"}(U||(U={}));const B=(e,t=!1,n=!1,r=null)=>{r&&r();let i=0;const s=[[e,0]];for(;s.length>0;){const[e,t]=s[s.length-1];if(t<e.children.length)s.push([e.children[t],0]);else{const[e,t]=s.pop();s.length>0&&s[s.length-1][1]++,j(e,!n),0===s.length&&G(e)}i++,r&&i%5e4==0&&r()}t||H(e,r),r&&r()},j=(e,t)=>{const n={};e.children.forEach(((e,t)=>{null!==e.tag&&(void 0===n[e.tag]&&(n[e.tag]=[]),n[e.tag].push(t))})),Object.defineProperty(e,"_index",{enumerable:t,configurable:!0,writable:!0}),e._index={byTag:n}},G=e=>{const t={};e.children.forEach(((n,r)=>{if(null!==n.tag&&null!==n.pointer){if(void 0===t[n.tag]&&(t[n.tag]={}),void 0!==t[n.tag][n.pointer])throw new m(`Duplicate pointer: ${n.pointer}`,n.indexSource+1,e.children[t[n.tag][n.pointer]].indexSource,n.pointer);t[n.tag][n.pointer]=r}})),e._index.byTagPointer=t},H=(e,t=null)=>{const n=(e,t,n)=>{const r=e[t];return null!=r?r:n},r=e._index,i=n(r.byTagPointer,"FAM",{}),s={},l={};Object.values(i).forEach(((r,i)=>{const o=e.children[r],a=o._index;for(const e of["HUSB","WIFE"])for(const t of n(a.byTag,e,[])){const e=o.children[t].value;null!==e&&(void 0!==s[e]?s[e].push(r):s[e]=[r])}for(const e of n(a.byTag,"CHIL",[])){const t=o.children[e].value;null!==t&&(void 0!==l[t]?l[t].push(r):l[t]=[r])}t&&i%5e3==0&&t()})),r.asSpouse=s,r.asChild=l},V=(e,t={})=>{W(e);const n=null==t.forcedCharset?(e=>{const{sourceEncoding:t,sourceProvider:n,sourceProviderVersion:r,fileHasBOM:i}=((e,t=5e3,n=200)=>{const{output:r,bomCharset:i}=w(e.slice(0,t)),s=null!==i,l=v(r,!1);let o=0;const a=[];for(const e of l){if(o>=n)break;a.push(e),o+=1}const u=N(a).children.filter((e=>"HEAD"===e.tag)),c=u.flatMap((e=>e.children.filter((e=>"CHAR"===e.tag||"CHARACTER"===e.tag)))),d=c.length>0?c[0].value:null,h=u.flatMap((e=>e.children.filter((e=>"SOUR"===e.tag)))),g=h.length>0?h[0].value:null,f=h.flatMap((e=>e.children.filter((e=>"VERS"===e.tag))));return{sourceEncoding:d,sourceProvider:g,sourceProviderVersion:f.length>0?f[0].value:null,fileHasBOM:s}})(e);function s(){return"UTF-8"===t?"UTF-8":"ANSEL"===t?"ANSEL":"ASCII"===t||"ANSI"===t?"Cp1252":"UNICODE"===t?"UTF-16be":"WINDOWS"===t||"IBM WINDOWS"===t?"Cp1252":"MACINTOSH"===t?"Macintosh":"IBMPC"===t||"MSDOS"===t?"Cp850":"UNIX"===t?"Cp1252":"UTF8"===t?"UTF-8":"windows-1250"===t?"Cp1252":"UTF-8"}return i?"UTF-8":"GeneWeb"===n?"ASCII"===t?"Cp1252":"UTF-8"===t?"UTF-8":s():null!=n&&n.startsWith("HEREDIS")?"ANSI"===t?"Cp1252":s():"GENEATIQUE"===n?"ANSEL"===t?"ANSEL":s():"Gramps"===n&&"UTF-8"===t?"UTF-8":s()})(e):t.forcedCharset,r=t.progressCallback,i=e.byteLength,s=r?e=>r(0,e/i):void 0;let l;if("UTF-8"===n||"UTF-16be"===n||"UTF-16le"===n)l=((e,t)=>{const{output:n}=w(e,t);return n})(e,s);else if("Cp1252"===n)l=((e,t)=>{t&&t(0);const n=new Uint8Array(e);let r="",i=0;for(;i<n.length;i++)r+="\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ".charAt(n[i]),t&&i%T==0&&t(i);return t&&t(i),r})(e,s);else if("ANSEL"===n)l=((e,t,n)=>{t&&t(0);const r=(e,t,n)=>{const r=new Map;for(let i=0;i<e.length;i++)r.set(parseInt(e.substring(i*t,(i+1)*t),16),n.charCodeAt(i));return r},i=r("8d8ea1a2a3a4a5a6a7a8a9aaabacadaeb0b1b2b3b4b5b6b7b8b9babcbdc0c1c2c3c4c5c6cfe0e1e2e3e4e5e6e7e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfe818889929394c7c8e8bebfcdce",2,"ŁØÐÞÆŒʹ·♭®±ƠƯʾ°łøđþæœʺı£ðơư°ℓ℗©♯¿¡ß̧̨̣̤̥̳̲̦̜̮̉̀́̂̃̄̆̇̌̊︠︡̋̐︢︣̓̕ü'“”߀̈▯▮eo"),s=r("e020e041e045e049e04fe055e059e061e065e069e06fe075e079e120e141e145e149e14fe155e157e159e161e165e169e16fe175e177e179e220e241e243e245e247e249e24be24ce24de24ee24fe250e252e253e255e257e259e25ae261e263e265e267e269e26be26ce26de26ee26fe270e272e273e275e277e279e27ae2a5e2b5e320e341e343e345e347e348e349e34ae34fe353e355e357e359e35ae361e363e365e367e368e369e36ae36fe373e375e377e379e37ae420e441e445e449e44ee44fe455e456e459e461e465e469e46ee46fe475e476e479e520e541e545e547e549e54fe555e561e565e567e569e56fe575e5a5e5b5e620e641e645e647e649e64fe655e661e665e667e669e66fe675e720e742e743e744e745e746e747e748e749e74de74ee750e752e753e754e757e758e759e75ae762e763e764e765e766e767e768e76de76ee770e772e773e774e777e778e779e77ae820e841e845e848e849e84fe855e857e858e859e861e865e868e869e86fe874e875e877e878e879e920e941e943e944e945e947e949e94be94ce94ee94fe952e953e954e955e95ae961e963e964e965e967e969e96ae96be96ce96ee96fe972e973e974e975e97aea20ea41ea61ea75ea77ea79eaaded20ee20ee4fee55ee6fee75f020f043f044f047f048f04bf04cf04ef052f053f054f063f064f067f068f06bf06cf06ef072f073f074f120f141f145f149f14ff155f161f165f169f16ff175f241f242f244f245f248f249f24bf24cf24df24ef24ff252f253f254f255f256f257f259f25af261f262f264f265f268f269f26bf26cf26df26ef26ff272f273f274f275f276f277f279f27af355f375f441f461f520f948f968fc20fc41fc43fc45fc4bfc4cfc4ffc51fc54fc56fc61fc63fc65fc6bfc6cfc6ffc71fc74fc76d741d742d743d744d745d746d747d748d749d74ad74bd74cd74dd74ed74fd750d751d752d753d754d755d756d757d758d761d762d763d764d765d766d767d768d769d76ad76bd76cd76dd76ed76fd770d771d772d773d774d775d776d777d778d779d824d841d842d843d844d845d846d847d848d849d84bd84cd84dd84ed84fd850d851d852d853d854d855d856d857d858d85ad861d862d863d864d865d866d867d868d869d86bd86cd86dd86ed86fd870d871d872d873d874d875d876d877d878d87ad920d921d922d923d924d925d926d927d928d929d92ad92bd92cd92dd92ed92fd930d931d932d933d941d942d943d944d945d946d947d948d949d94ad94cd94dd94ed94fd950d951d952d953d954d955d956d957d958d959d95ad961d962d963d964d965d966d967d968d969d96ad96bd96cd96dd96ed96fd970d971d972d973d974d975d976d977d979d97ad97bd97c",4,"ˀẢẺỈỎỦỶảẻỉỏủỷˋÀÈÌÒÙẀỲàèìòùẁỳˊÁĆÉǴÍḰĹḾŃÓṔŔŚÚẂÝŹáćéǵíḱĺḿńóṕŕśúẃýźǼǽˆÂĈÊĜĤÎĴÔŜÛŴŶẐâĉêĝĥîĵôŝûŵŷẑ˜ÃẼĨÑÕŨṼỸãẽĩñõũṽỹˉĀĒḠĪŌŪāēḡīōūǢǣ˘ĂĔĞĬŎŬăĕğĭŏŭ˙ḂĊḊĖḞĠḢİṀṄṖṘṠṪẆẊẎŻḃċḋėḟġḣṁṅṗṙṡṫẇẋẏż¨ÄËḦÏÖÜẄẌŸäëḧïöẗüẅẍÿˇǍČĎĚǦǏǨĽŇǑŘŠŤǓŽǎčďěǧǐǰǩľňǒřšťǔž˚ÅåůẘẙŮʼ˝ŐŰőű¸ÇḐĢḨĶĻŅŖŞŢçḑģḩķļņŗşţ˛ĄĘĮǪŲąęįǫųẠḄḌẸḤỊḲḶṂṆỌṚṢṬỤṾẈỴẒạḅḍẹḥịḳḷṃṇọṛṣṭụṿẉỵẓṲṳḀḁ‗Ḫḫ̸ȺȻɆꝂŁØꝘȾꝞⱥȼɇꝃłøꝙⱦꝟ═║╗╝╚╔╣╩╠╦╬╢╧╟╤╡╨╞╥╪░▒▓█─│┐┘└┌┤┴├┬┼╕╛╘╒╖╜╙╓╫▌▀▐▄▪ςΑΒΥΔΕΦΓΨΙΚΛΜΝΟΠΧΡΣΤΩΘΗΞΖαβυδεφγψικλμνοπχρστωθηξζ฿¢¥₧ƒ¤₤₠₡₢₣₥₦₨₩₪€¹²³ªº«»¦¶§⌐†‡™fifl‹›‰…“”‚„•– µ½¼¾∞∅∈∩¬≡×≥≤÷≈⋅⌠⌡√⁄‘’—₭₮₯₫"),l=new Uint8Array(e),a=[];let u=0,c=l[u];for(u++;void 0!==c;){const e=c;if(c=l[u],u++,e<128)a.push(String.fromCharCode(e));else if(void 0!==c&&(e>=224&&e<=255||e>=215&&e<=217)){const t=256*e+c,r=s.get(t);if(void 0!==r)c=l[u],u++,a.push(String.fromCharCode(r));else{if(n)throw new o(`Illegal ANSEL character code: ${t}`,t);c=l[u],u++,a.push("�")}}else{const t=i.get(e),n=String.fromCharCode(void 0!==t?t:65533);a.push(n)}t&&u%T==0&&t(u)}return t&&t(u),a.join("")})(e,s,!!t.doStrictDecoding);else if("Macintosh"===n)l=((e,t)=>{t&&t(0);const n=new Uint8Array(e);let r="",i=0;for(;i<n.length;i++)r+="\0\b\t\n\v\f\r⌘✓◆ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ".charAt(n[i]),t&&i%T==0&&t(0);return t&&t(i),r})(e,s);else{if("Cp850"!==n)throw new a(`Unsupported charset: ${n}`,n);l=((e,t)=>{t&&t(0);const n=new Uint8Array(e);let r="",i=0;for(;i<n.length;i++){const e=n[i];r+=e<128?String.fromCharCode(e):"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²".charAt(e-128),t&&i%T==0&&t(i)}return t&&t(i),r})(e,s)}const u=l.length,c=v(l),d=N(c,!!t.noInlineContinuations,r?e=>r(1,e/u):null);return k(d),t.noIndex||B(d,!!t.noBackwardsReferencesIndex,!!t.doHideIndex,r?()=>r(2,null):null),t.doFreeze&&(r&&r(3,0),$(d),r&&r(3,1)),d},W=e=>{const t="0 HEAD",n=[];for(let e=0;e<t.length;e++)n.push(t.charCodeAt(e));const r=new Uint8Array(e),i=e=>{if(r.byteLength<e.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==r[t])return!1;return!0};if(!i(n)&&!i(y.concat(n))){const e=n.map((e=>[0,e]));if(!i(M.concat(e.flat()))&&!i(P.concat(e.map((e=>e.slice().reverse())).flat()))){const e=n.map((e=>[0,0,0,e]));if(!i(D.concat(e.flat()))&&!i(I.concat(e.map((e=>e.slice().reverse())).flat())))throw new l("Probably not a Gedcom file")}}},k=e=>{const t=e.children,n=t[0];if("HEAD"!==n.tag)throw new f(`First node is not a header (got ${n.tag})`);const r=t[t.length-1];if("TRLR"!==r.tag)throw new f(`Last node is not a trailer (got ${r.tag})`)},$=e=>{let t=[e];for(;t.length>0;){const e=[];t.forEach((t=>{null==t||"object"!=typeof t||Object.isFrozen(t)||(Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>e.push(t[n]))))})),t=e}};var z,_,Y=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};class J{constructor(e,t){z.add(this),this.rootNode=e,this.length=t.length;for(let e=0;e<t.length;e++)this[e]=t[e]}tag(){const e=[];for(let t=0;t<this.length;t++)e.push(this[t].tag);return e}pointer(){const e=[];for(let t=0;t<this.length;t++)e.push(this[t].pointer);return e}value(){const e=[];for(let t=0;t<this.length;t++)e.push(this[t].value);return e}valueNonNull(){return this.value().filter((e=>null!==e))}root(){return new jt(this.rootNode,[this.rootNode])}get(e,t,n){const r=null!=n?n:J,i=null!=e?Array.isArray(e)?e:[e]:null,s=null!=t?Array.isArray(t)?t:[t]:null,l=[];for(let e=0;e<this.length;e++){const t=this[e];if(null===i&&null===s)t.children.forEach((e=>l.push(e)));else if(void 0!==t._index){const e=t._index,n=[],r=null!==i&&i.length>0||null!==s&&s.length>0;if(null!==s){const r=e;void 0!==r.byTagPointer&&(null!==i?i.forEach((e=>s.forEach((i=>{const s=r.byTagPointer[e][i];void 0!==s&&n.push(t.children[s])})))):Object.values(r.byTagPointer).forEach((e=>s.forEach((r=>{const i=e[r];void 0!==i&&n.push(t.children[i])})))))}else i.forEach((r=>{const i=e.byTag[r];void 0!==i&&i.forEach((e=>n.push(t.children[e])))}));r&&n.sort(((e,t)=>e.indexSource-t.indexSource)),n.forEach((e=>l.push(e)))}else t.children.filter((e=>(null===i||null!==e.tag&&i.includes(e.tag))&&(null===s||null!==e.pointer&&s.includes(e.pointer)))).forEach((e=>l.push(e)))}return new r(this.rootNode,l)}filter(e){const t=[];for(let n=0;n<this.length;n++){const r=this[n];e(r)&&t.push(r)}return new(Y(this,z,"m",_).call(this))(this.rootNode,t)}filterSelect(e){const t=Y(this,z,"m",_).call(this),n=[];for(let r=0;r<this.length;r++){const i=this[r];e(new t(this.rootNode,[i]))&&n.push(i)}return new t(this.rootNode,n)}as(e){return new e(this.rootNode,this)}array(){const e=[];for(let t=0;t<this.length;t++)e.push(this[t]);return e}arraySelect(){const e=Y(this,z,"m",_).call(this),t=[];for(let n=0;n<this.length;n++)t.push(new e(this.rootNode,[this[n]]));return t}concatenate(e){const t=Y(this,z,"m",_).call(this),n=[];for(let e=0;e<this.length;e++)n.push(this[e]);for(let t=0;t<e.length;t++)n.push(e[t]);return new t(this.rootNode,n)}concatenateLeft(e){const t=Y(this,z,"m",_).call(this),n=[];for(let t=0;t<e.length;t++)n.push(e[t]);for(let e=0;e<this.length;e++)n.push(this[e]);return new t(this.rootNode,n)}sorted(e=((e,t)=>e.indexSource-t.indexSource)){const t=Y(this,z,"m",_).call(this),n=[];for(let e=0;e<this.length;e++)n.push(this[e]);return n.sort(e),new t(this.rootNode,n)}equals(e){if(this.length!==e.length)return!1;for(let t=0;t<this.length;t++)if(this[t]!==e[t])return!1;return!0}toString(){return this.length>0?this.array().map(n).join("\n\n"):"(empty selection)"}static of(e,t,n){const r=null!=n?n:J,i=Array.isArray(t)?t:[t];return new r(e.rootNode,i)}}z=new WeakSet,_=function(){return void 0!==Object.getPrototypeOf?Object.getPrototypeOf(this).constructor:this.__proto__.constructor},function(e,t,n,r){var i,s=arguments.length,l=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(l=(s<3?i(l):s>3?i(t,n,l):i(t,n))||l);s>3&&l&&Object.defineProperty(t,n,l)}([(!1,(e,t,n)=>{if(n)n.enumerable=false;else{const n=Symbol(t);Object.defineProperty(e,t,{configurable:!0,enumerable:false,get(){return this[n]},set(e){this[n]=e}})}}),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:type",Object)],J.prototype,"rootNode",void 0);const K=/^(0|[1-9][0-9]{0,2})\.(0|[1-9][0-9]{0,2})(?:\.(0|[1-9][0-9]{0,2}))?$/,X=e=>{if(!e)return null;const t=K.exec(e);if(!t)return null;const n=[];for(let e=0;e<3&&t[e+1];e++)n.push(parseInt(t[e+1]));return n};class Q extends J{valueAsVersion(){return this.value().map(X)}}class Z extends J{getVersion(){return this.get("VERS")}getName(){return this.get("NAME")}}class q extends J{getVersion(){return this.get("VERS",null,Q)}getGedcomForm(){return this.get("FORM",null,Z)}}class ee extends J{getAddressLine1(){return this.get("ADR1")}getAddressLine2(){return this.get("ADR2")}getAddressLine3(){return this.get("ADR3")}getCity(){return this.get("CITY")}getState(){return this.get("STAE")}getPostalCode(){return this.get("POST")}getCountry(){return this.get("CTRY")}}const te=e=>class extends e{getAddress(){return this.get("ADDR",null,ee)}getPhoneNumber(){return this.get("PHON")}getEmailAddress(){return this.get("EMAIL")}getFaxAddress(){return this.get("FAX")}getWebAddress(){return this.get("WWW")}};class ne extends(te(J)){}const re="DGREGORIAN",ie=(e,t=!1)=>{const n=e.map(((e,t)=>[e,t+1])),r=t?n.concat(n.map((([e,t])=>{return[(n=e,n?n[0].toUpperCase()+n.substring(1).toLowerCase():n),t];var n}))):n;return Object.fromEntries(r)},se=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],le=["VEND","BRUM","FRIM","NIVO","PLUV","VENT","GERM","FLOR","PRAI","MESS","THER","FRUC","COMP"],oe=["TSH","CSH","KSL","TVT","SHV","ADR","ADS","NSN","IYR","SVN","TMZ","AAV","ELL"],ae=ie(se,!0),ue=ie(le),ce=ie(oe),de=ie(["BCE","BC","B.C."]),he=/^@#(.*)@$/,ge=/^\((.*)\)$/,fe=/\((.*)\)$/,pe="([1-9][0-9]*|0|00[1-9]|0[1-9][0-9])",Ae=new RegExp(`^${pe}$`),me=new RegExp(`^${pe}/([0-9]{2})$`),Se=/^(?:0?[1-9]|[1-2][0-9]|3[0-1])$/,Ee=(e,t,n)=>{if(null!=t){if(t<1||t>se.length)return!1;if(null!=n){const r=((e,t)=>2===e?28+(t?1:0):30+([4,6,9,11].includes(e)?0:1))(t,e);if(n<1||n>r)return!1}}return!0},Ce=(e,t,n)=>Ee(e%4==0&&e%100!=0||e%400==0,t,n),Re=(e,t,n)=>Ee(e%4==0,t,n),be=(e,t,n)=>{if(!(e>=1&&e<=14))return!1;if(null!=t){if(t<1||t>le.length)return!1;if(null!=n){const r=e%4==3,i=13!==t?30:5+(r?1:0);if(n<1||n>i)return!1}}return!0},ve=(e,t,n)=>{if(e<1)return!1;if(null!=t){if(t<1||t>oe.length)return!1;if(null!=n){const e=29+([1,5,6,8,10,12].includes(t)?1:0)+(2===t||3===t?1:0);if(n<1||n>e)return!1}}return!0},Ne=e=>{if(!e)return null;e=e.trim();const t={hasDate:!0,hasPhrase:!1,isDatePunctual:!1,isDatePeriod:!1,isDateRange:!1,isDateApproximated:!1,isDateInterpreted:!1};let n;if(null!==(n=ge.exec(e))){const e=n[1];return Object.assign(Object.assign({},t),{hasDate:!1,hasPhrase:!0,phrase:e})}const r=[];let i=0;const s="@#";for(let t=0;t<e.length;t++)if(e.substring(t,t+s.length)===s)for(t+=s.length;t<e.length&&"@"!==e[t];)t++;else" "===e[t]&&(r.push(e.substring(i,t)),i=t+1);r.push(e.substring(i,e.length));let l=0;const o=(e,t,n)=>{const r={isBce:!1,isDual:!1};let i;if(l<e.length&&null!==Ae.exec(e[l])){const n=parseInt(e[l]);if(l++,t){let t=!1;return l<e.length&&void 0!==de[e[l]]&&(t=!0,l++),Object.assign(Object.assign({},r),{value:n,isBce:t})}return Object.assign(Object.assign({},r),{value:n})}if(n&&l<e.length&&null!==(i=me.exec(e[l]))){const e=parseInt(i[1]),t=parseInt(i[2]);return l++,Object.assign(Object.assign({},r),{value:e,isDual:!0,valueDual:t})}return null},a=e=>{var t;if(l<e.length){let n,r=re;null!==(n=he.exec(e[l]))&&(r=null!==(t=n[1])&&void 0!==t?t:n[2],l++);const i=r===re,s="DJULIAN"===r,a="DHEBREW"===r,u="DFRENCH R"===r,c=i||s,d={isGregorian:i,isJulian:s,isHebrew:a,isFrenchRepublican:u,isUnknown:"DUNKNOWN"===r};let h,g;if(i||s)h=ae;else if(a)h=ce;else{if(!u)return null;h=ue}if(l<e.length&&void 0!==(g=h[e[l]])){l++;const t=o(e,!1,c);return null!==t?i&&!Ce(t.value,g)||s&&!Re(t.value,g)||u&&!be(t.value,g)||a&&!ve(t.value,g)?null:{calendar:d,month:g,year:t}:null}{const t=l,n=o(e,c,!1);if(null!==n&&n.isBce)return{calendar:d,year:n};l=t;const r=l<e.length&&null!==Se.exec(e[l])?parseInt(e[l]):null;let g=null;if(null!==r&&l+1<e.length){const t=h[e[l+1]];void 0!==t&&(g=t)}if(null!==r&&null!==g){l+=2;const t=o(e,!1,c);return null!==t?i&&!Ce(t.value,g,r)||s&&!Re(t.value,g,r)||u&&!be(t.value,g,r)||a&&!ve(t.value,g,r)?null:{calendar:d,day:r,month:g,year:t}:null}return null!==n?(l++,u&&!be(n.value)||a&&!ve(n.value)?null:{calendar:d,year:n}):null}}return null};if(l++,0===r.length)return null;if("FROM"===r[0]){const e=a(r);if(null!==e){if(l===r.length)return Object.assign(Object.assign({},t),{isDatePeriod:!0,dateFrom:e});if(l<r.length&&"TO"===r[l]){l++;const n=a(r);if(null!==n&&l===r.length)return Object.assign(Object.assign({},t),{isDatePeriod:!0,dateFrom:e,dateTo:n})}}}else if("TO"===r[0]){const e=a(r);if(null!==e&&l===r.length)return Object.assign(Object.assign({},t),{isDatePeriod:!0,dateTo:e})}else if("BEF"===r[0]){const e=a(r);if(null!==e&&l===r.length)return Object.assign(Object.assign({},t),{isDateRange:!0,dateBefore:e})}else if("AFT"===r[0]){const e=a(r);if(null!==e&&l===r.length)return Object.assign(Object.assign({},t),{isDateRange:!0,dateAfter:e})}else if("BET"===r[0]){const e=a(r);if(null!==e&&"AND"===r[l]){l++;const n=a(r);if(null!==n&&l===r.length)return Object.assign(Object.assign({},t),{isDateRange:!0,dateAfter:e,dateBefore:n})}}else if("ABT"===r[0]||"CAL"===r[0]||"EST"===r[0]){const e=a(r);if(null!==e&&l===r.length)return Object.assign(Object.assign({},t),{isDatePunctual:!0,isDateApproximated:!0,approximationKind:{isAbout:"ABT"===r[0],isCalculated:"CAL"===r[0],isEstimated:"EST"===r[0]},date:e})}else if("INT"===r[0]){const n=a(r);if(null!==n){const r=fe.exec(e);if(null!==r){const e=r[1];return Object.assign(Object.assign({},t),{hasPhrase:!0,isDatePunctual:!0,isDateInterpreted:!0,date:n,phrase:e})}}}else{l--;const e=a(r);if(null!==e&&l===r.length)return Object.assign(Object.assign({},t),{isDatePunctual:!0,date:e})}return null},Te=e=>{if(!e)return null;const t=(e=e.trim()).split(" ");if(3!==t.length)return null;const n=ae[t[1]];return null!==Se.exec(t[0])&&void 0!==n&&null!==Ae.exec(t[2])?{day:parseInt(t[0]),month:n,year:parseInt(t[2])}:null};class ye extends J{valueAsDate(){return this.value().map(Ne)}}class Me extends J{getDate(){return this.get("DATE",null,ye)}getCopyright(){return this.get("COPR")}}class Pe extends J{getVersion(){return this.get("VERS")}getName(){return this.get("NAME")}getCorporation(){return this.get("CORP",null,ne)}getDataSource(){return this.get("DATA",null,Me)}}const De=e=>{if(!e)return null;const t=/^(0?[0-9]|1[0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]{2}))?)?$/.exec(e);if(!t)return null;const n={hours:parseInt(t[1]),minutes:parseInt(t[2])};if(void 0!==t[3]){const e=parseInt(t[3]),r=Object.assign(Object.assign({},n),{seconds:e});if(void 0!==t[4]){const e=parseInt(t[4]);return Object.assign(Object.assign({},r),{centiseconds:e})}return r}return n};class Ie extends J{valueAsExactTime(){return this.value().map(De)}}class xe extends J{valueAsExactDate(){return this.value().map(Te)}getExactTime(){return this.get("TIME",null,Ie)}}class Fe extends J{}class Oe extends Fe{getSubmitterRecord(){return this.root().getSubmitterRecord(this.valueNonNull())}}class Le extends J{getNoteRecord(){return this.root().getNoteRecord(this.valueNonNull())}}const we=e=>class extends e{getNote(){return this.get("NOTE",null,Le)}};class Ue extends(we(J)){getGedcomFile(){return this.get("GEDC",null,q)}getCharacterEncoding(){return this.get("CHAR")}getSourceSystem(){return this.get("SOUR",null,Pe)}getDestinationSystem(){return this.get("DEST")}getFileCreationDate(){return this.get("DATE",null,xe)}getLanguage(){return this.get("LANG")}getSubmitterReference(){return this.get("SUBM",null,Oe)}getFilename(){return this.get("FILE")}getCopyright(){return this.get("COPR")}}class Be extends J{getType(){return this.get("TYPE")}}class je extends(we(J)){getExactDate(){return this.get("DATE",null,xe)}}class Ge extends J{getReferenceNumber(){return this.get("REFN",null,Be)}getRecordIdentificationNumber(){return this.get("RIN")}getChanged(){return this.get("CHAN",null,je)}}class He extends Fe{getMultimediaRecord(){return this.root().getMultimediaRecord(this.valueNonNull())}}const Ve=e=>class extends e{getMultimedia(){return this.get("OBJE",null,He)}};class We extends(Ve(te(we(Ge)))){getName(){return this.get("NAME")}}class ke extends J{valueAsArray(){return this.value().map((e=>null!==e?e.split(", "):null))}}class $e extends ke{getRole(){return this.get("ROLE")}}class ze extends J{getDate(){return this.get("DATE",null,ye)}getText(){return this.get("TEXT")}}class _e extends(Ve(we(J))){getSourceRecord(){return this.root().getSourceRecord(this.valueNonNull())}getLocationInSource(){return this.get("PAGE")}getEventCitedFrom(){return this.get("EVEN",null,$e)}getData(){return this.get("DATA",null,ze)}getCertainty(){return this.get("QUAY")}}const Ye=e=>class extends e{getSourceCitation(){return this.get("SOUR",null,_e)}},Je=e=>Ye(we(e)),Ke=/^(?:([^\/]*)|(?:(?:([^\/]*?) ?)?\/([^\/]*)\/(?: ?([^\/]*))?))$/,Xe=e=>{if(!e)return null;const t=Ke.exec(e);return t?void 0===t[1]?[t[2],t[3],t[4]]:[t[1],void 0,void 0]:null};class Qe extends(Je(J)){getPrefixName(){return this.get("NPFX")}getGivenName(){return this.get("GIVN")}getNickname(){return this.get("NICK")}getPrefixSurname(){return this.get("SPFX")}getSurname(){return this.get("SURN")}getNameSuffix(){return this.get("NSFX")}}class Ze extends Qe{getMethod(){return this.get("TYPE")}}class qe extends Qe{getMethod(){return this.get("TYPE")}}class et extends Qe{valueAsParts(){return this.value().map(Xe)}getType(){return this.get("TYPE")}getNamePhonetization(){return this.get("FONE",null,Ze)}getNameRomanization(){return this.get("FONE",null,qe)}}const tt=e=>null===e?null:e.split(/, ?/);class nt extends J{getMethod(){return this.get("TYPE")}}class rt extends J{getMethod(){return this.get("TYPE")}}const it=(e,t,n)=>{if(!n)return null;const r=e.exec(n);return r?(void 0!==r[1]?t[r[1]]:"-"===r[2]?-1:1)*parseFloat(r[3]):null},st=e=>it(/^(?:([NS])|([+-]?))([0-9]{1,2}(?:\.[0-9]{1,6})?)$/,{N:1,S:-1},e),lt=e=>it(/^(?:([EW])|([+-]?))([0-9]{1,3}(?:\.[0-9]{1,6})?)$/,{E:1,W:-1},e);class ot extends J{valueAsLatitude(){return this.value().map(st)}}class at extends J{valueAsLongitude(){return this.value().map(lt)}}class ut extends J{getLatitude(){return this.get("LATI",null,ot)}getLongitude(){return this.get("LONG",null,at)}}class ct extends(we(J)){valueAsParts(){return this.value().map(tt)}getPhonetization(){return this.get("FONE",null,nt)}getRomanization(){return this.get("ROMN",null,rt)}getCoordinates(){return this.get("MAP",null,ut)}}class dt extends(te(Ve(Je(J)))){valueAsHappened(){return this.value().map((e=>!!e&&("Y"===e||null)))}getType(){return this.get("TYPE")}getDate(){return this.get("DATE",null,ye)}getPlace(){return this.get("PLAC",null,ct)}getResponsibleAgency(){return this.get("AGNC")}getReligiousAffiliation(){return this.get("RELI")}getCause(){return this.get("CAUS")}}const ht=e=>{if(!e)return null;const t="<>".indexOf(e[0]),n=t>=0?e.substring(1):e,r="CHILD"===n,i="INFANT"===n,s="STILLBORN"===n,l={isGreaterThan:1===t,isLessThan:0===t,isChild:r,isInfant:i,isStillborn:s};if(r||i||s)return Object.assign({hasDate:!1},l);{const e=n.split(" ");if(e.length>3)return null;const t=/^(?:0|[1-9][0-9]{0,2})$/,r=/^(?:ymd|y|m|d|ym|yd|md)$/,i=e.map((e=>{if(e.length<2)return null;const n=e[e.length-1];if(!"ymd".includes(n))return null;const r=e.substring(0,e.length-1);if(null!==r.match(t)){const e=parseInt(r);return"d"===n&&e>365||"m"===n&&e>11?null:[n,e]}return null}));if(i.includes(null))return null;const s=i;if(null===s.map((e=>e[0])).join("").match(r))return null;let o=0,a=0,u=0;return s.forEach((([e,t])=>{"y"===e?o=t:"m"===e?a=t:u=t})),Object.assign({hasDate:!0,date:{years:o,months:a,days:u}},l)}};class gt extends J{valueAsAge(){return this.value().map(ht)}}class ft extends J{getAge(){return this.get("AGE",null,gt)}}class pt extends dt{getHusbandDetails(){return this.get("HUSB",null,ft)}getWifeDetails(){return this.get("WIFE",null,ft)}}class At extends Fe{getIndividualRecord(){return this.root().getIndividualRecord(this.valueNonNull())}}class mt extends(Ve(Je(Ge))){getEventAnnulment(){return this.get("ANUL",null,pt)}getEventCensus(){return this.get("CENS",null,pt)}getEventDivorce(){return this.get("DIV",null,pt)}getEventDivorceFiled(){return this.get("DIVF",null,pt)}getEventEngagement(){return this.get("ENGA",null,pt)}getEventMarriageBann(){return this.get("MARB",null,pt)}getEventMarriageContract(){return this.get("MARC",null,pt)}getEventMarriage(){return this.get("MARR",null,pt)}getEventMarriageLicense(){return this.get("MARL",null,pt)}getEventMarriageSettlement(){return this.get("MARS",null,pt)}getEventResidence(){return this.get("RESI",null,pt)}getEventOther(){return this.get("EVEN",null,pt)}getHusband(){return this.get("HUSB",null,At)}getWife(){return this.get("WIFE",null,At)}getChild(){return this.get("CHIL",null,At)}getChildrenCount(){return this.get("NCHI")}}class St extends dt{getAge(){return this.get("AGE",null,gt)}}class Et extends Fe{getFamilyRecord(){return this.root().getFamilyRecord(this.valueNonNull())}}class Ct extends St{getFamilyAsChildReference(){return this.get("FAMC",null,Et)}}class Rt extends Et{getAdoptedByWhom(){return this.get("ADOP")}}class bt extends St{getFamilyAsChildReference(){return this.get("FAMC",null,Rt)}}class vt extends St{getType(){return this.get("TYPE")}}class Nt extends(we(J)){getFamilyRecord(){return this.root().getFamilyRecord(this.valueNonNull())}getPedigreeLinkageType(){return this.get("PEDI")}}class Tt extends(we(J)){getFamilyRecord(){return this.root().getFamilyRecord(this.valueNonNull())}}class yt extends(Je(J)){getRelation(){return this.get("RELA")}}class Mt extends(Ve(Je(Ge))){getName(){return this.get("NAME",null,et)}getSex(){return this.get("SEX")}getFamilyAsChild(){const e=[],t=this.rootNode._index;if(void 0!==t&&void 0!==t.asChild)for(let n=0;n<this.length;n++){const r=this[n];if(null!==r.pointer){const n=t.asChild[r.pointer];void 0!==n&&n.forEach((t=>{e.push(this.rootNode.children[t])}))}}else{const t=this.rootNode.children.filter((e=>"FAM"===e.tag));for(let n=0;n<this.length;n++){const r=this[n];null!==r.pointer&&t.filter((e=>e.children.some((e=>"CHIL"===e.tag&&e.value===r.pointer)))).forEach((t=>e.push(t)))}}return new mt(this.rootNode,e)}getFamilyAsSpouse(){const e=[],t=this.rootNode._index;if(void 0!==t&&void 0!==t.asSpouse)for(let n=0;n<this.length;n++){const r=this[n];if(null!==r.pointer){const n=t.asSpouse[r.pointer];void 0!==n&&n.forEach((t=>{e.push(this.rootNode.children[t])}))}}else{const t=this.rootNode.children.filter((e=>"FAM"===e.tag));for(let n=0;n<this.length;n++){const r=this[n];null!==r.pointer&&t.filter((e=>e.children.some((e=>("HUSB"===e.tag||"WIFE"===e.tag)&&e.value===r.pointer)))).forEach((t=>e.push(t)))}}return new mt(this.rootNode,e)}getEventBirth(){return this.get("BIRT",null,Ct)}getEventChristening(){return this.get("CHR",null,Ct)}getEventDeath(){return this.get("DEAT",null,St)}getEventBurial(){return this.get("BURI",null,St)}getEventCremation(){return this.get("CREM",null,St)}getEventAdoption(){return this.get("ADOP",null,bt)}getEventBaptism(){return this.get("BAPM",null,St)}getEventBarMitzvah(){return this.get("BARM",null,St)}getEventBatMitzvah(){return this.get("BASM",null,St)}getEventAdultChristening(){return this.get("CHRA",null,St)}getEventConfirmation(){return this.get("CONF",null,St)}getEventFirstCommunion(){return this.get("FCOM",null,St)}getEventNaturalization(){return this.get("NATU",null,St)}getEventEmigration(){return this.get("EMIG",null,St)}getEventImmigration(){return this.get("IMMI",null,St)}getEventCensus(){return this.get("CENS",null,St)}getEventProbate(){return this.get("PROB",null,St)}getEventWill(){return this.get("WILL",null,St)}getEventGraduation(){return this.get("GRAD",null,St)}getEventRetirement(){return this.get("RETI",null,St)}getEventOther(){return this.get("EVEN",null,St)}getAttributeCaste(){return this.get("CAST",null,vt)}getAttributePhysicalDescription(){return this.get("DSCR",null,vt)}getAttributeScholasticAchievement(){return this.get("EDUC",null,vt)}getAttributeIdentificationNumber(){return this.get("IDNO",null,vt)}getAttributeNationality(){return this.get("NATI",null,vt)}getAttributeChildrenCount(){return this.get("NCHI",null,vt)}getAttributeRelationshipCount(){return this.get("NMR",null,vt)}getAttributeOccupation(){return this.get("OCCU",null,vt)}getAttributePossessions(){return this.get("PROP",null,vt)}getAttributeReligiousAffiliation(){return this.get("RELI",null,vt)}getAttributeResidence(){return this.get("RESI",null,vt)}getAttributeNobilityTitle(){return this.get("TITL",null,vt)}getAttributeFact(){return this.get("FACT",null,vt)}getChildFamilyLink(){return this.get("FAMC",null,Nt)}getSpouseFamilyLink(){return this.get("FAMS",null,Tt)}getAssociation(){return this.get("ASSO",null,yt)}}class Pt extends J{getMediaType(){return this.get("TYPE")}}class Dt extends J{getFormat(){return this.get("FORM",null,Pt)}getTitle(){return this.get("TITL")}}class It extends(Je(Ge)){getFileReference(){return this.get("FILE",null,Dt)}}class xt extends(Ye(Ge)){}class Ft extends ye{valueAsDatePeriod(){return this.value().map((e=>{const t=Ne(e);return null!==t&&t.isDatePeriod?t:null}))}}class Ot extends ke{getPlace(){return this.get("PLAC",null,ct)}getDatePeriod(){return this.get("DATE",null,Ft)}}class Lt extends(we(J)){getEventsRecorded(){return this.get("EVEN",null,Ot)}getResponsibleAgency(){return this.get("AGNC")}}class wt extends J{getRepositoryRecord(){return this.root().getRepositoryRecord(this.valueNonNull())}getSourceCallNumber(){return this.get("CALN")}}class Ut extends(Ve(we(Ge))){getData(){return this.get("DATA",null,Lt)}getOriginator(){return this.get("AUTH")}getDescriptiveTitle(){return this.get("TITL")}getShortTitle(){return this.get("ABBR")}getPublicationFacts(){return this.get("PUBL")}getText(){return this.get("TEXT")}getRepository(){return this.get("REPO",null,wt)}}class Bt extends(te(we(Ge))){getName(){return this.get("NAME")}}class jt extends J{getHeader(){return this.get("HEAD",null,Ue)}getRecord(e,t,n){return this.get(e,t,n)}getSubmitterRecord(e){return this.get("SUBM",null!=e?e:null,We)}getIndividualRecord(e){return this.get("INDI",null!=e?e:null,Mt)}getFamilyRecord(e){return this.get("FAM",null!=e?e:null,mt)}getMultimediaRecord(e){return this.get("OBJE",null!=e?e:null,It)}getNoteRecord(e){return this.get("NOTE",null!=e?e:null,xt)}getSourceRecord(e){return this.get("SOUR",null!=e?e:null,Ut)}getRepositoryRecord(e){return this.get("REPO",null!=e?e:null,Bt)}}const Gt=(e,t={})=>{const n=V(e,t);return new jt(n,[n])},Ht=e=>new jt(e,[e]);class Vt extends J{valueAsDate(){return this.value().map((e=>{const t=Ne(e);return null!==t&&t.isDatePunctual&&!t.isDateApproximated?t:null}))}}const Wt=e=>{var t,n;const r=null!==(t=e.day)&&void 0!==t?t:1,i=null!==(n=e.month)&&void 0!==n?n:1,s=e.year.isBce?-e.year.value:e.year.value;if(e.year.isDual)return null;if(e.calendar.isGregorian)return new Date(Date.UTC(s,i-1,r));if(e.calendar.isFrenchRepublican){const e=1791,t=s%4==0,n=[21,21,20,20,19,18,20,19,19,18,18,17,16],[l,o,a]=[8,7,1],u=n[i-1]+(i<7&&t?1:0)+(s>l||s===l&&(i>o||i===o&&r>=a)?1:0);return new Date(Date.UTC(e+s+(i>4?1:0),(i-1+8)%12,r+u))}if(e.calendar.isJulian){const e=i>2,t=s-(e?0:1),n=i+(e?0:12);return(e=>{const t=e+32044,n=146097,r=Math.floor(t/n),i=t%n,s=Math.floor(3*(Math.floor(i/36524)+1)/4),l=i-36524*s,o=Math.floor(l/1461),a=l%1461,u=Math.floor(3*(Math.floor(a/365)+1)/4),c=a-365*u,d=400*r+100*s+4*o+u,h=Math.floor((5*c+308)/153)-2,g=c-Math.floor(153*(h+4)/5)+122,f=d-4800+Math.floor((h+2)/12),p=(h+2)%12,A=g+1;return new Date(Date.UTC(f,p,A))})(Math.floor((1461*t+6884472)/4)+Math.floor((153*n-457)/5)+r-1)}return e.calendar.isHebrew,null},kt=(e,t)=>{const n=new Date(Date.UTC(e.year,e.month-1,e.day));return null!=t&&(n.setUTCHours(t.hours),n.setUTCMinutes(t.minutes),void 0!==t.seconds&&(n.setUTCSeconds(t.seconds),void 0!==t.centiseconds&&n.setUTCMilliseconds(10*t.centiseconds))),n};var $t,zt,_t,Yt,Jt,Kt,Xt,Qt,Zt,qt,en,tn,nn,rn,sn,ln,on,an;return function(e){e[e.Decoding=0]="Decoding",e[e.TokenizationAndStructuring=1]="TokenizationAndStructuring",e[e.Indexing=2]="Indexing",e[e.Freezing=3]="Freezing"}($t||($t={})),function(e){e.Abbreviation="ABBR",e.Address="ADDR",e.Address1="ADR1",e.Address2="ADR2",e.Address3="ADR3",e.Adoption="ADOP",e.AdultChristening="CHRA",e.Age="AGE",e.Agency="AGNC",e.Alias="ALIA",e.Ancestors="ANCE",e.AncestorInterest="ANCI",e.AncestralFileNumber="AFN",e.Annulment="ANUL",e.Associates="ASSO",e.Author="AUTH",e.Baptism="BAPM",e.BaptismLDS="BAPL",e.BarMitzvah="BARM",e.BatMitzvah="BASM",e.BinaryObject="BLOB",e.Birth="BIRT",e.Blessing="BLES",e.Burial="BURI",e.CallNumber="CALN",e.Caste="CAST",e.Cause="CAUS",e.Census="CENS",e.Change="CHAN",e.Character="CHAR",e.Child="CHIL",e.ChildrenCount="NCHI",e.Christening="CHR",e.City="CITY",e.Concatenation="CONC",e.Confirmation="CONF",e.ConfirmationLDS="CONL",e.Continuation="CONT",e.Copyright="COPR",e.Corporate="CORP",e.Country="CTRY",e.Cremation="CREM",e.Data="DATA",e.Date="DATE",e.Death="DEAT",e.Descendants="DESC",e.DescendantInt="DESI",e.Destination="DEST",e.Divorce="DIV",e.DivorceFiled="DIVF",e.Education="EDUC",e.Email="EMAIL",e.Emigration="EMIG",e.Endowment="ENDL",e.Engagement="ENGA",e.Event="EVEN",e.Fact="FACT",e.Family="FAM",e.FamilyChild="FAMC",e.FamilyFile="FAMF",e.FamilySpouse="FAMS",e.Fax="FAX",e.File="FILE",e.FirstCommunion="FCOM",e.Format="FORM",e.Gedcom="GEDC",e.GivenName="GIVN",e.Graduation="GRAD",e.Header="HEAD",e.Husband="HUSB",e.IdentificationNumber="IDNO",e.Immigration="IMMI",e.Individual="INDI",e.Language="LANG",e.Latitude="LATI",e.Legatee="LEGA",e.Longitude="LONG",e.Map="MAP",e.Marriage="MARR",e.MarriageBan="MARB",e.MarriageContract="MARC",e.MarriageCount="NMR",e.MarriageLicense="MARL",e.MarriageSettlement="MARS",e.Media="MEDI",e.Name="NAME",e.NamePrefix="NPFX",e.NameSuffix="NSFX",e.Nationality="NATI",e.Naturalization="NATU",e.Nickname="NICK",e.Note="NOTE",e.Object="OBJE",e.Occupation="OCCU",e.Ordinance="ORDI",e.Ordination="ORDN",e.Page="PAGE",e.Pedigree="PEDI",e.Phone="PHON",e.Phonetic="FONE",e.PhysicalDescription="DSCR",e.Place="PLAC",e.PostalCode="POST",e.Probate="PROB",e.Property="PROP",e.Publication="PUBL",e.QualityOfData="QUAY",e.RecordFileNumber="RFN",e.RecordIdNumber="RIN",e.Reference="REFN",e.Relationship="RELA",e.Religion="RELI",e.Repository="REPO",e.Residence="RESI",e.Restriction="RESN",e.Retirement="RETI",e.Role="ROLE",e.Romanized="ROMN",e.SealingChild="SLGC",e.SealingSpouse="SLGS",e.Sex="SEX",e.SocialSecurityNumber="SSN",e.Source="SOUR",e.State="STAE",e.Status="STAT",e.Submission="SUBN",e.Submitter="SUBM",e.Surname="SURN",e.SurnamePrefix="SPFX",e.Temple="TEMP",e.Text="TEXT",e.Time="TIME",e.Title="TITL",e.Trailer="TRLR",e.Type="TYPE",e.Version="VERS",e.Web="WWW",e.Wife="WIFE",e.Will="WILL"}(zt||(zt={})),function(e){e.CharacterAlt="CHARACTER"}(_t||(_t={})),function(e){e.Husband="HUSB",e.Wife="WIFE",e.Both="BOTH"}(Yt||(Yt={})),function(e){e[e.Unreliable=0]="Unreliable",e[e.Questionable=1]="Questionable",e[e.Secondary=2]="Secondary",e[e.Primary=3]="Primary"}(Jt||(Jt={})),function(e){e.Utf8="UTF-8",e.Unicode="UNICODE",e.Ansel="ANSEL",e.Ascii="ASCII",e.Ansi="ANSI"}(Kt||(Kt={})),function(e){e.Yes="Y"}(Xt||(Xt={})),function(e){e.LineageLinked="LINEAGE-LINKED"}(Qt||(Qt={})),function(e){e.Afrikaans="Afrikaans",e.Albanian="Albanian",e.AngloSaxon="Anglo-Saxon",e.Catalan="Catalan",e.CatalanSpn="Catalan_Spn",e.Czech="Czech",e.Danish="Danish",e.Dutch="Dutch",e.English="English",e.Esperanto="Esperanto",e.Estonian="Estonian",e.Faroese="Faroese",e.Finnish="Finnish",e.French="French",e.German="German",e.Hawaiian="Hawaiian",e.Hungarian="Hungarian",e.Icelandic="Icelandic",e.Indonesian="Indonesian",e.Italian="Italian",e.Latvian="Latvian",e.Lithuanian="Lithuanian",e.Navaho="Navaho",e.Norwegian="Norwegian",e.Polish="Polish",e.Portuguese="Portuguese",e.Romanian="Romanian",e.SerboCroa="Serbo_Croa",e.Slovak="Slovak",e.Slovene="Slovene",e.Spanish="Spanish",e.Swedish="Swedish",e.Turkish="Turkish",e.Wendic="Wendic",e.Amharic="Amharic",e.Arabic="Arabic",e.Armenian="Armenian",e.Assamese="Assamese",e.Belorusian="Belorusian",e.Bengali="Bengali",e.Braj="Braj",e.Bulgarian="Bulgarian",e.Burmese="Burmese",e.Cantonese="Cantonese",e.ChurchSlavic="Church-Slavic",e.Dogri="Dogri",e.Georgian="Georgian",e.Greek="Greek",e.Gujarati="Gujarati",e.Hebrew="Hebrew",e.Hindi="Hindi",e.Japanese="Japanese",e.Kannada="Kannada",e.Khmer="Khmer",e.Konkani="Konkani",e.Korean="Korean",e.Lahnda="Lahnda",e.Lao="Lao",e.Macedonian="Macedonian",e.Maithili="Maithili",e.Malayalam="Malayalam",e.Mandarin="Mandarin",e.Manipuri="Manipuri",e.Marathi="Marathi",e.Mewari="Mewari",e.Nepali="Nepali",e.Oriya="Oriya",e.Pahari="Pahari",e.Pali="Pali",e.Panjabi="Panjabi",e.Persian="Persian",e.Prakrit="Prakrit",e.Pusto="Pusto",e.Rajasthani="Rajasthani",e.Russian="Russian",e.Sanskrit="Sanskrit",e.Serb="Serb",e.Tagalog="Tagalog",e.Tamil="Tamil",e.Telugu="Telugu",e.Thai="Thai",e.Tibetan="Tibetan",e.Ukrainian="Ukrainian",e.Urdu="Urdu",e.Vietnamese="Vietnamese",e.Yiddish="Yiddish"}(Zt||(Zt={})),function(e){e.Audio="audio",e.Book="book",e.Card="card",e.Electronic="electronic",e.Fiche="fiche",e.Film="film",e.Magazine="magazine",e.Manuscript="manuscript",e.Map="map",e.Newspaper="newspaper",e.Photo="photo",e.Tombstone="tombstone",e.Video="video"}(qt||(qt={})),function(e){e.Aac="AAC",e.Avi="AVI",e.Bmp="BMP",e.Epub="ePUB",e.Flac="FLAC",e.Gif="GIF",e.Jpeg="JPEG",e.Jpg="JPG",e.Mkv="MKV",e.Mobi="mobi",e.Mp3="MP3",e.Pcx="PCX",e.Pdf="PDF",e.Png="PNG",e.Tiff="TIFF",e.Tif="TIF",e.Wav="WAV"}(en||(en={})),function(e){e.Alias="aka",e.Birth="birth",e.Immigration="immigrant",e.Maiden="maiden",e.Married="married"}(tn||(tn={})),function(e){e.Adopted="adopted",e.Birth="birth",e.Foster="foster"}(nn||(nn={})),function(e){e.Hangul="Hangul",e.Kana="kana"}(rn||(rn={})),function(e){e.Child="CHIL",e.Husband="HUSB",e.Wife="WIFE",e.Mother="MOTH",e.Father="FATH",e.Spouse="SPOU"}(sn||(sn={})),function(e){e.Pinyin="pinyin",e.Romaji="romaji",e.Wadegiles="wadegiles"}(ln||(ln={})),function(e){e.Male="M",e.Female="F",e.Intersex="X",e.Unknown="U",e.NotRecorded="N"}(on||(on={})),function(e){e[e.Unreliable=0]="Unreliable",e[e.Questionable=1]="Questionable",e[e.Secondary=2]="Secondary",e[e.Primary=3]="Primary"}(an||(an={})),t}()}));
//# sourceMappingURL=read-gedcom.min.js.map