rndefine("#RNMainCore",["lit","#RNMainLit/Lit"],(function(e,t){"use strict";class r{constructor(){this.Subscribers=[]}Subscribe(e,t,r=10){Array.isArray(e)||(e=[e]),this.GetSubscriberByRef(e)||this.Subscribers.push({reference:e,callback:t,priority:r})}Unsubscribe(e){let t=this.GetSubscriberByRef(e);null!=t&&this.Subscribers.splice(this.Subscribers.indexOf(t),1)}GetSubscriberByRef(e){return Array.isArray(e)||(e=[e]),this.Subscribers.find((t=>t.reference.length==e.length&&t.reference.filter((t=>e.some((e=>e==t)))).length==t.reference.length))}Publish(e){let t=null;for(let r of this.Subscribers){let n=r.callback(e);void 0!==n&&(t=n)}return t}}class n{static SanitizeStringArray(e,t=!0){return null==e?[]:Array.isArray(e)?e.map((e=>n.SanitizeString(e))):t?[]:[n.SanitizeString(e)]}static SanitizeString(e,t=""){return null==e||Array.isArray(e)||null==e.toString||"object"==typeof e?t:e.toString()}static GetValueFromPath(e,t,r=""){if("string"==typeof t&&(t=t.split(".")),null==e)return r;let n="";for(;null!=(n=t.shift());){if(null==e[n])return r;e=e[n]}return e}static GetStringValueFromPath(e,t,r=""){let i=n.GetValueFromPath(e,t,null);return null==i?r:n.SanitizeString(i)}static SanitizeNumber(e,t=0){return null==e||Array.isArray(e)||""===e?t:(e=Number(e),isNaN(e)?t:e)}static SanitizeBoolean(e,t=!1){return null===e?t:"boolean"==typeof e?e:isNaN(Number(e))?t:0!=e}}class i{constructor(){this.IsDirty=!1,this.ValueChanged=new r,this._defaultValuesLoaded=!1}Subscribe(e,t){this.ValueChanged.Subscribe(e,t)}Unsubscribe(e){this.ValueChanged.Unsubscribe(e)}GetValue(e){return this[e]}SetValue(e,t){this.ParseAndSetValue(e,t),this.ValueChanged.Publish(e)}Merge(e=null){if(this._defaultValuesLoaded||(this.LoadDefaultValues(),this._defaultValuesLoaded=!0),null==e)return this.SetAutoIncrementIds(),this;for(let t in e)if(this.hasOwnProperty(t)){let r=e[t];this.ParseAndSetValue(t,r)}return this.SetAutoIncrementIds(),this}SetAutoIncrementIds(){if(null==this.StoreAutoIncrementDictionary)return;let e=this.StoreAutoIncrementDictionary;for(let t in this){if(!this.hasOwnProperty(t))continue;if(null==e[t])continue;let r=n.SanitizeNumber(this[t]);if(0==r||null==r){let r=e[t];++r,this[t]=r}e[t]=Math.max(this[t],e[t])}}ParseAndSetValue(e,t){let r=this[e],n=this.GetValueFromLoader(e,t);if(null!=n)return void(this[e]=n);if(["_fields","ValueChanged","IsDirty","_fields","_defaultValuesLoaded"].indexOf(e)>=0)return;if(null!=r&&r instanceof i)return void(null!=t&&t instanceof i?this[e]=t:this[e].Merge(t));if("number"==typeof r)return void(this[e]=parseFloat(null==t?0:t.toString()));if("boolean"==typeof r)return void(isNaN(t)?this[e]="true"==t:this[e]=!0===t||1==parseFloat(t));if("string"==typeof r)return void(this[e]=t);let s=this.MaybeGetType(this.constructor,e);if(null==r||r.constructor!=Array){if(null==r&&null!=s){if(null==t)return;let r=s;if(r.prototype instanceof i)return void(this[e]=(new r).Merge(t))}if(s!=Object)throw"Could not process type "+typeof r+" of "+e;this[e]=t}else{if(null==s)throw"Property "+e+" of class "+this.constructor.name+" is an array but does not have the OptionType decorator implemented";if(this[e]=[],s==String||s===Object)return void(this[e]=t);if(s==Number)return void(this[e]=t);for(let r of t)null!=r&&r.hasOwnProperty("_fields")&&r.hasOwnProperty("_defaultValuesLoaded")?this[e].push(r):this[e].push((new s).Merge(r))}}GetValueFromLoader(e,t){return null}ToObject(){return JSON.parse(JSON.stringify(this,((e,t)=>{if(!(["_fields","_defaultValuesLoaded","IsDirty","ValueChanged"].indexOf(e)>=0||"function"==typeof t))return t})))}SerializeObject(e){let t=["_fields","_defaultValuesLoaded","IsDirty"];for(let r in e){let n=e[r];t.indexOf(r)>=0||"function"==typeof n?delete e[r]:(Array.isArray(n)&&this.SerializeArray(n),"object"==typeof n&&(n=this.SerializeObject(n)))}return e}SerializeArray(e){for(let t=0;t<e.length;t++){let r=e[t];Array.isArray(r)&&this.SerializeArray(r),"object"==typeof r&&(e[t]=this.SerializeObject(r))}}MaybeGetType(e,t){let r=i.TypeDictionary.get(e);return null!=r&&r.has(t)?r.get(t):Object.getPrototypeOf(e)!=Object.prototype?this.MaybeGetType(Object.getPrototypeOf(e),t):null}}i.TypeDictionary=new Map;class s{static GetInstance(){return null==window.RNLocalEvent&&(window.RNLocalEvent=new l),window.RNLocalEvent}static Publish(e,t=null,r=null){return s.GetInstance().Publish(e,t,r)}static Subscribe(e,t,r=null,n=0){s.GetInstance().Subscribe(e,t,r,n)}static SubscriptionCount(e){let t=s.GetInstance().Events[e];return null==t?0:t.length}static UnsubscribeEvent(e,t){s.GetInstance().UnsubscribeEvent(e,t)}}s.LocalEvent=null;class l{constructor(){this.Events={}}Publish(e,t,r=null){if(null==this.Events[e])return r;let n=this.Events[e],i=null;for(let e of n){let r;r=e.CallBack(t),null!=r&&(i=r)}return null==i?r:i}Subscribe(e,t,r,n=0){null==this.Events[e]&&(this.Events[e]=[]);let i=this.Events[e],s=new a(e,t,n,r);for(let e=0;e<i.length;e++)if(i[e].Priority>s.Priority){i.splice(e,0,s),s=null;break}null!=s&&i.push(s)}UnsubscribeEvent(e,t){let r=this.Events[e];if(null==r)return;let n=r.find((e=>e.Reference==t));null!=n&&r.splice(r.indexOf(n),1),0==r.length&&delete this.Events[e]}}class a{constructor(e,t,r=0,n=null){this.Event=e,this.CallBack=t,this.Priority=r,this.Reference=n}}class o{static Sanitize(e,t){return(new o).SanitizeProperty(e,t)}SanitizeProperty(e,t){if(Array.isArray(t))return this.SanitizeArray(e,t);switch(typeof t){case"object":return this.SanitizeObject(e,t);case"string":return n.SanitizeString(e,t);case"boolean":return n.SanitizeBoolean(e,t);case"number":case"bigint":return n.SanitizeNumber(e,t)}return e}SanitizeArray(e,t){if(0==t.length)return[];let r=t[0];Array.isArray(e)||(e=[]);let n=[];for(let t of e)n.push(this.SanitizeProperty(t,r));return n}SanitizeObject(e,t){null!=e&&"object"==typeof e||(e={});for(let r in t){let n=t[r],i=e[r];e[r]=this.SanitizeProperty(i,n)}return e}}class u{static async Post(e,t=null,r="",n=null,i={}){""==r&&(r=u.DefaultURL);let s=null!=(null==i?void 0:i.Prefix)?i.Prefix:u.DefaultPrefix;var l=new FormData;if(l.append("action",(""!=s?s+"_":"")+e),l.append("_nonce",null!=(null==i?void 0:i.Nonce)?i.Nonce:u.DefaultNonce),null!=n)for(let e in n)l.append(e,n[e],n[e].name);null!=t&&l.append("data",JSON.stringify(t));try{var a;let e=await fetch(r,{method:"POST",body:l}).then((async e=>{if(500==e.status){var t;let r=null;try{r=await e.json()}catch(e){}if(null!=(null===(t=r)||void 0===t?void 0:t.errorMessage))return r}if(e.status>=400&&e.status<600)throw new Error("Bad response from server");return e})),t=e;return null!=e.json&&(t=await e.json()),0==t.success&&(i.OnError||u.DefaultHandleError)(null!==(a=t.errorMessage)&&void 0!==a?a:"",t.detail,t),t.result}catch(e){return(i.OnError||u.DefaultHandleError)(e)}}static SetGlobalVar(e){var t,r;u.DefaultURL=e.ajaxurl,u.DefaultNonce=null!==(t=null==e?void 0:e._nonce)&&void 0!==t?t:"",u.DefaultPrefix=null!==(r=null==e?void 0:e._prefix)&&void 0!==r?r:""}}u.DefaultURL="",u.DefaultPrefix="",u.DefaultNonce="",u.DefaultHandleError=null;class c extends e.LitElement{constructor(){super(),this.Display="block",this.UpdateOrDisconnectedPromise=null,this.UpdateRequested=new r}createRenderRoot(){return this}GetParentClasses(){return""}GetParentStyles(){return{display:""==this.style.display?this.GetDisplay():this.style.display}}GetDisplay(){return"block"}GetAllLitElements(e=[],t=this){return t instanceof c&&e.push(t),t.childNodes.forEach((t=>this.GetAllLitElements(e,t))),e}get AllUpdateComplete(){return new Promise((async e=>{let t=[];for(;(t=this.GetAllLitElements().filter((e=>e.isUpdatePending&&e.isConnected))).length>0;)await Promise.all(t.map((e=>e.UpdatedOrDisconnected)));e(!0)}))}get UpdatedOrDisconnected(){return null==this.UpdateOrDisconnectedPromise&&(this.UpdateOrDisconnectedPromise=new Promise((e=>{this.UpdateOrDisconnectedResolver=e,this.updateComplete.then((e=>{this.MaybeFireUpdateOrDisconnected()}))}))),this.UpdateOrDisconnectedPromise}connectedCallback(){super.connectedCallback();let t=this.parentNode;for(this.ParentElement=null;null!=t;){if(t instanceof e.LitElement){this.ParentElement=t,this.ParentElement.UpdateRequested.Subscribe(this,(()=>this.forceUpdate()));break}t=t.parentNode}}disconnectedCallback(){super.disconnectedCallback(),this.MaybeFireUpdateOrDisconnected(),null!=this.ParentElement&&this.ParentElement.UpdateRequested.Unsubscribe(this)}RenderParentStyles(){let e=this.GetParentStyles();if(null!=e)for(let t in e)null!=e[t]&&(this.renderRoot.style[t]=e[t]);let t=this.GetParentClasses();if(null!=t&&""!=t)for(let e of t.trim().split(" "))this.renderRoot.classList.add(e)}removeController(e){super.removeController(e)}async forceUpdate(e){this.requestUpdate(),this.RenderParentStyles(),this.UpdateRequested.Publish(),null!=e&&(await this.AllUpdateComplete,e())}firstUpdated(e){super.firstUpdated(e),this.RenderParentStyles()}FireEvent(e,r=null,n=!1){return t.rnDispatchEvent(this,e,r,n)}MaybeFireUpdateOrDisconnected(){null!=this.UpdateOrDisconnectedResolver&&(this.UpdateOrDisconnectedResolver(null),this.UpdateOrDisconnectedPromise=null,this.UpdateOrDisconnectedResolver=null)}}exports.StoreBase=i,exports.StoreAutoIncrement=function(e){return function(e,t,r){null==e.StoreAutoIncrementDictionary&&(e.StoreAutoIncrementDictionary=[]),e.StoreAutoIncrementDictionary[t]=0}},exports.StoreDataType=function(e){return function(t,r,n){i.TypeDictionary.has(t.constructor)||i.TypeDictionary.set(t.constructor,new Map),i.TypeDictionary.get(t.constructor).set(r,e)}},exports.EventManager=s,exports.WpAjaxPost=u,exports.SingleEvent=r,exports.Sanitizer=n,exports.ObjectSanitizer=o,exports.LitElementBase=c}));