Edit the organigram data and download JSON from the button in the header
In Sitefinity PROD find the page ABOUT
Navigate to Content -> Documents & Files and upload your new JSON file without replacing the existing one. SYNC!
In the organigram page editor, find the block called "Document Link", change the current file reference to your uploaded JSON file
Sync the Organigram page!
How to change data in SF TEST?
Edit the organigram data and download JSON from the button in the header
In Sitefinity TEST find the page test-david
Navigate to Content -> Documents & Files and upload your new JSON file without replacing the existing one. Sync is not required in test.
In the organigram page editor, find the block called "Document Link", change the current file reference to your uploaded JSON file
Preview
Tips
Always use TEST env first, upload the JSON in test, check it. When you are sure about the result, please upload the same JSON in Prod.
The button "Load JSON File" will parse any Organigram File previously downloaded from "Download JSON" button.
Never unallow dialogs in this page from your browser! Dialog/alerts and confirms are widely used and the solution won't work as expected without them.
This solution was tested only on Chromium browsers (like Google Chrome).
`,1),Kf=b("<!> <!>",1);function Qf(t){let e=ie(!1);const r=()=>{W(e,!l(e))};var a=Kf(),n=R(a);Te(n,{size:"lg",class:"fs-4 ms-3",color:"info",$$events:{click:r},children:(s,d)=>{var c=pe("INFO");o(s,c)},$$slots:{default:!0}});var i=w(n,2);$f(i,{style:"width: 50vw",get isOpen(){return l(e)},toggle:r,placement:"end",children:(s,d)=>{var c=Gf();o(s,c)},$$slots:{default:!0}}),o(t,a)}function ev(){confirm("Are you sure you want delete your changes and restore the JSON file from Sitefinity?")&&Ke.restoreVersion(1)}async function tv(t,e,r){const a=await Wo(t);a&&(W(e,!0),W(r,!0),Ke.reInitialize(a),setTimeout(()=>{W(e,!1)},1500))}var rv=b('
SPACERS ARE NOT VISIBLE IN MOBILE MODE - DO NOT EDIT IN MOBILE MODE!
'),av=b('<!> <!>',1),nv=b('
View Mode:
<!> <!>',1),iv=b(" ",1),lv=b("<!> <!>",1),sv=b('
<!>
<!>',1),ov=b('
This version was manually uploaded from the LOAD from JSON button.
'),cv=b(''),dv=b('
<!> You did a lot of changes! Please download the file to avoid to lose your work! <!>
');Yr(["click"]);const $r={zh:/[\u4E00-\u9FFF]/,ar:/[\u0600-\u06FF]/,ru:/[\u0400-\u04FF]/};function zv(t){return Object.entries(t).every(([e,r])=>{const a=r.replace(/\([^)]*\)/g,"").trim();return e==="zh"&&!$r.zh.test(a)?confirm(`Expected only Chinese characters in: "${a}"
Do you confirm this is correct?`):e==="ar"&&!$r.ar.test(a)?confirm(`Expected only Arabic characters in: "${a}"
Do you confirm this is correct?`):e==="ru"&&!$r.ru.test(a)?confirm(`Expected only Cyrillic characters in: "${a}"
Do you confirm this is correct?`):(e==="en"||e==="fr"||e==="es")&&($r.zh.test(a)||$r.ar.test(a)||$r.ru.test(a))?confirm(`Found unexpected characters in ${e}: "${a}"
Do you confirm this is correct?`):!0})}var pa,ba,ya;class Dv{constructor(){Dt(this,pa,Ee(0));Dt(this,ba,Ee(!1));Dt(this,ya,Ee(ve([])))}get _step(){return l(it(this,pa))}set _step(e){W(it(this,pa),ve(e))}get _completed(){return l(it(this,ba))}set _completed(e){W(it(this,ba),ve(e))}get _questions(){return l(it(this,ya))}set _questions(e){W(it(this,ya),ve(e))}get step(){return this._step}get questions(){return this._questions}set questions(e){this._questions.push(...e)}set completed(e){this._completed=e,e?this._step=this._questions.length-1:this._step=0}get completed(){return this._completed}getCurrentStep(){return this._questions[this._step]||null}nextStep(){this._step+10&&this._step--}removeQuestion(e){e>=0&&e=this._questions.length&&(this._step=Math.max(0,this._questions.length-1)))}reset(){this._step=0,this._completed=!1,this._questions=[]}}pa=new WeakMap,ba=new WeakMap,ya=new WeakMap;const Ze=new Dv;var Rv=b('
Box Size
<!>',1),Nv=b('
Text Centering
<!>',1),Iv=b(`Link can be shown in english or all languages (checkbox to set to english only is below).
If you fill a valid link (check below for link requirements)
the box will show a globe icon. The color of globe icon depens on the background color of the box.
A valid link has to come from FAO Domain, has use HTTPS protocol and should NEVER contain any language, even if the website is for english only since the language is always automatically handled.
Example of a valid link: https://www.fao.org/about/leadership/name-surname`,1),Mv=b("<!> <!>",1),qv=b('
Website Link
<!>
<!> <!>
<!> <!>',1),jv=b('
Background Color
<!>',1),Bv=b("<!> <!>",1),Fv=b('
Name of the box
<!>',1),Hv=b("If a box has a modal, it has the option to set the chevron (small arrow pointing down) either to the right side of the box or below it. Please try to follow the schema of the row.",1),Uv=b('
DISABLED!
Add a modal to set chevron position.
',1),Vv=b('
Chevron position <!> <!>
<!>',1),Wv=b("<!> <!> <!> <!> <!> <!>",1),Zv=b("<!> <!>",1);function Vl(t,e){var f,m;ge(e,!0);let r=D(e,"onEditRealBoxFinalize",3,null),a=!1,n=Ee(!1);const i=ve({...e.rowSchemaCopy[e.activeEntryIndex]});let s=ve({isDoubleSize:((f=i.size)==null?void 0:f.doubleX)??!1,centerText:i.centerText??!1,link:i.link??"",linkEnOnly:i.linkEnOnly??!1,bg:i.bg,modal:!!((m=i.data)!=null&&m.modal),chevronDown:i.chevronDown??!1,title:{...i.data.title}});const d=Pt(s);dt(()=>{if(s.isDoubleSize?i.size={doubleX:!0}:i.size&&delete i.size,s.centerText?i.centerText=!0:"centerText"in i&&delete i.centerText,s.link.trim()){const g=s.link.replace(/\/$/,""),v=["/en","/fr","/es","/zh","/ru","/ar"].find(h=>g.endsWith(h));v?(alert("DO NOT INPUT THE LANGUAGE IN THE WEBSITE FIELD! IT IS AUTO-TRANSLATED!!!"),i.link=g.slice(0,-v.length)):i.link=g,"linkEnOnly"in i&&!s.linkEnOnly?delete i.linkEnOnly:s.linkEnOnly&&(i.linkEnOnly=!0)}else delete i.link,delete i.linkEnOnly;i.bg=s.bg,s.chevronDown?i.chevronDown=!0:delete i.chevronDown,i.data.title=s.title,W(n,JSON.stringify(s)!==JSON.stringify(d))}),zs(()=>{const g=[...e.rowSchemaCopy];g[e.activeEntryIndex]=i,e.onUpdateRowSchema(g)});function c(g){const v=g.target;if(g.preventDefault(),!!zv(s.title)&&v.checkValidity()){const h=[...e.rowSchemaCopy];h[e.activeEntryIndex]=i,e.onUpdateRowSchema(h),r()?r()():Ze.nextStep()}}cn(t,{class:"edit-form-box",get validated(){return a},onsubmit:c,children:(g,v)=>{var h=Zv(),x=R(h);lt(x,{class:"grid-entries",children:(_,k)=>{var y=Wv(),T=R(y);Fe(T,{class:"form-entry",children:(O,A)=>{var L=Rv(),$=w(R(L),2);He($,16,()=>[!0,!1],Ve,(z,I)=>{const q=de(()=>I?"Double size":"Standard size");Se(z,{type:"radio",get value(){return I},get label(){return l(q)},get group(){return s.isDoubleSize},set group(M){s.isDoubleSize=M}})}),o(O,L)},$$slots:{default:!0}});var S=w(T,2);Fe(S,{class:"form-entry",children:(O,A)=>{var L=Nv(),$=w(R(L),2);He($,16,()=>[!0,!1],Ve,(z,I)=>{const q=de(()=>I?"Yes":"No");Se(z,{type:"radio",get value(){return I},get label(){return l(q)},get group(){return s.centerText},set group(M){s.centerText=M}})}),o(O,L)},$$slots:{default:!0}});var p=w(S,2);Fe(p,{class:"form-entry double-size",children:(O,A)=>{var L=qv(),$=R(L),z=N($),I=w(N(z),2);fe(I,{id:"btn-link-info",color:"info",name:"info-circle-fill ms-3 mb-2"});var q=w(z,2);xt(q,{trigger:"hover",placement:"right",target:"btn-link-info",title:"Website link Info",children:(U,Z)=>{var X=Iv();o(U,X)},$$slots:{default:!0}});var M=w(q,2);Cl(M,{pill:!0,color:"info",children:(U,Z)=>{var X=pe("Auto translated");o(U,X)},$$slots:{default:!0}});var j=w($,2);rt(j,{children:(U,Z)=>{var X=Mv(),re=R(X);Ie(re,{children:(ne,Q)=>{fe(ne,{name:"globe"})},$$slots:{default:!0}});var le=w(re,2);Se(le,{type:"url",pattern:"https://(.*\\.)?fao\\.org(/.*)?$",placeholder:"Website link here without LANG at the end...",get value(){return s.link},set value(ne){s.link=ne}}),o(U,X)},$$slots:{default:!0}});var B=w(j,2);{var Y=U=>{Se(U,{class:"mt-2 ms-1",type:"checkbox",label:"Website in English ONLY",get checked(){return s.linkEnOnly},set checked(Z){s.linkEnOnly=Z}})};V(B,U=>{s.link.trim()&&U(Y)})}o(O,L)},$$slots:{default:!0}});var E=w(p,2);Fe(E,{class:"form-entry",children:(O,A)=>{var L=jv(),$=w(R(L),2);He($,16,()=>["darkblue","lightblue","opaqueblue","white"],Ve,(z,I)=>{const q=de(()=>I.toLocaleUpperCase());Se(z,{type:"radio",get value(){return I},get label(){return l(q)},get group(){return s.bg},set group(M){s.bg=M}})}),o(O,L)},$$slots:{default:!0}});var C=w(E,2);Fe(C,{class:"form-entry double-size",children:(O,A)=>{var L=Fv(),$=w(R(L),2);He($,16,()=>["en","fr","es","zh","ru","ar"],z=>z,(z,I)=>{rt(z,{class:"mb-3",children:(q,M)=>{var j=Bv(),B=R(j);Ie(B,{children:(U,Z)=>{var X=pe();F(re=>ee(X,re),[()=>I.toLocaleUpperCase()]),o(U,X)},$$slots:{default:!0}});var Y=w(B,2);Se(Y,{required:!0,get value(){return s.title[I]},set value(U){s.title[I]=U}}),o(q,j)},$$slots:{default:!0}})}),o(O,L)},$$slots:{default:!0}});var P=w(C,2);Fe(P,{class:"form-entry",children:(O,A)=>{var L=Vv(),$=R(L),z=w(N($));fe(z,{id:"btn-modal-info",color:"info",name:"info-circle-fill ms-3"});var I=w(z,2);xt(I,{trigger:"hover",placement:"right",target:"btn-modal-info",title:"Modal Info",children:(B,Y)=>{var U=Hv();o(B,U)},$$slots:{default:!0}});var q=w($,2);{var M=B=>{var Y=te(),U=R(Y);He(U,16,()=>[!0,!1],Ve,(Z,X)=>{const re=de(()=>X?"Bottom side":"Right side");Se(Z,{type:"radio",get value(){return X},get label(){return l(re)},get group(){return s.chevronDown},set group(le){s.chevronDown=le}})}),o(B,Y)},j=B=>{var Y=Uv();o(B,Y)};V(q,B=>{s.modal?B(M):B(j,!1)})}o(O,L)},$$slots:{default:!0}}),o(_,y)},$$slots:{default:!0}});var u=w(x,2);Zt(u,{children:(_,k)=>{_t(_,{class:"w-100 p-4",size:"lg",children:(y,T)=>{const S=de(()=>!l(n));Te(y,{color:"success",get disabled(){return l(S)},children:(p,E)=>{var C=pe("Confirm Box Changes");o(p,C)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}}),o(g,h)},$$slots:{default:!0}}),me()}var Yv=b("<!> <!>",1),Jv=b("<!> <!>",1),Xv=b("<!> <!>",1),Gv=b("<!> <!> <!>",1),Kv=b("
Progress step: 1/1
<!> <!>",1),Qv=b("<!> <!>",1);function eh(t,e){ge(e,!0);let r=D(e,"stepDone",15),a=Ee(ve(Pt(Ke.organigram.grid[e.rowIndex].rowSchema))),n=Ee(null),i=Ee(null),s=Ee(null),d=Ee(!1),c=Ee(!1);const f=[{value:!0,label:"Add before the selected entry"},{value:!1,label:"Add after the selected entry"}],m=[{value:"spacer",label:"Spacer"},{value:"box",label:"Regular Box"}];dt(()=>{typeof l(n)=="boolean"&&typeof l(i)=="string"?(W(d,!0),W(s,e.activeEntryIndex+(l(n)?0:1))):(W(d,!1),W(s,null))});function g(){if(l(n)===null||l(i)===null){alert("Please select both position and type");return}if(l(i)==="spacer"&&typeof l(s)=="number"){Ke.addBox(null,e.rowIndex,l(s)),r(!0);return}else if(typeof l(s)=="number"){const y={bg:"white",data:{title:{en:"New Box",fr:"",es:"",zh:"",ru:"",ar:""}}};l(a).splice(l(s),0,y),W(c,!0)}}function v(){Ke.addBox(l(a)[l(s)],e.rowIndex,l(s)),r(!0)}var h=te(),x=R(h);{var u=k=>{rr(k,{children:(y,T)=>{var S=Gv(),p=R(S);It(p,{class:"pb-5",children:(P,O)=>{bv(P,()=>l(a),()=>e.activeEntryIndex,()=>l(s),()=>l(i),()=>l(d))},$$slots:{default:!0}});var E=w(p,2);lt(E,{children:(P,O)=>{var A=Xv(),L=R(A);Fe(L,{children:(z,I)=>{var q=Yv(),M=R(q);ot(M,{class:"fs-5 my-2",children:(B,Y)=>{var U=pe("Position");o(B,U)},$$slots:{default:!0}});var j=w(M,2);He(j,17,()=>f,Ve,(B,Y)=>{let U=()=>l(Y).value,Z=()=>l(Y).label;Se(B,{type:"radio",get value(){return U()},get label(){return Z()},get group(){return l(n)},set group(X){W(n,ve(X))}})}),o(z,q)},$$slots:{default:!0}});var $=w(L,4);Fe($,{children:(z,I)=>{var q=Jv(),M=R(q);ot(M,{class:"fs-5 my-2",children:(B,Y)=>{var U=pe("Entry type to add");o(B,U)},$$slots:{default:!0}});var j=w(M,2);He(j,17,()=>m,Ve,(B,Y)=>{let U=()=>l(Y).value,Z=()=>l(Y).label;Se(B,{type:"radio",get value(){return U()},get label(){return Z()},get group(){return l(i)},set group(X){W(i,ve(X))}})}),o(z,q)},$$slots:{default:!0}}),o(P,A)},$$slots:{default:!0}});var C=w(E,2);Zt(C,{children:(P,O)=>{const A=de(()=>!l(d));Te(P,{get disabled(){return l(A)},class:"fs-4 w-100 my-3",color:"success",onclick:g,children:(L,$)=>{var z=pe();F(()=>ee(z,`Confirm and proceed to ${(l(i)==="spacer"?"Confirmation step":"Edit Box Mode")??""}`)),o(L,z)},$$slots:{default:!0}})},$$slots:{default:!0}}),o(y,S)},$$slots:{default:!0}})},_=k=>{rr(k,{children:(y,T)=>{var S=Qv(),p=R(S);It(p,{children:(C,P)=>{var O=Kv(),A=w(R(O),2);Lr(A,{class:"my-2",animated:!0,color:"success",value:1,max:1});var L=w(A,2);dn(L,()=>l(a),()=>l(s),()=>()=>{},()=>()=>{}),o(C,O)},$$slots:{default:!0}});var E=w(p,2);lt(E,{children:(C,P)=>{Vl(C,{get rowSchemaCopy(){return l(a)},get activeEntryIndex(){return l(s)},onUpdateRowSchema:O=>W(a,ve(O)),onEditRealBoxFinalize:v})},$$slots:{default:!0}}),o(y,S)},$$slots:{default:!0}})};V(x,k=>{l(c)?k(_,!1):k(u)})}o(t,h),me()}var th=b('<!>
MODAL WITH OVERRIDES, DO NOT CHANGE ANYTHING IN THIS FORM!
<!>',1),rh=b('
Delete modal?
',1),ah=b("<!> Create New Modal",1),nh=b('
Add a modal?
<!>',1),ih=b("Add or remove modal entries (for all langs) Change existing modal entries from person to list. Any new modal entry needs translations for all langs!
Color legend:
Yellow - Person with existing data
Blue - List with existing data
Gray - new entry or changed entry without data
",1),lh=b('
Edit modal layout? <!> <!>
<!>
'),sh=b("<!> Add Entry",1),oh=b("<!> ",1),ch=b('
'),dh=b('
...
'),uh=b("
Spacer
"),fh=b('
<!> Existing List Entry <!>
'),vh=b('
<!> New List Entry Maybe list entries...
'),hh=b('
'),gh=b('
<!> New Personnel Entry To Be Defined!
'),mh=b('
<!> <!>
<!>
'),_h=b('
Modal Entries <!>
',1),ph=b('
Layout Direction <!> <!>
<!>',1),bh=b(" <!>",1),yh=b("<!> <!>",1),wh=b('
<!> <!>
<!>
',1),xh=b("<!> <!> <!> <!>",1);function kh(t,e){var y,T;ge(e,!0);let r=ve({...e.rowSchemaCopy[e.activeEntryIndex]}),a=Ee(!1),n=Ee(!1),i=ve({entries:(y=r.data)!=null&&y.modal?r.data.modal.map(S=>({...S,checked:!1})):[],isHorizontal:!!((T=r==null?void 0:r.data)!=null&&T.isHorizontal)});r.data.modalOveriddes&&confirm("THIS IS A MODAL WITH OVERRIDES! READ CAREFULLY PLEASE. Even if the system allows to do so, NEVER CHANGE MODAL ORDER (modal layout) and NEVER REORDER ENTRIES!!! It is possible to change existing entries data (like name, title, reporting lines, img...) but NEVER reorder entries or add/remove entries from the modal layout!"),dt(()=>(e.onShowHideOrganigramDev(!1),l(a)&&i.entries.length===0&&(i.entries=[Kr()]),i.isHorizontal&&(i.entries.length<2||i.entries.length>3)&&(i.isHorizontal=!1),()=>e.onShowHideOrganigramDev(!0)));function s(){i.entries=[Kr(),...i.entries]}function d(S){W(n,!0),i.entries=i.entries.filter((p,E)=>E!==S)}function c(S){i.entries=i.entries.map((p,E)=>E===S?"isList"in p?Kr():pi():p)}function f(){i.entries=[Kr()]}function m(){if(confirm("Are you sure you want to delete all modal data?")){const S=[...e.rowSchemaCopy],p=S[e.activeEntryIndex];delete p.data.modal,p.chevronDown&&delete p.chevronDown,e.onUpdateRowSchema(S),Ze.completed=!0}}function g(S){const p=i.entries.map(C=>{var P;return"name"in C&&C.name&&C.img||"isList"in C&&C.entries&&C.entries.length>0||C.title&&((P=C.title.en)==null?void 0:P.length)>0||C.endsWithHr?C:"isList"in C?pi():Kr()}),E=i.isHorizontal&&(i.entries.length===2||i.entries.length===3);p.length===1&&(Ze.removeQuestion(Ze.step+1),i.entries[0].checked=!0),e.onUpdateModalSchema(p,E,l(n)),Ze.nextStep()}var v=xh(),h=R(v);It(h,{children:(S,p)=>{Lr(S,{class:"my-2",animated:!0,color:"success",get value(){return Ze.step},max:8})},$$slots:{default:!0}});var x=w(h,2);{var u=S=>{Wn(S,{class:"mt-2 p-3 d-flex align-items-center justify-content-between",color:"danger",children:(p,E)=>{var C=th(),P=R(C);fe(P,{class:"fs-1",name:"exclamation-triangle-fill"});var O=w(P,4);fe(O,{class:"fs-1",name:"exclamation-triangle-fill"}),o(p,C)},$$slots:{default:!0}})};V(x,S=>{r.data.modalOveriddes&&S(u)})}var _=w(x,2);lt(_,{class:"four-col-grid",children:(S,p)=>{var E=wh(),C=R(E),P=N(C);{var O=M=>{Fe(M,{children:(j,B)=>{var Y=rh(),U=w(R(Y),2);U.__click=m,o(j,Y)},$$slots:{default:!0}})},A=M=>{Fe(M,{children:(j,B)=>{var Y=nh(),U=w(R(Y),2);Te(U,{color:"primary",size:"lg",onclick:f,children:(Z,X)=>{var re=ah(),le=R(re);fe(le,{name:"plus-circle",class:"me-2"}),o(Z,re)},$$slots:{default:!0}}),o(j,Y)},$$slots:{default:!0}})};V(P,M=>{i.entries.length>0?M(O):M(A,!1)})}var L=w(P,2);{var $=M=>{var j=lh(),B=N(j),Y=w(N(B));fe(Y,{id:"edit-modal-info",color:"info",name:"info-circle-fill mx-3"});var U=w(Y,2);xt(U,{trigger:"hover",placement:"right",target:"edit-modal-info",title:"Modal edit Info",children:(X,re)=>{var le=ih();o(X,le)},$$slots:{default:!0}});var Z=w(B,2);Fe(Z,{children:(X,re)=>{var le=te(),ne=R(le);He(ne,16,()=>[!0,!1],Ve,(Q,ue)=>{const K=de(()=>ue?"Yes":"No");Se(Q,{type:"radio",name:"editLayout",get value(){return ue},get label(){return l(K)},get group(){return l(a)},set group(Ce){W(a,ve(Ce))}})}),o(X,le)},$$slots:{default:!0}}),o(M,j)};V(L,M=>{i.entries.length>0&&M($)})}var z=w(C,2),I=N(z);{var q=M=>{var j=yh(),B=R(j);Fe(B,{children:(Z,X)=>{var re=_h(),le=R(re),ne=w(N(le));Te(ne,{color:"primary",size:"sm",onclick:s,children:(ue,K)=>{var Ce=sh(),ye=R(Ce);fe(ye,{name:"plus-circle"}),o(ue,Ce)},$$slots:{default:!0}});var Q=w(le,2);He(Q,21,()=>i.entries,Ve,(ue,K,Ce)=>{var ye=mh(),se=N(ye),ze=N(se);ze.textContent=`Entry ${Ce+1}`;var ce=w(ze,2),Xe=N(ce);Te(Xe,{color:"primary",size:"sm",class:"me-2",onclick:()=>c(Ce),children:(Le,Je)=>{var Ne=oh(),pt=R(Ne);const et=de(()=>"isList"in l(K)?"person":"list-ul");fe(pt,{get name(){return l(et)}});var xe=w(pt);F(()=>ee(xe,` Change to ${("isList"in l(K)?"Person View":"List View")??""}`)),o(Le,Ne)},$$slots:{default:!0}});var Re=w(Xe,2);{var ke=Le=>{Te(Le,{color:"danger",size:"sm",onclick:()=>d(Ce),children:(Je,Ne)=>{fe(Je,{name:"trash-fill"})},$$slots:{default:!0}})};V(Re,Le=>{i.entries.length>1&&Le(ke)})}var Ue=w(se,2),Pe=N(Ue);{var gt=Le=>{var Je=te(),Ne=R(Je);{var pt=xe=>{var tt=fh(),at=N(tt);fe(at,{name:"list-ul",class:"me-2 fs-5"});var Mt=w(at,2);{var nt=st=>{var be=ch(),nr=N(be);F(()=>ee(nr,l(K).title.en[0])),o(st,be)},Ae=st=>{var be=te(),nr=R(be);{var qt=Lt=>{var ir=dh(),lr=N(ir),Cr=N(lr);F(()=>ee(Cr,l(K).entries[0].en)),o(Lt,ir)},Xt=Lt=>{var ir=uh();o(Lt,ir)};V(nr,Lt=>{l(K).entries&&l(K).entries.length>0?Lt(qt):Lt(Xt,!1)},!0)}o(st,be)};V(Mt,st=>{l(K).title?st(nt):st(Ae,!1)})}o(xe,tt)},et=xe=>{var tt=vh(),at=N(tt);fe(at,{name:"list-ul",class:"me-5 fs-5"}),o(xe,tt)};V(Ne,xe=>{l(K).checked?xe(et,!1):xe(pt)})}o(Le,Je)},Be=Le=>{var Je=te(),Ne=R(Je);{var pt=xe=>{var tt=hh(),at=N(tt),Mt=w(at,2),nt=N(Mt);F(()=>{Oe(at,"src",l(K).img??"https://www.fao.org/images/aboutfaolibraries/organizationalchart/Vacant.jpg"),Oe(at,"alt",l(K).name.en),ee(nt,l(K).name.en)}),o(xe,tt)},et=xe=>{var tt=gh(),at=N(tt);fe(at,{name:"person",class:"me-5 fs-5"}),o(xe,tt)};V(Ne,xe=>{l(K).checked?xe(et,!1):xe(pt)})}o(Le,Je)};V(Pe,Le=>{"isList"in l(K)?Le(gt):Le(Be,!1)})}F(()=>{ae(ye,"bg-light",l(K).checked),ae(ye,"bg-info",!l(K).checked&&"isList"in l(K)),ae(ye,"bg-warning",!l(K).checked&&!("isList"in l(K)))}),o(ue,ye)}),o(Z,re)},$$slots:{default:!0}});var Y=w(B,2);{var U=Z=>{var X=bh(),re=w(R(X),2);Fe(re,{children:(le,ne)=>{var Q=ph(),ue=R(Q),K=w(N(ue));fe(K,{id:"btn-layout-dir-info",color:"info",name:"info-circle-fill mx-3"});var Ce=w(K,2);xt(Ce,{trigger:"hover",placement:"right",target:"btn-layout-dir-info",title:"Direction info",children:(se,ze)=>{var ce=pe("Row view: entries will be displayed side by side. Available only for 2 or 3 entries.");o(se,ce)},$$slots:{default:!0}});var ye=w(ue,2);Se(ye,{type:"checkbox",name:"isHorizontal",label:"Use horizontal layout",get checked(){return i.isHorizontal},set checked(se){i.isHorizontal=se}}),o(le,Q)},$$slots:{default:!0}}),o(Z,X)};V(Y,Z=>{i.entries.length>=2&&i.entries.length<=3&&Z(U)})}o(M,j)};V(I,M=>{l(a)&&M(q)})}o(S,E)},$$slots:{default:!0}});var k=w(_,2);Zt(k,{children:(S,p)=>{_t(S,{class:"w-100 p-4",size:"lg",children:(E,C)=>{const P=de(()=>i.entries.length===0);Te(E,{get disabled(){return l(P)},onclick:g,color:"success",children:(O,A)=>{var L=pe("Confirm modal layout");o(O,L)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}}),o(t,v),me()}Yr(["click"]);var Oh=b("<!> <!>",1),Eh=b('
Edit box position
<!>',1),Ph=b("
<!> <!>
");function Sh(t,e){ge(e,!0);let r=D(e,"unhighlight",15),a=ve(e.activeEntryIndex);dt(()=>(r(!1),()=>{r(!0)}));function n(f){Ze.nextStep()}function i(f){const m=e.activeEntryIndex-f,g=[...e.rowSchemaCopy];[g[e.activeEntryIndex],g[m]]=[g[m],g[e.activeEntryIndex]],e.onUpdateRowSchema(g),e.onUpdateActiveIndex(m)}var s=Ph(),d=N(s);lt(d,{children:(f,m)=>{var g=Eh(),v=w(R(g),2);Fe(v,{children:(h,x)=>{_t(h,{class:"w-100 p-4",size:"lg",children:(u,_)=>{var k=Oh(),y=R(k);const T=de(()=>e.activeEntryIndex<1);Te(y,{onclick:()=>i(1),get disabled(){return l(T)},color:"primary",class:"me-3",children:(E,C)=>{var P=pe("Move to Left (previous position)");o(E,P)},$$slots:{default:!0}});var S=w(y,2);const p=de(()=>e.activeEntryIndex===e.rowSchemaCopy.length-1);Te(S,{onclick:()=>i(-1),get disabled(){return l(p)},color:"primary",children:(E,C)=>{var P=pe("Move to Right (next position)");o(E,P)},$$slots:{default:!0}}),o(u,k)},$$slots:{default:!0}})},$$slots:{default:!0}}),o(f,g)},$$slots:{default:!0}});var c=w(d,2);Zt(c,{children:(f,m)=>{_t(f,{class:"w-100 p-4",size:"lg",children:(g,v)=>{const h=de(()=>a===e.activeEntryIndex);Te(g,{get disabled(){return l(h)},onclick:n,class:"me-3",color:"success",children:(x,u)=>{var _=pe("Confirm");o(x,_)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}}),o(t,s),me()}var Lh=b("
Progress step: 1/1
<!> <!>",1),Ch=b('
Edit spacer
<!>',1),Ah=b("<!> <!> <!>",1);function Th(t,e){var m,g;ge(e,!0);let r=ve(Ke.organigram.grid[e.rowIndex].rowSchema),a=Ee(!!((g=(m=r[e.activeEntryIndex])==null?void 0:m.size)!=null&&g.doubleX));function n(){r[e.activeEntryIndex]=l(a)?{size:{doubleX:!0}}:null}function i(){e.onUpdateRowSchema(r),Ze.nextStep()}dt(()=>(e.onShowHideOrganigramDev(!1),()=>{e.onShowHideOrganigramDev(!0)}));var s=Ah(),d=R(s);It(d,{children:(v,h)=>{var x=Lh(),u=w(R(x),2);Lr(u,{class:"my-2",animated:!0,color:"success",value:1,max:1});var _=w(u,2);dn(_,()=>r,()=>e.activeEntryIndex,()=>()=>{},()=>()=>{}),o(v,x)},$$slots:{default:!0}});var c=w(d,2);lt(c,{children:(v,h)=>{var x=Ch(),u=w(R(x),2);Fe(u,{children:(_,k)=>{var y=te(),T=R(y);He(T,16,()=>["Standard size","Double size"],Ve,(S,p,E)=>{Se(S,{name:"editSpacer",value:!!E,get label(){return p},required:!0,type:"radio",get group(){return l(a)},set group(C){W(a,ve(C))},$$events:{change:n}})}),o(_,y)},$$slots:{default:!0}}),o(v,x)},$$slots:{default:!0}});var f=w(c,2);Zt(f,{children:(v,h)=>{_t(v,{class:"w-100 p-4",size:"lg",children:(x,u)=>{Te(x,{color:"success",onclick:i,children:(_,k)=>{var y=pe("Confirm");o(_,y)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}}),o(t,s),me()}var $h=b("Edit mode: Use checkboxes to indicate what parts of the modal you wish to edit Checked means you need to edit, unchecked entries won't be changed. Each entry that was previously added or changed during the modal layout step will be checked by default and disabled as it needs valid data before it can be saved!
Reorder mode: Use arrows to move an entry. Reordering an element will be applied for each language
This step (edit/reordering mode) will be shown only if the modal has at least two entries.",1),zh=b('
Select what to edit and/or reorder: <!> <!>
<!> <!>
'),Dh=b('<!>
MODAL WITH OVERRIDES, DO NOT REORDER IN THIS FORM!
If possible, consider creating more versions instead of doing so many changes at once!
'),jh=b('
<!> <!>',1),Bh=b('<!> <!> <!> <!>',1);function Fh(t,e){ge(e,!0);let r=Ee(ve([...e.updatedModalSchema])),a=de(()=>l(r).flatMap(x=>x.checked?[!0]:[]).length);function n(x){const u=JSON.stringify(e.updatedModalSchema)===JSON.stringify(l(r)),_=e.modalLayoutWasHorizontal===e.modalLayoutHorizontal,k=u&&_&&!e.hasDeletedEntries;if(k&&l(r).every(y=>!y.checked)){alert("There are no position changes, no entries deleted and no entries flagged for edits. That would create a new version that is equal as the current version hence not allowed.");return}else if(!k&&l(r).every(y=>!y.checked))if(confirm("Changes detected and no modal entries selected for edits. Are you sure you want to skip language edits and create a new version now?")){const T=Pl(l(r));Ke.changeBoxModal(e.rowIndex,e.activeEntryIndex,T,e.modalLayoutHorizontal),e.onModalChangedFinal(),Ze.completed=!0;return}else return;e.onUpdateModalSchema(l(r)),Ze.nextStep()}dt(()=>(e.onShowHideOrganigramDev(!1),()=>{e.onShowHideOrganigramDev(!0)}));function i(x,u=!0){u&&x>0?(_=>(l(r)[x-1]=_[0],l(r)[x]=_[1]))([l(r)[x],l(r)[x-1]]):!u&&x(l(r)[x+1]=_[0],l(r)[x]=_[1]))([l(r)[x],l(r)[x+1]])}function s(x=!0){x?W(r,ve(l(r).map(u=>({...u,checked:!0})))):W(r,ve(l(r).map(u=>{var k;const _=!!((k=u.title)!=null&&k.en&&u.title.en[0]==="------");return{...u,checked:_}})))}var d=Bh(),c=R(d);It(c,{children:(x,u)=>{Lr(x,{class:"my-2",animated:!0,color:"success",get value(){return Ze.step},max:8})},$$slots:{default:!0}});var f=w(c,2);rr(f,{children:(x,u)=>{It(x,{children:(_,k)=>{var y=zh(),T=N(y),S=w(N(T));fe(S,{id:"btn-layout-dir-info",color:"info",name:"info-circle-fill mx-3"});var p=w(S,2);xt(p,{trigger:"hover",placement:"right",target:"btn-layout-dir-info",title:"Edit and Reorder Modes",children:(P,O)=>{var A=$h();o(P,A)},$$slots:{default:!0}});var E=w(T,2);Te(E,{color:"warning",class:"mx-3",$$events:{click:()=>s(!0)},children:(P,O)=>{var A=pe("Select all");o(P,A)},$$slots:{default:!0}});var C=w(E,2);Te(C,{color:"warning",class:"mx-3",$$events:{click:()=>s(!1)},children:(P,O)=>{var A=pe("Unselect all");o(P,A)},$$slots:{default:!0}}),o(_,y)},$$slots:{default:!0}})},$$slots:{default:!0}});var m=w(f,2);{var g=x=>{Wn(x,{class:"mt-0 p-3 d-flex align-items-center justify-content-between",color:"danger",children:(u,_)=>{var k=Dh(),y=R(k);fe(y,{class:"fs-1",name:"exclamation-triangle-fill"});var T=w(y,4);fe(T,{class:"fs-1",name:"exclamation-triangle-fill"}),o(u,k)},$$slots:{default:!0}})};V(m,x=>{e.rowSchemaCopy[e.activeEntryIndex].data.modalOveriddes&&x(g)})}var v=w(m,2);He(v,21,()=>l(r),Ve,(x,u,_)=>{var k=Mh(),y=N(k),T=N(y);const S=de(()=>{var C;return((C=l(u).title)==null?void 0:C.en)&&l(u).title.en[0]==="------"});Se(T,{class:"fs-3",get disabled(){return l(S)},type:"checkbox",label:"Entry #"+(_+1),get checked(){return l(u).checked},set checked(C){l(u).checked=C}});var p=w(y,2),E=N(p);rr(E,{class:"mb-0",children:(C,P)=>{var O=Ih(),A=R(O);lt(A,{children:($,z)=>{var I=te(),q=R(I);{var M=B=>{Un(B,()=>l(u),()=>_===0,()=>"en")},j=B=>{Vn(B,()=>l(u),()=>_+1!==l(r).length,()=>"en")};V(q,B=>{l(u).isList?B(M):B(j,!1)})}o($,I)},$$slots:{default:!0}});var L=w(A,2);Zt(L,{class:"d-flex align-items-center justify-content-center",children:($,z)=>{var I=Nh(),q=w(R(I),2);_t(q,{children:(M,j)=>{var B=Rh(),Y=R(B);Te(Y,{disabled:_===0,color:"primary",size:"sm",class:"mx-2 p-1",$$events:{click:()=>i(_)},children:(X,re)=>{fe(X,{class:"fs-5",name:"arrow-up"})},$$slots:{default:!0}});var U=w(Y,2);const Z=de(()=>_===l(r).length-1);Te(U,{get disabled(){return l(Z)},color:"primary",size:"sm",class:"mx-2 p-1",$$events:{click:()=>i(_,!1)},children:(X,re)=>{fe(X,{class:"fs-5",name:"arrow-down"})},$$slots:{default:!0}}),o(M,B)},$$slots:{default:!0}}),o($,I)},$$slots:{default:!0}}),o(C,O)},$$slots:{default:!0}}),F(()=>{ae(k,"list-color",l(u).isList),ae(k,"person-color",!l(u).isList)}),o(x,k)});var h=w(v,2);Zt(h,{children:(x,u)=>{var _=jh(),k=R(_),y=N(k),T=w(k,2);{var S=E=>{var C=qh();o(E,C)};V(T,E=>{l(a)>3&&E(S)})}var p=w(T,2);_t(p,{class:"w-100 p-4",size:"lg",children:(E,C)=>{Te(E,{onclick:n,color:"success",children:(P,O)=>{var A=pe("Confirm current selection");o(P,A)},$$slots:{default:!0}})},$$slots:{default:!0}}),F(()=>{ae(k,"text-danger",l(a)>3),ae(k,"text-success",l(a)<4),ee(y,`You selected ${l(a)??""} modal parts to edit.`)}),o(x,_)},$$slots:{default:!0}}),o(t,d),me()}function Rt(t,e=0){return{en:(t==null?void 0:t.en[e])??"",fr:(t==null?void 0:t.fr[e])??"",es:(t==null?void 0:t.es[e])??"",zh:(t==null?void 0:t.zh[e])??"",ru:(t==null?void 0:t.ru[e])??"",ar:(t==null?void 0:t.ar[e])??""}}function un(t){return{en:(t==null?void 0:t.en)??"",zh:(t==null?void 0:t.zh)??"",ru:(t==null?void 0:t.ru)??""}}function Wl(t){return{en:(t==null?void 0:t.en)??"",es:(t==null?void 0:t.es)??"",fr:(t==null?void 0:t.fr)??"",zh:(t==null?void 0:t.zh)??"",ru:(t==null?void 0:t.ru)??"",ar:(t==null?void 0:t.ar)??""}}function Hh(t){var e,r;return{titleTexts:Rt(t.title,0),titleTexts2:Rt(t.title,1),nameTexts:un(t.name),hasReportingLines:t.reportingLines!==void 0,hasLink:t.link!==void 0,hasImage:t.img!==void 0,reportingLines:Rt(t.reportingLines,0),reportingLines2:Rt(t.reportingLines,1),showSecondTitle:t.title.en.length>1,showSecondReportingLine:(((r=(e=t.reportingLines)==null?void 0:e.en)==null?void 0:r.length)??0)>1,img:t.img??"",link:t.link??""}}function Uh(t){var e,r;return{titleTexts:Rt(t.title,0),titleTexts2:Rt(t.title,1),nameTexts:un(t.name),officeText:Wl(t.office),hasReportingLines:t.reportingLines!==void 0,hasLink:t.link!==void 0,hasImage:t.img!==void 0,reportingLines:Rt(t.reportingLines,0),reportingLines2:Rt(t.reportingLines,1),showSecondTitle:t.title.en.length>1,showSecondReportingLine:(((r=(e=t.reportingLines)==null?void 0:e.en)==null?void 0:r.length)??0)>1,img:t.img??"",link:t.link??""}}function Vh(t){var e;return{hasTitle:t.title!==void 0,hasEntries:t.entries!==void 0,hasHr:t.endsWithHr??!1,titleTexts:Rt(t.title),entriesTexts:((e=t.entries)==null?void 0:e.map(r=>({en:r.en,fr:r.fr,es:r.es,zh:r.zh,ru:r.ru,ar:r.ar})))??[]}}function Ja(t,e){const r=e&&Object.values(e).some(n=>n);return{en:r?[t.en,e.en]:[t.en],fr:r?[t.fr,e.fr]:[t.fr],es:r?[t.es,e.es]:[t.es],zh:r?[t.zh,e.zh]:[t.zh],ru:r?[t.ru,e.ru]:[t.ru],ar:r?[t.ar,e.ar]:[t.ar]}}function Wh(t){return{en:[t.en],fr:[t.fr],es:[t.es],zh:[t.zh],ru:[t.ru],ar:[t.ar]}}var Zh=b("
Last switch is disabled since at least one field has to be active! Please enable another field before attempting to disable the last active one.
NO Automatic Prefixing (aka the field is stored as you provide it, raw, without any auto modification). Example: Input Example:"Reporting line: X" Will output:"Reporting line: X"
Double reporting lines
Automatic translated prefix Example: Input Example: X, Y Will output: "Reporting line A: X" "Reporting line B: Y" Note:Automatic prefix will show up in preview as soon as the field of second reporting line is filled.
',1),_1=b("<!> ",1),p1=b('
<!> Reporting Lines
<!> <!>
<!>',1),b1=b("<!> <!> <!>",1),y1=b("<!> <!> <!>",1),w1=b("<!> <!>",1),x1=b("<!> <!>",1),k1=b("<!> ",1),O1=b('If field image is disabled the default"Vacant" Image will be used.
Valid image link requirements:
FAO Domain is mandatory.
HTTPS protocol is mandatory.
Example of a valid image link: https://www.fao.org/images/aboutfaolibraries/organizationalchart/Name_Surname.jpg',1),E1=b('<!> Image
<!> <!>
',1),P1=b("<!> <!>",1),S1=b("<!> <!>",1),L1=b("<!> ",1),C1=b("Valid personal website link requirements:
FAO Domain is mandatory.
HTTPS protocol is mandatory.
As per every auto translated field should NEVER contain any language
Example of a valid link: https://www.fao.org/about/leadership/name-surname",1),A1=b('<!> Link
<!> <!>
<!>',1),T1=b("<!> <!>",1),$1=b("<!> <!>",1),z1=b("<!> <!> <!> <!> <!>",1);function D1(t,e){ge(e,!0);let r=Pt(e.entry),a=ve({...Hh(r),showSecondTitle:r.title.en.length>1,hasImage:r.img!==void 0});dt(()=>{a.hasReportingLines&&!r.reportingLines&&(a.showSecondReportingLine=!0),r.title=Ja(a.titleTexts,a.showSecondTitle?a.titleTexts2:void 0),r.name=un(a.nameTexts),a.hasReportingLines?r.reportingLines=Ja(a.reportingLines,a.showSecondReportingLine?a.reportingLines2:void 0):delete r.reportingLines,r.img=a.hasImage?a.img:void 0,a.hasLink&&a.link?r.link=a.link:delete r.link,e.onModalChanged({...r})});var n=z1(),i=R(n);Fe(i,{children:(u,_)=>{var k=o1(),y=R(k);ot(y,{class:"d-flex align-items-center justify-content-between",children:(E,C)=>{var P=i1(),O=w(R(P),2);{var A=L=>{const $=de(()=>a.showSecondTitle?"danger":"success");Te(L,{onclick:z=>{z.preventDefault(),a.showSecondTitle=!a.showSecondTitle},size:"sm",get color(){return l($)},children:(z,I)=>{var q=n1(),M=R(q);const j=de(()=>a.showSecondTitle?"trash-fill":"plus-lg");fe(M,{get name(){return l(j)}});var B=w(M);F(()=>ee(B,` ${(a.showSecondTitle?"Remove":"Add")??""} Second Title`)),o(z,q)},$$slots:{default:!0}})};V(O,L=>{e.lang==="en"&&L(A)})}o(E,P)},$$slots:{default:!0}});var T=w(y,2);rt(T,{theme:"light",class:"mb-2",children:(E,C)=>{var P=l1(),O=R(P);Ie(O,{class:"py-0",children:(z,I)=>{fe(z,{class:"fs-5",name:"textarea-t"})},$$slots:{default:!0}});var A=w(O,2);const L=de(()=>`${e.lang.toUpperCase()} primary title`);Se(A,{type:"text",required:!0,pattern:"^(?!.*------).*",minlength:2,get placeholder(){return l(L)},get value(){return a.titleTexts[e.lang]},set value(z){a.titleTexts[e.lang]=z}});var $=w(A,2);Ie($,{class:"py-0",children:(z,I)=>{var q=pe();F(M=>ee(q,M),[()=>e.lang.toUpperCase()]),o(z,q)},$$slots:{default:!0}}),o(E,P)},$$slots:{default:!0}});var S=w(T,2);{var p=E=>{rt(E,{theme:"light",children:(C,P)=>{var O=s1(),A=R(O);Ie(A,{class:"py-0",children:(I,q)=>{fe(I,{class:"fs-5",name:"textarea-t"})},$$slots:{default:!0}});var L=w(A,2);const $=de(()=>`${e.lang.toUpperCase()} secondary title`);Se(L,{type:"text",required:!0,pattern:"^(?!.*------).*",minlength:2,get placeholder(){return l($)},get value(){return a.titleTexts2[e.lang]},set value(I){a.titleTexts2[e.lang]=I}});var z=w(L,2);Ie(z,{class:"py-0",children:(I,q)=>{var M=pe();F(j=>ee(M,j),[()=>e.lang.toUpperCase()]),o(I,M)},$$slots:{default:!0}}),o(C,O)},$$slots:{default:!0}})};V(S,E=>{a.showSecondTitle&&E(p)})}o(u,k)},$$slots:{default:!0}});var s=w(i,4);{var d=u=>{var _=f1(),k=R(_);Fe(k,{children:(y,T)=>{var S=u1(),p=R(S);ot(p,{class:"d-flex align-items-center",children:(C,P)=>{var O=c1();o(C,O)},$$slots:{default:!0}});var E=w(p,2);rt(E,{theme:"light",children:(C,P)=>{var O=d1(),A=R(O);Ie(A,{class:"py-0",children:(I,q)=>{fe(I,{class:"fs-5",name:"person"})},$$slots:{default:!0}});var L=w(A,2);const $=de(()=>`${e.lang.toUpperCase()} name`);Se(L,{type:"text",required:!0,pattern:"^(?!.*------).*",minlength:2,get placeholder(){return l($)},get value(){return a.nameTexts[e.lang]},set value(I){a.nameTexts[e.lang]=I}});var z=w(L,2);Ie(z,{class:"py-0",children:(I,q)=>{var M=pe();F(j=>ee(M,j),[()=>e.lang.toUpperCase()]),o(I,M)},$$slots:{default:!0}}),o(C,O)},$$slots:{default:!0}}),o(y,S)},$$slots:{default:!0}}),o(u,_)},c=u=>{Fe(u,{children:(_,k)=>{var y=g1(),T=R(y);ot(T,{class:"d-flex align-items-center",children:(p,E)=>{var C=v1();o(p,C)},$$slots:{default:!0}});var S=w(T,2);rt(S,{class:"disabled-field",children:(p,E)=>{var C=h1(),P=R(C);Ie(P,{class:"py-0",children:(L,$)=>{fe(L,{class:"fs-5",name:"person"})},$$slots:{default:!0}});var O=w(P,2);Se(O,{type:"text",get value(){return a.nameTexts.en},disabled:!0,readonly:!0});var A=w(O,2);Ie(A,{class:"py-0",children:(L,$)=>{var z=pe();F(I=>ee(z,I),[()=>e.lang.toUpperCase()]),o(L,z)},$$slots:{default:!0}}),o(p,C)},$$slots:{default:!0}}),o(_,y)},$$slots:{default:!0}})};V(s,u=>{e.lang==="en"||e.lang==="zh"||e.lang==="ru"?u(d):u(c,!1)})}var f=w(s,2);{var m=u=>{var _=k1(),k=R(_);Fe(k,{children:(y,T)=>{var S=x1(),p=R(S);ot(p,{class:"d-flex align-items-center justify-content-between",children:(P,O)=>{var A=p1(),L=R(A),$=N(L);{var z=U=>{Se(U,{type:"switch",class:"mb-0 me-1",get checked(){return a.hasReportingLines},set checked(Z){a.hasReportingLines=Z}})};V($,U=>{e.lang==="en"&&U(z)})}var I=w($,2),q=w(I,2),M=N(q);fe(M,{get id(){return`btn-rl-${e.indexInList??""}-info`},color:"info",name:"info-circle-fill ms-3"});var j=w(M,2);xt(j,{trigger:"hover",placement:"right",get target(){return`btn-rl-${e.indexInList??""}-info`},title:"Report lines",children:(U,Z)=>{var X=m1();o(U,X)},$$slots:{default:!0}});var B=w(L,2);{var Y=U=>{const Z=de(()=>a.showSecondReportingLine?"danger":"success");Te(U,{size:"sm",get color(){return l(Z)},onclick:X=>{X.preventDefault(),a.showSecondReportingLine=!a.showSecondReportingLine},children:(X,re)=>{var le=_1(),ne=R(le);const Q=de(()=>a.showSecondReportingLine?"trash-fill":"plus-lg");fe(ne,{get name(){return l(Q)}});var ue=w(ne);F(()=>ee(ue,` ${(a.showSecondReportingLine?"Remove":"Add")??""} Second Line`)),o(X,le)},$$slots:{default:!0}})};V(B,U=>{a.hasReportingLines&&e.lang==="en"&&U(Y)})}F(()=>{ae(I,"text-success",a.hasReportingLines),ae(I,"text-danger",!a.hasReportingLines)}),o(P,A)},$$slots:{default:!0}});var E=w(p,2);{var C=P=>{var O=w1(),A=R(O);rt(A,{theme:"light",class:"mb-2",children:(z,I)=>{var q=b1(),M=R(q);Ie(M,{class:"py-0",children:(U,Z)=>{fe(U,{class:"fs-5",name:"diagram-2"})},$$slots:{default:!0}});var j=w(M,2);const B=de(()=>`${e.lang.toUpperCase()} primary reporting line`);Se(j,{type:"text",pattern:"^(?!.*------).*",minlength:2,required:!0,get placeholder(){return l(B)},get value(){return a.reportingLines[e.lang]},set value(U){a.reportingLines[e.lang]=U}});var Y=w(j,2);Ie(Y,{class:"py-0",children:(U,Z)=>{var X=pe();F(re=>ee(X,re),[()=>e.lang.toUpperCase()]),o(U,X)},$$slots:{default:!0}}),o(z,q)},$$slots:{default:!0}});var L=w(A,2);{var $=z=>{rt(z,{theme:"light",children:(I,q)=>{var M=y1(),j=R(M);Ie(j,{class:"py-0",children:(Z,X)=>{fe(Z,{class:"fs-5",name:"diagram-2"})},$$slots:{default:!0}});var B=w(j,2);const Y=de(()=>`${e.lang.toUpperCase()} secondary reporting line`);Se(B,{type:"text",pattern:"^(?!.*------).*",minlength:2,required:!0,get placeholder(){return l(Y)},get value(){return a.reportingLines2[e.lang]},set value(Z){a.reportingLines2[e.lang]=Z}});var U=w(B,2);Ie(U,{class:"py-0",children:(Z,X)=>{var re=pe();F(le=>ee(re,le),[()=>e.lang.toUpperCase()]),o(Z,re)},$$slots:{default:!0}}),o(I,M)},$$slots:{default:!0}})};V(L,z=>{a.showSecondReportingLine&&z($)})}o(P,O)};V(E,P=>{a.hasReportingLines&&P(C)})}o(y,S)},$$slots:{default:!0}}),o(u,_)};V(f,u=>{(e.lang==="en"||a.hasReportingLines)&&u(m)})}var g=w(f,2);{var v=u=>{var _=L1(),k=R(_);Fe(k,{children:(y,T)=>{var S=S1(),p=R(S);ot(p,{class:"d-flex align-items-center",children:(P,O)=>{var A=E1(),L=R(A);Se(L,{disabled:!1,type:"switch",class:"mb-0 me-1",get checked(){return a.hasImage},set checked(M){a.hasImage=M}});var $=w(L,2),z=w(N($)),I=N(z);fe(I,{get id(){return`btn-image-${e.indexInList??""}-info`},color:"info",name:"info-circle-fill ms-3"});var q=w(I,2);xt(q,{trigger:"hover",placement:"right",get target(){return`btn-image-${e.indexInList??""}-info`},title:"Image link",children:(M,j)=>{var B=O1();o(M,B)},$$slots:{default:!0}}),F(()=>{ae($,"text-success",a.hasImage),ae($,"text-danger",!a.hasImage)}),o(P,A)},$$slots:{default:!0}});var E=w(p,2);{var C=P=>{rt(P,{theme:"light",children:(O,A)=>{var L=P1(),$=R(L);Ie($,{class:"py-0",children:(I,q)=>{fe(I,{class:"fs-5",name:"image"})},$$slots:{default:!0}});var z=w($,2);Se(z,{class:"smaller",type:"url",required:!0,pattern:"https://(.*\\.)?fao\\.org(/.*)?$",minlength:2,placeholder:"Image URL",get value(){return a.img},set value(I){a.img=I}}),o(O,L)},$$slots:{default:!0}})};V(E,P=>{a.hasImage&&P(C)})}o(y,S)},$$slots:{default:!0}}),o(u,_)};V(g,u=>{e.lang==="en"&&u(v)})}var h=w(g,2);{var x=u=>{Fe(u,{children:(_,k)=>{var y=$1(),T=R(y);ot(T,{class:"d-flex align-items-center",children:(E,C)=>{var P=A1(),O=R(P);Se(O,{disabled:!1,type:"switch",class:"mb-0 me-1",get checked(){return a.hasLink},set checked(q){a.hasLink=q}});var A=w(O,2),L=w(N(A)),$=N(L);fe($,{get id(){return`btn-linkp-${e.indexInList??""}-info`},color:"info",name:"info-circle-fill ms-3"});var z=w($,2);xt(z,{trigger:"hover",placement:"right",get target(){return`btn-linkp-${e.indexInList??""}-info`},title:"Personal Website link",children:(q,M)=>{var j=C1();o(q,j)},$$slots:{default:!0}});var I=w(L,2);Cl(I,{class:"ms-3",pill:!0,color:"info",children:(q,M)=>{var j=pe("Auto translated");o(q,j)},$$slots:{default:!0}}),F(()=>{ae(A,"text-success",a.hasLink),ae(A,"text-danger",!a.hasLink)}),o(E,P)},$$slots:{default:!0}});var S=w(T,2);{var p=E=>{rt(E,{theme:"light",children:(C,P)=>{var O=T1(),A=R(O);Ie(A,{class:"py-0",children:($,z)=>{fe($,{class:"fs-5",name:"link-45deg"})},$$slots:{default:!0}});var L=w(A,2);Se(L,{type:"text",required:!0,pattern:"https://(.*\\.)?fao\\.org(/.*)?$",minlength:2,placeholder:"Link URL",get value(){return a.link},set value($){a.link=$}}),o(C,O)},$$slots:{default:!0}})};V(S,E=>{a.hasLink&&E(p)})}o(_,y)},$$slots:{default:!0}})};V(h,u=>{e.lang==="en"&&u(x)})}o(t,n),me()}var R1=b("The structure (aka the schema) of the modal entries can be changed in English only (to ensure the form is filled with all required translations). Each subsequent language translation will have to be filled according to the English structure.
Optional fields have switches. If a switch is activated, data must be provided. Lists Forms must have at least one field marked as active in order to be considered valid. Person Forms must have at least a working title and a name. If there is no image is provided, the default (vacant) image will be used
",1),N1=b('
<!>
<!>
'),I1=b('
<!>
<!>
'),M1=b('
<!>
'),q1=b('
Currently editing Language : <!> <!>
',1),j1=b("<!> <!>",1),B1=b("<!> <!>",1),F1=b("<!> <!>",1);function H1(t,e){ge(e,!0);let r=ve([!1,!1,!1,!1,!1,!1]),a=Pt(e.updatedModalSchema),n=ve(a),i=Ee(0),s=Ee(ve(e.updatedModalSchema.findIndex(_=>_.checked)));const d=["en","fr","es","zh","ru","ar"],c={en:"English",fr:"French",es:"Spanish",ru:"Russian",zh:"Chinese",ar:"Arabic"};async function f(_){if(_.preventDefault(),r[l(i)]=!0,Va(i),W(s,0),l(i)===d.length){if(JSON.stringify(a)===JSON.stringify(n)){alert("No changes detected, going back to English. Either this is a bug with the Modal Changes Detector (alert a dev about this), or you forgot to do ANY change in the edit mode."),r.map(y=>!1),W(i,0),W(s,0);return}const k=Pl(n);Ke.changeBoxModal(e.rowIndex,e.activeEntryIndex,k,e.modalLayoutHorizontal),e.onModalChangedFinal(),Ze.nextStep()}else{await Ua();const k=document.querySelector('.edit-active input[type="text"]');k==null||k.focus()}}function m(_=null){_&&_.preventDefault(),r.map(k=>!1),W(i,0),W(s,0)}dt(()=>(e.onShowHideOrganigramDev(!1),()=>{e.onShowHideOrganigramDev(!0)}));async function g(_){W(s,ve(_)),await Ua();const k=document.querySelector(".fake-modal .card.edit-active");k&&(k.scrollIntoView({behavior:"smooth",block:"center"}),k.scrollBy(0,20))}function v(_,k){n[k]=_}var h=F1(),x=R(h);It(x,{children:(_,k)=>{const y=de(()=>3+l(i));Lr(_,{class:"my-2",animated:!0,color:"success",get value(){return l(y)},max:8})},$$slots:{default:!0}});var u=w(x,2);lt(u,{children:(_,k)=>{var y=te(),T=R(y);ln(T,()=>d[l(i)],S=>{cn(S,{get validated(){return r[l(i)]},onsubmit:f,children:(p,E)=>{var C=B1(),P=R(C);lt(P,{children:(A,L)=>{var $=q1(),z=R($),I=w(N(z)),q=N(I),M=w(I,2);fe(M,{id:"edit-lang-info",color:"info",name:"info-circle-fill mx-3"});var j=w(M,2);xt(j,{trigger:"hover",placement:"right",target:"edit-lang-info",title:"Modal Language Edit Info",children:(Y,U)=>{var Z=R1();o(Y,Z)},$$slots:{default:!0}});var B=w(z,2);He(B,21,()=>n,Ve,(Y,U,Z)=>{var X=te(),re=R(X);{var le=ne=>{var Q=M1(),ue=N(Q);rr(ue,{class:"mb-0",onclick:K=>g(Z),children:(K,Ce)=>{lt(K,{children:(ye,se)=>{var ze=te(),ce=R(ze);{var Xe=ke=>{var Ue=N1(),Pe=N(Ue),gt=N(Pe);a1(gt,{get lang(){return d[l(i)]},get entry(){return n[Z]},onModalChanged:Je=>v(Je,Z)});var Be=w(Pe,2),Le=N(Be);lt(Le,{children:(Je,Ne)=>{Un(Je,()=>l(U),()=>Z===0,()=>d[l(i)])},$$slots:{default:!0}}),F(()=>ae(Be,"edit-active",l(s)===Z)),o(ke,Ue)},Re=ke=>{var Ue=I1(),Pe=N(Ue),gt=N(Pe);D1(gt,{indexInList:Z,get entry(){return n[Z]},get lang(){return d[l(i)]},onModalChanged:Je=>v(Je,Z)});var Be=w(Pe,2),Le=N(Be);lt(Le,{children:(Je,Ne)=>{Vn(Je,()=>l(U),()=>Z+1!==n.length,()=>d[l(i)])},$$slots:{default:!0}}),F(()=>ae(Be,"edit-active",l(s)===Z)),o(ke,Ue)};V(ce,ke=>{l(U).isList?ke(Xe):ke(Re,!1)})}o(ye,ze)},$$slots:{default:!0}})},$$slots:{default:!0}}),F(()=>ae(Q,"edit-active",Z===l(s))),o(ne,Q)};V(re,ne=>{l(U).checked&&ne(le)})}o(Y,X)}),F(Y=>ee(q,Y),[()=>c[d[l(i)]].toLocaleUpperCase()]),o(A,$)},$$slots:{default:!0}});var O=w(P,2);Zt(O,{children:(A,L)=>{_t(A,{class:"w-100 px-2 pt-2 pb-3",size:"lg",children:($,z)=>{var I=j1(),q=R(I);Te(q,{class:"w-75",color:"success",children:(B,Y)=>{var U=pe();F(Z=>ee(U,`Confirm language ${Z??""}`),[()=>c[d[l(i)]].toLocaleUpperCase()]),o(B,U)},$$slots:{default:!0}});var M=w(q,2);const j=de(()=>d[l(i)]==="en");Te(M,{get disabled(){return l(j)},onclick:m,class:"w-25 ms-5",color:"danger",children:(B,Y)=>{var U=pe("Reset to EN");o(B,U)},$$slots:{default:!0}}),o($,I)},$$slots:{default:!0}})},$$slots:{default:!0}}),o(p,C)},$$slots:{default:!0}})}),o(_,y)},$$slots:{default:!0}}),o(t,h),me()}var U1=b("<!> ",1),V1=b('Job Title <!>',1),W1=b("<!> <!> <!>",1),Z1=b("<!> <!> <!>",1),Y1=b("<!> <!> <!>",1),J1=b('Name'),X1=b("<!> <!> <!>",1),G1=b("<!> <!>",1),K1=b('Office'),Q1=b("<!> <!> <!>",1),eg=b("<!> <!>",1),tg=b("<!> <!> ",1),rg=b('Name'),ag=b("<!> <!> <!>",1),ng=b("<!> <!>",1),ig=b('Reporting lines can be 1 or 2.
Single reporting lines
NO Automatic Prefixing (aka the field is stored as you provide it, raw, without any auto modification). Example: Input Example:"Reporting line: X" Will output:"Reporting line: X"
Double reporting lines
Automatic translated prefix Example: Input Example: X, Y Will output: "Reporting line A: X" "Reporting line B: Y" Note:Automatic prefix will show up in preview as soon as the field of second reporting line is filled.
',1),lg=b("<!> ",1),sg=b('
Reporting Lines
<!> <!>
<!>',1),og=b("<!> <!> <!>",1),cg=b("<!> <!> <!>",1),dg=b("<!> <!>",1),ug=b("<!> <!>",1),fg=b("<!> ",1),vg=b('If field image is disabled the default"Vacant" Image will be used.
Valid image link requirements:
FAO Domain is mandatory.
HTTPS protocol is mandatory.
Example of a valid image link: https://www.fao.org/images/aboutfaolibraries/organizationalchart/Name_Surname.jpg',1),hg=b('<!> Image
<!> <!>
',1),gg=b("<!> <!>",1),mg=b("<!> <!>",1),_g=b("<!> ",1),pg=b("Valid Office website link requirements:
FAO Domain is mandatory.
HTTPS protocol is mandatory.
Link can be translated.
Example of a valid link: https://www.fao.org/new-york/en/",1),bg=b('<!> Office Link
<!>',1),$g=b("<!> <!>",1);function zg(t,e){ge(e,!0);const r=[`${e.isRealBox?"Box":"Spacer"} position`,`${e.isRealBox?"Box":"Spacer size"}`,"Modal"].filter((d,c)=>e.isRealBox||c<2);e.isRealBox&&e.rowSchemaCopy[e.activeEntryIndex]&&e.rowSchemaCopy[e.activeEntryIndex].data.modalOveriddes&&r.push("LIAISON OFFICES accordion (inside modal)");let a=Ee(null),n=!1;function i(d){d.preventDefault(),d.target.checkValidity()&&s(l(a),e.isRealBox)}function s(d,c){if(typeof d=="number"){switch(d){case 0:Ze.questions=[Sh];break;case 1:Ze.questions=c?[Vl]:[Th];break;case 2:Ze.questions=[kh,Fh,H1];break;case 3:Ze.questions=[Ag];break;default:console.error("Wrong number passed to WhatToEdit!")}Ze.nextStep()}}cn(t,{get validated(){return n},onsubmit:i,children:(d,c)=>{var f=$g(),m=R(f);lt(m,{children:(v,h)=>{var x=Tg(),u=w(R(x),2);Fe(u,{children:(_,k)=>{var y=te(),T=R(y);He(T,17,()=>r,Ve,(S,p,E)=>{Se(S,{name:"WhatToEdit",value:E,get label(){return l(p)},required:!0,type:"radio",get group(){return l(a)},set group(C){W(a,ve(C))}})}),o(_,y)},$$slots:{default:!0}}),o(v,x)},$$slots:{default:!0}});var g=w(m,2);Zt(g,{children:(v,h)=>{_t(v,{class:"w-100 p-4",size:"lg",children:(x,u)=>{Te(x,{color:"success",children:(_,k)=>{var y=pe("Confirm");o(_,y)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}}),o(d,f)},$$slots:{default:!0}}),me()}var Dg=b(`Progress state depends on the required steps to perform a valid change.
Steps will start as undefined (until you specify what kind of edit is required). Steps can increase or decrease based on the edit requirements. If the form automatically "skips" steps, it’s not a bug — it means a step became redundant due to current requirements and was auto-completed.
Example of Auto Step Skip: If a modal has only one entry, the select/reorder step is skipped. There's nothing to reorder, and it’s assumed you want to edit the only entry.
To add box/spacer click on any existing entry and then select "add before" or "add after"
Example 1: you want to add a box as first entry? click the first entry then, in the next form, select previous position Example 2: you want to add a box as last entry? click the last entry then, in the next form, select next position Example 3: you want to add a box as the 2nd entry of a row with 3+ existing boxes? click the first box then select next position or click second box then select previous position',1),Hg=b('
Click a box/spacer next to where you want to add the new one <!> <!>
'),Ug=b("<!> <!>",1),Vg=b('
Confirm your current selection?
<!>
'),Wg=b("<!> <!>",1),Zg=b('
Confirm or Undo?
<!>
',1),Yg=b("<!> <!>",1),Jg=b('
<!>
<!>
<!>
');function Xg(t,e){ge(e,!0);let r=D(e,"boxAction",15),a=Ee(null),n=Ee(!1),i=Ee(null);dt(()=>(document.documentElement.style.overflowY="hidden",document.documentElement.style.height="100%",document.body.style.overflowY="hidden",document.body.style.height="100%",()=>{document.documentElement.style.overflowY="",document.documentElement.style.height="",document.body.style.overflowY="",document.body.style.height=""}));function s(){r()==="delete"?confirm("This will delete the highlighted box. Please consider keeping a backup, once you upload the new JSON to Sitefinity this data will be lost forever!")&&(Ke.removeBox(e.rowIndex,l(a)),W(a,null),W(n,!0)):W(i,!0)}function d(){Ke.restoreVersion(Ke.history.length-1),W(n,!1),r(null)}function c(E){W(a,ve(E))}var f=Jg(),m=N(f),g=N(m),v=N(g),h=N(v),x=N(h),u=w(h,2);{var _=E=>{var C=jg();C.__click=[qg,r];var P=N(C);fe(P,{name:"x-lg"}),o(E,C)};V(u,E=>{l(n)||E(_)})}var k=w(v,2);{var y=E=>{var C=te(),P=R(C);{var O=L=>{var $=Bg(),z=N($);F(()=>ee(z,`Click the box/spacer you want to ${r()??""}`)),o(L,$)},A=L=>{var $=Hg(),z=w(N($));fe(z,{id:"btn-add-info",color:"info",name:"info-circle-fill mx-3"});var I=w(z,2);xt(I,{trigger:"hover",placement:"bottom",target:"btn-add-info",title:"Direction info",children:(q,M)=>{var j=Fg();o(q,j)},$$slots:{default:!0}}),o(L,$)};V(P,L=>{r()!=="add"?L(O):L(A,!1)})}o(E,C)};V(k,E=>{!l(i)&&!l(n)&&E(y)})}var T=w(g,2);{var S=E=>{var C=te(),P=R(C);{var O=L=>{eh(L,{get rowIndex(){return e.rowIndex},get activeEntryIndex(){return l(a)},get stepDone(){return l(n)},set stepDone($){W(n,ve($))}})},A=L=>{var $=te(),z=R($);{var I=q=>{Mg(q,{get rowIndex(){return e.rowIndex},get activeEntryIndex(){return l(a)},get stepDone(){return l(n)},set stepDone(M){W(n,ve(M))}})};V(z,q=>{l(a)!==null&&q(I)},!0)}o(L,$)};V(P,L=>{r()==="add"?L(O):L(A,!1)})}o(E,C)},p=E=>{var C=Yg(),P=R(C);dn(P,()=>Ke.organigram.grid[e.rowIndex].rowSchema,()=>l(a),()=>c,()=>c);var O=w(P,2);{var A=$=>{var z=Vg(),I=w(N(z),2);_t(I,{class:"d-flex align-items-center mt-5",children:(q,M)=>{var j=Ug(),B=R(j);Te(B,{onclick:s,class:"mx-5 p-3",color:"success",children:(U,Z)=>{var X=pe("Confirm");o(U,X)},$$slots:{default:!0}});var Y=w(B,2);Te(Y,{onclick:()=>W(a,null),class:"mx-5 p-3",color:"danger",children:(U,Z)=>{var X=pe("Unselect");o(U,X)},$$slots:{default:!0}}),o(q,j)},$$slots:{default:!0}}),o($,z)},L=$=>{var z=te(),I=R(z);{var q=M=>{var j=Zg(),B=w(R(j),2),Y=N(B);_t(Y,{class:"d-flex align-items-center mt-5",children:(U,Z)=>{var X=Wg(),re=R(X);Te(re,{onclick:()=>r(null),class:"mx-5 p-3",color:"success",children:(ne,Q)=>{var ue=pe("Confirm");o(ne,ue)},$$slots:{default:!0}});var le=w(re,2);Te(le,{onclick:d,class:"mx-5 p-3",color:"danger",children:(ne,Q)=>{var ue=pe("Undo");o(ne,ue)},$$slots:{default:!0}}),o(U,X)},$$slots:{default:!0}}),o(M,j)};V(I,M=>{l(n)&&M(q)},!0)}o($,z)};V(O,$=>{typeof l(a)=="number"&&!l(i)?$(A):$(L,!1)})}o(E,C)};V(T,E=>{l(i)&&!l(n)?E(S):E(p,!1)})}F(E=>ee(x,`${E??""} MODE`),[()=>{var E;return(E=r())==null?void 0:E.toLocaleUpperCase()}]),o(t,f),me()}Yr(["click"]);var Gg=b("ADD <!>",1),Kg=b("CHANGE <!>",1),Qg=b("<!> DELETE <!>",1),em=b("<!> <!> <!>",1),tm=b("<!> <!>",1);function rm(t,e){let r=Ee(null);var a=tm(),n=R(a);_t(n,{class:"w-100 d-flex",children:(d,c)=>{var f=em(),m=R(f);Te(m,{size:"sm",class:"me-3",color:"success",onclick:()=>W(r,"add"),children:(h,x)=>{var u=Gg(),_=w(R(u));fe(_,{name:"plus-lg"}),o(h,u)},$$slots:{default:!0}});var g=w(m,2);Te(g,{size:"sm",class:"me-3",color:"warning",onclick:()=>W(r,"edit"),children:(h,x)=>{var u=Kg(),_=w(R(u));fe(_,{name:"pencil-fill"}),o(h,u)},$$slots:{default:!0}});var v=w(g,2);Te(v,{size:"sm",color:"danger",onclick:()=>W(r,"delete"),children:(h,x)=>{var u=Qg(),_=R(u);fe(_,{name:"exclamation-triangle-fill"});var k=w(_,2);fe(k,{name:"exclamation-triangle-fill"}),o(h,u)},$$slots:{default:!0}}),o(d,f)},$$slots:{default:!0}});var i=w(n,2);{var s=d=>{Xg(d,{get rowIndex(){return e.index},get boxAction(){return l(r)},set boxAction(c){W(r,ve(c))}})};V(i,d=>{l(r)&&d(s)})}o(t,a)}var am=b("ADD Above <!>",1),nm=b("ADD Below <!>",1),im=b("<!> REMOVE Row <!>",1),lm=b("<!> <!> <!>",1);function sm(t,e){ge(e,!0),_t(t,{class:"w-100 d-flex",children:(r,a)=>{var n=lm(),i=R(n);Te(i,{size:"sm",class:"me-3",color:"success",onclick:()=>Ke.addRow(e.index,!0),children:(c,f)=>{var m=am(),g=w(R(m));fe(g,{name:"arrow-up"}),o(c,m)},$$slots:{default:!0}});var s=w(i,2);Te(s,{size:"sm",class:"me-3",color:"success",onclick:()=>Ke.addRow(e.index+1),children:(c,f)=>{var m=nm(),g=w(R(m));fe(g,{name:"arrow-down"}),o(c,m)},$$slots:{default:!0}});var d=w(s,2);Te(d,{size:"sm",color:"danger",onclick:()=>Ke.removeRow(e.index),children:(c,f)=>{var m=im(),g=R(m);fe(g,{name:"exclamation-triangle-fill"});var v=w(g,2);fe(v,{name:"exclamation-triangle-fill"}),o(c,m)},$$slots:{default:!0}}),o(r,n)},$$slots:{default:!0}}),me()}var om=b('