@supersoniks/concorde 2.0.2 → 2.0.4
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 +1 -0
- package/concorde-core.bundle.js +748 -690
- package/concorde-core.es.js +3903 -3123
- package/core/_types/types.d.ts +2 -4
- package/core/components/functional/date/date.d.ts +4 -2
- package/core/components/functional/date/date.js +28 -13
- package/core/components/functional/fetch/fetch.d.ts +9 -10
- package/core/components/functional/fetch/fetch.js +21 -5
- package/core/components/functional/list/list.d.ts +7 -10
- package/core/components/functional/list/list.js +19 -4
- package/core/components/functional/queue/queue.d.ts +3 -2
- package/core/components/functional/queue/queue.js +71 -61
- package/core/components/functional/router/router.d.ts +1 -0
- package/core/components/functional/router/router.js +14 -3
- package/core/components/functional/sdui/sdui.d.ts +2 -7
- package/core/components/functional/submit/submit.js +11 -4
- package/core/components/ui/_css/scroll.js +13 -11
- package/core/components/ui/_css/size.js +1 -1
- package/core/components/ui/alert/alert.d.ts +14 -3
- package/core/components/ui/alert/alert.js +34 -4
- package/core/components/ui/badge/badge.js +10 -3
- package/core/components/ui/button/button.d.ts +19 -10
- package/core/components/ui/button/button.js +77 -22
- package/core/components/ui/captcha/captcha.d.ts +5 -4
- package/core/components/ui/captcha/captcha.js +33 -9
- package/core/components/ui/divider/divider.d.ts +2 -0
- package/core/components/ui/divider/divider.js +17 -2
- package/core/components/ui/form/checkbox/checkbox.d.ts +24 -9
- package/core/components/ui/form/checkbox/checkbox.js +4 -6
- package/core/components/ui/form/css/form-control.js +40 -7
- package/core/components/ui/form/fieldset/fieldset.d.ts +1 -0
- package/core/components/ui/form/fieldset/fieldset.js +14 -1
- package/core/components/ui/form/fieldset/legend-description.js +3 -3
- package/core/components/ui/form/fieldset/legend.js +2 -8
- package/core/components/ui/form/input/input.d.ts +4 -5
- package/core/components/ui/form/input/input.js +17 -13
- package/core/components/ui/form/input-autocomplete/input-autocomplete.d.ts +3 -5
- package/core/components/ui/form/input-autocomplete/input-autocomplete.js +9 -9
- package/core/components/ui/form/select/select.d.ts +4 -1
- package/core/components/ui/form/select/select.js +25 -18
- package/core/components/ui/form/textarea/textarea.d.ts +4 -5
- package/core/components/ui/form/textarea/textarea.js +19 -10
- package/core/components/ui/group/group.js +3 -3
- package/core/components/ui/icon/icon.js +2 -1
- package/core/components/ui/icon/icons.d.ts +0 -4
- package/core/components/ui/icon/icons.js +3 -16
- package/core/components/ui/link/link.d.ts +5 -2
- package/core/components/ui/link/link.js +31 -2
- package/core/components/ui/loader/loader.d.ts +4 -1
- package/core/components/ui/loader/loader.js +11 -3
- package/core/components/ui/loader/styles/inline.js +14 -16
- package/core/components/ui/menu/menu-item.js +2 -1
- package/core/components/ui/menu/menu.js +6 -22
- package/core/components/ui/modal/modal-close.js +2 -1
- package/core/components/ui/modal/modal.d.ts +13 -1
- package/core/components/ui/modal/modal.js +70 -10
- package/core/components/ui/pop/pop.d.ts +9 -3
- package/core/components/ui/pop/pop.js +46 -23
- package/core/components/ui/table/table-tr.d.ts +10 -2
- package/core/components/ui/table/table-tr.js +30 -2
- package/core/components/ui/table/table.d.ts +1 -0
- package/core/components/ui/table/table.js +7 -1
- package/core/components/ui/theme/theme-collection/core-variables.js +8 -19
- package/core/components/ui/theme/theme.d.ts +6 -0
- package/core/components/ui/theme/theme.js +11 -13
- package/core/components/ui/toast/message-subscriber.d.ts +0 -8
- package/core/components/ui/toast/message-subscriber.js +0 -46
- package/core/components/ui/toast/toast-item.js +31 -40
- package/core/components/ui/toast/toast.d.ts +5 -1
- package/core/components/ui/toast/toast.js +80 -13
- package/core/components/ui/tooltip/tooltip.d.ts +3 -1
- package/core/components/ui/tooltip/tooltip.js +22 -0
- package/core/core.d.ts +1 -0
- package/core/core.js +1 -0
- package/core/decorators/Subscriber.d.ts +3 -3
- package/core/decorators/Subscriber.js +66 -23
- package/core/directives/DataProvider.d.ts +12 -7
- package/core/directives/DataProvider.js +23 -8
- package/core/directives/Wording.d.ts +42 -0
- package/core/directives/Wording.js +202 -0
- package/core/mixins/Fetcher.d.ts +8 -11
- package/core/mixins/Fetcher.js +38 -22
- package/core/mixins/FormCheckable.d.ts +1 -4
- package/core/mixins/FormElement.d.ts +1 -0
- package/core/mixins/FormElement.js +3 -6
- package/core/mixins/FormInput.d.ts +3 -5
- package/core/mixins/FormInput.js +4 -0
- package/core/mixins/Subscriber.d.ts +0 -4
- package/core/mixins/Subscriber.js +13 -89
- package/core/mixins/TemplatesContainer.js +9 -0
- package/core/utils/Format.d.ts +1 -0
- package/core/utils/Format.js +16 -0
- package/core/utils/HTML.d.ts +13 -0
- package/core/utils/HTML.js +42 -3
- package/core/utils/Objects.d.ts +1 -0
- package/core/utils/Objects.js +5 -0
- package/core/utils/PublisherProxy.d.ts +16 -10
- package/core/utils/PublisherProxy.js +112 -74
- package/core/utils/Utils.d.ts +1 -0
- package/core/utils/Utils.js +5 -0
- package/core/utils/api.d.ts +26 -0
- package/core/utils/api.js +135 -3
- package/core/utils/url-pattern.d.ts +2 -0
- package/core/utils/url-pattern.js +2 -0
- package/mixins.d.ts +6 -16
- package/package.json +9 -2
package/concorde-core.bundle.js
CHANGED
|
@@ -1,70 +1,84 @@
|
|
|
1
|
-
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){var t,e;let s=class{static getLanguage(){return document.getElementsByTagName("html")[0].getAttribute("lang")}static getCookies(){return document.cookie.split(";").reduce(((t,e)=>{const s=e.indexOf("=");return t[e.substring(0,s).trim()]=e.substring(s+1),t}),{})}static getAncestorAttributeValue(t,e){if(!t)return null;for(;!("hasAttribute"in t)||!t.hasAttribute(e);){if(!(t.parentNode||t.host))break;t=t.parentNode||t.host}return"hasAttribute"in t?t.getAttribute(e):null}static getClosestForm(t){for(;!t.nodeName||"form"!==t.nodeName.toLowerCase();){if(!(t.parentNode||t.host))break;t=t.parentNode||t.host}return t.nodeName?t:null}static async loadJS(t){return new Promise((async e=>{const s=document.createElement("script");s.src=t,s.onload=()=>e(!0),s.onerror=()=>e(!0),document.head.appendChild(s)}))}static async loadCSS(t){return new Promise((async e=>{const s=document.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=t,s.onload=()=>e(!0),s.onerror=()=>e(!0),document.head.appendChild(s)}))}},i=class t{static shallowEqual(t,e,s=!0){const i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length&&s)return!1;for(const o of i){const i=t[o],r=e[o];if(s?i!==r:i!=r)return!1}return!0}static deepEqual(e,s,i=!0){const r=Object.keys(e),o=Object.keys(s);if(r.length!==o.length&&i)return!1;for(const n of r){const r=e[n],o=s[n],a=t.isObject(r)&&t.isObject(o),l=i?r!==o:r!=o;if(a&&!t.deepEqual(r,o)||!a&&l)return!1}return!0}static isObject(t){return null!=t&&"object"==typeof t}static isUndefindOrNull(t){return null==t}static traverse(e,s,i=!1){for(const r of s){const s=e[r];if(void 0===s)return;e=i&&t.isObject(s)?Object.assign(Array.isArray(s)?[]:{},e,s):e[r]}return e}static getURLSearchArray(e,s=""){let i=[];for(let r in e){const o=e[r];s&&(r=s+"["+r+"]"),t.isObject(o)?i=[...i,...this.getURLSearchArray(o,r)]:i.push(`${r}=${o}`)}return i}static getURLSearchString(e){return t.getURLSearchArray(e,"").join("&")}};const r=class t{constructor(t){this.addHTTPResponse=!1,this.cache="default",this.serviceURL=t.serviceURL,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"}set token(e){this._token=e,e?t.invalidTokens.includes(e)||t.tokens.set(this.serviceURL,e):t.tokens.delete(this.serviceURL)}get token(){return t.invalidTokens.includes(this._token)?t.tokens.get(this.serviceURL):this._token}handleInvalidToken(e){e&&(t.invalidTokens.includes(e)||(t.invalidTokens.push(e),this.token=null))}async handleResult(e,s){var r;this.lastResult=e;const o=null==(r=e.headers.get("content-type"))?void 0:r.toLowerCase(),n=e.status;let a={};if(o&&0!=o.indexOf("text/"))try{a=await e.json()}catch(l){a={}}else{a={text:await e.text()}}return this.addHTTPResponse&&i.isObject(a)&&(a._sonic_http_response_=e),498!==n||t.failledTokenUpdates.has(this.serviceURL)||(this.handleInvalidToken(this.token),a="get"===s.apiMethod?await this[s.apiMethod](s.path,s.additionalHeaders):await this[s.apiMethod](s.path,s.data,s.method,s.additionalHeaders)),a}async auth(){if(this.token)return;if(t.tokens.has(this.serviceURL))return void(this.token=t.tokens.get(this.serviceURL));if(!this.tokenProvider)return;let e={};this.userName&&this.password?e={Authorization:"Basic "+window.btoa(unescape(encodeURIComponent(this.userName+":"+this.password)))}:this.authToken&&(e={Authorization:"Bearer "+this.authToken});const s=new URL(this.serviceURL),i=s.protocol+"//"+s.host,r=await fetch(this.computeURL(this.tokenProvider,{serviceHost:i}),{headers:e,credentials:this.credentials});try{const e=await r.json();e.token?this.token=e.token:t.failledTokenUpdates.set(this.serviceURL,!0)}catch(o){t.failledTokenUpdates.set(this.serviceURL,!0)}}async get(e,s){const i={apiMethod:"get",path:e,additionalHeaders:s},r=await this.createHeaders(s),o=this.computeURL(e),n=JSON.stringify({url:o,headers:r});if(!t.loadingGetPromises.has(n)){const e=new Promise((async t=>{const e=await fetch(o,{headers:r,credentials:this.credentials,cache:this.cache});t(await this.handleResult(e,i))}));t.loadingGetPromises.set(n,e)}const a=await t.loadingGetPromises.get(n);return t.loadingGetPromises.delete(n),a}async createHeaders(t){await this.auth();const e={};return this.token&&(e.Authorization="Bearer "+this.token),e["Accept-Language"]=s.getLanguage(),t&&Object.assign(e,t),e}computeURL(t,e={}){let s="";s=t.startsWith("http")?t:this.serviceURL+"/"+t,s.startsWith("http")||(s=window.location.origin+s);const i=new URL(s);for(const r in e)i.searchParams.set(r,e[r]);return i.toString().replace(/([^(https?:)])\/{2,}/g,"$1/")}async send(t,e,s="POST",i){const r={apiMethod:"send",path:t,additionalHeaders:i,method:s,data:e},o=await this.createHeaders(i);o.Accept="application/json",o["Content-Type"]="application/json";const n=await fetch(this.computeURL(t),{headers:o,credentials:this.credentials,method:s,body:JSON.stringify(e)});return await this.handleResult(n,r)}async submitFormData(t,e,s="POST",i){const r={apiMethod:"submitFormData",path:t,additionalHeaders:i,method:s,data:e},o=await this.createHeaders(i);o.Accept="application/json";const n=new FormData,a=e;for(const c in a)n.set(c,a[c]);const l=await fetch(this.computeURL(t),{headers:o,credentials:this.credentials,method:s,body:n});return await this.handleResult(l,r)}async put(t,e,s){return this.send(t,e,"PUT",s)}async post(t,e,s){return this.send(t,e,"POST",s)}async delete(t,e,s){return this.send(t,e,"delete",s)}};r.loadingGetPromises=new Map,r.tokens=new Map,r.invalidTokens=[],r.failledTokenUpdates=new Map;let o=r,n=class{static ucFirst(t){return"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.substring(1)}static js(t){try{return Function("return "+t)()}catch(e){return""}}};function a(t){return"object"==typeof t&&null!=t}const l=class t{constructor(t,e){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._value_=t,this.parent=e||null,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(const t of this._proxies_.values())t.delete();this._invalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),t.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach((t=>t())),!t){if(!d.changed&&this._is_savable_){d.changed=!0,d.saveId++;const t=d.saveId;setTimeout((()=>d.getInstance().saveToLocalStorage(t)),1e3)}this.parent&&this.parent._publishInternalMutation_()}}_publishAssignement_(t=!1){this._assignListeners_.forEach((t=>t(this.get()))),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach((t=>t()))}_publishDynamicFilling_(t,e){this._fillListeners_.forEach((s=>{s[t]!==e&&(s[t]=e)})),this._publishTemplateFilling_(t,e)}_publishTemplateFilling_(t,e){this._templateFillListeners_.forEach((s=>{const i=Object.getOwnPropertyDescriptor(s,t);(!i||i.set||i.writable)&&(s.propertyMap&&s.propertyMap[t]&&(t=s.propertyMap[t]),void 0!==s[t]&&s[t]!==e&&(s[t]=e))}))}onAssign(t,e=!0){"function"==typeof t&&(this._assignListeners_.add(t),e&&t(this.get()))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){"function"==typeof t&&this._invalidateListeners_.add(t)}offInvalidate(t){"function"==typeof t&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onInternalMutation(t){"function"==typeof t&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){"function"==typeof t&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),"object"==typeof this._value_)for(const e in this._value_){let s=e;const i=this._value_[e];t.propertyMap&&t.propertyMap[e]&&(s=t.propertyMap[e]),void 0!==t[e]&&t[e]!==i&&(t[s]=i)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const e in this._value_){const s=this._value_[e];t[e]!==s&&(t[e]=s)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,e=!1){var s;if(this._value_===t)return!0;if(this._value_&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;this._value_=a(t)?t:{__value:t};if(Object.prototype.hasOwnProperty.call(this._value_,"__value"))return this._publishAssignement_(e),!0;for(const r in this._value_)void 0===this._value_[r]&&delete this._value_[r];if(Array.from(this._proxies_.keys()).forEach((t=>{if(void 0===this._value_[t]&&this._proxies_.has(t)){const e=this._proxies_.get(t);(null==e?void 0:e.hasListener())?"_parent_"!=t&&i[t]&&(this._value_[t]=null):this._proxies_.delete(t)}})),this._publishAssignement_(),a(this._value_))for(const r in this._value_){const e=t[r],i=a(e)?e:{__value:e};if(!this._proxies_.has(r)){const t=new p({},this);this._proxies_.set(r,t),t._proxies_.set("_parent_",this)}null==(s=this._proxies_.get(r))||s.set(i,!0),this._publishDynamicFilling_(r,e)}return!0}get(){if(d.modifiedCollectore.length>0&&d.modifiedCollectore[0].add(this),Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return null!=t?t:null}return this._value_}get $tag(){this._instanceCounter_||(t.instancesCounter++,this._instanceCounter_=t.instancesCounter),t.instances.set(this._instanceCounter_,this);return'<reactive-publisher-proxy publisher="'+this._instanceCounter_+'"></reactive-publisher-proxy>'}};l.instances=new Map,l.instancesCounter=0;let c=l;const h=class t{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],null!=t.instance)throw"Singleton / use getInstance";t.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}async cleanStorageData(){return new Promise((t=>{(async()=>{try{let s=localStorage.getItem("publisher-proxies-data"),i=null;if(s&&(i=await this.decompress(s,"gzip")),i)try{this.localStorageData=JSON.parse(i)}catch(e){this.localStorageData={}}else s=await this.compress("{}","gzip"),localStorage.setItem("publisher-proxies-data",s),this.localStorageData={};const r=(new Date).getTime()-432e5;for(const t in this.localStorageData){this.localStorageData[t].lastModifiationMS<r&&delete this.localStorageData[t]}t(!0)}catch(e){window.requestAnimationFrame((()=>{t(!1)})),console.log("no publisher cache in this browser")}})()}))}static getInstance(){return null==t.instance?new t:t.instance}static get(e,s){return t.getInstance().get(e,s)}static collectModifiedPublisher(){t.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return t.modifiedCollectore.shift()}static delete(e){return t.getInstance().delete(e)}async setLocalData(t,e){var s;await this.isLocalStrorageReady,t.set((null==(s=this.localStorageData[e+"¤page:>"+document.location.pathname])?void 0:s.data)||t.get())}get(t,e){const s="enabled"===(null==e?void 0:e.localStorageMode);if(!this.publishers.has(t)){const e=new p({});this.set(t,e)}const i=this.publishers.get(t);return s&&-1===this.initialisedData.indexOf(t)&&(i._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(i,t)),this.publishers.get(t)}set(t,e){this.publishers.set(t,e)}delete(t){return!!this.publishers.has(t)&&(this.publishers.delete(t),!0)}async saveToLocalStorage(e=0){if(e===t.saveId||e%10==0)try{if(!t.changed||t.saving)return;t.saving=!0,t.changed=!1;const e=Array.from(this.publishers.keys());let s=!1;for(const t of e){const e=this.publishers.get(t);if(!(null==e?void 0:e._is_savable_))continue;const i=null==e?void 0:e.get();i&&(this.localStorageData[t+"¤page:>"+document.location.pathname]={lastModifiationMS:(new Date).getTime(),data:i},s=!0)}if(s){const t=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem("publisher-proxies-data",t)}if(t.saving=!1,t.changed){t.saveId++;const e=t.saveId;setTimeout((()=>this.saveToLocalStorage(e)),1e3)}}catch(s){t.saving=!1}}async compress(t,e){const s=(new TextEncoder).encode(t),i=new window.CompressionStream(e),r=i.writable.getWriter();r.write(s),r.close();const o=await new Response(i.readable).arrayBuffer(),n=new Uint8Array(o);let a="";for(let l=0;l<n.length;l++)a+=String.fromCharCode(n[l]);return btoa(a)}async decompress(t,e){const s=atob(t),i=Uint8Array.from(s,(t=>t.charCodeAt(0))).buffer,r=new window.DecompressionStream(e),o=r.writable.getWriter();o.write(i),o.close();const n=await new Response(r.readable).arrayBuffer();return(new TextDecoder).decode(n)}};h.changed=!1,h.saving=!1,h.saveId=0,h.instance=null,h.modifiedCollectore=[];let d=h;class p extends c{constructor(t,e=null){super(t,e);const s=new Proxy(this,{get:function(t,e){if(e==Symbol.toPrimitive)return()=>s.get();if(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_"].includes(e))return t[e];if(!t._proxies_.has(e)){const i=t._value_[e],r=new p(a(i)?i:{__value:i},t);r._proxies_.set("_parent_",s),t._proxies_.set(e,r)}return t._proxies_.get(e)},set:function(t,e,i){var r;if("_value_"==e)return t._value_=i,!0;if("_is_savable_"==e)return t._is_savable_=i,!0;if("_instanceCounter_"==e)return t._instanceCounter_=i,!0;if(!t._proxies_.has(e)){const i=new p({},t);i._proxies_.set("_parent_",s),t._proxies_.set(e,i)}return t._value_[e]!==i&&(t._value_[e]=i,t._publishDynamicFilling_(e,i),null==(r=t._proxies_.get(e))||r.set(a(i)?i:{__value:i})),!0},deleteProperty:function(t,e){return t._publishDynamicFilling_(e,null),t._proxies_.delete(e),delete t._value_[e]},has:function(t,e){return e in t._value_&&"_lockInternalMutationPublishing_"!=e},defineProperty:function(t,e,s){return s&&"value"in s&&(t._value_[e]=s.value),!0},getOwnPropertyDescriptor:function(t,e){return{enumerable:!0,configurable:!0}},ownKeys:function(t){return t._value_.__value?Object.keys(t._value_.__value):Object.keys(t._value_)}});return s}toString(){return"hey"}valueOf(){return 2}getProperty(t,e){return t[e]}}"undefined"!=typeof module&&(module.exports={Publisher:p,PublisherManager:d});class u extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=c.instances.get(parseInt(this.publisherId)),null==(t=this.publisher)||t.onAssign(this.onAssign)}disconnectedCallback(){var t;null==(t=this.publisher)||t.offAssign(this.onAssign)}}customElements.define("reactive-publisher-proxy",u);const g=class t{static disable(){this.enabled&&(this.enabled=!1,Array.from(t.observedElements.keys()).forEach((e=>t.unObserve(e))))}static observe(e){if(!e)return;if(!t.enabled)return;if(t.observedElements.has(e))return;const s=new MutationObserver(t.onMutation),i={childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-bind"]};s.observe(e,i),e.querySelectorAll("[data-bind]").forEach((e=>t.addPublisherListeners(e))),t.observedElements.set(e,s)}static unObserve(e){if(!e)return;const s=this.observedElements.get(e);s&&(s.disconnect(),e.querySelectorAll("[data-bind]").forEach((e=>t.removePublisherListeners(e))))}static onAdded(e){e.hasAttribute&&e.hasAttribute("data-bind")&&t.addPublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach((e=>t.addPublisherListeners(e))):e.childNodes.forEach((e=>t.onAdded(e)))}static onRemoved(e){e.hasAttribute&&e.hasAttribute("data-bind")&&t.removePublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach((e=>t.removePublisherListeners(e))):e.childNodes.forEach((e=>t.onRemoved(e)))}static onMutation(e){for(const s of e)switch(s.type){case"attributes":t.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach((e=>{t.onAdded(e)})),s.removedNodes.forEach((e=>{t.onRemoved(e)}))}}static removePublisherListeners(e){const s=t.publisherListeners.get(e);s&&(t.publisherListeners.delete(e),s.forEach((t=>{var e;null==(e=t.publisher)||e.offAssign(t.onAssign)})))}static getVariablesDescriptor(t){let e=t.match(/(\$(?:\w+\\?\.?)+)/g);return e=e?e.map((t=>t.replace("$",""))):[t],e=e.filter((t=>t.length>0)),{expression:t.replace("\\",""),variables:e.map((t=>t.split(/\b\.\b/).map((t=>t.replace("\\","")))))}}static getDataBindItems(e){return"attributes"in e?Array.from(e.attributes).filter((t=>0==t.name.indexOf("::"))).map((e=>({propertyToUpdate:e.name.substring(2).replace(/-((html)|\w)/g,(t=>t.substring(1).toUpperCase())),bindedVariablesDescriptor:t.getVariablesDescriptor(e.value)}))):[]}static getSubPublisher(t,e){if(!e)return t;for(const s of e)if("_self_"!=s){if(!t)return null;t=t[s]}return t}static addPublisherListeners(e){t.removePublisherListeners(e);const i=s.getAncestorAttributeValue(e.parentNode||e.host||e,"dataProvider");if(!i)return;const r=d.getInstance().get(i),o=t.getDataBindItems(e),a=[];o.forEach((s=>{const i=s.bindedVariablesDescriptor,o=s.propertyToUpdate;for(const l of i.variables){const s=l;let c=r;c=t.getSubPublisher(r,s);const h=e,d={publisher:c,onAssign:()=>{const e=i.variables.map((e=>{var s;return null==(s=t.getSubPublisher(r,e))?void 0:s.get()}));let s=i.expression,a=!1;if(1==e.length&&i.variables[0].join(".")==s.substring(1)){let t=e[0];return null===t&&(t=""),void(h[o]=t)}for(let t=0;t<e.length;t++){let r=e[t];const o=i.variables[t];null===r&&(a=!0,r=void 0),s=s.replace("$"+o.join("."),r)}if(-1!=s.indexOf("|")){const t=s.indexOf("|");if(0==t)s=n.js(s.substring(1));else{const e=s.substring(0,t),i=s.substring(t+1),r=n[e];s=a?"":r?r(i):s}}else s=a?"":s;h[o]=s}};null==c||c.onAssign(d.onAssign),a.push(d)}})),t.publisherListeners.set(e,a)}};g.observedElements=new Map,g.enabled=!0,g.publisherListeners=new Map;let b=g;b.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=b)
|
|
1
|
+
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){var t,e;let s=class t{static getLanguage(){const t=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||t}static getCookies(){return document.cookie.split(";").reduce(((t,e)=>{const s=e.indexOf("=");return t[e.substring(0,s).trim()]=e.substring(s+1),t}),{})}static everyAncestors(t,e){for(;t;){if(!e(t))return;t=t.parentNode||t.host}}static getAncestorAttributeValue(t,e){if(!t)return null;for(;!("hasAttribute"in t)||!t.hasAttribute(e);){if(!(t.parentNode||t.host))break;t=t.parentNode||t.host}return"hasAttribute"in t?t.getAttribute(e):null}static getApiConfiguration(e){const s=t.getAncestorAttributeValue(e,"token"),i=null!=t.getAncestorAttributeValue(e,"addHTTPResponse"),r=t.getAncestorAttributeValue(e,"serviceURL");let o=null,n=null;const a=t.getAncestorAttributeValue(e,"tokenProvider"),l=t.getAncestorAttributeValue(e,"eventsApiToken");s||(o=t.getAncestorAttributeValue(e,"userName"),n=t.getAncestorAttributeValue(e,"password"));return{serviceURL:r,token:s,userName:o,password:n,authToken:l,tokenProvider:a,addHTTPResponse:i,credentials:t.getAncestorAttributeValue(e,"credentials")||void 0,cache:e.getAttribute("cache"),blockUntilDone:e.hasAttribute("blockUntilDone")}}static getClosestElement(t,e){for(;!t.nodeName||t.nodeName.toLowerCase()!==e;){if(!(t.parentNode||t.host))break;t=t.parentNode||t.host}return t.nodeName?t:null}static getClosestForm(e){return t.getClosestElement(e,"form")}static async loadJS(t){return new Promise((async e=>{const s=document.createElement("script");s.src=t,s.onload=()=>e(!0),s.onerror=()=>e(!0),document.head.appendChild(s)}))}static async loadCSS(t){return new Promise((async e=>{const s=document.createElement("link");s.type="text/css",s.rel="stylesheet",s.href=t,s.onload=()=>e(!0),s.onerror=()=>e(!0),document.head.appendChild(s)}))}},i=class{static ucFirst(t){return"string"!=typeof t?t:t.charAt(0).toUpperCase()+t.substring(1)}static minutesDuration(t,e="",i="long"){e||(e=s.getLanguage());function r(t,e,s){return Intl.NumberFormat(t,{style:"unit",unit:e,unitDisplay:s}).format}const[o,n]=(a=t,l=60,[Math.floor(a/l),a%l]);var a,l;const c=[];return o&&c.push(r(e,"hour",i)(o)),n&&c.push(r(e,"minute",i)(n)),new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(c)}static js(t){try{return Function("return "+t)()}catch(e){return""}}};function r(t){return"object"==typeof t&&null!=t}const o=class t{constructor(t,e){for(this._proxies_=new Map,this._is_savable_=!1,this._invalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=t,this.parent=e||null,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(const t of this._proxies_.values())t.delete();this._invalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),t.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(t=!1){if(this._mutationListeners_.forEach((t=>t())),this._is_savable_&&!l.changed){l.changed=!0,l.saveId++;const t=l.saveId;setTimeout((()=>l.getInstance().saveToLocalStorage(t)),1e3)}t||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(t=!1){this._assignmentId_++;const e=this._assignmentId_;if(await(async()=>new Promise((t=>{window.queueMicrotask((()=>t(null)))})))(),e!==this._assignmentId_)return;const s=this.get();this._assignListeners_.forEach((t=>t(s))),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach((t=>t()))}_publishDynamicFilling_(t,e){this._fillListeners_.forEach((s=>{s[t]!==e&&(s[t]=e)})),this._publishTemplateFilling_(t,e)}_publishTemplateFilling_(t,e){this._templateFillListeners_.forEach((s=>{const i=Object.getOwnPropertyDescriptor(s,t);(!i||i.set||i.writable)&&(s.propertyMap&&s.propertyMap[t]&&(t=s.propertyMap[t]),void 0!==s[t]&&s[t]!==e&&(s[t]=e))}))}onAssign(t,e=!0){"function"==typeof t&&(this._assignListeners_.has(t)||(this._assignListeners_.add(t),e&&t(this.get())))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){"function"==typeof t&&this._invalidateListeners_.add(t)}offInvalidate(t){"function"==typeof t&&this._invalidateListeners_.delete(t)}invalidate(){this._publishInvalidation_()}onInternalMutation(t){"function"==typeof t&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){"function"==typeof t&&this._mutationListeners_.delete(t)}startTemplateFilling(t){if(this._templateFillListeners_.add(t),"object"==typeof this._value_)for(const e in this._value_){let s=e;const i=this._value_[e];t.propertyMap&&t.propertyMap[e]&&(s=t.propertyMap[e]),void 0!==t[e]&&t[e]!==i&&(t[s]=i)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(const e in this._value_){const s=this._value_[e];t[e]!==s&&(t[e]=s)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}async set(t,e=!1){var s;if(this._value_===t)return!0;if(this._value_&&Object.prototype.hasOwnProperty.call(this._value_,"__value")&&Object.prototype.hasOwnProperty.call(t,"__value")&&this._value_.__value===t.__value)return!0;const i=this._value_;this._value_=r(t)?t:{__value:t},this._cachedGet_=void 0;if(Object.prototype.hasOwnProperty.call(this._value_,"__value"))return await this._publishAssignement_(e),!0;for(const r in this._value_)void 0===this._value_[r]&&delete this._value_[r];if(this._proxies_.forEach(((t,e)=>{void 0===this._value_[e]&&"_parent_"!=e&&i[e]&&(this._value_[e]=null)})),await this._publishAssignement_(),r(this._value_))for(const o in this._value_){const e=t[o],i=r(e)?e:{__value:e};this._proxies_.has(o)?(await(null==(s=this._proxies_.get(o))?void 0:s.set(i,!0)),this._publishDynamicFilling_(o,e)):this._publishDynamicFilling_(o,e)}return!0}get(){if(void 0!==this._cachedGet_)return this._cachedGet_;if(l.modifiedCollectore.length>0&&l.modifiedCollectore[0].add(this),Object.prototype.hasOwnProperty.call(this._value_,"__value")){const t=this._value_.__value;return this._cachedGet_=null!=t?t:null}return this._cachedGet_=this._value_}get $tag(){this._instanceCounter_||(t.instancesCounter++,this._instanceCounter_=t.instancesCounter),t.instances.set(this._instanceCounter_,this);return'<reactive-publisher-proxy publisher="'+this._instanceCounter_+'"></reactive-publisher-proxy>'}};o.instances=new Map,o.instancesCounter=0;let n=o;const a=class t{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],null!=t.instance)throw"Singleton / use getInstance";t.instance=this,this.isLocalStrorageReady=this.cleanStorageData()}async cleanStorageData(){return new Promise((t=>{(async()=>{try{let s=localStorage.getItem("publisher-proxies-data"),i=null;if(s&&(i=await this.decompress(s,"gzip")),i)try{this.localStorageData=JSON.parse(i)}catch(e){this.localStorageData={}}else s=await this.compress("{}","gzip"),localStorage.setItem("publisher-proxies-data",s),this.localStorageData={};const r=(new Date).getTime()-432e5;for(const t in this.localStorageData){this.localStorageData[t].lastModifiationMS<r&&delete this.localStorageData[t]}t(!0)}catch(e){window.requestAnimationFrame((()=>{t(!1)})),console.log("no publisher cache in this browser")}})()}))}static getInstance(){return null==t.instance?new t:t.instance}static get(e,s){return t.getInstance().get(e,s)}static collectModifiedPublisher(){t.modifiedCollectore.unshift(new Set)}static getModifiedPublishers(){return t.modifiedCollectore.shift()}static delete(e){return!!e&&t.getInstance().delete(e)}async setLocalData(t,e){var i;await this.isLocalStrorageReady,t.set((null==(i=this.localStorageData[e+"¤lang_"+s.getLanguage()])?void 0:i.data)||t.get())}get(t,e){const s="enabled"===(null==e?void 0:e.localStorageMode);if(!this.publishers.has(t)){const e=new h({});this.set(t,e)}const i=this.publishers.get(t);return s&&-1===this.initialisedData.indexOf(t)&&(i._is_savable_=!0,this.initialisedData.push(t),this.setLocalData(i,t)),this.publishers.get(t)}set(t,e){this.publishers.set(t,e)}delete(t){return!!this.publishers.has(t)&&(this.publishers.delete(t),!0)}async saveToLocalStorage(e=0){if(e===t.saveId||e%10==0)try{if(!t.changed||t.saving)return;t.saving=!0,t.changed=!1;const e=Array.from(this.publishers.keys());let i=!1;for(const t of e){const e=this.publishers.get(t);if(!(null==e?void 0:e._is_savable_))continue;const r=null==e?void 0:e.get();r&&(this.localStorageData[t+"¤lang_"+s.getLanguage()]={lastModifiationMS:(new Date).getTime(),data:r},i=!0)}if(i){const t=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem("publisher-proxies-data",t)}if(t.saving=!1,t.changed){t.saveId++;const e=t.saveId;setTimeout((()=>this.saveToLocalStorage(e)),1e3)}}catch(i){t.saving=!1}}async compress(t,e){const s=(new TextEncoder).encode(t),i=new window.CompressionStream(e),r=i.writable.getWriter();r.write(s),r.close();const o=await new Response(i.readable).arrayBuffer(),n=new Uint8Array(o);let a="";for(let l=0;l<n.length;l++)a+=String.fromCharCode(n[l]);return btoa(a)}async decompress(t,e){const s=atob(t),i=Uint8Array.from(s,(t=>t.charCodeAt(0))).buffer,r=new window.DecompressionStream(e),o=r.writable.getWriter();o.write(i),o.close();const n=await new Response(r.readable).arrayBuffer();return(new TextDecoder).decode(n)}};a.buildDate="Thu Apr 04 2024 10:59:02 GMT+0200 (Central European Summer Time)",a.changed=!1,a.saving=!1,a.saveId=0,a.instance=null,a.modifiedCollectore=[];let l=a;const c=new Set(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_is_savable_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_"]);class h extends n{constructor(t,e=null){super(t,e);const s=new Proxy(this,{get:function(t,e){if(e==Symbol.toPrimitive)return()=>s.get();if(c.has(e))return t[e];if(!t._proxies_.has(e)){const i=t._value_[e],o=new h(r(i)?i:{__value:i},t);o._proxies_.set("_parent_",s),t._proxies_.set(e,o)}return t._proxies_.get(e)},set:function(t,e,i){var o;if("_value_"==e)return t._value_=i,!0;if("_cachedGet_"==e)return t._cachedGet_=i,!0;if("_assignmentId_"==e)return t._assignmentId_=i,!0;if("_is_savable_"==e)return t._is_savable_=i,!0;if("_instanceCounter_"==e)return t._instanceCounter_=i,!0;if(!t._proxies_.has(e)){const i=new h({},t);i._proxies_.set("_parent_",s),t._proxies_.set(e,i)}return t._value_[e]!==i&&(t._value_[e]=i,t._publishDynamicFilling_(e,i),null==(o=t._proxies_.get(e))||o.set(r(i)?i:{__value:i})),!0},deleteProperty:function(t,e){var s;return t._publishDynamicFilling_(e,null),null==(s=t._proxies_.get(e))||s.set(null),delete t._value_[e]},has:function(t,e){return e in t._value_&&"_lockInternalMutationPublishing_"!=e},defineProperty:function(t,e,s){return s&&"value"in s&&(t._value_[e]=s.value),!0},getOwnPropertyDescriptor:function(t,e){return{enumerable:!0,configurable:!0}},ownKeys:function(t){return t._value_.__value?Object.keys(t._value_.__value):Object.keys(t._value_)}});return s}toString(){return"hey"}valueOf(){return 2}getProperty(t,e){return t[e]}}"undefined"!=typeof module&&(module.exports={Publisher:h,PublisherManager:l});class d extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=t=>{this.innerHTML=t.toString()}}connectedCallback(){var t;this.publisherId=this.getAttribute("publisher")||"",this.publisher=n.instances.get(parseInt(this.publisherId)),null==(t=this.publisher)||t.onAssign(this.onAssign)}disconnectedCallback(){var t;null==(t=this.publisher)||t.offAssign(this.onAssign)}}customElements.define("reactive-publisher-proxy",d);const p=class t{static disable(){this.enabled&&(this.enabled=!1,Array.from(t.observedElements.keys()).forEach((e=>t.unObserve(e))))}static observe(e){if(!e)return;if(!t.enabled)return;if(t.observedElements.has(e))return;const s=new MutationObserver(t.onMutation),i={childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-bind"]};s.observe(e,i),e.querySelectorAll("[data-bind]").forEach((e=>t.addPublisherListeners(e))),t.observedElements.set(e,s)}static unObserve(e){if(!e)return;const s=this.observedElements.get(e);s&&(s.disconnect(),e.querySelectorAll("[data-bind]").forEach((e=>t.removePublisherListeners(e))))}static onAdded(e){e.hasAttribute&&e.hasAttribute("data-bind")&&t.addPublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach((e=>t.addPublisherListeners(e))):e.childNodes.forEach((e=>t.onAdded(e)))}static onRemoved(e){e.hasAttribute&&e.hasAttribute("data-bind")&&t.removePublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach((e=>t.removePublisherListeners(e))):e.childNodes.forEach((e=>t.onRemoved(e)))}static onMutation(e){for(const s of e)switch(s.type){case"attributes":t.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach((e=>{t.onAdded(e)})),s.removedNodes.forEach((e=>{t.onRemoved(e)}))}}static removePublisherListeners(e){const s=t.publisherListeners.get(e);s&&(t.publisherListeners.delete(e),s.forEach((t=>{var e;null==(e=t.publisher)||e.offAssign(t.onAssign)})))}static getVariablesDescriptor(t){let e=t.match(/(\$(?:\w+\\?\.?)+)/g);return e=e?e.map((t=>t.replace("$",""))):[t],e=e.filter((t=>t.length>0)),{expression:t.replace("\\",""),variables:e.map((t=>t.split(/\b\.\b/).map((t=>t.replace("\\","")))))}}static getDataBindItems(e){return"attributes"in e?Array.from(e.attributes).filter((t=>0==t.name.indexOf("::"))).map((e=>({propertyToUpdate:e.name.substring(2).replace(/-((html)|\w)/g,(t=>t.substring(1).toUpperCase())),bindedVariablesDescriptor:t.getVariablesDescriptor(e.value)}))):[]}static getSubPublisher(t,e){if(!e)return t;for(const s of e)if("_self_"!=s){if(!t)return null;t=t[s]}return t}static addPublisherListeners(e){t.removePublisherListeners(e);const r=s.getAncestorAttributeValue(e.parentNode||e.host||e,"dataProvider");if(!r)return;const o=l.getInstance().get(r),n=t.getDataBindItems(e),a=[];n.forEach((s=>{const r=s.bindedVariablesDescriptor,n=s.propertyToUpdate;for(const l of r.variables){const s=l;let c=o;c=t.getSubPublisher(o,s);const h=e,d={publisher:c,onAssign:()=>{const e=r.variables.map((e=>{var s;return null==(s=t.getSubPublisher(o,e))?void 0:s.get()}));let s=r.expression,a=!1;if(1==e.length&&r.variables[0].join(".")==s.substring(1)){let t=e[0];return null===t&&(t=""),void(h[n]=t)}for(let t=0;t<e.length;t++){let i=e[t];const o=r.variables[t];null===i&&(a=!0,i=void 0),s=s.replace("$"+o.join("."),i)}if(-1!=s.indexOf("|")){const t=s.indexOf("|");if(0==t)s=i.js(s.substring(1));else{const e=s.substring(0,t),r=s.substring(t+1),o=i[e];s=a?"":o?o(r):s}}else s=a?"":s;h[n]=s}};null==c||c.onAssign(d.onAssign),a.push(d)}})),t.publisherListeners.set(e,a)}};p.observedElements=new Map,p.enabled=!0,p.publisherListeners=new Map;let u=p;u.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=u);let g=class t{static shallowEqual(t,e,s=!0){const i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length&&s)return!1;for(const o of i){const i=t[o],r=e[o];if(s?i!==r:i!=r)return!1}return!0}static deepEqual(e,s,i=!0){const r=Object.keys(e),o=Object.keys(s);if(r.length!==o.length&&i)return!1;for(const n of r){const r=e[n],o=s[n],a=t.isObject(r)&&t.isObject(o),l=i?r!==o:r!=o;if(a&&!t.deepEqual(r,o)||!a&&l)return!1}return!0}static isObject(t){return null!=t&&"object"==typeof t}static isUndefindOrNull(t){return null==t}static isEmpty(e){return!!t.isUndefindOrNull(e)||0===Object.keys(e).length}static traverse(e,s,i=!1){for(const r of s){const s=e[r];if(void 0===s)return;e=i&&t.isObject(s)?Object.assign(Array.isArray(s)?[]:{},e,s):e[r]}return e}static getURLSearchArray(e,s=""){let i=[];for(let r in e){const o=e[r];s&&(r=s+"["+r+"]"),t.isObject(o)?i=[...i,...this.getURLSearchArray(o,r)]:i.push(`${r}=${o}`)}return i}static getURLSearchString(e){return t.getURLSearchArray(e,"").join("&")}};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
|
|
6
|
+
*/const b=t=>(e,s)=>{void 0!==s?s.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)}
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2019 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/,
|
|
11
|
+
*/,m=globalThis,f=m.ShadowRoot&&(void 0===m.ShadyCSS||m.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,v=Symbol(),y=new WeakMap;let w=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==v)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(f&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=y.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&y.set(e,t))}return t}toString(){return this.cssText}};const x=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new w(s,t,v)},_=f?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new w("string"==typeof t?t:t+"",void 0,v))(e)})(t):t
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/,{is:
|
|
16
|
+
*/,{is:k,defineProperty:A,getOwnPropertyDescriptor:P,getOwnPropertyNames:C,getOwnPropertySymbols:S,getPrototypeOf:$}=Object,O=globalThis,D=O.trustedTypes,L=D?D.emptyScript:"",E=O.reactiveElementPolyfillSupport,j=(t,e)=>t,M={toAttribute(t,e){switch(e){case Boolean:t=t?L:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(i){s=null}}return s}},I=(t,e)=>!k(t,e),T={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:I};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),O.litPropertyMetadata??(O.litPropertyMetadata=new WeakMap);let N=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=T){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&A(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=P(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return null==i?void 0:i.call(this)},set(e){const o=null==i?void 0:i.call(this);r.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??T}static _$Ei(){if(this.hasOwnProperty(j("elementProperties")))return;const t=$(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(j("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(j("properties"))){const t=this.properties,e=[...C(t),...S(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const t=this._$Eu(e,s);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(_(t))}else void 0!==t&&e.push(_(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e;(this._$E_??(this._$E_=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this._$E_)||e.delete(t)}_$ES(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.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((t,e)=>{if(f)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const s of e){const e=document.createElement("style"),i=m.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$E_)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$E_)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e){var s;const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null==(s=i.converter)?void 0:s.toAttribute)?i.converter:M).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){var s;const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(s=t.converter)?void 0:s.fromAttribute)?t.converter:M;this._$Em=r,this[r]=o.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s,i=!1,r){if(void 0!==t){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??I)(i?r:this[t],e))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],s)}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null==(t=this._$E_)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(s)):this._$ET()}catch(i){throw e=!1,this._$ET(),i}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;null==(e=this._$E_)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach((t=>this._$EO(t,this[t])))),this._$ET()}updated(t){}firstUpdated(t){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[j("elementProperties")]=new Map,N[j("finalized")]=new Map,null==E||E({ReactiveElement:N}),(O.reactiveElementVersions??(O.reactiveElementVersions=[])).push("2.0.2");
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
19
19
|
* Copyright 2017 Google LLC
|
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
21
|
*/
|
|
22
|
-
const
|
|
22
|
+
const z={attribute:!0,type:String,converter:M,reflect:!1,hasChanged:I},R=(t=z,e,s)=>{const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.C(i,void 0,t),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function F(t){return(e,s)=>"object"==typeof s?R(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/function
|
|
27
|
+
*/function U(t){return F({...t,state:!0,attribute:!1})}
|
|
28
28
|
/**
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright 2017 Google LLC
|
|
31
31
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
-
*/const
|
|
32
|
+
*/const V=(t,e,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,s),s)
|
|
33
33
|
/**
|
|
34
34
|
* @license
|
|
35
35
|
* Copyright 2017 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
-
*/;function
|
|
37
|
+
*/;function B(t,e){return(s,i,r)=>{const o=e=>{var s;return(null==(s=e.renderRoot)?void 0:s.querySelector(t))??null};if(e){const{get:t,set:e}="object"==typeof i?s:r??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return V(s,i,{get(){let s=t.call(this);return void 0===s&&(s=o(this),(null!==s||this.hasUpdated)&&e.call(this,s)),s}})}return V(s,i,{get(){return o(this)}})}}
|
|
38
38
|
/**
|
|
39
39
|
* @license
|
|
40
40
|
* Copyright 2021 Google LLC
|
|
41
41
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
42
|
-
*/function H(t){return(e,s)=>{const{slot:i,selector:r}=t??{},o="slot"+(i?`[name=${i}]`:":not([name])");return
|
|
42
|
+
*/function H(t){return(e,s)=>{const{slot:i,selector:r}=t??{},o="slot"+(i?`[name=${i}]`:":not([name])");return V(e,s,{get(){var e;const s=null==(e=this.renderRoot)?void 0:e.querySelector(o),i=(null==s?void 0:s.assignedElements(t))??[];return void 0===r?i:i.filter((t=>t.matches(r)))}})}}
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/
|
|
47
|
+
*/function q(t){return(e,s)=>{const{slot:i}=t??{},r="slot"+(i?`[name=${i}]`:":not([name])");return V(e,s,{get(){var e;const s=null==(e=this.renderRoot)?void 0:e.querySelector(r);return(null==s?void 0:s.assignedNodes(t))??[]}})}}
|
|
48
48
|
/**
|
|
49
49
|
* @license
|
|
50
50
|
* Copyright 2017 Google LLC
|
|
51
51
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
52
|
-
*/
|
|
53
|
-
|
|
52
|
+
*/const W=globalThis,K=W.trustedTypes,Z=K?K.createPolicy("lit-html",{createHTML:t=>t}):void 0,Y="$lit$",G=`lit$${(Math.random()+"").slice(9)}$`,Q="?"+G,J=`<${Q}>`,X=document,tt=()=>X.createComment(""),et=t=>null===t||"object"!=typeof t&&"function"!=typeof t,st=Array.isArray,it=t=>st(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),rt="[ \t\n\f\r]",ot=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,at=/>/g,lt=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,ht=/"/g,dt=/^(?:script|style|textarea|title)$/i,pt=(ft=1,(t,...e)=>({_$litType$:ft,strings:t,values:e})),ut=Symbol.for("lit-noChange"),gt=Symbol.for("lit-nothing"),bt=new WeakMap,mt=X.createTreeWalker(X,129);var ft;function vt(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Z?Z.createHTML(e):e}const yt=(t,e)=>{const s=t.length-1,i=[];let r,o=2===e?"<svg>":"",n=ot;for(let a=0;a<s;a++){const e=t[a];let s,l,c=-1,h=0;for(;h<e.length&&(n.lastIndex=h,l=n.exec(e),null!==l);)h=n.lastIndex,n===ot?"!--"===l[1]?n=nt:void 0!==l[1]?n=at:void 0!==l[2]?(dt.test(l[2])&&(r=RegExp("</"+l[2],"g")),n=lt):void 0!==l[3]&&(n=lt):n===lt?">"===l[0]?(n=r??ot,c=-1):void 0===l[1]?c=-2:(c=n.lastIndex-l[2].length,s=l[1],n=void 0===l[3]?lt:'"'===l[3]?ht:ct):n===ht||n===ct?n=lt:n===nt||n===at?n=ot:(n=lt,r=void 0);const d=n===lt&&t[a+1].startsWith("/>")?" ":"";o+=n===ot?e+J:c>=0?(i.push(s),e.slice(0,c)+Y+e.slice(c)+G+d):e+G+(-2===c?a:d)}return[vt(t,o+(t[s]||"<?>")+(2===e?"</svg>":"")),i]};class wt{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let r=0,o=0;const n=t.length-1,a=this.parts,[l,c]=yt(t,e);if(this.el=wt.createElement(l,s),mt.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=mt.nextNode())&&a.length<n;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(Y)){const e=c[o++],s=i.getAttribute(t).split(G),n=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:n[2],strings:s,ctor:"."===n[1]?Pt:"?"===n[1]?Ct:"@"===n[1]?St:At}),i.removeAttribute(t)}else t.startsWith(G)&&(a.push({type:6,index:r}),i.removeAttribute(t));if(dt.test(i.tagName)){const t=i.textContent.split(G),e=t.length-1;if(e>0){i.textContent=K?K.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],tt()),mt.nextNode(),a.push({type:2,index:++r});i.append(t[e],tt())}}}else if(8===i.nodeType)if(i.data===Q)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=i.data.indexOf(G,t+1));)a.push({type:7,index:r}),t+=G.length-1}r++}}static createElement(t,e){const s=X.createElement("template");return s.innerHTML=t,s}}function xt(t,e,s=t,i){var r,o;if(e===ut)return e;let n=void 0!==i?null==(r=s._$Co)?void 0:r[i]:s._$Cl;const a=et(e)?void 0:e._$litDirective$;return(null==n?void 0:n.constructor)!==a&&(null==(o=null==n?void 0:n._$AO)||o.call(n,!1),void 0===a?n=void 0:(n=new a(t),n._$AT(t,s,i)),void 0!==i?(s._$Co??(s._$Co=[]))[i]=n:s._$Cl=n),void 0!==n&&(e=xt(t,n._$AS(t,e.values),n,i)),e}class _t{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=((null==t?void 0:t.creationScope)??X).importNode(e,!0);mt.currentNode=i;let r=mt.nextNode(),o=0,n=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new kt(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new $t(r,this,t)),this._$AV.push(e),a=s[++n]}o!==(null==a?void 0:a.index)&&(r=mt.nextNode(),o++)}return mt.currentNode=X,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class kt{get _$AU(){var t;return(null==(t=this._$AM)?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=gt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(null==i?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=xt(this,t,e),et(t)?t===gt||null==t||""===t?(this._$AH!==gt&&this._$AR(),this._$AH=gt):t!==this._$AH&&t!==ut&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):it(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==gt&&et(this._$AH)?this._$AA.nextSibling.data=t:this.$(X.createTextNode(t)),this._$AH=t}g(t){var e;const{values:s,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=wt.createElement(vt(i.h,i.h[0]),this.options)),i);if((null==(e=this._$AH)?void 0:e._$AD)===r)this._$AH.p(s);else{const t=new _t(r,this),e=t.u(this.options);t.p(s),this.$(e),this._$AH=t}}_$AC(t){let e=bt.get(t.strings);return void 0===e&&bt.set(t.strings,e=new wt(t)),e}T(t){st(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const r of t)i===e.length?e.push(s=new kt(this.k(tt()),this.k(tt()),this,this.options)):s=e[i],s._$AI(r),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var s;for(null==(s=this._$AP)||s.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class At{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,r){this.type=1,this._$AH=gt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=gt}_$AI(t,e=this,s,i){const r=this.strings;let o=!1;if(void 0===r)t=xt(this,t,e,0),o=!et(t)||t!==this._$AH&&t!==ut,o&&(this._$AH=t);else{const i=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=xt(this,i[s+n],e,n),a===ut&&(a=this._$AH[n]),o||(o=!et(a)||a!==this._$AH[n]),a===gt?t=gt:t!==gt&&(t+=(a??"")+r[n+1]),this._$AH[n]=a}o&&!i&&this.O(t)}O(t){t===gt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Pt extends At{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===gt?void 0:t}}class Ct extends At{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==gt)}}class St extends At{constructor(t,e,s,i,r){super(t,e,s,i,r),this.type=5}_$AI(t,e=this){if((t=xt(this,t,e,0)??gt)===ut)return;const s=this._$AH,i=t===gt&&s!==gt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==gt&&(s===gt||i);i&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;"function"==typeof this._$AH?this._$AH.call((null==(e=this.options)?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class $t{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){xt(this,t)}}const Ot={j:Y,P:G,A:Q,C:1,M:yt,L:_t,R:it,V:xt,D:kt,I:At,H:Ct,N:St,U:Pt,B:$t},Dt=W.litHtmlPolyfillSupport;null==Dt||Dt(wt,kt),(W.litHtmlVersions??(W.litHtmlVersions=[])).push("3.1.0");const{D:Lt}=Ot,Et=()=>document.createComment(""),jt=(t,e,s)=>{var i;const r=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=r.insertBefore(Et(),o),i=r.insertBefore(Et(),o);s=new Lt(e,i,t,t.options)}else{const e=s._$AB.nextSibling,n=s._$AM,a=n!==t;if(a){let e;null==(i=s._$AQ)||i.call(s,t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==n._$AU&&s._$AP(e)}if(e!==o||a){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;r.insertBefore(t,o),t=e}}}return s},Mt=(t,e,s=t)=>(t._$AI(e,s),t),It={},Tt=t=>{var e;null==(e=t._$AP)||e.call(t,!1,!0);let s=t._$AA;const i=t._$AB.nextSibling;for(;s!==i;){const t=s.nextSibling;s.remove(),s=t}},Nt=1,zt=2,Rt=t=>(...e)=>({_$litDirective$:t,values:e});
|
|
53
|
+
/**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2020 Google LLC
|
|
56
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
+
*/let Ft=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
|
|
54
58
|
/**
|
|
55
59
|
* @license
|
|
56
60
|
* Copyright 2017 Google LLC
|
|
57
61
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
-
*/const
|
|
62
|
+
*/const Ut=(t,e)=>{var s;const i=t._$AN;if(void 0===i)return!1;for(const r of i)null==(s=r._$AO)||s.call(r,e,!1),Ut(r,e);return!0},Vt=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},Bt=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),Wt(e)}};function Ht(t){void 0!==this._$AN?(Vt(this),this._$AM=t,Bt(this)):this._$AM=t}function qt(t,e=!1,s=0){const i=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(i))for(let o=s;o<i.length;o++)Ut(i[o],!1),Vt(i[o]);else null!=i&&(Ut(i,!1),Vt(i));else Ut(this,t)}const Wt=t=>{t.type==zt&&(t._$AP??(t._$AP=qt),t._$AQ??(t._$AQ=Ht))};let Kt=class extends Ft{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Bt(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,i;t!==this.isConnected&&(this.isConnected=t,t?null==(s=this.reconnected)||s.call(this):null==(i=this.disconnected)||i.call(this)),e&&(Ut(this,t),Vt(this))}setValue(t){if(void 0===this._$Ct.strings)this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}},Zt=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=(null==s?void 0:s.renderBefore)??e;let r=i._$litPart$;if(void 0===r){const t=(null==s?void 0:s.renderBefore)??null;i._$litPart$=r=new kt(e.insertBefore(tt(),t),t,void 0,s??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return ut}};
|
|
63
|
+
/**
|
|
64
|
+
* @license
|
|
65
|
+
* Copyright 2017 Google LLC
|
|
66
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
67
|
+
*/Zt._$litElement$=!0,Zt.finalized=!0,null==(t=globalThis.litElementHydrateSupport)||t.call(globalThis,{LitElement:Zt});const Yt=globalThis.litElementPolyfillSupport;null==Yt||Yt({LitElement:Zt}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.2");const Gt=(t,e)=>{const s=function(t){if("function"==typeof t){const e=t;return l.collectModifiedPublisher(),e(),l.getModifiedPublishers()||new Set}if("string"==typeof t){const e=t.split("."),s=e.shift()||"";let i=l.get(s);i=g.traverse(i,e);const r=new Set;return r.add(i),r}return new Set([t])}(t).values().next().value;if(void 0!==e){const t=s.get();g.isEmpty(t)&&s.set(e)}return s},Qt=class t{constructor(t){this.addHTTPResponse=!1,this.cache="default",this.isServiceSimulated=!1,this.blockUntilDone=!1,this.serviceURL=t.serviceURL,this.blockUntilDone=t.blockUntilDone||!1,"publisher://"==this.serviceURL&&(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"}set token(e){this._token=e,e?t.invalidTokens.includes(e)||t.tokens.set(this.serviceURL,e):t.tokens.delete(this.serviceURL)}get token(){return t.invalidTokens.includes(this._token)?t.tokens.get(this.serviceURL):this._token}handleInvalidToken(e){e&&(t.invalidTokens.includes(e)||(t.invalidTokens.push(e),this.token=null))}async handleResult(e,s){var i;t.firstCallDoneFlags.set(this.serviceURL,"done"),this.lastResult=e;const r=null==(i=e.headers.get("content-type"))?void 0:i.toLowerCase(),o=e.status;let n={};if(r&&0!=r.indexOf("text/"))try{n=await e.json()}catch(a){n={}}else{n={text:await e.text()}}return this.addHTTPResponse&&g.isObject(n)&&(n._sonic_http_response_=e),498!==o||t.failledTokenUpdates.has(this.serviceURL)||(this.handleInvalidToken(this.token),n="get"===s.apiMethod?await this[s.apiMethod](s.path,s.additionalHeaders):await this[s.apiMethod](s.path,s.data,s.method,s.additionalHeaders)),n}async auth(){if(this.token)return;if(t.tokens.has(this.serviceURL))return void(this.token=t.tokens.get(this.serviceURL));if(!this.tokenProvider)return;let e={};this.userName&&this.password?e={Authorization:"Basic "+window.btoa(unescape(encodeURIComponent(this.userName+":"+this.password)))}:this.authToken&&(e={Authorization:"Bearer "+this.authToken});const s=new URL(this.serviceURL),i=s.protocol+"//"+s.host,r=await fetch(this.computeURL(this.tokenProvider,{serviceHost:i}),{headers:e,credentials:this.credentials});try{const e=await r.json();e.token?this.token=e.token:t.failledTokenUpdates.set(this.serviceURL,!0)}catch(o){t.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(t,e){var s;const i=l.get(t);console.log(i);const r=new URLSearchParams(e.split("?")[1]||""),o=i.get();let n=[];n=Array.isArray(o)?o:[o];const a=[];let c=Number.POSITIVE_INFINITY,h=0,d=0;if(r.has("limit")&&(c=parseInt(r.get("limit")||"0"),d++),r.has("offset")&&(h=parseInt(r.get("offset")||"0"),d++),d>0&&(r.delete("limit"),r.delete("offset")),0===r.size)return n.slice(h,h+c);for(const[l,p]of r.entries()){const t=p.split(",").map((t=>t.trim()));for(const e of t)for(const t of n)if("object"!=typeof t)isNaN(+p)?t.toString().includes(p)&&a.push(t):t==p&&a.push(t);else{const i=t;if(!i[l])continue;isNaN(+e)?(null==(s=i[l])?void 0:s.toString().toLowerCase().includes(e.toLowerCase()))&&a.push(t):i[l]==e&&a.push(t)}}return a.slice(h,h+c)}firstCallDone(){return new Promise((e=>{if(t.firstCallDoneFlags.has(this.serviceURL)){const s=()=>{[void 0,"loading"].includes(t.firstCallDoneFlags.get(this.serviceURL))?window.requestAnimationFrame(s):e(!0)};s()}else t.firstCallDoneFlags.set(this.serviceURL,"loading"),e(!0)}))}async get(e,s){await this.firstCallDone(),this.blockUntilDone&&t.firstCallDoneFlags.set(this.serviceURL,"loading");const i=/dataProvider\((.*?)\)(.*?)$/;if(i.test(e)){const t=e.match(i);if(!t)throw new Error("dataProvider path is not valid");return await this.localGet(t[1],t[2])}const r={apiMethod:"get",path:e,additionalHeaders:s},o=await this.createHeaders(s),n=this.computeURL(e),a=JSON.stringify({url:n,headers:o});if(!t.loadingGetPromises.has(a)){const e=new Promise((async t=>{try{const e=await fetch(n,{headers:o,credentials:this.credentials,cache:this.cache});t(await this.handleResult(e,r))}catch(e){t(null)}}));t.loadingGetPromises.set(a,e)}const l=await t.loadingGetPromises.get(a);return t.loadingGetPromises.delete(a),l}async createHeaders(t){await this.auth();const e={};return this.token&&(e.Authorization="Bearer "+this.token),e["Accept-Language"]=s.getLanguage(),t&&Object.assign(e,t),e}computeURL(t,e={}){let s="";s=t.startsWith("http")?t:this.serviceURL+"/"+t,s.startsWith("http")||(s=window.location.origin+s);const i=new URL(s);for(const r in e)i.searchParams.set(r,e[r]);return i.toString().replace(/([^(https?:)])\/{2,}/g,"$1/")}async send(t,e,s="POST",i){const r={apiMethod:"send",path:t,additionalHeaders:i,method:s,data:e},o=await this.createHeaders(i);o.Accept="application/json",o["Content-Type"]="application/json";const n=await fetch(this.computeURL(t),{headers:o,credentials:this.credentials,method:s,body:JSON.stringify(e)});return await this.handleResult(n,r)}async submitFormData(t,e,s="POST",i){const r={apiMethod:"submitFormData",path:t,additionalHeaders:i,method:s,data:e},o=await this.createHeaders(i);o.Accept="application/json";const n=new FormData,a=e;for(const c in a)n.set(c,a[c]);const l=await fetch(this.computeURL(t),{headers:o,credentials:this.credentials,method:s,body:n});return await this.handleResult(l,r)}async put(t,e,s){return this.send(t,e,"PUT",s)}async post(t,e,s){return this.send(t,e,"POST",s)}async patch(t,e,s){return this.send(t,e,"PATCH",s)}async delete(t,e,s){return this.send(t,e,"delete",s)}};Qt.loadingGetPromises=new Map,Qt.tokens=new Map,Qt.invalidTokens=[],Qt.failledTokenUpdates=new Map,Qt.firstCallDoneFlags=new Map;let Jt=Qt,Xt=class extends Ft{constructor(t){if(super(t),this.et=gt,t.type!==zt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===gt||null==t)return this.vt=void 0,this.et=t;if(t===ut)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}};
|
|
68
|
+
/**
|
|
69
|
+
* @license
|
|
70
|
+
* Copyright 2017 Google LLC
|
|
71
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
72
|
+
*/Xt.directiveName="unsafeHTML",Xt.resultType=1;const te=Rt(Xt),ee=new Map,se=t=>{if(!t)return null;const e=s.getApiConfiguration(t),i=s.getAncestorAttributeValue(t,"wordingProvider"),r=s.getAncestorAttributeValue(t,"wordingVersionProvider"),o={apiConfiguration:e,wordingProvider:i,wordingVersionProvider:r};let n=null;for(const[s,a]of ee)if(g.deepEqual(s,o)){n=a;break}if(!n){n={api:new Jt(e),keysToTranslate:new Set,translatedKeys:new Set,wordingProvider:i,callIndex:0,wordingVersionProvider:r,apiCallKey:o},ee.set(o,n)}return n},ie=class t extends Kt{constructor(t){super(t),this.useUnsafeHTML=!1,this.onAssign=t=>{const e=this.useUnsafeHTML?te(t):t;this.setValue(e)},this.node=t.options.host}unsubscribe(){t.publisher["wording_"+this.key].offAssign(this.onAssign)}render(t,e=!1){return this.useUnsafeHTML=e,this.key!==t&&(this.key=t,this.isConnected&&this.subscribe(t)),ut}static async callApi(e,i,r=!0,o){if(await l.getInstance().isLocalStrorageReady,t.firstCall){t.firstCall=!1;const e=Object.keys(t.publisher.get());for(const s of e)""===t.publisher.get()[s]&&delete t.publisher[s]}if(e){const i=s.getAncestorAttributeValue(e,"wordingVersionProvider");i&&Gt(i).onAssign(t.handleVersionProvider(e))}let n=null!=t.publisher.get()["wording_"+i];const a=o||se(e);if(!a)return;if(n&&""!==i)return void a.translatedKeys.add(i);a.callIndex++;const c=a.callIndex,h=a.wordingProvider??"";if(!h&&r)return void window.setTimeout((async()=>{t.callApi(null,i,!1,a)}),1e3);const d=a.api;window.queueMicrotask((async()=>{if(n=null!=t.publisher["wording_"+i].get(),n||""===i||(a.keysToTranslate.add(i),t.publisher["wording_"+i]=""),c!==a.callIndex)return;const e=Array.from(a.keysToTranslate);if(!e.length)return;const s=h.split("?"),r=s.shift()+"?"+((s.length>0?s.join("?")+"&":"")+"labels[]="+e.join("&labels[]="));a.translatedKeys=new Set([...a.translatedKeys,...a.keysToTranslate]),a.keysToTranslate.clear();const o=await d.get(r);for(const i in o)t.publisher["wording_"+i]=o[i]}))}static handleVersionProvider(e){const s=se(e);if(!s)return;if(t.versionProviderHandlers.has(s))return t.versionProviderHandlers.get(s);const i=function(e){if(!s.wordingVersionProvider)return;const i=t.publisher.get().__wording_versions__??[];if(null==e)return;const r=i.find((t=>t.serviceURL===s.api.serviceURL))||{serviceURL:s.api.serviceURL,version:0};if(i.includes(r)||i.push(r),e!==r.version){r.version=e,t.publisher.set({__wording_versions__:i});for(const e of ee.values())e.keysToTranslate=new Set(e.translatedKeys),e.keysToTranslate.size>0&&t.callApi(null,"",!1,e)}};return t.versionProviderHandlers.set(s,i),i}subscribe(e){this.unsubscribe(),t.publisher["wording_"+e].onAssign(this.onAssign),t.callApi(this.node,e)}disconnected(){this.unsubscribe()}reconnected(){this.key&&this.subscribe(this.key)}};ie.publisher=l.get("sonic-wording",{localStorageMode:"enabled"}),ie.firstCall=!0,ie.versionProviderHandlers=new Map;let re=ie;var oe=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,ae=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ne(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&oe(e,s,o),o};let le=!1,ce=new Set;const he=(t,e)=>{const i=class e extends t{constructor(...t){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.defferedDebug=null,this.debug=null,this.onAssign=t=>{this.props=t}}hasAncestorAttribute(t){return null!=this.getAncestorAttributeValue(t)}getAncestorAttributeValue(t){return s.getAncestorAttributeValue(this,t)}get props(){return null===this._props&&this.publisher?this.publisher.get():this._props}set props(t){"string"==typeof t&&["{","["].includes(t.trim().charAt(0))&&(t=JSON.parse(t)),t!=this._props&&(this._props=t,this.publisher&&this.publisher.get()!=t&&this.publisher.set(t),this.requestUpdate())}updated(t){super.updated(t);const e=[...(this.shadowRoot||this).children].filter((t=>"STYLE"!=t.tagName)),s=this.displayContents?"contents":0==e.length?"none":null;s?this.style.display=s:this.style.removeProperty("display")}connectedCallback(){if(e.instanceCounter++,this.hasAttribute("lazyRendering")){let t=!0;const e=new IntersectionObserver((s=>{for(const i of s)if(t&&i.isIntersecting){this.addDebugger(),t=!1,this.initWording(),this.initPublisher(),e.disconnect();break}}),{root:null,threshold:.9});e.observe(this)}else this.initWording(),this.initPublisher(),this.addDebugger();super.connectedCallback()}disconnectedCallback(){var t;this.removeDebugger(),super.disconnectedCallback(),this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate)),re.publisher.stopTemplateFilling(this),this.onAssign&&(null==(t=this.publisher)||t.offAssign(this.onAssign))}addDebugger(){var t;if(this.hasAttribute("debug")&&!this.defferedDebug){if(!this.debug){this.debug=document.createElement("div");const t=this.debug.style;t.position="fixed",t.top="0",t.right="0",t.margin="auto",t.borderRadius=".7rem",t.backgroundColor="#0f1729",t.color="#c5d4f9",t.padding="16px 16px",t.margin="16px 16px",t.boxShadow="0 10px 30px -18px rgba(0,0,0,.3)",t.overflowY="auto",t.zIndex="99999999",t.maxHeight="calc(100vh - 32px)",t.fontFamily="Consolas, monospace",t.maxWidth="min(50vw,25rem)",t.fontSize="12px",t.minWidth="300px",t.overflowWrap="break-word",t.resize="vertical"}this.addEventListener("click",(t=>{t.ctrlKey&&(t.preventDefault(),le=!le)})),this.dataProvider&&(window[this.dataProvider]=this.publisher),this.addEventListener("mouseover",(()=>{le||this.removeDebugger(),document.body.appendChild(this.debug),ce.add(this.debug)})),this.addEventListener("mouseout",(()=>{le||this.removeDebugger()})),null==(t=this.publisher)||t.onInternalMutation((()=>{var t;this.debug.innerHTML=`🤖 DataProvider : "<b style="font-weight:bold;color:#fff;">${this.dataProvider}</b>"<br>\n <div style="font-size:10px;border-top:1px dashed;margin-top:5px;padding-left:23px;opacity:.6;padding-top:5px;">\n Variable disponible dans la console<br>\n ctrl + Clique : épingler / désépingler\n </div>\n <pre style="margin-top:10px;background:transparent;padding:0;font-size:inherit;color:inherit;">${JSON.stringify(null==(t=this.publisher)?void 0:t.get(),null," ")}</pre>`}))}}removeDebugger(){ce.forEach((t=>{document.body.contains(t)&&document.body.removeChild(t)})),ce=new Set}getApiConfiguration(){return s.getApiConfiguration(this)}async initWording(){const t=Object.getOwnPropertyNames(this.constructor.prototype);for(const e of t)0==e.indexOf("wording_")&&re.callApi(this,e.substring(8));re.publisher.startTemplateFilling(this)}createRenderRoot(){if(""===this.noShadowDom||""===this.getAttribute("noShadowDom"))return this;const t=super.createRenderRoot();return u.observe(t),t}initPublisher(){if(!document)return;this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate),this.onAssign&&this.publisher.offAssign(this.onAssign));const t=l.getInstance();this.dataProvider||(this.dataProvider=this.getAncestorAttributeValue("dataProvider"));let s=this.dataProvider;if(!s&&this._props&&(this.dataProvider=s="__subscriber__"+e.instanceCounter),s){this.bindPublisher&&t.set(s,this.bindPublisher());let e=t.get(s,{localStorageMode:this.getAttribute("localStorage")||"disabled"});if(this.dataProvider=s,this.hasAttribute("subDataProvider")){const i=this.getAttribute("subDataProvider");this.dataProvider=s+"/"+i,e=g.traverse(e,i.split(".")),t.set(this.dataProvider,e),this.publisher=e}this.publisher=e}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 i.instanceCounter=0,ae([F({type:Number})],i.prototype,"collectDependenciesVersion",2),ae([F({type:Boolean})],i.prototype,"displayContents",2),ae([F({type:Boolean})],i.prototype,"noAutoFill",2),ae([F({type:Boolean})],i.prototype,"forceAutoFill",2),ae([F({type:Object})],i.prototype,"propertyMap",2),ae([F({type:String,attribute:"data-title"})],i.prototype,"title",2),ae([F({reflect:!0})],i.prototype,"dataProvider",2),ae([F()],i.prototype,"bindPublisher",2),ae([F()],i.prototype,"props",1),i};window.SonicPublisherManager||(window.SonicPublisherManager=l);var de=Object.defineProperty,pe=Object.getOwnPropertyDescriptor;const ue=t=>{class e extends t{constructor(){super(...arguments),this.templates=null,this.templateValueAttribute="data-value",this.templateList=[],this.templateParts={},this.templatePartsList=[]}connectedCallback(){const t=this.templates||[...this.querySelectorAll("template")];for(const e of t)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=t.filter((t=>!t.getAttribute("data-value"))),0==this.templateList.length&&(this.templateList=t),super.connectedCallback()}}return((t,e,s,i)=>{for(var r,o=i>1?void 0:i?pe(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);i&&o&&de(e,s,o)})([F({type:Array})],e.prototype,"templates",2),e};var ge=Object.defineProperty,be=Object.getOwnPropertyDescriptor,me=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?be(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ge(e,s,o),o};let fe=class extends(he(ue(Zt))){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.hide_hours=!1,this.end_date=0,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}get wording_billet_periode_validite(){return this._wording_billet_periode_validite}set wording_billet_periode_validite(t){var e;t||(t="Du %s au %s"),this._wording_billet_periode_validite=t,this.duAu=null==(e=this.wording_billet_periode_validite)?void 0:e.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=s.getLanguage(),super.connectedCallback()}getDatesParts(t,e,s){const r=this.startDateObject;r.setTime(1e3*t);let o=[];if(e>0){const t=this.endDateObject;t.setTime(1e3*e);const i=r.toDateString()==t.toDateString();i&&!this.hide_hours||(delete s.hour,delete s.minute);if(o=new Intl.DateTimeFormat(this.language||this.pageLanguage,s).formatRangeToParts(r,t),!i){const t=o.find((t=>"literal"==t.type&&"shared"==t.source&&t.value.trim().length>0));t&&(t.value=" "+this.duAu[1]+" ",t.type="to"),this.designMode||o.unshift({type:"from",value:this.duAu[0]+" ",source:"shared"})}}else{o=new Intl.DateTimeFormat(this.language||this.pageLanguage,s).formatToParts(r)}return this.designMode&&o.forEach((t=>t.value=t.value.replace(/,/g," "))),o[0].value=i.ucFirst(o[0].value),o.filter((t=>!0!==t.hidden))}dateStringToSeconds(t){return new Date(t).getTime()/1e3}render(){if(!this.renderIf)return gt;if(this.date_string&&(this.date=this.dateStringToSeconds(this.date_string)),this.date&&(this.start_date=this.date),this.start_date_string&&(this.start_date=this.dateStringToSeconds(this.start_date_string)),this.end_date_string&&(this.end_date=this.dateStringToSeconds(this.end_date_string)),!this.start_date&&!this.now&&!this.end_date)return gt;if(this.start_date||(this.start_date=Date.now()/1e3),this.end_date>0&&this.end_date<this.start_date){const t=this.start_date;this.start_date=this.end_date,this.end_date=t}const t={year:this.year,month:this.month,day:this.day,hour12:this.hour12};"hidden"!==this.weekday&&(t.weekday=this.weekday),"hidden"!==this.hour&&(t.hour=this.hour),"hidden"!==this.minute&&(t.minute=this.minute),this.era&&(t.era=this.era),this.time_zone&&(t.timeZone=this.time_zone);const e=this.getDatesParts(this.start_date,this.end_date,t);return te(`${e.map((t=>{const e=this.templateParts[t.type];if(e){const s=document.importNode(e.content,!0).children[0];return""==s.innerText.trim()&&(s.innerText=t.value),s.outerHTML}const s=document.createElement("span");return s.innerText=t.value,s.className=t.type,`<span class="${t.type}">${t.value}</span>`})).join("")}`)}};me([F()],fe.prototype,"wording_billet_periode_validite",1),me([F({type:Boolean})],fe.prototype,"designMode",2),me([F({type:String})],fe.prototype,"time_zone",2),me([F({type:Number})],fe.prototype,"date",2),me([F({type:String})],fe.prototype,"date_string",2),me([F({type:String})],fe.prototype,"start_date_string",2),me([F({type:String})],fe.prototype,"end_date_string",2),me([F({type:Number})],fe.prototype,"start_date",2),me([F({type:Boolean})],fe.prototype,"hide_hours",2),me([F({type:Number})],fe.prototype,"end_date",2),me([F({type:String})],fe.prototype,"era",2),me([F({type:String})],fe.prototype,"year",2),me([F({type:String})],fe.prototype,"month",2),me([F({type:String})],fe.prototype,"day",2),me([F({type:String})],fe.prototype,"weekday",2),me([F({type:String})],fe.prototype,"hour",2),me([F({type:Boolean})],fe.prototype,"hour12",2),me([F({type:String})],fe.prototype,"minute",2),me([F({type:String})],fe.prototype,"language",2),me([F({type:Boolean})],fe.prototype,"renderIf",2),me([F({type:Boolean})],fe.prototype,"now",2),fe=me([b("sonic-date")],fe);const ve=class t{static listen(){var e;if(!t.listening)return;const s=null==(e=document.location)?void 0:e.href.replace(document.location.origin,"");t.prevURL&&t.prevURL!=s&&(t.prevURL=s,t.listeners.forEach((t=>{t.location=s}))),window.requestAnimationFrame(t.listen)}static offChange(e){const s=t.listeners.indexOf(e);-1!=s&&(t.listeners.splice(s,1),0==t.listeners.length&&(t.listening=!1))}static onChange(e){t.listening||(t.listening=!0,t.listen()),t.listeners.push(e),e.location=this.prevURL}static changeFromComponent(t){const e=t.goBack,s=document.referrer;if(null!=e){const t=document.location.origin,i=e||t,r=!!(0==s.indexOf("http"))&&new URL(s).origin!=t,o=""==s,n=history.length<3,a=o&&n,l=i!=document.location.href;if(r&&l||a){const t=history.state||{};t.concorde=t.concorde||{},t.concorde.hasDoneHistoryBack=!0,history.pushState(t,document.title),history.back(),document.location.replace(i)}else history.back();return}let i=t.getAttribute("to")||"";if(i||(i=t.href||""),!i)return;if(0==i.indexOf("#"))return void(document.location.hash=i.substring(1));const r=new URL(i,document.location.href),o=r.pathname.split("/"),n=[];let a="";for(const l of o)l!=a&&n.push(l),a=l;i="/"+n.join("/")+r.search+(r.hash?+r.hash:""),t.hasAttribute("pushState")?history.pushState(null,"",i):t.hasAttribute("replaceState")?history.replaceState(null,"",i):document.location.href=i}static updateComponentActiveState(t){if("disabled"!=t.autoActive&&t.href&&0!=t.href.indexOf("http")){const e=new URL(t.href,document.location.href),s=new URL(t.location||"",document.location.origin);let i=!1;i="strict"==t.autoActive?e.pathname==s.pathname&&e.hash==s.hash&&e.search==s.search:0==s.href.indexOf(e.href),i?t.setAttribute("active","true"):t.removeAttribute("active")}}};ve.listeners=[],ve.listening=!1,ve.prevURL=null==(e=document.location)?void 0:e.href.replace(document.location.origin,"");let ye=ve;
|
|
59
73
|
/**
|
|
60
74
|
* @license
|
|
61
75
|
* Copyright 2018 Google LLC
|
|
62
76
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/const Jt="important",Xt=" !"+Jt,te=Qt(class extends Gt{constructor(t){var e;if(super(t),t.type!==Zt||"style"!==t.name||(null==(e=t.strings)?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const i=t[s];return null==i?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut)return this.ut=new Set(Object.keys(e)),this.render(e);for(const i of this.ut)null==e[i]&&(this.ut.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in e){const t=e[i];if(null!=t){this.ut.add(i);const e="string"==typeof t&&t.endsWith(Xt);i.includes("-")||e?s.setProperty(i,e?t.slice(0,-11):t,e?Jt:""):s[i]=t}}return _t}});var ee=Object.defineProperty,se=Object.getOwnPropertyDescriptor,ie=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?se(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ee(e,s,o),o};const re=new Map,oe=t=>{class e extends t{constructor(...t){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=t=>{this.setValueFromPublisher(t)},this.onFormValueAssign=t=>{this.setFormValueFromPublisher(t)},this.onFormDataInValidate=()=>{const t=this.getFormPublisher();t&&t.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(t){this.hasAttribute("name")&&!this.forceAutoFill&&(t=this.getAttribute("name")),this._name=t,this.requestUpdate()}validateFormElement(){}updateDataValue(){const t=this.getAttribute("name");if(t){const e=this.getFormPublisher();e&&(e[t]=this.getValueForFormPublisher(),this.setFormValueFromPublisher(e[t].get()))}}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?d.get(this.formDataProvider):null}getValueForFormPublisher(){return this.value}setValueFromPublisher(t){this.value=t}setFormValueFromPublisher(t){this.value=t}get value(){return this._value}set value(t){null==t&&(t=""),i.isObject(t)&&Object.prototype.hasOwnProperty.call(t,"__value")&&null==t._value&&(t=""),this._value!=t&&(this._value=t,this.updateDataValue(),this.requestUpdate())}initPublisher(){let t=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&t[this._name].get()?t[this._name].get():this.getAttribute("value");this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign),this._name&&t&&t[this._name].offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.publisher&&this._name&&this.publisher[this._name].onAssign(this.onValueAssign),t=this.getFormPublisher(),this._name&&t&&(t[this._name].onAssign(this.onFormValueAssign),t.onInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(t){this.value=t.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const t=this.getAncestorAttributeValue("data-keyboard-nav");if(!t)return;const e=t.split(" "),s=e[0];if(!s)return;for(const r of e){re.has(r)||re.set(r,[]);const t=re.get(r);-1==(null==t?void 0:t.indexOf(this))&&t.push(this)}const i=re.get(s);this.addEventListener("keydown",(t=>{var e;const s=t;if(!["ArrowDown","ArrowUp"].includes(s.key))return;const r="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",o=null==i?void 0:i.filter((t=>{var e;const s=null==(e=t.shadowRoot)?void 0:e.querySelector(r);if(!s)return!1;const i=window.getComputedStyle(s);return"none"!==i.display&&""!==i.display&&"none"!=i.pointerEvents&&"hidden"!==i.visibility&&s.getBoundingClientRect().width>0}));let n=null;if("ArrowDown"==s.key&&o){const t=o.indexOf(this);n=t==o.length-1?o[0]:o[t+1]}else if("ArrowUp"==s.key&&o){const t=o.indexOf(this);n=0==t?o[o.length-1]:o[t-1]}const a=null==(e=null==n?void 0:n.shadowRoot)?void 0:e.querySelector(r);a&&a.focus&&(a.focus(),t.preventDefault(),t.stopPropagation())}))}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);const t=this.getFormPublisher();this._name&&t&&(t[this._name].offAssign(this.onFormValueAssign),t.offInvalidate(this.onFormDataInValidate))}}return ie([U({type:Boolean,reflect:!0})],e.prototype,"touched",2),ie([U({type:Boolean})],e.prototype,"error",2),ie([U({type:Boolean})],e.prototype,"autofocus",2),ie([U({type:Boolean})],e.prototype,"required",2),ie([U({type:Boolean})],e.prototype,"forceAutoFill",2),ie([U({type:Boolean})],e.prototype,"disabled",2),ie([U({type:String,attribute:"data-aria-label"})],e.prototype,"ariaLabel",2),ie([U({type:String,attribute:"data-aria-labelledby"})],e.prototype,"ariaLabelledby",2),ie([U()],e.prototype,"name",1),ie([U()],e.prototype,"value",1),e};const ne=class{static async delayPromise(t){return new Promise((e=>{setTimeout(e,t)}))}},ae=class t{static areEqual(t,e){return t.length===e.length&&t.every(((t,s)=>t===e[s]))}static from2d(t){return{to1D:()=>{let e=[];return t.forEach((t=>e=e.concat(t))),this.from(e)}}}static from(e){return{get:()=>e||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:t=>{if(e.length<1)return!0;const s=(e[0]||{})[t];return e.every((e=>(e||{})[t]==s))}})})}),value:()=>({forKey:s=>t.from(e.map((t=>t[s])))}),copy:()=>({fromKey:t=>({toKey:s=>{e.forEach((e=>{e[s]=Array.isArray(e[t])?[...e[t]]:"object"==typeof e[t]&&null!=e[t]?{...e[t]}:e[t]}))}})})}),map:s=>t.from(e.map(s)),filter:s=>t.from(e.filter(s)),find:t=>e.find(t),some:t=>e.some(t),every:t=>e.every(t),group:()=>({byKey:s=>{const i=[],r=new Map;for(const t of e){const e=t[s];if(!r.has(e)){const t=i.length;r.set(e,t);const o={items:[]};o[s]=e,i.push(o)}i[r.get(e)].items.push(t)}return t.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(e.map((t=>t[s])))];return t.from(i.map((t=>e.find((e=>e[s]==t)))))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>t.from(e.filter((t=>{return s.every((e=t,r=i,t=>e[r]!=t[r]));var e,r})))})})})}}},le=b,ce=n,he=s,de=Kt,pe=i,ue=p,ge=d,be=o;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:ne,Arrays:ae,DataBindObserver:le,Format:ce,HTML:he,LocationHandler:de,Objects:pe,PublisherProxy:ue,PublisherManager:ge,api:be};var me=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,ve=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?fe(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&me(e,s,o),o};const ye=t=>{class e extends t{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this.unCheckOnDisconnect=!1,this._checked=null,this.updateAllChecked=()=>{const t=this.getAttribute("name"),e=this.getCheckAllPublisher(),s=this.getFormPublisher();if((null==e?void 0:e.hasCheckAll.get())&&!this.checksAll()&&e&&s&&t){if(!s[this.name].get().length)return void(e.checkMode="noneChecked");null===this.checked?e.checkMode="someUnchecked":"noneChecked"!=e.checkMode.get()&&null!=e.checkMode.get()||(e.checkMode="someUnchecked");const i=s[t].get(),r=e.values.get();if(r&&r.length){let t=r.length;for(const e of r)-1==i.indexOf(e)&&(t-=1);t==r.length&&(e.checkMode="allChecked"),0==t&&(e.checkMode="noneChecked")}-1==r.indexOf(this.value)&&(this.checked=null)}},this.onChecksAllRequest=t=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),"allChecked"==t&&(this.checked=!0,this.setAttribute("allChecked","")),"noneChecked"==t&&(this.checked=null),"someUnchecked"==t&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(t){if(this.value==t)return;if(this.hasAttribute("value")&&!this.forceAutoFill&&(t=this.getAttribute("value")),this._value==t)return;if(null==t)return;if(this._value=t,!this.value)return;const e=this.getFormPublisher();if(e&&this.name){let s=e[this.name].get();(this.radio||this.unique)&&(this.checked=s==t||null),Array.isArray(s)||(s=[]),-1!=s.indexOf(t)&&(this.checked=!0)}1==this.checked&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(t){if(this.setCheckedValue(t),this.checksAll()){const t=this.getCheckAllPublisher();if(t)if(!0===this.checked)t.checkMode="allChecked";else if(null===this.checked){t.checkMode="noneChecked";const e=this.getFormPublisher();e&&(e[this.name]=[])}}this.requestUpdate()}validateFormElement(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("input");if(!e||e.checkValidity())return;const s=this.getFormPublisher();if(s){const t=s[this.name].get();if((this.unique||this.radio)&&null!==t&&t.toString().length>0)return;s.isFormValid=!1,e.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(t){this._checked!=t&&(this._checked=t,this.updateDataValue(),this.requestUpdate(),setTimeout((()=>this.updateAllChecked()),1))}handleChange(){const t=!0!==this.checked||(!!this.radio||null);this.checked=t;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){const t=this.getFormPublisher();if(!t)return null;let e=t[this.name].get();if(this.radio)return!0===this.checked&&null!=this.value?this.value:e;if(this.unique)return!0===this.checked&&null!=this.value?this.value:null;Array.isArray(e)||(e=[]),e=e.slice(0);const s=e.indexOf(this.value);return!0!==this.checked||-1!==s||this.checksAll()||e.push(this.value),null===this.checked&&-1!==s&&e.splice(s,1),e}setFormValueFromPublisher(t){this.unique||this.radio?this.checked=this.value==t||null:(Array.isArray(t)||(t=[]),this.checksAll()||(this.checked=-1!==t.indexOf(this.value)||null))}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const t=this.formDataProvider,e=this.getAttribute("name");return t&&e?ge.get(t+"/"+e+"/_available_values_"):null}disconnectedCallback(){super.disconnectedCallback();const t=this.getCheckAllPublisher();if(t&&(t.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=t.values.get().slice(0),s=e.indexOf(this.value);-1!=s&&(e.splice(s,1),t.values=e)}setTimeout((()=>this.updateAllChecked()),1)}connectedCallback(){super.connectedCallback();const t=this.getFormPublisher();if(t&&this.name){const e=t[this.name].get();e&&Array.isArray(e)&&-1!==e.indexOf(this.value)&&(this.checked=!0)}const e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&(e.hasCheckAll=!0),e.values.get()||(e.values=[]),this.checksAll()||(e.values=[...e.values.get(),this.value])),this.hasAttribute("checked")&&(this.publisher&&!1===this.publisher.get().checked||setTimeout((()=>this.checked=!0),1))}}return ve([U()],e.prototype,"value",1),ve([U()],e.prototype,"forceAutoFill",2),ve([U({type:Boolean})],e.prototype,"unique",2),ve([U({type:Boolean})],e.prototype,"radio",2),ve([U({type:Boolean})],e.prototype,"unCheckOnDisconnect",2),ve([U()],e.prototype,"checked",1),e},we=t=>t??kt,xe=_`
|
|
77
|
+
*/const we="important",xe=" !"+we,_e=Rt(class extends Ft{constructor(t){var e;if(super(t),t.type!==Nt||"style"!==t.name||(null==(e=t.strings)?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const i=t[s];return null==i?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ut)return this.ut=new Set(Object.keys(e)),this.render(e);for(const i of this.ut)null==e[i]&&(this.ut.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in e){const t=e[i];if(null!=t){this.ut.add(i);const e="string"==typeof t&&t.endsWith(xe);i.includes("-")||e?s.setProperty(i,e?t.slice(0,-11):t,e?we:""):s[i]=t}}return ut}});var ke=Object.defineProperty,Ae=Object.getOwnPropertyDescriptor,Pe=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ae(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ke(e,s,o),o};const Ce=new Map,Se=t=>{class e extends t{constructor(...t){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=t=>{this.setValueFromPublisher(t)},this.onFormValueAssign=async t=>{this.setFormValueFromPublisher(t)},this.onFormDataInValidate=()=>{const t=this.getFormPublisher();t&&t.isFormValid.get()&&this.validateFormElement()}}get name(){return this._name}set name(t){this.hasAttribute("name")&&!this.forceAutoFill&&(t=this.getAttribute("name")),this._name=t,this.requestUpdate()}validateFormElement(){}updateDataValue(){const t=this.getAttribute("name");if(t){const e=this.getFormPublisher();e&&(e[t]=this.getValueForFormPublisher(),this.setFormValueFromPublisher(e[t].get()))}}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?l.get(this.formDataProvider):null}getValueForFormPublisher(){return this.value}setValueFromPublisher(t){this.value=t}setFormValueFromPublisher(t){this.value=t}get value(){return this._value}set value(t){null==t&&(t=""),g.isObject(t)&&Object.prototype.hasOwnProperty.call(t,"__value")&&null==t._value&&(t=""),this._value!=t&&(this._value=t,this.updateDataValue(),this.requestUpdate())}initPublisher(){let t=this.getFormPublisher();const e=this.hasAncestorAttribute("initFromPublisher")&&this._name&&t[this._name].get()?t[this._name].get():this.getAttribute("value");this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign),this._name&&t&&t[this._name].offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.publisher&&this._name&&this.publisher[this._name].onAssign(this.onValueAssign),t=this.getFormPublisher(),this._name&&t&&(t[this._name].onAssign(this.onFormValueAssign),t.onInvalidate(this.onFormDataInValidate)),this.updateDataValue(),e&&(this.value=e)}handleBlur(){this.touched=!0}handleChange(t){this.value=t.target.value;const e=new Event("change");this.dispatchEvent(e)}addKeyboardNavigation(){const t=this.getAncestorAttributeValue("data-keyboard-nav");if(!t)return;const e=t.split(" "),s=e[0];if(!s)return;for(const r of e){Ce.has(r)||Ce.set(r,[]);const t=Ce.get(r);-1==(null==t?void 0:t.indexOf(this))&&t.push(this)}const i=Ce.get(s);this.addEventListener("keydown",(t=>{var e;const s=t;if(!["ArrowDown","ArrowUp"].includes(s.key))return;const r="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",o=null==i?void 0:i.filter((t=>{var e;const s=null==(e=t.shadowRoot)?void 0:e.querySelector(r);if(!s)return!1;const i=window.getComputedStyle(s);return"none"!==i.display&&""!==i.display&&"none"!=i.pointerEvents&&"hidden"!==i.visibility&&s.getBoundingClientRect().width>0}));let n=null;if("ArrowDown"==s.key&&o){const t=o.indexOf(this);n=t==o.length-1?o[0]:o[t+1]}else if("ArrowUp"==s.key&&o){const t=o.indexOf(this);n=0==t?o[o.length-1]:o[t-1]}const a=null==(e=null==n?void 0:n.shadowRoot)?void 0:e.querySelector(r);a&&a.focus&&(a.focus(),t.preventDefault(),t.stopPropagation())}))}connectedCallback(){this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"),super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);const t=this.getFormPublisher();this._name&&t&&(t[this._name].offAssign(this.onFormValueAssign),t.offInvalidate(this.onFormDataInValidate))}}return Pe([F({type:Boolean,reflect:!0})],e.prototype,"touched",2),Pe([F({type:Boolean})],e.prototype,"error",2),Pe([F({type:Boolean})],e.prototype,"autofocus",2),Pe([F({type:Boolean})],e.prototype,"required",2),Pe([F({type:Boolean})],e.prototype,"forceAutoFill",2),Pe([F({type:Boolean})],e.prototype,"disabled",2),Pe([F({type:String,attribute:"data-aria-label"})],e.prototype,"ariaLabel",2),Pe([F({type:String,attribute:"data-aria-labelledby"})],e.prototype,"ariaLabelledby",2),Pe([F()],e.prototype,"name",1),Pe([F()],e.prototype,"value",1),e};const $e=class{static async queueTaskPromise(){return new Promise((t=>{window.queueMicrotask((()=>t(null)))}))}static async delayPromise(t){return new Promise((e=>{setTimeout(e,t)}))}},Oe=class t{static areEqual(t,e){return t.length===e.length&&t.every(((t,s)=>t===e[s]))}static from2d(t){return{to1D:()=>{let e=[];return t.forEach((t=>e=e.concat(t))),this.from(e)}}}static from(e){return{get:()=>e||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:t=>{if(e.length<1)return!0;const s=(e[0]||{})[t];return e.every((e=>(e||{})[t]==s))}})})}),value:()=>({forKey:s=>t.from(e.map((t=>t[s])))}),copy:()=>({fromKey:t=>({toKey:s=>{e.forEach((e=>{e[s]=Array.isArray(e[t])?[...e[t]]:"object"==typeof e[t]&&null!=e[t]?{...e[t]}:e[t]}))}})})}),map:s=>t.from(e.map(s)),filter:s=>t.from(e.filter(s)),find:t=>e.find(t),some:t=>e.some(t),every:t=>e.every(t),group:()=>({byKey:s=>{const i=[],r=new Map;for(const t of e){const e=t[s];if(!r.has(e)){const t=i.length;r.set(e,t);const o={items:[]};o[s]=e,i.push(o)}i[r.get(e)].items.push(t)}return t.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(e.map((t=>t[s])))];return t.from(i.map((t=>e.find((e=>e[s]==t)))))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>t.from(e.filter((t=>{return s.every((e=t,r=i,t=>e[r]!=t[r]));var e,r})))})})})}}},De=u,Le=i,Ee=s,je=ye,Me=g,Ie=h,Te=l,Ne=Jt;window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:$e,Arrays:Oe,DataBindObserver:De,Format:Le,HTML:Ee,LocationHandler:je,Objects:Me,PublisherProxy:Ie,PublisherManager:Te,api:Ne};var ze=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Fe=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Re(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ze(e,s,o),o};const Ue=t=>{class e extends t{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this.unCheckOnDisconnect=!1,this._checked=null,this.updateAllChecked=()=>{const t=this.getAttribute("name"),e=this.getCheckAllPublisher(),s=this.getFormPublisher();if((null==e?void 0:e.hasCheckAll.get())&&!this.checksAll()&&e&&s&&t){if(!s[this.name].get().length)return void(e.checkMode="noneChecked");null===this.checked?e.checkMode="someUnchecked":"noneChecked"!=e.checkMode.get()&&null!=e.checkMode.get()||(e.checkMode="someUnchecked");const i=s[t].get(),r=e.values.get();if(r&&r.length){let t=r.length;for(const e of r)-1==i.indexOf(e)&&(t-=1);t==r.length&&(e.checkMode="allChecked"),0==t&&(e.checkMode="noneChecked")}-1==r.indexOf(this.value)&&(this.checked=null)}},this.onChecksAllRequest=t=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),"allChecked"==t&&(this.checked=!0,this.setAttribute("allChecked","")),"noneChecked"==t&&(this.checked=null),"someUnchecked"==t&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(t){if(this.value==t)return;if(this.hasAttribute("value")&&!this.forceAutoFill&&(t=this.getAttribute("value")),this._value==t)return;if(null==t)return;if(this._value=t,!this.value)return;const e=this.getFormPublisher();if(e&&this.name){let s=e[this.name].get();(this.radio||this.unique)&&(this.checked=s==t||null),Array.isArray(s)||(s=[]),-1!=s.indexOf(t)&&(this.checked=!0)}1==this.checked&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(t){if(this.setCheckedValue(t),this.checksAll()){const t=this.getCheckAllPublisher();if(t)if(!0===this.checked)t.checkMode="allChecked";else if(null===this.checked){t.checkMode="noneChecked";const e=this.getFormPublisher();e&&(e[this.name]=[])}}this.requestUpdate()}validateFormElement(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("input");if(!e||e.checkValidity())return;const s=this.getFormPublisher();if(s){const t=s[this.name].get();if((this.unique||this.radio)&&null!==t&&t.toString().length>0)return;s.isFormValid=!1,e.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(t){this._checked!=t&&(this._checked=t,this.updateDataValue(),this.requestUpdate(),setTimeout((()=>this.updateAllChecked()),1))}handleChange(){const t=!0!==this.checked||(!!this.radio||null);this.checked=t;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){const t=this.getFormPublisher();if(!t)return null;let e=t[this.name].get();if(this.radio)return!0===this.checked&&null!=this.value?this.value:e;if(this.unique)return!0===this.checked&&null!=this.value?this.value:null;Array.isArray(e)||(e=[]),e=e.slice(0);const s=e.indexOf(this.value);return!0!==this.checked||-1!==s||this.checksAll()||e.push(this.value),null===this.checked&&-1!==s&&e.splice(s,1),e}setFormValueFromPublisher(t){this.unique||this.radio?this.checked=this.value==t||null:(Array.isArray(t)||(t=[]),this.checksAll()||(this.checked=-1!==t.indexOf(this.value)||null))}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const t=this.formDataProvider,e=this.getAttribute("name");return t&&e?Te.get(t+"/"+e+"/_available_values_"):null}disconnectedCallback(){super.disconnectedCallback();const t=this.getCheckAllPublisher();if(t&&(t.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const e=t.values.get().slice(0),s=e.indexOf(this.value);-1!=s&&(e.splice(s,1),t.values=e)}setTimeout((()=>this.updateAllChecked()),1)}connectedCallback(){super.connectedCallback();const t=this.getFormPublisher();if(t&&this.name){const e=t[this.name].get();e&&Array.isArray(e)&&-1!==e.indexOf(this.value)&&(this.checked=!0)}const e=this.getCheckAllPublisher();e&&(e.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&(e.hasCheckAll=!0),e.values.get()||(e.values=[]),this.checksAll()||(e.values=[...e.values.get(),this.value])),this.hasAttribute("checked")&&(this.publisher&&!1===this.publisher.get().checked||setTimeout((()=>this.checked=!0),1))}}return Fe([F()],e.prototype,"value",1),Fe([F()],e.prototype,"forceAutoFill",2),Fe([F({type:Boolean})],e.prototype,"unique",2),Fe([F({type:Boolean})],e.prototype,"radio",2),Fe([F({type:Boolean})],e.prototype,"unCheckOnDisconnect",2),Fe([F()],e.prototype,"checked",1),e},Ve=t=>t??gt,Be=x`
|
|
64
78
|
/*SIZES*/
|
|
65
79
|
:host {
|
|
66
80
|
--sc-fs: 1rem;
|
|
67
|
-
--sc-lh: 1.
|
|
81
|
+
--sc-lh: 1.15;
|
|
68
82
|
font-size: var(--sc-fs);
|
|
69
83
|
line-height: var(--sc-lh);
|
|
70
84
|
}
|
|
@@ -91,28 +105,32 @@ let Rt=class extends T{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
91
105
|
* @license
|
|
92
106
|
* Copyright 2018 Google LLC
|
|
93
107
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
94
|
-
*/var
|
|
108
|
+
*/var He=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,We=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?qe(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&He(e,s,o),o};let Ke=class extends(Ue(Se(he(Zt)))){constructor(){super(...arguments),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=""}set href(t){this._href=t,this.href&&0!=this.href.indexOf("http")?ye.onChange(this):ye.offChange(this),this.requestUpdate()}get href(){return this._href}handleNavigation(t){t.preventDefault(),ye.changeFromComponent(this)}handleChange(t){if(("click"!=(null==t?void 0:t.type)||!this.autoRepeat)&&(super.handleChange(),(this.pushState||null!==this.goBack)&&(null==t||t.preventDefault(),null==t||t.stopPropagation(),ye.changeFromComponent(this)),this.hasAttribute("reset"))){const t=this.getAttribute("reset"),e=t?Te.get(t):this.getFormPublisher();e&&e.set({})}}handleRepeatStart(t){this.autoRepeat&&(this.handleChange(t),this.pointerDownTime=Date.now(),this.isRepeating=!0,this.repeat()),window.addEventListener("pointerup",this.handleRepeatend),window.addEventListener("blur",this.handleRepeatend)}repeat(){this.isRepeating&&(this.hasAttribute("disabled")?this.isRepeating=!1:(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(t){if(this.name){if(t?this.setAttribute("active","true"):this.removeAttribute("active"),t==this._checked)return;super.setCheckedValue(t)}}disconnectedCallback(){ye.offChange(this),super.disconnectedCallback()}willUpdate(t){(t.has("href")||t.has("autoActive"))&&ye.updateComponentActiveState(this),t.has("location")&&ye.updateComponentActiveState(this)}render(){const t={flexDirection:this.direction,alignItems:this.alignItems,justifyContent:this.justify,align:this.align,minWidth:this.minWidth},e=pt`
|
|
95
109
|
<button
|
|
96
110
|
part="button"
|
|
97
111
|
class=${this.hasPrefix||this.hasSuffix?"has-prefix-or-suffix":""}
|
|
98
|
-
style=${
|
|
99
|
-
aria-
|
|
100
|
-
aria-
|
|
112
|
+
style=${_e(t)}
|
|
113
|
+
aria-controls=${Ve(this.ariaControls)}
|
|
114
|
+
aria-expanded=${Ve(this.sonicAriaExpanded)}
|
|
115
|
+
aria-label=${Ve(this.ariaLabel)}
|
|
116
|
+
aria-labelledby=${Ve(this.ariaLabelledby)}
|
|
101
117
|
@click=${this.handleChange}
|
|
118
|
+
@pointerdown=${this.handleRepeatStart}
|
|
102
119
|
>
|
|
103
120
|
<slot @slotchange=${this.onSlotChange} part="prefix" name="prefix"></slot>
|
|
104
121
|
<slot part="main" class="main-slot"></slot>
|
|
105
122
|
<slot @slotchange=${this.onSlotChange} part="suffix" name="suffix"></slot>
|
|
106
|
-
${1==this.loading?
|
|
123
|
+
${1==this.loading?pt`<sonic-icon name="loader" class="loader"></sonic-icon>`:""}
|
|
107
124
|
</button>
|
|
108
|
-
`;return this.href?
|
|
125
|
+
`;return this.href?pt`<a
|
|
109
126
|
href="${this.href}"
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
aria-
|
|
127
|
+
download=${Ve(this.download)}
|
|
128
|
+
target=${Ve(this.target)}
|
|
129
|
+
aria-label=${Ve(this.ariaLabel)}
|
|
130
|
+
aria-labelledby=${Ve(this.ariaLabelledby)}
|
|
113
131
|
@click=${this.pushState||null!==this.goBack?this.handleNavigation:null}
|
|
114
132
|
>${e}</a
|
|
115
|
-
>`:
|
|
133
|
+
>`:pt`${e}`}onSlotChange(){var t,e;this.hasPrefix=!!(null==(t=this.prefixes)?void 0:t.length),this.hasSuffix=!!(null==(e=this.suffixes)?void 0:e.length)}};Ke.styles=[Be,x`
|
|
116
134
|
* {
|
|
117
135
|
box-sizing: border-box;
|
|
118
136
|
}
|
|
@@ -123,6 +141,7 @@ let Rt=class extends T{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
123
141
|
--sc-btn-fs: var(--sc-fs, 1rem);
|
|
124
142
|
--sc-btn-fw: var(--sc-btn-font-weight);
|
|
125
143
|
--sc-btn-ff: var(--sc-btn-font-family);
|
|
144
|
+
--sc-btn-fw: var(--sc-btn-font-weight);
|
|
126
145
|
|
|
127
146
|
--sc-btn-height: var(--sc-form-height);
|
|
128
147
|
--btn-color: var(--sc-btn-color, var(--sc-base-content));
|
|
@@ -286,8 +305,8 @@ let Rt=class extends T{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
286
305
|
}
|
|
287
306
|
|
|
288
307
|
:host([variant="outline"][type="default"]) button {
|
|
289
|
-
border-color: var(--sc-base-
|
|
290
|
-
color: var(--sc-base-
|
|
308
|
+
border-color: var(--sc-base-content);
|
|
309
|
+
color: var(--sc-base-content);
|
|
291
310
|
background: transparent;
|
|
292
311
|
}
|
|
293
312
|
|
|
@@ -329,10 +348,22 @@ let Rt=class extends T{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
329
348
|
text-decoration: none;
|
|
330
349
|
}
|
|
331
350
|
|
|
351
|
+
/* Alignement */
|
|
352
|
+
:host([align="left"]) button {
|
|
353
|
+
text-align: left !important;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
:host([align="right"]) button {
|
|
357
|
+
text-align: right;
|
|
358
|
+
}
|
|
359
|
+
|
|
332
360
|
/*SHAPE*/
|
|
333
361
|
:host([shape="circle"]) button {
|
|
334
362
|
border-radius: 50%;
|
|
335
363
|
}
|
|
364
|
+
:host([shape="circle"]) .main-slot {
|
|
365
|
+
line-height: 1;
|
|
366
|
+
}
|
|
336
367
|
|
|
337
368
|
:host([shape="circle"]) button,
|
|
338
369
|
:host([shape="square"]) button {
|
|
@@ -364,20 +395,12 @@ let Rt=class extends T{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
364
395
|
border-color: var(--sc-btn-active-bg);
|
|
365
396
|
}
|
|
366
397
|
|
|
367
|
-
:host([align="left"]) button {
|
|
368
|
-
text-align: left;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
:host([align="right"]) button {
|
|
372
|
-
text-align: right;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
398
|
.main-slot {
|
|
376
399
|
flex-grow: 1;
|
|
377
400
|
display: block;
|
|
378
401
|
}
|
|
379
402
|
|
|
380
|
-
:host([minWidth]) .main-slot {
|
|
403
|
+
:host([minWidth]:not([shape="block"])) .main-slot {
|
|
381
404
|
flex-grow: 0;
|
|
382
405
|
}
|
|
383
406
|
|
|
@@ -395,6 +418,7 @@ let Rt=class extends T{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
395
418
|
}
|
|
396
419
|
|
|
397
420
|
/*BOUTON Avec icone seulement*/
|
|
421
|
+
:host([icon]) ::slotted(:only-child),
|
|
398
422
|
:host([icon]) ::slotted(sonic-icon) {
|
|
399
423
|
font-size: 1.2em;
|
|
400
424
|
vertical-align: middle;
|
|
@@ -449,185 +473,23 @@ let Rt=class extends T{constructor(){super(...arguments),this.renderOptions={hos
|
|
|
449
473
|
transform: translate(-50%, -50%) rotate(359deg);
|
|
450
474
|
}
|
|
451
475
|
}
|
|
452
|
-
`],
|
|
453
|
-
|
|
454
|
-
:host([align="left"]) .sonic-loader--inline {
|
|
455
|
-
margin-left:0;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
:host([align="right"]) .sonic-loader--inline {
|
|
459
|
-
margin-left:auto;
|
|
460
|
-
margin-right:0;
|
|
461
|
-
}
|
|
462
|
-
.sonic-loader--inline {
|
|
463
|
-
display:block;
|
|
464
|
-
position: relative;
|
|
465
|
-
width: 80px;
|
|
466
|
-
height: 80px;
|
|
467
|
-
margin:auto;
|
|
468
|
-
z-index:20;
|
|
469
|
-
}
|
|
470
|
-
.sonic-loader--inline div {
|
|
471
|
-
position: absolute;
|
|
472
|
-
top: 33px;
|
|
473
|
-
width: 13px;
|
|
474
|
-
height: 13px;
|
|
475
|
-
border-radius: 50%;
|
|
476
|
-
background:var(--sc-loader-bg);
|
|
477
|
-
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
478
|
-
}
|
|
479
|
-
.sonic-loader--inline div:nth-child(1) {
|
|
480
|
-
left: 8px;
|
|
481
|
-
animation: lds-ellipsis1 0.6s infinite;
|
|
482
|
-
}
|
|
483
|
-
.sonic-loader--inline div:nth-child(2) {
|
|
484
|
-
left: 8px;
|
|
485
|
-
animation: lds-ellipsis2 0.6s infinite;
|
|
486
|
-
}
|
|
487
|
-
.sonic-loader--inline div:nth-child(3) {
|
|
488
|
-
left: 32px;
|
|
489
|
-
animation: lds-ellipsis2 0.6s infinite;
|
|
490
|
-
}
|
|
491
|
-
.sonic-loader--inline div:nth-child(4) {
|
|
492
|
-
left: 56px;
|
|
493
|
-
animation: lds-ellipsis3 0.6s infinite;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
@keyframes lds-ellipsis1 {
|
|
497
|
-
0% {
|
|
498
|
-
transform: scale(0);
|
|
499
|
-
}
|
|
500
|
-
100% {
|
|
501
|
-
transform: scale(1);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
@keyframes lds-ellipsis3 {
|
|
505
|
-
0% {
|
|
506
|
-
transform: scale(1);
|
|
507
|
-
}
|
|
508
|
-
100% {
|
|
509
|
-
transform: scale(0);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
@keyframes lds-ellipsis2 {
|
|
513
|
-
0% {
|
|
514
|
-
transform: translate(0, 0);
|
|
515
|
-
}
|
|
516
|
-
100% {
|
|
517
|
-
transform: translate(24px, 0);
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
`,Se=_`
|
|
522
|
-
|
|
523
|
-
@keyframes sonic-loader--fixed {
|
|
524
|
-
0% {
|
|
525
|
-
transform: scale(0);
|
|
526
|
-
opacity: 0;
|
|
527
|
-
}
|
|
528
|
-
5% {
|
|
529
|
-
opacity: 1;
|
|
530
|
-
}
|
|
531
|
-
70% {
|
|
532
|
-
opacity:90%;
|
|
533
|
-
}
|
|
534
|
-
100% {
|
|
535
|
-
transform: scale(1);
|
|
536
|
-
opacity: 0;
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
.sonic-loader--fixed {
|
|
541
|
-
position: fixed;
|
|
542
|
-
top:50%;
|
|
543
|
-
left:50%;
|
|
544
|
-
transform:transateY(-50%) translateX(-50%);
|
|
545
|
-
z-index:999;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
.sonic-loader--fixed > div:nth-child(2) {
|
|
549
|
-
animation-delay: -0.5s;
|
|
550
|
-
}
|
|
551
|
-
.sonic-loader--fixed > div:nth-child(3) {
|
|
552
|
-
animation-delay: -0.2s;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
.sonic-loader--fixed > div:nth-child(4) {
|
|
556
|
-
display:none !important;
|
|
557
|
-
}
|
|
558
|
-
.sonic-loader--fixed > div {
|
|
559
|
-
background-color: var(--sc-loader-bg);
|
|
560
|
-
width: 5rem;
|
|
561
|
-
height: 5rem;
|
|
562
|
-
border-radius: 100%;
|
|
563
|
-
margin: 2px;
|
|
564
|
-
animation-fill-mode: both;
|
|
565
|
-
position: absolute;
|
|
566
|
-
top: 0px;
|
|
567
|
-
opacity: 0;
|
|
568
|
-
margin: 0;
|
|
569
|
-
top: -2.5rem;
|
|
570
|
-
left: -2.5rem;
|
|
571
|
-
width: 5rem;
|
|
572
|
-
height: 5rem;
|
|
573
|
-
animation: sonic-loader--fixed 1s 0s linear infinite;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
`;var $e=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,De=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Oe(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&$e(e,s,o),o};let Le=class extends Rt{constructor(){super(...arguments),this.mode="fixed"}static show(t){Le.loader||(Le.loader=document.createElement("sonic-loader"));const e=Le.loader;t||(t={}),t.mode&&e.setAttribute("mode",t.mode),t.container||(t.container=document.querySelector("sonic-theme")||document.body,t.mode="fixed"),t.container.appendChild(e),Le.callCounter++}static hide(){Le.callCounter--,Le.callCounter>0||Le.loader&&Le.loader.remove()}render(){return xt`<div class="sonic-loader sonic-loader--${this.mode} ">
|
|
577
|
-
<div></div>
|
|
578
|
-
<div></div>
|
|
579
|
-
<div></div>
|
|
580
|
-
<div></div>
|
|
581
|
-
</div>`}};Le.styles=[Ce,Se,_`
|
|
582
|
-
:host {
|
|
583
|
-
--sc-loader-bg: var(--sc-primary, currentColor);
|
|
584
|
-
pointer-events: none;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
.sonic-loader {
|
|
588
|
-
opacity: 0;
|
|
589
|
-
animation: showLoader 0.5s 0.5s forwards;
|
|
590
|
-
}
|
|
591
|
-
.sonic-loader--inline {
|
|
592
|
-
animation-delay: 0s;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
@keyframes showLoader {
|
|
596
|
-
0% {
|
|
597
|
-
opacity: 0;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
100% {
|
|
601
|
-
opacity: 1;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
`],Le.callCounter=0,De([U({type:String})],Le.prototype,"mode",2),Le=De([m("sonic-loader")],Le);
|
|
605
|
-
/**
|
|
606
|
-
* @license
|
|
607
|
-
* Copyright 2020 Google LLC
|
|
608
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
609
|
-
*/
|
|
610
|
-
const{D:Ee}=Tt,je=()=>document.createComment(""),Me=(t,e,s)=>{var i;const r=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=r.insertBefore(je(),o),i=r.insertBefore(je(),o);s=new Ee(e,i,t,t.options)}else{const e=s._$AB.nextSibling,n=s._$AM,a=n!==t;if(a){let e;null==(i=s._$AQ)||i.call(s,t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==n._$AU&&s._$AP(e)}if(e!==o||a){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;r.insertBefore(t,o),t=e}}}return s},Ne=(t,e,s=t)=>(t._$AI(e,s),t),ze={},Ie=t=>{var e;null==(e=t._$AP)||e.call(t,!1,!0);let s=t._$AA;const i=t._$AB.nextSibling;for(;s!==i;){const t=s.nextSibling;s.remove(),s=t}},Te=(t,e,s)=>{const i=new Map;for(let r=e;r<=s;r++)i.set(t[r],r);return i},Fe=Qt(class extends Gt{constructor(t){if(super(t),t.type!==Yt)throw Error("repeat() can only be used in text expressions")}ht(t,e,s){let i;void 0===s?s=e:void 0!==e&&(i=e);const r=[],o=[];let n=0;for(const a of t)r[n]=i?i(a,n):n,o[n]=s(a,n),n++;return{values:o,keys:r}}render(t,e,s){return this.ht(t,e,s).values}update(t,[e,s,i]){const r=t._$AH,{values:o,keys:n}=this.ht(e,s,i);if(!Array.isArray(r))return this.dt=n,o;const a=this.dt??(this.dt=[]),l=[];let c,h,d=0,p=r.length-1,u=0,g=o.length-1;for(;d<=p&&u<=g;)if(null===r[d])d++;else if(null===r[p])p--;else if(a[d]===n[u])l[u]=Ne(r[d],o[u]),d++,u++;else if(a[p]===n[g])l[g]=Ne(r[p],o[g]),p--,g--;else if(a[d]===n[g])l[g]=Ne(r[d],o[g]),Me(t,l[g+1],r[d]),d++,g--;else if(a[p]===n[u])l[u]=Ne(r[p],o[u]),Me(t,r[d],r[p]),p--,u++;else if(void 0===c&&(c=Te(n,u,g),h=Te(a,d,p)),c.has(a[d]))if(c.has(a[p])){const e=h.get(n[u]),s=void 0!==e?r[e]:null;if(null===s){const e=Me(t,r[d]);Ne(e,o[u]),l[u]=e}else l[u]=Ne(s,o[u]),Me(t,r[d],s),r[e]=null;u++}else Ie(r[p]),p--;else Ie(r[d]),d++;for(;u<=g;){const e=Me(t,l[g+1]);Ne(e,o[u]),l[u++]=e}for(;d<=p;){const t=r[d++];null!==t&&Ie(t)}return this.dt=n,((t,e=ze)=>{t._$AH=e})(t,l),_t}}),Re=(t,e)=>{var s;const i=t._$AN;if(void 0===i)return!1;for(const r of i)null==(s=r._$AO)||s.call(r,e,!1),Re(r,e);return!0},Ue=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===(null==s?void 0:s.size))},Ve=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),He(e)}};
|
|
611
|
-
/**
|
|
612
|
-
* @license
|
|
613
|
-
* Copyright 2017 Google LLC
|
|
614
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
615
|
-
*/function Be(t){void 0!==this._$AN?(Ue(this),this._$AM=t,Ve(this)):this._$AM=t}function qe(t,e=!1,s=0){const i=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(i))for(let o=s;o<i.length;o++)Re(i[o],!1),Ue(i[o]);else null!=i&&(Re(i,!1),Ue(i));else Re(this,t)}const He=t=>{t.type==Yt&&(t._$AP??(t._$AP=qe),t._$AQ??(t._$AQ=Be))};let We=class extends Gt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Ve(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,i;t!==this.isConnected&&(this.isConnected=t,t?null==(s=this.reconnected)||s.call(this):null==(i=this.disconnected)||i.call(this)),e&&(Re(this,t),Ue(this))}setValue(t){if(void 0===this._$Ct.strings)this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};const Ke=new WeakMap;let Ze=0;const Ye=new Map,Qe=new WeakSet,Ge=()=>new Promise((t=>requestAnimationFrame(t))),Je=[{opacity:0}],Xe=[{opacity:0},{opacity:1}],ts=(t,e)=>{const s=t-e;return 0===s?void 0:s},es=(t,e)=>{const s=t/e;return 1===s?void 0:s},ss={left:(t,e)=>{const s=ts(t,e);return{value:s,transform:null==s||isNaN(s)?void 0:`translateX(${s}px)`}},top:(t,e)=>{const s=ts(t,e);return{value:s,transform:null==s||isNaN(s)?void 0:`translateY(${s}px)`}},width:(t,e)=>{let s;0===e&&(e=1,s={width:"1px"});const i=es(t,e);return{value:i,overrideFrom:s,transform:null==i||isNaN(i)?void 0:`scaleX(${i})`}},height:(t,e)=>{let s;0===e&&(e=1,s={height:"1px"});const i=es(t,e);return{value:i,overrideFrom:s,transform:null==i||isNaN(i)?void 0:`scaleY(${i})`}}},is={duration:333,easing:"ease-in-out"},rs=["left","top","width","height","opacity","color","background"],os=new WeakMap;const ns=Qt(class extends We{constructor(t){if(super(t),this.t=null,this.i=null,this.o=!0,this.shouldLog=!1,t.type===Yt)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;null==(t=this.resolveFinished)||t.call(this),this.finished=new Promise((t=>{this.h=t}))}async resolveFinished(){var t;null==(t=this.h)||t.call(this),this.h=void 0}render(t){return kt}getController(){return Ke.get(this.l)}isDisabled(){var t;return this.options.disabled||(null==(t=this.getController())?void 0:t.disabled)}update(t,[e]){var s;const i=void 0===this.l;return i&&(this.l=null==(s=t.options)?void 0:s.host,this.l.addController(this),this.element=t.element,os.set(this.element,this)),this.optionsOrCallback=e,(i||"function"!=typeof e)&&this.u(e),this.render(e)}u(t){t=t??{};const e=this.getController();void 0!==e&&((t={...e.defaultOptions,...t}).keyframeOptions={...e.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??(t.properties=rs),this.options=t}p(){const t={},e=this.element.getBoundingClientRect(),s=getComputedStyle(this.element);return this.options.properties.forEach((i=>{const r=e[i]??(ss[i]?void 0:s[i]),o=Number(r);t[i]=isNaN(o)?r+"":o})),t}m(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((t,e)=>{if(Array.isArray(t)){if(Array.isArray(e)&&e.length===t.length&&t.every(((t,s)=>t===e[s])))return!1}else if(e===t)return!1;return!0})(t,this.v)),this.o=this.l.hasUpdated&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.o&&(this.v=Array.isArray(t)?Array.from(t):t),this.o}hostUpdate(){"function"==typeof this.optionsOrCallback&&this.u(this.optionsOrCallback()),this.m()&&(this.g=this.p(),this.t=this.t??this.element.parentNode,this.i=this.element.nextSibling)}async hostUpdated(){if(!this.o||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await Ge;const e=this._(),s=this.A(this.options.keyframeOptions,e),i=this.p();if(void 0!==this.g){const{from:s,to:r}=this.O(this.g,i,e);this.log("measured",[this.g,i,s,r]),t=this.calculateKeyframes(s,r)}else{const s=Ye.get(this.options.inId);if(s){Ye.delete(this.options.inId);const{from:r,to:o}=this.O(s,i,e);t=this.calculateKeyframes(r,o),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Ze++,t.forEach((t=>t.zIndex=Ze))}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,s)}resetStyles(){void 0!==this.j&&(this.element.setAttribute("style",this.j??""),this.j=void 0)}commitStyles(){var t,e;this.j=this.element.getAttribute("style"),null==(t=this.webAnimation)||t.commitStyles(),null==(e=this.webAnimation)||e.cancel()}reconnected(){}async disconnected(){var t;if(!this.o)return;if(void 0!==this.options.id&&Ye.set(this.options.id,this.g),void 0===this.options.out)return;if(this.prepare(),await Ge(),null==(t=this.t)?void 0:t.isConnected){const t=this.i&&this.i.parentNode===this.t?this.i:null;if(this.t.insertBefore(this.element,t),this.options.stabilizeOut){const t=this.p();this.log("stabilizing out");const e=this.g.left-t.left,s=this.g.top-t.top;!("static"===getComputedStyle(this.element).position)||0===e&&0===s||(this.element.style.position="relative"),0!==e&&(this.element.style.left=e+"px"),0!==s&&(this.element.style.top=s+"px")}}const e=this.A(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){var t,e;null==(e=(t=this.options).onStart)||e.call(t,this)}didFinish(t){var e,s;t&&(null==(s=(e=this.options).onComplete)||s.call(e,this)),this.g=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}_(){const t=[];for(let e=this.element.parentNode;e;e=null==e?void 0:e.parentNode){const s=os.get(e);s&&!s.isDisabled()&&s&&t.push(s)}return t}get isHostRendered(){const t=Qe.has(this.l);return t||this.l.updateComplete.then((()=>{Qe.add(this.l)})),t}A(t,e=this._()){const s={...is};return e.forEach((t=>Object.assign(s,t.options.keyframeOptions))),Object.assign(s,t),s}O(t,e,s){t={...t},e={...e};const i=s.map((t=>t.animatingProperties)).filter((t=>void 0!==t));let r=1,o=1;return void 0!==i&&(i.forEach((t=>{t.width&&(r/=t.width),t.height&&(o/=t.height)})),void 0!==t.left&&void 0!==e.left&&(t.left=r*t.left,e.left=r*e.left),void 0!==t.top&&void 0!==e.top&&(t.top=o*t.top,e.top=o*e.top)),{from:t,to:e}}calculateKeyframes(t,e,s=!1){const i={},r={};let o=!1;const n={};for(const a in e){const s=t[a],l=e[a];if(a in ss){const t=ss[a];if(void 0===s||void 0===l)continue;const e=t(s,l);void 0!==e.transform&&(n[a]=e.value,o=!0,i.transform=`${i.transform??""} ${e.transform}`,void 0!==e.overrideFrom&&Object.assign(i,e.overrideFrom))}else s!==l&&void 0!==s&&void 0!==l&&(o=!0,i[a]=s,r[a]=l)}return i.transformOrigin=r.transformOrigin=s?"center center":"top left",this.animatingProperties=n,o?[i,r]:void 0}async animate(t,e=this.options.keyframeOptions){this.start(),this.frames=t;let s=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),void 0!==t)){this.log("animate",[t,e]),s=!0,this.webAnimation=this.element.animate(t,e);const r=this.getController();null==r||r.add(this);try{await this.webAnimation.finished}catch(i){}null==r||r.remove(this)}return this.didFinish(s),s}isAnimating(){var t,e;return"running"===(null==(t=this.webAnimation)?void 0:t.playState)||(null==(e=this.webAnimation)?void 0:e.pending)}log(t,e){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,e)}}),as={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">\n<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"/>\n</svg>\n',"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">\n<path d="M7 12.5L10 15.5L17 8.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<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"/>\n</svg>\n',check:'<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5 13L9 17L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',"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">\n<path d="M12 11.5V16.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 7.51L12.01 7.49889" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<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"/>\n</svg>\n',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">\n <path stroke-linecap="round" stroke-linejoin="round" d="M18 12H6" />\n</svg>\n',"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">\n<path d="M18 12.5C18.2761 12.5 18.5 12.2761 18.5 12C18.5 11.7239 18.2761 11.5 18 11.5C17.7239 11.5 17.5 11.7239 17.5 12C17.5 12.2761 17.7239 12.5 18 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M6 12.5C6.27614 12.5 6.5 12.2761 6.5 12C6.5 11.7239 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.7239 5.5 12C5.5 12.2761 5.72386 12.5 6 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',"more-vert":'<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 18.5C12.2761 18.5 12.5 18.2761 12.5 18C12.5 17.7239 12.2761 17.5 12 17.5C11.7239 17.5 11.5 17.7239 11.5 18C11.5 18.2761 11.7239 18.5 12 18.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 6.5C12.2761 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.2761 5.5 12 5.5C11.7239 5.5 11.5 5.72386 11.5 6C11.5 6.27614 11.7239 6.5 12 6.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',"nav-arrow-down":'<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6 9L12 15L18 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',"warning-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">\n<path d="M12 7L12 13" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 17.01L12.01 16.9989" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<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"/>\n</svg>\n'}};
|
|
476
|
+
`],We([F({type:String,reflect:!0})],Ke.prototype,"type",2),We([F({type:String,reflect:!0})],Ke.prototype,"variant",2),We([F({type:String,reflect:!0})],Ke.prototype,"size",2),We([F({type:String,reflect:!0})],Ke.prototype,"shape",2),We([F({type:String})],Ke.prototype,"direction",2),We([F({type:String,reflect:!0})],Ke.prototype,"alignItems",2),We([F({type:String})],Ke.prototype,"justify",2),We([F({type:String,reflect:!0})],Ke.prototype,"align",2),We([F({type:String})],Ke.prototype,"minWidth",2),We([F({type:Boolean,reflect:!0})],Ke.prototype,"icon",2),We([F({type:String})],Ke.prototype,"download",2),We([F({type:String})],Ke.prototype,"autoActive",2),We([F({type:Boolean,reflect:!0})],Ke.prototype,"loading",2),We([U()],Ke.prototype,"hasPrefix",2),We([U()],Ke.prototype,"hasSuffix",2),We([H({flatten:!0,slot:"prefix"})],Ke.prototype,"prefixes",2),We([H({flatten:!0,slot:"suffix"})],Ke.prototype,"suffixes",2),We([F({type:String})],Ke.prototype,"target",2),We([F({type:String})],Ke.prototype,"href",1),We([F({type:String})],Ke.prototype,"goBack",2),We([F({type:Boolean})],Ke.prototype,"pushState",2),We([F({type:Boolean,reflect:!0})],Ke.prototype,"active",2),We([F({type:Boolean,reflect:!0})],Ke.prototype,"autoRepeat",2),We([F({type:String,attribute:"data-aria-controls"})],Ke.prototype,"ariaControls",2),We([F({type:Boolean,attribute:"data-aria-expanded"})],Ke.prototype,"sonicAriaExpanded",2),We([U()],Ke.prototype,"location",2),Ke=We([b("sonic-button")],Ke);
|
|
616
477
|
/**
|
|
617
478
|
* @license
|
|
618
479
|
* Copyright 2017 Google LLC
|
|
619
480
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
620
481
|
*/
|
|
621
|
-
let ls=class extends Gt{constructor(t){if(super(t),this.et=kt,t.type!==Yt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===kt||null==t)return this.vt=void 0,this.et=t;if(t===_t)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}};ls.directiveName="unsafeHTML",ls.resultType=1;const cs=Qt(ls),hs=new Map,ds={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:""}};let ps=!1;const us=sessionStorage.getItem("sonicIconsCache"),gs=us?JSON.parse(us):{icons:{},names:[]},bs=class{static registerIcons(t){const e=as;for(const s in t){const i=t[s],r=e[s]||{};for(const t in i)r[t]=i[t];e[s]=r}}};bs.fontAwesomeNext={get:async t=>{const e=t.library;if(!t.name)return"";const s=t.name,i=as;var r,o;if("custom"==e&&(ps||(ps=!0,ds.custom.url=(null==(r=document.querySelector("[customIconLibraryPath]"))?void 0:r.getAttribute("customIconLibraryPath"))||"",ds.custom.defaultPrefix=(null==(o=document.querySelector("[customIconDefaultPrefix]"))?void 0:o.getAttribute("customIconDefaultPrefix"))||"")),e&&ds[e]){const r=ds[e],o=t.prefix||r.defaultPrefix||"",n=i[e]||{};i[e]=n;const a=o+"-"+s;if(n[a])return cs(n[a]);const l=r.url.replace("$prefix",o).replace("$name",s);if(gs.icons[l])return n[a]=gs.icons[l],cs(gs.icons[l]);if(!hs.has(l)){const t=new Promise((async t=>{const e=await fetch(l);if(e.ok)try{t(await e.text())}catch(s){t(null)}else t(`<b title="Erreur ${e.status}">😶</b>`)}));hs.set(l,t)}const c=await hs.get(l);if(hs.delete(l),n[a]=c||"",gs.icons[l]=c||"",gs.names.length>100){const t=gs.names.shift();delete gs.icons[t]}return sessionStorage.setItem("sonicIconsCache",JSON.stringify(gs)),cs(c)}return cs(i.core[t.name]||"")}},bs.default=bs.fontAwesomeNext;let ms=bs;var fs=Object.defineProperty,vs=Object.getOwnPropertyDescriptor,ys=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?vs(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&fs(e,s,o),o};let ws=class extends Rt{constructor(){super(...arguments),this.iconText="",this.name="",this.prefix="",this.library=""}async updateIcon(){this.iconText=await ms.default.get({name:this.name,prefix:this.prefix,library:this.library})}willUpdate(t){(t.has("name")||t.has("prefix")||t.has("library"))&&this.updateIcon(),super.willUpdate(t)}render(){return this.iconText?this.iconText:kt}};ws.styles=_`
|
|
482
|
+
const Ze=(t,e,s)=>{const i=new Map;for(let r=e;r<=s;r++)i.set(t[r],r);return i},Ye=Rt(class extends Ft{constructor(t){if(super(t),t.type!==zt)throw Error("repeat() can only be used in text expressions")}ht(t,e,s){let i;void 0===s?s=e:void 0!==e&&(i=e);const r=[],o=[];let n=0;for(const a of t)r[n]=i?i(a,n):n,o[n]=s(a,n),n++;return{values:o,keys:r}}render(t,e,s){return this.ht(t,e,s).values}update(t,[e,s,i]){const r=t._$AH,{values:o,keys:n}=this.ht(e,s,i);if(!Array.isArray(r))return this.dt=n,o;const a=this.dt??(this.dt=[]),l=[];let c,h,d=0,p=r.length-1,u=0,g=o.length-1;for(;d<=p&&u<=g;)if(null===r[d])d++;else if(null===r[p])p--;else if(a[d]===n[u])l[u]=Mt(r[d],o[u]),d++,u++;else if(a[p]===n[g])l[g]=Mt(r[p],o[g]),p--,g--;else if(a[d]===n[g])l[g]=Mt(r[d],o[g]),jt(t,l[g+1],r[d]),d++,g--;else if(a[p]===n[u])l[u]=Mt(r[p],o[u]),jt(t,r[d],r[p]),p--,u++;else if(void 0===c&&(c=Ze(n,u,g),h=Ze(a,d,p)),c.has(a[d]))if(c.has(a[p])){const e=h.get(n[u]),s=void 0!==e?r[e]:null;if(null===s){const e=jt(t,r[d]);Mt(e,o[u]),l[u]=e}else l[u]=Mt(s,o[u]),jt(t,r[d],s),r[e]=null;u++}else Tt(r[p]),p--;else Tt(r[d]),d++;for(;u<=g;){const e=jt(t,l[g+1]);Mt(e,o[u]),l[u++]=e}for(;d<=p;){const t=r[d++];null!==t&&Tt(t)}return this.dt=n,((t,e=It)=>{t._$AH=e})(t,l),ut}}),Ge=new WeakMap;let Qe=0;const Je=new Map,Xe=new WeakSet,ts=()=>new Promise((t=>requestAnimationFrame(t))),es=[{opacity:0}],ss=[{opacity:0},{opacity:1}],is=(t,e)=>{const s=t-e;return 0===s?void 0:s},rs=(t,e)=>{const s=t/e;return 1===s?void 0:s},os={left:(t,e)=>{const s=is(t,e);return{value:s,transform:null==s||isNaN(s)?void 0:`translateX(${s}px)`}},top:(t,e)=>{const s=is(t,e);return{value:s,transform:null==s||isNaN(s)?void 0:`translateY(${s}px)`}},width:(t,e)=>{let s;0===e&&(e=1,s={width:"1px"});const i=rs(t,e);return{value:i,overrideFrom:s,transform:null==i||isNaN(i)?void 0:`scaleX(${i})`}},height:(t,e)=>{let s;0===e&&(e=1,s={height:"1px"});const i=rs(t,e);return{value:i,overrideFrom:s,transform:null==i||isNaN(i)?void 0:`scaleY(${i})`}}},ns={duration:333,easing:"ease-in-out"},as=["left","top","width","height","opacity","color","background"],ls=new WeakMap;const cs=Rt(class extends Kt{constructor(t){if(super(t),this.t=null,this.i=null,this.o=!0,this.shouldLog=!1,t.type===zt)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){var t;null==(t=this.resolveFinished)||t.call(this),this.finished=new Promise((t=>{this.h=t}))}async resolveFinished(){var t;null==(t=this.h)||t.call(this),this.h=void 0}render(t){return gt}getController(){return Ge.get(this.l)}isDisabled(){var t;return this.options.disabled||(null==(t=this.getController())?void 0:t.disabled)}update(t,[e]){var s;const i=void 0===this.l;return i&&(this.l=null==(s=t.options)?void 0:s.host,this.l.addController(this),this.element=t.element,ls.set(this.element,this)),this.optionsOrCallback=e,(i||"function"!=typeof e)&&this.u(e),this.render(e)}u(t){t=t??{};const e=this.getController();void 0!==e&&((t={...e.defaultOptions,...t}).keyframeOptions={...e.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??(t.properties=as),this.options=t}p(){const t={},e=this.element.getBoundingClientRect(),s=getComputedStyle(this.element);return this.options.properties.forEach((i=>{const r=e[i]??(os[i]?void 0:s[i]),o=Number(r);t[i]=isNaN(o)?r+"":o})),t}m(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((t,e)=>{if(Array.isArray(t)){if(Array.isArray(e)&&e.length===t.length&&t.every(((t,s)=>t===e[s])))return!1}else if(e===t)return!1;return!0})(t,this.v)),this.o=this.l.hasUpdated&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.o&&(this.v=Array.isArray(t)?Array.from(t):t),this.o}hostUpdate(){"function"==typeof this.optionsOrCallback&&this.u(this.optionsOrCallback()),this.m()&&(this.g=this.p(),this.t=this.t??this.element.parentNode,this.i=this.element.nextSibling)}async hostUpdated(){if(!this.o||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await ts;const e=this._(),s=this.A(this.options.keyframeOptions,e),i=this.p();if(void 0!==this.g){const{from:s,to:r}=this.O(this.g,i,e);this.log("measured",[this.g,i,s,r]),t=this.calculateKeyframes(s,r)}else{const s=Je.get(this.options.inId);if(s){Je.delete(this.options.inId);const{from:r,to:o}=this.O(s,i,e);t=this.calculateKeyframes(r,o),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,Qe++,t.forEach((t=>t.zIndex=Qe))}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,s)}resetStyles(){void 0!==this.j&&(this.element.setAttribute("style",this.j??""),this.j=void 0)}commitStyles(){var t,e;this.j=this.element.getAttribute("style"),null==(t=this.webAnimation)||t.commitStyles(),null==(e=this.webAnimation)||e.cancel()}reconnected(){}async disconnected(){var t;if(!this.o)return;if(void 0!==this.options.id&&Je.set(this.options.id,this.g),void 0===this.options.out)return;if(this.prepare(),await ts(),null==(t=this.t)?void 0:t.isConnected){const t=this.i&&this.i.parentNode===this.t?this.i:null;if(this.t.insertBefore(this.element,t),this.options.stabilizeOut){const t=this.p();this.log("stabilizing out");const e=this.g.left-t.left,s=this.g.top-t.top;!("static"===getComputedStyle(this.element).position)||0===e&&0===s||(this.element.style.position="relative"),0!==e&&(this.element.style.left=e+"px"),0!==s&&(this.element.style.top=s+"px")}}const e=this.A(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){var t,e;null==(e=(t=this.options).onStart)||e.call(t,this)}didFinish(t){var e,s;t&&(null==(s=(e=this.options).onComplete)||s.call(e,this)),this.g=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}_(){const t=[];for(let e=this.element.parentNode;e;e=null==e?void 0:e.parentNode){const s=ls.get(e);s&&!s.isDisabled()&&s&&t.push(s)}return t}get isHostRendered(){const t=Xe.has(this.l);return t||this.l.updateComplete.then((()=>{Xe.add(this.l)})),t}A(t,e=this._()){const s={...ns};return e.forEach((t=>Object.assign(s,t.options.keyframeOptions))),Object.assign(s,t),s}O(t,e,s){t={...t},e={...e};const i=s.map((t=>t.animatingProperties)).filter((t=>void 0!==t));let r=1,o=1;return void 0!==i&&(i.forEach((t=>{t.width&&(r/=t.width),t.height&&(o/=t.height)})),void 0!==t.left&&void 0!==e.left&&(t.left=r*t.left,e.left=r*e.left),void 0!==t.top&&void 0!==e.top&&(t.top=o*t.top,e.top=o*e.top)),{from:t,to:e}}calculateKeyframes(t,e,s=!1){const i={},r={};let o=!1;const n={};for(const a in e){const s=t[a],l=e[a];if(a in os){const t=os[a];if(void 0===s||void 0===l)continue;const e=t(s,l);void 0!==e.transform&&(n[a]=e.value,o=!0,i.transform=`${i.transform??""} ${e.transform}`,void 0!==e.overrideFrom&&Object.assign(i,e.overrideFrom))}else s!==l&&void 0!==s&&void 0!==l&&(o=!0,i[a]=s,r[a]=l)}return i.transformOrigin=r.transformOrigin=s?"center center":"top left",this.animatingProperties=n,o?[i,r]:void 0}async animate(t,e=this.options.keyframeOptions){this.start(),this.frames=t;let s=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),void 0!==t)){this.log("animate",[t,e]),s=!0,this.webAnimation=this.element.animate(t,e);const r=this.getController();null==r||r.add(this);try{await this.webAnimation.finished}catch(i){}null==r||r.remove(this)}return this.didFinish(s),s}isAnimating(){var t,e;return"running"===(null==(t=this.webAnimation)?void 0:t.playState)||(null==(e=this.webAnimation)?void 0:e.pending)}log(t,e){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,e)}}),hs={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">\n<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"/>\n</svg>\n',"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">\n<path d="M7 12.5L10 15.5L17 8.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<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"/>\n</svg>\n',check:'<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5 13L9 17L19 7" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',"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">\n<path d="M12 11.5V16.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 7.51L12.01 7.49889" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<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"/>\n</svg>\n',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">\n <path stroke-linecap="round" stroke-linejoin="round" d="M18 12H6" />\n</svg>\n',"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">\n<path d="M18 12.5C18.2761 12.5 18.5 12.2761 18.5 12C18.5 11.7239 18.2761 11.5 18 11.5C17.7239 11.5 17.5 11.7239 17.5 12C17.5 12.2761 17.7239 12.5 18 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M6 12.5C6.27614 12.5 6.5 12.2761 6.5 12C6.5 11.7239 6.27614 11.5 6 11.5C5.72386 11.5 5.5 11.7239 5.5 12C5.5 12.2761 5.72386 12.5 6 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',"more-vert":'<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M12 12.5C12.2761 12.5 12.5 12.2761 12.5 12C12.5 11.7239 12.2761 11.5 12 11.5C11.7239 11.5 11.5 11.7239 11.5 12C11.5 12.2761 11.7239 12.5 12 12.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 18.5C12.2761 18.5 12.5 18.2761 12.5 18C12.5 17.7239 12.2761 17.5 12 17.5C11.7239 17.5 11.5 17.7239 11.5 18C11.5 18.2761 11.7239 18.5 12 18.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 6.5C12.2761 6.5 12.5 6.27614 12.5 6C12.5 5.72386 12.2761 5.5 12 5.5C11.7239 5.5 11.5 5.72386 11.5 6C11.5 6.27614 11.7239 6.5 12 6.5Z" fill="currentColor" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',"nav-arrow-down":'<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6 9L12 15L18 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n',"warning-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">\n<path d="M12 7L12 13" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M12 17.01L12.01 16.9989" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>\n<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"/>\n</svg>\n'}},ds=new Map,ps={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:""}};let us=!1;const gs=sessionStorage.getItem("sonicIconsCache"),bs=gs?JSON.parse(gs):{icons:{},names:[]};class ms{}ms.default={get:async t=>{const e=t.library;if(!t.name)return"";const s=t.name,i=hs;var r,o;if("custom"==e&&(us||(us=!0,ps.custom.url=(null==(r=document.querySelector("[customIconLibraryPath]"))?void 0:r.getAttribute("customIconLibraryPath"))||"",ps.custom.defaultPrefix=(null==(o=document.querySelector("[customIconDefaultPrefix]"))?void 0:o.getAttribute("customIconDefaultPrefix"))||"")),e&&e in ps){const r=ps[e],o=t.prefix||r.defaultPrefix||"",n=i[e]||{};i[e]=n;const a=o+"-"+s;if(n[a])return te(n[a]);const l=(r.url||"").replace("$prefix",o).replace("$name",s);if(bs.icons[l])return n[a]=bs.icons[l],te(bs.icons[l]);if(!ds.has(l)){const t=new Promise((async t=>{const e=await fetch(l);if(e.ok)try{t(await e.text())}catch(s){t(null)}else t(`<b title="Erreur ${e.status}">😶</b>`)}));ds.set(l,t)}const c=await ds.get(l);if(ds.delete(l),n[a]=c||"",bs.icons[l]=c||"",bs.names.length>100){const t=bs.names.shift();delete bs.icons[t]}return sessionStorage.setItem("sonicIconsCache",JSON.stringify(bs)),te(c)}return te(i.core[t.name]||"")}};var fs=Object.defineProperty,vs=Object.getOwnPropertyDescriptor,ys=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?vs(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&fs(e,s,o),o};let ws=class extends Zt{constructor(){super(...arguments),this.iconText="",this.name="",this.prefix="",this.library=""}async updateIcon(){this.iconText=await ms.default.get({name:this.name,prefix:this.prefix,library:this.library})}willUpdate(t){(t.has("name")||t.has("prefix")||t.has("library"))&&this.updateIcon(),super.willUpdate(t)}render(){return this.iconText?this.iconText:gt}};ws.styles=x`
|
|
622
483
|
:host {
|
|
623
484
|
line-height: 0.1em;
|
|
624
485
|
width: fit-content;
|
|
625
486
|
height: fit-content;
|
|
626
487
|
vertical-align: -0.125em;
|
|
488
|
+
flex-shrink: 0;
|
|
627
489
|
}
|
|
628
490
|
svg {
|
|
629
491
|
height: var(--sc-icon-size, 1em);
|
|
630
|
-
width:
|
|
492
|
+
width: 1.4em;
|
|
631
493
|
overflow: visible;
|
|
632
494
|
}
|
|
633
495
|
|
|
@@ -666,46 +528,42 @@ let ls=class extends Gt{constructor(t){if(super(t),this.et=kt,t.type!==Yt)throw
|
|
|
666
528
|
:host([size="3xl"]) svg {
|
|
667
529
|
--sc-icon-size: 2.8em;
|
|
668
530
|
}
|
|
669
|
-
`,ys([
|
|
531
|
+
`,ys([U()],ws.prototype,"iconText",2),ys([F({type:String})],ws.prototype,"name",2),ys([F({type:String})],ws.prototype,"prefix",2),ys([F({type:String})],ws.prototype,"library",2),ws=ys([b("sonic-icon")],ws);const xs=x`
|
|
670
532
|
.custom-scroll {
|
|
671
533
|
overflow: auto !important;
|
|
672
534
|
overflow-y: overlay !important;
|
|
673
535
|
}
|
|
674
536
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
537
|
+
@media (hover: hover) {
|
|
538
|
+
.custom-scroll::-webkit-scrollbar {
|
|
539
|
+
width: 0.5rem;
|
|
540
|
+
height: 0.5rem;
|
|
541
|
+
border: solid 0.15rem transparent;
|
|
542
|
+
border-radius: var(--sc-rounded);
|
|
543
|
+
background: transparent;
|
|
544
|
+
}
|
|
682
545
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
546
|
+
.custom-scroll::-webkit-scrollbar-thumb {
|
|
547
|
+
box-shadow: inset 0 0 2rem 2rem var(--sc-scrollbar-bg);
|
|
548
|
+
border-radius: var(--sc-rounded);
|
|
549
|
+
border: solid 0.15rem transparent;
|
|
550
|
+
}
|
|
687
551
|
}
|
|
688
|
-
`;var _s=Object.defineProperty,ks=Object.getOwnPropertyDescriptor,As=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ks(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&_s(e,s,o),o};const Ps={warning:"warning-circled-outline",success:"check-circled-outline",error:"warning-circled-outline",info:"info-empty"};let Cs=class extends
|
|
689
|
-
class="sonic-toast
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
${this.status&&xt`<sonic-icon name=${Ps[this.status]} class="sonic-toast-icon" size="2xl"></sonic-icon>`}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
<div class="sonic-toast-text">
|
|
701
|
-
${this.title?xt`<div class="sonic-toast-title">${this.title}</div>`:""}
|
|
702
|
-
${this.text?cs(this.text):""}
|
|
552
|
+
`;var _s=Object.defineProperty,ks=Object.getOwnPropertyDescriptor,As=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ks(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&_s(e,s,o),o};const Ps={warning:"warning-circled-outline",success:"check-circled-outline",error:"warning-circled-outline",info:"info-empty"};let Cs=class extends Zt{constructor(){super(...arguments),this.title="",this.id="",this.text="",this.status="",this.ghost=!1,this.preserve=!1,this.dismissForever=!1,this.maxHeight="10rem",this.visible=!0}render(){if(this.dismissForever){const t=localStorage.getItem("sonic-toast-dismissed")||"{}";if(JSON.parse(t)[this.id])return gt}return this.visible?pt`<div class="sonic-toast ${this.status} ${this.ghost?"ghost":""}">
|
|
553
|
+
<button aria-label="Close" class="sonic-toast-close" @click=${()=>this.hide()}>
|
|
554
|
+
<sonic-icon name="cancel" size="lg"></sonic-icon>
|
|
555
|
+
</button>
|
|
556
|
+
<div class="sonic-toast-content custom-scroll" style="max-height: ${this.maxHeight} ;">
|
|
557
|
+
${this.status&&pt`<sonic-icon name=${Ps[this.status]} class="sonic-toast-icon" size="2xl"></sonic-icon>`}
|
|
558
|
+
|
|
559
|
+
<div class="sonic-toast-text">
|
|
560
|
+
${this.title?pt`<div class="sonic-toast-title">${this.title}</div>`:""} ${this.text?te(this.text):""}
|
|
703
561
|
<slot></slot>
|
|
704
|
-
</div>
|
|
705
|
-
|
|
706
|
-
${this.preserve?"":this.autoHide()}
|
|
707
562
|
</div>
|
|
708
|
-
|
|
563
|
+
|
|
564
|
+
${this.preserve?"":this.autoHide()}
|
|
565
|
+
</div>
|
|
566
|
+
</div>`:gt}hide(){if(this.closest("sonic-toast")||(this.visible=!1),this.dismissForever){const t=localStorage.getItem("sonic-toast-dismissed")||"{}",e=JSON.parse(t);e[this.id]=!0,localStorage.setItem("sonic-toast-dismissed",JSON.stringify(e))}this.dispatchEvent(new CustomEvent("hide",{bubbles:!0}))}show(){this.visible=!0}autoHide(){setTimeout((()=>{this.hide()}),6e3)}};Cs.styles=[xs,x`
|
|
709
567
|
* {
|
|
710
568
|
box-sizing: border-box;
|
|
711
569
|
}
|
|
@@ -732,7 +590,7 @@ let ls=class extends Gt{constructor(t){if(super(t),this.et=kt,t.type!==Yt)throw
|
|
|
732
590
|
.sonic-toast {
|
|
733
591
|
position: relative;
|
|
734
592
|
pointer-events: auto;
|
|
735
|
-
overflow:hidden;
|
|
593
|
+
overflow: hidden;
|
|
736
594
|
line-height: 1.25;
|
|
737
595
|
color: var(--sc-toast-color);
|
|
738
596
|
box-shadow: var(--sc-toast-shadow);
|
|
@@ -745,14 +603,14 @@ let ls=class extends Gt{constructor(t){if(super(t),this.et=kt,t.type!==Yt)throw
|
|
|
745
603
|
display: flex;
|
|
746
604
|
gap: 0.5rem;
|
|
747
605
|
overflow: auto;
|
|
748
|
-
position:relative;
|
|
749
|
-
}
|
|
606
|
+
position: relative;
|
|
607
|
+
}
|
|
750
608
|
|
|
751
609
|
.sonic-toast-text {
|
|
752
610
|
align-self: center;
|
|
753
611
|
margin-top: auto;
|
|
754
612
|
margin-bottom: auto;
|
|
755
|
-
max-width:70ch;
|
|
613
|
+
max-width: 70ch;
|
|
756
614
|
line-height: 1.2;
|
|
757
615
|
}
|
|
758
616
|
|
|
@@ -770,20 +628,19 @@ let ls=class extends Gt{constructor(t){if(super(t),this.et=kt,t.type!==Yt)throw
|
|
|
770
628
|
|
|
771
629
|
::slotted(li),
|
|
772
630
|
.sonic-toast-text li {
|
|
773
|
-
margin-bottom: .15em !important;
|
|
631
|
+
margin-bottom: 0.15em !important;
|
|
774
632
|
}
|
|
775
633
|
|
|
776
|
-
::slotted(
|
|
634
|
+
::slotted(:is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6):last-child),
|
|
777
635
|
.sonic-toast-text > :is(p, ul, ol, hr, h1, h2, h3, h4, h5, h6):last-child {
|
|
778
636
|
margin-bottom: 0 !important;
|
|
779
|
-
}
|
|
780
|
-
|
|
637
|
+
}
|
|
781
638
|
|
|
782
639
|
/*BUTTON CLOSE*/
|
|
783
640
|
.sonic-toast-close {
|
|
784
641
|
all: unset;
|
|
785
642
|
position: absolute;
|
|
786
|
-
z-index:4;
|
|
643
|
+
z-index: 4;
|
|
787
644
|
pointer-events: initial;
|
|
788
645
|
right: 0.5em;
|
|
789
646
|
top: 0.5em;
|
|
@@ -858,68 +715,357 @@ let ls=class extends Gt{constructor(t){if(super(t),this.et=kt,t.type!==Yt)throw
|
|
|
858
715
|
bottom: 0;
|
|
859
716
|
opacity: 0.05;
|
|
860
717
|
pointer-events: none;
|
|
861
|
-
transition: 0.2s;
|
|
862
|
-
border-radius: var(--sc-toast-rounded);
|
|
863
|
-
background-color: var(--sc-toast-status-color);
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
.sonic-toast:hover:before {
|
|
867
|
-
opacity: 0.025;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
.info .sonic-toast-icon,
|
|
871
|
-
.error .sonic-toast-icon,
|
|
872
|
-
.success .sonic-toast-icon,
|
|
873
|
-
.warning .sonic-toast-icon {
|
|
874
|
-
color: var(--sc-toast-status-color, currentColor);
|
|
718
|
+
transition: 0.2s;
|
|
719
|
+
border-radius: var(--sc-toast-rounded);
|
|
720
|
+
background-color: var(--sc-toast-status-color);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
.sonic-toast:hover:before {
|
|
724
|
+
opacity: 0.025;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.info .sonic-toast-icon,
|
|
728
|
+
.error .sonic-toast-icon,
|
|
729
|
+
.success .sonic-toast-icon,
|
|
730
|
+
.warning .sonic-toast-icon {
|
|
731
|
+
color: var(--sc-toast-status-color, currentColor);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.sonic-toast-icon {
|
|
735
|
+
position: sticky;
|
|
736
|
+
top: 0;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.ghost {
|
|
740
|
+
opacity: 0.85;
|
|
741
|
+
pointer-events: none;
|
|
742
|
+
}
|
|
743
|
+
`],As([F({type:String})],Cs.prototype,"title",2),As([F({type:String})],Cs.prototype,"id",2),As([F({type:String})],Cs.prototype,"text",2),As([F({type:String})],Cs.prototype,"status",2),As([F({type:Boolean})],Cs.prototype,"ghost",2),As([F({type:Boolean})],Cs.prototype,"preserve",2),As([F({type:Boolean})],Cs.prototype,"dismissForever",2),As([F({type:String})],Cs.prototype,"maxHeight",2),As([U()],Cs.prototype,"visible",2),Cs=As([b("sonic-toast-item")],Cs);const Ss=x`
|
|
744
|
+
:host {
|
|
745
|
+
/* polices*/
|
|
746
|
+
--sc-font-family-base: "Inter var", "Inter", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
|
|
747
|
+
sans-serif;
|
|
748
|
+
--sc-font-weight-base: 400;
|
|
749
|
+
--sc-font-style-base: normal;
|
|
750
|
+
|
|
751
|
+
--sc-headings-font-family: var(--sc-font-family-base), sans-serif;
|
|
752
|
+
--sc-headings-font-style: var(--sc-font-style-base);
|
|
753
|
+
--sc-headings-line-height: 1.1;
|
|
754
|
+
--sc-headings-font-weight: 700;
|
|
755
|
+
--sc-headings-text-transform: none;
|
|
756
|
+
|
|
757
|
+
/* Button*/
|
|
758
|
+
--sc-btn-font-weight: var(--sc-font-weight-base);
|
|
759
|
+
--sc-btn-font-family: var(--sc-font-family-base);
|
|
760
|
+
--sc-btn-font-style: var(--sc-font-style-base);
|
|
761
|
+
|
|
762
|
+
/* ROUNDED*/
|
|
763
|
+
--sc-rounded-sm: calc(var(--sc-rounded) * 0.5);
|
|
764
|
+
--sc-rounded: 0.375rem;
|
|
765
|
+
--sc-rounded-md: calc(var(--sc-rounded) * 1.8);
|
|
766
|
+
--sc-rounded-lg: calc(var(--sc-rounded) * 3);
|
|
767
|
+
--sc-rounded-xl: calc(var(--sc-rounded) * 7);
|
|
768
|
+
--sc-rounded-size-intensity: calc((1em - 1rem) * 0.4);
|
|
769
|
+
|
|
770
|
+
/* 4 for rounded full*/
|
|
771
|
+
--sc-btn-rounded-intensity: 1.4;
|
|
772
|
+
--sc-btn-font-weight: 500;
|
|
773
|
+
--sc-btn-rounded: calc((var(--sc-rounded) + var(--sc-rounded-size-intensity)) * var(--sc-btn-rounded-intensity));
|
|
774
|
+
|
|
775
|
+
/* Placeholder */
|
|
776
|
+
--sc-placeholder-bg: rgba(17, 24, 39, 0.05);
|
|
777
|
+
|
|
778
|
+
/* OMBRES */
|
|
779
|
+
--sc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
780
|
+
--sc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
781
|
+
--sc-shadow-lg: 0 10px 15px 0px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
782
|
+
--sc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
783
|
+
--sc-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
784
|
+
|
|
785
|
+
/* Forms */
|
|
786
|
+
--sc-border-width: max(1px, 0.12rem);
|
|
787
|
+
--sc-border-color: var(--sc-base-100);
|
|
788
|
+
--sc-form-height: 2.5em;
|
|
789
|
+
--sc-form-border-width: var(--sc-border-width);
|
|
790
|
+
--sc-input-bg: var(--sc-base-100);
|
|
791
|
+
--sc-input-border-color: var(--sc-input-bg);
|
|
792
|
+
--sc-input-rounded-intensity: 1.4;
|
|
793
|
+
--sc-input-rounded: calc((var(--sc-rounded) + var(--sc-rounded-size-intensity)) * var(--sc-input-rounded-intensity));
|
|
794
|
+
--sc-label-font-weight: 500;
|
|
795
|
+
|
|
796
|
+
/* Contrast -- ex : Text on images */
|
|
797
|
+
--sc-contrast-content: #fff;
|
|
798
|
+
--sc-contrast: #11151f;
|
|
799
|
+
|
|
800
|
+
/*Scrollbar*/
|
|
801
|
+
--sc-scrollbar-bg: var(--sc-base-400);
|
|
802
|
+
|
|
803
|
+
/*Body*/
|
|
804
|
+
--sc-body-bg: var(--sc-base);
|
|
805
|
+
}
|
|
806
|
+
`,$s=x`
|
|
807
|
+
:host {
|
|
808
|
+
/*Boutons*/
|
|
809
|
+
--sc-primary: var(--sc-base-800);
|
|
810
|
+
--sc-info: #2563eb;
|
|
811
|
+
--sc-danger: #f43f5e;
|
|
812
|
+
--sc-warning: #f97316;
|
|
813
|
+
--sc-success: #14b8a6;
|
|
814
|
+
|
|
815
|
+
--sc-primary-content: var(--sc-base);
|
|
816
|
+
--sc-info-content: var(--sc-base);
|
|
817
|
+
--sc-danger-content: var(--sc-base);
|
|
818
|
+
--sc-warning-content: var(--sc-base);
|
|
819
|
+
--sc-success-content: var(--sc-base);
|
|
820
|
+
|
|
821
|
+
/*Bases*/
|
|
822
|
+
--sc-base: #fff;
|
|
823
|
+
--sc-base-50: #f8fafc;
|
|
824
|
+
--sc-base-100: #f1f5f9;
|
|
825
|
+
--sc-base-200: #e2e8f0;
|
|
826
|
+
--sc-base-300: #cbd5e1;
|
|
827
|
+
--sc-base-400: #94a3b8;
|
|
828
|
+
--sc-base-500: #64748b;
|
|
829
|
+
--sc-base-600: #475569;
|
|
830
|
+
--sc-base-700: #334155;
|
|
831
|
+
--sc-base-800: #1e293b;
|
|
832
|
+
--sc-base-900: #0f172a;
|
|
833
|
+
--sc-base-content: var(--sc-base-700);
|
|
834
|
+
|
|
835
|
+
/*formulaires*/
|
|
836
|
+
--sc-input-bg: var(--sc-base-100);
|
|
837
|
+
--sc-input-color: var(--sc-base-content);
|
|
838
|
+
}
|
|
839
|
+
`,Os=x`
|
|
840
|
+
--sc-primary: var(--sc-dark-primary, var(--sc-base-700));
|
|
841
|
+
--sc-info: var(--sc-dark-info, #3abff8);
|
|
842
|
+
--sc-danger: var(--sc-dark-danger, #f87272);
|
|
843
|
+
--sc-warning: var(--sc-dark-warning, #fbbd23);
|
|
844
|
+
--sc-success: var(--sc-dark-success, #36d399);
|
|
845
|
+
|
|
846
|
+
--sc-primary-content: var(--sc-dark-primary-content, #002b3d);
|
|
847
|
+
--sc-info-content: var(--sc-dark-info-content, #002b3d);
|
|
848
|
+
--sc-danger-content: var(--sc-dark-danger-content, #382800);
|
|
849
|
+
--sc-warning-content: var(--sc-dark-warning-content, #382800);
|
|
850
|
+
--sc-success-content: var(--sc-dark-success-content, #003320);
|
|
851
|
+
|
|
852
|
+
--sc-base: var(--sc-dark-base, #1d2634);
|
|
853
|
+
--sc-base-50: var(--sc-dark-base-50, #1f2937);
|
|
854
|
+
--sc-base-100: var(--sc-dark-base-100, #252c36);
|
|
855
|
+
--sc-base-200: var(--sc-dark-base-200, #2c3543);
|
|
856
|
+
--sc-base-300: var(--sc-dark-base-300, #38414e);
|
|
857
|
+
--sc-base-400: var(--sc-dark-base-400, #515964);
|
|
858
|
+
--sc-base-500: var(--sc-dark-base-500, #828891);
|
|
859
|
+
--sc-base-600: var(--sc-dark-base-600, #b4b8be);
|
|
860
|
+
--sc-base-700: var(--sc-dark-base-700, #cdd0d5);
|
|
861
|
+
--sc-base-800: var(--sc-dark-base-800, #d9dce0);
|
|
862
|
+
--sc-base-900: var(--sc-dark-base-900, #e5e7eb);
|
|
863
|
+
--sc-base-content: var(--sc-dark-base-content, #e5e7eb);
|
|
864
|
+
`,Ds=x`
|
|
865
|
+
:host([theme="dark"]) {
|
|
866
|
+
${Os}
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
@media (prefers-color-scheme: dark) {
|
|
870
|
+
:host([theme="auto"]) {
|
|
871
|
+
${Os}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
`;var Ls=Object.defineProperty,Es=Object.getOwnPropertyDescriptor,js=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Es(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ls(e,s,o),o};let Ms=class extends Zt{constructor(){super(),this.theme="light",this.background=!1,this.color=!1,this.font=!1,Ms.instance=this}static getPopContainer(){return Ms.instance||document.body}connectedCallback(){super.connectedCallback(),window.addEventListener("message",(t=>this.receiveMessage(t)),!1),window.dispatchEvent(new CustomEvent("SonicThemeReady")),this.postCSSVars()}postCSSVars(){var t;const e=document.styleSheets,s=e.length,i=[];for(let o=0;o<s;o++){const t=e[o];t.href&&(t.href.includes("googleapis")||t.href.includes("typekit.net"))&&i.push(t.href)}const r={variables:this.getCssVariables(),fonts:i};null==(t=Te.get("sonic-theme"))||t.set(r),document.querySelectorAll("iframe").forEach((t=>{var e;return null==(e=t.contentWindow)?void 0:e.postMessage({type:"SonicTheme",...r},"*")}))}receiveMessage(t){const e=t.data;e.type&&"GetSonicTheme"==e.type&&this.postCSSVars()}getCssVariables(){const t=[],e=[...Ms.styles.map((t=>t.styleSheet)),...Array.from(document.styleSheets)];for(const o of e)try{if(!o)continue;const e=o.cssRules;for(const s of e){if(!("style"in s))continue;const e=s.style;for(const s of e)t.includes(s)||0!==s.indexOf("--sc")||t.push(s)}}catch(r){console.log("Erreur lors de la récupération des variables CSS")}const s=window.getComputedStyle(this),i={};return t.forEach((t=>i[t]=s.getPropertyValue(t))),i}render(){return pt`<slot></slot>`}};Ms.styles=[$s,Ds,Ss,x`
|
|
875
|
+
:host([color]) {
|
|
876
|
+
color: var(--sc-base-content);
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
:host([font]) {
|
|
880
|
+
font-family: var(--sc-font-family-base), sans-serif;
|
|
881
|
+
font-weight: var(--sc-font-weight-base);
|
|
882
|
+
font-style: var(--sc-font-style-base);
|
|
883
|
+
}
|
|
884
|
+
`],js([F({type:String,reflect:!0})],Ms.prototype,"theme",2),js([F({type:Boolean,reflect:!0})],Ms.prototype,"background",2),js([F({type:Boolean,reflect:!0})],Ms.prototype,"color",2),js([F({type:Boolean,reflect:!0})],Ms.prototype,"font",2),Ms=js([b("sonic-theme")],Ms);var Is=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,Ns=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ts(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Is(e,s,o),o};let zs=class extends Zt{constructor(){super(...arguments),this.toasts=[]}createRenderRoot(){return this}render(){const t=!(window.parent==window);let e={pointerEvents:"none",gap:"1rem",display:"flex",margin:"1rem"};return t||(e={...e,margin:"0",width:"calc(100% - 2.5rem)",position:"fixed",bottom:"1.25rem",right:"1.25rem",zIndex:"10000",maxWidth:"64ch",flexDirection:"column-reverse"}),zs.handleExistingToastDelegation(),this.toasts?pt`<div aria-live="polite" style=${_e(e)}>
|
|
885
|
+
${Ye(this.toasts,(t=>t.id),(e=>pt`
|
|
886
|
+
<sonic-toast-item
|
|
887
|
+
maxHeight=${t?"none":"10rem"}
|
|
888
|
+
status=${Ve(e.status)}
|
|
889
|
+
title=${Ve(e.title)}
|
|
890
|
+
?ghost=${e.ghost}
|
|
891
|
+
?dismissForever=${e.dismissForever}
|
|
892
|
+
?preserve=${e.preserve}
|
|
893
|
+
id=${Ve(e.id)}
|
|
894
|
+
@hide=${()=>this.removeItem(e)}
|
|
895
|
+
${cs({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})}
|
|
896
|
+
>
|
|
897
|
+
<!-- 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) -->
|
|
898
|
+
${e.text?te(e.text):""}
|
|
899
|
+
</sonic-toast-item>
|
|
900
|
+
`))}
|
|
901
|
+
</div>`:gt}static removeAll(){if(zs.delegateToasts)return zs.handleExistingToastDelegation(),void window.parent.postMessage({type:"removeAllToasts"},"*");const t=zs.getInstance();t&&(t.toasts=t.toasts.filter((t=>t.ghost)))}static getInstance(){return zs.instance||(zs.instance=document.createElement("sonic-toast"),Ms.getPopContainer().prepend(zs.instance)),zs.instance}static add(t){if(zs.delegateToasts)return zs.handleExistingToastDelegation(),void window.parent.postMessage({type:"addToast",toast:t},"*");const e=zs.getInstance(),s=t.id??(new Date).valueOf(),i=new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>").test(t.text),r={id:s,text:t.text,title:t.title,status:t.status,preserve:!!i||t.preserve,ghost:t.ghost,dismissForever:t.dismissForever};if(t.dismissForever&&t.id){const e=localStorage.getItem("sonic-toast-dismissed")||"{}";if(JSON.parse(e)[t.id])return null}if(null==e?void 0:e.toasts.length){const t={...r};for(const s of e.toasts){const e={...s};if(t.id=e.id=0,
|
|
902
|
+
/*!currentToast.preserve && */
|
|
903
|
+
g.shallowEqual(t,e))return null}}return e&&(e.toasts=[...e.toasts,r]),r}static handleExistingToastDelegation(){if(!this.delegateToasts)return;const t=zs.getInstance();window.parent.postMessage({type:"addToasts",toasts:t.toasts},"*"),t.toasts=[]}static removeItem(t){if(zs.delegateToasts)return zs.handleExistingToastDelegation(),void window.parent.postMessage({type:"removeToast",toast:t},"*");const e=zs.getInstance();e&&e.removeItem(t)}removeItem(t){t&&(this.toasts=this.toasts.filter((e=>(delete(e={...e}).id,!g.shallowEqual(e,t,!1)))))}};zs.delegateToasts=!1,Ns([F({type:Array})],zs.prototype,"toasts",2),zs=Ns([b("sonic-toast")],zs),"undefined"!=typeof window&&(window.SonicToast=zs),function(){var t;const e=!(window.parent==window);if(window.addEventListener("message",(t=>{"querySonicToastAvailability"==t.data.type&&t.source.postMessage({type:"sonicToastAvailable"},"*"),"sonicToastAvailable"==t.data.type&&(zs.delegateToasts=!0,zs.handleExistingToastDelegation()),"addToasts"==t.data.type&&(zs.getInstance().toasts=[...zs.getInstance().toasts,...t.data.toasts]),"removeAllToasts"==t.data.type&&zs.removeAll(),"removeToast"==t.data.type&&zs.removeItem(t.data.toast),"addToast"==t.data.type&&zs.add(t.data.toast)}),!1),e&&window.parent.postMessage({type:"querySonicToastAvailability"},"*"),!e)for(const s of document.querySelectorAll("iframe"))null==(t=s.contentWindow)||t.postMessage({type:"sonicToastAvailable"},"*")}();var Rs=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,Us=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Fs(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Rs(e,s,o),o};const Vs=new Set,Bs=new Set,Hs=(t,e)=>{class s extends t{constructor(...t){super(),this.api=null,this.key="",this.isFirstLoad=!0,this.isLoading=!1,this.iObserver=null,this.isFetchEnabled=!0,this.fetchedData=null,this._endPoint="",this.requestId=0,this.refetchEveryMs=0,this.dataProvider=""}get props(){return super.props}set props(t){super.props=t}set endPoint(t){this._endPoint=t,this.isConnected&&this._fetchData()}get endPoint(){return this._endPoint}async _fetchData(){if(this.requestUpdate(),!this.isFetchEnabled)return;if(this.api=new Jt(this.getApiConfiguration()),!this.api)return;if(this.dispatchEvent(new CustomEvent("loading",{detail:this})),"enabled"===this.getAttribute("localStorage")&&await Te.getInstance().isLocalStrorageReady,!this.isConnected)return;const t=Te.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();this.isLoading=!0,g.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}));let e=await this.api.get(this.endPoint||this.dataProvider||"",t);if(this.fetchedData=e,this.api.lastResult&&!this.api.lastResult.ok&&(Vs.add(this),(t=>{for(const e of Bs)e(t)})(this.api.lastResult)),this.isConnected){if(!e)return this.isLoading=!1,void(this.refetchEveryMs&&this.isConnected&&(this.refetchTimeOutId=setTimeout((()=>this._fetchData()),this.refetchEveryMs)));if(e._sonic_http_response_&&!e._sonic_http_response_.ok&&1===Object.keys(e).length&&zs.add({text:"Network Error",status:"error"}),this.key){const t=e._sonic_http_response_,s=this.key.split(".");e=g.traverse(e,s,this.hasAttribute("preserveOtherKeys")),e&&g.isObject(e)&&t&&(e._sonic_http_response_=t)}this.props=e,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(){var t;super.disconnectedCallback(),null==(t=this.publisher)||t.offInvalidate(this.onInvalidate),clearTimeout(this.refetchTimeOutId),this.isFirstLoad=!1}connectedCallback(){var t;this.lazyLoad=void 0!==this.lazyLoad?this.lazyLoad:this.hasAttribute("lazyload"),super.connectedCallback(),this.isFetchEnabled&&(this.key=""!=this.key?this.key:this.getAttribute("key"),this.props&&this.publisher.set(this.props),this.onInvalidate=()=>this._fetchData(),null==(t=this.publisher)||t.onInvalidate(this.onInvalidate),this.lazyLoad?this.handleLazyLoad():this._fetchData())}handleLazyLoad(){if(!this.lazyLoad)return;const t=this.getBoundingClientRect();if(t.x<window.innerWidth&&t.right>0&&t.y<window.innerHeight&&t.right>0)return void this._fetchData();const e=parseFloat(this.getAttribute("lazyBoundsRatio")||"1"),s={root:null,rootMargin:Math.max(window.innerWidth*e,window.innerHeight*e)+"px",threshold:.9};this.iObserver=new IntersectionObserver((t=>this.onIntersection(t)),s);let i=this.shadowRoot?this.shadowRoot.children[0]:this.children[0];if("slot"==(null==i?void 0:i.nodeName.toLocaleLowerCase())&&(i=i.children[0]),!i||"template"==i.nodeName.toLocaleLowerCase()){i=document.createElement("span");i.style.pointerEvents="none",this.lazyLoadSpan=i,this.appendChild(i)}i?this.iObserver.observe(i):this.isFirstLoad&&this._fetchData()}onIntersection(t){var e,s;for(const i of t)if(i.isIntersecting&&this.isFirstLoad){this._fetchData(),null==(e=this.lazyLoadSpan)||e.remove(),this.lazyLoadSpan=void 0,null==(s=this.iObserver)||s.disconnect();break}}}return Us([F()],s.prototype,"props",1),Us([F({type:String})],s.prototype,"endPoint",1),Us([F()],s.prototype,"requestId",2),Us([F({type:Number})],s.prototype,"refetchEveryMs",2),s};var qs=Object.defineProperty,Ws=Object.getOwnPropertyDescriptor,Ks=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ws(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&qs(e,s,o),o};const Zs=t=>{class e extends t{constructor(...t){super(),this.forceAutoFill=!1,this._type="text",this.status="default"}validateFormElement(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("input");if(!e||e.checkValidity())return;const s=this.getFormPublisher();s&&(s.isFormValid=!1),e.reportValidity()}set type(t){this.hasAttribute("type")&&!this.forceAutoFill&&(t=this.getAttribute("type")),this._type=t,this.requestUpdate()}get type(){return this._type}get description(){return this._description}set description(t){this.hasAttribute("description")&&!this.forceAutoFill&&(t=this.getAttribute("description")),this._description=t,this.requestUpdate()}get label(){return this._label}set label(t){this.hasAttribute("label")&&!this.forceAutoFill&&(t=this.getAttribute("label")),this._label=t,this.requestUpdate()}}return Ks([F()],e.prototype,"forceAutoFill",2),Ks([F({type:String})],e.prototype,"type",1),Ks([F()],e.prototype,"description",1),Ks([F()],e.prototype,"label",1),Ks([F({type:String,reflect:!0})],e.prototype,"status",2),Ks([F({type:Number})],e.prototype,"tabindex",2),Ks([F({type:String})],e.prototype,"autocomplete",2),e},Ys=Hs,Gs=Ue,Qs=Se,Js=Zs,Xs=he,ti=ue;window["concorde-mixins"]=window["concorde-mixins"]||{},window["concorde-mixins"]={Fetcher:Ys,FormCheckable:Gs,FormElement:Qs,FormInput:Js,Subscriber:Xs,TemplatesContainer:ti};
|
|
904
|
+
/**
|
|
905
|
+
* @license
|
|
906
|
+
* Copyright 2020 Google LLC
|
|
907
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
908
|
+
*/
|
|
909
|
+
const ei=Rt(class extends Ft{constructor(t){if(super(t),t.type!==zt)throw Error("templateContent can only be used in child bindings")}render(t){return this.ft===t?ut:(this.ft=t,document.importNode(t.content,!0))}});var si=Object.defineProperty,ii=Object.getOwnPropertyDescriptor,ri=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ii(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&si(e,s,o),o};let oi=class extends(Hs(he(ti(Zt)))){renderLoader(){if(!this.isLoading||void 0===this.loader)return gt;const t=!0===this.loader||""===this.loader?"fixed":this.loader;return pt`<sonic-loader mode=${t}></sonic-loader>`}renderSkeleton(){const t=this.templateParts.skeleton;return this.isLoading&&t?ei(t):gt}render(){return pt` ${this.renderSkeleton()} ${this.renderLoader()} ${this.isLoading?gt:pt`<slot></slot>`} `}};oi.styles=[x`
|
|
910
|
+
:host {
|
|
911
|
+
display: contents;
|
|
912
|
+
}
|
|
913
|
+
`],ri([F()],oi.prototype,"loader",2),oi=ri([b("sonic-fetch")],oi);var ni=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,li=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ai(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ni(e,s,o),o};let ci=class extends Zt{constructor(){super(...arguments),this.condition=!1}render(){return this.condition?pt` <slot></slot> `:gt}};ci.styles=x`
|
|
914
|
+
:host {
|
|
915
|
+
display: contents;
|
|
916
|
+
}
|
|
917
|
+
`,li([F({type:Boolean})],ci.prototype,"condition",2),ci=li([b("sonic-if")],ci);const hi=x`
|
|
918
|
+
:host([align="left"]) .sonic-loader--inline {
|
|
919
|
+
margin-left: 0;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
:host([align="right"]) .sonic-loader--inline {
|
|
923
|
+
margin-left: auto;
|
|
924
|
+
margin-right: 0;
|
|
925
|
+
}
|
|
926
|
+
.sonic-loader--inline {
|
|
927
|
+
display: block;
|
|
928
|
+
position: relative;
|
|
929
|
+
width: 80px;
|
|
930
|
+
height: 24px;
|
|
931
|
+
margin: auto;
|
|
932
|
+
z-index: 20;
|
|
933
|
+
}
|
|
934
|
+
.sonic-loader--inline div {
|
|
935
|
+
position: absolute;
|
|
936
|
+
top: 5px;
|
|
937
|
+
width: 13px;
|
|
938
|
+
height: 13px;
|
|
939
|
+
border-radius: 50%;
|
|
940
|
+
background: var(--sc-loader-bg);
|
|
941
|
+
animation-timing-function: cubic-bezier(0, 1, 1, 0);
|
|
942
|
+
}
|
|
943
|
+
.sonic-loader--inline div:nth-child(1) {
|
|
944
|
+
left: 8px;
|
|
945
|
+
animation: lds-ellipsis1 0.6s infinite;
|
|
946
|
+
}
|
|
947
|
+
.sonic-loader--inline div:nth-child(2) {
|
|
948
|
+
left: 8px;
|
|
949
|
+
animation: lds-ellipsis2 0.6s infinite;
|
|
950
|
+
}
|
|
951
|
+
.sonic-loader--inline div:nth-child(3) {
|
|
952
|
+
left: 32px;
|
|
953
|
+
animation: lds-ellipsis2 0.6s infinite;
|
|
954
|
+
}
|
|
955
|
+
.sonic-loader--inline div:nth-child(4) {
|
|
956
|
+
left: 56px;
|
|
957
|
+
animation: lds-ellipsis3 0.6s infinite;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
@keyframes lds-ellipsis1 {
|
|
961
|
+
0% {
|
|
962
|
+
transform: scale(0);
|
|
963
|
+
}
|
|
964
|
+
100% {
|
|
965
|
+
transform: scale(1);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
@keyframes lds-ellipsis3 {
|
|
969
|
+
0% {
|
|
970
|
+
transform: scale(1);
|
|
971
|
+
}
|
|
972
|
+
100% {
|
|
973
|
+
transform: scale(0);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
@keyframes lds-ellipsis2 {
|
|
977
|
+
0% {
|
|
978
|
+
transform: translate(0, 0);
|
|
979
|
+
}
|
|
980
|
+
100% {
|
|
981
|
+
transform: translate(24px, 0);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
`,di=x`
|
|
985
|
+
|
|
986
|
+
@keyframes sonic-loader--fixed {
|
|
987
|
+
0% {
|
|
988
|
+
transform: scale(0);
|
|
989
|
+
opacity: 0;
|
|
990
|
+
}
|
|
991
|
+
5% {
|
|
992
|
+
opacity: 1;
|
|
993
|
+
}
|
|
994
|
+
70% {
|
|
995
|
+
opacity:90%;
|
|
996
|
+
}
|
|
997
|
+
100% {
|
|
998
|
+
transform: scale(1);
|
|
999
|
+
opacity: 0;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
.sonic-loader--fixed {
|
|
1004
|
+
position: fixed;
|
|
1005
|
+
top:50%;
|
|
1006
|
+
left:50%;
|
|
1007
|
+
transform:transateY(-50%) translateX(-50%);
|
|
1008
|
+
z-index:999;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.sonic-loader--fixed > div:nth-child(2) {
|
|
1012
|
+
animation-delay: -0.5s;
|
|
1013
|
+
}
|
|
1014
|
+
.sonic-loader--fixed > div:nth-child(3) {
|
|
1015
|
+
animation-delay: -0.2s;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.sonic-loader--fixed > div:nth-child(4) {
|
|
1019
|
+
display:none !important;
|
|
1020
|
+
}
|
|
1021
|
+
.sonic-loader--fixed > div {
|
|
1022
|
+
background-color: var(--sc-loader-bg);
|
|
1023
|
+
width: 5rem;
|
|
1024
|
+
height: 5rem;
|
|
1025
|
+
border-radius: 100%;
|
|
1026
|
+
margin: 2px;
|
|
1027
|
+
animation-fill-mode: both;
|
|
1028
|
+
position: absolute;
|
|
1029
|
+
top: 0px;
|
|
1030
|
+
opacity: 0;
|
|
1031
|
+
margin: 0;
|
|
1032
|
+
top: -2.5rem;
|
|
1033
|
+
left: -2.5rem;
|
|
1034
|
+
width: 5rem;
|
|
1035
|
+
height: 5rem;
|
|
1036
|
+
animation: sonic-loader--fixed 1s 0s linear infinite;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
`;var pi=Object.defineProperty,ui=Object.getOwnPropertyDescriptor,gi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ui(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&pi(e,s,o),o};let bi=class extends Zt{constructor(){super(...arguments),this.mode="fixed",this.noDelay=!1}static show(t){bi.loader||(bi.loader=document.createElement("sonic-loader"));const e=bi.loader;t||(t={}),t.mode&&e.setAttribute("mode",t.mode),t.noDelay&&e.setAttribute("noDelay",""),t.container||(t.container=Ms.getPopContainer(),t.mode="fixed"),t.container.appendChild(e),bi.callCounter++}static hide(){bi.callCounter--,bi.callCounter>0||bi.loader&&bi.loader.remove()}render(){return pt`<div class="sonic-loader sonic-loader--${this.mode} ${this.noDelay?"sonic-loader--nodelay":""} ">
|
|
1040
|
+
<div></div>
|
|
1041
|
+
<div></div>
|
|
1042
|
+
<div></div>
|
|
1043
|
+
<div></div>
|
|
1044
|
+
</div>`}};bi.styles=[hi,di,x`
|
|
1045
|
+
:host {
|
|
1046
|
+
--sc-loader-bg: var(--sc-primary, currentColor);
|
|
1047
|
+
pointer-events: none;
|
|
875
1048
|
}
|
|
876
1049
|
|
|
877
|
-
.sonic-
|
|
878
|
-
|
|
879
|
-
|
|
1050
|
+
.sonic-loader {
|
|
1051
|
+
opacity: 0;
|
|
1052
|
+
animation: showLoader 0.5s 0.5s forwards;
|
|
880
1053
|
}
|
|
881
|
-
|
|
882
|
-
.
|
|
883
|
-
|
|
884
|
-
pointer-events: none;
|
|
1054
|
+
.sonic-loader--inline,
|
|
1055
|
+
.sonic-loader--nodelay {
|
|
1056
|
+
animation-delay: 0s;
|
|
885
1057
|
}
|
|
886
1058
|
|
|
887
|
-
|
|
1059
|
+
@keyframes showLoader {
|
|
1060
|
+
0% {
|
|
1061
|
+
opacity: 0;
|
|
1062
|
+
}
|
|
888
1063
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
maxHeight=${t?"none":"10rem"}
|
|
893
|
-
status=${we(e.status)}
|
|
894
|
-
title=${we(e.title)}
|
|
895
|
-
?ghost=${e.ghost}
|
|
896
|
-
?dismissForever=${e.dismissForever}
|
|
897
|
-
?preserve=${e.preserve}
|
|
898
|
-
id=${we(e.id)}
|
|
899
|
-
@hide=${()=>this.removeItem(e)}
|
|
900
|
-
${ns({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})}
|
|
901
|
-
>
|
|
902
|
-
<!-- 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) -->
|
|
903
|
-
${e.text?cs(e.text):""}
|
|
904
|
-
</sonic-toast-item>
|
|
905
|
-
`))}
|
|
906
|
-
</div>`:kt}static removeAll(){const t=document.querySelector("sonic-toast");t&&(t.toasts=t.toasts.filter((t=>t.ghost)))}static add(t){if(!document.querySelector("sonic-toast")){const t=document.createElement("sonic-toast");(document.querySelector("sonic-theme")||document.body).prepend(t)}const e=document.querySelector("sonic-toast"),s=t.id??(new Date).valueOf(),r=new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>").test(t.text),o={id:s,text:t.text,title:t.title,status:t.status,preserve:!!r||t.preserve,ghost:t.ghost,dismissForever:t.dismissForever};if(t.dismissForever&&t.id){const e=localStorage.getItem("sonic-toast-dismissed")||"{}";if(JSON.parse(e)[t.id])return null}if(e.toasts.length>0){const t={...o};for(const s of e.toasts){const e={...s};if(t.id=e.id=0,
|
|
907
|
-
/*!currentToast.preserve && */
|
|
908
|
-
i.shallowEqual(t,e))return null}}return e.toasts=[...e.toasts,o],o}static removeItem(t){const e=document.querySelector("sonic-toast");e&&e.removeItem(t)}removeItem(t){t&&(this.toasts=this.toasts.filter((e=>(delete(e={...e}).id,!i.shallowEqual(e,t,!1)))))}};Os([U({type:Array})],Ds.prototype,"toasts",2),Ds=Os([m("sonic-toast")],Ds),"undefined"!=typeof window&&(window.SonicToast=Ds);var Ls=Object.defineProperty,Es=Object.getOwnPropertyDescriptor,js=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Es(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ls(e,s,o),o};const Ms=(t,e)=>{class s extends t{constructor(...t){super(),this.api=null,this.key="",this.isFirstLoad=!0,this.isLoading=!1,this.iObserver=null,this.isDefaultLoaderEnabled=!0,this.isFetchEnabled=!0,this._endPoint="",this.requestId=0,this.refetchEveryMs=0,this.dataProvider=""}get props(){return super.props}set props(t){super.props=t}set endPoint(t){this._endPoint=t,this.isConnected&&this._fetchData()}get endPoint(){return this._endPoint}async _fetchData(){if(!this.isFetchEnabled)return;if(this.api=new o(this.getApiConfiguration()),!this.api)return;if(this.dispatchEvent(new CustomEvent("loading",{detail:this})),"enabled"===this.getAttribute("localStorage")&&await ge.getInstance().isLocalStrorageReady,!this.isConnected)return;const t=this.isDefaultLoaderEnabled&&!this.noLoader;t&&Le.show();const e=ge.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();this.isLoading=!0,i.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}));let s=await this.api.get(this.endPoint||this.dataProvider||"",e);if(this.isConnected){if(!s)return Ds.add({text:"Network Error",status:"error"}),this.isLoading=!1,void(t&&Le.hide());if(s._sonic_http_response_&&!s._sonic_http_response_.ok&&1===Object.keys(s).length&&Ds.add({text:"Network Error",status:"error"}),t&&Le.hide(),this.key){const t=s._sonic_http_response_;s=i.traverse(s,this.key.split("."),this.hasAttribute("preserveOtherKeys")),s&&i.isObject(s)&&t&&(s._sonic_http_response_=t)}this.props=s,this.dispatchEvent(new CustomEvent("load",{detail:this})),this.isFirstLoad=!1,this.isLoading=!1,this.refetchEveryMs&&this.isConnected&&(this.refetchTimeOutId=setTimeout((()=>this._fetchData()),this.refetchEveryMs))}else t&&Le.hide()}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.publisher)||t.offInvalidate(this.onInvalidate),clearTimeout(this.refetchTimeOutId),this.isFirstLoad=!1}connectedCallback(){var t;this.lazyLoad=void 0!==this.lazyLoad?this.lazyLoad:this.hasAttribute("lazyload"),this.noLoader=void 0!==this.noLoader?this.noLoader:this.hasAttribute("noloader"),super.connectedCallback(),this.isFetchEnabled&&(this.key=this.getAttribute("key"),this.props&&this.publisher.set(this.props),this.onInvalidate=()=>this._fetchData(),null==(t=this.publisher)||t.onInvalidate(this.onInvalidate),this.lazyLoad?this.handleLazyLoad():this._fetchData())}handleLazyLoad(){if(!this.lazyLoad)return;const t=this.getBoundingClientRect();if(t.x<window.innerWidth&&t.right>0&&t.y<window.innerHeight&&t.right>0)return void this._fetchData();const e=parseFloat(this.getAttribute("lazyBoundsRatio")||"1"),s={root:null,rootMargin:Math.max(window.innerWidth*e,window.innerHeight*e)+"px"};this.iObserver=new IntersectionObserver((t=>this.onIntersection(t)),s);let i=this.shadowRoot?this.shadowRoot.children[0]:this.children[0];if("slot"==(null==i?void 0:i.nodeName.toLocaleLowerCase())&&(i=i.children[0]),!i||"template"==i.nodeName.toLocaleLowerCase()){i=document.createElement("span");i.style.pointerEvents="none",this.lazyLoadSpan=i,this.appendChild(i)}i?this.iObserver.observe(i):this.isFirstLoad&&this._fetchData()}onIntersection(t){var e,s;for(const i of t)if(i.isIntersecting&&this.isFirstLoad){this._fetchData(),null==(e=this.lazyLoadSpan)||e.remove(),this.lazyLoadSpan=void 0,null==(s=this.iObserver)||s.disconnect();break}}}return js([U()],s.prototype,"props",1),js([U({type:String})],s.prototype,"endPoint",1),js([U()],s.prototype,"requestId",2),js([U({type:Number})],s.prototype,"refetchEveryMs",2),s};var Ns=Object.defineProperty,zs=Object.getOwnPropertyDescriptor;let Is=class extends(Ms(G(Rt))){render(){return xt`<slot></slot>`}};Is.styles=[_`
|
|
909
|
-
:host {
|
|
910
|
-
display: contents;
|
|
1064
|
+
100% {
|
|
1065
|
+
opacity: 1;
|
|
1066
|
+
}
|
|
911
1067
|
}
|
|
912
|
-
`],
|
|
913
|
-
:host {
|
|
914
|
-
display: contents;
|
|
915
|
-
}
|
|
916
|
-
`,Rs([U({type:Boolean})],Us.prototype,"condition",2),Us=Rs([m("sonic-if")],Us);
|
|
917
|
-
/**
|
|
918
|
-
* @license
|
|
919
|
-
* Copyright 2020 Google LLC
|
|
920
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
921
|
-
*/
|
|
922
|
-
const Vs=Qt(class extends Gt{constructor(t){if(super(t),t.type!==Yt)throw Error("templateContent can only be used in child bindings")}render(t){return this.ft===t?_t:(this.ft=t,document.importNode(t.content,!0))}});var Bs=Object.defineProperty,qs=Object.getOwnPropertyDescriptor;let Hs=class extends(G(Rt)){constructor(){super(...arguments),this.noAutofill=!0}connectedCallback(){this.noShadowDom="",super.connectedCallback()}updated(t){super.updated(t),0==this.children.length?this.style.display="none":this.style.display="contents"}render(){return xt`<slot></slot> `}};Hs=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?qs(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Bs(e,s,o),o})([m("sonic-subscriber")],Hs);var Ws=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,Zs=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ks(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ws(e,s,o),o};let Ys=class extends(Ms(G(tt(Rt)))){constructor(){super(...arguments),this.templateKey="template",this.idKey="id",this.limit=Number.POSITIVE_INFINITY,this.offset=0}connectedCallback(){this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.isDefaultLoaderEnabled=!1,this.isFetchEnabled=this.hasAttribute("fetch"),this.isFetchEnabled&&(this.isLoading=!0),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}renderLoadingState(){return this.templateParts.skeleton?Vs(this.templateParts.skeleton):xt`<sonic-loader mode="inline"></sonic-loader>`}renderNoResultState(){return xt` <div
|
|
1068
|
+
`],bi.callCounter=0,gi([F({type:String})],bi.prototype,"mode",2),gi([F({type:Boolean})],bi.prototype,"noDelay",2),bi=gi([b("sonic-loader")],bi);var mi=Object.defineProperty,fi=Object.getOwnPropertyDescriptor;let vi=class extends(he(Zt)){constructor(){super(...arguments),this.noAutofill=!0}connectedCallback(){this.noShadowDom="",super.connectedCallback()}updated(t){super.updated(t),0==this.children.length?this.style.display="none":this.style.display="contents"}render(){return pt`<slot></slot> `}};vi=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?fi(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&mi(e,s,o),o})([b("sonic-subscriber")],vi);var yi=Object.defineProperty,wi=Object.getOwnPropertyDescriptor,xi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?wi(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&yi(e,s,o),o};let _i=class extends(Hs(he(ue(Zt)))){constructor(){super(...arguments),this.templateKey="template",this.idKey="id",this.limit=Number.POSITIVE_INFINITY,this.offset=0}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(){if(!this.isLoading||void 0===this.loader)return gt;if(this.templateParts.skeleton)return gt;const t=!0===this.loader||""===this.loader?"fixed":this.loader;return pt`<sonic-loader mode=${t}></sonic-loader>`}renderSkeleton(){const t=this.templateParts.skeleton;return this.isLoading&&t?ei(t):gt}renderLoadingState(){return pt`${this.renderSkeleton()} ${this.renderLoader()}`}renderNoResultState(){return pt` <div
|
|
923
1069
|
style="color: var(--sc-base-400);
|
|
924
1070
|
font-size: 1.5em;
|
|
925
1071
|
margin: 4rem 0;
|
|
@@ -928,28 +1074,29 @@ const Vs=Qt(class extends Gt{constructor(t){if(super(t),t.type!==Yt)throw Error(
|
|
|
928
1074
|
>
|
|
929
1075
|
<sonic-icon name="emoji-puzzled" size="lg"></sonic-icon
|
|
930
1076
|
><span class="sonic-no-result-text">${"string"==typeof this.props&&""==this.props?"Aucun résultat":this.props}</span>
|
|
931
|
-
</div>`}formatProps(){let t=this.props;if(null==t)return null;const e=t._sonic_http_response_,s=this.hasAttribute("extractValues");return Array.isArray(t)||(t=s?Object.entries(t).map((([t,e])=>({key:t,value:e}))):
|
|
932
|
-
${null==
|
|
1077
|
+
</div>`}formatProps(){let t=this.props;if(null==t)return null;const e=t._sonic_http_response_,s=this.hasAttribute("extractValues");return Array.isArray(t)||(t=s?Object.entries(t).map((([t,e])=>({key:t,value:e}))):g.isObject(t)&&Object.keys(t).length>0&&(!e||e.ok)?[t]:[]),t=t.filter((t=>null!=t)),e&&(t._sonic_http_response_=e),t}render(){if(this.isLoading&&!Array.isArray(this.props))return this.renderLoadingState();if("string"==typeof this.props)return this.renderNoResultState();if(!g.isObject(this.props))return pt`<div></div>`;const t=this.formatProps();if(0==((null==t?void 0:t.length)||0)&&this.templateParts["no-item"])return ei(this.templateParts["no-item"]);const e=this.templateList.length;let s=-1;const i=this.hasAttribute("extractValues"),r=this.templateParts.separator,o=(null==t?void 0:t.length)||0,n=null==t?void 0:t.slice(this.offset,this.offset+this.limit);return pt`
|
|
1078
|
+
${null==n?void 0:n.map(((t,n)=>{if(null==t)return gt;let a=null,l=n;if("object"==typeof t&&!Array.isArray(t)){const e=t[this.templateKey];e&&"string"==typeof e&&(a=this.templateParts[e]),i&&(l=null==t?void 0:t.key)}if("_sonic_http_response_"==l)return gt;if("string"!=typeof l&&"number"!=typeof l)return gt;const c=n>=o-1,h=n%2,d=this.publisher[l];return d._key_=l+"",d._metadata_={...d._metadata_.get(),key:l,even:0==h,odd:1==h,onlyChild:1==o,firstChild:0==n,lastChild:c},s++,a&&(s=-1),t&&pt`
|
|
933
1079
|
<sonic-subscriber
|
|
934
1080
|
?debug=${!0===this.defferedDebug}
|
|
935
1081
|
.bindPublisher=${function(){return d}}
|
|
936
1082
|
.propertyMap?=${this.itemPropertyMap}
|
|
937
1083
|
dataProvider="${this.dataProvider}/list-item/${l}"
|
|
938
1084
|
>
|
|
939
|
-
${
|
|
1085
|
+
${ei(a||this.templateList[s%e])}
|
|
940
1086
|
</sonic-subscriber>
|
|
941
|
-
${
|
|
1087
|
+
${r&&!c?ei(r):gt}
|
|
942
1088
|
`}))}
|
|
943
|
-
`}};
|
|
1089
|
+
`}};xi([F({type:Object})],_i.prototype,"itemPropertyMap",2),xi([F({type:String})],_i.prototype,"templateKey",2),xi([F({type:String})],_i.prototype,"idKey",2),xi([F()],_i.prototype,"loader",2),xi([F()],_i.prototype,"limit",2),xi([F()],_i.prototype,"offset",2),_i=xi([b("sonic-list")],_i);var ki=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,Pi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ai(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ki(e,s,o),o};let Ci=class extends(he(Zt)){constructor(){super(...arguments),this.templates=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.filteredFields="",this.instanceId=0,this.localStorage="disabled",this.filterPublisher=null,this.filterTimeoutMs=400,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.updateFilteredContent=()=>{var t;const e=this.dataProviderExpression.split("?");e.shift();const s=new URLSearchParams(e.join("?")),i=null==(t=this.filterPublisher)?void 0:t.get(),r=this.filteredFields.split(" ");for(const n in i){let t=i[n];Array.isArray(t)&&(t=t.filter((t=>null!==t))),this.filteredFields&&!r.includes(n)||null==t||""===t.toString()||s.set(n,i[n].toString())}const o=s.toString();if(o!=this.searchHash||this.isFirstRequest){this.searchHash=o;for(const t of this.listDataProviders)l.delete(t);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout((async()=>{const t=this.resultCount;this.props=null,this.requestId++,this.resultCount=t,await l.getInstance().isLocalStrorageReady,window.requestAnimationFrame((()=>this.next()))}),this.isFirstRequest?0:this.filterTimeoutMs),this.isFirstRequest=!1}},this.dataProviderExpression="",this.idKey="id",this.listDataProviders=[],this.nextHadEvent=!1}disconnectedCallback(){var t;for(const e of this.listDataProviders)l.delete(e),this.listDataProviders=[];null==(t=this.filterPublisher)||t.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=Ci.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=Ee.getAncestorAttributeValue(this.parentElement,"dataProvider")||""),super.connectedCallback(),this.publisher.set({}),this.key=this.getAttribute("key"),await l.getInstance().isLocalStrorageReady,this.templates||(this.templates=Array.from(this.querySelectorAll("template"))),this.lastRequestTime=(new Date).getTime(),this.configFilter()}configFilter(){var t;const e=this.getAncestorAttributeValue("dataFilterProvider");e?(this.filterPublisher=l.getInstance().get(e),null==(t=this.filterPublisher)||t.onInternalMutation(this.updateFilteredContent)):this.next()}resetDuration(){this.lastRequestTime=(new Date).getTime()}next(t){var e;let s=this.offset;const i=(new Date).getTime()-this.lastRequestTime;if(!this.nextHadEvent&&t&&(this.publisher.resultCount=0,this.resultCount=0),this.nextHadEvent=!!t,t){if(this.publisher.lastFetchedData=t.detail.fetchedData,t.detail.requestId<this.requestId)return;if(this.resultCount+=t.detail.props.length,!t.detail.isFirstLoad||!t.detail.props.length||-1==this.dataProviderExpression.indexOf("$offset"))return void(this.publisher.resultCount=this.resultCount)}if(Array.isArray(this.props)){const t=this.props,e=t[t.length-1];s=parseInt(e.offset.toString())+parseInt(e.limit.toString())}else{const e=[];e.resultCount=this.resultCount,e.lastFetchedData=(null==t?void 0:t.detail.fetchedData)||{},this.props=e}i>0&&t&&!this.localStorage&&(this.limit=Math.round(this.limit/i*this.targetRequestDuration)),this.limit<1&&(this.limit=1),this.limit>15&&(this.limit=15);let r=this.dataProviderExpression.replace("$offset",s+"").replace("$limit",this.limit+"");const o=r.split("?");let n=o.shift();const a=new URLSearchParams(o.join("?")),l=null==(e=this.filterPublisher)?void 0:e.get(),c=this.filteredFields.split(" ");for(const d in l)this.filteredFields&&c.includes(d)||null==l[d]||""==l[d]||a.set(d,l[d]);this.searchHash||(this.searchHash=a.toString()),n=n+"?"+a.toString(),r=r+"_item_from_queue_"+this.instanceId,this.listDataProviders.push(r);const h=[...this.props,{id:a.toString()+"/"+this.props.length,dataProvider:r,endPoint:n,offset:s,limit:this.limit}];h.resultCount=this.resultCount,h.lastFetchedData=(null==t?void 0:t.detail.fetchedData)||{},this.props=h,this.lastRequestTime=(new Date).getTime()}render(){if(!Array.isArray(this.props))return gt;let t=!this.noLazyload;return 1==this.props.length&&(t=!1),pt`
|
|
944
1090
|
${
|
|
945
1091
|
/**
|
|
946
1092
|
* @license
|
|
947
1093
|
* Copyright 2021 Google LLC
|
|
948
1094
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
949
1095
|
*/
|
|
950
|
-
function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.props,((e,s)=>{var i;const r=0==s?this.templates:null==(i=this.templates)?void 0:i.filter((t=>"no-item"!=t.getAttribute("data-value")));return
|
|
1096
|
+
function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.props,((e,s)=>{var i;const r=0==s?this.templates:null==(i=this.templates)?void 0:i.filter((t=>"no-item"!=t.getAttribute("data-value")));return pt`
|
|
951
1097
|
<sonic-list
|
|
952
1098
|
fetch
|
|
1099
|
+
loader="inline"
|
|
953
1100
|
cache=${this.cache}
|
|
954
1101
|
displayContents
|
|
955
1102
|
lazyBoundsRatio=${this.lazyBoundsRatio}
|
|
@@ -968,190 +1115,33 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
968
1115
|
>
|
|
969
1116
|
</sonic-list>
|
|
970
1117
|
`}))}
|
|
971
|
-
`}};
|
|
1118
|
+
`}};Ci.instanceCounter=0,Pi([F({type:Array})],Ci.prototype,"templates",2),Pi([F({type:Object})],Ci.prototype,"itemPropertyMap",2),Pi([F()],Ci.prototype,"cache",2),Pi([F()],Ci.prototype,"targetRequestDuration",2),Pi([F()],Ci.prototype,"limit",2),Pi([F()],Ci.prototype,"lazyBoundsRatio",2),Pi([F()],Ci.prototype,"offset",2),Pi([F()],Ci.prototype,"resultCount",2),Pi([F({type:Boolean})],Ci.prototype,"noLazyload",2),Pi([F()],Ci.prototype,"filteredFields",2),Pi([F({type:String})],Ci.prototype,"dataProviderExpression",2),Pi([F({type:String})],Ci.prototype,"idKey",2),Ci=Pi([b("sonic-queue")],Ci);var Si=Object.defineProperty,$i=Object.getOwnPropertyDescriptor,Oi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?$i(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Si(e,s,o),o};let Di=class extends(he(Zt)){constructor(){super(...arguments),this.submitResultKey=null,this.disabled=!1,this.endPoint=null,this.name="",this.value="",this.api=null}connectedCallback(){this.hasAttribute("onClick")&&this.addEventListener("click",(()=>this.submit())),this.hasAttribute("onEnterKey")&&this.addEventListener("keydown",(t=>{"Enter"===t.key&&this.submit()})),super.connectedCallback(),this.api=new Jt(this.getApiConfiguration())}submitNativeForm(){const t=Ee.getClosestForm(this);if(!t)return;const e=this.getAncestorAttributeValue("formDataProvider"),s=l.get(e).get();for(const r in s){if("isFormValid"==r)continue;let e=t.querySelector('input[name="'+r+'"], select[name="'+r+'"], textarea[name="'+r+'"]');e||(e=document.createElement("input"),e.type="hidden",e.name=r,t.appendChild(e));let i=s[r];Array.isArray(i)&&(i=i.join(",")),"checkbox"===e.type||"radio"===e.type?i&&(e.checked=!0):e.value=i}const i=document.createElement("input");i.name=this.name,i.style.display="none",i.value=this.value,i.type="submit",t.appendChild(i),i&&i.click()}async submit(){var t;const e=l.getInstance().get(this.getAncestorAttributeValue("formDataProvider"));if(e.isFormValid=!0,e.invalidate(),!e.isFormValid.get())return;this.publisher&&(this.publisher.disabled=!0),e.isFormValid;if(this.hasAttribute("native"))return void this.submitNativeForm();const s=(null==(t=this.getAttribute("method"))?void 0:t.toLocaleLowerCase())||"post",i=this.hasAttribute("sendAsFormData"),r=e.get();delete r.isFormValid;const o=this.getAncestorAttributeValue("headersDataProvider"),n=o?l.getInstance().get(o):null;let a={};n&&(a=n.get());let c=null;const h=this.getAncestorAttributeValue("dataProvider"),d=this.endPoint||h;bi.show();const p=async()=>{var t,e,o,n,h,p,u;if(i)c=await(null==(t=this.api)?void 0:t.submitFormData(d,r,s,a));else switch(s){case"put":c=await(null==(e=this.api)?void 0:e.put(d,r,a));break;case"delete":c=await(null==(o=this.api)?void 0:o.delete(d,r,a));break;case"get":const t=new URLSearchParams;if(r)for(const e in r)t.append(e,r[e]);const s="?"+t.toString();c=await(null==(n=this.api)?void 0:n.get(d+s,a));break;default:c=await(null==(h=this.api)?void 0:h.post(d,r,a))}bi.hide(),c?c._sonic_http_response_&&!c._sonic_http_response_.ok&&1===Object.keys(c).length&&(c.messages=[{content:"Network Error",status:"error"}]):c={messages:[{content:"Network Error",status:"error"}]};const b=this.getAncestorAttributeValue("clearedDataOnSuccess");b&&b.split(" ").forEach((t=>l.get(t).set({})));const m=this.hasAttribute("usernameKey")?this.getAttribute("usernameKey"):"username",f=this.hasAttribute("passwordKey")?this.getAttribute("passwordKey"):"password";(null==(u=null==(p=this.api)?void 0:p.lastResult)?void 0:u.ok)&&r[m]&&r[f]&&this.saveCredentials(r[m],r[f]),this.submitResultKey&&(c=g.traverse(c,this.submitResultKey.split("."),!0));const v=this.getAncestorAttributeValue("submitResultDataProvider");v&&l.get(v).set(c),this.publisher&&(this.publisher.disabled=null)},u=(null==n?void 0:n.needsCaptchaValidation.get())?n:e.needsCaptchaValidation.get()?e:null;if(u){u.captchaMethod=s,u.captchaAction=(null==h?void 0:h.split("?")[0])??this.getAncestorAttributeValue("formDataProvider")??"submit",u.captchaToken="request_token";const t=e=>{"request_token"!=e&&""!=e&&(p(),u.captchaToken.offAssign(t))};u.captchaToken.onAssign(t)}else p()}async saveCredentials(t,e){if("PasswordCredential"in window){const s=new window.PasswordCredential({id:t,password:e});await navigator.credentials.store(s)}}render(){return pt`<div ?data-disabled=${this.disabled}><slot></slot></div>`}};Di.styles=x`
|
|
972
1119
|
[data-disabled] {
|
|
973
1120
|
opacity: 0.3;
|
|
974
1121
|
pointer-events: none;
|
|
975
1122
|
user-select: none;
|
|
976
1123
|
}
|
|
977
|
-
`,si([U({type:String})],ii.prototype,"submitResultKey",2),si([U({type:Boolean})],ii.prototype,"disabled",2),si([U({type:String})],ii.prototype,"endPoint",2),si([U()],ii.prototype,"name",2),si([U()],ii.prototype,"value",2),ii=si([m("sonic-submit")],ii);var ri="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ni,ai,li,ci,hi={exports:{}};ni=hi,ci=[].slice,ai=ri,li=function(){var t,e,s,i,r,o,n,a,l,c,h,d,p,u,g;return l=function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},n=function(t,e){var s,i,r;for(r=[],s=-1,i=t.length;++s<i;)r=r.concat(e(t[s]));return r},u=function(t,e){var s,i,r;for(r="",s=-1,i=t.length;++s<i;)r+=e(t[s]);return r},p=function(t){return new RegExp(t.toString()+"|").exec("").length-1},h=function(t,e){var s,i,r,o,n;for(o={},s=-1,r=t.length;++s<r;)i=t[s],null!=(n=e[s])&&(null!=o[i]?(Array.isArray(o[i])||(o[i]=[o[i]]),o[i].push(n)):o[i]=n);return o},(t={}).Result=function(t,e){this.value=t,this.rest=e},t.Tagged=function(t,e){this.tag=t,this.value=e},t.tag=function(e,s){return function(i){var r,o;if(null!=(r=s(i)))return o=new t.Tagged(e,r.value),new t.Result(o,r.rest)}},t.regex=function(e){return function(s){var i,r;if(null!=(i=e.exec(s)))return r=i[0],new t.Result(r,s.slice(r.length))}},t.sequence=function(){var e;return e=1<=arguments.length?ci.call(arguments,0):[],function(s){var i,r,o,n,a;for(i=-1,r=e.length,a=[],o=s;++i<r;){if(null==(n=(0,e[i])(o)))return;a.push(n.value),o=n.rest}return new t.Result(a,o)}},t.pick=function(){var e,s;return e=arguments[0],s=2<=arguments.length?ci.call(arguments,1):[],function(i){var r,o;if(null!=(o=t.sequence.apply(t,s)(i)))return r=o.value,o.value=r[e],o}},t.string=function(e){var s;return s=e.length,function(i){if(i.slice(0,s)===e)return new t.Result(e,i.slice(s))}},t.lazy=function(t){var e;return e=null,function(s){return null==e&&(e=t()),e(s)}},t.baseMany=function(e,s,i,r,o){var n,a,l;for(a=o,l=i?"":[];(null==s||null==s(a))&&null!=(n=e(a));)i?l+=n.value:l.push(n.value),a=n.rest;if(!r||0!==l.length)return new t.Result(l,a)},t.many1=function(e){return function(s){return t.baseMany(e,null,!1,!0,s)}},t.concatMany1Till=function(e,s){return function(i){return t.baseMany(e,s,!0,!0,i)}},t.firstChoice=function(){var t;return t=1<=arguments.length?ci.call(arguments,0):[],function(e){var s,i,r;for(s=-1,i=t.length;++s<i;)if(null!=(r=(0,t[s])(e)))return r}},d=function(e){var s;return(s={}).wildcard=t.tag("wildcard",t.string(e.wildcardChar)),s.optional=t.tag("optional",t.pick(1,t.string(e.optionalSegmentStartChar),t.lazy((function(){return s.pattern})),t.string(e.optionalSegmentEndChar))),s.name=t.regex(new RegExp("^["+e.segmentNameCharset+"]+")),s.named=t.tag("named",t.pick(1,t.string(e.segmentNameStartChar),t.lazy((function(){return s.name})))),s.escapedChar=t.pick(1,t.string(e.escapeChar),t.regex(/^./)),s.static=t.tag("static",t.concatMany1Till(t.firstChoice(t.lazy((function(){return s.escapedChar})),t.regex(/^./)),t.firstChoice(t.string(e.segmentNameStartChar),t.string(e.optionalSegmentStartChar),t.string(e.optionalSegmentEndChar),s.wildcard))),s.token=t.lazy((function(){return t.firstChoice(s.wildcard,s.optional,s.named,s.static)})),s.pattern=t.many1(t.lazy((function(){return s.token}))),s},a={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},o=function(t,e){if(Array.isArray(t))return u(t,(function(t){return o(t,e)}));switch(t.tag){case"wildcard":return"(.*?)";case"named":return"(["+e+"]+)";case"static":return l(t.value);case"optional":return"(?:"+o(t.value,e)+")?"}},r=function(t,e){return null==e&&(e=a.segmentValueCharset),"^"+o(t,e)+"$"},i=function(t){if(Array.isArray(t))return n(t,i);switch(t.tag){case"wildcard":return["_"];case"named":return[t.value];case"static":return[];case"optional":return i(t.value)}},c=function(t,e,s,i){var r,o,n;if(null==i&&(i=!1),null!=(n=t[e])){if(!((r=s[e]||0)>(Array.isArray(n)?n.length-1:0)))return o=Array.isArray(n)?n[r]:n,i&&(s[e]=r+1),o;if(i)throw new Error("too few values provided for key `"+e+"`")}else if(i)throw new Error("no values provided for key `"+e+"`")},s=function(t,e,i){var r,o;if(Array.isArray(t)){for(r=-1,o=t.length;++r<o;)if(s(t[r],e,i))return!0;return!1}switch(t.tag){case"wildcard":return null!=c(e,"_",i,!1);case"named":return null!=c(e,t.value,i,!1);case"static":return!1;case"optional":return s(t.value,e,i)}},g=function(t,e,i){if(Array.isArray(t))return u(t,(function(t){return g(t,e,i)}));switch(t.tag){case"wildcard":return c(e,"_",i,!0);case"named":return c(e,t.value,i,!0);case"static":return t.value;case"optional":return s(t.value,e,i)?g(t.value,e,i):""}},(e=function(t,s){var o,n,l;if(t instanceof e)return this.isRegex=t.isRegex,this.regex=t.regex,this.ast=t.ast,void(this.names=t.names);if(this.isRegex=t instanceof RegExp,"string"!=typeof t&&!this.isRegex)throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=t,null!=s){if(!Array.isArray(s))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(o=p(this.regex),s.length!==o)throw new Error("regex contains "+o+" groups but array of group names contains "+s.length);this.names=s}}else{if(""===t)throw new Error("argument must not be the empty string");if(t.replace(/\s+/g,"")!==t)throw new Error("argument must not contain whitespace");if(n={escapeChar:(null!=s?s.escapeChar:void 0)||a.escapeChar,segmentNameStartChar:(null!=s?s.segmentNameStartChar:void 0)||a.segmentNameStartChar,segmentNameCharset:(null!=s?s.segmentNameCharset:void 0)||a.segmentNameCharset,segmentValueCharset:(null!=s?s.segmentValueCharset:void 0)||a.segmentValueCharset,optionalSegmentStartChar:(null!=s?s.optionalSegmentStartChar:void 0)||a.optionalSegmentStartChar,optionalSegmentEndChar:(null!=s?s.optionalSegmentEndChar:void 0)||a.optionalSegmentEndChar,wildcardChar:(null!=s?s.wildcardChar:void 0)||a.wildcardChar},null==(l=d(n).pattern(t)))throw new Error("couldn't parse pattern");if(""!==l.rest)throw new Error("could only partially parse pattern");this.ast=l.value,this.regex=new RegExp(r(this.ast,n.segmentValueCharset)),this.names=i(this.ast)}}).prototype.match=function(t){var e,s;return null==(s=this.regex.exec(t))?null:(e=s.slice(1),this.names?h(this.names,e):e)},e.prototype.stringify=function(t){if(null==t&&(t={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(t!==Object(t))throw new Error("argument must be an object or undefined");return g(this.ast,t,{})},e.escapeForRegex=l,e.concatMap=n,e.stringConcatMap=u,e.regexGroupCount=p,e.keysAndValuesToObject=h,e.P=t,e.newParser=d,e.defaultOptions=a,e.astNodeToRegexString=r,e.astNodeToNames=i,e.getParam=c,e.astNodeContainsSegmentsForProvidedParams=s,e.stringify=g,e},null!==hi.exports?ni.exports=li():ai.UrlPattern=li();const di=oi(hi.exports);var pi=Object.defineProperty,ui=Object.getOwnPropertyDescriptor,gi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ui(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&pi(e,s,o),o};let bi=class extends(G(tt(Rt))){constructor(){super(...arguments),this.templateValueAttribute="data-route",this._location=document.location.href.replace(document.location.origin,"")}connectedCallback(){this.noShadowDom="",Kt.onChange(this),super.connectedCallback()}disconnectedCallback(){Kt.offChange(this),super.disconnectedCallback()}set location(t){this._location=t,this.requestUpdate()}get location(){return this._location}render(){const t=[];for(const s of this.templatePartsList){const i=s.getAttribute(this.templateValueAttribute)||"";if(new RegExp(i).test(this.location))t.push(s);else try{new di(i).match(this.location)&&(s.setAttribute("mode","patternMatching"),t.push(s))}catch(e){-1!=this.location.indexOf(i.replace(document.location.origin,""))&&t.push(s)}}return xt`${Fe(t,((t,e)=>e+(new Date).getTime()),(t=>{var e;if(t.title&&(document.title=t.title),t.hasAttribute("dataProviderExpression")){let s="";const i=t.getAttribute("dataProviderExpression")||"";if("patternMatching"==t.getAttribute("mode")){const e=new di(t.getAttribute(this.templateValueAttribute)||"");s=new di(i).stringify(e.match(this.location))}else{const r=new RegExp(t.getAttribute(this.templateValueAttribute)||""),o=(this.location+"").match(r);o&&(s=(null==(e=o.shift())?void 0:e.replace(r,i))||"")}return xt`<div style="display:contents" dataProvider="${s}">${Vs(t)}</div>`}return Vs(t)}))}`}};gi([U()],bi.prototype,"location",1),bi=gi([m("sonic-router")],bi);var mi=Object.defineProperty,fi=Object.getOwnPropertyDescriptor;let vi=class extends(G(Rt)){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"))return void Kt.changeFromComponent(this);if(!this.props)return;const t=this.getAttribute("onData").split("."),e=i.traverse(this.props,t);!e||i.isObject(e)&&e||Kt.changeFromComponent(this)}};vi=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?fi(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&mi(e,s,o),o})([m("sonic-redirect")],vi);var yi=Object.defineProperty,wi=Object.getOwnPropertyDescriptor,xi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?wi(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&yi(e,s,o),o};let _i=class extends(G(tt(Rt))){constructor(){super(...arguments),this.state="",this.inverted=!1,this.statePath="",this.onAssign=t=>{this.state=t,this.requestUpdate()}}connectedCallback(){if(this.noShadowDom="",super.connectedCallback(),this.hasAttribute("data-path")&&(this.statePath=this.getAttribute("data-path")),this.statePath){this.statePublisher=this.publisher;const t=this.statePath.split(".");for(const e of t)this.statePublisher=this.statePublisher[e];this.statePublisher.onAssign(this.onAssign)}}disconnectedCallback(){var t;this.statePath&&(null==(t=this.statePublisher)||t.offAssign(this.onAssign)),super.disconnectedCallback()}render(){const t=[];let e=this.state;(!Array.isArray(e)&&i.isObject(e)||void 0===e)&&(e="");for(const s of this.templatePartsList){let i=s.getAttribute(this.templateValueAttribute),r=e;this.inverted&&(r=i,i=e),""==i&&(i=this.inverted?".*?":"^$");if(new RegExp(i).test(r))t.push(s),s.removeAttribute("mode");else{const e=new di(i);e.names.length>0&&e.match(r)&&(s.setAttribute("mode","patternMatching"),t.push(s))}}return xt`${Fe(t,((t,e)=>e+(new Date).getTime()),(t=>{var s;if(t.title&&(document.title=t.title),t.hasAttribute("dataProviderExpression")){const i=t.getAttribute("dataProviderExpression");let r="",o=e,n=t.getAttribute(this.templateValueAttribute);if(this.inverted&&(o=n,n=e),""==n&&(n=this.inverted?"*":"^$"),"patternMatching"==t.getAttribute("mode")){const t=new di(n);r=new di(i).stringify(t.match(o))}else{const t=new RegExp(n),e=(o+"").match(t);e&&(r=null==(s=e.shift())?void 0:s.replace(t,i))}return xt`<div style="display:contents" dataProvider="${r}">${Vs(t)}</div>`}return Vs(t)}))}`}};xi([U()],_i.prototype,"state",2),xi([U({type:Boolean,reflect:!0})],_i.prototype,"inverted",2),_i=xi([m("sonic-states")],_i);var ki=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor;let Pi=class extends Rt{createRenderRoot(){return this}render(){return xt`<slot></slot>`}};Pi=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ai(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ki(e,s,o),o})([m("sonic-scope")],Pi);var Ci=Object.defineProperty,Si=Object.getOwnPropertyDescriptor,$i=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Si(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ci(e,s,o),o};let Oi=class extends(G(Rt)){constructor(){super(...arguments),this.text="Example"}render(){return xt`<div>${this.text}</div>`}};$i([U()],Oi.prototype,"text",2),Oi=$i([m("sonic-example")],Oi);const Di={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 Li{async transform(t,e){if(this.sduiDescriptor=t,this.sduiDescriptor.library)for(const s in e.library)this.sduiDescriptor.library[s]=e.library[s];for(const s of e.transforms)this.transformAction(s)}transformAction(t){const e=this.getNodesMatchingPatterns(t.patterns,this.sduiDescriptor);this[t.action](t,e)}getNodesMatchingPatterns(t,e){if(!t)return[];if(!e)return[];const s=e.nodes;if(!s)return[];let i=[],r=0;for(const o of t)for(const t of s)this.nodeMatchesPattern(o,t)&&i.push({parent:e,child:t,index:r}),i=i.concat(this.getNodesMatchingPatterns([o],t)),r++;return i}stringMatchesExpression(t,e){return!e||t&&t.match(e)}nodeMatchesPattern(t,e){const s=t,i=e,r=["libraryKey","innerHTML","prefix","suffix","markup"];for(const a of r)if(!this.stringMatchesExpression(i[a],s[a]))return!1;const o=t.attributes,n=e.attributes;if(o&&!n)return!1;if(o)for(const a in o)if(!n||!this.stringMatchesExpression(n[a],o[a]))return!1;return!0}unwrap(t,e){var s,i;for(const r of e)null==(s=r.parent.nodes)||s.splice(r.parent.nodes.indexOf(r.child),1),r.child.nodes&&(null==(i=r.parent.nodes)||i.splice(r.parent.nodes.indexOf(r.child),0,...r.child.nodes))}wrap(t,e){var s,i,r,o,n,a;const l={...t.ui};l.nodes||(l.nodes=[]);let c=0;for(const d of e)null==(s=l.nodes)||s.push(d.child),c>0&&(null==(i=d.parent.nodes)||i.splice(d.parent.nodes.indexOf(d.child),1)),c++;const h=null==(o=null==(r=e[0])?void 0:r.parent.nodes)?void 0:o.indexOf(e[0].child);h&&(null==(n=e[0].parent.nodes)||n.splice(h,1),null==(a=e[0].parent.nodes)||a.splice(h,0,l))}move(t,e){var s,i;for(const r of e){null==(s=r.parent.nodes)||s.splice(r.parent.nodes.indexOf(r.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&&(null==(i=o.parent.nodes)||i.splice(o.parent.nodes.indexOf(o.child)+(t.after?1:0),0,r.child))}}remap(t,e){var s,i,r;for(const o of e){const e={...t.ui};e.attributes||(e.attributes={});const n=o.child.attributes;if(n)for(const t in n)Object.prototype.hasOwnProperty.call(e.attributes,"key")||(e.attributes[t]=n[t]);const a=["libraryKey","innerHTML","prefix","suffix","markup"],l=o.child,c=e;for(const t of a)!Object.prototype.hasOwnProperty.call(e,t)&&l[t]&&(c[t]=l[t]);e.nodes||(e.nodes=[]);const h=o.child.nodes;if(h)for(const t of h)e.nodes.push(t);const d=(null==(s=o.parent.nodes)?void 0:s.indexOf(o.child))||-1;-1!=d&&(null==(i=o.parent.nodes)||i.splice(d,1),null==(r=o.parent.nodes)||r.splice(d,0,e))}}delete(t,e){var s;for(const i of e)null==(s=i.parent.nodes)||s.splice(i.parent.nodes.indexOf(i.child),1)}insert(t,e){var s;const i=t.after?"after":t.before?"before":"in";e=[],t.after?e=this.getNodesMatchingPatterns([t.after],this.sduiDescriptor):t.before?e=this.getNodesMatchingPatterns([t.before],this.sduiDescriptor):t.in&&(e=this.getNodesMatchingPatterns([t.in],this.sduiDescriptor));const r=e[0];r&&("in"==i?(r.child.nodes||(r.child.nodes=[]),r.child.nodes.push({...t.ui})):null==(s=r.parent.nodes)||s.splice(r.parent.nodes.indexOf(r.child)+("after"==i?1:0),0,{...t.ui}))}}var Ei=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,Mi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ji(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ei(e,s,o),o};const Ni=t=>{class e extends t{constructor(...t){super(),this.forceAutoFill=!1,this._type="text"}validateFormElement(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("input");if(!e||e.checkValidity())return;const s=this.getFormPublisher();s&&(s.isFormValid=!1),e.reportValidity()}set type(t){this.hasAttribute("type")&&!this.forceAutoFill&&(t=this.getAttribute("type")),this._type=t,this.requestUpdate()}get type(){return this._type}get description(){return this._description}set description(t){this.hasAttribute("description")&&!this.forceAutoFill&&(t=this.getAttribute("description")),this._description=t,this.requestUpdate()}get label(){return this._label}set label(t){this.hasAttribute("label")&&!this.forceAutoFill&&(t=this.getAttribute("label")),this._label=t,this.requestUpdate()}}return Mi([U()],e.prototype,"forceAutoFill",2),Mi([U({type:String})],e.prototype,"type",1),Mi([U()],e.prototype,"description",1),Mi([U()],e.prototype,"label",1),Mi([U({type:Number})],e.prototype,"tabindex",2),Mi([U({type:String})],e.prototype,"autocomplete",2),e},zi=Ms,Ii=ye,Ti=oe,Fi=Ni,Ri=G,Ui=tt;window["concorde-mixins"]=window["concorde-mixins"]||{},window["concorde-mixins"]={Fetcher:zi,FormCheckable:Ii,FormElement:Ti,FormInput:Fi,Subscriber:Ri,TemplatesContainer:Ui};var Vi=Object.defineProperty,Bi=Object.getOwnPropertyDescriptor,qi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Bi(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Vi(e,s,o),o};let Hi=class extends(zi(Ri(Rt))){constructor(){super(...arguments),this.sduiDescriptor={}}connectedCallback(){this.noShadowDom="",this.displayContents=!0,this.isFetchEnabled=this.hasAttribute("fetch"),super.connectedCallback()}willUpdate(t){null==this.props&&(this.sduiDescriptor={});{const t=this.sduiKey?this.props[this.sduiKey]:this.props;if(this.sduiDescriptor==t)return;this.sduiDescriptor=t,this.updateContents()}super.willUpdate(t)}async updateContents(){if(!this.sduiDescriptor)return;const t={};Object.assign(t,Di,this.sduiDescriptor.library),this.sduiDescriptor.library=t,this.loadAssets(),await this.loadLibrary(),await this.transformSDUIDescriptor(),this.parseRootNodes()}removeChildren(){for(;[...this.children].filter((t=>"SLOT"!=t.nodeName)).length>0;)this.removeChild(this.children[0])}loadAssets(){if(this.sduiDescriptor){if(this.sduiDescriptor.js)for(const t of this.sduiDescriptor.js)he.loadJS(t);if(this.sduiDescriptor.css)for(const t of this.sduiDescriptor.css)he.loadCSS(t)}}async transformSDUIDescriptor(){if(!this.hasAttribute("transformation"))return;const t=await fetch(this.getAttribute("transformation")),e=await t.json(),s=new Li;await s.transform(this.sduiDescriptor,e)}async loadLibrary(){if(!this.hasAttribute("library"))return;const t=await fetch(this.getAttribute("library")),e=await t.json();this.sduiDescriptor.library=e}parseRootNodes(){if(this.removeChildren(),!this.sduiDescriptor)return;let t=this.sduiDescriptor.nodes;t||(t=[]);const e={tagName:"sonic-toast-message-subscriber",attributes:{}};this.messagesKey&&(e.attributes={subDataProvider:this.messagesKey}),t.push(e),t.forEach((t=>this.appendChild(this.parseChild(t))))}parseChild(t){const e=t.tagName||"div";let{element:s,contentElement:i}=this.handleLibrary(t,e);if(this.handleAttributes(t,s),s=this.handleMarkup(t,s),i||(i=s),this.handleChildNodes(t,i,s),this.handleInnerHTML(t,i),t.prefix||t.suffix){return this.handlePrefixSuffix(t,s)}return s}handlePrefixSuffix(t,e){const s=document.createElement("div");return s.innerHTML=(t.prefix||"")+e.outerHTML+(t.suffix||""),s.style.display="contents",s}handleChildNodes(t,e,s){if(t.nodes){const i=t.nodes;for(const t of i){const i=this.parseChild(t);let r=e;if(t.parentElementSelector&&(r=s.querySelector(t.parentElementSelector)||e),r.shadowRoot)r.shadowRoot.appendChild(i);else if("template"==r.tagName.toLocaleLowerCase()){r.content.appendChild(i)}else r.appendChild(i)}}}handleLibrary(t,e){let s,i;if(t.libraryKey&&this.sduiDescriptor.library){s=this.parseChild(this.sduiDescriptor.library[t.libraryKey]||{tagName:"div"});const e=(this.sduiDescriptor.library[t.libraryKey]||{}).contentElementSelector;e&&(i=s.querySelector(e))}else s=document.createElement(e);return{element:s,contentElement:i}}handleAttributes(t,e){const s=t.attributes;for(const i in s){const t=s[i],r=pe.isObject(t)?JSON.stringify(t):t;e.setAttribute(i,r)}}handleMarkup(t,e){return t.markup&&((e=document.createElement("div")).style.display="contents",e.innerHTML=t.markup),e}handleInnerHTML(t,e){var s;if(t.innerHTML)if(-1!=t.innerHTML.indexOf("wording_")){const i=this.getAncestorAttributeValue("wordingProvider");null==(s=this.api)||s.post(i,{labels:[t.innerHTML.substring(8)]}).then((t=>{e&&(e.innerHTML+=t)}))}else e&&(e.innerHTML+=t.innerHTML)}};qi([U()],Hi.prototype,"sduiKey",2),qi([U()],Hi.prototype,"messagesKey",2),Hi=qi([m("sonic-sdui")],Hi);var Wi=Object.defineProperty,Ki=Object.getOwnPropertyDescriptor,Zi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ki(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Wi(e,s,o),o};let Yi=class extends(Ri(Rt)){constructor(){super(...arguments),this._composition={},this.listeners=[]}get composition(){return this._composition}set composition(t){this._composition=t,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 t=this.listeners;this.listeners=[],t.forEach((t=>{this.publisher.offAssign(t.subscriber)}))}parseComposition(t,e){if(t)for(const s in t){const i=t[s];if("string"==typeof i){const t=i.split("."),r=t.shift();if(!r)continue;let o=ge.get(r);o=pe.traverse(o,t);const n={publisher:o,subscriber:t=>{e[s]=t}};this.listeners.push(n),o.onAssign(n.subscriber),e._proxies_.set(s,o)}else{this.publisher[s]={};const t=new c({},e);e._proxies_.set(s,t);const r={publisher:t,subscriber:t=>{e[s]=t}};this.listeners.push(r),t.onAssign(r.subscriber),this.parseComposition(i,t)}}}render(){return xt`<slot></slot>`}};Yi.styles=[_`
|
|
1124
|
+
`,Oi([F({type:String})],Di.prototype,"submitResultKey",2),Oi([F({type:Boolean})],Di.prototype,"disabled",2),Oi([F({type:String})],Di.prototype,"endPoint",2),Oi([F()],Di.prototype,"name",2),Oi([F()],Di.prototype,"value",2),Di=Oi([b("sonic-submit")],Di);var Li="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ei(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ji,Mi,Ii,Ti,Ni={exports:{}};ji=Ni,Ti=[].slice,Mi=Li,Ii=function(){var t,e,s,i,r,o,n,a,l,c,h,d,p,u,g;return l=function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},n=function(t,e){var s,i,r;for(r=[],s=-1,i=t.length;++s<i;)r=r.concat(e(t[s]));return r},u=function(t,e){var s,i,r;for(r="",s=-1,i=t.length;++s<i;)r+=e(t[s]);return r},p=function(t){return new RegExp(t.toString()+"|").exec("").length-1},h=function(t,e){var s,i,r,o,n;for(o={},s=-1,r=t.length;++s<r;)i=t[s],null!=(n=e[s])&&(null!=o[i]?(Array.isArray(o[i])||(o[i]=[o[i]]),o[i].push(n)):o[i]=n);return o},(t={}).Result=function(t,e){this.value=t,this.rest=e},t.Tagged=function(t,e){this.tag=t,this.value=e},t.tag=function(e,s){return function(i){var r,o;if(null!=(r=s(i)))return o=new t.Tagged(e,r.value),new t.Result(o,r.rest)}},t.regex=function(e){return function(s){var i,r;if(null!=(i=e.exec(s)))return r=i[0],new t.Result(r,s.slice(r.length))}},t.sequence=function(){var e;return e=1<=arguments.length?Ti.call(arguments,0):[],function(s){var i,r,o,n,a;for(i=-1,r=e.length,a=[],o=s;++i<r;){if(null==(n=(0,e[i])(o)))return;a.push(n.value),o=n.rest}return new t.Result(a,o)}},t.pick=function(){var e,s;return e=arguments[0],s=2<=arguments.length?Ti.call(arguments,1):[],function(i){var r,o;if(null!=(o=t.sequence.apply(t,s)(i)))return r=o.value,o.value=r[e],o}},t.string=function(e){var s;return s=e.length,function(i){if(i.slice(0,s)===e)return new t.Result(e,i.slice(s))}},t.lazy=function(t){var e;return e=null,function(s){return null==e&&(e=t()),e(s)}},t.baseMany=function(e,s,i,r,o){var n,a,l;for(a=o,l=i?"":[];(null==s||null==s(a))&&null!=(n=e(a));)i?l+=n.value:l.push(n.value),a=n.rest;if(!r||0!==l.length)return new t.Result(l,a)},t.many1=function(e){return function(s){return t.baseMany(e,null,!1,!0,s)}},t.concatMany1Till=function(e,s){return function(i){return t.baseMany(e,s,!0,!0,i)}},t.firstChoice=function(){var t;return t=1<=arguments.length?Ti.call(arguments,0):[],function(e){var s,i,r;for(s=-1,i=t.length;++s<i;)if(null!=(r=(0,t[s])(e)))return r}},d=function(e){var s;return(s={}).wildcard=t.tag("wildcard",t.string(e.wildcardChar)),s.optional=t.tag("optional",t.pick(1,t.string(e.optionalSegmentStartChar),t.lazy((function(){return s.pattern})),t.string(e.optionalSegmentEndChar))),s.name=t.regex(new RegExp("^["+e.segmentNameCharset+"]+")),s.named=t.tag("named",t.pick(1,t.string(e.segmentNameStartChar),t.lazy((function(){return s.name})))),s.escapedChar=t.pick(1,t.string(e.escapeChar),t.regex(/^./)),s.static=t.tag("static",t.concatMany1Till(t.firstChoice(t.lazy((function(){return s.escapedChar})),t.regex(/^./)),t.firstChoice(t.string(e.segmentNameStartChar),t.string(e.optionalSegmentStartChar),t.string(e.optionalSegmentEndChar),s.wildcard))),s.token=t.lazy((function(){return t.firstChoice(s.wildcard,s.optional,s.named,s.static)})),s.pattern=t.many1(t.lazy((function(){return s.token}))),s},a={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},o=function(t,e){if(Array.isArray(t))return u(t,(function(t){return o(t,e)}));switch(t.tag){case"wildcard":return"(.*?)";case"named":return"(["+e+"]+)";case"static":return l(t.value);case"optional":return"(?:"+o(t.value,e)+")?"}},r=function(t,e){return null==e&&(e=a.segmentValueCharset),"^"+o(t,e)+"$"},i=function(t){if(Array.isArray(t))return n(t,i);switch(t.tag){case"wildcard":return["_"];case"named":return[t.value];case"static":return[];case"optional":return i(t.value)}},c=function(t,e,s,i){var r,o,n;if(null==i&&(i=!1),null!=(n=t[e])){if(!((r=s[e]||0)>(Array.isArray(n)?n.length-1:0)))return o=Array.isArray(n)?n[r]:n,i&&(s[e]=r+1),o;if(i)throw new Error("too few values provided for key `"+e+"`")}else if(i)throw new Error("no values provided for key `"+e+"`")},s=function(t,e,i){var r,o;if(Array.isArray(t)){for(r=-1,o=t.length;++r<o;)if(s(t[r],e,i))return!0;return!1}switch(t.tag){case"wildcard":return null!=c(e,"_",i,!1);case"named":return null!=c(e,t.value,i,!1);case"static":return!1;case"optional":return s(t.value,e,i)}},g=function(t,e,i){if(Array.isArray(t))return u(t,(function(t){return g(t,e,i)}));switch(t.tag){case"wildcard":return c(e,"_",i,!0);case"named":return c(e,t.value,i,!0);case"static":return t.value;case"optional":return s(t.value,e,i)?g(t.value,e,i):""}},(e=function(t,s){var o,n,l;if(t instanceof e)return this.isRegex=t.isRegex,this.regex=t.regex,this.ast=t.ast,void(this.names=t.names);if(this.isRegex=t instanceof RegExp,"string"!=typeof t&&!this.isRegex)throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=t,null!=s){if(!Array.isArray(s))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(o=p(this.regex),s.length!==o)throw new Error("regex contains "+o+" groups but array of group names contains "+s.length);this.names=s}}else{if(""===t)throw new Error("argument must not be the empty string");if(t.replace(/\s+/g,"")!==t)throw new Error("argument must not contain whitespace");if(n={escapeChar:(null!=s?s.escapeChar:void 0)||a.escapeChar,segmentNameStartChar:(null!=s?s.segmentNameStartChar:void 0)||a.segmentNameStartChar,segmentNameCharset:(null!=s?s.segmentNameCharset:void 0)||a.segmentNameCharset,segmentValueCharset:(null!=s?s.segmentValueCharset:void 0)||a.segmentValueCharset,optionalSegmentStartChar:(null!=s?s.optionalSegmentStartChar:void 0)||a.optionalSegmentStartChar,optionalSegmentEndChar:(null!=s?s.optionalSegmentEndChar:void 0)||a.optionalSegmentEndChar,wildcardChar:(null!=s?s.wildcardChar:void 0)||a.wildcardChar},null==(l=d(n).pattern(t)))throw new Error("couldn't parse pattern");if(""!==l.rest)throw new Error("could only partially parse pattern");this.ast=l.value,this.regex=new RegExp(r(this.ast,n.segmentValueCharset)),this.names=i(this.ast)}}).prototype.match=function(t){var e,s;return null==(s=this.regex.exec(t))?null:(e=s.slice(1),this.names?h(this.names,e):e)},e.prototype.stringify=function(t){if(null==t&&(t={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(t!==Object(t))throw new Error("argument must be an object or undefined");return g(this.ast,t,{})},e.escapeForRegex=l,e.concatMap=n,e.stringConcatMap=u,e.regexGroupCount=p,e.keysAndValuesToObject=h,e.P=t,e.newParser=d,e.defaultOptions=a,e.astNodeToRegexString=r,e.astNodeToNames=i,e.getParam=c,e.astNodeContainsSegmentsForProvidedParams=s,e.stringify=g,e},null!==Ni.exports?ji.exports=Ii():Mi.UrlPattern=Ii();const zi=Ei(Ni.exports);var Ri=Object.defineProperty,Fi=Object.getOwnPropertyDescriptor,Ui=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Fi(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ri(e,s,o),o};let Vi=class extends(he(ue(Zt))){constructor(){super(...arguments),this.templateValueAttribute="data-route",this._location=document.location.href.replace(document.location.origin,"")}connectedCallback(){this.noShadowDom="",ye.onChange(this),super.connectedCallback()}disconnectedCallback(){ye.offChange(this),super.disconnectedCallback()}set location(t){this._location=t,this.requestUpdate()}get location(){return this._location}render(){const t=[];for(const s of this.templatePartsList){const i=s.getAttribute(this.templateValueAttribute)||"";if(new RegExp(i).test(this.location))t.push(s);else try{new zi("(/)*"+i+"*").match(this.location)&&(s.setAttribute("mode","patternMatching"),t.push(s))}catch(e){-1!=this.location.indexOf(i.replace(document.location.origin,""))&&t.push(s)}}if(0==t.length){this.fallBackRoute&&this.isConnected&&(document.location.href=this.fallBackRoute);const e=this.templatePartsList.find((t=>t.hasAttribute("data-fallback")));e&&t.push(e)}return pt`${Ye(t,((t,e)=>e+(new Date).getTime()),(t=>{var e;if(t.title&&(document.title=t.title),t.hasAttribute("dataProviderExpression")){let s="";const i=t.getAttribute("dataProviderExpression")||"";if("patternMatching"==t.getAttribute("mode")){const e=new zi("(/)*"+(t.getAttribute(this.templateValueAttribute)||"")+"*");s=new zi(i).stringify(e.match(this.location))}else{const r=new RegExp(t.getAttribute(this.templateValueAttribute)||""),o=(this.location+"").match(r);o&&(s=(null==(e=o.shift())?void 0:e.replace(r,i))||"")}return pt`<div style="display:contents" dataProvider="${s}">${ei(t)}</div>`}return ei(t)}))}`}};Ui([F({type:String})],Vi.prototype,"fallBackRoute",2),Ui([F()],Vi.prototype,"location",1),Vi=Ui([b("sonic-router")],Vi);var Bi=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor;let qi=class extends(he(Zt)){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"))return void ye.changeFromComponent(this);if(!this.props)return;const t=this.getAttribute("onData").split("."),e=g.traverse(this.props,t);!e||g.isObject(e)&&e||ye.changeFromComponent(this)}};qi=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?Hi(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Bi(e,s,o),o})([b("sonic-redirect")],qi);var Wi=Object.defineProperty,Ki=Object.getOwnPropertyDescriptor,Zi=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ki(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Wi(e,s,o),o};let Yi=class extends(he(ue(Zt))){constructor(){super(...arguments),this.state="",this.inverted=!1,this.statePath="",this.onAssign=t=>{this.state=t,this.requestUpdate()}}connectedCallback(){if(this.noShadowDom="",super.connectedCallback(),this.hasAttribute("data-path")&&(this.statePath=this.getAttribute("data-path")),this.statePath){this.statePublisher=this.publisher;const t=this.statePath.split(".");for(const e of t)this.statePublisher=this.statePublisher[e];this.statePublisher.onAssign(this.onAssign)}}disconnectedCallback(){var t;this.statePath&&(null==(t=this.statePublisher)||t.offAssign(this.onAssign)),super.disconnectedCallback()}render(){const t=[];let e=this.state;(!Array.isArray(e)&&g.isObject(e)||void 0===e)&&(e="");for(const s of this.templatePartsList){let i=s.getAttribute(this.templateValueAttribute),r=e;this.inverted&&(r=i,i=e),""==i&&(i=this.inverted?".*?":"^$");if(new RegExp(i).test(r))t.push(s),s.removeAttribute("mode");else{const e=new zi(i);e.names.length>0&&e.match(r)&&(s.setAttribute("mode","patternMatching"),t.push(s))}}return pt`${Ye(t,((t,e)=>e+(new Date).getTime()),(t=>{var s;if(t.title&&(document.title=t.title),t.hasAttribute("dataProviderExpression")){const i=t.getAttribute("dataProviderExpression");let r="",o=e,n=t.getAttribute(this.templateValueAttribute);if(this.inverted&&(o=n,n=e),""==n&&(n=this.inverted?"*":"^$"),"patternMatching"==t.getAttribute("mode")){const t=new zi(n);r=new zi(i).stringify(t.match(o))}else{const t=new RegExp(n),e=(o+"").match(t);e&&(r=null==(s=e.shift())?void 0:s.replace(t,i))}return pt`<div style="display:contents" dataProvider="${r}">${ei(t)}</div>`}return ei(t)}))}`}};Zi([F()],Yi.prototype,"state",2),Zi([F({type:Boolean,reflect:!0})],Yi.prototype,"inverted",2),Yi=Zi([b("sonic-states")],Yi);var Gi=Object.defineProperty,Qi=Object.getOwnPropertyDescriptor;let Ji=class extends Zt{createRenderRoot(){return this}render(){return pt`<slot></slot>`}};Ji=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?Qi(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Gi(e,s,o),o})([b("sonic-scope")],Ji);var Xi=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,er=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?tr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Xi(e,s,o),o};let sr=class extends(he(Zt)){constructor(){super(...arguments),this.text="Example"}render(){return pt`<div>${this.text}</div>`}};er([F()],sr.prototype,"text",2),sr=er([b("sonic-example")],sr);const ir={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 rr{async transform(t,e){if(this.sduiDescriptor=t,this.sduiDescriptor.library)for(const s in e.library)this.sduiDescriptor.library[s]=e.library[s];for(const s of e.transforms)this.transformAction(s)}transformAction(t){const e=this.getNodesMatchingPatterns(t.patterns,this.sduiDescriptor);this[t.action](t,e)}getNodesMatchingPatterns(t,e){if(!t)return[];if(!e)return[];const s=e.nodes;if(!s)return[];let i=[],r=0;for(const o of t)for(const t of s)this.nodeMatchesPattern(o,t)&&i.push({parent:e,child:t,index:r}),i=i.concat(this.getNodesMatchingPatterns([o],t)),r++;return i}stringMatchesExpression(t,e){return!e||t&&t.match(e)}nodeMatchesPattern(t,e){const s=t,i=e,r=["libraryKey","innerHTML","prefix","suffix","markup"];for(const a of r)if(!this.stringMatchesExpression(i[a],s[a]))return!1;const o=t.attributes,n=e.attributes;if(o&&!n)return!1;if(o)for(const a in o)if(!n||!this.stringMatchesExpression(n[a],o[a]))return!1;return!0}unwrap(t,e){var s,i;for(const r of e)null==(s=r.parent.nodes)||s.splice(r.parent.nodes.indexOf(r.child),1),r.child.nodes&&(null==(i=r.parent.nodes)||i.splice(r.parent.nodes.indexOf(r.child),0,...r.child.nodes))}wrap(t,e){var s,i,r,o,n,a;const l={...t.ui};l.nodes||(l.nodes=[]);let c=0;for(const d of e)null==(s=l.nodes)||s.push(d.child),c>0&&(null==(i=d.parent.nodes)||i.splice(d.parent.nodes.indexOf(d.child),1)),c++;const h=null==(o=null==(r=e[0])?void 0:r.parent.nodes)?void 0:o.indexOf(e[0].child);h&&(null==(n=e[0].parent.nodes)||n.splice(h,1),null==(a=e[0].parent.nodes)||a.splice(h,0,l))}move(t,e){var s,i;for(const r of e){null==(s=r.parent.nodes)||s.splice(r.parent.nodes.indexOf(r.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&&(null==(i=o.parent.nodes)||i.splice(o.parent.nodes.indexOf(o.child)+(t.after?1:0),0,r.child))}}remap(t,e){var s,i,r;for(const o of e){const e={...t.ui};e.attributes||(e.attributes={});const n=o.child.attributes;if(n)for(const t in n)Object.prototype.hasOwnProperty.call(e.attributes,"key")||(e.attributes[t]=n[t]);const a=["libraryKey","innerHTML","prefix","suffix","markup"],l=o.child,c=e;for(const t of a)!Object.prototype.hasOwnProperty.call(e,t)&&l[t]&&(c[t]=l[t]);e.nodes||(e.nodes=[]);const h=o.child.nodes;if(h)for(const t of h)e.nodes.push(t);const d=(null==(s=o.parent.nodes)?void 0:s.indexOf(o.child))||-1;-1!=d&&(null==(i=o.parent.nodes)||i.splice(d,1),null==(r=o.parent.nodes)||r.splice(d,0,e))}}delete(t,e){var s;for(const i of e)null==(s=i.parent.nodes)||s.splice(i.parent.nodes.indexOf(i.child),1)}insert(t,e){var s;const i=t.after?"after":t.before?"before":"in";e=[],t.after?e=this.getNodesMatchingPatterns([t.after],this.sduiDescriptor):t.before?e=this.getNodesMatchingPatterns([t.before],this.sduiDescriptor):t.in&&(e=this.getNodesMatchingPatterns([t.in],this.sduiDescriptor));const r=e[0];r&&("in"==i?(r.child.nodes||(r.child.nodes=[]),r.child.nodes.push({...t.ui})):null==(s=r.parent.nodes)||s.splice(r.parent.nodes.indexOf(r.child)+("after"==i?1:0),0,{...t.ui}))}}var or=Object.defineProperty,nr=Object.getOwnPropertyDescriptor,ar=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?nr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&or(e,s,o),o};let lr=class extends(Ys(Xs(Zt))){constructor(){super(...arguments),this.sduiDescriptor={}}connectedCallback(){this.noShadowDom="",this.displayContents=!0,this.isFetchEnabled=this.hasAttribute("fetch"),super.connectedCallback()}willUpdate(t){null==this.props&&(this.sduiDescriptor={});{const t=this.sduiKey?this.props[this.sduiKey]:this.props;if(this.sduiDescriptor==t)return;this.sduiDescriptor=t,this.updateContents()}super.willUpdate(t)}async updateContents(){if(!this.sduiDescriptor)return;const t={};Object.assign(t,ir,this.sduiDescriptor.library),this.sduiDescriptor.library=t,this.loadAssets(),await this.loadLibrary(),await this.transformSDUIDescriptor(),this.parseRootNodes()}removeChildren(){for(;[...this.children].filter((t=>"SLOT"!=t.nodeName)).length>0;)this.removeChild(this.children[0])}loadAssets(){if(this.sduiDescriptor){if(this.sduiDescriptor.js)for(const t of this.sduiDescriptor.js)Ee.loadJS(t);if(this.sduiDescriptor.css)for(const t of this.sduiDescriptor.css)Ee.loadCSS(t)}}async transformSDUIDescriptor(){if(!this.hasAttribute("transformation"))return;const t=await fetch(this.getAttribute("transformation")),e=await t.json(),s=new rr;await s.transform(this.sduiDescriptor,e)}async loadLibrary(){if(!this.hasAttribute("library"))return;const t=await fetch(this.getAttribute("library")),e=await t.json();this.sduiDescriptor.library=e}parseRootNodes(){if(this.removeChildren(),!this.sduiDescriptor)return;let t=this.sduiDescriptor.nodes;t||(t=[]);const e={tagName:"sonic-toast-message-subscriber",attributes:{}};this.messagesKey&&(e.attributes={subDataProvider:this.messagesKey}),t.push(e),t.forEach((t=>this.appendChild(this.parseChild(t))))}parseChild(t){const e=t.tagName||"div";let{element:s,contentElement:i}=this.handleLibrary(t,e);if(this.handleAttributes(t,s),s=this.handleMarkup(t,s),i||(i=s),this.handleChildNodes(t,i,s),this.handleInnerHTML(t,i),t.prefix||t.suffix){return this.handlePrefixSuffix(t,s)}return s}handlePrefixSuffix(t,e){const s=document.createElement("div");return s.innerHTML=(t.prefix||"")+e.outerHTML+(t.suffix||""),s.style.display="contents",s}handleChildNodes(t,e,s){if(t.nodes){const i=t.nodes;for(const t of i){const i=this.parseChild(t);let r=e;if(t.parentElementSelector&&(r=s.querySelector(t.parentElementSelector)||e),r.shadowRoot)r.shadowRoot.appendChild(i);else if("template"==r.tagName.toLocaleLowerCase()){r.content.appendChild(i)}else r.appendChild(i)}}}handleLibrary(t,e){let s,i;if(t.libraryKey&&this.sduiDescriptor.library){s=this.parseChild(this.sduiDescriptor.library[t.libraryKey]||{tagName:"div"});const e=(this.sduiDescriptor.library[t.libraryKey]||{}).contentElementSelector;e&&(i=s.querySelector(e))}else s=document.createElement(e);return{element:s,contentElement:i}}handleAttributes(t,e){const s=t.attributes;for(const i in s){const t=s[i],r=Me.isObject(t)?JSON.stringify(t):t;e.setAttribute(i,r)}}handleMarkup(t,e){return t.markup&&((e=document.createElement("div")).style.display="contents",e.innerHTML=t.markup),e}handleInnerHTML(t,e){var s;if(t.innerHTML)if(-1!=t.innerHTML.indexOf("wording_")){const i=this.getAncestorAttributeValue("wordingProvider");null==(s=this.api)||s.post(i,{labels:[t.innerHTML.substring(8)]}).then((t=>{e&&(e.innerHTML+=t)}))}else e&&(e.innerHTML+=t.innerHTML)}};ar([F()],lr.prototype,"sduiKey",2),ar([F()],lr.prototype,"messagesKey",2),lr=ar([b("sonic-sdui")],lr);var cr=Object.defineProperty,hr=Object.getOwnPropertyDescriptor,dr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?hr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&cr(e,s,o),o};let pr=class extends(Xs(Zt)){constructor(){super(...arguments),this._composition={},this.listeners=[]}get composition(){return this._composition}set composition(t){this._composition=t,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 t=this.listeners;this.listeners=[],t.forEach((t=>{this.publisher.offAssign(t.subscriber)}))}parseComposition(t,e){if(t)for(const s in t){const i=t[s];if("string"==typeof i){const t=i.split("."),r=t.shift();if(!r)continue;let o=Te.get(r);o=Me.traverse(o,t);const n={publisher:o,subscriber:t=>{e[s]=t}};this.listeners.push(n),o.onAssign(n.subscriber),e._proxies_.set(s,o)}else{this.publisher[s]={};const t=new n({},e);e._proxies_.set(s,t);const r={publisher:t,subscriber:t=>{e[s]=t}};this.listeners.push(r),t.onAssign(r.subscriber),this.parseComposition(i,t)}}}render(){return pt`<slot></slot>`}};pr.styles=[x`
|
|
978
1125
|
:host {
|
|
979
1126
|
display: contents;
|
|
980
1127
|
}
|
|
981
|
-
`],
|
|
982
|
-
><slot name="suffix"></slot>`}};
|
|
983
|
-
:host {
|
|
984
|
-
/* polices*/
|
|
985
|
-
--sc-font-family-base: "Inter var", "Inter", -apple-system, system-ui,
|
|
986
|
-
BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
|
|
987
|
-
sans-serif;
|
|
988
|
-
--sc-font-weight-base: 400;
|
|
989
|
-
--sc-font-style-base: normal;
|
|
990
|
-
|
|
991
|
-
--sc-headings-font-family: var(--sc-font-family-base), sans-serif;
|
|
992
|
-
--sc-headings-font-style: var(--sc-font-style-base);
|
|
993
|
-
--sc-headings-line-height: 1.1;
|
|
994
|
-
--sc-headings-font-weight: 700;
|
|
995
|
-
--sc-headings-text-transform: none;
|
|
996
|
-
|
|
997
|
-
/* Button*/
|
|
998
|
-
--sc-btn-font-weight: var(--sc-font-weight-base);
|
|
999
|
-
--sc-btn-font-family: var(--sc-font-family-base);
|
|
1000
|
-
--sc-btn-font-style: var(--sc-font-style-base);
|
|
1001
|
-
|
|
1002
|
-
/* ROUNDED*/
|
|
1003
|
-
--sc-rounded-sm: calc(var(--sc-rounded) * 0.5);
|
|
1004
|
-
--sc-rounded: 0.375rem;
|
|
1005
|
-
--sc-rounded-md: calc(var(--sc-rounded) * 1.8);
|
|
1006
|
-
--sc-rounded-lg: calc(var(--sc-rounded) * 3);
|
|
1007
|
-
--sc-rounded-xl: calc(var(--sc-rounded) * 7);
|
|
1008
|
-
--sc-rounded-size-intensity: calc((1em - 1rem) * 0.4);
|
|
1009
|
-
|
|
1010
|
-
/* 4 for rounded full*/
|
|
1011
|
-
--sc-btn-rounded-intensity: 1.4;
|
|
1012
|
-
--sc-btn-font-weight: 500;
|
|
1013
|
-
--sc-btn-rounded: calc(
|
|
1014
|
-
(var(--sc-rounded) + var(--sc-rounded-size-intensity)) *
|
|
1015
|
-
var(--sc-btn-rounded-intensity)
|
|
1016
|
-
);
|
|
1017
|
-
|
|
1018
|
-
/* Placeholder */
|
|
1019
|
-
--sc-placeholder-bg: rgba(17, 24, 39, 0.05);
|
|
1020
|
-
|
|
1021
|
-
/* OMBRES */
|
|
1022
|
-
--sc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1),
|
|
1023
|
-
0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
1024
|
-
--sc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1),
|
|
1025
|
-
0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
1026
|
-
--sc-shadow-lg: 0 10px 15px 0px rgb(0 0 0 / 0.1),
|
|
1027
|
-
0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
1028
|
-
--sc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
|
|
1029
|
-
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
1030
|
-
--sc-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
|
1031
|
-
|
|
1032
|
-
/* Forms */
|
|
1033
|
-
--sc-border-width: max(1px, 0.12rem);
|
|
1034
|
-
--sc-border-color: var(--sc-base-200);
|
|
1035
|
-
--sc-form-height: 2.5em;
|
|
1036
|
-
--sc-form-border-width: var(--sc-border-width);
|
|
1037
|
-
--sc-input-bg: var(--sc-base-100);
|
|
1038
|
-
--sc-input-border-color: var(--sc-input-bg);
|
|
1039
|
-
--sc-input-rounded-intensity: 1.4;
|
|
1040
|
-
--sc-input-rounded: calc(
|
|
1041
|
-
(var(--sc-rounded) + var(--sc-rounded-size-intensity)) *
|
|
1042
|
-
var(--sc-input-rounded-intensity)
|
|
1043
|
-
);
|
|
1044
|
-
--sc-label-font-weight: 500;
|
|
1045
|
-
|
|
1046
|
-
/* Contrast -- ex : Text on images */
|
|
1047
|
-
--sc-contrast-content: #fff;
|
|
1048
|
-
--sc-contrast: #11151f;
|
|
1049
|
-
|
|
1050
|
-
/*Scrollbar*/
|
|
1051
|
-
--sc-scrollbar-bg: var(--sc-base-400);
|
|
1052
|
-
|
|
1053
|
-
/*Body*/
|
|
1054
|
-
--sc-body-bg: var(--sc-base);
|
|
1055
|
-
}
|
|
1056
|
-
`,tr=_`
|
|
1057
|
-
:host {
|
|
1058
|
-
/*Boutons*/
|
|
1059
|
-
--sc-primary: var(--sc-base-800);
|
|
1060
|
-
--sc-info: #2563eb;
|
|
1061
|
-
--sc-danger: #f43f5e;
|
|
1062
|
-
--sc-warning: #f97316;
|
|
1063
|
-
--sc-success: #14b8a6;
|
|
1064
|
-
|
|
1065
|
-
--sc-primary-content: var(--sc-base);
|
|
1066
|
-
--sc-info-content: var(--sc-base);
|
|
1067
|
-
--sc-danger-content: var(--sc-base);
|
|
1068
|
-
--sc-warning-content: var(--sc-base);
|
|
1069
|
-
--sc-success-content: var(--sc-base);
|
|
1070
|
-
|
|
1071
|
-
/*Bases*/
|
|
1072
|
-
--sc-base: #fff;
|
|
1073
|
-
--sc-base-50: #f8fafc;
|
|
1074
|
-
--sc-base-100: #f1f5f9;
|
|
1075
|
-
--sc-base-200: #e2e8f0;
|
|
1076
|
-
--sc-base-300: #cbd5e1;
|
|
1077
|
-
--sc-base-400: #94a3b8;
|
|
1078
|
-
--sc-base-500: #64748b;
|
|
1079
|
-
--sc-base-600: #475569;
|
|
1080
|
-
--sc-base-700: #334155;
|
|
1081
|
-
--sc-base-800: #1e293b;
|
|
1082
|
-
--sc-base-900: #0f172a;
|
|
1083
|
-
--sc-base-content: var(--sc-base-700);
|
|
1084
|
-
|
|
1085
|
-
/*formulaires*/
|
|
1086
|
-
--sc-input-bg: var(--sc-base-100);
|
|
1087
|
-
--sc-input-color: var(--sc-base-content);
|
|
1088
|
-
}
|
|
1089
|
-
`,er=_`
|
|
1090
|
-
--sc-primary: var(--sc-dark-primary, var(--sc-base-700));
|
|
1091
|
-
--sc-info: var(--sc-dark-info, #3abff8);
|
|
1092
|
-
--sc-danger: var(--sc-dark-danger, #f87272);
|
|
1093
|
-
--sc-warning: var(--sc-dark-warning, #fbbd23);
|
|
1094
|
-
--sc-success: var(--sc-dark-success, #36d399);
|
|
1095
|
-
|
|
1096
|
-
--sc-primary-content: var(--sc-dark-primary-content, #002b3d);
|
|
1097
|
-
--sc-info-content: var(--sc-dark-info-content, #002b3d);
|
|
1098
|
-
--sc-danger-content: var(--sc-dark-danger-content, #382800);
|
|
1099
|
-
--sc-warning-content: var(--sc-dark-warning-content, #382800);
|
|
1100
|
-
--sc-success-content: var(--sc-dark-success-content, #003320);
|
|
1101
|
-
|
|
1102
|
-
--sc-base: var(--sc-dark-base, #1d2634);
|
|
1103
|
-
--sc-base-50: var(--sc-dark-base-50, #1f2937);
|
|
1104
|
-
--sc-base-100: var(--sc-dark-base-100, #252c36);
|
|
1105
|
-
--sc-base-200: var(--sc-dark-base-200, #2c3543);
|
|
1106
|
-
--sc-base-300: var(--sc-dark-base-300, #38414e);
|
|
1107
|
-
--sc-base-400: var(--sc-dark-base-400, #515964);
|
|
1108
|
-
--sc-base-500: var(--sc-dark-base-500, #828891);
|
|
1109
|
-
--sc-base-600: var(--sc-dark-base-600, #b4b8be);
|
|
1110
|
-
--sc-base-700: var(--sc-dark-base-700, #cdd0d5);
|
|
1111
|
-
--sc-base-800: var(--sc-dark-base-800, #d9dce0);
|
|
1112
|
-
--sc-base-900: var(--sc-dark-base-900, #e5e7eb);
|
|
1113
|
-
--sc-base-content: var(--sc-dark-base-content, #e5e7eb);
|
|
1114
|
-
`,sr=_`
|
|
1115
|
-
:host([theme="dark"]) {
|
|
1116
|
-
${er}
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
@media (prefers-color-scheme: dark) {
|
|
1120
|
-
:host([theme="auto"]) {
|
|
1121
|
-
${er}
|
|
1122
|
-
}
|
|
1123
|
-
}
|
|
1124
|
-
`;var ir=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,or=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?rr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ir(e,s,o),o};let nr=class extends Rt{constructor(){super(...arguments),this.theme="light",this.background=!1,this.color=!1,this.font=!1}connectedCallback(){super.connectedCallback(),window.addEventListener("message",(t=>this.receiveMessage(t)),!1),this.postCSSVars()}postCSSVars(){var t;const e=document.styleSheets,s=e.length,i=[];for(let o=0;o<s;o++){const t=e[o];t.href&&(t.href.includes("googleapis")||t.href.includes("typekit.net"))&&i.push(t.href)}const r={variables:this.getCssVariables(),fonts:i};null==(t=ge.get("sonic-theme"))||t.set(r),document.querySelectorAll("iframe").forEach((t=>{var e;return null==(e=t.contentWindow)?void 0:e.postMessage({type:"SonicTheme",...r},"*")}))}receiveMessage(t){const e=t.data;e.type&&"GetSonicTheme"==e.type&&this.postCSSVars()}getCssVariables(){const t=[],e=[...nr.styles.map((t=>t.styleSheet)),...Array.from(document.styleSheets)];for(const o of e)try{if(!o)continue;const e=o.cssRules;for(const s of e){if(!("style"in s))continue;const e=s.style;for(const s of e)t.includes(s)||0!==s.indexOf("--sc")||t.push(s)}}catch(r){console.log("Erreur lors de la récupération des variables CSS")}const s=window.getComputedStyle(this),i={};return t.forEach((t=>i[t]=s.getPropertyValue(t))),i}render(){return xt`<slot></slot>`}};nr.styles=[tr,sr,Xi,_`
|
|
1125
|
-
:host([background]) {
|
|
1126
|
-
display: block !important;
|
|
1127
|
-
background: var(--sc-body-bg) !important;
|
|
1128
|
-
min-height: 100vh;
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
:host([color]) {
|
|
1132
|
-
color: var(--sc-base-content);
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
:host([font]) {
|
|
1136
|
-
font-family: var(--sc-font-family-base), sans-serif;
|
|
1137
|
-
font-weight: var(--sc-font-weight-base);
|
|
1138
|
-
font-style: var(--sc-font-style-base);
|
|
1139
|
-
}
|
|
1140
|
-
`],or([U({type:String,reflect:!0})],nr.prototype,"theme",2),or([U({type:Boolean,reflect:!0})],nr.prototype,"background",2),or([U({type:Boolean,reflect:!0})],nr.prototype,"color",2),or([U({type:Boolean,reflect:!0})],nr.prototype,"font",2),nr=or([m("sonic-theme")],nr);var ar=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,cr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?lr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ar(e,s,o),o};let hr=class extends Rt{constructor(){super(...arguments),this.type="default",this.variant="default",this.ellipsis=!1}render(){return xt`
|
|
1128
|
+
`],dr([F({type:Object})],pr.prototype,"composition",1),pr=dr([b("sonic-mix")],pr);var ur=Object.defineProperty,gr=Object.getOwnPropertyDescriptor;let br=class extends(Xs(Zt)){connectedCallback(){this.setAttribute("subDataProvider",this.getAttribute("key")),super.connectedCallback()}render(){return"object"==typeof this.props||void 0===this.props?pt`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`:pt`${te(this.props.toString())}<slot name="prefix"></slot><slot></slot
|
|
1129
|
+
><slot name="suffix"></slot>`}};br=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?gr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ur(e,s,o),o})([b("sonic-value")],br);var mr=Object.defineProperty,fr=Object.getOwnPropertyDescriptor,vr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?fr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&mr(e,s,o),o};let yr=class extends Zt{constructor(){super(...arguments),this.type="default",this.variant="default",this.ellipsis=!1}render(){return pt`
|
|
1141
1130
|
<slot name="prefix"></slot>
|
|
1142
1131
|
<slot></slot>
|
|
1143
1132
|
<slot name="suffix"></slot>
|
|
1144
|
-
`}};
|
|
1133
|
+
`}};yr.styles=[Be,x`
|
|
1145
1134
|
:host {
|
|
1146
1135
|
--sc-badge-gap: 0.3em;
|
|
1147
|
-
--sc-badge-py: 0.
|
|
1148
|
-
--sc-badge-px: 0.
|
|
1136
|
+
--sc-badge-py: 0.35em;
|
|
1137
|
+
--sc-badge-px: 0.67em;
|
|
1149
1138
|
--sc-fs: 1rem;
|
|
1150
1139
|
|
|
1151
1140
|
--sc-badge-color: var(--sc-base-content, #1f2937);
|
|
1152
1141
|
--sc-badge-bg: var(--sc-base-100, #e5e7eb);
|
|
1153
1142
|
|
|
1154
|
-
|
|
1143
|
+
/*--sc-badge-border-with: var(--sc-form-border-width, 0.1rem);*/
|
|
1144
|
+
--sc-badge-border-with: 1px;
|
|
1155
1145
|
--sc-badge-border-color: transparent;
|
|
1156
1146
|
--sc-badge-border: var(--sc-badge-border-with) solid var(--sc-badge-border-color);
|
|
1157
1147
|
|
|
@@ -1169,6 +1159,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1169
1159
|
|
|
1170
1160
|
font-family: var(--sc-badge-ff, var(--sc-font-family-base, inherit));
|
|
1171
1161
|
font-weight: var(--sc-badge-fw);
|
|
1162
|
+
line-height: 1;
|
|
1172
1163
|
|
|
1173
1164
|
padding-top: var(--sc-badge-py);
|
|
1174
1165
|
padding-bottom: var(--sc-badge-py);
|
|
@@ -1257,6 +1248,11 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1257
1248
|
background: transparent;
|
|
1258
1249
|
padding: 0;
|
|
1259
1250
|
}
|
|
1251
|
+
@media (forced-colors: active) {
|
|
1252
|
+
:host([variant="ghost"][type]) {
|
|
1253
|
+
padding: var(--sc-badge-py) var(--sc-badge-px);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1260
1256
|
|
|
1261
1257
|
:host([variant="ghost"][type="default"]) {
|
|
1262
1258
|
color: var(--sc-badge-color);
|
|
@@ -1280,23 +1276,28 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1280
1276
|
slot[name="prefix"] {
|
|
1281
1277
|
flex-shrink: 0;
|
|
1282
1278
|
}
|
|
1283
|
-
`],
|
|
1284
|
-
<a
|
|
1279
|
+
`],vr([F({type:String,reflect:!0})],yr.prototype,"type",2),vr([F({type:String,reflect:!0})],yr.prototype,"variant",2),vr([F({type:String,reflect:!0})],yr.prototype,"size",2),vr([F({type:Boolean,reflect:!0})],yr.prototype,"ellipsis",2),yr=vr([b("sonic-badge")],yr);class wr{static fixBlankLink(t){const e="undefined"==typeof require?null:require("electron");"_blank"==t.target&&t.addEventListener("click",(()=>{null==e||e.shell.openExternal(t.href)}))}}var xr=Object.defineProperty,_r=Object.getOwnPropertyDescriptor,kr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?_r(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&xr(e,s,o),o};let Ar=class extends Zt{constructor(){super(...arguments),this.href="",this._location="",this.ariaLabel=null,this.autoActive="partial",this._target=null,this.pushState=null}get location(){return this._location}set location(t){this._location=t,ye.updateComponentActiveState(this)}connectedCallback(){this.href&&0!=this.href.indexOf("http")&&(ye.onChange(this),this.location=document.location.href.replace(document.location.origin,"")),this.addEventListener("keypress",(t=>{var e,s;"Enter"===t.key&&(null==(s=null==(e=this.shadowRoot)?void 0:e.querySelector("a"))||s.click())})),this.setFocusable(),super.connectedCallback()}setFocusable(){this.href?this.setAttribute("tabIndex","0"):this.removeAttribute("tabIndex")}disconnectedCallback(){ye.offChange(this),super.disconnectedCallback()}set target(t){this._target=t,wr.fixBlankLink(this),this.requestUpdate()}get target(){return this._target}handlePushState(t){t.preventDefault(),ye.changeFromComponent(this)}updated(t){t.has("href")&&this.setFocusable()}render(){return this.href?pt`
|
|
1280
|
+
<a
|
|
1281
|
+
href="${this.href}"
|
|
1282
|
+
aria-label=${this.ariaLabel||gt}
|
|
1283
|
+
target=${Ve(this.target)}
|
|
1284
|
+
@click=${this.pushState?this.handlePushState:null}
|
|
1285
|
+
>
|
|
1285
1286
|
<slot></slot>
|
|
1286
1287
|
</a>
|
|
1287
|
-
`:
|
|
1288
|
+
`:pt`<slot></slot>`}};Ar.styles=[x`
|
|
1288
1289
|
a {
|
|
1289
1290
|
color: inherit;
|
|
1290
1291
|
text-decoration: none;
|
|
1291
1292
|
display: contents;
|
|
1292
1293
|
}
|
|
1293
|
-
`],
|
|
1294
|
-
<progress value=${
|
|
1294
|
+
`],kr([F({type:String})],Ar.prototype,"href",2),kr([F({type:String,attribute:"data-aria-label"})],Ar.prototype,"ariaLabel",2),kr([F({type:String})],Ar.prototype,"autoActive",2),kr([F({type:String})],Ar.prototype,"target",1),kr([F({type:Boolean})],Ar.prototype,"pushState",2),Ar=kr([b("sonic-link")],Ar);var Pr=Object.defineProperty,Cr=Object.getOwnPropertyDescriptor,Sr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Cr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Pr(e,s,o),o};let $r=class extends Zt{constructor(){super(...arguments),this.max=100,this.invert=!1,this.type="default",this.size="md"}render(){return pt`
|
|
1295
|
+
<progress value=${Ve(this.value)} max=${this.max}></progress>
|
|
1295
1296
|
<div class="slot-container">
|
|
1296
1297
|
<slot></slot>
|
|
1297
1298
|
<slot name="remaining"></slot>
|
|
1298
1299
|
</div>
|
|
1299
|
-
`}}
|
|
1300
|
+
`}};$r.styles=[Be,x`
|
|
1300
1301
|
:host {
|
|
1301
1302
|
--sc-progress-bg: var(--sc-input-bg, var(--sc-base-100, #f5f5f5));
|
|
1302
1303
|
--sc-progress-color: var(--sc-base-content, #1f2937);
|
|
@@ -1399,7 +1400,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1399
1400
|
gap: 0.5em;
|
|
1400
1401
|
margin-top: 0.15em;
|
|
1401
1402
|
}
|
|
1402
|
-
`],
|
|
1403
|
+
`],Sr([F({type:Number})],$r.prototype,"value",2),Sr([F({type:Number})],$r.prototype,"max",2),Sr([F({type:Boolean})],$r.prototype,"invert",2),Sr([F({type:String,reflect:!0})],$r.prototype,"type",2),Sr([F({type:String,reflect:!0})],$r.prototype,"size",2),$r=Sr([b("sonic-progress")],$r);const Or=x`
|
|
1403
1404
|
.password-toggle {
|
|
1404
1405
|
color: var(--sc-input-c);
|
|
1405
1406
|
font-size: var(--sc-input-fs);
|
|
@@ -1410,7 +1411,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1410
1411
|
:host([inlineContent]) .has-suffix .password-toggle {
|
|
1411
1412
|
margin-right: 0;
|
|
1412
1413
|
}
|
|
1413
|
-
`,
|
|
1414
|
+
`,Dr=x`
|
|
1414
1415
|
:host {
|
|
1415
1416
|
--sc-label-fs: var(--sc-fs, 1rem);
|
|
1416
1417
|
--sc-label-fw: var(--sc-label-font-weight);
|
|
@@ -1424,14 +1425,14 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1424
1425
|
margin-bottom: 0.22em;
|
|
1425
1426
|
display: block;
|
|
1426
1427
|
}
|
|
1427
|
-
`,
|
|
1428
|
+
`,Lr=x`
|
|
1428
1429
|
.form-description {
|
|
1429
1430
|
color: var(--sc-base-400);
|
|
1430
1431
|
font-size: 0.85em;
|
|
1431
1432
|
margin-top: 0.2em;
|
|
1432
1433
|
display: block;
|
|
1433
1434
|
}
|
|
1434
|
-
`,
|
|
1435
|
+
`,Er=x`
|
|
1435
1436
|
* {
|
|
1436
1437
|
box-sizing: border-box;
|
|
1437
1438
|
}
|
|
@@ -1464,13 +1465,11 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1464
1465
|
|
|
1465
1466
|
line-height: 1.1;
|
|
1466
1467
|
color: var(--sc-input-c);
|
|
1467
|
-
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
1468
|
-
var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
|
|
1468
|
+
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
|
|
1469
1469
|
|
|
1470
1470
|
font-family: var(--sc-input-ff);
|
|
1471
1471
|
background-color: var(--sc-input-background);
|
|
1472
|
-
border: var(--sc-input-b-width) solid
|
|
1473
|
-
var(--sc-input-b-color, var(--sc-base-300, #aaa));
|
|
1472
|
+
border: var(--sc-input-b-width) solid var(--sc-input-b-color, var(--sc-base-300, #aaa));
|
|
1474
1473
|
width: 100%;
|
|
1475
1474
|
font-size: var(--sc-input-fs);
|
|
1476
1475
|
|
|
@@ -1479,6 +1478,10 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1479
1478
|
padding-left: var(--sc-input-px);
|
|
1480
1479
|
padding-right: var(--sc-input-px);
|
|
1481
1480
|
|
|
1481
|
+
transition:
|
|
1482
|
+
border-color 0.15s ease-in-out,
|
|
1483
|
+
color 0.15s ease-in-out,
|
|
1484
|
+
box-shadow 0.15s ease-in-out;
|
|
1482
1485
|
min-height: var(--sc-input-height);
|
|
1483
1486
|
}
|
|
1484
1487
|
|
|
@@ -1497,6 +1500,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1497
1500
|
justify-content: center;
|
|
1498
1501
|
line-height: 1.1;
|
|
1499
1502
|
flex-shrink: 0;
|
|
1503
|
+
border: var(--sc-input-b-width) solid transparent;
|
|
1500
1504
|
padding-left: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px)));
|
|
1501
1505
|
padding-right: clamp(0.25em, 3%, calc(0.33 * var(--sc-input-px)));
|
|
1502
1506
|
}
|
|
@@ -1517,6 +1521,11 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1517
1521
|
border: none;*/
|
|
1518
1522
|
}
|
|
1519
1523
|
|
|
1524
|
+
:host(:not([inlineContent])[disabled]) .has-suffix slot[name="suffix"],
|
|
1525
|
+
:host(:not([inlineContent])[disabled]) .has-prefix slot[name="prefix"] {
|
|
1526
|
+
opacity: 0.43;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1520
1529
|
:host(:not([inlineContent])) .has-prefix .form-element {
|
|
1521
1530
|
border-top-left-radius: 0;
|
|
1522
1531
|
border-bottom-left-radius: 0;
|
|
@@ -1599,7 +1608,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1599
1608
|
/*Disbaled*/
|
|
1600
1609
|
:host([disabled]) .form-element {
|
|
1601
1610
|
pointer-events: none;
|
|
1602
|
-
opacity: 0.
|
|
1611
|
+
opacity: 0.43;
|
|
1603
1612
|
/* border-color: transparent;*/
|
|
1604
1613
|
}
|
|
1605
1614
|
:host([disabled]) .select-chevron {
|
|
@@ -1688,8 +1697,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1688
1697
|
}
|
|
1689
1698
|
input[type="color"]::-webkit-color-swatch {
|
|
1690
1699
|
border: none;
|
|
1691
|
-
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr)
|
|
1692
|
-
var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
|
|
1700
|
+
border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl);
|
|
1693
1701
|
}
|
|
1694
1702
|
|
|
1695
1703
|
/*Input Image*/
|
|
@@ -1740,50 +1748,77 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1740
1748
|
:host([noAppearance]) input[type="number"] {
|
|
1741
1749
|
-moz-appearance: textfield !important;
|
|
1742
1750
|
}
|
|
1751
|
+
|
|
1752
|
+
/*type color "default" | "success" | "error" | "warning" | "info" */
|
|
1753
|
+
:host([status="success"]) {
|
|
1754
|
+
--sc-input-b-color: var(--sc-success);
|
|
1755
|
+
--sc-input-c: var(--sc-success);
|
|
1756
|
+
--sc-input-addon-bg: var(--sc-success);
|
|
1757
|
+
--sc-input-addon-color: var(--sc-success-content);
|
|
1758
|
+
}
|
|
1759
|
+
:host([status="error"]) {
|
|
1760
|
+
--sc-input-b-color: var(--sc-danger);
|
|
1761
|
+
--sc-input-c: var(--sc-danger);
|
|
1762
|
+
--sc-input-addon-bg: var(--sc-danger);
|
|
1763
|
+
--sc-input-addon-color: var(--sc-danger-content);
|
|
1764
|
+
}
|
|
1765
|
+
:host([status="warning"]) {
|
|
1766
|
+
--sc-input-b-color: var(--sc-warning);
|
|
1767
|
+
--sc-input-c: var(--sc-warning);
|
|
1768
|
+
--sc-input-addon-bg: var(--sc-warning);
|
|
1769
|
+
--sc-input-addon-color: var(--sc-warning-content);
|
|
1770
|
+
}
|
|
1771
|
+
:host([status="info"]) {
|
|
1772
|
+
--sc-input-b-color: var(--sc-info);
|
|
1773
|
+
--sc-input-c: var(--sc-info);
|
|
1774
|
+
--sc-input-addon-bg: var(--sc-info);
|
|
1775
|
+
--sc-input-addon-color: var(--sc-info-content);
|
|
1776
|
+
}
|
|
1743
1777
|
`
|
|
1744
1778
|
/**
|
|
1745
1779
|
* @license
|
|
1746
1780
|
* Copyright 2018 Google LLC
|
|
1747
1781
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1748
|
-
*/,
|
|
1749
|
-
<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}"
|
|
1750
|
-
>${this.label?
|
|
1782
|
+
*/,jr=Rt(class extends Ft{constructor(t){var e;if(super(t),t.type!==Nt||"class"!==t.name||(null==(e=t.strings)?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var s,i;if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null==(s=this.st)?void 0:s.has(t))&&this.it.add(t);return this.render(e)}const r=t.element.classList;for(const o of this.it)o in e||(r.remove(o),this.it.delete(o));for(const o in e){const t=!!e[o];t===this.it.has(o)||(null==(i=this.st)?void 0:i.has(o))||(t?(r.add(o),this.it.add(o)):(r.remove(o),this.it.delete(o)))}return ut}});var Mr=Object.defineProperty,Ir=Object.getOwnPropertyDescriptor,Tr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ir(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Mr(e,s,o),o};let Nr=class extends(Zs(Se(he(Zt)))){constructor(){super(...arguments),this.readonly=!1,this.inlineContent=!1,this.disableInlineContentFocus=!1,this.showPasswordToggle=!1,this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1,this.isPassword=!1}connectedCallback(){if(super.connectedCallback(),this.hasSlotOrProps(),this.hasAttribute("sameValueAs")){this.sameValueAsName=this.getAttribute("sameValueAs"),this.sameValueAsHandle=t=>this.pattern=this.escapeRegExp(t);const t=this.getFormPublisher();if(!t)return;t[this.sameValueAsName].onAssign(this.sameValueAsHandle)}"password"==this.type&&(this.isPassword=!0,this.showPasswordToggle=!0,this.inlineContent=!0)}disconnectedCallback(){if(super.disconnectedCallback(),this.hasAttribute("sameValueAs")&&this.sameValueAsName){const t=this.getFormPublisher();if(!t)return;t[this.sameValueAsName].offAssign(this.sameValueAsHandle)}}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}willUpdate(t){this.hasSlotOrProps(),super.willUpdate(t)}setSelectionRange(t,e){this.input.setSelectionRange(t,e)}hasSlotOrProps(){var t,e,s,i;this.hasLabel=!(!this.label&&!(null==(t=this.slotLabelNodes)?void 0:t.length)),this.hasDescription=!(!this.description&&!(null==(e=this.slotDescriptionNodes)?void 0:e.length)),this.hasSuffix=!!(null==(s=this.slotSuffixNodes)?void 0:s.length),this.hasPrefix=!!(null==(i=this.slotPrefixNodes)?void 0:i.length)}inlineContentFocus(){var t;this.inlineContent&&!this.disableInlineContentFocus&&(null==(t=this.input)||t.focus())}handleChange(t){this.hasAttribute("inputDelayMs")?(this.changeTimeoutId&&clearTimeout(this.changeTimeoutId),this.changeTimeoutId=setTimeout((()=>super.handleChange(t)),parseInt(this.getAttribute("inputDelayMs")))):super.handleChange(t)}togglePasswordVisibility(){this.isPassword=!this.isPassword,this._type=this.isPassword?"password":"text"}render(){const t={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix,"no-suffix":!this.hasSuffix,"no-prefix":!this.hasPrefix};return pt`
|
|
1783
|
+
<label for="${this.id||"form-element"}" class="${this.hasLabel?"form-label":"hidden"}"
|
|
1784
|
+
>${this.label?te(this.label):""}<slot
|
|
1751
1785
|
name="label"
|
|
1752
1786
|
@slotchange=${this.hasSlotOrProps}
|
|
1753
1787
|
></slot
|
|
1754
1788
|
></label>
|
|
1755
1789
|
|
|
1756
|
-
<div @click=${this.inlineContentFocus} class="form-control ${
|
|
1757
|
-
<div class="${this.inlineContent?"form-element form-element-wrapper":"contents"}">
|
|
1790
|
+
<div @click=${this.inlineContentFocus} class="form-control ${jr(t)}">
|
|
1791
|
+
<div part="content" class="${this.inlineContent?"form-element form-element-wrapper":"contents"}">
|
|
1758
1792
|
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
1759
1793
|
<input
|
|
1760
|
-
|
|
1794
|
+
part="input"
|
|
1795
|
+
id=${Ve(this.id||"form-element")}
|
|
1761
1796
|
part="input"
|
|
1762
1797
|
class="form-element input"
|
|
1763
1798
|
@input=${this.handleChange}
|
|
1764
1799
|
@blur=${this.handleBlur}
|
|
1765
1800
|
type=${this.type}
|
|
1766
|
-
disabled=${
|
|
1801
|
+
disabled=${Ve(this.disabled)}
|
|
1767
1802
|
?readonly=${this.readonly}
|
|
1768
1803
|
?autofocus=${this.autofocus}
|
|
1769
|
-
list=${
|
|
1770
|
-
tabindex=${
|
|
1771
|
-
pattern=${
|
|
1772
|
-
min=${
|
|
1773
|
-
max=${
|
|
1774
|
-
step=${
|
|
1775
|
-
src=${
|
|
1776
|
-
minlength=${
|
|
1777
|
-
maxlength=${
|
|
1778
|
-
placeholder=${
|
|
1779
|
-
required=${
|
|
1780
|
-
autocomplete=${
|
|
1781
|
-
aria-label=${
|
|
1782
|
-
aria-labelledby=${
|
|
1804
|
+
list=${Ve(this.list)}
|
|
1805
|
+
tabindex=${Ve(this.tabindex)}
|
|
1806
|
+
pattern=${Ve(this.pattern)}
|
|
1807
|
+
min=${Ve(this.min)}
|
|
1808
|
+
max=${Ve(this.max)}
|
|
1809
|
+
step=${Ve(this.step)}
|
|
1810
|
+
src=${Ve(this.src)}
|
|
1811
|
+
minlength=${Ve(this.minlength)}
|
|
1812
|
+
maxlength=${Ve(this.maxlength)}
|
|
1813
|
+
placeholder=${Ve(this.placeholder)}
|
|
1814
|
+
required=${Ve(this.required)}
|
|
1815
|
+
autocomplete=${Ve(this.autocomplete)}
|
|
1816
|
+
aria-label=${Ve(this.ariaLabel)}
|
|
1817
|
+
aria-labelledby=${Ve(this.ariaLabelledby)}
|
|
1783
1818
|
.name=${this.name}
|
|
1784
1819
|
.value=${this.value}
|
|
1785
1820
|
/>
|
|
1786
|
-
${this.showPasswordToggle?
|
|
1821
|
+
${this.showPasswordToggle?pt`<sonic-button
|
|
1787
1822
|
shape="circle"
|
|
1788
1823
|
class="password-toggle"
|
|
1789
1824
|
@click=${this.togglePasswordVisibility}
|
|
@@ -1795,16 +1830,16 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1795
1830
|
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
1796
1831
|
</div>
|
|
1797
1832
|
</div>
|
|
1833
|
+
|
|
1834
|
+
<!-- le slot ne doit pas avoir d'espace-->
|
|
1798
1835
|
<slot
|
|
1799
1836
|
name="description"
|
|
1800
1837
|
@slotchange=${this.hasSlotOrProps}
|
|
1801
1838
|
class="${this.hasDescription?"form-description":"hidden"}"
|
|
1802
|
-
>
|
|
1803
|
-
${this.description?xt`${cs(this.description)}`:""}
|
|
1804
|
-
</slot>
|
|
1839
|
+
>${this.description?pt`${te(this.description)}`:gt}</slot>
|
|
1805
1840
|
<slot name="list"></slot>
|
|
1806
1841
|
</div>
|
|
1807
|
-
`}}
|
|
1842
|
+
`}};Nr.styles=[Be,Er,Dr,Lr,Or,x`
|
|
1808
1843
|
:host([type="hidden"]) {
|
|
1809
1844
|
appearance: none !important;
|
|
1810
1845
|
display: none !important;
|
|
@@ -1812,21 +1847,17 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1812
1847
|
:host > .form-control {
|
|
1813
1848
|
position: relative;
|
|
1814
1849
|
}
|
|
1815
|
-
`],
|
|
1816
|
-
<slot
|
|
1817
|
-
@click=${this._toggle}
|
|
1818
|
-
@keydown=${this._toggle}
|
|
1819
|
-
class="contents"
|
|
1820
|
-
></slot>
|
|
1850
|
+
`],Tr([F({type:String,reflect:!0})],Nr.prototype,"size",2),Tr([F({type:String})],Nr.prototype,"list",2),Tr([F({type:String})],Nr.prototype,"placeholder",2),Tr([F({type:String})],Nr.prototype,"pattern",2),Tr([F({type:String})],Nr.prototype,"min",2),Tr([F({type:String})],Nr.prototype,"max",2),Tr([F({type:Boolean})],Nr.prototype,"readonly",2),Tr([F({type:Number})],Nr.prototype,"step",2),Tr([F({type:Number})],Nr.prototype,"minlength",2),Tr([F({type:Number})],Nr.prototype,"maxlength",2),Tr([F({type:String})],Nr.prototype,"src",2),Tr([F({type:Boolean,reflect:!0})],Nr.prototype,"inlineContent",2),Tr([F({type:Boolean})],Nr.prototype,"disableInlineContentFocus",2),Tr([F({type:Boolean})],Nr.prototype,"showPasswordToggle",2),Tr([q({slot:"label",flatten:!0})],Nr.prototype,"slotLabelNodes",2),Tr([q({slot:"description",flatten:!0})],Nr.prototype,"slotDescriptionNodes",2),Tr([q({slot:"suffix",flatten:!0})],Nr.prototype,"slotSuffixNodes",2),Tr([q({slot:"prefix",flatten:!0})],Nr.prototype,"slotPrefixNodes",2),Tr([B("input")],Nr.prototype,"input",2),Tr([U()],Nr.prototype,"hasDescription",2),Tr([U()],Nr.prototype,"hasLabel",2),Tr([U()],Nr.prototype,"hasSuffix",2),Tr([U()],Nr.prototype,"hasPrefix",2),Tr([U()],Nr.prototype,"isPassword",2),Nr=Tr([b("sonic-input")],Nr);var zr=Object.defineProperty,Rr=Object.getOwnPropertyDescriptor,Fr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Rr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&zr(e,s,o),o};let Ur=class extends Zt{constructor(){super(...arguments),this.open=!1,this.noToggle=!1,this.inline=!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.ancestorsHavingZIndex=new Set}runPositioningLoop(){this.positioningRuns&&(this.positioningRuns=!0,this.computePosition(this.placement),window.requestAnimationFrame((()=>this.runPositioningLoop())))}toggle(t){if(this.open&&this.noToggle)return;const e=t;("keydown"!=t.type||"ArrowDown"==e.key&&!this.open)&&(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.dispatchEvent(new CustomEvent("hide"))}setMaxZindex(){s.everyAncestors(this,(t=>{const e=t;if(!e.className)return!0;if([...e.classList].includes("@container")){const s=e.style;s.zIndex="999999999";const i=getComputedStyle(e);return"relative"!==i.position&&"absolute"!==i.position&&(s.position="relative"),this.ancestorsHavingZIndex.add(t),!1}return!0}))}resetZindexes(){this.ancestorsHavingZIndex.forEach((t=>{t.style.removeProperty("position"),t.style.removeProperty("z-index")})),this.ancestorsHavingZIndex.clear()}_handleClosePop(t){const e=t.composedPath(),i=e[0];Ur.pops.forEach((r=>{const o=e.includes(r),n=e.includes(r.querySelector('[slot="content"]')),a="keep"===s.getAncestorAttributeValue(i,"data-on-select");"pointerdown"==t.type&&o||"click"==t.type&&(o&&a||!n)||r.hide()}))}connectedCallback(){super.connectedCallback(),0==Ur.pops.size&&(document.addEventListener("pointerdown",this._handleClosePop),document.addEventListener("click",this._handleClosePop)),Ur.pops.add(this)}firstUpdated(t){super.firstUpdated(t),this.resizeObserver.observe(this.popContent)}disconnectedCallback(){super.disconnectedCallback(),Ur.pops.delete(this),0==Ur.pops.size&&(document.removeEventListener("pointerdown",this._handleClosePop),document.removeEventListener("click",this._handleClosePop)),this.resizeObserver.unobserve(this.popContent)}computePosition(t){var e,s,i;let r=null==(e=this.popContent)?void 0:e.getBoundingClientRect();const o=this.getBoundingClientRect(),n=o.left,a=o.top;let l=n,c=a;const h=a-r.height-8,d=n-r.width-8,p=n+o.width+8,u=a+o.height+8;switch(t){case"bottom":c=u;break;case"top":c=h;break;case"left":l=d;break;case"right":l=p}this.lastContentX+=l-r.x,this.lastContentY+=c-r.y,Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),r=null==(s=this.popContent)?void 0:s.getBoundingClientRect(),r.x<5&&"left"==t&&(l=p),r.y<5&&"top"==t&&(c=u),r.x+r.width>window.innerWidth-5&&"right"==t&&(l=d),r.y+r.height>window.innerHeight-5&&"bottom"==t&&(c=h),this.lastContentX+=l-r.x,this.lastContentY+=c-r.y,Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`}),r=null==(i=this.popContent)?void 0:i.getBoundingClientRect(),r.x<0&&(this.lastContentX+=-r.x),r.y<0&&(this.lastContentY+=-r.y),r.x+r.width>window.innerWidth&&(this.lastContentX+=window.innerWidth-(r.x+r.width)),r.y+r.height>window.innerHeight&&(this.lastContentY+=window.innerHeight-(r.y+r.height)),Object.assign(this.popContent.style,{left:`${this.lastContentX}px`,top:`${this.lastContentY}px`})}render(){return pt`
|
|
1851
|
+
<slot @click=${this.toggle} @keydown=${this.toggle} class="contents"></slot>
|
|
1821
1852
|
<slot
|
|
1822
1853
|
name="content"
|
|
1823
1854
|
tabindex="-1"
|
|
1824
1855
|
part="content"
|
|
1825
1856
|
style="display: none;"
|
|
1826
1857
|
class="
|
|
1827
|
-
|
|
1858
|
+
${this.open?"is-open":""}"
|
|
1828
1859
|
></slot>
|
|
1829
|
-
`}};
|
|
1860
|
+
`}};Ur.pops=new Set,Ur.styles=[x`
|
|
1830
1861
|
:host {
|
|
1831
1862
|
display: inline-block;
|
|
1832
1863
|
vertical-align: middle;
|
|
@@ -1834,8 +1865,8 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1834
1865
|
slot[name="content"] {
|
|
1835
1866
|
max-width: 80vw;
|
|
1836
1867
|
background-color: var(--sc-base);
|
|
1837
|
-
position:
|
|
1838
|
-
z-index:
|
|
1868
|
+
position: fixed;
|
|
1869
|
+
z-index: 99999;
|
|
1839
1870
|
display: block;
|
|
1840
1871
|
transform: translateY(1rem) scale(0.95);
|
|
1841
1872
|
opacity: 0;
|
|
@@ -1876,17 +1907,17 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1876
1907
|
:host([inline]) {
|
|
1877
1908
|
vertical-align: baseline;
|
|
1878
1909
|
}
|
|
1879
|
-
`],
|
|
1910
|
+
`],Fr([U()],Ur.prototype,"open",2),Fr([B("slot:not([name=content])")],Ur.prototype,"popBtn",2),Fr([B("slot[name=content]")],Ur.prototype,"popContent",2),Fr([F({type:Boolean})],Ur.prototype,"noToggle",2),Fr([F({type:Boolean,reflect:!0})],Ur.prototype,"inline",2),Fr([F({type:String,reflect:!0})],Ur.prototype,"shadow",2),Fr([F({type:String})],Ur.prototype,"placement",2),Ur=Fr([b("sonic-pop")],Ur);var Vr=Object.defineProperty,Br=Object.getOwnPropertyDescriptor;let Hr=class extends Ke{constructor(){super()}connectedCallback(){this.hasAttribute("variant")||(this.variant="ghost"),this.hasAttribute("type")||(this.type="primary"),this.hasAttribute("shape")||(this.shape="block");const t="square"===this.shape||"circle"===this.shape;this.hasAttribute("align")||t||(this.align="left"),super.connectedCallback()}};Hr=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?Br(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Vr(e,s,o),o})([b("sonic-menu-item")],Hr);class qr{constructor(t,{target:e,config:s,callback:i,skipInitial:r}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,null!==e&&this.t.add(e??t),this.l=s,this.o=r??this.o,this.callback=i,window.ResizeObserver?(this.u=new ResizeObserver((t=>{this.handleChanges(t),this.h.requestUpdate()})),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){var e;this.value=null==(e=this.callback)?void 0:e.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}var Wr=Object.defineProperty,Kr=Object.getOwnPropertyDescriptor,Zr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Kr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Wr(e,s,o),o};let Yr=class extends(ti(Js(Qs(Xs(Zt))))){constructor(){super(...arguments),this.size="md",this.placeholder="",this.filteredFields="",this.readonly=null,this.dataProviderExpression="",this.key="",this.searchParameter="",this.propertyName="",this.hasInputPrefix=!1,this._resizeController=new qr(this,{}),this.searchDataProvider="",this.initSearchDataProvider="",this.queueDataProvider="",this.initQueueDataProvider="",this.lastValidSearch="",this.updateSearchParameter=t=>{var e;if(""==t)return void(this.lastValidSearch="");!1===this.queryQueueListItem(this.queueDataProvider,this.findSelection,this.setSearchFromSelection)&&(this.lastValidSearch=t,null==(e=this.searchPublisher)||e.set(this.lastValidSearch))},this.initSearchParameter=()=>{this.queryQueueListItem(this.initQueueDataProvider,this.findSelection,this.setSearchFromSelection)},this.selectListItem=t=>{var e;const s="_self"===this.propertyName?t:t[this.propertyName||this.name];null==(e=this.formValuePublisher)||e.set(s)},this.findSearchedItem=t=>{var e;return("_self"===this.propertyName?t:t[this.propertyName||this.searchParameter||this.name])==(null==(e=this.searchPublisher)?void 0:e.get())},this.findSelection=t=>("_self"===this.propertyName?t:t[this.propertyName||this.name])==this.value,this.setSearchFromSelection=t=>{var e;this.lastValidSearch="_self"===this.propertyName?t:t[this.propertyName||this.searchParameter||this.name],null==(e=this.searchPublisher)||e.set(this.lastValidSearch)},this.updateActiveSelection=()=>{var t,e,s;this.queryQueueListItem(this.queueDataProvider,this.findSearchedItem,this.selectListItem),!this.select&&this.lastValidSearch&&this.lastValidSearch!=(null==(t=this.searchPublisher)?void 0:t.get())&&(null==(e=this.formValuePublisher)?void 0:e.get())&&(null==(s=this.formValuePublisher)||s.set(""))}}hasSlotOrProps(){var t;this.hasInputPrefix=!!(null==(t=this.slotInputPrefixNodes)?void 0:t.length)}connectedCallback(){var t,e,s;super.connectedCallback();const i=this.searchParameter||this.name,r=this.getAncestorAttributeValue("formDataProvider"),o=r+"__"+this.name+"__autocomplete";this.initSearchDataProvider=`${o}_init_search__`,this.initQueueDataProvider=`${o}_init_queue__`,this.searchDataProvider=`${o}_search__`,this.queueDataProvider=`${o}_queue__`;const n=Te.get;this.searchPublisher=n(this.searchDataProvider)[i],this.formValuePublisher=n(r)[this.name],this.countPublisher=n(this.queueDataProvider).resultCount,this.initCountPublisher=n(this.initQueueDataProvider).resultCount,this.value&&(Te.get(this.initSearchDataProvider)[this.name]=this.value),null==(t=this.initCountPublisher)||t.onAssign(this.initSearchParameter),null==(e=this.formValuePublisher)||e.onAssign(this.updateSearchParameter),null==(s=this.countPublisher)||s.onAssign(this.updateActiveSelection)}disconnectedCallback(){var t,e,s;super.disconnectedCallback(),null==(t=this.initCountPublisher)||t.offAssign(this.initSearchParameter),null==(e=this.formValuePublisher)||e.offAssign(this.updateSearchParameter),null==(s=this.countPublisher)||s.offAssign(this.updateActiveSelection);const i=Te.get;i(this.initSearchDataProvider).delete(),i(this.initQueueDataProvider).delete(),i(this.searchDataProvider).delete(),i(this.queueDataProvider).delete()}queryQueueListItem(t,e,s){let i;const r=Te.get(t).get();if(Array.isArray(r)){for(const t of r){const s=Te.get(t.dataProvider).get();if(Array.isArray(s)&&(i=s.find(e),i))break}return!!i&&(s(i),!0)}}setSelectionRange(t,e){var s;null==(s=this.querySelector("sonic-input"))||s.setSelectionRange(t,e)}handleHide(){var t,e,s;if(this.select)return""==(null==(t=this.searchPublisher)?void 0:t.get())?(this.lastValidSearch="",void(null==(e=this.formValuePublisher)||e.set(""))):void(null==(s=this.searchPublisher)||s.set(this.lastValidSearch))}render(){return pt`
|
|
1880
1911
|
<sonic-pop noToggle style="display:block;" @hide=${this.handleHide}>
|
|
1881
1912
|
<sonic-input
|
|
1882
1913
|
dataProvider="${this.initSearchDataProvider+Math.random()}"
|
|
1883
1914
|
formDataProvider="${this.searchDataProvider}"
|
|
1884
1915
|
type="search"
|
|
1885
1916
|
data-keyboard-nav="${this.getAttribute("data-keyboard-nav")||""}"
|
|
1886
|
-
label="${
|
|
1887
|
-
description="${
|
|
1888
|
-
name="${
|
|
1889
|
-
placeholder="${
|
|
1917
|
+
label="${Ve(this.label)}"
|
|
1918
|
+
description="${Ve(this.description)}"
|
|
1919
|
+
name="${Ve(this.searchParameter||this.name)}"
|
|
1920
|
+
placeholder="${Ve(this.placeholder)}"
|
|
1890
1921
|
?readonly="${this.readonly}"
|
|
1891
1922
|
autocomplete="off"
|
|
1892
1923
|
clearable
|
|
@@ -1895,7 +1926,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1895
1926
|
>
|
|
1896
1927
|
<slot name="prefix" slot="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
1897
1928
|
|
|
1898
|
-
${this.select?
|
|
1929
|
+
${this.select?pt` <sonic-icon slot="suffix" class="select-chevron" name="nav-arrow-down" .size=${this.size}></sonic-icon> `:gt}
|
|
1899
1930
|
</sonic-input>
|
|
1900
1931
|
<sonic-menu slot="content" class="custom-scroll" style="${this.offsetWidth?`width: ${this.offsetWidth}px`:""}">
|
|
1901
1932
|
<sonic-queue
|
|
@@ -1910,6 +1941,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1910
1941
|
</sonic-queue>
|
|
1911
1942
|
<sonic-queue
|
|
1912
1943
|
noLazyload
|
|
1944
|
+
noLoader
|
|
1913
1945
|
dataProvider="${this.initQueueDataProvider}"
|
|
1914
1946
|
filteredFields=${this.filteredFields}
|
|
1915
1947
|
dataProviderExpression="${this.dataProviderExpression}"
|
|
@@ -1920,27 +1952,27 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1920
1952
|
</sonic-queue>
|
|
1921
1953
|
</sonic-menu>
|
|
1922
1954
|
</sonic-pop>
|
|
1923
|
-
`}};
|
|
1955
|
+
`}};Yr.styles=[xs,x`
|
|
1924
1956
|
:host {
|
|
1925
1957
|
display: block;
|
|
1926
1958
|
}
|
|
1927
1959
|
|
|
1928
1960
|
sonic-menu {
|
|
1929
1961
|
display: block;
|
|
1930
|
-
max-height: clamp(
|
|
1962
|
+
max-height: clamp(12rem, 20vh, 20rem);
|
|
1931
1963
|
min-width: 14rem;
|
|
1932
1964
|
width: 100%;
|
|
1933
1965
|
}
|
|
1934
|
-
`],
|
|
1966
|
+
`],Zr([F({type:String})],Yr.prototype,"size",2),Zr([F({type:String})],Yr.prototype,"placeholder",2),Zr([F()],Yr.prototype,"filteredFields",2),Zr([F({type:Boolean})],Yr.prototype,"readonly",2),Zr([F({type:String})],Yr.prototype,"dataProviderExpression",2),Zr([F({type:Boolean})],Yr.prototype,"select",2),Zr([F({type:String})],Yr.prototype,"key",2),Zr([F({type:String})],Yr.prototype,"searchParameter",2),Zr([F({type:String})],Yr.prototype,"propertyName",2),Zr([q({slot:"prefix",flatten:!0})],Yr.prototype,"slotInputPrefixNodes",2),Zr([U()],Yr.prototype,"hasInputPrefix",2),Yr=Zr([b("sonic-input-autocomplete")],Yr);var Gr=Object.defineProperty,Qr=Object.getOwnPropertyDescriptor,Jr=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Qr(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Gr(e,s,o),o};let Xr=class extends(Xs(Zt)){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=0==t.length,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)},Te.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].onAssign(this.checkValue))}disconnectedCallback(){this.checkValue&&this.name&&Te.get(this.getAncestorAttributeValue("formDataProvider"))[this.name].offAssign(this.checkValue),super.disconnectedCallback()}getIcon(t){return t?pt`<sonic-icon library="heroicons" name="face-smile"></sonic-icon>`:pt`<sonic-icon library="heroicons" name="x-mark"></sonic-icon>`}render(){return this.hasNoChar?gt:pt`
|
|
1935
1967
|
<div>${this.wording_password_helper_decription}</div>
|
|
1936
1968
|
<div>${this.getIcon(this.hasEnoughChars)} ${this.wording_password_helper_min_length}</div>
|
|
1937
1969
|
<div>${this.getIcon(this.hasMinuscule)} ${this.wording_password_helper_lower_case}</div>
|
|
1938
1970
|
<div>${this.getIcon(this.hasMajuscule)} ${this.wording_password_helper_upper_case}</div>
|
|
1939
1971
|
<div>${this.getIcon(this.hasNumber)} ${this.wording_password_helper_number}</div>
|
|
1940
1972
|
<div>${this.getIcon(this.hasSpecialChar)} ${this.wording_password_helper_special_char}</div>
|
|
1941
|
-
`}};
|
|
1942
|
-
<span> ${this.areEqual?
|
|
1943
|
-
`}};
|
|
1973
|
+
`}};Jr([F()],Xr.prototype,"name",2),Jr([F()],Xr.prototype,"minChars",2),Jr([U()],Xr.prototype,"hasNoChar",2),Jr([U()],Xr.prototype,"hasEnoughChars",2),Jr([U()],Xr.prototype,"hasMinuscule",2),Jr([U()],Xr.prototype,"hasMajuscule",2),Jr([U()],Xr.prototype,"hasNumber",2),Jr([U()],Xr.prototype,"hasSpecialChar",2),Jr([F()],Xr.prototype,"wording_password_helper_decription",2),Jr([F()],Xr.prototype,"wording_password_helper_min_length",2),Jr([F()],Xr.prototype,"wording_password_helper_lower_case",2),Jr([F()],Xr.prototype,"wording_password_helper_upper_case",2),Jr([F()],Xr.prototype,"wording_password_helper_number",2),Jr([F()],Xr.prototype,"wording_password_helper_special_char",2),Xr=Jr([b("sonic-password-helper")],Xr);var to=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,so=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?eo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&to(e,s,o),o};let io=class extends(Xs(Zt)){constructor(){super(...arguments),this.descriptionWhenEqual="Correspondance : oui",this.descriptionWhenNotEqual="Correspondance : non",this.areEqual=!1,this.hasNoChar=!0}connectedCallback(){super.connectedCallback();const t=Te.get(this.getAncestorAttributeValue("formDataProvider"));this.name&&this.sameValueAs&&(this.checkValue=e=>{this.hasNoChar=!e||0==e.length,this.name&&this.sameValueAs&&(this.areEqual=t[this.name].get()==t[this.sameValueAs].get())},t[this.name].onAssign(this.checkValue),t[this.sameValueAs].onAssign(this.checkValue))}disconnectedCallback(){if(this.checkValue&&this.name&&this.sameValueAs){const t=Te.get(this.getAncestorAttributeValue("formDataProvider"));t[this.name].offAssign(this.checkValue),t[this.sameValueAs].offAssign(this.checkValue)}super.disconnectedCallback()}render(){return this.hasNoChar?gt:pt`
|
|
1974
|
+
<span> ${this.areEqual?te(this.descriptionWhenEqual):te(this.descriptionWhenNotEqual)} </span>
|
|
1975
|
+
`}};so([F()],io.prototype,"name",2),so([F()],io.prototype,"sameValueAs",2),so([F()],io.prototype,"descriptionWhenEqual",2),so([F()],io.prototype,"descriptionWhenNotEqual",2),so([U()],io.prototype,"areEqual",2),so([U()],io.prototype,"hasNoChar",2),io=so([b("sonic-same-value-helper")],io);var ro=Object.defineProperty,oo=Object.getOwnPropertyDescriptor,no=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?oo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ro(e,s,o),o};let ao=class extends(Ue(Zs(Se(he(Zt))))){constructor(){super(...arguments),this.touched=!1,this.iconName="check",this.indeterminateIconName="minus-small",this.showAsIndeterminate=!1,this.hasDescription=!1,this.hasLabel=!1}connectedCallback(){this.type="checkbox",this.hasSlotOrProps(),super.connectedCallback()}willUpdate(t){this.hasSlotOrProps(),super.willUpdate(t)}hasSlotOrProps(){var t,e;this.hasLabel=!(!this.label&&!(null==(t=this.slotLabelNodes)?void 0:t.length)),this.hasDescription=!(!this.description&&!(null==(e=this.slotDescriptionNodes)?void 0:e.length))}render(){return pt`
|
|
1944
1976
|
<label class="checkbox-container ${this.disabled?"disabled":""}">
|
|
1945
1977
|
|
|
1946
1978
|
<span class="icon-container">
|
|
@@ -1950,27 +1982,25 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
1950
1982
|
@blur=${this.handleBlur}
|
|
1951
1983
|
?required=${this.required}
|
|
1952
1984
|
?data-indeterminate=${this.showAsIndeterminate}
|
|
1953
|
-
.disabled=${
|
|
1954
|
-
.checked=${
|
|
1985
|
+
.disabled=${Ve(this.disabled)}
|
|
1986
|
+
.checked=${Ve(this.checked)}
|
|
1955
1987
|
.name=${this.name}
|
|
1956
1988
|
.value=${this.value}
|
|
1957
1989
|
?autofocus=${this.autofocus}
|
|
1958
|
-
aria-label=${
|
|
1959
|
-
aria-labelledby=${
|
|
1990
|
+
aria-label=${Ve(this.ariaLabel)}
|
|
1991
|
+
aria-labelledby=${Ve(this.ariaLabelledby)}
|
|
1960
1992
|
/>
|
|
1961
1993
|
<sonic-icon name="${"indeterminate"==this.checked||this.showAsIndeterminate?this.indeterminateIconName:this.iconName}" class="sc-input-icon"></sonic-icon>
|
|
1962
1994
|
</span>
|
|
1963
1995
|
|
|
1964
1996
|
<div class="checkbox-text ${this.hasDescription||this.hasLabel?"checkbox-text":"hidden"}">
|
|
1965
|
-
${this.label?
|
|
1997
|
+
${this.label?te(this.label):""}
|
|
1966
1998
|
<slot @slotchange=${this.hasSlotOrProps}></slot>
|
|
1967
|
-
<slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription?"description":"hidden"} ">
|
|
1968
|
-
${this.description?xt`${cs(this.description)}`:""}
|
|
1969
|
-
</slot>
|
|
1999
|
+
<slot @slotchange=${this.hasSlotOrProps} name="description" class="${this.hasDescription?"description":"hidden"} ">${this.description?pt`${te(this.description)}`:""}</slot>
|
|
1970
2000
|
</div>
|
|
1971
2001
|
</label>
|
|
1972
2002
|
</label>
|
|
1973
|
-
`}};
|
|
2003
|
+
`}};ao.styles=[Be,x`
|
|
1974
2004
|
:host {
|
|
1975
2005
|
--sc-checkbox-border-width: var(--sc-form-border-width);
|
|
1976
2006
|
--sc-checkbox-border-color: var(--sc-input-border-color);
|
|
@@ -2095,7 +2125,7 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
2095
2125
|
color:var(--sc-danger);
|
|
2096
2126
|
}
|
|
2097
2127
|
*/
|
|
2098
|
-
`],
|
|
2128
|
+
`],no([F({type:Boolean,reflect:!0})],ao.prototype,"touched",2),no([F({type:String})],ao.prototype,"iconName",2),no([F({type:String})],ao.prototype,"indeterminateIconName",2),no([F({type:Boolean})],ao.prototype,"showAsIndeterminate",2),no([F({type:Boolean})],ao.prototype,"hasDescription",2),no([F({type:Boolean})],ao.prototype,"hasLabel",2),no([q({flatten:!0})],ao.prototype,"slotLabelNodes",2),no([q({slot:"description",flatten:!0})],ao.prototype,"slotDescriptionNodes",2),ao=no([b("sonic-checkbox")],ao);var lo=Object.defineProperty,co=Object.getOwnPropertyDescriptor;let ho=class extends ao{constructor(){super(),this.radio=!0}connectedCallback(){super.connectedCallback(),this.type="radio"}};ho.styles=[ao.styles,x`
|
|
2099
2129
|
:host input {
|
|
2100
2130
|
border-radius: 50%;
|
|
2101
2131
|
}
|
|
@@ -2109,12 +2139,12 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
2109
2139
|
height: 0.6em;
|
|
2110
2140
|
width: 0.6em;
|
|
2111
2141
|
}
|
|
2112
|
-
`],
|
|
2142
|
+
`],ho=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?co(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&lo(e,s,o),o})([b("sonic-radio")],ho);var po=Object.defineProperty,uo=Object.getOwnPropertyDescriptor,go=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?uo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&po(e,s,o),o};let bo=class extends(Se(he(Zt))){constructor(){super(...arguments),this.valueKey="value",this.wordingKey="wording",this.multiple=!1,this.status="default",this._options=[],this.hasDoneFirstUpdate=!1,this._value="",this.updateOptions=()=>{const t=this.querySelectorAll("option");t.length>0&&(this.options=Array.from(t).map((t=>({value:t.value,wording:t.text,selected:t.hasAttribute("selected")}))))},this.forceAutoFill=!1,this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1}set options(t){this._options=t;for(const e of t)e.selected&&(this.value=e.value||"");!(this.value||this.getAttribute("value"))&&this._options.length>0&&(this.value=this._options[0][this.valueKey]),this.requestUpdate()}get options(){return this._options}firstUpdated(t){this.hasDoneFirstUpdate=!0,super.firstUpdated(t)}set value(t){(null!=t||this.hasDoneFirstUpdate)&&(t||(t=""),this._value!=t&&(this._value=t,this.updateFormPublisherValue(),this.requestUpdate()))}get value(){return this._value}updateFormPublisherValue(){const t=this.getFormPublisher();t&&(t[this.name]=this.value)}connectedCallback(){super.connectedCallback(),this.hasSlotOrProps(),this.updateOptions()}get description(){return this._description}set description(t){this.hasAttribute("description")&&!this.forceAutoFill&&(t=this.getAttribute("description")),this._description=t,this.requestUpdate()}get label(){return this._label}set label(t){this.hasAttribute("label")&&!this.forceAutoFill&&(t=this.getAttribute("label")),this._label=t,this.requestUpdate()}willUpdate(t){this.hasSlotOrProps(),super.willUpdate(t)}hasSlotOrProps(){var t,e,s,i;this.hasLabel=!(!this.label&&!(null==(t=this.slotLabelNodes)?void 0:t.length)),this.hasDescription=!(!this.description&&!(null==(e=this.slotDescriptionNodes)?void 0:e.length)),this.hasSuffix=!!(null==(s=this.slotSuffixNodes)?void 0:s.length),this.hasPrefix=!!(null==(i=this.slotPrefixNodes)?void 0:i.length)}validateFormElement(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("select");if(!e||e.checkValidity())return;const s=this.getFormPublisher();s&&(s.isFormValid=!1),e.reportValidity()}render(){const t={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix};return pt`
|
|
2113
2143
|
<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}"
|
|
2114
|
-
>${this.label?
|
|
2144
|
+
>${this.label?te(this.label):""}<slot name="label" @slotchange=${this.hasSlotOrProps}></slot
|
|
2115
2145
|
></label>
|
|
2116
2146
|
|
|
2117
|
-
<div class="form-control ${
|
|
2147
|
+
<div class="form-control ${jr(t)}">
|
|
2118
2148
|
<slot name="prefix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
2119
2149
|
<div class="form-select-wrapper">
|
|
2120
2150
|
<select
|
|
@@ -2124,14 +2154,14 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
2124
2154
|
?disabled=${this.disabled}
|
|
2125
2155
|
?required=${this.required}
|
|
2126
2156
|
?multiple=${this.multiple}
|
|
2127
|
-
size=${
|
|
2157
|
+
size=${Ve(this.selectSize)}
|
|
2128
2158
|
?autofocus=${this.autofocus}
|
|
2129
2159
|
.value="${this.value}"
|
|
2130
2160
|
class="form-element"
|
|
2131
|
-
aria-label=${
|
|
2132
|
-
aria-labelledby=${
|
|
2161
|
+
aria-label=${Ve(this.ariaLabel)}
|
|
2162
|
+
aria-labelledby=${Ve(this.ariaLabelledby)}
|
|
2133
2163
|
>
|
|
2134
|
-
${
|
|
2164
|
+
${Ye(this.options,(t=>t[this.valueKey]),(t=>{const e=this.value==t[this.valueKey];return pt`<option ?selected=${e} value="${t[this.valueKey]}">${t[this.wordingKey]}</option>`}))}
|
|
2135
2165
|
<slot></slot>
|
|
2136
2166
|
</select>
|
|
2137
2167
|
<sonic-icon class="select-chevron" name="nav-arrow-down" .size=${this.size}></sonic-icon>
|
|
@@ -2139,10 +2169,10 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
2139
2169
|
<slot name="suffix" @slotchange=${this.hasSlotOrProps}></slot>
|
|
2140
2170
|
</div>
|
|
2141
2171
|
|
|
2142
|
-
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription?"form-description":"hidden"}"
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
`}};
|
|
2172
|
+
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription?"form-description":"hidden"}"
|
|
2173
|
+
>${this.description?pt`${te(this.description)}`:""}</slot
|
|
2174
|
+
>
|
|
2175
|
+
`}};bo.styles=[Be,Er,Dr,Lr,x`
|
|
2146
2176
|
.form-element {
|
|
2147
2177
|
appearance: none;
|
|
2148
2178
|
}
|
|
@@ -2187,70 +2217,68 @@ function*(t,e){if(void 0!==t){let s=0;for(const i of t)yield e(i,s++)}}(this.pro
|
|
|
2187
2217
|
background: transparent;
|
|
2188
2218
|
padding: 0;
|
|
2189
2219
|
}
|
|
2190
|
-
`],
|
|
2191
|
-
<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}"
|
|
2192
|
-
>${this.label?
|
|
2220
|
+
`],go([F({type:String})],bo.prototype,"valueKey",2),go([F({type:String})],bo.prototype,"wordingKey",2),go([F({type:Boolean})],bo.prototype,"multiple",2),go([F({type:String,reflect:!0})],bo.prototype,"size",2),go([F({type:Number})],bo.prototype,"selectSize",2),go([F({type:String,reflect:!0})],bo.prototype,"status",2),go([F({type:Array})],bo.prototype,"options",1),go([F({reflect:!0})],bo.prototype,"value",1),go([F({type:Boolean})],bo.prototype,"forceAutoFill",2),go([F()],bo.prototype,"description",1),go([F()],bo.prototype,"label",1),go([q({slot:"label",flatten:!0})],bo.prototype,"slotLabelNodes",2),go([q({slot:"description",flatten:!0})],bo.prototype,"slotDescriptionNodes",2),go([q({slot:"suffix",flatten:!0})],bo.prototype,"slotSuffixNodes",2),go([q({slot:"prefix",flatten:!0})],bo.prototype,"slotPrefixNodes",2),go([U()],bo.prototype,"hasDescription",2),go([U()],bo.prototype,"hasLabel",2),go([U()],bo.prototype,"hasSuffix",2),go([U()],bo.prototype,"hasPrefix",2),bo=go([b("sonic-select")],bo);var mo=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,vo=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?fo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&mo(e,s,o),o};let yo=class extends(Zs(Se(he(Zt)))){constructor(){super(...arguments),this.size="",this.readonly=!1,this.hasDescription=!1,this.hasLabel=!1}connectedCallback(){super.connectedCallback(),this.hasSlotOrProps()}willUpdate(t){this.hasSlotOrProps(),super.willUpdate(t)}hasSlotOrProps(){var t,e;this.hasLabel=!(!this.label&&!(null==(t=this.slotLabelNodes)?void 0:t.length)),this.hasDescription=!(!this.description&&!(null==(e=this.slotDescriptionNodes)?void 0:e.length))}validateFormElement(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("textarea");if(!e||e.checkValidity())return;const s=this.getFormPublisher();s&&(s.isFormValid=!1),e.reportValidity()}render(){const t={resize:this.resize};return pt`
|
|
2221
|
+
<label for="${this.id||"form-element"}" class="${this.hasLabel?"form-label":"hidden"}"
|
|
2222
|
+
>${this.label?te(this.label):""}<slot name="label" @slotchange=${this.hasSlotOrProps}></slot
|
|
2193
2223
|
></label>
|
|
2194
2224
|
|
|
2195
2225
|
<div class="form-control">
|
|
2196
2226
|
<textarea
|
|
2197
|
-
id="form-element"
|
|
2227
|
+
id="${this.id||"form-element"}"
|
|
2198
2228
|
@input=${this.handleChange}
|
|
2199
2229
|
@blur=${this.handleBlur}
|
|
2200
|
-
disabled=${
|
|
2230
|
+
disabled=${Ve(this.disabled)}
|
|
2201
2231
|
?required=${this.required}
|
|
2202
2232
|
?autofocus=${this.autofocus}
|
|
2203
|
-
rows=${
|
|
2204
|
-
cols=${
|
|
2205
|
-
maxlength=${
|
|
2206
|
-
minlength=${
|
|
2233
|
+
rows=${Ve(this.rows)}
|
|
2234
|
+
cols=${Ve(this.cols)}
|
|
2235
|
+
maxlength=${Ve(this.maxlength)}
|
|
2236
|
+
minlength=${Ve(this.minlength)}
|
|
2207
2237
|
?readonly=${this.readonly}
|
|
2208
|
-
spellcheck=${
|
|
2209
|
-
autocomplete=${
|
|
2210
|
-
tabindex=${
|
|
2211
|
-
wrap=${
|
|
2238
|
+
spellcheck=${Ve(this.spellcheck)}
|
|
2239
|
+
autocomplete=${Ve(this.autocomplete)}
|
|
2240
|
+
tabindex=${Ve(this.tabindex)}
|
|
2241
|
+
wrap=${Ve(this.wrap)}
|
|
2212
2242
|
placeholder="${this.placeholder}"
|
|
2213
2243
|
class="form-element textarea custom-scroll"
|
|
2214
|
-
aria-label=${
|
|
2215
|
-
aria-labelledby=${
|
|
2244
|
+
aria-label=${Ve(this.ariaLabel)}
|
|
2245
|
+
aria-labelledby=${Ve(this.ariaLabelledby)}
|
|
2246
|
+
style=${_e(t)}
|
|
2216
2247
|
>
|
|
2217
2248
|
${this.value}</textarea
|
|
2218
2249
|
>
|
|
2219
2250
|
</div>
|
|
2220
2251
|
|
|
2221
|
-
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription?"form-description":"hidden"}"
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
`}};
|
|
2252
|
+
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription?"form-description":"hidden"}"
|
|
2253
|
+
>${this.description?pt`${te(this.description)}`:""}</slot
|
|
2254
|
+
>
|
|
2255
|
+
`}};yo.styles=[Be,Er,Dr,Lr,xs,x`
|
|
2225
2256
|
textarea {
|
|
2257
|
+
overflow-y: auto !important;
|
|
2226
2258
|
font-size: inherit;
|
|
2227
2259
|
}
|
|
2228
|
-
`],
|
|
2260
|
+
`],vo([F({type:String})],yo.prototype,"size",2),vo([F({type:Number})],yo.prototype,"rows",2),vo([F({type:Number})],yo.prototype,"cols",2),vo([F({type:Number})],yo.prototype,"maxlength",2),vo([F({type:Number})],yo.prototype,"minlength",2),vo([F({type:String})],yo.prototype,"wrap",2),vo([F({type:Boolean})],yo.prototype,"readonly",2),vo([F({type:String})],yo.prototype,"placeholder",2),vo([F({type:String})],yo.prototype,"resize",2),vo([q({slot:"label",flatten:!0})],yo.prototype,"slotLabelNodes",2),vo([q({slot:"description",flatten:!0})],yo.prototype,"slotDescriptionNodes",2),vo([U()],yo.prototype,"hasDescription",2),vo([U()],yo.prototype,"hasLabel",2),yo=vo([b("sonic-textarea")],yo);var wo=Object.defineProperty,xo=Object.getOwnPropertyDescriptor;let _o=class extends Zt{render(){return pt`<slot></slot>`}};_o.styles=[x`
|
|
2229
2261
|
:host {
|
|
2230
|
-
|
|
2231
|
-
font-size: 1.25rem;
|
|
2262
|
+
font-size: 1.15rem;
|
|
2232
2263
|
line-height: 1.2;
|
|
2233
2264
|
display: block;
|
|
2265
|
+
color: var(--sc-base-500);
|
|
2234
2266
|
font-weight: var(--sc-font-weight-base);
|
|
2235
2267
|
font-style: var(--sc-font-style-base);
|
|
2236
|
-
margin-top: 0.
|
|
2237
|
-
}
|
|
2238
|
-
`],
|
|
2239
|
-
${this.iconName?
|
|
2240
|
-
<sonic-icon
|
|
2241
|
-
name=${this.iconName}
|
|
2242
|
-
prefix=${we(this.iconPrefix)}
|
|
2243
|
-
library=${we(this.iconLibrary)}
|
|
2244
|
-
></sonic-icon>
|
|
2268
|
+
margin-top: 0.2em;
|
|
2269
|
+
}
|
|
2270
|
+
`],_o=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?xo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&wo(e,s,o),o})([b("sonic-legend-description")],_o);var ko=Object.defineProperty,Ao=Object.getOwnPropertyDescriptor,Po=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ao(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ko(e,s,o),o};let Co=class extends Zt{constructor(){super(...arguments),this.forceAutoFill=!1}get description(){return this._description}set description(t){this.hasAttribute("description")&&!this.forceAutoFill&&(t=this.getAttribute("description")),this._description=t,this.requestUpdate()}get label(){return this._label}set label(t){this.hasAttribute("label")&&!this.forceAutoFill&&(t=this.getAttribute("label")),this._label=t,this.requestUpdate()}render(){return pt`<legend part="legend">
|
|
2271
|
+
${this.iconName?pt`<div class="icon">
|
|
2272
|
+
<sonic-icon name=${this.iconName} prefix=${Ve(this.iconPrefix)} library=${Ve(this.iconLibrary)}></sonic-icon>
|
|
2245
2273
|
</div>`:""}
|
|
2246
2274
|
|
|
2247
2275
|
<div class="legend-content">
|
|
2248
|
-
${
|
|
2249
|
-
${this.description?
|
|
2276
|
+
${te(this.label?this.label:"")}
|
|
2277
|
+
${this.description?pt`<sonic-legend-description>${te(this.description)}</sonic-legend-description>`:""}
|
|
2250
2278
|
<slot></slot>
|
|
2251
2279
|
</div>
|
|
2252
2280
|
<slot name="suffix"></slot>
|
|
2253
|
-
</legend>`}};
|
|
2281
|
+
</legend>`}};Co.styles=[x`
|
|
2254
2282
|
:host {
|
|
2255
2283
|
--sc-legend-font-size: 1.5rem;
|
|
2256
2284
|
--sc-legend-font-weight: var(--sc-font-weight-base);
|
|
@@ -2285,27 +2313,29 @@ ${this.value}</textarea
|
|
|
2285
2313
|
.legend-content {
|
|
2286
2314
|
flex-grow: 1;
|
|
2287
2315
|
}
|
|
2288
|
-
`],
|
|
2289
|
-
${this.label?
|
|
2290
|
-
label=${
|
|
2291
|
-
description=${
|
|
2292
|
-
iconName=${
|
|
2293
|
-
iconPrefix=${
|
|
2294
|
-
iconLibrary=${
|
|
2295
|
-
></sonic-legend>`:
|
|
2316
|
+
`],Po([F({type:Boolean})],Co.prototype,"forceAutoFill",2),Po([F()],Co.prototype,"description",1),Po([F()],Co.prototype,"label",1),Po([F({type:String})],Co.prototype,"iconName",2),Po([F({type:String})],Co.prototype,"iconLibrary",2),Po([F({type:String})],Co.prototype,"iconPrefix",2),Co=Po([b("sonic-legend")],Co);var So=Object.defineProperty,$o=Object.getOwnPropertyDescriptor,Oo=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?$o(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&So(e,s,o),o};let Do=class extends(he(Zt)){constructor(){super(...arguments),this.disabled=!1,this.variant="default"}render(){return pt`<fieldset form="${Ve(this.form)}" ?disabled="${this.disabled}">
|
|
2317
|
+
${this.label?pt` <sonic-legend
|
|
2318
|
+
label=${Ve(this.label)}
|
|
2319
|
+
description=${Ve(this.description)}
|
|
2320
|
+
iconName=${Ve(this.iconName)}
|
|
2321
|
+
iconPrefix=${Ve(this.iconPrefix)}
|
|
2322
|
+
iconLibrary=${Ve(this.iconLibrary)}
|
|
2323
|
+
></sonic-legend>`:gt}
|
|
2296
2324
|
<slot></slot>
|
|
2297
|
-
</fieldset>`}};
|
|
2325
|
+
</fieldset>`}};Do.styles=[x`
|
|
2298
2326
|
:host {
|
|
2299
2327
|
--sc-fieldset-mt: 0;
|
|
2300
2328
|
--sc-fieldset-mb: 1rem;
|
|
2301
2329
|
--sc-fieldset-border-color: var(--sc-border-color);
|
|
2302
2330
|
--sc-fieldset-border-width: var(--sc-form-border-width);
|
|
2331
|
+
--sc-fieldset-px: 1.25rem;
|
|
2332
|
+
--sc-fieldset-py: 1.8rem;
|
|
2303
2333
|
|
|
2304
2334
|
margin-top: var(--sc-fieldset-mt);
|
|
2305
2335
|
margin-bottom: var(--sc-fieldset-mb);
|
|
2306
2336
|
display: block;
|
|
2307
2337
|
border: var(--sc-fieldset-border-width) solid var(--sc-fieldset-border-color) !important;
|
|
2308
|
-
padding:
|
|
2338
|
+
padding: var(--sc-fieldset-py) var(--sc-fieldset-px);
|
|
2309
2339
|
border-radius: var(--sc-rounded-lg);
|
|
2310
2340
|
}
|
|
2311
2341
|
|
|
@@ -2313,6 +2343,7 @@ ${this.value}</textarea
|
|
|
2313
2343
|
all: unset;
|
|
2314
2344
|
display: contents;
|
|
2315
2345
|
}
|
|
2346
|
+
|
|
2316
2347
|
:host([variant="shadow"]),
|
|
2317
2348
|
:host([variant="ghost"]) {
|
|
2318
2349
|
--sc-fieldset-border-color: transparent;
|
|
@@ -2322,6 +2353,13 @@ ${this.value}</textarea
|
|
|
2322
2353
|
box-shadow: var(--sc-shadow-lg);
|
|
2323
2354
|
}
|
|
2324
2355
|
|
|
2356
|
+
:host([tight]) {
|
|
2357
|
+
--sc-fieldset-px: 0;
|
|
2358
|
+
border-left: none !important;
|
|
2359
|
+
border-right: none !important;
|
|
2360
|
+
border-radius: 0;
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2325
2363
|
sonic-legend,
|
|
2326
2364
|
::slotted(sonic-legend) {
|
|
2327
2365
|
margin-bottom: 1.5rem;
|
|
@@ -2331,9 +2369,9 @@ ${this.value}</textarea
|
|
|
2331
2369
|
::slotted(sonic-legend:last-child) {
|
|
2332
2370
|
margin-bottom: 0;
|
|
2333
2371
|
}
|
|
2334
|
-
`],
|
|
2372
|
+
`],Oo([F({type:Boolean,reflect:!0})],Do.prototype,"disabled",2),Oo([F({type:String})],Do.prototype,"form",2),Oo([F({type:String})],Do.prototype,"label",2),Oo([F({type:String})],Do.prototype,"description",2),Oo([F({type:String})],Do.prototype,"iconName",2),Oo([F({type:String})],Do.prototype,"iconLibrary",2),Oo([F({type:String})],Do.prototype,"iconPrefix",2),Oo([F({type:Boolean,reflect:!0})],Do.prototype,"tight",2),Oo([F({type:String,reflect:!0})],Do.prototype,"variant",2),Do=Oo([b("sonic-fieldset")],Do);var Lo=Object.defineProperty,Eo=Object.getOwnPropertyDescriptor,jo=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Eo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Lo(e,s,o),o};let Mo=class extends(he(Zt)){constructor(){super(...arguments),this._resizeController=new qr(this,{}),this.oneFormElement=!1}onSlotChange(){let t=this.slottedElements;const e=["sonic-input","sonic-select","sonic-input-autocomplete",".form-item-container"];t=t.filter((t=>e.includes(t.nodeName.toLowerCase()))),this.oneFormElement=1==t.length}render(){const t={"cq--md":this.offsetWidth>440,"one-form-element":this.oneFormElement};return pt`<div class=${jr(t)}>
|
|
2335
2373
|
<slot @slotchange=${this.onSlotChange}></slot>
|
|
2336
|
-
</div>`}};
|
|
2374
|
+
</div>`}};Mo.styles=[x`
|
|
2337
2375
|
:host {
|
|
2338
2376
|
display: block;
|
|
2339
2377
|
}
|
|
@@ -2368,7 +2406,7 @@ ${this.value}</textarea
|
|
|
2368
2406
|
::slotted(sonic-divider) {
|
|
2369
2407
|
--sc-divider-my: 0;
|
|
2370
2408
|
}
|
|
2371
|
-
`],
|
|
2409
|
+
`],jo([H({flatten:!0})],Mo.prototype,"slottedElements",2),jo([F({type:Boolean})],Mo.prototype,"oneFormElement",2),Mo=jo([b("sonic-form-layout")],Mo);var Io=Object.defineProperty,To=Object.getOwnPropertyDescriptor,No=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?To(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Io(e,s,o),o};let zo=class extends Zt{constructor(){super(...arguments),this.direction="row",this.justify="flex-start"}render(){const t={flexDirection:this.direction,justifyContent:this.justify};return pt`<slot style=${_e(t)}></slot>`}};zo.styles=[x`
|
|
2372
2410
|
:host {
|
|
2373
2411
|
display: block;
|
|
2374
2412
|
}
|
|
@@ -2377,13 +2415,13 @@ ${this.value}</textarea
|
|
|
2377
2415
|
flex-wrap: wrap;
|
|
2378
2416
|
gap: 0.3rem;
|
|
2379
2417
|
}
|
|
2380
|
-
`]
|
|
2381
|
-
>${this.label?
|
|
2418
|
+
`],No([F({type:String})],zo.prototype,"direction",2),No([F({type:String})],zo.prototype,"justify",2),zo=No([b("sonic-form-actions")],zo);var Ro=Object.defineProperty,Fo=Object.getOwnPropertyDescriptor,Uo=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Fo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ro(e,s,o),o};let Vo=class extends Zt{constructor(){super(...arguments),this.alignItems="center",this.hasDescription=!1,this.hasLabel=!1}updated(){const t=this.querySelectorAll("sonic-input, sonic-button, sonic-select"),e=t.length;e>1&&t.forEach(((t,s)=>{const i=t;0===s?(i.style.setProperty("--sc-item-rounded-tr","0"),i.style.setProperty("--sc-item-rounded-br","0")):s===e-1?(i.style.setProperty("--sc-item-rounded-tl","0"),i.style.setProperty("--sc-item-rounded-bl","0")):(i.style.setProperty("--sc-item-rounded-tr","0"),i.style.setProperty("--sc-item-rounded-br","0"),i.style.setProperty("--sc-item-rounded-tl","0"),i.style.setProperty("--sc-item-rounded-bl","0"))}))}connectedCallback(){super.connectedCallback(),this.hasSlotOrProps()}willUpdate(t){this.hasSlotOrProps(),super.willUpdate(t)}hasSlotOrProps(){var t,e;this.hasLabel=!(!this.label&&!(null==(t=this.slotLabelNodes)?void 0:t.length)),this.hasDescription=!(!this.description&&!(null==(e=this.slotDescriptionNodes)?void 0:e.length))}render(){const t={alignItems:this.alignItems};return pt`<span class="${this.hasLabel?"form-label":"hidden"}"
|
|
2419
|
+
>${this.label?te(this.label):""}<slot name="label" @slotchange=${this.hasSlotOrProps}></slot
|
|
2382
2420
|
></span>
|
|
2383
|
-
<slot class="main-slot" style=${
|
|
2421
|
+
<slot class="main-slot" style=${_e(t)}></slot>
|
|
2384
2422
|
<slot name="description" @slotchange=${this.hasSlotOrProps} class="${this.hasDescription?"form-description":"hidden"}">
|
|
2385
|
-
${this.description?
|
|
2386
|
-
</slot>`}};
|
|
2423
|
+
${this.description?pt`${te(this.description)}`:""}
|
|
2424
|
+
</slot>`}};Vo.styles=[Be,Dr,Lr,x`
|
|
2387
2425
|
:host {
|
|
2388
2426
|
display: inline-block;
|
|
2389
2427
|
vertical-align: middle;
|
|
@@ -2402,11 +2440,11 @@ ${this.value}</textarea
|
|
|
2402
2440
|
::slotted(sonic-select) {
|
|
2403
2441
|
flex-grow: 1;
|
|
2404
2442
|
}
|
|
2405
|
-
`],
|
|
2443
|
+
`],Uo([F({type:String})],Vo.prototype,"alignItems",2),Uo([F({type:String})],Vo.prototype,"label",2),Uo([F({type:String})],Vo.prototype,"description",2),Uo([q({slot:"label",flatten:!0})],Vo.prototype,"slotLabelNodes",2),Uo([q({slot:"description",flatten:!0})],Vo.prototype,"slotDescriptionNodes",2),Uo([U()],Vo.prototype,"hasDescription",2),Uo([U()],Vo.prototype,"hasLabel",2),Vo=Uo([b("sonic-group")],Vo);var Bo=Object.defineProperty,Ho=Object.getOwnPropertyDescriptor,qo=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ho(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Bo(e,s,o),o};let Wo=class extends Zt{constructor(){super(...arguments),this.rounded="none",this.src="",this.alt="",this.loading="lazy",this.ratio="auto",this.objectPosition="center center",this.imageRendering="auto",this.cover=!1}firstUpdated(t){var e;if(this.transition){const t=null==(e=this.shadowRoot)?void 0:e.querySelector("img");if(!t)return;t.onload=function(){t.classList.add("loaded")}}super.firstUpdated(t)}render(){const t={aspectRatio:this.cover?"auto":this.ratio,imageRendering:this.imageRendering,objectPosition:this.objectPosition};return pt`<div part="image">
|
|
2406
2444
|
<picture part="picture"
|
|
2407
|
-
><img part="img" src="${this.src}" loading="${this.loading}" alt="${this.alt}" style=${
|
|
2445
|
+
><img part="img" src="${this.src}" loading="${this.loading}" alt="${this.alt}" style=${_e(t)}
|
|
2408
2446
|
/></picture>
|
|
2409
|
-
</div>`}};
|
|
2447
|
+
</div>`}};Wo.styles=[x`
|
|
2410
2448
|
:host {
|
|
2411
2449
|
--sc-img-radius: 0;
|
|
2412
2450
|
--sc-img-bg: var(--sc-placeholder-bg);
|
|
@@ -2479,15 +2517,15 @@ ${this.value}</textarea
|
|
|
2479
2517
|
opacity: 1;
|
|
2480
2518
|
scale: 1;
|
|
2481
2519
|
}
|
|
2482
|
-
`],
|
|
2520
|
+
`],qo([F({type:String})],Wo.prototype,"rounded",2),qo([F({type:String})],Wo.prototype,"src",2),qo([F({type:String})],Wo.prototype,"alt",2),qo([F({type:String})],Wo.prototype,"loading",2),qo([F({type:String,reflect:!0})],Wo.prototype,"transition",2),qo([F({type:String})],Wo.prototype,"ratio",2),qo([F({type:String})],Wo.prototype,"objectPosition",2),qo([F({type:String})],Wo.prototype,"imageRendering",2),qo([F({type:Boolean,reflect:!0})],Wo.prototype,"cover",2),Wo=qo([b("sonic-image")],Wo);var Ko=Object.defineProperty,Zo=Object.getOwnPropertyDescriptor,Yo=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Zo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Ko(e,s,o),o};let Go=class extends Zt{constructor(){super(...arguments),this.size="",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.minWidth="0",this.hasMoreElements=!1,this.updateIsScollable=()=>{this.scrollable&&(this.initScrollable(),this.setScrollShadow(this,this.direction))}}checkIfMore(){var t;this.hasMoreElements=!!(null==(t=this.moreElements)?void 0:t.length)}updated(t){const e=this.querySelector(".more-btn");this.size&&e&&e.setAttribute("size",this.size);this.querySelectorAll("sonic-divider").forEach((t=>{t.hasAttribute("size")||t.setAttribute("size","xs")})),super.updated(t)}mainSlotChange(){this.setChildrenSize(this.menuChildren),this.updateIsScollable()}connectedCallback(){this.observer=new ResizeObserver(this.updateIsScollable),this.observer.observe(this),super.connectedCallback()}disconnectedCallback(){var t;null==(t=this.observer)||t.disconnect(),super.disconnectedCallback()}initScrollable(){let t,e,s=!1;this.scrollable&&(this.addEventListener("mousedown",(i=>{s=!0,this.classList.add("active"),t=i.pageX-this.offsetLeft,e=this.scrollLeft})),this.addEventListener("mouseleave",(()=>{s=!1,this.classList.remove("active")})),this.addEventListener("mouseup",(()=>{s=!1,this.classList.remove("active")})),this.addEventListener("mousemove",(i=>{if(!s)return;i.preventDefault();const r=1.5*(i.pageX-this.offsetLeft-t);this.scrollLeft=e-r,this.setScrollShadow(this,this.direction)})),this.addEventListener("scroll",(t=>{t.preventDefault(),this.setScrollShadow(this,this.direction)})))}setScrollShadow(t,e){"row"==e?(t.scrollLeft>0?this.classList.add("shadow-left"):this.classList.remove("shadow-left"),t.scrollLeft<t.scrollWidth-t.offsetWidth?this.classList.add("shadow-right"):this.classList.remove("shadow-right")):"column"==e&&(t.scrollTop>0?this.classList.add("shadow-top"):this.classList.remove("shadow-top"),t.scrollTop<t.scrollHeight-(t.offsetHeight+1)?this.classList.add("shadow-bottom"):this.classList.remove("shadow-bottom"))}setChildrenSize(t){t.forEach((t=>{this.size&&t.setAttribute("size",this.size),this.align&&"square"!=t.getAttribute("shape")&&"circle"!=t.getAttribute("shape")&&t.setAttribute("align",this.align),"row"==this.direction&&"block"==t.getAttribute("shape")&&t.setAttribute("shape","default")}))}render(){const t={minWidth:this.minWidth,flexDirection:this.direction,gap:this.gap},e="row"==this.direction,s={display:"block",alignSelf:e?"center":"flex-start",justifySelf:"center",flexDirection:this.direction},i={marginLeft:e?"":".55em"};return pt`<menu part="menu" class="shadowable" style=${_e(t)}>
|
|
2483
2521
|
<slot @slotchange=${this.mainSlotChange}></slot>
|
|
2484
|
-
<sonic-pop style=${
|
|
2485
|
-
<sonic-menu-item style=${
|
|
2522
|
+
<sonic-pop style=${_e(s)} class=${this.hasMoreElements?"":"hidden"}>
|
|
2523
|
+
<sonic-menu-item style=${_e(i)} class="more-btn" shape=${this.moreShape} align="center">
|
|
2486
2524
|
<sonic-icon size="xl" name=${e?"more-vert":"more-horiz"}></sonic-icon>
|
|
2487
2525
|
</sonic-menu-item>
|
|
2488
2526
|
<slot name="more" @slotchange=${this.checkIfMore} slot="content"></slot>
|
|
2489
2527
|
</sonic-pop>
|
|
2490
|
-
</menu>`}};
|
|
2528
|
+
</menu>`}};Go.styles=[x`
|
|
2491
2529
|
:host {
|
|
2492
2530
|
display: block;
|
|
2493
2531
|
--sc-menu-gap: 0.15rem;
|
|
@@ -2559,13 +2597,7 @@ ${this.value}</textarea
|
|
|
2559
2597
|
rgba(0, 0, 0, 1) 90%,
|
|
2560
2598
|
rgba(0, 0, 0, 0) 100%
|
|
2561
2599
|
);
|
|
2562
|
-
mask-image: linear-gradient(
|
|
2563
|
-
to right,
|
|
2564
|
-
rgba(0, 0, 0, 0) 0%,
|
|
2565
|
-
rgba(0, 0, 0, 1) 10%,
|
|
2566
|
-
rgba(0, 0, 0, 1) 90%,
|
|
2567
|
-
rgba(0, 0, 0, 0) 100%
|
|
2568
|
-
);
|
|
2600
|
+
mask-image: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%);
|
|
2569
2601
|
}
|
|
2570
2602
|
:host([scrollable][direction="column"].shadow-top) {
|
|
2571
2603
|
-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
@@ -2576,31 +2608,19 @@ ${this.value}</textarea
|
|
|
2576
2608
|
mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 10%);
|
|
2577
2609
|
}
|
|
2578
2610
|
:host([scrollable][direction="column"].shadow-top.shadow-bottom) {
|
|
2579
|
-
-webkit-mask-image: linear-gradient(
|
|
2580
|
-
|
|
2581
|
-
rgba(0, 0, 0, 0) 0%,
|
|
2582
|
-
rgba(0, 0, 0, 1) 10%,
|
|
2583
|
-
rgba(0, 0, 0, 1) 90%,
|
|
2584
|
-
rgba(0, 0, 0, 0) 100%
|
|
2585
|
-
);
|
|
2586
|
-
mask-image: linear-gradient(
|
|
2587
|
-
to bottom,
|
|
2588
|
-
rgba(0, 0, 0, 0) 0%,
|
|
2589
|
-
rgba(0, 0, 0, 1) 10%,
|
|
2590
|
-
rgba(0, 0, 0, 1) 90%,
|
|
2591
|
-
rgba(0, 0, 0, 0) 100%
|
|
2592
|
-
);
|
|
2611
|
+
-webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%);
|
|
2612
|
+
mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 100%);
|
|
2593
2613
|
}
|
|
2594
|
-
`],
|
|
2614
|
+
`],Yo([F({type:String,reflect:!0})],Go.prototype,"size",2),Yo([F({type:String,reflect:!0})],Go.prototype,"direction",2),Yo([F({type:String})],Go.prototype,"gap",2),Yo([F({type:String,reflect:!0})],Go.prototype,"align",2),Yo([F({type:String,reflect:!0})],Go.prototype,"shadow",2),Yo([F({type:String})],Go.prototype,"moreShape",2),Yo([F({type:Boolean})],Go.prototype,"scrollable",2),Yo([F({type:String})],Go.prototype,"minWidth",2),Yo([B("menu")],Go.prototype,"menu",2),Yo([H({selector:"sonic-menu-item"})],Go.prototype,"menuChildren",2),Yo([H({slot:"more",selector:"*"})],Go.prototype,"moreElements",2),Yo([U()],Go.prototype,"hasMoreElements",2),Go=Yo([b("sonic-menu")],Go);var Qo=Object.defineProperty,Jo=Object.getOwnPropertyDescriptor,Xo=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Jo(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Qo(e,s,o),o};let tn=class extends Zt{firstUpdated(t){var e;null==(e=this.buttons)||e.forEach((t=>{t.addEventListener("click",(()=>{if("false"!=t.getAttribute("hideModal")){const t=this.closest("sonic-modal");null==t||t.hide()}}))})),super.firstUpdated(t)}render(){return pt`<slot></slot>`}};tn.styles=[x`
|
|
2595
2615
|
:host {
|
|
2596
2616
|
display: flex;
|
|
2597
2617
|
gap: 0.5rem;
|
|
2598
2618
|
margin-top: auto;
|
|
2599
2619
|
padding-top: 1.5rem;
|
|
2600
2620
|
}
|
|
2601
|
-
`],
|
|
2621
|
+
`],Xo([H({selector:"sonic-button"})],tn.prototype,"buttons",2),tn=Xo([b("sonic-modal-actions")],tn);var en=Object.defineProperty,sn=Object.getOwnPropertyDescriptor,rn=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?sn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&en(e,s,o),o};let on=class extends Zt{render(){return pt`<sonic-button reset=${Ve(this.reset)} shape="circle" @click=${this.handleClick}
|
|
2602
2622
|
><sonic-icon name="cancel" size="lg"></sonic-icon
|
|
2603
|
-
></sonic-button>`}handleClick(){
|
|
2623
|
+
></sonic-button>`}handleClick(){s.getClosestElement(this,"sonic-modal").hide()}};on.styles=[x`
|
|
2604
2624
|
:host {
|
|
2605
2625
|
position: sticky;
|
|
2606
2626
|
display: block;
|
|
@@ -2611,12 +2631,12 @@ ${this.value}</textarea
|
|
|
2611
2631
|
transform: translate3d(calc(var(--sc-modal-px)), calc(-1 * var(--sc-modal-py)), 0);
|
|
2612
2632
|
z-index: 20;
|
|
2613
2633
|
}
|
|
2614
|
-
`],
|
|
2634
|
+
`],rn([F()],on.prototype,"reset",2),on=rn([b("sonic-modal-close")],on);var nn=Object.defineProperty,an=Object.getOwnPropertyDescriptor;let ln=class extends Zt{render(){return pt`<slot></slot>`}};ln.styles=[x`
|
|
2615
2635
|
:host {
|
|
2616
2636
|
display: block;
|
|
2617
2637
|
width: 100%;
|
|
2618
2638
|
}
|
|
2619
|
-
`],
|
|
2639
|
+
`],ln=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?an(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&nn(e,s,o),o})([b("sonic-modal-content")],ln);var cn=Object.defineProperty,hn=Object.getOwnPropertyDescriptor;let dn=class extends Zt{render(){return pt`<slot></slot>`}};dn.styles=[x`
|
|
2620
2640
|
:host {
|
|
2621
2641
|
font-size: 1.1rem;
|
|
2622
2642
|
display: block;
|
|
@@ -2625,7 +2645,7 @@ ${this.value}</textarea
|
|
|
2625
2645
|
font-family: var(--sc-headings-font-family);
|
|
2626
2646
|
font-weight: var(--sc-headings-font-weight);
|
|
2627
2647
|
}
|
|
2628
|
-
`],
|
|
2648
|
+
`],dn=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?hn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&cn(e,s,o),o})([b("sonic-modal-subtitle")],dn);var pn=Object.defineProperty,un=Object.getOwnPropertyDescriptor;let gn=class extends Zt{render(){return pt`<slot></slot>`}};gn.styles=[x`
|
|
2629
2649
|
:host {
|
|
2630
2650
|
font-weight: bold;
|
|
2631
2651
|
font-size: 1.5rem;
|
|
@@ -2633,33 +2653,35 @@ ${this.value}</textarea
|
|
|
2633
2653
|
line-height: var(--sc-headings-line-height);
|
|
2634
2654
|
font-family: var(--sc-headings-font-family);
|
|
2635
2655
|
}
|
|
2636
|
-
`],
|
|
2656
|
+
`],gn=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?un(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&pn(e,s,o),o})([b("sonic-modal-title")],gn);var bn=Object.defineProperty,mn=Object.getOwnPropertyDescriptor,fn=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?mn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&bn(e,s,o),o};const vn="sonic-modal";let yn=class extends(he(Zt)){constructor(){super(...arguments),this.forceAction=!1,this.removeOnHide=!1,this.removeHashOnHide=!1,this.align="left",this.padding="var(--sc-modal-py) var(--sc-modal-px)",this.maxWidth="var(--sc-modal-max-w) ",this.maxHeight="var(--sc-modal-max-h) ",this.width="100%",this.height="auto",this.zIndex="var(--sc-modal-z-index)",this.fullScreen=!1,this.visible=!1}static create(t){const e=document.createElement(vn);e.options=t,!0===t.removeHashOnHide&&e.setAttribute("removeHashOnHide","true"),!0===t.removeOnHide&&e.setAttribute("removeOnHide","true"),t.maxWidth&&(e.maxWidth=null==t?void 0:t.maxWidth),t.width&&(e.width=null==t?void 0:t.width),t.maxHeight&&(e.maxHeight=null==t?void 0:t.maxHeight),t.height&&(e.height=null==t?void 0:t.height),t.forceAction&&(e.forceAction=!0),t.paddingX&&e.style.setProperty("--sc-modal-px",null==t?void 0:t.paddingX),t.paddingY&&e.style.setProperty("--sc-modal-py",null==t?void 0:t.paddingY),t.zIndex&&e.style.setProperty("--sc-modal-z-index",null==t?void 0:t.zIndex);return Ms.getPopContainer().appendChild(e),e.show(),e}connectedCallback(){yn.modals.push(this),super.connectedCallback(),this.handleFullsceen()}disconnectedCallback(){yn.modals.splice(yn.modals.indexOf(this),1),super.disconnectedCallback()}updated(){const t=this;document.addEventListener("keydown",this.handleEscape),t.closeBtn.forEach((e=>{e.addEventListener("click",(function(){t.hide()}),{once:!0})}))}willUpdate(t){t.has("fullScreen")&&this.handleFullsceen(),super.willUpdate(t)}render(){var t;if(0==this.visible)return gt;const e={padding:this.padding,maxWidth:this.maxWidth,maxHeight:this.maxHeight,width:this.width,height:this.height,zIndex:this.zIndex,borderRadius:this.fullScreen?"0":"var(--sc-modal-rounded)"},s={maxWidth:this.maxWidth,maxHeight:this.maxHeight,width:this.width,height:this.height,borderRadius:this.fullScreen?"0":"var(--sc-modal-rounded)"};return pt`<div
|
|
2637
2657
|
class="modal-wrapper"
|
|
2638
|
-
style=${
|
|
2639
|
-
${
|
|
2658
|
+
style=${_e(s)}
|
|
2659
|
+
${cs({out:es})}
|
|
2640
2660
|
tabindex="0"
|
|
2641
2661
|
>
|
|
2642
2662
|
<div
|
|
2643
2663
|
part="modal"
|
|
2644
2664
|
class="modal custom-scroll"
|
|
2645
|
-
style=${
|
|
2646
|
-
${
|
|
2665
|
+
style=${_e(e)}
|
|
2666
|
+
${cs({keyframeOptions:{duration:400,easing:"cubic-bezier(0.250, 0.250, 0.420, 1.225)"},in:[{transform:"translateY(25%) scale(1)",boxShadow:"0 0 0 rgba(0,0,0,0)",opacity:0}],out:[{transform:"translateY(20%) scale(1)",boxShadow:"0 0 0 rgba(0,0,0,0)",opacity:0}]})}
|
|
2647
2667
|
>
|
|
2648
|
-
<div class="modal-content
|
|
2668
|
+
<div class="modal-content">
|
|
2669
|
+
${(null==(t=this.options)?void 0:t.forceAction)?gt:pt`<sonic-modal-close></sonic-modal-close>`} ${this.modalFragment("title")}
|
|
2670
|
+
${this.modalFragment("subtitle")} ${this.modalFragment("content")} ${this.modalFragment("actions")}
|
|
2671
|
+
|
|
2649
2672
|
<slot></slot>
|
|
2650
2673
|
</div>
|
|
2651
2674
|
</div>
|
|
2652
2675
|
</div>
|
|
2653
|
-
|
|
2654
2676
|
<div
|
|
2655
2677
|
class="overlay"
|
|
2656
2678
|
@click="${this.forceAction?null:this.hide}"
|
|
2657
|
-
${
|
|
2658
|
-
></div>`}show(){var t,e;this.visible=!0,null==(t=this.modalElement)||t.setAttribute("tabindex","0"),null==(e=this.modalElement)||e.focus(),this.dispatchEvent(new CustomEvent("show"))}hide(){var t;this.visible=!1,null==(t=this.modalElement)||t.setAttribute("tabindex","-1"),this.dispatchEvent(new CustomEvent("hide")),this.hasAttribute("resetDataProviderOnHide")&&
|
|
2679
|
+
${cs({keyframeOptions:{duration:500},in:ss,out:[{opacity:0,pointerEvents:"none"}]})}
|
|
2680
|
+
></div>`}modalFragment(t){var e;const s=null==(e=this.options)?void 0:e[t];if(!s)return gt;let i;switch(i=s instanceof Object?s:te(s),t){case"title":return pt`<sonic-modal-title>${i}</sonic-modal-title>`;case"subtitle":return pt`<sonic-modal-subtitle>${i}</sonic-modal-subtitle>`;case"content":return pt`<sonic-modal-content>${i}</sonic-modal-content>`;case"actions":return pt`<sonic-modal-actions>${i}</sonic-modal-actions>`;default:return gt}}show(){var t,e;this.visible=!0,null==(t=this.modalElement)||t.setAttribute("tabindex","0"),null==(e=this.modalElement)||e.focus(),this.dispatchEvent(new CustomEvent("show"))}hide(){var t;this.visible=!1,null==(t=this.modalElement)||t.setAttribute("tabindex","-1"),this.dispatchEvent(new CustomEvent("hide")),this.hasAttribute("resetDataProviderOnHide")&&Te.get(this.getAttribute("resetDataProviderOnHide")).set({}),this.removeOnHide&&this.remove(),setTimeout((()=>{this.dispatchEvent(new CustomEvent("hidden")),this.removeHashOnHide&&window.history.replaceState({},"",window.location.pathname)}),480)}dispose(){this.hide(),this.remove()}static disposeAll(){yn.modals.forEach((t=>{t.dispose()}))}handleEscape(t){"Escape"===t.key&&yn.modals.forEach((t=>{t.forceAction||t.hide()}))}handleFullsceen(){this.fullScreen&&(this.width="100%",this.height="100%",this.maxWidth="none",this.maxHeight="none")}};yn.styles=[xs,x`
|
|
2659
2681
|
:host {
|
|
2660
2682
|
--sc-modal-py: 2.5rem;
|
|
2661
2683
|
--sc-modal-px: 1.5rem;
|
|
2662
|
-
--sc-modal-max-w: min(100vw,
|
|
2684
|
+
--sc-modal-max-w: min(100vw, 40rem);
|
|
2663
2685
|
--sc-modal-max-h: 85vh;
|
|
2664
2686
|
--sc-modal-rounded: var(--sc-rounded-lg);
|
|
2665
2687
|
--sc-modal-z-index: 990;
|
|
@@ -2714,6 +2736,9 @@ ${this.value}</textarea
|
|
|
2714
2736
|
::slotted(sonic-modal-title) {
|
|
2715
2737
|
margin-bottom: 1.25rem;
|
|
2716
2738
|
}
|
|
2739
|
+
:host([align="left"]) ::slotted(sonic-modal-title) {
|
|
2740
|
+
padding-right: 1em;
|
|
2741
|
+
}
|
|
2717
2742
|
|
|
2718
2743
|
::slotted(sonic-modal-subtitle) {
|
|
2719
2744
|
margin-top: -0.9rem;
|
|
@@ -2765,16 +2790,18 @@ ${this.value}</textarea
|
|
|
2765
2790
|
:host([rounded="none"]) modal {
|
|
2766
2791
|
--sc-img-radius: 0 !important;
|
|
2767
2792
|
}
|
|
2768
|
-
`],
|
|
2769
|
-
${this.noIcon?
|
|
2793
|
+
`],yn.modals=[],fn([F({type:Boolean})],yn.prototype,"forceAction",2),fn([F({type:Boolean})],yn.prototype,"removeOnHide",2),fn([F({type:Boolean})],yn.prototype,"removeHashOnHide",2),fn([F({type:String,reflect:!0})],yn.prototype,"align",2),fn([F({type:String})],yn.prototype,"padding",2),fn([F({type:String})],yn.prototype,"maxWidth",2),fn([F({type:String})],yn.prototype,"maxHeight",2),fn([F({type:String})],yn.prototype,"width",2),fn([F({type:String})],yn.prototype,"height",2),fn([F({type:String})],yn.prototype,"zIndex",2),fn([F({type:Object})],yn.prototype,"options",2),fn([F({type:Boolean,reflect:!0})],yn.prototype,"fullScreen",2),fn([F({type:Boolean,reflect:!0})],yn.prototype,"visible",2),fn([B(".modal-wrapper")],yn.prototype,"modalWrapper",2),fn([B(".modal")],yn.prototype,"modalElement",2),fn([H({selector:"sonic-modal-close"})],yn.prototype,"closeBtn",2),yn=fn([b(vn)],yn),"undefined"!=typeof window&&(window.SonicModal=yn);var wn=Object.defineProperty,xn=Object.getOwnPropertyDescriptor,_n=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?xn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&wn(e,s,o),o};const kn={warning:"warning-circled-outline",success:"check-circled-outline",error:"warning-circled-outline",info:"info-empty",default:"info-empty"};let An=class extends Zt{constructor(){super(...arguments),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}render(){if(this.dismissForever){const t=localStorage.getItem("sonic-alert-dismissed")||"{}";if(JSON.parse(t)[this.id])return gt}return pt`<div part="alert" class="alert">
|
|
2794
|
+
<slot name="icon" class="${this.noIcon?"hidden":gt}"
|
|
2795
|
+
>${this.noIcon?gt:pt`<div>${this.status&&pt`<sonic-icon name=${kn[this.status]}></sonic-icon>`}</div>`}</slot
|
|
2796
|
+
>
|
|
2770
2797
|
<div>
|
|
2771
|
-
${this.label?
|
|
2772
|
-
<
|
|
2798
|
+
${this.label?pt`<span class="label">${te(this.label)}</span>`:gt}
|
|
2799
|
+
<div>${this.text}<slot></slot></div>
|
|
2773
2800
|
</div>
|
|
2774
|
-
${this.dismissible?
|
|
2801
|
+
${this.dismissible?pt`<sonic-button @click=${this.close} class="close-btn" variant="unstyled" shape="circle">
|
|
2775
2802
|
<sonic-icon name="cancel" size="lg"></sonic-icon>
|
|
2776
|
-
</sonic-button>`:
|
|
2777
|
-
</div>`}close(){this.remove()}};
|
|
2803
|
+
</sonic-button>`:gt}
|
|
2804
|
+
</div>`}close(){if(this.remove(),this.dismissForever){const t=localStorage.getItem("sonic-alert-dismissed")||"{}",e=JSON.parse(t);e[this.id]=!0,localStorage.setItem("sonic-alert-dismissed",JSON.stringify(e))}}};An.styles=[Be,x`
|
|
2778
2805
|
:host {
|
|
2779
2806
|
--sc-alert-color: var(--sc-base-content);
|
|
2780
2807
|
--sc-alert-rounded: var(--sc-rounded);
|
|
@@ -2792,10 +2819,13 @@ ${this.value}</textarea
|
|
|
2792
2819
|
display: flex;
|
|
2793
2820
|
gap: 0.4em;
|
|
2794
2821
|
border-radius: var(--sc-alert-rounded);
|
|
2822
|
+
overflow: hidden;
|
|
2795
2823
|
}
|
|
2796
2824
|
|
|
2797
2825
|
.label {
|
|
2798
2826
|
font-weight: var(--sc-alert-label-fw);
|
|
2827
|
+
margin-bottom: 0.15em;
|
|
2828
|
+
display: block;
|
|
2799
2829
|
}
|
|
2800
2830
|
|
|
2801
2831
|
:host([status="warning"]) {
|
|
@@ -2841,6 +2871,10 @@ ${this.value}</textarea
|
|
|
2841
2871
|
display: block;
|
|
2842
2872
|
}
|
|
2843
2873
|
|
|
2874
|
+
.hidden {
|
|
2875
|
+
display: none !important;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2844
2878
|
/*Rounded*/
|
|
2845
2879
|
:host([size="xs"]) .alert {
|
|
2846
2880
|
--sc-alert-rounded: var(--sc-rounded-sm);
|
|
@@ -2859,9 +2893,9 @@ ${this.value}</textarea
|
|
|
2859
2893
|
top: 0.25rem;
|
|
2860
2894
|
right: 0.25rem;
|
|
2861
2895
|
}
|
|
2862
|
-
`],
|
|
2896
|
+
`],_n([F({type:String})],An.prototype,"label",2),_n([F({type:Boolean,reflect:!0})],An.prototype,"noIcon",2),_n([F({type:String})],An.prototype,"text",2),_n([F({type:String})],An.prototype,"id",2),_n([F({type:String,reflect:!0})],An.prototype,"size",2),_n([F({type:Boolean,reflect:!0})],An.prototype,"dismissible",2),_n([F({type:Boolean,reflect:!0})],An.prototype,"background",2),_n([F({type:String,reflect:!0})],An.prototype,"status",2),_n([F({type:Boolean,reflect:!0})],An.prototype,"dismissForever",2),An=_n([b("sonic-alert")],An);var Pn=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,Sn=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Cn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Pn(e,s,o),o};let $n=class extends(he(Zt)){constructor(){super(...arguments),this._messages=[]}get messages(){return this._messages}set messages(t){this._messages=t,this.messages&&t.forEach((t=>{"public"==t.type&&zs.add({text:t.content||"",status:t.status})}))}render(){return gt}};Sn([F({type:Array})],$n.prototype,"messages",1),$n=Sn([b("sonic-toast-message-subscriber")],$n);var On=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor,Ln=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Dn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&On(e,s,o),o};let En=class extends Zt{constructor(){super(...arguments),this.label="",this.disabled=!1,this.focusable=!1}connectedCallback(){this.focusable&&this.setAttribute("tabindex","0"),super.connectedCallback()}render(){const t=this.disabled||""==this.label?"disabled":"";return pt`<div data-tooltip-text="${this.label.trim().replace(" "," ")}" class="tooltip ${t}">
|
|
2863
2897
|
<slot></slot>
|
|
2864
|
-
</div>`}};
|
|
2898
|
+
</div>`}};En.styles=[x`
|
|
2865
2899
|
:host {
|
|
2866
2900
|
position: relative;
|
|
2867
2901
|
display: inline-flex;
|
|
@@ -2889,6 +2923,7 @@ ${this.value}</textarea
|
|
|
2889
2923
|
white-space: pre-line;
|
|
2890
2924
|
font-weight: var(--sc-tooltip-fw);
|
|
2891
2925
|
}
|
|
2926
|
+
:host(:focus-within) .tooltip:not(.disabled):before,
|
|
2892
2927
|
.tooltip:not(.disabled):hover:before {
|
|
2893
2928
|
opacity: 1;
|
|
2894
2929
|
display: block;
|
|
@@ -2901,6 +2936,17 @@ ${this.value}</textarea
|
|
|
2901
2936
|
transform: translateX(-50%);
|
|
2902
2937
|
}
|
|
2903
2938
|
|
|
2939
|
+
:host([placement="top-end"]) .tooltip:before {
|
|
2940
|
+
bottom: calc(100% + 0.25rem);
|
|
2941
|
+
right: 0;
|
|
2942
|
+
transform: translateX(0);
|
|
2943
|
+
}
|
|
2944
|
+
:host([placement="top-start"]) .tooltip:before {
|
|
2945
|
+
bottom: calc(100% + 0.25rem);
|
|
2946
|
+
left: 0;
|
|
2947
|
+
transform: translateX(0);
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2904
2950
|
:host([placement="bottom"]) .tooltip:before {
|
|
2905
2951
|
top: calc(100% + 0.25rem);
|
|
2906
2952
|
left: 50%;
|
|
@@ -2918,9 +2964,9 @@ ${this.value}</textarea
|
|
|
2918
2964
|
transform: translateY(-50%);
|
|
2919
2965
|
left: calc(100% + 0.25rem);
|
|
2920
2966
|
}
|
|
2921
|
-
`],
|
|
2922
|
-
<span class="text">${
|
|
2923
|
-
</div>`}};
|
|
2967
|
+
`],Ln([F({type:String})],En.prototype,"label",2),Ln([F({type:String,reflect:!0})],En.prototype,"placement",2),Ln([F({type:Boolean})],En.prototype,"disabled",2),Ln([F({type:Boolean})],En.prototype,"focusable",2),En=Ln([b("sonic-tooltip")],En);var jn=Object.defineProperty,Mn=Object.getOwnPropertyDescriptor,In=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Mn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&jn(e,s,o),o};let Tn=class extends Zt{constructor(){super(...arguments),this.label="",this.align="center",this.vertical=!1,this.noMargin=!1,this.dashed=!1,this.dotted=!1}firstUpdated(t){var e,s;super.firstUpdated(t),(this.label||(null==(e=this.slotNodes)?void 0:e.length))&&(null==(s=this.divider)||s.classList.add("has-text"))}render(){return pt`<div part="divider">
|
|
2968
|
+
<span class="text">${te(this.label?this.label:"")}<slot></slot></span>
|
|
2969
|
+
</div>`}};Tn.styles=[x`
|
|
2924
2970
|
:host {
|
|
2925
2971
|
--sc-divider-my: 0.5rem;
|
|
2926
2972
|
--sc-divider-mx: 0;
|
|
@@ -3039,27 +3085,34 @@ ${this.value}</textarea
|
|
|
3039
3085
|
.has-text {
|
|
3040
3086
|
gap: 0.5rem;
|
|
3041
3087
|
}
|
|
3042
|
-
|
|
3088
|
+
|
|
3089
|
+
:host([dotted]) {
|
|
3090
|
+
--sc-divider-border-style: dotted;
|
|
3091
|
+
}
|
|
3092
|
+
:host([dashed]) {
|
|
3093
|
+
--sc-divider-border-style: dashed;
|
|
3094
|
+
}
|
|
3095
|
+
`],In([q({flatten:!0})],Tn.prototype,"slotNodes",2),In([B("div")],Tn.prototype,"divider",2),In([F({type:String})],Tn.prototype,"label",2),In([F({type:String,reflect:!0})],Tn.prototype,"size",2),In([F({type:String,reflect:!0})],Tn.prototype,"align",2),In([F({type:Boolean,reflect:!0})],Tn.prototype,"vertical",2),In([F({type:Boolean,reflect:!0})],Tn.prototype,"noMargin",2),In([F({type:Boolean,reflect:!0})],Tn.prototype,"dashed",2),In([F({type:Boolean,reflect:!0})],Tn.prototype,"dotted",2),Tn=In([b("sonic-divider")],Tn);var Nn=Object.defineProperty,zn=Object.getOwnPropertyDescriptor;let Rn=class extends Zt{render(){return pt`
|
|
3043
3096
|
<div>
|
|
3044
3097
|
<slot></slot>
|
|
3045
3098
|
</div>
|
|
3046
|
-
`}};
|
|
3099
|
+
`}};Rn.styles=[x`
|
|
3047
3100
|
div {
|
|
3048
3101
|
margin-top: 0.1em;
|
|
3049
3102
|
font-family: var(--sc-font-family-base);
|
|
3050
3103
|
font-size: 0.7em;
|
|
3051
3104
|
font-weight: var(--sc-font-style-base);
|
|
3052
3105
|
}
|
|
3053
|
-
`],
|
|
3106
|
+
`],Rn=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?zn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Nn(e,s,o),o})([b("sonic-card-header-description")],Rn);var Fn=Object.defineProperty,Un=Object.getOwnPropertyDescriptor,Vn=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Un(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Fn(e,s,o),o};let Bn=class extends Zt{render(){return pt`
|
|
3054
3107
|
<div class="header">
|
|
3055
3108
|
<div class="header-content">
|
|
3056
|
-
${
|
|
3057
|
-
${this.description?
|
|
3109
|
+
${te(this.label)}
|
|
3110
|
+
${this.description?pt`<sonic-card-header-description>${te(this.description)}</sonic-card-header-description>`:""}
|
|
3058
3111
|
<slot></slot>
|
|
3059
3112
|
</div>
|
|
3060
3113
|
<slot name="suffix"></slot>
|
|
3061
3114
|
</div>
|
|
3062
|
-
`}};
|
|
3115
|
+
`}};Bn.styles=[x`
|
|
3063
3116
|
:host {
|
|
3064
3117
|
--sc-card-header-mb: 1.35rem;
|
|
3065
3118
|
--sc-card-header-font-size: 1.875rem;
|
|
@@ -3092,15 +3145,15 @@ ${this.value}</textarea
|
|
|
3092
3145
|
slot[name="suffix"] {
|
|
3093
3146
|
flex-shrink: 0;
|
|
3094
3147
|
}
|
|
3095
|
-
`],
|
|
3148
|
+
`],Vn([F()],Bn.prototype,"label",2),Vn([F()],Bn.prototype,"description",2),Bn=Vn([b("sonic-card-header")],Bn);var Hn=Object.defineProperty,qn=Object.getOwnPropertyDescriptor;let Wn=class extends Zt{render(){return pt`
|
|
3096
3149
|
<div>
|
|
3097
3150
|
<slot></slot>
|
|
3098
3151
|
</div>
|
|
3099
|
-
`}};
|
|
3152
|
+
`}};Wn=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?qn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Hn(e,s,o),o})([b("sonic-card-main")],Wn);var Kn=Object.defineProperty,Zn=Object.getOwnPropertyDescriptor;let Yn=class extends Zt{render(){return pt` <slot></slot> `}};Yn=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?Zn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Kn(e,s,o),o})([b("sonic-card-footer")],Yn);var Gn=Object.defineProperty,Qn=Object.getOwnPropertyDescriptor,Jn=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Qn(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Gn(e,s,o),o};let Xn=class extends Zt{constructor(){super(...arguments),this.type="default"}render(){return pt`
|
|
3100
3153
|
<div part="card" class="card">
|
|
3101
3154
|
<slot></slot>
|
|
3102
3155
|
</div>
|
|
3103
|
-
`}};
|
|
3156
|
+
`}};Xn.styles=[x`
|
|
3104
3157
|
* {
|
|
3105
3158
|
box-sizing: border-box;
|
|
3106
3159
|
}
|
|
@@ -3176,7 +3229,7 @@ ${this.value}</textarea
|
|
|
3176
3229
|
--sc-card-color: var(--sc-base);
|
|
3177
3230
|
--sc-card-bg: var(--sc-base-900);
|
|
3178
3231
|
}
|
|
3179
|
-
`],
|
|
3232
|
+
`],Jn([F({type:String,reflect:!0})],Xn.prototype,"type",2),Xn=Jn([b("sonic-card")],Xn);const ta=x`
|
|
3180
3233
|
:host {
|
|
3181
3234
|
--sc-color: inherit;
|
|
3182
3235
|
color: var(--sc-color);
|
|
@@ -3201,7 +3254,7 @@ ${this.value}</textarea
|
|
|
3201
3254
|
.inherit-color {
|
|
3202
3255
|
color: var(--sc-color);
|
|
3203
3256
|
}
|
|
3204
|
-
`;
|
|
3257
|
+
`;x`
|
|
3205
3258
|
:host {
|
|
3206
3259
|
--sc-color: inherit;
|
|
3207
3260
|
--sc-bg: inherit;
|
|
@@ -3233,7 +3286,7 @@ ${this.value}</textarea
|
|
|
3233
3286
|
.inherit-bg {
|
|
3234
3287
|
color: inherit;
|
|
3235
3288
|
}
|
|
3236
|
-
`;var
|
|
3289
|
+
`;var ea=Object.defineProperty,sa=Object.getOwnPropertyDescriptor,ia=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?sa(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ea(e,s,o),o};let ra=class extends(he(Zt)){constructor(){super(...arguments),this._metadata_={}}willUpdate(t){t.has("_metadata_")&&(this.even=!!this._metadata_.even,this.odd=!!this._metadata_.odd,this.last=!!this._metadata_.lastChild),super.willUpdate(t)}render(){return pt`<slot></slot>`}};ra.styles=[ta,x`
|
|
3237
3290
|
:host {
|
|
3238
3291
|
display: table-row;
|
|
3239
3292
|
}
|
|
@@ -3245,12 +3298,15 @@ ${this.value}</textarea
|
|
|
3245
3298
|
background: var(--sc-table-bg) !important;
|
|
3246
3299
|
}
|
|
3247
3300
|
|
|
3301
|
+
:host([last]) {
|
|
3302
|
+
--sc-table-td-border-b: none;
|
|
3303
|
+
}
|
|
3248
3304
|
:host(:hover) {
|
|
3249
3305
|
background: var(--sc-table-hover-bg) !important;
|
|
3250
3306
|
}
|
|
3251
|
-
`],
|
|
3307
|
+
`],ia([F({type:Object})],ra.prototype,"_metadata_",2),ia([F({type:Boolean,reflect:!0})],ra.prototype,"even",2),ia([F({type:Boolean,reflect:!0})],ra.prototype,"odd",2),ia([F({type:Boolean,reflect:!0})],ra.prototype,"last",2),ra=ia([b("sonic-tr")],ra);var oa=Object.defineProperty,na=Object.getOwnPropertyDescriptor,aa=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?na(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&oa(e,s,o),o};let la=class extends Zt{render(){const t={textAlign:this.align,minWidth:this.minWidth,maxWidth:this.maxWidth,width:this.width};return pt`<th part="th" style=${_e(t)} colspan=${Ve(this.colSpan)} rowspan=${Ve(this.rowSpan)}>
|
|
3252
3308
|
<slot></slot>
|
|
3253
|
-
</th> `}};
|
|
3309
|
+
</th> `}};la.styles=[ta,x`
|
|
3254
3310
|
:host {
|
|
3255
3311
|
display: contents;
|
|
3256
3312
|
background: var(--sc-table-bg);
|
|
@@ -3272,9 +3328,9 @@ ${this.value}</textarea
|
|
|
3272
3328
|
:host([noBorder]) th {
|
|
3273
3329
|
border-bottom: none;
|
|
3274
3330
|
}
|
|
3275
|
-
`],
|
|
3331
|
+
`],aa([F({type:Number})],la.prototype,"colSpan",2),aa([F({type:Number})],la.prototype,"rowSpan",2),aa([F({type:String})],la.prototype,"align",2),aa([F({type:String})],la.prototype,"minWidth",2),aa([F({type:String})],la.prototype,"maxWidth",2),aa([F({type:String})],la.prototype,"width",2),la=aa([b("sonic-th")],la);var ca=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,da=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?ha(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ca(e,s,o),o};let pa=class extends Zt{render(){const t={textAlign:this.align,verticalAlign:this.vAlign,minWidth:this.minWidth,maxWidth:this.maxWidth,width:this.width};return pt`<td part="td" style=${_e(t)} colspan=${Ve(this.colSpan)} rowspan=${Ve(this.rowSpan)}>
|
|
3276
3332
|
<slot></slot>
|
|
3277
|
-
</td>`}};
|
|
3333
|
+
</td>`}};pa.styles=[ta,x`
|
|
3278
3334
|
:host {
|
|
3279
3335
|
display: contents;
|
|
3280
3336
|
}
|
|
@@ -3287,13 +3343,13 @@ ${this.value}</textarea
|
|
|
3287
3343
|
border-right: var(--sc-table-td-border-r, none);
|
|
3288
3344
|
border-left: var(--sc-table-td-border-l, none);
|
|
3289
3345
|
}
|
|
3290
|
-
`],
|
|
3346
|
+
`],da([F({type:Number})],pa.prototype,"colSpan",2),da([F({type:Number})],pa.prototype,"rowSpan",2),da([F({type:String})],pa.prototype,"align",2),da([F({type:String})],pa.prototype,"vAlign",2),da([F({type:String})],pa.prototype,"minWidth",2),da([F({type:String})],pa.prototype,"maxWidth",2),da([F({type:String})],pa.prototype,"width",2),pa=da([b("sonic-td")],pa);var ua=Object.defineProperty,ga=Object.getOwnPropertyDescriptor;let ba=class extends Zt{render(){return pt`<slot></slot>`}};ba.styles=[x`
|
|
3291
3347
|
:host {
|
|
3292
3348
|
display: table-header-group;
|
|
3293
3349
|
}
|
|
3294
|
-
`],
|
|
3350
|
+
`],ba=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?ga(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ua(e,s,o),o})([b("sonic-thead")],ba);var ma=Object.defineProperty,fa=Object.getOwnPropertyDescriptor;let va=class extends Zt{render(){return pt`<tbody part="tbody">
|
|
3295
3351
|
<slot></slot>
|
|
3296
|
-
</tbody>`}};
|
|
3352
|
+
</tbody>`}};va.styles=[x`
|
|
3297
3353
|
:host {
|
|
3298
3354
|
display: table-row-group;
|
|
3299
3355
|
}
|
|
@@ -3309,26 +3365,26 @@ ${this.value}</textarea
|
|
|
3309
3365
|
::slotted(sonic-tr:not(:last-child)) {
|
|
3310
3366
|
border-bottom: var(--sc-form-border-width) solid var(--sc-base-200) !important;
|
|
3311
3367
|
}
|
|
3312
|
-
`],
|
|
3368
|
+
`],va=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?fa(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ma(e,s,o),o})([b("sonic-tbody")],va);var ya=Object.defineProperty,wa=Object.getOwnPropertyDescriptor;let xa=class extends Zt{render(){return pt`<tfoot>
|
|
3313
3369
|
<slot></slot>
|
|
3314
|
-
</tfoot>`}};
|
|
3370
|
+
</tfoot>`}};xa.styles=[x`
|
|
3315
3371
|
:host {
|
|
3316
3372
|
display: contents;
|
|
3317
3373
|
}
|
|
3318
|
-
`],
|
|
3374
|
+
`],xa=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?wa(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&ya(e,s,o),o})([b("sonic-tfoot")],xa);var _a=Object.defineProperty,ka=Object.getOwnPropertyDescriptor;let Aa=class extends Zt{render(){return pt`<slot></slot>`}};Aa.styles=[x`
|
|
3319
3375
|
:host {
|
|
3320
3376
|
display: table-caption;
|
|
3321
3377
|
font-size: 0.75rem;
|
|
3322
3378
|
color: var(--sc-table-caption-color);
|
|
3323
3379
|
padding: var(--sc-table-td-py) var(--sc-table-td-px) calc(2 * var(--sc-table-td-py));
|
|
3324
3380
|
}
|
|
3325
|
-
`],
|
|
3326
|
-
<div class="table-container ${this.noCustomScroll?"":"custom-scroll"}" style=${
|
|
3381
|
+
`],Aa=((t,e,s,i)=>{for(var r,o=i>1?void 0:i?ka(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&_a(e,s,o),o})([b("sonic-caption")],Aa);var Pa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,Sa=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Ca(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Pa(e,s,o),o};let $a=class extends Zt{constructor(){super(...arguments),this.bordered=!1,this.rounded=!1,this.noCustomScroll=!1}render(){const t={maxHeight:this.maxHeight};return pt`
|
|
3382
|
+
<div class="table-container ${this.noCustomScroll?"":"custom-scroll"}" style=${_e(t)}>
|
|
3327
3383
|
<div class="table">
|
|
3328
3384
|
<slot></slot>
|
|
3329
3385
|
</div>
|
|
3330
3386
|
</div>
|
|
3331
|
-
`}}
|
|
3387
|
+
`}};$a.styles=[xs,Be,x`
|
|
3332
3388
|
:host {
|
|
3333
3389
|
--sc-table-fw: var(--sc-font-weight-base);
|
|
3334
3390
|
--sc-table-fst: var(--sc-font-style-base);
|
|
@@ -3364,6 +3420,8 @@ ${this.value}</textarea
|
|
|
3364
3420
|
}
|
|
3365
3421
|
|
|
3366
3422
|
:host([bordered]) .table-container {
|
|
3367
|
-
border: var(--sc-border-width) solid var(--sc-table-border-color)
|
|
3423
|
+
border: var(--sc-border-width) solid var(--sc-table-border-color);
|
|
3424
|
+
border-radius: var(--sc-rounded);
|
|
3425
|
+
--sc-table-td-border-b: var(--sc-border-width) solid var(--sc-table-border-color);
|
|
3368
3426
|
}
|
|
3369
|
-
`],
|
|
3427
|
+
`],Sa([F({type:String,reflect:!0})],$a.prototype,"size",2),Sa([F({type:Boolean,reflect:!0})],$a.prototype,"bordered",2),Sa([F({type:Boolean,reflect:!0})],$a.prototype,"rounded",2),Sa([F({type:Boolean,reflect:!0})],$a.prototype,"noCustomScroll",2),Sa([F({type:String})],$a.prototype,"maxHeight",2),$a=Sa([b("sonic-table")],$a);var Oa=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,La=(t,e,s,i)=>{for(var r,o=i>1?void 0:i?Da(e,s):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(i?r(e,s,o):r(o))||o);return i&&o&&Oa(e,s,o),o};let Ea=class extends(Xs(Zt)){constructor(){super(...arguments),this.key="",this.action=null,this.zIndex=9999,this.onCaptchaTokenChanged=t=>{"request_token"==t&&(this.formPublisher&&(this.formPublisher.captchaToken=""),this.requestToken())}}connectedCallback(){if(!document.getElementById("captcha-"+this.key)){const t=document.createElement("script");t.src="https://www.google.com/recaptcha/api.js?render="+this.key,t.id="captcha-"+this.key,document.head.appendChild(t)}if(super.connectedCallback(),this.formPublisher=Te.get(this.getAncestorAttributeValue("headersDataProvider")??this.getAncestorAttributeValue("formDataProvider")),!document.getElementById("concorde-recaptcha-css")){const t=document.createElement("style");t.innerHTML=".grecaptcha-badge {z-index: 9999;}",t.id="concorde-recaptcha-css",document.head.appendChild(t)}this.formPublisher&&!this.formPublisher.captchaToken.get()&&(this.formPublisher.needsCaptchaValidation=!0,this.formPublisher.captchaToken.onAssign(this.onCaptchaTokenChanged))}disconnectedCallback(){this.formPublisher&&this.formPublisher.captchaToken.offAssign(this.onCaptchaTokenChanged),super.disconnectedCallback()}requestToken(){var t,e;if(!this.formPublisher)return;const s=(this.action??(null==(t=this.formPublisher.captchaAction)?void 0:t.get())??"submit").replace(/[^\w_/]/g,"_"),i=((null==(e=this.formPublisher.captchaMethod)?void 0:e.get())??"POST").toUpperCase();delete this.formPublisher.captchaAction,delete this.formPublisher.captchaMethod,window.grecaptcha.ready((()=>{window.grecaptcha.execute(this.key,{action:i+"//"+s}).then((t=>{this.formPublisher&&(this.formPublisher.captchaToken=t)}))}))}render(){return pt` <slot></slot> `}};La([F()],Ea.prototype,"key",2),La([F()],Ea.prototype,"action",2),La([F({type:Number})],Ea.prototype,"zIndex",2),Ea=La([b("sonic-captcha")],Ea),window.SonicPublisherManager||(window.SonicPublisherManager=l),window.SonicDataBindObserver||(window.SonicDataBindObserver=u),window.queueMicrotask=window.queueMicrotask||function(t){Promise.resolve().then(t).catch((t=>setTimeout((()=>{throw t}))))};const ja=zs,Ma=yn;window["concorde-components"]=window["concorde-components"]||{},window["concorde-components"]={SonicToast:ja,SonicModal:Ma},window.concordeIsLoaded=!0,window.dispatchEvent(new CustomEvent("concorde-loaded"))}));
|