admins-components 5.0.7 → 5.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
9
9
  For more information see: https://www.keycloak.org/securing-apps/javascript-adapter#_modern_browsers`),D.enable=!1,u.silentCheckSsoFallback&&(u.silentCheckSsoRedirectUri=!1)),document.body.removeChild(Sr),window.removeEventListener("message",yn),Ft.setSuccess()))};window.addEventListener("message",yn,!1)}else Ft.setSuccess();return Vt(Ft.promise,u.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function ci(Ft){if(!Ft||Ft=="default")return{login:async function(Ar){return window.location.assign(await u.createLoginUrl(Ar)),or().promise},logout:async function(Ar){if(((Ar==null?void 0:Ar.logoutMethod)??u.logoutMethod)==="GET"){window.location.replace(u.createLogoutUrl(Ar));return}const ri=document.createElement("form");ri.setAttribute("method","POST"),ri.setAttribute("action",u.createLogoutUrl(Ar)),ri.style.display="none";const Za={id_token_hint:u.idToken,client_id:u.clientId,post_logout_redirect_uri:_.redirectUri(Ar,!1)};for(const[Zi,ft]of Object.entries(Za)){const vo=document.createElement("input");vo.setAttribute("type","hidden"),vo.setAttribute("name",Zi),vo.setAttribute("value",ft),ri.appendChild(vo)}document.body.appendChild(ri),ri.submit()},register:async function(Ar){return window.location.assign(await u.createRegisterUrl(Ar)),or().promise},accountManagement:function(){var Ar=u.createAccountUrl();if(typeof Ar<"u")window.location.href=Ar;else throw"Not supported by the OIDC server";return or().promise},redirectUri:function(Ar,$r){return Ar&&Ar.redirectUri?Ar.redirectUri:u.redirectUri?u.redirectUri:location.href}};if(Ft=="cordova"){D.enable=!1;var Sr=function(Ar,$r,ri){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(Ar,$r,ri):window.open(Ar,$r,ri)},yn=function(Ar){return Ar&&Ar.cordovaOptions?Object.keys(Ar.cordovaOptions).reduce(function($r,ri){return $r[ri]=Ar.cordovaOptions[ri],$r},{}):{}},Bn=function(Ar){return Object.keys(Ar).reduce(function($r,ri){return $r.push(ri+"="+Ar[ri]),$r},[]).join(",")},Or=function(Ar){var $r=yn(Ar);return $r.location="no",Ar&&Ar.prompt=="none"&&($r.hidden="yes"),Bn($r)},Yr=function(){return u.redirectUri||"http://localhost"};return{login:async function(Ar){var $r=or(),ri=Or(Ar),Za=await u.createLoginUrl(Ar),Zi=Sr(Za,"_blank",ri),ft=!1,vo=!1,bn=function(){vo=!0,Zi.close()};return Zi.addEventListener("loadstart",function(_s){if(_s.url.indexOf(Yr())==0){var xc=St(_s.url);et(xc,$r),bn(),ft=!0}}),Zi.addEventListener("loaderror",function(_s){if(!ft)if(_s.url.indexOf(Yr())==0){var xc=St(_s.url);et(xc,$r),bn(),ft=!0}else $r.setError(),bn()}),Zi.addEventListener("exit",function(_s){vo||$r.setError({reason:"closed_by_user"})}),$r.promise},logout:function(Ar){var $r=or(),ri=u.createLogoutUrl(Ar),Za=Sr(ri,"_blank","location=no,hidden=yes,clearcache=yes"),Zi;return Za.addEventListener("loadstart",function(ft){ft.url.indexOf(Yr())==0&&Za.close()}),Za.addEventListener("loaderror",function(ft){ft.url.indexOf(Yr())==0||(Zi=!0),Za.close()}),Za.addEventListener("exit",function(ft){Zi?$r.setError():(u.clearToken(),$r.setSuccess())}),$r.promise},register:async function(Ar){var $r=or(),ri=await u.createRegisterUrl(),Za=Or(Ar),Zi=Sr(ri,"_blank",Za);return Zi.addEventListener("loadstart",function(ft){if(ft.url.indexOf(Yr())==0){Zi.close();var vo=St(ft.url);et(vo,$r)}}),$r.promise},accountManagement:function(){var Ar=u.createAccountUrl();if(typeof Ar<"u"){var $r=Sr(Ar,"_blank","location=no");$r.addEventListener("loadstart",function(ri){ri.url.indexOf(Yr())==0&&$r.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(Ar){return Yr()}}}if(Ft=="cordova-native")return D.enable=!1,{login:async function(Ar){var $r=or(),ri=await u.createLoginUrl(Ar);return universalLinks.subscribe("keycloak",function(Za){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var Zi=St(Za.url);et(Zi,$r)}),window.cordova.plugins.browsertab.openUrl(ri),$r.promise},logout:function(Ar){var $r=or(),ri=u.createLogoutUrl(Ar);return universalLinks.subscribe("keycloak",function(Za){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),u.clearToken(),$r.setSuccess()}),window.cordova.plugins.browsertab.openUrl(ri),$r.promise},register:async function(Ar){var $r=or(),ri=await u.createRegisterUrl(Ar);return universalLinks.subscribe("keycloak",function(Za){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var Zi=St(Za.url);et(Zi,$r)}),window.cordova.plugins.browsertab.openUrl(ri),$r.promise},accountManagement:function(){var Ar=u.createAccountUrl();if(typeof Ar<"u")window.cordova.plugins.browsertab.openUrl(Ar);else throw"Not supported by the OIDC server"},redirectUri:function(Ar){return Ar&&Ar.redirectUri?Ar.redirectUri:u.redirectUri?u.redirectUri:"http://localhost"}};throw"invalid adapter type: "+Ft}const Dt="kc-callback-";var ei=function(){if(!(this instanceof ei))return new ei;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var Ft=this;function Sr(){const Yr=Date.now();for(const[Ar,$r]of Bn()){const ri=Or($r);(ri===null||ri<Yr)&&localStorage.removeItem(Ar)}}function yn(){for(const[Yr]of Bn())localStorage.removeItem(Yr)}function Bn(){return Object.entries(localStorage).filter(([Yr])=>Yr.startsWith(Dt))}function Or(Yr){let Ar;try{Ar=JSON.parse(Yr)}catch{return null}return _Se(Ar)&&"expires"in Ar&&typeof Ar.expires=="number"?Ar.expires:null}Ft.get=function(Yr){if(Yr){var Ar=Dt+Yr,$r=localStorage.getItem(Ar);return $r&&(localStorage.removeItem(Ar),$r=JSON.parse($r)),Sr(),$r}},Ft.add=function(Yr){Sr();const Ar=Dt+Yr.state,$r=JSON.stringify({...Yr,expires:Date.now()+3600*1e3});try{localStorage.setItem(Ar,$r)}catch{yn(),localStorage.setItem(Ar,$r)}}},Sn=function(){if(!(this instanceof Sn))return new Sn;var Ft=this;Ft.get=function(Or){if(Or){var Yr=yn(Dt+Or);if(Bn(Dt+Or,"",Sr(-100)),Yr)return JSON.parse(Yr)}},Ft.add=function(Or){Bn(Dt+Or.state,JSON.stringify(Or),Sr(60))},Ft.removeItem=function(Or){Bn(Or,"",Sr(-100))};var Sr=function(Or){var Yr=new Date;return Yr.setTime(Yr.getTime()+Or*60*1e3),Yr},yn=function(Or){for(var Yr=Or+"=",Ar=document.cookie.split(";"),$r=0;$r<Ar.length;$r++){for(var ri=Ar[$r];ri.charAt(0)==" ";)ri=ri.substring(1);if(ri.indexOf(Yr)==0)return ri.substring(Yr.length,ri.length)}return""},Bn=function(Or,Yr,Ar){var $r=Or+"="+Yr+"; expires="+Ar.toUTCString()+"; ";document.cookie=$r}};function cn(){try{return new ei}catch{}return new Sn}function pn(Ft){return function(){u.enableLogging&&Ft.apply(console,Array.prototype.slice.call(arguments))}}}function B6t(l){const u=String.fromCodePoint(...l);return btoa(u)}async function $6t(l){const _=new TextEncoder().encode(l);if(typeof crypto>"u"||typeof crypto.subtle>"u")throw new Error("Web Crypto API is not available.");return await crypto.subtle.digest("SHA-256",_)}function fSe(l){const[u,_]=l.split(".");if(typeof _!="string")throw new Error("Unable to decode token, payload not found.");let g;try{g=J6t(_)}catch(x){throw new Error("Unable to decode token, payload is not a valid Base64URL value.",{cause:x})}try{return JSON.parse(g)}catch(x){throw new Error("Unable to decode token, payload is not a valid JSON value.",{cause:x})}}function J6t(l){let u=l.replaceAll("-","+").replaceAll("_","/");switch(u.length%4){case 0:break;case 2:u+="==";break;case 3:u+="=";break;default:throw new Error("Input is not of the correct length.")}try{return U6t(u)}catch{return atob(u)}}function U6t(l){return decodeURIComponent(atob(l).replace(/(.)/g,(u,_)=>{let g=_.charCodeAt(0).toString(16).toUpperCase();return g.length<2&&(g="0"+g),"%"+g}))}function _Se(l){return typeof l=="object"&&l!==null}/*!
10
10
  * vue-keycloak-js v3.0.3
11
11
  * @license ISC
12
- */let kUe=!1;const eTe=w.reactive(V6t()),z6t={install:function(l,u={}){if(kUe)return;kUe=!0;const _={config:window.__BASEURL__?`${window.__BASEURL__}/config`:"/config",init:{onLoad:"login-required"}},g=Object.assign({},_,u),x=H6t(g);if(x.hasError)throw new Error(`Invalid options given: ${x.error}`);if(l.config.globalProperties.$keycloak=w.readonly(eTe),!g.config)throw new Error("Keycloak config is required");G6t(g.config).then(D=>{W6t(D,eTe,g)}).catch(D=>{console.log(D)})}};function q6t(){return w.readonly(eTe)}function V6t(){return{ready:!1,authenticated:!1,userName:void 0,fullName:void 0,token:void 0,tokenParsed:void 0,logoutFn:void 0,loginFn:void 0,login:void 0,createLoginUrl:void 0,createLogoutUrl:void 0,createRegisterUrl:void 0,register:void 0,accountManagement:void 0,createAccountUrl:void 0,loadUserProfile:void 0,subject:void 0,idToken:void 0,idTokenParsed:void 0,realmAccess:void 0,resourceAccess:void 0,refreshToken:void 0,refreshTokenParsed:void 0,timeSkew:void 0,responseMode:void 0,responseType:void 0,hasRealmRole:void 0,hasResourceRole:void 0,keycloak:void 0}}async function W6t(l,u,_){const g=new Gqe(l),{updateInterval:x,autoRefreshToken:D=!0}=_;function I($=!1){u.authenticated=$,u.loginFn=g.login,u.login=g.login,u.createLoginUrl=g.createLoginUrl,u.createLogoutUrl=g.createLogoutUrl,u.createRegisterUrl=g.createRegisterUrl,u.register=g.register,u.keycloak=g,$&&(u.accountManagement=g.accountManagement,u.createAccountUrl=g.createAccountUrl,u.hasRealmRole=g.hasRealmRole,u.hasResourceRole=g.hasResourceRole,u.loadUserProfile=g.loadUserProfile,u.token=g.token,u.subject=g.subject,u.idToken=g.idToken,u.idTokenParsed=g.idTokenParsed,u.realmAccess=g.realmAccess,u.resourceAccess=g.resourceAccess,u.refreshToken=g.refreshToken,u.refreshTokenParsed=g.refreshTokenParsed,u.timeSkew=g.timeSkew,u.responseMode=g.responseMode,u.responseType=g.responseType,u.tokenParsed=g.tokenParsed,u.userName=g.tokenParsed.preferred_username,u.fullName=g.tokenParsed.name)}g.onReady=function($){I($),u.ready=!0,typeof _.onReady=="function"&&_.onReady(g,u)},g.onAuthSuccess=function(){let $;D&&($=setInterval(()=>{g.updateToken(60).then(W=>{var ee;(ee=_.init)!=null&&ee.enableLogging&&console.log(`[vue-keycloak-js] Token ${W?"updated":"not updated"}`)}).catch(W=>{var ee;(ee=_.init)!=null&&ee.enableLogging&&console.log(`[vue-keycloak-js] Error while updating token: ${W}`),g.clearToken()})},x??1e4)),u.logoutFn=()=>($&&clearInterval($),g.logout(_.logout))},g.onAuthRefreshSuccess=function(){I(!0),typeof _.onAuthRefreshSuccess=="function"&&_.onAuthRefreshSuccess(g)},g.onAuthRefreshError=function(){I(!1),typeof _.onAuthRefreshError=="function"&&_.onAuthRefreshError(g)},g.onAuthLogout=function(){I(!1),typeof _.onAuthLogout=="function"&&_.onAuthLogout(g)};try{const $=await g.init(_.init);I($),typeof _.onInitSuccess=="function"&&_.onInitSuccess($)}catch($){I(!1);const W=new Error("Failure during initialization of keycloak-js adapter",{cause:$});typeof _.onInitError=="function"?_.onInitError(W,$):console.error(W,$)}}function H6t(l){const{config:u,init:_,onReady:g,onInitError:x,onAuthRefreshError:D,onAuthLogout:I}=l;return typeof u!="string"&&!tTe(u)?{hasError:!0,error:`'config' option must be a string or an object. Found: '${typeof u}'`}:!tTe(_)||typeof(_==null?void 0:_.onLoad)!="string"?{hasError:!0,error:`'init' option must be an object with an 'onLoad' property. Found: '${_}'`}:g&&typeof g!="function"?{hasError:!0,error:`'onReady' option must be a function. Found: '${typeof g}'`}:x&&typeof x!="function"?{hasError:!0,error:`'onInitError' option must be a function. Found: '${typeof x}'`}:D&&typeof D!="function"?{hasError:!0,error:`'onAuthRefreshError' option must be a function. Found: '${typeof D}'`}:I&&typeof I!="function"?{hasError:!0,error:`'onAuthLogout' option must be a function. Found: '${typeof I}'`}:{hasError:!1,error:null}}function G6t(l){return tTe(l)?Promise.resolve(l):fetch(l,{headers:{Accept:"application/json"}}).then(u=>{if(!u.ok)throw new Error(`Failed to fetch config: ${u.statusText}`);return u.json()})}function tTe(l){return l!==null&&typeof l=="object"&&Object.prototype.toString.call(l)!=="[object Array]"}function Yqe(l){return w.getCurrentScope()?(w.onScopeDispose(l),!0):!1}function pSe(){const l=new Set,u=D=>{l.delete(D)};return{on:D=>{l.add(D);const I=()=>u(D);return Yqe(I),{off:I}},off:u,trigger:(...D)=>Promise.all(Array.from(l).map(I=>I(...D))),clear:()=>{l.clear()}}}const Xqe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Y6t=()=>{};function dSe(...l){if(l.length!==1)return w.toRef(...l);const u=l[0];return typeof u=="function"?w.readonly(w.customRef(()=>({get:u,set:Y6t}))):w.ref(u)}function CUe(l,u=!1,_="Timeout"){return new Promise((g,x)=>{setTimeout(u?()=>x(_):g,l)})}function X6t(l,...u){return u.some(_=>_ in l)}function rTe(l,u=!1){function _(le,{flush:te="sync",deep:_e=!1,timeout:Ve,throwOnTimeout:Xe}={}){let et=null;const pt=[new Promise(ht=>{et=w.watch(l,rt=>{le(rt)!==u&&(et?et():w.nextTick(()=>et==null?void 0:et()),ht(rt))},{flush:te,deep:_e,immediate:!0})})];return Ve!=null&&pt.push(CUe(Ve,Xe).then(()=>w.toValue(l)).finally(()=>et==null?void 0:et())),Promise.race(pt)}function g(le,te){if(!w.isRef(le))return _(rt=>rt===le,te);const{flush:_e="sync",deep:Ve=!1,timeout:Xe,throwOnTimeout:et}=te??{};let bt=null;const ht=[new Promise(rt=>{bt=w.watch([l,le],([St,hr])=>{u!==(St===hr)&&(bt?bt():w.nextTick(()=>bt==null?void 0:bt()),rt(St))},{flush:_e,deep:Ve,immediate:!0})})];return Xe!=null&&ht.push(CUe(Xe,et).then(()=>w.toValue(l)).finally(()=>(bt==null||bt(),w.toValue(l)))),Promise.race(ht)}function x(le){return _(te=>!!te,le)}function D(le){return g(null,le)}function I(le){return g(void 0,le)}function $(le){return _(Number.isNaN,le)}function W(le,te){return _(_e=>{const Ve=Array.from(_e);return Ve.includes(le)||Ve.includes(w.toValue(le))},te)}function ee(le){return R(1,le)}function R(le=1,te){let _e=-1;return _(()=>(_e+=1,_e>=le),te)}return Array.isArray(w.toValue(l))?{toMatch:_,toContains:W,changed:ee,changedTimes:R,get not(){return rTe(l,!u)}}:{toMatch:_,toBe:g,toBeTruthy:x,toBeNull:D,toBeNaN:$,toBeUndefined:I,changed:ee,changedTimes:R,get not(){return rTe(l,!u)}}}function Q6t(l){return rTe(l)}function K6t(l,u,_={}){const{immediate:g=!0,immediateCallback:x=!1}=_,D=w.shallowRef(!1);let I;function $(){I&&(clearTimeout(I),I=void 0)}function W(){D.value=!1,$()}function ee(...R){x&&l(),$(),D.value=!0,I=setTimeout(()=>{D.value=!1,I=void 0,l(...R)},w.toValue(u))}return g&&(D.value=!0,Xqe&&ee()),Yqe(W),{isPending:w.shallowReadonly(D),start:ee,stop:W}}const Z6t=Xqe?window:void 0,eAt={json:"application/json",text:"text/plain"};function fne(l){return l&&X6t(l,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}const tAt=/^(?:[a-z][a-z\d+\-.]*:)?\/\//i;function rAt(l){return tAt.test(l)}function Hz(l){return typeof Headers<"u"&&l instanceof Headers?Object.fromEntries(l.entries()):l}function _M(l,...u){return l==="overwrite"?async _=>{let g;for(let x=u.length-1;x>=0;x--)if(u[x]!=null){g=u[x];break}return g?{..._,...await g(_)}:_}:async _=>{for(const g of u)g&&(_={..._,...await g(_)});return _}}function nAt(l={}){const u=l.combination||"chain",_=l.options||{},g=l.fetchOptions||{};function x(D,...I){const $=w.computed(()=>{const R=w.toValue(l.baseUrl),le=w.toValue(D);return R&&!rAt(le)?aAt(R,le):le});let W=_,ee=g;return I.length>0&&(fne(I[0])?W={...W,...I[0],beforeFetch:_M(u,_.beforeFetch,I[0].beforeFetch),afterFetch:_M(u,_.afterFetch,I[0].afterFetch),onFetchError:_M(u,_.onFetchError,I[0].onFetchError)}:ee={...ee,...I[0],headers:{...Hz(ee.headers)||{},...Hz(I[0].headers)||{}}}),I.length>1&&fne(I[1])&&(W={...W,...I[1],beforeFetch:_M(u,_.beforeFetch,I[1].beforeFetch),afterFetch:_M(u,_.afterFetch,I[1].afterFetch),onFetchError:_M(u,_.onFetchError,I[1].onFetchError)}),iAt($,ee,W)}return x}function iAt(l,...u){var _,g;const x=typeof AbortController=="function";let D={},I={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const $={method:"GET",type:"text",payload:void 0};u.length>0&&(fne(u[0])?I={...I,...u[0]}:D=u[0]),u.length>1&&fne(u[1])&&(I={...I,...u[1]});const{fetch:W=(g=(_=Z6t)==null?void 0:_.fetch)!=null?g:globalThis==null?void 0:globalThis.fetch,initialData:ee,timeout:R}=I,le=pSe(),te=pSe(),_e=pSe(),Ve=w.shallowRef(!1),Xe=w.shallowRef(!1),et=w.shallowRef(!1),bt=w.shallowRef(null),pt=w.shallowRef(null),ht=w.shallowRef(null),rt=w.shallowRef(ee||null),St=w.computed(()=>x&&Xe.value);let hr,$t;const or=Sn=>{x&&(hr==null||hr.abort(Sn),hr=new AbortController,hr.signal.onabort=()=>et.value=!0,D={...D,signal:hr.signal})},Vt=Sn=>{Xe.value=Sn,Ve.value=!Sn};R&&($t=K6t(or,R,{immediate:!1}));let mn=0;const vn=async(Sn=!1)=>{var cn,pn;or(),Vt(!0),ht.value=null,bt.value=null,et.value=!1,mn+=1;const Ft=mn,Sr={method:$.method,headers:{}},yn=w.toValue($.payload);if(yn){const Ar=Hz(Sr.headers),$r=Object.getPrototypeOf(yn);!$.payloadType&&yn&&($r===Object.prototype||Array.isArray($r))&&!(yn instanceof FormData)&&($.payloadType="json"),$.payloadType&&(Ar["Content-Type"]=(cn=eAt[$.payloadType])!=null?cn:$.payloadType),Sr.body=$.payloadType==="json"?JSON.stringify(yn):yn}let Bn=!1;const Or={url:w.toValue(l),options:{...Sr,...D},cancel:()=>{Bn=!0}};if(I.beforeFetch&&Object.assign(Or,await I.beforeFetch(Or)),Bn||!W)return Vt(!1),Promise.resolve(null);let Yr=null;return $t&&$t.start(),W(Or.url,{...Sr,...Or.options,headers:{...Hz(Sr.headers),...Hz((pn=Or.options)==null?void 0:pn.headers)}}).then(async Ar=>{if(pt.value=Ar,bt.value=Ar.status,Yr=await Ar.clone()[$.type](),!Ar.ok)throw rt.value=ee||null,new Error(Ar.statusText);return I.afterFetch&&({data:Yr}=await I.afterFetch({data:Yr,response:Ar,context:Or,execute:vn})),rt.value=Yr,le.trigger(Ar),Ar}).catch(async Ar=>{let $r=Ar.message||Ar.name;if(I.onFetchError&&({error:$r,data:Yr}=await I.onFetchError({data:Yr,error:Ar,response:pt.value,context:Or,execute:vn})),ht.value=$r,I.updateDataOnError&&(rt.value=Yr),te.trigger(Ar),Sn)throw Ar;return null}).finally(()=>{Ft===mn&&Vt(!1),$t&&$t.stop(),_e.trigger(null)})},sr=dSe(I.refetch);w.watch([sr,dSe(l)],([Sn])=>Sn&&vn(),{deep:!0});const Oi={isFinished:w.readonly(Ve),isFetching:w.readonly(Xe),statusCode:bt,response:pt,error:ht,data:rt,canAbort:St,aborted:et,abort:or,execute:vn,onFetchResponse:le.on,onFetchError:te.on,onFetchFinally:_e.on,get:ci("GET"),put:ci("PUT"),post:ci("POST"),delete:ci("DELETE"),patch:ci("PATCH"),head:ci("HEAD"),options:ci("OPTIONS"),json:ei("json"),text:ei("text"),blob:ei("blob"),arrayBuffer:ei("arrayBuffer"),formData:ei("formData")};function ci(Sn){return(cn,pn)=>{if(!Xe.value)return $.method=Sn,$.payload=cn,$.payloadType=pn,w.isRef($.payload)&&w.watch([sr,dSe($.payload)],([Ft])=>Ft&&vn(),{deep:!0}),{...Oi,then(Ft,Sr){return Dt().then(Ft,Sr)}}}}function Dt(){return new Promise((Sn,cn)=>{Q6t(Ve).toBe(!0).then(()=>Sn(Oi)).catch(cn)})}function ei(Sn){return()=>{if(!Xe.value)return $.type=Sn,{...Oi,then(cn,pn){return Dt().then(cn,pn)}}}}return I.immediate&&Promise.resolve().then(()=>vn()),{...Oi,then(Sn,cn){return Dt().then(Sn,cn)}}}function aAt(l,u){return!l.endsWith("/")&&!u.startsWith("/")?`${l}/${u}`:l.endsWith("/")&&u.startsWith("/")?`${l.slice(0,-1)}${u}`:`${l}${u}`}class One{constructor(u,_){mh(this,"title");mh(this,"message");this.title=u,this.message=_}}var _w=(l=>(l[l.GET=0]="GET",l[l.GET_TEXT=1]="GET_TEXT",l[l.POST=2]="POST",l[l.POST_TEXT=3]="POST_TEXT",l[l.PUT=4]="PUT",l[l.PUT_TEXT=5]="PUT_TEXT",l[l.PATCH=6]="PATCH",l[l.DELETE=7]="DELETE",l))(_w||{});class JP{constructor(u,_,g,x,D="application/json",I,$){mh(this,"fetchMethode");mh(this,"isIpInUrl",u=>/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/.test(u));this.relativeUrl=_,this.method=g,this.fetchMethode=nAt({baseUrl:u,fetchOptions:{credentials:u.indexOf("localhost")!=-1||this.isIpInUrl(u)?"omit":"include"},options:{immediate:!1,beforeFetch:async W=>{var ee;if(D&&(W.options.headers={"Content-Type":D}),I&&(W.options.headers={...W.options.headers,...I}),$){const R=q6t();await((ee=R.keycloak)==null?void 0:ee.updateToken()),W.options.headers={...W.options.headers,Authorization:R.token}}},onFetchError:W=>{let ee="Ismeretlen eredetű hiba!",R=!W.response;return W.response&&(W.response.ok||(R=!0,ee=x.get(W.response.status),ee||(ee=`${_w[g]} for Call: ${_} with Status: ${W.response.status} has no registered errorMessages!`,console.error(ee)))),R&&window.dispatchEvent(new CustomEvent("fetch-error",{detail:new One("Hiba a szerver elérése közben...",ee)})),W},afterFetch:W=>W}})}}function UP(l,u,_,g,x){const D={};return D.payload=w.ref(u),D.routeParams=w.ref(_),D.queryParams=w.ref(g),D.isFetching=w.ref(!1),D.data=w.ref(),D.sendKeycloakBearer=w.ref(x===void 0?!1:x),D.execute=()=>{D.fetch&&D.fetch.canAbort.value&&D.fetch.abort();const I=`${sAt(l.relativeUrl,D.routeParams.value,D.queryParams.value)}`,$=l.fetchMethode(I);let W;const ee=$.isFetching;function R(){le()&&D.successCallback?D.successCallback(D.data.value):!le()&&D.errorCallback&&(console.log(D.fetch.error.value),D.errorCallback(new One(D.fetch.error.value))),D.finallyCallback&&D.finallyCallback()}function le(){return D.fetch.statusCode&&D.fetch.statusCode.value>=200&&D.fetch.statusCode.value<=299}switch(l.method){case 0:W=$.get().json().data;break;case 1:W=$.get().text().data;break;case 4:W=$.put(D.payload).json().data;break;case 5:W=$.put(D.payload).text().data;break;case 3:W=$.post(D.payload).text().data;break;case 2:W=$.post(D.payload).json().data;break;case 6:W=$.patch(D.payload).json().data;break;case 7:W=$.delete(D.payload).json().data;break;default:throw new Error(`Method: ${l.method} is not implemented!`)}w.watch(W,te=>{D.data.value=te}),w.watch(ee,te=>{D.isFetching.value=te,te||R()}),D.fetch=$,$.execute()},D}function sAt(l,u,_){let g=l;return g||(g=""),g.slice(-1)==="/"&&(g=g.substring(0,g.length-1)),u&&Object.keys(u).forEach(x=>{if(g.indexOf(`{${x}}`)===-1)throw window.dispatchEvent(new CustomEvent("fetch-error",{detail:new One("Hiba!",`RouteParams: ${x} not found in url: ${g}! Contact the developers!`)})),new Error(`RouteParams: ${x} not found in url: ${g}! Contact the developers!`);const D=u[x];g=g.replace(`{${x}}`,D)}),_&&(g.indexOf("?")===-1&&(g+="?"),Object.keys(_).forEach(x=>{const D=_[x];g+=`${x}=${D}`})),g}const oAt=l=>{if(l=="NaN-NaN-NaN"||!l)return null;const u=new Date(Date.parse(l));return`${u.getFullYear()}-${(u.getMonth()+1).toString().padStart(2,"0")}-${u.getDate().toString().padStart(2,"0")}`},cAt=l=>{if(!l)return"-";const u=new Date(Date.parse(l));return`${u.getFullYear()}-${(u.getMonth()+1).toString().padStart(2,"0")}-${u.getDate().toString().padStart(2,"0")} ${u.getHours()}:${u.getMinutes()}`},lAt=l=>{if(!l)return"-";const u=new Date(Date.parse(l));return`${u.getFullYear()}-${(u.getMonth()+1).toString().padStart(2,"0")}-${u.getDate().toString().padStart(2,"0")} ${u.getHours()}:${u.getMinutes()}`},uAt=l=>{if(!l)return"-";const u=new Date(Date.parse(l));return`${u.getFullYear()}-${(u.getMonth()+1).toString().padStart(2,"0")}-${u.getDate().toString().padStart(2,"0")}`},fAt=l=>{const u=new Date(Date.parse(l)),_=u.getUTCFullYear(),g=String(u.getUTCMonth()+1).padStart(2,"0"),x=String(u.getUTCDate()).padStart(2,"0"),D=String(u.getUTCHours()).padStart(2,"0"),I=String(u.getUTCMinutes()).padStart(2,"0"),$=String(u.getUTCSeconds()).padStart(2,"0");return`${_}-${g}-${x}T${D}:${I}:${$}Z`},_At=l=>{const u=new Date(Date.parse(l)),_=u.getUTCFullYear(),g=String(u.getUTCMonth()+1).padStart(2,"0"),x=String(u.getUTCDate()).padStart(2,"0");return`${_}-${g}-${x}`},pAt=l=>{const u=new Date(Date.parse(l)),_=u.getFullYear(),g=String(u.getMonth()+1).padStart(2,"0"),x=String(u.getDate()).padStart(2,"0");return`${_}-${g}-${x}`},Qqe=l=>{if(!l)return null;const u=new Date(l);if(isNaN(u))return null;const _=u.getFullYear(),g=String(u.getMonth()+1).padStart(2,"0"),x=String(u.getDate()).padStart(2,"0"),D=String(u.getHours()).padStart(2,"0"),I=String(u.getMinutes()).padStart(2,"0");return`${_}-${g}-${x} ${D}:${I}`},iq=l=>{if(!l)return null;const u=new Date(l);if(isNaN(u))return null;const _=u.getFullYear(),g=String(u.getMonth()+1).padStart(2,"0"),x=String(u.getDate()).padStart(2,"0");return`${_}-${g}-${x}`},_ne=(l,u=!1)=>{if(!l)return null;const _=new Date(l);if(isNaN(_))return null;if(u)return iq(_)+"T00:00:00.000Z";const g=_.getUTCFullYear(),x=String(_.getUTCMonth()+1).padStart(2,"0"),D=String(_.getUTCDate()).padStart(2,"0"),I=String(_.getUTCHours()).padStart(2,"0"),$=String(_.getUTCMinutes()).padStart(2,"0"),W=String(_.getUTCSeconds()).padStart(2,"0");return`${g}-${x}-${D}T${I}:${$}:${W}.000Z`};function Kqe(l){return new Zqe(l)}class Zqe{constructor(u){mh(this,"getPostsConfig");mh(this,"getImagesConfig");mh(this,"getPresenceConfig");mh(this,"getKeycloakConfig");mh(this,"sites");this.apiurl=u,this.getPostsConfig=UP(new JP(this.apiurl,"/admin/Widgets/{name}",_w.GET,new Map([[400,"Search Posts Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Search Posts Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getImagesConfig=UP(new JP(this.apiurl,"/admin/Widgets/{name}",_w.GET,new Map([[400,"Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getPresenceConfig=UP(new JP(this.apiurl,"/admin/Widgets/{name}",_w.GET,new Map([[400,"Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getKeycloakConfig=UP(new JP(this.apiurl,"/admin/Widgets/{name}",_w.GET,new Map([[400,"Keycloak konfiguráció lekérése ismeretlen hiba!"],[500,"Keycloak konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.sites=UP(new JP(this.apiurl,"/admin/sites",_w.GET,new Map([[400,"Site lekérése ismeretlen hiba!"],[500,"Site lekérése ismeretlen hiba!"]])),void 0,void 0,void 0)}}const dAt=(l,u=500)=>{let _;return()=>{clearTimeout(_),_=setTimeout(()=>{l()},u)}};function mAt(l){return new eVe(l)}class eVe{constructor(u){mh(this,"baseUrl");mh(this,"searchPosts");mh(this,"partnersDetailsByIds");this.articleEditorBackendUrl=u,this.baseUrl=this.articleEditorBackendUrl,this.searchPosts=UP(new JP(this.baseUrl,"admin/Posts/searchPosts",_w.POST,new Map([[400,"Cikkek lekérdezése ismeretlen hiba!"],[500,"Cikkek lekérdezése ismeretlen hiba!"]])),{},void 0,void 0),this.partnersDetailsByIds=UP(new JP(this.baseUrl,"api/Partners/detailsByIds",_w.POST,new Map([[400,"BrandChannelek lekérdezése ismeretlen hiba!"],[500,"BrandChannelek lekérdezése ismeretlen hiba!"]])),{},void 0,void 0)}}const gAt={class:"d-flex flex-column w-100 gap-2"},hAt={class:"d-flex flex-row justify-content-between p-2"},vAt={key:0,class:"d-flex flex-column gap-2"},yAt={class:"d-flex flex-row justify-content-between"},bAt={class:"d-flex flex-row justify-content-between"},SAt=["onClick"],TAt={key:0,class:"d-flex flex-row gap-3"},xAt={class:"d-flex flex-column w-100"},kAt=["disabled","value"],CAt=["disabled","value"],EAt={class:"d-flex gap-2"},wAt={key:1,class:"d-flex justify-content-around flex-wrap gap-4 p-2"},DAt=["onClick"],AAt={key:2,class:"d-flex justify-content-around flex-wrap gap-4 p-2 cc-years"},PAt=["onClick"],UTe=w.defineComponent({__name:"CalendarComponent",props:{init:{},dateOnly:{type:Boolean}},emits:["changed"],setup(l,{emit:u}){const _=l,g=u,x=w.ref([]),D=w.ref(["H","K","Sz","Cs","P","Sz","V"]),I=w.ref(["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"]),$=w.ref([2025]),W=w.ref(""),ee=w.ref(2025),R=w.ref({local:null,utc:null}),le=w.ref(new Date),te=w.ref("00"),_e=w.ref("00"),Ve=w.ref(!1),Xe=w.ref("calendar");w.onMounted(()=>{et(_.init?_.init:null),bt(_.init?_.init:new Date)});const et=ht=>{if(ht){if(ht.setSeconds(0),_.dateOnly){const rt=new Date(ht);rt.setHours(0),rt.setMinutes(0),rt.setSeconds(0),R.value.local=rt,te.value="00",_e.value="00",R.value.utc=_ne(rt,!0)}else R.value.local=new Date(ht),te.value=ht.getHours().toString().padStart(2,"0"),_e.value=ht.getMinutes().toString().padStart(2,"0"),R.value.utc=_ne(ht);Ve.value=!0}else te.value="00",_e.value="00",R.value={local:null,utc:null},Ve.value=!1},bt=ht=>{let rt=new Date(ht);rt.setSeconds(0),le.value=new Date(rt),W.value=I.value[rt.getMonth()],ee.value=rt.getFullYear(),$.value=Array.from({length:60},(sr,Oi)=>rt.getFullYear()-29+Oi);const St=rt.getMonth();rt.setDate(1);const hr=[{days:[]}];let $t=hr[0],or=1;const Vt=sr=>sr.getDay()==0?6:sr.getDay()-1;let mn=Vt(rt);for(let sr=0;sr<mn;sr++)$t.days.push({label:"",isCurrent:!1,isSelected:!1,isWeekend:!1,isBlank:!0,number:sr});const vn=new Date;for(;rt.getMonth()===St;)mn=Vt(rt),mn==0&&($t={days:[]},hr.push($t)),$t.days.push({label:or.toString(),isCurrent:rt.getFullYear()==vn.getFullYear()&&rt.getMonth()==vn.getMonth()&&rt.getDate()==vn.getDate(),isSelected:R.value.local?R.value.local.getFullYear()==rt.getFullYear()&&R.value.local.getMonth()==rt.getMonth()&&R.value.local.getDate()==rt.getDate():!1,isWeekend:mn==5||mn==6,isBlank:!1,number:or}),or++,rt.setDate(rt.getDate()+1);for(mn=Vt(rt);mn!=6;)$t.days.push({label:or.toString(),isCurrent:!1,isSelected:!1,isWeekend:!1,isBlank:!0,number:0}),rt.setDate(rt.getDate()+1),mn=Vt(rt);x.value=hr},pt=()=>{let ht=new Date;ht.setHours(0),ht.setMinutes(0),ht.setSeconds(0),et(null),bt(ht),g("changed",R.value)};return(ht,rt)=>(w.openBlock(),w.createElementBlock("div",gAt,[w.createElementVNode("div",hAt,[w.createElementVNode("div",{class:"cc-btn",onClick:rt[0]||(rt[0]=()=>{let St=new Date(le.value);St.setMonth(le.value.getMonth()-1),bt(St)})}," < "),w.createElementVNode("div",{class:"cc-btn",onClick:rt[1]||(rt[1]=St=>Xe.value="years")},w.toDisplayString(ee.value),1),w.createElementVNode("div",{class:"cc-btn",onClick:rt[2]||(rt[2]=St=>Xe.value="months")},w.toDisplayString(W.value),1),w.createElementVNode("div",{class:"cc-btn",onClick:rt[3]||(rt[3]=()=>{let St=new Date(le.value);St.setMonth(le.value.getMonth()+1),bt(St)})}," > ")]),Xe.value=="calendar"?(w.openBlock(),w.createElementBlock("div",vAt,[w.createElementVNode("div",yAt,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(D.value,St=>(w.openBlock(),w.createElementBlock("div",null,w.toDisplayString(St),1))),256))]),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(x.value,St=>(w.openBlock(),w.createElementBlock("div",bAt,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(St.days,hr=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(["d-flex flex-row justify-content-center cc-day",{"cc-day-weekend":hr.isWeekend,"cc-day-blank":hr.isBlank,"cc-day-current":hr.isCurrent,"cc-day-selected":hr.isSelected}]),onClick:()=>{let $t=new Date(le.value.getFullYear(),le.value.getMonth(),hr.number,Number.parseInt(te.value),Number.parseInt(_e.value));et($t),bt($t)}},w.toDisplayString(hr.label),11,SAt))),256))]))),256)),ht.dateOnly?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",TAt,[w.createElementVNode("div",null,w.toDisplayString(te.value)+":"+w.toDisplayString(_e.value),1),w.createElementVNode("div",xAt,[w.createElementVNode("input",{type:"range",id:"slider",min:"0",max:"23",disabled:!Ve.value,value:te.value,onInput:rt[4]||(rt[4]=St=>{R.value.local.setHours(St.target.value),et(R.value.local)})},null,40,kAt),w.createElementVNode("input",{type:"range",id:"slider",min:"0",max:"59",disabled:!Ve.value,value:_e.value,onInput:rt[5]||(rt[5]=St=>{R.value.local.setMinutes(St.target.value),et(R.value.local)})},null,40,CAt)])])),w.createElementVNode("div",EAt,[w.createElementVNode("button",{type:"button",class:"btn btn-outline-secondary w-100",onClick:pt},"Töröl"),w.createElementVNode("button",{type:"button",class:"btn btn-primary w-100",onClick:rt[6]||(rt[6]=St=>g("changed",R.value))},"Beállít")])])):w.createCommentVNode("",!0),Xe.value=="months"?(w.openBlock(),w.createElementBlock("div",wAt,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(I.value,(St,hr)=>(w.openBlock(),w.createElementBlock("div",{class:"cc-btn-light",onClick:$t=>{let or=new Date(le.value);or.setMonth(hr),bt(or),Xe.value="calendar",$t.stopPropagation()}},w.toDisplayString(St),9,DAt))),256))])):w.createCommentVNode("",!0),Xe.value=="years"?(w.openBlock(),w.createElementBlock("div",AAt,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList($.value,St=>(w.openBlock(),w.createElementBlock("div",{class:"cc-btn-light",onClick:hr=>{let $t=new Date(le.value);$t.setFullYear(St),bt($t),Xe.value="calendar",hr.stopPropagation()}},w.toDisplayString(St),9,PAt))),256))])):w.createCommentVNode("",!0)]))}}),NAt={class:"d-flex flex-column flex-md-row gap-2"},IAt={class:"d-flex flex-row gap-2 w-100"},OAt={class:"vf-input-group"},FAt={key:0,class:"vf-floating-wrapper"},MAt={class:"vf-floating-label vf-floating-label-visible vf-floating-label-success"},LAt=["value","placeholder"],nTe=w.defineComponent({__name:"DateTimePicker",props:{placeholder:{},initial:{},dateOnly:{type:Boolean}},emits:["changed","calendar"],setup(l,{emit:u}){const _=l,g=u,x=w.ref(null),D=w.ref(null),I=w.ref(""),$=w.ref(null),W=w.ref(null),ee=w.ref(null),R=Xe=>{W.value&&!W.value.contains(Xe.target)&&(te.value=!1)};w.onMounted(()=>{_.initial&&(x.value=_.initial.local,D.value=_.initial.utc,le()),document.addEventListener("click",R)}),w.onUnmounted(()=>{document.removeEventListener("click",R)});const le=()=>{const Xe=_.dateOnly?iq(x.value):Qqe(x.value);I.value=Xe??""},te=w.ref(!1),_e=Xe=>{te.value?te.value=!1:(te.value=!0,w.nextTick(()=>{const et=W.value,bt=$.value,pt=ee.value,ht=bt.getBoundingClientRect();et.style.left=ht.left+ht.width+pt.getBoundingClientRect().width-et.getBoundingClientRect().width+15+"px",et.style.top=ht.top+ht.height+"px"})),Xe&&Xe.stopPropagation()},Ve=Xe=>{const et=new Date(Date.parse(Xe)),bt=_ne(et,_.dateOnly);if(!bt){D.value=null,w.nextTick(()=>D.value="");return}D.value=bt,x.value=et,le(),g("changed",{local:x.value,utc:D.value})};return w.watch(te,()=>{g("calendar",te.value)}),(Xe,et)=>(w.openBlock(),w.createElementBlock("div",NAt,[w.createElementVNode("div",IAt,[w.createElementVNode("div",OAt,[D.value?(w.openBlock(),w.createElementBlock("div",FAt,[w.createElementVNode("span",MAt,w.toDisplayString(Xe.placeholder),1)])):w.createCommentVNode("",!0),w.createElementVNode("input",{type:"text",id:"dateTimeInputText",ref_key:"dateTimeInputTextRef",ref:$,class:"vf-input-field",value:I.value,onChange:et[0]||(et[0]=bt=>Ve(bt.target.value)),placeholder:Xe.placeholder},null,40,LAt)]),w.createElementVNode("div",{ref_key:"iconBtn",ref:ee,class:"dateTime-picker__iconbtn",onClick:_e},[...et[2]||(et[2]=[w.createElementVNode("i",{class:"fa-regular fa-calendar"},null,-1)])],512)]),te.value?(w.openBlock(),w.createElementBlock("div",{key:0,ref_key:"calendarRef",ref:W,class:"dateTime-picker__popup"},[w.createVNode(UTe,{init:x.value,dateOnly:Xe.dateOnly,onChanged:et[1]||(et[1]=bt=>{x.value=bt.local,D.value=bt.utc,_e(null),le(),g("changed",{local:x.value,utc:D.value})})},null,8,["init","dateOnly"])],512)):w.createCommentVNode("",!0)]))}}),RAt=["id"],jAt=["id"],BAt={class:"dtrp-label"},$At=["id"],JAt="Törlés",UAt="Beállítás",zAt=w.defineComponent({__name:"DateRangePicker",props:{id:{},label:{}},emits:["changed"],setup(l,{emit:u}){const _=l,g=u,x=w.ref(!1),D=async()=>{x.value=!x.value,x.value&&await $()},I=w.reactive({top:"0px",left:"0px",zIndex:1e3}),$=async()=>{await w.nextTick();const rt=document.getElementById(`${_.id}-btn`).getBoundingClientRect(),St=document.getElementById(`${_.id}-popup`);if(!St)return;const hr=St.getBoundingClientRect(),$t=window.innerWidth;I.top=rt.top+rt.height+"px",rt.left<$t/3?I.left=rt.left+"px":rt.left>2*$t/3?I.left=rt.left+rt.width-hr.width+"px":I.left=rt.right-rt.width/2-hr.width/2+"px"},W=w.reactive({utc:null,local:null}),ee=w.reactive({utc:null,local:null}),R=w.ref(""),le=async()=>{W.local||ee.local?R.value=`'${iq(W.local)??""}'-'${iq(ee.local)??""}'`:R.value=_.label,await $()},te=ht=>{const rt=document.getElementById(`${_.id}-popup`);rt&&!rt.contains(ht.target)&&(x.value=!1)};let _e=!1;w.onMounted(()=>{le()}),w.onUnmounted(()=>{_e&&window.removeEventListener("click",te)});const Ve=()=>{W.utc=null,W.local=null,ee.local=null,ee.utc=null,le(),x.value=!1,g("changed",{fromUtc:W.utc,toUtc:ee.utc})},Xe=()=>{le(),x.value=!1,g("changed",{fromUtc:W.utc,toUtc:ee.utc})},et=()=>{_e||setTimeout(()=>{window.addEventListener("click",te),_e=!0},100)},bt=()=>{_e&&setTimeout(()=>{window.removeEventListener("click",te),_e=!1},100)},pt=ht=>{ht?bt():et()};return w.watch(x,()=>{x.value?et():bt()}),(ht,rt)=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[w.createElementVNode("div",{id:ht.id,class:"dtrp-flex"},[w.createElementVNode("button",{id:ht.id+"-btn",class:"btn btn-outline-secondary dtrp-flex dtrp-button",type:"button",onClick:D},[w.createElementVNode("div",BAt,w.toDisplayString(R.value),1)],8,jAt)],8,RAt),x.value?(w.openBlock(),w.createElementBlock("div",{key:0,id:ht.id+"-popup",class:"dtrp-popup d-flex flex-column gap-2",style:w.normalizeStyle(I)},[w.createVNode(nTe,{placeholder:"Ettől",id:ht.id+"-from",onChanged:rt[0]||(rt[0]=St=>{W.local=St.local,W.utc=St.utc}),dateOnly:!0,initial:W,onCalendar:pt},null,8,["id","initial"]),w.createVNode(nTe,{placeholder:"Eddig",id:ht.id+"-to",onChanged:rt[1]||(rt[1]=St=>{ee.local=St.local,ee.utc=St.utc}),dateOnly:!0,initial:ee,onCalendar:pt},null,8,["id","initial"]),w.createElementVNode("div",{class:"d-flex w-100 gap-2"},[w.createElementVNode("button",{class:"btn btn-outline-secondary w-50",onClick:Ve},w.toDisplayString(JAt)),w.createElementVNode("button",{class:"btn btn-outline-primary w-50",onClick:Xe},w.toDisplayString(UAt))])],12,$At)):w.createCommentVNode("",!0)],64))}}),qAt={class:"fltrctrl-container"},VAt=["placeholder","value"],WAt={key:1,class:"d-flex flex-row input-group align-items-center"};class HAt{constructor(u,_,g){mh(this,"type");this.key=u,this.placeholder=_,this.filtered=g,this.type="text"}}class GAt{constructor(u,_,g,x,D,I,$){mh(this,"type");this.key=u,this.label=_,this.options=g,this.filterevent=x,this.onfiltered=D,this.filtered=I,this.selected=$,this.type="dropdown"}}class YAt{constructor(u,_,g,x,D){mh(this,"type");this.key=u,this.label=_,this.filtered=g,this.defFrom=x,this.defTil=D,this.type="date"}}const mSe=w.ref({}),zTe=w.defineComponent({__name:"FilterControl",props:{item:{}},setup(l){const u=l;w.onMounted(()=>{var g;if(u.item.type=="dropdown"){const x=u.item;_.value=(g=x.options.value.find(D=>D.id==u.item.defaultv))==null?void 0:g.id,x.selected&&w.watch(x.selected,()=>{var D,I;_.value=(I=(D=x.selected)==null?void 0:D.value)==null?void 0:I.id})}});const _=w.ref(void 0);return(g,x)=>(w.openBlock(),w.createElementBlock("div",qAt,[g.item.type=="text"?(w.openBlock(),w.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:g.item.placeholder,value:g.item.defaultv??"",onInput:x[0]||(x[0]=D=>g.item.filtered(g.item.key,D.target.value))},null,40,VAt)):w.createCommentVNode("",!0),g.item.type=="date"?(w.openBlock(),w.createElementBlock("div",WAt,[w.createVNode(zAt,{id:g.item.key+"-dtrp",label:g.item.label,onChanged:x[1]||(x[1]=D=>{mSe.value.from=D.fromUtc,mSe.value.until=D.toUtc,g.item.filtered(g.item.key,mSe.value)})},null,8,["id","label"])])):w.createCommentVNode("",!0),g.item.type=="dropdown"?(w.openBlock(),w.createBlock(BM,{key:2,selected:_.value,options:w.ref(g.item.options),filterevent:g.item.filterevent,onFiltered:x[2]||(x[2]=D=>{g.item.onfiltered&&g.item.onfiltered(D)}),id:g.item.key,label:g.item.label,onSelected:x[3]||(x[3]=D=>{g.item.selected&&(g.item.selected.value=g.item.options.value.find(I=>I.id==D.id)),g.item.filtered(g.item.key,D.id)})},null,8,["selected","options","filterevent","id","label"])):w.createCommentVNode("",!0)]))}}),XAt=["title"],L8=w.defineComponent({__name:"IconButton",props:{icon:{},active:{type:Boolean},big:{type:Boolean},title:{}},emits:["click"],setup(l,{emit:u}){const _=l,g=w.computed(()=>`${_.icon} ${_.big?"ib-button-big":""}`),x=u;return(D,I)=>(w.openBlock(),w.createElementBlock("div",{onClick:I[0]||(I[0]=$=>x("click")),class:"ib-container"},[w.createElementVNode("div",{class:w.normalizeClass(["ib-button",{"ib-button-active":D.active}]),title:D.title},[w.createElementVNode("i",{class:w.normalizeClass(g.value)},null,2)],10,XAt)]))}}),QAt={class:"pc-container"},KAt=["value","max"],qTe=w.defineComponent({__name:"PaginatorControl",props:{settings:{}},emits:["pagesize","page"],setup(l,{emit:u}){const _=l,g=u,x=()=>{let ee=w.ref([]);return _.settings.value.sizes.forEach(R=>ee.value.push({label:R.toString(),id:R.toString()})),ee},D=w.ref(1);w.watch(()=>_.settings.value,()=>{D.value=1});const I=w.computed(()=>Math.floor(_.settings.value.total/_.settings.value.pagesize)+1),$=()=>{D.value>1&&(D.value-=1,g("page",D.value))},W=()=>{D.value<I.value&&(D.value+=1,g("page",D.value))};return(ee,R)=>(w.openBlock(),w.createElementBlock("div",QAt,[w.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:$},"<"),w.createElementVNode("input",{class:"form-control pc-input",type:"number",value:D.value,min:"1",max:I.value,onChange:R[0]||(R[0]=le=>ee.$emit("page",le.target.value))},null,40,KAt),w.createTextVNode("/"+w.toDisplayString(I.value)+" ",1),w.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:W},">"),w.createVNode(BM,{opentop:!0,class:"pc-dropdown",id:"pagecount",label:"10",selected:ee.settings.value.pagesize.toString(),options:x(),onSelected:R[1]||(R[1]=le=>{D.value=1,ee.$emit("pagesize",parseInt(le.id))})},null,8,["selected","options"])]))}}),ZAt={class:"form-check"},e4t=["name","id","checked"],t4t=["for"],VTe=w.defineComponent({__name:"RadioButton",props:{group:{},label:{},id:{},selected:{type:Boolean}},emits:["selected"],setup(l){return(u,_)=>(w.openBlock(),w.createElementBlock("div",ZAt,[w.createElementVNode("input",{class:"form-check-input",type:"radio",name:u.group,id:u.id,checked:u.selected,onChange:_[0]||(_[0]=g=>u.$emit("selected",u.id))},null,40,e4t),w.createElementVNode("label",{class:"form-check-label",for:u.id},w.toDisplayString(u.label),9,t4t)]))}}),r4t={class:"d-flex flex-column gap-2 justify-content-around"},tVe=w.defineComponent({__name:"RadioButtonGroup",props:{group:{},items:{}},emits:["selected"],setup(l){return(u,_)=>(w.openBlock(),w.createElementBlock("div",r4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.items,g=>(w.openBlock(),w.createBlock(VTe,{key:g.id,id:g.id,label:g.label,group:u.group,selected:g.selected,onSelected:_[0]||(_[0]=x=>u.$emit("selected",x))},null,8,["id","label","group","selected"]))),128))]))}}),n4t={key:0,class:"spinner-border",role:"status"},WTe=w.defineComponent({__name:"SpinningProgress",props:{loading:{type:Boolean}},setup(l){return(u,_)=>u.loading?(w.openBlock(),w.createElementBlock("div",n4t,[..._[0]||(_[0]=[w.createElementVNode("span",{class:"visually-hidden"},"Loading...",-1)])])):w.createCommentVNode("",!0)}}),i4t={key:0,class:"t2l-table-view t2l-table-header-label"},a4t={key:0,class:"t2l-select"},s4t={key:1,class:"t2l-cell"},o4t={class:"t2l-table-view t2l-table-header-filter"},c4t={key:0,class:"t2l-select"},l4t={key:1,class:"t2l-cell"},u4t={class:"t2l-table-view t2l-rows"},f4t={key:0,class:"t2l-select"},_4t=["id","onChange"],p4t=["innerHTML"],d4t={key:1,class:"t2l-cell t2l-actions"},m4t=["title","disabled","onClick"],g4t={class:"t2l-card-view t2l-card-filters"},h4t={class:"t2l-card-filter-order"},v4t={class:"t2l-card-filter-search"},y4t={class:"t2l-card-view t2l-rows"},b4t={key:0,class:"t2l-card-select"},S4t=["id","onChange"],T4t={key:0,class:"t2l-property"},x4t={class:"t2l-label"},k4t=["innerHTML"],C4t={class:"d-flex align-items-center"},E4t={key:2,class:"d-flex justify-content-center t2l-footer"},rVe=w.defineComponent({__name:"TableToList",props:{items:{},config:{}},emits:["pagesize","page"],setup(l){const u=R=>R&&R.component!==void 0,_=l,g=w.computed(()=>_.config.columns.filter(R=>R.visible!=!1)),x=w.computed(()=>_.config.columns.filter(R=>R.visible!=!1&&R.filter)),D=w.computed(()=>g.value.filter(R=>R.sort&&R.sort.active&&R.sort.active.value)),I=w.computed(()=>Math.ceil(g.value.length/_.config.smColCount)),$=(R,le)=>{var te=R-1+(le-1)*I.value;return te<g.value.length?g.value[te]:null},W=(R,le)=>R.converter?R.converter(le[R.property],le):le[R.property],ee=R=>{if(R.sort&&R.sort.active){let le=!R.sort.active.value;_.config.columns.forEach(te=>{te.sort&&te.sort.active&&(te.sort.active.value=!1)}),R.sort.active.value=le,R.sort.callback(le?R.property:"")}};return(R,le)=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[R.config.compact?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",i4t,[R.config.selectableId?(w.openBlock(),w.createElementBlock("span",a4t)):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(g.value,te=>{var _e,Ve;return w.openBlock(),w.createElementBlock("span",{class:"t2l-cell gap-2",key:te.property},[te.sort?(w.openBlock(),w.createBlock(L8,{key:0,icon:te.sort.icon,onClick:Xe=>ee(te),active:(Ve=(_e=te.sort)==null?void 0:_e.active)==null?void 0:Ve.value},null,8,["icon","onClick","active"])):w.createCommentVNode("",!0),w.createTextVNode(" "+w.toDisplayString(te.label),1)])}),128)),R.config.actionHeader?(w.openBlock(),w.createElementBlock("span",s4t,w.toDisplayString(R.config.actionHeader),1)):w.createCommentVNode("",!0)])),w.createElementVNode("div",o4t,[R.config.selectableId?(w.openBlock(),w.createElementBlock("span",c4t)):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(g.value,te=>(w.openBlock(),w.createElementBlock("span",{class:"t2l-cell",key:te.label},[te.filter?(w.openBlock(),w.createBlock(zTe,{key:0,item:te.filter},null,8,["item"])):w.createCommentVNode("",!0)]))),128)),R.config.actionHeader?(w.openBlock(),w.createElementBlock("span",l4t)):w.createCommentVNode("",!0)]),w.createElementVNode("div",u4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(R.items,te=>(w.openBlock(),w.createElementBlock("div",{key:te,class:"t2l-row"},[R.config.selectableId?(w.openBlock(),w.createElementBlock("div",f4t,[w.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:te[R.config.selectableId],onChange:_e=>te.selected=!te.selected},null,40,_4t)])):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(g.value,_e=>(w.openBlock(),w.createElementBlock("div",{class:"t2l-cell",key:_e.property},[w.isVNode(W(_e,te))?(w.openBlock(),w.createBlock(w.resolveDynamicComponent(W(_e,te)),{key:0})):u(W(_e,te))?(w.openBlock(),w.createBlock(w.resolveDynamicComponent(W(_e,te).component),w.mergeProps({key:1,ref_for:!0},W(_e,te).props),null,16)):(w.openBlock(),w.createElementBlock("span",{key:2,innerHTML:String(W(_e,te)??"")},null,8,p4t))]))),128)),R.config.actions?(w.openBlock(),w.createElementBlock("div",d4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(R.config.actions,_e=>(w.openBlock(),w.createElementBlock("button",{key:_e,type:"button",class:"btn btn-outline-secondary",title:_e.label,disabled:!_e.enabled(te),onClick:Ve=>_e.command(te)},[w.createElementVNode("i",{class:w.normalizeClass(_e.icon)},null,2)],8,m4t))),128))])):w.createCommentVNode("",!0)]))),128))]),w.createElementVNode("div",g4t,[w.createElementVNode("div",h4t,[w.createVNode($Te,{id:"card-filter-order",default:{icon:"fa-solid fa-chevron-down",label:"rendezés"},selected:D.value.length>0?D.value[0].property:"",enabled:R.config.sortEnabled,options:w.ref(g.value.filter(te=>te.sort).map(te=>({icon:te.sort.icon,label:te.sort.label,value:te.property,callback:te.sort.callback})))},null,8,["selected","enabled","options"])]),w.createElementVNode("div",v4t,[w.createVNode(JTe,{items:x.value.map(te=>({filter:te.filter,icon:te.filterIcon,label:te.label}))},null,8,["items"])])]),w.createElementVNode("div",y4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(R.items,(te,_e)=>(w.openBlock(),w.createElementBlock("div",{class:"t2l-row",key:_e},[R.config.selectableId?(w.openBlock(),w.createElementBlock("div",b4t,[w.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:te[R.config.selectableId],onChange:Ve=>te.selected=!te.selected},null,40,S4t)])):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(R.config.smColCount,Ve=>(w.openBlock(),w.createElementBlock("div",{class:"t2l-card-col",key:Ve},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(I.value,Xe=>(w.openBlock(),w.createElementBlock(w.Fragment,{key:Xe},[$(Xe,Ve)?(w.openBlock(),w.createElementBlock("div",T4t,[w.createElementVNode("span",x4t,w.toDisplayString($(Xe,Ve).label),1),w.isVNode(W($(Xe,Ve),te))?(w.openBlock(),w.createBlock(w.resolveDynamicComponent(W($(Xe,Ve),te)),{key:0})):u(W($(Xe,Ve),te))?(w.openBlock(),w.createBlock(w.resolveDynamicComponent(W($(Xe,Ve),te).component),w.mergeProps({key:1,ref_for:!0},W($(Xe,Ve),te).props),null,16)):(w.openBlock(),w.createElementBlock("span",{key:2,innerHTML:String(W($(Xe,Ve),te)??"")},null,8,k4t))])):w.createCommentVNode("",!0)],64))),128))]))),128)),w.createElementVNode("div",C4t,[_.config.actions?(w.openBlock(),w.createBlock(Ine,{key:0,item:te,options:_.config.actions,label:"...",id:_e.toString(),right:!0},null,8,["item","options","id"])):w.createCommentVNode("",!0)])]))),128))]),R.config.paginatorSettings?(w.openBlock(),w.createBlock(qTe,{key:1,settings:R.config.paginatorSettings,onPagesize:le[0]||(le[0]=te=>R.$emit("pagesize",te)),onPage:le[1]||(le[1]=te=>R.$emit("page",te))},null,8,["settings"])):w.createCommentVNode("",!0),R.config.paginatorSettings?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",E4t," Elemek: "+w.toDisplayString(_.items.length),1))],64))}}),w4t={class:"d-flex flex flex-row"},D4t={key:1,class:"d-flex flex-column gap-2 options-body flex-grow-1"},A4t={class:"d-flex flex-grow-1 flex-column"},P4t={class:"d-flex flex-row"},N4t={class:"d-flex align-items-end"},I4t=["disabled"],nVe=w.defineComponent({__name:"TableToListOptions",props:{colCount:{},options:{},config:{}},emits:["save"],setup(l,{emit:u}){const _=l,g=w.ref([]);w.onMounted(()=>{g.value=_.options,R()});const x=w.computed(()=>_.colCount!=0?Math.ceil(_.options.length/_.colCount):0),D=(le,te)=>{var _e=_.options[(le-1)*x.value+te-1];return _e},I=()=>{$("save",g.value)},$=u,W=w.ref(!1),ee=w.ref(!0),R=()=>{ee.value=g.value.filter(le=>le.checked).length<=1};return(le,te)=>(w.openBlock(),w.createElementBlock("div",w4t,[W.value?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",{key:0,class:"d-flex flex-row align-items-center gap-2 options-header justify-content-start",onClick:te[0]||(te[0]=_e=>W.value=!W.value)},[...te[3]||(te[3]=[w.createElementVNode("i",{class:"fa-solid fa-cog"},null,-1),w.createElementVNode("div",{class:"options-header-label"},"beállítások",-1)])])),W.value?(w.openBlock(),w.createElementBlock("div",D4t,[te[5]||(te[5]=w.createElementVNode("div",{class:"options-header-label"},"Táblázat tulajdonságai",-1)),w.createElementVNode("div",A4t,[w.createVNode(nq,{id:"compact",label:"Kompakt",checked:!!le.config.compact,onChanged:te[1]||(te[1]=_e=>le.config.compact=_e.checked)},null,8,["checked"])]),te[6]||(te[6]=w.createElementVNode("div",{class:"options-header-label"},"Látható oszlopok",-1)),w.createElementVNode("div",P4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(le.colCount,_e=>(w.openBlock(),w.createElementBlock("div",{class:"d-flex flex-grow-1 flex-column",key:_e},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(x.value,Ve=>(w.openBlock(),w.createElementBlock(w.Fragment,{key:Ve},[D(_e,Ve)?(w.openBlock(),w.createBlock(nq,{key:0,id:D(_e,Ve).property,label:D(_e,Ve).label,checked:D(_e,Ve).checked,onChanged:te[2]||(te[2]=Xe=>{g.value.find(et=>et.property==Xe.id).checked=Xe.checked,R()})},null,8,["id","label","checked"])):w.createCommentVNode("",!0)],64))),128))]))),128)),w.createElementVNode("div",N4t,[w.createElementVNode("button",{class:"btn btn-outline-secondary",type:"button",onClick:I,disabled:ee.value},[...te[4]||(te[4]=[w.createElementVNode("i",{class:"fa-solid fa-save"},null,-1)])],8,I4t)])])])):w.createCommentVNode("",!0)]))}}),O4t={class:"tlb-container d-flex flex-column flex-grow-1"},F4t={class:"d-flex flex-row tlb-item"},M4t={class:"d-flex flex-column flex-grow-1 flex-sm-row justify-content-between tlb-item"},L4t=["id"],R4t={key:0,class:"d-flex id"},j4t={class:"d-flex flex-row align-items-center tlb-children-container"},iVe=w.defineComponent({__name:"TextListBox",props:{items:{}},emits:["deleted"],setup(l){return(u,_)=>{const g=w.resolveComponent("TextListBox",!0);return w.openBlock(),w.createElementBlock("div",O4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.items,x=>(w.openBlock(),w.createElementBlock("div",{class:"d-flex flex-column",key:x.id},[w.createElementVNode("div",F4t,[w.createElementVNode("div",M4t,[w.createElementVNode("div",{class:"d-flex flex-grow-1",id:x.id},w.toDisplayString(x.label),9,L4t),x.showId?(w.openBlock(),w.createElementBlock("div",R4t,w.toDisplayString(x.id),1)):w.createCommentVNode("",!0)]),x.hideDelete?w.createCommentVNode("",!0):(w.openBlock(),w.createBlock(L8,{key:0,icon:"fa-solid fa-trash",onClick:D=>u.$emit("deleted",x.id)},null,8,["onClick"]))]),w.createElementVNode("div",j4t,[x.childrend?(w.openBlock(),w.createBlock(g,{key:0,items:x.childrend,showId:x.showId,hideDelete:x.hideDelete},null,8,["items","showId","hideDelete"])):w.createCommentVNode("",!0)])]))),128))])}}}),B4t={key:0,class:"toast-container position-fixed bottom-0 start-50 translate-middle-x p-4 toast-zindex"},$4t={class:"toast-header"},J4t={class:"me-auto"},U4t={class:"text-body-secondary"},z4t=["onClick"],q4t=["innerHTML"],EUe=500,HTe=w.defineComponent({__name:"ToastComponent",props:{defaultDisplayDuration:{}},setup(l,{expose:u}){const _=l,g=w.ref([]);return u({addToast:D=>{D.displayDuration||(D.displayDuration=_.defaultDisplayDuration),D.id=new Date,g.value.filter(function(I){return I.id!==D.id}),g.value.push(D)}}),setInterval(()=>{g.value=g.value.map(D=>(D.displayDuration-=EUe,D)),g.value=g.value.filter(D=>D.displayDuration>0)},EUe),(D,I)=>g.value.length>0?(w.openBlock(),w.createElementBlock("div",B4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(g.value,$=>(w.openBlock(),w.createElementBlock("div",{key:$.message,class:w.normalizeClass(["toast d-block",{"toast-info":$.type==="info","toast-success":$.type==="success","toast-warning":$.type==="warning","toast-error":$.type==="error"}]),role:"alert","aria-live":"assertive","aria-atomic":"true"},[w.createElementVNode("div",$4t,[w.createElementVNode("strong",J4t,w.toDisplayString($.title),1),w.createElementVNode("small",U4t,w.toDisplayString($.id.toLocaleTimeString()),1),w.createElementVNode("button",{type:"button",class:"btn-close","data-bs-dismiss":"toast","aria-label":"Close",onClick:W=>g.value=g.value.filter(ee=>ee.id!==$.id)},null,8,z4t)]),w.createElementVNode("div",{class:"toast-body",innerHTML:$.message},null,8,q4t)],2))),128))])):w.createCommentVNode("",!0)}}),aVe=w.defineComponent({__name:"ToastWrapper",setup(l){const u=w.ref(),_=[{id:"toast-notification-message",handler:g=>{let x=g.detail;u.value.addToast({title:x.title,message:x.message,type:x.severity,displayDuration:x.displayDuration?x.displayDuration:5e3})}},{id:"fetch-error",handler:g=>{let x=g.detail;u.value.addToast({title:x.title,message:x.message,type:"error",displayDuration:1e4})}}];return w.onMounted(()=>{_.forEach(g=>window.addEventListener(g.id,g.handler))}),w.onUnmounted(()=>{_.forEach(g=>window.removeEventListener(g.id,g.handler))}),(g,x)=>(w.openBlock(),w.createBlock(HTe,{ref_key:"toast",ref:u,defaultDisplayDuration:5e3},null,512))}}),Qk=class Qk{};mh(Qk,"getId",(u,_)=>`${u}_${_}`),mh(Qk,"saveOptions",(u,_,g,x)=>{localStorage.setItem(Qk.getId(u,_),JSON.stringify({ttlcos:x,ttlc:{compact:g.compact}})),window.location.reload()}),mh(Qk,"cleanOptions",(u,_)=>{for(let g=0;g<localStorage.length;g++)localStorage.key(g).includes(u)&&localStorage.key(g)!=Qk.getId(u,_)&&localStorage.removeItem(localStorage.key(g))}),mh(Qk,"loadOptions",(u,_,g,x,D)=>{Qk.cleanOptions(u,_);const I=Qk.getId(u,_);if(localStorage.getItem(I))try{const $=JSON.parse(localStorage.getItem(I));D.value=$.ttlcos,D.value.forEach(W=>x.columns.find(ee=>ee.property==W.property).visible=W.checked),x.compact=$.ttlc.compact}catch{localStorage.removeItem(I),Qk.loadOptions(u,_,g,x,D)}else g||(g=[]),D.value=x.columns.map($=>($.visible=g.indexOf($.property)==-1,{label:$.label,property:$.property,checked:$.visible}))});let iTe=Qk;const V4t={class:"hdr-container d-flex flex-row flex-wrap align-items-center gap-3"},W4t=["onClick","title"],H4t={class:"hdr-title d-flex align-items-center"},G4t=["onClick","title"],Y4t={class:"d-flex flex-grow-1 justify-content-end gap-3"},X4t=["onClick","title"],sVe=w.defineComponent({__name:"HeaderComponent",props:{title:{},isFetching:{type:Boolean},buttons:{}},setup(l){return(u,_)=>(w.openBlock(),w.createElementBlock("div",V4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.buttons,g=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[g.align=="pretitle"&&g.type=="iconButton"?(w.openBlock(),w.createBlock(L8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):w.createCommentVNode("",!0),g.align=="pretitle"&&g.type=="button"?(w.openBlock(),w.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title},w.toDisplayString(g.title),9,W4t)):w.createCommentVNode("",!0)],64))),256)),w.createElementVNode("div",H4t,w.toDisplayString(u.title),1),w.createVNode(WTe,{loading:u.isFetching},null,8,["loading"]),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.buttons,g=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[g.align=="left"&&g.type=="iconButton"?(w.openBlock(),w.createBlock(L8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):w.createCommentVNode("",!0),g.align=="left"&&g.type=="button"?(w.openBlock(),w.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title},w.toDisplayString(g.title),9,G4t)):w.createCommentVNode("",!0)],64))),256)),w.createElementVNode("div",Y4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.buttons,g=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[g.align=="right"&&g.type=="iconButton"?(w.openBlock(),w.createBlock(L8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):w.createCommentVNode("",!0),g.align=="right"&&g.type=="button"?(w.openBlock(),w.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title},w.toDisplayString(g.title),9,X4t)):w.createCommentVNode("",!0)],64))),256))])]))}}),Q4t={class:"image-picker"},K4t={key:0},Z4t=["src"],ePt={key:1},tPt=["src"],rPt={key:1},nPt={key:0,class:"d-flex flex-column flex-grow-1 gap-2"},iPt=["value","disabled"],aPt=["value","disabled"],sPt=["disabled"],oPt=["id"],cPt=["ae-api-url","environment","causationid"],$M=w.defineComponent({__name:"ImagePickerComponent",props:{modelValue:{},details:{type:Boolean},editable:{type:Boolean},direction:{},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{}},emits:["update:modelValue"],setup(l,{emit:u}){const _=l,g=u,x={id:"",url:"",isAdult:!1,source:"",title:""},D=w.ref(x);w.watch(()=>D,()=>{g("update:modelValue",D.value)},{deep:!0}),w.watch(()=>_.modelValue,et=>{et&&(D.value=et)},{deep:!0,immediate:!0});const I=_.searchImageWidgetUrl,$=_.imageBaseUrl,W=_.imageViewId,ee=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`ipe-${Date.now()}-${Math.random().toString(36).slice(2)}`,R=w.ref(`${ee}-image-picker-causation-id`);w.onMounted(()=>{if(!document.querySelector(`script[src="${I}"]`)){const et=document.createElement("script");et.type="text/javascript",et.src=I,et.async=!0,document.head.appendChild(et)}});const le=w.computed(()=>D.value&&(D.value.url&&D.value.url.length>0||D.value.id&&D.value.id.length>0)),te=w.computed(()=>{if(le.value)return D.value.url&&D.value.url.length>0?D.value.url:`${$}/${W}/${D.value.id}.jpg`}),_e=et=>{et.preventDefault(),w.nextTick(()=>{var bt;(bt=document.getElementById(R.value))==null||bt.showModal()})},Ve=et=>{et.preventDefault(),D.value=x},Xe=et=>{var bt,pt;((bt=et==null?void 0:et.detail)==null?void 0:bt.causationid)===R.value&&((pt=document.getElementById(R.value))==null||pt.close(),D.value={id:et.detail.image.id,url:"",isAdult:et.detail.image.isAdult,source:et.detail.image.source,title:et.detail.image.title})};return w.onMounted(()=>{window.addEventListener("image-selected",Xe)}),w.onUnmounted(()=>{window.removeEventListener("image-selected",Xe)}),(et,bt)=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[w.createElementVNode("div",Q4t,[w.createElementVNode("div",{class:w.normalizeClass(["d-flex gap-2",_.direction==="horizontal"?"flex-sm-row flex-column":"flex-column"])},[w.createElementVNode("div",{class:w.normalizeClass(["d-flex flex-column",_.direction==="horizontal"?"image-picker__preview":""])},[_.direction==="horizontal"?(w.openBlock(),w.createElementBlock("div",K4t,[le.value?(w.openBlock(),w.createElementBlock("img",{key:0,class:"image-picker__preview",alt:"",src:te.value},null,8,Z4t)):(w.openBlock(),w.createElementBlock("p",ePt,"Nincs kép kiválasztva!"))])):w.createCommentVNode("",!0),_.direction!=="horizontal"?(w.openBlock(),w.createElementBlock(w.Fragment,{key:1},[le.value?(w.openBlock(),w.createElementBlock("img",{key:0,alt:"",src:te.value},null,8,tPt)):(w.openBlock(),w.createElementBlock("p",rPt,"Nincs kép kiválasztva!"))],64)):w.createCommentVNode("",!0),w.createElementVNode("div",{class:"btn-group mt-2 w-100",role:"group","aria-label":"Képválasztó gombok"},[w.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:_e},"Kép választás"),w.createElementVNode("button",{class:"btn btn-outline-danger",onClick:Ve},"Eltávolítás")])],2),_.details&&D.value&&D.value.id?(w.openBlock(),w.createElementBlock("div",nPt,[w.createElementVNode("div",null,[bt[3]||(bt[3]=w.createElementVNode("label",{for:"imgSrc",class:"form-label"},"Forrás",-1)),w.createElementVNode("input",{id:"imgSrc",class:"form-control",type:"text",placeholder:"Forrás",value:D.value.source,onInput:bt[0]||(bt[0]=pt=>{D.value.source=pt.target.value}),disabled:!_.editable},null,40,iPt)]),w.createElementVNode("div",null,[bt[4]||(bt[4]=w.createElementVNode("label",{for:"imgAlt",class:"form-label"},"Képalá",-1)),w.createElementVNode("input",{id:"imgAlt",class:"form-control",type:"text",placeholder:"Képalá",value:D.value.title,onInput:bt[1]||(bt[1]=pt=>{D.value.title=pt.target.value}),disabled:!_.editable},null,40,aPt)]),w.createElementVNode("div",null,[bt[5]||(bt[5]=w.createElementVNode("label",{for:"isAdult",class:"form-check-label"},"Felnőtt tartalom",-1)),w.withDirectives(w.createElementVNode("input",{id:"isAdult",class:"m-1 form-check-input",type:"checkbox","onUpdate:modelValue":bt[2]||(bt[2]=pt=>D.value.isAdult=pt),disabled:!_.editable},null,8,sPt),[[w.vModelCheckbox,D.value.isAdult]])])])):w.createCommentVNode("",!0)],2)]),w.createElementVNode("dialog",{id:R.value,class:"w-100 h-100 p-0 m-0 border-none overflow-hidden"},[w.createElementVNode("hvg-search-image",{"ae-api-url":et.articleEditorUrl,environment:et.environment,causationid:R.value,selectonly:"true"},null,8,cPt)],8,oPt)],64))}}),lPt={class:"selector"},uPt={class:"form-label",for:"format"},fPt=["value"],_Pt=w.defineComponent({__name:"SelectorComponent",props:{modelValue:{},label:{},options:{}},emits:["update:modelValue"],setup(l,{emit:u}){const _=l,g=u,x=w.computed({get:()=>_.modelValue,set:D=>g("update:modelValue",D)});return w.watchEffect(async()=>{var I;if(!((I=_.options)!=null&&I.length))return;const D=_.options.map($=>$.value);(_.modelValue==null||!D.includes(_.modelValue))&&(g("update:modelValue",D[0]),await w.nextTick())}),(D,I)=>(w.openBlock(),w.createElementBlock("div",lPt,[w.createElementVNode("label",uPt,w.toDisplayString(D.label),1),w.withDirectives(w.createElementVNode("select",{class:"form-control",id:"format","onUpdate:modelValue":I[0]||(I[0]=$=>x.value=$)},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(D.options,$=>(w.openBlock(),w.createElementBlock("option",{key:$.value,value:$.value},w.toDisplayString($.label),9,fPt))),128))],512),[[w.vModelSelect,x.value]])]))}}),oVe=sC(_Pt,[["__scopeId","data-v-701e6d6d"]]),pPt={class:"d-flex flex-column gap-2"},dPt={class:"btn-group mt-2 w-100",role:"group","aria-label":"Cikkválasztó gombok"},mPt={key:0,class:"w-100 gap-1 d-flex"},gPt={class:"w-100"},hPt=["value"],vPt={class:"w-100"},yPt=["value"],bPt=["value"],SPt=["value"],TPt=["id"],xPt=["id","apiurl"],kPt="00000000-0000-0000-0000-000000000000",GTe=w.defineComponent({__name:"InternalArticleOfferComponent",props:{modelValue:{},searchArticleApiUrl:{},searchArticleWidgetUrl:{},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{},showIds:{type:Boolean,default:!0},formats:{}},emits:["update:modelValue"],setup(l,{emit:u}){const _={article:{siteId:"",id:"",imageId:"",title:"",lead:""},format:""},g=u,x=l,D=w.ref(_),I=w.ref({id:D.value.article.imageId||"",url:"",source:"",title:"",isAdult:!1});w.watch(()=>x.modelValue,le=>{le?D.value=le:D.value=_},{deep:!0,immediate:!0}),w.watch(()=>D,le=>{g("update:modelValue",D.value),I.value.id=le.value.article.imageId},{deep:!0,immediate:!0}),w.watch(()=>I.value.id,le=>{D.value.article.imageId=le},{deep:!0,immediate:!0});const $=w.ref(new Date().getTime().toString()+"article");w.onUnmounted(()=>{window.removeEventListener("search_posts_selected",W)}),w.onMounted(()=>{window.addEventListener("search_posts_selected",W)});const W=le=>{var te;if(le.detail.id==$.value){if(le.detail.result&&le.detail.posts.length>0){D.value.article.id=le.detail.posts[0].id,D.value.article.siteId=le.detail.posts[0].siteId,D.value.article.title=le.detail.posts[0].title,D.value.article.lead=le.detail.posts[0].lead;const _e=le.detail.posts[0].featuredImage;D.value.article.imageId=_e||kPt}(te=document.getElementById($.value))==null||te.close()}},ee=()=>{var le;(le=document.getElementById($.value))==null||le.showModal()},R=le=>{if(!document.querySelector(`script[src="${le}"]`)){let te=document.createElement("script");te.type="text/javascript",te.src=le,document.head.appendChild(te)}};return R(x.searchImageWidgetUrl),R(x.searchArticleWidgetUrl),(le,te)=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[w.createElementVNode("div",pPt,[w.createElementVNode("div",dPt,[w.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:te[0]||(te[0]=()=>ee())},"Cikk Választás")]),le.showIds?(w.openBlock(),w.createElementBlock("div",mPt,[w.createElementVNode("div",gPt,[w.createElementVNode("input",{type:"text",id:"articleId",class:"form-control",placeholder:"Cikk azonosító",disabled:"",value:D.value.article.id},null,8,hPt)]),w.createElementVNode("div",vPt,[w.createElementVNode("input",{type:"text",id:"articleSiteId",class:"form-control",placeholder:"Site azonosító",disabled:"",value:D.value.article.siteId},null,8,yPt)])])):w.createCommentVNode("",!0),w.createElementVNode("div",null,[te[5]||(te[5]=w.createElementVNode("label",{for:"articleTitle",class:"form-label"},"Címe",-1)),w.createElementVNode("textarea",{id:"articleTitle",class:"form-control",placeholder:"Címe",value:D.value.article.title,onInput:te[1]||(te[1]=_e=>{var Ve;return D.value.article.title=((Ve=_e.target)==null?void 0:Ve.value)||""})},null,40,bPt)]),w.createElementVNode("div",null,[te[6]||(te[6]=w.createElementVNode("label",{for:"articleLead",class:"form-label"},"Lead",-1)),w.createElementVNode("textarea",{id:"articleLead",class:"form-control",placeholder:"Lead",value:D.value.article.lead,onInput:te[2]||(te[2]=_e=>{var Ve;return D.value.article.lead=((Ve=_e.target)==null?void 0:Ve.value)||""})},null,40,SPt)]),w.createVNode($M,{modelValue:I.value,"onUpdate:modelValue":te[3]||(te[3]=_e=>I.value=_e),details:!1,editable:!1,"article-editor-url":x.articleEditorUrl,environment:x.environment,"search-image-widget-url":x.searchImageWidgetUrl,"image-base-url":x.imageBaseUrl,"image-view-id":x.imageViewId},null,8,["modelValue","article-editor-url","environment","search-image-widget-url","image-base-url","image-view-id"]),w.createVNode(oVe,{modelValue:D.value.format,"onUpdate:modelValue":te[4]||(te[4]=_e=>D.value.format=_e),options:x.formats,label:"Formátum"},null,8,["modelValue","options"])]),w.createElementVNode("dialog",{id:$.value,class:"w-100 h-100 p-0 border-none overflow-hidden"},[w.createElementVNode("search-posts-widget",{id:$.value,selector:"true",apiurl:x.searchArticleApiUrl,wpurl:"",searchurl:""},null,8,xPt)],8,TPt)],64))}}),CPt={class:"d-flex flex-column gap-2"},EPt=["value"],wPt=["value"],DPt=["value"],YTe=w.defineComponent({__name:"ExternalArticleOfferComponent",props:{modelValue:{},onArticleUrlChanged:{type:Function},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{},formats:{}},emits:["update:modelValue"],setup(l,{emit:u}){const _={article:{url:"",imageUrl:"",imageId:"",title:"",lead:""},format:""},g=u,x=l,D=w.ref(_),I=w.ref({id:D.value.article.imageId,url:"",source:"",title:"",isAdult:!1});w.watch(()=>x.modelValue,ee=>{ee?D.value=ee:D.value=_},{deep:!0,immediate:!0}),w.watch(()=>D,ee=>{g("update:modelValue",D.value),I.value.id=ee.value.article.imageId,I.value.url=ee.value.article.imageUrl},{deep:!0,immediate:!0}),w.watch(()=>I.value.id,ee=>{D.value.article.imageId=ee},{deep:!0,immediate:!0}),w.watch(()=>I.value.url,ee=>{D.value.article.imageUrl=ee},{deep:!0,immediate:!0});const $=ee=>{var R;D.value.article.url=((R=ee.target)==null?void 0:R.value)||"",D.value.article.url&&x.onArticleUrlChanged(D.value.article.url,le=>{D.value.article=le})};return(ee=>{if(!document.querySelector(`script[src="${ee}"]`)){let R=document.createElement("script");R.type="text/javascript",R.src=ee,document.head.appendChild(R)}})(x.searchImageWidgetUrl),(ee,R)=>(w.openBlock(),w.createElementBlock("div",CPt,[w.createElementVNode("div",null,[R[4]||(R[4]=w.createElementVNode("label",{for:"articleUrl",class:"form-label"},"Cikk URL",-1)),w.createElementVNode("textarea",{id:"articleUrl",class:"form-control",placeholder:"Cikk URL",value:D.value.article.url,onInput:$},null,40,EPt)]),w.createElementVNode("div",null,[R[5]||(R[5]=w.createElementVNode("label",{for:"articleTitle",class:"form-label"},"Címe",-1)),w.createElementVNode("textarea",{id:"articleTitle",class:"form-control",placeholder:"Címe",value:D.value.article.title,onInput:R[0]||(R[0]=le=>{var te;return D.value.article.title=((te=le.target)==null?void 0:te.value)||""})},null,40,wPt)]),w.createElementVNode("div",null,[R[6]||(R[6]=w.createElementVNode("label",{for:"articleLead",class:"form-label"},"Lead",-1)),w.createElementVNode("textarea",{id:"articleLead",class:"form-control",placeholder:"Lead",value:D.value.article.lead,onInput:R[1]||(R[1]=le=>{var te;return D.value.article.lead=((te=le.target)==null?void 0:te.value)||""})},null,40,DPt)]),w.createVNode($M,{modelValue:I.value,"onUpdate:modelValue":R[2]||(R[2]=le=>I.value=le),details:!1,editable:!1,"article-editor-url":x.articleEditorUrl,environment:x.environment,"search-image-widget-url":x.searchImageWidgetUrl,"image-base-url":x.imageBaseUrl,"image-view-id":x.imageViewId},null,8,["modelValue","article-editor-url","environment","search-image-widget-url","image-base-url","image-view-id"]),w.createVNode(oVe,{modelValue:D.value.format,"onUpdate:modelValue":R[3]||(R[3]=le=>D.value.format=le),options:x.formats,label:"Formátum"},null,8,["modelValue","options"])]))}});function cVe(l,u){return function(){return l.apply(u,arguments)}}const{toString:APt}=Object.prototype,{getPrototypeOf:XTe}=Object,{iterator:Fne,toStringTag:lVe}=Symbol,Mne=(l=>u=>{const _=APt.call(u);return l[_]||(l[_]=_.slice(8,-1).toLowerCase())})(Object.create(null)),oC=l=>(l=l.toLowerCase(),u=>Mne(u)===l),Lne=l=>u=>typeof u===l,{isArray:JM}=Array,IM=Lne("undefined");function pq(l){return l!==null&&!IM(l)&&l.constructor!==null&&!IM(l.constructor)&&_2(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const uVe=oC("ArrayBuffer");function PPt(l){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(l):u=l&&l.buffer&&uVe(l.buffer),u}const NPt=Lne("string"),_2=Lne("function"),fVe=Lne("number"),dq=l=>l!==null&&typeof l=="object",IPt=l=>l===!0||l===!1,Yre=l=>{if(Mne(l)!=="object")return!1;const u=XTe(l);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(lVe in l)&&!(Fne in l)},OPt=l=>{if(!dq(l)||pq(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},FPt=oC("Date"),MPt=oC("File"),LPt=oC("Blob"),RPt=oC("FileList"),jPt=l=>dq(l)&&_2(l.pipe),BPt=l=>{let u;return l&&(typeof FormData=="function"&&l instanceof FormData||_2(l.append)&&((u=Mne(l))==="formdata"||u==="object"&&_2(l.toString)&&l.toString()==="[object FormData]"))},$Pt=oC("URLSearchParams"),[JPt,UPt,zPt,qPt]=["ReadableStream","Request","Response","Headers"].map(oC),VPt=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mq(l,u,{allOwnKeys:_=!1}={}){if(l===null||typeof l>"u")return;let g,x;if(typeof l!="object"&&(l=[l]),JM(l))for(g=0,x=l.length;g<x;g++)u.call(null,l[g],g,l);else{if(pq(l))return;const D=_?Object.getOwnPropertyNames(l):Object.keys(l),I=D.length;let $;for(g=0;g<I;g++)$=D[g],u.call(null,l[$],$,l)}}function _Ve(l,u){if(pq(l))return null;u=u.toLowerCase();const _=Object.keys(l);let g=_.length,x;for(;g-- >0;)if(x=_[g],u===x.toLowerCase())return x;return null}const F8=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,pVe=l=>!IM(l)&&l!==F8;function aTe(){const{caseless:l,skipUndefined:u}=pVe(this)&&this||{},_={},g=(x,D)=>{const I=l&&_Ve(_,D)||D;Yre(_[I])&&Yre(x)?_[I]=aTe(_[I],x):Yre(x)?_[I]=aTe({},x):JM(x)?_[I]=x.slice():(!u||!IM(x))&&(_[I]=x)};for(let x=0,D=arguments.length;x<D;x++)arguments[x]&&mq(arguments[x],g);return _}const WPt=(l,u,_,{allOwnKeys:g}={})=>(mq(u,(x,D)=>{_&&_2(x)?l[D]=cVe(x,_):l[D]=x},{allOwnKeys:g}),l),HPt=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),GPt=(l,u,_,g)=>{l.prototype=Object.create(u.prototype,g),l.prototype.constructor=l,Object.defineProperty(l,"super",{value:u.prototype}),_&&Object.assign(l.prototype,_)},YPt=(l,u,_,g)=>{let x,D,I;const $={};if(u=u||{},l==null)return u;do{for(x=Object.getOwnPropertyNames(l),D=x.length;D-- >0;)I=x[D],(!g||g(I,l,u))&&!$[I]&&(u[I]=l[I],$[I]=!0);l=_!==!1&&XTe(l)}while(l&&(!_||_(l,u))&&l!==Object.prototype);return u},XPt=(l,u,_)=>{l=String(l),(_===void 0||_>l.length)&&(_=l.length),_-=u.length;const g=l.indexOf(u,_);return g!==-1&&g===_},QPt=l=>{if(!l)return null;if(JM(l))return l;let u=l.length;if(!fVe(u))return null;const _=new Array(u);for(;u-- >0;)_[u]=l[u];return _},KPt=(l=>u=>l&&u instanceof l)(typeof Uint8Array<"u"&&XTe(Uint8Array)),ZPt=(l,u)=>{const g=(l&&l[Fne]).call(l);let x;for(;(x=g.next())&&!x.done;){const D=x.value;u.call(l,D[0],D[1])}},e3t=(l,u)=>{let _;const g=[];for(;(_=l.exec(u))!==null;)g.push(_);return g},t3t=oC("HTMLFormElement"),r3t=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(_,g,x){return g.toUpperCase()+x}),wUe=(({hasOwnProperty:l})=>(u,_)=>l.call(u,_))(Object.prototype),n3t=oC("RegExp"),dVe=(l,u)=>{const _=Object.getOwnPropertyDescriptors(l),g={};mq(_,(x,D)=>{let I;(I=u(x,D,l))!==!1&&(g[D]=I||x)}),Object.defineProperties(l,g)},i3t=l=>{dVe(l,(u,_)=>{if(_2(l)&&["arguments","caller","callee"].indexOf(_)!==-1)return!1;const g=l[_];if(_2(g)){if(u.enumerable=!1,"writable"in u){u.writable=!1;return}u.set||(u.set=()=>{throw Error("Can not rewrite read-only method '"+_+"'")})}})},a3t=(l,u)=>{const _={},g=x=>{x.forEach(D=>{_[D]=!0})};return JM(l)?g(l):g(String(l).split(u)),_},s3t=()=>{},o3t=(l,u)=>l!=null&&Number.isFinite(l=+l)?l:u;function c3t(l){return!!(l&&_2(l.append)&&l[lVe]==="FormData"&&l[Fne])}const l3t=l=>{const u=new Array(10),_=(g,x)=>{if(dq(g)){if(u.indexOf(g)>=0)return;if(pq(g))return g;if(!("toJSON"in g)){u[x]=g;const D=JM(g)?[]:{};return mq(g,(I,$)=>{const W=_(I,x+1);!IM(W)&&(D[$]=W)}),u[x]=void 0,D}}return g};return _(l,0)},u3t=oC("AsyncFunction"),f3t=l=>l&&(dq(l)||_2(l))&&_2(l.then)&&_2(l.catch),mVe=((l,u)=>l?setImmediate:u?((_,g)=>(F8.addEventListener("message",({source:x,data:D})=>{x===F8&&D===_&&g.length&&g.shift()()},!1),x=>{g.push(x),F8.postMessage(_,"*")}))(`axios@${Math.random()}`,[]):_=>setTimeout(_))(typeof setImmediate=="function",_2(F8.postMessage)),_3t=typeof queueMicrotask<"u"?queueMicrotask.bind(F8):typeof process<"u"&&process.nextTick||mVe,p3t=l=>l!=null&&_2(l[Fne]),Pi={isArray:JM,isArrayBuffer:uVe,isBuffer:pq,isFormData:BPt,isArrayBufferView:PPt,isString:NPt,isNumber:fVe,isBoolean:IPt,isObject:dq,isPlainObject:Yre,isEmptyObject:OPt,isReadableStream:JPt,isRequest:UPt,isResponse:zPt,isHeaders:qPt,isUndefined:IM,isDate:FPt,isFile:MPt,isBlob:LPt,isRegExp:n3t,isFunction:_2,isStream:jPt,isURLSearchParams:$Pt,isTypedArray:KPt,isFileList:RPt,forEach:mq,merge:aTe,extend:WPt,trim:VPt,stripBOM:HPt,inherits:GPt,toFlatObject:YPt,kindOf:Mne,kindOfTest:oC,endsWith:XPt,toArray:QPt,forEachEntry:ZPt,matchAll:e3t,isHTMLForm:t3t,hasOwnProperty:wUe,hasOwnProp:wUe,reduceDescriptors:dVe,freezeMethods:i3t,toObjectSet:a3t,toCamelCase:r3t,noop:s3t,toFiniteNumber:o3t,findKey:_Ve,global:F8,isContextDefined:pVe,isSpecCompliantForm:c3t,toJSONObject:l3t,isAsyncFn:u3t,isThenable:f3t,setImmediate:mVe,asap:_3t,isIterable:p3t};function ru(l,u,_,g,x){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=l,this.name="AxiosError",u&&(this.code=u),_&&(this.config=_),g&&(this.request=g),x&&(this.response=x,this.status=x.status?x.status:null)}Pi.inherits(ru,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Pi.toJSONObject(this.config),code:this.code,status:this.status}}});const gVe=ru.prototype,hVe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(l=>{hVe[l]={value:l}});Object.defineProperties(ru,hVe);Object.defineProperty(gVe,"isAxiosError",{value:!0});ru.from=(l,u,_,g,x,D)=>{const I=Object.create(gVe);Pi.toFlatObject(l,I,function(R){return R!==Error.prototype},ee=>ee!=="isAxiosError");const $=l&&l.message?l.message:"Error",W=u==null&&l?l.code:u;return ru.call(I,$,W,_,g,x),l&&I.cause==null&&Object.defineProperty(I,"cause",{value:l,configurable:!0}),I.name=l&&l.name||"Error",D&&Object.assign(I,D),I};const d3t=null;function sTe(l){return Pi.isPlainObject(l)||Pi.isArray(l)}function vVe(l){return Pi.endsWith(l,"[]")?l.slice(0,-2):l}function DUe(l,u,_){return l?l.concat(u).map(function(x,D){return x=vVe(x),!_&&D?"["+x+"]":x}).join(_?".":""):u}function m3t(l){return Pi.isArray(l)&&!l.some(sTe)}const g3t=Pi.toFlatObject(Pi,{},null,function(u){return/^is[A-Z]/.test(u)});function Rne(l,u,_){if(!Pi.isObject(l))throw new TypeError("target must be an object");u=u||new FormData,_=Pi.toFlatObject(_,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Xe,et){return!Pi.isUndefined(et[Xe])});const g=_.metaTokens,x=_.visitor||R,D=_.dots,I=_.indexes,W=(_.Blob||typeof Blob<"u"&&Blob)&&Pi.isSpecCompliantForm(u);if(!Pi.isFunction(x))throw new TypeError("visitor must be a function");function ee(Ve){if(Ve===null)return"";if(Pi.isDate(Ve))return Ve.toISOString();if(Pi.isBoolean(Ve))return Ve.toString();if(!W&&Pi.isBlob(Ve))throw new ru("Blob is not supported. Use a Buffer instead.");return Pi.isArrayBuffer(Ve)||Pi.isTypedArray(Ve)?W&&typeof Blob=="function"?new Blob([Ve]):Buffer.from(Ve):Ve}function R(Ve,Xe,et){let bt=Ve;if(Ve&&!et&&typeof Ve=="object"){if(Pi.endsWith(Xe,"{}"))Xe=g?Xe:Xe.slice(0,-2),Ve=JSON.stringify(Ve);else if(Pi.isArray(Ve)&&m3t(Ve)||(Pi.isFileList(Ve)||Pi.endsWith(Xe,"[]"))&&(bt=Pi.toArray(Ve)))return Xe=vVe(Xe),bt.forEach(function(ht,rt){!(Pi.isUndefined(ht)||ht===null)&&u.append(I===!0?DUe([Xe],rt,D):I===null?Xe:Xe+"[]",ee(ht))}),!1}return sTe(Ve)?!0:(u.append(DUe(et,Xe,D),ee(Ve)),!1)}const le=[],te=Object.assign(g3t,{defaultVisitor:R,convertValue:ee,isVisitable:sTe});function _e(Ve,Xe){if(!Pi.isUndefined(Ve)){if(le.indexOf(Ve)!==-1)throw Error("Circular reference detected in "+Xe.join("."));le.push(Ve),Pi.forEach(Ve,function(bt,pt){(!(Pi.isUndefined(bt)||bt===null)&&x.call(u,bt,Pi.isString(pt)?pt.trim():pt,Xe,te))===!0&&_e(bt,Xe?Xe.concat(pt):[pt])}),le.pop()}}if(!Pi.isObject(l))throw new TypeError("data must be an object");return _e(l),u}function AUe(l){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(g){return u[g]})}function QTe(l,u){this._pairs=[],l&&Rne(l,this,u)}const yVe=QTe.prototype;yVe.append=function(u,_){this._pairs.push([u,_])};yVe.toString=function(u){const _=u?function(g){return u.call(this,g,AUe)}:AUe;return this._pairs.map(function(x){return _(x[0])+"="+_(x[1])},"").join("&")};function h3t(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function bVe(l,u,_){if(!u)return l;const g=_&&_.encode||h3t;Pi.isFunction(_)&&(_={serialize:_});const x=_&&_.serialize;let D;if(x?D=x(u,_):D=Pi.isURLSearchParams(u)?u.toString():new QTe(u,_).toString(g),D){const I=l.indexOf("#");I!==-1&&(l=l.slice(0,I)),l+=(l.indexOf("?")===-1?"?":"&")+D}return l}class PUe{constructor(){this.handlers=[]}use(u,_,g){return this.handlers.push({fulfilled:u,rejected:_,synchronous:g?g.synchronous:!1,runWhen:g?g.runWhen:null}),this.handlers.length-1}eject(u){this.handlers[u]&&(this.handlers[u]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(u){Pi.forEach(this.handlers,function(g){g!==null&&u(g)})}}const SVe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},v3t=typeof URLSearchParams<"u"?URLSearchParams:QTe,y3t=typeof FormData<"u"?FormData:null,b3t=typeof Blob<"u"?Blob:null,S3t={isBrowser:!0,classes:{URLSearchParams:v3t,FormData:y3t,Blob:b3t},protocols:["http","https","file","blob","url","data"]},KTe=typeof window<"u"&&typeof document<"u",oTe=typeof navigator=="object"&&navigator||void 0,T3t=KTe&&(!oTe||["ReactNative","NativeScript","NS"].indexOf(oTe.product)<0),x3t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",k3t=KTe&&window.location.href||"http://localhost",C3t=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:KTe,hasStandardBrowserEnv:T3t,hasStandardBrowserWebWorkerEnv:x3t,navigator:oTe,origin:k3t},Symbol.toStringTag,{value:"Module"})),jy={...C3t,...S3t};function E3t(l,u){return Rne(l,new jy.classes.URLSearchParams,{visitor:function(_,g,x,D){return jy.isNode&&Pi.isBuffer(_)?(this.append(g,_.toString("base64")),!1):D.defaultVisitor.apply(this,arguments)},...u})}function w3t(l){return Pi.matchAll(/\w+|\[(\w*)]/g,l).map(u=>u[0]==="[]"?"":u[1]||u[0])}function D3t(l){const u={},_=Object.keys(l);let g;const x=_.length;let D;for(g=0;g<x;g++)D=_[g],u[D]=l[D];return u}function TVe(l){function u(_,g,x,D){let I=_[D++];if(I==="__proto__")return!0;const $=Number.isFinite(+I),W=D>=_.length;return I=!I&&Pi.isArray(x)?x.length:I,W?(Pi.hasOwnProp(x,I)?x[I]=[x[I],g]:x[I]=g,!$):((!x[I]||!Pi.isObject(x[I]))&&(x[I]=[]),u(_,g,x[I],D)&&Pi.isArray(x[I])&&(x[I]=D3t(x[I])),!$)}if(Pi.isFormData(l)&&Pi.isFunction(l.entries)){const _={};return Pi.forEachEntry(l,(g,x)=>{u(w3t(g),x,_,0)}),_}return null}function A3t(l,u,_){if(Pi.isString(l))try{return(u||JSON.parse)(l),Pi.trim(l)}catch(g){if(g.name!=="SyntaxError")throw g}return(_||JSON.stringify)(l)}const gq={transitional:SVe,adapter:["xhr","http","fetch"],transformRequest:[function(u,_){const g=_.getContentType()||"",x=g.indexOf("application/json")>-1,D=Pi.isObject(u);if(D&&Pi.isHTMLForm(u)&&(u=new FormData(u)),Pi.isFormData(u))return x?JSON.stringify(TVe(u)):u;if(Pi.isArrayBuffer(u)||Pi.isBuffer(u)||Pi.isStream(u)||Pi.isFile(u)||Pi.isBlob(u)||Pi.isReadableStream(u))return u;if(Pi.isArrayBufferView(u))return u.buffer;if(Pi.isURLSearchParams(u))return _.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),u.toString();let $;if(D){if(g.indexOf("application/x-www-form-urlencoded")>-1)return E3t(u,this.formSerializer).toString();if(($=Pi.isFileList(u))||g.indexOf("multipart/form-data")>-1){const W=this.env&&this.env.FormData;return Rne($?{"files[]":u}:u,W&&new W,this.formSerializer)}}return D||x?(_.setContentType("application/json",!1),A3t(u)):u}],transformResponse:[function(u){const _=this.transitional||gq.transitional,g=_&&_.forcedJSONParsing,x=this.responseType==="json";if(Pi.isResponse(u)||Pi.isReadableStream(u))return u;if(u&&Pi.isString(u)&&(g&&!this.responseType||x)){const I=!(_&&_.silentJSONParsing)&&x;try{return JSON.parse(u,this.parseReviver)}catch($){if(I)throw $.name==="SyntaxError"?ru.from($,ru.ERR_BAD_RESPONSE,this,null,this.response):$}}return u}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:jy.classes.FormData,Blob:jy.classes.Blob},validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Pi.forEach(["delete","get","head","post","put","patch"],l=>{gq.headers[l]={}});const P3t=Pi.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),N3t=l=>{const u={};let _,g,x;return l&&l.split(`
12
+ */let kUe=!1;const eTe=w.reactive(V6t()),z6t={install:function(l,u={}){if(kUe)return;kUe=!0;const _={config:window.__BASEURL__?`${window.__BASEURL__}/config`:"/config",init:{onLoad:"login-required"}},g=Object.assign({},_,u),x=H6t(g);if(x.hasError)throw new Error(`Invalid options given: ${x.error}`);if(l.config.globalProperties.$keycloak=w.readonly(eTe),!g.config)throw new Error("Keycloak config is required");G6t(g.config).then(D=>{W6t(D,eTe,g)}).catch(D=>{console.log(D)})}};function q6t(){return w.readonly(eTe)}function V6t(){return{ready:!1,authenticated:!1,userName:void 0,fullName:void 0,token:void 0,tokenParsed:void 0,logoutFn:void 0,loginFn:void 0,login:void 0,createLoginUrl:void 0,createLogoutUrl:void 0,createRegisterUrl:void 0,register:void 0,accountManagement:void 0,createAccountUrl:void 0,loadUserProfile:void 0,subject:void 0,idToken:void 0,idTokenParsed:void 0,realmAccess:void 0,resourceAccess:void 0,refreshToken:void 0,refreshTokenParsed:void 0,timeSkew:void 0,responseMode:void 0,responseType:void 0,hasRealmRole:void 0,hasResourceRole:void 0,keycloak:void 0}}async function W6t(l,u,_){const g=new Gqe(l),{updateInterval:x,autoRefreshToken:D=!0}=_;function I($=!1){u.authenticated=$,u.loginFn=g.login,u.login=g.login,u.createLoginUrl=g.createLoginUrl,u.createLogoutUrl=g.createLogoutUrl,u.createRegisterUrl=g.createRegisterUrl,u.register=g.register,u.keycloak=g,$&&(u.accountManagement=g.accountManagement,u.createAccountUrl=g.createAccountUrl,u.hasRealmRole=g.hasRealmRole,u.hasResourceRole=g.hasResourceRole,u.loadUserProfile=g.loadUserProfile,u.token=g.token,u.subject=g.subject,u.idToken=g.idToken,u.idTokenParsed=g.idTokenParsed,u.realmAccess=g.realmAccess,u.resourceAccess=g.resourceAccess,u.refreshToken=g.refreshToken,u.refreshTokenParsed=g.refreshTokenParsed,u.timeSkew=g.timeSkew,u.responseMode=g.responseMode,u.responseType=g.responseType,u.tokenParsed=g.tokenParsed,u.userName=g.tokenParsed.preferred_username,u.fullName=g.tokenParsed.name)}g.onReady=function($){I($),u.ready=!0,typeof _.onReady=="function"&&_.onReady(g,u)},g.onAuthSuccess=function(){let $;D&&($=setInterval(()=>{g.updateToken(60).then(W=>{var ee;(ee=_.init)!=null&&ee.enableLogging&&console.log(`[vue-keycloak-js] Token ${W?"updated":"not updated"}`)}).catch(W=>{var ee;(ee=_.init)!=null&&ee.enableLogging&&console.log(`[vue-keycloak-js] Error while updating token: ${W}`),g.clearToken()})},x??1e4)),u.logoutFn=()=>($&&clearInterval($),g.logout(_.logout))},g.onAuthRefreshSuccess=function(){I(!0),typeof _.onAuthRefreshSuccess=="function"&&_.onAuthRefreshSuccess(g)},g.onAuthRefreshError=function(){I(!1),typeof _.onAuthRefreshError=="function"&&_.onAuthRefreshError(g)},g.onAuthLogout=function(){I(!1),typeof _.onAuthLogout=="function"&&_.onAuthLogout(g)};try{const $=await g.init(_.init);I($),typeof _.onInitSuccess=="function"&&_.onInitSuccess($)}catch($){I(!1);const W=new Error("Failure during initialization of keycloak-js adapter",{cause:$});typeof _.onInitError=="function"?_.onInitError(W,$):console.error(W,$)}}function H6t(l){const{config:u,init:_,onReady:g,onInitError:x,onAuthRefreshError:D,onAuthLogout:I}=l;return typeof u!="string"&&!tTe(u)?{hasError:!0,error:`'config' option must be a string or an object. Found: '${typeof u}'`}:!tTe(_)||typeof(_==null?void 0:_.onLoad)!="string"?{hasError:!0,error:`'init' option must be an object with an 'onLoad' property. Found: '${_}'`}:g&&typeof g!="function"?{hasError:!0,error:`'onReady' option must be a function. Found: '${typeof g}'`}:x&&typeof x!="function"?{hasError:!0,error:`'onInitError' option must be a function. Found: '${typeof x}'`}:D&&typeof D!="function"?{hasError:!0,error:`'onAuthRefreshError' option must be a function. Found: '${typeof D}'`}:I&&typeof I!="function"?{hasError:!0,error:`'onAuthLogout' option must be a function. Found: '${typeof I}'`}:{hasError:!1,error:null}}function G6t(l){return tTe(l)?Promise.resolve(l):fetch(l,{headers:{Accept:"application/json"}}).then(u=>{if(!u.ok)throw new Error(`Failed to fetch config: ${u.statusText}`);return u.json()})}function tTe(l){return l!==null&&typeof l=="object"&&Object.prototype.toString.call(l)!=="[object Array]"}function Yqe(l){return w.getCurrentScope()?(w.onScopeDispose(l),!0):!1}function pSe(){const l=new Set,u=D=>{l.delete(D)};return{on:D=>{l.add(D);const I=()=>u(D);return Yqe(I),{off:I}},off:u,trigger:(...D)=>Promise.all(Array.from(l).map(I=>I(...D))),clear:()=>{l.clear()}}}const Xqe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Y6t=()=>{};function dSe(...l){if(l.length!==1)return w.toRef(...l);const u=l[0];return typeof u=="function"?w.readonly(w.customRef(()=>({get:u,set:Y6t}))):w.ref(u)}function CUe(l,u=!1,_="Timeout"){return new Promise((g,x)=>{setTimeout(u?()=>x(_):g,l)})}function X6t(l,...u){return u.some(_=>_ in l)}function rTe(l,u=!1){function _(le,{flush:te="sync",deep:_e=!1,timeout:Ve,throwOnTimeout:Xe}={}){let et=null;const pt=[new Promise(ht=>{et=w.watch(l,rt=>{le(rt)!==u&&(et?et():w.nextTick(()=>et==null?void 0:et()),ht(rt))},{flush:te,deep:_e,immediate:!0})})];return Ve!=null&&pt.push(CUe(Ve,Xe).then(()=>w.toValue(l)).finally(()=>et==null?void 0:et())),Promise.race(pt)}function g(le,te){if(!w.isRef(le))return _(rt=>rt===le,te);const{flush:_e="sync",deep:Ve=!1,timeout:Xe,throwOnTimeout:et}=te??{};let bt=null;const ht=[new Promise(rt=>{bt=w.watch([l,le],([St,hr])=>{u!==(St===hr)&&(bt?bt():w.nextTick(()=>bt==null?void 0:bt()),rt(St))},{flush:_e,deep:Ve,immediate:!0})})];return Xe!=null&&ht.push(CUe(Xe,et).then(()=>w.toValue(l)).finally(()=>(bt==null||bt(),w.toValue(l)))),Promise.race(ht)}function x(le){return _(te=>!!te,le)}function D(le){return g(null,le)}function I(le){return g(void 0,le)}function $(le){return _(Number.isNaN,le)}function W(le,te){return _(_e=>{const Ve=Array.from(_e);return Ve.includes(le)||Ve.includes(w.toValue(le))},te)}function ee(le){return R(1,le)}function R(le=1,te){let _e=-1;return _(()=>(_e+=1,_e>=le),te)}return Array.isArray(w.toValue(l))?{toMatch:_,toContains:W,changed:ee,changedTimes:R,get not(){return rTe(l,!u)}}:{toMatch:_,toBe:g,toBeTruthy:x,toBeNull:D,toBeNaN:$,toBeUndefined:I,changed:ee,changedTimes:R,get not(){return rTe(l,!u)}}}function Q6t(l){return rTe(l)}function K6t(l,u,_={}){const{immediate:g=!0,immediateCallback:x=!1}=_,D=w.shallowRef(!1);let I;function $(){I&&(clearTimeout(I),I=void 0)}function W(){D.value=!1,$()}function ee(...R){x&&l(),$(),D.value=!0,I=setTimeout(()=>{D.value=!1,I=void 0,l(...R)},w.toValue(u))}return g&&(D.value=!0,Xqe&&ee()),Yqe(W),{isPending:w.shallowReadonly(D),start:ee,stop:W}}const Z6t=Xqe?window:void 0,eAt={json:"application/json",text:"text/plain"};function fne(l){return l&&X6t(l,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}const tAt=/^(?:[a-z][a-z\d+\-.]*:)?\/\//i;function rAt(l){return tAt.test(l)}function Hz(l){return typeof Headers<"u"&&l instanceof Headers?Object.fromEntries(l.entries()):l}function _M(l,...u){return l==="overwrite"?async _=>{let g;for(let x=u.length-1;x>=0;x--)if(u[x]!=null){g=u[x];break}return g?{..._,...await g(_)}:_}:async _=>{for(const g of u)g&&(_={..._,...await g(_)});return _}}function nAt(l={}){const u=l.combination||"chain",_=l.options||{},g=l.fetchOptions||{};function x(D,...I){const $=w.computed(()=>{const R=w.toValue(l.baseUrl),le=w.toValue(D);return R&&!rAt(le)?aAt(R,le):le});let W=_,ee=g;return I.length>0&&(fne(I[0])?W={...W,...I[0],beforeFetch:_M(u,_.beforeFetch,I[0].beforeFetch),afterFetch:_M(u,_.afterFetch,I[0].afterFetch),onFetchError:_M(u,_.onFetchError,I[0].onFetchError)}:ee={...ee,...I[0],headers:{...Hz(ee.headers)||{},...Hz(I[0].headers)||{}}}),I.length>1&&fne(I[1])&&(W={...W,...I[1],beforeFetch:_M(u,_.beforeFetch,I[1].beforeFetch),afterFetch:_M(u,_.afterFetch,I[1].afterFetch),onFetchError:_M(u,_.onFetchError,I[1].onFetchError)}),iAt($,ee,W)}return x}function iAt(l,...u){var _,g;const x=typeof AbortController=="function";let D={},I={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const $={method:"GET",type:"text",payload:void 0};u.length>0&&(fne(u[0])?I={...I,...u[0]}:D=u[0]),u.length>1&&fne(u[1])&&(I={...I,...u[1]});const{fetch:W=(g=(_=Z6t)==null?void 0:_.fetch)!=null?g:globalThis==null?void 0:globalThis.fetch,initialData:ee,timeout:R}=I,le=pSe(),te=pSe(),_e=pSe(),Ve=w.shallowRef(!1),Xe=w.shallowRef(!1),et=w.shallowRef(!1),bt=w.shallowRef(null),pt=w.shallowRef(null),ht=w.shallowRef(null),rt=w.shallowRef(ee||null),St=w.computed(()=>x&&Xe.value);let hr,$t;const or=Sn=>{x&&(hr==null||hr.abort(Sn),hr=new AbortController,hr.signal.onabort=()=>et.value=!0,D={...D,signal:hr.signal})},Vt=Sn=>{Xe.value=Sn,Ve.value=!Sn};R&&($t=K6t(or,R,{immediate:!1}));let mn=0;const vn=async(Sn=!1)=>{var cn,pn;or(),Vt(!0),ht.value=null,bt.value=null,et.value=!1,mn+=1;const Ft=mn,Sr={method:$.method,headers:{}},yn=w.toValue($.payload);if(yn){const Ar=Hz(Sr.headers),$r=Object.getPrototypeOf(yn);!$.payloadType&&yn&&($r===Object.prototype||Array.isArray($r))&&!(yn instanceof FormData)&&($.payloadType="json"),$.payloadType&&(Ar["Content-Type"]=(cn=eAt[$.payloadType])!=null?cn:$.payloadType),Sr.body=$.payloadType==="json"?JSON.stringify(yn):yn}let Bn=!1;const Or={url:w.toValue(l),options:{...Sr,...D},cancel:()=>{Bn=!0}};if(I.beforeFetch&&Object.assign(Or,await I.beforeFetch(Or)),Bn||!W)return Vt(!1),Promise.resolve(null);let Yr=null;return $t&&$t.start(),W(Or.url,{...Sr,...Or.options,headers:{...Hz(Sr.headers),...Hz((pn=Or.options)==null?void 0:pn.headers)}}).then(async Ar=>{if(pt.value=Ar,bt.value=Ar.status,Yr=await Ar.clone()[$.type](),!Ar.ok)throw rt.value=ee||null,new Error(Ar.statusText);return I.afterFetch&&({data:Yr}=await I.afterFetch({data:Yr,response:Ar,context:Or,execute:vn})),rt.value=Yr,le.trigger(Ar),Ar}).catch(async Ar=>{let $r=Ar.message||Ar.name;if(I.onFetchError&&({error:$r,data:Yr}=await I.onFetchError({data:Yr,error:Ar,response:pt.value,context:Or,execute:vn})),ht.value=$r,I.updateDataOnError&&(rt.value=Yr),te.trigger(Ar),Sn)throw Ar;return null}).finally(()=>{Ft===mn&&Vt(!1),$t&&$t.stop(),_e.trigger(null)})},sr=dSe(I.refetch);w.watch([sr,dSe(l)],([Sn])=>Sn&&vn(),{deep:!0});const Oi={isFinished:w.readonly(Ve),isFetching:w.readonly(Xe),statusCode:bt,response:pt,error:ht,data:rt,canAbort:St,aborted:et,abort:or,execute:vn,onFetchResponse:le.on,onFetchError:te.on,onFetchFinally:_e.on,get:ci("GET"),put:ci("PUT"),post:ci("POST"),delete:ci("DELETE"),patch:ci("PATCH"),head:ci("HEAD"),options:ci("OPTIONS"),json:ei("json"),text:ei("text"),blob:ei("blob"),arrayBuffer:ei("arrayBuffer"),formData:ei("formData")};function ci(Sn){return(cn,pn)=>{if(!Xe.value)return $.method=Sn,$.payload=cn,$.payloadType=pn,w.isRef($.payload)&&w.watch([sr,dSe($.payload)],([Ft])=>Ft&&vn(),{deep:!0}),{...Oi,then(Ft,Sr){return Dt().then(Ft,Sr)}}}}function Dt(){return new Promise((Sn,cn)=>{Q6t(Ve).toBe(!0).then(()=>Sn(Oi)).catch(cn)})}function ei(Sn){return()=>{if(!Xe.value)return $.type=Sn,{...Oi,then(cn,pn){return Dt().then(cn,pn)}}}}return I.immediate&&Promise.resolve().then(()=>vn()),{...Oi,then(Sn,cn){return Dt().then(Sn,cn)}}}function aAt(l,u){return!l.endsWith("/")&&!u.startsWith("/")?`${l}/${u}`:l.endsWith("/")&&u.startsWith("/")?`${l.slice(0,-1)}${u}`:`${l}${u}`}class One{constructor(u,_){mh(this,"title");mh(this,"message");this.title=u,this.message=_}}var _w=(l=>(l[l.GET=0]="GET",l[l.GET_TEXT=1]="GET_TEXT",l[l.POST=2]="POST",l[l.POST_TEXT=3]="POST_TEXT",l[l.PUT=4]="PUT",l[l.PUT_TEXT=5]="PUT_TEXT",l[l.PATCH=6]="PATCH",l[l.DELETE=7]="DELETE",l))(_w||{});class JP{constructor(u,_,g,x,D="application/json",I,$){mh(this,"fetchMethode");mh(this,"isIpInUrl",u=>/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/.test(u));this.relativeUrl=_,this.method=g,console.info("sendKeycloakBearer: ",$),this.fetchMethode=nAt({baseUrl:u,fetchOptions:{credentials:u.indexOf("localhost")!=-1||this.isIpInUrl(u)?"omit":"include"},options:{immediate:!1,beforeFetch:async W=>{var ee;if(D&&(W.options.headers={"Content-Type":D}),I&&(W.options.headers={...W.options.headers,...I}),$){console.info("initializing keycloak bearer...");const R=q6t();await((ee=R.keycloak)==null?void 0:ee.updateToken()),console.info("got token: ",R.token),W.options.headers={...W.options.headers,Authorization:R.token}}},onFetchError:W=>{let ee="Ismeretlen eredetű hiba!",R=!W.response;return W.response&&(W.response.ok||(R=!0,ee=x.get(W.response.status),ee||(ee=`${_w[g]} for Call: ${_} with Status: ${W.response.status} has no registered errorMessages!`,console.error(ee)))),R&&window.dispatchEvent(new CustomEvent("fetch-error",{detail:new One("Hiba a szerver elérése közben...",ee)})),W},afterFetch:W=>W}})}}function UP(l,u,_,g,x){const D={};return D.payload=w.ref(u),D.routeParams=w.ref(_),D.queryParams=w.ref(g),D.isFetching=w.ref(!1),D.data=w.ref(),D.sendKeycloakBearer=w.ref(x===void 0?!1:x),D.execute=()=>{D.fetch&&D.fetch.canAbort.value&&D.fetch.abort();const I=`${sAt(l.relativeUrl,D.routeParams.value,D.queryParams.value)}`,$=l.fetchMethode(I);let W;const ee=$.isFetching;function R(){le()&&D.successCallback?D.successCallback(D.data.value):!le()&&D.errorCallback&&(console.log(D.fetch.error.value),D.errorCallback(new One(D.fetch.error.value))),D.finallyCallback&&D.finallyCallback()}function le(){return D.fetch.statusCode&&D.fetch.statusCode.value>=200&&D.fetch.statusCode.value<=299}switch(l.method){case 0:W=$.get().json().data;break;case 1:W=$.get().text().data;break;case 4:W=$.put(D.payload).json().data;break;case 5:W=$.put(D.payload).text().data;break;case 3:W=$.post(D.payload).text().data;break;case 2:W=$.post(D.payload).json().data;break;case 6:W=$.patch(D.payload).json().data;break;case 7:W=$.delete(D.payload).json().data;break;default:throw new Error(`Method: ${l.method} is not implemented!`)}w.watch(W,te=>{D.data.value=te}),w.watch(ee,te=>{D.isFetching.value=te,te||R()}),D.fetch=$,$.execute()},D}function sAt(l,u,_){let g=l;return g||(g=""),g.slice(-1)==="/"&&(g=g.substring(0,g.length-1)),u&&Object.keys(u).forEach(x=>{if(g.indexOf(`{${x}}`)===-1)throw window.dispatchEvent(new CustomEvent("fetch-error",{detail:new One("Hiba!",`RouteParams: ${x} not found in url: ${g}! Contact the developers!`)})),new Error(`RouteParams: ${x} not found in url: ${g}! Contact the developers!`);const D=u[x];g=g.replace(`{${x}}`,D)}),_&&(g.indexOf("?")===-1&&(g+="?"),Object.keys(_).forEach(x=>{const D=_[x];g+=`${x}=${D}`})),g}const oAt=l=>{if(l=="NaN-NaN-NaN"||!l)return null;const u=new Date(Date.parse(l));return`${u.getFullYear()}-${(u.getMonth()+1).toString().padStart(2,"0")}-${u.getDate().toString().padStart(2,"0")}`},cAt=l=>{if(!l)return"-";const u=new Date(Date.parse(l));return`${u.getFullYear()}-${(u.getMonth()+1).toString().padStart(2,"0")}-${u.getDate().toString().padStart(2,"0")} ${u.getHours()}:${u.getMinutes()}`},lAt=l=>{if(!l)return"-";const u=new Date(Date.parse(l));return`${u.getFullYear()}-${(u.getMonth()+1).toString().padStart(2,"0")}-${u.getDate().toString().padStart(2,"0")} ${u.getHours()}:${u.getMinutes()}`},uAt=l=>{if(!l)return"-";const u=new Date(Date.parse(l));return`${u.getFullYear()}-${(u.getMonth()+1).toString().padStart(2,"0")}-${u.getDate().toString().padStart(2,"0")}`},fAt=l=>{const u=new Date(Date.parse(l)),_=u.getUTCFullYear(),g=String(u.getUTCMonth()+1).padStart(2,"0"),x=String(u.getUTCDate()).padStart(2,"0"),D=String(u.getUTCHours()).padStart(2,"0"),I=String(u.getUTCMinutes()).padStart(2,"0"),$=String(u.getUTCSeconds()).padStart(2,"0");return`${_}-${g}-${x}T${D}:${I}:${$}Z`},_At=l=>{const u=new Date(Date.parse(l)),_=u.getUTCFullYear(),g=String(u.getUTCMonth()+1).padStart(2,"0"),x=String(u.getUTCDate()).padStart(2,"0");return`${_}-${g}-${x}`},pAt=l=>{const u=new Date(Date.parse(l)),_=u.getFullYear(),g=String(u.getMonth()+1).padStart(2,"0"),x=String(u.getDate()).padStart(2,"0");return`${_}-${g}-${x}`},Qqe=l=>{if(!l)return null;const u=new Date(l);if(isNaN(u))return null;const _=u.getFullYear(),g=String(u.getMonth()+1).padStart(2,"0"),x=String(u.getDate()).padStart(2,"0"),D=String(u.getHours()).padStart(2,"0"),I=String(u.getMinutes()).padStart(2,"0");return`${_}-${g}-${x} ${D}:${I}`},iq=l=>{if(!l)return null;const u=new Date(l);if(isNaN(u))return null;const _=u.getFullYear(),g=String(u.getMonth()+1).padStart(2,"0"),x=String(u.getDate()).padStart(2,"0");return`${_}-${g}-${x}`},_ne=(l,u=!1)=>{if(!l)return null;const _=new Date(l);if(isNaN(_))return null;if(u)return iq(_)+"T00:00:00.000Z";const g=_.getUTCFullYear(),x=String(_.getUTCMonth()+1).padStart(2,"0"),D=String(_.getUTCDate()).padStart(2,"0"),I=String(_.getUTCHours()).padStart(2,"0"),$=String(_.getUTCMinutes()).padStart(2,"0"),W=String(_.getUTCSeconds()).padStart(2,"0");return`${g}-${x}-${D}T${I}:${$}:${W}.000Z`};function Kqe(l){return new Zqe(l)}class Zqe{constructor(u){mh(this,"getPostsConfig");mh(this,"getImagesConfig");mh(this,"getPresenceConfig");mh(this,"getKeycloakConfig");mh(this,"sites");this.apiurl=u,this.getPostsConfig=UP(new JP(this.apiurl,"/admin/Widgets/{name}",_w.GET,new Map([[400,"Search Posts Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Search Posts Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getImagesConfig=UP(new JP(this.apiurl,"/admin/Widgets/{name}",_w.GET,new Map([[400,"Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getPresenceConfig=UP(new JP(this.apiurl,"/admin/Widgets/{name}",_w.GET,new Map([[400,"Widget konfiguráció lekérése ismeretlen hiba!"],[500,"Widget konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.getKeycloakConfig=UP(new JP(this.apiurl,"/admin/Widgets/{name}",_w.GET,new Map([[400,"Keycloak konfiguráció lekérése ismeretlen hiba!"],[500,"Keycloak konfiguráció lekérése ismeretlen hiba!"]])),void 0,{name:""},void 0),this.sites=UP(new JP(this.apiurl,"/admin/sites",_w.GET,new Map([[400,"Site lekérése ismeretlen hiba!"],[500,"Site lekérése ismeretlen hiba!"]])),void 0,void 0,void 0)}}const dAt=(l,u=500)=>{let _;return()=>{clearTimeout(_),_=setTimeout(()=>{l()},u)}};function mAt(l){return new eVe(l)}class eVe{constructor(u){mh(this,"baseUrl");mh(this,"searchPosts");mh(this,"partnersDetailsByIds");this.articleEditorBackendUrl=u,this.baseUrl=this.articleEditorBackendUrl,this.searchPosts=UP(new JP(this.baseUrl,"admin/Posts/searchPosts",_w.POST,new Map([[400,"Cikkek lekérdezése ismeretlen hiba!"],[500,"Cikkek lekérdezése ismeretlen hiba!"]])),{},void 0,void 0),this.partnersDetailsByIds=UP(new JP(this.baseUrl,"api/Partners/detailsByIds",_w.POST,new Map([[400,"BrandChannelek lekérdezése ismeretlen hiba!"],[500,"BrandChannelek lekérdezése ismeretlen hiba!"]])),{},void 0,void 0)}}const gAt={class:"d-flex flex-column w-100 gap-2"},hAt={class:"d-flex flex-row justify-content-between p-2"},vAt={key:0,class:"d-flex flex-column gap-2"},yAt={class:"d-flex flex-row justify-content-between"},bAt={class:"d-flex flex-row justify-content-between"},SAt=["onClick"],TAt={key:0,class:"d-flex flex-row gap-3"},xAt={class:"d-flex flex-column w-100"},kAt=["disabled","value"],CAt=["disabled","value"],EAt={class:"d-flex gap-2"},wAt={key:1,class:"d-flex justify-content-around flex-wrap gap-4 p-2"},DAt=["onClick"],AAt={key:2,class:"d-flex justify-content-around flex-wrap gap-4 p-2 cc-years"},PAt=["onClick"],UTe=w.defineComponent({__name:"CalendarComponent",props:{init:{},dateOnly:{type:Boolean}},emits:["changed"],setup(l,{emit:u}){const _=l,g=u,x=w.ref([]),D=w.ref(["H","K","Sz","Cs","P","Sz","V"]),I=w.ref(["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"]),$=w.ref([2025]),W=w.ref(""),ee=w.ref(2025),R=w.ref({local:null,utc:null}),le=w.ref(new Date),te=w.ref("00"),_e=w.ref("00"),Ve=w.ref(!1),Xe=w.ref("calendar");w.onMounted(()=>{et(_.init?_.init:null),bt(_.init?_.init:new Date)});const et=ht=>{if(ht){if(ht.setSeconds(0),_.dateOnly){const rt=new Date(ht);rt.setHours(0),rt.setMinutes(0),rt.setSeconds(0),R.value.local=rt,te.value="00",_e.value="00",R.value.utc=_ne(rt,!0)}else R.value.local=new Date(ht),te.value=ht.getHours().toString().padStart(2,"0"),_e.value=ht.getMinutes().toString().padStart(2,"0"),R.value.utc=_ne(ht);Ve.value=!0}else te.value="00",_e.value="00",R.value={local:null,utc:null},Ve.value=!1},bt=ht=>{let rt=new Date(ht);rt.setSeconds(0),le.value=new Date(rt),W.value=I.value[rt.getMonth()],ee.value=rt.getFullYear(),$.value=Array.from({length:60},(sr,Oi)=>rt.getFullYear()-29+Oi);const St=rt.getMonth();rt.setDate(1);const hr=[{days:[]}];let $t=hr[0],or=1;const Vt=sr=>sr.getDay()==0?6:sr.getDay()-1;let mn=Vt(rt);for(let sr=0;sr<mn;sr++)$t.days.push({label:"",isCurrent:!1,isSelected:!1,isWeekend:!1,isBlank:!0,number:sr});const vn=new Date;for(;rt.getMonth()===St;)mn=Vt(rt),mn==0&&($t={days:[]},hr.push($t)),$t.days.push({label:or.toString(),isCurrent:rt.getFullYear()==vn.getFullYear()&&rt.getMonth()==vn.getMonth()&&rt.getDate()==vn.getDate(),isSelected:R.value.local?R.value.local.getFullYear()==rt.getFullYear()&&R.value.local.getMonth()==rt.getMonth()&&R.value.local.getDate()==rt.getDate():!1,isWeekend:mn==5||mn==6,isBlank:!1,number:or}),or++,rt.setDate(rt.getDate()+1);for(mn=Vt(rt);mn!=6;)$t.days.push({label:or.toString(),isCurrent:!1,isSelected:!1,isWeekend:!1,isBlank:!0,number:0}),rt.setDate(rt.getDate()+1),mn=Vt(rt);x.value=hr},pt=()=>{let ht=new Date;ht.setHours(0),ht.setMinutes(0),ht.setSeconds(0),et(null),bt(ht),g("changed",R.value)};return(ht,rt)=>(w.openBlock(),w.createElementBlock("div",gAt,[w.createElementVNode("div",hAt,[w.createElementVNode("div",{class:"cc-btn",onClick:rt[0]||(rt[0]=()=>{let St=new Date(le.value);St.setMonth(le.value.getMonth()-1),bt(St)})}," < "),w.createElementVNode("div",{class:"cc-btn",onClick:rt[1]||(rt[1]=St=>Xe.value="years")},w.toDisplayString(ee.value),1),w.createElementVNode("div",{class:"cc-btn",onClick:rt[2]||(rt[2]=St=>Xe.value="months")},w.toDisplayString(W.value),1),w.createElementVNode("div",{class:"cc-btn",onClick:rt[3]||(rt[3]=()=>{let St=new Date(le.value);St.setMonth(le.value.getMonth()+1),bt(St)})}," > ")]),Xe.value=="calendar"?(w.openBlock(),w.createElementBlock("div",vAt,[w.createElementVNode("div",yAt,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(D.value,St=>(w.openBlock(),w.createElementBlock("div",null,w.toDisplayString(St),1))),256))]),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(x.value,St=>(w.openBlock(),w.createElementBlock("div",bAt,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(St.days,hr=>(w.openBlock(),w.createElementBlock("div",{class:w.normalizeClass(["d-flex flex-row justify-content-center cc-day",{"cc-day-weekend":hr.isWeekend,"cc-day-blank":hr.isBlank,"cc-day-current":hr.isCurrent,"cc-day-selected":hr.isSelected}]),onClick:()=>{let $t=new Date(le.value.getFullYear(),le.value.getMonth(),hr.number,Number.parseInt(te.value),Number.parseInt(_e.value));et($t),bt($t)}},w.toDisplayString(hr.label),11,SAt))),256))]))),256)),ht.dateOnly?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",TAt,[w.createElementVNode("div",null,w.toDisplayString(te.value)+":"+w.toDisplayString(_e.value),1),w.createElementVNode("div",xAt,[w.createElementVNode("input",{type:"range",id:"slider",min:"0",max:"23",disabled:!Ve.value,value:te.value,onInput:rt[4]||(rt[4]=St=>{R.value.local.setHours(St.target.value),et(R.value.local)})},null,40,kAt),w.createElementVNode("input",{type:"range",id:"slider",min:"0",max:"59",disabled:!Ve.value,value:_e.value,onInput:rt[5]||(rt[5]=St=>{R.value.local.setMinutes(St.target.value),et(R.value.local)})},null,40,CAt)])])),w.createElementVNode("div",EAt,[w.createElementVNode("button",{type:"button",class:"btn btn-outline-secondary w-100",onClick:pt},"Töröl"),w.createElementVNode("button",{type:"button",class:"btn btn-primary w-100",onClick:rt[6]||(rt[6]=St=>g("changed",R.value))},"Beállít")])])):w.createCommentVNode("",!0),Xe.value=="months"?(w.openBlock(),w.createElementBlock("div",wAt,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(I.value,(St,hr)=>(w.openBlock(),w.createElementBlock("div",{class:"cc-btn-light",onClick:$t=>{let or=new Date(le.value);or.setMonth(hr),bt(or),Xe.value="calendar",$t.stopPropagation()}},w.toDisplayString(St),9,DAt))),256))])):w.createCommentVNode("",!0),Xe.value=="years"?(w.openBlock(),w.createElementBlock("div",AAt,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList($.value,St=>(w.openBlock(),w.createElementBlock("div",{class:"cc-btn-light",onClick:hr=>{let $t=new Date(le.value);$t.setFullYear(St),bt($t),Xe.value="calendar",hr.stopPropagation()}},w.toDisplayString(St),9,PAt))),256))])):w.createCommentVNode("",!0)]))}}),NAt={class:"d-flex flex-column flex-md-row gap-2"},IAt={class:"d-flex flex-row gap-2 w-100"},OAt={class:"vf-input-group"},FAt={key:0,class:"vf-floating-wrapper"},MAt={class:"vf-floating-label vf-floating-label-visible vf-floating-label-success"},LAt=["value","placeholder"],nTe=w.defineComponent({__name:"DateTimePicker",props:{placeholder:{},initial:{},dateOnly:{type:Boolean}},emits:["changed","calendar"],setup(l,{emit:u}){const _=l,g=u,x=w.ref(null),D=w.ref(null),I=w.ref(""),$=w.ref(null),W=w.ref(null),ee=w.ref(null),R=Xe=>{W.value&&!W.value.contains(Xe.target)&&(te.value=!1)};w.onMounted(()=>{_.initial&&(x.value=_.initial.local,D.value=_.initial.utc,le()),document.addEventListener("click",R)}),w.onUnmounted(()=>{document.removeEventListener("click",R)});const le=()=>{const Xe=_.dateOnly?iq(x.value):Qqe(x.value);I.value=Xe??""},te=w.ref(!1),_e=Xe=>{te.value?te.value=!1:(te.value=!0,w.nextTick(()=>{const et=W.value,bt=$.value,pt=ee.value,ht=bt.getBoundingClientRect();et.style.left=ht.left+ht.width+pt.getBoundingClientRect().width-et.getBoundingClientRect().width+15+"px",et.style.top=ht.top+ht.height+"px"})),Xe&&Xe.stopPropagation()},Ve=Xe=>{const et=new Date(Date.parse(Xe)),bt=_ne(et,_.dateOnly);if(!bt){D.value=null,w.nextTick(()=>D.value="");return}D.value=bt,x.value=et,le(),g("changed",{local:x.value,utc:D.value})};return w.watch(te,()=>{g("calendar",te.value)}),(Xe,et)=>(w.openBlock(),w.createElementBlock("div",NAt,[w.createElementVNode("div",IAt,[w.createElementVNode("div",OAt,[D.value?(w.openBlock(),w.createElementBlock("div",FAt,[w.createElementVNode("span",MAt,w.toDisplayString(Xe.placeholder),1)])):w.createCommentVNode("",!0),w.createElementVNode("input",{type:"text",id:"dateTimeInputText",ref_key:"dateTimeInputTextRef",ref:$,class:"vf-input-field",value:I.value,onChange:et[0]||(et[0]=bt=>Ve(bt.target.value)),placeholder:Xe.placeholder},null,40,LAt)]),w.createElementVNode("div",{ref_key:"iconBtn",ref:ee,class:"dateTime-picker__iconbtn",onClick:_e},[...et[2]||(et[2]=[w.createElementVNode("i",{class:"fa-regular fa-calendar"},null,-1)])],512)]),te.value?(w.openBlock(),w.createElementBlock("div",{key:0,ref_key:"calendarRef",ref:W,class:"dateTime-picker__popup"},[w.createVNode(UTe,{init:x.value,dateOnly:Xe.dateOnly,onChanged:et[1]||(et[1]=bt=>{x.value=bt.local,D.value=bt.utc,_e(null),le(),g("changed",{local:x.value,utc:D.value})})},null,8,["init","dateOnly"])],512)):w.createCommentVNode("",!0)]))}}),RAt=["id"],jAt=["id"],BAt={class:"dtrp-label"},$At=["id"],JAt="Törlés",UAt="Beállítás",zAt=w.defineComponent({__name:"DateRangePicker",props:{id:{},label:{}},emits:["changed"],setup(l,{emit:u}){const _=l,g=u,x=w.ref(!1),D=async()=>{x.value=!x.value,x.value&&await $()},I=w.reactive({top:"0px",left:"0px",zIndex:1e3}),$=async()=>{await w.nextTick();const rt=document.getElementById(`${_.id}-btn`).getBoundingClientRect(),St=document.getElementById(`${_.id}-popup`);if(!St)return;const hr=St.getBoundingClientRect(),$t=window.innerWidth;I.top=rt.top+rt.height+"px",rt.left<$t/3?I.left=rt.left+"px":rt.left>2*$t/3?I.left=rt.left+rt.width-hr.width+"px":I.left=rt.right-rt.width/2-hr.width/2+"px"},W=w.reactive({utc:null,local:null}),ee=w.reactive({utc:null,local:null}),R=w.ref(""),le=async()=>{W.local||ee.local?R.value=`'${iq(W.local)??""}'-'${iq(ee.local)??""}'`:R.value=_.label,await $()},te=ht=>{const rt=document.getElementById(`${_.id}-popup`);rt&&!rt.contains(ht.target)&&(x.value=!1)};let _e=!1;w.onMounted(()=>{le()}),w.onUnmounted(()=>{_e&&window.removeEventListener("click",te)});const Ve=()=>{W.utc=null,W.local=null,ee.local=null,ee.utc=null,le(),x.value=!1,g("changed",{fromUtc:W.utc,toUtc:ee.utc})},Xe=()=>{le(),x.value=!1,g("changed",{fromUtc:W.utc,toUtc:ee.utc})},et=()=>{_e||setTimeout(()=>{window.addEventListener("click",te),_e=!0},100)},bt=()=>{_e&&setTimeout(()=>{window.removeEventListener("click",te),_e=!1},100)},pt=ht=>{ht?bt():et()};return w.watch(x,()=>{x.value?et():bt()}),(ht,rt)=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[w.createElementVNode("div",{id:ht.id,class:"dtrp-flex"},[w.createElementVNode("button",{id:ht.id+"-btn",class:"btn btn-outline-secondary dtrp-flex dtrp-button",type:"button",onClick:D},[w.createElementVNode("div",BAt,w.toDisplayString(R.value),1)],8,jAt)],8,RAt),x.value?(w.openBlock(),w.createElementBlock("div",{key:0,id:ht.id+"-popup",class:"dtrp-popup d-flex flex-column gap-2",style:w.normalizeStyle(I)},[w.createVNode(nTe,{placeholder:"Ettől",id:ht.id+"-from",onChanged:rt[0]||(rt[0]=St=>{W.local=St.local,W.utc=St.utc}),dateOnly:!0,initial:W,onCalendar:pt},null,8,["id","initial"]),w.createVNode(nTe,{placeholder:"Eddig",id:ht.id+"-to",onChanged:rt[1]||(rt[1]=St=>{ee.local=St.local,ee.utc=St.utc}),dateOnly:!0,initial:ee,onCalendar:pt},null,8,["id","initial"]),w.createElementVNode("div",{class:"d-flex w-100 gap-2"},[w.createElementVNode("button",{class:"btn btn-outline-secondary w-50",onClick:Ve},w.toDisplayString(JAt)),w.createElementVNode("button",{class:"btn btn-outline-primary w-50",onClick:Xe},w.toDisplayString(UAt))])],12,$At)):w.createCommentVNode("",!0)],64))}}),qAt={class:"fltrctrl-container"},VAt=["placeholder","value"],WAt={key:1,class:"d-flex flex-row input-group align-items-center"};class HAt{constructor(u,_,g){mh(this,"type");this.key=u,this.placeholder=_,this.filtered=g,this.type="text"}}class GAt{constructor(u,_,g,x,D,I,$){mh(this,"type");this.key=u,this.label=_,this.options=g,this.filterevent=x,this.onfiltered=D,this.filtered=I,this.selected=$,this.type="dropdown"}}class YAt{constructor(u,_,g,x,D){mh(this,"type");this.key=u,this.label=_,this.filtered=g,this.defFrom=x,this.defTil=D,this.type="date"}}const mSe=w.ref({}),zTe=w.defineComponent({__name:"FilterControl",props:{item:{}},setup(l){const u=l;w.onMounted(()=>{var g;if(u.item.type=="dropdown"){const x=u.item;_.value=(g=x.options.value.find(D=>D.id==u.item.defaultv))==null?void 0:g.id,x.selected&&w.watch(x.selected,()=>{var D,I;_.value=(I=(D=x.selected)==null?void 0:D.value)==null?void 0:I.id})}});const _=w.ref(void 0);return(g,x)=>(w.openBlock(),w.createElementBlock("div",qAt,[g.item.type=="text"?(w.openBlock(),w.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:g.item.placeholder,value:g.item.defaultv??"",onInput:x[0]||(x[0]=D=>g.item.filtered(g.item.key,D.target.value))},null,40,VAt)):w.createCommentVNode("",!0),g.item.type=="date"?(w.openBlock(),w.createElementBlock("div",WAt,[w.createVNode(zAt,{id:g.item.key+"-dtrp",label:g.item.label,onChanged:x[1]||(x[1]=D=>{mSe.value.from=D.fromUtc,mSe.value.until=D.toUtc,g.item.filtered(g.item.key,mSe.value)})},null,8,["id","label"])])):w.createCommentVNode("",!0),g.item.type=="dropdown"?(w.openBlock(),w.createBlock(BM,{key:2,selected:_.value,options:w.ref(g.item.options),filterevent:g.item.filterevent,onFiltered:x[2]||(x[2]=D=>{g.item.onfiltered&&g.item.onfiltered(D)}),id:g.item.key,label:g.item.label,onSelected:x[3]||(x[3]=D=>{g.item.selected&&(g.item.selected.value=g.item.options.value.find(I=>I.id==D.id)),g.item.filtered(g.item.key,D.id)})},null,8,["selected","options","filterevent","id","label"])):w.createCommentVNode("",!0)]))}}),XAt=["title"],L8=w.defineComponent({__name:"IconButton",props:{icon:{},active:{type:Boolean},big:{type:Boolean},title:{}},emits:["click"],setup(l,{emit:u}){const _=l,g=w.computed(()=>`${_.icon} ${_.big?"ib-button-big":""}`),x=u;return(D,I)=>(w.openBlock(),w.createElementBlock("div",{onClick:I[0]||(I[0]=$=>x("click")),class:"ib-container"},[w.createElementVNode("div",{class:w.normalizeClass(["ib-button",{"ib-button-active":D.active}]),title:D.title},[w.createElementVNode("i",{class:w.normalizeClass(g.value)},null,2)],10,XAt)]))}}),QAt={class:"pc-container"},KAt=["value","max"],qTe=w.defineComponent({__name:"PaginatorControl",props:{settings:{}},emits:["pagesize","page"],setup(l,{emit:u}){const _=l,g=u,x=()=>{let ee=w.ref([]);return _.settings.value.sizes.forEach(R=>ee.value.push({label:R.toString(),id:R.toString()})),ee},D=w.ref(1);w.watch(()=>_.settings.value,()=>{D.value=1});const I=w.computed(()=>Math.floor(_.settings.value.total/_.settings.value.pagesize)+1),$=()=>{D.value>1&&(D.value-=1,g("page",D.value))},W=()=>{D.value<I.value&&(D.value+=1,g("page",D.value))};return(ee,R)=>(w.openBlock(),w.createElementBlock("div",QAt,[w.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:$},"<"),w.createElementVNode("input",{class:"form-control pc-input",type:"number",value:D.value,min:"1",max:I.value,onChange:R[0]||(R[0]=le=>ee.$emit("page",le.target.value))},null,40,KAt),w.createTextVNode("/"+w.toDisplayString(I.value)+" ",1),w.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:W},">"),w.createVNode(BM,{opentop:!0,class:"pc-dropdown",id:"pagecount",label:"10",selected:ee.settings.value.pagesize.toString(),options:x(),onSelected:R[1]||(R[1]=le=>{D.value=1,ee.$emit("pagesize",parseInt(le.id))})},null,8,["selected","options"])]))}}),ZAt={class:"form-check"},e4t=["name","id","checked"],t4t=["for"],VTe=w.defineComponent({__name:"RadioButton",props:{group:{},label:{},id:{},selected:{type:Boolean}},emits:["selected"],setup(l){return(u,_)=>(w.openBlock(),w.createElementBlock("div",ZAt,[w.createElementVNode("input",{class:"form-check-input",type:"radio",name:u.group,id:u.id,checked:u.selected,onChange:_[0]||(_[0]=g=>u.$emit("selected",u.id))},null,40,e4t),w.createElementVNode("label",{class:"form-check-label",for:u.id},w.toDisplayString(u.label),9,t4t)]))}}),r4t={class:"d-flex flex-column gap-2 justify-content-around"},tVe=w.defineComponent({__name:"RadioButtonGroup",props:{group:{},items:{}},emits:["selected"],setup(l){return(u,_)=>(w.openBlock(),w.createElementBlock("div",r4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.items,g=>(w.openBlock(),w.createBlock(VTe,{key:g.id,id:g.id,label:g.label,group:u.group,selected:g.selected,onSelected:_[0]||(_[0]=x=>u.$emit("selected",x))},null,8,["id","label","group","selected"]))),128))]))}}),n4t={key:0,class:"spinner-border",role:"status"},WTe=w.defineComponent({__name:"SpinningProgress",props:{loading:{type:Boolean}},setup(l){return(u,_)=>u.loading?(w.openBlock(),w.createElementBlock("div",n4t,[..._[0]||(_[0]=[w.createElementVNode("span",{class:"visually-hidden"},"Loading...",-1)])])):w.createCommentVNode("",!0)}}),i4t={key:0,class:"t2l-table-view t2l-table-header-label"},a4t={key:0,class:"t2l-select"},s4t={key:1,class:"t2l-cell"},o4t={class:"t2l-table-view t2l-table-header-filter"},c4t={key:0,class:"t2l-select"},l4t={key:1,class:"t2l-cell"},u4t={class:"t2l-table-view t2l-rows"},f4t={key:0,class:"t2l-select"},_4t=["id","onChange"],p4t=["innerHTML"],d4t={key:1,class:"t2l-cell t2l-actions"},m4t=["title","disabled","onClick"],g4t={class:"t2l-card-view t2l-card-filters"},h4t={class:"t2l-card-filter-order"},v4t={class:"t2l-card-filter-search"},y4t={class:"t2l-card-view t2l-rows"},b4t={key:0,class:"t2l-card-select"},S4t=["id","onChange"],T4t={key:0,class:"t2l-property"},x4t={class:"t2l-label"},k4t=["innerHTML"],C4t={class:"d-flex align-items-center"},E4t={key:2,class:"d-flex justify-content-center t2l-footer"},rVe=w.defineComponent({__name:"TableToList",props:{items:{},config:{}},emits:["pagesize","page"],setup(l){const u=R=>R&&R.component!==void 0,_=l,g=w.computed(()=>_.config.columns.filter(R=>R.visible!=!1)),x=w.computed(()=>_.config.columns.filter(R=>R.visible!=!1&&R.filter)),D=w.computed(()=>g.value.filter(R=>R.sort&&R.sort.active&&R.sort.active.value)),I=w.computed(()=>Math.ceil(g.value.length/_.config.smColCount)),$=(R,le)=>{var te=R-1+(le-1)*I.value;return te<g.value.length?g.value[te]:null},W=(R,le)=>R.converter?R.converter(le[R.property],le):le[R.property],ee=R=>{if(R.sort&&R.sort.active){let le=!R.sort.active.value;_.config.columns.forEach(te=>{te.sort&&te.sort.active&&(te.sort.active.value=!1)}),R.sort.active.value=le,R.sort.callback(le?R.property:"")}};return(R,le)=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[R.config.compact?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",i4t,[R.config.selectableId?(w.openBlock(),w.createElementBlock("span",a4t)):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(g.value,te=>{var _e,Ve;return w.openBlock(),w.createElementBlock("span",{class:"t2l-cell gap-2",key:te.property},[te.sort?(w.openBlock(),w.createBlock(L8,{key:0,icon:te.sort.icon,onClick:Xe=>ee(te),active:(Ve=(_e=te.sort)==null?void 0:_e.active)==null?void 0:Ve.value},null,8,["icon","onClick","active"])):w.createCommentVNode("",!0),w.createTextVNode(" "+w.toDisplayString(te.label),1)])}),128)),R.config.actionHeader?(w.openBlock(),w.createElementBlock("span",s4t,w.toDisplayString(R.config.actionHeader),1)):w.createCommentVNode("",!0)])),w.createElementVNode("div",o4t,[R.config.selectableId?(w.openBlock(),w.createElementBlock("span",c4t)):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(g.value,te=>(w.openBlock(),w.createElementBlock("span",{class:"t2l-cell",key:te.label},[te.filter?(w.openBlock(),w.createBlock(zTe,{key:0,item:te.filter},null,8,["item"])):w.createCommentVNode("",!0)]))),128)),R.config.actionHeader?(w.openBlock(),w.createElementBlock("span",l4t)):w.createCommentVNode("",!0)]),w.createElementVNode("div",u4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(R.items,te=>(w.openBlock(),w.createElementBlock("div",{key:te,class:"t2l-row"},[R.config.selectableId?(w.openBlock(),w.createElementBlock("div",f4t,[w.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:te[R.config.selectableId],onChange:_e=>te.selected=!te.selected},null,40,_4t)])):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(g.value,_e=>(w.openBlock(),w.createElementBlock("div",{class:"t2l-cell",key:_e.property},[w.isVNode(W(_e,te))?(w.openBlock(),w.createBlock(w.resolveDynamicComponent(W(_e,te)),{key:0})):u(W(_e,te))?(w.openBlock(),w.createBlock(w.resolveDynamicComponent(W(_e,te).component),w.mergeProps({key:1,ref_for:!0},W(_e,te).props),null,16)):(w.openBlock(),w.createElementBlock("span",{key:2,innerHTML:String(W(_e,te)??"")},null,8,p4t))]))),128)),R.config.actions?(w.openBlock(),w.createElementBlock("div",d4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(R.config.actions,_e=>(w.openBlock(),w.createElementBlock("button",{key:_e,type:"button",class:"btn btn-outline-secondary",title:_e.label,disabled:!_e.enabled(te),onClick:Ve=>_e.command(te)},[w.createElementVNode("i",{class:w.normalizeClass(_e.icon)},null,2)],8,m4t))),128))])):w.createCommentVNode("",!0)]))),128))]),w.createElementVNode("div",g4t,[w.createElementVNode("div",h4t,[w.createVNode($Te,{id:"card-filter-order",default:{icon:"fa-solid fa-chevron-down",label:"rendezés"},selected:D.value.length>0?D.value[0].property:"",enabled:R.config.sortEnabled,options:w.ref(g.value.filter(te=>te.sort).map(te=>({icon:te.sort.icon,label:te.sort.label,value:te.property,callback:te.sort.callback})))},null,8,["selected","enabled","options"])]),w.createElementVNode("div",v4t,[w.createVNode(JTe,{items:x.value.map(te=>({filter:te.filter,icon:te.filterIcon,label:te.label}))},null,8,["items"])])]),w.createElementVNode("div",y4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(R.items,(te,_e)=>(w.openBlock(),w.createElementBlock("div",{class:"t2l-row",key:_e},[R.config.selectableId?(w.openBlock(),w.createElementBlock("div",b4t,[w.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:te[R.config.selectableId],onChange:Ve=>te.selected=!te.selected},null,40,S4t)])):w.createCommentVNode("",!0),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(R.config.smColCount,Ve=>(w.openBlock(),w.createElementBlock("div",{class:"t2l-card-col",key:Ve},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(I.value,Xe=>(w.openBlock(),w.createElementBlock(w.Fragment,{key:Xe},[$(Xe,Ve)?(w.openBlock(),w.createElementBlock("div",T4t,[w.createElementVNode("span",x4t,w.toDisplayString($(Xe,Ve).label),1),w.isVNode(W($(Xe,Ve),te))?(w.openBlock(),w.createBlock(w.resolveDynamicComponent(W($(Xe,Ve),te)),{key:0})):u(W($(Xe,Ve),te))?(w.openBlock(),w.createBlock(w.resolveDynamicComponent(W($(Xe,Ve),te).component),w.mergeProps({key:1,ref_for:!0},W($(Xe,Ve),te).props),null,16)):(w.openBlock(),w.createElementBlock("span",{key:2,innerHTML:String(W($(Xe,Ve),te)??"")},null,8,k4t))])):w.createCommentVNode("",!0)],64))),128))]))),128)),w.createElementVNode("div",C4t,[_.config.actions?(w.openBlock(),w.createBlock(Ine,{key:0,item:te,options:_.config.actions,label:"...",id:_e.toString(),right:!0},null,8,["item","options","id"])):w.createCommentVNode("",!0)])]))),128))]),R.config.paginatorSettings?(w.openBlock(),w.createBlock(qTe,{key:1,settings:R.config.paginatorSettings,onPagesize:le[0]||(le[0]=te=>R.$emit("pagesize",te)),onPage:le[1]||(le[1]=te=>R.$emit("page",te))},null,8,["settings"])):w.createCommentVNode("",!0),R.config.paginatorSettings?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",E4t," Elemek: "+w.toDisplayString(_.items.length),1))],64))}}),w4t={class:"d-flex flex flex-row"},D4t={key:1,class:"d-flex flex-column gap-2 options-body flex-grow-1"},A4t={class:"d-flex flex-grow-1 flex-column"},P4t={class:"d-flex flex-row"},N4t={class:"d-flex align-items-end"},I4t=["disabled"],nVe=w.defineComponent({__name:"TableToListOptions",props:{colCount:{},options:{},config:{}},emits:["save"],setup(l,{emit:u}){const _=l,g=w.ref([]);w.onMounted(()=>{g.value=_.options,R()});const x=w.computed(()=>_.colCount!=0?Math.ceil(_.options.length/_.colCount):0),D=(le,te)=>{var _e=_.options[(le-1)*x.value+te-1];return _e},I=()=>{$("save",g.value)},$=u,W=w.ref(!1),ee=w.ref(!0),R=()=>{ee.value=g.value.filter(le=>le.checked).length<=1};return(le,te)=>(w.openBlock(),w.createElementBlock("div",w4t,[W.value?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",{key:0,class:"d-flex flex-row align-items-center gap-2 options-header justify-content-start",onClick:te[0]||(te[0]=_e=>W.value=!W.value)},[...te[3]||(te[3]=[w.createElementVNode("i",{class:"fa-solid fa-cog"},null,-1),w.createElementVNode("div",{class:"options-header-label"},"beállítások",-1)])])),W.value?(w.openBlock(),w.createElementBlock("div",D4t,[te[5]||(te[5]=w.createElementVNode("div",{class:"options-header-label"},"Táblázat tulajdonságai",-1)),w.createElementVNode("div",A4t,[w.createVNode(nq,{id:"compact",label:"Kompakt",checked:!!le.config.compact,onChanged:te[1]||(te[1]=_e=>le.config.compact=_e.checked)},null,8,["checked"])]),te[6]||(te[6]=w.createElementVNode("div",{class:"options-header-label"},"Látható oszlopok",-1)),w.createElementVNode("div",P4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(le.colCount,_e=>(w.openBlock(),w.createElementBlock("div",{class:"d-flex flex-grow-1 flex-column",key:_e},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(x.value,Ve=>(w.openBlock(),w.createElementBlock(w.Fragment,{key:Ve},[D(_e,Ve)?(w.openBlock(),w.createBlock(nq,{key:0,id:D(_e,Ve).property,label:D(_e,Ve).label,checked:D(_e,Ve).checked,onChanged:te[2]||(te[2]=Xe=>{g.value.find(et=>et.property==Xe.id).checked=Xe.checked,R()})},null,8,["id","label","checked"])):w.createCommentVNode("",!0)],64))),128))]))),128)),w.createElementVNode("div",N4t,[w.createElementVNode("button",{class:"btn btn-outline-secondary",type:"button",onClick:I,disabled:ee.value},[...te[4]||(te[4]=[w.createElementVNode("i",{class:"fa-solid fa-save"},null,-1)])],8,I4t)])])])):w.createCommentVNode("",!0)]))}}),O4t={class:"tlb-container d-flex flex-column flex-grow-1"},F4t={class:"d-flex flex-row tlb-item"},M4t={class:"d-flex flex-column flex-grow-1 flex-sm-row justify-content-between tlb-item"},L4t=["id"],R4t={key:0,class:"d-flex id"},j4t={class:"d-flex flex-row align-items-center tlb-children-container"},iVe=w.defineComponent({__name:"TextListBox",props:{items:{}},emits:["deleted"],setup(l){return(u,_)=>{const g=w.resolveComponent("TextListBox",!0);return w.openBlock(),w.createElementBlock("div",O4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.items,x=>(w.openBlock(),w.createElementBlock("div",{class:"d-flex flex-column",key:x.id},[w.createElementVNode("div",F4t,[w.createElementVNode("div",M4t,[w.createElementVNode("div",{class:"d-flex flex-grow-1",id:x.id},w.toDisplayString(x.label),9,L4t),x.showId?(w.openBlock(),w.createElementBlock("div",R4t,w.toDisplayString(x.id),1)):w.createCommentVNode("",!0)]),x.hideDelete?w.createCommentVNode("",!0):(w.openBlock(),w.createBlock(L8,{key:0,icon:"fa-solid fa-trash",onClick:D=>u.$emit("deleted",x.id)},null,8,["onClick"]))]),w.createElementVNode("div",j4t,[x.childrend?(w.openBlock(),w.createBlock(g,{key:0,items:x.childrend,showId:x.showId,hideDelete:x.hideDelete},null,8,["items","showId","hideDelete"])):w.createCommentVNode("",!0)])]))),128))])}}}),B4t={key:0,class:"toast-container position-fixed bottom-0 start-50 translate-middle-x p-4 toast-zindex"},$4t={class:"toast-header"},J4t={class:"me-auto"},U4t={class:"text-body-secondary"},z4t=["onClick"],q4t=["innerHTML"],EUe=500,HTe=w.defineComponent({__name:"ToastComponent",props:{defaultDisplayDuration:{}},setup(l,{expose:u}){const _=l,g=w.ref([]);return u({addToast:D=>{D.displayDuration||(D.displayDuration=_.defaultDisplayDuration),D.id=new Date,g.value.filter(function(I){return I.id!==D.id}),g.value.push(D)}}),setInterval(()=>{g.value=g.value.map(D=>(D.displayDuration-=EUe,D)),g.value=g.value.filter(D=>D.displayDuration>0)},EUe),(D,I)=>g.value.length>0?(w.openBlock(),w.createElementBlock("div",B4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(g.value,$=>(w.openBlock(),w.createElementBlock("div",{key:$.message,class:w.normalizeClass(["toast d-block",{"toast-info":$.type==="info","toast-success":$.type==="success","toast-warning":$.type==="warning","toast-error":$.type==="error"}]),role:"alert","aria-live":"assertive","aria-atomic":"true"},[w.createElementVNode("div",$4t,[w.createElementVNode("strong",J4t,w.toDisplayString($.title),1),w.createElementVNode("small",U4t,w.toDisplayString($.id.toLocaleTimeString()),1),w.createElementVNode("button",{type:"button",class:"btn-close","data-bs-dismiss":"toast","aria-label":"Close",onClick:W=>g.value=g.value.filter(ee=>ee.id!==$.id)},null,8,z4t)]),w.createElementVNode("div",{class:"toast-body",innerHTML:$.message},null,8,q4t)],2))),128))])):w.createCommentVNode("",!0)}}),aVe=w.defineComponent({__name:"ToastWrapper",setup(l){const u=w.ref(),_=[{id:"toast-notification-message",handler:g=>{let x=g.detail;u.value.addToast({title:x.title,message:x.message,type:x.severity,displayDuration:x.displayDuration?x.displayDuration:5e3})}},{id:"fetch-error",handler:g=>{let x=g.detail;u.value.addToast({title:x.title,message:x.message,type:"error",displayDuration:1e4})}}];return w.onMounted(()=>{_.forEach(g=>window.addEventListener(g.id,g.handler))}),w.onUnmounted(()=>{_.forEach(g=>window.removeEventListener(g.id,g.handler))}),(g,x)=>(w.openBlock(),w.createBlock(HTe,{ref_key:"toast",ref:u,defaultDisplayDuration:5e3},null,512))}}),Qk=class Qk{};mh(Qk,"getId",(u,_)=>`${u}_${_}`),mh(Qk,"saveOptions",(u,_,g,x)=>{localStorage.setItem(Qk.getId(u,_),JSON.stringify({ttlcos:x,ttlc:{compact:g.compact}})),window.location.reload()}),mh(Qk,"cleanOptions",(u,_)=>{for(let g=0;g<localStorage.length;g++)localStorage.key(g).includes(u)&&localStorage.key(g)!=Qk.getId(u,_)&&localStorage.removeItem(localStorage.key(g))}),mh(Qk,"loadOptions",(u,_,g,x,D)=>{Qk.cleanOptions(u,_);const I=Qk.getId(u,_);if(localStorage.getItem(I))try{const $=JSON.parse(localStorage.getItem(I));D.value=$.ttlcos,D.value.forEach(W=>x.columns.find(ee=>ee.property==W.property).visible=W.checked),x.compact=$.ttlc.compact}catch{localStorage.removeItem(I),Qk.loadOptions(u,_,g,x,D)}else g||(g=[]),D.value=x.columns.map($=>($.visible=g.indexOf($.property)==-1,{label:$.label,property:$.property,checked:$.visible}))});let iTe=Qk;const V4t={class:"hdr-container d-flex flex-row flex-wrap align-items-center gap-3"},W4t=["onClick","title"],H4t={class:"hdr-title d-flex align-items-center"},G4t=["onClick","title"],Y4t={class:"d-flex flex-grow-1 justify-content-end gap-3"},X4t=["onClick","title"],sVe=w.defineComponent({__name:"HeaderComponent",props:{title:{},isFetching:{type:Boolean},buttons:{}},setup(l){return(u,_)=>(w.openBlock(),w.createElementBlock("div",V4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.buttons,g=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[g.align=="pretitle"&&g.type=="iconButton"?(w.openBlock(),w.createBlock(L8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):w.createCommentVNode("",!0),g.align=="pretitle"&&g.type=="button"?(w.openBlock(),w.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title},w.toDisplayString(g.title),9,W4t)):w.createCommentVNode("",!0)],64))),256)),w.createElementVNode("div",H4t,w.toDisplayString(u.title),1),w.createVNode(WTe,{loading:u.isFetching},null,8,["loading"]),(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.buttons,g=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[g.align=="left"&&g.type=="iconButton"?(w.openBlock(),w.createBlock(L8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):w.createCommentVNode("",!0),g.align=="left"&&g.type=="button"?(w.openBlock(),w.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title},w.toDisplayString(g.title),9,G4t)):w.createCommentVNode("",!0)],64))),256)),w.createElementVNode("div",Y4t,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(u.buttons,g=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[g.align=="right"&&g.type=="iconButton"?(w.openBlock(),w.createBlock(L8,{key:0,big:!0,icon:g.icon,onClick:g.callBack,title:g.title},null,8,["icon","onClick","title"])):w.createCommentVNode("",!0),g.align=="right"&&g.type=="button"?(w.openBlock(),w.createElementBlock("button",{key:1,type:"button",class:"btn btn-outline-secondary",onClick:g.callBack,title:g.title},w.toDisplayString(g.title),9,X4t)):w.createCommentVNode("",!0)],64))),256))])]))}}),Q4t={class:"image-picker"},K4t={key:0},Z4t=["src"],ePt={key:1},tPt=["src"],rPt={key:1},nPt={key:0,class:"d-flex flex-column flex-grow-1 gap-2"},iPt=["value","disabled"],aPt=["value","disabled"],sPt=["disabled"],oPt=["id"],cPt=["ae-api-url","environment","causationid"],$M=w.defineComponent({__name:"ImagePickerComponent",props:{modelValue:{},details:{type:Boolean},editable:{type:Boolean},direction:{},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{}},emits:["update:modelValue"],setup(l,{emit:u}){const _=l,g=u,x={id:"",url:"",isAdult:!1,source:"",title:""},D=w.ref(x);w.watch(()=>D,()=>{g("update:modelValue",D.value)},{deep:!0}),w.watch(()=>_.modelValue,et=>{et&&(D.value=et)},{deep:!0,immediate:!0});const I=_.searchImageWidgetUrl,$=_.imageBaseUrl,W=_.imageViewId,ee=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`ipe-${Date.now()}-${Math.random().toString(36).slice(2)}`,R=w.ref(`${ee}-image-picker-causation-id`);w.onMounted(()=>{if(!document.querySelector(`script[src="${I}"]`)){const et=document.createElement("script");et.type="text/javascript",et.src=I,et.async=!0,document.head.appendChild(et)}});const le=w.computed(()=>D.value&&(D.value.url&&D.value.url.length>0||D.value.id&&D.value.id.length>0)),te=w.computed(()=>{if(le.value)return D.value.url&&D.value.url.length>0?D.value.url:`${$}/${W}/${D.value.id}.jpg`}),_e=et=>{et.preventDefault(),w.nextTick(()=>{var bt;(bt=document.getElementById(R.value))==null||bt.showModal()})},Ve=et=>{et.preventDefault(),D.value=x},Xe=et=>{var bt,pt;((bt=et==null?void 0:et.detail)==null?void 0:bt.causationid)===R.value&&((pt=document.getElementById(R.value))==null||pt.close(),D.value={id:et.detail.image.id,url:"",isAdult:et.detail.image.isAdult,source:et.detail.image.source,title:et.detail.image.title})};return w.onMounted(()=>{window.addEventListener("image-selected",Xe)}),w.onUnmounted(()=>{window.removeEventListener("image-selected",Xe)}),(et,bt)=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[w.createElementVNode("div",Q4t,[w.createElementVNode("div",{class:w.normalizeClass(["d-flex gap-2",_.direction==="horizontal"?"flex-sm-row flex-column":"flex-column"])},[w.createElementVNode("div",{class:w.normalizeClass(["d-flex flex-column",_.direction==="horizontal"?"image-picker__preview":""])},[_.direction==="horizontal"?(w.openBlock(),w.createElementBlock("div",K4t,[le.value?(w.openBlock(),w.createElementBlock("img",{key:0,class:"image-picker__preview",alt:"",src:te.value},null,8,Z4t)):(w.openBlock(),w.createElementBlock("p",ePt,"Nincs kép kiválasztva!"))])):w.createCommentVNode("",!0),_.direction!=="horizontal"?(w.openBlock(),w.createElementBlock(w.Fragment,{key:1},[le.value?(w.openBlock(),w.createElementBlock("img",{key:0,alt:"",src:te.value},null,8,tPt)):(w.openBlock(),w.createElementBlock("p",rPt,"Nincs kép kiválasztva!"))],64)):w.createCommentVNode("",!0),w.createElementVNode("div",{class:"btn-group mt-2 w-100",role:"group","aria-label":"Képválasztó gombok"},[w.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:_e},"Kép választás"),w.createElementVNode("button",{class:"btn btn-outline-danger",onClick:Ve},"Eltávolítás")])],2),_.details&&D.value&&D.value.id?(w.openBlock(),w.createElementBlock("div",nPt,[w.createElementVNode("div",null,[bt[3]||(bt[3]=w.createElementVNode("label",{for:"imgSrc",class:"form-label"},"Forrás",-1)),w.createElementVNode("input",{id:"imgSrc",class:"form-control",type:"text",placeholder:"Forrás",value:D.value.source,onInput:bt[0]||(bt[0]=pt=>{D.value.source=pt.target.value}),disabled:!_.editable},null,40,iPt)]),w.createElementVNode("div",null,[bt[4]||(bt[4]=w.createElementVNode("label",{for:"imgAlt",class:"form-label"},"Képalá",-1)),w.createElementVNode("input",{id:"imgAlt",class:"form-control",type:"text",placeholder:"Képalá",value:D.value.title,onInput:bt[1]||(bt[1]=pt=>{D.value.title=pt.target.value}),disabled:!_.editable},null,40,aPt)]),w.createElementVNode("div",null,[bt[5]||(bt[5]=w.createElementVNode("label",{for:"isAdult",class:"form-check-label"},"Felnőtt tartalom",-1)),w.withDirectives(w.createElementVNode("input",{id:"isAdult",class:"m-1 form-check-input",type:"checkbox","onUpdate:modelValue":bt[2]||(bt[2]=pt=>D.value.isAdult=pt),disabled:!_.editable},null,8,sPt),[[w.vModelCheckbox,D.value.isAdult]])])])):w.createCommentVNode("",!0)],2)]),w.createElementVNode("dialog",{id:R.value,class:"w-100 h-100 p-0 m-0 border-none overflow-hidden"},[w.createElementVNode("hvg-search-image",{"ae-api-url":et.articleEditorUrl,environment:et.environment,causationid:R.value,selectonly:"true"},null,8,cPt)],8,oPt)],64))}}),lPt={class:"selector"},uPt={class:"form-label",for:"format"},fPt=["value"],_Pt=w.defineComponent({__name:"SelectorComponent",props:{modelValue:{},label:{},options:{}},emits:["update:modelValue"],setup(l,{emit:u}){const _=l,g=u,x=w.computed({get:()=>_.modelValue,set:D=>g("update:modelValue",D)});return w.watchEffect(async()=>{var I;if(!((I=_.options)!=null&&I.length))return;const D=_.options.map($=>$.value);(_.modelValue==null||!D.includes(_.modelValue))&&(g("update:modelValue",D[0]),await w.nextTick())}),(D,I)=>(w.openBlock(),w.createElementBlock("div",lPt,[w.createElementVNode("label",uPt,w.toDisplayString(D.label),1),w.withDirectives(w.createElementVNode("select",{class:"form-control",id:"format","onUpdate:modelValue":I[0]||(I[0]=$=>x.value=$)},[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(D.options,$=>(w.openBlock(),w.createElementBlock("option",{key:$.value,value:$.value},w.toDisplayString($.label),9,fPt))),128))],512),[[w.vModelSelect,x.value]])]))}}),oVe=sC(_Pt,[["__scopeId","data-v-701e6d6d"]]),pPt={class:"d-flex flex-column gap-2"},dPt={class:"btn-group mt-2 w-100",role:"group","aria-label":"Cikkválasztó gombok"},mPt={key:0,class:"w-100 gap-1 d-flex"},gPt={class:"w-100"},hPt=["value"],vPt={class:"w-100"},yPt=["value"],bPt=["value"],SPt=["value"],TPt=["id"],xPt=["id","apiurl"],kPt="00000000-0000-0000-0000-000000000000",GTe=w.defineComponent({__name:"InternalArticleOfferComponent",props:{modelValue:{},searchArticleApiUrl:{},searchArticleWidgetUrl:{},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{},showIds:{type:Boolean,default:!0},formats:{}},emits:["update:modelValue"],setup(l,{emit:u}){const _={article:{siteId:"",id:"",imageId:"",title:"",lead:""},format:""},g=u,x=l,D=w.ref(_),I=w.ref({id:D.value.article.imageId||"",url:"",source:"",title:"",isAdult:!1});w.watch(()=>x.modelValue,le=>{le?D.value=le:D.value=_},{deep:!0,immediate:!0}),w.watch(()=>D,le=>{g("update:modelValue",D.value),I.value.id=le.value.article.imageId},{deep:!0,immediate:!0}),w.watch(()=>I.value.id,le=>{D.value.article.imageId=le},{deep:!0,immediate:!0});const $=w.ref(new Date().getTime().toString()+"article");w.onUnmounted(()=>{window.removeEventListener("search_posts_selected",W)}),w.onMounted(()=>{window.addEventListener("search_posts_selected",W)});const W=le=>{var te;if(le.detail.id==$.value){if(le.detail.result&&le.detail.posts.length>0){D.value.article.id=le.detail.posts[0].id,D.value.article.siteId=le.detail.posts[0].siteId,D.value.article.title=le.detail.posts[0].title,D.value.article.lead=le.detail.posts[0].lead;const _e=le.detail.posts[0].featuredImage;D.value.article.imageId=_e||kPt}(te=document.getElementById($.value))==null||te.close()}},ee=()=>{var le;(le=document.getElementById($.value))==null||le.showModal()},R=le=>{if(!document.querySelector(`script[src="${le}"]`)){let te=document.createElement("script");te.type="text/javascript",te.src=le,document.head.appendChild(te)}};return R(x.searchImageWidgetUrl),R(x.searchArticleWidgetUrl),(le,te)=>(w.openBlock(),w.createElementBlock(w.Fragment,null,[w.createElementVNode("div",pPt,[w.createElementVNode("div",dPt,[w.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:te[0]||(te[0]=()=>ee())},"Cikk Választás")]),le.showIds?(w.openBlock(),w.createElementBlock("div",mPt,[w.createElementVNode("div",gPt,[w.createElementVNode("input",{type:"text",id:"articleId",class:"form-control",placeholder:"Cikk azonosító",disabled:"",value:D.value.article.id},null,8,hPt)]),w.createElementVNode("div",vPt,[w.createElementVNode("input",{type:"text",id:"articleSiteId",class:"form-control",placeholder:"Site azonosító",disabled:"",value:D.value.article.siteId},null,8,yPt)])])):w.createCommentVNode("",!0),w.createElementVNode("div",null,[te[5]||(te[5]=w.createElementVNode("label",{for:"articleTitle",class:"form-label"},"Címe",-1)),w.createElementVNode("textarea",{id:"articleTitle",class:"form-control",placeholder:"Címe",value:D.value.article.title,onInput:te[1]||(te[1]=_e=>{var Ve;return D.value.article.title=((Ve=_e.target)==null?void 0:Ve.value)||""})},null,40,bPt)]),w.createElementVNode("div",null,[te[6]||(te[6]=w.createElementVNode("label",{for:"articleLead",class:"form-label"},"Lead",-1)),w.createElementVNode("textarea",{id:"articleLead",class:"form-control",placeholder:"Lead",value:D.value.article.lead,onInput:te[2]||(te[2]=_e=>{var Ve;return D.value.article.lead=((Ve=_e.target)==null?void 0:Ve.value)||""})},null,40,SPt)]),w.createVNode($M,{modelValue:I.value,"onUpdate:modelValue":te[3]||(te[3]=_e=>I.value=_e),details:!1,editable:!1,"article-editor-url":x.articleEditorUrl,environment:x.environment,"search-image-widget-url":x.searchImageWidgetUrl,"image-base-url":x.imageBaseUrl,"image-view-id":x.imageViewId},null,8,["modelValue","article-editor-url","environment","search-image-widget-url","image-base-url","image-view-id"]),w.createVNode(oVe,{modelValue:D.value.format,"onUpdate:modelValue":te[4]||(te[4]=_e=>D.value.format=_e),options:x.formats,label:"Formátum"},null,8,["modelValue","options"])]),w.createElementVNode("dialog",{id:$.value,class:"w-100 h-100 p-0 border-none overflow-hidden"},[w.createElementVNode("search-posts-widget",{id:$.value,selector:"true",apiurl:x.searchArticleApiUrl,wpurl:"",searchurl:""},null,8,xPt)],8,TPt)],64))}}),CPt={class:"d-flex flex-column gap-2"},EPt=["value"],wPt=["value"],DPt=["value"],YTe=w.defineComponent({__name:"ExternalArticleOfferComponent",props:{modelValue:{},onArticleUrlChanged:{type:Function},articleEditorUrl:{},environment:{},searchImageWidgetUrl:{},imageBaseUrl:{},imageViewId:{},formats:{}},emits:["update:modelValue"],setup(l,{emit:u}){const _={article:{url:"",imageUrl:"",imageId:"",title:"",lead:""},format:""},g=u,x=l,D=w.ref(_),I=w.ref({id:D.value.article.imageId,url:"",source:"",title:"",isAdult:!1});w.watch(()=>x.modelValue,ee=>{ee?D.value=ee:D.value=_},{deep:!0,immediate:!0}),w.watch(()=>D,ee=>{g("update:modelValue",D.value),I.value.id=ee.value.article.imageId,I.value.url=ee.value.article.imageUrl},{deep:!0,immediate:!0}),w.watch(()=>I.value.id,ee=>{D.value.article.imageId=ee},{deep:!0,immediate:!0}),w.watch(()=>I.value.url,ee=>{D.value.article.imageUrl=ee},{deep:!0,immediate:!0});const $=ee=>{var R;D.value.article.url=((R=ee.target)==null?void 0:R.value)||"",D.value.article.url&&x.onArticleUrlChanged(D.value.article.url,le=>{D.value.article=le})};return(ee=>{if(!document.querySelector(`script[src="${ee}"]`)){let R=document.createElement("script");R.type="text/javascript",R.src=ee,document.head.appendChild(R)}})(x.searchImageWidgetUrl),(ee,R)=>(w.openBlock(),w.createElementBlock("div",CPt,[w.createElementVNode("div",null,[R[4]||(R[4]=w.createElementVNode("label",{for:"articleUrl",class:"form-label"},"Cikk URL",-1)),w.createElementVNode("textarea",{id:"articleUrl",class:"form-control",placeholder:"Cikk URL",value:D.value.article.url,onInput:$},null,40,EPt)]),w.createElementVNode("div",null,[R[5]||(R[5]=w.createElementVNode("label",{for:"articleTitle",class:"form-label"},"Címe",-1)),w.createElementVNode("textarea",{id:"articleTitle",class:"form-control",placeholder:"Címe",value:D.value.article.title,onInput:R[0]||(R[0]=le=>{var te;return D.value.article.title=((te=le.target)==null?void 0:te.value)||""})},null,40,wPt)]),w.createElementVNode("div",null,[R[6]||(R[6]=w.createElementVNode("label",{for:"articleLead",class:"form-label"},"Lead",-1)),w.createElementVNode("textarea",{id:"articleLead",class:"form-control",placeholder:"Lead",value:D.value.article.lead,onInput:R[1]||(R[1]=le=>{var te;return D.value.article.lead=((te=le.target)==null?void 0:te.value)||""})},null,40,DPt)]),w.createVNode($M,{modelValue:I.value,"onUpdate:modelValue":R[2]||(R[2]=le=>I.value=le),details:!1,editable:!1,"article-editor-url":x.articleEditorUrl,environment:x.environment,"search-image-widget-url":x.searchImageWidgetUrl,"image-base-url":x.imageBaseUrl,"image-view-id":x.imageViewId},null,8,["modelValue","article-editor-url","environment","search-image-widget-url","image-base-url","image-view-id"]),w.createVNode(oVe,{modelValue:D.value.format,"onUpdate:modelValue":R[3]||(R[3]=le=>D.value.format=le),options:x.formats,label:"Formátum"},null,8,["modelValue","options"])]))}});function cVe(l,u){return function(){return l.apply(u,arguments)}}const{toString:APt}=Object.prototype,{getPrototypeOf:XTe}=Object,{iterator:Fne,toStringTag:lVe}=Symbol,Mne=(l=>u=>{const _=APt.call(u);return l[_]||(l[_]=_.slice(8,-1).toLowerCase())})(Object.create(null)),oC=l=>(l=l.toLowerCase(),u=>Mne(u)===l),Lne=l=>u=>typeof u===l,{isArray:JM}=Array,IM=Lne("undefined");function pq(l){return l!==null&&!IM(l)&&l.constructor!==null&&!IM(l.constructor)&&_2(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const uVe=oC("ArrayBuffer");function PPt(l){let u;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?u=ArrayBuffer.isView(l):u=l&&l.buffer&&uVe(l.buffer),u}const NPt=Lne("string"),_2=Lne("function"),fVe=Lne("number"),dq=l=>l!==null&&typeof l=="object",IPt=l=>l===!0||l===!1,Yre=l=>{if(Mne(l)!=="object")return!1;const u=XTe(l);return(u===null||u===Object.prototype||Object.getPrototypeOf(u)===null)&&!(lVe in l)&&!(Fne in l)},OPt=l=>{if(!dq(l)||pq(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},FPt=oC("Date"),MPt=oC("File"),LPt=oC("Blob"),RPt=oC("FileList"),jPt=l=>dq(l)&&_2(l.pipe),BPt=l=>{let u;return l&&(typeof FormData=="function"&&l instanceof FormData||_2(l.append)&&((u=Mne(l))==="formdata"||u==="object"&&_2(l.toString)&&l.toString()==="[object FormData]"))},$Pt=oC("URLSearchParams"),[JPt,UPt,zPt,qPt]=["ReadableStream","Request","Response","Headers"].map(oC),VPt=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mq(l,u,{allOwnKeys:_=!1}={}){if(l===null||typeof l>"u")return;let g,x;if(typeof l!="object"&&(l=[l]),JM(l))for(g=0,x=l.length;g<x;g++)u.call(null,l[g],g,l);else{if(pq(l))return;const D=_?Object.getOwnPropertyNames(l):Object.keys(l),I=D.length;let $;for(g=0;g<I;g++)$=D[g],u.call(null,l[$],$,l)}}function _Ve(l,u){if(pq(l))return null;u=u.toLowerCase();const _=Object.keys(l);let g=_.length,x;for(;g-- >0;)if(x=_[g],u===x.toLowerCase())return x;return null}const F8=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,pVe=l=>!IM(l)&&l!==F8;function aTe(){const{caseless:l,skipUndefined:u}=pVe(this)&&this||{},_={},g=(x,D)=>{const I=l&&_Ve(_,D)||D;Yre(_[I])&&Yre(x)?_[I]=aTe(_[I],x):Yre(x)?_[I]=aTe({},x):JM(x)?_[I]=x.slice():(!u||!IM(x))&&(_[I]=x)};for(let x=0,D=arguments.length;x<D;x++)arguments[x]&&mq(arguments[x],g);return _}const WPt=(l,u,_,{allOwnKeys:g}={})=>(mq(u,(x,D)=>{_&&_2(x)?l[D]=cVe(x,_):l[D]=x},{allOwnKeys:g}),l),HPt=l=>(l.charCodeAt(0)===65279&&(l=l.slice(1)),l),GPt=(l,u,_,g)=>{l.prototype=Object.create(u.prototype,g),l.prototype.constructor=l,Object.defineProperty(l,"super",{value:u.prototype}),_&&Object.assign(l.prototype,_)},YPt=(l,u,_,g)=>{let x,D,I;const $={};if(u=u||{},l==null)return u;do{for(x=Object.getOwnPropertyNames(l),D=x.length;D-- >0;)I=x[D],(!g||g(I,l,u))&&!$[I]&&(u[I]=l[I],$[I]=!0);l=_!==!1&&XTe(l)}while(l&&(!_||_(l,u))&&l!==Object.prototype);return u},XPt=(l,u,_)=>{l=String(l),(_===void 0||_>l.length)&&(_=l.length),_-=u.length;const g=l.indexOf(u,_);return g!==-1&&g===_},QPt=l=>{if(!l)return null;if(JM(l))return l;let u=l.length;if(!fVe(u))return null;const _=new Array(u);for(;u-- >0;)_[u]=l[u];return _},KPt=(l=>u=>l&&u instanceof l)(typeof Uint8Array<"u"&&XTe(Uint8Array)),ZPt=(l,u)=>{const g=(l&&l[Fne]).call(l);let x;for(;(x=g.next())&&!x.done;){const D=x.value;u.call(l,D[0],D[1])}},e3t=(l,u)=>{let _;const g=[];for(;(_=l.exec(u))!==null;)g.push(_);return g},t3t=oC("HTMLFormElement"),r3t=l=>l.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(_,g,x){return g.toUpperCase()+x}),wUe=(({hasOwnProperty:l})=>(u,_)=>l.call(u,_))(Object.prototype),n3t=oC("RegExp"),dVe=(l,u)=>{const _=Object.getOwnPropertyDescriptors(l),g={};mq(_,(x,D)=>{let I;(I=u(x,D,l))!==!1&&(g[D]=I||x)}),Object.defineProperties(l,g)},i3t=l=>{dVe(l,(u,_)=>{if(_2(l)&&["arguments","caller","callee"].indexOf(_)!==-1)return!1;const g=l[_];if(_2(g)){if(u.enumerable=!1,"writable"in u){u.writable=!1;return}u.set||(u.set=()=>{throw Error("Can not rewrite read-only method '"+_+"'")})}})},a3t=(l,u)=>{const _={},g=x=>{x.forEach(D=>{_[D]=!0})};return JM(l)?g(l):g(String(l).split(u)),_},s3t=()=>{},o3t=(l,u)=>l!=null&&Number.isFinite(l=+l)?l:u;function c3t(l){return!!(l&&_2(l.append)&&l[lVe]==="FormData"&&l[Fne])}const l3t=l=>{const u=new Array(10),_=(g,x)=>{if(dq(g)){if(u.indexOf(g)>=0)return;if(pq(g))return g;if(!("toJSON"in g)){u[x]=g;const D=JM(g)?[]:{};return mq(g,(I,$)=>{const W=_(I,x+1);!IM(W)&&(D[$]=W)}),u[x]=void 0,D}}return g};return _(l,0)},u3t=oC("AsyncFunction"),f3t=l=>l&&(dq(l)||_2(l))&&_2(l.then)&&_2(l.catch),mVe=((l,u)=>l?setImmediate:u?((_,g)=>(F8.addEventListener("message",({source:x,data:D})=>{x===F8&&D===_&&g.length&&g.shift()()},!1),x=>{g.push(x),F8.postMessage(_,"*")}))(`axios@${Math.random()}`,[]):_=>setTimeout(_))(typeof setImmediate=="function",_2(F8.postMessage)),_3t=typeof queueMicrotask<"u"?queueMicrotask.bind(F8):typeof process<"u"&&process.nextTick||mVe,p3t=l=>l!=null&&_2(l[Fne]),Pi={isArray:JM,isArrayBuffer:uVe,isBuffer:pq,isFormData:BPt,isArrayBufferView:PPt,isString:NPt,isNumber:fVe,isBoolean:IPt,isObject:dq,isPlainObject:Yre,isEmptyObject:OPt,isReadableStream:JPt,isRequest:UPt,isResponse:zPt,isHeaders:qPt,isUndefined:IM,isDate:FPt,isFile:MPt,isBlob:LPt,isRegExp:n3t,isFunction:_2,isStream:jPt,isURLSearchParams:$Pt,isTypedArray:KPt,isFileList:RPt,forEach:mq,merge:aTe,extend:WPt,trim:VPt,stripBOM:HPt,inherits:GPt,toFlatObject:YPt,kindOf:Mne,kindOfTest:oC,endsWith:XPt,toArray:QPt,forEachEntry:ZPt,matchAll:e3t,isHTMLForm:t3t,hasOwnProperty:wUe,hasOwnProp:wUe,reduceDescriptors:dVe,freezeMethods:i3t,toObjectSet:a3t,toCamelCase:r3t,noop:s3t,toFiniteNumber:o3t,findKey:_Ve,global:F8,isContextDefined:pVe,isSpecCompliantForm:c3t,toJSONObject:l3t,isAsyncFn:u3t,isThenable:f3t,setImmediate:mVe,asap:_3t,isIterable:p3t};function ru(l,u,_,g,x){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=l,this.name="AxiosError",u&&(this.code=u),_&&(this.config=_),g&&(this.request=g),x&&(this.response=x,this.status=x.status?x.status:null)}Pi.inherits(ru,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Pi.toJSONObject(this.config),code:this.code,status:this.status}}});const gVe=ru.prototype,hVe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(l=>{hVe[l]={value:l}});Object.defineProperties(ru,hVe);Object.defineProperty(gVe,"isAxiosError",{value:!0});ru.from=(l,u,_,g,x,D)=>{const I=Object.create(gVe);Pi.toFlatObject(l,I,function(R){return R!==Error.prototype},ee=>ee!=="isAxiosError");const $=l&&l.message?l.message:"Error",W=u==null&&l?l.code:u;return ru.call(I,$,W,_,g,x),l&&I.cause==null&&Object.defineProperty(I,"cause",{value:l,configurable:!0}),I.name=l&&l.name||"Error",D&&Object.assign(I,D),I};const d3t=null;function sTe(l){return Pi.isPlainObject(l)||Pi.isArray(l)}function vVe(l){return Pi.endsWith(l,"[]")?l.slice(0,-2):l}function DUe(l,u,_){return l?l.concat(u).map(function(x,D){return x=vVe(x),!_&&D?"["+x+"]":x}).join(_?".":""):u}function m3t(l){return Pi.isArray(l)&&!l.some(sTe)}const g3t=Pi.toFlatObject(Pi,{},null,function(u){return/^is[A-Z]/.test(u)});function Rne(l,u,_){if(!Pi.isObject(l))throw new TypeError("target must be an object");u=u||new FormData,_=Pi.toFlatObject(_,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Xe,et){return!Pi.isUndefined(et[Xe])});const g=_.metaTokens,x=_.visitor||R,D=_.dots,I=_.indexes,W=(_.Blob||typeof Blob<"u"&&Blob)&&Pi.isSpecCompliantForm(u);if(!Pi.isFunction(x))throw new TypeError("visitor must be a function");function ee(Ve){if(Ve===null)return"";if(Pi.isDate(Ve))return Ve.toISOString();if(Pi.isBoolean(Ve))return Ve.toString();if(!W&&Pi.isBlob(Ve))throw new ru("Blob is not supported. Use a Buffer instead.");return Pi.isArrayBuffer(Ve)||Pi.isTypedArray(Ve)?W&&typeof Blob=="function"?new Blob([Ve]):Buffer.from(Ve):Ve}function R(Ve,Xe,et){let bt=Ve;if(Ve&&!et&&typeof Ve=="object"){if(Pi.endsWith(Xe,"{}"))Xe=g?Xe:Xe.slice(0,-2),Ve=JSON.stringify(Ve);else if(Pi.isArray(Ve)&&m3t(Ve)||(Pi.isFileList(Ve)||Pi.endsWith(Xe,"[]"))&&(bt=Pi.toArray(Ve)))return Xe=vVe(Xe),bt.forEach(function(ht,rt){!(Pi.isUndefined(ht)||ht===null)&&u.append(I===!0?DUe([Xe],rt,D):I===null?Xe:Xe+"[]",ee(ht))}),!1}return sTe(Ve)?!0:(u.append(DUe(et,Xe,D),ee(Ve)),!1)}const le=[],te=Object.assign(g3t,{defaultVisitor:R,convertValue:ee,isVisitable:sTe});function _e(Ve,Xe){if(!Pi.isUndefined(Ve)){if(le.indexOf(Ve)!==-1)throw Error("Circular reference detected in "+Xe.join("."));le.push(Ve),Pi.forEach(Ve,function(bt,pt){(!(Pi.isUndefined(bt)||bt===null)&&x.call(u,bt,Pi.isString(pt)?pt.trim():pt,Xe,te))===!0&&_e(bt,Xe?Xe.concat(pt):[pt])}),le.pop()}}if(!Pi.isObject(l))throw new TypeError("data must be an object");return _e(l),u}function AUe(l){const u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(l).replace(/[!'()~]|%20|%00/g,function(g){return u[g]})}function QTe(l,u){this._pairs=[],l&&Rne(l,this,u)}const yVe=QTe.prototype;yVe.append=function(u,_){this._pairs.push([u,_])};yVe.toString=function(u){const _=u?function(g){return u.call(this,g,AUe)}:AUe;return this._pairs.map(function(x){return _(x[0])+"="+_(x[1])},"").join("&")};function h3t(l){return encodeURIComponent(l).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function bVe(l,u,_){if(!u)return l;const g=_&&_.encode||h3t;Pi.isFunction(_)&&(_={serialize:_});const x=_&&_.serialize;let D;if(x?D=x(u,_):D=Pi.isURLSearchParams(u)?u.toString():new QTe(u,_).toString(g),D){const I=l.indexOf("#");I!==-1&&(l=l.slice(0,I)),l+=(l.indexOf("?")===-1?"?":"&")+D}return l}class PUe{constructor(){this.handlers=[]}use(u,_,g){return this.handlers.push({fulfilled:u,rejected:_,synchronous:g?g.synchronous:!1,runWhen:g?g.runWhen:null}),this.handlers.length-1}eject(u){this.handlers[u]&&(this.handlers[u]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(u){Pi.forEach(this.handlers,function(g){g!==null&&u(g)})}}const SVe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},v3t=typeof URLSearchParams<"u"?URLSearchParams:QTe,y3t=typeof FormData<"u"?FormData:null,b3t=typeof Blob<"u"?Blob:null,S3t={isBrowser:!0,classes:{URLSearchParams:v3t,FormData:y3t,Blob:b3t},protocols:["http","https","file","blob","url","data"]},KTe=typeof window<"u"&&typeof document<"u",oTe=typeof navigator=="object"&&navigator||void 0,T3t=KTe&&(!oTe||["ReactNative","NativeScript","NS"].indexOf(oTe.product)<0),x3t=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",k3t=KTe&&window.location.href||"http://localhost",C3t=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:KTe,hasStandardBrowserEnv:T3t,hasStandardBrowserWebWorkerEnv:x3t,navigator:oTe,origin:k3t},Symbol.toStringTag,{value:"Module"})),jy={...C3t,...S3t};function E3t(l,u){return Rne(l,new jy.classes.URLSearchParams,{visitor:function(_,g,x,D){return jy.isNode&&Pi.isBuffer(_)?(this.append(g,_.toString("base64")),!1):D.defaultVisitor.apply(this,arguments)},...u})}function w3t(l){return Pi.matchAll(/\w+|\[(\w*)]/g,l).map(u=>u[0]==="[]"?"":u[1]||u[0])}function D3t(l){const u={},_=Object.keys(l);let g;const x=_.length;let D;for(g=0;g<x;g++)D=_[g],u[D]=l[D];return u}function TVe(l){function u(_,g,x,D){let I=_[D++];if(I==="__proto__")return!0;const $=Number.isFinite(+I),W=D>=_.length;return I=!I&&Pi.isArray(x)?x.length:I,W?(Pi.hasOwnProp(x,I)?x[I]=[x[I],g]:x[I]=g,!$):((!x[I]||!Pi.isObject(x[I]))&&(x[I]=[]),u(_,g,x[I],D)&&Pi.isArray(x[I])&&(x[I]=D3t(x[I])),!$)}if(Pi.isFormData(l)&&Pi.isFunction(l.entries)){const _={};return Pi.forEachEntry(l,(g,x)=>{u(w3t(g),x,_,0)}),_}return null}function A3t(l,u,_){if(Pi.isString(l))try{return(u||JSON.parse)(l),Pi.trim(l)}catch(g){if(g.name!=="SyntaxError")throw g}return(_||JSON.stringify)(l)}const gq={transitional:SVe,adapter:["xhr","http","fetch"],transformRequest:[function(u,_){const g=_.getContentType()||"",x=g.indexOf("application/json")>-1,D=Pi.isObject(u);if(D&&Pi.isHTMLForm(u)&&(u=new FormData(u)),Pi.isFormData(u))return x?JSON.stringify(TVe(u)):u;if(Pi.isArrayBuffer(u)||Pi.isBuffer(u)||Pi.isStream(u)||Pi.isFile(u)||Pi.isBlob(u)||Pi.isReadableStream(u))return u;if(Pi.isArrayBufferView(u))return u.buffer;if(Pi.isURLSearchParams(u))return _.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),u.toString();let $;if(D){if(g.indexOf("application/x-www-form-urlencoded")>-1)return E3t(u,this.formSerializer).toString();if(($=Pi.isFileList(u))||g.indexOf("multipart/form-data")>-1){const W=this.env&&this.env.FormData;return Rne($?{"files[]":u}:u,W&&new W,this.formSerializer)}}return D||x?(_.setContentType("application/json",!1),A3t(u)):u}],transformResponse:[function(u){const _=this.transitional||gq.transitional,g=_&&_.forcedJSONParsing,x=this.responseType==="json";if(Pi.isResponse(u)||Pi.isReadableStream(u))return u;if(u&&Pi.isString(u)&&(g&&!this.responseType||x)){const I=!(_&&_.silentJSONParsing)&&x;try{return JSON.parse(u,this.parseReviver)}catch($){if(I)throw $.name==="SyntaxError"?ru.from($,ru.ERR_BAD_RESPONSE,this,null,this.response):$}}return u}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:jy.classes.FormData,Blob:jy.classes.Blob},validateStatus:function(u){return u>=200&&u<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Pi.forEach(["delete","get","head","post","put","patch"],l=>{gq.headers[l]={}});const P3t=Pi.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),N3t=l=>{const u={};let _,g,x;return l&&l.split(`
13
13
  `).forEach(function(I){x=I.indexOf(":"),_=I.substring(0,x).trim().toLowerCase(),g=I.substring(x+1).trim(),!(!_||u[_]&&P3t[_])&&(_==="set-cookie"?u[_]?u[_].push(g):u[_]=[g]:u[_]=u[_]?u[_]+", "+g:g)}),u},NUe=Symbol("internals");function Az(l){return l&&String(l).trim().toLowerCase()}function Xre(l){return l===!1||l==null?l:Pi.isArray(l)?l.map(Xre):String(l)}function I3t(l){const u=Object.create(null),_=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let g;for(;g=_.exec(l);)u[g[1]]=g[2];return u}const O3t=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function gSe(l,u,_,g,x){if(Pi.isFunction(g))return g.call(this,u,_);if(x&&(u=_),!!Pi.isString(u)){if(Pi.isString(g))return u.indexOf(g)!==-1;if(Pi.isRegExp(g))return g.test(u)}}function F3t(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(u,_,g)=>_.toUpperCase()+g)}function M3t(l,u){const _=Pi.toCamelCase(" "+u);["get","set","has"].forEach(g=>{Object.defineProperty(l,g+_,{value:function(x,D,I){return this[g].call(this,u,x,D,I)},configurable:!0})})}let p2=class{constructor(u){u&&this.set(u)}set(u,_,g){const x=this;function D($,W,ee){const R=Az(W);if(!R)throw new Error("header name must be a non-empty string");const le=Pi.findKey(x,R);(!le||x[le]===void 0||ee===!0||ee===void 0&&x[le]!==!1)&&(x[le||W]=Xre($))}const I=($,W)=>Pi.forEach($,(ee,R)=>D(ee,R,W));if(Pi.isPlainObject(u)||u instanceof this.constructor)I(u,_);else if(Pi.isString(u)&&(u=u.trim())&&!O3t(u))I(N3t(u),_);else if(Pi.isObject(u)&&Pi.isIterable(u)){let $={},W,ee;for(const R of u){if(!Pi.isArray(R))throw TypeError("Object iterator must return a key-value pair");$[ee=R[0]]=(W=$[ee])?Pi.isArray(W)?[...W,R[1]]:[W,R[1]]:R[1]}I($,_)}else u!=null&&D(_,u,g);return this}get(u,_){if(u=Az(u),u){const g=Pi.findKey(this,u);if(g){const x=this[g];if(!_)return x;if(_===!0)return I3t(x);if(Pi.isFunction(_))return _.call(this,x,g);if(Pi.isRegExp(_))return _.exec(x);throw new TypeError("parser must be boolean|regexp|function")}}}has(u,_){if(u=Az(u),u){const g=Pi.findKey(this,u);return!!(g&&this[g]!==void 0&&(!_||gSe(this,this[g],g,_)))}return!1}delete(u,_){const g=this;let x=!1;function D(I){if(I=Az(I),I){const $=Pi.findKey(g,I);$&&(!_||gSe(g,g[$],$,_))&&(delete g[$],x=!0)}}return Pi.isArray(u)?u.forEach(D):D(u),x}clear(u){const _=Object.keys(this);let g=_.length,x=!1;for(;g--;){const D=_[g];(!u||gSe(this,this[D],D,u,!0))&&(delete this[D],x=!0)}return x}normalize(u){const _=this,g={};return Pi.forEach(this,(x,D)=>{const I=Pi.findKey(g,D);if(I){_[I]=Xre(x),delete _[D];return}const $=u?F3t(D):String(D).trim();$!==D&&delete _[D],_[$]=Xre(x),g[$]=!0}),this}concat(...u){return this.constructor.concat(this,...u)}toJSON(u){const _=Object.create(null);return Pi.forEach(this,(g,x)=>{g!=null&&g!==!1&&(_[x]=u&&Pi.isArray(g)?g.join(", "):g)}),_}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([u,_])=>u+": "+_).join(`
14
14
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(u){return u instanceof this?u:new this(u)}static concat(u,..._){const g=new this(u);return _.forEach(x=>g.set(x)),g}static accessor(u){const g=(this[NUe]=this[NUe]={accessors:{}}).accessors,x=this.prototype;function D(I){const $=Az(I);g[$]||(M3t(x,I),g[$]=!0)}return Pi.isArray(u)?u.forEach(D):D(u),this}};p2.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Pi.reduceDescriptors(p2.prototype,({value:l},u)=>{let _=u[0].toUpperCase()+u.slice(1);return{get:()=>l,set(g){this[_]=g}}});Pi.freezeMethods(p2);function hSe(l,u){const _=this||gq,g=u||_,x=p2.from(g.headers);let D=g.data;return Pi.forEach(l,function($){D=$.call(_,D,x.normalize(),u?u.status:void 0)}),x.normalize(),D}function xVe(l){return!!(l&&l.__CANCEL__)}function UM(l,u,_){ru.call(this,l??"canceled",ru.ERR_CANCELED,u,_),this.name="CanceledError"}Pi.inherits(UM,ru,{__CANCEL__:!0});function kVe(l,u,_){const g=_.config.validateStatus;!_.status||!g||g(_.status)?l(_):u(new ru("Request failed with status code "+_.status,[ru.ERR_BAD_REQUEST,ru.ERR_BAD_RESPONSE][Math.floor(_.status/100)-4],_.config,_.request,_))}function L3t(l){const u=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l);return u&&u[1]||""}function R3t(l,u){l=l||10;const _=new Array(l),g=new Array(l);let x=0,D=0,I;return u=u!==void 0?u:1e3,function(W){const ee=Date.now(),R=g[D];I||(I=ee),_[x]=W,g[x]=ee;let le=D,te=0;for(;le!==x;)te+=_[le++],le=le%l;if(x=(x+1)%l,x===D&&(D=(D+1)%l),ee-I<u)return;const _e=R&&ee-R;return _e?Math.round(te*1e3/_e):void 0}}function j3t(l,u){let _=0,g=1e3/u,x,D;const I=(ee,R=Date.now())=>{_=R,x=null,D&&(clearTimeout(D),D=null),l(...ee)};return[(...ee)=>{const R=Date.now(),le=R-_;le>=g?I(ee,R):(x=ee,D||(D=setTimeout(()=>{D=null,I(x)},g-le)))},()=>x&&I(x)]}const pne=(l,u,_=3)=>{let g=0;const x=R3t(50,250);return j3t(D=>{const I=D.loaded,$=D.lengthComputable?D.total:void 0,W=I-g,ee=x(W),R=I<=$;g=I;const le={loaded:I,total:$,progress:$?I/$:void 0,bytes:W,rate:ee||void 0,estimated:ee&&$&&R?($-I)/ee:void 0,event:D,lengthComputable:$!=null,[u?"download":"upload"]:!0};l(le)},_)},IUe=(l,u)=>{const _=l!=null;return[g=>u[0]({lengthComputable:_,total:l,loaded:g}),u[1]]},OUe=l=>(...u)=>Pi.asap(()=>l(...u)),B3t=jy.hasStandardBrowserEnv?((l,u)=>_=>(_=new URL(_,jy.origin),l.protocol===_.protocol&&l.host===_.host&&(u||l.port===_.port)))(new URL(jy.origin),jy.navigator&&/(msie|trident)/i.test(jy.navigator.userAgent)):()=>!0,$3t=jy.hasStandardBrowserEnv?{write(l,u,_,g,x,D){const I=[l+"="+encodeURIComponent(u)];Pi.isNumber(_)&&I.push("expires="+new Date(_).toGMTString()),Pi.isString(g)&&I.push("path="+g),Pi.isString(x)&&I.push("domain="+x),D===!0&&I.push("secure"),document.cookie=I.join("; ")},read(l){const u=document.cookie.match(new RegExp("(^|;\\s*)("+l+")=([^;]*)"));return u?decodeURIComponent(u[3]):null},remove(l){this.write(l,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function J3t(l){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(l)}function U3t(l,u){return u?l.replace(/\/?\/$/,"")+"/"+u.replace(/^\/+/,""):l}function CVe(l,u,_){let g=!J3t(u);return l&&(g||_==!1)?U3t(l,u):u}const FUe=l=>l instanceof p2?{...l}:l;function $8(l,u){u=u||{};const _={};function g(ee,R,le,te){return Pi.isPlainObject(ee)&&Pi.isPlainObject(R)?Pi.merge.call({caseless:te},ee,R):Pi.isPlainObject(R)?Pi.merge({},R):Pi.isArray(R)?R.slice():R}function x(ee,R,le,te){if(Pi.isUndefined(R)){if(!Pi.isUndefined(ee))return g(void 0,ee,le,te)}else return g(ee,R,le,te)}function D(ee,R){if(!Pi.isUndefined(R))return g(void 0,R)}function I(ee,R){if(Pi.isUndefined(R)){if(!Pi.isUndefined(ee))return g(void 0,ee)}else return g(void 0,R)}function $(ee,R,le){if(le in u)return g(ee,R);if(le in l)return g(void 0,ee)}const W={url:D,method:D,data:D,baseURL:I,transformRequest:I,transformResponse:I,paramsSerializer:I,timeout:I,timeoutMessage:I,withCredentials:I,withXSRFToken:I,adapter:I,responseType:I,xsrfCookieName:I,xsrfHeaderName:I,onUploadProgress:I,onDownloadProgress:I,decompress:I,maxContentLength:I,maxBodyLength:I,beforeRedirect:I,transport:I,httpAgent:I,httpsAgent:I,cancelToken:I,socketPath:I,responseEncoding:I,validateStatus:$,headers:(ee,R,le)=>x(FUe(ee),FUe(R),le,!0)};return Pi.forEach(Object.keys({...l,...u}),function(R){const le=W[R]||x,te=le(l[R],u[R],R);Pi.isUndefined(te)&&le!==$||(_[R]=te)}),_}const EVe=l=>{const u=$8({},l);let{data:_,withXSRFToken:g,xsrfHeaderName:x,xsrfCookieName:D,headers:I,auth:$}=u;if(u.headers=I=p2.from(I),u.url=bVe(CVe(u.baseURL,u.url,u.allowAbsoluteUrls),l.params,l.paramsSerializer),$&&I.set("Authorization","Basic "+btoa(($.username||"")+":"+($.password?unescape(encodeURIComponent($.password)):""))),Pi.isFormData(_)){if(jy.hasStandardBrowserEnv||jy.hasStandardBrowserWebWorkerEnv)I.setContentType(void 0);else if(Pi.isFunction(_.getHeaders)){const W=_.getHeaders(),ee=["content-type","content-length"];Object.entries(W).forEach(([R,le])=>{ee.includes(R.toLowerCase())&&I.set(R,le)})}}if(jy.hasStandardBrowserEnv&&(g&&Pi.isFunction(g)&&(g=g(u)),g||g!==!1&&B3t(u.url))){const W=x&&D&&$3t.read(D);W&&I.set(x,W)}return u},z3t=typeof XMLHttpRequest<"u",q3t=z3t&&function(l){return new Promise(function(_,g){const x=EVe(l);let D=x.data;const I=p2.from(x.headers).normalize();let{responseType:$,onUploadProgress:W,onDownloadProgress:ee}=x,R,le,te,_e,Ve;function Xe(){_e&&_e(),Ve&&Ve(),x.cancelToken&&x.cancelToken.unsubscribe(R),x.signal&&x.signal.removeEventListener("abort",R)}let et=new XMLHttpRequest;et.open(x.method.toUpperCase(),x.url,!0),et.timeout=x.timeout;function bt(){if(!et)return;const ht=p2.from("getAllResponseHeaders"in et&&et.getAllResponseHeaders()),St={data:!$||$==="text"||$==="json"?et.responseText:et.response,status:et.status,statusText:et.statusText,headers:ht,config:l,request:et};kVe(function($t){_($t),Xe()},function($t){g($t),Xe()},St),et=null}"onloadend"in et?et.onloadend=bt:et.onreadystatechange=function(){!et||et.readyState!==4||et.status===0&&!(et.responseURL&&et.responseURL.indexOf("file:")===0)||setTimeout(bt)},et.onabort=function(){et&&(g(new ru("Request aborted",ru.ECONNABORTED,l,et)),et=null)},et.onerror=function(rt){const St=rt&&rt.message?rt.message:"Network Error",hr=new ru(St,ru.ERR_NETWORK,l,et);hr.event=rt||null,g(hr),et=null},et.ontimeout=function(){let rt=x.timeout?"timeout of "+x.timeout+"ms exceeded":"timeout exceeded";const St=x.transitional||SVe;x.timeoutErrorMessage&&(rt=x.timeoutErrorMessage),g(new ru(rt,St.clarifyTimeoutError?ru.ETIMEDOUT:ru.ECONNABORTED,l,et)),et=null},D===void 0&&I.setContentType(null),"setRequestHeader"in et&&Pi.forEach(I.toJSON(),function(rt,St){et.setRequestHeader(St,rt)}),Pi.isUndefined(x.withCredentials)||(et.withCredentials=!!x.withCredentials),$&&$!=="json"&&(et.responseType=x.responseType),ee&&([te,Ve]=pne(ee,!0),et.addEventListener("progress",te)),W&&et.upload&&([le,_e]=pne(W),et.upload.addEventListener("progress",le),et.upload.addEventListener("loadend",_e)),(x.cancelToken||x.signal)&&(R=ht=>{et&&(g(!ht||ht.type?new UM(null,l,et):ht),et.abort(),et=null)},x.cancelToken&&x.cancelToken.subscribe(R),x.signal&&(x.signal.aborted?R():x.signal.addEventListener("abort",R)));const pt=L3t(x.url);if(pt&&jy.protocols.indexOf(pt)===-1){g(new ru("Unsupported protocol "+pt+":",ru.ERR_BAD_REQUEST,l));return}et.send(D||null)})},V3t=(l,u)=>{const{length:_}=l=l?l.filter(Boolean):[];if(u||_){let g=new AbortController,x;const D=function(ee){if(!x){x=!0,$();const R=ee instanceof Error?ee:this.reason;g.abort(R instanceof ru?R:new UM(R instanceof Error?R.message:R))}};let I=u&&setTimeout(()=>{I=null,D(new ru(`timeout ${u} of ms exceeded`,ru.ETIMEDOUT))},u);const $=()=>{l&&(I&&clearTimeout(I),I=null,l.forEach(ee=>{ee.unsubscribe?ee.unsubscribe(D):ee.removeEventListener("abort",D)}),l=null)};l.forEach(ee=>ee.addEventListener("abort",D));const{signal:W}=g;return W.unsubscribe=()=>Pi.asap($),W}},W3t=function*(l,u){let _=l.byteLength;if(_<u){yield l;return}let g=0,x;for(;g<_;)x=g+u,yield l.slice(g,x),g=x},H3t=async function*(l,u){for await(const _ of G3t(l))yield*W3t(_,u)},G3t=async function*(l){if(l[Symbol.asyncIterator]){yield*l;return}const u=l.getReader();try{for(;;){const{done:_,value:g}=await u.read();if(_)break;yield g}}finally{await u.cancel()}},MUe=(l,u,_,g)=>{const x=H3t(l,u);let D=0,I,$=W=>{I||(I=!0,g&&g(W))};return new ReadableStream({async pull(W){try{const{done:ee,value:R}=await x.next();if(ee){$(),W.close();return}let le=R.byteLength;if(_){let te=D+=le;_(te)}W.enqueue(new Uint8Array(R))}catch(ee){throw $(ee),ee}},cancel(W){return $(W),x.return()}},{highWaterMark:2})},LUe=64*1024,{isFunction:Fre}=Pi,Y3t=(({Request:l,Response:u})=>({Request:l,Response:u}))(Pi.global),{ReadableStream:RUe,TextEncoder:jUe}=Pi.global,BUe=(l,...u)=>{try{return!!l(...u)}catch{return!1}},X3t=l=>{l=Pi.merge.call({skipUndefined:!0},Y3t,l);const{fetch:u,Request:_,Response:g}=l,x=u?Fre(u):typeof fetch=="function",D=Fre(_),I=Fre(g);if(!x)return!1;const $=x&&Fre(RUe),W=x&&(typeof jUe=="function"?(Ve=>Xe=>Ve.encode(Xe))(new jUe):async Ve=>new Uint8Array(await new _(Ve).arrayBuffer())),ee=D&&$&&BUe(()=>{let Ve=!1;const Xe=new _(jy.origin,{body:new RUe,method:"POST",get duplex(){return Ve=!0,"half"}}).headers.has("Content-Type");return Ve&&!Xe}),R=I&&$&&BUe(()=>Pi.isReadableStream(new g("").body)),le={stream:R&&(Ve=>Ve.body)};x&&["text","arrayBuffer","blob","formData","stream"].forEach(Ve=>{!le[Ve]&&(le[Ve]=(Xe,et)=>{let bt=Xe&&Xe[Ve];if(bt)return bt.call(Xe);throw new ru(`Response type '${Ve}' is not supported`,ru.ERR_NOT_SUPPORT,et)})});const te=async Ve=>{if(Ve==null)return 0;if(Pi.isBlob(Ve))return Ve.size;if(Pi.isSpecCompliantForm(Ve))return(await new _(jy.origin,{method:"POST",body:Ve}).arrayBuffer()).byteLength;if(Pi.isArrayBufferView(Ve)||Pi.isArrayBuffer(Ve))return Ve.byteLength;if(Pi.isURLSearchParams(Ve)&&(Ve=Ve+""),Pi.isString(Ve))return(await W(Ve)).byteLength},_e=async(Ve,Xe)=>{const et=Pi.toFiniteNumber(Ve.getContentLength());return et??te(Xe)};return async Ve=>{let{url:Xe,method:et,data:bt,signal:pt,cancelToken:ht,timeout:rt,onDownloadProgress:St,onUploadProgress:hr,responseType:$t,headers:or,withCredentials:Vt="same-origin",fetchOptions:mn}=EVe(Ve),vn=u||fetch;$t=$t?($t+"").toLowerCase():"text";let sr=V3t([pt,ht&&ht.toAbortSignal()],rt),Oi=null;const ci=sr&&sr.unsubscribe&&(()=>{sr.unsubscribe()});let Dt;try{if(hr&&ee&&et!=="get"&&et!=="head"&&(Dt=await _e(or,bt))!==0){let Sr=new _(Xe,{method:"POST",body:bt,duplex:"half"}),yn;if(Pi.isFormData(bt)&&(yn=Sr.headers.get("content-type"))&&or.setContentType(yn),Sr.body){const[Bn,Or]=IUe(Dt,pne(OUe(hr)));bt=MUe(Sr.body,LUe,Bn,Or)}}Pi.isString(Vt)||(Vt=Vt?"include":"omit");const ei=D&&"credentials"in _.prototype,Sn={...mn,signal:sr,method:et.toUpperCase(),headers:or.normalize().toJSON(),body:bt,duplex:"half",credentials:ei?Vt:void 0};Oi=D&&new _(Xe,Sn);let cn=await(D?vn(Oi,mn):vn(Xe,Sn));const pn=R&&($t==="stream"||$t==="response");if(R&&(St||pn&&ci)){const Sr={};["status","statusText","headers"].forEach(Yr=>{Sr[Yr]=cn[Yr]});const yn=Pi.toFiniteNumber(cn.headers.get("content-length")),[Bn,Or]=St&&IUe(yn,pne(OUe(St),!0))||[];cn=new g(MUe(cn.body,LUe,Bn,()=>{Or&&Or(),ci&&ci()}),Sr)}$t=$t||"text";let Ft=await le[Pi.findKey(le,$t)||"text"](cn,Ve);return!pn&&ci&&ci(),await new Promise((Sr,yn)=>{kVe(Sr,yn,{data:Ft,headers:p2.from(cn.headers),status:cn.status,statusText:cn.statusText,config:Ve,request:Oi})})}catch(ei){throw ci&&ci(),ei&&ei.name==="TypeError"&&/Load failed|fetch/i.test(ei.message)?Object.assign(new ru("Network Error",ru.ERR_NETWORK,Ve,Oi),{cause:ei.cause||ei}):ru.from(ei,ei&&ei.code,Ve,Oi)}}},Q3t=new Map,wVe=l=>{let u=l?l.env:{};const{fetch:_,Request:g,Response:x}=u,D=[g,x,_];let I=D.length,$=I,W,ee,R=Q3t;for(;$--;)W=D[$],ee=R.get(W),ee===void 0&&R.set(W,ee=$?new Map:X3t(u)),R=ee;return ee};wVe();const cTe={http:d3t,xhr:q3t,fetch:{get:wVe}};Pi.forEach(cTe,(l,u)=>{if(l){try{Object.defineProperty(l,"name",{value:u})}catch{}Object.defineProperty(l,"adapterName",{value:u})}});const $Ue=l=>`- ${l}`,K3t=l=>Pi.isFunction(l)||l===null||l===!1,DVe={getAdapter:(l,u)=>{l=Pi.isArray(l)?l:[l];const{length:_}=l;let g,x;const D={};for(let I=0;I<_;I++){g=l[I];let $;if(x=g,!K3t(g)&&(x=cTe[($=String(g)).toLowerCase()],x===void 0))throw new ru(`Unknown adapter '${$}'`);if(x&&(Pi.isFunction(x)||(x=x.get(u))))break;D[$||"#"+I]=x}if(!x){const I=Object.entries(D).map(([W,ee])=>`adapter ${W} `+(ee===!1?"is not supported by the environment":"is not available in the build"));let $=_?I.length>1?`since :
15
15
  `+I.map($Ue).join(`
@@ -488,4 +488,4 @@ Project '${d.projectName}' (${jI[d.projectKind]}) ${o}
488
488
  `,o++};this.projectService.externalProjects.forEach(c),this.projectService.configuredProjects.forEach(c),this.projectService.inferredProjects.forEach(c)}}this.logger.msg(a,"Err")}send(t){if(t.type==="event"&&!this.canUseEvents){this.logger.hasLevel(3)&&this.logger.info(`Session does not support events: ignored event: ${bT(t)}`);return}this.writeMessage(t)}writeMessage(t){const n=kye(t,this.logger,this.byteLength,this.host.newLine);this.host.write(n)}event(t,n){this.send(Cye(n,t))}doOutput(t,n,i,a,o,c){const d={seq:0,type:"response",command:n,request_seq:i,success:a,performanceData:o&&IMe(o)};if(a){let p;if(qa(t))d.body=t,p=t.metadata,delete t.metadata;else if(typeof t=="object")if(t.metadata){const{metadata:y,...b}=t;d.body=b,p=y}else d.body=t;else d.body=t;p&&(d.metadata=p)}else F.assert(t===void 0);c&&(d.message=c),this.send(d)}semanticCheck(t,n){var i,a;const o=Rc();(i=Hn)==null||i.push(Hn.Phase.Session,"semanticCheck",{file:t,configFilePath:n.canonicalConfigFilePath});const c=SMe(n,t)?of:n.getLanguageService().getSemanticDiagnostics(t).filter(d=>!!d.file);this.sendDiagnosticsEvent(t,n,c,"semanticDiag",o),(a=Hn)==null||a.pop()}syntacticCheck(t,n){var i,a;const o=Rc();(i=Hn)==null||i.push(Hn.Phase.Session,"syntacticCheck",{file:t,configFilePath:n.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,n,n.getLanguageService().getSyntacticDiagnostics(t),"syntaxDiag",o),(a=Hn)==null||a.pop()}suggestionCheck(t,n){var i,a;const o=Rc();(i=Hn)==null||i.push(Hn.Phase.Session,"suggestionCheck",{file:t,configFilePath:n.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,n,n.getLanguageService().getSuggestionDiagnostics(t),"suggestionDiag",o),(a=Hn)==null||a.pop()}regionSemanticCheck(t,n,i){var a,o,c;const d=Rc();(a=Hn)==null||a.push(Hn.Phase.Session,"regionSemanticCheck",{file:t,configFilePath:n.canonicalConfigFilePath});let p;if(!this.shouldDoRegionCheck(t)||!(p=n.getLanguageService().getRegionSemanticDiagnostics(t,i))){(o=Hn)==null||o.pop();return}this.sendDiagnosticsEvent(t,n,p.diagnostics,"regionSemanticDiag",d,p.spans),(c=Hn)==null||c.pop()}shouldDoRegionCheck(t){var n;const i=(n=this.projectService.getScriptInfoForNormalizedPath(t))==null?void 0:n.textStorage.getLineInfo().getLineCount();return!!(i&&i>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(t,n,i,a,o,c){try{const d=F.checkDefined(n.getScriptInfo(t)),p=Rc()-o,y={file:t,diagnostics:i.map(b=>TMe(t,n,b)),spans:c==null?void 0:c.map(b=>M0(b,d))};this.event(y,a),this.addDiagnosticsPerformanceData(t,a,p)}catch(d){this.logError(d,a)}}updateErrorCheck(t,n,i,a=!0){if(n.length===0)return;F.assert(!this.suppressDiagnosticEvents);const o=this.changeSeq,c=Math.min(i,200);let d=0;const p=()=>{if(d++,n.length>d)return t.delay("checkOne",c,b)},y=(S,E)=>{if(this.semanticCheck(S,E),this.changeSeq===o){if(this.getPreferences(S).disableSuggestions)return p();t.immediate("suggestionCheck",()=>{this.suggestionCheck(S,E),p()})}},b=()=>{if(this.changeSeq!==o)return;let S,E=n[d];if(ba(E)?E=this.toPendingErrorCheck(E):"ranges"in E&&(S=E.ranges,E=this.toPendingErrorCheck(E.file)),!E)return p();const{fileName:A,project:O}=E;if(jg(O),!!O.containsFile(A,a)&&(this.syntacticCheck(A,O),this.changeSeq===o)){if(O.projectService.serverMode!==0)return p();if(S)return t.immediate("regionSemanticCheck",()=>{const M=this.projectService.getScriptInfoForNormalizedPath(A);M&&this.regionSemanticCheck(A,O,S.map(L=>this.getRange({file:A,...L},M))),this.changeSeq===o&&t.immediate("semanticCheck",()=>y(A,O))});t.immediate("semanticCheck",()=>y(A,O))}};n.length>d&&this.changeSeq===o&&t.delay("checkOne",i,b)}cleanProjects(t,n){if(n){this.logger.info(`cleaning ${t}`);for(const i of n)i.getLanguageService(!1).cleanupSemanticCache(),i.cleanupProgram()}}cleanup(){this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",ma(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc&&(this.logger.info("host.gc()"),this.host.gc())}getEncodedSyntacticClassifications(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t);return i.getEncodedSyntacticClassifications(n,t)}getEncodedSemanticClassifications(t){const{file:n,project:i}=this.getFileAndProject(t),a=t.format==="2020"?"2020":"original";return i.getLanguageService().getEncodedSemanticClassifications(n,t,a)}getProject(t){return t===void 0?void 0:this.projectService.findProject(t)}getConfigFileAndProject(t){const n=this.getProject(t.projectFileName),i=Ac(t.file);return{configFile:n&&n.hasConfigFile(i)?i:void 0,project:n}}getConfigFileDiagnostics(t,n,i){const a=n.getAllProjectErrors(),o=n.getLanguageService().getCompilerOptionsDiagnostics(),c=sr(bn(a,o),d=>!!d.file&&d.file.fileName===t);return i?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):Dt(c,d=>i9(d,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(t){return t.map(n=>({message:N0(n.messageText,this.host.newLine),start:n.start,length:n.length,category:dC(n),code:n.code,source:n.source,startLocation:n.file&&X4(ro(n.file,n.start)),endLocation:n.file&&X4(ro(n.file,n.start+n.length)),reportsUnnecessary:n.reportsUnnecessary,reportsDeprecated:n.reportsDeprecated,relatedInformation:Dt(n.relatedInformation,Tee)}))}getCompilerOptionsDiagnostics(t){const n=this.getProject(t.projectFileName);return this.convertToDiagnosticsWithLinePosition(sr(n.getLanguageService().getCompilerOptionsDiagnostics(),i=>!i.file),void 0)}convertToDiagnosticsWithLinePosition(t,n){return t.map(i=>({message:N0(i.messageText,this.host.newLine),start:i.start,length:i.length,category:dC(i),code:i.code,source:i.source,startLocation:n&&n.positionToLineOffset(i.start),endLocation:n&&n.positionToLineOffset(i.start+i.length),reportsUnnecessary:i.reportsUnnecessary,reportsDeprecated:i.reportsDeprecated,relatedInformation:Dt(i.relatedInformation,Tee)}))}getDiagnosticsWorker(t,n,i,a){const{project:o,file:c}=this.getFileAndProject(t);if(n&&SMe(o,c))return of;const d=o.getScriptInfoForNormalizedPath(c),p=i(o,c);return a?this.convertToDiagnosticsWithLinePosition(p,d):p.map(y=>TMe(c,o,y))}getDefinition(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=this.mapDefinitionInfoLocations(a.getLanguageService().getDefinitionAtPosition(i,o)||of,a);return n?this.mapDefinitionInfo(c,a):c.map(une.mapToOriginalLocation)}mapDefinitionInfoLocations(t,n){return t.map(i=>{const a=AMe(i,n);return a?{...a,containerKind:i.containerKind,containerName:i.containerName,kind:i.kind,name:i.name,failedAliasResolution:i.failedAliasResolution,...i.unverified&&{unverified:i.unverified}}:i})}getDefinitionAndBoundSpan(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=F.checkDefined(a.getScriptInfo(i)),d=a.getLanguageService().getDefinitionAndBoundSpan(i,o);if(!d||!d.definitions)return{definitions:of,textSpan:void 0};const p=this.mapDefinitionInfoLocations(d.definitions,a),{textSpan:y}=d;return n?{definitions:this.mapDefinitionInfo(p,a),textSpan:M0(y,c)}:{definitions:p.map(une.mapToOriginalLocation),textSpan:y}}findSourceDefinition(t){var n;const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=a.getLanguageService().getDefinitionAtPosition(i,o);let d=this.mapDefinitionInfoLocations(c||of,a).slice();if(this.projectService.serverMode===0&&(!ft(d,A=>Ac(A.fileName)!==i&&!A.isAmbient)||ft(d,A=>!!A.failedAliasResolution))){const A=Kd(J=>J.textSpan.start,FQ(this.host.useCaseSensitiveFileNames));d==null||d.forEach(J=>A.add(J));const O=a.getNoDtsResolutionProject(i),M=O.getLanguageService(),L=(n=M.getDefinitionAtPosition(i,o,!0,!1))==null?void 0:n.filter(J=>Ac(J.fileName)!==i);if(ft(L))for(const J of L){if(J.unverified){const q=S(J,a.getLanguageService().getProgram(),M.getProgram());if(ft(q)){for(const z of q)A.add(z);continue}}A.add(J)}else{const J=d.filter(q=>Ac(q.fileName)!==i&&q.isAmbient);for(const q of ft(J)?J:b()){const z=y(q.fileName,i,O);if(!z)continue;const G=this.projectService.getOrCreateScriptInfoNotOpenedByClient(z,O.currentDirectory,O.directoryStructureHost,!1);if(!G)continue;O.containsScriptInfo(G)||(O.addRoot(G),O.updateGraph());const Z=M.getProgram(),ne=F.checkDefined(Z.getSourceFile(z));for(const oe of E(q.name,ne,Z))A.add(oe)}}d=ma(A.values())}return d=d.filter(A=>!A.isAmbient&&!A.failedAliasResolution),this.mapDefinitionInfo(d,a);function y(A,O,M){var L,J,q;const z=gj(A);if(z&&A.lastIndexOf(fy)===z.topLevelNodeModulesIndex){const G=A.substring(0,z.packageRootIndex),Z=(L=a.getModuleResolutionCache())==null?void 0:L.getPackageJsonInfoCache(),ne=a.getCompilationSettings(),oe=VN(ns(G,a.getCurrentDirectory()),qN(Z,a,ne));if(!oe)return;const re=tY(oe,{moduleResolution:2},a,a.getModuleResolutionCache()),Ee=A.substring(z.topLevelPackageNameIndex+1,z.packageRootIndex),pe=WN(wF(Ee)),K=a.toPath(A);if(re&&ft(re,ve=>a.toPath(ve)===K))return(J=M.resolutionCache.resolveSingleModuleNameWithoutWatching(pe,O).resolvedModule)==null?void 0:J.resolvedFileName;{const ve=A.substring(z.packageRootIndex+1),ge=`${pe}/${gp(ve)}`;return(q=M.resolutionCache.resolveSingleModuleNameWithoutWatching(ge,O).resolvedModule)==null?void 0:q.resolvedFileName}}}function b(){const A=a.getLanguageService(),O=A.getProgram(),M=qp(O.getSourceFile(i),o);return(ic(M)||Ze(M))&&Yc(M.parent)&&wce(M,L=>{var J;if(L===M)return;const q=(J=A.getDefinitionAtPosition(i,L.getStart(),!0,!1))==null?void 0:J.filter(z=>Ac(z.fileName)!==i&&z.isAmbient).map(z=>({fileName:z.fileName,name:Xm(M)}));if(ft(q))return q})||of}function S(A,O,M){var L;const J=M.getSourceFile(A.fileName);if(!J)return;const q=qp(O.getSourceFile(i),o),z=O.getTypeChecker().getSymbolAtLocation(q),G=z&&_l(z,276);if(!G)return;const Z=((L=G.propertyName)==null?void 0:L.text)||G.name.text;return E(Z,J,M)}function E(A,O,M){const L=Qc.Core.getTopMostDeclarationNamesInFile(A,O);return Or(L,J=>{const q=M.getTypeChecker().getSymbolAtLocation(J),z=q3(J);if(q&&z)return V4.createDefinitionInfo(z,M.getTypeChecker(),q,z,!0)})}}getEmitOutput(t){const{file:n,project:i}=this.getFileAndProject(t);if(!i.shouldEmitFile(i.getScriptInfo(n)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};const a=i.getLanguageService().getEmitOutput(n);return t.richResponse?{...a,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(a.diagnostics):a.diagnostics.map(o=>i9(o,!0))}:a}mapJSDocTagInfo(t,n,i){return t?t.map(a=>{var o;return{...a,text:i?this.mapDisplayParts(a.text,n):(o=a.text)==null?void 0:o.map(c=>c.text).join("")}}):[]}mapDisplayParts(t,n){return t?t.map(i=>i.kind!=="linkName"?i:{...i,target:this.toFileSpan(i.target.fileName,i.target.textSpan,n)}):[]}mapSignatureHelpItems(t,n,i){return t.map(a=>({...a,documentation:this.mapDisplayParts(a.documentation,n),parameters:a.parameters.map(o=>({...o,documentation:this.mapDisplayParts(o.documentation,n)})),tags:this.mapJSDocTagInfo(a.tags,n,i)}))}mapDefinitionInfo(t,n){return t.map(i=>({...this.toFileSpanWithContext(i.fileName,i.textSpan,i.contextSpan,n),...i.unverified&&{unverified:i.unverified}}))}static mapToOriginalLocation(t){return t.originalFileName?(F.assert(t.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...t,fileName:t.originalFileName,textSpan:t.originalTextSpan,targetFileName:t.fileName,targetTextSpan:t.textSpan,contextSpan:t.originalContextSpan,targetContextSpan:t.contextSpan}):t}toFileSpan(t,n,i){const a=i.getLanguageService(),o=a.toLineColumnOffset(t,n.start),c=a.toLineColumnOffset(t,Il(n));return{file:t,start:{line:o.line+1,offset:o.character+1},end:{line:c.line+1,offset:c.character+1}}}toFileSpanWithContext(t,n,i,a){const o=this.toFileSpan(t,n,a),c=i&&this.toFileSpan(t,i,a);return c?{...o,contextStart:c.start,contextEnd:c.end}:o}getTypeDefinition(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,n),o=this.mapDefinitionInfoLocations(i.getLanguageService().getTypeDefinitionAtPosition(n,a)||of,i);return this.mapDefinitionInfo(o,i)}mapImplementationLocations(t,n){return t.map(i=>{const a=AMe(i,n);return a?{...a,kind:i.kind,displayParts:i.displayParts}:i})}getImplementation(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=this.mapImplementationLocations(a.getLanguageService().getImplementationAtPosition(i,o)||of,a);return n?c.map(({fileName:d,textSpan:p,contextSpan:y})=>this.toFileSpanWithContext(d,p,y,a)):c.map(une.mapToOriginalLocation)}getSyntacticDiagnosticsSync(t){const{configFile:n}=this.getConfigFileAndProject(t);return n?of:this.getDiagnosticsWorker(t,!1,(i,a)=>i.getLanguageService().getSyntacticDiagnostics(a),!!t.includeLinePosition)}getSemanticDiagnosticsSync(t){const{configFile:n,project:i}=this.getConfigFileAndProject(t);return n?this.getConfigFileDiagnostics(n,i,!!t.includeLinePosition):this.getDiagnosticsWorker(t,!0,(a,o)=>a.getLanguageService().getSemanticDiagnostics(o).filter(c=>!!c.file),!!t.includeLinePosition)}getSuggestionDiagnosticsSync(t){const{configFile:n}=this.getConfigFileAndProject(t);return n?of:this.getDiagnosticsWorker(t,!0,(i,a)=>i.getLanguageService().getSuggestionDiagnostics(a),!!t.includeLinePosition)}getJsxClosingTag(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=i.getJsxClosingTagAtPosition(n,a);return o===void 0?void 0:{newText:o.newText,caretOffset:0}}getLinkedEditingRange(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=i.getLinkedEditingRangeAtPosition(n,a),c=this.projectService.getScriptInfoForNormalizedPath(n);if(!(c===void 0||o===void 0))return vvt(o,c)}getDocumentHighlights(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.getPositionInFile(t,i),c=a.getLanguageService().getDocumentHighlights(i,o,t.filesToSearch);return c?n?c.map(({fileName:d,highlightSpans:p})=>{const y=a.getScriptInfo(d);return{file:d,highlightSpans:p.map(({textSpan:b,kind:S,contextSpan:E})=>({...wye(b,E,y),kind:S}))}}):c:of}provideInlayHints(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.projectService.getScriptInfoForNormalizedPath(n);return i.getLanguageService().provideInlayHints(n,t,this.getPreferences(n)).map(c=>{const{position:d,displayParts:p}=c;return{...c,position:a.positionToLineOffset(d),displayParts:p==null?void 0:p.map(({text:y,span:b,file:S})=>{if(b){F.assertIsDefined(S,"Target file should be defined together with its span.");const E=this.projectService.getScriptInfo(S);return{text:y,span:{start:E.positionToLineOffset(b.start),end:E.positionToLineOffset(b.start+b.length),file:S}}}else return{text:y}})}})}mapCode(t){var n;const i=this.getHostFormatOptions(),a=this.getHostPreferences(),{file:o,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),d=this.projectService.getScriptInfoForNormalizedPath(o),p=(n=t.mapping.focusLocations)==null?void 0:n.map(b=>b.map(S=>{const E=d.lineOffsetToPosition(S.start.line,S.start.offset),A=d.lineOffsetToPosition(S.end.line,S.end.offset);return{start:E,length:A-E}})),y=c.mapCode(o,t.mapping.contents,p,i,a);return this.mapTextChangesToCodeEdits(y)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(t){this.projectService.setCompilerOptionsForInferredProjects(t.options,t.projectRootPath)}getProjectInfo(t){return this.getProjectInfoWorker(t.file,t.projectFileName,t.needFileNameList,t.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker(t,n,i,a,o){const{project:c}=this.getFileAndProjectWorker(t,n);return jg(c),{configFileName:c.getProjectName(),languageServiceDisabled:!c.languageServiceEnabled,fileNames:i?c.getFileNames(!1,o):void 0,configuredProjectInfo:a?this.getDefaultConfiguredProjectInfo(t):void 0}}getDefaultConfiguredProjectInfo(t){var n;const i=this.projectService.getScriptInfo(t);if(!i)return;const a=this.projectService.findDefaultConfiguredProjectWorker(i,3);if(!a)return;let o,c;return a.seenProjects.forEach((d,p)=>{p!==a.defaultProject&&(d!==3?(o??(o=[])).push(Ac(p.getConfigFilePath())):(c??(c=[])).push(Ac(p.getConfigFilePath())))}),(n=a.seenConfigs)==null||n.forEach(d=>(o??(o=[])).push(d)),{notMatchedByConfig:o,notInProject:c,defaultProject:a.defaultProject&&Ac(a.defaultProject.getConfigFilePath())}}getRenameInfo(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,n),o=this.getPreferences(n);return i.getLanguageService().getRenameInfo(n,a,o)}getProjects(t,n,i){let a,o;if(t.projectFileName){const c=this.getProject(t.projectFileName);c&&(a=[c])}else{const c=n?this.projectService.getScriptInfoEnsuringProjectsUptoDate(t.file):this.projectService.getScriptInfo(t.file);if(c)n||this.projectService.ensureDefaultProjectForFile(c);else return i?of:(this.projectService.logErrorForScriptInfoNotFound(t.file),f1.ThrowNoProject());a=c.containingProjects,o=this.projectService.getSymlinkedProjects(c)}return a=sr(a,c=>c.languageServiceEnabled&&!c.isOrphan()),!i&&(!a||!a.length)&&!o?(this.projectService.logErrorForScriptInfoNotFound(t.file??t.projectFileName),f1.ThrowNoProject()):o?{projects:a,symLinkedProjects:o}:a}getDefaultProject(t){if(t.projectFileName){const i=this.getProject(t.projectFileName);if(i)return i;if(!t.file)return f1.ThrowNoProject()}return this.projectService.getScriptInfo(t.file).getDefaultProject()}getRenameLocations(t,n){const i=Ac(t.file),a=this.getPositionInFile(t,i),o=this.getProjects(t),c=this.getDefaultProject(t),d=this.getPreferences(i),p=this.mapRenameInfo(c.getLanguageService().getRenameInfo(i,a,d),F.checkDefined(this.projectService.getScriptInfo(i)));if(!p.canRename)return n?{info:p,locs:[]}:[];const y=_vt(o,c,{fileName:t.file,pos:a},!!t.findInStrings,!!t.findInComments,d,this.host.useCaseSensitiveFileNames);return n?{info:p,locs:this.toSpanGroups(y)}:y}mapRenameInfo(t,n){if(t.canRename){const{canRename:i,fileToRename:a,displayName:o,fullDisplayName:c,kind:d,kindModifiers:p,triggerSpan:y}=t;return{canRename:i,fileToRename:a,displayName:o,fullDisplayName:c,kind:d,kindModifiers:p,triggerSpan:M0(y,n)}}else return t}toSpanGroups(t){const n=new Map;for(const{fileName:i,textSpan:a,contextSpan:o,originalContextSpan:c,originalTextSpan:d,originalFileName:p,...y}of t){let b=n.get(i);b||n.set(i,b={file:i,locs:[]});const S=F.checkDefined(this.projectService.getScriptInfo(i));b.locs.push({...wye(a,o,S),...y})}return ma(n.values())}getReferences(t,n){const i=Ac(t.file),a=this.getProjects(t),o=this.getPositionInFile(t,i),c=pvt(a,this.getDefaultProject(t),{fileName:t.file,pos:o},this.host.useCaseSensitiveFileNames,this.logger);if(!n)return c;const d=this.getPreferences(i),p=this.getDefaultProject(t),y=p.getScriptInfoForNormalizedPath(i),b=p.getLanguageService().getQuickInfoAtPosition(i,o),S=b?D5(b.displayParts):"",E=b&&b.textSpan,A=E?y.positionToLineOffset(E.start).offset:0,O=E?y.getSnapshot().getText(E.start,Il(E)):"";return{refs:pn(c,L=>L.references.map(J=>FMe(this.projectService,J,d))),symbolName:O,symbolStartOffset:A,symbolDisplayString:S}}getFileReferences(t,n){const i=this.getProjects(t),a=Ac(t.file),o=this.getPreferences(a),c={fileName:a,pos:0},d=Eye(i,this.getDefaultProject(t),c,c,EMe,b=>(this.logger.info(`Finding references to file ${a} in project ${b.getProjectName()}`),b.getLanguageService().getFileReferences(a)));let p;if(qa(d))p=d;else{p=[];const b=xee(this.host.useCaseSensitiveFileNames);d.forEach(S=>{for(const E of S)b.has(E)||(p.push(E),b.add(E))})}return n?{refs:p.map(b=>FMe(this.projectService,b,o)),symbolName:`"${t.file}"`}:p}openClientFile(t,n,i,a){this.projectService.openClientFileWithNormalizedPath(t,n,i,!1,a)}getPosition(t,n){return t.position!==void 0?t.position:n.lineOffsetToPosition(t.line,t.offset)}getPositionInFile(t,n){const i=this.projectService.getScriptInfoForNormalizedPath(n);return this.getPosition(t,i)}getFileAndProject(t){return this.getFileAndProjectWorker(t.file,t.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(t){const{file:n,project:i}=this.getFileAndProject(t);return{file:n,languageService:i.getLanguageService(!1)}}getFileAndProjectWorker(t,n){const i=Ac(t),a=this.getProject(n)||this.projectService.ensureDefaultProjectForFile(i);return{file:i,project:a}}getOutliningSpans(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getOutliningSpans(i);if(n){const c=this.projectService.getScriptInfoForNormalizedPath(i);return o.map(d=>({textSpan:M0(d.textSpan,c),hintSpan:M0(d.hintSpan,c),bannerText:d.bannerText,autoCollapse:d.autoCollapse,kind:d.kind}))}else return o}getTodoComments(t){const{file:n,project:i}=this.getFileAndProject(t);return i.getLanguageService().getTodoComments(n,t.descriptors)}getDocCommentTemplate(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getDocCommentTemplateAtPosition(n,a,this.getPreferences(n),this.getFormatOptions(n))}getSpanOfEnclosingComment(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.onlyMultiLine,o=this.getPositionInFile(t,n);return i.getSpanOfEnclosingComment(n,o,a)}getIndentation(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n),o=t.options?Y4(t.options):this.getFormatOptions(n),c=i.getIndentationAtPosition(n,a,o);return{position:a,indentation:c}}getBreakpointStatement(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getBreakpointStatementAtPosition(n,a)}getNameOrDottedNameSpan(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.getNameOrDottedNameSpan(n,a,a)}isValidBraceCompletion(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,n);return i.isValidBraceCompletionAtPosition(n,a,t.openingBrace.charCodeAt(0))}getQuickInfoWorker(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=a.getLanguageService().getQuickInfoAtPosition(i,this.getPosition(t,o));if(!c)return;const d=!!this.getPreferences(i).displayPartsForJSDoc;if(n){const p=D5(c.displayParts);return{kind:c.kind,kindModifiers:c.kindModifiers,start:o.positionToLineOffset(c.textSpan.start),end:o.positionToLineOffset(Il(c.textSpan)),displayString:p,documentation:d?this.mapDisplayParts(c.documentation,a):D5(c.documentation),tags:this.mapJSDocTagInfo(c.tags,a,d)}}else return d?c:{...c,tags:this.mapJSDocTagInfo(c.tags,a,!1)}}getFormattingEditsForRange(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.projectService.getScriptInfoForNormalizedPath(n),o=a.lineOffsetToPosition(t.line,t.offset),c=a.lineOffsetToPosition(t.endLine,t.endOffset),d=i.getFormattingEditsForRange(n,o,c,this.getFormatOptions(n));if(d)return d.map(p=>this.convertTextChangeToCodeEdit(p,a))}getFormattingEditsForRangeFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Y4(t.options):this.getFormatOptions(n);return i.getFormattingEditsForRange(n,t.position,t.endPosition,a)}getFormattingEditsForDocumentFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Y4(t.options):this.getFormatOptions(n);return i.getFormattingEditsForDocument(n,a)}getFormattingEditsAfterKeystrokeFull(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?Y4(t.options):this.getFormatOptions(n);return i.getFormattingEditsAfterKeystroke(n,t.position,t.key,a)}getFormattingEditsAfterKeystroke(t){const{file:n,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.projectService.getScriptInfoForNormalizedPath(n),o=a.lineOffsetToPosition(t.line,t.offset),c=this.getFormatOptions(n),d=i.getFormattingEditsAfterKeystroke(n,o,t.key,c);if(t.key===`
489
489
  `&&(!d||d.length===0||lvt(d,o))){const{lineText:p,absolutePosition:y}=a.textStorage.getAbsolutePositionAndLineText(t.line);if(p&&p.search("\\S")<0){const b=i.getIndentationAtPosition(n,o,c);let S=0,E,A;for(E=0,A=p.length;E<A;E++)if(p.charAt(E)===" ")S++;else if(p.charAt(E)===" ")S+=c.tabSize;else break;if(b!==S){const O=y+E;d.push({span:su(y,O),newText:Lu.getIndentationString(b,c)})}}}if(d)return d.map(p=>({start:a.positionToLineOffset(p.span.start),end:a.positionToLineOffset(Il(p.span)),newText:p.newText?p.newText:""}))}getCompletions(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getLanguageService().getCompletionsAtPosition(i,c,{...cye(this.getPreferences(i)),triggerCharacter:t.triggerCharacter,triggerKind:t.triggerKind,includeExternalModuleExports:t.includeExternalModuleExports,includeInsertTextCompletions:t.includeInsertTextCompletions},a.projectService.getFormatCodeOptions(i));if(d===void 0)return;if(n==="completions-full")return d;const p=t.prefix||"",y=Or(d.entries,S=>{if(d.isMemberCompletion||Va(S.name.toLowerCase(),p.toLowerCase())){const E=S.replacementSpan?M0(S.replacementSpan,o):void 0;return{...S,replacementSpan:E,hasAction:S.hasAction||void 0,symbol:void 0}}});return n==="completions"?(d.metadata&&(y.metadata=d.metadata),y):{...d,optionalReplacementSpan:d.optionalReplacementSpan&&M0(d.optionalReplacementSpan,o),entries:y}}getCompletionEntryDetails(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.projectService.getFormatCodeOptions(i),p=!!this.getPreferences(i).displayPartsForJSDoc,y=Or(t.entryNames,b=>{const{name:S,source:E,data:A}=typeof b=="string"?{name:b,source:void 0,data:void 0}:b;return a.getLanguageService().getCompletionEntryDetails(i,c,S,d,E,this.getPreferences(i),A?Ms(A,xvt):void 0)});return n?p?y:y.map(b=>({...b,tags:this.mapJSDocTagInfo(b.tags,a,!1)})):y.map(b=>({...b,codeActions:Dt(b.codeActions,S=>this.mapCodeAction(S)),documentation:this.mapDisplayParts(b.documentation,a),tags:this.mapJSDocTagInfo(b.tags,a,p)}))}getCompileOnSaveAffectedFileList(t){const n=this.getProjects(t,!0,!0),i=this.projectService.getScriptInfo(t.file);return i?fvt(i,a=>this.projectService.getScriptInfoForPath(a),n,(a,o)=>{if(!a.compileOnSaveEnabled||!a.languageServiceEnabled||a.isOrphan())return;const c=a.getCompilationSettings();if(!(c.noEmit||sf(o.fileName)&&!cvt(c)))return{projectFileName:a.getProjectName(),fileNames:a.getCompileOnSaveAffectedFileList(o),projectUsesOutFile:!!c.outFile}}):of}emitFile(t){const{file:n,project:i}=this.getFileAndProject(t);if(i||f1.ThrowNoProject(),!i.languageServiceEnabled)return t.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;const a=i.getScriptInfo(n),{emitSkipped:o,diagnostics:c}=i.emitFile(a,(d,p,y)=>this.host.writeFile(d,p,y));return t.richResponse?{emitSkipped:o,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):c.map(d=>i9(d,!0))}:!o}getSignatureHelpItems(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getLanguageService().getSignatureHelpItems(i,c,t),p=!!this.getPreferences(i).displayPartsForJSDoc;if(d&&n){const y=d.applicableSpan;return{...d,applicableSpan:{start:o.positionToLineOffset(y.start),end:o.positionToLineOffset(y.start+y.length)},items:this.mapSignatureHelpItems(d.items,a,p)}}else return p||!d?d:{...d,items:d.items.map(y=>({...y,tags:this.mapJSDocTagInfo(y.tags,a,!1)}))}}toPendingErrorCheck(t){const n=Ac(t),i=this.projectService.tryGetDefaultProjectForFile(n);return i&&{fileName:n,project:i}}getDiagnostics(t,n,i){this.suppressDiagnosticEvents||i.length>0&&this.updateErrorCheck(t,i,n)}change(t){const n=this.projectService.getScriptInfo(t.file);F.assert(!!n),n.textStorage.switchToScriptVersionCache();const i=n.lineOffsetToPosition(t.line,t.offset),a=n.lineOffsetToPosition(t.endLine,t.endOffset);i>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(n,ri({span:{start:i,length:a-i},newText:t.insertString})))}reload(t){const n=Ac(t.file),i=t.tmpfile===void 0?void 0:Ac(t.tmpfile),a=this.projectService.getScriptInfoForNormalizedPath(n);a&&(this.changeSeq++,a.reloadFromFile(i))}saveToTmp(t,n){const i=this.projectService.getScriptInfo(t);i&&i.saveTo(n)}closeClientFile(t){if(!t)return;const n=co(t);this.projectService.closeClientFile(n)}mapLocationNavigationBarItems(t,n){return Dt(t,i=>({text:i.text,kind:i.kind,kindModifiers:i.kindModifiers,spans:i.spans.map(a=>M0(a,n)),childItems:this.mapLocationNavigationBarItems(i.childItems,n),indent:i.indent}))}getNavigationBarItems(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getNavigationBarItems(i);return o?n?this.mapLocationNavigationBarItems(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}toLocationNavigationTree(t,n){return{text:t.text,kind:t.kind,kindModifiers:t.kindModifiers,spans:t.spans.map(i=>M0(i,n)),nameSpan:t.nameSpan&&M0(t.nameSpan,n),childItems:Dt(t.childItems,i=>this.toLocationNavigationTree(i,n))}}getNavigationTree(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=a.getNavigationTree(i);return o?n?this.toLocationNavigationTree(o,this.projectService.getScriptInfoForNormalizedPath(i)):o:void 0}getNavigateToItems(t,n){const i=this.getFullNavigateToItems(t);return n?pn(i,({project:a,navigateToItems:o})=>o.map(c=>{const d=a.getScriptInfo(c.fileName),p={name:c.name,kind:c.kind,kindModifiers:c.kindModifiers,isCaseSensitive:c.isCaseSensitive,matchKind:c.matchKind,file:c.fileName,start:d.positionToLineOffset(c.textSpan.start),end:d.positionToLineOffset(Il(c.textSpan))};return c.kindModifiers&&c.kindModifiers!==""&&(p.kindModifiers=c.kindModifiers),c.containerName&&c.containerName.length>0&&(p.containerName=c.containerName),c.containerKind&&c.containerKind.length>0&&(p.containerKind=c.containerKind),p})):pn(i,({navigateToItems:a})=>a)}getFullNavigateToItems(t){const{currentFileOnly:n,searchValue:i,maxResultCount:a,projectFileName:o}=t;if(n){F.assertIsDefined(t.file);const{file:E,project:A}=this.getFileAndProject(t);return[{project:A,navigateToItems:A.getLanguageService().getNavigateToItems(i,a,E)}]}const c=this.getHostPreferences(),d=[],p=new Map;if(!t.file&&!o)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(E=>y(E));else{const E=this.getProjects(t);CMe(E,void 0,A=>y(A))}return d;function y(E){const A=E.getLanguageService().getNavigateToItems(i,a,void 0,E.isNonTsProject(),c.excludeLibrarySymbolsInNavTo),O=sr(A,M=>b(M)&&!kee(BI(M),E));O.length&&d.push({project:E,navigateToItems:O})}function b(E){const A=E.name;if(!p.has(A))return p.set(A,[E]),!0;const O=p.get(A);for(const M of O)if(S(M,E))return!1;return O.push(E),!0}function S(E,A){return E===A?!0:!E||!A?!1:E.containerKind===A.containerKind&&E.containerName===A.containerName&&E.fileName===A.fileName&&E.isCaseSensitive===A.isCaseSensitive&&E.kind===A.kind&&E.kindModifiers===A.kindModifiers&&E.matchKind===A.matchKind&&E.name===A.name&&E.textSpan.start===A.textSpan.start&&E.textSpan.length===A.textSpan.length}}getSupportedCodeFixes(t){if(!t)return JK();if(t.file){const{file:i,project:a}=this.getFileAndProject(t);return a.getLanguageService().getSupportedCodeFixes(i)}const n=this.getProject(t.projectFileName);return n||f1.ThrowNoProject(),n.getLanguageService().getSupportedCodeFixes()}isLocation(t){return t.line!==void 0}extractPositionOrRange(t,n){let i,a;return this.isLocation(t)?i=o(t):a=this.getRange(t,n),F.checkDefined(i===void 0?a:i);function o(c){return c.position!==void 0?c.position:n.lineOffsetToPosition(c.line,c.offset)}}getRange(t,n){const{startPosition:i,endPosition:a}=this.getStartAndEndPosition(t,n);return{pos:i,end:a}}getApplicableRefactors(t){const{file:n,project:i}=this.getFileAndProject(t),a=i.getScriptInfoForNormalizedPath(n);return i.getLanguageService().getApplicableRefactors(n,this.extractPositionOrRange(t,a),this.getPreferences(n),t.triggerReason,t.kind,t.includeInteractiveActions).map(c=>({...c,actions:c.actions.map(d=>({...d,range:d.range?{start:X4({line:d.range.start.line,character:d.range.start.offset}),end:X4({line:d.range.end.line,character:d.range.end.offset})}:void 0}))}))}getEditsForRefactor(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=a.getScriptInfoForNormalizedPath(i),c=a.getLanguageService().getEditsForRefactor(i,this.getFormatOptions(i),this.extractPositionOrRange(t,o),t.refactor,t.action,this.getPreferences(i),t.interactiveRefactorArguments);if(c===void 0)return{edits:[]};if(n){const{renameFilename:d,renameLocation:p,edits:y}=c;let b;if(d!==void 0&&p!==void 0){const S=a.getScriptInfoForNormalizedPath(Ac(d));b=Dye(RD(S.getSnapshot()),d,p,y)}return{renameLocation:b,renameFilename:d,edits:this.mapTextChangesToCodeEdits(y),notApplicableReason:c.notApplicableReason}}return c}getMoveToRefactoringFileSuggestions(t){const{file:n,project:i}=this.getFileAndProject(t),a=i.getScriptInfoForNormalizedPath(n);return i.getLanguageService().getMoveToRefactoringFileSuggestions(n,this.extractPositionOrRange(t,a),this.getPreferences(n))}preparePasteEdits(t){const{file:n,project:i}=this.getFileAndProject(t);return i.getLanguageService().preparePasteEditsForFile(n,t.copiedTextSpan.map(a=>this.getRange({file:n,startLine:a.start.line,startOffset:a.start.offset,endLine:a.end.line,endOffset:a.end.offset},this.projectService.getScriptInfoForNormalizedPath(n))))}getPasteEdits(t){const{file:n,project:i}=this.getFileAndProject(t);if(RI(n))return;const a=t.copiedFrom?{file:t.copiedFrom.file,range:t.copiedFrom.spans.map(c=>this.getRange({file:t.copiedFrom.file,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(Ac(t.copiedFrom.file))))}:void 0,o=i.getLanguageService().getPasteEdits({targetFile:n,pastedText:t.pastedText,pasteLocations:t.pasteLocations.map(c=>this.getRange({file:n,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(n))),copiedFrom:a,preferences:this.getPreferences(n)},this.getFormatOptions(n));return o&&this.mapPasteEditsAction(o)}organizeImports(t,n){F.assert(t.scope.type==="file");const{file:i,project:a}=this.getFileAndProject(t.scope.args),o=a.getLanguageService().organizeImports({fileName:i,mode:t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(i),this.getPreferences(i));return n?this.mapTextChangesToCodeEdits(o):o}getEditsForFileRename(t,n){const i=Ac(t.oldFilePath),a=Ac(t.newFilePath),o=this.getHostFormatOptions(),c=this.getHostPreferences(),d=new Set,p=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(y=>{const b=y.getLanguageService().getEditsForFileRename(i,a,o,c),S=[];for(const E of b)d.has(E.fileName)||(p.push(E),S.push(E.fileName));for(const E of S)d.add(E)}),n?p.map(y=>this.mapTextChangeToCodeEdit(y)):p}getCodeFixes(t,n){const{file:i,project:a}=this.getFileAndProject(t),o=a.getScriptInfoForNormalizedPath(i),{startPosition:c,endPosition:d}=this.getStartAndEndPosition(t,o);let p;try{p=a.getLanguageService().getCodeFixesAtPosition(i,c,d,t.errorCodes,this.getFormatOptions(i),this.getPreferences(i))}catch(y){const b=a.getLanguageService(),S=[...b.getSyntacticDiagnostics(i),...b.getSemanticDiagnostics(i),...b.getSuggestionDiagnostics(i)].map(A=>h7(c,d-c,A.start,A.length)&&A.code),E=t.errorCodes.find(A=>!S.includes(A));throw E!==void 0&&(y.message=`BADCLIENT: Bad error code, ${E} not found in range ${c}..${d} (found: ${S.join(", ")}); could have caused this error:
490
490
  ${y.message}`),y}return n?p.map(y=>this.mapCodeFixAction(y)):p}getCombinedCodeFix({scope:t,fixId:n},i){F.assert(t.type==="file");const{file:a,project:o}=this.getFileAndProject(t.args),c=o.getLanguageService().getCombinedCodeFix({type:"file",fileName:a},n,this.getFormatOptions(a),this.getPreferences(a));return i?{changes:this.mapTextChangesToCodeEdits(c.changes),commands:c.commands}:c}applyCodeActionCommand(t){const n=t.command;for(const i of Ch(n)){const{file:a,project:o}=this.getFileAndProject(i);o.getLanguageService().applyCodeActionCommand(i,this.getFormatOptions(a)).then(c=>{},c=>{})}return{}}getStartAndEndPosition(t,n){let i,a;return t.startPosition!==void 0?i=t.startPosition:(i=n.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=i),t.endPosition!==void 0?a=t.endPosition:(a=n.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=a),{startPosition:i,endPosition:a}}mapCodeAction({description:t,changes:n,commands:i}){return{description:t,changes:this.mapTextChangesToCodeEdits(n),commands:i}}mapCodeFixAction({fixName:t,description:n,changes:i,commands:a,fixId:o,fixAllDescription:c}){return{fixName:t,description:n,changes:this.mapTextChangesToCodeEdits(i),commands:a,fixId:o,fixAllDescription:c}}mapPasteEditsAction({edits:t,fixId:n}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:n}}mapTextChangesToCodeEdits(t){return t.map(n=>this.mapTextChangeToCodeEdit(n))}mapTextChangeToCodeEdit(t){const n=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!n&&(n||this.projectService.logErrorForScriptInfoNotFound(t.fileName),F.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!n}))),n?{fileName:t.fileName,textChanges:t.textChanges.map(i=>hvt(i,n))}:bvt(t)}convertTextChangeToCodeEdit(t,n){return{start:n.positionToLineOffset(t.span.start),end:n.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:""}}getBraceMatching(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,o),d=a.getBraceMatchingAtPosition(i,c);return d?n?d.map(p=>M0(p,o)):d:void 0}getDiagnosticsForProject(t,n,i){if(this.suppressDiagnosticEvents)return;const{fileNames:a,languageServiceDisabled:o}=this.getProjectInfoWorker(i,void 0,!0,void 0,!0);if(o)return;const c=a.filter(M=>!M.includes("lib.d.ts"));if(c.length===0)return;const d=[],p=[],y=[],b=[],S=Ac(i),E=this.projectService.ensureDefaultProjectForFile(S);for(const M of c)this.getCanonicalFileName(M)===this.getCanonicalFileName(i)?d.push(M):this.projectService.getScriptInfo(M).isScriptOpen()?p.push(M):sf(M)?b.push(M):y.push(M);const O=[...d,...p,...y,...b].map(M=>({fileName:M,project:E}));this.updateErrorCheck(t,O,n,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,n){const{locations:i}=t,{file:a,languageService:o}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=F.checkDefined(this.projectService.getScriptInfo(a));return Dt(i,d=>{const p=this.getPosition(d,c),y=o.getSmartSelectionRange(a,p);return n?this.mapSelectionRange(y,c):y})}toggleLineComment(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfo(i),c=this.getRange(t,o),d=a.toggleLineComment(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}toggleMultilineComment(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.toggleMultilineComment(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}commentSelection(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.commentSelection(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}uncommentSelection(t,n){const{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),o=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,o),d=a.uncommentSelection(i,c);if(n){const p=this.projectService.getScriptInfoForNormalizedPath(i);return d.map(y=>this.convertTextChangeToCodeEdit(y,p))}return d}mapSelectionRange(t,n){const i={textSpan:M0(t.textSpan,n)};return t.parent&&(i.parent=this.mapSelectionRange(t.parent,n)),i}getScriptInfoFromProjectService(t){const n=Ac(t),i=this.projectService.getScriptInfoForNormalizedPath(n);return i||(this.projectService.logErrorForScriptInfoNotFound(n),f1.ThrowNoProject())}toProtocolCallHierarchyItem(t){const n=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:M0(t.span,n),selectionSpan:M0(t.selectionSpan,n)}}toProtocolCallHierarchyIncomingCall(t){const n=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(i=>M0(i,n))}}toProtocolCallHierarchyOutgoingCall(t,n){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(i=>M0(i,n))}}prepareCallHierarchy(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.projectService.getScriptInfoForNormalizedPath(n);if(a){const o=this.getPosition(t,a),c=i.getLanguageService().prepareCallHierarchy(n,o);return c&&QQ(c,d=>this.toProtocolCallHierarchyItem(d))}}provideCallHierarchyIncomingCalls(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getScriptInfoFromProjectService(n);return i.getLanguageService().provideCallHierarchyIncomingCalls(n,this.getPosition(t,a)).map(c=>this.toProtocolCallHierarchyIncomingCall(c))}provideCallHierarchyOutgoingCalls(t){const{file:n,project:i}=this.getFileAndProject(t),a=this.getScriptInfoFromProjectService(n);return i.getLanguageService().provideCallHierarchyOutgoingCalls(n,this.getPosition(t,a)).map(c=>this.toProtocolCallHierarchyOutgoingCall(c,a))}getCanonicalFileName(t){const n=this.host.useCaseSensitiveFileNames?t:f0(t);return co(n)}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,n){if(this.handlers.has(t))throw new Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,n)}setCurrentRequest(t){F.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){F.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,n,i){const a=this.performanceData;try{return this.performanceData=i,this.setCurrentRequest(t),n()}finally{this.resetCurrentRequest(t),this.performanceData=a}}executeCommand(t){const n=this.handlers.get(t.command);if(n){const i=this.executeWithRequestId(t.seq,()=>n(t),void 0);return this.projectService.enableRequestedPlugins(),i}else return this.logger.msg(`Unrecognized JSON command:${bT(t)}`,"Err"),this.doOutput(void 0,"unknown",t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var n,i,a,o,c,d,p;this.gcTimer.scheduleCollect();let y;const b=this.performanceData;this.logger.hasLevel(2)&&(y=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${lI(this.toStringMessage(t))}`));let S,E;try{S=this.parseMessage(t),E=S.arguments&&S.arguments.file?S.arguments:void 0,(n=Hn)==null||n.instant(Hn.Phase.Session,"request",{seq:S.seq,command:S.command}),(i=Hn)==null||i.push(Hn.Phase.Session,"executeCommand",{seq:S.seq,command:S.command},!0);const{response:A,responseRequired:O,performanceData:M}=this.executeCommand(S);if((a=Hn)==null||a.pop(),this.logger.hasLevel(2)){const L=ovt(this.hrtime(y)).toFixed(4);O?this.logger.perftrc(`${S.seq}::${S.command}: elapsed time (in milliseconds) ${L}`):this.logger.perftrc(`${S.seq}::${S.command}: async elapsed time (in milliseconds) ${L}`)}(o=Hn)==null||o.instant(Hn.Phase.Session,"response",{seq:S.seq,command:S.command,success:!!A}),A?this.doOutput(A,S.command,S.seq,!0,M):O&&this.doOutput(void 0,S.command,S.seq,!1,M,"No content available.")}catch(A){if((c=Hn)==null||c.popAll(),A instanceof c3){(d=Hn)==null||d.instant(Hn.Phase.Session,"commandCanceled",{seq:S==null?void 0:S.seq,command:S==null?void 0:S.command}),this.doOutput({canceled:!0},S.command,S.seq,!0,this.performanceData);return}this.logErrorWorker(A,this.toStringMessage(t),E),(p=Hn)==null||p.instant(Hn.Phase.Session,"commandError",{seq:S==null?void 0:S.seq,command:S==null?void 0:S.command,message:A.message}),this.doOutput(void 0,S?S.command:"unknown",S?S.seq:0,!1,this.performanceData,"Error processing request. "+A.message+`
491
- `+A.stack)}finally{this.performanceData=b}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function IMe(e){const t=e.diagnosticsDuration&&ma(e.diagnosticsDuration,([n,i])=>({...i,file:n}));return{...e,diagnosticsDuration:t}}function M0(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Il(e))}}function wye(e,t,n){const i=M0(e,n),a=t&&M0(t,n);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function hvt(e,t){return{start:OMe(t,e.span.start),end:OMe(t,Il(e.span)),newText:e.newText}}function OMe(e,t){return bye(e)?yvt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function vvt(e,t){const n=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function yvt(e){return{line:e.line+1,offset:e.character+1}}function bvt(e){F.assert(e.textChanges.length===1);const t=Fs(e.textChanges);return F.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function Dye(e,t,n,i){const a=Svt(e,t,i),{line:o,character:c}=_A(ww(a),n);return{line:o+1,offset:c+1}}function Svt(e,t,n){for(const{fileName:i,textChanges:a}of n)if(i===t)for(let o=a.length-1;o>=0;o--){const{newText:c,span:{start:d,length:p}}=a[o];e=e.slice(0,d)+c+e.slice(d+p)}return e}function FMe(e,{fileName:t,textSpan:n,contextSpan:i,isWriteAccess:a,isDefinition:o},{disableLineTextInReferences:c}){const d=F.checkDefined(e.getScriptInfo(t)),p=wye(n,i,d),y=c?void 0:Tvt(d,p);return{file:t,...p,lineText:y,isWriteAccess:a,isDefinition:o}}function Tvt(e,t){const n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,Il(n)).replace(/\r|\n/g,"")}function xvt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var Q4=4,Aye=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(Aye||{}),kvt=class{constructor(){this.goSubtree=!0,this.lineIndex=new a9,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new K4,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;const i=a9.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let a,o;for(let d=this.endBranch.length-1;d>=0;d--)this.endBranch[d].updateCounts(),this.endBranch[d].charCount()===0&&(o=this.endBranch[d],d>0?a=this.endBranch[d-1]:a=this.branchNode);o&&a.remove(o);const c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let d=new Array(i.length-1),p=c;for(let S=1;S<i.length;S++)d[S-1]=new iU(i[S]);let y=this.startPath.length-2;for(;y>=0;){const S=this.startPath[y];d=S.insertAt(p,d),y--,p=S}let b=d.length;for(;b>0;){const S=new K4;S.add(this.lineIndex.root),d=S.insertAt(this.lineIndex.root,d),b=d.length,this.lineIndex.root=S}this.lineIndex.root.updateCounts()}else for(let d=this.startPath.length-2;d>=0;d--)this.startPath[d].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let p=this.startPath.length-2;p>=0;p--)this.startPath[p].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,i,a){const o=this.stack[this.stack.length-1];this.state===2&&a===1&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=n);let c;function d(p){return p.isLeaf()?new iU(""):new K4}switch(a){case 0:this.goSubtree=!1,this.state!==4&&o.add(n);break;case 1:this.state===4?this.goSubtree=!1:(c=d(n),o.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=d(n),o.add(c),this.startPath.push(c)):n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&o.add(n);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):this.state===2?(this.initialText=n.text.substring(0,e),this.trailingText=n.text.substring(e+t)):this.trailingText=n.text.substring(e+t)}},Cvt=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return v7(Gf(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Cee=class fw{constructor(){this.changes=[],this.versions=new Array(fw.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%fw.maxVersions}currentVersionToIndex(){return this.currentVersion%fw.maxVersions}edit(t,n,i){this.changes.push(new Cvt(t,n,i)),(this.changes.length>fw.changeNumberThreshold||n>fw.changeLengthThreshold||i&&i.length>fw.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(const i of this.changes)n=n.edit(i.pos,i.deleteLen,i.insertedText);t=new MMe(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=fw.maxVersions&&(this.minVersion=this.currentVersion-fw.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){const n=this._getSnapshot().index,{lineText:i,absolutePosition:a}=n.lineNumberToInfo(t+1),o=i!==void 0?i.length:n.absolutePositionOfStartOfLine(t+2)-a;return Gf(a,o)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){const i=[];for(let a=t+1;a<=n;a++){const o=this.versions[this.versionToIndex(a)];for(const c of o.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return use(i)}else return;else return TL}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){const n=new fw,i=new MMe(0,n,new a9);n.versions[n.currentVersion]=i;const a=a9.linesFromText(t);return i.index.load(a.lines),n}};Cee.changeNumberThreshold=8,Cee.changeLengthThreshold=256,Cee.maxVersions=8;var Eee=Cee,MMe=class gQe{constructor(t,n,i,a=of){this.version=t,this.cache=n,this.index=i,this.changesSincePreviousVersion=a}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof gQe&&this.cache===t.cache)return this.version<=t.version?TL:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},a9=class jTe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){const{oneBasedLine:n,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){const n=this.getLineCount();if(t<=n){const{position:i,leaf:a}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:a&&a.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){const n=[];for(let i=0;i<t.length;i++)n[i]=new iU(t[i]);this.root=jTe.buildTreeFromBottom(n)}else this.root=new K4}walk(t,n,i){this.root.walk(t,n,i)}getText(t,n){let i="";return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(a,o,c)=>{i=i.concat(c.text.substring(a,a+o))}}),i}getLength(){return this.root.charCount()}every(t,n,i){i||(i=this.root.charCount());const a={goSubtree:!0,done:!1,leaf(o,c,d){t(d,o,c)||(this.done=!0)}};return this.walk(n,i-n,a),!a.done}edit(t,n,i){if(this.root.charCount()===0)return F.assert(n===0),i!==void 0?(this.load(jTe.linesFromText(i).lines),this):void 0;{let a;if(this.checkEdits){const d=this.getText(0,this.root.charCount());a=d.slice(0,t)+i+d.slice(t+n)}const o=new kvt;let c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;const d=this.getText(t,1);i?i=d+i:i=d,n=0,c=!0}else if(n>0){const d=t+n,{zeroBasedColumn:p,lineText:y}=this.positionToColumnAndLineText(d);p===0&&(n+=y.length,i=i?i+y:y)}if(this.root.walk(t,n,o),o.insertLines(i,c),this.checkEdits){const d=o.lineIndex.getText(0,o.lineIndex.getLength());F.assert(a===d,"buffer edit mismatch")}return o.lineIndex}}static buildTreeFromBottom(t){if(t.length<Q4)return new K4(t);const n=new Array(Math.ceil(t.length/Q4));let i=0;for(let a=0;a<n.length;a++){const o=Math.min(i+Q4,t.length);n[a]=new K4(t.slice(i,o)),i=o}return this.buildTreeFromBottom(n)}static linesFromText(t){const n=ww(t);if(n.length===0)return{lines:[],lineMap:n};const i=new Array(n.length),a=n.length-1;for(let c=0;c<a;c++)i[c]=t.substring(n[c],n[c+1]);const o=t.substring(n[a]);return o.length>0?i[a]=o:i.pop(),{lines:i,lineMap:n}}},K4=class BTe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(const t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,i,a,o){return i.pre&&i.pre(t,n,this.children[a],this,o),i.goSubtree?(this.children[a].walk(t,n,i),i.post&&i.post(t,n,this.children[a],this,o)):i.goSubtree=!0,i.done}skipChild(t,n,i,a,o){a.pre&&!a.done&&(a.pre(t,n,this.children[i],this,o),a.goSubtree=!0)}walk(t,n,i){if(this.children.length===0)return;let a=0,o=this.children[a].charCount(),c=t;for(;c>=o;)this.skipChild(c,n,a,i,0),c-=o,a++,o=this.children[a].charCount();if(c+n<=o){if(this.execWalk(c,n,i,a,2))return}else{if(this.execWalk(c,o-c,i,a,1))return;let d=n-(o-c);for(a++,o=this.children[a].charCount();d>o;){if(this.execWalk(0,o,i,a,3))return;d-=o,a++,o=this.children[a].charCount()}if(d>0&&this.execWalk(0,d,i,a,4))return}if(i.pre){const d=this.children.length;if(a<d-1)for(let p=a+1;p<d;p++)this.skipChild(0,0,p,i,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(const o of this.children){if(o.charCount()>n)return o.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:o.text}:o.charOffsetToLineInfo(t,n);n-=o.charCount(),t+=o.lineCount()}const i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};const a=F.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:a.charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(const i of this.children){const a=i.lineCount();if(a>=t)return i.isLeaf()?{position:n,leaf:i}:i.lineNumberToInfo(t,n);t-=a,n+=i.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n;const i=this.children.length;t++;const a=t;if(t<i){for(n=new BTe;t<i;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=a,n}remove(t){const n=this.findChildIndex(t),i=this.children.length;if(n<i-1)for(let a=n;a<i-1;a++)this.children[a]=this.children[a+1];this.children.pop()}findChildIndex(t){const n=this.children.indexOf(t);return F.assert(n!==-1),n}insertAt(t,n){let i=this.findChildIndex(t);const a=this.children.length,o=n.length;if(a<Q4&&i===a-1&&o===1)return this.add(n[0]),this.updateCounts(),[];{const c=this.splitAfter(i);let d=0;for(i++;i<Q4&&d<o;)this.children[i]=n[d],i++,d++;let p=[],y=0;if(d<o){y=Math.ceil((o-d)/Q4),p=new Array(y);let b=0;for(let E=0;E<y;E++)p[E]=new BTe;let S=p[0];for(;d<o;)S.add(n[d]),d++,S.children.length===Q4&&(b++,S=p[b]);for(let E=p.length-1;E>=0;E--)p[E].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let b=0;b<y;b++)p[b].updateCounts();return p}}add(t){this.children.push(t),F.assert(this.children.length<=Q4)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},iU=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},LMe=class hQe{constructor(t,n,i,a,o,c){this.telemetryEnabled=t,this.logger=n,this.host=i,this.globalTypingsCacheLocation=a,this.event=o,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=Op(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var n;return K2.validatePackageName(t)!==K2.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((n=this.typesRegistryCache)!=null&&n.has(t)))}installPackage(t){this.packageInstallId++;const n={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((a,o)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:a,reject:o})});return this.installer.send(n),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,n,i){const a=Lve(t,n,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${bT(a)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(a):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${a.projectName}`),this.requestQueue.enqueue(a),this.requestMap.set(a.projectName,a))}handleMessage(t){var n,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${bT(t)}`),t.kind){case GX:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case T$:{const a=(n=this.packageInstalledPromise)==null?void 0:n.get(t.id);F.assertIsDefined(a,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?a.resolve({successMessage:t.message}):a.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case $pe:{const a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case YX:{const a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case XX:{if(this.telemetryEnabled){const c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}const a={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(a,"endInstallTypes");break}case S$:{this.projectService.updateTypingsForProject(t);break}case b$:{for(this.activeRequestCount>0?this.activeRequestCount--:F.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){const a=this.requestQueue.dequeue();if(this.requestMap.get(a.projectName)===a){this.requestMap.delete(a.projectName),this.scheduleRequest(a);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${a.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case ZF:this.projectService.watchTypingLocations(t);break}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${bT(t)}`),this.installer.send(t)},hQe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};LMe.requestDelayMillis=100;var RMe=LMe,jMe={};x(jMe,{ActionInvalidate:()=>S$,ActionPackageInstalled:()=>T$,ActionSet:()=>b$,ActionWatchTypingLocations:()=>ZF,Arguments:()=>QX,AutoImportProviderProject:()=>nye,AuxiliaryProject:()=>tye,CharRangeSection:()=>Aye,CloseFileWatcherEvent:()=>dee,CommandNames:()=>xMe,ConfigFileDiagEvent:()=>lee,ConfiguredProject:()=>iye,ConfiguredProjectLoadKind:()=>uye,CreateDirectoryWatcherEvent:()=>pee,CreateFileWatcherEvent:()=>_ee,Errors:()=>f1,EventBeginInstallTypes:()=>YX,EventEndInstallTypes:()=>XX,EventInitializationFailed:()=>$pe,EventTypesRegistry:()=>GX,ExternalProject:()=>nee,GcTimer:()=>zve,InferredProject:()=>eye,LargeFileReferencedEvent:()=>cee,LineIndex:()=>a9,LineLeaf:()=>iU,LineNode:()=>K4,LogLevel:()=>Fve,Msg:()=>Mve,OpenFileInfoTelemetryEvent:()=>aye,Project:()=>QD,ProjectInfoTelemetryEvent:()=>fee,ProjectKind:()=>jI,ProjectLanguageServiceStateEvent:()=>uee,ProjectLoadingFinishEvent:()=>oee,ProjectLoadingStartEvent:()=>see,ProjectService:()=>yye,ProjectsUpdatedInBackgroundEvent:()=>tU,ScriptInfo:()=>Hve,ScriptVersionCache:()=>Eee,Session:()=>NMe,TextStorage:()=>Wve,ThrottledOperations:()=>Uve,TypingsInstallerAdapter:()=>RMe,allFilesAreJsOrDts:()=>Qve,allRootFilesAreJsOrDts:()=>Xve,asNormalizedPath:()=>Y9e,convertCompilerOptions:()=>rU,convertFormatOptions:()=>Y4,convertScriptKindName:()=>gee,convertTypeAcquisition:()=>oye,convertUserPreferences:()=>cye,convertWatchOptions:()=>n9,countEachFileTypes:()=>Z5,createInstallTypingsRequest:()=>Lve,createModuleSpecifierCache:()=>Tye,createNormalizedPathMap:()=>X9e,createPackageJsonCache:()=>xye,createSortedArray:()=>Jve,emptyArray:()=>of,findArgument:()=>XAe,formatDiagnosticToProtocol:()=>i9,formatMessage:()=>kye,getBaseConfigFileName:()=>ree,getDetailWatchInfo:()=>bee,getLocationInNewDocument:()=>Dye,hasArgument:()=>YAe,hasNoTypeScriptSource:()=>Kve,indent:()=>lI,isBackgroundProject:()=>t9,isConfigFile:()=>bye,isConfiguredProject:()=>Db,isDynamicFileName:()=>RI,isExternalProject:()=>e9,isInferredProject:()=>G4,isInferredProjectName:()=>Rve,isProjectDeferredClose:()=>r9,makeAutoImportProviderProjectName:()=>Bve,makeAuxiliaryProjectName:()=>$ve,makeInferredProjectName:()=>jve,maxFileSize:()=>aee,maxProgramSizeForNonTsFiles:()=>iee,normalizedPathToPath:()=>H4,nowString:()=>QAe,nullCancellationToken:()=>bMe,nullTypingsInstaller:()=>nU,protocol:()=>qve,scriptInfoIsContainedByBackgroundProject:()=>Gve,scriptInfoIsContainedByDeferredClosedProject:()=>Yve,stringifyIndented:()=>bT,toEvent:()=>Cye,toNormalizedPath:()=>Ac,tryConvertScriptKindName:()=>mee,typingsInstaller:()=>Ove,updateProjectIfDirty:()=>jg}),typeof console<"u"&&(F.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return u},set exports(_){u=_,l.exports&&(l.exports=_)}})})(ZSe)),ZSe.exports}enr();const tnr=oA({name:"PartnerPickerElement",setup(l,u){const{value:_}=u.element,g=w.ref(""),x=w.ref("");w.watch(_,W=>{W&&I(W)},{deep:!0});const D=exports.ppeconfig.onFetchData,I=W=>{W&&exports.ppeconfig.onFetchData(W,$)},$=(W,ee,R)=>{g.value=ee,x.value=R,_.value!=W&&(_.value=W)};return{logoUrl:g,pname:x,value:_,fetchData:I,onFetchData:D,gotData:$}}}),rnr={class:"d-flex flex-column flex-md-row gap-2"},nnr={class:"d-flex flex-row gap-2 w-100"},inr=["src"],anr={class:"w-100"},snr=["value"],onr={class:"w-100"},cnr=["value"];function lnr(l,u,_,g,x,D){const I=w.resolveComponent("ElementLayout");return w.openBlock(),w.createBlock(I,null,w.createSlots({element:w.withCtx(()=>[w.createElementVNode("div",rnr,[w.createElementVNode("div",nnr,[w.createElementVNode("img",{class:"partner-picker__logo__preview",alt:"",src:l.logoUrl},null,8,inr),w.createElementVNode("div",anr,[w.createElementVNode("input",{type:"text",class:"form-control",value:l.pname,disabled:"",placeholder:"Neve"},null,8,snr)])]),w.createElementVNode("div",onr,[w.createElementVNode("input",{id:"partner-id",type:"text",class:"form-control",value:l.value,onChange:u[0]||(u[0]=$=>l.fetchData($.target.value)),placeholder:"Azonoító"},null,40,cnr)])])]),_:2},[w.renderList(l.elementSlots,($,W)=>({name:W,fn:w.withCtx(()=>[w.renderSlot(l.$slots,W,{el$:l.el$},()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const unr=sC(tnr,[["render",lnr]]);exports.gisConfig=void 0;const fnr=l=>(exports.gisConfig=l,exports.gisConfig),_nr=oA({name:"GalleryImageSelectorElement",setup(l,u){const{value:_}=u.element,g=w.ref([]),x=W=>{_.value.activeImageIndex=0,_.value.galleryId=W.target.value,exports.gisConfig.onFetchGallery(W.target.value,ee=>{g.value=ee.items||[],$()})};w.watch(()=>_.value,(W,ee)=>{!W||(W==null?void 0:W.galleryId)===(ee==null?void 0:ee.galleryId)||exports.gisConfig.onFetchGallery(W==null?void 0:W.galleryId,R=>{g.value=R.items||[],$()})},{immediate:!0,deep:!0});const D=W=>{_.value.activeImageIndex=W.target.value,$()},I=w.ref(),$=()=>{var W;if(g.value&&_.value.activeImageIndex>=0){const ee=(W=g.value[_.value.activeImageIndex])==null?void 0:W.url;I.value=ee;return}I.value=null};return{onGalleryIdChanged:x,onActiveIndexChanged:D,imageUrl:I,value:_}}}),pnr={key:0},dnr=["src"],mnr={key:1},gnr=["value"],hnr=["value"];function vnr(l,u,_,g,x,D){const I=w.resolveComponent("ElementLayout");return w.openBlock(),w.createBlock(I,null,w.createSlots({_:2},[l.value?{name:"element",fn:w.withCtx(()=>[l.imageUrl?(w.openBlock(),w.createElementBlock("div",pnr,[w.createElementVNode("img",{class:"gallery__preview",alt:"",src:l.imageUrl},null,8,dnr)])):w.createCommentVNode("",!0),l.imageUrl?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",mnr,[...u[2]||(u[2]=[w.createElementVNode("p",{class:"gallery__preview-empty"},"Nincs kép kiválasztva!",-1)])])),w.createElementVNode("div",null,[u[3]||(u[3]=w.createElementVNode("label",{for:"galleryId",class:"form-label"},"Galéria azonosító",-1)),w.createElementVNode("input",{type:"text",id:"galleryId",placeholder:"Galéria azonosító",class:"form-control",value:l.value.galleryId,onInput:u[0]||(u[0]=$=>l.onGalleryIdChanged($))},null,40,gnr)]),w.createElementVNode("div",null,[u[4]||(u[4]=w.createElementVNode("label",{for:"activeImageIndex",class:"form-label"},"Aktív kép index",-1)),w.createElementVNode("input",{type:"number",id:"activeImageIndex",placeholder:"Aktív kép index",class:"form-control",value:l.value.activeImageIndex,onInput:u[1]||(u[1]=$=>l.onActiveIndexChanged($))},null,40,hnr)])]),key:"0"}:void 0,w.renderList(l.elementSlots,($,W)=>({name:W,fn:w.withCtx(()=>[w.renderSlot(l.$slots,W,{el$:l.el$},()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const ynr=sC(_nr,[["render",vnr]]);function bnr(l){window.dispatchEvent(new CustomEvent("toast-notification-message",{detail:l}))}function Snr(l,u,_,g){Tnr(u,_).then(x=>{l.use(z6t,{config:{url:x.url,realm:x.realm,clientId:g},init:{onLoad:"login-required",checkLoginIframe:!!x.silentSsoCheckUrl,silentCheckSsoRedirectUri:x.silentSsoCheckUrl}})})}async function Tnr(l,u){const _=Kqe(l);return new Promise((g,x)=>{_.getKeycloakConfig.routeParams.value.name="keycloak-jwt",_.getKeycloakConfig.successCallback=D=>{const I=D.environments.find($=>$.name===u);I?g(I):x(`No matching environment was found in response for ${u}`)},_.getKeycloakConfig.execute()})}const xnr={CheckBox:nq,CheckBoxList:Wqe,DropDown:BM,DropDownButton:Hqe,DropDownMenu:Ine,DropDownCallBack:$Te,ExternalArticleOfferComponent:YTe,FilterCompact:JTe,FilterControl:zTe,IconButton:L8,ImagePickerComponent:$M,InternalArticleOfferComponent:GTe,PaginatorControl:qTe,RadioButton:VTe,RadioButtonGroup:tVe,SpinningProgress:WTe,TableToList:rVe,TableToListOptions:nVe,TextListBox:iVe,ToastComponent:HTe,ToastWrapper:aVe,CalendarComponent:UTe,HeaderComponent:sVe},knr={install(l){Object.entries(xnr).forEach(([u,_])=>{l.component(u,_)})}};exports.ArticleEditorService=eVe;exports.ArticleOfferElement=frr;exports.ArticlePickerElement=Irr;exports.CalendarComponent=UTe;exports.CheckBox=nq;exports.CheckBoxList=Wqe;exports.ConfigService=Zqe;exports.DateTimePickerElement=Yrr;exports.DropDown=BM;exports.DropDownButton=Hqe;exports.DropDownCallBack=$Te;exports.DropDownMenu=Ine;exports.ExternalArticleOfferComponent=YTe;exports.ExternalArticleOfferElement=Wrr;exports.FetchDetails=JP;exports.FetchError=One;exports.FilterCompact=JTe;exports.FilterControl=zTe;exports.FilterDate=YAt;exports.FilterDropDown=GAt;exports.FilterText=HAt;exports.GalleryImageSelectorElement=ynr;exports.HeaderComponent=sVe;exports.IconButton=L8;exports.ImagePickerComponent=$M;exports.ImagePickerDetailsElement=jrr;exports.ImagePickerElement=Mrr;exports.InternalArticleOfferComponent=GTe;exports.InternalArticleOfferElement=Urr;exports.Methods=_w;exports.PaginatorControl=qTe;exports.PartnerPickerElement=unr;exports.RadioButton=VTe;exports.RadioButtonGroup=tVe;exports.SpinningProgress=WTe;exports.TableToList=rVe;exports.TableToListOptions=nVe;exports.TableToListOptionsPersister=iTe;exports.TextListBox=iVe;exports.ToastComponent=HTe;exports.ToastWrapper=aVe;exports.configureArticleOfferElement=err;exports.configureArticlePickerElement=_rr;exports.configureExternalArticleOfferElement=zrr;exports.configureGalleryImageSelectorElement=fnr;exports.configureImagePickerElement=prr;exports.configureInternalArticleOfferElement=Brr;exports.configurePartnerPickerElement=Xrr;exports.debounce=dAt;exports.default=knr;exports.initRequest=UP;exports.localDateTimeToDate=pAt;exports.localDateTimeToUTC=fAt;exports.localDateTimeToUTCDate=_At;exports.localToDateStr=iq;exports.localToStr=Qqe;exports.localToUtcStr=_ne;exports.sendMsgToToast=bnr;exports.toDateString=oAt;exports.toDateStringFromUtc=uAt;exports.toDateTimeString=cAt;exports.toDateTimeStringFromUtc=lAt;exports.useAdminKeycloak=Snr;exports.useArticleEditorService=mAt;exports.useConfigService=Kqe;
491
+ `+A.stack)}finally{this.performanceData=b}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function IMe(e){const t=e.diagnosticsDuration&&ma(e.diagnosticsDuration,([n,i])=>({...i,file:n}));return{...e,diagnosticsDuration:t}}function M0(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Il(e))}}function wye(e,t,n){const i=M0(e,n),a=t&&M0(t,n);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function hvt(e,t){return{start:OMe(t,e.span.start),end:OMe(t,Il(e.span)),newText:e.newText}}function OMe(e,t){return bye(e)?yvt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function vvt(e,t){const n=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:n,wordPattern:e.wordPattern}:{ranges:n}}function yvt(e){return{line:e.line+1,offset:e.character+1}}function bvt(e){F.assert(e.textChanges.length===1);const t=Fs(e.textChanges);return F.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function Dye(e,t,n,i){const a=Svt(e,t,i),{line:o,character:c}=_A(ww(a),n);return{line:o+1,offset:c+1}}function Svt(e,t,n){for(const{fileName:i,textChanges:a}of n)if(i===t)for(let o=a.length-1;o>=0;o--){const{newText:c,span:{start:d,length:p}}=a[o];e=e.slice(0,d)+c+e.slice(d+p)}return e}function FMe(e,{fileName:t,textSpan:n,contextSpan:i,isWriteAccess:a,isDefinition:o},{disableLineTextInReferences:c}){const d=F.checkDefined(e.getScriptInfo(t)),p=wye(n,i,d),y=c?void 0:Tvt(d,p);return{file:t,...p,lineText:y,isWriteAccess:a,isDefinition:o}}function Tvt(e,t){const n=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(n.start,Il(n)).replace(/\r|\n/g,"")}function xvt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var Q4=4,Aye=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(Aye||{}),kvt=class{constructor(){this.goSubtree=!0,this.lineIndex=new a9,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new K4,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;const i=a9.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let a,o;for(let d=this.endBranch.length-1;d>=0;d--)this.endBranch[d].updateCounts(),this.endBranch[d].charCount()===0&&(o=this.endBranch[d],d>0?a=this.endBranch[d-1]:a=this.branchNode);o&&a.remove(o);const c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let d=new Array(i.length-1),p=c;for(let S=1;S<i.length;S++)d[S-1]=new iU(i[S]);let y=this.startPath.length-2;for(;y>=0;){const S=this.startPath[y];d=S.insertAt(p,d),y--,p=S}let b=d.length;for(;b>0;){const S=new K4;S.add(this.lineIndex.root),d=S.insertAt(this.lineIndex.root,d),b=d.length,this.lineIndex.root=S}this.lineIndex.root.updateCounts()}else for(let d=this.startPath.length-2;d>=0;d--)this.startPath[d].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let p=this.startPath.length-2;p>=0;p--)this.startPath[p].updateCounts()}return this.lineIndex}post(e,t,n){n===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,n,i,a){const o=this.stack[this.stack.length-1];this.state===2&&a===1&&(this.state=1,this.branchNode=o,this.lineCollectionAtBranch=n);let c;function d(p){return p.isLeaf()?new iU(""):new K4}switch(a){case 0:this.goSubtree=!1,this.state!==4&&o.add(n);break;case 1:this.state===4?this.goSubtree=!1:(c=d(n),o.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=d(n),o.add(c),this.startPath.push(c)):n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:n.isLeaf()||(c=d(n),o.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&o.add(n);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,n){this.state===1?this.initialText=n.text.substring(0,e):this.state===2?(this.initialText=n.text.substring(0,e),this.trailingText=n.text.substring(e+t)):this.trailingText=n.text.substring(e+t)}},Cvt=class{constructor(e,t,n){this.pos=e,this.deleteLen=t,this.insertedText=n}getTextChangeRange(){return v7(Gf(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Cee=class fw{constructor(){this.changes=[],this.versions=new Array(fw.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%fw.maxVersions}currentVersionToIndex(){return this.currentVersion%fw.maxVersions}edit(t,n,i){this.changes.push(new Cvt(t,n,i)),(this.changes.length>fw.changeNumberThreshold||n>fw.changeLengthThreshold||i&&i.length>fw.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let n=t.index;for(const i of this.changes)n=n.edit(i.pos,i.deleteLen,i.insertedText);t=new MMe(this.currentVersion+1,this,n,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=fw.maxVersions&&(this.minVersion=this.currentVersion-fw.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,n){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(n-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){const n=this._getSnapshot().index,{lineText:i,absolutePosition:a}=n.lineNumberToInfo(t+1),o=i!==void 0?i.length:n.absolutePositionOfStartOfLine(t+2)-a;return Gf(a,o)}getTextChangesBetweenVersions(t,n){if(t<n)if(t>=this.minVersion){const i=[];for(let a=t+1;a<=n;a++){const o=this.versions[this.versionToIndex(a)];for(const c of o.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return use(i)}else return;else return TL}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){const n=new fw,i=new MMe(0,n,new a9);n.versions[n.currentVersion]=i;const a=a9.linesFromText(t);return i.index.load(a.lines),n}};Cee.changeNumberThreshold=8,Cee.changeLengthThreshold=256,Cee.maxVersions=8;var Eee=Cee,MMe=class gQe{constructor(t,n,i,a=of){this.version=t,this.cache=n,this.index=i,this.changesSincePreviousVersion=a}getText(t,n){return this.index.getText(t,n-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof gQe&&this.cache===t.cache)return this.version<=t.version?TL:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},a9=class jTe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){const{oneBasedLine:n,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:n,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){const n=this.getLineCount();if(t<=n){const{position:i,leaf:a}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:a&&a.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){const n=[];for(let i=0;i<t.length;i++)n[i]=new iU(t[i]);this.root=jTe.buildTreeFromBottom(n)}else this.root=new K4}walk(t,n,i){this.root.walk(t,n,i)}getText(t,n){let i="";return n>0&&t<this.root.charCount()&&this.walk(t,n,{goSubtree:!0,done:!1,leaf:(a,o,c)=>{i=i.concat(c.text.substring(a,a+o))}}),i}getLength(){return this.root.charCount()}every(t,n,i){i||(i=this.root.charCount());const a={goSubtree:!0,done:!1,leaf(o,c,d){t(d,o,c)||(this.done=!0)}};return this.walk(n,i-n,a),!a.done}edit(t,n,i){if(this.root.charCount()===0)return F.assert(n===0),i!==void 0?(this.load(jTe.linesFromText(i).lines),this):void 0;{let a;if(this.checkEdits){const d=this.getText(0,this.root.charCount());a=d.slice(0,t)+i+d.slice(t+n)}const o=new kvt;let c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;const d=this.getText(t,1);i?i=d+i:i=d,n=0,c=!0}else if(n>0){const d=t+n,{zeroBasedColumn:p,lineText:y}=this.positionToColumnAndLineText(d);p===0&&(n+=y.length,i=i?i+y:y)}if(this.root.walk(t,n,o),o.insertLines(i,c),this.checkEdits){const d=o.lineIndex.getText(0,o.lineIndex.getLength());F.assert(a===d,"buffer edit mismatch")}return o.lineIndex}}static buildTreeFromBottom(t){if(t.length<Q4)return new K4(t);const n=new Array(Math.ceil(t.length/Q4));let i=0;for(let a=0;a<n.length;a++){const o=Math.min(i+Q4,t.length);n[a]=new K4(t.slice(i,o)),i=o}return this.buildTreeFromBottom(n)}static linesFromText(t){const n=ww(t);if(n.length===0)return{lines:[],lineMap:n};const i=new Array(n.length),a=n.length-1;for(let c=0;c<a;c++)i[c]=t.substring(n[c],n[c+1]);const o=t.substring(n[a]);return o.length>0?i[a]=o:i.pop(),{lines:i,lineMap:n}}},K4=class BTe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(const t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,n,i,a,o){return i.pre&&i.pre(t,n,this.children[a],this,o),i.goSubtree?(this.children[a].walk(t,n,i),i.post&&i.post(t,n,this.children[a],this,o)):i.goSubtree=!0,i.done}skipChild(t,n,i,a,o){a.pre&&!a.done&&(a.pre(t,n,this.children[i],this,o),a.goSubtree=!0)}walk(t,n,i){if(this.children.length===0)return;let a=0,o=this.children[a].charCount(),c=t;for(;c>=o;)this.skipChild(c,n,a,i,0),c-=o,a++,o=this.children[a].charCount();if(c+n<=o){if(this.execWalk(c,n,i,a,2))return}else{if(this.execWalk(c,o-c,i,a,1))return;let d=n-(o-c);for(a++,o=this.children[a].charCount();d>o;){if(this.execWalk(0,o,i,a,3))return;d-=o,a++,o=this.children[a].charCount()}if(d>0&&this.execWalk(0,d,i,a,4))return}if(i.pre){const d=this.children.length;if(a<d-1)for(let p=a+1;p<d;p++)this.skipChild(0,0,p,i,5)}}charOffsetToLineInfo(t,n){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:n,lineText:void 0};for(const o of this.children){if(o.charCount()>n)return o.isLeaf()?{oneBasedLine:t,zeroBasedColumn:n,lineText:o.text}:o.charOffsetToLineInfo(t,n);n-=o.charCount(),t+=o.lineCount()}const i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};const a=F.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:a.charCount(),lineText:void 0}}lineNumberToInfo(t,n){for(const i of this.children){const a=i.lineCount();if(a>=t)return i.isLeaf()?{position:n,leaf:i}:i.lineNumberToInfo(t,n);t-=a,n+=i.charCount()}return{position:n,leaf:void 0}}splitAfter(t){let n;const i=this.children.length;t++;const a=t;if(t<i){for(n=new BTe;t<i;)n.add(this.children[t]),t++;n.updateCounts()}return this.children.length=a,n}remove(t){const n=this.findChildIndex(t),i=this.children.length;if(n<i-1)for(let a=n;a<i-1;a++)this.children[a]=this.children[a+1];this.children.pop()}findChildIndex(t){const n=this.children.indexOf(t);return F.assert(n!==-1),n}insertAt(t,n){let i=this.findChildIndex(t);const a=this.children.length,o=n.length;if(a<Q4&&i===a-1&&o===1)return this.add(n[0]),this.updateCounts(),[];{const c=this.splitAfter(i);let d=0;for(i++;i<Q4&&d<o;)this.children[i]=n[d],i++,d++;let p=[],y=0;if(d<o){y=Math.ceil((o-d)/Q4),p=new Array(y);let b=0;for(let E=0;E<y;E++)p[E]=new BTe;let S=p[0];for(;d<o;)S.add(n[d]),d++,S.children.length===Q4&&(b++,S=p[b]);for(let E=p.length-1;E>=0;E--)p[E].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let b=0;b<y;b++)p[b].updateCounts();return p}}add(t){this.children.push(t),F.assert(this.children.length<=Q4)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},iU=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,n){n.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},LMe=class hQe{constructor(t,n,i,a,o,c){this.telemetryEnabled=t,this.logger=n,this.host=i,this.globalTypingsCacheLocation=a,this.event=o,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=Op(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var n;return K2.validatePackageName(t)!==K2.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((n=this.typesRegistryCache)!=null&&n.has(t)))}installPackage(t){this.packageInstallId++;const n={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((a,o)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:a,reject:o})});return this.installer.send(n),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,n,i){const a=Lve(t,n,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${bT(a)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(a):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${a.projectName}`),this.requestQueue.enqueue(a),this.requestMap.set(a.projectName,a))}handleMessage(t){var n,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${bT(t)}`),t.kind){case GX:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case T$:{const a=(n=this.packageInstalledPromise)==null?void 0:n.get(t.id);F.assertIsDefined(a,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?a.resolve({successMessage:t.message}):a.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case $pe:{const a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case YX:{const a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case XX:{if(this.telemetryEnabled){const c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}const a={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(a,"endInstallTypes");break}case S$:{this.projectService.updateTypingsForProject(t);break}case b$:{for(this.activeRequestCount>0?this.activeRequestCount--:F.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){const a=this.requestQueue.dequeue();if(this.requestMap.get(a.projectName)===a){this.requestMap.delete(a.projectName),this.scheduleRequest(a);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${a.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case ZF:this.projectService.watchTypingLocations(t);break}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${bT(t)}`),this.installer.send(t)},hQe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};LMe.requestDelayMillis=100;var RMe=LMe,jMe={};x(jMe,{ActionInvalidate:()=>S$,ActionPackageInstalled:()=>T$,ActionSet:()=>b$,ActionWatchTypingLocations:()=>ZF,Arguments:()=>QX,AutoImportProviderProject:()=>nye,AuxiliaryProject:()=>tye,CharRangeSection:()=>Aye,CloseFileWatcherEvent:()=>dee,CommandNames:()=>xMe,ConfigFileDiagEvent:()=>lee,ConfiguredProject:()=>iye,ConfiguredProjectLoadKind:()=>uye,CreateDirectoryWatcherEvent:()=>pee,CreateFileWatcherEvent:()=>_ee,Errors:()=>f1,EventBeginInstallTypes:()=>YX,EventEndInstallTypes:()=>XX,EventInitializationFailed:()=>$pe,EventTypesRegistry:()=>GX,ExternalProject:()=>nee,GcTimer:()=>zve,InferredProject:()=>eye,LargeFileReferencedEvent:()=>cee,LineIndex:()=>a9,LineLeaf:()=>iU,LineNode:()=>K4,LogLevel:()=>Fve,Msg:()=>Mve,OpenFileInfoTelemetryEvent:()=>aye,Project:()=>QD,ProjectInfoTelemetryEvent:()=>fee,ProjectKind:()=>jI,ProjectLanguageServiceStateEvent:()=>uee,ProjectLoadingFinishEvent:()=>oee,ProjectLoadingStartEvent:()=>see,ProjectService:()=>yye,ProjectsUpdatedInBackgroundEvent:()=>tU,ScriptInfo:()=>Hve,ScriptVersionCache:()=>Eee,Session:()=>NMe,TextStorage:()=>Wve,ThrottledOperations:()=>Uve,TypingsInstallerAdapter:()=>RMe,allFilesAreJsOrDts:()=>Qve,allRootFilesAreJsOrDts:()=>Xve,asNormalizedPath:()=>Y9e,convertCompilerOptions:()=>rU,convertFormatOptions:()=>Y4,convertScriptKindName:()=>gee,convertTypeAcquisition:()=>oye,convertUserPreferences:()=>cye,convertWatchOptions:()=>n9,countEachFileTypes:()=>Z5,createInstallTypingsRequest:()=>Lve,createModuleSpecifierCache:()=>Tye,createNormalizedPathMap:()=>X9e,createPackageJsonCache:()=>xye,createSortedArray:()=>Jve,emptyArray:()=>of,findArgument:()=>XAe,formatDiagnosticToProtocol:()=>i9,formatMessage:()=>kye,getBaseConfigFileName:()=>ree,getDetailWatchInfo:()=>bee,getLocationInNewDocument:()=>Dye,hasArgument:()=>YAe,hasNoTypeScriptSource:()=>Kve,indent:()=>lI,isBackgroundProject:()=>t9,isConfigFile:()=>bye,isConfiguredProject:()=>Db,isDynamicFileName:()=>RI,isExternalProject:()=>e9,isInferredProject:()=>G4,isInferredProjectName:()=>Rve,isProjectDeferredClose:()=>r9,makeAutoImportProviderProjectName:()=>Bve,makeAuxiliaryProjectName:()=>$ve,makeInferredProjectName:()=>jve,maxFileSize:()=>aee,maxProgramSizeForNonTsFiles:()=>iee,normalizedPathToPath:()=>H4,nowString:()=>QAe,nullCancellationToken:()=>bMe,nullTypingsInstaller:()=>nU,protocol:()=>qve,scriptInfoIsContainedByBackgroundProject:()=>Gve,scriptInfoIsContainedByDeferredClosedProject:()=>Yve,stringifyIndented:()=>bT,toEvent:()=>Cye,toNormalizedPath:()=>Ac,tryConvertScriptKindName:()=>mee,typingsInstaller:()=>Ove,updateProjectIfDirty:()=>jg}),typeof console<"u"&&(F.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return u},set exports(_){u=_,l.exports&&(l.exports=_)}})})(ZSe)),ZSe.exports}enr();const tnr=oA({name:"PartnerPickerElement",setup(l,u){const{value:_}=u.element,g=w.ref(""),x=w.ref("");w.watch(_,W=>{W&&I(W)},{deep:!0});const D=exports.ppeconfig.onFetchData,I=W=>{W&&exports.ppeconfig.onFetchData(W,$)},$=(W,ee,R)=>{g.value=ee,x.value=R,_.value!=W&&(_.value=W)};return{logoUrl:g,pname:x,value:_,fetchData:I,onFetchData:D,gotData:$}}}),rnr={class:"d-flex flex-column flex-md-row gap-2"},nnr={class:"d-flex flex-row gap-2 w-100"},inr=["src"],anr={class:"w-100"},snr=["value"],onr={class:"w-100"},cnr=["value"];function lnr(l,u,_,g,x,D){const I=w.resolveComponent("ElementLayout");return w.openBlock(),w.createBlock(I,null,w.createSlots({element:w.withCtx(()=>[w.createElementVNode("div",rnr,[w.createElementVNode("div",nnr,[w.createElementVNode("img",{class:"partner-picker__logo__preview",alt:"",src:l.logoUrl},null,8,inr),w.createElementVNode("div",anr,[w.createElementVNode("input",{type:"text",class:"form-control",value:l.pname,disabled:"",placeholder:"Neve"},null,8,snr)])]),w.createElementVNode("div",onr,[w.createElementVNode("input",{id:"partner-id",type:"text",class:"form-control",value:l.value,onChange:u[0]||(u[0]=$=>l.fetchData($.target.value)),placeholder:"Azonoító"},null,40,cnr)])])]),_:2},[w.renderList(l.elementSlots,($,W)=>({name:W,fn:w.withCtx(()=>[w.renderSlot(l.$slots,W,{el$:l.el$},()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const unr=sC(tnr,[["render",lnr]]);exports.gisConfig=void 0;const fnr=l=>(exports.gisConfig=l,exports.gisConfig),_nr=oA({name:"GalleryImageSelectorElement",setup(l,u){const{value:_}=u.element,g=w.ref([]),x=W=>{_.value.activeImageIndex=0,_.value.galleryId=W.target.value,exports.gisConfig.onFetchGallery(W.target.value,ee=>{g.value=ee.items||[],$()})};w.watch(()=>_.value,(W,ee)=>{!W||(W==null?void 0:W.galleryId)===(ee==null?void 0:ee.galleryId)||exports.gisConfig.onFetchGallery(W==null?void 0:W.galleryId,R=>{g.value=R.items||[],$()})},{immediate:!0,deep:!0});const D=W=>{_.value.activeImageIndex=W.target.value,$()},I=w.ref(),$=()=>{var W;if(g.value&&_.value.activeImageIndex>=0){const ee=(W=g.value[_.value.activeImageIndex])==null?void 0:W.url;I.value=ee;return}I.value=null};return{onGalleryIdChanged:x,onActiveIndexChanged:D,imageUrl:I,value:_}}}),pnr={key:0},dnr=["src"],mnr={key:1},gnr=["value"],hnr=["value"];function vnr(l,u,_,g,x,D){const I=w.resolveComponent("ElementLayout");return w.openBlock(),w.createBlock(I,null,w.createSlots({_:2},[l.value?{name:"element",fn:w.withCtx(()=>[l.imageUrl?(w.openBlock(),w.createElementBlock("div",pnr,[w.createElementVNode("img",{class:"gallery__preview",alt:"",src:l.imageUrl},null,8,dnr)])):w.createCommentVNode("",!0),l.imageUrl?w.createCommentVNode("",!0):(w.openBlock(),w.createElementBlock("div",mnr,[...u[2]||(u[2]=[w.createElementVNode("p",{class:"gallery__preview-empty"},"Nincs kép kiválasztva!",-1)])])),w.createElementVNode("div",null,[u[3]||(u[3]=w.createElementVNode("label",{for:"galleryId",class:"form-label"},"Galéria azonosító",-1)),w.createElementVNode("input",{type:"text",id:"galleryId",placeholder:"Galéria azonosító",class:"form-control",value:l.value.galleryId,onInput:u[0]||(u[0]=$=>l.onGalleryIdChanged($))},null,40,gnr)]),w.createElementVNode("div",null,[u[4]||(u[4]=w.createElementVNode("label",{for:"activeImageIndex",class:"form-label"},"Aktív kép index",-1)),w.createElementVNode("input",{type:"number",id:"activeImageIndex",placeholder:"Aktív kép index",class:"form-control",value:l.value.activeImageIndex,onInput:u[1]||(u[1]=$=>l.onActiveIndexChanged($))},null,40,hnr)])]),key:"0"}:void 0,w.renderList(l.elementSlots,($,W)=>({name:W,fn:w.withCtx(()=>[w.renderSlot(l.$slots,W,{el$:l.el$},()=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent($),{el$:l.el$},null,8,["el$"]))])])}))]),1024)}const ynr=sC(_nr,[["render",vnr]]);function bnr(l){window.dispatchEvent(new CustomEvent("toast-notification-message",{detail:l}))}function Snr(l,u,_,g){Tnr(u,_).then(x=>{l.use(z6t,{config:{url:x.url,realm:x.realm,clientId:g},init:{onLoad:"login-required",checkLoginIframe:!!x.silentSsoCheckUrl,silentCheckSsoRedirectUri:x.silentSsoCheckUrl}})})}async function Tnr(l,u){const _=Kqe(l);return new Promise((g,x)=>{_.getKeycloakConfig.routeParams.value.name="keycloak-jwt",_.getKeycloakConfig.successCallback=D=>{const I=D.environments.find($=>$.name===u);I?(console.info("selected keycloak config: ",I),g(I)):(console.error(`No matching environment was found in response for ${u}`),x(`No matching environment was found in response for ${u}`))},_.getKeycloakConfig.execute()})}const xnr={CheckBox:nq,CheckBoxList:Wqe,DropDown:BM,DropDownButton:Hqe,DropDownMenu:Ine,DropDownCallBack:$Te,ExternalArticleOfferComponent:YTe,FilterCompact:JTe,FilterControl:zTe,IconButton:L8,ImagePickerComponent:$M,InternalArticleOfferComponent:GTe,PaginatorControl:qTe,RadioButton:VTe,RadioButtonGroup:tVe,SpinningProgress:WTe,TableToList:rVe,TableToListOptions:nVe,TextListBox:iVe,ToastComponent:HTe,ToastWrapper:aVe,CalendarComponent:UTe,HeaderComponent:sVe},knr={install(l){Object.entries(xnr).forEach(([u,_])=>{l.component(u,_)})}};exports.ArticleEditorService=eVe;exports.ArticleOfferElement=frr;exports.ArticlePickerElement=Irr;exports.CalendarComponent=UTe;exports.CheckBox=nq;exports.CheckBoxList=Wqe;exports.ConfigService=Zqe;exports.DateTimePickerElement=Yrr;exports.DropDown=BM;exports.DropDownButton=Hqe;exports.DropDownCallBack=$Te;exports.DropDownMenu=Ine;exports.ExternalArticleOfferComponent=YTe;exports.ExternalArticleOfferElement=Wrr;exports.FetchDetails=JP;exports.FetchError=One;exports.FilterCompact=JTe;exports.FilterControl=zTe;exports.FilterDate=YAt;exports.FilterDropDown=GAt;exports.FilterText=HAt;exports.GalleryImageSelectorElement=ynr;exports.HeaderComponent=sVe;exports.IconButton=L8;exports.ImagePickerComponent=$M;exports.ImagePickerDetailsElement=jrr;exports.ImagePickerElement=Mrr;exports.InternalArticleOfferComponent=GTe;exports.InternalArticleOfferElement=Urr;exports.Methods=_w;exports.PaginatorControl=qTe;exports.PartnerPickerElement=unr;exports.RadioButton=VTe;exports.RadioButtonGroup=tVe;exports.SpinningProgress=WTe;exports.TableToList=rVe;exports.TableToListOptions=nVe;exports.TableToListOptionsPersister=iTe;exports.TextListBox=iVe;exports.ToastComponent=HTe;exports.ToastWrapper=aVe;exports.configureArticleOfferElement=err;exports.configureArticlePickerElement=_rr;exports.configureExternalArticleOfferElement=zrr;exports.configureGalleryImageSelectorElement=fnr;exports.configureImagePickerElement=prr;exports.configureInternalArticleOfferElement=Brr;exports.configurePartnerPickerElement=Xrr;exports.debounce=dAt;exports.default=knr;exports.initRequest=UP;exports.localDateTimeToDate=pAt;exports.localDateTimeToUTC=fAt;exports.localDateTimeToUTCDate=_At;exports.localToDateStr=iq;exports.localToStr=Qqe;exports.localToUtcStr=_ne;exports.sendMsgToToast=bnr;exports.toDateString=oAt;exports.toDateStringFromUtc=uAt;exports.toDateTimeString=cAt;exports.toDateTimeStringFromUtc=lAt;exports.useAdminKeycloak=Snr;exports.useArticleEditorService=mAt;exports.useConfigService=Kqe;
@@ -1855,7 +1855,7 @@ class o7 {
1855
1855
  constructor(u, _, g, x, w = "application/json", I, B) {
1856
1856
  Ph(this, "fetchMethode");
1857
1857
  Ph(this, "isIpInUrl", (u) => /(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/.test(u));
1858
- this.relativeUrl = _, this.method = g, this.fetchMethode = XAt({
1858
+ this.relativeUrl = _, this.method = g, console.info("sendKeycloakBearer: ", B), this.fetchMethode = XAt({
1859
1859
  baseUrl: u,
1860
1860
  fetchOptions: {
1861
1861
  credentials: u.indexOf("localhost") != -1 || this.isIpInUrl(u) ? "omit" : "include"
@@ -1868,8 +1868,9 @@ class o7 {
1868
1868
  ...W.options.headers,
1869
1869
  ...I
1870
1870
  }), B) {
1871
+ console.info("initializing keycloak bearer...");
1871
1872
  const L = RAt();
1872
- await ((Z = L.keycloak) == null ? void 0 : Z.updateToken()), W.options.headers = {
1873
+ await ((Z = L.keycloak) == null ? void 0 : Z.updateToken()), console.info("got token: ", L.token), W.options.headers = {
1873
1874
  ...W.options.headers,
1874
1875
  Authorization: L.token
1875
1876
  };
@@ -193513,7 +193514,7 @@ async function Ynr(l, u) {
193513
193514
  return new Promise((g, x) => {
193514
193515
  _.getKeycloakConfig.routeParams.value.name = "keycloak-jwt", _.getKeycloakConfig.successCallback = (w) => {
193515
193516
  const I = w.environments.find((B) => B.name === u);
193516
- I ? g(I) : x(`No matching environment was found in response for ${u}`);
193517
+ I ? (console.info("selected keycloak config: ", I), g(I)) : (console.error(`No matching environment was found in response for ${u}`), x(`No matching environment was found in response for ${u}`));
193517
193518
  }, _.getKeycloakConfig.execute();
193518
193519
  });
193519
193520
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "admins-components",
3
- "version": "5.0.7",
3
+ "version": "5.0.8",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"