/**
 * 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=self.webpackChunk_nocobase_plugin_workflow||[]).push([["159"],{3210:function(e,n,r){r.d(n,{s:function(){return i}});var t=r(5477),a=r(8275),o=r(9155),l=r.n(o);function u(){var e,n,r=(e=["\n          &:after {\n            content: ':';\n          }\n          & + a {\n            margin-left: 0.25em;\n          }\n        "],n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}})));return u=function(){return r},r}var i=function(e,n){var r=a.evaluators.get(e);return r&&r.link?l().createElement(l().Fragment,null,l().createElement("span",{className:(0,t.css)(u())},n("Syntax references")),l().createElement("a",{href:n(r.link),target:"_blank",rel:"noreferrer"},r.label)):null}},2066:function(e,n,r){r.d(n,{CalculationFieldset:function(){return p}});var t=r(9155),a=r.n(t),o=r(2059),l=r(8275),u=r(9785),i=r(3210),c=r(5606),s=r(9488);function f(e,n,r,t,a,o,l){try{var u=e[o](l),i=u.value}catch(e){r(e);return}u.done?n(i):Promise.resolve(i).then(t,a)}function p(){var e,n=(0,s.kj)(),r=null!=(e=o.Form.useWatch(["config","engine"]))?e:"formula.js";return a().createElement(a().Fragment,null,a().createElement(o.Form.Item,{name:["config","engine"],label:n("Calculation engine"),rules:[{required:!0}],initialValue:"formula.js"},a().createElement(u.$,{options:(0,l.getOptions)()})),a().createElement(o.Form.Item,{name:["config","expression"],label:n("Calculation expression"),dependencies:[["config","engine"]],validateTrigger:["onChange","onBlur"],rules:[{required:!0},{validator:function(e,t){var a;return(a=function(){var e,a;return function(e,n){var r,t,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(r=1,t&&(a=2&c[0]?t.return:c[0]?t.throw||((a=t.return)&&a.call(t),0):t.next)&&!(a=a.call(t,c[1])).done)return a;switch(t=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,t=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=n.call(e,o)}catch(e){c=[6,e],t=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){if(!t||!(e=l.evaluators.get(r)))return[2];a=String(t).trim().replace(/{{([^{}]+)}}/g,' "1" ');try{e.evaluate(a)}catch(e){throw Error(n("Expression syntax error"))}return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,t){var o=a.apply(e,n);function l(e){f(o,r,t,l,u,"next",e)}function u(e){f(o,r,t,l,u,"throw",e)}l(void 0)})})()}}],extra:(0,i.s)(r,n)},a().createElement(c.M,null)))}}}]);