@supersoniks/concorde 1.1.27 → 1.1.28
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/concorde-core.bundle.js +11 -11
- package/concorde-core.es.js +15 -15
- package/core/components/ui/button/button.d.ts +1 -1
- package/core/components/ui/form/checkbox/checkbox.d.ts +2 -2
- package/core/components/ui/form/checkbox/checkbox.js +2 -2
- package/core/components/ui/form/input/input.d.ts +1 -1
- package/core/components/ui/form/textarea/textarea.d.ts +1 -1
- package/core/components/ui/icon/icons.js +4 -0
- package/core/components/ui/icon/icons.json +1 -1
- package/core/components/ui/toast/toast-item.d.ts +2 -0
- package/core/components/ui/toast/toast-item.js +23 -0
- package/core/components/ui/toast/toast.d.ts +1 -0
- package/core/components/ui/toast/toast.js +16 -2
- package/core/components/ui/toast/types.d.ts +1 -0
- package/core/mixins/FormCheckable.d.ts +1 -1
- package/core/mixins/FormCheckable.js +2 -2
- package/core/mixins/FormElement.d.ts +1 -1
- package/core/mixins/FormElement.js +1 -1
- package/core/mixins/FormInput.d.ts +1 -1
- package/mixins.d.ts +2 -2
- package/package.json +1 -1
package/concorde-core.bundle.js
CHANGED
|
@@ -10,11 +10,11 @@ var Wl=Object.defineProperty,Kl=Object.defineProperties;var Yl=Object.getOwnProp
|
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/var bs;const Xt=globalThis.trustedTypes,er=Xt?Xt.createPolicy("lit-html",{createHTML:i=>i}):void 0,
|
|
13
|
+
*/var bs;const Xt=globalThis.trustedTypes,er=Xt?Xt.createPolicy("lit-html",{createHTML:i=>i}):void 0,bt=`lit$${(Math.random()+"").slice(9)}$`,ys="?"+bt,Hi=`<${ys}>`,Jt=document,fe=(i="")=>Jt.createComment(i),me=i=>i===null||typeof i!="object"&&typeof i!="function",sr=Array.isArray,rr=i=>{var t;return sr(i)||typeof((t=i)===null||t===void 0?void 0:t[Symbol.iterator])=="function"},ve=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ir=/-->/g,or=/>/g,Lt=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,nr=/'/g,ar=/"/g,lr=/^(?:script|style|textarea|title)$/i,Wi=i=>(t,...r)=>({_$litType$:i,strings:t,values:r}),u=Wi(1),ht=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),cr=new WeakMap,Ki=(i,t,r)=>{var e,s;const o=(e=r==null?void 0:r.renderBefore)!==null&&e!==void 0?e:t;let n=o._$litPart$;if(n===void 0){const l=(s=r==null?void 0:r.renderBefore)!==null&&s!==void 0?s:null;o._$litPart$=n=new te(t.insertBefore(fe(),l),l,void 0,r!=null?r:{})}return n._$AI(i),n},Qt=Jt.createTreeWalker(Jt,129,null,!1),hr=(i,t)=>{const r=i.length-1,e=[];let s,o=t===2?"<svg>":"",n=ve;for(let c=0;c<r;c++){const h=i[c];let b,f,g=-1,$=0;for(;$<h.length&&(n.lastIndex=$,f=n.exec(h),f!==null);)$=n.lastIndex,n===ve?f[1]==="!--"?n=ir:f[1]!==void 0?n=or:f[2]!==void 0?(lr.test(f[2])&&(s=RegExp("</"+f[2],"g")),n=Lt):f[3]!==void 0&&(n=Lt):n===Lt?f[0]===">"?(n=s!=null?s:ve,g=-1):f[1]===void 0?g=-2:(g=n.lastIndex-f[2].length,b=f[1],n=f[3]===void 0?Lt:f[3]==='"'?ar:nr):n===ar||n===nr?n=Lt:n===ir||n===or?n=ve:(n=Lt,s=void 0);const _=n===Lt&&i[c+1].startsWith("/>")?" ":"";o+=n===ve?h+Hi:g>=0?(e.push(b),h.slice(0,g)+"$lit$"+h.slice(g)+bt+_):h+bt+(g===-2?(e.push(void 0),c):_)}const l=o+(i[r]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return[er!==void 0?er.createHTML(l):l,e]};class be{constructor({strings:t,_$litType$:r},e){let s;this.parts=[];let o=0,n=0;const l=t.length-1,c=this.parts,[h,b]=hr(t,r);if(this.el=be.createElement(h,e),Qt.currentNode=this.el.content,r===2){const f=this.el.content,g=f.firstChild;g.remove(),f.append(...g.childNodes)}for(;(s=Qt.nextNode())!==null&&c.length<l;){if(s.nodeType===1){if(s.hasAttributes()){const f=[];for(const g of s.getAttributeNames())if(g.endsWith("$lit$")||g.startsWith(bt)){const $=b[n++];if(f.push(g),$!==void 0){const _=s.getAttribute($.toLowerCase()+"$lit$").split(bt),k=/([.?@])?(.*)/.exec($);c.push({type:1,index:o,name:k[2],strings:_,ctor:k[1]==="."?pr:k[1]==="?"?ur:k[1]==="@"?gr:ye})}else c.push({type:6,index:o})}for(const g of f)s.removeAttribute(g)}if(lr.test(s.tagName)){const f=s.textContent.split(bt),g=f.length-1;if(g>0){s.textContent=Xt?Xt.emptyScript:"";for(let $=0;$<g;$++)s.append(f[$],fe()),Qt.nextNode(),c.push({type:2,index:++o});s.append(f[g],fe())}}}else if(s.nodeType===8)if(s.data===ys)c.push({type:2,index:o});else{let f=-1;for(;(f=s.data.indexOf(bt,f+1))!==-1;)c.push({type:7,index:o}),f+=bt.length-1}o++}}static createElement(t,r){const e=Jt.createElement("template");return e.innerHTML=t,e}}function zt(i,t,r=i,e){var s,o,n,l;if(t===ht)return t;let c=e!==void 0?(s=r._$Cl)===null||s===void 0?void 0:s[e]:r._$Cu;const h=me(t)?void 0:t._$litDirective$;return(c==null?void 0:c.constructor)!==h&&((o=c==null?void 0:c._$AO)===null||o===void 0||o.call(c,!1),h===void 0?c=void 0:(c=new h(i),c._$AT(i,r,e)),e!==void 0?((n=(l=r)._$Cl)!==null&&n!==void 0?n:l._$Cl=[])[e]=c:r._$Cu=c),c!==void 0&&(t=zt(i,c._$AS(i,t.values),c,e)),t}class dr{constructor(t,r){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var r;const{el:{content:e},parts:s}=this._$AD,o=((r=t==null?void 0:t.creationScope)!==null&&r!==void 0?r:Jt).importNode(e,!0);Qt.currentNode=o;let n=Qt.nextNode(),l=0,c=0,h=s[0];for(;h!==void 0;){if(l===h.index){let b;h.type===2?b=new te(n,n.nextSibling,this,t):h.type===1?b=new h.ctor(n,h.name,h.strings,this,t):h.type===6&&(b=new fr(n,this,t)),this.v.push(b),h=s[++c]}l!==(h==null?void 0:h.index)&&(n=Qt.nextNode(),l++)}return o}m(t){let r=0;for(const e of this.v)e!==void 0&&(e.strings!==void 0?(e._$AI(t,e,r),r+=e.strings.length-2):e._$AI(t[r])),r++}}class te{constructor(t,r,e,s){var o;this.type=2,this._$AH=P,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=e,this.options=s,this._$Cg=(o=s==null?void 0:s.isConnected)===null||o===void 0||o}get _$AU(){var t,r;return(r=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&r!==void 0?r:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&t.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=zt(this,t,r),me(t)?t===P||t==null||t===""?(this._$AH!==P&&this._$AR(),this._$AH=P):t!==this._$AH&&t!==ht&&this.$(t):t._$litType$!==void 0?this.T(t):t.nodeType!==void 0?this.k(t):rr(t)?this.S(t):this.$(t)}M(t,r=this._$AB){return this._$AA.parentNode.insertBefore(t,r)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==P&&me(this._$AH)?this._$AA.nextSibling.data=t:this.k(Jt.createTextNode(t)),this._$AH=t}T(t){var r;const{values:e,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=be.createElement(s.h,this.options)),s);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===o)this._$AH.m(e);else{const n=new dr(o,this),l=n.p(this.options);n.m(e),this.k(l),this._$AH=n}}_$AC(t){let r=cr.get(t.strings);return r===void 0&&cr.set(t.strings,r=new be(t)),r}S(t){sr(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let e,s=0;for(const o of t)s===r.length?r.push(e=new te(this.M(fe()),this.M(fe()),this,this.options)):e=r[s],e._$AI(o),s++;s<r.length&&(this._$AR(e&&e._$AB.nextSibling,s),r.length=s)}_$AR(t=this._$AA.nextSibling,r){var e;for((e=this._$AP)===null||e===void 0||e.call(this,!1,!0,r);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var r;this._$AM===void 0&&(this._$Cg=t,(r=this._$AP)===null||r===void 0||r.call(this,t))}}class ye{constructor(t,r,e,s,o){this.type=1,this._$AH=P,this._$AN=void 0,this.element=t,this.name=r,this._$AM=s,this.options=o,e.length>2||e[0]!==""||e[1]!==""?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=P}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,e,s){const o=this.strings;let n=!1;if(o===void 0)t=zt(this,t,r,0),n=!me(t)||t!==this._$AH&&t!==ht,n&&(this._$AH=t);else{const l=t;let c,h;for(t=o[0],c=0;c<o.length-1;c++)h=zt(this,l[e+c],r,c),h===ht&&(h=this._$AH[c]),n||(n=!me(h)||h!==this._$AH[c]),h===P?t=P:t!==P&&(t+=(h!=null?h:"")+o[c+1]),this._$AH[c]=h}n&&!s&&this.C(t)}C(t){t===P?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}}class pr extends ye{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===P?void 0:t}}const Yi=Xt?Xt.emptyScript:"";class ur extends ye{constructor(){super(...arguments),this.type=4}C(t){t&&t!==P?this.element.setAttribute(this.name,Yi):this.element.removeAttribute(this.name)}}class gr extends ye{constructor(t,r,e,s,o){super(t,r,e,s,o),this.type=5}_$AI(t,r=this){var e;if((t=(e=zt(this,t,r,0))!==null&&e!==void 0?e:P)===ht)return;const s=this._$AH,o=t===P&&s!==P||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==P&&(s===P||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var r,e;typeof this._$AH=="function"?this._$AH.call((e=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&e!==void 0?e:this.element,t):this._$AH.handleEvent(t)}}class fr{constructor(t,r,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){zt(this,t)}}const Zi={L:"$lit$",P:bt,V:ys,I:1,N:hr,R:dr,j:rr,D:zt,H:te,F:ye,O:ur,W:gr,B:pr,Z:fr},mr=window.litHtmlPolyfillSupport;mr==null||mr(be,te),((bs=globalThis.litHtmlVersions)!==null&&bs!==void 0?bs:globalThis.litHtmlVersions=[]).push("2.2.3");/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/var ws,$s;class v extends Gt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,r;const e=super.createRenderRoot();return(t=(r=this.renderOptions).renderBefore)!==null&&t!==void 0||(r.renderBefore=e.firstChild),e}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=Ki(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!1)}render(){return
|
|
17
|
+
*/var ws,$s;class v extends Gt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,r;const e=super.createRenderRoot();return(t=(r=this.renderOptions).renderBefore)!==null&&t!==void 0||(r.renderBefore=e.firstChild),e}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=Ki(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!1)}render(){return ht}}v.finalized=!0,v._$litElement$=!0,(ws=globalThis.litElementHydrateSupport)===null||ws===void 0||ws.call(globalThis,{LitElement:v});const vr=globalThis.litElementPolyfillSupport;vr==null||vr({LitElement:v}),(($s=globalThis.litElementVersions)!==null&&$s!==void 0?$s:globalThis.litElementVersions=[]).push("3.2.0");/**
|
|
18
18
|
* @license
|
|
19
19
|
* Copyright 2017 Google LLC
|
|
20
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -42,7 +42,7 @@ var Wl=Object.defineProperty,Kl=Object.defineProperties;var Yl=Object.getOwnProp
|
|
|
42
42
|
* @license
|
|
43
43
|
* Copyright 2017 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/function rt(i,t,r){let e,s=i;return typeof i=="object"?(s=i.slot,e=i):e={flatten:t},r?Tt({slot:s,flatten:t,selector:r}):xs({descriptor:o=>({get(){var n,l;const c="slot"+(s?`[name=${s}]`:":not([name])"),h=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(c);return(l=h==null?void 0:h.assignedNodes(e))!==null&&l!==void 0?l:[]},enumerable:!0,configurable:!0})})}function Re(i){return typeof i=="object"&&i!=null}class Ji{constructor(t,r=null){for(this._proxies_=new Map,this._value_=t,this._invalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this.parent=r,this.root=this;this.root.parent;)this.root=this.root.parent}delete(){for(let 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()}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){this._mutationListeners_.forEach(r=>r()),!t&&this.parent&&this.parent._publishInternalMutation_()}_publishAssignement_(t=!1){this._assignListeners_.forEach(r=>r(this.get())),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,r){this._fillListeners_.forEach(e=>{e[t]!==r&&(e[t]=r)}),this._publishTemplateFilling_(t,r)}_publishTemplateFilling_(t,r){this._templateFillListeners_.forEach(e=>{let s=Object.getOwnPropertyDescriptor(e,t);s&&!s.set||(e.propertyMap&&e.propertyMap[t]&&(t=e.propertyMap[t]),typeof e[t]!="undefined"&&e[t]!==r&&(e[t]=r))})}onAssign(t){typeof t=="function"&&(this._assignListeners_.add(t),t(this.get()))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){this._invalidateListeners_.delete(t)}invalidate(t){this._publishInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){this._mutationListeners_.delete(t)}startTemplateFilling(t){this._templateFillListeners_.add(t);for(var r in this._value_){const e=this._value_[r];t.propertyMap&&t.propertyMap[r]&&(r=t.propertyMap[r]),typeof t[r]!="undefined"&&t[r]!==e&&(t[r]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(var r in this._value_){const e=this._value_[r];t[r]!==e&&(t[r]=e)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,r=!1){if(this._value_===t||this._value_.hasOwnProperty("__value")&&t.hasOwnProperty("__value")&&this._value_.__value===t.__value)return!0;if(this._value_=t,this._value_.hasOwnProperty("__value"))return this._publishAssignement_(r),!0;if(Array.from(this._proxies_.keys()).forEach(s=>{!this._value_[s]&&this._proxies_.has(s)&&!this._proxies_.get(s).hasListener()&&this._proxies_.delete(s)}),Re(this._value_))for(let s in this._value_){let o=t[s],l=Re(o)?o:{__value:o};if(!this._proxies_.has(s)){let c=new Mt({},this);this._proxies_.set(s,c,!0),c._proxies_.set("_parent_",this)}this._proxies_.get(s).set(l,!0),this._publishDynamicFilling_(s,o)}return this._publishAssignement_(),!0}get(){if(this._value_.hasOwnProperty("__value")){let t=this._value_.__value;return t!=null?t:null}return this._value_}}const xt=class{constructor(){if(xt.instance!=null)throw"Singleton / use getInstance";xt.instance=this,this.publishers=new Map}static getInstance(){return xt.instance==null?new xt:xt.instance}static get(t){return xt.getInstance().get(t)}static delete(t){return xt.getInstance().delete(t)}get(t){return this.publishers.has(t)||this.publishers.set(t,new Mt({})),this.publishers.get(t)}set(t,r){this.publishers.set(t,r)}delete(t){if(!this.publishers.has(t))return!1;this.publishers.get(t),this.publishers.delete(t)}};let K=xt;Ui(K,"instance",null);class Mt extends Ji{constructor(t,r=null){super(t,r);let e=this,s=new Proxy(this,{get:function(o,n){if(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_lockInternalMutationPublishing_"].includes(n))return e[n];if(!e._proxies_.has(n)){let l=e._value_[n],c=new Mt(Re(l)?l:{__value:l},e);c._proxies_.set("_parent_",s),e._proxies_.set(n,c)}return e._proxies_.get(n)},set:function(o,n,l){if(n=="_value_")return o._value_=l,o._value_;if(!e._proxies_.has(n)){let h=new Mt({},e);h._proxies_.set("_parent_",s),e._proxies_.set(n,h)}return e._value_[n]!==l&&(e._value_[n]=l,e._publishDynamicFilling_(n,l),e._proxies_.get(n).set(Re(l)?l:{__value:l})),e._proxies_.get(n)},deleteProperty:function(o,n){return e._publishDynamicFilling_(n,null),e._proxies_.delete(n),delete e._value_[n]},enumerate:function(o,n){return e._value_.keys()},has:function(o,n){return n in e._value_&&n!="_lockInternalMutationPublishing_"},defineProperty:function(o,n,l){return l&&"value"in l&&(e._value_[n]=l.value),e._value_},getOwnPropertyDescriptor:function(o,n){return e._value_[n],{enumerable:!0,configurable:!0}},ownKeys:function(o){return e._value_.__value?Object.keys(this._value_.__value):Object.keys(e._value_)}});return s}}typeof module!="undefined"&&(module.exports={Publisher:Mt,PublisherManager:K});class ee{static getLanguage(){return document.getElementsByTagName("html")[0].getAttribute("lang")}static getCookies(){return document.cookie.split(";").reduce((t,r)=>{const e=r.indexOf("=");return t[r.substring(0,e).trim()]=r.substring(e+1),t},{})}static getAncestorAttributeValue(t,r){for(;!(t.hasAttribute&&t.hasAttribute(r))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.hasAttribute?t.getAttribute(r):null}}const _t=class{constructor(i){this.serviceURL=i.serviceURL,this.serviceURL||(this.serviceURL=document.location.origin),this.userName=i.userName,this.password=i.password,this.token=i.token,this.tokenProvider=i.tokenProvider}async auth(){if(this.token)return;if(_t.tokens.has(this.serviceURL)){this.token=_t.tokens.get(this.serviceURL);return}if(!this.userName||!this.password||!this.tokenProvider)return;let i={Authorization:"Basic "+window.btoa(unescape(encodeURIComponent(this.userName+":"+this.password)))},t=await fetch(this.computeURL(this.tokenProvider),{headers:i});try{let r=await t.json();this.token=r.token,_t.tokens.set(this.serviceURL,this.token)}catch{}}async get(i,t){let r=await this.createHeaders(t);const e=this.computeURL(i);if(!_t.loadingGetPromises.has(e)){let o=new Promise(async n=>{let l=await fetch(e,{headers:r});try{let c=await l.json();n(c)}catch{n(null)}});_t.loadingGetPromises.set(e,o)}let s=await _t.loadingGetPromises.get(e);return _t.loadingGetPromises.delete(e),s}async createHeaders(i){await this.auth();let t={};return this.token&&(t.Authorization="Bearer "+this.token),t.credentials="include",t["Accept-Language"]=ee.getLanguage(),i&&Object.assign(t,i),t}computeURL(i){return(this.serviceURL+"/"+i).replace(/([^(https?\:)])\/{2,}/g,"$1/")}async send(i,t,r="POST",e){await this.auth();let s=await this.createHeaders(e);s.Accept="application/json",s["Content-Type"]="application/json";let o=await fetch(this.computeURL(i),{headers:s,method:r,body:JSON.stringify(t)});try{return await o.json()}catch{return null}}async put(i,t,r){return this.send(i,t,"PUT",r)}async post(i,t,r){return this.send(i,t,"POST",r)}async delete(i,t,r){return this.send(i,t,"delete",r)}};let se=_t;se.loadingGetPromises=new Map,se.tokens=new Map;class Ne{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static js(t){try{return Function("return "+t)()}catch{return""}}}const C=class{static disable(){!this.enabled||(this.enabled=!1,Array.from(C.observedElements.keys()).forEach(i=>C.unObserve(i)))}static observe(i){if(!i||!C.enabled||C.observedElements.has(i))return;let t=new MutationObserver(C.onMutation),r={};r.childList=!0,r.subtree=!0,r.attributes=!0,r.attributeFilter=["data-bind"],t.observe(i,r),i.querySelectorAll("[data-bind]").forEach(e=>C.addPublisherListeners(e)),C.observedElements.set(i,t)}static unObserve(i){if(!i)return;let t=this.observedElements.get(i);!t||(t.disconnect(),i.querySelectorAll("[data-bind]").forEach(r=>C.removePublisherListeners(r)))}static onAdded(i){i.hasAttribute&&i.hasAttribute("data-bind")&&C.addPublisherListeners(i),i.querySelectorAll?i.querySelectorAll("[data-bind]").forEach(t=>C.addPublisherListeners(t)):i.childNodes.forEach(t=>C.onAdded(t))}static onRemoved(i){i.hasAttribute&&i.hasAttribute("data-bind")&&C.removePublisherListeners(i),i.querySelectorAll?i.querySelectorAll("[data-bind]").forEach(t=>C.removePublisherListeners(t)):i.childNodes.forEach(t=>C.onRemoved(t))}static onMutation(i){for(let e of i)switch(e.type){case"attributes":C.addPublisherListeners(e.target);break;case"childList":var t=e.addedNodes,r=e.removedNodes;t.forEach(s=>{C.onAdded(s)}),r.forEach(s=>{C.onRemoved(s)});break}}static removePublisherListeners(i){let t=C.publisherListeners.get(i);!t||(C.publisherListeners.delete(i),t.forEach(r=>{r.publisher.offAssign(r.onAssign)}))}static getVariablesDescriptor(i){let t=i.match(/(\$(?:\w+\\?\.?)+)/g);return t?t=t.map(r=>r.replace("$","")):t=[i],t=t.filter(r=>r.length>0),{expression:i.replace("\\",""),variables:t.map(r=>r.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(i){return Array.from(i.attributes).filter(t=>t.name.indexOf("::")==0).map(t=>({propertyToUpdate:t.name.substring(2).replace(/\-((html)|\w)/g,r=>r.substring(1).toUpperCase()),bindedVariablesDescriptor:C.getVariablesDescriptor(t.value)}))}static getSubPublisher(i,t){for(let r of t)r!="_self_"&&(i=i[r]);return i}static addPublisherListeners(i){C.removePublisherListeners(i);let t=i,r=ee.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!r)return;let e=K.getInstance().get(r),s=C.getDataBindItems(i),o=[];s.forEach(n=>{let l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(let h of l.variables){let b=h,f=e;f=C.getSubPublisher(e,b);let g=i,$={publisher:f,onAssign:()=>{let _=l.variables.map(D=>C.getSubPublisher(e,D).get()),A=l.expression,R=!1;if(_.length==1&&l.variables[0].join(".")==A.substring(1)){let D=_[0];D===null&&(D=""),g[c]=D;return}for(let D=0;D<_.length;D++){let d=_[D],p=l.variables[D];d===null&&(R=!0,d=void 0),A=A.replace("$"+p.join("."),d)}if(A.indexOf("|")!=-1){let D=A.indexOf("|");if(D==0)A=Ne.js(A.substring(1));else{let d=A.substring(0,D),p=A.substring(D+1),m=Ne;A=R?"":m[d]?m[d](p):A}}else A=R?"":A;g[c]=A}};f.onAssign($.onAssign),o.push($)}}),C.publisherListeners.set(i,o)}};let kt=C;kt.observedElements=new Map,kt.enabled=!0,kt.publisherListeners=new Map,kt.observe(document.documentElement);let br=window;br.SonicDataBindObserver||(br.SonicDataBindObserver=kt);class et{static shallowEqual(t,r){const e=Object.keys(t),s=Object.keys(r);if(e.length!==s.length)return!1;for(let o of e)if(t[o]!==r[o])return!1;return!0}static deepEqual(t,r){const e=Object.keys(t),s=Object.keys(r);if(e.length!==s.length)return!1;for(const o of e){const n=t[o],l=r[o],c=et.isObject(n)&&et.isObject(l);if(c&&!et.deepEqual(n,l)||!c&&n!==l)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static traverse(t,r,e=!1){for(let s of r){let o=t[s];if(o===void 0)return;e&&et.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[s]}return t}}var Qi=Object.defineProperty,to=Object.getOwnPropertyDescriptor,re=(i,t,r,e)=>{for(var s=e>1?void 0:e?to(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Qi(t,r,s),s};let Fe=!1,ks=new Set;const I=i=>{const t=class extends i{constructor(...e){super(),this.noAutoFill=!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=null,this.args=e}hasAncestorAttribute(e){return this.getAncestorAttributeValue(e)!=null}getAncestorAttributeValue(e){let s=this;return ee.getAncestorAttributeValue(s,e)}get props(){return this.publisher?this.publisher.get():this._props}set props(e){typeof e=="string"&&["{","["].includes(e.trim().charAt(0))&&(e=JSON.parse(e)),(e==null||e==="")&&(e={}),this.publisher||this.initPublisher(),this._props=e,this.publisher&&this.publisher.set(e),this.requestUpdate()}updated(e){super.updated(e),this.shadowRoot?this.shadowRoot.children.length==0?this.style.display="none":this.style.removeProperty("display"):this.children.length==0?this.style.display="none":this.style.removeProperty("display")}connectedCallback(){if(this.hasAttribute("lazyRendering")){let e={root:null,rootMargin:Math.max(window.innerWidth*.1,window.innerHeight*.1)+"px"},s=!0;new IntersectionObserver(o=>{for(const n of o)s&&n.isIntersecting&&(s=!1,this.initWording(),this.initPublisher())},e).observe(this)}else this.initWording(),this.initPublisher();this.addDebugger(),super.connectedCallback(),t.instanceCounter++}disconnectedCallback(){this.removeDebugger(),super.disconnectedCallback(),this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate())),this.wordingPublisher&&this.wordingPublisher.stopTemplateFilling(this),this.onAssign&&this.publisher.offAssign(this.onAssign)}addDebugger(){if(this.hasAttribute("debug")&&!this.defferedDebug){if(!this.debug){this.debug=document.createElement("div");let e=this.debug.style;e.position="fixed",e.top="0",e.right="0",e.margin="auto",e.borderRadius=".7rem",e.backgroundColor="#0f1729",e.color="#c5d4f9",e.padding="16px 16px",e.margin="16px 16px",e.boxShadow="0 10px 30px -18px rgba(0,0,0,.3)",e.overflowY="auto",e.zIndex="99999999",e.maxHeight="calc(100vh - 32px)",e.fontFamily="Consolas, monospace",e.maxWidth="50vw",e.fontSize="12px",e.minWidth="300px",e.overflowWrap="break-word"}if(this.addEventListener("click",e=>{!e.ctrlKey||(e.preventDefault(),Fe=!Fe)}),this.dataProvider){let e=window;e[this.dataProvider]=this.publisher}this.addEventListener("mouseover",()=>{Fe||this.removeDebugger(),document.body.appendChild(this.debug),ks.add(this.debug)}),this.addEventListener("mouseout",()=>{Fe||this.removeDebugger()}),this.publisher.onInternalMutation(()=>{this.debug.innerHTML=`\u{1F916} DataProvider : "<b style="font-weight:700;color:#fff">${this.dataProvider}</b>"<br><div style="font-size:10px;border-top:1px dashed;margin-top:5px;padding-left:23px;opacity:.6;padding-top:5px">Variable disponible dans la console<br>ctrl + Clique : \xE9pingler / d\xE9s\xE9pingler</div><pre style="margin-top:10px;background:0 0;padding:0;font-size:inherit;color:inherit">${JSON.stringify(this.publisher.get(),null," ")}</pre>`})}}removeDebugger(){ks.forEach(e=>{document.body.contains(e)&&document.body.removeChild(e)}),ks=new Set}getApiConfiguration(){const e=this.getAncestorAttributeValue("token");let s=this.getAncestorAttributeValue("serviceURL"),o=null,n=null,l=null;return e||(o=this.getAncestorAttributeValue("userName"),n=this.getAncestorAttributeValue("password"),l=this.getAncestorAttributeValue("tokenProvider")),{serviceURL:s,token:e,userName:o,password:n,tokenProvider:l}}async initWording(){let e=!1;const s=Object.getOwnPropertyNames(this.constructor.prototype);for(let c of s)if(c.indexOf("wording_")==0){e=!0;break}if(!e)return;let o=K.getInstance().get("sonic-wording"),n=this.getAncestorAttributeValue("wordingProvider");const l=new se(this.getApiConfiguration());if(n){let c=[];for(let h of s)if(h.indexOf("wording_")==0){let b=h.substring(8);o.get()[h]||(o[h]="...",c.push(b))}if(c.length>0){let h=await l.post(n,{labels:c});for(let b in h)o["wording_"+b]=h[b]}o.startTemplateFilling(this),this.wordingPublisher=o}}createRenderRoot(){if(this.noShadowDom===""||this.getAttribute("noShadowDom")==="")return this;let e=super.createRenderRoot();return kt.observe(e),e}initPublisher(){if(!document)return;this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate),this.onAssign&&this.publisher.offAssign(this.onAssign));const e=K.getInstance();this.dataProvider||(this.dataProvider=this.getAncestorAttributeValue("dataProvider"));let s=this.dataProvider;if(!s&&this._props&&(this.dataProvider=s="__subscriber__"+t.instanceCounter),s){this.bindPublisher&&e.set(s,this.bindPublisher());let o=e.get(s);if(this.dataProvider=s,this.hasAttribute("subDataProvider")){let n=this.getAttribute("subDataProvider");this.dataProvider=s+"/"+n,o=et.traverse(o,n.split(".")),e.set(this.dataProvider,o),this.publisher=o}this.publisher=o}this.publisher&&(this.onAssign=()=>{this.requestUpdate()},this.publisher.onAssign(this.onAssign),this.noAutoFill||this.publisher.startTemplateFilling(this),this.renderOnPropsInternalChange&&this.publisher.onInternalMutation(this.requestUpdate),this._props&&this.publisher.set(this._props))}};let r=t;return r.instanceCounter=0,re([a({type:Boolean})],r.prototype,"noAutoFill",2),re([a({type:Object})],r.prototype,"propertyMap",2),re([a({type:String,attribute:"data-title"})],r.prototype,"title",2),re([a({reflect:!0})],r.prototype,"dataProvider",2),re([a()],r.prototype,"bindPublisher",2),re([a()],r.prototype,"props",1),r};let yr=window;yr.SonicPublisherManager||(yr.SonicPublisherManager=K);var eo=Object.defineProperty,so=Object.getOwnPropertyDescriptor,ro=(i,t,r,e)=>{for(var s=e>1?void 0:e?so(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&eo(t,r,s),s};const $e=i=>{class t extends i{constructor(){super(...arguments),this.templates=null,this.templateValueAttribute="data-value",this.templateList=[],this.templateParts={},this.templatePartsList=[]}connectedCallback(){let e=this.templates||[...this.querySelectorAll("template")];for(let s of e)s.hasAttribute(this.templateValueAttribute)&&(this.templateParts[s.getAttribute(this.templateValueAttribute)]=s,this.templatePartsList.push(s));this.templateList=e.filter(s=>!s.getAttribute("data-value")),this.templateList.length==0&&(this.templateList=e),super.connectedCallback()}}return ro([a({type:Array})],t.prototype,"templates",2),t};var io=Object.defineProperty,oo=Object.getOwnPropertyDescriptor,V=(i,t,r,e)=>{for(var s=e>1?void 0:e?oo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&io(t,r,s),s};const no="sonic-date";let U=class extends I($e(v)){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=new Date().getTime()/1e3,this.end_date=0,this.era="",this.year="numeric",this.month="short",this.day="2-digit",this.weekday="short",this.hour="2-digit",this.minute="2-digit",this.language="",this.renderIf=!0,this.startDateObject=new Date,this.endDateObject=new Date}get wording_billet_periode_validite(){return this._wording_billet_periode_validite}set wording_billet_periode_validite(i){this._wording_billet_periode_validite=i,this.duAu=this.wording_billet_periode_validite.split("%s").map(t=>t.trim()),this.duAu.pop(),this.requestUpdate()}connectedCallback(){this.wording_billet_periode_validite="Du %s au %s",this.pageLanguage=ee.getLanguage(),super.connectedCallback()}getDatesParts(i,t,r){const e=new Intl.DateTimeFormat(this.language||this.pageLanguage,r);let s=this.startDateObject;s.setTime(i*1e3);let o=null;if(t>0){let n=this.endDateObject;if(n.setTime(t*1e3),o=e.formatRangeToParts(s,n),this.designMode)for(let c of o)c.type=="literal"&&this.designMode&&c.value.trim()==","&&(c.hidden=!0);const l=s.getFullYear()==n.getFullYear()&&s.getMonth()==n.getMonth()&&s.getDate()==n.getDate();if(o.some(c=>c.source=="endRange")&&!l){for(let c of o)if(c.type=="literal"&&c.source=="shared"&&c.value.trim().length>0&&!l){c.value=" "+this.duAu[1]+" ",c.type="to";break}this.designMode||o.unshift({type:"from",value:this.duAu[0]+" ",source:"shared"})}}else o=e.formatToParts(s);return o[0].value=Ne.ucFirst(o[0].value),o=o.filter(n=>n.hidden!==!0),o}render(){if(!this.renderIf)return P;if(this.date_string&&(this.date=new Date(this.date_string).getTime()/1e3),this.date&&(this.start_date=this.date),this.start_date_string&&(this.start_date=new Date(this.start_date_string).getTime()/1e3),this.end_date_string&&(this.end_date=new Date(this.end_date_string).getTime()/1e3),this.end_date>0&&this.end_date<this.start_date){const r=this.start_date;this.start_date=this.end_date,this.end_date=r}let i={weekday:this.weekday,year:this.year,month:this.month,day:this.day};this.hour&&(i.hour=this.hour),this.minute&&(i.minute=this.minute),this.era&&(i.era=this.era),this.time_zone&&(i.timeZone=this.time_zone);let t=this.getDatesParts(this.start_date,this.end_date,i);return u`${t.map(r=>{let e=this.templateParts[r.type];if(e){var s=document.importNode(e.content,!0);let o=s.children[0];return o.innerText.trim()==""&&(o.innerText=r.value),s}return u`<span class="${r.type}">${r.value}</span>`})}`}};V([a()],U.prototype,"wording_billet_periode_validite",1),V([a({type:Boolean})],U.prototype,"designMode",2),V([a({type:String})],U.prototype,"time_zone",2),V([a({type:Number})],U.prototype,"date",2),V([a({type:String})],U.prototype,"date_string",2),V([a({type:String})],U.prototype,"start_date_string",2),V([a({type:String})],U.prototype,"end_date_string",2),V([a({type:Number})],U.prototype,"start_date",2),V([a({type:Number})],U.prototype,"end_date",2),V([a({type:String})],U.prototype,"era",2),V([a({type:String})],U.prototype,"year",2),V([a({type:String})],U.prototype,"month",2),V([a({type:String})],U.prototype,"day",2),V([a({type:String})],U.prototype,"weekday",2),V([a({type:String})],U.prototype,"hour",2),V([a({type:String})],U.prototype,"minute",2),V([a({type:String})],U.prototype,"language",2),V([a({type:Boolean})],U.prototype,"renderIf",2),U=V([y(no)],U);const ao=w`:host([align="left"]) .sonic-loader--inline { margin-left:0; } :host([align="right"]) .sonic-loader--inline { margin-left:auto; margin-right:0; } .sonic-loader--inline { display:block; position: relative; width: 80px; height: 80px; margin:auto; z-index:20; } .sonic-loader--inline div { position: absolute; top: 33px; width: 13px; height: 13px; border-radius: 50%; background:var(--sc-loader-bg); animation-timing-function: cubic-bezier(0, 1, 1, 0); } .sonic-loader--inline div:nth-child(1) { left: 8px; animation: lds-ellipsis1 0.6s infinite; } .sonic-loader--inline div:nth-child(2) { left: 8px; animation: lds-ellipsis2 0.6s infinite; } .sonic-loader--inline div:nth-child(3) { left: 32px; animation: lds-ellipsis2 0.6s infinite; } .sonic-loader--inline div:nth-child(4) { left: 56px; animation: lds-ellipsis3 0.6s infinite; } @keyframes lds-ellipsis1 { 0% { transform: scale(0); } 100% { transform: scale(1); } } @keyframes lds-ellipsis3 { 0% { transform: scale(1); } 100% { transform: scale(0); } } @keyframes lds-ellipsis2 { 0% { transform: translate(0, 0); } 100% { transform: translate(24px, 0); } }`,lo=w`@keyframes sonic-loader--fixed { 0% { transform: scale(0); opacity: 0; } 5% { opacity: 1; } 70% { opacity:90%; } 100% { transform: scale(1); opacity: 0; } } .sonic-loader--fixed { position: fixed; top:50%; left:50%; transform:transateY(-50%) translateX(-50%); z-index:999; } .sonic-loader--fixed > div:nth-child(2) { animation-delay: -0.5s; } .sonic-loader--fixed > div:nth-child(3) { animation-delay: -0.2s; } .sonic-loader--fixed > div:nth-child(4) { display:none !important; } .sonic-loader--fixed > div { background-color: var(--sc-loader-bg); width: 5rem; height: 5rem; border-radius: 100%; margin: 2px; animation-fill-mode: both; position: absolute; top: 0px; opacity: 0; margin: 0; top: -2.5rem; left: -2.5rem; width: 5rem; height: 5rem; animation: sonic-loader--fixed 1s 0s linear infinite; }`;var co=Object.defineProperty,ho=Object.getOwnPropertyDescriptor,wr=(i,t,r,e)=>{for(var s=e>1?void 0:e?ho(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&co(t,r,s),s};const $r="sonic-loader";let q=class extends v{constructor(){super(...arguments),this.mode="fixed"}static show(i){q.loader||(q.loader=document.createElement("sonic-loader"));let t=q.loader;i||(i={});let r=i;for(let e in r)t.setAttribute(e,r[e]);i.container||(i.container=document.querySelector("sonic-theme")||document.body,i.mode="fixed"),i.container.appendChild(t),q.callCounter++}static hide(){q.callCounter--,!(q.callCounter>0)&&q.loader&&q.loader.remove()}render(){return u`<div class="sonic-loader sonic-loader--${this.mode}"><div></div><div></div><div></div><div></div></div>`}};q.styles=[ao,lo,w`:host { --sc-loader-bg: var(--sc-primary, currentColor); pointer-events: none; } .sonic-loader { opacity: 0; animation: showLoader 0.5s 0.5s forwards; } .sonic-loader--inline { animation-delay: 0s; } @keyframes showLoader { 0% { opacity: 0; } 100% { opacity: 1; } }`],q.callCounter=0,wr([a({type:String})],q.prototype,"mode",2),q=wr([y($r)],q);try{customElements.define($r,q)}catch{}/**
|
|
45
|
+
*/function rt(i,t,r){let e,s=i;return typeof i=="object"?(s=i.slot,e=i):e={flatten:t},r?Tt({slot:s,flatten:t,selector:r}):xs({descriptor:o=>({get(){var n,l;const c="slot"+(s?`[name=${s}]`:":not([name])"),h=(n=this.renderRoot)===null||n===void 0?void 0:n.querySelector(c);return(l=h==null?void 0:h.assignedNodes(e))!==null&&l!==void 0?l:[]},enumerable:!0,configurable:!0})})}function Re(i){return typeof i=="object"&&i!=null}class Ji{constructor(t,r=null){for(this._proxies_=new Map,this._value_=t,this._invalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this.parent=r,this.root=this;this.root.parent;)this.root=this.root.parent}delete(){for(let 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()}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){this._mutationListeners_.forEach(r=>r()),!t&&this.parent&&this.parent._publishInternalMutation_()}_publishAssignement_(t=!1){this._assignListeners_.forEach(r=>r(this.get())),this._publishInternalMutation_(t)}_publishInvalidation_(){this._invalidateListeners_.forEach(t=>t())}_publishDynamicFilling_(t,r){this._fillListeners_.forEach(e=>{e[t]!==r&&(e[t]=r)}),this._publishTemplateFilling_(t,r)}_publishTemplateFilling_(t,r){this._templateFillListeners_.forEach(e=>{let s=Object.getOwnPropertyDescriptor(e,t);s&&!s.set||(e.propertyMap&&e.propertyMap[t]&&(t=e.propertyMap[t]),typeof e[t]!="undefined"&&e[t]!==r&&(e[t]=r))})}onAssign(t){typeof t=="function"&&(this._assignListeners_.add(t),t(this.get()))}offAssign(t){this._assignListeners_.delete(t)}onInvalidate(t){typeof t=="function"&&this._invalidateListeners_.add(t)}offInvalidate(t){this._invalidateListeners_.delete(t)}invalidate(t){this._publishInvalidation_()}onInternalMutation(t){typeof t=="function"&&(this._mutationListeners_.add(t),t())}offInternalMutation(t){this._mutationListeners_.delete(t)}startTemplateFilling(t){this._templateFillListeners_.add(t);for(var r in this._value_){const e=this._value_[r];t.propertyMap&&t.propertyMap[r]&&(r=t.propertyMap[r]),typeof t[r]!="undefined"&&t[r]!==e&&(t[r]=e)}}stopTemplateFilling(t){this._templateFillListeners_.delete(t)}startDynamicFilling(t){this._fillListeners_.add(t);for(var r in this._value_){const e=this._value_[r];t[r]!==e&&(t[r]=e)}}stopDynamicFilling(t){this._fillListeners_.delete(t)}set(t,r=!1){if(this._value_===t||this._value_.hasOwnProperty("__value")&&t.hasOwnProperty("__value")&&this._value_.__value===t.__value)return!0;if(this._value_=t,this._value_.hasOwnProperty("__value"))return this._publishAssignement_(r),!0;if(Array.from(this._proxies_.keys()).forEach(s=>{!this._value_[s]&&this._proxies_.has(s)&&!this._proxies_.get(s).hasListener()&&this._proxies_.delete(s)}),Re(this._value_))for(let s in this._value_){let o=t[s],l=Re(o)?o:{__value:o};if(!this._proxies_.has(s)){let c=new Mt({},this);this._proxies_.set(s,c,!0),c._proxies_.set("_parent_",this)}this._proxies_.get(s).set(l,!0),this._publishDynamicFilling_(s,o)}return this._publishAssignement_(),!0}get(){if(this._value_.hasOwnProperty("__value")){let t=this._value_.__value;return t!=null?t:null}return this._value_}}const _t=class{constructor(){if(_t.instance!=null)throw"Singleton / use getInstance";_t.instance=this,this.publishers=new Map}static getInstance(){return _t.instance==null?new _t:_t.instance}static get(t){return _t.getInstance().get(t)}static delete(t){return _t.getInstance().delete(t)}get(t){return this.publishers.has(t)||this.publishers.set(t,new Mt({})),this.publishers.get(t)}set(t,r){this.publishers.set(t,r)}delete(t){if(!this.publishers.has(t))return!1;this.publishers.get(t),this.publishers.delete(t)}};let K=_t;Ui(K,"instance",null);class Mt extends Ji{constructor(t,r=null){super(t,r);let e=this,s=new Proxy(this,{get:function(o,n){if(["invalidate","onInvalidate","offInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_value_","_lockInternalMutationPublishing_"].includes(n))return e[n];if(!e._proxies_.has(n)){let l=e._value_[n],c=new Mt(Re(l)?l:{__value:l},e);c._proxies_.set("_parent_",s),e._proxies_.set(n,c)}return e._proxies_.get(n)},set:function(o,n,l){if(n=="_value_")return o._value_=l,o._value_;if(!e._proxies_.has(n)){let h=new Mt({},e);h._proxies_.set("_parent_",s),e._proxies_.set(n,h)}return e._value_[n]!==l&&(e._value_[n]=l,e._publishDynamicFilling_(n,l),e._proxies_.get(n).set(Re(l)?l:{__value:l})),e._proxies_.get(n)},deleteProperty:function(o,n){return e._publishDynamicFilling_(n,null),e._proxies_.delete(n),delete e._value_[n]},enumerate:function(o,n){return e._value_.keys()},has:function(o,n){return n in e._value_&&n!="_lockInternalMutationPublishing_"},defineProperty:function(o,n,l){return l&&"value"in l&&(e._value_[n]=l.value),e._value_},getOwnPropertyDescriptor:function(o,n){return e._value_[n],{enumerable:!0,configurable:!0}},ownKeys:function(o){return e._value_.__value?Object.keys(this._value_.__value):Object.keys(e._value_)}});return s}}typeof module!="undefined"&&(module.exports={Publisher:Mt,PublisherManager:K});class ee{static getLanguage(){return document.getElementsByTagName("html")[0].getAttribute("lang")}static getCookies(){return document.cookie.split(";").reduce((t,r)=>{const e=r.indexOf("=");return t[r.substring(0,e).trim()]=r.substring(e+1),t},{})}static getAncestorAttributeValue(t,r){for(;!(t.hasAttribute&&t.hasAttribute(r))&&(t.parentNode||t.host);)t=t.parentNode||t.host;return t.hasAttribute?t.getAttribute(r):null}}const kt=class{constructor(i){this.serviceURL=i.serviceURL,this.serviceURL||(this.serviceURL=document.location.origin),this.userName=i.userName,this.password=i.password,this.token=i.token,this.tokenProvider=i.tokenProvider}async auth(){if(this.token)return;if(kt.tokens.has(this.serviceURL)){this.token=kt.tokens.get(this.serviceURL);return}if(!this.userName||!this.password||!this.tokenProvider)return;let i={Authorization:"Basic "+window.btoa(unescape(encodeURIComponent(this.userName+":"+this.password)))},t=await fetch(this.computeURL(this.tokenProvider),{headers:i});try{let r=await t.json();this.token=r.token,kt.tokens.set(this.serviceURL,this.token)}catch{}}async get(i,t){let r=await this.createHeaders(t);const e=this.computeURL(i);if(!kt.loadingGetPromises.has(e)){let o=new Promise(async n=>{let l=await fetch(e,{headers:r});try{let c=await l.json();n(c)}catch{n(null)}});kt.loadingGetPromises.set(e,o)}let s=await kt.loadingGetPromises.get(e);return kt.loadingGetPromises.delete(e),s}async createHeaders(i){await this.auth();let t={};return this.token&&(t.Authorization="Bearer "+this.token),t.credentials="include",t["Accept-Language"]=ee.getLanguage(),i&&Object.assign(t,i),t}computeURL(i){return(this.serviceURL+"/"+i).replace(/([^(https?\:)])\/{2,}/g,"$1/")}async send(i,t,r="POST",e){await this.auth();let s=await this.createHeaders(e);s.Accept="application/json",s["Content-Type"]="application/json";let o=await fetch(this.computeURL(i),{headers:s,method:r,body:JSON.stringify(t)});try{return await o.json()}catch{return null}}async put(i,t,r){return this.send(i,t,"PUT",r)}async post(i,t,r){return this.send(i,t,"POST",r)}async delete(i,t,r){return this.send(i,t,"delete",r)}};let se=kt;se.loadingGetPromises=new Map,se.tokens=new Map;class Ne{static ucFirst(t){return typeof t!="string"?t:t.charAt(0).toUpperCase()+t.substring(1)}static js(t){try{return Function("return "+t)()}catch{return""}}}const C=class{static disable(){!this.enabled||(this.enabled=!1,Array.from(C.observedElements.keys()).forEach(i=>C.unObserve(i)))}static observe(i){if(!i||!C.enabled||C.observedElements.has(i))return;let t=new MutationObserver(C.onMutation),r={};r.childList=!0,r.subtree=!0,r.attributes=!0,r.attributeFilter=["data-bind"],t.observe(i,r),i.querySelectorAll("[data-bind]").forEach(e=>C.addPublisherListeners(e)),C.observedElements.set(i,t)}static unObserve(i){if(!i)return;let t=this.observedElements.get(i);!t||(t.disconnect(),i.querySelectorAll("[data-bind]").forEach(r=>C.removePublisherListeners(r)))}static onAdded(i){i.hasAttribute&&i.hasAttribute("data-bind")&&C.addPublisherListeners(i),i.querySelectorAll?i.querySelectorAll("[data-bind]").forEach(t=>C.addPublisherListeners(t)):i.childNodes.forEach(t=>C.onAdded(t))}static onRemoved(i){i.hasAttribute&&i.hasAttribute("data-bind")&&C.removePublisherListeners(i),i.querySelectorAll?i.querySelectorAll("[data-bind]").forEach(t=>C.removePublisherListeners(t)):i.childNodes.forEach(t=>C.onRemoved(t))}static onMutation(i){for(let e of i)switch(e.type){case"attributes":C.addPublisherListeners(e.target);break;case"childList":var t=e.addedNodes,r=e.removedNodes;t.forEach(s=>{C.onAdded(s)}),r.forEach(s=>{C.onRemoved(s)});break}}static removePublisherListeners(i){let t=C.publisherListeners.get(i);!t||(C.publisherListeners.delete(i),t.forEach(r=>{r.publisher.offAssign(r.onAssign)}))}static getVariablesDescriptor(i){let t=i.match(/(\$(?:\w+\\?\.?)+)/g);return t?t=t.map(r=>r.replace("$","")):t=[i],t=t.filter(r=>r.length>0),{expression:i.replace("\\",""),variables:t.map(r=>r.split(/\b\.\b/).map(e=>e.replace("\\","")))}}static getDataBindItems(i){return Array.from(i.attributes).filter(t=>t.name.indexOf("::")==0).map(t=>({propertyToUpdate:t.name.substring(2).replace(/\-((html)|\w)/g,r=>r.substring(1).toUpperCase()),bindedVariablesDescriptor:C.getVariablesDescriptor(t.value)}))}static getSubPublisher(i,t){for(let r of t)r!="_self_"&&(i=i[r]);return i}static addPublisherListeners(i){C.removePublisherListeners(i);let t=i,r=ee.getAncestorAttributeValue(t.parentNode||t.host||t,"dataProvider");if(!r)return;let e=K.getInstance().get(r),s=C.getDataBindItems(i),o=[];s.forEach(n=>{let l=n.bindedVariablesDescriptor,c=n.propertyToUpdate;for(let h of l.variables){let b=h,f=e;f=C.getSubPublisher(e,b);let g=i,$={publisher:f,onAssign:()=>{let _=l.variables.map(D=>C.getSubPublisher(e,D).get()),k=l.expression,R=!1;if(_.length==1&&l.variables[0].join(".")==k.substring(1)){let D=_[0];D===null&&(D=""),g[c]=D;return}for(let D=0;D<_.length;D++){let d=_[D],p=l.variables[D];d===null&&(R=!0,d=void 0),k=k.replace("$"+p.join("."),d)}if(k.indexOf("|")!=-1){let D=k.indexOf("|");if(D==0)k=Ne.js(k.substring(1));else{let d=k.substring(0,D),p=k.substring(D+1),m=Ne;k=R?"":m[d]?m[d](p):k}}else k=R?"":k;g[c]=k}};f.onAssign($.onAssign),o.push($)}}),C.publisherListeners.set(i,o)}};let At=C;At.observedElements=new Map,At.enabled=!0,At.publisherListeners=new Map,At.observe(document.documentElement);let br=window;br.SonicDataBindObserver||(br.SonicDataBindObserver=At);class et{static shallowEqual(t,r){const e=Object.keys(t),s=Object.keys(r);if(e.length!==s.length)return!1;for(let o of e)if(t[o]!==r[o])return!1;return!0}static deepEqual(t,r){const e=Object.keys(t),s=Object.keys(r);if(e.length!==s.length)return!1;for(const o of e){const n=t[o],l=r[o],c=et.isObject(n)&&et.isObject(l);if(c&&!et.deepEqual(n,l)||!c&&n!==l)return!1}return!0}static isObject(t){return t!=null&&typeof t=="object"}static isUndefindOrNull(t){return t==null}static traverse(t,r,e=!1){for(let s of r){let o=t[s];if(o===void 0)return;e&&et.isObject(o)?t=Object.assign(Array.isArray(o)?[]:{},t,o):t=t[s]}return t}}var Qi=Object.defineProperty,to=Object.getOwnPropertyDescriptor,re=(i,t,r,e)=>{for(var s=e>1?void 0:e?to(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Qi(t,r,s),s};let Fe=!1,ks=new Set;const I=i=>{const t=class extends i{constructor(...e){super(),this.noAutoFill=!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=null,this.args=e}hasAncestorAttribute(e){return this.getAncestorAttributeValue(e)!=null}getAncestorAttributeValue(e){let s=this;return ee.getAncestorAttributeValue(s,e)}get props(){return this.publisher?this.publisher.get():this._props}set props(e){typeof e=="string"&&["{","["].includes(e.trim().charAt(0))&&(e=JSON.parse(e)),(e==null||e==="")&&(e={}),this.publisher||this.initPublisher(),this._props=e,this.publisher&&this.publisher.set(e),this.requestUpdate()}updated(e){super.updated(e),this.shadowRoot?this.shadowRoot.children.length==0?this.style.display="none":this.style.removeProperty("display"):this.children.length==0?this.style.display="none":this.style.removeProperty("display")}connectedCallback(){if(this.hasAttribute("lazyRendering")){let e={root:null,rootMargin:Math.max(window.innerWidth*.1,window.innerHeight*.1)+"px"},s=!0;new IntersectionObserver(o=>{for(const n of o)s&&n.isIntersecting&&(s=!1,this.initWording(),this.initPublisher())},e).observe(this)}else this.initWording(),this.initPublisher();this.addDebugger(),super.connectedCallback(),t.instanceCounter++}disconnectedCallback(){this.removeDebugger(),super.disconnectedCallback(),this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate())),this.wordingPublisher&&this.wordingPublisher.stopTemplateFilling(this),this.onAssign&&this.publisher.offAssign(this.onAssign)}addDebugger(){if(this.hasAttribute("debug")&&!this.defferedDebug){if(!this.debug){this.debug=document.createElement("div");let e=this.debug.style;e.position="fixed",e.top="0",e.right="0",e.margin="auto",e.borderRadius=".7rem",e.backgroundColor="#0f1729",e.color="#c5d4f9",e.padding="16px 16px",e.margin="16px 16px",e.boxShadow="0 10px 30px -18px rgba(0,0,0,.3)",e.overflowY="auto",e.zIndex="99999999",e.maxHeight="calc(100vh - 32px)",e.fontFamily="Consolas, monospace",e.maxWidth="50vw",e.fontSize="12px",e.minWidth="300px",e.overflowWrap="break-word"}if(this.addEventListener("click",e=>{!e.ctrlKey||(e.preventDefault(),Fe=!Fe)}),this.dataProvider){let e=window;e[this.dataProvider]=this.publisher}this.addEventListener("mouseover",()=>{Fe||this.removeDebugger(),document.body.appendChild(this.debug),ks.add(this.debug)}),this.addEventListener("mouseout",()=>{Fe||this.removeDebugger()}),this.publisher.onInternalMutation(()=>{this.debug.innerHTML=`\u{1F916} DataProvider : "<b style="font-weight:700;color:#fff">${this.dataProvider}</b>"<br><div style="font-size:10px;border-top:1px dashed;margin-top:5px;padding-left:23px;opacity:.6;padding-top:5px">Variable disponible dans la console<br>ctrl + Clique : \xE9pingler / d\xE9s\xE9pingler</div><pre style="margin-top:10px;background:0 0;padding:0;font-size:inherit;color:inherit">${JSON.stringify(this.publisher.get(),null," ")}</pre>`})}}removeDebugger(){ks.forEach(e=>{document.body.contains(e)&&document.body.removeChild(e)}),ks=new Set}getApiConfiguration(){const e=this.getAncestorAttributeValue("token");let s=this.getAncestorAttributeValue("serviceURL"),o=null,n=null,l=null;return e||(o=this.getAncestorAttributeValue("userName"),n=this.getAncestorAttributeValue("password"),l=this.getAncestorAttributeValue("tokenProvider")),{serviceURL:s,token:e,userName:o,password:n,tokenProvider:l}}async initWording(){let e=!1;const s=Object.getOwnPropertyNames(this.constructor.prototype);for(let c of s)if(c.indexOf("wording_")==0){e=!0;break}if(!e)return;let o=K.getInstance().get("sonic-wording"),n=this.getAncestorAttributeValue("wordingProvider");const l=new se(this.getApiConfiguration());if(n){let c=[];for(let h of s)if(h.indexOf("wording_")==0){let b=h.substring(8);o.get()[h]||(o[h]="...",c.push(b))}if(c.length>0){let h=await l.post(n,{labels:c});for(let b in h)o["wording_"+b]=h[b]}o.startTemplateFilling(this),this.wordingPublisher=o}}createRenderRoot(){if(this.noShadowDom===""||this.getAttribute("noShadowDom")==="")return this;let e=super.createRenderRoot();return At.observe(e),e}initPublisher(){if(!document)return;this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate),this.onAssign&&this.publisher.offAssign(this.onAssign));const e=K.getInstance();this.dataProvider||(this.dataProvider=this.getAncestorAttributeValue("dataProvider"));let s=this.dataProvider;if(!s&&this._props&&(this.dataProvider=s="__subscriber__"+t.instanceCounter),s){this.bindPublisher&&e.set(s,this.bindPublisher());let o=e.get(s);if(this.dataProvider=s,this.hasAttribute("subDataProvider")){let n=this.getAttribute("subDataProvider");this.dataProvider=s+"/"+n,o=et.traverse(o,n.split(".")),e.set(this.dataProvider,o),this.publisher=o}this.publisher=o}this.publisher&&(this.onAssign=()=>{this.requestUpdate()},this.publisher.onAssign(this.onAssign),this.noAutoFill||this.publisher.startTemplateFilling(this),this.renderOnPropsInternalChange&&this.publisher.onInternalMutation(this.requestUpdate),this._props&&this.publisher.set(this._props))}};let r=t;return r.instanceCounter=0,re([a({type:Boolean})],r.prototype,"noAutoFill",2),re([a({type:Object})],r.prototype,"propertyMap",2),re([a({type:String,attribute:"data-title"})],r.prototype,"title",2),re([a({reflect:!0})],r.prototype,"dataProvider",2),re([a()],r.prototype,"bindPublisher",2),re([a()],r.prototype,"props",1),r};let yr=window;yr.SonicPublisherManager||(yr.SonicPublisherManager=K);var eo=Object.defineProperty,so=Object.getOwnPropertyDescriptor,ro=(i,t,r,e)=>{for(var s=e>1?void 0:e?so(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&eo(t,r,s),s};const $e=i=>{class t extends i{constructor(){super(...arguments),this.templates=null,this.templateValueAttribute="data-value",this.templateList=[],this.templateParts={},this.templatePartsList=[]}connectedCallback(){let e=this.templates||[...this.querySelectorAll("template")];for(let s of e)s.hasAttribute(this.templateValueAttribute)&&(this.templateParts[s.getAttribute(this.templateValueAttribute)]=s,this.templatePartsList.push(s));this.templateList=e.filter(s=>!s.getAttribute("data-value")),this.templateList.length==0&&(this.templateList=e),super.connectedCallback()}}return ro([a({type:Array})],t.prototype,"templates",2),t};var io=Object.defineProperty,oo=Object.getOwnPropertyDescriptor,V=(i,t,r,e)=>{for(var s=e>1?void 0:e?oo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&io(t,r,s),s};const no="sonic-date";let U=class extends I($e(v)){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=new Date().getTime()/1e3,this.end_date=0,this.era="",this.year="numeric",this.month="short",this.day="2-digit",this.weekday="short",this.hour="2-digit",this.minute="2-digit",this.language="",this.renderIf=!0,this.startDateObject=new Date,this.endDateObject=new Date}get wording_billet_periode_validite(){return this._wording_billet_periode_validite}set wording_billet_periode_validite(i){this._wording_billet_periode_validite=i,this.duAu=this.wording_billet_periode_validite.split("%s").map(t=>t.trim()),this.duAu.pop(),this.requestUpdate()}connectedCallback(){this.wording_billet_periode_validite="Du %s au %s",this.pageLanguage=ee.getLanguage(),super.connectedCallback()}getDatesParts(i,t,r){const e=new Intl.DateTimeFormat(this.language||this.pageLanguage,r);let s=this.startDateObject;s.setTime(i*1e3);let o=null;if(t>0){let n=this.endDateObject;if(n.setTime(t*1e3),o=e.formatRangeToParts(s,n),this.designMode)for(let c of o)c.type=="literal"&&this.designMode&&c.value.trim()==","&&(c.hidden=!0);const l=s.getFullYear()==n.getFullYear()&&s.getMonth()==n.getMonth()&&s.getDate()==n.getDate();if(o.some(c=>c.source=="endRange")&&!l){for(let c of o)if(c.type=="literal"&&c.source=="shared"&&c.value.trim().length>0&&!l){c.value=" "+this.duAu[1]+" ",c.type="to";break}this.designMode||o.unshift({type:"from",value:this.duAu[0]+" ",source:"shared"})}}else o=e.formatToParts(s);return o[0].value=Ne.ucFirst(o[0].value),o=o.filter(n=>n.hidden!==!0),o}render(){if(!this.renderIf)return P;if(this.date_string&&(this.date=new Date(this.date_string).getTime()/1e3),this.date&&(this.start_date=this.date),this.start_date_string&&(this.start_date=new Date(this.start_date_string).getTime()/1e3),this.end_date_string&&(this.end_date=new Date(this.end_date_string).getTime()/1e3),this.end_date>0&&this.end_date<this.start_date){const r=this.start_date;this.start_date=this.end_date,this.end_date=r}let i={weekday:this.weekday,year:this.year,month:this.month,day:this.day};this.hour&&(i.hour=this.hour),this.minute&&(i.minute=this.minute),this.era&&(i.era=this.era),this.time_zone&&(i.timeZone=this.time_zone);let t=this.getDatesParts(this.start_date,this.end_date,i);return u`${t.map(r=>{let e=this.templateParts[r.type];if(e){var s=document.importNode(e.content,!0);let o=s.children[0];return o.innerText.trim()==""&&(o.innerText=r.value),s}return u`<span class="${r.type}">${r.value}</span>`})}`}};V([a()],U.prototype,"wording_billet_periode_validite",1),V([a({type:Boolean})],U.prototype,"designMode",2),V([a({type:String})],U.prototype,"time_zone",2),V([a({type:Number})],U.prototype,"date",2),V([a({type:String})],U.prototype,"date_string",2),V([a({type:String})],U.prototype,"start_date_string",2),V([a({type:String})],U.prototype,"end_date_string",2),V([a({type:Number})],U.prototype,"start_date",2),V([a({type:Number})],U.prototype,"end_date",2),V([a({type:String})],U.prototype,"era",2),V([a({type:String})],U.prototype,"year",2),V([a({type:String})],U.prototype,"month",2),V([a({type:String})],U.prototype,"day",2),V([a({type:String})],U.prototype,"weekday",2),V([a({type:String})],U.prototype,"hour",2),V([a({type:String})],U.prototype,"minute",2),V([a({type:String})],U.prototype,"language",2),V([a({type:Boolean})],U.prototype,"renderIf",2),U=V([y(no)],U);const ao=w`:host([align="left"]) .sonic-loader--inline { margin-left:0; } :host([align="right"]) .sonic-loader--inline { margin-left:auto; margin-right:0; } .sonic-loader--inline { display:block; position: relative; width: 80px; height: 80px; margin:auto; z-index:20; } .sonic-loader--inline div { position: absolute; top: 33px; width: 13px; height: 13px; border-radius: 50%; background:var(--sc-loader-bg); animation-timing-function: cubic-bezier(0, 1, 1, 0); } .sonic-loader--inline div:nth-child(1) { left: 8px; animation: lds-ellipsis1 0.6s infinite; } .sonic-loader--inline div:nth-child(2) { left: 8px; animation: lds-ellipsis2 0.6s infinite; } .sonic-loader--inline div:nth-child(3) { left: 32px; animation: lds-ellipsis2 0.6s infinite; } .sonic-loader--inline div:nth-child(4) { left: 56px; animation: lds-ellipsis3 0.6s infinite; } @keyframes lds-ellipsis1 { 0% { transform: scale(0); } 100% { transform: scale(1); } } @keyframes lds-ellipsis3 { 0% { transform: scale(1); } 100% { transform: scale(0); } } @keyframes lds-ellipsis2 { 0% { transform: translate(0, 0); } 100% { transform: translate(24px, 0); } }`,lo=w`@keyframes sonic-loader--fixed { 0% { transform: scale(0); opacity: 0; } 5% { opacity: 1; } 70% { opacity:90%; } 100% { transform: scale(1); opacity: 0; } } .sonic-loader--fixed { position: fixed; top:50%; left:50%; transform:transateY(-50%) translateX(-50%); z-index:999; } .sonic-loader--fixed > div:nth-child(2) { animation-delay: -0.5s; } .sonic-loader--fixed > div:nth-child(3) { animation-delay: -0.2s; } .sonic-loader--fixed > div:nth-child(4) { display:none !important; } .sonic-loader--fixed > div { background-color: var(--sc-loader-bg); width: 5rem; height: 5rem; border-radius: 100%; margin: 2px; animation-fill-mode: both; position: absolute; top: 0px; opacity: 0; margin: 0; top: -2.5rem; left: -2.5rem; width: 5rem; height: 5rem; animation: sonic-loader--fixed 1s 0s linear infinite; }`;var co=Object.defineProperty,ho=Object.getOwnPropertyDescriptor,wr=(i,t,r,e)=>{for(var s=e>1?void 0:e?ho(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&co(t,r,s),s};const $r="sonic-loader";let q=class extends v{constructor(){super(...arguments),this.mode="fixed"}static show(i){q.loader||(q.loader=document.createElement("sonic-loader"));let t=q.loader;i||(i={});let r=i;for(let e in r)t.setAttribute(e,r[e]);i.container||(i.container=document.querySelector("sonic-theme")||document.body,i.mode="fixed"),i.container.appendChild(t),q.callCounter++}static hide(){q.callCounter--,!(q.callCounter>0)&&q.loader&&q.loader.remove()}render(){return u`<div class="sonic-loader sonic-loader--${this.mode}"><div></div><div></div><div></div><div></div></div>`}};q.styles=[ao,lo,w`:host { --sc-loader-bg: var(--sc-primary, currentColor); pointer-events: none; } .sonic-loader { opacity: 0; animation: showLoader 0.5s 0.5s forwards; } .sonic-loader--inline { animation-delay: 0s; } @keyframes showLoader { 0% { opacity: 0; } 100% { opacity: 1; } }`],q.callCounter=0,wr([a({type:String})],q.prototype,"mode",2),q=wr([y($r)],q);try{customElements.define($r,q)}catch{}/**
|
|
46
46
|
* @license
|
|
47
47
|
* Copyright 2017 Google LLC
|
|
48
48
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -54,7 +54,7 @@ var Wl=Object.defineProperty,Kl=Object.defineProperties;var Yl=Object.getOwnProp
|
|
|
54
54
|
* @license
|
|
55
55
|
* Copyright 2017 Google LLC
|
|
56
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
-
*/const _r=(i,t,r)=>{const e=new Map;for(let s=t;s<=r;s++)e.set(i[s],s);return e},Ft=ie(class extends oe{constructor(i){if(super(i),i.type!==Rt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,t,r){let e;r===void 0?r=t:t!==void 0&&(e=t);const s=[],o=[];let n=0;for(const l of i)s[n]=e?e(l,n):n,o[n]=r(l,n),n++;return{values:o,keys:s}}render(i,t,r){return this.dt(i,t,r).values}update(i,[t,r,e]){var s;const o=mo(i),{values:n,keys:l}=this.dt(t,r,e);if(!Array.isArray(o))return this.ut=l,n;const c=(s=this.ut)!==null&&s!==void 0?s:this.ut=[],h=[];let b,f,g=0,$=o.length-1,_=0,
|
|
57
|
+
*/const _r=(i,t,r)=>{const e=new Map;for(let s=t;s<=r;s++)e.set(i[s],s);return e},Ft=ie(class extends oe{constructor(i){if(super(i),i.type!==Rt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,t,r){let e;r===void 0?r=t:t!==void 0&&(e=t);const s=[],o=[];let n=0;for(const l of i)s[n]=e?e(l,n):n,o[n]=r(l,n),n++;return{values:o,keys:s}}render(i,t,r){return this.dt(i,t,r).values}update(i,[t,r,e]){var s;const o=mo(i),{values:n,keys:l}=this.dt(t,r,e);if(!Array.isArray(o))return this.ut=l,n;const c=(s=this.ut)!==null&&s!==void 0?s:this.ut=[],h=[];let b,f,g=0,$=o.length-1,_=0,k=n.length-1;for(;g<=$&&_<=k;)if(o[g]===null)g++;else if(o[$]===null)$--;else if(c[g]===l[_])h[_]=Nt(o[g],n[_]),g++,_++;else if(c[$]===l[k])h[k]=Nt(o[$],n[k]),$--,k--;else if(c[g]===l[k])h[k]=Nt(o[g],n[k]),xe(i,h[k+1],o[g]),g++,k--;else if(c[$]===l[_])h[_]=Nt(o[$],n[_]),xe(i,o[g],o[$]),$--,_++;else if(b===void 0&&(b=_r(l,_,k),f=_r(c,g,$)),b.has(c[g]))if(b.has(c[$])){const R=f.get(l[_]),D=R!==void 0?o[R]:null;if(D===null){const d=xe(i,o[g]);Nt(d,n[_]),h[_]=d}else h[_]=Nt(D,n[_]),xe(i,o[g],D),o[R]=null;_++}else As(o[$]),$--;else As(o[g]),g++;for(;_<=k;){const R=xe(i,h[k+1]);Nt(R,n[_]),h[_++]=R}for(;g<=$;){const R=o[g++];R!==null&&As(R)}return this.ut=l,fo(i,h),ht}});/**
|
|
58
58
|
* @license
|
|
59
59
|
* Copyright 2017 Google LLC
|
|
60
60
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -62,7 +62,7 @@ var Wl=Object.defineProperty,Kl=Object.defineProperties;var Yl=Object.getOwnProp
|
|
|
62
62
|
* @license
|
|
63
63
|
* Copyright 2017 Google LLC
|
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
65
|
-
*/class Cs extends oe{constructor(t){if(super(t),this.it=P,t.type!==Rt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===P||t==null)return this.ft=void 0,this.it=t;if(t===
|
|
65
|
+
*/class Cs extends oe{constructor(t){if(super(t),this.it=P,t.type!==Rt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===P||t==null)return this.ft=void 0,this.it=t;if(t===ht)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const r=[t];return r.raw=r,this.ft={_$litType$:this.constructor.resultType,strings:r,values:[]}}}Cs.directiveName="unsafeHTML",Cs.resultType=1;const It=ie(Cs);var jr={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">
|
|
66
66
|
<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"/>
|
|
67
67
|
</svg>
|
|
68
68
|
`,"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">
|
|
@@ -95,21 +95,21 @@ var Wl=Object.defineProperty,Kl=Object.defineProperties;var Yl=Object.getOwnProp
|
|
|
95
95
|
<path d="M12 17.01L12.01 16.9989" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
96
96
|
<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"/>
|
|
97
97
|
</svg>
|
|
98
|
-
`}};const Be=new Map,ke={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"},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"}};let Dr=!1;function Po(){var i,t;Dr||(Dr=!0,ke.custom={},ke.custom.url=(i=document.querySelector("[customIconLibraryPath]"))==null?void 0:i.getAttribute("customIconLibraryPath"),ke.custom.defaultPrefix=(t=document.querySelector("[customIconDefaultPrefix]"))==null?void 0:t.getAttribute("customIconDefaultPrefix"))}const Lr=class{static registerIcons(i){const t=jr;for(let r in i){const e=i[r],s=t[r]||{};for(let o in e)s[o]=e[o];t[r]=s}}};let Os=Lr;Os.fontAwesomeNext={get:async i=>{let t=i.library,r=i.name||"";const e=jr;if(t=="custom"&&Po(),t&&ke[t]){let s=ke[t],o=i.prefix||s.defaultPrefix,n=e[t]||{},l=o+"-"+r;if(n[l])return It(n[l]);let c=s.url.replace("$prefix",o).replace("$name",r);if(n[l])return It(n[l]);if(!Be.has(c)){let b=new Promise(async f=>{let g=await fetch(c);try{let $=await g.text();f($)}catch{f(null)}});Be.set(c,b)}let h=await Be.get(c);return Be.delete(c),n[l]=h,It(h)}return It(e.core[i.name]||"")}},Os.default=Lr.fontAwesomeNext;var Co=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,Ve=(i,t,r,e)=>{for(var s=e>1?void 0:e?Oo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Co(t,r,s),s};const zr="sonic-icon";let Ut=class extends v{constructor(){super(...arguments),this.iconText="",this._name="",this._prefix="",this._library=""}async updateIcon(){!this.name||(this.iconText=await Os.default.get({name:this.name,prefix:this.prefix,library:this.library}),this.requestUpdate())}get name(){return this._name}set name(i){this._name=i,this.updateIcon()}get prefix(){return this._prefix}set prefix(i){this._prefix=i,this.updateIcon()}get library(){return this._library}set library(i){this._library=i,this.updateIcon()}render(){return this.name?(this.style.removeProperty("display"),this.iconText):(this.style.display="none",P)}};Ut.styles=w`:host { line-height: 0; width: fit-content; height: fit-content; vertical-align: -0.125em; } svg { height: var(--sc-icon-size, 1em); width: var(--sc-icon-size, 1em); } svg:not([fill="none"]){ fill: currentColor; } svg[fill="none"]{ stroke-width: 2; } :host([size="2xs"]) svg { --sc-icon-size: 0.625em; } :host([size="xs"]) svg { --sc-icon-size: 0.75em; } :host([size="sm"]) svg { --sc-icon-size: 0.875em; } :host([size="lg"]) svg { --sc-icon-size: 1.25em; } :host([size="xl"]) svg { --sc-icon-size: 1.5em; } :host([size="2xl"]) svg { --sc-icon-size: 2em; }`,Ve([a({type:String})],Ut.prototype,"name",1),Ve([a({type:String})],Ut.prototype,"prefix",1),Ve([a({type:String})],Ut.prototype,"library",1),Ut=Ve([y(zr)],Ut);try{customElements.define(zr,Ut)}catch{}/**
|
|
98
|
+
`}};const Be=new Map,ke={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"},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"}};let Dr=!1;function Po(){var i,t;Dr||(Dr=!0,ke.custom={},ke.custom.url=(i=document.querySelector("[customIconLibraryPath]"))==null?void 0:i.getAttribute("customIconLibraryPath"),ke.custom.defaultPrefix=(t=document.querySelector("[customIconDefaultPrefix]"))==null?void 0:t.getAttribute("customIconDefaultPrefix"))}const Lr=class{static registerIcons(i){const t=jr;for(let r in i){const e=i[r],s=t[r]||{};for(let o in e)s[o]=e[o];t[r]=s}}};let Os=Lr;Os.fontAwesomeNext={get:async i=>{let t=i.library,r=i.name||"";const e=jr;if(t=="custom"&&Po(),t&&ke[t]){let s=ke[t],o=i.prefix||s.defaultPrefix,n=e[t]||{},l=o+"-"+r;if(n[l])return It(n[l]);let c=s.url.replace("$prefix",o).replace("$name",r);if(n[l])return It(n[l]);if(!Be.has(c)){let b=new Promise(async f=>{let g=await fetch(c);if(!g.ok){f(`<b title="Erreur ${g.status}">\u{1F636}</b>`);return}try{let $=await g.text();f($)}catch{f(null)}});Be.set(c,b)}let h=await Be.get(c);return Be.delete(c),n[l]=h,It(h)}return It(e.core[i.name]||"")}},Os.default=Lr.fontAwesomeNext;var Co=Object.defineProperty,Oo=Object.getOwnPropertyDescriptor,Ve=(i,t,r,e)=>{for(var s=e>1?void 0:e?Oo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Co(t,r,s),s};const zr="sonic-icon";let Ut=class extends v{constructor(){super(...arguments),this.iconText="",this._name="",this._prefix="",this._library=""}async updateIcon(){!this.name||(this.iconText=await Os.default.get({name:this.name,prefix:this.prefix,library:this.library}),this.requestUpdate())}get name(){return this._name}set name(i){this._name=i,this.updateIcon()}get prefix(){return this._prefix}set prefix(i){this._prefix=i,this.updateIcon()}get library(){return this._library}set library(i){this._library=i,this.updateIcon()}render(){return this.name?(this.style.removeProperty("display"),this.iconText):(this.style.display="none",P)}};Ut.styles=w`:host { line-height: 0; width: fit-content; height: fit-content; vertical-align: -0.125em; } svg { height: var(--sc-icon-size, 1em); width: var(--sc-icon-size, 1em); } svg:not([fill="none"]){ fill: currentColor; } svg[fill="none"]{ stroke-width: 2; } :host([size="2xs"]) svg { --sc-icon-size: 0.625em; } :host([size="xs"]) svg { --sc-icon-size: 0.75em; } :host([size="sm"]) svg { --sc-icon-size: 0.875em; } :host([size="lg"]) svg { --sc-icon-size: 1.25em; } :host([size="xl"]) svg { --sc-icon-size: 1.5em; } :host([size="2xl"]) svg { --sc-icon-size: 2em; }`,Ve([a({type:String})],Ut.prototype,"name",1),Ve([a({type:String})],Ut.prototype,"prefix",1),Ve([a({type:String})],Ut.prototype,"library",1),Ut=Ve([y(zr)],Ut);try{customElements.define(zr,Ut)}catch{}/**
|
|
99
99
|
* @license
|
|
100
100
|
* Copyright 2018 Google LLC
|
|
101
101
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
-
*/const ht=ie(class extends oe{constructor(i){var t;if(super(i),i.type!==Rt.ATTRIBUTE||i.name!=="style"||((t=i.strings)===null||t===void 0?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,r)=>{const e=i[r];return e==null?t:t+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(i,[t]){const{style:r}=i.element;if(this.ct===void 0){this.ct=new Set;for(const e in t)this.ct.add(e);return this.render(t)}this.ct.forEach(e=>{t[e]==null&&(this.ct.delete(e),e.includes("-")?r.removeProperty(e):r[e]="")});for(const e in t){const s=t[e];s!=null&&(this.ct.add(e),e.includes("-")?r.setProperty(e,s):r[e]=s)}return ct}}),qe=w`.custom-scroll { overflow:auto !important; } .custom-scroll::-webkit-scrollbar { width: 0.5rem; height: 0.5rem; border: solid .15rem transparent; border-radius: var(--sc-rounded); background:transparent; } .custom-scroll::-webkit-scrollbar-thumb { box-shadow: inset 0 0 2rem 2rem var(--sc-scrollbar-bg); border-radius: var(--sc-rounded); border: solid .15rem transparent; }`;var Eo=Object.defineProperty,jo=Object.getOwnPropertyDescriptor,At=(i,t,r,e)=>{for(var s=e>1?void 0:e?jo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Eo(t,r,s),s};const Do={warning:"warning-circled-outline",success:"check-circled-outline",error:"warning-circled-outline",info:"info-empty"},Lo="sonic-toast-item";let gt=class extends v{constructor(){super(...arguments),this.title="",this.text="",this.status="",this.ghost=!1,this.preserve=!1,this.maxHeight="10rem",this.visible=!0}render(){return this.visible?u`<div class="sonic-toast ${this.status} ${this.ghost?"ghost":""}"><button aria-label="Close" class="sonic-toast-close" @click="${()=>this.hide()}"><sonic-icon name="cancel" size="lg"></sonic-icon></button><div class="sonic-toast-content custom-scroll" style="max-height:${this.maxHeight}">${this.status&&u`<sonic-icon name="${Do[this.status]}" class="sonic-toast-icon" size="2xl"></sonic-icon>`}<div class="sonic-toast-text">${this.title?u`<div class="sonic-toast-title">${this.title}</div>`:""} ${this.text?It(this.text):""}<slot></slot></div>${this.preserve?"":this.autoHide()}</div></div>`:P}hide(){this.closest("sonic-toast")||(this.visible=!1),this.dispatchEvent(new CustomEvent("hide",{bubbles:!0}))}show(){this.visible=!0}autoHide(){setTimeout(()=>{this.hide()},4200)}};gt.styles=[qe,w`* { box-sizing: border-box; } :host { display: block; pointer-events: auto; position: relative; --sc-toast-status-color: transparent; --sc-toast-color: var(--sc-base-content); --sc-toast-bg: var(--sc-base); --sc-toast-rounded: var(--sc-rounded-md); --sc-toast-shadow: var(--sc-shadow-lg); } .fixed-area { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 999; display: flex; flex-direction: column-reverse; } .sonic-toast { position: relative; pointer-events: auto; overflow:hidden; line-height: 1.25; color: var(--sc-toast-color); box-shadow: var(--sc-toast-shadow); border-radius: var(--sc-toast-rounded); background: var(--sc-toast-bg); } .sonic-toast-content { padding: 1em 2rem 1em 1em; display: flex; gap: 0.5rem; overflow: auto; position:relative; } .sonic-toast-text { align-self: center; margin-top: auto; margin-bottom: auto; max-width:70ch; } ::slotted(a), .sonic-toast-text a { color: inherit; text-decoration: underline; text-underline-offset: 0.15rem; } /*BUTTON CLOSE*/ .sonic-toast-close { all: unset; position: absolute; z-index:4; pointer-events: initial; right: 0.5em; top: 0.5em; width: 1.5rem; height: 1.5rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; text-align: center; opacity: 0.5; background: rgba(0, 0, 0, 0); } .sonic-toast-close:focus, .sonic-toast-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.075); } .sonic-toast-close svg { width: 1rem; height: 1rem; object-fit: contain; object-position: center center; } /*Title*/ .sonic-toast-title { font-weight: bold; font-size: 1.15rem; margin: 0.15em 0 0.25em; } /*STATUS*/ .success { --sc-toast-status-color: var(--sc-success); --sc-toast-title-color: var(--sc-toast-status-color); } .error { --sc-toast-status-color: var(--sc-danger); --sc-toast-title-color: var(--sc-toast-status-color); } .warning { --sc-toast-status-color: var(--sc-warning); --sc-toast-title-color: var(--sc-toast-status-color); } .info { --sc-toast-status-color: var(--sc-info); --sc-toast-title-color: var(--sc-toast-status-color); } .success, .error, .info, .warning { border-top: 3px solid var(--sc-toast-status-color, currentColor); } .sonic-toast:before { content: ""; display: block; position: absolute; left: 0; top: 0; right: 0; bottom: 0; opacity: 0.05; pointer-events: none; transition: 0.2s; border-radius: var(--sc-toast-rounded); background-color: var(--sc-toast-status-color); } .sonic-toast:hover:before { opacity: 0.025; } .info .sonic-toast-icon, .error .sonic-toast-icon, .success .sonic-toast-icon, .warning .sonic-toast-icon { color: var(--sc-toast-status-color, currentColor); } .sonic-toast-icon { position:sticky; top:0; } .ghost { opacity: 0.85; pointer-events: none; }`],At([a({type:String})],gt.prototype,"title",2),At([a({type:String})],gt.prototype,"text",2),At([a({type:String})],gt.prototype,"status",2),At([a({type:Boolean})],gt.prototype,"ghost",2),At([a({type:Boolean})],gt.prototype,"preserve",2),At([a({type:String})],gt.prototype,"maxHeight",2),At([Z()],gt.prototype,"visible",2),gt=At([y(Lo)],gt);var zo=Object.defineProperty,To=Object.getOwnPropertyDescriptor,Tr=(i,t,r,e)=>{for(var s=e>1?void 0:e?To(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&zo(t,r,s),s};const Mo="sonic-toast";let dt=class extends v{constructor(){super(...arguments),this.toasts=[]}createRenderRoot(){return this}render(){const i=window.parent!=window;let t={pointerEvents:"none",gap:"1rem",display:"flex",margin:"1rem"};return i||(t=Me(J({},t),{margin:"0",width:"calc(100% - 2.5rem)",position:"fixed",bottom:"1.25rem",right:"1.25rem",zIndex:"999",maxWidth:"64ch",flexDirection:"column-reverse"})),this.toasts?u`<div aria-live="polite" style="${ht(t)}">${Ft(this.toasts,r=>r.id,r=>u`<sonic-toast-item maxHeight="${i?"none":"10rem"}" status="${r.status}" ?ghost="${r.ghost}" ?preserve="${r.preserve}" id="${r.id}" @hide="${()=>this.removeItem(r)}" ${Ue({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})}>${r.text?It(r.text):""}</sonic-toast-item>`)}</div>`:P}static removeAll(){let i=document.querySelector("sonic-toast");!i||(i.toasts=i.toasts.filter(t=>t.ghost))}static add(i){if(!document.querySelector("sonic-toast")){let o=document.createElement("sonic-toast");(document.querySelector("sonic-theme")||document.body).prepend(o)}let t=document.querySelector("sonic-toast");const r=new Date().valueOf(),e=new RegExp("</a>|</button>").test(i.text),s={id:r,text:i.text,title:i.title,status:i.status,preserve:e?!0:i.preserve,ghost:i.ghost};if(t.toasts.length>0){let o=J({},s),n=J({},t.toasts[t.toasts.length-1]);if(o.id=n.id=0,!s.preserve&&et.shallowEqual(o,n))return null}return t.toasts=[...t.toasts,s],s}removeItem(i){this.toasts=this.toasts.filter(t=>t!=i)}};if(Tr([a({type:Array})],dt.prototype,"toasts",2),dt=Tr([y(Mo)],dt),typeof window<"u"){let i=window;i.SonicToast=dt}const st=class{static listen(){var t;if(!st.listening)return;let i=(t=document.location)==null?void 0:t.href.replace(document.location.origin,"");st.prevURL&&st.prevURL!=i&&(st.prevURL=i,st.listeners.forEach(r=>{r.location=i})),window.requestAnimationFrame(st.listen)}static offChange(i){let t=st.listeners.indexOf(i);t!=-1&&(st.listeners.splice(t,1),st.listeners.length==0&&(st.listening=!1))}static onChange(i){st.listening||(st.listening=!0,st.listen()),st.listeners.push(i)}static changeFromComponent(i){if(i.goBack!==null){const n=document.location.origin;let l=i.goBack||n;if((document.referrer.indexOf("http")!=0||new URL(document.referrer).origin!=n)&&l!=document.location.href){let c=history.state||{};c.concorde=c.concorde||{},c.concorde.hasDoneHistoryBack=!0,history.pushState(c,document.title),history.back(),document.location.replace(l)}else history.back();return}let t=i.getAttribute("to");if(t||(t=i.href),!t)return;if(t.indexOf("#")==0){document.location.hash=t.substring(1);return}let r=new URL(t,document.location.href),e=r.pathname.split("/"),s=[],o="";for(let n of e)n!=o&&s.push(n),o=n;t="/"+s.join("/")+r.search+(r.hash?+r.hash:""),i.hasAttribute("pushState")?history.pushState(null,"",t):i.hasAttribute("replaceState")?history.replaceState(null,"",t):document.location.href=t}static updateComponentActiveState(i){if(i.autoActive!="disabled"&&i.href&&i.href.indexOf("http")!=0){let t=new URL(i.href,document.location.href),r=new URL(i.location,document.location.origin),e=!1;i.autoActive=="strict"?e=t.pathname==r.pathname&&t.hash==r.hash&&t.search==r.search:e=r.href.indexOf(t.href)==0,e?i.setAttribute("active","true"):i.removeAttribute("active")}}};let G=st;G.listeners=[],G.listening=!1,G.prevURL=(Fi=document.location)==null?void 0:Fi.href.replace(document.location.origin,"");var Ro=Object.defineProperty,No=Object.getOwnPropertyDescriptor,Bt=(i,t,r,e)=>{for(var s=e>1?void 0:e?No(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ro(t,r,s),s};const He=new Map,ne=i=>{class t extends i{constructor(...e){super(),this.touched=!1,this.error=null,this.autofocus=null,this.disabled=null,this.required=null,this.onValueAssign=null,this.onFormValueAssign=null,this.onFormDataInValidate=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=s=>{this.setValueFromPublisher(s)},this.onFormValueAssign=s=>{this.setFormValueFromPublisher(s)},this.onFormDataInValidate=()=>{!this.getFormPublisher().isFormValid.get()||this.validateFormElement()}}get name(){return this._name}set name(e){this._name=e}validateFormElement(){}updateDataValue(){if(this._name){let e=this.getFormPublisher();e&&(e[this._name]=this.getValueForFormPublisher(),this.setFormValueFromPublisher(e[this.name].get()))}}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?K.get(this.formDataProvider):this.publisher}getValueForFormPublisher(){return this.value}setValueFromPublisher(e){this.value=e}setFormValueFromPublisher(e){this.value=e}get value(){return this._value}set value(e){et.isObject(e)&&e.hasOwnProperty("__value")&&e.value==null||e!=null&&this._value!=e&&(this._value=e,this.updateDataValue(),this.requestUpdate())}initPublisher(){this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);let e=this.getFormPublisher();this._name&&e&&e[this._name].offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.updateDataValue(),this.publisher&&this._name&&this.publisher[this._name].onAssign(this.onValueAssign),e=this.getFormPublisher(),this._name&&e&&(e[this._name].onAssign(this.onFormValueAssign),e.onInvalidate(this.onFormDataInValidate))}handleChange(e){this.value=e.target.value;const s=new Event("change");this.dispatchEvent(s)}addKeyboardNavigation(){let e=this.getAncestorAttributeValue("data-keyboard-nav");if(!e)return;let s=e.split(" "),o=s[0];if(!o)return;for(let l of s){He.has(l)||He.set(l,[]);let c=He.get(l);c.indexOf(this)==-1&&c.push(this)}let n=He.get(o);this.addEventListener("keydown",l=>{if(!["ArrowDown","ArrowUp"].includes(l.key))return;let c="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",h=n.filter(g=>{let $=g.shadowRoot.querySelector(c);if(!$)return!1;let _=window.getComputedStyle($);return _.display!=="none"&&_.display!==""&&_.pointerEvents!="none"&&_.visibility!=="hidden"&&$.getBoundingClientRect().width>0}),b=null;if(l.key=="ArrowDown"){let g=h.indexOf(this);g==h.length-1?b=h[0]:b=h[g+1]}else if(l.key=="ArrowUp"){let g=h.indexOf(this);g==0?b=h[h.length-1]:b=h[g-1]}let f=b.shadowRoot.querySelector(c);f&&(f.focus(),l.preventDefault())})}connectedCallback(){super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);let e=this.getFormPublisher();this._name&&e&&(e[this._name].offAssign(this.onFormValueAssign),e.offInvalidate(this.onFormDataInValidate))}}return Bt([a({type:Boolean,reflect:!0})],t.prototype,"touched",2),Bt([a({type:Boolean})],t.prototype,"error",2),Bt([a({type:Boolean})],t.prototype,"autofocus",2),Bt([a({type:Boolean})],t.prototype,"disabled",2),Bt([a({type:Boolean})],t.prototype,"required",2),Bt([a()],t.prototype,"name",1),Bt([a()],t.prototype,"value",1),t};var Fo=Object.defineProperty,Io=Object.getOwnPropertyDescriptor,Ae=(i,t,r,e)=>{for(var s=e>1?void 0:e?Io(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Fo(t,r,s),s};const Es=i=>{class t extends i{constructor(){super(...arguments),this._value="",this._name="",this.unique=null,this.radio=null,this._checked=null}get value(){return this._value}set value(e){this.hasAttribute("value")&&(e=this.getAttribute("value")),this._value!=e&&(this._value=e,this.updateDataValue(),this.requestUpdate())}get name(){return this._name}set name(e){this.hasAttribute("name")&&(e=this.getAttribute("name")),this._name=e}get checked(){return this._checked}set checked(e){this.setCheckedValue(e)}validateFormElement(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector("input");if(!e||e.checkValidity())return;let s=this.getFormPublisher()[this.name].get();(this.unique||this.radio)&&s!==null&&s.toString().length>0||(this.getFormPublisher().isFormValid=!1,e.reportValidity())}setCheckedValue(e){this._checked!=e&&(this._checked=e,this.updateDataValue(),this.requestUpdate(),this.publisher&&!this.radio&&!this.unique&&(this.publisher.checked=this._checked))}handleChange(){this.checked=this.checked?this.radio?!0:null:!0;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){let e=this.getFormPublisher()[this.name].get();if(this.unique||this.radio)return this.checked&&this.value!=null?this.value:e;Array.isArray(e)||(e=[]),e=e.slice(0);let s=e.indexOf(this.value);return this.checked===!0&&s===-1&&e.push(this.value),this.checked===null&&s!==-1&&e.splice(s,1),e}setFormValueFromPublisher(e){if(this.unique||this.radio){this.checked=this.value==e?!0:null;return}Array.isArray(e)||(e=[]),this.checked=e.indexOf(this.value)!==-1?!0:null}initPublisher(){super.initPublisher(),!!this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&(this.checked=!0)}}return Ae([a()],t.prototype,"value",1),Ae([a()],t.prototype,"name",1),Ae([a({type:Boolean})],t.prototype,"unique",2),Ae([a({type:Boolean})],t.prototype,"radio",2),Ae([a()],t.prototype,"checked",1),t};/**
|
|
102
|
+
*/const dt=ie(class extends oe{constructor(i){var t;if(super(i),i.type!==Rt.ATTRIBUTE||i.name!=="style"||((t=i.strings)===null||t===void 0?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,r)=>{const e=i[r];return e==null?t:t+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(i,[t]){const{style:r}=i.element;if(this.ct===void 0){this.ct=new Set;for(const e in t)this.ct.add(e);return this.render(t)}this.ct.forEach(e=>{t[e]==null&&(this.ct.delete(e),e.includes("-")?r.removeProperty(e):r[e]="")});for(const e in t){const s=t[e];s!=null&&(this.ct.add(e),e.includes("-")?r.setProperty(e,s):r[e]=s)}return ht}}),qe=w`.custom-scroll { overflow:auto !important; } .custom-scroll::-webkit-scrollbar { width: 0.5rem; height: 0.5rem; border: solid .15rem transparent; border-radius: var(--sc-rounded); background:transparent; } .custom-scroll::-webkit-scrollbar-thumb { box-shadow: inset 0 0 2rem 2rem var(--sc-scrollbar-bg); border-radius: var(--sc-rounded); border: solid .15rem transparent; }`;var Eo=Object.defineProperty,jo=Object.getOwnPropertyDescriptor,ft=(i,t,r,e)=>{for(var s=e>1?void 0:e?jo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Eo(t,r,s),s};const Do={warning:"warning-circled-outline",success:"check-circled-outline",error:"warning-circled-outline",info:"info-empty"},Lo="sonic-toast-item";let lt=class extends v{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 i=localStorage.getItem("sonic-toast-dismissed")||"{}";if(JSON.parse(i)[this.id])return P}return this.visible?u`<div class="sonic-toast ${this.status} ${this.ghost?"ghost":""}"><button aria-label="Close" class="sonic-toast-close" @click="${()=>this.hide()}"><sonic-icon name="cancel" size="lg"></sonic-icon></button><div class="sonic-toast-content custom-scroll" style="max-height:${this.maxHeight}">${this.status&&u`<sonic-icon name="${Do[this.status]}" class="sonic-toast-icon" size="2xl"></sonic-icon>`}<div class="sonic-toast-text">${this.title?u`<div class="sonic-toast-title">${this.title}</div>`:""} ${this.text?It(this.text):""}<slot></slot></div>${this.preserve?"":this.autoHide()}</div></div>`:P}hide(){if(this.closest("sonic-toast")||(this.visible=!1),this.dismissForever){const i=localStorage.getItem("sonic-toast-dismissed")||"{}",t=JSON.parse(i);t[this.id]=!0,localStorage.setItem("sonic-toast-dismissed",JSON.stringify(t))}this.dispatchEvent(new CustomEvent("hide",{bubbles:!0}))}show(){this.visible=!0}autoHide(){setTimeout(()=>{this.hide()},4200)}};lt.styles=[qe,w`* { box-sizing: border-box; } :host { display: block; pointer-events: auto; position: relative; --sc-toast-status-color: transparent; --sc-toast-color: var(--sc-base-content); --sc-toast-bg: var(--sc-base); --sc-toast-rounded: var(--sc-rounded-md); --sc-toast-shadow: var(--sc-shadow-lg); } .fixed-area { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 999; display: flex; flex-direction: column-reverse; } .sonic-toast { position: relative; pointer-events: auto; overflow:hidden; line-height: 1.25; color: var(--sc-toast-color); box-shadow: var(--sc-toast-shadow); border-radius: var(--sc-toast-rounded); background: var(--sc-toast-bg); } .sonic-toast-content { padding: 1em 2rem 1em 1em; display: flex; gap: 0.5rem; overflow: auto; position:relative; } .sonic-toast-text { align-self: center; margin-top: auto; margin-bottom: auto; max-width:70ch; } ::slotted(a), .sonic-toast-text a { color: inherit; text-decoration: underline; text-underline-offset: 0.15rem; } /*BUTTON CLOSE*/ .sonic-toast-close { all: unset; position: absolute; z-index:4; pointer-events: initial; right: 0.5em; top: 0.5em; width: 1.5rem; height: 1.5rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; text-align: center; opacity: 0.5; background: rgba(0, 0, 0, 0); } .sonic-toast-close:focus, .sonic-toast-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.075); } .sonic-toast-close svg { width: 1rem; height: 1rem; object-fit: contain; object-position: center center; } /*Title*/ .sonic-toast-title { font-weight: bold; font-size: 1.15rem; margin: 0.15em 0 0.25em; } /*STATUS*/ .success { --sc-toast-status-color: var(--sc-success); --sc-toast-title-color: var(--sc-toast-status-color); } .error { --sc-toast-status-color: var(--sc-danger); --sc-toast-title-color: var(--sc-toast-status-color); } .warning { --sc-toast-status-color: var(--sc-warning); --sc-toast-title-color: var(--sc-toast-status-color); } .info { --sc-toast-status-color: var(--sc-info); --sc-toast-title-color: var(--sc-toast-status-color); } .success, .error, .info, .warning { border-top: 3px solid var(--sc-toast-status-color, currentColor); } .sonic-toast:before { content: ""; display: block; position: absolute; left: 0; top: 0; right: 0; bottom: 0; opacity: 0.05; pointer-events: none; transition: 0.2s; border-radius: var(--sc-toast-rounded); background-color: var(--sc-toast-status-color); } .sonic-toast:hover:before { opacity: 0.025; } .info .sonic-toast-icon, .error .sonic-toast-icon, .success .sonic-toast-icon, .warning .sonic-toast-icon { color: var(--sc-toast-status-color, currentColor); } .sonic-toast-icon { position:sticky; top:0; } .ghost { opacity: 0.85; pointer-events: none; }`],ft([a({type:String})],lt.prototype,"title",2),ft([a({type:String})],lt.prototype,"id",2),ft([a({type:String})],lt.prototype,"text",2),ft([a({type:String})],lt.prototype,"status",2),ft([a({type:Boolean})],lt.prototype,"ghost",2),ft([a({type:Boolean})],lt.prototype,"preserve",2),ft([a({type:Boolean})],lt.prototype,"dismissForever",2),ft([a({type:String})],lt.prototype,"maxHeight",2),ft([Z()],lt.prototype,"visible",2),lt=ft([y(Lo)],lt);var zo=Object.defineProperty,To=Object.getOwnPropertyDescriptor,Tr=(i,t,r,e)=>{for(var s=e>1?void 0:e?To(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&zo(t,r,s),s};const Mo="sonic-toast";let pt=class extends v{constructor(){super(...arguments),this.toasts=[]}createRenderRoot(){return this}render(){const i=window.parent!=window;let t={pointerEvents:"none",gap:"1rem",display:"flex",margin:"1rem"};return i||(t=Me(J({},t),{margin:"0",width:"calc(100% - 2.5rem)",position:"fixed",bottom:"1.25rem",right:"1.25rem",zIndex:"999",maxWidth:"64ch",flexDirection:"column-reverse"})),this.toasts?u`<div aria-live="polite" style="${dt(t)}">${Ft(this.toasts,r=>r.id,r=>u`<sonic-toast-item maxHeight="${i?"none":"10rem"}" status="${r.status}" ?ghost="${r.ghost}" ?dismissForever="${r.dismissForever}" ?preserve="${r.preserve}" id="${r.id}" @hide="${()=>this.removeItem(r)}" ${Ue({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})}>${r.text?It(r.text):""}</sonic-toast-item>`)}</div>`:P}static removeAll(){let i=document.querySelector("sonic-toast");!i||(i.toasts=i.toasts.filter(t=>t.ghost))}static add(i){var o;if(!document.querySelector("sonic-toast")){let n=document.createElement("sonic-toast");(document.querySelector("sonic-theme")||document.body).prepend(n)}let t=document.querySelector("sonic-toast");const r=(o=i.id)!=null?o:new Date().valueOf(),e=new RegExp("</a>|</button>").test(i.text),s={id:r,text:i.text,title:i.title,status:i.status,preserve:e?!0:i.preserve,ghost:i.ghost,dismissForever:i.dismissForever};if(i.dismissForever&&i.id){const n=localStorage.getItem("sonic-toast-dismissed")||"{}";if(JSON.parse(n)[i.id])return null}if(t.toasts.length>0){let n=J({},s),l=J({},t.toasts[t.toasts.length-1]);if(n.id=l.id=0,!s.preserve&&et.shallowEqual(n,l))return null}return t.toasts=[...t.toasts,s],s}removeItem(i){this.toasts=this.toasts.filter(t=>t!=i)}};if(Tr([a({type:Array})],pt.prototype,"toasts",2),pt=Tr([y(Mo)],pt),typeof window<"u"){let i=window;i.SonicToast=pt}const st=class{static listen(){var t;if(!st.listening)return;let i=(t=document.location)==null?void 0:t.href.replace(document.location.origin,"");st.prevURL&&st.prevURL!=i&&(st.prevURL=i,st.listeners.forEach(r=>{r.location=i})),window.requestAnimationFrame(st.listen)}static offChange(i){let t=st.listeners.indexOf(i);t!=-1&&(st.listeners.splice(t,1),st.listeners.length==0&&(st.listening=!1))}static onChange(i){st.listening||(st.listening=!0,st.listen()),st.listeners.push(i)}static changeFromComponent(i){if(i.goBack!==null){const n=document.location.origin;let l=i.goBack||n;if((document.referrer.indexOf("http")!=0||new URL(document.referrer).origin!=n)&&l!=document.location.href){let c=history.state||{};c.concorde=c.concorde||{},c.concorde.hasDoneHistoryBack=!0,history.pushState(c,document.title),history.back(),document.location.replace(l)}else history.back();return}let t=i.getAttribute("to");if(t||(t=i.href),!t)return;if(t.indexOf("#")==0){document.location.hash=t.substring(1);return}let r=new URL(t,document.location.href),e=r.pathname.split("/"),s=[],o="";for(let n of e)n!=o&&s.push(n),o=n;t="/"+s.join("/")+r.search+(r.hash?+r.hash:""),i.hasAttribute("pushState")?history.pushState(null,"",t):i.hasAttribute("replaceState")?history.replaceState(null,"",t):document.location.href=t}static updateComponentActiveState(i){if(i.autoActive!="disabled"&&i.href&&i.href.indexOf("http")!=0){let t=new URL(i.href,document.location.href),r=new URL(i.location,document.location.origin),e=!1;i.autoActive=="strict"?e=t.pathname==r.pathname&&t.hash==r.hash&&t.search==r.search:e=r.href.indexOf(t.href)==0,e?i.setAttribute("active","true"):i.removeAttribute("active")}}};let G=st;G.listeners=[],G.listening=!1,G.prevURL=(Fi=document.location)==null?void 0:Fi.href.replace(document.location.origin,"");var Ro=Object.defineProperty,No=Object.getOwnPropertyDescriptor,Bt=(i,t,r,e)=>{for(var s=e>1?void 0:e?No(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ro(t,r,s),s};const He=new Map,ne=i=>{class t extends i{constructor(...e){super(),this.touched=!1,this.error=null,this.autofocus=!1,this.disabled=null,this.required=null,this.onValueAssign=null,this.onFormValueAssign=null,this.onFormDataInValidate=null,this.formDataProvider="",this._name="",this._value="",this.onValueAssign=s=>{this.setValueFromPublisher(s)},this.onFormValueAssign=s=>{this.setFormValueFromPublisher(s)},this.onFormDataInValidate=()=>{!this.getFormPublisher().isFormValid.get()||this.validateFormElement()}}get name(){return this._name}set name(e){this._name=e}validateFormElement(){}updateDataValue(){if(this._name){let e=this.getFormPublisher();e&&(e[this._name]=this.getValueForFormPublisher(),this.setFormValueFromPublisher(e[this.name].get()))}}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?K.get(this.formDataProvider):this.publisher}getValueForFormPublisher(){return this.value}setValueFromPublisher(e){this.value=e}setFormValueFromPublisher(e){this.value=e}get value(){return this._value}set value(e){et.isObject(e)&&e.hasOwnProperty("__value")&&e.value==null||e!=null&&this._value!=e&&(this._value=e,this.updateDataValue(),this.requestUpdate())}initPublisher(){this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);let e=this.getFormPublisher();this._name&&e&&e[this._name].offAssign(this.onFormValueAssign),super.initPublisher(),this.name||(this._name=this.getAttribute("name")),this.value||(this._value=this.getAttribute("value")),this.updateDataValue(),this.publisher&&this._name&&this.publisher[this._name].onAssign(this.onValueAssign),e=this.getFormPublisher(),this._name&&e&&(e[this._name].onAssign(this.onFormValueAssign),e.onInvalidate(this.onFormDataInValidate))}handleChange(e){this.value=e.target.value;const s=new Event("change");this.dispatchEvent(s)}addKeyboardNavigation(){let e=this.getAncestorAttributeValue("data-keyboard-nav");if(!e)return;let s=e.split(" "),o=s[0];if(!o)return;for(let l of s){He.has(l)||He.set(l,[]);let c=He.get(l);c.indexOf(this)==-1&&c.push(this)}let n=He.get(o);this.addEventListener("keydown",l=>{if(!["ArrowDown","ArrowUp"].includes(l.key))return;let c="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",h=n.filter(g=>{let $=g.shadowRoot.querySelector(c);if(!$)return!1;let _=window.getComputedStyle($);return _.display!=="none"&&_.display!==""&&_.pointerEvents!="none"&&_.visibility!=="hidden"&&$.getBoundingClientRect().width>0}),b=null;if(l.key=="ArrowDown"){let g=h.indexOf(this);g==h.length-1?b=h[0]:b=h[g+1]}else if(l.key=="ArrowUp"){let g=h.indexOf(this);g==0?b=h[h.length-1]:b=h[g-1]}let f=b.shadowRoot.querySelector(c);f&&(f.focus(),l.preventDefault())})}connectedCallback(){super.connectedCallback(),this.addKeyboardNavigation()}disconnectedCallback(){super.disconnectedCallback(),this._name&&this.publisher&&this.publisher[this._name].offAssign(this.onValueAssign);let e=this.getFormPublisher();this._name&&e&&(e[this._name].offAssign(this.onFormValueAssign),e.offInvalidate(this.onFormDataInValidate))}}return Bt([a({type:Boolean,reflect:!0})],t.prototype,"touched",2),Bt([a({type:Boolean})],t.prototype,"error",2),Bt([a({type:Boolean})],t.prototype,"autofocus",2),Bt([a({type:Boolean})],t.prototype,"disabled",2),Bt([a({type:Boolean})],t.prototype,"required",2),Bt([a()],t.prototype,"name",1),Bt([a()],t.prototype,"value",1),t};var Fo=Object.defineProperty,Io=Object.getOwnPropertyDescriptor,Ae=(i,t,r,e)=>{for(var s=e>1?void 0:e?Io(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Fo(t,r,s),s};const Es=i=>{class t extends i{constructor(){super(...arguments),this._value="",this._name="",this.unique=null,this.radio=null,this._checked=null}get value(){return this._value}set value(e){this.hasAttribute("value")&&(e=this.getAttribute("value")),this._value!=e&&(this._value=e,this.updateDataValue(),this.requestUpdate())}get name(){return this._name}set name(e){this.hasAttribute("name")&&(e=this.getAttribute("name")),this._name=e}get checked(){return this._checked}set checked(e){this.setCheckedValue(e)}validateFormElement(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector("input");if(!e||e.checkValidity())return;let s=this.getFormPublisher()[this.name].get();(this.unique||this.radio)&&s!==null&&s.toString().length>0||(this.getFormPublisher().isFormValid=!1,e.reportValidity())}setCheckedValue(e){this._checked!=e&&(this._checked=e,this.updateDataValue(),this.requestUpdate(),this.publisher&&!this.radio&&!this.unique&&(this.publisher.checked=this._checked))}handleChange(){this.checked=this.checked?this.radio?!0:null:!0;const e=new Event("change");this.dispatchEvent(e)}getValueForFormPublisher(){let e=this.getFormPublisher();if(this.unique||this.radio)return this.checked&&this.value!=null?this.value:null;let s=e[this.name].get();Array.isArray(s)||(s=[]),s=s.slice(0);let o=s.indexOf(this.value);return this.checked===!0&&o===-1&&s.push(this.value),this.checked===null&&o!==-1&&s.splice(o,1),s}setFormValueFromPublisher(e){if(this.unique||this.radio){this.checked=this.value==e?!0:null;return}Array.isArray(e)||(e=[]),this.checked=e.indexOf(this.value)!==-1?!0:null}initPublisher(){super.initPublisher(),!!this.hasAttribute("checked")&&(!this.publisher||this.publisher.get().checked!==!1)&&(this.checked=!0)}}return Ae([a()],t.prototype,"value",1),Ae([a()],t.prototype,"name",1),Ae([a({type:Boolean})],t.prototype,"unique",2),Ae([a({type:Boolean})],t.prototype,"radio",2),Ae([a()],t.prototype,"checked",1),t};/**
|
|
103
103
|
* @license
|
|
104
104
|
* Copyright 2018 Google LLC
|
|
105
105
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
106
|
-
*/const k=i=>i!=null?i:P;var Uo=Object.defineProperty,Bo=Object.getOwnPropertyDescriptor,T=(i,t,r,e)=>{for(var s=e>1?void 0:e?Bo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Uo(t,r,s),s};const Mr="sonic-button";let E=class extends Es(ne(I(v))){constructor(){super(...arguments),this.type="default",this.variant="default",this.size="md",this.shape="default",this.direction="row",this.alignItems="center",this.justify="center",this.align="center",this.minWidth="0",this.autoActive="partial",this.loading=!1,this.hasPrefix=!1,this.hasSuffix=!1,this._href="",this.goBack=null,this.pushState=null,this.active=!1,this._location=""}set href(i){this._href=i,this.href&&this.href.indexOf("http")!=0?(G.onChange(this),this.location=document.location.href.replace(document.location.origin,"")):G.offChange(this),this.requestUpdate()}get href(){return this._href}handleNavigation(i){i.preventDefault(),G.changeFromComponent(this)}handleChange(i){super.handleChange(i),(this.pushState||this.goBack!==null)&&(i.preventDefault(),i.stopPropagation(),G.changeFromComponent(this))}connectedCallback(){super.connectedCallback()}setCheckedValue(i){if(this.name){if(i==this._checked)return;super.setCheckedValue(i),this._checked?this.setAttribute("active","true"):this.removeAttribute("active")}}disconnectedCallback(){G.offChange(this),super.disconnectedCallback()}get location(){return this._location}set location(i){this._location=i,G.updateComponentActiveState(this)}render(){const i={flexDirection:this.direction,alignItems:this.alignItems,justifyContent:this.justify,textAlign:this.align,minWidth:this.minWidth},t=u`<button part="button" class="${this.hasPrefix||this.hasSuffix?"has-prefix-or-suffix":""}" style="${ht(i)}" @click="${this.handleChange}"><slot @slotchange="${this.onSlotChange}" part="prefix" name="prefix"></slot><slot part="main" class="main-slot"></slot><slot @slotchange="${this.onSlotChange}" part="suffix" name="suffix"></slot>${this.loading==!0?u`<sonic-icon name="loader" class="loader"></sonic-icon>`:""}</button>`;return this.href?u`<a href="${this.href}" target="${k(this.target)}" @click="${this.pushState||this.goBack!==null?this.handleNavigation:null}">${t}</a>`:u`${t}`}onSlotChange(){var i,t;this.hasPrefix=!!((i=this.prefixes)!=null&&i.length),this.hasSuffix=!!((t=this.suffixes)!=null&&t.length)}};E.styles=[w`* { box-sizing: border-box; } :host { --sc-btn-gap: 0.35em; --sc-btn-py: 0.25em; --sc-btn-px: 1.1em; --sc-btn-fs: 1rem; --sc-btn-fw: var(--sc-btn-font-weight); --sc-btn-ff: var(--sc-btn-font-family); --sc-btn-height: var(--sc-form-height, 2.5em); --sc-btn-color: var(--sc-base-content, #1f2937); --sc-btn-bg: var(--sc-base-100, #e5e7eb); --sc-btn-border-style: solid; --sc-btn-border-with: var(--sc-form-border-width, 0.1rem); --sc-btn-border-color: transparent; --sc-btn-outline-bg-hover: var(--sc-base-100); --sc-btn-ghost-bg-hover: var(--sc-base-100); --sc-btn-active-color: var(--sc-base); --sc-btn-hover-filter: brightness(0.97); --sc-btn-active-filter: brightness(0.96); --sc-btn-active-bg: var(--sc-base-content); --sc-item-rounded-tr: var(--sc-btn-rounded); --sc-item-rounded-tl: var(--sc-btn-rounded); --sc-item-rounded-bl: var(--sc-btn-rounded); --sc-item-rounded-br: var(--sc-btn-rounded); display: inline-flex; vertical-align: middle; box-sizing: border-box; } :host a { display: contents; color:unset; } :host button { display: flex; flex: 1; box-sizing: border-box; align-items: center; justify-content: center; font-family: var(--sc-btn-ff); font-weight: var(--sc-btn-fw); font-size: var(--sc-btn-fs); cursor: pointer; text-align: center; line-height: 1.1; border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl); background: var(--sc-btn-bg); color: var(--sc-btn-color); padding-top: var(--sc-btn-py); padding-bottom: var(--sc-btn-py); padding-left: var(--sc-btn-px); padding-right: var(--sc-btn-px); border: var(--sc-btn-border-with) var(--sc-btn-border-style) var(--sc-btn-border-color); min-height: var(--sc-btn-height); } :host button.has-prefix-or-suffix { gap: var(--sc-btn-gap); } :host button:focus, :host button:hover { filter: var(--sc-btn-hover-filter); } :host button:active { filter: var(--sc-btn-active-filter); } /*TYPES*/ :host([type="default"]) button { --sc-btn-color: var(--sc-base-content); --sc-btn-bg: var(--sc-base-100); } :host([type="primary"]) button { --sc-btn-color: var(--sc-primary-content); --sc-btn-bg: var(--sc-primary); } :host([type="warning"]) button { --sc-btn-color: var(--sc-warning-content); --sc-btn-bg: var(--sc-warning); } :host([type="danger"]) button { --sc-btn-color: var(--sc-danger-content); --sc-btn-bg: var(--sc-danger); } :host([type="info"]) button { --sc-btn-color: var(--sc-info-content); --sc-btn-bg: var(--sc-info); } :host([type="success"]) button { --sc-btn-color: var(--sc-success-content); --sc-btn-bg: var(--sc-success); } :host([type="neutral"]) button { --sc-btn-color: var(--sc-base); --sc-btn-bg: var(--sc-base-600); } /*SIZE*/ :host([size="2xs"]) { --sc-btn-fs: 0.6rem; } :host([size="xs"]) { --sc-btn-fs: 0.75rem; } :host([size="sm"]) { --sc-btn-fs: 0.85rem; } :host([size="lg"]) { --sc-btn-fs: 1.2rem; } :host([size="xl"]) { --sc-btn-fs: 1.5rem; } /*UNSTYLED*/ :host([variant="unstyled"]) button { all: unset; transition: 0.1s; display: inline-flex; cursor: pointer; --sc-btn-height: auto; --sc-btn-width: auto; } /*GESTION DU FOCUS*/ :host(:not([disabled])) button:focus { box-shadow: 0 0 0 0.18rem var(--sc-base-300); border-color: var(--sc-base-300) !important; outline: none; } /*GHOST*/ :host([variant="ghost"][type]) button { color: var(--sc-btn-bg); background: transparent; } :host([variant="ghost"][type="default"]) button { color: var(--sc-btn-color); background: transparent; } /*:host([variant="ghost"]) button:focus,*/ :host([variant="ghost"]) button:hover { background: var(--sc-btn-ghost-bg-hover); filter: none; } :host([active][variant="ghost"]) button { background: var(--sc-btn-ghost-bg-hover); filter: none; } :host([active][variant="ghost"]) button:hover { filter: var(--sc-btn-hover-filter); } /*OUTLINE*/ :host([variant="outline"][type]) button { border-color: var(--sc-btn-bg); color: var(--sc-btn-bg); background: transparent; } :host([variant="outline"][type="default"]) button { border-color: var(--sc-base-400); color: var(--sc-base-500); background: transparent; } /*:host([variant="outline"]) button:focus,*/ :host([variant="outline"]) button:hover { background: var(--sc-btn-outline-bg-hover); } /*OUTLINE*/ :host([variant="link"]) { vertical-align: baseline; margin-left:.25em; margin-right:.25em; } :host([variant="link"]) button { text-decoration: underline; padding: 0; background: none; border: none; font-size: inherit; min-height: 0; color: inherit; } :host([variant="link"][type]) button { color: var(--sc-btn-bg); } :host([variant="link"][type="default"]) button { color: inherit; } :host([variant="link"]) button:focus, :host([variant="link"]) button:hover { text-decoration: none; } /*SHAPE*/ :host([shape="circle"]) button { border-radius: 50%; } :host([shape="circle"]) button, :host([shape="square"]) button { width: var(--sc-btn-height); height: var(--sc-btn-height); overflow: hidden; padding: 0; align-items: center; justify-content: 0; text-align:center !important; } :host([shape="block"]), :host([shape="block"]) button { width: 100%; } :host([disabled]) { opacity: 0.3; pointer-events: none; user-select: none; } /*ACTIVE*/ :host([active]:not([variant="ghost"])) button { background: var(--sc-btn-active-bg); color: var(--sc-btn-active-color); border-color: var(--sc-btn-active-bg); } :host([textAlign="left"]) button { text-align: left; } :host([textAlign="right"]) button { text-align: right; } .main-slot { flex-grow: 1; display: block; /*align-items: center; justify-content: center;*/ } :host([minWidth]) .main-slot { flex-grow:0; } slot[name="suffix"], slot[name="prefix"] { flex-shrink: 0; } /*ALIGNEMENT DES ICONES permet de tous les avoir alignés dans un menu */ ::slotted(sonic-icon) { min-width: 1.3em; text-align: center; } /*Tooltip ne joue pas sur le layout*/ sonic-tooltip { display: contents; } /*OUTLINE*/ :host(:not([active])) ::slotted([swap="on"]) { display: none; } :host([active]) ::slotted([swap="off"]) { display: none; } /*Loading*/ :host([loading]) { pointer-events: none; position: relative; } :host([loading]) slot { opacity: 0 !important; pointer-events: none; } /*Loading*/ :host([loading]) .loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; line-height: 0; height: var(--sc-btn-ff); width: var(--sc-btn-ff); animation: rotation 2s infinite linear; } @keyframes rotation { from { transform-origin: 50% 50%; transform: translate(-50%, -50%) rotate(0deg); } to { transform-origin: 50% 50%; transform: translate(-50%, -50%) rotate(359deg); } }`],T([a({type:String,reflect:!0})],E.prototype,"type",2),T([a({type:String,reflect:!0})],E.prototype,"variant",2),T([a({type:String,reflect:!0})],E.prototype,"size",2),T([a({type:String,reflect:!0})],E.prototype,"shape",2),T([a({type:String})],E.prototype,"direction",2),T([a({type:String,reflect:!0})],E.prototype,"alignItems",2),T([a({type:String})],E.prototype,"justify",2),T([a({type:String,reflect:!0})],E.prototype,"align",2),T([a({type:String})],E.prototype,"minWidth",2),T([a({type:String})],E.prototype,"autoActive",2),T([a({type:Boolean,reflect:!0})],E.prototype,"loading",2),T([Z()],E.prototype,"hasPrefix",2),T([Z()],E.prototype,"hasSuffix",2),T([Tt({flatten:!0,slot:"prefix"})],E.prototype,"prefixes",2),T([Tt({flatten:!0,slot:"suffix"})],E.prototype,"suffixes",2),T([a({type:String})],E.prototype,"target",2),T([a({type:String})],E.prototype,"href",1),T([a({type:String})],E.prototype,"goBack",2),T([a({type:Boolean})],E.prototype,"pushState",2),T([a({type:Boolean,reflect:!0})],E.prototype,"active",2),E=T([y(Mr)],E);try{customElements.define(Mr,E)}catch{}class St{static areEqual(t,r){return t.length===r.length?t.every((e,s)=>e===r[s]):!1}static from2d(t){return{to1D:()=>{let r=[];return t.forEach(e=>r=r.concat(e)),this.from(r)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:r=>{if(t.length<1)return!0;let e=(t[0]||{})[r];return t.every(s=>(s||{})[r]==e)}})})}),value:()=>({forKey:r=>St.from(t.map(e=>e[r]))}),copy:()=>({fromKey:r=>({toKey:e=>{t.forEach(s=>{s[e]=Array.isArray(s[r])?[...s[r]]:typeof s[r]=="object"&&s[r]!=null?J({},s[r]):s[r]})}})})}),map:r=>St.from(t.map(r)),filter:r=>St.from(t.filter(r)),find:r=>t.find(r),some:r=>t.some(r),every:r=>t.every(r),group:()=>({byKey:r=>{let e=[],s=new Map;for(let o of t){let n=o[r];if(!s.has(n)){let l=e.length;s.set(n,l);let c={items:[]};c[r]=n,e.push(c)}e[s.get(n)].items.push(o)}return St.from(e)}}),without:()=>({duplicates:()=>({forKey:r=>{let e=[...new Set(t.map(s=>s[r]))];return St.from(e.map(s=>t.find(o=>o[r]==s)))}}),itemsIn:r=>({havingSameValue:()=>({forKey:e=>{let s=(o,n)=>l=>o[n]!=l[n];return St.from(t.filter(o=>r.every(s(o,e))))}})})})}}}const Vo=St,qo=kt,Ho=Ne,Wo=ee,Ko=G,Yo=et,Zo=Mt,Rr=K,Go=se;let js=window;js["concorde-utils"]=js["concorde-utils"]||{},js["concorde-utils"]={Arrays:Vo,DataBindObserver:qo,Format:Ho,HTML:Wo,LocationHandler:Ko,Objects:Yo,PublisherProxy:Zo,PublisherManager:Rr,api:Go};var Xo=Object.defineProperty,Jo=Object.getOwnPropertyDescriptor,Qo=(i,t,r,e)=>{for(var s=e>1?void 0:e?Jo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Xo(t,r,s),s};const Ds=i=>{class t extends i{constructor(...e){super(),this.api=null,this.key="",this.isFirstLoad=!0,this.isLoading=!1,this.iObserver=null,this.isDefaultLoaderEnabled=!0,this.isFetchEnabled=!0,this._endPoint="",this.dataProvider=""}set endPoint(e){this._endPoint=e,this.isConnected&&this._fetchData()}get endPoint(){return this._endPoint}async _fetchData(){if(!this.isFetchEnabled||(this.api=new se(this.getApiConfiguration()),!this.api))return;this.dispatchEvent(new CustomEvent("loading",{detail:this})),this.isLoading=!0,this.requestUpdate();let e,s=this.isDefaultLoaderEnabled&&!this.hasAttribute("noLoader");s&&q.show();let o=Rr.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();if(e=await this.api.get(this.endPoint||this.dataProvider||"",o),!e){dt.add({text:"Network Error",status:"error"}),this.isLoading=!1,s&&q.hide();return}s&&q.hide(),this.key&&(e=et.traverse(e,this.key.split("."),!1)),this.props=e,this.dispatchEvent(new CustomEvent("load",{detail:this})),this.isFirstLoad=!1,this.isLoading=!1}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.publisher)==null||e.offInvalidate(this.onInvalidate),this.isFirstLoad=!1}connectedCallback(){var e;if(this.noShadowDom="",!this.isFetchEnabled){super.connectedCallback();return}super.connectedCallback(),this.key=this.getAncestorAttributeValue("key"),this.props&&this.publisher.set(this.props),this.onInvalidate=()=>this._fetchData(),(e=this.publisher)==null||e.onInvalidate(this.onInvalidate),this.getAncestorAttributeValue("lazyload")===null&&this._fetchData()}firstUpdated(){if(this.getAncestorAttributeValue("lazyload")===null)return;let e={root:null,rootMargin:Math.max(window.innerWidth,window.innerHeight)+"px"};this.iObserver=new IntersectionObserver(n=>this.onIntersection(n),e);let s=this,o=s.shadowRoot?s.shadowRoot.children[0]:s.children[0];o&&o.nodeName.toLocaleLowerCase()=="slot"&&(o=o.children[0]),(!o||o.nodeName.toLocaleLowerCase()=="template")&&(o=document.createElement("span"),s.appendChild(o)),o?this.iObserver.observe(o):this.isFirstLoad&&this._fetchData()}onIntersection(e){for(const s of e)s.isIntersecting&&this.isFirstLoad&&this._fetchData()}}return Qo([a({type:String})],t.prototype,"endPoint",1),t};var tn=Object.defineProperty,en=Object.getOwnPropertyDescriptor,sn=(i,t,r,e)=>{for(var s=e>1?void 0:e?en(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&tn(t,r,s),s};const Nr="sonic-fetch";let We=class extends Ds(I(v)){render(){return u`<slot></slot>`}};We.styles=[w`:host { display: contents; }`],We=sn([y(Nr)],We);try{customElements.define(Nr,We)}catch{}var rn=Object.defineProperty,on=Object.getOwnPropertyDescriptor,Fr=(i,t,r,e)=>{for(var s=e>1?void 0:e?on(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&rn(t,r,s),s};const Ir="sonic-if";let Se=class extends v{constructor(){super(...arguments),this.condition=!1}render(){return this.condition?u`<slot></slot>`:P}};Se.styles=w`:host{ display:contents; }`,Fr([a({type:Boolean})],Se.prototype,"condition",2),Se=Fr([y(Ir)],Se);try{customElements.define(Ir,Se)}catch{}/**
|
|
106
|
+
*/const S=i=>i!=null?i:P;var Uo=Object.defineProperty,Bo=Object.getOwnPropertyDescriptor,T=(i,t,r,e)=>{for(var s=e>1?void 0:e?Bo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Uo(t,r,s),s};const Mr="sonic-button";let E=class extends Es(ne(I(v))){constructor(){super(...arguments),this.type="default",this.variant="default",this.size="md",this.shape="default",this.direction="row",this.alignItems="center",this.justify="center",this.align="center",this.minWidth="0",this.autoActive="partial",this.loading=!1,this.hasPrefix=!1,this.hasSuffix=!1,this._href="",this.goBack=null,this.pushState=null,this.active=!1,this._location=""}set href(i){this._href=i,this.href&&this.href.indexOf("http")!=0?(G.onChange(this),this.location=document.location.href.replace(document.location.origin,"")):G.offChange(this),this.requestUpdate()}get href(){return this._href}handleNavigation(i){i.preventDefault(),G.changeFromComponent(this)}handleChange(i){super.handleChange(i),(this.pushState||this.goBack!==null)&&(i.preventDefault(),i.stopPropagation(),G.changeFromComponent(this))}connectedCallback(){super.connectedCallback()}setCheckedValue(i){if(this.name){if(i==this._checked)return;super.setCheckedValue(i),this._checked?this.setAttribute("active","true"):this.removeAttribute("active")}}disconnectedCallback(){G.offChange(this),super.disconnectedCallback()}get location(){return this._location}set location(i){this._location=i,G.updateComponentActiveState(this)}render(){const i={flexDirection:this.direction,alignItems:this.alignItems,justifyContent:this.justify,textAlign:this.align,minWidth:this.minWidth},t=u`<button part="button" class="${this.hasPrefix||this.hasSuffix?"has-prefix-or-suffix":""}" style="${dt(i)}" @click="${this.handleChange}"><slot @slotchange="${this.onSlotChange}" part="prefix" name="prefix"></slot><slot part="main" class="main-slot"></slot><slot @slotchange="${this.onSlotChange}" part="suffix" name="suffix"></slot>${this.loading==!0?u`<sonic-icon name="loader" class="loader"></sonic-icon>`:""}</button>`;return this.href?u`<a href="${this.href}" target="${S(this.target)}" @click="${this.pushState||this.goBack!==null?this.handleNavigation:null}">${t}</a>`:u`${t}`}onSlotChange(){var i,t;this.hasPrefix=!!((i=this.prefixes)!=null&&i.length),this.hasSuffix=!!((t=this.suffixes)!=null&&t.length)}};E.styles=[w`* { box-sizing: border-box; } :host { --sc-btn-gap: 0.35em; --sc-btn-py: 0.25em; --sc-btn-px: 1.1em; --sc-btn-fs: 1rem; --sc-btn-fw: var(--sc-btn-font-weight); --sc-btn-ff: var(--sc-btn-font-family); --sc-btn-height: var(--sc-form-height, 2.5em); --sc-btn-color: var(--sc-base-content, #1f2937); --sc-btn-bg: var(--sc-base-100, #e5e7eb); --sc-btn-border-style: solid; --sc-btn-border-with: var(--sc-form-border-width, 0.1rem); --sc-btn-border-color: transparent; --sc-btn-outline-bg-hover: var(--sc-base-100); --sc-btn-ghost-bg-hover: var(--sc-base-100); --sc-btn-active-color: var(--sc-base); --sc-btn-hover-filter: brightness(0.97); --sc-btn-active-filter: brightness(0.96); --sc-btn-active-bg: var(--sc-base-content); --sc-item-rounded-tr: var(--sc-btn-rounded); --sc-item-rounded-tl: var(--sc-btn-rounded); --sc-item-rounded-bl: var(--sc-btn-rounded); --sc-item-rounded-br: var(--sc-btn-rounded); display: inline-flex; vertical-align: middle; box-sizing: border-box; } :host a { display: contents; color:unset; } :host button { display: flex; flex: 1; box-sizing: border-box; align-items: center; justify-content: center; font-family: var(--sc-btn-ff); font-weight: var(--sc-btn-fw); font-size: var(--sc-btn-fs); cursor: pointer; text-align: center; line-height: 1.1; border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl); background: var(--sc-btn-bg); color: var(--sc-btn-color); padding-top: var(--sc-btn-py); padding-bottom: var(--sc-btn-py); padding-left: var(--sc-btn-px); padding-right: var(--sc-btn-px); border: var(--sc-btn-border-with) var(--sc-btn-border-style) var(--sc-btn-border-color); min-height: var(--sc-btn-height); } :host button.has-prefix-or-suffix { gap: var(--sc-btn-gap); } :host button:focus, :host button:hover { filter: var(--sc-btn-hover-filter); } :host button:active { filter: var(--sc-btn-active-filter); } /*TYPES*/ :host([type="default"]) button { --sc-btn-color: var(--sc-base-content); --sc-btn-bg: var(--sc-base-100); } :host([type="primary"]) button { --sc-btn-color: var(--sc-primary-content); --sc-btn-bg: var(--sc-primary); } :host([type="warning"]) button { --sc-btn-color: var(--sc-warning-content); --sc-btn-bg: var(--sc-warning); } :host([type="danger"]) button { --sc-btn-color: var(--sc-danger-content); --sc-btn-bg: var(--sc-danger); } :host([type="info"]) button { --sc-btn-color: var(--sc-info-content); --sc-btn-bg: var(--sc-info); } :host([type="success"]) button { --sc-btn-color: var(--sc-success-content); --sc-btn-bg: var(--sc-success); } :host([type="neutral"]) button { --sc-btn-color: var(--sc-base); --sc-btn-bg: var(--sc-base-600); } /*SIZE*/ :host([size="2xs"]) { --sc-btn-fs: 0.6rem; } :host([size="xs"]) { --sc-btn-fs: 0.75rem; } :host([size="sm"]) { --sc-btn-fs: 0.85rem; } :host([size="lg"]) { --sc-btn-fs: 1.2rem; } :host([size="xl"]) { --sc-btn-fs: 1.5rem; } /*UNSTYLED*/ :host([variant="unstyled"]) button { all: unset; transition: 0.1s; display: inline-flex; cursor: pointer; --sc-btn-height: auto; --sc-btn-width: auto; } /*GESTION DU FOCUS*/ :host(:not([disabled])) button:focus { box-shadow: 0 0 0 0.18rem var(--sc-base-300); border-color: var(--sc-base-300) !important; outline: none; } /*GHOST*/ :host([variant="ghost"][type]) button { color: var(--sc-btn-bg); background: transparent; } :host([variant="ghost"][type="default"]) button { color: var(--sc-btn-color); background: transparent; } /*:host([variant="ghost"]) button:focus,*/ :host([variant="ghost"]) button:hover { background: var(--sc-btn-ghost-bg-hover); filter: none; } :host([active][variant="ghost"]) button { background: var(--sc-btn-ghost-bg-hover); filter: none; } :host([active][variant="ghost"]) button:hover { filter: var(--sc-btn-hover-filter); } /*OUTLINE*/ :host([variant="outline"][type]) button { border-color: var(--sc-btn-bg); color: var(--sc-btn-bg); background: transparent; } :host([variant="outline"][type="default"]) button { border-color: var(--sc-base-400); color: var(--sc-base-500); background: transparent; } /*:host([variant="outline"]) button:focus,*/ :host([variant="outline"]) button:hover { background: var(--sc-btn-outline-bg-hover); } /*OUTLINE*/ :host([variant="link"]) { vertical-align: baseline; margin-left:.25em; margin-right:.25em; } :host([variant="link"]) button { text-decoration: underline; padding: 0; background: none; border: none; font-size: inherit; min-height: 0; color: inherit; } :host([variant="link"][type]) button { color: var(--sc-btn-bg); } :host([variant="link"][type="default"]) button { color: inherit; } :host([variant="link"]) button:focus, :host([variant="link"]) button:hover { text-decoration: none; } /*SHAPE*/ :host([shape="circle"]) button { border-radius: 50%; } :host([shape="circle"]) button, :host([shape="square"]) button { width: var(--sc-btn-height); height: var(--sc-btn-height); overflow: hidden; padding: 0; align-items: center; justify-content: 0; text-align:center !important; } :host([shape="block"]), :host([shape="block"]) button { width: 100%; } :host([disabled]) { opacity: 0.3; pointer-events: none; user-select: none; } /*ACTIVE*/ :host([active]:not([variant="ghost"])) button { background: var(--sc-btn-active-bg); color: var(--sc-btn-active-color); border-color: var(--sc-btn-active-bg); } :host([textAlign="left"]) button { text-align: left; } :host([textAlign="right"]) button { text-align: right; } .main-slot { flex-grow: 1; display: block; /*align-items: center; justify-content: center;*/ } :host([minWidth]) .main-slot { flex-grow:0; } slot[name="suffix"], slot[name="prefix"] { flex-shrink: 0; } /*ALIGNEMENT DES ICONES permet de tous les avoir alignés dans un menu */ ::slotted(sonic-icon) { min-width: 1.3em; text-align: center; } /*Tooltip ne joue pas sur le layout*/ sonic-tooltip { display: contents; } /*OUTLINE*/ :host(:not([active])) ::slotted([swap="on"]) { display: none; } :host([active]) ::slotted([swap="off"]) { display: none; } /*Loading*/ :host([loading]) { pointer-events: none; position: relative; } :host([loading]) slot { opacity: 0 !important; pointer-events: none; } /*Loading*/ :host([loading]) .loader { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; line-height: 0; height: var(--sc-btn-ff); width: var(--sc-btn-ff); animation: rotation 2s infinite linear; } @keyframes rotation { from { transform-origin: 50% 50%; transform: translate(-50%, -50%) rotate(0deg); } to { transform-origin: 50% 50%; transform: translate(-50%, -50%) rotate(359deg); } }`],T([a({type:String,reflect:!0})],E.prototype,"type",2),T([a({type:String,reflect:!0})],E.prototype,"variant",2),T([a({type:String,reflect:!0})],E.prototype,"size",2),T([a({type:String,reflect:!0})],E.prototype,"shape",2),T([a({type:String})],E.prototype,"direction",2),T([a({type:String,reflect:!0})],E.prototype,"alignItems",2),T([a({type:String})],E.prototype,"justify",2),T([a({type:String,reflect:!0})],E.prototype,"align",2),T([a({type:String})],E.prototype,"minWidth",2),T([a({type:String})],E.prototype,"autoActive",2),T([a({type:Boolean,reflect:!0})],E.prototype,"loading",2),T([Z()],E.prototype,"hasPrefix",2),T([Z()],E.prototype,"hasSuffix",2),T([Tt({flatten:!0,slot:"prefix"})],E.prototype,"prefixes",2),T([Tt({flatten:!0,slot:"suffix"})],E.prototype,"suffixes",2),T([a({type:String})],E.prototype,"target",2),T([a({type:String})],E.prototype,"href",1),T([a({type:String})],E.prototype,"goBack",2),T([a({type:Boolean})],E.prototype,"pushState",2),T([a({type:Boolean,reflect:!0})],E.prototype,"active",2),E=T([y(Mr)],E);try{customElements.define(Mr,E)}catch{}class St{static areEqual(t,r){return t.length===r.length?t.every((e,s)=>e===r[s]):!1}static from2d(t){return{to1D:()=>{let r=[];return t.forEach(e=>r=r.concat(e)),this.from(r)}}}static from(t){return{get:()=>t||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:r=>{if(t.length<1)return!0;let e=(t[0]||{})[r];return t.every(s=>(s||{})[r]==e)}})})}),value:()=>({forKey:r=>St.from(t.map(e=>e[r]))}),copy:()=>({fromKey:r=>({toKey:e=>{t.forEach(s=>{s[e]=Array.isArray(s[r])?[...s[r]]:typeof s[r]=="object"&&s[r]!=null?J({},s[r]):s[r]})}})})}),map:r=>St.from(t.map(r)),filter:r=>St.from(t.filter(r)),find:r=>t.find(r),some:r=>t.some(r),every:r=>t.every(r),group:()=>({byKey:r=>{let e=[],s=new Map;for(let o of t){let n=o[r];if(!s.has(n)){let l=e.length;s.set(n,l);let c={items:[]};c[r]=n,e.push(c)}e[s.get(n)].items.push(o)}return St.from(e)}}),without:()=>({duplicates:()=>({forKey:r=>{let e=[...new Set(t.map(s=>s[r]))];return St.from(e.map(s=>t.find(o=>o[r]==s)))}}),itemsIn:r=>({havingSameValue:()=>({forKey:e=>{let s=(o,n)=>l=>o[n]!=l[n];return St.from(t.filter(o=>r.every(s(o,e))))}})})})}}}const Vo=St,qo=At,Ho=Ne,Wo=ee,Ko=G,Yo=et,Zo=Mt,Rr=K,Go=se;let js=window;js["concorde-utils"]=js["concorde-utils"]||{},js["concorde-utils"]={Arrays:Vo,DataBindObserver:qo,Format:Ho,HTML:Wo,LocationHandler:Ko,Objects:Yo,PublisherProxy:Zo,PublisherManager:Rr,api:Go};var Xo=Object.defineProperty,Jo=Object.getOwnPropertyDescriptor,Qo=(i,t,r,e)=>{for(var s=e>1?void 0:e?Jo(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Xo(t,r,s),s};const Ds=i=>{class t extends i{constructor(...e){super(),this.api=null,this.key="",this.isFirstLoad=!0,this.isLoading=!1,this.iObserver=null,this.isDefaultLoaderEnabled=!0,this.isFetchEnabled=!0,this._endPoint="",this.dataProvider=""}set endPoint(e){this._endPoint=e,this.isConnected&&this._fetchData()}get endPoint(){return this._endPoint}async _fetchData(){if(!this.isFetchEnabled||(this.api=new se(this.getApiConfiguration()),!this.api))return;this.dispatchEvent(new CustomEvent("loading",{detail:this})),this.isLoading=!0,this.requestUpdate();let e,s=this.isDefaultLoaderEnabled&&!this.hasAttribute("noLoader");s&&q.show();let o=Rr.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();if(e=await this.api.get(this.endPoint||this.dataProvider||"",o),!e){pt.add({text:"Network Error",status:"error"}),this.isLoading=!1,s&&q.hide();return}s&&q.hide(),this.key&&(e=et.traverse(e,this.key.split("."),!1)),this.props=e,this.dispatchEvent(new CustomEvent("load",{detail:this})),this.isFirstLoad=!1,this.isLoading=!1}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.publisher)==null||e.offInvalidate(this.onInvalidate),this.isFirstLoad=!1}connectedCallback(){var e;if(this.noShadowDom="",!this.isFetchEnabled){super.connectedCallback();return}super.connectedCallback(),this.key=this.getAncestorAttributeValue("key"),this.props&&this.publisher.set(this.props),this.onInvalidate=()=>this._fetchData(),(e=this.publisher)==null||e.onInvalidate(this.onInvalidate),this.getAncestorAttributeValue("lazyload")===null&&this._fetchData()}firstUpdated(){if(this.getAncestorAttributeValue("lazyload")===null)return;let e={root:null,rootMargin:Math.max(window.innerWidth,window.innerHeight)+"px"};this.iObserver=new IntersectionObserver(n=>this.onIntersection(n),e);let s=this,o=s.shadowRoot?s.shadowRoot.children[0]:s.children[0];o&&o.nodeName.toLocaleLowerCase()=="slot"&&(o=o.children[0]),(!o||o.nodeName.toLocaleLowerCase()=="template")&&(o=document.createElement("span"),s.appendChild(o)),o?this.iObserver.observe(o):this.isFirstLoad&&this._fetchData()}onIntersection(e){for(const s of e)s.isIntersecting&&this.isFirstLoad&&this._fetchData()}}return Qo([a({type:String})],t.prototype,"endPoint",1),t};var tn=Object.defineProperty,en=Object.getOwnPropertyDescriptor,sn=(i,t,r,e)=>{for(var s=e>1?void 0:e?en(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&tn(t,r,s),s};const Nr="sonic-fetch";let We=class extends Ds(I(v)){render(){return u`<slot></slot>`}};We.styles=[w`:host { display: contents; }`],We=sn([y(Nr)],We);try{customElements.define(Nr,We)}catch{}var rn=Object.defineProperty,on=Object.getOwnPropertyDescriptor,Fr=(i,t,r,e)=>{for(var s=e>1?void 0:e?on(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&rn(t,r,s),s};const Ir="sonic-if";let Se=class extends v{constructor(){super(...arguments),this.condition=!1}render(){return this.condition?u`<slot></slot>`:P}};Se.styles=w`:host{ display:contents; }`,Fr([a({type:Boolean})],Se.prototype,"condition",2),Se=Fr([y(Ir)],Se);try{customElements.define(Ir,Se)}catch{}/**
|
|
107
107
|
* @license
|
|
108
108
|
* Copyright 2020 Google LLC
|
|
109
109
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
110
|
-
*/const Pt=ie(class extends oe{constructor(i){if(super(i),i.type!==Rt.CHILD)throw Error("templateContent can only be used in child bindings")}render(i){return this.vt===i?ct:(this.vt=i,document.importNode(i.content,!0))}});var nn=Object.defineProperty,an=Object.getOwnPropertyDescriptor,ln=(i,t,r,e)=>{for(var s=e>1?void 0:e?an(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&nn(t,r,s),s};const Ur="sonic-subscriber";let Ls=class extends I(v){constructor(){super(...arguments),this.noAutofill=!0}connectedCallback(){this.noShadowDom="",super.connectedCallback()}render(){return u`<slot></slot>`}};Ls=ln([y(Ur)],Ls);try{customElements.define(Ur,Ls)}catch{}var cn=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,Ke=(i,t,r,e)=>{for(var s=e>1?void 0:e?hn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&cn(t,r,s),s};const Br="sonic-list";let Vt=class extends Ds(I($e(v))){constructor(){super(...arguments),this.itemPropertyMap=null,this.templateKey="template",this.idKey="id"}connectedCallback(){this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.isDefaultLoaderEnabled=!1,this.isFetchEnabled=this.hasAttribute("fetch"),this.isFetchEnabled&&(this.isLoading=!0),super.connectedCallback()}renderLoadingState(){return this.templateParts.skeleton?Pt(this.templateParts.skeleton):u`<sonic-loader mode="inline"></sonic-loader>`}renderNoResultState(){return u`<div class="sonic-no-result-container"><sonic-icon name="emoji-puzzled" size="lg"></sonic-icon><span class="sonic-no-result-text">${this.props}</span></div>`}formatProps(){let i=this.props,t=this.hasAttribute("extractValues");return Array.isArray(i)||(t?i=Object.entries(i).map(([r,e])=>({key:r,value:e})):i=[i]),i}render(){if(this.isLoading&&!Array.isArray(this.props))return this.renderLoadingState();if(typeof this.props=="string")return this.renderNoResultState();if(!et.isObject(this.props))return u`<div></div>`;let i=this.formatProps();if(i.length==0&&this.templateParts["no-item"])return Pt(this.templateParts["no-item"]);let t=this.templateList.length,r=-1,e=this.hasAttribute("extractValues");return u`${Ft(i,(s,o)=>s[this.idKey]||o,(s,o)=>{let n=s[this.templateKey],l=n&&this.templateParts[n];r++,l&&(r=-1);let c=e?s.key:o,h=this.publisher[c];return h._key_=c+"",s&&u`<sonic-subscriber debug="${k(this.defferedDebug)}" .bindPublisher="${function(){return h}}" .propertyMap="${k(this.itemPropertyMap)}" dataProvider="${this.dataProvider}/list-item/${o}">${Pt(l?this.templateParts[n]:this.templateList[r%t])}</sonic-subscriber>`})}`}};Vt.styles=[w`.sonic-no-result-container { color: var(--sc-base-400); font-size: 1.65rem; } sonic-icon { margin-right: 0.25em; } span { vertical-align: middle; }`],Ke([a({type:Object})],Vt.prototype,"itemPropertyMap",2),Ke([a({type:String})],Vt.prototype,"templateKey",2),Ke([a({type:String})],Vt.prototype,"idKey",2),Vt=Ke([y(Br)],Vt);try{customElements.define(Br,Vt)}catch{}var dn=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,bt=(i,t,r,e)=>{for(var s=e>1?void 0:e?pn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&dn(t,r,s),s};const Vr="sonic-queue";let nt=class extends I(v){constructor(){super(...arguments),this.templates=null,this.lastRequestTime=0,this.key="",this.itemPropertyMap=null,this.targetRequestDuration=500,this.limit=5,this.offset=0,this.filteredFields="",this.filterPublisher=null,this.filterTimeoutId=void 0,this.dataProviderExpression="",this.idKey="id",this.currentScrollPosition=void 0,this.listDataProviders=[]}connectedCallback(){this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.dataProvider||(this.dataProvider="sonic-queue-"+nt.instanceCounter++),this.configFilter(),super.connectedCallback(),this.key=this.getAttribute("key"),this.templates||(this.templates=Array.from(this.querySelectorAll("template"))),this.lastRequestTime=new Date().getTime(),this.next()}configFilter(){var t;let i=this.getAncestorAttributeValue("dataFilterProvider");!i||(this.filterPublisher=K.getInstance().get(i),(t=this.filterPublisher)==null||t.onInternalMutation(()=>{var r;Object.keys((r=this.filterPublisher)==null?void 0:r.get()).length!=0&&this.updateFilteredContent()}))}updateFilteredContent(){for(let i of this.listDataProviders)K.delete(i);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout(()=>{this.props=null,this.next()},250)}resetDuration(){this.lastRequestTime=new Date().getTime()}next(i){var h,b;let t=this.offset;const r=new Date().getTime()-this.lastRequestTime;if(i&&(!i.detail.isFirstLoad||!i.detail.props.length||this.dataProviderExpression.indexOf("$offset")==-1))return;if(!Array.isArray(this.props))this.props=[];else{const f=this.props,g=f[f.length-1];t=parseInt(g.offset.toString())+parseInt(g.limit.toString())}r>0&&i&&(this.limit=Math.round(this.limit/r*this.targetRequestDuration)),this.limit<1&&(this.limit=1),this.limit>15&&(this.limit=15);let e=this.dataProviderExpression.replace("$offset",t+"").replace("$limit",this.limit+""),s=e.split("?"),o=s.shift(),n=new URLSearchParams(s.join("?")),l=(h=this.filterPublisher)==null?void 0:h.get(),c=this.filteredFields.split(" ");for(let f in l)this.filteredFields&&!c.includes(f)||n.set(f,l[f]);e=o+"?"+n.toString(),this.listDataProviders.push(e),this.currentScrollPosition=(b=document.scrollingElement)==null?void 0:b.scrollTop,this.props=[...this.props,{id:n.toString()+"/"+this.props.length,dataProvider:e,offset:t,limit:this.limit}],this.lastRequestTime=new Date().getTime()}render(){return this.currentScrollPosition&&window.requestAnimationFrame(()=>{document.scrollingElement&&(document.scrollingElement.scrollTop=this.currentScrollPosition),this.currentScrollPosition=void 0}),Array.isArray(this.props)?u`${Ft(this.props,i=>i.id,(i,t)=>{var e;let r=t==0?this.templates:(e=this.templates)==null?void 0:e.filter(s=>s.getAttribute("data-value")!="no-item");return u`<sonic-list fetch .itemPropertyMap="${this.itemPropertyMap}" debug="${k(this.defferedDebug)}" @load="${this.next}" key="${this.key}" @loading="${this.resetDuration}" dataProvider="${i.dataProvider}" idKey="${this.idKey}" .templates="${r}"></sonic-list>`})}`:P}};nt.instanceCounter=0,bt([a({type:Array})],nt.prototype,"templates",2),bt([a({type:Object})],nt.prototype,"itemPropertyMap",2),bt([a()],nt.prototype,"targetRequestDuration",2),bt([a()],nt.prototype,"limit",2),bt([a()],nt.prototype,"offset",2),bt([a()],nt.prototype,"filteredFields",2),bt([a({type:String})],nt.prototype,"dataProviderExpression",2),bt([a({type:String})],nt.prototype,"idKey",2),nt=bt([y(Vr)],nt);try{customElements.define(Vr,nt)}catch{}var un=Object.defineProperty,gn=Object.getOwnPropertyDescriptor,Ye=(i,t,r,e)=>{for(var s=e>1?void 0:e?gn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&un(t,r,s),s};const qr="sonic-submit";let qt=class extends I(v){constructor(){super(...arguments),this.submitResultKey=null,this.disabled=!1,this.endPoint=null,this.api=null}connectedCallback(){this.hasAttribute("onClick")&&this.addEventListener("click",()=>this.submit()),this.hasAttribute("onEnterKey")&&this.addEventListener("keydown",i=>{i.key==="Enter"&&this.submit()}),super.connectedCallback(),this.api=new se(this.getApiConfiguration())}async submit(){var c,h,b,f,g;const i=K.getInstance().get(this.getAncestorAttributeValue("formDataProvider"));if(i.isFormValid=!0,i.invalidate(),!i.isFormValid.get())return;this.publisher.disabled=!0,i.isFormValid;let t=((c=this.getAttribute("method"))==null?void 0:c.toLocaleLowerCase())||"post",r=i.get();delete r.isFormValid;let e=K.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get(),s=null,o=this.getAncestorAttributeValue("dataProvider"),n=this.endPoint||o;switch(q.show(),t){case"put":s=await((h=this.api)==null?void 0:h.put(n,r,e));break;case"delete":s=await((b=this.api)==null?void 0:b.delete(n,r,e));break;case"get":s=await((f=this.api)==null?void 0:f.get(n));break;default:s=await((g=this.api)==null?void 0:g.post(n,r,e));break}q.hide(),s||(s={messages:[{content:"Network Error",status:"error"}]});let l=this.getAncestorAttributeValue("clearedDataOnSuccess");l&&l.split(" ").forEach($=>K.get($).set({})),this.submitResultKey&&(s=et.traverse(s,this.submitResultKey.split("."),!0)),K.getInstance().get(this.getAncestorAttributeValue("submitResultDataProvider")).set(s),this.publisher.disabled=!1}render(){return u`<div ?data-disabled="${this.disabled}"><slot></slot></div>`}};qt.styles=w`[data-disabled]{ opacity: 0.3; pointer-events: none; user-select: none; }`,Ye([a({type:String})],qt.prototype,"submitResultKey",2),Ye([a({type:Boolean})],qt.prototype,"disabled",2),Ye([a({type:String})],qt.prototype,"endPoint",2),qt=Ye([y(qr)],qt);try{customElements.define(qr,qt)}catch{}var fn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},zs={exports:{}};(function(i,t){var r=[].slice;(function(e,s){return t!==null?i.exports=s():e.UrlPattern=s()})(fn,function(){var e,s,o,n,l,c,h,b,f,g,$,_,A,R,D;return f=function(d){return d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(d,p){var m,x,S;for(S=[],m=-1,x=d.length;++m<x;)S=S.concat(p(d[m]));return S},R=function(d,p){var m,x,S;for(S="",m=-1,x=d.length;++m<x;)S+=p(d[m]);return S},A=function(d){return new RegExp(d.toString()+"|").exec("").length-1},$=function(d,p){var m,x,S,O,N;for(O={},m=-1,S=d.length;++m<S;)x=d[m],N=p[m],N!=null&&(O[x]!=null?(Array.isArray(O[x])||(O[x]=[O[x]]),O[x].push(N)):O[x]=N);return O},e={},e.Result=function(d,p){this.value=d,this.rest=p},e.Tagged=function(d,p){this.tag=d,this.value=p},e.tag=function(d,p){return function(m){var x,S;if(x=p(m),x!=null)return S=new e.Tagged(d,x.value),new e.Result(S,x.rest)}},e.regex=function(d){return function(p){var m,x;if(m=d.exec(p),m!=null)return x=m[0],new e.Result(x,p.slice(x.length))}},e.sequence=function(){var d;return d=1<=arguments.length?r.call(arguments,0):[],function(p){var m,x,S,O,N,X;for(m=-1,x=d.length,X=[],O=p;++m<x;){if(S=d[m],N=S(O),N==null)return;X.push(N.value),O=N.rest}return new e.Result(X,O)}},e.pick=function(){var d,p;return d=arguments[0],p=2<=arguments.length?r.call(arguments,1):[],function(m){var x,S;if(S=e.sequence.apply(e,p)(m),S!=null)return x=S.value,S.value=x[d],S}},e.string=function(d){var p;return p=d.length,function(m){if(m.slice(0,p)===d)return new e.Result(d,m.slice(p))}},e.lazy=function(d){var p;return p=null,function(m){return p==null&&(p=d()),p(m)}},e.baseMany=function(d,p,m,x,S){var O,N,X,Te;for(X=S,Te=m?"":[];!(p!=null&&(O=p(X),O!=null)||(N=d(X),N==null));)m?Te+=N.value:Te.push(N.value),X=N.rest;if(!(x&&Te.length===0))return new e.Result(Te,X)},e.many1=function(d){return function(p){return e.baseMany(d,null,!1,!0,p)}},e.concatMany1Till=function(d,p){return function(m){return e.baseMany(d,p,!0,!0,m)}},e.firstChoice=function(){var d;return d=1<=arguments.length?r.call(arguments,0):[],function(p){var m,x,S,O;for(m=-1,x=d.length;++m<x;)if(S=d[m],O=S(p),O!=null)return O}},_=function(d){var p;return p={},p.wildcard=e.tag("wildcard",e.string(d.wildcardChar)),p.optional=e.tag("optional",e.pick(1,e.string(d.optionalSegmentStartChar),e.lazy(function(){return p.pattern}),e.string(d.optionalSegmentEndChar))),p.name=e.regex(new RegExp("^["+d.segmentNameCharset+"]+")),p.named=e.tag("named",e.pick(1,e.string(d.segmentNameStartChar),e.lazy(function(){return p.name}))),p.escapedChar=e.pick(1,e.string(d.escapeChar),e.regex(/^./)),p.static=e.tag("static",e.concatMany1Till(e.firstChoice(e.lazy(function(){return p.escapedChar}),e.regex(/^./)),e.firstChoice(e.string(d.segmentNameStartChar),e.string(d.optionalSegmentStartChar),e.string(d.optionalSegmentEndChar),p.wildcard))),p.token=e.lazy(function(){return e.firstChoice(p.wildcard,p.optional,p.named,p.static)}),p.pattern=e.many1(e.lazy(function(){return p.token})),p},b={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(d,p){if(Array.isArray(d))return R(d,function(m){return c(m,p)});switch(d.tag){case"wildcard":return"(.*?)";case"named":return"(["+p+"]+)";case"static":return f(d.value);case"optional":return"(?:"+c(d.value,p)+")?"}},l=function(d,p){return p==null&&(p=b.segmentValueCharset),"^"+c(d,p)+"$"},n=function(d){if(Array.isArray(d))return h(d,n);switch(d.tag){case"wildcard":return["_"];case"named":return[d.value];case"static":return[];case"optional":return n(d.value)}},g=function(d,p,m,x){var S,O,N,X;if(x==null&&(x=!1),X=d[p],X==null){if(x)throw new Error("no values provided for key `"+p+"`");return}if(S=m[p]||0,O=Array.isArray(X)?X.length-1:0,S>O){if(x)throw new Error("too few values provided for key `"+p+"`");return}return N=Array.isArray(X)?X[S]:X,x&&(m[p]=S+1),N},o=function(d,p,m){var x,S;if(Array.isArray(d)){for(x=-1,S=d.length;++x<S;)if(o(d[x],p,m))return!0;return!1}switch(d.tag){case"wildcard":return g(p,"_",m,!1)!=null;case"named":return g(p,d.value,m,!1)!=null;case"static":return!1;case"optional":return o(d.value,p,m)}},D=function(d,p,m){if(Array.isArray(d))return R(d,function(x){return D(x,p,m)});switch(d.tag){case"wildcard":return g(p,"_",m,!0);case"named":return g(p,d.value,m,!0);case"static":return d.value;case"optional":return o(d.value,p,m)?D(d.value,p,m):""}},s=function(d,p){var m,x,S,O,N;if(d instanceof s){this.isRegex=d.isRegex,this.regex=d.regex,this.ast=d.ast,this.names=d.names;return}if(this.isRegex=d instanceof RegExp,!(typeof d=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=d,p!=null){if(!Array.isArray(p))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(m=A(this.regex),p.length!==m)throw new Error("regex contains "+m+" groups but array of group names contains "+p.length);this.names=p}return}if(d==="")throw new Error("argument must not be the empty string");if(N=d.replace(/\s+/g,""),N!==d)throw new Error("argument must not contain whitespace");if(x={escapeChar:(p!=null?p.escapeChar:void 0)||b.escapeChar,segmentNameStartChar:(p!=null?p.segmentNameStartChar:void 0)||b.segmentNameStartChar,segmentNameCharset:(p!=null?p.segmentNameCharset:void 0)||b.segmentNameCharset,segmentValueCharset:(p!=null?p.segmentValueCharset:void 0)||b.segmentValueCharset,optionalSegmentStartChar:(p!=null?p.optionalSegmentStartChar:void 0)||b.optionalSegmentStartChar,optionalSegmentEndChar:(p!=null?p.optionalSegmentEndChar:void 0)||b.optionalSegmentEndChar,wildcardChar:(p!=null?p.wildcardChar:void 0)||b.wildcardChar},O=_(x),S=O.pattern(d),S==null)throw new Error("couldn't parse pattern");if(S.rest!=="")throw new Error("could only partially parse pattern");this.ast=S.value,this.regex=new RegExp(l(this.ast,x.segmentValueCharset)),this.names=n(this.ast)},s.prototype.match=function(d){var p,m;return m=this.regex.exec(d),m==null?null:(p=m.slice(1),this.names?$(this.names,p):p)},s.prototype.stringify=function(d){if(d==null&&(d={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(d!==Object(d))throw new Error("argument must be an object or undefined");return D(this.ast,d,{})},s.escapeForRegex=f,s.concatMap=h,s.stringConcatMap=R,s.regexGroupCount=A,s.keysAndValuesToObject=$,s.P=e,s.newParser=_,s.defaultOptions=b,s.astNodeToRegexString=l,s.astNodeToNames=n,s.getParam=g,s.astNodeContainsSegmentsForProvidedParams=o,s.stringify=D,s})})(zs,zs.exports);var ae=zs.exports,mn=Object.defineProperty,vn=Object.getOwnPropertyDescriptor,Hr=(i,t,r,e)=>{for(var s=e>1?void 0:e?vn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&mn(t,r,s),s};const Wr="sonic-router";let Ze=class extends I($e(v)){constructor(){super(...arguments),this.templateValueAttribute="data-route",this._location=document.location.href.replace(document.location.origin,"")}connectedCallback(){this.noShadowDom="",G.onChange(this),super.connectedCallback()}disconnectedCallback(){G.offChange(this),super.disconnectedCallback()}set location(i){this._location=i,this.requestUpdate()}get location(){return this._location}render(){let i=[];for(let t of this.templatePartsList){let r=t.getAttribute(this.templateValueAttribute),e=new RegExp(r),s=new ae(r);e.test(this.location)?i.push(t):s.match(this.location)&&(t.setAttribute("mode","patternMatching"),i.push(t))}return u`${Ft(i,(t,r)=>r+new Date().getTime(),t=>{var r;if(t.title&&(document.title=t.title),t.hasAttribute("dataProviderExpression")){let e="",s=t.getAttribute("dataProviderExpression");if(t.getAttribute("mode")=="patternMatching"){const o=new ae(t.getAttribute(this.templateValueAttribute));e=new ae(s).stringify(o.match(this.location))}else{const o=new RegExp(t.getAttribute(this.templateValueAttribute));let n=(this.location+"").match(o);n&&(e=(r=n.shift())==null?void 0:r.replace(o,s))}return u`<div style="display:contents" dataProvider="${e}">${Pt(t)}</div>`}return Pt(t)})}`}};Hr([a()],Ze.prototype,"location",1),Ze=Hr([y(Wr)],Ze);try{customElements.define(Wr,Ze)}catch{}var bn=Object.defineProperty,yn=Object.getOwnPropertyDescriptor,wn=(i,t,r,e)=>{for(var s=e>1?void 0:e?yn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&bn(t,r,s),s};const Kr="sonic-redirect";let Ts=class extends I(v){constructor(){super(...arguments),this.udpateCallBack=()=>{}}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.props)return;let i=this.getAttribute("onData").split("."),t=et.traverse(this.props,i);t&&!(et.isObject(t)&&t)&&G.changeFromComponent(this)}};Ts=wn([y(Kr)],Ts);try{customElements.define(Kr,Ts)}catch{}var $n=Object.defineProperty,xn=Object.getOwnPropertyDescriptor,Ms=(i,t,r,e)=>{for(var s=e>1?void 0:e?xn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&$n(t,r,s),s};const Yr="sonic-states";let Pe=class extends I($e(v)){constructor(){super(...arguments),this.state="",this.inverted=!1,this.statePath="",this.onAssign=null}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("data-path")&&(this.statePath=this.getAttribute("data-path")),this.statePath){this.statePublisher=this.publisher;let i=this.statePath.split(".");for(let t of i)this.statePublisher=this.statePublisher[t];this.onAssign=t=>{this.state=t,this.requestUpdate()},this.statePublisher.onAssign(this.onAssign)}}disconnectedCallback(){this.statePath&&this.statePublisher.offAssign(this.onAssign),super.disconnectedCallback()}render(){let i=[],t=this.state;(!Array.isArray(t)&&et.isObject(t)||t===void 0)&&(t="");for(let r of this.templatePartsList){let e=r.getAttribute(this.templateValueAttribute),s=t;if(this.inverted&&(s=e,e=t),e==""&&(e=this.inverted?".*?":"^$"),new RegExp(e).test(s))i.push(r),r.removeAttribute("mode");else{let o=new ae(e);o.names.length>0&&o.match(s)&&(r.setAttribute("mode","patternMatching"),i.push(r))}}return u`${Ft(i,(r,e)=>e+new Date().getTime(),r=>{var e;if(r.title&&(document.title=r.title),r.hasAttribute("dataProviderExpression")){let s=r.getAttribute("dataProviderExpression"),o="",n=t,l=r.getAttribute(this.templateValueAttribute);if(this.inverted&&(n=l,l=t),l==""&&(l=this.inverted?"*":"^$"),r.getAttribute("mode")=="patternMatching"){const c=new ae(l);o=new ae(s).stringify(c.match(n))}else{const c=new RegExp(l);let h=(n+"").match(c);h&&(o=(e=h.shift())==null?void 0:e.replace(c,s))}return u`<div style="display:contents" dataProvider="${o}">${Pt(r)}</div>`}return Pt(r)})}`}};Ms([a()],Pe.prototype,"state",2),Ms([a({type:Boolean,reflect:!0})],Pe.prototype,"inverted",2),Pe=Ms([y(Yr)],Pe);try{customElements.define(Yr,Pe)}catch{}var _n=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,An=(i,t,r,e)=>{for(var s=e>1?void 0:e?kn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&_n(t,r,s),s};const Sn="sonic-scope";let Zr=class extends v{createRenderRoot(){return this}render(){return u`<slot></slot>`}};Zr=An([y(Sn)],Zr);var Pn=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,Gr=(i,t,r,e)=>{for(var s=e>1?void 0:e?Cn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Pn(t,r,s),s};const On="sonic-example";let Rs=class extends I(v){constructor(){super(...arguments),this.text="Example"}render(){return u`${this.text}`}};Gr([a()],Rs.prototype,"text",2),Rs=Gr([y(On)],Rs);const En=w`:host { /* polices*/ --sc-font-family-base: "Inter var", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --sc-font-weight-base: 400; --sc-font-style-base: normal; --sc-headings-font-family: var(--sc-font-family-base); --sc-headings-font-style: var(--sc-font-style-base); --sc-headings-line-height: 1.1; --sc-headings-font-weight: 700; --sc-headings-text-transform: none; /* Button*/ --sc-btn-font-weight: var(--sc-font-weight-base); --sc-btn-font-family: var(--sc-font-family-base); --sc-btn-font-style: var(--sc-font-style-base); /* ROUNDED*/ --sc-rounded-sm: calc(var(--sc-rounded) * 0.5); --sc-rounded: 0.35rem; --sc-rounded-md: calc(var(--sc-rounded) * 1.8); --sc-rounded-lg: calc(var(--sc-rounded) * 3.5); --sc-rounded-xl: calc(var(--sc-rounded) * 7); --sc-btn-rounded: calc(var(--sc-rounded) * 1.2); /* Placeholder */ --sc-placeholder-bg: rgba(17, 24, 39, 0.05); /* Images*/ --sc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); --sc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); --sc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); --sc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); --sc-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25); /* formulaires*/ --sc-border-width: max(1px, 0.085rem); --sc-form-border-width: var(--sc-border-width); --sc-input-bg: var(--sc-base-100); --sc-input-border-color: var(--sc-input-bg); --sc-input-rounded: calc(var(--sc-rounded) * 1.2); /*Couleurs -- textes sur images*/ --sc-contrast-content: #fff; --sc-contrast: #0f172a; /*Scrollbar*/ --sc-scrollbar-bg : var(--sc-base-400); }`,jn=w`:host { /*Boutons*/ --sc-primary: var(--sc-base-800); --sc-info: #2563eb; --sc-danger: #f43f5e; --sc-warning: #f97316; --sc-success: #14b8a6; --sc-primary-content: var(--sc-base); --sc-info-content: var(--sc-base); --sc-danger-content: var(--sc-base); --sc-warning-content: var(--sc-base); --sc-success-content: var(--sc-base); /*Bases*/ --sc-base: #fff; --sc-base-50: #f8fafc; --sc-base-100: #f1f5f9; --sc-base-200: #e2e8f0; --sc-base-300: #cbd5e1; --sc-base-400: #94a3b8; --sc-base-500: #64748b; --sc-base-600: #475569; --sc-base-700: #334155; --sc-base-800: #1e293b; --sc-base-900: #0f172a; --sc-base-content: var(--sc-base-700); /*formulaires*/ --sc-input-bg: var(--sc-base-100); --sc-input-color: var(--sc-base-content); }`,Xr=w`--sc-primary: var(--sc-dark-primary, var(--sc-base-700)); --sc-info: var(--sc-dark-info, #3abff8); --sc-danger: var(--sc-dark-danger, #f87272); --sc-warning: var(--sc-dark-warning, #fbbd23); --sc-success: var(--sc-dark-success, #36d399); --sc-primary-content: var(--sc-dark-primary-content, #002b3d); --sc-info-content: var(--sc-dark-info-content, #002b3d); --sc-danger-content: var(--sc-dark-danger-content, #382800); --sc-warning-content: var(--sc-dark-warning-content, #382800); --sc-success-content: var(--sc-dark-success-content, #003320); --sc-base: var(--sc-dark-base, #1d2634); --sc-base-50: var(--sc-dark-base-50, #1f2937); --sc-base-100: var(--sc-dark-base-100, #252C36); --sc-base-200: var(--sc-dark-base-200, #2c3543); --sc-base-300: var(--sc-dark-base-300, #38414e); --sc-base-400: var(--sc-dark-base-400, #515964); --sc-base-500: var(--sc-dark-base-500, #828891); --sc-base-600: var(--sc-dark-base-600, #b4b8be); --sc-base-700: var(--sc-dark-base-700, #cdd0d5); --sc-base-800: var(--sc-dark-base-800, #d9dce0); --sc-base-900: var(--sc-dark-base-900, #e5e7eb); --sc-base-content: var(--sc-dark-base-content, #e5e7eb);`,Dn=w`:host([theme="dark"]) { ${Xr} } @media (prefers-color-scheme: dark) { :host([theme="auto"]) { ${Xr} } }`;var Ln=Object.defineProperty,zn=Object.getOwnPropertyDescriptor,Jr=(i,t,r,e)=>{for(var s=e>1?void 0:e?zn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ln(t,r,s),s};const Tn="sonic-theme";let Ce=class extends v{constructor(){super(...arguments),this.theme="light"}connectedCallback(){super.connectedCallback(),window.addEventListener("message",i=>this.receiveMessage(i),!1),this.postCSSVars()}postCSSVars(){const i=document.styleSheets,t=i.length;let r=[];for(let e=0;e<t;e++){let s=i[e];s.href&&(s.href.includes("googleapis")||s.href.includes("typekit.net"))&&r.push(s.href)}document.querySelectorAll("iframe").forEach(e=>{var s;return(s=e.contentWindow)==null?void 0:s.postMessage({type:"SonicTheme",variables:this.getCssVariables(),fonts:r},"*")})}receiveMessage(i){let t=i.data;!t.type||t.type!="GetSonicTheme"||this.postCSSVars()}getCssVariables(){let i=[],t=[...Ce.styles.map(s=>s.styleSheet),...Array.from(document.styleSheets)];for(let s of t)try{let o=s==null?void 0:s.cssRules;for(let n of o)if(n.style)for(let l of n.style)i.includes(l)||l.indexOf("--sc")!==0||i.push(l)}catch{}let r=window.getComputedStyle(this),e={};return i.forEach(s=>e[s]=r.getPropertyValue(s)),e}render(){return u`<slot></slot>`}};Ce.styles=[jn,Dn,En,w`:host([background]) { display: block !important; background: var(--sc-base) !important; } :host([color]) { color: var(--sc-base-content); } :host([font]) { font-family: var(--sc-font-family-base); font-weight: var(--sc-font-weight-base); font-style: var(--sc-font-style-base); }`],Jr([a({type:String,reflect:!0})],Ce.prototype,"theme",2),Ce=Jr([y(Tn)],Ce);var Mn=Object.defineProperty,Rn=Object.getOwnPropertyDescriptor,Ge=(i,t,r,e)=>{for(var s=e>1?void 0:e?Rn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Mn(t,r,s),s};const Qr="sonic-badge";let Ht=class extends v{constructor(){super(...arguments),this.type="default",this.variant="default",this.size="md"}render(){return u`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`}};Ht.styles=[w`:host { --sc-badge-gap: 0.3em; --sc-badge-py: 0.15em; --sc-badge-px: 0.66em; --sc-badge-fs: 1rem; --sc-badge-color: var(--sc-base-content, #1f2937); --sc-badge-bg: var(--sc-base-200, #e5e7eb); --sc-badge-border-with: var(--sc-form-border-width, 0.1rem); --sc-badge-border-color: transparent; --sc-badge-border: var(--sc-badge-border-with) solid var(--sc-badge-border-color); --sc-badge-rounded: 9999px; --sc-badge-line-height: 1.15; --sc-badge-fw: var(--sc-font-weight-base); display: inline-flex; align-items:center; box-sizing: border-box; line-height: var(--sc-badge-line-height); border-radius: var(--sc-badge-rounded); background: var(--sc-badge-bg); color: var(--sc-badge-color); font-family: var(--sc-badge-ff, var(--sc-font-family-base, inherit)); font-weight: var(--sc-badge-fw); padding-top: var(--sc-badge-py); padding-bottom: var(--sc-badge-py); padding-left: var(--sc-badge-px); padding-right: var(--sc-badge-px); min-height: calc(var(--sc-badge-px) * 2); border: var(--sc-badge-border); } /*TYPES*/ :host([type="primary"]) { --sc-badge-color: var(--sc-primary-content); --sc-badge-bg: var(--sc-primary); } :host([type="warning"]) { --sc-badge-color: var(--sc-warning-content); --sc-badge-bg: var(--sc-warning); } :host([type="danger"]) { --sc-badge-color: var(--sc-danger-content); --sc-badge-bg: var(--sc-danger); } :host([type="info"]) { --sc-badge-color: var(--sc-info-content); --sc-badge-bg: var(--sc-info); } :host([type="success"]) { --sc-badge-color: var(--sc-success-content); --sc-badge-bg: var(--sc-success); } :host([type="neutral"]) { --sc-badge-color: var(--sc-base); --sc-badge-bg: var(--sc-base-content); } /*SIZE*/ :host { font-size: var(--sc-badge-fs); gap: var(--sc-badge-gap); } :host([size="xs"]) { --sc-badge-fs: 0.68rem; --sc-badge-gap: 0.35em; } :host([size="sm"]) { --sc-badge-fs: 0.85rem; --sc-badge-gap: 0.35em; } :host([size="lg"]) { --sc-badge-line-height: 1.2; --sc-badge-fs: 1.25rem; --sc-badge-gap: 0.5em; } :host([size="xl"]) { --sc-badge-line-height: 1.2; --sc-badge-fs: 1.5rem; --sc-badge-gap: 0.5em; } /*OUTLINE*/ :host([variant="outline"][type]) { border-width: var(--sc-badge-border-with) !important; border-color: var(--sc-badge-bg); color: var(--sc-badge-bg); background: transparent; } :host([variant="outline"][type="default"]) { border-color: var(--sc-base-400); color: var(--sc-base-500); background: transparent; } /*GHOST*/ :host([variant="ghost"][type]) { color: var(--sc-badge-bg); background: transparent; padding: 0; } :host([variant="ghost"][type="default"]) { color: var(--sc-badge-color); background: transparent; }`],Ge([a({type:String,reflect:!0})],Ht.prototype,"type",2),Ge([a({type:String,reflect:!0})],Ht.prototype,"variant",2),Ge([a({type:String,reflect:!0})],Ht.prototype,"size",2),Ht=Ge([y(Qr)],Ht);try{customElements.define(Qr,Ht)}catch{}class Nn{static fixBlankLink(t){const r="electron",e=typeof require>"u"?null:require(r);typeof e&&t.target=="_blank"&&t.addEventListener("click",()=>{e==null||e.shell.openExternal(t.href)})}}var Fn=Object.defineProperty,In=Object.getOwnPropertyDescriptor,Oe=(i,t,r,e)=>{for(var s=e>1?void 0:e?In(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Fn(t,r,s),s};const ti="sonic-link";let Ct=class extends v{constructor(){super(...arguments),this.href="",this._location="",this.autoActive="partial",this._target=null,this.pushState=null}get location(){return this._location}set location(i){this._location=i,G.updateComponentActiveState(this)}connectedCallback(){this.href&&this.href.indexOf("http")!=0&&(G.onChange(this),this.location=document.location.href.replace(document.location.origin,"")),super.connectedCallback()}disconnectedCallback(){G.offChange(this),super.disconnectedCallback()}set target(i){this._target=i,Nn.fixBlankLink(this),this.requestUpdate()}get target(){return this._target}handlePushState(i){i.preventDefault(),G.changeFromComponent(this)}render(){return this.href?u`<a href="${this.href}" target="${k(this.target)}" @click="${this.pushState?this.handlePushState:null}"><slot></slot></a>`:u`<slot></slot>`}};Ct.styles=[w`a { color: inherit; text-decoration: none; display:contents; }`],Oe([a({type:String})],Ct.prototype,"href",2),Oe([a({type:String})],Ct.prototype,"autoActive",2),Oe([a({type:String})],Ct.prototype,"target",1),Oe([a({type:Boolean})],Ct.prototype,"pushState",2),Ct=Oe([y(ti)],Ct);try{customElements.define(ti,Ct)}catch{}var Un=Object.defineProperty,Bn=Object.getOwnPropertyDescriptor,Ee=(i,t,r,e)=>{for(var s=e>1?void 0:e?Bn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Un(t,r,s),s};const ei="sonic-progress";let Ot=class extends v{constructor(){super(...arguments),this.max=100,this.type="default",this.size="md"}render(){return u`<progress value="${k(this.value)}" max="${this.max}"></progress><div class="slot-container"><slot></slot><slot name="remaining"></slot></div>`}};Ot.styles=[w`:host { --sc-progress-bg: var(--sc-input-bg, var(--sc-base-100, #f5f5f5)); --sc-progress-color: var(--sc-base-content, #1f2937); --sc-progress-height: .6rem; --sc-progress-fs: 1rem; --sc-progress-fw: 500; --sc-progress-rounded: var(--sc-rounded-lg); display: block; line-height: 1.2; font-weight:var(--sc-progress-fw); font-size:var(--sc-progress-fs); color:var(--sc-progress-color); } progress { position: relative; width: 100%; -webkit-appearance: none; appearance: none; overflow: hidden; border:none; height: var(--sc-progress-height); border-radius: var(--sc-progress-rounded); background-color: var(--sc-progress-bg); color: var(--sc-progress-color); } progress::-moz-progress-bar { background-color: var(--sc-progress-color); border-radius: var(--sc-progress-rounded); } progress:not([value])::-moz-progress-bar { background-color: var(--sc-progress-bg); } progress::-webkit-progress-bar { background-color: var(--sc-progress-bg); } progress::-webkit-progress-value { background-color: var(--sc-progress-color); border-radius: var(--sc-progress-rounded); } /* Indeterminate */ progress:indeterminate:after { background-color: var(--sc-progress-color); content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 33.333333%; border-radius: var(--sc-progress-rounded); animation: progress-loading 3s infinite ease-in-out; } @keyframes progress-loading { 50% { left: 107%; } } /* COLOR TYPES */ :host([type="warning"]) { --sc-progress-color: var(--sc-warning); } :host([type="danger"]) { --sc-progress-color: var(--sc-danger); } :host([type="info"]) { --sc-progress-color: var(--sc-info); } :host([type="success"]) { --sc-progress-color: var(--sc-success); } /* SIZES */ :host([size="xs"]) { --sc-progress-height:.25rem; --sc-progress-fs: 0.68rem; } :host([size="sm"]) { --sc-progress-height:.4rem; --sc-progress-fs: 0.85rem; } :host([size="lg"]) { --sc-progress-height:1rem; --sc-progress-fs: 1.25rem; } :host([size="xl"]) { --sc-progress-height:1.5rem; --sc-progress-fs: 1.5rem; } slot[name="remaining"] { font-weight:var(--sc-font-weight-base); color:var(--sc-base-400); font-size:.85em; margin-top:.5em; } .slot-container { display:flex; justify-content: space-between; gap:.5em; }`],Ee([a({type:Number})],Ot.prototype,"value",2),Ee([a({type:Number})],Ot.prototype,"max",2),Ee([a({type:String,reflect:!0})],Ot.prototype,"type",2),Ee([a({type:String,reflect:!0})],Ot.prototype,"size",2),Ot=Ee([y(ei)],Ot);try{customElements.define(ei,Ot)}catch{}const Ns=w`* { box-sizing: border-box; } :host { --sc-input-height: var(--sc-form-height, 2.5em); --sc-input-border-width: var(--sc-form-border-width, 0.1rem); --sc-input-color: var(--sc-base-content, #1f2937); --sc-item-rounded-tr: var(--sc-input-rounded, var(--sc-rounded)); --sc-item-rounded-tl: var(--sc-input-rounded, var(--sc-rounded)); --sc-item-rounded-bl: var(--sc-input-rounded, var(--sc-rounded)); --sc-item-rounded-br: var(--sc-input-rounded, var(--sc-rounded)); --sc-input-ff: inherit; --sc-input-py: 0.6em; --sc-input-px: 1.15em; --sc-input-prefix-color: var(--sc-input-color); --sc-input-prefix-bg: var(--sc-input-bg); --sc-input-prefix-border-color: var(--sc-input-border-color); --sc-input-suffix-color: var(--sc-input-color); --sc-input-suffix-bg: var(--sc-input-bg); --sc-input-suffix-border-color: var(--sc-input-border-color); --sc-label-fs: var(--sc-input-fs); --sc-label-fw: normal; } .form-element { display: block; flex-grow: 1; width: 100%; line-height: 1.1; color: var(--sc-input-color); border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl); font-family: var(--sc-input-ff); background-color: var(--sc-input-bg, var(--sc-base, #fff)); border: var(--sc-input-border-width) solid var(--sc-input-border-color, var(--sc-base-300, #aaa)); width: 100%; font-size: var(--sc-input-fs); padding-top: var(--sc-input-py); padding-bottom: var(--sc-input-py); padding-left: var(--sc-input-px); padding-right: var(--sc-input-px); min-height: var(--sc-input-height); } label { font-size: var(--sc-label-fs); font-weight: var(--sc-label-fw); line-height: 1.2; } .form-control { display: flex; width: 100%; } /*Suffix*/ :host(:not([inlineContent])) .has-suffix slot[name="suffix"], :host(:not([inlineContent])) .has-prefix slot[name="prefix"] { min-width: var(--sc-input-height); box-sizing: border-box; display: flex; align-items: center; justify-content: center; line-height: 1.1; flex-shrink: 0; padding-left: calc(-1 * var(--sc-input-px)); padding-right: calc(-1 * var(--sc-input-px)); } :host(:not([inlineContent])) slot[name="prefix"] { border-radius: var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl); background-color: var(--sc-input-prefix-bg); color: var(--sc-input-prefix-color); border: var(--sc-input-border-width) solid var(--sc-input-prefix-border-color); margin-right: calc(-1 * var(--sc-input-border-width)); } :host(:not([inlineContent])) slot[name="suffix"] { border-radius: 0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0; background-color: var(--sc-input-suffix-bg); color: var(--sc-input-suffix-color); border: var(--sc-input-border-width) solid var(--sc-input-suffix-border-color); margin-left: calc(-1 * var(--sc-input-border-width)); } :host(:not([inlineContent])) .has-prefix .form-element { border-top-left-radius: 0; border-bottom-left-radius: 0; } :host(:not([inlineContent])) .has-suffix .form-element { border-top-right-radius: 0; border-bottom-right-radius: 0; } /*InlineCONTENT */ :host([inlineContent]) { --sc-input-py: 0; } :host([inlineContent]) .form-element { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2em; } /*Disabled */ :host([disabled]) .form-element-container { cursor: not-allowed; } /*SIZE*/ :host { --sc-input-fs: 1rem; } :host([size="xs"]) { --sc-input-fs: 0.75rem; } :host([size="sm"]) { --sc-input-fs: 0.85rem; } :host([size="lg"]) { --sc-input-fs: 1.2rem; } :host([variant="ghost"]) .form-element { --sc-input-bg: transparent; } /*Disbaled*/ :host([disabled]) .form-element { pointer-events: none; background-color: var(--sc-base-100); border-color: transparent; color: var(--sc-base-400); } /*PLACEHOLDER*/ ::placeholder { color: inherit; opacity: 0.45; } :focus::placeholder { opacity: 0; } /*HOVER*/ :host(:not([disabled])) .form-element:hover, .form-element:focus-visible, .form-element:focus { filter: brightness(0.97); outline: none; } .form-label { margin-bottom: 0.22em; display: block; } .form-description { color: var(--sc-base-400); font-size: 0.85em; margin-top: 0.2em; display: block; } .form-element > slot, .form-element .form-element { all: unset !important; } /*Utilitaires*/ .hidden { display: none; } .contents { display: contents; } /*ERROR*/ :host([error]) { --sc-input-border-color: var(--sc-danger); } :host input:visited{ display:none; } :host([touched]) :not(:focus):invalid { --sc-input-border-color: var(--sc-danger); --sc-input-color: var(--sc-danger); } :host([touched]) :not(:focus):invalid + .select-chevron{ --sc-input-color: var(--sc-danger); } /*VALID*/ :host([touched]) :not([value=""]):not(:focus):valid { --sc-input-border-color: var(--sc-success); --sc-input-color: var(--sc-success); } :host([touched]) :not(:focus):valid + .select-chevron{ --sc-input-color: var(--sc-success); }`;var Vn=Object.defineProperty,qn=Object.getOwnPropertyDescriptor,Fs=(i,t,r,e)=>{for(var s=e>1?void 0:e?qn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Vn(t,r,s),s};const Xe=i=>{class t extends i{constructor(...e){super(),this.type="text",this.tabindex=null,this.autocomplete=null}validateFormElement(){var s;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("input");!e||e.checkValidity()||(this.getFormPublisher().isFormValid=!1,e.reportValidity())}}return Fs([a({type:String})],t.prototype,"type",2),Fs([a({type:String})],t.prototype,"tabindex",2),Fs([a({type:String})],t.prototype,"autocomplete",2),t};/**
|
|
110
|
+
*/const Pt=ie(class extends oe{constructor(i){if(super(i),i.type!==Rt.CHILD)throw Error("templateContent can only be used in child bindings")}render(i){return this.vt===i?ht:(this.vt=i,document.importNode(i.content,!0))}});var nn=Object.defineProperty,an=Object.getOwnPropertyDescriptor,ln=(i,t,r,e)=>{for(var s=e>1?void 0:e?an(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&nn(t,r,s),s};const Ur="sonic-subscriber";let Ls=class extends I(v){constructor(){super(...arguments),this.noAutofill=!0}connectedCallback(){this.noShadowDom="",super.connectedCallback()}render(){return u`<slot></slot>`}};Ls=ln([y(Ur)],Ls);try{customElements.define(Ur,Ls)}catch{}var cn=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,Ke=(i,t,r,e)=>{for(var s=e>1?void 0:e?hn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&cn(t,r,s),s};const Br="sonic-list";let Vt=class extends Ds(I($e(v))){constructor(){super(...arguments),this.itemPropertyMap=null,this.templateKey="template",this.idKey="id"}connectedCallback(){this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.isDefaultLoaderEnabled=!1,this.isFetchEnabled=this.hasAttribute("fetch"),this.isFetchEnabled&&(this.isLoading=!0),super.connectedCallback()}renderLoadingState(){return this.templateParts.skeleton?Pt(this.templateParts.skeleton):u`<sonic-loader mode="inline"></sonic-loader>`}renderNoResultState(){return u`<div class="sonic-no-result-container"><sonic-icon name="emoji-puzzled" size="lg"></sonic-icon><span class="sonic-no-result-text">${this.props}</span></div>`}formatProps(){let i=this.props,t=this.hasAttribute("extractValues");return Array.isArray(i)||(t?i=Object.entries(i).map(([r,e])=>({key:r,value:e})):i=[i]),i}render(){if(this.isLoading&&!Array.isArray(this.props))return this.renderLoadingState();if(typeof this.props=="string")return this.renderNoResultState();if(!et.isObject(this.props))return u`<div></div>`;let i=this.formatProps();if(i.length==0&&this.templateParts["no-item"])return Pt(this.templateParts["no-item"]);let t=this.templateList.length,r=-1,e=this.hasAttribute("extractValues");return u`${Ft(i,(s,o)=>s[this.idKey]||o,(s,o)=>{let n=s[this.templateKey],l=n&&this.templateParts[n];r++,l&&(r=-1);let c=e?s.key:o,h=this.publisher[c];return h._key_=c+"",s&&u`<sonic-subscriber debug="${S(this.defferedDebug)}" .bindPublisher="${function(){return h}}" .propertyMap="${S(this.itemPropertyMap)}" dataProvider="${this.dataProvider}/list-item/${o}">${Pt(l?this.templateParts[n]:this.templateList[r%t])}</sonic-subscriber>`})}`}};Vt.styles=[w`.sonic-no-result-container { color: var(--sc-base-400); font-size: 1.65rem; } sonic-icon { margin-right: 0.25em; } span { vertical-align: middle; }`],Ke([a({type:Object})],Vt.prototype,"itemPropertyMap",2),Ke([a({type:String})],Vt.prototype,"templateKey",2),Ke([a({type:String})],Vt.prototype,"idKey",2),Vt=Ke([y(Br)],Vt);try{customElements.define(Br,Vt)}catch{}var dn=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,yt=(i,t,r,e)=>{for(var s=e>1?void 0:e?pn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&dn(t,r,s),s};const Vr="sonic-queue";let nt=class extends I(v){constructor(){super(...arguments),this.templates=null,this.lastRequestTime=0,this.key="",this.itemPropertyMap=null,this.targetRequestDuration=500,this.limit=5,this.offset=0,this.filteredFields="",this.filterPublisher=null,this.filterTimeoutId=void 0,this.dataProviderExpression="",this.idKey="id",this.currentScrollPosition=void 0,this.listDataProviders=[]}connectedCallback(){this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.dataProvider||(this.dataProvider="sonic-queue-"+nt.instanceCounter++),this.configFilter(),super.connectedCallback(),this.key=this.getAttribute("key"),this.templates||(this.templates=Array.from(this.querySelectorAll("template"))),this.lastRequestTime=new Date().getTime(),this.next()}configFilter(){var t;let i=this.getAncestorAttributeValue("dataFilterProvider");!i||(this.filterPublisher=K.getInstance().get(i),(t=this.filterPublisher)==null||t.onInternalMutation(()=>{var r;Object.keys((r=this.filterPublisher)==null?void 0:r.get()).length!=0&&this.updateFilteredContent()}))}updateFilteredContent(){for(let i of this.listDataProviders)K.delete(i);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout(()=>{this.props=null,this.next()},250)}resetDuration(){this.lastRequestTime=new Date().getTime()}next(i){var h,b;let t=this.offset;const r=new Date().getTime()-this.lastRequestTime;if(i&&(!i.detail.isFirstLoad||!i.detail.props.length||this.dataProviderExpression.indexOf("$offset")==-1))return;if(!Array.isArray(this.props))this.props=[];else{const f=this.props,g=f[f.length-1];t=parseInt(g.offset.toString())+parseInt(g.limit.toString())}r>0&&i&&(this.limit=Math.round(this.limit/r*this.targetRequestDuration)),this.limit<1&&(this.limit=1),this.limit>15&&(this.limit=15);let e=this.dataProviderExpression.replace("$offset",t+"").replace("$limit",this.limit+""),s=e.split("?"),o=s.shift(),n=new URLSearchParams(s.join("?")),l=(h=this.filterPublisher)==null?void 0:h.get(),c=this.filteredFields.split(" ");for(let f in l)this.filteredFields&&!c.includes(f)||n.set(f,l[f]);e=o+"?"+n.toString(),this.listDataProviders.push(e),this.currentScrollPosition=(b=document.scrollingElement)==null?void 0:b.scrollTop,this.props=[...this.props,{id:n.toString()+"/"+this.props.length,dataProvider:e,offset:t,limit:this.limit}],this.lastRequestTime=new Date().getTime()}render(){return this.currentScrollPosition&&window.requestAnimationFrame(()=>{document.scrollingElement&&(document.scrollingElement.scrollTop=this.currentScrollPosition),this.currentScrollPosition=void 0}),Array.isArray(this.props)?u`${Ft(this.props,i=>i.id,(i,t)=>{var e;let r=t==0?this.templates:(e=this.templates)==null?void 0:e.filter(s=>s.getAttribute("data-value")!="no-item");return u`<sonic-list fetch .itemPropertyMap="${this.itemPropertyMap}" debug="${S(this.defferedDebug)}" @load="${this.next}" key="${this.key}" @loading="${this.resetDuration}" dataProvider="${i.dataProvider}" idKey="${this.idKey}" .templates="${r}"></sonic-list>`})}`:P}};nt.instanceCounter=0,yt([a({type:Array})],nt.prototype,"templates",2),yt([a({type:Object})],nt.prototype,"itemPropertyMap",2),yt([a()],nt.prototype,"targetRequestDuration",2),yt([a()],nt.prototype,"limit",2),yt([a()],nt.prototype,"offset",2),yt([a()],nt.prototype,"filteredFields",2),yt([a({type:String})],nt.prototype,"dataProviderExpression",2),yt([a({type:String})],nt.prototype,"idKey",2),nt=yt([y(Vr)],nt);try{customElements.define(Vr,nt)}catch{}var un=Object.defineProperty,gn=Object.getOwnPropertyDescriptor,Ye=(i,t,r,e)=>{for(var s=e>1?void 0:e?gn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&un(t,r,s),s};const qr="sonic-submit";let qt=class extends I(v){constructor(){super(...arguments),this.submitResultKey=null,this.disabled=!1,this.endPoint=null,this.api=null}connectedCallback(){this.hasAttribute("onClick")&&this.addEventListener("click",()=>this.submit()),this.hasAttribute("onEnterKey")&&this.addEventListener("keydown",i=>{i.key==="Enter"&&this.submit()}),super.connectedCallback(),this.api=new se(this.getApiConfiguration())}async submit(){var c,h,b,f,g;const i=K.getInstance().get(this.getAncestorAttributeValue("formDataProvider"));if(i.isFormValid=!0,i.invalidate(),!i.isFormValid.get())return;this.publisher.disabled=!0,i.isFormValid;let t=((c=this.getAttribute("method"))==null?void 0:c.toLocaleLowerCase())||"post",r=i.get();delete r.isFormValid;let e=K.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get(),s=null,o=this.getAncestorAttributeValue("dataProvider"),n=this.endPoint||o;switch(q.show(),t){case"put":s=await((h=this.api)==null?void 0:h.put(n,r,e));break;case"delete":s=await((b=this.api)==null?void 0:b.delete(n,r,e));break;case"get":s=await((f=this.api)==null?void 0:f.get(n));break;default:s=await((g=this.api)==null?void 0:g.post(n,r,e));break}q.hide(),s||(s={messages:[{content:"Network Error",status:"error"}]});let l=this.getAncestorAttributeValue("clearedDataOnSuccess");l&&l.split(" ").forEach($=>K.get($).set({})),this.submitResultKey&&(s=et.traverse(s,this.submitResultKey.split("."),!0)),K.getInstance().get(this.getAncestorAttributeValue("submitResultDataProvider")).set(s),this.publisher.disabled=!1}render(){return u`<div ?data-disabled="${this.disabled}"><slot></slot></div>`}};qt.styles=w`[data-disabled]{ opacity: 0.3; pointer-events: none; user-select: none; }`,Ye([a({type:String})],qt.prototype,"submitResultKey",2),Ye([a({type:Boolean})],qt.prototype,"disabled",2),Ye([a({type:String})],qt.prototype,"endPoint",2),qt=Ye([y(qr)],qt);try{customElements.define(qr,qt)}catch{}var fn=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},zs={exports:{}};(function(i,t){var r=[].slice;(function(e,s){return t!==null?i.exports=s():e.UrlPattern=s()})(fn,function(){var e,s,o,n,l,c,h,b,f,g,$,_,k,R,D;return f=function(d){return d.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},h=function(d,p){var m,x,A;for(A=[],m=-1,x=d.length;++m<x;)A=A.concat(p(d[m]));return A},R=function(d,p){var m,x,A;for(A="",m=-1,x=d.length;++m<x;)A+=p(d[m]);return A},k=function(d){return new RegExp(d.toString()+"|").exec("").length-1},$=function(d,p){var m,x,A,O,N;for(O={},m=-1,A=d.length;++m<A;)x=d[m],N=p[m],N!=null&&(O[x]!=null?(Array.isArray(O[x])||(O[x]=[O[x]]),O[x].push(N)):O[x]=N);return O},e={},e.Result=function(d,p){this.value=d,this.rest=p},e.Tagged=function(d,p){this.tag=d,this.value=p},e.tag=function(d,p){return function(m){var x,A;if(x=p(m),x!=null)return A=new e.Tagged(d,x.value),new e.Result(A,x.rest)}},e.regex=function(d){return function(p){var m,x;if(m=d.exec(p),m!=null)return x=m[0],new e.Result(x,p.slice(x.length))}},e.sequence=function(){var d;return d=1<=arguments.length?r.call(arguments,0):[],function(p){var m,x,A,O,N,X;for(m=-1,x=d.length,X=[],O=p;++m<x;){if(A=d[m],N=A(O),N==null)return;X.push(N.value),O=N.rest}return new e.Result(X,O)}},e.pick=function(){var d,p;return d=arguments[0],p=2<=arguments.length?r.call(arguments,1):[],function(m){var x,A;if(A=e.sequence.apply(e,p)(m),A!=null)return x=A.value,A.value=x[d],A}},e.string=function(d){var p;return p=d.length,function(m){if(m.slice(0,p)===d)return new e.Result(d,m.slice(p))}},e.lazy=function(d){var p;return p=null,function(m){return p==null&&(p=d()),p(m)}},e.baseMany=function(d,p,m,x,A){var O,N,X,Te;for(X=A,Te=m?"":[];!(p!=null&&(O=p(X),O!=null)||(N=d(X),N==null));)m?Te+=N.value:Te.push(N.value),X=N.rest;if(!(x&&Te.length===0))return new e.Result(Te,X)},e.many1=function(d){return function(p){return e.baseMany(d,null,!1,!0,p)}},e.concatMany1Till=function(d,p){return function(m){return e.baseMany(d,p,!0,!0,m)}},e.firstChoice=function(){var d;return d=1<=arguments.length?r.call(arguments,0):[],function(p){var m,x,A,O;for(m=-1,x=d.length;++m<x;)if(A=d[m],O=A(p),O!=null)return O}},_=function(d){var p;return p={},p.wildcard=e.tag("wildcard",e.string(d.wildcardChar)),p.optional=e.tag("optional",e.pick(1,e.string(d.optionalSegmentStartChar),e.lazy(function(){return p.pattern}),e.string(d.optionalSegmentEndChar))),p.name=e.regex(new RegExp("^["+d.segmentNameCharset+"]+")),p.named=e.tag("named",e.pick(1,e.string(d.segmentNameStartChar),e.lazy(function(){return p.name}))),p.escapedChar=e.pick(1,e.string(d.escapeChar),e.regex(/^./)),p.static=e.tag("static",e.concatMany1Till(e.firstChoice(e.lazy(function(){return p.escapedChar}),e.regex(/^./)),e.firstChoice(e.string(d.segmentNameStartChar),e.string(d.optionalSegmentStartChar),e.string(d.optionalSegmentEndChar),p.wildcard))),p.token=e.lazy(function(){return e.firstChoice(p.wildcard,p.optional,p.named,p.static)}),p.pattern=e.many1(e.lazy(function(){return p.token})),p},b={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},c=function(d,p){if(Array.isArray(d))return R(d,function(m){return c(m,p)});switch(d.tag){case"wildcard":return"(.*?)";case"named":return"(["+p+"]+)";case"static":return f(d.value);case"optional":return"(?:"+c(d.value,p)+")?"}},l=function(d,p){return p==null&&(p=b.segmentValueCharset),"^"+c(d,p)+"$"},n=function(d){if(Array.isArray(d))return h(d,n);switch(d.tag){case"wildcard":return["_"];case"named":return[d.value];case"static":return[];case"optional":return n(d.value)}},g=function(d,p,m,x){var A,O,N,X;if(x==null&&(x=!1),X=d[p],X==null){if(x)throw new Error("no values provided for key `"+p+"`");return}if(A=m[p]||0,O=Array.isArray(X)?X.length-1:0,A>O){if(x)throw new Error("too few values provided for key `"+p+"`");return}return N=Array.isArray(X)?X[A]:X,x&&(m[p]=A+1),N},o=function(d,p,m){var x,A;if(Array.isArray(d)){for(x=-1,A=d.length;++x<A;)if(o(d[x],p,m))return!0;return!1}switch(d.tag){case"wildcard":return g(p,"_",m,!1)!=null;case"named":return g(p,d.value,m,!1)!=null;case"static":return!1;case"optional":return o(d.value,p,m)}},D=function(d,p,m){if(Array.isArray(d))return R(d,function(x){return D(x,p,m)});switch(d.tag){case"wildcard":return g(p,"_",m,!0);case"named":return g(p,d.value,m,!0);case"static":return d.value;case"optional":return o(d.value,p,m)?D(d.value,p,m):""}},s=function(d,p){var m,x,A,O,N;if(d instanceof s){this.isRegex=d.isRegex,this.regex=d.regex,this.ast=d.ast,this.names=d.names;return}if(this.isRegex=d instanceof RegExp,!(typeof d=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=d,p!=null){if(!Array.isArray(p))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(m=k(this.regex),p.length!==m)throw new Error("regex contains "+m+" groups but array of group names contains "+p.length);this.names=p}return}if(d==="")throw new Error("argument must not be the empty string");if(N=d.replace(/\s+/g,""),N!==d)throw new Error("argument must not contain whitespace");if(x={escapeChar:(p!=null?p.escapeChar:void 0)||b.escapeChar,segmentNameStartChar:(p!=null?p.segmentNameStartChar:void 0)||b.segmentNameStartChar,segmentNameCharset:(p!=null?p.segmentNameCharset:void 0)||b.segmentNameCharset,segmentValueCharset:(p!=null?p.segmentValueCharset:void 0)||b.segmentValueCharset,optionalSegmentStartChar:(p!=null?p.optionalSegmentStartChar:void 0)||b.optionalSegmentStartChar,optionalSegmentEndChar:(p!=null?p.optionalSegmentEndChar:void 0)||b.optionalSegmentEndChar,wildcardChar:(p!=null?p.wildcardChar:void 0)||b.wildcardChar},O=_(x),A=O.pattern(d),A==null)throw new Error("couldn't parse pattern");if(A.rest!=="")throw new Error("could only partially parse pattern");this.ast=A.value,this.regex=new RegExp(l(this.ast,x.segmentValueCharset)),this.names=n(this.ast)},s.prototype.match=function(d){var p,m;return m=this.regex.exec(d),m==null?null:(p=m.slice(1),this.names?$(this.names,p):p)},s.prototype.stringify=function(d){if(d==null&&(d={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(d!==Object(d))throw new Error("argument must be an object or undefined");return D(this.ast,d,{})},s.escapeForRegex=f,s.concatMap=h,s.stringConcatMap=R,s.regexGroupCount=k,s.keysAndValuesToObject=$,s.P=e,s.newParser=_,s.defaultOptions=b,s.astNodeToRegexString=l,s.astNodeToNames=n,s.getParam=g,s.astNodeContainsSegmentsForProvidedParams=o,s.stringify=D,s})})(zs,zs.exports);var ae=zs.exports,mn=Object.defineProperty,vn=Object.getOwnPropertyDescriptor,Hr=(i,t,r,e)=>{for(var s=e>1?void 0:e?vn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&mn(t,r,s),s};const Wr="sonic-router";let Ze=class extends I($e(v)){constructor(){super(...arguments),this.templateValueAttribute="data-route",this._location=document.location.href.replace(document.location.origin,"")}connectedCallback(){this.noShadowDom="",G.onChange(this),super.connectedCallback()}disconnectedCallback(){G.offChange(this),super.disconnectedCallback()}set location(i){this._location=i,this.requestUpdate()}get location(){return this._location}render(){let i=[];for(let t of this.templatePartsList){let r=t.getAttribute(this.templateValueAttribute),e=new RegExp(r),s=new ae(r);e.test(this.location)?i.push(t):s.match(this.location)&&(t.setAttribute("mode","patternMatching"),i.push(t))}return u`${Ft(i,(t,r)=>r+new Date().getTime(),t=>{var r;if(t.title&&(document.title=t.title),t.hasAttribute("dataProviderExpression")){let e="",s=t.getAttribute("dataProviderExpression");if(t.getAttribute("mode")=="patternMatching"){const o=new ae(t.getAttribute(this.templateValueAttribute));e=new ae(s).stringify(o.match(this.location))}else{const o=new RegExp(t.getAttribute(this.templateValueAttribute));let n=(this.location+"").match(o);n&&(e=(r=n.shift())==null?void 0:r.replace(o,s))}return u`<div style="display:contents" dataProvider="${e}">${Pt(t)}</div>`}return Pt(t)})}`}};Hr([a()],Ze.prototype,"location",1),Ze=Hr([y(Wr)],Ze);try{customElements.define(Wr,Ze)}catch{}var bn=Object.defineProperty,yn=Object.getOwnPropertyDescriptor,wn=(i,t,r,e)=>{for(var s=e>1?void 0:e?yn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&bn(t,r,s),s};const Kr="sonic-redirect";let Ts=class extends I(v){constructor(){super(...arguments),this.udpateCallBack=()=>{}}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.props)return;let i=this.getAttribute("onData").split("."),t=et.traverse(this.props,i);t&&!(et.isObject(t)&&t)&&G.changeFromComponent(this)}};Ts=wn([y(Kr)],Ts);try{customElements.define(Kr,Ts)}catch{}var $n=Object.defineProperty,xn=Object.getOwnPropertyDescriptor,Ms=(i,t,r,e)=>{for(var s=e>1?void 0:e?xn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&$n(t,r,s),s};const Yr="sonic-states";let Pe=class extends I($e(v)){constructor(){super(...arguments),this.state="",this.inverted=!1,this.statePath="",this.onAssign=null}connectedCallback(){if(super.connectedCallback(),this.hasAttribute("data-path")&&(this.statePath=this.getAttribute("data-path")),this.statePath){this.statePublisher=this.publisher;let i=this.statePath.split(".");for(let t of i)this.statePublisher=this.statePublisher[t];this.onAssign=t=>{this.state=t,this.requestUpdate()},this.statePublisher.onAssign(this.onAssign)}}disconnectedCallback(){this.statePath&&this.statePublisher.offAssign(this.onAssign),super.disconnectedCallback()}render(){let i=[],t=this.state;(!Array.isArray(t)&&et.isObject(t)||t===void 0)&&(t="");for(let r of this.templatePartsList){let e=r.getAttribute(this.templateValueAttribute),s=t;if(this.inverted&&(s=e,e=t),e==""&&(e=this.inverted?".*?":"^$"),new RegExp(e).test(s))i.push(r),r.removeAttribute("mode");else{let o=new ae(e);o.names.length>0&&o.match(s)&&(r.setAttribute("mode","patternMatching"),i.push(r))}}return u`${Ft(i,(r,e)=>e+new Date().getTime(),r=>{var e;if(r.title&&(document.title=r.title),r.hasAttribute("dataProviderExpression")){let s=r.getAttribute("dataProviderExpression"),o="",n=t,l=r.getAttribute(this.templateValueAttribute);if(this.inverted&&(n=l,l=t),l==""&&(l=this.inverted?"*":"^$"),r.getAttribute("mode")=="patternMatching"){const c=new ae(l);o=new ae(s).stringify(c.match(n))}else{const c=new RegExp(l);let h=(n+"").match(c);h&&(o=(e=h.shift())==null?void 0:e.replace(c,s))}return u`<div style="display:contents" dataProvider="${o}">${Pt(r)}</div>`}return Pt(r)})}`}};Ms([a()],Pe.prototype,"state",2),Ms([a({type:Boolean,reflect:!0})],Pe.prototype,"inverted",2),Pe=Ms([y(Yr)],Pe);try{customElements.define(Yr,Pe)}catch{}var _n=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,An=(i,t,r,e)=>{for(var s=e>1?void 0:e?kn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&_n(t,r,s),s};const Sn="sonic-scope";let Zr=class extends v{createRenderRoot(){return this}render(){return u`<slot></slot>`}};Zr=An([y(Sn)],Zr);var Pn=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,Gr=(i,t,r,e)=>{for(var s=e>1?void 0:e?Cn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Pn(t,r,s),s};const On="sonic-example";let Rs=class extends I(v){constructor(){super(...arguments),this.text="Example"}render(){return u`${this.text}`}};Gr([a()],Rs.prototype,"text",2),Rs=Gr([y(On)],Rs);const En=w`:host { /* polices*/ --sc-font-family-base: "Inter var", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --sc-font-weight-base: 400; --sc-font-style-base: normal; --sc-headings-font-family: var(--sc-font-family-base); --sc-headings-font-style: var(--sc-font-style-base); --sc-headings-line-height: 1.1; --sc-headings-font-weight: 700; --sc-headings-text-transform: none; /* Button*/ --sc-btn-font-weight: var(--sc-font-weight-base); --sc-btn-font-family: var(--sc-font-family-base); --sc-btn-font-style: var(--sc-font-style-base); /* ROUNDED*/ --sc-rounded-sm: calc(var(--sc-rounded) * 0.5); --sc-rounded: 0.35rem; --sc-rounded-md: calc(var(--sc-rounded) * 1.8); --sc-rounded-lg: calc(var(--sc-rounded) * 3.5); --sc-rounded-xl: calc(var(--sc-rounded) * 7); --sc-btn-rounded: calc(var(--sc-rounded) * 1.2); /* Placeholder */ --sc-placeholder-bg: rgba(17, 24, 39, 0.05); /* Images*/ --sc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); --sc-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); --sc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); --sc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); --sc-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25); /* formulaires*/ --sc-border-width: max(1px, 0.085rem); --sc-form-border-width: var(--sc-border-width); --sc-input-bg: var(--sc-base-100); --sc-input-border-color: var(--sc-input-bg); --sc-input-rounded: calc(var(--sc-rounded) * 1.2); /*Couleurs -- textes sur images*/ --sc-contrast-content: #fff; --sc-contrast: #0f172a; /*Scrollbar*/ --sc-scrollbar-bg : var(--sc-base-400); }`,jn=w`:host { /*Boutons*/ --sc-primary: var(--sc-base-800); --sc-info: #2563eb; --sc-danger: #f43f5e; --sc-warning: #f97316; --sc-success: #14b8a6; --sc-primary-content: var(--sc-base); --sc-info-content: var(--sc-base); --sc-danger-content: var(--sc-base); --sc-warning-content: var(--sc-base); --sc-success-content: var(--sc-base); /*Bases*/ --sc-base: #fff; --sc-base-50: #f8fafc; --sc-base-100: #f1f5f9; --sc-base-200: #e2e8f0; --sc-base-300: #cbd5e1; --sc-base-400: #94a3b8; --sc-base-500: #64748b; --sc-base-600: #475569; --sc-base-700: #334155; --sc-base-800: #1e293b; --sc-base-900: #0f172a; --sc-base-content: var(--sc-base-700); /*formulaires*/ --sc-input-bg: var(--sc-base-100); --sc-input-color: var(--sc-base-content); }`,Xr=w`--sc-primary: var(--sc-dark-primary, var(--sc-base-700)); --sc-info: var(--sc-dark-info, #3abff8); --sc-danger: var(--sc-dark-danger, #f87272); --sc-warning: var(--sc-dark-warning, #fbbd23); --sc-success: var(--sc-dark-success, #36d399); --sc-primary-content: var(--sc-dark-primary-content, #002b3d); --sc-info-content: var(--sc-dark-info-content, #002b3d); --sc-danger-content: var(--sc-dark-danger-content, #382800); --sc-warning-content: var(--sc-dark-warning-content, #382800); --sc-success-content: var(--sc-dark-success-content, #003320); --sc-base: var(--sc-dark-base, #1d2634); --sc-base-50: var(--sc-dark-base-50, #1f2937); --sc-base-100: var(--sc-dark-base-100, #252C36); --sc-base-200: var(--sc-dark-base-200, #2c3543); --sc-base-300: var(--sc-dark-base-300, #38414e); --sc-base-400: var(--sc-dark-base-400, #515964); --sc-base-500: var(--sc-dark-base-500, #828891); --sc-base-600: var(--sc-dark-base-600, #b4b8be); --sc-base-700: var(--sc-dark-base-700, #cdd0d5); --sc-base-800: var(--sc-dark-base-800, #d9dce0); --sc-base-900: var(--sc-dark-base-900, #e5e7eb); --sc-base-content: var(--sc-dark-base-content, #e5e7eb);`,Dn=w`:host([theme="dark"]) { ${Xr} } @media (prefers-color-scheme: dark) { :host([theme="auto"]) { ${Xr} } }`;var Ln=Object.defineProperty,zn=Object.getOwnPropertyDescriptor,Jr=(i,t,r,e)=>{for(var s=e>1?void 0:e?zn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ln(t,r,s),s};const Tn="sonic-theme";let Ce=class extends v{constructor(){super(...arguments),this.theme="light"}connectedCallback(){super.connectedCallback(),window.addEventListener("message",i=>this.receiveMessage(i),!1),this.postCSSVars()}postCSSVars(){const i=document.styleSheets,t=i.length;let r=[];for(let e=0;e<t;e++){let s=i[e];s.href&&(s.href.includes("googleapis")||s.href.includes("typekit.net"))&&r.push(s.href)}document.querySelectorAll("iframe").forEach(e=>{var s;return(s=e.contentWindow)==null?void 0:s.postMessage({type:"SonicTheme",variables:this.getCssVariables(),fonts:r},"*")})}receiveMessage(i){let t=i.data;!t.type||t.type!="GetSonicTheme"||this.postCSSVars()}getCssVariables(){let i=[],t=[...Ce.styles.map(s=>s.styleSheet),...Array.from(document.styleSheets)];for(let s of t)try{let o=s==null?void 0:s.cssRules;for(let n of o)if(n.style)for(let l of n.style)i.includes(l)||l.indexOf("--sc")!==0||i.push(l)}catch{}let r=window.getComputedStyle(this),e={};return i.forEach(s=>e[s]=r.getPropertyValue(s)),e}render(){return u`<slot></slot>`}};Ce.styles=[jn,Dn,En,w`:host([background]) { display: block !important; background: var(--sc-base) !important; } :host([color]) { color: var(--sc-base-content); } :host([font]) { font-family: var(--sc-font-family-base); font-weight: var(--sc-font-weight-base); font-style: var(--sc-font-style-base); }`],Jr([a({type:String,reflect:!0})],Ce.prototype,"theme",2),Ce=Jr([y(Tn)],Ce);var Mn=Object.defineProperty,Rn=Object.getOwnPropertyDescriptor,Ge=(i,t,r,e)=>{for(var s=e>1?void 0:e?Rn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Mn(t,r,s),s};const Qr="sonic-badge";let Ht=class extends v{constructor(){super(...arguments),this.type="default",this.variant="default",this.size="md"}render(){return u`<slot name="prefix"></slot><slot></slot><slot name="suffix"></slot>`}};Ht.styles=[w`:host { --sc-badge-gap: 0.3em; --sc-badge-py: 0.15em; --sc-badge-px: 0.66em; --sc-badge-fs: 1rem; --sc-badge-color: var(--sc-base-content, #1f2937); --sc-badge-bg: var(--sc-base-200, #e5e7eb); --sc-badge-border-with: var(--sc-form-border-width, 0.1rem); --sc-badge-border-color: transparent; --sc-badge-border: var(--sc-badge-border-with) solid var(--sc-badge-border-color); --sc-badge-rounded: 9999px; --sc-badge-line-height: 1.15; --sc-badge-fw: var(--sc-font-weight-base); display: inline-flex; align-items:center; box-sizing: border-box; line-height: var(--sc-badge-line-height); border-radius: var(--sc-badge-rounded); background: var(--sc-badge-bg); color: var(--sc-badge-color); font-family: var(--sc-badge-ff, var(--sc-font-family-base, inherit)); font-weight: var(--sc-badge-fw); padding-top: var(--sc-badge-py); padding-bottom: var(--sc-badge-py); padding-left: var(--sc-badge-px); padding-right: var(--sc-badge-px); min-height: calc(var(--sc-badge-px) * 2); border: var(--sc-badge-border); } /*TYPES*/ :host([type="primary"]) { --sc-badge-color: var(--sc-primary-content); --sc-badge-bg: var(--sc-primary); } :host([type="warning"]) { --sc-badge-color: var(--sc-warning-content); --sc-badge-bg: var(--sc-warning); } :host([type="danger"]) { --sc-badge-color: var(--sc-danger-content); --sc-badge-bg: var(--sc-danger); } :host([type="info"]) { --sc-badge-color: var(--sc-info-content); --sc-badge-bg: var(--sc-info); } :host([type="success"]) { --sc-badge-color: var(--sc-success-content); --sc-badge-bg: var(--sc-success); } :host([type="neutral"]) { --sc-badge-color: var(--sc-base); --sc-badge-bg: var(--sc-base-content); } /*SIZE*/ :host { font-size: var(--sc-badge-fs); gap: var(--sc-badge-gap); } :host([size="xs"]) { --sc-badge-fs: 0.68rem; --sc-badge-gap: 0.35em; } :host([size="sm"]) { --sc-badge-fs: 0.85rem; --sc-badge-gap: 0.35em; } :host([size="lg"]) { --sc-badge-line-height: 1.2; --sc-badge-fs: 1.25rem; --sc-badge-gap: 0.5em; } :host([size="xl"]) { --sc-badge-line-height: 1.2; --sc-badge-fs: 1.5rem; --sc-badge-gap: 0.5em; } /*OUTLINE*/ :host([variant="outline"][type]) { border-width: var(--sc-badge-border-with) !important; border-color: var(--sc-badge-bg); color: var(--sc-badge-bg); background: transparent; } :host([variant="outline"][type="default"]) { border-color: var(--sc-base-400); color: var(--sc-base-500); background: transparent; } /*GHOST*/ :host([variant="ghost"][type]) { color: var(--sc-badge-bg); background: transparent; padding: 0; } :host([variant="ghost"][type="default"]) { color: var(--sc-badge-color); background: transparent; }`],Ge([a({type:String,reflect:!0})],Ht.prototype,"type",2),Ge([a({type:String,reflect:!0})],Ht.prototype,"variant",2),Ge([a({type:String,reflect:!0})],Ht.prototype,"size",2),Ht=Ge([y(Qr)],Ht);try{customElements.define(Qr,Ht)}catch{}class Nn{static fixBlankLink(t){const r="electron",e=typeof require>"u"?null:require(r);typeof e&&t.target=="_blank"&&t.addEventListener("click",()=>{e==null||e.shell.openExternal(t.href)})}}var Fn=Object.defineProperty,In=Object.getOwnPropertyDescriptor,Oe=(i,t,r,e)=>{for(var s=e>1?void 0:e?In(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Fn(t,r,s),s};const ti="sonic-link";let Ct=class extends v{constructor(){super(...arguments),this.href="",this._location="",this.autoActive="partial",this._target=null,this.pushState=null}get location(){return this._location}set location(i){this._location=i,G.updateComponentActiveState(this)}connectedCallback(){this.href&&this.href.indexOf("http")!=0&&(G.onChange(this),this.location=document.location.href.replace(document.location.origin,"")),super.connectedCallback()}disconnectedCallback(){G.offChange(this),super.disconnectedCallback()}set target(i){this._target=i,Nn.fixBlankLink(this),this.requestUpdate()}get target(){return this._target}handlePushState(i){i.preventDefault(),G.changeFromComponent(this)}render(){return this.href?u`<a href="${this.href}" target="${S(this.target)}" @click="${this.pushState?this.handlePushState:null}"><slot></slot></a>`:u`<slot></slot>`}};Ct.styles=[w`a { color: inherit; text-decoration: none; display:contents; }`],Oe([a({type:String})],Ct.prototype,"href",2),Oe([a({type:String})],Ct.prototype,"autoActive",2),Oe([a({type:String})],Ct.prototype,"target",1),Oe([a({type:Boolean})],Ct.prototype,"pushState",2),Ct=Oe([y(ti)],Ct);try{customElements.define(ti,Ct)}catch{}var Un=Object.defineProperty,Bn=Object.getOwnPropertyDescriptor,Ee=(i,t,r,e)=>{for(var s=e>1?void 0:e?Bn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Un(t,r,s),s};const ei="sonic-progress";let Ot=class extends v{constructor(){super(...arguments),this.max=100,this.type="default",this.size="md"}render(){return u`<progress value="${S(this.value)}" max="${this.max}"></progress><div class="slot-container"><slot></slot><slot name="remaining"></slot></div>`}};Ot.styles=[w`:host { --sc-progress-bg: var(--sc-input-bg, var(--sc-base-100, #f5f5f5)); --sc-progress-color: var(--sc-base-content, #1f2937); --sc-progress-height: .6rem; --sc-progress-fs: 1rem; --sc-progress-fw: 500; --sc-progress-rounded: var(--sc-rounded-lg); display: block; line-height: 1.2; font-weight:var(--sc-progress-fw); font-size:var(--sc-progress-fs); color:var(--sc-progress-color); } progress { position: relative; width: 100%; -webkit-appearance: none; appearance: none; overflow: hidden; border:none; height: var(--sc-progress-height); border-radius: var(--sc-progress-rounded); background-color: var(--sc-progress-bg); color: var(--sc-progress-color); } progress::-moz-progress-bar { background-color: var(--sc-progress-color); border-radius: var(--sc-progress-rounded); } progress:not([value])::-moz-progress-bar { background-color: var(--sc-progress-bg); } progress::-webkit-progress-bar { background-color: var(--sc-progress-bg); } progress::-webkit-progress-value { background-color: var(--sc-progress-color); border-radius: var(--sc-progress-rounded); } /* Indeterminate */ progress:indeterminate:after { background-color: var(--sc-progress-color); content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 33.333333%; border-radius: var(--sc-progress-rounded); animation: progress-loading 3s infinite ease-in-out; } @keyframes progress-loading { 50% { left: 107%; } } /* COLOR TYPES */ :host([type="warning"]) { --sc-progress-color: var(--sc-warning); } :host([type="danger"]) { --sc-progress-color: var(--sc-danger); } :host([type="info"]) { --sc-progress-color: var(--sc-info); } :host([type="success"]) { --sc-progress-color: var(--sc-success); } /* SIZES */ :host([size="xs"]) { --sc-progress-height:.25rem; --sc-progress-fs: 0.68rem; } :host([size="sm"]) { --sc-progress-height:.4rem; --sc-progress-fs: 0.85rem; } :host([size="lg"]) { --sc-progress-height:1rem; --sc-progress-fs: 1.25rem; } :host([size="xl"]) { --sc-progress-height:1.5rem; --sc-progress-fs: 1.5rem; } slot[name="remaining"] { font-weight:var(--sc-font-weight-base); color:var(--sc-base-400); font-size:.85em; margin-top:.5em; } .slot-container { display:flex; justify-content: space-between; gap:.5em; }`],Ee([a({type:Number})],Ot.prototype,"value",2),Ee([a({type:Number})],Ot.prototype,"max",2),Ee([a({type:String,reflect:!0})],Ot.prototype,"type",2),Ee([a({type:String,reflect:!0})],Ot.prototype,"size",2),Ot=Ee([y(ei)],Ot);try{customElements.define(ei,Ot)}catch{}const Ns=w`* { box-sizing: border-box; } :host { --sc-input-height: var(--sc-form-height, 2.5em); --sc-input-border-width: var(--sc-form-border-width, 0.1rem); --sc-input-color: var(--sc-base-content, #1f2937); --sc-item-rounded-tr: var(--sc-input-rounded, var(--sc-rounded)); --sc-item-rounded-tl: var(--sc-input-rounded, var(--sc-rounded)); --sc-item-rounded-bl: var(--sc-input-rounded, var(--sc-rounded)); --sc-item-rounded-br: var(--sc-input-rounded, var(--sc-rounded)); --sc-input-ff: inherit; --sc-input-py: 0.6em; --sc-input-px: 1.15em; --sc-input-prefix-color: var(--sc-input-color); --sc-input-prefix-bg: var(--sc-input-bg); --sc-input-prefix-border-color: var(--sc-input-border-color); --sc-input-suffix-color: var(--sc-input-color); --sc-input-suffix-bg: var(--sc-input-bg); --sc-input-suffix-border-color: var(--sc-input-border-color); --sc-label-fs: var(--sc-input-fs); --sc-label-fw: normal; } .form-element { display: block; flex-grow: 1; width: 100%; line-height: 1.1; color: var(--sc-input-color); border-radius: var(--sc-item-rounded-tl) var(--sc-item-rounded-tr) var(--sc-item-rounded-br) var(--sc-item-rounded-bl); font-family: var(--sc-input-ff); background-color: var(--sc-input-bg, var(--sc-base, #fff)); border: var(--sc-input-border-width) solid var(--sc-input-border-color, var(--sc-base-300, #aaa)); width: 100%; font-size: var(--sc-input-fs); padding-top: var(--sc-input-py); padding-bottom: var(--sc-input-py); padding-left: var(--sc-input-px); padding-right: var(--sc-input-px); min-height: var(--sc-input-height); } label { font-size: var(--sc-label-fs); font-weight: var(--sc-label-fw); line-height: 1.2; } .form-control { display: flex; width: 100%; } /*Suffix*/ :host(:not([inlineContent])) .has-suffix slot[name="suffix"], :host(:not([inlineContent])) .has-prefix slot[name="prefix"] { min-width: var(--sc-input-height); box-sizing: border-box; display: flex; align-items: center; justify-content: center; line-height: 1.1; flex-shrink: 0; padding-left: calc(-1 * var(--sc-input-px)); padding-right: calc(-1 * var(--sc-input-px)); } :host(:not([inlineContent])) slot[name="prefix"] { border-radius: var(--sc-item-rounded-tl) 0 0 var(--sc-item-rounded-bl); background-color: var(--sc-input-prefix-bg); color: var(--sc-input-prefix-color); border: var(--sc-input-border-width) solid var(--sc-input-prefix-border-color); margin-right: calc(-1 * var(--sc-input-border-width)); } :host(:not([inlineContent])) slot[name="suffix"] { border-radius: 0 var(--sc-item-rounded-tr) var(--sc-item-rounded-br) 0; background-color: var(--sc-input-suffix-bg); color: var(--sc-input-suffix-color); border: var(--sc-input-border-width) solid var(--sc-input-suffix-border-color); margin-left: calc(-1 * var(--sc-input-border-width)); } :host(:not([inlineContent])) .has-prefix .form-element { border-top-left-radius: 0; border-bottom-left-radius: 0; } :host(:not([inlineContent])) .has-suffix .form-element { border-top-right-radius: 0; border-bottom-right-radius: 0; } /*InlineCONTENT */ :host([inlineContent]) { --sc-input-py: 0; } :host([inlineContent]) .form-element { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2em; } /*Disabled */ :host([disabled]) .form-element-container { cursor: not-allowed; } /*SIZE*/ :host { --sc-input-fs: 1rem; } :host([size="xs"]) { --sc-input-fs: 0.75rem; } :host([size="sm"]) { --sc-input-fs: 0.85rem; } :host([size="lg"]) { --sc-input-fs: 1.2rem; } :host([variant="ghost"]) .form-element { --sc-input-bg: transparent; } /*Disbaled*/ :host([disabled]) .form-element { pointer-events: none; background-color: var(--sc-base-100); border-color: transparent; color: var(--sc-base-400); } /*PLACEHOLDER*/ ::placeholder { color: inherit; opacity: 0.45; } :focus::placeholder { opacity: 0; } /*HOVER*/ :host(:not([disabled])) .form-element:hover, .form-element:focus-visible, .form-element:focus { filter: brightness(0.97); outline: none; } .form-label { margin-bottom: 0.22em; display: block; } .form-description { color: var(--sc-base-400); font-size: 0.85em; margin-top: 0.2em; display: block; } .form-element > slot, .form-element .form-element { all: unset !important; } /*Utilitaires*/ .hidden { display: none; } .contents { display: contents; } /*ERROR*/ :host([error]) { --sc-input-border-color: var(--sc-danger); } :host input:visited{ display:none; } :host([touched]) :not(:focus):invalid { --sc-input-border-color: var(--sc-danger); --sc-input-color: var(--sc-danger); } :host([touched]) :not(:focus):invalid + .select-chevron{ --sc-input-color: var(--sc-danger); } /*VALID*/ :host([touched]) :not([value=""]):not(:focus):valid { --sc-input-border-color: var(--sc-success); --sc-input-color: var(--sc-success); } :host([touched]) :not(:focus):valid + .select-chevron{ --sc-input-color: var(--sc-success); }`;var Vn=Object.defineProperty,qn=Object.getOwnPropertyDescriptor,Fs=(i,t,r,e)=>{for(var s=e>1?void 0:e?qn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Vn(t,r,s),s};const Xe=i=>{class t extends i{constructor(...e){super(),this.type="text",this.tabindex=null,this.autocomplete=null}validateFormElement(){var s;const e=(s=this.shadowRoot)==null?void 0:s.querySelector("input");!e||e.checkValidity()||(this.getFormPublisher().isFormValid=!1,e.reportValidity())}}return Fs([a({type:String})],t.prototype,"type",2),Fs([a({type:String})],t.prototype,"tabindex",2),Fs([a({type:String})],t.prototype,"autocomplete",2),t};/**
|
|
111
111
|
* @license
|
|
112
112
|
* Copyright 2018 Google LLC
|
|
113
113
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
114
|
-
*/const si=ie(class extends oe{constructor(i){var t;if(super(i),i.type!==Rt.ATTRIBUTE||i.name!=="class"||((t=i.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var r,e;if(this.et===void 0){this.et=new Set,i.strings!==void 0&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in t)t[o]&&!(!((r=this.st)===null||r===void 0)&&r.has(o))&&this.et.add(o);return this.render(t)}const s=i.element.classList;this.et.forEach(o=>{o in t||(s.remove(o),this.et.delete(o))});for(const o in t){const n=!!t[o];n===this.et.has(o)||((e=this.st)===null||e===void 0?void 0:e.has(o))||(n?(s.add(o),this.et.add(o)):(s.remove(o),this.et.delete(o)))}return ct}});var Hn=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,z=(i,t,r,e)=>{for(var s=e>1?void 0:e?Wn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Hn(t,r,s),s};const ri="sonic-input";let j=class extends Xe(ne(I(v))){constructor(){super(...arguments),this.size="",this.list=null,this.placeholder="",this.readonly=!1,this.pattern=null,this.min=null,this.max=null,this.step=null,this.minlength=null,this.maxlength=null,this.label="",this.description="",this.inlineContent=!1,this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1}updated(){var i,t,r,e;this.hasLabel=!!(this.label||((i=this.slotLabelNodes)==null?void 0:i.length)),this.hasDescription=!!(this.description||((t=this.slotDescriptionNodes)==null?void 0:t.length)),this.hasSuffix=!!((r=this.slotSuffixNodes)!=null&&r.length),this.hasPrefix=!!((e=this.slotPrefixNodes)!=null&&e.length)}onSlotChange(){this.requestUpdate()}render(){const i={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix};return u`<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}">${this.label?this.label:""}<slot name="label" @slotchange="${this.onSlotChange}"></slot></label><div class="form-control ${si(i)}"><div class="${this.inlineContent?"form-element form-element-wrapper":"contents"}"><slot name="prefix" @slotchange="${this.onSlotChange}"></slot><input id="form-element" part="input" class="form-element input" type="${this.type}" @input="${this.handleChange}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" list="${k(this.list)}" autofocus="${k(this.autofocus)}" required="${k(this.required)}" tabindex="${k(this.tabindex)}" pattern="${k(this.pattern)}" min="${k(this.min)}" max="${k(this.max)}" step="${k(this.step)}" minlength="${k(this.minlength)}" maxlength="${k(this.maxlength)}" placeholder="${this.placeholder}" .name="${this.name}" .value="${this.value}" autocomplete="${k(this.autocomplete)}"><slot name="suffix" @slotchange="${this.onSlotChange}"></slot></div></div><slot name="description" class="${this.hasDescription?"form-description":"hidden"}">${this.description?u`${this.description}`:""}</slot>`}};j.styles=[Ns],z([a({type:String})],j.prototype,"size",2),z([a({type:String})],j.prototype,"list",2),z([a({type:String})],j.prototype,"placeholder",2),z([a({type:Boolean})],j.prototype,"readonly",2),z([a({type:String})],j.prototype,"pattern",2),z([a({type:String})],j.prototype,"min",2),z([a({type:String})],j.prototype,"max",2),z([a({type:String})],j.prototype,"step",2),z([a({type:String})],j.prototype,"minlength",2),z([a({type:String})],j.prototype,"maxlength",2),z([a({type:String})],j.prototype,"label",2),z([a({type:String})],j.prototype,"description",2),z([a({type:Boolean,reflect:!0})],j.prototype,"inlineContent",2),z([rt({slot:"label"})],j.prototype,"slotLabelNodes",2),z([rt({slot:"description"})],j.prototype,"slotDescriptionNodes",2),z([rt({slot:"suffix"})],j.prototype,"slotSuffixNodes",2),z([rt({slot:"prefix"})],j.prototype,"slotPrefixNodes",2),z([Z()],j.prototype,"hasDescription",2),z([Z()],j.prototype,"hasLabel",2),z([Z()],j.prototype,"hasSuffix",2),z([Z()],j.prototype,"hasPrefix",2),j=z([y(ri)],j);try{customElements.define(ri,j)}catch{}var Kn=Object.defineProperty,Yn=Object.getOwnPropertyDescriptor,Wt=(i,t,r,e)=>{for(var s=e>1?void 0:e?Yn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Kn(t,r,s),s};const ii="sonic-checkbox";let lt=class extends Es(Xe(ne(I(v)))){constructor(){super(...arguments),this.touched=!1,this.iconName="check",this.description="",this.label="",this.hasDescription=!1}updated(){var i;this.hasDescription=!!(this.description||((i=this.slotDescriptionNodes)==null?void 0:i.length))}connectedCallback(){this.type="checkbox",super.connectedCallback()}render(){return u`<label class="checkbox-container ${this.disabled?"disabled":""}"><span class="icon-container"><input type="${this.type}" @change="${this.handleChange}" .disabled="${k(this.disabled)}" .required="${k(this.required)}" .checked="${k(this.checked)}" .name="${this.name}" .value="${this.value}" autofocus="${k(this.autofocus)}"><sonic-icon name="${this.iconName}" class="sc-input-icon"></sonic-icon></span><div class="checkbox-text">${this.label?this.label:""}<slot></slot><slot name="description" class="${this.hasDescription?"description":"hidden"}">${this.description?u`${this.description}`:""}<slot></slot></slot></div></label>`}};lt.styles=[w`:host{ --sc-checkbox-border-width: var(--sc-form-border-width); --sc-checkbox-border-color: transparent; } * { box-sizing: border-box; } .checkbox-container { min-height: 1.4em; display: flex; gap: 0.5em; line-height: 1.2; align-items: flex-start; } .icon-container { position: relative; display: flex; flex-shrink: 0; } input { appearance: none; flex-shrink: 0; height: 1.5em; width: 1.5em; display: block; cursor: pointer; border-radius: 0.25em; transition: 0.2s; outline: none; margin: 0; background-color: var(--sc-base-200); border:var(--sc-checkbox-border-width) solid var(--sc-checkbox-border-color); } input:focus, :host(:not([disabled])) input:active { box-shadow: 0 0 0 2px var(--sc-primary); } :host(:not([disabled])) label { cursor: pointer; } sonic-icon { line-height: 0; position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%) scale(0); transition: transform 0.2s ease-in-out; color: var(--sc-primary-content); } /* .checkbox-text { align-self: center; } */ .description { color: var(--sc-base-400); font-size: 0.85em; margin-top: 0.2em; display: block; } /*Active */ input:checked, input[checked="true"] { background: var(--sc-primary); } input:checked + sonic-icon, input[checked="true"] + sonic-icon { transform: translateX(-50%) translateY(-50%) scale(1); } /*DISABLED */ .disabled { cursor: not-allowed; } .disabled input { opacity: 0.4; } .disabled .checkbox-text { opacity: 0.6; } ::slotted(a) { color: inherit; text-decoration: underline !important; } ::slotted(a:hover) { text-decoration: none !important; } /*Utils */ .hidden { display: none; } /*ERROR*/ :host([touched]) .checkbox-container:has(input:not(:focus):invalid) { --sc-checkbox-border-color:var(--sc-danger); } :host([touched]) .checkbox-container:has(input:not(:focus):invalid) .checkbox-text{ color:var(--sc-danger); }`],Wt([a({type:Boolean,reflect:!0})],lt.prototype,"touched",2),Wt([a({type:String})],lt.prototype,"iconName",2),Wt([a({type:String})],lt.prototype,"description",2),Wt([a({type:String})],lt.prototype,"label",2),Wt([rt({slot:"description"})],lt.prototype,"slotDescriptionNodes",2),Wt([a({type:Boolean})],lt.prototype,"hasDescription",2),lt=Wt([y(ii)],lt);try{customElements.define(ii,lt)}catch{}var Zn=Object.defineProperty,Gn=Object.getOwnPropertyDescriptor,Xn=(i,t,r,e)=>{for(var s=e>1?void 0:e?Gn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Zn(t,r,s),s};const oi="sonic-radio";let Je=class extends lt{constructor(){super()}connectedCallback(){this.radio=!0,super.connectedCallback(),this.type="radio"}};Je.styles=[lt.styles,w`:host input { border-radius: 50%; } :host sonic-icon { border-radius: 50%; overflow: hidden; background-color:var(--sc-primary-content); line-height:0; display:block; font-size:0; height:10px; width:10px; }`],Je=Xn([y(oi)],Je);try{customElements.define(oi,Je)}catch{}var Jn=Object.defineProperty,Qn=Object.getOwnPropertyDescriptor,Y=(i,t,r,e)=>{for(var s=e>1?void 0:e?Qn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Jn(t,r,s),s};const ni="sonic-select";let M=class extends ne(I(v)){constructor(){super(...arguments),this.valueKey="value",this.wordingKey="wording",this.multiple=null,this.size="",this.selectSize=null,this._options=[],this._value="",this.label="",this.description="",this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1}set options(i){this._options=i,!this.value&&this._options.length>0&&(this.value=this._options[0][this.valueKey]),this.requestUpdate()}get options(){return this._options}get value(){return this._value}set value(i){!i||this._value!=i&&(this._value=i,this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?K.getInstance().get(this.formDataProvider)[this._name]=i:this.publisher&&(this.publisher[this._name]=i),this.requestUpdate())}connectedCallback(){super.connectedCallback();let i=this.querySelectorAll("option");i.length>0&&(this.options=Array.from(i).map(t=>({value:t.value,wording:t.text})))}updated(){var i,t,r,e;this.hasLabel=!!(this.label||((i=this.slotLabelNodes)==null?void 0:i.length)),this.hasDescription=!!(this.description||((t=this.slotDescriptionNodes)==null?void 0:t.length)),this.hasSuffix=!!((r=this.slotSuffixNodes)!=null&&r.length),this.hasPrefix=!!((e=this.slotPrefixNodes)!=null&&e.length)}onSlotChange(){this.requestUpdate()}validateFormElement(){var t;const i=(t=this.shadowRoot)==null?void 0:t.querySelector("select");!i||i.checkValidity()||(this.getFormPublisher().isFormValid=!1,i.reportValidity())}render(){const i={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix};return u`<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}">${this.label?this.label:""}<slot name="label" @slotchange="${this.onSlotChange}"></slot></label><div class="form-control ${si(i)}"><slot name="prefix" @slotchange="${this.onSlotChange}"></slot><div class="form-select-wrapper"><select @change="${this.handleChange}" disabled="${k(this.multiple)}" size="${k(this.selectSize)}" autofocus="${k(this.autofocus)}" required="${k(this.required)}" .value="${this.value}" class="form-element">${Ft(this.options,t=>t[this.valueKey],t=>{const r=this.value==t[this.valueKey]?"selected":null;return u`<option selected="${k(r)}" value="${t[this.valueKey]}">${t[this.wordingKey]}</option>`})}<slot></slot></select><sonic-icon class="select-chevron" name="nav-arrow-down" size="${this.size}"></sonic-icon></div><slot name="suffix" @slotchange="${this.onSlotChange}"></slot></div><slot name="description" class="${this.hasDescription?"form-description":"hidden"}">${this.description?u`${this.description}`:""}</slot>`}};M.styles=[Ns,w`.form-element { appearance: none; padding-right: 2.5em; } .form-select-wrapper { position: relative; width: 100%; } sonic-icon { position: absolute; right: 1em; top: 50%; pointer-events: none; transform: translateY(-50%); color:var(--sc-input-color); } option { padding: 0.1rem 5rem; color: var(--sc-base-content); background: var(--sc-base); }`],Y([a({type:String})],M.prototype,"valueKey",2),Y([a({type:String})],M.prototype,"wordingKey",2),Y([a({type:Boolean})],M.prototype,"multiple",2),Y([a({type:String})],M.prototype,"size",2),Y([a({type:String})],M.prototype,"selectSize",2),Y([a({type:Array})],M.prototype,"options",1),Y([a()],M.prototype,"value",1),Y([a({type:String})],M.prototype,"label",2),Y([a({type:String})],M.prototype,"description",2),Y([rt({slot:"label"})],M.prototype,"slotLabelNodes",2),Y([rt({slot:"description"})],M.prototype,"slotDescriptionNodes",2),Y([rt({slot:"suffix"})],M.prototype,"slotSuffixNodes",2),Y([rt({slot:"prefix"})],M.prototype,"slotPrefixNodes",2),Y([Z()],M.prototype,"hasDescription",2),Y([Z()],M.prototype,"hasLabel",2),Y([Z()],M.prototype,"hasSuffix",2),Y([Z()],M.prototype,"hasPrefix",2),M=Y([y(ni)],M);try{customElements.define(ni,M)}catch{}var ta=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,B=(i,t,r,e)=>{for(var s=e>1?void 0:e?ea(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ta(t,r,s),s};const ai="sonic-textarea";let L=class extends Xe(ne(I(v))){constructor(){super(...arguments),this.size="",this.rows="",this.cols="",this.maxlength="",this.minlength="",this.wrap=null,this.readonly=null,this.placeholder="",this.label="",this.description="",this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1,this.slotClasses={}}updated(){var i,t,r,e;this.hasLabel=!!(this.label||((i=this.slotLabelNodes)==null?void 0:i.length)),this.hasDescription=!!(this.description||((t=this.slotDescriptionNodes)==null?void 0:t.length)),this.hasSuffix=!!((r=this.slotSuffixNodes)!=null&&r.length),this.hasPrefix=!!((e=this.slotPrefixNodes)!=null&&e.length)}onSlotChange(){this.requestUpdate()}validateFormElement(){var t;const i=(t=this.shadowRoot)==null?void 0:t.querySelector("textarea");!i||i.checkValidity()||(this.getFormPublisher().isFormValid=!1,i.reportValidity())}render(){return u`<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}">${this.label?this.label:""}<slot name="label" @slotchange="${this.onSlotChange}"></slot></label><div class="form-control"><textarea @input="${this.handleChange}" ?disabled="${this.disabled}" ?required="${this.required}" autocomplete="${k(this.autocomplete)}" autofocus="${k(this.autofocus)}" rows="${k(this.rows)}" cols="${k(this.cols)}" maxlength="${k(this.maxlength)}" minlength="${k(this.minlength)}" ?readonly="${this.readonly}" spellcheck="${k(this.spellcheck)}" wrap="${k(this.wrap)}" class="form-element textarea custom-scroll" placeholder="${this.placeholder}">
|
|
115
|
-
${this.value}</textarea></div><slot name="description" class="${this.hasDescription?"form-description":"hidden"}">${this.description?u`${this.description}`:""}</slot>`}};L.styles=[Ns,qe,w`textarea { font-size: inherit; }`],B([a({type:String})],L.prototype,"size",2),B([a({type:String})],L.prototype,"rows",2),B([a({type:String})],L.prototype,"cols",2),B([a({type:String})],L.prototype,"maxlength",2),B([a({type:String})],L.prototype,"minlength",2),B([a({type:String})],L.prototype,"wrap",2),B([a({type:Boolean})],L.prototype,"readonly",2),B([a({type:String})],L.prototype,"placeholder",2),B([a({type:String})],L.prototype,"label",2),B([a({type:String})],L.prototype,"description",2),B([rt({slot:"label"})],L.prototype,"slotLabelNodes",2),B([rt({slot:"description"})],L.prototype,"slotDescriptionNodes",2),B([rt({slot:"suffix"})],L.prototype,"slotSuffixNodes",2),B([rt({slot:"prefix"})],L.prototype,"slotPrefixNodes",2),B([Z()],L.prototype,"hasDescription",2),B([Z()],L.prototype,"hasLabel",2),B([Z()],L.prototype,"hasSuffix",2),B([Z()],L.prototype,"hasPrefix",2),B([a()],L.prototype,"slotClasses",2),L=B([y(ai)],L);try{customElements.define(ai,L)}catch{}var sa=Object.defineProperty,ra=Object.getOwnPropertyDescriptor,Is=(i,t,r,e)=>{for(var s=e>1?void 0:e?ra(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&sa(t,r,s),s};const li="sonic-fieldset";let le=class extends I(v){constructor(){super(...arguments),this.disabled=!1}render(){return u`<fieldset form="${k(this.form)}" ?disabled="${this.disabled}"><slot></slot></fieldset>`}};le.styles=[w`:host { --sc-fieldset-mt: 0; --sc-fieldset-mb: 1rem; --sc-fieldset-border-color: var(--sc-base-200); --sc-fieldset-border-width: var(--sc-form-border-width); margin-top: var(--sc-fieldset-mt); margin-bottom: var(--sc-fieldset-mb); display: block; border: var(--sc-fieldset-border-width) solid var(--sc-fieldset-border-color) !important; padding: 1.8rem 1.25rem; border-radius: var(--sc-rounded-lg); } fieldset { all: unset; display: contents; } ::slotted(sonic-legend) { margin-bottom: 1.5rem; display: block; }`],Is([a({type:Boolean,reflect:!0})],le.prototype,"disabled",2),Is([a({type:String})],le.prototype,"form",2),le=Is([y(li)],le);try{customElements.define(li,le)}catch{}var ia=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,na=(i,t,r,e)=>{for(var s=e>1?void 0:e?oa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ia(t,r,s),s};let Qe=class extends v{render(){return u`<slot></slot>`}};Qe.styles=[w`:host { color: var(--sc-neutral-500); font-size: 1.25rem; line-height: 1.2; display: block; font-weight: var(--sc-font-weight-base); font-style: var(--sc-font-style-base); margin-top: 0.25em; }`],Qe=na([y("sonic-legend-description")],Qe);try{customElements.define("sonic-legend-description",Qe)}catch{}var aa=Object.defineProperty,la=Object.getOwnPropertyDescriptor,ce=(i,t,r,e)=>{for(var s=e>1?void 0:e?la(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&aa(t,r,s),s};const ci="sonic-legend";let yt=class extends v{render(){return u`<legend part="legend">${this.iconName?u`<div class="icon"><sonic-icon name="${this.iconName}" prefix="${k(this.iconPrefix)}" library="${k(this.iconLibrary)}"></sonic-icon></div>`:""}<div class="legend-content">${this.label} ${this.description?u`<sonic-legend-description>${this.description}</sonic-legend-description>`:""}<slot></slot></div><slot name="suffix"></slot></legend>`}};yt.styles=[w`:host { --sc-legend-font-size: 1.75rem; --sc-legend-font-weight: var(--sc-font-weight-base); --sc-legend-font-style: var(--sc-headings-font-style); --sc-legend-family: var(--sc-headings-font-family); --sc-legend-line-height: var(--sc-headings-line-height); display: flex; width: 100%; } legend { font-size: var(--sc-legend-font-size); font-weight: var(--sc-legend-font-weight); font-style: var(--sc-legend-font-style); font-family: var(--sc-legend-font-family); line-height: var(--sc-legend-line-height); padding: 0; display: flex; width: 100%; align-items: flex-start; gap: 0.5em; } slot[name="suffix"] { display: block; margin-left: auto; flex-shrink: 0; } .legend-content { flex-grow: 1; }`],ce([a({type:String})],yt.prototype,"description",2),ce([a({type:String})],yt.prototype,"label",2),ce([a({type:String})],yt.prototype,"iconName",2),ce([a({type:String})],yt.prototype,"iconLibrary",2),ce([a({type:String})],yt.prototype,"iconPrefix",2),yt=ce([y(ci)],yt);try{customElements.define(ci,yt)}catch{}class ca{constructor(t,{target:r,config:e,callback:s,skipInitial:o}){this.t=!1,this.i=!1,this.callback=()=>!0,(this.h=t).addController(this),this.o=r===null||r!=null?r:this.h,this.l=e,this.t=o!=null?o:this.t,this.callback=s!=null?s:this.callback,window.ResizeObserver?this.u=new ResizeObserver(n=>{this.handleChanges(n),this.h.requestUpdate()}):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){this.value=this.callback(t,this.u)}hostConnected(){this.o&&this.observe(this.o)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.t&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}disconnect(){this.u.disconnect()}}var ha=Object.defineProperty,da=Object.getOwnPropertyDescriptor,pa=(i,t,r,e)=>{for(var s=e>1?void 0:e?da(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ha(t,r,s),s};const hi="sonic-form-layout";let ts=class extends I(v){constructor(){super(...arguments),this._resizeController=new ca(this,{})}render(){return u`<div class="${this.offsetWidth>440?"cq--md":""}"><slot></slot></div>`}};ts.styles=[w`:host { display: block; } div { display: grid; grid-gap: 1.5rem; align-items: flex-start; } .cq--md { grid-gap: 1.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); } ::slotted(sonic-radio), ::slotted(sonic-checkbox), ::slotted(sonic-form-actions), ::slotted(sonic-divider), ::slotted(sonic-textarea) { grid-column: 1 / -1; } ::slotted(sonic-divider) { --sc-divider-my: 0; }`],ts=pa([y(hi)],ts);try{customElements.define(hi,ts)}catch{}var ua=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,fa=(i,t,r,e)=>{for(var s=e>1?void 0:e?ga(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ua(t,r,s),s};const di="sonic-form-actions";let es=class extends v{render(){return u`<slot></slot>`}};es.styles=[w`:host{ display:flex; gap:.3rem; }`],es=fa([y(di)],es);try{customElements.define(di,es)}catch{}var ma=Object.defineProperty,va=Object.getOwnPropertyDescriptor,ba=(i,t,r,e)=>{for(var s=e>1?void 0:e?va(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ma(t,r,s),s};const pi="sonic-group";let ss=class extends v{updated(){const i=this.querySelectorAll("sonic-input, sonic-button"),t=i.length;t>1&&i.forEach((r,e)=>{e===0?(r.style.setProperty("--sc-item-rounded-tr","0"),r.style.setProperty("--sc-item-rounded-br","0")):e===t-1?(r.style.setProperty("--sc-item-rounded-tl","0"),r.style.setProperty("--sc-item-rounded-bl","0")):(r.style.setProperty("--sc-item-rounded-tr","0"),r.style.setProperty("--sc-item-rounded-br","0"),r.style.setProperty("--sc-item-rounded-tl","0"),r.style.setProperty("--sc-item-rounded-bl","0"))})}render(){return u`<slot></slot>`}};ss.styles=[w`:host { display: inline-flex; vertical-align: middle; } slot { width: 100%; display: flex; align-items: flex-end; }`],ss=ba([y(pi)],ss);try{customElements.define(pi,ss)}catch{}var ya=Object.defineProperty,wa=Object.getOwnPropertyDescriptor,ft=(i,t,r,e)=>{for(var s=e>1?void 0:e?wa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ya(t,r,s),s};const ui="sonic-image";let at=class extends v{constructor(){super(...arguments),this.rounded="none",this.src="",this.alt="",this.loading="lazy",this.ratio="auto",this.objectPosition="center center",this.imageRendering="auto",this.shadow="none",this.cover=!1}render(){const i={aspectRatio:this.cover?"auto":this.ratio,imageRendering:this.imageRendering,objectPosition:this.objectPosition};return u`<div part="image"><picture part="picture"><img part="img" src="${this.src}" loading="${this.loading}" alt="${this.alt}" style="${ht(i)}"></picture></div>`}};at.styles=[w`:host { --sc-img-radius: 0; --sc-img-bg: var(--sc-placeholder-bg); border-radius: var(--sc-img-radius); display: block; width: 100%; background: var(--sc-img-bg); } img { width: 100%; vertical-align: middle; object-fit: cover; } img[src=""] { visibility: hidden; } /*Rounded*/ :host([rounded]) { --sc-img-radius: var(--sc-rounded); overflow: hidden; } :host([rounded="sm"]) { --sc-img-radius: var(--sc-rounded-sm); } :host([rounded="md"]) { --sc-img-radius: var(--sc-rounded-md); } :host([rounded="lg"]) { --sc-img-radius: var(--sc-rounded-lg); } :host([rounded="xl"]) { --sc-img-radius: var(--sc-rounded-xl); } /*Cercle*/ :host([rounded="full"]) { --sc-img-radius: 50% !important; } :host([rounded="none"]) { --sc-img-radius: 0 !important; } /*OMBRE*/ :host([shadow]) > div, :host([shadow="md"]) > div, :host([shadow="true"]) > div { box-shadow: var(--sc-shadow); } :host([shadow="sm"]) > div { box-shadow: var(--sc-shadow-sm); } :host([shadow="none"]) > div { box-shadow: none; } :host([shadow="lg"]) > div { box-shadow: var(--sc-shadow-lg); } :host([cover]), :host([cover]) > div, :host([cover]) img { position: absolute !important; left: 0 !important; top: 0 !important; right: 0 !important; bottom: 0 !important; height: 100% !important; width: 100% !important; }`],ft([a({type:String})],at.prototype,"rounded",2),ft([a({type:String})],at.prototype,"src",2),ft([a({type:String})],at.prototype,"alt",2),ft([a({type:String})],at.prototype,"loading",2),ft([a({type:String})],at.prototype,"ratio",2),ft([a({type:String})],at.prototype,"objectPosition",2),ft([a({type:String})],at.prototype,"imageRendering",2),ft([a({type:String,reflect:!0})],at.prototype,"shadow",2),ft([a({type:Boolean,reflect:!0})],at.prototype,"cover",2),at=ft([y(ui)],at);try{customElements.define(ui,at)}catch{}var $a=Object.defineProperty,xa=Object.getOwnPropertyDescriptor,Et=(i,t,r,e)=>{for(var s=e>1?void 0:e?xa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&$a(t,r,s),s};const _a="sonic-taxonomy";let pt=class extends v{constructor(){super(...arguments),this.icon={},this.taxonomy=[],this.separator=", ",this.key="",this.type="default",this.variant="default",this.size="md"}render(){if(!this.taxonomy)return P;let i=this.key+"_display",t=this.taxonomy.filter(r=>r!=null&&(r[i]===!0||r[i]=="1"||!r.hasOwnProperty(i)));return t.length===0?(this.style.display="none",P):(this.style.removeProperty("display"),u`<sonic-badge type="${this.type}" variant="${this.variant}" size="${this.size}"><sonic-icon slot="prefix" name="${this.icon.name}" prefix="${this.icon.prefix}"></sonic-icon><span class="taxonomy-list">${Ft(t,r=>r[this.key+"_id"],r=>u`<span>${r[this.key+"_name"]}</span><span class="sonic-taxonomy-separator">${It(this.separator)}</span>`)}</span></sonic-badge>`)}};pt.styles=w`:host .sonic-taxonomy-separator:last-child { display: none; } .taxonomy-list { display: flex; flex-wrap: wrap; }`,Et([a({type:Object})],pt.prototype,"icon",2),Et([a({type:Array})],pt.prototype,"taxonomy",2),Et([a({type:String})],pt.prototype,"separator",2),Et([a({type:String})],pt.prototype,"key",2),Et([a({type:String,reflect:!0})],pt.prototype,"type",2),Et([a({type:String,reflect:!0})],pt.prototype,"variant",2),Et([a({type:String,reflect:!0})],pt.prototype,"size",2),pt=Et([y(_a)],pt);try{customElements.define("sonic-taxonomy",pt)}catch{}var ka=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,Sa=(i,t,r,e)=>{for(var s=e>1?void 0:e?Aa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ka(t,r,s),s};const gi="sonic-menu-item";let Us=class extends E{constructor(){super()}connectedCallback(){this.hasAttribute("variant")||(this.variant="ghost"),this.hasAttribute("type")||(this.type="primary"),this.hasAttribute("shape")||(this.shape="block"),this.hasAttribute("align")||(this.align="left"),super.connectedCallback()}};Us=Sa([y(gi)],Us);try{customElements.define(gi,Us)}catch{}var Pa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,ut=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ca(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Pa(t,r,s),s};const fi="sonic-menu";let it=class extends v{constructor(){super(...arguments),this.size="",this.direction="column",this.gap="var(--sc-menu-gap)",this.align="left",this.shadow=null,this.moreShape="circle",this.minWidth="0",this.hasMoreElements=!1}checkIfMore(){var i;this.hasMoreElements=!!((i=this.moreElements)!=null&&i.length)}updated(i){const t=this.querySelector(".more-btn");this.size&&t&&t.setAttribute("size",this.size),this.querySelectorAll("sonic-divider").forEach(r=>{r.hasAttribute("size")||r.setAttribute("size","xs")}),super.updated(i)}mainSlotChange(){this.setChildrenSize(this.menuChildren)}setChildrenSize(i){i.forEach(t=>{this.size&&t.setAttribute("size",this.size),this.align&&t.setAttribute("align",this.align),this.direction=="row"&&t.getAttribute("shape")=="block"&&t.setAttribute("shape","default")})}render(){const i={minWidth:this.minWidth,flexDirection:this.direction,gap:this.gap},t=this.direction=="row",r={display:"block",alignSelf:t?"center":"flex-start",justifySelf:"center",flexDirection:this.direction},e={marginLeft:t?"":".55em"};return u`<menu part="menu" class="shadowable" style="${ht(i)}"><slot @slotchange="${this.mainSlotChange}"></slot><sonic-pop style="${ht(r)}" class="${this.hasMoreElements?"":"hidden"}"><sonic-menu-item style="${ht(e)}" class="more-btn" shape="${this.moreShape}" align="center"><sonic-icon size="xl" name="${t?"more-vert":"more-horiz"}"></sonic-icon></sonic-menu-item><slot name="more" @slotchange="${this.checkIfMore}" slot="content"></slot></sonic-pop></menu>`}};it.styles=[w`:host { display: block; --sc-menu-gap:.15rem; } :host > menu { display: flex; border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); margin: 0; padding: 0.35em; } .hidden { display:none !important; } /*OMBRE*/ :host([shadow]) .shadowable, :host([shadow="md"]) .shadowable, :host([shadow="true"]) .shadowable { box-shadow: var(--sc-shadow); } :host([shadow="sm"]) .shadowable { box-shadow: var(--sc-shadow-sm); } :host([shadow="lg"]) .shadowable { box-shadow: var(--sc-shadow-lg); } :host([shadow="none"]) .shadowable { box-shadow: none; }`],ut([a({type:String,reflect:!0})],it.prototype,"size",2),ut([a({type:String,reflect:!0})],it.prototype,"direction",2),ut([a({type:String})],it.prototype,"gap",2),ut([a({type:String,reflect:!0})],it.prototype,"align",2),ut([a({type:String,reflect:!0})],it.prototype,"shadow",2),ut([a({type:String})],it.prototype,"moreShape",2),ut([a({type:String})],it.prototype,"minWidth",2),ut([Tt({selector:"sonic-menu-item"})],it.prototype,"menuChildren",2),ut([Tt({slot:"more",selector:"*"})],it.prototype,"moreElements",2),ut([Z()],it.prototype,"hasMoreElements",2),it=ut([y(fi)],it);try{customElements.define(fi,it)}catch{}var Oa=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,mi=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ea(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Oa(t,r,s),s};const vi="sonic-modal-actions";let je=class extends v{firstUpdated(){var i;(i=this.buttons)==null||i.forEach(t=>{t.addEventListener("click",()=>{var r;t.getAttribute("hideModal")!="false"&&((r=this.closest("sonic-modal"))==null||r.hide())})})}render(){return u`<slot></slot>`}};je.styles=[w`:host { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 1rem; }`],mi([Tt({selector:"sonic-button"})],je.prototype,"buttons",2),je=mi([y(vi)],je);try{customElements.define(vi,je)}catch{}var ja=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,La=(i,t,r,e)=>{for(var s=e>1?void 0:e?Da(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ja(t,r,s),s};const bi="sonic-modal-title";let rs=class extends v{render(){return u`<slot></slot>`}};rs.styles=[w`:host { font-weight: bold; font-size: 1.5rem; display: block; line-height: var(--sc-headings-line-height); font-family: var(--sc-headings-font-family); }`],rs=La([y(bi)],rs);try{customElements.define(bi,rs)}catch{}var za=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ma=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ta(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&za(t,r,s),s};const yi="sonic-modal-subtitle";let is=class extends v{render(){return u`<slot></slot>`}};is.styles=[w`:host { font-size: 1.1rem; display: block; text-transform: uppercase; line-height: var(--sc-headings-line-height); font-family: var(--sc-headings-font-family); }`],is=Ma([y(yi)],is);try{customElements.define(yi,is)}catch{}var Ra=Object.defineProperty,Na=Object.getOwnPropertyDescriptor,Fa=(i,t,r,e)=>{for(var s=e>1?void 0:e?Na(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ra(t,r,s),s};const wi="sonic-modal-content";let os=class extends v{render(){return u`<slot></slot>`}};os.styles=[w`:host { display: block; }`],os=Fa([y(wi)],os);try{customElements.define(wi,os)}catch{}var Ia=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,Ba=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ua(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ia(t,r,s),s};const $i="sonic-modal-close";let ns=class extends v{render(){return u`<sonic-button shape="circle" variant="ghost" @click="${this.handleClick}"><sonic-icon name="cancel" size="lg"></sonic-icon></sonic-button>`}handleClick(){this.closest("sonic-modal").hide()}};ns.styles=[w`:host { position: absolute; right: 0.6rem; top: 0.6rem; z-index: 20; }`],ns=Ba([y($i)],ns);try{customElements.define($i,ns)}catch{}var Va=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,ot=(i,t,r,e)=>{for(var s=e>1?void 0:e?qa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Va(t,r,s),s};const as="sonic-modal";let H=class extends I(v){constructor(){super(...arguments),this.hideOnOverlayClick=!0,this.hideOnEscape=!0,this.align="center",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.fullScreen=!1,this.visible=!1}static create(i){const t=document.createElement(as);return t.innerHTML=`<sonic-modal-close></sonic-modal-close><sonic-modal-content>${i.content}</sonic-modal-content>`||"",(document.querySelector("sonic-theme")||document.body).appendChild(t),t.show(),t}connectedCallback(){super.connectedCallback()}updated(){const i=this;document.addEventListener("keydown",this.handleEscape),i.closeBtn.forEach(t=>{t.addEventListener("click",function(){i.hide()},{once:!0})})}render(){if(this.visible==!1)return P;this.handleFullsceen();const i={padding:this.padding,maxWidth:this.maxWidth,maxHeight:this.maxHeight,width:this.width,height:this.height,borderRadius:this.fullScreen?"0":"var(--sc-modal-rounded)"},t={maxWidth:this.maxWidth,maxHeight:this.maxHeight,width:this.width,height:this.height,borderRadius:this.fullScreen?"0":"var(--sc-modal-rounded)"};return u`<div class="modal-wrapper" style="${ht(t)}" ${Ue({out:xo})} tabindex="0"><div part="modal" class="modal custom-scroll" style="${ht(i)}" ${Ue({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}]})}><div class="modal-content"><slot></slot></div></div></div><div class="overlay" @click="${this.hideOnOverlayClick?this.hide:""}" ${Ue({keyframeOptions:{duration:500},in:_o,out:[{opacity:0,pointerEvents:"none"}]})}></div>`}show(){var i,t;this.visible=!0,(i=this.modalElement)==null||i.setAttribute("tabindex","0"),(t=this.modalElement)==null||t.focus(),this.dispatchEvent(new CustomEvent("show"))}hide(){var i;this.visible=!1,(i=this.modalElement)==null||i.setAttribute("tabindex","-1"),this.dispatchEvent(new CustomEvent("hide"))}dispose(){this.hide(),this.remove()}handleEscape(i){i.key==="Escape"&&[...document.querySelectorAll(as)].forEach(t=>{this.hideOnEscape==!0&&t.hide()})}handleFullsceen(){this.fullScreen&&(this.width="100%",this.height="100%",this.maxWidth="none",this.maxHeight="none")}};if(H.styles=[qe,w`:host { --sc-modal-py: 2.5rem; --sc-modal-px: 1.5rem; --sc-modal-content: var(--sc-base-content); --sc-modal-bg: var(--sc-base); --sc-modal-max-w: min(100vw, 64ch); --sc-modal-max-h: 80vh; --sc-modal-scrollbar-bg: var(--sc-base-300); --sc-modal-rounded: var(--sc-rounded-lg); } * { box-sizing: border-box; } .modal-wrapper { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 990; text-align: center; align-items: center; justify-content: center; flex-direction: column; display: flex; pointer-events: none; } .modal-content { overflow-y: auto; display: flex; flex-direction: column; text-align: center; align-items: center; min-height: 10rem; } .modal { background: var(--sc-base); width: 100%; box-shadow: var(--sc-shadow-lg); border-radius: var(--sc-modal-rounded) var(--sc-modal-rounded) 0 0; pointer-events: auto; /*overflow: hidden;*/ transform: translateZ(0); } .overlay { background: var(--sc-base-200); left: 0; top: 0; right: 0; bottom: 0; z-index: 900; opacity: 0.8; position: fixed; } ::slotted(sonic-modal-title) { margin-bottom: 1rem; } ::slotted(sonic-modal-subtitle) { margin-top: -0.45rem; margin-bottom: 1rem; } @media (max-width: 767.5px) { .modal-wrapper, .modal { max-width: none !important; width: 100% !important; } } @media (min-width: 768px) { .modal-wrapper { top: 50%; left: 50%; bottom: auto; right: auto; transform: translateX(-50%) translateY(-50%); } .modal { top: 50%; bottom: auto; right: auto; border-radius: var(--sc-modal-rounded); } } :host([align="left"]) .modal-content { text-align: left; align-items: flex-start; } :host([align="right"]) .modal-content { text-align: right; align-items: flex-end; } /* Border radius */ :host([rounded="none"]) modal { --sc-img-radius: 0 !important; }`],ot([a({type:Boolean,reflect:!0})],H.prototype,"hideOnOverlayClick",2),ot([a({type:Boolean,reflect:!0})],H.prototype,"hideOnEscape",2),ot([a({type:String,reflect:!0})],H.prototype,"align",2),ot([a({type:String})],H.prototype,"padding",2),ot([a({type:String})],H.prototype,"maxWidth",2),ot([a({type:String})],H.prototype,"maxHeight",2),ot([a({type:String})],H.prototype,"width",2),ot([a({type:String})],H.prototype,"height",2),ot([a({type:Boolean,reflect:!0})],H.prototype,"fullScreen",2),ot([a({type:Boolean,reflect:!0})],H.prototype,"visible",2),ot([we(".modal-wrapper")],H.prototype,"modalWrapper",2),ot([we(".modal")],H.prototype,"modalElement",2),ot([Tt({selector:"sonic-modal-close"})],H.prototype,"closeBtn",2),H=ot([y(as)],H),typeof window<"u"){let i=window;i.SonicModal=H}try{customElements.define(as,H)}catch{}var Ha=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,he=(i,t,r,e)=>{for(var s=e>1?void 0:e?Wa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ha(t,r,s),s};const Ka={warning:"warning-circled-outline",success:"check-circled-outline",error:"warning-circled-outline",info:"info-empty",default:"info-empty"},xi="sonic-alert";let wt=class extends v{constructor(){super(...arguments),this.label="",this.text="",this.size="md",this.background=!1,this.status="default"}render(){return u`<div part="alert" class="alert"><div>${this.status&&u`<sonic-icon name="${Ka[this.status]}"></sonic-icon>`}</div><div>${this.label?u`<span class="label">${this.label} :</span>`:P} ${this.text}<slot></slot></div></div>`}};wt.styles=[w`:host { --sc-alert-color: inherit; --sc-alert-rounded: var(--sc-rounded); --sc-alert-fw: var(--sc-font-weight-base); --sc-alert-fst: var(--sc-font-style-base); --sc-alert-fs: 1rem; --sc-alert-label-fw: bold; display: block; font-size: var(--sc-alert-fs); font-weight: var(--sc-alert-fw); font-style: var(--sc-alert-fst); } .alert { color: var(--sc-alert-color); position: relative; display: flex; gap: 0.4em; line-height: 1.2; border-radius: var(--sc-alert-rounded); } .label { font-weight: var(--sc-alert-label-fw); } :host([status="warning"]) { --sc-alert-color: var(--sc-warning); } :host([status="error"]) { --sc-alert-color: var(--sc-danger); } :host([status="info"]) { --sc-alert-color: var(--sc-info); } :host([status="success"]) { --sc-alert-color: var(--sc-success); } /*background*/ :host([background]) .alert { background: var(--sc-base); padding: 0.8em 1.15em; } :host([background]) .alert:before { background-color: currentColor; content: ""; display: block; position: absolute; left: 0; top: 0; right: 0; bottom: 0; opacity: 0.08; border-radius: var(--sc-alert-rounded); pointer-events: none; } :host([background]) > div { z-index: 2; position: relative; } /*SIZE*/ :host([size="xs"]) { --sc-alert-fs: 0.75rem; } :host([size="sm"]) { --sc-alert-fs: 0.85rem; } :host([size="lg"]) { --sc-alert-fs: 1.2rem; } /*Rounded*/ :host([size="xs"]) .alert { --sc-alert-rounded: var(--sc-rounded-sm); } :host([size="sm"]) .alert { --sc-alert-rounded: var(--sc-rounded-sm); }`],he([a({type:String})],wt.prototype,"label",2),he([a({type:String})],wt.prototype,"text",2),he([a({type:String,reflect:!0})],wt.prototype,"size",2),he([a({type:Boolean,reflect:!0})],wt.prototype,"background",2),he([a({type:String,reflect:!0})],wt.prototype,"status",2),wt=he([y(xi)],wt);try{customElements.define(xi,wt)}catch{}var Ya=Object.defineProperty,Za=Object.getOwnPropertyDescriptor,de=(i,t,r,e)=>{for(var s=e>1?void 0:e?Za(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ya(t,r,s),s};const Ga="sonic-toast-message-subscriber";let Kt=class extends I(v){constructor(){super(...arguments),this._messages=[],this.success=null,this.status=null,this._message="",this._data=""}get messages(){return this._messages}set messages(i){this._messages=i,this.messages&&i.forEach(t=>{t.type=="public"&&dt.add({text:t.content,status:t.status})})}get message(){return this._message}set message(i){this._message=i,!!this.message&&this.props.success===!1&&(this.props.public_message||dt.add({text:this.message,status:"error"}))}get data(){return this._data}set data(i){this._data=i;const t={text:"Votre produit a bien \xE9t\xE9 ajout\xE9",status:"success"};Array.isArray(this.data)&&this.props.success===!0&&dt.add(t),this.data==""&&this.props.status===!0&&dt.add(t),this.props.success===!1&&(this.props.public_message||dt.add({text:this.data,status:"error"}))}render(){return P}};de([a({type:Boolean})],Kt.prototype,"success",2),de([a({type:Boolean})],Kt.prototype,"status",2),de([a({type:Array})],Kt.prototype,"messages",1),de([a({type:String})],Kt.prototype,"message",1),de([a()],Kt.prototype,"data",1),Kt=de([y(Ga)],Kt);var Xa=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,Bs=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ja(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Xa(t,r,s),s};const _i="sonic-tooltip";let pe=class extends v{constructor(){super(...arguments),this.label="",this.disabled=!1}render(){let i=this.disabled||this.label==""?"disabled":"";return u`<div data-tooltip-text="${this.label.trim().replace(" "," ")}" class="tooltip ${i}"><slot></slot></div>`}};pe.styles=[w`.tooltip { position: relative; display: flex; align-items: center; text-align: center; } .tooltip:before { position: absolute; content: attr(data-tooltip-text); font-size: 0.85rem; display: block; opacity: 0; pointer-events: none; bottom: calc(100% + 0.25rem); left: 50%; transform: translateX(-50%); background: var(--sc-base-content, #111827); padding: 0.25rem; border-radius: 0.25rem; color: var(--sc-base, #fff); z-index: 999; display: none; line-height: 1.1; width: max-content; max-width: 20rem; } .tooltip:not(.disabled):hover:before { opacity: 1; display: block; }`],Bs([a({type:String})],pe.prototype,"label",2),Bs([a({type:Boolean})],pe.prototype,"disabled",2),pe=Bs([y(_i)],pe);try{customElements.define(_i,pe)}catch{}var Qa=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,Yt=(i,t,r,e)=>{for(var s=e>1?void 0:e?tl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Qa(t,r,s),s};const ki="sonic-pop";let tt=class extends v{constructor(){super(...arguments),this.open=!1,this.toggle="true",this.shadow="lg",this.placement="bottom",this.positioningRuns=!1,this.lastContentX=Number.NaN,this.lastContentY=Number.NaN}runPositioning(){!this.positioningRuns||(this.positioningRuns=!0,this._setUpMenu(this.placement),window.requestAnimationFrame(()=>this.runPositioning()))}_toggle(i){this.open&&this.toggle=="false"||i.type=="keydown"&&(i.key!="ArrowDown"||this.open)||(this.open=!this.open,this.open?this._show():this._hide())}_show(){this.open=!0,this.popContent.setAttribute("tabindex","0"),this.popBtn&&this.popContent&&!this.positioningRuns&&(this.positioningRuns=!0,this.lastContentX=Number.NaN,this.lastContentY=Number.NaN,this.runPositioning())}_hide(){this.open=!1,this.popContent.setAttribute("tabindex","-1"),this.positioningRuns=!1}_handleClosePop(i){let t=i.composedPath(),r=t[0];tt.pops.forEach(e=>{const s=t.includes(e),o=t.includes(e.querySelector('[slot="content"]')),n=ee.getAncestorAttributeValue(r,"data-on-select")==="keep";i.type=="pointerdown"&&s||i.type=="click"&&(s&&n||!o)||e._hide()})}connectedCallback(){super.connectedCallback(),tt.pops.size==0&&(document.addEventListener("pointerdown",this._handleClosePop),document.addEventListener("click",this._handleClosePop)),tt.pops.add(this)}disconnectedCallback(){super.disconnectedCallback(),tt.pops.delete(this),tt.pops.size==0&&(document.removeEventListener("pointerdown",this._handleClosePop),document.removeEventListener("click",this._handleClosePop))}_setUpMenu(i){var R;const t=(R=this.popContent)==null?void 0:R.getBoundingClientRect(),r=8,e=20,s=this.getBoundingClientRect();if(!this.offsetParent)return;let o=this.offsetParent.getBoundingClientRect(),n=s.left-o.left,l=s.top-o.top,c=n,h=l,b=l-t.height-r,f=n-t.width-2*r,g=n+s.width+2*r,$=l+s.height+r;switch(i){case"bottom":h=$;break;case"top":h=b;break;case"left":c=f;break;case"right":c=g;break}let _=window.innerWidth-g-o.left-t.width-e;_<0&&i==="right"&&(c=f),_<0&&["top","bottom"].includes(i)&&(c=Math.max(c+_,f+s.width)),-o.left-f>e&&i==="left"&&(c=g);let A=window.innerHeight-$-o.top-t.height-e;A<0&&i==="bottom"&&(h=b),A<0&&["left","right"].includes(i)&&(h=Math.max(h+A,b+s.height)),-o.top-b>-e&&i==="top"&&(h=$),this.lastContentX=c,this.lastContentY=h,Object.assign(this.popContent.style,{left:`${c}px`,top:`${h}px`})}render(){return u`<slot @click="${this._toggle}" @keydown="${this._toggle}" class="contents"></slot><slot name="content" tabindex="-1" part="content" class="${this.open?"is-open":""}"></slot>`}};tt.pops=new Set,tt.styles=[w`:host { display: inline-block; vertical-align: middle; } slot[name="content"] { background-color: var(--sc-base); position: absolute; z-index: 50; display: block; transform: translateY(1rem) scale(0.95); opacity: 0; pointer-events: none; transition-duration: 0.15s ; transition-timing-function: ease; transition-property:all; border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); } slot[name="content"].is-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; transition-property:scale, opacity; transition-timing-function: cubic-bezier(0.25, 0.25, 0.42, 1.225); } /*OMBRE*/ :host([shadow]) slot[name="content"], :host([shadow="md"]) slot[name="content"], :host([shadow="true"]) slot[name="content"] { box-shadow: var(--sc-shadow); } :host([shadow="sm"]) slot[name="content"] { box-shadow: var(--sc-shadow-sm); } :host([shadow="none"]) slot[name="content"] { box-shadow: none; } :host([shadow="lg"]) slot[name="content"] { box-shadow: var(--sc-shadow-lg); }`],Yt([Z()],tt.prototype,"open",2),Yt([we("slot:not([name=content])")],tt.prototype,"popBtn",2),Yt([we("slot[name=content]")],tt.prototype,"popContent",2),Yt([a({type:String})],tt.prototype,"toggle",2),Yt([a({type:String,reflect:!0})],tt.prototype,"shadow",2),Yt([a({type:String})],tt.prototype,"placement",2),tt=Yt([y(ki)],tt);try{customElements.define(ki,tt)}catch{}var el=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,ue=(i,t,r,e)=>{for(var s=e>1?void 0:e?sl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&el(t,r,s),s};const rl="sonic-divider";let $t=class extends v{constructor(){super(...arguments),this.label="",this.size="md",this.align="center"}firstUpdated(){var i,t;(this.label||((i=this.slotNodes)==null?void 0:i.length))&&((t=this.divider)==null||t.classList.add("has-text"))}render(){return u`<div part="divider"><span class="text">${this.label}<slot></slot></span></div>`}};$t.styles=[w`:host { --sc-divider-my: 0.5rem; --sc-divider-mx: 0; --sc-divider-border-width: min(2px, 0.15rem); --sc-divider-border-color: var(--sc-base-200); --sc-divider-border-style: solid; --sc-divider-color: var(--sc-base-500); --sc-divider-ff: var(--sc-font-family-base); --sc-divider-fs: 1rem; --sc-divider-fw: var(--sc-font-weight-base); --sc-divider-fst: var(--sc-font-style-base); margin: var(--sc-divider-my) var(--sc-divider-mx); font-size: var(--sc-divider-fs); font-style: var(--sc-divider-fst); font-family: var(--sc-divider-ff); font-weight: var(--sc-divider-fw); color: var(--sc-divider-color); display: block; } /*SIZE*/ :host([size="xs"]) { --sc-divider-my: 0.5rem; --sc-divider-fs: 0.75rem; } :host([size="sm"]) { --sc-divider-my: 0.75rem; --sc-divider-fs: 0.85rem; } :host([size="md"]) { --sc-divider-my: 1.25rem; } :host([size="lg"]) { --sc-divider-my: 1.85rem; } :host([size="xl"]) { --sc-divider-my: 2.25rem; } :host([size="2xl"]) { --sc-divider-my: 3rem; } div { display: flex; align-items: center; width: 100%; } div:before { content: ""; flex-grow: 1; border-top: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color); width: 100%; } div:after { content: ""; flex-grow: 1; border-top: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color); width: 100%; } /*ALIGNEMENT*/ :host([align="left"]) div:before { display: none; } :host([align="right"]) div:after { display: none; } /*TEXT*/ .text { flex-shrink: 0; max-width: 80%; } .no-text .text { display: none; } .has-text { gap: 0.5rem; }`],ue([rt()],$t.prototype,"slotNodes",2),ue([we("div")],$t.prototype,"divider",2),ue([a({type:String})],$t.prototype,"label",2),ue([a({type:String,reflect:!0})],$t.prototype,"size",2),ue([a({type:String,reflect:!0})],$t.prototype,"align",2),$t=ue([y("sonic-divider")],$t);try{customElements.define(rl,$t)}catch{}var il=Object.defineProperty,ol=Object.getOwnPropertyDescriptor,nl=(i,t,r,e)=>{for(var s=e>1?void 0:e?ol(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&il(t,r,s),s};const Ai="sonic-card-header-description";let ls=class extends v{render(){return u`<div><slot></slot></div>`}};ls.styles=[w`div { margin-top: .1em; font-family: var(--sc-font-family-base); font-size: .7em; font-weight: var(--sc-font-style-base); }`],ls=nl([y(Ai)],ls);try{customElements.define(Ai,ls)}catch{}var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,Vs=(i,t,r,e)=>{for(var s=e>1?void 0:e?ll(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&al(t,r,s),s};const Si="sonic-card-header";let ge=class extends v{render(){return u`<div class="header"><div class="header-content">${this.label} ${this.description?u`<sonic-card-header-description>${this.description}</sonic-card-header-description>`:""}<slot></slot></div><slot name="suffix"></slot></div>`}};ge.styles=[w`:host { --sc-card-header-mb: 1rem; --sc-card-header-font-size: 1.875rem; --sc-card-header-font-weight: var(--sc-headings-font-weight); --sc-card-header-font-style: var(--sc-headings-font-style); --sc-card-header-family: var(--sc-headings-font-family); --sc-card-header-line-height: var(--sc-headings-line-height); } .header { display: flex; align-items: flex-start; gap: .5em 1em; margin-bottom: var(--sc-card-header-mb); line-height: var(--sc-card-header-line-height); font-family: var(--sc-card-header-font-family); font-size: var(--sc-card-header-font-size); font-style: var(--sc-card-header-font-style); font-weight: var(--sc-card-header-font-weight); } .header-content { flex-grow: 1; } slot[name="suffix"] { flex-shrink: 0; }`],Vs([a()],ge.prototype,"label",2),Vs([a()],ge.prototype,"description",2),ge=Vs([y(Si)],ge);try{customElements.define(Si,ge)}catch{}var cl=Object.defineProperty,hl=Object.getOwnPropertyDescriptor,dl=(i,t,r,e)=>{for(var s=e>1?void 0:e?hl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&cl(t,r,s),s};const Pi="sonic-card-main";let qs=class extends v{render(){return u`<div><slot></slot></div>`}};qs=dl([y(Pi)],qs);try{customElements.define(Pi,qs)}catch{}var pl=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,gl=(i,t,r,e)=>{for(var s=e>1?void 0:e?ul(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&pl(t,r,s),s};const Ci="sonic-card-footer";let Hs=class extends v{render(){return u`<slot></slot>`}};Hs=gl([y(Ci)],Hs);try{customElements.define(Ci,Hs)}catch{}var fl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,Oi=(i,t,r,e)=>{for(var s=e>1?void 0:e?ml(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&fl(t,r,s),s};const Ei="sonic-card";let De=class extends v{constructor(){super(...arguments),this.type="default"}render(){return u`<div part="card" class="card"><slot></slot></div>`}};De.styles=[w`:host { --sc-card-padding: 1.5rem; --sc-card-color: var(--sc-base-content); --sc-card-bg: var(--sc-base); --sc-card-rounded: var(--sc-rounded-lg); --sc-card-shadow: var(--sc-shadow-lg); } .card { padding: var(--sc-card-padding); background-color: var(--sc-card-bg); border-radius: var(--sc-card-rounded); box-shadow: var(--sc-card-shadow); color: var(--sc-card-color); } /*TYPES*/ :host([type="primary"]) { --sc-card-color: var(--sc-primary-content); --sc-badge-bg: var(--sc-primary); } :host([type="warning"]) { --sc-card-color: var(--sc-warning-content); --sc-card-bg: var(--sc-warning); } :host([type="danger"]) { --sc-card-color: var(--sc-danger-content); --sc-card-bg: var(--sc-danger); } :host([type="info"]) { --sc-card-color: var(--sc-info-content); --sc-card-bg: var(--sc-info); } :host([type="success"]) { --sc-card-color: var(--sc-success-content); --sc-card-bg: var(--sc-success); } :host([type="light"]) { --sc-card-color: var(--sc-base-content); --sc-card-bg: var(--sc-base-100); } :host([type="neutral"]) { --sc-card-color: var(--sc-base); --sc-card-bg: var(--sc-base-content); } :host([type="invert"]) { --sc-card-color: var(--sc-base); --sc-card-bg: var(--sc-base-900); }`],Oi([a({type:String,reflect:!0})],De.prototype,"type",2),De=Oi([y(Ei)],De);try{customElements.define(Ei,De)}catch{}const Ws=w`:host{ --sc-color:inherit; color:var(--sc-color); } :host([type="primary"]) { --sc-color: var(--sc-primary); } :host([type="warning"]) { --sc-color: var(--sc-warning); } :host([type="danger"]) { --sc-color: var(--sc-danger); } :host([type="info"]) { --sc-color: var(--sc-info); } :host([type="success"]) { --sc-color: var(--sc-success); } .inherit-color{ color:var(--sc-color); }`;w`:host{ --sc-color:inherit; --sc-bg:inherit; color:var(--sc-color); background:var(--sc-bg); } :host([type="primary"]) { --sc-color: var(--sc-primary-content); --sc-bg: var(--sc-primary); } :host([type="warning"]) { --sc-color: var(--sc-warning-content); --sc-bg: var(--sc-warning); } :host([type="danger"]) { --sc-color: var(--sc-danger-content); --sc-bg: var(--sc-danger); } :host([type="info"]) { --sc-color: var(--sc-info-content); --sc-bg: var(--sc-info); } :host([type="success"]) { --sc-color: var(--sc-success-content); --sc-bg: var(--sc-success); } .inherit-bg{ color:inherit; }`;var vl=Object.defineProperty,bl=Object.getOwnPropertyDescriptor,yl=(i,t,r,e)=>{for(var s=e>1?void 0:e?bl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&vl(t,r,s),s};const ji="sonic-tr";let cs=class extends v{render(){return u`<slot></slot>`}};cs.styles=[Ws,w`:host { display: table-row; }`],cs=yl([y(ji)],cs);try{customElements.define(ji,cs)}catch{}var wl=Object.defineProperty,$l=Object.getOwnPropertyDescriptor,Le=(i,t,r,e)=>{for(var s=e>1?void 0:e?$l(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&wl(t,r,s),s};const Di="sonic-th";let jt=class extends v{render(){const i={textAlign:this.align,minWidth:this.minWidth};return u`<th part="th" style="${ht(i)}" colspan="${k(this.colSpan)}" rowspan="${k(this.rowSpan)}"><slot></slot></th>`}};jt.styles=[Ws,w`:host { display: contents; background:var(--sc-table-bg); position:sticky; top:0; z-index:20; } th { all: inherit; display: table-cell; border-bottom: calc(var(--sc-border-width) * 1.5) solid var(--sc-table-border-color); text-transform: var(--sc-table-th-tt); font-weight: var(--sc-table-th-fw); font-size: var(--sc-table-th-fs); padding: var(--sc-table-th-py) var(--sc-table-th-px); }`],Le([a({type:Number})],jt.prototype,"colSpan",2),Le([a({type:Number})],jt.prototype,"rowSpan",2),Le([a({type:String})],jt.prototype,"align",2),Le([a({type:String})],jt.prototype,"minWidth",2),jt=Le([y(Di)],jt);try{customElements.define(Di,jt)}catch{}var xl=Object.defineProperty,_l=Object.getOwnPropertyDescriptor,ze=(i,t,r,e)=>{for(var s=e>1?void 0:e?_l(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&xl(t,r,s),s};const Li="sonic-td";let Dt=class extends v{render(){const i={textAlign:this.align,minWidth:this.minWidth};return u`<td part="td" style="${ht(i)}" colspan="${k(this.colSpan)}" rowspan="${k(this.rowSpan)}"><slot></slot></td>`}};Dt.styles=[Ws,w`:host { display: contents; } td { all: inherit; display: table-cell; padding: var(--sc-table-td-py) var(--sc-table-td-px); }`],ze([a({type:Number})],Dt.prototype,"colSpan",2),ze([a({type:Number})],Dt.prototype,"rowSpan",2),ze([a({type:String})],Dt.prototype,"align",2),ze([a({type:String})],Dt.prototype,"minWidth",2),Dt=ze([y(Li)],Dt);try{customElements.define(Li,Dt)}catch{}var kl=Object.defineProperty,Al=Object.getOwnPropertyDescriptor,Sl=(i,t,r,e)=>{for(var s=e>1?void 0:e?Al(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&kl(t,r,s),s};const zi="sonic-thead";let hs=class extends v{render(){return u`<slot></slot>`}};hs.styles=[w`:host { display: table-header-group; }`],hs=Sl([y(zi)],hs);try{customElements.define(zi,hs)}catch{}var Pl=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Ol=(i,t,r,e)=>{for(var s=e>1?void 0:e?Cl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Pl(t,r,s),s};const Ti="sonic-tbody";let ds=class extends v{render(){return u`<tbody><slot></slot></tbody>`}};ds.styles=[w`:host { display: table-row-group; } ::slotted(sonic-tr:nth-child(odd)){ background:var(--sc-base-50); } ::slotted(sonic-tr:hover) { background:var(--sc-base-100); } ::slotted(sonic-tr:not(:last-child)){ border-bottom:var(--sc-form-border-width) solid var(--sc-base-200) !important; }`],ds=Ol([y(Ti)],ds);try{customElements.define(Ti,ds)}catch{}var El=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Dl=(i,t,r,e)=>{for(var s=e>1?void 0:e?jl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&El(t,r,s),s};const Mi="sonic-tfoot";let ps=class extends v{render(){return u`<tfoot><slot></slot></tfoot>`}};ps.styles=[w`:host { display: contents; }`],ps=Dl([y(Mi)],ps);try{customElements.define(Mi,ps)}catch{}var Ll=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,Tl=(i,t,r,e)=>{for(var s=e>1?void 0:e?zl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ll(t,r,s),s};const Ri="sonic-caption";let us=class extends v{render(){return u`<slot></slot>`}};us.styles=[w`:host { display:table-caption; font-size:.75rem; color:var(--sc-table-caption-color); padding: var(--sc-table-td-py) var(--sc-table-td-px) calc(2 * var(--sc-table-td-py) ); }`],us=Tl([y(Ri)],us);try{customElements.define(Ri,us)}catch{}var Ml=Object.defineProperty,Rl=Object.getOwnPropertyDescriptor,Zt=(i,t,r,e)=>{for(var s=e>1?void 0:e?Rl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ml(t,r,s),s};const Ni="sonic-table";let mt=class extends v{constructor(){super(...arguments),this.size="md",this.striped=!1,this.sticky=!1,this.bordered=!1,this.hover=!1}render(){const i={maxHeight:this.maxHeight};return u`<div class="table-container custom-scroll" style="${ht(i)}"><div class="table" ?striped="${this.striped}" ?hover="${this.hover}" ?sticky="${this.sticky}"><slot></slot></div></div>`}};mt.styles=[qe,w`:host { --sc-table-fw: var(--sc-font-weight-base); --sc-table-fst: var(--sc-font-style-base); --sc-table-fs: 1rem; --sc-table-border-color: var(--sc-base-200); --sc-table-caption-color: var(--sc-base-400); --sc-table-bg: var(--sc-base); --sc-table-th-fs: .85em; --sc-table-th-fw: bold; --sc-table-th-tt: uppercase; --sc-table-th-px: var(--sc-table-td-px); --sc-table-th-py: calc(1.8 * var(--sc-table-td-py) ); --sc-table-td-px: .5em; --sc-table-td-py: .5em; display:block; } .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; } .table { width: 100%; font-size: var(--sc-table-fs); display: table; box-sizing:border-box; } /*SIZES*/ :host([size="2xs"]) { --sc-table-fs: 0.6rem; } :host([size="xs"]) { --sc-table-fs: 0.75rem; } :host([size="sm"]) { --sc-table-fs: 0.85rem; } :host([size="lg"]) { --sc-table-fs: 1.2rem; } :host([size="xl"]) { --sc-table-fs: 1.5rem; } :host([bordered]) .table-container { border:var(--sc-border-width) solid var(--sc-table-border-color) !important; }`],Zt([a({type:String,reflect:!0})],mt.prototype,"size",2),Zt([a({type:Boolean,reflect:!0})],mt.prototype,"striped",2),Zt([a({type:Boolean,reflect:!0})],mt.prototype,"sticky",2),Zt([a({type:Boolean,reflect:!0})],mt.prototype,"bordered",2),Zt([a({type:Boolean,reflect:!0})],mt.prototype,"hover",2),Zt([a({type:String})],mt.prototype,"maxHeight",2),mt=Zt([y(Ni)],mt);try{customElements.define(Ni,mt)}catch{}let gs=window;gs.SonicPublisherManager||(gs.SonicPublisherManager=K),gs.SonicDataBindObserver||(gs.SonicDataBindObserver=kt);const Nl=Ds,Fl=Es,Il=ne,Ul=Xe,Bl=I,Vl=$e;let Ks=window;Ks["concorde-mixins"]=Ks["concorde-mixins"]||{},Ks["concorde-mixins"]={Fetcher:Nl,FormCheckable:Fl,FormElement:Il,FormInput:Ul,Subscriber:Bl,TemplatesContainer:Vl};const ql=dt,Hl=H;let Ys=window;Ys["concorde-components"]=Ys["concorde-components"]||{},Ys["concorde-components"]={SonicToast:ql,SonicModal:Hl}});
|
|
114
|
+
*/const si=ie(class extends oe{constructor(i){var t;if(super(i),i.type!==Rt.ATTRIBUTE||i.name!=="class"||((t=i.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var r,e;if(this.et===void 0){this.et=new Set,i.strings!==void 0&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in t)t[o]&&!(!((r=this.st)===null||r===void 0)&&r.has(o))&&this.et.add(o);return this.render(t)}const s=i.element.classList;this.et.forEach(o=>{o in t||(s.remove(o),this.et.delete(o))});for(const o in t){const n=!!t[o];n===this.et.has(o)||((e=this.st)===null||e===void 0?void 0:e.has(o))||(n?(s.add(o),this.et.add(o)):(s.remove(o),this.et.delete(o)))}return ht}});var Hn=Object.defineProperty,Wn=Object.getOwnPropertyDescriptor,z=(i,t,r,e)=>{for(var s=e>1?void 0:e?Wn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Hn(t,r,s),s};const ri="sonic-input";let j=class extends Xe(ne(I(v))){constructor(){super(...arguments),this.size="",this.list=null,this.placeholder="",this.readonly=!1,this.pattern=null,this.min=null,this.max=null,this.step=null,this.minlength=null,this.maxlength=null,this.label="",this.description="",this.inlineContent=!1,this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1}updated(){var i,t,r,e;this.hasLabel=!!(this.label||((i=this.slotLabelNodes)==null?void 0:i.length)),this.hasDescription=!!(this.description||((t=this.slotDescriptionNodes)==null?void 0:t.length)),this.hasSuffix=!!((r=this.slotSuffixNodes)!=null&&r.length),this.hasPrefix=!!((e=this.slotPrefixNodes)!=null&&e.length)}onSlotChange(){this.requestUpdate()}render(){const i={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix};return u`<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}">${this.label?this.label:""}<slot name="label" @slotchange="${this.onSlotChange}"></slot></label><div class="form-control ${si(i)}"><div class="${this.inlineContent?"form-element form-element-wrapper":"contents"}"><slot name="prefix" @slotchange="${this.onSlotChange}"></slot><input id="form-element" part="input" class="form-element input" type="${this.type}" @input="${this.handleChange}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" list="${S(this.list)}" autofocus="${S(this.autofocus)}" required="${S(this.required)}" tabindex="${S(this.tabindex)}" pattern="${S(this.pattern)}" min="${S(this.min)}" max="${S(this.max)}" step="${S(this.step)}" minlength="${S(this.minlength)}" maxlength="${S(this.maxlength)}" placeholder="${this.placeholder}" .name="${this.name}" .value="${this.value}" autocomplete="${S(this.autocomplete)}"><slot name="suffix" @slotchange="${this.onSlotChange}"></slot></div></div><slot name="description" class="${this.hasDescription?"form-description":"hidden"}">${this.description?u`${this.description}`:""}</slot>`}};j.styles=[Ns],z([a({type:String})],j.prototype,"size",2),z([a({type:String})],j.prototype,"list",2),z([a({type:String})],j.prototype,"placeholder",2),z([a({type:Boolean})],j.prototype,"readonly",2),z([a({type:String})],j.prototype,"pattern",2),z([a({type:String})],j.prototype,"min",2),z([a({type:String})],j.prototype,"max",2),z([a({type:String})],j.prototype,"step",2),z([a({type:String})],j.prototype,"minlength",2),z([a({type:String})],j.prototype,"maxlength",2),z([a({type:String})],j.prototype,"label",2),z([a({type:String})],j.prototype,"description",2),z([a({type:Boolean,reflect:!0})],j.prototype,"inlineContent",2),z([rt({slot:"label"})],j.prototype,"slotLabelNodes",2),z([rt({slot:"description"})],j.prototype,"slotDescriptionNodes",2),z([rt({slot:"suffix"})],j.prototype,"slotSuffixNodes",2),z([rt({slot:"prefix"})],j.prototype,"slotPrefixNodes",2),z([Z()],j.prototype,"hasDescription",2),z([Z()],j.prototype,"hasLabel",2),z([Z()],j.prototype,"hasSuffix",2),z([Z()],j.prototype,"hasPrefix",2),j=z([y(ri)],j);try{customElements.define(ri,j)}catch{}var Kn=Object.defineProperty,Yn=Object.getOwnPropertyDescriptor,Wt=(i,t,r,e)=>{for(var s=e>1?void 0:e?Yn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Kn(t,r,s),s};const ii="sonic-checkbox";let ct=class extends Es(Xe(ne(I(v)))){constructor(){super(...arguments),this.touched=!1,this.iconName="check",this.description="",this.label="",this.hasDescription=!1}updated(){var i;this.hasDescription=!!(this.description||((i=this.slotDescriptionNodes)==null?void 0:i.length))}connectedCallback(){this.type="checkbox",super.connectedCallback()}render(){return u`<label class="checkbox-container ${this.disabled?"disabled":""}"><span class="icon-container"><input type="${this.type}" @change="${this.handleChange}" .disabled="${S(this.disabled)}" .required="${S(this.required)}" .checked="${S(this.checked)}" .name="${this.name}" .value="${this.value}" ?autofocus="${this.autofocus}"><sonic-icon name="${this.iconName}" class="sc-input-icon"></sonic-icon></span><div class="checkbox-text">${this.label?this.label:""}<slot></slot><slot name="description" class="${this.hasDescription?"description":"hidden"}">${this.description?u`${this.description}`:""}</slot></div></label>`}};ct.styles=[w`:host{ --sc-checkbox-border-width: var(--sc-form-border-width); --sc-checkbox-border-color: transparent; } * { box-sizing: border-box; } .checkbox-container { min-height: 1.4em; display: flex; gap: 0.5em; line-height: 1.2; align-items: flex-start; } .icon-container { position: relative; display: flex; flex-shrink: 0; } input { appearance: none; flex-shrink: 0; height: 1.5em; width: 1.5em; display: block; cursor: pointer; border-radius: 0.25em; transition: 0.2s; outline: none; margin: 0; background-color: var(--sc-base-200); border:var(--sc-checkbox-border-width) solid var(--sc-checkbox-border-color); } input:focus, :host(:not([disabled])) input:active { box-shadow: 0 0 0 2px var(--sc-primary); } :host(:not([disabled])) label { cursor: pointer; } sonic-icon { line-height: 0; position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%) scale(0); transition: transform 0.2s ease-in-out; color: var(--sc-primary-content); } /* .checkbox-text { align-self: center; } */ .description { color: var(--sc-base-400); font-size: 0.85em; margin-top: 0.2em; display: block; } /*Active */ input:checked, input[checked="true"] { background: var(--sc-primary); } input:checked + sonic-icon, input[checked="true"] + sonic-icon { transform: translateX(-50%) translateY(-50%) scale(1); } /*DISABLED */ .disabled { cursor: not-allowed; } .disabled input { opacity: 0.4; } .disabled .checkbox-text { opacity: 0.6; } ::slotted(a) { color: inherit; text-decoration: underline !important; } ::slotted(a:hover) { text-decoration: none !important; } /*Utils */ .hidden { display: none; } /*ERROR*/ :host([touched]) .checkbox-container:has(input:not(:focus):invalid) { --sc-checkbox-border-color:var(--sc-danger); } :host([touched]) .checkbox-container:has(input:not(:focus):invalid) .checkbox-text{ color:var(--sc-danger); }`],Wt([a({type:Boolean,reflect:!0})],ct.prototype,"touched",2),Wt([a({type:String})],ct.prototype,"iconName",2),Wt([a({type:String})],ct.prototype,"description",2),Wt([a({type:String})],ct.prototype,"label",2),Wt([rt({slot:"description"})],ct.prototype,"slotDescriptionNodes",2),Wt([a({type:Boolean})],ct.prototype,"hasDescription",2),ct=Wt([y(ii)],ct);try{customElements.define(ii,ct)}catch{}var Zn=Object.defineProperty,Gn=Object.getOwnPropertyDescriptor,Xn=(i,t,r,e)=>{for(var s=e>1?void 0:e?Gn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Zn(t,r,s),s};const oi="sonic-radio";let Je=class extends ct{constructor(){super()}connectedCallback(){this.radio=!0,super.connectedCallback(),this.type="radio"}};Je.styles=[ct.styles,w`:host input { border-radius: 50%; } :host sonic-icon { border-radius: 50%; overflow: hidden; background-color:var(--sc-primary-content); line-height:0; display:block; font-size:0; height:10px; width:10px; }`],Je=Xn([y(oi)],Je);try{customElements.define(oi,Je)}catch{}var Jn=Object.defineProperty,Qn=Object.getOwnPropertyDescriptor,Y=(i,t,r,e)=>{for(var s=e>1?void 0:e?Qn(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Jn(t,r,s),s};const ni="sonic-select";let M=class extends ne(I(v)){constructor(){super(...arguments),this.valueKey="value",this.wordingKey="wording",this.multiple=null,this.size="",this.selectSize=null,this._options=[],this._value="",this.label="",this.description="",this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1}set options(i){this._options=i,!this.value&&this._options.length>0&&(this.value=this._options[0][this.valueKey]),this.requestUpdate()}get options(){return this._options}get value(){return this._value}set value(i){!i||this._value!=i&&(this._value=i,this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")),this.formDataProvider?K.getInstance().get(this.formDataProvider)[this._name]=i:this.publisher&&(this.publisher[this._name]=i),this.requestUpdate())}connectedCallback(){super.connectedCallback();let i=this.querySelectorAll("option");i.length>0&&(this.options=Array.from(i).map(t=>({value:t.value,wording:t.text})))}updated(){var i,t,r,e;this.hasLabel=!!(this.label||((i=this.slotLabelNodes)==null?void 0:i.length)),this.hasDescription=!!(this.description||((t=this.slotDescriptionNodes)==null?void 0:t.length)),this.hasSuffix=!!((r=this.slotSuffixNodes)!=null&&r.length),this.hasPrefix=!!((e=this.slotPrefixNodes)!=null&&e.length)}onSlotChange(){this.requestUpdate()}validateFormElement(){var t;const i=(t=this.shadowRoot)==null?void 0:t.querySelector("select");!i||i.checkValidity()||(this.getFormPublisher().isFormValid=!1,i.reportValidity())}render(){const i={"has-prefix":this.hasPrefix,"has-suffix":this.hasSuffix};return u`<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}">${this.label?this.label:""}<slot name="label" @slotchange="${this.onSlotChange}"></slot></label><div class="form-control ${si(i)}"><slot name="prefix" @slotchange="${this.onSlotChange}"></slot><div class="form-select-wrapper"><select @change="${this.handleChange}" disabled="${S(this.multiple)}" size="${S(this.selectSize)}" autofocus="${S(this.autofocus)}" required="${S(this.required)}" .value="${this.value}" class="form-element">${Ft(this.options,t=>t[this.valueKey],t=>{const r=this.value==t[this.valueKey]?"selected":null;return u`<option selected="${S(r)}" value="${t[this.valueKey]}">${t[this.wordingKey]}</option>`})}<slot></slot></select><sonic-icon class="select-chevron" name="nav-arrow-down" size="${this.size}"></sonic-icon></div><slot name="suffix" @slotchange="${this.onSlotChange}"></slot></div><slot name="description" class="${this.hasDescription?"form-description":"hidden"}">${this.description?u`${this.description}`:""}</slot>`}};M.styles=[Ns,w`.form-element { appearance: none; padding-right: 2.5em; } .form-select-wrapper { position: relative; width: 100%; } sonic-icon { position: absolute; right: 1em; top: 50%; pointer-events: none; transform: translateY(-50%); color:var(--sc-input-color); } option { padding: 0.1rem 5rem; color: var(--sc-base-content); background: var(--sc-base); }`],Y([a({type:String})],M.prototype,"valueKey",2),Y([a({type:String})],M.prototype,"wordingKey",2),Y([a({type:Boolean})],M.prototype,"multiple",2),Y([a({type:String})],M.prototype,"size",2),Y([a({type:String})],M.prototype,"selectSize",2),Y([a({type:Array})],M.prototype,"options",1),Y([a()],M.prototype,"value",1),Y([a({type:String})],M.prototype,"label",2),Y([a({type:String})],M.prototype,"description",2),Y([rt({slot:"label"})],M.prototype,"slotLabelNodes",2),Y([rt({slot:"description"})],M.prototype,"slotDescriptionNodes",2),Y([rt({slot:"suffix"})],M.prototype,"slotSuffixNodes",2),Y([rt({slot:"prefix"})],M.prototype,"slotPrefixNodes",2),Y([Z()],M.prototype,"hasDescription",2),Y([Z()],M.prototype,"hasLabel",2),Y([Z()],M.prototype,"hasSuffix",2),Y([Z()],M.prototype,"hasPrefix",2),M=Y([y(ni)],M);try{customElements.define(ni,M)}catch{}var ta=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,B=(i,t,r,e)=>{for(var s=e>1?void 0:e?ea(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ta(t,r,s),s};const ai="sonic-textarea";let L=class extends Xe(ne(I(v))){constructor(){super(...arguments),this.size="",this.rows="",this.cols="",this.maxlength="",this.minlength="",this.wrap=null,this.readonly=null,this.placeholder="",this.label="",this.description="",this.hasDescription=!1,this.hasLabel=!1,this.hasSuffix=!1,this.hasPrefix=!1,this.slotClasses={}}updated(){var i,t,r,e;this.hasLabel=!!(this.label||((i=this.slotLabelNodes)==null?void 0:i.length)),this.hasDescription=!!(this.description||((t=this.slotDescriptionNodes)==null?void 0:t.length)),this.hasSuffix=!!((r=this.slotSuffixNodes)!=null&&r.length),this.hasPrefix=!!((e=this.slotPrefixNodes)!=null&&e.length)}onSlotChange(){this.requestUpdate()}validateFormElement(){var t;const i=(t=this.shadowRoot)==null?void 0:t.querySelector("textarea");!i||i.checkValidity()||(this.getFormPublisher().isFormValid=!1,i.reportValidity())}render(){return u`<label for="form-element" class="${this.hasLabel?"form-label":"hidden"}">${this.label?this.label:""}<slot name="label" @slotchange="${this.onSlotChange}"></slot></label><div class="form-control"><textarea @input="${this.handleChange}" ?disabled="${this.disabled}" ?required="${this.required}" autocomplete="${S(this.autocomplete)}" autofocus="${S(this.autofocus)}" rows="${S(this.rows)}" cols="${S(this.cols)}" maxlength="${S(this.maxlength)}" minlength="${S(this.minlength)}" ?readonly="${this.readonly}" spellcheck="${S(this.spellcheck)}" wrap="${S(this.wrap)}" class="form-element textarea custom-scroll" placeholder="${this.placeholder}">
|
|
115
|
+
${this.value}</textarea></div><slot name="description" class="${this.hasDescription?"form-description":"hidden"}">${this.description?u`${this.description}`:""}</slot>`}};L.styles=[Ns,qe,w`textarea { font-size: inherit; }`],B([a({type:String})],L.prototype,"size",2),B([a({type:String})],L.prototype,"rows",2),B([a({type:String})],L.prototype,"cols",2),B([a({type:String})],L.prototype,"maxlength",2),B([a({type:String})],L.prototype,"minlength",2),B([a({type:String})],L.prototype,"wrap",2),B([a({type:Boolean})],L.prototype,"readonly",2),B([a({type:String})],L.prototype,"placeholder",2),B([a({type:String})],L.prototype,"label",2),B([a({type:String})],L.prototype,"description",2),B([rt({slot:"label"})],L.prototype,"slotLabelNodes",2),B([rt({slot:"description"})],L.prototype,"slotDescriptionNodes",2),B([rt({slot:"suffix"})],L.prototype,"slotSuffixNodes",2),B([rt({slot:"prefix"})],L.prototype,"slotPrefixNodes",2),B([Z()],L.prototype,"hasDescription",2),B([Z()],L.prototype,"hasLabel",2),B([Z()],L.prototype,"hasSuffix",2),B([Z()],L.prototype,"hasPrefix",2),B([a()],L.prototype,"slotClasses",2),L=B([y(ai)],L);try{customElements.define(ai,L)}catch{}var sa=Object.defineProperty,ra=Object.getOwnPropertyDescriptor,Is=(i,t,r,e)=>{for(var s=e>1?void 0:e?ra(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&sa(t,r,s),s};const li="sonic-fieldset";let le=class extends I(v){constructor(){super(...arguments),this.disabled=!1}render(){return u`<fieldset form="${S(this.form)}" ?disabled="${this.disabled}"><slot></slot></fieldset>`}};le.styles=[w`:host { --sc-fieldset-mt: 0; --sc-fieldset-mb: 1rem; --sc-fieldset-border-color: var(--sc-base-200); --sc-fieldset-border-width: var(--sc-form-border-width); margin-top: var(--sc-fieldset-mt); margin-bottom: var(--sc-fieldset-mb); display: block; border: var(--sc-fieldset-border-width) solid var(--sc-fieldset-border-color) !important; padding: 1.8rem 1.25rem; border-radius: var(--sc-rounded-lg); } fieldset { all: unset; display: contents; } ::slotted(sonic-legend) { margin-bottom: 1.5rem; display: block; }`],Is([a({type:Boolean,reflect:!0})],le.prototype,"disabled",2),Is([a({type:String})],le.prototype,"form",2),le=Is([y(li)],le);try{customElements.define(li,le)}catch{}var ia=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,na=(i,t,r,e)=>{for(var s=e>1?void 0:e?oa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ia(t,r,s),s};let Qe=class extends v{render(){return u`<slot></slot>`}};Qe.styles=[w`:host { color: var(--sc-neutral-500); font-size: 1.25rem; line-height: 1.2; display: block; font-weight: var(--sc-font-weight-base); font-style: var(--sc-font-style-base); margin-top: 0.25em; }`],Qe=na([y("sonic-legend-description")],Qe);try{customElements.define("sonic-legend-description",Qe)}catch{}var aa=Object.defineProperty,la=Object.getOwnPropertyDescriptor,ce=(i,t,r,e)=>{for(var s=e>1?void 0:e?la(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&aa(t,r,s),s};const ci="sonic-legend";let wt=class extends v{render(){return u`<legend part="legend">${this.iconName?u`<div class="icon"><sonic-icon name="${this.iconName}" prefix="${S(this.iconPrefix)}" library="${S(this.iconLibrary)}"></sonic-icon></div>`:""}<div class="legend-content">${this.label} ${this.description?u`<sonic-legend-description>${this.description}</sonic-legend-description>`:""}<slot></slot></div><slot name="suffix"></slot></legend>`}};wt.styles=[w`:host { --sc-legend-font-size: 1.75rem; --sc-legend-font-weight: var(--sc-font-weight-base); --sc-legend-font-style: var(--sc-headings-font-style); --sc-legend-family: var(--sc-headings-font-family); --sc-legend-line-height: var(--sc-headings-line-height); display: flex; width: 100%; } legend { font-size: var(--sc-legend-font-size); font-weight: var(--sc-legend-font-weight); font-style: var(--sc-legend-font-style); font-family: var(--sc-legend-font-family); line-height: var(--sc-legend-line-height); padding: 0; display: flex; width: 100%; align-items: flex-start; gap: 0.5em; } slot[name="suffix"] { display: block; margin-left: auto; flex-shrink: 0; } .legend-content { flex-grow: 1; }`],ce([a({type:String})],wt.prototype,"description",2),ce([a({type:String})],wt.prototype,"label",2),ce([a({type:String})],wt.prototype,"iconName",2),ce([a({type:String})],wt.prototype,"iconLibrary",2),ce([a({type:String})],wt.prototype,"iconPrefix",2),wt=ce([y(ci)],wt);try{customElements.define(ci,wt)}catch{}class ca{constructor(t,{target:r,config:e,callback:s,skipInitial:o}){this.t=!1,this.i=!1,this.callback=()=>!0,(this.h=t).addController(this),this.o=r===null||r!=null?r:this.h,this.l=e,this.t=o!=null?o:this.t,this.callback=s!=null?s:this.callback,window.ResizeObserver?this.u=new ResizeObserver(n=>{this.handleChanges(n),this.h.requestUpdate()}):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){this.value=this.callback(t,this.u)}hostConnected(){this.o&&this.observe(this.o)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.t&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}disconnect(){this.u.disconnect()}}var ha=Object.defineProperty,da=Object.getOwnPropertyDescriptor,pa=(i,t,r,e)=>{for(var s=e>1?void 0:e?da(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ha(t,r,s),s};const hi="sonic-form-layout";let ts=class extends I(v){constructor(){super(...arguments),this._resizeController=new ca(this,{})}render(){return u`<div class="${this.offsetWidth>440?"cq--md":""}"><slot></slot></div>`}};ts.styles=[w`:host { display: block; } div { display: grid; grid-gap: 1.5rem; align-items: flex-start; } .cq--md { grid-gap: 1.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); } ::slotted(sonic-radio), ::slotted(sonic-checkbox), ::slotted(sonic-form-actions), ::slotted(sonic-divider), ::slotted(sonic-textarea) { grid-column: 1 / -1; } ::slotted(sonic-divider) { --sc-divider-my: 0; }`],ts=pa([y(hi)],ts);try{customElements.define(hi,ts)}catch{}var ua=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,fa=(i,t,r,e)=>{for(var s=e>1?void 0:e?ga(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ua(t,r,s),s};const di="sonic-form-actions";let es=class extends v{render(){return u`<slot></slot>`}};es.styles=[w`:host{ display:flex; gap:.3rem; }`],es=fa([y(di)],es);try{customElements.define(di,es)}catch{}var ma=Object.defineProperty,va=Object.getOwnPropertyDescriptor,ba=(i,t,r,e)=>{for(var s=e>1?void 0:e?va(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ma(t,r,s),s};const pi="sonic-group";let ss=class extends v{updated(){const i=this.querySelectorAll("sonic-input, sonic-button"),t=i.length;t>1&&i.forEach((r,e)=>{e===0?(r.style.setProperty("--sc-item-rounded-tr","0"),r.style.setProperty("--sc-item-rounded-br","0")):e===t-1?(r.style.setProperty("--sc-item-rounded-tl","0"),r.style.setProperty("--sc-item-rounded-bl","0")):(r.style.setProperty("--sc-item-rounded-tr","0"),r.style.setProperty("--sc-item-rounded-br","0"),r.style.setProperty("--sc-item-rounded-tl","0"),r.style.setProperty("--sc-item-rounded-bl","0"))})}render(){return u`<slot></slot>`}};ss.styles=[w`:host { display: inline-flex; vertical-align: middle; } slot { width: 100%; display: flex; align-items: flex-end; }`],ss=ba([y(pi)],ss);try{customElements.define(pi,ss)}catch{}var ya=Object.defineProperty,wa=Object.getOwnPropertyDescriptor,mt=(i,t,r,e)=>{for(var s=e>1?void 0:e?wa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ya(t,r,s),s};const ui="sonic-image";let at=class extends v{constructor(){super(...arguments),this.rounded="none",this.src="",this.alt="",this.loading="lazy",this.ratio="auto",this.objectPosition="center center",this.imageRendering="auto",this.shadow="none",this.cover=!1}render(){const i={aspectRatio:this.cover?"auto":this.ratio,imageRendering:this.imageRendering,objectPosition:this.objectPosition};return u`<div part="image"><picture part="picture"><img part="img" src="${this.src}" loading="${this.loading}" alt="${this.alt}" style="${dt(i)}"></picture></div>`}};at.styles=[w`:host { --sc-img-radius: 0; --sc-img-bg: var(--sc-placeholder-bg); border-radius: var(--sc-img-radius); display: block; width: 100%; background: var(--sc-img-bg); } img { width: 100%; vertical-align: middle; object-fit: cover; } img[src=""] { visibility: hidden; } /*Rounded*/ :host([rounded]) { --sc-img-radius: var(--sc-rounded); overflow: hidden; } :host([rounded="sm"]) { --sc-img-radius: var(--sc-rounded-sm); } :host([rounded="md"]) { --sc-img-radius: var(--sc-rounded-md); } :host([rounded="lg"]) { --sc-img-radius: var(--sc-rounded-lg); } :host([rounded="xl"]) { --sc-img-radius: var(--sc-rounded-xl); } /*Cercle*/ :host([rounded="full"]) { --sc-img-radius: 50% !important; } :host([rounded="none"]) { --sc-img-radius: 0 !important; } /*OMBRE*/ :host([shadow]) > div, :host([shadow="md"]) > div, :host([shadow="true"]) > div { box-shadow: var(--sc-shadow); } :host([shadow="sm"]) > div { box-shadow: var(--sc-shadow-sm); } :host([shadow="none"]) > div { box-shadow: none; } :host([shadow="lg"]) > div { box-shadow: var(--sc-shadow-lg); } :host([cover]), :host([cover]) > div, :host([cover]) img { position: absolute !important; left: 0 !important; top: 0 !important; right: 0 !important; bottom: 0 !important; height: 100% !important; width: 100% !important; }`],mt([a({type:String})],at.prototype,"rounded",2),mt([a({type:String})],at.prototype,"src",2),mt([a({type:String})],at.prototype,"alt",2),mt([a({type:String})],at.prototype,"loading",2),mt([a({type:String})],at.prototype,"ratio",2),mt([a({type:String})],at.prototype,"objectPosition",2),mt([a({type:String})],at.prototype,"imageRendering",2),mt([a({type:String,reflect:!0})],at.prototype,"shadow",2),mt([a({type:Boolean,reflect:!0})],at.prototype,"cover",2),at=mt([y(ui)],at);try{customElements.define(ui,at)}catch{}var $a=Object.defineProperty,xa=Object.getOwnPropertyDescriptor,Et=(i,t,r,e)=>{for(var s=e>1?void 0:e?xa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&$a(t,r,s),s};const _a="sonic-taxonomy";let ut=class extends v{constructor(){super(...arguments),this.icon={},this.taxonomy=[],this.separator=", ",this.key="",this.type="default",this.variant="default",this.size="md"}render(){if(!this.taxonomy)return P;let i=this.key+"_display",t=this.taxonomy.filter(r=>r!=null&&(r[i]===!0||r[i]=="1"||!r.hasOwnProperty(i)));return t.length===0?(this.style.display="none",P):(this.style.removeProperty("display"),u`<sonic-badge type="${this.type}" variant="${this.variant}" size="${this.size}"><sonic-icon slot="prefix" name="${this.icon.name}" prefix="${this.icon.prefix}"></sonic-icon><span class="taxonomy-list">${Ft(t,r=>r[this.key+"_id"],r=>u`<span>${r[this.key+"_name"]}</span><span class="sonic-taxonomy-separator">${It(this.separator)}</span>`)}</span></sonic-badge>`)}};ut.styles=w`:host .sonic-taxonomy-separator:last-child { display: none; } .taxonomy-list { display: flex; flex-wrap: wrap; }`,Et([a({type:Object})],ut.prototype,"icon",2),Et([a({type:Array})],ut.prototype,"taxonomy",2),Et([a({type:String})],ut.prototype,"separator",2),Et([a({type:String})],ut.prototype,"key",2),Et([a({type:String,reflect:!0})],ut.prototype,"type",2),Et([a({type:String,reflect:!0})],ut.prototype,"variant",2),Et([a({type:String,reflect:!0})],ut.prototype,"size",2),ut=Et([y(_a)],ut);try{customElements.define("sonic-taxonomy",ut)}catch{}var ka=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,Sa=(i,t,r,e)=>{for(var s=e>1?void 0:e?Aa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ka(t,r,s),s};const gi="sonic-menu-item";let Us=class extends E{constructor(){super()}connectedCallback(){this.hasAttribute("variant")||(this.variant="ghost"),this.hasAttribute("type")||(this.type="primary"),this.hasAttribute("shape")||(this.shape="block"),this.hasAttribute("align")||(this.align="left"),super.connectedCallback()}};Us=Sa([y(gi)],Us);try{customElements.define(gi,Us)}catch{}var Pa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,gt=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ca(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Pa(t,r,s),s};const fi="sonic-menu";let it=class extends v{constructor(){super(...arguments),this.size="",this.direction="column",this.gap="var(--sc-menu-gap)",this.align="left",this.shadow=null,this.moreShape="circle",this.minWidth="0",this.hasMoreElements=!1}checkIfMore(){var i;this.hasMoreElements=!!((i=this.moreElements)!=null&&i.length)}updated(i){const t=this.querySelector(".more-btn");this.size&&t&&t.setAttribute("size",this.size),this.querySelectorAll("sonic-divider").forEach(r=>{r.hasAttribute("size")||r.setAttribute("size","xs")}),super.updated(i)}mainSlotChange(){this.setChildrenSize(this.menuChildren)}setChildrenSize(i){i.forEach(t=>{this.size&&t.setAttribute("size",this.size),this.align&&t.setAttribute("align",this.align),this.direction=="row"&&t.getAttribute("shape")=="block"&&t.setAttribute("shape","default")})}render(){const i={minWidth:this.minWidth,flexDirection:this.direction,gap:this.gap},t=this.direction=="row",r={display:"block",alignSelf:t?"center":"flex-start",justifySelf:"center",flexDirection:this.direction},e={marginLeft:t?"":".55em"};return u`<menu part="menu" class="shadowable" style="${dt(i)}"><slot @slotchange="${this.mainSlotChange}"></slot><sonic-pop style="${dt(r)}" class="${this.hasMoreElements?"":"hidden"}"><sonic-menu-item style="${dt(e)}" class="more-btn" shape="${this.moreShape}" align="center"><sonic-icon size="xl" name="${t?"more-vert":"more-horiz"}"></sonic-icon></sonic-menu-item><slot name="more" @slotchange="${this.checkIfMore}" slot="content"></slot></sonic-pop></menu>`}};it.styles=[w`:host { display: block; --sc-menu-gap:.15rem; } :host > menu { display: flex; border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); margin: 0; padding: 0.35em; } .hidden { display:none !important; } /*OMBRE*/ :host([shadow]) .shadowable, :host([shadow="md"]) .shadowable, :host([shadow="true"]) .shadowable { box-shadow: var(--sc-shadow); } :host([shadow="sm"]) .shadowable { box-shadow: var(--sc-shadow-sm); } :host([shadow="lg"]) .shadowable { box-shadow: var(--sc-shadow-lg); } :host([shadow="none"]) .shadowable { box-shadow: none; }`],gt([a({type:String,reflect:!0})],it.prototype,"size",2),gt([a({type:String,reflect:!0})],it.prototype,"direction",2),gt([a({type:String})],it.prototype,"gap",2),gt([a({type:String,reflect:!0})],it.prototype,"align",2),gt([a({type:String,reflect:!0})],it.prototype,"shadow",2),gt([a({type:String})],it.prototype,"moreShape",2),gt([a({type:String})],it.prototype,"minWidth",2),gt([Tt({selector:"sonic-menu-item"})],it.prototype,"menuChildren",2),gt([Tt({slot:"more",selector:"*"})],it.prototype,"moreElements",2),gt([Z()],it.prototype,"hasMoreElements",2),it=gt([y(fi)],it);try{customElements.define(fi,it)}catch{}var Oa=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,mi=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ea(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Oa(t,r,s),s};const vi="sonic-modal-actions";let je=class extends v{firstUpdated(){var i;(i=this.buttons)==null||i.forEach(t=>{t.addEventListener("click",()=>{var r;t.getAttribute("hideModal")!="false"&&((r=this.closest("sonic-modal"))==null||r.hide())})})}render(){return u`<slot></slot>`}};je.styles=[w`:host { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 1rem; }`],mi([Tt({selector:"sonic-button"})],je.prototype,"buttons",2),je=mi([y(vi)],je);try{customElements.define(vi,je)}catch{}var ja=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,La=(i,t,r,e)=>{for(var s=e>1?void 0:e?Da(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&ja(t,r,s),s};const bi="sonic-modal-title";let rs=class extends v{render(){return u`<slot></slot>`}};rs.styles=[w`:host { font-weight: bold; font-size: 1.5rem; display: block; line-height: var(--sc-headings-line-height); font-family: var(--sc-headings-font-family); }`],rs=La([y(bi)],rs);try{customElements.define(bi,rs)}catch{}var za=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ma=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ta(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&za(t,r,s),s};const yi="sonic-modal-subtitle";let is=class extends v{render(){return u`<slot></slot>`}};is.styles=[w`:host { font-size: 1.1rem; display: block; text-transform: uppercase; line-height: var(--sc-headings-line-height); font-family: var(--sc-headings-font-family); }`],is=Ma([y(yi)],is);try{customElements.define(yi,is)}catch{}var Ra=Object.defineProperty,Na=Object.getOwnPropertyDescriptor,Fa=(i,t,r,e)=>{for(var s=e>1?void 0:e?Na(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ra(t,r,s),s};const wi="sonic-modal-content";let os=class extends v{render(){return u`<slot></slot>`}};os.styles=[w`:host { display: block; }`],os=Fa([y(wi)],os);try{customElements.define(wi,os)}catch{}var Ia=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,Ba=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ua(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ia(t,r,s),s};const $i="sonic-modal-close";let ns=class extends v{render(){return u`<sonic-button shape="circle" variant="ghost" @click="${this.handleClick}"><sonic-icon name="cancel" size="lg"></sonic-icon></sonic-button>`}handleClick(){this.closest("sonic-modal").hide()}};ns.styles=[w`:host { position: absolute; right: 0.6rem; top: 0.6rem; z-index: 20; }`],ns=Ba([y($i)],ns);try{customElements.define($i,ns)}catch{}var Va=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,ot=(i,t,r,e)=>{for(var s=e>1?void 0:e?qa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Va(t,r,s),s};const as="sonic-modal";let H=class extends I(v){constructor(){super(...arguments),this.hideOnOverlayClick=!0,this.hideOnEscape=!0,this.align="center",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.fullScreen=!1,this.visible=!1}static create(i){const t=document.createElement(as);return t.innerHTML=`<sonic-modal-close></sonic-modal-close><sonic-modal-content>${i.content}</sonic-modal-content>`||"",(document.querySelector("sonic-theme")||document.body).appendChild(t),t.show(),t}connectedCallback(){super.connectedCallback()}updated(){const i=this;document.addEventListener("keydown",this.handleEscape),i.closeBtn.forEach(t=>{t.addEventListener("click",function(){i.hide()},{once:!0})})}render(){if(this.visible==!1)return P;this.handleFullsceen();const i={padding:this.padding,maxWidth:this.maxWidth,maxHeight:this.maxHeight,width:this.width,height:this.height,borderRadius:this.fullScreen?"0":"var(--sc-modal-rounded)"},t={maxWidth:this.maxWidth,maxHeight:this.maxHeight,width:this.width,height:this.height,borderRadius:this.fullScreen?"0":"var(--sc-modal-rounded)"};return u`<div class="modal-wrapper" style="${dt(t)}" ${Ue({out:xo})} tabindex="0"><div part="modal" class="modal custom-scroll" style="${dt(i)}" ${Ue({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}]})}><div class="modal-content"><slot></slot></div></div></div><div class="overlay" @click="${this.hideOnOverlayClick?this.hide:""}" ${Ue({keyframeOptions:{duration:500},in:_o,out:[{opacity:0,pointerEvents:"none"}]})}></div>`}show(){var i,t;this.visible=!0,(i=this.modalElement)==null||i.setAttribute("tabindex","0"),(t=this.modalElement)==null||t.focus(),this.dispatchEvent(new CustomEvent("show"))}hide(){var i;this.visible=!1,(i=this.modalElement)==null||i.setAttribute("tabindex","-1"),this.dispatchEvent(new CustomEvent("hide"))}dispose(){this.hide(),this.remove()}handleEscape(i){i.key==="Escape"&&[...document.querySelectorAll(as)].forEach(t=>{this.hideOnEscape==!0&&t.hide()})}handleFullsceen(){this.fullScreen&&(this.width="100%",this.height="100%",this.maxWidth="none",this.maxHeight="none")}};if(H.styles=[qe,w`:host { --sc-modal-py: 2.5rem; --sc-modal-px: 1.5rem; --sc-modal-content: var(--sc-base-content); --sc-modal-bg: var(--sc-base); --sc-modal-max-w: min(100vw, 64ch); --sc-modal-max-h: 80vh; --sc-modal-scrollbar-bg: var(--sc-base-300); --sc-modal-rounded: var(--sc-rounded-lg); } * { box-sizing: border-box; } .modal-wrapper { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 990; text-align: center; align-items: center; justify-content: center; flex-direction: column; display: flex; pointer-events: none; } .modal-content { overflow-y: auto; display: flex; flex-direction: column; text-align: center; align-items: center; min-height: 10rem; } .modal { background: var(--sc-base); width: 100%; box-shadow: var(--sc-shadow-lg); border-radius: var(--sc-modal-rounded) var(--sc-modal-rounded) 0 0; pointer-events: auto; /*overflow: hidden;*/ transform: translateZ(0); } .overlay { background: var(--sc-base-200); left: 0; top: 0; right: 0; bottom: 0; z-index: 900; opacity: 0.8; position: fixed; } ::slotted(sonic-modal-title) { margin-bottom: 1rem; } ::slotted(sonic-modal-subtitle) { margin-top: -0.45rem; margin-bottom: 1rem; } @media (max-width: 767.5px) { .modal-wrapper, .modal { max-width: none !important; width: 100% !important; } } @media (min-width: 768px) { .modal-wrapper { top: 50%; left: 50%; bottom: auto; right: auto; transform: translateX(-50%) translateY(-50%); } .modal { top: 50%; bottom: auto; right: auto; border-radius: var(--sc-modal-rounded); } } :host([align="left"]) .modal-content { text-align: left; align-items: flex-start; } :host([align="right"]) .modal-content { text-align: right; align-items: flex-end; } /* Border radius */ :host([rounded="none"]) modal { --sc-img-radius: 0 !important; }`],ot([a({type:Boolean,reflect:!0})],H.prototype,"hideOnOverlayClick",2),ot([a({type:Boolean,reflect:!0})],H.prototype,"hideOnEscape",2),ot([a({type:String,reflect:!0})],H.prototype,"align",2),ot([a({type:String})],H.prototype,"padding",2),ot([a({type:String})],H.prototype,"maxWidth",2),ot([a({type:String})],H.prototype,"maxHeight",2),ot([a({type:String})],H.prototype,"width",2),ot([a({type:String})],H.prototype,"height",2),ot([a({type:Boolean,reflect:!0})],H.prototype,"fullScreen",2),ot([a({type:Boolean,reflect:!0})],H.prototype,"visible",2),ot([we(".modal-wrapper")],H.prototype,"modalWrapper",2),ot([we(".modal")],H.prototype,"modalElement",2),ot([Tt({selector:"sonic-modal-close"})],H.prototype,"closeBtn",2),H=ot([y(as)],H),typeof window<"u"){let i=window;i.SonicModal=H}try{customElements.define(as,H)}catch{}var Ha=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,he=(i,t,r,e)=>{for(var s=e>1?void 0:e?Wa(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ha(t,r,s),s};const Ka={warning:"warning-circled-outline",success:"check-circled-outline",error:"warning-circled-outline",info:"info-empty",default:"info-empty"},xi="sonic-alert";let $t=class extends v{constructor(){super(...arguments),this.label="",this.text="",this.size="md",this.background=!1,this.status="default"}render(){return u`<div part="alert" class="alert"><div>${this.status&&u`<sonic-icon name="${Ka[this.status]}"></sonic-icon>`}</div><div>${this.label?u`<span class="label">${this.label} :</span>`:P} ${this.text}<slot></slot></div></div>`}};$t.styles=[w`:host { --sc-alert-color: inherit; --sc-alert-rounded: var(--sc-rounded); --sc-alert-fw: var(--sc-font-weight-base); --sc-alert-fst: var(--sc-font-style-base); --sc-alert-fs: 1rem; --sc-alert-label-fw: bold; display: block; font-size: var(--sc-alert-fs); font-weight: var(--sc-alert-fw); font-style: var(--sc-alert-fst); } .alert { color: var(--sc-alert-color); position: relative; display: flex; gap: 0.4em; line-height: 1.2; border-radius: var(--sc-alert-rounded); } .label { font-weight: var(--sc-alert-label-fw); } :host([status="warning"]) { --sc-alert-color: var(--sc-warning); } :host([status="error"]) { --sc-alert-color: var(--sc-danger); } :host([status="info"]) { --sc-alert-color: var(--sc-info); } :host([status="success"]) { --sc-alert-color: var(--sc-success); } /*background*/ :host([background]) .alert { background: var(--sc-base); padding: 0.8em 1.15em; } :host([background]) .alert:before { background-color: currentColor; content: ""; display: block; position: absolute; left: 0; top: 0; right: 0; bottom: 0; opacity: 0.08; border-radius: var(--sc-alert-rounded); pointer-events: none; } :host([background]) > div { z-index: 2; position: relative; } /*SIZE*/ :host([size="xs"]) { --sc-alert-fs: 0.75rem; } :host([size="sm"]) { --sc-alert-fs: 0.85rem; } :host([size="lg"]) { --sc-alert-fs: 1.2rem; } /*Rounded*/ :host([size="xs"]) .alert { --sc-alert-rounded: var(--sc-rounded-sm); } :host([size="sm"]) .alert { --sc-alert-rounded: var(--sc-rounded-sm); }`],he([a({type:String})],$t.prototype,"label",2),he([a({type:String})],$t.prototype,"text",2),he([a({type:String,reflect:!0})],$t.prototype,"size",2),he([a({type:Boolean,reflect:!0})],$t.prototype,"background",2),he([a({type:String,reflect:!0})],$t.prototype,"status",2),$t=he([y(xi)],$t);try{customElements.define(xi,$t)}catch{}var Ya=Object.defineProperty,Za=Object.getOwnPropertyDescriptor,de=(i,t,r,e)=>{for(var s=e>1?void 0:e?Za(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ya(t,r,s),s};const Ga="sonic-toast-message-subscriber";let Kt=class extends I(v){constructor(){super(...arguments),this._messages=[],this.success=null,this.status=null,this._message="",this._data=""}get messages(){return this._messages}set messages(i){this._messages=i,this.messages&&i.forEach(t=>{t.type=="public"&&pt.add({text:t.content,status:t.status})})}get message(){return this._message}set message(i){this._message=i,!!this.message&&this.props.success===!1&&(this.props.public_message||pt.add({text:this.message,status:"error"}))}get data(){return this._data}set data(i){this._data=i;const t={text:"Votre produit a bien \xE9t\xE9 ajout\xE9",status:"success"};Array.isArray(this.data)&&this.props.success===!0&&pt.add(t),this.data==""&&this.props.status===!0&&pt.add(t),this.props.success===!1&&(this.props.public_message||pt.add({text:this.data,status:"error"}))}render(){return P}};de([a({type:Boolean})],Kt.prototype,"success",2),de([a({type:Boolean})],Kt.prototype,"status",2),de([a({type:Array})],Kt.prototype,"messages",1),de([a({type:String})],Kt.prototype,"message",1),de([a()],Kt.prototype,"data",1),Kt=de([y(Ga)],Kt);var Xa=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,Bs=(i,t,r,e)=>{for(var s=e>1?void 0:e?Ja(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Xa(t,r,s),s};const _i="sonic-tooltip";let pe=class extends v{constructor(){super(...arguments),this.label="",this.disabled=!1}render(){let i=this.disabled||this.label==""?"disabled":"";return u`<div data-tooltip-text="${this.label.trim().replace(" "," ")}" class="tooltip ${i}"><slot></slot></div>`}};pe.styles=[w`.tooltip { position: relative; display: flex; align-items: center; text-align: center; } .tooltip:before { position: absolute; content: attr(data-tooltip-text); font-size: 0.85rem; display: block; opacity: 0; pointer-events: none; bottom: calc(100% + 0.25rem); left: 50%; transform: translateX(-50%); background: var(--sc-base-content, #111827); padding: 0.25rem; border-radius: 0.25rem; color: var(--sc-base, #fff); z-index: 999; display: none; line-height: 1.1; width: max-content; max-width: 20rem; } .tooltip:not(.disabled):hover:before { opacity: 1; display: block; }`],Bs([a({type:String})],pe.prototype,"label",2),Bs([a({type:Boolean})],pe.prototype,"disabled",2),pe=Bs([y(_i)],pe);try{customElements.define(_i,pe)}catch{}var Qa=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,Yt=(i,t,r,e)=>{for(var s=e>1?void 0:e?tl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Qa(t,r,s),s};const ki="sonic-pop";let tt=class extends v{constructor(){super(...arguments),this.open=!1,this.toggle="true",this.shadow="lg",this.placement="bottom",this.positioningRuns=!1,this.lastContentX=Number.NaN,this.lastContentY=Number.NaN}runPositioning(){!this.positioningRuns||(this.positioningRuns=!0,this._setUpMenu(this.placement),window.requestAnimationFrame(()=>this.runPositioning()))}_toggle(i){this.open&&this.toggle=="false"||i.type=="keydown"&&(i.key!="ArrowDown"||this.open)||(this.open=!this.open,this.open?this._show():this._hide())}_show(){this.open=!0,this.popContent.setAttribute("tabindex","0"),this.popBtn&&this.popContent&&!this.positioningRuns&&(this.positioningRuns=!0,this.lastContentX=Number.NaN,this.lastContentY=Number.NaN,this.runPositioning())}_hide(){this.open=!1,this.popContent.setAttribute("tabindex","-1"),this.positioningRuns=!1}_handleClosePop(i){let t=i.composedPath(),r=t[0];tt.pops.forEach(e=>{const s=t.includes(e),o=t.includes(e.querySelector('[slot="content"]')),n=ee.getAncestorAttributeValue(r,"data-on-select")==="keep";i.type=="pointerdown"&&s||i.type=="click"&&(s&&n||!o)||e._hide()})}connectedCallback(){super.connectedCallback(),tt.pops.size==0&&(document.addEventListener("pointerdown",this._handleClosePop),document.addEventListener("click",this._handleClosePop)),tt.pops.add(this)}disconnectedCallback(){super.disconnectedCallback(),tt.pops.delete(this),tt.pops.size==0&&(document.removeEventListener("pointerdown",this._handleClosePop),document.removeEventListener("click",this._handleClosePop))}_setUpMenu(i){var R;const t=(R=this.popContent)==null?void 0:R.getBoundingClientRect(),r=8,e=20,s=this.getBoundingClientRect();if(!this.offsetParent)return;let o=this.offsetParent.getBoundingClientRect(),n=s.left-o.left,l=s.top-o.top,c=n,h=l,b=l-t.height-r,f=n-t.width-2*r,g=n+s.width+2*r,$=l+s.height+r;switch(i){case"bottom":h=$;break;case"top":h=b;break;case"left":c=f;break;case"right":c=g;break}let _=window.innerWidth-g-o.left-t.width-e;_<0&&i==="right"&&(c=f),_<0&&["top","bottom"].includes(i)&&(c=Math.max(c+_,f+s.width)),-o.left-f>e&&i==="left"&&(c=g);let k=window.innerHeight-$-o.top-t.height-e;k<0&&i==="bottom"&&(h=b),k<0&&["left","right"].includes(i)&&(h=Math.max(h+k,b+s.height)),-o.top-b>-e&&i==="top"&&(h=$),this.lastContentX=c,this.lastContentY=h,Object.assign(this.popContent.style,{left:`${c}px`,top:`${h}px`})}render(){return u`<slot @click="${this._toggle}" @keydown="${this._toggle}" class="contents"></slot><slot name="content" tabindex="-1" part="content" class="${this.open?"is-open":""}"></slot>`}};tt.pops=new Set,tt.styles=[w`:host { display: inline-block; vertical-align: middle; } slot[name="content"] { background-color: var(--sc-base); position: absolute; z-index: 50; display: block; transform: translateY(1rem) scale(0.95); opacity: 0; pointer-events: none; transition-duration: 0.15s ; transition-timing-function: ease; transition-property:all; border-radius: min(calc(var(--sc-btn-rounded) * 2), 0.4em); } slot[name="content"].is-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; transition-property:scale, opacity; transition-timing-function: cubic-bezier(0.25, 0.25, 0.42, 1.225); } /*OMBRE*/ :host([shadow]) slot[name="content"], :host([shadow="md"]) slot[name="content"], :host([shadow="true"]) slot[name="content"] { box-shadow: var(--sc-shadow); } :host([shadow="sm"]) slot[name="content"] { box-shadow: var(--sc-shadow-sm); } :host([shadow="none"]) slot[name="content"] { box-shadow: none; } :host([shadow="lg"]) slot[name="content"] { box-shadow: var(--sc-shadow-lg); }`],Yt([Z()],tt.prototype,"open",2),Yt([we("slot:not([name=content])")],tt.prototype,"popBtn",2),Yt([we("slot[name=content]")],tt.prototype,"popContent",2),Yt([a({type:String})],tt.prototype,"toggle",2),Yt([a({type:String,reflect:!0})],tt.prototype,"shadow",2),Yt([a({type:String})],tt.prototype,"placement",2),tt=Yt([y(ki)],tt);try{customElements.define(ki,tt)}catch{}var el=Object.defineProperty,sl=Object.getOwnPropertyDescriptor,ue=(i,t,r,e)=>{for(var s=e>1?void 0:e?sl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&el(t,r,s),s};const rl="sonic-divider";let xt=class extends v{constructor(){super(...arguments),this.label="",this.size="md",this.align="center"}firstUpdated(){var i,t;(this.label||((i=this.slotNodes)==null?void 0:i.length))&&((t=this.divider)==null||t.classList.add("has-text"))}render(){return u`<div part="divider"><span class="text">${this.label}<slot></slot></span></div>`}};xt.styles=[w`:host { --sc-divider-my: 0.5rem; --sc-divider-mx: 0; --sc-divider-border-width: min(2px, 0.15rem); --sc-divider-border-color: var(--sc-base-200); --sc-divider-border-style: solid; --sc-divider-color: var(--sc-base-500); --sc-divider-ff: var(--sc-font-family-base); --sc-divider-fs: 1rem; --sc-divider-fw: var(--sc-font-weight-base); --sc-divider-fst: var(--sc-font-style-base); margin: var(--sc-divider-my) var(--sc-divider-mx); font-size: var(--sc-divider-fs); font-style: var(--sc-divider-fst); font-family: var(--sc-divider-ff); font-weight: var(--sc-divider-fw); color: var(--sc-divider-color); display: block; } /*SIZE*/ :host([size="xs"]) { --sc-divider-my: 0.5rem; --sc-divider-fs: 0.75rem; } :host([size="sm"]) { --sc-divider-my: 0.75rem; --sc-divider-fs: 0.85rem; } :host([size="md"]) { --sc-divider-my: 1.25rem; } :host([size="lg"]) { --sc-divider-my: 1.85rem; } :host([size="xl"]) { --sc-divider-my: 2.25rem; } :host([size="2xl"]) { --sc-divider-my: 3rem; } div { display: flex; align-items: center; width: 100%; } div:before { content: ""; flex-grow: 1; border-top: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color); width: 100%; } div:after { content: ""; flex-grow: 1; border-top: var(--sc-divider-border-width) var(--sc-divider-border-style) var(--sc-divider-border-color); width: 100%; } /*ALIGNEMENT*/ :host([align="left"]) div:before { display: none; } :host([align="right"]) div:after { display: none; } /*TEXT*/ .text { flex-shrink: 0; max-width: 80%; } .no-text .text { display: none; } .has-text { gap: 0.5rem; }`],ue([rt()],xt.prototype,"slotNodes",2),ue([we("div")],xt.prototype,"divider",2),ue([a({type:String})],xt.prototype,"label",2),ue([a({type:String,reflect:!0})],xt.prototype,"size",2),ue([a({type:String,reflect:!0})],xt.prototype,"align",2),xt=ue([y("sonic-divider")],xt);try{customElements.define(rl,xt)}catch{}var il=Object.defineProperty,ol=Object.getOwnPropertyDescriptor,nl=(i,t,r,e)=>{for(var s=e>1?void 0:e?ol(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&il(t,r,s),s};const Ai="sonic-card-header-description";let ls=class extends v{render(){return u`<div><slot></slot></div>`}};ls.styles=[w`div { margin-top: .1em; font-family: var(--sc-font-family-base); font-size: .7em; font-weight: var(--sc-font-style-base); }`],ls=nl([y(Ai)],ls);try{customElements.define(Ai,ls)}catch{}var al=Object.defineProperty,ll=Object.getOwnPropertyDescriptor,Vs=(i,t,r,e)=>{for(var s=e>1?void 0:e?ll(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&al(t,r,s),s};const Si="sonic-card-header";let ge=class extends v{render(){return u`<div class="header"><div class="header-content">${this.label} ${this.description?u`<sonic-card-header-description>${this.description}</sonic-card-header-description>`:""}<slot></slot></div><slot name="suffix"></slot></div>`}};ge.styles=[w`:host { --sc-card-header-mb: 1rem; --sc-card-header-font-size: 1.875rem; --sc-card-header-font-weight: var(--sc-headings-font-weight); --sc-card-header-font-style: var(--sc-headings-font-style); --sc-card-header-family: var(--sc-headings-font-family); --sc-card-header-line-height: var(--sc-headings-line-height); } .header { display: flex; align-items: flex-start; gap: .5em 1em; margin-bottom: var(--sc-card-header-mb); line-height: var(--sc-card-header-line-height); font-family: var(--sc-card-header-font-family); font-size: var(--sc-card-header-font-size); font-style: var(--sc-card-header-font-style); font-weight: var(--sc-card-header-font-weight); } .header-content { flex-grow: 1; } slot[name="suffix"] { flex-shrink: 0; }`],Vs([a()],ge.prototype,"label",2),Vs([a()],ge.prototype,"description",2),ge=Vs([y(Si)],ge);try{customElements.define(Si,ge)}catch{}var cl=Object.defineProperty,hl=Object.getOwnPropertyDescriptor,dl=(i,t,r,e)=>{for(var s=e>1?void 0:e?hl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&cl(t,r,s),s};const Pi="sonic-card-main";let qs=class extends v{render(){return u`<div><slot></slot></div>`}};qs=dl([y(Pi)],qs);try{customElements.define(Pi,qs)}catch{}var pl=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,gl=(i,t,r,e)=>{for(var s=e>1?void 0:e?ul(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&pl(t,r,s),s};const Ci="sonic-card-footer";let Hs=class extends v{render(){return u`<slot></slot>`}};Hs=gl([y(Ci)],Hs);try{customElements.define(Ci,Hs)}catch{}var fl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,Oi=(i,t,r,e)=>{for(var s=e>1?void 0:e?ml(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&fl(t,r,s),s};const Ei="sonic-card";let De=class extends v{constructor(){super(...arguments),this.type="default"}render(){return u`<div part="card" class="card"><slot></slot></div>`}};De.styles=[w`:host { --sc-card-padding: 1.5rem; --sc-card-color: var(--sc-base-content); --sc-card-bg: var(--sc-base); --sc-card-rounded: var(--sc-rounded-lg); --sc-card-shadow: var(--sc-shadow-lg); } .card { padding: var(--sc-card-padding); background-color: var(--sc-card-bg); border-radius: var(--sc-card-rounded); box-shadow: var(--sc-card-shadow); color: var(--sc-card-color); } /*TYPES*/ :host([type="primary"]) { --sc-card-color: var(--sc-primary-content); --sc-badge-bg: var(--sc-primary); } :host([type="warning"]) { --sc-card-color: var(--sc-warning-content); --sc-card-bg: var(--sc-warning); } :host([type="danger"]) { --sc-card-color: var(--sc-danger-content); --sc-card-bg: var(--sc-danger); } :host([type="info"]) { --sc-card-color: var(--sc-info-content); --sc-card-bg: var(--sc-info); } :host([type="success"]) { --sc-card-color: var(--sc-success-content); --sc-card-bg: var(--sc-success); } :host([type="light"]) { --sc-card-color: var(--sc-base-content); --sc-card-bg: var(--sc-base-100); } :host([type="neutral"]) { --sc-card-color: var(--sc-base); --sc-card-bg: var(--sc-base-content); } :host([type="invert"]) { --sc-card-color: var(--sc-base); --sc-card-bg: var(--sc-base-900); }`],Oi([a({type:String,reflect:!0})],De.prototype,"type",2),De=Oi([y(Ei)],De);try{customElements.define(Ei,De)}catch{}const Ws=w`:host{ --sc-color:inherit; color:var(--sc-color); } :host([type="primary"]) { --sc-color: var(--sc-primary); } :host([type="warning"]) { --sc-color: var(--sc-warning); } :host([type="danger"]) { --sc-color: var(--sc-danger); } :host([type="info"]) { --sc-color: var(--sc-info); } :host([type="success"]) { --sc-color: var(--sc-success); } .inherit-color{ color:var(--sc-color); }`;w`:host{ --sc-color:inherit; --sc-bg:inherit; color:var(--sc-color); background:var(--sc-bg); } :host([type="primary"]) { --sc-color: var(--sc-primary-content); --sc-bg: var(--sc-primary); } :host([type="warning"]) { --sc-color: var(--sc-warning-content); --sc-bg: var(--sc-warning); } :host([type="danger"]) { --sc-color: var(--sc-danger-content); --sc-bg: var(--sc-danger); } :host([type="info"]) { --sc-color: var(--sc-info-content); --sc-bg: var(--sc-info); } :host([type="success"]) { --sc-color: var(--sc-success-content); --sc-bg: var(--sc-success); } .inherit-bg{ color:inherit; }`;var vl=Object.defineProperty,bl=Object.getOwnPropertyDescriptor,yl=(i,t,r,e)=>{for(var s=e>1?void 0:e?bl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&vl(t,r,s),s};const ji="sonic-tr";let cs=class extends v{render(){return u`<slot></slot>`}};cs.styles=[Ws,w`:host { display: table-row; }`],cs=yl([y(ji)],cs);try{customElements.define(ji,cs)}catch{}var wl=Object.defineProperty,$l=Object.getOwnPropertyDescriptor,Le=(i,t,r,e)=>{for(var s=e>1?void 0:e?$l(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&wl(t,r,s),s};const Di="sonic-th";let jt=class extends v{render(){const i={textAlign:this.align,minWidth:this.minWidth};return u`<th part="th" style="${dt(i)}" colspan="${S(this.colSpan)}" rowspan="${S(this.rowSpan)}"><slot></slot></th>`}};jt.styles=[Ws,w`:host { display: contents; background:var(--sc-table-bg); position:sticky; top:0; z-index:20; } th { all: inherit; display: table-cell; border-bottom: calc(var(--sc-border-width) * 1.5) solid var(--sc-table-border-color); text-transform: var(--sc-table-th-tt); font-weight: var(--sc-table-th-fw); font-size: var(--sc-table-th-fs); padding: var(--sc-table-th-py) var(--sc-table-th-px); }`],Le([a({type:Number})],jt.prototype,"colSpan",2),Le([a({type:Number})],jt.prototype,"rowSpan",2),Le([a({type:String})],jt.prototype,"align",2),Le([a({type:String})],jt.prototype,"minWidth",2),jt=Le([y(Di)],jt);try{customElements.define(Di,jt)}catch{}var xl=Object.defineProperty,_l=Object.getOwnPropertyDescriptor,ze=(i,t,r,e)=>{for(var s=e>1?void 0:e?_l(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&xl(t,r,s),s};const Li="sonic-td";let Dt=class extends v{render(){const i={textAlign:this.align,minWidth:this.minWidth};return u`<td part="td" style="${dt(i)}" colspan="${S(this.colSpan)}" rowspan="${S(this.rowSpan)}"><slot></slot></td>`}};Dt.styles=[Ws,w`:host { display: contents; } td { all: inherit; display: table-cell; padding: var(--sc-table-td-py) var(--sc-table-td-px); }`],ze([a({type:Number})],Dt.prototype,"colSpan",2),ze([a({type:Number})],Dt.prototype,"rowSpan",2),ze([a({type:String})],Dt.prototype,"align",2),ze([a({type:String})],Dt.prototype,"minWidth",2),Dt=ze([y(Li)],Dt);try{customElements.define(Li,Dt)}catch{}var kl=Object.defineProperty,Al=Object.getOwnPropertyDescriptor,Sl=(i,t,r,e)=>{for(var s=e>1?void 0:e?Al(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&kl(t,r,s),s};const zi="sonic-thead";let hs=class extends v{render(){return u`<slot></slot>`}};hs.styles=[w`:host { display: table-header-group; }`],hs=Sl([y(zi)],hs);try{customElements.define(zi,hs)}catch{}var Pl=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Ol=(i,t,r,e)=>{for(var s=e>1?void 0:e?Cl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Pl(t,r,s),s};const Ti="sonic-tbody";let ds=class extends v{render(){return u`<tbody><slot></slot></tbody>`}};ds.styles=[w`:host { display: table-row-group; } ::slotted(sonic-tr:nth-child(odd)){ background:var(--sc-base-50); } ::slotted(sonic-tr:hover) { background:var(--sc-base-100); } ::slotted(sonic-tr:not(:last-child)){ border-bottom:var(--sc-form-border-width) solid var(--sc-base-200) !important; }`],ds=Ol([y(Ti)],ds);try{customElements.define(Ti,ds)}catch{}var El=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Dl=(i,t,r,e)=>{for(var s=e>1?void 0:e?jl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&El(t,r,s),s};const Mi="sonic-tfoot";let ps=class extends v{render(){return u`<tfoot><slot></slot></tfoot>`}};ps.styles=[w`:host { display: contents; }`],ps=Dl([y(Mi)],ps);try{customElements.define(Mi,ps)}catch{}var Ll=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,Tl=(i,t,r,e)=>{for(var s=e>1?void 0:e?zl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ll(t,r,s),s};const Ri="sonic-caption";let us=class extends v{render(){return u`<slot></slot>`}};us.styles=[w`:host { display:table-caption; font-size:.75rem; color:var(--sc-table-caption-color); padding: var(--sc-table-td-py) var(--sc-table-td-px) calc(2 * var(--sc-table-td-py) ); }`],us=Tl([y(Ri)],us);try{customElements.define(Ri,us)}catch{}var Ml=Object.defineProperty,Rl=Object.getOwnPropertyDescriptor,Zt=(i,t,r,e)=>{for(var s=e>1?void 0:e?Rl(t,r):t,o=i.length-1,n;o>=0;o--)(n=i[o])&&(s=(e?n(t,r,s):n(s))||s);return e&&s&&Ml(t,r,s),s};const Ni="sonic-table";let vt=class extends v{constructor(){super(...arguments),this.size="md",this.striped=!1,this.sticky=!1,this.bordered=!1,this.hover=!1}render(){const i={maxHeight:this.maxHeight};return u`<div class="table-container custom-scroll" style="${dt(i)}"><div class="table" ?striped="${this.striped}" ?hover="${this.hover}" ?sticky="${this.sticky}"><slot></slot></div></div>`}};vt.styles=[qe,w`:host { --sc-table-fw: var(--sc-font-weight-base); --sc-table-fst: var(--sc-font-style-base); --sc-table-fs: 1rem; --sc-table-border-color: var(--sc-base-200); --sc-table-caption-color: var(--sc-base-400); --sc-table-bg: var(--sc-base); --sc-table-th-fs: .85em; --sc-table-th-fw: bold; --sc-table-th-tt: uppercase; --sc-table-th-px: var(--sc-table-td-px); --sc-table-th-py: calc(1.8 * var(--sc-table-td-py) ); --sc-table-td-px: .5em; --sc-table-td-py: .5em; display:block; } .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; } .table { width: 100%; font-size: var(--sc-table-fs); display: table; box-sizing:border-box; } /*SIZES*/ :host([size="2xs"]) { --sc-table-fs: 0.6rem; } :host([size="xs"]) { --sc-table-fs: 0.75rem; } :host([size="sm"]) { --sc-table-fs: 0.85rem; } :host([size="lg"]) { --sc-table-fs: 1.2rem; } :host([size="xl"]) { --sc-table-fs: 1.5rem; } :host([bordered]) .table-container { border:var(--sc-border-width) solid var(--sc-table-border-color) !important; }`],Zt([a({type:String,reflect:!0})],vt.prototype,"size",2),Zt([a({type:Boolean,reflect:!0})],vt.prototype,"striped",2),Zt([a({type:Boolean,reflect:!0})],vt.prototype,"sticky",2),Zt([a({type:Boolean,reflect:!0})],vt.prototype,"bordered",2),Zt([a({type:Boolean,reflect:!0})],vt.prototype,"hover",2),Zt([a({type:String})],vt.prototype,"maxHeight",2),vt=Zt([y(Ni)],vt);try{customElements.define(Ni,vt)}catch{}let gs=window;gs.SonicPublisherManager||(gs.SonicPublisherManager=K),gs.SonicDataBindObserver||(gs.SonicDataBindObserver=At);const Nl=Ds,Fl=Es,Il=ne,Ul=Xe,Bl=I,Vl=$e;let Ks=window;Ks["concorde-mixins"]=Ks["concorde-mixins"]||{},Ks["concorde-mixins"]={Fetcher:Nl,FormCheckable:Fl,FormElement:Il,FormInput:Ul,Subscriber:Bl,TemplatesContainer:Vl};const ql=pt,Hl=H;let Ys=window;Ys["concorde-components"]=Ys["concorde-components"]||{},Ys["concorde-components"]={SonicToast:ql,SonicModal:Hl}});
|