(function(y,O){typeof exports=="object"&&typeof module<"u"?module.exports=O(require("react")):typeof define=="function"&&define.amd?define(["react"],O):(y=typeof globalThis<"u"?globalThis:y||self,y.OrganizationChart=O(y.React))})(this,function(y){"use strict";var O={exports:{}},N={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Q;function Oe(){if(Q)return N;Q=1;var P=y,j=Symbol.for("react.element"),l=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,C=P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,k={key:!0,ref:!0,__self:!0,__source:!0};function b(_,o,h){var g,R={},S=null,$=null;h!==void 0&&(S=""+h),o.key!==void 0&&(S=""+o.key),o.ref!==void 0&&($=o.ref);for(g in o)E.call(o,g)&&!k.hasOwnProperty(g)&&(R[g]=o[g]);if(_&&_.defaultProps)for(g in o=_.defaultProps,o)R[g]===void 0&&(R[g]=o[g]);return{$$typeof:j,type:_,key:S,ref:$,props:R,_owner:C.current}}return N.Fragment=l,N.jsx=b,N.jsxs=b,N}var I={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ee;function Se(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){var P=y,j=Symbol.for("react.element"),l=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),_=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),te=Symbol.iterator,we="@@iterator";function Pe(e){if(e===null||typeof e!="object")return null;var r=te&&e[te]||e[we];return typeof r=="function"?r:null}var A=P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n=1&&f>=0&&a[c]!==p[f];)f--;for(;c>=1&&f>=0;c--,f--)if(a[c]!==p[f]){if(c!==1||f!==1)do if(c--,f--,f<0||a[c]!==p[f]){var m=` `+a[c].replace(" at new "," at ");return e.displayName&&m.includes("")&&(m=m.replace("",e.displayName)),typeof e=="function"&&M.set(e,m),m}while(c>=1&&f>=0);break}}}finally{G=!1,z.current=u,Le(),Error.prepareStackTrace=s}var D=e?e.displayName||e.name:"",Ce=D?L(D):"";return typeof e=="function"&&M.set(e,Ce),Ce}function Ve(e,r,t){return ve(e,!1)}function Ue(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function V(e,r,t){if(e==null)return"";if(typeof e=="function")return ve(e,Ue(e));if(typeof e=="string")return L(e);switch(e){case h:return L("Suspense");case g:return L("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case o:return Ve(e.render);case R:return V(e.type,r,t);case S:{var n=e,s=n._payload,u=n._init;try{return V(u(s),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,pe={},he=A.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);he.setExtraStackFrame(t)}else he.setExtraStackFrame(null)}function Be(e,r,t,n,s){{var u=Function.call.bind(U);for(var i in e)if(u(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var p=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){a=c}a&&!(a instanceof Error)&&(B(s),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),B(null)),a instanceof Error&&!(a.message in pe)&&(pe[a.message]=!0,B(s),v("Failed %s type: %s",t,a.message),B(null))}}}var ze=Array.isArray;function q(e){return ze(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ge(e){try{return ge(e),!1}catch{return!0}}function ge(e){return""+e}function me(e){if(Ge(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),ge(e)}var Y=A.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},ye,be,K;K={};function Ke(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function He(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Xe(e,r){if(typeof e.ref=="string"&&Y.current&&r&&Y.current.stateNode!==r){var t=x(Y.current.type);K[t]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',x(Y.current.type),e.ref),K[t]=!0)}}function Ze(e,r){{var t=function(){ye||(ye=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Qe(e,r){{var t=function(){be||(be=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var er=function(e,r,t,n,s,u,i){var a={$$typeof:j,type:e,key:r,ref:t,props:i,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function rr(e,r,t,n,s){{var u,i={},a=null,p=null;t!==void 0&&(me(t),a=""+t),He(r)&&(me(r.key),a=""+r.key),Ke(r)&&(p=r.ref,Xe(r,s));for(u in r)U.call(r,u)&&!qe.hasOwnProperty(u)&&(i[u]=r[u]);if(e&&e.defaultProps){var c=e.defaultProps;for(u in c)i[u]===void 0&&(i[u]=c[u])}if(a||p){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Ze(i,f),p&&Qe(i,f)}return er(e,a,p,s,n,Y.current,i)}}var H=A.ReactCurrentOwner,Ee=A.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var X;X=!1;function Z(e){return typeof e=="object"&&e!==null&&e.$$typeof===j}function _e(){{if(H.current){var e=x(H.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function tr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return` Check your code at `+r+":"+t+"."}return""}}var Re={};function nr(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=` Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=nr(r);if(Re[t])return;Re[t]=!0;var n="";e&&e._owner&&e._owner!==H.current&&(n=" It was passed a child from "+x(e._owner.type)+"."),F(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),F(null)}}function Te(e,r){{if(typeof e!="object")return;if(q(e))for(var t=0;t",a=" Did you accidentally export a JSX literal instead of a component?"):c=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",c,a)}var f=rr(e,r,t,s,u);if(f==null)return f;if(i){var m=r.children;if(m!==void 0)if(n)if(q(m)){for(var D=0;D{o.extend=!0,Array.isArray(o.children)&&o.children.forEach(h=>{C(h)}),E(o)},[]),k=(o,h)=>{o.extend=h,E({...o})},b=()=>Array.isArray(l.children)&&l.children.length,_=()=>Array.isArray(l.member)&&l.member.length;return y.useEffect(()=>{C(P)},[P,C]),d.jsx("table",{className:"org-table",style:{display:l.title?"block":"none"},children:d.jsxs("tbody",{children:[d.jsx("tr",{children:d.jsxs("td",{colSpan:Array.isArray(l.children)?l.children.length*2:1,className:`${b()||"org-parent-level"} ${b()&&l.extend?"org-extend":""}`,children:[d.jsx("div",{className:"org-node",children:d.jsxs("div",{className:"org-container",onClick:()=>j(l),children:[d.jsx("div",{className:`org-title ${l.titleClass||""}`,children:l.title}),_()&&d.jsx("div",{className:`org-content ${l.contentClass||""}`,children:l.member.map((o,h)=>d.jsxs("div",{className:"org-content-item",children:[d.jsxs("div",{className:"item-box",children:[d.jsx("p",{className:"item-title",children:o.name}),d.jsx("p",{className:"item-add",children:o.add})]}),o.image_url&&d.jsx("div",{className:"avat",children:o.image_url&&d.jsx("img",{src:o.image_url})})]},h))})]})}),d.jsx("div",{className:"org-extend-arrow",style:{display:b()?"block":"none"},onClick:()=>k(l,!l.extend)})]})}),d.jsx("tr",{children:b()&&l.extend&&l.children.map((o,h)=>d.jsx("td",{colSpan:2,className:"org-child-level",children:d.jsx(re,{data:o,onClickNode:j})},h))})]})})}return re});