File: /var/www/lcc.kaunokolegija.lt/wp-content/plugins/codepress-admin-columns/assets/js/admin-general.js
/*! For license information please see admin-general.js.LICENSE.txt */
(()=>{var t={44:(t,e,n)=>{var s=n(889),i="undefined"!=typeof window;function o(t){this.hasWindow=t,this.hasIdle=this.hasWindow&&window.requestIdleCallback,this.method=this.hasIdle?window.requestIdleCallback.bind(window):this.setTimeout,this.scheduled=!1,this.queue=[]}o.prototype.push=function(t){s.equal(typeof t,"function","nanoscheduler.push: cb should be type function"),this.queue.push(t),this.schedule()},o.prototype.schedule=function(){if(!this.scheduled){this.scheduled=!0;var t=this;this.method(function(e){for(;t.queue.length&&e.timeRemaining()>0;)t.queue.shift()(e);t.scheduled=!1,t.queue.length&&t.schedule()})}},o.prototype.setTimeout=function(t){setTimeout(t,0,{timeRemaining:function(){return 1}})},t.exports=function(){var t;return i?(window._nanoScheduler||(window._nanoScheduler=new o(!0)),t=window._nanoScheduler):t=new o,t}},124:t=>{"use strict";t.exports=function(t,e,n){var s,i=t.length;if(!(e>=i||0===n)){var o=i-(n=e+n>i?i-e:n);for(s=e;s<o;++s)t[s]=t[s+n];t.length=o}}},209:(t,e,n)=>{var s,i=n(44)(),o=n(889);r.disabled=!0;try{s=window.performance,r.disabled="true"===window.localStorage.DISABLE_NANOTIMING||!s.mark}catch(t){}function r(t){if(o.equal(typeof t,"string","nanotiming: name should be type string"),r.disabled)return l;var e=(1e4*s.now()).toFixed()%Number.MAX_SAFE_INTEGER,n="start-"+e+"-"+t;function a(o){var r="end-"+e+"-"+t;s.mark(r),i.push(function(){var i=null;try{var l=t+" ["+e+"]";s.measure(l,n,r),s.clearMarks(n),s.clearMarks(r)}catch(t){i=t}o&&o(i,t)})}return s.mark(n),a.uuid=e,a}function l(t){t&&i.push(function(){t(new Error("nanotiming: performance API unavailable"))})}t.exports=r},215:(t,e,n)=>{var s,i,o;void 0===(i="function"==typeof(s=o=function(){function t(){for(var t=0,e={};t<arguments.length;t++){var n=arguments[t];for(var s in n)e[s]=n[s]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(s){function i(){}function o(e,n,o){if("undefined"!=typeof document){"number"==typeof(o=t({path:"/"},i.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var r=JSON.stringify(n);/^[\{\[]/.test(r)&&(n=r)}catch(t){}n=s.write?s.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var l="";for(var a in o)o[a]&&(l+="; "+a,!0!==o[a]&&(l+="="+o[a].split(";")[0]));return document.cookie=e+"="+n+l}}function r(t,n){if("undefined"!=typeof document){for(var i={},o=document.cookie?document.cookie.split("; "):[],r=0;r<o.length;r++){var l=o[r].split("="),a=l.slice(1).join("=");n||'"'!==a.charAt(0)||(a=a.slice(1,-1));try{var c=e(l[0]);if(a=(s.read||s)(a,c)||e(a),n)try{a=JSON.parse(a)}catch(t){}if(i[c]=a,t===c)break}catch(t){}}return t?i[t]:i}}return i.set=o,i.get=function(t){return r(t,!1)},i.getJSON=function(t){return r(t,!0)},i.remove=function(e,n){o(e,"",t(n,{expires:-1}))},i.defaults={},i.withConverter=n,i}(function(){})})?s.call(e,n,e,t):s)||(t.exports=i),t.exports=o()},291:(t,e,n)=>{var s=n(124),i=n(209),o=n(889);function r(t){if(!(this instanceof r))return new r(t);this._name=t||"nanobus",this._starListeners=[],this._listeners={}}t.exports=r,r.prototype.emit=function(t){o.ok("string"==typeof t||"symbol"==typeof t,"nanobus.emit: eventName should be type string or symbol");for(var e=[],n=1,s=arguments.length;n<s;n++)e.push(arguments[n]);var r=i(this._name+"('"+t.toString()+"')"),l=this._listeners[t];return l&&l.length>0&&this._emit(this._listeners[t],e),this._starListeners.length>0&&this._emit(this._starListeners,t,e,r.uuid),r(),this},r.prototype.on=r.prototype.addListener=function(t,e){return o.ok("string"==typeof t||"symbol"==typeof t,"nanobus.on: eventName should be type string or symbol"),o.equal(typeof e,"function","nanobus.on: listener should be type function"),"*"===t?this._starListeners.push(e):(this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e)),this},r.prototype.prependListener=function(t,e){return o.ok("string"==typeof t||"symbol"==typeof t,"nanobus.prependListener: eventName should be type string or symbol"),o.equal(typeof e,"function","nanobus.prependListener: listener should be type function"),"*"===t?this._starListeners.unshift(e):(this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].unshift(e)),this},r.prototype.once=function(t,e){o.ok("string"==typeof t||"symbol"==typeof t,"nanobus.once: eventName should be type string or symbol"),o.equal(typeof e,"function","nanobus.once: listener should be type function");var n=this;return this.on(t,function s(){e.apply(n,arguments),n.removeListener(t,s)}),this},r.prototype.prependOnceListener=function(t,e){o.ok("string"==typeof t||"symbol"==typeof t,"nanobus.prependOnceListener: eventName should be type string or symbol"),o.equal(typeof e,"function","nanobus.prependOnceListener: listener should be type function");var n=this;return this.prependListener(t,function s(){e.apply(n,arguments),n.removeListener(t,s)}),this},r.prototype.removeListener=function(t,e){return o.ok("string"==typeof t||"symbol"==typeof t,"nanobus.removeListener: eventName should be type string or symbol"),o.equal(typeof e,"function","nanobus.removeListener: listener should be type function"),"*"===t?(this._starListeners=this._starListeners.slice(),n(this._starListeners,e)):(void 0!==this._listeners[t]&&(this._listeners[t]=this._listeners[t].slice()),n(this._listeners[t],e));function n(t,e){if(t){var n=t.indexOf(e);return-1!==n?(s(t,n,1),!0):void 0}}},r.prototype.removeAllListeners=function(t){return t?"*"===t?this._starListeners=[]:this._listeners[t]=[]:(this._starListeners=[],this._listeners={}),this},r.prototype.listeners=function(t){var e="*"!==t?this._listeners[t]:this._starListeners,n=[];if(e)for(var s=e.length,i=0;i<s;i++)n.push(e[i]);return n},r.prototype._emit=function(t,e,n,s){if(void 0!==t&&0!==t.length){void 0===n&&(n=e,e=null),e&&(n=void 0!==s?[e].concat(n,s):[e].concat(n));for(var i=t.length,o=0;o<i;o++){var r=t[o];r.apply(r,n)}}}},889:t=>{function e(t,e){if(!t)throw new Error(e||"AssertionError")}e.notEqual=function(t,n,s){e(t!=n,s)},e.notOk=function(t,n){e(!t,n)},e.equal=function(t,n,s){e(t==n,s)},e.ok=e,t.exports=e}},e={};function n(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";let t=n(215);class e{constructor(t){this.element=t,this.init()}init(){if(this.element.classList.contains("-closable")){const e=this.element.querySelector(".ac-section__header");if(e&&e.addEventListener("click",()=>{this.toggle()}),this.isStorable()){let e=t.get(this.getCookieKey());void 0!==e&&(1===parseInt(e)?this.open:this.close())}}}getCookieKey(){return`ac-section_${this.getSectionId()}`}getSectionId(){return this.element.dataset.section}isStorable(){return void 0!==this.element.dataset.section}toggle(){this.isOpen()?this.close():this.open()}isOpen(){return!this.element.classList.contains("-closed")}open(){this.element.classList.remove("-closed"),this.isStorable()&&t.set(this.getCookieKey(),1)}close(){this.element.classList.add("-closed"),this.isStorable()&&t.set(this.getCookieKey(),0)}}class s{constructor(t,e=""){this.element=t,this.content=e||t.dataset.acTip,this.tip=i(this.content),this.initEvents()}initEvents(){"1"!==this.element.dataset.acTooltipInit&&(this.element.dataset.acTooltipInit="1",this.element.addEventListener("mouseenter",()=>{const t=document.body.getBoundingClientRect(),e=this.element.getBoundingClientRect();document.body.appendChild(this.tip),this.tip.style.left=e.left-t.left+this.element.offsetWidth/2+"px",this.tip.style.top=e.top-t.top+this.element.offsetHeight+"px",this.tip.classList.add("hover")}),this.element.addEventListener("mouseleave",()=>{this.tip.classList.remove("hover"),document.body.contains(this.tip)&&document.body.removeChild(this.tip)}),this.element.removeAttribute("title"))}}const i=t=>{let e=document.createElement("div");return e.classList.add("ac-tooltip"),e.innerHTML=t,e},o=class{constructor(){this.init()}init(){document.querySelectorAll(".ac-tooltip").forEach(t=>t.remove()),document.querySelectorAll("[data-ac-tip]").forEach(t=>{new s(t)})}};new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;class l{_listeners="WeakMap"in r?new WeakMap:void 0;_observer=void 0;options;constructor(t){this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver(t=>{for(const e of t)l.entries.set(e.target,e),this._listeners.get(e.target)?.(e)}))}}l.entries="WeakMap"in r?new WeakMap:void 0;let a,c=!1;function u(t,e){t.appendChild(e)}function h(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode&&t.parentNode.removeChild(t)}function p(t){return document.createElement(t)}function f(t){return document.createTextNode(t)}function m(){return f(" ")}function $(t,e,n,s){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n,s)}function v(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function y(t,e,n){t.classList.toggle(e,!!n)}function g(){}function b(t){return t()}function _(){return Object.create(null)}function w(t){t.forEach(b)}function E(t){return"function"==typeof t}function C(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function L(t){a=t}new Map;const S=[],k=[];let x=[];const O=[],A=Promise.resolve();let q=!1;function N(t){x.push(t)}const I=new Set;let T=0;function M(){if(0!==T)return;const t=a;do{try{for(;T<S.length;){const t=S[T];T++,L(t),H(t.$$)}}catch(t){throw S.length=0,T=0,t}for(L(null),S.length=0,T=0;k.length;)k.pop()();for(let t=0;t<x.length;t+=1){const e=x[t];I.has(e)||(I.add(e),e())}x.length=0}while(S.length);for(;O.length;)O.pop()();q=!1,I.clear(),L(t)}function H(t){if(null!==t.fragment){t.update(),w(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(N)}}const B=new Set;function R(t){return void 0!==t?.length?t:Array.from(t)}let P;function j(t,e,n,s,i,o,r,l=[-1]){const u=a;L(t);const h=t.$$={fragment:null,ctx:[],props:o,update:g,not_equal:i,bound:_(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:_(),dirty:l,skip_bound:!1,root:e.target||u.$$.root};r&&r(h.root);let p=!1;if(h.ctx=n?n(t,e.props||{},(e,n,...s)=>{const o=s.length?s[0]:n;return h.ctx&&i(h.ctx[e],h.ctx[e]=o)&&(!h.skip_bound&&h.bound[e]&&h.bound[e](o),p&&function(t,e){-1===t.$$.dirty[0]&&(S.push(t),q||(q=!0,A.then(M)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(t,e)),n}):[],h.update(),p=!0,w(h.before_update),h.fragment=!!s&&s(h.ctx),e.target){if(e.hydrate){c=!0;const t=(m=e.target,Array.from(m.childNodes));h.fragment&&h.fragment.l(t),t.forEach(d)}else h.fragment&&h.fragment.c();e.intro&&(f=t.$$.fragment)&&f.i&&(B.delete(f),f.i(undefined)),function(t,e,n){const{fragment:s,after_update:i}=t.$$;s&&s.m(e,n),N(()=>{const e=t.$$.on_mount.map(b).filter(E);t.$$.on_destroy?t.$$.on_destroy.push(...e):w(e),t.$$.on_mount=[]}),i.forEach(N)}(t,e.target,e.anchor),c=!1,M()}var f,m;L(u)}function F(t,e,n,s){const i=n[t]?.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!s||!n[t])return e;if("toAttribute"===s)switch(i){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),"function"==typeof HTMLElement&&(P=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(t,e,n){super(),this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=p("slot"),"default"!==t&&v(e,"name",t)},m:function(t,n){h(t,e,n)},d:function(t){t&&d(e)}}}}const e={},n=function(t){const e={};return t.childNodes.forEach(t=>{e[t.slot||"default"]=!0}),e}(this);for(const i of this.$$s)i in n&&(e[i]=[t(i)]);for(const o of this.attributes){const r=this.$$g_p(o.name);r in this.$$d||(this.$$d[r]=F(r,o.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});const s=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=F(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(s),s();for(const l in this.$$l)for(const a of this.$$l[l]){const c=this.$$c.$on(l,a);this.$$l_u.set(a,c)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=F(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(t){return Object.keys(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});class W{$$=void 0;$$set=void 0;$destroy(){(function(t,e){const n=t.$$;null!==n.fragment&&(function(t){const e=[],n=[];x.forEach(s=>-1===t.indexOf(s)?e.push(s):n.push(s)),n.forEach(t=>t()),x=e}(n.after_update),w(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])})(this,1),this.$destroy=g}$on(t,e){if(!E(e))return g;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function D(t){let e,n,s,i,o,r,l;return{c(){e=p("div"),n=p("div"),s=m(),i=p("div"),v(n,"class","ac-pointer-modal__arrow"),v(n,"data-pos",t[1]),v(i,"class","ac-pointer-modal__content"),v(e,"class",o="ac-pointer-modal -"+t[1]),v(e,"role","none")},m(o,a){h(o,e,a),u(e,n),u(e,s),u(e,i),i.innerHTML=t[0],r||(l=[$(e,"mouseenter",t[6]),$(e,"mouseleave",t[7])],r=!0)},p(t,[s]){2&s&&v(n,"data-pos",t[1]),1&s&&(i.innerHTML=t[0]),2&s&&o!==(o="ac-pointer-modal -"+t[1])&&v(e,"class",o)},i:g,o:g,d(t){t&&d(e),r=!1,w(l)}}}function J(t,e,n){let{content:s=""}=e,{position:i=""}=e,o=!1,{closeHandler:r}=e;const l=()=>{n(2,o=!1),r()};return t.$$set=t=>{"content"in t&&n(0,s=t.content),"position"in t&&n(1,i=t.position),"closeHandler"in t&&n(4,r=t.closeHandler)},[s,i,o,l,r,()=>o,()=>n(2,o=!0),()=>l()]}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");const U=class extends W{constructor(t){super(),j(this,t,J,D,C,{content:0,position:1,closeHandler:4,isOnElement:5})}get isOnElement(){return this.$$.ctx[5]}};class K{constructor(t,e){var n,s;this.element=t,this.target=e,this.width=null!==(n=t.dataset.width)&&void 0!==n?n:null,this.position=null!==(s=t.dataset.pos)&&void 0!==s?s:"right",this.noClick=void 0!==t.dataset.noclick,this.waitingForClose=!1,this.initEvents()}initEvents(){"1"!==this.element.dataset.acTooltipInit&&(this.container=V(),this.width&&(this.container.style.width=`${this.width}px`),this.attachModel(),this.element.dataset.acTooltipInit="1",this.element.addEventListener("mouseenter",()=>{this.onScreen||(this.onScreen=!0,document.body.appendChild(this.container),this.container.style.width=`${this.width}px`,this.setPosition(),setTimeout(()=>{this.setPosition()},100))}),this.element.addEventListener("mouseleave",()=>{this.checkClose()}),this.element.addEventListener("click",()=>{this.noClick||(this.waitingForClose=!0)}))}setPosition(){const t=document.body.getBoundingClientRect(),e=this.element.getBoundingClientRect();switch(this.container.style.top=e.top-t.top+this.element.offsetHeight-this.container.offsetHeight/2+20+"px",this.position){case"right_bottom":this.container.style.top=e.top-t.top-this.container.offsetHeight+100+"px",this.container.style.left=e.left-t.left+this.element.offsetWidth+14+"px";break;case"left":this.container.style.left=e.left-t.left-this.container.offsetWidth-12+"px";break;default:this.container.style.left=e.left-t.left+this.element.offsetWidth+10+"px"}}checkClose(){setTimeout(()=>{this.waitingForClose||this.closeHandler()},50)}closeHandler(){this.onScreen&&(document.body.removeChild(this.container),this.onScreen=!1,this.waitingForClose=!1)}destroyComponent(){null!==this.component&&this.component.$destroy()}attachModel(){this.component=new U({target:this.container,props:{content:this.target.innerHTML,position:this.position,closeHandler:()=>this.closeHandler(),destroyHandler:()=>this.destroyComponent()}})}}const V=()=>{const t=document.createElement("div");return t.classList.add("ac-pointer-modal-container"),t.style.position="absolute",t};var G=n(291),z=n.n(G);class Q{constructor(t){this.element=t}static find(t){let e=document.querySelector(t);return null===e?null:new Q(e)}static create(t){return new Q(document.createElement(t))}getElement(){return this.element}addId(t){return this.element.id=t,this}toggleClass(t,e=null){return null===e?this.element.classList.contains(t)?this.removeClass(t):this.addClass(t):e?this.addClass(t):this.removeClasses(t)}addClass(t){return this.element.classList.add(t),this}addClasses(...t){return t.forEach(t=>this.addClass(t)),this}removeClasses(...t){return t.forEach(t=>this.removeClass(t)),this}removeClass(t){return this.element.classList.remove(t),this}setAttribute(t,e){return this.element.setAttribute(t,e),this}setAttributes(t){return Object.keys(t).forEach(e=>this.setAttribute(e,t[e])),this}addHtml(t){return this.element.innerHTML=t,this}append(t){return this.element.appendChild(t),this}appendFound(t){return document.querySelectorAll(t).forEach(t=>this.append(t)),this}appendSelfTo(t){return t.append(this.element),this}prepend(t){return this.element.prepend(t),this}prependSelfTo(t){return t.prepend(this.element),this}css(t,e){return this.element.style[t]=e,this}insertAfter(t){var e;try{null===(e=this.element.parentElement)||void 0===e||e.insertBefore(t,this.element.nextElementSibling)}catch(t){console.error("Not able to insert element after current node",this.element)}}insertSelfBefore(t){var e;try{null===(e=t.parentElement)||void 0===e||e.insertBefore(this.element,t)}catch(t){console.error("Not able to insert element before current node",this.element)}return this}insertBefore(t){var e;try{null===(e=this.element.parentElement)||void 0===e||e.insertBefore(t,this.element)}catch(t){console.error("Not able to insert element before current node",this.element)}return this}addEventListener(t,e){return this.element.addEventListener(t,e),this}addEventListeners(t,e){return t.forEach(t=>this.addEventListener(t,e)),this}$(){return this.getElement()}}class X{constructor(){this.filters={}}addFilter(t,e,n=10){this.filters.hasOwnProperty(t)||(this.filters[t]={}),this.filters[t].hasOwnProperty(n)||(this.filters[t][n]=[]),this.filters[t][n].push(e)}applyFilters(t,e,n={}){return this.filters.hasOwnProperty(t)?(Object.keys(this.filters[t]).forEach(s=>{this.filters[t][parseInt(s)].forEach(t=>{e=t(e,n)})}),e):e}}function Z(t,e,n){const s=t.slice();return s[5]=e[n],s}function Y(t){let e;return{c(){e=p("span"),v(e,"class","dashicons dashicons-yes")},m(t,n){h(t,e,n)},d(t){t&&d(e)}}}function tt(t){let e,n,s,i,o,r,l,a=t[5].label+"",c=t[0]===t[5].value&&Y();function g(){return t[4](t[5])}return{c(){e=p("button"),c&&c.c(),n=m(),s=f(a),i=m(),v(e,"class","button"),e.value=o=t[5].value,y(e,"button-primary",t[0]===t[5].value)},m(t,o){var a;h(t,e,o),c&&c.m(e,null),u(e,n),u(e,s),u(e,i),r||(l=$(e,"click",(a=g,function(t){return t.preventDefault(),a.call(this,t)})),r=!0)},p(i,r){var l,u;(t=i)[0]===t[5].value?c||(c=Y(),c.c(),c.m(e,n)):c&&(c.d(1),c=null),2&r&&a!==(a=t[5].label+"")&&(u=""+(u=a),(l=s).data!==u&&(l.data=u)),2&r&&o!==(o=t[5].value)&&(e.value=o),3&r&&y(e,"button-primary",t[0]===t[5].value)},d(t){t&&d(e),c&&c.d(),r=!1,l()}}}function et(t){let e,n=R(t[1]),s=[];for(let e=0;e<n.length;e+=1)s[e]=tt(Z(t,n,e));return{c(){e=p("div");for(let t=0;t<s.length;t+=1)s[t].c();v(e,"class","acui-toggle-buttons")},m(t,n){h(t,e,n);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(e,null)},p(t,[i]){if(7&i){let o;for(n=R(t[1]),o=0;o<n.length;o+=1){const r=Z(t,n,o);s[o]?s[o].p(r,i):(s[o]=tt(r),s[o].c(),s[o].m(e,null))}for(;o<s.length;o+=1)s[o].d(1);s.length=n.length}},i:g,o:g,d(t){t&&d(e),function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(s,t)}}}function nt(t,e,n){let{value:s}=e,{options:i}=e,{onChange:o}=e;const r=t=>{n(0,s=t),o(t)};return t.$$set=t=>{"value"in t&&n(0,s=t.value),"options"in t&&n(1,i=t.options),"onChange"in t&&n(3,o=t.onChange)},[s,i,r,o,t=>r(t.value)]}const st=class extends W{constructor(t){super(),j(this,t,nt,et,C,{value:0,options:1,onChange:3})}};class it{constructor(t){this.input=t,this.parseOptions(),this.wrap()}parseOptions(){const t=this.input.dataset.options?JSON.parse(this.input.dataset.options):{};let e=[];Object.keys(JSON.parse(this.input.dataset.options)).forEach(n=>{e.push({value:n,label:t[n]})}),this.options=e}wrap(){const t=Q.create("div").addClass("acui-plugin-toggle-buttons"),e=Q.create("div");this.input.readOnly=!0,this.input.type="hidden",this.input.parentElement.insertBefore(t.getElement(),this.input),t.append(this.input).append(e.getElement()),new st({target:e.getElement(),props:{onChange:t=>{this.input.value=t,this.input.dispatchEvent(new Event("change")),this.input.dispatchEvent(new Event("input"))},value:this.input.value,options:this.options}})}}window.AC_SERVICES||(window.AC_SERVICES=new class{constructor(){this.services={},this.events=new(z()),this.filters=new X,this.$=Q}registerService(t,e){return this.services[t]=e,this.events.emit(`Service.Registered.${t}`,e),this}getService(t){return this.hasService(t)?this.services[t]:null}hasService(t){return this.services.hasOwnProperty(t)}addListener(t,e){this.events.addListener(t,e)}emitEvent(t,e){this.events.emit(t,e)}}),window.AC_SERVICES,document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".ac-section").forEach(t=>{new e(t)}),jQuery(document).on("select2:open",()=>{var t;null===(t=document.querySelector(".select2-container--open .select2-search__field"))||void 0===t||t.focus()}),((t=null)=>{t||(t=document.querySelectorAll(".ac-pointer")),t.forEach(t=>{let e=t.getAttribute("rel");null===e&&(e="n");let n=document.querySelector(`#${e}`);n&&new K(t,n)}),new o})(),document.querySelectorAll('input[data-component="acui-toggle-buttons"]').forEach(t=>{new it(t)})})})()})();