/*! For license information please see jfb-action-v2.js.LICENSE.txt */
(()=>{"use strict";var e={192:(e,t,o)=>{var n=o(609),r=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),l=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,o){var n,s={},d=null,c=null;for(n in void 0!==o&&(d=""+o),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(c=t.ref),t)i.call(t,n)&&!a.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:r,type:e,key:d,ref:c,props:s,_owner:l.current}}t.jsx=s,t.jsxs=s},540:(e,t,o)=>{e.exports=o(192)},609:e=>{e.exports=window.React}},t={};const o=window.wp.i18n,n=window.wp.components,r=window.jfb.components,i=window.jfb.actions,l=window.jfb.blocksToActions;var a=function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}(540);const s=window.wp.primitives,d=(0,a.jsx)(s.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",children:(0,a.jsx)(s.Path,{d:"M19.53 4.47a.75.75 0 0 1 0 1.06L17.06 8l.77.769a3.155 3.155 0 0 1 .685 3.439 3.15 3.15 0 0 1-.685 1.022v.001L13.23 17.83v.001a3.15 3.15 0 0 1-4.462 0L8 17.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L6.94 16l-.77-.769a3.154 3.154 0 0 1-.685-3.439 3.15 3.15 0 0 1 .685-1.023l4.599-4.598a3.152 3.152 0 0 1 4.462 0l.769.768 2.47-2.47a.75.75 0 0 1 1.06 0Zm-2.76 7.7L15 13.94 10.06 9l1.771-1.77a1.65 1.65 0 0 1 2.338 0L16.77 9.83a1.649 1.649 0 0 1 0 2.338h-.001ZM13.94 15 9 10.06l-1.77 1.771a1.65 1.65 0 0 0 0 2.338l2.601 2.602a1.649 1.649 0 0 0 2.338 0v-.001L13.94 15Z"})}),c={type:"connect_relation_items",label:(0,o.__)("Connect Relation Items","jet-engine"),category:"content",edit:function(e){const{source:t,settings:s,onChangeSettingObj:d}=e,c=(0,l.useFields)({withInner:!1,placeholder:"--"});return(0,a.jsxs)(n.Flex,{direction:"column",children:[(0,a.jsx)(i.ValidatedSelectControl,{label:(0,o.__)("Relation","jet-engine"),labelPosition:"side",value:s.relation,onChange:e=>d({relation:e}),options:[{value:"",label:"--"},...t.relations],required:!0,isErrorSupported:({property:e})=>"relation"===e}),(0,a.jsx)(r.WideLine,{}),(0,a.jsx)(i.ValidatedSelectControl,{label:(0,o.__)("Parent Item ID","jet-engine"),value:s.parent_id,onChange:e=>d({parent_id:e}),options:c,required:!0,isErrorSupported:({property:e})=>"parent_id"===e}),(0,a.jsx)(r.WideLine,{}),(0,a.jsx)(i.ValidatedSelectControl,{label:(0,o.__)("Child Item ID","jet-engine"),value:s.child_id,onChange:e=>d({child_id:e}),options:c,required:!0,isErrorSupported:({property:e})=>"child_id"===e}),(0,a.jsx)(r.WideLine,{}),(0,a.jsx)(i.ValidatedSelectControl,{label:(0,o.__)("Update Context","jet-engine"),value:s.context,onChange:e=>d({context:e}),options:[{value:"",label:"--"},...t.context_options]}),(0,a.jsx)(r.WideLine,{}),(0,a.jsx)(i.ValidatedSelectControl,{label:(0,o.__)("How to Store New Items","jet-engine"),value:s.store_items_type,onChange:e=>d({store_items_type:e}),options:[{value:"",label:"--"},...t.store_items_type_options]})]})},icon:d,docHref:"#",validators:[({settings:e})=>!e?.relation&&{property:"relation"},({settings:e})=>!e?.parent_id&&{property:"parent_id"},({settings:e})=>!e?.child_id&&{property:"child_id"}]},p=window.wp.hooks;(0,i.registerAction)(c),(0,p.addFilter)("jet.fb.preset.editor.custom.condition","jet-engine/connect-relation-items",(function(e,t,o){return"relation_query_var"===t?"connect_relation_items"===o.from&&["query_var","object_var"].includes(o.rel_object_from):e}))})();
//# sourceMappingURL=jfb-action-v2.js.map