/**
 * 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_client_v2=self.webpackChunk_nocobase_plugin_workflow_client_v2||[]).push([["142"],{5329:function(e,n,t){t.d(n,{F:function(){return u}});var r=t(9155),l=t.n(r),o=t(2059),a=t(7806),i=t(9488);function c(e){var n=e.value,t=e.onChange,o=e.disabled,i=e.onCollectionChanged,c=(0,r.useRef)();return l().createElement(a.XJ,{value:n,disabled:o,onChange:function(e){var r,l=null!=(r=c.current)?r:n;null==t||t(e),l&&l!==e&&(null==i||i(l,e)),c.current=e}})}function u(e){var n=e.disabled,t=e.onCollectionChanged,r=(0,i.kj)();return l().createElement(o.Form.Item,{name:["config","collection"],label:r("Collection"),rules:[{required:!0}]},l().createElement(c,{disabled:n,onCollectionChanged:t}))}},6855:function(e,n,t){t.d(n,{F:function(){return s}});var r=t(9155),l=t.n(r),o=t(2059),a=t(7768),i=t(1801),c=t(9488);function u(e,n,t,r,l,o,a){try{var i=e[o](a),c=i.value}catch(e){t(e);return}i.done?n(c):Promise.resolve(c).then(r,l)}function s(e){var n=e.collection,t=e.label,r=e.name,s=e.required,f=e.maxAssociationFieldDepth,m=(0,c.kj)();return l().createElement(o.Form.Item,{name:void 0===r?["config","params","filter"]:r,label:null!=t?t:m("Filter"),validateTrigger:["onChange","onBlur"],rules:void 0===s||s?[{validator:function(e,n){var t;return(t=function(){return function(e,n){var t,r,l,o={label:0,sent:function(){if(1&l[0])throw l[1];return l[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:c(0)}),i(a,"throw",{value:c(1)}),i(a,"return",{value:c(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function c(i){return function(c){var u=[i,c];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(t=1,r&&(l=2&u[0]?r.return:u[0]?r.throw||((l=r.return)&&l.call(r),0):r.next)&&!(l=l.call(r,u[1])).done)return l;switch(r=0,l&&(u=[2&u[0],l.value]),u[0]){case 0:case 1:l=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,r=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(l=(l=o.trys).length>0&&l[l.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!l||u[1]>l[0]&&u[1]<l[3])){o.label=u[1];break}if(6===u[0]&&o.label<l[1]){o.label=l[1],l=u;break}if(l&&o.label<l[2]){o.label=l[2],o.ops.push(u);break}l[2]&&o.ops.pop(),o.trys.pop();continue}u=n.call(e,o)}catch(e){u=[6,e],r=0}finally{t=l=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){if(!(0,a.isValidFilter)(n))throw Error(m("Please add at least one condition"));return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,l){var o=t.apply(e,n);function a(e){u(o,r,l,a,i,"next",e)}function i(e){u(o,r,l,a,i,"throw",e)}a(void 0)})})()}}]:void 0},l().createElement(i.N$,{collection:n,maxAssociationFieldDepth:void 0===f?2:f}))}},693:function(e,n,t){t.d(n,{QueryFieldset:function(){return d},QueryPresetFieldset:function(){return p}});var r=t(9155),l=t.n(r),o=t(2059),a=t(2235),i=t(7806),c=t(9785),u=t(9488),s=t(5329),f=t(6855);function m(){var e=(0,u.kj)(),n=o.Form.useWatch(["config","collection"]);return n?l().createElement(l().Fragment,null,l().createElement(f.F,{collection:n,required:!1}),l().createElement(o.Form.Item,{name:["config","params","sort"],label:e("Sort")},l().createElement(i.o5,{collection:n})),l().createElement(i.uc,{pageName:["config","params","page"],pageSizeName:["config","params","pageSize"]}),l().createElement(o.Form.Item,{name:["config","params","appends"],label:e("Preload associations"),extra:e("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.")},l().createElement(i.Kr,{collection:n}))):null}function d(){var e,n,t=(0,u.kj)(),i=(0,a.TA)(),f=o.Form.useFormInstance(),d=[{label:(e=(0,u.kj)())("Single record"),value:!1,tooltip:e("The result will be an object of the first matching record only, or null if no matched record.")},{label:e("Multiple records"),value:!0,tooltip:e("The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.")}];return(0,r.useEffect)(function(){void 0===f.getFieldValue(["config","multiple"])&&f.setFieldValue(["config","multiple"],!1)},[f]),l().createElement(l().Fragment,null,l().createElement(s.F,{disabled:!!(null==i||null==(n=i.config)?void 0:n.collection),onCollectionChanged:function(){f.setFieldValue(["config","params"],{})}}),l().createElement(o.Form.Item,{name:["config","multiple"],label:t("Result type")},l().createElement(c.$,{options:d})),l().createElement(m,null),l().createElement(o.Form.Item,{name:["config","failOnEmpty"],valuePropName:"checked"},l().createElement(o.Checkbox,null,t("Exit when query result is null"))))}function p(){return l().createElement(s.F,null)}}}]);