filecat 6.45.3 → 6.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/build/dist/124.23fa0d2699d9618dda9b.js +1 -0
  2. package/build/dist/{9725.c0f5fe759b3f29ad5989.js → 1240.8141c3584667c9b102c5.js} +1 -1
  3. package/build/dist/125.46b0b0838cec5442fdf6.js +1 -0
  4. package/build/dist/{1472.f10cd19f1ebc66d06ca5.js → 1472.822ac655d838f1a02b9a.js} +1 -1
  5. package/build/dist/{6202.f1c6599d8628dfe0f47d.js → 1715.b6871d580981169bbdc4.js} +1 -1
  6. package/build/dist/{8888.c714553db9ff11c9da25.js → 1730.f999109734b2ec283532.js} +1 -1
  7. package/build/dist/{4892.2bcb6c2d911a8d6049e6.js → 1750.36c146cd44049aaf79bc.js} +1 -1
  8. package/build/dist/{1218.bb8814412156c1a05a8c.js → 1772.7868dde9477de83bca1b.js} +1 -1
  9. package/build/dist/2449.0a762cd0483921adb91b.js +1 -0
  10. package/build/dist/2535.15ea6ba73588f47dc278.js +1 -0
  11. package/build/dist/{3813.6430f39e6bcabeb141ba.js → 2549.d0b9ca007ebae4995c22.js} +1 -1
  12. package/build/dist/2862.b1506f9eda52fa4f64cd.js +1 -0
  13. package/build/dist/2979.a1aa1f822cfc6c15f4a7.js +1 -0
  14. package/build/dist/{9499.bd13c877be5faa569e76.js → 3386.cc4b0d13967d3d1ac1ac.js} +1 -1
  15. package/build/dist/{6317.0929fcd5463e5e8e67d1.js → 3743.847ccbdcf5b607eec417.js} +1 -1
  16. package/build/dist/{8814.5157a8490dc97bab58c8.js → 3822.7e8ba22abbc6a60e6e20.js} +1 -1
  17. package/build/dist/{9786.cd9c2e2e7602e4310054.js → 3975.fde79b562d1f76f82274.js} +1 -1
  18. package/build/dist/{2018.8ee7ad4c73b038c713c5.js → 4619.1f7d8bf06c69e2ce9de7.js} +1 -1
  19. package/build/dist/{2640.6877d2665aa4ee6a1a85.js → 4625.a6a593542f4f2ebdae0f.js} +1 -1
  20. package/build/dist/{1082.e5badad25358d9fb3079.js → 4877.c31b8c8ee069225abc0d.js} +1 -1
  21. package/build/dist/5014.ff2b55369c42ab3cdda2.js +1 -0
  22. package/build/dist/{2726.52ceb81411f86822798f.js → 5135.9c0adbfd935bc46dd00d.js} +1 -1
  23. package/build/dist/5222.540853902e9c52d28220.js +1 -0
  24. package/build/dist/{7551.fd0ef76160cc344a6cfc.js → 5708.d62ffec88d557ee68f7b.js} +1 -1
  25. package/build/dist/5877.4e8f34819a3ae8da88b7.js +1 -0
  26. package/build/dist/5919.8a2c39a0e1623d795ee5.js +1 -0
  27. package/build/dist/5976.67aa23f2625209b8003b.js +1 -0
  28. package/build/dist/6002.1c2ff6a9c94ee343dded.js +1 -0
  29. package/build/dist/6110.a21be9c843a97bad11d5.js +1 -0
  30. package/build/dist/6402.dc70cc4e1530b8f1519d.js +1 -0
  31. package/build/dist/648.ca43171884d81b27c3a3.js +1 -0
  32. package/build/dist/{5061.5a9a6052bb6d3c895bc0.js → 6794.2fe35b73c565a07ec864.js} +1 -1
  33. package/build/dist/7017.274f83a8995232a6a9a0.js +1 -0
  34. package/build/dist/736.086cd9a8f1598c9f0ac7.js +1 -0
  35. package/build/dist/764.7c29eaf9d7edbee8467e.js +1 -0
  36. package/build/dist/{5181.1493235f192ed0e34fa8.js → 7887.2edcfdeb215d33478936.js} +1 -1
  37. package/build/dist/{4775.2e9cd58436b05580eb1c.js → 8018.02ea29dc6f59bbfaaee0.js} +1 -1
  38. package/build/dist/{5460.d692ffc021e7b872705d.js → 8136.dc1403b91767ca089293.js} +1 -1
  39. package/build/dist/{8256.0e3d9a5222004414b053.js → 8220.3ddda498d174349e189c.js} +1 -1
  40. package/build/dist/8233.6f5cd229953db8462d7d.js +1 -0
  41. package/build/dist/8535.9d68b1a6589a813c5bf1.js +1 -0
  42. package/build/dist/8947.55d1c2f1238de7f51549.js +2 -0
  43. package/build/dist/{4371.773ef273063e38ac1fd1.js → 9256.5d9a03011b69d1504ae4.js} +1 -1
  44. package/build/dist/9307.2c9d7f6089fef297b1c1.js +1 -0
  45. package/build/dist/{2703.e711df3217f7b4dfc978.js → 9352.6ebe66d0487686642ec9.js} +1 -1
  46. package/build/dist/index.html +1 -1
  47. package/build/dist/main.5bc1e6b78e3174e3fe27.js +2 -0
  48. package/build/main.js +1 -1
  49. package/package.json +2 -2
  50. package/build/dist/1012.1ffc2b5f439b4dbd31ab.js +0 -1
  51. package/build/dist/135.f248a925d34a798480d7.js +0 -1
  52. package/build/dist/1727.69b721002e5c4cee43f5.js +0 -1
  53. package/build/dist/2227.630510781f59cc4c4fb2.js +0 -1
  54. package/build/dist/2579.7a313dc04e7bd13abef5.js +0 -1
  55. package/build/dist/3084.52a9fb540f9a2f20e2a4.js +0 -1
  56. package/build/dist/3106.7d69822609a6d0ddd7af.js +0 -1
  57. package/build/dist/4204.e82ad99dea01b22eb25d.js +0 -1
  58. package/build/dist/4754.cd598f047ff6236c61c9.js +0 -1
  59. package/build/dist/5088.0caefbc5a430ba64afa1.js +0 -1
  60. package/build/dist/5945.244b607c26ac99161fe1.js +0 -1
  61. package/build/dist/6084.2417b84c3833e9b05951.js +0 -1
  62. package/build/dist/6085.1dc5c0e79932b5f9e52c.js +0 -1
  63. package/build/dist/636.d61ff5465a8d2326514b.js +0 -1
  64. package/build/dist/6383.b333496d85f9b04daf1f.js +0 -1
  65. package/build/dist/7111.b2007509a9bf0683c90a.js +0 -1
  66. package/build/dist/7209.3b487c37072aadaed4ca.js +0 -1
  67. package/build/dist/7632.43249289310a589f1b1e.js +0 -1
  68. package/build/dist/7911.89b6408e7daaccc1d8af.js +0 -1
  69. package/build/dist/893.0160359067e299f9a4f2.js +0 -1
  70. package/build/dist/8947.f1f29db3485b2287da46.js +0 -2
  71. package/build/dist/9756.eb8e5cd0c35395fdf573.js +0 -1
  72. package/build/dist/main.360cfb58341f1f91aefe.js +0 -2
  73. /package/build/dist/{8947.f1f29db3485b2287da46.js.LICENSE.txt → 8947.55d1c2f1238de7f51549.js.LICENSE.txt} +0 -0
  74. /package/build/dist/{main.360cfb58341f1f91aefe.js.LICENSE.txt → main.5bc1e6b78e3174e3fe27.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6202],{15350(t,r,e){e.d(r,{m:()=>n});var o=e(86827),n=class{constructor(t){this.init=t,this.records=this.init()}static{(0,o.K)(this,"ImperativeState")}reset(){this.records=this.init()}}},77454(t,r,e){function o(t,r){t.accDescr&&r.setAccDescription?.(t.accDescr),t.accTitle&&r.setAccTitle?.(t.accTitle),t.title&&r.setDiagramTitle?.(t.title)}e.d(r,{S:()=>o}),(0,e(86827).K)(o,"populateCommonDb")},76202(t,r,e){e.d(r,{diagram:()=>vt});var o=e(15350),n=e(77454),a=e(28342),i=e(68861),s=e(31293),c=e(86827),d=e(34376),h=e(51444),$={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},m=i.UI.gitGraph,l=(0,c.K)(()=>(0,a.$t)({...m,...(0,i.zj)().gitGraph}),"getConfig"),g=new o.m(()=>{const t=l(),r=t.mainBranchName,e=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:e}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function p(){return(0,a.yT)({length:7})}function y(t,r){const e=Object.create(null);return t.reduce((t,o)=>{const n=r(o);return e[n]||(e[n]=!0,t.push(o)),t},[])}(0,c.K)(p,"getID"),(0,c.K)(y,"uniqBy");var f=(0,c.K)(function(t){g.records.direction=t},"setDirection"),x=(0,c.K)(function(t){s.R.debug("options str",t),t=t?.trim(),t=t||"{}";try{g.records.options=JSON.parse(t)}catch(t){s.R.error("error while parsing gitGraph options",t.message)}},"setOptions"),u=(0,c.K)(function(){return g.records.options},"getOptions"),b=(0,c.K)(function(t){let r=t.msg,e=t.id;const o=t.type;let n=t.tags;s.R.info("commit",r,e,o,n),s.R.debug("Entering commit:",r,e,o,n);const a=l();e=i.Y2.sanitizeText(e,a),r=i.Y2.sanitizeText(r,a),n=n?.map(t=>i.Y2.sanitizeText(t,a));const c={id:e||g.records.seq+"-"+p(),message:r,seq:g.records.seq++,type:o??$.NORMAL,tags:n??[],parents:null==g.records.head?[]:[g.records.head.id],branch:g.records.currBranch};g.records.head=c,s.R.info("main branch",a.mainBranchName),g.records.commits.has(c.id)&&s.R.warn(`Commit ID ${c.id} already exists`),g.records.commits.set(c.id,c),g.records.branches.set(g.records.currBranch,c.id),s.R.debug("in pushCommit "+c.id)},"commit"),w=(0,c.K)(function(t){let r=t.name;const e=t.order;if(r=i.Y2.sanitizeText(r,l()),g.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);g.records.branches.set(r,null!=g.records.head?g.records.head.id:null),g.records.branchConfig.set(r,{name:r,order:e}),E(r),s.R.debug("in createBranch")},"branch"),k=(0,c.K)(t=>{let r=t.branch,e=t.id;const o=t.type,n=t.tags,a=l();r=i.Y2.sanitizeText(r,a),e&&(e=i.Y2.sanitizeText(e,a));const c=g.records.branches.get(g.records.currBranch),d=g.records.branches.get(r),h=c?g.records.commits.get(c):void 0,m=d?g.records.commits.get(d):void 0;if(h&&m&&h.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(g.records.currBranch===r){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(void 0===h||!h){const t=new Error(`Incorrect usage of "merge". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},t}if(!g.records.branches.has(r)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},t}if(void 0===m||!m){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},t}if(h===m){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(e&&g.records.commits.has(e)){const t=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom id");throw t.hash={text:`merge ${r} ${e} ${o} ${n?.join(" ")}`,token:`merge ${r} ${e} ${o} ${n?.join(" ")}`,expected:[`merge ${r} ${e}_UNIQUE ${o} ${n?.join(" ")}`]},t}const y=d||"",f={id:e||`${g.records.seq}-${p()}`,message:`merged branch ${r} into ${g.records.currBranch}`,seq:g.records.seq++,parents:null==g.records.head?[]:[g.records.head.id,y],branch:g.records.currBranch,type:$.MERGE,customType:o,customId:!!e,tags:n??[]};g.records.head=f,g.records.commits.set(f.id,f),g.records.branches.set(g.records.currBranch,f.id),s.R.debug(g.records.branches),s.R.debug("in mergeBranch")},"merge"),B=(0,c.K)(function(t){let r=t.id,e=t.targetId,o=t.tags,n=t.parent;s.R.debug("Entering cherryPick:",r,e,o);const a=l();if(r=i.Y2.sanitizeText(r,a),e=i.Y2.sanitizeText(e,a),o=o?.map(t=>i.Y2.sanitizeText(t,a)),n=i.Y2.sanitizeText(n,a),!r||!g.records.commits.has(r)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const c=g.records.commits.get(r);if(void 0===c||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(n&&(!Array.isArray(c.parents)||!c.parents.includes(n))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const d=c.branch;if(c.type===$.MERGE&&!n){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!e||!g.records.commits.has(e)){if(d===g.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const t=g.records.branches.get(g.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const a=g.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const i={id:g.records.seq+"-"+p(),message:`cherry-picked ${c?.message} into ${g.records.currBranch}`,seq:g.records.seq++,parents:null==g.records.head?[]:[g.records.head.id,c.id],branch:g.records.currBranch,type:$.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${c.id}${c.type===$.MERGE?`|parent:${n}`:""}`]};g.records.head=i,g.records.commits.set(i.id,i),g.records.branches.set(g.records.currBranch,i.id),s.R.debug(g.records.branches),s.R.debug("in cherryPick")}},"cherryPick"),E=(0,c.K)(function(t){if(t=i.Y2.sanitizeText(t,l()),!g.records.branches.has(t)){const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}{g.records.currBranch=t;const r=g.records.branches.get(g.records.currBranch);g.records.head=void 0!==r&&r?g.records.commits.get(r)??null:null}},"checkout");function C(t,r,e){const o=t.indexOf(r);-1===o?t.push(e):t.splice(o,1,e)}function T(t){const r=t.reduce((t,r)=>t.seq>r.seq?t:r,t[0]);let e="";t.forEach(function(t){e+=t===r?"\t*":"\t|"});const o=[e,r.id,r.seq];for(const t in g.records.branches)g.records.branches.get(t)===r.id&&o.push(t);if(s.R.debug(o.join(" ")),r.parents&&2==r.parents.length&&r.parents[0]&&r.parents[1]){const e=g.records.commits.get(r.parents[0]);C(t,r,e),r.parents[1]&&t.push(g.records.commits.get(r.parents[1]))}else{if(0==r.parents.length)return;if(r.parents[0]){const e=g.records.commits.get(r.parents[0]);C(t,r,e)}}T(t=y(t,t=>t.id))}(0,c.K)(C,"upsert"),(0,c.K)(T,"prettyPrintCommitHistory");var L=(0,c.K)(function(){s.R.debug(g.records.commits);T([I()[0]])},"prettyPrint"),K=(0,c.K)(function(){g.reset(),(0,i.IU)()},"clear"),M=(0,c.K)(function(){return[...g.records.branchConfig.values()].map((t,r)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${r}`)}).sort((t,r)=>(t.order??0)-(r.order??0)).map(({name:t})=>({name:t}))},"getBranchesAsObjArray"),R=(0,c.K)(function(){return g.records.branches},"getBranches"),v=(0,c.K)(function(){return g.records.commits},"getCommits"),I=(0,c.K)(function(){const t=[...g.records.commits.values()];return t.forEach(function(t){s.R.debug(t.id)}),t.sort((t,r)=>t.seq-r.seq),t},"getCommitsArray"),P={commitType:$,getConfig:l,setDirection:f,setOptions:x,getOptions:u,commit:b,branch:w,merge:k,cherryPick:B,checkout:E,prettyPrint:L,clear:K,getBranchesAsObjArray:M,getBranches:R,getCommits:v,getCommitsArray:I,getCurrentBranch:(0,c.K)(function(){return g.records.currBranch},"getCurrentBranch"),getDirection:(0,c.K)(function(){return g.records.direction},"getDirection"),getHead:(0,c.K)(function(){return g.records.head},"getHead"),setAccTitle:i.SV,getAccTitle:i.iN,getAccDescription:i.m7,setAccDescription:i.EI,setDiagramTitle:i.ke,getDiagramTitle:i.ab},O=(0,c.K)((t,r)=>{(0,n.S)(t,r),t.dir&&r.setDirection(t.dir);for(const e of t.statements)A(e,r)},"populate"),A=(0,c.K)((t,r)=>{const e={Commit:(0,c.K)(t=>r.commit(G(t)),"Commit"),Branch:(0,c.K)(t=>r.branch(S(t)),"Branch"),Merge:(0,c.K)(t=>r.merge(D(t)),"Merge"),Checkout:(0,c.K)(t=>r.checkout(H(t)),"Checkout"),CherryPicking:(0,c.K)(t=>r.cherryPick(W(t)),"CherryPicking")}[t.$type];e?e(t):s.R.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),G=(0,c.K)(t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?$[t.type]:$.NORMAL,tags:t.tags??void 0}),"parseCommit"),S=(0,c.K)(t=>({name:t.name,order:t.order??0}),"parseBranch"),D=(0,c.K)(t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?$[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),H=(0,c.K)(t=>t.branch,"parseCheckout"),W=(0,c.K)(t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),q={parse:(0,c.K)(async t=>{const r=await(0,d.qg)("gitGraph",t);s.R.debug(r),O(r,P)},"parse")};var z=10,_=40,Y=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),j=new Set(["redux-color","redux-dark-color"]),N=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),F=(0,c.K)((t,r,e=!1)=>e&&t>0?(t-1)%(r-1)+1:t%r,"calcColorIndex"),V=new Map,U=new Map,J=new Map,Q=[],X=0,Z="LR",tt=(0,c.K)(()=>{V.clear(),U.clear(),J.clear(),X=0,Q=[],Z="LR"},"clear"),rt=(0,c.K)(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=t.trim(),r.appendChild(e)}),r},"drawText"),et=(0,c.K)(t=>{let r,e,o;return"BT"===Z?(e=(0,c.K)((t,r)=>t<=r,"comparisonFunc"),o=1/0):(e=(0,c.K)((t,r)=>t>=r,"comparisonFunc"),o=0),t.forEach(t=>{const n="TB"===Z||"BT"==Z?U.get(t)?.y:U.get(t)?.x;void 0!==n&&e(n,o)&&(r=t,o=n)}),r},"findClosestParent"),ot=(0,c.K)(t=>{let r="",e=1/0;return t.forEach(t=>{const o=U.get(t).y;o<=e&&(r=t,e=o)}),r||void 0},"findClosestParentBT"),nt=(0,c.K)((t,r,e)=>{let o=e,n=e;const a=[];t.forEach(t=>{const e=r.get(t);if(!e)throw new Error(`Commit not found for key ${t}`);e.parents.length?(o=it(e),n=Math.max(o,n)):a.push(e),st(e,o)}),o=n,a.forEach(t=>{ct(t,o,e)}),t.forEach(t=>{const e=r.get(t);if(e?.parents.length){const t=ot(e.parents);o=U.get(t).y-_,o<=n&&(n=o);const r=V.get(e.branch).pos,a=o-z;U.set(e.id,{x:r,y:a})}})},"setParallelBTPos"),at=(0,c.K)(t=>{const r=et(t.parents.filter(t=>null!==t));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const e=U.get(r)?.y;if(void 0===e)throw new Error(`Closest parent position not found for commit ${t.id}`);return e},"findClosestParentPos"),it=(0,c.K)(t=>at(t)+_,"calculateCommitPosition"),st=(0,c.K)((t,r)=>{const e=V.get(t.branch);if(!e)throw new Error(`Branch not found for commit ${t.id}`);const o=e.pos,n=r+z;return U.set(t.id,{x:o,y:n}),{x:o,y:n}},"setCommitPosition"),ct=(0,c.K)((t,r,e)=>{const o=V.get(t.branch);if(!o)throw new Error(`Branch not found for commit ${t.id}`);const n=r+e,a=o.pos;U.set(t.id,{x:a,y:n})},"setRootPosition"),dt=(0,c.K)((t,r,e,o,n,a)=>{const{theme:s}=(0,i.D7)(),c=Y.has(s??""),d=j.has(s??""),h=N.has(s??"");if(a===$.HIGHLIGHT)t.append("rect").attr("x",e.x-10+(c?3:0)).attr("y",e.y-10+(c?3:0)).attr("width",c?14:20).attr("height",c?14:20).attr("class",`commit ${r.id} commit-highlight${F(n,8,d)} ${o}-outer`),t.append("rect").attr("x",e.x-6+(c?2:0)).attr("y",e.y-6+(c?2:0)).attr("width",c?8:12).attr("height",c?8:12).attr("class",`commit ${r.id} commit${F(n,8,d)} ${o}-inner`);else if(a===$.CHERRY_PICK)t.append("circle").attr("cx",e.x).attr("cy",e.y).attr("r",c?7:10).attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x-3).attr("cy",e.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x+3).attr("cy",e.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x+3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x-3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const i=t.append("circle");if(i.attr("cx",e.x),i.attr("cy",e.y),i.attr("r",c?7:10),i.attr("class",`commit ${r.id} commit${F(n,8,d)}`),a===$.MERGE){const a=t.append("circle");a.attr("cx",e.x),a.attr("cy",e.y),a.attr("r",c?5:6),a.attr("class",`commit ${o} ${r.id} commit${F(n,8,d)}`)}if(a===$.REVERSE){const a=c?4:5;t.append("path").attr("d",`M ${e.x-a},${e.y-a}L${e.x+a},${e.y+a}M${e.x-a},${e.y+a}L${e.x+a},${e.y-a}`).attr("class",`commit ${o} ${r.id} commit${F(n,8,d)}`)}}},"drawCommitBullet"),ht=(0,c.K)((t,r,e,o,n)=>{if(r.type!==$.CHERRY_PICK&&(r.customId&&r.type===$.MERGE||r.type!==$.MERGE)&&n.showCommitLabel){const a=t.append("g"),i=a.insert("rect").attr("class","commit-label-bkg"),s=a.append("text").attr("x",o).attr("y",e.y+25).attr("class","commit-label").text(r.id),c=s.node()?.getBBox();if(c&&(i.attr("x",e.posWithOffset-c.width/2-2).attr("y",e.y+13.5).attr("width",c.width+4).attr("height",c.height+4),"TB"===Z||"BT"===Z?(i.attr("x",e.x-(c.width+16+5)).attr("y",e.y-12),s.attr("x",e.x-(c.width+16)).attr("y",e.y+c.height-12)):s.attr("x",e.posWithOffset-c.width/2),n.rotateCommitLabel))if("TB"===Z||"BT"===Z)s.attr("transform","rotate(-45, "+e.x+", "+e.y+")"),i.attr("transform","rotate(-45, "+e.x+", "+e.y+")");else{const t=-7.5-(c.width+10)/25*9.5,r=10+c.width/25*8.5;a.attr("transform","translate("+t+", "+r+") rotate(-45, "+o+", "+e.y+")")}}},"drawCommitLabel"),$t=(0,c.K)((t,r,e,o)=>{if(r.tags.length>0){let n=0,a=0,i=0;const s=[];for(const o of r.tags.reverse()){const r=t.insert("polygon"),c=t.append("circle"),d=t.append("text").attr("y",e.y-16-n).attr("class","tag-label").text(o),h=d.node()?.getBBox();if(!h)throw new Error("Tag bbox not found");a=Math.max(a,h.width),i=Math.max(i,h.height),d.attr("x",e.posWithOffset-h.width/2),s.push({tag:d,hole:c,rect:r,yOffset:n}),n+=20}for(const{tag:t,hole:r,rect:n,yOffset:c}of s){const s=i/2,d=e.y-19.2-c;if(n.attr("class","tag-label-bkg").attr("points",`\n ${o-a/2-2},${d+2} \n ${o-a/2-2},${d-2}\n ${e.posWithOffset-a/2-4},${d-s-2}\n ${e.posWithOffset+a/2+4},${d-s-2}\n ${e.posWithOffset+a/2+4},${d+s+2}\n ${e.posWithOffset-a/2-4},${d+s+2}`),r.attr("cy",d).attr("cx",o-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===Z||"BT"===Z){const i=o+c;n.attr("class","tag-label-bkg").attr("points",`\n ${e.x},${i+2}\n ${e.x},${i-2}\n ${e.x+z},${i-s-2}\n ${e.x+z+a+4},${i-s-2}\n ${e.x+z+a+4},${i+s+2}\n ${e.x+z},${i+s+2}`).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),r.attr("cx",e.x+2).attr("cy",i).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),t.attr("x",e.x+5).attr("y",i+3).attr("transform","translate(14,14) rotate(45, "+e.x+","+o+")")}}}},"drawCommitTags"),mt=(0,c.K)(t=>{switch(t.customType??t.type){case $.NORMAL:return"commit-normal";case $.REVERSE:return"commit-reverse";case $.HIGHLIGHT:return"commit-highlight";case $.MERGE:return"commit-merge";case $.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),lt=(0,c.K)((t,r,e,o)=>{const n={x:0,y:0};if(!(t.parents.length>0)){if("TB"===r)return 30;if("BT"===r){return(o.get(t.id)??n).y-_}return 0}{const e=et(t.parents);if(e){const a=o.get(e)??n;if("TB"===r)return a.y+_;if("BT"===r){return(o.get(t.id)??n).y-_}return a.x+_}}return 0},"calculatePosition"),gt=(0,c.K)((t,r,e)=>{const o="BT"===Z&&e?r:r+z,n=V.get(t.branch)?.pos,a="TB"===Z||"BT"===Z?V.get(t.branch)?.pos:o;if(void 0===a||void 0===n)throw new Error(`Position were undefined for commit ${t.id}`);const s=Y.has((0,i.D7)().theme??"");return{x:a,y:"TB"===Z||"BT"===Z?o:n+(s?7:-2),posWithOffset:o}},"getCommitPosition"),pt=(0,c.K)((t,r,e,o)=>{const n=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let i="TB"===Z||"BT"===Z?30:0;const s=[...r.keys()],d=o.parallelCommits??!1,h=(0,c.K)((t,e)=>{const o=r.get(t)?.seq,n=r.get(e)?.seq;return void 0!==o&&void 0!==n?o-n:0},"sortKeys");let $=s.sort(h);"BT"===Z&&(d&&nt($,r,i),$=$.reverse()),$.forEach(t=>{const s=r.get(t);if(!s)throw new Error(`Commit not found for key ${t}`);d&&(i=lt(s,Z,i,U));const c=gt(s,i,d);if(e){const t=mt(s),r=s.customType??s.type,e=V.get(s.branch)?.index??0;dt(n,s,c,t,e,r),ht(a,s,c,i,o),$t(a,s,c,i)}"TB"===Z||"BT"===Z?U.set(s.id,{x:c.x,y:c.posWithOffset}):U.set(s.id,{x:c.posWithOffset,y:c.y}),i="BT"===Z&&d?i+_:i+_+z,i>X&&(X=i)})},"drawCommits"),yt=(0,c.K)((t,r,e,o,n)=>{const a=("TB"===Z||"BT"===Z?e.x<o.x:e.y<o.y)?r.branch:t.branch,i=(0,c.K)(t=>t.branch===a,"isOnBranchToGetCurve"),s=(0,c.K)(e=>e.seq>t.seq&&e.seq<r.seq,"isBetweenCommits");return[...n.values()].some(t=>s(t)&&i(t))},"shouldRerouteArrow"),ft=(0,c.K)((t,r,e=0)=>{const o=t+Math.abs(t-r)/2;if(e>5)return o;if(Q.every(t=>Math.abs(t-o)>=10))return Q.push(o),o;const n=Math.abs(t-r);return ft(t,r-n/5,e+1)},"findLane"),xt=(0,c.K)((t,r,e,o)=>{const{theme:n}=(0,i.D7)(),a=j.has(n??""),s=U.get(r.id),c=U.get(e.id);if(void 0===s||void 0===c)throw new Error(`Commit positions not found for commits ${r.id} and ${e.id}`);const d=yt(r,e,s,c,o);let h,m="",l="",g=0,p=0,y=V.get(e.branch)?.index;if(e.type===$.MERGE&&r.id!==e.parents[0]&&(y=V.get(r.branch)?.index),d){m="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",g=10,p=10;const t=s.y<c.y?ft(s.y,c.y):ft(c.y,s.y),e=s.x<c.x?ft(s.x,c.x):ft(c.x,s.x);"TB"===Z?s.x<c.x?h=`M ${s.x} ${s.y} L ${e-g} ${s.y} ${l} ${e} ${s.y+p} L ${e} ${c.y-g} ${m} ${e+p} ${c.y} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${e+g} ${s.y} ${m} ${e} ${s.y+p} L ${e} ${c.y-g} ${l} ${e-p} ${c.y} L ${c.x} ${c.y}`):"BT"===Z?s.x<c.x?h=`M ${s.x} ${s.y} L ${e-g} ${s.y} ${m} ${e} ${s.y-p} L ${e} ${c.y+g} ${l} ${e+p} ${c.y} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${e+g} ${s.y} ${l} ${e} ${s.y-p} L ${e} ${c.y+g} ${m} ${e-p} ${c.y} L ${c.x} ${c.y}`):s.y<c.y?h=`M ${s.x} ${s.y} L ${s.x} ${t-g} ${m} ${s.x+p} ${t} L ${c.x-g} ${t} ${l} ${c.x} ${t+p} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${s.x} ${t+g} ${l} ${s.x+p} ${t} L ${c.x-g} ${t} ${m} ${c.x} ${t-p} L ${c.x} ${c.y}`)}else m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,"TB"===Z?(s.x<c.x&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${m} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${l} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x>c.x&&(m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${l} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+g} ${s.y} ${m} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):"BT"===Z?(s.x<c.x&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${l} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${m} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x>c.x&&(m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${m} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+g} ${s.y} ${l} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):(s.y<c.y&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${l} ${c.x} ${s.y+p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${m} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y>c.y&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${m} ${c.x} ${s.y-p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${l} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y===c.y&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`));if(void 0===h)throw new Error("Line definition not found");t.append("path").attr("d",h).attr("class","arrow arrow"+F(y,8,a))},"drawArrow"),ut=(0,c.K)((t,r)=>{const e=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(t=>{const o=r.get(t);o.parents&&o.parents.length>0&&o.parents.forEach(t=>{xt(e,r.get(t),o,r)})})},"drawArrows"),bt=(0,c.K)((t,r,e,o)=>{const{look:n,theme:a,themeVariables:s}=(0,i.D7)(),{dropShadow:c,THEME_COLOR_LIMIT:d}=s,h=Y.has(a??""),$=j.has(a??""),m=t.append("g");r.forEach((t,r)=>{const a=F(r,h?d:8,$),i=V.get(t.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${t.name}`);const s="TB"===Z||"BT"===Z?i:h?i+6+1:i-2,l=m.append("line");l.attr("x1",0),l.attr("y1",s),l.attr("x2",X),l.attr("y2",s),l.attr("class","branch branch"+a),"TB"===Z?(l.attr("y1",30),l.attr("x1",i),l.attr("y2",X),l.attr("x2",i)):"BT"===Z&&(l.attr("y1",X),l.attr("x1",i),l.attr("y2",30),l.attr("x2",i)),Q.push(s);const g=t.name,p=rt(g),y=m.insert("rect"),f=m.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);f.node().appendChild(p);const x=p.getBBox(),u=h?0:4,b=h?16:0,w=h?12:0;"neo"===n&&y.attr("data-look","neo"),y.attr("class","branchLabelBkg label"+a).attr("style","neo"===n?`filter:${h?`url(#${o}-drop-shadow)`:c}`:"").attr("rx",u).attr("ry",u).attr("x",-x.width-4-(!0===e.rotateCommitLabel?30:0)).attr("y",-x.height/2+10).attr("width",x.width+18+b).attr("height",x.height+4+w),f.attr("transform","translate("+(-x.width-14-(!0===e.rotateCommitLabel?30:0)+b/2)+", "+(s-x.height/2-2)+")"),"TB"===Z?(y.attr("x",i-x.width/2-10).attr("y",0),f.attr("transform","translate("+(i-x.width/2-5)+", 0)"),h&&(y.attr("transform",`translate(${-b/2-3}, ${-w-10})`),f.attr("transform","translate("+(i-x.width/2-5)+", "+(2*-w+7)+")"))):"BT"===Z?(y.attr("x",i-x.width/2-10).attr("y",X),f.attr("transform","translate("+(i-x.width/2-5)+", "+X+")"),h&&(y.attr("transform",`translate(${-b/2-3}, ${w+10})`),f.attr("transform","translate("+(i-x.width/2-5)+", "+(X+2*w+4)+")"))):y.attr("transform","translate(-19, "+(s-12-w/2)+")")})},"drawBranches"),wt=(0,c.K)(function(t,r,e,o,n){return V.set(t,{pos:r,index:e}),r+=50+(n?40:0)+("TB"===Z||"BT"===Z?o.width/2:0)},"setBranchPosition"),kt={draw:(0,c.K)(function(t,r,e,o){tt(),s.R.debug("in gitgraph renderer",t+"\n","id:",r,e);const n=o.db;if(!n.getConfig)return void s.R.error("getConfig method is not available on db");const c=n.getConfig(),d=c.rotateCommitLabel??!1;J=n.getCommits();const $=n.getBranchesAsObjArray();Z=n.getDirection();const m=(0,h.Ltv)(`[id="${r}"]`),{look:l,theme:g,themeVariables:p}=(0,i.D7)(),{useGradient:y,gradientStart:f,gradientStop:x,filterColor:u}=p;if(y){const t=m.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.append("stop").attr("offset","0%").attr("stop-color",f).attr("stop-opacity",1),t.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}"neo"===l&&Y.has(g??"")&&m.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",u);let b=0;$.forEach((t,r)=>{const e=rt(t.name),o=m.append("g"),n=o.insert("g").attr("class","branchLabel"),a=n.insert("g").attr("class","label branch-label");a.node()?.appendChild(e);const i=e.getBBox();b=wt(t.name,b,r,i,d),a.remove(),n.remove(),o.remove()}),pt(m,J,!1,c),c.showBranches&&bt(m,$,c,r),ut(m,J),pt(m,J,!0,c),a._K.insertTitle(m,"gitTitleText",c.titleTopMargin??0,n.getDiagramTitle()),(0,i.mj)(void 0,m,c.diagramPadding,c.useMaxWidth)},"draw")};var Bt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Et=new Set(["redux-color","redux-dark-color"]),Ct=new Set(["neo","neo-dark"]),Tt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Lt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Kt=(0,c.K)(t=>{const{svgId:r}=t;let e="";if(t.useGradient&&r)for(let o=0;o<t.THEME_COLOR_LIMIT;o++)e+=`\n .label${o} { fill: ${t.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${t.strokeWidth};}\n `;return e},"genGitGraphGradient"),Mt=(0,c.K)(t=>{const r=(0,i.zj)(),{theme:e,themeVariables:o}=r,{borderColorArray:n}=o,a=Bt.has(e);if(Ct.has(e)){let r="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)if(0===e)r+=`\n .branch-label${e} { fill: ${t.nodeBorder};}\n .commit${e} { stroke: ${t.nodeBorder}; }\n .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }\n .arrow${e} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }\n ${Kt(t)}`;else{const o=e%8;r+=`\n .branch-label${e} { fill: ${t["gitBranchLabel"+o]}; }\n .commit${e} { stroke: ${t["git"+o]}; fill: ${t["git"+o]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+o]}; fill: ${t["gitInv"+o]}; }\n .arrow${e} { stroke: ${t["git"+o]}; }\n `}return r}if(Et.has(e)){let r="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)if(0===o)r+=`\n .branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${o} { stroke: ${t.nodeBorder}; }\n .commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }\n .label${o} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .arrow${o} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n `;else{const i=o%n.length;r+=`\n .branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${o} { stroke: ${n[i]}; fill: ${n[i]}; }\n .commit-highlight${o} { stroke: ${n[i]}; fill: ${n[i]}; }\n .label${o} { fill: ${Tt.has(e)?t.mainBkg:n[i]}; stroke: ${n[i]}; stroke-width: ${t.strokeWidth}; }\n .arrow${o} { stroke: ${n[i]}; }\n `}return r}{let r="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)r+=`\n .branch-label${e} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${e} { stroke: ${t.nodeBorder}; }\n .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }\n .label${e} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""}}\n .arrow${e} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }\n `;return r}},"genColor"),Rt=(0,c.K)(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(t,r)=>r).map(r=>{const e=r%8;return`\n .branch-label${r} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${r} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${r} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${r} { fill: ${t["git"+e]}; }\n .arrow${r} { stroke: ${t["git"+e]}; }\n `}).join("\n")}`,"normalTheme"),vt={parser:q,db:P,renderer:kt,styles:(0,c.K)(t=>{const r=(0,i.zj)(),{theme:e}=r,o=Lt.has(e);return`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n \n ${o?Mt(t):Rt(t)}\n\n .branch {\n stroke-width: ${t.strokeWidth};\n stroke: ${t.commitLineColor??t.lineColor};\n stroke-dasharray: ${o?"4 2":"2"};\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${o?t.nodeBorder:t.commitLabelColor}; ${o?`font-weight:${t.noteFontWeight};`:""}}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${o?"transparent":t.commitLabelBackground}; opacity: ${o?"":.5}; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${o?t.mainBkg:t.tagLabelBackground}; stroke: ${o?t.nodeBorder:t.tagLabelBorder}; ${o?`filter:${t.dropShadow}`:""} }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n }\n .commit-reverse {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n stroke-width: ${o?t.strokeWidth:3};\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n }\n\n .arrow {\n /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */\n stroke-width: ${Bt.has(e)?t.strokeWidth:8};\n stroke-linecap: round;\n fill: none\n }\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`},"getStyles")}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1715],{15350(t,r,e){e.d(r,{m:()=>n});var o=e(86827),n=class{constructor(t){this.init=t,this.records=this.init()}static{(0,o.K)(this,"ImperativeState")}reset(){this.records=this.init()}}},77454(t,r,e){function o(t,r){t.accDescr&&r.setAccDescription?.(t.accDescr),t.accTitle&&r.setAccTitle?.(t.accTitle),t.title&&r.setDiagramTitle?.(t.title)}e.d(r,{S:()=>o}),(0,e(86827).K)(o,"populateCommonDb")},31715(t,r,e){e.d(r,{diagram:()=>vt});var o=e(15350),n=e(77454),a=e(99087),i=e(32178),s=e(31293),c=e(86827),d=e(34376),h=e(51444),$={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},m=i.UI.gitGraph,l=(0,c.K)(()=>(0,a.$t)({...m,...(0,i.zj)().gitGraph}),"getConfig"),g=new o.m(()=>{const t=l(),r=t.mainBranchName,e=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:e}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function p(){return(0,a.yT)({length:7})}function y(t,r){const e=Object.create(null);return t.reduce((t,o)=>{const n=r(o);return e[n]||(e[n]=!0,t.push(o)),t},[])}(0,c.K)(p,"getID"),(0,c.K)(y,"uniqBy");var f=(0,c.K)(function(t){g.records.direction=t},"setDirection"),x=(0,c.K)(function(t){s.R.debug("options str",t),t=t?.trim(),t=t||"{}";try{g.records.options=JSON.parse(t)}catch(t){s.R.error("error while parsing gitGraph options",t.message)}},"setOptions"),u=(0,c.K)(function(){return g.records.options},"getOptions"),b=(0,c.K)(function(t){let r=t.msg,e=t.id;const o=t.type;let n=t.tags;s.R.info("commit",r,e,o,n),s.R.debug("Entering commit:",r,e,o,n);const a=l();e=i.Y2.sanitizeText(e,a),r=i.Y2.sanitizeText(r,a),n=n?.map(t=>i.Y2.sanitizeText(t,a));const c={id:e||g.records.seq+"-"+p(),message:r,seq:g.records.seq++,type:o??$.NORMAL,tags:n??[],parents:null==g.records.head?[]:[g.records.head.id],branch:g.records.currBranch};g.records.head=c,s.R.info("main branch",a.mainBranchName),g.records.commits.has(c.id)&&s.R.warn(`Commit ID ${c.id} already exists`),g.records.commits.set(c.id,c),g.records.branches.set(g.records.currBranch,c.id),s.R.debug("in pushCommit "+c.id)},"commit"),w=(0,c.K)(function(t){let r=t.name;const e=t.order;if(r=i.Y2.sanitizeText(r,l()),g.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);g.records.branches.set(r,null!=g.records.head?g.records.head.id:null),g.records.branchConfig.set(r,{name:r,order:e}),E(r),s.R.debug("in createBranch")},"branch"),k=(0,c.K)(t=>{let r=t.branch,e=t.id;const o=t.type,n=t.tags,a=l();r=i.Y2.sanitizeText(r,a),e&&(e=i.Y2.sanitizeText(e,a));const c=g.records.branches.get(g.records.currBranch),d=g.records.branches.get(r),h=c?g.records.commits.get(c):void 0,m=d?g.records.commits.get(d):void 0;if(h&&m&&h.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(g.records.currBranch===r){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(void 0===h||!h){const t=new Error(`Incorrect usage of "merge". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},t}if(!g.records.branches.has(r)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},t}if(void 0===m||!m){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},t}if(h===m){const t=new Error('Incorrect usage of "merge". Both branches have same head');throw t.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},t}if(e&&g.records.commits.has(e)){const t=new Error('Incorrect usage of "merge". Commit with id:'+e+" already exists, use different custom id");throw t.hash={text:`merge ${r} ${e} ${o} ${n?.join(" ")}`,token:`merge ${r} ${e} ${o} ${n?.join(" ")}`,expected:[`merge ${r} ${e}_UNIQUE ${o} ${n?.join(" ")}`]},t}const y=d||"",f={id:e||`${g.records.seq}-${p()}`,message:`merged branch ${r} into ${g.records.currBranch}`,seq:g.records.seq++,parents:null==g.records.head?[]:[g.records.head.id,y],branch:g.records.currBranch,type:$.MERGE,customType:o,customId:!!e,tags:n??[]};g.records.head=f,g.records.commits.set(f.id,f),g.records.branches.set(g.records.currBranch,f.id),s.R.debug(g.records.branches),s.R.debug("in mergeBranch")},"merge"),B=(0,c.K)(function(t){let r=t.id,e=t.targetId,o=t.tags,n=t.parent;s.R.debug("Entering cherryPick:",r,e,o);const a=l();if(r=i.Y2.sanitizeText(r,a),e=i.Y2.sanitizeText(e,a),o=o?.map(t=>i.Y2.sanitizeText(t,a)),n=i.Y2.sanitizeText(n,a),!r||!g.records.commits.has(r)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const c=g.records.commits.get(r);if(void 0===c||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(n&&(!Array.isArray(c.parents)||!c.parents.includes(n))){throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.")}const d=c.branch;if(c.type===$.MERGE&&!n){throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.")}if(!e||!g.records.commits.has(e)){if(d===g.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const t=g.records.branches.get(g.records.currBranch);if(void 0===t||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const a=g.records.commits.get(t);if(void 0===a||!a){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${g.records.currBranch})has no commits`);throw t.hash={text:`cherryPick ${r} ${e}`,token:`cherryPick ${r} ${e}`,expected:["cherry-pick abc"]},t}const i={id:g.records.seq+"-"+p(),message:`cherry-picked ${c?.message} into ${g.records.currBranch}`,seq:g.records.seq++,parents:null==g.records.head?[]:[g.records.head.id,c.id],branch:g.records.currBranch,type:$.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${c.id}${c.type===$.MERGE?`|parent:${n}`:""}`]};g.records.head=i,g.records.commits.set(i.id,i),g.records.branches.set(g.records.currBranch,i.id),s.R.debug(g.records.branches),s.R.debug("in cherryPick")}},"cherryPick"),E=(0,c.K)(function(t){if(t=i.Y2.sanitizeText(t,l()),!g.records.branches.has(t)){const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}{g.records.currBranch=t;const r=g.records.branches.get(g.records.currBranch);g.records.head=void 0!==r&&r?g.records.commits.get(r)??null:null}},"checkout");function C(t,r,e){const o=t.indexOf(r);-1===o?t.push(e):t.splice(o,1,e)}function T(t){const r=t.reduce((t,r)=>t.seq>r.seq?t:r,t[0]);let e="";t.forEach(function(t){e+=t===r?"\t*":"\t|"});const o=[e,r.id,r.seq];for(const t in g.records.branches)g.records.branches.get(t)===r.id&&o.push(t);if(s.R.debug(o.join(" ")),r.parents&&2==r.parents.length&&r.parents[0]&&r.parents[1]){const e=g.records.commits.get(r.parents[0]);C(t,r,e),r.parents[1]&&t.push(g.records.commits.get(r.parents[1]))}else{if(0==r.parents.length)return;if(r.parents[0]){const e=g.records.commits.get(r.parents[0]);C(t,r,e)}}T(t=y(t,t=>t.id))}(0,c.K)(C,"upsert"),(0,c.K)(T,"prettyPrintCommitHistory");var L=(0,c.K)(function(){s.R.debug(g.records.commits);T([I()[0]])},"prettyPrint"),K=(0,c.K)(function(){g.reset(),(0,i.IU)()},"clear"),M=(0,c.K)(function(){return[...g.records.branchConfig.values()].map((t,r)=>null!==t.order&&void 0!==t.order?t:{...t,order:parseFloat(`0.${r}`)}).sort((t,r)=>(t.order??0)-(r.order??0)).map(({name:t})=>({name:t}))},"getBranchesAsObjArray"),R=(0,c.K)(function(){return g.records.branches},"getBranches"),v=(0,c.K)(function(){return g.records.commits},"getCommits"),I=(0,c.K)(function(){const t=[...g.records.commits.values()];return t.forEach(function(t){s.R.debug(t.id)}),t.sort((t,r)=>t.seq-r.seq),t},"getCommitsArray"),P={commitType:$,getConfig:l,setDirection:f,setOptions:x,getOptions:u,commit:b,branch:w,merge:k,cherryPick:B,checkout:E,prettyPrint:L,clear:K,getBranchesAsObjArray:M,getBranches:R,getCommits:v,getCommitsArray:I,getCurrentBranch:(0,c.K)(function(){return g.records.currBranch},"getCurrentBranch"),getDirection:(0,c.K)(function(){return g.records.direction},"getDirection"),getHead:(0,c.K)(function(){return g.records.head},"getHead"),setAccTitle:i.SV,getAccTitle:i.iN,getAccDescription:i.m7,setAccDescription:i.EI,setDiagramTitle:i.ke,getDiagramTitle:i.ab},O=(0,c.K)((t,r)=>{(0,n.S)(t,r),t.dir&&r.setDirection(t.dir);for(const e of t.statements)A(e,r)},"populate"),A=(0,c.K)((t,r)=>{const e={Commit:(0,c.K)(t=>r.commit(G(t)),"Commit"),Branch:(0,c.K)(t=>r.branch(S(t)),"Branch"),Merge:(0,c.K)(t=>r.merge(D(t)),"Merge"),Checkout:(0,c.K)(t=>r.checkout(H(t)),"Checkout"),CherryPicking:(0,c.K)(t=>r.cherryPick(W(t)),"CherryPicking")}[t.$type];e?e(t):s.R.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),G=(0,c.K)(t=>({id:t.id,msg:t.message??"",type:void 0!==t.type?$[t.type]:$.NORMAL,tags:t.tags??void 0}),"parseCommit"),S=(0,c.K)(t=>({name:t.name,order:t.order??0}),"parseBranch"),D=(0,c.K)(t=>({branch:t.branch,id:t.id??"",type:void 0!==t.type?$[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),H=(0,c.K)(t=>t.branch,"parseCheckout"),W=(0,c.K)(t=>({id:t.id,targetId:"",tags:0===t.tags?.length?void 0:t.tags,parent:t.parent}),"parseCherryPicking"),q={parse:(0,c.K)(async t=>{const r=await(0,d.qg)("gitGraph",t);s.R.debug(r),O(r,P)},"parse")};var z=10,_=40,Y=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),j=new Set(["redux-color","redux-dark-color"]),N=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),F=(0,c.K)((t,r,e=!1)=>e&&t>0?(t-1)%(r-1)+1:t%r,"calcColorIndex"),V=new Map,U=new Map,J=new Map,Q=[],X=0,Z="LR",tt=(0,c.K)(()=>{V.clear(),U.clear(),J.clear(),X=0,Q=[],Z="LR"},"clear"),rt=(0,c.K)(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return("string"==typeof t?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=t.trim(),r.appendChild(e)}),r},"drawText"),et=(0,c.K)(t=>{let r,e,o;return"BT"===Z?(e=(0,c.K)((t,r)=>t<=r,"comparisonFunc"),o=1/0):(e=(0,c.K)((t,r)=>t>=r,"comparisonFunc"),o=0),t.forEach(t=>{const n="TB"===Z||"BT"==Z?U.get(t)?.y:U.get(t)?.x;void 0!==n&&e(n,o)&&(r=t,o=n)}),r},"findClosestParent"),ot=(0,c.K)(t=>{let r="",e=1/0;return t.forEach(t=>{const o=U.get(t).y;o<=e&&(r=t,e=o)}),r||void 0},"findClosestParentBT"),nt=(0,c.K)((t,r,e)=>{let o=e,n=e;const a=[];t.forEach(t=>{const e=r.get(t);if(!e)throw new Error(`Commit not found for key ${t}`);e.parents.length?(o=it(e),n=Math.max(o,n)):a.push(e),st(e,o)}),o=n,a.forEach(t=>{ct(t,o,e)}),t.forEach(t=>{const e=r.get(t);if(e?.parents.length){const t=ot(e.parents);o=U.get(t).y-_,o<=n&&(n=o);const r=V.get(e.branch).pos,a=o-z;U.set(e.id,{x:r,y:a})}})},"setParallelBTPos"),at=(0,c.K)(t=>{const r=et(t.parents.filter(t=>null!==t));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const e=U.get(r)?.y;if(void 0===e)throw new Error(`Closest parent position not found for commit ${t.id}`);return e},"findClosestParentPos"),it=(0,c.K)(t=>at(t)+_,"calculateCommitPosition"),st=(0,c.K)((t,r)=>{const e=V.get(t.branch);if(!e)throw new Error(`Branch not found for commit ${t.id}`);const o=e.pos,n=r+z;return U.set(t.id,{x:o,y:n}),{x:o,y:n}},"setCommitPosition"),ct=(0,c.K)((t,r,e)=>{const o=V.get(t.branch);if(!o)throw new Error(`Branch not found for commit ${t.id}`);const n=r+e,a=o.pos;U.set(t.id,{x:a,y:n})},"setRootPosition"),dt=(0,c.K)((t,r,e,o,n,a)=>{const{theme:s}=(0,i.D7)(),c=Y.has(s??""),d=j.has(s??""),h=N.has(s??"");if(a===$.HIGHLIGHT)t.append("rect").attr("x",e.x-10+(c?3:0)).attr("y",e.y-10+(c?3:0)).attr("width",c?14:20).attr("height",c?14:20).attr("class",`commit ${r.id} commit-highlight${F(n,8,d)} ${o}-outer`),t.append("rect").attr("x",e.x-6+(c?2:0)).attr("y",e.y-6+(c?2:0)).attr("width",c?8:12).attr("height",c?8:12).attr("class",`commit ${r.id} commit${F(n,8,d)} ${o}-inner`);else if(a===$.CHERRY_PICK)t.append("circle").attr("cx",e.x).attr("cy",e.y).attr("r",c?7:10).attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x-3).attr("cy",e.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("circle").attr("cx",e.x+3).attr("cy",e.y+2).attr("r",c?2.5:2.75).attr("fill",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x+3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`),t.append("line").attr("x1",e.x-3).attr("y1",e.y+1).attr("x2",e.x).attr("y2",e.y-5).attr("stroke",h?"#000000":"#fff").attr("class",`commit ${r.id} ${o}`);else{const i=t.append("circle");if(i.attr("cx",e.x),i.attr("cy",e.y),i.attr("r",c?7:10),i.attr("class",`commit ${r.id} commit${F(n,8,d)}`),a===$.MERGE){const a=t.append("circle");a.attr("cx",e.x),a.attr("cy",e.y),a.attr("r",c?5:6),a.attr("class",`commit ${o} ${r.id} commit${F(n,8,d)}`)}if(a===$.REVERSE){const a=c?4:5;t.append("path").attr("d",`M ${e.x-a},${e.y-a}L${e.x+a},${e.y+a}M${e.x-a},${e.y+a}L${e.x+a},${e.y-a}`).attr("class",`commit ${o} ${r.id} commit${F(n,8,d)}`)}}},"drawCommitBullet"),ht=(0,c.K)((t,r,e,o,n)=>{if(r.type!==$.CHERRY_PICK&&(r.customId&&r.type===$.MERGE||r.type!==$.MERGE)&&n.showCommitLabel){const a=t.append("g"),i=a.insert("rect").attr("class","commit-label-bkg"),s=a.append("text").attr("x",o).attr("y",e.y+25).attr("class","commit-label").text(r.id),c=s.node()?.getBBox();if(c&&(i.attr("x",e.posWithOffset-c.width/2-2).attr("y",e.y+13.5).attr("width",c.width+4).attr("height",c.height+4),"TB"===Z||"BT"===Z?(i.attr("x",e.x-(c.width+16+5)).attr("y",e.y-12),s.attr("x",e.x-(c.width+16)).attr("y",e.y+c.height-12)):s.attr("x",e.posWithOffset-c.width/2),n.rotateCommitLabel))if("TB"===Z||"BT"===Z)s.attr("transform","rotate(-45, "+e.x+", "+e.y+")"),i.attr("transform","rotate(-45, "+e.x+", "+e.y+")");else{const t=-7.5-(c.width+10)/25*9.5,r=10+c.width/25*8.5;a.attr("transform","translate("+t+", "+r+") rotate(-45, "+o+", "+e.y+")")}}},"drawCommitLabel"),$t=(0,c.K)((t,r,e,o)=>{if(r.tags.length>0){let n=0,a=0,i=0;const s=[];for(const o of r.tags.reverse()){const r=t.insert("polygon"),c=t.append("circle"),d=t.append("text").attr("y",e.y-16-n).attr("class","tag-label").text(o),h=d.node()?.getBBox();if(!h)throw new Error("Tag bbox not found");a=Math.max(a,h.width),i=Math.max(i,h.height),d.attr("x",e.posWithOffset-h.width/2),s.push({tag:d,hole:c,rect:r,yOffset:n}),n+=20}for(const{tag:t,hole:r,rect:n,yOffset:c}of s){const s=i/2,d=e.y-19.2-c;if(n.attr("class","tag-label-bkg").attr("points",`\n ${o-a/2-2},${d+2} \n ${o-a/2-2},${d-2}\n ${e.posWithOffset-a/2-4},${d-s-2}\n ${e.posWithOffset+a/2+4},${d-s-2}\n ${e.posWithOffset+a/2+4},${d+s+2}\n ${e.posWithOffset-a/2-4},${d+s+2}`),r.attr("cy",d).attr("cx",o-a/2+2).attr("r",1.5).attr("class","tag-hole"),"TB"===Z||"BT"===Z){const i=o+c;n.attr("class","tag-label-bkg").attr("points",`\n ${e.x},${i+2}\n ${e.x},${i-2}\n ${e.x+z},${i-s-2}\n ${e.x+z+a+4},${i-s-2}\n ${e.x+z+a+4},${i+s+2}\n ${e.x+z},${i+s+2}`).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),r.attr("cx",e.x+2).attr("cy",i).attr("transform","translate(12,12) rotate(45, "+e.x+","+o+")"),t.attr("x",e.x+5).attr("y",i+3).attr("transform","translate(14,14) rotate(45, "+e.x+","+o+")")}}}},"drawCommitTags"),mt=(0,c.K)(t=>{switch(t.customType??t.type){case $.NORMAL:return"commit-normal";case $.REVERSE:return"commit-reverse";case $.HIGHLIGHT:return"commit-highlight";case $.MERGE:return"commit-merge";case $.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),lt=(0,c.K)((t,r,e,o)=>{const n={x:0,y:0};if(!(t.parents.length>0)){if("TB"===r)return 30;if("BT"===r){return(o.get(t.id)??n).y-_}return 0}{const e=et(t.parents);if(e){const a=o.get(e)??n;if("TB"===r)return a.y+_;if("BT"===r){return(o.get(t.id)??n).y-_}return a.x+_}}return 0},"calculatePosition"),gt=(0,c.K)((t,r,e)=>{const o="BT"===Z&&e?r:r+z,n=V.get(t.branch)?.pos,a="TB"===Z||"BT"===Z?V.get(t.branch)?.pos:o;if(void 0===a||void 0===n)throw new Error(`Position were undefined for commit ${t.id}`);const s=Y.has((0,i.D7)().theme??"");return{x:a,y:"TB"===Z||"BT"===Z?o:n+(s?7:-2),posWithOffset:o}},"getCommitPosition"),pt=(0,c.K)((t,r,e,o)=>{const n=t.append("g").attr("class","commit-bullets"),a=t.append("g").attr("class","commit-labels");let i="TB"===Z||"BT"===Z?30:0;const s=[...r.keys()],d=o.parallelCommits??!1,h=(0,c.K)((t,e)=>{const o=r.get(t)?.seq,n=r.get(e)?.seq;return void 0!==o&&void 0!==n?o-n:0},"sortKeys");let $=s.sort(h);"BT"===Z&&(d&&nt($,r,i),$=$.reverse()),$.forEach(t=>{const s=r.get(t);if(!s)throw new Error(`Commit not found for key ${t}`);d&&(i=lt(s,Z,i,U));const c=gt(s,i,d);if(e){const t=mt(s),r=s.customType??s.type,e=V.get(s.branch)?.index??0;dt(n,s,c,t,e,r),ht(a,s,c,i,o),$t(a,s,c,i)}"TB"===Z||"BT"===Z?U.set(s.id,{x:c.x,y:c.posWithOffset}):U.set(s.id,{x:c.posWithOffset,y:c.y}),i="BT"===Z&&d?i+_:i+_+z,i>X&&(X=i)})},"drawCommits"),yt=(0,c.K)((t,r,e,o,n)=>{const a=("TB"===Z||"BT"===Z?e.x<o.x:e.y<o.y)?r.branch:t.branch,i=(0,c.K)(t=>t.branch===a,"isOnBranchToGetCurve"),s=(0,c.K)(e=>e.seq>t.seq&&e.seq<r.seq,"isBetweenCommits");return[...n.values()].some(t=>s(t)&&i(t))},"shouldRerouteArrow"),ft=(0,c.K)((t,r,e=0)=>{const o=t+Math.abs(t-r)/2;if(e>5)return o;if(Q.every(t=>Math.abs(t-o)>=10))return Q.push(o),o;const n=Math.abs(t-r);return ft(t,r-n/5,e+1)},"findLane"),xt=(0,c.K)((t,r,e,o)=>{const{theme:n}=(0,i.D7)(),a=j.has(n??""),s=U.get(r.id),c=U.get(e.id);if(void 0===s||void 0===c)throw new Error(`Commit positions not found for commits ${r.id} and ${e.id}`);const d=yt(r,e,s,c,o);let h,m="",l="",g=0,p=0,y=V.get(e.branch)?.index;if(e.type===$.MERGE&&r.id!==e.parents[0]&&(y=V.get(r.branch)?.index),d){m="A 10 10, 0, 0, 0,",l="A 10 10, 0, 0, 1,",g=10,p=10;const t=s.y<c.y?ft(s.y,c.y):ft(c.y,s.y),e=s.x<c.x?ft(s.x,c.x):ft(c.x,s.x);"TB"===Z?s.x<c.x?h=`M ${s.x} ${s.y} L ${e-g} ${s.y} ${l} ${e} ${s.y+p} L ${e} ${c.y-g} ${m} ${e+p} ${c.y} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${e+g} ${s.y} ${m} ${e} ${s.y+p} L ${e} ${c.y-g} ${l} ${e-p} ${c.y} L ${c.x} ${c.y}`):"BT"===Z?s.x<c.x?h=`M ${s.x} ${s.y} L ${e-g} ${s.y} ${m} ${e} ${s.y-p} L ${e} ${c.y+g} ${l} ${e+p} ${c.y} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${e+g} ${s.y} ${l} ${e} ${s.y-p} L ${e} ${c.y+g} ${m} ${e-p} ${c.y} L ${c.x} ${c.y}`):s.y<c.y?h=`M ${s.x} ${s.y} L ${s.x} ${t-g} ${m} ${s.x+p} ${t} L ${c.x-g} ${t} ${l} ${c.x} ${t+p} L ${c.x} ${c.y}`:(y=V.get(r.branch)?.index,h=`M ${s.x} ${s.y} L ${s.x} ${t+g} ${l} ${s.x+p} ${t} L ${c.x-g} ${t} ${m} ${c.x} ${t-p} L ${c.x} ${c.y}`)}else m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,"TB"===Z?(s.x<c.x&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${m} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${l} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x>c.x&&(m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${l} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+g} ${s.y} ${m} ${c.x} ${s.y+p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):"BT"===Z?(s.x<c.x&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${l} ${s.x+p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${m} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x>c.x&&(m="A 20 20, 0, 0, 0,",l="A 20 20, 0, 0, 1,",g=20,p=20,h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${m} ${s.x-p} ${c.y} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${c.x+g} ${s.y} ${l} ${c.x} ${s.y-p} L ${c.x} ${c.y}`),s.x===c.x&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`)):(s.y<c.y&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${l} ${c.x} ${s.y+p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y-g} ${m} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y>c.y&&(h=e.type===$.MERGE&&r.id!==e.parents[0]?`M ${s.x} ${s.y} L ${c.x-g} ${s.y} ${m} ${c.x} ${s.y-p} L ${c.x} ${c.y}`:`M ${s.x} ${s.y} L ${s.x} ${c.y+g} ${l} ${s.x+p} ${c.y} L ${c.x} ${c.y}`),s.y===c.y&&(h=`M ${s.x} ${s.y} L ${c.x} ${c.y}`));if(void 0===h)throw new Error("Line definition not found");t.append("path").attr("d",h).attr("class","arrow arrow"+F(y,8,a))},"drawArrow"),ut=(0,c.K)((t,r)=>{const e=t.append("g").attr("class","commit-arrows");[...r.keys()].forEach(t=>{const o=r.get(t);o.parents&&o.parents.length>0&&o.parents.forEach(t=>{xt(e,r.get(t),o,r)})})},"drawArrows"),bt=(0,c.K)((t,r,e,o)=>{const{look:n,theme:a,themeVariables:s}=(0,i.D7)(),{dropShadow:c,THEME_COLOR_LIMIT:d}=s,h=Y.has(a??""),$=j.has(a??""),m=t.append("g");r.forEach((t,r)=>{const a=F(r,h?d:8,$),i=V.get(t.name)?.pos;if(void 0===i)throw new Error(`Position not found for branch ${t.name}`);const s="TB"===Z||"BT"===Z?i:h?i+6+1:i-2,l=m.append("line");l.attr("x1",0),l.attr("y1",s),l.attr("x2",X),l.attr("y2",s),l.attr("class","branch branch"+a),"TB"===Z?(l.attr("y1",30),l.attr("x1",i),l.attr("y2",X),l.attr("x2",i)):"BT"===Z&&(l.attr("y1",X),l.attr("x1",i),l.attr("y2",30),l.attr("x2",i)),Q.push(s);const g=t.name,p=rt(g),y=m.insert("rect"),f=m.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+a);f.node().appendChild(p);const x=p.getBBox(),u=h?0:4,b=h?16:0,w=h?12:0;"neo"===n&&y.attr("data-look","neo"),y.attr("class","branchLabelBkg label"+a).attr("style","neo"===n?`filter:${h?`url(#${o}-drop-shadow)`:c}`:"").attr("rx",u).attr("ry",u).attr("x",-x.width-4-(!0===e.rotateCommitLabel?30:0)).attr("y",-x.height/2+10).attr("width",x.width+18+b).attr("height",x.height+4+w),f.attr("transform","translate("+(-x.width-14-(!0===e.rotateCommitLabel?30:0)+b/2)+", "+(s-x.height/2-2)+")"),"TB"===Z?(y.attr("x",i-x.width/2-10).attr("y",0),f.attr("transform","translate("+(i-x.width/2-5)+", 0)"),h&&(y.attr("transform",`translate(${-b/2-3}, ${-w-10})`),f.attr("transform","translate("+(i-x.width/2-5)+", "+(2*-w+7)+")"))):"BT"===Z?(y.attr("x",i-x.width/2-10).attr("y",X),f.attr("transform","translate("+(i-x.width/2-5)+", "+X+")"),h&&(y.attr("transform",`translate(${-b/2-3}, ${w+10})`),f.attr("transform","translate("+(i-x.width/2-5)+", "+(X+2*w+4)+")"))):y.attr("transform","translate(-19, "+(s-12-w/2)+")")})},"drawBranches"),wt=(0,c.K)(function(t,r,e,o,n){return V.set(t,{pos:r,index:e}),r+=50+(n?40:0)+("TB"===Z||"BT"===Z?o.width/2:0)},"setBranchPosition"),kt={draw:(0,c.K)(function(t,r,e,o){tt(),s.R.debug("in gitgraph renderer",t+"\n","id:",r,e);const n=o.db;if(!n.getConfig)return void s.R.error("getConfig method is not available on db");const c=n.getConfig(),d=c.rotateCommitLabel??!1;J=n.getCommits();const $=n.getBranchesAsObjArray();Z=n.getDirection();const m=(0,h.Ltv)(`[id="${r}"]`),{look:l,theme:g,themeVariables:p}=(0,i.D7)(),{useGradient:y,gradientStart:f,gradientStop:x,filterColor:u}=p;if(y){const t=m.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");t.append("stop").attr("offset","0%").attr("stop-color",f).attr("stop-opacity",1),t.append("stop").attr("offset","100%").attr("stop-color",x).attr("stop-opacity",1)}"neo"===l&&Y.has(g??"")&&m.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",u);let b=0;$.forEach((t,r)=>{const e=rt(t.name),o=m.append("g"),n=o.insert("g").attr("class","branchLabel"),a=n.insert("g").attr("class","label branch-label");a.node()?.appendChild(e);const i=e.getBBox();b=wt(t.name,b,r,i,d),a.remove(),n.remove(),o.remove()}),pt(m,J,!1,c),c.showBranches&&bt(m,$,c,r),ut(m,J),pt(m,J,!0,c),a._K.insertTitle(m,"gitTitleText",c.titleTopMargin??0,n.getDiagramTitle()),(0,i.mj)(void 0,m,c.diagramPadding,c.useMaxWidth)},"draw")};var Bt=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),Et=new Set(["redux-color","redux-dark-color"]),Ct=new Set(["neo","neo-dark"]),Tt=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),Lt=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),Kt=(0,c.K)(t=>{const{svgId:r}=t;let e="";if(t.useGradient&&r)for(let o=0;o<t.THEME_COLOR_LIMIT;o++)e+=`\n .label${o} { fill: ${t.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${t.strokeWidth};}\n `;return e},"genGitGraphGradient"),Mt=(0,c.K)(t=>{const r=(0,i.zj)(),{theme:e,themeVariables:o}=r,{borderColorArray:n}=o,a=Bt.has(e);if(Ct.has(e)){let r="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)if(0===e)r+=`\n .branch-label${e} { fill: ${t.nodeBorder};}\n .commit${e} { stroke: ${t.nodeBorder}; }\n .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }\n .arrow${e} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }\n ${Kt(t)}`;else{const o=e%8;r+=`\n .branch-label${e} { fill: ${t["gitBranchLabel"+o]}; }\n .commit${e} { stroke: ${t["git"+o]}; fill: ${t["git"+o]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+o]}; fill: ${t["gitInv"+o]}; }\n .arrow${e} { stroke: ${t["git"+o]}; }\n `}return r}if(Et.has(e)){let r="";for(let o=0;o<t.THEME_COLOR_LIMIT;o++)if(0===o)r+=`\n .branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${o} { stroke: ${t.nodeBorder}; }\n .commit-highlight${o} { stroke: ${t.nodeBorder}; fill: ${t.mainBkg}; }\n .label${o} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .arrow${o} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n `;else{const i=o%n.length;r+=`\n .branch-label${o} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${o} { stroke: ${n[i]}; fill: ${n[i]}; }\n .commit-highlight${o} { stroke: ${n[i]}; fill: ${n[i]}; }\n .label${o} { fill: ${Tt.has(e)?t.mainBkg:n[i]}; stroke: ${n[i]}; stroke-width: ${t.strokeWidth}; }\n .arrow${o} { stroke: ${n[i]}; }\n `}return r}{let r="";for(let e=0;e<t.THEME_COLOR_LIMIT;e++)r+=`\n .branch-label${e} { fill: ${t.nodeBorder}; ${a?`font-weight:${t.noteFontWeight}`:""} }\n .commit${e} { stroke: ${t.nodeBorder}; }\n .commit-highlight${e} { stroke: ${t.nodeBorder}; fill: ${t.nodeBorder}; }\n .label${e} { fill: ${t.mainBkg}; stroke: ${t.nodeBorder}; stroke-width: ${t.strokeWidth}; ${a?`font-weight:${t.noteFontWeight}`:""}}\n .arrow${e} { stroke: ${t.nodeBorder}; }\n .commit-bullets { fill: ${t.nodeBorder}; }\n .commit-cherry-pick${e} { stroke: ${t.nodeBorder}; }\n `;return r}},"genColor"),Rt=(0,c.K)(t=>`${Array.from({length:t.THEME_COLOR_LIMIT},(t,r)=>r).map(r=>{const e=r%8;return`\n .branch-label${r} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${r} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${r} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${r} { fill: ${t["git"+e]}; }\n .arrow${r} { stroke: ${t["git"+e]}; }\n `}).join("\n")}`,"normalTheme"),vt={parser:q,db:P,renderer:kt,styles:(0,c.K)(t=>{const r=(0,i.zj)(),{theme:e}=r,o=Lt.has(e);return`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n \n ${o?Mt(t):Rt(t)}\n\n .branch {\n stroke-width: ${t.strokeWidth};\n stroke: ${t.commitLineColor??t.lineColor};\n stroke-dasharray: ${o?"4 2":"2"};\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${o?t.nodeBorder:t.commitLabelColor}; ${o?`font-weight:${t.noteFontWeight};`:""}}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${o?"transparent":t.commitLabelBackground}; opacity: ${o?"":.5}; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${o?t.mainBkg:t.tagLabelBackground}; stroke: ${o?t.nodeBorder:t.tagLabelBorder}; ${o?`filter:${t.dropShadow}`:""} }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n }\n .commit-reverse {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n stroke-width: ${o?t.strokeWidth:3};\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${o?t.mainBkg:t.primaryColor};\n fill: ${o?t.mainBkg:t.primaryColor};\n }\n\n .arrow {\n /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */\n stroke-width: ${Bt.has(e)?t.strokeWidth:8};\n stroke-linecap: round;\n fill: none\n }\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`},"getStyles")}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8888],{77454(t,e,n){function a(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}n.d(e,{S:()=>a}),(0,n(86827).K)(a,"populateCommonDb")},98888(t,e,n){n.d(e,{diagram:()=>A});var a=n(77454),r=n(37851),i=n(28342),o=n(68861),c=n(31293),s=n(86827),l=n(34376),d=(0,s.K)(()=>({domains:new Map,transitions:[]}),"createDefaultData"),f=d(),p={getDomains:(0,s.K)(()=>f.domains,"getDomains"),getTransitions:(0,s.K)(()=>f.transitions,"getTransitions"),setDomains:(0,s.K)(t=>{if(t)for(const e of t){const t=e.domain,n=(e.items??[]).map(t=>({label:t.label}));f.domains.set(t,{name:t,items:n})}},"setDomains"),setTransitions:(0,s.K)(t=>{t&&(f.transitions=t.filter(t=>t.from!==t.to||(c.R.warn(`Cynefin: self-loop transition on domain "${t.from}" is not meaningful and will be skipped.`),!1)).map(t=>({from:t.from,to:t.to,label:t.label||void 0})))},"setTransitions"),getConfig:(0,s.K)(()=>(0,i.$t)({...o.UI.cynefin,...(0,o.zj)().cynefin}),"getConfig"),clear:(0,s.K)(()=>{(0,o.IU)(),f=d()},"clear"),setAccTitle:o.SV,getAccTitle:o.iN,setDiagramTitle:o.ke,getDiagramTitle:o.ab,getAccDescription:o.m7,setAccDescription:o.EI},m=(0,s.K)(t=>{(0,a.S)(t,p),p.setDomains(t.domains),p.setTransitions(t.transitions)},"populate"),y={parse:(0,s.K)(async t=>{const e=await(0,l.qg)("cynefin",t);c.R.debug(e),m(e)},"parse")};function x(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}function h(t){let e=0;for(let n=0;n<t.length;n++){e=(e<<5)-e+t.charCodeAt(n),e|=0}return e}function $(t,e){return"number"==typeof t&&Number.isFinite(t)&&0!==t?t:h(e)}function g(t,e,n,a){const r=t/2,i=a??.015*t,o=e/7,c=[];for(let t=0;t<=7;t++){const e=x(n+17*t)*i*2-i;c.push({x:r+e,y:t*o})}let s=`M${c[0].x},${c[0].y}`;for(let t=0;t<c.length-1;t++){const e=c[t],a=c[t+1],r=(e.y+a.y)/2,o=1.5*i*(t%2==0?1:-1)*x(n+31*t+7);s+=` C${e.x+o},${r} ${a.x-o},${r} ${a.x},${a.y}`}return s}function u(t,e,n,a){const r=e/2,i=a??.015*e,o=t/7,c=[];for(let t=0;t<=7;t++){const e=x(n+23*t)*i*2-i;c.push({x:t*o,y:r+e})}let s=`M${c[0].x},${c[0].y}`;for(let t=0;t<c.length-1;t++){const e=c[t],a=c[t+1],r=(e.x+a.x)/2,o=1.5*i*(t%2==0?1:-1)*x(n+37*t+11);s+=` C${r},${e.y+o} ${r},${a.y-o} ${a.x},${a.y}`}return s}function b(t,e){const n=t/2,a=.5*e,r=.03*t;return[`M${n},${a}`,`C${n+r},${a+.2*(e-a)}`,`${n-1.5*r},${a+.55*(e-a)}`,`${n+.5*r},${a+.75*(e-a)}`,`C${n-r},${a+.85*(e-a)}`,`${n+.3*r},${a+.95*(e-a)}`,`${n},${e}`].join(" ")}function w(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}(0,s.K)(x,"seededRandom"),(0,s.K)(h,"hashString"),(0,s.K)($,"resolveSeed"),(0,s.K)(g,"generateFoldPath"),(0,s.K)(u,"generateHorizontalBoundary"),(0,s.K)(b,"generateCliffPath"),(0,s.K)(w,"generateConfusionPath");var C={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},k=(0,s.K)((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:.7*n,y:.7*a,w:.6*n,h:.6*a}}},"getDomainLayouts"),D=(0,s.K)(()=>{const t=(0,o.P$)(),e=(0,o.zj)();return(0,i.$t)(t,e.themeVariables).cynefin},"getCynefinDomainColors"),K={draw:(0,s.K)((t,e,n,a)=>{const i=a.db,s=i.getDomains(),l=i.getTransitions(),d=i.getDiagramTitle(),f=i.getAccTitle(),p=i.getAccDescription(),m=i.getConfig(),y=D();c.R.debug("Rendering Cynefin diagram");const x=m.width,h=m.height,K=m.padding,T=m.showDomainDescriptions,A=m.boundaryAmplitude,B=x+2*K,S=h+2*K,z={complex:y.complexBg,complicated:y.complicatedBg,clear:y.clearBg,chaotic:y.chaoticBg,confusion:y.confusionBg},v=(0,r.D)(e);(0,o.a$)(v,S,B,m.useMaxWidth??!0),v.attr("viewBox",`0 0 ${B} ${S}`),f&&v.append("title").text(f),p&&v.append("desc").text(p);const M=v.append("g").attr("transform",`translate(${K}, ${K})`),I=k(x,h),L=$(m.seed,e),P=M.append("g").attr("class","cynefin-backgrounds"),R=["complex","complicated","chaotic","clear"];for(const t of R){const e=I[t];P.append("rect").attr("class","cynefinDomain").attr("x",e.x).attr("y",e.y).attr("width",e.w).attr("height",e.h).attr("fill",z[t]).attr("fill-opacity",.4).attr("stroke","none")}const F=M.append("g").attr("class","cynefin-boundaries");F.append("path").attr("class","cynefinBoundary").attr("d",g(x,h,L,A)).attr("fill","none"),F.append("path").attr("class","cynefinBoundary").attr("d",u(x,h,L+100,A)).attr("fill","none"),F.append("path").attr("class","cynefinCliff").attr("d",b(x,h)).attr("fill","none");const j=.15*x,W=.15*h;M.append("path").attr("class","cynefinConfusion").attr("d",w(x/2,h/2,j,W)).attr("fill",z.confusion).attr("fill-opacity",.5);const E=M.append("g").attr("class","cynefin-labels");for(const t of R){const e=I[t];E.append("text").attr("class","cynefinDomainLabel").attr("x",e.cx).attr("y",T?e.cy-30:e.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(t.charAt(0).toUpperCase()+t.slice(1))}if(E.append("text").attr("class","cynefinDomainLabel").attr("x",x/2).attr("y",T?h/2-10:h/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),T){const t=M.append("g").attr("class","cynefin-subtitles");for(const e of R){const n=I[e],a=C[e];t.append("text").attr("class","cynefinSubtitle").attr("x",n.cx).attr("y",n.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(a.model),t.append("text").attr("class","cynefinSubtitle").attr("x",n.cx).attr("y",n.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(a.practice)}t.append("text").attr("class","cynefinSubtitle").attr("x",x/2).attr("y",h/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(C.confusion.practice)}const H=M.append("g").attr("class","cynefin-items"),N=26,U=["complex","complicated","chaotic","clear","confusion"];for(const t of U){const e=s.get(t);if(!e||0===e.items.length)continue;const n=I[t],a="confusion"===t;let r,i=e.items,o=0;if(a&&e.items.length>3&&(o=e.items.length-3,i=e.items.slice(0,3)),a){const t=T?22:14;r=n.cy+t}else r=n.cy+(T?25:15);if([...i].forEach((e,a)=>{const i=r+30*a,o=H.append("g"),c=o.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",13).attr("text-anchor","middle").attr("dominant-baseline","central").text(e.label);let s=7*e.label.length;const l=c.node();if(l&&"function"==typeof l.getBBox){const t=l.getBBox();t.width>0&&(s=t.width)}const d=s+20,f=n.cx-d/2;o.attr("transform",`translate(${f}, ${i})`),o.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",d).attr("height",N).attr("rx",4).attr("ry",4).attr("fill",z[t]).attr("fill-opacity",.95),c.attr("x",d/2).attr("y",13)}),o>0){const e=r+30*i.length,a=`+${o} more`,c=H.append("g"),s=c.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",13).attr("text-anchor","middle").attr("dominant-baseline","central").text(a);let l=7*a.length;const d=s.node();if(d&&"function"==typeof d.getBBox){const t=d.getBBox();t.width>0&&(l=t.width)}const f=l+20,p=n.cx-f/2;c.attr("transform",`translate(${p}, ${e})`),c.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",f).attr("height",N).attr("rx",4).attr("ry",4).attr("fill",z[t]).attr("fill-opacity",.6),s.attr("x",f/2).attr("y",13)}}if(l.length>0){const t=v.select("defs").empty()?v.append("defs"):v.select("defs"),n=`cynefin-arrow-${e}`;t.append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const a=M.append("g").attr("class","cynefin-arrows");l.forEach(t=>{const e=I[t.from],r=I[t.to];if(!e||!r)return;if(t.from===t.to)return void c.R.warn(`Cynefin renderer: skipping self-loop on domain "${t.from}"`);const i=e.cx,o=e.cy,s=r.cx,l=r.cy,d=(i+s)/2,f=(o+l)/2,p=s-i,m=l-o,y=Math.sqrt(p*p+m*m),x=.15*y,h=d+-m/y*x,$=f+p/y*x;a.append("path").attr("class","cynefinArrowLine").attr("d",`M${i},${o} Q${h},${$} ${s},${l}`).attr("fill","none").attr("marker-end",`url(#${n})`),t.label&&a.append("text").attr("class","cynefinArrowLabel").attr("x",h).attr("y",$-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(t.label)})}d&&M.append("text").attr("class","cynefinTitle").attr("x",x/2).attr("y",-K/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(d)},"draw")},T=(0,s.K)(()=>{const t=(0,o.P$)(),e=(0,o.zj)();return(0,i.$t)(t,e.themeVariables).cynefin},"getCynefinTheme"),A={parser:y,db:p,renderer:K,styles:(0,s.K)(()=>{const t=T();return`\n\t.cynefinDomain {\n\t\tstroke: none;\n\t}\n\t.cynefinDomainLabel {\n\t\tfont-size: ${t.domainFontSize}px;\n\t\tfont-weight: bold;\n\t\tfill: ${t.labelColor};\n\t}\n\t.cynefinSubtitle {\n\t\tfont-size: ${t.itemFontSize-1}px;\n\t\tfill: ${t.textColor};\n\t\tfont-style: italic;\n\t}\n\t.cynefinItem {\n\t\tfill-opacity: 0.95;\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1;\n\t}\n\t.cynefinItemText {\n\t\tfont-size: ${t.itemFontSize}px;\n\t\tfill: ${t.textColor};\n\t}\n\t.cynefinItemOverflow {\n\t\tfill-opacity: 0.6;\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1;\n\t\tstroke-dasharray: 3 2;\n\t}\n\t.cynefinBoundary {\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: ${t.boundaryWidth};\n\t\tstroke-dasharray: 6 3;\n\t}\n\t.cynefinCliff {\n\t\tstroke: ${t.cliffColor};\n\t\tstroke-width: ${t.cliffWidth};\n\t}\n\t.cynefinConfusion {\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1.5;\n\t\tstroke-dasharray: 4 2;\n\t}\n\t.cynefinArrowLine {\n\t\tstroke: ${t.arrowColor};\n\t\tstroke-width: ${t.arrowWidth};\n\t\tfill: none;\n\t}\n\t.cynefinArrowHead {\n\t\tfill: ${t.arrowColor};\n\t\tstroke: none;\n\t}\n\t.cynefinArrowLabel {\n\t\tfont-size: ${t.itemFontSize-1}px;\n\t\tfill: ${t.textColor};\n\t}\n\t.cynefinTitle {\n\t\tfont-size: ${t.domainFontSize+2}px;\n\t\tfont-weight: bold;\n\t\tfill: ${t.labelColor};\n\t}\n\t`},"styles")}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1730],{77454(t,e,n){function a(t,e){t.accDescr&&e.setAccDescription?.(t.accDescr),t.accTitle&&e.setAccTitle?.(t.accTitle),t.title&&e.setDiagramTitle?.(t.title)}n.d(e,{S:()=>a}),(0,n(86827).K)(a,"populateCommonDb")},11730(t,e,n){n.d(e,{diagram:()=>A});var a=n(77454),r=n(22422),i=n(99087),o=n(32178),c=n(31293),s=n(86827),l=n(34376),d=(0,s.K)(()=>({domains:new Map,transitions:[]}),"createDefaultData"),f=d(),p={getDomains:(0,s.K)(()=>f.domains,"getDomains"),getTransitions:(0,s.K)(()=>f.transitions,"getTransitions"),setDomains:(0,s.K)(t=>{if(t)for(const e of t){const t=e.domain,n=(e.items??[]).map(t=>({label:t.label}));f.domains.set(t,{name:t,items:n})}},"setDomains"),setTransitions:(0,s.K)(t=>{t&&(f.transitions=t.filter(t=>t.from!==t.to||(c.R.warn(`Cynefin: self-loop transition on domain "${t.from}" is not meaningful and will be skipped.`),!1)).map(t=>({from:t.from,to:t.to,label:t.label||void 0})))},"setTransitions"),getConfig:(0,s.K)(()=>(0,i.$t)({...o.UI.cynefin,...(0,o.zj)().cynefin}),"getConfig"),clear:(0,s.K)(()=>{(0,o.IU)(),f=d()},"clear"),setAccTitle:o.SV,getAccTitle:o.iN,setDiagramTitle:o.ke,getDiagramTitle:o.ab,getAccDescription:o.m7,setAccDescription:o.EI},m=(0,s.K)(t=>{(0,a.S)(t,p),p.setDomains(t.domains),p.setTransitions(t.transitions)},"populate"),y={parse:(0,s.K)(async t=>{const e=await(0,l.qg)("cynefin",t);c.R.debug(e),m(e)},"parse")};function x(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}function h(t){let e=0;for(let n=0;n<t.length;n++){e=(e<<5)-e+t.charCodeAt(n),e|=0}return e}function $(t,e){return"number"==typeof t&&Number.isFinite(t)&&0!==t?t:h(e)}function g(t,e,n,a){const r=t/2,i=a??.015*t,o=e/7,c=[];for(let t=0;t<=7;t++){const e=x(n+17*t)*i*2-i;c.push({x:r+e,y:t*o})}let s=`M${c[0].x},${c[0].y}`;for(let t=0;t<c.length-1;t++){const e=c[t],a=c[t+1],r=(e.y+a.y)/2,o=1.5*i*(t%2==0?1:-1)*x(n+31*t+7);s+=` C${e.x+o},${r} ${a.x-o},${r} ${a.x},${a.y}`}return s}function u(t,e,n,a){const r=e/2,i=a??.015*e,o=t/7,c=[];for(let t=0;t<=7;t++){const e=x(n+23*t)*i*2-i;c.push({x:t*o,y:r+e})}let s=`M${c[0].x},${c[0].y}`;for(let t=0;t<c.length-1;t++){const e=c[t],a=c[t+1],r=(e.x+a.x)/2,o=1.5*i*(t%2==0?1:-1)*x(n+37*t+11);s+=` C${r},${e.y+o} ${r},${a.y-o} ${a.x},${a.y}`}return s}function b(t,e){const n=t/2,a=.5*e,r=.03*t;return[`M${n},${a}`,`C${n+r},${a+.2*(e-a)}`,`${n-1.5*r},${a+.55*(e-a)}`,`${n+.5*r},${a+.75*(e-a)}`,`C${n-r},${a+.85*(e-a)}`,`${n+.3*r},${a+.95*(e-a)}`,`${n},${e}`].join(" ")}function w(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}(0,s.K)(x,"seededRandom"),(0,s.K)(h,"hashString"),(0,s.K)($,"resolveSeed"),(0,s.K)(g,"generateFoldPath"),(0,s.K)(u,"generateHorizontalBoundary"),(0,s.K)(b,"generateCliffPath"),(0,s.K)(w,"generateConfusionPath");var C={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},k=(0,s.K)((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:.7*n,y:.7*a,w:.6*n,h:.6*a}}},"getDomainLayouts"),D=(0,s.K)(()=>{const t=(0,o.P$)(),e=(0,o.zj)();return(0,i.$t)(t,e.themeVariables).cynefin},"getCynefinDomainColors"),K={draw:(0,s.K)((t,e,n,a)=>{const i=a.db,s=i.getDomains(),l=i.getTransitions(),d=i.getDiagramTitle(),f=i.getAccTitle(),p=i.getAccDescription(),m=i.getConfig(),y=D();c.R.debug("Rendering Cynefin diagram");const x=m.width,h=m.height,K=m.padding,T=m.showDomainDescriptions,A=m.boundaryAmplitude,B=x+2*K,S=h+2*K,z={complex:y.complexBg,complicated:y.complicatedBg,clear:y.clearBg,chaotic:y.chaoticBg,confusion:y.confusionBg},v=(0,r.D)(e);(0,o.a$)(v,S,B,m.useMaxWidth??!0),v.attr("viewBox",`0 0 ${B} ${S}`),f&&v.append("title").text(f),p&&v.append("desc").text(p);const M=v.append("g").attr("transform",`translate(${K}, ${K})`),I=k(x,h),L=$(m.seed,e),P=M.append("g").attr("class","cynefin-backgrounds"),R=["complex","complicated","chaotic","clear"];for(const t of R){const e=I[t];P.append("rect").attr("class","cynefinDomain").attr("x",e.x).attr("y",e.y).attr("width",e.w).attr("height",e.h).attr("fill",z[t]).attr("fill-opacity",.4).attr("stroke","none")}const F=M.append("g").attr("class","cynefin-boundaries");F.append("path").attr("class","cynefinBoundary").attr("d",g(x,h,L,A)).attr("fill","none"),F.append("path").attr("class","cynefinBoundary").attr("d",u(x,h,L+100,A)).attr("fill","none"),F.append("path").attr("class","cynefinCliff").attr("d",b(x,h)).attr("fill","none");const j=.15*x,W=.15*h;M.append("path").attr("class","cynefinConfusion").attr("d",w(x/2,h/2,j,W)).attr("fill",z.confusion).attr("fill-opacity",.5);const E=M.append("g").attr("class","cynefin-labels");for(const t of R){const e=I[t];E.append("text").attr("class","cynefinDomainLabel").attr("x",e.cx).attr("y",T?e.cy-30:e.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(t.charAt(0).toUpperCase()+t.slice(1))}if(E.append("text").attr("class","cynefinDomainLabel").attr("x",x/2).attr("y",T?h/2-10:h/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),T){const t=M.append("g").attr("class","cynefin-subtitles");for(const e of R){const n=I[e],a=C[e];t.append("text").attr("class","cynefinSubtitle").attr("x",n.cx).attr("y",n.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(a.model),t.append("text").attr("class","cynefinSubtitle").attr("x",n.cx).attr("y",n.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(a.practice)}t.append("text").attr("class","cynefinSubtitle").attr("x",x/2).attr("y",h/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(C.confusion.practice)}const H=M.append("g").attr("class","cynefin-items"),N=26,U=["complex","complicated","chaotic","clear","confusion"];for(const t of U){const e=s.get(t);if(!e||0===e.items.length)continue;const n=I[t],a="confusion"===t;let r,i=e.items,o=0;if(a&&e.items.length>3&&(o=e.items.length-3,i=e.items.slice(0,3)),a){const t=T?22:14;r=n.cy+t}else r=n.cy+(T?25:15);if([...i].forEach((e,a)=>{const i=r+30*a,o=H.append("g"),c=o.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",13).attr("text-anchor","middle").attr("dominant-baseline","central").text(e.label);let s=7*e.label.length;const l=c.node();if(l&&"function"==typeof l.getBBox){const t=l.getBBox();t.width>0&&(s=t.width)}const d=s+20,f=n.cx-d/2;o.attr("transform",`translate(${f}, ${i})`),o.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",d).attr("height",N).attr("rx",4).attr("ry",4).attr("fill",z[t]).attr("fill-opacity",.95),c.attr("x",d/2).attr("y",13)}),o>0){const e=r+30*i.length,a=`+${o} more`,c=H.append("g"),s=c.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",13).attr("text-anchor","middle").attr("dominant-baseline","central").text(a);let l=7*a.length;const d=s.node();if(d&&"function"==typeof d.getBBox){const t=d.getBBox();t.width>0&&(l=t.width)}const f=l+20,p=n.cx-f/2;c.attr("transform",`translate(${p}, ${e})`),c.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",f).attr("height",N).attr("rx",4).attr("ry",4).attr("fill",z[t]).attr("fill-opacity",.6),s.attr("x",f/2).attr("y",13)}}if(l.length>0){const t=v.select("defs").empty()?v.append("defs"):v.select("defs"),n=`cynefin-arrow-${e}`;t.append("marker").attr("id",n).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const a=M.append("g").attr("class","cynefin-arrows");l.forEach(t=>{const e=I[t.from],r=I[t.to];if(!e||!r)return;if(t.from===t.to)return void c.R.warn(`Cynefin renderer: skipping self-loop on domain "${t.from}"`);const i=e.cx,o=e.cy,s=r.cx,l=r.cy,d=(i+s)/2,f=(o+l)/2,p=s-i,m=l-o,y=Math.sqrt(p*p+m*m),x=.15*y,h=d+-m/y*x,$=f+p/y*x;a.append("path").attr("class","cynefinArrowLine").attr("d",`M${i},${o} Q${h},${$} ${s},${l}`).attr("fill","none").attr("marker-end",`url(#${n})`),t.label&&a.append("text").attr("class","cynefinArrowLabel").attr("x",h).attr("y",$-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(t.label)})}d&&M.append("text").attr("class","cynefinTitle").attr("x",x/2).attr("y",-K/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(d)},"draw")},T=(0,s.K)(()=>{const t=(0,o.P$)(),e=(0,o.zj)();return(0,i.$t)(t,e.themeVariables).cynefin},"getCynefinTheme"),A={parser:y,db:p,renderer:K,styles:(0,s.K)(()=>{const t=T();return`\n\t.cynefinDomain {\n\t\tstroke: none;\n\t}\n\t.cynefinDomainLabel {\n\t\tfont-size: ${t.domainFontSize}px;\n\t\tfont-weight: bold;\n\t\tfill: ${t.labelColor};\n\t}\n\t.cynefinSubtitle {\n\t\tfont-size: ${t.itemFontSize-1}px;\n\t\tfill: ${t.textColor};\n\t\tfont-style: italic;\n\t}\n\t.cynefinItem {\n\t\tfill-opacity: 0.95;\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1;\n\t}\n\t.cynefinItemText {\n\t\tfont-size: ${t.itemFontSize}px;\n\t\tfill: ${t.textColor};\n\t}\n\t.cynefinItemOverflow {\n\t\tfill-opacity: 0.6;\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1;\n\t\tstroke-dasharray: 3 2;\n\t}\n\t.cynefinBoundary {\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: ${t.boundaryWidth};\n\t\tstroke-dasharray: 6 3;\n\t}\n\t.cynefinCliff {\n\t\tstroke: ${t.cliffColor};\n\t\tstroke-width: ${t.cliffWidth};\n\t}\n\t.cynefinConfusion {\n\t\tstroke: ${t.boundaryColor};\n\t\tstroke-width: 1.5;\n\t\tstroke-dasharray: 4 2;\n\t}\n\t.cynefinArrowLine {\n\t\tstroke: ${t.arrowColor};\n\t\tstroke-width: ${t.arrowWidth};\n\t\tfill: none;\n\t}\n\t.cynefinArrowHead {\n\t\tfill: ${t.arrowColor};\n\t\tstroke: none;\n\t}\n\t.cynefinArrowLabel {\n\t\tfont-size: ${t.itemFontSize-1}px;\n\t\tfill: ${t.textColor};\n\t}\n\t.cynefinTitle {\n\t\tfont-size: ${t.domainFontSize+2}px;\n\t\tfont-weight: bold;\n\t\tfill: ${t.labelColor};\n\t}\n\t`},"styles")}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4892],{84892(t,e,i){i.d(e,{diagram:()=>C});var n=i(37851),s=i(28342),a=i(68861),r=(i(31293),i(86827)),h=i(61057),o=function(){var t=(0,r.K)(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),e=[1,4],i=[1,14],n=[1,12],s=[1,13],a=[6,7,8],h=[1,20],o=[1,18],l=[1,19],c=[6,7,11],u=[1,6,13,14],d=[1,23],y=[1,24],p=[1,6,7,11,13,14],g={trace:(0,r.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:(0,r.K)(function(t,e,i,n,s,a,r){var h=a.length-1;switch(s){case 6:case 7:return n;case 15:n.addNode(a[h-1].length,a[h].trim());break;case 16:n.addNode(0,a[h].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:i,7:[1,10],9:9,12:11,13:n,14:s},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:i,12:15,13:n,14:s},{6:i,9:16,12:11,13:n,14:s},{6:h,7:o,10:17,11:l},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:h,7:o,10:22,11:l},{1:[2,7],6:i,12:15,13:n,14:s},t(u,[2,14],{7:d,11:y}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(c,[2,15]),t(u,[2,13],{7:d,11:y}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,r.K)(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:(0,r.K)(function(t){var e=this,i=[0],n=[],s=[null],a=[],h=this.table,o="",l=0,c=0,u=0,d=a.slice.call(arguments,1),y=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);y.setInput(t,p.yy),p.yy.lexer=y,p.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var f=y.yylloc;a.push(f);var k=y.options&&y.options.ranges;function m(){var t;return"number"!=typeof(t=n.pop()||y.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,r.K)(function(t){i.length=i.length-2*t,s.length=s.length-t,a.length=a.length-t},"popStack"),(0,r.K)(m,"lex");for(var w,x,b,_,v,S,K,$,I,E={};;){if(b=i[i.length-1],this.defaultActions[b]?_=this.defaultActions[b]:(null==w&&(w=m()),_=h[b]&&h[b][w]),void 0===_||!_.length||!_[0]){var A="";for(S in I=[],h[b])this.terminals_[S]&&S>2&&I.push("'"+this.terminals_[S]+"'");A=y.showPosition?"Parse error on line "+(l+1)+":\n"+y.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==w?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(A,{text:y.match,token:this.terminals_[w]||w,line:y.yylineno,loc:f,expected:I})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+w);switch(_[0]){case 1:i.push(w),s.push(y.yytext),a.push(y.yylloc),i.push(_[1]),w=null,x?(w=x,x=null):(c=y.yyleng,o=y.yytext,l=y.yylineno,f=y.yylloc,u>0&&u--);break;case 2:if(K=this.productions_[_[1]][1],E.$=s[s.length-K],E._$={first_line:a[a.length-(K||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(K||1)].first_column,last_column:a[a.length-1].last_column},k&&(E._$.range=[a[a.length-(K||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,_[1],s,a].concat(d))))return v;K&&(i=i.slice(0,-1*K*2),s=s.slice(0,-1*K),a=a.slice(0,-1*K)),i.push(this.productions_[_[1]][0]),s.push(E.$),a.push(E._$),$=h[i[i.length-2]][i[i.length-1]],i.push($);break;case 3:return!0}}return!0},"parse")},f=function(){return{EOF:1,parseError:(0,r.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,r.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,r.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,r.K)(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,r.K)(function(){return this._more=!0,this},"more"),reject:(0,r.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,r.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,r.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,r.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,r.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,r.K)(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},"test_match"),next:(0,r.K)(function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((i=this._input.match(this.rules[s[a]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,r.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,r.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,r.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,r.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,r.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,r.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,r.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,r.K)(function(t,e,i,n){switch(i){case 0:case 3:return 6;case 1:case 2:return 8;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function k(){this.yy={}}return g.lexer=f,(0,r.K)(k,"Parser"),k.prototype=g,g.Parser=k,new k}();o.parser=o;var l=o,c=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{(0,r.K)(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,(0,a.IU)()}getRoot(){return this.root}addNode(t,e){const i=a.Y2.sanitizeText(e,(0,a.D7)());if(!this.root)return this.root={text:i,children:[]},this.stack=[{level:0,node:this.root}],void(0,a.ke)(i);this.baseLevel??=t;let n=t-this.baseLevel+1;for(n<=0&&(n=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=n;)this.stack.pop();const s={text:i,children:[]};this.stack[this.stack.length-1].node.children.push(s),this.stack.push({level:n,node:s})}getAccTitle(){return(0,a.iN)()}setAccTitle(t){(0,a.SV)(t)}getAccDescription(){return(0,a.m7)()}setAccDescription(t){(0,a.EI)(t)}getDiagramTitle(){return(0,a.ab)()}setDiagramTitle(t){(0,a.ke)(t)}},u=250,d=82*Math.PI/180,y=Math.cos(d),p=Math.sin(d),g=(0,r.K)((t,e,i)=>{const n=t.node().getBBox(),s=n.width+2*e,r=n.height+2*e;(0,a.a$)(t,r,s,i),t.attr("viewBox",`${n.x-e} ${n.y-e} ${s} ${r}`)},"applyPaddedViewBox"),f=(0,r.K)((t,e,i,r)=>{const o=r.db.getRoot();if(!o)return;const l=(0,a.D7)(),{look:c,handDrawnSeed:d,themeVariables:y}=l,p=(0,s.I5)(l.fontSize)[0]??14,f="handDrawn"===c,w=o.children??[],x=l.ishikawa?.diagramPadding??20,b=l.ishikawa?.useMaxWidth??!1,v=(0,n.D)(e),S=v.append("g").attr("class","ishikawa"),K=f?h.A.svg(v.node()):void 0,$=K?{roughSvg:K,seed:d??0,lineColor:y?.lineColor??"#333",fillColor:y?.mainBkg??"#fff"}:void 0,E=`ishikawa-arrow-${e}`;f||S.append("defs").append("marker").attr("id",E).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let A=0,C=u;const L=f?void 0:I(S,A,C,A,C,"ishikawa-spine");if(m(S,A,C,o.text,p,$),!w.length)return f&&I(S,A,C,A,C,"ishikawa-spine",$),void g(v,x,b);A-=20;const M=w.filter((t,e)=>e%2==0),P=w.filter((t,e)=>e%2==1),T=k(M),B=k(P),D=T.total+B.total;let N=u,O=u;if(D>0){const t=500,e=75;N=Math.max(e,t*(T.total/D)),O=Math.max(e,t*(B.total/D))}const W=2*p;N=Math.max(N,T.max*W),O=Math.max(O,B.max*W),C=Math.max(N,u),L&&L.attr("y1",C).attr("y2",C),S.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const j=Math.ceil(w.length/2);for(let t=0;t<j;t++){const e=S.append("g").attr("class","ishikawa-pair");for(const[i,n,s]of[[w[2*t],-1,N],[w[2*t+1],1,O]])i&&_(e,i,A,C,n,s,p,$);A=e.selectAll("text").nodes().reduce((t,e)=>Math.min(t,e.getBBox().x),1/0)}if(f)I(S,A,C,0,C,"ishikawa-spine",$);else{L.attr("x1",A);const t=`url(#${E})`;S.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",t)}g(v,x,b)},"draw"),k=(0,r.K)(t=>{const e=(0,r.K)(t=>t.children.reduce((t,i)=>t+1+e(i),0),"countDescendants");return t.reduce((t,i)=>{const n=e(i);return t.total+=n,t.max=Math.max(t.max,n),t},{total:0,max:0})},"sideStats"),m=(0,r.K)((t,e,i,n,s,a)=>{const r=Math.max(6,Math.floor(110/(.6*s))),h=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${i})`),o=K(h,S(n,r),0,0,"ishikawa-head-label","start",s),l=o.node().getBBox(),c=Math.max(60,l.width+6),u=Math.max(40,2*l.height+40),d=`M 0 ${-u/2} L 0 ${u/2} Q ${2.4*c} 0 0 ${-u/2} Z`;if(a){const t=a.roughSvg.path(d,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-head")}else h.insert("path",":first-child").attr("class","ishikawa-head").attr("d",d);o.attr("transform",`translate(${(c-l.width)/2-l.x+3},${-l.y-l.height/2})`)},"drawHead"),w=(0,r.K)((t,e)=>{const i=[],n=[],s=(0,r.K)((t,a,r)=>{const h=-1===e?[...t].reverse():t;for(const t of h){const e=i.length,h=t.children??[];i.push({depth:r,text:S(t.text,15),parentIndex:a,childCount:h.length}),r%2==0?(n.push(e),h.length&&s(h,e,r+1)):(h.length&&s(h,e,r+1),n.push(e))}},"walk");return s(t,-1,2),{entries:i,yOrder:n}},"flattenTree"),x=(0,r.K)((t,e,i,n,s,a,r)=>{const h=t.append("g").attr("class","ishikawa-label-group"),o=K(h,e,i,n+11*s,"ishikawa-label cause","middle",a).node().getBBox();if(r){const t=r.roughSvg.rectangle(o.x-20,o.y-2,o.width+40,o.height+4,{roughness:1.5,seed:r.seed,fill:r.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:r.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-label-box")}else h.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",o.x-20).attr("y",o.y-2).attr("width",o.width+40).attr("height",o.height+4)},"drawCauseLabel"),b=(0,r.K)((t,e,i,n,s,a)=>{const r=Math.sqrt(n*n+s*s);if(0===r)return;const h=n/r,o=s/r,l=6*-o,c=6*h,u=`M ${e} ${i} L ${e-6*h*2+l} ${i-6*o*2+c} L ${e-6*h*2-l} ${i-6*o*2-c} Z`,d=a.roughSvg.path(u,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>d)},"drawArrowMarker"),_=(0,r.K)((t,e,i,n,s,a,r,h)=>{const o=e.children??[],l=a*(o.length?1:.2),c=p*l*s,u=i+-y*l,d=n+c;if(I(t,i,n,u,d,"ishikawa-branch",h),h&&b(t,i,n,i-u,n-d,h),x(t,e.text,u,d,s,r,h),!o.length)return;const{entries:g,yOrder:f}=w(o,s),k=g.length,m=new Array(k);for(const[t,e]of f.entries())m[e]=n+c*((t+1)/(k+1));const _=new Map;_.set(-1,{x0:i,y0:n,x1:u,y1:d,childCount:o.length,childrenDrawn:0});const v=-y,S=p*s,E=s<0?"ishikawa-label up":"ishikawa-label down";for(const[e,i]of g.entries()){const n=m[e],s=_.get(i.parentIndex),a=t.append("g").attr("class","ishikawa-sub-group");let o=0,l=0,c=0;if(i.depth%2==0){const t=s.y1-s.y0;o=$(s.x0,s.x1,t?(n-s.y0)/t:.5),l=n,c=o-(i.childCount>0?60+5*i.childCount:30),I(a,o,n,c,n,"ishikawa-sub-branch",h),h&&b(a,o,n,1,0,h),K(a,i.text,c,n,"ishikawa-label align","end",r)}else{const t=s.childrenDrawn++;o=$(s.x0,s.x1,(s.childCount-t)/(s.childCount+1)),l=s.y0,c=o+v*((n-l)/S),I(a,o,l,c,n,"ishikawa-sub-branch",h),h&&b(a,o,l,o-c,l-n,h),K(a,i.text,c,n,E,"end",r)}i.childCount>0&&_.set(e,{x0:o,y0:l,x1:c,y1:n,childCount:i.childCount,childrenDrawn:0})}},"drawBranch"),v=(0,r.K)(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),S=(0,r.K)((t,e)=>{if(t.length<=e)return t;const i=[];for(const n of t.split(/\s+/)){const t=i.length-1;t>=0&&i[t].length+1+n.length<=e?i[t]+=" "+n:i.push(n)}return i.join("\n")},"wrapText"),K=(0,r.K)((t,e,i,n,s,a,r)=>{const h=v(e),o=1.05*r,l=t.append("text").attr("class",s).attr("text-anchor",a).attr("x",i).attr("y",n-(h.length-1)*o/2);for(const[t,e]of h.entries())l.append("tspan").attr("x",i).attr("dy",0===t?0:o).text(e);return l},"drawMultilineText"),$=(0,r.K)((t,e,i)=>t+(e-t)*i,"lerp"),I=(0,r.K)((t,e,i,n,s,a,r)=>{if(r){const h=r.roughSvg.line(e,i,n,s,{roughness:1.5,seed:r.seed,stroke:r.lineColor,strokeWidth:2});return void t.append(()=>h).attr("class",a)}return t.append("line").attr("class",a).attr("x1",e).attr("y1",i).attr("x2",n).attr("y2",s)},"drawLine"),E={draw:f},A=(0,r.K)(t=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${t.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${t.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n fill: ${t.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),C={parser:l,get db(){return new c},renderer:E,styles:A}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1750],{61750(t,e,i){i.d(e,{diagram:()=>C});var n=i(22422),s=i(99087),a=i(32178),r=(i(31293),i(86827)),h=i(61057),o=function(){var t=(0,r.K)(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),e=[1,4],i=[1,14],n=[1,12],s=[1,13],a=[6,7,8],h=[1,20],o=[1,18],l=[1,19],c=[6,7,11],u=[1,6,13,14],d=[1,23],y=[1,24],p=[1,6,7,11,13,14],g={trace:(0,r.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:(0,r.K)(function(t,e,i,n,s,a,r){var h=a.length-1;switch(s){case 6:case 7:return n;case 15:n.addNode(a[h-1].length,a[h].trim());break;case 16:n.addNode(0,a[h].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:i,7:[1,10],9:9,12:11,13:n,14:s},t(a,[2,3]),{1:[2,2]},t(a,[2,4]),t(a,[2,5]),{1:[2,6],6:i,12:15,13:n,14:s},{6:i,9:16,12:11,13:n,14:s},{6:h,7:o,10:17,11:l},t(c,[2,18],{14:[1,21]}),t(c,[2,16]),t(c,[2,17]),{6:h,7:o,10:22,11:l},{1:[2,7],6:i,12:15,13:n,14:s},t(u,[2,14],{7:d,11:y}),t(p,[2,8]),t(p,[2,9]),t(p,[2,10]),t(c,[2,15]),t(u,[2,13],{7:d,11:y}),t(p,[2,11]),t(p,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,r.K)(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:(0,r.K)(function(t){var e=this,i=[0],n=[],s=[null],a=[],h=this.table,o="",l=0,c=0,u=0,d=a.slice.call(arguments,1),y=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);y.setInput(t,p.yy),p.yy.lexer=y,p.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var f=y.yylloc;a.push(f);var k=y.options&&y.options.ranges;function m(){var t;return"number"!=typeof(t=n.pop()||y.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,r.K)(function(t){i.length=i.length-2*t,s.length=s.length-t,a.length=a.length-t},"popStack"),(0,r.K)(m,"lex");for(var w,x,b,_,v,S,K,$,I,E={};;){if(b=i[i.length-1],this.defaultActions[b]?_=this.defaultActions[b]:(null==w&&(w=m()),_=h[b]&&h[b][w]),void 0===_||!_.length||!_[0]){var A="";for(S in I=[],h[b])this.terminals_[S]&&S>2&&I.push("'"+this.terminals_[S]+"'");A=y.showPosition?"Parse error on line "+(l+1)+":\n"+y.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[w]||w)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==w?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(A,{text:y.match,token:this.terminals_[w]||w,line:y.yylineno,loc:f,expected:I})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+w);switch(_[0]){case 1:i.push(w),s.push(y.yytext),a.push(y.yylloc),i.push(_[1]),w=null,x?(w=x,x=null):(c=y.yyleng,o=y.yytext,l=y.yylineno,f=y.yylloc,u>0&&u--);break;case 2:if(K=this.productions_[_[1]][1],E.$=s[s.length-K],E._$={first_line:a[a.length-(K||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(K||1)].first_column,last_column:a[a.length-1].last_column},k&&(E._$.range=[a[a.length-(K||1)].range[0],a[a.length-1].range[1]]),void 0!==(v=this.performAction.apply(E,[o,c,l,p.yy,_[1],s,a].concat(d))))return v;K&&(i=i.slice(0,-1*K*2),s=s.slice(0,-1*K),a=a.slice(0,-1*K)),i.push(this.productions_[_[1]][0]),s.push(E.$),a.push(E._$),$=h[i[i.length-2]][i[i.length-1]],i.push($);break;case 3:return!0}}return!0},"parse")},f=function(){return{EOF:1,parseError:(0,r.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,r.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,r.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,r.K)(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,r.K)(function(){return this._more=!0,this},"more"),reject:(0,r.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,r.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,r.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,r.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,r.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,r.K)(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},"test_match"),next:(0,r.K)(function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((i=this._input.match(this.rules[s[a]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[a])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,r.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,r.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,r.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,r.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,r.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,r.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,r.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,r.K)(function(t,e,i,n){switch(i){case 0:case 3:return 6;case 1:case 2:return 8;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function k(){this.yy={}}return g.lexer=f,(0,r.K)(k,"Parser"),k.prototype=g,g.Parser=k,new k}();o.parser=o;var l=o,c=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{(0,r.K)(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,(0,a.IU)()}getRoot(){return this.root}addNode(t,e){const i=a.Y2.sanitizeText(e,(0,a.D7)());if(!this.root)return this.root={text:i,children:[]},this.stack=[{level:0,node:this.root}],void(0,a.ke)(i);this.baseLevel??=t;let n=t-this.baseLevel+1;for(n<=0&&(n=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=n;)this.stack.pop();const s={text:i,children:[]};this.stack[this.stack.length-1].node.children.push(s),this.stack.push({level:n,node:s})}getAccTitle(){return(0,a.iN)()}setAccTitle(t){(0,a.SV)(t)}getAccDescription(){return(0,a.m7)()}setAccDescription(t){(0,a.EI)(t)}getDiagramTitle(){return(0,a.ab)()}setDiagramTitle(t){(0,a.ke)(t)}},u=250,d=82*Math.PI/180,y=Math.cos(d),p=Math.sin(d),g=(0,r.K)((t,e,i)=>{const n=t.node().getBBox(),s=n.width+2*e,r=n.height+2*e;(0,a.a$)(t,r,s,i),t.attr("viewBox",`${n.x-e} ${n.y-e} ${s} ${r}`)},"applyPaddedViewBox"),f=(0,r.K)((t,e,i,r)=>{const o=r.db.getRoot();if(!o)return;const l=(0,a.D7)(),{look:c,handDrawnSeed:d,themeVariables:y}=l,p=(0,s.I5)(l.fontSize)[0]??14,f="handDrawn"===c,w=o.children??[],x=l.ishikawa?.diagramPadding??20,b=l.ishikawa?.useMaxWidth??!1,v=(0,n.D)(e),S=v.append("g").attr("class","ishikawa"),K=f?h.A.svg(v.node()):void 0,$=K?{roughSvg:K,seed:d??0,lineColor:y?.lineColor??"#333",fillColor:y?.mainBkg??"#fff"}:void 0,E=`ishikawa-arrow-${e}`;f||S.append("defs").append("marker").attr("id",E).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let A=0,C=u;const L=f?void 0:I(S,A,C,A,C,"ishikawa-spine");if(m(S,A,C,o.text,p,$),!w.length)return f&&I(S,A,C,A,C,"ishikawa-spine",$),void g(v,x,b);A-=20;const M=w.filter((t,e)=>e%2==0),P=w.filter((t,e)=>e%2==1),T=k(M),B=k(P),D=T.total+B.total;let N=u,O=u;if(D>0){const t=500,e=75;N=Math.max(e,t*(T.total/D)),O=Math.max(e,t*(B.total/D))}const W=2*p;N=Math.max(N,T.max*W),O=Math.max(O,B.max*W),C=Math.max(N,u),L&&L.attr("y1",C).attr("y2",C),S.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const j=Math.ceil(w.length/2);for(let t=0;t<j;t++){const e=S.append("g").attr("class","ishikawa-pair");for(const[i,n,s]of[[w[2*t],-1,N],[w[2*t+1],1,O]])i&&_(e,i,A,C,n,s,p,$);A=e.selectAll("text").nodes().reduce((t,e)=>Math.min(t,e.getBBox().x),1/0)}if(f)I(S,A,C,0,C,"ishikawa-spine",$);else{L.attr("x1",A);const t=`url(#${E})`;S.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",t)}g(v,x,b)},"draw"),k=(0,r.K)(t=>{const e=(0,r.K)(t=>t.children.reduce((t,i)=>t+1+e(i),0),"countDescendants");return t.reduce((t,i)=>{const n=e(i);return t.total+=n,t.max=Math.max(t.max,n),t},{total:0,max:0})},"sideStats"),m=(0,r.K)((t,e,i,n,s,a)=>{const r=Math.max(6,Math.floor(110/(.6*s))),h=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${e},${i})`),o=K(h,S(n,r),0,0,"ishikawa-head-label","start",s),l=o.node().getBBox(),c=Math.max(60,l.width+6),u=Math.max(40,2*l.height+40),d=`M 0 ${-u/2} L 0 ${u/2} Q ${2.4*c} 0 0 ${-u/2} Z`;if(a){const t=a.roughSvg.path(d,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-head")}else h.insert("path",":first-child").attr("class","ishikawa-head").attr("d",d);o.attr("transform",`translate(${(c-l.width)/2-l.x+3},${-l.y-l.height/2})`)},"drawHead"),w=(0,r.K)((t,e)=>{const i=[],n=[],s=(0,r.K)((t,a,r)=>{const h=-1===e?[...t].reverse():t;for(const t of h){const e=i.length,h=t.children??[];i.push({depth:r,text:S(t.text,15),parentIndex:a,childCount:h.length}),r%2==0?(n.push(e),h.length&&s(h,e,r+1)):(h.length&&s(h,e,r+1),n.push(e))}},"walk");return s(t,-1,2),{entries:i,yOrder:n}},"flattenTree"),x=(0,r.K)((t,e,i,n,s,a,r)=>{const h=t.append("g").attr("class","ishikawa-label-group"),o=K(h,e,i,n+11*s,"ishikawa-label cause","middle",a).node().getBBox();if(r){const t=r.roughSvg.rectangle(o.x-20,o.y-2,o.width+40,o.height+4,{roughness:1.5,seed:r.seed,fill:r.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:r.lineColor,strokeWidth:2});h.insert(()=>t,":first-child").attr("class","ishikawa-label-box")}else h.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",o.x-20).attr("y",o.y-2).attr("width",o.width+40).attr("height",o.height+4)},"drawCauseLabel"),b=(0,r.K)((t,e,i,n,s,a)=>{const r=Math.sqrt(n*n+s*s);if(0===r)return;const h=n/r,o=s/r,l=6*-o,c=6*h,u=`M ${e} ${i} L ${e-6*h*2+l} ${i-6*o*2+c} L ${e-6*h*2-l} ${i-6*o*2-c} Z`,d=a.roughSvg.path(u,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>d)},"drawArrowMarker"),_=(0,r.K)((t,e,i,n,s,a,r,h)=>{const o=e.children??[],l=a*(o.length?1:.2),c=p*l*s,u=i+-y*l,d=n+c;if(I(t,i,n,u,d,"ishikawa-branch",h),h&&b(t,i,n,i-u,n-d,h),x(t,e.text,u,d,s,r,h),!o.length)return;const{entries:g,yOrder:f}=w(o,s),k=g.length,m=new Array(k);for(const[t,e]of f.entries())m[e]=n+c*((t+1)/(k+1));const _=new Map;_.set(-1,{x0:i,y0:n,x1:u,y1:d,childCount:o.length,childrenDrawn:0});const v=-y,S=p*s,E=s<0?"ishikawa-label up":"ishikawa-label down";for(const[e,i]of g.entries()){const n=m[e],s=_.get(i.parentIndex),a=t.append("g").attr("class","ishikawa-sub-group");let o=0,l=0,c=0;if(i.depth%2==0){const t=s.y1-s.y0;o=$(s.x0,s.x1,t?(n-s.y0)/t:.5),l=n,c=o-(i.childCount>0?60+5*i.childCount:30),I(a,o,n,c,n,"ishikawa-sub-branch",h),h&&b(a,o,n,1,0,h),K(a,i.text,c,n,"ishikawa-label align","end",r)}else{const t=s.childrenDrawn++;o=$(s.x0,s.x1,(s.childCount-t)/(s.childCount+1)),l=s.y0,c=o+v*((n-l)/S),I(a,o,l,c,n,"ishikawa-sub-branch",h),h&&b(a,o,l,o-c,l-n,h),K(a,i.text,c,n,E,"end",r)}i.childCount>0&&_.set(e,{x0:o,y0:l,x1:c,y1:n,childCount:i.childCount,childrenDrawn:0})}},"drawBranch"),v=(0,r.K)(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),S=(0,r.K)((t,e)=>{if(t.length<=e)return t;const i=[];for(const n of t.split(/\s+/)){const t=i.length-1;t>=0&&i[t].length+1+n.length<=e?i[t]+=" "+n:i.push(n)}return i.join("\n")},"wrapText"),K=(0,r.K)((t,e,i,n,s,a,r)=>{const h=v(e),o=1.05*r,l=t.append("text").attr("class",s).attr("text-anchor",a).attr("x",i).attr("y",n-(h.length-1)*o/2);for(const[t,e]of h.entries())l.append("tspan").attr("x",i).attr("dy",0===t?0:o).text(e);return l},"drawMultilineText"),$=(0,r.K)((t,e,i)=>t+(e-t)*i,"lerp"),I=(0,r.K)((t,e,i,n,s,a,r)=>{if(r){const h=r.roughSvg.line(e,i,n,s,{roughness:1.5,seed:r.seed,stroke:r.lineColor,strokeWidth:2});return void t.append(()=>h).attr("class",a)}return t.append("line").attr("class",a).attr("x1",e).attr("y1",i).attr("x2",n).attr("y2",s)},"drawLine"),E={draw:f},A=(0,r.K)(t=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${t.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${t.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n fill: ${t.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),C={parser:l,get db(){return new c},renderer:E,styles:A}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1218],{71218(t,e,n){n.d(e,{diagram:()=>Et});var s=n(37851),i=n(28342),r=n(68861),o=(n(31293),n(86827)),a=n(51444),l=n(5097),c=n(95635);const h=(t,e)=>(0,c.A)(t,"a",-e);var u=n(78041),f=n(75263);const d=1e-10;function y(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let s=n+1;s<t.length;++s){const i=m(t[n],t[s]);for(const t of i)t.parentIndex=[n,s],e.push(t)}return e}(t),s=n.filter(e=>function(t,e){return e.every(e=>x(t,e)<e.radius+d)}(e,t));let i=0,r=0;const o=[];if(s.length>1){const e=b(s);for(let t=0;t<s.length;++t){const n=s[t];n.angle=Math.atan2(n.x-e.x,n.y-e.y)}s.sort((t,e)=>e.angle-t.angle);let n=s[s.length-1];for(let e=0;e<s.length;++e){const a=s[e];r+=(n.x+a.x)*(a.y-n.y);const l={x:(a.x+n.x)/2,y:(a.y+n.y)/2};let c=null;for(let e=0;e<a.parentIndex.length;++e)if(n.parentIndex.includes(a.parentIndex[e])){const s=t[a.parentIndex[e]],i=Math.atan2(a.x-s.x,a.y-s.y),r=Math.atan2(n.x-s.x,n.y-s.y);let o=r-i;o<0&&(o+=2*Math.PI);const h=r-o/2;let u=x(l,{x:s.x+s.radius*Math.sin(h),y:s.y+s.radius*Math.cos(h)});u>2*s.radius&&(u=2*s.radius),(null==c||c.width>u)&&(c={circle:s,width:u,p1:a,p2:n,large:u>s.radius,sweep:!0})}null!=c&&(o.push(c),i+=g(c.circle.radius,c.width),n=a)}}else{let e=t[0];for(let n=1;n<t.length;++n)t[n].radius<e.radius&&(e=t[n]);let n=!1;for(let s=0;s<t.length;++s)if(x(t[s],e)>Math.abs(e.radius-t[s].radius)){n=!0;break}n?i=r=0:(i=e.radius*e.radius*Math.PI,o.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-d,y:e.y+e.radius},width:2*e.radius,large:!0,sweep:!0}))}return r/=2,e&&(e.area=i+r,e.arcArea=i,e.polygonArea=r,e.arcs=o,e.innerPoints=s,e.intersectionPoints=n),i+r}function g(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function x(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function p(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(n*n-t*t+e*e)/(2*n);return g(t,t-(n*n-e*e+t*t)/(2*n))+g(e,s)}function m(t,e){const n=x(t,e),s=t.radius,i=e.radius;if(n>=s+i||n<=Math.abs(s-i))return[];const r=(s*s-i*i+n*n)/(2*n),o=Math.sqrt(s*s-r*r),a=t.x+r*(e.x-t.x)/n,l=t.y+r*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:a+c,y:l-h},{x:a-c,y:l+h}]}function b(t){const e={x:0,y:0};for(const n of t)e.x+=n.x,e.y+=n.y;return e.x/=t.length,e.y/=t.length,e}function v(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function I(t,e){return v(t).map(()=>v(e))}function M(t,e){let n=0;for(let s=0;s<t.length;++s)n+=t[s]*e[s];return n}function k(t){return Math.sqrt(M(t,t))}function w(t,e,n){for(let s=0;s<e.length;++s)t[s]=e[s]*n}function _(t,e,n,s,i){for(let r=0;r<t.length;++r)t[r]=e*n[r]+s*i[r]}function S(t,e,n){const s=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,r=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,a=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,u=void 0!==n.sigma?n.sigma:.5;let f;const d=e.length,y=new Array(d+1);y[0]=e,y[0].fx=t(e),y[0].id=0;for(let n=0;n<d;++n){const s=e.slice();s[n]=s[n]?s[n]*i:r,y[n+1]=s,y[n+1].fx=t(s),y[n+1].id=n+1}function g(t){for(let e=0;e<t.length;e++)y[d][e]=t[e];y[d].fx=t.fx}const x=(t,e)=>t.fx-e.fx,p=e.slice(),m=e.slice(),b=e.slice(),v=e.slice();for(let e=0;e<s;++e){if(y.sort(x),n.history){const t=y.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:y[0].slice(),fx:y[0].fx,simplex:t})}f=0;for(let t=0;t<d;++t)f=Math.max(f,Math.abs(y[0][t]-y[1][t]));if(Math.abs(y[0].fx-y[d].fx)<o&&f<a)break;for(let t=0;t<d;++t){p[t]=0;for(let e=0;e<d;++e)p[t]+=y[e][t];p[t]/=d}const e=y[d];if(_(m,1+l,p,-l,e),m.fx=t(m),m.fx<y[0].fx)_(v,1+c,p,-c,e),v.fx=t(v),v.fx<m.fx?g(v):g(m);else if(m.fx>=y[d-1].fx){let n=!1;if(m.fx>e.fx?(_(b,1+h,p,-h,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(_(b,1-h*l,p,h*l,e),b.fx=t(b),b.fx<m.fx?g(b):n=!0),n){if(u>=1)break;for(let e=1;e<y.length;++e)_(y[e],1-u,y[0],u,y[e]),y[e].fx=t(y[e])}}else g(m)}return y.sort(x),{fx:y[0].fx,x:y[0]}}function E(t,e,n,s,i,r,o){const a=n.fx,l=M(n.fxprime,e);let c=a,h=a,u=l,f=0;function d(h,f,d){for(let y=0;y<16;++y)if(i=(h+f)/2,_(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=M(s.fxprime,e),c>a+r*i*l||c>=d)f=i;else{if(Math.abs(u)<=-o*l)return i;u*(f-h)>=0&&(f=h),h=i,d=c}return 0}i=i||1,r=r||1e-6,o=o||.1;for(let y=0;y<10;++y){if(_(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=M(s.fxprime,e),c>a+r*i*l||y&&c>=h)return d(f,i,h);if(Math.abs(u)<=-o*l)return i;if(u>=0)return d(i,f,c);h=c,f=i,i*=2}return i}function T(t,e,n){let s={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let o,a,l,c=1;l=(n=n||{}).maxIterations||20*e.length,s.fx=t(s.x,s.fxprime),o=s.fxprime.slice(),w(o,s.fxprime,-1);for(let e=0;e<l;++e){if(c=E(t,o,s,i,c),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),c){_(r,1,i.fxprime,-1,s.fxprime);const t=M(s.fxprime,s.fxprime);_(o,Math.max(0,M(r,i.fxprime)/t),o,-1,i.fxprime),a=s,s=i,i=a}else w(o,s.fxprime,-1);if(k(s.fxprime)<=1e-5)break}return n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),s}function z(t,e={}){e.maxIterations=e.maxIterations||500;const n=e.initialLayout||K,s=e.lossFunction||N,i=function(t,e={}){const n=e.distinct,s=t.map(t=>Object.assign({},t));function i(t){return t.join(";")}if(n){const t=new Map;for(const e of s)for(let n=0;n<e.sets.length;n++){const s=String(e.sets[n]);t.set(s,e.size+(t.get(s)||0));for(let i=n+1;i<e.sets.length;i++){const n=String(e.sets[i]),r=`${s};${n}`,o=`${n};${s}`;t.set(r,e.size+(t.get(r)||0)),t.set(o,e.size+(t.get(o)||0))}}for(const e of s)e.sets.length<3&&(e.size=t.get(i(e.sets)))}const r=[],o=new Set;for(const t of s)if(1===t.sets.length)r.push(t.sets[0]);else if(2===t.sets.length){const e=t.sets[0],n=t.sets[1];o.add(i(t.sets)),o.add(i([n,e]))}r.sort((t,e)=>t===e?0:t<e?-1:1);for(let t=0;t<r.length;++t){const e=r[t];for(let n=t+1;n<r.length;++n){const t=r[n];o.has(i([e,t]))||s.push({sets:[e,t],size:0})}}return s}(t,e),r=n(i,e),o=Object.keys(r),a=[];for(const t of o)a.push(r[t].x),a.push(r[t].y);const l=S(t=>{const e={};for(let n=0;n<o.length;++n){const s=o[n];e[s]={x:t[2*n],y:t[2*n+1],radius:r[s].radius}}return s(e,i)},a,e).x;for(let t=0;t<o.length;++t){const e=o[t];r[e].x=l[2*t],r[e].y=l[2*t+1]}return r}const A=1e-10;function R(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+1e-10?Math.abs(t-e):function(t,e,n,s){const i=(s=s||{}).maxIterations||100,r=s.tolerance||1e-10,o=t(e),a=t(n);let l=n-e;if(o*a>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===a)return n;for(let n=0;n<i;++n){l/=2;const n=e+l,s=t(n);if(s*o>=0&&(e=n),Math.abs(l)<r||0===s)return n}return e+l}(s=>p(t,e,s)-n,0,t+e)}function K(t,e={}){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:N,s={},i={};for(const e of t)if(1===e.sets.length){const t=e.sets[0];s[t]={x:1e10,y:1e10,rowid:s.length,size:e.size,radius:Math.sqrt(e.size/Math.PI)},i[t]=[]}t=t.filter(t=>2===t.sets.length);for(const e of t){let t=null!=e.weight?e.weight:1;const n=e.sets[0],r=e.sets[1];e.size+A>=Math.min(s[n].size,s[r].size)&&(t=0),i[n].push({set:r,size:e.size,weight:t}),i[r].push({set:n,size:e.size,weight:t})}const r=[];function o(t,e){return e.size-t.size}Object.keys(i).forEach(t=>{let e=0;for(let n=0;n<i[t].length;++n)e+=i[t][n].size*i[t][n].weight;r.push({set:t,size:e})}),r.sort(o);const a={};function l(t){return t.set in a}function c(t,e){s[e].x=t.x,s[e].y=t.y,a[e]=!0}c({x:0,y:0},r[0].set);for(let e=1;e<r.length;++e){const a=r[e].set,u=i[a].filter(l),f=s[a];if(u.sort(o),0===u.length)throw"ERROR: missing pairwise overlap information";const d=[];for(var h=0;h<u.length;++h){const t=s[u[h].set],e=R(f.radius,t.radius,u[h].size);d.push({x:t.x+e,y:t.y}),d.push({x:t.x-e,y:t.y}),d.push({y:t.y+e,x:t.x}),d.push({y:t.y-e,x:t.x});for(let n=h+1;n<u.length;++n){const i=s[u[n].set],r=R(f.radius,i.radius,u[n].size),o=m({x:t.x,y:t.y,radius:e},{x:i.x,y:i.y,radius:r});d.push(...o)}}let y=1e50,g=d[0];for(const e of d){s[a].x=e.x,s[a].y=e.y;const i=n(s,t);i<y&&(y=i,g=e)}c(g,a)}return s}(t,e);const s=e.lossFunction||N;if(t.length>=8){const i=function(t,e={}){const n=e.restarts||10,s=[],i={};for(const e of t)1===e.sets.length&&(i[e.sets[0]]=s.length,s.push(e));let{distances:r,constraints:o}=function(t,e,n){const s=I(e.length,e.length),i=I(e.length,e.length);return t.filter(t=>2===t.sets.length).forEach(t=>{const r=n[t.sets[0]],o=n[t.sets[1]],a=R(Math.sqrt(e[r].size/Math.PI),Math.sqrt(e[o].size/Math.PI),t.size);s[r][o]=s[o][r]=a;let l=0;t.size+1e-10>=Math.min(e[r].size,e[o].size)?l=1:t.size<=1e-10&&(l=-1),i[r][o]=i[o][r]=l}),{distances:s,constraints:i}}(t,s,i);const a=k(r.map(k))/r.length;r=r.map(t=>t.map(t=>t/a));const l=(t,e)=>function(t,e,n,s){for(let t=0;t<e.length;++t)e[t]=0;let i=0;for(let r=0;r<n.length;++r){const o=t[2*r],a=t[2*r+1];for(let l=r+1;l<n.length;++l){const c=t[2*l],h=t[2*l+1],u=n[r][l],f=s[r][l],d=(c-o)*(c-o)+(h-a)*(h-a),y=Math.sqrt(d),g=d-u*u;f>0&&y<=u||f<0&&y>=u||(i+=2*g*g,e[2*r]+=4*g*(o-c),e[2*r+1]+=4*g*(a-h),e[2*l]+=4*g*(c-o),e[2*l+1]+=4*g*(h-a))}}return i}(t,e,r,o);let c=null;for(let t=0;t<n;++t){const t=T(l,v(2*r.length).map(Math.random),e);(!c||t.fx<c.fx)&&(c=t)}const h=c.x,u={};for(let t=0;t<s.length;++t){const e=s[t];u[e.sets[0]]={x:h[2*t]*a,y:h[2*t+1]*a,radius:Math.sqrt(e.size/Math.PI)}}if(e.history)for(const t of e.history)w(t.x,a);return u}(t,e);s(i,t)+1e-8<s(n,t)&&(n=i)}return n}function N(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=p(n.radius,i.radius,x(n,i))}else e=y(s.sets.map(e=>t[e]));n+=(null!=s.weight?s.weight:1)*(e-s.size)*(e-s.size)}return n}function D(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=p(n.radius,i.radius,x(n,i))}else e=y(s.sets.map(e=>t[e]));const i=null!=s.weight?s.weight:1,r=Math.log((e+1)/(s.size+1));n+=i*r*r}return n}function O(t,e,n){if(null==n?t.sort((t,e)=>e.radius-t.radius):t.sort(n),t.length>0){const e=t[0].x,n=t[0].y;for(const s of t)s.x-=e,s.y-=n}if(2===t.length){x(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y)}if(t.length>1){const n=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(n),i=Math.sin(n);for(const e of t){const t=e.x,n=e.y;e.x=s*t-i*n,e.y=i*t+s*n}}if(t.length>2){let n=Math.atan2(t[2].x,t[2].y)-e;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(const n of t){var s=(n.x+e*n.y)/(1+e*e);n.x=2*s-n.x,n.y=2*s*e-n.y}}}}function C(t){const e=e=>({max:t.reduce((t,n)=>Math.max(t,n[e]+n.radius),Number.NEGATIVE_INFINITY),min:t.reduce((t,n)=>Math.min(t,n[e]-n.radius),Number.POSITIVE_INFINITY)});return{xRange:e("x"),yRange:e("y")}}function F(t,e,n){null==e&&(e=Math.PI/2);let s=L(t).map(t=>Object.assign({},t));const i=function(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){const s=e(t),i=e(n);s.parent=i}t.forEach(t=>{t.parent=t});for(let e=0;e<t.length;++e)for(let s=e+1;s<t.length;++s){const i=t[e].radius+t[s].radius;x(t[e],t[s])+1e-10<i&&n(t[s],t[e])}const s=new Map;for(let n=0;n<t.length;++n){const i=e(t[n]).parent.setid;s.has(i)||s.set(i,[]),s.get(i).push(t[n])}return t.forEach(t=>{delete t.parent}),Array.from(s.values())}(s);for(const t of i){O(t,e,n);const s=C(t);t.size=(s.xRange.max-s.xRange.min)*(s.yRange.max-s.yRange.min),t.bounds=s}i.sort((t,e)=>e.size-t.size),s=i[0];let r=s.bounds;const o=(r.xRange.max-r.xRange.min)/50;function a(t,e,n){if(!t)return;const i=t.bounds;let a,l;if(e)a=r.xRange.max-i.xRange.min+o;else{a=r.xRange.max-i.xRange.max;const t=(i.xRange.max-i.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;t<0&&(a+=t)}if(n)l=r.yRange.max-i.yRange.min+o;else{l=r.yRange.max-i.yRange.max;const t=(i.yRange.max-i.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;t<0&&(l+=t)}for(const e of t)e.x+=a,e.y+=l,s.push(e)}let l=1;for(;l<i.length;)a(i[l],!0,!1),a(i[l+1],!1,!0),a(i[l+2],!0,!0),l+=3,r=C(s);return j(s)}function $(t,e,n,s,i){const r=L(t);e-=2*s,n-=2*s;const{xRange:o,yRange:a}=C(r);if(o.max===o.min||a.max===a.min)return console.log("not scaling solution: zero size detected"),t;let l,c;if(i){const t=2*Math.sqrt(i/Math.PI);l=e/t,c=n/t}else l=e/(o.max-o.min),c=n/(a.max-a.min);const h=Math.min(c,l),u=(e-(o.max-o.min)*h)/2,f=(n-(a.max-a.min)*h)/2;return j(r.map(t=>({radius:h*t.radius,x:s+u+(t.x-o.min)*h,y:s+f+(t.y-a.min)*h,setid:t.setid})))}function j(t){const e={};for(const n of t)e[n.setid]=n;return e}function L(t){return Object.keys(t).map(e=>Object.assign(t[e],{setid:e}))}function P(t={}){let e=!1,n=600,s=350,i=15,r=1e3,o=Math.PI/2,a=!0,l=null,c=!0,h=!0,u=null,f=null,d=!1,y=null,g=!(!t||!t.symmetricalTextCentre)&&t.symmetricalTextCentre,x={},p=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],m=0,b=function(t){if(t in x)return x[t];var e=x[t]=p[m];return m+=1,m>=p.length&&(m=0),e},v=z,I=N;function M(x){let p=x.datum();const m=new Set;p.forEach(t=>{0==t.size&&1==t.sets.length&&m.add(t.sets[0])}),p=p.filter(t=>!t.sets.some(t=>m.has(t)));let M={},k={};if(p.length>0){let t=v(p,{lossFunction:I,distinct:d});a&&(t=F(t,o,f)),M=$(t,n,s,i,l),k=V(M,p,g)}const w={};function _(t){return t.sets in w?w[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}p.forEach(t=>{t.label&&(w[t.sets]=t.label)}),x.selectAll("svg").data([M]).enter().append("svg");const S=x.select("svg");e?S.attr("viewBox",`0 0 ${n} ${s}`):S.attr("width",n).attr("height",s);const E={};let T=!1;function z(t){return e=>Y(t.sets.map(t=>{let i=E[t],r=M[t];return i||(i={x:n/2,y:s/2,radius:1}),r||(r={x:n/2,y:s/2,radius:1}),{x:i.x*(1-e)+r.x*e,y:i.y*(1-e)+r.y*e,radius:i.radius*(1-e)+r.radius*e}}),y)}S.selectAll(".venn-area path").each(function(t){const e=this.getAttribute("d");1==t.sets.length&&e&&!d&&(T=!0,E[t.sets[0]]=function(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}(e))});const A=S.selectAll(".venn-area").data(p,t=>t.sets),R=A.enter().append("g").attr("class",t=>`venn-area venn-${1==t.sets.length?"circle":"intersection"}${t.colour||t.color?" venn-coloured":""}`).attr("data-venn-sets",t=>t.sets.join("_")),K=R.append("path"),N=R.append("text").attr("class","label").text(t=>_(t)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",s/2);function D(t){return"function"==typeof t.transition?t.transition("venn").duration(r):t}h&&(K.style("fill-opacity","0").filter(t=>1==t.sets.length).style("fill",t=>t.colour?t.colour:t.color?t.color:b(t.sets)).style("fill-opacity",".25"),N.style("fill",e=>e.colour||e.color?"#FFF":t.textFill?t.textFill:1==e.sets.length?b(e.sets):"#444"));let O=x;T&&"function"==typeof O.transition?(O=D(x),O.selectAll("path").attrTween("d",z)):O.selectAll("path").attr("d",t=>Y(t.sets.map(t=>M[t])),y);const C=O.selectAll("text").filter(t=>t.sets in k).text(t=>_(t)).attr("x",t=>Math.floor(k[t.sets].x)).attr("y",t=>Math.floor(k[t.sets].y));c&&(T?"on"in C?C.on("end",U(M,_)):C.each("end",U(M,_)):C.each(U(M,_)));const j=D(A.exit()).remove();"function"==typeof A.transition&&j.selectAll("path").attrTween("d",z);const L=j.selectAll("text").attr("x",n/2).attr("y",s/2);return null!==u&&(N.style("font-size","0px"),C.style("font-size",u),L.style("font-size","0px")),{circles:M,textCentres:k,nodes:A,enter:R,update:O,exit:j}}return M.wrap=function(t){return arguments.length?(c=t,M):c},M.useViewBox=function(){return e=!0,M},M.width=function(t){return arguments.length?(n=t,M):n},M.height=function(t){return arguments.length?(s=t,M):s},M.padding=function(t){return arguments.length?(i=t,M):i},M.distinct=function(t){return arguments.length?(d=t,M):d},M.colours=function(t){return arguments.length?(b=t,M):b},M.colors=function(t){return arguments.length?(b=t,M):b},M.fontSize=function(t){return arguments.length?(u=t,M):u},M.round=function(t){return arguments.length?(y=t,M):y},M.duration=function(t){return arguments.length?(r=t,M):r},M.layoutFunction=function(t){return arguments.length?(v=t,M):v},M.normalize=function(t){return arguments.length?(a=t,M):a},M.scaleToFit=function(t){return arguments.length?(l=t,M):l},M.styled=function(t){return arguments.length?(h=t,M):h},M.orientation=function(t){return arguments.length?(o=t,M):o},M.orientationOrder=function(t){return arguments.length?(f=t,M):f},M.lossFunction=function(t){return arguments.length?(I="default"===t?N:"logRatio"===t?D:t,M):I},M}function U(t,e){return function(n){const s=this,i=t[n.sets[0]].radius||50,r=e(n)||"",o=r.split(/\s+/).reverse(),a=(r.length+o.length)/3;let l=o.pop(),c=[l],h=0;s.textContent=null;const u=[];function f(t){const e=s.ownerDocument.createElementNS(s.namespaceURI,"tspan");return e.textContent=t,u.push(e),s.append(e),e}let d=f(l);for(;l=o.pop(),l;){c.push(l);const t=c.join(" ");d.textContent=t,t.length>a&&d.getComputedTextLength()>i&&(c.pop(),d.textContent=c.join(" "),c=[l],d=f(l),h++)}const y=.35-1.1*h/2,g=s.getAttribute("x"),x=s.getAttribute("y");u.forEach((t,e)=>{t.setAttribute("x",g),t.setAttribute("y",x),t.setAttribute("dy",`${y+1.1*e}em`)})}}function q(t,e,n){let s=e[0].radius-x(e[0],t);for(let n=1;n<e.length;++n){const i=e[n].radius-x(e[n],t);i<=s&&(s=i)}for(let e=0;e<n.length;++e){const i=x(n[e],t)-n[e].radius;i<=s&&(s=i)}return s}function B(t,e,n){const s=[];for(const e of t)s.push({x:e.x,y:e.y}),s.push({x:e.x+e.radius/2,y:e.y}),s.push({x:e.x-e.radius/2,y:e.y}),s.push({x:e.x,y:e.y+e.radius/2}),s.push({x:e.x,y:e.y-e.radius/2});let i=s[0],r=q(s[0],t,e);for(let n=1;n<s.length;++n){const o=q(s[n],t,e);o>=r&&(i=s[n],r=o)}const o=S(n=>-1*q({x:n[0],y:n[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,a={x:n?0:o[0],y:o[1]};let l=!0;for(const e of t)if(x(a,e)>e.radius){l=!1;break}for(const t of e)if(x(a,t)<t.radius){l=!1;break}if(l)return a;if(1==t.length)return{x:t[0].x,y:t[0].y};const c={};return y(t,c),0===c.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==c.arcs.length?{x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?B(t,[]):b(c.arcs.map(t=>t.p1))}function G(t){const e={},n=Object.keys(t);for(const t of n)e[t]=[];for(let s=0;s<n.length;s++){const i=n[s],r=t[i];for(let o=s+1;o<n.length;++o){const s=n[o],a=t[s],l=x(r,a);l+a.radius<=r.radius+1e-10?e[s].push(i):l+r.radius<=a.radius+1e-10&&e[i].push(s)}}return e}function V(t,e,n){const s={},i=G(t);for(let r=0;r<e.length;++r){const o=e[r].sets,a={},l={};for(let t=0;t<o.length;++t){a[o[t]]=!0;const e=i[o[t]];for(let t=0;t<e.length;++t)l[e[t]]=!0}const c=[],h=[];for(let e in t)e in a?c.push(t[e]):e in l||h.push(t[e]);const u=B(c,h,n);s[o]=u,u.disjoint&&e[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return s}function W(t){if(0===t.length)return[];const e={};return y(t,e),e.arcs}function X(t,e){if(0===t.length)return"M 0 0";const n=Math.pow(10,e||0),s=null!=e?t=>Math.round(t*n)/n:t=>t;if(1==t.length){const e=t[0].circle;return function(t,e,n){const s=[];return s.push("\nM",t,e),s.push("\nm",-n,0),s.push("\na",n,n,0,1,0,2*n,0),s.push("\na",n,n,0,1,0,2*-n,0),s.join(" ")}(s(e.x),s(e.y),s(e.radius))}const i=["\nM",s(t[0].p2.x),s(t[0].p2.y)];for(const e of t){const t=s(e.circle.radius);i.push("\nA",t,t,0,e.large?1:0,e.sweep?1:0,s(e.p1.x),s(e.p1.y))}return i.join(" ")}function Y(t,e){return X(W(t),e)}var Z=n(61057),H=function(){var t=(0,o.K)(function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},"o"),e=[5,8],n=[7,8,11,12,17,19,22,24],s=[1,17],i=[1,18],r=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],l=[1,39],c=[7,8,11,12,17,19,22,24,27],h=[1,57],u=[1,56],f=[1,58],d=[1,59],y=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],x={trace:(0,o.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:(0,o.K)(function(t,e,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return r[a-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:r[a-1].push(r[a]),this.$=r[a-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=r[a];break;case 8:s.setDiagramTitle(r[a].substr(6)),this.$=r[a].substr(6);break;case 9:s.addSubsetData([r[a]],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 10:s.addSubsetData([r[a-1]],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 11:s.addSubsetData([r[a-2]],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 12:s.addSubsetData([r[a-3]],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 13:if(r[a].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a]),s.addSubsetData(r[a],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 14:if(r[a-1].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-1]),s.addSubsetData(r[a-1],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 15:if(r[a-2].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-2]),s.addSubsetData(r[a-2],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 16:if(r[a-3].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-3]),s.addSubsetData(r[a-3],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 17:case 18:case 19:s.addTextData(r[a-1],r[a],void 0);break;case 20:case 21:s.addTextData(r[a-2],r[a-1],r[a]);break;case 23:s.addStyleData(r[a-1],r[a]);break;case 24:case 25:case 26:if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a],void 0);break;case 27:case 28:var l;if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a-1],r[a]);break;case 29:case 41:case 34:this.$=[r[a]];break;case 30:case 42:this.$=[...r[a-2],r[a]];break;case 31:this.$=[r[a-2],r[a]];break;case 33:this.$=r[a].join(" ")}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(n,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(n,[2,5]),t(n,[2,6]),t(n,[2,7]),t(n,[2,8]),{13:16,20:s,21:i},{13:20,18:19,20:s,21:i},{13:20,18:21,20:s,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:s,21:i},t(n,[2,9],{14:[1,27],15:[1,28]}),t(r,[2,43]),t(r,[2,44]),t(n,[2,13],{14:[1,29],15:[1,30],27:a}),t(r,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(n,[2,22]),t(n,[2,24],{14:[1,35]}),t(n,[2,25],{14:[1,36]}),t(n,[2,26]),{20:l,25:37,26:38,27:a},t(n,[2,10],{15:[1,40]}),{16:[1,41]},t(n,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:s,21:i},t(n,[2,17],{14:[1,45]}),t(n,[2,18],{14:[1,46]}),t(n,[2,19]),t(n,[2,27]),t(n,[2,28]),t(n,[2,23],{27:[1,47]}),t(c,[2,29]),{15:[1,48]},{16:[1,49]},t(n,[2,11]),{16:[1,50]},t(n,[2,15]),t(r,[2,42]),t(n,[2,20]),t(n,[2,21]),{20:l,26:51},{16:h,20:u,21:[1,53],28:52,29:54,30:55,31:f,32:d,33:y},t(n,[2,12]),t(n,[2,16]),t(c,[2,30]),t(c,[2,31]),t(c,[2,32]),t(c,[2,33],{30:61,16:h,20:u,31:f,32:d,33:y}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:(0,o.K)(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:(0,o.K)(function(t){var e=this,n=[0],s=[],i=[null],r=[],a=this.table,l="",c=0,h=0,u=0,f=r.slice.call(arguments,1),d=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);d.setInput(t,y.yy),y.yy.lexer=d,y.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var x=d.yylloc;r.push(x);var p=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,o.K)(function(t){n.length=n.length-2*t,i.length=i.length-t,r.length=r.length-t},"popStack"),(0,o.K)(m,"lex");for(var b,v,I,M,k,w,_,S,E,T={};;){if(I=n[n.length-1],this.defaultActions[I]?M=this.defaultActions[I]:(null==b&&(b=m()),M=a[I]&&a[I][b]),void 0===M||!M.length||!M[0]){var z="";for(w in E=[],a[I])this.terminals_[w]&&w>2&&E.push("'"+this.terminals_[w]+"'");z=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(z,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:x,expected:E})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+b);switch(M[0]){case 1:n.push(b),i.push(d.yytext),r.push(d.yylloc),n.push(M[1]),b=null,v?(b=v,v=null):(h=d.yyleng,l=d.yytext,c=d.yylineno,x=d.yylloc,u>0&&u--);break;case 2:if(_=this.productions_[M[1]][1],T.$=i[i.length-_],T._$={first_line:r[r.length-(_||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(_||1)].first_column,last_column:r[r.length-1].last_column},p&&(T._$.range=[r[r.length-(_||1)].range[0],r[r.length-1].range[1]]),void 0!==(k=this.performAction.apply(T,[l,h,c,y.yy,M[1],i,r].concat(f))))return k;_&&(n=n.slice(0,-1*_*2),i=i.slice(0,-1*_),r=r.slice(0,-1*_)),n.push(this.productions_[M[1]][0]),i.push(T.$),r.push(T._$),S=a[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},p=function(){return{EOF:1,parseError:(0,o.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,o.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,o.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,o.K)(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,o.K)(function(){return this._more=!0,this},"more"),reject:(0,o.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,o.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,o.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,o.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,o.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,o.K)(function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:(0,o.K)(function(){if(this.done)return this.EOF;var t,e,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((n=this._input.match(this.rules[i[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,o.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,o.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,o.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,o.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,o.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,o.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,o.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,o.K)(function(t,e,n,s){switch(n){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(t.getIndentMode&&t.getIndentMode())return t.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:t.setIndentMode&&t.setIndentMode(!1),this.begin("INITIAL"),this.unput(e.yytext);break;case 6:return this.begin("bol"),8;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(!t.consumeIndentText)return 19;t.consumeIndentText=!1;break;case 15:return 24;case 16:return e.yytext=e.yytext.slice(2,-2),14;case 17:return e.yytext=e.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}}();function m(){this.yy={}}return x.lexer=p,(0,o.K)(m,"Parser"),m.prototype=x,x.Parser=m,new m}();H.parser=H;var J,Q=H,tt=[],et=[],nt=[],st=new Set,it=!1,rt=(0,o.K)((t,e,n)=>{const s=ft(t).sort(),i=n??10/Math.pow(t.length,2);J=s,1===s.length&&st.add(s[0]),tt.push({sets:s,size:i,label:e?at(e):void 0})},"addSubsetData"),ot=(0,o.K)(()=>tt,"getSubsetData"),at=(0,o.K)(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),lt=(0,o.K)(t=>t?at(t):t,"normalizeStyleValue"),ct=(0,o.K)((t,e,n)=>{const s=at(e);et.push({sets:ft(t).sort(),id:s,label:n?at(n):void 0})},"addTextData"),ht=(0,o.K)((t,e)=>{const n=ft(t).sort(),s={};for(const[t,n]of e)s[t]=lt(n)??n;nt.push({targets:n,styles:s})},"addStyleData"),ut=(0,o.K)(()=>nt,"getStyleData"),ft=(0,o.K)(t=>t.map(t=>at(t)),"normalizeIdentifierList"),dt=(0,o.K)(t=>{const e=ft(t).filter(t=>!st.has(t));if(e.length>0)throw new Error(`unknown set identifier: ${e.join(", ")}`)},"validateUnionIdentifiers"),yt=(0,o.K)(()=>et,"getTextData"),gt=(0,o.K)(()=>J,"getCurrentSets"),xt=(0,o.K)(()=>it,"getIndentMode"),pt=(0,o.K)(t=>{it=t},"setIndentMode"),mt=r.UI.venn;function bt(){return(0,i.$t)(mt,(0,r.zj)().venn)}(0,o.K)(bt,"getConfig");var vt={getConfig:bt,clear:(0,o.K)(()=>{(0,r.IU)(),tt.length=0,et.length=0,nt.length=0,st.clear(),J=void 0,it=!1},"customClear"),setAccTitle:r.SV,getAccTitle:r.iN,setDiagramTitle:r.ke,getDiagramTitle:r.ab,getAccDescription:r.m7,setAccDescription:r.EI,addSubsetData:rt,getSubsetData:ot,addTextData:ct,addStyleData:ht,validateUnionIdentifiers:dt,getTextData:yt,getStyleData:ut,getCurrentSets:gt,getIndentMode:xt,setIndentMode:pt},It=(0,o.K)(t=>`\n .venn-title {\n font-size: 32px;\n fill: ${t.vennTitleTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-circle text {\n font-size: 48px;\n font-family: ${t.fontFamily};\n }\n\n .venn-intersection text {\n font-size: 48px;\n fill: ${t.vennSetTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-text-node {\n font-family: ${t.fontFamily};\n color: ${t.vennSetTextColor};\n }\n`,"getStyles");function Mt(t){const e=new Map;for(const n of t){const t=n.targets.join("|"),s=e.get(t);s?Object.assign(s,n.styles):e.set(t,{...n.styles})}return e}(0,o.K)(Mt,"buildStyleByKey");var kt=(0,o.K)((t,e,n,i)=>{const o=i.db,c=o.getConfig?.(),{themeVariables:d,look:y,handDrawnSeed:g}=(0,r.zj)(),x="handDrawn"===y,p=[d.venn1,d.venn2,d.venn3,d.venn4,d.venn5,d.venn6,d.venn7,d.venn8].filter(Boolean),m=o.getDiagramTitle?.(),b=o.getSubsetData(),v=o.getTextData(),I=Mt(o.getStyleData()),M=St(b),k=c?.width??800,w=c?.height??450,_=k/1600,S=m?48*_:0,E=d.primaryTextColor??d.textColor,T=(0,s.D)(e);T.attr("viewBox",`0 0 ${k} ${w}`),m&&T.append("text").text(m).attr("class","venn-title").attr("font-size",32*_+"px").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*_).style("fill",d.vennTitleTextColor||d.titleColor);const A=(0,a.Ltv)(document.createElement("div")),R=P().width(k).height(w-S);A.datum(M).call(R);const K=x?Z.A.svg(A.select("svg").node()):void 0,O=function(t,e={}){const{lossFunction:n,layoutFunction:s=z,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:a=600,height:l=350,padding:c=15,scaleToFit:h=!1,symmetricalTextCentre:u=!1,distinct:f,round:d=2}=e;let y=s(t,{lossFunction:"default"!==n&&n?"logRatio"===n?D:n:N,distinct:f});i&&(y=F(y,r,o));const g=$(y,a,l,c,h),x=V(g,t,u),p=new Map(Object.keys(g).map(t=>[t,{set:t,x:g[t].x,y:g[t].y,radius:g[t].radius}])),m=t.map(t=>{const e=t.sets.map(t=>p.get(t)),n=W(e);return{circles:e,arcs:n,path:X(n,d),area:t,has:new Set(t.sets)}});function b(t){let e="";for(const n of m)n.has.size>t.length&&t.every(t=>n.has.has(t))&&(e+=" "+n.path);return e}return m.map(({circles:t,arcs:e,path:n,area:s})=>({data:s,text:x[s.sets],circles:t,arcs:e,path:n,distinctPath:n+b(s.sets)}))}(M,{width:k,height:w-S,padding:c?.padding??15}),C=new Map;for(const t of O){const e=wt([...t.data.sets].sort());C.set(e,t)}v.length>0&&_t(c,C,A,v,_,I);const j=(0,l.A)(d.background||"#f4f4f4");A.selectAll(".venn-circle").each(function(t,e){const n=(0,a.Ltv)(this),s=wt([...t.sets].sort()),i=I.get(s),r=i?.fill||p[e%p.length]||d.primaryColor;n.classed("venn-set-"+e%8,!0);const o=i?.["fill-opacity"]??.1,l=i?.stroke||r,c=i?.["stroke-width"]||""+5*_;if(x&&K){const t=C.get(s);if(t&&t.circles.length>0){const s=t.circles[0],i=K.circle(s.x,s.y,2*s.radius,{roughness:.7,seed:g,fill:h(r,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:60*e-41,stroke:l,strokeWidth:parseFloat(String(c))});n.select("path").remove(),n.node()?.insertBefore(i,n.select("text").node())}}else n.select("path").style("fill",r).style("fill-opacity",o).style("stroke",l).style("stroke-width",c).style("stroke-opacity",.95);const y=i?.color||(j?(0,u.A)(r,30):(0,f.A)(r,30));n.select("text").style("font-size",48*_+"px").style("fill",y)}),x&&K?A.selectAll(".venn-intersection").each(function(t){const e=(0,a.Ltv)(this),n=wt([...t.sets].sort()),s=I.get(n),i=s?.fill;if(i){const t=e.select("path"),n=t.attr("d");if(n){const e=K.path(n,{roughness:.7,seed:g,fill:h(i,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),s=t.node();s?.parentNode?.insertBefore(e,s),t.remove()}}else e.select("path").style("fill-opacity",0);e.select("text").style("font-size",48*_+"px").style("fill",s?.color??d.vennSetTextColor??E)}):(A.selectAll(".venn-intersection text").style("font-size",48*_+"px").style("fill",t=>{const e=wt([...t.sets].sort());return I.get(e)?.color??d.vennSetTextColor??E}),A.selectAll(".venn-intersection path").style("fill-opacity",t=>{const e=wt([...t.sets].sort());return I.get(e)?.fill?1:0}).style("fill",t=>{const e=wt([...t.sets].sort());return I.get(e)?.fill??"transparent"}));const L=T.append("g").attr("transform",`translate(0, ${S})`),U=A.select("svg").node();if(U&&"childNodes"in U)for(const t of[...U.childNodes])L.node()?.appendChild(t);(0,r.a$)(T,w,k,c?.useMaxWidth??!0)},"draw");function wt(t){return t.join("|")}function _t(t,e,n,s,i,r){const o=t?.useDebugLayout??!1,a=n.select("svg").append("g").attr("class","venn-text-nodes"),l=new Map;for(const t of s){const e=wt(t.sets),n=l.get(e);n?n.push(t):l.set(e,[t])}for(const[t,n]of l.entries()){const s=e.get(t);if(!s?.text)continue;const l=s.text.x,c=s.text.y,h=Math.min(...s.circles.map(t=>t.radius)),u=Math.min(...s.circles.map(t=>t.radius-Math.hypot(l-t.x,c-t.y)));let f=Number.isFinite(u)?Math.max(0,u):0;0===f&&Number.isFinite(h)&&(f=.6*h);const d=a.append("g").attr("class","venn-text-area").attr("font-size",40*i+"px");o&&d.append("circle").attr("class","venn-text-debug-circle").attr("cx",l).attr("cy",c).attr("r",f).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const y=Math.max(80*i,2*f*.95),g=Math.max(60*i,2*f*.95),x=(s.data.label&&s.data.label.length>0?Math.min(32*i,.25*f):0)+(n.length<=2?30*i:0),p=l-y/2,m=c-g/2+x,b=Math.max(1,Math.ceil(Math.sqrt(n.length))),v=y/b,I=g/Math.max(1,Math.ceil(n.length/b));for(const[t,e]of n.entries()){const n=t%b,s=Math.floor(t/b),a=p+v*(n+.5),l=m+I*(s+.5);o&&d.append("rect").attr("class","venn-text-debug-cell").attr("x",p+v*n).attr("y",m+I*s).attr("width",v).attr("height",I).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const c=.9*v,h=.9*I,u=d.append("foreignObject").attr("class","venn-text-node-fo").attr("width",c).attr("height",h).attr("x",a-c/2).attr("y",l-h/2).attr("overflow","visible"),f=r.get(e.id)?.color,y=u.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(e.label??e.id);f&&y.style("color",f)}}}function St(t){const e=new Set(t.map(t=>[...t.sets].sort().join("|"))),n=new Map(t.filter(t=>1===t.sets.length&&void 0!==t.size).map(t=>[t.sets[0],t.size])),s=[];for(const i of t){if(i.sets.length<3)continue;const t=[...i.sets].sort();for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++){const o=[t[i],t[r]],a=o.join("|");if(!e.has(a)){e.add(a);const t=n.get(o[0]),i=n.get(o[1]),r=void 0!==t&&void 0!==i?Math.min(t,i)/4:2.5;s.push({sets:o,size:r,label:""})}}}return s.length>0?[...t,...s]:t}(0,o.K)(wt,"stableSetsKey"),(0,o.K)(_t,"renderTextNodes"),(0,o.K)(St,"ensurePairwiseSubsets");var Et={parser:Q,db:vt,renderer:{draw:kt},styles:It}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[1772],{61772(t,e,n){n.d(e,{diagram:()=>Et});var s=n(22422),i=n(99087),r=n(32178),o=(n(31293),n(86827)),a=n(51444),l=n(5097),c=n(95635);const h=(t,e)=>(0,c.A)(t,"a",-e);var u=n(78041),f=n(75263);const d=1e-10;function y(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let s=n+1;s<t.length;++s){const i=m(t[n],t[s]);for(const t of i)t.parentIndex=[n,s],e.push(t)}return e}(t),s=n.filter(e=>function(t,e){return e.every(e=>x(t,e)<e.radius+d)}(e,t));let i=0,r=0;const o=[];if(s.length>1){const e=b(s);for(let t=0;t<s.length;++t){const n=s[t];n.angle=Math.atan2(n.x-e.x,n.y-e.y)}s.sort((t,e)=>e.angle-t.angle);let n=s[s.length-1];for(let e=0;e<s.length;++e){const a=s[e];r+=(n.x+a.x)*(a.y-n.y);const l={x:(a.x+n.x)/2,y:(a.y+n.y)/2};let c=null;for(let e=0;e<a.parentIndex.length;++e)if(n.parentIndex.includes(a.parentIndex[e])){const s=t[a.parentIndex[e]],i=Math.atan2(a.x-s.x,a.y-s.y),r=Math.atan2(n.x-s.x,n.y-s.y);let o=r-i;o<0&&(o+=2*Math.PI);const h=r-o/2;let u=x(l,{x:s.x+s.radius*Math.sin(h),y:s.y+s.radius*Math.cos(h)});u>2*s.radius&&(u=2*s.radius),(null==c||c.width>u)&&(c={circle:s,width:u,p1:a,p2:n,large:u>s.radius,sweep:!0})}null!=c&&(o.push(c),i+=g(c.circle.radius,c.width),n=a)}}else{let e=t[0];for(let n=1;n<t.length;++n)t[n].radius<e.radius&&(e=t[n]);let n=!1;for(let s=0;s<t.length;++s)if(x(t[s],e)>Math.abs(e.radius-t[s].radius)){n=!0;break}n?i=r=0:(i=e.radius*e.radius*Math.PI,o.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-d,y:e.y+e.radius},width:2*e.radius,large:!0,sweep:!0}))}return r/=2,e&&(e.area=i+r,e.arcArea=i,e.polygonArea=r,e.arcs=o,e.innerPoints=s,e.intersectionPoints=n),i+r}function g(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function x(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function p(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(n*n-t*t+e*e)/(2*n);return g(t,t-(n*n-e*e+t*t)/(2*n))+g(e,s)}function m(t,e){const n=x(t,e),s=t.radius,i=e.radius;if(n>=s+i||n<=Math.abs(s-i))return[];const r=(s*s-i*i+n*n)/(2*n),o=Math.sqrt(s*s-r*r),a=t.x+r*(e.x-t.x)/n,l=t.y+r*(e.y-t.y)/n,c=-(e.y-t.y)*(o/n),h=-(e.x-t.x)*(o/n);return[{x:a+c,y:l-h},{x:a-c,y:l+h}]}function b(t){const e={x:0,y:0};for(const n of t)e.x+=n.x,e.y+=n.y;return e.x/=t.length,e.y/=t.length,e}function v(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function I(t,e){return v(t).map(()=>v(e))}function M(t,e){let n=0;for(let s=0;s<t.length;++s)n+=t[s]*e[s];return n}function k(t){return Math.sqrt(M(t,t))}function w(t,e,n){for(let s=0;s<e.length;++s)t[s]=e[s]*n}function _(t,e,n,s,i){for(let r=0;r<t.length;++r)t[r]=e*n[r]+s*i[r]}function S(t,e,n){const s=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,r=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,a=n.minErrorDelta||1e-5,l=void 0!==n.rho?n.rho:1,c=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,u=void 0!==n.sigma?n.sigma:.5;let f;const d=e.length,y=new Array(d+1);y[0]=e,y[0].fx=t(e),y[0].id=0;for(let n=0;n<d;++n){const s=e.slice();s[n]=s[n]?s[n]*i:r,y[n+1]=s,y[n+1].fx=t(s),y[n+1].id=n+1}function g(t){for(let e=0;e<t.length;e++)y[d][e]=t[e];y[d].fx=t.fx}const x=(t,e)=>t.fx-e.fx,p=e.slice(),m=e.slice(),b=e.slice(),v=e.slice();for(let e=0;e<s;++e){if(y.sort(x),n.history){const t=y.map(t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e});t.sort((t,e)=>t.id-e.id),n.history.push({x:y[0].slice(),fx:y[0].fx,simplex:t})}f=0;for(let t=0;t<d;++t)f=Math.max(f,Math.abs(y[0][t]-y[1][t]));if(Math.abs(y[0].fx-y[d].fx)<o&&f<a)break;for(let t=0;t<d;++t){p[t]=0;for(let e=0;e<d;++e)p[t]+=y[e][t];p[t]/=d}const e=y[d];if(_(m,1+l,p,-l,e),m.fx=t(m),m.fx<y[0].fx)_(v,1+c,p,-c,e),v.fx=t(v),v.fx<m.fx?g(v):g(m);else if(m.fx>=y[d-1].fx){let n=!1;if(m.fx>e.fx?(_(b,1+h,p,-h,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(_(b,1-h*l,p,h*l,e),b.fx=t(b),b.fx<m.fx?g(b):n=!0),n){if(u>=1)break;for(let e=1;e<y.length;++e)_(y[e],1-u,y[0],u,y[e]),y[e].fx=t(y[e])}}else g(m)}return y.sort(x),{fx:y[0].fx,x:y[0]}}function E(t,e,n,s,i,r,o){const a=n.fx,l=M(n.fxprime,e);let c=a,h=a,u=l,f=0;function d(h,f,d){for(let y=0;y<16;++y)if(i=(h+f)/2,_(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=M(s.fxprime,e),c>a+r*i*l||c>=d)f=i;else{if(Math.abs(u)<=-o*l)return i;u*(f-h)>=0&&(f=h),h=i,d=c}return 0}i=i||1,r=r||1e-6,o=o||.1;for(let y=0;y<10;++y){if(_(s.x,1,n.x,i,e),c=s.fx=t(s.x,s.fxprime),u=M(s.fxprime,e),c>a+r*i*l||y&&c>=h)return d(f,i,h);if(Math.abs(u)<=-o*l)return i;if(u>=0)return d(i,f,c);h=c,f=i,i*=2}return i}function T(t,e,n){let s={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let o,a,l,c=1;l=(n=n||{}).maxIterations||20*e.length,s.fx=t(s.x,s.fxprime),o=s.fxprime.slice(),w(o,s.fxprime,-1);for(let e=0;e<l;++e){if(c=E(t,o,s,i,c),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),c){_(r,1,i.fxprime,-1,s.fxprime);const t=M(s.fxprime,s.fxprime);_(o,Math.max(0,M(r,i.fxprime)/t),o,-1,i.fxprime),a=s,s=i,i=a}else w(o,s.fxprime,-1);if(k(s.fxprime)<=1e-5)break}return n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),alpha:c}),s}function z(t,e={}){e.maxIterations=e.maxIterations||500;const n=e.initialLayout||K,s=e.lossFunction||N,i=function(t,e={}){const n=e.distinct,s=t.map(t=>Object.assign({},t));function i(t){return t.join(";")}if(n){const t=new Map;for(const e of s)for(let n=0;n<e.sets.length;n++){const s=String(e.sets[n]);t.set(s,e.size+(t.get(s)||0));for(let i=n+1;i<e.sets.length;i++){const n=String(e.sets[i]),r=`${s};${n}`,o=`${n};${s}`;t.set(r,e.size+(t.get(r)||0)),t.set(o,e.size+(t.get(o)||0))}}for(const e of s)e.sets.length<3&&(e.size=t.get(i(e.sets)))}const r=[],o=new Set;for(const t of s)if(1===t.sets.length)r.push(t.sets[0]);else if(2===t.sets.length){const e=t.sets[0],n=t.sets[1];o.add(i(t.sets)),o.add(i([n,e]))}r.sort((t,e)=>t===e?0:t<e?-1:1);for(let t=0;t<r.length;++t){const e=r[t];for(let n=t+1;n<r.length;++n){const t=r[n];o.has(i([e,t]))||s.push({sets:[e,t],size:0})}}return s}(t,e),r=n(i,e),o=Object.keys(r),a=[];for(const t of o)a.push(r[t].x),a.push(r[t].y);const l=S(t=>{const e={};for(let n=0;n<o.length;++n){const s=o[n];e[s]={x:t[2*n],y:t[2*n+1],radius:r[s].radius}}return s(e,i)},a,e).x;for(let t=0;t<o.length;++t){const e=o[t];r[e].x=l[2*t],r[e].y=l[2*t+1]}return r}const A=1e-10;function R(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+1e-10?Math.abs(t-e):function(t,e,n,s){const i=(s=s||{}).maxIterations||100,r=s.tolerance||1e-10,o=t(e),a=t(n);let l=n-e;if(o*a>0)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===a)return n;for(let n=0;n<i;++n){l/=2;const n=e+l,s=t(n);if(s*o>=0&&(e=n),Math.abs(l)<r||0===s)return n}return e+l}(s=>p(t,e,s)-n,0,t+e)}function K(t,e={}){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:N,s={},i={};for(const e of t)if(1===e.sets.length){const t=e.sets[0];s[t]={x:1e10,y:1e10,rowid:s.length,size:e.size,radius:Math.sqrt(e.size/Math.PI)},i[t]=[]}t=t.filter(t=>2===t.sets.length);for(const e of t){let t=null!=e.weight?e.weight:1;const n=e.sets[0],r=e.sets[1];e.size+A>=Math.min(s[n].size,s[r].size)&&(t=0),i[n].push({set:r,size:e.size,weight:t}),i[r].push({set:n,size:e.size,weight:t})}const r=[];function o(t,e){return e.size-t.size}Object.keys(i).forEach(t=>{let e=0;for(let n=0;n<i[t].length;++n)e+=i[t][n].size*i[t][n].weight;r.push({set:t,size:e})}),r.sort(o);const a={};function l(t){return t.set in a}function c(t,e){s[e].x=t.x,s[e].y=t.y,a[e]=!0}c({x:0,y:0},r[0].set);for(let e=1;e<r.length;++e){const a=r[e].set,u=i[a].filter(l),f=s[a];if(u.sort(o),0===u.length)throw"ERROR: missing pairwise overlap information";const d=[];for(var h=0;h<u.length;++h){const t=s[u[h].set],e=R(f.radius,t.radius,u[h].size);d.push({x:t.x+e,y:t.y}),d.push({x:t.x-e,y:t.y}),d.push({y:t.y+e,x:t.x}),d.push({y:t.y-e,x:t.x});for(let n=h+1;n<u.length;++n){const i=s[u[n].set],r=R(f.radius,i.radius,u[n].size),o=m({x:t.x,y:t.y,radius:e},{x:i.x,y:i.y,radius:r});d.push(...o)}}let y=1e50,g=d[0];for(const e of d){s[a].x=e.x,s[a].y=e.y;const i=n(s,t);i<y&&(y=i,g=e)}c(g,a)}return s}(t,e);const s=e.lossFunction||N;if(t.length>=8){const i=function(t,e={}){const n=e.restarts||10,s=[],i={};for(const e of t)1===e.sets.length&&(i[e.sets[0]]=s.length,s.push(e));let{distances:r,constraints:o}=function(t,e,n){const s=I(e.length,e.length),i=I(e.length,e.length);return t.filter(t=>2===t.sets.length).forEach(t=>{const r=n[t.sets[0]],o=n[t.sets[1]],a=R(Math.sqrt(e[r].size/Math.PI),Math.sqrt(e[o].size/Math.PI),t.size);s[r][o]=s[o][r]=a;let l=0;t.size+1e-10>=Math.min(e[r].size,e[o].size)?l=1:t.size<=1e-10&&(l=-1),i[r][o]=i[o][r]=l}),{distances:s,constraints:i}}(t,s,i);const a=k(r.map(k))/r.length;r=r.map(t=>t.map(t=>t/a));const l=(t,e)=>function(t,e,n,s){for(let t=0;t<e.length;++t)e[t]=0;let i=0;for(let r=0;r<n.length;++r){const o=t[2*r],a=t[2*r+1];for(let l=r+1;l<n.length;++l){const c=t[2*l],h=t[2*l+1],u=n[r][l],f=s[r][l],d=(c-o)*(c-o)+(h-a)*(h-a),y=Math.sqrt(d),g=d-u*u;f>0&&y<=u||f<0&&y>=u||(i+=2*g*g,e[2*r]+=4*g*(o-c),e[2*r+1]+=4*g*(a-h),e[2*l]+=4*g*(c-o),e[2*l+1]+=4*g*(h-a))}}return i}(t,e,r,o);let c=null;for(let t=0;t<n;++t){const t=T(l,v(2*r.length).map(Math.random),e);(!c||t.fx<c.fx)&&(c=t)}const h=c.x,u={};for(let t=0;t<s.length;++t){const e=s[t];u[e.sets[0]]={x:h[2*t]*a,y:h[2*t+1]*a,radius:Math.sqrt(e.size/Math.PI)}}if(e.history)for(const t of e.history)w(t.x,a);return u}(t,e);s(i,t)+1e-8<s(n,t)&&(n=i)}return n}function N(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=p(n.radius,i.radius,x(n,i))}else e=y(s.sets.map(e=>t[e]));n+=(null!=s.weight?s.weight:1)*(e-s.size)*(e-s.size)}return n}function D(t,e){let n=0;for(const s of e){if(1===s.sets.length)continue;let e;if(2===s.sets.length){const n=t[s.sets[0]],i=t[s.sets[1]];e=p(n.radius,i.radius,x(n,i))}else e=y(s.sets.map(e=>t[e]));const i=null!=s.weight?s.weight:1,r=Math.log((e+1)/(s.size+1));n+=i*r*r}return n}function O(t,e,n){if(null==n?t.sort((t,e)=>e.radius-t.radius):t.sort(n),t.length>0){const e=t[0].x,n=t[0].y;for(const s of t)s.x-=e,s.y-=n}if(2===t.length){x(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y)}if(t.length>1){const n=Math.atan2(t[1].x,t[1].y)-e,s=Math.cos(n),i=Math.sin(n);for(const e of t){const t=e.x,n=e.y;e.x=s*t-i*n,e.y=i*t+s*n}}if(t.length>2){let n=Math.atan2(t[2].x,t[2].y)-e;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(const n of t){var s=(n.x+e*n.y)/(1+e*e);n.x=2*s-n.x,n.y=2*s*e-n.y}}}}function C(t){const e=e=>({max:t.reduce((t,n)=>Math.max(t,n[e]+n.radius),Number.NEGATIVE_INFINITY),min:t.reduce((t,n)=>Math.min(t,n[e]-n.radius),Number.POSITIVE_INFINITY)});return{xRange:e("x"),yRange:e("y")}}function F(t,e,n){null==e&&(e=Math.PI/2);let s=L(t).map(t=>Object.assign({},t));const i=function(t){function e(t){return t.parent!==t&&(t.parent=e(t.parent)),t.parent}function n(t,n){const s=e(t),i=e(n);s.parent=i}t.forEach(t=>{t.parent=t});for(let e=0;e<t.length;++e)for(let s=e+1;s<t.length;++s){const i=t[e].radius+t[s].radius;x(t[e],t[s])+1e-10<i&&n(t[s],t[e])}const s=new Map;for(let n=0;n<t.length;++n){const i=e(t[n]).parent.setid;s.has(i)||s.set(i,[]),s.get(i).push(t[n])}return t.forEach(t=>{delete t.parent}),Array.from(s.values())}(s);for(const t of i){O(t,e,n);const s=C(t);t.size=(s.xRange.max-s.xRange.min)*(s.yRange.max-s.yRange.min),t.bounds=s}i.sort((t,e)=>e.size-t.size),s=i[0];let r=s.bounds;const o=(r.xRange.max-r.xRange.min)/50;function a(t,e,n){if(!t)return;const i=t.bounds;let a,l;if(e)a=r.xRange.max-i.xRange.min+o;else{a=r.xRange.max-i.xRange.max;const t=(i.xRange.max-i.xRange.min)/2-(r.xRange.max-r.xRange.min)/2;t<0&&(a+=t)}if(n)l=r.yRange.max-i.yRange.min+o;else{l=r.yRange.max-i.yRange.max;const t=(i.yRange.max-i.yRange.min)/2-(r.yRange.max-r.yRange.min)/2;t<0&&(l+=t)}for(const e of t)e.x+=a,e.y+=l,s.push(e)}let l=1;for(;l<i.length;)a(i[l],!0,!1),a(i[l+1],!1,!0),a(i[l+2],!0,!0),l+=3,r=C(s);return j(s)}function $(t,e,n,s,i){const r=L(t);e-=2*s,n-=2*s;const{xRange:o,yRange:a}=C(r);if(o.max===o.min||a.max===a.min)return console.log("not scaling solution: zero size detected"),t;let l,c;if(i){const t=2*Math.sqrt(i/Math.PI);l=e/t,c=n/t}else l=e/(o.max-o.min),c=n/(a.max-a.min);const h=Math.min(c,l),u=(e-(o.max-o.min)*h)/2,f=(n-(a.max-a.min)*h)/2;return j(r.map(t=>({radius:h*t.radius,x:s+u+(t.x-o.min)*h,y:s+f+(t.y-a.min)*h,setid:t.setid})))}function j(t){const e={};for(const n of t)e[n.setid]=n;return e}function L(t){return Object.keys(t).map(e=>Object.assign(t[e],{setid:e}))}function P(t={}){let e=!1,n=600,s=350,i=15,r=1e3,o=Math.PI/2,a=!0,l=null,c=!0,h=!0,u=null,f=null,d=!1,y=null,g=!(!t||!t.symmetricalTextCentre)&&t.symmetricalTextCentre,x={},p=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],m=0,b=function(t){if(t in x)return x[t];var e=x[t]=p[m];return m+=1,m>=p.length&&(m=0),e},v=z,I=N;function M(x){let p=x.datum();const m=new Set;p.forEach(t=>{0==t.size&&1==t.sets.length&&m.add(t.sets[0])}),p=p.filter(t=>!t.sets.some(t=>m.has(t)));let M={},k={};if(p.length>0){let t=v(p,{lossFunction:I,distinct:d});a&&(t=F(t,o,f)),M=$(t,n,s,i,l),k=V(M,p,g)}const w={};function _(t){return t.sets in w?w[t.sets]:1==t.sets.length?""+t.sets[0]:void 0}p.forEach(t=>{t.label&&(w[t.sets]=t.label)}),x.selectAll("svg").data([M]).enter().append("svg");const S=x.select("svg");e?S.attr("viewBox",`0 0 ${n} ${s}`):S.attr("width",n).attr("height",s);const E={};let T=!1;function z(t){return e=>Y(t.sets.map(t=>{let i=E[t],r=M[t];return i||(i={x:n/2,y:s/2,radius:1}),r||(r={x:n/2,y:s/2,radius:1}),{x:i.x*(1-e)+r.x*e,y:i.y*(1-e)+r.y*e,radius:i.radius*(1-e)+r.radius*e}}),y)}S.selectAll(".venn-area path").each(function(t){const e=this.getAttribute("d");1==t.sets.length&&e&&!d&&(T=!0,E[t.sets[0]]=function(t){const e=t.split(" ");return{x:Number.parseFloat(e[1]),y:Number.parseFloat(e[2]),radius:-Number.parseFloat(e[4])}}(e))});const A=S.selectAll(".venn-area").data(p,t=>t.sets),R=A.enter().append("g").attr("class",t=>`venn-area venn-${1==t.sets.length?"circle":"intersection"}${t.colour||t.color?" venn-coloured":""}`).attr("data-venn-sets",t=>t.sets.join("_")),K=R.append("path"),N=R.append("text").attr("class","label").text(t=>_(t)).attr("text-anchor","middle").attr("dy",".35em").attr("x",n/2).attr("y",s/2);function D(t){return"function"==typeof t.transition?t.transition("venn").duration(r):t}h&&(K.style("fill-opacity","0").filter(t=>1==t.sets.length).style("fill",t=>t.colour?t.colour:t.color?t.color:b(t.sets)).style("fill-opacity",".25"),N.style("fill",e=>e.colour||e.color?"#FFF":t.textFill?t.textFill:1==e.sets.length?b(e.sets):"#444"));let O=x;T&&"function"==typeof O.transition?(O=D(x),O.selectAll("path").attrTween("d",z)):O.selectAll("path").attr("d",t=>Y(t.sets.map(t=>M[t])),y);const C=O.selectAll("text").filter(t=>t.sets in k).text(t=>_(t)).attr("x",t=>Math.floor(k[t.sets].x)).attr("y",t=>Math.floor(k[t.sets].y));c&&(T?"on"in C?C.on("end",U(M,_)):C.each("end",U(M,_)):C.each(U(M,_)));const j=D(A.exit()).remove();"function"==typeof A.transition&&j.selectAll("path").attrTween("d",z);const L=j.selectAll("text").attr("x",n/2).attr("y",s/2);return null!==u&&(N.style("font-size","0px"),C.style("font-size",u),L.style("font-size","0px")),{circles:M,textCentres:k,nodes:A,enter:R,update:O,exit:j}}return M.wrap=function(t){return arguments.length?(c=t,M):c},M.useViewBox=function(){return e=!0,M},M.width=function(t){return arguments.length?(n=t,M):n},M.height=function(t){return arguments.length?(s=t,M):s},M.padding=function(t){return arguments.length?(i=t,M):i},M.distinct=function(t){return arguments.length?(d=t,M):d},M.colours=function(t){return arguments.length?(b=t,M):b},M.colors=function(t){return arguments.length?(b=t,M):b},M.fontSize=function(t){return arguments.length?(u=t,M):u},M.round=function(t){return arguments.length?(y=t,M):y},M.duration=function(t){return arguments.length?(r=t,M):r},M.layoutFunction=function(t){return arguments.length?(v=t,M):v},M.normalize=function(t){return arguments.length?(a=t,M):a},M.scaleToFit=function(t){return arguments.length?(l=t,M):l},M.styled=function(t){return arguments.length?(h=t,M):h},M.orientation=function(t){return arguments.length?(o=t,M):o},M.orientationOrder=function(t){return arguments.length?(f=t,M):f},M.lossFunction=function(t){return arguments.length?(I="default"===t?N:"logRatio"===t?D:t,M):I},M}function U(t,e){return function(n){const s=this,i=t[n.sets[0]].radius||50,r=e(n)||"",o=r.split(/\s+/).reverse(),a=(r.length+o.length)/3;let l=o.pop(),c=[l],h=0;s.textContent=null;const u=[];function f(t){const e=s.ownerDocument.createElementNS(s.namespaceURI,"tspan");return e.textContent=t,u.push(e),s.append(e),e}let d=f(l);for(;l=o.pop(),l;){c.push(l);const t=c.join(" ");d.textContent=t,t.length>a&&d.getComputedTextLength()>i&&(c.pop(),d.textContent=c.join(" "),c=[l],d=f(l),h++)}const y=.35-1.1*h/2,g=s.getAttribute("x"),x=s.getAttribute("y");u.forEach((t,e)=>{t.setAttribute("x",g),t.setAttribute("y",x),t.setAttribute("dy",`${y+1.1*e}em`)})}}function q(t,e,n){let s=e[0].radius-x(e[0],t);for(let n=1;n<e.length;++n){const i=e[n].radius-x(e[n],t);i<=s&&(s=i)}for(let e=0;e<n.length;++e){const i=x(n[e],t)-n[e].radius;i<=s&&(s=i)}return s}function B(t,e,n){const s=[];for(const e of t)s.push({x:e.x,y:e.y}),s.push({x:e.x+e.radius/2,y:e.y}),s.push({x:e.x-e.radius/2,y:e.y}),s.push({x:e.x,y:e.y+e.radius/2}),s.push({x:e.x,y:e.y-e.radius/2});let i=s[0],r=q(s[0],t,e);for(let n=1;n<s.length;++n){const o=q(s[n],t,e);o>=r&&(i=s[n],r=o)}const o=S(n=>-1*q({x:n[0],y:n[1]},t,e),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,a={x:n?0:o[0],y:o[1]};let l=!0;for(const e of t)if(x(a,e)>e.radius){l=!1;break}for(const t of e)if(x(a,t)<t.radius){l=!1;break}if(l)return a;if(1==t.length)return{x:t[0].x,y:t[0].y};const c={};return y(t,c),0===c.arcs.length?{x:0,y:-1e3,disjoint:!0}:1==c.arcs.length?{x:c.arcs[0].circle.x,y:c.arcs[0].circle.y}:e.length?B(t,[]):b(c.arcs.map(t=>t.p1))}function G(t){const e={},n=Object.keys(t);for(const t of n)e[t]=[];for(let s=0;s<n.length;s++){const i=n[s],r=t[i];for(let o=s+1;o<n.length;++o){const s=n[o],a=t[s],l=x(r,a);l+a.radius<=r.radius+1e-10?e[s].push(i):l+r.radius<=a.radius+1e-10&&e[i].push(s)}}return e}function V(t,e,n){const s={},i=G(t);for(let r=0;r<e.length;++r){const o=e[r].sets,a={},l={};for(let t=0;t<o.length;++t){a[o[t]]=!0;const e=i[o[t]];for(let t=0;t<e.length;++t)l[e[t]]=!0}const c=[],h=[];for(let e in t)e in a?c.push(t[e]):e in l||h.push(t[e]);const u=B(c,h,n);s[o]=u,u.disjoint&&e[r].size>0&&console.log("WARNING: area "+o+" not represented on screen")}return s}function W(t){if(0===t.length)return[];const e={};return y(t,e),e.arcs}function X(t,e){if(0===t.length)return"M 0 0";const n=Math.pow(10,e||0),s=null!=e?t=>Math.round(t*n)/n:t=>t;if(1==t.length){const e=t[0].circle;return function(t,e,n){const s=[];return s.push("\nM",t,e),s.push("\nm",-n,0),s.push("\na",n,n,0,1,0,2*n,0),s.push("\na",n,n,0,1,0,2*-n,0),s.join(" ")}(s(e.x),s(e.y),s(e.radius))}const i=["\nM",s(t[0].p2.x),s(t[0].p2.y)];for(const e of t){const t=s(e.circle.radius);i.push("\nA",t,t,0,e.large?1:0,e.sweep?1:0,s(e.p1.x),s(e.p1.y))}return i.join(" ")}function Y(t,e){return X(W(t),e)}var Z=n(61057),H=function(){var t=(0,o.K)(function(t,e,n,s){for(n=n||{},s=t.length;s--;n[t[s]]=e);return n},"o"),e=[5,8],n=[7,8,11,12,17,19,22,24],s=[1,17],i=[1,18],r=[7,8,11,12,14,15,16,17,19,20,21,22,24,27],a=[1,31],l=[1,39],c=[7,8,11,12,17,19,22,24,27],h=[1,57],u=[1,56],f=[1,58],d=[1,59],y=[1,60],g=[7,8,11,12,16,17,19,20,22,24,27,31,32,33],x={trace:(0,o.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,optNewlines:4,VENN:5,document:6,EOF:7,NEWLINE:8,line:9,statement:10,TITLE:11,SET:12,identifier:13,BRACKET_LABEL:14,COLON:15,NUMERIC:16,UNION:17,identifierList:18,TEXT:19,IDENTIFIER:20,STRING:21,INDENT_TEXT:22,indentedTextTail:23,STYLE:24,stylesOpt:25,styleField:26,COMMA:27,styleValue:28,valueTokens:29,valueToken:30,HEXCOLOR:31,RGBCOLOR:32,RGBACOLOR:33,$accept:0,$end:1},terminals_:{2:"error",5:"VENN",7:"EOF",8:"NEWLINE",11:"TITLE",12:"SET",14:"BRACKET_LABEL",15:"COLON",16:"NUMERIC",17:"UNION",19:"TEXT",20:"IDENTIFIER",21:"STRING",22:"INDENT_TEXT",24:"STYLE",27:"COMMA",31:"HEXCOLOR",32:"RGBCOLOR",33:"RGBACOLOR"},productions_:[0,[3,4],[4,0],[4,2],[6,0],[6,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,5],[10,2],[10,3],[10,4],[10,5],[10,3],[10,3],[10,3],[10,4],[10,4],[10,2],[10,3],[23,1],[23,1],[23,1],[23,2],[23,2],[25,1],[25,3],[26,3],[28,1],[28,1],[29,1],[29,2],[30,1],[30,1],[30,1],[30,1],[30,1],[18,1],[18,3],[13,1],[13,1]],performAction:(0,o.K)(function(t,e,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return r[a-1];case 2:case 3:case 4:case 6:this.$=[];break;case 5:case 35:r[a-1].push(r[a]),this.$=r[a-1];break;case 7:case 22:case 32:case 36:case 37:case 38:case 39:case 40:case 43:case 44:this.$=r[a];break;case 8:s.setDiagramTitle(r[a].substr(6)),this.$=r[a].substr(6);break;case 9:s.addSubsetData([r[a]],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 10:s.addSubsetData([r[a-1]],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 11:s.addSubsetData([r[a-2]],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 12:s.addSubsetData([r[a-3]],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 13:if(r[a].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a]),s.addSubsetData(r[a],void 0,void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 14:if(r[a-1].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-1]),s.addSubsetData(r[a-1],r[a],void 0),s.setIndentMode&&s.setIndentMode(!0);break;case 15:if(r[a-2].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-2]),s.addSubsetData(r[a-2],void 0,parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 16:if(r[a-3].length<2)throw new Error("union requires multiple identifiers");s.validateUnionIdentifiers&&s.validateUnionIdentifiers(r[a-3]),s.addSubsetData(r[a-3],r[a-2],parseFloat(r[a])),s.setIndentMode&&s.setIndentMode(!0);break;case 17:case 18:case 19:s.addTextData(r[a-1],r[a],void 0);break;case 20:case 21:s.addTextData(r[a-2],r[a-1],r[a]);break;case 23:s.addStyleData(r[a-1],r[a]);break;case 24:case 25:case 26:if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a],void 0);break;case 27:case 28:var l;if(!(l=s.getCurrentSets()))throw new Error("text requires set");s.addTextData(l,r[a-1],r[a]);break;case 29:case 41:case 34:this.$=[r[a]];break;case 30:case 42:this.$=[...r[a-2],r[a]];break;case 31:this.$=[r[a-2],r[a]];break;case 33:this.$=r[a].join(" ")}},"anonymous"),table:[t(e,[2,2],{3:1,4:2}),{1:[3]},{5:[1,3],8:[1,4]},t(n,[2,4],{6:5}),t(e,[2,3]),{7:[1,6],8:[1,8],9:7,10:9,11:[1,10],12:[1,11],17:[1,12],19:[1,13],22:[1,14],24:[1,15]},{1:[2,1]},t(n,[2,5]),t(n,[2,6]),t(n,[2,7]),t(n,[2,8]),{13:16,20:s,21:i},{13:20,18:19,20:s,21:i},{13:20,18:21,20:s,21:i},{16:[1,25],20:[1,23],21:[1,24],23:22},{13:20,18:26,20:s,21:i},t(n,[2,9],{14:[1,27],15:[1,28]}),t(r,[2,43]),t(r,[2,44]),t(n,[2,13],{14:[1,29],15:[1,30],27:a}),t(r,[2,41]),{16:[1,34],20:[1,32],21:[1,33],27:a},t(n,[2,22]),t(n,[2,24],{14:[1,35]}),t(n,[2,25],{14:[1,36]}),t(n,[2,26]),{20:l,25:37,26:38,27:a},t(n,[2,10],{15:[1,40]}),{16:[1,41]},t(n,[2,14],{15:[1,42]}),{16:[1,43]},{13:44,20:s,21:i},t(n,[2,17],{14:[1,45]}),t(n,[2,18],{14:[1,46]}),t(n,[2,19]),t(n,[2,27]),t(n,[2,28]),t(n,[2,23],{27:[1,47]}),t(c,[2,29]),{15:[1,48]},{16:[1,49]},t(n,[2,11]),{16:[1,50]},t(n,[2,15]),t(r,[2,42]),t(n,[2,20]),t(n,[2,21]),{20:l,26:51},{16:h,20:u,21:[1,53],28:52,29:54,30:55,31:f,32:d,33:y},t(n,[2,12]),t(n,[2,16]),t(c,[2,30]),t(c,[2,31]),t(c,[2,32]),t(c,[2,33],{30:61,16:h,20:u,31:f,32:d,33:y}),t(g,[2,34]),t(g,[2,36]),t(g,[2,37]),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,35])],defaultActions:{6:[2,1]},parseError:(0,o.K)(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:(0,o.K)(function(t){var e=this,n=[0],s=[],i=[null],r=[],a=this.table,l="",c=0,h=0,u=0,f=r.slice.call(arguments,1),d=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);d.setInput(t,y.yy),y.yy.lexer=d,y.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var x=d.yylloc;r.push(x);var p=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,o.K)(function(t){n.length=n.length-2*t,i.length=i.length-t,r.length=r.length-t},"popStack"),(0,o.K)(m,"lex");for(var b,v,I,M,k,w,_,S,E,T={};;){if(I=n[n.length-1],this.defaultActions[I]?M=this.defaultActions[I]:(null==b&&(b=m()),M=a[I]&&a[I][b]),void 0===M||!M.length||!M[0]){var z="";for(w in E=[],a[I])this.terminals_[w]&&w>2&&E.push("'"+this.terminals_[w]+"'");z=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(z,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:x,expected:E})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+b);switch(M[0]){case 1:n.push(b),i.push(d.yytext),r.push(d.yylloc),n.push(M[1]),b=null,v?(b=v,v=null):(h=d.yyleng,l=d.yytext,c=d.yylineno,x=d.yylloc,u>0&&u--);break;case 2:if(_=this.productions_[M[1]][1],T.$=i[i.length-_],T._$={first_line:r[r.length-(_||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(_||1)].first_column,last_column:r[r.length-1].last_column},p&&(T._$.range=[r[r.length-(_||1)].range[0],r[r.length-1].range[1]]),void 0!==(k=this.performAction.apply(T,[l,h,c,y.yy,M[1],i,r].concat(f))))return k;_&&(n=n.slice(0,-1*_*2),i=i.slice(0,-1*_),r=r.slice(0,-1*_)),n.push(this.productions_[M[1]][0]),i.push(T.$),r.push(T._$),S=a[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},p=function(){return{EOF:1,parseError:(0,o.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,o.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,o.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,o.K)(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,o.K)(function(){return this._more=!0,this},"more"),reject:(0,o.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,o.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,o.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,o.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,o.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,o.K)(function(t,e){var n,s,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:(0,o.K)(function(){if(this.done)return this.EOF;var t,e,n,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((n=this._input.match(this.rules[i[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,i[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,o.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,o.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,o.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,o.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,o.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,o.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,o.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,o.K)(function(t,e,n,s){switch(n){case 0:case 1:case 2:case 4:case 7:case 8:break;case 3:if(t.getIndentMode&&t.getIndentMode())return t.consumeIndentText=!0,this.begin("INITIAL"),22;break;case 5:t.setIndentMode&&t.setIndentMode(!1),this.begin("INITIAL"),this.unput(e.yytext);break;case 6:return this.begin("bol"),8;case 9:return 7;case 10:return 11;case 11:return 5;case 12:return 12;case 13:return 17;case 14:if(!t.consumeIndentText)return 19;t.consumeIndentText=!1;break;case 15:return 24;case 16:return e.yytext=e.yytext.slice(2,-2),14;case 17:return e.yytext=e.yytext.slice(1,-1).trim(),14;case 18:return 16;case 19:return 31;case 20:return 33;case 21:return 32;case 22:return 20;case 23:return 21;case 24:return 27;case 25:return 15}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[ \t]+(?=[\n\r]))/i,/^(?:[ \t]+(?=text\b))/i,/^(?:[ \t]+)/i,/^(?:[^ \t\n\r])/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[ \t]+)/i,/^(?:$)/i,/^(?:title\s[^#\n;]+)/i,/^(?:venn-beta\b)/i,/^(?:set\b)/i,/^(?:union\b)/i,/^(?:text\b)/i,/^(?:style\b)/i,/^(?:\["[^\"]*"\])/i,/^(?:\[[^\]\"]+\])/i,/^(?:[+-]?(\d+(\.\d+)?|\.\d+))/i,/^(?:#[0-9a-fA-F]{3,8})/i,/^(?:rgba\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:rgb\(\s*[0-9.]+\s*[,]\s*[0-9.]+\s*[,]\s*[0-9.]+\s*\))/i,/^(?:[A-Za-z_][A-Za-z0-9\-_]*)/i,/^(?:"[^\"]*")/i,/^(?:,)/i,/^(?::)/i],conditions:{bol:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0},INITIAL:{rules:[0,1,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25],inclusive:!0}}}}();function m(){this.yy={}}return x.lexer=p,(0,o.K)(m,"Parser"),m.prototype=x,x.Parser=m,new m}();H.parser=H;var J,Q=H,tt=[],et=[],nt=[],st=new Set,it=!1,rt=(0,o.K)((t,e,n)=>{const s=ft(t).sort(),i=n??10/Math.pow(t.length,2);J=s,1===s.length&&st.add(s[0]),tt.push({sets:s,size:i,label:e?at(e):void 0})},"addSubsetData"),ot=(0,o.K)(()=>tt,"getSubsetData"),at=(0,o.K)(t=>{const e=t.trim();return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e},"normalizeText"),lt=(0,o.K)(t=>t?at(t):t,"normalizeStyleValue"),ct=(0,o.K)((t,e,n)=>{const s=at(e);et.push({sets:ft(t).sort(),id:s,label:n?at(n):void 0})},"addTextData"),ht=(0,o.K)((t,e)=>{const n=ft(t).sort(),s={};for(const[t,n]of e)s[t]=lt(n)??n;nt.push({targets:n,styles:s})},"addStyleData"),ut=(0,o.K)(()=>nt,"getStyleData"),ft=(0,o.K)(t=>t.map(t=>at(t)),"normalizeIdentifierList"),dt=(0,o.K)(t=>{const e=ft(t).filter(t=>!st.has(t));if(e.length>0)throw new Error(`unknown set identifier: ${e.join(", ")}`)},"validateUnionIdentifiers"),yt=(0,o.K)(()=>et,"getTextData"),gt=(0,o.K)(()=>J,"getCurrentSets"),xt=(0,o.K)(()=>it,"getIndentMode"),pt=(0,o.K)(t=>{it=t},"setIndentMode"),mt=r.UI.venn;function bt(){return(0,i.$t)(mt,(0,r.zj)().venn)}(0,o.K)(bt,"getConfig");var vt={getConfig:bt,clear:(0,o.K)(()=>{(0,r.IU)(),tt.length=0,et.length=0,nt.length=0,st.clear(),J=void 0,it=!1},"customClear"),setAccTitle:r.SV,getAccTitle:r.iN,setDiagramTitle:r.ke,getDiagramTitle:r.ab,getAccDescription:r.m7,setAccDescription:r.EI,addSubsetData:rt,getSubsetData:ot,addTextData:ct,addStyleData:ht,validateUnionIdentifiers:dt,getTextData:yt,getStyleData:ut,getCurrentSets:gt,getIndentMode:xt,setIndentMode:pt},It=(0,o.K)(t=>`\n .venn-title {\n font-size: 32px;\n fill: ${t.vennTitleTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-circle text {\n font-size: 48px;\n font-family: ${t.fontFamily};\n }\n\n .venn-intersection text {\n font-size: 48px;\n fill: ${t.vennSetTextColor};\n font-family: ${t.fontFamily};\n }\n\n .venn-text-node {\n font-family: ${t.fontFamily};\n color: ${t.vennSetTextColor};\n }\n`,"getStyles");function Mt(t){const e=new Map;for(const n of t){const t=n.targets.join("|"),s=e.get(t);s?Object.assign(s,n.styles):e.set(t,{...n.styles})}return e}(0,o.K)(Mt,"buildStyleByKey");var kt=(0,o.K)((t,e,n,i)=>{const o=i.db,c=o.getConfig?.(),{themeVariables:d,look:y,handDrawnSeed:g}=(0,r.zj)(),x="handDrawn"===y,p=[d.venn1,d.venn2,d.venn3,d.venn4,d.venn5,d.venn6,d.venn7,d.venn8].filter(Boolean),m=o.getDiagramTitle?.(),b=o.getSubsetData(),v=o.getTextData(),I=Mt(o.getStyleData()),M=St(b),k=c?.width??800,w=c?.height??450,_=k/1600,S=m?48*_:0,E=d.primaryTextColor??d.textColor,T=(0,s.D)(e);T.attr("viewBox",`0 0 ${k} ${w}`),m&&T.append("text").text(m).attr("class","venn-title").attr("font-size",32*_+"px").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*_).style("fill",d.vennTitleTextColor||d.titleColor);const A=(0,a.Ltv)(document.createElement("div")),R=P().width(k).height(w-S);A.datum(M).call(R);const K=x?Z.A.svg(A.select("svg").node()):void 0,O=function(t,e={}){const{lossFunction:n,layoutFunction:s=z,normalize:i=!0,orientation:r=Math.PI/2,orientationOrder:o,width:a=600,height:l=350,padding:c=15,scaleToFit:h=!1,symmetricalTextCentre:u=!1,distinct:f,round:d=2}=e;let y=s(t,{lossFunction:"default"!==n&&n?"logRatio"===n?D:n:N,distinct:f});i&&(y=F(y,r,o));const g=$(y,a,l,c,h),x=V(g,t,u),p=new Map(Object.keys(g).map(t=>[t,{set:t,x:g[t].x,y:g[t].y,radius:g[t].radius}])),m=t.map(t=>{const e=t.sets.map(t=>p.get(t)),n=W(e);return{circles:e,arcs:n,path:X(n,d),area:t,has:new Set(t.sets)}});function b(t){let e="";for(const n of m)n.has.size>t.length&&t.every(t=>n.has.has(t))&&(e+=" "+n.path);return e}return m.map(({circles:t,arcs:e,path:n,area:s})=>({data:s,text:x[s.sets],circles:t,arcs:e,path:n,distinctPath:n+b(s.sets)}))}(M,{width:k,height:w-S,padding:c?.padding??15}),C=new Map;for(const t of O){const e=wt([...t.data.sets].sort());C.set(e,t)}v.length>0&&_t(c,C,A,v,_,I);const j=(0,l.A)(d.background||"#f4f4f4");A.selectAll(".venn-circle").each(function(t,e){const n=(0,a.Ltv)(this),s=wt([...t.sets].sort()),i=I.get(s),r=i?.fill||p[e%p.length]||d.primaryColor;n.classed("venn-set-"+e%8,!0);const o=i?.["fill-opacity"]??.1,l=i?.stroke||r,c=i?.["stroke-width"]||""+5*_;if(x&&K){const t=C.get(s);if(t&&t.circles.length>0){const s=t.circles[0],i=K.circle(s.x,s.y,2*s.radius,{roughness:.7,seed:g,fill:h(r,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:60*e-41,stroke:l,strokeWidth:parseFloat(String(c))});n.select("path").remove(),n.node()?.insertBefore(i,n.select("text").node())}}else n.select("path").style("fill",r).style("fill-opacity",o).style("stroke",l).style("stroke-width",c).style("stroke-opacity",.95);const y=i?.color||(j?(0,u.A)(r,30):(0,f.A)(r,30));n.select("text").style("font-size",48*_+"px").style("fill",y)}),x&&K?A.selectAll(".venn-intersection").each(function(t){const e=(0,a.Ltv)(this),n=wt([...t.sets].sort()),s=I.get(n),i=s?.fill;if(i){const t=e.select("path"),n=t.attr("d");if(n){const e=K.path(n,{roughness:.7,seed:g,fill:h(i,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),s=t.node();s?.parentNode?.insertBefore(e,s),t.remove()}}else e.select("path").style("fill-opacity",0);e.select("text").style("font-size",48*_+"px").style("fill",s?.color??d.vennSetTextColor??E)}):(A.selectAll(".venn-intersection text").style("font-size",48*_+"px").style("fill",t=>{const e=wt([...t.sets].sort());return I.get(e)?.color??d.vennSetTextColor??E}),A.selectAll(".venn-intersection path").style("fill-opacity",t=>{const e=wt([...t.sets].sort());return I.get(e)?.fill?1:0}).style("fill",t=>{const e=wt([...t.sets].sort());return I.get(e)?.fill??"transparent"}));const L=T.append("g").attr("transform",`translate(0, ${S})`),U=A.select("svg").node();if(U&&"childNodes"in U)for(const t of[...U.childNodes])L.node()?.appendChild(t);(0,r.a$)(T,w,k,c?.useMaxWidth??!0)},"draw");function wt(t){return t.join("|")}function _t(t,e,n,s,i,r){const o=t?.useDebugLayout??!1,a=n.select("svg").append("g").attr("class","venn-text-nodes"),l=new Map;for(const t of s){const e=wt(t.sets),n=l.get(e);n?n.push(t):l.set(e,[t])}for(const[t,n]of l.entries()){const s=e.get(t);if(!s?.text)continue;const l=s.text.x,c=s.text.y,h=Math.min(...s.circles.map(t=>t.radius)),u=Math.min(...s.circles.map(t=>t.radius-Math.hypot(l-t.x,c-t.y)));let f=Number.isFinite(u)?Math.max(0,u):0;0===f&&Number.isFinite(h)&&(f=.6*h);const d=a.append("g").attr("class","venn-text-area").attr("font-size",40*i+"px");o&&d.append("circle").attr("class","venn-text-debug-circle").attr("cx",l).attr("cy",c).attr("r",f).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const y=Math.max(80*i,2*f*.95),g=Math.max(60*i,2*f*.95),x=(s.data.label&&s.data.label.length>0?Math.min(32*i,.25*f):0)+(n.length<=2?30*i:0),p=l-y/2,m=c-g/2+x,b=Math.max(1,Math.ceil(Math.sqrt(n.length))),v=y/b,I=g/Math.max(1,Math.ceil(n.length/b));for(const[t,e]of n.entries()){const n=t%b,s=Math.floor(t/b),a=p+v*(n+.5),l=m+I*(s+.5);o&&d.append("rect").attr("class","venn-text-debug-cell").attr("x",p+v*n).attr("y",m+I*s).attr("width",v).attr("height",I).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const c=.9*v,h=.9*I,u=d.append("foreignObject").attr("class","venn-text-node-fo").attr("width",c).attr("height",h).attr("x",a-c/2).attr("y",l-h/2).attr("overflow","visible"),f=r.get(e.id)?.color,y=u.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(e.label??e.id);f&&y.style("color",f)}}}function St(t){const e=new Set(t.map(t=>[...t.sets].sort().join("|"))),n=new Map(t.filter(t=>1===t.sets.length&&void 0!==t.size).map(t=>[t.sets[0],t.size])),s=[];for(const i of t){if(i.sets.length<3)continue;const t=[...i.sets].sort();for(let i=0;i<t.length-1;i++)for(let r=i+1;r<t.length;r++){const o=[t[i],t[r]],a=o.join("|");if(!e.has(a)){e.add(a);const t=n.get(o[0]),i=n.get(o[1]),r=void 0!==t&&void 0!==i?Math.min(t,i)/4:2.5;s.push({sets:o,size:r,label:""})}}}return s.length>0?[...t,...s]:t}(0,o.K)(wt,"stableSetsKey"),(0,o.K)(_t,"renderTextNodes"),(0,o.K)(St,"ensurePairwiseSubsets");var Et={parser:Q,db:vt,renderer:{draw:kt},styles:It}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2449],{92449(e,r,t){t.d(r,{diagram:()=>y});var n=t(67977),a=t(77454),s=(t(22422),t(32178),t(31293)),l=t(86827),i=t(34376),p=(0,i.sB)().RailroadAbnf.parser.LangiumParser,m=(0,l.K)(e=>{const r=e.alternatives.map(o);return 1===r.length?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),o=(0,l.K)(e=>{const r=e.elements.map(c);return 1===r.length?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),u=(0,l.K)(e=>{if(e.includes("*")){const[r,t]=e.split("*");return{min:r?parseInt(r,10):0,max:t?parseInt(t,10):1/0}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),c=(0,l.K)(e=>{const r=d(e.primary);if(!e.repeat)return r;const{min:t,max:n}=u(e.repeat);return 0===t&&1===n?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:n}},"transformElement"),d=(0,l.K)(e=>{switch(e.$type){case"AbnfStringLiteral":case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return m(e.element);case"AbnfOptionalGroup":return{type:"optional",element:m(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),f=(0,l.K)(e=>({name:e.name,definition:m(e.definition)}),"transformRule"),b=(0,l.K)(e=>{(0,a.S)(e,n.db),e.title&&n.db.setTitle(e.title),e.rules.map(e=>n.db.addRule(f(e)))},"populateDb"),y={parser:{parse:(0,l.K)(e=>{n.db.clear(),s.R.debug("[ABNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new i.zg(r);const t=r.value;s.R.debug("[ABNF Parser] Parsed rules:",t.rules.length),b(t),s.R.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n.db}},db:n.db,renderer:n.U,styles:n.$}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[2535],{52535(e,t,n){n.d(t,{diagram:()=>r});var a=n(49352),l=(n(64918),n(96755),n(78257),n(81818),n(21570),n(91730),n(9290),n(9636),n(14782),n(91865),n(6129),n(62979),n(5494),n(99087),n(32178),n(31293),(0,n(86827).K)(e=>`${(0,a.tM)(e)}\n .swimlane.cluster rect {\n stroke: ${e.clusterBorder} !important;\n }\n [data-look="neo"].cluster rect {\n filter: none;\n }\n`,"getStyles")),r=(0,a.ur)({defaultLayout:"swimlane",styles:l})}}]);