@ytsaurus/ui 3.4.0 → 3.4.1

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 (35) hide show
  1. package/dist/public/build/assets-manifest.json +21 -21
  2. package/dist/public/build/css/3132.43311d48.chunk.css +2 -0
  3. package/dist/public/build/css/3132.43311d48.chunk.css.map +1 -0
  4. package/dist/public/build/css/590.6f40b178.chunk.css +2 -0
  5. package/dist/public/build/css/590.6f40b178.chunk.css.map +1 -0
  6. package/dist/public/build/css/scheduling.8b8a192b.chunk.css +2 -0
  7. package/dist/public/build/css/scheduling.8b8a192b.chunk.css.map +1 -0
  8. package/dist/public/build/js/887.d8e107dc.chunk.js +2 -0
  9. package/dist/public/build/js/887.d8e107dc.chunk.js.map +1 -0
  10. package/dist/public/build/js/{cluster-page-wrapper.98d8905c.chunk.js → cluster-page-wrapper.84f72ceb.chunk.js} +2 -2
  11. package/dist/public/build/js/{cluster-page-wrapper.98d8905c.chunk.js.map → cluster-page-wrapper.84f72ceb.chunk.js.map} +1 -1
  12. package/dist/public/build/js/main.d91d7090.js +3 -0
  13. package/dist/public/build/js/main.d91d7090.js.map +1 -0
  14. package/dist/public/build/js/{navigation.c35bb543.chunk.js → navigation.9b4e0429.chunk.js} +2 -2
  15. package/dist/public/build/js/navigation.9b4e0429.chunk.js.map +1 -0
  16. package/dist/public/build/js/{runtime.9aefe6d7.js → runtime.93a1fc00.js} +2 -2
  17. package/dist/public/build/js/{runtime.9aefe6d7.js.map → runtime.93a1fc00.js.map} +1 -1
  18. package/dist/public/build/js/scheduling.943b1602.chunk.js +2 -0
  19. package/dist/public/build/js/scheduling.943b1602.chunk.js.map +1 -0
  20. package/dist/public/build/manifest.json +18 -18
  21. package/package.json +5 -5
  22. package/dist/public/build/css/3132.62cd9c06.chunk.css +0 -2
  23. package/dist/public/build/css/3132.62cd9c06.chunk.css.map +0 -1
  24. package/dist/public/build/css/590.1d7b27ca.chunk.css +0 -2
  25. package/dist/public/build/css/590.1d7b27ca.chunk.css.map +0 -1
  26. package/dist/public/build/css/scheduling.f5b832cf.chunk.css +0 -2
  27. package/dist/public/build/css/scheduling.f5b832cf.chunk.css.map +0 -1
  28. package/dist/public/build/js/887.7bbb21d6.chunk.js +0 -2
  29. package/dist/public/build/js/887.7bbb21d6.chunk.js.map +0 -1
  30. package/dist/public/build/js/main.7226048e.js +0 -3
  31. package/dist/public/build/js/main.7226048e.js.map +0 -1
  32. package/dist/public/build/js/navigation.c35bb543.chunk.js.map +0 -1
  33. package/dist/public/build/js/scheduling.3fff0b4f.chunk.js +0 -2
  34. package/dist/public/build/js/scheduling.3fff0b4f.chunk.js.map +0 -1
  35. /package/dist/public/build/js/{main.7226048e.js.LICENSE.txt → main.d91d7090.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_ytsaurus_ui=self.webpackChunk_ytsaurus_ui||[]).push([[1069],{523:(e,t,n)=>{n.d(t,{L:()=>c}),n(77810);var r=n(1335),o=n(45760),a=n(39702),i=n(40319),s=n(64922);const u=function(e){return(0,s.jsx)("svg",(0,i.A)((0,i.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,s.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.47 10.97a.75.75 0 1 0 1.06 1.06l3.5-3.5a.75.75 0 0 0 0-1.06l-3.5-3.5a.75.75 0 0 0-1.06 1.06L6.44 8zm5 0a.75.75 0 1 0 1.06 1.06l3.5-3.5a.75.75 0 0 0 0-1.06l-3.5-3.5a.75.75 0 0 0-1.06 1.06L11.44 8z",clipRule:"evenodd"})}))};var l=(0,n(76872).A)("yt-expanded-button"),c=function(e){var t=e.className,n=e.expanded,i=e.inline,c=e.toggleExpanded,d=e.all,p=e.showText,m=e.qa,h=d?"Collapse All":"Collapse",f=d?"Expand All":"Expand";return(0,s.jsxs)(r.$,{className:l({inline:i},t),view:"flat-secondary",title:n?h:f,onClick:c,qa:m,children:[p&&(n?h:f)+" ",(0,s.jsx)(o.I,{className:l("expand",{expanded:n}),data:d?u:a.A,size:16})]})}},6803:(e,t,n)=>{n.d(t,{$L:()=>l,Ec:()=>o,Fv:()=>s,Gn:()=>i,Nh:()=>r,PW:()=>u,n2:()=>a});var r=function(e){return e.aclFilters.approversSubject},o=function(e){return e.aclFilters.objectSubject},a=function(e){return e.aclFilters.objectPermissions},i=function(e){return e.aclFilters.columnsFilter},s=function(e){return e.aclFilters.columnGroupNameFilter},u=function(e){return e.aclFilters.expandedSubjects},l=function(e){return e.aclFilters.aclCurrentTab}},13616:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(77810);const o=e=>r.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.199 2H8.8a.2.2 0 0 1 .2.2c0 1.808 1.958 2.939 3.524 2.034a.2.2 0 0 1 .271.073l.802 1.388a.2.2 0 0 1-.073.272c-1.566.904-1.566 3.164 0 4.069a.2.2 0 0 1 .073.271l-.802 1.388a.2.2 0 0 1-.271.073C10.958 10.863 9 11.993 9 13.8a.2.2 0 0 1-.199.2H7.2a.2.2 0 0 1-.2-.2c0-1.808-1.958-2.938-3.524-2.034a.2.2 0 0 1-.272-.073l-.8-1.388a.2.2 0 0 1 .072-.271c1.566-.905 1.566-3.165 0-4.07a.2.2 0 0 1-.073-.27l.801-1.389a.2.2 0 0 1 .272-.072C5.042 5.138 7 4.007 7 2.199c0-.11.089-.199.199-.199M5.5 2.2c0-.94.76-1.7 1.699-1.7H8.8c.94 0 1.7.76 1.7 1.7a.85.85 0 0 0 1.274.735 1.7 1.7 0 0 1 2.32.622l.802 1.388c.469.813.19 1.851-.622 2.32a.85.85 0 0 0 0 1.472 1.7 1.7 0 0 1 .622 2.32l-.802 1.388a1.7 1.7 0 0 1-2.32.622.85.85 0 0 0-1.274.735c0 .939-.76 1.7-1.699 1.7H7.2a1.7 1.7 0 0 1-1.699-1.7.85.85 0 0 0-1.274-.735 1.7 1.7 0 0 1-2.32-.622l-.802-1.388a1.7 1.7 0 0 1 .622-2.32.85.85 0 0 0 0-1.471 1.7 1.7 0 0 1-.622-2.32l.801-1.389a1.7 1.7 0 0 1 2.32-.622A.85.85 0 0 0 5.5 2.2m4 5.8a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0",clipRule:"evenodd"}))},14242:(e,t,n)=>{n.d(t,{p0:()=>i,wY:()=>s});var r=n(39760),o=n.n(r),a=n(18472),i=function(e){return e.scheduling.createPoolDialog.error},s=(0,a.Mz)([function(e){return e.scheduling.createPoolDialog.treeItems},function(e){return e.scheduling.createPoolDialog.currentTree}],(function(e,t){return{sortedFlatTree:u([],e).sort(),treeName:t}}));function u(e,t){return o()(t,(function(t,n){e.push(n),u(e,t)})),e}},17271:(e,t,n)=>{n.d(t,{W9:()=>w,Ay:()=>j,Fl:()=>b,$x:()=>A});var r=n(40319),o=n(18801),a=n(29121),i=n(12937),s=n(66134),u=n(10785),l=n(77810),c=n(76872),d=n(69764),p=n(19410),m=n(73822),h=n(22269),f=n(26264),v=n(64922),g=["value","onChange","min","max","validator","format","defaultValue"],x=["value","error","onChange"],y=(0,c.A)("yt-number-input");function A(e,t){if(""!==e){var n=e.replace(/\s/g,"");return"Bytes"===t?(0,h.z)(n):Number(n)}}function b(e,t,n){if(void 0===e)return"";var r="Bytes"===t?m.A.format.Bytes(e,n):m.A.format.Number(e,n);return r===m.A.format.NO_VALUE?"":r}function _(e){return void 0===e?"":e}var w=function(e){function t(){var e;(0,a.A)(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=(0,s.A)(this,t,[].concat(r))).state={parsedValue:NaN},e.onChange=function(n){var r=e.parseValue(n),o=t.errorFromValue(r,e.props),a=e.format(null==r?void 0:r.value);e.setState({parsedValue:null==r?void 0:r.value,parsedError:o,rawValue:n,formattedValue:a}),(0,e.props.onChange)({value:null==r?void 0:r.value,error:o})},e.onBlur=function(){e.setState({focused:!1})},e.onFocus=function(){e.setState({focused:!0})},e.onKeyDown=function(t){t.keyCode===f.DD.ENTER&&e.props.onEnterKeyDown&&e.props.onEnterKeyDown()},e}return(0,u.A)(t,e),(0,i.A)(t,[{key:"parseValue",value:function(e){return this.props.parseFn?this.props.parseFn(e):{value:A(e,this.props.format)}}},{key:"format",value:function(e){var t=this.props,n=t.format,r=t.decimalPlaces,o=t.formatFn;return o?o(e):b(e,n,{digits:r})}},{key:"getRestProps",value:function(){var e=this.props;return e.value,e.onChange,e.min,e.max,e.validator,e.format,e.defaultValue,(0,o.A)(e,g)}},{key:"renderMinMaxHint",value:function(){var e=this.props,t=e.min,n=e.max,r=e.showHint,o=e.size,a=!isNaN(t),i=!isNaN(n);return r&&(a||i)?(0,v.jsxs)("div",{className:y("hint",{size:o}),children:[a&&(0,v.jsxs)(p.m,{content:String(t),placement:"bottom",children:["min: ",(0,v.jsx)("b",{children:this.format(t)})]}),a&&(0,v.jsx)(v.Fragment,{children:"   "}),i&&(0,v.jsxs)(p.m,{content:String(n),placement:"bottom",children:["max: ",(0,v.jsx)("b",{children:this.format(n)})]})]}):null}},{key:"renderPrettyValue",value:function(){var e=this.props,t=e.size,n=e.hidePrettyValue,r=this.state.formattedValue;return n?null:(0,v.jsxs)("div",{className:y("pretty-value",{size:t}),children:[r," "]})}},{key:"renderDefaultValue",value:function(){var e=this.props,t=e.defaultValue,n=e.defaultValueClassName;return(0,v.jsx)(d.k,{disabled:!0,className:n,value:this.format(t),pin:"clear-round"})}},{key:"isBottomLineVisible",value:function(){var e=this.props.bottomLineVisibility,t=this.state.focused;return"visible"===e||t&&"focused"===e}},{key:"render",value:function(){var e=this.props,t=e.value,n=e.className,o=e.showHint,a=e.hidePrettyValue,i=e.showDefaultValue,s=this.state,u=s.parsedError,c=s.rawValue,p=s.formattedValue,m=s.focused,h=this.getRestProps(),f=h.size,g=h.view,x=h.hasClear,A=(null!=t?t:{}).error||u,b=m?c:p;return(0,v.jsxs)("div",{className:y(null,n),children:[(0,v.jsxs)("div",{className:y("top"),children:[(0,v.jsx)(d.k,(0,r.A)((0,r.A)({},h),{},{error:A,autoComplete:!1,onUpdate:this.onChange,onKeyDown:this.onKeyDown,hasClear:x,value:b,size:f,view:g,onBlur:this.onBlur,onFocus:this.onFocus,pin:i?"round-brick":void 0})),i&&this.renderDefaultValue()]}),!A&&this.isBottomLineVisible()&&(0,v.jsx)(l.Fragment,{children:!o||m&&!a?this.renderPrettyValue():this.renderMinMaxHint()})]})}}],[{key:"getDerivedStateFromProps",value:function(e,n){var r=e.value,o=e.format,a=e.preciseInitialRawValue,i=e.decimalPlaces,s=e.formatFn;if(void 0===n.rawValue){var u=s?s(null==r?void 0:r.value):b(null==r?void 0:r.value,o,{digits:i});return{parsedValue:null==r?void 0:r.value,parsedError:t.errorFromValue(r,e),rawValue:a?_(null==r?void 0:r.value):u,formattedValue:u}}return null}},{key:"errorFromValue",value:function(e,t){var n=t.validator,r=void 0===n?function(){}:n,o=t.min,a=t.max,i=t.integerOnly,s=e||{},u=s.value,l=s.error;if(l)return l;if(null!=u){try{if(isNaN(u))return"wrong format";var c=r(u);if(c)return c}catch(l){return String(l)}return i&&u%1!=0?"The value must be an integer":void 0!==o&&u<o?"The value must be ≥ ".concat(o):void 0!==a&&u>a?"The value must be ≤ ".concat(a):void 0}}}])}(l.Component);w.defaultProps={size:"m",view:"normal",hasClear:!0,bottomLineVisibility:"visible"};var j=function(e){function t(){var e;(0,a.A)(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=(0,s.A)(this,t,[].concat(r))).onChange=function(t){e.props.onChange(null==t?void 0:t.value)},e}return(0,u.A)(t,e),(0,i.A)(t,[{key:"render",value:function(){var e=this.props,t=e.value,n=e.error,a=(e.onChange,(0,o.A)(e,x));return(0,v.jsx)(w,(0,r.A)((0,r.A)({},a),{},{onChange:this.onChange,value:{value:t,error:n}}))}}],[{key:"format",value:function(e,t,n){return b(e,t,n)}}])}(l.Component)},20361:(e,t,n)=>{n.d(t,{J_:()=>x,Vm:()=>N,yz:()=>k,yZ:()=>C,lN:()=>_.lN,Y:()=>y,Ln:()=>b,D7:()=>_.D7,ps:()=>_.ps});var r=n(53775),o=n(28407),a=n(77810),i=n(33882),s=n(40319),u=n(9736),l=n(64922),c=n(68175),d=n(76872),p=n(54736),m=n(29347),h=n.n(m),f=n(27528),v=n.n(f),g=(0,d.A)("yt-dialog-error");function x(e){return(0,l.jsx)(p.z,(0,s.A)((0,s.A)({},e),{},{className:g()}))}function y(e){return h()(v()(e,(function(e,t){return e?{name:"error_".concat(t),type:"block",extras:{children:(0,l.jsx)(x,{error:e})}}:void 0})))}var A="FINAL_FORM/form-error";function b(e){return{validationErrors:(0,c.A)({},A,(0,l.jsx)(x,{error:e}))}}var _=n(67249);function w(){return Promise.all([n.e(8096),n.e(4428),n.e(5473),n.e(4724),n.e(9143),n.e(6030),n.e(1086),n.e(164),n.e(840),n.e(7422),n.e(2640),n.e(2209),n.e(2642),n.e(6756),n.e(3776),n.e(3536),n.e(937),n.e(9641),n.e(536),n.e(3320),n.e(7999),n.e(5423),n.e(827),n.e(2433),n.e(1051),n.e(8512),n.e(7315),n.e(3688),n.e(3559),n.e(5338),n.e(6680),n.e(5082),n.e(2947),n.e(3676),n.e(193),n.e(8992),n.e(2736)]).then(n.bind(n,8191))}var j,C=(j=(0,i.A)(a.lazy((0,o.A)((0,r.A)().mark((function e(){return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w();case 2:return e.t0=e.sent.YTDialog,e.abrupt("return",{default:e.t0});case 4:case"end":return e.stop()}}),e)})))),""),function(e){var t=a.useState(!1),n=(0,u.A)(t,2),r=n[0],o=n[1];return a.useEffect((function(){!r&&e.visible&&o(!0)}),[e.visible,r]),r?(0,l.jsx)(j,(0,s.A)({},e)):null});(0,i.A)(a.lazy((0,o.A)((0,r.A)().mark((function e(){return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w();case 2:return e.t0=e.sent.RoleListControl,e.abrupt("return",{default:e.t0});case 4:case"end":return e.stop()}}),e)})))),"");var N=(0,i.A)(a.lazy((0,o.A)((0,r.A)().mark((function e(){return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w();case 2:return e.t0=e.sent.EditableList,e.abrupt("return",{default:e.t0});case 4:case"end":return e.stop()}}),e)})))),""),k=(0,i.A)(a.lazy((0,o.A)((0,r.A)().mark((function e(){return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,w();case 2:return e.t0=e.sent.TabFieldVertical,e.abrupt("return",{default:e.t0});case 4:case"end":return e.stop()}}),e)})))),"")},22269:(e,t,n)=>{n.d(t,{z:()=>a});var r=n(49339),o=n.n(r);function a(e){var t=["B","K","M","G","T","P","E"],n=new RegExp("^((\\d*[.])?\\d+)( *["+t.join("")+"])(iB)?(/s)?$","i");if(n.test(e)){var r=e.match(n),a=r[1],i=r[3].trim(),s=o()(t,(function(e){return e.toUpperCase()===i.toUpperCase()}));return Math.floor(Number(a)*Math.pow(2,10*s))}return Math.floor(Number(e))}},26777:(e,t,n)=>{n.d(t,{BZ:()=>S,D1:()=>L,Gy:()=>R,N8:()=>F,O6:()=>O,Rh:()=>V,Sz:()=>q,VS:()=>G,Y:()=>M,Zb:()=>I,o6:()=>T,u_:()=>E,w8:()=>P});var r=n(70353),o=n(53775),a=n(9736),i=n(28407),s=n(40319),u=n(13322),l=n(3009),c=n.n(l),d=n(39760),p=n.n(d),m=n(31470),h=n.n(m),f=n(96843),v=n.n(f),g=n(27528),x=n.n(g),y=n(90636),A=n.n(y),b=n(84092),_=n.n(b),w=n(69313),j=n(48971),C=n(27859),N={labels:["codec:","level:"],items:(0,u.A)(["none","snappy","zlib_","lz4","lz4_high_compression","quick_lz","zstd_","brotli_","lzma_","bzip2_"].map((function(e){return{value:e,content:e}}))),subItemsMap:{zlib_:k(1,9),zstd_:k(1,21),brotli_:k(1,11),lzma_:k(0,9),bzip2_:k(1,9)}};function k(e,t){for(var n=[],r=e;r<=t;++r)n.push({value:String(r),content:String(r)});return n}function S(e){if(!e)return[w.HL];for(var t in N.subItemsMap)if(e.startsWith(t))return[t,e.substr(t.length)];return[e]}function P(e){return h()(e,[w.HL])?"":null==e?void 0:e.join("")}var E={REPLICATION:"replication",ERASURE:"erasure"},z=[{value:"lrc_12_2_2",title:"lrc_12_2_2 (recommended)"},{value:"reed_solomon_6_3",title:"reed_solomon_6_3"}];function O(e){return e&&"none"!==e?E.ERASURE:E.REPLICATION}function I(e){return e&&"none"!==e?e:z[0].value}function T(e,t){return e===E.REPLICATION?"none":t||z[0].value}var M={NONE:"none",COMPRESSED:"compressed",UNCOMPRESSED:"uncompressed"};function V(e){return{ui_marker:e}}function R(e,t,n){return null==t?{command:"remove",parameters:(0,s.A)({path:e},n)}:{command:"set",parameters:(0,s.A)((0,s.A)({path:e},n),{},{force:!0}),input:t}}var F={REPLICATED_TABLE:"replicated_table",REPLICATION_LOG_TABLE:"replication_log_table",CHAOS_REPLICATED_TABLE:"chaos_replicated_table",MAP_NODE:"map_node",TABLE:"table"};function B(e,t){return U.apply(this,arguments)}function U(){return(U=(0,i.A)((0,o.A)().mark((function e(t,n){var a,i,s,u,l;return(0,o.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.length){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:a={},p()(n,(function(e){for(var t=e.split("/"),n=1;n<t.length;++n){var r=t.slice(0,n).join("/");r&&(a[r]=!0)}})),i=Object.keys(a).sort(),s=(0,r.A)(i),e.prev=6,l=(0,o.A)().mark((function e(){var n,r;return(0,o.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.value,r=t+"/@"+n,e.next=4,_().v3.exists({path:r}).then((function(e){if(!e)return _().v3.set({path:r},{})}));case 4:case"end":return e.stop()}}),e)})),s.s();case 9:if((u=s.n()).done){e.next=13;break}return e.delegateYield(l(),"t0",11);case 11:e.next=9;break;case 13:e.next=18;break;case 15:e.prev=15,e.t1=e.catch(6),s.e(e.t1);case 18:return e.prev=18,s.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[6,15,18,21]])})))).apply(this,arguments)}function L(e,t){if(v()(t))return Promise.resolve();var n=[],r=[],s={};return p()(t,(function(t){var o=t.attr,i=t.value,u=o.split("/");if(1===u.length){var l=e+"/@"+u.join("/");n.push(R(l,i))}else{var c=u.splice(u.length-1,1),d=(0,a.A)(c,1)[0],p=u.join("/");r.push(p);var m=e+"/@"+p;(s[m]=s[m]||{})[d]=i}})),Promise.all([].concat((0,u.A)(n.length?[(0,j.Mt)(C.Qq.executeBatch(C.Vu.updateNodeAttributes,{requests:n}),"Failed to update node attributes")]:[]),[B(e,r).then((function(){if(v()(s))return Promise.resolve([]);var e=x()(s,function(){var e=(0,i.A)((0,o.A)().mark((function e(t,n){var r;return(0,o.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=D(n,t),e.next=3,r;case 3:return e.abrupt("return",r);case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}());return Promise.all(e)}))]))}function D(e,t){if(v()(t))return Promise.resolve();var n=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=c()(n);return p()(t,(function(e,t){void 0===e?delete r[t]:r[t]=e})),h()(n,r)?Promise.resolve():_().v3.set({path:e},r)};return _().v3.exists({path:e}).then((function(t){return t?C.Qq.get(C.Vu.updateAttributes,{path:e}).then(n):n({})}))}function q(e,t,n){return{command:e,parameters:t,setup:n}}function G(e){var t=A()(e,(function(e){return-1===e.indexOf("/")})),n=(0,a.A)(t,2),r=n[0],o=n[1];return o.length?{keys:r,paths:o}:r}},36161:(e,t,n)=>{n.d(t,{A:()=>u}),n(77810);var r=n(76872),o=n(64965),a=n(73822),i=n(64922),s=(0,r.A)("elements-message");function u(){var e=(0,o.W5)().params.tab;return(0,i.jsx)("div",{className:s({theme:"warning"}),children:(0,i.jsx)("p",{className:s("paragraph"),children:e?'Viewer for tab "'.concat(a.A.format.ReadableField(e),'" is not implemented.'):"Viewer for this tab is not implemented."})})}},39702:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(40319),o=n(64922);const a=function(e){return(0,o.jsx)("svg",(0,r.A)((0,r.A)({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16"},e),{},{children:(0,o.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.47 13.03a.75.75 0 0 1 0-1.06L9.44 8 5.47 4.03a.75.75 0 0 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0",clipRule:"evenodd"})}))}},46357:(e,t,n)=>{n.d(t,{v:()=>s});var r=n(40319),o=n(22636),a=n(8160),i=n(52797);function s(e){var t=(0,a.d4)(i.dB);(0,o.gj)((0,r.A)((0,r.A)({},e),{},{subPage:e.subPage||"ui.".concat(t)}))}},57486:(e,t,n)=>{n.d(t,{A:()=>g});var r=n(29121),o=n(12937),a=n(66134),i=n(10785),s=n(68175),u=n(77810),l=n(76872),c=n(64772),d=n(88787),p=n(19410),m=n(44458),h=n(64922),f=(0,l.A)("sort-icon"),v=(0,s.A)((0,s.A)((0,s.A)((0,s.A)((0,s.A)((0,s.A)((0,s.A)({},"","sort"),"asc","sort-up"),"desc","sort-down"),"asc-undefined","arrow-to-bottom"),"desc-undefined","arrow-from-bottom"),"undefined-asc","arrow-from-top"),"undefined-desc","arrow-to-top"),g=function(e){function t(){var e;(0,r.A)(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return(e=(0,a.A)(this,t,[].concat(o))).onClick=function(){var t=e.props,n=t.order,r=t.onChange,o=t.allowUnordered,a=t.withUndefined;r&&r((0,m.$N)(n,o,a))},e}return(0,i.A)(t,e),(0,o.A)(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.label,r=e.order,o=e.hidden,a=v[r||""];return(0,h.jsxs)("span",{className:f({hidden:o},t),onClick:this.onClick,children:[n&&(0,h.jsx)("span",{className:f("label"),children:n}),(0,h.jsx)(p.m,{className:f("icon"),content:r?c.A.ReadableField(r):"Unordered",children:(0,h.jsx)(d.A,{awesome:a,face:"solid"})})]})}}])}(u.Component)},59911:(e,t,n)=>{n.d(t,{z:()=>p});var r=n(40319),o=n(18801),a=(n(77810),n(76872)),i=n(39427),s=n(81336),u=n(68987),l=n(64922),c=["className","text","disableEdit","withControls","cancelOnClose","openOnClick","size","saveButtonView","cancelButtonView","renderEditor","onModeChange","children","beforeEditorContent","afterEditorContent","view"],d=(0,a.A)("yt-editable-breadcrumbs");function p(e){var t=e.className,n=e.text,a=e.disableEdit,p=e.withControls,m=e.cancelOnClose,h=e.openOnClick,f=e.size,v=e.saveButtonView,g=e.cancelButtonView,x=e.renderEditor,y=e.onModeChange,A=e.children,b=e.beforeEditorContent,_=e.afterEditorContent,w=e.view,j=(0,o.A)(e,c);return(0,l.jsx)(u.c,{className:d(null,t),text:n,onChange:function(){},disableEdit:a,withControls:p,cancelOnClose:m,openOnClick:h,size:f,saveButtonView:v,cancelButtonView:g,renderEditor:x,onModeChange:y,renderContent:function(e){return(0,l.jsx)(i.a,{className:d({view:w},"".concat(d("breadcrumbs-container")," ").concat(e.className)),children:(0,l.jsx)(s.B,(0,r.A)((0,r.A)({},j),{},{showRoot:!0,endContent:(0,l.jsxs)(l.Fragment,{children:[b?(0,l.jsx)("div",{style:{marginLeft:"8px"},children:b}):null,e.renderEditButton(),_?(0,l.jsx)("div",{style:{marginRight:"8px"},children:_}):null]}),children:A}))})},children:(0,l.jsx)(l.Fragment,{})})}},67249:(e,t,n)=>{n.d(t,{om:()=>v,lN:()=>b,D7:()=>g,ps:()=>y});var r=n(13322),o=n(40319),a=n(76872),i=n(49214),s=n.n(i),u=n(39760),l=n.n(u),c=n(27528),d=n.n(c),p=n(92611);const m=JSON.parse('{"title_current":"Current","title_will-be-added":"Will be added","title_will-be-removed":"Will be removed","title_unrecognized":"Unrecognized"}'),h=JSON.parse('{"title_current":"Текущие","title_will-be-added":"Будут добавлены","title_will-be-removed":"Будут удалены","title_unrecognized":"Нераспознанные"}'),f=(0,p.Kc)("yt:dialog-role-list",{en:m,ru:h});var v=(0,a.A)("role-list-control");function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=[],o=[],a=[];l()(e,(function(e){var t=e.isUnrecognized,i=e.isRequested,s=e.isApproved,u=e.isDepriving;t?a.push(e):u?o.push(e):s||i?r.push(e):n.push(e)}));var i=n.map((function(e){return x(e)})),s=t.map((function(e){return{title:e,data:{},frozen:!0}}));return{newItems:[],current:{title:f("title_current"),data:i.concat(s)},toAdd:{title:f("title_will-be-added"),itemClassName:v("item-to-add"),data:r.map((function(e){return x(e,{frozen:!0})}))},toRemove:{title:f("title_will-be-removed"),itemClassName:v("item-to-remove"),data:o.map((function(e){return x(e,{frozen:!0})}))},unrecognized:{title:f("title_unrecognized"),itemClassName:v("item-unrecognized"),data:a.map((function(e){return x(e,{frozen:!0})}))}}}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.A)({title:e.text||e.value,data:e},t)}function y(e){var t=e.current,n=e.newItems,o=e.toAdd;return[].concat((0,r.A)(n),(0,r.A)(A(t)),(0,r.A)(A(o)))}function A(e){var t=(e||{}).data;return d()(s()(t,(function(e){return!e.removed})),(function(e){var t=e.data||{};return{type:t.type,value:t.value}}))}function b(e){var t=e.current,n=e.newItems||[],r=(t&&t.data||[]).filter((function(e){return e.removed}));return{added:n.map((function(e){var t=e.type,n=e.value;return"users"===t?{user:n}:{group:n}})),removed:r.map((function(e){var t=e.data||{},n=t.value;return"users"===t.type?{user:n}:{group:n}}))}}},68987:(e,t,n)=>{n.d(t,{c:()=>d});var r=n(9736),o=n(77810),a=n(76872),i=n(69764),s=n(88787),u=n(58299),l=n(64922),c=(0,a.A)("editable-as-text");function d(e){var t=e.children,n=e.onChange,a=e.text,d=e.className,p=e.withControls,m=e.size,h=e.disableEdit,f=e.cancelOnClose,v=e.renderEditor,g=e.renderContent,x=e.onModeChange,y=e.saveButtonView,A=void 0===y?"normal":y,b=e.cancelButtonView,_=void 0===b?"normal":b,w=o.useState(!1),j=(0,r.A)(w,2),C=j[0],N=j[1],k=o.useState(a||""),S=(0,r.A)(k,2),P=S[0],E=S[1];(0,o.useEffect)((function(){E(a||"")}),[a]);var z=(0,o.useCallback)((function(e){x&&x(e),N(e)}),[x]),O=o.useCallback((function(){z(!1),f&&E(a||"")}),[f,z,a]),I=(0,o.useCallback)((function(){z(!0)}),[z]),T=o.useCallback((function(e){return E(null!=e?e:"")}),[E]),M=(0,o.useCallback)((function(){z(!1),n(P)}),[n,z,P]),V=(0,o.useCallback)((function(){z(!1),E(a||"")}),[z,a]),R=(0,o.useCallback)((function(e){z(!1),n(e)}),[z,n]),F=o.useCallback((function(e){"Enter"===e.key&&M(),"Escape"===e.key&&V()}),[M,V]),B=m||"m";return(0,l.jsx)(l.Fragment,{children:C?(0,l.jsxs)("div",{className:c({edit:!h,controls:Boolean(p)},d),children:[v?v({value:P,onChange:T,className:c("control"),onBlur:O,onApply:R}):(0,l.jsx)(i.k,{className:c("control"),autoFocus:!0,size:B,value:P,onUpdate:T,onKeyDown:F,onBlur:O}),p&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.A,{className:c("control"),view:A,extraProps:{onMouseDown:M},size:B,children:(0,l.jsx)(s.A,{awesome:"check",size:B})}),(0,l.jsx)(u.A,{className:c("control"),view:_,extraProps:{onMouseDown:V},size:B,children:(0,l.jsx)(s.A,{awesome:"times",size:B})})]})]}):g?g({renderEditButton:function(){return(0,l.jsx)(l.Fragment,{children:!h&&(0,l.jsx)(u.A,{className:c("control",{type:"edit"}),view:"outlined",onClick:I,size:B,qa:"edit-text-button",children:(0,l.jsx)(s.A,{awesome:"pencil",size:B})})})},className:c(null,d)}):(0,l.jsxs)("div",{className:c(null,d),children:[t,!h&&(0,l.jsx)(u.A,{className:c("control",{type:"edit"}),view:"outlined",onClick:I,size:B,qa:"edit-text-button",children:(0,l.jsx)(s.A,{awesome:"pencil",size:B})})]})})}},77528:(e,t,n)=>{n.d(t,{d:()=>u});var r=n(64922),o=n(77810),a=n(79497),i=n(31648);const s=(0,n(47999).om)("switch"),u=o.forwardRef((function(e,t){const{size:n="m",disabled:o=!1,content:u,children:l,title:c,style:d,className:p,qa:m}=e,{checked:h,inputProps:f}=(0,a.v)({...e,controlProps:{...e.controlProps,role:"switch"}}),v=u||l,g=(0,r.jsxs)("span",{className:s("indicator"),children:[(0,r.jsx)("input",{...f,className:s("control")}),(0,r.jsx)("span",{className:s("outline")}),(0,r.jsx)("span",{className:s("slider")})]});return(0,r.jsx)(i.m,{ref:t,title:c,style:d,size:n,disabled:o,className:s({size:n,disabled:o,checked:h},p),labelClassName:s("text"),qa:m,control:g,children:v})}))},81954:(e,t,n)=>{n.d(t,{WM:()=>f,zA:()=>v});var r=n(70353),o=n(13322),a=n(40319),i=(n(77810),n(41655)),s=n.n(i),u=n(76872),l=n(17271),c=n(19410),d=n(42321),p=n(88787),m=n(64922),h=(0,u.A)("yt-time-duration");function f(e){var t,n=e.value,r=e.onChange,o=e.error;return(0,m.jsxs)("div",{className:h(),children:[(0,m.jsx)(l.W9,{className:h("input"),value:(0,a.A)((0,a.A)({},n),{},{value:null==n?void 0:n.value,error:null!==(t=null==n?void 0:n.error)&&void 0!==t?t:o}),onChange:r,formatFn:v,parseFn:g}),(0,m.jsx)(c.m,{content:(0,m.jsxs)("div",{children:[(0,m.jsx)(d.Ay,{items:[x({y:"years",w:"weeks",M:"months",d:"days"}),x({h:"hours",m:"minutes",s:"seconds",ms:"milliseconds"})]}),"1M=30d",(0,m.jsx)("br",{}),(0,m.jsx)("br",{}),"Examles: 1M2d3h, 4h15m"]}),children:(0,m.jsx)(p.A,{className:h("info"),awesome:"question-circle"})})]})}function v(e){if(!e&&0!==e)return"";var t=e,n="",r=36e5,o=24*r,a={y:365*o,M:30*o,d:o,h:r,m:6e4,s:1e3,ms:1};return Object.keys(a).forEach((function(e){var r=a[e],o=Math.floor(t/r);o>0&&(n+="".concat(o).concat(e," "),t-=o*r)})),n}function g(e){if(!e)return{value:void 0};if(!/^[\d\sa-zA-Z]*$/.test(e))return{value:void 0,error:"only digits and latin characters are allowed"};var t=e.replace(/\s+/g,""),n=(0,o.A)(t.matchAll(/\d+[a-zA-Z]*/g));if(!n.length||0!==n[0].index)return{value:void 0,error:"wrong format"};var a,i=0,u=(0,r.A)(n);try{for(u.s();!(a=u.n()).done;){var l,c=a.value[0].match(/\d+/)||{},d=c[0],p=c.input;if(!d)return{value:void 0,error:"wring fromat 1"};var m=null!==(l=null==p?void 0:p.substring(d.length))&&void 0!==l?l:"",h=Number(d),f=s().duration(h,m).valueOf();if(0===f&&0!==h)return{value:void 0,error:"wrong format of ".concat(p)};i+=f}}catch(e){u.e(e)}finally{u.f()}return{value:i}}function x(e){return Object.keys(e).map((function(t){return{key:t,label:t,value:e[t]}}))}f.hasErrorRenderer=!0,f.getDefaultValue=function(){return{value:void 0}},f.isEmpty=function(e){return!e},f.validator=function(e){return null==e?void 0:e.error}},82733:(e,t,n)=>{n.d(t,{Eo:()=>H,FW:()=>F,Lt:()=>X,Pc:()=>$,QP:()=>se,RX:()=>ue,Sx:()=>le,Uy:()=>de,Xb:()=>L,ap:()=>ne,b5:()=>ae,cE:()=>he,e6:()=>Y,eX:()=>ce,j3:()=>ee,l$:()=>pe,oq:()=>me,xd:()=>M});var r=n(29121),o=n(12937),a=n(9736),i=n(13322),s=n(40319),u=n(18472),l=n(29347),c=n.n(l),d=n(49214),p=n.n(d),m=n(4176),h=n.n(m),f=n(39760),v=n.n(f),g=n(27528),x=n.n(g),y=n(63281),A=n.n(y),b=n(31285),_=n.n(b),w=n(90636),j=n.n(w),C=n(31470),N=n.n(C),k=n(17239),S=n.n(k),P=n(48971),E=n(6184),z=n(6803),O=n(7787);function I(e){var t=x()(e,(function(e){return e.columns}));return c()(_()(h()(t))).sort()}function T(e,t){return x()(e,(function(e){var n={type:t,subjects:[e.value],subjectType:"users"===e.type?"user":"group",groupInfo:"groups"===e.type?{name:e.group_name,url:e.url,group:void 0}:void 0,action:void 0};return(0,s.A)((0,s.A)({},e),n)}))}var M=function(e,t){return e.acl[t].userPermissions},V=function(e,t){return e.acl[t].objectPermissions},R=(0,u.Mz)([V],(function(e){var t=[];return v()(e,(function(e){var n=e.subjects;n&&n.length>1?v()(n,(function(n,r){t.push((0,s.A)((0,s.A)({},e),{},{subjects:[n],isSplitted:!0,subjectIndex:r}))})):t.push(e)})),t})),F=function(e){return(0,u.Mz)([z.n2,function(t){return R(t,e)}],(function(t,n){var r=new Set,o=(O.Ay.getAclPermissionsSettings()[e]||{}).permissionTypes;return[].concat((0,i.A)(o),(0,i.A)(t)).forEach((function(e){return r.add(e)})),n.forEach((function(e){var t=e.permissions;null==t||t.forEach((function(e){return r.add(e)}))})),A()((0,i.A)(r),(function(e){return e}))}))};function B(e,t){var n,r=e.subjectType,o=e.groupInfo;return"group"===r?S()(Object.entries(null!=o?o:{}),(function(e){var n,r=(0,a.A)(e,2),o=r[0],i=r[1],s=String(i);return"url"===o&&("/"===s[s.length-1]&&(s=s.slice(0,-1)),s=s.split("/").pop()),-1!==(null===(n=s)||void 0===n?void 0:n.toLowerCase().indexOf(t))})):-1!==String(null!==(n=e.subjects[0])&&void 0!==n?n:"").toLowerCase().indexOf(t)}var U=(0,u.Mz)([R,z.Ec,z.n2,z.Gn],(function(e,t,n,r){var o=j()(e,(function(e){var t;return!(null!==(t=e.columns)&&void 0!==t&&t.length)})),u=(0,a.A)(o,2),l=u[0],d=u[1].map((function(e){return(0,s.A)((0,s.A)({},e),{},{columns:A()(e.columns)})})),p=null==t?void 0:t.toLocaleLowerCase(),m=p?function(e){return B(e,p)}:void 0,h=new Set(n),f=h.size?function(e){var t;return null!==(t=function(e,t){var n=e.permissions,r=0;return null==n?void 0:n.some((function(e){return t.has(e)&&r++,r>=t.size}))}(e,h))&&void 0!==t&&t}:void 0,v=new Set(r),g=v.size?function(e){var t,n=e.columns;return null!==(t=null==n?void 0:n.some((function(e){return v.has(e)})))&&void 0!==t&&t}:void 0,x=c()([m,f]),y=c()([m,g]);return{mainPermissions:x.length?l.filter(E.concatByAnd.apply(void 0,(0,i.A)(x))):l,columnsPermissions:y.length?d.filter(E.concatByAnd.apply(void 0,(0,i.A)(y))):d}})),L=(0,u.Mz)([U,z.PW],(function(e,t){var n=e.mainPermissions,r=e.columnsPermissions;return{mainPermissions:(0,s.A)((0,s.A)({},G(n,t)),{},{count:n.length}),columnsPermissions:(0,s.A)((0,s.A)({},G(r,t)),{},{count:r.length})}})),D=function(){return(0,o.A)((function e(t){if((0,r.A)(this,e),this.aggrKey=void 0,this.subject=void 0,this.inherited=void 0,this.allPermissions=new Set,this.columns=new Set,this.first=void 0,this.children=new Array,t.subjects.length>1)throw new Error("Unexpected behavior: more than one subject occured: ".concat(t.subjects.join(",")));this.aggrKey=q(t),this.inherited=Boolean(t.inherited),this.subject=t.subjects[0],this.first=(0,s.A)({},t),this.add(t)}),[{key:"add",value:function(e){var t,n,r,o,a,u,l,c,d=this,p=q(e);if(this.aggrKey!==p)throw new Error("Unexpected behavior: aggregation keys are not queal: ".concat(this.aggrKey," !== ").concat(p));if(1!==e.subjects.length)throw new Error("Unexpected behavior: item.subjects.length !== 1: ".concat(JSON.stringify(e)));var m=(0,s.A)((0,s.A)({},e),{},{permissions:(0,i.A)(null!==(t=e.permissions)&&void 0!==t?t:[])});this.children.push(m),null===(n=m.permissions)||void 0===n||n.sort(),null===(r=m.permissions)||void 0===r||r.forEach((function(e){d.allPermissions.add(e)})),null===(o=e.columns)||void 0===o||o.forEach((function(e){return d.columns.add(e)})),(a=this.first).isMissing||(a.isMissing=Boolean(e.isMissing)),(u=this.first).isUnrecognized||(u.isUnrecognized=Boolean(e.isUnrecognized)),(l=this.first).isApproved||(l.isApproved=Boolean(e.isApproved)),(c=this.first).isRequested||(c.isRequested=Boolean(e.isRequested))}},{key:"getItems",value:function(e){var t=this,n=this.inherited;if(1===this.children.length)return{items:this.children,hasInherited:n};var r=(0,s.A)((0,s.A)({},this.first),{},{level:0,expanded:e});r.permissions=(0,i.A)(this.allPermissions).sort(),r.columns=(0,i.A)(this.columns).sort();var o=!1,a=e?[r].concat((0,i.A)(A()(this.children,["inheritance_mode","permissions"]).map((function(e){return o||(o="deny"===e.action),(0,s.A)((0,s.A)({},e),{},{level:1})})))):[r];return this.children.forEach((function(e){e.inheritance_mode!==r.inheritance_mode&&(r.inheritance_mode=void 0),N()(t.first.inheritedFrom,e.inheritedFrom)||(r.inheritedFrom=void 0)})),{items:a,hasExpandable:!0,hasDenyAction:o,hasInherited:n}}}])}();function q(e){var t=e.inherited,n=(0,a.A)(e.subjects,1)[0];return"subject:".concat(n,"_inherited:").concat(Boolean(t))}function G(e,t){var n={};e.forEach((function(e){var t=q(e),r=n[t];r?r.add(e):n[t]=new D(e)}));var r=Object.values(n).reduce((function(e,n){var r=n.getItems(t.has(n.subject)),o=r.items,a=r.hasExpandable,i=r.hasInherited;return e.items=e.items.concat(o),e.hasExpandable||(e.hasExpandable=a),e.hasInherited||(e.hasInherited=i),e}),{items:[]}),o=j()(r.items,(function(e){return e.inherited})),u=(0,a.A)(o,2),l=u[0],c=u[1];return(0,s.A)((0,s.A)({},r),{},{items:[].concat((0,i.A)(l),(0,i.A)(c))})}(0,u.Mz)([V],W);var H=(0,u.Mz)([function(e,t){return e.acl[t].columnGroups},z.Gn,z.Fv],(function(e,t,n){var r=new Set(t),o=null==n?void 0:n.toLowerCase(),a=c()([function(e){return!e.removed},r.size>0?function(e){var t,n;return null!==(t=null===(n=e.columns)||void 0===n?void 0:n.some((function(e){return r.has(e)})))&&void 0!==t&&t}:void 0,null!=o&&o.length?function(e){var t,n;return-1!==(null!==(t=null===(n=e.name)||void 0===n||null===(n=n.toLowerCase())||void 0===n?void 0:n.indexOf(o))&&void 0!==t?t:-1)}:void 0]),u=p()(e,E.concatByAnd.apply(void 0,(0,i.A)(a))).map((function(e){return(0,s.A)((0,s.A)({},e),{},{columns:A()(e.columns)})}));return A()(u,["name"])}));function W(e){var t=[],n=[],r=[],o=[];return v()(e,(function(e){var a=e.isDepriving,i=e.isRequested,s=e.isUnrecognized,u=e.isApproved;s?t.push(e):a?r.push(e):i||u?n.push(e):o.push(e)})),[].concat(n,r,t,o)}var J=function(e,t){return e.acl[t].readApprovers},K=function(e,t){return e.acl[t].responsible},Q=function(e,t){return e.acl[t].auditors},Y=(0,u.Mz)([J],(function(e){return p()(e,(function(e){return!e.inherited}))})),$=(0,u.Mz)([K],(function(e){return p()(e,(function(e){return!e.inherited}))})),X=(0,u.Mz)([Q],(function(e){return p()(e,(function(e){return!e.inherited}))})),Z=(0,u.Mz)([J,K,Q],(function(e,t,n){return[].concat((0,i.A)(T(e,"read_approver")),(0,i.A)(T(t,"responsible")),(0,i.A)(T(n,"auditor")))})),ee=(0,u.Mz)([Z],(function(e){return e.length>0})),te=(0,u.Mz)([Z,z.Nh],(function(e,t){if(!t)return e;var n=t.toLowerCase();return p()(e,(function(e){return B(e,n)}))})),ne=(0,u.Mz)([te],(function(e){return A()(e,[function(e){return!e.inherited},function(e){return e.subjects&&e.subjects[0]||!0}])})),re=((0,u.Mz)([Z],W),(0,u.Mz)([V],(function(e){var t=p()(e,(function(e){var t;return"allow"===e.action&&(null===(t=e.columns)||void 0===t?void 0:t.length)>0}));return x()(t,(function(e){var t=(0,s.A)({},e);return t.type="columns",t}))}))),oe=(0,u.Mz)([V],(function(e){var t=p()(e,(function(e){var t;return"deny"===e.action&&(null===(t=e.columns)||void 0===t?void 0:t.length)>0}));return x()(t,(function(e){return(0,s.A)((0,s.A)({},e),{},{type:"columns"})}))})),ae=(0,u.Mz)([re],I),ie=(0,u.Mz)([oe],I),se=(0,u.Mz)([ie],(function(e){return x()(e,(function(e){return{key:e,value:e,title:e}}))})),ue=function(e,t){return e.acl[t].isPermissionDeleted},le=function(e,t){return e.acl[t].deletionError},ce=function(e,t){return e.acl[t].deletedItemKey},de=function(e,t){return e.acl[t].idmPermissionsRequestError},pe=function(e,t){return e.acl[t].idmManageAclRequestError},me=function(e,t){return e.acl[t].version},he=(0,u.Mz)([function(e,t){return e.acl[t].loading},function(e,t){return e.acl[t].loaded},function(e,t){return e.acl[t].error}],(function(e,t,n){return(0,P.Ts)(e,t,n)}))},82777:(e,t,n)=>{n.d(t,{k:()=>m});var r=n(64922),o=n(77810);const a=(0,n(47999).om)("progress");function i(e){const{text:t,offset:n=0}=e;return t?(0,r.jsx)("div",{className:a("text-inner"),style:{transform:`translateX(calc(var(--g-flow-direction) * ${-n}%))`},children:t}):null}function s({item:e}){const{value:t,color:n,className:o,theme:i,title:s,content:u,loading:l}=e,c={loading:l};return void 0===n&&(c.theme=i||"default"),Number.isFinite(t)?(0,r.jsx)("div",{className:a("item",c,o),style:{width:`${t}%`,backgroundColor:n},title:s,children:u}):null}function u(e){return e<100?e-100:0}function l(e){const{theme:t,colorStops:n,colorStopsValue:r,value:o}=e;if(n){const e=n.find(((e,t)=>{const a="number"==typeof r?r:o,i=t>1?n[t-1].stop:0,s=t<n.length-1?e.stop:100;return a>=i&&a<=s}));return e?e.theme:t}return t}function c(e){const{stack:t,stackClassName:n,value:o,text:l}=e,c=u(o||function(e){return e.reduce(((e,{value:t})=>e+t),0)}(t));return(0,r.jsxs)("div",{className:a("stack",n),style:{transform:`translateX(calc(var(--g-flow-direction) * ${c}%))`},children:[(0,r.jsx)("div",{className:a("item"),style:{width:-c+"%"}}),t.map(((e,t)=>(0,r.jsx)(s,{item:e},t))),(0,r.jsx)(i,{offset:c,text:l})]})}function d(e){const{value:t,loading:n,text:o}=e,s=u(t);return Number.isFinite(t)?(0,r.jsx)("div",{className:a("item",{theme:l(e),loading:n}),style:{transform:`translateX(calc(var(--g-flow-direction) * ${s}%))`},children:(0,r.jsx)(i,{offset:s,text:o})}):null}function p(e){return void 0!==e.stack}const m=o.forwardRef((function(e,t){const{text:n="",theme:o="default",size:i="m",loading:s=!1,className:u,qa:l}=e,m={...e,text:n,theme:o,size:i,loading:s};return(0,r.jsxs)("div",{ref:t,className:a({size:i},u),"data-qa":l,children:[(0,r.jsx)("div",{className:a("text"),children:n}),p(m)?(0,r.jsx)(c,{...m}):(0,r.jsx)(d,{...m})]})}))},87319:(e,t,n)=>{n.d(t,{A:()=>C});var r=n(9736),o=n(29121),a=n(12937),i=n(66134),s=n(10785),u=n(77810),l=n(75826),c=n.n(l),d=n(25147),p=n.n(d),m=n(76872),h=n(23313),f=n.n(h),v=n(95603),g=n.n(v),x=n(90636),y=n.n(x),A=n(69764),b=n(21211),_=n(98840),w=n(64922),j=(0,m.A)("suggest"),C=(c().arrayOf(c().oneOfType([c().string,c().shape({value:c().string,text:c().string,counter:c().oneOfType([c().string,c().number])})])),function(e){function t(e){var n;return(0,o.A)(this,t),(n=(0,i.A)(this,t,[e])).input=u.createRef(),n.isClearClicked=!1,n.isUnmounting=!1,n.skipApplyForNextBlur=!1,n.onTextUpdate=function(e){var t=n.props,r=t.clear,o=t.onTextUpdate;n.setState({text:e}),n.loadSuggestions(e),e.length||null==r||r(),null==o||o(e)},n.showSuggestions=function(e){var t,r;n.isUnmounting||(n.setState({items:e,popupVisible:!0,selectedIndex:0}),null===(t=(r=n.props).onOpenChange)||void 0===t||t.call(r,{open:!0}))},n.state={text:"text"in e?e.text:e.defaultText,items:e.items,selectedIndex:0,popupVisible:!1,prevItems:[]},n.onFocus=n.onFocus.bind(n),n.onBlur=n.onBlur.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.hideSuggestions=n.hideSuggestions.bind(n),n.clearSuggestions=n.clearSuggestions.bind(n),n}return(0,s.A)(t,e),(0,a.A)(t,[{key:"componentDidMount",value:function(){this.isClearClicked=!1}},{key:"componentWillUnmount",value:function(){this.isUnmounting=!0}},{key:"onFocus",value:function(){var e,t;this.setState({focused:!0}),this.isClearClicked=!1,this.loadSuggestions(this.state.text),this.skipApplyForNextBlur=!1,null===(e=(t=this.props).onFocus)||void 0===e||e.call(t)}},{key:"onBlur",value:function(){var e,t,n;this.hideSuggestions(),this.isClearClicked||null===(e=(t=this.props).onBlur)||void 0===e||e.call(t),this.skipApplyForNextBlur||this.applySuggestion(null!==(n=this.state.text)&&void 0!==n?n:""),this.setState({focused:!1})}},{key:"onKeyDown",value:function(e){var t=e.keyCode;if(40===t)e.preventDefault(),this.selectNextSuggestion();else if(38===t)e.preventDefault(),this.selectPrevSuggestion();else if(13===t)this.applyOrClearSuggestion();else if(27===t){var n;null===(n=this.input.current)||void 0===n||n.blur()}}},{key:"hideSuggestions",value:function(){var e,t;this.setState({items:[],popupVisible:!1,selectedIndex:0}),null===(e=(t=this.props).onOpenChange)||void 0===e||e.call(t,{open:!1})}},{key:"loadSuggestions",value:function(e){var t=this.props,n=t.filter,r=t.items;Promise.resolve(n(r,e)).then(this.showSuggestions)}},{key:"clearSuggestions",value:function(){var e,t=this.props.clear;null==t||t(),this.isClearClicked=!0,null===(e=this.input.current)||void 0===e||e.blur()}},{key:"applySuggestion",value:function(e){var t,n=this.props.apply;this.setState({text:e}),null==n||n(e),null===(t=this.input.current)||void 0===t||t.blur()}},{key:"getItemIndex",value:function(e){return e-1}},{key:"getSelectedIndex",value:function(e){return e+1}},{key:"getItemValue",value:function(e){return"string"==typeof e?e:e.value}},{key:"applyOrClearSuggestion",value:function(){var e,t=this.state,n=t.selectedIndex,r=t.items;if(0===n?r.length>0&&(e=r[0]):e=r[this.getItemIndex(n)],e){var o=this.getItemValue(e);this.applySuggestion(o);var a=this.props.onItemClick;null==a||a(e)}}},{key:"selectPrevSuggestion",value:function(){var e=this.state,t=e.selectedIndex,n=e.items,r=0===t?this.getSelectedIndex(n.length-1):t-1;this.setState({selectedIndex:r})}},{key:"selectNextSuggestion",value:function(){var e=this.state,t=e.selectedIndex,n=e.items,r=t===this.getSelectedIndex(n.length-1)?0:t+1;this.setState({selectedIndex:r})}},{key:"renderInput",value:function(){var e=this.state.text,t=this.props,n=t.placeholder,r=t.autoFocus,o=t.disabled,a=t.pin;return(0,w.jsx)(A.k,{hasClear:!0,value:e,className:j("control"),placeholder:n,disabled:o,onUpdate:this.onTextUpdate,onFocus:this.onFocus,onBlur:this.onBlur,autoFocus:r,controlRef:this.input,pin:a,onKeyDown:this.onKeyDown})}},{key:"renderCounter",value:function(e){var t=e.counter;return void 0!==t&&(0,w.jsx)("span",{className:j("item-counter"),children:t})}},{key:"renderSimpleItem",value:function(e){var t="string"==typeof e?e:e.text;return(0,w.jsxs)("span",{children:["string"!=typeof e&&this.renderCounter(e),t]})}},{key:"renderItem",value:function(e,t,n,r){var o=this,a=this.state.selectedIndex,i=j("item",{selected:a===this.getSelectedIndex(t)?"yes":void 0},r),s=this.getItemValue(e),u=this.props,l=u.template,c=u.renderItem,d=u.onItemClick,p=null!=c?c:void 0!==l?_.Ay.get(l.key).__default__:this.renderSimpleItem.bind(this);return(0,w.jsx)("li",{title:s,className:i,onMouseDown:function(){o.skipApplyForNextBlur=!0,null==d||d(e),o.applySuggestion(s)},children:p(e)},n)}},{key:"getInputWidth",value:function(){return this.input.current?this.input.current.offsetWidth-2:0}},{key:"restrictItems",value:function(e){var t=this.props.maxItems;if(f()(t))return e.slice(0,t||e.length);if(g()(t)){var n=t.totalAmount,o=t.groupPredicate,a=y()(e,o),i=(0,r.A)(a,2),s=i[0],u=i[1];if(s.length&&u.length){var l=Math.round(Math.max(s.length/e.length*n,1));return s.slice(0,l).concat(u.slice(0,n-l))}return e.slice(0,n||e.length)}return e}},{key:"renderSuggestions",value:function(e){var t=this,n=j("wrapper"),r=j("items"),o=0===e.length&&this.state.text;return e&&(0,w.jsxs)("div",{className:n,children:[o&&this.renderItem("No items",-1,"no_items",j("no-items")),(0,w.jsx)("ul",{className:r,style:{minWidth:this.getInputWidth()},children:(0,w.jsx)(p(),{itemRenderer:function(n,r){return t.renderItem(e[n],n,r)},length:e.length,type:"uniform"})})]})}},{key:"renderPopup",value:function(){var e=this,t=this.props,n=t.popupClassName,r=t.popupPlacement,o=this.state.popupVisible,a=this.restrictItems(this.state.items);return(0,w.jsx)(b.z,{className:n,placement:null!=r?r:"bottom",anchorElement:this.input.current,open:!this.isClearClicked&&o&&a.length>0,onOpenChange:function(t){t||e.hideSuggestions()},children:this.renderSuggestions(a)})}},{key:"render",value:function(){var e=this.props.className;return(0,w.jsxs)("div",{className:j(null,e),children:[this.renderInput(),this.renderPopup()]})}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=!t.focused&&"text"in e?e.text:t.text;return e.items===t.prevItems&&n===t.text?null:{items:e.filter(e.items,n),prevItems:e.items,text:n}}}])}(u.Component));C.defaultProps={disable:!1,text:"",autoFocus:!1,items:[],zIndexGroupLevel:1,onBlur:function(){},focused:!1}},88191:(e,t,n)=>{n.d(t,{S:()=>u});var r=n(77810),o=n(76872),a=n(64772),i=n(64922),s=(0,o.A)("yt-operation-type");function u(e){var t=e.value,n=r.useMemo((function(){return a.A.ReadableField(t)}),[t]);return(0,i.jsx)("span",{className:s(),children:n})}},95976:(e,t,n)=>{n.d(t,{c:()=>i}),n(77810);var r=n(76872),o=n(64922),a=(0,r.A)("yt-color-circle");function i(e){var t=e.color,n=e.marginRight,r=void 0===n||n;return(0,o.jsx)("div",{className:a({"margin-right":r}),style:{backgroundColor:t}})}},98115:(e,t,n)=>{n.d(t,{O:()=>v,A:()=>g});var r=n(40319),o=n(9736),a=n(29121),i=n(12937),s=n(66134),u=n(10785),l=n(77810),c=n(76872),d=n(18866),p=n(88787),m=n(64922),h=(0,c.A)("collapsible-section"),f=(0,c.A)("elements-heading"),v=function(e){function t(){var e;(0,a.A)(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=(0,s.A)(this,t,[].concat(r))).toggle=function(){(0,e.props.onToggle)(!e.props.collapsed)},e}return(0,u.A)(t,e),(0,i.A)(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.children,r=e.size,o=e.overview,a=e.className,i=e.headingClassName,s=e.collapsed,u=e.marginDirection,l=e.togglerRightPadding;return(0,m.jsx)(d.A,{children:(0,m.jsxs)("div",{className:h({margin:u},a),children:[(0,m.jsxs)("div",{className:f({size:r,overview:"yes"},i),children:[(0,m.jsxs)("span",{className:f("heading",{clickable:"yes"},h("title")),onClick:this.toggle,children:[t,(0,m.jsx)("a",{children:(0,m.jsx)(p.A,{className:h("toggler",{"right-padding":l}),awesome:s?"angle-down":"angle-up"})})]}),o]}),!s&&(0,m.jsx)(d.A,{children:n})]})})}}])}(l.Component);function g(e){var t=e.onToggle,n=l.useState(e.collapsed),a=(0,o.A)(n,2),i=a[0],s=a[1],u=l.useCallback((function(e){s(e),t&&t(e)}),[s,t]);return(0,m.jsx)(v,(0,r.A)((0,r.A)({},e),{},{onToggle:u,collapsed:i}))}v.defaultProps={size:"m",collapsed:!1,marginDirection:"top"}},99442:(e,t,n)=>{n.r(t),n.d(t,{Scheduling:()=>$r,SchedulingTopRow:()=>Mo});var r=n(9736),o=n(77810),a=n(14371),i=n(76872),s=n(65304),u=n.n(s),l=n(39055),c=n(18866),d=n(8208),p=n(40319),m=n(75414),h=n.n(m),f=n(64965),v=n(56950),g=n(62250),x=n(61643),y=n(36161),A=n(5675),b=n(98115),_=n(66205),w=n(13322),j=n(49214),C=n.n(j),N=n(34455),k=n.n(N),S=n(18472),P=n(29746),E=n(52797),z=n(55594),O=(0,S.Mz)([_.d_,z.IY],(function(e,t){for(var n=e,r=[],o=function(){r.push(n);var e=n,o=(k()(t,(function(t){return t.name===e}))||{}).parent;n=o};n;)o();return r.reverse()}));function I(e,t){return{name:e,cpu:P.A.getValue(t,"/cpu"),gpu:P.A.getValue(t,"/gpu"),memory:P.A.getValue(t,"/user_memory"),user_slots:P.A.getValue(t,"/user_slots"),network:P.A.getValue(t,"/network")}}var T=(0,S.Mz)([_.HE,_.cO],(function(e,t){if(e||null==t||!t.attributes)return{};var n=P.A.getValue(t.attributes,"/specified_burst_guarantee_resources"),r=P.A.getValue(t.attributes,"/specified_resource_flow");return{strong:I("Strong guarantee",P.A.getValue(t.attributes,"/strong_guarantee_resources")),burst:n?I("Burst",n):void 0,flow:r?I("Flow",r):void 0}}));function M(e,t,n){var r=P.A.getNumber(e,"/"+n,0),o=P.A.getNumber(t,"/"+n,0);return{total:r,used:r-o,free:o}}function V(e,t,n){var r=P.A.getNumber(e,"/"+n,0),o=P.A.getNumber(t,"/"+n,0);return{total:r+o,used:r,free:o}}var R=(0,S.Mz)([z.IY],(function(e){return C()(e,(function(e){return e.parent===x.W1}))})),F=(0,S.Mz)([R],(function(e){return h()(e,(function(e,t){return e.maxOperationCount+=t.maxOperationCount||0,e.maxRunningOperationCount+=t.maxRunningOperationCount||0,e}),{maxOperationCount:0,maxRunningOperationCount:0})})),B=(0,S.Mz)([_.Ww],(function(e){return P.A.getNumber(e,"/resource_limits/gpu",0)})),U=(0,S.Mz)([_.Ww,F,E.dB,_.Jv],(function(e,t){var n=e.config,r=P.A.getNumber(n,"/max_operation_count",0),o=P.A.getNumber(n,"/max_running_operation_count",0);return[{name:"Operations",format:"Number"},{level:1,name:"Total",format:"Number",total:r,used:t.maxOperationCount,usedTitle:"Max operation count",free:r-t.maxOperationCount,lastDayMaxValueSensor:"max_operation_count",lastDayMaxValueTitle:"Last day max operations"},{level:1,name:"Running",format:"Number",total:o,used:t.maxRunningOperationCount,usedTitle:"Max running operation count",free:o-t.maxRunningOperationCount,lastDayMaxValueSensor:"max_running_operation_count",lastDayMaxValueTitle:"Last day max running operations"}]})),L=(0,S.Mz)([_.Ww,U],(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.resource_distribution_info,r=e.resource_limits;if(!n)return[];var o=n.undistributed_resources,a=n.distributed_burst_guarantee_resources,i=n.undistributed_burst_guarantee_resources,s=n.distributed_resource_flow,u=n.undistributed_resource_flow,l=(0,p.A)({level:0,name:"CPU",format:"Number"},M(r,o,"cpu")),c=(0,p.A)((0,p.A)({level:1,name:"Burst",format:"Number"},V(a,i,"cpu")),{},{total:void 0,free:void 0}),d=(0,p.A)((0,p.A)({level:1,name:"Flow",format:"Number"},V(s,u,"cpu")),{},{total:void 0});return d.free=c.used-d.used,[l,{level:1,name:"Strong",format:"Number",used:l.used-Math.max.apply(Math,(0,w.A)([0,c.used,d.used].filter((function(e){return!isNaN(e)}))))},c,d,(0,p.A)({name:"Memory",format:"Bytes"},M(r,o,"user_memory")),(0,p.A)({name:"GPU",format:"Number"},M(r,o,"gpu"))].concat((0,w.A)(t))})),D=n(81379),q=n(64772),G=n(66026),H=n(16883),W=n(7787),J=n(64922),K=(0,i.A)("scheduling-static-configuration");function Q(){var e=(0,a.w)(),t=(0,a.d)(_.HE),n=(0,a.d)(G.K),r=o.useCallback((function(t){e((0,H.CU)(t))}),[e]);return t?(0,J.jsx)(b.A,{name:"Static configuration",className:K(),onToggle:r,collapsed:n,children:(0,J.jsx)("div",{className:K("container"),children:(0,J.jsx)($,{})})}):null}const Y=o.memo(Q);function $(){var e=(0,a.d)(L),t=(0,a.d)(_.Jv),n=(0,a.d)(E.dB),r=[{name:"name",header:"",sortable:!1,width:200,render:function(e){var t=(null==e?void 0:e.row)||{},n=t.name,r=t.level;return(0,J.jsx)("span",{className:K("name",{level:r}),children:n})}},{name:"total",header:"Total",sortable:!1,width:100,render:function(e){var t=e.row;return q.A[t.format](t.total)},align:"right"},{name:"used",header:"Distributed",sortable:!1,width:150,render:function(e){var r=e.row,o=r.used,a=r.usedTitle,i=r.lastDayMaxValueSensor,s=r.lastDayMaxValueTitle,u=q.A[r.format],l=i?W.Ay.renderSchedulingLastDayMaximum({cluster:n,tree:t,title:s,sensor:i,format:u,current:{value:u(o),title:a},showHint:!0,showAsLink:!0}):null;return l?(0,J.jsxs)("span",{className:K("used-cell"),children:[u(o)," / ",l]}):u(o)},align:"right"},{name:"free",header:"Delta",sortable:!1,width:150,render:function(e){var r=e.row,o=q.A[r.format],a=r.free,i=r.total,s=r.lastDayMaxValueSensor,u=o(a),l=s?W.Ay.renderSchedulingLastDayMaximum({cluster:n,tree:t,title:"Last day max operations",sensor:s,format:function(e){var t=isNaN(i)||isNaN(e)?void 0:i-e;return o(t)}}):null;return l?(0,J.jsxs)("span",{children:[u," / ",l]}):u},align:"right"}];return(0,J.jsx)(D.Ay,{className:K("table"),columns:r,data:e,useThemeYT:!0,settings:{displayIndices:!1},rowClassName:function(e){return null!=e&&e.level?K("row",{level:e.level}):""}})}var X=n(8160),Z=n(82777),ee=n(4617),te=(0,i.A)("yt-charge-level");function ne(e){var t=e.className,n=e.value,r=void 0===n?0:n,a=o.useMemo((function(){for(var e=Math.max(0,Math.min(100,r)),t=[],n=e;n>0;n-=10)t.push({value:n>=10?10:n,theme:"misc"});return{stack:t,effectiveValue:e}}),[r]),i=a.stack,s=a.effectiveValue;return(0,J.jsx)(Z.k,{className:te(null,t),stack:(0,ee.ok)(i,{spaceSize:490/242,startSpace:!0,endSpace:!0}),text:"".concat(q.A.NumberSmart(s),"%")})}var re=n(95976),oe=n(42321),ae=n(19410),ie=n(48971),se=n(92611);const ue=JSON.parse('{"burst":"Burst","balanced":"Balanced","capacity":"Capacity","charging":"Charging","charged":"Charged","discharging":"Discharging","flow":"Flow","general":"General","guarantee-type":"Guarantee type","integral-guarantees":"Integral guarantees","integral-guarantee":"Integral guarantee","mode":"Mode","operation-count":"Operation count","operation-count-max":"Max operation count","operations":"Operations","operations-pending":"Pending operations","operations-running":"Running operations","operations-running-lightweigh":"Running lightweigh operations","operations-running-max":"Max running operations","strong-guarantees":"Strong guarantees","weight":"Weight","user-slots":"User slots"}'),le=JSON.parse('{"burst":"Burst","balanced":"Сбалансированный","capacity":"Емкость","charging":"Заряжается","charged":"Заряжено","discharging":"Разряжается","flow":"Flow","general":"Основные","guarantee-type":"Тип гарантии","integral-guarantees":"Интегральные гарантии","integral-guarantee":"Интегральная гарантия","mode":"Режим","operation-count":"Число операций","operation-count-max":"Максимальное число операций","operations":"Операции","operations-pending":"Ожидающие операции","operations-running":"Бегущие операции","operations-running-lightweigh":"Бегущие легковесные операции","operations-running-max":"Максимальое число бегущих операций","strong-guarantees":"Строгие гарантии","weight":"Вес","user-slots":"Пользовательские слоты"}'),ce=(0,se.Kc)("yt:scheduling",{en:ue,ru:le});var de=(0,i.A)("yt-scheduling-meta");function pe(){var e=(0,X.d4)(_.cO),t=(0,X.d4)(T),n=(0,X.d4)(_.Ul),r=o.useMemo((function(){var r,o=null!=e?e:{},a=o.mode,i=o.resources,s=o.integralType,u=o.flowCPU,l=void 0===u?0:u,c=o.flowGPU,d=void 0===c?0:c,p=o.weight,m=null!=i?i:{},h=m.cpu,f=m.gpu,v=m.user_memory,g=s&&"none"!==s||l>0||d>0?q.A.ReadableField(s):"",x=fe(t.burst),y=fe(t.flow),A={items:[[{key:ce("mode"),value:q.A.ReadableField(a)},{key:ce("weight"),value:q.A.Number(p)},{key:ce("operations-running"),value:he(e,"running")},{key:ce("operations"),value:he(e,"total")}],[{key:"GPU",value:me(null==f?void 0:f.usage,null==f?void 0:f.min),visible:Boolean((null==f?void 0:f.usage)||(null==f?void 0:f.min))},{key:"CPU",value:me(null==h?void 0:h.usage,null==h?void 0:h.min)},{key:"RAM",value:me(null==v?void 0:v.usage,null==v?void 0:v.min,"Bytes")}]],subTitles:[ce("general"),ce("strong-guarantees")]},b="memory"===n?"user_memory":null!=n?n:"cpu",_=null!==(r=null==e?void 0:e.attributes)&&void 0!==r?r:{},w=_.accumulated_resource_volume,j=_.integral_pool_capacity,C=(null!=j?j:{})[b],N=void 0===C?NaN:C;if(N>=0||x.length||y.length){var k=(null!=w?w:{})[b],S=void 0===k?NaN:k,P=function(e){switch(b){case"user_memory":return q.A.Bytes(e)+"*hours";case"cpu":case"gpu":return q.A.NumberSmart(e)+" CPU*hours";case"user_slots":return q.A.NumberSmart(e)+" Slot*hours"}};A.items.push([{key:ce("guarantee-type"),value:g},{key:ce("capacity"),value:(0,J.jsx)(ae.m,{content:(0,J.jsx)(oe.Ay,{items:[{key:"accumulated_resource_volume",value:P(S/3600)},{key:"integral_pool_capacity",value:P(N/3600)}]}),children:(0,J.jsx)(ne,{value:S/N*100})}),visible:N>=0},{key:ce("burst"),value:x,visible:x.length>0},{key:ce("flow"),value:y,visible:y.length>0}]),A.subTitles.push(ce("integral-guarantees"))}return A}),[e,t,n]),a=r.items,i=r.subTitles;return null!=e&&e.name&&(null==e?void 0:e.name)!==x.W1?(0,J.jsx)(b.A,{className:de(),name:e.name,children:(0,J.jsx)(oe.Ay,{items:a,subTitles:i})}):null}function me(e,t,n){return(0,J.jsx)(Z.k,(0,p.A)((0,p.A)({className:de("progress")},Object.assign((0,ie.z)(e,t,n))),{},{theme:"success"}))}function he(e,t){if(!e)return null;var n=e.operationCount,r=void 0===n?NaN:n,o=e.maxOperationCount,a=void 0===o?NaN:o,i=e.runningOperationCount,s=void 0===i?NaN:i,u=e.maxRunningOperationCount,l=void 0===u?NaN:u,c=e.lightweightRunningOperationCount,d=void 0===c?NaN:c,p=r-s-d,m=q.A.Number(s),h=q.A.Number(p),f=q.A.Number(l),v=q.A.Number(a),g=q.A.Number(d),x="".concat(m," / ").concat(f),y="".concat(m," + ").concat(g," + ").concat(h," / ").concat(v);return(0,J.jsx)(ae.m,{className:de("progress",{operation:!0}),content:(0,J.jsx)(oe.Ay,{items:"running"===t?[{key:ce("operations-running-max"),value:f},{key:"operations-running",label:(0,J.jsxs)("span",{className:de("progress-meta-subitem"),children:[(0,J.jsx)(re.c,{marginRight:!0,color:"var(--success-color)"}),ce("operations-running")]}),value:m}]:[{key:ce("operation-count-max"),value:v},{key:"operations-running",label:(0,J.jsxs)("span",{className:de("progress-meta-subitem"),children:[(0,J.jsx)(re.c,{marginRight:!0,color:"var(--success-color)"}),ce("operations-running")]}),value:m},{key:"lightweigh",label:(0,J.jsxs)("span",{className:de("progress-meta-subitem"),children:[(0,J.jsx)(re.c,{marginRight:!0,color:"var(--default-color)"}),ce("operations-running-lightweigh")]}),value:g},{key:"pending",label:(0,J.jsxs)("span",{className:de("progress-meta-subitem"),children:[(0,J.jsx)(re.c,{marginRight:!0,color:"var(--info-color)"}),ce("operations-pending")]}),value:h}]}),children:"running"===t?(0,J.jsx)(Z.k,{className:de("progress-control",{left:!0}),stack:(0,ee.ok)([{value:s/l*100,theme:"success"}]),text:x}):(0,J.jsx)(Z.k,{className:de("progress-control",{right:!0}),stack:(0,ee.ok)([{value:s/a*100,theme:"success"},{value:d/a*100,theme:"default"},{value:p/a*100,theme:"info"}]),text:y})})}function fe(e){var t=null!=e?e:{},n=t.gpu,r=t.cpu,o=t.memory;return[n>0&&"".concat(q.A.Number(n)," GPU"),r>0&&"".concat(q.A.Number(r)," CPU"),o>0&&"".concat(q.A.Bytes(o)," RAM")].filter(Boolean).join(", ")}var ve=n(18801),ge=n(41655),xe=n.n(ge),ye=n(3962),Ae=n(55339),be=n(33559),_e=n(56747),we=n(81648),je=n(523),Ce=(0,i.A)("yt-expandable-cell");function Ne(e){var t=e.level,n=void 0===t?0:t,r=e.expanded,o=e.onExpand,a=e.children;return(0,J.jsxs)(Ae.s,{alignItems:"center",className:Ce({child:n>0}),overflow:"hidden",shrink:1,grow:1,children:[(0,J.jsx)(ke,{level:n}),(0,J.jsx)(je.L,{className:Ce("expand",{hidden:!o}),expanded:Boolean(r),toggleExpanded:function(){return null==o?void 0:o(!r)}}),a]})}function ke(e){var t=e.level;return t>0?(0,J.jsx)(Ae.s,{children:(0,w.A)(Array(t).keys()).map((function(e){return(0,J.jsx)("div",{className:Ce("splitter")},e)}))}):null}var Se=["className","virtualized","rowHeight","scrollToIndex","rowClassName","isHighlightedRow"],Pe=["children"],Ee=(0,i.A)("yt-gravity-table"),ze=function(e,t){if(!e)return t;var n=e.column.getIsPinned();return(0,p.A)({width:e.column.getSize(),minWidth:e.column.columnDef.minSize,maxWidth:e.column.columnDef.maxSize,left:"left"===n?"".concat(e.column.getStart("left"),"px"):void 0,right:"right"===n?"".concat(e.column.getAfter("right"),"px"):void 0},t)};function Oe(e){var t=e.className,n=e.virtualized,a=e.rowHeight,i=e.scrollToIndex,s=e.rowClassName,u=e.isHighlightedRow,l=(0,ve.A)(e,Se),c=o.useState(null),d=(0,r.A)(c,2),m=d[0],h=d[1],f=function(e){var t=e.element,n=e.timeout,a=void 0===n?1e3:n,i=o.useState(),s=(0,r.A)(i,2),u=s[0],l=s[1];return o.useEffect((function(){if(t){var e=setInterval((function(){var e=document.body.getBoundingClientRect().y,n=t.getBoundingClientRect().y,r=Math.round(n-e);u!==r&&l(r)}),a);return function(){return clearInterval(e)}}}),[u,t,a]),u}({element:m}),v=(0,we.L0)({count:l.table.getRowModel().rows.length,estimateSize:function(){return a},overscan:5,scrollMargin:f}),g=n?{rowVirtualizer:v}:{};o.useEffect((function(){var e;return void 0!==i&&i>=0&&(e=setTimeout((function(){return v.scrollToIndex(i,{align:"center"})}),500)),function(){return clearTimeout(e)}}),[v,i]);var x=o.useCallback((function(e){var t=u?u(null==e?void 0:e.original):void 0;return Ee("row",{highlighted:t},"string"==typeof s?s:null==s?void 0:s(e))}),[s,u]),y=l.cellAttributes,A=l.headerCellAttributes,b=o.useCallback((function(e){var t="function"==typeof y?y(e):y,n=(0,p.A)({},ze(e));return void 0!==n.left&&Object.assign(n,{left:"calc(".concat(n.left," + var(--gn-aside-header-size))")}),(0,p.A)((0,p.A)({},t),{},{style:(0,p.A)((0,p.A)({},null==t?void 0:t.style),n)})}),[y]),_=o.useCallback((function(e){var t="function"==typeof A?A(e):A,n=(0,p.A)({},ze(e));return void 0!==n.left&&Object.assign(n,{left:"calc(".concat(n.left," + var(--gn-aside-header-size))")}),(0,p.A)((0,p.A)({},t),{},{style:(0,p.A)((0,p.A)({},null==t?void 0:t.style),n)})}),[A]);return(0,J.jsx)("div",{className:Ee({virtualized:n},t),ref:h,children:(0,J.jsx)(we.XI,(0,p.A)((0,p.A)((0,p.A)({className:Ee("table"),stickyHeader:!0,rowClassName:x},g),l),{},{cellAttributes:b,headerCellAttributes:_}))})}function Ie(e){var t=e.children,n=(0,ve.A)(e,Pe);return(0,J.jsx)(Ae.s,(0,p.A)((0,p.A)({},n),{},{style:{height:"100%",width:"100%",overflow:"hidden"},alignItems:"center",wrap:"nowrap",children:t}))}var Te=n(44131),Me=n(63936),Ve=n(22269),Re=["className","tooltip"],Fe=["value","hideApproximateChar"],Be=(0,i.A)("yt-format-number");function Ue(e){var t=e.className,n=e.tooltip,r=function(e){var t=e.value,n=e.hideApproximateChar,r=(0,ve.A)(e,Fe);if(isNaN(t))return{content:q.A.NO_VALUE};var o=q.A[r.type](t,r.settings),a=String(t),i="Bytes"===r.type?(0,Ve.z)(o):Number(o.replaceAll(" ",""));return{content:o,title:a,prefix:n||t===i?void 0:Le}}((0,ve.A)(e,Re)),o=r.content,a=r.title,i=r.prefix,s=n?(0,J.jsx)(Me.Tu,{color:"secondary",children:n}):null;return(0,J.jsxs)(ae.m,{className:Be(null,t),content:(0,J.jsxs)(J.Fragment,{children:[s," ",(0,J.jsxs)("span",{children:[a," "]}),(0,J.jsx)(Te.A,{view:"clear",text:a,inlineMargins:!0})]}),children:[i,o]})}var Le="≈",De=n(66133),qe=n(88191),Ge=n(95664),He=n(45025),We=n(81954),Je=n(31470),Ke=n.n(Je),Qe=n(95942),Ye=n(59028),$e=500,Xe=(0,i.A)("share-usage-bar");function Ze(e){var t=e.className,n=e.shareValue,r=e.usageValue,a=e.shareTitle,i=e.usageTitle,s=e.forceTheme,u=e.title,l=Number(r)/Number(n);if(isNaN(n)||isNaN(r)||isNaN(l))return(0,J.jsx)(ae.m,{content:(0,J.jsxs)(o.Fragment,{children:[(0,J.jsxs)("div",{children:[a,": ",n]}),(0,J.jsxs)("div",{children:[i,": ",r]})]}),children:q.A.NO_VALUE});var c=(0,ie.z)(r,2*Number(n)),d=c.value,p=c.theme;return(0,J.jsxs)(ae.m,{className:Xe(null,t),content:(0,J.jsxs)(o.Fragment,{children:[u,(0,J.jsxs)("div",{children:[i," / ",a," = ",q.A.Number(l,{digits:3})]})]}),children:[(0,J.jsx)(Z.k,{className:Xe("progress"),size:"s",value:Number(d),theme:s||p}),(0,J.jsx)("div",{className:Xe("tick")})]})}const et=o.memo(Ze);var tt=n(57614),nt=n(68175),rt=n(12937),ot=n(29121),at=n(66134),it=n(10785),st=n(23842),ut=n(39760),lt=n.n(ut),ct=n(27859),dt=n(40519);function pt(e,t){return{command:"get",parameters:(0,p.A)((0,p.A)({path:e},t),dt.R)}}function mt(e,t){return{command:"list",parameters:(0,p.A)((0,p.A)((0,p.A)({path:e},t),dt.R),dt.v)}}var ht=n(617),ft=n(76365),vt=n(11865),gt=n(17897),xt=n(91984),yt=new ft.A,At=["accumulated_resource_ratio_volume","accumulated_resource_volume","demand_ratio","detailed_fair_share","dominant_resource","effective_lightweight_operations_enabled","estimated_burst_usage_duration_sec","fair_share_ratio","fifo_index","fifo_sort_parameters","integral_guarantee_type","integral_pool_capacity","is_ephemeral","max_operation_count","max_running_operation_count","lightweight_running_operation_count","max_share_ratio","min_share_ratio","mode","operation_count","parent","pool_operation_count","child_pool_count","resource_demand","resource_limits","specified_resource_limits","resource_usage","estimated_guarantee_resources","effective_strong_guarantee_resources","running_operation_count","specified_burst_guarantee_resources","specified_resource_flow","starvation_status","starving","strong_guarantee_resources","usage_ratio","weight","abc"],bt=["integral_guarantees","weight","max_operation_count","max_running_operation_count","strong_guarantee_resources","resource_limits","specified_resource_limits","forbid_immediate_operations","create_ephemeral_subpools","fifo_sort_parameters","config","folder_id"],_t=function(e){function t(){return(0,ot.A)(this,t),(0,at.A)(this,t,arguments)}return(0,it.A)(t,e),(0,rt.A)(t)}((0,st.A)(Error));function wt(e){return function(t,n){var o=(0,_.d_)(n());if(e)return o===x.W1?t(jt(e)):ct.Qq.executeBatch(ct.Vu.schedulingPoolFullPath,{requests:[{command:"get",parameters:{path:"//sys/scheduler/orchid/scheduler/pool_trees/".concat(e,"/pools/").concat(o),fields:["is_ephemeral","full_path"]}}]}).then((function(n){var o=(0,r.A)(n,1)[0].output,a=null!=o?o:{},i=a.full_path,s=a.is_ephemeral;if(!i)throw new _t;t(function(e,t,n){return function(r,o){for(var a=o(),i=(0,He.bJ)(a),s=new Map(i[e]),u=t.split("/").slice(1),l=0;l<u.length;++l){var c=u[l],d=u.slice(0,l).join("/");s.set(c,{parentPoolPath:d,isEphemeral:n})}r(Nt(e,s))}}(e,i,s)),t(jt(e))})).catch((function(e){e instanceof _t?t({type:x.Q$,data:{pool:x.W1}}):xt.X.add({name:"schedulingPoolFullPath",theme:"danger",title:""})}))}}function jt(e){return function(t,n){var o,a=n(),i=(0,He.op)(a),s=i?new Map:null!==(o=(0,He.bJ)(a)[e])&&void 0!==o?o:new Map,u=(0,w.A)(s.keys()),l=(0,w.A)(u),c=[];if(i)c.push(pt("//sys/scheduler/orchid/scheduler/pool_trees/".concat(e,"/operations")));else{var d="//sys/scheduler/orchid/scheduler/pool_trees/".concat(e,"/operations_by_pool");l.forEach((function(e){c.push(pt("".concat(d,"/").concat(e)))}))}var p=i,m=[],f=[],v=[],g=[x.W1].concat((0,w.A)(u));return p?(m.push(pt("//sys/scheduler/orchid/scheduler/pool_trees/".concat(e,"/pools"),{fields:At})),v.push(pt("//sys/pool_trees/".concat(e),{attributes:bt}))):g.forEach((function(t){var n;m.push(pt("//sys/scheduler/orchid/scheduler/pool_trees/".concat(e,"/pools/").concat(t),{fields:At})),f.push(pt("//sys/scheduler/orchid/scheduler/pool_trees/".concat(e,"/child_pools_by_pool/").concat(t),{fields:At}));var r=null!==(n=s.get(t))&&void 0!==n?n:{},o=r.parentPoolPath,a=r.isEphemeral,i=o?"//sys/pool_trees/".concat(e,"/").concat(o,"/").concat(t):"//sys/pool_trees/".concat(e,"/").concat(t);t!==x.W1&&a||v.push(mt(t===x.W1?"//sys/pool_trees/".concat(e):i,{attributes:bt}))})),yt.removeAllRequests(),t({type:x.HY}),Promise.all([c.length?ct.Qq.executeBatch(ct.Vu.schedulingLoadOperationsPerPool,{parameters:{requests:c},cancellation:yt.saveCancelToken}):Promise.resolve([]),ct.Qq.executeBatch(p?ct.Vu.schedulingLoadPoolsAll:ct.Vu.schedulingLoadPoolsPerPool,{parameters:{requests:m},cancellation:yt.saveCancelToken}),p?Promise.resolve([]):ct.Qq.executeBatch(ct.Vu.schedulingLoadChildrenPerPool,{parameters:{requests:f},cancellation:yt.saveCancelToken}),v.length?ct.Qq.executeBatch(ct.Vu.schedulingLoadCypressDataPerPool,{parameters:{requests:v},cancellation:yt.saveCancelToken}):Promise.resolve([])]).then((function(n){var o,a=(0,r.A)(n,4),i=a[0],s=a[1],u=a[2],c=a[3],d=new gt.n("Failed to load expanded pools"),m=(0,ie.hC)(i,d,ie.o8),f=m.results,v=m.errorIgnoredIndices,y=h()(f,(function(e,t){return Object.assign(e,t)}),{}),A={};lt()(v,(function(e){A[l[e]]=!1}));var b={},_={};if(p){var j=(0,ie.hC)(s,d).results,C=null!=j?j:[],N=(0,r.A)(C,1)[0],k=void 0===N?{}:N;Object.assign(b,k);var S=(0,ie.hC)(c,d),P=(0,r.A)(S.results,1)[0];Object.assign(_,(0,vt.Aj)(P))}else{var E=(0,ie.hC)(s,d,ie.o8),z=E.results,O=E.resultIndices,I=E.errorIgnoredIndices;z.forEach((function(e,t){var n=g[O[t]];b[n]=e}));var T=(0,ie.hC)(u,d,ie.o8),M=T.results,V=T.errorIgnoredIndices;M.forEach((function(e){Object.assign(b,e)}));var R=(0,ie.hC)(c,d,ie.o8),F=R.results,B=R.errorIgnoredIndices;F.forEach((function(e){e.forEach((function(e){_[e.$value]=e}))})),lt()([].concat((0,w.A)(I),(0,w.A)(V),(0,w.A)(B)),(function(e){var t=g[e];A[t]=!1})),Ct(A)}var U=Object.keys(b).sort();if(t({type:x.L$,data:{expandedPoolsTree:e,rawOperations:Object.keys(y).length?y:ht.t0,rawPools:U.length?U.reduce((function(e,t){return e[t]=b[t],e}),{}):ht.t0,flattenCypressData:Object.keys(_).length?_:ht.t0}}),null!==(o=d.inner_errors)&&void 0!==o&&o.length)throw d})).catch((function(e){(0,ft.m)(e)||t({type:x.AH,data:{error:e}})}))}}function Ct(e){return function(t,n){var r=n(),o=(0,_.Jv)(n()),a=(0,He.bJ)(r),i=(0,z.w3)(r),s=new Map(a[o]);lt()(e,(function(e,t){if(e){var n=function(e,t){for(var n,r=t[e],o=null===(n=r)||void 0===n?void 0:n.isEphemeral,a="";null!==(i=r)&&void 0!==i&&i.parent&&r.parent!==x.W1;){var i;a=a?"".concat(r.parent,"/").concat(a):r.parent,r=t[r.parent]}return{parentPoolPath:a,isEphemeral:o}}(t,i);s.set(t,n)}else s.delete(t)})),t(Nt(o,s)),t(wt(o))}}function Nt(e,t){return function(n,r){var o=(0,He.bJ)(r()),a=(0,p.A)((0,p.A)({},o),{},(0,nt.A)({},e,t));n({type:x.Ar,data:{expandedPools:a}})}}function kt(e){return function(t,n){var r=n(),o=(0,_.IY)(r),a=(0,_.Jv)(r);return{fullPath:(0,_.un)(e,o,a),orchidPath:"//sys/scheduler/orchid/scheduler/pool_trees/".concat(a,"/pools/").concat(e)}}}var St=n(96843),Pt=n.n(St),Et=n(27528),zt=n.n(Et),Ot=n(79832),It=n.n(Ot),Tt=n(36146),Mt=n.n(Tt),Vt=n(25897),Rt=n.n(Vt),Ft=n(16737),Bt=n.n(Ft),Ut=n(73100),Lt=n.n(Ut),Dt=n(79329),qt=n(13724),Gt=n(78373),Ht=n.n(Gt),Wt=n(26777),Jt=n(84092),Kt=n.n(Jt),Qt=n(11896),Yt=n(79488),$t=["guaranteeType"];function Xt(){return function(e,t){e({type:x.g4});var n=t(),o=(0,_.nX)(n),a=(0,E.dB)(n),i=new ct.CT(a,Qt.c.SCHEDULING);return i.fetch(ct.Vu.schedulingData,ct.Qq.executeBatch(ct.Vu.schedulingData,(0,p.A)({requests:[pt("//sys/scheduler/@alerts"),mt("//sys/scheduler/orchid/scheduler/pool_trees"),pt("//sys/scheduler/orchid/scheduler/default_pool_tree")]},dt.R))).then((function(n){var a=(0,ie.hC)(n,"Failed to fetch scheduling data"),s=a.error,u=(0,r.A)(a.results,3),l=u[0],c=u[1],d=u[2];if(s)return Promise.reject(s);var m=t(),h=(0,vt.V0)(c),f=(0,vt.DX)(d,h,m.scheduling.scheduling.tree);o&&e(tn(f,{checkFilters:!0})),e({type:x.VQ,data:{schedulerAlerts:l,trees:h,tree:f}});var v=[pt("//sys/scheduler/orchid/scheduler/pool_trees/".concat(f,"/resource_usage")),pt("//sys/scheduler/orchid/scheduler/pool_trees/".concat(f,"/resource_limits")),pt("//sys/scheduler/orchid/scheduler/pool_trees/".concat(f,"/config")),pt("//sys/scheduler/orchid/scheduler/pool_trees/".concat(f,"/resource_distribution_info"))];return o||e(wt(f)),i.fetch(ct.Vu.schedulingLoadTree,ct.$S.executeBatch(ct.Vu.schedulingLoadTree,(0,p.A)({requests:v},dt.R))).then((function(e){var t=(0,ie.mb)(e,v),n=(0,ie.hC)(t.results,"Failed to fetch tree details"),r=n.error,o=n.results;if(r)throw r;return o}))})).then((function(t){var n=(0,r.A)(t,4),o={resource_usage:n[0],resource_limits:n[1],config:n[2],resource_distribution_info:n[3]};e({type:x.aO,data:{treeResources:o}})})).catch((function(t){t.code!==Kt().codes.CANCELLED&&e({type:x.nr,data:{error:t}})}))}}function Zt(){return{type:x.DI,data:{visibility:!1,item:void 0}}}function en(e){var t=e.poolPath,n=e.values,r=e.initials,o=e.tree;if(Pt()(n))return Promise.resolve();var a=[],i=[],s=n.guaranteeType,u=(0,ve.A)(n,$t);return lt()(u,(function(e,t){var n=e||{},o=n.limit,s=n.source,u=t,l=vt.mS[u];if(s&&void 0!==o){var c,d=(o||0)-((null===(c=r[u])||void 0===c?void 0:c.limit)||0);d&&a.push({diff:d,source:s,path:l})}else i.push({attr:l,value:o})})),Object.hasOwnProperty.call(n,"guaranteeType")&&i.push({attr:vt.mS.guaranteeType,value:s}),(0,Wt.D1)(t,i).then((function(){return function(e){var t=e.poolPath,n=e.transferData,r=e.tree;if(Pt()(n))return Promise.resolve();var o=t.split("/"),a=o[o.length-1],i=zt()(n,(function(e){var t=e.diff,n=e.source,o=e.path,i=(o.startsWith(vt.YK)?o.substr(vt.YK.length):o).replace(/\//g,"."),s=Ht()({},i,(function(){return Math.abs(t)}));return{command:"transfer_pool_resources",parameters:{source_pool:t>0?n:a,destination_pool:t>0?a:n,pool_tree:r,resource_delta:s}}}));return ct.$S.executeBatch(ct.Vu.schedulingTransferPoolQuota,{requests:i}).then((function(e){var t=(0,ie.$7)(e.results,"Failed to transfer pool quota");return t?Promise.reject(t):e}))}({poolPath:t,transferData:a,tree:o})}))}function tn(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).checkFilters;return function(n,r){var o=r();if(!t||(0,Yt.Gr)(o)){var a=(0,Yt.x2)(o),i=a.lastTime,s=a.lastTree;if(!(e===s&&Date.now()-i<12e4))return(0,ie.fI)(ct.Qq.get(ct.Vu.schedulingFilterAttributes,(0,p.A)({path:"//sys/scheduler/orchid/scheduler/pool_trees/".concat(e,"/pools"),fields:["parent","abc"]},dt.R)),{skipSuccessToast:!0,toasterName:"schedulingLoadFilterAttributes",errorContent:"Failed to load attributes required for filtering"}).then((function(t){n({type:x.VQ,data:{attributesToFilter:t,attributesToFilterParams:{lastTime:Date.now(),lastTree:e}}})}))}}}var nn=n(33952),rn=function(e,t,n){return n===t?Promise.resolve():ct.X8.set({path:"".concat(e,"/@name")},t)},on=function(e,t,n){var r=n.fifoSortParams.join("|"),o=t.fifoSortParams.join("|"),a=[];return n.forbidImmediateOperations!==t.forbidImmediateOperations&&a.push({command:"set",parameters:{path:"".concat(e,"/@forbid_immediate_operations")},input:t.forbidImmediateOperations}),n.createEphemeralSubpools!==t.createEphemeralSubpools&&a.push({command:"set",parameters:{path:"".concat(e,"/@create_ephemeral_subpools")},input:t.createEphemeralSubpools}),r!==o&&a.push({command:"set",parameters:{path:"".concat(e,"/@fifo_sort_parameters")},input:t.fifoSortParams}),a},an=function(e,t,n,r){if(Pt()(t)&&Pt()(n))return Promise.resolve();var o={userSlots:"user_slots"},a=zt()(n,(function(e,t){return o[t]||t})),i=It()(t,(function(e,t){return o[t]||t}));return ct.Qq.get(ct.Vu.schedulingGetAttrsBeforeEdit,{path:"".concat(e,"/@").concat(r)}).then((function(t){var n=(0,p.A)((0,p.A)({},t),i),o=Rt()(n,a);return ct.X8.set({path:"".concat(e,"/@").concat(r)},o)})).catch((function(t){return 500===t.code?ct.X8.set({path:"".concat(e,"/@").concat(r)},i):Promise.reject(t)}))},sn=function(e,t,n){var r,o,a=function(e,t){return e===t},i=Lt()(t,(function(e){return""===e||null==e})),s=[];if(a(t.mode,n.mode)||s.push({command:"set",parameters:{path:"".concat(e,"/@mode")},input:t.mode}),!a(null===(r=t.weight)||void 0===r?void 0:r.value,null===(o=n.weight)||void 0===o?void 0:o.value))if(function(e,t){return Object.prototype.hasOwnProperty.call(t,"weight")}(0,i))s.push({command:"remove",parameters:{path:"".concat(e,"/@weight")}});else if(!a(t.weight,n.weight)){var u;s.push({command:"set",parameters:{path:"".concat(e,"/@weight")},input:Number(null===(u=t.weight)||void 0===u?void 0:u.value)})}return s};function un(e){return""===e||isNaN(Number(e))}function ln(e){return!un(e)}function cn(e,t,n){return function(r,o){var a=o(),i=(0,_.Jv)(a),s=(0,_.IY)(a),u=(0,vt.v0)(e,s),l="//sys/pool_trees/".concat(i,"/").concat(u),c=Lt()(t.resourceLimits,ln),d=Lt()(t.resourceLimits,un),m=Mt()(c,(function(e){return Number(e)}));r({type:x.t0});var h=[].concat((0,w.A)(sn(l,t.general,n.general)),(0,w.A)(on(l,t.otherSettings,n.otherSettings)));return Promise.all([ct.Qq.executeBatch(ct.Vu.schedulingEditPool,{requests:h}).then((function(e){var t=(0,ie.hC)(e,"Failed to fetch pool details").error;if(t)return Promise.reject(t)})),en({poolPath:l,values:(0,p.A)((0,p.A)((0,p.A)({},t.resourceGuarantee),t.integralGuarantee),Bt()(t.general,Object.keys(vt.oB))),initials:(0,p.A)((0,p.A)((0,p.A)({},n.resourceGuarantee),n.integralGuarantee),Bt()(n.general,Object.keys(vt.oB))),tree:i}),an(l,m,d,"resource_limits"),rn(l,t.general.name,n.general.name)]).then((function(){xt.X.add({name:"edit pool",autoHiding:1e4,theme:"success",title:"Successfully edited ".concat(e.name,". Please wait.")}),r({type:x.Hi}),r(dn()),setTimeout((function(){return r(Xt())}),3e3)})).catch((function(e){if(e.code!==nn.N.CANCELLED)return r({type:x.O5,data:{error:e}}),Promise.reject(e)}))}}function dn(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cancelled;return function(t){t({type:x.dH,data:{visibility:!1,item:void 0}}),e&&t({type:x.ze})}}function pn(e){return function(t){t({type:x.E4,data:{tree:e}}),t(Xt())}}function mn(e){return{type:x.Q$,data:{pool:e}}}var hn=n(31285),fn=n.n(hn),vn=n(29347),gn=n.n(vn),xn=n(85935),yn=["name","FI","weight","fair_share_usage","fair_share","usage","demand","min_share","operation_overview","dominant_resource","actions"],An=(0,S.Mz)([Qe.u],(function(e){var t=e["global::scheduling::overviewColumns"];if(!t)return[].concat(yn);var n=gn()(["name"].concat((0,w.A)(t.map((function(e){return(0,xn.G)(e)?e:void 0}))),["actions"]));return fn()(n)}));const bn=JSON.parse('{"pool-operation":"Pool / Operation"}'),_n=JSON.parse('{"pool-operation":"Пул / Операция"}'),wn=(0,se.Kc)("yt:scheduling-table",{en:bn,ru:_n});var jn=n(76426),Cn=n(12541),Nn=n(43739),kn=n(88314),Sn=n.n(kn),Pn=(0,i.A)("scheduling-pool-tags");function En(e){var t=e.pool.integralType;return"burst"===t||"relaxed"===t?(0,J.jsx)(De.A,{className:Pn("tag"),text:Sn()(t),theme:"complementary"},"guarantee-type"):null}const zn=o.memo(En);var On=(0,i.A)("yt-scheduling-name-cell");function In(e){var t=e.row,n=(0,a.d)(Nn.dB),r=(0,a.d)(z.Jv),i=(0,a.d)(_.cO),s=(0,a.w)(),u=(0,a.d)(_.aQ),l=o.useCallback((function(e,t){s(Ct((0,nt.A)({},e,t)))}),[s]),c=t.name,d=t.type,p=t.level,m=void 0===p?0:p,h=t.incomplete,f=(null==i?void 0:i.name)===c,v=t.attributes,g=v.child_pool_count,x=void 0===g?0:g,y=v.pool_operation_count,A=x>0||(void 0===y?0:y)>0,b="pool"===d?Boolean(null==u?void 0:u.get(c)):void 0;return(0,J.jsx)(Ne,{level:m,expanded:b,onExpand:!f&&A?function(){return l(c,!b)}:void 0,children:"pool"===t.type?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Cn.s,{hideTree:!0,routed:!0,className:On("pool"),cluster:n,pool:{pool:h?"":t.name,tree:r,isLightweight:t.isEffectiveLightweight,isEphemeral:t.isEphemeral},theme:"primary"}),(0,J.jsx)("span",{style:{flex:"1 1 0px"}}),(0,J.jsx)(zn,{pool:t})]}):Tn({cluster:n,row:t})})}function Tn(e){var t=e.cluster,n=e.row,r=n.id,o=n.attributes.title,a=n.fifoIndex,i="/".concat(t,"/operations/").concat(r),s=void 0!==a?(0,J.jsxs)(ae.m,{content:"Fifo index: ".concat(a),children:["#",a," "]}):null,u=0>(null==o?void 0:o.length);return(0,J.jsxs)(Ae.s,{direction:"column",style:{margin:"-4px 0"},overflow:"hidden",children:[(0,J.jsxs)(ye.E,{variant:"inherit",ellipsis:!0,children:[s,(0,J.jsx)(jn.A,{url:i,children:null!=o?o:r})]}),!u&&(0,J.jsx)(ye.E,{variant:"code-inline-1",color:"secondary",ellipsis:!0,children:r})]})}function Mn(e){var t=e.pool,n=(0,X.d4)(Nn.jU);return W.Ay.renderSchedulingTableItemExtraControls({pool:t,clusterUiConfig:n})}var Vn=["type"],Rn=(0,i.A)("yt-scheduling-table");function Fn(){var e,t,n,i=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.minWidth,s=void 0===i?50:i,u=n.maxWidth,l=void 0===u?800:u,c=(0,a.w)(),d=null!==(t=(0,a.d)(Qe.u)[e])&&void 0!==t?t:{},m=o.useRef({time:0});return{columnSizes:d,setColumnSizes:function(t){c((function(n,o){var a,i=null!==(a=(0,Qe.u)(o())[e])&&void 0!==a?a:{},u="function"==typeof t?t({}):t,d=(0,p.A)((0,p.A)({},i),u),h=Date.now();h-m.current.time<$e&&Ke()(m.current.changes,u)&&Object.keys(u).forEach((function(e){delete d[e]})),Object.assign(m.current,{time:h,changes:u}),Ke()(i,d)||c((0,Ye.rw)(e,Object.entries(d).reduce((function(e,t){var n=(0,r.A)(t,2),o=n[0],a=n[1];return e[o]=Math.max(s,Math.min(l,a)),e}),{})))}))}}}("global::scheduling::overviewColumnSizes",{minWidth:80}),s=i.columnSizes,u=i.setColumnSizes,l=(e="global::scheduling::overviewColumns",n=(0,a.w)(),{visibleColumns:null!==(t=(0,a.d)(Qe.u)[e])&&void 0!==t?t:[],onColumnVisibilityChange:function(t){n((function(r,o){var a,i=null!==(a=(0,Qe.u)(o())[e])&&void 0!==a?a:[],s="function"==typeof t?t({}):t,u=(0,w.A)(i);Object.keys(s).forEach((function(e){var t=u.indexOf(e);s[e]?-1===t&&u.push(e):-1!==t&&u.splice(t,1)})),Ke()(i,u)||n((0,Ye.rw)(e,u))}))},onColumnOrderChange:function(t){n((function(r,o){var a,i=null!==(a=(0,Qe.u)(o())[e])&&void 0!==a?a:[],s=new Set(i),u=("function"==typeof t?t([]):t).filter((function(e){return s.has(e)}));Ke()(i,u)||n((0,Ye.rw)(e,u))}))}}),c=l.onColumnVisibilityChange,d=l.onColumnOrderChange,m=function(){var e,t,n,r=(t=(0,a.d)(_.BY),n=(0,a.d)(An),"custom"===t?n:null!==(e=Bn[t])&&void 0!==e?e:[]),i=o.useMemo((function(){var e=[{id:"name",header:function(){return(0,J.jsx)(qn,{})},size:400,cell:function(e){var t=e.row.original;return(0,J.jsx)(Ie,{children:(0,J.jsx)(In,{row:t})})},enableColumnFilter:!1,enableHiding:!1},{id:"weight",header:function(){return(0,J.jsx)(Qn,{column:"weight",allowUnordered:!0})},cell:function(e){var t=e.row.original,n=t.weightEdited,r=void 0===n?NaN:n,o=t.type,a=t.weight;return(0,J.jsx)(Ie,{children:"pool"===o?(0,J.jsx)(Hn,{value:a,edited:r,type:"NumberSmart"}):(0,J.jsx)(Ue,{value:a,type:"NumberSmart"})})},size:100},{id:"view_mode",header:function(){return(0,J.jsx)(Qn,{column:"view_mode",title:"Mode",allowUnordered:!0})},cell:function(e){var t=e.row.original,n=t.type,r=t.mode;return(0,J.jsx)(Ie,{children:"pool"===n?(0,J.jsx)(ye.E,{variant:"inherit",color:"secondary",children:q.A.ReadableField(r)}):(0,J.jsx)(qe.S,{value:t.operationType})})},size:100},{id:"owner",header:function(){return(0,J.jsx)(Qn,{column:"owner",title:"Owner",allowUnordered:!0})},cell:function(e){var t=e.row.original,n=t.user,r="operation"===t.type?n?(0,J.jsx)(Ge.R,{name:n,type:"user"}):q.A.NO_VALUE:(0,J.jsx)(Mn,{pool:t});return(0,J.jsx)(Ie,{children:r})}},Ln("dominant_resource",{size:100}),{id:"fair_share_usage",header:function(){return(0,J.jsx)(Qn,{column:"fair_share_usage",title:"Usage / Fair share",allowUnordered:!0})},cell:function(e){var t=e.row.original;return(0,J.jsx)(Ie,{justifyContent:"center",children:(0,J.jsx)(Kn,{item:t})})}},{id:"usage",header:function(){return(0,J.jsx)(Qn,{column:"abs_usage_cpu",title:"Usage",options:[{column:"abs_usage_cpu",title:"CPU",allowUnordered:!0},{column:"abs_usage_gpu",title:"GPU",allowUnordered:!0},{column:"abs_usage_memory",title:"RAM",allowUnordered:!0},{column:"fair_share",title:"Ratio",allowUnordered:!0}]})},cell:function(e){var t=e.row.original;return(0,J.jsx)(Ie,{children:(0,J.jsx)(Gn,{item:t,type:"usage"})})},size:100},{id:"demand",header:function(){return(0,J.jsx)(Qn,{column:"abs_demand_cpu",title:"Demand",options:[{column:"abs_demand_cpu",title:"CPU",allowUnordered:!0},{column:"abs_demand_gpu",title:"GPU",allowUnordered:!0},{column:"abs_demand_memory",title:"RAM",allowUnordered:!0},{column:"fair_share",title:"Ratio",allowUnordered:!0}]})},cell:function(e){var t=e.row.original;return(0,J.jsx)(Ie,{children:(0,J.jsx)(Gn,{item:t,type:"demand"})})},size:100},{id:"guaranteed",header:function(){return(0,J.jsx)(Qn,{column:"abs_effective_guaranteed_cpu",title:"Guarantee",options:[{column:"abs_effective_guaranteed_cpu",title:"CPU",allowUnordered:!0},{column:"abs_effective_guaranteed_gpu",title:"GPU",allowUnordered:!0},{column:"abs_effective_guaranteed_memory",title:"RAM",allowUnordered:!0},{column:"fair_share",title:"Ratio",allowUnordered:!0}]})},cell:function(e){var t=e.row.original;return(0,J.jsx)(Ie,{children:(0,J.jsx)(Gn,{item:t,type:"effectiveGuaranteed"})})},size:100},{id:"operation_overview",header:function(){return(0,J.jsx)(Qn,{column:"running_operation_count",title:"Operations",options:[{column:"running_operation_count",title:"Running",allowUnordered:!0},{column:"max_operation_count",title:"Max count",allowUnordered:!0}]})},cell:function(e){var t=e.row.original,n=t.maxOperationCount,r=t.maxOperationCountEdited,o=t.runningOperationCount;return"operation"===t.type?(0,J.jsx)(Ie,{children:q.A.NO_VALUE}):(0,J.jsx)(Ie,{children:(0,J.jsxs)(ye.E,{variant:"inherit",ellipsis:!0,children:[(0,J.jsx)(Ue,{value:o,type:"NumberSmart"})," / ",(0,J.jsx)(Hn,{value:n,edited:r,type:"NumberSmart"})]})})},size:120},{id:"duration",header:function(){return(0,J.jsx)(Qn,{column:"duration"})},cell:function(e){var t=e.row.original.startTime;return(0,J.jsx)(Ie,{children:(0,J.jsx)(Dn,{start:t})})}},{id:"FI",header:function(){return(0,J.jsx)(Qn,{column:"FI"})},cell:function(e){var t=e.row.original;return void 0===t.fifoIndex||"operation"!==t.type?"":t.fifoIndex},size:50},{id:"operation_progress",header:function(){return(0,J.jsx)(Qn,{column:"operation_count",title:xn.b.operation_progress.caption,options:[{column:"operation_progress",title:"Progress",allowUnordered:!0},{column:"operation_count",title:"Count",allowUnordered:!0},{column:"max_operation_count",title:"Max count",allowUnordered:!0}]})},cell:function(e){var t=e.row.original,n=xn.b.operation_progress,r=n.get(t),o=(0,ee.F0)(r),a=n.text(t);return isNaN(r)?q.A.NO_VALUE:(0,J.jsx)(Z.k,{value:100*r,theme:o,text:a})}},{id:"running_operation_progress",header:function(){return(0,J.jsx)(Qn,{column:"running_operation_progress",title:xn.b.running_operation_progress.caption,options:[{column:"running_operation_progress",title:"Progress",allowUnordered:!0},{column:"running_operation_count",title:"Count",allowUnordered:!0},{column:"max_running_operation_count",title:"Max running",allowUnordered:!0}]})},cell:function(e){var t=e.row.original,n=xn.b.running_operation_progress,r=n.get(t),o=(0,ee.F0)(r),a=n.text(t);return isNaN(r)?q.A.NO_VALUE:(0,J.jsx)(Z.k,{value:100*r,theme:o,text:a})}},Un("abs_demand_cpu",{hideApproximateChar:!0}),Un("abs_demand_gpu",{hideApproximateChar:!0}),Un("abs_demand_memory",{type:"Bytes",hideApproximateChar:!0}),Un("abs_demand_user_slots"),Un("abs_guaranteed_cpu",{hideApproximateChar:!0}),Un("abs_guaranteed_gpu",{hideApproximateChar:!0}),Un("abs_guaranteed_memory",{type:"Bytes",hideApproximateChar:!0}),Un("abs_guaranteed_user_slots"),Un("abs_usage_cpu",{hideApproximateChar:!0}),Un("abs_usage_gpu",{hideApproximateChar:!0}),Un("abs_usage_memory",{type:"Bytes",hideApproximateChar:!0}),Un("abs_usage_user_slots"),Un("accumulated"),Un("burst_cpu"),Un("burst_duration"),Un("children_burst_cpu"),Un("children_flow_cpu"),Un("flow_cpu"),Ln("integral_type"),Un("max_operation_count"),Un("max_running_operation_count"),Un("min_resources_cpu",{hideApproximateChar:!0}),Un("min_resources_gpu",{hideApproximateChar:!0}),Un("min_resources_memory",{type:"Bytes",hideApproximateChar:!0}),Un("min_resources_user_slots"),Un("operation_count"),Un("resource_detailed_cpu",{hideApproximateChar:!0}),Un("resource_detailed_gpu",{hideApproximateChar:!0}),Un("resource_detailed_memory",{type:"Bytes",hideApproximateChar:!0}),Un("resource_detailed_user_slots"),Un("resource_limit_cpu"),Un("resource_limit_gpu"),Un("resource_limit_memory",{type:"Bytes",hideApproximateChar:!0}),Un("resource_limit_user_slots"),Un("running_operation_count"),{id:"actions",header:function(e){return(0,J.jsx)(Yn,{table:e.table})},size:50,cell:function(e){var t=e.row.original;return(0,J.jsx)(Jn,{item:t})},enableColumnFilter:!1,enableHiding:!1,enableResizing:!1}];return e}),[]),s=o.useMemo((function(){var e=new Set(r),t=i.reduce((function(t,n){var r=n.id;return t[r]="name"===r||"actions"===r||e.has(r),t}),{}),n=[].concat((0,w.A)(r.filter((function(e){return t[e]}))),(0,w.A)(Object.keys(t).filter((function(e){return!t[e]}))));return{columnVisibility:t,columnOrder:n}}),[r,i]),u=s.columnVisibility,l=s.columnOrder;return{columns:i,columnVisibility:u,columnOrder:l}}(),h=m.columns,f=m.columnVisibility,v=m.columnOrder,g=(0,a.d)(_.Uo),x=(0,a.d)(Yt.Gt),y=(0,we.K2)({columns:h,data:g,enableColumnPinning:!0,enableColumnResizing:!0,state:{columnPinning:{left:["name"],right:["actions"]},columnSizing:s,columnVisibility:f,columnOrder:v},onColumnSizingChange:u,onColumnVisibilityChange:c,onColumnOrderChange:d}),A=o.useMemo((function(){return x?{scrollToIndex:g.findIndex((function(e){var t=e.id;return x===t})),isHighlightedRow:function(e){return(null==e?void 0:e.id)===x}}:{}}),[x,g]),b=A.scrollToIndex,j=A.isHighlightedRow;return(0,J.jsx)(Oe,{className:Rn(),table:y,virtualized:!0,rowHeight:49,scrollToIndex:b,isHighlightedRow:j})}var Bn={summary:["weight","view_mode","owner","dominant_resource","fair_share_usage","usage","demand","guaranteed","operation_overview","duration"],cpu:["weight","min_resources_cpu","abs_guaranteed_cpu","abs_demand_cpu","resource_detailed_cpu","abs_usage_cpu","resource_limit_cpu"],memory:["weight","min_resources_memory","abs_guaranteed_memory","abs_demand_memory","resource_detailed_memory","abs_usage_memory","resource_limit_memory"],gpu:["weight","min_resources_gpu","abs_guaranteed_gpu","abs_demand_gpu","resource_detailed_gpu","abs_usage_gpu","resource_limit_gpu"],user_slots:["weight","min_resources_user_slots","abs_guaranteed_user_slots","abs_demand_user_slots","resource_detailed_user_slots","abs_usage_user_slots","resource_limit_user_slots"],operations:["running_operation_count","max_running_operation_count","running_operation_progress","operation_count","max_operation_count","operation_progress"],integral_guarantees:["integral_type","burst_cpu","children_burst_cpu","flow_cpu","children_flow_cpu","accumulated","burst_duration"],custom:[]};function Un(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,r=void 0===n?"NumberSmart":n,o=(0,ve.A)(t,Vn),a=xn.b[e],i=(0,p.A)({caption:void 0},a).caption;return{id:e,header:function(){return(0,J.jsx)(Qn,{column:e,title:i})},cell:function(e){var t,n=e.row.original;return"sort"in a&&"function"==typeof a.sort?t=a.sort(n):"get"in a&&"function"==typeof a.get&&(t=a.get(n)),(0,J.jsx)(Ie,{children:(0,J.jsx)(Ue,(0,p.A)({value:t,type:r},o))})}}}function Ln(e,t){var n=xn.b[e],r=(0,p.A)({caption:void 0},n).caption;return(0,p.A)({id:e,header:function(){return(0,J.jsx)(Qn,{column:e,title:r})},cell:function(e){var t,r=e.row.original;return"sort"in n&&"function"==typeof n.sort?t=n.sort(r):"get"in n&&"function"==typeof n.get&&(t=n.get(r)),(0,J.jsx)(Ie,{children:void 0===t?q.A.NO_VALUE:q.A.ReadableField(t)})}},t)}var Dn=o.memo(Wn);function qn(){var e=(0,a.d)(He.T7),t=(0,a.d)(_.LM);return(0,J.jsx)(Qn,{title:wn("pool-operation"),column:"name",loading:t||e,allowUnordered:!0})}function Gn(e){var t,n,r,o,i=e.item,s=e.type,u=(0,a.d)(_.Xr),l=null!==(t=(0,a.d)(_.Ul))&&void 0!==t?t:"CPU",c=i.fairShareRatio;if(!u&&!c)return(0,J.jsx)(Ie,{children:q.A.Number(void 0)});if(!u)return(0,J.jsx)(Ie,{children:(0,J.jsx)(Ue,{value:c,type:"NumberSmart"})});var d=(null!=i?i:{}).resources,p=null==d||null===(n=d.cpu)||void 0===n?void 0:n[s],m=null==d||null===(r=d.gpu)||void 0===r?void 0:r[s],h=null==d||null===(o=d.user_memory)||void 0===o?void 0:o[s];if(u&&!p&&!m&&!h)return(0,J.jsx)(Ie,{children:q.A.Number(void 0)});var f=q.A.NumberSmart(p)+" CPU",v=q.A.NumberSmart(m)+" GPU",g=q.A.Bytes(h)+" RAM",x="cpu"===l?f:v,y="cpu"===l?[m&&v,g].filter(Boolean).join(", "):[p&&f,g].filter(Boolean).join(", ");return(0,J.jsxs)(Ae.s,{direction:"column",style:{margin:"-8px 0"},overflow:"hidden",children:[(0,J.jsx)(ye.E,{variant:"subheader-1",style:{fontWeight:"var(--yt-font-weight-bold)"},ellipsis:!0,children:x}),(0,J.jsx)(ye.E,{variant:"caption-2",color:"secondary",ellipsis:!0,children:y})]})}function Hn(e){var t=e.value,n=e.edited,r=e.type,o=isNaN(n),a=o?"Automatically calculated":"Explicitly defined";return(0,J.jsx)(Ue,{className:Rn("edited-number",{autocalculated:o}),tooltip:a,value:t,type:r})}function Wn(e){var t=e.start,n=o.useState(Date.now()),a=(0,r.A)(n,2),i=a[0],s=a[1];if(o.useEffect((function(){var e=setInterval((function(){return s(Date.now())}),1e3);return function(){return clearInterval(e)}}),[]),!t)return null;var u=xe()(t).valueOf();return(0,J.jsx)(ae.m,{className:Rn("duration"),ellipsis:!0,content:(0,J.jsx)(oe.Ay,{items:[{key:"start time",value:q.A.DateTime(u/1e3)}]}),children:(0,We.zA)(1e3*Math.round((i-u)/1e3))})}function Jn(e){var t=e.item,n=(0,a.w)(),r=t.type;return!t.isEphemeral&&"pool"===r&&(0,J.jsx)(be.r,{switcherWrapperClassName:Rn("actions"),items:[{text:"Attributes",action:function(){var e,o=null===(e=n(kt(t.name)))||void 0===e?void 0:e.orchidPath;"pool"===r&&n((0,tt.V6)({title:t.name,exactPath:o}))}},{action:function(){return n(function(e){return{type:x.dH,data:{visibility:!0,item:e}}}(t))},text:"Edit"},{action:function(){return n(function(e){return{type:x.DI,data:{visibility:!0,item:e}}}(t))},text:"Delete",theme:"danger"}]})}function Kn(e){var t=e.item,n=t.starvation_status,r=t.fairShareRatio,o=t.usageRatio,a={starving:"warning",aggressively_starving:"danger"}[n],i=a?(0,J.jsx)("div",{className:Rn("starvation-status"),children:(0,J.jsx)(De.A,{theme:a,text:q.A.Readable(n)})}):null;return(0,J.jsx)(et,{className:Rn("share-usage"),shareValue:r,shareTitle:"Fair share",usageValue:o,usageTitle:"Usage",forceTheme:a,title:i})}function Qn(e){var t=(0,a.w)(),n=(0,a.d)(_.CT),i=(0,r.A)(n,1)[0],s=e.column===(null==i?void 0:i.column)?i.order:void 0,u=o.useRef(e.column),l={column:u.current};if(null!=i&&i.column&&e.options){var c=e.options.find((function(e){return e.column===i.column}));c&&Object.assign(l,{column:c.column,order:i.order})}return(0,J.jsx)(_e.A,(0,p.A)((0,p.A)((0,p.A)({},e),{},{order:s},l),{},{onSort:function(e,n,r){var o,a=r.currentOrder;t(function(e){return{type:x.VQ,data:{sortState:e}}}(e&&n?[{column:a?e:null!==(o=u.current)&&void 0!==o?o:e,order:n}]:[])),e&&(u.current=e)}}))}function Yn(e){var t=e.table;return"custom"===(0,a.d)(_.BY)?(0,J.jsx)(we.QA,{table:t}):null}var $n=n(54473),Xn=n(77528),Zn=n(33023),er=n(87319),tr=(0,i.A)("yt-pools-suggest");function nr(e){var t=e.onCancelEdit,n=void 0===t?function(){}:t,r=e.className,i=e.autoFocus,s=(0,a.d)(_.A8),u=(0,a.d)(_.Jv),l=(0,a.w)(),c=o.useCallback((function(e,t){if(!t)return s;var n=[],r=[],o=[],a=null==t?void 0:t.toLowerCase();return lt()(s,(function(e){var t=e.toLowerCase();a===t?n.push(e):t.startsWith(a)?r.push(e):e!==x.W1&&-1!==t.indexOf(a)&&o.push(e)})),n.concat(r,o)}),[s]),d=o.useCallback((function(){setTimeout(n,500)}),[n]),p=o.useCallback((function(e){l(mn(e)),n()}),[l,n]),m=o.useCallback((function(){l(tn(u))}),[l,u]);return(0,J.jsx)(er.A,{className:tr(null,r),popupClassName:tr("popup"),autoFocus:i,filter:c,onBlur:d,onFocus:m,placeholder:"Select pool...",onItemClick:function(e){return p("string"==typeof e?e:e.value)},items:s})}var rr=(0,i.A)("yt-scheduling-toolbar");function or(){var e=(0,a.d)(_.BY);return(0,J.jsx)(Zn.M,{className:rr(),itemsToWrap:[{node:(0,J.jsx)(ar,{})},{node:(0,J.jsx)(nr,{className:rr("filter")}),width:200},{node:(0,J.jsx)(ir,{})}].concat((0,w.A)("summary"===e||"custom"===e?[{node:(0,J.jsx)(sr,{})}]:[]))})}function ar(){var e=(0,a.w)(),t=(0,a.d)(_.BY);return(0,J.jsx)($n.x,{size:"m",qa:"scheduling:conftent:mode",value:t,onUpdate:function(t){return e((n=t,{type:x.Fl,data:{contentMode:n}}));var n},name:"navigation-tablets-mode",options:_.eJ.map((function(e){return{value:e,content:q.A.ReadableField(e)}}))})}function ir(){var e,t=(0,a.w)(),n=(null!==(e=(0,a.d)(Yt.bV))&&void 0!==e?e:{}).slug;return W.Ay.renderControlAbcService({className:rr("abc-filter"),value:n?{slug:n}:void 0,onChange:function(e){t(function(e){return function(t,n){var r=null!=e?e:{},o=r.id,a=r.slug;t(tn((0,_.Jv)(n()))),t({type:x.VQ,data:{abcServiceFilter:{id:o,slug:a}}})}}(e))}})}function sr(){var e=(0,a.w)(),t=(0,a.d)(_.Xr);return(0,J.jsx)(Xn.d,{checked:t,onUpdate:function(t){var n;e((n=t,{type:x.VQ,data:{showAbsResources:n}}))},children:"Show abs. resources"})}function ur(){return(0,J.jsxs)("div",{children:[(0,J.jsx)(pe,{}),(0,J.jsx)(Y,{}),(0,J.jsx)(A.Ay,{toolbar:(0,J.jsx)(or,{}),content:(0,J.jsx)(Fn,{}),topMargin:"none"})]})}var lr=n(60192),cr=n(7452),dr=n(22636),pr=n(82733),mr=n(35336),hr=n(46357);function fr(){var e=(0,a.d)(_.HE),t=(0,a.d)(_.d_),n=(0,a.d)(_.Jv),r=(0,a.d)(_.IY);return e?(0,J.jsx)(lr.R,{warning:"Visualization is not supported for <Root>.",hint:" Please select a specific pool."}):Pt()(r)?null:(0,J.jsx)(c.A,{children:(0,J.jsx)(cr.J0,{path:t,poolTree:n},"".concat(n,"_").concat(t))})}const vr=(0,X.Ng)((function(e){return{loadState:(0,pr.cE)(e,mr.wf.POOL)}}))((function(e){var t=e.loadState;return(0,hr.v)({type:Qt.c.SCHEDULING_ACL,additionalStartType:Qt.c.SCHEDULING,startDeps:[t],allowStart:function(e){var t=(0,r.A)(e,1)[0];return!(0,ie.RP)(t)}}),(0,dr.ol)({type:Qt.c.SCHEDULING_ACL,stopDeps:[t],allowStop:function(e){var t=(0,r.A)(e,1)[0];return(0,ie.RP)(t)}}),(0,J.jsx)(fr,{})}));var gr=n(53332),xr=n(72902),yr=n(35441);function Ar(){var e=(0,a.d)(_.Jv),t=(0,a.d)(_.d_),n=(0,a.w)();return o.useEffect((function(){n(wt(e))}),[n,e,t]),null}const br=o.memo(Ar);var _r=n(54736),wr=n(84549),jr=n(78519),Cr=n(53263);function Nr(e){var t=e.className,n=(0,a.d)(_.cO);return n?(0,J.jsx)(kr,{className:t,pool:n}):null}function kr(e){var t,n,r=e.className,i=e.pool,s=(0,a.w)(),u=o.useMemo((function(){return s(kt(i.name))}),[s,i.name]),l=(0,Cr.Ou)({id:ct.Vu.schedulingPoolAttributes,errorTitle:"Failed to load pool attributes",parameters:{requests:[{command:"get",parameters:{path:u.orchidPath}}]}}),c=l.data,d=l.error,p=l.isLoading;return(0,J.jsxs)("div",{className:r,children:[p&&(0,J.jsx)(wr.A,{}),Boolean(d)&&(0,J.jsx)(_r.z,{error:d}),(0,J.jsx)(jr.A,{folding:!0,virtualized:!0,value:null!==(t=null==c||null===(n=c[0])||void 0===n?void 0:n.output)&&void 0!==t?t:null})]})}var Sr=(0,i.A)("scheduling-content");const Pr=(0,f.y)((function(e){var t=e.match,n=e.location,r=(0,a.d)(E.dB),o=(0,a.d)(_.d_),i=(0,a.d)(_.Jv),s=(0,a.d)(_.En),u=(0,a.d)(_.HE),l=(0,a.d)(_.Nr),d=(0,p.A)({},x.oz),m=h()(x.oz,(function(e,t){return e[t]={show:x.yf[t]||!u},e}),{}),A={},b=m[x.oz.ACL];b.show=b.show&&l;var w=W.Ay.getSchedulingExtraTabs({cluster:r,pool:o,tree:i,extraOptions:{isRoot:u,isEphemeral:s}}),j=[];w.forEach((function(e){var n=e.name,a=e.title,s=e.component,u=e.urlTemplate,l={show:!e.hidden};if(m[n]=l,u&&(l.routed=!1,l.external=!0,l.url=(0,yr.j)(u,{ytCluster:r,ytPool:o,ytPoolTree:i})),d[n]=n,a&&(A[n]=a),s){var c=(0,J.jsx)(f.qh,{path:"".concat(t.path,"/").concat(n),component:s},n);j.push(c)}})),delete d.ACL,d[x.oz.ACL]=x.oz.ACL;var C=(0,gr._4)(t.url,d,m,{pool:o,tree:i},A);return(0,J.jsxs)(c.A,{children:[(0,J.jsx)(br,{}),(0,J.jsx)(v.A,(0,p.A)((0,p.A)({},C),{},{active:x._N,className:Sr("tabs"),routed:!0,size:g.jr})),(0,J.jsxs)(f.dO,{children:[(0,J.jsx)(f.qh,{path:"".concat(t.path,"/").concat(x.oz.OVERVIEW),component:ur}),(0,J.jsx)(f.qh,{path:"".concat(t.path,"/").concat(x.oz.ATTRIBUTES),render:function(){return(0,J.jsx)(Nr,{className:Sr("attributes")})}}),j,b.show&&(0,J.jsx)(f.qh,{path:"".concat(t.path,"/").concat(x.oz.ACL),component:vr}),(0,J.jsx)(f.qh,{path:"".concat(t.path,"/details"),render:function(){return(0,J.jsx)(f.rd,{to:(0,xr.oG)({pool:o,poolTree:i})})}}),(0,J.jsx)(f.qh,{path:"".concat(t.path,"/:tab"),component:y.A}),(0,J.jsx)(f.rd,{from:t.url,to:{pathname:"".concat(t.url,"/").concat(x._N),search:n.search}})]})]})}));var Er=n(13685),zr=(0,S.Mz)([function(e){return e.scheduling.scheduling.loading},function(e){return e.scheduling.scheduling.loaded},function(e){return e.scheduling.scheduling.error}],(function(e,t,n){var r=(0,ie.Ts)(e,t,n);return(0,ie.RP)(r)})),Or=n(73822),Ir=(0,i.A)("scheduling-resources"),Tr=(0,i.A)("elements-heading");function Mr(){var e=(0,a.d)(_.HE),t=(0,a.d)(_.QH);return!e||Pt()(t)?null:(0,J.jsx)("div",{className:Ir(),children:zt()(t,(function(e){return(0,J.jsxs)("div",{className:Ir("resources-item"),children:[(0,J.jsx)("div",{className:Tr({size:"s"}),children:Or.A.format.ReadableField(e.type)}),(0,J.jsx)(Z.k,(0,p.A)({},e.progress))]},e.type)}))})}const Vr=o.memo(Mr);var Rr=n(53775),Fr=n(74360),Br=n(28407),Ur=n(20361),Lr=n(42153),Dr=n(63582),qr=n(29081),Gr=(0,i.A)("pool-editor-dialog");function Hr(e){return Pt()(e)?null:(0,J.jsx)(d.z,{className:Gr("error"),error:e})}function Wr(){var e,t,n,i,s,u,l,c,d,m=(0,a.w)(),h=(0,a.d)(_.o2),f=(0,a.d)((function(e){return e.scheduling.scheduling})),v=f.poolErrorData,g=f.editVisibility,x=(0,a.d)(B),y=(0,a.d)(_.D2),A=(0,a.d)(_.Aq),b=(0,a.d)(_.IY),j=(0,a.d)(_.Jv),C=(0,o.useMemo)((function(){var e=(0,vt.f6)(h,y);return(0,p.A)((0,p.A)({},e),{},{general:(0,p.A)((0,p.A)({},e.general),{},{weight:{value:e.general.weight}})})}),[h,y]),N=(0,o.useCallback)((function(){m(dn({cancelled:!0}))}),[m]),k=(0,o.useCallback)(function(){var e=(0,Br.A)((0,Rr.A)().mark((function e(t){var n,r,o,a,i,s,u,l;return(0,Rr.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.getState(),r=n.values,o=r.general,a=r.resourceGuarantee,i=r.integralGuarantee,s=r.resourceLimits,u=r.otherSettings,l={general:(0,p.A)((0,p.A)({},Bt()(o,["name","mode"])),{},{weight:o.weight},Lt()(Bt()(o,Object.keys(vt.oB)),(function(e,t){var n;if(!e)return!1;var r=t,o=null===(n=C.general[r])||void 0===n?void 0:n.limit;return e.limit!==o}))),resourceGuarantee:Lt()(Bt()(a,Object.keys(vt.Mj)),(function(e,t){var n;if(!e)return!1;var r=t,o=null===(n=C.resourceGuarantee[r])||void 0===n?void 0:n.limit;return e.limit!==o})),integralGuarantee:Lt()(Bt()(i,Object.keys(vt.iE)),(function(e,t){if(!e)return!1;var n=t,r=C.integralGuarantee[n];return"object"===(0,Fr.A)(e)&&"object"===(0,Fr.A)(r)?e.limit!==r.limit:e!==r})),resourceLimits:Bt()(s,["cpu","gpu","memory","userSlots"]),otherSettings:Bt()(u,["forbidImmediateOperations","fifoSortParams","createEphemeralSubpools"])},e.next=5,m(cn(h,l,C));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[h,C,m]),S=(0,a.d)(E.ID),P=o.useState(!1),O=(0,r.A)(P,2),I=O[0],T=O[1],M=o.useState(null),V=(0,r.A)(M,2),R=V[0],F=V[1];o.useEffect((function(){if(F(null),null!=h&&h.name){var e=(0,_.un)(h.name,b,j);(0,Dr.UG)(e,S,["write"]).then((function(e){var t="allow"!==(0,r.A)(e,1)[0].action;t!==I&&T(t)})).catch((function(e){F(e)}))}}),[b,j,null==h?void 0:h.name,I,T,F]);var U,L={type:"block",name:"perm-warning",extras:{children:(U=I,U?(0,J.jsxs)("div",{className:Gr("permissions-warning"),children:["You do not have sufficient permissions to modify pool settings. In order to be able to modify pool settings ",(0,J.jsx)("span",{className:Gr("flag"),children:"inherit_acl"})," flag should be enabled for current pool and you should be responsible for the parent pool."]}):null)}},D={type:"block",name:"check-perm-error",extras:{children:Hr(R)}},q={type:"block",name:"pool-error-data",extras:{children:Hr(v)}},G=function(e){var t=(e||{}).parent,n=(0,a.d)(z.w3)[t],r=W.Ay.renderTransferQuotaNoticeForPool({pool:e,parentPool:n,isTopLevel:(0,Lr.Q)(e)});return r?[{type:"block",name:"transferQuotaNotice",extras:{children:r}}]:[]}(h),H=function(e,t,n){var r=e||{},o=r.name,i=r.parent,s=(0,a.d)(E.dB);if((0,Lr.A)(o)||!(0,Lr.A)(i)&&!(0,Lr.Q)(e))return[];var u=o?(0,_.un)(o,t,n):void 0,l="".concat(u,"/@integral_guarantees/guarantee_type"),c="[".concat(s,"]: Change-request of ").concat(l),d=(0,qr.kQ)({summary:c}),p=d.url,m=d.queue;return[{type:"block",name:"integralTypeNotice",extras:{children:(0,J.jsxs)("div",{className:Gr("changeTypeNotice"),children:["To change the guarantee type of the pool you have to create a request to"," ",p?(0,J.jsx)(jn.A,{url:p,children:m}):"the cluster's support team"]})}}]}(h,b,j);return(0,J.jsx)(Ur.yZ,{size:"l",className:Gr(),visible:g,onClose:N,headerProps:{title:null==h?void 0:h.name},onAdd:k,initialValues:C,fields:[{type:"tab-vertical",name:"general",title:"General",fields:[].concat((0,w.A)(G),[{name:"name",type:"text",caption:"Pool name",required:!0,extras:{placeholder:"Enter pool name..."}},{name:"parent",type:"yt-select-single",caption:"Parent",tooltip:"Select parent pool, defining a place in pool_tree to place a new pool.",required:!0,extras:{disabled:!0,items:A,placeholder:"Select pool tree...",width:"max"}},{name:"separator",type:"block",extras:{children:(0,J.jsx)("div",{className:Gr("separator")})}},{name:"mode",type:"yt-select-single",caption:"Mode",required:!0,extras:{items:[{key:"fair_share",value:"fair_share",title:"fair_share"},{key:"fifo",value:"fifo",title:"fifo"}],placeholder:"Select mode...",width:"max",hideFilter:!0}},{name:"weight",type:"number",caption:"Weight",extras:{min:Number.MIN_VALUE,hidePrettyValue:!0,formatFn:function(e){return void 0===e?"":String(e)}}},{name:"maxOperationCount",type:"pool-quota-editor",caption:"Max operation count",extras:{pool:(null==h?void 0:h.name)||"",resourceType:"maxOperationCount",initialLimit:null===(e=C.general.maxOperationCount)||void 0===e?void 0:e.limit,min:0,max:1/0,sourcesSkipParent:!0,limitInputTitle:"Limit"}},{name:"maxRunningOperationCount",type:"pool-quota-editor",caption:"Max running operation count",extras:{pool:(null==h?void 0:h.name)||"",resourceType:"maxRunningOperationCount",initialLimit:null===(t=C.general.maxRunningOperationCount)||void 0===t?void 0:t.limit,min:0,max:1/0,sourcesSkipParent:!0,limitInputTitle:"Limit"}},L,q,D])},{type:"tab-vertical",name:"resourceGuarantee",title:"Strong Guarantee",fields:[].concat((0,w.A)(G),[{name:"cpuStrong",type:"pool-quota-editor",caption:"CPU",extras:{pool:(null==h?void 0:h.name)||"",resourceType:"cpuStrong",initialLimit:null===(n=C.resourceGuarantee.cpuStrong)||void 0===n?void 0:n.limit,decimalPlaces:2}}],(0,w.A)(x>0?[{name:"gpuStrong",type:"pool-quota-editor",caption:"GPU",extras:{pool:(null==h?void 0:h.name)||"",resourceType:"gpuStrong",initialLimit:null===(i=C.resourceGuarantee.gpuStrong)||void 0===i?void 0:i.limit}}]:[]),[{name:"memoryStrong",type:"pool-quota-editor",caption:"Memory",extras:{format:"Bytes",pool:(null==h?void 0:h.name)||"",resourceType:"memoryStrong",initialLimit:null===(s=C.resourceGuarantee.memoryStrong)||void 0===s?void 0:s.limit}},L,q,D])},{type:"tab-vertical",name:"integralGuarantee",title:"Integral Guarantee",fields:[].concat((0,w.A)(G),(0,w.A)(H),[{name:"guaranteeType",type:"yt-select-single",caption:"Guarantee",extras:{placeholder:"Integral guarantee type...",items:[{value:"none",text:"Descendants only"},{value:"burst",text:"Burst"},{value:"relaxed",text:"Relaxed"}],width:"max"}},{name:"burstCpu",type:"pool-quota-editor",caption:"Burst CPU",extras:{pool:(null==h?void 0:h.name)||"",resourceType:"burstCpu",initialLimit:null===(u=C.integralGuarantee.burstCpu)||void 0===u?void 0:u.limit,decimalPlaces:2}}],(0,w.A)(x>0?[{name:"burstGpu",type:"pool-quota-editor",caption:"Burst GPU",extras:{pool:(null==h?void 0:h.name)||"",resourceType:"burstGpu",initialLimit:null===(l=C.integralGuarantee.burstGpu)||void 0===l?void 0:l.limit}}]:[]),[{name:"flowCpu",type:"pool-quota-editor",caption:"Flow CPU",extras:{pool:(null==h?void 0:h.name)||"",resourceType:"flowCpu",initialLimit:null===(c=C.integralGuarantee.flowCpu)||void 0===c?void 0:c.limit,decimalPlaces:2}}],(0,w.A)(x>0?[{name:"flowGpu",type:"pool-quota-editor",caption:"Flow GPU",extras:{pool:(null==h?void 0:h.name)||"",resourceType:"flowGpu",initialLimit:null===(d=C.integralGuarantee.flowGpu)||void 0===d?void 0:d.limit}}]:[]),[L,q,D])},{type:"tab-vertical",name:"resourceLimits",title:"Resource Limits",fields:[{name:"cpu",type:"text",caption:"CPU"},{name:"gpu",type:"text",caption:"GPU"},{name:"memory",type:"bytes",caption:"Memory",validator:function(e){if(void 0!==e&&isNaN(e))return"Incorrect value"}},{name:"userSlots",type:"text",caption:"User slots"},L,q,D]},{type:"tab-vertical",name:"otherSettings",title:"Other settings",fields:[{name:"forbidImmediateOperations",type:"tumbler",caption:"Forbid immediate operations"},{name:"fifoSortParams",type:"sortable-list",caption:"Fifo sort parameters",extras:{axis:"x"}},{name:"createEphemeralSubpools",type:"tumbler",caption:"Create ephemeral subpools"},L,q,D]}]},(null==h?void 0:h.name)+"/"+g)}var Jr=(0,i.A)("scheduling"),Kr=o.memo(Xr);function Qr(){var e=(0,a.d)((function(e){var t=e.scheduling.scheduling,n=t.error,r=t.errorData;return n?r:void 0})),t=(0,a.w)(),n=o.useCallback((function(){t(Xt())}),[t]);return(0,Er.Tt)(n),(0,J.jsx)("div",{className:Jr(null,"elements-main-section"),children:(0,J.jsxs)(c.A,{children:[e&&(0,J.jsx)(d.z,{error:e}),(0,J.jsxs)("div",{className:Jr("wrapper"),children:[(0,J.jsx)(Vr,{}),(0,J.jsx)(Pr,{className:Jr("content")})]}),(0,J.jsx)(Kr,{})]})})}var Yr=o.memo(Qr);function $r(){var e=(0,a.d)(zr);return(0,hr.v)({type:Qt.c.SCHEDULING,startDeps:[e],allowStart:function(e){return!(0,r.A)(e,1)[0]}}),(0,J.jsx)(Yr,{})}function Xr(){var e=(0,a.w)(),t=(0,a.d)((function(e){return e.scheduling.scheduling})),n=t.deleteVisibility,r=t.deleteItem,i=t.poolErrorData,s=o.useCallback((function(){return e((t=r,function(e,n){if(t){var r=n(),o=(0,_.Jv)(r),a=(0,_.IY)(r),i=(0,vt.v0)(t,a);return e({type:x.CI}),Kt().v3.remove({path:"//sys/pool_trees/".concat(o,"/").concat(i)}).then((function(){xt.X.add({name:"delete pool",autoHiding:1e4,theme:"success",title:"Successfully deleted ".concat(t.name,". Please wait.")}),e({type:x.i5}),e(Zt()),setTimeout((function(){return e(Xt())}),3e3)})).catch((function(t){return t.code!==Kt().codes.CANCELLED?(e({type:x.FL,data:{error:t}}),Promise.reject(t)):null}))}}));var t}),[r,e]),c=o.useCallback((function(){e({type:x.x3}),e(Zt())}),[e]);return(0,J.jsxs)(o.Fragment,{children:[n&&(0,J.jsxs)(l.K,{size:"m",className:Jr("delete-dialog"),open:n,onClose:c,hasCloseButton:!0,children:[(0,J.jsx)(l.K.Header,{caption:"Delete"}),(0,J.jsxs)(l.K.Body,{children:["Are you sure you want to delete the ",(0,J.jsx)("b",{children:null==r?void 0:r.name})," pool?",u()(i).length>0?(0,J.jsx)(d.z,{message:"Delete pool failure",error:i}):null]}),(0,J.jsx)(l.K.Footer,{onClickButtonApply:s,onClickButtonCancel:c,propsButtonApply:{view:"flat-danger"},textButtonCancel:"Cancel",textButtonApply:"Delete"})]}),(0,J.jsx)(Wr,{})]})}var Zr=n(81336),eo=n(73688),to=n(17239),no=n.n(to),ro=n(64859),oo=n(86704),ao=n(82947),io=n(26264),so=n(59911),uo=n(99564),lo=n.n(uo),co=n(58299);function po(e){return e&&e.value?{slug:e.value.startsWith("svc_")?e.value.slice(4):e.value,name:e.title,id:Number(e.id)}:{}}function mo(e){return function(t){return ct.Qq.get(ct.Vu.getPoolTrees,{path:"//sys/pool_trees/".concat(e)}).then((function(n){t({type:x.Rk,data:{currentTree:e,treeItems:n}})}))}}function ho(e){return function(t,n){var r=e.abcService,o=(0,E.dB)(n());return(0,ie.fI)(Kt().v3.create({type:"scheduler_pool",attributes:Object.assign({name:e.name,parent_name:e.parent||void 0,pool_tree:e.tree},r&&r.value?{abc:po(r)}:{})}),{toasterName:"create_".concat(e.name),successContent:"Successfully created ".concat(e.name,". Please wait."),errorContent:"'".concat(e.name,"' pool creation failed"),timeout:1e4}).then((function(){return(0,Dr.iO)(o,e.name,{idmKind:mr.wf.POOL,poolTree:e.tree,responsible:e.responsible}),bo(e).then((function(){t(Xt())}))})).catch((function(e){if((null==e?void 0:e.code)!==Kt().codes.CANCELLED)return t({type:x.OH,data:e}),Promise.reject(e)}))}}var fo=(0,qr.v1)(),vo=fo.url,go=fo.queue,xo=1500,yo=1e4,Ao={message:(0,J.jsxs)("div",{children:["The pool was not appeared in orchidea in 10 seconds.",vo?(0,J.jsxs)(J.Fragment,{children:["Please fill a ticket for ",(0,J.jsx)(jn.A,{url:vo,children:go})]}):"Please report it to the cluster's support team.","."]})};function bo(e){var t=e.name,n=e.tree,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)||Date.now();return Date.now()-r>yo?Promise.resolve():new Promise((function(e,o){setTimeout((function(){Kt().v3.exists({path:"//sys/scheduler/orchid/scheduler/pool_trees/".concat(n,"/pools/").concat(t)}).then((function(o){return e(!!o||bo({name:t,tree:n},r))})).catch((function(a){return a!==Ao?e(bo({name:t,tree:n},r)):o(a)}))}),xo)}))}var _o=n(14242),wo=!n(31229).mH.schedulingDenyRootAsParent;function jo(){var e=(0,a.w)(),t=(0,a.d)(_.HE),n=(0,o.useState)(!1),i=(0,r.A)(n,2),s=i[0],u=i[1],l=(0,o.useCallback)((function(){return u(!0)}),[u]),c=(0,o.useCallback)((function(){u(!1),e({type:x.x3})}),[e,u]);return(0,J.jsxs)(o.Fragment,{children:[(0,J.jsx)(co.A,{view:"action",disabled:!wo&&t,onClick:l,children:"Create pool"}),s&&(0,J.jsx)(Co,{onClose:c})]})}function Co(e){var t=(0,a.w)(),n=(0,a.d)(_.Jv),i=o.useState(n),s=(0,r.A)(i,2),u=s[0],l=s[1],c=o.useCallback((function(e){l(e),t(mo(e))}),[t]);o.useEffect((function(){t(mo(u))}),[t]);var m=(0,a.d)(_o.p0),h=(0,a.d)(E.ID),f=(0,a.d)(_.yM),v=(0,a.d)(_.d_),g=(0,o.useCallback)((function(e){var n=e.getState().values;return t(ho(n))}),[t]),x=(0,o.useMemo)((function(){return{tree:u,parent:v,responsible:[{value:h,type:"users"}]}}),[u,v,h]),y=o.useState(""),A=(0,r.A)(y,2),b=A[0],j=A[1],C=o.useCallback((function(e){j(e)}),[j]),N=(0,a.d)(_o.wY).sortedFlatTree,k=o.useCallback((function(e){var t=e.name,n={};return-1!==lo()(N,t)&&(n.name="the value must be unique"),Pt()(n)?null:n}),[N]),S=o.useMemo((function(){return function(e){var t=k(e.values);return Boolean(t)}}),[k]);return(0,J.jsx)(Ur.yZ,{visible:!0,onClose:e.onClose,headerProps:{title:"Create pool"},onAdd:g,initialValues:(0,p.A)((0,p.A)({},x),{},{name:b}),validate:k,isApplyDisabled:S,pristineSubmittable:!0,fields:[{name:"name",type:"text",caption:"Name",required:!0,extras:{placeholder:"Enter pool name..."},onChange:C,touched:Boolean(b)},{name:"tree",type:"yt-select-single",caption:"Pool tree",tooltip:(0,J.jsxs)("span",{children:["Select pool tree where to create new pool."," ",(0,qr.fs)((0,J.jsxs)(J.Fragment,{children:["See"," ",(0,J.jsx)(jn.A,{url:W.Ay.docsUrls["scheduler:scheduler_and_pools"],children:"Documentations"})," ","for more details."]}))]}),required:!0,extras:{hideFilter:!0,items:f,placeholder:"Select pool tree...",width:"max"},onChange:function(e){c(e)}},{name:"parent",type:"create-pool-parent",caption:"Parent",tooltip:"Select parent pool, defining a place in pool_tree to place a new pool.",required:!wo,extras:{placeholder:"Select parent..."}}].concat((0,w.A)((0,qr.Gq)()?[{name:"responsible",type:"acl-subjects",caption:"Responsible users",tooltip:"Choose responsible users who will manage permissions and pool settings.",required:!0,extras:{placeholder:"Select responsible users..."}}]:[]),[{name:"error-block",type:"block",extras:{children:m&&(0,J.jsx)(d.z,{error:m})}}])})}var No=n(64209),ko=(0,i.A)("scheduling-top-row-content");function So(){var e=(0,a.d)(_.cO),t=(0,a.d)(E.jU);return(0,J.jsxs)(ro.K,{page:io.YW.SCHEDULING,className:ko(),urlParams:{pool:""},children:[(0,J.jsx)(Po,{}),(0,J.jsx)(Io,{}),(0,J.jsxs)(Ae.s,{grow:1,shrink:1,justifyContent:"space-between",alignItems:"center",children:[(0,J.jsx)(zo,{}),(0,J.jsxs)("span",{className:ko("actions"),children:[W.Ay.renderTopRowExtraControlsForPool({itemClassName:ko("extra-control"),pool:e,clusterUiConfig:t}),(0,J.jsx)(jo,{})]})]})]})}function Po(){var e=(0,a.d)(_.Jv),t=(0,a.w)(),n=(0,a.d)(_.d_),i=(0,a.d)(ao.F6),s=(0,a.d)(ao.As),u=o.useCallback((function(e){var n=e.path.match(/(.+)\[(.+)]/),o=(0,r.A)(n,3),a=o[1],i=o[2];t(mn(a)),t(pn(i))}),[t]),l=o.useCallback((function(){return t(function(e,t){return function(n,r){var o="".concat(e,"[").concat(t,"]"),a=(0,Dt.cY)(r());return n((0,qt.Mb)(o,a))}}(n,e))}),[t,n,e]),c=(0,a.d)(_.d_);return(0,J.jsx)(oo.A,{className:ko("favourites"),theme:"clear",items:i||[],isActive:s,onToggle:l,onItemClick:u,toggleDisabled:x.W1===c})}function Eo(){var e=(0,a.d)(_.d_),t=(0,a.d)(_.ZM);return(0,J.jsx)(Te.A,{className:ko("clipboard"),text:e,shiftText:t,hoverContent:"Hold SHIFT-key to copy full path"})}function zo(){var e=(0,a.d)(O),t=(0,a.w)(),n=(0,f.W6)(),r=(0,a.d)(_.Jv),i=(0,a.d)(E.dB),s=o.useMemo((function(){return["<Root>"].concat((0,w.A)(e.slice(1))).map((function(e,t){var n=Oo(window.location.pathname,i,e);return(0,J.jsx)(Zr.B.Item,{href:(0,No.RK)(n,{tree:r,text:e,filter:""}),onClick:function(e){return e.preventDefault()},children:e},"".concat(JSON.stringify({text:e,index:t})))}))}),[e,i,r]);return(0,J.jsx)(so.z,{view:"top-row",onAction:function(e){var o,a=JSON.parse(e).text;o=a,setTimeout((function(){t(mn(o.toString()));var e=Oo(window.location.pathname,i,o.toString());n.push((0,No.RK)(e,{tree:r,filter:""}))}),0)},className:ko("breadcrumbs"),showRoot:!0,afterEditorContent:(0,J.jsx)(Eo,{}),renderEditor:function(e){return(0,J.jsx)(nr,{autoFocus:!0,onCancelEdit:e.onBlur,className:ko("pool-suggest")})},children:s})}function Oo(e,t,n){return"<Root>"===n?no()(x.yf,(function(t,n){return e.endsWith("/"+n)}))?e:"/".concat(t,"/").concat(io.YW.SCHEDULING,"/").concat(x.oz.OVERVIEW):e}function Io(){var e=(0,a.d)(_.Jv),t=(0,a.d)(_.yM),n=(0,a.w)(),r=o.useCallback((function(e){return n(pn(e))}),[n]);return(0,J.jsx)("div",{className:ko("tree"),children:(0,J.jsx)(eo.l,{value:[e],filterable:(null==t?void 0:t.length)>=5,options:t,onUpdate:function(e){return r(e[0])},className:ko("path-tree"),placeholder:"Select tree...",width:"max"})})}var To=o.memo(So);function Mo(){return(0,J.jsx)(c.A,{compact:!0,children:(0,J.jsx)(To,{})})}}}]);
2
+ //# sourceMappingURL=scheduling.943b1602.chunk.js.map