(this.webpackJsonpbitdeals=this.webpackJsonpbitdeals||[]).push([[12],{852: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}))},854:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(921),r=(n(0),n(95)),i=n(26),c=n(1);function s(e){return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)(r.a,{children:Object(c.jsx)("title",{children:e.title})}),Object(c.jsx)("h2",{className:"title gx-mb-4",children:Object(c.jsx)(i.a,{to:e.url,className:"gx-text-dark",children:Object(c.jsxs)(a.b,{children:[e.icon,e.title]})})})]})}},856: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}))},857:function(e,t,n){"use strict";var a=n(438);t.a=a.a},858:function(e,t,n){"use strict";var a=n(253);t.a=a.a},864:function(e,t,n){"use strict";var a=n(12),r=n(11),i=n(16),c=n(17),s=n(0),o=n.n(s),l=n(831),d=n(167),u=n(1),p=null,b=function(e){Object(i.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(a.a)(this,n),(r=t.call(this,e)).searchHandle=function(e){r.setState({searchValue:e}),r.state.searchDelay||!r.props.onSearch?(r.setState({searchPending:!0}),window.clearTimeout(p),p=window.setTimeout((function(){r.setState({searchPending:!1}),r.props.onSearch&&r.props.onSearch(e)}),r.state.searchDelay)):r.props.onSearch(e)},r.searchOnChange=function(e){r.searchHandle(e.target.value)},r.state={searchValue:e.defaultValue||"",searchPending:!1,searchDelay:e.hasOwnProperty("searchDelay")?e.searchDelay:1e3},r}return Object(r.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.intl,a=t.className,r=this.state,i=r.searchValue,c=r.searchPending,s=this.props.placeholder||n.formatMessage({id:"search.placeholder"});return Object(u.jsx)(l.a.Search,{placeholder:s,className:a,value:i,onChange:this.searchOnChange,onSearch:function(){return e.searchHandle(i)},loading:c})}}]),n}(o.a.Component);t.a=Object(d.c)(b)},865:function(e,t,n){"use strict";var a=n(866),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,i,c,s,o,l,d=!1;t||(t={}),n=t.debug||!1;try{if(c=a(),s=document.createRange(),o=document.getSelection(),(l=document.createElement("span")).textContent=e,l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(a){if(a.stopPropagation(),t.format)if(a.preventDefault(),"undefined"===typeof a.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var i=r[t.format]||r.default;window.clipboardData.setData(i,e)}else a.clipboardData.clearData(),a.clipboardData.setData(t.format,e);t.onCopy&&(a.preventDefault(),t.onCopy(a.clipboardData))})),document.body.appendChild(l),s.selectNodeContents(l),o.addRange(s),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");d=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),d=!0}catch(u){n&&console.error("unable to copy using clipboardData: ",u),n&&console.error("falling back to prompt"),i=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(i,e)}}finally{o&&("function"==typeof o.removeRange?o.removeRange(s):o.removeAllRanges()),l&&document.body.removeChild(l),c()}return d}},866:function(e,t){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],a=0;a=0},children:t})}}]),n}(u.a.Component);j.contextType=h.a,t.a=Object(p.c)(j)},890:function(e,t,n){"use strict";var a=n(3),r=n(5),i=n(0),c=n(6),s=n.n(c),o=n(53),l=n(146),d=n(27),u=n(145),p=n(304),b=n(306),h=n(144),f=n(109),m=n(80),j=n(256),v=n(28),O=n(108),x=n(870),g=n(863),y=void 0,w=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 r=0;for(a=Object.getOwnPropertySymbols(e);rt){var s=t-n;return a.push(String(i).slice(0,s)),a}a.push(i),n=c}return e}var Q=function(e){var t=e.enabledMeasure,n=e.children,r=e.text,c=e.width,s=e.rows,o=e.onEllipsis,l=i.useState([0,0,0]),d=Object(j.a)(l,2),u=d[0],p=d[1],b=i.useState(0),h=Object(j.a)(b,2),f=h[0],m=h[1],v=Object(j.a)(u,3),x=v[0],g=v[1],y=v[2],w=i.useState(0),S=Object(j.a)(w,2),k=S[0],E=S[1],C=i.useRef(null),I=i.useRef(null),T=i.useMemo((function(){return Object(O.a)(r)}),[r]),P=i.useMemo((function(){return function(e){var t=0;return e.forEach((function(e){W(e)?t+=String(e).length:t+=1})),t}(T)}),[T]),N=i.useMemo((function(){return t&&3===f?n(_(T,g),g1&&Xe,Ze=function(e){var t;Pe(!0),null===(t=Be.onExpand)||void 0===t||t.call(Be,e)},$e=i.useState(0),et=Object(j.a)($e,2),tt=et[0],nt=et[1],at=function(e){var t;Ae(e),Le!==e&&(null===(t=Be.onEllipsis)||void 0===t||t.call(Be,e))};i.useEffect((function(){var e=H.current;if(ze&&Xe&&e){var t=Ye?e.offsetHeight=0}})}}]),n}(u.a.Component);m.contextType=h.a,t.a=Object(p.c)(m)},949:function(e,t,n){"use strict";var a=n(3),r=n(4),i=n(0),c=n(9),s=n(2),o=n(5),l=n(13),d=n(20),u=n(883),p=n(878),b=n(896),h=n(53),f=n(27),m=n(114),j=n(905),v=i.createContext(null),O=i.createContext(null);function x(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function g(e){return!e||e.disabled||e.disableCheckbox||!1===e.checkable}function y(e){return null===e||void 0===e}var w={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},S=function(e,t){var n=Object(u.e)(),r=n.prefixCls,s=n.multiple,l=n.searchValue,d=n.toggleOpen,p=n.open,b=n.notFoundContent,h=i.useContext(O),x=h.virtual,y=h.listHeight,S=h.listItemHeight,k=h.treeData,E=h.fieldNames,C=h.onSelect,I=i.useContext(v),T=I.checkable,M=I.checkedKeys,P=I.halfCheckedKeys,N=I.treeExpandedKeys,D=I.treeDefaultExpandAll,L=I.treeDefaultExpandedKeys,A=I.onTreeExpand,F=I.treeIcon,K=I.showTreeIcon,q=I.switcherIcon,R=I.treeLine,H=I.treeNodeFilterProp,V=I.loadData,z=I.treeLoadedKeys,B=I.treeMotion,U=I.onTreeLoad,W=I.keyEntities,_=i.useRef(),Q=Object(m.a)((function(){return k}),[p,k],(function(e,t){return t[0]&&e[1]!==t[1]})),X=i.useMemo((function(){return T?{checked:M,halfChecked:P}:null}),[T,M,P]);i.useEffect((function(){var e;p&&!s&&M.length&&(null===(e=_.current)||void 0===e||e.scrollTo({key:M[0]}))}),[p]);var J=String(l).toLowerCase(),G=i.useState(L),Y=Object(o.a)(G,2),Z=Y[0],$=Y[1],ee=i.useState(null),te=Object(o.a)(ee,2),ne=te[0],ae=te[1],re=i.useMemo((function(){return N?Object(c.a)(N):l?ne:Z}),[Z,ne,N,l]);i.useEffect((function(){l&&ae(function(e,t){var n=[];return function e(a){a.forEach((function(a){n.push(a[t.value]);var r=a[t.children];r&&e(r)}))}(e),n}(k,E))}),[l]);var ie=function(e){e.preventDefault()},ce=function(e,t){var n=t.node;T&&g(n)||(C(n.key,{selected:!M.includes(n.key)}),s||d(!1))},se=i.useState(null),oe=Object(o.a)(se,2),le=oe[0],de=oe[1],ue=W[le];if(i.useImperativeHandle(t,(function(){var e;return{scrollTo:null===(e=_.current)||void 0===e?void 0:e.scrollTo,onKeyDown:function(e){var t;switch(e.which){case f.a.UP:case f.a.DOWN:case f.a.LEFT:case f.a.RIGHT:null===(t=_.current)||void 0===t||t.onKeyDown(e);break;case f.a.ENTER:if(ue){var n=(null===ue||void 0===ue?void 0:ue.node)||{},a=n.selectable,r=n.value;!1!==a&&ce(0,{node:{key:le},selected:!M.includes(r)})}break;case f.a.ESC:d(!1)}},onKeyUp:function(){}}})),0===Q.length)return i.createElement("div",{role:"listbox",className:"".concat(r,"-empty"),onMouseDown:ie},b);var pe={fieldNames:E};return z&&(pe.loadedKeys=z),re&&(pe.expandedKeys=re),i.createElement("div",{onMouseDown:ie},ue&&p&&i.createElement("span",{style:w,"aria-live":"assertive"},ue.node.value),i.createElement(j.b,Object(a.a)({ref:_,focusable:!1,prefixCls:"".concat(r,"-tree"),treeData:Q,height:y,itemHeight:S,virtual:x,multiple:s,icon:F,showIcon:K,switcherIcon:q,showLine:R,loadData:l?null:V,motion:B,activeKey:le,checkable:T,checkStrictly:!0,checkedKeys:X,selectedKeys:T?[]:M,defaultExpandAll:D},pe,{onActiveChange:de,onSelect:ce,onCheck:ce,onExpand:function(e){$(e),ae(e),A&&A(e)},onLoad:U,filterTreeNode:function(e){return!!J&&String(e[H]).toLowerCase().includes(J)}})))},k=i.forwardRef(S);k.displayName="OptionList";var E=k,C=function(){return null},I="SHOW_ALL",T="SHOW_PARENT",M="SHOW_CHILD";function P(e,t,n,a){var r=new Set(e);return t===M?e.filter((function(e){var t=n[e];return!(t&&t.children&&t.children.every((function(e){var t=e.node;return r.has(t[a.value])})))})):t===T?e.filter((function(e){var t=n[e],a=t?t.parent:null;return!(a&&!g(a.node)&&r.has(a.key))})):e}var N=n(74),D=n(33),L=["children","value"];function A(e){return Object(N.a)(e).map((function(e){if(!i.isValidElement(e)||!e.type)return null;var t=e.key,n=e.props,a=n.children,r=n.value,c=Object(l.a)(n,L),o=Object(s.a)({key:t,value:r},c),d=A(a);return d.length&&(o.children=d),o})).filter((function(e){return e}))}function F(e){if(!e)return e;var t=Object(s.a)({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Object(D.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function K(e,t,n){return i.useMemo((function(){return e?n?function(e,t){var n=t.id,a=t.pId,r=t.rootPId,i={},c=[];return e.map((function(e){var t=Object(s.a)({},e),a=t[n];return i[a]=t,t.key=t.key||a,t})).forEach((function(e){var t=e[a],n=i[t];n&&(n.children=n.children||[],n.children.push(e)),(t===r||!n&&null===r)&&c.push(e)})),c}(e,Object(s.a)({id:"id",pId:"pId",rootPId:null},!0!==n?n:{})):e:A(t)}),[t,n,e])}function q(e){var t=i.useRef();t.current=e;var n=i.useCallback((function(){return t.current.apply(t,arguments)}),[]);return n}var R=n(872);var H=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","virtual","listHeight","listItemHeight","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion"];var V=i.forwardRef((function(e,t){var n=e.id,f=e.prefixCls,m=void 0===f?"rc-tree-select":f,j=e.value,g=e.defaultValue,w=e.onChange,S=e.onSelect,k=e.onDeselect,I=e.searchValue,T=e.inputValue,N=e.onSearch,L=e.autoClearSearchValue,A=void 0===L||L,V=e.filterTreeNode,z=e.treeNodeFilterProp,B=void 0===z?"value":z,U=e.showCheckedStrategy,W=void 0===U?M:U,_=e.treeNodeLabelProp,Q=e.multiple,X=e.treeCheckable,J=e.treeCheckStrictly,G=e.labelInValue,Y=e.fieldNames,Z=e.treeDataSimpleMode,$=e.treeData,ee=e.children,te=e.loadData,ne=e.treeLoadedKeys,ae=e.onTreeLoad,re=e.treeDefaultExpandAll,ie=e.treeExpandedKeys,ce=e.treeDefaultExpandedKeys,se=e.onTreeExpand,oe=e.virtual,le=e.listHeight,de=void 0===le?200:le,ue=e.listItemHeight,pe=void 0===ue?20:ue,be=e.onDropdownVisibleChange,he=e.dropdownMatchSelectWidth,fe=void 0===he||he,me=e.treeLine,je=e.treeIcon,ve=e.showTreeIcon,Oe=e.switcherIcon,xe=e.treeMotion,ge=Object(l.a)(e,H),ye=Object(b.a)(n),we=X&&!J,Se=X||J,ke=J||G,Ee=Se||Q;var Ce=i.useMemo((function(){return function(e){var t=e||{},n=t.label,a=t.value||"value";return{_title:n?[n]:["title","label"],value:a,key:a,children:t.children||"children"}}(Y)}),[JSON.stringify(Y)]),Ie=Object(h.a)("",{value:void 0!==I?I:T,postState:function(e){return e||""}}),Te=Object(o.a)(Ie,2),Me=Te[0],Pe=Te[1],Ne=K($,ee,Z),De=function(e,t){return i.useMemo((function(){return Object(R.a)(e,{fieldNames:t,initWrapper:function(e){return Object(s.a)(Object(s.a)({},e),{},{valueEntities:new Map})},processEntity:function(e,n){var a=e.node[t.value];n.valueEntities.set(a,e)}})}),[e,t])}(Ne,Ce),Le=De.keyEntities,Ae=De.valueEntities,Fe=i.useCallback((function(e){var t=[],n=[];return e.forEach((function(e){Ae.has(e)?n.push(e):t.push(e)})),{missingRawValues:t,existRawValues:n}}),[Ae]),Ke=function(e,t,n){var a=n.treeNodeFilterProp,c=n.filterTreeNode,o=n.fieldNames.children;return i.useMemo((function(){if(!t||!1===c)return e;var n;if("function"===typeof c)n=c;else{var i=t.toUpperCase();n=function(e,t){var n=t[a];return String(n).toUpperCase().includes(i)}}return function e(a){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return a.map((function(a){var c=a[o],l=i||n(t,F(a)),d=e(c||[],l);return l||d.length?Object(s.a)(Object(s.a)({},a),{},Object(r.a)({},o,d)):null})).filter((function(e){return e}))}(e)}),[e,t,o,a,c])}(Ne,Me,{fieldNames:Ce,treeNodeFilterProp:B,filterTreeNode:V}),qe=i.useCallback((function(e){if(e){if(_)return e[_];for(var t=Ce._title,n=0;n1&&void 0!==arguments[1]?arguments[1]:"0",l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return a.map((function(a,d){var u="".concat(r,"-").concat(d),p=a[c.value],b=n.includes(p),h=e(a[c.children]||[],u,b),f=i.createElement(C,a,h.map((function(e){return e.node})));if(t===p&&(s=f),b){var m={pos:u,node:f,children:h};return l||o.push(m),m}return null})).filter((function(e){return e}))}(a),o.sort((function(e,t){var a=e.node.props.value,r=t.node.props.value;return n.indexOf(a)-n.indexOf(r)})))}Object.defineProperty(e,"triggerNode",{get:function(){return Object(D.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),l(),s}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return Object(D.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),l(),r?o:o.map((function(e){return e.node}))}})}(h,l,e,Ne,f,Ce),Se?h.checked=d:h.selected=d;var m=ke?b:b.map((function(e){return e.value}));w(Ee?m:m[0],ke?null:b.map((function(e){return e.label})),h)}})),rt=i.useCallback((function(e,t){var n,a=t.selected,r=t.source,i=Le[e],s=null===i||void 0===i?void 0:i.node,o=null!==(n=null===s||void 0===s?void 0:s[Ce.value])&&void 0!==n?n:e;if(Ee){var l=a?[].concat(Object(c.a)(Ge),[o]):$e.filter((function(e){return e!==o}));if(we){var d,u=Fe(l),b=u.missingRawValues,h=u.existRawValues.map((function(e){return Ae.get(e).key}));if(a)d=Object(p.a)(h,!0,Le).checkedKeys;else d=Object(p.a)(h,{checked:!1,halfCheckedKeys:et},Le).checkedKeys;l=[].concat(Object(c.a)(b),Object(c.a)(d.map((function(e){return Le[e].node[Ce.value]}))))}at(l,{selected:a,triggerValue:o},r||"option")}else at([o],{selected:!0,triggerValue:o},"option");a||!Ee?null===S||void 0===S||S(o,F(s)):null===k||void 0===k||k(o,F(s))}),[Fe,Ae,Le,Ce,Ee,Ge,at,we,S,k,$e,et]),it=i.useCallback((function(e){if(be){var t={};Object.defineProperty(t,"documentClickClose",{get:function(){return Object(D.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),be(e,t)}}),[be]),ct=q((function(e,t){var n=e.map((function(e){return e.value}));"clear"!==t.type?t.values.length&&rt(t.values[0].value,{selected:!1,source:"selection"}):at(n,{},"selection")})),st=i.useMemo((function(){return{virtual:oe,listHeight:de,listItemHeight:pe,treeData:Ke,fieldNames:Ce,onSelect:rt}}),[oe,de,pe,Ke,Ce,rt]),ot=i.useMemo((function(){return{checkable:Se,loadData:te,treeLoadedKeys:ne,onTreeLoad:ae,checkedKeys:$e,halfCheckedKeys:et,treeDefaultExpandAll:re,treeExpandedKeys:ie,treeDefaultExpandedKeys:ce,onTreeExpand:se,treeIcon:je,treeMotion:xe,showTreeIcon:ve,switcherIcon:Oe,treeLine:me,treeNodeFilterProp:B,keyEntities:Le}}),[Se,te,ne,ae,$e,et,re,ie,ce,se,je,xe,ve,Oe,me,B,Le]);return i.createElement(O.Provider,{value:st},i.createElement(v.Provider,{value:ot},i.createElement(u.a,Object(a.a)({ref:t},ge,{id:ye,prefixCls:m,mode:Ee?"multiple":void 0,displayValues:nt,onDisplayValuesChange:ct,searchValue:Me,onSearch:function(e){Pe(e),null===N||void 0===N||N(e)},OptionList:E,emptyOptions:!Ne.length,onDropdownVisibleChange:it,dropdownMatchSelectWidth:fe}))))}));var z=V;z.TreeNode=C,z.SHOW_ALL=I,z.SHOW_PARENT=T,z.SHOW_CHILD=M;var B=z,U=n(6),W=n.n(U),_=n(35),Q=n(80),X=n(40),J=n(897),G=n(904),Y=n(62),Z=n(108),$=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 r=0;for(a=Object.getOwnPropertySymbols(e);r0&&void 0!==arguments[0]&&arguments[0];if(!e)for(var t in i.state.items){e=t;break}i.setState({activeItem:String(e)});var n=i.state.items[String(e)]||{};i.props.onChange(n)},i.save=function(){var e=Object(a.a)(l.a.mark((function e(t){var n,a,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.props.intl,a=i.state.items[i.state.activeItem],i.state.edit&&(t.id=a.id),t.class=i.props.classId,t.sequence||delete t.sequence,i.setState({pending:!0}),e.next=8,i.context.api.q(i.apiPath+"/set",t);case 8:if(!1===(r=e.sent)){e.next=17;break}return m.b.success(n.formatMessage({id:"save.success"})),e.next=13,i.load();case 13:i.setState({edit:!1,add:!1,security:!1}),r.id&&i.select(r.id),e.next=18;break;case 17:m.b.error(n.formatMessage({id:"save.fail"}));case 18:i.setState({pending:!1});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i.delete=Object(a.a)(l.a.mark((function e(){var t,n,a=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},n=i.props.intl,i.setState({pending:!0}),e.next=5,i.context.api.q(i.apiPath+"/delete",{id:t.id});case 5:!1!==e.sent?(m.b.success(n.formatMessage({id:"delete.success"})),i.select(),i.load()):m.b.error(n.formatMessage({id:"delete.fail"})),i.setState({pending:!1});case 8:case"end":return e.stop()}}),e)}))),i.onEditStart=function(e){i.setState({edit:!0,activeItem:e.id})},i.onAddStart=function(){i.setState({add:!0,activeItem:!1})},i.onEditEnd=function(){i.setState({add:!1,edit:!1,security:!1})},i.state={pending:!1,activeItem:!1,add:!1,edit:!1,security:!1,items:{}},i.apiPath="/workflow/state",i}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.load()}},{key:"renderPath",value:function(){var e=this.state.items[this.state.activeItem]||{},t=e.classlabel,n=e.label;return Object(F.jsx)(T.a,{style:{marginBottom:"15px"},type:"info",message:Object(F.jsxs)(j.b,{children:[t,Object(F.jsx)("span",{className:"fa fa-long-arrow-right"}),n]})})}},{key:"render",value:function(){var e=this,t=this.props,n=t.classId,a=t.intl,r=this.state.items[this.state.activeItem]||{},i=[{title:this.m("typecode"),dataIndex:"typecode",key:"typecode",render:function(e){return Object(F.jsx)(ce,{type:"secondary",children:e})}},{title:this.m("typename"),dataIndex:"typename",key:"typename"},{title:this.m("code"),dataIndex:"code",key:"code",render:function(e){return Object(F.jsx)(ce,{type:"secondary",children:e})}},{title:Object(F.jsxs)(R.a,{between:!0,children:[Object(F.jsx)("div",{children:this.m("label")}),Object(F.jsx)(O.a,{onClick:function(){return e.onAddStart()},icon:Object(F.jsx)(E.a,{})})]}),dataIndex:"label",key:"label",render:function(t,n){return Object(F.jsxs)(R.a,{between:!0,children:[Object(F.jsx)("div",{children:t}),Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{onClick:function(){return e.onEditStart(n)},icon:Object(F.jsx)(H.a,{})}),Object(F.jsx)(x.a,{title:"".concat(a.formatMessage({id:"delete.sure"})," ").concat(t),onConfirm:function(){return e.delete(n)},okText:a.formatMessage({id:"yes"}),cancelText:a.formatMessage({id:"no"}),children:Object(F.jsx)(O.a,{icon:Object(F.jsx)(C.a,{})})})]})]})}}];return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(M.a,{spinning:!!this.state.pending,children:n&&Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(B.a,{pagination:{hideOnSinglePage:!0},columns:i,dataSource:Object.values(this.state.items),rowClassName:function(e){return e.id===r.id?"row-selected":""},onRow:function(t){return{onClick:function(){return e.select(t.id)}}}})})}),Object(F.jsxs)(z.a,{onCancel:this.onEditEnd,visible:this.state.add||this.state.edit,footer:null,children:[this.renderPath(),Object(F.jsx)(P.a,{layout:"vertical",name:"type",initialValues:{type:r.type||"",sequence:r.sequence||"",code:r.code||"",label:r.label||""},onFinish:this.save,onFinishFailed:this.onFormFinishFailed,children:Object(F.jsxs)(j.b,{direction:"vertical",style:{width:"100%"},children:[Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("type"),name:"type",children:Object(F.jsx)(L.a,{labelKey:"name",query:"/state/type"})}),Object(F.jsx)(P.a.Item,{label:this.m("sequence"),name:"sequence",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("code"),name:"code",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("label"),name:"label",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{style:{marginTop:"10px"},children:Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{className:"gx-mb-0",loading:this.state.pending,type:"primary",htmlType:"submit",children:a.formatMessage({id:"save"})}),Object(F.jsx)(O.a,{className:"gx-mb-0",onClick:this.onEditEnd,children:a.formatMessage({id:"cancell"})})]})})]})},r.id)]})]})}}]),n}(u.a.Component);se.contextType=y.a;var oe=Object(p.c)(se),le={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"},de=n(14),ue=function(e,t){return d.createElement(de.a,Object(I.a)(Object(I.a)({},e),{},{ref:t,icon:le}))};ue.displayName="UnorderedListOutlined";var pe=d.forwardRef(ue),be={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zM402.9 528.8l-77.5 77.5a8.03 8.03 0 000 11.3l34 34c3.1 3.1 8.2 3.1 11.3 0l77.5-77.5c55.7 35.1 130.1 28.4 178.6-20.1 56.3-56.3 56.3-147.5 0-203.8-56.3-56.3-147.5-56.3-203.8 0-48.5 48.5-55.2 123-20.1 178.6zm65.4-133.3c31.3-31.3 82-31.3 113.2 0 31.3 31.3 31.3 82 0 113.2-31.3 31.3-82 31.3-113.2 0s-31.3-81.9 0-113.2z"}}]},name:"security-scan",theme:"outlined"},he=function(e,t){return d.createElement(de.a,Object(I.a)(Object(I.a)({},e),{},{ref:t,icon:be}))};he.displayName="SecurityScanOutlined";var fe=d.forwardRef(he),me=V.a.Text,je=function(e){Object(c.a)(n,e);var t=Object(s.a)(n);function n(e){var i;return Object(r.a)(this,n),(i=t.call(this,e)).m=function(e){return i.props.intl.formatMessage({id:"admin.workflow.constructor.methods."+e})},i.load=Object(a.a)(l.a.mark((function e(){var t,n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.props.classId){e.next=10;break}if(i.props.stateId||i.state.all){e.next=3;break}return e.abrupt("return");case 3:return i.setState({pending:!0}),t=[{field:"class",compare:"EQL",value:i.props.classId}],i.props.stateId&&!i.state.all&&t.push({field:"state",compare:"EQL",value:i.props.stateId}),e.next=8,i.context.api.q(i.apiPath+"/list",{search:t,orderby:["sequence ASC"]},{toObject:!0});case 8:n=e.sent,i.setState({pending:!1,items:n},(function(){return i.select(i.state.activeItem)}));case 10:case"end":return e.stop()}}),e)}))),i.select=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)for(var t in i.state.items){e=t;break}i.setState({activeItem:String(e)});var n=i.state.items[String(e)]||{};i.props.onChange(n)},i.save=function(){var e=Object(a.a)(l.a.mark((function e(t){var n,a,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.props.intl,a=i.state.items[i.state.activeItem],i.state.edit&&(t.id=a.id),t.class=i.props.classId,t.state=i.props.stateId,t.sequence||delete t.sequence,i.setState({pending:!0}),e.next=9,i.context.api.q(i.apiPath+"/set",t);case 9:if(!1===(r=e.sent)){e.next=18;break}return m.b.success(n.formatMessage({id:"save.success"})),e.next=14,i.load();case 14:i.setState({edit:!1,add:!1,security:!1}),r.id&&i.select(r.id),e.next=19;break;case 18:m.b.error(n.formatMessage({id:"save.fail"}));case 19:i.setState({pending:!1});case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i.delete=Object(a.a)(l.a.mark((function e(){var t,n,a=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},n=i.props.intl,i.setState({pending:!0}),e.next=5,i.context.api.q(i.apiPath+"/delete",{id:t.id});case 5:!1!==e.sent?(m.b.success(n.formatMessage({id:"delete.success"})),i.select(),i.load()):m.b.error(n.formatMessage({id:"delete.fail"})),i.setState({pending:!1});case 8:case"end":return e.stop()}}),e)}))),i.toggleAll=function(){i.setState((function(e){return{all:!e.all,activeItem:!1}}),(function(){return i.load()}))},i.onEditStart=function(e){i.setState({edit:!0,activeItem:e.id})},i.onSecurityStart=function(e){i.setState({security:!0,activeItem:e.id})},i.onAddStart=function(){i.setState({add:!0,activeItem:!1})},i.onEditEnd=function(){i.setState({add:!1,edit:!1,security:!1})},i.state={all:!1,pending:!1,activeItem:!1,add:!1,edit:!1,security:!1,items:{}},i.apiPath="/workflow/method",i}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.load()}},{key:"renderPath",value:function(){var e=this.state.items[this.state.activeItem]||{},t=e.classlabel||this.props.stateItem.classlabel,n=e.statelabel||this.props.stateItem.label;return Object(F.jsx)(T.a,{style:{marginBottom:"15px"},type:"info",message:Object(F.jsxs)(j.b,{children:[t,Object(F.jsx)("span",{className:"fa fa-long-arrow-right"}),n]})})}},{key:"render",value:function(){var e=this,t=this.props,n=t.classId,a=t.intl,r=this.state.items[this.state.activeItem]||{},i=[{title:this.m("actioncode"),dataIndex:"actioncode",key:"actioncode",render:function(e){return Object(F.jsx)(me,{type:"secondary",children:e})}},{title:this.m("actionname"),dataIndex:"actionname",key:"actionname"},{title:this.m("code"),dataIndex:"code",key:"code",render:function(e){return Object(F.jsx)(me,{type:"secondary",children:e})}},{title:Object(F.jsxs)(R.a,{between:!0,children:[Object(F.jsx)("div",{children:this.m("label")}),Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{type:this.state.all?"primary":null,onClick:function(){return e.toggleAll()},icon:Object(F.jsx)(pe,{})}),Object(F.jsx)(O.a,{onClick:function(){return e.onAddStart()},icon:Object(F.jsx)(E.a,{})})]})]}),dataIndex:"label",key:"label",render:function(t,n){return Object(F.jsxs)(R.a,{between:!0,children:[Object(F.jsx)("div",{children:t}),Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{onClick:function(){return e.onSecurityStart(n)},icon:Object(F.jsx)(fe,{})}),Object(F.jsx)(O.a,{onClick:function(){return e.onEditStart(n)},icon:Object(F.jsx)(H.a,{})}),Object(F.jsx)(x.a,{title:"".concat(a.formatMessage({id:"delete.sure"})," ").concat(t),onConfirm:function(){return e.delete(n)},okText:a.formatMessage({id:"yes"}),cancelText:a.formatMessage({id:"no"}),children:Object(F.jsx)(O.a,{icon:Object(F.jsx)(C.a,{})})})]})]})}}];return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(M.a,{spinning:!!this.state.pending,children:n&&Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(B.a,{pagination:{hideOnSinglePage:!0},columns:i,dataSource:Object.values(this.state.items),rowClassName:function(e){return e.id===r.id?"row-selected":""},onRow:function(t){return{onClick:function(){return e.select(t.id)}}}})})}),Object(F.jsx)(z.a,{onCancel:this.onEditEnd,visible:this.state.security,footer:null,width:"800px",children:Object(F.jsx)(ie,{onCancell:function(){return e.setState({add:!1,edit:!1,security:!1})},mode:"method",itemId:r.id})}),Object(F.jsxs)(z.a,{onCancel:this.onEditEnd,visible:this.state.add||this.state.edit,footer:null,children:[this.renderPath(),Object(F.jsx)(P.a,{layout:"vertical",name:"type",initialValues:{action:r.action||"",sequence:r.sequence||"",code:r.code||"",label:r.label||""},onFinish:this.save,onFinishFailed:this.onFormFinishFailed,children:Object(F.jsxs)(j.b,{direction:"vertical",style:{width:"100%"},children:[Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("action"),name:"action",children:Object(F.jsx)(L.a,{labelKey:"name",query:"/workflow/action/list"})}),Object(F.jsx)(P.a.Item,{label:this.m("sequence"),name:"sequence",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("code"),name:"code",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("label"),name:"label",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{style:{marginTop:"10px"},children:Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{className:"gx-mb-0",loading:this.state.pending,type:"primary",htmlType:"submit",children:a.formatMessage({id:"save"})}),Object(F.jsx)(O.a,{className:"gx-mb-0",onClick:this.onEditEnd,children:a.formatMessage({id:"cancell"})})]})})]})},r.id)]})]})}}]),n}(u.a.Component);je.contextType=y.a;var ve=Object(p.c)(je),Oe=V.a.Text,xe=function(e){Object(c.a)(n,e);var t=Object(s.a)(n);function n(e){var i;return Object(r.a)(this,n),(i=t.call(this,e)).m=function(e){return i.props.intl.formatMessage({id:"admin.workflow.constructor.transitions."+e})},i.load=Object(a.a)(l.a.mark((function e(){var t,n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.props.classId){e.next=11;break}if(i.props.stateId||i.props.actionId){e.next=3;break}return e.abrupt("return");case 3:return i.setState({pending:!0}),t=[],i.props.stateId&&t.push({field:"state",compare:"EQL",value:i.props.stateId}),i.props.actionId&&!i.state.all&&t.push({field:"method",compare:"EQL",value:i.props.actionId}),e.next=9,i.context.api.q(i.apiPath+"/list",{search:t},{toObject:!0});case 9:n=e.sent,i.setState({pending:!1,items:n},(function(){return i.select(i.state.activeItem)}));case 11:case"end":return e.stop()}}),e)}))),i.select=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)for(var t in i.state.items){e=t;break}i.setState({activeItem:String(e)});var n=i.state.items[String(e)]||{};i.props.onChange(n)},i.save=function(){var e=Object(a.a)(l.a.mark((function e(t){var n,a,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.props.intl,a=i.state.items[i.state.activeItem],i.state.edit&&(t.id=a.id),t.state=i.props.stateId,t.method=i.props.actionId,t.sequence||delete t.sequence,i.setState({pending:!0}),e.next=9,i.context.api.q(i.apiPath+"/set",t);case 9:if(!1===(r=e.sent)){e.next=18;break}return m.b.success(n.formatMessage({id:"save.success"})),e.next=14,i.load();case 14:i.setState({edit:!1,add:!1,security:!1}),r.id&&i.select(r.id),e.next=19;break;case 18:m.b.error(n.formatMessage({id:"save.fail"}));case 19:i.setState({pending:!1});case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i.delete=Object(a.a)(l.a.mark((function e(){var t,n,a=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},n=i.props.intl,i.setState({pending:!0}),e.next=5,i.context.api.q(i.apiPath+"/delete",{id:t.id});case 5:!1!==e.sent?(m.b.success(n.formatMessage({id:"delete.success"})),i.select(),i.load()):m.b.error(n.formatMessage({id:"delete.fail"})),i.setState({pending:!1});case 8:case"end":return e.stop()}}),e)}))),i.toggleAll=function(){i.setState((function(e){return{all:!e.all,activeItem:!1}}),(function(){return i.load()}))},i.onEditStart=function(e){i.setState({edit:!0,activeItem:e.id})},i.onSecurityStart=function(e){i.setState({security:!0,activeItem:e.id})},i.onAddStart=function(){i.setState({add:!0,activeItem:!1})},i.onEditEnd=function(){i.setState({add:!1,edit:!1,security:!1})},i.state={all:!1,pending:!1,activeItem:!1,add:!1,edit:!1,security:!1,items:{}},i.apiPath="/workflow/transition",i}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.load()}},{key:"renderPath",value:function(){var e=(this.state.items[this.state.activeItem]||{}).classlabel||this.props.stateItem.classlabel,t=this.props.stateItem.label,n=this.props.actionItem.label;return Object(F.jsx)(T.a,{style:{marginBottom:"15px"},type:"info",message:Object(F.jsxs)(j.b,{children:[e,Object(F.jsx)("span",{className:"fa fa-long-arrow-right mx-2 text-muted"}),t,Object(F.jsx)("span",{className:"fa fa-long-arrow-right mx-2 text-muted"}),Object(F.jsx)("b",{children:n})]})})}},{key:"render",value:function(){var e=this,t=this.props,n=t.classId,a=t.intl,r=this.state.items[this.state.activeItem]||{},i=[{title:this.m("state"),dataIndex:"statecode",key:"statecode",render:function(e,t){return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(Oe,{type:"secondary",children:t.statecode}),": ",t.statelabel]})}},{title:this.m("operation"),dataIndex:"actioncode",key:"actioncode",render:function(e,t){return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(Oe,{type:"secondary",children:t.actioncode}),": ",t.actionname]})}},{title:Object(F.jsxs)(R.a,{between:!0,children:[Object(F.jsx)("div",{children:this.m("newstate")}),Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{type:this.state.all?"primary":null,onClick:function(){return e.toggleAll()},icon:Object(F.jsx)(pe,{})}),Object(F.jsx)(O.a,{onClick:function(){return e.onAddStart()},icon:Object(F.jsx)(E.a,{})})]})]}),dataIndex:"newstatecode",key:"newstatecode",render:function(t,n){return Object(F.jsxs)(R.a,{between:!0,children:[Object(F.jsxs)("div",{children:[Object(F.jsx)(Oe,{type:"secondary",children:n.newstatecode}),":"," ",n.newstatelabel]}),Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{onClick:function(){return e.onEditStart(n)},icon:Object(F.jsx)(H.a,{})}),Object(F.jsx)(x.a,{title:"".concat(a.formatMessage({id:"delete.sure"})," ").concat(t),onConfirm:function(){return e.delete(n)},okText:a.formatMessage({id:"yes"}),cancelText:a.formatMessage({id:"no"}),children:Object(F.jsx)(O.a,{icon:Object(F.jsx)(C.a,{})})})]})]})}}];return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(M.a,{spinning:!!this.state.pending,children:n&&Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(B.a,{pagination:{hideOnSinglePage:!0},columns:i,dataSource:Object.values(this.state.items),rowClassName:function(e){return e.id===r.id?"row-selected":""},onRow:function(t){return{onClick:function(){return e.select(t.id)}}}})})}),Object(F.jsx)(z.a,{onCancel:this.onEditEnd,visible:this.state.security,footer:null,width:"800px",children:Object(F.jsx)(ie,{onCancell:function(){return e.setState({add:!1,edit:!1,security:!1})},mode:"method",itemId:r.id})}),Object(F.jsxs)(z.a,{onCancel:this.onEditEnd,visible:this.state.add||this.state.edit,footer:null,children:[this.renderPath(),Object(F.jsx)(P.a,{layout:"vertical",name:"type",initialValues:{newstate:r.newstate||""},onFinish:this.save,onFinishFailed:this.onFormFinishFailed,children:Object(F.jsxs)(j.b,{direction:"vertical",style:{width:"100%"},children:[Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("newstate"),name:"newstate",children:Object(F.jsx)(L.a,{search:[{field:"class",compare:"EQL",value:this.props.classId}],labelKey:"label",query:"/workflow/state/list"})}),Object(F.jsx)(P.a.Item,{style:{marginTop:"10px"},children:Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{className:"gx-mb-0",loading:this.state.pending,type:"primary",htmlType:"submit",children:a.formatMessage({id:"save"})}),Object(F.jsx)(O.a,{className:"gx-mb-0",onClick:this.onEditEnd,children:a.formatMessage({id:"cancell"})})]})})]})},r.id)]})]})}}]),n}(u.a.Component);xe.contextType=y.a;var ge=Object(p.c)(xe),ye={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M433.1 657.7a31.8 31.8 0 0051.7 0l210.6-292c3.8-5.3 0-12.7-6.5-12.7H642c-10.2 0-19.9 4.9-25.9 13.3L459 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H315c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"check-square",theme:"outlined"},we=function(e,t){return d.createElement(de.a,Object(I.a)(Object(I.a)({},e),{},{ref:t,icon:ye}))};we.displayName="CheckSquareOutlined";var Se=d.forwardRef(we),ke=V.a.Text,Ee=function(e){Object(c.a)(n,e);var t=Object(s.a)(n);function n(e){var i;return Object(r.a)(this,n),(i=t.call(this,e)).m=function(e){return i.props.intl.formatMessage({id:"admin.workflow.constructor.events."+e})},i.load=Object(a.a)(l.a.mark((function e(){var t,n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!i.props.classId){e.next=10;break}if(i.props.stateId||i.state.all){e.next=3;break}return e.abrupt("return");case 3:return i.setState({pending:!0}),t=[{field:"class",compare:"EQL",value:i.props.classId}],i.props.actionItem.action&&!i.state.all&&t.push({field:"action",compare:"EQL",value:i.props.actionItem.action}),e.next=8,i.context.api.q(i.apiPath+"/list",{search:t,orderby:["sequence ASC"]},{toObject:!0});case 8:n=e.sent,i.setState({pending:!1,items:n},(function(){return i.select(i.state.activeItem)}));case 10:case"end":return e.stop()}}),e)}))),i.select=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)for(var t in i.state.items){e=t;break}i.setState({activeItem:String(e)});var n=i.state.items[String(e)]||{};i.props.onChange(n)},i.save=function(){var e=Object(a.a)(l.a.mark((function e(t){var n,a,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.props.intl,a=i.state.items[i.state.activeItem],i.state.edit&&(t.id=a.id),t.class=i.props.classId,t.action=i.props.actionItem.action,t.sequence||delete t.sequence,i.setState({pending:!0}),e.next=9,i.context.api.q(i.apiPath+"/set",t);case 9:if(!1===(r=e.sent)){e.next=18;break}return m.b.success(n.formatMessage({id:"save.success"})),e.next=14,i.load();case 14:i.setState({edit:!1,add:!1,security:!1}),r.id&&i.select(r.id),e.next=19;break;case 18:m.b.error(n.formatMessage({id:"save.fail"}));case 19:i.setState({pending:!1});case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i.delete=Object(a.a)(l.a.mark((function e(){var t,n,a=arguments;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:{},n=i.props.intl,i.setState({pending:!0}),e.next=5,i.context.api.q(i.apiPath+"/delete",{id:t.id});case 5:!1!==e.sent?(m.b.success(n.formatMessage({id:"delete.success"})),i.select(),i.load()):m.b.error(n.formatMessage({id:"delete.fail"})),i.setState({pending:!1});case 8:case"end":return e.stop()}}),e)}))),i.toggleAll=function(){i.setState((function(e){return{all:!e.all,activeItem:!1}}),(function(){return i.load()}))},i.onEditStart=function(e){i.setState({edit:!0,activeItem:e.id})},i.onSecurityStart=function(e){i.setState({security:!0,activeItem:e.id})},i.onAddStart=function(){i.setState({add:!0,activeItem:!1})},i.onEditEnd=function(){i.setState({add:!1,edit:!1,security:!1})},i.state={all:!1,pending:!1,activeItem:!1,add:!1,edit:!1,security:!1,items:{}},i.apiPath="/workflow/event",i}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.load()}},{key:"renderPath",value:function(){var e=this.state.items[this.state.activeItem]||{},t=e.classlabel||this.props.stateItem.classlabel,n=e.actionname||this.props.actionItem.actionname;return Object(F.jsx)(T.a,{style:{marginBottom:"15px"},type:"info",message:Object(F.jsxs)(j.b,{children:[t,Object(F.jsx)("span",{className:"fa fa-long-arrow-right"}),n]})})}},{key:"render",value:function(){var e=this,t=this.props,n=t.classId,a=t.intl,r=this.state.items[this.state.activeItem]||{},i=[{title:this.m("type"),dataIndex:"typecode",key:"typecode",render:function(e,t){return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(ke,{type:"secondary",children:e}),":",t.typename]})}},{title:this.m("action"),dataIndex:"actioncode",key:"actioncode",render:function(e,t){return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(ke,{type:"secondary",children:e}),":",t.actionname]})}},{title:Object(F.jsxs)(R.a,{between:!0,children:[Object(F.jsx)("div",{children:this.m("label")}),Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{type:this.state.all?"primary":null,onClick:function(){return e.toggleAll()},icon:Object(F.jsx)(pe,{})}),Object(F.jsx)(O.a,{onClick:function(){return e.onAddStart()},icon:Object(F.jsx)(E.a,{})})]})]}),dataIndex:"label",key:"label",render:function(t,n){return Object(F.jsxs)(R.a,{between:!0,children:[Object(F.jsxs)("div",{children:[t,Object(F.jsx)("div",{children:Object(F.jsx)(ke,{type:"secondary",children:n.text})})]}),Object(F.jsxs)(j.b,{children:[n.enabled&&Object(F.jsx)(Se,{style:{color:"#52c41a"}}),Object(F.jsx)(O.a,{onClick:function(){return e.onEditStart(n)},icon:Object(F.jsx)(H.a,{})}),Object(F.jsx)(x.a,{title:"".concat(a.formatMessage({id:"delete.sure"})," ").concat(t),onConfirm:function(){return e.delete(n)},okText:a.formatMessage({id:"yes"}),cancelText:a.formatMessage({id:"no"}),children:Object(F.jsx)(O.a,{icon:Object(F.jsx)(C.a,{})})})]})]})}}];return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(M.a,{spinning:!!this.state.pending,children:n&&Object(F.jsx)(F.Fragment,{children:Object(F.jsx)(B.a,{pagination:{hideOnSinglePage:!0},columns:i,dataSource:Object.values(this.state.items),rowClassName:function(e){return e.id===r.id?"row-selected":""},onRow:function(t){return{onClick:function(){return e.select(t.id)}}}})})}),Object(F.jsx)(z.a,{onCancel:this.onEditEnd,visible:this.state.security,footer:null,width:"800px",children:Object(F.jsx)(ie,{onCancell:function(){return e.setState({add:!1,edit:!1,security:!1})},mode:"method",itemId:r.id})}),Object(F.jsxs)(z.a,{onCancel:this.onEditEnd,visible:this.state.add||this.state.edit,footer:null,children:[this.renderPath(),Object(F.jsx)(P.a,{layout:"vertical",name:"type",initialValues:{type:r.type||"",sequence:r.sequence||"",label:r.label||"",text:r.text||"",enabled:!!r.enabled},onFinish:this.save,onFinishFailed:this.onFormFinishFailed,children:Object(F.jsxs)(j.b,{direction:"vertical",style:{width:"100%"},children:[Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("type"),name:"type",children:Object(F.jsx)(L.a,{labelKey:"name",query:"/workflow/event/type"})}),Object(F.jsx)(P.a.Item,{label:this.m("sequence"),name:"sequence",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{rules:[{required:!0}],label:this.m("label"),name:"label",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{label:this.m("text"),name:"text",children:Object(F.jsx)(N.a,{})}),Object(F.jsx)(P.a.Item,{name:"enabled",valuePropName:"checked",children:Object(F.jsx)(D.a,{children:this.m("enabled")})}),Object(F.jsx)(P.a.Item,{style:{marginTop:"10px"},children:Object(F.jsxs)(j.b,{children:[Object(F.jsx)(O.a,{loading:this.state.pending,type:"primary",htmlType:"submit",className:"gx-mb-0",children:a.formatMessage({id:"save"})}),Object(F.jsx)(O.a,{className:"gx-mb-0",onClick:this.onEditEnd,children:a.formatMessage({id:"cancell"})})]})})]})},r.id)]})]})}}]),n}(u.a.Component);Ee.contextType=y.a;var Ce=Object(p.c)(Ee),Ie=V.a.Title,Te=function(e){Object(c.a)(n,e);var t=Object(s.a)(n);function n(e){var a;return Object(r.a)(this,n),(a=t.call(this,e)).onStateChanged=function(e){a.setState({state:e})},a.onActionChanged=function(e){a.setState({action:e})},a.onTransitionChanged=function(e){a.setState({transition:e})},a.m=function(e){return a.props.intl.formatMessage({id:"admin.workflow.constructor."+e})},a.state={state:{},action:{},transition:{}},a}return Object(i.a)(n,[{key:"render",value:function(){var e=this.props.classId;return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(Ie,{level:5,children:this.m("states")}),Object(F.jsx)(oe,{onChange:this.onStateChanged,classId:e},e),Object(F.jsx)(Ie,{style:{marginTop:"25px"},level:5,children:this.m("methods")}),Object(F.jsx)(ve,{onChange:this.onActionChanged,classId:this.props.classId,stateId:this.state.state.id,stateItem:this.state.state},this.state.state.id),Object(F.jsx)(Ie,{style:{marginTop:"25px"},level:5,children:this.m("transitions")}),Object(F.jsx)(ge,{onChange:this.onTransitionChanged,classId:this.props.classId,stateId:this.state.state.id,stateItem:this.state.state,actionId:this.state.action.id,actionItem:this.state.action},"transitions".concat(this.state.state.id).concat(this.state.action.id)),Object(F.jsx)(Ie,{style:{marginTop:"25px"},level:5,children:this.m("events")}),Object(F.jsx)(Ce,{onChange:function(){},classId:this.props.classId,stateId:this.state.state.id,stateItem:this.state.state,actionId:this.state.action.id,actionItem:this.state.action},"events".concat(this.state.state.id).concat(this.state.action.id))]})}}]),n}(u.a.Component);Te.contextType=y.a;var Me=Object(p.c)(Te),Pe=n(854),Ne=f.a.TabPane,De=function(e){Object(c.a)(n,e);var t=Object(s.a)(n);function n(e){var i;return Object(r.a)(this,n),(i=t.call(this,e)).pendingStart=function(){i.props.onPendingStart?i.props.onPendingStart():i.setState({pending:!0})},i.pendingEnd=function(){i.props.onPendingEnd?i.props.onPendingEnd():i.setState({pending:!1})},i.setParams=function(){var e=i.props.match.params,t=e.param1,n=e.param2,a=void 0===n?"edit":n;i.setState({classId:t,tabKey:a})},i.loadTree=Object(a.a)(l.a.mark((function e(){var t,n;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.setState({pending:!0}),t=[],i.state.treeSearch&&t.push({field:"label",compare:"IKE",value:"%".concat(i.state.treeSearch,"%")}),e.next=5,i.context.api.q("/workflow/class/list",{search:t},{toTree:!0});case 5:n=e.sent,i.setState({tree:n,treeKey:Object(b.a)(),pending:!1});case 7:case"end":return e.stop()}}),e)}))),i.onTreeSelect=function(e){var t=i.state.tabKey;Array.isArray(e)&&e[0]&&i.props.history.push("/admin/workflow/".concat(e[0],"/").concat(t||""))},i.onTreeSearch=function(e){i.setState({treeSearch:e},(function(){return i.loadTree()}))},i.onTabChange=function(e){var t=i.state.classId;e&&t&&i.props.history.push("/admin/workflow/".concat(t,"/").concat(e))},i.onAddStart=function(){i.props.history.push("/admin/workflow/add")},i.onDelete=Object(a.a)(l.a.mark((function e(){var t,n,a,r;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.props,n=t.intl,a=t.history,r=i.state.classId,i.pendingStart(),e.next=5,i.context.api.q("/workflow/class/delete",{id:r});case 5:!1!==e.sent?(m.b.success(n.formatMessage({id:"delete.success"})),a.push("/admin/workflow/"),i.loadTree()):(m.b.error(n.formatMessage({id:"delete.fail"})),i.pendingEnd());case 7:case"end":return e.stop()}}),e)}))),i.m=function(e){return i.props.intl.formatMessage({id:"admin.workflow."+e})},i.state={treeSearch:"",treeKey:Object(b.a)(),tree:[]},i}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.setParams(),this.loadTree()}},{key:"componentDidUpdate",value:function(e){Object(S.a)(e,this.props)&&this.setParams(),e.intl.locale!==this.props.intl.locale&&this.loadTree()}},{key:"render",value:function(){var e=this,t=this.state,n=t.pending,a=t.treeKey,r=t.tabKey,i=t.classId,c=this.props.intl;return Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(Pe.a,{title:this.m("workflow"),url:"/admin/workflow",icon:Object(F.jsx)(k.a,{})}),Object(F.jsxs)(h.a,{pending:n,onSearch:this.onTreeSearch,children:[Object(F.jsx)("div",{}),Object(F.jsx)("div",{className:"isoNoteBtns",children:Object(F.jsxs)(j.b,{children:[Object(F.jsx)(v.a,{title:this.m("btn.add"),children:Object(F.jsx)(O.a,{onClick:this.onAddStart,type:"primary",icon:Object(F.jsx)(E.a,{})})}),Object(F.jsx)(x.a,{title:"".concat(c.formatMessage({id:"delete.sure"})),onConfirm:function(){return e.onDelete()},okText:c.formatMessage({id:"yes"}),cancelText:c.formatMessage({id:"no"}),children:Object(F.jsx)(v.a,{title:this.m("btn.delete"),children:Object(F.jsx)(O.a,{icon:Object(F.jsx)(C.a,{})})})})]})}),Object(F.jsx)(g.a,{defaultExpandAll:!0,defaultExpandParent:!0,defaultSelectedKeys:[i],defaultExpandedKeys:[i],treeData:this.state.tree,onSelect:this.onTreeSelect},a),Object(F.jsx)("div",{children:r&&i&&Object(F.jsxs)(f.a,{defaultActiveKey:r,onChange:this.onTabChange,children:[Object(F.jsx)(Ne,{tab:c.formatMessage({id:"admin.workflow.tab.edit"}),children:Object(F.jsx)(q,{itemId:i,onChange:this.loadTree,onPendingStart:this.pendingStart,onPendingEnd:this.pendingEnd})},"edit"),"add"!==i&&Object(F.jsxs)(F.Fragment,{children:[Object(F.jsx)(Ne,{tab:c.formatMessage({id:"admin.workflow.tab.workflow"}),children:Object(F.jsx)(Me,{classId:i})},"workflow"),Object(F.jsx)(Ne,{tab:c.formatMessage({id:"admin.workflow.tab.types"}),children:Object(F.jsx)(_,{itemId:i,onPendingStart:this.pendingStart,onPendingEnd:this.pendingEnd})},"types"),Object(F.jsx)(Ne,{tab:c.formatMessage({id:"admin.workflow.tab.security"}),children:Object(F.jsx)(ie,{itemId:i,onPendingStart:this.pendingStart,onPendingEnd:this.pendingEnd,mode:"class"})},"security")]})]})})]})]})}}]),n}(u.a.Component);De.contextType=y.a;t.default=Object(w.h)(Object(p.c)(De))}}]);