← Back
Editing: display-conditions.min.js
/*! elementor-pro - v4.4.0 - 24-11-2026 */ (function(N,a,jt,y,he){var At=Object.create,ye=Object.defineProperty,b=(e,t)=>ye(e,"name",{value:t,configurable:!0}),qt=Object.getOwnPropertyDescriptor,Lt=Object.getOwnPropertyNames,Ht=Object.getPrototypeOf,Bt=Object.prototype.hasOwnProperty,le=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Ft=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Lt(t),i=0,s=o.length,c;i<s;i++)c=o[i],!Bt.call(e,c)&&c!==r&&ye(e,c,{get:(l=>t[l]).bind(null,c),enumerable:!(n=qt(t,c))||n.enumerable});return e},ge=(e,t,r)=>(r=e!=null?At(Ht(e)):{},Ft(t||!e||!e.__esModule?ye(r,"default",{value:e,enumerable:!0}):r,e));a=ge(a);var Yt=class extends Marionette.Behavior{ui(){const e=".eicon-flow.e-control-display-conditions";return{displayConditionsButton:e,displayConditionsPromoButton:`${e}-promo`}}events(){return{"click @ui.displayConditionsButton":"onClickControlButtonDisplayConditions","mouseenter @ui.displayConditionsPromoButton":"onHoverControlButtonDisplayConditions"}}onClickControlButtonDisplayConditions(e){e.stopPropagation(),this.mount()}onHoverControlButtonDisplayConditions(e){e.stopPropagation(),elementor.promotion.showDialog({title:(0,N.__)("Display Conditions","elementor-pro"),content:(0,N.__)("Upgrade to Elementor Pro Advanced to get the Display Conditions feature as well as additional professional and ecommerce widgets","elementor-pro"),targetElement:this.el,actionButton:{url:"https://go.elementor.com/go-pro-advanced-display-conditions/",text:(0,N.__)("Upgrade Now","elementor-pro"),classes:["elementor-button","go-pro"]}})}getRootElement(){let e=window.parent.document.getElementById("elementor-conditions__modal");return e||(e=document.createElement("div"),e.setAttribute("id","elementor-conditions__modal"),e)}mount(){const e=this.getRootElement();window.parent.document.body.appendChild(e),window.dispatchEvent(new CustomEvent("elementor/display-conditions/open",{detail:{rootElement:e,props:{getControlValue:this.getOption("getControlValue"),setControlValue:this.getOption("setControlValue"),onClose:()=>this.unmount(e),setCacheNoticeStatus:this.getOption("setCacheNoticeStatus")}}}))}unmount(e){window.dispatchEvent(new CustomEvent("elementor/display-conditions/close",{detail:{rootElement:e}}))}};function oe(e){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oe(e)}function Wt(e,t){if(oe(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(oe(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kt(e){var t=Wt(e,"string");return oe(t)=="symbol"?t:t+""}function H(e,t,r){return(t=kt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Te(e,t,r,n,o,i,s){try{var c=e[i](s),l=c.value}catch(m){r(m);return}c.done?t(l):Promise.resolve(l).then(n,o)}function Ut(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function s(l){Te(i,n,o,s,c,"next",l)}function c(l){Te(i,n,o,s,c,"throw",l)}s(void 0)})}}var Gt=class extends elementorModules.editor.utils.Module{constructor(...e){var t;super(...e),t=this,H(this,"pasteAction","paste"),H(this,"clearAction","clear"),H(this,"atomicDisplayConditionsKey","display-conditions"),H(this,"registerControlBehavior",(r,n)=>(this.getSettings("controls").trigger!==n.options.model.get("name")||(r||(r={}),r.displayConditions={behaviorClass:Yt,getControlValue:()=>{const o=this.getEditorControlView(this.getSettings("controls").displayConditions);if(!o)return[];const i=o.getControlValue();return this.getStructuredConditions(JSON.parse(i||"[]"))},setControlValue:o=>{const i=this.getEditorControlView(this.getSettings("controls").displayConditions),s=this.getEditorControlView(this.getSettings("controls").trigger);if(i&&(o=!(o!=null&&o.length)||o[0]==="[]"?"":o,i.setValue(o),i.applySavedValue()),s.$el){const c=s.$el.find(this.getSettings("selectors").icon);this.highlightIcon(c,i)}},setCacheNoticeStatus:(function(){var o=Ut(function*(){const i=yield t.doAjaxRequest("display_conditions_set_cache_notice_status");return i&&(elementor.config.displayConditions.show_cache_notice=!1),i});return function(){return o.apply(this,arguments)}})()}),r)),H(this,"highlightIconIfFilled",(r,n)=>{if(!["section_advanced","_section_style","section_layout"].includes(r))return;const o=this.getEditorControlView(this.getSettings("controls").displayConditions);if(!o)return;const i=n.$childViewContainer.find(this.getSettings("selectors").icon);this.highlightIcon(i,o)}),H(this,"highlightIcon",(r,n)=>{if(!r[0])return;const o=n.getControlValue()||"[]";if((o!=="[]"?this.getStructuredConditions(JSON.parse(o)):[]).length){var s;(s=r[0])===null||s===void 0||(s=s.classList)===null||s===void 0||s.add("filled")}else{var i;(i=r[0])===null||i===void 0||(i=i.classList)===null||i===void 0||i.remove("filled")}}),H(this,"doAjaxRequest",(r,n)=>{try{return new Promise((o,i)=>{elementorCommon.ajax.addRequest(r,{data:n,error:()=>i(),success:s=>{o(s)}})})}catch(o){return!1}}),H(this,"getStructuredConditions",r=>this.shouldConvertConditionsStructure(r)?[r]:r),H(this,"shouldConvertConditionsStructure",r=>r.length&&!Array.isArray(r[0])),H(this,"isAtomic",r=>elementor.helpers.isAtomicWidget(r)),H(this,"getSettingsKey",(r=!1)=>r?this.atomicDisplayConditionsKey:"e_display_conditions"),H(this,"getAtomicElementTypes",()=>Object.entries(elementor.config.elements).filter(([,r])=>!!(r!=null&&r.atomic_props_schema)).map(([r])=>r)),H(this,"createDisplayConditions",(r,n=!1)=>r!=null&&r.length?n?this.transformV3ToV4Conditions(r):JSON.stringify(r):n?null:""),H(this,"extractDisplayConditions",(r,n)=>{const o=this.getSettingsKey(n),i=r==null?void 0:r[o];return n?this.transformV4ToV3Conditions(i,n):JSON.parse(i||"[]")}),H(this,"transformV4ToV3Conditions",r=>{var n;return!(r==null||(n=r.value)===null||n===void 0)&&n.length?r.value.map(({value:o})=>{var i;return(i=o==null?void 0:o.map(({value:s})=>JSON.parse(s)))!==null&&i!==void 0?i:null}).filter(o=>!!(o!=null&&o.length)):[]}),H(this,"transformV3ToV4Conditions",r=>r!=null&&r.length?{$$type:this.atomicDisplayConditionsKey,value:r.map(n=>({$$type:"condition-group",value:n.map(o=>({$$type:"string",value:JSON.stringify(o)}))}))}:null)}getDefaultSettings(){return{selectors:{icon:".eicon-flow.e-control-display-conditions"},controls:{displayConditions:"e_display_conditions",trigger:"e_display_conditions_trigger"}}}onElementorInit(){elementor.hooks.addFilter("controls/base/behaviors",this.registerControlBehavior),elementor.channels.editor.on("section:activated",this.highlightIconIfFilled),elementor.on("navigator:init",this.onNavigatorInit.bind(this)),["widget","section","column","container",...this.getAtomicElementTypes()].forEach(e=>{elementor.hooks.addFilter(`elements/${e}/contextMenuGroups`,this.registerContextMenuGroups.bind(this))})}onElementorInitComponents(){$e.commands.register("document/elements","paste-display-conditions",e=>{this.tryContextMenuActions(e,this.pasteAction)}),$e.commands.register("document/elements","clear-display-conditions",e=>{this.tryContextMenuActions(e,this.clearAction)})}registerContextMenuGroups(e,t){const r=e.find(o=>o.name==="clipboard");if(!r)return e;const n=r.actions.findIndex(o=>o.name==="pasteStyle");return n!==-1&&r.actions.splice(n+1,0,{name:"pasteDisplayConditions",isEnabled:()=>this.isPasteDisplayConditionsEnabled(t),isVisible:()=>this.isPasteDisplayConditionsEnabled(t),title:(0,N.__)("Paste display conditions","elementor-pro"),callback:()=>$e.run("document/elements/paste-display-conditions",elementor.selection.getElements(t.getContainer()))}),r.actions.push({name:"clearDisplayConditions",isEnabled:()=>this.isClearDisplayConditionsEnabled(t),isVisible:()=>this.isClearDisplayConditionsEnabled(t),title:(0,N.__)("Clear display conditions","elementor-pro"),callback:()=>$e.run("document/elements/clear-display-conditions",elementor.selection.getElements(t.getContainer()))}),e}isPasteDisplayConditionsEnabled(e){var t;if(!((t=window.ElementorProDisplayConditions)===null||t===void 0)&&t.isLicenseExpired)return!1;const r=this.getSelectedElementDisplayCondition(e),n=!!this.getDisplayConditionsFromClipboard().length;return!r.length&&!elementor.selection.isMultiple()&&n}isClearDisplayConditionsEnabled(e){return this.getSelectedElementDisplayCondition(e).length&&!elementor.selection.isMultiple()}getSelectedElementDisplayCondition(e){var t;const r=this.isAtomic(e==null?void 0:e.model),n=this.getSettingsKey(r),o=e==null||(t=e.model)===null||t===void 0?void 0:t.getSetting(n);return r?this.transformV4ToV3Conditions(o):JSON.parse(o||"[]")}getDisplayConditionsFromClipboard(){const e=elementorCommon.storage.get("clipboard"),t=(e==null?void 0:e.elements)||[];if(t.length!==1)return[];const r=t[0],n=this.isAtomic(r);return this.extractDisplayConditions(r==null?void 0:r.settings,n)}tryContextMenuActions(e,t){const r=(e==null?void 0:e[0])||null,n=this.pasteAction===t?this.getDisplayConditionsFromClipboard():null;if(!r)return;const o=this.isAtomic(r.model),i=this.getSettingsKey(o);$e.run("document/elements/settings",{container:r,settings:{[i]:this.createDisplayConditions(n,o)}}),r.panel.refresh();try{const s=r.panel.getControlView(this.getSettings("controls").displayConditions),c=this.getEditorControlView(this.getSettings("controls").trigger).$el.find(this.getSettings("selectors").icon);this.highlightIcon(c,s)}catch(s){return!1}}onNavigatorInit(){elementor.navigator.indicators.displayConditions={icon:"flow",title:(0,N.__)("Display Conditions","elementor-pro"),settingKeys:["e_display_conditions","display-conditions"],section:"e_display_conditions_trigger"}}},zt=le(((e,t)=>{var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=r})),Kt=le(((e,t)=>{var r=zt();function n(){}function o(){}o.resetWarningCache=n,t.exports=function(){function i(l,m,v,g,P,S){if(S!==r){var R=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw R.name="Invariant Violation",R}}i.isRequired=i;function s(){return i}var c={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:s,element:i,elementType:i,instanceOf:s,node:i,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:o,resetWarningCache:n};return c.PropTypes=c,c}})),Jt=le(((e,t)=>{t.exports=Kt()()})),u=ge(Jt()),J={MULTIPLE_SELECT:"select2",SELECT:"select",QUERY:"query",DATE_TIME:"date_time",TEXT_FIELD:"text"},xe={select2:[],query:[],select:"",text:"",date_time:null},Y={CHANGE_CONTROL_VALUE:"CHANGE_CONTROL_VALUE",SET_ERRORS:"SET_ERRORS",ADD_OR_CONDITION:"ADD_OR_CONDITION",CHANGE_CONDITION_TYPE:"CHANGE_CONDITION_TYPE",ADD_AND_CONDITION:"ADD_AND_CONDITION",REMOVE_AND_CONDITION:"REMOVE_AND_CONDITION",REMOVE_OR_CONDITION:"REMOVE_OR_CONDITION"},ue={CONDITION_NAME:"dynamic_tags",CONTROL_NAME:"dynamic_tag_value",COMPARATORS:["is_empty","is_not_empty"]};function Ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function $(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ne(Object(r),!0).forEach(function(n){H(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Zt=(e,t)=>{switch(t.type){case Y.CHANGE_CONDITION_TYPE:return $($({},e),{},{selectedConditions:Qt($($({},e),t))});case Y.CHANGE_CONTROL_VALUE:return $($({},e),{},{selectedConditions:Xt($($({},e),t))});case Y.ADD_AND_CONDITION:return $($({},e),{},{selectedConditions:er($($({},e),t))});case Y.ADD_OR_CONDITION:return $($({},e),{},{selectedConditions:[...e.selectedConditions,[t.andCondition]]});case Y.REMOVE_AND_CONDITION:return $($({},e),{},{selectedConditions:tr($($({},e),t))});case Y.REMOVE_OR_CONDITION:return $($({},e),{},{selectedConditions:e.selectedConditions.filter((r,n)=>n!==t.orConditionIndex)});case Y.SET_ERRORS:return $($({},e),{},{selectedConditions:rr($($({},e),t))});default:return e}},Qt=({selectedConditions:e,conditionToChange:t,orConditionIndex:r,andConditionIndex:n})=>{const o=e[r].map((i,s)=>s===n?t:$({},i));return e.map((i,s)=>s===r?o:[...i])},Xt=({selectedConditions:e,orConditionIndex:t,andConditionIndex:r,controlKey:n,value:o})=>{const i=[...e[t]],s=$($({},$({},i[r])),{},{[n]:o}),c=i.map((l,m)=>m===r?s:$({},l));return e.map((l,m)=>m===t?c:[...l])},er=({selectedConditions:e,orConditionIndex:t,andConditionIndex:r,andCondition:n})=>{const o=e[t],i=o.reduce((s,c,l)=>(s.push($({},c)),(l===r||o.length===r&&o.length-1===l)&&s.push(n),s),[]);return e.map((s,c)=>c===t?i:[...s])},tr=({selectedConditions:e,orConditionIndex:t,andConditionIndex:r})=>{const n=e[t].reduce((o,i,s)=>(s!==r&&o.push($({},i)),o),[]);return e.reduce((o,i,s)=>(s===t&&n.length&&o.push(n),s!==t&&o.push([...i]),o),[])},rr=({selectedConditions:e,orConditionIndex:t,andConditionIndex:r,errors:n})=>{const o=[...e[t]],i=$({},o[r]);return i.errors=$($({},i.errors),n),o[r]=i,e.map((s,c)=>c===t?[...o]:[...s])},_e=a.default.createContext();function Ie(e){return J.MULTIPLE_SELECT===e||J.QUERY===e}function Ve(e){return Object.values(e)[0][0]}function Ce(e,t,r,n=!1){return r!=null&&r.length?{}:{message:sr(e,t),shouldShow:n}}var nr=(e,t)=>{const{type:r,variant:n=null,options:o}=t,i=(t==null?void 0:t.default)||(o&&J.MULTIPLE_SELECT!==r?Object.keys(o)[0]:xe[r]),s=Ie(r)&&!Array.isArray(i)?[i]:i;return{defaultValue:s,error:Ce(r,n,s)}},Oe=(e,t)=>{const{controls:r={}}=(e==null?void 0:e[t])||{};return Object.keys(r).reduce((n,o)=>{if(o==="__settings")return n;const{defaultValue:i,error:s}=nr(o,r[o]);return n[o]=i,n.errors[o]=s,n},{errors:{}})};function or(e){if(isNaN(parseFloat(e)))return!1;if(e.toString().indexOf(".")!==-1||e.toString().indexOf(",")!==-1)return!0}function ir(e){return e===3?200:150}function ar(e){return e===3?190:135}function Ee(e,t){return typeof e!="undefined"?e:t}function sr(e,t=null){return Ie(e)?(0,N.__)("Select an option","elementor-pro"):J.DATE_TIME===e?t==="time"?(0,N.__)("Select a time","elementor-pro"):(0,N.__)("Select a date","elementor-pro"):(0,N.__)("Enter a value","elementor-pro")}function lr(e,t){return ue.CONTROL_NAME===e&&ue.COMPARATORS.includes(t)}function ur(e,t){return ue.CONDITION_NAME===e&&ue.COMPARATORS.includes(t)}var cr=Object.defineProperty,Me=Object.getOwnPropertySymbols,dr=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,je=b((e,t,r)=>t in e?cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),fr=b((e,t)=>{for(var r in t||(t={}))dr.call(t,r)&&je(e,r,t[r]);if(Me)for(var r of Me(t))pr.call(t,r)&&je(e,r,t[r]);return e},"__spreadValues"),mr=e=>a.createElement(y.SvgIcon,fr({viewBox:"0 0 32 32"},e),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.69648 24.8891C0.938383 22.2579 0 19.1645 0 16C0 11.7566 1.68571 7.68687 4.68629 4.68629C7.68687 1.68571 11.7566 0 16 0C19.1645 0 22.2579 0.938383 24.8891 2.69648C27.5203 4.45459 29.5711 6.95344 30.7821 9.87706C31.9931 12.8007 32.3099 16.0177 31.6926 19.1214C31.0752 22.2251 29.5514 25.0761 27.3137 27.3137C25.0761 29.5514 22.2251 31.0752 19.1214 31.6926C16.0177 32.3099 12.8007 31.9931 9.87706 30.7821C6.95344 29.5711 4.45459 27.5203 2.69648 24.8891ZM12.0006 9.33281H9.33437V22.6665H12.0006V9.33281ZM22.6657 9.33281H14.6669V11.9991H22.6657V9.33281ZM22.6657 14.6654H14.6669V17.3316H22.6657V14.6654ZM22.6657 20.0003H14.6669V22.6665H22.6657V20.0003Z"})),Ae=({onClose:e})=>a.default.createElement(y.AppBar,{sx:{fontWeight:"normal"},color:"transparent",position:"relative"},a.default.createElement(y.Toolbar,{variant:"dense"},a.default.createElement(mr,{sx:{mr:1}}),a.default.createElement(y.Typography,{component:"span",variant:"subtitle2",sx:{fontWeight:"bold",textTransform:"uppercase"}},(0,N.__)("Display Conditions","elementor-pro")),a.default.createElement(y.Stack,{direction:"row",spacing:1,alignItems:"center",sx:{ml:"auto"}},a.default.createElement(y.IconButton,{size:"small","aria-label":(0,N.__)("Close","elementor-pro"),onClick:e,sx:{"&.MuiButtonBase-root":{mr:-1}}},a.default.createElement(he.XIcon,null)))));Ae.propTypes={onClose:u.func.isRequired};var qe=({onClickSaveButton:e,isButtonDisabled:t})=>a.createElement(y.Stack,{direction:"row",justifyContent:"flex-end",sx:{py:1,px:3}},a.createElement(y.Button,{variant:"contained",color:"accent",className:"save-and-close-button",disabled:!t,onClick:e},(0,N.__)("Save & Close","elementor-pro")));qe.propTypes={onClickSaveButton:u.default.func,isButtonDisabled:u.default.bool.isRequired};var vr=Object.defineProperty,hr=Object.defineProperties,yr=Object.getOwnPropertyDescriptors,Le=Object.getOwnPropertySymbols,gr=Object.prototype.hasOwnProperty,_r=Object.prototype.propertyIsEnumerable,He=b((e,t,r)=>t in e?vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),Cr=b((e,t)=>{for(var r in t||(t={}))gr.call(t,r)&&He(e,r,t[r]);if(Le)for(var r of Le(t))_r.call(t,r)&&He(e,r,t[r]);return e},"__spreadValues"),Or=b((e,t)=>hr(e,yr(t)),"__spreadProps"),Er=(0,y.styled)(a.forwardRef((e,t)=>a.createElement(y.SvgIcon,Or(Cr({viewBox:"0 0 24 24"},e),{ref:t}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 3.75C10.3096 3.75 9.75 4.30964 9.75 5V7C9.75 7.69036 10.3096 8.25 11 8.25H13C13.6904 8.25 14.25 7.69036 14.25 7V5C14.25 4.30964 13.6904 3.75 13 3.75H11ZM12.75 9.75H13C14.5188 9.75 15.75 8.51878 15.75 7V5C15.75 3.48122 14.5188 2.25 13 2.25H11C9.48122 2.25 8.25 3.48122 8.25 5V7C8.25 8.51878 9.48122 9.75 11 9.75H11.25V11.25H8C7.27065 11.25 6.57118 11.5397 6.05546 12.0555C5.53973 12.5712 5.25 13.2707 5.25 14V14.25H5C3.48122 14.25 2.25 15.4812 2.25 17V19C2.25 20.5188 3.48122 21.75 5 21.75H7C8.51878 21.75 9.75 20.5188 9.75 19V17C9.75 15.4812 8.51878 14.25 7 14.25H6.75V14C6.75 13.6685 6.8817 13.3505 7.11612 13.1161C7.35054 12.8817 7.66848 12.75 8 12.75H16C16.3315 12.75 16.6495 12.8817 16.8839 13.1161C17.1183 13.3505 17.25 13.6685 17.25 14V14.25H17C15.4812 14.25 14.25 15.4812 14.25 17V19C14.25 20.5188 15.4812 21.75 17 21.75H19C20.5188 21.75 21.75 20.5188 21.75 19V17C21.75 15.4812 20.5188 14.25 19 14.25H18.75V14C18.75 13.2707 18.4603 12.5712 17.9445 12.0555C17.4288 11.5397 16.7293 11.25 16 11.25H12.75V9.75ZM17 15.75C16.3096 15.75 15.75 16.3096 15.75 17V19C15.75 19.6904 16.3096 20.25 17 20.25H19C19.6904 20.25 20.25 19.6904 20.25 19V17C20.25 16.3096 19.6904 15.75 19 15.75H17ZM5 15.75C4.30964 15.75 3.75 16.3096 3.75 17V19C3.75 19.6904 4.30964 20.25 5 20.25H7C7.69036 20.25 8.25 19.6904 8.25 19V17C8.25 16.3096 7.69036 15.75 7 15.75H5Z"}))))(({theme:e})=>({"& path":{fill:e.palette.text.primary}}));function ie(){return(0,a.useContext)(_e)}var br=Object.defineProperty,Pr=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,ce=Object.getOwnPropertySymbols,Be=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,Ye=b((e,t,r)=>t in e?br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),$r=b((e,t)=>{for(var r in t||(t={}))Be.call(t,r)&&Ye(e,r,t[r]);if(ce)for(var r of ce(t))Fe.call(t,r)&&Ye(e,r,t[r]);return e},"__spreadValues"),wr=b((e,t)=>Pr(e,Sr(t)),"__spreadProps"),Dr=b((e,t)=>{var r={};for(var n in e)Be.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ce)for(var n of ce(e))t.indexOf(n)<0&&Fe.call(e,n)&&(r[n]=e[n]);return r},"__objRest"),be=e=>{var t=e,{controlCount:r}=t,n=Dr(t,["controlCount"]);return a.default.createElement(y.Select,wr($r({},n),{size:"small",sx:{flex:1,textAlign:"start",alignSelf:"flex-start",".MuiSelect-select .MuiTypography-root":{maxWidth:ar(r)}},color:"secondary",MenuProps:{PaperProps:{sx:{maxHeight:280,"& .MuiListSubheader-root":{position:"initial"}}},classes:{paper:"e-conditions-select-menu"}}}))};be.propTypes={controlCount:u.number.isRequired};var Rr=Object.defineProperty,Tr=Object.defineProperties,xr=Object.getOwnPropertyDescriptors,de=Object.getOwnPropertySymbols,We=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,Ue=b((e,t,r)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),Ge=b((e,t)=>{for(var r in t||(t={}))We.call(t,r)&&Ue(e,r,t[r]);if(de)for(var r of de(t))ke.call(t,r)&&Ue(e,r,t[r]);return e},"__spreadValues"),Nr=b((e,t)=>Tr(e,xr(t)),"__spreadProps"),Ir=b((e,t)=>{var r={};for(var n in e)We.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&de)for(var n of de(e))t.indexOf(n)<0&&ke.call(e,n)&&(r[n]=e[n]);return r},"__objRest"),Q=e=>{var t=e,{controlCount:r,sx:n={}}=t,o=Ir(t,["controlCount","sx"]);return a.default.createElement(y.Typography,Nr(Ge({noWrap:!0},o),{variant:o.variant||"inherit",sx:Ge({maxWidth:ir(r)},n)}))};Q.propTypes={sx:u.object,isDropdownItem:u.bool,variant:u.string,controlCount:u.number.isRequired};var ze=({condition:e,control:t,controlKey:r,onChangeOption:n,options:o,value:i,controlCount:s})=>{const[c,l]=(0,a.useState)(i);(0,a.useEffect)(()=>{l(i)},[e]);const m=g=>{n(g),l(g)},v=()=>Object.entries(o).map(([g,P])=>{var S;if(!P)return null;if(P.type==="group")return a.createElement(y.ListSubheader,{key:g},a.createElement(Q,{controlCount:s},P.label));const R=(S=t==null?void 0:t.disabled_options)==null?void 0:S.includes(g);return a.createElement(y.MenuItem,{key:g,value:g,disabled:R,className:R&&(t==null?void 0:t.disabled_type)==="hidden"?"elementor-hidden":""},a.createElement(Q,{controlCount:s},P))});return a.createElement(be,{id:`select-${r}`,value:c,onChange:g=>m(g.target.value),disabled:Object.keys(o).length<=1,controlCount:s},v())};ze.propTypes={condition:u.object.isRequired,control:u.object.isRequired,controlKey:u.string.isRequired,onChangeOption:u.func.isRequired,options:u.object.isRequired,value:u.string.isRequired,controlCount:u.number.isRequired};var Vr=Object.defineProperty,Mr=Object.defineProperties,jr=Object.getOwnPropertyDescriptors,pe=Object.getOwnPropertySymbols,Ke=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Ze=b((e,t,r)=>t in e?Vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),Qe=b((e,t)=>{for(var r in t||(t={}))Ke.call(t,r)&&Ze(e,r,t[r]);if(pe)for(var r of pe(t))Je.call(t,r)&&Ze(e,r,t[r]);return e},"__spreadValues"),Xe=b((e,t)=>Mr(e,jr(t)),"__spreadProps"),Ar=(e,t)=>{var r={};for(var n in e)Ke.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pe)for(var n of pe(e))t.indexOf(n)<0&&Je.call(e,n)&&(r[n]=e[n]);return r},Pe=b(e=>Array.isArray(e)?e:[e],"formatValue"),et=({conditions:e,condition:t,controlKey:r,onChangeOption:n,options:o,value:i,shouldShowError:s,errorMessage:c,isMultiple:l,controlCount:m})=>{const[v,g]=(0,a.useState)(Pe(i)),P=v!=null&&v.length?"":e[t.condition].label||"";(0,a.useEffect)(()=>{g(Pe(i))},[t]);const S=I=>{n(I),g(I)},R=(I,V)=>{var j=I,{key:U}=j,C=Ar(j,["key"]);return a.createElement(y.Typography,Xe(Qe({component:"li"},C),{key:U}),a.createElement(Q,{component:"span",variant:"inherit",noWrap:!0,controlCount:m},o[V]))},k=I=>a.createElement(y.TextField,Xe(Qe({error:s,helperText:c},I),{placeholder:P,color:"secondary"}));return a.createElement(y.Autocomplete,{multiple:l,id:`select-${r}`,value:v,options:Object.keys(o),getOptionLabel:I=>o[I],sx:{flex:1},ChipProps:{sx:{"&.MuiAutocomplete-tag":{maxWidth:"100px"}}},renderInput:k,ListboxProps:{sx:{maxHeight:280}},size:"small",onChange:(I,V)=>S(Pe(V)),renderOption:R,forcePopupIcon:!Object.keys(o).length<=1})};et.propTypes={conditions:u.object.isRequired,condition:u.object.isRequired,controlKey:u.string.isRequired,onChangeOption:u.func.isRequired,value:u.array.isRequired,options:u.object.isRequired,errorMessage:u.string.isRequired,shouldShowError:u.bool.isRequired,isMultiple:u.bool.isRequired,controlCount:u.number.isRequired};var qr=e=>new DOMParser().parseFromString(e,"text/html").documentElement.textContent,Lr=Object.defineProperty,Hr=Object.defineProperties,Br=Object.getOwnPropertyDescriptors,tt=Object.getOwnPropertySymbols,Fr=Object.prototype.hasOwnProperty,Yr=Object.prototype.propertyIsEnumerable,rt=b((e,t,r)=>t in e?Lr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),Se=b((e,t)=>{for(var r in t||(t={}))Fr.call(t,r)&&rt(e,r,t[r]);if(tt)for(var r of tt(t))Yr.call(t,r)&&rt(e,r,t[r]);return e},"__spreadValues"),nt=b((e,t)=>Hr(e,Br(t)),"__spreadProps"),Wr=b((e,t,r)=>new Promise((n,o)=>{var i=l=>{try{c(r.next(l))}catch(m){o(m)}},s=l=>{try{c(r.throw(l))}catch(m){o(m)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);c((r=r.apply(e,t)).next())}),"__async"),ot=e=>Array.isArray(e)?e:[e],it=({conditions:e,condition:t,control:r,controlKey:n,onChangeOption:o,value:i,shouldShowError:s,errorMessage:c,isMultiple:l,controlCount:m})=>{const{fetchData:v}=(0,a.useContext)(_e),[g,P]=(0,a.useState)(ot(i)),[S,R]=(0,a.useState)([]),[k,I]=(0,a.useState)(!1),V=g!=null&&g.length?"":e[t.condition].label||"";(0,a.useEffect)(()=>{P(ot(i))},[t]);const j=(C,D,M)=>Wr(null,null,function*(){if(D===""){R([]);return}I(!0);const G=(yield v(D,r)).filter(q=>(q.text=qr(q.text),!M.some(B=>(B==null?void 0:B.id)===(q==null?void 0:q.id))));R(G),I(!1)}),U=C=>{o(C),P(C)};return a.default.createElement(y.Autocomplete,{multiple:l,id:`select-${n}`,value:g,options:S,getOptionLabel:C=>C?C.text:"",isOptionEqualToValue:(C,D)=>C.id===D.id,filterOptions:C=>C,noOptionsText:(0,N.__)("No results","elementor-pro"),loading:k,loadingText:(0,N.__)("Searching...","elementor-pro"),size:"small",sx:{flex:1},ChipProps:{sx:{"&.MuiAutocomplete-tag":{maxWidth:"100px"}}},renderInput:C=>a.default.createElement(y.TextField,nt(Se({},C),{placeholder:V,color:"secondary",error:s,helperText:c,InputProps:nt(Se({},C.InputProps),{endAdornment:a.default.createElement(a.default.Fragment,null,k?a.default.createElement(y.CircularProgress,{color:"inherit",size:20}):null,C.InputProps.endAdornment)})})),ListboxProps:{sx:{maxHeight:280}},onChange:(C,D)=>U(D),onInputChange:(C,D)=>j(C,D,g),renderOption:(C,D)=>a.default.createElement(y.Typography,Se({component:"li"},C),a.default.createElement(Q,{component:"span",variant:"inherit",noWrap:!0,controlCount:m},D.text))})};it.propTypes={conditions:u.object.isRequired,condition:u.object.isRequired,onChangeOption:u.func.isRequired,controlKey:u.string.isRequired,control:u.object.isRequired,value:u.array.isRequired,errorMessage:u.string.isRequired,shouldShowError:u.bool.isRequired,isMultiple:u.bool.isRequired,controlCount:u.number.isRequired};var kr=Object.defineProperty,Ur=Object.defineProperties,Gr=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,zr=Object.prototype.hasOwnProperty,Kr=Object.prototype.propertyIsEnumerable,st=b((e,t,r)=>t in e?kr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),Jr=b((e,t)=>{for(var r in t||(t={}))zr.call(t,r)&&st(e,r,t[r]);if(at)for(var r of at(t))Kr.call(t,r)&&st(e,r,t[r]);return e},"__spreadValues"),Zr=b((e,t)=>Ur(e,Gr(t)),"__spreadProps"),lt=({condition:e,controlKey:t,control:r,onChangeOption:n,value:o,errorMessage:i,shouldShowError:s,placeholder:c,disabled:l})=>{const[m,v]=(0,a.useState)(o),{step:g=1,min:P=0,variant:S=null}=r,R=S==="number"?{type:"number",inputProps:{step:g,min:P}}:{};(0,a.useEffect)(()=>{v(o)},[e]);const k=(I,V)=>{let j=null;V==="number"&&or(I)&&(j=Math.floor(parseFloat(I))),n(j!=null?j:I.trim()),v(j!=null?j:I)};return a.createElement(y.TextField,Zr(Jr({},R),{sx:{flex:1},error:s,helperText:i,value:m,id:`text-${t}`,variant:"outlined",onChange:I=>k(I.target.value,S),size:"small",color:"secondary",placeholder:c,disabled:l!=null?l:!1}))};lt.propTypes={condition:u.object.isRequired,controlKey:u.string.isRequired,control:u.object.isRequired,onChangeOption:u.func.isRequired,value:u.oneOfType([u.string,u.number]).isRequired,errorMessage:u.string.isRequired,shouldShowError:u.bool.isRequired,placeholder:u.string.isRequired,disabled:u.bool};var Qr=le(((e,t)=>{(function(r,n){typeof e=="object"&&typeof t!="undefined"?t.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis!="undefined"?globalThis:r||self).dayjs=n()})(e,(function(){"use strict";var r=1e3,n=6e4,o=36e5,i="millisecond",s="second",c="minute",l="hour",m="day",v="week",g="month",P="quarter",S="year",R="date",k="Invalid Date",I=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,V=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var f=["th","st","nd","rd"],d=_%100;return"["+_+(f[(d-20)%10]||f[d]||f[0])+"]"}},U=function(_,f,d){var h=String(_);return!h||h.length>=f?_:""+Array(f+1-h.length).join(d)+_},C={s:U,z:function(_){var f=-_.utcOffset(),d=Math.abs(f),h=Math.floor(d/60),p=d%60;return(f<=0?"+":"-")+U(h,2,"0")+":"+U(p,2,"0")},m:function _(f,d){if(f.date()<d.date())return-_(d,f);var h=12*(d.year()-f.year())+(d.month()-f.month()),p=f.clone().add(h,g),O=d-p<0,E=f.clone().add(h+(O?-1:1),g);return+(-(h+(d-p)/(O?p-E:E-p))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:g,y:S,w:v,d:m,D:R,h:l,m:c,s,ms:i,Q:P}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},D="en",M={};M[D]=j;var G="$isDayjsObject",q=function(_){return _ instanceof re||!(!_||!_[G])},B=function _(f,d,h){var p;if(!f)return D;if(typeof f=="string"){var O=f.toLowerCase();M[O]&&(p=O),d&&(M[O]=d,p=O);var E=f.split("-");if(!p&&E.length>1)return _(E[0])}else{var x=f.name;M[x]=f,p=x}return!h&&p&&(D=p),p||!h&&D},T=function(_,f){if(q(_))return _.clone();var d=typeof f=="object"?f:{};return d.date=_,d.args=arguments,new re(d)},w=C;w.l=B,w.i=q,w.w=function(_,f){return T(_,{locale:f.$L,utc:f.$u,x:f.$x,$offset:f.$offset})};var re=(function(){function _(d){this.$L=B(d.locale,null,!0),this.parse(d),this.$x=this.$x||d.x||{},this[G]=!0}var f=_.prototype;return f.parse=function(d){this.$d=(function(h){var p=h.date,O=h.utc;if(p===null)return new Date(NaN);if(w.u(p))return new Date;if(p instanceof Date)return new Date(p);if(typeof p=="string"&&!/Z$/i.test(p)){var E=p.match(I);if(E){var x=E[2]-1||0,A=(E[7]||"0").substring(0,3);return O?new Date(Date.UTC(E[1],x,E[3]||1,E[4]||0,E[5]||0,E[6]||0,A)):new Date(E[1],x,E[3]||1,E[4]||0,E[5]||0,E[6]||0,A)}}return new Date(p)})(d),this.init()},f.init=function(){var d=this.$d;this.$y=d.getFullYear(),this.$M=d.getMonth(),this.$D=d.getDate(),this.$W=d.getDay(),this.$H=d.getHours(),this.$m=d.getMinutes(),this.$s=d.getSeconds(),this.$ms=d.getMilliseconds()},f.$utils=function(){return w},f.isValid=function(){return this.$d.toString()!==k},f.isSame=function(d,h){var p=T(d);return this.startOf(h)<=p&&p<=this.endOf(h)},f.isAfter=function(d,h){return T(d)<this.startOf(h)},f.isBefore=function(d,h){return this.endOf(h)<T(d)},f.$g=function(d,h,p){return w.u(d)?this[h]:this.set(p,d)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(d,h){var p=this,O=!!w.u(h)||h,E=w.p(d),x=function(ee,W){var Z=w.w(p.$u?Date.UTC(p.$y,W,ee):new Date(p.$y,W,ee),p);return O?Z:Z.endOf(m)},A=function(ee,W){return w.w(p.toDate()[ee].apply(p.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(W)),p)},L=this.$W,F=this.$M,z=this.$D,ne="set"+(this.$u?"UTC":"");switch(E){case S:return O?x(1,0):x(31,11);case g:return O?x(1,F):x(0,F+1);case v:var X=this.$locale().weekStart||0,ae=(L<X?L+7:L)-X;return x(O?z-ae:z+(6-ae),F);case m:case R:return A(ne+"Hours",0);case l:return A(ne+"Minutes",1);case c:return A(ne+"Seconds",2);case s:return A(ne+"Milliseconds",3);default:return this.clone()}},f.endOf=function(d){return this.startOf(d,!1)},f.$set=function(d,h){var p,O=w.p(d),E="set"+(this.$u?"UTC":""),x=(p={},p[m]=E+"Date",p[R]=E+"Date",p[g]=E+"Month",p[S]=E+"FullYear",p[l]=E+"Hours",p[c]=E+"Minutes",p[s]=E+"Seconds",p[i]=E+"Milliseconds",p)[O],A=O===m?this.$D+(h-this.$W):h;if(O===g||O===S){var L=this.clone().set(R,1);L.$d[x](A),L.init(),this.$d=L.set(R,Math.min(this.$D,L.daysInMonth())).$d}else x&&this.$d[x](A);return this.init(),this},f.set=function(d,h){return this.clone().$set(d,h)},f.get=function(d){return this[w.p(d)]()},f.add=function(d,h){var p,O=this;d=Number(d);var E=w.p(h),x=function(F){var z=T(O);return w.w(z.date(z.date()+Math.round(F*d)),O)};if(E===g)return this.set(g,this.$M+d);if(E===S)return this.set(S,this.$y+d);if(E===m)return x(1);if(E===v)return x(7);var A=(p={},p[c]=n,p[l]=o,p[s]=r,p)[E]||1,L=this.$d.getTime()+d*A;return w.w(L,this)},f.subtract=function(d,h){return this.add(-1*d,h)},f.format=function(d){var h=this,p=this.$locale();if(!this.isValid())return p.invalidDate||k;var O=d||"YYYY-MM-DDTHH:mm:ssZ",E=w.z(this),x=this.$H,A=this.$m,L=this.$M,F=p.weekdays,z=p.months,ne=p.meridiem,X=function(W,Z,se,ve){return W&&(W[Z]||W(h,O))||se[Z].slice(0,ve)},ae=function(W){return w.s(x%12||12,W,"0")},ee=ne||function(W,Z,se){var ve=W<12?"AM":"PM";return se?ve.toLowerCase():ve};return O.replace(V,(function(W,Z){return Z||(function(se){switch(se){case"YY":return String(h.$y).slice(-2);case"YYYY":return w.s(h.$y,4,"0");case"M":return L+1;case"MM":return w.s(L+1,2,"0");case"MMM":return X(p.monthsShort,L,z,3);case"MMMM":return X(z,L);case"D":return h.$D;case"DD":return w.s(h.$D,2,"0");case"d":return String(h.$W);case"dd":return X(p.weekdaysMin,h.$W,F,2);case"ddd":return X(p.weekdaysShort,h.$W,F,3);case"dddd":return F[h.$W];case"H":return String(x);case"HH":return w.s(x,2,"0");case"h":return ae(1);case"hh":return ae(2);case"a":return ee(x,A,!0);case"A":return ee(x,A,!1);case"m":return String(A);case"mm":return w.s(A,2,"0");case"s":return String(h.$s);case"ss":return w.s(h.$s,2,"0");case"SSS":return w.s(h.$ms,3,"0");case"Z":return E}return null})(W)||E.replace(":","")}))},f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(d,h,p){var O,E=this,x=w.p(h),A=T(d),L=(A.utcOffset()-this.utcOffset())*n,F=this-A,z=function(){return w.m(E,A)};switch(x){case S:O=z()/12;break;case g:O=z();break;case P:O=z()/3;break;case v:O=(F-L)/6048e5;break;case m:O=(F-L)/864e5;break;case l:O=F/o;break;case c:O=F/n;break;case s:O=F/r;break;default:O=F}return p?O:w.a(O)},f.daysInMonth=function(){return this.endOf(g).$D},f.$locale=function(){return M[this.$L]},f.locale=function(d,h){if(!d)return this.$L;var p=this.clone(),O=B(d,h,!0);return O&&(p.$L=O),p},f.clone=function(){return w.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},_})(),me=re.prototype;return T.prototype=me,[["$ms",i],["$s",s],["$m",c],["$H",l],["$W",m],["$M",g],["$y",S],["$D",R]].forEach((function(_){me[_[1]]=function(f){return this.$g(f,_[0],_[1])}})),T.extend=function(_,f){return _.$i||(_(f,re,T),_.$i=!0),T},T.locale=B,T.isDayjs=q,T.unix=function(_){return T(1e3*_)},T.en=M[D],T.Ls=M,T.p={},T}))})),te=ge(Qr()),fe="MM-DD-YYYY",we=b(e=>(0,te.default)(e,fe,!0).isValid()?(0,te.default)(e,fe):null,"formattedValue"),ut=({condition:e,onChangeOption:t,controlKey:r,value:n,shouldShowError:o,errorMessage:i})=>{const[s,c]=(0,a.useState)(we(n));(0,a.useEffect)(()=>{c(we(n))},[e]);const l=m=>{(0,te.default)(m,fe,!0).isValid()?(t(m.format(fe)),c(we(m))):t("")};return a.createElement(y.DatePicker,{value:s,sx:{flex:1},id:`select-${r}`,slotProps:{openPickerButton:{size:"small"},textField:{size:"small",color:"secondary",error:o,helperText:i}},onChange:m=>l(m)})};ut.propTypes={condition:u.object.isRequired,controlKey:u.string.isRequired,onChangeOption:u.func.isRequired,value:u.string,errorMessage:u.string.isRequired,shouldShowError:u.bool.isRequired};var ct="HH:mm",dt="MM-DD-YYYY HH:mm",Xr=e=>(0,te.default)(e,ct,!0).isValid()?(0,te.default)(e,ct):null,pt=({condition:e,controlKey:t,onChangeOption:r,value:n,shouldShowError:o,errorMessage:i})=>{const s=(0,a.useRef)(Xr(n)),[c,l]=(0,a.useState)(s.current);(0,a.useEffect)(()=>{l(s.current)},[e]);const m=v=>{r((0,te.default)(v,dt,!0).isValid()?v.format(dt):""),s.current=v,l(v)};return a.createElement(y.TimePicker,{sx:{flex:1},id:`select-${t}`,value:c,slotProps:{textField:{size:"small",error:o,helperText:i}},onChange:v=>m(v)})};pt.propTypes={condition:u.object.isRequired,control:u.object.isRequired,controlKey:u.string.isRequired,onChangeOption:u.func.isRequired,value:u.string,errorMessage:u.string.isRequired,shouldShowError:u.bool.isRequired};var en=Object.defineProperty,ft=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,rn=Object.prototype.propertyIsEnumerable,mt=b((e,t,r)=>t in e?en(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),K=b((e,t)=>{for(var r in t||(t={}))tn.call(t,r)&&mt(e,r,t[r]);if(ft)for(var r of ft(t))rn.call(t,r)&&mt(e,r,t[r]);return e},"__spreadValues"),vt=({controlKey:e,andConditionIndex:t,orConditionIndex:r,controlCount:n})=>{const{conditionsConfig:o,selectedConditions:i,dispatch:s}=ie(),{conditions:c}=o,l=i[r][t],{controls:m={}}=c[l.condition],v={}=m[e],{options:g={}}=v;if(e==="__settings")return null;const P=V=>{const j=S(V),U=R(),C={controlKey:e,control:v,conditionIndex:t,condition:l,conditions:c,options:g,onChangeOption:k,controlCount:n};return lr(e,C.condition.comparator)&&(C.disabled=!0),K(K(K({},j),U),C)},S=V=>{V=Ee(V,xe[v.type]);const j=Ee(v==null?void 0:v.default,Object.keys(g)[0]||V);return{defaultValue:j,value:Ee(l[e],j),placeholder:(v==null?void 0:v.placeholder)||"",isMultiple:(v==null?void 0:v.multiple)||!1}},R=()=>{const V=(l.errors||{})[e]||{},j=V.shouldShow&&V.message||"";return{errorMessage:j,shouldShowError:!!j}},k=V=>{const{type:j,variant:U}=m[e],C=Ce(j,U,V);s({type:Y.CHANGE_CONTROL_VALUE,orConditionIndex:r,andConditionIndex:t,controlKey:e,value:V}),s({type:Y.SET_ERRORS,andConditionIndex:t,orConditionIndex:r,errors:{[e]:C}})},I=V=>{switch(V){case"date":return a.createElement(ut,K({},P()));case"time":return a.createElement(pt,K({},P()))}};switch(v.type){case J.SELECT:return a.createElement(ze,K({},P()));case J.MULTIPLE_SELECT:return a.createElement(et,K({},P()));case J.DATE_TIME:return I(v==null?void 0:v.variant);case J.QUERY:return a.createElement(it,K({},P()))}return a.createElement(lt,K({},P()))};vt.propTypes={controlKey:u.string.isRequired,andConditionIndex:u.number.isRequired,orConditionIndex:u.number.isRequired,controlCount:u.number.isRequired};var nn=Object.defineProperty,ht=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable,yt=b((e,t,r)=>t in e?nn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),sn=b((e,t)=>{for(var r in t||(t={}))on.call(t,r)&&yt(e,r,t[r]);if(ht)for(var r of ht(t))an.call(t,r)&&yt(e,r,t[r]);return e},"__spreadValues"),gt=({orConditionIndex:e,andConditionIndex:t})=>{const{conditionsConfig:r,dispatch:n}=ie(),{conditions:o,conditionsByGroup:i}=r,s=()=>{const l=Ve(i),m=Oe(o,l),v=sn({condition:l},m);n({type:Y.ADD_AND_CONDITION,andCondition:v,andConditionIndex:t,orConditionIndex:e})},c=()=>{n({type:Y.REMOVE_AND_CONDITION,andConditionIndex:t,orConditionIndex:e})};return a.createElement(y.Stack,{direction:"row",alignItems:"center",sx:{left:"100%",gap:.5,ml:-1,mt:"2.5px",position:"absolute"}},a.createElement(y.Button,{color:"secondary",variant:"outlined",sx:{px:1,minWidth:"unset"},className:"add-single-condition-button",onClick:s},(0,N.__)("AND","elementor-pro")),a.createElement(y.IconButton,{color:"secondary","aria-label":(0,N.__)("Delete","elementor-pro"),className:"remove-single-condition-button",onClick:c},a.createElement(he.XIcon,{fontSize:"small"})))};gt.propTypes={andConditionIndex:u.default.number.isRequired,orConditionIndex:u.default.number.isRequired};var ln=Object.defineProperty,_t=Object.getOwnPropertySymbols,un=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable,Ct=b((e,t,r)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),dn=b((e,t)=>{for(var r in t||(t={}))un.call(t,r)&&Ct(e,r,t[r]);if(_t)for(var r of _t(t))cn.call(t,r)&&Ct(e,r,t[r]);return e},"__spreadValues"),Ot=({andConditionIndex:e,orConditionIndex:t})=>{var r;const{selectedConditions:n,conditionsConfig:o,dispatch:i}=ie(),{conditions:s,flattenedConditionOptions:c}=o,l=n[t][e],m=((r=s[l==null?void 0:l.condition])==null?void 0:r.controls)||{},v=Object.keys(m).length,g=P=>{const S=P.target.value,R=dn({condition:S},Oe(s,S));i({type:Y.CHANGE_CONDITION_TYPE,orConditionIndex:t,andConditionIndex:e,conditionToChange:R})};return a.createElement(y.Container,{maxWidth:"md",sx:{display:"flex",gap:.5,mb:1,position:"relative"},className:`and-condition-repeater-row and-condition-${e}`},a.createElement(be,{id:"condition-select",value:l.condition||"",onChange:P=>g(P,e),controlCount:v},c.map(({key:P,label:S,isGroup:R})=>R?a.createElement(y.ListSubheader,{key:P},a.createElement(Q,{variant:"caption",controlCount:v},S)):a.createElement(y.MenuItem,{key:P,value:P},a.createElement(Q,{controlCount:v},S)))),Object.keys(m).map(P=>a.createElement(vt,{key:P,controlKey:P,andConditionIndex:e,orConditionIndex:t,controlCount:v})),a.createElement(gt,{orConditionIndex:t,andConditionIndex:e}))};Ot.propTypes={andConditionIndex:u.number.isRequired,orConditionIndex:u.number.isRequired};var Et=({orConditionIndex:e})=>{const{selectedConditions:t}=ie(),r=t[e];return a.default.createElement(y.Box,{sx:{my:2,gap:1},className:`or-condition-repeater or-condition-${e}`},r.map((n,o)=>a.default.createElement(Ot,{key:"or-condition-row-"+o,andConditionIndex:o,orConditionIndex:e})))};Et.propTypes={orConditionIndex:u.default.number.isRequired};var pn=()=>a.default.createElement(y.Divider,{sx:{px:3}},(0,N.__)("OR","elementor-pro")),fn=Object.defineProperty,bt=Object.getOwnPropertySymbols,mn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,Pt=b((e,t,r)=>t in e?fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),hn=b((e,t)=>{for(var r in t||(t={}))mn.call(t,r)&&Pt(e,r,t[r]);if(bt)for(var r of bt(t))vn.call(t,r)&&Pt(e,r,t[r]);return e},"__spreadValues"),St=({showConditions:e,setShowConditions:t})=>{const{selectedConditions:r,conditionsConfig:n,dispatch:o}=ie(),{conditions:i,conditionsByGroup:s}=n,c=r.length?(0,N.__)("Add condition group","elementor-pro"):(0,N.__)("Add Condition","elementor-pro"),l=()=>{const m=Ve(s),v=Oe(i,m),g=hn({condition:m},v);o({type:Y.ADD_OR_CONDITION,andCondition:g}),t(!0)};return a.default.createElement(y.Box,null,e&&r.map((m,v)=>a.default.createElement(a.Fragment,{key:v},v>0&&a.default.createElement(pn,null),a.default.createElement(Et,{orConditionIndex:v}))),a.default.createElement(y.Button,{variant:"contained",className:"add-or-condition-button",color:"secondary",startIcon:a.default.createElement(he.PlusIcon,null),sx:{mt:1,mb:5},onClick:()=>l()},c))};St.propTypes={showConditions:u.default.bool.isRequired,setShowConditions:u.default.func.isRequired};var yn=Object.defineProperty,$t=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,wt=b((e,t,r)=>t in e?yn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),Cn=b((e,t)=>{for(var r in t||(t={}))gn.call(t,r)&&wt(e,r,t[r]);if($t)for(var r of $t(t))_n.call(t,r)&&wt(e,r,t[r]);return e},"__spreadValues"),On=e=>a.createElement(y.Box,{display:"flex",justifyContent:"center",alignItems:"flex-start",sx:{flex:1,overflow:"auto"}},a.createElement(y.Stack,{maxWidth:"md",width:"100%",justifyContent:"center",textAlign:"center",sx:{pt:5,pb:10,px:6}},a.createElement(Er,{fontSize:"large",sx:{mb:1,mx:"auto"}}),a.createElement(y.Typography,{component:"h6",variant:"h6",color:"text.primary"},(0,N.__)("Set one or more conditions for this element","elementor-pro")),a.createElement(y.Typography,{variant:"body2",color:"text.tertiary",sx:{mb:4}},(0,N.__)("It will only appear on your website when all the conditions are met.","elementor-pro")," ",a.createElement(y.Link,{href:"https://go.elementor.com/app-display-conditions/",target:"_blank",rel:"noreferrer",color:"info.main",underline:"hover",sx:{"&:hover":{color:t=>t.palette.info.main}}},(0,N.__)("Learn more","elementor-pro"))),a.createElement(St,Cn({},e)))),En=b((e,t,r)=>new Promise((n,o)=>{var i=l=>{try{c(r.next(l))}catch(m){o(m)}},s=l=>{try{c(r.throw(l))}catch(m){o(m)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);c((r=r.apply(e,t)).next())}),"__async"),Dt=({setCacheNoticeStatus:e})=>{const[t,r]=(0,a.useState)(!0),n=()=>En(null,null,function*(){(yield e())&&r(!1)});return a.default.createElement(y.Box,null,a.default.createElement(y.Collapse,{in:t,sx:{px:3}},a.default.createElement(y.Alert,{color:"info",severity:"error",variant:"standard",onClose:n,sx:{mt:3}},(0,N.__)("Keep in mind: Certain cache plugins can conflict with your display conditions.","elementor-pro")," ",a.default.createElement(y.Link,{href:"https://go.elementor.com/app-display-conditions-cache-notice/",underline:"hover",color:"info.main",target:"_blank",sx:{"&:hover":{color:o=>o.palette.info.main}}},(0,N.__)("Learn more","elementor-pro")))))};Dt.propTypes={setCacheNoticeStatus:u.default.func.isRequired};var bn=Object.defineProperty,Rt=Object.getOwnPropertySymbols,Pn=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,Tt=b((e,t,r)=>t in e?bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,"__defNormalProp"),xt=b((e,t)=>{for(var r in t||(t={}))Pn.call(t,r)&&Tt(e,r,t[r]);if(Rt)for(var r of Rt(t))Sn.call(t,r)&&Tt(e,r,t[r]);return e},"__spreadValues"),Nt=({getControlValue:e,setControlValue:t,conditionsConfig:r,onClose:n,fetchData:o,setCacheNoticeStatus:i})=>{const s={conditionsConfig:r,selectedConditions:e()||[],fetchData:o},[c,l]=a.default.useState(!0),[m,v]=(0,a.useReducer)(Zt,s),[g,P]=(0,a.useState)(!1),{selectedConditions:S}=m;(0,a.useEffect)(()=>{g||P(!0)},[S]),(0,a.useEffect)(()=>{P(!1)},[]);const R=()=>{let C=!1,D=null,M=null;return S.forEach((G,q)=>{const{hasFoundInvalidConditionInConditionSet:B,invalidAndConditionIndex:T}=k(G,q);B&&!C&&(C=!0,M=T,D=q)}),{hasFoundInvalidCondition:C,invalidOrConditionIndex:D,invalidAndConditionIndex:M}},k=(C,D)=>{let M=!1,G=null;return C.forEach((q,B)=>{const{condition:T}=q,w=j(T);I({requiredKeys:w,andCondition:q,orConditionIndex:D,andConditionIndex:B})&&!M&&(G=B,M=!0)}),{hasFoundInvalidConditionInConditionSet:M,invalidAndConditionIndex:G}},I=({requiredKeys:C,andCondition:D,orConditionIndex:M,andConditionIndex:G})=>{const{condition:q}=D;let B=!1;return C.forEach(T=>{const w=D[T],{type:re,variant:me=null}=r.conditions[q].controls[T];w!=null&&w.length||ur(D.condition,D.comparator)||(B||(B=!0),v({type:Y.SET_ERRORS,andConditionIndex:G,orConditionIndex:M,errors:{[T]:Ce(re,me,w,!0)}}))}),B},V=()=>{const{hasFoundInvalidCondition:C,invalidOrConditionIndex:D,invalidAndConditionIndex:M}=R();if(C){const G=`.or-condition-repeater.or-condition-${D} .and-condition-repeater-row.and-condition-${M}`,q=document.querySelector(G);setTimeout(()=>q==null?void 0:q.scrollIntoView({behavior:"smooth"}),100);return}t([JSON.stringify(U())]),n()},j=C=>{const{controls:D}=r.conditions[C];return Object.keys(D).filter(M=>D[M].required)},U=()=>S.map(C=>C.map(D=>{const M=xt({},D);return delete M.errors,M}));return a.default.createElement(a.default.Fragment,null,a.default.createElement(Ae,{onClose:n}),a.default.createElement(y.Divider,{orientation:"horizontal"}),r.show_cache_notice&&a.default.createElement(Dt,{setCacheNoticeStatus:i}),a.default.createElement(_e.Provider,{value:xt({dispatch:v},m)},a.default.createElement(On,{showConditions:c,setShowConditions:l})),a.default.createElement(y.Divider,{orientation:"horizontal"}),a.default.createElement(qe,{onClickSaveButton:()=>V(),showConditions:c,setShowConditions:l,isButtonDisabled:g}))};Nt.propTypes={getControlValue:u.default.func.isRequired,setControlValue:u.default.func.isRequired,fetchData:u.default.func.isRequired,onClose:u.default.func.isRequired,conditionsConfig:u.default.object.isRequired,setCacheNoticeStatus:u.default.func.isRequired};var It=e=>{const[t,r]=(0,a.useState)(!0),n=500;(0,a.useEffect)(()=>{if(!t){const i=setTimeout(()=>{e.onClose()},n);return()=>clearTimeout(i)}},[t]);const o=()=>{r(!1)};return a.default.createElement(y.DirectionProvider,{rtl:e.isRTL},a.default.createElement(y.LocalizationProvider,null,a.default.createElement(jt.ThemeProvider,{colorScheme:e.colorScheme},a.default.createElement(y.Dialog,{open:t,fullWidth:!0,maxWidth:"lg",TransitionComponent:y.Fade,transitionDuration:{enter:n,exit:n},sx:{"& .MuiDialog-paper":{height:"calc(100vh - 4rem)",maxHeight:775}}},a.default.createElement(Nt,{getControlValue:e.getControlValue,setControlValue:e.setControlValue,fetchData:e.fetchData,onClose:o,conditionsConfig:e.conditionsConfig,setCacheNoticeStatus:e.setCacheNoticeStatus})))))};It.propTypes={colorScheme:u.default.oneOf(["auto","light","dark"]),isRTL:u.default.bool,getControlValue:u.default.func.isRequired,setControlValue:u.default.func.isRequired,fetchData:u.default.func.isRequired,onClose:u.default.func.isRequired,conditionsConfig:u.default.object.isRequired,setCacheNoticeStatus:u.default.func.isRequired};var $n=Object.defineProperty,wn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,Vt=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Tn=Object.prototype.propertyIsEnumerable,Mt=(e,t,r)=>t in e?$n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xn=(e,t)=>{for(var r in t||(t={}))Rn.call(t,r)&&Mt(e,r,t[r]);if(Vt)for(var r of Vt(t))Tn.call(t,r)&&Mt(e,r,t[r]);return e},Nn=(e,t)=>wn(e,Dn(t)),De=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{c(r.next(l))}catch(m){o(m)}},s=l=>{try{c(r.throw(l))}catch(m){o(m)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);c((r=r.apply(e,t)).next())});function In(e){return Object.keys((e==null?void 0:e.groups)||{}).reduce((t,r)=>{const n=Vn(e.conditions,r);return n.length&&(t[r]=n),t},{})}function Vn(e,t){return Object.keys(e).filter(r=>t===e[r].group)}function Mn(e){const{conditions:t={},groups:r={}}=elementor.config.displayConditions||{};return Object.entries(e).reduce((n,[o,i])=>{const s=i.map(c=>({key:c,label:t[c].label,isGroup:!1}));return n.push({key:o,label:r[o].label,isGroup:!0},...s),n},[])}function Re(e,t){try{return new Promise((r,n)=>{elementorCommon.ajax.addRequest(e,{data:t,error:()=>n(),success:o=>{r(o)}})})}catch(r){return!1}}function jn(e,t){return De(this,null,function*(){var r;const n=yield Re("pro_panel_posts_control_filter_autocomplete",{autocomplete:t.autocomplete,q:e});return(r=n==null?void 0:n.results)!=null?r:[]})}function An(){return De(this,null,function*(){const e=yield Re("display_conditions_set_cache_notice_status");return e&&(elementor.config.displayConditions.show_cache_notice=!1),e})}function qn(){let e=null;const t=()=>{let o=window.parent.document.getElementById("elementor-conditions__modal");return o||(o=document.createElement("div"),o.setAttribute("id","elementor-conditions__modal"),o)},r=()=>{const o=In(elementor.config.displayConditions||{}),i=Mn(o);return Nn(xn({},elementor.config.displayConditions),{conditionsByGroup:o,flattenedConditionOptions:i})},n=({colorScheme:o,isRTL:i,getControlValue:s,setControlValue:c,fetchData:l,onClose:m,conditionsConfig:v,setCacheNoticeStatus:g},P)=>{var S;e=ReactDOM.createRoot(P),e.render(a.default.createElement(It,{colorScheme:o!=null?o:((S=elementor==null?void 0:elementor.getPreferences)==null?void 0:S.call(elementor,"ui_theme"))||"auto",isRTL:i!=null?i:elementorCommon.config.isRTL,getControlValue:s,setControlValue:c,fetchData:l!=null?l:jn,onClose:m,conditionsConfig:v!=null?v:r(),setCacheNoticeStatus:g!=null?g:An}))};window.addEventListener("elementor/display-conditions/open",o=>{var i;n(o.detail.props,(i=o.detail.rootElement)!=null?i:t())}),window.addEventListener("elementor/display-conditions/close",o=>{var i,s,c;const{rootElement:l}=(i=o.detail)!=null?i:{};(s=e==null?void 0:e.unmount)==null||s.call(e),(c=l==null?void 0:l.remove)==null||c.call(l)}),window.addEventListener("elementor/display-conditions/set-cache-notice-status",o=>De(null,null,function*(){var i;const{resolve:s,reject:c}=(i=o.detail)!=null?i:{};if(!(!s||!c))try{const l=!!(yield Re("display_conditions_set_cache_notice_status"));l&&(elementor.config.displayConditions.show_cache_notice=!1),s(l)}catch(l){c(l)}}))}new Gt,qn()})(wp.i18n,React,elementorV2.editorUi,elementorV2.ui,elementorV2.icons);
Save File
Cancel