/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */

"use strict";(self.webpackChunk_nocobase_plugin_workflow_javascript=self.webpackChunk_nocobase_plugin_workflow_javascript||[]).push([["222"],{1706:function(e,r,n){n.r(r);var t,o,a=n(8156),i=n.n(a),c=n(687),l=n(990),u=n(7055),s=n(7402),f=n(4779),d=n(115),h=n(2749);function v(e,r,n,t,o,a,i){try{var c=e[a](i),l=c.value}catch(e){n(e);return}c.done?r(l):Promise.resolve(l).then(t,o)}function b(){var e,r,n=(e=["\n    display: flex;\n    width: 100%;\n    height: 20em;\n\n    .cm-editor {\n      width: 100%;\n      border-radius: ","px;\n      border: 1px solid ",";\n      &:hover {\n        border-color: ",";\n      }\n      overflow: hidden;\n\n      &.cm-focused {\n        border-color: ",";\n        outline: none;\n      }\n    }\n  "],r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}})));return b=function(){return n},n}var p=(0,n(8202).createStyles)(function(e){var r=e.token;return{box:(0,e.css)(b(),r.borderRadius,r.colorBorder,r.colorPrimaryHover,r.colorPrimaryHover)}}),m=l.tk.theme({".cm-scroller":{backgroundColor:"#f0f0f0"}}),y=l.tk.theme({".cm-scroller":{backgroundColor:"#fff"}}),w=(0,f.ir)((t=function(e){var r;return function(e,r){var n,t,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){var l=[a,c];if(n)throw TypeError("Generator is already executing.");for(;i;)try{if(n=1,t&&(o=2&l[0]?t.return:l[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,l[1])).done)return o;switch(t=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,t=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=r.call(e,i)}catch(e){l=[6,e],t=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(n){return r=e.state.doc.toString(),(0,d.JSHINT)(r,{esversion:11,asi:!1,browser:!0,undef:!0,unused:!0,strict:"global",module:!0}),[2,(d.JSHINT.errors||[]).map(function(r){if(!r)return null;try{var n=e.state.doc.line(r.line||1),t=Math.min(Math.max(0,r.character-1),n.length),o=t;if(r.evidence){var a,i=(null==(a=r.evidence.slice(t).match(/^\w+|./))?void 0:a[0])||"";o=Math.min(t+i.length,n.length)}return{from:n.from+t,to:n.from+o,message:r.reason||"Syntax error",severity:r.code&&r.code.startsWith("W")?"warning":"error",source:"jshint"}}catch(e){return console.warn("Error processing lint result:",e),null}}).filter(Boolean)]})},o=function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(e){v(a,n,o,i,c,"next",e)}function c(e){v(a,n,o,i,c,"throw",e)}i(void 0)})},function(e){return o.apply(this,arguments)}));r.default=function(e){var r=e.onChange,n=e.value,t=e.disabled,o=(0,a.useRef)(null),f=(0,h.useMemoizedFn)(function(e){r&&r(e)}),d=p().styles,v=new u.F6;return(0,a.useEffect)(function(){var e=u.yy.create({doc:n,extensions:[c.Xy,(0,s.eJ)(),v.of(w),l.tk.updateListener.of(function(e){e.docChanged&&f(e.state.doc.toString())}),l.tk.editable.of(!t),t?m:y]}),r=new l.tk({state:e,parent:o.current});return function(){r.destroy()}},[t]),i().createElement("div",{ref:o,className:d.box})}}}]);