@supersoniks/concorde 4.2.1 → 4.4.0
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/README.md +163 -0
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +585 -670
- package/concorde-core.es.js +7165 -9505
- package/dist/concorde-core.bundle.js +585 -670
- package/dist/concorde-core.es.js +7165 -9505
- package/docs/assets/index-DP1oMukw.js +4949 -0
- package/docs/assets/index-DZtxIZCW.css +1 -0
- package/docs/index.html +2 -2
- package/{src/docs/_misc → docs/src/docs/_decorators}/ancestor-attribute.md +15 -31
- package/docs/src/docs/_decorators/bind.md +164 -0
- package/docs/src/docs/_decorators/get.md +65 -0
- package/docs/src/docs/_decorators/publish.md +54 -0
- package/docs/src/docs/_decorators/subscribe.md +36 -0
- package/docs/src/docs/_misc/dataProviderKey.md +135 -0
- package/docs/src/docs/_misc/endpoint.md +42 -0
- package/docs/src/docs/search/docs-search.json +850 -710
- package/docs/src/tsconfig.json +43 -4
- package/package.json +25 -4
- package/php/get-challenge.php +34 -0
- package/php/some-service.php +42 -0
- package/scripts/pre-build.mjs +4 -0
- package/src/core/_types/endpoint.ts +4 -0
- package/src/core/_types/key.ts +1 -0
- package/src/core/components/functional/example/example.ts +38 -6
- package/src/core/decorators/Subscriber.ts +2 -0
- package/src/core/decorators/api.spec.ts +150 -0
- package/src/core/decorators/api.ts +244 -0
- package/src/core/decorators/subscriber/bind.ts +57 -145
- package/src/core/decorators/subscriber/dynamicPath.ts +77 -0
- package/src/core/decorators/subscriber/dynamicPropertyWatch.ts +105 -0
- package/src/core/decorators/subscriber/onAssign.ts +11 -147
- package/src/core/decorators/subscriber/publish.spec.ts +21 -0
- package/src/core/decorators/subscriber/publish.ts +148 -0
- package/src/core/decorators/subscriber/publisherPath.ts +13 -0
- package/src/core/decorators/subscriber/subscribe.spec.ts +21 -0
- package/src/core/decorators/subscriber/subscribe.ts +32 -0
- package/src/core/decorators/subscriber/subscribe.type-test.ts +32 -0
- package/src/core/utils/api.ts +83 -15
- package/src/core/utils/dataProviderKey.spec.ts +34 -0
- package/src/core/utils/dataProviderKey.ts +86 -0
- package/src/core/utils/endpoint.spec.ts +41 -0
- package/src/core/utils/endpoint.ts +87 -0
- package/src/decorators.ts +14 -0
- package/{docs/src/docs/_misc → src/docs/_decorators}/ancestor-attribute.md +15 -31
- package/src/docs/_decorators/bind.md +164 -0
- package/src/docs/_decorators/get.md +65 -0
- package/src/docs/_decorators/publish.md +54 -0
- package/src/docs/_decorators/subscribe.md +36 -0
- package/src/docs/_misc/dataProviderKey.md +135 -0
- package/src/docs/_misc/endpoint.md +42 -0
- package/src/docs/example/decorators-demo-bind-demos.ts +210 -0
- package/src/docs/example/decorators-demo-geo.ts +45 -0
- package/src/docs/example/decorators-demo-init.ts +228 -0
- package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +324 -0
- package/src/docs/example/decorators-demo.ts +12 -459
- package/src/docs/navigation/navigation.ts +27 -10
- package/src/docs/search/docs-search.json +1059 -609
- package/src/tsconfig-model.json +1 -1
- package/src/tsconfig.json +65 -1
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/utils.ts +8 -1
- package/vite/config.js +25 -6
- package/vite.config.mts +13 -0
- package/docs/assets/index-B0IJ9I_B.js +0 -4918
- package/docs/assets/index-B3QHEJTV.css +0 -1
- package/docs/src/docs/_misc/bind.md +0 -436
- package/docs/src/docs/_misc/key.md +0 -135
- package/src/docs/_misc/bind.md +0 -362
- /package/docs/src/docs/{_misc → _decorators}/auto-subscribe.md +0 -0
- /package/docs/src/docs/{_misc → _decorators}/on-assign.md +0 -0
- /package/docs/src/docs/{_misc → _decorators}/wait-for-ancestors.md +0 -0
- /package/src/docs/{_misc → _decorators}/auto-subscribe.md +0 -0
- /package/src/docs/{_misc → _decorators}/on-assign.md +0 -0
- /package/src/docs/{_misc → _decorators}/wait-for-ancestors.md +0 -0
|
@@ -1,79 +1,10 @@
|
|
|
1
|
-
(function(H){typeof define=="function"&&define.amd?define(H):H()})((function(){"use strict";var N,Z;let H=class zt{static getLanguage(){const t=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||t}static getCookies(){return document.cookie.split(";").reduce((t,i)=>{const s=i.indexOf("=");return t[i.substring(0,s).trim()]=i.substring(s+1),t},{})}static everyAncestors(t,i){for(;t;){if(!i(t))return;t=t.parentNode||t.host}}static getScrollableAncestor(t){for(;t;){const i=t;if(i.nodeType===1){const s=window.getComputedStyle(i);if(s?.overflowY==="auto"||s?.overflowY==="scroll"||s?.overflowY==="hidden"||s?.overflowX==="auto"||s?.overflowX==="scroll"||s?.overflowX==="hidden")return t}t=t.parentNode||t.host}return null}static getAncestorAttributeValue(t,i){if(!t)return null;for(;!("hasAttribute"in t&&t.hasAttribute(i))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return"hasAttribute"in t?t.getAttribute(i):null}static getApiConfiguration(t){const i=zt.getAncestorAttributeValue(t,"token"),s=zt.getAncestorAttributeValue(t,"addHTTPResponse")!=null,e=zt.getAncestorAttributeValue(t,"serviceURL");let o=null,n=null;const l=zt.getAncestorAttributeValue(t,"tokenProvider"),c=zt.getAncestorAttributeValue(t,"eventsApiToken");i||(o=zt.getAncestorAttributeValue(t,"userName"),n=zt.getAncestorAttributeValue(t,"password"));const h=zt.getAncestorAttributeValue(t,"credentials")||void 0,u=t.getAttribute("cache"),d=t.hasAttribute("blockUntilDone"),g=t.hasAttribute("keepAlive");return{serviceURL:e,token:i,userName:o,password:n,authToken:c,tokenProvider:l,addHTTPResponse:s,credentials:h,cache:u,blockUntilDone:d,keepAlive:g}}static getClosestElement(t,i){for(;!(t.nodeName&&t.nodeName.toLowerCase()===i)&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.nodeName?t:null}static getClosestForm(t){return zt.getClosestElement(t,"form")}static getAncestorsByTagNames(t,i){const s=new Set(i.map(n=>n.toLowerCase())),e=[];let o=t.parentNode||t.host;for(;o;)o instanceof Element&&s.has(o.tagName.toLowerCase())&&e.push(o),o=o.parentNode||o.host;return e}static getAncestorsBySelectors(t,i){const s=[];let e=t.parentNode||t.host;for(;e;){if(e instanceof Element)for(const o of i)try{if(e.matches(o)){s.push(e);break}}catch{}e=e.parentNode||e.host}return s}static async loadJS(t){return new Promise(async s=>{const e=document.createElement("script");e.src=t,e.onload=()=>s(!0),e.onerror=()=>s(!0),document.head.appendChild(e)})}static async loadCSS(t){return new Promise(async s=>{const e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,e.onload=()=>s(!0),e.onerror=()=>s(!0),document.head.appendChild(e)})}};const Us=r=>{const t=document.documentElement,i=new MutationObserver(e=>{for(let o of e)o.type==="attributes"&&o.attributeName==="lang"&&r()}),s={attributes:!0,attributeFilter:["lang"]};i.observe(t,s)};let cs=class{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,i="",s="long"){i||(i=H.getLanguage());const e=(h,u)=>[Math.floor(h/u),h%u];function o(h,u,d){return new Intl.NumberFormat(h,{style:"unit",unit:u,unitDisplay:d}).format}const[n,l]=e(t,60),c=[];return n&&c.push(o(i,"hour",s)(n)),l&&c.push(o(i,"minute",s)(l)),new Intl.ListFormat(i,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch{return""}}},tt=class Ht{static shallowEqual(t,i,s=!0){const e=Object.keys(t),o=Object.keys(i);if(e.length!==o.length&&s)return!1;for(const n of e){const l=t[n],c=i[n];if(s?l!==c:l!=c)return!1}return!0}static deepEqual(t,i,s=!0){const e=Object.keys(t),o=Object.keys(i);if(e.length!==o.length&&s)return!1;for(const n of e){const l=t[n],c=i[n],h=Ht.isObject(l)&&Ht.isObject(c),u=s?l!==c:l!=c;if(h&&!Ht.deepEqual(l,c)||!h&&u)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static isEmpty(t){return Ht.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,i,s=!1){for(const e of i){const o=t[e];if(o===void 0)return;s&&Ht.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[e]}return t}static traverseDotNotation(t,i,s=!1){return Ht.traverse(t,i.split("."),s)}static getURLSearchArray(t,i=""){let s=[];for(let e in t){const o=t[e];i&&(e=i+"["+e+"]"),Ht.isObject(o)?s=[...s,...this.getURLSearchArray(o,e)]:s.push(`${e}=${o}`)}return s}static getURLSearchString(t){return Ht.getURLSearchArray(t,"").join("&")}};const ut=tt.traverseDotNotation;let Hr=class{static async queueTaskPromise(){return new Promise(t=>{window.queueMicrotask(()=>t(null))})}static async delayPromise(t){return new Promise(i=>{setTimeout(i,t)})}},ji="sonic";typeof __SONIC_PREFIX__<"u"&&(ji=__SONIC_PREFIX__);let Fi=ji.replace(/-([a-z])/g,r=>r[1].toUpperCase());const hs=Fi.charAt(0).toUpperCase()+Fi.slice(1);function ds(r){return Object.prototype.hasOwnProperty.call(r,"__value")}function Wt(r){return typeof r=="object"&&r!==null}let _e="sonic";typeof __SONIC_PREFIX__>"u"&&(_e="sonic");const Vs=_e=="sonic"?"publisher-proxies-data":_e+"-publisher-proxies-data",oe=class oe{constructor(t,i,s){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidate_on_page_show_=!1,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=t,this.parent=i||null,this._parentKey_=s,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(const t in this._proxies_.keys())t!="_parent_"&&this._proxies_.get(t)?.delete();this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),oe.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach(i=>i()),this._is_savable_&&!k.changed){k.changed=!0,k.saveId++;const i=k.saveId;setTimeout(()=>k.getInstance().saveToLocalStorage(i),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const s=this.get();this._assignListeners_.forEach(e=>{e(s)}),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,i){this._fillListeners_.forEach(s=>{s[t]!==i&&(s[t]=i)}),this._publishTemplateFilling_(t,i)}_publishTemplateFilling_(t,i){this._templateFillListeners_.forEach(s=>{const e=Object.getOwnPropertyDescriptor(s,t);e&&!e.set&&!e.writable||(s.propertyMap&&s.propertyMap[t]&&(t=s.propertyMap[t]),typeof s[t]<"u"&&s[t]!==i&&(s[t]=i))})}onAssign(t,i=!0){typeof t=="function"&&(this._assignListeners_.has(t)||(this._assignListeners_.add(t),i&&t(this.get())))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){typeof t=="function"&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.add(t)}offFormInvalidate(t){typeof t=="function"&&this._formInvalidateListeners_.delete(t)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){typeof t=="function"&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),typeof this._value_=="object")for(const i in this._value_){let s=i;const e=this._value_[i];t.propertyMap&&t.propertyMap[i]&&(s=t.propertyMap[i]),typeof t[i]<"u"&&t[i]!==e&&(t[s]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const i in this._value_){const s=this._value_[i];t[i]!==s&&(t[i]=s)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,i=!1){if(this._value_===t||Wt(this._value_)&&Wt(t)&&t&&ds(this._value_)&&ds(t)&&this._value_.__value===t.__value||!Wt(t)&&t===this._value_.__value)return!0;this._value_=Wt(t)?t:{__value:t},this._cachedGet_=void 0;const s=ds(this._value_);if(this._parentKey_&&this.parent){const e=ds(this._value_)?this._value_.__value:this._value_;if(this.parent?.get()==null&&this.parent?.get()==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:e});else{const o=[];o[Number(this._parentKey_)]=e,this.parent.set(o)}else this.parent._value_[this._parentKey_]=e}if(s)return this._proxies_.forEach((e,o)=>{o!="_parent_"&&(e.set(null),this._publishDynamicFilling_(o,null))}),this._publishAssignement_(i),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const e in this._value_)this._value_[e]===void 0&&delete this._value_[e];if(this._proxies_.forEach((e,o)=>{const n=this._value_[o];o!="_parent_"&&n===void 0&&n!==null&&isNaN(Number(o))&&(e.set(null),this._publishDynamicFilling_(o,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),Wt(this._value_))for(const e in this._value_){const o=t[e],l=Wt(o)?o:{__value:o};if(!this._proxies_.has(e)){this._publishDynamicFilling_(e,o);continue}this._proxies_.get(e)?.set(l,!0),this._publishDynamicFilling_(e,o)}return!0}get(){if(k.modifiedCollectore.length>0&&k.modifiedCollectore[0].add(this),this._cachedGet_!==void 0)return this._cachedGet_;if(Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return this._cachedGet_=t??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(oe.instancesCounter++,this._instanceCounter_=oe.instancesCounter),oe.instances.set(this._instanceCounter_,this),"<"+_e+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+_e+"-publisher-proxy>"}};oe.instances=new Map,oe.instancesCounter=0;let je=oe;const I=class I{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],I.instance!=null)throw"Singleton / use getInstance";I.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}invalidateAll(){this.publishers.forEach(t=>{t._invalidate_on_page_show_&&t.invalidate()})}async cleanStorageData(){return new Promise(t=>{(async()=>{try{let s=localStorage.getItem(Vs),e=null;if(s&&(e=await this.decompress(s,"gzip")),e)try{this.localStorageData=JSON.parse(e)}catch{this.localStorageData={}}else s=await this.compress("{}","gzip"),localStorage.setItem(Vs,s),this.localStorageData={};const o=1e3*60*60*12;for(const n in this.localStorageData){const l=this.localStorageData[n],c=new Date().getTime()-(l.expirationDelayMs||o);l.lastModifiationMS<c&&delete this.localStorageData[n]}t(!0)}catch{window.requestAnimationFrame(()=>{t(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(t){if(t){const i=I.instances.get(t);return i||(console.warn("No PublisherManager instance registered with id:",t,"creating new one"),new I)}return I.instance==null?new I:I.instance}static registerInstance(t,i){I.instances.has(t)&&console.warn("PublisherManager instance already registered with id: ",t),I.instances.set(t,i)}static get(t,i){return I.getInstance().get(t,i)}static collectModifiedPublisher(){I.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return I.modifiedCollectore.shift()}static delete(t){return t?I.getInstance().delete(t):!1}async setLocalData(t,i){await this.isLocalStrorageReady,t.set(this.localStorageData[i+"¤lang_"+H.getLanguage()]?.data||t.get())}get(t,i){const s=i?.localStorageMode==="enabled",e=i?.invalidateOnPageShow===!0;if(!this.publishers.has(t)){const l=Bs({});this.set(t,l)}const o=this.publishers.get(t);return s&&this.initialisedData.indexOf(t)===-1&&(i?.expirationDelayMs&&(o._expiration_delay_=i.expirationDelayMs),o._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(o,t)),e&&(o._invalidate_on_page_show_=e),this.publishers.get(t)}set(t,i){this.publishers.set(t,i)}delete(t){return this.publishers.has(t)?(this.publishers.delete(t),!0):!1}async saveToLocalStorage(t=0){if(!(t!==I.saveId&&t%10!=0))try{if(!I.changed||I.saving)return;I.saving=!0,I.changed=!1;const i=Array.from(this.publishers.keys());let s=!1;for(const e of i){const o=this.publishers.get(e);if(!o?._is_savable_)continue;const n=o?.get();n&&(this.localStorageData[e+"¤lang_"+H.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:o._expiration_delay_,data:n},s=!0)}if(s){const e=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(Vs,e)}if(I.saving=!1,I.changed){I.saveId++;const e=I.saveId;setTimeout(()=>this.saveToLocalStorage(e),1e3)}}catch{I.saving=!1}}async compress(t,i){const s=new TextEncoder().encode(t),e=window,o=new e.CompressionStream(i),n=o.writable.getWriter();n.write(s),n.close();const l=await new Response(o.readable).arrayBuffer(),c=new Uint8Array(l);let h="";for(let u=0;u<c.length;u++)h+=String.fromCharCode(c[u]);return btoa(h)}async decompress(t,i){const s=atob(t),o=Uint8Array.from(s,u=>u.charCodeAt(0)).buffer,n=window,l=new n.DecompressionStream(i),c=l.writable.getWriter();c.write(o),c.close();const h=await new Response(l.readable).arrayBuffer();return new TextDecoder().decode(h)}};I.buildDate="Fri Apr 10 2026 16:29:04 GMT+0200 (Central European Summer Time)",I.changed=!1,I.saving=!1,I.saveId=0,I.instance=null,I.instances=new Map,I.modifiedCollectore=[];let k=I;if(typeof window<"u"){const r=window;r[hs+"PublisherManager"]=r[hs+"PublisherManager"]||k}const Wr=new Set(["invalidate","onInvalidate","offInvalidate","invalidateForm","onFormInvalidate","offFormInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_formInvalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishFormInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_parentKey_","_value_","_is_savable_","_expiration_delay_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_","_invalidate_on_page_show_"]);function Kr(r,t){return{get:function(i,s){if(typeof s=="string"&&Wr.has(s))return r[s];if(s==Symbol.toPrimitive)return()=>t().get();if(!r._proxies_.has(s)){const e=r._value_[s],o=Bs(Wt(e)?e:{__value:e},r,s);o._proxies_.set("_parent_",t()),r._proxies_.set(s,o)}return r._proxies_.get(s)},set:function(i,s,e){if(s=="_value_")return r._value_=e,!0;if(s=="_cachedGet_")return r._cachedGet_=e,!0;if(s=="_assignmentId_")return r._assignmentId_=e,!0;if(s=="_is_savable_")return r._is_savable_=e,!0;if(s=="_expiration_delay_")return r._expiration_delay_=e,!0;if(s=="_invalidate_on_page_show_")return r._invalidate_on_page_show_=e,!0;if(s=="_instanceCounter_")return r._instanceCounter_=e,!0;if(!r._proxies_.has(s)){const n=Bs({},r,s);n._proxies_.set("_parent_",t()),r._proxies_.set(s,n)}return r._value_[s]!==e&&(r._value_[s]=e,r._publishDynamicFilling_(s,e),r._proxies_.get(s)?.set(Wt(e)?e:{__value:e})),!0},deleteProperty:function(i,s){return r._publishDynamicFilling_(s,null),r._proxies_.get(s)?.set(null),delete r._value_[s]},has:function(i,s){return s in r._value_&&s!="_lockInternalMutationPublishing_"},defineProperty:function(i,s,e){return e&&"value"in e&&(r._value_[s]=e.value),!0},getOwnPropertyDescriptor:function(i,s){return{enumerable:!0,configurable:!0}},ownKeys:function(i){return r._value_.__value?Object.keys(r._value_.__value):Object.keys(r._value_)}}}function Bs(r,t=null,i){const s=new je(r,t,i);let e=null;const o=Kr(s,()=>e);return e=new Proxy(s,o),e}class Yr extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){this.publisherId=this.getAttribute("publisher")||"",this.publisher=je.instances.get(parseInt(this.publisherId)),this.publisher?.onAssign(this.onAssign)}disconnectedCallback(){this.publisher?.offAssign(this.onAssign)}}try{customElements.define(_e+"-publisher-proxy",Yr)}catch{}const us=r=>{if(typeof r=="function"){const t=r;return k.collectModifiedPublisher(),t(),k.getModifiedPublishers()}if(typeof r=="string"){const t=r.split("."),i=t.shift()||"";let s=k.get(i);s=tt.traverse(s,t);const e=new Set;return e.add(s),e}return new Set([r])},Zr=r=>us(r).values().next().value?.get(),zi=r=>us(r).values().next().value,Xr=zi,ps=zi,Gr=(r,t)=>{us(r).values().next().value?.set(t)};window.addEventListener("pageshow",r=>{r.persisted&&k.getInstance().invalidateAll()});let fs=(N=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(N.observedElements.keys()).forEach(t=>N.unObserve(t)))}static observe(t){if(!t||!N.enabled||N.observedElements.has(t))return;const i=new MutationObserver(N.onMutation),s={};s.childList=!0,s.subtree=!0,s.attributes=!0,s.attributeFilter=["data-bind"],i.observe(t,s),t.querySelectorAll("[data-bind]").forEach(e=>N.addPublisherListeners(e)),N.observedElements.set(t,i)}static unObserve(t){if(!t)return;const i=this.observedElements.get(t);i&&(i.disconnect(),t.querySelectorAll("[data-bind]").forEach(s=>N.removePublisherListeners(s)))}static onAdded(t){t.hasAttribute&&t.hasAttribute("data-bind")&&N.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(i=>N.addPublisherListeners(i)):t.childNodes.forEach(i=>N.onAdded(i))}static onRemoved(t){t.hasAttribute&&t.hasAttribute("data-bind")&&N.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll("[data-bind]").forEach(i=>N.removePublisherListeners(i)):t.childNodes.forEach(i=>N.onRemoved(i))}static onMutation(t){for(const i of t)switch(i.type){case"attributes":N.addPublisherListeners(i.target);break;case"childList":i.addedNodes.forEach(s=>{N.onAdded(s)}),i.removedNodes.forEach(s=>{N.onRemoved(s)});break}}static removePublisherListeners(t){const i=N.publisherListeners.get(t);i&&(N.publisherListeners.delete(t),i.forEach(s=>{s.publisher?.offAssign(s.onAssign)}))}static getVariablesDescriptor(t){let i=t.match(/(\$(?:\w+\\?\.?)+)/g);return i?i=i.map(s=>s.replace("$","")):i=[t],i=i.filter(s=>s.length>0),{expression:t.replace("\\",""),variables:i.map(s=>s.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(t){return"attributes"in t?Array.from(t.attributes).filter(i=>i.name.indexOf("::")==0).map(i=>({propertyToUpdate:i.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:N.getVariablesDescriptor(i.value)})):[]}static getSubPublisher(t,i){if(!i)return t;for(const s of i)if(s!="_self_"){if(!t)return null;t=t[s]}return t}static addPublisherListeners(t){N.removePublisherListeners(t);const i=H.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!i)return;const s=k.getInstance().get(i),e=N.getDataBindItems(t),o=[];e.forEach(n=>{const l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(const h of l.variables){const u=h;let d=s;d=N.getSubPublisher(s,u);const g=t,m={publisher:d,onAssign:()=>{const v=l.variables.map(L=>N.getSubPublisher(s,L)?.get());let y=l.expression,$=!1;if(v.length==1&&l.variables[0].join(".")==y.substring(1)){let L=v[0];L===null&&(L=""),g[c]=L;return}for(let L=0;L<v.length;L++){let p=v[L];const f=l.variables[L];p===null&&($=!0,p=void 0),y=y.replace("$"+f.join("."),p)}if(y.indexOf("|")!=-1){const L=y.indexOf("|");if(L==0)y=cs.js(y.substring(1));else{const p=y.substring(0,L),f=y.substring(L+1),_=cs[p];y=$?"":_?_(f):y}}else y=$?"":y;g[c]=y}};d?.onAssign(m.onAssign),o.push(m)}}),N.publisherListeners.set(t,o)}},N.observedElements=new Map,N.enabled=!0,N.publisherListeners=new Map,N);fs.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=fs);/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const x=r=>(t,i)=>{i!==void 0?i.addInitializer((()=>{customElements.define(r,t)})):customElements.define(r,t)};/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2019 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const ms=globalThis,qs=ms.ShadowRoot&&(ms.ShadyCSS===void 0||ms.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hs=Symbol(),Ri=new WeakMap;let Ui=class{constructor(t,i,s){if(this._$cssResult$=!0,s!==Hs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const i=this.t;if(qs&&t===void 0){const s=i!==void 0&&i.length===1;s&&(t=Ri.get(i)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Ri.set(i,t))}return t}toString(){return this.cssText}};const Qr=r=>new Ui(typeof r=="string"?r:r+"",void 0,Hs),P=(r,...t)=>{const i=r.length===1?r[0]:t.reduce(((s,e,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+r[o+1]),r[0]);return new Ui(i,r,Hs)},Jr=(r,t)=>{if(qs)r.adoptedStyleSheets=t.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(const i of t){const s=document.createElement("style"),e=ms.litNonce;e!==void 0&&s.setAttribute("nonce",e),s.textContent=i.cssText,r.appendChild(s)}},Vi=qs?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let i="";for(const s of t.cssRules)i+=s.cssText;return Qr(i)})(r):r;/**
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright 2017 Google LLC
|
|
12
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const{is:to,defineProperty:eo,getOwnPropertyDescriptor:so,getOwnPropertyNames:io,getOwnPropertySymbols:ro,getPrototypeOf:oo}=Object,bs=globalThis,Bi=bs.trustedTypes,no=Bi?Bi.emptyScript:"",ao=bs.reactiveElementPolyfillSupport,Fe=(r,t)=>r,gs={toAttribute(r,t){switch(t){case Boolean:r=r?no:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let i=r;switch(t){case Boolean:i=r!==null;break;case Number:i=r===null?null:Number(r);break;case Object:case Array:try{i=JSON.parse(r)}catch{i=null}}return i}},Ws=(r,t)=>!to(r,t),qi={attribute:!0,type:String,converter:gs,reflect:!1,useDefault:!1,hasChanged:Ws};Symbol.metadata??=Symbol("metadata"),bs.litPropertyMetadata??=new WeakMap;let xe=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=qi){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(t,i),!i.noAccessor){const s=Symbol(),e=this.getPropertyDescriptor(t,s,i);e!==void 0&&eo(this.prototype,t,e)}}static getPropertyDescriptor(t,i,s){const{get:e,set:o}=so(this.prototype,t)??{get(){return this[i]},set(n){this[i]=n}};return{get:e,set(n){const l=e?.call(this);o?.call(this,n),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??qi}static _$Ei(){if(this.hasOwnProperty(Fe("elementProperties")))return;const t=oo(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Fe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fe("properties"))){const i=this.properties,s=[...io(i),...ro(i)];for(const e of s)this.createProperty(e,i[e])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[s,e]of i)this.elementProperties.set(s,e)}this._$Eh=new Map;for(const[i,s]of this.elementProperties){const e=this._$Eu(i,s);e!==void 0&&this._$Eh.set(e,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const e of s)i.unshift(Vi(e))}else t!==void 0&&i.push(Vi(t));return i}static _$Eu(t,i){const s=i.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const s of i.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Jr(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,i,s){this._$AK(t,s)}_$ET(t,i){const s=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,s);if(e!==void 0&&s.reflect===!0){const o=(s.converter?.toAttribute!==void 0?s.converter:gs).toAttribute(i,s.type);this._$Em=t,o==null?this.removeAttribute(e):this.setAttribute(e,o),this._$Em=null}}_$AK(t,i){const s=this.constructor,e=s._$Eh.get(t);if(e!==void 0&&this._$Em!==e){const o=s.getPropertyOptions(e),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:gs;this._$Em=e;const l=n.fromAttribute(i,o.type);this[e]=l??this._$Ej?.get(e)??l,this._$Em=null}}requestUpdate(t,i,s){if(t!==void 0){const e=this.constructor,o=this[t];if(s??=e.getPropertyOptions(t),!((s.hasChanged??Ws)(o,i)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,s))))return;this.C(t,i,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,i,{useDefault:s,reflect:e,wrapped:o},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??i??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(i=void 0),this._$AL.set(t,i)),e===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,o]of this._$Ep)this[e]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[e,o]of s){const{wrapped:n}=o,l=this[e];n!==!0||this._$AL.has(e)||l===void 0||this.C(e,void 0,o,l)}}let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(i)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(i)}willUpdate(t){}_$AE(t){this._$EO?.forEach((i=>i.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((i=>this._$ET(i,this[i]))),this._$EM()}updated(t){}firstUpdated(t){}};xe.elementStyles=[],xe.shadowRootOptions={mode:"open"},xe[Fe("elementProperties")]=new Map,xe[Fe("finalized")]=new Map,ao?.({ReactiveElement:xe}),(bs.reactiveElementVersions??=[]).push("2.1.1");/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright 2017 Google LLC
|
|
16
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/const lo={attribute:!0,type:String,converter:gs,reflect:!1,hasChanged:Ws},co=(r=lo,t,i)=>{const{kind:s,metadata:e}=i;let o=globalThis.litPropertyMetadata.get(e);if(o===void 0&&globalThis.litPropertyMetadata.set(e,o=new Map),s==="setter"&&((r=Object.create(r)).wrapped=!0),o.set(i.name,r),s==="accessor"){const{name:n}=i;return{set(l){const c=t.get.call(this);t.set.call(this,l),this.requestUpdate(n,c,r)},init(l){return l!==void 0&&this.C(n,void 0,r,l),l}}}if(s==="setter"){const{name:n}=i;return function(l){const c=this[n];t.call(this,l),this.requestUpdate(n,c,r)}}throw Error("Unsupported decorator location: "+s)};function a(r){return(t,i)=>typeof i=="object"?co(r,t,i):((s,e,o)=>{const n=e.hasOwnProperty(o);return e.constructor.createProperty(o,s),n?Object.getOwnPropertyDescriptor(e,o):void 0})(r,t,i)}/**
|
|
18
|
-
* @license
|
|
19
|
-
* Copyright 2017 Google LLC
|
|
20
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
-
*/function E(r){return a({...r,state:!0,attribute:!1})}/**
|
|
22
|
-
* @license
|
|
23
|
-
* Copyright 2017 Google LLC
|
|
24
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/const Ks=(r,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(r,t,i),i);/**
|
|
26
|
-
* @license
|
|
27
|
-
* Copyright 2017 Google LLC
|
|
28
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/function Kt(r,t){return(i,s,e)=>{const o=n=>n.renderRoot?.querySelector(r)??null;return Ks(i,s,{get(){return o(this)}})}}/**
|
|
30
|
-
* @license
|
|
31
|
-
* Copyright 2021 Google LLC
|
|
32
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/function Pe(r){return(t,i)=>{const{slot:s,selector:e}=r??{},o="slot"+(s?`[name=${s}]`:":not([name])");return Ks(t,i,{get(){const n=this.renderRoot?.querySelector(o),l=n?.assignedElements(r)??[];return e===void 0?l:l.filter((c=>c.matches(e)))}})}}/**
|
|
34
|
-
* @license
|
|
35
|
-
* Copyright 2017 Google LLC
|
|
36
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
-
*/function at(r){return(t,i)=>{const{slot:s}=r??{},e="slot"+(s?`[name=${s}]`:":not([name])");return Ks(t,i,{get(){return this.renderRoot?.querySelector(e)?.assignedNodes(r)??[]}})}}/**
|
|
38
|
-
* @license
|
|
39
|
-
* Copyright 2017 Google LLC
|
|
40
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
-
*/const Ys=globalThis,vs=Ys.trustedTypes,Hi=vs?vs.createPolicy("lit-html",{createHTML:r=>r}):void 0,Wi="$lit$",Yt=`lit$${Math.random().toFixed(9).slice(2)}$`,Ki="?"+Yt,ho=`<${Ki}>`,ne=document,ze=()=>ne.createComment(""),Re=r=>r===null||typeof r!="object"&&typeof r!="function",Zs=Array.isArray,uo=r=>Zs(r)||typeof r?.[Symbol.iterator]=="function",Xs=`[
|
|
42
|
-
\f\r]`,Ue=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Yi=/-->/g,Zi=/>/g,ae=RegExp(`>|${Xs}(?:([^\\s"'>=/]+)(${Xs}*=${Xs}*(?:[^
|
|
43
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Xi=/'/g,Gi=/"/g,Qi=/^(?:script|style|textarea|title)$/i,po=r=>(t,...i)=>({_$litType$:r,strings:t,values:i}),b=po(1),vt=Symbol.for("lit-noChange"),S=Symbol.for("lit-nothing"),Ji=new WeakMap,le=ne.createTreeWalker(ne,129);function tr(r,t){if(!Zs(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hi!==void 0?Hi.createHTML(t):t}const fo=(r,t)=>{const i=r.length-1,s=[];let e,o=t===2?"<svg>":t===3?"<math>":"",n=Ue;for(let l=0;l<i;l++){const c=r[l];let h,u,d=-1,g=0;for(;g<c.length&&(n.lastIndex=g,u=n.exec(c),u!==null);)g=n.lastIndex,n===Ue?u[1]==="!--"?n=Yi:u[1]!==void 0?n=Zi:u[2]!==void 0?(Qi.test(u[2])&&(e=RegExp("</"+u[2],"g")),n=ae):u[3]!==void 0&&(n=ae):n===ae?u[0]===">"?(n=e??Ue,d=-1):u[1]===void 0?d=-2:(d=n.lastIndex-u[2].length,h=u[1],n=u[3]===void 0?ae:u[3]==='"'?Gi:Xi):n===Gi||n===Xi?n=ae:n===Yi||n===Zi?n=Ue:(n=ae,e=void 0);const m=n===ae&&r[l+1].startsWith("/>")?" ":"";o+=n===Ue?c+ho:d>=0?(s.push(h),c.slice(0,d)+Wi+c.slice(d)+Yt+m):c+Yt+(d===-2?l:m)}return[tr(r,o+(r[i]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};let Gs=class qr{constructor({strings:t,_$litType$:i},s){let e;this.parts=[];let o=0,n=0;const l=t.length-1,c=this.parts,[h,u]=fo(t,i);if(this.el=qr.createElement(h,s),le.currentNode=this.el.content,i===2||i===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(e=le.nextNode())!==null&&c.length<l;){if(e.nodeType===1){if(e.hasAttributes())for(const d of e.getAttributeNames())if(d.endsWith(Wi)){const g=u[n++],m=e.getAttribute(d).split(Yt),v=/([.?@])?(.*)/.exec(g);c.push({type:1,index:o,name:v[2],strings:m,ctor:v[1]==="."?bo:v[1]==="?"?go:v[1]==="@"?vo:ys}),e.removeAttribute(d)}else d.startsWith(Yt)&&(c.push({type:6,index:o}),e.removeAttribute(d));if(Qi.test(e.tagName)){const d=e.textContent.split(Yt),g=d.length-1;if(g>0){e.textContent=vs?vs.emptyScript:"";for(let m=0;m<g;m++)e.append(d[m],ze()),le.nextNode(),c.push({type:2,index:++o});e.append(d[g],ze())}}}else if(e.nodeType===8)if(e.data===Ki)c.push({type:2,index:o});else{let d=-1;for(;(d=e.data.indexOf(Yt,d+1))!==-1;)c.push({type:7,index:o}),d+=Yt.length-1}o++}}static createElement(t,i){const s=ne.createElement("template");return s.innerHTML=t,s}};function $e(r,t,i=r,s){if(t===vt)return t;let e=s!==void 0?i._$Co?.[s]:i._$Cl;const o=Re(t)?void 0:t._$litDirective$;return e?.constructor!==o&&(e?._$AO?.(!1),o===void 0?e=void 0:(e=new o(r),e._$AT(r,i,s)),s!==void 0?(i._$Co??=[])[s]=e:i._$Cl=e),e!==void 0&&(t=$e(r,e._$AS(r,t.values),e,s)),t}let mo=class{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??ne).importNode(i,!0);le.currentNode=e;let o=le.nextNode(),n=0,l=0,c=s[0];for(;c!==void 0;){if(n===c.index){let h;c.type===2?h=new Ce(o,o.nextSibling,this,t):c.type===1?h=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(h=new yo(o,this,t)),this._$AV.push(h),c=s[++l]}n!==c?.index&&(o=le.nextNode(),n++)}return le.currentNode=ne,e}p(t){let i=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++}};class Ce{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=S,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&t?.nodeType===11&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=$e(this,t,i),Re(t)?t===S||t==null||t===""?(this._$AH!==S&&this._$AR(),this._$AH=S):t!==this._$AH&&t!==vt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):uo(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==S&&Re(this._$AH)?this._$AA.nextSibling.data=t:this.T(ne.createTextNode(t)),this._$AH=t}$(t){const{values:i,_$litType$:s}=t,e=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=Gs.createElement(tr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else{const o=new mo(e,this),n=o.u(this.options);o.p(i),this.T(n),this._$AH=o}}_$AC(t){let i=Ji.get(t.strings);return i===void 0&&Ji.set(t.strings,i=new Gs(t)),i}k(t){Zs(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new Ce(this.O(ze()),this.O(ze()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e)}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class ys{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,o){this.type=1,this._$AH=S,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=S}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(o===void 0)t=$e(this,t,i,0),n=!Re(t)||t!==this._$AH&&t!==vt,n&&(this._$AH=t);else{const l=t;let c,h;for(t=o[0],c=0;c<o.length-1;c++)h=$e(this,l[s+c],i,c),h===vt&&(h=this._$AH[c]),n||=!Re(h)||h!==this._$AH[c],h===S?t=S:t!==S&&(t+=(h??"")+o[c+1]),this._$AH[c]=h}n&&!e&&this.j(t)}j(t){t===S?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class bo extends ys{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===S?void 0:t}}class go extends ys{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==S)}}class vo extends ys{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5}_$AI(t,i=this){if((t=$e(this,t,i,0)??S)===vt)return;const s=this._$AH,e=t===S&&s!==S||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==S&&(s===S||e);e&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class yo{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){$e(this,t)}}const wo={I:Ce},_o=Ys.litHtmlPolyfillSupport;_o?.(Gs,Ce),(Ys.litHtmlVersions??=[]).push("3.3.1");const xo=(r,t,i)=>{const s=i?.renderBefore??t;let e=s._$litPart$;if(e===void 0){const o=i?.renderBefore??null;s._$litPart$=e=new Ce(t.insertBefore(ze(),o),o,void 0,i??{})}return e._$AI(r),e};/**
|
|
44
|
-
* @license
|
|
45
|
-
* Copyright 2020 Google LLC
|
|
46
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/const{I:Po}=wo,$o=r=>r.strings===void 0,er=()=>document.createComment(""),Ve=(r,t,i)=>{const s=r._$AA.parentNode,e=t===void 0?r._$AB:t._$AA;if(i===void 0){const o=s.insertBefore(er(),e),n=s.insertBefore(er(),e);i=new Po(o,n,r,r.options)}else{const o=i._$AB.nextSibling,n=i._$AM,l=n!==r;if(l){let c;i._$AQ?.(r),i._$AM=r,i._$AP!==void 0&&(c=r._$AU)!==n._$AU&&i._$AP(c)}if(o!==e||l){let c=i._$AA;for(;c!==o;){const h=c.nextSibling;s.insertBefore(c,e),c=h}}}return i},ce=(r,t,i=r)=>(r._$AI(t,i),r),Co={},So=(r,t=Co)=>r._$AH=t,Ao=r=>r._$AH,Qs=r=>{r._$AR(),r._$AA.remove()};/**
|
|
48
|
-
* @license
|
|
49
|
-
* Copyright 2017 Google LLC
|
|
50
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
-
*/const he={ATTRIBUTE:1,CHILD:2},Zt=r=>(...t)=>({_$litDirective$:r,values:t});let Se=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};/**
|
|
52
|
-
* @license
|
|
53
|
-
* Copyright 2017 Google LLC
|
|
54
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
-
*/const Be=(r,t)=>{const i=r._$AN;if(i===void 0)return!1;for(const s of i)s._$AO?.(t,!1),Be(s,t);return!0},ws=r=>{let t,i;do{if((t=r._$AM)===void 0)break;i=t._$AN,i.delete(r),r=t}while(i?.size===0)},sr=r=>{for(let t;t=r._$AM;r=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(r))break;i.add(r),Do(t)}};function ko(r){this._$AN!==void 0?(ws(this),this._$AM=r,sr(this)):this._$AM=r}function Oo(r,t=!1,i=0){const s=this._$AH,e=this._$AN;if(e!==void 0&&e.size!==0)if(t)if(Array.isArray(s))for(let o=i;o<s.length;o++)Be(s[o],!1),ws(s[o]);else s!=null&&(Be(s,!1),ws(s));else Be(this,r)}const Do=r=>{r.type==he.CHILD&&(r._$AP??=Oo,r._$AQ??=ko)};class Js extends Se{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),sr(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(Be(this,t),ws(this))}setValue(t){if($o(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}/**
|
|
56
|
-
* @license
|
|
57
|
-
* Copyright 2017 Google LLC
|
|
58
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/const ti=globalThis;let w=class extends xe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=xo(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return vt}};w._$litElement$=!0,w.finalized=!0,ti.litElementHydrateSupport?.({LitElement:w});const Lo=ti.litElementPolyfillSupport;Lo?.({LitElement:w}),(ti.litElementVersions??=[]).push("4.2.1");const U=class U{constructor(t){this.addHTTPResponse=!1,this.cache="default",this.isServiceSimulated=!1,this.blockUntilDone=!1,this.keepAlive=!1,this.serviceURL=t.serviceURL,this.blockUntilDone=t.blockUntilDone||!1,this.serviceURL=="publisher://"&&(this.isServiceSimulated=!0),this.serviceURL||(this.serviceURL=document.location.origin),this.userName=t.userName,this.password=t.password,t.token&&(this.token=t.token),this.tokenProvider=t.tokenProvider,this.authToken=t.authToken,this.addHTTPResponse=t.addHTTPResponse||!1,this.credentials=t.credentials,this.cache=t.cache||"default",this.keepAlive=t.keepAlive||!1}set token(t){if(this._token=t,!t){U.tokens.delete(this.serviceURL);return}U.invalidTokens.includes(t)||U.tokens.set(this.serviceURL,t)}get token(){return U.invalidTokens.includes(this._token)?U.tokens.get(this.serviceURL):this._token}handleInvalidToken(t){t&&(U.invalidTokens.includes(t)||(U.invalidTokens.push(t),this.token=null))}async handleResult(t,i){U.firstCallDoneFlags.set(this.serviceURL,"done"),this.lastResult=t;const s=t.headers.get("content-type")?.toLowerCase(),e=t.status;let o={};if(!s||s.indexOf("text/")==0)o={text:await t.text()};else try{o=await t.json()}catch{o={}}return this.addHTTPResponse&&tt.isObject(o)&&(o._sonic_http_response_=t),e===498&&!U.failledTokenUpdates.has(this.serviceURL)&&(this.handleInvalidToken(this.token),i.apiMethod==="get"?o=await this[i.apiMethod](i.path,i.additionalHeaders):o=await this[i.apiMethod](i.path,i.data,i.method,i.additionalHeaders)),ps("sonic-api").lastResponse.set({http:t,processed:o}),o}async auth(){if(this.token)return;if(U.tokens.has(this.serviceURL)){this.token=U.tokens.get(this.serviceURL);return}if(!this.tokenProvider)return;let t={};this.userName&&this.password?t={Authorization:"Basic "+window.btoa(unescape(encodeURIComponent(this.userName+":"+this.password)))}:this.authToken&&(t={Authorization:"Bearer "+this.authToken});const i=new URL(this.serviceURL),s=i.protocol+"//"+i.host,e=await fetch(this.computeURL(this.tokenProvider,{serviceHost:s}),{headers:t,credentials:this.credentials,keepalive:this.keepAlive});try{const o=await e.json();o.token?this.token=o.token:U.failledTokenUpdates.set(this.serviceURL,!0)}catch{U.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(t,i){const s=k.get(t),e=new URLSearchParams(i.split("?")[1]||""),o=s.get();let n=[];Array.isArray(o)?n=o:n=[o];const l=[];let c=Number.POSITIVE_INFINITY,h=0,u=0;if(e.has("limit")&&(c=parseInt(e.get("limit")||"0"),u++),e.has("offset")&&(h=parseInt(e.get("offset")||"0"),u++),u>0&&(e.delete("limit"),e.delete("offset")),e.size===0)return n.slice(h,h+c);for(const[d,g]of e.entries()){const m=g.split(",").map(v=>v.trim());for(const v of m)for(const y of n)if(typeof y!="object")isNaN(+y)?y.toString().toLowerCase().includes(g.toLowerCase())&&l.push(y):y===g&&l.push(y);else{const $=y;if(!$[d])continue;isNaN(+$[d])?$[d]?.toString().toLowerCase().includes(v.toLowerCase())&&l.push(y):$[d]===v&&l.push(y)}}return l.slice(h,h+c)}firstCallDone(){return new Promise(t=>{if(!U.firstCallDoneFlags.has(this.serviceURL))U.firstCallDoneFlags.set(this.serviceURL,"loading"),t(!0);else{const i=()=>{[void 0,"loading"].includes(U.firstCallDoneFlags.get(this.serviceURL))?window.requestAnimationFrame(i):t(!0)};i()}})}async get(t,i){await this.firstCallDone(),this.blockUntilDone&&U.firstCallDoneFlags.set(this.serviceURL,"loading");const s=/dataProvider\((.*?)\)(.*?)$/;if(s.test(t)){const h=t.match(s);if(!h)throw new Error("dataProvider path is not valid");return await this.localGet(h[1],h[2])}const e={apiMethod:"get",path:t,additionalHeaders:i},o=await this.createHeaders(i),n=this.computeURL(t),l=JSON.stringify({url:n,headers:o});if(!U.loadingGetPromises.has(l)){const h=new Promise(async u=>{try{const d=await fetch(n,{headers:o,credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),g=await this.handleResult(d,e);u(g)}catch{u(null)}});U.loadingGetPromises.set(l,h)}const c=await U.loadingGetPromises.get(l);return U.loadingGetPromises.delete(l),c}async createHeaders(t){await this.auth();const i={};return this.token&&(i.Authorization="Bearer "+this.token),i["Accept-Language"]=H.getLanguage(),t&&Object.assign(i,t),i}computeURL(t,i={}){let s="";t.startsWith("http")?s=t:s=this.serviceURL+"/"+t,s.startsWith("http")||(s=window.location.origin+s);const e=new URL(s);for(const o in i)e.searchParams.set(o,i[o]);return e.toString().replace(/([^(https?:)])\/{2,}/g,"$1/")}async send(t,i,s="POST",e){const o={apiMethod:"send",path:t,additionalHeaders:e,method:s,data:i},n=await this.createHeaders(e);n.Accept="application/json",n["Content-Type"]="application/json";const l=await fetch(this.computeURL(t),{headers:n,credentials:this.credentials,method:s,body:JSON.stringify(i),keepalive:this.keepAlive});return await this.handleResult(l,o)}async submitFormData(t,i,s="POST",e){const o={apiMethod:"submitFormData",path:t,additionalHeaders:e,method:s,data:i},n=await this.createHeaders(e);n.Accept="application/json";const l=new FormData,c=i;for(const u in c)l.set(u,c[u]);const h=await fetch(this.computeURL(t),{headers:n,credentials:this.credentials,method:s,body:l,keepalive:this.keepAlive});return await this.handleResult(h,o)}async put(t,i,s){return this.send(t,i,"PUT",s)}async post(t,i,s){return this.send(t,i,"POST",s)}async patch(t,i,s){return this.send(t,i,"PATCH",s)}async delete(t,i,s){return this.send(t,i,"delete",s)}};U.loadingGetPromises=new Map,U.tokens=new Map,U.invalidTokens=[],U.failledTokenUpdates=new Map,U.firstCallDoneFlags=new Map;let Ae=U;H.getApiConfiguration(document.body||document.documentElement);const Eo=async(r,t)=>{};/**
|
|
60
|
-
* @license
|
|
61
|
-
* Copyright 2017 Google LLC
|
|
62
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/let ei=class extends Se{constructor(t){if(super(t),this.it=S,t.type!==he.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===S||t==null)return this._t=void 0,this.it=t;if(t===vt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const i=[t];return i.raw=i,this._t={_$litType$:this.constructor.resultType,strings:i,values:[]}}};ei.directiveName="unsafeHTML",ei.resultType=1;const F=Zt(ei),si=new Map,ir=r=>{if(!r)return null;const t=H.getApiConfiguration(r),i=H.getAncestorAttributeValue(r,"wordingProvider"),s=H.getAncestorAttributeValue(r,"wordingVersionProvider"),e={apiConfiguration:t,wordingProvider:i,wordingVersionProvider:s};let o=null;for(const[n,l]of si)if(tt.deepEqual(n,e)){o=l;break}return o||(o={api:new Ae(t),keysToTranslate:new Set,translatedKeys:new Set,wordingProvider:i,callIndex:0,wordingVersionProvider:s,apiCallKey:e},si.set(e,o)),o},rr="",B=class B extends Js{constructor(t){super(t),this.useUnsafeHTML=!1,this.onAssign=i=>{const s=this.useUnsafeHTML?F(i):i;this.setValue(s)},this.node=t.options.host}unsubscribe(){B.publisher["wording_"+this.key].offAssign(this.onAssign)}render(t,i=!1){return this.useUnsafeHTML=i,this.key!==t&&(this.key=t,this.isConnected&&this.subscribe(t)),vt}static async callApi(t,i,s=!0,e){if(await k.getInstance().isLocalStrorageReady,B.firstCall){B.firstCall=!1,Us(B.reloadWordings);const u=Object.keys(B.publisher.get());for(const d of u)B.publisher.get()[d]===rr&&delete B.publisher[d]}if(t){const u=H.getAncestorAttributeValue(t,"wordingVersionProvider");u&&ps(u).onAssign(B.handleVersionProvider(t))}let o=B.publisher.get()["wording_"+i]!=null;const n=e||ir(t);if(!n)return;if(o&&i!==""){n.translatedKeys.add(i);return}n.callIndex++;const l=n.callIndex,c=n.wordingProvider??"";if(!c&&s){window.setTimeout(async()=>{B.callApi(null,i,!1,n)},1e3);return}const h=n.api;window.queueMicrotask(async()=>{if(o=B.publisher["wording_"+i].get()!=null,!o&&i!==""&&(n.keysToTranslate.add(i),B.publisher["wording_"+i].set(rr)),l!==n.callIndex)return;const u=Array.from(n.keysToTranslate);if(!u.length)return;const d=c.split("?"),g=d.shift(),m=(d.length>0?d.join("?")+"&":"")+"labels[]="+u.join("&labels[]="),v=g+"?"+m;n.translatedKeys=new Set([...n.translatedKeys,...n.keysToTranslate]),n.keysToTranslate.clear();const y=await h.get(v);for(const $ in y)B.publisher["wording_"+$].set(y[$])})}static reloadWordings(){for(const t of si.values())t.keysToTranslate=new Set(t.translatedKeys),t.keysToTranslate.size>0&&B.callApi(null,"",!1,t)}static handleVersionProvider(t){const i=ir(t),s=o=>{};if(!i)return s;if(B.versionProviderHandlers.has(i))return B.versionProviderHandlers.get(i)||s;const e=function(o){if(!i.wordingVersionProvider)return;const l=B.publisher.get().__wording_versions__??[];if(o==null)return;const c=l.find(h=>h.serviceURL===i.api.serviceURL)||{serviceURL:i.api.serviceURL,version:0};l.includes(c)||l.push(c),o!==c.version&&(c.version=o,B.publisher.set({__wording_versions__:l}),B.reloadWordings())};return B.versionProviderHandlers.set(i,e),e}subscribe(t){this.unsubscribe(),B.publisher["wording_"+t].onAssign(this.onAssign),B.callApi(this.node,t)}disconnected(){this.unsubscribe()}reconnected(){this.key&&this.subscribe(this.key)}};B.publisher=k.get("sonic-wording",{localStorageMode:"enabled"}),B.firstCall=!0,B.versionProviderHandlers=new Map;let ke=B;const No=Zt(ke);var To=Object.defineProperty,Io=Object.getOwnPropertyDescriptor,kt=(r,t,i,s)=>{for(var e=s>1?void 0:s?Io(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&To(t,i,e),e};let _s=!1,ii=new Set;const X=(r,t)=>{var e;const i=(e=class extends r{constructor(...n){super(),this.collectDependenciesVersion=0,this.displayContents=!1,this.noAutoFill=!1,this.forceAutoFill=!1,this.renderOnPropsInternalChange=!1,this.noShadowDom=null,this.propertyMap=null,this.title="",this.dataProvider=null,this.bindPublisher=null,this._props=null,this.shouldRenderLazy=!0,this.defferedDebug=null,this.debug=null,this.onAssign=l=>{this.props=l}}hasAncestorAttribute(n){return this.getAncestorAttributeValue(n)!=null}getAncestorAttributeValue(n){return H.getAncestorAttributeValue(this,n)}get props(){return this._props!==null||!this.publisher?this._props:this.publisher.get()}set props(n){typeof n=="string"&&["{","["].includes(n.trim().charAt(0))&&(n=JSON.parse(n)),n!=this._props&&(this._props=n,this.publisher&&this.publisher.get()!=n&&this.publisher.set(n),this.requestUpdate())}updated(n){super.updated(n);const c=[...(this.shadowRoot||this).children].filter(u=>u.tagName!="STYLE"),h=this.displayContents?"contents":c.length==0?"none":null;h?this.style.display=h:this.style.removeProperty("display")}connectedCallback(){if(e.instanceCounter++,this.hasAttribute("lazyRendering")){const n={root:null,threshold:.9};let l=!0;const c=new IntersectionObserver(h=>{for(const u of h)if(l&&u.isIntersecting){l=!1,c.disconnect(),this.initWording(),this.shouldRenderLazy=!1,this.startPublisher();break}},n);c.observe(this)}else this.initWording(),this.shouldRenderLazy=!1;this.initPublisher(),this.addDebugger(),super.connectedCallback()}disconnectedCallback(){this.removeDebugger(),super.disconnectedCallback(),this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate)),ke.publisher.stopTemplateFilling(this),this.onAssign&&this.publisher?.offAssign(this.onAssign)}addDebugger(){if(this.hasAttribute("debug")&&!this.defferedDebug){if(!this.debug){this.debug=document.createElement("div");const n=this.debug.style;n.position="fixed",n.top="0",n.right="0",n.margin="auto",n.borderRadius=".7rem",n.backgroundColor="#0f1729",n.color="#c5d4f9",n.padding="16px 16px",n.margin="16px 16px",n.boxShadow="0 10px 30px -18px rgba(0,0,0,.3)",n.overflowY="auto",n.zIndex="99999999",n.maxHeight="calc(100vh - 32px)",n.fontFamily="Consolas, monospace",n.maxWidth="min(50vw,25rem)",n.fontSize="12px",n.minWidth="300px",n.overflowWrap="break-word",n.resize="vertical"}this.addEventListener("click",n=>{n.ctrlKey&&(n.preventDefault(),_s=!_s)}),this.dataProvider&&(window[this.dataProvider]=this.publisher),this.addEventListener("mouseover",()=>{_s||this.removeDebugger(),document.body.appendChild(this.debug),ii.add(this.debug)}),this.addEventListener("mouseout",()=>{_s||this.removeDebugger()}),this.publisher?.onInternalMutation(()=>{this.debug.innerHTML=`🤖 DataProvider : "<b style="font-weight:bold;color:#fff;">${this.dataProvider}</b>"<br>
|
|
1
|
+
(function(e){typeof define==`function`&&define.amd?define([],e):e()})(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=class e{static getLanguage(){let e=document.documentElement.lang;return localStorage.getItem(`SonicSelectedLanguage`)||e}static getCookies(){return document.cookie.split(`;`).reduce((e,t)=>{let n=t.indexOf(`=`);return e[t.substring(0,n).trim()]=t.substring(n+1),e},{})}static everyAncestors(e,t){for(;e;){if(!t(e))return;e=e.parentNode||e.host}}static getScrollableAncestor(e){for(;e;){let t=e;if(t.nodeType===1){let n=window.getComputedStyle(t);if(n?.overflowY===`auto`||n?.overflowY===`scroll`||n?.overflowY===`hidden`||n?.overflowX===`auto`||n?.overflowX===`scroll`||n?.overflowX===`hidden`)return e}e=e.parentNode||e.host}return null}static getAncestorAttributeValue(e,t){if(!e)return null;for(;!(`hasAttribute`in e&&e.hasAttribute(t))&&(e.parentNode||e.host);)e=e.parentNode||e.host;return`hasAttribute`in e?e.getAttribute(t):null}static getApiConfiguration(t){let n=e.getAncestorAttributeValue(t,`token`),r=e.getAncestorAttributeValue(t,`addHTTPResponse`)!=null,i=e.getAncestorAttributeValue(t,`serviceURL`),a=null,o=null,s=e.getAncestorAttributeValue(t,`tokenProvider`),c=e.getAncestorAttributeValue(t,`eventsApiToken`);n||(a=e.getAncestorAttributeValue(t,`userName`),o=e.getAncestorAttributeValue(t,`password`));let l=e.getAncestorAttributeValue(t,`credentials`)||void 0,u=t.getAttribute(`cache`),d=t.hasAttribute(`blockUntilDone`),f=t.hasAttribute(`keepAlive`);return{serviceURL:i,token:n,userName:a,password:o,authToken:c,tokenProvider:s,addHTTPResponse:r,credentials:l,cache:u,blockUntilDone:d,keepAlive:f}}static getClosestElement(e,t){for(;!(e.nodeName&&e.nodeName.toLowerCase()===t)&&(e.parentNode||e.host);)e=e.parentNode||e.host;return e.nodeName?e:null}static getClosestForm(t){return e.getClosestElement(t,`form`)}static getAncestorsByTagNames(e,t){let n=new Set(t.map(e=>e.toLowerCase())),r=[],i=e.parentNode||e.host;for(;i;)i instanceof Element&&n.has(i.tagName.toLowerCase())&&r.push(i),i=i.parentNode||i.host;return r}static getAncestorsBySelectors(e,t){let n=[],r=e.parentNode||e.host;for(;r;){if(r instanceof Element)for(let e of t)try{if(r.matches(e)){n.push(r);break}}catch{}r=r.parentNode||r.host}return n}static async loadJS(e){return new Promise(async t=>{let n=document.createElement(`script`);n.src=e,n.onload=()=>t(!0),n.onerror=()=>t(!0),document.head.appendChild(n)})}static async loadCSS(e){return new Promise(async t=>{let n=document.createElement(`link`);n.type=`text/css`,n.rel=`stylesheet`,n.href=e,n.onload=()=>t(!0),n.onerror=()=>t(!0),document.head.appendChild(n)})}},u=e=>{let t=document.documentElement;new MutationObserver(t=>{for(let n of t)n.type===`attributes`&&n.attributeName===`lang`&&e()}).observe(t,{attributes:!0,attributeFilter:[`lang`]})},d=class{static ucFirst(e){return typeof e==`string`?e.charAt(0).toUpperCase()+e.substring(1):e}static minutesDuration(e,t=``,n=`long`){t||=l.getLanguage();let r=(e,t)=>[Math.floor(e/t),e%t];function i(e,t,n){return new Intl.NumberFormat(e,{style:`unit`,unit:t,unitDisplay:n}).format}let[a,o]=r(e,60),s=[];return a&&s.push(i(t,`hour`,n)(a)),o&&s.push(i(t,`minute`,n)(o)),new Intl.ListFormat(t,{style:`long`,type:`conjunction`}).format(s)}static js(e){try{return Function(`return `+e)()}catch{return``}}},f=class e{static shallowEqual(e,t,n=!0){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length&&n)return!1;for(let i of r){let r=e[i],a=t[i];if(n?r!==a:r!=a)return!1}return!0}static deepEqual(t,n,r=!0){let i=Object.keys(t),a=Object.keys(n);if(i.length!==a.length&&r)return!1;for(let a of i){let i=t[a],o=n[a],s=e.isObject(i)&&e.isObject(o),c=r?i!==o:i!=o;if(s&&!e.deepEqual(i,o)||!s&&c)return!1}return!0}static isObject(e){return typeof e==`object`&&!!e}static isUndefindOrNull(e){return e==null}static isEmpty(t){return e.isUndefindOrNull(t)?!0:Object.keys(t).length===0}static traverse(t,n,r=!1){for(let i of n){let n=t[i];if(n===void 0)return;t=r&&e.isObject(n)?Object.assign(Array.isArray(n)?[]:{},t,n):t[i]}return t}static traverseDotNotation(t,n,r=!1){return e.traverse(t,n.split(`.`),r)}static getURLSearchArray(t,n=``){let r=[];for(let i in t){let a=t[i];n&&(i=n+`[`+i+`]`),e.isObject(a)?r=[...r,...this.getURLSearchArray(a,i)]:r.push(`${i}=${a}`)}return r}static getURLSearchString(t){return e.getURLSearchArray(t,``).join(`&`)}},p=f.traverseDotNotation,m=class{static async queueTaskPromise(){return new Promise(e=>{window.queueMicrotask(()=>e(null))})}static async delayPromise(e){return new Promise(t=>{setTimeout(t,e)})}},h=`sonic`;typeof __SONIC_PREFIX__<`u`&&(h=__SONIC_PREFIX__);var ee=h.replace(/-([a-z])/g,e=>e[1].toUpperCase()),te=ee.charAt(0).toUpperCase()+ee.slice(1);function ne(e){return Object.prototype.hasOwnProperty.call(e,`__value`)}function g(e){return typeof e==`object`&&!!e}var re=`sonic`;typeof __SONIC_PREFIX__>`u`&&(re=`sonic`);var ie=re==`sonic`?`publisher-proxies-data`:re+`-publisher-proxies-data`,ae=class e{static{this.instances=new Map}static{this.instancesCounter=0}constructor(e,t,n){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidate_on_page_show_=!1,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=e,this.parent=t||null,this._parentKey_=n,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(let e in this._proxies_.keys())e!=`_parent_`&&this._proxies_.get(e)?.delete();this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),e.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(e=!1){if(this._mutationListeners_.forEach(e=>e()),this._is_savable_&&!_.changed){_.changed=!0,_.saveId++;let e=_.saveId;setTimeout(()=>_.getInstance().saveToLocalStorage(e),1e3)}e||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(e=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;let t=this.get();this._assignListeners_.forEach(e=>{e(t)}),this._publishInternalMutation_(e)}_publishInvalidation_(){this._invalidateListeners_.forEach(e=>e())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(e=>e())}_publishDynamicFilling_(e,t){this._fillListeners_.forEach(n=>{n[e]!==t&&(n[e]=t)}),this._publishTemplateFilling_(e,t)}_publishTemplateFilling_(e,t){this._templateFillListeners_.forEach(n=>{let r=Object.getOwnPropertyDescriptor(n,e);r&&!r.set&&!r.writable||(n.propertyMap&&n.propertyMap[e]&&(e=n.propertyMap[e]),n[e]!==void 0&&n[e]!==t&&(n[e]=t))})}onAssign(e,t=!0){typeof e==`function`&&(this._assignListeners_.has(e)||(this._assignListeners_.add(e),t&&e(this.get())))}offAssign(e){this._assignListeners_.delete(e)}onInvalidate(e){typeof e==`function`&&this._invalidateListeners_.add(e)}offInvalidate(e){typeof e==`function`&&this._invalidateListeners_.delete(e)}invalidate(){this._publishInvalidation_()}onFormInvalidate(e){typeof e==`function`&&this._formInvalidateListeners_.add(e)}offFormInvalidate(e){typeof e==`function`&&this._formInvalidateListeners_.delete(e)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(e){typeof e==`function`&&(this._mutationListeners_.add(e),e())}offInternalMutation(e){typeof e==`function`&&this._mutationListeners_.delete(e)}startTemplateFilling(e){if(this._templateFillListeners_.add(e),typeof this._value_==`object`)for(let t in this._value_){let n=t,r=this._value_[t];e.propertyMap&&e.propertyMap[t]&&(n=e.propertyMap[t]),e[t]!==void 0&&e[t]!==r&&(e[n]=r)}}stopTemplateFilling(e){this._templateFillListeners_.delete(e)}startDynamicFilling(e){this._fillListeners_.add(e);for(let t in this._value_){let n=this._value_[t];e[t]!==n&&(e[t]=n)}}stopDynamicFilling(e){this._fillListeners_.delete(e)}set(e,t=!1){if(this._value_===e||g(this._value_)&&g(e)&&e&&ne(this._value_)&&ne(e)&&this._value_.__value===e.__value||!g(e)&&e===this._value_.__value)return!0;this._value_=g(e)?e:{__value:e},this._cachedGet_=void 0;let n=ne(this._value_);if(this._parentKey_&&this.parent){let e=ne(this._value_)?this._value_.__value:this._value_;if(this.parent?.get()==null&&this.parent?.get()==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:e});else{let t=[];t[Number(this._parentKey_)]=e,this.parent.set(t)}else this.parent._value_[this._parentKey_]=e}if(n)return this._proxies_.forEach((e,t)=>{t!=`_parent_`&&(e.set(null),this._publishDynamicFilling_(t,null))}),this._publishAssignement_(t),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(let e in this._value_)this._value_[e]===void 0&&delete this._value_[e];if(this._proxies_.forEach((e,t)=>{let n=this._value_[t];t!=`_parent_`&&n===void 0&&n!==null&&isNaN(Number(t))&&(e.set(null),this._publishDynamicFilling_(t,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),g(this._value_))for(let t in this._value_){let n=e[t],r=g(n)?n:{__value:n};if(!this._proxies_.has(t)){this._publishDynamicFilling_(t,n);continue}this._proxies_.get(t)?.set(r,!0),this._publishDynamicFilling_(t,n)}return!0}get(){if(_.modifiedCollectore.length>0&&_.modifiedCollectore[0].add(this),this._cachedGet_!==void 0)return this._cachedGet_;if(Object.prototype.hasOwnProperty.call(this._value_,`__value`)){let e=this._value_.__value;return this._cachedGet_=e??null}return this._cachedGet_=this._value_==null?null:this._value_}get $tag(){return this._instanceCounter_||=(e.instancesCounter++,e.instancesCounter),e.instances.set(this._instanceCounter_,this),`<`+re+`-publisher-proxy publisher="`+this._instanceCounter_+`"></`+re+`-publisher-proxy>`}},_=class e{static{this.buildDate=`Fri Apr 24 2026 14:37:41 GMT+0200 (Central European Summer Time)`}static{this.changed=!1}static{this.saving=!1}static{this.saveId=0}static{this.instance=null}static{this.instances=new Map}constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],e.instance!=null)throw`Singleton / use getInstance`;e.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}invalidateAll(){this.publishers.forEach(e=>{e._invalidate_on_page_show_&&e.invalidate()})}async cleanStorageData(){return new Promise(e=>{(async()=>{try{let t=localStorage.getItem(ie),n=null;if(t&&(n=await this.decompress(t,`gzip`)),n)try{this.localStorageData=JSON.parse(n)}catch{this.localStorageData={}}else t=await this.compress(`{}`,`gzip`),localStorage.setItem(ie,t),this.localStorageData={};for(let e in this.localStorageData){let t=this.localStorageData[e],n=new Date().getTime()-(t.expirationDelayMs||432e5);t.lastModifiationMS<n&&delete this.localStorageData[e]}e(!0)}catch{window.requestAnimationFrame(()=>{e(!1)}),console.warn(`no publisher cache in this browser`)}})()})}static getInstance(t){return t?e.instances.get(t)||(console.warn(`No PublisherManager instance registered with id:`,t,`creating new one`),new e):e.instance==null?new e:e.instance}static registerInstance(t,n){e.instances.has(t)&&console.warn(`PublisherManager instance already registered with id: `,t),e.instances.set(t,n)}static get(t,n){return e.getInstance().get(t,n)}static{this.modifiedCollectore=[]}static collectModifiedPublisher(){e.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return e.modifiedCollectore.shift()}static delete(t){return t?e.getInstance().delete(t):!1}async setLocalData(e,t){await this.isLocalStrorageReady,e.set(this.localStorageData[t+`¤lang_`+l.getLanguage()]?.data||e.get())}get(e,t){let n=t?.localStorageMode===`enabled`,r=t?.invalidateOnPageShow===!0;if(!this.publishers.has(e)){let t=ce({});this.set(e,t)}let i=this.publishers.get(e);return n&&this.initialisedData.indexOf(e)===-1&&(t?.expirationDelayMs&&(i._expiration_delay_=t.expirationDelayMs),i._is_savable_=!0,this.initialisedData.push(e),this.setLocalData(i,e)),r&&(i._invalidate_on_page_show_=r),this.publishers.get(e)}set(e,t){this.publishers.set(e,t)}delete(e){return this.publishers.has(e)?(this.publishers.delete(e),!0):!1}async saveToLocalStorage(t=0){if(!(t!==e.saveId&&t%10!=0))try{if(!e.changed||e.saving)return;e.saving=!0,e.changed=!1;let t=Array.from(this.publishers.keys()),n=!1;for(let e of t){let t=this.publishers.get(e);if(!t?._is_savable_)continue;let r=t?.get();r&&(this.localStorageData[e+`¤lang_`+l.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:t._expiration_delay_,data:r},n=!0)}if(n){let e=await this.compress(JSON.stringify(this.localStorageData),`gzip`);localStorage.setItem(ie,e)}if(e.saving=!1,e.changed){e.saveId++;let t=e.saveId;setTimeout(()=>this.saveToLocalStorage(t),1e3)}}catch{e.saving=!1}}async compress(e,t){let n=new TextEncoder().encode(e),r=new window.CompressionStream(t),i=r.writable.getWriter();i.write(n),i.close();let a=await new Response(r.readable).arrayBuffer(),o=new Uint8Array(a),s=``;for(let e=0;e<o.length;e++)s+=String.fromCharCode(o[e]);return btoa(s)}async decompress(e,t){let n=atob(e),r=Uint8Array.from(n,e=>e.charCodeAt(0)).buffer,i=new window.DecompressionStream(t),a=i.writable.getWriter();a.write(r),a.close();let o=await new Response(i.readable).arrayBuffer();return new TextDecoder().decode(o)}};if(typeof window<`u`){let e=window;e[te+`PublisherManager`]=e[te+`PublisherManager`]||_}var oe=new Set(`invalidate.onInvalidate.offInvalidate.invalidateForm.onFormInvalidate.offFormInvalidate.onAssign.offAssign.startDynamicFilling.stopDynamicFilling.startTemplateFilling.stopTemplateFilling.onInternalMutation.offInternalMutation.set.get.$tag._cachedGet_._templateFillListeners_._fillListeners_._assignListeners_._invalidateListeners_._formInvalidateListeners_._publishInternalMutation_.hasListener.delete._mutationListeners_._publishDynamicFilling_._publishInvalidation_._publishFormInvalidation_._publishTemplateFilling_._publishAssignement_._proxies_.parent._parentKey_._value_._is_savable_._expiration_delay_._lockInternalMutationPublishing_._instanceCounter_._assignmentId_._invalidate_on_page_show_`.split(`.`));function se(e,t){return{get:function(n,r){if(typeof r==`string`&&oe.has(r))return e[r];if(r==Symbol.toPrimitive)return()=>t().get();if(!e._proxies_.has(r)){let n=e._value_[r],i=ce(g(n)?n:{__value:n},e,r);i._proxies_.set(`_parent_`,t()),e._proxies_.set(r,i)}return e._proxies_.get(r)},set:function(n,r,i){if(r==`_value_`)return e._value_=i,!0;if(r==`_cachedGet_`)return e._cachedGet_=i,!0;if(r==`_assignmentId_`)return e._assignmentId_=i,!0;if(r==`_is_savable_`)return e._is_savable_=i,!0;if(r==`_expiration_delay_`)return e._expiration_delay_=i,!0;if(r==`_invalidate_on_page_show_`)return e._invalidate_on_page_show_=i,!0;if(r==`_instanceCounter_`)return e._instanceCounter_=i,!0;if(!e._proxies_.has(r)){let n=ce({},e,r);n._proxies_.set(`_parent_`,t()),e._proxies_.set(r,n)}return e._value_[r]!==i&&(e._value_[r]=i,e._publishDynamicFilling_(r,i),e._proxies_.get(r)?.set(g(i)?i:{__value:i})),!0},deleteProperty:function(t,n){return e._publishDynamicFilling_(n,null),e._proxies_.get(n)?.set(null),delete e._value_[n]},has:function(t,n){return n in e._value_&&n!=`_lockInternalMutationPublishing_`},defineProperty:function(t,n,r){return r&&`value`in r&&(e._value_[n]=r.value),!0},getOwnPropertyDescriptor:function(e,t){return{enumerable:!0,configurable:!0}},ownKeys:function(t){return e._value_.__value?Object.keys(e._value_.__value):Object.keys(e._value_)}}}function ce(e,t=null,n){let r=new ae(e,t,n),i=null,a=se(r,()=>i);return i=new Proxy(r,a),i}var le=class extends HTMLElement{constructor(){super(),this.publisherId=``,this.onAssign=e=>{this.innerHTML=e.toString()}}connectedCallback(){this.publisherId=this.getAttribute(`publisher`)||``,this.publisher=ae.instances.get(parseInt(this.publisherId)),this.publisher?.onAssign(this.onAssign)}disconnectedCallback(){this.publisher?.offAssign(this.onAssign)}};try{customElements.define(re+`-publisher-proxy`,le)}catch{}var ue=e=>{if(typeof e==`function`){let t=e;return _.collectModifiedPublisher(),t(),_.getModifiedPublishers()}if(typeof e==`string`){let t=e.split(`.`),n=t.shift()||``,r=_.get(n);r=f.traverse(r,t);let i=new Set;return i.add(r),i}return new Set([e])},de=e=>ue(e).values().next().value?.get(),fe=e=>ue(e).values().next().value,pe=fe,me=fe,he=(e,t)=>{ue(e).values().next().value?.set(t)};window.addEventListener(`pageshow`,e=>{e.persisted&&_.getInstance().invalidateAll()});var ge=class e{static{this.observedElements=new Map}static{this.enabled=!0}static disable(){this.enabled&&(this.enabled=!1,Array.from(e.observedElements.keys()).forEach(t=>e.unObserve(t)))}static observe(t){if(!t||!e.enabled||e.observedElements.has(t))return;let n=new MutationObserver(e.onMutation),r={};r.childList=!0,r.subtree=!0,r.attributes=!0,r.attributeFilter=[`data-bind`],n.observe(t,r),t.querySelectorAll(`[data-bind]`).forEach(t=>e.addPublisherListeners(t)),e.observedElements.set(t,n)}static unObserve(t){if(!t)return;let n=this.observedElements.get(t);n&&(n.disconnect(),t.querySelectorAll(`[data-bind]`).forEach(t=>e.removePublisherListeners(t)))}static onAdded(t){t.hasAttribute&&t.hasAttribute(`data-bind`)&&e.addPublisherListeners(t),t.querySelectorAll?t.querySelectorAll(`[data-bind]`).forEach(t=>e.addPublisherListeners(t)):t.childNodes.forEach(t=>e.onAdded(t))}static onRemoved(t){t.hasAttribute&&t.hasAttribute(`data-bind`)&&e.removePublisherListeners(t),t.querySelectorAll?t.querySelectorAll(`[data-bind]`).forEach(t=>e.removePublisherListeners(t)):t.childNodes.forEach(t=>e.onRemoved(t))}static onMutation(t){for(let n of t)switch(n.type){case`attributes`:e.addPublisherListeners(n.target);break;case`childList`:n.addedNodes.forEach(t=>{e.onAdded(t)}),n.removedNodes.forEach(t=>{e.onRemoved(t)});break}}static{this.publisherListeners=new Map}static removePublisherListeners(t){let n=e.publisherListeners.get(t);n&&(e.publisherListeners.delete(t),n.forEach(e=>{e.publisher?.offAssign(e.onAssign)}))}static getVariablesDescriptor(e){let t=e.match(/(\$(?:\w+\\?\.?)+)/g);return t=t?t.map(e=>e.replace(`$`,``)):[e],t=t.filter(e=>e.length>0),{expression:e.replace(`\\`,``),variables:t.map(e=>e.split(/\b\.\b/).map(e=>e.replace(`\\`,``)))}}static getDataBindItems(t){return`attributes`in t?Array.from(t.attributes).filter(e=>e.name.indexOf(`::`)==0).map(t=>({propertyToUpdate:t.name.substring(2).replace(/-((html)|\w)/g,e=>e.substring(1).toUpperCase()),bindedVariablesDescriptor:e.getVariablesDescriptor(t.value)})):[]}static getSubPublisher(e,t){if(!t)return e;for(let n of t)if(n!=`_self_`){if(!e)return null;e=e[n]}return e}static addPublisherListeners(t){e.removePublisherListeners(t);let n=l.getAncestorAttributeValue(t.parentNode||t.host||t,`dataProvider`);if(!n)return;let r=_.getInstance().get(n),i=e.getDataBindItems(t),a=[];i.forEach(n=>{let i=n.bindedVariablesDescriptor,o=n.propertyToUpdate;for(let n of i.variables){let s=n,c=r;c=e.getSubPublisher(r,s);let l=t,u={publisher:c,onAssign:()=>{let t=i.variables.map(t=>e.getSubPublisher(r,t)?.get()),n=i.expression,a=!1;if(t.length==1&&i.variables[0].join(`.`)==n.substring(1)){let e=t[0];e===null&&(e=``),l[o]=e;return}for(let e=0;e<t.length;e++){let r=t[e],o=i.variables[e];r===null&&(a=!0,r=void 0),n=n.replace(`$`+o.join(`.`),r)}if(n.indexOf(`|`)!=-1){let e=n.indexOf(`|`);if(e==0)n=d.js(n.substring(1));else{let t=n.substring(0,e),r=n.substring(e+1),i=d[t];n=a?``:i?i(r):n}}else n=a?``:n;l[o]=n}};c?.onAssign(u.onAssign),a.push(u)}}),e.publisherListeners.set(t,a)}};ge.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=ge);var v=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer((()=>{customElements.define(e,t)}))},_e=globalThis,ve=_e.ShadowRoot&&(_e.ShadyCSS===void 0||_e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,ye=Symbol(),be=new WeakMap,xe=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ye)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(ve&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=be.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&be.set(t,e))}return e}toString(){return this.cssText}},Se=e=>new xe(typeof e==`string`?e:e+``,void 0,ye),y=(e,...t)=>new xe(e.length===1?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1]),e[0]),e,ye),Ce=(e,t)=>{if(ve)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let n of t){let t=document.createElement(`style`),r=_e.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},we=ve?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return Se(t)})(e):e,{is:Te,defineProperty:Ee,getOwnPropertyDescriptor:De,getOwnPropertyNames:Oe,getOwnPropertySymbols:ke,getPrototypeOf:Ae}=Object,je=globalThis,Me=je.trustedTypes,Ne=Me?Me.emptyScript:``,Pe=je.reactiveElementPolyfillSupport,Fe=(e,t)=>e,Ie={toAttribute(e,t){switch(t){case Boolean:e=e?Ne:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},Le=(e,t)=>!Te(e,t),Re={attribute:!0,type:String,converter:Ie,reflect:!1,useDefault:!1,hasChanged:Le};Symbol.metadata??=Symbol(`metadata`),je.litPropertyMetadata??=new WeakMap;var ze=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Re){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Ee(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=De(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Re}static _$Ei(){if(this.hasOwnProperty(Fe(`elementProperties`)))return;let e=Ae(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Fe(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fe(`properties`))){let e=this.properties,t=[...Oe(e),...ke(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(we(e))}else e!==void 0&&t.push(we(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ce(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?Ie:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?Ie:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let r=this.constructor,i=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??Le)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};ze.elementStyles=[],ze.shadowRootOptions={mode:`open`},ze[Fe(`elementProperties`)]=new Map,ze[Fe(`finalized`)]=new Map,Pe?.({ReactiveElement:ze}),(je.reactiveElementVersions??=[]).push(`2.1.1`);var Be={attribute:!0,type:String,converter:Ie,reflect:!1,hasChanged:Le},Ve=(e=Be,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e)}}throw Error(`Unsupported decorator location: `+r)};function b(e){return(t,n)=>typeof n==`object`?Ve(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function x(e){return b({...e,state:!0,attribute:!1})}var He=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function Ue(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return He(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return He(n,r,{get(){return a(this)}})}}function We(e){return(t,n)=>{let{slot:r,selector:i}=e??{},a=`slot`+(r?`[name=${r}]`:`:not([name])`);return He(t,n,{get(){let t=(this.renderRoot?.querySelector(a))?.assignedElements(e)??[];return i===void 0?t:t.filter((e=>e.matches(i)))}})}}function S(e){return(t,n)=>{let{slot:r}=e??{},i=`slot`+(r?`[name=${r}]`:`:not([name])`);return He(t,n,{get(){return(this.renderRoot?.querySelector(i))?.assignedNodes(e)??[]}})}}var Ge=globalThis,Ke=Ge.trustedTypes,qe=Ke?Ke.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,Je=`$lit$`,Ye=`lit$${Math.random().toFixed(9).slice(2)}$`,Xe=`?`+Ye,Ze=`<${Xe}>`,Qe=document,$e=()=>Qe.createComment(``),et=e=>e===null||typeof e!=`object`&&typeof e!=`function`,tt=Array.isArray,nt=e=>tt(e)||typeof e?.[Symbol.iterator]==`function`,rt=`[
|
|
2
|
+
\f\r]`,it=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,at=/-->/g,ot=/>/g,st=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ct=/'/g,lt=/"/g,ut=/^(?:script|style|textarea|title)$/i,C=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),w=Symbol.for(`lit-noChange`),T=Symbol.for(`lit-nothing`),dt=new WeakMap,ft=Qe.createTreeWalker(Qe,129);function pt(e,t){if(!tt(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return qe===void 0?t:qe.createHTML(t)}var mt=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=it;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===it?c[1]===`!--`?o=at:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=st):(ut.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=st):o=ot:o===st?c[0]===`>`?(o=i??it,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?st:c[3]===`"`?lt:ct):o===lt||o===ct?o=st:o===at||o===ot?o=it:(o=st,i=void 0);let d=o===st&&e[t+1].startsWith(`/>`)?` `:``;a+=o===it?n+Ze:l>=0?(r.push(s),n.slice(0,l)+Je+n.slice(l)+Ye+d):n+Ye+(l===-2?t:d)}return[pt(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},ht=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=mt(t,n);if(this.el=e.createElement(l,r),ft.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=ft.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(Je)){let t=u[o++],n=i.getAttribute(e).split(Ye),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?bt:r[1]===`?`?xt:r[1]===`@`?St:yt}),i.removeAttribute(e)}else e.startsWith(Ye)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(ut.test(i.tagName)){let e=i.textContent.split(Ye),t=e.length-1;if(t>0){i.textContent=Ke?Ke.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],$e()),ft.nextNode(),c.push({type:2,index:++a});i.append(e[t],$e())}}}else if(i.nodeType===8)if(i.data===Xe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(Ye,e+1))!==-1;)c.push({type:7,index:a}),e+=Ye.length-1}a++}}static createElement(e,t){let n=Qe.createElement(`template`);return n.innerHTML=e,n}};function gt(e,t,n=e,r){if(t===w)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=et(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=gt(e,i._$AS(e,t.values),i,r)),t}var _t=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??Qe).importNode(t,!0);ft.currentNode=r;let i=ft.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new vt(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Ct(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=ft.nextNode(),a++)}return ft.currentNode=Qe,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},vt=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=gt(this,e,t),et(e)?e===T||e==null||e===``?(this._$AH!==T&&this._$AR(),this._$AH=T):e!==this._$AH&&e!==w&&this._(e):e._$litType$===void 0?e.nodeType===void 0?nt(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==T&&et(this._$AH)?this._$AA.nextSibling.data=e:this.T(Qe.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=ht.createElement(pt(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new _t(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=dt.get(e.strings);return t===void 0&&dt.set(e.strings,t=new ht(e)),t}k(t){tt(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O($e()),this.O($e()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},yt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=T,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=T}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=gt(this,e,t,0),a=!et(e)||e!==this._$AH&&e!==w,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=gt(this,r[n+o],t,o),s===w&&(s=this._$AH[o]),a||=!et(s)||s!==this._$AH[o],s===T?e=T:e!==T&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},bt=class extends yt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===T?void 0:e}},xt=class extends yt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==T)}},St=class extends yt{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=gt(this,e,t,0)??T)===w)return;let n=this._$AH,r=e===T&&n!==T||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==T&&(n===T||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Ct=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){gt(this,e)}},wt={M:Je,P:Ye,A:Xe,C:1,L:mt,R:_t,D:nt,V:gt,I:vt,H:yt,N:xt,U:St,B:bt,F:Ct},Tt=Ge.litHtmlPolyfillSupport;Tt?.(ht,vt),(Ge.litHtmlVersions??=[]).push(`3.3.1`);var Et=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new vt(t.insertBefore($e(),e),e,void 0,n??{})}return i._$AI(e),i},{I:Dt}=wt,Ot=e=>e.strings===void 0,kt=()=>document.createComment(``),At=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new Dt(r.insertBefore(kt(),i),r.insertBefore(kt(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=e.nextSibling;r.insertBefore(e,i),e=t}}}return n},jt=(e,t,n=e)=>(e._$AI(t,n),e),Mt={},Nt=(e,t=Mt)=>e._$AH=t,Pt=e=>e._$AH,Ft=e=>{e._$AR(),e._$AA.remove()},It={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Lt=e=>(...t)=>({_$litDirective$:e,values:t}),Rt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},zt=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let e of n)e._$AO?.(t,!1),zt(e,t);return!0},Bt=e=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},Vt=e=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Wt(t)}};function Ht(e){this._$AN===void 0?this._$AM=e:(Bt(this),this._$AM=e,Vt(this))}function Ut(e,t=!1,n=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let e=n;e<r.length;e++)zt(r[e],!1),Bt(r[e]);else r!=null&&(zt(r,!1),Bt(r));else zt(this,e)}var Wt=e=>{e.type==It.CHILD&&(e._$AP??=Ut,e._$AQ??=Ht)},Gt=class extends Rt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),Vt(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(zt(this,e),Bt(this))}setValue(e){if(Ot(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}},Kt=globalThis,E=class extends ze{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Et(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};E._$litElement$=!0,E.finalized=!0,Kt.litElementHydrateSupport?.({LitElement:E});var qt=Kt.litElementPolyfillSupport;qt?.({LitElement:E}),(Kt.litElementVersions??=[]).push(`4.2.1`);function Jt(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t._sonic_http_response_,t}var Yt=class e{static{this.loadingGetPromises=new Map}set token(t){if(this._token=t,!t){e.tokens.delete(this.serviceURL);return}e.invalidTokens.includes(t)||e.tokens.set(this.serviceURL,t)}get token(){return e.invalidTokens.includes(this._token)?e.tokens.get(this.serviceURL):this._token}static{this.tokens=new Map}static{this.invalidTokens=[]}handleInvalidToken(t){t&&(e.invalidTokens.includes(t)||(e.invalidTokens.push(t),this.token=null))}static{this.failledTokenUpdates=new Map}static{this.firstCallDoneFlags=new Map}constructor(e){this.addHTTPResponse=!1,this.cache=`default`,this.isServiceSimulated=!1,this.blockUntilDone=!1,this.keepAlive=!1,this.serviceURL=e.serviceURL,this.blockUntilDone=e.blockUntilDone||!1,this.serviceURL==`publisher://`&&(this.isServiceSimulated=!0),this.serviceURL||=document.location.origin,this.userName=e.userName,this.password=e.password,e.token&&(this.token=e.token),this.tokenProvider=e.tokenProvider,this.authToken=e.authToken,this.addHTTPResponse=e.addHTTPResponse||!1,this.credentials=e.credentials,this.cache=e.cache||`default`,this.keepAlive=e.keepAlive||!1}async handleResult(t,n){e.firstCallDoneFlags.set(this.serviceURL,`done`),this.lastResult=t;let r=t.headers.get(`content-type`)?.toLowerCase(),i=t.status,a={};if(!r||r.indexOf(`text/`)==0)a={text:await t.text()};else try{a=await t.json()}catch{a={}}return this.addHTTPResponse&&f.isObject(a)&&(a._sonic_http_response_=t),i===498&&!e.failledTokenUpdates.has(this.serviceURL)&&(this.handleInvalidToken(this.token),a=n.apiMethod===`get`?await this[n.apiMethod](n.path,n.additionalHeaders):await this[n.apiMethod](n.path,n.data,n.method,n.additionalHeaders)),me(`sonic-api`).lastResponse.set({http:t,processed:a}),a}async auth(){if(this.token)return;if(e.tokens.has(this.serviceURL)){this.token=e.tokens.get(this.serviceURL);return}if(!this.tokenProvider)return;let t={};this.userName&&this.password?t={Authorization:`Basic `+window.btoa(unescape(encodeURIComponent(this.userName+`:`+this.password)))}:this.authToken&&(t={Authorization:`Bearer `+this.authToken});let n=new URL(this.serviceURL),r=n.protocol+`//`+n.host,i=await fetch(this.computeURL(this.tokenProvider,{serviceHost:r}),{headers:t,credentials:this.credentials,keepalive:this.keepAlive});try{let t=await i.json();t.token?this.token=t.token:e.failledTokenUpdates.set(this.serviceURL,!0)}catch{e.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(e,t){let n=_.get(e),r=new URLSearchParams(t.split(`?`)[1]||``),i=n.get(),a=[];a=Array.isArray(i)?i:[i];let o=[],s=1/0,c=0,l=0;if(r.has(`limit`)&&(s=parseInt(r.get(`limit`)||`0`),l++),r.has(`offset`)&&(c=parseInt(r.get(`offset`)||`0`),l++),l>0&&(r.delete(`limit`),r.delete(`offset`)),r.size===0)return a.slice(c,c+s);for(let[e,t]of r.entries()){let n=t.split(`,`).map(e=>e.trim());for(let r of n)for(let n of a)if(typeof n!=`object`)isNaN(+n)?n.toString().toLowerCase().includes(t.toLowerCase())&&o.push(n):n===t&&o.push(n);else{let t=n;if(!t[e])continue;isNaN(+t[e])?t[e]?.toString().toLowerCase().includes(r.toLowerCase())&&o.push(n):t[e]===r&&o.push(n)}}return o.slice(c,c+s)}firstCallDone(){return new Promise(t=>{if(!e.firstCallDoneFlags.has(this.serviceURL))e.firstCallDoneFlags.set(this.serviceURL,`loading`),t(!0);else{let n=()=>{[void 0,`loading`].includes(e.firstCallDoneFlags.get(this.serviceURL))?window.requestAnimationFrame(n):t(!0)};n()}})}async get(t,n){await this.firstCallDone(),this.blockUntilDone&&e.firstCallDoneFlags.set(this.serviceURL,`loading`);let r=/dataProvider\((.*?)\)(.*?)$/;if(r.test(t)){let e=t.match(r);if(!e)throw Error(`dataProvider path is not valid`);return await this.localGet(e[1],e[2])}let i={apiMethod:`get`,path:t,additionalHeaders:n},a=await this.createHeaders(n),o=this.computeURL(t),s=JSON.stringify({url:o,headers:a});if(!e.loadingGetPromises.has(s)){let t=new Promise(async e=>{try{let t=await fetch(o,{headers:a,credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive});e(await this.handleResult(t,i))}catch{e(null)}});e.loadingGetPromises.set(s,t)}let c=await e.loadingGetPromises.get(s);return e.loadingGetPromises.delete(s),c}async getDetailed(e,t){let n=/dataProvider\((.*?)\)(.*?)$/.test(e),r=await this.get(e,t);if(r==null)return;let i=Jt(r),a=this.computeURL(e);if(n)return{request:new Request(a,{method:`GET`}),result:i};let o=await this.createHeaders(t);return{request:new Request(a,{method:`GET`,headers:new Headers(o),credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),response:this.lastResult,result:i}}async createHeaders(e){await this.auth();let t={};return this.token&&(t.Authorization=`Bearer `+this.token),t[`Accept-Language`]=l.getLanguage(),e&&Object.assign(t,e),t}computeURL(e,t={}){let n=``;n=e.startsWith(`http`)?e:this.serviceURL+`/`+e,n.startsWith(`http`)||(n=window.location.origin+n);let r=new URL(n);for(let e in t)r.searchParams.set(e,t[e]);return r.toString().replace(/([^(https?:)])\/{2,}/g,`$1/`)}async send(e,t,n=`POST`,r){let i={apiMethod:`send`,path:e,additionalHeaders:r,method:n,data:t},a=await this.createHeaders(r);a.Accept=`application/json`,a[`Content-Type`]=`application/json`;let o=await fetch(this.computeURL(e),{headers:a,credentials:this.credentials,method:n,body:JSON.stringify(t),keepalive:this.keepAlive});return await this.handleResult(o,i)}async submitFormData(e,t,n=`POST`,r){let i={apiMethod:`submitFormData`,path:e,additionalHeaders:r,method:n,data:t},a=await this.createHeaders(r);a.Accept=`application/json`;let o=new FormData,s=t;for(let e in s)o.set(e,s[e]);let c=await fetch(this.computeURL(e),{headers:a,credentials:this.credentials,method:n,body:o,keepalive:this.keepAlive});return await this.handleResult(c,i)}async put(e,t,n){return this.send(e,t,`PUT`,n)}async post(e,t,n){return this.send(e,t,`POST`,n)}async patch(e,t,n){return this.send(e,t,`PATCH`,n)}async delete(e,t,n){return this.send(e,t,`delete`,n)}},Xt=!1,Zt=`log`,Qt=l.getApiConfiguration(document.body||document.documentElement),$t=[],en=0,tn=async(e,t)=>{if(!Xt)return;$t.push({message:e,variables:t||{}}),en++;let n=en;window.queueMicrotask(()=>{if(n!==en)return;let e=[...$t];return $t=[],new Yt(Qt).post(Zt,{logs:e})})},nn=class extends Rt{constructor(e){if(super(e),this.it=T,e.type!==It.CHILD)throw Error(this.constructor.directiveName+`() can only be used in child bindings`)}render(e){if(e===T||e==null)return this._t=void 0,this.it=e;if(e===w)return e;if(typeof e!=`string`)throw Error(this.constructor.directiveName+`() called with a non-string value`);if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};nn.directiveName=`unsafeHTML`,nn.resultType=1;var D=Lt(nn),rn=new Map,an=e=>{if(!e)return null;let t=l.getApiConfiguration(e),n=l.getAncestorAttributeValue(e,`wordingProvider`),r=l.getAncestorAttributeValue(e,`wordingVersionProvider`),i={apiConfiguration:t,wordingProvider:n,wordingVersionProvider:r},a=null;for(let[e,t]of rn)if(f.deepEqual(e,i)){a=t;break}return a||(a={api:new Yt(t),keysToTranslate:new Set,translatedKeys:new Set,wordingProvider:n,callIndex:0,wordingVersionProvider:r,apiCallKey:i},rn.set(i,a)),a},on=class e extends Gt{static{this.publisher=_.get(`sonic-wording`,{localStorageMode:`enabled`})}unsubscribe(){e.publisher[`wording_`+this.key].offAssign(this.onAssign)}constructor(e){super(e),this.useUnsafeHTML=!1,this.onAssign=e=>{let t=this.useUnsafeHTML?D(e):e;this.setValue(t)},this.node=e.options.host}render(e,t=!1){return this.useUnsafeHTML=t,this.key!==e&&(this.key=e,this.isConnected&&this.subscribe(e)),w}static{this.firstCall=!0}static async callApi(t,n,r=!0,i){if(await _.getInstance().isLocalStrorageReady,e.firstCall){e.firstCall=!1,u(e.reloadWordings);let t=Object.keys(e.publisher.get());for(let n of t)e.publisher.get()[n]===``&&delete e.publisher[n]}if(t){let n=l.getAncestorAttributeValue(t,`wordingVersionProvider`);n&&me(n).onAssign(e.handleVersionProvider(t))}let a=e.publisher.get()[`wording_`+n]!=null,o=i||an(t);if(!o)return;if(a&&n!==``){o.translatedKeys.add(n);return}o.callIndex++;let s=o.callIndex,c=o.wordingProvider??``;if(!c&&r){window.setTimeout(async()=>{e.callApi(null,n,!1,o)},1e3);return}let d=o.api;window.queueMicrotask(async()=>{if(a=e.publisher[`wording_`+n].get()!=null,!a&&n!==``&&(o.keysToTranslate.add(n),e.publisher[`wording_`+n].set(``)),s!==o.callIndex)return;let t=Array.from(o.keysToTranslate);if(!t.length)return;let r=c.split(`?`),i=r.shift(),l=(r.length>0?r.join(`?`)+`&`:``)+`labels[]=`+t.join(`&labels[]=`),u=i+`?`+l;o.translatedKeys=new Set([...o.translatedKeys,...o.keysToTranslate]),o.keysToTranslate.clear();let f=await d.get(u);for(let t in f)e.publisher[`wording_`+t].set(f[t])})}static reloadWordings(){for(let t of rn.values())t.keysToTranslate=new Set(t.translatedKeys),t.keysToTranslate.size>0&&e.callApi(null,``,!1,t)}static{this.versionProviderHandlers=new Map}static handleVersionProvider(t){let n=an(t),r=e=>{};if(!n)return r;if(e.versionProviderHandlers.has(n))return e.versionProviderHandlers.get(n)||r;let i=function(t){if(!n.wordingVersionProvider)return;let r=e.publisher.get().__wording_versions__??[];if(t==null)return;let i=r.find(e=>e.serviceURL===n.api.serviceURL)||{serviceURL:n.api.serviceURL,version:0};r.includes(i)||r.push(i),t!==i.version&&(i.version=t,e.publisher.set({__wording_versions__:r}),e.reloadWordings())};return e.versionProviderHandlers.set(n,i),i}subscribe(t){this.unsubscribe(),e.publisher[`wording_`+t].onAssign(this.onAssign),e.callApi(this.node,t)}disconnected(){this.unsubscribe()}reconnected(){this.key&&this.subscribe(this.key)}},sn=Lt(on);function O(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var cn=!1,ln=new Set,k=(e,t)=>{class n extends e{static{this.instanceCounter=0}constructor(...e){super(),this.collectDependenciesVersion=0,this.displayContents=!1,this.noAutoFill=!1,this.forceAutoFill=!1,this.renderOnPropsInternalChange=!1,this.noShadowDom=null,this.propertyMap=null,this.title=``,this.dataProvider=null,this.bindPublisher=null,this._props=null,this.shouldRenderLazy=!0,this.defferedDebug=null,this.debug=null,this.onAssign=e=>{this.props=e}}hasAncestorAttribute(e){return this.getAncestorAttributeValue(e)!=null}getAncestorAttributeValue(e){return l.getAncestorAttributeValue(this,e)}get props(){return this._props!==null||!this.publisher?this._props:this.publisher.get()}set props(e){typeof e==`string`&&[`{`,`[`].includes(e.trim().charAt(0))&&(e=JSON.parse(e)),e!=this._props&&(this._props=e,this.publisher&&this.publisher.get()!=e&&this.publisher.set(e),this.requestUpdate())}updated(e){super.updated(e);let t=[...(this.shadowRoot||this).children].filter(e=>e.tagName!=`STYLE`),n=this.displayContents?`contents`:t.length==0?`none`:null;n?this.style.display=n:this.style.removeProperty(`display`)}connectedCallback(){if(n.instanceCounter++,this.hasAttribute(`lazyRendering`)){let e={root:null,threshold:.9},t=!0,n=new IntersectionObserver(e=>{for(let r of e)if(t&&r.isIntersecting){t=!1,n.disconnect(),this.initWording(),this.shouldRenderLazy=!1,this.startPublisher();break}},e);n.observe(this)}else this.initWording(),this.shouldRenderLazy=!1;this.initPublisher(),this.addDebugger(),super.connectedCallback()}disconnectedCallback(){this.removeDebugger(),super.disconnectedCallback(),this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate)),on.publisher.stopTemplateFilling(this),this.onAssign&&this.publisher?.offAssign(this.onAssign)}addDebugger(){if(this.hasAttribute(`debug`)&&!this.defferedDebug){if(!this.debug){this.debug=document.createElement(`div`);let e=this.debug.style;e.position=`fixed`,e.top=`0`,e.right=`0`,e.margin=`auto`,e.borderRadius=`.7rem`,e.backgroundColor=`#0f1729`,e.color=`#c5d4f9`,e.padding=`16px 16px`,e.margin=`16px 16px`,e.boxShadow=`0 10px 30px -18px rgba(0,0,0,.3)`,e.overflowY=`auto`,e.zIndex=`99999999`,e.maxHeight=`calc(100vh - 32px)`,e.fontFamily=`Consolas, monospace`,e.maxWidth=`min(50vw,25rem)`,e.fontSize=`12px`,e.minWidth=`300px`,e.overflowWrap=`break-word`,e.resize=`vertical`}this.addEventListener(`click`,e=>{e.ctrlKey&&(e.preventDefault(),cn=!cn)}),this.dataProvider&&(window[this.dataProvider]=this.publisher),this.addEventListener(`mouseover`,()=>{cn||this.removeDebugger(),document.body.appendChild(this.debug),ln.add(this.debug)}),this.addEventListener(`mouseout`,()=>{cn||this.removeDebugger()}),this.publisher?.onInternalMutation(()=>{this.debug.innerHTML=`🤖 DataProvider : "<b style="font-weight:bold;color:#fff;">${this.dataProvider}</b>"<br>
|
|
64
3
|
<div style="font-size:10px;border-top:1px dashed;margin-top:5px;padding-left:23px;opacity:.6;padding-top:5px;">
|
|
65
4
|
Variable disponible dans la console<br>
|
|
66
5
|
ctrl + Clique : épingler / désépingler
|
|
67
6
|
</div>
|
|
68
|
-
<pre style="margin-top:10px;background:transparent;padding:0;font-size:inherit;color:inherit;">${JSON.stringify(this.publisher?.get(),null," ")}</pre>`})}}removeDebugger(){ii.forEach(n=>{document.body.contains(n)&&document.body.removeChild(n)}),ii=new Set}getApiConfiguration(){return H.getApiConfiguration(this)}async initWording(){const n=Object.getOwnPropertyNames(this.constructor.prototype);for(const l of n)l.indexOf("wording_")==0&&ke.callApi(this,l.substring(8));ke.publisher.startTemplateFilling(this)}createRenderRoot(){if(this.noShadowDom===""||this.getAttribute("noShadowDom")==="")return this;const n=super.createRenderRoot();return fs.observe(n),n}initPublisher(){if(!document)return;this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate),this.onAssign&&this.publisher.offAssign(this.onAssign));const n=k.getInstance();this.dataProvider||(this.dataProvider=this.getAncestorAttributeValue("dataProvider"));let l=this.dataProvider;if(!l&&this._props&&(this.dataProvider=l="__subscriber__"+e.instanceCounter),l){this.bindPublisher&&n.set(l,this.bindPublisher());let c=n.get(l,{localStorageMode:this.getAttribute("localStorage")||"disabled",invalidateOnPageShow:this.hasAttribute("invalidateOnPageShow")});if(this.dataProvider=l,this.hasAttribute("subDataProvider")){const h=this.getAttribute("subDataProvider");this.dataProvider=l+"/"+h,c=tt.traverse(c,h.split(".")),n.set(this.dataProvider,c),this.publisher=c}this.publisher=c}this.hasAttribute("lazyRendering")||this.startPublisher()}startPublisher(){this.publisher&&(this._props&&this.publisher.set(this._props),this.noAutoFill||this.publisher.startTemplateFilling(this),this.renderOnPropsInternalChange&&this.publisher.onInternalMutation(this.requestUpdate),this.publisher.onAssign(this.onAssign))}},e.instanceCounter=0,e);return kt([a({type:Number})],i.prototype,"collectDependenciesVersion",2),kt([a({type:Boolean})],i.prototype,"displayContents",2),kt([a({type:Boolean})],i.prototype,"noAutoFill",2),kt([a({type:Boolean})],i.prototype,"forceAutoFill",2),kt([a({type:Object})],i.prototype,"propertyMap",2),kt([a({type:String,attribute:"data-title"})],i.prototype,"title",2),kt([a({reflect:!0})],i.prototype,"dataProvider",2),kt([a()],i.prototype,"bindPublisher",2),kt([a()],i.prototype,"props",1),kt([E()],i.prototype,"shouldRenderLazy",2),i};var Mo=Object.defineProperty,jo=(r,t,i,s)=>{for(var e=void 0,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=n(t,i,e)||e);return e&&Mo(t,i,e),e};const qe=r=>{class t extends r{constructor(){super(...arguments),this.templates=null,this.templateValueAttribute="data-value",this.templateList=[],this.templateParts={},this.templatePartsList=[]}connectedCallback(){const s=this.templates||[...this.querySelectorAll("template")];for(const e of s)e.hasAttribute(this.templateValueAttribute)&&(this.templateParts[e.getAttribute(this.templateValueAttribute)]=e,this.templatePartsList.push(e)),e.hasAttribute("skeleton")&&(this.templateParts.skeleton=e),e.hasAttribute("no-result")&&(this.templateParts["no-result"]=e),e.hasAttribute("no-item")&&(this.templateParts["no-item"]=e);this.templateList=s.filter(e=>!e.getAttribute("data-value")),this.templateList.length==0&&(this.templateList=s),super.connectedCallback()}}return jo([a({type:Array})],t.prototype,"templates"),t};var Fo=Object.defineProperty,zo=Object.getOwnPropertyDescriptor,W=(r,t,i,s)=>{for(var e=s>1?void 0:s?zo(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&Fo(t,i,e),e};const Ro="sonic-date";Us(()=>z.updateComponentsLanguage());let z=class extends X(qe(w)){constructor(){super(...arguments),this.pageLanguage="fr",this.duAu=[],this._wording_billet_periode_validite="",this.designMode=null,this.time_zone=null,this.date=null,this.date_string=null,this.start_date_string=null,this.end_date_string=null,this.start_date=0,this.computedStartDate=0,this.end_date=0,this.computedEndDate=0,this.hide_hours=!1,this.era="",this.year="numeric",this.month="short",this.day="2-digit",this.weekday="short",this.hour="2-digit",this.hour12=!1,this.minute="2-digit",this.language="",this.renderIf=!0,this.now=!1,this.startDateObject=new Date,this.endDateObject=new Date}static updateComponentsLanguage(){z.dateCompnents.forEach(r=>r.pageLanguage=H.getLanguage())}get wording_billet_periode_validite(){return this._wording_billet_periode_validite}set wording_billet_periode_validite(r){r||(r="Du %s au %s"),this._wording_billet_periode_validite=r,this.duAu=this.wording_billet_periode_validite?.split("%s").map(t=>t.trim()),this.duAu.pop(),this.requestUpdate()}connectedCallback(){this.hasAttribute("wording_billet_periode_validite")||(this.wording_billet_periode_validite="Du %s au %s"),this.pageLanguage=H.getLanguage(),z.dateCompnents.add(this),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),z.dateCompnents.delete(this)}getDatesParts(r,t,i){const s=this.startDateObject;s.setTime(r*1e3);let e=[];if(t>0){const o=this.endDateObject;o.setTime(t*1e3);const n=s.toDateString()==o.toDateString();if((!n||this.hide_hours)&&(delete i.hour,delete i.minute),e=new Intl.DateTimeFormat(this.language||this.pageLanguage,i).formatRangeToParts(s,o),!n){const c=e.find(h=>h.type=="literal"&&h.source=="shared"&&h.value.trim().length>0);c&&(c.value=" "+this.duAu[1]+" ",c.type="to"),this.designMode||e.unshift({type:"from",value:this.duAu[0]+" ",source:"shared"})}}else e=new Intl.DateTimeFormat(this.language||this.pageLanguage,i).formatToParts(s);return this.designMode&&e.forEach(o=>o.value=o.value.replace(/,/g," ")),e[0].value=cs.ucFirst(e[0].value),e.filter(o=>o.hidden!==!0)}dateStringToSeconds(r){return new Date(r).getTime()/1e3}willUpdate(r){if(this.computedStartDate=0,this.computedEndDate=0,this.date_string&&(this.date=this.dateStringToSeconds(this.date_string)),this.date&&(this.computedStartDate=this.date),this.start_date_string&&(this.computedStartDate=this.dateStringToSeconds(this.start_date_string)),this.end_date_string&&(this.end_date=this.dateStringToSeconds(this.end_date_string)),this.start_date&&(this.computedStartDate=this.start_date),!(!this.computedStartDate&&!this.now&&!this.end_date)&&(this.computedStartDate||(this.computedStartDate=Date.now()/1e3),this.end_date&&(this.computedEndDate=this.end_date),this.computedEndDate>0&&this.computedEndDate<this.computedStartDate)){const t=this.computedStartDate;this.computedStartDate=this.computedEndDate,this.computedEndDate=t}}render(){if(!this.renderIf||!this.computedStartDate&&!this.now&&!this.computedEndDate)return S;const r={year:this.year||"numeric",month:this.month||"short",day:this.day||"2-digit",hour12:this.hour12||!1};this.weekday!=="hidden"&&(r.weekday=this.weekday||"short"),this.hour!=="hidden"&&(r.hour=this.hour||"2-digit"),this.minute!=="hidden"&&(r.minute=this.minute||"2-digit"),this.era&&(r.era=this.era),this.time_zone&&(r.timeZone=this.time_zone);const t=this.getDatesParts(this.computedStartDate,this.computedEndDate,r);return F(`${t.map(i=>{const s=this.templateParts[i.type];if(s){const n=document.importNode(s.content,!0).children[0];return n.innerText.trim()==""&&(n.innerText=i.value),n.outerHTML}const e=document.createElement("span");return e.innerText=i.value,e.className=i.type,`<span class="${i.type}">${i.value}</span>`}).join("")}`)}};z.dateCompnents=new Set,W([a()],z.prototype,"wording_billet_periode_validite",1),W([a({type:Boolean})],z.prototype,"designMode",2),W([a({type:String})],z.prototype,"time_zone",2),W([a({type:Number})],z.prototype,"date",2),W([a({type:String})],z.prototype,"date_string",2),W([a({type:String})],z.prototype,"start_date_string",2),W([a({type:String})],z.prototype,"end_date_string",2),W([a({type:Number})],z.prototype,"start_date",2),W([a({type:Number})],z.prototype,"end_date",2),W([a({type:Boolean})],z.prototype,"hide_hours",2),W([a({type:String})],z.prototype,"era",2),W([a({type:String})],z.prototype,"year",2),W([a({type:String})],z.prototype,"month",2),W([a({type:String})],z.prototype,"day",2),W([a({type:String})],z.prototype,"weekday",2),W([a({type:String})],z.prototype,"hour",2),W([a({type:Boolean})],z.prototype,"hour12",2),W([a({type:String})],z.prototype,"minute",2),W([a({type:String})],z.prototype,"language",2),W([a({type:Boolean})],z.prototype,"renderIf",2),W([a({type:Boolean})],z.prototype,"now",2),z=W([x(Ro)],z);let et=(Z=class{static listen(){if(!Z.listening)return;const t=document.location?.href.replace(document.location.origin,"");Z.prevURL&&Z.prevURL!=t&&(Z.prevURL=t,Z.listeners.forEach(i=>{i.location=t})),window.requestAnimationFrame(Z.listen)}static offChange(t){const i=Z.listeners.indexOf(t);i!=-1&&(Z.listeners.splice(i,1),Z.listeners.length==0&&(Z.listening=!1))}static onChange(t){Z.listening||(Z.listening=!0,Z.listen()),Z.listeners.push(t),t.location=this.prevURL}static changeFromComponent(t){const i=t.goBack,s=document.referrer;if(i!=null){const h=document.location.origin,u=(i||h).toString(),g=s.indexOf("http")==0?new URL(s).origin!=h:!1,m=s=="",v=history.length<3,y=m&&v,$=u!=document.location.href;if(g&&$||y){const p=history.state||{};p.concorde=p.concorde||{},p.concorde.hasDoneHistoryBack=!0,history.pushState(p,document.title),history.back(),document.location.replace(u)}else history.back();return}let e=t.getAttribute("to")||"";if(e||(e=t.href?.toString()||""),!e)return;if(e.indexOf("#")==0){document.location.hash=e.substring(1);return}const o=new URL(e,document.location.href),n=o.pathname.split("/"),l=[];let c="";for(const h of n)h!=c&&l.push(h),c=h;e="/"+l.join("/")+o.search+(o.hash?+o.hash:""),t.hasAttribute("pushState")?history.pushState(null,"",e):t.hasAttribute("replaceState")?history.replaceState(null,"",e):document.location.href=e}static updateComponentActiveState(t){if(t.autoActive=="disabled")return;const i=t.href?.toString()||"";if(t.href&&i.indexOf("http")!=0){const s=new URL(i,document.location.href),e=new URL(t.location||"",document.location.origin);let o=!1;t.autoActive=="strict"?o=s.pathname==e.pathname&&s.hash==e.hash&&s.search==e.search:t.autoActive=="strict-path-only"?o=s.pathname==e.pathname&&s.hash==e.hash:o=e.href.indexOf(s.href)==0,o?t.setAttribute("active","true"):t.removeAttribute("active")}}},Z.listeners=[],Z.listening=!1,Z.prevURL=document.location?.href.replace(document.location.origin,""),Z);/**
|
|
69
|
-
* @license
|
|
70
|
-
* Copyright 2018 Google LLC
|
|
71
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
72
|
-
*/const or="important",Uo=" !"+or,pt=Zt(class extends Se{constructor(r){if(super(r),r.type!==he.ATTRIBUTE||r.name!=="style"||r.strings?.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,i)=>{const s=r[i];return s==null?t:t+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(r,[t]){const{style:i}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?i.removeProperty(s):i[s]=null);for(const s in t){const e=t[s];if(e!=null){this.ft.add(s);const o=typeof e=="string"&&e.endsWith(Uo);s.includes("-")||o?i.setProperty(s,o?e.slice(0,-11):e,o?or:""):i[s]=e}}return vt}});var Vo=Object.defineProperty,Bo=Object.getOwnPropertyDescriptor,Ot=(r,t,i,s)=>{for(var e=s>1?void 0:s?Bo(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&Vo(t,i,e),e};const xs=new Map,Oe=r=>{class t extends r{constructor(...s){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=!1,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(s){this.hasAttribute("name")&&!this.forceAutoFill&&(s=this.getAttribute("name")),this._name=s,this.requestUpdate()}validateFormElement(){}unsetOnDisconnect(){return this.hasAttribute("unsetOnDisconnect")}updateDataValue(){this.getAttribute("name")&&this.getFormPublisher()&&(this.setFormPublisherValue(this.getValueForFormPublisher()),this.setFormValueFromPublisher(this.getFormPublisherValue()))}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?k.get(this.formDataProvider):null}setFormPublisherValue(s){const e=this.getFormPublisher();e&&ut(e,this.name).set(s)}getFormPublisherValue(){const s=this.getFormPublisher();return s?ut(s,this.name).get():null}getValueForFormPublisher(){return this.value}setValueFromPublisher(s){this.value=s}setFormValueFromPublisher(s){this.value=s}get value(){return this._value}set value(s){s==null&&(s=""),tt.isObject(s)&&Object.prototype.hasOwnProperty.call(s,"__value")&&s._value==null&&(s=""),this._value!=s&&(this._value=s,this.updateDataValue(),this.requestUpdate())}initPublisher(){let s=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&this.getFormPublisherValue()?this.getFormPublisherValue():this.getAttribute("value");this._name&&this.publisher&&ut(this.publisher,this._name).offAssign(this.onValueAssign),this._name&&s&&ut(s,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&&ut(this.publisher,this._name).onAssign(this.onValueAssign),s=this.getFormPublisher(),this._name&&s&&(ut(s,this._name).onAssign(this.onFormValueAssign),s.onFormInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(s){this.value=s.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const s=this.getAncestorAttributeValue("data-keyboard-nav");if(!s)return;const e=s.split(" "),o=e[0];if(!o)return;for(const l of e){xs.has(l)||xs.set(l,[]);const c=xs.get(l);c?.indexOf(this)==-1&&c.push(this)}const n=xs.get(o);this.addEventListener("keydown",l=>{const c=l;if(!["ArrowDown","ArrowUp"].includes(c.key))return;const h="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",u=n?.filter(m=>{const v=m.shadowRoot?.querySelector(h);if(!v)return!1;const y=window.getComputedStyle(v);return y.display!=="none"&&y.display!==""&&y.pointerEvents!="none"&&y.visibility!=="hidden"&&v.getBoundingClientRect().width>0});let d=null;if(c.key=="ArrowDown"&&u){const m=u.indexOf(this);m==u.length-1?d=u[0]:d=u[m+1]}else if(c.key=="ArrowUp"&&u){const m=u.indexOf(this);m==0?d=u[u.length-1]:d=u[m-1]}const g=d?.shadowRoot?.querySelector(h);g&&g.focus&&(g.focus(),l.preventDefault(),l.stopPropagation())})}focus(){this.shadowRoot?.querySelector("[data-form-element], button")?.focus()}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),super.connectedCallback(),this.addKeyboardNavigation()}unset(){this.value=null}disconnectedCallback(){this.unsetOnDisconnect()&&this.unset(),super.disconnectedCallback(),this._name&&this.publisher&&ut(this.publisher,this._name).offAssign(this.onValueAssign);const s=this.getFormPublisher();this._name&&s&&(ut(s,this._name).offAssign(this.onFormValueAssign),s.offFormInvalidate(this.onFormDataInValidate))}}return Ot([a({type:Boolean,reflect:!0})],t.prototype,"touched",2),Ot([a({type:Boolean})],t.prototype,"error",2),Ot([a({type:Boolean})],t.prototype,"autofocus",2),Ot([a({type:Boolean})],t.prototype,"required",2),Ot([a({type:Boolean})],t.prototype,"forceAutoFill",2),Ot([a({type:Boolean,reflect:!0})],t.prototype,"disabled",2),Ot([a({type:String,attribute:"data-aria-label"})],t.prototype,"ariaLabel",2),Ot([a({type:String,attribute:"data-aria-labelledby"})],t.prototype,"ariaLabelledby",2),Ot([a()],t.prototype,"name",1),Ot([a()],t.prototype,"value",1),t};let qo=class we{static areEqual(t,i){return t.length===i.length?t.every((s,e)=>s===i[e]):!1}static from2d(t){return{to1D:()=>{let i=[];return t.forEach(s=>i=i.concat(s)),this.from(i)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:i=>{if(t.length<1)return!0;const s=(t[0]||{})[i];return t.every(e=>(e||{})[i]==s)}})})}),value:()=>({forKey:i=>we.from(t.map(s=>s[i]))}),copy:()=>({fromKey:i=>({toKey:s=>{t.forEach(e=>{e[s]=Array.isArray(e[i])?[...e[i]]:typeof e[i]=="object"&&e[i]!=null?{...e[i]}:e[i]})}})})}),map:i=>we.from(t.map(i)),filter:i=>we.from(t.filter(i)),find:i=>t.find(i),some:i=>t.some(i),every:i=>t.every(i),group:()=>({byKey:i=>{const s=[],e=new Map;for(const o of t){const n=o[i];if(!e.has(n)){const l=s.length;e.set(n,l);const c={items:[]};c[i]=n,s.push(c)}s[e.get(n)].items.push(o)}return we.from(s)}}),without:()=>({duplicates:()=>({forKey:i=>{const s=[...new Set(t.map(e=>e[i]))];return we.from(s.map(e=>t.find(o=>o[i]==e)))}}),itemsIn:i=>({havingSameValue:()=>({forKey:s=>{const e=(o,n)=>l=>o[n]!=l[n];return we.from(t.filter(o=>i.every(e(o,s))))}})})})}}};function Ho(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var He={exports:{}},Wo=He.exports,nr;function Ko(){return nr||(nr=1,(function(r,t){var i=[].slice;(function(s,e){return t!==null?r.exports=e():s.UrlPattern=e()})(Wo,function(){var s,e,o,n,l,c,h,u,d,g,m,v,y,$,L;return d=function(p){return p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(p,f){var _,A,O;for(O=[],_=-1,A=p.length;++_<A;)O=O.concat(f(p[_]));return O},$=function(p,f){var _,A,O;for(O="",_=-1,A=p.length;++_<A;)O+=f(p[_]);return O},y=function(p){return new RegExp(p.toString()+"|").exec("").length-1},m=function(p,f){var _,A,O,q,Q;for(q={},_=-1,O=p.length;++_<O;)A=p[_],Q=f[_],Q!=null&&(q[A]!=null?(Array.isArray(q[A])||(q[A]=[q[A]]),q[A].push(Q)):q[A]=Q);return q},s={},s.Result=function(p,f){this.value=p,this.rest=f},s.Tagged=function(p,f){this.tag=p,this.value=f},s.tag=function(p,f){return function(_){var A,O;if(A=f(_),A!=null)return O=new s.Tagged(p,A.value),new s.Result(O,A.rest)}},s.regex=function(p){return function(f){var _,A;if(_=p.exec(f),_!=null)return A=_[0],new s.Result(A,f.slice(A.length))}},s.sequence=function(){var p;return p=1<=arguments.length?i.call(arguments,0):[],function(f){var _,A,O,q,Q,nt;for(_=-1,A=p.length,nt=[],q=f;++_<A;){if(O=p[_],Q=O(q),Q==null)return;nt.push(Q.value),q=Q.rest}return new s.Result(nt,q)}},s.pick=function(){var p,f;return p=arguments[0],f=2<=arguments.length?i.call(arguments,1):[],function(_){var A,O;if(O=s.sequence.apply(s,f)(_),O!=null)return A=O.value,O.value=A[p],O}},s.string=function(p){var f;return f=p.length,function(_){if(_.slice(0,f)===p)return new s.Result(p,_.slice(f))}},s.lazy=function(p){var f;return f=null,function(_){return f==null&&(f=p()),f(_)}},s.baseMany=function(p,f,_,A,O){var q,Q,nt,ls;for(nt=O,ls=_?"":[];!(f!=null&&(q=f(nt),q!=null)||(Q=p(nt),Q==null));)_?ls+=Q.value:ls.push(Q.value),nt=Q.rest;if(!(A&&ls.length===0))return new s.Result(ls,nt)},s.many1=function(p){return function(f){return s.baseMany(p,null,!1,!0,f)}},s.concatMany1Till=function(p,f){return function(_){return s.baseMany(p,f,!0,!0,_)}},s.firstChoice=function(){var p;return p=1<=arguments.length?i.call(arguments,0):[],function(f){var _,A,O,q;for(_=-1,A=p.length;++_<A;)if(O=p[_],q=O(f),q!=null)return q}},v=function(p){var f;return f={},f.wildcard=s.tag("wildcard",s.string(p.wildcardChar)),f.optional=s.tag("optional",s.pick(1,s.string(p.optionalSegmentStartChar),s.lazy(function(){return f.pattern}),s.string(p.optionalSegmentEndChar))),f.name=s.regex(new RegExp("^["+p.segmentNameCharset+"]+")),f.named=s.tag("named",s.pick(1,s.string(p.segmentNameStartChar),s.lazy(function(){return f.name}))),f.escapedChar=s.pick(1,s.string(p.escapeChar),s.regex(/^./)),f.static=s.tag("static",s.concatMany1Till(s.firstChoice(s.lazy(function(){return f.escapedChar}),s.regex(/^./)),s.firstChoice(s.string(p.segmentNameStartChar),s.string(p.optionalSegmentStartChar),s.string(p.optionalSegmentEndChar),f.wildcard))),f.token=s.lazy(function(){return s.firstChoice(f.wildcard,f.optional,f.named,f.static)}),f.pattern=s.many1(s.lazy(function(){return f.token})),f},u={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(p,f){if(Array.isArray(p))return $(p,function(_){return c(_,f)});switch(p.tag){case"wildcard":return"(.*?)";case"named":return"(["+f+"]+)";case"static":return d(p.value);case"optional":return"(?:"+c(p.value,f)+")?"}},l=function(p,f){return f==null&&(f=u.segmentValueCharset),"^"+c(p,f)+"$"},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)}},g=function(p,f,_,A){var O,q,Q,nt;if(A==null&&(A=!1),nt=p[f],nt==null){if(A)throw new Error("no values provided for key `"+f+"`");return}if(O=_[f]||0,q=Array.isArray(nt)?nt.length-1:0,O>q){if(A)throw new Error("too few values provided for key `"+f+"`");return}return Q=Array.isArray(nt)?nt[O]:nt,A&&(_[f]=O+1),Q},o=function(p,f,_){var A,O;if(Array.isArray(p)){for(A=-1,O=p.length;++A<O;)if(o(p[A],f,_))return!0;return!1}switch(p.tag){case"wildcard":return g(f,"_",_,!1)!=null;case"named":return g(f,p.value,_,!1)!=null;case"static":return!1;case"optional":return o(p.value,f,_)}},L=function(p,f,_){if(Array.isArray(p))return $(p,function(A){return L(A,f,_)});switch(p.tag){case"wildcard":return g(f,"_",_,!0);case"named":return g(f,p.value,_,!0);case"static":return p.value;case"optional":return o(p.value,f,_)?L(p.value,f,_):""}},e=function(p,f){var _,A,O,q,Q;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,f!=null){if(!Array.isArray(f))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(this.regex),f.length!==_)throw new Error("regex contains "+_+" groups but array of group names contains "+f.length);this.names=f}return}if(p==="")throw new Error("argument must not be the empty string");if(Q=p.replace(/\s+/g,""),Q!==p)throw new Error("argument must not contain whitespace");if(A={escapeChar:f?.escapeChar||u.escapeChar,segmentNameStartChar:f?.segmentNameStartChar||u.segmentNameStartChar,segmentNameCharset:f?.segmentNameCharset||u.segmentNameCharset,segmentValueCharset:f?.segmentValueCharset||u.segmentValueCharset,optionalSegmentStartChar:f?.optionalSegmentStartChar||u.optionalSegmentStartChar,optionalSegmentEndChar:f?.optionalSegmentEndChar||u.optionalSegmentEndChar,wildcardChar:f?.wildcardChar||u.wildcardChar},q=v(A),O=q.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 f,_;return _=this.regex.exec(p),_==null?null:(f=_.slice(1),this.names?m(this.names,f):f)},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 L(this.ast,p,{})},e.escapeForRegex=d,e.concatMap=h,e.stringConcatMap=$,e.regexGroupCount=y,e.keysAndValuesToObject=m,e.P=s,e.newParser=v,e.defaultOptions=u,e.astNodeToRegexString=l,e.astNodeToNames=n,e.getParam=g,e.astNodeContainsSegmentsForProvidedParams=o,e.stringify=L,e})})(He,He.exports)),He.exports}var Yo=Ko();const Rt=Ho(Yo),Zo=Hr,Xo=qo,Go=fs,Qo=cs,Xt=H,Jo=et,De=tt,tn=Ae,en=Rt;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:Zo,Arrays:Xo,DataBindObserver:Go,Format:Qo,HTML:Xt,LocationHandler:Jo,Objects:De,PublisherManager:k,api:tn,URLPattern:en};var sn=Object.defineProperty,rn=Object.getOwnPropertyDescriptor,We=(r,t,i,s)=>{for(var e=s>1?void 0:s?rn(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&sn(t,i,e),e};const ri=r=>{class t extends r{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this._checked=null,this.updateAllChecked=()=>{const s=this.getAttribute("name"),e=this.getCheckAllPublisher(),o=this.getFormPublisher();if(e?.hasCheckAll.get()&&!this.checksAll()&&e&&o&&s){if(this.getFormPublisherValue()?.length)(this.checked===null||e.checkMode.get()=="noneChecked"||e.checkMode.get()==null)&&e.checkMode.set("someUnchecked");else{e.checkMode.set("noneChecked");return}const n=this.getFormPublisherValue(),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.set("allChecked"),c==0&&e.checkMode.set("noneChecked")}l.indexOf(this.value)==-1&&this.unsetOnDisconnect()&&(this.checked=null)}},this.onChecksAllRequest=s=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),s=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),s=="noneChecked"&&(this.checked=null),s=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(s){if(this.value==s||(this.hasAttribute("value")&&!this.forceAutoFill&&(s=this.getAttribute("value")),this._value==s)||s==null||(this._value=s,!this.value))return;if(this.getFormPublisher()&&this.name){let o=this.getFormPublisherValue();(this.radio||this.unique)&&(this.checked=o==s?!0:null),Array.isArray(o)||(o=[]),o.indexOf(s)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(s){if(this.setCheckedValue(s),this.checksAll()){const e=this.getCheckAllPublisher();e&&(this.checked===!0?e.checkMode.set("allChecked"):this.checked===null&&(e.checkMode.set("noneChecked"),this.getFormPublisher()&&this.setFormPublisherValue([])))}this.requestUpdate()}validateFormElement(){const s=this.shadowRoot?.querySelector("input");if(!s||s.checkValidity())return;const e=this.getFormPublisher();if(e){const o=this.getFormPublisherValue();if((this.unique||this.radio)&&o!==null&&o!==void 0&&o.toString().length>0)return;e.isFormValid=!1,s.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(s){this._checked!=s&&(this._checked=s,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const s=this.checked===!0?this.radio?!0:null:!0;this.checked=s;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){let s=this.getFormPublisherValue();if(this.radio)return this.checked===!0&&this.value!=null?this.value:s;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(s)||(s=[]);const e=s.slice(0),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(s){if(this.unique||this.radio){this.checked=this.value==s?!0:null;return}Array.isArray(s)||(s=[]),!this.checksAll()&&(this.checked=s.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const s=this.formDataProvider,e=this.getAttribute("name");return!s||!e?null:k.get(s+"/"+e+"/_available_values_")}unset(){this.checked=null}disconnectedCallback(){super.disconnectedCallback();const s=this.getCheckAllPublisher();if(s&&(s.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=s.values.get().slice(0),o=e.indexOf(this.value);o!=-1&&(e.splice(o,1),s.values.set(e))}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){if(super.connectedCallback(),this.getFormPublisher()&&this.name){const o=this.getFormPublisherValue();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.set(!0),e.values.get()||e.values.set([]),this.checksAll()||e.values.set([...e.values.get(),this.value])),this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&setTimeout(()=>this.checked=!0,1)}}return We([a()],t.prototype,"value",1),We([a()],t.prototype,"forceAutoFill",2),We([a({type:Boolean})],t.prototype,"unique",2),We([a({type:Boolean})],t.prototype,"radio",2),We([a()],t.prototype,"checked",1),t};/**
|
|
73
|
-
* @license
|
|
74
|
-
* Copyright 2018 Google LLC
|
|
75
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
76
|
-
*/const C=r=>r??S,Dt=P`
|
|
7
|
+
<pre style="margin-top:10px;background:transparent;padding:0;font-size:inherit;color:inherit;">${JSON.stringify(this.publisher?.get(),null,` `)}</pre>`})}}removeDebugger(){ln.forEach(e=>{document.body.contains(e)&&document.body.removeChild(e)}),ln=new Set}getApiConfiguration(){return l.getApiConfiguration(this)}async initWording(){let e=Object.getOwnPropertyNames(this.constructor.prototype);for(let t of e)t.indexOf(`wording_`)==0&&on.callApi(this,t.substring(8));on.publisher.startTemplateFilling(this)}createRenderRoot(){if(this.noShadowDom===``||this.getAttribute(`noShadowDom`)===``)return this;let e=super.createRenderRoot();return ge.observe(e),e}initPublisher(){if(!document)return;this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate),this.onAssign&&this.publisher.offAssign(this.onAssign));let e=_.getInstance();this.dataProvider||=this.getAncestorAttributeValue(`dataProvider`);let t=this.dataProvider;if(!t&&this._props&&(this.dataProvider=t=`__subscriber__`+n.instanceCounter),t){this.bindPublisher&&e.set(t,this.bindPublisher());let n=e.get(t,{localStorageMode:this.getAttribute(`localStorage`)||`disabled`,invalidateOnPageShow:this.hasAttribute(`invalidateOnPageShow`)});if(this.dataProvider=t,this.hasAttribute(`subDataProvider`)){let r=this.getAttribute(`subDataProvider`);this.dataProvider=t+`/`+r,n=f.traverse(n,r.split(`.`)),e.set(this.dataProvider,n),this.publisher=n}this.publisher=n}this.hasAttribute(`lazyRendering`)||this.startPublisher()}startPublisher(){this.publisher&&(this._props&&this.publisher.set(this._props),this.noAutoFill||this.publisher.startTemplateFilling(this),this.renderOnPropsInternalChange&&this.publisher.onInternalMutation(this.requestUpdate),this.publisher.onAssign(this.onAssign))}}return O([b({type:Number})],n.prototype,`collectDependenciesVersion`,void 0),O([b({type:Boolean})],n.prototype,`displayContents`,void 0),O([b({type:Boolean})],n.prototype,`noAutoFill`,void 0),O([b({type:Boolean})],n.prototype,`forceAutoFill`,void 0),O([b({type:Object})],n.prototype,`propertyMap`,void 0),O([b({type:String,attribute:`data-title`})],n.prototype,`title`,void 0),O([b({reflect:!0})],n.prototype,`dataProvider`,void 0),O([b()],n.prototype,`bindPublisher`,void 0),O([b()],n.prototype,`props`,null),O([x()],n.prototype,`shouldRenderLazy`,void 0),n},un=e=>{class t extends e{constructor(...e){super(...e),this.templates=null,this.templateValueAttribute=`data-value`,this.templateList=[],this.templateParts={},this.templatePartsList=[]}connectedCallback(){let e=this.templates||[...this.querySelectorAll(`template`)];for(let t of e)t.hasAttribute(this.templateValueAttribute)&&(this.templateParts[t.getAttribute(this.templateValueAttribute)]=t,this.templatePartsList.push(t)),t.hasAttribute(`skeleton`)&&(this.templateParts.skeleton=t),t.hasAttribute(`no-result`)&&(this.templateParts[`no-result`]=t),t.hasAttribute(`no-item`)&&(this.templateParts[`no-item`]=t);this.templateList=e.filter(e=>!e.getAttribute(`data-value`)),this.templateList.length==0&&(this.templateList=e),super.connectedCallback()}}return O([b({type:Array})],t.prototype,`templates`,void 0),t},dn,fn=`sonic-date`;u(()=>A.updateComponentsLanguage());var A=class extends k(un(E)){static{dn=this}constructor(...e){super(...e),this.pageLanguage=`fr`,this.duAu=[],this._wording_billet_periode_validite=``,this.designMode=null,this.time_zone=null,this.date=null,this.date_string=null,this.start_date_string=null,this.end_date_string=null,this.start_date=0,this.computedStartDate=0,this.end_date=0,this.computedEndDate=0,this.hide_hours=!1,this.era=``,this.year=`numeric`,this.month=`short`,this.day=`2-digit`,this.weekday=`short`,this.hour=`2-digit`,this.hour12=!1,this.minute=`2-digit`,this.language=``,this.renderIf=!0,this.now=!1,this.startDateObject=new Date,this.endDateObject=new Date}static{this.dateCompnents=new Set}static updateComponentsLanguage(){dn.dateCompnents.forEach(e=>e.pageLanguage=l.getLanguage())}get wording_billet_periode_validite(){return this._wording_billet_periode_validite}set wording_billet_periode_validite(e){e||=`Du %s au %s`,this._wording_billet_periode_validite=e,this.duAu=this.wording_billet_periode_validite?.split(`%s`).map(e=>e.trim()),this.duAu.pop(),this.requestUpdate()}connectedCallback(){this.hasAttribute(`wording_billet_periode_validite`)||(this.wording_billet_periode_validite=`Du %s au %s`),this.pageLanguage=l.getLanguage(),dn.dateCompnents.add(this),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),dn.dateCompnents.delete(this)}getDatesParts(e,t,n){let r=this.startDateObject;r.setTime(e*1e3);let i=[];if(t>0){let e=this.endDateObject;e.setTime(t*1e3);let a=r.toDateString()==e.toDateString();if((!a||this.hide_hours)&&(delete n.hour,delete n.minute),i=new Intl.DateTimeFormat(this.language||this.pageLanguage,n).formatRangeToParts(r,e),!a){let e=i.find(e=>e.type==`literal`&&e.source==`shared`&&e.value.trim().length>0);e&&(e.value=` `+this.duAu[1]+` `,e.type=`to`),this.designMode||i.unshift({type:`from`,value:this.duAu[0]+` `,source:`shared`})}}else i=new Intl.DateTimeFormat(this.language||this.pageLanguage,n).formatToParts(r);return this.designMode&&i.forEach(e=>e.value=e.value.replace(/,/g,` `)),i[0].value=d.ucFirst(i[0].value),i.filter(e=>e.hidden!==!0)}dateStringToSeconds(e){return new Date(e).getTime()/1e3}willUpdate(e){if(this.computedStartDate=0,this.computedEndDate=0,this.date_string&&(this.date=this.dateStringToSeconds(this.date_string)),this.date&&(this.computedStartDate=this.date),this.start_date_string&&(this.computedStartDate=this.dateStringToSeconds(this.start_date_string)),this.end_date_string&&(this.end_date=this.dateStringToSeconds(this.end_date_string)),this.start_date&&(this.computedStartDate=this.start_date),!(!this.computedStartDate&&!this.now&&!this.end_date)&&(this.computedStartDate||=Date.now()/1e3,this.end_date&&(this.computedEndDate=this.end_date),this.computedEndDate>0&&this.computedEndDate<this.computedStartDate)){let e=this.computedStartDate;this.computedStartDate=this.computedEndDate,this.computedEndDate=e}}render(){if(!this.renderIf||!this.computedStartDate&&!this.now&&!this.computedEndDate)return T;let e={year:this.year||`numeric`,month:this.month||`short`,day:this.day||`2-digit`,hour12:this.hour12||!1};return this.weekday!==`hidden`&&(e.weekday=this.weekday||`short`),this.hour!==`hidden`&&(e.hour=this.hour||`2-digit`),this.minute!==`hidden`&&(e.minute=this.minute||`2-digit`),this.era&&(e.era=this.era),this.time_zone&&(e.timeZone=this.time_zone),D(`${this.getDatesParts(this.computedStartDate,this.computedEndDate,e).map(e=>{let t=this.templateParts[e.type];if(t){let n=document.importNode(t.content,!0).children[0];return n.innerText.trim()==``&&(n.innerText=e.value),n.outerHTML}let n=document.createElement(`span`);return n.innerText=e.value,n.className=e.type,`<span class="${e.type}">${e.value}</span>`}).join(``)}`)}};O([b()],A.prototype,`wording_billet_periode_validite`,null),O([b({type:Boolean})],A.prototype,`designMode`,void 0),O([b({type:String})],A.prototype,`time_zone`,void 0),O([b({type:Number})],A.prototype,`date`,void 0),O([b({type:String})],A.prototype,`date_string`,void 0),O([b({type:String})],A.prototype,`start_date_string`,void 0),O([b({type:String})],A.prototype,`end_date_string`,void 0),O([b({type:Number})],A.prototype,`start_date`,void 0),O([b({type:Number})],A.prototype,`end_date`,void 0),O([b({type:Boolean})],A.prototype,`hide_hours`,void 0),O([b({type:String})],A.prototype,`era`,void 0),O([b({type:String})],A.prototype,`year`,void 0),O([b({type:String})],A.prototype,`month`,void 0),O([b({type:String})],A.prototype,`day`,void 0),O([b({type:String})],A.prototype,`weekday`,void 0),O([b({type:String})],A.prototype,`hour`,void 0),O([b({type:Boolean})],A.prototype,`hour12`,void 0),O([b({type:String})],A.prototype,`minute`,void 0),O([b({type:String})],A.prototype,`language`,void 0),O([b({type:Boolean})],A.prototype,`renderIf`,void 0),O([b({type:Boolean})],A.prototype,`now`,void 0),A=dn=O([v(fn)],A);var j=class e{static{this.listeners=[]}static{this.listening=!1}static{this.prevURL=document.location?.href.replace(document.location.origin,``)}static listen(){if(!e.listening)return;let t=document.location?.href.replace(document.location.origin,``);e.prevURL&&e.prevURL!=t&&(e.prevURL=t,e.listeners.forEach(e=>{e.location=t})),window.requestAnimationFrame(e.listen)}static offChange(t){let n=e.listeners.indexOf(t);n!=-1&&(e.listeners.splice(n,1),e.listeners.length==0&&(e.listening=!1))}static onChange(t){e.listening||(e.listening=!0,e.listen()),e.listeners.push(t),t.location=this.prevURL}static changeFromComponent(e){let t=e.goBack,n=document.referrer;if(t!=null){let e=document.location.origin,r=(t||e).toString(),i=n.indexOf(`http`)==0?new URL(n).origin!=e:!1,a=n==``,o=history.length<3,s=a&&o,c=r!=document.location.href;if(i&&c||s){let e=history.state||{};e.concorde=e.concorde||{},e.concorde.hasDoneHistoryBack=!0,history.pushState(e,document.title),history.back(),document.location.replace(r)}else history.back();return}let r=e.getAttribute(`to`)||``;if(r||=e.href?.toString()||``,!r)return;if(r.indexOf(`#`)==0){document.location.hash=r.substring(1);return}let i=new URL(r,document.location.href),a=i.pathname.split(`/`),o=[],s=``;for(let e of a)e!=s&&o.push(e),s=e;r=`/`+o.join(`/`)+i.search+(i.hash?+i.hash:``),e.hasAttribute(`pushState`)?history.pushState(null,``,r):e.hasAttribute(`replaceState`)?history.replaceState(null,``,r):document.location.href=r}static updateComponentActiveState(e){if(e.autoActive==`disabled`)return;let t=e.href?.toString()||``;if(e.href&&t.indexOf(`http`)!=0){let n=new URL(t,document.location.href),r=new URL(e.location||``,document.location.origin),i=!1;i=e.autoActive==`strict`?n.pathname==r.pathname&&n.hash==r.hash&&n.search==r.search:e.autoActive==`strict-path-only`?n.pathname==r.pathname&&n.hash==r.hash:r.href.indexOf(n.href)==0,i?e.setAttribute(`active`,`true`):e.removeAttribute(`active`)}}},pn=`important`,mn=` !`+pn,M=Lt(class extends Rt{constructor(e){if(super(e),e.type!==It.ATTRIBUTE||e.name!==`style`||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce(((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`}),``)}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let e of this.ft)t[e]??(this.ft.delete(e),e.includes(`-`)?n.removeProperty(e):n[e]=null);for(let e in t){let r=t[e];if(r!=null){this.ft.add(e);let t=typeof r==`string`&&r.endsWith(mn);e.includes(`-`)||t?n.setProperty(e,t?r.slice(0,-11):r,t?pn:``):n[e]=r}}return w}}),hn=new Map,gn=e=>{class t extends e{constructor(...e){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=!1,this.formDataProvider=``,this._name=``,this._value=``,this.onValueAssign=e=>{this.setValueFromPublisher(e)},this.onFormValueAssign=async e=>{this.setFormValueFromPublisher(e)},this.onFormDataInValidate=()=>{let e=this.getFormPublisher();e&&e.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(e){this.hasAttribute(`name`)&&!this.forceAutoFill&&(e=this.getAttribute(`name`)),this._name=e,this.requestUpdate()}validateFormElement(){}unsetOnDisconnect(){return this.hasAttribute(`unsetOnDisconnect`)}updateDataValue(){this.getAttribute(`name`)&&this.getFormPublisher()&&(this.setFormPublisherValue(this.getValueForFormPublisher()),this.setFormValueFromPublisher(this.getFormPublisherValue()))}getFormPublisher(){return this.formDataProvider||=this.getAncestorAttributeValue(`formDataProvider`),this.formDataProvider?_.get(this.formDataProvider):null}setFormPublisherValue(e){let t=this.getFormPublisher();t&&p(t,this.name).set(e)}getFormPublisherValue(){let e=this.getFormPublisher();return e?p(e,this.name).get():null}getValueForFormPublisher(){return this.value}setValueFromPublisher(e){this.value=e}setFormValueFromPublisher(e){this.value=e}get value(){return this._value}set value(e){e??=``,f.isObject(e)&&Object.prototype.hasOwnProperty.call(e,`__value`)&&e._value==null&&(e=``),this._value!=e&&(this._value=e,this.updateDataValue(),this.requestUpdate())}initPublisher(){let e=this.getFormPublisher(),t=this.hasAncestorAttribute(`initFromPublisher`)&&this._name&&this.getFormPublisherValue()?this.getFormPublisherValue():this.getAttribute(`value`);this._name&&this.publisher&&p(this.publisher,this._name).offAssign(this.onValueAssign),this._name&&e&&p(e,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&&p(this.publisher,this._name).onAssign(this.onValueAssign),e=this.getFormPublisher(),this._name&&e&&(p(e,this._name).onAssign(this.onFormValueAssign),e.onFormInvalidate(this.onFormDataInValidate)),this.updateDataValue(),t&&(this.value=t)}handleBlur(){this.touched=!0}handleChange(e){this.value=e.target.value;let t=new Event(`change`);this.dispatchEvent(t)}addKeyboardNavigation(){let e=this.getAncestorAttributeValue(`data-keyboard-nav`);if(!e)return;let t=e.split(` `),n=t[0];if(!n)return;for(let e of t){hn.has(e)||hn.set(e,[]);let t=hn.get(e);t?.indexOf(this)==-1&&t.push(this)}let r=hn.get(n);this.addEventListener(`keydown`,e=>{let t=e;if(![`ArrowDown`,`ArrowUp`].includes(t.key))return;let n=`input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])`,i=r?.filter(e=>{let t=e.shadowRoot?.querySelector(n);if(!t)return!1;let r=window.getComputedStyle(t);return r.display!==`none`&&r.display!==``&&r.pointerEvents!=`none`&&r.visibility!==`hidden`&&t.getBoundingClientRect().width>0}),a=null;if(t.key==`ArrowDown`&&i){let e=i.indexOf(this);a=e==i.length-1?i[0]:i[e+1]}else if(t.key==`ArrowUp`&&i){let e=i.indexOf(this);a=e==0?i[i.length-1]:i[e-1]}let o=a?.shadowRoot?.querySelector(n);o&&o.focus&&(o.focus(),e.preventDefault(),e.stopPropagation())})}focus(){(this.shadowRoot?.querySelector(`[data-form-element], button`))?.focus()}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue(`formDataProvider`),super.connectedCallback(),this.addKeyboardNavigation()}unset(){this.value=null}disconnectedCallback(){this.unsetOnDisconnect()&&this.unset(),super.disconnectedCallback(),this._name&&this.publisher&&p(this.publisher,this._name).offAssign(this.onValueAssign);let e=this.getFormPublisher();this._name&&e&&(p(e,this._name).offAssign(this.onFormValueAssign),e.offFormInvalidate(this.onFormDataInValidate))}}return O([b({type:Boolean,reflect:!0})],t.prototype,`touched`,void 0),O([b({type:Boolean})],t.prototype,`error`,void 0),O([b({type:Boolean})],t.prototype,`autofocus`,void 0),O([b({type:Boolean})],t.prototype,`required`,void 0),O([b({type:Boolean})],t.prototype,`forceAutoFill`,void 0),O([b({type:Boolean,reflect:!0})],t.prototype,`disabled`,void 0),O([b({type:String,attribute:`data-aria-label`})],t.prototype,`ariaLabel`,void 0),O([b({type:String,attribute:`data-aria-labelledby`})],t.prototype,`ariaLabelledby`,void 0),O([b()],t.prototype,`name`,null),O([b()],t.prototype,`value`,null),t},_n=class e{static areEqual(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}static from2d(e){return{to1D:()=>{let t=[];return e.forEach(e=>t=t.concat(e)),this.from(t)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:e=>{if(t.length<1)return!0;let n=(t[0]||{})[e];return t.every(t=>(t||{})[e]==n)}})})}),value:()=>({forKey:n=>e.from(t.map(e=>e[n]))}),copy:()=>({fromKey:e=>({toKey:n=>{t.forEach(t=>{t[n]=Array.isArray(t[e])?[...t[e]]:typeof t[e]==`object`&&t[e]!=null?{...t[e]}:t[e]})}})})}),map:n=>e.from(t.map(n)),filter:n=>e.from(t.filter(n)),find:e=>t.find(e),some:e=>t.some(e),every:e=>t.every(e),group:()=>({byKey:n=>{let r=[],i=new Map;for(let e of t){let t=e[n];if(!i.has(t)){let e=r.length;i.set(t,e);let a={items:[]};a[n]=t,r.push(a)}r[i.get(t)].items.push(e)}return e.from(r)}}),without:()=>({duplicates:()=>({forKey:n=>{let r=[...new Set(t.map(e=>e[n]))];return e.from(r.map(e=>t.find(t=>t[n]==e)))}}),itemsIn:n=>({havingSameValue:()=>({forKey:r=>{let i=(e,t)=>n=>e[t]!=n[t];return e.from(t.filter(e=>n.every(i(e,r))))}})})})}}},vn=c(o(((e,t)=>{var n=[].slice;(function(n,r){return typeof define==`function`&&define.amd!=null?define([],r):e==null?n.UrlPattern=r():t.exports=r()})(e,function(){var e,t,r,i,a,o,s,c,l=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,`\\$&`)},u,d,f,p,m,h;return s=function(e,t){var n,r,i=[];for(n=-1,r=e.length;++n<r;)i=i.concat(t(e[n]));return i},m=function(e,t){var n,r,i=``;for(n=-1,r=e.length;++n<r;)i+=t(e[n]);return i},p=function(e){return RegExp(e.toString()+`|`).exec(``).length-1},d=function(e,t){var n,r,i,a={},o;for(n=-1,i=e.length;++n<i;)r=e[n],o=t[n],o!=null&&(a[r]==null?a[r]=o:(Array.isArray(a[r])||(a[r]=[a[r]]),a[r].push(o)));return a},e={},e.Result=function(e,t){this.value=e,this.rest=t},e.Tagged=function(e,t){this.tag=e,this.value=t},e.tag=function(t,n){return function(r){var i=n(r),a;if(i!=null)return a=new e.Tagged(t,i.value),new e.Result(a,i.rest)}},e.regex=function(t){return function(n){var r=t.exec(n),i;if(r!=null)return i=r[0],new e.Result(i,n.slice(i.length))}},e.sequence=function(){var t=1<=arguments.length?n.call(arguments,0):[];return function(n){var r=-1,i=t.length,a,o,s,c=[];for(o=n;++r<i;){if(a=t[r],s=a(o),s==null)return;c.push(s.value),o=s.rest}return new e.Result(c,o)}},e.pick=function(){var t=arguments[0],r=2<=arguments.length?n.call(arguments,1):[];return function(n){var i,a=e.sequence.apply(e,r)(n);if(a!=null)return i=a.value,a.value=i[t],a}},e.string=function(t){var n=t.length;return function(r){if(r.slice(0,n)===t)return new e.Result(t,r.slice(n))}},e.lazy=function(e){var t=null;return function(n){return t??=e(),t(n)}},e.baseMany=function(t,n,r,i,a){for(var o,s,c=a,l=r?``:[];!(n!=null&&(o=n(c),o!=null)||(s=t(c),s==null));)r?l+=s.value:l.push(s.value),c=s.rest;if(!(i&&l.length===0))return new e.Result(l,c)},e.many1=function(t){return function(n){return e.baseMany(t,null,!1,!0,n)}},e.concatMany1Till=function(t,n){return function(r){return e.baseMany(t,n,!0,!0,r)}},e.firstChoice=function(){var e=1<=arguments.length?n.call(arguments,0):[];return function(t){for(var n=-1,r=e.length,i,a;++n<r;)if(i=e[n],a=i(t),a!=null)return a}},f=function(t){var n={};return n.wildcard=e.tag(`wildcard`,e.string(t.wildcardChar)),n.optional=e.tag(`optional`,e.pick(1,e.string(t.optionalSegmentStartChar),e.lazy(function(){return n.pattern}),e.string(t.optionalSegmentEndChar))),n.name=e.regex(RegExp(`^[`+t.segmentNameCharset+`]+`)),n.named=e.tag(`named`,e.pick(1,e.string(t.segmentNameStartChar),e.lazy(function(){return n.name}))),n.escapedChar=e.pick(1,e.string(t.escapeChar),e.regex(/^./)),n.static=e.tag(`static`,e.concatMany1Till(e.firstChoice(e.lazy(function(){return n.escapedChar}),e.regex(/^./)),e.firstChoice(e.string(t.segmentNameStartChar),e.string(t.optionalSegmentStartChar),e.string(t.optionalSegmentEndChar),n.wildcard))),n.token=e.lazy(function(){return e.firstChoice(n.wildcard,n.optional,n.named,n.static)}),n.pattern=e.many1(e.lazy(function(){return n.token})),n},c={escapeChar:`\\`,segmentNameStartChar:`:`,segmentValueCharset:`a-zA-Z0-9-_~ %`,segmentNameCharset:`a-zA-Z0-9`,optionalSegmentStartChar:`(`,optionalSegmentEndChar:`)`,wildcardChar:`*`},o=function(e,t){if(Array.isArray(e))return m(e,function(e){return o(e,t)});switch(e.tag){case`wildcard`:return`(.*?)`;case`named`:return`([`+t+`]+)`;case`static`:return l(e.value);case`optional`:return`(?:`+o(e.value,t)+`)?`}},a=function(e,t){return t??=c.segmentValueCharset,`^`+o(e,t)+`$`},i=function(e){if(Array.isArray(e))return s(e,i);switch(e.tag){case`wildcard`:return[`_`];case`named`:return[e.value];case`static`:return[];case`optional`:return i(e.value)}},u=function(e,t,n,r){var i,a,o,s;if(r??=!1,s=e[t],s==null){if(r)throw Error("no values provided for key `"+t+"`");return}if(i=n[t]||0,a=Array.isArray(s)?s.length-1:0,i>a){if(r)throw Error("too few values provided for key `"+t+"`");return}return o=Array.isArray(s)?s[i]:s,r&&(n[t]=i+1),o},r=function(e,t,n){var i,a;if(Array.isArray(e)){for(i=-1,a=e.length;++i<a;)if(r(e[i],t,n))return!0;return!1}switch(e.tag){case`wildcard`:return u(t,`_`,n,!1)!=null;case`named`:return u(t,e.value,n,!1)!=null;case`static`:return!1;case`optional`:return r(e.value,t,n)}},h=function(e,t,n){if(Array.isArray(e))return m(e,function(e){return h(e,t,n)});switch(e.tag){case`wildcard`:return u(t,`_`,n,!0);case`named`:return u(t,e.value,n,!0);case`static`:return e.value;case`optional`:return r(e.value,t,n)?h(e.value,t,n):``}},t=function(e,n){var r,o,s,l,u;if(e instanceof t){this.isRegex=e.isRegex,this.regex=e.regex,this.ast=e.ast,this.names=e.names;return}if(this.isRegex=e instanceof RegExp,!(typeof e==`string`||this.isRegex))throw TypeError(`argument must be a regex or a string`);if(this.isRegex){if(this.regex=e,n!=null){if(!Array.isArray(n))throw Error(`if first argument is a regex the second argument may be an array of group names but you provided something else`);if(r=p(this.regex),n.length!==r)throw Error(`regex contains `+r+` groups but array of group names contains `+n.length);this.names=n}return}if(e===``)throw Error(`argument must not be the empty string`);if(u=e.replace(/\s+/g,``),u!==e)throw Error(`argument must not contain whitespace`);if(o={escapeChar:n?.escapeChar||c.escapeChar,segmentNameStartChar:n?.segmentNameStartChar||c.segmentNameStartChar,segmentNameCharset:n?.segmentNameCharset||c.segmentNameCharset,segmentValueCharset:n?.segmentValueCharset||c.segmentValueCharset,optionalSegmentStartChar:n?.optionalSegmentStartChar||c.optionalSegmentStartChar,optionalSegmentEndChar:n?.optionalSegmentEndChar||c.optionalSegmentEndChar,wildcardChar:n?.wildcardChar||c.wildcardChar},l=f(o),s=l.pattern(e),s==null)throw Error(`couldn't parse pattern`);if(s.rest!==``)throw Error(`could only partially parse pattern`);this.ast=s.value,this.regex=new RegExp(a(this.ast,o.segmentValueCharset)),this.names=i(this.ast)},t.prototype.match=function(e){var t,n=this.regex.exec(e);return n==null?null:(t=n.slice(1),this.names?d(this.names,t):t)},t.prototype.stringify=function(e){if(e??={},this.isRegex)throw Error(`can't stringify patterns generated from a regex`);if(e!==Object(e))throw Error(`argument must be an object or undefined`);return h(this.ast,e,{})},t.escapeForRegex=l,t.concatMap=s,t.stringConcatMap=m,t.regexGroupCount=p,t.keysAndValuesToObject=d,t.P=e,t.newParser=f,t.defaultOptions=c,t.astNodeToRegexString=a,t.astNodeToNames=i,t.getParam=u,t.astNodeContainsSegmentsForProvidedParams=r,t.stringify=h,t})}))(),1).default,yn=class{constructor(e){this.path=e}toString(){return this.path}};function bn(e){return new Proxy(e,{get(e,t){return t===`path`?e.path:t===`toString`?e.toString.bind(e):t===Symbol.toStringTag?`DataProviderKey`:typeof t==`symbol`?e[t]:bn(new yn(e.path?`${e.path}.${String(t)}`:String(t)))}})}var xn=function(e){return this instanceof xn?bn(new yn(e)):new xn(e)},Sn=class e{constructor(t){this.path=e.normalizePath(t)}getDataProviderKey(){return new xn(this.path)}static normalizePath(e){let t=String(e).trim();if(!t)throw RangeError(`Endpoint: path cannot be empty`);if(/^https?:\/\//i.test(t)){let e;try{e=new URL(t)}catch{throw RangeError(`Endpoint: invalid absolute URL`)}return e.pathname=e.pathname.replace(/\/+/g,`/`),e.href}let n=t.indexOf(`?`),r=t.indexOf(`#`),i=t.length;n>=0&&(i=Math.min(i,n)),r>=0&&(i=Math.min(i,r));let a=t.slice(0,i),o=t.slice(i);if(a=a.replace(/^\/+/,``),a=a.replace(/\/+/g,`/`),!a&&o)throw RangeError(`Endpoint: path cannot be empty`);return a+o}static isNonEmpty(e){return String(e).trim().length>0}static looksLikeDataProviderPath(e){return/^\s*dataProvider\s*\(/i.test(String(e))}toString(){return this.path}},Cn=m,wn=_n,Tn=ge,En=d,Dn=l,On=j,kn=f,An=Yt,jn=vn;window[`concorde-utils`]=window[`concorde-utils`]||{},window[`concorde-utils`]={Utils:Cn,Arrays:wn,DataBindObserver:Tn,Format:En,HTML:Dn,LocationHandler:On,Objects:kn,PublisherManager:_,api:An,URLPattern:jn,Endpoint:Sn,DataProviderKey:xn};var Mn=e=>{class t extends e{constructor(...e){super(...e),this._value=``,this.forceAutoFill=!1,this.unique=null,this.radio=null,this._checked=null,this.updateAllChecked=()=>{let e=this.getAttribute(`name`),t=this.getCheckAllPublisher(),n=this.getFormPublisher();if(t?.hasCheckAll.get()&&!this.checksAll()&&t&&n&&e){if(this.getFormPublisherValue()?.length)(this.checked===null||t.checkMode.get()==`noneChecked`||t.checkMode.get()==null)&&t.checkMode.set(`someUnchecked`);else{t.checkMode.set(`noneChecked`);return}let e=this.getFormPublisherValue(),n=t.values.get();if(n&&n.length){let r=n.length;for(let t of n)e.indexOf(t)==-1&&--r;r==n.length&&t.checkMode.set(`allChecked`),r==0&&t.checkMode.set(`noneChecked`)}n.indexOf(this.value)==-1&&this.unsetOnDisconnect()&&(this.checked=null)}},this.onChecksAllRequest=e=>{this.removeAttribute(`allChecked`),this.removeAttribute(`indeterminate`),e==`allChecked`&&(this.checked=!0,this.setAttribute(`allChecked`,``)),e==`noneChecked`&&(this.checked=null),e==`someUnchecked`&&(this.checksAll()&&(this.checked=`indeterminate`),this.setAttribute(`indeterminate`,``))}}get value(){return this._value}set value(e){if(this.value!=e&&(this.hasAttribute(`value`)&&!this.forceAutoFill&&(e=this.getAttribute(`value`)),this._value!=e&&e!=null&&(this._value=e,this.value))){if(this.getFormPublisher()&&this.name){let t=this.getFormPublisherValue();(this.radio||this.unique)&&(this.checked=t==e?!0:null),Array.isArray(t)||(t=[]),t.indexOf(e)!=-1&&(this.checked=!0)}this.checked==1&&this.updateDataValue(),this.requestUpdate()}}get checked(){return this._checked}set checked(e){if(this.setCheckedValue(e),this.checksAll()){let e=this.getCheckAllPublisher();e&&(this.checked===!0?e.checkMode.set(`allChecked`):this.checked===null&&(e.checkMode.set(`noneChecked`),this.getFormPublisher()&&this.setFormPublisherValue([])))}this.requestUpdate()}validateFormElement(){let e=this.shadowRoot?.querySelector(`input`);if(!e||e.checkValidity())return;let t=this.getFormPublisher();if(t){let n=this.getFormPublisherValue();if((this.unique||this.radio)&&n!=null&&n.toString().length>0)return;t.isFormValid=!1,e.reportValidity()}}checksAll(){return this.hasAttribute(`checksAll`)}setCheckedValue(e){this._checked!=e&&(this._checked=e,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){let e=this.checked===!0?this.radio?!0:null:!0;this.checked=e;let t=new Event(`change`);this.dispatchEvent(t)}getValueForFormPublisher(){let e=this.getFormPublisherValue();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=[]);let t=e.slice(0),n=t.indexOf(this.value);return this.checked===!0&&n===-1&&!this.checksAll()&&t.push(this.value),this.checked===null&&n!==-1&&t.splice(n,1),t}setFormValueFromPublisher(e){if(this.unique||this.radio){this.checked=this.value==e?!0:null;return}Array.isArray(e)||(e=[]),!this.checksAll()&&(this.checked=e.indexOf(this.value)===-1?null:!0)}getCheckAllPublisher(){this.formDataProvider||=this.getAncestorAttributeValue(`formDataProvider`);let e=this.formDataProvider,t=this.getAttribute(`name`);return!e||!t?null:_.get(e+`/`+t+`/_available_values_`)}unset(){this.checked=null}disconnectedCallback(){super.disconnectedCallback();let e=this.getCheckAllPublisher();if(e&&(e.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){let t=e.values.get().slice(0),n=t.indexOf(this.value);n!=-1&&(t.splice(n,1),e.values.set(t))}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){if(super.connectedCallback(),this.getFormPublisher()&&this.name){let e=this.getFormPublisherValue();e&&Array.isArray(e)&&e.indexOf(this.value)!==-1&&(this.checked=!0)}let e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&e.hasCheckAll.set(!0),e.values.get()||e.values.set([]),this.checksAll()||e.values.set([...e.values.get(),this.value])),this.hasAttribute(`checked`)&&(!this.publisher||this.publisher.get().checked!==!1)&&setTimeout(()=>this.checked=!0,1)}}return O([b()],t.prototype,`value`,null),O([b()],t.prototype,`forceAutoFill`,void 0),O([b({type:Boolean})],t.prototype,`unique`,void 0),O([b({type:Boolean})],t.prototype,`radio`,void 0),O([b()],t.prototype,`checked`,null),t},N=e=>e??T,P=y`
|
|
77
8
|
/*SIZES*/
|
|
78
9
|
:host {
|
|
79
10
|
--sc-_fs: 1rem;
|
|
@@ -106,41 +37,7 @@
|
|
|
106
37
|
:host([size="inherit"]) {
|
|
107
38
|
--sc-_fs: 1em;
|
|
108
39
|
}
|
|
109
|
-
|
|
110
|
-
<button
|
|
111
|
-
part="button"
|
|
112
|
-
class=${this.hasPrefix||this.hasSuffix?"has-prefix-or-suffix":""}
|
|
113
|
-
style=${pt(r)}
|
|
114
|
-
aria-controls=${C(this.ariaControls)}
|
|
115
|
-
aria-expanded=${C(this.sonicAriaExpanded)}
|
|
116
|
-
aria-label=${C(this.ariaLabel)}
|
|
117
|
-
aria-labelledby=${C(this.ariaLabelledby)}
|
|
118
|
-
?disabled=${this.disabled}
|
|
119
|
-
@click=${this.handleChange}
|
|
120
|
-
@pointerdown=${this.handleRepeatStart}
|
|
121
|
-
>
|
|
122
|
-
<slot
|
|
123
|
-
@slotchange=${this.onSlotChange}
|
|
124
|
-
part="prefix"
|
|
125
|
-
name="prefix"
|
|
126
|
-
></slot>
|
|
127
|
-
<slot part="main" class="main-slot"></slot>
|
|
128
|
-
<slot
|
|
129
|
-
@slotchange=${this.onSlotChange}
|
|
130
|
-
part="suffix"
|
|
131
|
-
name="suffix"
|
|
132
|
-
></slot>
|
|
133
|
-
${this.loading==!0?b`<sonic-icon name="loader" class="loader"></sonic-icon>`:""}
|
|
134
|
-
</button>
|
|
135
|
-
`;return this.href?b`<a
|
|
136
|
-
href="${this.href}"
|
|
137
|
-
download=${C(this.download)}
|
|
138
|
-
target=${C(this.target)}
|
|
139
|
-
aria-label=${C(this.ariaLabel)}
|
|
140
|
-
aria-labelledby=${C(this.ariaLabelledby)}
|
|
141
|
-
@click=${this.pushState||this.goBack!==null?this.handleNavigation:null}
|
|
142
|
-
>${t}</a
|
|
143
|
-
>`:b`${t}`}onSlotChange(){this.hasPrefix=!!this.prefixes?.length,this.hasSuffix=!!this.suffixes?.length}};M.styles=[Dt,P`
|
|
40
|
+
`,Nn=`sonic-button`,F=class extends Mn(gn(k(E))){constructor(...e){super(...e),this.type=`default`,this.variant=`default`,this.shape=`default`,this.direction=`row`,this.alignItems=`center`,this.justify=`center`,this.minWidth=`0`,this.icon=!1,this.download=null,this.autoActive=`partial`,this.loading=!1,this.hasPrefix=!1,this.hasSuffix=!1,this._href=``,this.goBack=null,this.pushState=!1,this.active=!1,this.autoRepeat=!1,this.pointerDownTime=0,this.lastRepeatTime=0,this.isRepeating=!1,this.handleRepeatend=()=>{window.removeEventListener(`pointerup`,this.handleRepeatend),window.removeEventListener(`blur`,this.handleRepeatend),this.autoRepeat&&(this.isRepeating=!1)},this.location=``}static{this.styles=[P,y`
|
|
144
41
|
* {
|
|
145
42
|
box-sizing: border-box;
|
|
146
43
|
}
|
|
@@ -506,11 +403,41 @@
|
|
|
506
403
|
transform: translate(-50%, -50%) rotate(359deg);
|
|
507
404
|
}
|
|
508
405
|
}
|
|
509
|
-
`]
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
406
|
+
`]}set href(e){this._href=e;let t=this._href.toString();t&&t.indexOf(`http`)!=0?j.onChange(this):j.offChange(this),this.requestUpdate()}get href(){return this._href}handleNavigation(e){e.preventDefault(),j.changeFromComponent(this)}handleChange(e){if(!(e?.type==`click`&&this.autoRepeat)&&(super.handleChange(),(this.pushState||this.goBack!==null)&&(e?.preventDefault(),e?.stopPropagation(),j.changeFromComponent(this)),this.hasAttribute(`reset`))){let e=this.getAttribute(`reset`),t=e?_.get(e):this.getFormPublisher();t&&t.set({})}}handleRepeatStart(e){this.autoRepeat&&(this.handleChange(e),this.pointerDownTime=Date.now(),this.isRepeating=!0,this.repeat()),window.addEventListener(`pointerup`,this.handleRepeatend),window.addEventListener(`blur`,this.handleRepeatend)}repeat(){if(this.isRepeating){if(this.hasAttribute(`disabled`)){this.isRepeating=!1;return}window.requestAnimationFrame(this.repeat.bind(this)),!(Date.now()-this.pointerDownTime<500)&&(Date.now()-this.lastRepeatTime<100||(this.handleChange(),this.lastRepeatTime=Date.now()))}}connectedCallback(){super.connectedCallback()}setCheckedValue(e){if(this.name){if(e?this.setAttribute(`active`,`true`):this.removeAttribute(`active`),e==this._checked)return;super.setCheckedValue(e)}}disconnectedCallback(){j.offChange(this),super.disconnectedCallback()}willUpdate(e){(e.has(`href`)||e.has(`autoActive`))&&j.updateComponentActiveState(this),e.has(`location`)&&j.updateComponentActiveState(this)}render(){let e={flexDirection:this.direction,alignItems:this.alignItems,justifyContent:this.justify,align:this.align,minWidth:this.minWidth},t=C`
|
|
407
|
+
<button
|
|
408
|
+
part="button"
|
|
409
|
+
class=${this.hasPrefix||this.hasSuffix?`has-prefix-or-suffix`:``}
|
|
410
|
+
style=${M(e)}
|
|
411
|
+
aria-controls=${N(this.ariaControls)}
|
|
412
|
+
aria-expanded=${N(this.sonicAriaExpanded)}
|
|
413
|
+
aria-label=${N(this.ariaLabel)}
|
|
414
|
+
aria-labelledby=${N(this.ariaLabelledby)}
|
|
415
|
+
?disabled=${this.disabled}
|
|
416
|
+
@click=${this.handleChange}
|
|
417
|
+
@pointerdown=${this.handleRepeatStart}
|
|
418
|
+
>
|
|
419
|
+
<slot
|
|
420
|
+
@slotchange=${this.onSlotChange}
|
|
421
|
+
part="prefix"
|
|
422
|
+
name="prefix"
|
|
423
|
+
></slot>
|
|
424
|
+
<slot part="main" class="main-slot"></slot>
|
|
425
|
+
<slot
|
|
426
|
+
@slotchange=${this.onSlotChange}
|
|
427
|
+
part="suffix"
|
|
428
|
+
name="suffix"
|
|
429
|
+
></slot>
|
|
430
|
+
${this.loading==1?C`<sonic-icon name="loader" class="loader"></sonic-icon>`:``}
|
|
431
|
+
</button>
|
|
432
|
+
`;return this.href?C`<a
|
|
433
|
+
href="${this.href}"
|
|
434
|
+
download=${N(this.download)}
|
|
435
|
+
target=${N(this.target)}
|
|
436
|
+
aria-label=${N(this.ariaLabel)}
|
|
437
|
+
aria-labelledby=${N(this.ariaLabelledby)}
|
|
438
|
+
@click=${this.pushState||this.goBack!==null?this.handleNavigation:null}
|
|
439
|
+
>${t}</a
|
|
440
|
+
>`:C`${t}`}onSlotChange(){this.hasPrefix=!!this.prefixes?.length,this.hasSuffix=!!this.suffixes?.length}};O([b({type:String,reflect:!0})],F.prototype,`type`,void 0),O([b({type:String,reflect:!0})],F.prototype,`variant`,void 0),O([b({type:String,reflect:!0})],F.prototype,`size`,void 0),O([b({type:String,reflect:!0})],F.prototype,`shape`,void 0),O([b({type:String})],F.prototype,`direction`,void 0),O([b({type:String,reflect:!0})],F.prototype,`alignItems`,void 0),O([b({type:String})],F.prototype,`justify`,void 0),O([b({type:String,reflect:!0})],F.prototype,`align`,void 0),O([b({type:String})],F.prototype,`minWidth`,void 0),O([b({type:Boolean,reflect:!0})],F.prototype,`icon`,void 0),O([b({type:String})],F.prototype,`download`,void 0),O([b({type:String})],F.prototype,`autoActive`,void 0),O([b({type:Boolean,reflect:!0})],F.prototype,`loading`,void 0),O([x()],F.prototype,`hasPrefix`,void 0),O([x()],F.prototype,`hasSuffix`,void 0),O([We({flatten:!0,slot:`prefix`})],F.prototype,`prefixes`,void 0),O([We({flatten:!0,slot:`suffix`})],F.prototype,`suffixes`,void 0),O([b({type:String})],F.prototype,`target`,void 0),O([b({type:String})],F.prototype,`href`,null),O([b({type:String})],F.prototype,`goBack`,void 0),O([b({type:Boolean})],F.prototype,`pushState`,void 0),O([b({type:Boolean,reflect:!0})],F.prototype,`active`,void 0),O([b({type:Boolean,reflect:!0})],F.prototype,`autoRepeat`,void 0),O([b({type:String,attribute:`data-aria-controls`})],F.prototype,`ariaControls`,void 0),O([b({type:Boolean,attribute:`data-aria-expanded`})],F.prototype,`sonicAriaExpanded`,void 0),O([x()],F.prototype,`location`,void 0),F=O([v(Nn)],F);var Pn=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},Fn=Lt(class extends Rt{constructor(e){if(super(e),e.type!==It.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=Pt(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=jt(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=jt(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=jt(i[d],a[m]),At(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=jt(i[f],a[p]),At(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=Pn(o,p,m),u=Pn(s,d,f)),l.has(s[d]))if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=At(e,i[d]);jt(t,a[p]),c[p]=t}else c[p]=jt(n,a[p]),At(e,i[d],n),i[t]=null;p++}else Ft(i[f]),f--;else Ft(i[d]),d++;for(;p<=m;){let t=At(e,c[m+1]);jt(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&Ft(e)}return this.ut=o,Nt(e,c),w}}),In=new WeakMap,Ln=0,Rn=new Map,zn=new WeakSet,Bn=()=>new Promise((e=>requestAnimationFrame(e))),Vn=(e,t)=>{let n=e-t;return n===0?void 0:n},Hn=(e,t)=>{let n=e/t;return n===1?void 0:n},Un={left:(e,t)=>{let n=Vn(e,t);return{value:n,transform:n==null||isNaN(n)?void 0:`translateX(${n}px)`}},top:(e,t)=>{let n=Vn(e,t);return{value:n,transform:n==null||isNaN(n)?void 0:`translateY(${n}px)`}},width:(e,t)=>{let n;t===0&&(t=1,n={width:`1px`});let r=Hn(e,t);return{value:r,overrideFrom:n,transform:r==null||isNaN(r)?void 0:`scaleX(${r})`}},height:(e,t)=>{let n;t===0&&(t=1,n={height:`1px`});let r=Hn(e,t);return{value:r,overrideFrom:n,transform:r==null||isNaN(r)?void 0:`scaleY(${r})`}}},Wn={duration:333,easing:`ease-in-out`},Gn=[`left`,`top`,`width`,`height`,`opacity`,`color`,`background`],Kn=new WeakMap,qn=Lt(class extends Gt{constructor(e){if(super(e),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,e.type===It.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){this.resolveFinished?.(),this.finished=new Promise((e=>{this.l=e}))}async resolveFinished(){this.l?.(),this.l=void 0}render(e){return T}getController(){return In.get(this.u)}isDisabled(){return this.options.disabled||this.getController()?.disabled}update(e,[t]){let n=this.u===void 0;return n&&(this.u=e.options?.host,this.u.addController(this),this.u.updateComplete.then((e=>this.t=!0)),this.element=e.element,Kn.set(this.element,this)),this.optionsOrCallback=t,(n||typeof t!=`function`)&&this.p(t),this.render(t)}p(e){e??={};let t=this.getController();t!==void 0&&((e={...t.defaultOptions,...e}).keyframeOptions={...t.defaultOptions.keyframeOptions,...e.keyframeOptions}),e.properties??=Gn,this.options=e}m(){let e={},t=this.element.getBoundingClientRect(),n=getComputedStyle(this.element);return this.options.properties.forEach((r=>{let i=t[r]??(Un[r]?void 0:n[r]),a=Number(i);e[r]=isNaN(a)?i+``:a})),e}v(){let e,t=!0;return this.options.guard&&(e=this.options.guard(),t=((e,t)=>{if(Array.isArray(e)){if(Array.isArray(t)&&t.length===e.length&&e.every(((e,n)=>e===t[n])))return!1}else if(t===e)return!1;return!0})(e,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&t&&this.element.isConnected,this.h&&(this._=Array.isArray(e)?Array.from(e):e),this.h}hostUpdate(){typeof this.optionsOrCallback==`function`&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let e;this.prepare(),await Bn;let t=this.O(),n=this.j(this.options.keyframeOptions,t),r=this.m();if(this.A!==void 0){let{from:n,to:i}=this.N(this.A,r,t);this.log(`measured`,[this.A,r,n,i]),e=this.calculateKeyframes(n,i)}else{let n=Rn.get(this.options.inId);if(n){Rn.delete(this.options.inId);let{from:i,to:a}=this.N(n,r,t);e=this.calculateKeyframes(i,a),e=this.options.in?[{...this.options.in[0],...e[0]},...this.options.in.slice(1),e[1]]:e,Ln++,e.forEach((e=>e.zIndex=Ln))}else this.options.in&&(e=[...this.options.in,{}])}this.animate(e,n)}resetStyles(){this.P!==void 0&&(this.element.setAttribute(`style`,this.P??``),this.P=void 0)}commitStyles(){this.P=this.element.getAttribute(`style`),this.webAnimation?.commitStyles(),this.webAnimation?.cancel()}reconnected(){}async disconnected(){if(!this.h||(this.options.id!==void 0&&Rn.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await Bn(),this.i?.isConnected){let e=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,e),this.options.stabilizeOut){let e=this.m();this.log(`stabilizing out`);let t=this.A.left-e.left,n=this.A.top-e.top;getComputedStyle(this.element).position!==`static`||t===0&&n===0||(this.element.style.position=`relative`),t!==0&&(this.element.style.left=t+`px`),n!==0&&(this.element.style.top=n+`px`)}}let e=this.j(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){this.options.onStart?.(this)}didFinish(e){e&&this.options.onComplete?.(this),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){let e=[];for(let t=this.element.parentNode;t;t=t?.parentNode){let n=Kn.get(t);n&&!n.isDisabled()&&n&&e.push(n)}return e}get isHostRendered(){let e=zn.has(this.u);return e||this.u.updateComplete.then((()=>{zn.add(this.u)})),e}j(e,t=this.O()){let n={...Wn};return t.forEach((e=>Object.assign(n,e.options.keyframeOptions))),Object.assign(n,e),n}N(e,t,n){e={...e},t={...t};let r=n.map((e=>e.animatingProperties)).filter((e=>e!==void 0)),i=1,a=1;return r.length>0&&(r.forEach((e=>{e.width&&(i/=e.width),e.height&&(a/=e.height)})),e.left!==void 0&&t.left!==void 0&&(e.left=i*e.left,t.left=i*t.left),e.top!==void 0&&t.top!==void 0&&(e.top=a*e.top,t.top=a*t.top)),{from:e,to:t}}calculateKeyframes(e,t,n=!1){let r={},i={},a=!1,o={};for(let n in t){let s=e[n],c=t[n];if(n in Un){let e=Un[n];if(s===void 0||c===void 0)continue;let t=e(s,c);t.transform!==void 0&&(o[n]=t.value,a=!0,r.transform=`${r.transform??``} ${t.transform}`,t.overrideFrom!==void 0&&Object.assign(r,t.overrideFrom))}else s!==c&&s!==void 0&&c!==void 0&&(a=!0,r[n]=s,i[n]=c)}return r.transformOrigin=i.transformOrigin=n?`center center`:`top left`,this.animatingProperties=o,a?[r,i]:void 0}async animate(e,t=this.options.keyframeOptions){this.start(),this.frames=e;let n=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=e=this.options.onFrames(this),this.log(`modified frames`,e)),e!==void 0)){this.log(`animate`,[e,t]),n=!0,this.webAnimation=this.element.animate(e,t);let r=this.getController();r?.add(this);try{await this.webAnimation.finished}catch{}r?.remove(this)}return this.didFinish(n),n}isAnimating(){return this.webAnimation?.playState===`running`||this.webAnimation?.pending}log(e,t){this.shouldLog&&!this.isDisabled()&&console.log(e,this.options.id,t)}}),Jn={core:{cancel:`<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
514
441
|
<path d="M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
515
442
|
</svg>
|
|
516
443
|
`,"check-circled-outline":`<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -520,12 +447,12 @@
|
|
|
520
447
|
`,check:`<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
521
448
|
<path d="M5 13L9 17L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
522
449
|
</svg>
|
|
523
|
-
`,"emoji-puzzled"
|
|
450
|
+
`,"emoji-puzzled":`<svg width="24px" height="24px" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" ><path d="M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M11.5 15.5s1.5-2 4.5-2 4.5 2 4.5 2M3 4c0-2.754 4-2.754 4 0 0 1.967-2 1.64-2 4M5 11.01l.01-.011" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.5 9a.5.5 0 110-1 .5.5 0 010 1zM10.5 9a.5.5 0 110-1 .5.5 0 010 1z" fill="#000" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>`,"info-empty":`<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
524
451
|
<path d="M12 11.5V16.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
525
452
|
<path d="M12 7.51L12.01 7.49889" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
526
453
|
<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
527
454
|
</svg>
|
|
528
|
-
`,loader
|
|
455
|
+
`,loader:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-loader"><line x1="12" y1="2" x2="12" y2="6"></line><line x1="12" y1="18" x2="12" y2="22"></line><line x1="4.93" y1="4.93" x2="7.76" y2="7.76"></line><line x1="16.24" y1="16.24" x2="19.07" y2="19.07"></line><line x1="2" y1="12" x2="6" y2="12"></line><line x1="18" y1="12" x2="22" y2="12"></line><line x1="4.93" y1="19.07" x2="7.76" y2="16.24"></line><line x1="16.24" y1="7.76" x2="19.07" y2="4.93"></line></svg>`,"minus-small":`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
|
529
456
|
<path stroke-linecap="round" stroke-linejoin="round" d="M18 12H6" />
|
|
530
457
|
</svg>
|
|
531
458
|
`,"more-horiz":`<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -546,7 +473,7 @@
|
|
|
546
473
|
<path d="M12 17.01L12.01 16.9989" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
547
474
|
<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
548
475
|
</svg>
|
|
549
|
-
`}}
|
|
476
|
+
`}},Yn=new Map,Xn={heroicons:{url:`https://cdn.jsdelivr.net/npm/heroicons@2.0.4/24/$prefix/$name.svg`,defaultPrefix:`outline`},iconoir:{url:`https://cdnjs.cloudflare.com/ajax/libs/iconoir/5.1.4/icons/$name.svg`},feathers:{url:`https://cdn.jsdelivr.net/npm/feather-icons@4.29.0/dist/icons/$name.svg`},lucide:{url:`https://cdn.jsdelivr.net/npm/lucide-static@0.16.29/icons/$name.svg`},material:{url:`https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.5/svg/$name/$prefix.svg`,defaultPrefix:`regular`},fontAwesome:{url:`https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/svgs/$prefix/$name.svg`,defaultPrefix:`regular`},custom:{url:``,defaultPrefix:``}},Zn=!1;function Qn(){Zn||(Xn.custom.url=document.querySelector(`[customIconLibraryPath]`)?.getAttribute(`customIconLibraryPath`)||``,Xn.custom.defaultPrefix=document.querySelector(`[customIconDefaultPrefix]`)?.getAttribute(`customIconDefaultPrefix`)||``,Xn.custom.url&&(Zn=!0))}var $n=sessionStorage.getItem(`sonicIconsCache`),er=$n?JSON.parse($n):{icons:{},names:[]},tr=100,nr=class{static{this.default={get:async e=>{let t=e.library;if(!e.name)return``;let n=e.name,r=Jn;if(t==`custom`&&Qn(),t&&t in Xn){let i=Xn[t],a=e.prefix||i.defaultPrefix||``,o=r[t]||{};r[t]=o;let s=a+`-`+n;if(o[s])return D(o[s]);let c=(i.url||``).replace(`$prefix`,a).replace(`$name`,n);if(er.icons[c]){let e=er.icons[c];if(/^\s*<svg[\s>]/i.test(e||``))return o[s]=e,D(e);delete er.icons[c]}if(!Yn.has(c)){let t=new Promise(async t=>{try{let e=await fetch(c);if(!e.ok){t(``);return}try{let n=e.headers.get(`content-type`)||``;if(!n.includes(`image/svg+xml`)&&!n.includes(`svg`)){t(``);return}let r=await e.text();t(/^\s*<svg[\s>]/i.test(r)?r:``)}catch{t(``)}}catch{tn(`concorde icon loading error`,e),t(``)}});Yn.set(c,t)}let l=await Yn.get(c);if(Yn.delete(c),o[s]=l||``,l&&/^\s*<svg[\s>]/i.test(l)&&(er.icons[c]=l,er.names.push(c)),er.names.length>tr){let e=er.names.shift();delete er.icons[e]}return sessionStorage.setItem(`sonicIconsCache`,JSON.stringify(er)),l?D(l):``}return D(r.core[e.name]||``)}}}},rr=`sonic-icon`,ir=class extends E{constructor(...e){super(...e),this.iconText=``,this.name=``,this.prefix=``,this.library=``}static{this.styles=y`
|
|
550
477
|
:host {
|
|
551
478
|
line-height: 0.1em;
|
|
552
479
|
width: fit-content;
|
|
@@ -596,7 +523,7 @@
|
|
|
596
523
|
:host([size="3xl"]) svg {
|
|
597
524
|
--_sc-icon-size: 2.8em;
|
|
598
525
|
}
|
|
599
|
-
|
|
526
|
+
`}async updateIcon(){this.iconText=await nr.default.get({name:this.name,prefix:this.prefix,library:this.library})}connectedCallback(){this.setAttribute(`aria-hidden`,`true`),super.connectedCallback()}willUpdate(e){(e.has(`name`)||e.has(`prefix`)||e.has(`library`))&&this.updateIcon(),super.willUpdate(e)}render(){return this.iconText?this.iconText:T}};O([x()],ir.prototype,`iconText`,void 0),O([b({type:String})],ir.prototype,`name`,void 0),O([b({type:String})],ir.prototype,`prefix`,void 0),O([b({type:String})],ir.prototype,`library`,void 0),ir=O([v(rr)],ir);var ar=y`
|
|
600
527
|
.custom-scroll {
|
|
601
528
|
overflow: auto !important;
|
|
602
529
|
overflow-y: overlay !important;
|
|
@@ -618,42 +545,7 @@
|
|
|
618
545
|
border: solid 0.15rem transparent;
|
|
619
546
|
}
|
|
620
547
|
}
|
|
621
|
-
|
|
622
|
-
class="sonic-toast ${this.status} ${this.ghost?"ghost":""}"
|
|
623
|
-
role=${this.getAriaRole()}
|
|
624
|
-
aria-live=${i||S}
|
|
625
|
-
aria-atomic="true"
|
|
626
|
-
aria-label=${t||S}
|
|
627
|
-
>
|
|
628
|
-
<button
|
|
629
|
-
aria-label=${this.getCloseButtonLabel()}
|
|
630
|
-
class="sonic-toast-close"
|
|
631
|
-
@click=${()=>this.hide()}
|
|
632
|
-
>
|
|
633
|
-
<sonic-icon name="cancel" size="lg"></sonic-icon>
|
|
634
|
-
</button>
|
|
635
|
-
<div
|
|
636
|
-
class="sonic-toast-content custom-scroll"
|
|
637
|
-
style="max-height: ${this.maxHeight} ;"
|
|
638
|
-
>
|
|
639
|
-
${this.status&&b`<sonic-icon
|
|
640
|
-
name=${_n[this.status]}
|
|
641
|
-
class="sonic-toast-icon"
|
|
642
|
-
size="2xl"
|
|
643
|
-
aria-hidden="true"
|
|
644
|
-
></sonic-icon>`}
|
|
645
|
-
|
|
646
|
-
<div class="sonic-toast-text">
|
|
647
|
-
${this.title?b`<div class="sonic-toast-title" id=${r}>
|
|
648
|
-
${this.title}
|
|
649
|
-
</div>`:""}
|
|
650
|
-
${this.text?F(this.text):""}
|
|
651
|
-
<slot></slot>
|
|
652
|
-
</div>
|
|
653
|
-
|
|
654
|
-
${this.preserve?"":this.autoHide()}
|
|
655
|
-
</div>
|
|
656
|
-
</div>`}hide(){if(Xt.getClosestElement(this,"sonic-toast")||(this.visible=!1),this.dismissForever){const r=localStorage.getItem("sonic-toast-dismissed")||"{}",t=JSON.parse(r);t[this.id]=!0,localStorage.setItem("sonic-toast-dismissed",JSON.stringify(t))}this.dispatchEvent(new CustomEvent("hide",{bubbles:!0}))}show(){this.visible=!0}autoHide(){setTimeout(()=>{this.hide()},6e3)}};yt.styles=[Ze,P`
|
|
548
|
+
`,or={warning:`warning-circled-outline`,success:`check-circled-outline`,error:`warning-circled-outline`,info:`info-empty`},sr=`sonic-toast-item`,I=class extends E{constructor(...e){super(...e),this.title=``,this.id=``,this.text=``,this.status=``,this.ghost=!1,this.preserve=!1,this.dismissForever=!1,this.maxHeight=`10rem`,this.visible=!0,this._titleId=``}static{this.styles=[ar,y`
|
|
657
549
|
* {
|
|
658
550
|
box-sizing: border-box;
|
|
659
551
|
}
|
|
@@ -833,7 +725,42 @@
|
|
|
833
725
|
opacity: 0.85;
|
|
834
726
|
pointer-events: none;
|
|
835
727
|
}
|
|
836
|
-
`]
|
|
728
|
+
`]}getAriaRole(){return this.status===`error`?`alert`:`status`}getAriaLive(){return this.status===`error`?null:`polite`}getTitleId(){return this._titleId||=this.id?`toast-title-${this.id}`:`toast-title-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,this._titleId}getCloseButtonLabel(){return this.status&&{error:`Fermer le message d'erreur`,warning:`Fermer l'avertissement`,success:`Fermer le message de succès`,info:`Fermer l'information`}[this.status]||`Fermer la notification`}render(){if(this.dismissForever){let e=localStorage.getItem(`sonic-toast-dismissed`)||`{}`;if(JSON.parse(e)[this.id])return T}if(!this.visible)return T;let e=this.title?this.getTitleId():void 0,t=!this.title&&this.text?this.text.length>100?this.text.substring(0,100).replace(/\s+\S*$/,``)+`...`:this.text:void 0,n=this.getAriaLive();return C`<div
|
|
729
|
+
class="sonic-toast ${this.status} ${this.ghost?`ghost`:``}"
|
|
730
|
+
role=${this.getAriaRole()}
|
|
731
|
+
aria-live=${n||T}
|
|
732
|
+
aria-atomic="true"
|
|
733
|
+
aria-label=${t||T}
|
|
734
|
+
>
|
|
735
|
+
<button
|
|
736
|
+
aria-label=${this.getCloseButtonLabel()}
|
|
737
|
+
class="sonic-toast-close"
|
|
738
|
+
@click=${()=>this.hide()}
|
|
739
|
+
>
|
|
740
|
+
<sonic-icon name="cancel" size="lg"></sonic-icon>
|
|
741
|
+
</button>
|
|
742
|
+
<div
|
|
743
|
+
class="sonic-toast-content custom-scroll"
|
|
744
|
+
style="max-height: ${this.maxHeight} ;"
|
|
745
|
+
>
|
|
746
|
+
${this.status&&C`<sonic-icon
|
|
747
|
+
name=${or[this.status]}
|
|
748
|
+
class="sonic-toast-icon"
|
|
749
|
+
size="2xl"
|
|
750
|
+
aria-hidden="true"
|
|
751
|
+
></sonic-icon>`}
|
|
752
|
+
|
|
753
|
+
<div class="sonic-toast-text">
|
|
754
|
+
${this.title?C`<div class="sonic-toast-title" id=${e}>
|
|
755
|
+
${this.title}
|
|
756
|
+
</div>`:``}
|
|
757
|
+
${this.text?D(this.text):``}
|
|
758
|
+
<slot></slot>
|
|
759
|
+
</div>
|
|
760
|
+
|
|
761
|
+
${this.preserve?``:this.autoHide()}
|
|
762
|
+
</div>
|
|
763
|
+
</div>`}hide(){if(Dn.getClosestElement(this,`sonic-toast`)||(this.visible=!1),this.dismissForever){let e=localStorage.getItem(`sonic-toast-dismissed`)||`{}`,t=JSON.parse(e);t[this.id]=!0,localStorage.setItem(`sonic-toast-dismissed`,JSON.stringify(t))}this.dispatchEvent(new CustomEvent(`hide`,{bubbles:!0}))}show(){this.visible=!0}autoHide(){setTimeout(()=>{this.hide()},6e3)}};O([b({type:String})],I.prototype,`title`,void 0),O([b({type:String})],I.prototype,`id`,void 0),O([b({type:String})],I.prototype,`text`,void 0),O([b({type:String})],I.prototype,`status`,void 0),O([b({type:Boolean})],I.prototype,`ghost`,void 0),O([b({type:Boolean})],I.prototype,`preserve`,void 0),O([b({type:Boolean})],I.prototype,`dismissForever`,void 0),O([b({type:String})],I.prototype,`maxHeight`,void 0),O([x()],I.prototype,`visible`,void 0),O([x()],I.prototype,`_titleId`,void 0),I=O([v(sr)],I);var cr=y`
|
|
837
764
|
:host {
|
|
838
765
|
/* POLICES */
|
|
839
766
|
/*
|
|
@@ -904,7 +831,7 @@
|
|
|
904
831
|
--sc-contrast-content: #fff;
|
|
905
832
|
--sc-contrast: #000000;
|
|
906
833
|
}
|
|
907
|
-
|
|
834
|
+
`,lr=y`
|
|
908
835
|
:host([theme="light"]) {
|
|
909
836
|
/*Boutons*/
|
|
910
837
|
--sc-primary: var(--sc-base-800);
|
|
@@ -933,7 +860,7 @@
|
|
|
933
860
|
--sc-base-900: #0f172a;
|
|
934
861
|
--sc-base-content: var(--sc-base-700);
|
|
935
862
|
}
|
|
936
|
-
`,
|
|
863
|
+
`,ur=y`
|
|
937
864
|
--sc-primary: var(--sc-dark-primary, var(--sc-base-700));
|
|
938
865
|
--sc-info: var(--sc-dark-info, #3abff8);
|
|
939
866
|
--sc-danger: var(--sc-dark-danger, #f87272);
|
|
@@ -958,17 +885,17 @@
|
|
|
958
885
|
--sc-base-800: var(--sc-dark-base-800, #d9dce0);
|
|
959
886
|
--sc-base-900: var(--sc-dark-base-900, #e5e7eb);
|
|
960
887
|
--sc-base-content: var(--sc-dark-base-content, #e5e7eb);
|
|
961
|
-
`,
|
|
888
|
+
`,dr=y`
|
|
962
889
|
:host([theme="dark"]) {
|
|
963
|
-
${
|
|
890
|
+
${ur}
|
|
964
891
|
}
|
|
965
892
|
|
|
966
893
|
@media (prefers-color-scheme: dark) {
|
|
967
894
|
:host([theme="auto"]) {
|
|
968
|
-
${
|
|
895
|
+
${ur}
|
|
969
896
|
}
|
|
970
897
|
}
|
|
971
|
-
|
|
898
|
+
`,fr,pr=`sonic-theme`,mr=class extends E{static{fr=this}static{this.styles=[lr,dr,cr,y`
|
|
972
899
|
:host([color]) {
|
|
973
900
|
color: var(--sc-base-content, #000);
|
|
974
901
|
}
|
|
@@ -1000,39 +927,35 @@
|
|
|
1000
927
|
transition-property: scale, opacity;
|
|
1001
928
|
transition-timing-function: cubic-bezier(0.25, 0.25, 0.42, 1.225);
|
|
1002
929
|
}
|
|
1003
|
-
`],
|
|
1004
|
-
${
|
|
930
|
+
`]}constructor(){super(),this.background=!1,this.color=!1,this.font=!1,fr.instance=this}static getPopContainer(){return fr.instance||document.body}connectedCallback(){super.connectedCallback(),window.addEventListener(`message`,e=>this.receiveMessage(e),!1),window.dispatchEvent(new CustomEvent(`SonicThemeReady`)),this.postCSSVars()}postCSSVars(){let e=document.styleSheets,t=e.length,n=[];for(let r=0;r<t;r++){let t=e[r];t.href&&(t.href.includes(`googleapis`)||t.href.includes(`typekit.net`))&&n.push(t.href)}let r={variables:this.getCssVariables(),fonts:n};_.get(`sonic-theme`)?.set(r),document.querySelectorAll(`iframe`).forEach(e=>e.contentWindow?.postMessage({type:`SonicTheme`,...r},`*`))}receiveMessage(e){let t=e.data;!t.type||t.type!=`GetSonicTheme`||this.postCSSVars()}getCssVariables(){let e=[],t=[...fr.styles.map(e=>e.styleSheet),...Array.from(document.styleSheets)];for(let n of t)try{if(!n)continue;let t=n.cssRules;for(let n of t){if(!(`style`in n))continue;let t=n.style;for(let n of t)e.includes(n)||n.indexOf(`--sc`)!==0||e.push(n)}}catch{console.warn(`Erreur lors de la récupération des variables CSS`)}let n=window.getComputedStyle(this),r={};return e.forEach(e=>r[e]=n.getPropertyValue(e)),r}render(){return C`<slot></slot>`}};O([b({type:String,reflect:!0})],mr.prototype,`theme`,void 0),O([b({type:Boolean,reflect:!0})],mr.prototype,`background`,void 0),O([b({type:Boolean,reflect:!0})],mr.prototype,`color`,void 0),O([b({type:Boolean,reflect:!0})],mr.prototype,`font`,void 0),mr=fr=O([v(pr)],mr);var L,hr=`sonic-toast`,R=class extends E{static{L=this}constructor(...e){super(...e),this.toasts=[]}static{this.delegateToasts=!1}createRenderRoot(){return this}render(){let e=window.parent!=window,t={pointerEvents:`none`,gap:`1rem`,display:`flex`,margin:this.toasts.length?`1rem`:`0`};return e||(t={...t,margin:`0`,width:`calc(100% - 2.5rem)`,position:`fixed`,bottom:`1.25rem`,right:`1.25rem`,zIndex:`10000`,maxWidth:`64ch`,flexDirection:`column-reverse`}),L.handleExistingToastDelegation(),this.toasts?C`<div style=${M(t)}>
|
|
931
|
+
${Fn(this.toasts,e=>e.id,t=>C`
|
|
1005
932
|
<sonic-toast-item
|
|
1006
|
-
maxHeight=${
|
|
1007
|
-
status=${
|
|
1008
|
-
title=${
|
|
1009
|
-
?ghost=${
|
|
1010
|
-
?dismissForever=${
|
|
1011
|
-
?preserve=${
|
|
1012
|
-
id=${
|
|
1013
|
-
@hide=${()=>this.removeItem(
|
|
1014
|
-
${
|
|
933
|
+
maxHeight=${e?`none`:`10rem`}
|
|
934
|
+
status=${N(t.status)}
|
|
935
|
+
title=${N(t.title)}
|
|
936
|
+
?ghost=${t.ghost}
|
|
937
|
+
?dismissForever=${t.dismissForever}
|
|
938
|
+
?preserve=${t.preserve}
|
|
939
|
+
id=${N(t.id)}
|
|
940
|
+
@hide=${()=>this.removeItem(t)}
|
|
941
|
+
${qn({keyframeOptions:{duration:250,easing:`cubic-bezier(0.250, 0.250, 0.420, 1.225)`},in:[{transform:`translateY(0) scale(1.25)`,boxShadow:`0 0 0 rgba(0,0,0,0)`,opacity:0}],out:[{transform:`scale(.90) `,opacity:0,duration:3e3,easing:`ease-in-out`}],stabilizeOut:!0})}
|
|
1015
942
|
>
|
|
1016
943
|
<!-- Le texte est passé dans le slot et non pas en propriété pour contrer des problèmatiques de shadow-dom et d'appel exterieur (exemple: fancybox) -->
|
|
1017
|
-
${
|
|
944
|
+
${t.text?D(t.text):``}
|
|
1018
945
|
</sonic-toast-item>
|
|
1019
946
|
`)}
|
|
1020
|
-
</div>`:
|
|
1021
|
-
* @license
|
|
1022
|
-
* Copyright 2020 Google LLC
|
|
1023
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1024
|
-
*/const Lt=Zt(class extends Se{constructor(r){if(super(r),r.type!==he.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.vt===r?vt:(this.vt=r,document.importNode(r.content,!0))}});var Un=Object.defineProperty,Vn=Object.getOwnPropertyDescriptor,_r=(r,t,i,s)=>{for(var e=s>1?void 0:s?Vn(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&Un(t,i,e),e};const Bn="sonic-fetch";let Ss=class extends hi(X(di(w))){renderLoader(){if(!(this.isLoading&&this.loader!==void 0))return S;const r=this.loader===!0||this.loader===""?"fixed":this.loader;return b`<sonic-loader mode=${r}></sonic-loader>`}renderSkeleton(){const r=this.templateParts.skeleton;return this.isLoading&&r?Lt(r):S}render(){return b`
|
|
1025
|
-
${this.renderSkeleton()} ${this.renderLoader()}
|
|
1026
|
-
${this.isLoading?S:b`<slot></slot>`}
|
|
1027
|
-
`}};Ss.styles=[P`
|
|
947
|
+
</div>`:T}static removeAll(){if(L.delegateToasts){L.handleExistingToastDelegation(),window.parent.postMessage({type:`removeAllToasts`},`*`);return}let e=L.getInstance();e&&(e.toasts=e.toasts.filter(e=>e.ghost))}static removeItemsByStatus(e){if(L.delegateToasts){L.handleExistingToastDelegation(),window.parent.postMessage({type:`removeItemsByStatus`,status:e},`*`);return}let t=L.getInstance();t&&(t.toasts=t.toasts.filter(t=>t.status!==e))}static removeTemporaryItems(){if(L.delegateToasts){L.handleExistingToastDelegation(),window.parent.postMessage({type:`removeTemporaryItems`},`*`);return}let e=L.getInstance();e&&(e.toasts=e.toasts.filter(e=>e.preserve))}static getInstance(){return L.instance?L.instance:(L.instance=document.createElement(`sonic-toast`),mr.getPopContainer().prepend(L.instance),L.instance)}static add(e){if(L.delegateToasts){L.handleExistingToastDelegation(),window.parent.postMessage({type:`addToast`,toast:e},`*`);return}let t=L.getInstance(),n=e.id??new Date().valueOf(),r=RegExp(`</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>`).test(e.text),i={id:n,text:e.text,title:e.title,status:e.status,preserve:r?!0:e.preserve,ghost:e.ghost,dismissForever:e.dismissForever};if(e.dismissForever&&e.id){let t=localStorage.getItem(`sonic-toast-dismissed`)||`{}`;if(JSON.parse(t)[e.id])return null}if(t?.toasts.length){let e={...i};for(let n of t.toasts){let t={...n};if(e.id=t.id=0,f.shallowEqual(e,t))return null}}return t&&(t.toasts=[...t.toasts,i]),i}static handleExistingToastDelegation(){if(!this.delegateToasts)return;let e=L.getInstance();window.parent.postMessage({type:`addToasts`,toasts:e.toasts},`*`),e.toasts=[]}static removeItem(e){if(L.delegateToasts){L.handleExistingToastDelegation(),window.parent.postMessage({type:`removeToast`,toast:e},`*`);return}let t=L.getInstance();t&&t.removeItem(e)}removeItem(e){e&&(this.toasts=this.toasts.filter(t=>(t={...t},delete t.id,!f.shallowEqual(t,e,!1))))}};O([b({type:Array})],R.prototype,`toasts`,void 0),R=L=O([v(hr)],R),typeof window<`u`&&(window[te+`Toast`]=window[te+`Toast`]||R);function gr(){let e=e=>{e.data.type==`querySonicToastAvailability`&&e.source.postMessage({type:`sonicToastAvailable`},`*`),e.data.type==`removeItemsByStatus`&&R.removeItemsByStatus(e.data.status),e.data.type==`removeTemporaryItems`&&R.removeTemporaryItems(),e.data.type==`sonicToastAvailable`&&(R.delegateToasts=!0,R.handleExistingToastDelegation()),e.data.type==`addToasts`&&(R.getInstance().toasts=[...R.getInstance().toasts,...e.data.toasts]),e.data.type==`removeAllToasts`&&R.removeAll(),e.data.type==`removeToast`&&R.removeItem(e.data.toast),e.data.type==`addToast`&&R.add(e.data.toast)},t=window.parent!=window;if(window.addEventListener(`message`,e,!1),t&&window.parent.postMessage({type:`querySonicToastAvailability`},`*`),!t)for(let e of document.querySelectorAll(`iframe`))e.contentWindow?.postMessage({type:`sonicToastAvailable`},`*`)}gr();var _r=new Set,vr=new Set,yr=e=>{for(let t of vr)t(e)},br=new Set,xr=0;u(async()=>{xr++;let e=xr,t=Array.from(br);for(;t.length>0;){if(e!=xr)return;let n=t.splice(0,4);await Promise.all(n.map(e=>e._fetchData()))}});var Sr=(e,t)=>{class n extends e{constructor(...e){super(),this.api=null,this.key=``,this.isFirstLoad=!0,this.isLoading=!1,this.iObserver=null,this.isFetchEnabled=!0,this.fetchedData=null,this._endPoint=``,this.noErrorsRecordings=!1,this.requestId=0,this.refetchEveryMs=0,this._isFetching=!1,this._mustRefetch=!1,this.dataProvider=``}get props(){return super.props}set props(e){super.props=e}set endPoint(e){this._endPoint=e,this.isConnected&&this._fetchData()}get endPoint(){return this._endPoint}handleStartFetching(){return this._isFetching?(this._mustRefetch=!0,`fetching`):(this._isFetching=!0,`okToFetch`)}handleEndFetching(){this._isFetching=!1,this._mustRefetch&&(this._mustRefetch=!1,this._fetchData())}async _fetchData(){if(this.requestUpdate(),!this.isFetchEnabled||(this.api=new Yt(this.getApiConfiguration()),!this.api)||(this.dispatchEvent(new CustomEvent(`loading`,{detail:this})),this.getAttribute(`localStorage`)===`enabled`&&await _.getInstance().isLocalStrorageReady,!this.isConnected))return;let e=_.getInstance().get(this.getAncestorAttributeValue(`headersDataProvider`)).get();if(this.isLoading=!0,f.isObject(this.props)&&Object.keys(this.props||{}).length>0&&this.isFirstLoad&&window.requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent(`load`,{detail:this})),this.isFirstLoad=!1,this.isLoading=!1}),this.handleStartFetching()===`fetching`)return;let t=null;try{t=await this.api.get(this.endPoint||this.dataProvider||``,e)}catch{}if(this.handleEndFetching(),this.fetchedData=t,this.api.lastResult&&!this.api.lastResult.ok&&(this.noErrorsRecordings||_r.add(this),yr(this.api.lastResult)),this.isConnected){if(t)t._sonic_http_response_&&!t._sonic_http_response_.ok&&Object.keys(t).length===1&&R.add({text:`Network Error`,status:`error`});else{this.isLoading=!1,this.refetchEveryMs&&this.isConnected&&(this.refetchTimeOutId=setTimeout(()=>this._fetchData(),this.refetchEveryMs));return}if(this.key){let e=t._sonic_http_response_,n=this.key.split(`.`);t=f.traverse(t,n,this.hasAttribute(`preserveOtherKeys`)),t&&f.isObject(t)&&e&&(t._sonic_http_response_=e)}this.props=t,this.dispatchEvent(new CustomEvent(`load`,{detail:this})),this.isFirstLoad=!1,this.isLoading=!1,this.refetchEveryMs&&this.isConnected&&(this.refetchTimeOutId=setTimeout(()=>this._fetchData(),this.refetchEveryMs))}}disconnectedCallback(){super.disconnectedCallback(),br.delete(this),this.publisher?.offInvalidate(this.onInvalidate),clearTimeout(this.refetchTimeOutId),this.isFirstLoad=!1}connectedCallback(){this.lazyLoad=this.lazyLoad===void 0?this.hasAttribute(`lazyload`):this.lazyLoad,br.add(this),super.connectedCallback(),this.isFetchEnabled&&(this.key=this.key==``?this.getAttribute(`key`):this.key,this.props&&this.publisher.set(this.props),this.onInvalidate=()=>this._fetchData(),this.publisher?.onInvalidate(this.onInvalidate),this.lazyLoad?this.handleLazyLoad():this._fetchData())}handleLazyLoad(){if(!this.lazyLoad)return;let e=parseFloat(this.getAttribute(`lazyBoundsRatio`)||`1`),t={root:null,rootMargin:Math.max(window.innerWidth*e,window.innerHeight*e)+`px`,threshold:.9};this.iObserver=new IntersectionObserver(e=>this.onIntersection(e),t);let n=[...(this.shadowRoot?this.shadowRoot:this).children].filter(e=>e.nodeName.toLowerCase()!=`style`)[0];if(n?.nodeName.toLocaleLowerCase()==`slot`&&(n=[...n.children].filter(e=>e.nodeName.toLowerCase()!=`style`)[0]),!n||n.nodeName.toLocaleLowerCase()==`template`){n=document.createElement(`div`);let e=n.style;e.pointerEvents=`none`,e.width=`1px`,e.height=`1px`,this.lazyLoadPlaceHolder=n,this.appendChild(n)}n?this.iObserver.observe(n):this.isFirstLoad&&this._fetchData()}onIntersection(e){for(let t of e)if(t.isIntersecting&&this.isFirstLoad){this._fetchData(),this.lazyLoadPlaceHolder?.remove(),this.lazyLoadPlaceHolder=void 0,this.iObserver?.disconnect();break}}}return O([b()],n.prototype,`noErrorsRecordings`,void 0),O([b()],n.prototype,`props`,null),O([b({type:String})],n.prototype,`endPoint`,null),O([b()],n.prototype,`requestId`,void 0),O([b({type:Number})],n.prototype,`refetchEveryMs`,void 0),n},Cr=e=>{class t extends e{constructor(...e){super(),this.forceAutoFill=!1,this._type=`text`,this.status=`default`}validateFormElement(){let e=this.shadowRoot?.querySelector(`input`);if(!e||e.checkValidity())return;let t=this.getFormPublisher();t&&(t.isFormValid=!1),e.reportValidity()}set type(e){this.hasAttribute(`type`)&&!this.forceAutoFill&&(e=this.getAttribute(`type`)),this._type=e,this.requestUpdate()}get type(){return this._type}get description(){return this._description}set description(e){this.hasAttribute(`description`)&&!this.forceAutoFill&&(e=this.getAttribute(`description`)),this._description=e,this.requestUpdate()}get label(){return this._label}set label(e){this.hasAttribute(`label`)&&!this.forceAutoFill&&(e=this.getAttribute(`label`)),this._label=e,this.requestUpdate()}}return O([b()],t.prototype,`forceAutoFill`,void 0),O([b({type:String})],t.prototype,`type`,null),O([b()],t.prototype,`description`,null),O([b()],t.prototype,`label`,null),O([b({type:String,reflect:!0})],t.prototype,`status`,void 0),O([b({type:Number})],t.prototype,`tabindex`,void 0),O([b({type:String})],t.prototype,`autocomplete`,void 0),t},wr=Sr,Tr=Mn,Er=gn,Dr=Cr,Or=k,kr=un;window[`concorde-mixins`]=window[`concorde-mixins`]||{},window[`concorde-mixins`]={Fetcher:wr,FormCheckable:Tr,FormElement:Er,FormInput:Dr,Subscriber:Or,TemplatesContainer:kr};var Ar=Lt(class extends Rt{constructor(e){if(super(e),e.type!==It.CHILD)throw Error(`templateContent can only be used in child bindings`)}render(e){return this.vt===e?w:(this.vt=e,document.importNode(e.content,!0))}}),jr=`sonic-fetch`,Mr=class extends Sr(k(kr(E))){static{this.styles=[y`
|
|
1028
948
|
:host {
|
|
1029
949
|
display: contents;
|
|
1030
950
|
}
|
|
1031
|
-
`]
|
|
951
|
+
`]}renderLoader(){return this.isLoading&&this.loader!==void 0?C`<sonic-loader mode=${this.loader===!0||this.loader===``?`fixed`:this.loader}></sonic-loader>`:T}renderSkeleton(){let e=this.templateParts.skeleton;return this.isLoading&&e?Ar(e):T}render(){return C`
|
|
952
|
+
${this.renderSkeleton()} ${this.renderLoader()}
|
|
953
|
+
${this.isLoading?T:C`<slot></slot>`}
|
|
954
|
+
`}};O([b()],Mr.prototype,`loader`,void 0),Mr=O([v(jr)],Mr);var Nr=`sonic-if`,Pr=class extends E{constructor(...e){super(...e),this.condition=!1}static{this.styles=y`
|
|
1032
955
|
:host {
|
|
1033
956
|
display: contents;
|
|
1034
957
|
}
|
|
1035
|
-
|
|
958
|
+
`}render(){return this.condition?C` <slot></slot> `:T}};O([b({type:Boolean})],Pr.prototype,`condition`,void 0),Pr=O([v(Nr)],Pr);var Fr=y`
|
|
1036
959
|
:host([align="left"]) .sonic-loader--inline {
|
|
1037
960
|
margin-left: 0;
|
|
1038
961
|
}
|
|
@@ -1099,7 +1022,7 @@
|
|
|
1099
1022
|
transform: translate(24px, 0);
|
|
1100
1023
|
}
|
|
1101
1024
|
}
|
|
1102
|
-
`,
|
|
1025
|
+
`,Ir=y`
|
|
1103
1026
|
@keyframes sonic-loader--fixed {
|
|
1104
1027
|
0% {
|
|
1105
1028
|
transform: scale(0);
|
|
@@ -1152,14 +1075,7 @@
|
|
|
1152
1075
|
height: 5rem;
|
|
1153
1076
|
animation: sonic-loader--fixed 1s 0s linear infinite;
|
|
1154
1077
|
}
|
|
1155
|
-
|
|
1156
|
-
class="sonic-loader sonic-loader--${this.mode} ${this.noDelay?"sonic-loader--nodelay":""} "
|
|
1157
|
-
>
|
|
1158
|
-
<div></div>
|
|
1159
|
-
<div></div>
|
|
1160
|
-
<div></div>
|
|
1161
|
-
<div></div>
|
|
1162
|
-
</div>`}};ot.styles=[Kn,Yn,P`
|
|
1078
|
+
`,Lr,Rr=`sonic-loader`,zr=class extends E{static{Lr=this}constructor(...e){super(...e),this.mode=`fixed`,this.noDelay=!1}static{this.styles=[Fr,Ir,y`
|
|
1163
1079
|
:host {
|
|
1164
1080
|
--sc-_loader-bg: var(--sc-primary, currentColor);
|
|
1165
1081
|
pointer-events: none;
|
|
@@ -1187,7 +1103,14 @@
|
|
|
1187
1103
|
opacity: 1;
|
|
1188
1104
|
}
|
|
1189
1105
|
}
|
|
1190
|
-
`]
|
|
1106
|
+
`]}static{this.callCounter=0}static show(e){Lr.loader||=document.createElement(`sonic-loader`);let t=Lr.loader;e||={},e.mode&&t.setAttribute(`mode`,e.mode),e.noDelay&&t.setAttribute(`noDelay`,``),e.container||(e.container=mr.getPopContainer(),e.mode=`fixed`),e.container.appendChild(t),Lr.callCounter++}static hide(){Lr.callCounter--,!(Lr.callCounter>0)&&Lr.loader&&Lr.loader.remove()}render(){return C`<div
|
|
1107
|
+
class="sonic-loader sonic-loader--${this.mode} ${this.noDelay?`sonic-loader--nodelay`:``} "
|
|
1108
|
+
>
|
|
1109
|
+
<div></div>
|
|
1110
|
+
<div></div>
|
|
1111
|
+
<div></div>
|
|
1112
|
+
<div></div>
|
|
1113
|
+
</div>`}};O([b({type:String})],zr.prototype,`mode`,void 0),O([b({type:Boolean})],zr.prototype,`noDelay`,void 0),zr=Lr=O([v(Rr)],zr);var Br=`sonic-subscriber`,Vr=class extends k(E){constructor(...e){super(...e),this.noAutofill=!0}connectedCallback(){this.noShadowDom=``,super.connectedCallback()}updated(e){super.updated(e),this.children.length==0?this.style.display=`none`:this.style.display=`contents`}render(){return C`<slot></slot> `}};Vr=O([v(Br)],Vr);var Hr=`sonic-list`,z=class extends Sr(k(un(E))){constructor(...e){super(...e),this.templateKey=`template`,this.idKey=`id`,this.limit=1/0,this.offset=0,this.loadingSize={width:0,height:0}}get items(){return this._items}set items(e){typeof e!=`function`&&e!==void 0||(this._items=e,this.requestUpdate())}connectedCallback(){this.noShadowDom=``,this.defferedDebug=this.hasAttribute(`debug`)||null,this.isFetchEnabled=this.hasAttribute(`fetch`),this.isFetchEnabled&&(this.isLoading=!0),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}renderLoader(){return!(this.isLoading&&this.loader!==void 0)||this.templateParts.skeleton?T:C`<sonic-loader mode=${this.loader===!0||this.loader===``?`fixed`:this.loader}></sonic-loader>`}renderSkeleton(){if(this.skeleton)return this.skeleton();let e=this.templateParts.skeleton;return this.isLoading&&e?Ar(e):T}renderSeparator(){if(this.separator)return this.separator();let e=this.templateParts.separator;return e?Ar(e):T}renderLoadingState(){return C`${this.renderSkeleton()} ${this.renderLoader()} `}renderNoResultState(){return C` <div
|
|
1191
1114
|
style="color: var(--sc-base-400);
|
|
1192
1115
|
font-size: 1.5em;
|
|
1193
1116
|
margin: 4rem 0;
|
|
@@ -1196,45 +1119,41 @@
|
|
|
1196
1119
|
>
|
|
1197
1120
|
<sonic-icon name="emoji-puzzled" size="lg"></sonic-icon
|
|
1198
1121
|
><span class="sonic-no-result-text"
|
|
1199
|
-
>${typeof this.props
|
|
1122
|
+
>${typeof this.props==`string`&&this.props==``?`Aucun résultat`:this.props}</span
|
|
1200
1123
|
>
|
|
1201
|
-
</div>`}formatProps(){let
|
|
1124
|
+
</div>`}formatProps(){let e=this.props;if(e==null)return null;let t=e._sonic_http_response_,n=this.hasAttribute(`extractValues`);return Array.isArray(e)||(e=n?Object.entries(e).map(([e,t])=>({key:e,value:t})):f.isObject(e)&&Object.keys(e).length>0&&(!t||t.ok)?[e]:[]),e=e.filter(e=>e!=null),t&&(e._sonic_http_response_=t),e}updated(e){window.requestAnimationFrame(()=>{if(!this.isLoading){this.style.setProperty(`--list-loader-height-display`,`none`);return}this.style.setProperty(`--list-loader-height-display`,`block`),this.loadingSize=this.getDisplayContentsSize(this)}),super.updated(e)}getAllRenderableElements(e){let t=[];function n(e){if(e.nodeType===Node.ELEMENT_NODE){let r=e.getBoundingClientRect();(r.width>0||r.height>0)&&t.push(e),e.childNodes.forEach(n),e.shadowRoot&&e.shadowRoot.childNodes.forEach(n)}}return n(e),t}getDisplayContentsSize(e){let t=this.getAllRenderableElements(e);if(t.length===0)return{width:0,height:0};let n=t.map(e=>e.getBoundingClientRect()),r=Math.min(...n.map(e=>e.left)),i=Math.max(...n.map(e=>e.right)),a=Math.min(...n.map(e=>e.top)),o=Math.max(...n.map(e=>e.bottom));return{width:i-r,height:o-a}}render(){return C`
|
|
1202
1125
|
${this.renderContent()}
|
|
1203
1126
|
<div
|
|
1204
1127
|
style="grid-column: 1 / -1;min-height:${this.isLoading?0:this.loadingSize.height}px; width:0;float:left;display: var(--list-loader-height-display);"
|
|
1205
1128
|
></div>
|
|
1206
|
-
`}handleProgrammaticTemplates(
|
|
1129
|
+
`}handleProgrammaticTemplates(e,t,n){return this.items?C`<sonic-subscriber
|
|
1207
1130
|
?debug=${this.defferedDebug===!0}
|
|
1208
|
-
.bindPublisher=${()=>this.publisher[
|
|
1131
|
+
.bindPublisher=${()=>this.publisher[n]}
|
|
1209
1132
|
.propertyMap?=${this.itemPropertyMap}
|
|
1210
|
-
dataProvider="${this.dataProvider}/list-item/${
|
|
1133
|
+
dataProvider="${this.dataProvider}/list-item/${n}"
|
|
1211
1134
|
>
|
|
1212
|
-
${this.items(
|
|
1213
|
-
</sonic-subscriber>`:null}renderContent(){if(this.isLoading&&!Array.isArray(this.props))return this.renderLoadingState();if(typeof this.props
|
|
1214
|
-
${
|
|
1135
|
+
${this.items(e,t)}
|
|
1136
|
+
</sonic-subscriber>`:null}renderContent(){if(this.isLoading&&!Array.isArray(this.props))return this.renderLoadingState();if(typeof this.props==`string`)return this.renderNoResultState();if(!f.isObject(this.props))return C`<div></div>`;let e=this.formatProps();if((e?.length||0)==0){if(this.noItems)return this.noItems();if(this.templateParts[`no-items`]=this.templateParts[`no-items`]||this.templateParts[`no-item`],this.templateParts[`no-items`])return Ar(this.templateParts[`no-items`])}let t=this.templateList.length,n=-1,r=this.hasAttribute(`extractValues`),i=this.renderSeparator(),a=e?.length||0;return C`
|
|
1137
|
+
${(e?.slice(this.offset,this.offset+this.limit))?.map((e,o)=>{if(e==null)return T;let s=o,c=null;if(typeof e==`object`&&!Array.isArray(e)){r&&(s=e?.key);let t=e[this.templateKey];t&&typeof t==`string`&&(c=this.templateParts[t])}if(s==`_sonic_http_response_`||typeof s!=`string`&&typeof s!=`number`)return T;let l=o>=a-1,u=o%2,d=this.publisher[s],f={key:s,even:u==0,odd:u==1,onlyChild:a==1,firstChild:o==0,lastChild:l};d._key_=s+``,d._metadata_={...d._metadata_.get(),...f};let p=this.handleProgrammaticTemplates(e,f,s);return p?C`${p}${l?T:i}`:(n++,c&&(n=-1),C`
|
|
1215
1138
|
<sonic-subscriber
|
|
1216
1139
|
?debug=${this.defferedDebug===!0}
|
|
1217
|
-
.bindPublisher=${function(){return
|
|
1140
|
+
.bindPublisher=${function(){return d}}
|
|
1218
1141
|
.propertyMap?=${this.itemPropertyMap}
|
|
1219
|
-
dataProvider="${this.dataProvider}/list-item/${
|
|
1142
|
+
dataProvider="${this.dataProvider}/list-item/${s}"
|
|
1220
1143
|
>
|
|
1221
|
-
${
|
|
1144
|
+
${Ar(c||this.templateList[n%t])}
|
|
1222
1145
|
</sonic-subscriber>
|
|
1223
|
-
${
|
|
1146
|
+
${l?T:i}
|
|
1224
1147
|
`)})}
|
|
1225
|
-
`}};
|
|
1226
|
-
|
|
1227
|
-
* Copyright 2021 Google LLC
|
|
1228
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
1229
|
-
*/function*$r(r,t){if(r!==void 0){let i=0;for(const s of r)yield t(s,i++)}}var ra=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,st=(r,t,i,s)=>{for(var e=s>1?void 0:s?oa(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&ra(t,i,e),e};const na="sonic-queue";let G=class extends X(w){constructor(){super(...arguments),this.templates=null,this.items=null,this.noItems=null,this.skeleton=null,this.lastRequestTime=0,this.key="",this.itemPropertyMap=null,this.cache="default",this.targetRequestDuration=500,this.limit=5,this.lazyBoundsRatio=1,this.offset=0,this.resultCount=0,this.noLazyload=!1,this.loader="inline",this.filteredFields="",this.instanceId=0,this.localStorage="disabled",this.filterPublisher=null,this.filterTimeoutMs=400,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.updateFilteredContent=()=>{const t=this.dataProviderExpression.split("?");t.shift();const i=new URLSearchParams(t.join("?")),s=this.filterPublisher?.get(),e=this.filteredFields.split(" ");for(const n in s){let l=s[n];Array.isArray(l)&&(l=l.filter(c=>c!==null)),!(this.filteredFields&&!e.includes(n)||l==null||l.toString()==="")&&i.set(n,s[n].toString())}const o=i.toString();if(!(o==this.searchHash&&!this.isFirstRequest)){this.searchHash=o;for(const n of this.listDataProviders)k.delete(n);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout(async()=>{const n=this.resultCount;this.props=null,this.requestId++,this.resultCount=n,await k.getInstance().isLocalStrorageReady,window.requestAnimationFrame(()=>this.next())},this.isFirstRequest?0:this.filterTimeoutMs),this.isFirstRequest=!1}},this.dataProviderExpression="",this.invalidateOnPageShow=!1,this.idKey="id",this.listDataProviders=[],this.nextHadEvent=!1,this.storedScrollY=0,this.storedScrollX=0}disconnectedCallback(){for(const r of this.listDataProviders)k.delete(r),this.listDataProviders=[];this.filterPublisher?.offInternalMutation(this.updateFilteredContent),this.props=null,this.limit=5,this.offset=0,this.resultCount=0,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.nextHadEvent=!1,this.publisher.set({}),super.disconnectedCallback()}async connectedCallback(){this.instanceId=G.instanceCounter++,this.localStorage=this.getAttribute("localStorage")||this.localStorage,this.filterTimeoutMs=parseInt(this.getAttribute("filterTimeoutMs")||"400"),this.removeAttribute("localStorage"),this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.dataProvider||(this.dataProvider=this.dataProviderExpression||"sonic-queue-"+this.instanceId+"-"+Math.random().toString(36).substring(7)),this.dataProviderExpression||(this.dataProviderExpression=Xt.getAncestorAttributeValue(this.parentElement,"dataProvider")||""),this.storeScrollPosition(),super.connectedCallback(),this.publisher.set({}),this.key=this.getAttribute("key"),await k.getInstance().isLocalStrorageReady,this.templates||(this.templates=Array.from(this.querySelectorAll("template"))),this.lastRequestTime=new Date().getTime(),this.configFilter()}configFilter(){const r=this.getAncestorAttributeValue("dataFilterProvider");if(!r){this.next();return}this.filterPublisher=k.getInstance().get(r),this.filterPublisher?.onInternalMutation(this.updateFilteredContent)}storeScrollPosition(){this.isSafari()&&(this.storedScrollX=window.scrollX,this.storedScrollY=window.scrollY)}isSafari(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}updated(r){this.isSafari()&&((Math.abs(this.storedScrollX-window.scrollX)>10||Math.abs(this.storedScrollY-window.scrollY)>10)&&window.scrollTo(this.storedScrollX,this.storedScrollY),window.requestAnimationFrame(()=>{(Math.abs(this.storedScrollX-window.scrollX)>10||Math.abs(this.storedScrollY-window.scrollY)>10)&&window.scrollTo(this.storedScrollX,this.storedScrollY)})),super.updated(r)}resetDuration(){this.lastRequestTime=new Date().getTime()}next(r){let t=this.offset;const s=new Date().getTime()-this.lastRequestTime;if(!this.nextHadEvent&&r&&(this.publisher.resultCount=0,this.resultCount=0),this.nextHadEvent=!!r,r){if(this.publisher.lastFetchedData=r.detail.fetchedData,r.detail.requestId<this.requestId)return;if(this.resultCount+=r.detail.props?.length||0,!r.detail.isFirstLoad||!r.detail.props?.length||this.dataProviderExpression.indexOf("$offset")==-1){this.publisher.resultCount=this.resultCount;return}}if(Array.isArray(this.props)){const d=this.props,g=d[d.length-1];t=parseInt(g.offset.toString())+parseInt(g.limit.toString())}else{const d=[];d.resultCount=this.resultCount,d.lastFetchedData=r?.detail.fetchedData||{},this.props=d}s>0&&r&&!this.localStorage&&(this.limit=Math.round(this.limit/s*this.targetRequestDuration)),this.limit<1&&(this.limit=1),this.limit>15&&(this.limit=15);let e=this.dataProviderExpression.replace("$offset",t+"").replace("$limit",this.limit+"");const o=e.split("?");let n=o.shift();const l=new URLSearchParams(o.join("?")),c=this.filterPublisher?.get(),h=this.filteredFields.split(" ");for(const d in c)this.filteredFields&&h.includes(d)||c[d]==null||c[d]==""||l.set(d,c[d]);this.searchHash||(this.searchHash=l.toString()),n=n+"?"+l.toString(),e=e+"_item_from_queue_"+this.instanceId,this.listDataProviders.push(e);const u=[...this.props,{id:l.toString()+"/"+this.props.length,dataProvider:e,endPoint:n,offset:t,limit:this.limit}];u.resultCount=this.resultCount,u.lastFetchedData=r?.detail.fetchedData||{},this.props=u,this.lastRequestTime=new Date().getTime()}render(){if(this.storeScrollPosition(),!Array.isArray(this.props))return S;let r=!this.noLazyload;return this.props.length==1&&(r=!1),this.style.display="block",b`
|
|
1230
|
-
${$r(this.props,(t,i)=>{const s=i==0?this.templates:this.templates?.filter(e=>e.getAttribute("data-value")!="no-item");return b`
|
|
1148
|
+
`}};O([b({type:Object})],z.prototype,`itemPropertyMap`,void 0),O([b({type:String})],z.prototype,`templateKey`,void 0),O([b({type:String})],z.prototype,`idKey`,void 0),O([b()],z.prototype,`loader`,void 0),O([b()],z.prototype,`limit`,void 0),O([b()],z.prototype,`offset`,void 0),O([b({type:Function})],z.prototype,`items`,null),O([b({type:Function})],z.prototype,`noItems`,void 0),O([b({type:Function})],z.prototype,`skeleton`,void 0),O([b({type:Function})],z.prototype,`separator`,void 0),z=O([v(Hr)],z);function*Ur(e,t){if(e!==void 0){let n=0;for(let r of e)yield t(r,n++)}}var Wr,Gr=`sonic-queue`,B=class extends k(E,{}){static{Wr=this}constructor(...e){super(...e),this.templates=null,this.items=null,this.noItems=null,this.skeleton=null,this.lastRequestTime=0,this.key=``,this.itemPropertyMap=null,this.cache=`default`,this.targetRequestDuration=500,this.limit=5,this.lazyBoundsRatio=1,this.offset=0,this.resultCount=0,this.noLazyload=!1,this.loader=`inline`,this.filteredFields=``,this.instanceId=0,this.localStorage=`disabled`,this.filterPublisher=null,this.filterTimeoutMs=400,this.searchHash=``,this.requestId=0,this.isFirstRequest=!0,this.updateFilteredContent=()=>{let e=this.dataProviderExpression.split(`?`);e.shift();let t=new URLSearchParams(e.join(`?`)),n=this.filterPublisher?.get(),r=this.filteredFields.split(` `);for(let e in n){let i=n[e];Array.isArray(i)&&(i=i.filter(e=>e!==null)),!(this.filteredFields&&!r.includes(e)||i==null||i.toString()===``)&&t.set(e,n[e].toString())}let i=t.toString();if(!(i==this.searchHash&&!this.isFirstRequest)){this.searchHash=i;for(let e of this.listDataProviders)_.delete(e);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout(async()=>{let e=this.resultCount;this.props=null,this.requestId++,this.resultCount=e,await _.getInstance().isLocalStrorageReady,window.requestAnimationFrame(()=>this.next())},this.isFirstRequest?0:this.filterTimeoutMs),this.isFirstRequest=!1}},this.dataProviderExpression=``,this.invalidateOnPageShow=!1,this.idKey=`id`,this.listDataProviders=[],this.nextHadEvent=!1,this.storedScrollY=0,this.storedScrollX=0}disconnectedCallback(){for(let e of this.listDataProviders)_.delete(e),this.listDataProviders=[];this.filterPublisher?.offInternalMutation(this.updateFilteredContent),this.props=null,this.limit=5,this.offset=0,this.resultCount=0,this.searchHash=``,this.requestId=0,this.isFirstRequest=!0,this.nextHadEvent=!1,this.publisher.set({}),super.disconnectedCallback()}static{this.instanceCounter=0}async connectedCallback(){this.instanceId=Wr.instanceCounter++,this.localStorage=this.getAttribute(`localStorage`)||this.localStorage,this.filterTimeoutMs=parseInt(this.getAttribute(`filterTimeoutMs`)||`400`),this.removeAttribute(`localStorage`),this.noShadowDom=``,this.defferedDebug=this.hasAttribute(`debug`)||null,this.dataProvider||=this.dataProviderExpression||`sonic-queue-`+this.instanceId+`-`+Math.random().toString(36).substring(7),this.dataProviderExpression||=Dn.getAncestorAttributeValue(this.parentElement,`dataProvider`)||``,this.storeScrollPosition(),super.connectedCallback(),this.publisher.set({}),this.key=this.getAttribute(`key`),await _.getInstance().isLocalStrorageReady,this.templates||=Array.from(this.querySelectorAll(`template`)),this.lastRequestTime=new Date().getTime(),this.configFilter()}configFilter(){let e=this.getAncestorAttributeValue(`dataFilterProvider`);if(!e){this.next();return}this.filterPublisher=_.getInstance().get(e),this.filterPublisher?.onInternalMutation(this.updateFilteredContent)}storeScrollPosition(){this.isSafari()&&(this.storedScrollX=window.scrollX,this.storedScrollY=window.scrollY)}isSafari(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}updated(e){this.isSafari()&&((Math.abs(this.storedScrollX-window.scrollX)>10||Math.abs(this.storedScrollY-window.scrollY)>10)&&window.scrollTo(this.storedScrollX,this.storedScrollY),window.requestAnimationFrame(()=>{(Math.abs(this.storedScrollX-window.scrollX)>10||Math.abs(this.storedScrollY-window.scrollY)>10)&&window.scrollTo(this.storedScrollX,this.storedScrollY)})),super.updated(e)}resetDuration(){this.lastRequestTime=new Date().getTime()}next(e){let t=this.offset,n=new Date().getTime()-this.lastRequestTime;if(!this.nextHadEvent&&e&&(this.publisher.resultCount=0,this.resultCount=0),this.nextHadEvent=!!e,e){if(this.publisher.lastFetchedData=e.detail.fetchedData,e.detail.requestId<this.requestId)return;if(this.resultCount+=e.detail.props?.length||0,!e.detail.isFirstLoad||!e.detail.props?.length||this.dataProviderExpression.indexOf(`$offset`)==-1){this.publisher.resultCount=this.resultCount;return}}if(Array.isArray(this.props)){let e=this.props,n=e[e.length-1];t=parseInt(n.offset.toString())+parseInt(n.limit.toString())}else{let t=[];t.resultCount=this.resultCount,t.lastFetchedData=e?.detail.fetchedData||{},this.props=t}n>0&&e&&!this.localStorage&&(this.limit=Math.round(this.limit/n*this.targetRequestDuration)),this.limit<1&&(this.limit=1),this.limit>15&&(this.limit=15);let r=this.dataProviderExpression.replace(`$offset`,t+``).replace(`$limit`,this.limit+``),i=r.split(`?`),a=i.shift(),o=new URLSearchParams(i.join(`?`)),s=this.filterPublisher?.get(),c=this.filteredFields.split(` `);for(let e in s)this.filteredFields&&c.includes(e)||s[e]==null||s[e]==``||o.set(e,s[e]);this.searchHash||=o.toString(),a=a+`?`+o.toString(),r=r+`_item_from_queue_`+this.instanceId,this.listDataProviders.push(r);let l=[...this.props,{id:o.toString()+`/`+this.props.length,dataProvider:r,endPoint:a,offset:t,limit:this.limit}];l.resultCount=this.resultCount,l.lastFetchedData=e?.detail.fetchedData||{},this.props=l,this.lastRequestTime=new Date().getTime()}render(){if(this.storeScrollPosition(),!Array.isArray(this.props))return T;let e=!this.noLazyload;return this.props.length==1&&(e=!1),this.style.display=`block`,C`
|
|
1149
|
+
${Ur(this.props,(t,n)=>{let r=n==0?this.templates:this.templates?.filter(e=>e.getAttribute(`data-value`)!=`no-item`);return C`
|
|
1231
1150
|
<sonic-list
|
|
1232
1151
|
fetch
|
|
1233
1152
|
loader="${this.loader}"
|
|
1234
1153
|
cache=${this.cache}
|
|
1235
1154
|
displayContents
|
|
1236
1155
|
lazyBoundsRatio=${this.lazyBoundsRatio}
|
|
1237
|
-
?lazyload=${
|
|
1156
|
+
?lazyload=${e}
|
|
1238
1157
|
?invalidateOnPageShow=${this.invalidateOnPageShow}
|
|
1239
1158
|
localStorage=${this.localStorage}
|
|
1240
1159
|
requestId=${this.requestId}
|
|
@@ -1246,39 +1165,39 @@
|
|
|
1246
1165
|
dataProvider="${t.dataProvider}"
|
|
1247
1166
|
endPoint="${t.endPoint}"
|
|
1248
1167
|
idKey=${this.idKey}
|
|
1249
|
-
.templates=${
|
|
1168
|
+
.templates=${r}
|
|
1250
1169
|
.items=${this.items}
|
|
1251
|
-
.noItems=${
|
|
1170
|
+
.noItems=${n==0?this.noItems:void 0}
|
|
1252
1171
|
.skeleton=${this.skeleton}
|
|
1253
1172
|
>
|
|
1254
1173
|
</sonic-list>
|
|
1255
1174
|
`})}
|
|
1256
|
-
`}};
|
|
1175
|
+
`}};O([b({type:Array})],B.prototype,`templates`,void 0),O([b({type:Function})],B.prototype,`items`,void 0),O([b({type:Function})],B.prototype,`noItems`,void 0),O([b({type:Function})],B.prototype,`skeleton`,void 0),O([b({type:Object})],B.prototype,`itemPropertyMap`,void 0),O([b()],B.prototype,`cache`,void 0),O([b()],B.prototype,`targetRequestDuration`,void 0),O([b()],B.prototype,`limit`,void 0),O([b()],B.prototype,`lazyBoundsRatio`,void 0),O([b()],B.prototype,`offset`,void 0),O([b()],B.prototype,`resultCount`,void 0),O([b({type:Boolean})],B.prototype,`noLazyload`,void 0),O([b({type:String})],B.prototype,`loader`,void 0),O([b()],B.prototype,`filteredFields`,void 0),O([b({type:String})],B.prototype,`dataProviderExpression`,void 0),O([b({type:Boolean})],B.prototype,`invalidateOnPageShow`,void 0),O([b({type:String})],B.prototype,`idKey`,void 0),B=Wr=O([v(Gr)],B);var Kr=`sonic-submit`,qr=class extends k(E){constructor(...e){super(...e),this.submitResultKey=null,this.disabled=!1,this.endPoint=null,this.name=``,this.value=``,this.api=null,this.clickTimeStamp=0,this.submit=async e=>{if(this.disabled||e instanceof KeyboardEvent&&e.key!==`Enter`)return;e instanceof MouseEvent&&e.stopPropagation();let t=_.getInstance().get(this.getAncestorAttributeValue(`formDataProvider`));if(t.isFormValid.set(!0),t.invalidateForm(),!t.isFormValid.get())return;if(this.disabled=!0,zr.show(),t.isFormValid,this.hasAttribute(`native`)){this.submitNativeForm();return}let n=this.getAttribute(`method`)?.toLocaleLowerCase()||`post`,r=this.hasAttribute(`sendAsFormData`),i=t.get();delete i.isFormValid;let a=this.getAncestorAttributeValue(`headersDataProvider`),o=a?_.getInstance().get(a):null,s={};o&&(s=o.get());let c=null,l=this.getAncestorAttributeValue(`dataProvider`),u=this.endPoint||l,d=async()=>{let e={...i};if(delete e.needsCaptchaValidation,delete s.needsCaptchaValidation,r)c=await this.api?.submitFormData(u,e,n,s);else switch(n){case`put`:c=await this.api?.put(u,e,s);break;case`patch`:c=await this.api?.patch(u,e,s);break;case`delete`:c=await this.api?.delete(u,e,s);break;case`get`:let t=new URLSearchParams;if(e)for(let n in e)t.append(n,e[n]);let n=`?`+t.toString();c=await this.api?.get(u+n,s);break;default:c=await this.api?.post(u,e,s);break}zr.hide(),c?c._sonic_http_response_&&!c._sonic_http_response_.ok&&Object.keys(c).length===1&&(c.messages=[{content:`Network Error`,status:`error`}]):c={messages:[{content:`Network Error`,status:`error`}]};let t=this.getAncestorAttributeValue(`clearedDataOnSuccess`);t&&t.split(` `).forEach(e=>_.get(e).set({}));let a=this.hasAttribute(`usernameKey`)?this.getAttribute(`usernameKey`):`username`,o=this.hasAttribute(`passwordKey`)?this.getAttribute(`passwordKey`):`password`;this.api?.lastResult?.ok&&e[a]&&e[o]&&this.saveCredentials(e[a],e[o]),this.submitResultKey&&(c=f.traverse(c,this.submitResultKey.split(`.`),!0));let l=this.getAncestorAttributeValue(`submitResultDataProvider`);l&&_.get(l).set(c),this.disabled=!1,this.dispatchEvent(new CustomEvent(`submit`,{detail:c,bubbles:!0,composed:!0}))},p=o?.needsCaptchaValidation.get()?o:t.needsCaptchaValidation.get()?t:null;if(p){p.captchaToken.set(`request_token`);let e=t=>{t==`request_token`?(zr.hide(),this.disabled=!1):(d(),p.captchaToken.offAssign(e))};p.captchaToken.onAssign(e)}else d()}}static{this.styles=y`
|
|
1257
1176
|
[data-disabled] {
|
|
1258
1177
|
opacity: 0.3;
|
|
1259
1178
|
pointer-events: none;
|
|
1260
1179
|
user-select: none;
|
|
1261
1180
|
}
|
|
1262
|
-
`,
|
|
1181
|
+
`}connectedCallback(){this.hasAttribute(`onClick`)&&this.addEventListener(`click`,this.submit),this.hasAttribute(`onEnterKey`)&&this.addEventListener(`keydown`,this.submit),super.connectedCallback(),this.api=new Yt(this.getApiConfiguration())}submitNativeForm(){let e=Dn.getClosestForm(this);if(!e)return;let t=this.getAncestorAttributeValue(`formDataProvider`),n={..._.get(t).get()};delete n.needsCaptchaValidation;for(let t in n){if(t==`isFormValid`)continue;let r=e.querySelector(`input[name="`+t+`"], select[name="`+t+`"], textarea[name="`+t+`"]`);r||(r=document.createElement(`input`),r.type=`hidden`,r.name=t,e.appendChild(r));let i=n[t];Array.isArray(i)&&(i=i.join(`,`)),r.type===`checkbox`||r.type===`radio`?i&&(r.checked=!0):r.value=i}let r=document.createElement(`input`);r.name=this.name,r.style.display=`none`,r.value=this.value,r.type=`submit`,e.appendChild(r),r&&r.click()}async saveCredentials(e,t){if(`PasswordCredential`in window){let n=new window.PasswordCredential({id:e,password:t});await navigator.credentials.store(n)}}render(){return C`<div ?data-disabled=${this.disabled}><slot></slot></div>`}};O([b({type:String})],qr.prototype,`submitResultKey`,void 0),O([b({type:Boolean})],qr.prototype,`disabled`,void 0),O([b({type:String})],qr.prototype,`endPoint`,void 0),O([b()],qr.prototype,`name`,void 0),O([b()],qr.prototype,`value`,void 0),qr=O([v(Kr)],qr);var Jr=`sonic-router`,Yr=class extends un(E){constructor(...e){super(...e),this.templateValueAttribute=`data-route`,this._location=document.location.href.replace(document.location.origin,``)}createRenderRoot(){return this}connectedCallback(){j.onChange(this),super.connectedCallback()}disconnectedCallback(){j.offChange(this),super.disconnectedCallback()}set location(e){this._location=e,this.requestUpdate()}get location(){return this._location}get cleanLocation(){let e=new URL(this.location,document.location.origin);return e.pathname+e.hash}get patternBasePath(){return this.basePath===void 0?`(/)*`:this.basePath}get regExpBasePath(){return this.basePath===void 0?``:`^`+this.basePath}handleroutes(){if(!this.routes)return[];let e=[];for(let[t,n]of Object.entries(this.routes)){if(t===`fallback`||!n)continue;let r=new RegExp(this.regExpBasePath+t);if(r.test(this.cleanLocation)){let i=r.exec(this.cleanLocation)||[t];i.shift(),e.push(n([...i]))}else try{let r=new vn(this.patternBasePath+t).match(this.cleanLocation);if(r){let t=r||{};e.push(n(t))}}catch{this.cleanLocation.indexOf((this.basePath||``)+t.replace(document.location.origin,``))!=-1&&e.push(n({}))}}return e.length==0&&this.routes?.fallback&&this.isConnected&&e.push(this.routes.fallback()),e}render(){let e=this.handleroutes();if(e.length>0)return C`${e}`;let t=[];for(let e of this.templatePartsList){let n=e.getAttribute(this.templateValueAttribute)||``;if(new RegExp(this.regExpBasePath+n).test(this.cleanLocation))t.push(e);else try{new vn(this.patternBasePath+n+`(/*)`).match(this.cleanLocation)&&(e.setAttribute(`mode`,`patternMatching`),t.push(e))}catch{this.cleanLocation.indexOf((this.basePath||``)+n.replace(document.location.origin,``))!=-1&&t.push(e)}}if(t.length==0){this.fallBackRoute&&this.isConnected&&(document.location.href=this.fallBackRoute);let e=this.templateList.find(e=>e.hasAttribute(`data-fallback`));e&&t.push(e)}return C`${Fn(t,(e,t)=>t+new Date().getTime(),e=>{if(e.title&&(document.title=e.title),e.hasAttribute(`dataProviderExpression`)){let t=``,n=e.getAttribute(`dataProviderExpression`)||``;if(e.getAttribute(`mode`)==`patternMatching`){let r=new vn(`(/)*`+(e.getAttribute(this.templateValueAttribute)||``)+`*`);t=new vn(n).stringify(r.match(this.cleanLocation))}else{let r=new RegExp(e.getAttribute(this.templateValueAttribute)||``),i=(this.cleanLocation+``).match(r);i&&(t=i.shift()?.replace(r,n)||``)}return C`<div
|
|
1263
1182
|
style="display:contents"
|
|
1264
|
-
dataProvider="${
|
|
1183
|
+
dataProvider="${t}"
|
|
1265
1184
|
>
|
|
1266
|
-
${
|
|
1267
|
-
</div>`}return
|
|
1185
|
+
${Ar(e)}
|
|
1186
|
+
</div>`}return Ar(e)})}`}};O([b({type:String})],Yr.prototype,`fallBackRoute`,void 0),O([b({type:Object})],Yr.prototype,`routes`,void 0),O([b({type:String})],Yr.prototype,`basePath`,void 0),O([b()],Yr.prototype,`location`,null),Yr=O([v(Jr)],Yr);var Xr=`sonic-redirect`,Zr=class extends k(E){connectedCallback(){this.noShadowDom=``,this.style.display=`none`,super.connectedCallback(),this.udpateCallBack=()=>this.update(),this.publisher&&this.publisher.onInternalMutation(this.udpateCallBack)}disconnectedCallback(){this.publisher&&this.publisher.offInternalMutation(this.udpateCallBack),super.disconnectedCallback()}update(){if(this.hasAttribute(`onAdded`)){j.changeFromComponent(this);return}if(!this.props)return;let e=this.getAttribute(`onData`).split(`.`),t=f.traverse(this.props,e);t&&!(f.isObject(t)&&t)&&j.changeFromComponent(this)}};Zr=O([v(Xr)],Zr);var Qr=`sonic-states`,$r=class extends k(un(E)){constructor(...e){super(...e),this.state=``,this.inverted=!1,this.statePath=``,this.onStateAssign=e=>{this.state=e,this.requestUpdate()}}connectedCallback(){if(this.noShadowDom=``,super.connectedCallback(),this.hasAttribute(`data-path`)&&(this.statePath=this.getAttribute(`data-path`)),this.statePath){this.statePublisher=this.publisher;let e=this.statePath.split(`.`);for(let t of e)this.statePublisher=this.statePublisher[t];this.statePublisher.onAssign(this.onStateAssign)}}disconnectedCallback(){this.statePath&&this.statePublisher?.offAssign(this.onStateAssign),super.disconnectedCallback()}handleStates(e){if(!this.states)return[];let t=[];for(let[n,r]of Object.entries(this.states)){if(n===`fallback`||!r)continue;let i=new RegExp(n);if(i.test(e)){let a=i.exec(e)||[n];a.shift(),t.push(r([...a]))}else try{let i=new vn(`(/)*`+n+`*`);if(i.match(e)){let n=i.match(e)||{};t.push(r(n))}}catch{e.indexOf(n.replace(document.location.origin,``))!=-1&&t.push(r({}))}}return t.length==0&&this.states?.fallback&&this.isConnected&&t.push(this.states.fallback()),t}render(){let e=this.state;(!Array.isArray(e)&&f.isObject(e)||e===void 0)&&(e=``);let t=this.handleStates(e);if(t.length>0)return C`${t}`;let n=[];for(let t of this.templatePartsList){let r=t.getAttribute(this.templateValueAttribute),i=e;if(this.inverted&&(i=r,r=e),r==``&&(r=this.inverted?`.*?`:`^$`),new RegExp(r).test(i+``))n.push(t),t.removeAttribute(`mode`);else{let e=new vn(r);e.names.length>0&&e.match(i)&&(t.setAttribute(`mode`,`patternMatching`),n.push(t))}}return C`${Fn(n,(e,t)=>t+new Date().getTime(),t=>{if(t?.hasAttribute(`dataProviderExpression`)){let n=t.getAttribute(`dataProviderExpression`),r=``,i=e,a=t.getAttribute(this.templateValueAttribute);if(this.inverted&&(i=a,a=e),a==``&&(a=this.inverted?`*`:`^$`),t.getAttribute(`mode`)==`patternMatching`){let e=new vn(a);r=new vn(n).stringify(e.match(i))}else{let e=new RegExp(a),t=(i+``).match(e);t&&(r=t.shift()?.replace(e,n))}return C`<div
|
|
1268
1187
|
style="display:contents"
|
|
1269
|
-
dataProvider="${
|
|
1188
|
+
dataProvider="${r}"
|
|
1270
1189
|
>
|
|
1271
|
-
${
|
|
1272
|
-
</div>`}return Lt(s)})}`}};ks([a()],Je.prototype,"state",2),ks([a({type:Boolean,reflect:!0})],Je.prototype,"inverted",2),ks([a({type:Object})],Je.prototype,"states",2),Je=ks([x(va)],Je);var ya=Object.getOwnPropertyDescriptor,wa=(r,t,i,s)=>{for(var e=s>1?void 0:s?ya(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=n(e)||e);return e};const _a="sonic-scope";let Sr=class extends w{createRenderRoot(){return this}render(){return b`<slot></slot>`}};Sr=wa([x(_a)],Sr);var xa=Object.defineProperty,Pa=Object.getOwnPropertyDescriptor,Ar=(r,t,i,s)=>{for(var e=s>1?void 0:s?Pa(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&xa(t,i,e),e};const $a="sonic-example";let pi=class extends X(w){constructor(){super(...arguments),this.text="Example"}render(){return b`<div>${this.text}</div>`}};Ar([a()],pi.prototype,"text",2),pi=Ar([x($a)],pi);const Ca={checkbox:{tagName:"sonic-checkbox"},date:{tagName:"sonic-input",attributes:{type:"date"}},fieldset:{tagName:"sonic-fieldset",nodes:[{libraryKey:"formLayout"}],contentElementSelector:"sonic-form-layout"},managed_file:{tagName:"sonic-input",attributes:{variant:"ghost",type:"file"}},password:{tagName:"sonic-input",attributes:{type:"password"}},radio:{tagName:"sonic-radio"},select:{tagName:"sonic-select"},textarea:{tagName:"sonic-textarea"},textfield:{tagName:"sonic-input",attributes:{type:"text"}},hidden:{tagName:"sonic-input",attributes:{type:"hidden"}},button:{tagName:"sonic-button"},form:{tagName:"sonic-submit",attributes:{onEnterKey:!0}},submit:{tagName:"sonic-submit",attributes:{onClick:!0},contentElementSelector:"sonic-button",nodes:[{libraryKey:"button",attributes:{type:"success"},nodes:[{tagName:"sonic-icon",attributes:{name:"check",slot:"prefix"}}]}]},email:{tagName:"sonic-input",attributes:{type:"email"}},formItemContainer:{tagName:"div",attributes:{class:"form-item-container"}},formLayout:{tagName:"sonic-form-layout"},formActions:{tagName:"sonic-form-actions"},passwordHelper:{tagName:"sonic-password-helper"},sameValueHelper:{tagName:"sonic-same-value-helper"},divider:{tagName:"sonic-divider"}};class Sa{async transform(t,i){if(this.sduiDescriptor=t,this.sduiDescriptor.library)for(const s in i.library)this.sduiDescriptor.library[s]=i.library[s];for(const s of i.transforms)this.transformAction(s)}transformAction(t){const i=this.getNodesMatchingPatterns(t.patterns,this.sduiDescriptor);this[t.action](t,i)}getNodesMatchingPatterns(t,i){if(!t)return[];if(!i)return[];const s=i.nodes;if(!s)return[];let e=[],o=0;for(const n of t)for(const l of s)this.nodeMatchesPattern(n,l)&&e.push({parent:i,child:l,index:o}),e=e.concat(this.getNodesMatchingPatterns([n],l)),o++;return e}stringMatchesExpression(t,i){return!i||t&&t.match(i)}nodeMatchesPattern(t,i){const s=t,e=i,o=["libraryKey","innerHTML","prefix","suffix","markup"];for(const c of o)if(!this.stringMatchesExpression(e[c],s[c]))return!1;const n=t.attributes,l=i.attributes;if(n&&!l)return!1;if(n){for(const c in n)if(!l||!this.stringMatchesExpression(l[c],n[c]))return!1}return!0}unwrap(t,i){for(const s of i)s.parent.nodes?.splice(s.parent.nodes.indexOf(s.child),1),s.child.nodes&&s.parent.nodes?.splice(s.parent.nodes.indexOf(s.child),0,...s.child.nodes)}wrap(t,i){const s={...t.ui};s.nodes||(s.nodes=[]);let e=0;for(const n of i)s.nodes?.push(n.child),e>0&&n.parent.nodes?.splice(n.parent.nodes.indexOf(n.child),1),e++;const o=i[0]?.parent.nodes?.indexOf(i[0].child);o&&(i[0].parent.nodes?.splice(o,1),i[0].parent.nodes?.splice(o,0,s))}move(t,i){for(const s of i){s.parent.nodes?.splice(s.parent.nodes.indexOf(s.child),1);let e=[];t.after&&(e=this.getNodesMatchingPatterns([t.after],this.sduiDescriptor)),t.before&&(e=this.getNodesMatchingPatterns([t.before],this.sduiDescriptor));const o=e[0];o&&o.parent.nodes?.splice(o.parent.nodes.indexOf(o.child)+(t.after?1:0),0,s.child)}}remap(t,i){for(const s of i){const e={...t.ui};e.attributes||(e.attributes={});const o=s.child.attributes;if(o)for(const d in o)Object.prototype.hasOwnProperty.call(e.attributes,"key")||(e.attributes[d]=o[d]);const n=["libraryKey","innerHTML","prefix","suffix","markup"],l=s.child,c=e;for(const d of n)!Object.prototype.hasOwnProperty.call(e,d)&&l[d]&&(c[d]=l[d]);e.nodes||(e.nodes=[]);const h=s.child.nodes;if(h)for(const d of h)e.nodes.push(d);const u=s.parent.nodes?.indexOf(s.child)||-1;u!=-1&&(s.parent.nodes?.splice(u,1),s.parent.nodes?.splice(u,0,e))}}delete(t,i){for(const s of i)s.parent.nodes?.splice(s.parent.nodes.indexOf(s.child),1)}insert(t,i){const s=t.after?"after":t.before?"before":"in";i=[],t.after?i=this.getNodesMatchingPatterns([t.after],this.sduiDescriptor):t.before?i=this.getNodesMatchingPatterns([t.before],this.sduiDescriptor):t.in&&(i=this.getNodesMatchingPatterns([t.in],this.sduiDescriptor));const e=i[0];e&&(s=="in"?(e.child.nodes||(e.child.nodes=[]),e.child.nodes.push({...t.ui})):e.parent.nodes?.splice(e.parent.nodes.indexOf(e.child)+(s=="after"?1:0),0,{...t.ui}))}}var Aa=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,fi=(r,t,i,s)=>{for(var e=s>1?void 0:s?ka(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&Aa(t,i,e),e};const Oa="sonic-sdui";let Os=class extends vr(Gt(w)){constructor(){super(...arguments),this.sduiDescriptor={}}connectedCallback(){this.noShadowDom="",this.displayContents=!0,this.isFetchEnabled=this.hasAttribute("fetch"),super.connectedCallback()}willUpdate(r){this.props==null&&(this.sduiDescriptor={});{const t=this.sduiKey?this.props[this.sduiKey]:this.props;if(this.sduiDescriptor==t)return;this.sduiDescriptor=t,this.updateContents()}super.willUpdate(r)}async updateContents(){if(!this.sduiDescriptor)return;const r={};Object.assign(r,Ca,this.sduiDescriptor.library),this.sduiDescriptor.library=r,this.loadAssets(),await this.loadLibrary(),await this.transformSDUIDescriptor(),this.parseRootNodes()}removeChildren(){for(;[...this.children].filter(r=>r.nodeName!="SLOT").length>0;)this.removeChild(this.children[0])}loadAssets(){if(this.sduiDescriptor){if(this.sduiDescriptor.js)for(const r of this.sduiDescriptor.js)Xt.loadJS(r);if(this.sduiDescriptor.css)for(const r of this.sduiDescriptor.css)Xt.loadCSS(r)}}async transformSDUIDescriptor(){if(!this.hasAttribute("transformation"))return;const t=await(await fetch(this.getAttribute("transformation"))).json();await new Sa().transform(this.sduiDescriptor,t)}async loadLibrary(){if(!this.hasAttribute("library"))return;const t=await(await fetch(this.getAttribute("library"))).json();this.sduiDescriptor.library=t}parseRootNodes(){if(this.removeChildren(),!this.sduiDescriptor)return;let r=this.sduiDescriptor.nodes;r||(r=[]);const t={tagName:"sonic-toast-message-subscriber",attributes:{}};this.messagesKey&&(t.attributes={subDataProvider:this.messagesKey}),r.push(t),r.forEach(i=>this.appendChild(this.parseChild(i)))}parseChild(r){const t=r.tagName||"div";let{element:i,contentElement:s}=this.handleLibrary(r,t);return this.handleAttributes(r,i),i=this.handleMarkup(r,i),s||(s=i),this.handleChildNodes(r,s,i),this.handleInnerHTML(r,s),r.prefix||r.suffix?this.handlePrefixSuffix(r,i):i}handlePrefixSuffix(r,t){const i=document.createElement("div");return i.innerHTML=(r.prefix||"")+t.outerHTML+(r.suffix||""),i.style.display="contents",i}handleChildNodes(r,t,i){if(r.nodes){const s=r.nodes;for(const e of s){const o=this.parseChild(e);let n=t;e.parentElementSelector&&(n=i.querySelector(e.parentElementSelector)||t),n.shadowRoot?n.shadowRoot.appendChild(o):n.tagName.toLocaleLowerCase()=="template"?n.content.appendChild(o):n.appendChild(o)}}}handleLibrary(r,t){let i,s;if(r.libraryKey&&this.sduiDescriptor.library){i=this.parseChild(this.sduiDescriptor.library[r.libraryKey]||{tagName:"div"});const e=(this.sduiDescriptor.library[r.libraryKey]||{}).contentElementSelector;e&&(s=i.querySelector(e))}else i=document.createElement(t);return{element:i,contentElement:s}}handleAttributes(r,t){const i=r.attributes;for(const s in i){const e=i[s],o=De.isObject(e)?JSON.stringify(e):e;t.setAttribute(s,o)}}handleMarkup(r,t){return r.markup&&(t=document.createElement("div"),t.style.display="contents",t.innerHTML=r.markup),t}handleInnerHTML(r,t){if(r.innerHTML)if(r.innerHTML.indexOf("wording_")!=-1){const i=this.getAncestorAttributeValue("wordingProvider");this.api?.post(i,{labels:[r.innerHTML.substring(8)]}).then(s=>{t&&(t.innerHTML+=s)})}else t&&(t.innerHTML+=r.innerHTML)}};fi([a()],Os.prototype,"sduiKey",2),fi([a()],Os.prototype,"messagesKey",2),Os=fi([x(Oa)],Os);var Da=Object.defineProperty,La=Object.getOwnPropertyDescriptor,kr=(r,t,i,s)=>{for(var e=s>1?void 0:s?La(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&Da(t,i,e),e};let Ds=class extends Gt(w){constructor(){super(...arguments),this._composition={},this.listeners=[]}get composition(){return this._composition}set composition(r){this._composition=r,this.updateComposition()}connectedCallback(){super.connectedCallback(),this.updateComposition()}disconnectedCallback(){this.removePublisherListeners(),super.disconnectedCallback()}updateComposition(){this.removePublisherListeners(),this.publisher&&(this.publisher.set({}),this.parseComposition(this.composition,this.publisher))}removePublisherListeners(){const r=this.listeners;this.listeners=[],r.forEach(t=>{this.publisher.offAssign(t.subscriber)})}parseComposition(r,t){if(r)for(const i in r){const s=r[i];if(typeof s=="string"){const e=s.split("."),o=e.shift();if(!o)continue;let n=k.get(o);n=De.traverse(n,e);const l={publisher:n,subscriber:c=>{t[i]=c}};this.listeners.push(l),n.onAssign(l.subscriber),t._proxies_.set(i,n)}else{this.publisher[i]={};const e=new je({},t);t._proxies_.set(i,e);const o={publisher:e,subscriber:n=>{t[i]=n}};this.listeners.push(o),e.onAssign(o.subscriber),this.parseComposition(s,e)}}}render(){return b`<slot></slot>`}};Ds.styles=[P`
|
|
1190
|
+
${Ar(t)}
|
|
1191
|
+
</div>`}return Ar(t)})}`}};O([b()],$r.prototype,`state`,void 0),O([b({type:Boolean,reflect:!0})],$r.prototype,`inverted`,void 0),O([b({type:Object})],$r.prototype,`states`,void 0),$r=O([v(Qr)],$r);var ei=`sonic-scope`,ti=class extends E{createRenderRoot(){return this}render(){return C`<slot></slot>`}};ti=O([v(ei)],ti);function ni(e){this.__connectedCallbackCalls__||=new Set,this.__connectedCallbackCalls__.add(e)}function ri(e){this.__disconnectedCallbackCalls__||=new Set,this.__disconnectedCallbackCalls__.add(e)}function ii(e){if(e.__is__setSubscribable__)return;e.__is__setSubscribable__=!0,e.__onConnected__=ni,e.__onDisconnected__=ri;let t=e.connectedCallback;e.connectedCallback=function(){t?.call(this),this.__connectedCallbackCalls__&&this.__connectedCallbackCalls__.forEach(e=>e(this))};let n=e.disconnectedCallback;e.disconnectedCallback=function(){n?.call(this),this.__disconnectedCallbackCalls__&&this.__disconnectedCallbackCalls__.forEach(e=>e(this))}}function ai(e){return e.trim().replace(/^this\./,``)}function oi(e,t){if(!t)return;let n=t.split(`.`).filter(Boolean);if(n.length===0)return;let r=e;for(let e of n){if(typeof r!=`object`||!r)return;r=r[e]}return r}function si(e,t){let n=!1,r=(t,r)=>{let i=oi(e,ai(r));return i==null?(n=!0,``):`${i}`},i=t.replace(/\$\{([^}]+)\}/g,r).replace(/\{\$([^}]+)\}/g,r).trim();if(n||!i.length)return{ready:!1,path:null};let a=i.split(`.`).filter(Boolean);return a.length===0||!a[0]?{ready:!1,path:null}:{ready:!0,path:i}}function ci(e){let t=[/\$\{([^}]+)\}/g,/\{\$([^}]+)\}/g],n=new Set;for(let r of t){let t;for(;(t=r.exec(e))!==null;){let e=(t[1]||``).trim().replace(/^this\./,``);if(!e)continue;let[r]=e.split(`.`);r&&n.add(r)}}return Array.from(n)}function li(e){return typeof e==`object`&&!!e&&`path`in e&&typeof e.path==`string`}function ui(e,t,n,r,i){let a=n,o=String(r);di(e,t,n),a[e]||Object.defineProperty(a,e,{value:new Map,enumerable:!1,configurable:!1,writable:!1});let s=a[e];s.has(o)||s.set(o,new Set);let c=s.get(o);return c.add(i),()=>{c.delete(i),c.size===0&&s.delete(o)}}function di(e,t,n){let r=Object.getPrototypeOf(n);if(!r||r[t])return;let i=Object.prototype.hasOwnProperty.call(r,`willUpdate`)?r.willUpdate:Object.getPrototypeOf(r)?.willUpdate;r.willUpdate=function(t){let n=this[e];n&&n.size>0&&(t&&t.size>0?t.forEach((e,t)=>{let r=n.get(String(t));r&&r.forEach(e=>e())}):n.forEach(e=>e.forEach(e=>e()))),typeof i==`function`&&i.call(this,t)},r[t]=!0}var fi={watcherStore:Symbol(`__bindDynamicWatcherStore__`),hooked:Symbol(`__bindDynamicWillUpdateHooked__`)},pi={watcherStore:`__publishDynamicWatcherStore__`,hooked:`__publishDynamicWillUpdateHooked__`},mi={watcherStore:`__getDynamicWatcherStore__`,hooked:`__getDynamicWillUpdateHooked__`},hi={watcherStore:Symbol(`__onAssignDynamicWatcherStore__`),hooked:Symbol(`__onAssignDynamicWillUpdateHooked__`)};function gi(e){let t=e.split(`.`).filter(e=>e.length>0);if(t.length===0)return null;let n=t.shift()||``;if(!n)return null;let r=_.get(n);return r?(r=kn.traverse(r,t),r):null}function _i(e,t){let n=t?.reflect??!1,r=ci(e),i=r.length>0;return function(t,a){if(!t)return;ii(t);let o=`__bind_state_${a}`,s=`__bind_${a}_publisher__`,c=n?`__bind_${a}_updating_from_publisher__`:null;if(n){let e=Object.getOwnPropertyDescriptor(t,a),n=`__bind_${a}_value__`,r=`__bind_${a}_updating_from_publisher__`,i=e&&!e.get&&!e.set?e.value:void 0;Object.defineProperty(t,a,{get(){return e?.get?e.get.call(this):(!Object.prototype.hasOwnProperty.call(this,n)&&i!==void 0&&(this[n]=i),this[n])},set(t){e?.set?e.set.call(this,t):this[n]=t,!this[r]&&this[s]&&this[s].set(t)},enumerable:e?.enumerable??!0,configurable:e?.configurable??!0})}t.__onConnected__(t=>{let l=t[o]||(t[o]={cleanupWatchers:[],unsubscribePublisher:null,currentPath:null});l.unsubscribePublisher&&=(l.unsubscribePublisher(),null),l.cleanupWatchers.forEach(e=>e()),l.cleanupWatchers=[],l.currentPath=null;let u=e=>{if(!e){l.unsubscribePublisher&&=(l.unsubscribePublisher(),null),l.currentPath=null,t[s]=null;return}if(e===l.currentPath)return;l.unsubscribePublisher&&=(l.unsubscribePublisher(),null);let r=gi(e);if(!r){l.currentPath=null,t[s]=null;return}let i=e=>{n&&c&&(t[c]=!0),t[a]=e,n&&c&&(t[c]=!1)};r.onAssign(i),l.unsubscribePublisher=()=>{r.offAssign(i),t[s]===r&&(t[s]=null)},l.currentPath=e,t[s]=r},d=()=>{if(i){let n=si(t,e);if(!n.ready){u(null);return}u(n.path);return}u(e)};if(i)for(let e of r){let n=ui(fi.watcherStore,fi.hooked,t,e,()=>d());l.cleanupWatchers.push(n)}d()}),t.__onDisconnected__(e=>{let t=e[o];t&&(t.unsubscribePublisher&&=(t.unsubscribePublisher(),null),t.cleanupWatchers.forEach(e=>e()),t.cleanupWatchers=[],t.currentPath=null,e[s]=null)})}}function vi(e,t){return _i(li(e)?e.path:e,t)}function yi(e){let t=e.path,n=ci(t);return function(e,r){ii(e);let i=`__publish_${r}_publisher__`,a=`__publish_${r}_value__`,o=Object.getOwnPropertyDescriptor(e,r),s=o&&!o.get&&!o.set?o.value:void 0;Object.defineProperty(e,r,{get(){return o?.get?o.get.call(this):(!Object.prototype.hasOwnProperty.call(this,a)&&s!==void 0&&(this[a]=s),this[a])},set(e){o?.set?o.set.call(this,e):this[a]=e;let t=this[i];t&&t.set(e)},enumerable:o?.enumerable??!0,configurable:o?.configurable??!0}),e.__onConnected__(e=>{let a=e,o=`__publish_state_${r}`,s=a[o]||(a[o]={cleanupWatchers:[]}),c=()=>{let o;if(n.length){let n=si(e,t);o=n.ready?n.path:null}else o=t;let s=o?gi(o):void 0;if(a[i]=s??null,s&&r in e){let e=a[r];e!==void 0&&s.set(e)}};if(s.cleanupWatchers.forEach(e=>e()),s.cleanupWatchers=[],n.length)for(let e of n)s.cleanupWatchers.push(ui(pi.watcherStore,pi.hooked,a,e,c));c()}),e.__onDisconnected__(e=>{let t=e,n=t[`__publish_state_${r}`];n?.cleanupWatchers&&n.cleanupWatchers.forEach(e=>e()),t[i]=void 0})}}function bi(e){return vi(e)}function xi(...e){let t=e.map(e=>{let t=ci(e);return{originalPath:e,dynamicDependencies:t,isDynamic:t.length>0}});return function(n,r,i){ii(n);let a=`__onAssign_state_${r}__`,o;n.__onConnected__(n=>{let r=n[a]||(n[a]={cleanupWatchers:[],configurations:[]});r.cleanupWatchers.forEach(e=>e()),r.cleanupWatchers=[],r.configurations.forEach(e=>{e.unsubscribePublisher&&e.unsubscribePublisher()}),r.configurations=[];let s=[],c=[];for(let n=0;n<e.length;n++){let r=t[n],i=new Set;c.push({publisher:null,onAssign:t=>{s[n]=t,s.filter(e=>e!=null).length===e.length&&i.forEach(e=>e(...s))},callbacks:i,unsubscribePublisher:null,pathConfig:r,index:n})}let l=(e,t)=>{if(e.unsubscribePublisher&&=(e.unsubscribePublisher(),null),s[e.index]=null,e.publisher=null,!t)return;let n=gi(t);n&&(n.onAssign(e.onAssign),e.unsubscribePublisher=()=>{n.offAssign(e.onAssign),e.publisher===n&&(e.publisher=null)},e.publisher=n)},u=()=>{for(let e of c)if(e.pathConfig.isDynamic){let t=si(n,e.pathConfig.originalPath);if(!t.ready){l(e,null);continue}l(e,t.path)}else l(e,e.pathConfig.originalPath)};for(let e of c)if(e.pathConfig.isDynamic)for(let t of e.pathConfig.dynamicDependencies){let e=ui(hi.watcherStore,hi.hooked,n,t,()=>u());r.cleanupWatchers.push(e)}o=i.value.bind(n);for(let e of c)e.callbacks.add(o);u(),r.configurations=c}),n.__onDisconnected__(e=>{let t=e[a];t&&(t.cleanupWatchers.forEach(e=>e()),t.cleanupWatchers=[],t.configurations.forEach(e=>{e.unsubscribePublisher&&e.unsubscribePublisher(),e.callbacks.delete(o)}),t.configurations=[])})}}function Si(){return function(e,t,n){let r=0,i=n.value,a=e.constructor.prototype.disconnectedCallback;e.constructor.prototype.disconnectedCallback=function(){a?.apply(this),this.__removeAutoSubscribe__()};let o=e.connectedCallback;e.connectedCallback=function(){o?.call(this),this[t]()},n.value=function(...e){let n=new Set,a=()=>{r++;let e=r;window.queueMicrotask(()=>{e===r&&this[t]()})};n.forEach(e=>{e.offAssign(a)}),_.collectModifiedPublisher();let o=i.apply(this,e);return n=_.getModifiedPublishers()||new Set,n.forEach(e=>{e.onAssign(a,!1)}),this.__removeAutoSubscribe__=()=>{n.forEach(e=>{e.offAssign(a)})},o}}}function Ci(e){return function(t){ii(t);for(let n of e){let e=n.split(`.`);if(e.length===0)continue;let r=e.shift()||``,i=_.get(r);i=kn.traverse(i,e),t.__onConnected__(e=>{i.startTemplateFilling(e)}),t.__onDisconnected__(()=>{})}}}function wi(e){return function(t,n){t&&(ii(t),t.__onConnected__(t=>{t[n]=l.getAncestorAttributeValue(t,e)}))}}function Ti(e){return e instanceof HTMLElement||e instanceof ShadowRoot?e:null}function Ei(e){if(!e||typeof e.get!=`function`)return null;let t=e.get();return!t||typeof t!=`object`||!(`serviceURL`in t)?null:t}function Di(e){let t=Ti(e);return t?l.getApiConfiguration(t):null}function Oi(e){e.configPublisher&&e.configMutationHandler&&e.configPublisher.offInternalMutation(e.configMutationHandler),e.configPublisher=null,e.configMutationHandler=null}function ki(e,t){let n=e.path,r=t?.path,i=ci(n),a=r?ci(r):[],o=[...new Set([...i,...a])],s=i.length>0,c=!!r;return function(e,t){if(!e)return;ii(e);let a=`__get_state_${t}`;e.__onConnected__(e=>{let l=e,u=l[a];u||(u={cleanupWatchers:[],requestGeneration:0,configPublisher:null,configMutationHandler:null},l[a]=u),u.cleanupWatchers.forEach(e=>e()),u.cleanupWatchers=[],u.requestGeneration++;let d=()=>{let i=s?si(e,n):{ready:!0,path:n};if(!i.ready||!i.path){l[t]=void 0;return}let a=null;if(c&&r){let n=si(e,r);if(!n.ready||!n.path){l[t]=void 0;return}a=Ei(gi(n.path))}else a=Di(e);if(!a){l[t]=void 0;return}let o=++u.requestGeneration;new Yt(a).getDetailed(i.path).then(e=>{o===u.requestGeneration&&(l[t]=e)})},f=()=>{if(!c||!r)return;Oi(u);let n=si(e,r);if(!n.ready||!n.path){l[t]=void 0;return}let i=gi(n.path);if(!i){l[t]=void 0;return}let a=()=>{d()};i.onInternalMutation(a),u.configPublisher=i,u.configMutationHandler=a};if(c){for(let t of o){let n=ui(mi.watcherStore,mi.hooked,e,t,()=>f());u.cleanupWatchers.push(n)}f()}else{if(s)for(let t of i){let n=ui(mi.watcherStore,mi.hooked,e,t,()=>d());u.cleanupWatchers.push(n)}d()}}),e.__onDisconnected__(e=>{let n=e,r=n[a];r&&(Oi(r),r.cleanupWatchers.forEach(e=>e()),r.cleanupWatchers=[],r.requestGeneration++,n[t]=void 0)})}}var Ai=yi,ji=bi,Mi=ki;window[`concorde-decorator-subscriber`]=window[`concorde-decorator-subscriber`]||{},window[`concorde-decorator-subscriber`]={bind:vi,publish:yi,subscribe:bi,onAssing:xi,ancestorAttribute:wi,autoSubscribe:Si,autoFill:Ci,get:ki};var Ni=new Sn(`communes?limit=$limit&fields=nom,code`),Pi=new xn(Ni.path),Fi=`sonic-example`,Ii=class extends E{constructor(...e){super(...e),this.limit=5}render(){return C` <span part="api-get-demo">
|
|
1192
|
+
· get: ${JSON.stringify(this.geoCommunesPayload?.result??null)} · HTTP
|
|
1193
|
+
${this.geoCommunesPayload?.response?.status??`—`} · subscribe:
|
|
1194
|
+
${JSON.stringify(this.geoCommunesResult??null)}</span
|
|
1195
|
+
>`}};O([b({type:Number})],Ii.prototype,`limit`,void 0),O([Mi(Ni),Ai(Pi)],Ii.prototype,`geoCommunesPayload`,void 0),O([x(),ji(Pi.result)],Ii.prototype,`geoCommunesResult`,void 0),Ii=O([v(Fi)],Ii);var Li={checkbox:{tagName:`sonic-checkbox`},date:{tagName:`sonic-input`,attributes:{type:`date`}},fieldset:{tagName:`sonic-fieldset`,nodes:[{libraryKey:`formLayout`}],contentElementSelector:`sonic-form-layout`},managed_file:{tagName:`sonic-input`,attributes:{variant:`ghost`,type:`file`}},password:{tagName:`sonic-input`,attributes:{type:`password`}},radio:{tagName:`sonic-radio`},select:{tagName:`sonic-select`},textarea:{tagName:`sonic-textarea`},textfield:{tagName:`sonic-input`,attributes:{type:`text`}},hidden:{tagName:`sonic-input`,attributes:{type:`hidden`}},button:{tagName:`sonic-button`},form:{tagName:`sonic-submit`,attributes:{onEnterKey:!0}},submit:{tagName:`sonic-submit`,attributes:{onClick:!0},contentElementSelector:`sonic-button`,nodes:[{libraryKey:`button`,attributes:{type:`success`},nodes:[{tagName:`sonic-icon`,attributes:{name:`check`,slot:`prefix`}}]}]},email:{tagName:`sonic-input`,attributes:{type:`email`}},formItemContainer:{tagName:`div`,attributes:{class:`form-item-container`}},formLayout:{tagName:`sonic-form-layout`},formActions:{tagName:`sonic-form-actions`},passwordHelper:{tagName:`sonic-password-helper`},sameValueHelper:{tagName:`sonic-same-value-helper`},divider:{tagName:`sonic-divider`}},Ri=class{async transform(e,t){if(this.sduiDescriptor=e,this.sduiDescriptor.library)for(let e in t.library)this.sduiDescriptor.library[e]=t.library[e];for(let e of t.transforms)this.transformAction(e)}transformAction(e){let t=this.getNodesMatchingPatterns(e.patterns,this.sduiDescriptor);this[e.action](e,t)}getNodesMatchingPatterns(e,t){if(!e||!t)return[];let n=t.nodes;if(!n)return[];let r=[],i=0;for(let a of e)for(let e of n)this.nodeMatchesPattern(a,e)&&r.push({parent:t,child:e,index:i}),r=r.concat(this.getNodesMatchingPatterns([a],e)),i++;return r}stringMatchesExpression(e,t){return!t||e&&e.match(t)}nodeMatchesPattern(e,t){let n=e,r=t;for(let e of[`libraryKey`,`innerHTML`,`prefix`,`suffix`,`markup`])if(!this.stringMatchesExpression(r[e],n[e]))return!1;let i=e.attributes,a=t.attributes;if(i&&!a)return!1;if(i){for(let e in i)if(!a||!this.stringMatchesExpression(a[e],i[e]))return!1}return!0}unwrap(e,t){for(let e of t)e.parent.nodes?.splice(e.parent.nodes.indexOf(e.child),1),e.child.nodes&&e.parent.nodes?.splice(e.parent.nodes.indexOf(e.child),0,...e.child.nodes)}wrap(e,t){let n={...e.ui};n.nodes||=[];let r=0;for(let e of t)n.nodes?.push(e.child),r>0&&e.parent.nodes?.splice(e.parent.nodes.indexOf(e.child),1),r++;let i=t[0]?.parent.nodes?.indexOf(t[0].child);i&&(t[0].parent.nodes?.splice(i,1),t[0].parent.nodes?.splice(i,0,n))}move(e,t){for(let n of t){n.parent.nodes?.splice(n.parent.nodes.indexOf(n.child),1);let t=[];e.after&&(t=this.getNodesMatchingPatterns([e.after],this.sduiDescriptor)),e.before&&(t=this.getNodesMatchingPatterns([e.before],this.sduiDescriptor));let r=t[0];r&&r.parent.nodes?.splice(r.parent.nodes.indexOf(r.child)+ +!!e.after,0,n.child)}}remap(e,t){for(let n of t){let t={...e.ui};t.attributes||={};let r=n.child.attributes;if(r)for(let e in r)Object.prototype.hasOwnProperty.call(t.attributes,`key`)||(t.attributes[e]=r[e]);let i=[`libraryKey`,`innerHTML`,`prefix`,`suffix`,`markup`],a=n.child,o=t;for(let e of i)!Object.prototype.hasOwnProperty.call(t,e)&&a[e]&&(o[e]=a[e]);t.nodes||=[];let s=n.child.nodes;if(s)for(let e of s)t.nodes.push(e);let c=n.parent.nodes?.indexOf(n.child)||-1;c!=-1&&(n.parent.nodes?.splice(c,1),n.parent.nodes?.splice(c,0,t))}}delete(e,t){for(let e of t)e.parent.nodes?.splice(e.parent.nodes.indexOf(e.child),1)}insert(e,t){let n=e.after?`after`:e.before?`before`:`in`;t=[],e.after?t=this.getNodesMatchingPatterns([e.after],this.sduiDescriptor):e.before?t=this.getNodesMatchingPatterns([e.before],this.sduiDescriptor):e.in&&(t=this.getNodesMatchingPatterns([e.in],this.sduiDescriptor));let r=t[0];r&&(n==`in`?(r.child.nodes||(r.child.nodes=[]),r.child.nodes.push({...e.ui})):r.parent.nodes?.splice(r.parent.nodes.indexOf(r.child)+ +(n==`after`),0,{...e.ui}))}},zi=`sonic-sdui`,Bi=class extends wr(Or(E)){constructor(...e){super(...e),this.sduiDescriptor={}}connectedCallback(){this.noShadowDom=``,this.displayContents=!0,this.isFetchEnabled=this.hasAttribute(`fetch`),super.connectedCallback()}willUpdate(e){this.props??(this.sduiDescriptor={});{let e=this.sduiKey?this.props[this.sduiKey]:this.props;if(this.sduiDescriptor==e)return;this.sduiDescriptor=e,this.updateContents()}super.willUpdate(e)}async updateContents(){if(!this.sduiDescriptor)return;let e={};Object.assign(e,Li,this.sduiDescriptor.library),this.sduiDescriptor.library=e,this.loadAssets(),await this.loadLibrary(),await this.transformSDUIDescriptor(),this.parseRootNodes()}removeChildren(){for(;[...this.children].filter(e=>e.nodeName!=`SLOT`).length>0;)this.removeChild(this.children[0])}loadAssets(){if(this.sduiDescriptor){if(this.sduiDescriptor.js)for(let e of this.sduiDescriptor.js)Dn.loadJS(e);if(this.sduiDescriptor.css)for(let e of this.sduiDescriptor.css)Dn.loadCSS(e)}}async transformSDUIDescriptor(){if(!this.hasAttribute(`transformation`))return;let e=await(await fetch(this.getAttribute(`transformation`))).json();await new Ri().transform(this.sduiDescriptor,e)}async loadLibrary(){if(!this.hasAttribute(`library`))return;let e=await(await fetch(this.getAttribute(`library`))).json();this.sduiDescriptor.library=e}parseRootNodes(){if(this.removeChildren(),!this.sduiDescriptor)return;let e=this.sduiDescriptor.nodes;e||=[];let t={tagName:`sonic-toast-message-subscriber`,attributes:{}};this.messagesKey&&(t.attributes={subDataProvider:this.messagesKey}),e.push(t),e.forEach(e=>this.appendChild(this.parseChild(e)))}parseChild(e){let t=e.tagName||`div`,{element:n,contentElement:r}=this.handleLibrary(e,t);return this.handleAttributes(e,n),n=this.handleMarkup(e,n),r||=n,this.handleChildNodes(e,r,n),this.handleInnerHTML(e,r),e.prefix||e.suffix?this.handlePrefixSuffix(e,n):n}handlePrefixSuffix(e,t){let n=document.createElement(`div`);return n.innerHTML=(e.prefix||``)+t.outerHTML+(e.suffix||``),n.style.display=`contents`,n}handleChildNodes(e,t,n){if(e.nodes){let r=e.nodes;for(let e of r){let r=this.parseChild(e),i=t;e.parentElementSelector&&(i=n.querySelector(e.parentElementSelector)||t),i.shadowRoot?i.shadowRoot.appendChild(r):i.tagName.toLocaleLowerCase()==`template`?i.content.appendChild(r):i.appendChild(r)}}}handleLibrary(e,t){let n,r;if(e.libraryKey&&this.sduiDescriptor.library){n=this.parseChild(this.sduiDescriptor.library[e.libraryKey]||{tagName:`div`});let t=(this.sduiDescriptor.library[e.libraryKey]||{}).contentElementSelector;t&&(r=n.querySelector(t))}else n=document.createElement(t);return{element:n,contentElement:r}}handleAttributes(e,t){let n=e.attributes;for(let e in n){let r=n[e],i=kn.isObject(r)?JSON.stringify(r):r;t.setAttribute(e,i)}}handleMarkup(e,t){return e.markup&&(t=document.createElement(`div`),t.style.display=`contents`,t.innerHTML=e.markup),t}handleInnerHTML(e,t){if(e.innerHTML)if(e.innerHTML.indexOf(`wording_`)!=-1){let n=this.getAncestorAttributeValue(`wordingProvider`);this.api?.post(n,{labels:[e.innerHTML.substring(8)]}).then(e=>{t&&(t.innerHTML+=e)})}else t&&(t.innerHTML+=e.innerHTML)}};O([b()],Bi.prototype,`sduiKey`,void 0),O([b()],Bi.prototype,`messagesKey`,void 0),Bi=O([v(zi)],Bi);var Vi=class extends Or(E){constructor(...e){super(...e),this._composition={},this.listeners=[]}static{this.styles=[y`
|
|
1273
1196
|
:host {
|
|
1274
1197
|
display: contents;
|
|
1275
1198
|
}
|
|
1276
|
-
`],
|
|
1277
|
-
><slot name="suffix"></slot>`}};
|
|
1278
|
-
<slot name="prefix"></slot>
|
|
1279
|
-
<slot></slot>
|
|
1280
|
-
<slot name="suffix"></slot>
|
|
1281
|
-
`}};pe.styles=[Dt,P`
|
|
1199
|
+
`]}get composition(){return this._composition}set composition(e){this._composition=e,this.updateComposition()}connectedCallback(){super.connectedCallback(),this.updateComposition()}disconnectedCallback(){this.removePublisherListeners(),super.disconnectedCallback()}updateComposition(){this.removePublisherListeners(),this.publisher&&(this.publisher.set({}),this.parseComposition(this.composition,this.publisher))}removePublisherListeners(){let e=this.listeners;this.listeners=[],e.forEach(e=>{this.publisher.offAssign(e.subscriber)})}parseComposition(e,t){if(e)for(let n in e){let r=e[n];if(typeof r==`string`){let e=r.split(`.`),i=e.shift();if(!i)continue;let a=_.get(i);a=kn.traverse(a,e);let o={publisher:a,subscriber:e=>{t[n]=e}};this.listeners.push(o),a.onAssign(o.subscriber),t._proxies_.set(n,a)}else{this.publisher[n]={};let e=new ae({},t);t._proxies_.set(n,e);let i={publisher:e,subscriber:e=>{t[n]=e}};this.listeners.push(i),e.onAssign(i.subscriber),this.parseComposition(r,e)}}}render(){return C`<slot></slot>`}};O([b({type:Object})],Vi.prototype,`composition`,null),Vi=O([v(`sonic-mix`)],Vi);var Hi=`sonic-value`,Ui=class extends Or(E){connectedCallback(){this.setAttribute(`subDataProvider`,this.getAttribute(`key`)),super.connectedCallback()}render(){return typeof this.props==`object`||this.props===void 0?C`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`:C`${D(this.props.toString())}<slot name="prefix"></slot><slot></slot
|
|
1200
|
+
><slot name="suffix"></slot>`}};Ui=O([v(Hi)],Ui);var Wi=`sonic-t`,Gi=class extends E{render(){return this.key?C`${sn(this.key,this.unsafeHTML)}`:T}};O([b({type:String})],Gi.prototype,`key`,void 0),O([b({type:Boolean})],Gi.prototype,`unsafeHTML`,void 0),Gi=O([v(Wi)],Gi);var Ki=`sonic-badge`,qi=class extends E{constructor(...e){super(...e),this.type=`default`,this.variant=`default`,this.ellipsis=!1}static{this.styles=[P,y`
|
|
1282
1201
|
:host {
|
|
1283
1202
|
--sc-badge-gap: 0.3em;
|
|
1284
1203
|
--sc-badge-py: 0.35em;
|
|
@@ -1418,28 +1337,26 @@
|
|
|
1418
1337
|
slot[name="prefix"] {
|
|
1419
1338
|
flex-shrink: 0;
|
|
1420
1339
|
}
|
|
1421
|
-
`]
|
|
1422
|
-
<
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
@click=${this.pushState?this.handlePushState:null}
|
|
1427
|
-
>
|
|
1428
|
-
<slot></slot>
|
|
1429
|
-
</a>
|
|
1430
|
-
`:b`<slot></slot>`}};Jt.styles=[P`
|
|
1340
|
+
`]}render(){return C`
|
|
1341
|
+
<slot name="prefix"></slot>
|
|
1342
|
+
<slot></slot>
|
|
1343
|
+
<slot name="suffix"></slot>
|
|
1344
|
+
`}};O([b({type:String,reflect:!0})],qi.prototype,`type`,void 0),O([b({type:String,reflect:!0})],qi.prototype,`variant`,void 0),O([b({type:String,reflect:!0})],qi.prototype,`size`,void 0),O([b({type:Boolean,reflect:!0})],qi.prototype,`ellipsis`,void 0),qi=O([v(Ki)],qi);var Ji=class{static fixBlankLink(e){let t=typeof require>`u`||typeof process!=`object`?null:require(`electron`);typeof t&&e.target==`_blank`&&e.addEventListener(`click`,()=>{t?.shell.openExternal(e.href)})}},Yi=`sonic-link`,Xi=class extends E{constructor(...e){super(...e),this.href=``,this._location=``,this.ariaLabel=null,this.autoActive=`partial`,this._target=null,this.pushState=null}static{this.styles=[y`
|
|
1431
1345
|
a {
|
|
1432
1346
|
color: inherit;
|
|
1433
1347
|
text-decoration: none;
|
|
1434
1348
|
display: contents;
|
|
1435
1349
|
}
|
|
1436
|
-
`]
|
|
1437
|
-
<
|
|
1438
|
-
|
|
1350
|
+
`]}get location(){return this._location}set location(e){this._location=e,j.updateComponentActiveState(this)}connectedCallback(){this.href&&this.href.indexOf(`http`)!=0&&(j.onChange(this),this.location=document.location.href.replace(document.location.origin,``)),this.addEventListener(`keypress`,e=>{e.key===`Enter`&&this.shadowRoot?.querySelector(`a`)?.click()}),this.setFocusable(),super.connectedCallback()}setFocusable(){this.href?this.setAttribute(`tabIndex`,`0`):this.removeAttribute(`tabIndex`)}disconnectedCallback(){j.offChange(this),super.disconnectedCallback()}set target(e){this._target=e,Ji.fixBlankLink(this),this.requestUpdate()}get target(){return this._target}handlePushState(e){e.preventDefault(),j.changeFromComponent(this)}updated(e){e.has(`href`)&&this.setFocusable()}render(){return this.href?C`
|
|
1351
|
+
<a
|
|
1352
|
+
href="${this.href}"
|
|
1353
|
+
aria-label=${this.ariaLabel||T}
|
|
1354
|
+
target=${N(this.target)}
|
|
1355
|
+
@click=${this.pushState?this.handlePushState:null}
|
|
1356
|
+
>
|
|
1439
1357
|
<slot></slot>
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
`}};te.styles=[Dt,P`
|
|
1358
|
+
</a>
|
|
1359
|
+
`:C`<slot></slot>`}};O([b({type:String})],Xi.prototype,`href`,void 0),O([b({type:String,attribute:`data-aria-label`})],Xi.prototype,`ariaLabel`,void 0),O([b({type:String})],Xi.prototype,`autoActive`,void 0),O([b({type:String})],Xi.prototype,`target`,null),O([b({type:Boolean})],Xi.prototype,`pushState`,void 0),Xi=O([v(Yi)],Xi);var Zi=`sonic-progress`,Qi=class extends E{constructor(...e){super(...e),this.max=100,this.invert=!1,this.type=`default`}static{this.styles=[P,y`
|
|
1443
1360
|
:host {
|
|
1444
1361
|
--sc-progress-bg: var(
|
|
1445
1362
|
--sc-input-bg,
|
|
@@ -1551,7 +1468,13 @@
|
|
|
1551
1468
|
gap: 0.5em;
|
|
1552
1469
|
margin-top: 0.15em;
|
|
1553
1470
|
}
|
|
1554
|
-
`]
|
|
1471
|
+
`]}render(){return C`
|
|
1472
|
+
<progress value=${N(this.value)} max=${this.max}></progress>
|
|
1473
|
+
<div class="slot-container">
|
|
1474
|
+
<slot></slot>
|
|
1475
|
+
<slot name="remaining"></slot>
|
|
1476
|
+
</div>
|
|
1477
|
+
`}};O([b({type:Number})],Qi.prototype,`value`,void 0),O([b({type:Number})],Qi.prototype,`max`,void 0),O([b({type:Boolean})],Qi.prototype,`invert`,void 0),O([b({type:String,reflect:!0})],Qi.prototype,`type`,void 0),O([b({type:String,reflect:!0})],Qi.prototype,`size`,void 0),Qi=O([v(Zi)],Qi);var $i=y`
|
|
1555
1478
|
.password-toggle {
|
|
1556
1479
|
color: var(--sc-input-c);
|
|
1557
1480
|
font-size: var(--sc-input-fs);
|
|
@@ -1562,7 +1485,7 @@
|
|
|
1562
1485
|
:host([inlineContent]) .has-suffix .password-toggle {
|
|
1563
1486
|
margin-right: 0;
|
|
1564
1487
|
}
|
|
1565
|
-
`,
|
|
1488
|
+
`,ea=y`
|
|
1566
1489
|
:host {
|
|
1567
1490
|
--sc-label-fs: var(--sc-_fs, 1rem);
|
|
1568
1491
|
--sc-label-fw: var(--sc-label-font-weight, 500);
|
|
@@ -1576,14 +1499,14 @@
|
|
|
1576
1499
|
margin-bottom: 0.22em;
|
|
1577
1500
|
display: block;
|
|
1578
1501
|
}
|
|
1579
|
-
`,
|
|
1502
|
+
`,ta=y`
|
|
1580
1503
|
.form-description {
|
|
1581
1504
|
color: var(--sc-base-400, var(--sc-base-content, #000));
|
|
1582
1505
|
font-size: 0.85em;
|
|
1583
1506
|
margin-top: 0.2em;
|
|
1584
1507
|
display: block;
|
|
1585
1508
|
}
|
|
1586
|
-
`,
|
|
1509
|
+
`,na=y`
|
|
1587
1510
|
* {
|
|
1588
1511
|
box-sizing: border-box;
|
|
1589
1512
|
}
|
|
@@ -1938,25 +1861,29 @@
|
|
|
1938
1861
|
--sc-input-addon-bg: var(--sc-primary, var(--sc-base-content, #000));
|
|
1939
1862
|
--sc-input-addon-color: var(--sc-primary-content, var(--sc-base, #fff));
|
|
1940
1863
|
}
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1864
|
+
`,ra=Lt(class extends Rt{constructor(e){if(super(e),e.type!==It.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter((t=>e[t])).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter((e=>e!==``))));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return w}}),ia=`sonic-input`,V=class extends Cr(gn(k(E))){constructor(...e){super(...e),this.readonly=!1,this.inlineContent=!1,this.disableInlineContentFocus=!1,this.showPasswordToggle=!1,this.autoActive=!1,this.active=!1,this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1,this.isPassword=!1}static{this.styles=[P,na,ea,ta,$i,y`
|
|
1865
|
+
:host([type="hidden"]) {
|
|
1866
|
+
appearance: none !important;
|
|
1867
|
+
display: none !important;
|
|
1868
|
+
}
|
|
1869
|
+
:host > .form-control {
|
|
1870
|
+
position: relative;
|
|
1871
|
+
}
|
|
1872
|
+
`]}connectedCallback(){if(super.connectedCallback(),this.hasSlotOrProps(),this.hasAttribute(`sameValueAs`)){this.sameValueAsName=this.getAttribute(`sameValueAs`),this.sameValueAsHandle=e=>this.pattern=this.escapeRegExp(e);let e=this.getFormPublisher();if(!e)return;e[this.sameValueAsName].onAssign(this.sameValueAsHandle)}this.type==`password`&&(this.isPassword=!0,this.showPasswordToggle=!0,this.inlineContent=!0)}disconnectedCallback(){if(super.disconnectedCallback(),this.hasAttribute(`sameValueAs`)&&this.sameValueAsName){let e=this.getFormPublisher();if(!e)return;e[this.sameValueAsName].offAssign(this.sameValueAsHandle)}}escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}willUpdate(e){this.hasSlotOrProps(),this.autoActive&&e.has(`value`)&&(this.active=!!this.value),super.willUpdate(e)}setSelectionRange(e,t){this.input.setSelectionRange(e,t)}hasSlotOrProps(){this.hasLabel=!!(this.label||this.slotLabelNodes?.length),this.hasDescription=!!(this.description||this.slotDescriptionNodes?.length),this.hasSuffix=!!this.slotSuffixNodes?.length,this.hasPrefix=!!this.slotPrefixNodes?.length}inlineContentFocus(){!this.inlineContent||this.disableInlineContentFocus||this.input?.focus()}handleChange(e){if(!this.hasAttribute(`inputDelayMs`)){super.handleChange(e);return}this.changeTimeoutId&&clearTimeout(this.changeTimeoutId),this.changeTimeoutId=setTimeout(()=>super.handleChange(e),parseInt(this.getAttribute(`inputDelayMs`)))}togglePasswordVisibility(e){e.preventDefault(),e.stopPropagation(),this.isPassword=!this.isPassword,this._type=this.isPassword?`password`:`text`}render(){let e={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix,"no-suffix":!this.hasSuffix,"no-prefix":!this.hasPrefix};return C`
|
|
1873
|
+
<label for="${this.id||`form-element`}" class="${this.hasLabel?`form-label`:`hidden`}"
|
|
1874
|
+
>${this.label?D(this.label):``}<slot
|
|
1948
1875
|
name="label"
|
|
1949
1876
|
@slotchange=${this.hasSlotOrProps}
|
|
1950
1877
|
></slot
|
|
1951
1878
|
></label>
|
|
1952
1879
|
|
|
1953
|
-
<div @click=${this.inlineContentFocus} class="form-control ${
|
|
1954
|
-
<div part="content" class="${this.inlineContent
|
|
1880
|
+
<div @click=${this.inlineContentFocus} class="form-control ${ra(e)}">
|
|
1881
|
+
<div part="content" class="${this.inlineContent?`form-element form-element-wrapper`:`contents`}">
|
|
1955
1882
|
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
1956
1883
|
<input
|
|
1957
1884
|
data-form-element
|
|
1958
1885
|
part="input"
|
|
1959
|
-
id=${
|
|
1886
|
+
id=${N(this.id||`form-element`)}
|
|
1960
1887
|
part="input"
|
|
1961
1888
|
class="form-element input"
|
|
1962
1889
|
@input=${this.handleChange}
|
|
@@ -1965,25 +1892,25 @@
|
|
|
1965
1892
|
?disabled=${this.disabled}
|
|
1966
1893
|
?readonly=${this.readonly}
|
|
1967
1894
|
?autofocus=${this.autofocus}
|
|
1968
|
-
list=${
|
|
1969
|
-
tabindex=${
|
|
1970
|
-
pattern=${
|
|
1971
|
-
min=${
|
|
1972
|
-
max=${
|
|
1973
|
-
step=${
|
|
1974
|
-
inputmode=${
|
|
1975
|
-
src=${
|
|
1976
|
-
minlength=${
|
|
1977
|
-
maxlength=${
|
|
1978
|
-
placeholder=${
|
|
1895
|
+
list=${N(this.list)}
|
|
1896
|
+
tabindex=${N(this.tabindex)}
|
|
1897
|
+
pattern=${N(this.pattern)}
|
|
1898
|
+
min=${N(this.min)}
|
|
1899
|
+
max=${N(this.max)}
|
|
1900
|
+
step=${N(this.step)}
|
|
1901
|
+
inputmode=${N(this.inputmode)}
|
|
1902
|
+
src=${N(this.src)}
|
|
1903
|
+
minlength=${N(this.minlength)}
|
|
1904
|
+
maxlength=${N(this.maxlength)}
|
|
1905
|
+
placeholder=${N(this.placeholder)}
|
|
1979
1906
|
?required=${this.required}
|
|
1980
|
-
autocomplete=${
|
|
1981
|
-
aria-label=${
|
|
1982
|
-
aria-labelledby=${
|
|
1907
|
+
autocomplete=${N(this.autocomplete)}
|
|
1908
|
+
aria-label=${N(this.ariaLabel)}
|
|
1909
|
+
aria-labelledby=${N(this.ariaLabelledby)}
|
|
1983
1910
|
.name=${this.name}
|
|
1984
1911
|
.value=${this.value}
|
|
1985
1912
|
/>
|
|
1986
|
-
${this.showPasswordToggle?
|
|
1913
|
+
${this.showPasswordToggle?C`<sonic-button
|
|
1987
1914
|
shape="circle"
|
|
1988
1915
|
class="password-toggle"
|
|
1989
1916
|
@click=${this.togglePasswordVisibility}
|
|
@@ -1992,9 +1919,9 @@
|
|
|
1992
1919
|
>
|
|
1993
1920
|
<sonic-icon
|
|
1994
1921
|
library="heroicons"
|
|
1995
|
-
name=${this.isPassword
|
|
1922
|
+
name=${this.isPassword?`eye`:`eye-slash`}
|
|
1996
1923
|
></sonic-icon>
|
|
1997
|
-
</sonic-button
|
|
1924
|
+
</sonic-button>`:``}
|
|
1998
1925
|
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
1999
1926
|
</div>
|
|
2000
1927
|
</div>
|
|
@@ -2003,19 +1930,11 @@
|
|
|
2003
1930
|
<slot
|
|
2004
1931
|
name="description"
|
|
2005
1932
|
@slotchange=${this.hasSlotOrProps}
|
|
2006
|
-
class="${this.hasDescription
|
|
2007
|
-
>${this.description?
|
|
1933
|
+
class="${this.hasDescription?`form-description`:`hidden`}"
|
|
1934
|
+
>${this.description?C`${D(this.description)}`:T}</slot>
|
|
2008
1935
|
<slot name="list"></slot>
|
|
2009
1936
|
</div>
|
|
2010
|
-
`}};
|
|
2011
|
-
:host([type="hidden"]) {
|
|
2012
|
-
appearance: none !important;
|
|
2013
|
-
display: none !important;
|
|
2014
|
-
}
|
|
2015
|
-
:host > .form-control {
|
|
2016
|
-
position: relative;
|
|
2017
|
-
}
|
|
2018
|
-
`],R([a({type:String,reflect:!0})],j.prototype,"size",2),R([a({type:String})],j.prototype,"inputmode",2),R([a({type:String})],j.prototype,"list",2),R([a({type:String})],j.prototype,"placeholder",2),R([a({type:String})],j.prototype,"pattern",2),R([a({type:String})],j.prototype,"min",2),R([a({type:String})],j.prototype,"max",2),R([a({type:Boolean,reflect:!0})],j.prototype,"readonly",2),R([a({type:Number})],j.prototype,"step",2),R([a({type:Number})],j.prototype,"minlength",2),R([a({type:Number})],j.prototype,"maxlength",2),R([a({type:String})],j.prototype,"src",2),R([a({type:Boolean,reflect:!0})],j.prototype,"inlineContent",2),R([a({type:Boolean})],j.prototype,"disableInlineContentFocus",2),R([a({type:Boolean})],j.prototype,"showPasswordToggle",2),R([a({type:Boolean})],j.prototype,"autoActive",2),R([a({type:Boolean,reflect:!0})],j.prototype,"active",2),R([at({slot:"label",flatten:!0})],j.prototype,"slotLabelNodes",2),R([at({slot:"description",flatten:!0})],j.prototype,"slotDescriptionNodes",2),R([at({slot:"suffix",flatten:!0})],j.prototype,"slotSuffixNodes",2),R([at({slot:"prefix",flatten:!0})],j.prototype,"slotPrefixNodes",2),R([Kt("input")],j.prototype,"input",2),R([E()],j.prototype,"hasDescription",2),R([E()],j.prototype,"hasLabel",2),R([E()],j.prototype,"hasSuffix",2),R([E()],j.prototype,"hasPrefix",2),R([E()],j.prototype,"isPassword",2),j=R([x(Ga)],j);const Dr=P`
|
|
1937
|
+
`}};O([b({type:String,reflect:!0})],V.prototype,`size`,void 0),O([b({type:String})],V.prototype,`inputmode`,void 0),O([b({type:String})],V.prototype,`list`,void 0),O([b({type:String})],V.prototype,`placeholder`,void 0),O([b({type:String})],V.prototype,`pattern`,void 0),O([b({type:String})],V.prototype,`min`,void 0),O([b({type:String})],V.prototype,`max`,void 0),O([b({type:Boolean,reflect:!0})],V.prototype,`readonly`,void 0),O([b({type:Number})],V.prototype,`step`,void 0),O([b({type:Number})],V.prototype,`minlength`,void 0),O([b({type:Number})],V.prototype,`maxlength`,void 0),O([b({type:String})],V.prototype,`src`,void 0),O([b({type:Boolean,reflect:!0})],V.prototype,`inlineContent`,void 0),O([b({type:Boolean})],V.prototype,`disableInlineContentFocus`,void 0),O([b({type:Boolean})],V.prototype,`showPasswordToggle`,void 0),O([b({type:Boolean})],V.prototype,`autoActive`,void 0),O([b({type:Boolean,reflect:!0})],V.prototype,`active`,void 0),O([S({slot:`label`,flatten:!0})],V.prototype,`slotLabelNodes`,void 0),O([S({slot:`description`,flatten:!0})],V.prototype,`slotDescriptionNodes`,void 0),O([S({slot:`suffix`,flatten:!0})],V.prototype,`slotSuffixNodes`,void 0),O([S({slot:`prefix`,flatten:!0})],V.prototype,`slotPrefixNodes`,void 0),O([Ue(`input`)],V.prototype,`input`,void 0),O([x()],V.prototype,`hasDescription`,void 0),O([x()],V.prototype,`hasLabel`,void 0),O([x()],V.prototype,`hasSuffix`,void 0),O([x()],V.prototype,`hasPrefix`,void 0),O([x()],V.prototype,`isPassword`,void 0),V=O([v(ia)],V);var aa=y`
|
|
2019
1938
|
/*OMBRE*/
|
|
2020
1939
|
:host([shadow]) .shadowable,
|
|
2021
1940
|
:host([shadow="md"]) .shadowable,
|
|
@@ -2034,21 +1953,7 @@
|
|
|
2034
1953
|
:host([shadow="none"]) .shadowable {
|
|
2035
1954
|
box-shadow: none;
|
|
2036
1955
|
}
|
|
2037
|
-
|
|
2038
|
-
<slot
|
|
2039
|
-
@click=${this.manual?()=>{}:this.toggle}
|
|
2040
|
-
@keydown=${this.manual?()=>{}:this.toggle}
|
|
2041
|
-
class="contents"
|
|
2042
|
-
></slot>
|
|
2043
|
-
<slot
|
|
2044
|
-
name="content"
|
|
2045
|
-
tabindex="-1"
|
|
2046
|
-
part="content"
|
|
2047
|
-
style="display: none;"
|
|
2048
|
-
class="shadowable
|
|
2049
|
-
${this.open?"is-open":""}"
|
|
2050
|
-
></slot>
|
|
2051
|
-
`}};it.pops=new Set,it.styles=[P`
|
|
1956
|
+
`,oa,sa=`sonic-pop`,H=class extends E{static{oa=this}constructor(...e){super(...e),this.open=!1,this.noToggle=!1,this.inline=!1,this.manual=!1,this.shadow=`lg`,this.placement=`bottom`,this.positioningRuns=!1,this.lastContentX=0,this.lastContentY=0,this.resizeObserver=new ResizeObserver(()=>this.computePosition(this.placement)),this.triggerElement=null,this.ancestorsHavingZIndex=new Set,this._handleKeyDown=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.hide())}}static{this.pops=new Set}static{this.styles=[y`
|
|
2052
1957
|
:host {
|
|
2053
1958
|
display: inline-block;
|
|
2054
1959
|
vertical-align: middle;
|
|
@@ -2080,11 +1985,42 @@
|
|
|
2080
1985
|
:host([inline]) {
|
|
2081
1986
|
vertical-align: baseline;
|
|
2082
1987
|
}
|
|
2083
|
-
`,
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
1988
|
+
`,aa]}runPositioningLoop(){this.positioningRuns&&(this.positioningRuns=!0,this.computePosition(this.placement),window.requestAnimationFrame(()=>this.runPositioningLoop()))}toggle(e){if(this.open&&this.noToggle)return;let t=e;e.type==`keydown`&&(t.key!=`ArrowDown`||this.open)||(this.open||(this.triggerElement=e.target),this.open=!this.open,this.open?this.show():this.hide())}show(){this.setMaxZindex(),this.popContent?.style?.removeProperty(`display`),this.open=!0,this.popContent.setAttribute(`tabindex`,`0`),this.popBtn&&this.popContent&&!this.positioningRuns&&(this.positioningRuns=!0,this.lastContentX=0,this.lastContentY=0,this.runPositioningLoop()),this.dispatchEvent(new CustomEvent(`show`))}hide(){this.resetZindexes(),this.open=!1,this.popContent.setAttribute(`tabindex`,`-1`),this.positioningRuns=!1,this.triggerElement&&=(this.triggerElement.focus(),null),Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),this.dispatchEvent(new CustomEvent(`hide`))}setMaxZindex(){l.everyAncestors(this,e=>{let t=e;if(!t.className)return!0;if([...t.classList].includes(`@container`)){let n=t.style;n.zIndex=`999999999`;let r=getComputedStyle(t);return r.position!==`relative`&&r.position!==`absolute`&&(n.position=`relative`),this.ancestorsHavingZIndex.add(e),!1}return!0})}resetZindexes(){this.ancestorsHavingZIndex.forEach(e=>{e.style.removeProperty(`position`),e.style.removeProperty(`z-index`)}),this.ancestorsHavingZIndex.clear()}_handleClosePop(e){let t=e.composedPath(),n=t[0];oa.pops.forEach(r=>{let i=t.includes(r),a=t.includes(r.querySelector(`[slot="content"]`)),o=l.getAncestorAttributeValue(n,`data-on-select`)===`keep`;e.type==`pointerdown`&&i||e.type==`click`&&(i&&o||!a)||r.hide()})}connectedCallback(){super.connectedCallback(),oa.pops.size==0&&(document.addEventListener(`pointerdown`,this._handleClosePop),document.addEventListener(`click`,this._handleClosePop),document.addEventListener(`keydown`,this._handleKeyDown)),oa.pops.add(this)}firstUpdated(e){super.firstUpdated(e),this.resizeObserver.observe(this.popContent)}disconnectedCallback(){this.popContent&&this.resizeObserver.unobserve(this.popContent),super.disconnectedCallback(),oa.pops.delete(this),oa.pops.size==0&&(document.removeEventListener(`pointerdown`,this._handleClosePop),document.removeEventListener(`click`,this._handleClosePop),document.removeEventListener(`keydown`,this._handleKeyDown))}computePosition(e){let t=e.split(` `),n=t[0],r=t[1],i=this.getBoundingClientRect(),a=l.getScrollableAncestor(this.popContent)?.getBoundingClientRect(),o=Math.max(0,a?.left||0)+5,s=Math.max(0,a?.top||0)+5,c=Math.min(window.innerWidth,a?.right||window.innerWidth)-5,u=Math.min(window.innerHeight,a?.bottom||window.innerHeight)-5,d=i.left,f=i.top,p=d,m=f,h=this.popContent?.getBoundingClientRect(),ee=f-h.height,te=d-h.width,ne=d+i.width,g=f+i.height,re=d+(i.width-h.width)*.5,ie=f+(i.height-h.height)*.5;switch(n){case`bottom`:m=g,r==`center`&&(p=re);break;case`top`:m=ee,r==`center`&&(p=re);break;case`left`:p=te,r==`center`&&(m=ie);break;case`right`:p=ne,r==`center`&&(m=ie);break}this.lastContentX+=p-h.x,this.lastContentY+=m-h.y,Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),h=this.popContent?.getBoundingClientRect(),h.x<o&&n==`left`&&(p=ne),h.y<s&&n==`top`&&(m=g),h.x+h.width>c&&n==`right`&&(p=te),h.y+h.height>u&&n==`bottom`&&(m=ee),this.lastContentX+=p-h.x,this.lastContentY+=m-h.y,Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),h=this.popContent?.getBoundingClientRect(),h.x<o&&(this.lastContentX+=o-h.x),h.y<s&&(this.lastContentY+=s-h.y),Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),h=this.popContent?.getBoundingClientRect(),h.x+h.width>c&&(this.lastContentX+=c-(h.x+h.width)),h.y+h.height>u&&(this.lastContentY+=u-(h.y+h.height)),Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`})}render(){return C`
|
|
1989
|
+
<slot
|
|
1990
|
+
@click=${this.manual?()=>{}:this.toggle}
|
|
1991
|
+
@keydown=${this.manual?()=>{}:this.toggle}
|
|
1992
|
+
class="contents"
|
|
1993
|
+
></slot>
|
|
1994
|
+
<slot
|
|
1995
|
+
name="content"
|
|
1996
|
+
tabindex="-1"
|
|
1997
|
+
part="content"
|
|
1998
|
+
style="display: none;"
|
|
1999
|
+
class="shadowable
|
|
2000
|
+
${this.open?`is-open`:``}"
|
|
2001
|
+
></slot>
|
|
2002
|
+
`}};O([x()],H.prototype,`open`,void 0),O([Ue(`slot:not([name=content])`)],H.prototype,`popBtn`,void 0),O([Ue(`slot[name=content]`)],H.prototype,`popContent`,void 0),O([b({type:Boolean})],H.prototype,`noToggle`,void 0),O([b({type:Boolean,reflect:!0})],H.prototype,`inline`,void 0),O([b({type:Boolean})],H.prototype,`manual`,void 0),O([b({type:String,reflect:!0})],H.prototype,`shadow`,void 0),O([b({type:String})],H.prototype,`placement`,void 0),O([x()],H.prototype,`triggerElement`,void 0),H=oa=O([v(sa)],H);var ca=`sonic-menu-item`,la=class extends F{constructor(){super()}connectedCallback(){this.hasAttribute(`variant`)||(this.variant=`ghost`),this.hasAttribute(`type`)||(this.type=`default`),this.hasAttribute(`shape`)||(this.shape=`block`);let e=this.shape===`square`||this.shape===`circle`;!this.hasAttribute(`align`)&&!e&&(this.align=`left`),super.connectedCallback()}};la=O([v(ca)],la);var ua=class{constructor(e,{target:t,config:n,callback:r,skipInitial:i}){this.t=new Set,this.o=!1,this.i=!1,this.h=e,t!==null&&this.t.add(t??e),this.l=n,this.o=i??this.o,this.callback=r,window.ResizeObserver?(this.u=new ResizeObserver((e=>{this.handleChanges(e),this.h.requestUpdate()})),e.addController(this)):console.warn(`ResizeController error: browser does not support ResizeObserver.`)}handleChanges(e){this.value=this.callback?.(e,this.u)}hostConnected(){for(let e of this.t)this.observe(e)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(e){this.t.add(e),this.u.observe(e,this.l),this.i=!0,this.h.requestUpdate()}unobserve(e){this.t.delete(e),this.u.unobserve(e)}disconnect(){this.u.disconnect()}},U=class extends kr(Dr(Er(Or(E)))){constructor(...e){super(...e),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 ua(this,{}),this.isPopVisible=!1,this.searchDataProvider=``,this.initSearchDataProvider=``,this.queueDataProvider=``,this.initQueueDataProvider=``,this.lastValidSearch=``,this.updateSearchParameter=e=>{if(e==``&&this.isSearchParameter()){this.lastValidSearch=``;return}this.queryQueueListItem(this.queueDataProvider,this.findSelection,this.setSearchFromSelection)===!1&&this.isSearchParameter()&&(this.lastValidSearch=e,this.searchPublisher?.set(this.lastValidSearch))},this.updatePopContentVisibility=e=>{this.isPopVisible=(e?.length||0)>=this.minSearchLength},this.initSearchParameter=()=>{this.queryQueueListItem(this.initQueueDataProvider,this.findSelection,this.setSearchFromSelection)},this.selectListItem=e=>{let t=this.propertyName===`_self`?e:e[this.propertyName||this.name];this.formValuePublisher?.set(t)},this.findSearchedItem=e=>(this.propertyName===`_self`?e:e[this.propertyName||this.searchParameter||this.name])==this.searchPublisher?.get(),this.findSelection=e=>(this.propertyName===`_self`?e:e[this.propertyName||this.name])==this.value,this.setSearchFromSelection=e=>{this.lastValidSearch=this.propertyName===`_self`?e:e[this.searchParameter||this.propertyName||this.name],this.isSearchParameter()&&this.searchPublisher?.set(this.lastValidSearch)},this.updateActiveSelection=()=>{this.queryQueueListItem(this.queueDataProvider,this.findSearchedItem,this.selectListItem),!this.select&&this.lastValidSearch&&this.lastValidSearch!=this.searchPublisher?.get()&&this.formValuePublisher?.get()&&this.formValuePublisher?.set(``)},this.handleFocusOut=e=>{setTimeout(()=>{let e=document.activeElement;if(!e){this.popElement.hide();return}let t=this.popElement.contains(e)||this.popElement.shadowRoot?.contains(e),n=this.contains(e)||this.shadowRoot?.contains(e);!t&&!n&&this.popElement.hide()},0)}}static{this.styles=[ar,y`
|
|
2003
|
+
:host {
|
|
2004
|
+
display: block;
|
|
2005
|
+
}
|
|
2006
|
+
/**disable mouse if there is an attribute readonly */
|
|
2007
|
+
:host([readonly]),
|
|
2008
|
+
:host([disabled]) {
|
|
2009
|
+
pointer-events: none;
|
|
2010
|
+
cursor: not-allowed;
|
|
2011
|
+
user-select: none;
|
|
2012
|
+
}
|
|
2013
|
+
:host([disabled]) {
|
|
2014
|
+
opacity: 0.43;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
sonic-menu {
|
|
2018
|
+
display: block;
|
|
2019
|
+
max-height: clamp(12rem, 20vh, 20rem);
|
|
2020
|
+
min-width: 14rem;
|
|
2021
|
+
width: 100%;
|
|
2022
|
+
}
|
|
2023
|
+
`]}hasSlotOrProps(){this.hasInputPrefix=!!this.slotInputPrefixNodes?.length}isSearchParameter(){return!this.searchParameter||this.searchParameter===this.name}connectedCallback(){super.connectedCallback();let e=this.searchParameter||this.name,t=this.getAncestorAttributeValue(`formDataProvider`),n=t+`__`+this.name+`__autocomplete`;this.initSearchDataProvider=`${n}_init_search__`,this.initQueueDataProvider=`${n}_init_queue__`,this.searchDataProvider=`${n}_search__`,this.queueDataProvider=`${n}_queue__`;let r=_.get;this.searchPublisher=r(this.searchDataProvider)[e],this.formValuePublisher=p(r(t),this.name),this.countPublisher=r(this.queueDataProvider).resultCount,this.initCountPublisher=r(this.initQueueDataProvider).resultCount,this.value&&_.get(this.initSearchDataProvider)[this.name].set(this.value),this.initCountPublisher?.onAssign(this.initSearchParameter),this.formValuePublisher?.onAssign(this.updateSearchParameter),this.countPublisher?.onAssign(this.updateActiveSelection),this.searchPublisher?.onAssign(this.updatePopContentVisibility)}firstUpdated(e){super.firstUpdated(e),this.popElement.addEventListener(`focusout`,this.handleFocusOut)}disconnectedCallback(){super.disconnectedCallback(),this.initCountPublisher?.offAssign(this.initSearchParameter),this.formValuePublisher?.offAssign(this.updateSearchParameter),this.countPublisher?.offAssign(this.updateActiveSelection);let e=_.get;e(this.initSearchDataProvider).delete(),e(this.initQueueDataProvider).delete(),e(this.searchDataProvider).delete(),e(this.queueDataProvider).delete(),this.searchPublisher?.offAssign(this.updatePopContentVisibility),this.popElement.removeEventListener(`focusout`,this.handleFocusOut)}queryQueueListItem(e,t,n){let r=_.get(e),i,a=r.get();if(!a||!Array.isArray(a)||!a.length)return!1;for(let e of a){let n=_.get(e.dataProvider).get();if(Array.isArray(n)&&(i=n.find(t),i))break}return i?(n(i),!0):!1}setSelectionRange(e,t){this.querySelector(`sonic-input`)?.setSelectionRange(e,t)}handleHide(){if(this.select){if(this.searchPublisher?.get()==``){this.lastValidSearch=``,this.formValuePublisher?.set(``);return}this.searchPublisher?.set(this.lastValidSearch)}}getInputValue(){return this.isSearchParameter()?this.searchPublisher?.get():this.lastValidSearch}handleFocus(){this.popElement.show()}render(){return C`
|
|
2088
2024
|
<sonic-pop manual style="display:block;" @hide=${this.handleHide}>
|
|
2089
2025
|
<sonic-input
|
|
2090
2026
|
class="form-element"
|
|
@@ -2092,19 +2028,19 @@
|
|
|
2092
2028
|
noAutofill
|
|
2093
2029
|
formDataProvider="${this.searchDataProvider}"
|
|
2094
2030
|
type="search"
|
|
2095
|
-
data-keyboard-nav="${this.getAttribute(
|
|
2096
|
-
label="${
|
|
2097
|
-
description="${
|
|
2098
|
-
name="${
|
|
2031
|
+
data-keyboard-nav="${this.getAttribute(`data-keyboard-nav`)||``}"
|
|
2032
|
+
label="${N(this.label)}"
|
|
2033
|
+
description="${N(this.description)}"
|
|
2034
|
+
name="${N(this.searchParameter||this.name)}"
|
|
2099
2035
|
?required=${this.required}
|
|
2100
|
-
placeholder="${
|
|
2036
|
+
placeholder="${N(this.placeholder)}"
|
|
2101
2037
|
?readonly="${this.readonly}"
|
|
2102
2038
|
autocomplete="off"
|
|
2103
2039
|
clearable
|
|
2104
2040
|
inlineContent
|
|
2105
2041
|
size=${this.size}
|
|
2106
2042
|
@focus=${this.handleFocus}
|
|
2107
|
-
value=${
|
|
2043
|
+
value=${N(this.getInputValue())}
|
|
2108
2044
|
>
|
|
2109
2045
|
<slot
|
|
2110
2046
|
name="prefix"
|
|
@@ -2112,19 +2048,19 @@
|
|
|
2112
2048
|
@slotchange=${this.hasSlotOrProps}
|
|
2113
2049
|
></slot>
|
|
2114
2050
|
|
|
2115
|
-
${this.select?
|
|
2051
|
+
${this.select?C`
|
|
2116
2052
|
<sonic-icon
|
|
2117
2053
|
slot="suffix"
|
|
2118
2054
|
class="select-chevron"
|
|
2119
2055
|
name="nav-arrow-down"
|
|
2120
2056
|
.size=${this.size}
|
|
2121
2057
|
></sonic-icon>
|
|
2122
|
-
`:
|
|
2058
|
+
`:T}
|
|
2123
2059
|
</sonic-input>
|
|
2124
2060
|
<sonic-menu
|
|
2125
2061
|
slot="content"
|
|
2126
2062
|
class="custom-scroll"
|
|
2127
|
-
style="${this.offsetWidth?`width: ${this.offsetWidth}px
|
|
2063
|
+
style="${this.offsetWidth?`width: ${this.offsetWidth}px`:``}; display:${this.isPopVisible?`block`:`none`};"
|
|
2128
2064
|
>
|
|
2129
2065
|
<sonic-queue
|
|
2130
2066
|
dataProvider="${this.queueDataProvider}"
|
|
@@ -2149,28 +2085,7 @@
|
|
|
2149
2085
|
</sonic-queue>
|
|
2150
2086
|
</sonic-menu>
|
|
2151
2087
|
</sonic-pop>
|
|
2152
|
-
`}};
|
|
2153
|
-
:host {
|
|
2154
|
-
display: block;
|
|
2155
|
-
}
|
|
2156
|
-
/**disable mouse if there is an attribute readonly */
|
|
2157
|
-
:host([readonly]),
|
|
2158
|
-
:host([disabled]) {
|
|
2159
|
-
pointer-events: none;
|
|
2160
|
-
cursor: not-allowed;
|
|
2161
|
-
user-select: none;
|
|
2162
|
-
}
|
|
2163
|
-
:host([disabled]) {
|
|
2164
|
-
opacity: 0.43;
|
|
2165
|
-
}
|
|
2166
|
-
|
|
2167
|
-
sonic-menu {
|
|
2168
|
-
display: block;
|
|
2169
|
-
max-height: clamp(12rem, 20vh, 20rem);
|
|
2170
|
-
min-width: 14rem;
|
|
2171
|
-
width: 100%;
|
|
2172
|
-
}
|
|
2173
|
-
`],lt([a({type:String})],rt.prototype,"size",2),lt([a({type:String})],rt.prototype,"placeholder",2),lt([a()],rt.prototype,"filteredFields",2),lt([a({type:Boolean,reflect:!0})],rt.prototype,"readonly",2),lt([a({type:String})],rt.prototype,"dataProviderExpression",2),lt([a({type:Number})],rt.prototype,"minSearchLength",2),lt([a({type:Boolean})],rt.prototype,"select",2),lt([a({type:String})],rt.prototype,"key",2),lt([a({type:String})],rt.prototype,"searchParameter",2),lt([a({type:String})],rt.prototype,"propertyName",2),lt([at({slot:"prefix",flatten:!0})],rt.prototype,"slotInputPrefixNodes",2),lt([E()],rt.prototype,"hasInputPrefix",2),lt([Kt("sonic-pop")],rt.prototype,"popElement",2),lt([E()],rt.prototype,"isPopVisible",2),lt([E()],rt.prototype,"lastValidSearch",2),rt=lt([x("sonic-input-autocomplete")],rt);var nl=Object.defineProperty,al=Object.getOwnPropertyDescriptor,ft=(r,t,i,s)=>{for(var e=s>1?void 0:s?al(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=(s?n(t,i,e):n(e))||e);return s&&e&&nl(t,i,e),e};const ll="sonic-password-helper";let ct=class extends Gt(w){constructor(){super(...arguments),this.minChars=8,this.hasNoChar=!0,this.hasEnoughChars=!1,this.hasMinuscule=!1,this.hasMajuscule=!1,this.hasNumber=!1,this.hasSpecialChar=!1,this.wording_password_helper_decription="Le mot de passe doit contenir au moins :",this.wording_password_helper_min_length="8 caractères",this.wording_password_helper_lower_case="1 minuscule",this.wording_password_helper_upper_case="1 majuscule",this.wording_password_helper_number="1 chiffre",this.wording_password_helper_special_char="1 caractère spécial"}connectedCallback(){super.connectedCallback(),this.name&&(this.checkValue=t=>{t?(this.hasNoChar=t.length==0,this.hasEnoughChars=t.length>this.minChars):(this.hasNoChar=!0,this.hasEnoughChars=!1),this.hasMinuscule=/[a-z]/.test(t),this.hasMajuscule=/[A-Z]/.test(t),this.hasNumber=/[0-9]/.test(t),this.hasSpecialChar=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/.test(t)},k.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].onAssign(this.checkValue))}disconnectedCallback(){this.checkValue&&this.name&&k.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].offAssign(this.checkValue),super.disconnectedCallback()}getIcon(t){return t?b`<sonic-icon library="heroicons" name="face-smile"></sonic-icon>`:b`<sonic-icon library="heroicons" name="x-mark"></sonic-icon>`}render(){return this.hasNoChar?S:b`
|
|
2088
|
+
`}};O([b({type:String})],U.prototype,`size`,void 0),O([b({type:String})],U.prototype,`placeholder`,void 0),O([b()],U.prototype,`filteredFields`,void 0),O([b({type:Boolean,reflect:!0})],U.prototype,`readonly`,void 0),O([b({type:String})],U.prototype,`dataProviderExpression`,void 0),O([b({type:Number})],U.prototype,`minSearchLength`,void 0),O([b({type:Boolean})],U.prototype,`select`,void 0),O([b({type:String})],U.prototype,`key`,void 0),O([b({type:String})],U.prototype,`searchParameter`,void 0),O([b({type:String})],U.prototype,`propertyName`,void 0),O([S({slot:`prefix`,flatten:!0})],U.prototype,`slotInputPrefixNodes`,void 0),O([x()],U.prototype,`hasInputPrefix`,void 0),O([Ue(`sonic-pop`)],U.prototype,`popElement`,void 0),O([x()],U.prototype,`isPopVisible`,void 0),O([x()],U.prototype,`lastValidSearch`,void 0),U=O([v(`sonic-input-autocomplete`)],U);var da=`sonic-password-helper`,W=class extends Or(E){constructor(...e){super(...e),this.minChars=8,this.hasNoChar=!0,this.hasEnoughChars=!1,this.hasMinuscule=!1,this.hasMajuscule=!1,this.hasNumber=!1,this.hasSpecialChar=!1,this.wording_password_helper_decription=`Le mot de passe doit contenir au moins :`,this.wording_password_helper_min_length=`8 caractères`,this.wording_password_helper_lower_case=`1 minuscule`,this.wording_password_helper_upper_case=`1 majuscule`,this.wording_password_helper_number=`1 chiffre`,this.wording_password_helper_special_char=`1 caractère spécial`}connectedCallback(){super.connectedCallback(),this.name&&(this.checkValue=e=>{e?(this.hasNoChar=e.length==0,this.hasEnoughChars=e.length>this.minChars):(this.hasNoChar=!0,this.hasEnoughChars=!1),this.hasMinuscule=/[a-z]/.test(e),this.hasMajuscule=/[A-Z]/.test(e),this.hasNumber=/[0-9]/.test(e),this.hasSpecialChar=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/.test(e)},_.get(this.getAncestorAttributeValue(`formDataProvider`))[this.name].onAssign(this.checkValue))}disconnectedCallback(){this.checkValue&&this.name&&_.get(this.getAncestorAttributeValue(`formDataProvider`))[this.name].offAssign(this.checkValue),super.disconnectedCallback()}getIcon(e){return e?C`<sonic-icon library="heroicons" name="face-smile"></sonic-icon>`:C`<sonic-icon library="heroicons" name="x-mark"></sonic-icon>`}render(){return this.hasNoChar?T:C`
|
|
2174
2089
|
<div>${this.wording_password_helper_decription}</div>
|
|
2175
2090
|
<div>
|
|
2176
2091
|
${this.getIcon(this.hasEnoughChars)}
|
|
@@ -2191,39 +2106,11 @@
|
|
|
2191
2106
|
${this.getIcon(this.hasSpecialChar)}
|
|
2192
2107
|
${this.wording_password_helper_special_char}
|
|
2193
2108
|
</div>
|
|
2194
|
-
`}};
|
|
2109
|
+
`}};O([b()],W.prototype,`name`,void 0),O([b()],W.prototype,`minChars`,void 0),O([x()],W.prototype,`hasNoChar`,void 0),O([x()],W.prototype,`hasEnoughChars`,void 0),O([x()],W.prototype,`hasMinuscule`,void 0),O([x()],W.prototype,`hasMajuscule`,void 0),O([x()],W.prototype,`hasNumber`,void 0),O([x()],W.prototype,`hasSpecialChar`,void 0),O([b()],W.prototype,`wording_password_helper_decription`,void 0),O([b()],W.prototype,`wording_password_helper_min_length`,void 0),O([b()],W.prototype,`wording_password_helper_lower_case`,void 0),O([b()],W.prototype,`wording_password_helper_upper_case`,void 0),O([b()],W.prototype,`wording_password_helper_number`,void 0),O([b()],W.prototype,`wording_password_helper_special_char`,void 0),W=O([v(da)],W);var fa=`sonic-same-value-helper`,pa=class extends Or(E){constructor(...e){super(...e),this.descriptionWhenEqual=`Correspondance : oui`,this.descriptionWhenNotEqual=`Correspondance : non`,this.areEqual=!1,this.hasNoChar=!0}connectedCallback(){super.connectedCallback();let e=_.get(this.getAncestorAttributeValue(`formDataProvider`));this.name&&this.sameValueAs&&(this.checkValue=t=>{t?this.hasNoChar=t.length==0:this.hasNoChar=!0,this.name&&this.sameValueAs&&(this.areEqual=p(e,this.name).get()==p(e,this.sameValueAs).get())},p(e,this.name).onAssign(this.checkValue),p(e,this.sameValueAs).onAssign(this.checkValue))}disconnectedCallback(){if(this.checkValue&&this.name&&this.sameValueAs){let e=_.get(this.getAncestorAttributeValue(`formDataProvider`));p(e,this.name).offAssign(this.checkValue),p(e,this.sameValueAs).offAssign(this.checkValue)}super.disconnectedCallback()}render(){return this.hasNoChar?T:C`
|
|
2195
2110
|
<span>
|
|
2196
|
-
${this.areEqual?
|
|
2111
|
+
${this.areEqual?D(this.descriptionWhenEqual):D(this.descriptionWhenNotEqual)}
|
|
2197
2112
|
</span>
|
|
2198
|
-
`}};
|
|
2199
|
-
<label class="checkbox-container ${this.disabled?"disabled":""}">
|
|
2200
|
-
|
|
2201
|
-
<span class="icon-container">
|
|
2202
|
-
<input
|
|
2203
|
-
type="${this.type}"
|
|
2204
|
-
@click=${this.handleChange}
|
|
2205
|
-
@blur=${this.handleBlur}
|
|
2206
|
-
?required=${this.required}
|
|
2207
|
-
?data-indeterminate=${this.showAsIndeterminate}
|
|
2208
|
-
?disabled=${this.disabled}
|
|
2209
|
-
.checked=${C(this.checked)}
|
|
2210
|
-
.name=${this.name}
|
|
2211
|
-
.value=${this.value}
|
|
2212
|
-
?autofocus=${this.autofocus}
|
|
2213
|
-
aria-label=${C(this.ariaLabel)}
|
|
2214
|
-
aria-labelledby=${C(this.ariaLabelledby)}
|
|
2215
|
-
/>
|
|
2216
|
-
<sonic-icon name="${this.checked=="indeterminate"||this.showAsIndeterminate?this.indeterminateIconName:this.iconName}" class="sc-input-icon"></sonic-icon>
|
|
2217
|
-
</span>
|
|
2218
|
-
|
|
2219
|
-
<div class="checkbox-text ${!this.hasDescription&&!this.hasLabel?"hidden":"checkbox-text"}">
|
|
2220
|
-
${this.label?F(this.label):""}
|
|
2221
|
-
<slot @slotchange=${this.hasSlotOrProps}></slot>
|
|
2222
|
-
<slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription?"description":"hidden"} ">${this.description?b`${F(this.description)}`:""}</slot>
|
|
2223
|
-
</div>
|
|
2224
|
-
</label>
|
|
2225
|
-
</label>
|
|
2226
|
-
`}};mt.styles=[Dt,P`
|
|
2113
|
+
`}};O([b()],pa.prototype,`name`,void 0),O([b()],pa.prototype,`sameValueAs`,void 0),O([b()],pa.prototype,`descriptionWhenEqual`,void 0),O([b()],pa.prototype,`descriptionWhenNotEqual`,void 0),O([x()],pa.prototype,`areEqual`,void 0),O([x()],pa.prototype,`hasNoChar`,void 0),pa=O([v(fa)],pa);var ma=`sonic-checkbox`,G=class extends Mn(Cr(gn(k(E)))){constructor(...e){super(...e),this.touched=!1,this.iconName=`check`,this.indeterminateIconName=`minus-small`,this.showAsIndeterminate=!1,this.hasDescription=!1,this.hasLabel=!1}static{this.styles=[P,y`
|
|
2227
2114
|
:host {
|
|
2228
2115
|
--sc-checkbox-border-width: var(--sc-form-border-width);
|
|
2229
2116
|
--sc-checkbox-border-color: var(
|
|
@@ -2345,7 +2232,35 @@
|
|
|
2345
2232
|
.hidden {
|
|
2346
2233
|
display: none;
|
|
2347
2234
|
}
|
|
2348
|
-
`]
|
|
2235
|
+
`]}connectedCallback(){this.type=`checkbox`,this.hasSlotOrProps(),super.connectedCallback()}willUpdate(e){this.hasSlotOrProps(),super.willUpdate(e),e.has(`type`)&&(this.type=`checkbox`)}hasSlotOrProps(){this.hasLabel=!!(this.label||this.slotLabelNodes?.length),this.hasDescription=!!(this.description||this.slotDescriptionNodes?.length)}render(){return C`
|
|
2236
|
+
<label class="checkbox-container ${this.disabled?`disabled`:``}">
|
|
2237
|
+
|
|
2238
|
+
<span class="icon-container">
|
|
2239
|
+
<input
|
|
2240
|
+
type="${this.type}"
|
|
2241
|
+
@click=${this.handleChange}
|
|
2242
|
+
@blur=${this.handleBlur}
|
|
2243
|
+
?required=${this.required}
|
|
2244
|
+
?data-indeterminate=${this.showAsIndeterminate}
|
|
2245
|
+
?disabled=${this.disabled}
|
|
2246
|
+
.checked=${N(this.checked)}
|
|
2247
|
+
.name=${this.name}
|
|
2248
|
+
.value=${this.value}
|
|
2249
|
+
?autofocus=${this.autofocus}
|
|
2250
|
+
aria-label=${N(this.ariaLabel)}
|
|
2251
|
+
aria-labelledby=${N(this.ariaLabelledby)}
|
|
2252
|
+
/>
|
|
2253
|
+
<sonic-icon name="${this.checked==`indeterminate`||this.showAsIndeterminate?this.indeterminateIconName:this.iconName}" class="sc-input-icon"></sonic-icon>
|
|
2254
|
+
</span>
|
|
2255
|
+
|
|
2256
|
+
<div class="checkbox-text ${!this.hasDescription&&!this.hasLabel?`hidden`:`checkbox-text`}">
|
|
2257
|
+
${this.label?D(this.label):``}
|
|
2258
|
+
<slot @slotchange=${this.hasSlotOrProps}></slot>
|
|
2259
|
+
<slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription?`description`:`hidden`} ">${this.description?C`${D(this.description)}`:``}</slot>
|
|
2260
|
+
</div>
|
|
2261
|
+
</label>
|
|
2262
|
+
</label>
|
|
2263
|
+
`}};O([b({type:Boolean,reflect:!0})],G.prototype,`touched`,void 0),O([b({type:String})],G.prototype,`iconName`,void 0),O([b({type:String})],G.prototype,`indeterminateIconName`,void 0),O([b({type:Boolean})],G.prototype,`showAsIndeterminate`,void 0),O([b({type:Boolean})],G.prototype,`hasDescription`,void 0),O([b({type:Boolean})],G.prototype,`hasLabel`,void 0),O([S({flatten:!0})],G.prototype,`slotLabelNodes`,void 0),O([S({slot:`description`,flatten:!0})],G.prototype,`slotDescriptionNodes`,void 0),G=O([v(ma)],G);var ha=`sonic-radio`,ga=class extends G{static{this.styles=[G.styles,y`
|
|
2349
2264
|
:host input {
|
|
2350
2265
|
border-radius: 50%;
|
|
2351
2266
|
}
|
|
@@ -2361,7 +2276,7 @@
|
|
|
2361
2276
|
width: 0.6em;
|
|
2362
2277
|
width: round(0.6em, 1px);
|
|
2363
2278
|
}
|
|
2364
|
-
`]
|
|
2279
|
+
`]}constructor(){super(),this.radio=!0}willUpdate(e){let t=e.has(`type`);super.willUpdate(e),t&&(this.type=`radio`)}connectedCallback(){super.connectedCallback(),this.type=`radio`}};ga=O([v(ha)],ga);var _a=`sonic-switch`,va=class extends G{static{this.styles=[G.styles,y`
|
|
2365
2280
|
sonic-icon {
|
|
2366
2281
|
display: none;
|
|
2367
2282
|
}
|
|
@@ -2426,64 +2341,13 @@
|
|
|
2426
2341
|
input + sonic-icon {
|
|
2427
2342
|
display: none;
|
|
2428
2343
|
}
|
|
2429
|
-
`]
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
></slot
|
|
2437
|
-
></label>
|
|
2438
|
-
|
|
2439
|
-
<div class="form-control ${gi(r)}">
|
|
2440
|
-
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
2441
|
-
<div class="form-select-wrapper">
|
|
2442
|
-
<select
|
|
2443
|
-
data-form-element
|
|
2444
|
-
id="form-element"
|
|
2445
|
-
@change=${this.handleChange}
|
|
2446
|
-
@blur=${this.handleBlur}
|
|
2447
|
-
?disabled=${this.disabled}
|
|
2448
|
-
?required=${this.required}
|
|
2449
|
-
?multiple=${this.multiple}
|
|
2450
|
-
size=${C(this.selectSize)}
|
|
2451
|
-
?autofocus=${this.autofocus}
|
|
2452
|
-
.value="${this.value}"
|
|
2453
|
-
class="form-element"
|
|
2454
|
-
aria-label=${C(this.ariaLabel)}
|
|
2455
|
-
aria-labelledby=${C(this.ariaLabelledby)}
|
|
2456
|
-
>
|
|
2457
|
-
${Ps(this.options,t=>t[this.valueKey],t=>{const i=this.value==t[this.valueKey];return b`<option
|
|
2458
|
-
?selected=${i}
|
|
2459
|
-
value="${t[this.valueKey]}"
|
|
2460
|
-
>
|
|
2461
|
-
${t[this.wordingKey]}
|
|
2462
|
-
</option>`})}
|
|
2463
|
-
<slot></slot>
|
|
2464
|
-
</select>
|
|
2465
|
-
<sonic-icon
|
|
2466
|
-
class="select-chevron"
|
|
2467
|
-
name="nav-arrow-down"
|
|
2468
|
-
.size=${this.size}
|
|
2469
|
-
></sonic-icon>
|
|
2470
|
-
</div>
|
|
2471
|
-
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
2472
|
-
</div>
|
|
2473
|
-
|
|
2474
|
-
<slot
|
|
2475
|
-
name="description"
|
|
2476
|
-
@slotchange=${this.hasSlotOrProps}
|
|
2477
|
-
class="${this.hasDescription?"form-description":"hidden"}"
|
|
2478
|
-
>${this.description?b`${F(this.description)}`:""}</slot
|
|
2479
|
-
>
|
|
2480
|
-
`}};K.styles=[Dt,bi,Es,Ns,P`
|
|
2481
|
-
.form-element {
|
|
2482
|
-
appearance: none;
|
|
2483
|
-
white-space: nowrap;
|
|
2484
|
-
overflow: hidden;
|
|
2485
|
-
text-overflow: ellipsis;
|
|
2486
|
-
}
|
|
2344
|
+
`]}constructor(){super(),this.unique=!0}};va=O([v(_a)],va);var ya=`sonic-select`,K=class extends gn(k(E)){constructor(...e){super(...e),this.valueKey=`value`,this.wordingKey=`wording`,this.multiple=!1,this.status=`default`,this._options=[],this.hasDoneFirstUpdate=!1,this._value=``,this.updateOptions=()=>{let e=this.querySelectorAll(`option`);e.length>0&&(this.options=Array.from(e).map(e=>({value:e.value,wording:e.text,selected:e.hasAttribute(`selected`)})))},this.forceAutoFill=!1,this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1}static{this.styles=[P,na,ea,ta,y`
|
|
2345
|
+
.form-element {
|
|
2346
|
+
appearance: none;
|
|
2347
|
+
white-space: nowrap;
|
|
2348
|
+
overflow: hidden;
|
|
2349
|
+
text-overflow: ellipsis;
|
|
2350
|
+
}
|
|
2487
2351
|
|
|
2488
2352
|
:host([disabled]) sonic-icon {
|
|
2489
2353
|
opacity: 0;
|
|
@@ -2530,11 +2394,67 @@
|
|
|
2530
2394
|
:host([multiple]) sonic-icon {
|
|
2531
2395
|
display: none !important;
|
|
2532
2396
|
}
|
|
2533
|
-
`]
|
|
2397
|
+
`]}set options(e){this._options=e;for(let t of e)t.selected&&(this.value=t[this.valueKey]||``);!(this.value||this.getAttribute(`value`))&&this._options.length>0&&(this.value=this._options[0][this.valueKey]),this.requestUpdate()}get options(){return this._options}firstUpdated(e){this.hasDoneFirstUpdate=!0,super.firstUpdated(e)}set value(e){e==null&&!this.hasDoneFirstUpdate||(e||=``,this._value!=e&&(this._value=e,this.updateFormPublisherValue(),this.requestUpdate()))}get value(){return this._value}updateFormPublisherValue(){this.setFormPublisherValue(this.value)}connectedCallback(){super.connectedCallback(),this.hasSlotOrProps(),this.updateOptions()}get description(){return this._description}set description(e){this.hasAttribute(`description`)&&!this.forceAutoFill&&(e=this.getAttribute(`description`)),this._description=e,this.requestUpdate()}get label(){return this._label}set label(e){this.hasAttribute(`label`)&&!this.forceAutoFill&&(e=this.getAttribute(`label`)),this._label=e,this.requestUpdate()}willUpdate(e){this.hasSlotOrProps(),super.willUpdate(e)}hasSlotOrProps(){this.hasLabel=!!(this.label||this.slotLabelNodes?.length),this.hasDescription=!!(this.description||this.slotDescriptionNodes?.length),this.hasSuffix=!!this.slotSuffixNodes?.length,this.hasPrefix=!!this.slotPrefixNodes?.length}validateFormElement(){let e=this.shadowRoot?.querySelector(`select`);if(!e||e.checkValidity())return;let t=this.getFormPublisher();t&&(t.isFormValid=!1),e.reportValidity()}render(){let e={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix};return C`
|
|
2398
|
+
<label
|
|
2399
|
+
for="form-element"
|
|
2400
|
+
class="${this.hasLabel?`form-label`:`hidden`}"
|
|
2401
|
+
>${this.label?D(this.label):``}<slot
|
|
2402
|
+
name="label"
|
|
2403
|
+
@slotchange=${this.hasSlotOrProps}
|
|
2404
|
+
></slot
|
|
2405
|
+
></label>
|
|
2406
|
+
|
|
2407
|
+
<div class="form-control ${ra(e)}">
|
|
2408
|
+
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
2409
|
+
<div class="form-select-wrapper">
|
|
2410
|
+
<select
|
|
2411
|
+
data-form-element
|
|
2412
|
+
id="form-element"
|
|
2413
|
+
@change=${this.handleChange}
|
|
2414
|
+
@blur=${this.handleBlur}
|
|
2415
|
+
?disabled=${this.disabled}
|
|
2416
|
+
?required=${this.required}
|
|
2417
|
+
?multiple=${this.multiple}
|
|
2418
|
+
size=${N(this.selectSize)}
|
|
2419
|
+
?autofocus=${this.autofocus}
|
|
2420
|
+
.value="${this.value}"
|
|
2421
|
+
class="form-element"
|
|
2422
|
+
aria-label=${N(this.ariaLabel)}
|
|
2423
|
+
aria-labelledby=${N(this.ariaLabelledby)}
|
|
2424
|
+
>
|
|
2425
|
+
${Fn(this.options,e=>e[this.valueKey],e=>C`<option
|
|
2426
|
+
?selected=${this.value==e[this.valueKey]}
|
|
2427
|
+
value="${e[this.valueKey]}"
|
|
2428
|
+
>
|
|
2429
|
+
${e[this.wordingKey]}
|
|
2430
|
+
</option>`)}
|
|
2431
|
+
<slot></slot>
|
|
2432
|
+
</select>
|
|
2433
|
+
<sonic-icon
|
|
2434
|
+
class="select-chevron"
|
|
2435
|
+
name="nav-arrow-down"
|
|
2436
|
+
.size=${this.size}
|
|
2437
|
+
></sonic-icon>
|
|
2438
|
+
</div>
|
|
2439
|
+
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
2440
|
+
</div>
|
|
2441
|
+
|
|
2442
|
+
<slot
|
|
2443
|
+
name="description"
|
|
2444
|
+
@slotchange=${this.hasSlotOrProps}
|
|
2445
|
+
class="${this.hasDescription?`form-description`:`hidden`}"
|
|
2446
|
+
>${this.description?C`${D(this.description)}`:``}</slot
|
|
2447
|
+
>
|
|
2448
|
+
`}};O([b({type:String})],K.prototype,`valueKey`,void 0),O([b({type:String})],K.prototype,`wordingKey`,void 0),O([b({type:Boolean})],K.prototype,`multiple`,void 0),O([b({type:String,reflect:!0})],K.prototype,`size`,void 0),O([b({type:Number})],K.prototype,`selectSize`,void 0),O([b({type:String,reflect:!0})],K.prototype,`status`,void 0),O([b({type:Array})],K.prototype,`options`,null),O([b({reflect:!0})],K.prototype,`value`,null),O([b({type:Boolean})],K.prototype,`forceAutoFill`,void 0),O([b()],K.prototype,`description`,null),O([b()],K.prototype,`label`,null),O([S({slot:`label`,flatten:!0})],K.prototype,`slotLabelNodes`,void 0),O([S({slot:`description`,flatten:!0})],K.prototype,`slotDescriptionNodes`,void 0),O([S({slot:`suffix`,flatten:!0})],K.prototype,`slotSuffixNodes`,void 0),O([S({slot:`prefix`,flatten:!0})],K.prototype,`slotPrefixNodes`,void 0),O([x()],K.prototype,`hasDescription`,void 0),O([x()],K.prototype,`hasLabel`,void 0),O([x()],K.prototype,`hasSuffix`,void 0),O([x()],K.prototype,`hasPrefix`,void 0),K=O([v(ya)],K);var ba=`sonic-textarea`,q=class extends Cr(gn(k(E))){constructor(...e){super(...e),this.size=`md`,this.readonly=!1,this.resize=`vertical`,this.hasDescription=!1,this.hasLabel=!1}static{this.styles=[P,na,ea,ta,ar,y`
|
|
2449
|
+
textarea {
|
|
2450
|
+
overflow-y: auto !important;
|
|
2451
|
+
font-size: inherit;
|
|
2452
|
+
}
|
|
2453
|
+
`]}connectedCallback(){super.connectedCallback(),this.hasSlotOrProps()}willUpdate(e){this.hasSlotOrProps(),super.willUpdate(e)}hasSlotOrProps(){this.hasLabel=!!(this.label||this.slotLabelNodes?.length),this.hasDescription=!!(this.description||this.slotDescriptionNodes?.length)}validateFormElement(){let e=this.shadowRoot?.querySelector(`textarea`);if(!e||e.checkValidity())return;let t=this.getFormPublisher();t&&(t.isFormValid=!1),e.reportValidity()}render(){let e={resize:this.resize};return C`
|
|
2534
2454
|
<label
|
|
2535
|
-
for="${this.id
|
|
2536
|
-
class="${this.hasLabel
|
|
2537
|
-
>${this.label?
|
|
2455
|
+
for="${this.id||`form-element`}"
|
|
2456
|
+
class="${this.hasLabel?`form-label`:`hidden`}"
|
|
2457
|
+
>${this.label?D(this.label):``}<slot
|
|
2538
2458
|
name="label"
|
|
2539
2459
|
@slotchange=${this.hasSlotOrProps}
|
|
2540
2460
|
></slot
|
|
@@ -2543,26 +2463,26 @@
|
|
|
2543
2463
|
<div class="form-control">
|
|
2544
2464
|
<textarea
|
|
2545
2465
|
data-form-element
|
|
2546
|
-
id="${this.id
|
|
2466
|
+
id="${this.id||`form-element`}"
|
|
2547
2467
|
@input=${this.handleChange}
|
|
2548
2468
|
@blur=${this.handleBlur}
|
|
2549
2469
|
?disabled=${this.disabled}
|
|
2550
2470
|
?required=${this.required}
|
|
2551
2471
|
?autofocus=${this.autofocus}
|
|
2552
|
-
rows=${
|
|
2553
|
-
cols=${
|
|
2554
|
-
maxlength=${
|
|
2555
|
-
minlength=${
|
|
2472
|
+
rows=${N(this.rows)}
|
|
2473
|
+
cols=${N(this.cols)}
|
|
2474
|
+
maxlength=${N(this.maxlength)}
|
|
2475
|
+
minlength=${N(this.minlength)}
|
|
2556
2476
|
?readonly=${this.readonly}
|
|
2557
|
-
spellcheck=${
|
|
2558
|
-
autocomplete=${
|
|
2559
|
-
tabindex=${
|
|
2560
|
-
wrap=${
|
|
2477
|
+
spellcheck=${N(this.spellcheck)}
|
|
2478
|
+
autocomplete=${N(this.autocomplete)}
|
|
2479
|
+
tabindex=${N(this.tabindex)}
|
|
2480
|
+
wrap=${N(this.wrap)}
|
|
2561
2481
|
placeholder="${this.placeholder}"
|
|
2562
2482
|
class="form-element textarea custom-scroll"
|
|
2563
|
-
aria-label=${
|
|
2564
|
-
aria-labelledby=${
|
|
2565
|
-
style=${
|
|
2483
|
+
aria-label=${N(this.ariaLabel)}
|
|
2484
|
+
aria-labelledby=${N(this.ariaLabelledby)}
|
|
2485
|
+
style=${M(e)}
|
|
2566
2486
|
>
|
|
2567
2487
|
${this.value}</textarea
|
|
2568
2488
|
>
|
|
@@ -2571,15 +2491,10 @@ ${this.value}</textarea
|
|
|
2571
2491
|
<slot
|
|
2572
2492
|
name="description"
|
|
2573
2493
|
@slotchange=${this.hasSlotOrProps}
|
|
2574
|
-
class="${this.hasDescription
|
|
2575
|
-
>${this.description?
|
|
2494
|
+
class="${this.hasDescription?`form-description`:`hidden`}"
|
|
2495
|
+
>${this.description?C`${D(this.description)}`:``}</slot
|
|
2576
2496
|
>
|
|
2577
|
-
`}};
|
|
2578
|
-
textarea {
|
|
2579
|
-
overflow-y: auto !important;
|
|
2580
|
-
font-size: inherit;
|
|
2581
|
-
}
|
|
2582
|
-
`],bt([a({type:String})],ht.prototype,"size",2),bt([a({type:Number})],ht.prototype,"rows",2),bt([a({type:Number})],ht.prototype,"cols",2),bt([a({type:Number})],ht.prototype,"maxlength",2),bt([a({type:Number})],ht.prototype,"minlength",2),bt([a({type:String})],ht.prototype,"wrap",2),bt([a({type:Boolean})],ht.prototype,"readonly",2),bt([a({type:String})],ht.prototype,"placeholder",2),bt([a({type:String})],ht.prototype,"resize",2),bt([at({slot:"label",flatten:!0})],ht.prototype,"slotLabelNodes",2),bt([at({slot:"description",flatten:!0})],ht.prototype,"slotDescriptionNodes",2),bt([E()],ht.prototype,"hasDescription",2),bt([E()],ht.prototype,"hasLabel",2),ht=bt([x(Sl)],ht);var Al=Object.getOwnPropertyDescriptor,kl=(r,t,i,s)=>{for(var e=s>1?void 0:s?Al(t,i):t,o=r.length-1,n;o>=0;o--)(n=r[o])&&(e=n(e)||e);return e};let wi=class extends w{render(){return b`<slot></slot>`}};wi.styles=[P`
|
|
2497
|
+
`}};O([b({type:String})],q.prototype,`size`,void 0),O([b({type:Number})],q.prototype,`rows`,void 0),O([b({type:Number})],q.prototype,`cols`,void 0),O([b({type:Number})],q.prototype,`maxlength`,void 0),O([b({type:Number})],q.prototype,`minlength`,void 0),O([b({type:String})],q.prototype,`wrap`,void 0),O([b({type:Boolean})],q.prototype,`readonly`,void 0),O([b({type:String})],q.prototype,`placeholder`,void 0),O([b({type:String})],q.prototype,`resize`,void 0),O([S({slot:`label`,flatten:!0})],q.prototype,`slotLabelNodes`,void 0),O([S({slot:`description`,flatten:!0})],q.prototype,`slotDescriptionNodes`,void 0),O([x()],q.prototype,`hasDescription`,void 0),O([x()],q.prototype,`hasLabel`,void 0),q=O([v(ba)],q);var xa=class extends E{static{this.styles=[y`
|
|
2583
2498
|
:host {
|
|
2584
2499
|
font-size: 1.15rem;
|
|
2585
2500
|
line-height: 1.2;
|
|
@@ -2596,24 +2511,7 @@ ${this.value}</textarea
|
|
|
2596
2511
|
font-size: 1rem;
|
|
2597
2512
|
}
|
|
2598
2513
|
}
|
|
2599
|
-
`]
|
|
2600
|
-
${this.iconName?b`<div class="icon">
|
|
2601
|
-
<sonic-icon
|
|
2602
|
-
name=${this.iconName}
|
|
2603
|
-
prefix=${C(this.iconPrefix)}
|
|
2604
|
-
library=${C(this.iconLibrary)}
|
|
2605
|
-
></sonic-icon>
|
|
2606
|
-
</div>`:""}
|
|
2607
|
-
|
|
2608
|
-
<div class="legend-content">
|
|
2609
|
-
${F(this.label?this.label:"")}
|
|
2610
|
-
${this.description?b`<sonic-legend-description
|
|
2611
|
-
>${F(this.description)}</sonic-legend-description
|
|
2612
|
-
>`:""}
|
|
2613
|
-
<slot></slot>
|
|
2614
|
-
</div>
|
|
2615
|
-
<slot name="suffix"></slot>
|
|
2616
|
-
</legend>`}};Bt.styles=[P`
|
|
2514
|
+
`]}render(){return C`<slot></slot>`}};xa=O([v(`sonic-legend-description`)],xa);var Sa=`sonic-legend`,Ca=class extends E{constructor(...e){super(...e),this.forceAutoFill=!1}static{this.styles=[y`
|
|
2617
2515
|
:host {
|
|
2618
2516
|
--sc-legend-font-size: 1.5rem;
|
|
2619
2517
|
--sc-legend-font-weight: var(--sc-font-weight-base, 400);
|
|
@@ -2657,19 +2555,24 @@ ${this.value}</textarea
|
|
|
2657
2555
|
.legend-content {
|
|
2658
2556
|
flex-grow: 1;
|
|
2659
2557
|
}
|
|
2660
|
-
`]
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2558
|
+
`]}get description(){return this._description}set description(e){this.hasAttribute(`description`)&&!this.forceAutoFill&&(e=this.getAttribute(`description`)),this._description=e,this.requestUpdate()}get label(){return this._label}set label(e){this.hasAttribute(`label`)&&!this.forceAutoFill&&(e=this.getAttribute(`label`)),this._label=e,this.requestUpdate()}render(){return C`<legend part="legend">
|
|
2559
|
+
${this.iconName?C`<div class="icon">
|
|
2560
|
+
<sonic-icon
|
|
2561
|
+
name=${this.iconName}
|
|
2562
|
+
prefix=${N(this.iconPrefix)}
|
|
2563
|
+
library=${N(this.iconLibrary)}
|
|
2564
|
+
></sonic-icon>
|
|
2565
|
+
</div>`:``}
|
|
2566
|
+
|
|
2567
|
+
<div class="legend-content">
|
|
2568
|
+
${D(this.label?this.label:``)}
|
|
2569
|
+
${this.description?C`<sonic-legend-description
|
|
2570
|
+
>${D(this.description)}</sonic-legend-description
|
|
2571
|
+
>`:``}
|
|
2572
|
+
<slot></slot>
|
|
2573
|
+
</div>
|
|
2574
|
+
<slot name="suffix"></slot>
|
|
2575
|
+
</legend>`}};O([b({type:Boolean})],Ca.prototype,`forceAutoFill`,void 0),O([b()],Ca.prototype,`description`,null),O([b()],Ca.prototype,`label`,null),O([b({type:String})],Ca.prototype,`iconName`,void 0),O([b({type:String})],Ca.prototype,`iconLibrary`,void 0),O([b({type:String})],Ca.prototype,`iconPrefix`,void 0),Ca=O([v(Sa)],Ca);var wa=`sonic-fieldset`,J=class extends k(E){constructor(...e){super(...e),this.disabled=!1,this.variant=`default`}static{this.styles=[y`
|
|
2673
2576
|
:host {
|
|
2674
2577
|
--sc-fieldset-mt: 0;
|
|
2675
2578
|
--sc-fieldset-mb: 1rem;
|
|
@@ -2718,9 +2621,19 @@ ${this.value}</textarea
|
|
|
2718
2621
|
::slotted(sonic-legend:last-child) {
|
|
2719
2622
|
margin-bottom: 0;
|
|
2720
2623
|
}
|
|
2721
|
-
`]
|
|
2722
|
-
|
|
2723
|
-
|
|
2624
|
+
`]}render(){return C`<fieldset
|
|
2625
|
+
form="${N(this.form)}"
|
|
2626
|
+
?disabled="${this.disabled}"
|
|
2627
|
+
>
|
|
2628
|
+
${this.label?C` <sonic-legend
|
|
2629
|
+
label=${N(this.label)}
|
|
2630
|
+
description=${N(this.description)}
|
|
2631
|
+
iconName=${N(this.iconName)}
|
|
2632
|
+
iconPrefix=${N(this.iconPrefix)}
|
|
2633
|
+
iconLibrary=${N(this.iconLibrary)}
|
|
2634
|
+
></sonic-legend>`:T}
|
|
2635
|
+
<slot></slot>
|
|
2636
|
+
</fieldset>`}};O([b({type:Boolean,reflect:!0})],J.prototype,`disabled`,void 0),O([b({type:String})],J.prototype,`form`,void 0),O([b({type:String})],J.prototype,`label`,void 0),O([b({type:String})],J.prototype,`description`,void 0),O([b({type:String})],J.prototype,`iconName`,void 0),O([b({type:String})],J.prototype,`iconLibrary`,void 0),O([b({type:String})],J.prototype,`iconPrefix`,void 0),O([b({type:Boolean,reflect:!0})],J.prototype,`tight`,void 0),O([b({type:String,reflect:!0})],J.prototype,`variant`,void 0),J=O([v(wa)],J);var Ta=`sonic-form-layout`,Ea=class extends k(E){constructor(...e){super(...e),this._resizeController=new ua(this,{}),this.oneFormElement=!1}static{this.styles=[y`
|
|
2724
2637
|
:host {
|
|
2725
2638
|
display: block;
|
|
2726
2639
|
}
|
|
@@ -2755,7 +2668,9 @@ ${this.value}</textarea
|
|
|
2755
2668
|
::slotted(sonic-divider) {
|
|
2756
2669
|
--sc-divider-my: 0;
|
|
2757
2670
|
}
|
|
2758
|
-
`]
|
|
2671
|
+
`]}onSlotChange(){let e=this.slottedElements,t=[`sonic-input`,`sonic-select`,`sonic-input-autocomplete`,`.form-item-container`];e=e.filter(e=>t.includes(e.nodeName.toLowerCase())),this.oneFormElement=e.length==1}render(){return C`<div class=${ra({"cq--md":this.offsetWidth>440,"one-form-element":this.oneFormElement})}>
|
|
2672
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
2673
|
+
</div>`}};O([We({flatten:!0})],Ea.prototype,`slottedElements`,void 0),O([b({type:Boolean})],Ea.prototype,`oneFormElement`,void 0),Ea=O([v(Ta)],Ea);var Da=`sonic-form-actions`,Oa=class extends E{constructor(...e){super(...e),this.direction=`row`,this.justify=`flex-start`}static{this.styles=[y`
|
|
2759
2674
|
:host {
|
|
2760
2675
|
display: block;
|
|
2761
2676
|
}
|
|
@@ -2764,20 +2679,7 @@ ${this.value}</textarea
|
|
|
2764
2679
|
flex-wrap: wrap;
|
|
2765
2680
|
gap: 0.3rem;
|
|
2766
2681
|
}
|
|
2767
|
-
`],
|
|
2768
|
-
>${this.label?F(this.label):""}<slot
|
|
2769
|
-
name="label"
|
|
2770
|
-
@slotchange=${this.hasSlotOrProps}
|
|
2771
|
-
></slot
|
|
2772
|
-
></span>
|
|
2773
|
-
<slot class="main-slot" style=${pt(r)}></slot>
|
|
2774
|
-
<slot
|
|
2775
|
-
name="description"
|
|
2776
|
-
@slotchange=${this.hasSlotOrProps}
|
|
2777
|
-
class="${this.hasDescription?"form-description":"hidden"}"
|
|
2778
|
-
>
|
|
2779
|
-
${this.description?b`${F(this.description)}`:""}
|
|
2780
|
-
</slot>`}};Tt.styles=[Dt,Es,Ns,P`
|
|
2682
|
+
`]}render(){return C`<slot style=${M({flexDirection:this.direction,justifyContent:this.justify})}></slot>`}};O([b({type:String})],Oa.prototype,`direction`,void 0),O([b({type:String})],Oa.prototype,`justify`,void 0),Oa=O([v(Da)],Oa);var ka=`sonic-group`,Aa=class extends E{constructor(...e){super(...e),this.alignItems=`center`,this.hasDescription=!1,this.hasLabel=!1}static{this.styles=[P,ea,ta,y`
|
|
2781
2683
|
:host {
|
|
2782
2684
|
display: inline-block;
|
|
2783
2685
|
vertical-align: middle;
|
|
@@ -2797,16 +2699,20 @@ ${this.value}</textarea
|
|
|
2797
2699
|
::slotted(sonic-select) {
|
|
2798
2700
|
flex-grow: 1;
|
|
2799
2701
|
}
|
|
2800
|
-
`]
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2702
|
+
`]}updated(){let e=this.querySelectorAll(`sonic-input, sonic-button, sonic-select`),t=e.length;t>1&&e.forEach((e,n)=>{let r=e;n===0?(r.style.setProperty(`--sc-item-rounded-tr`,`0`),r.style.setProperty(`--sc-item-rounded-br`,`0`)):n===t-1?(r.style.setProperty(`--sc-item-rounded-tl`,`0`),r.style.setProperty(`--sc-item-rounded-bl`,`0`)):(r.style.setProperty(`--sc-item-rounded-tr`,`0`),r.style.setProperty(`--sc-item-rounded-br`,`0`),r.style.setProperty(`--sc-item-rounded-tl`,`0`),r.style.setProperty(`--sc-item-rounded-bl`,`0`))})}connectedCallback(){super.connectedCallback(),this.hasSlotOrProps()}willUpdate(e){this.hasSlotOrProps(),super.willUpdate(e)}hasSlotOrProps(){this.hasLabel=!!(this.label||this.slotLabelNodes?.length),this.hasDescription=!!(this.description||this.slotDescriptionNodes?.length)}render(){let e={alignItems:this.alignItems};return C`<span class="${this.hasLabel?`form-label`:`hidden`}"
|
|
2703
|
+
>${this.label?D(this.label):``}<slot
|
|
2704
|
+
name="label"
|
|
2705
|
+
@slotchange=${this.hasSlotOrProps}
|
|
2706
|
+
></slot
|
|
2707
|
+
></span>
|
|
2708
|
+
<slot class="main-slot" style=${M(e)}></slot>
|
|
2709
|
+
<slot
|
|
2710
|
+
name="description"
|
|
2711
|
+
@slotchange=${this.hasSlotOrProps}
|
|
2712
|
+
class="${this.hasDescription?`form-description`:`hidden`}"
|
|
2713
|
+
>
|
|
2714
|
+
${this.description?C`${D(this.description)}`:``}
|
|
2715
|
+
</slot>`}};O([b({type:String})],Aa.prototype,`alignItems`,void 0),O([b({type:String})],Aa.prototype,`label`,void 0),O([b({type:String})],Aa.prototype,`description`,void 0),O([S({slot:`label`,flatten:!0})],Aa.prototype,`slotLabelNodes`,void 0),O([S({slot:`description`,flatten:!0})],Aa.prototype,`slotDescriptionNodes`,void 0),O([x()],Aa.prototype,`hasDescription`,void 0),O([x()],Aa.prototype,`hasLabel`,void 0),Aa=O([v(ka)],Aa);var ja=`sonic-image`,Y=class extends E{constructor(...e){super(...e),this.rounded=`none`,this.src=``,this.alt=``,this.loading=`lazy`,this.ratio=`auto`,this.objectPosition=`center center`,this.imageRendering=`auto`,this.cover=!1}static{this.styles=[y`
|
|
2810
2716
|
:host {
|
|
2811
2717
|
--sc-img-radius: 0;
|
|
2812
2718
|
--sc-img-bg: var(--sc-placeholder-bg, rgba(12, 12, 12, 0.05));
|
|
@@ -2880,38 +2786,16 @@ ${this.value}</textarea
|
|
|
2880
2786
|
opacity: 1;
|
|
2881
2787
|
scale: 1;
|
|
2882
2788
|
}
|
|
2883
|
-
`]
|
|
2884
|
-
part="
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
<sonic-pop
|
|
2894
|
-
style=${pt(s)}
|
|
2895
|
-
class=${this.hasMoreElements?"":"hidden"}
|
|
2896
|
-
>
|
|
2897
|
-
<sonic-menu-item
|
|
2898
|
-
style=${pt(e)}
|
|
2899
|
-
class="more-btn"
|
|
2900
|
-
shape=${this.moreShape}
|
|
2901
|
-
align="center"
|
|
2902
|
-
>
|
|
2903
|
-
<sonic-icon
|
|
2904
|
-
size="xl"
|
|
2905
|
-
name=${t?"more-vert":"more-horiz"}
|
|
2906
|
-
></sonic-icon>
|
|
2907
|
-
</sonic-menu-item>
|
|
2908
|
-
<slot
|
|
2909
|
-
name="more"
|
|
2910
|
-
@slotchange=${this.moreSlotChange}
|
|
2911
|
-
slot="content"
|
|
2912
|
-
></slot>
|
|
2913
|
-
</sonic-pop>
|
|
2914
|
-
</menu>`}};dt.styles=[P`
|
|
2789
|
+
`]}firstUpdated(e){if(this.transition){let e=this.shadowRoot?.querySelector(`img`);if(!e)return;e.onload=function(){e.classList.add(`loaded`)}}super.firstUpdated(e)}render(){let e={aspectRatio:this.cover?`auto`:this.ratio,imageRendering:this.imageRendering,objectPosition:this.objectPosition};return C`<div part="image">
|
|
2790
|
+
<picture part="picture"
|
|
2791
|
+
><img
|
|
2792
|
+
part="img"
|
|
2793
|
+
src="${this.src}"
|
|
2794
|
+
loading="${this.loading}"
|
|
2795
|
+
alt="${this.alt}"
|
|
2796
|
+
style=${M(e)}
|
|
2797
|
+
/></picture>
|
|
2798
|
+
</div>`}};O([b({type:String})],Y.prototype,`rounded`,void 0),O([b({type:String})],Y.prototype,`src`,void 0),O([b({type:String})],Y.prototype,`alt`,void 0),O([b({type:String})],Y.prototype,`loading`,void 0),O([b({type:String,reflect:!0})],Y.prototype,`transition`,void 0),O([b({type:String})],Y.prototype,`ratio`,void 0),O([b({type:String})],Y.prototype,`objectPosition`,void 0),O([b({type:String})],Y.prototype,`imageRendering`,void 0),O([b({type:Boolean,reflect:!0})],Y.prototype,`cover`,void 0),Y=O([v(ja)],Y);var Ma=`sonic-menu`,X=class extends E{constructor(...e){super(...e),this.direction=`column`,this.gap=`var(--sc-menu-gap)`,this.align=`left`,this.shadow=null,this.moreShape=`circle`,this.scrollable=!1,this.observer=null,this.attributeObserver=null,this.minWidth=`0`,this.hasMoreElements=!1,this.handleScrollEnd=()=>{this.setScrollShadow(this.menuContent,this.direction)},this.updateIsScollable=()=>{this.scrollable&&(this.initScrollable(),this.setScrollShadow(this.menuContent,this.direction))}}static{this.styles=[y`
|
|
2915
2799
|
:host {
|
|
2916
2800
|
display: block;
|
|
2917
2801
|
--sc-menu-gap: 0.15rem;
|
|
@@ -3039,27 +2923,58 @@ ${this.value}</textarea
|
|
|
3039
2923
|
rgba(0, 0, 0, 0) 100%
|
|
3040
2924
|
);
|
|
3041
2925
|
}
|
|
3042
|
-
`,
|
|
2926
|
+
`,aa]}checkIfMore(){this.hasMoreElements=!!this.moreElements?.length}moreSlotChange(){this.checkIfMore(),this.updateIsScollable()}updated(e){let t=this.querySelector(`.more-btn`);this.size&&t&&t.setAttribute(`size`,this.size),super.updated(e)}setDividersSize(e){e.forEach(e=>{e.setAttribute(`size`,`sm`),this.direction==`row`?e.style.setProperty(`margin`,`0 .1rem `):e.style.setProperty(`margin`,` 0.1rem 0`)})}mainSlotChange(){this.setChildrenSize(this.menuChildren),this.setDividersSize(this.menuChildren),this.updateIsScollable(),this.updateScrollPosition(),this.observeMenuItemsAttributes()}observeMenuItemsAttributes(){this.attributeObserver?.disconnect(),this.attributeObserver=new MutationObserver(()=>{this.updateScrollPosition()}),this.menuChildren.forEach(e=>{this.attributeObserver.observe(e,{attributes:!0,attributeFilter:[`active`]})})}updateScrollPosition(){if(this.scrollable){let e=this.menuChildren.filter(e=>e.hasAttribute(`active`)&&e.getAttribute(`active`)!==`false`);e.length===1&&requestAnimationFrame(()=>{e[0].scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})})}}connectedCallback(){this.observer=new ResizeObserver(this.updateIsScollable),this.observer.observe(this),super.connectedCallback()}firstUpdated(e){this.menuContent.addEventListener(`scrollend`,this.handleScrollEnd)}disconnectedCallback(){this.observer?.disconnect(),this.attributeObserver?.disconnect(),this.menuContent.removeEventListener(`scrollend`,this.handleScrollEnd),super.disconnectedCallback()}initScrollable(){let e=!1,t,n;this.scrollable&&(this.addEventListener(`mousedown`,r=>{e=!0,this.classList.add(`active`),t=r.pageX-this.menuContent.offsetLeft,n=this.menuContent.scrollLeft}),this.addEventListener(`mouseleave`,()=>{e=!1,this.classList.remove(`active`)}),this.addEventListener(`mouseup`,()=>{e=!1,this.classList.remove(`active`)}),this.addEventListener(`mousemove`,r=>{if(!e)return;r.preventDefault();let i=(r.pageX-this.menuContent.offsetLeft-t)*1.5;this.menuContent.scrollLeft=n-i,this.setScrollShadow(this.menuContent,this.direction)}),this.addEventListener(`scroll`,e=>{e.preventDefault(),this.setScrollShadow(this.menuContent,this.direction)}))}setScrollShadow(e,t){t==`row`?(e.scrollLeft>0?this.classList.add(`shadow-left`):this.classList.remove(`shadow-left`),e.scrollLeft<e.scrollWidth-e.offsetWidth?this.classList.add(`shadow-right`):this.classList.remove(`shadow-right`)):t==`column`&&(e.scrollTop>0?this.classList.add(`shadow-top`):this.classList.remove(`shadow-top`),e.scrollTop<e.scrollHeight-(e.offsetHeight+1)?this.classList.add(`shadow-bottom`):this.classList.remove(`shadow-bottom`))}setChildrenSize(e){e.forEach(e=>{this.size&&e.setAttribute(`size`,this.size),this.align&&e.getAttribute(`shape`)!=`square`&&e.getAttribute(`shape`)!=`circle`&&e.setAttribute(`align`,this.align),this.direction==`row`&&e.getAttribute(`shape`)==`block`&&e.setAttribute(`shape`,`default`)})}render(){let e={minWidth:this.minWidth,flexDirection:this.direction},t=this.direction==`row`,n={gap:this.gap,flexDirection:this.direction},r={display:`block`,alignSelf:t?`center`:`flex-start`,justifySelf:`center`,flexDirection:this.direction},i={marginLeft:t?``:`.55em`};return C`<menu
|
|
2927
|
+
part="menu"
|
|
2928
|
+
class="shadowable"
|
|
2929
|
+
style=${M(e)}
|
|
2930
|
+
>
|
|
2931
|
+
<slot
|
|
2932
|
+
@slotchange=${this.mainSlotChange}
|
|
2933
|
+
id="menu-content"
|
|
2934
|
+
style=${M(n)}
|
|
2935
|
+
></slot>
|
|
2936
|
+
<sonic-pop
|
|
2937
|
+
style=${M(r)}
|
|
2938
|
+
class=${this.hasMoreElements?``:`hidden`}
|
|
2939
|
+
>
|
|
2940
|
+
<sonic-menu-item
|
|
2941
|
+
style=${M(i)}
|
|
2942
|
+
class="more-btn"
|
|
2943
|
+
shape=${this.moreShape}
|
|
2944
|
+
align="center"
|
|
2945
|
+
>
|
|
2946
|
+
<sonic-icon
|
|
2947
|
+
size="xl"
|
|
2948
|
+
name=${t?`more-vert`:`more-horiz`}
|
|
2949
|
+
></sonic-icon>
|
|
2950
|
+
</sonic-menu-item>
|
|
2951
|
+
<slot
|
|
2952
|
+
name="more"
|
|
2953
|
+
@slotchange=${this.moreSlotChange}
|
|
2954
|
+
slot="content"
|
|
2955
|
+
></slot>
|
|
2956
|
+
</sonic-pop>
|
|
2957
|
+
</menu>`}};O([b({type:String,reflect:!0})],X.prototype,`size`,void 0),O([b({type:String,reflect:!0})],X.prototype,`direction`,void 0),O([b({type:String})],X.prototype,`gap`,void 0),O([b({type:String,reflect:!0})],X.prototype,`align`,void 0),O([b({type:String,reflect:!0})],X.prototype,`shadow`,void 0),O([b({type:String})],X.prototype,`moreShape`,void 0),O([b({type:Boolean})],X.prototype,`scrollable`,void 0),O([b({type:String})],X.prototype,`minWidth`,void 0),O([Ue(`menu`)],X.prototype,`menu`,void 0),O([Ue(`#menu-content`)],X.prototype,`menuContent`,void 0),O([We({selector:`*`})],X.prototype,`menuChildren`,void 0),O([We({slot:`more`,selector:`*`})],X.prototype,`moreElements`,void 0),O([x()],X.prototype,`hasMoreElements`,void 0),X=O([v(Ma)],X);var Na=`sonic-modal-actions`,Pa=class extends E{static{this.styles=[y`
|
|
3043
2958
|
:host {
|
|
3044
2959
|
display: flex;
|
|
3045
2960
|
gap: 0.5rem;
|
|
3046
2961
|
margin-top: auto;
|
|
3047
2962
|
padding-top: 1.5rem;
|
|
3048
2963
|
}
|
|
3049
|
-
`]
|
|
2964
|
+
`]}firstUpdated(e){this.buttons?.forEach(e=>{e.hasAttribute(`hideModal`)&&e.addEventListener(`click`,()=>{Dn.getClosestElement(this,`sonic-modal`)?.hide()})}),super.firstUpdated(e)}render(){return C`<slot></slot>`}};O([We({selector:`sonic-button`})],Pa.prototype,`buttons`,void 0),Pa=O([v(Na)],Pa);var Fa=`sonic-modal-close`,Ia=class extends E{constructor(...e){super(...e),this.translation={fr:`Fermer la fenêtre`,en:`Close window`,de:`Fenster schließen`,nl:`Venster sluiten`,es:`Cerrar`}}connectedCallback(){super.connectedCallback(),this.lang=document.documentElement.lang?.split(`-`)[0]??`fr`}render(){return C`<sonic-button
|
|
3050
2965
|
noAutoFill
|
|
3051
2966
|
data-aria-label=${this.translation[this.lang]}
|
|
3052
|
-
reset=${
|
|
2967
|
+
reset=${N(this.reset)}
|
|
3053
2968
|
shape="circle"
|
|
3054
2969
|
@click=${this.handleClick}
|
|
3055
|
-
type=${
|
|
2970
|
+
type=${N(this.type)}
|
|
3056
2971
|
><sonic-icon name="cancel" size="lg"></sonic-icon
|
|
3057
|
-
></sonic-button>`}handleClick(){
|
|
2972
|
+
></sonic-button>`}handleClick(){l.getClosestElement(this,`sonic-modal`).hide()}};O([b()],Ia.prototype,`translation`,void 0),O([b()],Ia.prototype,`reset`,void 0),O([b()],Ia.prototype,`type`,void 0),Ia=O([v(Fa)],Ia);var La=`sonic-modal-content`,Ra=class extends E{static{this.styles=[y`
|
|
3058
2973
|
:host {
|
|
3059
2974
|
display: block;
|
|
3060
2975
|
width: 100%;
|
|
3061
2976
|
}
|
|
3062
|
-
`]
|
|
2977
|
+
`]}render(){return C`<slot></slot>`}};Ra=O([v(La)],Ra);var za=`sonic-modal-subtitle`,Ba=class extends E{static{this.styles=[y`
|
|
3063
2978
|
:host {
|
|
3064
2979
|
font-size: 1.25rem;
|
|
3065
2980
|
display: block;
|
|
@@ -3071,7 +2986,7 @@ ${this.value}</textarea
|
|
|
3071
2986
|
font-weight: var(--sc-headings-font-weight, 700);
|
|
3072
2987
|
font-style: var(--sc-headings-font-style, normal);
|
|
3073
2988
|
}
|
|
3074
|
-
`]
|
|
2989
|
+
`]}render(){return C`<slot></slot>`}};Ba=O([v(za)],Ba);var Va=`sonic-modal-title`,Ha=class extends E{static{this.styles=[y`
|
|
3075
2990
|
:host {
|
|
3076
2991
|
font-weight: bold;
|
|
3077
2992
|
font-size: 1.5rem;
|
|
@@ -3084,30 +2999,7 @@ ${this.value}</textarea
|
|
|
3084
2999
|
font-weight: var(--sc-headings-font-weight, 700);
|
|
3085
3000
|
font-style: var(--sc-headings-font-style, normal);
|
|
3086
3001
|
}
|
|
3087
|
-
`]
|
|
3088
|
-
<div
|
|
3089
|
-
id="backdrop"
|
|
3090
|
-
@click=${this.handleOverlayClick}
|
|
3091
|
-
style=${pt(t)}
|
|
3092
|
-
></div>
|
|
3093
|
-
<dialog
|
|
3094
|
-
id="modal"
|
|
3095
|
-
part="modal"
|
|
3096
|
-
class="custom-scroll"
|
|
3097
|
-
aria-modal="true"
|
|
3098
|
-
style=${pt(r)}
|
|
3099
|
-
>
|
|
3100
|
-
${this._animationState!=="hidden"?b`<div id="modal-content">
|
|
3101
|
-
${!this.forceAction&&!this.noCloseButton?b`<sonic-modal-close
|
|
3102
|
-
class="${this._animationState=="visible"?"animate-in":"animate-out"}"
|
|
3103
|
-
type=${C(this.closeButtonType)}
|
|
3104
|
-
></sonic-modal-close>`:S}
|
|
3105
|
-
${this.modalFragment("title")} ${this.modalFragment("subtitle")}
|
|
3106
|
-
${this.modalFragment("content")} ${this.modalFragment("actions")}
|
|
3107
|
-
<slot></slot>
|
|
3108
|
-
</div>`:S}
|
|
3109
|
-
</dialog>
|
|
3110
|
-
`}modalFragment(r){const t=this.options?.[r];if(!t)return S;let i;switch(t instanceof Object?i=t:i=F(t),r){case"title":return b`<sonic-modal-title>${i}</sonic-modal-title>`;case"subtitle":return b`<sonic-modal-subtitle>${i}</sonic-modal-subtitle>`;case"content":return b`<sonic-modal-content>${i}</sonic-modal-content>`;case"actions":return b`<sonic-modal-actions>${i}</sonic-modal-actions>`;default:return S}}async show(){this._modalElement.show(),this._animationState="in",await this.animation("in"),this._animationState="visible",this.visible=!0,this.dispatchEvent(new CustomEvent("show")),this._modalElement.focus()}async hide(){this._animationState="out",this.dispatchEvent(new CustomEvent("hide")),await this.animation("out"),this._modalElement.close(),this._animationState="hidden",this.visible=!1,this.hasAttribute("resetDataProviderOnHide")&&k.get(this.getAttribute("resetDataProviderOnHide")).set({}),this.removeHashOnHide&&window.history.replaceState({},"",window.location.pathname),this.removeOnHide&&this.remove(),this.dispatchEvent(new CustomEvent("hidden"))}async dispose(){await this.hide(),this.remove()}static disposeAll(){T.modals.forEach(r=>{r.dispose()})}handleEscape(r){if(r.key==="Escape"){r.preventDefault();const t=T.modals.filter(i=>i._animationState!=="hidden"&&!i.forceAction);t.length>0&&t[t.length-1].hide()}}animation(r){return new Promise(t=>{const{quartOut:i,linear:s,translateY:e,durationIn:o,durationOut:n,quadOut:l}=this._animationConfig,c=this._modalElement;if(!c)return t();const h=r==="in",u=h?o:n,d=!this.fullScreen&&h?100:0;this.fullScreen||(h?this.style.setProperty("--sc_backdrop-opacity","0.8"):setTimeout(()=>{this.style.setProperty("--sc_backdrop-opacity","0")},150));const g=[];this.effect==="slide"&&(g.push(c.animate([{transform:h?e:"translateY(0)"},{transform:h?"translateY(0)":e}],{duration:u,easing:h?i:l,fill:"both",delay:d})),g.push(c.animate([{opacity:h?0:1},{opacity:h?1:0}],{duration:u,easing:s,fill:"both",delay:d}))),Promise.all(g.map(m=>m.finished)).then(()=>t())})}};T.styles=[Ze,P`
|
|
3002
|
+
`]}render(){return C`<slot></slot>`}};Ha=O([v(Va)],Ha);var Ua,Wa=`sonic-modal`,Z=class extends k(E){static{Ua=this}constructor(...e){super(...e),this.forceAction=!1,this.noCloseButton=!1,this.removeOnHide=!1,this.removeHashOnHide=!1,this.align=`left`,this.maxWidth=`min(100vw, 40rem)`,this.maxHeight=`90vh`,this.width=`100%`,this.height=`fit-content`,this.effect=`slide`,this.fullScreen=!1,this.visible=!1,this.closeOnLocationChange=!1,this.location=``,this._animationState=`hidden`,this._animationConfig={quartOut:`cubic-bezier(0.165, 0.84, 0.44, 1)`,quadOut:`cubic-bezier(0.25, 0.46, 0.45, 0.94)`,linear:`linear`,translateY:`translateY(2.5rem)`,durationIn:300,durationOut:300}}static{this.styles=[ar,y`
|
|
3111
3003
|
:host {
|
|
3112
3004
|
--sc-modal-py: 2.5rem;
|
|
3113
3005
|
--sc-modal-px: 1.5rem;
|
|
@@ -3257,26 +3149,30 @@ ${this.value}</textarea
|
|
|
3257
3149
|
transform: scale(0) !important;
|
|
3258
3150
|
transition: 0.2s linear !important;
|
|
3259
3151
|
}
|
|
3260
|
-
`]
|
|
3261
|
-
<
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3152
|
+
`]}static{this.modals=[]}static create(e){let t=document.createElement(Wa);return t.options=e,e.removeHashOnHide===!0&&t.setAttribute(`removeHashOnHide`,`true`),e.removeOnHide===!0&&t.setAttribute(`removeOnHide`,`true`),e.closeOnLocationChange===!0&&t.setAttribute(`closeOnLocationChange`,`true`),e.maxWidth&&(t.maxWidth=e?.maxWidth),e.width&&(t.width=e?.width),e.maxHeight&&(t.maxHeight=e?.maxHeight),e.height&&(t.height=e?.height),e.forceAction&&(t.forceAction=!0),e.fullScreen&&(t.fullScreen=e?.fullScreen),e.effect&&(t.effect=e?.effect),e.noCloseButton&&(t.noCloseButton=!0),e.closeButtonType&&(t.closeButtonType=e?.closeButtonType),e.paddingX&&(t.paddingX=e?.paddingX),e.paddingY&&(t.paddingY=e?.paddingY),e.zIndex&&(t.zIndex=e?.zIndex),mr.getPopContainer().appendChild(t),t.updateComplete.then(()=>{t.show()}),t}connectedCallback(){Ua.modals.push(this),j.onChange(this),super.connectedCallback()}disconnectedCallback(){j.offChange(this),Ua.modals.splice(Ua.modals.indexOf(this),1),this.removeEventListener(`keydown`,this.handleEscape),super.disconnectedCallback()}firstUpdated(){this.addEventListener(`keydown`,this.handleEscape)}willUpdate(e){if(this.closeOnLocationChange&&e.has(`location`)){let t=e.get(`location`);t&&this.location&&this.location!==t&&setTimeout(()=>{this.hide()},50)}e.has(`zIndex`)&&this.style.setProperty(`--sc_z-index`,this.zIndex||`990`),e.has(`paddingX`)&&this.style.setProperty(`--sc-modal-px`,this.paddingX||``),e.has(`paddingY`)&&this.style.setProperty(`--sc-modal-py`,this.paddingY||``),super.willUpdate(e)}updated(e){let t=!e.get(`visible`)&&this.visible,n=e.get(`visible`)&&!this.visible;t&&this._animationState===`hidden`?this.show():n&&this._animationState===`visible`&&this.hide()}handleOverlayClick(e){!this.forceAction&&this._animationState===`visible`&&this.hide()}render(){let e={maxWidth:this.maxWidth,maxHeight:this.maxHeight,width:this.width,height:this.height,pointerEvents:this._animationState===`hidden`?`none`:`auto`},t={display:this.fullScreen?`none`:`block`,pointerEvents:this._animationState===`visible`?`auto`:`none`};return C`
|
|
3153
|
+
<div
|
|
3154
|
+
id="backdrop"
|
|
3155
|
+
@click=${this.handleOverlayClick}
|
|
3156
|
+
style=${M(t)}
|
|
3157
|
+
></div>
|
|
3158
|
+
<dialog
|
|
3159
|
+
id="modal"
|
|
3160
|
+
part="modal"
|
|
3161
|
+
class="custom-scroll"
|
|
3162
|
+
aria-modal="true"
|
|
3163
|
+
style=${M(e)}
|
|
3265
3164
|
>
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
<sonic-icon name="cancel"></sonic-icon>
|
|
3278
|
-
</sonic-button>`:S}
|
|
3279
|
-
`}close(){if(this.remove(),this.dismissForever){const r=localStorage.getItem("sonic-alert-dismissed")||"{}",t=JSON.parse(r);t[this.id]=!0,localStorage.setItem("sonic-alert-dismissed",JSON.stringify(t))}}};$t.styles=[Dt,P`
|
|
3165
|
+
${this._animationState===`hidden`?T:C`<div id="modal-content">
|
|
3166
|
+
${!this.forceAction&&!this.noCloseButton?C`<sonic-modal-close
|
|
3167
|
+
class="${this._animationState==`visible`?`animate-in`:`animate-out`}"
|
|
3168
|
+
type=${N(this.closeButtonType)}
|
|
3169
|
+
></sonic-modal-close>`:T}
|
|
3170
|
+
${this.modalFragment(`title`)} ${this.modalFragment(`subtitle`)}
|
|
3171
|
+
${this.modalFragment(`content`)} ${this.modalFragment(`actions`)}
|
|
3172
|
+
<slot></slot>
|
|
3173
|
+
</div>`}
|
|
3174
|
+
</dialog>
|
|
3175
|
+
`}modalFragment(e){let t=this.options?.[e];if(!t)return T;let n;switch(n=t instanceof Object?t:D(t),e){case`title`:return C`<sonic-modal-title>${n}</sonic-modal-title>`;case`subtitle`:return C`<sonic-modal-subtitle>${n}</sonic-modal-subtitle>`;case`content`:return C`<sonic-modal-content>${n}</sonic-modal-content>`;case`actions`:return C`<sonic-modal-actions>${n}</sonic-modal-actions>`;default:return T}}async show(){this._modalElement.show(),this._animationState=`in`,await this.animation(`in`),this._animationState=`visible`,this.visible=!0,this.dispatchEvent(new CustomEvent(`show`)),this._modalElement.focus()}async hide(){this._animationState=`out`,this.dispatchEvent(new CustomEvent(`hide`)),await this.animation(`out`),this._modalElement.close(),this._animationState=`hidden`,this.visible=!1,this.hasAttribute(`resetDataProviderOnHide`)&&_.get(this.getAttribute(`resetDataProviderOnHide`)).set({}),this.removeHashOnHide&&window.history.replaceState({},``,window.location.pathname),this.removeOnHide&&this.remove(),this.dispatchEvent(new CustomEvent(`hidden`))}async dispose(){await this.hide(),this.remove()}static disposeAll(){Ua.modals.forEach(e=>{e.dispose()})}handleEscape(e){if(e.key===`Escape`){e.preventDefault();let t=Ua.modals.filter(e=>e._animationState!==`hidden`&&!e.forceAction);t.length>0&&t[t.length-1].hide()}}animation(e){return new Promise(t=>{let{quartOut:n,linear:r,translateY:i,durationIn:a,durationOut:o,quadOut:s}=this._animationConfig,c=this._modalElement;if(!c)return t();let l=e===`in`,u=l?a:o,d=!this.fullScreen&&l?100:0;this.fullScreen||(l?this.style.setProperty(`--sc_backdrop-opacity`,`0.8`):setTimeout(()=>{this.style.setProperty(`--sc_backdrop-opacity`,`0`)},150));let f=[];this.effect===`slide`&&(f.push(c.animate([{transform:l?i:`translateY(0)`},{transform:l?`translateY(0)`:i}],{duration:u,easing:l?n:s,fill:`both`,delay:d})),f.push(c.animate([{opacity:+!l},{opacity:+!!l}],{duration:u,easing:r,fill:`both`,delay:d}))),Promise.all(f.map(e=>e.finished)).then(()=>t())})}};O([b({type:Boolean})],Z.prototype,`forceAction`,void 0),O([b({type:Boolean})],Z.prototype,`noCloseButton`,void 0),O([b({type:Boolean})],Z.prototype,`removeOnHide`,void 0),O([b({type:Boolean})],Z.prototype,`removeHashOnHide`,void 0),O([b({type:String,reflect:!0})],Z.prototype,`align`,void 0),O([b({type:String})],Z.prototype,`paddingX`,void 0),O([b({type:String})],Z.prototype,`paddingY`,void 0),O([b({type:String})],Z.prototype,`maxWidth`,void 0),O([b({type:String})],Z.prototype,`maxHeight`,void 0),O([b({type:String})],Z.prototype,`zIndex`,void 0),O([b({type:String})],Z.prototype,`width`,void 0),O([b({type:String})],Z.prototype,`height`,void 0),O([b({type:String})],Z.prototype,`effect`,void 0),O([b({type:Object})],Z.prototype,`options`,void 0),O([b({type:Boolean,reflect:!0})],Z.prototype,`fullScreen`,void 0),O([b({type:Boolean,reflect:!0})],Z.prototype,`visible`,void 0),O([b({type:String})],Z.prototype,`closeButtonType`,void 0),O([Ue(`#modal`)],Z.prototype,`_modalElement`,void 0),O([b({type:Boolean})],Z.prototype,`closeOnLocationChange`,void 0),O([x()],Z.prototype,`location`,void 0),O([x()],Z.prototype,`_animationState`,void 0),Z=Ua=O([v(Wa)],Z),typeof window<`u`&&(window.SonicModal=Z);var Ga={warning:`warning-circled-outline`,success:`check-circled-outline`,error:`warning-circled-outline`,info:`info-empty`,default:`info-empty`},Ka=`sonic-alert`,Q=class extends E{constructor(...e){super(...e),this.label=``,this.noIcon=!1,this.text=``,this.id=new Date().getTime().toString(),this.dismissible=!1,this.background=!1,this.status=`default`,this.dismissForever=!1}static{this.styles=[P,y`
|
|
3280
3176
|
:host {
|
|
3281
3177
|
--sc_color: var(--sc-base-content, #000);
|
|
3282
3178
|
--sc_rounded: var(--sc-rounded);
|
|
@@ -3363,27 +3259,41 @@ ${this.value}</textarea
|
|
|
3363
3259
|
top: 0.4rem;
|
|
3364
3260
|
right: 0.3rem;
|
|
3365
3261
|
}
|
|
3366
|
-
`]
|
|
3367
|
-
${
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3262
|
+
`]}connectedCallback(){if(this.dismissForever){let e=localStorage.getItem(`sonic-alert-dismissed`)||`{}`;JSON.parse(e)[this.id]&&this.remove()}super.connectedCallback()}render(){return C`
|
|
3263
|
+
<slot name="icon" class="${this.noIcon?`hidden`:``}"
|
|
3264
|
+
>${this.noIcon?T:C`<div>
|
|
3265
|
+
${this.status&&C`<sonic-icon name=${Ga[this.status]}></sonic-icon>`}
|
|
3266
|
+
</div>`}</slot
|
|
3267
|
+
>
|
|
3268
|
+
<div class="content">
|
|
3269
|
+
${this.label?C`<span class="label">${D(this.label)}</span>`:T}
|
|
3270
|
+
<div>${this.text}<slot></slot></div>
|
|
3271
|
+
</div>
|
|
3272
|
+
${this.dismissible?C`<sonic-button
|
|
3273
|
+
@click=${this.close}
|
|
3274
|
+
class="close-btn"
|
|
3275
|
+
variant="unstyled"
|
|
3276
|
+
shape="circle"
|
|
3277
|
+
icon
|
|
3278
|
+
>
|
|
3279
|
+
<sonic-icon name="cancel"></sonic-icon>
|
|
3280
|
+
</sonic-button>`:T}
|
|
3281
|
+
`}close(){if(this.remove(),this.dismissForever){let e=localStorage.getItem(`sonic-alert-dismissed`)||`{}`,t=JSON.parse(e);t[this.id]=!0,localStorage.setItem(`sonic-alert-dismissed`,JSON.stringify(t))}}};O([b({type:String})],Q.prototype,`label`,void 0),O([b({type:Boolean,reflect:!0})],Q.prototype,`noIcon`,void 0),O([b({type:String})],Q.prototype,`text`,void 0),O([b({type:String})],Q.prototype,`id`,void 0),O([b({type:String,reflect:!0})],Q.prototype,`size`,void 0),O([b({type:Boolean,reflect:!0})],Q.prototype,`dismissible`,void 0),O([b({type:Boolean,reflect:!0})],Q.prototype,`background`,void 0),O([b({type:String,reflect:!0})],Q.prototype,`status`,void 0),O([b({type:Boolean,reflect:!0})],Q.prototype,`dismissForever`,void 0),Q=O([v(Ka)],Q);var qa=`sonic-alert-messages`,Ja=class extends k(E,{}){constructor(...e){super(...e),this.size=`md`,this.background=!1,this.noIcon=!1,this.messages=[]}static{this.styles=[y`
|
|
3375
3282
|
.container {
|
|
3376
3283
|
display: grid;
|
|
3377
3284
|
gap: 0.5em;
|
|
3378
3285
|
grid-template-columns: minmax(0, 1fr);
|
|
3379
3286
|
width: 100%;
|
|
3380
3287
|
}
|
|
3381
|
-
`]
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3288
|
+
`]}render(){return this.messages?.length?C`<div class="container">
|
|
3289
|
+
${Ur(this.messages,e=>e.type==`public`?C`<sonic-alert
|
|
3290
|
+
status=${e.status||`default`}
|
|
3291
|
+
text=${N(e.content)}
|
|
3292
|
+
size=${this.size}
|
|
3293
|
+
?noIcon=${this.noIcon}
|
|
3294
|
+
?background=${this.background}
|
|
3295
|
+
></sonic-alert>`:T)}
|
|
3296
|
+
</div>`:T}};O([b({type:String})],Ja.prototype,`size`,void 0),O([b({type:Boolean})],Ja.prototype,`background`,void 0),O([b({type:Boolean})],Ja.prototype,`noIcon`,void 0),O([b({type:Array})],Ja.prototype,`messages`,void 0),Ja=O([v(qa)],Ja);var Ya=`sonic-toast-message-subscriber`,Xa=class extends k(E,{}){constructor(...e){super(...e),this._messages=[]}get messages(){return this._messages}set messages(e){this._messages=e,this.messages&&e.forEach(e=>{e.type==`public`&&R.add({text:e.content||``,status:e.status})})}render(){return T}};O([b({type:Array})],Xa.prototype,`messages`,null),Xa=O([v(Ya)],Xa);var Za=`sonic-tooltip`,Qa=class extends E{static{this.styles=[y`
|
|
3387
3297
|
:host {
|
|
3388
3298
|
position: relative;
|
|
3389
3299
|
display: inline-flex;
|
|
@@ -3489,11 +3399,12 @@ ${this.value}</textarea
|
|
|
3489
3399
|
bottom: 0;
|
|
3490
3400
|
left: var(--sc-tooltip-position);
|
|
3491
3401
|
}
|
|
3492
|
-
`]
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3402
|
+
`]}constructor(){super(),this.label=``,this.disabled=!1,this.focusable=!1,this.lastKeyWasTab=!1,this.handleKeyDown=e=>{e.key===`Tab`&&(this.lastKeyWasTab=!0)},this.handleMouseDown=()=>{this.lastKeyWasTab=!1,this.classList.remove(`keyboard-focus`)},this.handleFocusIn=()=>{this.lastKeyWasTab&&this.classList.add(`keyboard-focus`),this.lastKeyWasTab=!1},this.handleFocusOut=()=>{this.classList.remove(`keyboard-focus`),this.lastKeyWasTab=!1},this.boundHandleKeyDown=this.handleKeyDown.bind(this),this.boundHandleMouseDown=this.handleMouseDown.bind(this)}connectedCallback(){super.connectedCallback(),this.addEventListener(`focusin`,this.handleFocusIn),this.addEventListener(`focusout`,this.handleFocusOut),document.addEventListener(`keydown`,this.boundHandleKeyDown,!0),document.addEventListener(`mousedown`,this.boundHandleMouseDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`focusin`,this.handleFocusIn),this.removeEventListener(`focusout`,this.handleFocusOut),document.removeEventListener(`keydown`,this.boundHandleKeyDown,!0),document.removeEventListener(`mousedown`,this.boundHandleMouseDown,!0)}willUpdate(e){if(e.has(`disabled`)){let t=e.get(`disabled`)===!0;this.disabled?(this.setAttribute(`tabindex`,`-1`),this.classList.remove(`keyboard-focus`)):!this.disabled&&t&&(this.focusable?this.setAttribute(`tabindex`,`0`):this.removeAttribute(`tabindex`))}e.has(`focusable`)&&(this.focusable&&!this.disabled?this.setAttribute(`tabindex`,`0`):!this.focusable&&!this.disabled&&this.removeAttribute(`tabindex`)),super.willUpdate(e)}render(){let e=this.disabled||this.label==``?`disabled`:``;return C`<div
|
|
3403
|
+
data-tooltip-text="${this.label.trim().replace(` `,` `)}"
|
|
3404
|
+
class="tooltip ${e}"
|
|
3405
|
+
>
|
|
3406
|
+
<slot></slot>
|
|
3407
|
+
</div>`}};O([b({type:String})],Qa.prototype,`label`,void 0),O([b({type:String,reflect:!0})],Qa.prototype,`placement`,void 0),O([b({type:Boolean})],Qa.prototype,`disabled`,void 0),O([b({type:Boolean})],Qa.prototype,`focusable`,void 0),Qa=O([v(Za)],Qa);var $a=`sonic-divider`,$=class extends E{constructor(...e){super(...e),this.label=``,this.align=`center`,this.vertical=!1,this.noMargin=!1,this.dashed=!1,this.dotted=!1}static{this.styles=[y`
|
|
3497
3408
|
:host {
|
|
3498
3409
|
--sc-divider-my: 0.5rem;
|
|
3499
3410
|
--sc-divider-mx: 0;
|
|
@@ -3624,7 +3535,11 @@ ${this.value}</textarea
|
|
|
3624
3535
|
:host([dashed]) {
|
|
3625
3536
|
--sc-divider-border-style: dashed;
|
|
3626
3537
|
}
|
|
3627
|
-
`]
|
|
3538
|
+
`]}firstUpdated(e){super.firstUpdated(e),(this.label||this.slotNodes?.length)&&this.divider?.classList.add(`has-text`)}render(){return C`<div part="divider">
|
|
3539
|
+
<span class="text"
|
|
3540
|
+
>${D(this.label?this.label:``)}<slot></slot
|
|
3541
|
+
></span>
|
|
3542
|
+
</div>`}};O([S({flatten:!0})],$.prototype,`slotNodes`,void 0),O([Ue(`div`)],$.prototype,`divider`,void 0),O([b({type:String})],$.prototype,`label`,void 0),O([b({type:String,reflect:!0})],$.prototype,`size`,void 0),O([b({type:String,reflect:!0})],$.prototype,`align`,void 0),O([b({type:Boolean,reflect:!0})],$.prototype,`vertical`,void 0),O([b({type:Boolean,reflect:!0})],$.prototype,`noMargin`,void 0),O([b({type:Boolean,reflect:!0})],$.prototype,`dashed`,void 0),O([b({type:Boolean,reflect:!0})],$.prototype,`dotted`,void 0),$=O([v($a)],$);var eo=`sonic-card-header-description`,to=class extends E{static{this.styles=[y`
|
|
3628
3543
|
:host() {
|
|
3629
3544
|
display: block;
|
|
3630
3545
|
font-size: 0.7em;
|
|
@@ -3632,16 +3547,7 @@ ${this.value}</textarea
|
|
|
3632
3547
|
font-family: var(--sc-font-family-base, sans-serif);
|
|
3633
3548
|
font-weight: var(--sc-font-style-base, normal);
|
|
3634
3549
|
}
|
|
3635
|
-
`]
|
|
3636
|
-
<div class="header-content">
|
|
3637
|
-
${F(this.label)}
|
|
3638
|
-
${this.description?b`<sonic-card-header-description
|
|
3639
|
-
>${F(this.description)}</sonic-card-header-description
|
|
3640
|
-
>`:S}
|
|
3641
|
-
<slot></slot>
|
|
3642
|
-
</div>
|
|
3643
|
-
<slot name="suffix"></slot>
|
|
3644
|
-
`}};ns.styles=[P`
|
|
3550
|
+
`]}render(){return C`<slot></slot>`}};to=O([v(eo)],to);var no=`sonic-card-header`,ro=class extends E{static{this.styles=[y`
|
|
3645
3551
|
:host {
|
|
3646
3552
|
--sc-card-header-mb: 1.35rem;
|
|
3647
3553
|
--sc-card-header-font-size: 1.875rem;
|
|
@@ -3679,15 +3585,24 @@ ${this.value}</textarea
|
|
|
3679
3585
|
::slotted(sonic-card-header-description) {
|
|
3680
3586
|
margin-top: 0.1em;
|
|
3681
3587
|
}
|
|
3682
|
-
`]
|
|
3588
|
+
`]}render(){return C`
|
|
3589
|
+
<div class="header-content">
|
|
3590
|
+
${D(this.label)}
|
|
3591
|
+
${this.description?C`<sonic-card-header-description
|
|
3592
|
+
>${D(this.description)}</sonic-card-header-description
|
|
3593
|
+
>`:T}
|
|
3594
|
+
<slot></slot>
|
|
3595
|
+
</div>
|
|
3596
|
+
<slot name="suffix"></slot>
|
|
3597
|
+
`}};O([b()],ro.prototype,`label`,void 0),O([b()],ro.prototype,`description`,void 0),ro=O([v(no)],ro);var io=`sonic-card-main`,ao=class extends E{static{this.styles=[y`
|
|
3683
3598
|
:host {
|
|
3684
3599
|
display: block;
|
|
3685
3600
|
}
|
|
3686
|
-
`]
|
|
3601
|
+
`]}render(){return C`<slot></slot>`}};ao=O([v(io)],ao);var oo=`sonic-card-footer`,so=class extends E{static{this.styles=[y`
|
|
3687
3602
|
:host {
|
|
3688
3603
|
display: block;
|
|
3689
3604
|
}
|
|
3690
|
-
`]
|
|
3605
|
+
`]}render(){return C` <slot></slot> `}};so=O([v(oo)],so);var co=y`
|
|
3691
3606
|
:host {
|
|
3692
3607
|
--sc-_color: inherit;
|
|
3693
3608
|
color: var(--sc-_color);
|
|
@@ -3712,7 +3627,7 @@ ${this.value}</textarea
|
|
|
3712
3627
|
.inherit-color {
|
|
3713
3628
|
color: var(--sc-_color);
|
|
3714
3629
|
}
|
|
3715
|
-
`,
|
|
3630
|
+
`,lo=y`
|
|
3716
3631
|
:host {
|
|
3717
3632
|
--sc-_color: inherit;
|
|
3718
3633
|
--sc-_bg: inherit;
|
|
@@ -3775,7 +3690,7 @@ ${this.value}</textarea
|
|
|
3775
3690
|
.inherit-bg {
|
|
3776
3691
|
color: inherit;
|
|
3777
3692
|
}
|
|
3778
|
-
|
|
3693
|
+
`,uo=`sonic-card`,fo=class extends E{constructor(...e){super(...e),this.type=`base`}static{this.styles=[lo,y`
|
|
3779
3694
|
* {
|
|
3780
3695
|
box-sizing: border-box;
|
|
3781
3696
|
}
|
|
@@ -3805,7 +3720,7 @@ ${this.value}</textarea
|
|
|
3805
3720
|
box-shadow: var(--sc-_shadow);
|
|
3806
3721
|
color: var(--sc-_color);
|
|
3807
3722
|
}
|
|
3808
|
-
`]
|
|
3723
|
+
`]}render(){return C`<slot></slot> `}};O([b({type:String,reflect:!0})],fo.prototype,`type`,void 0),fo=O([v(uo)],fo);var po=`sonic-tr`,mo=class extends k(E){constructor(...e){super(...e),this._metadata_={}}static{this.styles=[co,y`
|
|
3809
3724
|
:host {
|
|
3810
3725
|
display: table-row;
|
|
3811
3726
|
}
|
|
@@ -3823,14 +3738,7 @@ ${this.value}</textarea
|
|
|
3823
3738
|
:host(:hover) {
|
|
3824
3739
|
background: var(--sc-table-hover-bg) !important;
|
|
3825
3740
|
}
|
|
3826
|
-
`],
|
|
3827
|
-
part="th"
|
|
3828
|
-
style=${pt(r)}
|
|
3829
|
-
colspan=${C(this.colSpan)}
|
|
3830
|
-
rowspan=${C(this.rowSpan)}
|
|
3831
|
-
>
|
|
3832
|
-
<slot></slot>
|
|
3833
|
-
</th> `}};qt.styles=[Li,P`
|
|
3741
|
+
`]}willUpdate(e){e.has(`_metadata_`)&&(this.even=!!this._metadata_.even,this.odd=!!this._metadata_.odd,this.last=!!this._metadata_.lastChild),super.willUpdate(e)}render(){return C`<slot></slot>`}};O([b({type:Object})],mo.prototype,`_metadata_`,void 0),O([b({type:Boolean,reflect:!0})],mo.prototype,`even`,void 0),O([b({type:Boolean,reflect:!0})],mo.prototype,`odd`,void 0),O([b({type:Boolean,reflect:!0})],mo.prototype,`last`,void 0),mo=O([v(po)],mo);var ho=`sonic-th`,go=class extends E{static{this.styles=[co,y`
|
|
3834
3742
|
:host {
|
|
3835
3743
|
display: contents;
|
|
3836
3744
|
background: var(--sc-table-bg);
|
|
@@ -3853,9 +3761,14 @@ ${this.value}</textarea
|
|
|
3853
3761
|
:host([noBorder]) th {
|
|
3854
3762
|
border-bottom: none;
|
|
3855
3763
|
}
|
|
3856
|
-
`]
|
|
3764
|
+
`]}render(){return C`<th
|
|
3765
|
+
part="th"
|
|
3766
|
+
style=${M({textAlign:this.align,minWidth:this.minWidth,maxWidth:this.maxWidth,width:this.width})}
|
|
3767
|
+
colspan=${N(this.colSpan)}
|
|
3768
|
+
rowspan=${N(this.rowSpan)}
|
|
3769
|
+
>
|
|
3857
3770
|
<slot></slot>
|
|
3858
|
-
</
|
|
3771
|
+
</th> `}};O([b({type:Number})],go.prototype,`colSpan`,void 0),O([b({type:Number})],go.prototype,`rowSpan`,void 0),O([b({type:String})],go.prototype,`align`,void 0),O([b({type:String})],go.prototype,`minWidth`,void 0),O([b({type:String})],go.prototype,`maxWidth`,void 0),O([b({type:String})],go.prototype,`width`,void 0),go=O([v(ho)],go);var _o=`sonic-td`,vo=class extends E{static{this.styles=[co,y`
|
|
3859
3772
|
:host {
|
|
3860
3773
|
display: contents;
|
|
3861
3774
|
}
|
|
@@ -3868,13 +3781,13 @@ ${this.value}</textarea
|
|
|
3868
3781
|
border-right: var(--sc-table-td-border-r, none);
|
|
3869
3782
|
border-left: var(--sc-table-td-border-l, none);
|
|
3870
3783
|
}
|
|
3871
|
-
`]
|
|
3784
|
+
`]}render(){return C`<td part="td" style=${M({textAlign:this.align,verticalAlign:this.vAlign,minWidth:this.minWidth,maxWidth:this.maxWidth,width:this.width})} colspan=${N(this.colSpan)} rowspan=${N(this.rowSpan)}>
|
|
3785
|
+
<slot></slot>
|
|
3786
|
+
</td>`}};O([b({type:Number})],vo.prototype,`colSpan`,void 0),O([b({type:Number})],vo.prototype,`rowSpan`,void 0),O([b({type:String})],vo.prototype,`align`,void 0),O([b({type:String})],vo.prototype,`vAlign`,void 0),O([b({type:String})],vo.prototype,`minWidth`,void 0),O([b({type:String})],vo.prototype,`maxWidth`,void 0),O([b({type:String})],vo.prototype,`width`,void 0),vo=O([v(_o)],vo);var yo=`sonic-thead`,bo=class extends E{static{this.styles=[y`
|
|
3872
3787
|
:host {
|
|
3873
3788
|
display: table-header-group;
|
|
3874
3789
|
}
|
|
3875
|
-
`]
|
|
3876
|
-
<slot></slot>
|
|
3877
|
-
</tbody>`}};Ni.styles=[P`
|
|
3790
|
+
`]}render(){return C`<slot></slot>`}};bo=O([v(yo)],bo);var xo=`sonic-tbody`,So=class extends E{static{this.styles=[y`
|
|
3878
3791
|
:host {
|
|
3879
3792
|
display: table-row-group;
|
|
3880
3793
|
}
|
|
@@ -3891,29 +3804,22 @@ ${this.value}</textarea
|
|
|
3891
3804
|
border-bottom: var(--sc-form-border-width) solid
|
|
3892
3805
|
var(--sc-base-200, rgba(0, 0, 0, 0.12)) !important;
|
|
3893
3806
|
}
|
|
3894
|
-
`]
|
|
3807
|
+
`]}render(){return C`<tbody part="tbody">
|
|
3895
3808
|
<slot></slot>
|
|
3896
|
-
</
|
|
3809
|
+
</tbody>`}};So=O([v(xo)],So);var Co=`sonic-tfoot`,wo=class extends E{static{this.styles=[y`
|
|
3897
3810
|
:host {
|
|
3898
3811
|
display: contents;
|
|
3899
3812
|
}
|
|
3900
|
-
`]
|
|
3813
|
+
`]}render(){return C`<tfoot>
|
|
3814
|
+
<slot></slot>
|
|
3815
|
+
</tfoot>`}};wo=O([v(Co)],wo);var To=`sonic-caption`,Eo=class extends E{static{this.styles=[y`
|
|
3901
3816
|
:host {
|
|
3902
3817
|
display: table-caption;
|
|
3903
3818
|
font-size: 0.75rem;
|
|
3904
3819
|
color: var(--sc-table-caption-color);
|
|
3905
3820
|
padding: var(--sc-table-td-py) var(--sc-table-td-px) calc(2 * var(--sc-table-td-py));
|
|
3906
3821
|
}
|
|
3907
|
-
`]
|
|
3908
|
-
<div
|
|
3909
|
-
class="table-container ${this.noCustomScroll?"":"custom-scroll"}"
|
|
3910
|
-
style=${pt(r)}
|
|
3911
|
-
>
|
|
3912
|
-
<div class="table">
|
|
3913
|
-
<slot></slot>
|
|
3914
|
-
</div>
|
|
3915
|
-
</div>
|
|
3916
|
-
`}};re.styles=[Ze,Dt,P`
|
|
3822
|
+
`]}render(){return C`<slot></slot>`}};Eo=O([v(To)],Eo);var Do=`sonic-table`,Oo=class extends E{static{this.styles=[ar,P,y`
|
|
3917
3823
|
:host {
|
|
3918
3824
|
--sc-table-fw: var(--sc-font-weight-base, 400);
|
|
3919
3825
|
--sc-table-fst: var(--sc-font-style-base, normal);
|
|
@@ -3958,7 +3864,16 @@ ${this.value}</textarea
|
|
|
3958
3864
|
--sc-table-td-border-b: var(--sc-table-bw) solid
|
|
3959
3865
|
var(--sc-table-border-color);
|
|
3960
3866
|
}
|
|
3961
|
-
`]
|
|
3867
|
+
`]}render(){let e={maxHeight:this.maxHeight};return C`
|
|
3868
|
+
<div
|
|
3869
|
+
class="table-container ${this.noCustomScroll?``:`custom-scroll`}"
|
|
3870
|
+
style=${M(e)}
|
|
3871
|
+
>
|
|
3872
|
+
<div class="table">
|
|
3873
|
+
<slot></slot>
|
|
3874
|
+
</div>
|
|
3875
|
+
</div>
|
|
3876
|
+
`}};O([b({type:String,reflect:!0})],Oo.prototype,`size`,void 0),O([b({type:Boolean,reflect:!0})],Oo.prototype,`bordered`,void 0),O([b({type:Boolean,reflect:!0})],Oo.prototype,`rounded`,void 0),O([b({type:Boolean,reflect:!0})],Oo.prototype,`noCustomScroll`,void 0),O([b({type:String})],Oo.prototype,`maxHeight`,void 0),Oo=O([v(Do)],Oo);var ko=`AES-CBC`,Ao=256;async function jo(){return crypto.subtle.generateKey({name:ko,length:Ao},!0,[`encrypt`,`decrypt`])}function Mo(e){return btoa(String.fromCharCode(...new Uint8Array(e)))}async function No(e,t,n){let r=new TextEncoder().encode(e);return Mo(await crypto.subtle.encrypt({name:ko,iv:n.buffer},t,r))}var Po=y`
|
|
3962
3877
|
@keyframes altcha-spinner {
|
|
3963
3878
|
to {
|
|
3964
3879
|
transform: rotate(360deg);
|
|
@@ -4181,19 +4096,7 @@ ${this.value}</textarea
|
|
|
4181
4096
|
animation: altcha-spinner 0.75s infinite linear;
|
|
4182
4097
|
transform-origin: center;
|
|
4183
4098
|
}
|
|
4184
|
-
|
|
4185
|
-
<form>
|
|
4186
|
-
<altcha-widget
|
|
4187
|
-
challengeurl="${this.chalengeUrl}?key=${this.key}&maxNumber=${this.maxNumber}"
|
|
4188
|
-
maxnumber=${this.maxNumber}
|
|
4189
|
-
hidelogo
|
|
4190
|
-
hidefooter
|
|
4191
|
-
auto="onfocus"
|
|
4192
|
-
strings=${JSON.stringify(t)}
|
|
4193
|
-
></altcha-widget>
|
|
4194
|
-
</form>
|
|
4195
|
-
<slot></slot>
|
|
4196
|
-
`}};Me.styles=[yh,P`
|
|
4099
|
+
`,Fo=`supersoniks_altcha`,Io=`Si2\\]X8M4!n9DCLd`,Lo=!1,Ro=`sonic-captcha`,zo=class extends Or(E){constructor(...e){super(...e),this.key=``,this.action=null,this.zIndex=9999,this.onCaptchaTokenChanged=e=>{e==`request_token`&&(this.formPublisher&&this.formPublisher.captchaToken.set(``),this.requestToken())},this.maxNumber=5e4,this.chalengeUrl=`https://altcha.supersoniks.org/get-challenge`}static{this.styles=[Po,y`
|
|
4197
4100
|
:host {
|
|
4198
4101
|
--altcha-border-width: var(--sc-border-width, 1px);
|
|
4199
4102
|
--altcha-border-radius: var(--sc-rounded);
|
|
@@ -4212,4 +4115,16 @@ ${this.value}</textarea
|
|
|
4212
4115
|
--altcha-color-footer-bg: var(--sc-base-100, #000);
|
|
4213
4116
|
--altcha-max-width: 260px;
|
|
4214
4117
|
}
|
|
4215
|
-
`]
|
|
4118
|
+
`]}connectedCallback(){if(document.location.protocol.includes(`https`)){if(!Lo){let e=document.createElement(`script`);e.type=`module`,this.setAttribute(`async`,``),this.setAttribute(`defer`,``),e.src=`https://cdn.jsdelivr.net/gh/altcha-org/altcha/dist/altcha.min.js`,Lo=!0,document.head.appendChild(e)}this.generateEncryptedKey(),super.connectedCallback(),this.formPublisher=me(this.getAncestorAttributeValue(`headersDataProvider`)??this.getAncestorAttributeValue(`formDataProvider`)),this.formPublisher&&!this.formPublisher.captchaToken.get()&&(this.formPublisher.needsCaptchaValidation.set(!0),this.formPublisher.captchaToken.onAssign(this.onCaptchaTokenChanged))}}disconnectedCallback(){this.formPublisher&&(this.formPublisher.captchaToken.offAssign(this.onCaptchaTokenChanged),this.formPublisher.captchaToken.set(``),this.formPublisher.needsCaptchaValidation.set(!1)),super.disconnectedCallback()}requestToken(){if(!this.formPublisher)return;let e=this.shadowRoot.querySelector(`form`);if(!e)return;let t=new FormData(e);this.formPublisher.captchaKey.set(this.key),this.formPublisher.captchaToken.set(t.get(`altcha`)?.toString()||``)}async generateEncryptedKey(){if(this.key)return;let e=await No(Fo,await jo(),new TextEncoder().encode(Io));this.key=e}render(){if(!this.key)return T;let e=Dn.getLanguage().match(`^fr\\b`)?{aria:`Visitez altcha.org`,error:`La vérification a échoué, réessayez plus tard.`,expired:`La vérification a expiré, réessayez.`,footer:`Protégé par Altcha`,label:`Je ne suis pas un robot.`,verified:`Vérifié`,verifying:`Vérification en cours...`,wait:`Vérification en cours… Veuillez patienter.`}:{aria:`Visit altcha.org`,error:`Verification failed, try again later.`,expired:`Verification expired, try again.`,footer:`Protected by Altcha`,label:`I'm not a robot.`,verified:`Verified`,verifying:`Verifying...`,wait:`Verifying... Please wait.`};return C`
|
|
4119
|
+
<form>
|
|
4120
|
+
<altcha-widget
|
|
4121
|
+
challengeurl="${this.chalengeUrl}?key=${this.key}&maxNumber=${this.maxNumber}"
|
|
4122
|
+
maxnumber=${this.maxNumber}
|
|
4123
|
+
hidelogo
|
|
4124
|
+
hidefooter
|
|
4125
|
+
auto="onfocus"
|
|
4126
|
+
strings=${JSON.stringify(e)}
|
|
4127
|
+
></altcha-widget>
|
|
4128
|
+
</form>
|
|
4129
|
+
<slot></slot>
|
|
4130
|
+
`}};O([b()],zo.prototype,`key`,void 0),O([b()],zo.prototype,`action`,void 0),O([b({type:Number})],zo.prototype,`zIndex`,void 0),zo=O([v(Ro)],zo),window.queueMicrotask=window.queueMicrotask||function(e){Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))};var Bo=Lt(class extends Gt{unsubscribe(){this.observables.forEach(e=>e.offAssign(this.onAssign))}constructor(e){super(e),this.observables=new Set,this.onAssign=e=>{this.setValue(e)},this.node=e.options?.host}render(e){return this.observable!==e&&(this.observable=e,this.isConnected&&this.subscribe(e)),w}subscribe(e){this.unsubscribe(),this.onAssign=e=>{this.setValue(e)},this.observables=ue(e),this.observables.forEach(e=>{e.onAssign(this.onAssign)})}disconnected(){this.unsubscribe()}reconnected(){this.observable&&this.subscribe(this.observable)}}),Vo=Bo,Ho=Bo;window[`concorde-directives-data-provider`]=window[`concorde-directives-data-provider`]||{},window[`concorde-directives-data-provider`]={dp:me,dataProvider:pe,sub:Ho,subscribe:Vo,get:de,set:he};var Uo=R,Wo=Z;window[`concorde-components`]=window[`concorde-components`]||{},window[`concorde-components`]={SonicToast:Uo,SonicModal:Wo};var Go=window;Go.concordeIsLoaded=!0,window.dispatchEvent(new CustomEvent(`concorde-loaded`))});
|