@supersoniks/concorde 3.1.11 → 3.1.12
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 +1 -1
- package/concorde-core.bundle.js +4 -3
- package/concorde-core.es.js +6 -4
- package/dist/concorde-core.bundle.js +4 -3
- package/dist/concorde-core.es.js +6 -4
- package/package.json +1 -1
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +5 -0
- package/src/core/mixins/FormElement.ts +4 -0
package/build-infos.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"date":
|
|
1
|
+
{"date":1720797545}
|
package/concorde-core.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Q){typeof define=="function"&&define.amd?define(Q):Q()})(function(){"use strict";var jt,k,L,Er,t,G;let Q=class It{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=It.getAncestorAttributeValue(t,"token"),i=It.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=It.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=It.getAncestorAttributeValue(t,"tokenProvider"),c=It.getAncestorAttributeValue(t,"eventsApiToken");s||(o=It.getAncestorAttributeValue(t,"userName"),n=It.getAncestorAttributeValue(t,"password"));const h=It.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),f=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:f}}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 It.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)})}},os=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=Q.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,f){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:f}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),l&&c.push(o(s,"minute",i)(l)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}};function Te(r){return typeof r=="object"&&r!=null}const Tr=async()=>new Promise(r=>{window.queueMicrotask(()=>r(null))});let Pe="sonic";typeof __SONIC_PREFIX__>"u"&&(Pe="sonic"+Math.floor(Math.random()*1e6));const Es=Pe=="sonic"?"publisher-proxies-data":Pe+"-publisher-proxies-data";let Ns=(jt=class{constructor(t,s){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=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.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._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),jt.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.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){this._assignmentId_++;const s=this._assignmentId_;if(await Tr(),s!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>e(i)),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.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_()}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)}async set(t,s=!1){var o;if(this._value_===t||this._value_&&t&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;if(this._value_=Te(t)?t:{__value:t},this._cachedGet_=void 0,Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(s),!0;for(const n in this._value_)this._value_[n]===void 0&&delete this._value_[n];if(this._proxies_.forEach((n,l)=>{this._value_[l]===void 0&&l!="_parent_"&&i[l]&&(this._value_[l]=null)}),await this._publishAssignement_(),Te(this._value_))for(const n in this._value_){const l=t[n],h=Te(l)?l:{__value:l};if(!this._proxies_.has(n)){this._publishDynamicFilling_(n,l);continue}await((o=this._proxies_.get(n))==null?void 0:o.set(h,!0)),this._publishDynamicFilling_(n,l)}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_}get $tag(){return this._instanceCounter_||(jt.instancesCounter++,this._instanceCounter_=jt.instancesCounter),jt.instances.set(this._instanceCounter_,this),"<"+Pe+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+Pe+"-publisher-proxy>"}},jt.instances=new Map,jt.instancesCounter=0,jt),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(Es),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(Es,i),this.localStorageData={};const o=new Date().getTime()-1e3*60*60*12;for(const n in this.localStorageData)this.localStorageData[n].lastModifiationMS<o&&delete this.localStorageData[n];t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.log("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_"+Q.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 je(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(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_"+Q.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Es,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 l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);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,l=new n.DecompressionStream(s),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Fri Jul 12 2024 11:42:03 GMT+0200 (Central European Summer Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);const Ts=window;Ts.SonicPublisherManager||(Ts.SonicPublisherManager=N),Ts.SonicPublisherManager.registerInstance(N.getInstance());const jr=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class je extends Ns{constructor(t,s=null){super(t,s);const i=new Proxy(this,{get:function(e,o){if(o==Symbol.toPrimitive)return()=>i.get();if(jr.has(o))return e[o];if(!e._proxies_.has(o)){const n=e._value_[o],l=new je(Te(n)?n:{__value:n},e);l._proxies_.set("_parent_",i),e._proxies_.set(o,l)}return e._proxies_.get(o)},set:function(e,o,n){var c;if(o=="_value_")return e._value_=n,!0;if(o=="_cachedGet_")return e._cachedGet_=n,!0;if(o=="_assignmentId_")return e._assignmentId_=n,!0;if(o=="_is_savable_")return e._is_savable_=n,!0;if(o=="_instanceCounter_")return e._instanceCounter_=n,!0;if(!e._proxies_.has(o)){const h=new je({},e);h._proxies_.set("_parent_",i),e._proxies_.set(o,h)}return e._value_[o]!==n&&(e._value_[o]=n,e._publishDynamicFilling_(o,n),(c=e._proxies_.get(o))==null||c.set(Te(n)?n:{__value:n})),!0},deleteProperty:function(e,o){var n;return e._publishDynamicFilling_(o,null),(n=e._proxies_.get(o))==null||n.set(null),delete e._value_[o]},has:function(e,o){return o in e._value_&&o!="_lockInternalMutationPublishing_"},defineProperty:function(e,o,n){return n&&"value"in n&&(e._value_[o]=n.value),!0},getOwnPropertyDescriptor:function(e,o){return{enumerable:!0,configurable:!0}},ownKeys:function(e){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}});return i}toString(){return"hey"}valueOf(){return 2}getProperty(t,s){return t[s]}}class Mr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=Ns.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(Pe+"-publisher-proxy",Mr)}catch{}let ns=(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=Q.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 l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const d=h;let f=i;f=L.getSubPublisher(i,d);const m=t,v={publisher:f,onAssign:()=>{const b=l.variables.map(D=>{var p;return(p=L.getSubPublisher(i,D))==null?void 0:p.get()});let P=l.expression,S=!1;if(b.length==1&&l.variables[0].join(".")==P.substring(1)){let D=b[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<b.length;D++){let p=b[D];const u=l.variables[D];p===null&&(S=!0,p=void 0),P=P.replace("$"+u.join("."),p)}if(P.indexOf("|")!=-1){const D=P.indexOf("|");if(D==0)P=os.js(P.substring(1));else{const p=P.substring(0,D),u=P.substring(D+1),y=os[p];P=S?"":y?y(u):P}}else P=S?"":P;m[c]=P}};f==null||f.onAssign(v.onAssign),o.push(v)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ns.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ns);let X=class ee{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 l=t[n],c=s[n];if(i?l!==c:l!=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 l=t[n],c=s[n],h=ee.isObject(l)&&ee.isObject(c),d=i?l!==c:l!=c;if(h&&!ee.deepEqual(l,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 ee.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&&ee.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),ee.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return ee.getURLSearchArray(t,"").join("&")}};/**
|
|
1
|
+
(function(Q){typeof define=="function"&&define.amd?define(Q):Q()})(function(){"use strict";var jt,k,L,Er,t,G;let Q=class It{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=It.getAncestorAttributeValue(t,"token"),i=It.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=It.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=It.getAncestorAttributeValue(t,"tokenProvider"),c=It.getAncestorAttributeValue(t,"eventsApiToken");s||(o=It.getAncestorAttributeValue(t,"userName"),n=It.getAncestorAttributeValue(t,"password"));const h=It.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),f=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:f}}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 It.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)})}},os=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=Q.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,f){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:f}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),l&&c.push(o(s,"minute",i)(l)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}};function Te(r){return typeof r=="object"&&r!=null}const Tr=async()=>new Promise(r=>{window.queueMicrotask(()=>r(null))});let Pe="sonic";typeof __SONIC_PREFIX__>"u"&&(Pe="sonic"+Math.floor(Math.random()*1e6));const Es=Pe=="sonic"?"publisher-proxies-data":Pe+"-publisher-proxies-data";let Ns=(jt=class{constructor(t,s){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=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.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._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),jt.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.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){this._assignmentId_++;const s=this._assignmentId_;if(await Tr(),s!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>e(i)),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.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_()}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)}async set(t,s=!1){var o;if(this._value_===t||this._value_&&t&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;if(this._value_=Te(t)?t:{__value:t},this._cachedGet_=void 0,Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(s),!0;for(const n in this._value_)this._value_[n]===void 0&&delete this._value_[n];if(this._proxies_.forEach((n,l)=>{this._value_[l]===void 0&&l!="_parent_"&&i[l]&&(this._value_[l]=null)}),await this._publishAssignement_(),Te(this._value_))for(const n in this._value_){const l=t[n],h=Te(l)?l:{__value:l};if(!this._proxies_.has(n)){this._publishDynamicFilling_(n,l);continue}await((o=this._proxies_.get(n))==null?void 0:o.set(h,!0)),this._publishDynamicFilling_(n,l)}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_}get $tag(){return this._instanceCounter_||(jt.instancesCounter++,this._instanceCounter_=jt.instancesCounter),jt.instances.set(this._instanceCounter_,this),"<"+Pe+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+Pe+"-publisher-proxy>"}},jt.instances=new Map,jt.instancesCounter=0,jt),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(Es),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(Es,i),this.localStorageData={};const o=new Date().getTime()-1e3*60*60*12;for(const n in this.localStorageData)this.localStorageData[n].lastModifiationMS<o&&delete this.localStorageData[n];t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.log("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_"+Q.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 je(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(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_"+Q.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Es,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 l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);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,l=new n.DecompressionStream(s),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Fri Jul 12 2024 17:19:05 GMT+0200 (Central European Summer Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);const Ts=window;Ts.SonicPublisherManager||(Ts.SonicPublisherManager=N),Ts.SonicPublisherManager.registerInstance(N.getInstance());const jr=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class je extends Ns{constructor(t,s=null){super(t,s);const i=new Proxy(this,{get:function(e,o){if(o==Symbol.toPrimitive)return()=>i.get();if(jr.has(o))return e[o];if(!e._proxies_.has(o)){const n=e._value_[o],l=new je(Te(n)?n:{__value:n},e);l._proxies_.set("_parent_",i),e._proxies_.set(o,l)}return e._proxies_.get(o)},set:function(e,o,n){var c;if(o=="_value_")return e._value_=n,!0;if(o=="_cachedGet_")return e._cachedGet_=n,!0;if(o=="_assignmentId_")return e._assignmentId_=n,!0;if(o=="_is_savable_")return e._is_savable_=n,!0;if(o=="_instanceCounter_")return e._instanceCounter_=n,!0;if(!e._proxies_.has(o)){const h=new je({},e);h._proxies_.set("_parent_",i),e._proxies_.set(o,h)}return e._value_[o]!==n&&(e._value_[o]=n,e._publishDynamicFilling_(o,n),(c=e._proxies_.get(o))==null||c.set(Te(n)?n:{__value:n})),!0},deleteProperty:function(e,o){var n;return e._publishDynamicFilling_(o,null),(n=e._proxies_.get(o))==null||n.set(null),delete e._value_[o]},has:function(e,o){return o in e._value_&&o!="_lockInternalMutationPublishing_"},defineProperty:function(e,o,n){return n&&"value"in n&&(e._value_[o]=n.value),!0},getOwnPropertyDescriptor:function(e,o){return{enumerable:!0,configurable:!0}},ownKeys:function(e){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}});return i}toString(){return"hey"}valueOf(){return 2}getProperty(t,s){return t[s]}}class Mr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=Ns.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(Pe+"-publisher-proxy",Mr)}catch{}let ns=(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=Q.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 l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const d=h;let f=i;f=L.getSubPublisher(i,d);const m=t,v={publisher:f,onAssign:()=>{const b=l.variables.map(D=>{var p;return(p=L.getSubPublisher(i,D))==null?void 0:p.get()});let P=l.expression,S=!1;if(b.length==1&&l.variables[0].join(".")==P.substring(1)){let D=b[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<b.length;D++){let p=b[D];const u=l.variables[D];p===null&&(S=!0,p=void 0),P=P.replace("$"+u.join("."),p)}if(P.indexOf("|")!=-1){const D=P.indexOf("|");if(D==0)P=os.js(P.substring(1));else{const p=P.substring(0,D),u=P.substring(D+1),y=os[p];P=S?"":y?y(u):P}}else P=S?"":P;m[c]=P}};f==null||f.onAssign(v.onAssign),o.push(v)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ns.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ns);let X=class ee{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 l=t[n],c=s[n];if(i?l!==c:l!=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 l=t[n],c=s[n],h=ee.isObject(l)&&ee.isObject(c),d=i?l!==c:l!=c;if(h&&!ee.deepEqual(l,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 ee.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&&ee.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),ee.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return ee.getURLSearchArray(t,"").join("&")}};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
* @license
|
|
70
70
|
* Copyright 2018 Google LLC
|
|
71
71
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
72
|
-
*/const Xi="important",_o=" !"+Xi,pt=he(class extends Ae{constructor(r){var t;if(super(r),r.type!==ce.ATTRIBUTE||r.name!=="style"||((t=r.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((t,s)=>{const i=r[s];return i==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(r,[t]){const{style:s}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in t){const e=t[i];if(e!=null){this.ft.add(i);const o=typeof e=="string"&&e.endsWith(_o);i.includes("-")||o?s.setProperty(i,o?e.slice(0,-11):e,o?Xi:""):s[i]=e}}return mt}});var xo=Object.defineProperty,Po=Object.getOwnPropertyDescriptor,Ct=(r,t,s,i)=>{for(var e=i>1?void 0:i?Po(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&&xo(t,s,e),e};const fs=new Map,Oe=r=>{class t extends r{constructor(...i){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=e=>{this.setValueFromPublisher(e)},this.onFormValueAssign=async e=>{this.setFormValueFromPublisher(e)},this.onFormDataInValidate=()=>{const e=this.getFormPublisher();e&&e.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(i){this.hasAttribute("name")&&!this.forceAutoFill&&(i=this.getAttribute("name")),this._name=i,this.requestUpdate()}validateFormElement(){}updateDataValue(){const i=this.getAttribute("name");if(i){const e=this.getFormPublisher();e&&(e[i]=this.getValueForFormPublisher(),this.setFormValueFromPublisher(e[i].get()))}}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?N.get(this.formDataProvider):null}getValueForFormPublisher(){return this.value}setValueFromPublisher(i){this.value=i}setFormValueFromPublisher(i){this.value=i}get value(){return this._value}set value(i){i==null&&(i=""),X.isObject(i)&&Object.prototype.hasOwnProperty.call(i,"__value")&&i._value==null&&(i=""),this._value!=i&&(this._value=i,this.updateDataValue(),this.requestUpdate())}initPublisher(){let i=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&i[this._name].get()?i[this._name].get():this.getAttribute("value");this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign),this._name&&i&&i[this._name].offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.publisher&&this._name&&this.publisher[this._name].onAssign(this.onValueAssign),i=this.getFormPublisher(),this._name&&i&&(i[this._name].onAssign(this.onFormValueAssign),i.onInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(i){this.value=i.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const i=this.getAncestorAttributeValue("data-keyboard-nav");if(!i)return;const e=i.split(" "),o=e[0];if(!o)return;for(const l of e){fs.has(l)||fs.set(l,[]);const c=fs.get(l);(c==null?void 0:c.indexOf(this))==-1&&c.push(this)}const n=fs.get(o);this.addEventListener("keydown",l=>{var v;const c=l;if(!["ArrowDown","ArrowUp"].includes(c.key))return;const h="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",d=n==null?void 0:n.filter(b=>{var D;const P=(D=b.shadowRoot)==null?void 0:D.querySelector(h);if(!P)return!1;const S=window.getComputedStyle(P);return S.display!=="none"&&S.display!==""&&S.pointerEvents!="none"&&S.visibility!=="hidden"&&P.getBoundingClientRect().width>0});let f=null;if(c.key=="ArrowDown"&&d){const b=d.indexOf(this);b==d.length-1?f=d[0]:f=d[b+1]}else if(c.key=="ArrowUp"&&d){const b=d.indexOf(this);b==0?f=d[d.length-1]:f=d[b-1]}const m=(v=f==null?void 0:f.shadowRoot)==null?void 0:v.querySelector(h);m&&m.focus&&(m.focus(),l.preventDefault(),l.stopPropagation())})}focus(){var e;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("[data-form-element]");i==null||i.focus()}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);const i=this.getFormPublisher();this._name&&i&&(i[this._name].offAssign(this.onFormValueAssign),i.offInvalidate(this.onFormDataInValidate))}}return Ct([a({type:Boolean,reflect:!0})],t.prototype,"touched",2),Ct([a({type:Boolean})],t.prototype,"error",2),Ct([a({type:Boolean})],t.prototype,"autofocus",2),Ct([a({type:Boolean})],t.prototype,"required",2),Ct([a({type:Boolean})],t.prototype,"forceAutoFill",2),Ct([a({type:Boolean})],t.prototype,"disabled",2),Ct([a({type:String,attribute:"data-aria-label"})],t.prototype,"ariaLabel",2),Ct([a({type:String,attribute:"data-aria-labelledby"})],t.prototype,"ariaLabelledby",2),Ct([a()],t.prototype,"name",1),Ct([a()],t.prototype,"value",1),t};let $o=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},Co=class xe{static areEqual(t,s){return t.length===s.length?t.every((i,e)=>i===s[e]):!1}static from2d(t){return{to1D:()=>{let s=[];return t.forEach(i=>s=s.concat(i)),this.from(s)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:s=>{if(t.length<1)return!0;const i=(t[0]||{})[s];return t.every(e=>(e||{})[s]==i)}})})}),value:()=>({forKey:s=>xe.from(t.map(i=>i[s]))}),copy:()=>({fromKey:s=>({toKey:i=>{t.forEach(e=>{e[i]=Array.isArray(e[s])?[...e[s]]:typeof e[s]=="object"&&e[s]!=null?{...e[s]}:e[s]})}})})}),map:s=>xe.from(t.map(s)),filter:s=>xe.from(t.filter(s)),find:s=>t.find(s),some:s=>t.some(s),every:s=>t.every(s),group:()=>({byKey:s=>{const i=[],e=new Map;for(const o of t){const n=o[s];if(!e.has(n)){const l=i.length;e.set(n,l);const c={items:[]};c[s]=n,i.push(c)}i[e.get(n)].items.push(o)}return xe.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(t.map(e=>e[s]))];return xe.from(i.map(e=>t.find(o=>o[s]==e)))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>{const e=(o,n)=>l=>o[n]!=l[n];return xe.from(t.filter(o=>s.every(e(o,i))))}})})})}}};var Ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function So(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ys={exports:{}};(function(r,t){var s=[].slice;(function(i,e){return t!==null?r.exports=e():i.UrlPattern=e()})(Ao,function(){var i,e,o,n,l,c,h,d,f,m,v,b,P,S,D;return f=function(p){return p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(p,u){var y,A,O;for(O=[],y=-1,A=p.length;++y<A;)O=O.concat(u(p[y]));return O},S=function(p,u){var y,A,O;for(O="",y=-1,A=p.length;++y<A;)O+=u(p[y]);return O},P=function(p){return new RegExp(p.toString()+"|").exec("").length-1},v=function(p,u){var y,A,O,E,V;for(E={},y=-1,O=p.length;++y<O;)A=p[y],V=u[y],V!=null&&(E[A]!=null?(Array.isArray(E[A])||(E[A]=[E[A]]),E[A].push(V)):E[A]=V);return E},i={},i.Result=function(p,u){this.value=p,this.rest=u},i.Tagged=function(p,u){this.tag=p,this.value=u},i.tag=function(p,u){return function(y){var A,O;if(A=u(y),A!=null)return O=new i.Tagged(p,A.value),new i.Result(O,A.rest)}},i.regex=function(p){return function(u){var y,A;if(y=p.exec(u),y!=null)return A=y[0],new i.Result(A,u.slice(A.length))}},i.sequence=function(){var p;return p=1<=arguments.length?s.call(arguments,0):[],function(u){var y,A,O,E,V,q;for(y=-1,A=p.length,q=[],E=u;++y<A;){if(O=p[y],V=O(E),V==null)return;q.push(V.value),E=V.rest}return new i.Result(q,E)}},i.pick=function(){var p,u;return p=arguments[0],u=2<=arguments.length?s.call(arguments,1):[],function(y){var A,O;if(O=i.sequence.apply(i,u)(y),O!=null)return A=O.value,O.value=A[p],O}},i.string=function(p){var u;return u=p.length,function(y){if(y.slice(0,u)===p)return new i.Result(p,y.slice(u))}},i.lazy=function(p){var u;return u=null,function(y){return u==null&&(u=p()),u(y)}},i.baseMany=function(p,u,y,A,O){var E,V,q,Mt;for(q=O,Mt=y?"":[];!(u!=null&&(E=u(q),E!=null)||(V=p(q),V==null));)y?Mt+=V.value:Mt.push(V.value),q=V.rest;if(!(A&&Mt.length===0))return new i.Result(Mt,q)},i.many1=function(p){return function(u){return i.baseMany(p,null,!1,!0,u)}},i.concatMany1Till=function(p,u){return function(y){return i.baseMany(p,u,!0,!0,y)}},i.firstChoice=function(){var p;return p=1<=arguments.length?s.call(arguments,0):[],function(u){var y,A,O,E;for(y=-1,A=p.length;++y<A;)if(O=p[y],E=O(u),E!=null)return E}},b=function(p){var u;return u={},u.wildcard=i.tag("wildcard",i.string(p.wildcardChar)),u.optional=i.tag("optional",i.pick(1,i.string(p.optionalSegmentStartChar),i.lazy(function(){return u.pattern}),i.string(p.optionalSegmentEndChar))),u.name=i.regex(new RegExp("^["+p.segmentNameCharset+"]+")),u.named=i.tag("named",i.pick(1,i.string(p.segmentNameStartChar),i.lazy(function(){return u.name}))),u.escapedChar=i.pick(1,i.string(p.escapeChar),i.regex(/^./)),u.static=i.tag("static",i.concatMany1Till(i.firstChoice(i.lazy(function(){return u.escapedChar}),i.regex(/^./)),i.firstChoice(i.string(p.segmentNameStartChar),i.string(p.optionalSegmentStartChar),i.string(p.optionalSegmentEndChar),u.wildcard))),u.token=i.lazy(function(){return i.firstChoice(u.wildcard,u.optional,u.named,u.static)}),u.pattern=i.many1(i.lazy(function(){return u.token})),u},d={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(p,u){if(Array.isArray(p))return S(p,function(y){return c(y,u)});switch(p.tag){case"wildcard":return"(.*?)";case"named":return"(["+u+"]+)";case"static":return f(p.value);case"optional":return"(?:"+c(p.value,u)+")?"}},l=function(p,u){return u==null&&(u=d.segmentValueCharset),"^"+c(p,u)+"$"},n=function(p){if(Array.isArray(p))return h(p,n);switch(p.tag){case"wildcard":return["_"];case"named":return[p.value];case"static":return[];case"optional":return n(p.value)}},m=function(p,u,y,A){var O,E,V,q;if(A==null&&(A=!1),q=p[u],q==null){if(A)throw new Error("no values provided for key `"+u+"`");return}if(O=y[u]||0,E=Array.isArray(q)?q.length-1:0,O>E){if(A)throw new Error("too few values provided for key `"+u+"`");return}return V=Array.isArray(q)?q[O]:q,A&&(y[u]=O+1),V},o=function(p,u,y){var A,O;if(Array.isArray(p)){for(A=-1,O=p.length;++A<O;)if(o(p[A],u,y))return!0;return!1}switch(p.tag){case"wildcard":return m(u,"_",y,!1)!=null;case"named":return m(u,p.value,y,!1)!=null;case"static":return!1;case"optional":return o(p.value,u,y)}},D=function(p,u,y){if(Array.isArray(p))return S(p,function(A){return D(A,u,y)});switch(p.tag){case"wildcard":return m(u,"_",y,!0);case"named":return m(u,p.value,y,!0);case"static":return p.value;case"optional":return o(p.value,u,y)?D(p.value,u,y):""}},e=function(p,u){var y,A,O,E,V;if(p instanceof e){this.isRegex=p.isRegex,this.regex=p.regex,this.ast=p.ast,this.names=p.names;return}if(this.isRegex=p instanceof RegExp,!(typeof p=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=p,u!=null){if(!Array.isArray(u))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(y=P(this.regex),u.length!==y)throw new Error("regex contains "+y+" groups but array of group names contains "+u.length);this.names=u}return}if(p==="")throw new Error("argument must not be the empty string");if(V=p.replace(/\s+/g,""),V!==p)throw new Error("argument must not contain whitespace");if(A={escapeChar:(u!=null?u.escapeChar:void 0)||d.escapeChar,segmentNameStartChar:(u!=null?u.segmentNameStartChar:void 0)||d.segmentNameStartChar,segmentNameCharset:(u!=null?u.segmentNameCharset:void 0)||d.segmentNameCharset,segmentValueCharset:(u!=null?u.segmentValueCharset:void 0)||d.segmentValueCharset,optionalSegmentStartChar:(u!=null?u.optionalSegmentStartChar:void 0)||d.optionalSegmentStartChar,optionalSegmentEndChar:(u!=null?u.optionalSegmentEndChar:void 0)||d.optionalSegmentEndChar,wildcardChar:(u!=null?u.wildcardChar:void 0)||d.wildcardChar},E=b(A),O=E.pattern(p),O==null)throw new Error("couldn't parse pattern");if(O.rest!=="")throw new Error("could only partially parse pattern");this.ast=O.value,this.regex=new RegExp(l(this.ast,A.segmentValueCharset)),this.names=n(this.ast)},e.prototype.match=function(p){var u,y;return y=this.regex.exec(p),y==null?null:(u=y.slice(1),this.names?v(this.names,u):u)},e.prototype.stringify=function(p){if(p==null&&(p={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(p!==Object(p))throw new Error("argument must be an object or undefined");return D(this.ast,p,{})},e.escapeForRegex=f,e.concatMap=h,e.stringConcatMap=S,e.regexGroupCount=P,e.keysAndValuesToObject=v,e.P=i,e.newParser=b,e.defaultOptions=d,e.astNodeToRegexString=l,e.astNodeToNames=n,e.getParam=m,e.astNodeContainsSegmentsForProvidedParams=o,e.stringify=D,e})})(Ys,Ys.exports);var Oo=Ys.exports;const de=So(Oo),Do=$o,ko=Co,Lo=ns,Eo=os,pe=Q,No=rt,Ke=X,To=je,tt=N,jo=Se,Mo=de;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:Do,Arrays:ko,DataBindObserver:Lo,Format:Eo,HTML:pe,LocationHandler:No,Objects:Ke,PublisherProxy:To,PublisherManager:tt,api:jo,URLPattern:Mo};var Io=Object.defineProperty,zo=Object.getOwnPropertyDescriptor,De=(r,t,s,i)=>{for(var e=i>1?void 0:i?zo(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&&Io(t,s,e),e};const Gs=r=>{class t extends r{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this.unCheckOnDisconnect=!1,this._checked=null,this.updateAllChecked=()=>{const i=this.getAttribute("name"),e=this.getCheckAllPublisher(),o=this.getFormPublisher();if(e!=null&&e.hasCheckAll.get()&&!this.checksAll()&&e&&o&&i){if(o[this.name].get().length)(this.checked===null||e.checkMode.get()=="noneChecked"||e.checkMode.get()==null)&&(e.checkMode="someUnchecked");else{e.checkMode="noneChecked";return}const n=o[i].get(),l=e.values.get();if(l&&l.length){let c=l.length;for(const h of l)n.indexOf(h)==-1&&(c-=1);c==l.length&&(e.checkMode="allChecked"),c==0&&(e.checkMode="noneChecked")}l.indexOf(this.value)==-1&&(this.checked=null)}},this.onChecksAllRequest=i=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),i=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),i=="noneChecked"&&(this.checked=null),i=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(i){if(this.value==i||(this.hasAttribute("value")&&!this.forceAutoFill&&(i=this.getAttribute("value")),this._value==i)||i==null||(this._value=i,!this.value))return;const e=this.getFormPublisher();if(e&&this.name){let o=e[this.name].get();(this.radio||this.unique)&&(this.checked=o==i?!0:null),Array.isArray(o)||(o=[]),o.indexOf(i)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(i){if(this.setCheckedValue(i),this.checksAll()){const e=this.getCheckAllPublisher();if(e){if(this.checked===!0)e.checkMode="allChecked";else if(this.checked===null){e.checkMode="noneChecked";const o=this.getFormPublisher();o&&(o[this.name]=[])}}}this.requestUpdate()}validateFormElement(){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("input");if(!i||i.checkValidity())return;const e=this.getFormPublisher();if(e){const n=e[this.name].get();if((this.unique||this.radio)&&n!==null&&n.toString().length>0)return;e.isFormValid=!1,i.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(i){this._checked!=i&&(this._checked=i,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const i=this.checked===!0?this.radio?!0:null:!0;this.checked=i;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){const i=this.getFormPublisher();if(!i)return null;let e=i[this.name].get();if(this.radio)return this.checked===!0&&this.value!=null?this.value:e;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(e)||(e=[]),e=e.slice(0);const o=e.indexOf(this.value);return this.checked===!0&&o===-1&&!this.checksAll()&&e.push(this.value),this.checked===null&&o!==-1&&e.splice(o,1),e}setFormValueFromPublisher(i){if(this.unique||this.radio){this.checked=this.value==i?!0:null;return}Array.isArray(i)||(i=[]),!this.checksAll()&&(this.checked=i.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const i=this.formDataProvider,e=this.getAttribute("name");return!i||!e?null:tt.get(i+"/"+e+"/_available_values_")}disconnectedCallback(){super.disconnectedCallback();const i=this.getCheckAllPublisher();if(i&&(i.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=i.values.get().slice(0),o=e.indexOf(this.value);o!=-1&&(e.splice(o,1),i.values=e)}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){super.connectedCallback();const i=this.getFormPublisher();if(i&&this.name){const o=i[this.name].get();o&&Array.isArray(o)&&o.indexOf(this.value)!==-1&&(this.checked=!0)}const e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&(e.hasCheckAll=!0),e.values.get()||(e.values=[]),this.checksAll()||(e.values=[...e.values.get(),this.value])),this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&setTimeout(()=>this.checked=!0,1)}}return De([a()],t.prototype,"value",1),De([a()],t.prototype,"forceAutoFill",2),De([a({type:Boolean})],t.prototype,"unique",2),De([a({type:Boolean})],t.prototype,"radio",2),De([a({type:Boolean})],t.prototype,"unCheckOnDisconnect",2),De([a()],t.prototype,"checked",1),t};/**
|
|
72
|
+
*/const Xi="important",_o=" !"+Xi,pt=he(class extends Ae{constructor(r){var t;if(super(r),r.type!==ce.ATTRIBUTE||r.name!=="style"||((t=r.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((t,s)=>{const i=r[s];return i==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(r,[t]){const{style:s}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in t){const e=t[i];if(e!=null){this.ft.add(i);const o=typeof e=="string"&&e.endsWith(_o);i.includes("-")||o?s.setProperty(i,o?e.slice(0,-11):e,o?Xi:""):s[i]=e}}return mt}});var xo=Object.defineProperty,Po=Object.getOwnPropertyDescriptor,Ct=(r,t,s,i)=>{for(var e=i>1?void 0:i?Po(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&&xo(t,s,e),e};const fs=new Map,Oe=r=>{class t extends r{constructor(...i){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=e=>{this.setValueFromPublisher(e)},this.onFormValueAssign=async e=>{this.setFormValueFromPublisher(e)},this.onFormDataInValidate=()=>{const e=this.getFormPublisher();e&&e.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(i){this.hasAttribute("name")&&!this.forceAutoFill&&(i=this.getAttribute("name")),this._name=i,this.requestUpdate()}validateFormElement(){}updateDataValue(){const i=this.getAttribute("name");if(i){const e=this.getFormPublisher();e&&(e[i]=this.getValueForFormPublisher(),this.setFormValueFromPublisher(e[i].get()))}}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?N.get(this.formDataProvider):null}getValueForFormPublisher(){return this.value}setValueFromPublisher(i){this.value=i}setFormValueFromPublisher(i){this.value=i}get value(){return this._value}set value(i){i==null&&(i=""),X.isObject(i)&&Object.prototype.hasOwnProperty.call(i,"__value")&&i._value==null&&(i=""),this._value!=i&&(i||console.trace(this.name,this._value,i),this._value=i,this.updateDataValue(),this.requestUpdate())}initPublisher(){let i=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&i[this._name].get()?i[this._name].get():this.getAttribute("value");this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign),this._name&&i&&i[this._name].offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.publisher&&this._name&&this.publisher[this._name].onAssign(this.onValueAssign),i=this.getFormPublisher(),this._name&&i&&(i[this._name].onAssign(this.onFormValueAssign),i.onInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(i){this.value=i.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const i=this.getAncestorAttributeValue("data-keyboard-nav");if(!i)return;const e=i.split(" "),o=e[0];if(!o)return;for(const l of e){fs.has(l)||fs.set(l,[]);const c=fs.get(l);(c==null?void 0:c.indexOf(this))==-1&&c.push(this)}const n=fs.get(o);this.addEventListener("keydown",l=>{var v;const c=l;if(!["ArrowDown","ArrowUp"].includes(c.key))return;const h="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",d=n==null?void 0:n.filter(b=>{var D;const P=(D=b.shadowRoot)==null?void 0:D.querySelector(h);if(!P)return!1;const S=window.getComputedStyle(P);return S.display!=="none"&&S.display!==""&&S.pointerEvents!="none"&&S.visibility!=="hidden"&&P.getBoundingClientRect().width>0});let f=null;if(c.key=="ArrowDown"&&d){const b=d.indexOf(this);b==d.length-1?f=d[0]:f=d[b+1]}else if(c.key=="ArrowUp"&&d){const b=d.indexOf(this);b==0?f=d[d.length-1]:f=d[b-1]}const m=(v=f==null?void 0:f.shadowRoot)==null?void 0:v.querySelector(h);m&&m.focus&&(m.focus(),l.preventDefault(),l.stopPropagation())})}focus(){var e;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("[data-form-element]");i==null||i.focus()}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),this.value&&this.setAttribute("value",this.value),super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);const i=this.getFormPublisher();this._name&&i&&(i[this._name].offAssign(this.onFormValueAssign),i.offInvalidate(this.onFormDataInValidate))}}return Ct([a({type:Boolean,reflect:!0})],t.prototype,"touched",2),Ct([a({type:Boolean})],t.prototype,"error",2),Ct([a({type:Boolean})],t.prototype,"autofocus",2),Ct([a({type:Boolean})],t.prototype,"required",2),Ct([a({type:Boolean})],t.prototype,"forceAutoFill",2),Ct([a({type:Boolean})],t.prototype,"disabled",2),Ct([a({type:String,attribute:"data-aria-label"})],t.prototype,"ariaLabel",2),Ct([a({type:String,attribute:"data-aria-labelledby"})],t.prototype,"ariaLabelledby",2),Ct([a()],t.prototype,"name",1),Ct([a()],t.prototype,"value",1),t};let $o=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},Co=class xe{static areEqual(t,s){return t.length===s.length?t.every((i,e)=>i===s[e]):!1}static from2d(t){return{to1D:()=>{let s=[];return t.forEach(i=>s=s.concat(i)),this.from(s)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:s=>{if(t.length<1)return!0;const i=(t[0]||{})[s];return t.every(e=>(e||{})[s]==i)}})})}),value:()=>({forKey:s=>xe.from(t.map(i=>i[s]))}),copy:()=>({fromKey:s=>({toKey:i=>{t.forEach(e=>{e[i]=Array.isArray(e[s])?[...e[s]]:typeof e[s]=="object"&&e[s]!=null?{...e[s]}:e[s]})}})})}),map:s=>xe.from(t.map(s)),filter:s=>xe.from(t.filter(s)),find:s=>t.find(s),some:s=>t.some(s),every:s=>t.every(s),group:()=>({byKey:s=>{const i=[],e=new Map;for(const o of t){const n=o[s];if(!e.has(n)){const l=i.length;e.set(n,l);const c={items:[]};c[s]=n,i.push(c)}i[e.get(n)].items.push(o)}return xe.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(t.map(e=>e[s]))];return xe.from(i.map(e=>t.find(o=>o[s]==e)))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>{const e=(o,n)=>l=>o[n]!=l[n];return xe.from(t.filter(o=>s.every(e(o,i))))}})})})}}};var Ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function So(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ys={exports:{}};(function(r,t){var s=[].slice;(function(i,e){return t!==null?r.exports=e():i.UrlPattern=e()})(Ao,function(){var i,e,o,n,l,c,h,d,f,m,v,b,P,S,D;return f=function(p){return p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(p,u){var y,A,O;for(O=[],y=-1,A=p.length;++y<A;)O=O.concat(u(p[y]));return O},S=function(p,u){var y,A,O;for(O="",y=-1,A=p.length;++y<A;)O+=u(p[y]);return O},P=function(p){return new RegExp(p.toString()+"|").exec("").length-1},v=function(p,u){var y,A,O,E,V;for(E={},y=-1,O=p.length;++y<O;)A=p[y],V=u[y],V!=null&&(E[A]!=null?(Array.isArray(E[A])||(E[A]=[E[A]]),E[A].push(V)):E[A]=V);return E},i={},i.Result=function(p,u){this.value=p,this.rest=u},i.Tagged=function(p,u){this.tag=p,this.value=u},i.tag=function(p,u){return function(y){var A,O;if(A=u(y),A!=null)return O=new i.Tagged(p,A.value),new i.Result(O,A.rest)}},i.regex=function(p){return function(u){var y,A;if(y=p.exec(u),y!=null)return A=y[0],new i.Result(A,u.slice(A.length))}},i.sequence=function(){var p;return p=1<=arguments.length?s.call(arguments,0):[],function(u){var y,A,O,E,V,q;for(y=-1,A=p.length,q=[],E=u;++y<A;){if(O=p[y],V=O(E),V==null)return;q.push(V.value),E=V.rest}return new i.Result(q,E)}},i.pick=function(){var p,u;return p=arguments[0],u=2<=arguments.length?s.call(arguments,1):[],function(y){var A,O;if(O=i.sequence.apply(i,u)(y),O!=null)return A=O.value,O.value=A[p],O}},i.string=function(p){var u;return u=p.length,function(y){if(y.slice(0,u)===p)return new i.Result(p,y.slice(u))}},i.lazy=function(p){var u;return u=null,function(y){return u==null&&(u=p()),u(y)}},i.baseMany=function(p,u,y,A,O){var E,V,q,Mt;for(q=O,Mt=y?"":[];!(u!=null&&(E=u(q),E!=null)||(V=p(q),V==null));)y?Mt+=V.value:Mt.push(V.value),q=V.rest;if(!(A&&Mt.length===0))return new i.Result(Mt,q)},i.many1=function(p){return function(u){return i.baseMany(p,null,!1,!0,u)}},i.concatMany1Till=function(p,u){return function(y){return i.baseMany(p,u,!0,!0,y)}},i.firstChoice=function(){var p;return p=1<=arguments.length?s.call(arguments,0):[],function(u){var y,A,O,E;for(y=-1,A=p.length;++y<A;)if(O=p[y],E=O(u),E!=null)return E}},b=function(p){var u;return u={},u.wildcard=i.tag("wildcard",i.string(p.wildcardChar)),u.optional=i.tag("optional",i.pick(1,i.string(p.optionalSegmentStartChar),i.lazy(function(){return u.pattern}),i.string(p.optionalSegmentEndChar))),u.name=i.regex(new RegExp("^["+p.segmentNameCharset+"]+")),u.named=i.tag("named",i.pick(1,i.string(p.segmentNameStartChar),i.lazy(function(){return u.name}))),u.escapedChar=i.pick(1,i.string(p.escapeChar),i.regex(/^./)),u.static=i.tag("static",i.concatMany1Till(i.firstChoice(i.lazy(function(){return u.escapedChar}),i.regex(/^./)),i.firstChoice(i.string(p.segmentNameStartChar),i.string(p.optionalSegmentStartChar),i.string(p.optionalSegmentEndChar),u.wildcard))),u.token=i.lazy(function(){return i.firstChoice(u.wildcard,u.optional,u.named,u.static)}),u.pattern=i.many1(i.lazy(function(){return u.token})),u},d={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(p,u){if(Array.isArray(p))return S(p,function(y){return c(y,u)});switch(p.tag){case"wildcard":return"(.*?)";case"named":return"(["+u+"]+)";case"static":return f(p.value);case"optional":return"(?:"+c(p.value,u)+")?"}},l=function(p,u){return u==null&&(u=d.segmentValueCharset),"^"+c(p,u)+"$"},n=function(p){if(Array.isArray(p))return h(p,n);switch(p.tag){case"wildcard":return["_"];case"named":return[p.value];case"static":return[];case"optional":return n(p.value)}},m=function(p,u,y,A){var O,E,V,q;if(A==null&&(A=!1),q=p[u],q==null){if(A)throw new Error("no values provided for key `"+u+"`");return}if(O=y[u]||0,E=Array.isArray(q)?q.length-1:0,O>E){if(A)throw new Error("too few values provided for key `"+u+"`");return}return V=Array.isArray(q)?q[O]:q,A&&(y[u]=O+1),V},o=function(p,u,y){var A,O;if(Array.isArray(p)){for(A=-1,O=p.length;++A<O;)if(o(p[A],u,y))return!0;return!1}switch(p.tag){case"wildcard":return m(u,"_",y,!1)!=null;case"named":return m(u,p.value,y,!1)!=null;case"static":return!1;case"optional":return o(p.value,u,y)}},D=function(p,u,y){if(Array.isArray(p))return S(p,function(A){return D(A,u,y)});switch(p.tag){case"wildcard":return m(u,"_",y,!0);case"named":return m(u,p.value,y,!0);case"static":return p.value;case"optional":return o(p.value,u,y)?D(p.value,u,y):""}},e=function(p,u){var y,A,O,E,V;if(p instanceof e){this.isRegex=p.isRegex,this.regex=p.regex,this.ast=p.ast,this.names=p.names;return}if(this.isRegex=p instanceof RegExp,!(typeof p=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=p,u!=null){if(!Array.isArray(u))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(y=P(this.regex),u.length!==y)throw new Error("regex contains "+y+" groups but array of group names contains "+u.length);this.names=u}return}if(p==="")throw new Error("argument must not be the empty string");if(V=p.replace(/\s+/g,""),V!==p)throw new Error("argument must not contain whitespace");if(A={escapeChar:(u!=null?u.escapeChar:void 0)||d.escapeChar,segmentNameStartChar:(u!=null?u.segmentNameStartChar:void 0)||d.segmentNameStartChar,segmentNameCharset:(u!=null?u.segmentNameCharset:void 0)||d.segmentNameCharset,segmentValueCharset:(u!=null?u.segmentValueCharset:void 0)||d.segmentValueCharset,optionalSegmentStartChar:(u!=null?u.optionalSegmentStartChar:void 0)||d.optionalSegmentStartChar,optionalSegmentEndChar:(u!=null?u.optionalSegmentEndChar:void 0)||d.optionalSegmentEndChar,wildcardChar:(u!=null?u.wildcardChar:void 0)||d.wildcardChar},E=b(A),O=E.pattern(p),O==null)throw new Error("couldn't parse pattern");if(O.rest!=="")throw new Error("could only partially parse pattern");this.ast=O.value,this.regex=new RegExp(l(this.ast,A.segmentValueCharset)),this.names=n(this.ast)},e.prototype.match=function(p){var u,y;return y=this.regex.exec(p),y==null?null:(u=y.slice(1),this.names?v(this.names,u):u)},e.prototype.stringify=function(p){if(p==null&&(p={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(p!==Object(p))throw new Error("argument must be an object or undefined");return D(this.ast,p,{})},e.escapeForRegex=f,e.concatMap=h,e.stringConcatMap=S,e.regexGroupCount=P,e.keysAndValuesToObject=v,e.P=i,e.newParser=b,e.defaultOptions=d,e.astNodeToRegexString=l,e.astNodeToNames=n,e.getParam=m,e.astNodeContainsSegmentsForProvidedParams=o,e.stringify=D,e})})(Ys,Ys.exports);var Oo=Ys.exports;const de=So(Oo),Do=$o,ko=Co,Lo=ns,Eo=os,pe=Q,No=rt,Ke=X,To=je,tt=N,jo=Se,Mo=de;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:Do,Arrays:ko,DataBindObserver:Lo,Format:Eo,HTML:pe,LocationHandler:No,Objects:Ke,PublisherProxy:To,PublisherManager:tt,api:jo,URLPattern:Mo};var Io=Object.defineProperty,zo=Object.getOwnPropertyDescriptor,De=(r,t,s,i)=>{for(var e=i>1?void 0:i?zo(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&&Io(t,s,e),e};const Gs=r=>{class t extends r{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this.unCheckOnDisconnect=!1,this._checked=null,this.updateAllChecked=()=>{const i=this.getAttribute("name"),e=this.getCheckAllPublisher(),o=this.getFormPublisher();if(e!=null&&e.hasCheckAll.get()&&!this.checksAll()&&e&&o&&i){if(o[this.name].get().length)(this.checked===null||e.checkMode.get()=="noneChecked"||e.checkMode.get()==null)&&(e.checkMode="someUnchecked");else{e.checkMode="noneChecked";return}const n=o[i].get(),l=e.values.get();if(l&&l.length){let c=l.length;for(const h of l)n.indexOf(h)==-1&&(c-=1);c==l.length&&(e.checkMode="allChecked"),c==0&&(e.checkMode="noneChecked")}l.indexOf(this.value)==-1&&(this.checked=null)}},this.onChecksAllRequest=i=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),i=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),i=="noneChecked"&&(this.checked=null),i=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(i){if(this.value==i||(this.hasAttribute("value")&&!this.forceAutoFill&&(i=this.getAttribute("value")),this._value==i)||i==null||(this._value=i,!this.value))return;const e=this.getFormPublisher();if(e&&this.name){let o=e[this.name].get();(this.radio||this.unique)&&(this.checked=o==i?!0:null),Array.isArray(o)||(o=[]),o.indexOf(i)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(i){if(this.setCheckedValue(i),this.checksAll()){const e=this.getCheckAllPublisher();if(e){if(this.checked===!0)e.checkMode="allChecked";else if(this.checked===null){e.checkMode="noneChecked";const o=this.getFormPublisher();o&&(o[this.name]=[])}}}this.requestUpdate()}validateFormElement(){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("input");if(!i||i.checkValidity())return;const e=this.getFormPublisher();if(e){const n=e[this.name].get();if((this.unique||this.radio)&&n!==null&&n.toString().length>0)return;e.isFormValid=!1,i.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(i){this._checked!=i&&(this._checked=i,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const i=this.checked===!0?this.radio?!0:null:!0;this.checked=i;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){const i=this.getFormPublisher();if(!i)return null;let e=i[this.name].get();if(this.radio)return this.checked===!0&&this.value!=null?this.value:e;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(e)||(e=[]),e=e.slice(0);const o=e.indexOf(this.value);return this.checked===!0&&o===-1&&!this.checksAll()&&e.push(this.value),this.checked===null&&o!==-1&&e.splice(o,1),e}setFormValueFromPublisher(i){if(this.unique||this.radio){this.checked=this.value==i?!0:null;return}Array.isArray(i)||(i=[]),!this.checksAll()&&(this.checked=i.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const i=this.formDataProvider,e=this.getAttribute("name");return!i||!e?null:tt.get(i+"/"+e+"/_available_values_")}disconnectedCallback(){super.disconnectedCallback();const i=this.getCheckAllPublisher();if(i&&(i.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=i.values.get().slice(0),o=e.indexOf(this.value);o!=-1&&(e.splice(o,1),i.values=e)}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){super.connectedCallback();const i=this.getFormPublisher();if(i&&this.name){const o=i[this.name].get();o&&Array.isArray(o)&&o.indexOf(this.value)!==-1&&(this.checked=!0)}const e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&(e.hasCheckAll=!0),e.values.get()||(e.values=[]),this.checksAll()||(e.values=[...e.values.get(),this.value])),this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&setTimeout(()=>this.checked=!0,1)}}return De([a()],t.prototype,"value",1),De([a()],t.prototype,"forceAutoFill",2),De([a({type:Boolean})],t.prototype,"unique",2),De([a({type:Boolean})],t.prototype,"radio",2),De([a({type:Boolean})],t.prototype,"unCheckOnDisconnect",2),De([a()],t.prototype,"checked",1),t};/**
|
|
73
73
|
* @license
|
|
74
74
|
* Copyright 2018 Google LLC
|
|
75
75
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -2017,7 +2017,7 @@
|
|
|
2017
2017
|
:host([inline]) {
|
|
2018
2018
|
vertical-align: baseline;
|
|
2019
2019
|
}
|
|
2020
|
-
`],Gt([j()],nt.prototype,"open",2),Gt([se("slot:not([name=content])")],nt.prototype,"popBtn",2),Gt([se("slot[name=content]")],nt.prototype,"popContent",2),Gt([a({type:Boolean})],nt.prototype,"noToggle",2),Gt([a({type:Boolean,reflect:!0})],nt.prototype,"inline",2),Gt([a({type:String,reflect:!0})],nt.prototype,"shadow",2),Gt([a({type:String})],nt.prototype,"placement",2),nt=Gt([_(za)],nt);var Fa=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,Ua=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ra(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&&Fa(t,s,e),e};const Va="sonic-menu-item";let xr=class extends M{constructor(){super()}connectedCallback(){this.hasAttribute("variant")||(this.variant="ghost"),this.hasAttribute("type")||(this.type="default"),this.hasAttribute("shape")||(this.shape="block");const r=this.shape==="square"||this.shape==="circle";!this.hasAttribute("align")&&!r&&(this.align="left"),super.connectedCallback()}};xr=Ua([_(Va)],xr);class Pr{constructor(t,{target:s,config:i,callback:e,skipInitial:o}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,s!==null&&this.t.add(s??t),this.l=i,this.o=o??this.o,this.callback=e,window.ResizeObserver?(this.u=new ResizeObserver(n=>{this.handleChanges(n),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){var s;this.value=(s=this.callback)==null?void 0:s.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}var Ba=Object.defineProperty,Ha=Object.getOwnPropertyDescriptor,ft=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ha(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&&Ba(t,s,e),e};let at=class extends ei(ur(pr(qt(w)))){constructor(){super(...arguments),this.size="md",this.placeholder="",this.filteredFields="",this.readonly=null,this.dataProviderExpression="",this.minSearchLength=0,this.key="",this.searchParameter="",this.propertyName="",this.hasInputPrefix=!1,this._resizeController=new Pr(this,{}),this.isPopVisible=!1,this.searchDataProvider="",this.initSearchDataProvider="",this.queueDataProvider="",this.initQueueDataProvider="",this.lastValidSearch="",this.updateSearchParameter=r=>{var s;if(r==""){this.lastValidSearch="";return}this.queryQueueListItem(this.queueDataProvider,this.findSelection,this.setSearchFromSelection)===!1&&(this.lastValidSearch=r,(s=this.searchPublisher)==null||s.set(this.lastValidSearch))},this.updatePopContentVisibility=r=>{this.isPopVisible=((r==null?void 0:r.length)||0)>=this.minSearchLength},this.initSearchParameter=()=>{this.queryQueueListItem(this.initQueueDataProvider,this.findSelection,this.setSearchFromSelection)},this.selectListItem=r=>{var s;const t=this.propertyName==="_self"?r:r[this.propertyName||this.name];(s=this.formValuePublisher)==null||s.set(t)},this.findSearchedItem=r=>{var s;return(this.propertyName==="_self"?r:r[this.propertyName||this.searchParameter||this.name])==((s=this.searchPublisher)==null?void 0:s.get())},this.findSelection=r=>(this.propertyName==="_self"?r:r[this.propertyName||this.name])==this.value,this.setSearchFromSelection=r=>{var t;this.lastValidSearch=this.propertyName==="_self"?r:r[this.searchParameter||this.propertyName||this.name],(t=this.searchPublisher)==null||t.set(this.lastValidSearch)},this.updateActiveSelection=()=>{var r,t,s;this.queryQueueListItem(this.queueDataProvider,this.findSearchedItem,this.selectListItem),!this.select&&this.lastValidSearch&&this.lastValidSearch!=((r=this.searchPublisher)==null?void 0:r.get())&&((t=this.formValuePublisher)!=null&&t.get())&&((s=this.formValuePublisher)==null||s.set(""))}}hasSlotOrProps(){var r;this.hasInputPrefix=!!((r=this.slotInputPrefixNodes)!=null&&r.length)}connectedCallback(){var e,o,n,l;super.connectedCallback();const r=this.searchParameter||this.name,t=this.getAncestorAttributeValue("formDataProvider"),s=t+"__"+this.name+"__autocomplete";this.initSearchDataProvider=`${s}_init_search__`,this.initQueueDataProvider=`${s}_init_queue__`,this.searchDataProvider=`${s}_search__`,this.queueDataProvider=`${s}_queue__`;const i=tt.get;this.searchPublisher=i(this.searchDataProvider)[r],this.formValuePublisher=i(t)[this.name],this.countPublisher=i(this.queueDataProvider).resultCount,this.initCountPublisher=i(this.initQueueDataProvider).resultCount,this.value&&(tt.get(this.initSearchDataProvider)[this.name]=this.value),(e=this.initCountPublisher)==null||e.onAssign(this.initSearchParameter),(o=this.formValuePublisher)==null||o.onAssign(this.updateSearchParameter),(n=this.countPublisher)==null||n.onAssign(this.updateActiveSelection),(l=this.searchPublisher)==null||l.onAssign(this.updatePopContentVisibility)}disconnectedCallback(){var t,s,i,e;super.disconnectedCallback(),(t=this.initCountPublisher)==null||t.offAssign(this.initSearchParameter),(s=this.formValuePublisher)==null||s.offAssign(this.updateSearchParameter),(i=this.countPublisher)==null||i.offAssign(this.updateActiveSelection);const r=tt.get;r(this.initSearchDataProvider).delete(),r(this.initQueueDataProvider).delete(),r(this.searchDataProvider).delete(),r(this.queueDataProvider).delete(),(e=this.searchPublisher)==null||e.offAssign(this.updatePopContentVisibility)}queryQueueListItem(r,t,s){const i=tt.get(r);let e;const o=i.get();if(Array.isArray(o)){for(const n of o){const l=tt.get(n.dataProvider).get();if(Array.isArray(l)&&(e=l.find(t),e))break}return e?(s(e),!0):!1}}setSelectionRange(r,t){var s;(s=this.querySelector("sonic-input"))==null||s.setSelectionRange(r,t)}handleHide(){var r,t,s;if(this.select){if(((r=this.searchPublisher)==null?void 0:r.get())==""){this.lastValidSearch="",(t=this.formValuePublisher)==null||t.set("");return}(s=this.searchPublisher)==null||s.set(this.lastValidSearch)}}render(){return g`
|
|
2020
|
+
`],Gt([j()],nt.prototype,"open",2),Gt([se("slot:not([name=content])")],nt.prototype,"popBtn",2),Gt([se("slot[name=content]")],nt.prototype,"popContent",2),Gt([a({type:Boolean})],nt.prototype,"noToggle",2),Gt([a({type:Boolean,reflect:!0})],nt.prototype,"inline",2),Gt([a({type:String,reflect:!0})],nt.prototype,"shadow",2),Gt([a({type:String})],nt.prototype,"placement",2),nt=Gt([_(za)],nt);var Fa=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,Ua=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ra(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&&Fa(t,s,e),e};const Va="sonic-menu-item";let xr=class extends M{constructor(){super()}connectedCallback(){this.hasAttribute("variant")||(this.variant="ghost"),this.hasAttribute("type")||(this.type="default"),this.hasAttribute("shape")||(this.shape="block");const r=this.shape==="square"||this.shape==="circle";!this.hasAttribute("align")&&!r&&(this.align="left"),super.connectedCallback()}};xr=Ua([_(Va)],xr);class Pr{constructor(t,{target:s,config:i,callback:e,skipInitial:o}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,s!==null&&this.t.add(s??t),this.l=i,this.o=o??this.o,this.callback=e,window.ResizeObserver?(this.u=new ResizeObserver(n=>{this.handleChanges(n),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){var s;this.value=(s=this.callback)==null?void 0:s.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}var Ba=Object.defineProperty,Ha=Object.getOwnPropertyDescriptor,ft=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ha(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&&Ba(t,s,e),e};let at=class extends ei(ur(pr(qt(w)))){constructor(){super(...arguments),this.size="md",this.placeholder="",this.filteredFields="",this.readonly=null,this.dataProviderExpression="",this.minSearchLength=0,this.key="",this.searchParameter="",this.propertyName="",this.hasInputPrefix=!1,this._resizeController=new Pr(this,{}),this.isPopVisible=!1,this.searchDataProvider="",this.initSearchDataProvider="",this.queueDataProvider="",this.initQueueDataProvider="",this.lastValidSearch="",this.updateSearchParameter=r=>{var s;if(r==""){this.lastValidSearch="";return}this.queryQueueListItem(this.queueDataProvider,this.findSelection,this.setSearchFromSelection)===!1&&(this.lastValidSearch=r,(s=this.searchPublisher)==null||s.set(this.lastValidSearch))},this.updatePopContentVisibility=r=>{this.isPopVisible=((r==null?void 0:r.length)||0)>=this.minSearchLength},this.initSearchParameter=()=>{this.queryQueueListItem(this.initQueueDataProvider,this.findSelection,this.setSearchFromSelection)},this.selectListItem=r=>{var s;const t=this.propertyName==="_self"?r:r[this.propertyName||this.name];(s=this.formValuePublisher)==null||s.set(t)},this.findSearchedItem=r=>{var s;return(this.propertyName==="_self"?r:r[this.propertyName||this.searchParameter||this.name])==((s=this.searchPublisher)==null?void 0:s.get())},this.findSelection=r=>(this.propertyName==="_self"?r:r[this.propertyName||this.name])==this.value,this.setSearchFromSelection=r=>{var t;this.lastValidSearch=this.propertyName==="_self"?r:r[this.searchParameter||this.propertyName||this.name],(t=this.searchPublisher)==null||t.set(this.lastValidSearch)},this.updateActiveSelection=()=>{var r,t,s;this.queryQueueListItem(this.queueDataProvider,this.findSearchedItem,this.selectListItem),!this.select&&this.lastValidSearch&&this.lastValidSearch!=((r=this.searchPublisher)==null?void 0:r.get())&&((t=this.formValuePublisher)!=null&&t.get())&&((s=this.formValuePublisher)==null||s.set(""))}}hasSlotOrProps(){var r;this.hasInputPrefix=!!((r=this.slotInputPrefixNodes)!=null&&r.length)}connectedCallback(){var e,o,n,l;console.log(this.value,this.getAttribute("value")),super.connectedCallback(),console.log(this.value,this.getAttribute("value"));const r=this.searchParameter||this.name,t=this.getAncestorAttributeValue("formDataProvider"),s=t+"__"+this.name+"__autocomplete";this.initSearchDataProvider=`${s}_init_search__`,this.initQueueDataProvider=`${s}_init_queue__`,this.searchDataProvider=`${s}_search__`,this.queueDataProvider=`${s}_queue__`;const i=tt.get;this.searchPublisher=i(this.searchDataProvider)[r],this.formValuePublisher=i(t)[this.name],this.countPublisher=i(this.queueDataProvider).resultCount,this.initCountPublisher=i(this.initQueueDataProvider).resultCount,this.value&&(tt.get(this.initSearchDataProvider)[this.name]=this.value),(e=this.initCountPublisher)==null||e.onAssign(this.initSearchParameter),(o=this.formValuePublisher)==null||o.onAssign(this.updateSearchParameter),(n=this.countPublisher)==null||n.onAssign(this.updateActiveSelection),(l=this.searchPublisher)==null||l.onAssign(this.updatePopContentVisibility)}disconnectedCallback(){var t,s,i,e;super.disconnectedCallback(),(t=this.initCountPublisher)==null||t.offAssign(this.initSearchParameter),(s=this.formValuePublisher)==null||s.offAssign(this.updateSearchParameter),(i=this.countPublisher)==null||i.offAssign(this.updateActiveSelection);const r=tt.get;r(this.initSearchDataProvider).delete(),r(this.initQueueDataProvider).delete(),r(this.searchDataProvider).delete(),r(this.queueDataProvider).delete(),(e=this.searchPublisher)==null||e.offAssign(this.updatePopContentVisibility)}queryQueueListItem(r,t,s){const i=tt.get(r);let e;const o=i.get();if(Array.isArray(o)){for(const n of o){const l=tt.get(n.dataProvider).get();if(Array.isArray(l)&&(e=l.find(t),e))break}return e?(s(e),!0):!1}}setSelectionRange(r,t){var s;(s=this.querySelector("sonic-input"))==null||s.setSelectionRange(r,t)}handleHide(){var r,t,s;if(this.select){if(((r=this.searchPublisher)==null?void 0:r.get())==""){this.lastValidSearch="",(t=this.formValuePublisher)==null||t.set("");return}(s=this.searchPublisher)==null||s.set(this.lastValidSearch)}}render(){var r;return g`
|
|
2021
2021
|
<sonic-pop noToggle style="display:block;" @hide=${this.handleHide}>
|
|
2022
2022
|
<sonic-input
|
|
2023
2023
|
dataProvider="${this.initSearchDataProvider+Math.random()}"
|
|
@@ -2033,6 +2033,7 @@
|
|
|
2033
2033
|
clearable
|
|
2034
2034
|
inlineContent
|
|
2035
2035
|
size=${this.size}
|
|
2036
|
+
value="${x(((r=this.searchPublisher)==null?void 0:r.get())||this.value)}"
|
|
2036
2037
|
>
|
|
2037
2038
|
<slot
|
|
2038
2039
|
name="prefix"
|
package/concorde-core.es.js
CHANGED
|
@@ -495,7 +495,7 @@ let T = (k = class {
|
|
|
495
495
|
const h = await new Response(l.readable).arrayBuffer();
|
|
496
496
|
return new TextDecoder().decode(h);
|
|
497
497
|
}
|
|
498
|
-
}, k.buildDate = "Fri Jul 12 2024
|
|
498
|
+
}, k.buildDate = "Fri Jul 12 2024 17:19:05 GMT+0200 (Central European Summer Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
|
|
499
499
|
const Us = window;
|
|
500
500
|
Us.SonicPublisherManager || (Us.SonicPublisherManager = T);
|
|
501
501
|
Us.SonicPublisherManager.registerInstance(
|
|
@@ -2697,7 +2697,7 @@ const ns = /* @__PURE__ */ new Map(), De = (r) => {
|
|
|
2697
2697
|
return this._value;
|
|
2698
2698
|
}
|
|
2699
2699
|
set value(i) {
|
|
2700
|
-
i == null && (i = ""), X.isObject(i) && Object.prototype.hasOwnProperty.call(i, "__value") && i._value == null && (i = ""), this._value != i && (this._value = i, this.updateDataValue(), this.requestUpdate());
|
|
2700
|
+
i == null && (i = ""), X.isObject(i) && Object.prototype.hasOwnProperty.call(i, "__value") && i._value == null && (i = ""), this._value != i && (i || console.trace(this.name, this._value, i), this._value = i, this.updateDataValue(), this.requestUpdate());
|
|
2701
2701
|
}
|
|
2702
2702
|
initPublisher() {
|
|
2703
2703
|
let i = this.getFormPublisher();
|
|
@@ -2769,7 +2769,7 @@ const ns = /* @__PURE__ */ new Map(), De = (r) => {
|
|
|
2769
2769
|
connectedCallback() {
|
|
2770
2770
|
this.formDataProvider = this.getAncestorAttributeValue(
|
|
2771
2771
|
"formDataProvider"
|
|
2772
|
-
), super.connectedCallback(), this.addKeyboardNavigation();
|
|
2772
|
+
), this.value && this.setAttribute("value", this.value), super.connectedCallback(), this.addKeyboardNavigation();
|
|
2773
2773
|
}
|
|
2774
2774
|
disconnectedCallback() {
|
|
2775
2775
|
super.disconnectedCallback(), this._name && this.publisher && this.publisher[this._name].offAssign(this.onValueAssign);
|
|
@@ -8196,7 +8196,7 @@ let nt = class extends ui(
|
|
|
8196
8196
|
}
|
|
8197
8197
|
connectedCallback() {
|
|
8198
8198
|
var e, o, n, l;
|
|
8199
|
-
super.connectedCallback();
|
|
8199
|
+
console.log(this.value, this.getAttribute("value")), super.connectedCallback(), console.log(this.value, this.getAttribute("value"));
|
|
8200
8200
|
const r = this.searchParameter || this.name, t = this.getAncestorAttributeValue("formDataProvider"), s = t + "__" + this.name + "__autocomplete";
|
|
8201
8201
|
this.initSearchDataProvider = `${s}_init_search__`, this.initQueueDataProvider = `${s}_init_queue__`, this.searchDataProvider = `${s}_search__`, this.queueDataProvider = `${s}_queue__`;
|
|
8202
8202
|
const i = J.get;
|
|
@@ -8245,6 +8245,7 @@ let nt = class extends ui(
|
|
|
8245
8245
|
}
|
|
8246
8246
|
}
|
|
8247
8247
|
render() {
|
|
8248
|
+
var r;
|
|
8248
8249
|
return g`
|
|
8249
8250
|
<sonic-pop noToggle style="display:block;" @hide=${this.handleHide}>
|
|
8250
8251
|
<sonic-input
|
|
@@ -8261,6 +8262,7 @@ let nt = class extends ui(
|
|
|
8261
8262
|
clearable
|
|
8262
8263
|
inlineContent
|
|
8263
8264
|
size=${this.size}
|
|
8265
|
+
value="${x(((r = this.searchPublisher) == null ? void 0 : r.get()) || this.value)}"
|
|
8264
8266
|
>
|
|
8265
8267
|
<slot
|
|
8266
8268
|
name="prefix"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Q){typeof define=="function"&&define.amd?define(Q):Q()})(function(){"use strict";var jt,k,L,Er,t,G;let Q=class It{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=It.getAncestorAttributeValue(t,"token"),i=It.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=It.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=It.getAncestorAttributeValue(t,"tokenProvider"),c=It.getAncestorAttributeValue(t,"eventsApiToken");s||(o=It.getAncestorAttributeValue(t,"userName"),n=It.getAncestorAttributeValue(t,"password"));const h=It.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),f=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:f}}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 It.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)})}},os=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=Q.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,f){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:f}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),l&&c.push(o(s,"minute",i)(l)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}};function Te(r){return typeof r=="object"&&r!=null}const Tr=async()=>new Promise(r=>{window.queueMicrotask(()=>r(null))});let Pe="sonic";typeof __SONIC_PREFIX__>"u"&&(Pe="sonic"+Math.floor(Math.random()*1e6));const Es=Pe=="sonic"?"publisher-proxies-data":Pe+"-publisher-proxies-data";let Ns=(jt=class{constructor(t,s){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=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.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._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),jt.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.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){this._assignmentId_++;const s=this._assignmentId_;if(await Tr(),s!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>e(i)),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.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_()}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)}async set(t,s=!1){var o;if(this._value_===t||this._value_&&t&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;if(this._value_=Te(t)?t:{__value:t},this._cachedGet_=void 0,Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(s),!0;for(const n in this._value_)this._value_[n]===void 0&&delete this._value_[n];if(this._proxies_.forEach((n,l)=>{this._value_[l]===void 0&&l!="_parent_"&&i[l]&&(this._value_[l]=null)}),await this._publishAssignement_(),Te(this._value_))for(const n in this._value_){const l=t[n],h=Te(l)?l:{__value:l};if(!this._proxies_.has(n)){this._publishDynamicFilling_(n,l);continue}await((o=this._proxies_.get(n))==null?void 0:o.set(h,!0)),this._publishDynamicFilling_(n,l)}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_}get $tag(){return this._instanceCounter_||(jt.instancesCounter++,this._instanceCounter_=jt.instancesCounter),jt.instances.set(this._instanceCounter_,this),"<"+Pe+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+Pe+"-publisher-proxy>"}},jt.instances=new Map,jt.instancesCounter=0,jt),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(Es),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(Es,i),this.localStorageData={};const o=new Date().getTime()-1e3*60*60*12;for(const n in this.localStorageData)this.localStorageData[n].lastModifiationMS<o&&delete this.localStorageData[n];t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.log("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_"+Q.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 je(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(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_"+Q.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Es,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 l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);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,l=new n.DecompressionStream(s),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Fri Jul 12 2024 11:42:03 GMT+0200 (Central European Summer Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);const Ts=window;Ts.SonicPublisherManager||(Ts.SonicPublisherManager=N),Ts.SonicPublisherManager.registerInstance(N.getInstance());const jr=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class je extends Ns{constructor(t,s=null){super(t,s);const i=new Proxy(this,{get:function(e,o){if(o==Symbol.toPrimitive)return()=>i.get();if(jr.has(o))return e[o];if(!e._proxies_.has(o)){const n=e._value_[o],l=new je(Te(n)?n:{__value:n},e);l._proxies_.set("_parent_",i),e._proxies_.set(o,l)}return e._proxies_.get(o)},set:function(e,o,n){var c;if(o=="_value_")return e._value_=n,!0;if(o=="_cachedGet_")return e._cachedGet_=n,!0;if(o=="_assignmentId_")return e._assignmentId_=n,!0;if(o=="_is_savable_")return e._is_savable_=n,!0;if(o=="_instanceCounter_")return e._instanceCounter_=n,!0;if(!e._proxies_.has(o)){const h=new je({},e);h._proxies_.set("_parent_",i),e._proxies_.set(o,h)}return e._value_[o]!==n&&(e._value_[o]=n,e._publishDynamicFilling_(o,n),(c=e._proxies_.get(o))==null||c.set(Te(n)?n:{__value:n})),!0},deleteProperty:function(e,o){var n;return e._publishDynamicFilling_(o,null),(n=e._proxies_.get(o))==null||n.set(null),delete e._value_[o]},has:function(e,o){return o in e._value_&&o!="_lockInternalMutationPublishing_"},defineProperty:function(e,o,n){return n&&"value"in n&&(e._value_[o]=n.value),!0},getOwnPropertyDescriptor:function(e,o){return{enumerable:!0,configurable:!0}},ownKeys:function(e){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}});return i}toString(){return"hey"}valueOf(){return 2}getProperty(t,s){return t[s]}}class Mr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=Ns.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(Pe+"-publisher-proxy",Mr)}catch{}let ns=(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=Q.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 l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const d=h;let f=i;f=L.getSubPublisher(i,d);const m=t,v={publisher:f,onAssign:()=>{const b=l.variables.map(D=>{var p;return(p=L.getSubPublisher(i,D))==null?void 0:p.get()});let P=l.expression,S=!1;if(b.length==1&&l.variables[0].join(".")==P.substring(1)){let D=b[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<b.length;D++){let p=b[D];const u=l.variables[D];p===null&&(S=!0,p=void 0),P=P.replace("$"+u.join("."),p)}if(P.indexOf("|")!=-1){const D=P.indexOf("|");if(D==0)P=os.js(P.substring(1));else{const p=P.substring(0,D),u=P.substring(D+1),y=os[p];P=S?"":y?y(u):P}}else P=S?"":P;m[c]=P}};f==null||f.onAssign(v.onAssign),o.push(v)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ns.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ns);let X=class ee{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 l=t[n],c=s[n];if(i?l!==c:l!=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 l=t[n],c=s[n],h=ee.isObject(l)&&ee.isObject(c),d=i?l!==c:l!=c;if(h&&!ee.deepEqual(l,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 ee.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&&ee.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),ee.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return ee.getURLSearchArray(t,"").join("&")}};/**
|
|
1
|
+
(function(Q){typeof define=="function"&&define.amd?define(Q):Q()})(function(){"use strict";var jt,k,L,Er,t,G;let Q=class It{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=It.getAncestorAttributeValue(t,"token"),i=It.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=It.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=It.getAncestorAttributeValue(t,"tokenProvider"),c=It.getAncestorAttributeValue(t,"eventsApiToken");s||(o=It.getAncestorAttributeValue(t,"userName"),n=It.getAncestorAttributeValue(t,"password"));const h=It.getAncestorAttributeValue(t,"credentials")||void 0,d=t.getAttribute("cache"),f=t.hasAttribute("blockUntilDone");return{serviceURL:e,token:s,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:i,credentials:h,cache:d,blockUntilDone:f}}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 It.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)})}},os=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,s="",i="long"){s||(s=Q.getLanguage());const e=(h,d)=>[Math.floor(h/d),h%d];function o(h,d,f){return new Intl.NumberFormat(h,{style:"unit",unit:d,unitDisplay:f}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(s,"hour",i)(n)),l&&c.push(o(s,"minute",i)(l)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}};function Te(r){return typeof r=="object"&&r!=null}const Tr=async()=>new Promise(r=>{window.queueMicrotask(()=>r(null))});let Pe="sonic";typeof __SONIC_PREFIX__>"u"&&(Pe="sonic"+Math.floor(Math.random()*1e6));const Es=Pe=="sonic"?"publisher-proxies-data":Pe+"-publisher-proxies-data";let Ns=(jt=class{constructor(t,s){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=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.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._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),jt.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.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){this._assignmentId_++;const s=this._assignmentId_;if(await Tr(),s!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(e=>e(i)),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.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_()}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)}async set(t,s=!1){var o;if(this._value_===t||this._value_&&t&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;if(this._value_=Te(t)?t:{__value:t},this._cachedGet_=void 0,Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(s),!0;for(const n in this._value_)this._value_[n]===void 0&&delete this._value_[n];if(this._proxies_.forEach((n,l)=>{this._value_[l]===void 0&&l!="_parent_"&&i[l]&&(this._value_[l]=null)}),await this._publishAssignement_(),Te(this._value_))for(const n in this._value_){const l=t[n],h=Te(l)?l:{__value:l};if(!this._proxies_.has(n)){this._publishDynamicFilling_(n,l);continue}await((o=this._proxies_.get(n))==null?void 0:o.set(h,!0)),this._publishDynamicFilling_(n,l)}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_}get $tag(){return this._instanceCounter_||(jt.instancesCounter++,this._instanceCounter_=jt.instancesCounter),jt.instances.set(this._instanceCounter_,this),"<"+Pe+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+Pe+"-publisher-proxy>"}},jt.instances=new Map,jt.instancesCounter=0,jt),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(Es),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(Es,i),this.localStorageData={};const o=new Date().getTime()-1e3*60*60*12;for(const n in this.localStorageData)this.localStorageData[n].lastModifiationMS<o&&delete this.localStorageData[n];t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.log("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_"+Q.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 je(o);this.set(t,n)}const e=this.publishers.get(t);return i&&this.initialisedData.indexOf(t)===-1&&(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_"+Q.getLanguage()]={lastModifiationMS:new Date().getTime(),data:n},i=!0)}if(i){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Es,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 l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);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,l=new n.DecompressionStream(s),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}},k.buildDate="Fri Jul 12 2024 17:19:05 GMT+0200 (Central European Summer Time)",k.changed=!1,k.saving=!1,k.saveId=0,k.instance=null,k.instances=new Map,k.modifiedCollectore=[],k);const Ts=window;Ts.SonicPublisherManager||(Ts.SonicPublisherManager=N),Ts.SonicPublisherManager.registerInstance(N.getInstance());const jr=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class je extends Ns{constructor(t,s=null){super(t,s);const i=new Proxy(this,{get:function(e,o){if(o==Symbol.toPrimitive)return()=>i.get();if(jr.has(o))return e[o];if(!e._proxies_.has(o)){const n=e._value_[o],l=new je(Te(n)?n:{__value:n},e);l._proxies_.set("_parent_",i),e._proxies_.set(o,l)}return e._proxies_.get(o)},set:function(e,o,n){var c;if(o=="_value_")return e._value_=n,!0;if(o=="_cachedGet_")return e._cachedGet_=n,!0;if(o=="_assignmentId_")return e._assignmentId_=n,!0;if(o=="_is_savable_")return e._is_savable_=n,!0;if(o=="_instanceCounter_")return e._instanceCounter_=n,!0;if(!e._proxies_.has(o)){const h=new je({},e);h._proxies_.set("_parent_",i),e._proxies_.set(o,h)}return e._value_[o]!==n&&(e._value_[o]=n,e._publishDynamicFilling_(o,n),(c=e._proxies_.get(o))==null||c.set(Te(n)?n:{__value:n})),!0},deleteProperty:function(e,o){var n;return e._publishDynamicFilling_(o,null),(n=e._proxies_.get(o))==null||n.set(null),delete e._value_[o]},has:function(e,o){return o in e._value_&&o!="_lockInternalMutationPublishing_"},defineProperty:function(e,o,n){return n&&"value"in n&&(e._value_[o]=n.value),!0},getOwnPropertyDescriptor:function(e,o){return{enumerable:!0,configurable:!0}},ownKeys:function(e){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}});return i}toString(){return"hey"}valueOf(){return 2}getProperty(t,s){return t[s]}}class Mr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=Ns.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(Pe+"-publisher-proxy",Mr)}catch{}let ns=(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=Q.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 l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const d=h;let f=i;f=L.getSubPublisher(i,d);const m=t,v={publisher:f,onAssign:()=>{const b=l.variables.map(D=>{var p;return(p=L.getSubPublisher(i,D))==null?void 0:p.get()});let P=l.expression,S=!1;if(b.length==1&&l.variables[0].join(".")==P.substring(1)){let D=b[0];D===null&&(D=""),m[c]=D;return}for(let D=0;D<b.length;D++){let p=b[D];const u=l.variables[D];p===null&&(S=!0,p=void 0),P=P.replace("$"+u.join("."),p)}if(P.indexOf("|")!=-1){const D=P.indexOf("|");if(D==0)P=os.js(P.substring(1));else{const p=P.substring(0,D),u=P.substring(D+1),y=os[p];P=S?"":y?y(u):P}}else P=S?"":P;m[c]=P}};f==null||f.onAssign(v.onAssign),o.push(v)}}),L.publisherListeners.set(t,o)}},L.observedElements=new Map,L.enabled=!0,L.publisherListeners=new Map,L);ns.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ns);let X=class ee{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 l=t[n],c=s[n];if(i?l!==c:l!=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 l=t[n],c=s[n],h=ee.isObject(l)&&ee.isObject(c),d=i?l!==c:l!=c;if(h&&!ee.deepEqual(l,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 ee.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&&ee.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static getURLSearchArray(t,s=""){let i=[];for(let e in t){const o=t[e];s&&(e=s+"["+e+"]"),ee.isObject(o)?i=[...i,...this.getURLSearchArray(o,e)]:i.push(`${e}=${o}`)}return i}static getURLSearchString(t){return ee.getURLSearchArray(t,"").join("&")}};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
* @license
|
|
70
70
|
* Copyright 2018 Google LLC
|
|
71
71
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
72
|
-
*/const Xi="important",_o=" !"+Xi,pt=he(class extends Ae{constructor(r){var t;if(super(r),r.type!==ce.ATTRIBUTE||r.name!=="style"||((t=r.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((t,s)=>{const i=r[s];return i==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(r,[t]){const{style:s}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in t){const e=t[i];if(e!=null){this.ft.add(i);const o=typeof e=="string"&&e.endsWith(_o);i.includes("-")||o?s.setProperty(i,o?e.slice(0,-11):e,o?Xi:""):s[i]=e}}return mt}});var xo=Object.defineProperty,Po=Object.getOwnPropertyDescriptor,Ct=(r,t,s,i)=>{for(var e=i>1?void 0:i?Po(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&&xo(t,s,e),e};const fs=new Map,Oe=r=>{class t extends r{constructor(...i){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=e=>{this.setValueFromPublisher(e)},this.onFormValueAssign=async e=>{this.setFormValueFromPublisher(e)},this.onFormDataInValidate=()=>{const e=this.getFormPublisher();e&&e.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(i){this.hasAttribute("name")&&!this.forceAutoFill&&(i=this.getAttribute("name")),this._name=i,this.requestUpdate()}validateFormElement(){}updateDataValue(){const i=this.getAttribute("name");if(i){const e=this.getFormPublisher();e&&(e[i]=this.getValueForFormPublisher(),this.setFormValueFromPublisher(e[i].get()))}}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?N.get(this.formDataProvider):null}getValueForFormPublisher(){return this.value}setValueFromPublisher(i){this.value=i}setFormValueFromPublisher(i){this.value=i}get value(){return this._value}set value(i){i==null&&(i=""),X.isObject(i)&&Object.prototype.hasOwnProperty.call(i,"__value")&&i._value==null&&(i=""),this._value!=i&&(this._value=i,this.updateDataValue(),this.requestUpdate())}initPublisher(){let i=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&i[this._name].get()?i[this._name].get():this.getAttribute("value");this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign),this._name&&i&&i[this._name].offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.publisher&&this._name&&this.publisher[this._name].onAssign(this.onValueAssign),i=this.getFormPublisher(),this._name&&i&&(i[this._name].onAssign(this.onFormValueAssign),i.onInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(i){this.value=i.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const i=this.getAncestorAttributeValue("data-keyboard-nav");if(!i)return;const e=i.split(" "),o=e[0];if(!o)return;for(const l of e){fs.has(l)||fs.set(l,[]);const c=fs.get(l);(c==null?void 0:c.indexOf(this))==-1&&c.push(this)}const n=fs.get(o);this.addEventListener("keydown",l=>{var v;const c=l;if(!["ArrowDown","ArrowUp"].includes(c.key))return;const h="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",d=n==null?void 0:n.filter(b=>{var D;const P=(D=b.shadowRoot)==null?void 0:D.querySelector(h);if(!P)return!1;const S=window.getComputedStyle(P);return S.display!=="none"&&S.display!==""&&S.pointerEvents!="none"&&S.visibility!=="hidden"&&P.getBoundingClientRect().width>0});let f=null;if(c.key=="ArrowDown"&&d){const b=d.indexOf(this);b==d.length-1?f=d[0]:f=d[b+1]}else if(c.key=="ArrowUp"&&d){const b=d.indexOf(this);b==0?f=d[d.length-1]:f=d[b-1]}const m=(v=f==null?void 0:f.shadowRoot)==null?void 0:v.querySelector(h);m&&m.focus&&(m.focus(),l.preventDefault(),l.stopPropagation())})}focus(){var e;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("[data-form-element]");i==null||i.focus()}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);const i=this.getFormPublisher();this._name&&i&&(i[this._name].offAssign(this.onFormValueAssign),i.offInvalidate(this.onFormDataInValidate))}}return Ct([a({type:Boolean,reflect:!0})],t.prototype,"touched",2),Ct([a({type:Boolean})],t.prototype,"error",2),Ct([a({type:Boolean})],t.prototype,"autofocus",2),Ct([a({type:Boolean})],t.prototype,"required",2),Ct([a({type:Boolean})],t.prototype,"forceAutoFill",2),Ct([a({type:Boolean})],t.prototype,"disabled",2),Ct([a({type:String,attribute:"data-aria-label"})],t.prototype,"ariaLabel",2),Ct([a({type:String,attribute:"data-aria-labelledby"})],t.prototype,"ariaLabelledby",2),Ct([a()],t.prototype,"name",1),Ct([a()],t.prototype,"value",1),t};let $o=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},Co=class xe{static areEqual(t,s){return t.length===s.length?t.every((i,e)=>i===s[e]):!1}static from2d(t){return{to1D:()=>{let s=[];return t.forEach(i=>s=s.concat(i)),this.from(s)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:s=>{if(t.length<1)return!0;const i=(t[0]||{})[s];return t.every(e=>(e||{})[s]==i)}})})}),value:()=>({forKey:s=>xe.from(t.map(i=>i[s]))}),copy:()=>({fromKey:s=>({toKey:i=>{t.forEach(e=>{e[i]=Array.isArray(e[s])?[...e[s]]:typeof e[s]=="object"&&e[s]!=null?{...e[s]}:e[s]})}})})}),map:s=>xe.from(t.map(s)),filter:s=>xe.from(t.filter(s)),find:s=>t.find(s),some:s=>t.some(s),every:s=>t.every(s),group:()=>({byKey:s=>{const i=[],e=new Map;for(const o of t){const n=o[s];if(!e.has(n)){const l=i.length;e.set(n,l);const c={items:[]};c[s]=n,i.push(c)}i[e.get(n)].items.push(o)}return xe.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(t.map(e=>e[s]))];return xe.from(i.map(e=>t.find(o=>o[s]==e)))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>{const e=(o,n)=>l=>o[n]!=l[n];return xe.from(t.filter(o=>s.every(e(o,i))))}})})})}}};var Ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function So(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ys={exports:{}};(function(r,t){var s=[].slice;(function(i,e){return t!==null?r.exports=e():i.UrlPattern=e()})(Ao,function(){var i,e,o,n,l,c,h,d,f,m,v,b,P,S,D;return f=function(p){return p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(p,u){var y,A,O;for(O=[],y=-1,A=p.length;++y<A;)O=O.concat(u(p[y]));return O},S=function(p,u){var y,A,O;for(O="",y=-1,A=p.length;++y<A;)O+=u(p[y]);return O},P=function(p){return new RegExp(p.toString()+"|").exec("").length-1},v=function(p,u){var y,A,O,E,V;for(E={},y=-1,O=p.length;++y<O;)A=p[y],V=u[y],V!=null&&(E[A]!=null?(Array.isArray(E[A])||(E[A]=[E[A]]),E[A].push(V)):E[A]=V);return E},i={},i.Result=function(p,u){this.value=p,this.rest=u},i.Tagged=function(p,u){this.tag=p,this.value=u},i.tag=function(p,u){return function(y){var A,O;if(A=u(y),A!=null)return O=new i.Tagged(p,A.value),new i.Result(O,A.rest)}},i.regex=function(p){return function(u){var y,A;if(y=p.exec(u),y!=null)return A=y[0],new i.Result(A,u.slice(A.length))}},i.sequence=function(){var p;return p=1<=arguments.length?s.call(arguments,0):[],function(u){var y,A,O,E,V,q;for(y=-1,A=p.length,q=[],E=u;++y<A;){if(O=p[y],V=O(E),V==null)return;q.push(V.value),E=V.rest}return new i.Result(q,E)}},i.pick=function(){var p,u;return p=arguments[0],u=2<=arguments.length?s.call(arguments,1):[],function(y){var A,O;if(O=i.sequence.apply(i,u)(y),O!=null)return A=O.value,O.value=A[p],O}},i.string=function(p){var u;return u=p.length,function(y){if(y.slice(0,u)===p)return new i.Result(p,y.slice(u))}},i.lazy=function(p){var u;return u=null,function(y){return u==null&&(u=p()),u(y)}},i.baseMany=function(p,u,y,A,O){var E,V,q,Mt;for(q=O,Mt=y?"":[];!(u!=null&&(E=u(q),E!=null)||(V=p(q),V==null));)y?Mt+=V.value:Mt.push(V.value),q=V.rest;if(!(A&&Mt.length===0))return new i.Result(Mt,q)},i.many1=function(p){return function(u){return i.baseMany(p,null,!1,!0,u)}},i.concatMany1Till=function(p,u){return function(y){return i.baseMany(p,u,!0,!0,y)}},i.firstChoice=function(){var p;return p=1<=arguments.length?s.call(arguments,0):[],function(u){var y,A,O,E;for(y=-1,A=p.length;++y<A;)if(O=p[y],E=O(u),E!=null)return E}},b=function(p){var u;return u={},u.wildcard=i.tag("wildcard",i.string(p.wildcardChar)),u.optional=i.tag("optional",i.pick(1,i.string(p.optionalSegmentStartChar),i.lazy(function(){return u.pattern}),i.string(p.optionalSegmentEndChar))),u.name=i.regex(new RegExp("^["+p.segmentNameCharset+"]+")),u.named=i.tag("named",i.pick(1,i.string(p.segmentNameStartChar),i.lazy(function(){return u.name}))),u.escapedChar=i.pick(1,i.string(p.escapeChar),i.regex(/^./)),u.static=i.tag("static",i.concatMany1Till(i.firstChoice(i.lazy(function(){return u.escapedChar}),i.regex(/^./)),i.firstChoice(i.string(p.segmentNameStartChar),i.string(p.optionalSegmentStartChar),i.string(p.optionalSegmentEndChar),u.wildcard))),u.token=i.lazy(function(){return i.firstChoice(u.wildcard,u.optional,u.named,u.static)}),u.pattern=i.many1(i.lazy(function(){return u.token})),u},d={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(p,u){if(Array.isArray(p))return S(p,function(y){return c(y,u)});switch(p.tag){case"wildcard":return"(.*?)";case"named":return"(["+u+"]+)";case"static":return f(p.value);case"optional":return"(?:"+c(p.value,u)+")?"}},l=function(p,u){return u==null&&(u=d.segmentValueCharset),"^"+c(p,u)+"$"},n=function(p){if(Array.isArray(p))return h(p,n);switch(p.tag){case"wildcard":return["_"];case"named":return[p.value];case"static":return[];case"optional":return n(p.value)}},m=function(p,u,y,A){var O,E,V,q;if(A==null&&(A=!1),q=p[u],q==null){if(A)throw new Error("no values provided for key `"+u+"`");return}if(O=y[u]||0,E=Array.isArray(q)?q.length-1:0,O>E){if(A)throw new Error("too few values provided for key `"+u+"`");return}return V=Array.isArray(q)?q[O]:q,A&&(y[u]=O+1),V},o=function(p,u,y){var A,O;if(Array.isArray(p)){for(A=-1,O=p.length;++A<O;)if(o(p[A],u,y))return!0;return!1}switch(p.tag){case"wildcard":return m(u,"_",y,!1)!=null;case"named":return m(u,p.value,y,!1)!=null;case"static":return!1;case"optional":return o(p.value,u,y)}},D=function(p,u,y){if(Array.isArray(p))return S(p,function(A){return D(A,u,y)});switch(p.tag){case"wildcard":return m(u,"_",y,!0);case"named":return m(u,p.value,y,!0);case"static":return p.value;case"optional":return o(p.value,u,y)?D(p.value,u,y):""}},e=function(p,u){var y,A,O,E,V;if(p instanceof e){this.isRegex=p.isRegex,this.regex=p.regex,this.ast=p.ast,this.names=p.names;return}if(this.isRegex=p instanceof RegExp,!(typeof p=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=p,u!=null){if(!Array.isArray(u))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(y=P(this.regex),u.length!==y)throw new Error("regex contains "+y+" groups but array of group names contains "+u.length);this.names=u}return}if(p==="")throw new Error("argument must not be the empty string");if(V=p.replace(/\s+/g,""),V!==p)throw new Error("argument must not contain whitespace");if(A={escapeChar:(u!=null?u.escapeChar:void 0)||d.escapeChar,segmentNameStartChar:(u!=null?u.segmentNameStartChar:void 0)||d.segmentNameStartChar,segmentNameCharset:(u!=null?u.segmentNameCharset:void 0)||d.segmentNameCharset,segmentValueCharset:(u!=null?u.segmentValueCharset:void 0)||d.segmentValueCharset,optionalSegmentStartChar:(u!=null?u.optionalSegmentStartChar:void 0)||d.optionalSegmentStartChar,optionalSegmentEndChar:(u!=null?u.optionalSegmentEndChar:void 0)||d.optionalSegmentEndChar,wildcardChar:(u!=null?u.wildcardChar:void 0)||d.wildcardChar},E=b(A),O=E.pattern(p),O==null)throw new Error("couldn't parse pattern");if(O.rest!=="")throw new Error("could only partially parse pattern");this.ast=O.value,this.regex=new RegExp(l(this.ast,A.segmentValueCharset)),this.names=n(this.ast)},e.prototype.match=function(p){var u,y;return y=this.regex.exec(p),y==null?null:(u=y.slice(1),this.names?v(this.names,u):u)},e.prototype.stringify=function(p){if(p==null&&(p={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(p!==Object(p))throw new Error("argument must be an object or undefined");return D(this.ast,p,{})},e.escapeForRegex=f,e.concatMap=h,e.stringConcatMap=S,e.regexGroupCount=P,e.keysAndValuesToObject=v,e.P=i,e.newParser=b,e.defaultOptions=d,e.astNodeToRegexString=l,e.astNodeToNames=n,e.getParam=m,e.astNodeContainsSegmentsForProvidedParams=o,e.stringify=D,e})})(Ys,Ys.exports);var Oo=Ys.exports;const de=So(Oo),Do=$o,ko=Co,Lo=ns,Eo=os,pe=Q,No=rt,Ke=X,To=je,tt=N,jo=Se,Mo=de;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:Do,Arrays:ko,DataBindObserver:Lo,Format:Eo,HTML:pe,LocationHandler:No,Objects:Ke,PublisherProxy:To,PublisherManager:tt,api:jo,URLPattern:Mo};var Io=Object.defineProperty,zo=Object.getOwnPropertyDescriptor,De=(r,t,s,i)=>{for(var e=i>1?void 0:i?zo(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&&Io(t,s,e),e};const Gs=r=>{class t extends r{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this.unCheckOnDisconnect=!1,this._checked=null,this.updateAllChecked=()=>{const i=this.getAttribute("name"),e=this.getCheckAllPublisher(),o=this.getFormPublisher();if(e!=null&&e.hasCheckAll.get()&&!this.checksAll()&&e&&o&&i){if(o[this.name].get().length)(this.checked===null||e.checkMode.get()=="noneChecked"||e.checkMode.get()==null)&&(e.checkMode="someUnchecked");else{e.checkMode="noneChecked";return}const n=o[i].get(),l=e.values.get();if(l&&l.length){let c=l.length;for(const h of l)n.indexOf(h)==-1&&(c-=1);c==l.length&&(e.checkMode="allChecked"),c==0&&(e.checkMode="noneChecked")}l.indexOf(this.value)==-1&&(this.checked=null)}},this.onChecksAllRequest=i=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),i=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),i=="noneChecked"&&(this.checked=null),i=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(i){if(this.value==i||(this.hasAttribute("value")&&!this.forceAutoFill&&(i=this.getAttribute("value")),this._value==i)||i==null||(this._value=i,!this.value))return;const e=this.getFormPublisher();if(e&&this.name){let o=e[this.name].get();(this.radio||this.unique)&&(this.checked=o==i?!0:null),Array.isArray(o)||(o=[]),o.indexOf(i)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(i){if(this.setCheckedValue(i),this.checksAll()){const e=this.getCheckAllPublisher();if(e){if(this.checked===!0)e.checkMode="allChecked";else if(this.checked===null){e.checkMode="noneChecked";const o=this.getFormPublisher();o&&(o[this.name]=[])}}}this.requestUpdate()}validateFormElement(){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("input");if(!i||i.checkValidity())return;const e=this.getFormPublisher();if(e){const n=e[this.name].get();if((this.unique||this.radio)&&n!==null&&n.toString().length>0)return;e.isFormValid=!1,i.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(i){this._checked!=i&&(this._checked=i,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const i=this.checked===!0?this.radio?!0:null:!0;this.checked=i;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){const i=this.getFormPublisher();if(!i)return null;let e=i[this.name].get();if(this.radio)return this.checked===!0&&this.value!=null?this.value:e;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(e)||(e=[]),e=e.slice(0);const o=e.indexOf(this.value);return this.checked===!0&&o===-1&&!this.checksAll()&&e.push(this.value),this.checked===null&&o!==-1&&e.splice(o,1),e}setFormValueFromPublisher(i){if(this.unique||this.radio){this.checked=this.value==i?!0:null;return}Array.isArray(i)||(i=[]),!this.checksAll()&&(this.checked=i.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const i=this.formDataProvider,e=this.getAttribute("name");return!i||!e?null:tt.get(i+"/"+e+"/_available_values_")}disconnectedCallback(){super.disconnectedCallback();const i=this.getCheckAllPublisher();if(i&&(i.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=i.values.get().slice(0),o=e.indexOf(this.value);o!=-1&&(e.splice(o,1),i.values=e)}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){super.connectedCallback();const i=this.getFormPublisher();if(i&&this.name){const o=i[this.name].get();o&&Array.isArray(o)&&o.indexOf(this.value)!==-1&&(this.checked=!0)}const e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&(e.hasCheckAll=!0),e.values.get()||(e.values=[]),this.checksAll()||(e.values=[...e.values.get(),this.value])),this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&setTimeout(()=>this.checked=!0,1)}}return De([a()],t.prototype,"value",1),De([a()],t.prototype,"forceAutoFill",2),De([a({type:Boolean})],t.prototype,"unique",2),De([a({type:Boolean})],t.prototype,"radio",2),De([a({type:Boolean})],t.prototype,"unCheckOnDisconnect",2),De([a()],t.prototype,"checked",1),t};/**
|
|
72
|
+
*/const Xi="important",_o=" !"+Xi,pt=he(class extends Ae{constructor(r){var t;if(super(r),r.type!==ce.ATTRIBUTE||r.name!=="style"||((t=r.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((t,s)=>{const i=r[s];return i==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(r,[t]){const{style:s}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in t){const e=t[i];if(e!=null){this.ft.add(i);const o=typeof e=="string"&&e.endsWith(_o);i.includes("-")||o?s.setProperty(i,o?e.slice(0,-11):e,o?Xi:""):s[i]=e}}return mt}});var xo=Object.defineProperty,Po=Object.getOwnPropertyDescriptor,Ct=(r,t,s,i)=>{for(var e=i>1?void 0:i?Po(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&&xo(t,s,e),e};const fs=new Map,Oe=r=>{class t extends r{constructor(...i){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=e=>{this.setValueFromPublisher(e)},this.onFormValueAssign=async e=>{this.setFormValueFromPublisher(e)},this.onFormDataInValidate=()=>{const e=this.getFormPublisher();e&&e.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(i){this.hasAttribute("name")&&!this.forceAutoFill&&(i=this.getAttribute("name")),this._name=i,this.requestUpdate()}validateFormElement(){}updateDataValue(){const i=this.getAttribute("name");if(i){const e=this.getFormPublisher();e&&(e[i]=this.getValueForFormPublisher(),this.setFormValueFromPublisher(e[i].get()))}}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?N.get(this.formDataProvider):null}getValueForFormPublisher(){return this.value}setValueFromPublisher(i){this.value=i}setFormValueFromPublisher(i){this.value=i}get value(){return this._value}set value(i){i==null&&(i=""),X.isObject(i)&&Object.prototype.hasOwnProperty.call(i,"__value")&&i._value==null&&(i=""),this._value!=i&&(i||console.trace(this.name,this._value,i),this._value=i,this.updateDataValue(),this.requestUpdate())}initPublisher(){let i=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&i[this._name].get()?i[this._name].get():this.getAttribute("value");this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign),this._name&&i&&i[this._name].offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.publisher&&this._name&&this.publisher[this._name].onAssign(this.onValueAssign),i=this.getFormPublisher(),this._name&&i&&(i[this._name].onAssign(this.onFormValueAssign),i.onInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(i){this.value=i.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const i=this.getAncestorAttributeValue("data-keyboard-nav");if(!i)return;const e=i.split(" "),o=e[0];if(!o)return;for(const l of e){fs.has(l)||fs.set(l,[]);const c=fs.get(l);(c==null?void 0:c.indexOf(this))==-1&&c.push(this)}const n=fs.get(o);this.addEventListener("keydown",l=>{var v;const c=l;if(!["ArrowDown","ArrowUp"].includes(c.key))return;const h="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",d=n==null?void 0:n.filter(b=>{var D;const P=(D=b.shadowRoot)==null?void 0:D.querySelector(h);if(!P)return!1;const S=window.getComputedStyle(P);return S.display!=="none"&&S.display!==""&&S.pointerEvents!="none"&&S.visibility!=="hidden"&&P.getBoundingClientRect().width>0});let f=null;if(c.key=="ArrowDown"&&d){const b=d.indexOf(this);b==d.length-1?f=d[0]:f=d[b+1]}else if(c.key=="ArrowUp"&&d){const b=d.indexOf(this);b==0?f=d[d.length-1]:f=d[b-1]}const m=(v=f==null?void 0:f.shadowRoot)==null?void 0:v.querySelector(h);m&&m.focus&&(m.focus(),l.preventDefault(),l.stopPropagation())})}focus(){var e;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("[data-form-element]");i==null||i.focus()}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),this.value&&this.setAttribute("value",this.value),super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);const i=this.getFormPublisher();this._name&&i&&(i[this._name].offAssign(this.onFormValueAssign),i.offInvalidate(this.onFormDataInValidate))}}return Ct([a({type:Boolean,reflect:!0})],t.prototype,"touched",2),Ct([a({type:Boolean})],t.prototype,"error",2),Ct([a({type:Boolean})],t.prototype,"autofocus",2),Ct([a({type:Boolean})],t.prototype,"required",2),Ct([a({type:Boolean})],t.prototype,"forceAutoFill",2),Ct([a({type:Boolean})],t.prototype,"disabled",2),Ct([a({type:String,attribute:"data-aria-label"})],t.prototype,"ariaLabel",2),Ct([a({type:String,attribute:"data-aria-labelledby"})],t.prototype,"ariaLabelledby",2),Ct([a()],t.prototype,"name",1),Ct([a()],t.prototype,"value",1),t};let $o=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(s=>{setTimeout(s,t)})}},Co=class xe{static areEqual(t,s){return t.length===s.length?t.every((i,e)=>i===s[e]):!1}static from2d(t){return{to1D:()=>{let s=[];return t.forEach(i=>s=s.concat(i)),this.from(s)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:s=>{if(t.length<1)return!0;const i=(t[0]||{})[s];return t.every(e=>(e||{})[s]==i)}})})}),value:()=>({forKey:s=>xe.from(t.map(i=>i[s]))}),copy:()=>({fromKey:s=>({toKey:i=>{t.forEach(e=>{e[i]=Array.isArray(e[s])?[...e[s]]:typeof e[s]=="object"&&e[s]!=null?{...e[s]}:e[s]})}})})}),map:s=>xe.from(t.map(s)),filter:s=>xe.from(t.filter(s)),find:s=>t.find(s),some:s=>t.some(s),every:s=>t.every(s),group:()=>({byKey:s=>{const i=[],e=new Map;for(const o of t){const n=o[s];if(!e.has(n)){const l=i.length;e.set(n,l);const c={items:[]};c[s]=n,i.push(c)}i[e.get(n)].items.push(o)}return xe.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(t.map(e=>e[s]))];return xe.from(i.map(e=>t.find(o=>o[s]==e)))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>{const e=(o,n)=>l=>o[n]!=l[n];return xe.from(t.filter(o=>s.every(e(o,i))))}})})})}}};var Ao=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function So(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ys={exports:{}};(function(r,t){var s=[].slice;(function(i,e){return t!==null?r.exports=e():i.UrlPattern=e()})(Ao,function(){var i,e,o,n,l,c,h,d,f,m,v,b,P,S,D;return f=function(p){return p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(p,u){var y,A,O;for(O=[],y=-1,A=p.length;++y<A;)O=O.concat(u(p[y]));return O},S=function(p,u){var y,A,O;for(O="",y=-1,A=p.length;++y<A;)O+=u(p[y]);return O},P=function(p){return new RegExp(p.toString()+"|").exec("").length-1},v=function(p,u){var y,A,O,E,V;for(E={},y=-1,O=p.length;++y<O;)A=p[y],V=u[y],V!=null&&(E[A]!=null?(Array.isArray(E[A])||(E[A]=[E[A]]),E[A].push(V)):E[A]=V);return E},i={},i.Result=function(p,u){this.value=p,this.rest=u},i.Tagged=function(p,u){this.tag=p,this.value=u},i.tag=function(p,u){return function(y){var A,O;if(A=u(y),A!=null)return O=new i.Tagged(p,A.value),new i.Result(O,A.rest)}},i.regex=function(p){return function(u){var y,A;if(y=p.exec(u),y!=null)return A=y[0],new i.Result(A,u.slice(A.length))}},i.sequence=function(){var p;return p=1<=arguments.length?s.call(arguments,0):[],function(u){var y,A,O,E,V,q;for(y=-1,A=p.length,q=[],E=u;++y<A;){if(O=p[y],V=O(E),V==null)return;q.push(V.value),E=V.rest}return new i.Result(q,E)}},i.pick=function(){var p,u;return p=arguments[0],u=2<=arguments.length?s.call(arguments,1):[],function(y){var A,O;if(O=i.sequence.apply(i,u)(y),O!=null)return A=O.value,O.value=A[p],O}},i.string=function(p){var u;return u=p.length,function(y){if(y.slice(0,u)===p)return new i.Result(p,y.slice(u))}},i.lazy=function(p){var u;return u=null,function(y){return u==null&&(u=p()),u(y)}},i.baseMany=function(p,u,y,A,O){var E,V,q,Mt;for(q=O,Mt=y?"":[];!(u!=null&&(E=u(q),E!=null)||(V=p(q),V==null));)y?Mt+=V.value:Mt.push(V.value),q=V.rest;if(!(A&&Mt.length===0))return new i.Result(Mt,q)},i.many1=function(p){return function(u){return i.baseMany(p,null,!1,!0,u)}},i.concatMany1Till=function(p,u){return function(y){return i.baseMany(p,u,!0,!0,y)}},i.firstChoice=function(){var p;return p=1<=arguments.length?s.call(arguments,0):[],function(u){var y,A,O,E;for(y=-1,A=p.length;++y<A;)if(O=p[y],E=O(u),E!=null)return E}},b=function(p){var u;return u={},u.wildcard=i.tag("wildcard",i.string(p.wildcardChar)),u.optional=i.tag("optional",i.pick(1,i.string(p.optionalSegmentStartChar),i.lazy(function(){return u.pattern}),i.string(p.optionalSegmentEndChar))),u.name=i.regex(new RegExp("^["+p.segmentNameCharset+"]+")),u.named=i.tag("named",i.pick(1,i.string(p.segmentNameStartChar),i.lazy(function(){return u.name}))),u.escapedChar=i.pick(1,i.string(p.escapeChar),i.regex(/^./)),u.static=i.tag("static",i.concatMany1Till(i.firstChoice(i.lazy(function(){return u.escapedChar}),i.regex(/^./)),i.firstChoice(i.string(p.segmentNameStartChar),i.string(p.optionalSegmentStartChar),i.string(p.optionalSegmentEndChar),u.wildcard))),u.token=i.lazy(function(){return i.firstChoice(u.wildcard,u.optional,u.named,u.static)}),u.pattern=i.many1(i.lazy(function(){return u.token})),u},d={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(p,u){if(Array.isArray(p))return S(p,function(y){return c(y,u)});switch(p.tag){case"wildcard":return"(.*?)";case"named":return"(["+u+"]+)";case"static":return f(p.value);case"optional":return"(?:"+c(p.value,u)+")?"}},l=function(p,u){return u==null&&(u=d.segmentValueCharset),"^"+c(p,u)+"$"},n=function(p){if(Array.isArray(p))return h(p,n);switch(p.tag){case"wildcard":return["_"];case"named":return[p.value];case"static":return[];case"optional":return n(p.value)}},m=function(p,u,y,A){var O,E,V,q;if(A==null&&(A=!1),q=p[u],q==null){if(A)throw new Error("no values provided for key `"+u+"`");return}if(O=y[u]||0,E=Array.isArray(q)?q.length-1:0,O>E){if(A)throw new Error("too few values provided for key `"+u+"`");return}return V=Array.isArray(q)?q[O]:q,A&&(y[u]=O+1),V},o=function(p,u,y){var A,O;if(Array.isArray(p)){for(A=-1,O=p.length;++A<O;)if(o(p[A],u,y))return!0;return!1}switch(p.tag){case"wildcard":return m(u,"_",y,!1)!=null;case"named":return m(u,p.value,y,!1)!=null;case"static":return!1;case"optional":return o(p.value,u,y)}},D=function(p,u,y){if(Array.isArray(p))return S(p,function(A){return D(A,u,y)});switch(p.tag){case"wildcard":return m(u,"_",y,!0);case"named":return m(u,p.value,y,!0);case"static":return p.value;case"optional":return o(p.value,u,y)?D(p.value,u,y):""}},e=function(p,u){var y,A,O,E,V;if(p instanceof e){this.isRegex=p.isRegex,this.regex=p.regex,this.ast=p.ast,this.names=p.names;return}if(this.isRegex=p instanceof RegExp,!(typeof p=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=p,u!=null){if(!Array.isArray(u))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(y=P(this.regex),u.length!==y)throw new Error("regex contains "+y+" groups but array of group names contains "+u.length);this.names=u}return}if(p==="")throw new Error("argument must not be the empty string");if(V=p.replace(/\s+/g,""),V!==p)throw new Error("argument must not contain whitespace");if(A={escapeChar:(u!=null?u.escapeChar:void 0)||d.escapeChar,segmentNameStartChar:(u!=null?u.segmentNameStartChar:void 0)||d.segmentNameStartChar,segmentNameCharset:(u!=null?u.segmentNameCharset:void 0)||d.segmentNameCharset,segmentValueCharset:(u!=null?u.segmentValueCharset:void 0)||d.segmentValueCharset,optionalSegmentStartChar:(u!=null?u.optionalSegmentStartChar:void 0)||d.optionalSegmentStartChar,optionalSegmentEndChar:(u!=null?u.optionalSegmentEndChar:void 0)||d.optionalSegmentEndChar,wildcardChar:(u!=null?u.wildcardChar:void 0)||d.wildcardChar},E=b(A),O=E.pattern(p),O==null)throw new Error("couldn't parse pattern");if(O.rest!=="")throw new Error("could only partially parse pattern");this.ast=O.value,this.regex=new RegExp(l(this.ast,A.segmentValueCharset)),this.names=n(this.ast)},e.prototype.match=function(p){var u,y;return y=this.regex.exec(p),y==null?null:(u=y.slice(1),this.names?v(this.names,u):u)},e.prototype.stringify=function(p){if(p==null&&(p={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(p!==Object(p))throw new Error("argument must be an object or undefined");return D(this.ast,p,{})},e.escapeForRegex=f,e.concatMap=h,e.stringConcatMap=S,e.regexGroupCount=P,e.keysAndValuesToObject=v,e.P=i,e.newParser=b,e.defaultOptions=d,e.astNodeToRegexString=l,e.astNodeToNames=n,e.getParam=m,e.astNodeContainsSegmentsForProvidedParams=o,e.stringify=D,e})})(Ys,Ys.exports);var Oo=Ys.exports;const de=So(Oo),Do=$o,ko=Co,Lo=ns,Eo=os,pe=Q,No=rt,Ke=X,To=je,tt=N,jo=Se,Mo=de;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:Do,Arrays:ko,DataBindObserver:Lo,Format:Eo,HTML:pe,LocationHandler:No,Objects:Ke,PublisherProxy:To,PublisherManager:tt,api:jo,URLPattern:Mo};var Io=Object.defineProperty,zo=Object.getOwnPropertyDescriptor,De=(r,t,s,i)=>{for(var e=i>1?void 0:i?zo(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&&Io(t,s,e),e};const Gs=r=>{class t extends r{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this.unCheckOnDisconnect=!1,this._checked=null,this.updateAllChecked=()=>{const i=this.getAttribute("name"),e=this.getCheckAllPublisher(),o=this.getFormPublisher();if(e!=null&&e.hasCheckAll.get()&&!this.checksAll()&&e&&o&&i){if(o[this.name].get().length)(this.checked===null||e.checkMode.get()=="noneChecked"||e.checkMode.get()==null)&&(e.checkMode="someUnchecked");else{e.checkMode="noneChecked";return}const n=o[i].get(),l=e.values.get();if(l&&l.length){let c=l.length;for(const h of l)n.indexOf(h)==-1&&(c-=1);c==l.length&&(e.checkMode="allChecked"),c==0&&(e.checkMode="noneChecked")}l.indexOf(this.value)==-1&&(this.checked=null)}},this.onChecksAllRequest=i=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),i=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),i=="noneChecked"&&(this.checked=null),i=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(i){if(this.value==i||(this.hasAttribute("value")&&!this.forceAutoFill&&(i=this.getAttribute("value")),this._value==i)||i==null||(this._value=i,!this.value))return;const e=this.getFormPublisher();if(e&&this.name){let o=e[this.name].get();(this.radio||this.unique)&&(this.checked=o==i?!0:null),Array.isArray(o)||(o=[]),o.indexOf(i)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(i){if(this.setCheckedValue(i),this.checksAll()){const e=this.getCheckAllPublisher();if(e){if(this.checked===!0)e.checkMode="allChecked";else if(this.checked===null){e.checkMode="noneChecked";const o=this.getFormPublisher();o&&(o[this.name]=[])}}}this.requestUpdate()}validateFormElement(){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("input");if(!i||i.checkValidity())return;const e=this.getFormPublisher();if(e){const n=e[this.name].get();if((this.unique||this.radio)&&n!==null&&n.toString().length>0)return;e.isFormValid=!1,i.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(i){this._checked!=i&&(this._checked=i,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const i=this.checked===!0?this.radio?!0:null:!0;this.checked=i;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){const i=this.getFormPublisher();if(!i)return null;let e=i[this.name].get();if(this.radio)return this.checked===!0&&this.value!=null?this.value:e;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(e)||(e=[]),e=e.slice(0);const o=e.indexOf(this.value);return this.checked===!0&&o===-1&&!this.checksAll()&&e.push(this.value),this.checked===null&&o!==-1&&e.splice(o,1),e}setFormValueFromPublisher(i){if(this.unique||this.radio){this.checked=this.value==i?!0:null;return}Array.isArray(i)||(i=[]),!this.checksAll()&&(this.checked=i.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const i=this.formDataProvider,e=this.getAttribute("name");return!i||!e?null:tt.get(i+"/"+e+"/_available_values_")}disconnectedCallback(){super.disconnectedCallback();const i=this.getCheckAllPublisher();if(i&&(i.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=i.values.get().slice(0),o=e.indexOf(this.value);o!=-1&&(e.splice(o,1),i.values=e)}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){super.connectedCallback();const i=this.getFormPublisher();if(i&&this.name){const o=i[this.name].get();o&&Array.isArray(o)&&o.indexOf(this.value)!==-1&&(this.checked=!0)}const e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&(e.hasCheckAll=!0),e.values.get()||(e.values=[]),this.checksAll()||(e.values=[...e.values.get(),this.value])),this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&setTimeout(()=>this.checked=!0,1)}}return De([a()],t.prototype,"value",1),De([a()],t.prototype,"forceAutoFill",2),De([a({type:Boolean})],t.prototype,"unique",2),De([a({type:Boolean})],t.prototype,"radio",2),De([a({type:Boolean})],t.prototype,"unCheckOnDisconnect",2),De([a()],t.prototype,"checked",1),t};/**
|
|
73
73
|
* @license
|
|
74
74
|
* Copyright 2018 Google LLC
|
|
75
75
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -2017,7 +2017,7 @@
|
|
|
2017
2017
|
:host([inline]) {
|
|
2018
2018
|
vertical-align: baseline;
|
|
2019
2019
|
}
|
|
2020
|
-
`],Gt([j()],nt.prototype,"open",2),Gt([se("slot:not([name=content])")],nt.prototype,"popBtn",2),Gt([se("slot[name=content]")],nt.prototype,"popContent",2),Gt([a({type:Boolean})],nt.prototype,"noToggle",2),Gt([a({type:Boolean,reflect:!0})],nt.prototype,"inline",2),Gt([a({type:String,reflect:!0})],nt.prototype,"shadow",2),Gt([a({type:String})],nt.prototype,"placement",2),nt=Gt([_(za)],nt);var Fa=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,Ua=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ra(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&&Fa(t,s,e),e};const Va="sonic-menu-item";let xr=class extends M{constructor(){super()}connectedCallback(){this.hasAttribute("variant")||(this.variant="ghost"),this.hasAttribute("type")||(this.type="default"),this.hasAttribute("shape")||(this.shape="block");const r=this.shape==="square"||this.shape==="circle";!this.hasAttribute("align")&&!r&&(this.align="left"),super.connectedCallback()}};xr=Ua([_(Va)],xr);class Pr{constructor(t,{target:s,config:i,callback:e,skipInitial:o}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,s!==null&&this.t.add(s??t),this.l=i,this.o=o??this.o,this.callback=e,window.ResizeObserver?(this.u=new ResizeObserver(n=>{this.handleChanges(n),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){var s;this.value=(s=this.callback)==null?void 0:s.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}var Ba=Object.defineProperty,Ha=Object.getOwnPropertyDescriptor,ft=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ha(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&&Ba(t,s,e),e};let at=class extends ei(ur(pr(qt(w)))){constructor(){super(...arguments),this.size="md",this.placeholder="",this.filteredFields="",this.readonly=null,this.dataProviderExpression="",this.minSearchLength=0,this.key="",this.searchParameter="",this.propertyName="",this.hasInputPrefix=!1,this._resizeController=new Pr(this,{}),this.isPopVisible=!1,this.searchDataProvider="",this.initSearchDataProvider="",this.queueDataProvider="",this.initQueueDataProvider="",this.lastValidSearch="",this.updateSearchParameter=r=>{var s;if(r==""){this.lastValidSearch="";return}this.queryQueueListItem(this.queueDataProvider,this.findSelection,this.setSearchFromSelection)===!1&&(this.lastValidSearch=r,(s=this.searchPublisher)==null||s.set(this.lastValidSearch))},this.updatePopContentVisibility=r=>{this.isPopVisible=((r==null?void 0:r.length)||0)>=this.minSearchLength},this.initSearchParameter=()=>{this.queryQueueListItem(this.initQueueDataProvider,this.findSelection,this.setSearchFromSelection)},this.selectListItem=r=>{var s;const t=this.propertyName==="_self"?r:r[this.propertyName||this.name];(s=this.formValuePublisher)==null||s.set(t)},this.findSearchedItem=r=>{var s;return(this.propertyName==="_self"?r:r[this.propertyName||this.searchParameter||this.name])==((s=this.searchPublisher)==null?void 0:s.get())},this.findSelection=r=>(this.propertyName==="_self"?r:r[this.propertyName||this.name])==this.value,this.setSearchFromSelection=r=>{var t;this.lastValidSearch=this.propertyName==="_self"?r:r[this.searchParameter||this.propertyName||this.name],(t=this.searchPublisher)==null||t.set(this.lastValidSearch)},this.updateActiveSelection=()=>{var r,t,s;this.queryQueueListItem(this.queueDataProvider,this.findSearchedItem,this.selectListItem),!this.select&&this.lastValidSearch&&this.lastValidSearch!=((r=this.searchPublisher)==null?void 0:r.get())&&((t=this.formValuePublisher)!=null&&t.get())&&((s=this.formValuePublisher)==null||s.set(""))}}hasSlotOrProps(){var r;this.hasInputPrefix=!!((r=this.slotInputPrefixNodes)!=null&&r.length)}connectedCallback(){var e,o,n,l;super.connectedCallback();const r=this.searchParameter||this.name,t=this.getAncestorAttributeValue("formDataProvider"),s=t+"__"+this.name+"__autocomplete";this.initSearchDataProvider=`${s}_init_search__`,this.initQueueDataProvider=`${s}_init_queue__`,this.searchDataProvider=`${s}_search__`,this.queueDataProvider=`${s}_queue__`;const i=tt.get;this.searchPublisher=i(this.searchDataProvider)[r],this.formValuePublisher=i(t)[this.name],this.countPublisher=i(this.queueDataProvider).resultCount,this.initCountPublisher=i(this.initQueueDataProvider).resultCount,this.value&&(tt.get(this.initSearchDataProvider)[this.name]=this.value),(e=this.initCountPublisher)==null||e.onAssign(this.initSearchParameter),(o=this.formValuePublisher)==null||o.onAssign(this.updateSearchParameter),(n=this.countPublisher)==null||n.onAssign(this.updateActiveSelection),(l=this.searchPublisher)==null||l.onAssign(this.updatePopContentVisibility)}disconnectedCallback(){var t,s,i,e;super.disconnectedCallback(),(t=this.initCountPublisher)==null||t.offAssign(this.initSearchParameter),(s=this.formValuePublisher)==null||s.offAssign(this.updateSearchParameter),(i=this.countPublisher)==null||i.offAssign(this.updateActiveSelection);const r=tt.get;r(this.initSearchDataProvider).delete(),r(this.initQueueDataProvider).delete(),r(this.searchDataProvider).delete(),r(this.queueDataProvider).delete(),(e=this.searchPublisher)==null||e.offAssign(this.updatePopContentVisibility)}queryQueueListItem(r,t,s){const i=tt.get(r);let e;const o=i.get();if(Array.isArray(o)){for(const n of o){const l=tt.get(n.dataProvider).get();if(Array.isArray(l)&&(e=l.find(t),e))break}return e?(s(e),!0):!1}}setSelectionRange(r,t){var s;(s=this.querySelector("sonic-input"))==null||s.setSelectionRange(r,t)}handleHide(){var r,t,s;if(this.select){if(((r=this.searchPublisher)==null?void 0:r.get())==""){this.lastValidSearch="",(t=this.formValuePublisher)==null||t.set("");return}(s=this.searchPublisher)==null||s.set(this.lastValidSearch)}}render(){return g`
|
|
2020
|
+
`],Gt([j()],nt.prototype,"open",2),Gt([se("slot:not([name=content])")],nt.prototype,"popBtn",2),Gt([se("slot[name=content]")],nt.prototype,"popContent",2),Gt([a({type:Boolean})],nt.prototype,"noToggle",2),Gt([a({type:Boolean,reflect:!0})],nt.prototype,"inline",2),Gt([a({type:String,reflect:!0})],nt.prototype,"shadow",2),Gt([a({type:String})],nt.prototype,"placement",2),nt=Gt([_(za)],nt);var Fa=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,Ua=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ra(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&&Fa(t,s,e),e};const Va="sonic-menu-item";let xr=class extends M{constructor(){super()}connectedCallback(){this.hasAttribute("variant")||(this.variant="ghost"),this.hasAttribute("type")||(this.type="default"),this.hasAttribute("shape")||(this.shape="block");const r=this.shape==="square"||this.shape==="circle";!this.hasAttribute("align")&&!r&&(this.align="left"),super.connectedCallback()}};xr=Ua([_(Va)],xr);class Pr{constructor(t,{target:s,config:i,callback:e,skipInitial:o}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,s!==null&&this.t.add(s??t),this.l=i,this.o=o??this.o,this.callback=e,window.ResizeObserver?(this.u=new ResizeObserver(n=>{this.handleChanges(n),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){var s;this.value=(s=this.callback)==null?void 0:s.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}var Ba=Object.defineProperty,Ha=Object.getOwnPropertyDescriptor,ft=(r,t,s,i)=>{for(var e=i>1?void 0:i?Ha(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&&Ba(t,s,e),e};let at=class extends ei(ur(pr(qt(w)))){constructor(){super(...arguments),this.size="md",this.placeholder="",this.filteredFields="",this.readonly=null,this.dataProviderExpression="",this.minSearchLength=0,this.key="",this.searchParameter="",this.propertyName="",this.hasInputPrefix=!1,this._resizeController=new Pr(this,{}),this.isPopVisible=!1,this.searchDataProvider="",this.initSearchDataProvider="",this.queueDataProvider="",this.initQueueDataProvider="",this.lastValidSearch="",this.updateSearchParameter=r=>{var s;if(r==""){this.lastValidSearch="";return}this.queryQueueListItem(this.queueDataProvider,this.findSelection,this.setSearchFromSelection)===!1&&(this.lastValidSearch=r,(s=this.searchPublisher)==null||s.set(this.lastValidSearch))},this.updatePopContentVisibility=r=>{this.isPopVisible=((r==null?void 0:r.length)||0)>=this.minSearchLength},this.initSearchParameter=()=>{this.queryQueueListItem(this.initQueueDataProvider,this.findSelection,this.setSearchFromSelection)},this.selectListItem=r=>{var s;const t=this.propertyName==="_self"?r:r[this.propertyName||this.name];(s=this.formValuePublisher)==null||s.set(t)},this.findSearchedItem=r=>{var s;return(this.propertyName==="_self"?r:r[this.propertyName||this.searchParameter||this.name])==((s=this.searchPublisher)==null?void 0:s.get())},this.findSelection=r=>(this.propertyName==="_self"?r:r[this.propertyName||this.name])==this.value,this.setSearchFromSelection=r=>{var t;this.lastValidSearch=this.propertyName==="_self"?r:r[this.searchParameter||this.propertyName||this.name],(t=this.searchPublisher)==null||t.set(this.lastValidSearch)},this.updateActiveSelection=()=>{var r,t,s;this.queryQueueListItem(this.queueDataProvider,this.findSearchedItem,this.selectListItem),!this.select&&this.lastValidSearch&&this.lastValidSearch!=((r=this.searchPublisher)==null?void 0:r.get())&&((t=this.formValuePublisher)!=null&&t.get())&&((s=this.formValuePublisher)==null||s.set(""))}}hasSlotOrProps(){var r;this.hasInputPrefix=!!((r=this.slotInputPrefixNodes)!=null&&r.length)}connectedCallback(){var e,o,n,l;console.log(this.value,this.getAttribute("value")),super.connectedCallback(),console.log(this.value,this.getAttribute("value"));const r=this.searchParameter||this.name,t=this.getAncestorAttributeValue("formDataProvider"),s=t+"__"+this.name+"__autocomplete";this.initSearchDataProvider=`${s}_init_search__`,this.initQueueDataProvider=`${s}_init_queue__`,this.searchDataProvider=`${s}_search__`,this.queueDataProvider=`${s}_queue__`;const i=tt.get;this.searchPublisher=i(this.searchDataProvider)[r],this.formValuePublisher=i(t)[this.name],this.countPublisher=i(this.queueDataProvider).resultCount,this.initCountPublisher=i(this.initQueueDataProvider).resultCount,this.value&&(tt.get(this.initSearchDataProvider)[this.name]=this.value),(e=this.initCountPublisher)==null||e.onAssign(this.initSearchParameter),(o=this.formValuePublisher)==null||o.onAssign(this.updateSearchParameter),(n=this.countPublisher)==null||n.onAssign(this.updateActiveSelection),(l=this.searchPublisher)==null||l.onAssign(this.updatePopContentVisibility)}disconnectedCallback(){var t,s,i,e;super.disconnectedCallback(),(t=this.initCountPublisher)==null||t.offAssign(this.initSearchParameter),(s=this.formValuePublisher)==null||s.offAssign(this.updateSearchParameter),(i=this.countPublisher)==null||i.offAssign(this.updateActiveSelection);const r=tt.get;r(this.initSearchDataProvider).delete(),r(this.initQueueDataProvider).delete(),r(this.searchDataProvider).delete(),r(this.queueDataProvider).delete(),(e=this.searchPublisher)==null||e.offAssign(this.updatePopContentVisibility)}queryQueueListItem(r,t,s){const i=tt.get(r);let e;const o=i.get();if(Array.isArray(o)){for(const n of o){const l=tt.get(n.dataProvider).get();if(Array.isArray(l)&&(e=l.find(t),e))break}return e?(s(e),!0):!1}}setSelectionRange(r,t){var s;(s=this.querySelector("sonic-input"))==null||s.setSelectionRange(r,t)}handleHide(){var r,t,s;if(this.select){if(((r=this.searchPublisher)==null?void 0:r.get())==""){this.lastValidSearch="",(t=this.formValuePublisher)==null||t.set("");return}(s=this.searchPublisher)==null||s.set(this.lastValidSearch)}}render(){var r;return g`
|
|
2021
2021
|
<sonic-pop noToggle style="display:block;" @hide=${this.handleHide}>
|
|
2022
2022
|
<sonic-input
|
|
2023
2023
|
dataProvider="${this.initSearchDataProvider+Math.random()}"
|
|
@@ -2033,6 +2033,7 @@
|
|
|
2033
2033
|
clearable
|
|
2034
2034
|
inlineContent
|
|
2035
2035
|
size=${this.size}
|
|
2036
|
+
value="${x(((r=this.searchPublisher)==null?void 0:r.get())||this.value)}"
|
|
2036
2037
|
>
|
|
2037
2038
|
<slot
|
|
2038
2039
|
name="prefix"
|
package/dist/concorde-core.es.js
CHANGED
|
@@ -495,7 +495,7 @@ let T = (k = class {
|
|
|
495
495
|
const h = await new Response(l.readable).arrayBuffer();
|
|
496
496
|
return new TextDecoder().decode(h);
|
|
497
497
|
}
|
|
498
|
-
}, k.buildDate = "Fri Jul 12 2024
|
|
498
|
+
}, k.buildDate = "Fri Jul 12 2024 17:19:05 GMT+0200 (Central European Summer Time)", k.changed = !1, k.saving = !1, k.saveId = 0, k.instance = null, k.instances = /* @__PURE__ */ new Map(), k.modifiedCollectore = [], k);
|
|
499
499
|
const Us = window;
|
|
500
500
|
Us.SonicPublisherManager || (Us.SonicPublisherManager = T);
|
|
501
501
|
Us.SonicPublisherManager.registerInstance(
|
|
@@ -2697,7 +2697,7 @@ const ns = /* @__PURE__ */ new Map(), De = (r) => {
|
|
|
2697
2697
|
return this._value;
|
|
2698
2698
|
}
|
|
2699
2699
|
set value(i) {
|
|
2700
|
-
i == null && (i = ""), X.isObject(i) && Object.prototype.hasOwnProperty.call(i, "__value") && i._value == null && (i = ""), this._value != i && (this._value = i, this.updateDataValue(), this.requestUpdate());
|
|
2700
|
+
i == null && (i = ""), X.isObject(i) && Object.prototype.hasOwnProperty.call(i, "__value") && i._value == null && (i = ""), this._value != i && (i || console.trace(this.name, this._value, i), this._value = i, this.updateDataValue(), this.requestUpdate());
|
|
2701
2701
|
}
|
|
2702
2702
|
initPublisher() {
|
|
2703
2703
|
let i = this.getFormPublisher();
|
|
@@ -2769,7 +2769,7 @@ const ns = /* @__PURE__ */ new Map(), De = (r) => {
|
|
|
2769
2769
|
connectedCallback() {
|
|
2770
2770
|
this.formDataProvider = this.getAncestorAttributeValue(
|
|
2771
2771
|
"formDataProvider"
|
|
2772
|
-
), super.connectedCallback(), this.addKeyboardNavigation();
|
|
2772
|
+
), this.value && this.setAttribute("value", this.value), super.connectedCallback(), this.addKeyboardNavigation();
|
|
2773
2773
|
}
|
|
2774
2774
|
disconnectedCallback() {
|
|
2775
2775
|
super.disconnectedCallback(), this._name && this.publisher && this.publisher[this._name].offAssign(this.onValueAssign);
|
|
@@ -8196,7 +8196,7 @@ let nt = class extends ui(
|
|
|
8196
8196
|
}
|
|
8197
8197
|
connectedCallback() {
|
|
8198
8198
|
var e, o, n, l;
|
|
8199
|
-
super.connectedCallback();
|
|
8199
|
+
console.log(this.value, this.getAttribute("value")), super.connectedCallback(), console.log(this.value, this.getAttribute("value"));
|
|
8200
8200
|
const r = this.searchParameter || this.name, t = this.getAncestorAttributeValue("formDataProvider"), s = t + "__" + this.name + "__autocomplete";
|
|
8201
8201
|
this.initSearchDataProvider = `${s}_init_search__`, this.initQueueDataProvider = `${s}_init_queue__`, this.searchDataProvider = `${s}_search__`, this.queueDataProvider = `${s}_queue__`;
|
|
8202
8202
|
const i = J.get;
|
|
@@ -8245,6 +8245,7 @@ let nt = class extends ui(
|
|
|
8245
8245
|
}
|
|
8246
8246
|
}
|
|
8247
8247
|
render() {
|
|
8248
|
+
var r;
|
|
8248
8249
|
return g`
|
|
8249
8250
|
<sonic-pop noToggle style="display:block;" @hide=${this.handleHide}>
|
|
8250
8251
|
<sonic-input
|
|
@@ -8261,6 +8262,7 @@ let nt = class extends ui(
|
|
|
8261
8262
|
clearable
|
|
8262
8263
|
inlineContent
|
|
8263
8264
|
size=${this.size}
|
|
8265
|
+
value="${x(((r = this.searchPublisher) == null ? void 0 : r.get()) || this.value)}"
|
|
8264
8266
|
>
|
|
8265
8267
|
<slot
|
|
8266
8268
|
name="prefix"
|
package/package.json
CHANGED
|
@@ -178,8 +178,12 @@ export class InputAutocomplete extends TemplatesContainer(
|
|
|
178
178
|
};
|
|
179
179
|
|
|
180
180
|
connectedCallback() {
|
|
181
|
+
console.log(this.value, this.getAttribute("value"));
|
|
182
|
+
|
|
181
183
|
super.connectedCallback();
|
|
182
184
|
|
|
185
|
+
console.log(this.value, this.getAttribute("value"));
|
|
186
|
+
|
|
183
187
|
/**
|
|
184
188
|
* Nom de la valeur de recherche
|
|
185
189
|
* Si non défini, on utilise name
|
|
@@ -309,6 +313,7 @@ export class InputAutocomplete extends TemplatesContainer(
|
|
|
309
313
|
clearable
|
|
310
314
|
inlineContent
|
|
311
315
|
size=${this.size}
|
|
316
|
+
value="${ifDefined(this.searchPublisher?.get() || this.value)}"
|
|
312
317
|
>
|
|
313
318
|
<slot
|
|
314
319
|
name="prefix"
|
|
@@ -157,6 +157,7 @@ const Form = <T extends Constructor<SubscriberInterface>>(superClass: T) => {
|
|
|
157
157
|
)
|
|
158
158
|
value = "";
|
|
159
159
|
if (this._value == value) return;
|
|
160
|
+
if (!value) console.trace(this.name, this._value, value);
|
|
160
161
|
this._value = value;
|
|
161
162
|
this.updateDataValue();
|
|
162
163
|
this.requestUpdate();
|
|
@@ -281,6 +282,9 @@ const Form = <T extends Constructor<SubscriberInterface>>(superClass: T) => {
|
|
|
281
282
|
this.formDataProvider = this.getAncestorAttributeValue(
|
|
282
283
|
"formDataProvider"
|
|
283
284
|
) as string;
|
|
285
|
+
if (this.value) {
|
|
286
|
+
this.setAttribute("value", this.value as string);
|
|
287
|
+
}
|
|
284
288
|
super.connectedCallback();
|
|
285
289
|
this.addKeyboardNavigation();
|
|
286
290
|
}
|