mateu-vaadin 0.0.2 → 0.0.3

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.
@@ -21516,7 +21516,7 @@ To prevent other runtimes from defining tags that you use, consider using scopin
21516
21516
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Q){return Q instanceof this?Q:new this(Q)}static concat(Q,...X){const ee=new this(Q);return X.forEach(ie=>ee.set(ie)),ee}static accessor(Q){const ee=(this[$internals]=this[$internals]={accessors:{}}).accessors,ie=this.prototype;function oe(ne){const ae=normalizeHeader(ne);ee[ae]||(buildAccessors(ie,ne),ee[ae]=!0)}return utils$1.isArray(Q)?Q.forEach(oe):oe(Q),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders$1.prototype,({value:te},Q)=>{let X=Q[0].toUpperCase()+Q.slice(1);return{get:()=>te,set(ee){this[X]=ee}}});utils$1.freezeMethods(AxiosHeaders$1);function transformData(te,Q){const X=this||defaults$1,ee=Q||X,ie=AxiosHeaders$1.from(ee.headers);let oe=ee.data;return utils$1.forEach(te,function(ae){oe=ae.call(X,oe,ie.normalize(),Q?Q.status:void 0)}),ie.normalize(),oe}function isCancel$1(te){return!!(te&&te.__CANCEL__)}function CanceledError$1(te,Q,X){AxiosError$1.call(this,te??"canceled",AxiosError$1.ERR_CANCELED,Q,X),this.name="CanceledError"}utils$1.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(te,Q,X){const ee=X.config.validateStatus;!X.status||!ee||ee(X.status)?te(X):Q(new AxiosError$1("Request failed with status code "+X.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(X.status/100)-4],X.config,X.request,X))}function parseProtocol(te){const Q=/^([-+\w]{1,25})(:?\/\/|:)/.exec(te);return Q&&Q[1]||""}function speedometer(te,Q){te=te||10;const X=new Array(te),ee=new Array(te);let ie=0,oe=0,ne;return Q=Q!==void 0?Q:1e3,function(se){const le=Date.now(),de=ee[oe];ne||(ne=le),X[ie]=se,ee[ie]=le;let ce=oe,he=0;for(;ce!==ie;)he+=X[ce++],ce=ce%te;if(ie=(ie+1)%te,ie===oe&&(oe=(oe+1)%te),le-ne<Q)return;const ue=de&&le-de;return ue?Math.round(he*1e3/ue):void 0}}function throttle(te,Q){let X=0,ee=1e3/Q,ie,oe;const ne=(le,de=Date.now())=>{X=de,ie=null,oe&&(clearTimeout(oe),oe=null),te(...le)};return[(...le)=>{const de=Date.now(),ce=de-X;ce>=ee?ne(le,de):(ie=le,oe||(oe=setTimeout(()=>{oe=null,ne(ie)},ee-ce)))},()=>ie&&ne(ie)]}const progressEventReducer=(te,Q,X=3)=>{let ee=0;const ie=speedometer(50,250);return throttle(oe=>{const ne=oe.loaded,ae=oe.lengthComputable?oe.total:void 0,se=ne-ee,le=ie(se),de=ne<=ae;ee=ne;const ce={loaded:ne,total:ae,progress:ae?ne/ae:void 0,bytes:se,rate:le||void 0,estimated:le&&ae&&de?(ae-ne)/le:void 0,event:oe,lengthComputable:ae!=null,[Q?"download":"upload"]:!0};te(ce)},X)},progressEventDecorator=(te,Q)=>{const X=te!=null;return[ee=>Q[0]({lengthComputable:X,total:te,loaded:ee}),Q[1]]},asyncDecorator=te=>(...Q)=>utils$1.asap(()=>te(...Q)),isURLSameOrigin=platform.hasStandardBrowserEnv?((te,Q)=>X=>(X=new URL(X,platform.origin),te.protocol===X.protocol&&te.host===X.host&&(Q||te.port===X.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(te,Q,X,ee,ie,oe){const ne=[te+"="+encodeURIComponent(Q)];utils$1.isNumber(X)&&ne.push("expires="+new Date(X).toGMTString()),utils$1.isString(ee)&&ne.push("path="+ee),utils$1.isString(ie)&&ne.push("domain="+ie),oe===!0&&ne.push("secure"),document.cookie=ne.join("; ")},read(te){const Q=document.cookie.match(new RegExp("(^|;\\s*)("+te+")=([^;]*)"));return Q?decodeURIComponent(Q[3]):null},remove(te){this.write(te,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(te){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(te)}function combineURLs(te,Q){return Q?te.replace(/\/?\/$/,"")+"/"+Q.replace(/^\/+/,""):te}function buildFullPath(te,Q,X){let ee=!isAbsoluteURL(Q);return te&&(ee||X==!1)?combineURLs(te,Q):Q}const headersToObject=te=>te instanceof AxiosHeaders$1?{...te}:te;function mergeConfig$1(te,Q){Q=Q||{};const X={};function ee(le,de,ce,he){return utils$1.isPlainObject(le)&&utils$1.isPlainObject(de)?utils$1.merge.call({caseless:he},le,de):utils$1.isPlainObject(de)?utils$1.merge({},de):utils$1.isArray(de)?de.slice():de}function ie(le,de,ce,he){if(utils$1.isUndefined(de)){if(!utils$1.isUndefined(le))return ee(void 0,le,ce,he)}else return ee(le,de,ce,he)}function oe(le,de){if(!utils$1.isUndefined(de))return ee(void 0,de)}function ne(le,de){if(utils$1.isUndefined(de)){if(!utils$1.isUndefined(le))return ee(void 0,le)}else return ee(void 0,de)}function ae(le,de,ce){if(ce in Q)return ee(le,de);if(ce in te)return ee(void 0,le)}const se={url:oe,method:oe,data:oe,baseURL:ne,transformRequest:ne,transformResponse:ne,paramsSerializer:ne,timeout:ne,timeoutMessage:ne,withCredentials:ne,withXSRFToken:ne,adapter:ne,responseType:ne,xsrfCookieName:ne,xsrfHeaderName:ne,onUploadProgress:ne,onDownloadProgress:ne,decompress:ne,maxContentLength:ne,maxBodyLength:ne,beforeRedirect:ne,transport:ne,httpAgent:ne,httpsAgent:ne,cancelToken:ne,socketPath:ne,responseEncoding:ne,validateStatus:ae,headers:(le,de,ce)=>ie(headersToObject(le),headersToObject(de),ce,!0)};return utils$1.forEach(Object.keys({...te,...Q}),function(de){const ce=se[de]||ie,he=ce(te[de],Q[de],de);utils$1.isUndefined(he)&&ce!==ae||(X[de]=he)}),X}const resolveConfig=te=>{const Q=mergeConfig$1({},te);let{data:X,withXSRFToken:ee,xsrfHeaderName:ie,xsrfCookieName:oe,headers:ne,auth:ae}=Q;Q.headers=ne=AxiosHeaders$1.from(ne),Q.url=buildURL(buildFullPath(Q.baseURL,Q.url,Q.allowAbsoluteUrls),te.params,te.paramsSerializer),ae&&ne.set("Authorization","Basic "+btoa((ae.username||"")+":"+(ae.password?unescape(encodeURIComponent(ae.password)):"")));let se;if(utils$1.isFormData(X)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)ne.setContentType(void 0);else if((se=ne.getContentType())!==!1){const[le,...de]=se?se.split(";").map(ce=>ce.trim()).filter(Boolean):[];ne.setContentType([le||"multipart/form-data",...de].join("; "))}}if(platform.hasStandardBrowserEnv&&(ee&&utils$1.isFunction(ee)&&(ee=ee(Q)),ee||ee!==!1&&isURLSameOrigin(Q.url))){const le=ie&&oe&&cookies.read(oe);le&&ne.set(ie,le)}return Q},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(te){return new Promise(function(X,ee){const ie=resolveConfig(te);let oe=ie.data;const ne=AxiosHeaders$1.from(ie.headers).normalize();let{responseType:ae,onUploadProgress:se,onDownloadProgress:le}=ie,de,ce,he,ue,pe;function fe(){ue&&ue(),pe&&pe(),ie.cancelToken&&ie.cancelToken.unsubscribe(de),ie.signal&&ie.signal.removeEventListener("abort",de)}let ve=new XMLHttpRequest;ve.open(ie.method.toUpperCase(),ie.url,!0),ve.timeout=ie.timeout;function me(){if(!ve)return;const _e=AxiosHeaders$1.from("getAllResponseHeaders"in ve&&ve.getAllResponseHeaders()),ye={data:!ae||ae==="text"||ae==="json"?ve.responseText:ve.response,status:ve.status,statusText:ve.statusText,headers:_e,config:te,request:ve};settle(function(we){X(we),fe()},function(we){ee(we),fe()},ye),ve=null}"onloadend"in ve?ve.onloadend=me:ve.onreadystatechange=function(){!ve||ve.readyState!==4||ve.status===0&&!(ve.responseURL&&ve.responseURL.indexOf("file:")===0)||setTimeout(me)},ve.onabort=function(){ve&&(ee(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,te,ve)),ve=null)},ve.onerror=function(){ee(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,te,ve)),ve=null},ve.ontimeout=function(){let be=ie.timeout?"timeout of "+ie.timeout+"ms exceeded":"timeout exceeded";const ye=ie.transitional||transitionalDefaults;ie.timeoutErrorMessage&&(be=ie.timeoutErrorMessage),ee(new AxiosError$1(be,ye.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,te,ve)),ve=null},oe===void 0&&ne.setContentType(null),"setRequestHeader"in ve&&utils$1.forEach(ne.toJSON(),function(be,ye){ve.setRequestHeader(ye,be)}),utils$1.isUndefined(ie.withCredentials)||(ve.withCredentials=!!ie.withCredentials),ae&&ae!=="json"&&(ve.responseType=ie.responseType),le&&([he,pe]=progressEventReducer(le,!0),ve.addEventListener("progress",he)),se&&ve.upload&&([ce,ue]=progressEventReducer(se),ve.upload.addEventListener("progress",ce),ve.upload.addEventListener("loadend",ue)),(ie.cancelToken||ie.signal)&&(de=_e=>{ve&&(ee(!_e||_e.type?new CanceledError$1(null,te,ve):_e),ve.abort(),ve=null)},ie.cancelToken&&ie.cancelToken.subscribe(de),ie.signal&&(ie.signal.aborted?de():ie.signal.addEventListener("abort",de)));const ge=parseProtocol(ie.url);if(ge&&platform.protocols.indexOf(ge)===-1){ee(new AxiosError$1("Unsupported protocol "+ge+":",AxiosError$1.ERR_BAD_REQUEST,te));return}ve.send(oe||null)})},composeSignals=(te,Q)=>{const{length:X}=te=te?te.filter(Boolean):[];if(Q||X){let ee=new AbortController,ie;const oe=function(le){if(!ie){ie=!0,ae();const de=le instanceof Error?le:this.reason;ee.abort(de instanceof AxiosError$1?de:new CanceledError$1(de instanceof Error?de.message:de))}};let ne=Q&&setTimeout(()=>{ne=null,oe(new AxiosError$1(`timeout ${Q} of ms exceeded`,AxiosError$1.ETIMEDOUT))},Q);const ae=()=>{te&&(ne&&clearTimeout(ne),ne=null,te.forEach(le=>{le.unsubscribe?le.unsubscribe(oe):le.removeEventListener("abort",oe)}),te=null)};te.forEach(le=>le.addEventListener("abort",oe));const{signal:se}=ee;return se.unsubscribe=()=>utils$1.asap(ae),se}},streamChunk=function*(te,Q){let X=te.byteLength;if(X<Q){yield te;return}let ee=0,ie;for(;ee<X;)ie=ee+Q,yield te.slice(ee,ie),ee=ie},readBytes=async function*(te,Q){for await(const X of readStream(te))yield*streamChunk(X,Q)},readStream=async function*(te){if(te[Symbol.asyncIterator]){yield*te;return}const Q=te.getReader();try{for(;;){const{done:X,value:ee}=await Q.read();if(X)break;yield ee}}finally{await Q.cancel()}},trackStream=(te,Q,X,ee)=>{const ie=readBytes(te,Q);let oe=0,ne,ae=se=>{ne||(ne=!0,ee&&ee(se))};return new ReadableStream({async pull(se){try{const{done:le,value:de}=await ie.next();if(le){ae(),se.close();return}let ce=de.byteLength;if(X){let he=oe+=ce;X(he)}se.enqueue(new Uint8Array(de))}catch(le){throw ae(le),le}},cancel(se){return ae(se),ie.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(te=>Q=>te.encode(Q))(new TextEncoder):async te=>new Uint8Array(await new Response(te).arrayBuffer())),test=(te,...Q)=>{try{return!!te(...Q)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let te=!1;const Q=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return te=!0,"half"}}).headers.has("Content-Type");return te&&!Q}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$1.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(te=>te.body)};isFetchSupported&&(te=>{["text","arrayBuffer","blob","formData","stream"].forEach(Q=>{!resolvers[Q]&&(resolvers[Q]=utils$1.isFunction(te[Q])?X=>X[Q]():(X,ee)=>{throw new AxiosError$1(`Response type '${Q}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,ee)})})})(new Response);const getBodyLength=async te=>{if(te==null)return 0;if(utils$1.isBlob(te))return te.size;if(utils$1.isSpecCompliantForm(te))return(await new Request(platform.origin,{method:"POST",body:te}).arrayBuffer()).byteLength;if(utils$1.isArrayBufferView(te)||utils$1.isArrayBuffer(te))return te.byteLength;if(utils$1.isURLSearchParams(te)&&(te=te+""),utils$1.isString(te))return(await encodeText(te)).byteLength},resolveBodyLength=async(te,Q)=>{const X=utils$1.toFiniteNumber(te.getContentLength());return X??getBodyLength(Q)},fetchAdapter=isFetchSupported&&(async te=>{let{url:Q,method:X,data:ee,signal:ie,cancelToken:oe,timeout:ne,onDownloadProgress:ae,onUploadProgress:se,responseType:le,headers:de,withCredentials:ce="same-origin",fetchOptions:he}=resolveConfig(te);le=le?(le+"").toLowerCase():"text";let ue=composeSignals([ie,oe&&oe.toAbortSignal()],ne),pe;const fe=ue&&ue.unsubscribe&&(()=>{ue.unsubscribe()});let ve;try{if(se&&supportsRequestStream&&X!=="get"&&X!=="head"&&(ve=await resolveBodyLength(de,ee))!==0){let ye=new Request(Q,{method:"POST",body:ee,duplex:"half"}),xe;if(utils$1.isFormData(ee)&&(xe=ye.headers.get("content-type"))&&de.setContentType(xe),ye.body){const[we,$e]=progressEventDecorator(ve,progressEventReducer(asyncDecorator(se)));ee=trackStream(ye.body,DEFAULT_CHUNK_SIZE,we,$e)}}utils$1.isString(ce)||(ce=ce?"include":"omit");const me="credentials"in Request.prototype;pe=new Request(Q,{...he,signal:ue,method:X.toUpperCase(),headers:de.normalize().toJSON(),body:ee,duplex:"half",credentials:me?ce:void 0});let ge=await fetch(pe,he);const _e=supportsResponseStream&&(le==="stream"||le==="response");if(supportsResponseStream&&(ae||_e&&fe)){const ye={};["status","statusText","headers"].forEach(Ae=>{ye[Ae]=ge[Ae]});const xe=utils$1.toFiniteNumber(ge.headers.get("content-length")),[we,$e]=ae&&progressEventDecorator(xe,progressEventReducer(asyncDecorator(ae),!0))||[];ge=new Response(trackStream(ge.body,DEFAULT_CHUNK_SIZE,we,()=>{$e&&$e(),fe&&fe()}),ye)}le=le||"text";let be=await resolvers[utils$1.findKey(resolvers,le)||"text"](ge,te);return!_e&&fe&&fe(),await new Promise((ye,xe)=>{settle(ye,xe,{data:be,headers:AxiosHeaders$1.from(ge.headers),status:ge.status,statusText:ge.statusText,config:te,request:pe})})}catch(me){throw fe&&fe(),me&&me.name==="TypeError"&&/Load failed|fetch/i.test(me.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,te,pe),{cause:me.cause||me}):AxiosError$1.from(me,me&&me.code,te,pe)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$1.forEach(knownAdapters,(te,Q)=>{if(te){try{Object.defineProperty(te,"name",{value:Q})}catch{}Object.defineProperty(te,"adapterName",{value:Q})}});const renderReason=te=>`- ${te}`,isResolvedHandle=te=>utils$1.isFunction(te)||te===null||te===!1,adapters$1={getAdapter:te=>{te=utils$1.isArray(te)?te:[te];const{length:Q}=te;let X,ee;const ie={};for(let oe=0;oe<Q;oe++){X=te[oe];let ne;if(ee=X,!isResolvedHandle(X)&&(ee=knownAdapters[(ne=String(X)).toLowerCase()],ee===void 0))throw new AxiosError$1(`Unknown adapter '${ne}'`);if(ee)break;ie[ne||"#"+oe]=ee}if(!ee){const oe=Object.entries(ie).map(([ae,se])=>`adapter ${ae} `+(se===!1?"is not supported by the environment":"is not available in the build"));let ne=Q?oe.length>1?`since :
21517
21517
  `+oe.map(renderReason).join(`
21518
21518
  `):" "+renderReason(oe[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+ne,"ERR_NOT_SUPPORT")}return ee},adapters:knownAdapters};function throwIfCancellationRequested(te){if(te.cancelToken&&te.cancelToken.throwIfRequested(),te.signal&&te.signal.aborted)throw new CanceledError$1(null,te)}function dispatchRequest(te){return throwIfCancellationRequested(te),te.headers=AxiosHeaders$1.from(te.headers),te.data=transformData.call(te,te.transformRequest),["post","put","patch"].indexOf(te.method)!==-1&&te.headers.setContentType("application/x-www-form-urlencoded",!1),adapters$1.getAdapter(te.adapter||defaults$1.adapter)(te).then(function(ee){return throwIfCancellationRequested(te),ee.data=transformData.call(te,te.transformResponse,ee),ee.headers=AxiosHeaders$1.from(ee.headers),ee},function(ee){return isCancel$1(ee)||(throwIfCancellationRequested(te),ee&&ee.response&&(ee.response.data=transformData.call(te,te.transformResponse,ee.response),ee.response.headers=AxiosHeaders$1.from(ee.response.headers))),Promise.reject(ee)})}const VERSION$1="1.11.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((te,Q)=>{validators$1[te]=function(ee){return typeof ee===te||"a"+(Q<1?"n ":" ")+te}});const deprecatedWarnings={};validators$1.transitional=function te(Q,X,ee){function ie(oe,ne){return"[Axios v"+VERSION$1+"] Transitional option '"+oe+"'"+ne+(ee?". "+ee:"")}return(oe,ne,ae)=>{if(Q===!1)throw new AxiosError$1(ie(ne," has been removed"+(X?" in "+X:"")),AxiosError$1.ERR_DEPRECATED);return X&&!deprecatedWarnings[ne]&&(deprecatedWarnings[ne]=!0,console.warn(ie(ne," has been deprecated since v"+X+" and will be removed in the near future"))),Q?Q(oe,ne,ae):!0}};validators$1.spelling=function te(Q){return(X,ee)=>(console.warn(`${ee} is likely a misspelling of ${Q}`),!0)};function assertOptions(te,Q,X){if(typeof te!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const ee=Object.keys(te);let ie=ee.length;for(;ie-- >0;){const oe=ee[ie],ne=Q[oe];if(ne){const ae=te[oe],se=ae===void 0||ne(ae,oe,te);if(se!==!0)throw new AxiosError$1("option "+oe+" must be "+se,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(X!==!0)throw new AxiosError$1("Unknown option "+oe,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(Q){this.defaults=Q||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(Q,X){try{return await this._request(Q,X)}catch(ee){if(ee instanceof Error){let ie={};Error.captureStackTrace?Error.captureStackTrace(ie):ie=new Error;const oe=ie.stack?ie.stack.replace(/^.+\n/,""):"";try{ee.stack?oe&&!String(ee.stack).endsWith(oe.replace(/^.+\n.+\n/,""))&&(ee.stack+=`
21519
- `+oe):ee.stack=oe}catch{}}throw ee}}_request(Q,X){typeof Q=="string"?(X=X||{},X.url=Q):X=Q||{},X=mergeConfig$1(this.defaults,X);const{transitional:ee,paramsSerializer:ie,headers:oe}=X;ee!==void 0&&validator.assertOptions(ee,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),ie!=null&&(utils$1.isFunction(ie)?X.paramsSerializer={serialize:ie}:validator.assertOptions(ie,{encode:validators.function,serialize:validators.function},!0)),X.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?X.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:X.allowAbsoluteUrls=!0),validator.assertOptions(X,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),X.method=(X.method||this.defaults.method||"get").toLowerCase();let ne=oe&&utils$1.merge(oe.common,oe[X.method]);oe&&utils$1.forEach(["delete","get","head","post","put","patch","common"],pe=>{delete oe[pe]}),X.headers=AxiosHeaders$1.concat(ne,oe);const ae=[];let se=!0;this.interceptors.request.forEach(function(fe){typeof fe.runWhen=="function"&&fe.runWhen(X)===!1||(se=se&&fe.synchronous,ae.unshift(fe.fulfilled,fe.rejected))});const le=[];this.interceptors.response.forEach(function(fe){le.push(fe.fulfilled,fe.rejected)});let de,ce=0,he;if(!se){const pe=[dispatchRequest.bind(this),void 0];for(pe.unshift(...ae),pe.push(...le),he=pe.length,de=Promise.resolve(X);ce<he;)de=de.then(pe[ce++],pe[ce++]);return de}he=ae.length;let ue=X;for(ce=0;ce<he;){const pe=ae[ce++],fe=ae[ce++];try{ue=pe(ue)}catch(ve){fe.call(this,ve);break}}try{de=dispatchRequest.call(this,ue)}catch(pe){return Promise.reject(pe)}for(ce=0,he=le.length;ce<he;)de=de.then(le[ce++],le[ce++]);return de}getUri(Q){Q=mergeConfig$1(this.defaults,Q);const X=buildFullPath(Q.baseURL,Q.url,Q.allowAbsoluteUrls);return buildURL(X,Q.params,Q.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function te(Q){Axios$1.prototype[Q]=function(X,ee){return this.request(mergeConfig$1(ee||{},{method:Q,url:X,data:(ee||{}).data}))}});utils$1.forEach(["post","put","patch"],function te(Q){function X(ee){return function(oe,ne,ae){return this.request(mergeConfig$1(ae||{},{method:Q,headers:ee?{"Content-Type":"multipart/form-data"}:{},url:oe,data:ne}))}}Axios$1.prototype[Q]=X(),Axios$1.prototype[Q+"Form"]=X(!0)});let CancelToken$1=class pr{constructor(Q){if(typeof Q!="function")throw new TypeError("executor must be a function.");let X;this.promise=new Promise(function(oe){X=oe});const ee=this;this.promise.then(ie=>{if(!ee._listeners)return;let oe=ee._listeners.length;for(;oe-- >0;)ee._listeners[oe](ie);ee._listeners=null}),this.promise.then=ie=>{let oe;const ne=new Promise(ae=>{ee.subscribe(ae),oe=ae}).then(ie);return ne.cancel=function(){ee.unsubscribe(oe)},ne},Q(function(oe,ne,ae){ee.reason||(ee.reason=new CanceledError$1(oe,ne,ae),X(ee.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Q){if(this.reason){Q(this.reason);return}this._listeners?this._listeners.push(Q):this._listeners=[Q]}unsubscribe(Q){if(!this._listeners)return;const X=this._listeners.indexOf(Q);X!==-1&&this._listeners.splice(X,1)}toAbortSignal(){const Q=new AbortController,X=ee=>{Q.abort(ee)};return this.subscribe(X),Q.signal.unsubscribe=()=>this.unsubscribe(X),Q.signal}static source(){let Q;return{token:new pr(function(ie){Q=ie}),cancel:Q}}};function spread$1(te){return function(X){return te.apply(null,X)}}function isAxiosError$1(te){return utils$1.isObject(te)&&te.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([te,Q])=>{HttpStatusCode$1[Q]=te});function createInstance(te){const Q=new Axios$1(te),X=bind(Axios$1.prototype.request,Q);return utils$1.extend(X,Axios$1.prototype,Q,{allOwnKeys:!0}),utils$1.extend(X,Q,null,{allOwnKeys:!0}),X.create=function(ie){return createInstance(mergeConfig$1(te,ie))},X}const axios=createInstance(defaults$1);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function te(Q){return Promise.all(Q)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=te=>formDataToJSON(utils$1.isHTMLForm(te)?new FormData(te):te);axios.getAdapter=adapters$1.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,urlAlphabet="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let nanoid=(te=21)=>{let Q="",X=crypto.getRandomValues(new Uint8Array(te|=0));for(;te--;)Q+=urlAlphabet[X[te]&63];return Q},abortControllers=[];class AxiosMateuApiClient{constructor(){this.axiosInstance=axios.create({timeout:6e4}),this.axiosInstance.interceptors.request.use(Q=>(this.addAuthToken(Q),this.addSessionId(Q),Q))}addSessionId(Q){let X=sessionStorage.getItem("__mateu_sesion_id");X||(X=nanoid(),sessionStorage.setItem("__mateu_sesion_id",X)),Q.headers["X-Session-Id"]=X}addAuthToken(Q){const X=localStorage.getItem("__mateu_auth_token");X&&(Q.headers.Authorization="Bearer "+X)}async wrap(Q,X,ee,ie){return ee||X.dispatchEvent(new CustomEvent("backend-called-event",{bubbles:!0,composed:!0,detail:{}})),Q.then(oe=>(X.dispatchEvent(new CustomEvent("backend-succeeded-event",{bubbles:!0,composed:!0,detail:{actionId:ie}})),oe)).catch(oe=>{throw oe.code=="ERR_CANCELED"?X.dispatchEvent(new CustomEvent("backend-cancelled-event",{bubbles:!0,composed:!0,detail:{}})):X.dispatchEvent(new CustomEvent("backend-failed-event",{bubbles:!0,composed:!0,detail:{actionId:ie,reason:this.serialize(oe)}})),oe})}serialize(Q){return Q.message?Q:JSON.stringify(Q)}async get(Q){const X=new AbortController;return abortControllers=[...abortControllers,X],this.axiosInstance.get(Q,{signal:X.signal})}async post(Q,X){const ee=new AbortController;return abortControllers=[...abortControllers,ee],this.axiosInstance.post(Q,X,{signal:ee.signal})}async abortAll(){abortControllers.forEach(Q=>Q.abort()),abortControllers=[]}async runAction(Q,X,ee,ie,oe,ne,ae,se,le,de,ce,he){return X&&X.startsWith("/")&&(X=X.substring(1)),await this.wrap(this.post(Q+"/mateu/v3/sync/"+(X&&X!=""?X:"_no_route")+(ie?"/"+ie:""),{serverSideType:ae,appServerSideType:se,appState:ne,componentState:le,parameters:de,initiatorComponentId:oe,consumedRoute:ee,route:X&&X!=""?"/"+X:"",actionId:ie}).then(ue=>ue.data),ce,he,ie)}}const mateuApiClient=new AxiosMateuApiClient;var UIFragmentAction=(te=>(te.Add="Add",te.Replace="Replace",te))(UIFragmentAction||{}),AppVariant=(te=>(te.HAMBURGUER_MENU="HAMBURGUER_MENU",te.MENU_ON_LEFT="MENU_ON_LEFT",te.MENU_ON_TOP="MENU_ON_TOP",te.TABS="TABS",te))(AppVariant||{}),__defProp$l=Object.defineProperty,__decorateClass$l=(te,Q,X,ee)=>{for(var ie=void 0,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=ne(Q,X,ie)||ie);return ie&&__defProp$l(Q,X,ie),ie};class ConnectedElement extends i$s{constructor(){super(...arguments),this.id="",this.baseUrl="",this.createElement=Q=>{const X=Q.data,ee=document.createElement(X.name);for(let ie in X.attributes)ee.setAttribute(ie,X.attributes[ie]);for(let ie in X.on)console.log("adding listener to ",X.on),ee.addEventListener(ie,oe=>{this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:X.on[ie],parameters:{event:oe}},bubbles:!0,composed:!0}))});return ee},this.closeModal=()=>{const Q=this.shadowRoot?.querySelectorAll("mateu-dialog");Q&&Q.length>0&&Q[Q.length-1].close()},this.changeFavicon=Q=>{let X=document.querySelector('link[rel="icon"]');X!==null?X.setAttribute("href",Q):(X=document.createElement("link"),X.setAttribute("rel","icon"),X.setAttribute("href",Q),document.head.appendChild(X))}}connectedCallback(){super.connectedCallback(),this.upstreamSubscription=upstream.subscribe(Q=>{if(Q.command){const X=Q.command;this.id==X.targetComponentId&&this.applyCommand(X)}if(Q.fragment){const X=Q.fragment;this.id==X.targetComponentId&&(this.applyFragment(X),this.completeMenu(X))}})}completeMenu(Q){if(Q.component&&Q.component.type==ComponentType.ClientSide){const X=Q.component,ee=X.metadata;if(ee?.type==ComponentMetadataType.App){const ie=ee,oe=this.getRemoteMenus(ie.menu);if(oe.length>0){const ne=oe.map(ae=>mateuApiClient.runAction(ae.baseUrl,ae.route,"_empty","",ae.baseUrl+"#"+ae.route,void 0,void 0,void 0,void 0,ae.params,this,!0));Promise.all(ne).then(ae=>{ie.menu=this.updateMenu(ie.menu,ae.map(se=>se.fragments).filter(se=>se).map(se=>se).flat()),console.log("updated menu",ie.menu),ie.variant=AppVariant.MENU_ON_TOP,upstream.next({fragment:{component:X,data:void 0,state:void 0,action:UIFragmentAction.Replace,targetComponentId:this.id}})})}}}}updateMenu(Q,X){const ee=[];return Q.forEach(ie=>{if(ie.remote){const oe=X.find(ne=>ne.targetComponentId==ie.baseUrl+"#"+ie.route);if(console.log("replacement",oe,ie),oe&&oe.component?.type==ComponentType.ClientSide){const ne=oe.component;if(ne.metadata?.type==ComponentMetadataType.App){const ae=ne.metadata,se=ie.appServerSideType&&ie.appServerSideType!=""?ie.appServerSideType:ae.appServerSideType;console.log("xxx",ie.appServerSideType,ae.appServerSideType,ie.appServerSideType??ae.appServerSideType,se),this.changeBaseUrl(ae.menu,ie.baseUrl,se),ee.push(...ae.menu)}}}else ee.push(ie)}),ee}changeBaseUrl(Q,X,ee){Q.forEach(ie=>{ie.baseUrl||(ie.submenus&&ie.submenus.length>0?this.changeBaseUrl(ie.submenus,X,ee):(ie.baseUrl=X,ie.appServerSideType=ee,ie.destination.baseUrl=X))})}getRemoteMenus(Q){const X=[];return Q.forEach(ee=>{ee.remote&&X.push(ee)}),X}disconnectedCallback(){super.disconnectedCallback(),this.upstreamSubscription?.unsubscribe()}applyCommand(Q){if(Q.type=="SetWindowTitle"&&(document.title=Q.data),Q.type=="SetFavicon"&&this.changeFavicon(Q.data),Q.type=="NavigateTo"){const X=Q.data;X&&(X.startsWith("http:")||X.startsWith("https:")?window.location.href=Q.data:this.dispatchEvent(new CustomEvent("navigate-to-requested",{detail:{route:X},bubbles:!0,composed:!0})))}if(Q.type=="PushStateToHistory"){const X=Q.data;X&&(window.history.pushState({},"",X),this.dispatchEvent(new CustomEvent("history-pushed",{detail:{route:X},bubbles:!0,composed:!0})))}if(Q.type=="RunAction"){const X=Q.data;X&&X.actionId&&this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:X.actionId},bubbles:!0,composed:!0}))}if(Q.type=="CloseModal"&&this.closeModal(),Q.type=="AddContentToHead"){const X=Q.data;if(X&&X.name){if(X.attributes&&X.attributes.id&&document.getElementById(X.attributes.id)){console.log("already there",X);return}document.head.appendChild(this.createElement(Q))}}if(Q.type=="AddContentToBody"){const X=Q.data;if(X&&X.name){if(X.attributes&&X.attributes.id&&document.getElementById(X.attributes.id)){console.log("already there",X);return}document.body.appendChild(this.createElement(Q))}}}}__decorateClass$l([n$t()],ConnectedElement.prototype,"id");__decorateClass$l([n$t()],ConnectedElement.prototype,"baseUrl");var __defProp$k=Object.defineProperty,__decorateClass$k=(te,Q,X,ee)=>{for(var ie=void 0,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=ne(Q,X,ie)||ie);return ie&&__defProp$k(Q,X,ie),ie};class MetadataDrivenElement extends ConnectedElement{applyFragment(Q){}manageActionRequestedEvent(Q){}}__decorateClass$k([n$t()],MetadataDrivenElement.prototype,"component");/**
21519
+ `+oe):ee.stack=oe}catch{}}throw ee}}_request(Q,X){typeof Q=="string"?(X=X||{},X.url=Q):X=Q||{},X=mergeConfig$1(this.defaults,X);const{transitional:ee,paramsSerializer:ie,headers:oe}=X;ee!==void 0&&validator.assertOptions(ee,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),ie!=null&&(utils$1.isFunction(ie)?X.paramsSerializer={serialize:ie}:validator.assertOptions(ie,{encode:validators.function,serialize:validators.function},!0)),X.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?X.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:X.allowAbsoluteUrls=!0),validator.assertOptions(X,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),X.method=(X.method||this.defaults.method||"get").toLowerCase();let ne=oe&&utils$1.merge(oe.common,oe[X.method]);oe&&utils$1.forEach(["delete","get","head","post","put","patch","common"],pe=>{delete oe[pe]}),X.headers=AxiosHeaders$1.concat(ne,oe);const ae=[];let se=!0;this.interceptors.request.forEach(function(fe){typeof fe.runWhen=="function"&&fe.runWhen(X)===!1||(se=se&&fe.synchronous,ae.unshift(fe.fulfilled,fe.rejected))});const le=[];this.interceptors.response.forEach(function(fe){le.push(fe.fulfilled,fe.rejected)});let de,ce=0,he;if(!se){const pe=[dispatchRequest.bind(this),void 0];for(pe.unshift(...ae),pe.push(...le),he=pe.length,de=Promise.resolve(X);ce<he;)de=de.then(pe[ce++],pe[ce++]);return de}he=ae.length;let ue=X;for(ce=0;ce<he;){const pe=ae[ce++],fe=ae[ce++];try{ue=pe(ue)}catch(ve){fe.call(this,ve);break}}try{de=dispatchRequest.call(this,ue)}catch(pe){return Promise.reject(pe)}for(ce=0,he=le.length;ce<he;)de=de.then(le[ce++],le[ce++]);return de}getUri(Q){Q=mergeConfig$1(this.defaults,Q);const X=buildFullPath(Q.baseURL,Q.url,Q.allowAbsoluteUrls);return buildURL(X,Q.params,Q.paramsSerializer)}};utils$1.forEach(["delete","get","head","options"],function te(Q){Axios$1.prototype[Q]=function(X,ee){return this.request(mergeConfig$1(ee||{},{method:Q,url:X,data:(ee||{}).data}))}});utils$1.forEach(["post","put","patch"],function te(Q){function X(ee){return function(oe,ne,ae){return this.request(mergeConfig$1(ae||{},{method:Q,headers:ee?{"Content-Type":"multipart/form-data"}:{},url:oe,data:ne}))}}Axios$1.prototype[Q]=X(),Axios$1.prototype[Q+"Form"]=X(!0)});let CancelToken$1=class pr{constructor(Q){if(typeof Q!="function")throw new TypeError("executor must be a function.");let X;this.promise=new Promise(function(oe){X=oe});const ee=this;this.promise.then(ie=>{if(!ee._listeners)return;let oe=ee._listeners.length;for(;oe-- >0;)ee._listeners[oe](ie);ee._listeners=null}),this.promise.then=ie=>{let oe;const ne=new Promise(ae=>{ee.subscribe(ae),oe=ae}).then(ie);return ne.cancel=function(){ee.unsubscribe(oe)},ne},Q(function(oe,ne,ae){ee.reason||(ee.reason=new CanceledError$1(oe,ne,ae),X(ee.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(Q){if(this.reason){Q(this.reason);return}this._listeners?this._listeners.push(Q):this._listeners=[Q]}unsubscribe(Q){if(!this._listeners)return;const X=this._listeners.indexOf(Q);X!==-1&&this._listeners.splice(X,1)}toAbortSignal(){const Q=new AbortController,X=ee=>{Q.abort(ee)};return this.subscribe(X),Q.signal.unsubscribe=()=>this.unsubscribe(X),Q.signal}static source(){let Q;return{token:new pr(function(ie){Q=ie}),cancel:Q}}};function spread$1(te){return function(X){return te.apply(null,X)}}function isAxiosError$1(te){return utils$1.isObject(te)&&te.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([te,Q])=>{HttpStatusCode$1[Q]=te});function createInstance(te){const Q=new Axios$1(te),X=bind(Axios$1.prototype.request,Q);return utils$1.extend(X,Axios$1.prototype,Q,{allOwnKeys:!0}),utils$1.extend(X,Q,null,{allOwnKeys:!0}),X.create=function(ie){return createInstance(mergeConfig$1(te,ie))},X}const axios=createInstance(defaults$1);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function te(Q){return Promise.all(Q)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=te=>formDataToJSON(utils$1.isHTMLForm(te)?new FormData(te):te);axios.getAdapter=adapters$1.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios,urlAlphabet="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let nanoid=(te=21)=>{let Q="",X=crypto.getRandomValues(new Uint8Array(te|=0));for(;te--;)Q+=urlAlphabet[X[te]&63];return Q},abortControllers=[];class AxiosMateuApiClient{constructor(){this.axiosInstance=axios.create({timeout:6e4}),this.axiosInstance.interceptors.request.use(Q=>(this.addAuthToken(Q),this.addSessionId(Q),Q))}addSessionId(Q){let X=sessionStorage.getItem("__mateu_sesion_id");X||(X=nanoid(),sessionStorage.setItem("__mateu_sesion_id",X)),Q.headers["X-Session-Id"]=X}addAuthToken(Q){const X=localStorage.getItem("__mateu_auth_token");X&&(Q.headers.Authorization="Bearer "+X)}async wrap(Q,X,ee,ie){return ee||X.dispatchEvent(new CustomEvent("backend-called-event",{bubbles:!0,composed:!0,detail:{}})),Q.then(oe=>(X.dispatchEvent(new CustomEvent("backend-succeeded-event",{bubbles:!0,composed:!0,detail:{actionId:ie}})),oe)).catch(oe=>{throw oe.code=="ERR_CANCELED"?X.dispatchEvent(new CustomEvent("backend-cancelled-event",{bubbles:!0,composed:!0,detail:{}})):X.dispatchEvent(new CustomEvent("backend-failed-event",{bubbles:!0,composed:!0,detail:{actionId:ie,reason:this.serialize(oe)}})),oe})}serialize(Q){return Q.message?Q:JSON.stringify(Q)}async get(Q){const X=new AbortController;return abortControllers=[...abortControllers,X],this.axiosInstance.get(Q,{signal:X.signal})}async post(Q,X){const ee=new AbortController;return abortControllers=[...abortControllers,ee],this.axiosInstance.post(Q,X,{signal:ee.signal})}async abortAll(){abortControllers.forEach(Q=>Q.abort()),abortControllers=[]}async runAction(Q,X,ee,ie,oe,ne,ae,se,le,de,ce,he){return X&&X.startsWith("/")&&(X=X.substring(1)),await this.wrap(this.post(Q+"/mateu/v3/sync/"+(X&&X!=""?X:"_no_route")+(ie?"/"+ie:""),{serverSideType:ae,appServerSideType:se,appState:ne,componentState:le,parameters:de,initiatorComponentId:oe,consumedRoute:ee,route:X&&X!=""?"/"+X:"",actionId:ie}).then(ue=>ue.data),ce,he,ie)}}const mateuApiClient=new AxiosMateuApiClient;var UIFragmentAction=(te=>(te.Add="Add",te.Replace="Replace",te))(UIFragmentAction||{}),AppVariant=(te=>(te.HAMBURGUER_MENU="HAMBURGUER_MENU",te.MENU_ON_LEFT="MENU_ON_LEFT",te.MENU_ON_TOP="MENU_ON_TOP",te.TABS="TABS",te))(AppVariant||{}),__defProp$l=Object.defineProperty,__decorateClass$l=(te,Q,X,ee)=>{for(var ie=void 0,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=ne(Q,X,ie)||ie);return ie&&__defProp$l(Q,X,ie),ie};class ConnectedElement extends i$s{constructor(){super(...arguments),this.id="",this.baseUrl="",this.createElement=Q=>{const X=Q.data,ee=document.createElement(X.name);for(let ie in X.attributes)ee.setAttribute(ie,X.attributes[ie]);for(let ie in X.on)console.log("adding listener to ",X.on),ee.addEventListener(ie,oe=>{this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:X.on[ie],parameters:{event:oe}},bubbles:!0,composed:!0}))});return ee},this.closeModal=()=>{const Q=this.shadowRoot?.querySelectorAll("mateu-dialog");Q&&Q.length>0&&Q[Q.length-1].close()},this.changeFavicon=Q=>{let X=document.querySelector('link[rel="icon"]');X!==null?X.setAttribute("href",Q):(X=document.createElement("link"),X.setAttribute("rel","icon"),X.setAttribute("href",Q),document.head.appendChild(X))}}connectedCallback(){super.connectedCallback(),this.upstreamSubscription=upstream.subscribe(Q=>{if(Q.command){const X=Q.command;this.id==X.targetComponentId&&this.applyCommand(X)}if(Q.fragment){const X=Q.fragment;this.id==X.targetComponentId&&(this.applyFragment(X),this.completeMenu(X))}})}completeMenu(Q){if(Q.component&&Q.component.type==ComponentType.ClientSide){const X=Q.component,ee=X.metadata;if(ee?.type==ComponentMetadataType.App){const ie=ee,oe=this.getRemoteMenus(ie.menu);if(oe.length>0){const ne=oe.map(ae=>mateuApiClient.runAction(ae.baseUrl,ae.route,"_empty","",ae.baseUrl+"#"+ae.route,void 0,void 0,void 0,void 0,ae.params,this,!0));Promise.all(ne).then(ae=>{ie.menu=this.updateMenu(ie.menu,ae.map(se=>se.fragments).filter(se=>se).map(se=>se).flat()),ie.variant=AppVariant.MENU_ON_TOP,upstream.next({fragment:{component:X,data:void 0,state:void 0,action:UIFragmentAction.Replace,targetComponentId:this.id}})})}}}}updateMenu(Q,X){const ee=[];return Q.forEach(ie=>{if(ie.remote){const oe=X.find(ne=>ne.targetComponentId==ie.baseUrl+"#"+ie.route);if(oe&&oe.component?.type==ComponentType.ClientSide){const ne=oe.component;if(ne.metadata?.type==ComponentMetadataType.App){const ae=ne.metadata,se=ie.appServerSideType&&ie.appServerSideType!=""?ie.appServerSideType:ae.appServerSideType;this.changeBaseUrl(ae.menu,ie.baseUrl,se,ie.destination.route),ee.push(...ae.menu)}}}else ee.push(ie)}),ee}changeBaseUrl(Q,X,ee,ie){Q.forEach(oe=>{oe.baseUrl||(oe.submenus&&oe.submenus.length>0?this.changeBaseUrl(oe.submenus,X,ee,ie):(oe.baseUrl=X,oe.appServerSideType=ee,oe.destination.baseUrl=X,oe.uriPrefix=ie))})}getRemoteMenus(Q){const X=[];return Q.forEach(ee=>{ee.remote&&X.push(ee)}),X}disconnectedCallback(){super.disconnectedCallback(),this.upstreamSubscription?.unsubscribe()}applyCommand(Q){if(Q.type=="SetWindowTitle"&&(document.title=Q.data),Q.type=="SetFavicon"&&this.changeFavicon(Q.data),Q.type=="NavigateTo"){const X=Q.data;X&&(X.startsWith("http:")||X.startsWith("https:")?window.location.href=Q.data:this.dispatchEvent(new CustomEvent("navigate-to-requested",{detail:{route:X},bubbles:!0,composed:!0})))}if(Q.type=="PushStateToHistory"){const X=Q.data;X&&(this.dispatchEvent(new CustomEvent("route-changed",{detail:{route:X},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("history-pushed",{detail:{route:X},bubbles:!0,composed:!0})))}if(Q.type=="RunAction"){const X=Q.data;X&&X.actionId&&this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:X.actionId},bubbles:!0,composed:!0}))}if(Q.type=="CloseModal"&&this.closeModal(),Q.type=="AddContentToHead"){const X=Q.data;if(X&&X.name){if(X.attributes&&X.attributes.id&&document.getElementById(X.attributes.id)){console.log("already there",X);return}document.head.appendChild(this.createElement(Q))}}if(Q.type=="AddContentToBody"){const X=Q.data;if(X&&X.name){if(X.attributes&&X.attributes.id&&document.getElementById(X.attributes.id)){console.log("already there",X);return}document.body.appendChild(this.createElement(Q))}}}}__decorateClass$l([n$t()],ConnectedElement.prototype,"id");__decorateClass$l([n$t()],ConnectedElement.prototype,"baseUrl");var __defProp$k=Object.defineProperty,__decorateClass$k=(te,Q,X,ee)=>{for(var ie=void 0,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=ne(Q,X,ie)||ie);return ie&&__defProp$k(Q,X,ie),ie};class MetadataDrivenElement extends ConnectedElement{applyFragment(Q){}manageActionRequestedEvent(Q){}}__decorateClass$k([n$t()],MetadataDrivenElement.prototype,"component");/**
21520
21520
  * @license
21521
21521
  * Copyright 2017 Google LLC
21522
21522
  * SPDX-License-Identifier: BSD-3-Clause
@@ -21556,7 +21556,7 @@ To prevent other runtimes from defining tags that you use, consider using scopin
21556
21556
  slot="${Q.slot??E$5}"
21557
21557
  style="${Q.style}"
21558
21558
  class="${Q.cssClasses}"
21559
- .state="${Q.initialData}"
21559
+ .state="${{...Q.initialData,...ee}}"
21560
21560
  .data="${{}}"
21561
21561
  .appState="${oe}"
21562
21562
  .appData="${ne}"
@@ -21661,7 +21661,7 @@ To prevent other runtimes from defining tags that you use, consider using scopin
21661
21661
  <g id="lumo:unordered-list"><path d="M146 325c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63z m0 250c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63z m0 250c-42 0-67-26-67-63 0-37 25-63 67-63 42 0 67 26 67 63 0 37-25 63-67 63zM333 258c0-18 15-33 34-33h516c18 0 33 15 34 33 0 18-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z m0 250c0-18 15-33 34-33h516c18 0 33 15 34 33s-15 33-34 34H367c-18 0-33-15-34-34z"></path></g>
21662
21662
  <g id="lumo:upload"><path d="M454 271V604c0 21-17 38-37 38s-38-17-38-38V271L254 382c-15 14-39 12-53-3-14-15-12-39 3-53L391 160c14-13 36-13 51-1 0 0 0 0 0 1l187 166c15 14 17 37 3 53-14 15-37 17-53 3L454 271zM675 704c0-21 17-38 37-37 21 0 38 17 38 37v92c0 21-17 38-38 37H121c-21 0-38-17-38-37v-92c0-21 17-38 38-37s38 17 37 37v54h517v-54z"></path></g>
21663
21663
  <g id="lumo:user"><path d="M500 500c-69 0-125-56-125-125s56-125 125-125 125 56 125 125-56 125-125 125z m-292 292c0-115 131-208 292-209s292 93 292 209H208z"></path></g>
21664
- </defs></svg>`;Iconset$1.register("lumo",1e3,template$1);var __defProp$j=Object.defineProperty,__getOwnPropDesc$i=Object.getOwnPropertyDescriptor,__decorateClass$j=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$i(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$j(Q,X,ie),ie};let MateuGrid=class extends MetadataDrivenElement{constructor(){super(...arguments),this.appState={},this.appData={},this.handleButtonClick=te=>{this.dispatchEvent(new CustomEvent("action-requested",{detail:{actionId:te},bubbles:!0,composed:!0}))}}render(){let te=[];this.field?.fieldId&&this.state&&this.state[this.field.fieldId]&&(te=this.state[this.field.fieldId]);const Q=this.state[this.field?.fieldId+"_show_detail"]||this.state._show_detail[this.field.fieldId],X=this.state[this.field?.fieldId+"_editing"]||this.state._editing[this.field.fieldId];if(this.field?.remoteCoordinates){const ie=this.field.remoteCoordinates,oe="";this.data[this.id]&&(this.data[this.id].searchSignature||oe)&&this.data[this.id].searchSignature!=oe&&(this.data[this.id]=void 0),this.data[this.id]&&this.data[this.id].content&&this.data[this.id].totalElements?te=this.data[this.id].content:this.dispatchEvent(new CustomEvent("action-requested",{detail:{actionId:ie.action,parameters:{searchText:oe,fieldId:this.field?.fieldId,size:200,page:0,sort:void 0}},bubbles:!0,composed:!0}))}const ee=this.field?.formPosition=="left"||this.field?.formPosition=="right"?"horizontal":"vertical";return x$4`
21664
+ </defs></svg>`;Iconset$1.register("lumo",1e3,template$1);var __defProp$j=Object.defineProperty,__getOwnPropDesc$i=Object.getOwnPropertyDescriptor,__decorateClass$j=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$i(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$j(Q,X,ie),ie};let MateuGrid=class extends MetadataDrivenElement{constructor(){super(...arguments),this.appState={},this.appData={},this.handleButtonClick=te=>{this.dispatchEvent(new CustomEvent("action-requested",{detail:{actionId:te},bubbles:!0,composed:!0}))}}render(){let te=[];this.field?.fieldId&&this.state&&this.state[this.field.fieldId]&&(te=this.state[this.field.fieldId]);const Q=this.state[this.field?.fieldId+"_show_detail"]||this.state._show_detail&&this.state._show_detail[this.field.fieldId],X=this.state[this.field?.fieldId+"_editing"]||this.state._editing&&this.state._editing[this.field.fieldId];if(this.field?.remoteCoordinates){const ie=this.field.remoteCoordinates,oe="";this.data[this.id]&&(this.data[this.id].searchSignature||oe)&&this.data[this.id].searchSignature!=oe&&(this.data[this.id]=void 0),this.data[this.id]&&this.data[this.id].content&&this.data[this.id].totalElements?te=this.data[this.id].content:this.dispatchEvent(new CustomEvent("action-requested",{detail:{actionId:ie.action,parameters:{searchText:oe,fieldId:this.field?.fieldId,size:200,page:0,sort:void 0}},bubbles:!0,composed:!0}))}const ee=this.field?.formPosition=="left"||this.field?.formPosition=="right"?"horizontal":"vertical";return x$4`
21665
21665
  <vaadin-vertical-layout>
21666
21666
  <vaadin-master-detail-layout
21667
21667
  style="width: 100%; ${Q?"min-height: 20rem;":""}"
@@ -22149,7 +22149,7 @@ To prevent other runtimes from defining tags that you use, consider using scopin
22149
22149
  id="${this.field.fieldId}"
22150
22150
  label="${ee}"
22151
22151
  data-colspan="${this.field.colspan}"
22152
- ><div style="line-height: 20px; margin-top: 5px; margin-bottom: 24px;">${o$u(Q)}</div></vaadin-custom-field>
22152
+ ><div style="line-height: 20px; margin-top: 5px; margin-bottom: 24px;">${o$u(""+Q)}</div></vaadin-custom-field>
22153
22153
  `:this.field?.stereotype=="image"?x$4`
22154
22154
  <vaadin-custom-field
22155
22155
  id="${this.field.fieldId}"
@@ -23306,9 +23306,10 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
23306
23306
  .component="${Q}"
23307
23307
  .data="${ee}"
23308
23308
  style="${Q.style}"
23309
- class="${Q.cssClasses}"
23309
+ class="${Q.cssClasses}"
23310
23310
  .appState="${oe}"
23311
23311
  .appData="${ne}"
23312
+ .selectedRoute="${Q.metadata.homeRoute}"
23312
23313
  >
23313
23314
  ${Q.children?.map(le=>renderComponent(te,le,X,ee,ie,oe,ne))}
23314
23315
  </mateu-app>`;if(se==ComponentMetadataType.Element)return renderElement(te,Q.metadata,Q);if(se==ComponentMetadataType.FormField){const le=Q.metadata;return x$4`
@@ -23842,7 +23843,7 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
23842
23843
  >
23843
23844
  <slot></slot>
23844
23845
  </ul>
23845
- `}_shouldSetFocus(Q){return Q.composedPath()[0]===this.focusElement}_onLabelClick(){this.collapsible&&this.__toggleCollapsed()}_onLabelSlotChange(){const Q=this.querySelector('[slot="label"]');Q?(Q.id||(Q.id=this._labelId),this.setAttribute("aria-labelledby",Q.id)):this.removeAttribute("aria-labelledby")}__locationChanged(){window.dispatchEvent(new CustomEvent("side-nav-location-changed"))}__toggleCollapsed(){this.collapsed=!this.collapsed}__onClick(Q){if(!this.onNavigate||Q.metaKey||Q.shiftKey)return;const ee=Q.composedPath(),ie=ee.find(se=>se.localName&&se.localName.includes("side-nav-item")),oe=ee.find(se=>se instanceof HTMLAnchorElement);if(!ie||!ie.shadowRoot.contains(oe)||!(oe.href&&oe.href.startsWith(location.origin))||ie.target==="_blank"||ie.routerIgnore)return;this.onNavigate({path:ie.path,target:ie.target,current:ie.current,expanded:ie.expanded,pathAliases:ie.pathAliases,originalEvent:Q})!==!1&&Q.preventDefault()}}defineCustomElement(SideNav);var TriggerType=(te=>(te.OnLoad="OnLoad",te.OnSuccess="OnSuccess",te.OnError="OnError",te.OnValueChange="OnValueChange",te.OnCustomEvent="OnCustomEvent",te))(TriggerType||{}),__defProp$a=Object.defineProperty,__decorateClass$a=(te,Q,X,ee)=>{for(var ie=void 0,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=ne(Q,X,ie)||ie);return ie&&__defProp$a(Q,X,ie),ie};class ComponentElement extends MetadataDrivenElement{constructor(){super(...arguments),this.state={},this.data={},this.appData={},this.appState={},this.triggerOnLoad=()=>{this.state,this.data;const serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnLoad).forEach(trigger=>{(!trigger.condition||eval(trigger.condition)&&!trigger.triggered)&&(trigger.triggered=!0,this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId},bubbles:!0,composed:!0})))})},this.customEventManager=event=>{if(event.stopPropagation(),event.preventDefault(),event instanceof CustomEvent){const customEvent=event,serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnCustomEvent).filter(te=>te.eventName==customEvent.type).forEach(trigger=>{(!trigger.condition||eval(trigger.condition))&&this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId,parameters:customEvent.detail},bubbles:!0,composed:!0}))})}}}applyFragment(te){if(this.id==te.targetComponentId){if(te.component)if(UIFragmentAction.Add==te.action)this.component&&this.component.children?.push(te.component);else{if(te.component?.type==ComponentType.ServerSide){const X=this.component,ee=te.component;X.serverSideType!=ee.serverSideType&&setTimeout(()=>this.triggerOnLoad()),X.actions=ee.actions,X.type=ee.type,X.rules=ee.rules,X.triggers=ee.triggers,X.serverSideType=ee.serverSideType,X.initialData=ee.initialData,X.validations=ee.validations,X.cssClasses=ee.cssClasses,X.slot=ee.slot,X.style=ee.style,X.children=ee.children}else{const X=[te.component];this.component&&(this.component.children=X)}this.state={},this.data={}}if(te.state&&(this.state={...this.state,...te.state}),te.data){for(const X in te.data){const ee=te.data[X].page;ee?.pageNumber>0&&this.data[X]&&this.data[X].page.content&&(ee.content?ee.content=[...this.data[X].page.content,...ee.content]:ee.content=[...this.data[X].page.content])}this.data={...this.data,...te.data}}const Q=this.component;this.state,this.data,Q.triggers?.filter(X=>X.type==TriggerType.OnCustomEvent).forEach(X=>{this.addEventListener(X.eventName,this.customEventManager)}),componentRenderer.getAfterRenderHook()&&setTimeout(componentRenderer.getAfterRenderHook()(this)),this.requestUpdate()}}}__decorateClass$a([n$t()],ComponentElement.prototype,"state");__decorateClass$a([n$t()],ComponentElement.prototype,"data");__decorateClass$a([n$t()],ComponentElement.prototype,"appData");__decorateClass$a([n$t()],ComponentElement.prototype,"appState");registerStyles("vaadin-icon",i$w`
23846
+ `}_shouldSetFocus(Q){return Q.composedPath()[0]===this.focusElement}_onLabelClick(){this.collapsible&&this.__toggleCollapsed()}_onLabelSlotChange(){const Q=this.querySelector('[slot="label"]');Q?(Q.id||(Q.id=this._labelId),this.setAttribute("aria-labelledby",Q.id)):this.removeAttribute("aria-labelledby")}__locationChanged(){window.dispatchEvent(new CustomEvent("side-nav-location-changed"))}__toggleCollapsed(){this.collapsed=!this.collapsed}__onClick(Q){if(!this.onNavigate||Q.metaKey||Q.shiftKey)return;const ee=Q.composedPath(),ie=ee.find(se=>se.localName&&se.localName.includes("side-nav-item")),oe=ee.find(se=>se instanceof HTMLAnchorElement);if(!ie||!ie.shadowRoot.contains(oe)||!(oe.href&&oe.href.startsWith(location.origin))||ie.target==="_blank"||ie.routerIgnore)return;this.onNavigate({path:ie.path,target:ie.target,current:ie.current,expanded:ie.expanded,pathAliases:ie.pathAliases,originalEvent:Q})!==!1&&Q.preventDefault()}}defineCustomElement(SideNav);var TriggerType=(te=>(te.OnLoad="OnLoad",te.OnSuccess="OnSuccess",te.OnError="OnError",te.OnValueChange="OnValueChange",te.OnCustomEvent="OnCustomEvent",te))(TriggerType||{}),__defProp$a=Object.defineProperty,__decorateClass$a=(te,Q,X,ee)=>{for(var ie=void 0,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=ne(Q,X,ie)||ie);return ie&&__defProp$a(Q,X,ie),ie};class ComponentElement extends MetadataDrivenElement{constructor(){super(...arguments),this.state={},this.data={},this.appData={},this.appState={},this.triggerOnLoad=()=>{this.state,this.data;const serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnCustomEvent).forEach(te=>{console.log("adding listener for "+te.eventName),this.addEventListener(te.eventName,this.customEventManager)}),serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnLoad).forEach(trigger=>{(!trigger.condition||eval(trigger.condition)&&!trigger.triggered)&&(trigger.triggered=!0,this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId},bubbles:!0,composed:!0})))})},this.customEventManager=event=>{if(event.stopPropagation(),event.preventDefault(),event instanceof CustomEvent){const customEvent=event,serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnCustomEvent).filter(te=>te.eventName==customEvent.type).forEach(trigger=>{(!trigger.condition||eval(trigger.condition))&&this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId,parameters:customEvent.detail},bubbles:!0,composed:!0}))})}}}applyFragment(te){if(this.id==te.targetComponentId){if(te.component)if(UIFragmentAction.Add==te.action)this.component&&this.component.children?.push(te.component);else{if(te.component?.type==ComponentType.ServerSide){const X=this.component,ee=te.component;X.serverSideType!=ee.serverSideType&&setTimeout(()=>this.triggerOnLoad()),X.actions=ee.actions,X.type=ee.type,X.rules=ee.rules,X.triggers=ee.triggers,X.serverSideType=ee.serverSideType,X.initialData=ee.initialData,X.validations=ee.validations,X.cssClasses=ee.cssClasses,X.slot=ee.slot,X.style=ee.style,X.children=ee.children}else{const X=[te.component];this.component&&(this.component.children=X)}this.state={},this.data={}}if(te.state&&(this.state={...this.state,...te.state}),te.data){for(const X in te.data){const ee=te.data[X].page;ee?.pageNumber>0&&this.data[X]&&this.data[X].page.content&&(ee.content?ee.content=[...this.data[X].page.content,...ee.content]:ee.content=[...this.data[X].page.content])}this.data={...this.data,...te.data}}const Q=this.component;this.state,this.data,Q.triggers?.filter(X=>X.type==TriggerType.OnCustomEvent).forEach(X=>{console.log("adding listener for "+X.eventName),this.addEventListener(X.eventName,this.customEventManager)}),componentRenderer.getAfterRenderHook()&&setTimeout(componentRenderer.getAfterRenderHook()(this)),this.requestUpdate()}}}__decorateClass$a([n$t()],ComponentElement.prototype,"state");__decorateClass$a([n$t()],ComponentElement.prototype,"data");__decorateClass$a([n$t()],ComponentElement.prototype,"appData");__decorateClass$a([n$t()],ComponentElement.prototype,"appState");registerStyles("vaadin-icon",i$w`
23846
23847
  :host {
23847
23848
  width: var(--lumo-icon-size-m);
23848
23849
  height: var(--lumo-icon-size-m);
@@ -23973,15 +23974,15 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
23973
23974
  ></vaadin-notification>`}};MateuApiCaller.styles=i$w`
23974
23975
  :host {
23975
23976
  }
23976
- `;__decorateClass$9([r$o()],MateuApiCaller.prototype,"loading",2);__decorateClass$9([r$o()],MateuApiCaller.prototype,"notificationOpened",2);__decorateClass$9([r$o()],MateuApiCaller.prototype,"error",2);MateuApiCaller=__decorateClass$9([t$o("mateu-api-caller")],MateuApiCaller);var __defProp$8=Object.defineProperty,__getOwnPropDesc$8=Object.getOwnPropertyDescriptor,__decorateClass$8=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$8(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$8(Q,X,ie),ie};let MateuApp=class extends ComponentElement{constructor(){super(...arguments),this.filter="",this.instant=void 0,this.selectedRoute=void 0,this.selectedBaseUrl=void 0,this.selectedAppServerSideType=void 0,this.selectedParams=void 0,this.getSelectedOption=te=>{if(te)for(let Q=0;Q<te.length;Q++){const X=te[Q];if(X.selected)return X;const ee=this.getSelectedOption(X.submenus);if(ee)return ee}return null},this.itemSelected=te=>{console.log("itemSelected",te.detail.value),this.selectRoute(te.detail.value.route,te.detail.value.actionId,te.detail.value.baseUrl,te.detail.value.appServerSideType)},this.selectRoute=(te,Q,X,ee)=>{if(te){console.log("_baseUrl",X,ee),this.selectedBaseUrl=X,this.selectedRoute=te,this.selectedAppServerSideType=ee,this.instant=nanoid();let oe=this.baseUrl??"";oe.indexOf("://")<0&&(oe.startsWith("/")||(oe="/"+oe),oe=window.location.origin+oe),oe.endsWith("/")&&te.startsWith("/")&&(te=te.substring(1));let ne=new URL(oe+te);if(window.location.pathname!=ne.pathname){let ae=ne.pathname;ae&&!ae.startsWith("/")&&(ae="/"+ae),window.history.pushState({},"",ae)}var ie=this.shadowRoot?.querySelector("mateu-ux");ie&&(ie.setAttribute("baseUrl",X??""),ie.setAttribute("appServerSideType",ee??""),ie.setAttribute("route",te),ie.setAttribute("instant",nanoid()))}},this.mapItems=(te,Q)=>(console.log("options",te),te.map(X=>{if(X.submenus&&X.submenus.length>0){let ee=this.mapItems(X.submenus,Q);return Q&&X.label.toLowerCase().includes(Q)&&(ee=this.mapItems(X.submenus,"")),ee&&ee.length>0?{text:X.label,route:X.destination?.route,baseUrl:X.baseUrl,appServerSideType:X.appServerSideType,actionId:X.actionId,selected:Q||X.selected,children:ee}:void 0}if(X.separator)return Q?void 0:{component:"hr"};if(!Q||X.label.toLowerCase().includes(Q))return{text:X.label,route:X.destination?.route,baseUrl:X.baseUrl,appServerSideType:X.appServerSideType,actionId:X.actionId,selected:Q||X.selected}}).filter(X=>X)),this.getSelectedIndex=te=>{if(te){const Q=this.getSelectedOption(te);if(Q)return te.indexOf(Q)}},this.renderOptionOnLeftMenu=te=>te.submenus&&te.submenus.length>0?x$4`
23977
+ `;__decorateClass$9([r$o()],MateuApiCaller.prototype,"loading",2);__decorateClass$9([r$o()],MateuApiCaller.prototype,"notificationOpened",2);__decorateClass$9([r$o()],MateuApiCaller.prototype,"error",2);MateuApiCaller=__decorateClass$9([t$o("mateu-api-caller")],MateuApiCaller);var __defProp$8=Object.defineProperty,__getOwnPropDesc$8=Object.getOwnPropertyDescriptor,__decorateClass$8=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$8(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$8(Q,X,ie),ie};let MateuApp=class extends ComponentElement{constructor(){super(...arguments),this.filter="",this.instant=void 0,this.selectedRoute=void 0,this.selectedUriPrefix=void 0,this.selectedBaseUrl=void 0,this.selectedAppServerSideType=void 0,this.selectedParams=void 0,this.getSelectedOption=te=>{if(te)for(let Q=0;Q<te.length;Q++){const X=te[Q];if(X.selected)return X;const ee=this.getSelectedOption(X.submenus);if(ee)return ee}return null},this.itemSelected=te=>{this.selectRoute(te.detail.value.route,te.detail.value.actionId,te.detail.value.baseUrl,te.detail.value.appServerSideType,te.detail.value.uriPrefix)},this.selectRoute=(te,Q,X,ee,ie)=>{if(te){this.selectedBaseUrl=X,this.selectedRoute=te,this.selectedAppServerSideType=ee,this.selectedUriPrefix=ie,this.instant=nanoid();let oe=this.baseUrl??"";oe.indexOf("://")<0&&(oe.startsWith("/")||(oe="/"+oe),oe=window.location.origin+oe),oe.endsWith("/")&&te.startsWith("/")&&(te=te.substring(1));let ne=new URL(oe+te);if((window.location.pathname||ne.pathname)&&window.location.pathname!=ne.pathname){let le=ne.pathname;le&&!le.startsWith("/")&&(le="/"+le),this.baseUrl&&le.startsWith(this.baseUrl)&&(le=le.substring(this.baseUrl.length));let de=le;this.selectedUriPrefix&&(de.startsWith("/")&&this.selectedUriPrefix.endsWith("/")?de=this.selectedUriPrefix+de.substring(1):!de.startsWith("/")&&!this.selectedUriPrefix.endsWith("/")?de=this.selectedUriPrefix+"/"+de:de=this.selectedUriPrefix+de),this.dispatchEvent(new CustomEvent("route-changed",{detail:{route:de},bubbles:!0,composed:!0}))}const ae=this.component.metadata,se=this.shadowRoot?.querySelector("mateu-ux");se&&(se.setAttribute("baseUrl",X??this.baseUrl),se.setAttribute("appServerSideType",ee??ae.appServerSideType),se.setAttribute("route",te),se.setAttribute("instant",nanoid()))}},this.mapItems=(te,Q)=>te.map(X=>{if(X.submenus&&X.submenus.length>0){let ee=this.mapItems(X.submenus,Q);return Q&&X.label.toLowerCase().includes(Q)&&(ee=this.mapItems(X.submenus,"")),ee&&ee.length>0?{text:X.label,route:X.destination?.route,baseUrl:X.baseUrl,appServerSideType:X.appServerSideType,uriPrefix:X.uriPrefix,actionId:X.actionId,selected:Q||X.selected,children:ee}:void 0}if(X.separator)return Q?void 0:{component:"hr"};if(!Q||X.label.toLowerCase().includes(Q))return{text:X.label,route:X.destination?.route,baseUrl:X.baseUrl,appServerSideType:X.appServerSideType,uriPrefix:X.uriPrefix,actionId:X.actionId,selected:Q||X.selected}}).filter(X=>X),this.getSelectedIndex=te=>{if(te){const Q=this.getSelectedOption(te);if(Q)return te.indexOf(Q)}},this.renderOptionOnLeftMenu=te=>te.submenus&&te.submenus.length>0?x$4`
23977
23978
  <vaadin-details summary="${te.label}" theme="reverse">
23978
23979
  <vaadin-vertical-layout>
23979
23980
  ${te.submenus.map(Q=>x$4`${this.renderOptionOnLeftMenu(Q)}`)}
23980
23981
  </vaadin-vertical-layout>
23981
23982
  </vaadin-details>
23982
23983
  `:x$4`<vaadin-button theme="tertiary"
23983
- @click="${()=>this.selectRoute(te.destination.route,te.actionId,te.baseUrl,te.appServerSideType)}"
23984
- >${te.label}</vaadin-button>`,this.navItemSelected=te=>{this.selectRoute(te.path,te.actionId,te.baseUrl,te.appServerSideType),this.component.metadata.drawerClosed&&this.vaadinAppLayout&&(this.vaadinAppLayout.drawerOpened=!1)},this.renderSideNav=(te,Q)=>te?x$4`
23984
+ @click="${()=>this.selectRoute(te.destination.route,te.actionId,te.baseUrl,te.appServerSideType,te.uriPrefix)}"
23985
+ >${te.label}</vaadin-button>`,this.navItemSelected=te=>{this.selectRoute(te.path,te.actionId,te.baseUrl,te.appServerSideType,te.uriPrefix),this.component.metadata.drawerClosed&&this.vaadinAppLayout&&(this.vaadinAppLayout.drawerOpened=!1)},this.renderSideNav=(te,Q)=>te?x$4`
23985
23986
  ${te.map(X=>x$4`
23986
23987
 
23987
23988
  ${X.component=="hr"?x$4`<hr slot="children"/>`:x$4`
@@ -23999,7 +24000,7 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
23999
24000
  </vaadin-side-nav-item>
24000
24001
  `}
24001
24002
 
24002
- `)}`:E$5,this.updateRoute=te=>{te.preventDefault(),te.stopPropagation();var Q=te.detail;this.selectRoute(Q.route,Q.actionId,Q.baseUrl,Q.appServerSideType)}}createRenderRoot(){return componentRenderer.mustUseShadowRoot()?super.createRenderRoot():this}updated(te){if(super.updated(te),te.has("component")&&(this.selectedRoute=void 0),this.component){const X=this.component.metadata;if(X){const ee=X;if(ee.favicon){let ie=document.querySelector("link[rel~='icon']");ie||(ie=document.createElement("link"),ie.rel="icon",document.head.appendChild(ie)),ie.href=ee.favicon}}}}connectedCallback(){super.connectedCallback(),this.addEventListener("update-route",this.updateRoute)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("update-route",this.updateRoute)}render(){return componentRenderer.get()?.renderAppComponent(this,this.component,this.baseUrl,this.state,this.data,this.appState,this.appData)}};MateuApp.styles=i$w`
24003
+ `)}`:E$5,this.updateRoute=te=>{te.preventDefault(),te.stopPropagation();var Q=te.detail;this.selectRoute(Q.route,Q.actionId,Q.baseUrl,Q.appServerSideType,Q.uriPrefix)}}createRenderRoot(){return componentRenderer.mustUseShadowRoot()?super.createRenderRoot():this}updated(te){if(super.updated(te),this.component){const X=this.component.metadata;if(X){const ee=X;if(ee.favicon){let ie=document.querySelector("link[rel~='icon']");ie||(ie=document.createElement("link"),ie.rel="icon",document.head.appendChild(ie)),ie.href=ee.favicon}}}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}render(){return componentRenderer.get()?.renderAppComponent(this,this.component,this.baseUrl,this.state,this.data,this.appState,this.appData)}};MateuApp.styles=i$w`
24003
24004
 
24004
24005
  .app-content {
24005
24006
  padding-left: 2rem;
@@ -24011,7 +24012,7 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24011
24012
  background-color: var(--lumo-base-color);
24012
24013
  }
24013
24014
 
24014
- `;__decorateClass$8([r$o()],MateuApp.prototype,"filter",2);__decorateClass$8([r$o()],MateuApp.prototype,"instant",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedRoute",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedBaseUrl",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedAppServerSideType",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedParams",2);__decorateClass$8([e$m("vaadin-app-layout")],MateuApp.prototype,"vaadinAppLayout",2);MateuApp=__decorateClass$8([t$o("mateu-app")],MateuApp);/*!
24015
+ `;__decorateClass$8([r$o()],MateuApp.prototype,"filter",2);__decorateClass$8([r$o()],MateuApp.prototype,"instant",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedRoute",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedUriPrefix",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedBaseUrl",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedAppServerSideType",2);__decorateClass$8([r$o()],MateuApp.prototype,"selectedParams",2);__decorateClass$8([e$m("vaadin-app-layout")],MateuApp.prototype,"vaadinAppLayout",2);MateuApp=__decorateClass$8([t$o("mateu-app")],MateuApp);/*!
24015
24016
  * @kurkle/color v0.3.4
24016
24017
  * https://github.com/kurkle/color#readme
24017
24018
  * (c) 2024 Jukka Kurkela
@@ -24035,7 +24036,7 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24035
24036
  * Released under the MIT license
24036
24037
  */const FORMATS={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};adapters._date.override({_id:"date-fns",formats:function(){return FORMATS},parse:function(te,Q){if(te===null||typeof te>"u")return null;const X=typeof te;return X==="number"||te instanceof Date?te=toDate(te):X==="string"&&(typeof Q=="string"?te=parse(te,Q,new Date,this.options):te=parseISO(te,this.options)),isValid(te)?te.getTime():null},format:function(te,Q){return format(te,Q,this.options)},add:function(te,Q,X){switch(X){case"millisecond":return addMilliseconds(te,Q);case"second":return addSeconds(te,Q);case"minute":return addMinutes(te,Q);case"hour":return addHours(te,Q);case"day":return addDays(te,Q);case"week":return addWeeks(te,Q);case"month":return addMonths(te,Q);case"quarter":return addQuarters(te,Q);case"year":return addYears(te,Q);default:return te}},diff:function(te,Q,X){switch(X){case"millisecond":return differenceInMilliseconds(te,Q);case"second":return differenceInSeconds(te,Q);case"minute":return differenceInMinutes(te,Q);case"hour":return differenceInHours(te,Q);case"day":return differenceInDays(te,Q);case"week":return differenceInWeeks(te,Q);case"month":return differenceInMonths(te,Q);case"quarter":return differenceInQuarters(te,Q);case"year":return differenceInYears(te,Q);default:return 0}},startOf:function(te,Q,X){switch(Q){case"second":return startOfSecond(te);case"minute":return startOfMinute(te);case"hour":return startOfHour(te);case"day":return startOfDay(te);case"week":return startOfWeek(te);case"isoWeek":return startOfWeek(te,{weekStartsOn:+X});case"month":return startOfMonth(te);case"quarter":return startOfQuarter(te);case"year":return startOfYear(te);default:return te}},endOf:function(te,Q){switch(Q){case"second":return endOfSecond(te);case"minute":return endOfMinute(te);case"hour":return endOfHour(te);case"day":return endOfDay(te);case"week":return endOfWeek(te);case"month":return endOfMonth(te);case"quarter":return endOfQuarter(te);case"year":return endOfYear(te);default:return te}}});var cookieconsent_min={},hasRequiredCookieconsent_min;function requireCookieconsent_min(){return hasRequiredCookieconsent_min||(hasRequiredCookieconsent_min=1,(function(te){if(!te.hasInitialised){var Q={escapeRegExp:function(ee){return ee.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},hasClass:function(ee,ie){var oe=" ";return ee.nodeType===1&&(oe+ee.className+oe).replace(/[\n\t]/g,oe).indexOf(oe+ie+oe)>=0},addClass:function(ee,ie){ee.className+=" "+ie},removeClass:function(ee,ie){var oe=new RegExp("\\b"+this.escapeRegExp(ie)+"\\b");ee.className=ee.className.replace(oe,"")},interpolateString:function(ee,ie){return ee.replace(/{{([a-z][a-z0-9\-_]*)}}/gi,function(oe){return ie(arguments[1])||""})},getCookie:function(ee){var ie=("; "+document.cookie).split("; "+ee+"=");return ie.length<2?void 0:ie.pop().split(";").shift()},setCookie:function(ee,ie,oe,ne,ae,se){var le=new Date;le.setHours(le.getHours()+24*(oe||365));var de=[ee+"="+ie,"expires="+le.toUTCString(),"path="+(ae||"/")];ne&&de.push("domain="+ne),se&&de.push("secure"),document.cookie=de.join(";")},deepExtend:function(ee,ie){for(var oe in ie)ie.hasOwnProperty(oe)&&(oe in ee&&this.isPlainObject(ee[oe])&&this.isPlainObject(ie[oe])?this.deepExtend(ee[oe],ie[oe]):ee[oe]=ie[oe]);return ee},throttle:function(ee,ie){var oe=!1;return function(){oe||(ee.apply(this,arguments),oe=!0,setTimeout(function(){oe=!1},ie))}},hash:function(ee){var ie,oe,ne=0;if(ee.length===0)return ne;for(ie=0,oe=ee.length;ie<oe;++ie)ne=(ne<<5)-ne+ee.charCodeAt(ie),ne|=0;return ne},normaliseHex:function(ee){return ee[0]=="#"&&(ee=ee.substr(1)),ee.length==3&&(ee=ee[0]+ee[0]+ee[1]+ee[1]+ee[2]+ee[2]),ee},getContrast:function(ee){return ee=this.normaliseHex(ee),(299*parseInt(ee.substr(0,2),16)+587*parseInt(ee.substr(2,2),16)+114*parseInt(ee.substr(4,2),16))/1e3>=128?"#000":"#fff"},getLuminance:function(ee){var ie=parseInt(this.normaliseHex(ee),16),oe=38+(ie>>16),ne=38+(ie>>8&255),ae=38+(255&ie);return"#"+(16777216+65536*(oe<255?oe<1?0:oe:255)+256*(ne<255?ne<1?0:ne:255)+(ae<255?ae<1?0:ae:255)).toString(16).slice(1)},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isPlainObject:function(ee){return typeof ee=="object"&&ee!==null&&ee.constructor==Object},traverseDOMPath:function(ee,ie){return ee&&ee.parentNode?Q.hasClass(ee,ie)?ee:this.traverseDOMPath(ee.parentNode,ie):null}};te.status={deny:"deny",allow:"allow",dismiss:"dismiss"},te.transitionEnd=(function(){var ee=document.createElement("div"),ie={t:"transitionend",OT:"oTransitionEnd",msT:"MSTransitionEnd",MozT:"transitionend",WebkitT:"webkitTransitionEnd"};for(var oe in ie)if(ie.hasOwnProperty(oe)&&ee.style[oe+"ransition"]!==void 0)return ie[oe];return""})(),te.hasTransition=!!te.transitionEnd;var X=Object.keys(te.status).map(Q.escapeRegExp);te.customStyles={},te.Popup=(function(){var ee={enabled:!0,container:null,cookie:{name:"cookieconsent_status",path:"/",domain:"",expiryDays:365,secure:!1},onPopupOpen:function(){},onPopupClose:function(){},onInitialise:function(ce){},onStatusChange:function(ce,he){},onRevokeChoice:function(){},onNoCookieLaw:function(ce,he){},content:{header:"Cookies used on the website!",message:"This website uses cookies to ensure you get the best experience on our website.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",href:"https://www.cookiesandyou.com",close:"&#x274c;",target:"_blank",policy:"Cookie Policy"},elements:{header:'<span class="cc-header">{{header}}</span>&nbsp;',message:'<span id="cookieconsent:desc" class="cc-message">{{message}}</span>',messagelink:'<span id="cookieconsent:desc" class="cc-message">{{message}} <a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" rel="noopener noreferrer nofollow" target="{{target}}">{{link}}</a></span>',dismiss:'<a aria-label="dismiss cookie message" role=button tabindex="0" class="cc-btn cc-dismiss">{{dismiss}}</a>',allow:'<a aria-label="allow cookies" role=button tabindex="0" class="cc-btn cc-allow">{{allow}}</a>',deny:'<a aria-label="deny cookies" role=button tabindex="0" class="cc-btn cc-deny">{{deny}}</a>',link:'<a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" rel="noopener noreferrer nofollow" target="{{target}}">{{link}}</a>',close:'<span aria-label="dismiss cookie message" role=button tabindex="0" class="cc-close">{{close}}</span>'},window:'<div role="dialog" aria-live="polite" aria-label="cookieconsent" aria-describedby="cookieconsent:desc" class="cc-window {{classes}}"><!--googleoff: all-->{{children}}<!--googleon: all--></div>',revokeBtn:'<div class="cc-revoke {{classes}}">{{policy}}</div>',compliance:{info:'<div class="cc-compliance">{{dismiss}}</div>',"opt-in":'<div class="cc-compliance cc-highlight">{{deny}}{{allow}}</div>',"opt-out":'<div class="cc-compliance cc-highlight">{{deny}}{{allow}}</div>'},type:"info",layouts:{basic:"{{messagelink}}{{compliance}}","basic-close":"{{messagelink}}{{compliance}}{{close}}","basic-header":"{{header}}{{message}}{{link}}{{compliance}}"},layout:"basic",position:"bottom",theme:"block",static:!1,palette:null,revokable:!1,animateRevokable:!0,showLink:!0,dismissOnScroll:!1,dismissOnTimeout:!1,dismissOnWindowClick:!1,ignoreClicksFrom:["cc-revoke","cc-btn"],autoOpen:!0,autoAttach:!0,whitelistPage:[],blacklistPage:[],overrideHTML:null};function ie(){this.initialise.apply(this,arguments)}function oe(ce){this.openingTimeout=null,Q.removeClass(ce,"cc-invisible")}function ne(ce){ce.style.display="none",ce.removeEventListener(te.transitionEnd,this.afterTransition),this.afterTransition=null}function ae(){var ce=this.options.position.split("-"),he=[];return ce.forEach(function(ue){he.push("cc-"+ue)}),he}function se(ce){var he=this.options,ue=document.createElement("div"),pe=he.container&&he.container.nodeType===1?he.container:document.body;ue.innerHTML=ce;var fe=ue.children[0];return fe.style.display="none",Q.hasClass(fe,"cc-window")&&te.hasTransition&&Q.addClass(fe,"cc-invisible"),this.onButtonClick=(function(ve){var me=Q.traverseDOMPath(ve.target,"cc-btn")||ve.target;if(Q.hasClass(me,"cc-btn")){var ge=me.className.match(new RegExp("\\bcc-("+X.join("|")+")\\b")),_e=ge&&ge[1]||!1;_e&&(this.setStatus(_e),this.close(!0))}Q.hasClass(me,"cc-close")&&(this.setStatus(te.status.dismiss),this.close(!0)),Q.hasClass(me,"cc-revoke")&&this.revokeChoice()}).bind(this),fe.addEventListener("click",this.onButtonClick),he.autoAttach&&(pe.firstChild?pe.insertBefore(fe,pe.firstChild):pe.appendChild(fe)),fe}function le(ce){return(ce=Q.normaliseHex(ce))=="000000"?"#222":Q.getLuminance(ce)}function de(ce,he){for(var ue=0,pe=ce.length;ue<pe;++ue){var fe=ce[ue];if(fe instanceof RegExp&&fe.test(he)||typeof fe=="string"&&fe.length&&fe===he)return!0}return!1}return ie.prototype.initialise=function(ce){this.options&&this.destroy(),Q.deepExtend(this.options={},ee),Q.isPlainObject(ce)&&Q.deepExtend(this.options,ce),(function(){var fe=this.options.onInitialise.bind(this);if(!window.navigator.cookieEnabled)return fe(te.status.deny),!0;if(window.CookiesOK||window.navigator.CookiesOK)return fe(te.status.allow),!0;var ve=Object.keys(te.status),me=this.getStatus(),ge=ve.indexOf(me)>=0;return ge&&fe(me),ge}).call(this)&&(this.options.enabled=!1),de(this.options.blacklistPage,location.pathname)&&(this.options.enabled=!1),de(this.options.whitelistPage,location.pathname)&&(this.options.enabled=!0);var he=this.options.window.replace("{{classes}}",(function(){var fe=this.options,ve=fe.position=="top"||fe.position=="bottom"?"banner":"floating";Q.isMobile()&&(ve="floating");var me=["cc-"+ve,"cc-type-"+fe.type,"cc-theme-"+fe.theme];return fe.static&&me.push("cc-static"),me.push.apply(me,ae.call(this)),(function(ge){var _e=Q.hash(JSON.stringify(ge)),be="cc-color-override-"+_e,ye=Q.isPlainObject(ge);return this.customStyleSelector=ye?be:null,ye&&(function(xe,we,$e){if(te.customStyles[xe])return void++te.customStyles[xe].references;var Ae={},Me=we.popup,Ee=we.button,Te=we.highlight;Me&&(Me.text=Me.text?Me.text:Q.getContrast(Me.background),Me.link=Me.link?Me.link:Me.text,Ae[$e+".cc-window"]=["color: "+Me.text,"background-color: "+Me.background],Ae[$e+".cc-revoke"]=["color: "+Me.text,"background-color: "+Me.background],Ae[$e+" .cc-link,"+$e+" .cc-link:active,"+$e+" .cc-link:visited"]=["color: "+Me.link],Ee&&(Ee.text=Ee.text?Ee.text:Q.getContrast(Ee.background),Ee.border=Ee.border?Ee.border:"transparent",Ae[$e+" .cc-btn"]=["color: "+Ee.text,"border-color: "+Ee.border,"background-color: "+Ee.background],Ee.padding&&Ae[$e+" .cc-btn"].push("padding: "+Ee.padding),Ee.background!="transparent"&&(Ae[$e+" .cc-btn:hover, "+$e+" .cc-btn:focus"]=["background-color: "+(Ee.hover||le(Ee.background))]),Te?(Te.text=Te.text?Te.text:Q.getContrast(Te.background),Te.border=Te.border?Te.border:"transparent",Ae[$e+" .cc-highlight .cc-btn:first-child"]=["color: "+Te.text,"border-color: "+Te.border,"background-color: "+Te.background]):Ae[$e+" .cc-highlight .cc-btn:first-child"]=["color: "+Me.text]));var ke=document.createElement("style");document.head.appendChild(ke),te.customStyles[xe]={references:1,element:ke.sheet};var De=-1;for(var Ie in Ae)Ae.hasOwnProperty(Ie)&&ke.sheet.insertRule(Ie+"{"+Ae[Ie].join(";")+"}",++De)})(_e,ge,"."+be),ye}).call(this,this.options.palette),this.customStyleSelector&&me.push(this.customStyleSelector),me}).call(this).join(" ")).replace("{{children}}",(function(){var fe={},ve=this.options;ve.showLink||(ve.elements.link="",ve.elements.messagelink=ve.elements.message),Object.keys(ve.elements).forEach(function(_e){fe[_e]=Q.interpolateString(ve.elements[_e],function(be){var ye=ve.content[be];return be&&typeof ye=="string"&&ye.length?ye:""})});var me=ve.compliance[ve.type];me||(me=ve.compliance.info),fe.compliance=Q.interpolateString(me,function(_e){return fe[_e]});var ge=ve.layouts[ve.layout];return ge||(ge=ve.layouts.basic),Q.interpolateString(ge,function(_e){return fe[_e]})}).call(this)),ue=this.options.overrideHTML;if(typeof ue=="string"&&ue.length&&(he=ue),this.options.static){var pe=se.call(this,'<div class="cc-grower">'+he+"</div>");pe.style.display="",this.element=pe.firstChild,this.element.style.display="none",Q.addClass(this.element,"cc-invisible")}else this.element=se.call(this,he);(function(){var fe=this.setStatus.bind(this),ve=this.close.bind(this),me=this.options.dismissOnTimeout;typeof me=="number"&&me>=0&&(this.dismissTimeout=window.setTimeout(function(){fe(te.status.dismiss),ve(!0)},Math.floor(me)));var ge=this.options.dismissOnScroll;if(typeof ge=="number"&&ge>=0){var _e=function(we){window.pageYOffset>Math.floor(ge)&&(fe(te.status.dismiss),ve(!0),window.removeEventListener("scroll",_e),this.onWindowScroll=null)};this.options.enabled&&(this.onWindowScroll=_e,window.addEventListener("scroll",_e))}var be=this.options.dismissOnWindowClick,ye=this.options.ignoreClicksFrom;if(be){var xe=(function(we){for(var $e=!1,Ae=we.path.length,Me=ye.length,Ee=0;Ee<Ae;Ee++)if(!$e)for(var Te=0;Te<Me;Te++)$e||($e=Q.hasClass(we.path[Ee],ye[Te]));$e||(fe(te.status.dismiss),ve(!0),window.removeEventListener("click",xe),window.removeEventListener("touchend",xe),this.onWindowClick=null)}).bind(this);this.options.enabled&&(this.onWindowClick=xe,window.addEventListener("click",xe),window.addEventListener("touchend",xe))}}).call(this),(function(){if(this.options.type!="info"&&(this.options.revokable=!0),Q.isMobile()&&(this.options.animateRevokable=!1),this.options.revokable){var fe=ae.call(this);this.options.animateRevokable&&fe.push("cc-animate"),this.customStyleSelector&&fe.push(this.customStyleSelector);var ve=this.options.revokeBtn.replace("{{classes}}",fe.join(" ")).replace("{{policy}}",this.options.content.policy);this.revokeBtn=se.call(this,ve);var me=this.revokeBtn;if(this.options.animateRevokable){var ge=Q.throttle(function(_e){var be=!1,ye=window.innerHeight-20;Q.hasClass(me,"cc-top")&&_e.clientY<20&&(be=!0),Q.hasClass(me,"cc-bottom")&&_e.clientY>ye&&(be=!0),be?Q.hasClass(me,"cc-active")||Q.addClass(me,"cc-active"):Q.hasClass(me,"cc-active")&&Q.removeClass(me,"cc-active")},200);this.onMouseMove=ge,window.addEventListener("mousemove",ge)}}}).call(this),this.options.autoOpen&&this.autoOpen()},ie.prototype.destroy=function(){this.onButtonClick&&this.element&&(this.element.removeEventListener("click",this.onButtonClick),this.onButtonClick=null),this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.onWindowScroll&&(window.removeEventListener("scroll",this.onWindowScroll),this.onWindowScroll=null),this.onWindowClick&&(window.removeEventListener("click",this.onWindowClick),this.onWindowClick=null),this.onMouseMove&&(window.removeEventListener("mousemove",this.onMouseMove),this.onMouseMove=null),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.revokeBtn&&this.revokeBtn.parentNode&&this.revokeBtn.parentNode.removeChild(this.revokeBtn),this.revokeBtn=null,(function(ce){if(Q.isPlainObject(ce)){var he=Q.hash(JSON.stringify(ce)),ue=te.customStyles[he];if(ue&&!--ue.references){var pe=ue.element.ownerNode;pe&&pe.parentNode&&pe.parentNode.removeChild(pe),te.customStyles[he]=null}}})(this.options.palette),this.options=null},ie.prototype.open=function(ce){if(this.element)return this.isOpen()||(te.hasTransition?this.fadeIn():this.element.style.display="",this.options.revokable&&this.toggleRevokeButton(),this.options.onPopupOpen.call(this)),this},ie.prototype.close=function(ce){if(this.element)return this.isOpen()&&(te.hasTransition?this.fadeOut():this.element.style.display="none",ce&&this.options.revokable&&this.toggleRevokeButton(!0),this.options.onPopupClose.call(this)),this},ie.prototype.fadeIn=function(){var ce=this.element;if(te.hasTransition&&ce&&(this.afterTransition&&ne.call(this,ce),Q.hasClass(ce,"cc-invisible"))){if(ce.style.display="",this.options.static){var he=this.element.clientHeight;this.element.parentNode.style.maxHeight=he+"px"}this.openingTimeout=setTimeout(oe.bind(this,ce),20)}},ie.prototype.fadeOut=function(){var ce=this.element;te.hasTransition&&ce&&(this.openingTimeout&&(clearTimeout(this.openingTimeout),oe.bind(this,ce)),Q.hasClass(ce,"cc-invisible")||(this.options.static&&(this.element.parentNode.style.maxHeight=""),this.afterTransition=ne.bind(this,ce),ce.addEventListener(te.transitionEnd,this.afterTransition),Q.addClass(ce,"cc-invisible")))},ie.prototype.isOpen=function(){return this.element&&this.element.style.display==""&&(!te.hasTransition||!Q.hasClass(this.element,"cc-invisible"))},ie.prototype.toggleRevokeButton=function(ce){this.revokeBtn&&(this.revokeBtn.style.display=ce?"":"none")},ie.prototype.revokeChoice=function(ce){this.options.enabled=!0,this.clearStatus(),this.options.onRevokeChoice.call(this),ce||this.autoOpen()},ie.prototype.hasAnswered=function(ce){return Object.keys(te.status).indexOf(this.getStatus())>=0},ie.prototype.hasConsented=function(ce){var he=this.getStatus();return he==te.status.allow||he==te.status.dismiss},ie.prototype.autoOpen=function(ce){!this.hasAnswered()&&this.options.enabled?this.open():this.hasAnswered()&&this.options.revokable&&this.toggleRevokeButton(!0)},ie.prototype.setStatus=function(ce){var he=this.options.cookie,ue=Q.getCookie(he.name),pe=Object.keys(te.status).indexOf(ue)>=0;Object.keys(te.status).indexOf(ce)>=0?(Q.setCookie(he.name,ce,he.expiryDays,he.domain,he.path,he.secure),this.options.onStatusChange.call(this,ce,pe)):this.clearStatus()},ie.prototype.getStatus=function(){return Q.getCookie(this.options.cookie.name)},ie.prototype.clearStatus=function(){var ce=this.options.cookie;Q.setCookie(ce.name,"",-1,ce.domain,ce.path)},ie})(),te.Location=(function(){var ee={timeout:5e3,services:["ipinfo"],serviceDefinitions:{ipinfo:function(){return{url:"//ipinfo.io",headers:["Accept: application/json"],callback:function(se,le){try{var de=JSON.parse(le);return de.error?ae(de):{code:de.country}}catch(ce){return ae({error:"Invalid response ("+ce+")"})}}}},ipinfodb:function(se){return{url:"//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}",isScript:!0,callback:function(le,de){try{var ce=JSON.parse(de);return ce.statusCode=="ERROR"?ae({error:ce.statusMessage}):{code:ce.countryCode}}catch(he){return ae({error:"Invalid response ("+he+")"})}}}},maxmind:function(){return{url:"//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js",isScript:!0,callback:function(se){window.geoip2?geoip2.country(function(le){try{se({code:le.country.iso_code})}catch(de){se(ae(de))}},function(le){se(ae(le))}):se(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope"))}}}}};function ie(se){Q.deepExtend(this.options={},ee),Q.isPlainObject(se)&&Q.deepExtend(this.options,se),this.currentServiceIndex=-1}function oe(se,le,de){var ce,he=document.createElement("script");he.type="text/"+(se.type||"javascript"),he.src=se.src||se,he.async=!1,he.onreadystatechange=he.onload=function(){var ue=he.readyState;clearTimeout(ce),le.done||ue&&!/loaded|complete/.test(ue)||(le.done=!0,le(),he.onreadystatechange=he.onload=null)},document.body.appendChild(he),ce=setTimeout(function(){le.done=!0,le(),he.onreadystatechange=he.onload=null},de)}function ne(se,le,de,ce,he){var ue=new(window.XMLHttpRequest||window.ActiveXObject)("MSXML2.XMLHTTP.3.0");if(ue.open(ce?"POST":"GET",se,1),ue.setRequestHeader("Content-type","application/x-www-form-urlencoded"),Array.isArray(he))for(var pe=0,fe=he.length;pe<fe;++pe){var ve=he[pe].split(":",2);ue.setRequestHeader(ve[0].replace(/^\s+|\s+$/g,""),ve[1].replace(/^\s+|\s+$/g,""))}typeof le=="function"&&(ue.onreadystatechange=function(){ue.readyState>3&&le(ue)}),ue.send(ce)}function ae(se){return new Error("Error ["+(se.code||"UNKNOWN")+"]: "+se.error)}return ie.prototype.getNextService=function(){var se;do se=this.getServiceByIdx(++this.currentServiceIndex);while(this.currentServiceIndex<this.options.services.length&&!se);return se},ie.prototype.getServiceByIdx=function(se){var le=this.options.services[se];if(typeof le=="function"){var de=le();return de.name&&Q.deepExtend(de,this.options.serviceDefinitions[de.name](de)),de}return typeof le=="string"?this.options.serviceDefinitions[le]():Q.isPlainObject(le)?this.options.serviceDefinitions[le.name](le):null},ie.prototype.locate=function(se,le){var de=this.getNextService();de?(this.callbackComplete=se,this.callbackError=le,this.runService(de,this.runNextServiceOnError.bind(this))):le(new Error("No services to run"))},ie.prototype.setupUrl=function(se){var le=this.getCurrentServiceOpts();return se.url.replace(/\{(.*?)\}/g,function(de,ce){if(ce==="callback"){var he="callback"+Date.now();return window[he]=function(ue){se.__JSONP_DATA=JSON.stringify(ue)},he}if(ce in le.interpolateUrl)return le.interpolateUrl[ce]})},ie.prototype.runService=function(se,le){var de=this;se&&se.url&&se.callback&&(se.isScript?oe:ne)(this.setupUrl(se),function(ce){var he=ce?ce.responseText:"";se.__JSONP_DATA&&(he=se.__JSONP_DATA,delete se.__JSONP_DATA),de.runServiceCallback.call(de,le,se,he)},this.options.timeout,se.data,se.headers)},ie.prototype.runServiceCallback=function(se,le,de){var ce=this,he=le.callback(function(ue){he||ce.onServiceResult.call(ce,se,ue)},de);he&&this.onServiceResult.call(this,se,he)},ie.prototype.onServiceResult=function(se,le){le instanceof Error||le&&le.error?se.call(this,le,null):se.call(this,null,le)},ie.prototype.runNextServiceOnError=function(se,le){if(se){this.logError(se);var de=this.getNextService();de?this.runService(de,this.runNextServiceOnError.bind(this)):this.completeService.call(this,this.callbackError,new Error("All services failed"))}else this.completeService.call(this,this.callbackComplete,le)},ie.prototype.getCurrentServiceOpts=function(){var se=this.options.services[this.currentServiceIndex];return typeof se=="string"?{name:se}:typeof se=="function"?se():Q.isPlainObject(se)?se:{}},ie.prototype.completeService=function(se,le){this.currentServiceIndex=-1,se&&se(le)},ie.prototype.logError=function(se){var le=this.currentServiceIndex,de=this.getServiceByIdx(le);console.warn("The service["+le+"] ("+de.url+") responded with the following error",se)},ie})(),te.Law=(function(){var ee={regionalLaw:!0,hasLaw:["AT","BE","BG","HR","CZ","CY","DK","EE","FI","FR","DE","EL","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","SK","ES","SE","GB","UK","GR","EU"],revokable:["HR","CY","DK","EE","FR","DE","LV","LT","NL","PT","ES"],explicitAction:["HR","IT","ES"]};function ie(oe){this.initialise.apply(this,arguments)}return ie.prototype.initialise=function(oe){Q.deepExtend(this.options={},ee),Q.isPlainObject(oe)&&Q.deepExtend(this.options,oe)},ie.prototype.get=function(oe){var ne=this.options;return{hasLaw:ne.hasLaw.indexOf(oe)>=0,revokable:ne.revokable.indexOf(oe)>=0,explicitAction:ne.explicitAction.indexOf(oe)>=0}},ie.prototype.applyLaw=function(oe,ne){var ae=this.get(ne);return ae.hasLaw||(oe.enabled=!1,typeof oe.onNoCookieLaw=="function"&&oe.onNoCookieLaw(ne,ae)),this.options.regionalLaw&&(ae.revokable&&(oe.revokable=!0),ae.explicitAction&&(oe.dismissOnScroll=!1,oe.dismissOnTimeout=!1)),oe},ie})(),te.initialise=function(ee,ie,oe){var ne=new te.Law(ee.law);ie||(ie=function(){}),oe||(oe=function(){});var ae=Object.keys(te.status),se=Q.getCookie("cookieconsent_status");ae.indexOf(se)>=0?ie(new te.Popup(ee)):te.getCountryCode(ee,function(le){delete ee.law,delete ee.location,le.code&&(ee=ne.applyLaw(ee,le.code)),ie(new te.Popup(ee))},function(le){delete ee.law,delete ee.location,oe(le,new te.Popup(ee))})},te.getCountryCode=function(ee,ie,oe){ee.law&&ee.law.countryCode?ie({code:ee.law.countryCode}):ee.location?new te.Location(ee.location).locate(function(ne){ie(ne||{})},oe):ie({})},te.utils=Q,te.hasInitialised=!0,window.cookieconsent=te}})(window.cookieconsent||{})),cookieconsent_min}requireCookieconsent_min();var __defProp$7=Object.defineProperty,__getOwnPropDesc$7=Object.getOwnPropertyDescriptor,__decorateClass$7=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$7(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$7(Q,X,ie),ie};let MateuCookieConsent=class extends i$s{constructor(){super(...arguments),this.message="This website uses cookies.",this.dismiss="Ok. Thanks :).",this.learnMore="Learn more",this.learnMoreLink="https://cookiesandyou.com/",this.showLearnMore=!0,this.position="top",this.cookieName="mateu-cookieconsent"}updated(te){super.updated(te)}connectedCallback(){super.connectedCallback(),this._css=document.createElement("style"),this._css.innerText=".cc-window{opacity:1;transition:opacity 1s ease}.cc-window.cc-invisible{opacity:0}.cc-animate.cc-revoke{transition:transform 1s ease}.cc-animate.cc-revoke.cc-top{transform:translateY(-2em)}.cc-animate.cc-revoke.cc-bottom{transform:translateY(2em)}.cc-animate.cc-revoke.cc-active.cc-bottom,.cc-animate.cc-revoke.cc-active.cc-top,.cc-revoke:hover{transform:translateY(0)}.cc-grower{max-height:0;overflow:hidden;transition:max-height 1s}.cc-link,.cc-revoke:hover{text-decoration:underline}.cc-revoke,.cc-window{position:fixed;overflow:hidden;box-sizing:border-box;font-family:Helvetica,Calibri,Arial,sans-serif;font-size:16px;line-height:1.5em;display:flex;flex-wrap:nowrap;z-index:9999}.cc-window.cc-static{position:static}.cc-window.cc-floating{padding:2em;max-width:24em;flex-direction:column}.cc-window.cc-banner{padding:1em 1.8em;width:100%;flex-direction:row}.cc-revoke{padding:.5em}.cc-header{font-size:18px;font-weight:700}.cc-btn,.cc-close,.cc-link,.cc-revoke{cursor:pointer}.cc-link{opacity:.8;display:inline-block;padding:.2em}.cc-link:hover{opacity:1}.cc-link:active,.cc-link:visited{color:initial}.cc-btn{display:block;padding:.4em .8em;font-size:.9em;font-weight:700;border-width:2px;border-style:solid;text-align:center;white-space:nowrap}.cc-banner .cc-btn:last-child{min-width:140px}.cc-highlight .cc-btn:first-child{background-color:transparent;border-color:transparent}.cc-highlight .cc-btn:first-child:focus,.cc-highlight .cc-btn:first-child:hover{background-color:transparent;text-decoration:underline}.cc-close{display:block;position:absolute;top:.5em;right:.5em;font-size:1.6em;opacity:.9;line-height:.75}.cc-close:focus,.cc-close:hover{opacity:1}.cc-revoke.cc-top{top:0;left:3em;border-bottom-left-radius:.5em;border-bottom-right-radius:.5em}.cc-revoke.cc-bottom{bottom:0;left:3em;border-top-left-radius:.5em;border-top-right-radius:.5em}.cc-revoke.cc-left{left:3em;right:unset}.cc-revoke.cc-right{right:3em;left:unset}.cc-top{top:1em}.cc-left{left:1em}.cc-right{right:1em}.cc-bottom{bottom:1em}.cc-floating>.cc-link{margin-bottom:1em}.cc-floating .cc-message{display:block;margin-bottom:1em}.cc-window.cc-floating .cc-compliance{flex:1 0 auto}.cc-window.cc-banner{align-items:center}.cc-banner.cc-top{left:0;right:0;top:0}.cc-banner.cc-bottom{left:0;right:0;bottom:0}.cc-banner .cc-message{flex:1}.cc-compliance{display:flex;align-items:center;align-content:space-between}.cc-compliance>.cc-btn{flex:1}.cc-btn+.cc-btn{margin-left:.5em}@media print{.cc-revoke,.cc-window{display:none}}@media screen and (max-width:900px){.cc-btn{white-space:normal}}@media screen and (max-width:414px) and (orientation:portrait),screen and (max-width:736px) and (orientation:landscape){.cc-window.cc-top{top:0}.cc-window.cc-bottom{bottom:0}.cc-window.cc-banner,.cc-window.cc-left,.cc-window.cc-right{left:0;right:0}.cc-window.cc-banner{flex-direction:column}.cc-window.cc-banner .cc-compliance{flex:1}.cc-window.cc-floating{max-width:none}.cc-window .cc-message{margin-bottom:1em}.cc-window.cc-banner{align-items:unset}}.cc-floating.cc-theme-classic{padding:1.2em;border-radius:5px}.cc-floating.cc-type-info.cc-theme-classic .cc-compliance{text-align:center;display:inline;flex:none}.cc-theme-classic .cc-btn{border-radius:5px}.cc-theme-classic .cc-btn:last-child{min-width:140px}.cc-floating.cc-type-info.cc-theme-classic .cc-btn{display:inline-block}.cc-theme-edgeless.cc-window{padding:0}.cc-floating.cc-theme-edgeless .cc-message{margin:2em 2em 1.5em}.cc-banner.cc-theme-edgeless .cc-btn{margin:0;padding:.8em 1.8em;height:100%}.cc-banner.cc-theme-edgeless .cc-message{margin-left:1em}.cc-floating.cc-theme-edgeless .cc-btn+.cc-btn{margin-left:0}",document.head.appendChild(this._css),this.__updatePopup()}disconnectedCallback(){super.disconnectedCallback(),this.__closePopup(),this._css.isConnected&&this._css.remove()}__closePopup(){const te=this.popup;te&&te.parentNode?.removeChild(te)}_show(){const te=this.popup;te&&(te.classList.remove("cc-invisible"),te.style.display="")}__updatePopup(){this.__closePopup(),window.cookieconsent.initialise({palette:{popup:{background:"#000"},button:{background:"rgba(22, 118, 243, 0.95)",hover:"rgba(22, 118, 243, 1)"}},showLink:this.showLearnMore,content:{message:this.message,dismiss:this.dismiss,link:this.learnMore,href:this.learnMoreLink},cookie:{name:this.cookieName},position:this.position,elements:{messagelink:`<span id="cookieconsent:desc" class="cc-message">${this.message} <a tabindex="0" class="cc-link" href="${this.learnMoreLink}" target="_blank" rel="noopener noreferrer nofollow">${this.learnMore}</a></span>`,dismiss:`<a tabindex="0" class="cc-btn cc-dismiss">${this.dismiss}</a>`}});const te=this.popup;if(te){te.setAttribute("role","alert");const Q=te.querySelector("a.cc-btn");Q?.addEventListener("keydown",X=>{const oe=X.keyCode||X.which;(oe===32||oe===13)&&Q.click()})}}render(){return x$4`
24037
24038
  `}};MateuCookieConsent.styles=i$w`
24038
- `;__decorateClass$7([n$t()],MateuCookieConsent.prototype,"message",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"dismiss",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"learnMore",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"learnMoreLink",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"showLearnMore",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"position",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"cookieName",2);__decorateClass$7([r$o()],MateuCookieConsent.prototype,"_css",2);__decorateClass$7([e$m('[aria-label="cookieconsent"]')],MateuCookieConsent.prototype,"popup",2);MateuCookieConsent=__decorateClass$7([t$o("mateu-cookie-consent")],MateuCookieConsent);var __defProp$6=Object.defineProperty,__getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__decorateClass$6=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$6(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$6(Q,X,ie),ie};let MateuEventInterceptor=class extends i$s{constructor(){super(...arguments),this.redispatchEvent=te=>{te instanceof CustomEvent&&(te.stopPropagation(),te.preventDefault(),this.target?.dispatchEvent(new CustomEvent(te.type,{detail:te.detail,bubbles:!0,composed:!0})))}}connectedCallback(){super.connectedCallback(),this.addEventListener("value-changed",this.redispatchEvent),this.addEventListener("action-requested",this.redispatchEvent),this.addEventListener("server-side-action-requested",this.redispatchEvent)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("value-changed",this.redispatchEvent),this.removeEventListener("action-requested",this.redispatchEvent),this.removeEventListener("server-side-action-requested",this.redispatchEvent)}render(){return x$4`<slot></slot>`}};MateuEventInterceptor.styles=i$w`
24039
+ `;__decorateClass$7([n$t()],MateuCookieConsent.prototype,"message",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"dismiss",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"learnMore",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"learnMoreLink",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"showLearnMore",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"position",2);__decorateClass$7([n$t()],MateuCookieConsent.prototype,"cookieName",2);__decorateClass$7([r$o()],MateuCookieConsent.prototype,"_css",2);__decorateClass$7([e$m('[aria-label="cookieconsent"]')],MateuCookieConsent.prototype,"popup",2);MateuCookieConsent=__decorateClass$7([t$o("mateu-cookie-consent")],MateuCookieConsent);var __defProp$6=Object.defineProperty,__getOwnPropDesc$6=Object.getOwnPropertyDescriptor,__decorateClass$6=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$6(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$6(Q,X,ie),ie};let MateuEventInterceptor=class extends i$s{constructor(){super(...arguments),this.redispatchEvent=te=>{te instanceof CustomEvent&&(te.stopPropagation(),te.preventDefault(),this.target?.dispatchEvent(new CustomEvent(te.type,{detail:te.detail,bubbles:!0,composed:!0})))}}connectedCallback(){super.connectedCallback(),this.addEventListener("value-changed",this.redispatchEvent),this.addEventListener("action-requested",this.redispatchEvent),this.addEventListener("server-side-action-requested",this.redispatchEvent),this.addEventListener("route-changed",this.redispatchEvent)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("value-changed",this.redispatchEvent),this.removeEventListener("action-requested",this.redispatchEvent),this.removeEventListener("server-side-action-requested",this.redispatchEvent),this.removeEventListener("route-changed",this.redispatchEvent)}render(){return x$4`<slot></slot>`}};MateuEventInterceptor.styles=i$w`
24039
24040
  :host {
24040
24041
  /* width: 100%; */
24041
24042
  display: inline-block;
@@ -24109,7 +24110,7 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24109
24110
  <slot @slotchange=${this.handleSlotChange}></slot>
24110
24111
  </div>
24111
24112
  `}};MateuChart.styles=i$w`
24112
- `;__decorateClass$3([n$t()],MateuChart.prototype,"type",2);__decorateClass$3([n$t()],MateuChart.prototype,"data",2);__decorateClass$3([n$t()],MateuChart.prototype,"options",2);__decorateClass$3([e$m("#chart")],MateuChart.prototype,"chartElement",2);__decorateClass$3([o$r({slot:""})],MateuChart.prototype,"scriptElements",2);MateuChart=__decorateClass$3([t$o("mateu-chart")],MateuChart);var RuleAction=(te=>(te.SetAppDataValue="SetAppDataValue",te.SetAppStateValue="SetAppStateValue",te.SetDataValue="SetDataValue",te.RunAction="RunAction",te.RunJS="RunJS",te.SetAttributeValue="SetAttributeValue",te.SetStateValue="SetStateValue",te.SetCssClass="SetCssClass",te.SetStyle="SetStyle",te))(RuleAction||{}),RuleFieldAttribute=(te=>(te.required="required",te.disabled="disabled",te.hidden="hidden",te.pattern="pattern",te.minValue="minValue",te.maxValue="maxValue",te.minLength="minLength",te.maxLength="maxLength",te.css="css",te.style="style",te.theme="theme",te.errorMessage="errorMessage",te.description="description",te.none="none",te))(RuleFieldAttribute||{}),RuleResult=(te=>(te.Continue="Continue",te.Stop="Stop",te))(RuleResult||{}),__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$2(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$2(Q,X,ie),ie};let MateuComponent=class extends ComponentElement{constructor(){super(...arguments),this.baseUrl="",this.route="",this.consumedRoute="",this.applyRules=()=>{const rules=this.component.rules;if(rules){this.state,this.data,this.appState,this.appData;const newState={...this.state},newData={...this.data};let stateUpdated=!1,dataUpdated=!1;for(let ruleIndex=0;ruleIndex<rules.length;ruleIndex++){const rule=rules[ruleIndex];try{if(eval(rule.filter)){if(RuleAction.SetStateValue==rule.action||RuleAction.SetDataValue==rule.action){const target=RuleAction.SetStateValue==rule.action?newState:newData,fieldNames=rule.fieldName.split(",");for(let fieldIndex=0;fieldIndex<fieldNames.length;fieldIndex++){const fieldName=fieldNames[fieldIndex];if(!target[fieldName]||target[fieldName]!=rule.value){const value=rule.expression?eval(eval("`"+rule.expression+"`")):rule.value,propertyName=RuleFieldAttribute.none==rule.fieldAttribute?fieldName:fieldName+"."+rule.fieldAttribute;value!=target[propertyName]&&(target[propertyName]=value,RuleAction.SetStateValue==rule.action&&(stateUpdated=!0),RuleAction.SetDataValue==rule.action&&(dataUpdated=!0))}}}if(RuleAction.RunAction==rule.action&&this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:rule.actionId},bubbles:!0,composed:!0})),RuleAction.RunJS==rule.action&&eval(rule.value),RuleAction.SetAttributeValue==rule.action&&this.shadowRoot?.getElementById(rule.fieldName)?.setAttribute(rule.fieldAttribute,rule.value),RuleAction.SetCssClass==rule.action&&this.shadowRoot?.getElementById(rule.fieldName)?.setAttribute("class",rule.value),RuleAction.SetStyle==rule.action&&this.shadowRoot?.getElementById(rule.fieldName)?.style.setProperty(rule.expression,rule.value),RuleResult.Stop==rule.result)break}}catch(te){console.log("rule failed",rule,te)}}stateUpdated&&(this.state=newState),dataUpdated&&(this.data=newData)}},this.checkValidations=()=>{const validatons=this.component.validations;let valid=!0,dataUpdated=!1;const data=this.data??{},newData={...this.data??{},errors:{}};if(validatons){const state=this.state;for(let te=0;te<validatons.length;te++){const X=(validatons[te].fieldId??"_component").split(",");for(let ee=0;ee<X.length;ee++){const ie=X[ee];newData.errors[ie]=[]}}for(let validationIndex=0;validationIndex<validatons.length;validationIndex++){const validation=validatons[validationIndex];try{const failed=validation.condition&&!eval(validation.condition);if(console.log("validating",validation,!eval(validation.condition),state),failed){valid=!1;const fieldNames=(validation.fieldId??"_component").split(",");for(let fieldIndex=0;fieldIndex<fieldNames.length;fieldIndex++){const fieldName=fieldNames[fieldIndex];let errors=newData.errors[fieldName];if(errors||(newData.errors[fieldName]=[]),errors=newData.errors[fieldName],!data[fieldName]){let message=validation.message;try{message=eval(validation.message)}catch(te){}errors.push(message)}}}}catch(te){console.error("validation failed",validation,te)}}for(let te=0;te<validatons.length;te++){const X=(validatons[te].fieldId??"_component").split(",");for(let ee=0;ee<X.length;ee++){const ie=X[ee];if(data.errors?[ie].join(","):newData.errors==""&&[ie].join(",")){dataUpdated=!0;break}}}(data.errors?["_component"].join(","):newData.errors==""&&["_component"].join(","))&&(dataUpdated=!0)}newData._valid=valid,newData._valid!=data._valid&&(dataUpdated=!0),dataUpdated&&(this.data=newData)},this.onChange=()=>{this.applyRules(),this.checkValidations()},this.valueChangedListener=e=>{if(e.preventDefault(),e.stopPropagation(),e instanceof CustomEvent){const detail=e.detail;if(e.type=="value-changed"){const newState={...this.state};newState[detail.fieldId]=detail.value,this.state=newState;const serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnValueChange).filter(te=>!te.propertyName||detail.fieldId==te.propertyName).forEach(trigger=>{(!trigger.condition||eval(trigger.condition))&&this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId},bubbles:!0,composed:!0}))})}}},this.actionRequestedListener=te=>{te.preventDefault(),te.stopPropagation(),te instanceof CustomEvent&&this.manageActionRequestedEvent(te)},this.manageActionRequestedEvent=te=>{const Q=te.detail;if(te.type=="action-requested"){te.preventDefault(),te.stopPropagation();const X=this.component,ee=X.actions?.find(ie=>ie.id==Q.actionId);if(ee&&ee.rowsSelectedRequired&&(!this.state.crud_selected_items||this.state.crud_selected_items.length==0)){this.notify("You first need to select some rows");return}if(ee&&ee.validationRequired&&(this.checkValidations(),!this.data._valid)){console.log("data",this.data),this.notify("There are validation errors");return}ee&&ee.confirmationRequired?this.callAfterConfirmation(ee,()=>this.requestActionCallToServer(Q,X,ee)):this.requestActionCallToServer(Q,X,ee)}},this.notify=te=>{Notification.show(te,{position:"bottom-end",theme:"error",duration:3e3})},this.callAfterConfirmation=(te,Q)=>{let X="One moment, please",ee="Are you sure?",ie="Yes",oe="No";te.confirmationTexts&&(X=te.confirmationTexts.title,ee=te.confirmationTexts.message,ie=te.confirmationTexts.confirmationText,oe=te.confirmationTexts.denialText);const ne=document.createElement("vaadin-confirm-dialog");ne.setAttribute("header",X),ne.setAttribute("cancel-button-visible","cancel-button-visible"),ne.setAttribute("confirm-text",ie),ne.setAttribute("cancel-text",oe),ne.append(ee),ne.opened=!0,ne.addEventListener("confirm",()=>Q()),ne.addEventListener("close",()=>document.body.removeChild(ne)),ne.addEventListener("confirm",()=>document.body.removeChild(ne)),ne.addEventListener("cancel",()=>document.body.removeChild(ne)),ne.addEventListener("reject",()=>document.body.removeChild(ne)),document.body.append(ne)},this.requestActionCallToServer=(detail,serverSideComponent,action)=>{if(action&&action.href){window.location.href=action.href;return}if(action&&action.js){const data=this.data,state=this.state,component=this.component;try{eval(action.js),this.state={...this.state},this.data={...this.data}}catch(te){console.error("when evaluating "+action.js,te,component,state,data)}return}if(action&&action.customEvent){this.dispatchEvent(new CustomEvent(action.customEvent.name,{detail:action.customEvent.detail,bubbles:!0,composed:!0}));return}detail.actionId=="search"&&(this.state.size||(this.state.size=10,this.state.page=0,this.state.sort=[]),this.state.page==0&&(this.data={...this.data,crud:{}})),this.dispatchEvent(new CustomEvent("server-side-action-requested",{detail:{route:this.route,consumedRoute:this.consumedRoute,componentState:{...this.state},parameters:detail.parameters,actionId:detail.actionId,serverSideType:serverSideComponent.serverSideType,initiatorComponentId:detail.initiatorComponentId??serverSideComponent.id,initiator:this,background:action?.background,sse:action?.sse,callback:detail.callback},bubbles:!0,composed:!0}))},this.handleBackendSucceeded=e=>{const customEvent=e;if(customEvent.detail.actionId){const serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnSuccess).filter(te=>e.detail.actionId==te.calledActionId).forEach(trigger=>{(!trigger.condition||eval(trigger.condition))&&(e.preventDefault(),e.stopPropagation(),this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId},bubbles:!0,composed:!0})))})}},this.handleBackendFailed=e=>{const customEvent=e;if(customEvent.detail.actionId){const serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnError).filter(te=>e.detail.actionId==te.calledActionId).forEach(trigger=>{(!trigger.condition||eval(trigger.condition))&&(e.preventDefault(),e.stopPropagation(),this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId},bubbles:!0,composed:!0})))})}}}createRenderRoot(){return componentRenderer.mustUseShadowRoot()?super.createRenderRoot():this}updated(te){super.updated(te),te.has("state")&&this.state&&JSON.stringify(this.state)!=JSON.stringify({})&&this.onChange(),te.has("component")&&setTimeout(()=>this.triggerOnLoad())}connectedCallback(){super.connectedCallback(),this.addEventListener("backend-call-succeeded",this.handleBackendSucceeded),this.addEventListener("backend-call-failed",this.handleBackendFailed)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("backend-call-succeeded",this.handleBackendSucceeded),this.removeEventListener("backend-call-failed",this.handleBackendFailed)}render(){return x$4`<div>
24113
+ `;__decorateClass$3([n$t()],MateuChart.prototype,"type",2);__decorateClass$3([n$t()],MateuChart.prototype,"data",2);__decorateClass$3([n$t()],MateuChart.prototype,"options",2);__decorateClass$3([e$m("#chart")],MateuChart.prototype,"chartElement",2);__decorateClass$3([o$r({slot:""})],MateuChart.prototype,"scriptElements",2);MateuChart=__decorateClass$3([t$o("mateu-chart")],MateuChart);var RuleAction=(te=>(te.SetAppDataValue="SetAppDataValue",te.SetAppStateValue="SetAppStateValue",te.SetDataValue="SetDataValue",te.RunAction="RunAction",te.RunJS="RunJS",te.SetAttributeValue="SetAttributeValue",te.SetStateValue="SetStateValue",te.SetCssClass="SetCssClass",te.SetStyle="SetStyle",te))(RuleAction||{}),RuleFieldAttribute=(te=>(te.required="required",te.disabled="disabled",te.hidden="hidden",te.pattern="pattern",te.minValue="minValue",te.maxValue="maxValue",te.minLength="minLength",te.maxLength="maxLength",te.css="css",te.style="style",te.theme="theme",te.errorMessage="errorMessage",te.description="description",te.none="none",te))(RuleFieldAttribute||{}),RuleResult=(te=>(te.Continue="Continue",te.Stop="Stop",te))(RuleResult||{}),__defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$2(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$2(Q,X,ie),ie};let MateuComponent=class extends ComponentElement{constructor(){super(...arguments),this.baseUrl="",this.route="",this.consumedRoute="",this.applyRules=()=>{const rules=this.component.rules;if(rules){this.state,this.data,this.appState,this.appData;const newState={...this.state},newData={...this.data};let stateUpdated=!1,dataUpdated=!1;for(let ruleIndex=0;ruleIndex<rules.length;ruleIndex++){const rule=rules[ruleIndex];try{if(eval(rule.filter)){if(RuleAction.SetStateValue==rule.action||RuleAction.SetDataValue==rule.action){const target=RuleAction.SetStateValue==rule.action?newState:newData,fieldNames=rule.fieldName.split(",");for(let fieldIndex=0;fieldIndex<fieldNames.length;fieldIndex++){const fieldName=fieldNames[fieldIndex];if(!target[fieldName]||target[fieldName]!=rule.value){const value=rule.expression?eval(eval("`"+rule.expression+"`")):rule.value,propertyName=RuleFieldAttribute.none==rule.fieldAttribute?fieldName:fieldName+"."+rule.fieldAttribute;value!=target[propertyName]&&(target[propertyName]=value,RuleAction.SetStateValue==rule.action&&(stateUpdated=!0),RuleAction.SetDataValue==rule.action&&(dataUpdated=!0))}}}if(RuleAction.RunAction==rule.action&&this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:rule.actionId},bubbles:!0,composed:!0})),RuleAction.RunJS==rule.action&&eval(rule.value),RuleAction.SetAttributeValue==rule.action&&this.shadowRoot?.getElementById(rule.fieldName)?.setAttribute(rule.fieldAttribute,rule.value),RuleAction.SetCssClass==rule.action&&this.shadowRoot?.getElementById(rule.fieldName)?.setAttribute("class",rule.value),RuleAction.SetStyle==rule.action&&this.shadowRoot?.getElementById(rule.fieldName)?.style.setProperty(rule.expression,rule.value),RuleResult.Stop==rule.result)break}}catch(te){console.log("rule failed",rule,te)}}stateUpdated&&(this.state=newState),dataUpdated&&(this.data=newData)}},this.checkValidations=()=>{const validatons=this.component.validations;let valid=!0,dataUpdated=!1;const data=this.data??{},newData={...this.data??{},errors:{}};if(validatons){const state=this.state;for(let te=0;te<validatons.length;te++){const X=(validatons[te].fieldId??"_component").split(",");for(let ee=0;ee<X.length;ee++){const ie=X[ee];newData.errors[ie]=[]}}for(let validationIndex=0;validationIndex<validatons.length;validationIndex++){const validation=validatons[validationIndex];try{const failed=validation.condition&&!eval(validation.condition);if(console.log("validating",validation,!eval(validation.condition),state),failed){valid=!1;const fieldNames=(validation.fieldId??"_component").split(",");for(let fieldIndex=0;fieldIndex<fieldNames.length;fieldIndex++){const fieldName=fieldNames[fieldIndex];let errors=newData.errors[fieldName];if(errors||(newData.errors[fieldName]=[]),errors=newData.errors[fieldName],!data[fieldName]){let message=validation.message;try{message=eval(validation.message)}catch(te){}errors.push(message)}}}}catch(te){console.error("validation failed",validation,te)}}for(let te=0;te<validatons.length;te++){const X=(validatons[te].fieldId??"_component").split(",");for(let ee=0;ee<X.length;ee++){const ie=X[ee];if(data.errors?[ie].join(","):newData.errors==""&&[ie].join(",")){dataUpdated=!0;break}}}(data.errors?["_component"].join(","):newData.errors==""&&["_component"].join(","))&&(dataUpdated=!0)}newData._valid=valid,newData._valid!=data._valid&&(dataUpdated=!0),dataUpdated&&(this.data=newData)},this.onChange=()=>{this.applyRules(),this.checkValidations()},this.valueChangedListener=e=>{if(e.preventDefault(),e.stopPropagation(),e instanceof CustomEvent){const detail=e.detail;if(e.type=="value-changed"){const newState={...this.state};newState[detail.fieldId]=detail.value,this.state=newState;const serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnValueChange).filter(te=>!te.propertyName||detail.fieldId==te.propertyName).forEach(trigger=>{(!trigger.condition||eval(trigger.condition))&&this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId},bubbles:!0,composed:!0}))})}}},this.actionRequestedListener=te=>{te.preventDefault(),te.stopPropagation(),te instanceof CustomEvent&&this.manageActionRequestedEvent(te)},this.manageActionRequestedEvent=te=>{const Q=te.detail;if(te.type=="action-requested"){te.preventDefault(),te.stopPropagation();const X=this.component,ee=X.actions?.find(ie=>ie.id==Q.actionId);if(ee&&ee.rowsSelectedRequired&&(!this.state.crud_selected_items||this.state.crud_selected_items.length==0)){this.notify("You first need to select some rows");return}if(ee&&ee.validationRequired&&(this.checkValidations(),!this.data._valid)){console.log("data",this.data),this.notify("There are validation errors");return}ee&&ee.confirmationRequired?this.callAfterConfirmation(ee,()=>this.requestActionCallToServer(Q,X,ee)):this.requestActionCallToServer(Q,X,ee)}},this.notify=te=>{Notification.show(te,{position:"bottom-end",theme:"error",duration:3e3})},this.callAfterConfirmation=(te,Q)=>{let X="One moment, please",ee="Are you sure?",ie="Yes",oe="No";te.confirmationTexts&&(X=te.confirmationTexts.title,ee=te.confirmationTexts.message,ie=te.confirmationTexts.confirmationText,oe=te.confirmationTexts.denialText);const ne=document.createElement("vaadin-confirm-dialog");ne.setAttribute("header",X),ne.setAttribute("cancel-button-visible","cancel-button-visible"),ne.setAttribute("confirm-text",ie),ne.setAttribute("cancel-text",oe),ne.append(ee),ne.opened=!0,ne.addEventListener("confirm",()=>Q()),ne.addEventListener("close",()=>document.body.removeChild(ne)),ne.addEventListener("confirm",()=>document.body.removeChild(ne)),ne.addEventListener("cancel",()=>document.body.removeChild(ne)),ne.addEventListener("reject",()=>document.body.removeChild(ne)),document.body.append(ne)},this.requestActionCallToServer=(detail,serverSideComponent,action)=>{if(action&&action.href){window.location.href=action.href;return}if(action&&action.js){const data=this.data,state=this.state,component=this.component;try{eval(action.js),this.state={...this.state},this.data={...this.data}}catch(te){console.error("when evaluating "+action.js,te,component,state,data)}}action&&action.customEvent&&(console.log("custom event",action.customEvent),this.dispatchEvent(new CustomEvent(action.customEvent.name,{detail:action.customEvent.detail,bubbles:!0,composed:!0}))),!(action&&(action.js||action.customEvent))&&(detail.actionId=="search"&&(this.state.size||(this.state.size=10,this.state.page=0,this.state.sort=[]),this.state.page==0&&(this.data={...this.data,crud:{}})),this.dispatchEvent(new CustomEvent("server-side-action-requested",{detail:{route:this.route,consumedRoute:this.consumedRoute,componentState:{...this.state},parameters:detail.parameters,actionId:detail.actionId,serverSideType:serverSideComponent.serverSideType,initiatorComponentId:detail.initiatorComponentId??serverSideComponent.id,initiator:this,background:action?.background,sse:action?.sse,callback:detail.callback},bubbles:!0,composed:!0})))},this.handleBackendSucceeded=e=>{const customEvent=e;if(customEvent.detail.actionId){const serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnSuccess).filter(te=>e.detail.actionId==te.calledActionId).forEach(trigger=>{(!trigger.condition||eval(trigger.condition))&&(e.preventDefault(),e.stopPropagation(),this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId},bubbles:!0,composed:!0})))})}},this.handleBackendFailed=e=>{const customEvent=e;if(console.log("backend failed",customEvent),customEvent.detail.actionId){const serverSideComponent=this.component;serverSideComponent.triggers?.filter(te=>te.type==TriggerType.OnError).filter(te=>e.detail.actionId==te.calledActionId).forEach(trigger=>{(!trigger.condition||eval(trigger.condition))&&(e.preventDefault(),e.stopPropagation(),this.manageActionRequestedEvent(new CustomEvent("action-requested",{detail:{actionId:trigger.actionId},bubbles:!0,composed:!0})))})}}}createRenderRoot(){return componentRenderer.mustUseShadowRoot()?super.createRenderRoot():this}updated(te){super.updated(te),te.has("state")&&this.state&&JSON.stringify(this.state)!=JSON.stringify({})&&this.onChange(),te.has("component")&&setTimeout(()=>this.triggerOnLoad())}connectedCallback(){super.connectedCallback(),this.addEventListener("backend-call-succeeded",this.handleBackendSucceeded),this.addEventListener("backend-call-failed",this.handleBackendFailed)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("backend-call-succeeded",this.handleBackendSucceeded),this.removeEventListener("backend-call-failed",this.handleBackendFailed)}render(){return x$4`<div>
24113
24114
  <div>${this._render()}</div>
24114
24115
  ${this.data&&this.data.errors&&this.data.errors._component&&this.data.errors._component.length>0?x$4`
24115
24116
  <div><ul>${this.data.errors._component.map(te=>x$4`<li>${te}</li>`)}</ul></div>
@@ -24127,7 +24128,7 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24127
24128
  grid-column: 3;
24128
24129
  }
24129
24130
 
24130
- `;__decorateClass$2([n$t()],MateuComponent.prototype,"baseUrl",2);__decorateClass$2([n$t()],MateuComponent.prototype,"route",2);__decorateClass$2([n$t()],MateuComponent.prototype,"consumedRoute",2);MateuComponent=__decorateClass$2([t$o("mateu-component")],MateuComponent);const parseOverrides=te=>{if(te)try{return JSON.parse(te)}catch{return{value:te}}else return{}};class RunActionCommandHandler{async handle(Q,X){return await Q.runAction(X.baseUrl,X.route,X.consumedRoute,X.actionId,X.initiatorComponentId,X.appState,X.serverSideType,X.appServerSideType,X.componentState,X.parameters,X.initiator,X.background)}}const runActionCommandHandler=new RunActionCommandHandler;class HttpService{constructor(){this.mapPosition=Q=>{switch(Q){case"topStretch":return"top-stretch";case"topStart":return"top-start";case"topCenter":return"top-center";case"topEnd":return"top-end";case"middle":return"middle";case"bottomStart":return"bottom-start";case"bottomEnd":return"bottom-end";case"bottomStretch":return"bottom-stretch";case"bottomCenter":return"bottom-center"}return"bottom-end"},this.handleUIIncrement=(Q,X)=>{if(Q?.fragments?.forEach(ee=>{upstream.next({command:void 0,fragment:ee,ui:void 0,error:void 0})}),Q?.appState&&(appState.value={...Q.appState},X.dispatchEvent(new CustomEvent("app-data-updated",{bubbles:!0,composed:!0}))),Q?.appData){const ee=Q?.appData;appData.value={...Q.appData,...ee},X.dispatchEvent(new CustomEvent("app-data-updated",{bubbles:!0,composed:!0}))}Q?.messages?.forEach(ee=>{Notification.show(ee.text,{position:ee.position?this.mapPosition(ee.position):void 0,theme:ee.variant,duration:ee.duration})}),Q?.commands?.forEach(ee=>{upstream.next({command:ee,fragment:void 0,ui:void 0,error:void 0})})}}async runAction(Q,X,ee,ie,oe,ne,ae,se,le,de,ce,he,ue,pe){try{const fe=await runActionCommandHandler.handle(Q,{baseUrl:X,route:ee,consumedRoute:ie,actionId:oe,appState:appState.value,initiatorComponentId:ne,componentState:de,parameters:ce,serverSideType:se,appServerSideType:le,initiator:he,background:ue});this.handleUIIncrement(fe,he),pe&&pe(),he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-succeeded",{detail:{actionId:oe},bubbles:!0,composed:!0}))}catch(fe){he.dispatchEvent(new CustomEvent("backend-failed-event",{bubbles:!0,composed:!0,detail:{actionId:oe,reason:this.serialize(fe)}})),he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-failed",{detail:{actionId:oe},bubbles:!0,composed:!0}))}}serialize(Q){return Q.message?Q:JSON.stringify(Q)}}const httpService=new HttpService,service=httpService;class SSEService{constructor(){this.mapPosition=Q=>{switch(Q){case"topStretch":return"top-stretch";case"topStart":return"top-start";case"topCenter":return"top-center";case"topEnd":return"top-end";case"middle":return"middle";case"bottomStart":return"bottom-start";case"bottomEnd":return"bottom-end";case"bottomStretch":return"bottom-stretch";case"bottomCenter":return"bottom-center"}return"bottom-end"},this.handleUIIncrement=(Q,X)=>{if(console.log("increment",Q),Q?.messages?.forEach(ee=>{Notification.show(ee.text,{position:ee.position?this.mapPosition(ee.position):"bottom-end",theme:ee.variant,duration:ee.duration})}),Q?.commands?.forEach(ee=>{upstream.next({command:ee,fragment:void 0,ui:void 0,error:void 0})}),Q?.fragments?.forEach(ee=>{upstream.next({command:void 0,fragment:ee,ui:void 0,error:void 0})}),Q?.appState&&(appState.value={...Q.appState},X.dispatchEvent(new CustomEvent("app-data-updated",{bubbles:!0,composed:!0}))),Q?.appData){const ee=Q?.appData;appData.value={...Q.appData,...ee},X.dispatchEvent(new CustomEvent("app-data-updated",{bubbles:!0,composed:!0}))}}}async runAction(Q,X,ee,ie,oe,ne,ae,se,le,de,ce,he,ue,pe){if(!ee){console.log("no route");return}{ee=ee||"_no_route",ee&&ee.startsWith("/")&&(ee=ee.substring(1));const fe={serverSideType:se,appState:appState.value,componentState:de,parameters:ce,initiatorComponentId:ne,consumedRoute:ie,route:"/"+ee,actionId:oe};ue||he.dispatchEvent(new CustomEvent("backend-called-event",{bubbles:!0,composed:!0,detail:{}})),fetch(X+"/mateu/v3/sse/"+ee+(oe?"/"+oe:""),{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(fe)}).then(async ve=>{const me=ve.body?.pipeThrough(new TextDecoderStream).getReader();if(me)for(;;){const{value:ge,done:_e}=await me.read();if(_e)break;if(ge.startsWith("data:")){const be=JSON.parse(ge.substring(5));this.handleUIIncrement(be,he)}else{let be=ge;try{const ye=JSON.parse(ge);be=ye.message,ye._embedded?.errors?.length>0&&ye._embedded.errors[0].message&&(be=ye._embedded.errors[0].message)}catch{}throw new Error(be)}}ue||he.dispatchEvent(new CustomEvent("backend-succeeded-event",{bubbles:!0,composed:!0,detail:{actionId:oe}})),he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-succeeded",{detail:{actionId:oe},bubbles:!0,composed:!0}))}).catch(ve=>{he.dispatchEvent(new CustomEvent("backend-failed-event",{bubbles:!0,composed:!0,detail:{actionId:oe,reason:this.serialize(ve)}})),he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-failed",{detail:{actionId:oe},bubbles:!0,composed:!0}))}),pe&&pe()}}serialize(Q){return Q.message?Q:JSON.stringify(Q)}}const sseService=new SSEService;var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$1(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$1(Q,X,ie),ie};let MateuUx=class extends ConnectedElement{constructor(){super(...arguments),this.consumedRoute="",this.appServerSideType=void 0,this.uriPrefix=void 0,this.overrides=void 0,this.homeRoute=void 0,this.route=void 0,this.top=void 0,this.preventNavigation=!1,this.overridesParsed={},this.fragment=void 0,this.actionRequestedListener=te=>{te instanceof CustomEvent&&(te.preventDefault(),te.stopPropagation(),this.manageActionEvent(te))},this.historyPushed=te=>{te instanceof CustomEvent&&(te.preventDefault(),te.stopPropagation())},this.navigateToRequestedListener=te=>{te instanceof CustomEvent&&(te.preventDefault(),te.stopPropagation(),this.route=te.detail.route,this.setAttribute("route",this.route??""),this.dispatchEvent(new CustomEvent("update-route",{detail:{route:te.detail.route},bubbles:!0,composed:!0})))},this.backendFailedListener=te=>{te.preventDefault(),te.stopPropagation(),te instanceof CustomEvent&&te.detail.actionId==""&&(this.fragment={targetComponentId:this.id,data:{},state:{},component:{type:ComponentType.ClientSide,metadata:{type:ComponentMetadataType.Element,name:"div",content:"Not found"},id:"fieldId"},action:UIFragmentAction.Replace})},this.detail1=void 0,this.manageActionEvent=te=>{te.preventDefault(),te.stopPropagation(),this.detail1=te.detail;const Q=this.detail1;if(te.type=="server-side-action-requested"){let X=service;Q.sse&&(X=sseService),X.runAction(mateuApiClient,this.baseUrl,Q.route??"",Q.consumedRoute,Q.actionId,Q.initiatorComponentId,this.getCustomisedAppState(),Q.serverSideType,Q.appServerSideType,Q.componentState,Q.parameters,Q.initiator,Q.background,Q.callback)}},this.getCustomisedAppState=()=>{let te={...appState.value};if(this.overrides){const Q=parseOverrides(this.overrides);te={...te,...Q}}return te}}manageActionRequestedEvent(te){throw console.log("manageActionRequestedEvent",te),new Error("Method not implemented.")}createRenderRoot(){return componentRenderer.mustUseShadowRoot()?super.createRenderRoot():this}connectedCallback(){super.connectedCallback(),this.overridesParsed=parseOverrides(this.overrides),this.addEventListener("server-side-action-requested",this.actionRequestedListener),this.addEventListener("backend-call-failed",this.backendFailedListener),this.addEventListener("navigate-to-requested",this.navigateToRequestedListener),this.addEventListener("history-pushed",this.historyPushed),window.Vaadin.featureFlags.masterDetailLayoutComponent=!0}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("server-side-action-requested",this.actionRequestedListener),this.removeEventListener("backend-call-failed",this.backendFailedListener),this.removeEventListener("navigate-to-requested",this.navigateToRequestedListener),this.removeEventListener("history-pushed",this.historyPushed)}updated(te){(te.has("id")||te.has("baseurl")||te.has("route")||te.has("consumedRoute")||te.has("instant"))&&(this.preventNavigation||this.manageActionEvent(new CustomEvent("server-side-action-requested",{detail:{route:this.route,consumedRoute:this.consumedRoute,userData:void 0,actionId:"",serverSideType:void 0,appServerSideType:this.appServerSideType,initiatorComponentId:this.id,initiator:this},bubbles:!0,composed:!0}))),te.has("route")&&this.top&&(this.preventNavigation||this.dispatchEvent(new CustomEvent("route-changed",{detail:{route:this.route},bubbles:!0,composed:!0}))),this.preventNavigation&&(this.preventNavigation=!1)}applyFragment(te){this.fragment=te}render(){return x$4`
24131
+ `;__decorateClass$2([n$t()],MateuComponent.prototype,"baseUrl",2);__decorateClass$2([n$t()],MateuComponent.prototype,"route",2);__decorateClass$2([n$t()],MateuComponent.prototype,"consumedRoute",2);MateuComponent=__decorateClass$2([t$o("mateu-component")],MateuComponent);const parseOverrides=te=>{if(te)try{return JSON.parse(te)}catch{return{value:te}}else return{}};class RunActionCommandHandler{async handle(Q,X){return await Q.runAction(X.baseUrl,X.route,X.consumedRoute,X.actionId,X.initiatorComponentId,X.appState,X.serverSideType,X.appServerSideType,X.componentState,X.parameters,X.initiator,X.background)}}const runActionCommandHandler=new RunActionCommandHandler;class HttpService{constructor(){this.mapPosition=Q=>{switch(Q){case"topStretch":return"top-stretch";case"topStart":return"top-start";case"topCenter":return"top-center";case"topEnd":return"top-end";case"middle":return"middle";case"bottomStart":return"bottom-start";case"bottomEnd":return"bottom-end";case"bottomStretch":return"bottom-stretch";case"bottomCenter":return"bottom-center"}return"bottom-end"},this.handleUIIncrement=(Q,X)=>{if(Q?.fragments?.forEach(ee=>{upstream.next({command:void 0,fragment:ee,ui:void 0,error:void 0})}),Q?.appState&&(appState.value={...Q.appState},X.dispatchEvent(new CustomEvent("app-data-updated",{bubbles:!0,composed:!0}))),Q?.appData){const ee=Q?.appData;appData.value={...Q.appData,...ee},X.dispatchEvent(new CustomEvent("app-data-updated",{bubbles:!0,composed:!0}))}Q?.messages?.forEach(ee=>{Notification.show(ee.text,{position:ee.position?this.mapPosition(ee.position):void 0,theme:ee.variant,duration:ee.duration})}),Q?.commands?.forEach(ee=>{upstream.next({command:ee,fragment:void 0,ui:void 0,error:void 0})})}}async runAction(Q,X,ee,ie,oe,ne,ae,se,le,de,ce,he,ue,pe){try{const fe=await runActionCommandHandler.handle(Q,{baseUrl:X,route:ee,consumedRoute:ie,actionId:oe,appState:appState.value,initiatorComponentId:ne,componentState:de,parameters:ce,serverSideType:se,appServerSideType:le,initiator:he,background:ue});this.handleUIIncrement(fe,he),pe&&pe(),fe.messages&&fe.messages.length==1&&fe.messages[0].variant=="error"&&he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-failed",{detail:{actionId:oe},bubbles:!0,composed:!0})),he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-succeeded",{detail:{actionId:oe},bubbles:!0,composed:!0}))}catch(fe){console.log("reason",fe),he.dispatchEvent(new CustomEvent("backend-failed-event",{bubbles:!0,composed:!0,detail:{actionId:oe,reason:this.serialize(fe)}})),he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-failed",{detail:{actionId:oe},bubbles:!0,composed:!0}))}}serialize(Q){return Q.message?Q:JSON.stringify(Q)}}const httpService=new HttpService,service=httpService;class SSEService{constructor(){this.mapPosition=Q=>{switch(Q){case"topStretch":return"top-stretch";case"topStart":return"top-start";case"topCenter":return"top-center";case"topEnd":return"top-end";case"middle":return"middle";case"bottomStart":return"bottom-start";case"bottomEnd":return"bottom-end";case"bottomStretch":return"bottom-stretch";case"bottomCenter":return"bottom-center"}return"bottom-end"},this.handleUIIncrement=(Q,X)=>{if(Q?.messages?.forEach(ee=>{Notification.show(ee.text,{position:ee.position?this.mapPosition(ee.position):"bottom-end",theme:ee.variant,duration:ee.duration})}),Q?.commands?.forEach(ee=>{upstream.next({command:ee,fragment:void 0,ui:void 0,error:void 0})}),Q?.fragments?.forEach(ee=>{upstream.next({command:void 0,fragment:ee,ui:void 0,error:void 0})}),Q?.appState&&(appState.value={...Q.appState},X.dispatchEvent(new CustomEvent("app-data-updated",{bubbles:!0,composed:!0}))),Q?.appData){const ee=Q?.appData;appData.value={...Q.appData,...ee},X.dispatchEvent(new CustomEvent("app-data-updated",{bubbles:!0,composed:!0}))}}}async runAction(Q,X,ee,ie,oe,ne,ae,se,le,de,ce,he,ue,pe){if(!ee){console.log("no route");return}{ee=ee||"_no_route",ee&&ee.startsWith("/")&&(ee=ee.substring(1));const fe={serverSideType:se,appState:appState.value,componentState:de,parameters:ce,initiatorComponentId:ne,consumedRoute:ie,route:"/"+ee,actionId:oe};ue||he.dispatchEvent(new CustomEvent("backend-called-event",{bubbles:!0,composed:!0,detail:{}})),fetch(X+"/mateu/v3/sse/"+ee+(oe?"/"+oe:""),{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(fe)}).then(async ve=>{const me=ve.body?.pipeThrough(new TextDecoderStream).getReader();if(me)for(;;){const{value:ge,done:_e}=await me.read();if(_e)break;if(ge.startsWith("data:")){const be=JSON.parse(ge.substring(5));this.handleUIIncrement(be,he),be.messages&&be.messages.length==1&&be.messages[0].variant=="error"&&he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-failed",{detail:{actionId:oe},bubbles:!0,composed:!0}))}else{let be=ge;try{const ye=JSON.parse(ge);be=ye.message,ye._embedded?.errors?.length>0&&ye._embedded.errors[0].message&&(be=ye._embedded.errors[0].message)}catch{}throw new Error(be)}}ue||he.dispatchEvent(new CustomEvent("backend-succeeded-event",{bubbles:!0,composed:!0,detail:{actionId:oe}})),he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-succeeded",{detail:{actionId:oe},bubbles:!0,composed:!0}))}).catch(ve=>{he.dispatchEvent(new CustomEvent("backend-failed-event",{bubbles:!0,composed:!0,detail:{actionId:oe,reason:this.serialize(ve)}})),he.shadowRoot?.dispatchEvent(new CustomEvent("backend-call-failed",{detail:{actionId:oe},bubbles:!0,composed:!0}))}),pe&&pe()}}serialize(Q){return Q.message?Q:JSON.stringify(Q)}}const sseService=new SSEService;var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc$1(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp$1(Q,X,ie),ie};let MateuUx=class extends ConnectedElement{constructor(){super(...arguments),this.consumedRoute="",this.appServerSideType=void 0,this.uriPrefix=void 0,this.overrides=void 0,this.homeRoute=void 0,this.route=void 0,this.top=void 0,this.preventNavigation=!1,this.overridesParsed={},this.fragment=void 0,this.actionRequestedListener=te=>{te instanceof CustomEvent&&(te.preventDefault(),te.stopPropagation(),this.manageActionEvent(te))},this.historyPushed=te=>{te instanceof CustomEvent&&(te.preventDefault(),te.stopPropagation())},this.routeChangedListener=te=>{if(te instanceof CustomEvent){te.preventDefault(),te.stopPropagation();let Q=te.detail.route;this.uriPrefix&&(Q.startsWith("/")&&this.uriPrefix.endsWith("/")?Q=this.uriPrefix+Q.substring(1):!Q.startsWith("/")&&!this.uriPrefix.endsWith("/")?Q=this.uriPrefix+"/"+Q:Q=this.uriPrefix+Q),this.dispatchEvent(new CustomEvent("url-update-requested",{detail:{route:Q},bubbles:!0,composed:!0}))}},this.backendFailedListener=te=>{te.preventDefault(),te.stopPropagation(),te instanceof CustomEvent&&te.detail.actionId==""&&(this.fragment={targetComponentId:this.id,data:{},state:{},component:{type:ComponentType.ClientSide,metadata:{type:ComponentMetadataType.Element,name:"div",content:"Not found"},id:"fieldId"},action:UIFragmentAction.Replace})},this.detail1=void 0,this.manageActionEvent=te=>{te.preventDefault(),te.stopPropagation(),this.detail1=te.detail;const Q=this.detail1;if(te.type=="server-side-action-requested"){let X=service;Q.sse&&(X=sseService),X.runAction(mateuApiClient,this.baseUrl,Q.route??"",Q.consumedRoute,Q.actionId,Q.initiatorComponentId,this.getCustomisedAppState(),Q.serverSideType,Q.appServerSideType,Q.componentState,Q.parameters,Q.initiator,Q.background,Q.callback)}},this.getCustomisedAppState=()=>{let te={...appState.value};if(this.overrides){const Q=parseOverrides(this.overrides);te={...te,...Q}}return te}}manageActionRequestedEvent(te){throw console.log("manageActionRequestedEvent",te),new Error("Method not implemented.")}createRenderRoot(){return componentRenderer.mustUseShadowRoot()?super.createRenderRoot():this}connectedCallback(){super.connectedCallback(),this.overridesParsed=parseOverrides(this.overrides),this.addEventListener("server-side-action-requested",this.actionRequestedListener),this.addEventListener("backend-call-failed",this.backendFailedListener),this.addEventListener("history-pushed",this.historyPushed),this.addEventListener("route-changed",this.routeChangedListener),window.Vaadin.featureFlags.masterDetailLayoutComponent=!0}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("server-side-action-requested",this.actionRequestedListener),this.removeEventListener("backend-call-failed",this.backendFailedListener),this.removeEventListener("history-pushed",this.historyPushed),this.removeEventListener("route-changed",this.routeChangedListener)}updated(te){(te.has("id")||te.has("baseurl")||te.has("route")||te.has("consumedRoute")||te.has("instant"))&&(this.preventNavigation||this.manageActionEvent(new CustomEvent("server-side-action-requested",{detail:{route:this.route,consumedRoute:this.consumedRoute,userData:void 0,actionId:"",serverSideType:void 0,appServerSideType:this.appServerSideType,initiatorComponentId:this.id,initiator:this},bubbles:!0,composed:!0}))),te.has("route")&&this.top&&(this.preventNavigation||this.dispatchEvent(new CustomEvent("route-changed",{detail:{route:this.route},bubbles:!0,composed:!0}))),this.preventNavigation&&(this.preventNavigation=!1)}applyFragment(te){this.fragment=te}render(){return x$4`
24131
24132
  ${this.fragment?.component?renderComponent(this,this.fragment?.component,this.baseUrl,this.fragment?.state??{},this.fragment?.data??{},this.appState,this.appData):E$5}
24132
24133
  `}};MateuUx.styles=i$w`
24133
24134
  :host {
@@ -24139,14 +24140,14 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24139
24140
  max-width: 1392px;
24140
24141
  margin: 0 auto;
24141
24142
  }
24142
- `;__decorateClass$1([n$t()],MateuUx.prototype,"consumedRoute",2);__decorateClass$1([n$t()],MateuUx.prototype,"appServerSideType",2);__decorateClass$1([n$t()],MateuUx.prototype,"uriPrefix",2);__decorateClass$1([n$t()],MateuUx.prototype,"overrides",2);__decorateClass$1([n$t()],MateuUx.prototype,"homeRoute",2);__decorateClass$1([n$t()],MateuUx.prototype,"route",2);__decorateClass$1([n$t()],MateuUx.prototype,"top",2);__decorateClass$1([n$t()],MateuUx.prototype,"instant",2);__decorateClass$1([n$t()],MateuUx.prototype,"appState",2);__decorateClass$1([n$t()],MateuUx.prototype,"appData",2);__decorateClass$1([r$o()],MateuUx.prototype,"fragment",2);MateuUx=__decorateClass$1([t$o("mateu-ux")],MateuUx);var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp(Q,X,ie),ie};let MateuUi=class extends i$s{constructor(){super(...arguments),this.baseUrl="",this.route=void 0,this.config=void 0,this.routeChangedListener=te=>{if(te.preventDefault(),te.stopPropagation(),te instanceof CustomEvent){let Q=te.detail.route,X=this.baseUrl??"";X.indexOf("://")<0&&(X.startsWith("/")||(X="/"+X),X=window.location.origin+X),X.endsWith("/")&&Q.startsWith("/")&&(Q=Q.substring(1));let ee=new URL(X+Q);if(window.location.pathname!=ee.pathname){let ie=ee.pathname;ie&&!ie.startsWith("/")&&(ie="/"+ie),window.history.pushState({},"",ie)}}}}createRenderRoot(){return componentRenderer.mustUseShadowRoot()?super.createRenderRoot():this}connectedCallback(){super.connectedCallback(),window.onpopstate=te=>{const Q=te.target;this.loadUrl(Q)},this.loadUrl(window),this.addEventListener("route-changed",this.routeChangedListener)}disconnectedCallback(){super.disconnectedCallback(),this.upstreamSubscription?.unsubscribe(),this.removeEventListener("route-changed",this.routeChangedListener)}loadUrl(te){if(this.route=this.extractRouteFromUrl(te),this.setAttribute("route",this.route),this.instant=nanoid(),te.location.search){const X=new URLSearchParams(te.location.search).get("overrides");X&&(this.config=X)}}extractRouteFromUrl(te){const Q=this.extractGrossRouteFromUrl(te);return Q=="/"?"":Q}extractGrossRouteFromUrl(te){const Q=te.location.pathname,X=this.baseUrl&&(this.baseUrl.startsWith("http://")||this.baseUrl.startsWith("https://"))?this.baseUrl.substring(this.getContextPathStartingIndex(this.baseUrl)):this.baseUrl;return Q.startsWith(X)?Q.substring(X.length):Q}getContextPathStartingIndex(te){return te.startsWith("http:")?te.indexOf("/",7):te.startsWith("https:")?te.indexOf("/",8):0}render(){return x$4`
24143
+ `;__decorateClass$1([n$t()],MateuUx.prototype,"consumedRoute",2);__decorateClass$1([n$t()],MateuUx.prototype,"appServerSideType",2);__decorateClass$1([n$t()],MateuUx.prototype,"uriPrefix",2);__decorateClass$1([n$t()],MateuUx.prototype,"overrides",2);__decorateClass$1([n$t()],MateuUx.prototype,"homeRoute",2);__decorateClass$1([n$t()],MateuUx.prototype,"route",2);__decorateClass$1([n$t()],MateuUx.prototype,"top",2);__decorateClass$1([n$t()],MateuUx.prototype,"instant",2);__decorateClass$1([n$t()],MateuUx.prototype,"appState",2);__decorateClass$1([n$t()],MateuUx.prototype,"appData",2);__decorateClass$1([r$o()],MateuUx.prototype,"fragment",2);MateuUx=__decorateClass$1([t$o("mateu-ux")],MateuUx);var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=(te,Q,X,ee)=>{for(var ie=ee>1?void 0:ee?__getOwnPropDesc(Q,X):Q,oe=te.length-1,ne;oe>=0;oe--)(ne=te[oe])&&(ie=(ee?ne(Q,X,ie):ne(ie))||ie);return ee&&ie&&__defProp(Q,X,ie),ie};let MateuUi=class extends i$s{constructor(){super(...arguments),this.baseUrl="",this.route=void 0,this.consumedRoute="_empty",this.config=void 0,this.top="true",this.routeChangedListener=te=>{if(te.preventDefault(),te.stopPropagation(),te instanceof CustomEvent&&this.top=="true"){let Q=te.detail.route,X=this.baseUrl??"";X.indexOf("://")<0&&(X.startsWith("/")||(X="/"+X),X=window.location.origin+X),X.endsWith("/")&&Q.startsWith("/")&&(Q=Q.substring(1));let ee=new URL(X+Q);if((window.location.pathname||ee.pathname)&&window.location.pathname!=ee.pathname){let ie=ee.pathname;ie&&!ie.startsWith("/")&&(ie="/"+ie),window.history.pushState({},"",ie)}}},this.navigateToRequestedListener=te=>{if(te.preventDefault(),te.stopPropagation(),te instanceof CustomEvent){let Q=te.detail.route;const X=this.shadowRoot?.querySelector("mateu-ux");X&&(X.setAttribute("route",Q),X.setAttribute("instant",nanoid()))}}}createRenderRoot(){return componentRenderer.mustUseShadowRoot()?super.createRenderRoot():this}connectedCallback(){if(super.connectedCallback(),window.onpopstate=te=>{const Q=te.target;this.loadUrl(Q)},this.route?this.consumedRoute="":this.loadUrl(window),this.config)try{const te=JSON.parse(this.config);appState.value={...appState.value,...te}}catch{appState.value={...appState.value,config:this.config}}this.addEventListener("url-update-requested",this.routeChangedListener),this.addEventListener("navigate-to-requested",this.navigateToRequestedListener)}disconnectedCallback(){super.disconnectedCallback(),this.upstreamSubscription?.unsubscribe(),this.removeEventListener("url-update-requested",this.routeChangedListener),this.removeEventListener("navigate-to-requested",this.navigateToRequestedListener)}loadUrl(te){if(this.route=this.extractRouteFromUrl(te),this.setAttribute("route",this.route),this.instant=nanoid(),te.location.search){const X=new URLSearchParams(te.location.search).get("overrides");if(X&&(this.config=X,this.config))try{const ee=JSON.parse(this.config);appState.value={...appState.value,...ee}}catch{appState.value={...appState.value,config:this.config}}}}extractRouteFromUrl(te){const Q=this.extractGrossRouteFromUrl(te);return Q=="/"?"":Q}extractGrossRouteFromUrl(te){const Q=te.location.pathname,X=this.baseUrl&&(this.baseUrl.startsWith("http://")||this.baseUrl.startsWith("https://"))?this.baseUrl.substring(this.getContextPathStartingIndex(this.baseUrl)):this.baseUrl;return Q.startsWith(X)?Q.substring(X.length):Q}getContextPathStartingIndex(te){return te.startsWith("http:")?te.indexOf("/",7):te.startsWith("https:")?te.indexOf("/",8):0}render(){return x$4`
24143
24144
  <mateu-api-caller>
24144
24145
  <mateu-ux id="_ux"
24145
24146
  baseurl="${this.baseUrl}"
24146
24147
  route="${this.route}"
24147
- consumedRoute="_empty"
24148
+ consumedRoute="${this.consumedRoute}"
24148
24149
  instant="${this.instant}"
24149
- top="true"
24150
+ top="${this.top}"
24150
24151
  style="width: 100%;"
24151
24152
  @app-data-updated="${()=>this.requestUpdate()}"
24152
24153
  .appData="${appData.value}"
@@ -24156,7 +24157,7 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24156
24157
  `}};MateuUi.styles=i$w`
24157
24158
  :host {
24158
24159
  }
24159
- `;__decorateClass([n$t()],MateuUi.prototype,"baseUrl",2);__decorateClass([n$t()],MateuUi.prototype,"route",2);__decorateClass([n$t()],MateuUi.prototype,"config",2);__decorateClass([r$o()],MateuUi.prototype,"instant",2);MateuUi=__decorateClass([t$o("mateu-ui")],MateuUi);const filterMenu=(te,Q)=>{Q.filter!=te.detail.value&&(Q.filter=te.detail.value)},renderApp=(te,Q,X,ee,ie,oe,ne)=>{const ae=te.mapItems(Q.menu,te.filter?.toLowerCase()??"");return x$4`
24160
+ `;__decorateClass([n$t()],MateuUi.prototype,"baseUrl",2);__decorateClass([n$t()],MateuUi.prototype,"route",2);__decorateClass([n$t()],MateuUi.prototype,"consumedRoute",2);__decorateClass([n$t()],MateuUi.prototype,"config",2);__decorateClass([n$t()],MateuUi.prototype,"top",2);__decorateClass([r$o()],MateuUi.prototype,"instant",2);MateuUi=__decorateClass([t$o("mateu-ui")],MateuUi);const filterMenu=(te,Q)=>{Q.filter!=te.detail.value&&(Q.filter=te.detail.value)},renderApp=(te,Q,X,ee,ie,oe,ne)=>{const ae=te.mapItems(Q.menu,te.filter?.toLowerCase()??"");return x$4`
24160
24161
  ${Q.variant==AppVariant.HAMBURGUER_MENU?x$4`
24161
24162
  <vaadin-app-layout style="${Q?.style}" class="${Q?.cssClasses}" .drawerOpened=${!Q.drawerClosed}>
24162
24163
  <vaadin-drawer-toggle slot="navbar"></vaadin-drawer-toggle>
@@ -24177,9 +24178,10 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24177
24178
  <mateu-ux
24178
24179
  route="${te.selectedRoute??Q.homeRoute}"
24179
24180
  id="ux_${te.id}"
24180
- baseUrl="${te.selectedBaseUrl}"
24181
+ baseUrl="${te.selectedBaseUrl??te.baseUrl}"
24181
24182
  consumedRoute="${Q.route}"
24182
- appServerSideType="${te.selectedAppServerSideType}"
24183
+ appServerSideType="${te.selectedAppServerSideType??Q.appServerSideType}"
24184
+ uriPrefix="${te.selectedUriPrefix}"
24183
24185
  style="width: 100%;"
24184
24186
  .appState="${oe}"
24185
24187
  .appData="${ne}"
@@ -24191,7 +24193,6 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24191
24193
  `:E$5}
24192
24194
 
24193
24195
  ${Q.variant==AppVariant.MENU_ON_TOP?x$4`
24194
-
24195
24196
  <vaadin-vertical-layout style="width: 100%;">
24196
24197
  <vaadin-horizontal-layout style="width: 100%; height: 4rem; align-items: center; border-bottom: 1px solid var(--lumo-disabled-text-color);" theme="spacing">
24197
24198
  <vaadin-horizontal-layout style="align-items: center;">
@@ -24210,14 +24211,15 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24210
24211
  widgets
24211
24212
  </vaadin-horizontal-layout>
24212
24213
  </vaadin-horizontal-layout>
24213
- <div class="app-content">
24214
+ <div class="app-content">
24214
24215
  <mateu-api-caller>
24215
24216
  <mateu-ux
24216
24217
  route="${te.selectedRoute??Q.homeRoute}"
24217
24218
  id="ux_${te.id}"
24218
- baseUrl="${te.selectedBaseUrl}"
24219
+ baseUrl="${te.selectedBaseUrl??Q.homeBaseUrl??te.baseUrl}"
24219
24220
  consumedRoute="${Q.route}"
24220
- appServerSideType="${te.selectedAppServerSideType}"
24221
+ appServerSideType="${te.selectedAppServerSideType??Q.homeAppServerSideType??Q.appServerSideType}"
24222
+ uriPrefix="${te.selectedUriPrefix??Q.homeUriPrefix}"
24221
24223
  style="width: 100%;"
24222
24224
  .appState="${oe}"
24223
24225
  .appData="${ne}"
@@ -24241,9 +24243,10 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24241
24243
  <mateu-ux
24242
24244
  route="${te.selectedRoute??Q.homeRoute}"
24243
24245
  id="ux_${te.id}"
24244
- baseUrl="${te.selectedBaseUrl}"
24246
+ baseUrl="${te.selectedBaseUrl??te.baseUrl}"
24245
24247
  consumedRoute="${Q.route}"
24246
- appServerSideType="${te.selectedAppServerSideType}"
24248
+ appServerSideType="${te.selectedAppServerSideType??Q.appServerSideType}"
24249
+ uriPrefix="${te.selectedUriPrefix}"
24247
24250
  style="width: 100%; padding: 1em;"
24248
24251
  .appState="${oe}"
24249
24252
  .appData="${ne}"
@@ -24263,7 +24266,7 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24263
24266
  class="${te.component?.cssClasses}">
24264
24267
  ${Q.menu.map(se=>x$4`
24265
24268
  <vaadin-tab
24266
- @click="${()=>te.selectRoute(se.destination.route,se.actionId,se.baseUrl,se.appServerSideType)}"
24269
+ @click="${()=>te.selectRoute(se.destination.route,se.actionId,se.baseUrl,se.appServerSideType,se.uriPrefix)}"
24267
24270
  >${se.label}</vaadin-tab>
24268
24271
  `)}
24269
24272
  </vaadin-tabs>
@@ -24274,9 +24277,10 @@ Let me know your thoughts!`,userName:"Sam Rivera"}]}"
24274
24277
  <mateu-ux
24275
24278
  route="${te.selectedRoute??Q.homeRoute}"
24276
24279
  id="ux_${te.id}"
24277
- baseUrl="${te.selectedBaseUrl}"
24280
+ baseUrl="${te.selectedBaseUrl??te.baseUrl}"
24278
24281
  consumedRoute="${Q.route}"
24279
- appServerSideType="${te.selectedAppServerSideType}"
24282
+ appServerSideType="${te.selectedAppServerSideType??Q.appServerSideType}"
24283
+ uriPrefix="${te.selectedUriPrefix}"
24280
24284
  style="width: 100%;"
24281
24285
  .appState="${oe}"
24282
24286
  .appData="${ne}"
@@ -17,8 +17,9 @@
17
17
  baseUrl="/declarative"
18
18
  baseUrl=""
19
19
  -->
20
- <mateu-ui baseUrl=""
20
+ <mateu-ui baseUrl="https://demo.mateu.io/fluent"
21
21
  config='{"tenantId": "1111","profile": "dev"}'
22
+ top="false"
22
23
  style="width: 100%; height: 100vh;"
23
24
  >
24
25
  </mateu-ui>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mateu-vaadin",
3
3
  "private": false,
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "files": ["dist"],