@supersoniks/concorde 3.1.59 → 3.1.61

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.
package/build-infos.json CHANGED
@@ -1 +1 @@
1
- {"date":1739547634}
1
+ {"date":1739982273}
@@ -1,4 +1,4 @@
1
- (function(K){typeof define=="function"&&define.amd?define(K):K()})(function(){"use strict";var St,k,L,ko,t,G;let K=class Rt{static getLanguage(){const t=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||t}static getCookies(){return document.cookie.split(";").reduce((t,s)=>{const i=s.indexOf("=");return t[s.substring(0,i).trim()]=s.substring(i+1),t},{})}static everyAncestors(t,s){for(;t;){if(!s(t))return;t=t.parentNode||t.host}}static getScrollableAncestor(t){for(;t;){const s=t;if(s.nodeType===1){const i=window.getComputedStyle(s);if((i==null?void 0:i.overflowY)==="hidden"||(i==null?void 0:i.overflowX)==="hidden")return t}t=t.parentNode||t.host}return null}static getAncestorAttributeValue(t,s){if(!t)return null;for(;!("hasAttribute"in t&&t.hasAttribute(s))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return"hasAttribute"in t?t.getAttribute(s):null}static getApiConfiguration(t){const s=Rt.getAncestorAttributeValue(t,"token"),i=Rt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Rt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const a=Rt.getAncestorAttributeValue(t,"tokenProvider"),c=Rt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Rt.getAncestorAttributeValue(t,"userName"),n=Rt.getAncestorAttributeValue(t,"password"));const h=Rt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),p=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:a,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:p}}static getClosestElement(t,s){for(;!(t.nodeName&&t.nodeName.toLowerCase()===s)&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.nodeName?t:null}static getClosestForm(t){return Rt.getClosestElement(t,"form")}static async loadJS(t){return new Promise(async i=>{const e=document.createElement("script");e.src=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}static async loadCSS(t){return new Promise(async i=>{const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}};const ti=r=>{const t=document.documentElement,s=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="lang"&&r()}),i={attributes:!0,attributeFilter:["lang"]};s.observe(t,i)};let vs=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=K.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,p){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:p}).format}const[n,a]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),a&&c.push(o(s,"minute",i)(a)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}},Mo=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},rr="sonic";typeof __SONIC_PREFIX__<"u"&&(rr=__SONIC_PREFIX__);let or=rr.replace(/-([a-z])/g,r=>r[1].toUpperCase());const ys=or.charAt(0).toUpperCase()+or.slice(1);function _s(r){return Object.prototype.hasOwnProperty.call(r,"__value")}function He(r){return typeof r=="object"&&r!=null}let De="sonic";typeof __SONIC_PREFIX__>"u"&&(De="sonic"+Math.floor(Math.random()*1e6));const ei=De=="sonic"?"publisher-proxies-data":De+"-publisher-proxies-data";let si=(St=class{constructor(t,s,i){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=t,this.parent=s||null,this._parentKey_=i,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){var t;for(const s in this._proxies_.keys())s!="_parent_"&&((t=this._proxies_.get(s))==null||t.delete());this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),St.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!N.changed){N.changed=!0,N.saveId++;const s=N.saveId;setTimeout(()=>N.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>{e(i)}),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,s){this._fillListeners_.forEach(i=>{i[t]!==s&&(i[t]=s)}),this._publishTemplateFilling_(t,s)}_publishTemplateFilling_(t,s){this._templateFillListeners_.forEach(i=>{const e=Object.getOwnPropertyDescriptor(i,t);e&&!e.set&&!e.writable||(i.propertyMap&&i.propertyMap[t]&&(t=i.propertyMap[t]),typeof i[t]<"u"&&i[t]!==s&&(i[t]=s))})}onAssign(t,s=!0){typeof t=="function"&&(this._assignListeners_.has(t)||(this._assignListeners_.add(t),s&&t(this.get())))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){typeof t=="function"&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.add(t)}offFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.delete(t)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){typeof t=="function"&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),typeof this._value_=="object")for(const s in this._value_){let i=s;const e=this._value_[s];t.propertyMap&&t.propertyMap[s]&&(i=t.propertyMap[s]),typeof t[s]<"u"&&t[s]!==e&&(t[i]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const s in this._value_){const i=this._value_[s];t[s]!==i&&(t[s]=i)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,s=!1){var e,o,n;if(this._value_===t||this._value_&&t&&_s(this._value_)&&_s(t)&&this._value_.__value===t.__value)return!0;this._value_=He(t)?t:{__value:t},this._cachedGet_=void 0;const i=_s(this._value_);if(this._parentKey_&&this.parent){const a=_s(this._value_)?this._value_.__value:this._value_;if(((e=this.parent)==null?void 0:e.get())==null&&((o=this.parent)==null?void 0:o.get())==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:a});else{const c=[];c[Number(this._parentKey_)]=a,this.parent.set(c)}else this.parent._value_[this._parentKey_]=a}if(i)return this._publishAssignement_(s),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const a in this._value_)this._value_[a]===void 0&&delete this._value_[a];if(this._proxies_.forEach((a,c)=>{const h=this._value_[c];c!="_parent_"&&h===void 0&&h!==null&&isNaN(Number(c))&&(a.set(null),this._publishDynamicFilling_(c,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),He(this._value_))for(const a in this._value_){const c=t[a],d=He(c)?c:{__value:c};if(!this._proxies_.has(a)){this._publishDynamicFilling_(a,c);continue}(n=this._proxies_.get(a))==null||n.set(d,!0),this._publishDynamicFilling_(a,c)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(N.modifiedCollectore.length>0&&N.modifiedCollectore[0].add(this),Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return this._cachedGet_=t??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(St.instancesCounter++,this._instanceCounter_=St.instancesCounter),St.instances.set(this._instanceCounter_,this),"<"+De+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+De+"-publisher-proxy>"}},St.instances=new Map,St.instancesCounter=0,St),N=(k=class{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],k.instance!=null)throw"Singleton / use getInstance";k.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}async cleanStorageData(){return new Promise(t=>{(async()=>{try{let i=localStorage.getItem(ei),e=null;if(i&&(e=await this.decompress(i,"gzip")),e)try{this.localStorageData=JSON.parse(e)}catch{this.localStorageData={}}else i=await this.compress("{}","gzip"),localStorage.setItem(ei,i),this.localStorageData={};const o=1e3*60*60*12;for(const n in this.localStorageData){const a=this.localStorageData[n],c=new Date().getTime()-(a.expirationDelayMs||o);a.lastModifiationMS<c&&delete this.localStorageData[n]}t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(t){if(t){const s=k.instances.get(t);return s||(console.warn("No PublisherManager instance registered with id:",t,"creating new one"),new k)}return k.instance==null?new k:k.instance}static registerInstance(t,s){k.instances.has(t)&&console.warn("PublisherManager instance already registered with id: ",t),k.instances.set(t,s)}static get(t,s){return k.getInstance().get(t,s)}static collectModifiedPublisher(){k.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return k.modifiedCollectore.shift()}static delete(t){return t?k.getInstance().delete(t):!1}async setLocalData(t,s){var i;await this.isLocalStrorageReady,t.set(((i=this.localStorageData[s+"¤lang_"+K.getLanguage()])==null?void 0:i.data)||t.get())}get(t,s){const i=(s==null?void 0:s.localStorageMode)==="enabled";if(!this.publishers.has(t)){const o={},n=new Be(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(s!=null&&s.expirationDelayMs&&(e._expiration_delay_=s.expirationDelayMs),e._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(e,t)),this.publishers.get(t)}set(t,s){this.publishers.set(t,s)}delete(t){return this.publishers.has(t)?(this.publishers.delete(t),!0):!1}async saveToLocalStorage(t=0){if(!(t!==k.saveId&&t%10!=0))try{if(!k.changed||k.saving)return;k.saving=!0,k.changed=!1;const s=Array.from(this.publishers.keys());let i=!1;for(const e of s){const o=this.publishers.get(e);if(!(o!=null&&o._is_savable_))continue;const n=o==null?void 0:o.get();n&&(this.localStorageData[e+"¤lang_"+K.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:o._expiration_delay_,data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(ei,e)}if(k.saving=!1,k.changed){k.saveId++;const e=k.saveId;setTimeout(()=>this.saveToLocalStorage(e),1e3)}}catch{k.saving=!1}}async compress(t,s){const i=new TextEncoder().encode(t),e=window,o=new e.CompressionStream(s),n=o.writable.getWriter();n.write(i),n.close();const a=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(a);let h="";for(let d=0;d<c.length;d++)h+=String.fromCharCode(c[d]);return btoa(h)}async decompress(t,s){const i=atob(t),o=Uint8Array.from(i,d=>d.charCodeAt(0)).buffer,n=window,a=new n.DecompressionStream(s),c=a.writable.getWriter();c.write(o),c.close();const h=await new Response(a.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Fri Feb 14 2025 16:40:33 GMT+0100 (Central European Standard Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);if(typeof window<"u"){const r=window;r[ys+"PublisherManager"]=r[ys+"PublisherManager"]||N}const Io=new Set(["invalidate","onInvalidate","offInvalidate","invalidateForm","onFormInvalidate","offFormInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_formInvalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishFormInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_parentKey_","_value_","_is_savable_","_expiration_delay_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class Be extends si{constructor(t,s=null,i){super(t,s,i);const e=new Proxy(this,{get:function(o,n){if(Io.has(n))return o[n];if(n==Symbol.toPrimitive)return()=>e.get();if(!o._proxies_.has(n)){const a=o._value_[n],c=new Be(He(a)?a:{__value:a},o,n);c._proxies_.set("_parent_",e),o._proxies_.set(n,c)}return o._proxies_.get(n)},set:function(o,n,a){var h;if(n=="_value_")return o._value_=a,!0;if(n=="_cachedGet_")return o._cachedGet_=a,!0;if(n=="_assignmentId_")return o._assignmentId_=a,!0;if(n=="_is_savable_")return o._is_savable_=a,!0;if(n=="_expiration_delay_")return o._expiration_delay_=a,!0;if(n=="_instanceCounter_")return o._instanceCounter_=a,!0;if(!o._proxies_.has(n)){const d=new Be({},o,n);d._proxies_.set("_parent_",e),o._proxies_.set(n,d)}return o._value_[n]!==a&&(o._value_[n]=a,o._publishDynamicFilling_(n,a),(h=o._proxies_.get(n))==null||h.set(He(a)?a:{__value:a})),!0},deleteProperty:function(o,n){var a;return o._publishDynamicFilling_(n,null),(a=o._proxies_.get(n))==null||a.set(null),delete o._value_[n]},has:function(o,n){return n in o._value_&&n!="_lockInternalMutationPublishing_"},defineProperty:function(o,n,a){return a&&"value"in a&&(o._value_[n]=a.value),!0},getOwnPropertyDescriptor:function(o,n){return{enumerable:!0,configurable:!0}},ownKeys:function(o){return o._value_.__value?Object.keys(o._value_.__value):Object.keys(o._value_)}});return e}getProperty(t,s){return t[s]}}class jo extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=si.instances.get(parseInt(this.publisherId)),(t=this.publisher)==null||t.onAssign(this.onAssign)}disconnectedCallback(){var t;(t=this.publisher)==null||t.offAssign(this.onAssign)}}try{customElements.define(De+"-publisher-proxy",jo)}catch{}let ws=(L=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(L.observedElements.keys()).forEach(t=>L.unObserve(t)))}static observe(t){if(!t||!L.enabled||L.observedElements.has(t))return;const s=new MutationObserver(L.onMutation),i={};i.childList=!0,i.subtree=!0,i.attributes=!0,i.attributeFilter=["data-bind"],s.observe(t,i),t.querySelectorAll("[data-bind]").forEach(e=>L.addPublisherListeners(e)),L.observedElements.set(t,s)}static unObserve(t){if(!t)return;const s=this.observedElements.get(t);s&&(s.disconnect(),t.querySelectorAll("[data-bind]").forEach(i=>L.removePublisherListeners(i)))}static onAdded(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.addPublisherListeners(s)):t.childNodes.forEach(s=>L.onAdded(s))}static onRemoved(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.removePublisherListeners(s)):t.childNodes.forEach(s=>L.onRemoved(s))}static onMutation(t){for(const s of t)switch(s.type){case"attributes":L.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach(i=>{L.onAdded(i)}),s.removedNodes.forEach(i=>{L.onRemoved(i)});break}}static removePublisherListeners(t){const s=L.publisherListeners.get(t);s&&(L.publisherListeners.delete(t),s.forEach(i=>{var e;(e=i.publisher)==null||e.offAssign(i.onAssign)}))}static getVariablesDescriptor(t){let s=t.match(/(\$(?:\w+\\?\.?)+)/g);return s?s=s.map(i=>i.replace("$","")):s=[t],s=s.filter(i=>i.length>0),{expression:t.replace("\\",""),variables:s.map(i=>i.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(t){return"attributes"in t?Array.from(t.attributes).filter(s=>s.name.indexOf("::")==0).map(s=>({propertyToUpdate:s.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:L.getVariablesDescriptor(s.value)})):[]}static getSubPublisher(t,s){if(!s)return t;for(const i of s)if(i!="_self_"){if(!t)return null;t=t[i]}return t}static addPublisherListeners(t){L.removePublisherListeners(t);const s=K.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=N.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const a=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of a.variables){const d=h;let p=i;p=L.getSubPublisher(i,d);const g=t,b={publisher:p,onAssign:()=>{const v=a.variables.map(D=>{var u;return(u=L.getSubPublisher(i,D))==null?void 0:u.get()});let y=a.expression,S=!1;if(v.length==1&&a.variables[0].join(".")==y.substring(1)){let D=v[0];D===null&&(D=""),g[c]=D;return}for(let D=0;D<v.length;D++){let u=v[D];const f=a.variables[D];u===null&&(S=!0,u=void 0),y=y.replace("$"+f.join("."),u)}if(y.indexOf("|")!=-1){const D=y.indexOf("|");if(D==0)y=vs.js(y.substring(1));else{const u=y.substring(0,D),f=y.substring(D+1),_=vs[u];y=S?"":_?_(f):y}}else y=S?"":y;g[c]=y}};p==null||p.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ws.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ws);let J=class qt{static shallowEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n];if(i?a!==c:a!=c)return!1}return!0}static deepEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n],h=qt.isObject(a)&&qt.isObject(c),d=i?a!==c:a!=c;if(h&&!qt.deepEqual(a,c)||!h&&d)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static isEmpty(t){return qt.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,s,i=!1){for(const e of s){const o=t[e];if(o===void 0)return;i&&qt.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static traverseDotNotation(t,s,i=!1){return qt.traverse(t,s.split("."),i)}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),qt.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return qt.getURLSearchArray(t,"").join("&")}};const dt=J.traverseDotNotation;/**
1
+ (function(K){typeof define=="function"&&define.amd?define(K):K()})(function(){"use strict";var St,k,L,ko,t,G;let K=class Rt{static getLanguage(){const t=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||t}static getCookies(){return document.cookie.split(";").reduce((t,s)=>{const i=s.indexOf("=");return t[s.substring(0,i).trim()]=s.substring(i+1),t},{})}static everyAncestors(t,s){for(;t;){if(!s(t))return;t=t.parentNode||t.host}}static getScrollableAncestor(t){for(;t;){const s=t;if(s.nodeType===1){const i=window.getComputedStyle(s);if((i==null?void 0:i.overflowY)==="hidden"||(i==null?void 0:i.overflowX)==="hidden")return t}t=t.parentNode||t.host}return null}static getAncestorAttributeValue(t,s){if(!t)return null;for(;!("hasAttribute"in t&&t.hasAttribute(s))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return"hasAttribute"in t?t.getAttribute(s):null}static getApiConfiguration(t){const s=Rt.getAncestorAttributeValue(t,"token"),i=Rt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Rt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const a=Rt.getAncestorAttributeValue(t,"tokenProvider"),c=Rt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Rt.getAncestorAttributeValue(t,"userName"),n=Rt.getAncestorAttributeValue(t,"password"));const h=Rt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),p=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:a,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:p}}static getClosestElement(t,s){for(;!(t.nodeName&&t.nodeName.toLowerCase()===s)&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.nodeName?t:null}static getClosestForm(t){return Rt.getClosestElement(t,"form")}static async loadJS(t){return new Promise(async i=>{const e=document.createElement("script");e.src=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}static async loadCSS(t){return new Promise(async i=>{const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}};const ti=r=>{const t=document.documentElement,s=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="lang"&&r()}),i={attributes:!0,attributeFilter:["lang"]};s.observe(t,i)};let vs=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=K.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,p){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:p}).format}const[n,a]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),a&&c.push(o(s,"minute",i)(a)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}},Mo=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},rr="sonic";typeof __SONIC_PREFIX__<"u"&&(rr=__SONIC_PREFIX__);let or=rr.replace(/-([a-z])/g,r=>r[1].toUpperCase());const ys=or.charAt(0).toUpperCase()+or.slice(1);function _s(r){return Object.prototype.hasOwnProperty.call(r,"__value")}function He(r){return typeof r=="object"&&r!=null}let De="sonic";typeof __SONIC_PREFIX__>"u"&&(De="sonic"+Math.floor(Math.random()*1e6));const ei=De=="sonic"?"publisher-proxies-data":De+"-publisher-proxies-data";let si=(St=class{constructor(t,s,i){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=t,this.parent=s||null,this._parentKey_=i,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){var t;for(const s in this._proxies_.keys())s!="_parent_"&&((t=this._proxies_.get(s))==null||t.delete());this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),St.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!N.changed){N.changed=!0,N.saveId++;const s=N.saveId;setTimeout(()=>N.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>{e(i)}),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,s){this._fillListeners_.forEach(i=>{i[t]!==s&&(i[t]=s)}),this._publishTemplateFilling_(t,s)}_publishTemplateFilling_(t,s){this._templateFillListeners_.forEach(i=>{const e=Object.getOwnPropertyDescriptor(i,t);e&&!e.set&&!e.writable||(i.propertyMap&&i.propertyMap[t]&&(t=i.propertyMap[t]),typeof i[t]<"u"&&i[t]!==s&&(i[t]=s))})}onAssign(t,s=!0){typeof t=="function"&&(this._assignListeners_.has(t)||(this._assignListeners_.add(t),s&&t(this.get())))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){typeof t=="function"&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.add(t)}offFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.delete(t)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){typeof t=="function"&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),typeof this._value_=="object")for(const s in this._value_){let i=s;const e=this._value_[s];t.propertyMap&&t.propertyMap[s]&&(i=t.propertyMap[s]),typeof t[s]<"u"&&t[s]!==e&&(t[i]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const s in this._value_){const i=this._value_[s];t[s]!==i&&(t[s]=i)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,s=!1){var e,o,n;if(this._value_===t||this._value_&&t&&_s(this._value_)&&_s(t)&&this._value_.__value===t.__value)return!0;this._value_=He(t)?t:{__value:t},this._cachedGet_=void 0;const i=_s(this._value_);if(this._parentKey_&&this.parent){const a=_s(this._value_)?this._value_.__value:this._value_;if(((e=this.parent)==null?void 0:e.get())==null&&((o=this.parent)==null?void 0:o.get())==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:a});else{const c=[];c[Number(this._parentKey_)]=a,this.parent.set(c)}else this.parent._value_[this._parentKey_]=a}if(i)return this._publishAssignement_(s),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const a in this._value_)this._value_[a]===void 0&&delete this._value_[a];if(this._proxies_.forEach((a,c)=>{const h=this._value_[c];c!="_parent_"&&h===void 0&&h!==null&&isNaN(Number(c))&&(a.set(null),this._publishDynamicFilling_(c,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),He(this._value_))for(const a in this._value_){const c=t[a],d=He(c)?c:{__value:c};if(!this._proxies_.has(a)){this._publishDynamicFilling_(a,c);continue}(n=this._proxies_.get(a))==null||n.set(d,!0),this._publishDynamicFilling_(a,c)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(N.modifiedCollectore.length>0&&N.modifiedCollectore[0].add(this),Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return this._cachedGet_=t??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(St.instancesCounter++,this._instanceCounter_=St.instancesCounter),St.instances.set(this._instanceCounter_,this),"<"+De+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+De+"-publisher-proxy>"}},St.instances=new Map,St.instancesCounter=0,St),N=(k=class{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],k.instance!=null)throw"Singleton / use getInstance";k.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}async cleanStorageData(){return new Promise(t=>{(async()=>{try{let i=localStorage.getItem(ei),e=null;if(i&&(e=await this.decompress(i,"gzip")),e)try{this.localStorageData=JSON.parse(e)}catch{this.localStorageData={}}else i=await this.compress("{}","gzip"),localStorage.setItem(ei,i),this.localStorageData={};const o=1e3*60*60*12;for(const n in this.localStorageData){const a=this.localStorageData[n],c=new Date().getTime()-(a.expirationDelayMs||o);a.lastModifiationMS<c&&delete this.localStorageData[n]}t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(t){if(t){const s=k.instances.get(t);return s||(console.warn("No PublisherManager instance registered with id:",t,"creating new one"),new k)}return k.instance==null?new k:k.instance}static registerInstance(t,s){k.instances.has(t)&&console.warn("PublisherManager instance already registered with id: ",t),k.instances.set(t,s)}static get(t,s){return k.getInstance().get(t,s)}static collectModifiedPublisher(){k.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return k.modifiedCollectore.shift()}static delete(t){return t?k.getInstance().delete(t):!1}async setLocalData(t,s){var i;await this.isLocalStrorageReady,t.set(((i=this.localStorageData[s+"¤lang_"+K.getLanguage()])==null?void 0:i.data)||t.get())}get(t,s){const i=(s==null?void 0:s.localStorageMode)==="enabled";if(!this.publishers.has(t)){const o={},n=new Be(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(s!=null&&s.expirationDelayMs&&(e._expiration_delay_=s.expirationDelayMs),e._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(e,t)),this.publishers.get(t)}set(t,s){this.publishers.set(t,s)}delete(t){return this.publishers.has(t)?(this.publishers.delete(t),!0):!1}async saveToLocalStorage(t=0){if(!(t!==k.saveId&&t%10!=0))try{if(!k.changed||k.saving)return;k.saving=!0,k.changed=!1;const s=Array.from(this.publishers.keys());let i=!1;for(const e of s){const o=this.publishers.get(e);if(!(o!=null&&o._is_savable_))continue;const n=o==null?void 0:o.get();n&&(this.localStorageData[e+"¤lang_"+K.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:o._expiration_delay_,data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(ei,e)}if(k.saving=!1,k.changed){k.saveId++;const e=k.saveId;setTimeout(()=>this.saveToLocalStorage(e),1e3)}}catch{k.saving=!1}}async compress(t,s){const i=new TextEncoder().encode(t),e=window,o=new e.CompressionStream(s),n=o.writable.getWriter();n.write(i),n.close();const a=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(a);let h="";for(let d=0;d<c.length;d++)h+=String.fromCharCode(c[d]);return btoa(h)}async decompress(t,s){const i=atob(t),o=Uint8Array.from(i,d=>d.charCodeAt(0)).buffer,n=window,a=new n.DecompressionStream(s),c=a.writable.getWriter();c.write(o),c.close();const h=await new Response(a.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Wed Feb 19 2025 17:24:32 GMT+0100 (Central European Standard Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);if(typeof window<"u"){const r=window;r[ys+"PublisherManager"]=r[ys+"PublisherManager"]||N}const Io=new Set(["invalidate","onInvalidate","offInvalidate","invalidateForm","onFormInvalidate","offFormInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_formInvalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishFormInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_parentKey_","_value_","_is_savable_","_expiration_delay_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class Be extends si{constructor(t,s=null,i){super(t,s,i);const e=new Proxy(this,{get:function(o,n){if(Io.has(n))return o[n];if(n==Symbol.toPrimitive)return()=>e.get();if(!o._proxies_.has(n)){const a=o._value_[n],c=new Be(He(a)?a:{__value:a},o,n);c._proxies_.set("_parent_",e),o._proxies_.set(n,c)}return o._proxies_.get(n)},set:function(o,n,a){var h;if(n=="_value_")return o._value_=a,!0;if(n=="_cachedGet_")return o._cachedGet_=a,!0;if(n=="_assignmentId_")return o._assignmentId_=a,!0;if(n=="_is_savable_")return o._is_savable_=a,!0;if(n=="_expiration_delay_")return o._expiration_delay_=a,!0;if(n=="_instanceCounter_")return o._instanceCounter_=a,!0;if(!o._proxies_.has(n)){const d=new Be({},o,n);d._proxies_.set("_parent_",e),o._proxies_.set(n,d)}return o._value_[n]!==a&&(o._value_[n]=a,o._publishDynamicFilling_(n,a),(h=o._proxies_.get(n))==null||h.set(He(a)?a:{__value:a})),!0},deleteProperty:function(o,n){var a;return o._publishDynamicFilling_(n,null),(a=o._proxies_.get(n))==null||a.set(null),delete o._value_[n]},has:function(o,n){return n in o._value_&&n!="_lockInternalMutationPublishing_"},defineProperty:function(o,n,a){return a&&"value"in a&&(o._value_[n]=a.value),!0},getOwnPropertyDescriptor:function(o,n){return{enumerable:!0,configurable:!0}},ownKeys:function(o){return o._value_.__value?Object.keys(o._value_.__value):Object.keys(o._value_)}});return e}getProperty(t,s){return t[s]}}class jo extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=si.instances.get(parseInt(this.publisherId)),(t=this.publisher)==null||t.onAssign(this.onAssign)}disconnectedCallback(){var t;(t=this.publisher)==null||t.offAssign(this.onAssign)}}try{customElements.define(De+"-publisher-proxy",jo)}catch{}let ws=(L=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(L.observedElements.keys()).forEach(t=>L.unObserve(t)))}static observe(t){if(!t||!L.enabled||L.observedElements.has(t))return;const s=new MutationObserver(L.onMutation),i={};i.childList=!0,i.subtree=!0,i.attributes=!0,i.attributeFilter=["data-bind"],s.observe(t,i),t.querySelectorAll("[data-bind]").forEach(e=>L.addPublisherListeners(e)),L.observedElements.set(t,s)}static unObserve(t){if(!t)return;const s=this.observedElements.get(t);s&&(s.disconnect(),t.querySelectorAll("[data-bind]").forEach(i=>L.removePublisherListeners(i)))}static onAdded(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.addPublisherListeners(s)):t.childNodes.forEach(s=>L.onAdded(s))}static onRemoved(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.removePublisherListeners(s)):t.childNodes.forEach(s=>L.onRemoved(s))}static onMutation(t){for(const s of t)switch(s.type){case"attributes":L.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach(i=>{L.onAdded(i)}),s.removedNodes.forEach(i=>{L.onRemoved(i)});break}}static removePublisherListeners(t){const s=L.publisherListeners.get(t);s&&(L.publisherListeners.delete(t),s.forEach(i=>{var e;(e=i.publisher)==null||e.offAssign(i.onAssign)}))}static getVariablesDescriptor(t){let s=t.match(/(\$(?:\w+\\?\.?)+)/g);return s?s=s.map(i=>i.replace("$","")):s=[t],s=s.filter(i=>i.length>0),{expression:t.replace("\\",""),variables:s.map(i=>i.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(t){return"attributes"in t?Array.from(t.attributes).filter(s=>s.name.indexOf("::")==0).map(s=>({propertyToUpdate:s.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:L.getVariablesDescriptor(s.value)})):[]}static getSubPublisher(t,s){if(!s)return t;for(const i of s)if(i!="_self_"){if(!t)return null;t=t[i]}return t}static addPublisherListeners(t){L.removePublisherListeners(t);const s=K.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=N.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const a=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of a.variables){const d=h;let p=i;p=L.getSubPublisher(i,d);const g=t,b={publisher:p,onAssign:()=>{const v=a.variables.map(D=>{var u;return(u=L.getSubPublisher(i,D))==null?void 0:u.get()});let y=a.expression,S=!1;if(v.length==1&&a.variables[0].join(".")==y.substring(1)){let D=v[0];D===null&&(D=""),g[c]=D;return}for(let D=0;D<v.length;D++){let u=v[D];const f=a.variables[D];u===null&&(S=!0,u=void 0),y=y.replace("$"+f.join("."),u)}if(y.indexOf("|")!=-1){const D=y.indexOf("|");if(D==0)y=vs.js(y.substring(1));else{const u=y.substring(0,D),f=y.substring(D+1),_=vs[u];y=S?"":_?_(f):y}}else y=S?"":y;g[c]=y}};p==null||p.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ws.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ws);let J=class qt{static shallowEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n];if(i?a!==c:a!=c)return!1}return!0}static deepEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n],h=qt.isObject(a)&&qt.isObject(c),d=i?a!==c:a!=c;if(h&&!qt.deepEqual(a,c)||!h&&d)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static isEmpty(t){return qt.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,s,i=!1){for(const e of s){const o=t[e];if(o===void 0)return;i&&qt.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static traverseDotNotation(t,s,i=!1){return qt.traverse(t,s.split("."),i)}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),qt.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return qt.getURLSearchArray(t,"").join("&")}};const dt=J.traverseDotNotation;/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -3870,7 +3870,7 @@ ${this.value}</textarea
3870
3870
  --sc-table-td-border-b: var(--sc-table-bw) solid
3871
3871
  var(--sc-table-border-color);
3872
3872
  }
3873
- `],Ue([l({type:String,reflect:!0})],oe.prototype,"size",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"bordered",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"rounded",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"noCustomScroll",2),Ue([l({type:String})],oe.prototype,"maxHeight",2),oe=Ue([x(Sd)],oe);const So="AES-CBC",Od=256;async function Dd(){return crypto.subtle.generateKey({name:So,length:Od},!0,["encrypt","decrypt"])}function kd(r){return btoa(String.fromCharCode(...new Uint8Array(r)))}async function Ld(r,t,s){const i=new TextEncoder().encode(r),e=await crypto.subtle.encrypt({name:So,iv:s},t,i);return kd(e)}var Ed=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,Qs=(r,t,s,i)=>{for(var e=i>1?void 0:i?Nd(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Ed(t,s,e),e};const Td="supersoniks_altcha",Md="Si2\\]X8M4!n9DCLd";let Oo=!1;const Id="sonic-captcha";let Ve=class extends Gt(w){constructor(){super(...arguments),this.key="",this.action=null,this.zIndex=9999,this.onCaptchaTokenChanged=r=>{r=="request_token"&&(this.formPublisher&&(this.formPublisher.captchaToken=""),this.requestToken())},this.maxNumber=5e4,this.chalengeUrl="https://altcha.supersoniks.org/get-challenge"}connectedCallback(){if(!Oo){const r=document.createElement("script");r.type="module",this.setAttribute("async",""),this.setAttribute("defer",""),r.src="https://eu.altcha.org/js/latest/altcha.min.js",Oo=!0,document.head.appendChild(r)}this.generateEncryptedKey(),super.connectedCallback(),this.formPublisher=st.get(this.getAncestorAttributeValue("headersDataProvider")??this.getAncestorAttributeValue("formDataProvider")),this.formPublisher&&!this.formPublisher.captchaToken.get()&&(this.formPublisher.needsCaptchaValidation=!0,this.formPublisher.captchaToken.onAssign(this.onCaptchaTokenChanged))}disconnectedCallback(){this.formPublisher&&(this.formPublisher.captchaToken.offAssign(this.onCaptchaTokenChanged),this.formPublisher.captchaToken=""),super.disconnectedCallback()}requestToken(){var s;if(!this.formPublisher)return;const r=this.shadowRoot.querySelector("form");if(!r)return;const t=new FormData(r);this.formPublisher.captchaKey=this.key,this.formPublisher.captchaToken=((s=t.get("altcha"))==null?void 0:s.toString())||""}async generateEncryptedKey(){if(this.key)return;const r=await Dd(),t=new TextEncoder().encode(Md),s=await Ld(Td,r,t);this.key=s}render(){if(!this.key)return A;const t=Kt.getLanguage().match("^fr\\b")?{aria:"Visitez altcha.org",error:"La vérification a échoué, réessayez plus tard.",expired:"La vérification a expiré, réessayez.",footer:"Protégé par Altcha",label:"Je ne suis pas un robot.",verified:"Vérifié",verifying:"Vérification en cours...",wait:"Vérification en cours… Veuillez patienter."}:{aria:"Visit altcha.org",error:"Verification failed, try again later.",expired:"Verification expired, try again.",footer:"Protected by Altcha",label:"I'm not a robot.",verified:"Verified",verifying:"Verifying...",wait:"Verifying... Please wait."};return m`
3873
+ `],Ue([l({type:String,reflect:!0})],oe.prototype,"size",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"bordered",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"rounded",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"noCustomScroll",2),Ue([l({type:String})],oe.prototype,"maxHeight",2),oe=Ue([x(Sd)],oe);const So="AES-CBC",Od=256;async function Dd(){return crypto.subtle.generateKey({name:So,length:Od},!0,["encrypt","decrypt"])}function kd(r){return btoa(String.fromCharCode(...new Uint8Array(r)))}async function Ld(r,t,s){const i=new TextEncoder().encode(r),e=await crypto.subtle.encrypt({name:So,iv:s},t,i);return kd(e)}var Ed=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,Qs=(r,t,s,i)=>{for(var e=i>1?void 0:i?Nd(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Ed(t,s,e),e};const Td="supersoniks_altcha",Md="Si2\\]X8M4!n9DCLd";let Oo=!1;const Id="sonic-captcha";let Ve=class extends Gt(w){constructor(){super(...arguments),this.key="",this.action=null,this.zIndex=9999,this.onCaptchaTokenChanged=r=>{r=="request_token"&&(this.formPublisher&&(this.formPublisher.captchaToken=""),this.requestToken())},this.maxNumber=5e4,this.chalengeUrl="https://altcha.supersoniks.org/get-challenge"}connectedCallback(){if(document.location.protocol.includes("https")){if(!Oo){const r=document.createElement("script");r.type="module",this.setAttribute("async",""),this.setAttribute("defer",""),r.src="https://eu.altcha.org/js/latest/altcha.min.js",Oo=!0,document.head.appendChild(r)}this.generateEncryptedKey(),super.connectedCallback(),this.formPublisher=st.get(this.getAncestorAttributeValue("headersDataProvider")??this.getAncestorAttributeValue("formDataProvider")),this.formPublisher&&!this.formPublisher.captchaToken.get()&&(this.formPublisher.needsCaptchaValidation=!0,this.formPublisher.captchaToken.onAssign(this.onCaptchaTokenChanged))}}disconnectedCallback(){this.formPublisher&&(this.formPublisher.captchaToken.offAssign(this.onCaptchaTokenChanged),this.formPublisher.captchaToken=""),super.disconnectedCallback()}requestToken(){var s;if(!this.formPublisher)return;const r=this.shadowRoot.querySelector("form");if(!r)return;const t=new FormData(r);this.formPublisher.captchaKey=this.key,this.formPublisher.captchaToken=((s=t.get("altcha"))==null?void 0:s.toString())||""}async generateEncryptedKey(){if(this.key)return;const r=await Dd(),t=new TextEncoder().encode(Md),s=await Ld(Td,r,t);this.key=s}render(){if(!this.key)return A;const t=Kt.getLanguage().match("^fr\\b")?{aria:"Visitez altcha.org",error:"La vérification a échoué, réessayez plus tard.",expired:"La vérification a expiré, réessayez.",footer:"Protégé par Altcha",label:"Je ne suis pas un robot.",verified:"Vérifié",verifying:"Vérification en cours...",wait:"Vérification en cours… Veuillez patienter."}:{aria:"Visit altcha.org",error:"Verification failed, try again later.",expired:"Verification expired, try again.",footer:"Protected by Altcha",label:"I'm not a robot.",verified:"Verified",verifying:"Verifying...",wait:"Verifying... Please wait."};return m`
3874
3874
  <form>
3875
3875
  <altcha-widget
3876
3876
  challengeurl="${this.chalengeUrl}?key=${this.key}&maxNumber=${this.maxNumber}"
@@ -556,7 +556,7 @@ let T = (k = class {
556
556
  const h = await new Response(a.readable).arrayBuffer();
557
557
  return new TextDecoder().decode(h);
558
558
  }
559
- }, k.buildDate = "Fri Feb 14 2025 16:40:33 GMT+0100 (Central European Standard Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
559
+ }, k.buildDate = "Wed Feb 19 2025 17:24:32 GMT+0100 (Central European Standard Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
560
560
  if (typeof window < "u") {
561
561
  const r = window;
562
562
  r[Cs + "PublisherManager"] = r[Cs + "PublisherManager"] || T;
@@ -12296,15 +12296,17 @@ let Me = class extends se(w) {
12296
12296
  }, this.maxNumber = 5e4, this.chalengeUrl = "https://altcha.supersoniks.org/get-challenge";
12297
12297
  }
12298
12298
  connectedCallback() {
12299
- if (!Hr) {
12300
- const r = document.createElement("script");
12301
- r.type = "module", this.setAttribute("async", ""), this.setAttribute("defer", ""), r.src = "https://eu.altcha.org/js/latest/altcha.min.js", Hr = !0, document.head.appendChild(r);
12299
+ if (document.location.protocol.includes("https")) {
12300
+ if (!Hr) {
12301
+ const r = document.createElement("script");
12302
+ r.type = "module", this.setAttribute("async", ""), this.setAttribute("defer", ""), r.src = "https://eu.altcha.org/js/latest/altcha.min.js", Hr = !0, document.head.appendChild(r);
12303
+ }
12304
+ this.generateEncryptedKey(), super.connectedCallback(), this.formPublisher = st.get(
12305
+ this.getAncestorAttributeValue("headersDataProvider") ?? this.getAncestorAttributeValue("formDataProvider")
12306
+ ), this.formPublisher && !this.formPublisher.captchaToken.get() && (this.formPublisher.needsCaptchaValidation = !0, this.formPublisher.captchaToken.onAssign(
12307
+ this.onCaptchaTokenChanged
12308
+ ));
12302
12309
  }
12303
- this.generateEncryptedKey(), super.connectedCallback(), this.formPublisher = st.get(
12304
- this.getAncestorAttributeValue("headersDataProvider") ?? this.getAncestorAttributeValue("formDataProvider")
12305
- ), this.formPublisher && !this.formPublisher.captchaToken.get() && (this.formPublisher.needsCaptchaValidation = !0, this.formPublisher.captchaToken.onAssign(
12306
- this.onCaptchaTokenChanged
12307
- ));
12308
12310
  }
12309
12311
  disconnectedCallback() {
12310
12312
  this.formPublisher && (this.formPublisher.captchaToken.offAssign(
@@ -1,4 +1,4 @@
1
- (function(K){typeof define=="function"&&define.amd?define(K):K()})(function(){"use strict";var St,k,L,ko,t,G;let K=class Rt{static getLanguage(){const t=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||t}static getCookies(){return document.cookie.split(";").reduce((t,s)=>{const i=s.indexOf("=");return t[s.substring(0,i).trim()]=s.substring(i+1),t},{})}static everyAncestors(t,s){for(;t;){if(!s(t))return;t=t.parentNode||t.host}}static getScrollableAncestor(t){for(;t;){const s=t;if(s.nodeType===1){const i=window.getComputedStyle(s);if((i==null?void 0:i.overflowY)==="hidden"||(i==null?void 0:i.overflowX)==="hidden")return t}t=t.parentNode||t.host}return null}static getAncestorAttributeValue(t,s){if(!t)return null;for(;!("hasAttribute"in t&&t.hasAttribute(s))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return"hasAttribute"in t?t.getAttribute(s):null}static getApiConfiguration(t){const s=Rt.getAncestorAttributeValue(t,"token"),i=Rt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Rt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const a=Rt.getAncestorAttributeValue(t,"tokenProvider"),c=Rt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Rt.getAncestorAttributeValue(t,"userName"),n=Rt.getAncestorAttributeValue(t,"password"));const h=Rt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),p=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:a,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:p}}static getClosestElement(t,s){for(;!(t.nodeName&&t.nodeName.toLowerCase()===s)&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.nodeName?t:null}static getClosestForm(t){return Rt.getClosestElement(t,"form")}static async loadJS(t){return new Promise(async i=>{const e=document.createElement("script");e.src=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}static async loadCSS(t){return new Promise(async i=>{const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}};const ti=r=>{const t=document.documentElement,s=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="lang"&&r()}),i={attributes:!0,attributeFilter:["lang"]};s.observe(t,i)};let vs=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=K.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,p){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:p}).format}const[n,a]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),a&&c.push(o(s,"minute",i)(a)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}},Mo=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},rr="sonic";typeof __SONIC_PREFIX__<"u"&&(rr=__SONIC_PREFIX__);let or=rr.replace(/-([a-z])/g,r=>r[1].toUpperCase());const ys=or.charAt(0).toUpperCase()+or.slice(1);function _s(r){return Object.prototype.hasOwnProperty.call(r,"__value")}function He(r){return typeof r=="object"&&r!=null}let De="sonic";typeof __SONIC_PREFIX__>"u"&&(De="sonic"+Math.floor(Math.random()*1e6));const ei=De=="sonic"?"publisher-proxies-data":De+"-publisher-proxies-data";let si=(St=class{constructor(t,s,i){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=t,this.parent=s||null,this._parentKey_=i,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){var t;for(const s in this._proxies_.keys())s!="_parent_"&&((t=this._proxies_.get(s))==null||t.delete());this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),St.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!N.changed){N.changed=!0,N.saveId++;const s=N.saveId;setTimeout(()=>N.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>{e(i)}),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,s){this._fillListeners_.forEach(i=>{i[t]!==s&&(i[t]=s)}),this._publishTemplateFilling_(t,s)}_publishTemplateFilling_(t,s){this._templateFillListeners_.forEach(i=>{const e=Object.getOwnPropertyDescriptor(i,t);e&&!e.set&&!e.writable||(i.propertyMap&&i.propertyMap[t]&&(t=i.propertyMap[t]),typeof i[t]<"u"&&i[t]!==s&&(i[t]=s))})}onAssign(t,s=!0){typeof t=="function"&&(this._assignListeners_.has(t)||(this._assignListeners_.add(t),s&&t(this.get())))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){typeof t=="function"&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.add(t)}offFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.delete(t)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){typeof t=="function"&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),typeof this._value_=="object")for(const s in this._value_){let i=s;const e=this._value_[s];t.propertyMap&&t.propertyMap[s]&&(i=t.propertyMap[s]),typeof t[s]<"u"&&t[s]!==e&&(t[i]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const s in this._value_){const i=this._value_[s];t[s]!==i&&(t[s]=i)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,s=!1){var e,o,n;if(this._value_===t||this._value_&&t&&_s(this._value_)&&_s(t)&&this._value_.__value===t.__value)return!0;this._value_=He(t)?t:{__value:t},this._cachedGet_=void 0;const i=_s(this._value_);if(this._parentKey_&&this.parent){const a=_s(this._value_)?this._value_.__value:this._value_;if(((e=this.parent)==null?void 0:e.get())==null&&((o=this.parent)==null?void 0:o.get())==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:a});else{const c=[];c[Number(this._parentKey_)]=a,this.parent.set(c)}else this.parent._value_[this._parentKey_]=a}if(i)return this._publishAssignement_(s),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const a in this._value_)this._value_[a]===void 0&&delete this._value_[a];if(this._proxies_.forEach((a,c)=>{const h=this._value_[c];c!="_parent_"&&h===void 0&&h!==null&&isNaN(Number(c))&&(a.set(null),this._publishDynamicFilling_(c,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),He(this._value_))for(const a in this._value_){const c=t[a],d=He(c)?c:{__value:c};if(!this._proxies_.has(a)){this._publishDynamicFilling_(a,c);continue}(n=this._proxies_.get(a))==null||n.set(d,!0),this._publishDynamicFilling_(a,c)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(N.modifiedCollectore.length>0&&N.modifiedCollectore[0].add(this),Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return this._cachedGet_=t??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(St.instancesCounter++,this._instanceCounter_=St.instancesCounter),St.instances.set(this._instanceCounter_,this),"<"+De+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+De+"-publisher-proxy>"}},St.instances=new Map,St.instancesCounter=0,St),N=(k=class{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],k.instance!=null)throw"Singleton / use getInstance";k.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}async cleanStorageData(){return new Promise(t=>{(async()=>{try{let i=localStorage.getItem(ei),e=null;if(i&&(e=await this.decompress(i,"gzip")),e)try{this.localStorageData=JSON.parse(e)}catch{this.localStorageData={}}else i=await this.compress("{}","gzip"),localStorage.setItem(ei,i),this.localStorageData={};const o=1e3*60*60*12;for(const n in this.localStorageData){const a=this.localStorageData[n],c=new Date().getTime()-(a.expirationDelayMs||o);a.lastModifiationMS<c&&delete this.localStorageData[n]}t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(t){if(t){const s=k.instances.get(t);return s||(console.warn("No PublisherManager instance registered with id:",t,"creating new one"),new k)}return k.instance==null?new k:k.instance}static registerInstance(t,s){k.instances.has(t)&&console.warn("PublisherManager instance already registered with id: ",t),k.instances.set(t,s)}static get(t,s){return k.getInstance().get(t,s)}static collectModifiedPublisher(){k.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return k.modifiedCollectore.shift()}static delete(t){return t?k.getInstance().delete(t):!1}async setLocalData(t,s){var i;await this.isLocalStrorageReady,t.set(((i=this.localStorageData[s+"¤lang_"+K.getLanguage()])==null?void 0:i.data)||t.get())}get(t,s){const i=(s==null?void 0:s.localStorageMode)==="enabled";if(!this.publishers.has(t)){const o={},n=new Be(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(s!=null&&s.expirationDelayMs&&(e._expiration_delay_=s.expirationDelayMs),e._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(e,t)),this.publishers.get(t)}set(t,s){this.publishers.set(t,s)}delete(t){return this.publishers.has(t)?(this.publishers.delete(t),!0):!1}async saveToLocalStorage(t=0){if(!(t!==k.saveId&&t%10!=0))try{if(!k.changed||k.saving)return;k.saving=!0,k.changed=!1;const s=Array.from(this.publishers.keys());let i=!1;for(const e of s){const o=this.publishers.get(e);if(!(o!=null&&o._is_savable_))continue;const n=o==null?void 0:o.get();n&&(this.localStorageData[e+"¤lang_"+K.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:o._expiration_delay_,data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(ei,e)}if(k.saving=!1,k.changed){k.saveId++;const e=k.saveId;setTimeout(()=>this.saveToLocalStorage(e),1e3)}}catch{k.saving=!1}}async compress(t,s){const i=new TextEncoder().encode(t),e=window,o=new e.CompressionStream(s),n=o.writable.getWriter();n.write(i),n.close();const a=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(a);let h="";for(let d=0;d<c.length;d++)h+=String.fromCharCode(c[d]);return btoa(h)}async decompress(t,s){const i=atob(t),o=Uint8Array.from(i,d=>d.charCodeAt(0)).buffer,n=window,a=new n.DecompressionStream(s),c=a.writable.getWriter();c.write(o),c.close();const h=await new Response(a.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Fri Feb 14 2025 16:40:33 GMT+0100 (Central European Standard Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);if(typeof window<"u"){const r=window;r[ys+"PublisherManager"]=r[ys+"PublisherManager"]||N}const Io=new Set(["invalidate","onInvalidate","offInvalidate","invalidateForm","onFormInvalidate","offFormInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_formInvalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishFormInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_parentKey_","_value_","_is_savable_","_expiration_delay_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class Be extends si{constructor(t,s=null,i){super(t,s,i);const e=new Proxy(this,{get:function(o,n){if(Io.has(n))return o[n];if(n==Symbol.toPrimitive)return()=>e.get();if(!o._proxies_.has(n)){const a=o._value_[n],c=new Be(He(a)?a:{__value:a},o,n);c._proxies_.set("_parent_",e),o._proxies_.set(n,c)}return o._proxies_.get(n)},set:function(o,n,a){var h;if(n=="_value_")return o._value_=a,!0;if(n=="_cachedGet_")return o._cachedGet_=a,!0;if(n=="_assignmentId_")return o._assignmentId_=a,!0;if(n=="_is_savable_")return o._is_savable_=a,!0;if(n=="_expiration_delay_")return o._expiration_delay_=a,!0;if(n=="_instanceCounter_")return o._instanceCounter_=a,!0;if(!o._proxies_.has(n)){const d=new Be({},o,n);d._proxies_.set("_parent_",e),o._proxies_.set(n,d)}return o._value_[n]!==a&&(o._value_[n]=a,o._publishDynamicFilling_(n,a),(h=o._proxies_.get(n))==null||h.set(He(a)?a:{__value:a})),!0},deleteProperty:function(o,n){var a;return o._publishDynamicFilling_(n,null),(a=o._proxies_.get(n))==null||a.set(null),delete o._value_[n]},has:function(o,n){return n in o._value_&&n!="_lockInternalMutationPublishing_"},defineProperty:function(o,n,a){return a&&"value"in a&&(o._value_[n]=a.value),!0},getOwnPropertyDescriptor:function(o,n){return{enumerable:!0,configurable:!0}},ownKeys:function(o){return o._value_.__value?Object.keys(o._value_.__value):Object.keys(o._value_)}});return e}getProperty(t,s){return t[s]}}class jo extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=si.instances.get(parseInt(this.publisherId)),(t=this.publisher)==null||t.onAssign(this.onAssign)}disconnectedCallback(){var t;(t=this.publisher)==null||t.offAssign(this.onAssign)}}try{customElements.define(De+"-publisher-proxy",jo)}catch{}let ws=(L=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(L.observedElements.keys()).forEach(t=>L.unObserve(t)))}static observe(t){if(!t||!L.enabled||L.observedElements.has(t))return;const s=new MutationObserver(L.onMutation),i={};i.childList=!0,i.subtree=!0,i.attributes=!0,i.attributeFilter=["data-bind"],s.observe(t,i),t.querySelectorAll("[data-bind]").forEach(e=>L.addPublisherListeners(e)),L.observedElements.set(t,s)}static unObserve(t){if(!t)return;const s=this.observedElements.get(t);s&&(s.disconnect(),t.querySelectorAll("[data-bind]").forEach(i=>L.removePublisherListeners(i)))}static onAdded(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.addPublisherListeners(s)):t.childNodes.forEach(s=>L.onAdded(s))}static onRemoved(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.removePublisherListeners(s)):t.childNodes.forEach(s=>L.onRemoved(s))}static onMutation(t){for(const s of t)switch(s.type){case"attributes":L.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach(i=>{L.onAdded(i)}),s.removedNodes.forEach(i=>{L.onRemoved(i)});break}}static removePublisherListeners(t){const s=L.publisherListeners.get(t);s&&(L.publisherListeners.delete(t),s.forEach(i=>{var e;(e=i.publisher)==null||e.offAssign(i.onAssign)}))}static getVariablesDescriptor(t){let s=t.match(/(\$(?:\w+\\?\.?)+)/g);return s?s=s.map(i=>i.replace("$","")):s=[t],s=s.filter(i=>i.length>0),{expression:t.replace("\\",""),variables:s.map(i=>i.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(t){return"attributes"in t?Array.from(t.attributes).filter(s=>s.name.indexOf("::")==0).map(s=>({propertyToUpdate:s.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:L.getVariablesDescriptor(s.value)})):[]}static getSubPublisher(t,s){if(!s)return t;for(const i of s)if(i!="_self_"){if(!t)return null;t=t[i]}return t}static addPublisherListeners(t){L.removePublisherListeners(t);const s=K.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=N.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const a=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of a.variables){const d=h;let p=i;p=L.getSubPublisher(i,d);const g=t,b={publisher:p,onAssign:()=>{const v=a.variables.map(D=>{var u;return(u=L.getSubPublisher(i,D))==null?void 0:u.get()});let y=a.expression,S=!1;if(v.length==1&&a.variables[0].join(".")==y.substring(1)){let D=v[0];D===null&&(D=""),g[c]=D;return}for(let D=0;D<v.length;D++){let u=v[D];const f=a.variables[D];u===null&&(S=!0,u=void 0),y=y.replace("$"+f.join("."),u)}if(y.indexOf("|")!=-1){const D=y.indexOf("|");if(D==0)y=vs.js(y.substring(1));else{const u=y.substring(0,D),f=y.substring(D+1),_=vs[u];y=S?"":_?_(f):y}}else y=S?"":y;g[c]=y}};p==null||p.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ws.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ws);let J=class qt{static shallowEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n];if(i?a!==c:a!=c)return!1}return!0}static deepEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n],h=qt.isObject(a)&&qt.isObject(c),d=i?a!==c:a!=c;if(h&&!qt.deepEqual(a,c)||!h&&d)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static isEmpty(t){return qt.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,s,i=!1){for(const e of s){const o=t[e];if(o===void 0)return;i&&qt.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static traverseDotNotation(t,s,i=!1){return qt.traverse(t,s.split("."),i)}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),qt.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return qt.getURLSearchArray(t,"").join("&")}};const dt=J.traverseDotNotation;/**
1
+ (function(K){typeof define=="function"&&define.amd?define(K):K()})(function(){"use strict";var St,k,L,ko,t,G;let K=class Rt{static getLanguage(){const t=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||t}static getCookies(){return document.cookie.split(";").reduce((t,s)=>{const i=s.indexOf("=");return t[s.substring(0,i).trim()]=s.substring(i+1),t},{})}static everyAncestors(t,s){for(;t;){if(!s(t))return;t=t.parentNode||t.host}}static getScrollableAncestor(t){for(;t;){const s=t;if(s.nodeType===1){const i=window.getComputedStyle(s);if((i==null?void 0:i.overflowY)==="hidden"||(i==null?void 0:i.overflowX)==="hidden")return t}t=t.parentNode||t.host}return null}static getAncestorAttributeValue(t,s){if(!t)return null;for(;!("hasAttribute"in t&&t.hasAttribute(s))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return"hasAttribute"in t?t.getAttribute(s):null}static getApiConfiguration(t){const s=Rt.getAncestorAttributeValue(t,"token"),i=Rt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=Rt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const a=Rt.getAncestorAttributeValue(t,"tokenProvider"),c=Rt.getAncestorAttributeValue(t,"eventsApiToken");s||(o=Rt.getAncestorAttributeValue(t,"userName"),n=Rt.getAncestorAttributeValue(t,"password"));const h=Rt.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),p=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:a,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:p}}static getClosestElement(t,s){for(;!(t.nodeName&&t.nodeName.toLowerCase()===s)&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.nodeName?t:null}static getClosestForm(t){return Rt.getClosestElement(t,"form")}static async loadJS(t){return new Promise(async i=>{const e=document.createElement("script");e.src=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}static async loadCSS(t){return new Promise(async i=>{const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,e.onload=()=>i(!0),e.onerror=()=>i(!0),document.head.appendChild(e)})}};const ti=r=>{const t=document.documentElement,s=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="lang"&&r()}),i={attributes:!0,attributeFilter:["lang"]};s.observe(t,i)};let vs=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=K.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,p){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:p}).format}const[n,a]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),a&&c.push(o(s,"minute",i)(a)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}},Mo=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},rr="sonic";typeof __SONIC_PREFIX__<"u"&&(rr=__SONIC_PREFIX__);let or=rr.replace(/-([a-z])/g,r=>r[1].toUpperCase());const ys=or.charAt(0).toUpperCase()+or.slice(1);function _s(r){return Object.prototype.hasOwnProperty.call(r,"__value")}function He(r){return typeof r=="object"&&r!=null}let De="sonic";typeof __SONIC_PREFIX__>"u"&&(De="sonic"+Math.floor(Math.random()*1e6));const ei=De=="sonic"?"publisher-proxies-data":De+"-publisher-proxies-data";let si=(St=class{constructor(t,s,i){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=t,this.parent=s||null,this._parentKey_=i,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){var t;for(const s in this._proxies_.keys())s!="_parent_"&&((t=this._proxies_.get(s))==null||t.delete());this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),St.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!N.changed){N.changed=!0,N.saveId++;const s=N.saveId;setTimeout(()=>N.getInstance().saveToLocalStorage(s),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>{e(i)}),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,s){this._fillListeners_.forEach(i=>{i[t]!==s&&(i[t]=s)}),this._publishTemplateFilling_(t,s)}_publishTemplateFilling_(t,s){this._templateFillListeners_.forEach(i=>{const e=Object.getOwnPropertyDescriptor(i,t);e&&!e.set&&!e.writable||(i.propertyMap&&i.propertyMap[t]&&(t=i.propertyMap[t]),typeof i[t]<"u"&&i[t]!==s&&(i[t]=s))})}onAssign(t,s=!0){typeof t=="function"&&(this._assignListeners_.has(t)||(this._assignListeners_.add(t),s&&t(this.get())))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){typeof t=="function"&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.add(t)}offFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.delete(t)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){typeof t=="function"&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),typeof this._value_=="object")for(const s in this._value_){let i=s;const e=this._value_[s];t.propertyMap&&t.propertyMap[s]&&(i=t.propertyMap[s]),typeof t[s]<"u"&&t[s]!==e&&(t[i]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const s in this._value_){const i=this._value_[s];t[s]!==i&&(t[s]=i)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,s=!1){var e,o,n;if(this._value_===t||this._value_&&t&&_s(this._value_)&&_s(t)&&this._value_.__value===t.__value)return!0;this._value_=He(t)?t:{__value:t},this._cachedGet_=void 0;const i=_s(this._value_);if(this._parentKey_&&this.parent){const a=_s(this._value_)?this._value_.__value:this._value_;if(((e=this.parent)==null?void 0:e.get())==null&&((o=this.parent)==null?void 0:o.get())==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:a});else{const c=[];c[Number(this._parentKey_)]=a,this.parent.set(c)}else this.parent._value_[this._parentKey_]=a}if(i)return this._publishAssignement_(s),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const a in this._value_)this._value_[a]===void 0&&delete this._value_[a];if(this._proxies_.forEach((a,c)=>{const h=this._value_[c];c!="_parent_"&&h===void 0&&h!==null&&isNaN(Number(c))&&(a.set(null),this._publishDynamicFilling_(c,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),He(this._value_))for(const a in this._value_){const c=t[a],d=He(c)?c:{__value:c};if(!this._proxies_.has(a)){this._publishDynamicFilling_(a,c);continue}(n=this._proxies_.get(a))==null||n.set(d,!0),this._publishDynamicFilling_(a,c)}return!0}get(){if(this._cachedGet_!==void 0)return this._cachedGet_;if(N.modifiedCollectore.length>0&&N.modifiedCollectore[0].add(this),Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return this._cachedGet_=t??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(St.instancesCounter++,this._instanceCounter_=St.instancesCounter),St.instances.set(this._instanceCounter_,this),"<"+De+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+De+"-publisher-proxy>"}},St.instances=new Map,St.instancesCounter=0,St),N=(k=class{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],k.instance!=null)throw"Singleton / use getInstance";k.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}async cleanStorageData(){return new Promise(t=>{(async()=>{try{let i=localStorage.getItem(ei),e=null;if(i&&(e=await this.decompress(i,"gzip")),e)try{this.localStorageData=JSON.parse(e)}catch{this.localStorageData={}}else i=await this.compress("{}","gzip"),localStorage.setItem(ei,i),this.localStorageData={};const o=1e3*60*60*12;for(const n in this.localStorageData){const a=this.localStorageData[n],c=new Date().getTime()-(a.expirationDelayMs||o);a.lastModifiationMS<c&&delete this.localStorageData[n]}t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(t){if(t){const s=k.instances.get(t);return s||(console.warn("No PublisherManager instance registered with id:",t,"creating new one"),new k)}return k.instance==null?new k:k.instance}static registerInstance(t,s){k.instances.has(t)&&console.warn("PublisherManager instance already registered with id: ",t),k.instances.set(t,s)}static get(t,s){return k.getInstance().get(t,s)}static collectModifiedPublisher(){k.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return k.modifiedCollectore.shift()}static delete(t){return t?k.getInstance().delete(t):!1}async setLocalData(t,s){var i;await this.isLocalStrorageReady,t.set(((i=this.localStorageData[s+"¤lang_"+K.getLanguage()])==null?void 0:i.data)||t.get())}get(t,s){const i=(s==null?void 0:s.localStorageMode)==="enabled";if(!this.publishers.has(t)){const o={},n=new Be(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(s!=null&&s.expirationDelayMs&&(e._expiration_delay_=s.expirationDelayMs),e._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(e,t)),this.publishers.get(t)}set(t,s){this.publishers.set(t,s)}delete(t){return this.publishers.has(t)?(this.publishers.delete(t),!0):!1}async saveToLocalStorage(t=0){if(!(t!==k.saveId&&t%10!=0))try{if(!k.changed||k.saving)return;k.saving=!0,k.changed=!1;const s=Array.from(this.publishers.keys());let i=!1;for(const e of s){const o=this.publishers.get(e);if(!(o!=null&&o._is_savable_))continue;const n=o==null?void 0:o.get();n&&(this.localStorageData[e+"¤lang_"+K.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:o._expiration_delay_,data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(ei,e)}if(k.saving=!1,k.changed){k.saveId++;const e=k.saveId;setTimeout(()=>this.saveToLocalStorage(e),1e3)}}catch{k.saving=!1}}async compress(t,s){const i=new TextEncoder().encode(t),e=window,o=new e.CompressionStream(s),n=o.writable.getWriter();n.write(i),n.close();const a=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(a);let h="";for(let d=0;d<c.length;d++)h+=String.fromCharCode(c[d]);return btoa(h)}async decompress(t,s){const i=atob(t),o=Uint8Array.from(i,d=>d.charCodeAt(0)).buffer,n=window,a=new n.DecompressionStream(s),c=a.writable.getWriter();c.write(o),c.close();const h=await new Response(a.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Wed Feb 19 2025 17:24:32 GMT+0100 (Central European Standard Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);if(typeof window<"u"){const r=window;r[ys+"PublisherManager"]=r[ys+"PublisherManager"]||N}const Io=new Set(["invalidate","onInvalidate","offInvalidate","invalidateForm","onFormInvalidate","offFormInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_formInvalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishFormInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_parentKey_","_value_","_is_savable_","_expiration_delay_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class Be extends si{constructor(t,s=null,i){super(t,s,i);const e=new Proxy(this,{get:function(o,n){if(Io.has(n))return o[n];if(n==Symbol.toPrimitive)return()=>e.get();if(!o._proxies_.has(n)){const a=o._value_[n],c=new Be(He(a)?a:{__value:a},o,n);c._proxies_.set("_parent_",e),o._proxies_.set(n,c)}return o._proxies_.get(n)},set:function(o,n,a){var h;if(n=="_value_")return o._value_=a,!0;if(n=="_cachedGet_")return o._cachedGet_=a,!0;if(n=="_assignmentId_")return o._assignmentId_=a,!0;if(n=="_is_savable_")return o._is_savable_=a,!0;if(n=="_expiration_delay_")return o._expiration_delay_=a,!0;if(n=="_instanceCounter_")return o._instanceCounter_=a,!0;if(!o._proxies_.has(n)){const d=new Be({},o,n);d._proxies_.set("_parent_",e),o._proxies_.set(n,d)}return o._value_[n]!==a&&(o._value_[n]=a,o._publishDynamicFilling_(n,a),(h=o._proxies_.get(n))==null||h.set(He(a)?a:{__value:a})),!0},deleteProperty:function(o,n){var a;return o._publishDynamicFilling_(n,null),(a=o._proxies_.get(n))==null||a.set(null),delete o._value_[n]},has:function(o,n){return n in o._value_&&n!="_lockInternalMutationPublishing_"},defineProperty:function(o,n,a){return a&&"value"in a&&(o._value_[n]=a.value),!0},getOwnPropertyDescriptor:function(o,n){return{enumerable:!0,configurable:!0}},ownKeys:function(o){return o._value_.__value?Object.keys(o._value_.__value):Object.keys(o._value_)}});return e}getProperty(t,s){return t[s]}}class jo extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=si.instances.get(parseInt(this.publisherId)),(t=this.publisher)==null||t.onAssign(this.onAssign)}disconnectedCallback(){var t;(t=this.publisher)==null||t.offAssign(this.onAssign)}}try{customElements.define(De+"-publisher-proxy",jo)}catch{}let ws=(L=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(L.observedElements.keys()).forEach(t=>L.unObserve(t)))}static observe(t){if(!t||!L.enabled||L.observedElements.has(t))return;const s=new MutationObserver(L.onMutation),i={};i.childList=!0,i.subtree=!0,i.attributes=!0,i.attributeFilter=["data-bind"],s.observe(t,i),t.querySelectorAll("[data-bind]").forEach(e=>L.addPublisherListeners(e)),L.observedElements.set(t,s)}static unObserve(t){if(!t)return;const s=this.observedElements.get(t);s&&(s.disconnect(),t.querySelectorAll("[data-bind]").forEach(i=>L.removePublisherListeners(i)))}static onAdded(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.addPublisherListeners(s)):t.childNodes.forEach(s=>L.onAdded(s))}static onRemoved(t){t.hasAttribute&&t.hasAttribute("data-bind")&&L.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(s=>L.removePublisherListeners(s)):t.childNodes.forEach(s=>L.onRemoved(s))}static onMutation(t){for(const s of t)switch(s.type){case"attributes":L.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach(i=>{L.onAdded(i)}),s.removedNodes.forEach(i=>{L.onRemoved(i)});break}}static removePublisherListeners(t){const s=L.publisherListeners.get(t);s&&(L.publisherListeners.delete(t),s.forEach(i=>{var e;(e=i.publisher)==null||e.offAssign(i.onAssign)}))}static getVariablesDescriptor(t){let s=t.match(/(\$(?:\w+\\?\.?)+)/g);return s?s=s.map(i=>i.replace("$","")):s=[t],s=s.filter(i=>i.length>0),{expression:t.replace("\\",""),variables:s.map(i=>i.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(t){return"attributes"in t?Array.from(t.attributes).filter(s=>s.name.indexOf("::")==0).map(s=>({propertyToUpdate:s.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:L.getVariablesDescriptor(s.value)})):[]}static getSubPublisher(t,s){if(!s)return t;for(const i of s)if(i!="_self_"){if(!t)return null;t=t[i]}return t}static addPublisherListeners(t){L.removePublisherListeners(t);const s=K.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!s)return;const i=N.getInstance().get(s),e=L.getDataBindItems(t),o=[];e.forEach(n=>{const a=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of a.variables){const d=h;let p=i;p=L.getSubPublisher(i,d);const g=t,b={publisher:p,onAssign:()=>{const v=a.variables.map(D=>{var u;return(u=L.getSubPublisher(i,D))==null?void 0:u.get()});let y=a.expression,S=!1;if(v.length==1&&a.variables[0].join(".")==y.substring(1)){let D=v[0];D===null&&(D=""),g[c]=D;return}for(let D=0;D<v.length;D++){let u=v[D];const f=a.variables[D];u===null&&(S=!0,u=void 0),y=y.replace("$"+f.join("."),u)}if(y.indexOf("|")!=-1){const D=y.indexOf("|");if(D==0)y=vs.js(y.substring(1));else{const u=y.substring(0,D),f=y.substring(D+1),_=vs[u];y=S?"":_?_(f):y}}else y=S?"":y;g[c]=y}};p==null||p.onAssign(b.onAssign),o.push(b)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ws.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ws);let J=class qt{static shallowEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n];if(i?a!==c:a!=c)return!1}return!0}static deepEqual(t,s,i=!0){const e=Object.keys(t),o=Object.keys(s);if(e.length!==o.length&&i)return!1;for(const n of e){const a=t[n],c=s[n],h=qt.isObject(a)&&qt.isObject(c),d=i?a!==c:a!=c;if(h&&!qt.deepEqual(a,c)||!h&&d)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static isEmpty(t){return qt.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,s,i=!1){for(const e of s){const o=t[e];if(o===void 0)return;i&&qt.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static traverseDotNotation(t,s,i=!1){return qt.traverse(t,s.split("."),i)}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),qt.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return qt.getURLSearchArray(t,"").join("&")}};const dt=J.traverseDotNotation;/**
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
@@ -3870,7 +3870,7 @@ ${this.value}</textarea
3870
3870
  --sc-table-td-border-b: var(--sc-table-bw) solid
3871
3871
  var(--sc-table-border-color);
3872
3872
  }
3873
- `],Ue([l({type:String,reflect:!0})],oe.prototype,"size",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"bordered",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"rounded",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"noCustomScroll",2),Ue([l({type:String})],oe.prototype,"maxHeight",2),oe=Ue([x(Sd)],oe);const So="AES-CBC",Od=256;async function Dd(){return crypto.subtle.generateKey({name:So,length:Od},!0,["encrypt","decrypt"])}function kd(r){return btoa(String.fromCharCode(...new Uint8Array(r)))}async function Ld(r,t,s){const i=new TextEncoder().encode(r),e=await crypto.subtle.encrypt({name:So,iv:s},t,i);return kd(e)}var Ed=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,Qs=(r,t,s,i)=>{for(var e=i>1?void 0:i?Nd(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Ed(t,s,e),e};const Td="supersoniks_altcha",Md="Si2\\]X8M4!n9DCLd";let Oo=!1;const Id="sonic-captcha";let Ve=class extends Gt(w){constructor(){super(...arguments),this.key="",this.action=null,this.zIndex=9999,this.onCaptchaTokenChanged=r=>{r=="request_token"&&(this.formPublisher&&(this.formPublisher.captchaToken=""),this.requestToken())},this.maxNumber=5e4,this.chalengeUrl="https://altcha.supersoniks.org/get-challenge"}connectedCallback(){if(!Oo){const r=document.createElement("script");r.type="module",this.setAttribute("async",""),this.setAttribute("defer",""),r.src="https://eu.altcha.org/js/latest/altcha.min.js",Oo=!0,document.head.appendChild(r)}this.generateEncryptedKey(),super.connectedCallback(),this.formPublisher=st.get(this.getAncestorAttributeValue("headersDataProvider")??this.getAncestorAttributeValue("formDataProvider")),this.formPublisher&&!this.formPublisher.captchaToken.get()&&(this.formPublisher.needsCaptchaValidation=!0,this.formPublisher.captchaToken.onAssign(this.onCaptchaTokenChanged))}disconnectedCallback(){this.formPublisher&&(this.formPublisher.captchaToken.offAssign(this.onCaptchaTokenChanged),this.formPublisher.captchaToken=""),super.disconnectedCallback()}requestToken(){var s;if(!this.formPublisher)return;const r=this.shadowRoot.querySelector("form");if(!r)return;const t=new FormData(r);this.formPublisher.captchaKey=this.key,this.formPublisher.captchaToken=((s=t.get("altcha"))==null?void 0:s.toString())||""}async generateEncryptedKey(){if(this.key)return;const r=await Dd(),t=new TextEncoder().encode(Md),s=await Ld(Td,r,t);this.key=s}render(){if(!this.key)return A;const t=Kt.getLanguage().match("^fr\\b")?{aria:"Visitez altcha.org",error:"La vérification a échoué, réessayez plus tard.",expired:"La vérification a expiré, réessayez.",footer:"Protégé par Altcha",label:"Je ne suis pas un robot.",verified:"Vérifié",verifying:"Vérification en cours...",wait:"Vérification en cours… Veuillez patienter."}:{aria:"Visit altcha.org",error:"Verification failed, try again later.",expired:"Verification expired, try again.",footer:"Protected by Altcha",label:"I'm not a robot.",verified:"Verified",verifying:"Verifying...",wait:"Verifying... Please wait."};return m`
3873
+ `],Ue([l({type:String,reflect:!0})],oe.prototype,"size",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"bordered",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"rounded",2),Ue([l({type:Boolean,reflect:!0})],oe.prototype,"noCustomScroll",2),Ue([l({type:String})],oe.prototype,"maxHeight",2),oe=Ue([x(Sd)],oe);const So="AES-CBC",Od=256;async function Dd(){return crypto.subtle.generateKey({name:So,length:Od},!0,["encrypt","decrypt"])}function kd(r){return btoa(String.fromCharCode(...new Uint8Array(r)))}async function Ld(r,t,s){const i=new TextEncoder().encode(r),e=await crypto.subtle.encrypt({name:So,iv:s},t,i);return kd(e)}var Ed=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,Qs=(r,t,s,i)=>{for(var e=i>1?void 0:i?Nd(t,s):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(i?n(t,s,e):n(e))||e);return i&&e&&Ed(t,s,e),e};const Td="supersoniks_altcha",Md="Si2\\]X8M4!n9DCLd";let Oo=!1;const Id="sonic-captcha";let Ve=class extends Gt(w){constructor(){super(...arguments),this.key="",this.action=null,this.zIndex=9999,this.onCaptchaTokenChanged=r=>{r=="request_token"&&(this.formPublisher&&(this.formPublisher.captchaToken=""),this.requestToken())},this.maxNumber=5e4,this.chalengeUrl="https://altcha.supersoniks.org/get-challenge"}connectedCallback(){if(document.location.protocol.includes("https")){if(!Oo){const r=document.createElement("script");r.type="module",this.setAttribute("async",""),this.setAttribute("defer",""),r.src="https://eu.altcha.org/js/latest/altcha.min.js",Oo=!0,document.head.appendChild(r)}this.generateEncryptedKey(),super.connectedCallback(),this.formPublisher=st.get(this.getAncestorAttributeValue("headersDataProvider")??this.getAncestorAttributeValue("formDataProvider")),this.formPublisher&&!this.formPublisher.captchaToken.get()&&(this.formPublisher.needsCaptchaValidation=!0,this.formPublisher.captchaToken.onAssign(this.onCaptchaTokenChanged))}}disconnectedCallback(){this.formPublisher&&(this.formPublisher.captchaToken.offAssign(this.onCaptchaTokenChanged),this.formPublisher.captchaToken=""),super.disconnectedCallback()}requestToken(){var s;if(!this.formPublisher)return;const r=this.shadowRoot.querySelector("form");if(!r)return;const t=new FormData(r);this.formPublisher.captchaKey=this.key,this.formPublisher.captchaToken=((s=t.get("altcha"))==null?void 0:s.toString())||""}async generateEncryptedKey(){if(this.key)return;const r=await Dd(),t=new TextEncoder().encode(Md),s=await Ld(Td,r,t);this.key=s}render(){if(!this.key)return A;const t=Kt.getLanguage().match("^fr\\b")?{aria:"Visitez altcha.org",error:"La vérification a échoué, réessayez plus tard.",expired:"La vérification a expiré, réessayez.",footer:"Protégé par Altcha",label:"Je ne suis pas un robot.",verified:"Vérifié",verifying:"Vérification en cours...",wait:"Vérification en cours… Veuillez patienter."}:{aria:"Visit altcha.org",error:"Verification failed, try again later.",expired:"Verification expired, try again.",footer:"Protected by Altcha",label:"I'm not a robot.",verified:"Verified",verifying:"Verifying...",wait:"Verifying... Please wait."};return m`
3874
3874
  <form>
3875
3875
  <altcha-widget
3876
3876
  challengeurl="${this.chalengeUrl}?key=${this.key}&maxNumber=${this.maxNumber}"
@@ -556,7 +556,7 @@ let T = (k = class {
556
556
  const h = await new Response(a.readable).arrayBuffer();
557
557
  return new TextDecoder().decode(h);
558
558
  }
559
- }, k.buildDate = "Fri Feb 14 2025 16:40:33 GMT+0100 (Central European Standard Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
559
+ }, k.buildDate = "Wed Feb 19 2025 17:24:32 GMT+0100 (Central European Standard Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
560
560
  if (typeof window < "u") {
561
561
  const r = window;
562
562
  r[Cs + "PublisherManager"] = r[Cs + "PublisherManager"] || T;
@@ -12296,15 +12296,17 @@ let Me = class extends se(w) {
12296
12296
  }, this.maxNumber = 5e4, this.chalengeUrl = "https://altcha.supersoniks.org/get-challenge";
12297
12297
  }
12298
12298
  connectedCallback() {
12299
- if (!Hr) {
12300
- const r = document.createElement("script");
12301
- r.type = "module", this.setAttribute("async", ""), this.setAttribute("defer", ""), r.src = "https://eu.altcha.org/js/latest/altcha.min.js", Hr = !0, document.head.appendChild(r);
12299
+ if (document.location.protocol.includes("https")) {
12300
+ if (!Hr) {
12301
+ const r = document.createElement("script");
12302
+ r.type = "module", this.setAttribute("async", ""), this.setAttribute("defer", ""), r.src = "https://eu.altcha.org/js/latest/altcha.min.js", Hr = !0, document.head.appendChild(r);
12303
+ }
12304
+ this.generateEncryptedKey(), super.connectedCallback(), this.formPublisher = st.get(
12305
+ this.getAncestorAttributeValue("headersDataProvider") ?? this.getAncestorAttributeValue("formDataProvider")
12306
+ ), this.formPublisher && !this.formPublisher.captchaToken.get() && (this.formPublisher.needsCaptchaValidation = !0, this.formPublisher.captchaToken.onAssign(
12307
+ this.onCaptchaTokenChanged
12308
+ ));
12302
12309
  }
12303
- this.generateEncryptedKey(), super.connectedCallback(), this.formPublisher = st.get(
12304
- this.getAncestorAttributeValue("headersDataProvider") ?? this.getAncestorAttributeValue("formDataProvider")
12305
- ), this.formPublisher && !this.formPublisher.captchaToken.get() && (this.formPublisher.needsCaptchaValidation = !0, this.formPublisher.captchaToken.onAssign(
12306
- this.onCaptchaTokenChanged
12307
- ));
12308
12310
  }
12309
12311
  disconnectedCallback() {
12310
12312
  this.formPublisher && (this.formPublisher.captchaToken.offAssign(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "3.1.59",
3
+ "version": "3.1.61",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "",
@@ -11,7 +11,9 @@
11
11
  "build": "tsc --build src/tsconfig.json && vite build",
12
12
  "build-docs": "LIB_NAME=docs vite build",
13
13
  "postbuild-docs": "node scripts/post-build-docs.js",
14
- "prepublishOnly": "node scripts/pre-publish.mjs"
14
+ "prepublishOnly": "node scripts/pre-publish.mjs",
15
+ "microTests": "node scripts/microTests.js",
16
+ "test": "vitest"
15
17
  },
16
18
  "exports": {
17
19
  "./core/components/ui/icon/icons.json": "./src/core/components/ui/icon/icons.json",
@@ -272,6 +274,7 @@
272
274
  "./utils/Utils": "./src/core/utils/Utils.ts",
273
275
  "./utils/aesCrypto": "./src/core/utils/aesCrypto.ts",
274
276
  "./utils/api": "./src/core/utils/api.ts",
277
+ "./utils/route.spec": "./src/core/utils/route.spec.ts",
275
278
  "./utils/route": "./src/core/utils/route.ts",
276
279
  "./utils/url-pattern": "./src/core/utils/url-pattern.ts",
277
280
  "./code": "./src/docs/code.ts",
@@ -298,6 +301,7 @@
298
301
  "altcha": "^1.0.7",
299
302
  "autoprefixer": "^10.4.19",
300
303
  "intl": "^1.2.5",
304
+ "jsdom": "^26.0.0",
301
305
  "lit": "^3.1.3",
302
306
  "marked": "^12.0.1",
303
307
  "marked-gfm-heading-id": "^3.1.3",
@@ -311,7 +315,8 @@
311
315
  "dependencies": {
312
316
  "@lit-labs/motion": "^1.0.7",
313
317
  "@lit-labs/observers": "^2.0.2",
314
- "url-pattern": "^1.0.3"
318
+ "url-pattern": "^1.0.3",
319
+ "vitest": "^3.0.6"
315
320
  },
316
321
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
317
322
  }
@@ -1,4 +1,5 @@
1
- import {expect} from "@jest/globals";
1
+ // sum.test.ts
2
+ import { expect } from "vitest";
2
3
  import TestUtils from "@supersoniks/concorde/test-utils/TestUtils";
3
4
  import "./if";
4
5
 
@@ -10,7 +11,8 @@ test("shows ''Some Content'' condition = true set by property accessor", async (
10
11
  const elt: any = create();
11
12
  elt.condition = true;
12
13
  await elt.updated();
13
- const renderedText = elt.shadowRoot.children[0].assignedNodes()[0].textContent;
14
+ const renderedText =
15
+ elt.shadowRoot.children[0].assignedNodes()[0].textContent;
14
16
  expect(renderedText).toBe("Some Content");
15
17
  });
16
18
 
@@ -18,7 +20,9 @@ test("shows nothing condition = false set by property accessor", async () => {
18
20
  const elt: any = create();
19
21
  elt.condition = false;
20
22
  await elt.updated();
21
- const children = Array.from(elt.shadowRoot.children).filter((elt: any) => elt.nodeName.toLowerCase() != "style");
23
+ const children = Array.from(elt.shadowRoot.children).filter(
24
+ (elt: any) => elt.nodeName.toLowerCase() != "style"
25
+ );
22
26
  const length = children.length;
23
27
  expect(length).toBe(0);
24
28
  });
@@ -27,14 +31,17 @@ test("shows ''Some Content'' condition = true set by attribute", async () => {
27
31
  const elt: any = create();
28
32
  elt.setAttribute("condition", "");
29
33
  await elt.updated();
30
- const renderedText = elt.shadowRoot.children[0].assignedNodes()[0].textContent;
34
+ const renderedText =
35
+ elt.shadowRoot.children[0].assignedNodes()[0].textContent;
31
36
  expect(renderedText).toBe("Some Content");
32
37
  });
33
38
 
34
39
  test("shows nothing condition not set", async () => {
35
40
  const elt: any = create();
36
41
  await elt.updated();
37
- const children = Array.from(elt.shadowRoot.children).filter((elt: any) => elt.nodeName.toLowerCase() != "style");
42
+ const children = Array.from(elt.shadowRoot.children).filter(
43
+ (elt: any) => elt.nodeName.toLowerCase() != "style"
44
+ );
38
45
  const length = children.length;
39
46
  expect(length).toBe(0);
40
47
  });
@@ -61,6 +61,9 @@ export class Captcha extends Subscriber(LitElement) {
61
61
  }
62
62
  };
63
63
  connectedCallback() {
64
+ if (!document.location.protocol.includes("https")) {
65
+ return;
66
+ }
64
67
  if (!scriptAdded) {
65
68
  const script = document.createElement("script");
66
69
  script.type = "module";
@@ -0,0 +1,165 @@
1
+ // route.test.ts
2
+ import { describe, it, expect, beforeEach } from "vitest";
3
+ import { route, Routes } from "./route";
4
+
5
+ function matchesCurrentPathTest(
6
+ location: string,
7
+ testRoute: string,
8
+ result: boolean
9
+ ) {
10
+ it(`matchesCurrentPath renvoie ${result} si location vaut ${location} et route vaut ${testRoute}`, () => {
11
+ window.history.pushState({}, "", location);
12
+ Routes.register({ page: testRoute });
13
+ expect(route("page").matchesCurrentPath()).toBe(result);
14
+ });
15
+ }
16
+
17
+ describe("Route", () => {
18
+ // Avant chaque test, on réinitialise l'URL et les routes enregistrées
19
+ beforeEach(() => {
20
+ window.history.back();
21
+ // On positionne l'URL par défaut sur la racine
22
+ window.history.pushState({}, "", "/");
23
+ // On "réinitialise" les routes en enregistrant un objet vide (pour éviter des interférences entre tests)
24
+ Routes.register({}, "");
25
+ });
26
+
27
+ describe("Méthodes de Route", () => {
28
+ //ex : matchesCurrentPathTest(location, testedRoute, expectedResult);
29
+ matchesCurrentPathTest("/pageA", "/pageB", false);
30
+ matchesCurrentPathTest("#page", "/", false);
31
+ matchesCurrentPathTest("/page", "/", false);
32
+ matchesCurrentPathTest("/", "/page", false);
33
+ matchesCurrentPathTest("/", "#page", false);
34
+ matchesCurrentPathTest("/a/b/page", "/page", true);
35
+ matchesCurrentPathTest("/page", "a/b/page", false);
36
+ matchesCurrentPathTest("/page", "/page", true);
37
+ matchesCurrentPathTest("/page/124", "/page/:id", true);
38
+ matchesCurrentPathTest("/page", "/page/:id", false);
39
+ //Optionalité des paramètres
40
+ matchesCurrentPathTest("/page/", "/page/(:id)", true);
41
+ matchesCurrentPathTest("/page/1234", "/page/(:id)", true);
42
+ //
43
+ matchesCurrentPathTest("/page", "/page/a/:id", false);
44
+ //
45
+ //Le match ne pas en compter la query string
46
+ //
47
+ matchesCurrentPathTest("/page?query1=hey&query2=hello", "/page", true);
48
+
49
+ return;
50
+ it("fill remplace les paramètres dynamiques de la route", () => {
51
+ Routes.register({ user: "/user/:id" });
52
+ const testedRoute = route("user");
53
+ testedRoute.fill({ id: "123" });
54
+ expect(route.toString()).toBe("/user/123");
55
+ });
56
+
57
+ it("query ajoute des paramètres de requête", () => {
58
+ Routes.register({ home: "/home" });
59
+ const testedRoute = route("home");
60
+ testedRoute.query({ foo: "bar" });
61
+ // On vérifie que le résultat contient bien le paramètre "foo=bar"
62
+ expect(testedRoute.toString()).toMatch(/\?foo=bar/);
63
+ });
64
+
65
+ it("hash ajoute un fragment à l'URL", () => {
66
+ Routes.register({ home: "/home" });
67
+ const testedRoute = route("home");
68
+ testedRoute.hash("section");
69
+ expect(testedRoute.toString()).toMatch(/#section$/);
70
+ });
71
+
72
+ it("appendPath ajoute un segment de chemin", () => {
73
+ Routes.register({ home: "/home" });
74
+ const testedRoute = route("home");
75
+ testedRoute.appendPath("profile");
76
+ expect(testedRoute.toString()).toBe("/home/profile");
77
+ });
78
+
79
+ it("hasHash et getHash détectent et renvoient le hash de l'URL", () => {
80
+ Routes.register({ home: "/home" });
81
+ const testedRoute = route("home");
82
+ testedRoute.hash("section");
83
+ expect(testedRoute.hasHash()).toBe(true);
84
+ expect(testedRoute.getHash()).toBe("#section");
85
+ });
86
+
87
+ it("hasSameBaseAs retourne true pour des routes ayant la même base", () => {
88
+ Routes.register({ home: "/home" });
89
+ const testedRoute1 = route("home");
90
+ const testedRoute2 = route("home");
91
+ // On ajoute des éléments différents qui n'influenceront pas la base (pathname)
92
+ testedRoute1.query({ foo: "bar" });
93
+ testedRoute2.hash("section");
94
+ expect(testedRoute1.hasSameBaseAs(testedRoute2)).toBe(true);
95
+ });
96
+
97
+ it("hasSameBaseAs retourne false si les bases sont différentes ou si la route comparée est undefined", () => {
98
+ Routes.register({ home: "/home", about: "/about" });
99
+ const testedRoute1 = route("home");
100
+ const testedRoute2 = route("about");
101
+ expect(testedRoute1.hasSameBaseAs(testedRoute2)).toBe(false);
102
+ expect(testedRoute1.hasSameBaseAs(undefined as any)).toBe(false);
103
+ });
104
+
105
+ it("goTo modifie window.location.href", () => {
106
+ // Sauvegarde de la valeur originale de window.location
107
+ const originalLocation = window.location;
108
+ let hrefValue = "";
109
+ // Création d'un objet factice pour window.location avec un getter et setter pour href
110
+ const fakeLocation = {
111
+ get href() {
112
+ return hrefValue;
113
+ },
114
+ set href(val: string) {
115
+ hrefValue = val;
116
+ },
117
+ origin: "http://localhost",
118
+ };
119
+
120
+ // Redéfinition de window.location avec notre objet factice
121
+ Object.defineProperty(window, "location", {
122
+ configurable: true,
123
+ enumerable: true,
124
+ value: fakeLocation,
125
+ });
126
+
127
+ Routes.register({ home: "/home" });
128
+ const testedRoute = route("home");
129
+ testedRoute.goTo();
130
+
131
+ expect(hrefValue).toBe("/home");
132
+
133
+ // Restauration de window.location
134
+ Object.defineProperty(window, "location", {
135
+ configurable: true,
136
+ enumerable: true,
137
+ value: originalLocation,
138
+ });
139
+ });
140
+ });
141
+ /*
142
+ describe("Méthodes statiques de Routes", () => {
143
+ it("Routes.get renvoie la route correcte avec propertyMap", () => {
144
+ Routes.register({ user: "/user/:id" });
145
+ const result = Routes.get("user", { propertyMap: { id: "456" } });
146
+ expect(result).toBe("/user/456");
147
+ });
148
+
149
+ it("Routes.get renvoie la route correcte avec query et hash", () => {
150
+ Routes.register({ home: "/home" });
151
+ const result = Routes.get("home", {
152
+ query: { foo: "bar" },
153
+ hash: "section",
154
+ });
155
+ expect(result).toMatch(/\?foo=bar/);
156
+ expect(result).toMatch(/#section$/);
157
+ });
158
+
159
+ it("fillURLPattern remplit correctement une URL avec paramètres", () => {
160
+ const filled = Routes.fillURLPattern("/user/:id", { id: "789" });
161
+ expect(filled).toBe("/user/789");
162
+ });
163
+ });
164
+ */
165
+ });
@@ -15,13 +15,22 @@ export class Route<RoutesData = any> {
15
15
  }
16
16
 
17
17
  extract() {
18
- const pattern = new URLPattern("(/)*" + this.route + "*");
19
- const currentUrl = window.location.href.replace(window.location.origin, "");
18
+ const pattern = new URLPattern("(/)*" + this.route);
19
+ const currentUrl = document.location.pathname + document.location.hash;
20
20
  const matches = pattern.match(currentUrl);
21
21
  return matches;
22
22
  }
23
23
 
24
+ /**
25
+ * @deprecated
26
+ * @see matchesCurrentPath
27
+ * @returns {boolean}
28
+ */
29
+
24
30
  matchesLocation() {
31
+ return this.matchesCurrentPath();
32
+ }
33
+ matchesCurrentPath() {
25
34
  return this.extract() !== null;
26
35
  }
27
36
 
@@ -1,10 +1,5 @@
1
- import {jest} from "@jest/globals";
2
- import IntlPolyfill from "intl";
3
- import "intl/locale-data/jsonp/fr";
4
-
5
1
  export default class TestUtils {
6
2
  static bootstrap(html: string) {
7
- jest.spyOn(global.Intl, "DateTimeFormat").mockImplementation(() => new IntlPolyfill.DateTimeFormat());
8
3
  const container = document.createElement("div");
9
4
  container.innerHTML = html;
10
5
  document.body.appendChild(container);
package/src/tsconfig.json CHANGED
@@ -772,6 +772,9 @@
772
772
  "./utils/api": [
773
773
  "/sites/concorde/src/core/utils/api.ts"
774
774
  ],
775
+ "./utils/route.spec": [
776
+ "/sites/concorde/src/core/utils/route.spec.ts"
777
+ ],
775
778
  "./utils/route": [
776
779
  "/sites/concorde/src/core/utils/route.ts"
777
780
  ],
@@ -1 +1 @@
1
- {"root":["./components.ts","./concorde-loaded.ts","./decorators.ts","./directives.ts","./index.ts","./mixins.ts","./utils.ts","./core/core.ts","./core/_types/types.ts","./core/components/functional/functional.ts","./core/components/functional/date/date.ts","./core/components/functional/example/example.ts","./core/components/functional/fetch/fetch.ts","./core/components/functional/if/if.test.ts","./core/components/functional/if/if.ts","./core/components/functional/list/list.ts","./core/components/functional/mix/mix.ts","./core/components/functional/queue/queue.ts","./core/components/functional/router/redirect.ts","./core/components/functional/router/router.ts","./core/components/functional/sdui/SDUIDescriptorTransformer.ts","./core/components/functional/sdui/sdui-utils.ts","./core/components/functional/sdui/sdui.ts","./core/components/functional/sdui/types.ts","./core/components/functional/sonic-scope/sonic-scope.ts","./core/components/functional/states/states.ts","./core/components/functional/submit/submit.ts","./core/components/functional/subscriber/subscriber.ts","./core/components/functional/translation/translation.ts","./core/components/functional/value/value.ts","./core/components/ui/ui.ts","./core/components/ui/_css/scroll.ts","./core/components/ui/_css/shadow.ts","./core/components/ui/_css/size.ts","./core/components/ui/_css/type.ts","./core/components/ui/alert/alert.ts","./core/components/ui/alert-messages/alert-messages.ts","./core/components/ui/badge/badge.ts","./core/components/ui/button/button.ts","./core/components/ui/captcha/captcha.ts","./core/components/ui/card/card-footer.ts","./core/components/ui/card/card-header-descripton.ts","./core/components/ui/card/card-header.ts","./core/components/ui/card/card-main.ts","./core/components/ui/card/card.ts","./core/components/ui/divider/divider.ts","./core/components/ui/form/checkbox/checkbox.ts","./core/components/ui/form/css/form-control.ts","./core/components/ui/form/fieldset/fieldset.ts","./core/components/ui/form/fieldset/legend-description.ts","./core/components/ui/form/fieldset/legend.ts","./core/components/ui/form/form-actions/form-actions.ts","./core/components/ui/form/form-layout/form-layout.ts","./core/components/ui/form/input/input.ts","./core/components/ui/form/input/password-helper.ts","./core/components/ui/form/input/same-value-helper.ts","./core/components/ui/form/input-autocomplete/input-autocomplete.ts","./core/components/ui/form/radio/radio.ts","./core/components/ui/form/select/select.ts","./core/components/ui/form/switch/switch.ts","./core/components/ui/form/textarea/textarea.ts","./core/components/ui/group/group.ts","./core/components/ui/icon/icon.stories.ts","./core/components/ui/icon/icon.ts","./core/components/ui/icon/icons.ts","./core/components/ui/image/image.ts","./core/components/ui/link/link.ts","./core/components/ui/loader/loader.stories.ts","./core/components/ui/loader/loader.ts","./core/components/ui/loader/styles/fixed.ts","./core/components/ui/loader/styles/inline.ts","./core/components/ui/menu/menu-item.ts","./core/components/ui/menu/menu.ts","./core/components/ui/modal/modal-actions.ts","./core/components/ui/modal/modal-close.ts","./core/components/ui/modal/modal-content.ts","./core/components/ui/modal/modal-subtitle.ts","./core/components/ui/modal/modal-title.ts","./core/components/ui/modal/modal.stories.ts","./core/components/ui/modal/modal.ts","./core/components/ui/pop/pop.ts","./core/components/ui/progress/progress.ts","./core/components/ui/table/table-caption.ts","./core/components/ui/table/table-tbody.ts","./core/components/ui/table/table-td.ts","./core/components/ui/table/table-tfoot.ts","./core/components/ui/table/table-th.ts","./core/components/ui/table/table-thead.ts","./core/components/ui/table/table-tr.ts","./core/components/ui/table/table.ts","./core/components/ui/theme/theme.ts","./core/components/ui/theme/theme-collection/core-variables.ts","./core/components/ui/theme/theme-collection/dark.ts","./core/components/ui/theme/theme-collection/light.ts","./core/components/ui/toast/message-subscriber.stories.ts","./core/components/ui/toast/message-subscriber.ts","./core/components/ui/toast/toast-item.ts","./core/components/ui/toast/toast.ts","./core/components/ui/toast/types.ts","./core/components/ui/tooltip/tooltip.ts","./core/decorators/Subscriber.ts","./core/directives/DataProvider.ts","./core/directives/Wording.ts","./core/mixins/Fetcher.ts","./core/mixins/FormCheckable.ts","./core/mixins/FormElement.ts","./core/mixins/FormInput.ts","./core/mixins/Subscriber.ts","./core/mixins/TemplatesContainer.ts","./core/mixins/mixins.ts","./core/utils/Arrays.ts","./core/utils/DataBindObserver.ts","./core/utils/Electron.ts","./core/utils/Format.ts","./core/utils/HTML.ts","./core/utils/LocationHandler.ts","./core/utils/Objects.ts","./core/utils/PublisherProxy.ts","./core/utils/Utils.ts","./core/utils/aesCrypto.ts","./core/utils/api.ts","./core/utils/route.ts","./core/utils/url-pattern.ts","./test-utils/TestUtils.ts"],"version":"5.6.3"}
1
+ {"root":["./components.ts","./concorde-loaded.ts","./decorators.ts","./directives.ts","./index.ts","./mixins.ts","./utils.ts","./core/core.ts","./core/_types/types.ts","./core/components/functional/functional.ts","./core/components/functional/date/date.ts","./core/components/functional/example/example.ts","./core/components/functional/fetch/fetch.ts","./core/components/functional/if/if.test.ts","./core/components/functional/if/if.ts","./core/components/functional/list/list.ts","./core/components/functional/mix/mix.ts","./core/components/functional/queue/queue.ts","./core/components/functional/router/redirect.ts","./core/components/functional/router/router.ts","./core/components/functional/sdui/SDUIDescriptorTransformer.ts","./core/components/functional/sdui/sdui-utils.ts","./core/components/functional/sdui/sdui.ts","./core/components/functional/sdui/types.ts","./core/components/functional/sonic-scope/sonic-scope.ts","./core/components/functional/states/states.ts","./core/components/functional/submit/submit.ts","./core/components/functional/subscriber/subscriber.ts","./core/components/functional/translation/translation.ts","./core/components/functional/value/value.ts","./core/components/ui/ui.ts","./core/components/ui/_css/scroll.ts","./core/components/ui/_css/shadow.ts","./core/components/ui/_css/size.ts","./core/components/ui/_css/type.ts","./core/components/ui/alert/alert.ts","./core/components/ui/alert-messages/alert-messages.ts","./core/components/ui/badge/badge.ts","./core/components/ui/button/button.ts","./core/components/ui/captcha/captcha.ts","./core/components/ui/card/card-footer.ts","./core/components/ui/card/card-header-descripton.ts","./core/components/ui/card/card-header.ts","./core/components/ui/card/card-main.ts","./core/components/ui/card/card.ts","./core/components/ui/divider/divider.ts","./core/components/ui/form/checkbox/checkbox.ts","./core/components/ui/form/css/form-control.ts","./core/components/ui/form/fieldset/fieldset.ts","./core/components/ui/form/fieldset/legend-description.ts","./core/components/ui/form/fieldset/legend.ts","./core/components/ui/form/form-actions/form-actions.ts","./core/components/ui/form/form-layout/form-layout.ts","./core/components/ui/form/input/input.ts","./core/components/ui/form/input/password-helper.ts","./core/components/ui/form/input/same-value-helper.ts","./core/components/ui/form/input-autocomplete/input-autocomplete.ts","./core/components/ui/form/radio/radio.ts","./core/components/ui/form/select/select.ts","./core/components/ui/form/switch/switch.ts","./core/components/ui/form/textarea/textarea.ts","./core/components/ui/group/group.ts","./core/components/ui/icon/icon.stories.ts","./core/components/ui/icon/icon.ts","./core/components/ui/icon/icons.ts","./core/components/ui/image/image.ts","./core/components/ui/link/link.ts","./core/components/ui/loader/loader.stories.ts","./core/components/ui/loader/loader.ts","./core/components/ui/loader/styles/fixed.ts","./core/components/ui/loader/styles/inline.ts","./core/components/ui/menu/menu-item.ts","./core/components/ui/menu/menu.ts","./core/components/ui/modal/modal-actions.ts","./core/components/ui/modal/modal-close.ts","./core/components/ui/modal/modal-content.ts","./core/components/ui/modal/modal-subtitle.ts","./core/components/ui/modal/modal-title.ts","./core/components/ui/modal/modal.stories.ts","./core/components/ui/modal/modal.ts","./core/components/ui/pop/pop.ts","./core/components/ui/progress/progress.ts","./core/components/ui/table/table-caption.ts","./core/components/ui/table/table-tbody.ts","./core/components/ui/table/table-td.ts","./core/components/ui/table/table-tfoot.ts","./core/components/ui/table/table-th.ts","./core/components/ui/table/table-thead.ts","./core/components/ui/table/table-tr.ts","./core/components/ui/table/table.ts","./core/components/ui/theme/theme.ts","./core/components/ui/theme/theme-collection/core-variables.ts","./core/components/ui/theme/theme-collection/dark.ts","./core/components/ui/theme/theme-collection/light.ts","./core/components/ui/toast/message-subscriber.stories.ts","./core/components/ui/toast/message-subscriber.ts","./core/components/ui/toast/toast-item.ts","./core/components/ui/toast/toast.ts","./core/components/ui/toast/types.ts","./core/components/ui/tooltip/tooltip.ts","./core/decorators/Subscriber.ts","./core/directives/DataProvider.ts","./core/directives/Wording.ts","./core/mixins/Fetcher.ts","./core/mixins/FormCheckable.ts","./core/mixins/FormElement.ts","./core/mixins/FormInput.ts","./core/mixins/Subscriber.ts","./core/mixins/TemplatesContainer.ts","./core/mixins/mixins.ts","./core/utils/Arrays.ts","./core/utils/DataBindObserver.ts","./core/utils/Electron.ts","./core/utils/Format.ts","./core/utils/HTML.ts","./core/utils/LocationHandler.ts","./core/utils/Objects.ts","./core/utils/PublisherProxy.ts","./core/utils/Utils.ts","./core/utils/aesCrypto.ts","./core/utils/api.ts","./core/utils/route.spec.ts","./core/utils/route.ts","./core/utils/url-pattern.ts","./test-utils/TestUtils.ts"],"version":"5.6.3"}
package/vite.config.mts CHANGED
@@ -68,6 +68,11 @@ fs.writeFileSync(
68
68
  // https://vitejs.dev/config/
69
69
  export default defineConfig({
70
70
  base: "./",
71
+ test: {
72
+ globals: true, // si tu souhaites utiliser des globals comme describe, it, etc.
73
+ environment: "jsdom", // ou 'node' selon tes besoins
74
+ // d'autres options de configuration...
75
+ },
71
76
  define: {
72
77
  // Définir une constante contenant la date de build
73
78
  __BUILD_DATE__: JSON.stringify(__BUILD_DATE__.toString()),