text: (this["webpackJsonpocpp-cs"]=this["webpackJsonpocpp-cs"]||[]).push([[25],{783:function(e,t,n){"use strict";function a(){return"f".concat((+new Date).toString(16)).concat((e=1e3,t=9999,e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e));var e,t}n.d(t,"a",(function(){return a}))},788:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(836),c=(n(0),n(98)),r=n(33),s=n(2);function i(e){return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(c.a,{children:Object(s.jsx)("title",{children:e.title})}),Object(s.jsx)("h2",{className:"title gx-mb-4",children:Object(s.jsx)(r.a,{to:e.url,className:"gx-text-dark",children:Object(s.jsxs)(a.b,{children:[e.icon,e.title]})})})]})}},792:function(e,t,n){"use strict";function a(e,t){var n=e.match.params||{},a=t.match.params||{};return n.param1!==a.param1||n.param2!==a.param2||n.param3!==a.param3}n.d(t,"a",(function(){return a}))},799:function(e,t,n){"use strict";var a=n(16),c=n(15),r=n(19),s=n(20),i=n(0),o=n.n(i),l=n(759),d=n(187),u=n(2),p=null,h=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(e){var c;return Object(a.a)(this,n),(c=t.call(this,e)).searchHandle=function(e){c.setState({searchValue:e}),c.state.searchDelay||!c.props.onSearch?(c.setState({searchPending:!0}),window.clearTimeout(p),p=window.setTimeout((function(){c.setState({searchPending:!1}),c.props.onSearch&&c.props.onSearch(e)}),c.state.searchDelay)):c.props.onSearch(e)},c.searchOnChange=function(e){c.searchHandle(e.target.value)},c.state={searchValue:e.defaultValue||"",searchPending:!1,searchDelay:e.hasOwnProperty("searchDelay")?e.searchDelay:1e3},c}return Object(c.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.intl,a=t.className,c=this.state,r=c.searchValue,s=c.searchPending,i=this.props.placeholder||n.formatMessage({id:"search.placeholder"});return Object(u.jsx)(l.a.Search,{placeholder:i,className:a,value:r,onChange:this.searchOnChange,onSearch:function(){return e.searchHandle(r)},loading:s})}}]),n}(o.a.Component);t.a=Object(d.c)(h)},801:function(e,t,n){"use strict";var a=n(7),c=n(16),r=n(15),s=n(19),i=n(20),o=n(0),l=n.n(o),d=n(165),u=n(293),p=n(2),h=function(e){var t=e.id,n=e.style,a=e.children,c=e.className;return Object(p.jsx)(u.Scrollbars,{id:t,className:c,style:n,autoHide:!0,autoHideTimeout:1e3,autoHideDuration:200,autoHeightMin:0,autoHeightMax:200,thumbMinSize:30,universal:!0,children:a})},m=n(799),j=n(760),b=n(816),O=n(187),f=j.a.Header,x=j.a.Content,g=function(e){Object(s.a)(n,e);var t=Object(i.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(r.a)(n,[{key:"render",value:function(){var e=Object(a.a)(this.props.children,4),t=e[0],n=e[1],c=e[2],r=e[3];return Object(p.jsx)(p.Fragment,{children:Object(p.jsx)(b.a,{spinning:!!this.props.pending,children:Object(p.jsxs)("div",{className:"isomorphicNoteComponent",children:[Object(p.jsx)("div",{style:{width:"340px"},className:"isoNoteListSidebar",children:Object(p.jsxs)("div",{className:"isoNoteListWrapper",children:[this.props.onSearch&&Object(p.jsx)(m.a,{placeholder:this.props.searchPlaceholder,className:"isoSearchNotes",onSearch:this.props.onSearch,searchDelay:this.props.searchDelay}),Object(p.jsx)("div",{className:"isoNoteList",children:c?Object(p.jsx)(h,{children:Object(p.jsx)("div",{className:"isoNoteListHolder",children:c})}):Object(p.jsx)("span",{className:"isoNoResultMsg",children:Object(p.jsx)(d.a,{id:"nothing.found"})})})]})}),Object(p.jsxs)(j.a,{className:"isoNotepadWrapper",children:[Object(p.jsxs)(f,{className:"isoHeader",children:[t,n]}),Object(p.jsx)(x,{className:"isoNoteEditingArea",children:r&&Object(p.jsx)(h,{children:Object(p.jsx)("div",{className:"isoNoteContentHolder",children:r})})})]})]})})})}}]),n}(l.a.Component);t.a=Object(O.c)(g)},812:function(e,t,n){"use strict";var a=n(3),c=n(0),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},s=n(14),i=function(e,t){return c.createElement(s.a,Object(a.a)(Object(a.a)({},e),{},{ref:t,icon:r}))};i.displayName="CopyOutlined";t.a=c.forwardRef(i)},829:function(e,t,n){"use strict";var a=n(6),c=n(5),r=n(0),s=n(43),i=n(8),o=n.n(i),l=n(814),d=n(83),u=n(821),p=n(74),h=n(105),m=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var c=0;for(a=Object.getOwnPropertySymbols(e);c<a.length;c++)t.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(n[a[c]]=e[a[c]])}return n},j="SECRET_COMBOBOX_MODE_DO_NOT_USE",b=function(e,t){var n,i,b=e.prefixCls,O=e.bordered,f=void 0===O||O,x=e.className,g=e.getPopupContainer,v=e.dropdownClassName,y=e.listHeight,S=void 0===y?256:y,N=e.listItemHeight,C=void 0===N?24:N,w=e.size,H=e.notFoundContent,P=m(e,["prefixCls","bordered","className","getPopupContainer","dropdownClassName","listHeight","listItemHeight","size","notFoundContent"]),M=r.useContext(d.b),E=M.getPopupContainer,I=M.getPrefixCls,D=M.renderEmpty,F=M.direction,T=M.virtual,k=M.dropdownMatchSelectWidth,R=r.useContext(p.b),z=I("select",b),_=I(),V=r.useMemo((function(){var e=P.mode;if("combobox"!==e)return e===j?"combobox":e}),[P.mode]),A="multiple"===V||"tags"===V;i=void 0!==H?H:"combobox"===V?null:D("Select");var B=Object(u.a)(Object(c.a)(Object(c.a)({},P),{multiple:A,prefixCls:z})),L=B.suffixIcon,K=B.itemIcon,q=B.removeIcon,J=B.clearIcon,W=Object(s.a)(P,["suffixIcon","itemIcon"]),U=o()(v,Object(a.a)({},"".concat(z,"-dropdown-").concat(F),"rtl"===F)),X=w||R,$=o()((n={},Object(a.a)(n,"".concat(z,"-lg"),"large"===X),Object(a.a)(n,"".concat(z,"-sm"),"small"===X),Object(a.a)(n,"".concat(z,"-rtl"),"rtl"===F),Object(a.a)(n,"".concat(z,"-borderless"),!f),n),x);return r.createElement(l.d,Object(c.a)({ref:t,virtual:T,dropdownMatchSelectWidth:k},W,{transitionName:Object(h.b)(_,"slide-up",P.transitionName),listHeight:S,listItemHeight:C,mode:V,prefixCls:z,direction:F,inputIcon:L,menuItemSelectedIcon:K,removeIcon:q,clearIcon:J,notFoundContent:i,className:$,getPopupContainer:g||E,dropdownClassName:U}))},O=r.forwardRef(b);O.SECRET_COMBOBOX_MODE_DO_NOT_USE=j,O.Option=l.c,O.OptGroup=l.b,t.a=O},866:function(e,t,n){"use strict";n.r(t);var a=n(7),c=n(28),r=n(16),s=n(15),i=n(19),o=n(20),l=n(10),d=n.n(l),u=n(0),p=n.n(u),h=n(783),m=n(187),j=n(33),b=n(50),O=n(836),f=n(287),x=n(849),g=n(435),v=n(801);var y=n(95),S=n(792),N=n(776),C=n(3),w={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"},H=n(14),P=function(e,t){return u.createElement(H.a,Object(C.a)(Object(C.a)({},e),{},{ref:t,icon:w}))};P.displayName="MenuOutlined";var M=u.forwardRef(P),E=n(812),I=n(788),D=n(829),F=n(164),T=n(761),k=n(759),R=n(2),z=D.a.Option,_=function(e){Object(i.a)(n,e);var t=Object(o.a)(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,c=new Array(a),s=0;s<a;s++)c[s]=arguments[s];return(e=t.call.apply(t,[this].concat(c))).mc=function(t,n){return e.props.m(e.props.command+"."+t,n)},e.m=function(t,n){return e.props.m(t,n)},e}return Object(s.a)(n,[{key:"render",value:function(){var e=this;if(!this.props.station||!this.props.command)return Object(R.jsx)(F.a,{});var t=this.context.ocpp.commands[this.props.command],n=null===t||void 0===t?void 0:t.form;if(!n)return Object(R.jsx)(F.a,{});var c=function(e){switch(e.type){case"string":return e.enum?Object(R.jsx)(D.a,{children:e.enum.map((function(e){return Object(R.jsx)(z,{value:e,children:e},e)}))}):(e.format,Object(R.jsx)(k.a,{}));case"array":case"object":return Object(R.jsx)(k.a,{});case"integer":case"number":return Object(R.jsx)(k.a,{type:"number"});default:return null}};return Object(R.jsx)(R.Fragment,{children:Object(R.jsxs)(T.a,{layout:"vertical",name:"command",onFinish:this.props.onFinish,scrollToFirstError:!0,children:[function(t){var n=t.properties,r=t.required;return 0===Object.entries(n).length?Object(R.jsx)("div",{className:"gx-text-grey gx-font-weight-normal gx-mb-3",children:e.m("noform")}):Object.entries(n).map((function(t){var n=Object(a.a)(t,2),s=n[0],i=n[1];return Object(R.jsx)(T.a.Item,{rules:[{required:null===r||void 0===r?void 0:r.includes(s)}],label:e.mc(s),name:s,extra:Object(R.jsxs)("div",{className:"gx-text-grey gx-font-weight-light gx-text-small",children:[Object(R.jsx)("span",{className:"gx-font-weight-normal gx-mr-2",children:e.m("type."+i.type)}),e.mc(s+".description")]}),children:c(i)},s)}))}(n),Object(R.jsx)(f.a,{type:"primary",htmlType:"submit",children:this.m("submit","")})]},this.props.command)})}}]),n}(p.a.Component);_.contextType=y.a;var V=Object(m.c)(_),A=function(e){Object(i.a)(n,e);var t=Object(o.a)(n);function n(e){var s;return Object(r.a)(this,n),(s=t.call(this,e)).pendingStart=function(){s.props.onPendingStart?s.props.onPendingStart():s.setState({pending:!0})},s.pendingEnd=function(){s.props.onPendingEnd?s.props.onPendingEnd():s.setState({pending:!1})},s.setParams=function(){var e=s.props.match.params,t=e.param1,n=e.param2;s.setState({identity:t,command:n,commandResult:null})},s.load=Object(c.a)(d.a.mark((function e(){var t,n;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s.setState({pending:!0}),e.t0=s.context.ocpp,e.next=4,s.context.ocpp.q("/ChargePointList",{});case 4:e.t1=e.sent,t=e.t0.getArray.call(e.t0,e.t1,"ChargePointList","Identity"),n=Object.entries(s.context.ocpp.commands).map((function(e){var t=Object(a.a)(e,1)[0];return{key:t,title:s.m(t)}})),s.setState({treeKey:Object(h.a)(),tree:n,stations:t,pending:!1});case 8:case"end":return e.stop()}}),e)}))),s.getStation=function(e){return s.state.stations.find((function(t){return t.Identity===e}))},s.onTreeSelect=function(e){Array.isArray(e)&&e[0]&&s.props.history.push("/ocpp/command/".concat(s.state.identity,"/").concat(e[0],"/"))},s.onTreeSearch=function(e){s.setState({treeSearch:e})},s.onFormFininsh=function(){var e=Object(c.a)(d.a.mark((function e(t){var n,a,c,r;return d.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.state,a=n.command,c=n.identity,s.pendingStart(),e.next=4,s.context.ocpp.q("/ChargePoint/".concat(c,"/").concat(a),t);case 4:r=e.sent,s.setState({commandResult:r}),s.pendingEnd();case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s.m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ocpp.commands.",n=s.props.intl;return n.formatMessage({id:t+e})},s.state={treeSearch:"",treeKey:Object(h.a)(),tree:[],stations:[],identity:null,command:null,commandResult:null},s}return Object(s.a)(n,[{key:"componentDidMount",value:function(){this.setParams(),this.load()}},{key:"componentDidUpdate",value:function(e){Object(S.a)(e,this.props)&&this.setParams(),e.intl.locale!==this.props.intl.locale&&this.load()}},{key:"render",value:function(){var e=this,t=this.state,n=t.pending,a=t.treeKey,c=t.identity,r=t.command,s=t.commandResult,i=t.tree,o=t.treeSearch,l=this.getStation(c),d=o?i.filter((function(e){var t=new RegExp(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(o),"gi");return(e.title.toString().match(t)||[]).length>0})):i;return Object(R.jsxs)(R.Fragment,{children:[Object(R.jsx)(I.a,{title:this.m("commands"),url:"/ocpp/command",icon:Object(R.jsx)(N.a,{})}),Object(R.jsxs)(v.a,{pending:n,onSearch:this.onTreeSearch,searchDelay:0,children:[Object(R.jsx)("div",{children:l?Object(R.jsxs)(O.b,{children:[Object(R.jsx)(j.a,{to:"/ocpp",children:Object(R.jsx)("h3",{className:"gx-mb-0",children:l.Identity})}),Object(R.jsx)("div",{className:"gx-text-grey",children:l.Address})]}):Object(R.jsx)(R.Fragment,{children:!n&&Object(R.jsx)(j.a,{to:"/ocpp",children:this.m("pick")})})}),Object(R.jsx)("div",{className:"isoNoteBtns",children:Object(R.jsx)(O.b,{children:Object(R.jsx)(j.a,{to:"/ocpp",children:Object(R.jsx)(f.a,{onClick:this.onAddStart,type:"secondary",icon:Object(R.jsx)(M,{})})})})}),Object(R.jsx)(x.a,{defaultExpandParent:!0,defaultSelectedKeys:[r],defaultExpandedKeys:[r],treeData:d,onSelect:this.onTreeSelect},a),Object(R.jsxs)("div",{children:[Object(R.jsx)(V,{m:this.m,onFinish:this.onFormFininsh,station:l,command:r}),s&&Object(R.jsxs)("div",{className:"inspector",children:[Object(R.jsx)("hr",{}),Object(R.jsxs)("h3",{children:[this.m("result"),Object(R.jsx)(f.a,{className:"gx-ml-2 gx-mb-0",onClick:function(){navigator.clipboard.writeText(JSON.stringify(s,null,2)),g.b.success(e.m("copied"))},icon:Object(R.jsx)(E.a,{})})]}),Object(R.jsx)("pre",{children:JSON.stringify(s,null,2)})]})]})]})]})}}]),n}(p.a.Component);A.contextType=y.a;t.default=Object(b.i)(Object(m.c)(A))}}]);