/**
 * 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([["276"],{5329:function(e,n,t){t.d(n,{F:function(){return c}});var r=t(9155),o=t.n(r),l=t(2059),a=t(7806),i=t(9488);function u(e){var n=e.value,t=e.onChange,l=e.disabled,i=e.onCollectionChanged,u=(0,r.useRef)();return o().createElement(a.XJ,{value:n,disabled:l,onChange:function(e){var r,o=null!=(r=u.current)?r:n;null==t||t(e),o&&o!==e&&(null==i||i(o,e)),u.current=e}})}function c(e){var n=e.disabled,t=e.onCollectionChanged,r=(0,i.kj)();return o().createElement(l.Form.Item,{name:["config","collection"],label:r("Collection"),rules:[{required:!0}]},o().createElement(u,{disabled:n,onCollectionChanged:t}))}},9671:function(e,n,t){t.d(n,{DestroyFieldset:function(){return f},DestroyPresetFieldset:function(){return s}});var r=t(9155),o=t.n(r),l=t(2059),a=t(2235),i=t(5329),u=t(6855);function c(){var e=l.Form.useWatch(["config","collection"]);return e?o().createElement(u.F,{collection:e}):null}function f(){var e,n=(0,a.TA)(),t=l.Form.useFormInstance();return o().createElement(o().Fragment,null,o().createElement(i.F,{disabled:!!(null==n||null==(e=n.config)?void 0:e.collection),onCollectionChanged:function(){t.setFieldValue(["config","params","filter"],{})}}),o().createElement(c,null))}function s(){return o().createElement(i.F,null)}},6855:function(e,n,t){t.d(n,{F:function(){return f}});var r=t(9155),o=t.n(r),l=t(2059),a=t(7768),i=t(1801),u=t(9488);function c(e,n,t,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){t(e);return}i.done?n(u):Promise.resolve(u).then(r,o)}function f(e){var n=e.collection,t=e.label,r=e.name,f=e.required,s=e.maxAssociationFieldDepth,d=(0,u.kj)();return o().createElement(l.Form.Item,{name:void 0===r?["config","params","filter"]:r,label:null!=t?t:d("Filter"),validateTrigger:["onChange","onBlur"],rules:void 0===f||f?[{validator:function(e,n){var t;return(t=function(){return function(e,n){var t,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(t)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(t=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=n.call(e,l)}catch(e){c=[6,e],r=0}finally{t=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){if(!(0,a.isValidFilter)(n))throw Error(d("Please add at least one condition"));return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,o){var l=t.apply(e,n);function a(e){c(l,r,o,a,i,"next",e)}function i(e){c(l,r,o,a,i,"throw",e)}a(void 0)})})()}}]:void 0},o().createElement(i.N$,{collection:n,maxAssociationFieldDepth:void 0===s?2:s}))}}}]);