ged2web - parts.go

package main

// File automatically generated with ./embed.sh

const (
	htmlStart = "<html lang=\"en\"><head><title>Ged2Web</title><meta charset=\"UTF-8\" /><script type=\"module\">"
	htmlEnd   = "</script><style type=\"text/css\">#indexes a:not(:first-child){padding-left:.5em}#indexes a:not(:last-child){border-right:1px solid #000;padding-right:.5em}page-numbers::part(base){list-style:none;padding:0;margin:0}page-numbers::part(page),page-numbers::part(separator){display:inline-block;padding-left:1em}page-numbers::part(separator):after{content:"…"}page-numbers::part(prev){padding-left:0}.results{list-style:none;margin:20px 0;padding:0;overflow:hidden;clear:left}.results>li{padding-bottom:10px;border-bottom:1px dashed #000;margin-bottom:10px;overflow:hidden}.results>li>div:first-child{float:left;width:200px}.results>li>div:last-child{overflow:hidden}.results>li>div:last-child>div{display:inline;margin-right:20px;overflow:hidden}#relationship{border-collapse:separate;border-spacing:5px 0;margin-left:auto;margin-right:auto}#relationship ul{list-style:none;margin:0;padding:0}#relationship td:first-child{background-color:rgba(0,255,0,0.5);text-align:right}#relationship td:last-child{background-color:rgba(255,0,0,0.5);text-align:left}#relationship tr:last-child td{background-color:rgba(255,255,0,0.5);text-align:center}#relationship td{vertical-align:bottom;padding:0 20px;width:50%}#ged2web_title{text-align:center}.person{position:absolute;width:150px;left:50px;border:1px solid #000;text-align:center;word-wrap:break-word}.highlight{border-color:#080}.sex_U{background-color:#aaa}.sex_M{background-color:#aaf}.sex_F{background-color:#faa}.spouseLine{position:absolute;border-top:5px solid #000;border-bottom:5px solid #000;height:5px;width:200px;left:50px;z-index:-1}.downLeft{position:absolute;margin-top:10px;height:100px;width:100px;border-right:5px solid #000;border-bottom:5px solid #000}.downRight{position:absolute;margin-top:10px;height:100px;width:100px;border-left:5px solid #000;border-bottom:5px solid #000}.chosen{border-color:#f00 !important}.dob,.dod{font-size:.5em}.collapse,.expand{width:7px;height:7px;border-width:0 1px 1px 0;border-color:#000;border-style:solid;float:left;background-color:#fff;cursor:pointer;cursor:hand}.collapse{background-color:#000}</style></head><body></body></html>"
	modStart  = "export const people = ["
	modMid    = "], families = ["
	modEnd    = "]"
	jsStart   = "class e extends HTMLElement{#e=new Text;#t=!1;#s=new Map;#n=[];#o;constructor(){super(),L.observe(this,{childList:!0})}#i(){this.#t=!1,this.#e.replaceWith(this.#e=new Text)}#r(e,t,s=window.location,n){const o={},i=s.searchParams??new URLSearchParams(s.search),r=s.pathname.match(e.path);if(!r)return!1;r.shift();for(const t of e.matches)o[t]=r.shift();for(const[t,s]of e.params){const e=i.get(t);if(\":\"===s.charAt(0)&&s.length>1)e&&(o[s.slice(1)]=e);else if(e!==s)return!1}return s.hash===e.hash&&(this.#a(t(n?Object.assign(o,n):o)),this.#t=!0)}#a(e){(this.#o??T.get(this.getAttribute(\"router-transition\")??\"\")??P)(this.#e,this.#e=e)}#c(e,t){for(const s of this.#n)if(this.#r(s[0],s[1],e,t))return!0;return!1}add(e,t){const s=new URL(e,window.location.href),n=[],o={matches:n,params:s.searchParams,hash:s.hash};let i=s.pathname,r=e.startsWith(\"/\")?\"^\":\"\";for(let e=i.indexOf(\":\");e>=0;e=i.indexOf(\":\")){r+=i.slice(0,e).replace(/[[\\]()$*+.]/g,\"\\\\$&\")+\"([^/]+)\",i=i.slice(e);const t=i.indexOf(\"/\"),s=t<0?i.length:t;n.push(i.slice(1,s)),i=i.slice(s)}return o.path=new RegExp(r+i+(i.endsWith(\"/\")?\"\":\"$\")),this.#n.push([o,t]),!this.#t&&this.#e.isConnected&&this.#r(o,t),this}setTransition(e){return this.#o=e,this}[S](e,t,s){if(this.#e.isConnected){const n=this.#s.get(t??0);if(this.#s.set(a,this.#e),n)return this.#a(n),!0;if(this.#c(e,s))return!0}return!1}[E](){if(this.#e.isConnected){for(const t of this.children)if(!(t instanceof e)){const e=t.getAttribute(\"route-match\");if(null!==e){const s=t.cloneNode(!0);s.removeAttribute(\"route-match\"),this.add(e,(e=>{const t=s.cloneNode(!0);for(const s in e)t.setAttribute(s,e[s]);return t}))}}this.replaceChildren()}}connectedCallback(){let t=this.parentNode;for(;t&&t!==document;)if(t instanceof ShadowRoot)t=t.host;else{if(!t.parentNode||t instanceof e)return;t=t.parentNode}k.add(this),this.#i(),this.replaceWith(this.#e),this.#c(window.location),this[E]()}remove(){this.#e.remove(),k.delete(this)}}class t extends HTMLElement{#l=\"\";connectedCallback(){$(document.body,{class:[this.#l??=this.getAttribute(\"class\")??\"_\"]}),document.title=`${Ut} - ${this.getAttribute(\"title\")??\"\"}`}disconnectedCallback(){$(document.body,{class:{[this.#l]:!1}})}}class s extends HTMLElement{#h=3;#d=3;#f=1;#u=0;#p=null;#m;constructor(){super(),$(this.attachShadow({mode:\"open\"}),this.#m=Ot({part:\"base\"}))}attributeChangedCallback(e,t,s){if(\"href\"===e)this.#p=s;else{const t=parseInt(s??\"\");if(isNaN(t)||t<0)return;switch(e){case\"end\":this.#h=t;break;case\"surround\":this.#d=t;break;case\"total\":this.#f=t;break;case\"page\":this.#u=t}}this.#g()}static get observedAttributes(){return[\"href\",\"end\",\"surround\",\"total\",\"page\"]}setAttributeNode(e){if(\"realValue\"in e){const t=e.realValue;if(t instanceof Function&&\"href\"===e.name)return this.#p=t,this.#g(),null}return super.setAttributeNode(e)}#g(){if(0===this.#f)return;const e=[],t=this.#f-1,s=this.#u<this.#f?this.#u:t;let n=0;for(let o=0;o<=this.#f;o++)o<this.#h||o>t-this.#h||(this.#d>s||o>=s-this.#d)&&o<=s+this.#d||this.#h>0&&(s-this.#d-1===this.#h&&o===this.#h||s+this.#d+1===t-this.#h&&o==t-this.#h)||(o!==n&&es(e,s,n,o-1,this.#p),n=o+1);n<this.#f&&es(e,s,n,t,this.#p),A(this.#m,[$(0!==s?Zt(s-1,this.#p,ts.PREV):Ge(ts.PREV),{part:\"page prev\"}),e,$(s!==t?Zt(s+1,this.#p,ts.NEXT):Ge(ts.NEXT),{part:\"page next\"})])}getPageNumberFromEvent(e){return s.getPageNumberFromEvent(e)}static getPageNumberFromEvent(e){return parseInt(e.composedPath()?.[0].dataset?.page??\"\")??-1}}class n{container=ce();chosen;highlight;expanded;rows=[];constructor(e,t){this.chosen=e,this.highlight=new Set(t),this.expanded=new Set(t),this.draw()}draw(e=0,t=0){let s=this.chosen,n=0,o=0;for(;;){const e=Gt[s][5],[t,n]=It[e];if(this.expanded.has(t))s=t;else{if(!this.expanded.has(n)){if(e)new i(this,t,0,!0);else{const e=new i(this,0,0);e.spouses=[new r(this,e,[0,0,s],0)]}break}s=n}}const a=N();for(const t of this.rows){for(const s of t){const t=fs+n*ps,c=us+s.col*bs;e&&s.id===e&&(o=c),s instanceof i?(n>0&&$(a,ce({class:\"downLeft\",style:{top:t-50+\"px\",left:`${c+ms/2}px`,width:0,height:\"50px\"}})),s.spouses.length>0&&$(a,ce({class:\"spouseLine\",style:{top:`${t}px`,left:`${c}px`,width:(s.spouses[s.spouses.length-1].col-s.col)*bs+\"px\"}}))):s instanceof r&&s.children.length>0&&($(a,ce(s.col<=s.children[0].col?{class:\"downRight\",style:{top:`${t}px`,left:c-gs/2+\"px\"}}:{class:\"downLeft\",style:{top:`${t}px`,left:c-ms+gs/2+\"px\",width:ms-gs+\"px\"}})),s.children.length>1&&$(a,ce({class:\"downLeft\",style:{top:t+ps-50+\"px\",left:`${us+s.children[0].col*bs+ms/2}px`,width:(s.children[s.children.length-1].col-s.children[0].col)*bs+\"px\",height:0}})));const l=s.id,[,,h,d,f,,...u]=Gt[s.id],p=s instanceof r;$(a,ce({class:{person:!0,[ws[f]]:!0,highlight:this.highlight.has(l),chosen:this.chosen===s.id},style:{top:`${fs+n*ps}px`,left:`${us+s.col*bs}px`}},[s.id>0&&s.id!==this.chosen&&(s instanceof i&&u.length>0||p)?ce({class:!this.expanded.has(s.id)||p?\"expand\":\"collapse\",onclick:this.expand.bind(this,s.id,p)}):[],ce({class:\"name\"},Vt(s.id)),h?ce({class:\"dob\"},h):[],d?ce({class:\"dod\"},d):[]]))}n++}A(this.container,a),e&&window.scroll({left:o+t})}addPerson(e,t){const s=this.rows[e],n=s?.[s?.length-1];return s?(s.push(n.next=t),n.col+1):(this.rows.push([t]),0)}expand(e,t,s){t?this.chosen=e:this.expanded.has(e)?this.expanded.delete(e):this.expanded.add(e),this.rows=[],this.draw(e,window.scrollX-s.target.offsetParent.offsetLeft)}}class o{id;col;next;constructor(e,t,s){this.id=t,this.col=e.addPerson(s,this)}}class i extends o{spouses=[];constructor(e,t,s,n=!1){if(super(e,t,s),e.expanded.has(t)||e.chosen===t||n){const[,,,,,,...n]=Gt[t];if(n.length>0){for(const t of n)this.spouses.push(new r(e,this,It[t],s));this.col=this.spouses[0].col-1}}}shift(e){this.col+=e,this.next&&this.next.col<=this.col&&this.next.shift(this.col-this.next.col+1)}}class r extends o{children=[];constructor(e,t,s,n){super(e,s[0]===t.id?s[1]:s[0],n);const[,,...o]=s,r=n+1;if(o.length>0){for(const t of o)this.children.push(new i(e,t,r));for(let e=this.children.length-1;e>=0;e--){const t=this.children[e];t.col<this.col-1&&t.next&&(t.col=t.next.col-1)}this.col<this.children[0].col&&(this.col=this.children[0].col),this.shift(0)}}shift(e){if(this.col+=e,0!==this.children.length)for(;this.children[this.children.length-1].col<this.col-1;)this.children[0].shift(this.col-this.children[this.children.length-1].col-1);this.next&&this.next.col<=this.col&&this.next.shift(this.col-this.next.col+1)}}customElements.define(\"x-router\",e),customElements.define(\"x-route\",class extends HTMLElement{#l;#b;#w;connectedCallback(){const e=this.#l??=this.getAttribute(\"route-class\")??\"\",t=this.#b??=this.getAttribute(\"route-id\")??\"\",s=this.#w??=this.getAttribute(\"route-title\")??\"\";e&&document.documentElement.classList.toggle(e,!0),t&&document.documentElement.setAttribute(\"id\",t),s&&(document.title=s)}disconnectedCallback(){const e=this.#l;e&&document.documentElement.classList.toggle(e,!1),this.#b&&document.documentElement.getAttribute(\"id\")===this.#b&&document.documentElement.removeAttribute(\"id\")}}),customElements.define(\"ged-2-web\",t),customElements.define(\"page-numbers\",s);let a=Date.now(),c=0;const l=(e,t=[])=>{if(m(e))t.push(e[b]);else if(\"string\"==typeof e||e instanceof Node)t.push(e);else if(Array.isArray(e))for(const s of e)l(s,t);else(e instanceof NodeList||e instanceof HTMLCollection)&&t.push(...e);return t},h=e=>e instanceof Function||(e=>e instanceof Object&&e.handleEvent instanceof Function)(e)&&(!(x in e)||h(e[x])),d=e=>h(e)||e instanceof Array&&3===e.length&&h(e[0])&&e[1]instanceof Object&&\"boolean\"==typeof e[2],f=e=>e instanceof Object&&!p(e),u=e=>e instanceof CSSStyleDeclaration||e instanceof Object&&!p(e),p=e=>e instanceof Object&&w in e,m=e=>e instanceof Object&&b in e,g=(e,t)=>{const s=document.createAttributeNS(null,e);return s.textContent=t,s},b=Symbol(\"child\"),w=Symbol(\"attr\"),x=Symbol(\"value\"),y=e=>e instanceof Array||\"string\"==typeof e||e instanceof Element||e instanceof DocumentFragment||e instanceof Text||m(e)||e instanceof NodeList||e instanceof HTMLCollection,$=(e,t,s)=>{if(t&&y(t))s=t;else if(t instanceof NamedNodeMap&&e instanceof Element)for(const s of t)e.setAttributeNode(s.cloneNode());else if(e&&\"object\"==typeof t){const s=!!((n=e).style&&n.classList&&n.removeAttribute&&n.setAttributeNode&&n.toggleAttribute);for(const n in t){const o=t[n];if(d(o)&&n.startsWith(\"on\")){const t=o instanceof Array;e[t&&o[2]?\"removeEventListener\":\"addEventListener\"](n.slice(2),t?o[0]:o,!!t&&o[1])}else if(s)if(\"boolean\"==typeof o)e.toggleAttribute(n,o);else if(void 0===o)e.removeAttribute(n);else if(o instanceof Array||o instanceof DOMTokenList){if(\"class\"===n&&o.length)for(const t of o){const s=t.slice(0,1),n=\"!\"!==s&&(\"~\"!==s||void 0);e.classList.toggle(n?t:t.slice(1),n)}}else if(\"class\"===n&&f(o))for(const t in o)e.classList.toggle(t,o[t]??void 0);else if(\"style\"===n&&u(o))for(const[t,s]of o instanceof CSSStyleDeclaration?Array.from(o,(e=>[e,o.getPropertyValue(e)])):Object.entries(o))void 0===s?e.style.removeProperty(t):e.style.setProperty(t,s.toString());else null!==o&&e.setAttributeNode(o instanceof Attr?o:Object.assign(p(o)?o[w](n):g(n,o),{realValue:o}))}}var n;return e instanceof Node&&(\"string\"!=typeof s||e.firstChild?s&&(s instanceof Node?e.appendChild(s):e instanceof Element||e instanceof DocumentFragment?e.append(...l(s)):e.appendChild(N(s))):e.textContent=s),e},v=(e,t)=>Object.defineProperty(((s,n)=>$(document.createElementNS(e,t),s,n)),\"name\",{value:t}),N=e=>{const t=document.createDocumentFragment();return\"string\"==typeof e?t.textContent=e:e instanceof Node?t.append(e):void 0!==e&&t.append(...l(e)),t},A=(e,t,s)=>{if(!e)return e;if(t&&y(t)&&(t=void(s=t)),\"string\"==typeof s)s=void(e.textContent=s);else if(s&&e instanceof Element)s=void e.replaceChildren(...l(s));else for(;e.lastChild;)e.lastChild.remove();return $(e,t,s)},C=\"complete\"===document.readyState?Promise.resolve():new Promise((e=>window.addEventListener(\"load\",e,{once:!0}))),E=Symbol(\"update\"),S=Symbol(\"newState\"),k=new Set,L=new MutationObserver((t=>{for(const s of t)\"childList\"===s.type&&s.target instanceof e&&s.addedNodes.length&&s.target[E]()})),P=(e,t)=>e.replaceWith(t),T=new Map([[\"\",P]]),M=window.goto=(e,t)=>{const s=new URL(e,window.location+\"\");let n=!1;if(s.host===window.location.host){const o=Date.now();for(const e of k)e[S](s,o,t)&&(n=!0);a=o,n&&history.pushState(o,\"\",new URL(e,s+\"\")+\"\")}return n},O=\"http://www.w3.org/1999/xhtml\",[R,j,F,G,I,D,U,_,B,H,q,V,W,X,z,J,K,Q,Y,Z,ee,te,se,ne,oe,ie,re,ae,ce,le,he,de,fe,ue,pe,me,ge,be,we,xe,ye,$e,ve,Ne,Ae,Ce,Ee,Se,ke,Le,Pe,Te,Me,Oe,Re,je,Fe,Ge,Ie,De,Ue,_e,Be,He,qe,Ve,We,Xe,ze,Je,Ke,Qe,Ye,Ze,et,tt,st,nt,ot,it,rt,at,ct,lt,ht,dt,ft,ut,pt,mt,gt,bt,wt,xt,yt,$t,vt,Nt,At,Ct,Et,St,kt,Lt,Pt,Tt,Mt,Ot,Rt,jt,Ft]=\"a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd label legend li link main map mark menu meta meter nav noscript object ol optgroup option output p picture pre progress q rp rt ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr\".split(\" \").map((e=>v(O,e))),Gt=["
	jsMid     = "],It=["
	jsEnd     = "],Dt=[\"list\",\"fhcalc\",\"tree\"].includes(window.location.pathname.split(\"/\").pop()?.split(\".\").shift()??\"\"),Ut=document.title,_t=(e,t)=>M(Bt(e,t)),Bt=(e,t)=>(Dt?`${e}.html?`:`?module=${e}&`)+Object.entries(t).map((([e,t])=>`${e}=${encodeURIComponent(t)}`)).join(\"&\"),Ht=(e,t)=>R({href:Bt(e,t)}),qt=v(O,\"ged-2-web\"),Vt=e=>`${Gt[e][0]??\"?\"} ${Gt[e][1]??\"?\"}`,Wt=[[\"Parent\",\"Father\",\"Mother\"],[\"Sibling\",\"Brother\",\"Sister\"],[\"Spouse\",\"Husband\",\"Wife\"],[\"Child\",\"Son\",\"Daughter\"],[\"Pibling\",\"Uncle\",\"Aunt\"],[\"Nibling\",\"Nephew\",\"Niece\"]],Xt=(e,t)=>{const s=[];for(;t>0;)s.push(t),t=e.get(t)[0];return s.reverse()},zt={one:\"st\",two:\"nd\",few:\"rd\",other:\"th\"},Jt=[\"Once\",\"Twice\",\"Thrice\"],Kt=new Intl.PluralRules(\"en-GB\",{type:\"ordinal\"}),Qt=(e,t,s)=>{const n=e.length,o=t.length,i=n>0&&o>0&&Gt[e[n-1]][5]!=Gt[t[o-1]][5]?\"Half-\":\"\";switch(n){case 0:switch(o){case 0:return\"Clone\";case 1:return Wt[0][s];default:const e=o-2;return e>3?`${e} x Great-Grand-`:\"Great-\".repeat(e)+`Grand-${Wt[0][s]}`}case 1:switch(o){case 0:return Wt[3][Gt[e[0]][4]];case 1:return`${i}${Wt[1][Gt[e[0]][4]]}`;default:const t=o-2;return`${i}${t>3?`${t} x Great-Grand-`:\"Great-\".repeat(t)}${Wt[4][Gt[e[0]][4]]}`}default:const t=n-2;switch(o){case 0:return(t>3?`${t} x Great-Grand-`:\"Great-\".repeat(t)+\"Grand-\")+Wt[3][Gt[e[0]][4]];case 1:return`${i}${t>3?`${t} x Great-`:\"Great-\".repeat(t)}${Wt[5][Gt[e[0]][4]]}`;default:const s=Math.min(n,o)-1,r=Math.abs(n-o);return`${i}${s}${zt[Kt.select(s)]} ${i}Cousin${r>0?`, ${Jt[r-1]||`${r} Times`} Removed`:\"\"}`}}},Yt=e=>{const t=parseInt(e.from+\"\"),s=parseInt(e.to+\"\");if(t<=0||s<=0||!Gt[t]||!Gt[s])return qt({title:\"Family Tree\",class:\"ged2web_error\"},\"Error: Unknown ID\");const[n,o,i]=((e,t)=>{const s=new Map([[e,[0,0]],[t,[0,0]]]),n=[[e,1],[t,2]];for(;n.length>0;){const e=n.shift(),[t,o]=e,i=Gt[t][5];for(const r of It[i].slice(0,2))if(r){const i=s.get(r);if(i){if(i[1]!==o)return[r,Xt(s,1===o?t:i[0]),Xt(s,1===o?i[0]:t)]}else s.set(r,e),n.push([r,o])}}return[0,[],[]]})(t,s),r=Vt(t),a=Vt(s);return qt({title:\"Relationship Calculator\",class:\"ged2web_fhcalc\"},0===n?xe(`No direct relationship between ${r} and ${a}`):ce([ce({id:\"ged2web_title\"},[xe(`${r} is the ${Qt(o,i,Gt[n][4])} of ${a}`),z({onclick:()=>_t(\"fhcalc\",{from:s,to:t})},\"Swap\")]),yt({id:\"relationship\"},$t([Pt([r,a].map((e=>vt(ye(`Route from ${e}`))))),Pt([o,i].map((e=>vt(Ot(e.map((e=>Ge(`${Vt(e)}, who is the ${Wt[3][Gt[e][4]]} of…`)))))))),Pt(vt({colspan:2},[ce(Vt(n)),ye(\"Common Ancestor\"),$(Ht(\"tree\",{id:n,highlight:o.concat(i).join(\".\")}),\"Show in Tree\")]))]))]))},Zt=(e,t,s)=>null!==t?Ge({part:\"page\"},R({href:t instanceof Function?t(e):t+e,\"data-page\":e},s??e+1+\"\")):Ge({part:\"page\",\"data-page\":e},s??e+1+\"\"),es=(e,t,s,n,o)=>{0!==e.length&&e.push(Ge({part:\"separator\"}));for(let i=s;i<=n;i++)e.push(t===i?Ge({part:\"page current\"},i+1+\"\"):Zt(i,o))},ts={NEXT:\"Next\",PREV:\"Previous\"},ss=v(O,\"page-numbers\"),ns=(Promise.resolve(),Array.from({length:26},(()=>[]))),os=(new Intl.Collator).compare,is=(e,t)=>{const[s=\"\",n=\"\"]=Gt[e],[o=\"\",i=\"\"]=Gt[t];return n!==i?os(n,i):s!==o?os(s,o):t-e},rs=(e,t)=>0===e?[]:ce([$(Ht(\"tree\",{id:e}),Vt(e)),\" (\"+Wt[t][Gt[e][4]]+\")\"]),as=[],cs=(e,t,s,n=0)=>{const o=Math.min(20*(n+1),t.length),i=Ot({class:\"results\"}),r={href:e=>Bt(\"list\",Object.assign(s,{p:e})),end:3,surround:3,page:n,total:Math.ceil(t.length/20)-1};for(let e=20*n;e<o;e++){const s=t[e],[,,,,,n,...o]=Gt[s],[r,a,...l]=It[n],h=o.map((e=>It[e])),d=z({onclick:()=>{if(c===s){c=0;for(const[,e]of as)A(e,\"+\")}else if(0===c){c=s;for(const[e,t]of as)A(t,e===s?\"-\":\"=\")}else _t(\"fhcalc\",{from:c,to:s})}},0===c?\"+\":c===s?\"-\":\"=\");as.push([s,d]),$(i,Ge([ce([$(Ht(\"tree\",{id:s}),Vt(s)),d]),ce([rs(r,0),rs(a,0),l.filter((e=>e!==s)).map((e=>rs(e,1))),h.map((([e,t,...n])=>[rs(e!==s?e:t,2),n.filter((e=>e!==s)).map((e=>rs(e,3)))]))])]))}$(e,[ss(r),i,ss(r)])},ls=new Map,hs=se({id:\"treeNames\"}),ds=e=>{hs.parentNode||$(document.body,hs);const t=(e.l??\"\")+\"\",s=(e.q??\"\")+\"\",n=ce(),o=((e,t=-1/0,s=1/0,n=0)=>((e,t=-1/0,s=1/0)=>\"number\"==typeof e&&(0|e)===e&&e>=t&&e<=s)(e,t,s)?e:n)(parseInt(e.p+\"\"),0),i=()=>_t(\"list\",{q:r.value}),r=Me({type:\"text\",list:\"treeNames\",onkeypress:e=>\"Enter\"===e.key&&i()});let a=\"List\";if(s){r.value=s,a=\"Search\";const e=r.value.toUpperCase().split(\" \").sort(),t=e.join(\" \");let i=[];if(ls.has(t))i=ls.get(t);else{for(let t=0;t<Gt.length;t++){const s=`${Gt[t][0]||\"\"} ${Gt[t][1]||\"\"}`.toUpperCase();e.every((e=>s.includes(e)))&&i.push(t)}ls.set(t,i)}cs(n,i.sort(is),{q:s},o)}else if(t){const e=t.toUpperCase().charCodeAt(0);e>=65&&e<=90&&(a=`List - ${t}`,cs(n,ns[e-65],{l:t},o))}return qt({title:a,class:\"ged2web_list\"},[ce({id:\"ged2web_title\"},[xe(\"Select a Name\"),ce({id:\"indexes\"},ns.map(((e,t)=>$(Ht(\"list\",{l:String.fromCharCode(t+65)}),String.fromCharCode(t+65))))),ce({id:\"index_search\"},[je({for:\"index_search\"},\"Search Terms: \"),r,z({onclick:i},\"Search\")])]),n])},fs=100,us=50,ps=150,ms=150,gs=50,bs=ms+gs,ws=[\"U\",\"M\",\"F\"].map((e=>`sex_${e}`)),xs=e=>{const t=e.highlight+\"\",s=parseInt(e.id+\"\");return s<=0||void 0===Gt[s]?qt({title:\"Family Tree\",class:\"ged2web_error\"},\"Error: Unknown ID\"):qt({title:`Family Tree - ${Vt(s)}`,class:\"ged2web_tree\"},new n(s,(t||\"\").split(\".\").map((e=>parseInt(e))).filter((e=>e>0))).container)};history.replaceState(a,\"\"),window.addEventListener(\"click\",(e=>{let t=e.target;for(;t&&!(t instanceof HTMLAnchorElement||t instanceof HTMLAreaElement||t instanceof SVGAElement);)t=t.parentNode;const s=t?.getAttribute(\"href\");s&&M(s)&&e.preventDefault()})),window.addEventListener(\"popstate\",(()=>{for(const e of k)e[S](window.location,history.state);a=history.state}));for(let e=0;e<Gt.length;e++){let t=(Gt[e][1]??\"\").charCodeAt(0);t>=97&&(t-=32),t>=65&&t<=90&&ns[t-65].push(e)}for(const e of ns){e.sort(is);for(const t of e){const[e,s]=Gt[t];e&&s&&$(hs,Ke({value:`${e} ${s}`}))}}C.then((()=>A(document.getElementById(\"ged2web\")??document.body,(new e).add(\"tree.html?id=:id&highlight=:highlight\",xs).add(\"?module=tree&id=:id&highlight=:highlight\",xs).add(\"fhcalc.html?from=:from&to=:to\",Yt).add(\"?module=fhcalc&from=:from&to=:to\",Yt).add(\"list.html?l=:l&q=:q&p=:p\",ds).add(\"?module=list&l=:l&q=:q&p=:p\",ds).add(\"\",ds))));"
)