wcs-core 7.2.1 → 7.2.2
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/dist/cjs/wcs-select_2.cjs.entry.js +8 -6
- package/dist/cjs/wcs-select_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/select/select.e2e.js +52 -0
- package/dist/collection/components/select/select.e2e.js.map +1 -1
- package/dist/collection/components/select/select.js +8 -6
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/esm/wcs-select_2.entry.js +8 -6
- package/dist/esm/wcs-select_2.entry.js.map +1 -1
- package/dist/types/components/select/select.d.ts +1 -0
- package/dist/wcs/{p-d27d4a53.entry.js → p-b94a09b6.entry.js} +2 -2
- package/dist/wcs/p-b94a09b6.entry.js.map +1 -0
- package/dist/wcs/wcs.esm.js +1 -1
- package/package.json +1 -1
- package/dist/wcs/p-d27d4a53.entry.js.map +0 -1
|
@@ -238,6 +238,7 @@ export declare class Select implements ComponentInterface, MutableAriaAttribute
|
|
|
238
238
|
* Set the autocomplete value and open the select if needed.
|
|
239
239
|
* @param filter - The new filter value
|
|
240
240
|
* @param isReset - If true, the filter is reset and the select is closed
|
|
241
|
+
* @param fromUserInteraction - If true, the change comes from user interaction (typing), if false it's programmatic
|
|
241
242
|
* @private
|
|
242
243
|
*/
|
|
243
244
|
private setAutocompleteValue;
|
|
@@ -12,5 +12,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var g=function(){g=Object.assign||function t(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s))e[s]=r[s]}return e};return g.apply(this,arguments)};function m(t,e){var r={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0)r[i]=t[i];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++){if(e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n]))r[i[n]]=t[i[n]]}return r}function k(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&i>=t.length)t=void 0;return{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(t,e){var r=typeof Symbol==="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{while((e===void 0||e-- >0)&&!(n=i.next()).done)s.push(n.value)}catch(t){o={error:t}}finally{try{if(n&&!n.done&&(r=i["return"]))r.call(i)}finally{if(o)throw o.error}}return s}function O(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++){if(s||!(i in e)){if(!s)s=Array.prototype.slice.call(e,0,i);s[i]=e[i]}}return t.concat(s||Array.prototype.slice.call(e))}var S;(function(t){t["Start"]="xstate.start";t["Stop"]="xstate.stop";t["Raise"]="xstate.raise";t["Send"]="xstate.send";t["Cancel"]="xstate.cancel";t["NullEvent"]="";t["Assign"]="xstate.assign";t["After"]="xstate.after";t["DoneState"]="done.state";t["DoneInvoke"]="done.invoke";t["Log"]="xstate.log";t["Init"]="xstate.init";t["Invoke"]="xstate.invoke";t["ErrorExecution"]="error.execution";t["ErrorCommunication"]="error.communication";t["ErrorPlatform"]="error.platform";t["ErrorCustom"]="xstate.error";t["Update"]="xstate.update";t["Pure"]="xstate.pure";t["Choose"]="xstate.choose"})(S||(S={}));var _;(function(t){t["Parent"]="#_parent";t["Internal"]="#_internal"})(_||(_={}));var E=S.Start;var j=S.Stop;var A=S.Raise;var z=S.Send;var C=S.Cancel;var q=S.NullEvent;var T=S.Assign;var F=S.Log;var R=S.Init;var N=S.Invoke;var L=S.ErrorPlatform;var P=S.ErrorCustom;var I=S.Update;var B=S.Choose;var M=S.Pure;var W=".";var H={};var D="xstate.guard";var U="";var V="production"==="production";var K;function J(t,e,r){if(r===void 0){r=W}var i=X(t,r);var n=X(e,r);if(yt(n)){if(yt(i)){return n===i}return false}if(yt(i)){return i in n}return Object.keys(i).every((function(t){if(!(t in n)){return false}return J(i[t],n[t])}))}function $(t){try{return yt(t)||typeof t==="number"?"".concat(t):t.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function G(t,e){try{if(wt(t)){return t}return t.toString().split(e)}catch(e){throw new Error("'".concat(t,"' is not a valid state path."))}}function Q(t){return typeof t==="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function X(t,e){if(Q(t)){return t.value}if(wt(t)){return Y(t)}if(typeof t!=="string"){return t}var r=G(t,e);return Y(r)}function Y(t){if(t.length===1){return t[0]}var e={};var r=e;for(var i=0;i<t.length-1;i++){if(i===t.length-2){r[t[i]]=t[i+1]}else{r[t[i]]={};r=r[t[i]]}}return e}function Z(t,e){var r={};var i=Object.keys(t);for(var n=0;n<i.length;n++){var s=i[n];r[s]=e(t[s],s,t,n)}return r}function tt(t,e,r){var i,n;var s={};try{for(var o=k(Object.keys(t)),c=o.next();!c.done;c=o.next()){var a=c.value;var l=t[a];if(!r(l)){continue}s[a]=e(l,a,t)}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=o.return))n.call(o)}finally{if(i)throw i.error}}return s}var et=function(t){return function(e){var r,i;var n=e;try{for(var s=k(t),o=s.next();!o.done;o=s.next()){var c=o.value;n=n[c]}}catch(t){r={error:t}}finally{try{if(o&&!o.done&&(i=s.return))i.call(s)}finally{if(r)throw r.error}}return n}};function rt(t,e){return function(r){var i,n;var s=r;try{for(var o=k(t),c=o.next();!c.done;c=o.next()){var a=c.value;s=s[e][a]}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=o.return))n.call(o)}finally{if(i)throw i.error}}return s}}function it(t){if(!t){return[[]]}if(yt(t)){return[[t]]}var e=nt(Object.keys(t).map((function(e){var r=t[e];if(typeof r!=="string"&&(!r||!Object.keys(r).length)){return[[e]]}return it(t[e]).map((function(t){return[e].concat(t)}))})));return e}function nt(t){var e;return(e=[]).concat.apply(e,O([],x(t),false))}function st(t){if(wt(t)){return t}return[t]}function ot(t){if(t===undefined){return[]}return st(t)}function ct(t,e,r){var i,n;if(bt(t)){return t(e,r.data)}var s={};try{for(var o=k(Object.keys(t)),c=o.next();!c.done;c=o.next()){var a=c.value;var l=t[a];if(bt(l)){s[a]=l(e,r.data)}else{s[a]=l}}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=o.return))n.call(o)}finally{if(i)throw i.error}}return s}function at(t){return/^(done|error)\./.test(t)}function lt(t){if(t instanceof Promise){return true}if(t!==null&&(bt(t)||typeof t==="object")&&bt(t.then)){return true}return false}function ut(t){return t!==null&&typeof t==="object"&&"transition"in t&&typeof t.transition==="function"}function ft(t,e){var r,i;var n=x([[],[]],2),s=n[0],o=n[1];try{for(var c=k(t),a=c.next();!a.done;a=c.next()){var l=a.value;if(e(l)){s.push(l)}else{o.push(l)}}}catch(t){r={error:t}}finally{try{if(a&&!a.done&&(i=c.return))i.call(c)}finally{if(r)throw r.error}}return[s,o]}function ht(t,e){return Z(t.states,(function(t,r){if(!t){return undefined}var i=(yt(e)?undefined:e[r])||(t?t.current:undefined);if(!i){return undefined}return{current:i,states:ht(t,i)}}))}function dt(t,e){return{current:e,states:ht(t,e)}}function vt(t,e,r,i){var n=t?r.reduce((function(t,r){var n,s;var o=r.assignment;var c={state:i,action:r,_event:e};var a={};if(bt(o)){a=o(t,e.data,c)}else{try{for(var l=k(Object.keys(o)),u=l.next();!u.done;u=l.next()){var f=u.value;var h=o[f];a[f]=bt(h)?h(t,e.data,c):h}}catch(t){n={error:t}}finally{try{if(u&&!u.done&&(s=l.return))s.call(l)}finally{if(n)throw n.error}}}return Object.assign({},t,a)}),t):t;return n}var pt=function(){};function wt(t){return Array.isArray(t)}function bt(t){return typeof t==="function"}function yt(t){return typeof t==="string"}function gt(t,e){if(!t){return undefined}if(yt(t)){return{type:D,name:t,predicate:e?e[t]:undefined}}if(bt(t)){return{type:D,name:t.name,predicate:t}}return t}function mt(t){try{return"subscribe"in t&&bt(t.subscribe)}catch(t){return false}}var kt=function(){return typeof Symbol==="function"&&Symbol.observable||"@@observable"}();K={},K[kt]=function(){return this},K[Symbol.observable]=function(){return this},K;function xt(t){return!!t&&"__xstatenode"in t}function Ot(t){return!!t&&typeof t.send==="function"}function St(t,e){if(yt(t)||typeof t==="number"){return g({type:t},e)}return t}function _t(t,e){if(!yt(t)&&"$$type"in t&&t.$$type==="scxml"){return t}var r=St(t);return g({name:r.type,data:r,$$type:"scxml",type:"external"},e)}function Et(t,e){var r=st(e).map((function(e){if(typeof e==="undefined"||typeof e==="string"||xt(e)){return{target:e,event:t}}return g(g({},e),{event:t})}));return r}function jt(t){if(t===undefined||t===U){return undefined}return ot(t)}function At(t,e,r,i,n){var s=t.options.guards;var o={state:n,cond:e,_event:i};if(e.type===D){return((s===null||s===void 0?void 0:s[e.name])||e.predicate)(r,i.data,o)}var c=s===null||s===void 0?void 0:s[e.type];if(!c){throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."))}return c(r,i.data,o)}function zt(t){if(typeof t==="string"){return{type:t}}return t}function Ct(t,e,r){var i=function(){};var n=typeof t==="object";var s=n?t:null;return{next:((n?t.next:t)||i).bind(s),error:((n?t.error:e)||i).bind(s),complete:((n?t.complete:r)||i).bind(s)}}function qt(t,e){return"".concat(t,":invocation[").concat(e,"]")}function Tt(t){return(t.type===A||t.type===z&&t.to===_.Internal)&&typeof t.delay!=="number"}var Ft=_t({type:R});function Rt(t,e){return e?e[t]||undefined:undefined}function Nt(t,e){var r;if(yt(t)||typeof t==="number"){var i=Rt(t,e);if(bt(i)){r={type:t,exec:i}}else if(i){r=i}else{r={type:t,exec:undefined}}}else if(bt(t)){r={type:t.name||t.toString(),exec:t}}else{var i=Rt(t.type,e);if(bt(i)){r=g(g({},t),{exec:i})}else if(i){var n=i.type||t.type;r=g(g(g({},i),t),{type:n})}else{r=t}}return r}var Lt=function(t,e){if(!t){return[]}var r=wt(t)?t:[t];return r.map((function(t){return Nt(t,e)}))};function Pt(t){var e=Nt(t);return g(g({id:yt(t)?t:e.id},e),{type:e.type})}function It(t,e){return{type:A,event:typeof t==="function"?t:St(t),delay:e?e.delay:undefined,id:e===null||e===void 0?void 0:e.id}}function Bt(t,e,r,i){var n={_event:r};var s=_t(bt(t.event)?t.event(e,r.data,n):t.event);var o;if(yt(t.delay)){var c=i&&i[t.delay];o=bt(c)?c(e,r.data,n):c}else{o=bt(t.delay)?t.delay(e,r.data,n):t.delay}return g(g({},t),{type:A,_event:s,delay:o})}function Mt(t,e){return{to:e?e.to:undefined,type:z,event:bt(t)?t:St(t),delay:e?e.delay:undefined,id:e&&e.id!==undefined?e.id:bt(t)?t.name:$(t)}}function Wt(t,e,r,i){var n={_event:r};var s=_t(bt(t.event)?t.event(e,r.data,n):t.event);var o;if(yt(t.delay)){var c=i&&i[t.delay];o=bt(c)?c(e,r.data,n):c}else{o=bt(t.delay)?t.delay(e,r.data,n):t.delay}var a=bt(t.to)?t.to(e,r.data,n):t.to;return g(g({},t),{to:a,_event:s,event:s.data,delay:o})}var Ht=function(t,e,r){return g(g({},t),{value:yt(t.expr)?t.expr:t.expr(e,r.data,{_event:r})})};var Dt=function(t){return{type:C,sendId:t}};function Ut(t){var e=Pt(t);return{type:S.Start,activity:e,exec:undefined}}function Vt(t){var e=bt(t)?t:Pt(t);return{type:S.Stop,activity:e,exec:undefined}}function Kt(t,e,r){var i=bt(t.activity)?t.activity(e,r.data):t.activity;var n=typeof i==="string"?{id:i}:i;var s={type:S.Stop,activity:n};return s}function Jt(t,e){var r=e?"#".concat(e):"";return"".concat(S.After,"(").concat(t,")").concat(r)}function $t(t,e){var r="".concat(S.DoneState,".").concat(t);var i={type:r,data:e};i.toString=function(){return r};return i}function Gt(t,e){var r="".concat(S.DoneInvoke,".").concat(t);var i={type:r,data:e};i.toString=function(){return r};return i}function Qt(t,e){var r="".concat(S.ErrorPlatform,".").concat(t);var i={type:r,data:e};i.toString=function(){return r};return i}var Xt=function(t){var e,r;var i=[];try{for(var n=k(t),s=n.next();!s.done;s=n.next()){var o=s.value;var c=0;while(c<o.actions.length){if(o.actions[c].type===T){i.push(o.actions[c]);o.actions.splice(c,1);continue}c++}}}catch(t){e={error:t}}finally{try{if(s&&!s.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}return i};function Yt(t,e,r,i,n,s,o){if(o===void 0){o=false}var c=o?[]:Xt(n);var a=c.length?vt(r,i,c,e):r;var l=o?[r]:undefined;var u=[];function f(n,c){var f;switch(c.type){case A:{var h=Bt(c,a,i,t.options.delays);if(s&&typeof h.delay==="number"){s(h,a,i)}return h}case z:var d=Wt(c,a,i,t.options.delays);if(s&&d.to!==_.Internal){if(n==="entry"){u.push(d)}else{s(d,a,i)}}return d;case F:{var v=Ht(c,a,i);s===null||s===void 0?void 0:s(v,a,i);return v}case B:{var p=c;var w=(f=p.conds.find((function(r){var n=gt(r.cond,t.options.guards);return!n||At(t,n,a,i,!s?e:undefined)})))===null||f===void 0?void 0:f.actions;if(!w){return[]}var b=x(Yt(t,e,a,i,[{type:n,actions:Lt(ot(w),t.options.actions)}],s,o),2),y=b[0],m=b[1];a=m;l===null||l===void 0?void 0:l.push(a);return y}case M:{var w=c.get(a,i.data);if(!w){return[]}var k=x(Yt(t,e,a,i,[{type:n,actions:Lt(ot(w),t.options.actions)}],s,o),2),S=k[0],E=k[1];a=E;l===null||l===void 0?void 0:l.push(a);return S}case j:{var v=Kt(c,a,i);s===null||s===void 0?void 0:s(v,r,i);return v}case T:{a=vt(a,i,[c],!s?e:undefined);l===null||l===void 0?void 0:l.push(a);break}default:var C=Nt(c,t.options.actions);var q=C.exec;if(s){s(C,a,i)}else if(q&&l){var R=l.length-1;var N=g(g({},C),{exec:function(t){var e=[];for(var r=1;r<arguments.length;r++){e[r-1]=arguments[r]}q.apply(void 0,O([l[R]],x(e),false))}});C=N}return C}}function h(t){var e,r;var n=[];try{for(var o=k(t.actions),c=o.next();!c.done;c=o.next()){var l=c.value;var h=f(t.type,l);if(h){n=n.concat(h)}}}catch(t){e={error:t}}finally{try{if(c&&!c.done&&(r=o.return))r.call(o)}finally{if(e)throw e.error}}u.forEach((function(t){s(t,a,i)}));u.length=0;return n}var d=nt(n.map(h));return[d,a]}var Zt=function(t,e){var r=e(t);return r};function te(t){var e;return e={id:t,send:function(){return void 0},subscribe:function(){return{unsubscribe:function(){return void 0}}},getSnapshot:function(){return undefined},toJSON:function(){return{id:t}}},e[kt]=function(){return this},e}function ee(t,e,r,i){var n;var s=zt(t.src);var o=(n=e===null||e===void 0?void 0:e.options.services)===null||n===void 0?void 0:n[s.type];var c=t.data?ct(t.data,r,i):undefined;var a=o?re(o,t.id,c):te(t.id);a.meta=t;return a}function re(t,e,r){var i=te(e);i.deferred=true;if(xt(t)){var n=i.state=Zt(undefined,(function(){return(r?t.withContext(r):t).initialState}));i.getSnapshot=function(){return n}}return i}function ie(t){try{return typeof t.send==="function"}catch(t){return false}}function ne(t){return ie(t)&&"id"in t}function se(t){var e;return g((e={subscribe:function(){return{unsubscribe:function(){return void 0}}},id:"anonymous",getSnapshot:function(){return undefined}},e[kt]=function(){return this},e),t)}var oe=function(t){return t.type==="atomic"||t.type==="final"};function ce(t){return Object.keys(t.states).map((function(e){return t.states[e]}))}function ae(t){return ce(t).filter((function(t){return t.type!=="history"}))}function le(t){var e=[t];if(oe(t)){return e}return e.concat(nt(ae(t).map(le)))}function ue(t,e){var r,i,n,s,o,c,a,l;var u=new Set(t);var f=he(u);var h=new Set(e);try{for(var d=k(h),v=d.next();!v.done;v=d.next()){var p=v.value;var w=p.parent;while(w&&!h.has(w)){h.add(w);w=w.parent}}}catch(t){r={error:t}}finally{try{if(v&&!v.done&&(i=d.return))i.call(d)}finally{if(r)throw r.error}}var b=he(h);try{for(var y=k(h),g=y.next();!g.done;g=y.next()){var p=g.value;if(p.type==="compound"&&(!b.get(p)||!b.get(p).length)){if(f.get(p)){f.get(p).forEach((function(t){return h.add(t)}))}else{p.initialStateNodes.forEach((function(t){return h.add(t)}))}}else{if(p.type==="parallel"){try{for(var m=(o=void 0,k(ae(p))),x=m.next();!x.done;x=m.next()){var O=x.value;if(!h.has(O)){h.add(O);if(f.get(O)){f.get(O).forEach((function(t){return h.add(t)}))}else{O.initialStateNodes.forEach((function(t){return h.add(t)}))}}}}catch(t){o={error:t}}finally{try{if(x&&!x.done&&(c=m.return))c.call(m)}finally{if(o)throw o.error}}}}}}catch(t){n={error:t}}finally{try{if(g&&!g.done&&(s=y.return))s.call(y)}finally{if(n)throw n.error}}try{for(var S=k(h),_=S.next();!_.done;_=S.next()){var p=_.value;var w=p.parent;while(w&&!h.has(w)){h.add(w);w=w.parent}}}catch(t){a={error:t}}finally{try{if(_&&!_.done&&(l=S.return))l.call(S)}finally{if(a)throw a.error}}return h}function fe(t,e){var r=e.get(t);if(!r){return{}}if(t.type==="compound"){var i=r[0];if(i){if(oe(i)){return i.key}}else{return{}}}var n={};r.forEach((function(t){n[t.key]=fe(t,e)}));return n}function he(t){var e,r;var i=new Map;try{for(var n=k(t),s=n.next();!s.done;s=n.next()){var o=s.value;if(!i.has(o)){i.set(o,[])}if(o.parent){if(!i.has(o.parent)){i.set(o.parent,[])}i.get(o.parent).push(o)}}}catch(t){e={error:t}}finally{try{if(s&&!s.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}return i}function de(t,e){var r=ue([t],e);return fe(t,he(r))}function ve(t,e){if(Array.isArray(t)){return t.some((function(t){return t===e}))}if(t instanceof Set){return t.has(e)}return false}function pe(t){return O([],x(new Set(nt(O([],x(t.map((function(t){return t.ownEvents}))),false)))),false)}function we(t,e){if(e.type==="compound"){return ae(e).some((function(e){return e.type==="final"&&ve(t,e)}))}if(e.type==="parallel"){return ae(e).every((function(e){return we(t,e)}))}return false}function be(t){if(t===void 0){t=[]}return t.reduce((function(t,e){if(e.meta!==undefined){t[e.id]=e.meta}return t}),{})}function ye(t){return new Set(nt(t.map((function(t){return t.tags}))))}function ge(t,e){if(t===e){return true}if(t===undefined||e===undefined){return false}if(yt(t)||yt(e)){return t===e}var r=Object.keys(t);var i=Object.keys(e);return r.length===i.length&&r.every((function(r){return ge(t[r],e[r])}))}function me(t){if(typeof t!=="object"||t===null){return false}return"value"in t&&"_event"in t}function ke(t,e){var r=t.exec;var i=g(g({},t),{exec:r!==undefined?function(){return r(e.context,e.event,{action:t,state:e,_event:e._event})}:undefined});return i}var xe=function(){function t(t){var e=this;var r;this.actions=[];this.activities=H;this.meta={};this.events=[];this.value=t.value;this.context=t.context;this._event=t._event;this._sessionid=t._sessionid;this.event=this._event.data;this.historyValue=t.historyValue;this.history=t.history;this.actions=t.actions||[];this.activities=t.activities||H;this.meta=be(t.configuration);this.events=t.events||[];this.matches=this.matches.bind(this);this.toStrings=this.toStrings.bind(this);this.configuration=t.configuration;this.transitions=t.transitions;this.children=t.children;this.done=!!t.done;this.tags=(r=Array.isArray(t.tags)?new Set(t.tags):t.tags)!==null&&r!==void 0?r:new Set;this.machine=t.machine;Object.defineProperty(this,"nextEvents",{get:function(){return pe(e.configuration)}})}t.from=function(e,r){if(e instanceof t){if(e.context!==r){return new t({value:e.value,context:r,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}})}return e}var i=Ft;return new t({value:e,context:r,_event:i,_sessionid:null,historyValue:undefined,history:undefined,actions:[],activities:undefined,meta:undefined,events:[],configuration:[],transitions:[],children:{}})};t.create=function(e){return new t(e)};t.inert=function(e,r){if(e instanceof t){if(!e.actions.length){return e}var i=Ft;return new t({value:e.value,context:r,_event:i,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,r)};t.prototype.toStrings=function(t,e){var r=this;if(t===void 0){t=this.value}if(e===void 0){e="."}if(yt(t)){return[t]}var i=Object.keys(t);return i.concat.apply(i,O([],x(i.map((function(i){return r.toStrings(t[i],e).map((function(t){return i+e+t}))}))),false))};t.prototype.toJSON=function(){var t=this;var e=t.tags;var r=m(t,["configuration","transitions","tags","machine"]);return g(g({},r),{tags:Array.from(e)})};t.prototype.matches=function(t){return J(t,this.value)};t.prototype.hasTag=function(t){return this.tags.has(t)};t.prototype.can=function(t){var e;var r=(e=this.machine)===null||e===void 0?void 0:e.getTransitionData(this,t);return!!(r===null||r===void 0?void 0:r.transitions.length)&&r.transitions.some((function(t){return t.target!==undefined||t.actions.length}))};return t}();var Oe={deferEvents:false};var Se=function(){function t(t){this.processingEvent=false;this.queue=[];this.initialized=false;this.options=g(g({},Oe),t)}t.prototype.initialize=function(t){this.initialized=true;if(t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()};t.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(this.queue.length!==0){throw new Error("Event queue should be empty when it is not processing events")}this.process(t);this.flushEvents()};t.prototype.clear=function(){this.queue=[]};t.prototype.flushEvents=function(){var t=this.queue.shift();while(t){this.process(t);t=this.queue.shift()}};t.prototype.process=function(t){this.processingEvent=true;try{t()}catch(t){this.clear();throw t}finally{this.processingEvent=false}};return t}();var _e=new Map;var Ee=0;var je={bookId:function(){return"x:".concat(Ee++)},register:function(t,e){_e.set(t,e);return t},get:function(t){return _e.get(t)},free:function(t){_e.delete(t)}};function Ae(){if(typeof globalThis!=="undefined"){return globalThis}if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}}function ze(){var t=Ae();if(t&&"__xstate__"in t){return t.__xstate__}return undefined}function Ce(t){if(!Ae()){return}var e=ze();if(e){e.register(t)}}function qe(t,e){if(e===void 0){e={}}var r=t.initialState;var i=new Set;var n=[];var s=false;var o=function(){if(s){return}s=true;while(n.length>0){var e=n.shift();r=t.transition(r,e,a);i.forEach((function(t){return t.next(r)}))}s=false};var c=se({id:e.id,send:function(t){n.push(t);o()},getSnapshot:function(){return r},subscribe:function(t,e,n){var s=Ct(t,e,n);i.add(s);s.next(r);return{unsubscribe:function(){i.delete(s)}}}});var a={parent:e.parent,self:c,id:e.id||"anonymous",observers:i};r=t.start?t.start(a):r;return c}var Te={sync:false,autoForward:false};var Fe;(function(t){t[t["NotStarted"]=0]="NotStarted";t[t["Running"]=1]="Running";t[t["Stopped"]=2]="Stopped"})(Fe||(Fe={}));var Re=function(){function t(e,r){if(r===void 0){r=t.defaultOptions}var i=this;this.machine=e;this.delayedEventsMap={};this.listeners=new Set;this.contextListeners=new Set;this.stopListeners=new Set;this.doneListeners=new Set;this.eventListeners=new Set;this.sendListeners=new Set;this.initialized=false;this.status=Fe.NotStarted;this.children=new Map;this.forwardTo=new Set;this._outgoingQueue=[];this.init=this.start;this.send=function(t,e){if(wt(t)){i.batch(t);return i.state}var r=_t(St(t,e));if(i.status===Fe.Stopped){return i.state}if(i.status!==Fe.Running&&!i.options.deferEvents){throw new Error('Event "'.concat(r.name,'" was sent to uninitialized service "').concat(i.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(r.data)))}i.scheduler.schedule((function(){i.forward(r);var t=i._nextState(r);i.update(t,r)}));return i._state};this.sendTo=function(t,e,r){var n=i.parent&&(e===_.Parent||i.parent.id===e);var s=n?i.parent:yt(e)?e===_.Internal?i:i.children.get(e)||je.get(e):Ot(e)?e:undefined;if(!s){if(!n){throw new Error("Unable to send event to child '".concat(e,"' from service '").concat(i.id,"'."))}return}if("machine"in s){if(i.status!==Fe.Stopped||i.parent!==s||i.state.done){var o=g(g({},t),{name:t.name===P?"".concat(Qt(i.id)):t.name,origin:i.sessionId});if(!r&&i.machine.config.predictableActionArguments){i._outgoingQueue.push([s,o])}else{s.send(o)}}}else{if(!r&&i.machine.config.predictableActionArguments){i._outgoingQueue.push([s,t.data])}else{s.send(t.data)}}};this._exec=function(t,e,r,n){if(n===void 0){n=i.machine.options.actions}var s=t.exec||Rt(t.type,n);var o=bt(s)?s:s?s.exec:t.exec;if(o){try{return o(e,r.data,!i.machine.config.predictableActionArguments?{action:t,state:i.state,_event:r}:{action:t,_event:r})}catch(t){if(i.parent){i.parent.send({type:"xstate.error",data:t})}throw t}}switch(t.type){case A:{var c=t;i.defer(c);break}case z:var a=t;if(typeof a.delay==="number"){i.defer(a);return}else{if(a.to){i.sendTo(a._event,a.to,r===Ft)}else{i.send(a._event)}}break;case C:i.cancel(t.sendId);break;case E:{if(i.status!==Fe.Running){return}var l=t.activity;if(!i.machine.config.predictableActionArguments&&!i.state.activities[l.id||l.type]){break}if(l.type===S.Invoke){var u=zt(l.src);var f=i.machine.options.services?i.machine.options.services[u.type]:undefined;var h=l.id,d=l.data;var v="autoForward"in l?l.autoForward:!!l.forward;if(!f){return}var p=d?ct(d,e,r):undefined;if(typeof f==="string"){return}var w=bt(f)?f(e,r.data,{data:p,src:u,meta:l.meta}):f;if(!w){return}var b=void 0;if(xt(w)){w=p?w.withContext(p):w;b={autoForward:v}}i.spawn(w,h,b)}else{i.spawnActivity(l)}break}case j:{i.stopChild(t.activity.id);break}case F:var y=t,g=y.label,m=y.value;if(g){i.logger(g,m)}else{i.logger(m)}break}};var n=g(g({},t.defaultOptions),r);var s=n.clock,o=n.logger,c=n.parent,a=n.id;var l=a!==undefined?a:e.id;this.id=l;this.logger=o;this.clock=s;this.parent=c;this.options=n;this.scheduler=new Se({deferEvents:this.options.deferEvents});this.sessionId=je.bookId()}Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;if(this._initialState){return this._initialState}return Zt(this,(function(){t._initialState=t.machine.initialState;return t._initialState}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:false,configurable:true});t.prototype.execute=function(t,e){var r,i;try{for(var n=k(t.actions),s=n.next();!s.done;s=n.next()){var o=s.value;this.exec(o,t,e)}}catch(t){r={error:t}}finally{try{if(s&&!s.done&&(i=n.return))i.call(n)}finally{if(r)throw r.error}}};t.prototype.update=function(t,e){var r,i,n,s,o,c,a,l;var u=this;t._sessionid=this.sessionId;this._state=t;if((!this.machine.config.predictableActionArguments||e===Ft)&&this.options.execute){this.execute(this.state)}else{var f=void 0;while(f=this._outgoingQueue.shift()){f[0].send(f[1])}}this.children.forEach((function(t){u.state.children[t.id]=t}));if(this.devTools){this.devTools.send(e.data,t)}if(t.event){try{for(var h=k(this.eventListeners),d=h.next();!d.done;d=h.next()){var v=d.value;v(t.event)}}catch(t){r={error:t}}finally{try{if(d&&!d.done&&(i=h.return))i.call(h)}finally{if(r)throw r.error}}}try{for(var p=k(this.listeners),w=p.next();!w.done;w=p.next()){var v=w.value;v(t,t.event)}}catch(t){n={error:t}}finally{try{if(w&&!w.done&&(s=p.return))s.call(p)}finally{if(n)throw n.error}}try{for(var b=k(this.contextListeners),y=b.next();!y.done;y=b.next()){var g=y.value;g(this.state.context,this.state.history?this.state.history.context:undefined)}}catch(t){o={error:t}}finally{try{if(y&&!y.done&&(c=b.return))c.call(b)}finally{if(o)throw o.error}}if(this.state.done){var m=t.configuration.find((function(t){return t.type==="final"&&t.parent===u.machine}));var x=m&&m.doneData?ct(m.doneData,t.context,e):undefined;this._doneEvent=Gt(this.id,x);try{for(var O=k(this.doneListeners),S=O.next();!S.done;S=O.next()){var v=S.value;v(this._doneEvent)}}catch(t){a={error:t}}finally{try{if(S&&!S.done&&(l=O.return))l.call(O)}finally{if(a)throw a.error}}this._stop();this._stopChildren();je.free(this.sessionId)}};t.prototype.onTransition=function(t){this.listeners.add(t);if(this.status===Fe.Running){t(this.state,this.state.event)}return this};t.prototype.subscribe=function(t,e,r){var i=this;var n=Ct(t,e,r);this.listeners.add(n.next);if(this.status!==Fe.NotStarted){n.next(this.state)}var s=function(){i.doneListeners.delete(s);i.stopListeners.delete(s);n.complete()};if(this.status===Fe.Stopped){n.complete()}else{this.onDone(s);this.onStop(s)}return{unsubscribe:function(){i.listeners.delete(n.next);i.doneListeners.delete(s);i.stopListeners.delete(s)}}};t.prototype.onEvent=function(t){this.eventListeners.add(t);return this};t.prototype.onSend=function(t){this.sendListeners.add(t);return this};t.prototype.onChange=function(t){this.contextListeners.add(t);return this};t.prototype.onStop=function(t){this.stopListeners.add(t);return this};t.prototype.onDone=function(t){if(this.status===Fe.Stopped&&this._doneEvent){t(this._doneEvent)}else{this.doneListeners.add(t)}return this};t.prototype.off=function(t){this.listeners.delete(t);this.eventListeners.delete(t);this.sendListeners.delete(t);this.stopListeners.delete(t);this.doneListeners.delete(t);this.contextListeners.delete(t);return this};t.prototype.start=function(t){var e=this;if(this.status===Fe.Running){return this}this.machine._init();je.register(this.sessionId,this);this.initialized=true;this.status=Fe.Running;var r=t===undefined?this.initialState:Zt(this,(function(){return me(t)?e.machine.resolveState(t):e.machine.resolveState(xe.from(t,e.machine.context))}));if(this.options.devTools){this.attachDev()}this.scheduler.initialize((function(){e.update(r,Ft)}));return this};t.prototype._stopChildren=function(){this.children.forEach((function(t){if(bt(t.stop)){t.stop()}}));this.children.clear()};t.prototype._stop=function(){var t,e,r,i,n,s,o,c,a,l;try{for(var u=k(this.listeners),f=u.next();!f.done;f=u.next()){var h=f.value;this.listeners.delete(h)}}catch(e){t={error:e}}finally{try{if(f&&!f.done&&(e=u.return))e.call(u)}finally{if(t)throw t.error}}try{for(var d=k(this.stopListeners),v=d.next();!v.done;v=d.next()){var h=v.value;h();this.stopListeners.delete(h)}}catch(t){r={error:t}}finally{try{if(v&&!v.done&&(i=d.return))i.call(d)}finally{if(r)throw r.error}}try{for(var p=k(this.contextListeners),w=p.next();!w.done;w=p.next()){var h=w.value;this.contextListeners.delete(h)}}catch(t){n={error:t}}finally{try{if(w&&!w.done&&(s=p.return))s.call(p)}finally{if(n)throw n.error}}try{for(var b=k(this.doneListeners),y=b.next();!y.done;y=b.next()){var h=y.value;this.doneListeners.delete(h)}}catch(t){o={error:t}}finally{try{if(y&&!y.done&&(c=b.return))c.call(b)}finally{if(o)throw o.error}}if(!this.initialized){return this}this.initialized=false;this.status=Fe.Stopped;this._initialState=undefined;try{for(var g=k(Object.keys(this.delayedEventsMap)),m=g.next();!m.done;m=g.next()){var x=m.value;this.clock.clearTimeout(this.delayedEventsMap[x])}}catch(t){a={error:t}}finally{try{if(m&&!m.done&&(l=g.return))l.call(g)}finally{if(a)throw a.error}}this.scheduler.clear();this.scheduler=new Se({deferEvents:this.options.deferEvents})};t.prototype.stop=function(){var t=this;var e=this.scheduler;this._stop();e.schedule((function(){var e=_t({type:"xstate.stop"});var r=Zt(t,(function(){var r=nt(O([],x(t.state.configuration),false).sort((function(t,e){return e.order-t.order})).map((function(e){return Lt(e.onExit,t.machine.options.actions)})));var i=x(Yt(t.machine,t.state,t.state.context,e,[{type:"exit",actions:r}],t.machine.config.predictableActionArguments?t._exec:undefined,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),n=i[0],s=i[1];var o=new xe({value:t.state.value,context:s,_event:e,_sessionid:t.sessionId,historyValue:undefined,history:t.state,actions:n.filter((function(t){return!Tt(t)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});o.changed=true;return o}));t.update(r,e);t._stopChildren();je.free(t.sessionId)}));return this};t.prototype.batch=function(t){var e=this;if(this.status===Fe.NotStarted&&this.options.deferEvents);else if(this.status!==Fe.Running){throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(!t.length){return}var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var i,n;var s=e.state;var o=false;var c=[];var a=function(t){var i=_t(t);e.forward(i);s=Zt(e,(function(){return e.machine.transition(s,i,undefined,r||undefined)}));c.push.apply(c,O([],x(e.machine.config.predictableActionArguments?s.actions:s.actions.map((function(t){return ke(t,s)}))),false));o=o||!!s.changed};try{for(var l=k(t),u=l.next();!u.done;u=l.next()){var f=u.value;a(f)}}catch(t){i={error:t}}finally{try{if(u&&!u.done&&(n=l.return))n.call(l)}finally{if(i)throw i.error}}s.changed=o;s.actions=c;e.update(s,_t(t[t.length-1]))}))};t.prototype.sender=function(t){return this.send.bind(this,t)};t.prototype._nextState=function(t,e){var r=this;if(e===void 0){e=!!this.machine.config.predictableActionArguments&&this._exec}var i=_t(t);if(i.name.indexOf(L)===0&&!this.state.nextEvents.some((function(t){return t.indexOf(L)===0}))){throw i.data.data}var n=Zt(this,(function(){return r.machine.transition(r.state,i,undefined,e||undefined)}));return n};t.prototype.nextState=function(t){return this._nextState(t,false)};t.prototype.forward=function(t){var e,r;try{for(var i=k(this.forwardTo),n=i.next();!n.done;n=i.next()){var s=n.value;var o=this.children.get(s);if(!o){throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(s,"'."))}o.send(t)}}catch(t){e={error:t}}finally{try{if(n&&!n.done&&(r=i.return))r.call(i)}finally{if(e)throw e.error}}};t.prototype.defer=function(t){var e=this;var r=this.clock.setTimeout((function(){if("to"in t&&t.to){e.sendTo(t._event,t.to,true)}else{e.send(t._event)}}),t.delay);if(t.id){this.delayedEventsMap[t.id]=r}};t.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]);delete this.delayedEventsMap[t]};t.prototype.exec=function(t,e,r){if(r===void 0){r=this.machine.options.actions}this._exec(t,e.context,e._event,r)};t.prototype.removeChild=function(t){var e;this.children.delete(t);this.forwardTo.delete(t);(e=this.state)===null||e===void 0?true:delete e.children[t]};t.prototype.stopChild=function(t){var e=this.children.get(t);if(!e){return}this.removeChild(t);if(bt(e.stop)){e.stop()}};t.prototype.spawn=function(t,e,r){if(this.status!==Fe.Running){return re(t,e)}if(lt(t)){return this.spawnPromise(Promise.resolve(t),e)}else if(bt(t)){return this.spawnCallback(t,e)}else if(ne(t)){return this.spawnActor(t,e)}else if(mt(t)){return this.spawnObservable(t,e)}else if(xt(t)){return this.spawnMachine(t,g(g({},r),{id:e}))}else if(ut(t)){return this.spawnBehavior(t,e)}else{throw new Error('Unable to spawn entity "'.concat(e,'" of type "').concat(typeof t,'".'))}};t.prototype.spawnMachine=function(e,r){var i=this;if(r===void 0){r={}}var n=new t(e,g(g({},this.options),{parent:this,id:r.id||e.id}));var s=g(g({},Te),r);if(s.sync){n.onTransition((function(t){i.send(I,{state:t,id:n.id})}))}var o=n;this.children.set(n.id,o);if(s.autoForward){this.forwardTo.add(n.id)}n.onDone((function(t){i.removeChild(n.id);i.send(_t(t,{origin:n.id}))})).start();return o};t.prototype.spawnBehavior=function(t,e){var r=qe(t,{id:e,parent:this});this.children.set(e,r);return r};t.prototype.spawnPromise=function(t,e){var r;var i=this;var n=false;var s;t.then((function(t){if(!n){s=t;i.removeChild(e);i.send(_t(Gt(e,t),{origin:e}))}}),(function(t){if(!n){i.removeChild(e);var r=Qt(e,t);try{i.send(_t(r,{origin:e}))}catch(t){if(i.devTools){i.devTools.send(r,i.state)}if(i.machine.strict){i.stop()}}}}));var o=(r={id:e,send:function(){return void 0},subscribe:function(e,r,i){var n=Ct(e,r,i);var s=false;t.then((function(t){if(s){return}n.next(t);if(s){return}n.complete()}),(function(t){if(s){return}n.error(t)}));return{unsubscribe:function(){return s=true}}},stop:function(){n=true},toJSON:function(){return{id:e}},getSnapshot:function(){return s}},r[kt]=function(){return this},r);this.children.set(e,o);return o};t.prototype.spawnCallback=function(t,e){var r;var i=this;var n=false;var s=new Set;var o=new Set;var c;var a=function(t){c=t;o.forEach((function(e){return e(t)}));if(n){return}i.send(_t(t,{origin:e}))};var l;try{l=t(a,(function(t){s.add(t)}))}catch(t){this.send(Qt(e,t))}if(lt(l)){return this.spawnPromise(l,e)}var u=(r={id:e,send:function(t){return s.forEach((function(e){return e(t)}))},subscribe:function(t){var e=Ct(t);o.add(e.next);return{unsubscribe:function(){o.delete(e.next)}}},stop:function(){n=true;if(bt(l)){l()}},toJSON:function(){return{id:e}},getSnapshot:function(){return c}},r[kt]=function(){return this},r);this.children.set(e,u);return u};t.prototype.spawnObservable=function(t,e){var r;var i=this;var n;var s=t.subscribe((function(t){n=t;i.send(_t(t,{origin:e}))}),(function(t){i.removeChild(e);i.send(_t(Qt(e,t),{origin:e}))}),(function(){i.removeChild(e);i.send(_t(Gt(e),{origin:e}))}));var o=(r={id:e,send:function(){return void 0},subscribe:function(e,r,i){return t.subscribe(e,r,i)},stop:function(){return s.unsubscribe()},getSnapshot:function(){return n},toJSON:function(){return{id:e}}},r[kt]=function(){return this},r);this.children.set(e,o);return o};t.prototype.spawnActor=function(t,e){this.children.set(e,t);return t};t.prototype.spawnActivity=function(t){var e=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:undefined;if(!e){return}var r=e(this.state.context,t);this.spawnEffect(t.id,r)};t.prototype.spawnEffect=function(t,e){var r;this.children.set(t,(r={id:t,send:function(){return void 0},subscribe:function(){return{unsubscribe:function(){return void 0}}},stop:e||undefined,getSnapshot:function(){return undefined},toJSON:function(){return{id:t}}},r[kt]=function(){return this},r))};t.prototype.attachDev=function(){var t=Ae();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var e=typeof this.options.devTools==="object"?this.options.devTools:undefined;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(g(g({name:this.id,autoPause:true,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:g({jump:false,skip:false},e?e.features:undefined)}),this.machine);this.devTools.init(this.state)}Ce(this)}};t.prototype.toJSON=function(){return{id:this.id}};t.prototype[kt]=function(){return this};t.prototype.getSnapshot=function(){if(this.status===Fe.NotStarted){return this.initialState}return this._state};t.defaultOptions={execute:true,deferEvents:true,clock:{setTimeout:function(t,e){return setTimeout(t,e)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:false};t.interpret=Ne;return t}();function Ne(t,e){var r=new Re(t,e);return r}function Le(t){if(typeof t==="string"){var e={type:t};e.toString=function(){return t};return e}return t}function Pe(t){return g(g({type:N},t),{toJSON:function(){var e=m(t,["onDone","onError"]);return g(g({},e),{type:N,src:Le(t.src)})}})}var Ie="";var Be="#";var Me="*";var We={};var He=function(t){return t[0]===Be};var De=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}};var Ue=function(t,e,r){r.slice(0,-1).some((function(t){return!("cond"in t)&&!("in"in t)&&(yt(t.target)||xt(t.target))}))};var Ve=function(){function t(e,r,i,n){if(i===void 0){i="context"in e?e.context:undefined}var s=this;var o;this.config=e;this._context=i;this.order=-1;this.__xstatenode=true;this.__cache={events:undefined,relativeValue:new Map,initialStateValue:undefined,initialState:undefined,on:undefined,transitions:undefined,candidates:{},delayedTransitions:undefined};this.idMap={};this.tags=[];this.options=Object.assign(De(),r);this.parent=n===null||n===void 0?void 0:n.parent;this.key=this.config.key||(n===null||n===void 0?void 0:n.key)||this.config.id||"(machine)";this.machine=this.parent?this.parent.machine:this;this.path=this.parent?this.parent.path.concat(this.key):[];this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:W);this.id=this.config.id||O([this.machine.key],x(this.path),false).join(this.delimiter);this.version=this.parent?this.parent.version:this.config.version;this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic");this.schema=this.parent?this.machine.schema:(o=this.config.schema)!==null&&o!==void 0?o:{};this.description=this.config.description;this.initial=this.config.initial;this.states=this.config.states?Z(this.config.states,(function(e,r){var i;var n=new t(e,{},undefined,{parent:s,key:r});Object.assign(s.idMap,g((i={},i[n.id]=n,i),n.idMap));return n})):We;var c=0;function a(t){var e,r;t.order=c++;try{for(var i=k(ce(t)),n=i.next();!n.done;n=i.next()){var s=n.value;a(s)}}catch(t){e={error:t}}finally{try{if(n&&!n.done&&(r=i.return))r.call(i)}finally{if(e)throw e.error}}}a(this);this.history=this.config.history===true?"shallow":this.config.history||false;this._transient=!!this.config.always||(!this.config.on?false:Array.isArray(this.config.on)?this.config.on.some((function(t){var e=t.event;return e===Ie})):Ie in this.config.on);this.strict=!!this.config.strict;this.onEntry=ot(this.config.entry||this.config.onEntry).map((function(t){return Nt(t)}));this.onExit=ot(this.config.exit||this.config.onExit).map((function(t){return Nt(t)}));this.meta=this.config.meta;this.doneData=this.type==="final"?this.config.data:undefined;this.invoke=ot(this.config.invoke).map((function(t,e){var r,i;if(xt(t)){var n=qt(s.id,e);s.machine.options.services=g((r={},r[n]=t,r),s.machine.options.services);return Pe({src:n,id:n})}else if(yt(t.src)){var n=t.id||qt(s.id,e);return Pe(g(g({},t),{id:n,src:t.src}))}else if(xt(t.src)||bt(t.src)){var n=t.id||qt(s.id,e);s.machine.options.services=g((i={},i[n]=t.src,i),s.machine.options.services);return Pe(g(g({id:n},t),{src:n}))}else{var o=t.src;return Pe(g(g({id:qt(s.id,e)},t),{src:o}))}}));this.activities=ot(this.config.activities).concat(this.invoke).map((function(t){return Pt(t)}));this.transition=this.transition.bind(this);this.tags=ot(this.config.tags)}t.prototype._init=function(){if(this.__cache.transitions){return}le(this).forEach((function(t){return t.on}))};t.prototype.withConfig=function(e,r){var i=this.options,n=i.actions,s=i.activities,o=i.guards,c=i.services,a=i.delays;return new t(this.config,{actions:g(g({},n),e.actions),activities:g(g({},s),e.activities),guards:g(g({},o),e.guards),services:g(g({},c),e.services),delays:g(g({},a),e.delays)},r!==null&&r!==void 0?r:this.context)};t.prototype.withContext=function(e){return new t(this.config,this.options,e)};Object.defineProperty(t.prototype,"context",{get:function(){return bt(this._context)?this._context():this._context},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Z(this.states,(function(t){return t.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:false,configurable:true});t.prototype.toJSON=function(){return this.definition};Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on){return this.__cache.on}var t=this.transitions;return this.__cache.on=t.reduce((function(t,e){t[e.eventType]=t[e.eventType]||[];t[e.eventType].push(e);return t}),{})},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:false,configurable:true});t.prototype.getCandidates=function(t){if(this.__cache.candidates[t]){return this.__cache.candidates[t]}var e=t===Ie;var r=this.transitions.filter((function(r){var i=r.eventType===t;return e?i:i||r.eventType===Me}));this.__cache.candidates[t]=r;return r};t.prototype.getDelayedTransitions=function(){var t=this;var e=this.config.after;if(!e){return[]}var r=function(e,r){var i=bt(e)?"".concat(t.id,":delay[").concat(r,"]"):e;var n=Jt(i,t.id);t.onEntry.push(Mt(n,{delay:e}));t.onExit.push(Dt(n));return n};var i=wt(e)?e.map((function(t,e){var i=r(t.delay,e);return g(g({},t),{event:i})})):nt(Object.keys(e).map((function(t,i){var n=e[t];var s=yt(n)?{target:n}:n;var o=!isNaN(+t)?+t:t;var c=r(o,i);return ot(s).map((function(t){return g(g({},t),{event:c,delay:o})}))})));return i.map((function(e){var r=e.delay;return g(g({},t.formatTransition(e)),{delay:r})}))};t.prototype.getStateNodes=function(t){var e;var r=this;if(!t){return[]}var i=t instanceof xe?t.value:X(t,this.delimiter);if(yt(i)){var n=this.getStateNode(i).initial;return n!==undefined?this.getStateNodes((e={},e[i]=n,e)):[this,this.states[i]]}var s=Object.keys(i);var o=[this];o.push.apply(o,O([],x(nt(s.map((function(t){return r.getStateNode(t).getStateNodes(i[t])})))),false));return o};t.prototype.handles=function(t){var e=$(t);return this.events.includes(e)};t.prototype.resolveState=function(t){var e=t instanceof xe?t:xe.create(t);var r=Array.from(ue([],this.getStateNodes(e.value)));return new xe(g(g({},e),{value:this.resolve(e.value),configuration:r,done:we(r,this),tags:ye(r),machine:this.machine}))};t.prototype.transitionLeafNode=function(t,e,r){var i=this.getStateNode(t);var n=i.next(e,r);if(!n||!n.transitions.length){return this.next(e,r)}return n};t.prototype.transitionCompoundNode=function(t,e,r){var i=Object.keys(t);var n=this.getStateNode(i[0]);var s=n._transition(t[i[0]],e,r);if(!s||!s.transitions.length){return this.next(e,r)}return s};t.prototype.transitionParallelNode=function(t,e,r){var i,n;var s={};try{for(var o=k(Object.keys(t)),c=o.next();!c.done;c=o.next()){var a=c.value;var l=t[a];if(!l){continue}var u=this.getStateNode(a);var f=u._transition(l,e,r);if(f){s[a]=f}}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=o.return))n.call(o)}finally{if(i)throw i.error}}var h=Object.keys(s).map((function(t){return s[t]}));var d=nt(h.map((function(t){return t.transitions})));var v=h.some((function(t){return t.transitions.length>0}));if(!v){return this.next(e,r)}var p=nt(Object.keys(s).map((function(t){return s[t].configuration})));return{transitions:d,exitSet:nt(h.map((function(t){return t.exitSet}))),configuration:p,source:e,actions:nt(Object.keys(s).map((function(t){return s[t].actions})))}};t.prototype._transition=function(t,e,r){if(yt(t)){return this.transitionLeafNode(t,e,r)}if(Object.keys(t).length===1){return this.transitionCompoundNode(t,e,r)}return this.transitionParallelNode(t,e,r)};t.prototype.getTransitionData=function(t,e){return this._transition(t.value,t,_t(e))};t.prototype.next=function(t,e){var r,i;var n=this;var s=e.name;var o=[];var c=[];var a;try{for(var l=k(this.getCandidates(s)),u=l.next();!u.done;u=l.next()){var f=u.value;var h=f.cond,d=f.in;var v=t.context;var p=d?yt(d)&&He(d)?t.matches(X(this.getStateNodeById(d).path,this.delimiter)):J(X(d,this.delimiter),et(this.path.slice(0,-2))(t.value)):true;var w=false;try{w=!h||At(this.machine,h,v,e,t)}catch(t){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,"':\n").concat(t.message))}if(w&&p){if(f.target!==undefined){c=f.target}o.push.apply(o,O([],x(f.actions),false));a=f;break}}}catch(t){r={error:t}}finally{try{if(u&&!u.done&&(i=l.return))i.call(l)}finally{if(r)throw r.error}}if(!a){return undefined}if(!c.length){return{transitions:[a],exitSet:[],configuration:t.value?[this]:[],source:t,actions:o}}var b=nt(c.map((function(e){return n.getRelativeStateNodes(e,t.historyValue)})));var y=!!a.internal;return{transitions:[a],exitSet:y?[]:nt(c.map((function(t){return n.getPotentiallyReenteringNodes(t)}))),configuration:b,source:t,actions:o}};t.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order){return[this]}var e=[];var r=this;var i=t;while(r&&r!==i){e.push(r);r=r.parent}if(r!==i){return[]}e.push(i);return e};t.prototype.getActions=function(t,e,r,i,n,s,o){var c,a,l,u;var f=this;var h=s?ue([],this.getStateNodes(s.value)):[];var d=new Set;try{for(var v=k(Array.from(t).sort((function(t,e){return t.order-e.order}))),p=v.next();!p.done;p=v.next()){var w=p.value;if(!ve(h,w)||ve(r.exitSet,w)||w.parent&&d.has(w.parent)){d.add(w)}}}catch(t){c={error:t}}finally{try{if(p&&!p.done&&(a=v.return))a.call(v)}finally{if(c)throw c.error}}try{for(var b=k(h),y=b.next();!y.done;y=b.next()){var w=y.value;if(!ve(t,w)||ve(r.exitSet,w.parent)){r.exitSet.push(w)}}}catch(t){l={error:t}}finally{try{if(y&&!y.done&&(u=b.return))u.call(b)}finally{if(l)throw l.error}}r.exitSet.sort((function(t,e){return e.order-t.order}));var g=Array.from(d).sort((function(t,e){return t.order-e.order}));var m=new Set(r.exitSet);var S=nt(g.map((function(t){var e=[];if(t.type!=="final"){return e}var s=t.parent;if(!s.parent){return e}e.push($t(t.id,t.doneData),$t(s.id,t.doneData?ct(t.doneData,i,n):undefined));var o=s.parent;if(o.type==="parallel"){if(ae(o).every((function(t){return we(r.configuration,t)}))){e.push($t(o.id))}}return e})));var _=g.map((function(t){var e=t.onEntry;var r=t.activities.map((function(t){return Ut(t)}));return{type:"entry",actions:Lt(o?O(O([],x(e),false),x(r),false):O(O([],x(r),false),x(e),false),f.machine.options.actions)}})).concat({type:"state_done",actions:S.map((function(t){return It(t)}))});var E=Array.from(m).map((function(t){return{type:"exit",actions:Lt(O(O([],x(t.onExit),false),x(t.activities.map((function(t){return Vt(t)}))),false),f.machine.options.actions)}}));var j=E.concat({type:"transition",actions:Lt(r.actions,this.machine.options.actions)}).concat(_);if(e){var A=Lt(nt(O([],x(t),false).sort((function(t,e){return e.order-t.order})).map((function(t){return t.onExit}))),this.machine.options.actions).filter((function(t){return!Tt(t)}));return j.concat({type:"stop",actions:A})}return j};t.prototype.transition=function(t,e,r,i){if(t===void 0){t=this.initialState}var n=_t(e);var s;if(t instanceof xe){s=r===undefined?t:this.resolveState(xe.from(t,r))}else{var o=yt(t)?this.resolve(Y(this.getResolvedPath(t))):this.resolve(t);var c=r!==null&&r!==void 0?r:this.machine.context;s=this.resolveState(xe.from(o,c))}if(!V&&n.name===Me){throw new Error("An event cannot have the wildcard type ('".concat(Me,"')"))}if(this.strict){if(!this.events.includes(n.name)&&!at(n.name)){throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(n.name,"'"))}}var a=this._transition(s.value,s,n)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]};var l=ue([],this.getStateNodes(s.value));var u=a.configuration.length?ue(l,a.configuration):l;a.configuration=O([],x(u),false);return this.resolveTransition(a,s,s.context,i,n)};t.prototype.resolveRaisedTransition=function(t,e,r,i){var n;var s=t.actions;t=this.transition(t,e,undefined,i);t._event=r;t.event=r.data;(n=t.actions).unshift.apply(n,O([],x(s),false));return t};t.prototype.resolveTransition=function(t,e,r,i,n){var s,o,c,a;var l=this;if(n===void 0){n=Ft}var u=t.configuration;var f=!e||t.transitions.length>0;var h=f?t.configuration:e?e.configuration:[];var d=we(h,this);var v=f?de(this.machine,u):undefined;var p=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):undefined:undefined;var w=this.getActions(new Set(h),d,t,r,n,e,i);var b=e?g({},e.activities):{};try{for(var y=k(w),m=y.next();!m.done;m=y.next()){var O=m.value;try{for(var S=(c=void 0,k(O.actions)),_=S.next();!_.done;_=S.next()){var A=_.value;if(A.type===E){b[A.activity.id||A.activity.type]=A}else if(A.type===j){b[A.activity.id||A.activity.type]=false}}}catch(t){c={error:t}}finally{try{if(_&&!_.done&&(a=S.return))a.call(S)}finally{if(c)throw c.error}}}}catch(t){s={error:t}}finally{try{if(m&&!m.done&&(o=y.return))o.call(y)}finally{if(s)throw s.error}}var z=x(Yt(this,e,r,n,w,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),C=z[0],T=z[1];var F=x(ft(C,Tt),2),R=F[0],L=F[1];var P=C.filter((function(t){var e;return t.type===E&&((e=t.activity)===null||e===void 0?void 0:e.type)===N}));var B=P.reduce((function(t,e){t[e.activity.id]=ee(e.activity,l.machine,T,n);return t}),e?g({},e.children):{});var M=new xe({value:v||e.value,context:T,_event:n,_sessionid:e?e._sessionid:null,historyValue:v?p?dt(p,v):undefined:e?e.historyValue:undefined,history:!v||t.source?e:undefined,actions:v?L:[],activities:v?b:e?e.activities:{},events:[],configuration:h,transitions:t.transitions,children:B,done:d,tags:ye(h),machine:this});var W=r!==T;M.changed=n.name===I||W;var H=M.history;if(H){delete H.history}var D=!d&&(this._transient||u.some((function(t){return t._transient})));if(!f&&(!D||n.name===Ie)){return M}var U=M;if(!d){if(D){U=this.resolveRaisedTransition(U,{type:q},n,i)}while(R.length){var V=R.shift();U=this.resolveRaisedTransition(U,V._event,n,i)}}var K=U.changed||(H?!!U.actions.length||W||typeof H.value!==typeof U.value||!ge(U.value,H.value):undefined);U.changed=K;U.history=H;return U};t.prototype.getStateNode=function(t){if(He(t)){return this.machine.getStateNodeById(t)}if(!this.states){throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."))}var e=this.states[t];if(!e){throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"))}return e};t.prototype.getStateNodeById=function(t){var e=He(t)?t.slice(Be.length):t;if(e===this.id){return this}var r=this.machine.idMap[e];if(!r){throw new Error("Child state node '#".concat(e,"' does not exist on machine '").concat(this.id,"'"))}return r};t.prototype.getStateNodeByPath=function(t){if(typeof t==="string"&&He(t)){try{return this.getStateNodeById(t.slice(1))}catch(t){}}var e=G(t,this.delimiter).slice();var r=this;while(e.length){var i=e.shift();if(!i.length){break}r=r.getStateNode(i)}return r};t.prototype.resolve=function(t){var e;var r=this;if(!t){return this.initialStateValue||We}switch(this.type){case"parallel":return Z(this.initialStateValue,(function(e,i){return e?r.getStateNode(i).resolve(t[i]||e):We}));case"compound":if(yt(t)){var i=this.getStateNode(t);if(i.type==="parallel"||i.type==="compound"){return e={},e[t]=i.initialStateValue,e}return t}if(!Object.keys(t).length){return this.initialStateValue||{}}return Z(t,(function(t,e){return t?r.getStateNode(e).resolve(t):We}));default:return t||We}};t.prototype.getResolvedPath=function(t){if(He(t)){var e=this.machine.idMap[t.slice(Be.length)];if(!e){throw new Error("Unable to find state node '".concat(t,"'"))}return e.path}return G(t,this.delimiter)};Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue){return this.__cache.initialStateValue}var e;if(this.type==="parallel"){e=tt(this.states,(function(t){return t.initialStateValue||We}),(function(t){return!(t.type==="history")}))}else if(this.initial!==undefined){if(!this.states[this.initial]){throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"))}e=oe(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else{e={}}this.__cache.initialStateValue=e;return this.__cache.initialStateValue},enumerable:false,configurable:true});t.prototype.getInitialState=function(t,e){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:undefined,actions:[]},undefined,e!==null&&e!==void 0?e:this.machine.context,undefined)};Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t){throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."))}return this.getInitialState(t)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"target",{get:function(){var t;if(this.type==="history"){var e=this.config;if(yt(e.target)){t=He(e.target)?Y(this.machine.getStateNodeById(e.target).path.slice(this.path.length-1)):e.target}else{t=e.target}}return t},enumerable:false,configurable:true});t.prototype.getRelativeStateNodes=function(t,e,r){if(r===void 0){r=true}return r?t.type==="history"?t.resolveHistory(e):t.initialStateNodes:[t]};Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var t=this;if(oe(this)){return[this]}if(this.type==="compound"&&!this.initial){if(!V){pt(false,"Compound state node '".concat(this.id,"' has no initial state."))}return[this]}var e=it(this.initialStateValue);return nt(e.map((function(e){return t.getFromRelativePath(e)})))},enumerable:false,configurable:true});t.prototype.getFromRelativePath=function(t){if(!t.length){return[this]}var e=x(t),r=e[0],i=e.slice(1);if(!this.states){throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"))}var n=this.getStateNode(r);if(n.type==="history"){return n.resolveHistory()}if(!this.states[r]){throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"))}return this.states[r].getFromRelativePath(i)};t.prototype.historyValue=function(t){if(!Object.keys(this.states).length){return undefined}return{current:t||this.initialStateValue,states:tt(this.states,(function(e,r){if(!t){return e.historyValue()}var i=yt(t)?undefined:t[r];return e.historyValue(i||e.initialStateValue)}),(function(t){return!t.history}))}};t.prototype.resolveHistory=function(t){var e=this;if(this.type!=="history"){return[this]}var r=this.parent;if(!t){var i=this.target;return i?nt(it(i).map((function(t){return r.getFromRelativePath(t)}))):r.initialStateNodes}var n=rt(r.path,"states")(t).current;if(yt(n)){return[r.getStateNode(n)]}return nt(it(n).map((function(t){return e.history==="deep"?r.getFromRelativePath(t):[r.states[t[0]]]})))};Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this;var e=nt(Object.keys(this.states).map((function(e){return t.states[e].stateIds})));return[this.id].concat(e)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"events",{get:function(){var t,e,r,i;if(this.__cache.events){return this.__cache.events}var n=this.states;var s=new Set(this.ownEvents);if(n){try{for(var o=k(Object.keys(n)),c=o.next();!c.done;c=o.next()){var a=c.value;var l=n[a];if(l.states){try{for(var u=(r=void 0,k(l.events)),f=u.next();!f.done;f=u.next()){var h=f.value;s.add("".concat(h))}}catch(t){r={error:t}}finally{try{if(f&&!f.done&&(i=u.return))i.call(u)}finally{if(r)throw r.error}}}}}catch(e){t={error:e}}finally{try{if(c&&!c.done&&(e=o.return))e.call(o)}finally{if(t)throw t.error}}}return this.__cache.events=Array.from(s)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter((function(t){return!(!t.target&&!t.actions.length&&t.internal)})).map((function(t){return t.eventType})));return Array.from(t)},enumerable:false,configurable:true});t.prototype.resolveTarget=function(t){var e=this;if(t===undefined){return undefined}return t.map((function(t){if(!yt(t)){return t}var r=t[0]===e.delimiter;if(r&&!e.parent){return e.getStateNodeByPath(t.slice(1))}var i=r?e.key+t:t;if(e.parent){try{var n=e.parent.getStateNodeByPath(i);return n}catch(t){throw new Error("Invalid transition definition for state node '".concat(e.id,"':\n").concat(t.message))}}else{return e.getStateNodeByPath(i)}}))};t.prototype.formatTransition=function(t){var e=this;var r=jt(t.target);var i="internal"in t?t.internal:r?r.some((function(t){return yt(t)&&t[0]===e.delimiter})):true;var n=this.machine.options.guards;var s=this.resolveTarget(r);var o=g(g({},t),{actions:Lt(ot(t.actions)),cond:gt(t.cond,n),target:s,source:this,internal:i,eventType:t.event,toJSON:function(){return g(g({},o),{target:o.target?o.target.map((function(t){return"#".concat(t.id)})):undefined,source:"#".concat(e.id)})}});return o};t.prototype.formatTransitions=function(){var t,e;var r=this;var i;if(!this.config.on){i=[]}else if(Array.isArray(this.config.on)){i=this.config.on}else{var n=this.config.on,s=Me,o=n[s],c=o===void 0?[]:o,a=m(n,[typeof s==="symbol"?s:s+""]);i=nt(Object.keys(a).map((function(t){if(!V&&t===Ie){pt(false,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'))}var e=Et(t,a[t]);if(!V){Ue(r,t,e)}return e})).concat(Et(Me,c)))}var l=this.config.always?Et("",this.config.always):[];var u=this.config.onDone?Et(String($t(this.id)),this.config.onDone):[];if(!V){pt(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'))}var f=nt(this.invoke.map((function(t){var e=[];if(t.onDone){e.push.apply(e,O([],x(Et(String(Gt(t.id)),t.onDone)),false))}if(t.onError){e.push.apply(e,O([],x(Et(String(Qt(t.id)),t.onError)),false))}return e})));var h=this.after;var d=nt(O(O(O(O([],x(u),false),x(f),false),x(i),false),x(l),false).map((function(t){return ot(t).map((function(t){return r.formatTransition(t)}))})));try{for(var v=k(h),p=v.next();!p.done;p=v.next()){var w=p.value;d.push(w)}}catch(e){t={error:e}}finally{try{if(p&&!p.done&&(e=v.return))e.call(v)}finally{if(t)throw t.error}}return d};return t}();function Ke(t,e,r){if(r===void 0){r=t.context}return new Ve(t,e,r)}const Je=(t,e)=>t.textContent.toLowerCase().startsWith(e.toLowerCase());const $e=["m","l"];function Ge(t){return $e.includes(t)}const Qe=({disabled:e,option:r,onRemove:i})=>{const n={};if(r.chipColor){n["color"]=r.chipColor}if(r.chipBackgroundColor){n["background-color"]=r.chipBackgroundColor}return t("label",{class:"wcs-select-chip",style:n,onClick:t=>t.stopImmediatePropagation()},t("div",null,r.displayText),e?null:t("div",{onClick:()=>i(r)},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"12",viewBox:"0 0 20 12",class:"chip"},t("path",{d:"M2,0 6,4 10,0 12,2 8,6 12,10 10,12 6,8 2,12 0,10 4,6 0,2 2,0",fill:r.chipColor,transform:"translate(8 0)"}))))};function Xe(t,e,r){const i=p(t);if(i==="UNKNOWN"){return[]}switch(e){case"closed":switch(i){case"MAJ+TAB":switch(r){case"unique":case"multiple":return[];case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"MoveFocus",target:"previous"}]}break;case"DOWN_ARROW":switch(r){case"unique":return[{kind:"SelectOption",target:"next"}];case"autocomplete_multiple":case"autocomplete_unique":return[{kind:"OpenSelect"},{kind:"HighlightOption",target:"first"}];case"multiple":return[{kind:"OpenSelect"},{kind:"FocusOption",target:"first"}]}break;case"RIGHT_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":return[{kind:"SelectOption",target:"next"}];case"multiple":return[{kind:"OpenSelect"},{kind:"FocusOption",target:"first"}]}break;case"UP_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"OpenSelect"},{kind:"HighlightOption",target:"last"}];case"multiple":break;case"unique":return[{kind:"SelectOption",target:"previous"}]}break;case"LEFT_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":return[{kind:"SelectOption",target:"previous"}]}break;case"ALT+DOWN_ARROW":case"ALT+UP_ARROW":switch(r){case"unique":return[{kind:"OpenSelect"},{kind:"FocusOption",target:"first"}];case"autocomplete_unique":case"autocomplete_multiple":case"multiple":return[{kind:"OpenSelect"}]}break;case"SPACE":case"ENTER":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":case"multiple":return[{kind:"OpenSelect"},{kind:"FocusOption",target:"lastFocused"}]}break;case"ESCAPE":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"ClearAutocompleteInput"}];case"unique":case"multiple":return[]}break;case"PAGE_UP":switch(r){case"autocomplete_unique":return[];case"autocomplete_multiple":return[];case"unique":return[{kind:"SelectOption",target:"first"}];case"multiple":return[]}break;case"PAGE_DOWN":switch(r){case"autocomplete_unique":return[];case"autocomplete_multiple":return[];case"unique":return[{kind:"SelectOption",target:"last"}];case"multiple":return[]}break}break;case"opened":switch(i){case"ESCAPE":switch(r){case"unique":case"multiple":case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"CloseSelect",shouldBlur:false}]}break;case"ALT+UP_ARROW":switch(r){case"unique":case"multiple":return[{kind:"CloseSelect",shouldBlur:false}];case"autocomplete_unique":case"autocomplete_multiple":return[]}break;case"TAB":switch(r){case"autocomplete_unique":return[{kind:"SelectOption",target:"lastHighlighted"},{kind:"CloseSelect",shouldBlur:false}];case"autocomplete_multiple":return[{kind:"CloseSelect",shouldBlur:false}];case"unique":case"multiple":return[{kind:"CloseSelect",shouldBlur:true}]}break;case"MAJ+TAB":switch(r){case"autocomplete_unique":return[{kind:"SelectOption",target:"lastHighlighted"},{kind:"CloseSelect",shouldBlur:false},{kind:"MoveFocus",target:"previous"}];case"autocomplete_multiple":return[{kind:"CloseSelect",shouldBlur:false},{kind:"MoveFocus",target:"previous"}];case"unique":case"multiple":return[{kind:"CloseSelect",shouldBlur:true}]}break;case"UP_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"HighlightOption",target:"previous"}];case"unique":case"multiple":return[{kind:"FocusOption",target:"previous"}]}break;case"LEFT_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":case"multiple":return[{kind:"FocusOption",target:"previous"}]}break;case"DOWN_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"HighlightOption",target:"next"}];case"unique":case"multiple":return[{kind:"FocusOption",target:"next"}]}break;case"RIGHT_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":case"multiple":return[{kind:"FocusOption",target:"next"}]}break;case"PAGE_UP":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"HighlightOption",target:"first"}];case"unique":case"multiple":return[{kind:"FocusOption",target:"first"}]}break;case"PAGE_DOWN":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"HighlightOption",target:"last"}];case"unique":case"multiple":return[{kind:"FocusOption",target:"last"}]}break;case"ENTER":switch(r){case"autocomplete_unique":return[{kind:"SelectOption",target:"lastHighlighted"}];case"autocomplete_multiple":return[{kind:"SelectOption",target:"lastHighlighted"}]}break}break;default:throw Error("Unknown error")}return[]}const Ye=':host{--wcs-select-ligther-percentage:40;--wcs-select-control-border-radius:var(--wcs-semantic-border-radius-base);--wcs-select-text-color-disabled:var(--wcs-semantic-color-text-disabled);--wcs-select-value-color:var(--wcs-semantic-color-text-primary);--wcs-select-value-font-weight:var(--wcs-semantic-font-weight-medium);--wcs-select-placeholder-color:var(--wcs-semantic-color-text-tertiary);--wcs-select-placeholder-font-weight:var(--wcs-semantic-font-weight-roman);--wcs-select-placeholder-font-style:var(--wcs-semantic-font-style-control-placeholder);--wcs-select-options-padding:var(--wcs-semantic-spacing-base-150);--wcs-select-control-line-height:var(--wcs-semantic-font-line-height-large);--wcs-select-control-background-color:var(--wcs-semantic-color-background-control-default);--wcs-select-control-arrow-color:var(--wcs-semantic-color-foreground-action-secondary-default);--wcs-select-control-arrow-color-disabled:var(--wcs-semantic-color-foreground-disabled);--wcs-select-control-chips-gap:var(--wcs-semantic-spacing-small);--wcs-select-control-border-color-default:var(--wcs-semantic-color-border-primary);--wcs-select-control-border-color-disabled:var(--wcs-semantic-color-border-disabled);--wcs-select-control-border-color-focus:var(--wcs-semantic-color-border-control-focus);--wcs-select-control-border-color-error:var(--wcs-semantic-color-border-critical);--wcs-select-control-border-style-default:solid;--wcs-select-control-border-style-error:solid;--wcs-select-control-border-style-focus:var(--wcs-semantic-border-style-focus-control);--wcs-select-control-border-width-default:var(--wcs-semantic-border-width-default);--wcs-select-control-border-width-focus:var(--wcs-semantic-border-width-large);--wcs-select-control-padding-horizontal-m:var(--wcs-semantic-spacing-large);--wcs-select-control-padding-horizontal-l:var(--wcs-semantic-spacing-large);--wcs-select-control-height:var(--wcs-select-control-height-m);--wcs-select-control-height-m:var(--wcs-semantic-size-m);--wcs-select-control-height-l:var(--wcs-semantic-size-l);--wcs-internal-select-chip-size:var(--wcs-semantic-size-s);--wcs-select-control-font-size:var(--wcs-select-control-font-size-m, 1rem);--wcs-select-control-font-size-m:var(--wcs-semantic-font-size-m);--wcs-select-control-font-size-l:var(--wcs-semantic-font-size-l);--wcs-select-overlay-max-height:360px;--wcs-select-overlay-background-color:var(--wcs-semantic-color-background-surface-primary);--wcs-select-overlay-border-width:var(--wcs-semantic-border-width-default);--wcs-select-overlay-border-color:var(--wcs-semantic-color-border-secondary);--wcs-select-overlay-border-radius:var(--wcs-semantic-border-radius-base);--wcs-select-control-chip-color-default:var(--wcs-semantic-color-foreground-action-primary-default);--wcs-select-control-chip-color-disabled:var(--wcs-semantic-color-text-disabled);--wcs-select-control-chip-background-color-default:var(--wcs-semantic-color-background-action-primary-default);--wcs-select-control-chip-background-color-disabled:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-select-control-chip-padding-vertical:var(--wcs-semantic-spacing-small);--wcs-select-control-chip-padding-horizontal:calc(1.5 * var(--wcs-semantic-spacing-base));--wcs-select-control-chip-line-height:var(--wcs-semantic-font-line-height-large);--wcs-select-control-chip-border-radius:var(--wcs-semantic-border-radius-base);--wcs-select-control-autocomplete-padding-vertical-m:var(--wcs-semantic-spacing-small);--wcs-select-control-autocomplete-padding-vertical-l:var(--wcs-semantic-spacing-small);--wcs-select-internal-noresult-padding-horizontal:var(--wcs-semantic-spacing-base);display:block;min-height:var(--wcs-select-control-height);position:relative;outline:none;user-select:none;box-sizing:border-box}:host svg{flex-shrink:0}:host .wcs-select-control{min-height:var(--wcs-select-control-height);outline:var(--wcs-select-control-border-width-default) var(--wcs-select-control-border-style-default) var(--wcs-select-control-border-color-default);outline-offset:calc(var(--wcs-select-control-border-width-default) * -1)}:host .arrow{fill:var(--wcs-select-control-arrow-color)}:host .chip{fill:var(--wcs-select-control-chip-color-default);opacity:calc((100 - var(--wcs-select-ligther-percentage)) / 100)}:host .chip:hover{opacity:100}.wcs-select-control{box-sizing:border-box;display:flex;align-items:center;background-color:var(--wcs-select-control-background-color);border-radius:var(--wcs-select-control-border-radius);outline:var(--wcs-select-control-border-color-default) solid var(--wcs-select-control-border-width-default);outline-offset:calc(var(--wcs-select-control-border-width-default) * -1);font-size:var(--wcs-select-control-font-size, 1rem);line-height:var(--wcs-select-control-line-height);cursor:pointer;padding-left:var(--wcs-select-control-padding-horizontal-m);padding-right:calc(var(--wcs-select-control-padding-horizontal-m) - 4px)}label{cursor:pointer;transition:color 125ms ease-in;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label.wcs-select-placeholder{color:var(--wcs-select-placeholder-color);font-style:var(--wcs-select-placeholder-font-style);font-weight:var(--wcs-select-placeholder-font-weight)}label.wcs-select-value{color:var(--wcs-select-value-color);font-style:normal;font-weight:var(--wcs-select-value-font-weight)}label::after{content:"";padding:1px}.wcs-select-value-container{max-width:calc(100% - (24px + var(--wcs-semantic-spacing-base)));padding-right:8px;display:flex;flex-direction:row;gap:var(--wcs-select-control-chips-gap);align-items:center;flex-wrap:wrap}.wcs-select-chip{box-sizing:border-box;height:var(--wcs-internal-select-chip-size);line-height:var(--wcs-select-control-chip-line-height);color:var(--wcs-select-control-chip-color-default);background-color:var(--wcs-select-control-chip-background-color-default);border-radius:var(--wcs-select-control-chip-border-radius);display:flex;align-items:center;padding:var(--wcs-select-control-chip-padding-vertical) var(--wcs-select-control-chip-padding-horizontal);overflow:initial;z-index:1}.wcs-select-options{display:none;position:absolute;z-index:999999999;border:solid var(--wcs-select-overlay-border-width) var(--wcs-select-overlay-border-color);border-radius:var(--wcs-select-overlay-border-radius);max-height:var(--wcs-select-overlay-max-height);overflow-y:auto;width:calc(100% - (2 * var(--wcs-select-overlay-border-width) + 2 * var(--wcs-select-options-padding)));padding:var(--wcs-select-options-padding);background-color:var(--wcs-select-overlay-background-color)}:host(.expanded){outline-width:var(--wcs-select-control-border-width-focus)}:host(.expanded) .wcs-select-control{outline:var(--wcs-select-control-border-width-focus) var(--wcs-select-control-border-style-focus) var(--wcs-select-control-border-color-focus);outline-offset:calc(var(--wcs-select-control-border-width-focus) * -1)}:host(.expanded) .wcs-select-options{display:block}:host([aria-invalid=true]) .wcs-select-control,:host([autocomplete]):has(input[aria-invalid=true]) .wcs-select-control{outline-style:var(--wcs-select-control-border-style-error);outline-color:var(--wcs-select-control-border-color-error)}:host(:not(.expanded):focus-visible){outline-width:var(--wcs-select-control-border-width-focus)}:host(:not(.expanded):focus-visible) .wcs-select-control{outline:var(--wcs-select-control-border-width-focus) var(--wcs-select-control-border-style-focus) var(--wcs-select-control-border-color-focus);outline-offset:calc(var(--wcs-select-control-border-width-focus) * -1)}:host([disabled]){cursor:not-allowed;--wcs-select-control-background-color:var(--wcs-semantic-color-background-control-disabled)}:host([disabled]) .wcs-select-control{outline-style:var(--wcs-select-control-border-style-default);outline-color:var(--wcs-select-control-border-color-disabled)}:host([disabled]) .wcs-select-control,:host([disabled]) label{cursor:default;pointer-events:none}:host([disabled]) label{color:var(--wcs-select-text-color-disabled)}:host([disabled]) .arrow{fill:var(--wcs-select-control-arrow-color-disabled)}:host([disabled]) .wcs-select-chip{color:var(--wcs-select-control-chip-color-disabled);background-color:var(--wcs-select-control-chip-background-color-disabled)}:host([disabled]) .chip{fill:var(--wcs-select-control-chip-color-disabled)}:host([size=m]){--wcs-select-control-font-size:var(--wcs-select-control-font-size-m);--wcs-select-control-height:var(--wcs-select-control-height-m);--wcs-internal-select-chip-size:var(--wcs-select-chip-size-m)}:host([size=m]) .wcs-select-control{padding-left:var(--wcs-select-control-padding-horizontal-m);padding-right:calc(var(--wcs-select-control-padding-horizontal-m) - 4px)}:host([size=m]):host([autocomplete]) .autocomplete-field{height:calc(var(--wcs-select-control-height) - var(--wcs-select-control-autocomplete-padding-vertical-m) * 2)}:host([size=m]):host([autocomplete]) .wcs-select-value-container{padding-top:var(--wcs-select-control-autocomplete-padding-vertical-m);padding-bottom:var(--wcs-select-control-autocomplete-padding-vertical-m)}:host([size=l]){--wcs-select-control-font-size:var(--wcs-select-control-font-size-l);--wcs-select-control-height:var(--wcs-select-control-height-l);--wcs-internal-select-chip-size:var(--wcs-select-chip-size-l)}:host([size=l]) .wcs-select-control{padding-left:var(--wcs-select-control-padding-horizontal-l);padding-right:calc(var(--wcs-select-control-padding-horizontal-l) - 4px)}:host([size=l]):host([autocomplete]) .autocomplete-field{height:calc(var(--wcs-select-control-height) - var(--wcs-select-control-autocomplete-padding-vertical-l) * 2)}:host([size=l]):host([autocomplete]) .wcs-select-value-container{padding-top:var(--wcs-select-control-autocomplete-padding-vertical-l);padding-bottom:var(--wcs-select-control-autocomplete-padding-vertical-l)}:host([chips]) .wcs-select-control{flex-wrap:wrap}:host([chips]) .wcs-select-value-container{margin-top:4px;margin-bottom:4px}:host([autocomplete]) .wcs-select-value-container{margin:0;width:100%}:host([autocomplete]) input{font:unset;background-color:transparent;outline:none;border:none;padding:unset;color:var(--wcs-select-value-color);font-weight:var(--wcs-select-value-font-weight) !important;font-size:var(--wcs-select-control-font-size);line-height:inherit}:host([autocomplete]) input::placeholder{color:var(--wcs-select-placeholder-color);opacity:1;font-weight:var(--wcs-select-placeholder-font-weight);font-style:var(--wcs-select-placeholder-font-style)}:host([autocomplete]:focus-within) .wcs-select-control{outline:var(--wcs-select-control-border-width-focus) var(--wcs-select-control-border-style-focus) var(--wcs-select-control-border-color-focus);outline-offset:calc(var(--wcs-select-control-border-width-focus) * -1)}.autocomplete-field{width:0;min-width:50px;flex-grow:1}.noresult-container{padding-left:var(--wcs-select-internal-noresult-padding-horizontal);padding-right:var(--wcs-select-internal-noresult-padding-horizontal);display:flex;flex-direction:row;align-items:center;height:var(--wcs-select-control-height)}';const Ze=Ye;const tr={key:"select",initial:"closed",states:{closed:{entry:["close"],on:{CLICK:"opened",OPEN:"opened",OPTION_SELECTED:{actions:["selectOption"]}}},opened:{entry:["open"],on:{CLICK:"closed",CLOSE:"closed",OPTION_SELECTED:{actions:["selectOption"]}}}}};const er=["tabindex","title"];const rr=class{constructor(t){e(this,t);this.wcsChange=r(this,"wcsChange",7);this.wcsFocus=r(this,"wcsFocus",7);this.wcsBlur=r(this,"wcsBlur",7);this.wcsFilterChange=r(this,"wcsFilterChange",7);this.inheritedAttributes={};this.selectId=`wcs-select-${ir++}`;this.optionsId=o("OPTIONS");this.expanded=false;this.size="m";this.displayText=undefined;this.focused=undefined;this.value=undefined;this.placeholder=undefined;this.disabled=false;this.required=false;this.multiple=false;this.autocomplete=false;this.serverMode=false;this.filterFn=undefined;this.chips=false;this.name=undefined;this.compareWith=(t,e)=>b(t,e);this.showNoResultFoundLabel=false;this.autocompleteValue=undefined;this.overlayDirection="bottom"}async open(){this.stateService.send("OPEN")}async close(){this.stateService.send("CLOSE")}onValueChangeHandler(t){this.updateSelectedValue(t)}updateSelectedValue(t,e=true){var r;if(!t&&e){this.reset()}if(this.multiple){if(!Array.isArray(t)){t=[t]}this.lastModifiedOptionElement=t.length>0?(r=Array.from(this.options).find((e=>this.compareWith(e.value,t[t.length-1]))))!==null&&r!==void 0?r:null:null;if(this.serverMode){const e=c(this.values.map((t=>t.value)),t,this.compareWith);e.added.forEach((t=>{const e=Array.from(this.options).find((e=>this.compareWith(e.value,t)));if(e){this.values.push({value:e.value,displayText:e.innerText,chipColor:e.chipColor,chipBackgroundColor:e.chipBackgroundColor});e.selected=true}}));e.kept.forEach((t=>{const e=Array.from(this.options).find((e=>this.compareWith(e.value,t)));if(e){e.selected=true}}));e.removed.forEach((t=>{this.values=this.values.filter((e=>!this.compareWith(e.value,t)));const e=Array.from(this.options).find((e=>this.compareWith(e.value,t)));if(e){e.selected=false}}))}else{this.values=[];this.options.forEach((e=>{const r=t?t.findIndex((t=>this.compareWith(e.value,t)))!==-1:false;if(r){this.values.push({value:e.value,displayText:e.innerText,chipColor:e.chipColor,chipBackgroundColor:e.chipBackgroundColor})}e.selected=r}))}this.displayText=this.values.length!==0?this.values.map((t=>t.displayText)).join(", "):undefined}else{this.options.forEach((e=>{const r=this.compareWith(e.value,t);if(r){this.displayText=e.innerText;this.lastModifiedOptionElement=e;if(this.autocomplete){this.setAutocompleteValue(e.innerText)}}e.selected=r}))}}reset(){this.values=[];this.displayText=undefined;if(this.autocomplete){this.setAutocompleteValue("",true)}this.options.forEach((t=>{t.selected=false}))}componentDidLoad(){this.optionsEl=this.el.shadowRoot.querySelector(".wcs-select-options");this.controlEl=this.el.shadowRoot.querySelector(".wcs-select-control");const t=Ke(tr,this.initMachineOptions());this.stateService=Ne(t);if(this.multiple){this.values=[]}this.stateService.start();if(this.optionsEl.querySelector("slot")===null){this.replaceOptions_firefoxBefore63();this.listenDomUpdate_firefoxBefore63()}if(this.value!==undefined){this.updateSelectedValue(this.value)}this.popper=this.createPopperInstance();this.labelElement=a(this.el);if(this.labelElement){this.labelElement.id=this.selectId+"-lbl"}}createPopperInstance(){return y(this.controlEl,this.optionsEl,{placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,4]}}]})}emitChange(t){this.wcsChange.emit({value:t})}replaceOptions_firefoxBefore63(){Array.from(this.el.querySelectorAll("wcs-select-option")).forEach((t=>{if(t.parentNode===this.el){this.el.removeChild(t);this.optionsEl.appendChild(t)}}))}listenDomUpdate_firefoxBefore63(){const t=new MutationObserver((t=>{for(const e of t){if(e.type==="childList"){this.replaceOptions_firefoxBefore63()}}}));t.observe(this.el,{childList:true})}componentWillRender(){if(this.multiple){this.options.forEach((t=>t.multiple=true))}}componentWillLoad(){if(!Ge(this.size)){console.warn(`Invalid size value for wcs-select : "${this.size}". Must be one of "${$e.join(", ")}"`);this.size="m"}if(this.autocomplete){this.inheritedAttributes=Object.assign(Object.assign({},l(this.el)),u(this.el,er))}}async setAriaAttribute(t,e){if(this.autocomplete===false){f(this.el,t,e)}else{f(this.autocompleteInput,t,e)}}get options(){var t;const e=(t=this.el)===null||t===void 0?void 0:t.querySelectorAll("wcs-select-option");if(e&&e.length!==0){return e}return[]}get notDisabledOptions(){var t;const e=(t=this.el)===null||t===void 0?void 0:t.querySelectorAll("wcs-select-option:not([disabled]):not([aria-hidden])");if(e&&e.length!==0){return e}return[]}initMachineOptions(){return{actions:{open:()=>{var t;if(!this.disabled){this.expanded=true;this.focused=false;if(this.multiple===false&&this.autocomplete&&this.hasValue===false){if(this.autocompleteValue&&this.autocompleteValue!==""){this.setAutocompleteValue(this.autocompleteValue)}}this.clearHighlightOnLastHighlightedOption();if(this.notDisabledOptions.length>0){this.lastFocusedOptionElement=(t=this.lastModifiedOptionElement)!==null&&t!==void 0?t:this.notDisabledOptions[0];requestAnimationFrame((()=>{var t,e;this.autocomplete?(t=this.autocompleteInput)===null||t===void 0?void 0:t.focus():(e=this.lastFocusedOptionElement)===null||e===void 0?void 0:e.focus()}))}}},close:(t,e)=>{var r,i;if(e.type==="CLOSE"){this.clearHighlightOnLastHighlightedOption();if((r=e.value)===null||r===void 0?void 0:r.shouldBlur){this.focused=false}else{if(this.autocomplete&&((i=e.value)===null||i===void 0?void 0:i.fromKeyboard)){this.focusAutocompleteInput()}else{this.el.focus()}this.focused=true}}this.expanded=false},selectOption:(t,e)=>{if(e.type==="OPTION_SELECTED"){if(this.multiple){this.handleOptionSelectedOnMultiple(e.value.option)}else{this.handleOptionSelectedOnSingle(e.value.option);this.stateService.send("CLOSE",{value:{fromKeyboard:e.value.fromKeyboard}})}if(this.autocomplete){if(this.multiple){requestAnimationFrame((()=>{this.autocompleteInput.focus()}))}else{this.autocompleteValue=e.value.option.displayText}}this.emitChange(this.value)}}},guards:{enabled:()=>!this.disabled}}}handleOptionSelectedOnMultiple(t){const e=this.values.findIndex((e=>this.compareWith(e.value,t.value)));if(e===-1){this.value=[...this.values.map((t=>t.value)),t.value]}else{this.value=this.values.filter((e=>!this.compareWith(e.value,t.value))).map((t=>t.value))}}handleOptionSelectedOnSingle(t){this.value=t.value}disconnectedCallback(){var t;(t=this.stateService)===null||t===void 0?void 0:t.stop()}get hasValue(){return this.displayText!==undefined}onMouseUp(t){const e=h(t.target)&&(t.offsetX>t.target.clientWidth||t.offsetY>t.target.clientHeight||t.offsetY<0);const r=t.composedPath().filter((t=>{const e=t;return e.nodeName==="svg"&&e.classList.contains("chip")})).length>0;if(!e&&!r){this.stateService.send("CLICK")}}onWindowClickEvent(t){const e=t.composedPath().filter((t=>t.nodeName==="WCS-SELECT"))[0];const r=e===this.el;if(this.expanded&&!r){this.stateService.send({type:"CLOSE",value:{shouldBlur:true,fromKeyboard:false}})}}onKeyDown(t){const e=this.stateService.getSnapshot().matches("closed")?"closed":"opened";let r;if(this.autocomplete){r=this.multiple?"autocomplete_multiple":"autocomplete_unique"}else{r=this.multiple?"multiple":"unique"}const i=Xe(t,e,r);if(i.length!=0&&i.filter((t=>t.kind==="MoveFocus")).length===0){t.preventDefault()}for(const e of i){this.doActionFromKeyboardEventAssociatedAction(e,t)}}doActionFromKeyboardEventAssociatedAction(t,e){var r,i;switch(t.kind){case"CloseSelect":this.stateService.send({type:"CLOSE",value:{shouldBlur:t.shouldBlur,fromKeyboard:true}});break;case"OpenSelect":this.stateService.send("OPEN");break;case"SelectOption":switch(t.target){case"next":this.selectClosestOption("next");break;case"previous":this.selectClosestOption("previous");break;case"first":this.selectFirstOption();break;case"last":this.selectLastOption();break;case"lastHighlighted":{const t=Array.from(this.notDisabledOptions).indexOf(this.lastHighlightedOptionElement);if(t!==-1){this.lastModifiedOptionElement=this.lastHighlightedOptionElement;this.selectOption(t,true)}break}}break;case"ClearAutocompleteInput":this.autocompleteValue="";break;case"ClearHighlight":this.clearHighlightOnLastHighlightedOption();break;case"HighlightOption":switch(t.target){case"next":this.highlightClosestOption("next");break;case"previous":this.highlightClosestOption("previous");break;case"first":this.highlightFirstOption();break;case"last":this.highlightLastOption();break}break;case"FocusOption":switch(t.target){case"next":this.focusClosestOption("next");break;case"previous":this.focusClosestOption("previous");break;case"first":this.focusFirstOption();break;case"last":this.focusLastOption();break;case"lastFocused":if(this.lastFocusedOptionElement!=null){this.focusOption(Array.from(this.notDisabledOptions).indexOf(this.lastFocusedOptionElement))}break}break;case"MoveFocus":switch(t.target){case"previous":{let t=(r=this.el.previousElementSibling)!==null&&r!==void 0?r:this.el.parentElement;while(t){if(w(t))break;t=(i=t.previousElementSibling)!==null&&i!==void 0?i:t.parentElement}if(t){e.preventDefault();t.focus()}break}}break;default:throw new Error("Internal error")}}getClosestActiveOptionIndexForState(t,e){let r;switch(e){case"focused":r=this.lastFocusedOptionElement;break;case"modified":r=this.lastModifiedOptionElement;break;case"highlighted":r=this.lastHighlightedOptionElement;break;default:r=null}let i=Array.from(this.notDisabledOptions).indexOf(r);const n=0;const s=this.notDisabledOptions.length-1;if(t==="next"&&i<s){i++}else if(t==="previous"&&i>n){i--}else{if(!this.autocomplete)return"nothing";if(t==="next"&&i>=s){i=0}if(t==="previous"&&i===n){i=s}}return i}selectOption(t,e=false){const r=this.notDisabledOptions[t];if(!r)return;this.sendOptionSelectedToStateMachine({source:r,value:r.value,displayText:r.innerText},e)}selectClosestOption(t){const e=this.getClosestActiveOptionIndexForState(t,"modified");if(e==="nothing")return;this.selectOption(e,true)}selectFirstOption(){if(this.notDisabledOptions.length<1){return}this.selectOption(0,true)}selectLastOption(){if(this.notDisabledOptions.length<1){return}this.selectOption(this.notDisabledOptions.length-1,true)}focusOption(t){var e;this.lastFocusedOptionElement=this.notDisabledOptions[t];(e=this.lastFocusedOptionElement)===null||e===void 0?void 0:e.focus();this.el.setAttribute("aria-activedescendant",this.lastFocusedOptionElement.id)}focusClosestOption(t){const e=this.getClosestActiveOptionIndexForState(t,"focused");if(e==="nothing")return;this.focusOption(e)}focusFirstOption(){this.focusOption(0)}focusLastOption(){this.focusOption(this.notDisabledOptions.length-1)}selectedOptionChanged(t){this.sendOptionSelectedToStateMachine(t.detail)}sendOptionSelectedToStateMachine(t,e=false){this.stateService.send({type:"OPTION_SELECTED",value:{option:t,fromKeyboard:e}})}onSlotchange(){this.updateSelectedValue(this.value,false);if(this.autocomplete&&this.serverMode){this.showNoResultFoundLabel=this.options.length<1}if(this.multiple){this.options.forEach((t=>t.multiple=true))}}removeChip(t){this.options.forEach((e=>{if(e.value===t.value){this.sendOptionSelectedToStateMachine(Object.assign(Object.assign({},t),{source:e}))}}))}highlightOption(t){this.clearHighlightOnLastHighlightedOption();this.lastHighlightedOptionElement=this.notDisabledOptions[t];if(this.lastHighlightedOptionElement){this.lastHighlightedOptionElement.highlighted=true;this.autocompleteInput.setAttribute("aria-activedescendant",this.lastHighlightedOptionElement.id);requestAnimationFrame((()=>{this.lastHighlightedOptionElement.scrollIntoView({block:"nearest",inline:"nearest"})}))}}highlightFirstOption(){this.highlightOption(0)}highlightLastOption(){this.highlightOption(this.notDisabledOptions.length-1)}highlightClosestOption(t){const e=this.getClosestActiveOptionIndexForState(t,"highlighted");if(e==="nothing")return;this.highlightOption(e)}clearHighlightOnLastHighlightedOption(){if(this.lastHighlightedOptionElement){this.lastHighlightedOptionElement.highlighted=false;this.lastHighlightedOptionElement=null}}onAutocompleteInputEvent(t){var e;const r=(e=this.autocompleteInput.value)!==null&&e!==void 0?e:"";this.setAutocompleteValue(r);t.stopPropagation()}setAutocompleteValue(t,e=false){var r,i;this.clearHighlightOnLastHighlightedOption();const n=this.lastModifiedOptionElement==null||((r=this.lastModifiedOptionElement)===null||r===void 0?void 0:r.textContent)!==this.autocompleteValue;if(!this.expanded&&n&&!e){this.open()}if(!this.serverMode){if(t.length){const[e,r]=[[],[]];const n=(i=this.filterFn)!==null&&i!==void 0?i:Je;this.options.forEach((i=>(n(i,t)?e:r).push(i)));this.showNoResultFoundLabel=e.length===0;e.forEach((t=>{t.hidden=false;t.removeAttribute("aria-hidden")}));r.forEach((t=>{t.hidden=true;t.setAttribute("aria-hidden","true")}))}else{this.showNoResultFoundLabel=false;this.options.forEach((t=>{t.hidden=false;t.removeAttribute("aria-hidden")}))}}if(this.autocompleteValue!==t){this.autocompleteValue=t!==null&&t!==void 0?t:"";this.wcsFilterChange.emit({value:t})}}onFocus(t){if(this.autocomplete){this.focusAutocompleteInput()}this.wcsFocus.emit(t)}focusAutocompleteInput(){var t;(t=this.autocompleteInput)===null||t===void 0?void 0:t.focus()}onBlur(t){const e=t.relatedTarget;if(this.el.contains(e)){return}this.wcsBlur.emit(t)}componentDidRender(){var t;(t=this.popper)===null||t===void 0?void 0:t.update()}focusedAttributes(){return!this.disabled?{tabIndex:0}:{}}onAutocompleteFieldBlur(t){if(this.multiple===false&&this.autocomplete===true&&this.hasValue){this.autocompleteValue=this.displayText}}render(){var e;const r=`${this.labelElement?this.labelElement.innerText:""} ${this.hasValue?this.displayText:""}`.trimEnd();const n="no-result-container";return t(i,Object.assign({key:"6a973d4f68de6f668fda8b17de1da78b94076dc0",class:this.expanded?"expanded ":"",overlayDirection:this.overlayDirection},this.focusedAttributes(),{role:!this.autocomplete?"combobox":null,"aria-haspopup":!this.autocomplete?"listbox":null,"aria-owns":!this.autocomplete?this.optionsId:null,"aria-controls":!this.autocomplete?this.optionsId:null,"aria-disabled":!this.autocomplete?this.disabled?"true":null:null,"aria-required":!this.autocomplete?this.required?"true":"false":null,"aria-expanded":!this.autocomplete?this.expanded?"true":"false":null,"aria-multiselectable":!this.autocomplete?this.multiple?"true":"false":null,"aria-label":!this.autocomplete?r:null}),t("div",{key:"190343789a5d2b4227b4a9822348aa087b4bbbad",class:"wcs-select-control"},t("div",{key:"2f61ddd11d08bd25d8acf00ecfdced4a97a33320",class:"wcs-select-value-container"},this.hasValue?this.chips?this.values.map((e=>t(Qe,{disabled:this.disabled,option:e,onRemove:this.removeChip.bind(this)}))):(!this.autocomplete||this.autocomplete&&this.multiple)&&t("label",{class:"wcs-select-value"},this.displayText):!this.autocomplete&&t("label",{class:"wcs-select-placeholder"},this.placeholder),this.autocomplete&&t("input",Object.assign({key:"7f2fc76276628b45ebcbcb40f64a82acafa5e192",class:"autocomplete-field",value:this.autocompleteValue,role:"combobox","aria-haspopup":"listbox","aria-label":r,"aria-describedby":n,"aria-disabled":this.disabled?"true":null,"aria-expanded":this.expanded?"true":"false","aria-controls":this.optionsId,"aria-owns":this.optionsId,"aria-multiselectable":this.multiple?"true":"false","aria-autocomplete":"list",autocomplete:"off",disabled:this.disabled,required:this.required,onBlur:t=>this.onAutocompleteFieldBlur(t),placeholder:((e=this.values)===null||e===void 0?void 0:e.length)?null:this.placeholder,onInput:t=>this.onAutocompleteInputEvent(t),ref:t=>this.autocompleteInput=t},this.inheritedAttributes))),t(s,{key:"a6075fc5a325bc1e19cc3d62ddbffb8a3409d454",up:this.expanded})),t("div",{key:"36a6ea6029659db97f174c12a4a5ff3c4c0bfd69",class:"wcs-select-options",id:this.optionsId,role:"listbox"},t("slot",{key:"3a02c19f0b77c98807a684ae77f2612c422cb096",name:"options",onSlotchange:this.onSlotchange.bind(this)}),this.autocomplete&&this.showNoResultFoundLabel&&t("div",{key:"82ecd4b70ed11d8497e9d5d3aea0c3c95f20ec36",role:"alert",id:n,class:"noresult-container"},t("slot",{key:"607e7d9c3c112e64218d2170ca4e07aaf5cbd25c",name:"filter-no-result"},t("span",{key:"da3800fefd8f57c0d7b62e261933e3293bea2161"},"Aucun résultat")))))}get el(){return n(this)}static get watchers(){return{value:["onValueChangeHandler"]}}};let ir=0;rr.style=Ze;const nr="wcs-select-option{--wcs-select-option-height:var(--wcs-semantic-size-m);--wcs-select-option-padding-horizontal:var(--wcs-semantic-spacing-base);--wcs-select-option-padding-vertical:0;--wcs-select-option-text-font-weight:var(--wcs-semantic-font-weight-medium);--wcs-select-option-text-font-size:var(--wcs-semantic-font-size-base);--wcs-select-option-text-color-default:var(--wcs-semantic-color-text-primary);--wcs-select-option-text-color-focus:var(--wcs-semantic-color-text-primary);--wcs-select-option-text-color-hover:var(--wcs-semantic-color-text-primary);--wcs-select-option-text-color-selected:var(--wcs-semantic-color-text-primary);--wcs-select-option-text-color-disabled:var(--wcs-semantic-color-text-disabled);--wcs-select-option-background-color-default:var(--wcs-semantic-color-background-action-secondary-default);--wcs-select-option-background-color-hover:var(--wcs-semantic-color-background-action-secondary-hover);--wcs-select-option-background-color-press:var(--wcs-semantic-color-background-action-secondary-press);--wcs-select-option-background-color-selected:var(--wcs-semantic-color-background-action-secondary-selected-default);--wcs-select-option-background-color-selected-hover:var(--wcs-semantic-color-background-action-secondary-selected-hover);--wcs-select-option-background-color-selected-press:var(--wcs-semantic-color-background-action-secondary-selected-press);--wcs-select-option-background-color-selected-disabled:var(--wcs-semantic-color-background-action-secondary-selected-disabled);--wcs-select-option-background-color-focus:var(--wcs-semantic-color-background-action-secondary-focus);--wcs-select-option-border-style-focus:var(--wcs-semantic-border-style-focus-base);--wcs-select-option-border-color-focus:var(--wcs-semantic-color-border-focus-base);--wcs-select-option-border-width-focus:var(--wcs-semantic-border-width-large);--wcs-select-option-border-radius:var(--wcs-semantic-border-radius-base);--wcs-select-option-checkbox-color:var(--wcs-semantic-color-background-control-indicator-selected);--wcs-select-option-gap:var(--wcs-semantic-spacing-base);--wcs-select-option-transition-duration:var(--wcs-semantic-motion-duration-feedback-base);display:flex;flex-direction:row;align-items:center;gap:var(--wcs-select-option-gap);padding:var(--wcs-select-option-padding-vertical) var(--wcs-select-option-padding-horizontal);height:var(--wcs-select-option-height);cursor:pointer;user-select:none;font-weight:var(--wcs-select-option-text-font-weight);font-size:var(--wcs-select-option-text-font-size);color:var(--wcs-select-option-text-color-default);background-color:var(--wcs-select-option-background-color-default);transition-duration:var(--wcs-select-option-transition-duration);transition-property:background-color, color;transition-timing-function:ease;border-radius:var(--wcs-select-option-border-radius);overflow:hidden;white-space:nowrap}wcs-select-option:focus-visible{outline:var(--wcs-select-option-border-style-focus) var(--wcs-select-option-border-width-focus) var(--wcs-select-option-border-color-focus);outline-offset:calc(-1 * var(--wcs-select-option-border-width-focus))}wcs-select-option:focus{color:var(--wcs-select-option-text-color-focus);background-color:var(--wcs-select-option-background-color-focus)}wcs-select-option:hover{color:var(--wcs-select-option-text-color-hover);background-color:var(--wcs-select-option-background-color-hover)}wcs-select-option:active{background-color:var(--wcs-select-option-background-color-press)}wcs-select-option[disabled]{cursor:not-allowed;pointer-events:none;color:var(--wcs-select-option-text-color-disabled)}wcs-select-option[hidden]{display:none}wcs-select-option[selected]{color:var(--wcs-select-option-text-color-selected);background-color:var(--wcs-select-option-background-color-selected)}wcs-select-option[selected]:hover{background-color:var(--wcs-select-option-background-color-selected-hover)}wcs-select-option[selected]:active{background-color:var(--wcs-select-option-background-color-selected-press)}wcs-select-option[selected][disabled]{color:var(--wcs-select-option-text-color-disabled);background-color:var(--wcs-select-option-background-color-selected-disabled)}wcs-select-option[multiple] wcs-checkbox{pointer-events:none}wcs-select-option[multiple]:hover wcs-checkbox{--wcs-checkbox-border-color:var(--wcs-select-option-checkbox-color)}wcs-select-option[highlighted]{outline:var(--wcs-select-option-border-style-focus) var(--wcs-select-option-border-width-focus) var(--wcs-select-option-border-color-focus);outline-offset:calc(-1 * var(--wcs-select-option-border-width-focus))}wcs-select-option[highlighted] wcs-checkbox{--wcs-checkbox-border-color:var(--wcs-select-option-checkbox-color)}";const sr=nr;const or=class{constructor(t){e(this,t);this.wcsSelectOptionClick=r(this,"wcsSelectOptionClick",7);this.selectOptionId=o(this.el.tagName);this.disabled=false;this.selected=false;this.highlighted=false;this.value=undefined;this.chipColor=undefined;this.chipBackgroundColor=undefined;this.multiple=false}componentWillLoad(){if(this.value===undefined){this.value=this.el.innerText||""}}chooseOption(t){if(!this.disabled){t.stopPropagation();const e=this.el.innerText;this.wcsSelectOptionClick.emit({source:this.el,value:this.value,displayText:e})}}onMouseUp(t){this.chooseOption(t)}handleKeydown(t){if(d(t)||v(t)){this.chooseOption(t);t.preventDefault();t.stopPropagation()}}render(){return t(i,{key:"8e2f93d1db10d33df62a34b1f9e62a948a78424e",id:this.selectOptionId,"aria-selected":this.selected||this.highlighted?"true":"false",slot:"options",role:"option",tabindex:"-1"},this.multiple&&t("wcs-checkbox",{key:"3af49da773954213d7f2b64c4a2f8fd7114b6a24",tabindex:"-1",checked:this.selected,disabled:this.disabled}),t("slot",{key:"3e5267f2626863b13bbcab46f98b4eacfa90c83f"}))}get el(){return n(this)}};or.style=sr;export{rr as wcs_select,or as wcs_select_option};
|
|
16
|
-
//# sourceMappingURL=p-
|
|
15
|
+
***************************************************************************** */var g=function(){g=Object.assign||function t(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s))e[s]=r[s]}return e};return g.apply(this,arguments)};function m(t,e){var r={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0)r[i]=t[i];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++){if(e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n]))r[i[n]]=t[i[n]]}return r}function k(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&i>=t.length)t=void 0;return{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(t,e){var r=typeof Symbol==="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{while((e===void 0||e-- >0)&&!(n=i.next()).done)s.push(n.value)}catch(t){o={error:t}}finally{try{if(n&&!n.done&&(r=i["return"]))r.call(i)}finally{if(o)throw o.error}}return s}function O(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++){if(s||!(i in e)){if(!s)s=Array.prototype.slice.call(e,0,i);s[i]=e[i]}}return t.concat(s||Array.prototype.slice.call(e))}var S;(function(t){t["Start"]="xstate.start";t["Stop"]="xstate.stop";t["Raise"]="xstate.raise";t["Send"]="xstate.send";t["Cancel"]="xstate.cancel";t["NullEvent"]="";t["Assign"]="xstate.assign";t["After"]="xstate.after";t["DoneState"]="done.state";t["DoneInvoke"]="done.invoke";t["Log"]="xstate.log";t["Init"]="xstate.init";t["Invoke"]="xstate.invoke";t["ErrorExecution"]="error.execution";t["ErrorCommunication"]="error.communication";t["ErrorPlatform"]="error.platform";t["ErrorCustom"]="xstate.error";t["Update"]="xstate.update";t["Pure"]="xstate.pure";t["Choose"]="xstate.choose"})(S||(S={}));var _;(function(t){t["Parent"]="#_parent";t["Internal"]="#_internal"})(_||(_={}));var E=S.Start;var j=S.Stop;var A=S.Raise;var z=S.Send;var C=S.Cancel;var q=S.NullEvent;var T=S.Assign;var F=S.Log;var R=S.Init;var N=S.Invoke;var L=S.ErrorPlatform;var P=S.ErrorCustom;var I=S.Update;var B=S.Choose;var M=S.Pure;var W=".";var H={};var D="xstate.guard";var U="";var V="production"==="production";var K;function J(t,e,r){if(r===void 0){r=W}var i=X(t,r);var n=X(e,r);if(yt(n)){if(yt(i)){return n===i}return false}if(yt(i)){return i in n}return Object.keys(i).every((function(t){if(!(t in n)){return false}return J(i[t],n[t])}))}function $(t){try{return yt(t)||typeof t==="number"?"".concat(t):t.type}catch(t){throw new Error("Events must be strings or objects with a string event.type property.")}}function G(t,e){try{if(wt(t)){return t}return t.toString().split(e)}catch(e){throw new Error("'".concat(t,"' is not a valid state path."))}}function Q(t){return typeof t==="object"&&"value"in t&&"context"in t&&"event"in t&&"_event"in t}function X(t,e){if(Q(t)){return t.value}if(wt(t)){return Y(t)}if(typeof t!=="string"){return t}var r=G(t,e);return Y(r)}function Y(t){if(t.length===1){return t[0]}var e={};var r=e;for(var i=0;i<t.length-1;i++){if(i===t.length-2){r[t[i]]=t[i+1]}else{r[t[i]]={};r=r[t[i]]}}return e}function Z(t,e){var r={};var i=Object.keys(t);for(var n=0;n<i.length;n++){var s=i[n];r[s]=e(t[s],s,t,n)}return r}function tt(t,e,r){var i,n;var s={};try{for(var o=k(Object.keys(t)),c=o.next();!c.done;c=o.next()){var a=c.value;var l=t[a];if(!r(l)){continue}s[a]=e(l,a,t)}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=o.return))n.call(o)}finally{if(i)throw i.error}}return s}var et=function(t){return function(e){var r,i;var n=e;try{for(var s=k(t),o=s.next();!o.done;o=s.next()){var c=o.value;n=n[c]}}catch(t){r={error:t}}finally{try{if(o&&!o.done&&(i=s.return))i.call(s)}finally{if(r)throw r.error}}return n}};function rt(t,e){return function(r){var i,n;var s=r;try{for(var o=k(t),c=o.next();!c.done;c=o.next()){var a=c.value;s=s[e][a]}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=o.return))n.call(o)}finally{if(i)throw i.error}}return s}}function it(t){if(!t){return[[]]}if(yt(t)){return[[t]]}var e=nt(Object.keys(t).map((function(e){var r=t[e];if(typeof r!=="string"&&(!r||!Object.keys(r).length)){return[[e]]}return it(t[e]).map((function(t){return[e].concat(t)}))})));return e}function nt(t){var e;return(e=[]).concat.apply(e,O([],x(t),false))}function st(t){if(wt(t)){return t}return[t]}function ot(t){if(t===undefined){return[]}return st(t)}function ct(t,e,r){var i,n;if(bt(t)){return t(e,r.data)}var s={};try{for(var o=k(Object.keys(t)),c=o.next();!c.done;c=o.next()){var a=c.value;var l=t[a];if(bt(l)){s[a]=l(e,r.data)}else{s[a]=l}}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=o.return))n.call(o)}finally{if(i)throw i.error}}return s}function at(t){return/^(done|error)\./.test(t)}function lt(t){if(t instanceof Promise){return true}if(t!==null&&(bt(t)||typeof t==="object")&&bt(t.then)){return true}return false}function ut(t){return t!==null&&typeof t==="object"&&"transition"in t&&typeof t.transition==="function"}function ft(t,e){var r,i;var n=x([[],[]],2),s=n[0],o=n[1];try{for(var c=k(t),a=c.next();!a.done;a=c.next()){var l=a.value;if(e(l)){s.push(l)}else{o.push(l)}}}catch(t){r={error:t}}finally{try{if(a&&!a.done&&(i=c.return))i.call(c)}finally{if(r)throw r.error}}return[s,o]}function ht(t,e){return Z(t.states,(function(t,r){if(!t){return undefined}var i=(yt(e)?undefined:e[r])||(t?t.current:undefined);if(!i){return undefined}return{current:i,states:ht(t,i)}}))}function dt(t,e){return{current:e,states:ht(t,e)}}function vt(t,e,r,i){var n=t?r.reduce((function(t,r){var n,s;var o=r.assignment;var c={state:i,action:r,_event:e};var a={};if(bt(o)){a=o(t,e.data,c)}else{try{for(var l=k(Object.keys(o)),u=l.next();!u.done;u=l.next()){var f=u.value;var h=o[f];a[f]=bt(h)?h(t,e.data,c):h}}catch(t){n={error:t}}finally{try{if(u&&!u.done&&(s=l.return))s.call(l)}finally{if(n)throw n.error}}}return Object.assign({},t,a)}),t):t;return n}var pt=function(){};function wt(t){return Array.isArray(t)}function bt(t){return typeof t==="function"}function yt(t){return typeof t==="string"}function gt(t,e){if(!t){return undefined}if(yt(t)){return{type:D,name:t,predicate:e?e[t]:undefined}}if(bt(t)){return{type:D,name:t.name,predicate:t}}return t}function mt(t){try{return"subscribe"in t&&bt(t.subscribe)}catch(t){return false}}var kt=function(){return typeof Symbol==="function"&&Symbol.observable||"@@observable"}();K={},K[kt]=function(){return this},K[Symbol.observable]=function(){return this},K;function xt(t){return!!t&&"__xstatenode"in t}function Ot(t){return!!t&&typeof t.send==="function"}function St(t,e){if(yt(t)||typeof t==="number"){return g({type:t},e)}return t}function _t(t,e){if(!yt(t)&&"$$type"in t&&t.$$type==="scxml"){return t}var r=St(t);return g({name:r.type,data:r,$$type:"scxml",type:"external"},e)}function Et(t,e){var r=st(e).map((function(e){if(typeof e==="undefined"||typeof e==="string"||xt(e)){return{target:e,event:t}}return g(g({},e),{event:t})}));return r}function jt(t){if(t===undefined||t===U){return undefined}return ot(t)}function At(t,e,r,i,n){var s=t.options.guards;var o={state:n,cond:e,_event:i};if(e.type===D){return((s===null||s===void 0?void 0:s[e.name])||e.predicate)(r,i.data,o)}var c=s===null||s===void 0?void 0:s[e.type];if(!c){throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."))}return c(r,i.data,o)}function zt(t){if(typeof t==="string"){return{type:t}}return t}function Ct(t,e,r){var i=function(){};var n=typeof t==="object";var s=n?t:null;return{next:((n?t.next:t)||i).bind(s),error:((n?t.error:e)||i).bind(s),complete:((n?t.complete:r)||i).bind(s)}}function qt(t,e){return"".concat(t,":invocation[").concat(e,"]")}function Tt(t){return(t.type===A||t.type===z&&t.to===_.Internal)&&typeof t.delay!=="number"}var Ft=_t({type:R});function Rt(t,e){return e?e[t]||undefined:undefined}function Nt(t,e){var r;if(yt(t)||typeof t==="number"){var i=Rt(t,e);if(bt(i)){r={type:t,exec:i}}else if(i){r=i}else{r={type:t,exec:undefined}}}else if(bt(t)){r={type:t.name||t.toString(),exec:t}}else{var i=Rt(t.type,e);if(bt(i)){r=g(g({},t),{exec:i})}else if(i){var n=i.type||t.type;r=g(g(g({},i),t),{type:n})}else{r=t}}return r}var Lt=function(t,e){if(!t){return[]}var r=wt(t)?t:[t];return r.map((function(t){return Nt(t,e)}))};function Pt(t){var e=Nt(t);return g(g({id:yt(t)?t:e.id},e),{type:e.type})}function It(t,e){return{type:A,event:typeof t==="function"?t:St(t),delay:e?e.delay:undefined,id:e===null||e===void 0?void 0:e.id}}function Bt(t,e,r,i){var n={_event:r};var s=_t(bt(t.event)?t.event(e,r.data,n):t.event);var o;if(yt(t.delay)){var c=i&&i[t.delay];o=bt(c)?c(e,r.data,n):c}else{o=bt(t.delay)?t.delay(e,r.data,n):t.delay}return g(g({},t),{type:A,_event:s,delay:o})}function Mt(t,e){return{to:e?e.to:undefined,type:z,event:bt(t)?t:St(t),delay:e?e.delay:undefined,id:e&&e.id!==undefined?e.id:bt(t)?t.name:$(t)}}function Wt(t,e,r,i){var n={_event:r};var s=_t(bt(t.event)?t.event(e,r.data,n):t.event);var o;if(yt(t.delay)){var c=i&&i[t.delay];o=bt(c)?c(e,r.data,n):c}else{o=bt(t.delay)?t.delay(e,r.data,n):t.delay}var a=bt(t.to)?t.to(e,r.data,n):t.to;return g(g({},t),{to:a,_event:s,event:s.data,delay:o})}var Ht=function(t,e,r){return g(g({},t),{value:yt(t.expr)?t.expr:t.expr(e,r.data,{_event:r})})};var Dt=function(t){return{type:C,sendId:t}};function Ut(t){var e=Pt(t);return{type:S.Start,activity:e,exec:undefined}}function Vt(t){var e=bt(t)?t:Pt(t);return{type:S.Stop,activity:e,exec:undefined}}function Kt(t,e,r){var i=bt(t.activity)?t.activity(e,r.data):t.activity;var n=typeof i==="string"?{id:i}:i;var s={type:S.Stop,activity:n};return s}function Jt(t,e){var r=e?"#".concat(e):"";return"".concat(S.After,"(").concat(t,")").concat(r)}function $t(t,e){var r="".concat(S.DoneState,".").concat(t);var i={type:r,data:e};i.toString=function(){return r};return i}function Gt(t,e){var r="".concat(S.DoneInvoke,".").concat(t);var i={type:r,data:e};i.toString=function(){return r};return i}function Qt(t,e){var r="".concat(S.ErrorPlatform,".").concat(t);var i={type:r,data:e};i.toString=function(){return r};return i}var Xt=function(t){var e,r;var i=[];try{for(var n=k(t),s=n.next();!s.done;s=n.next()){var o=s.value;var c=0;while(c<o.actions.length){if(o.actions[c].type===T){i.push(o.actions[c]);o.actions.splice(c,1);continue}c++}}}catch(t){e={error:t}}finally{try{if(s&&!s.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}return i};function Yt(t,e,r,i,n,s,o){if(o===void 0){o=false}var c=o?[]:Xt(n);var a=c.length?vt(r,i,c,e):r;var l=o?[r]:undefined;var u=[];function f(n,c){var f;switch(c.type){case A:{var h=Bt(c,a,i,t.options.delays);if(s&&typeof h.delay==="number"){s(h,a,i)}return h}case z:var d=Wt(c,a,i,t.options.delays);if(s&&d.to!==_.Internal){if(n==="entry"){u.push(d)}else{s(d,a,i)}}return d;case F:{var v=Ht(c,a,i);s===null||s===void 0?void 0:s(v,a,i);return v}case B:{var p=c;var w=(f=p.conds.find((function(r){var n=gt(r.cond,t.options.guards);return!n||At(t,n,a,i,!s?e:undefined)})))===null||f===void 0?void 0:f.actions;if(!w){return[]}var b=x(Yt(t,e,a,i,[{type:n,actions:Lt(ot(w),t.options.actions)}],s,o),2),y=b[0],m=b[1];a=m;l===null||l===void 0?void 0:l.push(a);return y}case M:{var w=c.get(a,i.data);if(!w){return[]}var k=x(Yt(t,e,a,i,[{type:n,actions:Lt(ot(w),t.options.actions)}],s,o),2),S=k[0],E=k[1];a=E;l===null||l===void 0?void 0:l.push(a);return S}case j:{var v=Kt(c,a,i);s===null||s===void 0?void 0:s(v,r,i);return v}case T:{a=vt(a,i,[c],!s?e:undefined);l===null||l===void 0?void 0:l.push(a);break}default:var C=Nt(c,t.options.actions);var q=C.exec;if(s){s(C,a,i)}else if(q&&l){var R=l.length-1;var N=g(g({},C),{exec:function(t){var e=[];for(var r=1;r<arguments.length;r++){e[r-1]=arguments[r]}q.apply(void 0,O([l[R]],x(e),false))}});C=N}return C}}function h(t){var e,r;var n=[];try{for(var o=k(t.actions),c=o.next();!c.done;c=o.next()){var l=c.value;var h=f(t.type,l);if(h){n=n.concat(h)}}}catch(t){e={error:t}}finally{try{if(c&&!c.done&&(r=o.return))r.call(o)}finally{if(e)throw e.error}}u.forEach((function(t){s(t,a,i)}));u.length=0;return n}var d=nt(n.map(h));return[d,a]}var Zt=function(t,e){var r=e(t);return r};function te(t){var e;return e={id:t,send:function(){return void 0},subscribe:function(){return{unsubscribe:function(){return void 0}}},getSnapshot:function(){return undefined},toJSON:function(){return{id:t}}},e[kt]=function(){return this},e}function ee(t,e,r,i){var n;var s=zt(t.src);var o=(n=e===null||e===void 0?void 0:e.options.services)===null||n===void 0?void 0:n[s.type];var c=t.data?ct(t.data,r,i):undefined;var a=o?re(o,t.id,c):te(t.id);a.meta=t;return a}function re(t,e,r){var i=te(e);i.deferred=true;if(xt(t)){var n=i.state=Zt(undefined,(function(){return(r?t.withContext(r):t).initialState}));i.getSnapshot=function(){return n}}return i}function ie(t){try{return typeof t.send==="function"}catch(t){return false}}function ne(t){return ie(t)&&"id"in t}function se(t){var e;return g((e={subscribe:function(){return{unsubscribe:function(){return void 0}}},id:"anonymous",getSnapshot:function(){return undefined}},e[kt]=function(){return this},e),t)}var oe=function(t){return t.type==="atomic"||t.type==="final"};function ce(t){return Object.keys(t.states).map((function(e){return t.states[e]}))}function ae(t){return ce(t).filter((function(t){return t.type!=="history"}))}function le(t){var e=[t];if(oe(t)){return e}return e.concat(nt(ae(t).map(le)))}function ue(t,e){var r,i,n,s,o,c,a,l;var u=new Set(t);var f=he(u);var h=new Set(e);try{for(var d=k(h),v=d.next();!v.done;v=d.next()){var p=v.value;var w=p.parent;while(w&&!h.has(w)){h.add(w);w=w.parent}}}catch(t){r={error:t}}finally{try{if(v&&!v.done&&(i=d.return))i.call(d)}finally{if(r)throw r.error}}var b=he(h);try{for(var y=k(h),g=y.next();!g.done;g=y.next()){var p=g.value;if(p.type==="compound"&&(!b.get(p)||!b.get(p).length)){if(f.get(p)){f.get(p).forEach((function(t){return h.add(t)}))}else{p.initialStateNodes.forEach((function(t){return h.add(t)}))}}else{if(p.type==="parallel"){try{for(var m=(o=void 0,k(ae(p))),x=m.next();!x.done;x=m.next()){var O=x.value;if(!h.has(O)){h.add(O);if(f.get(O)){f.get(O).forEach((function(t){return h.add(t)}))}else{O.initialStateNodes.forEach((function(t){return h.add(t)}))}}}}catch(t){o={error:t}}finally{try{if(x&&!x.done&&(c=m.return))c.call(m)}finally{if(o)throw o.error}}}}}}catch(t){n={error:t}}finally{try{if(g&&!g.done&&(s=y.return))s.call(y)}finally{if(n)throw n.error}}try{for(var S=k(h),_=S.next();!_.done;_=S.next()){var p=_.value;var w=p.parent;while(w&&!h.has(w)){h.add(w);w=w.parent}}}catch(t){a={error:t}}finally{try{if(_&&!_.done&&(l=S.return))l.call(S)}finally{if(a)throw a.error}}return h}function fe(t,e){var r=e.get(t);if(!r){return{}}if(t.type==="compound"){var i=r[0];if(i){if(oe(i)){return i.key}}else{return{}}}var n={};r.forEach((function(t){n[t.key]=fe(t,e)}));return n}function he(t){var e,r;var i=new Map;try{for(var n=k(t),s=n.next();!s.done;s=n.next()){var o=s.value;if(!i.has(o)){i.set(o,[])}if(o.parent){if(!i.has(o.parent)){i.set(o.parent,[])}i.get(o.parent).push(o)}}}catch(t){e={error:t}}finally{try{if(s&&!s.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}return i}function de(t,e){var r=ue([t],e);return fe(t,he(r))}function ve(t,e){if(Array.isArray(t)){return t.some((function(t){return t===e}))}if(t instanceof Set){return t.has(e)}return false}function pe(t){return O([],x(new Set(nt(O([],x(t.map((function(t){return t.ownEvents}))),false)))),false)}function we(t,e){if(e.type==="compound"){return ae(e).some((function(e){return e.type==="final"&&ve(t,e)}))}if(e.type==="parallel"){return ae(e).every((function(e){return we(t,e)}))}return false}function be(t){if(t===void 0){t=[]}return t.reduce((function(t,e){if(e.meta!==undefined){t[e.id]=e.meta}return t}),{})}function ye(t){return new Set(nt(t.map((function(t){return t.tags}))))}function ge(t,e){if(t===e){return true}if(t===undefined||e===undefined){return false}if(yt(t)||yt(e)){return t===e}var r=Object.keys(t);var i=Object.keys(e);return r.length===i.length&&r.every((function(r){return ge(t[r],e[r])}))}function me(t){if(typeof t!=="object"||t===null){return false}return"value"in t&&"_event"in t}function ke(t,e){var r=t.exec;var i=g(g({},t),{exec:r!==undefined?function(){return r(e.context,e.event,{action:t,state:e,_event:e._event})}:undefined});return i}var xe=function(){function t(t){var e=this;var r;this.actions=[];this.activities=H;this.meta={};this.events=[];this.value=t.value;this.context=t.context;this._event=t._event;this._sessionid=t._sessionid;this.event=this._event.data;this.historyValue=t.historyValue;this.history=t.history;this.actions=t.actions||[];this.activities=t.activities||H;this.meta=be(t.configuration);this.events=t.events||[];this.matches=this.matches.bind(this);this.toStrings=this.toStrings.bind(this);this.configuration=t.configuration;this.transitions=t.transitions;this.children=t.children;this.done=!!t.done;this.tags=(r=Array.isArray(t.tags)?new Set(t.tags):t.tags)!==null&&r!==void 0?r:new Set;this.machine=t.machine;Object.defineProperty(this,"nextEvents",{get:function(){return pe(e.configuration)}})}t.from=function(e,r){if(e instanceof t){if(e.context!==r){return new t({value:e.value,context:r,_event:e._event,_sessionid:null,historyValue:e.historyValue,history:e.history,actions:[],activities:e.activities,meta:{},events:[],configuration:[],transitions:[],children:{}})}return e}var i=Ft;return new t({value:e,context:r,_event:i,_sessionid:null,historyValue:undefined,history:undefined,actions:[],activities:undefined,meta:undefined,events:[],configuration:[],transitions:[],children:{}})};t.create=function(e){return new t(e)};t.inert=function(e,r){if(e instanceof t){if(!e.actions.length){return e}var i=Ft;return new t({value:e.value,context:r,_event:i,_sessionid:null,historyValue:e.historyValue,history:e.history,activities:e.activities,configuration:e.configuration,transitions:[],children:{}})}return t.from(e,r)};t.prototype.toStrings=function(t,e){var r=this;if(t===void 0){t=this.value}if(e===void 0){e="."}if(yt(t)){return[t]}var i=Object.keys(t);return i.concat.apply(i,O([],x(i.map((function(i){return r.toStrings(t[i],e).map((function(t){return i+e+t}))}))),false))};t.prototype.toJSON=function(){var t=this;var e=t.tags;var r=m(t,["configuration","transitions","tags","machine"]);return g(g({},r),{tags:Array.from(e)})};t.prototype.matches=function(t){return J(t,this.value)};t.prototype.hasTag=function(t){return this.tags.has(t)};t.prototype.can=function(t){var e;var r=(e=this.machine)===null||e===void 0?void 0:e.getTransitionData(this,t);return!!(r===null||r===void 0?void 0:r.transitions.length)&&r.transitions.some((function(t){return t.target!==undefined||t.actions.length}))};return t}();var Oe={deferEvents:false};var Se=function(){function t(t){this.processingEvent=false;this.queue=[];this.initialized=false;this.options=g(g({},Oe),t)}t.prototype.initialize=function(t){this.initialized=true;if(t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()};t.prototype.schedule=function(t){if(!this.initialized||this.processingEvent){this.queue.push(t);return}if(this.queue.length!==0){throw new Error("Event queue should be empty when it is not processing events")}this.process(t);this.flushEvents()};t.prototype.clear=function(){this.queue=[]};t.prototype.flushEvents=function(){var t=this.queue.shift();while(t){this.process(t);t=this.queue.shift()}};t.prototype.process=function(t){this.processingEvent=true;try{t()}catch(t){this.clear();throw t}finally{this.processingEvent=false}};return t}();var _e=new Map;var Ee=0;var je={bookId:function(){return"x:".concat(Ee++)},register:function(t,e){_e.set(t,e);return t},get:function(t){return _e.get(t)},free:function(t){_e.delete(t)}};function Ae(){if(typeof globalThis!=="undefined"){return globalThis}if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}}function ze(){var t=Ae();if(t&&"__xstate__"in t){return t.__xstate__}return undefined}function Ce(t){if(!Ae()){return}var e=ze();if(e){e.register(t)}}function qe(t,e){if(e===void 0){e={}}var r=t.initialState;var i=new Set;var n=[];var s=false;var o=function(){if(s){return}s=true;while(n.length>0){var e=n.shift();r=t.transition(r,e,a);i.forEach((function(t){return t.next(r)}))}s=false};var c=se({id:e.id,send:function(t){n.push(t);o()},getSnapshot:function(){return r},subscribe:function(t,e,n){var s=Ct(t,e,n);i.add(s);s.next(r);return{unsubscribe:function(){i.delete(s)}}}});var a={parent:e.parent,self:c,id:e.id||"anonymous",observers:i};r=t.start?t.start(a):r;return c}var Te={sync:false,autoForward:false};var Fe;(function(t){t[t["NotStarted"]=0]="NotStarted";t[t["Running"]=1]="Running";t[t["Stopped"]=2]="Stopped"})(Fe||(Fe={}));var Re=function(){function t(e,r){if(r===void 0){r=t.defaultOptions}var i=this;this.machine=e;this.delayedEventsMap={};this.listeners=new Set;this.contextListeners=new Set;this.stopListeners=new Set;this.doneListeners=new Set;this.eventListeners=new Set;this.sendListeners=new Set;this.initialized=false;this.status=Fe.NotStarted;this.children=new Map;this.forwardTo=new Set;this._outgoingQueue=[];this.init=this.start;this.send=function(t,e){if(wt(t)){i.batch(t);return i.state}var r=_t(St(t,e));if(i.status===Fe.Stopped){return i.state}if(i.status!==Fe.Running&&!i.options.deferEvents){throw new Error('Event "'.concat(r.name,'" was sent to uninitialized service "').concat(i.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(r.data)))}i.scheduler.schedule((function(){i.forward(r);var t=i._nextState(r);i.update(t,r)}));return i._state};this.sendTo=function(t,e,r){var n=i.parent&&(e===_.Parent||i.parent.id===e);var s=n?i.parent:yt(e)?e===_.Internal?i:i.children.get(e)||je.get(e):Ot(e)?e:undefined;if(!s){if(!n){throw new Error("Unable to send event to child '".concat(e,"' from service '").concat(i.id,"'."))}return}if("machine"in s){if(i.status!==Fe.Stopped||i.parent!==s||i.state.done){var o=g(g({},t),{name:t.name===P?"".concat(Qt(i.id)):t.name,origin:i.sessionId});if(!r&&i.machine.config.predictableActionArguments){i._outgoingQueue.push([s,o])}else{s.send(o)}}}else{if(!r&&i.machine.config.predictableActionArguments){i._outgoingQueue.push([s,t.data])}else{s.send(t.data)}}};this._exec=function(t,e,r,n){if(n===void 0){n=i.machine.options.actions}var s=t.exec||Rt(t.type,n);var o=bt(s)?s:s?s.exec:t.exec;if(o){try{return o(e,r.data,!i.machine.config.predictableActionArguments?{action:t,state:i.state,_event:r}:{action:t,_event:r})}catch(t){if(i.parent){i.parent.send({type:"xstate.error",data:t})}throw t}}switch(t.type){case A:{var c=t;i.defer(c);break}case z:var a=t;if(typeof a.delay==="number"){i.defer(a);return}else{if(a.to){i.sendTo(a._event,a.to,r===Ft)}else{i.send(a._event)}}break;case C:i.cancel(t.sendId);break;case E:{if(i.status!==Fe.Running){return}var l=t.activity;if(!i.machine.config.predictableActionArguments&&!i.state.activities[l.id||l.type]){break}if(l.type===S.Invoke){var u=zt(l.src);var f=i.machine.options.services?i.machine.options.services[u.type]:undefined;var h=l.id,d=l.data;var v="autoForward"in l?l.autoForward:!!l.forward;if(!f){return}var p=d?ct(d,e,r):undefined;if(typeof f==="string"){return}var w=bt(f)?f(e,r.data,{data:p,src:u,meta:l.meta}):f;if(!w){return}var b=void 0;if(xt(w)){w=p?w.withContext(p):w;b={autoForward:v}}i.spawn(w,h,b)}else{i.spawnActivity(l)}break}case j:{i.stopChild(t.activity.id);break}case F:var y=t,g=y.label,m=y.value;if(g){i.logger(g,m)}else{i.logger(m)}break}};var n=g(g({},t.defaultOptions),r);var s=n.clock,o=n.logger,c=n.parent,a=n.id;var l=a!==undefined?a:e.id;this.id=l;this.logger=o;this.clock=s;this.parent=c;this.options=n;this.scheduler=new Se({deferEvents:this.options.deferEvents});this.sessionId=je.bookId()}Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this;if(this._initialState){return this._initialState}return Zt(this,(function(){t._initialState=t.machine.initialState;return t._initialState}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:false,configurable:true});t.prototype.execute=function(t,e){var r,i;try{for(var n=k(t.actions),s=n.next();!s.done;s=n.next()){var o=s.value;this.exec(o,t,e)}}catch(t){r={error:t}}finally{try{if(s&&!s.done&&(i=n.return))i.call(n)}finally{if(r)throw r.error}}};t.prototype.update=function(t,e){var r,i,n,s,o,c,a,l;var u=this;t._sessionid=this.sessionId;this._state=t;if((!this.machine.config.predictableActionArguments||e===Ft)&&this.options.execute){this.execute(this.state)}else{var f=void 0;while(f=this._outgoingQueue.shift()){f[0].send(f[1])}}this.children.forEach((function(t){u.state.children[t.id]=t}));if(this.devTools){this.devTools.send(e.data,t)}if(t.event){try{for(var h=k(this.eventListeners),d=h.next();!d.done;d=h.next()){var v=d.value;v(t.event)}}catch(t){r={error:t}}finally{try{if(d&&!d.done&&(i=h.return))i.call(h)}finally{if(r)throw r.error}}}try{for(var p=k(this.listeners),w=p.next();!w.done;w=p.next()){var v=w.value;v(t,t.event)}}catch(t){n={error:t}}finally{try{if(w&&!w.done&&(s=p.return))s.call(p)}finally{if(n)throw n.error}}try{for(var b=k(this.contextListeners),y=b.next();!y.done;y=b.next()){var g=y.value;g(this.state.context,this.state.history?this.state.history.context:undefined)}}catch(t){o={error:t}}finally{try{if(y&&!y.done&&(c=b.return))c.call(b)}finally{if(o)throw o.error}}if(this.state.done){var m=t.configuration.find((function(t){return t.type==="final"&&t.parent===u.machine}));var x=m&&m.doneData?ct(m.doneData,t.context,e):undefined;this._doneEvent=Gt(this.id,x);try{for(var O=k(this.doneListeners),S=O.next();!S.done;S=O.next()){var v=S.value;v(this._doneEvent)}}catch(t){a={error:t}}finally{try{if(S&&!S.done&&(l=O.return))l.call(O)}finally{if(a)throw a.error}}this._stop();this._stopChildren();je.free(this.sessionId)}};t.prototype.onTransition=function(t){this.listeners.add(t);if(this.status===Fe.Running){t(this.state,this.state.event)}return this};t.prototype.subscribe=function(t,e,r){var i=this;var n=Ct(t,e,r);this.listeners.add(n.next);if(this.status!==Fe.NotStarted){n.next(this.state)}var s=function(){i.doneListeners.delete(s);i.stopListeners.delete(s);n.complete()};if(this.status===Fe.Stopped){n.complete()}else{this.onDone(s);this.onStop(s)}return{unsubscribe:function(){i.listeners.delete(n.next);i.doneListeners.delete(s);i.stopListeners.delete(s)}}};t.prototype.onEvent=function(t){this.eventListeners.add(t);return this};t.prototype.onSend=function(t){this.sendListeners.add(t);return this};t.prototype.onChange=function(t){this.contextListeners.add(t);return this};t.prototype.onStop=function(t){this.stopListeners.add(t);return this};t.prototype.onDone=function(t){if(this.status===Fe.Stopped&&this._doneEvent){t(this._doneEvent)}else{this.doneListeners.add(t)}return this};t.prototype.off=function(t){this.listeners.delete(t);this.eventListeners.delete(t);this.sendListeners.delete(t);this.stopListeners.delete(t);this.doneListeners.delete(t);this.contextListeners.delete(t);return this};t.prototype.start=function(t){var e=this;if(this.status===Fe.Running){return this}this.machine._init();je.register(this.sessionId,this);this.initialized=true;this.status=Fe.Running;var r=t===undefined?this.initialState:Zt(this,(function(){return me(t)?e.machine.resolveState(t):e.machine.resolveState(xe.from(t,e.machine.context))}));if(this.options.devTools){this.attachDev()}this.scheduler.initialize((function(){e.update(r,Ft)}));return this};t.prototype._stopChildren=function(){this.children.forEach((function(t){if(bt(t.stop)){t.stop()}}));this.children.clear()};t.prototype._stop=function(){var t,e,r,i,n,s,o,c,a,l;try{for(var u=k(this.listeners),f=u.next();!f.done;f=u.next()){var h=f.value;this.listeners.delete(h)}}catch(e){t={error:e}}finally{try{if(f&&!f.done&&(e=u.return))e.call(u)}finally{if(t)throw t.error}}try{for(var d=k(this.stopListeners),v=d.next();!v.done;v=d.next()){var h=v.value;h();this.stopListeners.delete(h)}}catch(t){r={error:t}}finally{try{if(v&&!v.done&&(i=d.return))i.call(d)}finally{if(r)throw r.error}}try{for(var p=k(this.contextListeners),w=p.next();!w.done;w=p.next()){var h=w.value;this.contextListeners.delete(h)}}catch(t){n={error:t}}finally{try{if(w&&!w.done&&(s=p.return))s.call(p)}finally{if(n)throw n.error}}try{for(var b=k(this.doneListeners),y=b.next();!y.done;y=b.next()){var h=y.value;this.doneListeners.delete(h)}}catch(t){o={error:t}}finally{try{if(y&&!y.done&&(c=b.return))c.call(b)}finally{if(o)throw o.error}}if(!this.initialized){return this}this.initialized=false;this.status=Fe.Stopped;this._initialState=undefined;try{for(var g=k(Object.keys(this.delayedEventsMap)),m=g.next();!m.done;m=g.next()){var x=m.value;this.clock.clearTimeout(this.delayedEventsMap[x])}}catch(t){a={error:t}}finally{try{if(m&&!m.done&&(l=g.return))l.call(g)}finally{if(a)throw a.error}}this.scheduler.clear();this.scheduler=new Se({deferEvents:this.options.deferEvents})};t.prototype.stop=function(){var t=this;var e=this.scheduler;this._stop();e.schedule((function(){var e=_t({type:"xstate.stop"});var r=Zt(t,(function(){var r=nt(O([],x(t.state.configuration),false).sort((function(t,e){return e.order-t.order})).map((function(e){return Lt(e.onExit,t.machine.options.actions)})));var i=x(Yt(t.machine,t.state,t.state.context,e,[{type:"exit",actions:r}],t.machine.config.predictableActionArguments?t._exec:undefined,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),n=i[0],s=i[1];var o=new xe({value:t.state.value,context:s,_event:e,_sessionid:t.sessionId,historyValue:undefined,history:t.state,actions:n.filter((function(t){return!Tt(t)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});o.changed=true;return o}));t.update(r,e);t._stopChildren();je.free(t.sessionId)}));return this};t.prototype.batch=function(t){var e=this;if(this.status===Fe.NotStarted&&this.options.deferEvents);else if(this.status!==Fe.Running){throw new Error("".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(!t.length){return}var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var i,n;var s=e.state;var o=false;var c=[];var a=function(t){var i=_t(t);e.forward(i);s=Zt(e,(function(){return e.machine.transition(s,i,undefined,r||undefined)}));c.push.apply(c,O([],x(e.machine.config.predictableActionArguments?s.actions:s.actions.map((function(t){return ke(t,s)}))),false));o=o||!!s.changed};try{for(var l=k(t),u=l.next();!u.done;u=l.next()){var f=u.value;a(f)}}catch(t){i={error:t}}finally{try{if(u&&!u.done&&(n=l.return))n.call(l)}finally{if(i)throw i.error}}s.changed=o;s.actions=c;e.update(s,_t(t[t.length-1]))}))};t.prototype.sender=function(t){return this.send.bind(this,t)};t.prototype._nextState=function(t,e){var r=this;if(e===void 0){e=!!this.machine.config.predictableActionArguments&&this._exec}var i=_t(t);if(i.name.indexOf(L)===0&&!this.state.nextEvents.some((function(t){return t.indexOf(L)===0}))){throw i.data.data}var n=Zt(this,(function(){return r.machine.transition(r.state,i,undefined,e||undefined)}));return n};t.prototype.nextState=function(t){return this._nextState(t,false)};t.prototype.forward=function(t){var e,r;try{for(var i=k(this.forwardTo),n=i.next();!n.done;n=i.next()){var s=n.value;var o=this.children.get(s);if(!o){throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(s,"'."))}o.send(t)}}catch(t){e={error:t}}finally{try{if(n&&!n.done&&(r=i.return))r.call(i)}finally{if(e)throw e.error}}};t.prototype.defer=function(t){var e=this;var r=this.clock.setTimeout((function(){if("to"in t&&t.to){e.sendTo(t._event,t.to,true)}else{e.send(t._event)}}),t.delay);if(t.id){this.delayedEventsMap[t.id]=r}};t.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]);delete this.delayedEventsMap[t]};t.prototype.exec=function(t,e,r){if(r===void 0){r=this.machine.options.actions}this._exec(t,e.context,e._event,r)};t.prototype.removeChild=function(t){var e;this.children.delete(t);this.forwardTo.delete(t);(e=this.state)===null||e===void 0?true:delete e.children[t]};t.prototype.stopChild=function(t){var e=this.children.get(t);if(!e){return}this.removeChild(t);if(bt(e.stop)){e.stop()}};t.prototype.spawn=function(t,e,r){if(this.status!==Fe.Running){return re(t,e)}if(lt(t)){return this.spawnPromise(Promise.resolve(t),e)}else if(bt(t)){return this.spawnCallback(t,e)}else if(ne(t)){return this.spawnActor(t,e)}else if(mt(t)){return this.spawnObservable(t,e)}else if(xt(t)){return this.spawnMachine(t,g(g({},r),{id:e}))}else if(ut(t)){return this.spawnBehavior(t,e)}else{throw new Error('Unable to spawn entity "'.concat(e,'" of type "').concat(typeof t,'".'))}};t.prototype.spawnMachine=function(e,r){var i=this;if(r===void 0){r={}}var n=new t(e,g(g({},this.options),{parent:this,id:r.id||e.id}));var s=g(g({},Te),r);if(s.sync){n.onTransition((function(t){i.send(I,{state:t,id:n.id})}))}var o=n;this.children.set(n.id,o);if(s.autoForward){this.forwardTo.add(n.id)}n.onDone((function(t){i.removeChild(n.id);i.send(_t(t,{origin:n.id}))})).start();return o};t.prototype.spawnBehavior=function(t,e){var r=qe(t,{id:e,parent:this});this.children.set(e,r);return r};t.prototype.spawnPromise=function(t,e){var r;var i=this;var n=false;var s;t.then((function(t){if(!n){s=t;i.removeChild(e);i.send(_t(Gt(e,t),{origin:e}))}}),(function(t){if(!n){i.removeChild(e);var r=Qt(e,t);try{i.send(_t(r,{origin:e}))}catch(t){if(i.devTools){i.devTools.send(r,i.state)}if(i.machine.strict){i.stop()}}}}));var o=(r={id:e,send:function(){return void 0},subscribe:function(e,r,i){var n=Ct(e,r,i);var s=false;t.then((function(t){if(s){return}n.next(t);if(s){return}n.complete()}),(function(t){if(s){return}n.error(t)}));return{unsubscribe:function(){return s=true}}},stop:function(){n=true},toJSON:function(){return{id:e}},getSnapshot:function(){return s}},r[kt]=function(){return this},r);this.children.set(e,o);return o};t.prototype.spawnCallback=function(t,e){var r;var i=this;var n=false;var s=new Set;var o=new Set;var c;var a=function(t){c=t;o.forEach((function(e){return e(t)}));if(n){return}i.send(_t(t,{origin:e}))};var l;try{l=t(a,(function(t){s.add(t)}))}catch(t){this.send(Qt(e,t))}if(lt(l)){return this.spawnPromise(l,e)}var u=(r={id:e,send:function(t){return s.forEach((function(e){return e(t)}))},subscribe:function(t){var e=Ct(t);o.add(e.next);return{unsubscribe:function(){o.delete(e.next)}}},stop:function(){n=true;if(bt(l)){l()}},toJSON:function(){return{id:e}},getSnapshot:function(){return c}},r[kt]=function(){return this},r);this.children.set(e,u);return u};t.prototype.spawnObservable=function(t,e){var r;var i=this;var n;var s=t.subscribe((function(t){n=t;i.send(_t(t,{origin:e}))}),(function(t){i.removeChild(e);i.send(_t(Qt(e,t),{origin:e}))}),(function(){i.removeChild(e);i.send(_t(Gt(e),{origin:e}))}));var o=(r={id:e,send:function(){return void 0},subscribe:function(e,r,i){return t.subscribe(e,r,i)},stop:function(){return s.unsubscribe()},getSnapshot:function(){return n},toJSON:function(){return{id:e}}},r[kt]=function(){return this},r);this.children.set(e,o);return o};t.prototype.spawnActor=function(t,e){this.children.set(e,t);return t};t.prototype.spawnActivity=function(t){var e=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:undefined;if(!e){return}var r=e(this.state.context,t);this.spawnEffect(t.id,r)};t.prototype.spawnEffect=function(t,e){var r;this.children.set(t,(r={id:t,send:function(){return void 0},subscribe:function(){return{unsubscribe:function(){return void 0}}},stop:e||undefined,getSnapshot:function(){return undefined},toJSON:function(){return{id:t}}},r[kt]=function(){return this},r))};t.prototype.attachDev=function(){var t=Ae();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var e=typeof this.options.devTools==="object"?this.options.devTools:undefined;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(g(g({name:this.id,autoPause:true,stateSanitizer:function(t){return{value:t.value,context:t.context,actions:t.actions}}},e),{features:g({jump:false,skip:false},e?e.features:undefined)}),this.machine);this.devTools.init(this.state)}Ce(this)}};t.prototype.toJSON=function(){return{id:this.id}};t.prototype[kt]=function(){return this};t.prototype.getSnapshot=function(){if(this.status===Fe.NotStarted){return this.initialState}return this._state};t.defaultOptions={execute:true,deferEvents:true,clock:{setTimeout:function(t,e){return setTimeout(t,e)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:false};t.interpret=Ne;return t}();function Ne(t,e){var r=new Re(t,e);return r}function Le(t){if(typeof t==="string"){var e={type:t};e.toString=function(){return t};return e}return t}function Pe(t){return g(g({type:N},t),{toJSON:function(){var e=m(t,["onDone","onError"]);return g(g({},e),{type:N,src:Le(t.src)})}})}var Ie="";var Be="#";var Me="*";var We={};var He=function(t){return t[0]===Be};var De=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}};var Ue=function(t,e,r){r.slice(0,-1).some((function(t){return!("cond"in t)&&!("in"in t)&&(yt(t.target)||xt(t.target))}))};var Ve=function(){function t(e,r,i,n){if(i===void 0){i="context"in e?e.context:undefined}var s=this;var o;this.config=e;this._context=i;this.order=-1;this.__xstatenode=true;this.__cache={events:undefined,relativeValue:new Map,initialStateValue:undefined,initialState:undefined,on:undefined,transitions:undefined,candidates:{},delayedTransitions:undefined};this.idMap={};this.tags=[];this.options=Object.assign(De(),r);this.parent=n===null||n===void 0?void 0:n.parent;this.key=this.config.key||(n===null||n===void 0?void 0:n.key)||this.config.id||"(machine)";this.machine=this.parent?this.parent.machine:this;this.path=this.parent?this.parent.path.concat(this.key):[];this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:W);this.id=this.config.id||O([this.machine.key],x(this.path),false).join(this.delimiter);this.version=this.parent?this.parent.version:this.config.version;this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic");this.schema=this.parent?this.machine.schema:(o=this.config.schema)!==null&&o!==void 0?o:{};this.description=this.config.description;this.initial=this.config.initial;this.states=this.config.states?Z(this.config.states,(function(e,r){var i;var n=new t(e,{},undefined,{parent:s,key:r});Object.assign(s.idMap,g((i={},i[n.id]=n,i),n.idMap));return n})):We;var c=0;function a(t){var e,r;t.order=c++;try{for(var i=k(ce(t)),n=i.next();!n.done;n=i.next()){var s=n.value;a(s)}}catch(t){e={error:t}}finally{try{if(n&&!n.done&&(r=i.return))r.call(i)}finally{if(e)throw e.error}}}a(this);this.history=this.config.history===true?"shallow":this.config.history||false;this._transient=!!this.config.always||(!this.config.on?false:Array.isArray(this.config.on)?this.config.on.some((function(t){var e=t.event;return e===Ie})):Ie in this.config.on);this.strict=!!this.config.strict;this.onEntry=ot(this.config.entry||this.config.onEntry).map((function(t){return Nt(t)}));this.onExit=ot(this.config.exit||this.config.onExit).map((function(t){return Nt(t)}));this.meta=this.config.meta;this.doneData=this.type==="final"?this.config.data:undefined;this.invoke=ot(this.config.invoke).map((function(t,e){var r,i;if(xt(t)){var n=qt(s.id,e);s.machine.options.services=g((r={},r[n]=t,r),s.machine.options.services);return Pe({src:n,id:n})}else if(yt(t.src)){var n=t.id||qt(s.id,e);return Pe(g(g({},t),{id:n,src:t.src}))}else if(xt(t.src)||bt(t.src)){var n=t.id||qt(s.id,e);s.machine.options.services=g((i={},i[n]=t.src,i),s.machine.options.services);return Pe(g(g({id:n},t),{src:n}))}else{var o=t.src;return Pe(g(g({id:qt(s.id,e)},t),{src:o}))}}));this.activities=ot(this.config.activities).concat(this.invoke).map((function(t){return Pt(t)}));this.transition=this.transition.bind(this);this.tags=ot(this.config.tags)}t.prototype._init=function(){if(this.__cache.transitions){return}le(this).forEach((function(t){return t.on}))};t.prototype.withConfig=function(e,r){var i=this.options,n=i.actions,s=i.activities,o=i.guards,c=i.services,a=i.delays;return new t(this.config,{actions:g(g({},n),e.actions),activities:g(g({},s),e.activities),guards:g(g({},o),e.guards),services:g(g({},c),e.services),delays:g(g({},a),e.delays)},r!==null&&r!==void 0?r:this.context)};t.prototype.withContext=function(e){return new t(this.config,this.options,e)};Object.defineProperty(t.prototype,"context",{get:function(){return bt(this._context)?this._context():this._context},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:Z(this.states,(function(t){return t.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:false,configurable:true});t.prototype.toJSON=function(){return this.definition};Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on){return this.__cache.on}var t=this.transitions;return this.__cache.on=t.reduce((function(t,e){t[e.eventType]=t[e.eventType]||[];t[e.eventType].push(e);return t}),{})},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:false,configurable:true});t.prototype.getCandidates=function(t){if(this.__cache.candidates[t]){return this.__cache.candidates[t]}var e=t===Ie;var r=this.transitions.filter((function(r){var i=r.eventType===t;return e?i:i||r.eventType===Me}));this.__cache.candidates[t]=r;return r};t.prototype.getDelayedTransitions=function(){var t=this;var e=this.config.after;if(!e){return[]}var r=function(e,r){var i=bt(e)?"".concat(t.id,":delay[").concat(r,"]"):e;var n=Jt(i,t.id);t.onEntry.push(Mt(n,{delay:e}));t.onExit.push(Dt(n));return n};var i=wt(e)?e.map((function(t,e){var i=r(t.delay,e);return g(g({},t),{event:i})})):nt(Object.keys(e).map((function(t,i){var n=e[t];var s=yt(n)?{target:n}:n;var o=!isNaN(+t)?+t:t;var c=r(o,i);return ot(s).map((function(t){return g(g({},t),{event:c,delay:o})}))})));return i.map((function(e){var r=e.delay;return g(g({},t.formatTransition(e)),{delay:r})}))};t.prototype.getStateNodes=function(t){var e;var r=this;if(!t){return[]}var i=t instanceof xe?t.value:X(t,this.delimiter);if(yt(i)){var n=this.getStateNode(i).initial;return n!==undefined?this.getStateNodes((e={},e[i]=n,e)):[this,this.states[i]]}var s=Object.keys(i);var o=[this];o.push.apply(o,O([],x(nt(s.map((function(t){return r.getStateNode(t).getStateNodes(i[t])})))),false));return o};t.prototype.handles=function(t){var e=$(t);return this.events.includes(e)};t.prototype.resolveState=function(t){var e=t instanceof xe?t:xe.create(t);var r=Array.from(ue([],this.getStateNodes(e.value)));return new xe(g(g({},e),{value:this.resolve(e.value),configuration:r,done:we(r,this),tags:ye(r),machine:this.machine}))};t.prototype.transitionLeafNode=function(t,e,r){var i=this.getStateNode(t);var n=i.next(e,r);if(!n||!n.transitions.length){return this.next(e,r)}return n};t.prototype.transitionCompoundNode=function(t,e,r){var i=Object.keys(t);var n=this.getStateNode(i[0]);var s=n._transition(t[i[0]],e,r);if(!s||!s.transitions.length){return this.next(e,r)}return s};t.prototype.transitionParallelNode=function(t,e,r){var i,n;var s={};try{for(var o=k(Object.keys(t)),c=o.next();!c.done;c=o.next()){var a=c.value;var l=t[a];if(!l){continue}var u=this.getStateNode(a);var f=u._transition(l,e,r);if(f){s[a]=f}}}catch(t){i={error:t}}finally{try{if(c&&!c.done&&(n=o.return))n.call(o)}finally{if(i)throw i.error}}var h=Object.keys(s).map((function(t){return s[t]}));var d=nt(h.map((function(t){return t.transitions})));var v=h.some((function(t){return t.transitions.length>0}));if(!v){return this.next(e,r)}var p=nt(Object.keys(s).map((function(t){return s[t].configuration})));return{transitions:d,exitSet:nt(h.map((function(t){return t.exitSet}))),configuration:p,source:e,actions:nt(Object.keys(s).map((function(t){return s[t].actions})))}};t.prototype._transition=function(t,e,r){if(yt(t)){return this.transitionLeafNode(t,e,r)}if(Object.keys(t).length===1){return this.transitionCompoundNode(t,e,r)}return this.transitionParallelNode(t,e,r)};t.prototype.getTransitionData=function(t,e){return this._transition(t.value,t,_t(e))};t.prototype.next=function(t,e){var r,i;var n=this;var s=e.name;var o=[];var c=[];var a;try{for(var l=k(this.getCandidates(s)),u=l.next();!u.done;u=l.next()){var f=u.value;var h=f.cond,d=f.in;var v=t.context;var p=d?yt(d)&&He(d)?t.matches(X(this.getStateNodeById(d).path,this.delimiter)):J(X(d,this.delimiter),et(this.path.slice(0,-2))(t.value)):true;var w=false;try{w=!h||At(this.machine,h,v,e,t)}catch(t){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,"':\n").concat(t.message))}if(w&&p){if(f.target!==undefined){c=f.target}o.push.apply(o,O([],x(f.actions),false));a=f;break}}}catch(t){r={error:t}}finally{try{if(u&&!u.done&&(i=l.return))i.call(l)}finally{if(r)throw r.error}}if(!a){return undefined}if(!c.length){return{transitions:[a],exitSet:[],configuration:t.value?[this]:[],source:t,actions:o}}var b=nt(c.map((function(e){return n.getRelativeStateNodes(e,t.historyValue)})));var y=!!a.internal;return{transitions:[a],exitSet:y?[]:nt(c.map((function(t){return n.getPotentiallyReenteringNodes(t)}))),configuration:b,source:t,actions:o}};t.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order){return[this]}var e=[];var r=this;var i=t;while(r&&r!==i){e.push(r);r=r.parent}if(r!==i){return[]}e.push(i);return e};t.prototype.getActions=function(t,e,r,i,n,s,o){var c,a,l,u;var f=this;var h=s?ue([],this.getStateNodes(s.value)):[];var d=new Set;try{for(var v=k(Array.from(t).sort((function(t,e){return t.order-e.order}))),p=v.next();!p.done;p=v.next()){var w=p.value;if(!ve(h,w)||ve(r.exitSet,w)||w.parent&&d.has(w.parent)){d.add(w)}}}catch(t){c={error:t}}finally{try{if(p&&!p.done&&(a=v.return))a.call(v)}finally{if(c)throw c.error}}try{for(var b=k(h),y=b.next();!y.done;y=b.next()){var w=y.value;if(!ve(t,w)||ve(r.exitSet,w.parent)){r.exitSet.push(w)}}}catch(t){l={error:t}}finally{try{if(y&&!y.done&&(u=b.return))u.call(b)}finally{if(l)throw l.error}}r.exitSet.sort((function(t,e){return e.order-t.order}));var g=Array.from(d).sort((function(t,e){return t.order-e.order}));var m=new Set(r.exitSet);var S=nt(g.map((function(t){var e=[];if(t.type!=="final"){return e}var s=t.parent;if(!s.parent){return e}e.push($t(t.id,t.doneData),$t(s.id,t.doneData?ct(t.doneData,i,n):undefined));var o=s.parent;if(o.type==="parallel"){if(ae(o).every((function(t){return we(r.configuration,t)}))){e.push($t(o.id))}}return e})));var _=g.map((function(t){var e=t.onEntry;var r=t.activities.map((function(t){return Ut(t)}));return{type:"entry",actions:Lt(o?O(O([],x(e),false),x(r),false):O(O([],x(r),false),x(e),false),f.machine.options.actions)}})).concat({type:"state_done",actions:S.map((function(t){return It(t)}))});var E=Array.from(m).map((function(t){return{type:"exit",actions:Lt(O(O([],x(t.onExit),false),x(t.activities.map((function(t){return Vt(t)}))),false),f.machine.options.actions)}}));var j=E.concat({type:"transition",actions:Lt(r.actions,this.machine.options.actions)}).concat(_);if(e){var A=Lt(nt(O([],x(t),false).sort((function(t,e){return e.order-t.order})).map((function(t){return t.onExit}))),this.machine.options.actions).filter((function(t){return!Tt(t)}));return j.concat({type:"stop",actions:A})}return j};t.prototype.transition=function(t,e,r,i){if(t===void 0){t=this.initialState}var n=_t(e);var s;if(t instanceof xe){s=r===undefined?t:this.resolveState(xe.from(t,r))}else{var o=yt(t)?this.resolve(Y(this.getResolvedPath(t))):this.resolve(t);var c=r!==null&&r!==void 0?r:this.machine.context;s=this.resolveState(xe.from(o,c))}if(!V&&n.name===Me){throw new Error("An event cannot have the wildcard type ('".concat(Me,"')"))}if(this.strict){if(!this.events.includes(n.name)&&!at(n.name)){throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(n.name,"'"))}}var a=this._transition(s.value,s,n)||{transitions:[],configuration:[],exitSet:[],source:s,actions:[]};var l=ue([],this.getStateNodes(s.value));var u=a.configuration.length?ue(l,a.configuration):l;a.configuration=O([],x(u),false);return this.resolveTransition(a,s,s.context,i,n)};t.prototype.resolveRaisedTransition=function(t,e,r,i){var n;var s=t.actions;t=this.transition(t,e,undefined,i);t._event=r;t.event=r.data;(n=t.actions).unshift.apply(n,O([],x(s),false));return t};t.prototype.resolveTransition=function(t,e,r,i,n){var s,o,c,a;var l=this;if(n===void 0){n=Ft}var u=t.configuration;var f=!e||t.transitions.length>0;var h=f?t.configuration:e?e.configuration:[];var d=we(h,this);var v=f?de(this.machine,u):undefined;var p=e?e.historyValue?e.historyValue:t.source?this.machine.historyValue(e.value):undefined:undefined;var w=this.getActions(new Set(h),d,t,r,n,e,i);var b=e?g({},e.activities):{};try{for(var y=k(w),m=y.next();!m.done;m=y.next()){var O=m.value;try{for(var S=(c=void 0,k(O.actions)),_=S.next();!_.done;_=S.next()){var A=_.value;if(A.type===E){b[A.activity.id||A.activity.type]=A}else if(A.type===j){b[A.activity.id||A.activity.type]=false}}}catch(t){c={error:t}}finally{try{if(_&&!_.done&&(a=S.return))a.call(S)}finally{if(c)throw c.error}}}}catch(t){s={error:t}}finally{try{if(m&&!m.done&&(o=y.return))o.call(y)}finally{if(s)throw s.error}}var z=x(Yt(this,e,r,n,w,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),C=z[0],T=z[1];var F=x(ft(C,Tt),2),R=F[0],L=F[1];var P=C.filter((function(t){var e;return t.type===E&&((e=t.activity)===null||e===void 0?void 0:e.type)===N}));var B=P.reduce((function(t,e){t[e.activity.id]=ee(e.activity,l.machine,T,n);return t}),e?g({},e.children):{});var M=new xe({value:v||e.value,context:T,_event:n,_sessionid:e?e._sessionid:null,historyValue:v?p?dt(p,v):undefined:e?e.historyValue:undefined,history:!v||t.source?e:undefined,actions:v?L:[],activities:v?b:e?e.activities:{},events:[],configuration:h,transitions:t.transitions,children:B,done:d,tags:ye(h),machine:this});var W=r!==T;M.changed=n.name===I||W;var H=M.history;if(H){delete H.history}var D=!d&&(this._transient||u.some((function(t){return t._transient})));if(!f&&(!D||n.name===Ie)){return M}var U=M;if(!d){if(D){U=this.resolveRaisedTransition(U,{type:q},n,i)}while(R.length){var V=R.shift();U=this.resolveRaisedTransition(U,V._event,n,i)}}var K=U.changed||(H?!!U.actions.length||W||typeof H.value!==typeof U.value||!ge(U.value,H.value):undefined);U.changed=K;U.history=H;return U};t.prototype.getStateNode=function(t){if(He(t)){return this.machine.getStateNodeById(t)}if(!this.states){throw new Error("Unable to retrieve child state '".concat(t,"' from '").concat(this.id,"'; no child states exist."))}var e=this.states[t];if(!e){throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"))}return e};t.prototype.getStateNodeById=function(t){var e=He(t)?t.slice(Be.length):t;if(e===this.id){return this}var r=this.machine.idMap[e];if(!r){throw new Error("Child state node '#".concat(e,"' does not exist on machine '").concat(this.id,"'"))}return r};t.prototype.getStateNodeByPath=function(t){if(typeof t==="string"&&He(t)){try{return this.getStateNodeById(t.slice(1))}catch(t){}}var e=G(t,this.delimiter).slice();var r=this;while(e.length){var i=e.shift();if(!i.length){break}r=r.getStateNode(i)}return r};t.prototype.resolve=function(t){var e;var r=this;if(!t){return this.initialStateValue||We}switch(this.type){case"parallel":return Z(this.initialStateValue,(function(e,i){return e?r.getStateNode(i).resolve(t[i]||e):We}));case"compound":if(yt(t)){var i=this.getStateNode(t);if(i.type==="parallel"||i.type==="compound"){return e={},e[t]=i.initialStateValue,e}return t}if(!Object.keys(t).length){return this.initialStateValue||{}}return Z(t,(function(t,e){return t?r.getStateNode(e).resolve(t):We}));default:return t||We}};t.prototype.getResolvedPath=function(t){if(He(t)){var e=this.machine.idMap[t.slice(Be.length)];if(!e){throw new Error("Unable to find state node '".concat(t,"'"))}return e.path}return G(t,this.delimiter)};Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue){return this.__cache.initialStateValue}var e;if(this.type==="parallel"){e=tt(this.states,(function(t){return t.initialStateValue||We}),(function(t){return!(t.type==="history")}))}else if(this.initial!==undefined){if(!this.states[this.initial]){throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"))}e=oe(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else{e={}}this.__cache.initialStateValue=e;return this.__cache.initialStateValue},enumerable:false,configurable:true});t.prototype.getInitialState=function(t,e){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:undefined,actions:[]},undefined,e!==null&&e!==void 0?e:this.machine.context,undefined)};Object.defineProperty(t.prototype,"initialState",{get:function(){var t=this.initialStateValue;if(!t){throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."))}return this.getInitialState(t)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"target",{get:function(){var t;if(this.type==="history"){var e=this.config;if(yt(e.target)){t=He(e.target)?Y(this.machine.getStateNodeById(e.target).path.slice(this.path.length-1)):e.target}else{t=e.target}}return t},enumerable:false,configurable:true});t.prototype.getRelativeStateNodes=function(t,e,r){if(r===void 0){r=true}return r?t.type==="history"?t.resolveHistory(e):t.initialStateNodes:[t]};Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var t=this;if(oe(this)){return[this]}if(this.type==="compound"&&!this.initial){if(!V){pt(false,"Compound state node '".concat(this.id,"' has no initial state."))}return[this]}var e=it(this.initialStateValue);return nt(e.map((function(e){return t.getFromRelativePath(e)})))},enumerable:false,configurable:true});t.prototype.getFromRelativePath=function(t){if(!t.length){return[this]}var e=x(t),r=e[0],i=e.slice(1);if(!this.states){throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"))}var n=this.getStateNode(r);if(n.type==="history"){return n.resolveHistory()}if(!this.states[r]){throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"))}return this.states[r].getFromRelativePath(i)};t.prototype.historyValue=function(t){if(!Object.keys(this.states).length){return undefined}return{current:t||this.initialStateValue,states:tt(this.states,(function(e,r){if(!t){return e.historyValue()}var i=yt(t)?undefined:t[r];return e.historyValue(i||e.initialStateValue)}),(function(t){return!t.history}))}};t.prototype.resolveHistory=function(t){var e=this;if(this.type!=="history"){return[this]}var r=this.parent;if(!t){var i=this.target;return i?nt(it(i).map((function(t){return r.getFromRelativePath(t)}))):r.initialStateNodes}var n=rt(r.path,"states")(t).current;if(yt(n)){return[r.getStateNode(n)]}return nt(it(n).map((function(t){return e.history==="deep"?r.getFromRelativePath(t):[r.states[t[0]]]})))};Object.defineProperty(t.prototype,"stateIds",{get:function(){var t=this;var e=nt(Object.keys(this.states).map((function(e){return t.states[e].stateIds})));return[this.id].concat(e)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"events",{get:function(){var t,e,r,i;if(this.__cache.events){return this.__cache.events}var n=this.states;var s=new Set(this.ownEvents);if(n){try{for(var o=k(Object.keys(n)),c=o.next();!c.done;c=o.next()){var a=c.value;var l=n[a];if(l.states){try{for(var u=(r=void 0,k(l.events)),f=u.next();!f.done;f=u.next()){var h=f.value;s.add("".concat(h))}}catch(t){r={error:t}}finally{try{if(f&&!f.done&&(i=u.return))i.call(u)}finally{if(r)throw r.error}}}}}catch(e){t={error:e}}finally{try{if(c&&!c.done&&(e=o.return))e.call(o)}finally{if(t)throw t.error}}}return this.__cache.events=Array.from(s)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter((function(t){return!(!t.target&&!t.actions.length&&t.internal)})).map((function(t){return t.eventType})));return Array.from(t)},enumerable:false,configurable:true});t.prototype.resolveTarget=function(t){var e=this;if(t===undefined){return undefined}return t.map((function(t){if(!yt(t)){return t}var r=t[0]===e.delimiter;if(r&&!e.parent){return e.getStateNodeByPath(t.slice(1))}var i=r?e.key+t:t;if(e.parent){try{var n=e.parent.getStateNodeByPath(i);return n}catch(t){throw new Error("Invalid transition definition for state node '".concat(e.id,"':\n").concat(t.message))}}else{return e.getStateNodeByPath(i)}}))};t.prototype.formatTransition=function(t){var e=this;var r=jt(t.target);var i="internal"in t?t.internal:r?r.some((function(t){return yt(t)&&t[0]===e.delimiter})):true;var n=this.machine.options.guards;var s=this.resolveTarget(r);var o=g(g({},t),{actions:Lt(ot(t.actions)),cond:gt(t.cond,n),target:s,source:this,internal:i,eventType:t.event,toJSON:function(){return g(g({},o),{target:o.target?o.target.map((function(t){return"#".concat(t.id)})):undefined,source:"#".concat(e.id)})}});return o};t.prototype.formatTransitions=function(){var t,e;var r=this;var i;if(!this.config.on){i=[]}else if(Array.isArray(this.config.on)){i=this.config.on}else{var n=this.config.on,s=Me,o=n[s],c=o===void 0?[]:o,a=m(n,[typeof s==="symbol"?s:s+""]);i=nt(Object.keys(a).map((function(t){if(!V&&t===Ie){pt(false,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(r.id,'".'))}var e=Et(t,a[t]);if(!V){Ue(r,t,e)}return e})).concat(Et(Me,c)))}var l=this.config.always?Et("",this.config.always):[];var u=this.config.onDone?Et(String($t(this.id)),this.config.onDone):[];if(!V){pt(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'))}var f=nt(this.invoke.map((function(t){var e=[];if(t.onDone){e.push.apply(e,O([],x(Et(String(Gt(t.id)),t.onDone)),false))}if(t.onError){e.push.apply(e,O([],x(Et(String(Qt(t.id)),t.onError)),false))}return e})));var h=this.after;var d=nt(O(O(O(O([],x(u),false),x(f),false),x(i),false),x(l),false).map((function(t){return ot(t).map((function(t){return r.formatTransition(t)}))})));try{for(var v=k(h),p=v.next();!p.done;p=v.next()){var w=p.value;d.push(w)}}catch(e){t={error:e}}finally{try{if(p&&!p.done&&(e=v.return))e.call(v)}finally{if(t)throw t.error}}return d};return t}();function Ke(t,e,r){if(r===void 0){r=t.context}return new Ve(t,e,r)}const Je=(t,e)=>t.textContent.toLowerCase().startsWith(e.toLowerCase());const $e=["m","l"];function Ge(t){return $e.includes(t)}const Qe=({disabled:e,option:r,onRemove:i})=>{const n={};if(r.chipColor){n["color"]=r.chipColor}if(r.chipBackgroundColor){n["background-color"]=r.chipBackgroundColor}return t("label",{class:"wcs-select-chip",style:n,onClick:t=>t.stopImmediatePropagation()},t("div",null,r.displayText),e?null:t("div",{onClick:()=>i(r)},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"12",viewBox:"0 0 20 12",class:"chip"},t("path",{d:"M2,0 6,4 10,0 12,2 8,6 12,10 10,12 6,8 2,12 0,10 4,6 0,2 2,0",fill:r.chipColor,transform:"translate(8 0)"}))))};function Xe(t,e,r){const i=p(t);if(i==="UNKNOWN"){return[]}switch(e){case"closed":switch(i){case"MAJ+TAB":switch(r){case"unique":case"multiple":return[];case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"MoveFocus",target:"previous"}]}break;case"DOWN_ARROW":switch(r){case"unique":return[{kind:"SelectOption",target:"next"}];case"autocomplete_multiple":case"autocomplete_unique":return[{kind:"OpenSelect"},{kind:"HighlightOption",target:"first"}];case"multiple":return[{kind:"OpenSelect"},{kind:"FocusOption",target:"first"}]}break;case"RIGHT_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":return[{kind:"SelectOption",target:"next"}];case"multiple":return[{kind:"OpenSelect"},{kind:"FocusOption",target:"first"}]}break;case"UP_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"OpenSelect"},{kind:"HighlightOption",target:"last"}];case"multiple":break;case"unique":return[{kind:"SelectOption",target:"previous"}]}break;case"LEFT_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":return[{kind:"SelectOption",target:"previous"}]}break;case"ALT+DOWN_ARROW":case"ALT+UP_ARROW":switch(r){case"unique":return[{kind:"OpenSelect"},{kind:"FocusOption",target:"first"}];case"autocomplete_unique":case"autocomplete_multiple":case"multiple":return[{kind:"OpenSelect"}]}break;case"SPACE":case"ENTER":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":case"multiple":return[{kind:"OpenSelect"},{kind:"FocusOption",target:"lastFocused"}]}break;case"ESCAPE":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"ClearAutocompleteInput"}];case"unique":case"multiple":return[]}break;case"PAGE_UP":switch(r){case"autocomplete_unique":return[];case"autocomplete_multiple":return[];case"unique":return[{kind:"SelectOption",target:"first"}];case"multiple":return[]}break;case"PAGE_DOWN":switch(r){case"autocomplete_unique":return[];case"autocomplete_multiple":return[];case"unique":return[{kind:"SelectOption",target:"last"}];case"multiple":return[]}break}break;case"opened":switch(i){case"ESCAPE":switch(r){case"unique":case"multiple":case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"CloseSelect",shouldBlur:false}]}break;case"ALT+UP_ARROW":switch(r){case"unique":case"multiple":return[{kind:"CloseSelect",shouldBlur:false}];case"autocomplete_unique":case"autocomplete_multiple":return[]}break;case"TAB":switch(r){case"autocomplete_unique":return[{kind:"SelectOption",target:"lastHighlighted"},{kind:"CloseSelect",shouldBlur:false}];case"autocomplete_multiple":return[{kind:"CloseSelect",shouldBlur:false}];case"unique":case"multiple":return[{kind:"CloseSelect",shouldBlur:true}]}break;case"MAJ+TAB":switch(r){case"autocomplete_unique":return[{kind:"SelectOption",target:"lastHighlighted"},{kind:"CloseSelect",shouldBlur:false},{kind:"MoveFocus",target:"previous"}];case"autocomplete_multiple":return[{kind:"CloseSelect",shouldBlur:false},{kind:"MoveFocus",target:"previous"}];case"unique":case"multiple":return[{kind:"CloseSelect",shouldBlur:true}]}break;case"UP_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"HighlightOption",target:"previous"}];case"unique":case"multiple":return[{kind:"FocusOption",target:"previous"}]}break;case"LEFT_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":case"multiple":return[{kind:"FocusOption",target:"previous"}]}break;case"DOWN_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"HighlightOption",target:"next"}];case"unique":case"multiple":return[{kind:"FocusOption",target:"next"}]}break;case"RIGHT_ARROW":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[];case"unique":case"multiple":return[{kind:"FocusOption",target:"next"}]}break;case"PAGE_UP":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"HighlightOption",target:"first"}];case"unique":case"multiple":return[{kind:"FocusOption",target:"first"}]}break;case"PAGE_DOWN":switch(r){case"autocomplete_unique":case"autocomplete_multiple":return[{kind:"HighlightOption",target:"last"}];case"unique":case"multiple":return[{kind:"FocusOption",target:"last"}]}break;case"ENTER":switch(r){case"autocomplete_unique":return[{kind:"SelectOption",target:"lastHighlighted"}];case"autocomplete_multiple":return[{kind:"SelectOption",target:"lastHighlighted"}]}break}break;default:throw Error("Unknown error")}return[]}const Ye=':host{--wcs-select-ligther-percentage:40;--wcs-select-control-border-radius:var(--wcs-semantic-border-radius-base);--wcs-select-text-color-disabled:var(--wcs-semantic-color-text-disabled);--wcs-select-value-color:var(--wcs-semantic-color-text-primary);--wcs-select-value-font-weight:var(--wcs-semantic-font-weight-medium);--wcs-select-placeholder-color:var(--wcs-semantic-color-text-tertiary);--wcs-select-placeholder-font-weight:var(--wcs-semantic-font-weight-roman);--wcs-select-placeholder-font-style:var(--wcs-semantic-font-style-control-placeholder);--wcs-select-options-padding:var(--wcs-semantic-spacing-base-150);--wcs-select-control-line-height:var(--wcs-semantic-font-line-height-large);--wcs-select-control-background-color:var(--wcs-semantic-color-background-control-default);--wcs-select-control-arrow-color:var(--wcs-semantic-color-foreground-action-secondary-default);--wcs-select-control-arrow-color-disabled:var(--wcs-semantic-color-foreground-disabled);--wcs-select-control-chips-gap:var(--wcs-semantic-spacing-small);--wcs-select-control-border-color-default:var(--wcs-semantic-color-border-primary);--wcs-select-control-border-color-disabled:var(--wcs-semantic-color-border-disabled);--wcs-select-control-border-color-focus:var(--wcs-semantic-color-border-control-focus);--wcs-select-control-border-color-error:var(--wcs-semantic-color-border-critical);--wcs-select-control-border-style-default:solid;--wcs-select-control-border-style-error:solid;--wcs-select-control-border-style-focus:var(--wcs-semantic-border-style-focus-control);--wcs-select-control-border-width-default:var(--wcs-semantic-border-width-default);--wcs-select-control-border-width-focus:var(--wcs-semantic-border-width-large);--wcs-select-control-padding-horizontal-m:var(--wcs-semantic-spacing-large);--wcs-select-control-padding-horizontal-l:var(--wcs-semantic-spacing-large);--wcs-select-control-height:var(--wcs-select-control-height-m);--wcs-select-control-height-m:var(--wcs-semantic-size-m);--wcs-select-control-height-l:var(--wcs-semantic-size-l);--wcs-internal-select-chip-size:var(--wcs-semantic-size-s);--wcs-select-control-font-size:var(--wcs-select-control-font-size-m, 1rem);--wcs-select-control-font-size-m:var(--wcs-semantic-font-size-m);--wcs-select-control-font-size-l:var(--wcs-semantic-font-size-l);--wcs-select-overlay-max-height:360px;--wcs-select-overlay-background-color:var(--wcs-semantic-color-background-surface-primary);--wcs-select-overlay-border-width:var(--wcs-semantic-border-width-default);--wcs-select-overlay-border-color:var(--wcs-semantic-color-border-secondary);--wcs-select-overlay-border-radius:var(--wcs-semantic-border-radius-base);--wcs-select-control-chip-color-default:var(--wcs-semantic-color-foreground-action-primary-default);--wcs-select-control-chip-color-disabled:var(--wcs-semantic-color-text-disabled);--wcs-select-control-chip-background-color-default:var(--wcs-semantic-color-background-action-primary-default);--wcs-select-control-chip-background-color-disabled:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-select-control-chip-padding-vertical:var(--wcs-semantic-spacing-small);--wcs-select-control-chip-padding-horizontal:calc(1.5 * var(--wcs-semantic-spacing-base));--wcs-select-control-chip-line-height:var(--wcs-semantic-font-line-height-large);--wcs-select-control-chip-border-radius:var(--wcs-semantic-border-radius-base);--wcs-select-control-autocomplete-padding-vertical-m:var(--wcs-semantic-spacing-small);--wcs-select-control-autocomplete-padding-vertical-l:var(--wcs-semantic-spacing-small);--wcs-select-internal-noresult-padding-horizontal:var(--wcs-semantic-spacing-base);display:block;min-height:var(--wcs-select-control-height);position:relative;outline:none;user-select:none;box-sizing:border-box}:host svg{flex-shrink:0}:host .wcs-select-control{min-height:var(--wcs-select-control-height);outline:var(--wcs-select-control-border-width-default) var(--wcs-select-control-border-style-default) var(--wcs-select-control-border-color-default);outline-offset:calc(var(--wcs-select-control-border-width-default) * -1)}:host .arrow{fill:var(--wcs-select-control-arrow-color)}:host .chip{fill:var(--wcs-select-control-chip-color-default);opacity:calc((100 - var(--wcs-select-ligther-percentage)) / 100)}:host .chip:hover{opacity:100}.wcs-select-control{box-sizing:border-box;display:flex;align-items:center;background-color:var(--wcs-select-control-background-color);border-radius:var(--wcs-select-control-border-radius);outline:var(--wcs-select-control-border-color-default) solid var(--wcs-select-control-border-width-default);outline-offset:calc(var(--wcs-select-control-border-width-default) * -1);font-size:var(--wcs-select-control-font-size, 1rem);line-height:var(--wcs-select-control-line-height);cursor:pointer;padding-left:var(--wcs-select-control-padding-horizontal-m);padding-right:calc(var(--wcs-select-control-padding-horizontal-m) - 4px)}label{cursor:pointer;transition:color 125ms ease-in;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label.wcs-select-placeholder{color:var(--wcs-select-placeholder-color);font-style:var(--wcs-select-placeholder-font-style);font-weight:var(--wcs-select-placeholder-font-weight)}label.wcs-select-value{color:var(--wcs-select-value-color);font-style:normal;font-weight:var(--wcs-select-value-font-weight)}label::after{content:"";padding:1px}.wcs-select-value-container{max-width:calc(100% - (24px + var(--wcs-semantic-spacing-base)));padding-right:8px;display:flex;flex-direction:row;gap:var(--wcs-select-control-chips-gap);align-items:center;flex-wrap:wrap}.wcs-select-chip{box-sizing:border-box;height:var(--wcs-internal-select-chip-size);line-height:var(--wcs-select-control-chip-line-height);color:var(--wcs-select-control-chip-color-default);background-color:var(--wcs-select-control-chip-background-color-default);border-radius:var(--wcs-select-control-chip-border-radius);display:flex;align-items:center;padding:var(--wcs-select-control-chip-padding-vertical) var(--wcs-select-control-chip-padding-horizontal);overflow:initial;z-index:1}.wcs-select-options{display:none;position:absolute;z-index:999999999;border:solid var(--wcs-select-overlay-border-width) var(--wcs-select-overlay-border-color);border-radius:var(--wcs-select-overlay-border-radius);max-height:var(--wcs-select-overlay-max-height);overflow-y:auto;width:calc(100% - (2 * var(--wcs-select-overlay-border-width) + 2 * var(--wcs-select-options-padding)));padding:var(--wcs-select-options-padding);background-color:var(--wcs-select-overlay-background-color)}:host(.expanded){outline-width:var(--wcs-select-control-border-width-focus)}:host(.expanded) .wcs-select-control{outline:var(--wcs-select-control-border-width-focus) var(--wcs-select-control-border-style-focus) var(--wcs-select-control-border-color-focus);outline-offset:calc(var(--wcs-select-control-border-width-focus) * -1)}:host(.expanded) .wcs-select-options{display:block}:host([aria-invalid=true]) .wcs-select-control,:host([autocomplete]):has(input[aria-invalid=true]) .wcs-select-control{outline-style:var(--wcs-select-control-border-style-error);outline-color:var(--wcs-select-control-border-color-error)}:host(:not(.expanded):focus-visible){outline-width:var(--wcs-select-control-border-width-focus)}:host(:not(.expanded):focus-visible) .wcs-select-control{outline:var(--wcs-select-control-border-width-focus) var(--wcs-select-control-border-style-focus) var(--wcs-select-control-border-color-focus);outline-offset:calc(var(--wcs-select-control-border-width-focus) * -1)}:host([disabled]){cursor:not-allowed;--wcs-select-control-background-color:var(--wcs-semantic-color-background-control-disabled)}:host([disabled]) .wcs-select-control{outline-style:var(--wcs-select-control-border-style-default);outline-color:var(--wcs-select-control-border-color-disabled)}:host([disabled]) .wcs-select-control,:host([disabled]) label{cursor:default;pointer-events:none}:host([disabled]) label{color:var(--wcs-select-text-color-disabled)}:host([disabled]) .arrow{fill:var(--wcs-select-control-arrow-color-disabled)}:host([disabled]) .wcs-select-chip{color:var(--wcs-select-control-chip-color-disabled);background-color:var(--wcs-select-control-chip-background-color-disabled)}:host([disabled]) .chip{fill:var(--wcs-select-control-chip-color-disabled)}:host([size=m]){--wcs-select-control-font-size:var(--wcs-select-control-font-size-m);--wcs-select-control-height:var(--wcs-select-control-height-m);--wcs-internal-select-chip-size:var(--wcs-select-chip-size-m)}:host([size=m]) .wcs-select-control{padding-left:var(--wcs-select-control-padding-horizontal-m);padding-right:calc(var(--wcs-select-control-padding-horizontal-m) - 4px)}:host([size=m]):host([autocomplete]) .autocomplete-field{height:calc(var(--wcs-select-control-height) - var(--wcs-select-control-autocomplete-padding-vertical-m) * 2)}:host([size=m]):host([autocomplete]) .wcs-select-value-container{padding-top:var(--wcs-select-control-autocomplete-padding-vertical-m);padding-bottom:var(--wcs-select-control-autocomplete-padding-vertical-m)}:host([size=l]){--wcs-select-control-font-size:var(--wcs-select-control-font-size-l);--wcs-select-control-height:var(--wcs-select-control-height-l);--wcs-internal-select-chip-size:var(--wcs-select-chip-size-l)}:host([size=l]) .wcs-select-control{padding-left:var(--wcs-select-control-padding-horizontal-l);padding-right:calc(var(--wcs-select-control-padding-horizontal-l) - 4px)}:host([size=l]):host([autocomplete]) .autocomplete-field{height:calc(var(--wcs-select-control-height) - var(--wcs-select-control-autocomplete-padding-vertical-l) * 2)}:host([size=l]):host([autocomplete]) .wcs-select-value-container{padding-top:var(--wcs-select-control-autocomplete-padding-vertical-l);padding-bottom:var(--wcs-select-control-autocomplete-padding-vertical-l)}:host([chips]) .wcs-select-control{flex-wrap:wrap}:host([chips]) .wcs-select-value-container{margin-top:4px;margin-bottom:4px}:host([autocomplete]) .wcs-select-value-container{margin:0;width:100%}:host([autocomplete]) input{font:unset;background-color:transparent;outline:none;border:none;padding:unset;color:var(--wcs-select-value-color);font-weight:var(--wcs-select-value-font-weight) !important;font-size:var(--wcs-select-control-font-size);line-height:inherit}:host([autocomplete]) input::placeholder{color:var(--wcs-select-placeholder-color);opacity:1;font-weight:var(--wcs-select-placeholder-font-weight);font-style:var(--wcs-select-placeholder-font-style)}:host([autocomplete]:focus-within) .wcs-select-control{outline:var(--wcs-select-control-border-width-focus) var(--wcs-select-control-border-style-focus) var(--wcs-select-control-border-color-focus);outline-offset:calc(var(--wcs-select-control-border-width-focus) * -1)}.autocomplete-field{width:0;min-width:50px;flex-grow:1}.noresult-container{padding-left:var(--wcs-select-internal-noresult-padding-horizontal);padding-right:var(--wcs-select-internal-noresult-padding-horizontal);display:flex;flex-direction:row;align-items:center;height:var(--wcs-select-control-height)}';const Ze=Ye;const tr={key:"select",initial:"closed",states:{closed:{entry:["close"],on:{CLICK:"opened",OPEN:"opened",OPTION_SELECTED:{actions:["selectOption"]}}},opened:{entry:["open"],on:{CLICK:"closed",CLOSE:"closed",OPTION_SELECTED:{actions:["selectOption"]}}}}};const er=["tabindex","title"];const rr=class{constructor(t){e(this,t);this.wcsChange=r(this,"wcsChange",7);this.wcsFocus=r(this,"wcsFocus",7);this.wcsBlur=r(this,"wcsBlur",7);this.wcsFilterChange=r(this,"wcsFilterChange",7);this.inheritedAttributes={};this.selectId=`wcs-select-${ir++}`;this.optionsId=o("OPTIONS");this.expanded=false;this.size="m";this.displayText=undefined;this.focused=undefined;this.value=undefined;this.placeholder=undefined;this.disabled=false;this.required=false;this.multiple=false;this.autocomplete=false;this.serverMode=false;this.filterFn=undefined;this.chips=false;this.name=undefined;this.compareWith=(t,e)=>b(t,e);this.showNoResultFoundLabel=false;this.autocompleteValue=undefined;this.overlayDirection="bottom"}async open(){this.stateService.send("OPEN")}async close(){this.stateService.send("CLOSE")}onValueChangeHandler(t){this.updateSelectedValue(t)}updateSelectedValue(t,e=true){var r;if(!t&&e){this.reset()}if(this.multiple){if(!Array.isArray(t)){t=[t]}this.lastModifiedOptionElement=t.length>0?(r=Array.from(this.options).find((e=>this.compareWith(e.value,t[t.length-1]))))!==null&&r!==void 0?r:null:null;if(this.serverMode){const e=c(this.values.map((t=>t.value)),t,this.compareWith);e.added.forEach((t=>{const e=Array.from(this.options).find((e=>this.compareWith(e.value,t)));if(e){this.values.push({value:e.value,displayText:e.innerText,chipColor:e.chipColor,chipBackgroundColor:e.chipBackgroundColor});e.selected=true}}));e.kept.forEach((t=>{const e=Array.from(this.options).find((e=>this.compareWith(e.value,t)));if(e){e.selected=true}}));e.removed.forEach((t=>{this.values=this.values.filter((e=>!this.compareWith(e.value,t)));const e=Array.from(this.options).find((e=>this.compareWith(e.value,t)));if(e){e.selected=false}}))}else{this.values=[];this.options.forEach((e=>{const r=t?t.findIndex((t=>this.compareWith(e.value,t)))!==-1:false;if(r){this.values.push({value:e.value,displayText:e.innerText,chipColor:e.chipColor,chipBackgroundColor:e.chipBackgroundColor})}e.selected=r}))}this.displayText=this.values.length!==0?this.values.map((t=>t.displayText)).join(", "):undefined}else{this.options.forEach((e=>{const r=this.compareWith(e.value,t);if(r){this.displayText=e.innerText;this.lastModifiedOptionElement=e;if(this.autocomplete){this.setAutocompleteValue(e.innerText)}}e.selected=r}))}}reset(){this.values=[];this.displayText=undefined;if(this.autocomplete){this.setAutocompleteValue("",true)}this.options.forEach((t=>{t.selected=false}))}componentDidLoad(){this.optionsEl=this.el.shadowRoot.querySelector(".wcs-select-options");this.controlEl=this.el.shadowRoot.querySelector(".wcs-select-control");const t=Ke(tr,this.initMachineOptions());this.stateService=Ne(t);if(this.multiple){this.values=[]}this.stateService.start();if(this.optionsEl.querySelector("slot")===null){this.replaceOptions_firefoxBefore63();this.listenDomUpdate_firefoxBefore63()}if(this.value!==undefined){this.updateSelectedValue(this.value)}this.popper=this.createPopperInstance();this.labelElement=a(this.el);if(this.labelElement){this.labelElement.id=this.selectId+"-lbl"}}createPopperInstance(){return y(this.controlEl,this.optionsEl,{placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,4]}}]})}emitChange(t){this.wcsChange.emit({value:t})}replaceOptions_firefoxBefore63(){Array.from(this.el.querySelectorAll("wcs-select-option")).forEach((t=>{if(t.parentNode===this.el){this.el.removeChild(t);this.optionsEl.appendChild(t)}}))}listenDomUpdate_firefoxBefore63(){const t=new MutationObserver((t=>{for(const e of t){if(e.type==="childList"){this.replaceOptions_firefoxBefore63()}}}));t.observe(this.el,{childList:true})}componentWillRender(){if(this.multiple){this.options.forEach((t=>t.multiple=true))}}componentWillLoad(){if(!Ge(this.size)){console.warn(`Invalid size value for wcs-select : "${this.size}". Must be one of "${$e.join(", ")}"`);this.size="m"}if(this.autocomplete){this.inheritedAttributes=Object.assign(Object.assign({},l(this.el)),u(this.el,er))}}async setAriaAttribute(t,e){if(this.autocomplete===false){f(this.el,t,e)}else{f(this.autocompleteInput,t,e)}}get options(){var t;const e=(t=this.el)===null||t===void 0?void 0:t.querySelectorAll("wcs-select-option");if(e&&e.length!==0){return e}return[]}get notDisabledOptions(){var t;const e=(t=this.el)===null||t===void 0?void 0:t.querySelectorAll("wcs-select-option:not([disabled]):not([aria-hidden])");if(e&&e.length!==0){return e}return[]}initMachineOptions(){return{actions:{open:()=>{var t;if(!this.disabled){this.expanded=true;this.focused=false;if(this.multiple===false&&this.autocomplete&&this.hasValue===false){if(this.autocompleteValue&&this.autocompleteValue!==""){this.setAutocompleteValue(this.autocompleteValue)}}this.clearHighlightOnLastHighlightedOption();if(this.notDisabledOptions.length>0){this.lastFocusedOptionElement=(t=this.lastModifiedOptionElement)!==null&&t!==void 0?t:this.notDisabledOptions[0];requestAnimationFrame((()=>{var t,e;this.autocomplete?(t=this.autocompleteInput)===null||t===void 0?void 0:t.focus():(e=this.lastFocusedOptionElement)===null||e===void 0?void 0:e.focus()}))}}},close:(t,e)=>{var r,i;if(e.type==="CLOSE"){this.clearHighlightOnLastHighlightedOption();if((r=e.value)===null||r===void 0?void 0:r.shouldBlur){this.focused=false}else{if(this.autocomplete&&((i=e.value)===null||i===void 0?void 0:i.fromKeyboard)){this.focusAutocompleteInput()}else{this.el.focus()}this.focused=true}}this.expanded=false},selectOption:(t,e)=>{if(e.type==="OPTION_SELECTED"){if(this.multiple){this.handleOptionSelectedOnMultiple(e.value.option)}else{this.handleOptionSelectedOnSingle(e.value.option);this.stateService.send("CLOSE",{value:{fromKeyboard:e.value.fromKeyboard}})}if(this.autocomplete){if(this.multiple){requestAnimationFrame((()=>{this.autocompleteInput.focus()}))}else{this.autocompleteValue=e.value.option.displayText}}this.emitChange(this.value)}}},guards:{enabled:()=>!this.disabled}}}handleOptionSelectedOnMultiple(t){const e=this.values.findIndex((e=>this.compareWith(e.value,t.value)));if(e===-1){this.value=[...this.values.map((t=>t.value)),t.value]}else{this.value=this.values.filter((e=>!this.compareWith(e.value,t.value))).map((t=>t.value))}}handleOptionSelectedOnSingle(t){this.value=t.value}disconnectedCallback(){var t;(t=this.stateService)===null||t===void 0?void 0:t.stop()}get hasValue(){return this.displayText!==undefined}onMouseUp(t){const e=h(t.target)&&(t.offsetX>t.target.clientWidth||t.offsetY>t.target.clientHeight||t.offsetY<0);const r=t.composedPath().filter((t=>{const e=t;return e.nodeName==="svg"&&e.classList.contains("chip")})).length>0;if(!e&&!r){this.stateService.send("CLICK")}}onWindowClickEvent(t){const e=t.composedPath().filter((t=>t.nodeName==="WCS-SELECT"))[0];const r=e===this.el;if(this.expanded&&!r){this.stateService.send({type:"CLOSE",value:{shouldBlur:true,fromKeyboard:false}})}}onKeyDown(t){const e=this.stateService.getSnapshot().matches("closed")?"closed":"opened";let r;if(this.autocomplete){r=this.multiple?"autocomplete_multiple":"autocomplete_unique"}else{r=this.multiple?"multiple":"unique"}const i=Xe(t,e,r);if(i.length!=0&&i.filter((t=>t.kind==="MoveFocus")).length===0){t.preventDefault()}for(const e of i){this.doActionFromKeyboardEventAssociatedAction(e,t)}}doActionFromKeyboardEventAssociatedAction(t,e){var r,i;switch(t.kind){case"CloseSelect":this.stateService.send({type:"CLOSE",value:{shouldBlur:t.shouldBlur,fromKeyboard:true}});break;case"OpenSelect":this.stateService.send("OPEN");break;case"SelectOption":switch(t.target){case"next":this.selectClosestOption("next");break;case"previous":this.selectClosestOption("previous");break;case"first":this.selectFirstOption();break;case"last":this.selectLastOption();break;case"lastHighlighted":{const t=Array.from(this.notDisabledOptions).indexOf(this.lastHighlightedOptionElement);if(t!==-1){this.lastModifiedOptionElement=this.lastHighlightedOptionElement;this.selectOption(t,true)}break}}break;case"ClearAutocompleteInput":this.autocompleteValue="";break;case"ClearHighlight":this.clearHighlightOnLastHighlightedOption();break;case"HighlightOption":switch(t.target){case"next":this.highlightClosestOption("next");break;case"previous":this.highlightClosestOption("previous");break;case"first":this.highlightFirstOption();break;case"last":this.highlightLastOption();break}break;case"FocusOption":switch(t.target){case"next":this.focusClosestOption("next");break;case"previous":this.focusClosestOption("previous");break;case"first":this.focusFirstOption();break;case"last":this.focusLastOption();break;case"lastFocused":if(this.lastFocusedOptionElement!=null){this.focusOption(Array.from(this.notDisabledOptions).indexOf(this.lastFocusedOptionElement))}break}break;case"MoveFocus":switch(t.target){case"previous":{let t=(r=this.el.previousElementSibling)!==null&&r!==void 0?r:this.el.parentElement;while(t){if(w(t))break;t=(i=t.previousElementSibling)!==null&&i!==void 0?i:t.parentElement}if(t){e.preventDefault();t.focus()}break}}break;default:throw new Error("Internal error")}}getClosestActiveOptionIndexForState(t,e){let r;switch(e){case"focused":r=this.lastFocusedOptionElement;break;case"modified":r=this.lastModifiedOptionElement;break;case"highlighted":r=this.lastHighlightedOptionElement;break;default:r=null}let i=Array.from(this.notDisabledOptions).indexOf(r);const n=0;const s=this.notDisabledOptions.length-1;if(t==="next"&&i<s){i++}else if(t==="previous"&&i>n){i--}else{if(!this.autocomplete)return"nothing";if(t==="next"&&i>=s){i=0}if(t==="previous"&&i===n){i=s}}return i}selectOption(t,e=false){const r=this.notDisabledOptions[t];if(!r)return;this.sendOptionSelectedToStateMachine({source:r,value:r.value,displayText:r.innerText},e)}selectClosestOption(t){const e=this.getClosestActiveOptionIndexForState(t,"modified");if(e==="nothing")return;this.selectOption(e,true)}selectFirstOption(){if(this.notDisabledOptions.length<1){return}this.selectOption(0,true)}selectLastOption(){if(this.notDisabledOptions.length<1){return}this.selectOption(this.notDisabledOptions.length-1,true)}focusOption(t){var e;this.lastFocusedOptionElement=this.notDisabledOptions[t];(e=this.lastFocusedOptionElement)===null||e===void 0?void 0:e.focus();this.el.setAttribute("aria-activedescendant",this.lastFocusedOptionElement.id)}focusClosestOption(t){const e=this.getClosestActiveOptionIndexForState(t,"focused");if(e==="nothing")return;this.focusOption(e)}focusFirstOption(){this.focusOption(0)}focusLastOption(){this.focusOption(this.notDisabledOptions.length-1)}selectedOptionChanged(t){this.sendOptionSelectedToStateMachine(t.detail)}sendOptionSelectedToStateMachine(t,e=false){this.stateService.send({type:"OPTION_SELECTED",value:{option:t,fromKeyboard:e}})}onSlotchange(){this.updateSelectedValue(this.value,false);if(this.autocomplete&&this.serverMode){this.showNoResultFoundLabel=this.options.length<1}if(this.multiple){this.options.forEach((t=>t.multiple=true))}}removeChip(t){this.options.forEach((e=>{if(e.value===t.value){this.sendOptionSelectedToStateMachine(Object.assign(Object.assign({},t),{source:e}))}}))}highlightOption(t){this.clearHighlightOnLastHighlightedOption();this.lastHighlightedOptionElement=this.notDisabledOptions[t];if(this.lastHighlightedOptionElement){this.lastHighlightedOptionElement.highlighted=true;this.autocompleteInput.setAttribute("aria-activedescendant",this.lastHighlightedOptionElement.id);requestAnimationFrame((()=>{this.lastHighlightedOptionElement.scrollIntoView({block:"nearest",inline:"nearest"})}))}}highlightFirstOption(){this.highlightOption(0)}highlightLastOption(){this.highlightOption(this.notDisabledOptions.length-1)}highlightClosestOption(t){const e=this.getClosestActiveOptionIndexForState(t,"highlighted");if(e==="nothing")return;this.highlightOption(e)}clearHighlightOnLastHighlightedOption(){if(this.lastHighlightedOptionElement){this.lastHighlightedOptionElement.highlighted=false;this.lastHighlightedOptionElement=null}}onAutocompleteInputEvent(t){var e;const r=(e=this.autocompleteInput.value)!==null&&e!==void 0?e:"";this.setAutocompleteValue(r,false,true);t.stopPropagation()}setAutocompleteValue(t,e=false,r=false){var i,n;this.clearHighlightOnLastHighlightedOption();const s=this.lastModifiedOptionElement==null||((i=this.lastModifiedOptionElement)===null||i===void 0?void 0:i.textContent)!==this.autocompleteValue;if(!this.expanded&&s&&!e&&r){this.open()}if(!this.serverMode){if(t.length){const[e,r]=[[],[]];const i=(n=this.filterFn)!==null&&n!==void 0?n:Je;this.options.forEach((n=>(i(n,t)?e:r).push(n)));this.showNoResultFoundLabel=e.length===0;e.forEach((t=>{t.hidden=false;t.removeAttribute("aria-hidden")}));r.forEach((t=>{t.hidden=true;t.setAttribute("aria-hidden","true")}))}else{this.showNoResultFoundLabel=false;this.options.forEach((t=>{t.hidden=false;t.removeAttribute("aria-hidden")}))}}if(this.autocompleteValue!==t){this.autocompleteValue=t!==null&&t!==void 0?t:"";this.wcsFilterChange.emit({value:t})}}onFocus(t){if(this.autocomplete){this.focusAutocompleteInput()}this.wcsFocus.emit(t)}focusAutocompleteInput(){var t;(t=this.autocompleteInput)===null||t===void 0?void 0:t.focus()}onBlur(t){const e=t.relatedTarget;if(this.el.contains(e)){return}this.wcsBlur.emit(t)}componentDidRender(){var t;(t=this.popper)===null||t===void 0?void 0:t.update()}focusedAttributes(){return!this.disabled?{tabIndex:0}:{}}onAutocompleteFieldBlur(t){if(this.multiple===false&&this.autocomplete===true&&this.hasValue){this.autocompleteValue=this.displayText}}render(){var e;const r=`${this.labelElement?this.labelElement.innerText:""} ${this.hasValue?this.displayText:""}`.trimEnd();const n="no-result-container";return t(i,Object.assign({key:"71154caab9c0b2244716f5c5626cc0de3ed7d327",class:this.expanded?"expanded ":"",overlayDirection:this.overlayDirection},this.focusedAttributes(),{role:!this.autocomplete?"combobox":null,"aria-haspopup":!this.autocomplete?"listbox":null,"aria-owns":!this.autocomplete?this.optionsId:null,"aria-controls":!this.autocomplete?this.optionsId:null,"aria-disabled":!this.autocomplete?this.disabled?"true":null:null,"aria-required":!this.autocomplete?this.required?"true":"false":null,"aria-expanded":!this.autocomplete?this.expanded?"true":"false":null,"aria-multiselectable":!this.autocomplete?this.multiple?"true":"false":null,"aria-label":!this.autocomplete?r:null}),t("div",{key:"2dff342eb864a28ac960583102de88cfd7f63d98",class:"wcs-select-control"},t("div",{key:"0f2028f2eb8245fa08da06ccebbfbac880d0e090",class:"wcs-select-value-container"},this.hasValue?this.chips?this.values.map((e=>t(Qe,{disabled:this.disabled,option:e,onRemove:this.removeChip.bind(this)}))):(!this.autocomplete||this.autocomplete&&this.multiple)&&t("label",{class:"wcs-select-value"},this.displayText):!this.autocomplete&&t("label",{class:"wcs-select-placeholder"},this.placeholder),this.autocomplete&&t("input",Object.assign({key:"000f05300690b402f77b210b4e6808e73647d607",class:"autocomplete-field",value:this.autocompleteValue,role:"combobox","aria-haspopup":"listbox","aria-label":r,"aria-describedby":n,"aria-disabled":this.disabled?"true":null,"aria-expanded":this.expanded?"true":"false","aria-controls":this.optionsId,"aria-owns":this.optionsId,"aria-multiselectable":this.multiple?"true":"false","aria-autocomplete":"list",autocomplete:"off",disabled:this.disabled,required:this.required,onBlur:t=>this.onAutocompleteFieldBlur(t),placeholder:((e=this.values)===null||e===void 0?void 0:e.length)?null:this.placeholder,onInput:t=>this.onAutocompleteInputEvent(t),ref:t=>this.autocompleteInput=t},this.inheritedAttributes))),t(s,{key:"cbbb2ef8b0c49b69c2a3509e6444f52d114efd23",up:this.expanded})),t("div",{key:"9330811ed0b8e0a2380692cdca34f2196b087466",class:"wcs-select-options",id:this.optionsId,role:"listbox"},t("slot",{key:"9efd1b1d83e7bc1af1733909060854025c21df07",name:"options",onSlotchange:this.onSlotchange.bind(this)}),this.autocomplete&&this.showNoResultFoundLabel&&t("div",{key:"a8438df62c26f1d4cfcd25c43d5636031138c71f",role:"alert",id:n,class:"noresult-container"},t("slot",{key:"95397947cdef93512fec2c168ca42893500950ba",name:"filter-no-result"},t("span",{key:"d5fc78e9ba099a017f6ed3116b23aa929c34dcb9"},"Aucun résultat")))))}get el(){return n(this)}static get watchers(){return{value:["onValueChangeHandler"]}}};let ir=0;rr.style=Ze;const nr="wcs-select-option{--wcs-select-option-height:var(--wcs-semantic-size-m);--wcs-select-option-padding-horizontal:var(--wcs-semantic-spacing-base);--wcs-select-option-padding-vertical:0;--wcs-select-option-text-font-weight:var(--wcs-semantic-font-weight-medium);--wcs-select-option-text-font-size:var(--wcs-semantic-font-size-base);--wcs-select-option-text-color-default:var(--wcs-semantic-color-text-primary);--wcs-select-option-text-color-focus:var(--wcs-semantic-color-text-primary);--wcs-select-option-text-color-hover:var(--wcs-semantic-color-text-primary);--wcs-select-option-text-color-selected:var(--wcs-semantic-color-text-primary);--wcs-select-option-text-color-disabled:var(--wcs-semantic-color-text-disabled);--wcs-select-option-background-color-default:var(--wcs-semantic-color-background-action-secondary-default);--wcs-select-option-background-color-hover:var(--wcs-semantic-color-background-action-secondary-hover);--wcs-select-option-background-color-press:var(--wcs-semantic-color-background-action-secondary-press);--wcs-select-option-background-color-selected:var(--wcs-semantic-color-background-action-secondary-selected-default);--wcs-select-option-background-color-selected-hover:var(--wcs-semantic-color-background-action-secondary-selected-hover);--wcs-select-option-background-color-selected-press:var(--wcs-semantic-color-background-action-secondary-selected-press);--wcs-select-option-background-color-selected-disabled:var(--wcs-semantic-color-background-action-secondary-selected-disabled);--wcs-select-option-background-color-focus:var(--wcs-semantic-color-background-action-secondary-focus);--wcs-select-option-border-style-focus:var(--wcs-semantic-border-style-focus-base);--wcs-select-option-border-color-focus:var(--wcs-semantic-color-border-focus-base);--wcs-select-option-border-width-focus:var(--wcs-semantic-border-width-large);--wcs-select-option-border-radius:var(--wcs-semantic-border-radius-base);--wcs-select-option-checkbox-color:var(--wcs-semantic-color-background-control-indicator-selected);--wcs-select-option-gap:var(--wcs-semantic-spacing-base);--wcs-select-option-transition-duration:var(--wcs-semantic-motion-duration-feedback-base);display:flex;flex-direction:row;align-items:center;gap:var(--wcs-select-option-gap);padding:var(--wcs-select-option-padding-vertical) var(--wcs-select-option-padding-horizontal);height:var(--wcs-select-option-height);cursor:pointer;user-select:none;font-weight:var(--wcs-select-option-text-font-weight);font-size:var(--wcs-select-option-text-font-size);color:var(--wcs-select-option-text-color-default);background-color:var(--wcs-select-option-background-color-default);transition-duration:var(--wcs-select-option-transition-duration);transition-property:background-color, color;transition-timing-function:ease;border-radius:var(--wcs-select-option-border-radius);overflow:hidden;white-space:nowrap}wcs-select-option:focus-visible{outline:var(--wcs-select-option-border-style-focus) var(--wcs-select-option-border-width-focus) var(--wcs-select-option-border-color-focus);outline-offset:calc(-1 * var(--wcs-select-option-border-width-focus))}wcs-select-option:focus{color:var(--wcs-select-option-text-color-focus);background-color:var(--wcs-select-option-background-color-focus)}wcs-select-option:hover{color:var(--wcs-select-option-text-color-hover);background-color:var(--wcs-select-option-background-color-hover)}wcs-select-option:active{background-color:var(--wcs-select-option-background-color-press)}wcs-select-option[disabled]{cursor:not-allowed;pointer-events:none;color:var(--wcs-select-option-text-color-disabled)}wcs-select-option[hidden]{display:none}wcs-select-option[selected]{color:var(--wcs-select-option-text-color-selected);background-color:var(--wcs-select-option-background-color-selected)}wcs-select-option[selected]:hover{background-color:var(--wcs-select-option-background-color-selected-hover)}wcs-select-option[selected]:active{background-color:var(--wcs-select-option-background-color-selected-press)}wcs-select-option[selected][disabled]{color:var(--wcs-select-option-text-color-disabled);background-color:var(--wcs-select-option-background-color-selected-disabled)}wcs-select-option[multiple] wcs-checkbox{pointer-events:none}wcs-select-option[multiple]:hover wcs-checkbox{--wcs-checkbox-border-color:var(--wcs-select-option-checkbox-color)}wcs-select-option[highlighted]{outline:var(--wcs-select-option-border-style-focus) var(--wcs-select-option-border-width-focus) var(--wcs-select-option-border-color-focus);outline-offset:calc(-1 * var(--wcs-select-option-border-width-focus))}wcs-select-option[highlighted] wcs-checkbox{--wcs-checkbox-border-color:var(--wcs-select-option-checkbox-color)}";const sr=nr;const or=class{constructor(t){e(this,t);this.wcsSelectOptionClick=r(this,"wcsSelectOptionClick",7);this.selectOptionId=o(this.el.tagName);this.disabled=false;this.selected=false;this.highlighted=false;this.value=undefined;this.chipColor=undefined;this.chipBackgroundColor=undefined;this.multiple=false}componentWillLoad(){if(this.value===undefined){this.value=this.el.innerText||""}}chooseOption(t){if(!this.disabled){t.stopPropagation();const e=this.el.innerText;this.wcsSelectOptionClick.emit({source:this.el,value:this.value,displayText:e})}}onMouseUp(t){this.chooseOption(t)}handleKeydown(t){if(d(t)||v(t)){this.chooseOption(t);t.preventDefault();t.stopPropagation()}}render(){return t(i,{key:"8e2f93d1db10d33df62a34b1f9e62a948a78424e",id:this.selectOptionId,"aria-selected":this.selected||this.highlighted?"true":"false",slot:"options",role:"option",tabindex:"-1"},this.multiple&&t("wcs-checkbox",{key:"3af49da773954213d7f2b64c4a2f8fd7114b6a24",tabindex:"-1",checked:this.selected,disabled:this.disabled}),t("slot",{key:"3e5267f2626863b13bbcab46f98b4eacfa90c83f"}))}get el(){return n(this)}};or.style=sr;export{rr as wcs_select,or as wcs_select_option};
|
|
16
|
+
//# sourceMappingURL=p-b94a09b6.entry.js.map
|