adminizer 5.2.0-build.32 → 5.2.0-build.34

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 (119) hide show
  1. package/assets/{abnfDiagram-VCTEODGH-DbgbyJcA.js → abnfDiagram-VCTEODGH-BbJTXfTE.js} +1 -1
  2. package/assets/{add-CZSjZSj4.js → add-UCuYfqnA.js} +1 -1
  3. package/assets/{add-group-D2OXN23o.js → add-group-Dqy51mK7.js} +1 -1
  4. package/assets/{add-user-DWw6yqHq.js → add-user-lHPqrZLh.js} +1 -1
  5. package/assets/ai-assistant/agent.es.js +19464 -18270
  6. package/assets/app-BKhgReUT.js +138 -0
  7. package/assets/app-Bon67K9l.css +1 -0
  8. package/assets/{architectureDiagram-5GKGNRK7-BgImmyg4.js → architectureDiagram-5GKGNRK7-DcRt--3g.js} +2 -2
  9. package/assets/{blockDiagram-I7D4REHJ-CICNz1pJ.js → blockDiagram-I7D4REHJ-8_cCt-vW.js} +4 -4
  10. package/assets/{c4Diagram-7LVT6UL2-PO45Obwl.js → c4Diagram-7LVT6UL2-Bsn2OlKb.js} +1 -1
  11. package/assets/{catalog-yW12d58W.js → catalog-DfYJNiry.js} +1 -1
  12. package/assets/channel-0VXWsV6U.js +1 -0
  13. package/assets/{chunk-2Q5K7J3B-Bw5ZGE4l.js → chunk-2Q5K7J3B-BzrtylLu.js} +1 -1
  14. package/assets/{chunk-5VM5RSS4-CGXR0Oqz.js → chunk-5VM5RSS4-D7pDUki8.js} +1 -1
  15. package/assets/{chunk-F27PBJKO-CrHFA3QY.js → chunk-F27PBJKO-Bw8mEYY6.js} +1 -1
  16. package/assets/{chunk-IMKFNOWR-2vxZURAx.js → chunk-IMKFNOWR-nZKNEeNv.js} +1 -1
  17. package/assets/{chunk-JWPE2WC7-DsNFW3Fc.js → chunk-JWPE2WC7-DxUX2M-J.js} +1 -1
  18. package/assets/{chunk-POPQ4Y6H-B9iEE0gK.js → chunk-POPQ4Y6H-Bgt0Kaqd.js} +1 -1
  19. package/assets/{chunk-SVP7TREG-gdJM9rxR.js → chunk-SVP7TREG-DLigtJWk.js} +4 -4
  20. package/assets/{chunk-TICWLB2K-na_1Z3ZQ.js → chunk-TICWLB2K-B5WjdD1M.js} +1 -1
  21. package/assets/{chunk-XXDRQBXY-BCIKd4yk.js → chunk-XXDRQBXY-BJS0Ht92.js} +1 -1
  22. package/assets/classDiagram-ZZMXUADV-DgvmCbKR.js +1 -0
  23. package/assets/classDiagram-v2-VYDZK3BY-DgvmCbKR.js +1 -0
  24. package/assets/controls/ckeditor.es.js +9602 -9418
  25. package/assets/controls/jsoneditor.es.js +667 -668
  26. package/assets/controls/toast-ui.es.js +14232 -14230
  27. package/assets/{cose-bilkent-JH36ORCC-BuPwEvrz.js → cose-bilkent-JH36ORCC-Be1z_i9Q.js} +1 -1
  28. package/assets/{cynefin-OW5HDTMX-BBWNZZ5h.js → cynefin-OW5HDTMX-na8kWeny.js} +1 -1
  29. package/assets/{cynefinDiagram-5FMLGOSQ-CFTmYo7z.js → cynefinDiagram-5FMLGOSQ-ql71XTsQ.js} +2 -2
  30. package/assets/d3-scale-4DPf7zan.js +1 -0
  31. package/assets/{dagre-GXQ25YYZ-BA5RSLP2.js → dagre-GXQ25YYZ-BuKFYbmi.js} +2 -2
  32. package/assets/{dashboard-By8UkLaw.js → dashboard-Drm_gp-G.js} +1 -1
  33. package/assets/{diagram-S7CK7UJ4-BvhL0CjC.js → diagram-S7CK7UJ4-znl5Fq0J.js} +3 -3
  34. package/assets/diagram-UQ7AKVKN-CRFVfrL1.js +41 -0
  35. package/assets/{diagram-VSXAHHWV-Bvgp8Yy3.js → diagram-VSXAHHWV-CIVgZDJa.js} +1 -1
  36. package/assets/diagram-VX7I27RA-DIQB8SES.js +24 -0
  37. package/assets/{diagram-Z3DM3KII-DKWm9OV0.js → diagram-Z3DM3KII-DeY6yMBN.js} +1 -1
  38. package/assets/{docs-ChZhTONp.js → docs-B6LIpITJ.js} +1 -1
  39. package/assets/{ebnfDiagram-PWID7BFC-hv0LYjtJ.js → ebnfDiagram-PWID7BFC-Im7jHJ-6.js} +1 -1
  40. package/assets/{erDiagram-RLTQ6QDP-CgWLeFqJ.js → erDiagram-RLTQ6QDP-CCvI6JHH.js} +1 -1
  41. package/assets/{flowDiagram-HODETNUW-DaF8dBdu.js → flowDiagram-HODETNUW-DgdTOUM1.js} +4 -4
  42. package/assets/ganttDiagram-EL5Y4UJY-BZ5DzFSb.js +292 -0
  43. package/assets/{gitGraphDiagram-WWUBYQGX-C0J3HKXb.js → gitGraphDiagram-WWUBYQGX-CQklLXfY.js} +1 -1
  44. package/assets/{history-Mnjs7E36.js → history-CbgCLusU.js} +1 -1
  45. package/assets/{infoDiagram-27XIBGKW-DGKmA2HC.js → infoDiagram-27XIBGKW-inaVWWG7.js} +1 -1
  46. package/assets/{init-user-CSUX8Zph.js → init-user-DmWRf1Jr.js} +1 -1
  47. package/assets/{ishikawaDiagram-5VMMS53U-sBPJ_zmB.js → ishikawaDiagram-5VMMS53U-R9uOXdb9.js} +3 -3
  48. package/assets/{journeyDiagram-3NMN7TZE-C_I6XtEx.js → journeyDiagram-3NMN7TZE-YhsaQCHu.js} +2 -2
  49. package/assets/{kanban-definition-UXKFOSKX-DJXuEpuj.js → kanban-definition-UXKFOSKX-SFHx0aHd.js} +6 -6
  50. package/assets/layout-CryHDwUP.js +1 -0
  51. package/assets/{list-C5s9ablZ.js → list-CMYKENzO.js} +1 -1
  52. package/assets/login-inT0h68O.js +1 -0
  53. package/assets/manifest.json +281 -322
  54. package/assets/{media-manager-BKafzZHC.js → media-manager-DLwgt3w-.js} +1 -1
  55. package/assets/mermaid.core-BJx2V7Fx.js +310 -0
  56. package/assets/{mindmap-definition-YA3MSWOX-TxmPbCcJ.js → mindmap-definition-YA3MSWOX-DavgP5bX.js} +1 -1
  57. package/assets/{module-C5ct1ybj.js → module-Cd8HVyqp.js} +1 -1
  58. package/assets/{notification-CPhQJoOk.js → notification-NHcn4uVC.js} +1 -1
  59. package/assets/{pegDiagram-XKGWAZYB-D8aHLl6X.js → pegDiagram-XKGWAZYB-yFW3IMW-.js} +1 -1
  60. package/assets/pieDiagram-E7YTZNPT-CQTyXz50.js +39 -0
  61. package/assets/{quadrantDiagram-AXDQQJYC-CAwJ1sa3.js → quadrantDiagram-AXDQQJYC-Cqjg5HSm.js} +4 -4
  62. package/assets/{railroadDiagram-O6MQD6OU-2Z1DiRqD.js → railroadDiagram-O6MQD6OU-DzL2XDLc.js} +1 -1
  63. package/assets/{register-j2fRPw-h.js → register-BrZOgrIT.js} +1 -1
  64. package/assets/{requirementDiagram-BXWQKSXE-CLSJHCUR.js → requirementDiagram-BXWQKSXE-CWcLe5E-.js} +1 -1
  65. package/assets/{ru-Ctt5rhuw.js → ru-DqbXrFdY.js} +1 -1
  66. package/assets/sankeyDiagram-P5KCCOFB-BzTZcPVf.js +40 -0
  67. package/assets/{sequenceDiagram-WJ2MYXX4-DUJm3o3w.js → sequenceDiagram-WJ2MYXX4-DM48lXLE.js} +1 -1
  68. package/assets/{sizeCapture-INFHLROL-tVk02ZBq.js → sizeCapture-INFHLROL-D7cx9va2.js} +1 -1
  69. package/assets/stateDiagram-D77RDMKH-CUReM6ha.js +1 -0
  70. package/assets/stateDiagram-v2-MP3YSRHH-UNjCyT1j.js +1 -0
  71. package/assets/{swimlanes-42K2YHIH-1bGEFd1q.js → swimlanes-42K2YHIH-DEqEyhLN.js} +1 -1
  72. package/assets/swimlanesDiagram-VR7AAH4N-Dh-s4bKd.js +8 -0
  73. package/assets/{timeline-definition-24CTP7MA-A_L0NAjr.js → timeline-definition-24CTP7MA-_OQxzNu9.js} +2 -2
  74. package/assets/{use-appearance-DexcS2XF.js → use-appearance-BfSu2Tjm.js} +1 -1
  75. package/assets/{user-filters-list-DYS6ypS7.js → user-filters-list-LqHail28.js} +1 -1
  76. package/assets/{vennDiagram-4TSXK5OY-CkVuIPLv.js → vennDiagram-4TSXK5OY-wUfSnIxp.js} +5 -5
  77. package/assets/{wardleyDiagram-VM6X3IG4-CAid-4O_.js → wardleyDiagram-VM6X3IG4-BPcd3HO7.js} +2 -2
  78. package/assets/{welcome-1CccLOAC.js → welcome-XTbUvCzA.js} +1 -1
  79. package/assets/with-app-layout-CTv_hHug.js +37 -0
  80. package/assets/xychartDiagram-S5SC5T6Z-DBXGC8lX.js +7 -0
  81. package/controllers/exportData.js +6 -6
  82. package/controllers/list.js +1 -10
  83. package/controllers/login.d.ts +1 -1
  84. package/controllers/login.js +18 -17
  85. package/helpers/fieldsHelper.d.ts +2 -0
  86. package/helpers/fieldsHelper.js +11 -0
  87. package/interfaces/global.d.ts +0 -1
  88. package/lib/helper/pretend.d.ts +4 -0
  89. package/lib/helper/pretend.js +27 -0
  90. package/lib/list-query-builder/ListQueryBuilder.d.ts +4 -0
  91. package/lib/list-query-builder/ListQueryBuilder.js +10 -3
  92. package/package.json +1 -1
  93. package/services/FeedService.js +12 -5
  94. package/system/bindInertia.js +1 -1
  95. package/system/bindReqFunctions.js +13 -4
  96. package/system/defaults.js +1 -0
  97. package/assets/app-6gn6IblM.js +0 -138
  98. package/assets/app-DM8KzeFz.css +0 -1
  99. package/assets/arc-Ds8Mu0yU.js +0 -1
  100. package/assets/channel-CVjHBlbP.js +0 -1
  101. package/assets/classDiagram-ZZMXUADV-DUJsEIfw.js +0 -1
  102. package/assets/classDiagram-v2-VYDZK3BY-DUJsEIfw.js +0 -1
  103. package/assets/defaultLocale-DX6XiGOO.js +0 -1
  104. package/assets/diagram-UQ7AKVKN-zw7Uct_H.js +0 -41
  105. package/assets/diagram-VX7I27RA-q44rgp03.js +0 -24
  106. package/assets/ganttDiagram-EL5Y4UJY-_PIGuWrs.js +0 -292
  107. package/assets/init-Gi6I4Gst.js +0 -1
  108. package/assets/layout-CDuOg8Qq.js +0 -1
  109. package/assets/linear-DYRQeDMx.js +0 -1
  110. package/assets/login-CvdKFskG.js +0 -1
  111. package/assets/mermaid.core-3Xq6zKVA.js +0 -310
  112. package/assets/ordinal-Cboi1Yqb.js +0 -1
  113. package/assets/pieDiagram-E7YTZNPT-DPECFdHR.js +0 -39
  114. package/assets/sankeyDiagram-P5KCCOFB-W7cqHKvP.js +0 -40
  115. package/assets/stateDiagram-D77RDMKH-XANTYlIR.js +0 -1
  116. package/assets/stateDiagram-v2-MP3YSRHH-D4PUgzoJ.js +0 -1
  117. package/assets/swimlanesDiagram-VR7AAH4N-CCjpImEw.js +0 -8
  118. package/assets/with-app-layout-l9hNx3ta.js +0 -34
  119. package/assets/xychartDiagram-S5SC5T6Z-WPk9HFyA.js +0 -7
