From 3437862384229732d548c09a1822d317d7652137 Mon Sep 17 00:00:00 2001 From: Rico Sonntag Date: Wed, 30 Aug 2023 18:55:26 +0200 Subject: [PATCH] Release 1.6.1 --- package.json | 2 +- resources/js/descendants-chart-storage.min.js | 2 +- resources/js/descendants-chart.min.js | 2 +- src/Module.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index e0847e8..8e14936 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webtrees-descendants-chart", - "version": "1.6.1-dev", + "version": "1.6.1", "description": "This modules provides an SVG descendants chart for the [webtrees](https://www.webtrees.net) genealogy application.", "keywords": [ "webtrees", diff --git a/resources/js/descendants-chart-storage.min.js b/resources/js/descendants-chart-storage.min.js index a452154..4144410 100644 --- a/resources/js/descendants-chart-storage.min.js +++ b/resources/js/descendants-chart-storage.min.js @@ -1 +1 @@ -var e,t;e=this,t=function(e){e.Storage=class{constructor(e){this._name=e,this._storage=JSON.parse(localStorage.getItem(this._name))||{}}register(e){let t=document.getElementById(e),s=this.read(e);s?t.type&&"checkbox"===t.type?t.checked=s:t.value=s:this.onInput(t),t.addEventListener("input",(e=>{this.onInput(e.target)}))}onInput(e){e.type&&"checkbox"===e.type?this.write(e.name,e.checked):this.write(e.name,e.value)}read(e){return this._storage[e]}write(e,t){this._storage[e]=t,localStorage.setItem(this._name,JSON.stringify(this._storage))}},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WebtreesDescendantsChart={}); +var e,t;e=this,t=function(e){e.Storage=class{constructor(e){this._name=e,this._storage=JSON.parse(localStorage.getItem(this._name))||{}}register(e){let t=document.getElementById(e),s=this.read(e);s?t.type&&"checkbox"===t.type?t.checked=s:t.value=s:this.onInput(t),t.addEventListener("input",(e=>{this.onInput(e.target)}))}onInput(e){e.type&&"checkbox"===e.type?this.write(e.name,e.checked):this.write(e.name,e.value)}read(e){return this._storage[e]}write(e,t){this._storage[e]=t,localStorage.setItem(this._name,JSON.stringify(this._storage))}}},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WebtreesDescendantsChart={}); diff --git a/resources/js/descendants-chart.min.js b/resources/js/descendants-chart.min.js index 4dfce5c..5bc7ce2 100644 --- a/resources/js/descendants-chart.min.js +++ b/resources/js/descendants-chart.min.js @@ -1 +1 @@ -var t,e;t=this,e=function(t){var e="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:e,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function i(t){var e=t+="",i=e.indexOf(":");return i>=0&&"xmlns"!==(e=t.slice(0,i))&&(t=t.slice(i+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function r(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===e&&n.documentElement.namespaceURI===e?n.createElement(t):n.createElementNS(i,t)}}function o(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function a(t){var e=i(t);return(e.local?o:r)(e)}function s(){}function h(t){return null==t?s:function(){return this.querySelector(t)}}function u(){return[]}function l(t){return null==t?u:function(){return this.querySelectorAll(t)}}function c(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function f(t){return function(){return this.matches(t)}}function d(t){return function(e){return e.matches(t)}}var p=Array.prototype.find;function g(){return this.firstElementChild}var _=Array.prototype.filter;function m(){return Array.from(this.children)}function y(t){return new Array(t.length)}function v(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function x(t,e,n,i,r,o){for(var a,s=0,h=e.length,u=o.length;se?1:t>=e?0:NaN}function A(t){return function(){this.removeAttribute(t)}}function $(t){return function(){this.removeAttributeNS(t.space,t.local)}}function N(t,e){return function(){this.setAttribute(t,e)}}function T(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function z(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function E(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function S(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function P(t){return function(){this.style.removeProperty(t)}}function C(t,e,n){return function(){this.style.setProperty(t,e,n)}}function L(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function O(t,e){return t.style.getPropertyValue(e)||S(t).getComputedStyle(t,null).getPropertyValue(e)}function I(t){return function(){delete this[t]}}function R(t,e){return function(){this[t]=e}}function B(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function H(t){return t.trim().split(/^|\s+/)}function D(t){return t.classList||new W(t)}function W(t){this._node=t,this._names=H(t.getAttribute("class")||"")}function X(t,e){for(var n=D(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var lt=[null];function ct(t,e){this._groups=t,this._parents=e}function ft(){return new ct([[document.documentElement]],lt)}function dt(t){return"string"==typeof t?new ct([[document.querySelector(t)]],[document.documentElement]):new ct([[t]],lt)}function pt(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}ct.prototype=ft.prototype={constructor:ct,select:function(t){"function"!=typeof t&&(t=h(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=A&&(A=M+1);!(v=m[A])&&++A=0;)(i=r[o])&&(a&&4^i.compareDocumentPosition(a)&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=M);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o1?this.each((null==e?P:"function"==typeof e?L:C)(t,e,null==n?"":n)):O(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?I:"function"==typeof e?B:R)(t,e)):this.node()[t]},classed:function(t,e){var n=H(t+"");if(arguments.length<2){for(var i=D(this.node()),r=-1,o=n.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?at:ot,i=0;i{}};function _t(){for(var t,e=0,n=arguments.length,i={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,i,r=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--bt}()}finally{bt=0,function(){for(var t,e,n=xt,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:xt=e);wt=t,Rt(i)}(),Nt=0}}function It(){var t=zt.now(),e=t-$t;e>At&&(Tt-=e,$t=t)}function Rt(t){bt||(kt&&(kt=clearTimeout(kt)),t-Nt>24?(t<1/0&&(kt=setTimeout(Ot,t-zt.now()-Tt)),Mt&&(Mt=clearInterval(Mt))):(Mt||($t=zt.now(),Mt=setInterval(It,At)),bt=1,Et(Ot)))}function Bt(t,e,n){var i=new Ct;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}Ct.prototype=Lt.prototype={constructor:Ct,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?St():+n)+(null==e?0:+e),this._next||wt===this||(wt?wt._next=this:xt=this,wt=this),this._call=t,this._time=n,Rt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rt())}};var Ht=_t("start","end","cancel","interrupt"),Dt=[],Wt=0,Xt=1,qt=2,Yt=3,Vt=4,jt=5,Ut=6;function Ft(t,e,n,i,r,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(t){n.state=Xt,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(o){var u,l,c,f;if(n.state!==Xt)return h();for(u in r)if((f=r[u]).name===n.name){if(f.state===Yt)return Bt(a);f.state===Vt?(f.state=Ut,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[u]):+uWt)throw new Error("too late; already scheduled");return n}function Kt(t,e){var n=Qt(t,e);if(n.state>Yt)throw new Error("too late; already running");return n}function Qt(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Zt(t,e){var n,i,r,o=t.__transition,a=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>qt&&n.state>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ve(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ve(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=he.exec(t))?new we(e[1],e[2],e[3],1):(e=ue.exec(t))?new we(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=le.exec(t))?ve(e[1],e[2],e[3],e[4]):(e=ce.exec(t))?ve(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=fe.exec(t))?Ne(e[1],e[2]/100,e[3]/100,1):(e=de.exec(t))?Ne(e[1],e[2]/100,e[3]/100,e[4]):pe.hasOwnProperty(t)?ye(pe[t]):"transparent"===t?new we(NaN,NaN,NaN,0):null}function ye(t){return new we(t>>16&255,t>>8&255,255&t,1)}function ve(t,e,n,i){return i<=0&&(t=e=n=NaN),new we(t,e,n,i)}function xe(t,e,n,i){return 1===arguments.length?((r=t)instanceof ee||(r=me(r)),r?new we((r=r.rgb()).r,r.g,r.b,r.opacity):new we):new we(t,e,n,null==i?1:i);var r}function we(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function be(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}`}function ke(){const t=Me(this.opacity);return`${1===t?"rgb(":"rgba("}${Ae(this.r)}, ${Ae(this.g)}, ${Ae(this.b)}${1===t?")":`, ${t})`}`}function Me(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ae(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function $e(t){return((t=Ae(t))<16?"0":"")+t.toString(16)}function Ne(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ze(t,e,n,i)}function Te(t){if(t instanceof ze)return new ze(t.h,t.s,t.l,t.opacity);if(t instanceof ee||(t=me(t)),!t)return new ze;if(t instanceof ze)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,h=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n0&&h<1?0:a,new ze(a,s,h,t.opacity)}function ze(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Ee(t){return(t=(t||0)%360)<0?t+360:t}function Se(t){return Math.max(0,Math.min(1,t||0))}function Pe(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Jt(ee,me,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ge,formatHex:ge,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Te(this).formatHsl()},formatRgb:_e,toString:_e}),Jt(we,xe,te(ee,{brighter(t){return t=null==t?ie:Math.pow(ie,t),new we(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?ne:Math.pow(ne,t),new we(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new we(Ae(this.r),Ae(this.g),Ae(this.b),Me(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:be,formatHex:be,formatHex8:function(){return`#${$e(this.r)}${$e(this.g)}${$e(this.b)}${$e(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ke,toString:ke})),Jt(ze,(function(t,e,n,i){return 1===arguments.length?Te(t):new ze(t,e,n,null==i?1:i)}),te(ee,{brighter(t){return t=null==t?ie:Math.pow(ie,t),new ze(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?ne:Math.pow(ne,t),new ze(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new we(Pe(t>=240?t-240:t+120,r,i),Pe(t,r,i),Pe(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new ze(Ee(this.h),Se(this.s),Se(this.l),Me(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Me(this.opacity);return`${1===t?"hsl(":"hsla("}${Ee(this.h)}, ${100*Se(this.s)}%, ${100*Se(this.l)}%${1===t?")":`, ${t})`}`}}));var Ce=t=>()=>t;function Le(t){return 1==(t=+t)?Oe:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Ce(isNaN(e)?n:e)}}function Oe(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Ce(isNaN(t)?e:t)}var Ie=function t(e){var n=Le(e);function i(t,e){var i=n((t=xe(t)).r,(e=xe(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=Oe(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function Re(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Be=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,He=new RegExp(Be.source,"g");function De(t,e){var n,i,r,o=Be.lastIndex=He.lastIndex=0,a=-1,s=[],h=[];for(t+="",e+="";(n=Be.exec(t))&&(i=He.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,h.push({i:a,x:Re(n,i)})),o=He.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:Re(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,a.rotate,s,h),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:Re(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,a.skewX,s,h),function(t,e,n,i,o,a){if(t!==n||e!==i){var s=o.push(r(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Re(t,n)},{i:s-2,x:Re(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,h),o=a=null,function(t){for(var e,n=-1,i=h.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Gt:Kt;return function(){var a=o(this,t),s=a.on;s!==i&&(r=(i=s).copy()).on(e,n),a.on=r}}(n,t,e))},attr:function(t,e){var n=i(t),r="transform"===n?Ue:Je;return this.attrTween(t,"function"==typeof e?(n.local?an:on)(n,r,Ze(this,"attr."+t,e)):null==e?(n.local?en:tn)(n):(n.local?rn:nn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=i(t);return this.tween(n,(r.local?sn:hn)(r,e))},style:function(t,e,n){var i="transform"==(t+="")?je:Je;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=O(this,t),a=(this.style.removeProperty(t),O(this,t));return o===a?null:o===n&&a===i?r:r=e(n=o,i=a)}}(t,i)).on("end.style."+t,pn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var a=O(this,t),s=n(this),h=s+"";return null==s&&(this.style.removeProperty(t),h=s=O(this,t)),a===h?null:a===i&&h===r?o:(r=h,o=e(i=a,s))}}(t,i,Ze(this,"style."+t,e))).each(function(t,e){var n,i,r,o,a="style."+e,s="end."+a;return function(){var h=Kt(this,t),u=h.on,l=null==h.value[a]?o||(o=pn(e)):void 0;u===n&&r===l||(i=(n=u).copy()).on(s,r=l),h.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var a=O(this,t);return a===o?null:a===i?r:r=e(i=a,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,o,n)),i}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Ze(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=Qt(this.node(),n).tween,o=0,a=r.length;o()=>t;function Mn(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function An(t,e,n){this.k=t,this.x=e,this.y=n}An.prototype={constructor:An,scale:function(t){return 1===t?this:new An(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new An(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $n=new An(1,0,0);function Nn(t){for(;!t.__zoom;)if(!(t=t.parentNode))return $n;return t.__zoom}function Tn(t){t.stopImmediatePropagation()}function zn(t){t.preventDefault(),t.stopImmediatePropagation()}function En(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Sn(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Pn(){return this.__zoom||$n}function Cn(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Ln(){return navigator.maxTouchPoints||"ontouchstart"in this}function On(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function In(){var t,e,n,i=En,r=Sn,o=On,a=Cn,s=Ln,h=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Ge,f=_t("start","zoom","end"),d=500,p=150,g=0,_=10;function m(t){t.property("__zoom",Pn).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",N).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,e){return(e=Math.max(h[0],Math.min(h[1],e)))===t.k?t:new An(e,t.x,t.y)}function v(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new An(t.k,i,r)}function x(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,i){t.on("start.zoom",(function(){b(this,arguments).event(i).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(i).end()})).tween("zoom",(function(){var t=this,o=arguments,a=b(t,o).event(i),s=r.apply(t,o),h=null==n?x(s):"function"==typeof n?n.apply(t,o):n,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),l=t.__zoom,f="function"==typeof e?e.apply(t,o):e,d=c(l.invert(h).concat(u/l.k),f.invert(h).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=u/e[2];t=new An(n,h[0]-e[0]*n,h[1]-e[1]*n)}a.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new k(t,e)}function k(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function M(t,...e){if(i.apply(this,arguments)){var n=b(this,e).event(t),r=this.__zoom,s=Math.max(h[0],Math.min(h[1],r.k*Math.pow(2,a.apply(this,arguments)))),l=pt(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=r.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[l,r.invert(l)],Zt(this),n.start()}zn(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",o(v(y(r,s),n.mouse[0],n.mouse[1]),n.extent,u))}}function A(t,...e){if(!n&&i.apply(this,arguments)){var r=t.currentTarget,a=b(this,e,!0).event(t),s=dt(t.view).on("mousemove.zoom",(function(t){if(zn(t),!a.moved){var e=t.clientX-l,n=t.clientY-c;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",o(v(a.that.__zoom,a.mouse[0]=pt(t,r),a.mouse[1]),a.extent,u))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,i=dt(t).on("dragstart.drag",null);e&&(i.on("click.drag",bn,wn),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,a.moved),zn(t),a.event(t).end()}),!0),h=pt(t,r),l=t.clientX,c=t.clientY;!function(t){var e=t.document.documentElement,n=dt(t).on("dragstart.drag",bn,wn);"onselectstart"in e?n.on("selectstart.drag",bn,wn):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Tn(t),a.mouse=[h,this.__zoom.invert(h)],Zt(this),a.start()}}function $(t,...e){if(i.apply(this,arguments)){var n=this.__zoom,a=pt(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),h=n.k*(t.shiftKey?.5:2),c=o(v(y(n,h),a,s),r.apply(this,e),u);zn(t),l>0?dt(this).transition().duration(l).call(w,c,a,t):dt(this).call(m.transform,c,a,t)}}function N(n,...r){if(i.apply(this,arguments)){var o,a,s,h,u=n.touches,l=u.length,c=b(this,r,n.changedTouches.length===l).event(n);for(Tn(n),a=0;a=0;)e+=n[i].value;else e=1;t.value=e}function Bn(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Dn)):void 0===e&&(e=Hn);for(var n,i,r,o,a,s=new qn(t),h=[s];n=h.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)h.push(i=r[o]=new qn(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Xn)}function Hn(t){return t.children}function Dn(t){return Array.isArray(t)?t[1]:null}function Wn(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Xn(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function qn(t){this.data=t,this.depth=this.height=0,this.parent=null}function Yn(t,e){return t.parent===e.parent?1:2}function Vn(t){var e=t.children;return e?e[0]:t.t}function jn(t){var e=t.children;return e?e[e.length-1]:t.t}function Un(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function Fn(t,e,n){return t.a.parent===e.parent?t.a:n}function Gn(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function Kn(){var t=Yn,e=1,n=1,i=null;function r(r){var h=function(t){for(var e,n,i,r,o,a=new Gn(t,0),s=[a];e=s.pop();)if(i=e._.children)for(e.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=e.children[r]=new Gn(i[r],r)),n.parent=e;return(a.parent=new Gn(null,0)).children=[a],a}(r);if(h.eachAfter(o),h.parent.m=-h.z,h.eachBefore(a),i)r.eachBefore(s);else{var u=r,l=r,c=r;r.eachBefore((function(t){t.xl.x&&(l=t),t.depth>c.depth&&(c=t)}));var f=u===l?1:t(u,l)/2,d=f-u.x,p=e/(l.x+f+d),g=n/(c.depth||1);r.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,a=e,s=n,h=o.parent.children[0],u=o.m,l=a.m,c=s.m,f=h.m;s=jn(s),o=Vn(o),s&&o;)h=Vn(h),(a=jn(a)).a=e,(r=s.z+c-o.z-u+t(s._,o._))>0&&(Un(Fn(s,e,i),e,r),u+=r,l+=r),c+=s.m,u+=o.m,f+=h.m,l+=a.m;s&&!jn(a)&&(a.t=s,a.m+=c-l),o&&!Vn(h)&&(h.t=o,h.m+=u-f,i=e)}return i}(e,r,e.parent.A||i[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}Nn.prototype=An.prototype,qn.prototype=Bn.prototype={constructor:qn,count:function(){return this.eachAfter(Rn)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],h=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Bn(this).eachBefore(Wn)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ei;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;eJn)if(Math.abs(l*s-h*u)>Jn&&r){let f=n-o,d=i-a,p=s*s+h*h,g=f*f+d*d,_=Math.sqrt(p),m=Math.sqrt(c),y=r*Math.tan((Qn-Math.acos((p+c-g)/(2*_*m)))/2),v=y/m,x=y/_;Math.abs(v-1)>Jn&&this._append`L${t+v*u},${e+v*l}`,this._append`A${r},${r},0,0,${+(l*f>u*d)},${this._x1=t+x*s},${this._y1=e+x*h}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(i),s=n*Math.sin(i),h=t+a,u=e+s,l=1^o,c=o?i-r:r-i;null===this._x1?this._append`M${h},${u}`:(Math.abs(this._x1-h)>Jn||Math.abs(this._y1-u)>Jn)&&this._append`L${h},${u}`,n&&(c<0&&(c=c%Zn+Zn),c>ti?this._append`A${n},${n},0,1,${l},${t-a},${e-s}A${n},${n},0,1,${l},${this._x1=h},${this._y1=u}`:c>Jn&&this._append`A${n},${n},0,${+(c>=Qn)},${l},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ii(){return new ni}function ri(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}ii.prototype=ni.prototype;const oi="right";class ai{constructor(t,e){this._xOffset=60,this._yOffset=60,this._boxWidth=t,this._boxHeight=e,this._splittNames=!1}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}get splittNames(){return this._splittNames}get boxWidth(){return this._boxWidth}get boxHeight(){return this._boxHeight}direction(){throw"Abstract method direction() not implemented"}nodeWidth(){throw"Abstract method nodeWidth() not implemented"}norm(t){throw"Abstract method norm() not implemented"}elbow(t){throw"Abstract method elbow() not implemented"}}function si(t,e){const n=e.xOffset/2,i=e.yOffset/2;let r=t.source.x,o=t.source.y;if(void 0!==t.spouse&&0===t.source.data.family?(r-=(t.source.x-t.spouse.x)/2,o-=hi(t,e)):o+=e.boxHeight/2*e.direction(),null===t.source.data.data&&(r-=e.boxWidth/2+n/2,o+=e.boxHeight/2*e.direction()),null!==t.target){let n=t.target.x,a=t.target.y-e.direction()*(e.boxHeight/2+i);const s=ii();return s.moveTo(r,o),s.lineTo(r,a),s.lineTo(n,a),s.lineTo(n,a+e.direction()*i),s.toString()}return function(t,e){const n=ii(),i=2,r=e.boxWidth/2;let o=t.source.y;if(t.spouse.data.spouses.length>=0&&(o-=hi(t,e)),null===t.coords&&(n.moveTo(t.spouse.x+r,o),n.lineTo(t.source.x-r,o)),t.coords&&t.coords.length>0){for(let e=0;e0&&(a=t.coords[e-1].x+r);let h=e>0?i:0,u=e+1<=t.coords.length?i:0;n.moveTo(a+h,o),n.lineTo(s-u,o)}n.moveTo(t.coords[t.coords.length-1].x+r+i,o),n.lineTo(t.source.x-r,o)}return n.toString()}(t,e)}function hi(t,e){return(t.source.data.family-Math.ceil(t.spouse.data.spouses.length/2))*e.direction()*5}class ui extends ai{constructor(t,e){super(t,e),this._splittNames=!0}direction(){return 1}get nodeWidth(){return 2*this._boxWidth+this._yOffset}norm(t){t.y=this.direction()*t.depth*(this._boxHeight+this._yOffset)}elbow(t){return si(t,this)}}class li extends ai{constructor(t,e){super(t,e),this._splittNames=!0}direction(){return-1}get nodeWidth(){return 2*this._boxWidth+this._yOffset}norm(t){t.y=this.direction()*t.depth*(this._boxHeight+this._yOffset)}elbow(t){return si(t,this)}}function ci(t,e){const n=e.xOffset/2,i=e.yOffset/2;let r=t.source.x,o=t.source.y;if(void 0!==t.spouse&&0===t.source.data.family?(r-=fi(t,e),o-=(t.source.y-t.spouse.y)/2):r+=e.boxWidth/2*e.direction(),null===t.source.data.data&&(r+=e.boxWidth/2*e.direction(),o-=e.boxHeight/2+i/2),null!==t.target){let i=t.target.x-e.direction()*(e.boxWidth/2+n),a=t.target.y;const s=ii();return s.moveTo(r,o),s.lineTo(i,o),s.lineTo(i,a),s.lineTo(i+e.direction()*n,a),s.toString()}return function(t,e){const n=ii(),i=2,r=e.boxHeight/2;let o=t.source.x;if(t.spouse.data.spouses.length>=0&&(o-=fi(t,e)),null===t.coords&&(n.moveTo(o,t.spouse.y+r),n.lineTo(o,t.source.y-r)),t.coords&&t.coords.length>0){for(let e=0;e0&&(a=t.coords[e-1].y+r);let h=e>0?i:0,u=e+1<=t.coords.length?i:0;n.moveTo(o,a+h),n.lineTo(o,s-u)}n.moveTo(o,t.coords[t.coords.length-1].y+r+i),n.lineTo(o,t.source.y-r)}return n.toString()}(t,e)}function fi(t,e){return(t.source.data.family-Math.ceil(t.spouse.data.spouses.length/2))*e.direction()*5}class di extends ai{constructor(t,e){super(t,e),this._xOffset=40,this._yOffset=40}direction(){return 1}get nodeWidth(){return 2*this._boxHeight+this._xOffset}norm(t){t.y=t.x,t.x=this.direction()*t.depth*(this._boxWidth+this._xOffset)}elbow(t){return ci(t,this)}}class pi extends ai{constructor(t,e){super(t,e),this._xOffset=40,this._yOffset=40}direction(){return-1}get nodeWidth(){return 2*this._boxHeight+this._xOffset}norm(t){t.y=t.x,t.x=this.direction()*t.depth*(this._boxWidth+this._xOffset)}elbow(t){return ci(t,this)}}class gi{constructor(){this._orientations={down:new ui(150,175),up:new li(150,175),[oi]:new di(300,80),left:new pi(300,80)}}get(){return this._orientations}}class _i{constructor(t,e=4,n=oi,i=!1,r=1){this._treeLayout=n,this._orientations=new gi,this.duration=750,this.padding=15,this.imagePadding=5,this._generations=e,this.textPadding=8,this._fontSize=14,this.fontColor="rgb(0, 0, 0)",this.rtl=i,this.labels=t,this.direction=r}get generations(){return this._generations}set generations(t){this._generations=t}get treeLayout(){return this._treeLayout}set treeLayout(t){this._treeLayout=t}get orientation(){return this._orientations.get()[this.treeLayout]}}class mi{constructor(t){this._configuration=t,this._nodes=null,this._root=null}init(t){let e=Bn(t);const n=Kn().nodeSize([this._configuration.orientation.nodeWidth,0]).separation(((t,e)=>this.separation(t,e)));this._root=e,this._nodes=n(e)}separation(t,e){return void 0!==t.data.spouses||void 0!==e.data.spouse?.75:t.parent===e.parent?.5:1}get nodes(){return this._nodes}get root(){return this._root}}class yi{constructor(t,e){this._orientation=t,this._cornerRadius=e,this._imagePadding=5,this._imageRadius=Math.min(40,t.boxHeight/2-this._imagePadding),this._x=this.calculateX(),this._y=this.calculateY(),this._width=this.calculateImageWidth(),this._height=this.calculateImageHeight(),this._rx=this.calculateCornerRadius(),this._ry=this.calculateCornerRadius()}calculateX(){return-this._orientation.boxWidth/2+this._imagePadding}calculateY(){return this._orientation instanceof di||this._orientation instanceof pi?-this._imageRadius:-this._orientation.boxHeight/2+this._imagePadding}calculateImageWidth(){return this._orientation instanceof di||this._orientation instanceof pi?2*this._imageRadius:this._orientation.boxWidth-2*this._imagePadding}calculateImageHeight(){return 2*this._imageRadius}calculateCornerRadius(){return this._cornerRadius-this._imagePadding}get imagePadding(){return this._imagePadding}get imageRadius(){return this._imageRadius}set imageRadius(t){this._imageRadius=t}get x(){return this._x}get y(){return this._y}get rx(){return this._rx}get ry(){return this._ry}get width(){return this._width}get height(){return this._height}}class vi{constructor(t,e=null){this._orientation=t,this._image=e,this._textPadding=15,this._x=this.calculateX(),this._y=this.calculateY(),this._width=this.calculateWidth()}calculateX(){const t=-this._orientation.boxWidth/2+this._textPadding;return this._image?t+this._image.width:t}calculateY(){return this._orientation instanceof di||this._orientation instanceof pi?-this._textPadding:this._image?this._image.y+this._image.height+2*this._textPadding:-this._orientation.boxHeight/2+2*this._textPadding}calculateWidth(){const t=this._orientation.boxWidth-2*this._textPadding;return this._image&&(this._orientation instanceof di||this._orientation instanceof pi)?t-this._image.width:t}get x(){return this._x}get y(){return this._y}get width(){return this._width}}class xi{constructor(t){this._cornerRadius=20,this._showImage=!0,this._orientation=t,this._x=-t.boxWidth/2,this._y=-t.boxHeight/2,this._rx=this._cornerRadius,this._ry=this._cornerRadius,this._width=t.boxWidth,this._height=t.boxHeight,this._image=new yi(t,this._cornerRadius)}get showImage(){return this._showImage}set showImage(t){this._showImage=t}get x(){return this._x}get y(){return this._y}get rx(){return this._rx}get ry(){return this._ry}get width(){return this._width}get height(){return this._height}get image(){return this._image}get text(){return new vi(this._orientation,this._showImage?this._image:null)}}class wi{constructor(t,e,n){this._svg=t,this._configuration=e,this._hierarchy=n,this._hierarchy.root.x0=0,this._hierarchy.root.y0=0,this._orientation=this._configuration.orientation,this._box=new xi(this._orientation),this.draw(this._hierarchy.root)}draw(t){let e=this._hierarchy.nodes.descendants(),n=[];e.shift(),e.forEach((t=>{this._orientation.norm(t)})),e.forEach((t=>{if(t.data&&t.data.spouse){const n=this.findSpouseById(t.data.spouse,e);if(this._orientation instanceof di||this._orientation instanceof pi){const e=t.y-n.y-this._orientation.boxHeight-this._orientation.yOffset/2;0!==e&&0===t.data.family&&(t.y-=e/2,n.y+=e/2)}else{const e=t.x-n.x-this._orientation.boxWidth-this._orientation.xOffset/2;0!==e&&0===t.data.family&&(t.x-=e/2,n.x+=e/2)}}}));const i=e.find((t=>t.children&&t.children.length>0));void 0!==i&&i.each((t=>{if(void 0!==t.data.spouse&&null!==t.data.spouse&&t.children&&t.children.length>=1){let e=0;e=this._orientation instanceof di||this._orientation instanceof pi?this._orientation.boxHeight/2+this._orientation.yOffset/4:this._orientation.boxWidth/2+this._orientation.xOffset/4,this.moveChildren(t,e)}})),e.forEach((t=>{const i=this.findSpouseById(t.data.spouse,e);if(void 0!==t.children&&t.children.length>0&&t.children.forEach((e=>{void 0!==e.data.spouse&&null!==e.data.spouse||n.push({spouse:i,source:t,target:e,coords:null})})),void 0!==i){let r=null;if(void 0!==i.data.spouses&&i.data.spouses.length>0){const n=i.data.spouses.indexOf(t.data.data.id),o=i.data.spouses.slice(0,n);o.length>0&&(r=[],o.forEach((t=>{const n=this.findSpouseById(Number(t),e);void 0!==n&&r.push({x:n.x,y:n.y})})))}null!==t.data.data&&n.push({spouse:i,source:t,target:null,coords:r})}})),this.drawLinks(n,t),this.drawNodes(e,t),e.forEach((t=>{t.x0=t.x,t.y0=t.y}))}findSpouseById(t,e){return e.find((e=>e.data.data.id===t))}moveChildren(t,e){t.each((n=>{n.depth!==t.depth&&(0!==t.data.family&&1===t.children.length&&void 0===n.children||(this._orientation instanceof di||this._orientation instanceof pi?n.y-=e:n.x-=e))}))}drawNodes(t,e){let n=0,i=this;this._svg.defs.get().append("clipPath").attr("id","clip-image").append("rect").attr("rx",this._box.image.rx).attr("ry",this._box.image.ry).attr("x",this._box.image.x).attr("y",this._box.image.y).attr("width",this._box.image.width).attr("height",this._box.image.height);const r=this._svg.visual.selectAll("g.person").data(t,(t=>t.id||(t.id=++n))).enter().append("g").append("g").attr("class",(t=>"person"+(t.data.spouse?" spouse":""))).attr("transform",(t=>"translate("+t.x+","+t.y+")"));r.append("rect").attr("class",(t=>"F"===t.data.data.sex?"female":"M"===t.data.data.sex?"male":"unknown")).attr("rx",this._box.rx).attr("ry",this._box.ry).attr("x",this._box.x).attr("y",this._box.y).attr("width",this._box.width).attr("height",this._box.height).attr("fill-opacity",.5),r.filter((t=>""!==t.data.data.xref)).each((function(t){let e=dt(this);i.drawText(e,t.data)}))}drawText(t,e){t.append("title").text(e.data.name);const n=this.getImageToLoad(e);if(this._box.showImage=!!n,this._box.showImage){let e=t.append("g").attr("class","image");e.append("rect").attr("rx",this._box.image.rx).attr("ry",this._box.image.ry).attr("x",this._box.image.x).attr("y",this._box.image.y).attr("width",this._box.image.width).attr("height",this._box.image.height).attr("fill","rgb(255, 255, 255)");let i=e.append("image").attr("x",this._box.image.x).attr("y",this._box.image.y).attr("width",this._box.image.width).attr("height",this._box.image.height).attr("clip-path","url(#clip-image)");(function(t,e=null){return fetch(t,e).then((t=>t.blob())).then((t=>new Promise(((e,n)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.onerror=n,i.readAsDataURL(t)}))))})(n).then((t=>i.attr("xlink:href",t))).catch((t=>{console.error(t)})),e.append("rect").attr("rx",this._box.image.rx).attr("ry",this._box.image.ry).attr("x",this._box.image.x).attr("y",this._box.image.y).attr("width",this._box.image.width).attr("height",this._box.image.height).attr("fill","none").attr("stroke","rgb(200, 200, 200)").attr("stroke-width",1.5)}this.addNames(t,e),this.addDates(t,e),this._box.showImage=!0}togglePerson(t,e){e.children?(e._children=e.children,e.children=null):(e.children=e._children,e._children=null),this.draw(e)}collapse(t){t.children&&(t._children=t.children,t._children.forEach((t=>this.collapse(t))),t.children=null)}addFirstNames(t,e){let n=0;for(let i of e.data.firstNames){let r=t.append("tspan").text(i);i===e.data.preferredName&&r.attr("class","preferred"),0!==n&&r.attr("dx","0.25em"),++n}}addLastNames(t,e,n=0){let i=0;for(let r of e.data.lastNames){let e=t.append("tspan").attr("class","lastName").text(r);0!==i&&e.attr("dx","0.25em"),0!==n&&e.attr("dx",n+"em"),++i}}truncateNames(t){let e=this._box.text.width;t.selectAll("tspan:not(.preferred):not(.lastName)").nodes().reverse().forEach((n=>dt(n).each(this.truncateText(t,e)))),t.selectAll("tspan.preferred").each(this.truncateText(t,e)),t.selectAll("tspan.lastName").each(this.truncateText(t,e))}truncateText(t,e){let n=this;return function(){let i=n.getTextLength(t),r=dt(this),o=r.text().split(/\s+/);for(let a=o.length-1;a>=0;--a)i>e&&(o[a]=o[a].slice(0,1)+".",r.text(o.join(" ")),i=n.getTextLength(t))}}truncateDate(t,e){let n=this;return function(){let i=n.getTextLength(t),r=dt(this),o=r.text();for(;i>e&&o.length>1;)o=o.slice(0,-1).trim(),r.text(o),i=n.getTextLength(t);"."===o[o.length-1]&&r.text(o.slice(0,-1).trim())}}getTextLength(t){let e=0;return t.selectAll("tspan").each((function(){e+=this.getComputedTextLength()})),e}addNames(t,e){let n=t.append("g").attr("class","name");if(this._orientation.splittNames){let t=n.append("text").attr("class","wt-chart-box-name").attr("text-anchor","middle").attr("alignment-baseline","central").attr("dy",this._box.text.y),i=n.append("text").attr("class","wt-chart-box-name").attr("text-anchor","middle").attr("alignment-baseline","central").attr("dy",this._box.text.y+20);this.addFirstNames(t,e),this.addLastNames(i,e),e.data.firstNames.length||e.data.lastNames.length||t.append("tspan").text(e.data.name),this.truncateNames(t),this.truncateNames(i)}else{let t=n.append("text").attr("class","wt-chart-box-name").attr("text-anchor",this._configuration.rtl?"end":"start").attr("dx",this._box.text.x).attr("dy",this._box.text.y);this.addFirstNames(t,e),this.addLastNames(t,e,.25),e.data.firstNames.length||e.data.lastNames.length||t.append("tspan").text(e.data.name),this.truncateNames(t)}}addDates(t,e){let n=t.append("g").attr("class","table");if(this._orientation.splittNames){let t=n.append("text").attr("class","date").attr("text-anchor","middle").attr("alignment-baseline","central").attr("dy",this._box.text.y+50);t.append("title").text(e.data.timespan);let i=t.append("tspan").text(e.data.timespan);return void(this.getTextLength(t)>this._box.text.width&&(t.selectAll("tspan").each(this.truncateDate(t,this._box.text.width)),i.text(i.text()+"…")))}let i=20;if(e.data.birth){n.append("text").attr("fill","currentColor").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x",this._box.text.x).attr("dy",this._box.text.y+i).append("tspan").text("★").attr("x",this._box.text.x+5);let t=n.append("text").attr("class","date").attr("text-anchor",this._configuration.rtl?"end":"start").attr("dominant-baseline","middle").attr("x",this._box.text.x).attr("dy",this._box.text.y+i);t.append("title").text(e.data.birth);let r=t.append("tspan").text(e.data.birth).attr("x",this._box.text.x+15);this.getTextLength(t)>this._box.text.width-25&&(t.selectAll("tspan").each(this.truncateDate(t,this._box.text.width-25)),r.text(r.text()+"…"))}if(e.data.death){e.data.birth&&(i+=20),n.append("text").attr("fill","currentColor").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x",this._box.text.x).attr("dy",this._box.text.y+i).append("tspan").text("†").attr("x",this._box.text.x+5);let t=n.append("text").attr("class","date").attr("text-anchor",this._configuration.rtl?"end":"start").attr("dominant-baseline","middle").attr("x",this._box.text.x).attr("dy",this._box.text.y+i);t.append("title").text(e.data.death);let r=t.append("tspan").text(e.data.death).attr("x",this._box.text.x+15);this.getTextLength(t)>this._box.text.width-25&&(t.selectAll("tspan").each(this.truncateDate(t,this._box.text.width-25)),r.text(r.text().trim()+"…"))}}getImageToLoad(t){return t.data.thumbnail?t.data.thumbnail:""}drawLinks(t,e){this._svg.visual.selectAll("path.link").data(t).enter().append("path").classed("link",!0).attr("d",(t=>this._orientation.elbow(t)))}}class bi{constructor(t){this._element=t.append("div").attr("class","overlay").style("opacity",1e-6)}show(t,e=0,n=null){this._element.select("p").remove(),this._element.append("p").attr("class","tooltip").text(t),this._element.transition().duration(e).style("opacity",1).on("end",(()=>{"function"==typeof n&&n()}))}hide(t=0,e=0){this._element.transition().delay(t).duration(e).style("opacity",1e-6)}get(){return this._element}}class ki{constructor(t){this._element=t.append("defs")}get(){return this._element}}class Mi{constructor(t){this._zoom=null,this._parent=t,this.init()}init(){this._zoom=In(),this._zoom.scaleExtent([.1,20]).on("zoom",(t=>{this._parent.attr("transform",t.transform)})),this._zoom.wheelDelta((t=>-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002))),this._zoom.filter((t=>{if("wheel"===t.type){if(!t.ctrlKey)return!1;const e=Nn(this);if(e.k){if(e.k<=.1&&t.deltaY>0)return t.preventDefault(),!1;if(e.k>=20&&t.deltaY<0)return t.preventDefault(),!1}return!0}return t.button||"touchstart"!==t.type?!(t.ctrlKey&&"wheel"!==t.type||t.button):2===t.touches.length}))}get(){return this._zoom}}class Ai{triggerDownload(t,e){let n=new MouseEvent("click",{view:window,bubbles:!1,cancelable:!0}),i=document.createElement("a");i.setAttribute("download",e),i.setAttribute("href",t),i.setAttribute("target","_blank"),i.dispatchEvent(n)}}class $i extends Ai{copyStylesInline(t,e){let n=["svg","g","text","textPath"];for(let i=0;i{let r=(new XMLSerializer).serializeToString(t),o=window.URL||window.webkitURL||window,a=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),s=o.createObjectURL(a),h=new Image;h.onload=()=>{let t=this.createCanvas(e,n),r=t.getContext("2d");r.fillStyle="rgb(255,255,255)",r.fillRect(0,0,t.width,t.height),r.drawImage(h,0,0),o.revokeObjectURL(s);let a=t.toDataURL("image/png").replace("image/png","image/octet-stream");i(a)},h.src=s}))}cloneSvg(t){return new Promise((e=>{e(t.cloneNode(!0))}))}svgToImage(t,e){const n=[4960,3508];this.cloneSvg(t.get().node()).then((e=>{this.copyStylesInline(t.get().node(),e);const i=this.calculateViewBox(t.get().node()),r=Math.max(n[0],i[2]),o=Math.max(n[1],i[3]);return e.setAttribute("width",""+r),e.setAttribute("height",""+o),e.setAttribute("viewBox",""+i),this.convertToDataUrl(e,r,o)})).then((t=>this.triggerDownload(t,e))).catch((()=>{console.log("Failed to save chart as PNG image")}))}}class Ni extends Ai{copyStylesInline(t,e){return new Promise((n=>{Promise.all(t.map((t=>function(t,e){return fetch(t,e).then(ri)}(t)))).then((t=>{t.forEach((t=>{t=t.replace(/#webtrees-descendants-chart-container /g,"");let n=document.createElementNS("http://www.w3.org/2000/svg","style");n.appendChild(document.createTextNode(t)),e.prepend(n)})),n(e)}))}))}convertToObjectUrl(t){return new Promise((e=>{let n=(new XMLSerializer).serializeToString(t),i=window.URL||window.webkitURL||window,r=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),o=i.createObjectURL(r),a=new Image;a.onload=()=>{e(o)},a.src=o}))}cloneSvg(t){return new Promise((e=>{e(t.cloneNode(!0))}))}svgToImage(t,e,n){this.cloneSvg(t.get().node()).then((t=>this.copyStylesInline(e,t))).then((t=>this.convertToObjectUrl(t))).then((t=>this.triggerDownload(t,n))).catch((()=>{console.log("Failed to save chart as SVG image")}))}}class Ti{constructor(){this._exportClass=null}setExportClass(t){switch(t){case"png":this._exportClass=$i;break;case"svg":this._exportClass=Ni}}createExport(t){switch(this.setExportClass(t),t){case"png":case"svg":return new this._exportClass}}}class zi{constructor(t,e){this._element=t.append("svg"),this._defs=new ki(this._element),this._visual=null,this._zoom=null,this._configuration=e,this.init()}init(){this._element.attr("class","wt-global").attr("width","100%").attr("height","100%").attr("text-rendering","optimizeLegibility").attr("text-anchor","middle").attr("xmlns:xlink","https://www.w3.org/1999/xlink")}initEvents(t){this._element.on("contextmenu",(t=>t.preventDefault())).on("wheel",(e=>{e.ctrlKey||t.show(this._configuration.labels.zoom,300,(()=>{t.hide(200,600)}))})).on("touchend",(e=>{e.touches.length<2&&t.hide(0,600)})).on("touchmove",(e=>{e.touches.length>=2?t.hide():t.show(this._configuration.labels.move)})).on("click",(t=>this.doStopPropagation(t)),!0),this._configuration.rtl&&this._element.classed("rtl",!0),this._visual=this._element.append("g"),this._zoom=new Mi(this._visual),this._element.call(this._zoom.get())}doStopPropagation(t){t.defaultPrevented&&t.stopPropagation()}export(t){return(new Ti).createExport(t)}get defs(){return this._defs}get zoom(){return this._zoom}get visual(){return this._visual}get(){return this._element}}class Ei{constructor(t,e){this._configuration=e,this._parent=t,this._hierarchy=new mi(this._configuration),this._data={}}get svg(){return this._svg}updateViewBox(){let t=this._svg.visual.node().getBBox(),e=this._parent.node().getBoundingClientRect(),n=Math.max(e.width,t.width),i=Math.max(e.height,t.height,300),r=(n-t.width)/2,o=(i-t.height)/2,a=Math.ceil(t.x-r-10),s=Math.ceil(t.y-o-10);n=Math.ceil(n+20),i=Math.ceil(i+20),this._svg.get().attr("viewBox",[a,s,n,i])}get data(){return this._data}set data(t){this._data=t,this._hierarchy.init(this._data)}draw(){this._parent.html(""),this._svg=new zi(this._parent,this._configuration),this._overlay=new bi(this._parent),this._svg.initEvents(this._overlay),new wi(this._svg,this._configuration,this._hierarchy),this.bindClickEventListener(),this.updateViewBox()}bindClickEventListener(){let t=this;this._svg.visual.selectAll("g.person").filter((t=>""!==t.data.data.xref)).each((function(e){dt(this).on("click",(function(){t.personClick(e.data)}))}))}personClick(t){1===t.data.generation?this.redirectToIndividual(t.data.url):this.update(t.data.updateUrl)}redirectToIndividual(t){window.open(t,"_blank")}update(t){window.location=t}}t.DescendantsChart=class{constructor(t,e){this._selector=t,this._parent=dt(this._selector),this._configuration=new _i(e.labels,e.generations,e.treeLayout,e.rtl),this._chart=new Ei(this._parent,this._configuration),this._cssFiles=[],this.init()}init(){dt("#centerButton").on("click",(()=>this.center())),dt("#exportPNG").on("click",(()=>this.exportPNG())),dt("#exportSVG").on("click",(()=>this.exportSVG()))}center(){this._chart.svg.get().transition().duration(750).call(this._chart.svg.zoom.get().transform,$n)}get configuration(){return this._configuration}set cssFiles(t){this._cssFiles=t}update(t){this._chart.update(t)}draw(t){this._chart.data=t,this._chart.draw()}exportPNG(){this._chart.svg.export("png").svgToImage(this._chart.svg,"descendants-chart.png")}exportSVG(){this._chart.svg.export("svg").svgToImage(this._chart.svg,this._cssFiles,"descendants-chart.svg")}},Object.defineProperty(t,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WebtreesDescendantsChart={}); +var t,e;t=this,e=function(t){function e(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function n(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function i(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=o)):void 0===e&&(e=r);for(var n,i,a,u,l,c=new h(t),f=[c];n=f.pop();)if((a=e(n.data))&&(l=(a=Array.from(a)).length))for(n.children=a,u=l-1;u>=0;--u)f.push(i=a[u]=new h(a[u])),i.parent=n,i.depth=n.depth+1;return c.eachBefore(s)}function r(t){return t.children}function o(t){return Array.isArray(t)?t[1]:null}function a(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function s(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function h(t){this.data=t,this.depth=this.height=0,this.parent=null}function u(t,e){return t.parent===e.parent?1:2}function l(t){var e=t.children;return e?e[0]:t.t}function c(t){var e=t.children;return e?e[e.length-1]:t.t}function f(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function d(t,e,n){return t.a.parent===e.parent?t.a:n}function p(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function g(){var t=u,e=1,n=1,i=null;function r(r){var h=function(t){for(var e,n,i,r,o,a=new p(t,0),s=[a];e=s.pop();)if(i=e._.children)for(e.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=e.children[r]=new p(i[r],r)),n.parent=e;return(a.parent=new p(null,0)).children=[a],a}(r);if(h.eachAfter(o),h.parent.m=-h.z,h.eachBefore(a),i)r.eachBefore(s);else{var u=r,l=r,c=r;r.eachBefore((function(t){t.xl.x&&(l=t),t.depth>c.depth&&(c=t)}));var f=u===l?1:t(u,l)/2,d=f-u.x,g=e/(l.x+f+d),_=n/(c.depth||1);r.eachBefore((function(t){t.x=(t.x+d)*g,t.y=t.depth*_}))}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,a=e,s=n,h=o.parent.children[0],u=o.m,p=a.m,g=s.m,_=h.m;s=c(s),o=l(o),s&&o;)h=l(h),(a=c(a)).a=e,(r=s.z+g-o.z-u+t(s._,o._))>0&&(f(d(s,e,i),e,r),u+=r,p+=r),g+=s.m,u+=o.m,_+=h.m,p+=a.m;s&&!c(a)&&(a.t=s,a.m+=g-p),o&&!l(h)&&(h.t=o,h.m+=u-_,i=e)}return i}(e,r,e.parent.A||i[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r}h.prototype=i.prototype={constructor:h,count:function(){return this.eachAfter(n)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],h=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return i(this).eachBefore(a)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n=0))throw new Error(`invalid digits: ${t}`);if(e>15)return x;const n=10**e;return function(t){this._+=t[0];for(let e=1,i=t.length;ey)if(Math.abs(l*s-h*u)>y&&r){let f=n-o,d=i-a,p=s*s+h*h,g=f*f+d*d,m=Math.sqrt(p),v=Math.sqrt(c),x=r*Math.tan((_-Math.acos((p+c-g)/(2*m*v)))/2),w=x/v,b=x/m;Math.abs(w-1)>y&&this._append`L${t+w*u},${e+w*l}`,this._append`A${r},${r},0,0,${+(l*f>u*d)},${this._x1=t+b*s},${this._y1=e+b*h}`}else this._append`L${this._x1=t},${this._y1=e}`}arc(t,e,n,i,r,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(i),s=n*Math.sin(i),h=t+a,u=e+s,l=1^o,c=o?i-r:r-i;null===this._x1?this._append`M${h},${u}`:(Math.abs(this._x1-h)>y||Math.abs(this._y1-u)>y)&&this._append`L${h},${u}`,n&&(c<0&&(c=c%m+m),c>v?this._append`A${n},${n},0,1,${l},${t-a},${e-s}A${n},${n},0,1,${l},${this._x1=h},${this._y1=u}`:c>y&&this._append`A${n},${n},0,${+(c>=_)},${l},${this._x1=t+n*Math.cos(r)},${this._y1=e+n*Math.sin(r)}`)}rect(t,e,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function b(){return new w}b.prototype=w.prototype;var k="http://www.w3.org/1999/xhtml",M={svg:"http://www.w3.org/2000/svg",xhtml:k,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function A(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),M.hasOwnProperty(e)?{space:M[e],local:t}:t}function $(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===k&&e.documentElement.namespaceURI===k?e.createElement(t):e.createElementNS(n,t)}}function N(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function T(t){var e=A(t);return(e.local?N:$)(e)}function z(){}function E(t){return null==t?z:function(){return this.querySelector(t)}}function S(){return[]}function P(t){return null==t?S:function(){return this.querySelectorAll(t)}}function C(t){return function(){return null==(e=t.apply(this,arguments))?[]:Array.isArray(e)?e:Array.from(e);var e}}function L(t){return function(){return this.matches(t)}}function O(t){return function(e){return e.matches(t)}}var I=Array.prototype.find;function R(){return this.firstElementChild}var B=Array.prototype.filter;function H(){return Array.from(this.children)}function D(t){return new Array(t.length)}function W(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function X(t,e,n,i,r,o){for(var a,s=0,h=e.length,u=o.length;se?1:t>=e?0:NaN}function j(t){return function(){this.removeAttribute(t)}}function G(t){return function(){this.removeAttributeNS(t.space,t.local)}}function F(t,e){return function(){this.setAttribute(t,e)}}function K(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Q(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Z(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function J(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function tt(t){return function(){this.style.removeProperty(t)}}function et(t,e,n){return function(){this.style.setProperty(t,e,n)}}function nt(t,e,n){return function(){var i=e.apply(this,arguments);null==i?this.style.removeProperty(t):this.style.setProperty(t,i,n)}}function it(t,e){return t.style.getPropertyValue(e)||J(t).getComputedStyle(t,null).getPropertyValue(e)}function rt(t){return function(){delete this[t]}}function ot(t,e){return function(){this[t]=e}}function at(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function st(t){return t.trim().split(/^|\s+/)}function ht(t){return t.classList||new ut(t)}function ut(t){this._node=t,this._names=st(t.getAttribute("class")||"")}function lt(t,e){for(var n=ht(t),i=-1,r=e.length;++i=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Pt=[null];function Ct(t,e){this._groups=t,this._parents=e}function Lt(){return new Ct([[document.documentElement]],Pt)}function Ot(t){return"string"==typeof t?new Ct([[document.querySelector(t)]],[document.documentElement]):new Ct([[t]],Pt)}function It(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,[(i=i.matrixTransform(e.getScreenCTM().inverse())).x,i.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}Ct.prototype=Lt.prototype={constructor:Ct,select:function(t){"function"!=typeof t&&(t=E(t));for(var e=this._groups,n=e.length,i=new Array(n),r=0;r=w&&(w=x+1);!(v=m[w])&&++w=0;)(i=r[o])&&(a&&4^i.compareDocumentPosition(a)&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=U);for(var n=this._groups,i=n.length,r=new Array(i),o=0;o1?this.each((null==e?tt:"function"==typeof e?nt:et)(t,e,null==n?"":n)):it(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?rt:"function"==typeof e?at:ot)(t,e)):this.node()[t]},classed:function(t,e){var n=st(t+"");if(arguments.length<2){for(var i=ht(this.node()),r=-1,o=n.length;++r=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?Tt:Nt,i=0;i{}};function Bt(){for(var t,e=0,n=arguments.length,i={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!i.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var n,i,r=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--Yt}()}finally{Yt=0,function(){for(var t,e,n=Xt,i=1/0;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Xt=e);qt=t,oe(i)}(),Ft=0}}function re(){var t=Qt.now(),e=t-Gt;e>jt&&(Kt-=e,Gt=t)}function oe(t){Yt||(Vt&&(Vt=clearTimeout(Vt)),t-Ft>24?(t<1/0&&(Vt=setTimeout(ie,t-Qt.now()-Kt)),Ut&&(Ut=clearInterval(Ut))):(Ut||(Gt=Qt.now(),Ut=setInterval(re,jt)),Yt=1,Zt(ie)))}function ae(t,e,n){var i=new ee;return e=null==e?0:+e,i.restart((n=>{i.stop(),t(n+e)}),e,n),i}ee.prototype=ne.prototype={constructor:ee,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Jt():+n)+(null==e?0:+e),this._next||qt===this||(qt?qt._next=this:Xt=this,qt=this),this._call=t,this._time=n,oe()},stop:function(){this._call&&(this._call=null,this._time=1/0,oe())}};var se=Bt("start","end","cancel","interrupt"),he=[],ue=0,le=1,ce=2,fe=3,de=4,pe=5,ge=6;function _e(t,e,n,i,r,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var i,r=t.__transition;function o(t){n.state=le,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(o){var u,l,c,f;if(n.state!==le)return h();for(u in r)if((f=r[u]).name===n.name){if(f.state===fe)return ae(a);f.state===de?(f.state=ge,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete r[u]):+uue)throw new Error("too late; already scheduled");return n}function ye(t,e){var n=ve(t,e);if(n.state>fe)throw new Error("too late; already running");return n}function ve(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function xe(t,e){var n,i,r,o=t.__transition,a=!0;if(o){for(r in e=null==e?null:e+"",o)(n=o[r]).name===e?(i=n.state>ce&&n.state>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?We(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?We(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ee.exec(t))?new qe(e[1],e[2],e[3],1):(e=Se.exec(t))?new qe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Pe.exec(t))?We(e[1],e[2],e[3],e[4]):(e=Ce.exec(t))?We(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Le.exec(t))?Fe(e[1],e[2]/100,e[3]/100,1):(e=Oe.exec(t))?Fe(e[1],e[2]/100,e[3]/100,e[4]):Ie.hasOwnProperty(t)?De(Ie[t]):"transparent"===t?new qe(NaN,NaN,NaN,0):null}function De(t){return new qe(t>>16&255,t>>8&255,255&t,1)}function We(t,e,n,i){return i<=0&&(t=e=n=NaN),new qe(t,e,n,i)}function Xe(t,e,n,i){return 1===arguments.length?((r=t)instanceof ke||(r=He(r)),r?new qe((r=r.rgb()).r,r.g,r.b,r.opacity):new qe):new qe(t,e,n,null==i?1:i);var r}function qe(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Ye(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}`}function Ve(){const t=Ue(this.opacity);return`${1===t?"rgb(":"rgba("}${je(this.r)}, ${je(this.g)}, ${je(this.b)}${1===t?")":`, ${t})`}`}function Ue(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function je(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ge(t){return((t=je(t))<16?"0":"")+t.toString(16)}function Fe(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Qe(t,e,n,i)}function Ke(t){if(t instanceof Qe)return new Qe(t.h,t.s,t.l,t.opacity);if(t instanceof ke||(t=He(t)),!t)return new Qe;if(t instanceof Qe)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,h=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n0&&h<1?0:a,new Qe(a,s,h,t.opacity)}function Qe(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Ze(t){return(t=(t||0)%360)<0?t+360:t}function Je(t){return Math.max(0,Math.min(1,t||0))}function tn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}we(ke,He,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ke(this).formatHsl()},formatRgb:Be,toString:Be}),we(qe,Xe,be(ke,{brighter(t){return t=null==t?Ae:Math.pow(Ae,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Me:Math.pow(Me,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new qe(je(this.r),je(this.g),je(this.b),Ue(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ye,formatHex:Ye,formatHex8:function(){return`#${Ge(this.r)}${Ge(this.g)}${Ge(this.b)}${Ge(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ve,toString:Ve})),we(Qe,(function(t,e,n,i){return 1===arguments.length?Ke(t):new Qe(t,e,n,null==i?1:i)}),be(ke,{brighter(t){return t=null==t?Ae:Math.pow(Ae,t),new Qe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Me:Math.pow(Me,t),new Qe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new qe(tn(t>=240?t-240:t+120,r,i),tn(t,r,i),tn(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Qe(Ze(this.h),Je(this.s),Je(this.l),Ue(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ue(this.opacity);return`${1===t?"hsl(":"hsla("}${Ze(this.h)}, ${100*Je(this.s)}%, ${100*Je(this.l)}%${1===t?")":`, ${t})`}`}}));var en=t=>()=>t;function nn(t){return 1==(t=+t)?rn:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):en(isNaN(e)?n:e)}}function rn(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):en(isNaN(t)?e:t)}var on=function t(e){var n=nn(e);function i(t,e){var i=n((t=Xe(t)).r,(e=Xe(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=rn(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function an(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var sn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hn=new RegExp(sn.source,"g");function un(t,e){var n,i,r,o=sn.lastIndex=hn.lastIndex=0,a=-1,s=[],h=[];for(t+="",e+="";(n=sn.exec(t))&&(i=hn.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,h.push({i:a,x:an(n,i)})),o=hn.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(r(n)+"rotate(",null,i)-2,x:an(t,e)})):e&&n.push(r(n)+"rotate("+e+i)}(o.rotate,a.rotate,s,h),function(t,e,n,o){t!==e?o.push({i:n.push(r(n)+"skewX(",null,i)-2,x:an(t,e)}):e&&n.push(r(n)+"skewX("+e+i)}(o.skewX,a.skewX,s,h),function(t,e,n,i,o,a){if(t!==n||e!==i){var s=o.push(r(o)+"scale(",null,",",null,")");a.push({i:s-4,x:an(t,n)},{i:s-2,x:an(e,i)})}else 1===n&&1===i||o.push(r(o)+"scale("+n+","+i+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,h),o=a=null,function(t){for(var e,n=-1,i=h.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?me:ye;return function(){var a=o(this,t),s=a.on;s!==i&&(r=(i=s).copy()).on(e,n),a.on=r}}(n,t,e))},attr:function(t,e){var n=A(t),i="transform"===n?_n:bn;return this.attrTween(t,"function"==typeof e?(n.local?Tn:Nn)(n,i,wn(this,"attr."+t,e)):null==e?(n.local?Mn:kn)(n):(n.local?$n:An)(n,i,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var i=A(t);return this.tween(n,(i.local?zn:En)(i,e))},style:function(t,e,n){var i="transform"==(t+="")?gn:bn;return null==e?this.styleTween(t,function(t,e){var n,i,r;return function(){var o=it(this,t),a=(this.style.removeProperty(t),it(this,t));return o===a?null:o===n&&a===i?r:r=e(n=o,i=a)}}(t,i)).on("end.style."+t,In(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var i,r,o;return function(){var a=it(this,t),s=n(this),h=s+"";return null==s&&(this.style.removeProperty(t),h=s=it(this,t)),a===h?null:a===i&&h===r?o:(r=h,o=e(i=a,s))}}(t,i,wn(this,"style."+t,e))).each(function(t,e){var n,i,r,o,a="style."+e,s="end."+a;return function(){var h=ye(this,t),u=h.on,l=null==h.value[a]?o||(o=In(e)):void 0;u===n&&r===l||(i=(n=u).copy()).on(s,r=l),h.on=i}}(this._id,t)):this.styleTween(t,function(t,e,n){var i,r,o=n+"";return function(){var a=it(this,t);return a===o?null:a===i?r:r=e(i=a,n)}}(t,i,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var i="style."+(t+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==e)return this.tween(i,null);if("function"!=typeof e)throw new Error;return this.tween(i,function(t,e,n){var i,r;function o(){var o=e.apply(this,arguments);return o!==r&&(i=(r=o)&&function(t,e,n){return function(i){this.style.setProperty(t,e.call(this,i),n)}}(t,o,n)),i}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(wn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function i(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&function(t){return function(e){this.textContent=t.call(this,e)}}(i)),e}return i._value=t,i}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var i,r=ve(this.node(),n).tween,o=0,a=r.length;o()=>t;function Un(t,{sourceEvent:e,target:n,transform:i,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:r}})}function jn(t,e,n){this.k=t,this.x=e,this.y=n}jn.prototype={constructor:jn,scale:function(t){return 1===t?this:new jn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new jn(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Gn=new jn(1,0,0);function Fn(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Gn;return t.__zoom}function Kn(t){t.stopImmediatePropagation()}function Qn(t){t.preventDefault(),t.stopImmediatePropagation()}function Zn(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Jn(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function ti(){return this.__zoom||Gn}function ei(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function ni(){return navigator.maxTouchPoints||"ontouchstart"in this}function ii(t,e,n){var i=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(r>i?(i+r)/2:Math.min(0,i)||Math.max(0,r),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function ri(){var t,e,n,i=Zn,r=Jn,o=ii,a=ei,s=ni,h=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,c=yn,f=Bt("start","zoom","end"),d=500,p=150,g=0,_=10;function m(t){t.property("__zoom",ti).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",$).filter(s).on("touchstart.zoom",N).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(t,e){return(e=Math.max(h[0],Math.min(h[1],e)))===t.k?t:new jn(e,t.x,t.y)}function v(t,e,n){var i=e[0]-n[0]*t.k,r=e[1]-n[1]*t.k;return i===t.x&&r===t.y?t:new jn(t.k,i,r)}function x(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,e,n,i){t.on("start.zoom",(function(){b(this,arguments).event(i).start()})).on("interrupt.zoom end.zoom",(function(){b(this,arguments).event(i).end()})).tween("zoom",(function(){var t=this,o=arguments,a=b(t,o).event(i),s=r.apply(t,o),h=null==n?x(s):"function"==typeof n?n.apply(t,o):n,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),l=t.__zoom,f="function"==typeof e?e.apply(t,o):e,d=c(l.invert(h).concat(u/l.k),f.invert(h).concat(u/f.k));return function(t){if(1===t)t=f;else{var e=d(t),n=u/e[2];t=new jn(n,h[0]-e[0]*n,h[1]-e[1]*n)}a.zoom(null,t)}}))}function b(t,e,n){return!n&&t.__zooming||new k(t,e)}function k(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=r.apply(t,e),this.taps=0}function M(t,...e){if(i.apply(this,arguments)){var n=b(this,e).event(t),r=this.__zoom,s=Math.max(h[0],Math.min(h[1],r.k*Math.pow(2,a.apply(this,arguments)))),l=It(t);if(n.wheel)n.mouse[0][0]===l[0]&&n.mouse[0][1]===l[1]||(n.mouse[1]=r.invert(n.mouse[0]=l)),clearTimeout(n.wheel);else{if(r.k===s)return;n.mouse=[l,r.invert(l)],xe(this),n.start()}Qn(t),n.wheel=setTimeout((function(){n.wheel=null,n.end()}),p),n.zoom("mouse",o(v(y(r,s),n.mouse[0],n.mouse[1]),n.extent,u))}}function A(t,...e){if(!n&&i.apply(this,arguments)){var r=t.currentTarget,a=b(this,e,!0).event(t),s=Ot(t.view).on("mousemove.zoom",(function(t){if(Qn(t),!a.moved){var e=t.clientX-l,n=t.clientY-c;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",o(v(a.that.__zoom,a.mouse[0]=It(t,r),a.mouse[1]),a.extent,u))}),!0).on("mouseup.zoom",(function(t){s.on("mousemove.zoom mouseup.zoom",null),function(t,e){var n=t.document.documentElement,i=Ot(t).on("dragstart.drag",null);e&&(i.on("click.drag",Yn,qn),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}(t.view,a.moved),Qn(t),a.event(t).end()}),!0),h=It(t,r),l=t.clientX,c=t.clientY;!function(t){var e=t.document.documentElement,n=Ot(t).on("dragstart.drag",Yn,qn);"onselectstart"in e?n.on("selectstart.drag",Yn,qn):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}(t.view),Kn(t),a.mouse=[h,this.__zoom.invert(h)],xe(this),a.start()}}function $(t,...e){if(i.apply(this,arguments)){var n=this.__zoom,a=It(t.changedTouches?t.changedTouches[0]:t,this),s=n.invert(a),h=n.k*(t.shiftKey?.5:2),c=o(v(y(n,h),a,s),r.apply(this,e),u);Qn(t),l>0?Ot(this).transition().duration(l).call(w,c,a,t):Ot(this).call(m.transform,c,a,t)}}function N(n,...r){if(i.apply(this,arguments)){var o,a,s,h,u=n.touches,l=u.length,c=b(this,r,n.changedTouches.length===l).event(n);for(Kn(n),a=0;a=0&&(o-=hi(t,e)),null===t.coords&&(n.moveTo(t.spouse.x+r,o),n.lineTo(t.source.x-r,o)),t.coords&&t.coords.length>0){for(let e=0;e0&&(a=t.coords[e-1].x+r);let h=e>0?i:0,u=e+1<=t.coords.length?i:0;n.moveTo(a+h,o),n.lineTo(s-u,o)}n.moveTo(t.coords[t.coords.length-1].x+r+i,o),n.lineTo(t.source.x-r,o)}return n.toString()}(t,e)}function hi(t,e){return(t.source.data.family-Math.ceil(t.spouse.data.spouses.length/2))*e.direction()*5}class ui extends ai{constructor(t,e){super(t,e),this._splittNames=!0}direction(){return 1}get nodeWidth(){return 2*this._boxWidth+this._yOffset}norm(t){t.y=this.direction()*t.depth*(this._boxHeight+this._yOffset)}elbow(t){return si(t,this)}}class li extends ai{constructor(t,e){super(t,e),this._splittNames=!0}direction(){return-1}get nodeWidth(){return 2*this._boxWidth+this._yOffset}norm(t){t.y=this.direction()*t.depth*(this._boxHeight+this._yOffset)}elbow(t){return si(t,this)}}function ci(t,e){const n=e.xOffset/2,i=e.yOffset/2;let r=t.source.x,o=t.source.y;if(void 0!==t.spouse&&0===t.source.data.family?(r-=fi(t,e),o-=(t.source.y-t.spouse.y)/2):r+=e.boxWidth/2*e.direction(),null===t.source.data.data&&(r+=e.boxWidth/2*e.direction(),o-=e.boxHeight/2+i/2),null!==t.target){let i=t.target.x-e.direction()*(e.boxWidth/2+n),a=t.target.y;const s=b();return s.moveTo(r,o),s.lineTo(i,o),s.lineTo(i,a),s.lineTo(i+e.direction()*n,a),s.toString()}return function(t,e){const n=b(),i=2,r=e.boxHeight/2;let o=t.source.x;if(t.spouse.data.spouses.length>=0&&(o-=fi(t,e)),null===t.coords&&(n.moveTo(o,t.spouse.y+r),n.lineTo(o,t.source.y-r)),t.coords&&t.coords.length>0){for(let e=0;e0&&(a=t.coords[e-1].y+r);let h=e>0?i:0,u=e+1<=t.coords.length?i:0;n.moveTo(o,a+h),n.lineTo(o,s-u)}n.moveTo(o,t.coords[t.coords.length-1].y+r+i),n.lineTo(o,t.source.y-r)}return n.toString()}(t,e)}function fi(t,e){return(t.source.data.family-Math.ceil(t.spouse.data.spouses.length/2))*e.direction()*5}class di extends ai{constructor(t,e){super(t,e),this._xOffset=40,this._yOffset=40}direction(){return 1}get nodeWidth(){return 2*this._boxHeight+this._xOffset}norm(t){t.y=t.x,t.x=this.direction()*t.depth*(this._boxWidth+this._xOffset)}elbow(t){return ci(t,this)}}class pi extends ai{constructor(t,e){super(t,e),this._xOffset=40,this._yOffset=40}direction(){return-1}get nodeWidth(){return 2*this._boxHeight+this._xOffset}norm(t){t.y=t.x,t.x=this.direction()*t.depth*(this._boxWidth+this._xOffset)}elbow(t){return ci(t,this)}}class gi{constructor(){this._orientations={down:new ui(150,175),up:new li(150,175),[oi]:new di(300,80),left:new pi(300,80)}}get(){return this._orientations}}class _i{constructor(t,e=4,n=oi,i=!1,r=1){this._treeLayout=n,this._orientations=new gi,this.duration=750,this.padding=15,this.imagePadding=5,this._generations=e,this.textPadding=8,this._fontSize=14,this.fontColor="rgb(0, 0, 0)",this.rtl=i,this.labels=t,this.direction=r}get generations(){return this._generations}set generations(t){this._generations=t}get treeLayout(){return this._treeLayout}set treeLayout(t){this._treeLayout=t}get orientation(){return this._orientations.get()[this.treeLayout]}}class mi{constructor(t){this._configuration=t,this._nodes=null,this._root=null}init(t){let e=i(t);const n=g().nodeSize([this._configuration.orientation.nodeWidth,0]).separation(((t,e)=>this.separation(t,e)));this._root=e,this._nodes=n(e)}separation(t,e){return void 0!==t.data.spouses||void 0!==e.data.spouse?.75:t.parent===e.parent?.5:1}get nodes(){return this._nodes}get root(){return this._root}}class yi{constructor(t,e=null){this._orientation=t,this._image=e,this._textPadding=15,this._x=this.calculateX(),this._y=this.calculateY(),this._width=this.calculateWidth()}calculateX(){const t=-this._orientation.boxWidth/2+this._textPadding;return this._image?t+this._image.width:t}calculateY(){return this._orientation instanceof di||this._orientation instanceof pi?-this._textPadding:this._image?this._image.y+this._image.height+2*this._textPadding:-this._orientation.boxHeight/2+2*this._textPadding}calculateWidth(){const t=this._orientation.boxWidth-2*this._textPadding;return this._image&&(this._orientation instanceof di||this._orientation instanceof pi)?t-this._image.width:t}get x(){return this._x}get y(){return this._y}get width(){return this._width}}class vi{constructor(t){this._cornerRadius=20,this._showImage=!0,this._orientation=t,this._x=-t.boxWidth/2,this._y=-t.boxHeight/2,this._rx=this._cornerRadius,this._ry=this._cornerRadius,this._width=t.boxWidth,this._height=t.boxHeight,this._image=new class{constructor(t,e){this._orientation=t,this._cornerRadius=e,this._imagePadding=5,this._imageRadius=Math.min(40,t.boxHeight/2-this._imagePadding),this._x=this.calculateX(),this._y=this.calculateY(),this._width=this.calculateImageWidth(),this._height=this.calculateImageHeight(),this._rx=this.calculateCornerRadius(),this._ry=this.calculateCornerRadius()}calculateX(){return-this._orientation.boxWidth/2+this._imagePadding}calculateY(){return this._orientation instanceof di||this._orientation instanceof pi?-this._imageRadius:-this._orientation.boxHeight/2+this._imagePadding}calculateImageWidth(){return this._orientation instanceof di||this._orientation instanceof pi?2*this._imageRadius:this._orientation.boxWidth-2*this._imagePadding}calculateImageHeight(){return 2*this._imageRadius}calculateCornerRadius(){return this._cornerRadius-this._imagePadding}get imagePadding(){return this._imagePadding}get imageRadius(){return this._imageRadius}set imageRadius(t){this._imageRadius=t}get x(){return this._x}get y(){return this._y}get rx(){return this._rx}get ry(){return this._ry}get width(){return this._width}get height(){return this._height}}(t,this._cornerRadius)}get showImage(){return this._showImage}set showImage(t){this._showImage=t}get x(){return this._x}get y(){return this._y}get rx(){return this._rx}get ry(){return this._ry}get width(){return this._width}get height(){return this._height}get image(){return this._image}get text(){return new yi(this._orientation,this._showImage?this._image:null)}}class xi{constructor(t,e,n){this._svg=t,this._configuration=e,this._hierarchy=n,this._hierarchy.root.x0=0,this._hierarchy.root.y0=0,this._orientation=this._configuration.orientation,this._box=new vi(this._orientation),this.draw(this._hierarchy.root)}draw(t){let e=this._hierarchy.nodes.descendants(),n=[];e.shift(),e.forEach((t=>{this._orientation.norm(t)})),e.forEach((t=>{if(t.data&&t.data.spouse){const n=this.findSpouseById(t.data.spouse,e);if(this._orientation instanceof di||this._orientation instanceof pi){const e=t.y-n.y-this._orientation.boxHeight-this._orientation.yOffset/2;0!==e&&0===t.data.family&&(t.y-=e/2,n.y+=e/2)}else{const e=t.x-n.x-this._orientation.boxWidth-this._orientation.xOffset/2;0!==e&&0===t.data.family&&(t.x-=e/2,n.x+=e/2)}}}));const i=e.find((t=>t.children&&t.children.length>0));void 0!==i&&i.each((t=>{if(void 0!==t.data.spouse&&null!==t.data.spouse&&t.children&&t.children.length>=1){let e=0;e=this._orientation instanceof di||this._orientation instanceof pi?this._orientation.boxHeight/2+this._orientation.yOffset/4:this._orientation.boxWidth/2+this._orientation.xOffset/4,this.moveChildren(t,e)}})),e.forEach((t=>{const i=this.findSpouseById(t.data.spouse,e);if(void 0!==t.children&&t.children.length>0&&t.children.forEach((e=>{void 0!==e.data.spouse&&null!==e.data.spouse||n.push({spouse:i,source:t,target:e,coords:null})})),void 0!==i){let r=null;if(void 0!==i.data.spouses&&i.data.spouses.length>0){const n=i.data.spouses.indexOf(t.data.data.id),o=i.data.spouses.slice(0,n);o.length>0&&(r=[],o.forEach((t=>{const n=this.findSpouseById(Number(t),e);void 0!==n&&r.push({x:n.x,y:n.y})})))}null!==t.data.data&&n.push({spouse:i,source:t,target:null,coords:r})}})),this.drawLinks(n,t),this.drawNodes(e,t),e.forEach((t=>{t.x0=t.x,t.y0=t.y}))}findSpouseById(t,e){return e.find((e=>e.data.data.id===t))}moveChildren(t,e){t.each((n=>{n.depth!==t.depth&&(0!==t.data.family&&1===t.children.length&&void 0===n.children||(this._orientation instanceof di||this._orientation instanceof pi?n.y-=e:n.x-=e))}))}drawNodes(t,e){let n=0,i=this;this._svg.defs.get().append("clipPath").attr("id","clip-image").append("rect").attr("rx",this._box.image.rx).attr("ry",this._box.image.ry).attr("x",this._box.image.x).attr("y",this._box.image.y).attr("width",this._box.image.width).attr("height",this._box.image.height);const r=this._svg.visual.selectAll("g.person").data(t,(t=>t.id||(t.id=++n))).enter().append("g").append("g").attr("class",(t=>"person"+(t.data.spouse?" spouse":""))).attr("transform",(t=>"translate("+t.x+","+t.y+")"));r.append("rect").attr("class",(t=>"F"===t.data.data.sex?"female":"M"===t.data.data.sex?"male":"unknown")).attr("rx",this._box.rx).attr("ry",this._box.ry).attr("x",this._box.x).attr("y",this._box.y).attr("width",this._box.width).attr("height",this._box.height).attr("fill-opacity",.5),r.filter((t=>""!==t.data.data.xref)).each((function(t){let e=Ot(this);i.drawText(e,t.data)}))}drawText(t,e){t.append("title").text(e.data.name);const n=this.getImageToLoad(e);if(this._box.showImage=!!n,this._box.showImage){let e=t.append("g").attr("class","image");e.append("rect").attr("rx",this._box.image.rx).attr("ry",this._box.image.ry).attr("x",this._box.image.x).attr("y",this._box.image.y).attr("width",this._box.image.width).attr("height",this._box.image.height).attr("fill","rgb(255, 255, 255)");let i=e.append("image").attr("x",this._box.image.x).attr("y",this._box.image.y).attr("width",this._box.image.width).attr("height",this._box.image.height).attr("clip-path","url(#clip-image)");(function(t,e=null){return fetch(t,e).then((t=>t.blob())).then((t=>new Promise(((e,n)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.onerror=n,i.readAsDataURL(t)}))))})(n).then((t=>i.attr("xlink:href",t))).catch((t=>{console.error(t)})),e.append("rect").attr("rx",this._box.image.rx).attr("ry",this._box.image.ry).attr("x",this._box.image.x).attr("y",this._box.image.y).attr("width",this._box.image.width).attr("height",this._box.image.height).attr("fill","none").attr("stroke","rgb(200, 200, 200)").attr("stroke-width",1.5)}this.addNames(t,e),this.addDates(t,e),this._box.showImage=!0}togglePerson(t,e){e.children?(e._children=e.children,e.children=null):(e.children=e._children,e._children=null),this.draw(e)}collapse(t){t.children&&(t._children=t.children,t._children.forEach((t=>this.collapse(t))),t.children=null)}addFirstNames(t,e){let n=0;for(let i of e.data.firstNames){let r=t.append("tspan").text(i);i===e.data.preferredName&&r.attr("class","preferred"),0!==n&&r.attr("dx","0.25em"),++n}}addLastNames(t,e,n=0){let i=0;for(let r of e.data.lastNames){let e=t.append("tspan").attr("class","lastName").text(r);0!==i&&e.attr("dx","0.25em"),0!==n&&e.attr("dx",n+"em"),++i}}truncateNames(t){let e=this._box.text.width;t.selectAll("tspan:not(.preferred):not(.lastName)").nodes().reverse().forEach((n=>Ot(n).each(this.truncateText(t,e)))),t.selectAll("tspan.preferred").each(this.truncateText(t,e)),t.selectAll("tspan.lastName").each(this.truncateText(t,e))}truncateText(t,e){let n=this;return function(){let i=n.getTextLength(t),r=Ot(this),o=r.text().split(/\s+/);for(let a=o.length-1;a>=0;--a)i>e&&(o[a]=o[a].slice(0,1)+".",r.text(o.join(" ")),i=n.getTextLength(t))}}truncateDate(t,e){let n=this;return function(){let i=n.getTextLength(t),r=Ot(this),o=r.text();for(;i>e&&o.length>1;)o=o.slice(0,-1).trim(),r.text(o),i=n.getTextLength(t);"."===o[o.length-1]&&r.text(o.slice(0,-1).trim())}}getTextLength(t){let e=0;return t.selectAll("tspan").each((function(){e+=this.getComputedTextLength()})),e}addNames(t,e){let n=t.append("g").attr("class","name");if(this._orientation.splittNames){let t=n.append("text").attr("class","wt-chart-box-name").attr("text-anchor","middle").attr("alignment-baseline","central").attr("dy",this._box.text.y),i=n.append("text").attr("class","wt-chart-box-name").attr("text-anchor","middle").attr("alignment-baseline","central").attr("dy",this._box.text.y+20);this.addFirstNames(t,e),this.addLastNames(i,e),e.data.firstNames.length||e.data.lastNames.length||t.append("tspan").text(e.data.name),this.truncateNames(t),this.truncateNames(i)}else{let t=n.append("text").attr("class","wt-chart-box-name").attr("text-anchor",this._configuration.rtl?"end":"start").attr("dx",this._box.text.x).attr("dy",this._box.text.y);this.addFirstNames(t,e),this.addLastNames(t,e,.25),e.data.firstNames.length||e.data.lastNames.length||t.append("tspan").text(e.data.name),this.truncateNames(t)}}addDates(t,e){let n=t.append("g").attr("class","table");if(this._orientation.splittNames){let t=n.append("text").attr("class","date").attr("text-anchor","middle").attr("alignment-baseline","central").attr("dy",this._box.text.y+50);t.append("title").text(e.data.timespan);let i=t.append("tspan").text(e.data.timespan);return void(this.getTextLength(t)>this._box.text.width&&(t.selectAll("tspan").each(this.truncateDate(t,this._box.text.width)),i.text(i.text()+"…")))}let i=20;if(e.data.birth){n.append("text").attr("fill","currentColor").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x",this._box.text.x).attr("dy",this._box.text.y+i).append("tspan").text("★").attr("x",this._box.text.x+5);let t=n.append("text").attr("class","date").attr("text-anchor",this._configuration.rtl?"end":"start").attr("dominant-baseline","middle").attr("x",this._box.text.x).attr("dy",this._box.text.y+i);t.append("title").text(e.data.birth);let r=t.append("tspan").text(e.data.birth).attr("x",this._box.text.x+15);this.getTextLength(t)>this._box.text.width-25&&(t.selectAll("tspan").each(this.truncateDate(t,this._box.text.width-25)),r.text(r.text()+"…"))}if(e.data.death){e.data.birth&&(i+=20),n.append("text").attr("fill","currentColor").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x",this._box.text.x).attr("dy",this._box.text.y+i).append("tspan").text("†").attr("x",this._box.text.x+5);let t=n.append("text").attr("class","date").attr("text-anchor",this._configuration.rtl?"end":"start").attr("dominant-baseline","middle").attr("x",this._box.text.x).attr("dy",this._box.text.y+i);t.append("title").text(e.data.death);let r=t.append("tspan").text(e.data.death).attr("x",this._box.text.x+15);this.getTextLength(t)>this._box.text.width-25&&(t.selectAll("tspan").each(this.truncateDate(t,this._box.text.width-25)),r.text(r.text().trim()+"…"))}}getImageToLoad(t){return t.data.thumbnail?t.data.thumbnail:""}drawLinks(t,e){this._svg.visual.selectAll("path.link").data(t).enter().append("path").classed("link",!0).attr("d",(t=>this._orientation.elbow(t)))}}class wi{constructor(t){this._element=t.append("div").attr("class","overlay").style("opacity",1e-6)}show(t,e=0,n=null){this._element.select("p").remove(),this._element.append("p").attr("class","tooltip").text(t),this._element.transition().duration(e).style("opacity",1).on("end",(()=>{"function"==typeof n&&n()}))}hide(t=0,e=0){this._element.transition().delay(t).duration(e).style("opacity",1e-6)}get(){return this._element}}class bi{constructor(t){this._element=t.append("defs")}get(){return this._element}}class ki{constructor(t){this._zoom=null,this._parent=t,this.init()}init(){this._zoom=ri(),this._zoom.scaleExtent([.1,20]).on("zoom",(t=>{this._parent.attr("transform",t.transform)})),this._zoom.wheelDelta((t=>-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002))),this._zoom.filter((t=>{if("wheel"===t.type){if(!t.ctrlKey)return!1;const e=Fn(this);if(e.k){if(e.k<=.1&&t.deltaY>0)return t.preventDefault(),!1;if(e.k>=20&&t.deltaY<0)return t.preventDefault(),!1}return!0}return t.button||"touchstart"!==t.type?!(t.ctrlKey&&"wheel"!==t.type||t.button):2===t.touches.length}))}get(){return this._zoom}}class Mi{triggerDownload(t,e){let n=new MouseEvent("click",{view:window,bubbles:!1,cancelable:!0}),i=document.createElement("a");i.setAttribute("download",e),i.setAttribute("href",t),i.setAttribute("target","_blank"),i.dispatchEvent(n)}}class Ai extends Mi{copyStylesInline(t,e){let n=["svg","g","text","textPath"];for(let i=0;i{let r=(new XMLSerializer).serializeToString(t),o=window.URL||window.webkitURL||window,a=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),s=o.createObjectURL(a),h=new Image;h.onload=()=>{let t=this.createCanvas(e,n),r=t.getContext("2d");r.fillStyle="rgb(255,255,255)",r.fillRect(0,0,t.width,t.height),r.drawImage(h,0,0),o.revokeObjectURL(s);let a=t.toDataURL("image/png").replace("image/png","image/octet-stream");i(a)},h.src=s}))}cloneSvg(t){return new Promise((e=>{e(t.cloneNode(!0))}))}svgToImage(t,e){const n=[4960,3508];this.cloneSvg(t.get().node()).then((e=>{this.copyStylesInline(t.get().node(),e);const i=this.calculateViewBox(t.get().node()),r=Math.max(n[0],i[2]),o=Math.max(n[1],i[3]);return e.setAttribute("width",""+r),e.setAttribute("height",""+o),e.setAttribute("viewBox",""+i),this.convertToDataUrl(e,r,o)})).then((t=>this.triggerDownload(t,e))).catch((()=>{console.log("Failed to save chart as PNG image")}))}}class $i extends Mi{copyStylesInline(t,n){return new Promise((i=>{Promise.all(t.map((t=>function(t,n){return fetch(t,n).then(e)}(t)))).then((t=>{t.forEach((t=>{t=t.replace(/.webtrees-descendants-chart-container /g,"");let e=document.createElementNS("http://www.w3.org/2000/svg","style");e.appendChild(document.createTextNode(t)),n.prepend(e)})),n.classList.add("wt-global"),i(n)}))}))}convertToObjectUrl(t){return new Promise((e=>{let n=(new XMLSerializer).serializeToString(t),i=window.URL||window.webkitURL||window,r=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),o=i.createObjectURL(r),a=new Image;a.onload=()=>{e(o)},a.src=o}))}cloneSvg(t){return new Promise((e=>{e(t.cloneNode(!0))}))}svgToImage(t,e,n){this.cloneSvg(t.get().node()).then((t=>this.copyStylesInline(e,t))).then((t=>this.convertToObjectUrl(t))).then((t=>this.triggerDownload(t,n))).catch((()=>{console.log("Failed to save chart as SVG image")}))}}class Ni{constructor(){this._exportClass=null}setExportClass(t){switch(t){case"png":this._exportClass=Ai;break;case"svg":this._exportClass=$i}}createExport(t){switch(this.setExportClass(t),t){case"png":case"svg":return new this._exportClass}}}class Ti{constructor(t,e){this._element=t.append("svg"),this._defs=new bi(this._element),this._visual=null,this._zoom=null,this._configuration=e,this.init()}init(){this._element.attr("width","100%").attr("height","100%").attr("text-rendering","optimizeLegibility").attr("text-anchor","middle").attr("xmlns:xlink","https://www.w3.org/1999/xlink")}initEvents(t){this._element.on("contextmenu",(t=>t.preventDefault())).on("wheel",(e=>{e.ctrlKey||t.show(this._configuration.labels.zoom,300,(()=>{t.hide(200,600)}))})).on("touchend",(e=>{e.touches.length<2&&t.hide(0,600)})).on("touchmove",(e=>{e.touches.length>=2?t.hide():t.show(this._configuration.labels.move)})).on("click",(t=>this.doStopPropagation(t)),!0),this._configuration.rtl&&this._element.classed("rtl",!0),this._visual=this._element.append("g"),this._zoom=new ki(this._visual),this._element.call(this._zoom.get())}doStopPropagation(t){t.defaultPrevented&&t.stopPropagation()}export(t){return(new Ni).createExport(t)}get defs(){return this._defs}get zoom(){return this._zoom}get visual(){return this._visual}get(){return this._element}}class zi{constructor(t,e){this._configuration=e,this._parent=t,this._hierarchy=new mi(this._configuration),this._data={}}get svg(){return this._svg}updateViewBox(){let t=this._svg.visual.node().getBBox(),e=this._parent.node().getBoundingClientRect(),n=Math.max(e.width,t.width),i=Math.max(e.height,t.height,300),r=(n-t.width)/2,o=(i-t.height)/2,a=Math.ceil(t.x-r-10),s=Math.ceil(t.y-o-10);n=Math.ceil(n+20),i=Math.ceil(i+20),this._svg.get().attr("viewBox",[a,s,n,i])}get data(){return this._data}set data(t){this._data=t,this._hierarchy.init(this._data)}draw(){this._parent.html(""),this._svg=new Ti(this._parent,this._configuration),this._overlay=new wi(this._parent),this._svg.initEvents(this._overlay),new xi(this._svg,this._configuration,this._hierarchy),this.bindClickEventListener(),this.updateViewBox()}bindClickEventListener(){let t=this;this._svg.visual.selectAll("g.person").filter((t=>""!==t.data.data.xref)).each((function(e){Ot(this).on("click",(function(){t.personClick(e.data)}))}))}personClick(t){1===t.data.generation?this.redirectToIndividual(t.data.url):this.update(t.data.updateUrl)}redirectToIndividual(t){window.open(t,"_blank")}update(t){window.location=t}}t.DescendantsChart=class{constructor(t,e){this._selector=t,this._parent=Ot(this._selector),this._configuration=new _i(e.labels,e.generations,e.treeLayout,e.rtl),this._cssFiles=e.cssFiles,this._chart=new zi(this._parent,this._configuration),this.init(),this.draw(e.data)}init(){Ot("#centerButton").on("click",(()=>this.center())),Ot("#exportPNG").on("click",(()=>this.exportPNG())),Ot("#exportSVG").on("click",(()=>this.exportSVG()))}center(){this._chart.svg.get().transition().duration(750).call(this._chart.svg.zoom.get().transform,Gn)}get configuration(){return this._configuration}update(t){this._chart.update(t)}draw(t){this._chart.data=t,this._chart.draw()}exportPNG(){this._chart.svg.export("png").svgToImage(this._chart.svg,"descendants-chart.png")}exportSVG(){this._chart.svg.export("svg").svgToImage(this._chart.svg,this._cssFiles,"descendants-chart.svg")}}},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).WebtreesDescendantsChart={}); diff --git a/src/Module.php b/src/Module.php index 4c5f2ef..34f0f80 100644 --- a/src/Module.php +++ b/src/Module.php @@ -64,7 +64,7 @@ class Module extends DescendancyChartModule implements ModuleCustomInterface /** * @var string */ - public const CUSTOM_VERSION = '1.6.1-dev'; + public const CUSTOM_VERSION = '1.6.1'; /** * @var string