@@ -0,0 +1,7 @@
1
+ import{s as pi,g as mi,o as $t,n as yi,a as bi,b as Ai,_ as n,l as Ut,D as wi,d as Ci,p as Si,y as Tt,i as Ri,A as Gt,B as _i,H as ki,I as Ti,J as Wt}from"./mermaid.core-BJx2V7Fx.js";import{b as Xt,l as Nt}from"./d3-scale-4DPf7zan.js";import"./app-BKhgReUT.js";import"./isObject-DL-BuaBl.js";var St=(function(){var e=n(function(V,r,g,u){for(g=g||{},u=V.length;u--;g[V[u]]=r);return g},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],a=[1,5],h=[1,6],l=[1,7],y=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],p=[1,26],_=[1,28],k=[1,29],P=[1,30],F=[1,31],W=[1,32],v=[1,33],z=[1,34],b=[1,35],T=[1,36],c=[1,37],I=[1,43],O=[1,42],X=[1,47],N=[1,50],S=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],w=[1,65],M=[26,28],R={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:n(function(r,g,u,x,C,o,lt){var f=o.length-1;switch(C){case 5:x.setOrientation(o[f]);break;case 9:x.setDiagramTitle(o[f].text.trim());break;case 12:x.setLineData({text:"",type:"text"},o[f]);break;case 13:x.setLineData(o[f-1],o[f]);break;case 14:x.setBarData({text:"",type:"text"},o[f]);break;case 15:x.setBarData(o[f-1],o[f]);break;case 16:this.$=o[f].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=o[f].trim(),x.setAccDescription(this.$);break;case 19:this.$=o[f-1];break;case 20:case 30:this.$=[o[f-2],...o[f]];break;case 21:case 31:this.$=[o[f]];break;case 22:this.$={value:Number(o[f-1]),label:o[f]};break;case 23:this.$={value:Number(o[f]),label:""};break;case 24:x.setXAxisTitle(o[f]);break;case 25:x.setXAxisTitle(o[f-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(o[f]);break;case 28:x.setXAxisRangeData(Number(o[f-2]),Number(o[f]));break;case 29:this.$=o[f-1];break;case 32:x.setYAxisTitle(o[f]);break;case 33:x.setYAxisTitle(o[f-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(o[f-2]),Number(o[f]));break;case 39:this.$={text:o[f],type:"text"};break;case 40:this.$={text:o[f],type:"text"};break;case 41:this.$={text:o[f],type:"markdown"};break;case 42:this.$=o[f];break;case 43:this.$=o[f-1]+""+o[f];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:a,37:h,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:a,37:h,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:a,37:h,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(y,[2,36]),e(y,[2,37]),e(y,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:a,37:h,38:l}),{1:[2,3]},e(y,[2,5]),e(t,[2,7],{4:22,36:a,37:h,38:l}),{11:23,30:d,39:24,40:p,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:z,49:b,50:T,51:c},{11:39,13:38,24:I,29:O,30:d,31:40,32:41,39:24,40:p,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:z,49:b,50:T,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:p,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:z,49:b,50:T,51:c},{11:49,17:48,24:N,30:d,39:24,40:p,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:z,49:b,50:T,51:c},{11:52,17:51,24:N,30:d,39:24,40:p,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:z,49:b,50:T,51:c},{20:[1,53]},{22:[1,54]},e(S,[2,18]),{1:[2,2]},e(S,[2,8]),e(S,[2,9]),e(H,[2,39],{41:55,42:_,43:k,44:P,45:F,46:W,47:v,48:z,49:b,50:T,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(S,[2,10]),e(S,[2,24],{32:41,31:56,24:I,29:O}),e(S,[2,26]),e(S,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:p,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:z,49:b,50:T,51:c},e(S,[2,11]),e(S,[2,32],{35:60,29:X}),e(S,[2,34]),{33:[1,61]},e(S,[2,12]),{17:62,24:N},{25:63,27:64,29:w},e(S,[2,14]),{17:66,24:N},e(S,[2,16]),e(S,[2,17]),e(A,[2,43]),e(S,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(S,[2,33]),{29:[1,70]},e(S,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(M,[2,23],{30:[1,73]}),e(S,[2,15]),e(S,[2,28]),e(S,[2,29]),{11:59,30:d,34:74,39:24,40:p,41:27,42:_,43:k,44:P,45:F,46:W,47:v,48:z,49:b,50:T,51:c},e(S,[2,35]),e(S,[2,19]),{25:75,27:64,29:w},e(M,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:n(function(r,g){if(g.recoverable)this.trace(r);else{var u=new Error(r);throw u.hash=g,u}},"parseError"),parse:n(function(r){var g=this,u=[0],x=[],C=[null],o=[],lt=this.table,f="",xt=0,zt=0,ui=2,Ot=1,xi=o.slice.call(arguments,1),D=Object.create(this.lexer),$={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&($.yy[bt]=this.yy[bt]);D.setInput(r,$.yy),$.yy.lexer=D,$.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var At=D.yylloc;o.push(At);var di=D.options&&D.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fi(E){u.length=u.length-2*E,C.length=C.length-E,o.length=o.length-E}n(fi,"popStack");function Vt(){var E;return E=x.pop()||D.lex()||Ot,typeof E!="number"&&(E instanceof Array&&(x=E,E=x.pop()),E=g.symbols_[E]||E),E}n(Vt,"lex");for(var L,U,B,wt,j={},dt,Y,Ft,ft;;){if(U=u[u.length-1],this.defaultActions[U]?B=this.defaultActions[U]:((L===null||typeof L>"u")&&(L=Vt()),B=lt[U]&&lt[U][L]),typeof B>"u"||!B.length||!B[0]){var Ct="";ft=[];for(dt in lt[U])this.terminals_[dt]&&dt>ui&&ft.push("'"+this.terminals_[dt]+"'");D.showPosition?Ct="Parse error on line "+(xt+1)+`:
2
+ `+D.showPosition()+`
3
+ Expecting `+ft.join(", ")+", got '"+(this.terminals_[L]||L)+"'":Ct="Parse error on line "+(xt+1)+": Unexpected "+(L==Ot?"end of input":"'"+(this.terminals_[L]||L)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[L]||L,line:D.yylineno,loc:At,expected:ft})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+L);switch(B[0]){case 1:u.push(L),C.push(D.yytext),o.push(D.yylloc),u.push(B[1]),L=null,zt=D.yyleng,f=D.yytext,xt=D.yylineno,At=D.yylloc;break;case 2:if(Y=this.productions_[B[1]][1],j.$=C[C.length-Y],j._$={first_line:o[o.length-(Y||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Y||1)].first_column,last_column:o[o.length-1].last_column},di&&(j._$.range=[o[o.length-(Y||1)].range[0],o[o.length-1].range[1]]),wt=this.performAction.apply(j,[f,zt,xt,$.yy,B[1],C,o].concat(xi)),typeof wt<"u")return wt;Y&&(u=u.slice(0,-1*Y*2),C=C.slice(0,-1*Y),o=o.slice(0,-1*Y)),u.push(this.productions_[B[1]][0]),C.push(j.$),o.push(j._$),Ft=lt[u[u.length-2]][u[u.length-1]],u.push(Ft);break;case 3:return!0}}return!0},"parse")},rt=(function(){var V={EOF:1,parseError:n(function(g,u){if(this.yy.parser)this.yy.parser.parseError(g,u);else throw new Error(g)},"parseError"),setInput:n(function(r,g){return this.yy=g||this.yy||{},this._input=r,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:n(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var g=r.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:n(function(r){var g=r.length,u=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var x=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),u.length-1&&(this.yylineno-=u.length-1);var C=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:u?(u.length===x.length?this.yylloc.first_column:0)+x[x.length-u.length].length-u[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(r){this.unput(this.match.slice(r))},"less"),pastInput:n(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var r=this.pastInput(),g=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
5
+ `+g+"^"},"showPosition"),test_match:n(function(r,g){var u,x,C;if(this.options.backtrack_lexer&&(C={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&&(C.yylloc.range=this.yylloc.range.slice(0))),x=r[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,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(r[0].length),this.matched+=r[0],u=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(var o in C)this[o]=C[o];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,g,u,x;this._more||(this.yytext="",this.match="");for(var C=this._currentRules(),o=0;o<C.length;o++)if(u=this._input.match(this.rules[C[o]]),u&&(!g||u[0].length>g[0].length)){if(g=u,x=o,this.options.backtrack_lexer){if(r=this.test_match(u,C[o]),r!==!1)return r;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(r=this.test_match(g,C[x]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){var g=this.next();return g||this.lex()},"lex"),begin:n(function(g){this.conditionStack.push(g)},"begin"),popState:n(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(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:n(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:n(function(g){this.begin(g)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(g,u,x,C){switch(x){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return V})();R.lexer=rt;function q(){this.yy={}}return n(q,"Parser"),q.prototype=R,R.Parser=q,new q})();St.parser=St;var Di=St;function pt(e){return e.type==="bar"}n(pt,"isBarPlot");function mt(e){return e.type==="band"}n(mt,"isBandAxisData");function Q(e){return e.type==="linear"}n(Q,"isLinearAxisData");var K,Dt=(K=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((h,l)=>Math.max(l.length,h),0)*i,height:i};const s={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const l=Ti(a,1,h),y=l?l.width:h.length*i,d=l?l.height:i;s.width=Math.max(s.width,y),s.height=Math.max(s.height,d)}return a.remove(),s}},n(K,"TextDimensionCalculatorWithFont"),K),Yt=.7,Ht=.2,J,qt=(J=class{constructor(t,i,s,a){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Yt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Yt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=Ht*t.width;this.outerPadding=Math.min(s.width/2,a);let h=s.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(h=Math.max(h,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height))),h+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=Ht*t.height;this.outerPadding=Math.min(s.height/2,a);const h=s.width+this.axisConfig.labelPadding*2;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const i=this.normalizedLabelRotationInRad;return i===0?0:Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},n(J,"BaseAxis"),J),Z,Pi=(Z=class extends qt{constructor(t,i,s,a,h){super(t,a,h,i),this.categories=s,this.scale=Xt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=Xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Ut.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},n(Z,"BandAxis"),Z),tt,Li=(tt=class extends qt{constructor(t,i,s,a,h){super(t,a,h,i),this.domain=s,this.scale=Nt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Nt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},n(tt,"LinearAxis"),tt);function Rt(e,t,i,s){const a=new Dt(s);return mt(e)?new Pi(t,i,e.categories,e.title,a):new Li(t,i,[e.min,e.max],e.title,a)}n(Rt,"getAxis");var it,vi=(it=class{constructor(t,i,s,a){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),a=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=a,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},n(it,"ChartTitle"),it);function jt(e,t,i,s){const a=new Dt(s);return new vi(a,e,t,i)}n(jt,"getChartTitleComponent");var Ei=.75,Ii=.5,Mi=.35;function _t(e){return{fontSize:e,markerSize:e*Ei,markerSpacing:e*Mi,itemSpacing:e*Ii}}n(_t,"getLegendLayout");var et,Bi=(et=class{constructor(t,i,s,a){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(p=>p.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};const{fontSize:i,markerSize:s,markerSpacing:a,itemSpacing:h}=_t(this.chartConfig.legendFontSize),l=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(p=>p.title),i),y=this.chartConfig.legendPadding*2+s+a+l.width,d=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*h;return y<=t.width&&d<=t.height?(this.boundingRect.width=y,this.boundingRect.height=d):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];const{fontSize:t,markerSize:i,markerSpacing:s,itemSpacing:a}=_t(this.chartConfig.legendFontSize),h=t+a,l=this.boundingRect.x+this.chartConfig.legendPadding,y=this.boundingRect.y+this.chartConfig.legendPadding,d=[],p=[];for(const[_,k]of this.visiblePlots.entries())if(pt(k))d.push({x:l,y:y+_*h,width:i,height:i,fill:k.fill,strokeFill:k.fill,strokeWidth:0});else{const P=y+_*h+i/2;p.push({path:`M ${l},${P} L ${l+i},${P}`,strokeFill:k.strokeFill,strokeWidth:k.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:d},{groupTexts:["legend","markers"],type:"path",data:p},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((_,k)=>({text:_.title,x:l+i+s,y:y+k*h+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}},n(et,"ChartLegend"),et);function Qt(e,t,i,s){const a=new Dt(s);return new Bi(a,e,t,i)}n(Qt,"getChartLegendComponent");var st,zi=(st=class{constructor(t,i,s,a,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=a,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(a=>[this.xAxis.getScaleValue(a[0]),this.yAxis.getScaleValue(a[1])]);let i;if(this.orientation==="horizontal"?i=Wt().y(a=>a[0]).x(a=>a[1])(t):i=Wt().x(a=>a[0]).y(a=>a[1])(t),!i)return[];const s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const l=[];for(const[y,[d,p]]of t.entries()){const _=this.plotData.pointLabels[y];_&&(this.orientation==="horizontal"?l.push({x:p+10,y:d,text:_,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):l.push({x:d,y:p-10,text:_,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}l.length>0&&s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:l})}return s}},n(st,"LinePlot"),st),at,Oi=(at=class{constructor(t,i,s,a,h,l){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=a,this.orientation=h,this.plotIndex=l}getDrawableElement(){const t=this.barData.data.map(h=>[this.xAxis.getScaleValue(h[0]),this.yAxis.getScaleValue(h[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(h=>({x:this.boundingRect.x,y:h[0]-a,height:s,width:h[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(h=>({x:h[0]-a,y:h[1],width:s,height:this.boundingRect.y+this.boundingRect.height-h[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},n(at,"BarPlot"),at),nt,Vi=(nt=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const a=new zi(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break;case"bar":{const a=new Oi(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break}return t}},n(nt,"BasePlot"),nt);function Kt(e,t,i){return new Vi(e,t,i)}n(Kt,"getPlotComponent");var ot,Fi=(ot=class{constructor(t,i,s,a){this.chartConfig=t,this.chartData=i,this.componentStore={title:jt(t,i,s,a),plot:Kt(t,i,s),legend:Qt(t,i,s,a),xAxis:Rt(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},a),yAxis:Rt(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,a=0,h={width:0,height:0},l=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),y=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),d=this.componentStore.plot.calculateSpace({width:l,height:y});t-=d.width,i-=d.height,d=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),a=d.height,i-=d.height,this.componentStore.xAxis.setAxisPosition("bottom"),d=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=d.height,this.componentStore.yAxis.setAxisPosition("left"),d=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=d.width,t-=d.width,h=this.componentStore.legend.calculateSpace({width:t,height:y}),t-=h.width,t>0&&(l+=t,t=0),i>0&&(y+=i,i=0),this.componentStore.plot.calculateSpace({width:l,height:y}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.legend.setBoundingBoxXY({x:s+l,y:a+Math.max((y-h.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+l]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:a+y}),this.componentStore.yAxis.setRange([a,a+y]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(p=>pt(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,a=0,h=0,l={width:0,height:0},y=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),d=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:y,height:d});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("left"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=p.width,a=p.width,this.componentStore.yAxis.setAxisPosition("top"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=p.height,h=s+p.height,l=this.componentStore.legend.calculateSpace({width:t,height:d}),t-=l.width,t>0&&(y+=t,t=0),i>0&&(d+=i,i=0),this.componentStore.plot.calculateSpace({width:y,height:d}),this.componentStore.plot.setBoundingBoxXY({x:a,y:h}),this.componentStore.legend.setBoundingBoxXY({x:a+y,y:h+Math.max((d-l.height)/2,0)}),this.componentStore.yAxis.setRange([a,a+y]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:s}),this.componentStore.xAxis.setRange([h,h+d]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(_=>pt(_))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},n(ot,"Orchestrator"),ot),ht,Wi=(ht=class{static build(t,i,s,a){return new Fi(t,i,s,a).getDrawableElement()}},n(ht,"XYChartBuilder"),ht),ct=0,Jt,gt=vt(),ut=Lt(),m=Et(),kt=ut.plotColorPalette.split(",").map(e=>e.trim()),yt=!1,Pt=!1;function Lt(){const e=ki(),t=Tt();return Gt(e.xyChart,t.themeVariables.xyChart)}n(Lt,"getChartDefaultThemeConfig");function vt(){const e=Tt();return Gt(_i.xyChart,e.xyChart)}n(vt,"getChartDefaultConfig");function Et(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n(Et,"getChartDefaultData");function G(e){const t=Tt();return Ri(e.trim(),t)}n(G,"textSanitizer");function Zt(e){Jt=e}n(Zt,"setTmpSVGG");function ti(e){e==="horizontal"?gt.chartOrientation="horizontal":gt.chartOrientation="vertical"}n(ti,"setOrientation");function ii(e){m.xAxis.title=G(e.text)}n(ii,"setXAxisTitle");function It(e,t){m.xAxis={type:"linear",title:m.xAxis.title,min:e,max:t},yt=!0}n(It,"setXAxisRangeData");function ei(e){m.xAxis={type:"band",title:m.xAxis.title,categories:e.map(t=>G(t.text))},yt=!0}n(ei,"setXAxisBand");function si(e){m.yAxis.title=G(e.text)}n(si,"setYAxisTitle");function ai(e,t){m.yAxis={type:"linear",title:m.yAxis.title,min:e,max:t},Pt=!0}n(ai,"setYAxisRangeData");function ni(e){const t=Math.min(...e),i=Math.max(...e),s=Q(m.yAxis)?m.yAxis.min:1/0,a=Q(m.yAxis)?m.yAxis.max:-1/0;m.yAxis={type:"linear",title:m.yAxis.title,min:Math.min(s,t),max:Math.max(a,i)}}n(ni,"setYAxisRangeFromPlotData");function Mt(e){let t=[];if(e.length===0)return t;if(!yt){const i=Q(m.xAxis)?m.xAxis.min:1/0,s=Q(m.xAxis)?m.xAxis.max:-1/0;It(Math.min(i,1),Math.max(s,e.length))}if(mt(m.xAxis)&&e.length>m.xAxis.categories.length&&(e=e.slice(0,m.xAxis.categories.length)),Pt||ni(e),mt(m.xAxis)&&(t=m.xAxis.categories.map((i,s)=>[i,e[s]])),Q(m.xAxis)){const i=m.xAxis.min,s=m.xAxis.max;if(e.length===1)t=[[`${i}`,e[0]]];else{const a=(s-i)/(e.length-1);t=e.map((h,l)=>[`${i+l*a}`,h])}}return t}n(Mt,"transformDataWithoutCategory");function Bt(e){return kt[e===0?0:e%kt.length]}n(Bt,"getPlotColorFromPalette");function oi(e,t){const i=t.map(l=>l.value),s=t.map(l=>l.label?G(l.label):""),a=Mt(i),h=s.some(l=>l!=="");m.plots.push({type:"line",title:G(e.text),strokeFill:Bt(ct),strokeWidth:2,data:a,...h?{pointLabels:s}:{}}),ct++}n(oi,"setLineData");function hi(e,t){const i=t.map(a=>a.value),s=Mt(i);m.plots.push({type:"bar",title:G(e.text),fill:Bt(ct),data:s}),ct++}n(hi,"setBarData");function ri(){if(m.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return m.title=$t(),Wi.build(gt,m,ut,Jt)}n(ri,"getDrawableElem");function li(){return ut}n(li,"getChartThemeConfig");function ci(){return gt}n(ci,"getChartConfig");function gi(){return m}n(gi,"getXYChartData");var Xi=n(function(){Si(),ct=0,gt=vt(),m=Et(),ut=Lt(),kt=ut.plotColorPalette.split(",").map(e=>e.trim()),yt=!1,Pt=!1},"clear"),Ni={getDrawableElem:ri,clear:Xi,setAccTitle:Ai,getAccTitle:bi,setDiagramTitle:yi,getDiagramTitle:$t,getAccDescription:mi,setAccDescription:pi,setOrientation:ti,setXAxisTitle:ii,setXAxisRangeData:It,setXAxisBand:ei,setYAxisTitle:si,setYAxisRangeData:ai,setLineData:oi,setBarData:hi,setTmpSVGG:Zt,getChartThemeConfig:li,getChartConfig:ci,getXYChartData:gi},Yi=n((e,t,i,s)=>{const a=s.db,h=a.getChartThemeConfig(),l=a.getChartConfig(),y=a.getXYChartData().plots[0].data.map(b=>b[1]);function d(b){return b==="top"?"text-before-edge":"middle"}n(d,"getDominantBaseLine");function p(b){return b==="left"?"start":b==="right"?"end":"middle"}n(p,"getTextAnchor");function _(b){return`translate(${b.x}, ${b.y}) rotate(${b.rotation||0})`}n(_,"getTextTransformation"),Ut.debug(`Rendering xychart chart
7
+ `+e);const k=wi(t),P=k.append("g").attr("class","main"),F=P.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");Ci(k,l.height,l.width,!0),k.attr("viewBox",`0 0 ${l.width} ${l.height}`),F.attr("fill",h.backgroundColor),a.setTmpSVGG(k.append("g").attr("class","mermaid-tmp-group"));const W=a.getDrawableElem(),v={};function z(b){let T=P,c="";for(const[I]of b.entries()){let O=P;I>0&&v[c]&&(O=v[c]),c+=b[I],T=v[c],T||(T=v[c]=O.append("g").attr("class",b[I]))}return T}n(z,"getGroup");for(const b of W){if(b.data.length===0)continue;const T=z(b.groupTexts);switch(b.type){case"rect":if(T.selectAll("rect").data(b.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),l.showDataLabel){const c=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let I=function(w,M){const{data:R,label:rt}=w;return M*rt.length*O<=R.width-X};n(I,"fitsHorizontally");const O=.7,X=10,N=b.data.map((w,M)=>({data:w,label:y[M].toString()})).filter(w=>w.data.width>0&&w.data.height>0),S=N.map(w=>{const{data:M}=w;let R=M.height*.7;for(;!I(w,R)&&R>0;)R-=1;return R}),H=Math.floor(Math.min(...S)),A=n(w=>c?w.data.x+w.data.width+X:w.data.x+w.data.width-X,"determineLabelXPosition");T.selectAll("text").data(N).enter().append("text").attr("x",A).attr("y",w=>w.data.y+w.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",h.dataLabelColor).attr("font-size",`${H}px`).text(w=>w.label)}else{let I=function(A,w,M){const{data:R,label:rt}=A,V=w*rt.length*.7,r=R.x+R.width/2,g=r-V/2,u=r+V/2,x=g>=R.x&&u<=R.x+R.width,C=R.y+M+w<=R.y+R.height;return x&&C};n(I,"fitsInBar");const O=10,X=b.data.map((A,w)=>({data:A,label:y[w].toString()})).filter(A=>A.data.width>0&&A.data.height>0),N=X.map(A=>{const{data:w,label:M}=A;let R=w.width/(M.length*.7);for(;!I(A,R,O)&&R>0;)R-=1;return R}),S=Math.floor(Math.min(...N)),H=n(A=>c?A.data.y-O:A.data.y+O,"determineLabelYPosition");T.selectAll("text").data(X).enter().append("text").attr("x",A=>A.data.x+A.data.width/2).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",h.dataLabelColor).attr("font-size",`${S}px`).text(A=>A.label)}}break;case"text":T.selectAll("text").data(b.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>d(c.verticalPos)).attr("text-anchor",c=>p(c.horizontalPos)).attr("transform",c=>_(c)).text(c=>c.text);break;case"path":T.selectAll("path").data(b.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),Hi={draw:Yi},ji={parser:Di,db:Ni,renderer:Hi};export{ji as diagram};
@@ -2,6 +2,7 @@ import { ControllerHelper } from "../helpers/controllerHelper.js";
2
2
  import { DataAccessor } from "../lib/DataAccessor.js";
3
3
  import { ListQueryBuilder } from "../lib/list-query-builder/ListQueryBuilder.js";
4
4
  import { Adminizer } from "../lib/Adminizer.js";
5
+ import { getVisibleFields } from "../helpers/fieldsHelper.js";
5
6
  import { FilterService } from "../lib/filters/FilterService.js";
6
7
  import { convertDatetimeConditions } from "../helpers/filterDatetimeHelper.js";
7
8
  /**
@@ -53,16 +54,15 @@ export default async function exportData(req, res) {
53
54
  return res.status(500).json({ error: 'Error loading filter' });
54
55
  }
55
56
  }
56
- // Determine fields to export
57
- let displayFields = fields;
57
+ // Determine fields to export: hidden fields (visible: false) are never exported
58
+ const exportableFields = getVisibleFields(fields);
59
+ let displayFields = exportableFields;
58
60
  // Apply selected fields from request body
59
61
  if (bodySelectedFields && Array.isArray(bodySelectedFields) && bodySelectedFields.length > 0) {
60
- const validFields = bodySelectedFields.filter(f => fields[f]);
62
+ const validFields = bodySelectedFields.filter(f => exportableFields[f]);
61
63
  if (validFields.length > 0) {
62
64
  displayFields = validFields.reduce((acc, key) => {
63
- if (fields[key]) {
64
- acc[key] = fields[key];
65
- }
65
+ acc[key] = exportableFields[key];
66
66
  return acc;
67
67
  }, {});
68
68
  }
@@ -3,6 +3,7 @@ import { DataAccessor } from "../lib/DataAccessor.js";
3
3
  import { ListQueryBuilder } from "../lib/list-query-builder/ListQueryBuilder.js";
4
4
  import { Adminizer } from "../lib/Adminizer.js";
5
5
  import { inertiaListHelper } from "../helpers/inertiaListHelper.js";
6
+ import { getVisibleFields } from "../helpers/fieldsHelper.js";
6
7
  import { FilterService } from "../lib/filters/FilterService.js";
7
8
  import { convertDatetimeConditions } from "../helpers/filterDatetimeHelper.js";
8
9
  import { getUiTranslations } from "../lib/ui-i18n/getUiTranslations.js";
@@ -273,16 +274,6 @@ function applyCustomColumns(fields, columns) {
273
274
  }
274
275
  return result;
275
276
  }
276
- function getVisibleFields(fields) {
277
- return Object.entries(fields).reduce((result, [key, field]) => {
278
- const config = field?.config;
279
- if (config?.visible === false) {
280
- return result;
281
- }
282
- result[key] = field;
283
- return result;
284
- }, {});
285
- }
286
277
  /**
287
278
  * Get field name by column index
288
279
  */
@@ -1 +1 @@
1
- export default function login(req: ReqType, res: ResType): Promise<void | (import("express-session").Session & Partial<import("express-session").SessionData> & reqSession) | ResType>;
1
+ export default function login(req: ReqType, res: ResType): Promise<void | ResType>;
@@ -3,7 +3,8 @@ import passwordHash from "password-hash";
3
3
  import { inertiaLoginHelper } from "../helpers/inertiaAutHelper.js";
4
4
  import { Adminizer } from "../lib/Adminizer.js";
5
5
  import { signUser } from "../lib/helper/jwt.js";
6
- import { serialize } from "cookie";
6
+ import { clearPretendedUserId, setPretendedUserId } from "../lib/helper/pretend.js";
7
+ import { parse, serialize } from "cookie";
7
8
  export default async function login(req, res) {
8
9
  const powCaptcha = new POWCaptcha();
9
10
  if (req.originalUrl.indexOf("login") >= 0) {
@@ -23,23 +24,23 @@ export default async function login(req, res) {
23
24
  return res.status(500).send({ error: e.message || 'Internal Server Error' });
24
25
  }
25
26
  if (req.body.pretend) {
26
- if (!user) {
27
+ // Checked before the lookup result, so a non-administrator cannot probe logins.
28
+ // While pretending, req.user is the pretended user: pretending further
29
+ // is only possible if that user is an administrator too.
30
+ const authToken = parse(req.headers.cookie || '').adminizer_jwt;
31
+ if (!authToken || !req.user || !req.user.isAdministrator) {
32
+ return res.sendStatus(403);
33
+ }
34
+ if (!user || user.id === undefined) {
27
35
  return res.sendStatus(404);
28
36
  }
29
- if (!req.user.isAdministrator) {
30
- return res.sendStatus(403);
37
+ // Marked on the server against this token; see lib/helper/pretend.
38
+ setPretendedUserId(authToken, user.id);
39
+ // Force full page reload after pretend
40
+ if (req.headers['x-inertia']) {
41
+ return res.writeHead(409, { 'x-inertia-location': `${req.adminizer.config.routePrefix}/` }).end();
31
42
  }
32
- req.session.userPretended = user;
33
- return req.session.save((err) => {
34
- if (err) {
35
- return res.status(500).send({ error: 'Session save failed' });
36
- }
37
- // Force full page reload after pretend
38
- if (req.headers['x-inertia']) {
39
- return res.writeHead(409, { 'x-inertia-location': `${req.adminizer.config.routePrefix}/` }).end();
40
- }
41
- return res.redirect(`${req.adminizer.config.routePrefix}/`);
42
- });
43
+ return res.redirect(`${req.adminizer.config.routePrefix}/`);
43
44
  }
44
45
  // Verify CAPTCHA solution if enabled
45
46
  if (req.adminizer.config.auth.captcha !== false) {
@@ -105,8 +106,8 @@ export default async function login(req, res) {
105
106
  }
106
107
  }
107
108
  else if (req.originalUrl.indexOf("logout") >= 0) {
108
- if (req.session.userPretended && req.session.userPretended.id && req.user && req.user.id) {
109
- delete (req.session.userPretended);
109
+ // Logout while pretending only drops the mark: back to the administrator.
110
+ if (clearPretendedUserId(parse(req.headers.cookie || '').adminizer_jwt)) {
110
111
  // Force full page reload after unpretend
111
112
  if (req.headers['x-inertia']) {
112
113
  return res.writeHead(409, { 'x-inertia-location': `${req.adminizer.config.routePrefix}/` }).end();
@@ -21,6 +21,8 @@ export type Field = {
21
21
  export type Fields = {
22
22
  [key: string]: Field;
23
23
  };
24
+ /** Fields without the ones hidden with `visible: false`: those never leave the server. */
25
+ export declare function getVisibleFields(fields: Fields): Fields;
24
26
  export declare class FieldsHelper {
25
27
  /**
26
28
  * Load list of records for all associations into `fields`
@@ -1,6 +1,17 @@
1
1
  import { DataAccessor } from "../lib/DataAccessor.js";
2
2
  import { RecordAccessCache } from "../lib/access-graph/RecordAccessCache.js";
3
3
  import { Adminizer } from "../lib/Adminizer.js";
4
+ /** Fields without the ones hidden with `visible: false`: those never leave the server. */
5
+ export function getVisibleFields(fields) {
6
+ return Object.entries(fields).reduce((result, [key, field]) => {
7
+ const config = field?.config;
8
+ if (config?.visible === false) {
9
+ return result;
10
+ }
11
+ result[key] = field;
12
+ return result;
13
+ }, {});
14
+ }
4
15
  export class FieldsHelper {
5
16
  /**
6
17
  * Load list of records for all associations into `fields`
@@ -44,7 +44,6 @@ declare global {
44
44
  flashMessages: Record<string, string[]>;
45
45
  xInertiaCurrentComponent: string | undefined;
46
46
  User: User;
47
- userPretended?: User;
48
47
  };
49
48
  type FlashMessages = 'info' | 'error' | 'success' | string;
50
49
  type ReqType = Request & {
@@ -0,0 +1,4 @@
1
+ export declare function setPretendedUserId(token: string, userId: number): void;
2
+ export declare function getPretendedUserId(token: string | undefined): number | undefined;
3
+ /** Returns whether the token was pretending. */
4
+ export declare function clearPretendedUserId(token: string | undefined): boolean;
@@ -0,0 +1,27 @@
1
+ import { createHash } from "crypto";
2
+ /**
3
+ * "Pretend to be a user": which auth token is currently acting as which user.
4
+ *
5
+ * Kept in a variable of the process on purpose, not in the session: the session cookie
6
+ * is not issued behind a proxy that terminates https, so a session lives for one request
7
+ * there. The price is that the mark is gone after a restart (the administrator is simply
8
+ * back under their own account) and is not shared between several workers.
9
+ *
10
+ * Keyed by the token, not by the administrator: pretending in one browser must not
11
+ * switch the other logins of the same administrator.
12
+ */
13
+ const pretendedByToken = new Map();
14
+ /** The token itself is not kept in memory, only its digest. */
15
+ function keyOf(token) {
16
+ return createHash("sha256").update(token).digest("hex");
17
+ }
18
+ export function setPretendedUserId(token, userId) {
19
+ pretendedByToken.set(keyOf(token), userId);
20
+ }
21
+ export function getPretendedUserId(token) {
22
+ return token ? pretendedByToken.get(keyOf(token)) : undefined;
23
+ }
24
+ /** Returns whether the token was pretending. */
25
+ export function clearPretendedUserId(token) {
26
+ return token ? pretendedByToken.delete(keyOf(token)) : false;
27
+ }
@@ -106,6 +106,10 @@ export declare class ListQueryBuilder {
106
106
  private sanitizeSortDirection;
107
107
  /**
108
108
  * Map data for output
109
+ *
110
+ * Only the fields the caller asked for (params.fields) or, by default, the
111
+ * visible ones reach the rows: rows end up in the page HTML, and a field
112
+ * hidden with `visible: false` (the password hash of User) must not leak there.
109
113
  */
110
114
  private mapData;
111
115
  private buildSelect;
@@ -60,7 +60,7 @@ export class ListQueryBuilder {
60
60
  this.model.count({ where: whereClause }, this.dataAccessor)
61
61
  ]);
62
62
  return {
63
- data: this.mapData(data),
63
+ data: this.mapData(data, params.fields),
64
64
  total,
65
65
  filtered,
66
66
  page: params.page,
@@ -602,16 +602,23 @@ export class ListQueryBuilder {
602
602
  }
603
603
  /**
604
604
  * Map data for output
605
+ *
606
+ * Only the fields the caller asked for (params.fields) or, by default, the
607
+ * visible ones reach the rows: rows end up in the page HTML, and a field
608
+ * hidden with `visible: false` (the password hash of User) must not leak there.
605
609
  */
606
- mapData(data) {
610
+ mapData(data, requestedFields) {
607
611
  const out = [];
612
+ const outputFields = requestedFields?.length
613
+ ? requestedFields.filter((key) => key in this.fields)
614
+ : Object.keys(this.fields).filter((key) => this.fields[key].config?.visible !== false);
608
615
  data.forEach((elem) => {
609
616
  const row = {};
610
617
  // Add primary key first
611
618
  const pk = this.model.primaryKey ?? 'id';
612
619
  row[pk] = elem[pk];
613
620
  // Process each field
614
- Object.keys(this.fields).forEach((key) => {
621
+ outputFields.forEach((key) => {
615
622
  const fieldConfig = this.fields[key].config;
616
623
  const fieldModel = this.fields[key].model;
617
624
  const modelConfig = this.fields[key].modelConfig;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adminizer",
3
3
  "type": "module",
4
- "version": "5.2.0-build.32",
4
+ "version": "5.2.0-build.34",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",
@@ -1,6 +1,7 @@
1
1
  import { Adminizer } from "../lib/Adminizer.js";
2
2
  import { DataAccessor } from "../lib/DataAccessor.js";
3
3
  import { ListQueryBuilder } from "../lib/list-query-builder/ListQueryBuilder.js";
4
+ import { getVisibleFields } from "../helpers/fieldsHelper.js";
4
5
  import { ControllerHelper } from "../helpers/controllerHelper.js";
5
6
  import { convertDatetimeConditions } from "../helpers/filterDatetimeHelper.js";
6
7
  /**
@@ -48,12 +49,18 @@ export class FeedService {
48
49
  if (!modelResource || !modelResource.model || !modelResource.model.attributes) {
49
50
  throw new Error(`Model '${modelName}' not found`);
50
51
  }
51
- // Build fields directly from model attributes (bypass permission checks for public API)
52
- const fields = this.buildFieldsFromAttributes(modelResource.model.attributes, modelResource.config?.fields || {}, adminizerInstance);
53
- // Use saved columns if available
54
- let displayFields = fields;
52
+ // Build fields directly from model attributes (bypass permission checks for public API).
53
+ // The list config goes on top, as in the list itself: it is where fields get hidden.
54
+ const listFieldsConfig = ControllerHelper.findActionConfig(modelResource, "list").fields || {};
55
+ const fieldsConfig = { ...modelResource.config?.fields };
56
+ for (const [key, config] of Object.entries(listFieldsConfig)) {
57
+ fieldsConfig[key] = { ...fieldsConfig[key], ...config };
58
+ }
59
+ const fields = this.buildFieldsFromAttributes(modelResource.model.attributes, fieldsConfig, adminizerInstance);
60
+ // Hidden fields (visible: false) never reach the feed; use saved columns if available
61
+ let displayFields = getVisibleFields(fields);
55
62
  if (filter.columns && filter.columns.length > 0) {
56
- displayFields = this.applyCustomColumns(fields, filter.columns);
63
+ displayFields = this.applyCustomColumns(displayFields, filter.columns);
57
64
  }
58
65
  // Convert datetime conditions (same as exportData.ts)
59
66
  const rawConditions = filter.conditions || [];
@@ -177,7 +177,7 @@ export function bindInertia(adminizer) {
177
177
  }
178
178
  req.Inertia.shareProps({
179
179
  auth: {
180
- user: toPublicUser(req.session.userPretended ?? req.user)
180
+ user: toPublicUser(req.user)
181
181
  },
182
182
  routePrefix: req.adminizer.config.routePrefix,
183
183
  i18n: {
@@ -2,6 +2,7 @@ import { Adminizer } from "../lib/Adminizer.js";
2
2
  import { I18n } from "../lib/I18n.js";
3
3
  import { parse } from "cookie";
4
4
  import { verifyUser } from "../lib/helper/jwt.js";
5
+ import { getPretendedUserId } from "../lib/helper/pretend.js";
5
6
  const ADMINIZER_REQUEST_DEPRECATION_MESSAGE = "req.adminizer is deprecated and will no longer be available starting with Adminizer v6. Use req.runtime instead.";
6
7
  export function createDeprecatedAdminizerProxy(adminizer, warn = (message) => Adminizer.log.warn(message)) {
7
8
  let warned = false;
@@ -64,12 +65,20 @@ export default function bindReqFunctions(adminizer) {
64
65
  const user = verifyUser(token, adminizer.jwtSecret);
65
66
  if (user) {
66
67
  // Load user with groups (Sequelize adapter auto-populates associations in _findOne)
67
- req.user = await adminizer.modelHandler.internal("auth").get("User").findOne({ where: { id: user.id } });
68
+ const userModel = adminizer.modelHandler.internal("auth").get("User");
69
+ req.user = await userModel.findOne({ where: { id: user.id } });
70
+ // "Pretend to be a user": this token may be marked as acting as another user.
71
+ // Both users are read from the database on every request, so the mark stops
72
+ // working as soon as the administrator loses the flag or the user is removed.
73
+ const pretendedUserId = getPretendedUserId(token);
74
+ if (pretendedUserId !== undefined && req.user?.isAdministrator) {
75
+ const pretended = await userModel.findOne({ where: { id: pretendedUserId } });
76
+ if (pretended) {
77
+ req.user = pretended;
78
+ }
79
+ }
68
80
  }
69
81
  }
70
- if (req.session.userPretended) {
71
- req.user = req.session.userPretended;
72
- }
73
82
  if (typeof adminizer.config.translation !== "boolean" && req.i18n?.setLocale) {
74
83
  const configuredLocales = adminizer.config.translation?.locales || [];
75
84
  const normalizeLocale = (value) => {
@@ -87,6 +87,7 @@ let adminpanelConfig = {
87
87
  id: { visible: false },
88
88
  email: { visible: false },
89
89
  passwordHashed: { visible: false },
90
+ apiKey: { visible: false },
90
91
  timezone: { visible: false },
91
92
  locale: { visible: false },
92
93
  isDeleted: { visible: false },