@viamedici-spc/configurator-framer-bundle 1.2.0 → 1.2.1-rc0004
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/index.cjs +95 -95
- package/dist/index.js +5188 -5179
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),$=require("react/jsx-runtime"),D=require("framer"),Gb=require("react-dom"),yT=require("framer-motion");function zb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const J=zb(O),gT=zb(Gb);var bT=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},ST=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},CT=function(e){var t=ST(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function ai(e){return e}function Dc(e){return function(){return e}}var wT=Dc(null),Wb=Dc(void 0),Br=Wb;function Zn(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function w(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}var jr=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,bT([i],r,!1))}}},xT=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},TT=function(e){return e._tag==="None"},ch=function(e){return e._tag==="Some"},Nc={_tag:"None"},Pc=function(e){return{_tag:"Some",value:e}},ET=function(e){return e._tag==="Left"},Rc=function(e){return{_tag:"Left",left:e}},kc=function(e){return{_tag:"Right",right:e}},IT=function(e){return[e]},AT=function(e){return e.length>0},$T=function(e){return e[0]},OT=function(e){return e.slice(1)},DT=[],NT={},PT=Object.prototype.hasOwnProperty,RT=function(e){return xT([e[0]],e.slice(1),!0)};function kT(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function MT(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function Hb(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):Hb(e,t-1,i)}}function jT(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return Hb(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function _T(e){return function(t){for(var n=Object.keys(t),r=n.length,i=jT(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function qT(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function FT(e){var t=MT(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Kb(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var LT=function(e){return function(){return Promise.resolve().then(e)}};function VT(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var Mc=function(e,t){return w(e,Yb(t))},fh=function(e,t){return w(e,BT(t))},Yb=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},BT=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},yu=function(e){return function(){return Promise.resolve(e)}},dh=jr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),gu="Task",jc={URI:gu,map:Mc},ph={URI:gu,of:yu},UT={URI:gu,map:Mc,ap:fh},hh={URI:gu,map:Mc,of:yu,ap:fh,chain:dh},GT=ai,Cm=dh,Wl={URI:gu,map:Mc,of:yu,ap:fh,chain:dh,fromIO:LT,fromTask:GT};function Jb(e){return function(t){return function(n){return e.fromEither(TT(n)?Rc(t()):kc(n.value))}}}function zT(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?kc(o):Rc(r(o)))})}}}var vh=Rc,_c=kc,Xb=function(e,t){return w(e,HT(t))},WT=function(e,t){return w(e,JT(t))},mh="Either",HT=function(e){return function(t){return Mi(t)?t:_c(e(t.right))}},KT={URI:mh,map:Xb},YT=function(e){return function(t){return Mi(t)?t:Mi(e)?e:_c(t.right(e.right))}},JT=YT,XT={URI:mh,map:Xb,ap:WT},QT=function(e){return function(t){return Mi(t)?vh(e(t.left)):t}},Qb={URI:mh,fromEither:ai},ZT=Jb(Qb),Mi=ET,eE=function(e,t){return function(n){return Mi(n)?e(n.left):t(n.right)}},ro=eE;Qb.fromEither;var tE=function(e){return Mi(e)?_c(e.left):vh(e.right)},Dn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},bn=function(e){return Dn(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},wm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dn(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},yh={equals:function(e,t){return e===t}};yh.equals;var nE=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function rE(e,t){return e<t?-1:e>t?1:0}var iE={equals:yh.equals,compare:rE},oE=iE,aE=function(e){return{concat:nE(e)}},sE=aE,xm=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},uE=DT,lE=AT,cE=function(e,t){return e<0||e>=t.length},fE=function(e){return function(t){return xm(xm([],t,!0),[e],!1)}},dE=fE,pE=function(e,t,n){if(n[e]===t)return n;var r=RT(n);return r[e]=t,r},hE=function(e){return function(t){if(t.length===1)return t;for(var n=[yE(t)],r=gE(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},vE=IT,mE=$T,yE=mE,gE=OT,qc={equals:function(e,t){return e===t}},bE={equals:qc.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};qc.equals,bE.compare;globalThis&&globalThis.__spreadArray;var Hl=function(e){return e.length===0},bu=lE,SE=dE,CE=function(e){return function(t){if(Hl(t))return Sh;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},Zb=cE,wE=function(e){return function(t){return Zb(e,t)?t:e===0?Sh:t.slice(0,e)}},xE=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Pc(n);return Nc}};function pn(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Pc(t[n]);return Nc}}var TE=function(e,t){return function(n){return Zb(e,n)?Nc:Pc(OE(e,t(n[e]),n))}};function gh(e){return function(t,n){if(n===void 0){var r=gh(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var la=function(e){var t=hE(e);return function(n){return bu(n)?t(n):n}},EE=function(e){return function(t){return Hl(t)?e:Hl(e)?t:t.concat(e)}},Pe=EE;function eS(e){var t=gh(e);return function(n,r){if(r===void 0){var i=eS(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var IE=vE,tS=jr(2,function(e,t){return w(e,CE(function(n,r){return t(r,n)}))}),bh=tS(ai),W=function(e){return function(t){return t.map(function(n){return e(n)})}},Yt=function(e){return function(t){return t.filter(e)}},AE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);ch(i)&&n.push(i.value)}return n}},jo=function(e){return AE(function(t,n){return e(n)})},Qn=jo(ai),Ad=function(e,t){return $E(e,function(n,r,i){return t(r,i)})},$E=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},Wi=function(e){return Dn(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},OE=function(e,t,n){return bu(n)?pE(e,t,n):n},$d=function(e){return e.slice()},Tm=function(e){return Hl(e)?Sh:e.slice()},Sh=uE,DE=tS,NE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}};function eo(e){return pn(e)}var xl=function(e){return function(t){return t.map(function(n){return e(n)})}},PE=jr(2,function(e,t){return w(e,NE(function(n,r){return t(r,n)}))}),RE=PE(ai),kE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);ch(i)&&n.push(i.value)}return n}},hi=function(e){return kE(function(t,n){return e(n)})},ME=function(e){return function(t){return t.filter(e)}},nS=function(e){return function(t){return Zn(e,t)}},jE=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ge=Nc,je=Pc;function Su(e){return function(t){return e(t)?je(t):ge}}var rS=function(e,t){return w(e,ee(t))},iS=function(e,t){return w(e,_E(t))},oS="Option",_o=function(e){return{equals:function(t,n){return t===n||(wr(t)?wr(n):wr(n)?!1:e.equals(t.value,n.value))}}},ee=function(e){return function(t){return wr(t)?ge:je(e(t.value))}},$i=je,_E=function(e){return function(t){return wr(t)||wr(e)?ge:je(t.value(e.value))}},qE={URI:oS,map:rS,ap:iS,of:$i},Ch=jr(2,function(e,t){return wr(e)?ge:t(e.value)}),FE={URI:oS,map:rS,ap:iS,chain:Ch},LE=jr(2,function(e,t){return wr(e)?t():e}),Em=LE,VE=Ch(ai),Jt=function(e){return function(t){return wr(t)?ge:e(t.value)?t:ge}},bs=ch,wr=function(e){return e._tag==="None"},BE=function(e,t){return function(n){return wr(n)?e():t(n.value)}},ji=BE,aS=ji,UE=function(e){return function(t){return wr(t)?e():t.value}},lt=UE,Od=VE,GE=jr(2,Kb(FE)),Ce=function(e){return e==null?ge:je(e)},or=ji(wT,ai),_t=ji(Wb,ai),ar=Ch,zE=GE,WE=FT(qE);function HE(e){return Zn(_c,e.of)}function KE(e){return Zn(vh,e.of)}function YE(e){return qT(e,KT)}function JE(e){return kT(e,XT)}function XE(e){return function(t,n){return e.chain(t,function(r){return Mi(r)?e.of(r):n(r.right)})}}function QE(e){return function(t,n){return e.map(t,QT(n))}}function ZE(e){return function(t,n){return function(r){return e.map(r,ro(t,n))}}}function eI(e){return function(t){return function(n){return e.chain(n,function(r){return Mi(r)?t(r.left):e.of(r)})}}}function tI(e){return function(t){return e.map(t,tE)}}var nI=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},rI=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Oi=KE(ph),ja=HE(ph),iI=yu,oI=function(e){return Yb(ZT(e))},Kl=ZE(jc),Im=function(e,t){return function(){return nI(void 0,void 0,void 0,function(){var n;return rI(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(kc)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Rc(t(n))];case 3:return[2]}})})}},sS=eI(hh),Am=tI(jc),uS=function(e,t){return w(e,Xt(t))},lS=function(e,t){return w(e,sI(t))},Xt=YE(jc),aI=jr(2,QE(jc)),br=aI,sI=JE(UT),cS=jr(2,XE(hh)),ca=ja,wh="TaskEither",uI={URI:wh,map:uS,ap:lS,of:ca},fS={URI:wh,map:uS,ap:lS,chain:cS},xh={URI:wh,fromEither:iI},lI=jr(2,Kb(fS)),Th=Jb(xh);xh.fromEither;var cI=zT(xh,fS),fI=ca(NT),yr=cS,dI=lI;function pI(e){return t=>w(t,Xt(n=>(e(n)(),n)))}const Us=pI;function Yl(e){return t=>w(t,Am,Us(e),Am)}function hI(e){return t=>w(t,Us(n=>()=>e(n)()),Yl(n=>()=>e(n)()))}function vI(e){return t=>w(t,ee(n=>(e(n)(),n)))}const mI=vI;function yI(e){return Zn(je,e.of)}function gI(e){return Dc(e.of(ge))}function bI(e){var t=gI(e);return function(n,r){return e.chain(n,ji(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var SI=yI(ph),CI=yu,wI=jr(2,bI(hh)),xI=wI,TI=CT,dt={equals:function(e,t){return e===t}};dt.equals;function dS(e){return function(t,n){if(n===void 0){var r=dS(e);return function(o){return r(o,t)}}for(var i in t)if(!PT.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function pS(e){var t=dS(e);return Dn(function(n,r){return t(n)(r)&&t(r)(n)})}function Cu(e){return Dn((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var Eh={equals:function(e,t){return e===t}};Eh.equals;const jn=Symbol.for("@ts-pattern/matcher"),hS=Symbol.for("@ts-pattern/isVariadic"),Jl="@ts-pattern/anonymous-select-key",Dd=e=>!!(e&&typeof e=="object"),Tl=e=>e&&!!e[jn],yn=(e,t,n)=>{if(Tl(e)){const r=e[jn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(Dd(e)){if(!Dd(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let r=[],i=[],o=[];for(const a of e.keys()){const s=e[a];Tl(s)&&s[hS]?o.push(s):o.length?i.push(s):r.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;const a=t.slice(0,r.length),s=i.length===0?[]:t.slice(-i.length),u=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((l,c)=>yn(l,a[c],n))&&i.every((l,c)=>yn(l,s[c],n))&&(o.length===0||yn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>yn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||Tl(o=i)&&o[jn]().matcherType==="optional")&&yn(i,t[r],n);var o})}return Object.is(t,e)},Jn=e=>{var t,n,r;return Dd(e)?Tl(e)?(t=(n=(r=e[jn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?Gs(e,Jn):Gs(Object.values(e),Jn):[]},Gs=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function EI(...e){if(e.length===1){const[t]=e;return n=>yn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return yn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function Tn(e){return Object.assign(e,{optional:()=>Ih(e),and:t=>xt(e,t),or:t=>vS(e,t),select:t=>t===void 0?zs(e):zs(t,e)})}function Nd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[hS]:!0})}}))(e),{optional:()=>Nd(Ih(e)),select:t=>Nd(t===void 0?zs(e):zs(t,e))})}function Ih(e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Jn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:yn(e,t,r),selections:n}},getSelectionKeys:()=>Jn(e),matcherType:"optional"})})}const II=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},AI=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function xt(...e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>yn(i,t,r)),selections:n}},getSelectionKeys:()=>Gs(e,Jn),matcherType:"and"})})}function vS(...e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return Gs(e,Jn).forEach(i=>r(i,void 0)),{matched:e.some(i=>yn(i,t,r)),selections:n}},getSelectionKeys:()=>Gs(e,Jn),matcherType:"or"})})}function Ze(e){return{[jn]:()=>({match:t=>({matched:!!e(t)})})}}function zs(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Tn({[jn]:()=>({match:r=>{let i={[t??Jl]:r};return{matched:n===void 0||yn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Jl].concat(n===void 0?[]:Jn(n))})})}function Ar(e){return typeof e=="number"}function io(e){return typeof e=="string"}function yi(e){return typeof e=="bigint"}const mS=Tn(Ze(function(e){return!0})),$I=mS,oo=e=>Object.assign(Tn(e),{startsWith:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.startsWith(n)))));var n},endsWith:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.endsWith(n)))));var n},minLength:t=>oo(xt(e,(n=>Ze(r=>io(r)&&r.length>=n))(t))),maxLength:t=>oo(xt(e,(n=>Ze(r=>io(r)&&r.length<=n))(t))),includes:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.includes(n)))));var n},regex:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&!!r.match(n)))));var n}}),OI=oo(Ze(io)),$r=e=>Object.assign(Tn(e),{between:(t,n)=>$r(xt(e,((r,i)=>Ze(o=>Ar(o)&&r<=o&&i>=o))(t,n))),lt:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r<n))(t))),gt:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r>n))(t))),lte:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r<=n))(t))),gte:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r>=n))(t))),int:()=>$r(xt(e,Ze(t=>Ar(t)&&Number.isInteger(t)))),finite:()=>$r(xt(e,Ze(t=>Ar(t)&&Number.isFinite(t)))),positive:()=>$r(xt(e,Ze(t=>Ar(t)&&t>0))),negative:()=>$r(xt(e,Ze(t=>Ar(t)&&t<0)))}),DI=$r(Ze(Ar)),gi=e=>Object.assign(Tn(e),{between:(t,n)=>gi(xt(e,((r,i)=>Ze(o=>yi(o)&&r<=o&&i>=o))(t,n))),lt:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r<n))(t))),gt:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r>n))(t))),lte:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r<=n))(t))),gte:t=>gi(xt(e,(n=>Ze(r=>yi(r)&&r>=n))(t))),positive:()=>gi(xt(e,Ze(t=>yi(t)&&t>0))),negative:()=>gi(xt(e,Ze(t=>yi(t)&&t<0)))}),NI=gi(Ze(yi)),PI=Tn(Ze(function(e){return typeof e=="boolean"})),RI=Tn(Ze(function(e){return typeof e=="symbol"})),kI=Tn(Ze(function(e){return e==null}));var Ct={__proto__:null,matcher:jn,optional:Ih,array:function(...e){return Nd({[jn]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let r={};if(t.length===0)return Jn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>yn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Jn(e[0])})})},set:function(...e){return Tn({[jn]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const r=(o,a)=>{n[o]=(n[o]||[]).concat([a])},i=e[0];return{matched:II(t,o=>yn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Jn(e[0])})})},map:function(...e){return Tn({[jn]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const r=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[o,a]=e;return{matched:AI(t,(s,u)=>{const l=yn(o,u,r),c=yn(a,s,r);return l&&c}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Jn(e[0]),...Jn(e[1])]})})},intersection:xt,union:vS,not:function(e){return Tn({[jn]:()=>({match:t=>({matched:!yn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Ze,select:zs,any:mS,_:$I,string:OI,number:DI,bigint:NI,boolean:PI,symbol:RI,nullish:kI,instanceOf:function(e){return Tn(Ze(function(t){return n=>n instanceof t}(e)))},shape:function(e){return Tn(Ze(EI(e)))}};const Pd={matched:!1,value:void 0};function ue(e){return new MI(e,Pd)}let MI=class Rd{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],r=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,a={};const s=(l,c)=>{o=!0,a[l]=c},u=!r.some(l=>yn(l,this.input,s))||i&&!i(this.input)?Pd:{matched:!0,value:n(o?Jl in a?a[Jl]:a:this.input,this.input)};return new Rd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new Rd(this.input,r?{matched:!0,value:n(this.input,this.input)}:Pd)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var jI=Object.getOwnPropertyNames,_I=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty;function $m(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function zu(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var o=i.cache,a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i);return o.delete(n),o.delete(r),u}}function Om(e){return jI(e).concat(_I(e))}var yS=Object.hasOwn||function(e,t){return qI.call(e,t)};function _a(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var gS="_owner",Dm=Object.getOwnPropertyDescriptor,Nm=Object.keys;function FI(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function LI(e,t){return _a(e.getTime(),t.getTime())}function Pm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),l=!1,c=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,v=p[0],g=p[1];!l&&!r[c]&&(l=n.equals(d,v,o,c,e,t,n)&&n.equals(h,g,d,v,e,t,n))&&(r[c]=!0),c++}if(!l)return!1;o++}return!0}function VI(e,t,n){var r=Nm(e),i=r.length;if(Nm(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===gS&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!yS(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function cs(e,t,n){var r=Om(e),i=r.length;if(Om(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===gS&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!yS(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Dm(e,o),s=Dm(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function BI(e,t){return _a(e.valueOf(),t.valueOf())}function UI(e,t){return e.source===t.source&&e.flags===t.flags}function Rm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,l=0;(a=s.next())&&!a.done;)!u&&!r[l]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[l]=!0),l++;if(!u)return!1}return!0}function GI(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var zI="[object Arguments]",WI="[object Boolean]",HI="[object Date]",KI="[object Map]",YI="[object Number]",JI="[object Object]",XI="[object RegExp]",QI="[object Set]",ZI="[object String]",eA=Array.isArray,km=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Mm=Object.assign,tA=Object.prototype.toString.call.bind(Object.prototype.toString);function nA(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(c,f,d){if(c===f)return!0;if(c==null||f==null||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;var h=c.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(c,f,d);if(eA(c))return t(c,f,d);if(km!=null&&km(c))return u(c,f,d);if(h===Date)return n(c,f,d);if(h===RegExp)return a(c,f,d);if(h===Map)return r(c,f,d);if(h===Set)return s(c,f,d);var p=tA(c);return p===HI?n(c,f,d):p===XI?a(c,f,d):p===KI?r(c,f,d):p===QI?s(c,f,d):p===JI?typeof c.then!="function"&&typeof f.then!="function"&&i(c,f,d):p===zI?i(c,f,d):p===WI||p===YI||p===ZI?o(c,f,d):!1}}function rA(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?cs:FI,areDatesEqual:LI,areMapsEqual:r?$m(Pm,cs):Pm,areObjectsEqual:r?cs:VI,arePrimitiveWrappersEqual:BI,areRegExpsEqual:UI,areSetsEqual:r?$m(Rm,cs):Rm,areTypedArraysEqual:r?cs:GI};if(n&&(i=Mm({},i,n(i))),t){var o=zu(i.areArraysEqual),a=zu(i.areMapsEqual),s=zu(i.areObjectsEqual),u=zu(i.areSetsEqual);i=Mm({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function iA(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function oA(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,l){var c=r(),f=c.cache,d=f===void 0?t?new WeakMap:void 0:f,h=c.meta;return n(u,l,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(u,l){return n(u,l,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,l){return n(u,l,a)}}var aA=Hi();Hi({strict:!0});Hi({circular:!0});Hi({circular:!0,strict:!0});Hi({createInternalComparator:function(){return _a}});Hi({strict:!0,createInternalComparator:function(){return _a}});Hi({circular:!0,createInternalComparator:function(){return _a}});Hi({circular:!0,createInternalComparator:function(){return _a},strict:!0});function Hi(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=rA(e),u=nA(s),l=r?r(u):iA(u);return oA({circular:n,comparator:u,createState:i,equals:l,strict:a})}function sA(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function uA(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),sA(e)}var Ps=w,lA=TI(WE({concat:sE(oE).concat,empty:0}))();function cA(e){return function(t){return t.iterNumber>=e?ge:je(0)}}function fA(e,t){return function(n){return Ps(n,t,ee(function(r){return Math.min(e,r)}))}}function dA(e){return function(t){return je(e*Math.pow(2,t.iterNumber))}}var pA={iterNumber:0,cumulativeDelay:0,previousDelay:ge};function hA(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+lt(function(){return 0})(n),previousDelay:n}}function vA(e,t){var n=hA(e,t);return Ps(n.previousDelay,aS(function(){return Wl.of(n)},function(r){return VT(r)(Wl.of(n))}))}function Uo(e,t,n){var r=function(i){return Ps(i,t,Cm(function(o){return n(o)?Ps(vA(e,i),Cm(function(a){return Ps(a.previousDelay,aS(function(){return Wl.of(o)},function(){return r(a)}))})):Wl.of(o)}))};return r(pA)}var jm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.isGuid=SS=Ws.guid=void 0;var mA=function(e){e===void 0&&(e=2);for(var t=(Date.now()*3).toString(16),n=new Date().getTimezoneOffset(),r=Number("".concat(n<0?"7":"6").concat(Math.abs(n))).toString(16),i=e*9+3+15,o="",a=0;a<e;a++)o+=_m()+"-";for(o+=r,o+=t;o.length<i;)o+=_m();return o.substring(0,i)},SS=Ws.guid=mA,_m=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},yA=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=gA(n[n.length-1]);if(n.length-1!==t)return"Invalid guid, invalid number of blocks";var i=n.concat().slice(0,-1).reduce(function(o,a){return o&&a.length===8&&!a.includes(" ")},!0);return i?!r&&n[n.length-1].length!==18?"Invalid guid, last date block has invalid size":!0:"Invalid guid, one or more random blocks are invalid"};Ws.isGuid=yA;var gA=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Ah(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Fc(e){return{equals(t,n){const r=w(Ce(t),lt(()=>[])),i=w(Ce(n),lt(()=>[]));return Wi(e).equals(r,i)}}}const qo=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModelId:Ah(dt)}),$h=bn({localId:dt,configurationModelId:dt}),CS=Dn((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>bA.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>SA.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>CA.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>wA.equals(n.x,n.y)).otherwise(()=>!1)),bA=bn({type:dt,attributeId:qo,state:dt,choiceValueId:dt}),SA=bn({type:dt,attributeId:qo,state:dt}),CA=bn({type:dt,attributeId:qo,state:qc}),wA=bn({type:dt,attributeId:qo,state:Eh});var xn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(xn||{}),Wt=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Wt||{}),ma=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ma||{}),sn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(sn||{}),Jr=(e=>(e.Channel="Channel",e.Package="Package",e))(Jr||{}),Oe=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Oe||{}),Xr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Xr||{}),_i=(e=>(e.Included="Included",e.Excluded="Excluded",e))(_i||{}),kr=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(kr||{}),Rr=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Rr||{}),qi=(e=>(e.Always="Always",e.Optional="Optional",e))(qi||{});const xA=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:sn,AttributeType:Oe,ChoiceValueDecisionState:Xr,ComponentDecisionState:_i,ConfigurationModelSourceType:Jr,ConstraintType:ma,DecisionKind:kr,ExplainQuestionSubject:Wt,ExplainQuestionType:xn,Inclusion:qi,Selection:Rr,eqCausedByDecision:CS,eqGlobalAttributeId:qo,eqGlobalConstraintId:$h},Symbol.toStringTag,{value:"Module"}));var zt=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(zt||{}),Lc=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Lc||{});const wS={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},TA=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:Lc,FailureResultFactory:wS,FailureType:zt},Symbol.toStringTag,{value:"Module"}));let xS=class{mapToCreateSessionRequest(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToAttributeRelations(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToConfigurationModelSource(t){return ue(t).with({type:Jr.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Jr.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return w(t,Ce,ee(Zn(W(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),_t)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:w([...t.decisions],xl(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return w(Ce(t),_t)}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath,sharedConfigurationModelId:t.sharedConfigurationModelId}}mapToAllowedInExplain(t){return t==null?null:{rules:this.mapToAllowedRulesInExplain(t.rules)}}mapToAllowedRulesInExplain(t){return ue(t).returnType().with({type:sn.all},()=>({type:"AllowedRulesAll"})).with({type:sn.none},()=>({type:"AllowedRulesNone"})).with({type:sn.specific},n=>({type:"AllowedRulesSpecific",rules:w(n.rules,W(this.mapToGlobalConstraintId),$d)})).with(Ct.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function EA(e){return t=>cI(n=>n!=null,e)(t)}function IA(){return ja(Br())}var Kn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Kn||{}),vo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(vo||{}),hn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(hn||{}),mo=(e=>(e.all="all",e.none="none",e.specific="specific",e))(mo||{});const Cn=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModel:Ah(dt)}),AA=_o(Wi(bn({attributeId:Cn,decisions:Fc(Cn)}))),$A=_o(Dn((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:r})=>Wi($h).equals(n.rules,r.rules)).otherwise(()=>!1))),OA=_o(bn({rules:$A})),DA=bn({configurationModelSource:Dn((e,t)=>aA(e,t)),decisionsToRespect:AA,usageRuleParameters:pS(dt),allowedInExplain:OA});var Hs=(e=>(e.Channel="Channel",e.Package="Package",e))(Hs||{}),ct=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ct||{}),Ee=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ee||{}),Qt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Qt||{}),Rt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Rt||{}),Co=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Co||{}),wo=(e=>(e.Always="Always",e.Optional="Optional",e))(wo||{});const NA={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:_o(dt).equals(e.state,t.state)},PA={equals(e,t){return _o(qc).equals(e.value,t.value)}},RA={equals(e,t){return _o(Eh).equals(e.value,t.value)}},kA={equals(e,t){return _o(dt).equals(e.state,t.state)}},MA={equals(e,t){return Cn.equals(e.attributeId,t.attributeId)?ue({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>RA.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>PA.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>kA.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>NA.equals(r.x,r.y)).otherwise(()=>!1):!1}},jA=Wi(MA),_A={equals:(e,t)=>jA.equals(e.decisions,t.decisions)&&qA.equals(e.mode,t.mode)},qA={equals:(e,t)=>ue({x:e,y:t}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var kd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(kd||{}),ya=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ya||{}),we=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(we||{}),Oh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Oh||{});function FA(e,t){console.log(`--------------------------------------------------------------------------------
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),$=require("react/jsx-runtime"),D=require("framer"),zb=require("react-dom"),gT=require("framer-motion");function Wb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const J=Wb(O),bT=Wb(zb);var ST=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},CT=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},wT=function(e){var t=CT(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function li(e){return e}function Nc(e){return function(){return e}}var xT=Nc(null),Hb=Nc(void 0),zr=Hb;function Zn(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function w(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}var jr=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,ST([i],r,!1))}}},TT=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},ET=function(e){return e._tag==="None"},dh=function(e){return e._tag==="Some"},Pc={_tag:"None"},Rc=function(e){return{_tag:"Some",value:e}},IT=function(e){return e._tag==="Left"},kc=function(e){return{_tag:"Left",left:e}},Mc=function(e){return{_tag:"Right",right:e}},AT=function(e){return[e]},$T=function(e){return e.length>0},OT=function(e){return e[0]},DT=function(e){return e.slice(1)},NT=[],PT={},RT=Object.prototype.hasOwnProperty,kT=function(e){return TT([e[0]],e.slice(1),!0)};function MT(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function jT(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function Kb(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):Kb(e,t-1,i)}}function _T(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return Kb(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function qT(e){return function(t){for(var n=Object.keys(t),r=n.length,i=_T(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function FT(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function LT(e){var t=jT(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Yb(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var VT=function(e){return function(){return Promise.resolve().then(e)}};function BT(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var jc=function(e,t){return w(e,Jb(t))},ph=function(e,t){return w(e,UT(t))},Jb=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},UT=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},gu=function(e){return function(){return Promise.resolve(e)}},hh=jr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),bu="Task",_c={URI:bu,map:jc},vh={URI:bu,of:gu},GT={URI:bu,map:jc,ap:ph},mh={URI:bu,map:jc,of:gu,ap:ph,chain:hh},zT=li,wm=hh,Hl={URI:bu,map:jc,of:gu,ap:ph,chain:hh,fromIO:VT,fromTask:zT};function Xb(e){return function(t){return function(n){return e.fromEither(ET(n)?kc(t()):Mc(n.value))}}}function WT(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Mc(o):kc(r(o)))})}}}var yh=kc,qc=Mc,Qb=function(e,t){return w(e,KT(t))},HT=function(e,t){return w(e,XT(t))},gh="Either",KT=function(e){return function(t){return ji(t)?t:qc(e(t.right))}},YT={URI:gh,map:Qb},JT=function(e){return function(t){return ji(t)?t:ji(e)?e:qc(t.right(e.right))}},XT=JT,QT={URI:gh,map:Qb,ap:HT},ZT=function(e){return function(t){return ji(t)?yh(e(t.left)):t}},Zb={URI:gh,fromEither:li},eE=Xb(Zb),ji=IT,tE=function(e,t){return function(n){return ji(n)?e(n.left):t(n.right)}},ro=tE;Zb.fromEither;var nE=function(e){return ji(e)?qc(e.left):yh(e.right)},Dn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},bn=function(e){return Dn(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},xm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Dn(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},bh={equals:function(e,t){return e===t}};bh.equals;var rE=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function iE(e,t){return e<t?-1:e>t?1:0}var oE={equals:bh.equals,compare:iE},aE=oE,sE=function(e){return{concat:rE(e)}},uE=sE,Tm=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},lE=NT,cE=$T,fE=function(e,t){return e<0||e>=t.length},dE=function(e){return function(t){return Tm(Tm([],t,!0),[e],!1)}},pE=dE,hE=function(e,t,n){if(n[e]===t)return n;var r=kT(n);return r[e]=t,r},vE=function(e){return function(t){if(t.length===1)return t;for(var n=[gE(t)],r=bE(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},mE=AT,yE=OT,gE=yE,bE=DT,Fc={equals:function(e,t){return e===t}},SE={equals:Fc.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};Fc.equals,SE.compare;globalThis&&globalThis.__spreadArray;var Kl=function(e){return e.length===0},Su=cE,CE=pE,wE=function(e){return function(t){if(Kl(t))return wh;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},eS=fE,xE=function(e){return function(t){return eS(e,t)?t:e===0?wh:t.slice(0,e)}},TE=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Rc(n);return Pc}};function pn(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Rc(t[n]);return Pc}}var EE=function(e,t){return function(n){return eS(e,n)?Pc:Rc(DE(e,t(n[e]),n))}};function Sh(e){return function(t,n){if(n===void 0){var r=Sh(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var la=function(e){var t=vE(e);return function(n){return Su(n)?t(n):n}},IE=function(e){return function(t){return Kl(t)?e:Kl(e)?t:t.concat(e)}},Pe=IE;function tS(e){var t=Sh(e);return function(n,r){if(r===void 0){var i=tS(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var AE=mE,nS=jr(2,function(e,t){return w(e,wE(function(n,r){return t(r,n)}))}),Ch=nS(li),W=function(e){return function(t){return t.map(function(n){return e(n)})}},Yt=function(e){return function(t){return t.filter(e)}},$E=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);dh(i)&&n.push(i.value)}return n}},jo=function(e){return $E(function(t,n){return e(n)})},Qn=jo(li),Od=function(e,t){return OE(e,function(n,r,i){return t(r,i)})},OE=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},Hi=function(e){return Dn(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},DE=function(e,t,n){return Su(n)?hE(e,t,n):n},Dd=function(e){return e.slice()},Em=function(e){return Kl(e)?wh:e.slice()},wh=lE,NE=nS,PE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}};function eo(e){return pn(e)}var Tl=function(e){return function(t){return t.map(function(n){return e(n)})}},RE=jr(2,function(e,t){return w(e,PE(function(n,r){return t(r,n)}))}),kE=RE(li),ME=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);dh(i)&&n.push(i.value)}return n}},vi=function(e){return ME(function(t,n){return e(n)})},jE=function(e){return function(t){return t.filter(e)}},rS=function(e){return function(t){return Zn(e,t)}},_E=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ge=Pc,je=Rc;function Cu(e){return function(t){return e(t)?je(t):ge}}var iS=function(e,t){return w(e,ee(t))},oS=function(e,t){return w(e,qE(t))},aS="Option",_o=function(e){return{equals:function(t,n){return t===n||(Tr(t)?Tr(n):Tr(n)?!1:e.equals(t.value,n.value))}}},ee=function(e){return function(t){return Tr(t)?ge:je(e(t.value))}},Oi=je,qE=function(e){return function(t){return Tr(t)||Tr(e)?ge:je(t.value(e.value))}},FE={URI:aS,map:iS,ap:oS,of:Oi},xh=jr(2,function(e,t){return Tr(e)?ge:t(e.value)}),LE={URI:aS,map:iS,ap:oS,chain:xh},VE=jr(2,function(e,t){return Tr(e)?t():e}),Im=VE,BE=xh(li),Jt=function(e){return function(t){return Tr(t)?ge:e(t.value)?t:ge}},Ss=dh,Tr=function(e){return e._tag==="None"},UE=function(e,t){return function(n){return Tr(n)?e():t(n.value)}},_i=UE,sS=_i,GE=function(e){return function(t){return Tr(t)?e():t.value}},lt=GE,Nd=BE,zE=jr(2,Yb(LE)),Ce=function(e){return e==null?ge:je(e)},ar=_i(xT,li),_t=_i(Hb,li),sr=xh,WE=zE,HE=LT(FE);function KE(e){return Zn(qc,e.of)}function YE(e){return Zn(yh,e.of)}function JE(e){return FT(e,YT)}function XE(e){return MT(e,QT)}function QE(e){return function(t,n){return e.chain(t,function(r){return ji(r)?e.of(r):n(r.right)})}}function ZE(e){return function(t,n){return e.map(t,ZT(n))}}function eI(e){return function(t,n){return function(r){return e.map(r,ro(t,n))}}}function tI(e){return function(t){return function(n){return e.chain(n,function(r){return ji(r)?t(r.left):e.of(r)})}}}function nI(e){return function(t){return e.map(t,nE)}}var rI=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},iI=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Di=YE(vh),ja=KE(vh),oI=gu,aI=function(e){return Jb(eE(e))},Yl=eI(_c),Am=function(e,t){return function(){return rI(void 0,void 0,void 0,function(){var n;return iI(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Mc)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,kc(t(n))];case 3:return[2]}})})}},uS=tI(mh),$m=nI(_c),lS=function(e,t){return w(e,Xt(t))},cS=function(e,t){return w(e,uI(t))},Xt=JE(_c),sI=jr(2,ZE(_c)),Cr=sI,uI=XE(GT),fS=jr(2,QE(mh)),ca=ja,Th="TaskEither",lI={URI:Th,map:lS,ap:cS,of:ca},dS={URI:Th,map:lS,ap:cS,chain:fS},Eh={URI:Th,fromEither:oI},cI=jr(2,Yb(dS)),Ih=Xb(Eh);Eh.fromEither;var fI=WT(Eh,dS),dI=ca(PT),br=fS,pI=cI;function hI(e){return t=>w(t,Xt(n=>(e(n)(),n)))}const Gs=hI;function Jl(e){return t=>w(t,$m,Gs(e),$m)}function vI(e){return t=>w(t,Gs(n=>()=>e(n)()),Jl(n=>()=>e(n)()))}function mI(e){return t=>w(t,ee(n=>(e(n)(),n)))}const yI=mI;function gI(e){return Zn(je,e.of)}function bI(e){return Nc(e.of(ge))}function SI(e){var t=bI(e);return function(n,r){return e.chain(n,_i(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var CI=gI(vh),wI=gu,xI=jr(2,SI(mh)),TI=xI,EI=wT,dt={equals:function(e,t){return e===t}};dt.equals;function pS(e){return function(t,n){if(n===void 0){var r=pS(e);return function(o){return r(o,t)}}for(var i in t)if(!RT.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function hS(e){var t=pS(e);return Dn(function(n,r){return t(n)(r)&&t(r)(n)})}function wu(e){return Dn((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var Ah={equals:function(e,t){return e===t}};Ah.equals;const jn=Symbol.for("@ts-pattern/matcher"),vS=Symbol.for("@ts-pattern/isVariadic"),Xl="@ts-pattern/anonymous-select-key",Pd=e=>!!(e&&typeof e=="object"),El=e=>e&&!!e[jn],yn=(e,t,n)=>{if(El(e)){const r=e[jn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(Pd(e)){if(!Pd(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let r=[],i=[],o=[];for(const a of e.keys()){const s=e[a];El(s)&&s[vS]?o.push(s):o.length?i.push(s):r.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;const a=t.slice(0,r.length),s=i.length===0?[]:t.slice(-i.length),u=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((l,c)=>yn(l,a[c],n))&&i.every((l,c)=>yn(l,s[c],n))&&(o.length===0||yn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>yn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||El(o=i)&&o[jn]().matcherType==="optional")&&yn(i,t[r],n);var o})}return Object.is(t,e)},Jn=e=>{var t,n,r;return Pd(e)?El(e)?(t=(n=(r=e[jn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?zs(e,Jn):zs(Object.values(e),Jn):[]},zs=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function II(...e){if(e.length===1){const[t]=e;return n=>yn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return yn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function Tn(e){return Object.assign(e,{optional:()=>$h(e),and:t=>xt(e,t),or:t=>mS(e,t),select:t=>t===void 0?Ws(e):Ws(t,e)})}function Rd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[vS]:!0})}}))(e),{optional:()=>Rd($h(e)),select:t=>Rd(t===void 0?Ws(e):Ws(t,e))})}function $h(e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Jn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:yn(e,t,r),selections:n}},getSelectionKeys:()=>Jn(e),matcherType:"optional"})})}const AI=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},$I=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function xt(...e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>yn(i,t,r)),selections:n}},getSelectionKeys:()=>zs(e,Jn),matcherType:"and"})})}function mS(...e){return Tn({[jn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return zs(e,Jn).forEach(i=>r(i,void 0)),{matched:e.some(i=>yn(i,t,r)),selections:n}},getSelectionKeys:()=>zs(e,Jn),matcherType:"or"})})}function Ze(e){return{[jn]:()=>({match:t=>({matched:!!e(t)})})}}function Ws(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return Tn({[jn]:()=>({match:r=>{let i={[t??Xl]:r};return{matched:n===void 0||yn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Xl].concat(n===void 0?[]:Jn(n))})})}function Ar(e){return typeof e=="number"}function io(e){return typeof e=="string"}function gi(e){return typeof e=="bigint"}const yS=Tn(Ze(function(e){return!0})),OI=yS,oo=e=>Object.assign(Tn(e),{startsWith:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.startsWith(n)))));var n},endsWith:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.endsWith(n)))));var n},minLength:t=>oo(xt(e,(n=>Ze(r=>io(r)&&r.length>=n))(t))),maxLength:t=>oo(xt(e,(n=>Ze(r=>io(r)&&r.length<=n))(t))),includes:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&r.includes(n)))));var n},regex:t=>{return oo(xt(e,(n=t,Ze(r=>io(r)&&!!r.match(n)))));var n}}),DI=oo(Ze(io)),$r=e=>Object.assign(Tn(e),{between:(t,n)=>$r(xt(e,((r,i)=>Ze(o=>Ar(o)&&r<=o&&i>=o))(t,n))),lt:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r<n))(t))),gt:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r>n))(t))),lte:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r<=n))(t))),gte:t=>$r(xt(e,(n=>Ze(r=>Ar(r)&&r>=n))(t))),int:()=>$r(xt(e,Ze(t=>Ar(t)&&Number.isInteger(t)))),finite:()=>$r(xt(e,Ze(t=>Ar(t)&&Number.isFinite(t)))),positive:()=>$r(xt(e,Ze(t=>Ar(t)&&t>0))),negative:()=>$r(xt(e,Ze(t=>Ar(t)&&t<0)))}),NI=$r(Ze(Ar)),bi=e=>Object.assign(Tn(e),{between:(t,n)=>bi(xt(e,((r,i)=>Ze(o=>gi(o)&&r<=o&&i>=o))(t,n))),lt:t=>bi(xt(e,(n=>Ze(r=>gi(r)&&r<n))(t))),gt:t=>bi(xt(e,(n=>Ze(r=>gi(r)&&r>n))(t))),lte:t=>bi(xt(e,(n=>Ze(r=>gi(r)&&r<=n))(t))),gte:t=>bi(xt(e,(n=>Ze(r=>gi(r)&&r>=n))(t))),positive:()=>bi(xt(e,Ze(t=>gi(t)&&t>0))),negative:()=>bi(xt(e,Ze(t=>gi(t)&&t<0)))}),PI=bi(Ze(gi)),RI=Tn(Ze(function(e){return typeof e=="boolean"})),kI=Tn(Ze(function(e){return typeof e=="symbol"})),MI=Tn(Ze(function(e){return e==null}));var Ct={__proto__:null,matcher:jn,optional:$h,array:function(...e){return Rd({[jn]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let r={};if(t.length===0)return Jn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>yn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Jn(e[0])})})},set:function(...e){return Tn({[jn]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const r=(o,a)=>{n[o]=(n[o]||[]).concat([a])},i=e[0];return{matched:AI(t,o=>yn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Jn(e[0])})})},map:function(...e){return Tn({[jn]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const r=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[o,a]=e;return{matched:$I(t,(s,u)=>{const l=yn(o,u,r),c=yn(a,s,r);return l&&c}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Jn(e[0]),...Jn(e[1])]})})},intersection:xt,union:mS,not:function(e){return Tn({[jn]:()=>({match:t=>({matched:!yn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Ze,select:Ws,any:yS,_:OI,string:DI,number:NI,bigint:PI,boolean:RI,symbol:kI,nullish:MI,instanceOf:function(e){return Tn(Ze(function(t){return n=>n instanceof t}(e)))},shape:function(e){return Tn(Ze(II(e)))}};const kd={matched:!1,value:void 0};function ue(e){return new jI(e,kd)}let jI=class Md{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],r=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,a={};const s=(l,c)=>{o=!0,a[l]=c},u=!r.some(l=>yn(l,this.input,s))||i&&!i(this.input)?kd:{matched:!0,value:n(o?Xl in a?a[Xl]:a:this.input,this.input)};return new Md(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new Md(this.input,r?{matched:!0,value:n(this.input,this.input)}:kd)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var _I=Object.getOwnPropertyNames,qI=Object.getOwnPropertySymbols,FI=Object.prototype.hasOwnProperty;function Om(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Wu(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var o=i.cache,a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i);return o.delete(n),o.delete(r),u}}function Dm(e){return _I(e).concat(qI(e))}var gS=Object.hasOwn||function(e,t){return FI.call(e,t)};function _a(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var bS="_owner",Nm=Object.getOwnPropertyDescriptor,Pm=Object.keys;function LI(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function VI(e,t){return _a(e.getTime(),t.getTime())}function Rm(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),l=!1,c=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,v=p[0],g=p[1];!l&&!r[c]&&(l=n.equals(d,v,o,c,e,t,n)&&n.equals(h,g,d,v,e,t,n))&&(r[c]=!0),c++}if(!l)return!1;o++}return!0}function BI(e,t,n){var r=Pm(e),i=r.length;if(Pm(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===bS&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!gS(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function fs(e,t,n){var r=Dm(e),i=r.length;if(Dm(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===bS&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!gS(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Nm(e,o),s=Nm(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function UI(e,t){return _a(e.valueOf(),t.valueOf())}function GI(e,t){return e.source===t.source&&e.flags===t.flags}function km(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,l=0;(a=s.next())&&!a.done;)!u&&!r[l]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[l]=!0),l++;if(!u)return!1}return!0}function zI(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var WI="[object Arguments]",HI="[object Boolean]",KI="[object Date]",YI="[object Map]",JI="[object Number]",XI="[object Object]",QI="[object RegExp]",ZI="[object Set]",eA="[object String]",tA=Array.isArray,Mm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,jm=Object.assign,nA=Object.prototype.toString.call.bind(Object.prototype.toString);function rA(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(c,f,d){if(c===f)return!0;if(c==null||f==null||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;var h=c.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(c,f,d);if(tA(c))return t(c,f,d);if(Mm!=null&&Mm(c))return u(c,f,d);if(h===Date)return n(c,f,d);if(h===RegExp)return a(c,f,d);if(h===Map)return r(c,f,d);if(h===Set)return s(c,f,d);var p=nA(c);return p===KI?n(c,f,d):p===QI?a(c,f,d):p===YI?r(c,f,d):p===ZI?s(c,f,d):p===XI?typeof c.then!="function"&&typeof f.then!="function"&&i(c,f,d):p===WI?i(c,f,d):p===HI||p===JI||p===eA?o(c,f,d):!1}}function iA(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?fs:LI,areDatesEqual:VI,areMapsEqual:r?Om(Rm,fs):Rm,areObjectsEqual:r?fs:BI,arePrimitiveWrappersEqual:UI,areRegExpsEqual:GI,areSetsEqual:r?Om(km,fs):km,areTypedArraysEqual:r?fs:zI};if(n&&(i=jm({},i,n(i))),t){var o=Wu(i.areArraysEqual),a=Wu(i.areMapsEqual),s=Wu(i.areObjectsEqual),u=Wu(i.areSetsEqual);i=jm({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function oA(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function aA(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,l){var c=r(),f=c.cache,d=f===void 0?t?new WeakMap:void 0:f,h=c.meta;return n(u,l,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(u,l){return n(u,l,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,l){return n(u,l,a)}}var sA=Ki();Ki({strict:!0});Ki({circular:!0});Ki({circular:!0,strict:!0});Ki({createInternalComparator:function(){return _a}});Ki({strict:!0,createInternalComparator:function(){return _a}});Ki({circular:!0,createInternalComparator:function(){return _a}});Ki({circular:!0,createInternalComparator:function(){return _a},strict:!0});function Ki(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=iA(e),u=rA(s),l=r?r(u):oA(u);return aA({circular:n,comparator:u,createState:i,equals:l,strict:a})}function uA(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function lA(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),uA(e)}var Rs=w,cA=EI(HE({concat:uE(aE).concat,empty:0}))();function fA(e){return function(t){return t.iterNumber>=e?ge:je(0)}}function dA(e,t){return function(n){return Rs(n,t,ee(function(r){return Math.min(e,r)}))}}function pA(e){return function(t){return je(e*Math.pow(2,t.iterNumber))}}var hA={iterNumber:0,cumulativeDelay:0,previousDelay:ge};function vA(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+lt(function(){return 0})(n),previousDelay:n}}function mA(e,t){var n=vA(e,t);return Rs(n.previousDelay,sS(function(){return Hl.of(n)},function(r){return BT(r)(Hl.of(n))}))}function Uo(e,t,n){var r=function(i){return Rs(i,t,wm(function(o){return n(o)?Rs(mA(e,i),wm(function(a){return Rs(a.previousDelay,sS(function(){return Hl.of(o)},function(){return r(a)}))})):Hl.of(o)}))};return r(hA)}var _m=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function SS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.isGuid=CS=Hs.guid=void 0;var yA=function(e){e===void 0&&(e=2);for(var t=(Date.now()*3).toString(16),n=new Date().getTimezoneOffset(),r=Number("".concat(n<0?"7":"6").concat(Math.abs(n))).toString(16),i=e*9+3+15,o="",a=0;a<e;a++)o+=qm()+"-";for(o+=r,o+=t;o.length<i;)o+=qm();return o.substring(0,i)},CS=Hs.guid=yA,qm=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},gA=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=bA(n[n.length-1]);if(n.length-1!==t)return"Invalid guid, invalid number of blocks";var i=n.concat().slice(0,-1).reduce(function(o,a){return o&&a.length===8&&!a.includes(" ")},!0);return i?!r&&n[n.length-1].length!==18?"Invalid guid, last date block has invalid size":!0:"Invalid guid, one or more random blocks are invalid"};Hs.isGuid=gA;var bA=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Oh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Lc(e){return{equals(t,n){const r=w(Ce(t),lt(()=>[])),i=w(Ce(n),lt(()=>[]));return Hi(e).equals(r,i)}}}const qo=bn({localId:dt,componentPath:Lc(dt),sharedConfigurationModelId:Oh(dt)}),Dh=bn({localId:dt,configurationModelId:dt}),wS=Dn((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>SA.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>CA.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>wA.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>xA.equals(n.x,n.y)).otherwise(()=>!1)),SA=bn({type:dt,attributeId:qo,state:dt,choiceValueId:dt}),CA=bn({type:dt,attributeId:qo,state:dt}),wA=bn({type:dt,attributeId:qo,state:Fc}),xA=bn({type:dt,attributeId:qo,state:Ah});var xn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(xn||{}),Wt=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Wt||{}),ma=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ma||{}),un=(e=>(e.all="all",e.none="none",e.specific="specific",e))(un||{}),Zr=(e=>(e.Channel="Channel",e.Package="Package",e))(Zr||{}),Oe=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Oe||{}),ei=(e=>(e.Included="Included",e.Excluded="Excluded",e))(ei||{}),qi=(e=>(e.Included="Included",e.Excluded="Excluded",e))(qi||{}),kr=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(kr||{}),Rr=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Rr||{}),Fi=(e=>(e.Always="Always",e.Optional="Optional",e))(Fi||{});const TA=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:un,AttributeType:Oe,ChoiceValueDecisionState:ei,ComponentDecisionState:qi,ConfigurationModelSourceType:Zr,ConstraintType:ma,DecisionKind:kr,ExplainQuestionSubject:Wt,ExplainQuestionType:xn,Inclusion:Fi,Selection:Rr,eqCausedByDecision:wS,eqGlobalAttributeId:qo,eqGlobalConstraintId:Dh},Symbol.toStringTag,{value:"Module"}));var zt=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(zt||{}),Vc=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Vc||{});const xS={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},EA=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:Vc,FailureResultFactory:xS,FailureType:zt},Symbol.toStringTag,{value:"Module"}));let TS=class{mapToCreateSessionRequest(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToAttributeRelations(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToConfigurationModelSource(t){return ue(t).with({type:Zr.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Zr.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return w(t,Ce,ee(Zn(W(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),_t)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:w([...t.decisions],Tl(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return w(Ce(t),_t)}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath,sharedConfigurationModelId:t.sharedConfigurationModelId}}mapToAllowedInExplain(t){return t==null?null:{rules:this.mapToAllowedRulesInExplain(t.rules)}}mapToAllowedRulesInExplain(t){return ue(t).returnType().with({type:un.all},()=>({type:"AllowedRulesAll"})).with({type:un.none},()=>({type:"AllowedRulesNone"})).with({type:un.specific},n=>({type:"AllowedRulesSpecific",rules:w(n.rules,W(this.mapToGlobalConstraintId),Dd)})).with(Ct.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function IA(e){return t=>fI(n=>n!=null,e)(t)}function AA(){return ja(zr())}var Kn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Kn||{}),vo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(vo||{}),hn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(hn||{}),mo=(e=>(e.all="all",e.none="none",e.specific="specific",e))(mo||{});const Cn=bn({localId:dt,componentPath:Lc(dt),sharedConfigurationModel:Oh(dt)}),$A=_o(Hi(bn({attributeId:Cn,decisions:Lc(Cn)}))),OA=_o(Dn((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:r})=>Hi(Dh).equals(n.rules,r.rules)).otherwise(()=>!1))),DA=_o(bn({rules:OA})),NA=bn({configurationModelSource:Dn((e,t)=>sA(e,t)),decisionsToRespect:$A,usageRuleParameters:hS(dt),allowedInExplain:DA});var Ks=(e=>(e.Channel="Channel",e.Package="Package",e))(Ks||{}),ct=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ct||{}),Ee=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ee||{}),Qt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Qt||{}),Rt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Rt||{}),Co=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Co||{}),wo=(e=>(e.Always="Always",e.Optional="Optional",e))(wo||{});const PA={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:_o(dt).equals(e.state,t.state)},RA={equals(e,t){return _o(Fc).equals(e.value,t.value)}},kA={equals(e,t){return _o(Ah).equals(e.value,t.value)}},MA={equals(e,t){return _o(dt).equals(e.state,t.state)}},jA={equals(e,t){return Cn.equals(e.attributeId,t.attributeId)?ue({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>kA.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>RA.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>MA.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>PA.equals(r.x,r.y)).otherwise(()=>!1):!1}},_A=Hi(jA),qA={equals:(e,t)=>_A.equals(e.decisions,t.decisions)&&FA.equals(e.mode,t.mode)},FA={equals:(e,t)=>ue({x:e,y:t}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var jd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(jd||{}),ya=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ya||{}),we=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(we||{}),Nh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Nh||{});function LA(e,t){console.log(`--------------------------------------------------------------------------------
|
|
2
2
|
-- ${t??""}
|
|
3
3
|
--------------------------------------------------------------------------------
|
|
4
|
-
${JSON.stringify(e,null,2)}`)}var Rs=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(Rs||{}),TS=(e=>(e.BooleanAttributeNotFound="BooleanAttributeNotFound",e.ChoiceAttributeNotFound="ChoiceAttributeNotFound",e.ChoiceValueNotFound="ChoiceValueNotFound",e.ConfigurationInitializationFailure="InitializationFailure",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",e.LegacySnapshotInvalid="SnapshotInvalid",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConflictWithConsequence="ConflictWithConsequence",e.DecisionInvalid="DecisionInvalid",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.NumericAttributeNotFound="NumericAttributeNotFound",e.NumericDecisionOutOfRange="NumericDecisionOutOfRange",e.SessionNotFound="SessionNotFound",e.SetDecisionConflict="SetDecisionConflict",e.Unauthorized="Unauthorized",e.AuthenticationFailure="AuthenticationFailure",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(TS||{});const LA=e=>Object.values(TS).includes(e),VA=e=>LA(e)?je(e):ge;function BA(e){const t=n=>ue(n).with("ConfigurationModelNotFound",()=>({type:we.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:we.DecisionsToRespectInvalid})).with(Ct.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:we.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:we.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:we.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:we.ConfigurationConflict,reason:Oh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:we.ConfigurationConflict})).with(Ct.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:we.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:we.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:we.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:we.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:we.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:we.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:we.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:we.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return w(e.type,VA,ee(t))}const UA=e=>Object.values(Rs).includes(e),GA=e=>UA(e)?je(e):ge;function zA(e){return w(e,GA,ee(n=>ue(n).with("Generic::LocalClientError",()=>({type:we.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:we.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:we.CommunicationError})).with("Generic::Unauthorized",()=>({type:we.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:we.Unknown})).exhaustive()))}function Ur(e,t){FA(e,t);const n=e.type;return w(ge,Em(()=>BA(e)),Em(()=>zA(n)),lt(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:we.Unknown})))}let ES=class{constructor(t,n,r,i){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=r,this.options=i}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return w(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),br(r=>Ur(r,"ClientSideSessionLifetimeHandler - create")),yr(r=>this.restToDomainMapper.mapToSessionId(r)),EA(()=>({type:we.ConfigurationUnauthenticated})))}close(t){return w(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),br(n=>Ur(n,"ClientSideSessionLifetimeHandler - close")),Xt(()=>Br()))}};var IS=(e=>(e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e))(IS||{});function Fr(e,t,n){const r=w(Array.isArray(e)?e:[e],uA);return w(Im(()=>fetch(r,t),i=>({type:"error"})),yr(i=>w(Im(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),sS(i=>i.status===401?Oi({type:Rs.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?ja({response:i,data:{}}):i.type==="error"?Oi({type:Rs.LowLevelCommunicationError}):Oi({type:Rs.UnhandledResponseStatus})),yr(i=>w(n(i),Th(()=>i.data))))}function Md(e,t){return Fr(e,t,n=>{if(n.response.status===200)return $i(n.data);if(n.response.status===409){const r=n.data;return ue(r).with({type:"ConfigurationModelInvalid"},i=>$i(r)).with({type:"ConfigurationModelNotFeasible"},i=>$i(r)).otherwise(()=>ge)}return ge})}let WA=class{constructor(t){this.baseUrl=t}createSessionUsingApiKey(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(t)};return Md([this.baseUrl,"v2/session"],r)}createSessionUsingJwtBearer(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(t)};return Md([this.baseUrl,"v2/session"],r)}setMany(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Fr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?je(i.data):ge)}makeDecision(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Fr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?je(i.data):ge)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Fr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?je(r.data):ge)}getWhyStateNotPossible(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Fr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?je(i.data):ge)}getWhyNotSatisfied(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Fr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?je(i.data):ge)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Fr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?je(r.data):ge)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return Fr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?je({}):ge)}};var xo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(xo||{}),jd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(jd||{}),_d=(e=>(e.Always="Always",e.Optional="Optional",e))(_d||{}),Ks=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Ks||{}),Hr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Hr||{}),Un=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Un||{}),qd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(qd||{}),Fd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(Fd||{}),Ss=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ss||{});const Vn=bn({localId:dt,componentPath:Fc(dt),sharedConfigurationModelId:Ah(dt)});let AS=class{mapToDecisions(t){return{}}mapToSessionId(t){return ue(t).with({sessionId:Ct.string},n=>ja(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=w(n.constraintExplanations,W(i=>this.mapToConstraintExplanation(i)));return Oi({type:we.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Oi({type:we.ConfigurationModelInvalid})).otherwise(()=>Oi({type:we.Unknown}))}mapToExplainAnswer(t,n){const r=ue(n).with({question:Kn.whyIsStateNotPossible,subject:hn.boolean},a=>[{type:Ee.Boolean,attributeId:a.attributeId,value:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.numeric},a=>[{type:Ee.Numeric,attributeId:a.attributeId,value:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.component},a=>[{type:Ee.Component,attributeId:a.attributeId,state:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.choiceValue},a=>[{type:Ee.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:je(a.state)}]).otherwise(()=>[]),i=w(t.decisionExplanations,W(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=w(t.constraintExplanations,W(a=>this.mapToConstraintExplanation(a)));return ue(n).with({answerType:vo.decisions},()=>({decisionExplanations:i})).with({answerType:vo.constraints},()=>({constraintExplanations:o})).with({answerType:vo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:we.ConfigurationSetManyConflict,decisionExplanations:w(t.decisionExplanations,W(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:w(t.constraintExplanations,W(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const r=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:r}}mapToBooleanDecision(t){return{type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Ce(t.state)}}mapToNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Ce(t.state)}}mapToComponentDecision(t){return{type:Ee.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return w(this.mapToDecisionState(t.state),ee(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:w(t.causedByRules,W(n=>this.mapToRuleConstraint(n))),causedByCardinalities:w(t.causedByCardinalities,W(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:ya.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:ya.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=w(t.booleanDecisions??[],W(a=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Ce(a.state)}))),r=w(t.numericDecisions??[],W(a=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Ce(a.state)}))),i=w(t.componentDecisions??[],W(a=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:w(Ce(a.state),ee(s=>this.mapToDecisionState(s)),Od)}))),o=w(t.choiceDecisions??[],W(a=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:w(Ce(a.state),ee(s=>this.mapToDecisionState(s)),Od)})));return w([],Pe(n),Pe(r),Pe(i),Pe(o))}mapToDecisionExplanation(t,n,r){const i=w(t.causedByBooleanDecisions,W(p=>this.mapToCausedByBooleanDecision(p))),o=w(t.causedByNumericDecisions,W(p=>this.mapToCausedByNumericDecision(p))),a=w(t.causedByComponentDecisions,W(p=>this.mapToCausedByComponentDecision(p))),s=w(t.causedByChoiceDecisions,W(p=>this.mapToCausedByChoiceValueDecision(p))),u=w(i,W(p=>({type:Ee.Boolean,attributeId:p.attributeId,value:ge}))),l=w(o,W(p=>({type:Ee.Numeric,attributeId:p.attributeId,value:ge}))),c=w(a,W(p=>({type:Ee.Component,attributeId:p.attributeId,state:ge}))),f=w(s,W(p=>({type:Ee.ChoiceValue,attributeId:p.attributeId,choiceValueId:p.choiceValueId,state:ge}))),d=w([],Pe(u),Pe(l),Pe(c),Pe(f)),h=eS(Dn((p,v)=>{const g=Cn.equals(p.attributeId,v.attributeId);return ue({a:p,b:v}).with({a:{type:Ee.ChoiceValue},b:{type:Ee.ChoiceValue}},C=>g&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>g)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:w([],Pe(d),Pe(h)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return ue(t).with(qd.NotAvailable,()=>kd.NotAvailable).with(qd.StateNotPossible,()=>kd.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Ee.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function r(d){return w(n.canAttributeContributeToConfigurationSatisfaction,pn(h=>Vn.equals(h,d)),bs)}const i=w([],Pe(w(t.choiceValueDecisions,W(d=>d.attributeId))),Pe(w(n.choiceConsequences,W(d=>d.attributeId))),la(Vn)),o=w(i,W(d=>{const h=w(t.choiceValueDecisions??[],ME(v=>Vn.equals(v.attributeId,d))),p=w(n.choiceConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToChoiceAttributes(v,h,r(d))))}),Qn),a=w([],Pe(w(t.numericDecisions,W(d=>d.attributeId))),Pe(w(n.numericConsequences,W(d=>d.attributeId))),la(Vn)),s=w(a,W(d=>{const h=w(t.numericDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.numericConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToNumericAttribute(v,h,r(d))))}),Qn),u=w([],Pe(w(t.booleanDecisions,W(d=>d.attributeId))),Pe(w(n.booleanConsequences,W(d=>d.attributeId))),la(Vn)),l=w(u,W(d=>{const h=w(t.booleanDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.booleanConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToBooleanAttribute(v,h,r(d))))}),Qn),c=w([],Pe(w(t.componentDecisions,W(d=>d.attributeId))),Pe(w(n.componentConsequences,W(d=>d.attributeId))),la(Vn)),f=w(c,W(d=>{const h=w(t.componentDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.componentConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToComponentAttribute(v,h,r(d))))}),Qn);return w([],Pe(o),Pe(f),Pe(s),Pe(l))}mapToComponentAttribute(t,n,r){return{type:ct.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:w(t.possibleDecisionStates,xl(i=>this.mapToPossibleDecisionState(i))),decision:w(n,ar(i=>w(this.mapToDecisionState(i.state),ee(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:w(t.selection,Ce,ee(i=>this.mapToSelection(i)),_t),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=w(t.values,xl(o=>{const a=w(n,pn(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ct.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:w(n,ar(i=>w(i.state,Ce,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ct.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:w(n,ar(i=>w(i.state,Ce,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=w(t.possibleDecisionStates,xl(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:w(n,ar(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return ue(t).with(Ks.Implicit,()=>Rt.Implicit).with(Ks.Explicit,()=>Rt.Explicit).exhaustive()}mapToDecisionState(t){return ue(t).with(Hr.Included,()=>je(Qt.Included)).with(Hr.Excluded,()=>je(Qt.Excluded)).with(Hr.Undefined,()=>ge).exhaustive()}mapToPossibleDecisionState(t){return ue(t).with(xo.Included,()=>Qt.Included).with(xo.Excluded,()=>Qt.Excluded).exhaustive()}mapToSelection(t){return ue(t).with(jd.Mandatory,()=>Co.Mandatory).with(jd.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(_d.Always,()=>wo.Always).with(_d.Optional,()=>wo.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},$S=class{constructor(t,n){this.restToDomainMapper=new AS,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Md(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return w(r,br(i=>Ur(i,"ServerSideSessionLifetimeHandler - create")),yr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return w(Fr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===IS.NoContent?je({}):ge),br(n=>Ur(n,"ServerSideSessionLifetimeHandler - close")),Xt(Br))}};const Dh={whyIsNotSatisfied:{configuration:{question:xn.whyIsNotSatisfied,subject:Wt.configuration},attribute:e=>({question:xn.whyIsNotSatisfied,subject:Wt.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:xn.whyIsStateNotPossible,subject:Wt.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.component,attributeId:e,state:t})})}},HA=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:Dh},Symbol.toStringTag,{value:"Module"}));let KA=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=ge}setOnConfigurationChangedHandler(t){const n=w(t,Ce,ee(r=>i=>{const o=this.domainToContractMapper.mapToConfiguration(i);r(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await w(this.inner.setSessionContext(n),Xt(Br),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await w(this.inner.restoreConfiguration(n),Xt(Br),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await w(this.inner.makeDecision(n),Xt(Br),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await w(this.inner.setMany(r,i),Xt(Br),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await w(this.inner.applySolution(n),Xt(Br),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(Dh):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await w(this.inner.explain(i),Xt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await w(this.inner.close(),br(t=>this.domainToContractMapper.mapToFailureResult(t)),Kl(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Zn(br(t=>this.domainToContractMapper.mapToFailureResult(t)),Kl(t=>Promise.reject(t),t=>Promise.resolve(t)))}},YA=class{mapToExplainQuestion(t,n){const r={answerType:ue(n).with("decisions",()=>vo.decisions).with("constraints",()=>vo.constraints).with("full",()=>vo.all).exhaustive()};return ue(t).with({question:xn.whyIsNotSatisfied,subject:Wt.configuration},i=>({...r,question:Kn.whyIsNotSatisfied,subject:hn.configuration})).with({question:xn.whyIsNotSatisfied,subject:Wt.attribute},i=>({...r,question:Kn.whyIsNotSatisfied,subject:hn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:xn.whyIsStateNotPossible,subject:Wt.choiceValue},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:xn.whyIsStateNotPossible,subject:Wt.component},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:xn.whyIsStateNotPossible,subject:Wt.numeric},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:xn.whyIsStateNotPossible,subject:Wt.boolean},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,W(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return w(t,W(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return ue(t).with({type:Oe.Choice,choiceValueId:Ct.string},n=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:Oe.Numeric},n=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Ce(n.state)})).with({type:Oe.Boolean},n=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Ce(n.state)})).with({type:Oe.Component},n=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(Ce(n.state),ar(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return w(Ce(t),ee(n=>w(n,W(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:w(r.decisions,W(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return ue(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).exhaustive()}mapToConflictHandling(t){return ue(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath??[],sharedConfigurationModel:t.sharedConfigurationModelId}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return ue(t).with({type:Jr.Package},n=>({type:Hs.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Jr.Channel},n=>({type:Hs.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:w(t.decisions,W(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return ue(t).with({type:Oe.Boolean},n=>({type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:w(n.decision,Ce,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Numeric},n=>({type:ct.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:w(n.decision,Ce,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Choice},n=>({type:ct.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:w(n.values,W(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Component},n=>({type:ct.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:w(n.decision,Ce,ar(r=>w(this.mapToDecisionStateOption(r.state),ee(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:w(n.possibleDecisionStates,W(r=>this.mapToDecisionStateOption(r)),Qn),selection:w(n.selection,Ce,ee(r=>this.mapToSelection(r)),_t),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:w(t.possibleDecisionStates,W(n=>this.mapToDecisionStateOption(n)),Qn)}}mapToChoiceValueDecision(t){return w(t.decision,Ce,ar(n=>w(this.mapToDecisionStateOption(n.state),ee(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return ue(t).with(kr.Implicit,()=>Rt.Implicit).with(kr.Explicit,()=>Rt.Explicit).exhaustive()}mapToSelection(t){return ue(t).with(Rr.Mandatory,()=>Co.Mandatory).with(Rr.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(qi.Always,()=>wo.Always).with(qi.Optional,()=>wo.Optional).exhaustive()}mapToDecisionState(t){return ue(t).with(Ct.union(Xr.Included,_i.Included),()=>Qt.Included).with(Ct.union(Xr.Excluded,_i.Excluded),()=>Qt.Excluded).exhaustive()}mapToDecisionStateOption(t){return w(Ce(t),ee(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return w(t,Ce,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return w(t,Ce,ee(n=>ue(n).returnType().with({type:sn.all},()=>({type:mo.all})).with({type:sn.none},()=>({type:mo.none})).with({type:sn.specific},r=>({type:mo.specific,rules:w(r.rules,W(this.mapToGlobalConstraintId))})).exhaustive()))}},OS=class{mapToExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},i=>w(i.decisionExplanations,W(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=ue(t).with({constraintExplanations:Ct.array(Ct.any)},i=>w(i.constraintExplanations,W(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:w(t.causedByCardinalities,W(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:w(t.causedByRules,W(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=w(t.causedByChoiceDecisions,W(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=w(t.causedByComponentDecisions,W(a=>this.mapToCausedByComponentAttributeDecision(a))),i=w(t.causedByNumericDecisions,W(a=>this.mapToCausedByNumericAttributeDecision(a))),o=w(t.causedByBooleanDecisions,W(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:w([],Pe(n),Pe(r),Pe(i),Pe(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:w(t.decisions,W(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return ue(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return ue(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(t.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToFailureResult(t){return ue(t).with({type:we.ConfigurationConflict},n=>({type:zt.ConfigurationConflict,reason:ue(n.reason).with(Oh.NumericDecisionOutOfRange,()=>Lc.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:we.ConfigurationApplicationError},()=>({type:zt.ConfigurationApplicationError})).with({type:we.ConfigurationUnauthenticated},()=>({type:zt.ConfigurationUnauthenticated})).with({type:we.ConfigurationModelNotFound},()=>({type:zt.ConfigurationModelNotFound})).with({type:we.ConfigurationTimeout},()=>({type:zt.ConfigurationTimeout})).with({type:we.ConfigurationAttributeNotFound},()=>({type:zt.ConfigurationAttributeNotFound})).with({type:we.ConfigurationChoiceValueNotFound},()=>({type:zt.ConfigurationChoiceValueNotFound})).with({type:we.ConfigurationSolutionNotAvailable},()=>({type:zt.ConfigurationSolutionNotAvailable})).with({type:we.ConfigurationRejectedDecisionsConflict},n=>{const r=w(n.rejectedDecisions,W(i=>this.mapToExplicitDecision(i)));return wS.createConfigurationRejectedDecisionsConflict(r)}).with({type:we.DecisionsToRespectInvalid},()=>({type:zt.DecisionsToRespectInvalid})).with({type:we.ServiceError},()=>({type:zt.ServiceError})).with({type:we.CommunicationError},()=>({type:zt.CommunicationError})).with({type:we.Unknown},()=>({type:zt.Unknown})).with({type:we.ConfigurationModelInvalid},()=>({type:zt.ConfigurationModelInvalid})).with({type:we.ConfigurationInitializationFailure},()=>({type:zt.ConfigurationInitializationFailure})).with({type:we.ConfigurationModelNotFeasible},n=>({type:zt.ConfigurationModelNotFeasible,constraintExplanations:w(n.constraintExplanations,W(r=>this.mapToConstraintExplanation(r)))})).with({type:we.ConfigurationSetManyConflict},n=>({type:zt.ConfigurationSetManyConflict,decisionExplanations:w(n.decisionExplanations,W(r=>this.mapToDecisionExplanation(r))),constraintExplanations:w(n.constraintExplanations,W(r=>this.mapToConstraintExplanation(r)))})).with({type:we.SpecifiedDeploymentForbidden},n=>({type:zt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,W(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return w(t,ee(Zn(W(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:w(n.decisions,W(r=>this.mapToGlobalAttributeId(r)))})))),or)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return ue(t).with({type:Hs.Package},n=>({type:Jr.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Hs.Channel},n=>({type:Jr.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:Oe.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.state,ee(r=>this.mapToChoiceValueDecisionState(r)),_t),choiceValueId:n.choiceValueId})).with({type:Ee.Component},n=>({type:Oe.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.state,ee(r=>this.mapToComponentDecisionState(r)),_t)})).with({type:Ee.Numeric},n=>({type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).with({type:Ee.Boolean},n=>({type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).exhaustive()}mapToCardinality(t){return ue(t).with(ya.Cardinality,()=>ma.Cardinality).with(ya.Component,()=>ma.Component).with(ya.Rule,()=>ma.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Ee.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Ee.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Ee.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:Oe.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:Oe.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return ue(t).with(Co.Mandatory,()=>Rr.Mandatory).with(Co.Optional,()=>Rr.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return ue(t).with({type:ct.Boolean},r=>({...n,type:Oe.Boolean,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),or),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ct.Numeric},r=>({...n,type:Oe.Numeric,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),or),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ct.Choice},r=>({...n,type:Oe.Choice,cardinality:r.cardinality,values:w(r.values,W(i=>{const o=w(i.decision,ee(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),or);return{id:i.choiceValueId,possibleDecisionStates:w(i.possibleDecisionStates,W(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ct.Component},r=>({...n,type:Oe.Component,decision:w(r.decision,ee(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),or),possibleDecisionStates:w(r.possibleDecisionStates,W(i=>this.mapToComponentDecisionState(i))),selection:w(r.selection,Ce,ee(i=>this.mapToSelection(i)),_t),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return ue(t).with(wo.Always,()=>qi.Always).with(wo.Optional,()=>qi.Optional).exhaustive()}mapToComponentDecisionState(t){return ue(t).with(Qt.Included,()=>_i.Included).with(Qt.Excluded,()=>_i.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return ue(t).with(Qt.Included,()=>Xr.Included).with(Qt.Excluded,()=>Xr.Excluded).exhaustive()}mapToDecisionKind(t){return ue(t).with(Rt.Explicit,()=>kr.Explicit).with(Rt.Implicit,()=>kr.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return w(t,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),or)}mapToAllowedRulesInExplain(t){return w(t,ee(n=>ue(n).returnType().with({type:mo.all},()=>({type:sn.all})).with({type:mo.none},()=>({type:sn.none})).with({type:mo.specific},r=>({type:sn.specific,rules:w(r.rules,W(this.mapToGlobalConstraintId))})).exhaustive()),or)}},DS=class{constructor(t,n){this.contractToDomainMapper=new YA,this.domainToContractMapper=new OS,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await w(this.sessionHandler.recreate(n),Xt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new KA(i,this.contractToDomainMapper,this.domainToContractMapper)}),Kl(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:ge,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function Nh(e){return e.possibleDecisionStates.some(t=>t===Xr.Included)}function NS(e){return!Nh(e)}const JA=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:Nh,isBlocked:NS},Symbol.toStringTag,{value:"Module"}));function XA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.lowerBound>0).with({type:Oe.Boolean},t=>t.selection===Rr.Mandatory).with({type:Oe.Numeric},t=>t.selection===Rr.Mandatory).with({type:Oe.Component},t=>t.inclusion===qi.Optional&&t.selection===Rr.Mandatory).exhaustive()}function QA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function ZA(e){return w(e.values,Yt(Nh))}function e$(e){return w(e.values,Yt(NS))}function PS(e,t){return w(e.values,jo(n=>w(n.decision,Ce,Jt(r=>r.kind===t))))}function RS(e){return w(e.values,Yt(t=>w(t.decision,Ce,ee(n=>n.state===Xr.Included),lt(()=>!1))))}const t$=RS;function kS(e){return w(e.decision,Ce,Jt(t=>t.kind===kr.Explicit),or)}function MS(e){return w(e.decision,Ce,Jt(t=>t.kind===kr.Explicit),or)}function n$(e,t){return e.possibleDecisionStates.some(n=>n===t)}function jS(e){return w(e.decision,Ce,or)}function _S(e){return qS(e,_i.Included)}function r$(e){return!_S(e)}function qS(e,t){return e.possibleDecisionStates.some(n=>n===t)}const i$=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:ZA,getBlockedChoiceValues:e$,getBooleanDecision:MS,getChoiceDecisions:PS,getComponentDecision:jS,getIncludedChoiceValues:RS,getNumericDecision:kS,getSelectedChoiceValues:t$,isBooleanValuePossible:n$,isComponentAllowed:_S,isComponentBlocked:r$,isComponentStatePossible:qS,isMandatory:XA,isMultiSelect:QA},Symbol.toStringTag,{value:"Module"})),FS=e=>e.type===Oe.Boolean,LS=e=>e.type===Oe.Choice,VS=e=>e.type===Oe.Numeric,BS=e=>e.type===Oe.Component,o$=Cu(dt),qm=Wi(dt);function US(e,t){const n=a=>o$.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return w(n,jE(t?a=>qm.equals(w(a.componentPath??[],wE(r)),e.componentPath):a=>qm.equals(a.componentPath??[],e.componentPath)))}function a$(e,t,n){const r=w(US({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:w(t.componentPath??[],SE(t.localId))},n),nS(i=>i.id));return w(e,Yt(r))}function s$(e,t,n){const r=w(US({sharedConfigurationModelId:t,componentPath:[]},n),nS(i=>i.id));return w(e,Yt(r))}function u$(e){return w(e,Yt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function l$(e,t){return w(GS(e),W(n=>PS(n,t)),bh,jo(n=>Ce(n)))}function c$(e,t){return w(WS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>kS(n)),jo(n=>Ce(n)))}function f$(e,t){return w(HS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>MS(n)),jo(n=>Ce(n)))}function d$(e,t){return w(zS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>jS(n)),jo(n=>Ce(n)))}function GS(e){return w(e.attributes,Yt(LS))}function zS(e){return w(e.attributes,Yt(BS))}function WS(e){return w(e.attributes,Yt(VS))}function HS(e){return w(e.attributes,Yt(FS))}function p$(e,t){return w(wu(e,t),_t)}function h$(e,t){return w(KS(e,t),_t)}function v$(e,t,n){return w(KS(e,t),ee(r=>r.values),ar(Zn(pn(r=>r.id===n))),_t)}function m$(e,t){return w(wu(e,t),Jt(VS),_t)}function y$(e,t){return w(wu(e,t),Jt(FS),_t)}function g$(e,t){return w(wu(e,t),Jt(BS),_t)}function wu(e,t){return w(e.attributes,pn(n=>qo.equals(n.id,t)))}function KS(e,t){return w(wu(e,t),Jt(LS))}const Fo=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:a$,filterAttributesOfRoot:u$,filterAttributesOfShared:s$,getAttribute:p$,getBooleanAttribute:y$,getBooleanAttributes:HS,getBooleanDecisions:f$,getChoiceAttribute:h$,getChoiceAttributes:GS,getChoiceDecisions:l$,getChoiceValue:v$,getComponentAttribute:g$,getComponentAttributes:zS,getComponentDecisions:d$,getNumericAttribute:m$,getNumericAttributes:WS,getNumericDecisions:c$},Symbol.toStringTag,{value:"Module"})),b$="https://spc.cloud.ceventis.de/api/engine",S$={hcaEngineBaseUrl:b$};function C$(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??S$.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function fs(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const YS=e=>t=>n=>w(n,xE(r=>e.equals(r,t)),ee(r=>w(n,TE(r,i=>t))),Od,lt(()=>w(n,Pe(IE(t))))),Wu=YS({equals:(e,t)=>Cn.equals(e.attributeId,t.attributeId)}),w$=YS({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let x$=class{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const r=this.updateConfiguration(t.configuration,n);return{...t,configuration:r}}updateConfiguration(t,n){var r,i,o,a,s,u,l,c,f,d;const h=w(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],W(this.restToDomainMapper.mapToGlobalAttributeId)),p=I=>gh(Cn)(I,h),v=w(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),g=w(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=w(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=w(((s=n.consequences)==null?void 0:s.componentConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=w(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=w(((l=n.consequences)==null?void 0:l.numericConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=w(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=w(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=w([],Pe(w(T,W(I=>I.attributeId))),Pe(w(E,W(I=>I.attributeId))),Pe(w(b,W(I=>I.attributeId))),Pe(w(x,W(I=>I.attributeId))),Pe(w(v,W(I=>I.attributeId))),Pe(w(g,W(I=>I.attributeId))),Pe(w(C,W(I=>I.attributeId))),Pe(w(m,W(I=>I.attributeId))),la(Cn)),N=w(A,Ad(t.attributes,(I,P)=>{const _=t.attributes.find(L=>Cn.equals(L.attributeId,P));return ue(_).with({type:ct.Choice},(L,U)=>{const Y=this.mergeChoice(U,w(g,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(v,Yt(k=>Cn.equals(k.attributeId,P)),W(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Numeric},(L,U)=>{const Y=this.mergeNumeric(U,w(x,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(b,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Boolean},(L,U)=>{const Y=this.mergeBoolean(U,w(E,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(T,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).with({type:ct.Component},(L,U)=>{const Y=this.mergeComponent(U,w(m,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(C,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Wu(Y)(I)}).exhaustive()}),W(I=>{const P=p(I.attributeId);return I.canContributeToConfigurationSatisfaction!=P?{...I,canContributeToConfigurationSatisfaction:P}:I}));return{...t,isSatisfied:w((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,Ce,lt(()=>t.isSatisfied)),attributes:N}}mergeChoice(t,n,r){const i=w(n,ee(u=>u.values??[]),lt(()=>[])),o=w(r),a=w([],Pe(w(i,W(u=>u.choiceValueId))),Pe(w(o,W(u=>u.choiceValueId))),W(fs),la(dt)),s=w(a,Ad(t.values,(u,l)=>{const c=w(i,pn(p=>p.choiceValueId===l)),f=w(o,pn(p=>p.choiceValueId===l)),d=w(t.values.find(p=>p.choiceValueId===l),Ce),h=this.mergeChoiceValue(l,d,c,f);return w$(h)(u)}));return{...t,isSatisfied:w(n,ee(u=>fs(u.isSatisfied)),lt(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=w(i,ee(s=>({state:this.toDecisionState(fs(s.state)),kind:this.toDecisionKind(fs(s.kind))})),lt(()=>({state:w(n,ar(s=>w(s.decision,ee(u=>u.state)))),kind:w(n,ar(s=>w(s.decision,ee(u=>u.kind))),lt(()=>Rt.Explicit))}))),a=w(r,ee(s=>w(Tm(s.possibleDecisionStates??[]),W(u=>this.toPossibleDecisionState(u)),Qn)),lt(()=>w(n,ee(s=>s.possibleDecisionStates??[]),lt(()=>[]))));return{choiceValueId:t,decision:w(o.state,ee(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=w(r,ee(a=>{const s=this.toDecisionState(fs(a.state));return w(s,ee(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),lt(()=>w(t.decision,ee(a=>({state:a.state,kind:a.kind}))))),o=w(n,ee(a=>w(Tm(a.possibleDecisionStates??[]),W(s=>this.toPossibleDecisionState(s)),Qn)),lt(()=>t.possibleDecisionStates));return{...t,isSatisfied:w(n,ee(a=>a.isSatisfied),lt(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:w(n,ar(i=>Ce(i.isSatisfied)),lt(()=>t.isSatisfied)),decision:w(r,ji(()=>t.decision,i=>w(i.state,Ce,ee(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:w(n,ar(i=>Ce(i.isSatisfied)),lt(()=>t.isSatisfied)),decision:w(r,ji(()=>t.decision,i=>w(i.state,Ce,ee(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:w(n,ee(i=>i.possibleDecisionStates),lt(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return ue(t).with(xo.Included,()=>je(Qt.Included)).with(xo.Excluded,()=>je(Qt.Excluded)).otherwise(()=>ge)}toDecisionState(t){return ue(t).with(Hr.Included,()=>je(Qt.Included)).with(Hr.Excluded,()=>je(Qt.Excluded)).otherwise(()=>ge)}toDecisionKind(t){return ue(t).with(Ks.Implicit,()=>Rt.Implicit).with(Ks.Explicit,()=>Rt.Explicit).exhaustive()}},T$=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ee.Component},n=>({type:Un.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ee.Numeric},n=>({type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).with({type:Ee.Boolean},n=>({type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=w([...t],hi(u=>u.type!==Ee.Boolean?ge:je({type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,_t)}))),o=w([...t],hi(u=>u.type!==Ee.Numeric?ge:je({type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,_t)}))),a=w([...t],hi(u=>u.type!==Ee.ChoiceValue?ge:je({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=w([...t],hi(u=>u.type!==Ee.Component?ge:je({type:Un.Component,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:this.mapToDecisionState(u.state)})));return{mode:r,choiceDecisions:a,numericDecisions:o,booleanDecisions:i,componentDecisions:s}}mapToExplicitDecisionsInner(t){const n=w([...t],hi(a=>a.type!==ct.Boolean?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitBooleanDecision(a))))),r=w([...t],hi(a=>a.type!==ct.Numeric?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitNumericDecision(a))))),i=w([...t],hi(a=>a.type!==ct.Component?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitComponentDecision(a))))),o=w([...t],hi(a=>a.type!==ct.Choice?ge:w(this.mapToExplicitChoiceDecisions(a),Su(s=>w(s,bu)))),RE);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return ue(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:w(t.componentPath,Ce,ee($d),or),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:ue(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Ct.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),_t)}}mapToExplicitNumericDecision(t){return{type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),_t)}}mapToExplicitComponentDecision(t){return{type:Un.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(w(t.decision,ee(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return w(r.decision,ee(i=>i.kind===Rt.Explicit),lt(()=>!1))}return w(t.values,Yt(n),W(r=>({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(w(r.decision,ee(i=>i.state)))})),$d)}mapToDecisionState(t){return w(t,ee(n=>ue(n).with(Qt.Included,()=>Hr.Included).with(Qt.Excluded,()=>Hr.Excluded).exhaustive()),lt(()=>Hr.Undefined))}mapToPossibleDecisionState(t){return ue(t).with(Qt.Included,()=>xo.Included).with(Qt.Excluded,()=>xo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return ue(t).with({subject:hn.attribute},n=>({type:Fd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:hn.configuration},()=>({type:Fd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return ue(t).with({subject:hn.boolean},n=>({type:Ss.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.numeric},n=>({type:Ss.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.component},n=>({type:Ss.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:hn.choiceValue},n=>({type:Ss.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},E$=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return w(t.configuration.attributes,pn(n=>ue(n).with({type:ct.Boolean},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).with({type:ct.Numeric},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).with({type:ct.Choice},r=>w(r.values,pn(i=>w(i.decision,ee(o=>o.kind===Rt.Explicit),lt(()=>!1))),bs)).with({type:ct.Component},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),bs)).exhaustive()),ji(()=>!1,()=>!0))},getExplicitDecisions(t){return w(t.configuration.attributes,W(n=>ue(n).with({type:ct.Boolean},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Boolean,attributeId:r.attributeId,value:Ce(i.state)})),ee(i=>[i]))).with({type:ct.Numeric},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Numeric,attributeId:r.attributeId,value:Ce(i.state)})),ee(i=>[i]))).with({type:ct.Choice},r=>w(r.values,W(i=>w(i.decision,Jt(o=>o.kind===Rt.Explicit),ee(o=>({type:Ee.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:Ce(o.state)})))),Qn,$i)).with({type:ct.Component},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Component,attributeId:r.attributeId,state:Ce(i.state)})),ee(i=>[i]))).exhaustive()),Qn,bh)}}}},I$=class{constructor(t,n,r,i,o,a){this.engineApiClient=n,this.domainToRestMapper=i,this.restToDomainMapper=r,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=t,this.interpreter=new E$}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const r=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(i,o)=>w(this.engineApiClient.makeDecision(i,r),br(Ur),Xt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=ue(t).with({question:Kn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Kn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return w(i,br(Ur),Xt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return w(a,yr(s=>{var u,l,c,f;return w([],Pe(w(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],W(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Pe(w(((l=s.rejectedDecisions)==null?void 0:l.numericDecisions)??[],W(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Pe(w(((c=s.rejectedDecisions)==null?void 0:c.componentDecisions)??[],W(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Pe(w(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],W(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),ca(this.domainUpdater.updateConfigurationSession(o,s))}))})}replaceDecisions(t,n){const r=this.interpreter.configurationSession.getExplicitDecisions(n),i=this.setManyInner(r,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return w(i,Xt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return w(o,br(Ur),yr(a=>{const s={rejectedDecisions:{booleanDecisions:Ct.array(Ct.any)}},u={decisionExplanations:Ct.array(Ct.any)};return ue(a).with(s,l=>ja(l)).with(u,l=>Oi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>Oi({type:we.Unknown}))}))}explainWhyStateNotPossible(t,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(t,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(t,n){return w(ca(t),yr(r=>w(r.sessionId,ji(()=>this.initializeInner(r,!1),()=>ca(r)))),yr(r=>w(r.sessionId,Th(()=>({type:we.ConfigurationUnauthenticated})),yr(i=>n(i,r)))))}initializeInner(t,n){return w(fI,()=>w(t.sessionId,CI,xI(s=>n?SI(s):w(this.sessionHandler.close(s),Kl(()=>ge,()=>ge)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return w(s,oI(()=>({type:we.ConfigurationUnauthenticated})),sS(()=>this.sessionHandler.create(u)))},s=>w(s,dI(u=>w($i(t),Jt(this.interpreter.configurationSession.hasExplicitDecisions),ee(l=>this.replaceDecisions(u,l)),lt(()=>ca({}))))),s=>w(s,yr(u=>{const l=this.determineConsequences(u),c=this.determineDecisions(u),f=_T(uI)({consequences:l,decisions:c});return w(f,Xt(({decisions:d,consequences:h})=>this.restToDomainMapper.mapToConfigurationModel(d,h)),Xt(d=>({sessionId:$i(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return w(this.engineApiClient.getDecisions(t),br(Ur))}determineConsequences(t){return w(this.engineApiClient.getConsequence(t),br(Ur))}},A$=class{constructor(t,n){this.onConfigurationChangedHandler=ge,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return w(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return w(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ge}}restoreConfiguration(t){return w(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return w(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return w(this.configurationSession.sessionId,ee(t=>this.sessionHandler.close(t)),ee(Zn(Xt(t=>{this.configurationSession={...this.configurationSession,sessionId:ge}}))),lt(Dc(IA())))}applySolution(t){return w(this.configurationSession.solutions,pn(n=>_A.equals(n,t)),Th(()=>({type:we.ConfigurationSolutionNotAvailable})),Xt(n=>n.decisions),yr(n=>this.setMany(n,t.mode)))}setMany(t,n){return w(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Yl(r=>()=>{const i=ue(r).with({decisionExplanations:Ct.array(Ct.any)},o=>je(o.decisionExplanations)).otherwise(()=>ge);this.configurationSession={...this.configurationSession,solutions:w(i,ee(Zn(W(o=>o.solution))),lt(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},r=>r.decisionExplanations).otherwise(()=>[]);return w(n,W(r=>r.solution))}invalidateAvailableSolutions(){return hI(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Yl(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Us(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Zn(Us(t=>()=>{this.configurationSession=t,w(this.onConfigurationChangedHandler,mI(n=>()=>n(this.configurationSession.configuration)))}),Xt(t=>t.configuration),this.invalidateAvailableSolutions())}},$$=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=fA(r,lA.concat(dA(i),cA(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Uo(this.policy,r,i=>w(i,ro(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return ue(t).with({type:we.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:we.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},O$=class{constructor(){this.queue=[],this.operating=ge}push(t){const n=new D$(t);return this.queue.push(n),this.operating=w(this.operating,lt(()=>this.start()),$i),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=w(t,W(r=>r.argument),Ad(ge,(r,i)=>this.reduce(r,i)),ee(Zn(r=>this.execute(r),r=>r.then(i=>{w(t,W(o=>{o.resolve(i)}))}).catch(i=>{w(t,W(o=>{o.reject(i)}))}))),_t);n&&await n}this.operating=ge}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},D$=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},N$=class extends O${constructor(t){super(),this.inner=t}reduce(t,n){return je(n)}async execute(t){return await this.inner.setSessionContext(t)()}},P$=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new N$(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(DA.equals(n,t))return ja(this.getConfiguration());const r=this.setContextReducingTaskExecutor.push(t);return()=>r}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},R$=class{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,r){const i=performance.now(),o=()=>{const a=performance.now()-i;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),w(r(),Yl(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Us(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},k$=class JS{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+SS()}static new(t){return new JS(t)}close(){return this.executeTaskSynchronous(()=>this.inner.close())}restoreConfiguration(t){return this.executeTaskSynchronous(()=>this.inner.restoreConfiguration(t))}setSessionContext(t){return this.executeTaskSynchronous(()=>this.inner.setSessionContext(t))}invalidateSessionId(){return this.inner.invalidateSessionId()}makeDecision(t){return this.executeTaskSynchronous(()=>this.inner.makeDecision(t))}applySolution(t){return this.executeTaskSynchronous(()=>this.inner.applySolution(t))}setMany(t,n){return this.executeTaskSynchronous(()=>this.inner.setMany(t,n))}explain(t){return this.executeTaskSynchronous(()=>this.inner.explain(t))}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}getConfiguration(){return this.inner.getConfiguration()}getSessionContext(){return this.inner.getSessionContext()}executeTaskSynchronous(t){return()=>navigator.locks.request(this.lockName,{mode:"exclusive"},()=>t()())}};function M$(e){e=C$(e);const t=new WA(e.hcaEngineBaseUrl),n=new AS,r=new T$,i=new OS,o=new xS,a=new x$(n),s=ue(e.sessionHandler).with({create:Ct.any,close:Ct.any},c=>c).with({accessToken:Ct.string},c=>new ES(t,o,n,c)).with({sessionCreateUrl:Ct.string,sessionDeleteUrl:Ct.string},c=>new $S(o,c)).exhaustive(),u=new I$(s,t,n,r,i,a),l=(c,f)=>w(new A$(c,f),d=>new $$(d),d=>new P$(d),k$.new,d=>new R$(d,!1));return new DS(u,l)}const XS=qo.equals,QS=$h.equals,j$=CS.equals,_$=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:sn,AttributeInterpreter:i$,AttributeType:Oe,ChoiceValueDecisionState:Xr,ChoiceValueInterpreter:JA,ClientSideSessionLifetimeHandler:ES,ComponentDecisionState:_i,ConfigurationConflictReason:Lc,ConfigurationInterpreter:Fo,ConfigurationModelSourceType:Jr,ConfiguratorClient:DS,ConstraintType:ma,ContractToRestMapper:xS,DecisionKind:kr,ExplainQuestionBuilderModule:HA,ExplainQuestionSubject:Wt,ExplainQuestionType:xn,FailureType:zt,Inclusion:qi,Results:TA,Selection:Rr,ServerSideSessionLifetimeHandler:$S,Types:xA,causedByDecisionEquals:j$,createClient:M$,explainQuestionBuilder:Dh,globalAttributeIdEquals:XS,globalConstraintIdEquals:QS},Symbol.toStringTag,{value:"Module"}));/*! *****************************************************************************
|
|
4
|
+
${JSON.stringify(e,null,2)}`)}var ks=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(ks||{}),ES=(e=>(e.BooleanAttributeNotFound="BooleanAttributeNotFound",e.ChoiceAttributeNotFound="ChoiceAttributeNotFound",e.ChoiceValueNotFound="ChoiceValueNotFound",e.ConfigurationInitializationFailure="InitializationFailure",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",e.LegacySnapshotInvalid="SnapshotInvalid",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConflictWithConsequence="ConflictWithConsequence",e.DecisionInvalid="DecisionInvalid",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.NumericAttributeNotFound="NumericAttributeNotFound",e.NumericDecisionOutOfRange="NumericDecisionOutOfRange",e.SessionNotFound="SessionNotFound",e.SetDecisionConflict="SetDecisionConflict",e.Unauthorized="Unauthorized",e.AuthenticationFailure="AuthenticationFailure",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(ES||{});const VA=e=>Object.values(ES).includes(e),BA=e=>VA(e)?je(e):ge;function UA(e){const t=n=>ue(n).with("ConfigurationModelNotFound",()=>({type:we.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:we.DecisionsToRespectInvalid})).with(Ct.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:we.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:we.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:we.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:we.ConfigurationConflict,reason:Nh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:we.ConfigurationConflict})).with(Ct.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:we.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:we.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:we.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:we.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:we.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:we.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:we.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:we.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return w(e.type,BA,ee(t))}const GA=e=>Object.values(ks).includes(e),zA=e=>GA(e)?je(e):ge;function WA(e){return w(e,zA,ee(n=>ue(n).with("Generic::LocalClientError",()=>({type:we.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:we.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:we.CommunicationError})).with("Generic::Unauthorized",()=>({type:we.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:we.Unknown})).exhaustive()))}function Wr(e,t){LA(e,t);const n=e.type;return w(ge,Im(()=>UA(e)),Im(()=>WA(n)),lt(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:we.Unknown})))}let IS=class{constructor(t,n,r,i){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=r,this.options=i}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return w(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),Cr(r=>Wr(r,"ClientSideSessionLifetimeHandler - create")),br(r=>this.restToDomainMapper.mapToSessionId(r)),IA(()=>({type:we.ConfigurationUnauthenticated})))}close(t){return w(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),Cr(n=>Wr(n,"ClientSideSessionLifetimeHandler - close")),Xt(()=>zr()))}};var AS=(e=>(e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e))(AS||{});function Br(e,t,n){const r=w(Array.isArray(e)?e:[e],lA);return w(Am(()=>fetch(r,t),i=>({type:"error"})),br(i=>w(Am(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),uS(i=>i.status===401?Di({type:ks.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?ja({response:i,data:{}}):i.type==="error"?Di({type:ks.LowLevelCommunicationError}):Di({type:ks.UnhandledResponseStatus})),br(i=>w(n(i),Ih(()=>i.data))))}function _d(e,t){return Br(e,t,n=>{if(n.response.status===200)return Oi(n.data);if(n.response.status===409){const r=n.data;return ue(r).with({type:"ConfigurationModelInvalid"},i=>Oi(r)).with({type:"ConfigurationModelNotFeasible"},i=>Oi(r)).otherwise(()=>ge)}return ge})}let HA=class{constructor(t){this.baseUrl=t}createSessionUsingApiKey(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(t)};return _d([this.baseUrl,"v2/session"],r)}createSessionUsingJwtBearer(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(t)};return _d([this.baseUrl,"v2/session"],r)}setMany(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Br([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?je(i.data):ge)}makeDecision(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Br([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?je(i.data):ge)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Br([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?je(r.data):ge)}getWhyStateNotPossible(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Br([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?je(i.data):ge)}getWhyNotSatisfied(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Br([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?je(i.data):ge)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Br([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?je(r.data):ge)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return Br([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?je({}):ge)}};var xo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(xo||{}),qd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(qd||{}),Fd=(e=>(e.Always="Always",e.Optional="Optional",e))(Fd||{}),Ys=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Ys||{}),Jr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Jr||{}),Un=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Un||{}),Ld=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Ld||{}),Vd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(Vd||{}),Cs=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Cs||{});const Vn=bn({localId:dt,componentPath:Lc(dt),sharedConfigurationModelId:Oh(dt)});let $S=class{mapToDecisions(t){return{}}mapToSessionId(t){return ue(t).with({sessionId:Ct.string},n=>ja(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=w(n.constraintExplanations,W(i=>this.mapToConstraintExplanation(i)));return Di({type:we.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Di({type:we.ConfigurationModelInvalid})).otherwise(()=>Di({type:we.Unknown}))}mapToExplainAnswer(t,n){const r=ue(n).with({question:Kn.whyIsStateNotPossible,subject:hn.boolean},a=>[{type:Ee.Boolean,attributeId:a.attributeId,value:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.numeric},a=>[{type:Ee.Numeric,attributeId:a.attributeId,value:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.component},a=>[{type:Ee.Component,attributeId:a.attributeId,state:je(a.state)}]).with({question:Kn.whyIsStateNotPossible,subject:hn.choiceValue},a=>[{type:Ee.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:je(a.state)}]).otherwise(()=>[]),i=w(t.decisionExplanations,W(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=w(t.constraintExplanations,W(a=>this.mapToConstraintExplanation(a)));return ue(n).with({answerType:vo.decisions},()=>({decisionExplanations:i})).with({answerType:vo.constraints},()=>({constraintExplanations:o})).with({answerType:vo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:we.ConfigurationSetManyConflict,decisionExplanations:w(t.decisionExplanations,W(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:w(t.constraintExplanations,W(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const r=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:r}}mapToBooleanDecision(t){return{type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Ce(t.state)}}mapToNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Ce(t.state)}}mapToComponentDecision(t){return{type:Ee.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return w(this.mapToDecisionState(t.state),ee(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:w(t.causedByRules,W(n=>this.mapToRuleConstraint(n))),causedByCardinalities:w(t.causedByCardinalities,W(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:ya.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:ya.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=w(t.booleanDecisions??[],W(a=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Ce(a.state)}))),r=w(t.numericDecisions??[],W(a=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Ce(a.state)}))),i=w(t.componentDecisions??[],W(a=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:w(Ce(a.state),ee(s=>this.mapToDecisionState(s)),Nd)}))),o=w(t.choiceDecisions??[],W(a=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:w(Ce(a.state),ee(s=>this.mapToDecisionState(s)),Nd)})));return w([],Pe(n),Pe(r),Pe(i),Pe(o))}mapToDecisionExplanation(t,n,r){const i=w(t.causedByBooleanDecisions,W(p=>this.mapToCausedByBooleanDecision(p))),o=w(t.causedByNumericDecisions,W(p=>this.mapToCausedByNumericDecision(p))),a=w(t.causedByComponentDecisions,W(p=>this.mapToCausedByComponentDecision(p))),s=w(t.causedByChoiceDecisions,W(p=>this.mapToCausedByChoiceValueDecision(p))),u=w(i,W(p=>({type:Ee.Boolean,attributeId:p.attributeId,value:ge}))),l=w(o,W(p=>({type:Ee.Numeric,attributeId:p.attributeId,value:ge}))),c=w(a,W(p=>({type:Ee.Component,attributeId:p.attributeId,state:ge}))),f=w(s,W(p=>({type:Ee.ChoiceValue,attributeId:p.attributeId,choiceValueId:p.choiceValueId,state:ge}))),d=w([],Pe(u),Pe(l),Pe(c),Pe(f)),h=tS(Dn((p,v)=>{const g=Cn.equals(p.attributeId,v.attributeId);return ue({a:p,b:v}).with({a:{type:Ee.ChoiceValue},b:{type:Ee.ChoiceValue}},C=>g&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>g)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:w([],Pe(d),Pe(h)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return ue(t).with(Ld.NotAvailable,()=>jd.NotAvailable).with(Ld.StateNotPossible,()=>jd.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Ee.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function r(d){return w(n.canAttributeContributeToConfigurationSatisfaction,pn(h=>Vn.equals(h,d)),Ss)}const i=w([],Pe(w(t.choiceValueDecisions,W(d=>d.attributeId))),Pe(w(n.choiceConsequences,W(d=>d.attributeId))),la(Vn)),o=w(i,W(d=>{const h=w(t.choiceValueDecisions??[],jE(v=>Vn.equals(v.attributeId,d))),p=w(n.choiceConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToChoiceAttributes(v,h,r(d))))}),Qn),a=w([],Pe(w(t.numericDecisions,W(d=>d.attributeId))),Pe(w(n.numericConsequences,W(d=>d.attributeId))),la(Vn)),s=w(a,W(d=>{const h=w(t.numericDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.numericConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToNumericAttribute(v,h,r(d))))}),Qn),u=w([],Pe(w(t.booleanDecisions,W(d=>d.attributeId))),Pe(w(n.booleanConsequences,W(d=>d.attributeId))),la(Vn)),l=w(u,W(d=>{const h=w(t.booleanDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.booleanConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToBooleanAttribute(v,h,r(d))))}),Qn),c=w([],Pe(w(t.componentDecisions,W(d=>d.attributeId))),Pe(w(n.componentConsequences,W(d=>d.attributeId))),la(Vn)),f=w(c,W(d=>{const h=w(t.componentDecisions??[],eo(v=>Vn.equals(v.attributeId,d))),p=w(n.componentConsequences??[],eo(v=>Vn.equals(v.attributeId,d)));return w(p,ee(v=>this.mapToComponentAttribute(v,h,r(d))))}),Qn);return w([],Pe(o),Pe(f),Pe(s),Pe(l))}mapToComponentAttribute(t,n,r){return{type:ct.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:w(t.possibleDecisionStates,Tl(i=>this.mapToPossibleDecisionState(i))),decision:w(n,sr(i=>w(this.mapToDecisionState(i.state),ee(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:w(t.selection,Ce,ee(i=>this.mapToSelection(i)),_t),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=w(t.values,Tl(o=>{const a=w(n,pn(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ct.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:w(n,sr(i=>w(i.state,Ce,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ct.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:w(n,sr(i=>w(i.state,Ce,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=w(t.possibleDecisionStates,Tl(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:w(n,sr(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return ue(t).with(Ys.Implicit,()=>Rt.Implicit).with(Ys.Explicit,()=>Rt.Explicit).exhaustive()}mapToDecisionState(t){return ue(t).with(Jr.Included,()=>je(Qt.Included)).with(Jr.Excluded,()=>je(Qt.Excluded)).with(Jr.Undefined,()=>ge).exhaustive()}mapToPossibleDecisionState(t){return ue(t).with(xo.Included,()=>Qt.Included).with(xo.Excluded,()=>Qt.Excluded).exhaustive()}mapToSelection(t){return ue(t).with(qd.Mandatory,()=>Co.Mandatory).with(qd.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(Fd.Always,()=>wo.Always).with(Fd.Optional,()=>wo.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},OS=class{constructor(t,n){this.restToDomainMapper=new $S,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=_d(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return w(r,Cr(i=>Wr(i,"ServerSideSessionLifetimeHandler - create")),br(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return w(Br(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===AS.NoContent?je({}):ge),Cr(n=>Wr(n,"ServerSideSessionLifetimeHandler - close")),Xt(zr))}};const Ph={whyIsNotSatisfied:{configuration:{question:xn.whyIsNotSatisfied,subject:Wt.configuration},attribute:e=>({question:xn.whyIsNotSatisfied,subject:Wt.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:xn.whyIsStateNotPossible,subject:Wt.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:xn.whyIsStateNotPossible,subject:Wt.component,attributeId:e,state:t})})}},KA=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:Ph},Symbol.toStringTag,{value:"Module"}));let YA=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=ge}setOnConfigurationChangedHandler(t){const n=w(t,Ce,ee(r=>i=>{const o=this.domainToContractMapper.mapToConfiguration(i);r(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await w(this.inner.setSessionContext(n),Xt(zr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await w(this.inner.restoreConfiguration(n),Xt(zr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await w(this.inner.makeDecision(n),Xt(zr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await w(this.inner.setMany(r,i),Xt(zr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await w(this.inner.applySolution(n),Xt(zr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(Ph):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await w(this.inner.explain(i),Xt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await w(this.inner.close(),Cr(t=>this.domainToContractMapper.mapToFailureResult(t)),Yl(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Zn(Cr(t=>this.domainToContractMapper.mapToFailureResult(t)),Yl(t=>Promise.reject(t),t=>Promise.resolve(t)))}},JA=class{mapToExplainQuestion(t,n){const r={answerType:ue(n).with("decisions",()=>vo.decisions).with("constraints",()=>vo.constraints).with("full",()=>vo.all).exhaustive()};return ue(t).with({question:xn.whyIsNotSatisfied,subject:Wt.configuration},i=>({...r,question:Kn.whyIsNotSatisfied,subject:hn.configuration})).with({question:xn.whyIsNotSatisfied,subject:Wt.attribute},i=>({...r,question:Kn.whyIsNotSatisfied,subject:hn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:xn.whyIsStateNotPossible,subject:Wt.choiceValue},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:xn.whyIsStateNotPossible,subject:Wt.component},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:xn.whyIsStateNotPossible,subject:Wt.numeric},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:xn.whyIsStateNotPossible,subject:Wt.boolean},i=>({...r,question:Kn.whyIsStateNotPossible,subject:hn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,W(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return w(t,W(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return ue(t).with({type:Oe.Choice,choiceValueId:Ct.string},n=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:Oe.Numeric},n=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Ce(n.state)})).with({type:Oe.Boolean},n=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Ce(n.state)})).with({type:Oe.Component},n=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(Ce(n.state),sr(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return w(Ce(t),ee(n=>w(n,W(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:w(r.decisions,W(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return ue(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).exhaustive()}mapToConflictHandling(t){return ue(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath??[],sharedConfigurationModel:t.sharedConfigurationModelId}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return ue(t).with({type:Zr.Package},n=>({type:Ks.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Zr.Channel},n=>({type:Ks.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:w(t.decisions,W(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return ue(t).with({type:Oe.Boolean},n=>({type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:w(n.decision,Ce,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Numeric},n=>({type:ct.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:w(n.decision,Ce,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Choice},n=>({type:ct.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:w(n.values,W(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Component},n=>({type:ct.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:w(n.decision,Ce,sr(r=>w(this.mapToDecisionStateOption(r.state),ee(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:w(n.possibleDecisionStates,W(r=>this.mapToDecisionStateOption(r)),Qn),selection:w(n.selection,Ce,ee(r=>this.mapToSelection(r)),_t),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:w(t.possibleDecisionStates,W(n=>this.mapToDecisionStateOption(n)),Qn)}}mapToChoiceValueDecision(t){return w(t.decision,Ce,sr(n=>w(this.mapToDecisionStateOption(n.state),ee(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return ue(t).with(kr.Implicit,()=>Rt.Implicit).with(kr.Explicit,()=>Rt.Explicit).exhaustive()}mapToSelection(t){return ue(t).with(Rr.Mandatory,()=>Co.Mandatory).with(Rr.Optional,()=>Co.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(Fi.Always,()=>wo.Always).with(Fi.Optional,()=>wo.Optional).exhaustive()}mapToDecisionState(t){return ue(t).with(Ct.union(ei.Included,qi.Included),()=>Qt.Included).with(Ct.union(ei.Excluded,qi.Excluded),()=>Qt.Excluded).exhaustive()}mapToDecisionStateOption(t){return w(Ce(t),ee(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return w(t,Ce,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return w(t,Ce,ee(n=>ue(n).returnType().with({type:un.all},()=>({type:mo.all})).with({type:un.none},()=>({type:mo.none})).with({type:un.specific},r=>({type:mo.specific,rules:w(r.rules,W(this.mapToGlobalConstraintId))})).exhaustive()))}},DS=class{mapToExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},i=>w(i.decisionExplanations,W(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=ue(t).with({constraintExplanations:Ct.array(Ct.any)},i=>w(i.constraintExplanations,W(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:w(t.causedByCardinalities,W(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:w(t.causedByRules,W(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=w(t.causedByChoiceDecisions,W(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=w(t.causedByComponentDecisions,W(a=>this.mapToCausedByComponentAttributeDecision(a))),i=w(t.causedByNumericDecisions,W(a=>this.mapToCausedByNumericAttributeDecision(a))),o=w(t.causedByBooleanDecisions,W(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:w([],Pe(n),Pe(r),Pe(i),Pe(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:w(t.decisions,W(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return ue(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return ue(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(t.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToFailureResult(t){return ue(t).with({type:we.ConfigurationConflict},n=>({type:zt.ConfigurationConflict,reason:ue(n.reason).with(Nh.NumericDecisionOutOfRange,()=>Vc.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:we.ConfigurationApplicationError},()=>({type:zt.ConfigurationApplicationError})).with({type:we.ConfigurationUnauthenticated},()=>({type:zt.ConfigurationUnauthenticated})).with({type:we.ConfigurationModelNotFound},()=>({type:zt.ConfigurationModelNotFound})).with({type:we.ConfigurationTimeout},()=>({type:zt.ConfigurationTimeout})).with({type:we.ConfigurationAttributeNotFound},()=>({type:zt.ConfigurationAttributeNotFound})).with({type:we.ConfigurationChoiceValueNotFound},()=>({type:zt.ConfigurationChoiceValueNotFound})).with({type:we.ConfigurationSolutionNotAvailable},()=>({type:zt.ConfigurationSolutionNotAvailable})).with({type:we.ConfigurationRejectedDecisionsConflict},n=>{const r=w(n.rejectedDecisions,W(i=>this.mapToExplicitDecision(i)));return xS.createConfigurationRejectedDecisionsConflict(r)}).with({type:we.DecisionsToRespectInvalid},()=>({type:zt.DecisionsToRespectInvalid})).with({type:we.ServiceError},()=>({type:zt.ServiceError})).with({type:we.CommunicationError},()=>({type:zt.CommunicationError})).with({type:we.Unknown},()=>({type:zt.Unknown})).with({type:we.ConfigurationModelInvalid},()=>({type:zt.ConfigurationModelInvalid})).with({type:we.ConfigurationInitializationFailure},()=>({type:zt.ConfigurationInitializationFailure})).with({type:we.ConfigurationModelNotFeasible},n=>({type:zt.ConfigurationModelNotFeasible,constraintExplanations:w(n.constraintExplanations,W(r=>this.mapToConstraintExplanation(r)))})).with({type:we.ConfigurationSetManyConflict},n=>({type:zt.ConfigurationSetManyConflict,decisionExplanations:w(n.decisionExplanations,W(r=>this.mapToDecisionExplanation(r))),constraintExplanations:w(n.constraintExplanations,W(r=>this.mapToConstraintExplanation(r)))})).with({type:we.SpecifiedDeploymentForbidden},n=>({type:zt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,W(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return w(t,ee(Zn(W(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:w(n.decisions,W(r=>this.mapToGlobalAttributeId(r)))})))),ar)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return ue(t).with({type:Ks.Package},n=>({type:Zr.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Ks.Channel},n=>({type:Zr.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:Oe.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.state,ee(r=>this.mapToChoiceValueDecisionState(r)),_t),choiceValueId:n.choiceValueId})).with({type:Ee.Component},n=>({type:Oe.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.state,ee(r=>this.mapToComponentDecisionState(r)),_t)})).with({type:Ee.Numeric},n=>({type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).with({type:Ee.Boolean},n=>({type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).exhaustive()}mapToCardinality(t){return ue(t).with(ya.Cardinality,()=>ma.Cardinality).with(ya.Component,()=>ma.Component).with(ya.Rule,()=>ma.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Ee.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Ee.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Ee.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:Oe.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:Oe.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return ue(t).with(Co.Mandatory,()=>Rr.Mandatory).with(Co.Optional,()=>Rr.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return ue(t).with({type:ct.Boolean},r=>({...n,type:Oe.Boolean,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),ar),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ct.Numeric},r=>({...n,type:Oe.Numeric,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),ar),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ct.Choice},r=>({...n,type:Oe.Choice,cardinality:r.cardinality,values:w(r.values,W(i=>{const o=w(i.decision,ee(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),ar);return{id:i.choiceValueId,possibleDecisionStates:w(i.possibleDecisionStates,W(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ct.Component},r=>({...n,type:Oe.Component,decision:w(r.decision,ee(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),ar),possibleDecisionStates:w(r.possibleDecisionStates,W(i=>this.mapToComponentDecisionState(i))),selection:w(r.selection,Ce,ee(i=>this.mapToSelection(i)),_t),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return ue(t).with(wo.Always,()=>Fi.Always).with(wo.Optional,()=>Fi.Optional).exhaustive()}mapToComponentDecisionState(t){return ue(t).with(Qt.Included,()=>qi.Included).with(Qt.Excluded,()=>qi.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return ue(t).with(Qt.Included,()=>ei.Included).with(Qt.Excluded,()=>ei.Excluded).exhaustive()}mapToDecisionKind(t){return ue(t).with(Rt.Explicit,()=>kr.Explicit).with(Rt.Implicit,()=>kr.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return w(t,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),ar)}mapToAllowedRulesInExplain(t){return w(t,ee(n=>ue(n).returnType().with({type:mo.all},()=>({type:un.all})).with({type:mo.none},()=>({type:un.none})).with({type:mo.specific},r=>({type:un.specific,rules:w(r.rules,W(this.mapToGlobalConstraintId))})).exhaustive()),ar)}},NS=class{constructor(t,n){this.contractToDomainMapper=new JA,this.domainToContractMapper=new DS,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await w(this.sessionHandler.recreate(n),Xt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new YA(i,this.contractToDomainMapper,this.domainToContractMapper)}),Yl(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:ge,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function Rh(e){return e.possibleDecisionStates.some(t=>t===ei.Included)}function PS(e){return!Rh(e)}const XA=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:Rh,isBlocked:PS},Symbol.toStringTag,{value:"Module"}));function QA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.lowerBound>0).with({type:Oe.Boolean},t=>t.selection===Rr.Mandatory).with({type:Oe.Numeric},t=>t.selection===Rr.Mandatory).with({type:Oe.Component},t=>t.inclusion===Fi.Optional&&t.selection===Rr.Mandatory).exhaustive()}function ZA(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function e$(e){return w(e.values,Yt(Rh))}function t$(e){return w(e.values,Yt(PS))}function RS(e,t){return w(e.values,jo(n=>w(n.decision,Ce,Jt(r=>r.kind===t))))}function kS(e){return w(e.values,Yt(t=>w(t.decision,Ce,ee(n=>n.state===ei.Included),lt(()=>!1))))}const n$=kS;function MS(e){return w(e.decision,Ce,Jt(t=>t.kind===kr.Explicit),ar)}function jS(e){return w(e.decision,Ce,Jt(t=>t.kind===kr.Explicit),ar)}function r$(e,t){return e.possibleDecisionStates.some(n=>n===t)}function _S(e){return w(e.decision,Ce,ar)}function qS(e){return FS(e,qi.Included)}function i$(e){return!qS(e)}function FS(e,t){return e.possibleDecisionStates.some(n=>n===t)}const o$=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:e$,getBlockedChoiceValues:t$,getBooleanDecision:jS,getChoiceDecisions:RS,getComponentDecision:_S,getIncludedChoiceValues:kS,getNumericDecision:MS,getSelectedChoiceValues:n$,isBooleanValuePossible:r$,isComponentAllowed:qS,isComponentBlocked:i$,isComponentStatePossible:FS,isMandatory:QA,isMultiSelect:ZA},Symbol.toStringTag,{value:"Module"})),LS=e=>e.type===Oe.Boolean,VS=e=>e.type===Oe.Choice,BS=e=>e.type===Oe.Numeric,US=e=>e.type===Oe.Component,a$=wu(dt),Fm=Hi(dt);function GS(e,t){const n=a=>a$.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return w(n,_E(t?a=>Fm.equals(w(a.componentPath??[],xE(r)),e.componentPath):a=>Fm.equals(a.componentPath??[],e.componentPath)))}function s$(e,t,n){const r=w(GS({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:w(t.componentPath??[],CE(t.localId))},n),rS(i=>i.id));return w(e,Yt(r))}function u$(e,t,n){const r=w(GS({sharedConfigurationModelId:t,componentPath:[]},n),rS(i=>i.id));return w(e,Yt(r))}function l$(e){return w(e,Yt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function c$(e,t){return w(zS(e),W(n=>RS(n,t)),Ch,jo(n=>Ce(n)))}function f$(e,t){return w(HS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>MS(n)),jo(n=>Ce(n)))}function d$(e,t){return w(KS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>jS(n)),jo(n=>Ce(n)))}function p$(e,t){return w(WS(e),Yt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),W(n=>_S(n)),jo(n=>Ce(n)))}function zS(e){return w(e.attributes,Yt(VS))}function WS(e){return w(e.attributes,Yt(US))}function HS(e){return w(e.attributes,Yt(BS))}function KS(e){return w(e.attributes,Yt(LS))}function h$(e,t){return w(xu(e,t),_t)}function v$(e,t){return w(YS(e,t),_t)}function m$(e,t,n){return w(YS(e,t),ee(r=>r.values),sr(Zn(pn(r=>r.id===n))),_t)}function y$(e,t){return w(xu(e,t),Jt(BS),_t)}function g$(e,t){return w(xu(e,t),Jt(LS),_t)}function b$(e,t){return w(xu(e,t),Jt(US),_t)}function xu(e,t){return w(e.attributes,pn(n=>qo.equals(n.id,t)))}function YS(e,t){return w(xu(e,t),Jt(VS))}const Fo=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:s$,filterAttributesOfRoot:l$,filterAttributesOfShared:u$,getAttribute:h$,getBooleanAttribute:g$,getBooleanAttributes:KS,getBooleanDecisions:d$,getChoiceAttribute:v$,getChoiceAttributes:zS,getChoiceDecisions:c$,getChoiceValue:m$,getComponentAttribute:b$,getComponentAttributes:WS,getComponentDecisions:p$,getNumericAttribute:y$,getNumericAttributes:HS,getNumericDecisions:f$},Symbol.toStringTag,{value:"Module"})),S$="https://spc.cloud.ceventis.de/api/engine",C$={hcaEngineBaseUrl:S$};function w$(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??C$.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function ds(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const JS=e=>t=>n=>w(n,TE(r=>e.equals(r,t)),ee(r=>w(n,EE(r,i=>t))),Nd,lt(()=>w(n,Pe(AE(t))))),Hu=JS({equals:(e,t)=>Cn.equals(e.attributeId,t.attributeId)}),x$=JS({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let T$=class{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const r=this.updateConfiguration(t.configuration,n);return{...t,configuration:r}}updateConfiguration(t,n){var r,i,o,a,s,u,l,c,f,d;const h=w(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],W(this.restToDomainMapper.mapToGlobalAttributeId)),p=I=>Sh(Cn)(I,h),v=w(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),g=w(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=w(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=w(((s=n.consequences)==null?void 0:s.componentConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=w(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=w(((l=n.consequences)==null?void 0:l.numericConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=w(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=w(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],W(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=w([],Pe(w(T,W(I=>I.attributeId))),Pe(w(E,W(I=>I.attributeId))),Pe(w(b,W(I=>I.attributeId))),Pe(w(x,W(I=>I.attributeId))),Pe(w(v,W(I=>I.attributeId))),Pe(w(g,W(I=>I.attributeId))),Pe(w(C,W(I=>I.attributeId))),Pe(w(m,W(I=>I.attributeId))),la(Cn)),N=w(A,Od(t.attributes,(I,P)=>{const _=t.attributes.find(L=>Cn.equals(L.attributeId,P));return ue(_).with({type:ct.Choice},(L,U)=>{const Y=this.mergeChoice(U,w(g,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(v,Yt(k=>Cn.equals(k.attributeId,P)),W(k=>k.payload)));return Hu(Y)(I)}).with({type:ct.Numeric},(L,U)=>{const Y=this.mergeNumeric(U,w(x,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(b,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Hu(Y)(I)}).with({type:ct.Boolean},(L,U)=>{const Y=this.mergeBoolean(U,w(E,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(T,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Hu(Y)(I)}).with({type:ct.Component},(L,U)=>{const Y=this.mergeComponent(U,w(m,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)),w(C,pn(k=>Cn.equals(k.attributeId,P)),ee(k=>k.payload)));return Hu(Y)(I)}).exhaustive()}),W(I=>{const P=p(I.attributeId);return I.canContributeToConfigurationSatisfaction!=P?{...I,canContributeToConfigurationSatisfaction:P}:I}));return{...t,isSatisfied:w((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,Ce,lt(()=>t.isSatisfied)),attributes:N}}mergeChoice(t,n,r){const i=w(n,ee(u=>u.values??[]),lt(()=>[])),o=w(r),a=w([],Pe(w(i,W(u=>u.choiceValueId))),Pe(w(o,W(u=>u.choiceValueId))),W(ds),la(dt)),s=w(a,Od(t.values,(u,l)=>{const c=w(i,pn(p=>p.choiceValueId===l)),f=w(o,pn(p=>p.choiceValueId===l)),d=w(t.values.find(p=>p.choiceValueId===l),Ce),h=this.mergeChoiceValue(l,d,c,f);return x$(h)(u)}));return{...t,isSatisfied:w(n,ee(u=>ds(u.isSatisfied)),lt(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=w(i,ee(s=>({state:this.toDecisionState(ds(s.state)),kind:this.toDecisionKind(ds(s.kind))})),lt(()=>({state:w(n,sr(s=>w(s.decision,ee(u=>u.state)))),kind:w(n,sr(s=>w(s.decision,ee(u=>u.kind))),lt(()=>Rt.Explicit))}))),a=w(r,ee(s=>w(Em(s.possibleDecisionStates??[]),W(u=>this.toPossibleDecisionState(u)),Qn)),lt(()=>w(n,ee(s=>s.possibleDecisionStates??[]),lt(()=>[]))));return{choiceValueId:t,decision:w(o.state,ee(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=w(r,ee(a=>{const s=this.toDecisionState(ds(a.state));return w(s,ee(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),lt(()=>w(t.decision,ee(a=>({state:a.state,kind:a.kind}))))),o=w(n,ee(a=>w(Em(a.possibleDecisionStates??[]),W(s=>this.toPossibleDecisionState(s)),Qn)),lt(()=>t.possibleDecisionStates));return{...t,isSatisfied:w(n,ee(a=>a.isSatisfied),lt(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:w(n,sr(i=>Ce(i.isSatisfied)),lt(()=>t.isSatisfied)),decision:w(r,_i(()=>t.decision,i=>w(i.state,Ce,ee(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:w(n,sr(i=>Ce(i.isSatisfied)),lt(()=>t.isSatisfied)),decision:w(r,_i(()=>t.decision,i=>w(i.state,Ce,ee(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:w(n,ee(i=>i.possibleDecisionStates),lt(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return ue(t).with(xo.Included,()=>je(Qt.Included)).with(xo.Excluded,()=>je(Qt.Excluded)).otherwise(()=>ge)}toDecisionState(t){return ue(t).with(Jr.Included,()=>je(Qt.Included)).with(Jr.Excluded,()=>je(Qt.Excluded)).otherwise(()=>ge)}toDecisionKind(t){return ue(t).with(Ys.Implicit,()=>Rt.Implicit).with(Ys.Explicit,()=>Rt.Explicit).exhaustive()}},E$=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ee.Component},n=>({type:Un.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ee.Numeric},n=>({type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).with({type:Ee.Boolean},n=>({type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,_t)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=w([...t],vi(u=>u.type!==Ee.Boolean?ge:je({type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,_t)}))),o=w([...t],vi(u=>u.type!==Ee.Numeric?ge:je({type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,_t)}))),a=w([...t],vi(u=>u.type!==Ee.ChoiceValue?ge:je({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=w([...t],vi(u=>u.type!==Ee.Component?ge:je({type:Un.Component,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:this.mapToDecisionState(u.state)})));return{mode:r,choiceDecisions:a,numericDecisions:o,booleanDecisions:i,componentDecisions:s}}mapToExplicitDecisionsInner(t){const n=w([...t],vi(a=>a.type!==ct.Boolean?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitBooleanDecision(a))))),r=w([...t],vi(a=>a.type!==ct.Numeric?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitNumericDecision(a))))),i=w([...t],vi(a=>a.type!==ct.Component?ge:w(a.decision,Jt(s=>s.kind===Rt.Explicit),ee(()=>this.mapToExplicitComponentDecision(a))))),o=w([...t],vi(a=>a.type!==ct.Choice?ge:w(this.mapToExplicitChoiceDecisions(a),Cu(s=>w(s,Su)))),kE);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return ue(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:w(t.componentPath,Ce,ee(Dd),ar),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:ue(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Ct.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Un.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),_t)}}mapToExplicitNumericDecision(t){return{type:Un.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),_t)}}mapToExplicitComponentDecision(t){return{type:Un.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(w(t.decision,ee(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return w(r.decision,ee(i=>i.kind===Rt.Explicit),lt(()=>!1))}return w(t.values,Yt(n),W(r=>({type:Un.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(w(r.decision,ee(i=>i.state)))})),Dd)}mapToDecisionState(t){return w(t,ee(n=>ue(n).with(Qt.Included,()=>Jr.Included).with(Qt.Excluded,()=>Jr.Excluded).exhaustive()),lt(()=>Jr.Undefined))}mapToPossibleDecisionState(t){return ue(t).with(Qt.Included,()=>xo.Included).with(Qt.Excluded,()=>xo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return ue(t).with({subject:hn.attribute},n=>({type:Vd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:hn.configuration},()=>({type:Vd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return ue(t).with({subject:hn.boolean},n=>({type:Cs.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.numeric},n=>({type:Cs.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.component},n=>({type:Cs.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:hn.choiceValue},n=>({type:Cs.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},I$=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return w(t.configuration.attributes,pn(n=>ue(n).with({type:ct.Boolean},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),Ss)).with({type:ct.Numeric},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),Ss)).with({type:ct.Choice},r=>w(r.values,pn(i=>w(i.decision,ee(o=>o.kind===Rt.Explicit),lt(()=>!1))),Ss)).with({type:ct.Component},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),Ss)).exhaustive()),_i(()=>!1,()=>!0))},getExplicitDecisions(t){return w(t.configuration.attributes,W(n=>ue(n).with({type:ct.Boolean},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Boolean,attributeId:r.attributeId,value:Ce(i.state)})),ee(i=>[i]))).with({type:ct.Numeric},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Numeric,attributeId:r.attributeId,value:Ce(i.state)})),ee(i=>[i]))).with({type:ct.Choice},r=>w(r.values,W(i=>w(i.decision,Jt(o=>o.kind===Rt.Explicit),ee(o=>({type:Ee.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:Ce(o.state)})))),Qn,Oi)).with({type:ct.Component},r=>w(r.decision,Jt(i=>i.kind===Rt.Explicit),ee(i=>({type:Ee.Component,attributeId:r.attributeId,state:Ce(i.state)})),ee(i=>[i]))).exhaustive()),Qn,Ch)}}}},A$=class{constructor(t,n,r,i,o,a){this.engineApiClient=n,this.domainToRestMapper=i,this.restToDomainMapper=r,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=t,this.interpreter=new I$}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const r=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(i,o)=>w(this.engineApiClient.makeDecision(i,r),Cr(Wr),Xt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=ue(t).with({question:Kn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Kn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return w(i,Cr(Wr),Xt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return w(a,br(s=>{var u,l,c,f;return w([],Pe(w(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],W(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Pe(w(((l=s.rejectedDecisions)==null?void 0:l.numericDecisions)??[],W(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Pe(w(((c=s.rejectedDecisions)==null?void 0:c.componentDecisions)??[],W(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Pe(w(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],W(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),ca(this.domainUpdater.updateConfigurationSession(o,s))}))})}replaceDecisions(t,n){const r=this.interpreter.configurationSession.getExplicitDecisions(n),i=this.setManyInner(r,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return w(i,Xt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return w(o,Cr(Wr),br(a=>{const s={rejectedDecisions:{booleanDecisions:Ct.array(Ct.any)}},u={decisionExplanations:Ct.array(Ct.any)};return ue(a).with(s,l=>ja(l)).with(u,l=>Di(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>Di({type:we.Unknown}))}))}explainWhyStateNotPossible(t,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(t,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(t,n){return w(ca(t),br(r=>w(r.sessionId,_i(()=>this.initializeInner(r,!1),()=>ca(r)))),br(r=>w(r.sessionId,Ih(()=>({type:we.ConfigurationUnauthenticated})),br(i=>n(i,r)))))}initializeInner(t,n){return w(dI,()=>w(t.sessionId,wI,TI(s=>n?CI(s):w(this.sessionHandler.close(s),Yl(()=>ge,()=>ge)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return w(s,aI(()=>({type:we.ConfigurationUnauthenticated})),uS(()=>this.sessionHandler.create(u)))},s=>w(s,pI(u=>w(Oi(t),Jt(this.interpreter.configurationSession.hasExplicitDecisions),ee(l=>this.replaceDecisions(u,l)),lt(()=>ca({}))))),s=>w(s,br(u=>{const l=this.determineConsequences(u),c=this.determineDecisions(u),f=qT(lI)({consequences:l,decisions:c});return w(f,Xt(({decisions:d,consequences:h})=>this.restToDomainMapper.mapToConfigurationModel(d,h)),Xt(d=>({sessionId:Oi(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return w(this.engineApiClient.getDecisions(t),Cr(Wr))}determineConsequences(t){return w(this.engineApiClient.getConsequence(t),Cr(Wr))}},$$=class{constructor(t,n){this.onConfigurationChangedHandler=ge,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return w(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return w(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ge}}restoreConfiguration(t){return w(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return w(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return w(this.configurationSession.sessionId,ee(t=>this.sessionHandler.close(t)),ee(Zn(Xt(t=>{this.configurationSession={...this.configurationSession,sessionId:ge}}))),lt(Nc(AA())))}applySolution(t){return w(this.configurationSession.solutions,pn(n=>qA.equals(n,t)),Ih(()=>({type:we.ConfigurationSolutionNotAvailable})),Xt(n=>n.decisions),br(n=>this.setMany(n,t.mode)))}setMany(t,n){return w(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Jl(r=>()=>{const i=ue(r).with({decisionExplanations:Ct.array(Ct.any)},o=>je(o.decisionExplanations)).otherwise(()=>ge);this.configurationSession={...this.configurationSession,solutions:w(i,ee(Zn(W(o=>o.solution))),lt(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},r=>r.decisionExplanations).otherwise(()=>[]);return w(n,W(r=>r.solution))}invalidateAvailableSolutions(){return vI(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Jl(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Gs(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Zn(Gs(t=>()=>{this.configurationSession=t,w(this.onConfigurationChangedHandler,yI(n=>()=>n(this.configurationSession.configuration)))}),Xt(t=>t.configuration),this.invalidateAvailableSolutions())}},O$=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=dA(r,cA.concat(pA(i),fA(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Uo(this.policy,n,r=>w(r,ro(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Uo(this.policy,r,i=>w(i,ro(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return ue(t).with({type:we.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:we.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},D$=class{constructor(){this.queue=[],this.operating=ge}push(t){const n=new N$(t);return this.queue.push(n),this.operating=w(this.operating,lt(()=>this.start()),Oi),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=w(t,W(r=>r.argument),Od(ge,(r,i)=>this.reduce(r,i)),ee(Zn(r=>this.execute(r),r=>r.then(i=>{w(t,W(o=>{o.resolve(i)}))}).catch(i=>{w(t,W(o=>{o.reject(i)}))}))),_t);n&&await n}this.operating=ge}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},N$=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},P$=class extends D${constructor(t){super(),this.inner=t}reduce(t,n){return je(n)}async execute(t){return await this.inner.setSessionContext(t)()}},R$=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new P$(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(NA.equals(n,t))return ja(this.getConfiguration());const r=this.setContextReducingTaskExecutor.push(t);return()=>r}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},k$=class{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,r){const i=performance.now(),o=()=>{const a=performance.now()-i;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),w(r(),Jl(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Gs(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},M$=class XS{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+CS()}static new(t){return new XS(t)}close(){return this.executeTaskSynchronous(()=>this.inner.close())}restoreConfiguration(t){return this.executeTaskSynchronous(()=>this.inner.restoreConfiguration(t))}setSessionContext(t){return this.executeTaskSynchronous(()=>this.inner.setSessionContext(t))}invalidateSessionId(){return this.inner.invalidateSessionId()}makeDecision(t){return this.executeTaskSynchronous(()=>this.inner.makeDecision(t))}applySolution(t){return this.executeTaskSynchronous(()=>this.inner.applySolution(t))}setMany(t,n){return this.executeTaskSynchronous(()=>this.inner.setMany(t,n))}explain(t){return this.executeTaskSynchronous(()=>this.inner.explain(t))}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}getConfiguration(){return this.inner.getConfiguration()}getSessionContext(){return this.inner.getSessionContext()}executeTaskSynchronous(t){return()=>navigator.locks.request(this.lockName,{mode:"exclusive"},()=>t()())}};function j$(e){e=w$(e);const t=new HA(e.hcaEngineBaseUrl),n=new $S,r=new E$,i=new DS,o=new TS,a=new T$(n),s=ue(e.sessionHandler).with({create:Ct.any,close:Ct.any},c=>c).with({accessToken:Ct.string},c=>new IS(t,o,n,c)).with({sessionCreateUrl:Ct.string,sessionDeleteUrl:Ct.string},c=>new OS(o,c)).exhaustive(),u=new A$(s,t,n,r,i,a),l=(c,f)=>w(new $$(c,f),d=>new O$(d),d=>new R$(d),M$.new,d=>new k$(d,!1));return new NS(u,l)}const QS=qo.equals,ZS=Dh.equals,_$=wS.equals,q$=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:un,AttributeInterpreter:o$,AttributeType:Oe,ChoiceValueDecisionState:ei,ChoiceValueInterpreter:XA,ClientSideSessionLifetimeHandler:IS,ComponentDecisionState:qi,ConfigurationConflictReason:Vc,ConfigurationInterpreter:Fo,ConfigurationModelSourceType:Zr,ConfiguratorClient:NS,ConstraintType:ma,ContractToRestMapper:TS,DecisionKind:kr,ExplainQuestionBuilderModule:KA,ExplainQuestionSubject:Wt,ExplainQuestionType:xn,FailureType:zt,Inclusion:Fi,Results:EA,Selection:Rr,ServerSideSessionLifetimeHandler:OS,Types:TA,causedByDecisionEquals:_$,createClient:j$,explainQuestionBuilder:Ph,globalAttributeIdEquals:QS,globalConstraintIdEquals:ZS},Symbol.toStringTag,{value:"Module"}));/*! *****************************************************************************
|
|
5
5
|
Copyright (c) Microsoft Corporation.
|
|
6
6
|
|
|
7
7
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -14,12 +14,12 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
14
14
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15
15
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
16
16
|
PERFORMANCE OF THIS SOFTWARE.
|
|
17
|
-
***************************************************************************** */var ne=function(){return ne=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ne.apply(this,arguments)};function Ph(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ve(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ze(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function yt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ht;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(ht||(ht={}));var To;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(To||(To={}));var Ld=ht.Start,Rh=ht.Stop,xu=ht.Raise,Vc=ht.Send,ZS=ht.Cancel,q$=ht.NullEvent,kh=ht.Assign;ht.After;ht.DoneState;var eC=ht.Log,F$=ht.Init,Vd=ht.Invoke;ht.ErrorExecution;var Fm=ht.ErrorPlatform,L$=ht.ErrorCustom,tC=ht.Update,V$=ht.Choose,B$=ht.Pure,nC=".",Lm={},Bd="xstate.guard",U$="",$t=process.env.NODE_ENV==="production",Hu;function Mh(e,t,n){n===void 0&&(n=nC);var r=ks(e,n),i=ks(t,n);return He(i)?He(r)?i===r:!1:He(r)?r in i:Object.keys(r).every(function(o){return o in i?Mh(r[o],i[o]):!1})}function rC(e){try{return He(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function Ud(e,t){try{return qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function G$(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function ks(e,t){if(G$(e))return e.value;if(qa(e))return Xl(e);if(typeof e!="string")return e;var n=Ud(e,t);return Xl(n)}function Xl(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function Cs(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function Vm(e,t,n){var r,i,o={};try{for(var a=Ve(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];n(l)&&(o[u]=t(l,u,e))}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var z$=function(e){return function(t){var n,r,i=t;try{for(var o=Ve(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=i[s]}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function W$(e,t){return function(n){var r,i,o=n;try{for(var a=Ve(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function El(e){if(!e)return[[]];if(He(e))return[[e]];var t=It(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:El(e[n]).map(function(i){return[n].concat(i)})}));return t}function It(e){var t;return(t=[]).concat.apply(t,yt([],ze(e),!1))}function iC(e){return qa(e)?e:[e]}function vr(e){return e===void 0?[]:iC(e)}function Ql(e,t,n){var r,i;if(tt(e))return e(t,n.data);var o={};try{for(var a=Ve(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];tt(l)?o[u]=l(t,n.data):o[u]=l}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function H$(e){return/^(done|error)\./.test(e)}function Bm(e){return!!(e instanceof Promise||e!==null&&(tt(e)||typeof e=="object")&&tt(e.then))}function K$(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function Y$(e,t){var n,r,i=ze([[],[]],2),o=i[0],a=i[1];try{for(var s=Ve(e),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)?o.push(l):a.push(l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function oC(e,t){return Cs(e.states,function(n,r){if(n){var i=(He(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:oC(n,i)}}})}function J$(e,t){return{current:t,states:oC(e,t)}}function Um(e,t,n,r){$t||tn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,l=a.assignment,c={state:r,action:a,_event:t},f={};if(tt(l))f=l(o,t.data,c);else try{for(var d=Ve(Object.keys(l)),h=d.next();!h.done;h=d.next()){var p=h.value,v=l[p];f[p]=tt(v)?v(o,t.data,c):v}}catch(g){s={error:g}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var tn=function(){};$t||(tn=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});function qa(e){return Array.isArray(e)}function tt(e){return typeof e=="function"}function He(e){return typeof e=="string"}function aC(e,t){if(e)return He(e)?{type:Bd,name:e,predicate:t?t[e]:void 0}:tt(e)?{type:Bd,name:e.name,predicate:e}:e}function X$(e){try{return"subscribe"in e&&tt(e.subscribe)}catch{return!1}}var wi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Hu={},Hu[wi]=function(){return this},Hu[Symbol.observable]=function(){return this};function Qr(e){return!!e&&"__xstatenode"in e}function Q$(e){return!!e&&typeof e.send=="function"}var Z$=function(){var e=0;return function(){return e++,e.toString(16)}}();function Bc(e,t){return He(e)||typeof e=="number"?ne({type:e},t):e}function fn(e,t){if(!He(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Bc(e);return ne({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Go(e,t){var n=iC(t).map(function(r){return typeof r>"u"||typeof r=="string"||Qr(r)?{target:r,event:e}:ne(ne({},r),{event:e})});return n}function eO(e){if(!(e===void 0||e===U$))return vr(e)}function tO(e,t,n){if(!$t){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function sC(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Bd)return((o==null?void 0:o[t.name])||t.predicate)(n,r.data,a);var s=o==null?void 0:o[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function uC(e){return typeof e=="string"?{type:e}:e}function Il(e,t,n){var r=function(){},i=typeof e=="object",o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function Ku(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Gd(e){return(e.type===xu||e.type===Vc&&e.to===To.Internal)&&typeof e.delay!="number"}var ga=fn({type:F$});function zd(e,t){return t&&t[e]||void 0}function Ys(e,t){var n;if(He(e)||typeof e=="number"){var r=zd(e,t);tt(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(tt(e))n={type:e.name||e.toString(),exec:e};else{var r=zd(e.type,t);if(tt(r))n=ne(ne({},e),{exec:r});else if(r){var i=r.type||e.type;n=ne(ne(ne({},r),e),{type:i})}else n=e}return n}var xi=function(e,t){if(!e)return[];var n=qa(e)?e:[e];return n.map(function(r){return Ys(r,t)})};function jh(e){var t=Ys(e);return ne(ne({id:He(e)?e:t.id},t),{type:t.type})}function nO(e,t){return{type:xu,event:typeof e=="function"?e:Bc(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function rO(e,t,n,r){var i={_event:n},o=fn(tt(e.event)?e.event(t,n.data,i):e.event),a;if(He(e.delay)){var s=r&&r[e.delay];a=tt(s)?s(t,n.data,i):s}else a=tt(e.delay)?e.delay(t,n.data,i):e.delay;return ne(ne({},e),{type:xu,_event:o,delay:a})}function Uc(e,t){return{to:t?t.to:void 0,type:Vc,event:tt(e)?e:Bc(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:tt(e)?e.name:rC(e)}}function iO(e,t,n,r){var i={_event:n},o=fn(tt(e.event)?e.event(t,n.data,i):e.event),a;if(He(e.delay)){var s=r&&r[e.delay];a=tt(s)?s(t,n.data,i):s}else a=tt(e.delay)?e.delay(t,n.data,i):e.delay;var u=tt(e.to)?e.to(t,n.data,i):e.to;return ne(ne({},e),{to:u,_event:o,event:o.data,delay:a})}function oO(e,t){return Uc(e,ne(ne({},t),{to:To.Parent}))}var aO=function(e,t,n){return ne(ne({},e),{value:He(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},sO=function(e){return{type:ZS,sendId:e}};function uO(e){var t=jh(e);return{type:ht.Start,activity:t,exec:void 0}}function lO(e){var t=tt(e)?e:jh(e);return{type:ht.Stop,activity:t,exec:void 0}}function cO(e,t,n){var r=tt(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:ht.Stop,activity:i};return o}var fO=function(e){return{type:kh,assignment:e}};function dO(e,t){var n=t?"#".concat(t):"";return"".concat(ht.After,"(").concat(e,")").concat(n)}function Yu(e,t){var n="".concat(ht.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Al(e,t){var n="".concat(ht.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function ws(e,t){var n="".concat(ht.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function pO(e,t){if(!$t&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,yt([],ze(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Uc(function(r,i){return i},ne(ne({},t),{to:e}))}var hO=function(e){var t,n,r=[];try{for(var i=Ve(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===kh){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Zl(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:hO(i),u=s.length?Um(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case xu:{var C=rO(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case Vc:var m=iO(v,u,r,e.options.delays);if(!$t){var b=v.delay;tn(!He(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==To.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case eC:{var x=aO(v,u,r);return o==null||o(x,u,r),x}case V$:{var T=v,E=(g=T.conds.find(function(B){var G=aC(B.cond,e.options.guards);return!G||sC(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=ze(Zl(e,t,u,r,[{type:p,actions:xi(vr(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case B$:{var E=v.get(u,r.data);if(!E)return[];var P=ze(Zl(e,t,u,r,[{type:p,actions:xi(vr(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case Rh:{var x=cO(v,u,r);return o==null||o(x,n,r),x}case kh:{u=Um(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=Ys(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=ne(ne({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,yt([l[k]],ze(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Ve(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=It(i.map(d));return[h,u]}var ec=[],na=function(e,t){ec.push(e);var n=t(e);return ec.pop(),n},vO=function(e){return e(ec[ec.length-1])};function lC(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[wi]=function(){return this},t}function mO(e,t,n,r){var i,o=uC(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Ql(e.data,n,r):void 0,u=a?_h(a,e.id,s):lC(e.id);return u.meta=e,u}function _h(e,t,n){var r=lC(t);if(r.deferred=!0,Qr(e)){var i=r.state=na(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function yO(e){try{return typeof e.send=="function"}catch{return!1}}function gO(e){return yO(e)&&"id"in e}function bO(e){var t;return ne((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[wi]=function(){return this},t),e)}var tc=function(e){return e.type==="atomic"||e.type==="final"};function cC(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Js(e){return cC(e).filter(function(t){return t.type!=="history"})}function fC(e){var t=[e];return tc(e)?t:t.concat(It(Js(e).map(fC)))}function xs(e,t){var n,r,i,o,a,s,u,l,c=new Set(e),f=Wd(c),d=new Set(t);try{for(var h=Ve(d),p=h.next();!p.done;p=h.next())for(var v=p.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){n={error:I}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var C=Wd(d);try{for(var m=Ve(d),b=m.next();!b.done;b=m.next()){var v=b.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(P){return d.add(P)}):v.initialStateNodes.forEach(function(P){return d.add(P)});else if(v.type==="parallel")try{for(var x=(a=void 0,Ve(Js(v))),T=x.next();!T.done;T=x.next()){var E=T.value;d.has(E)||(d.add(E),f.get(E)?f.get(E).forEach(function(P){return d.add(P)}):E.initialStateNodes.forEach(function(P){return d.add(P)}))}}catch(P){a={error:P}}finally{try{T&&!T.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Ve(d),N=A.next();!N.done;N=A.next())for(var v=N.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){u={error:I}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(u)throw u.error}}return d}function dC(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(tc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=dC(o,t)}),i}function Wd(e){var t,n,r=new Map;try{for(var i=Ve(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function SO(e,t){var n=xs([e],t);return dC(e,Wd(n))}function Ts(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function CO(e){return yt([],ze(new Set(It(yt([],ze(e.map(function(t){return t.ownEvents})),!1)))),!1)}function $l(e,t){return t.type==="compound"?Js(t).some(function(n){return n.type==="final"&&Ts(e,n)}):t.type==="parallel"?Js(t).every(function(n){return $l(e,n)}):!1}function wO(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function Gm(e){return new Set(It(e.map(function(t){return t.tags})))}function pC(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(He(e)||He(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return pC(e[i],t[i])})}function xO(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function TO(e,t){var n=e.exec,r=ne(ne({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return r}var rr=function(){function e(t){var n=this,r;this.actions=[],this.activities=Lm,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||Lm,this.meta=wO(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 CO(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var r=ga;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ga;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),He(t))return[t];var i=Object.keys(t);return i.concat.apply(i,yt([],ze(i.map(function(o){return r.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=Ph(t,["configuration","transitions","tags","machine"]);return ne(ne({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return Mh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;$t&&tn(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},e}(),EO={deferEvents:!1},zm=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ne(ne({},EO),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.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()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e}(),_f=new Map,IO=0,ds={bookId:function(){return"x:".concat(IO++)},register:function(e,t){return _f.set(e,t),e},get:function(e){return _f.get(e)},free:function(e){_f.delete(e)}};function qh(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;$t||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function AO(){var e=qh();if(e&&"__xstate__"in e)return e.__xstate__}function $O(e){if(qh()){var t=AO();t&&t.register(e)}}function OO(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var l=i.shift();n=e.transition(n,l,u),r.forEach(function(c){return c.next(n)})}o=!1}},s=bO({id:t.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,c,f){var d=Il(l,c,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,s}var Hd={sync:!1,autoForward:!1},Dt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Dt||(Dt={}));var DO=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,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=!1,this.status=Dt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,f){if(qa(c))return r.batch(c),r.state;var d=fn(Bc(c,f));if(r.status===Dt.Stopped)return $t||tn(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(r.machine.id,`". This service has already reached its final state, and will not transition.
|
|
17
|
+
***************************************************************************** */var ne=function(){return ne=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ne.apply(this,arguments)};function kh(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ve(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ze(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function yt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ht;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(ht||(ht={}));var To;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(To||(To={}));var Bd=ht.Start,Mh=ht.Stop,Tu=ht.Raise,Bc=ht.Send,eC=ht.Cancel,F$=ht.NullEvent,jh=ht.Assign;ht.After;ht.DoneState;var tC=ht.Log,L$=ht.Init,Ud=ht.Invoke;ht.ErrorExecution;var Lm=ht.ErrorPlatform,V$=ht.ErrorCustom,nC=ht.Update,B$=ht.Choose,U$=ht.Pure,rC=".",Vm={},Gd="xstate.guard",G$="",$t=process.env.NODE_ENV==="production",Ku;function _h(e,t,n){n===void 0&&(n=rC);var r=Ms(e,n),i=Ms(t,n);return He(i)?He(r)?i===r:!1:He(r)?r in i:Object.keys(r).every(function(o){return o in i?_h(r[o],i[o]):!1})}function iC(e){try{return He(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function zd(e,t){try{return qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function z$(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function Ms(e,t){if(z$(e))return e.value;if(qa(e))return Ql(e);if(typeof e!="string")return e;var n=zd(e,t);return Ql(n)}function Ql(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function ws(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function Bm(e,t,n){var r,i,o={};try{for(var a=Ve(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];n(l)&&(o[u]=t(l,u,e))}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var W$=function(e){return function(t){var n,r,i=t;try{for(var o=Ve(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=i[s]}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function H$(e,t){return function(n){var r,i,o=n;try{for(var a=Ve(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function Il(e){if(!e)return[[]];if(He(e))return[[e]];var t=It(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:Il(e[n]).map(function(i){return[n].concat(i)})}));return t}function It(e){var t;return(t=[]).concat.apply(t,yt([],ze(e),!1))}function oC(e){return qa(e)?e:[e]}function yr(e){return e===void 0?[]:oC(e)}function Zl(e,t,n){var r,i;if(tt(e))return e(t,n.data);var o={};try{for(var a=Ve(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];tt(l)?o[u]=l(t,n.data):o[u]=l}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function K$(e){return/^(done|error)\./.test(e)}function Um(e){return!!(e instanceof Promise||e!==null&&(tt(e)||typeof e=="object")&&tt(e.then))}function Y$(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function J$(e,t){var n,r,i=ze([[],[]],2),o=i[0],a=i[1];try{for(var s=Ve(e),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)?o.push(l):a.push(l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function aC(e,t){return ws(e.states,function(n,r){if(n){var i=(He(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:aC(n,i)}}})}function X$(e,t){return{current:t,states:aC(e,t)}}function Gm(e,t,n,r){$t||nn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,l=a.assignment,c={state:r,action:a,_event:t},f={};if(tt(l))f=l(o,t.data,c);else try{for(var d=Ve(Object.keys(l)),h=d.next();!h.done;h=d.next()){var p=h.value,v=l[p];f[p]=tt(v)?v(o,t.data,c):v}}catch(g){s={error:g}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var nn=function(){};$t||(nn=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});function qa(e){return Array.isArray(e)}function tt(e){return typeof e=="function"}function He(e){return typeof e=="string"}function sC(e,t){if(e)return He(e)?{type:Gd,name:e,predicate:t?t[e]:void 0}:tt(e)?{type:Gd,name:e.name,predicate:e}:e}function Q$(e){try{return"subscribe"in e&&tt(e.subscribe)}catch{return!1}}var xi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Ku={},Ku[xi]=function(){return this},Ku[Symbol.observable]=function(){return this};function ti(e){return!!e&&"__xstatenode"in e}function Z$(e){return!!e&&typeof e.send=="function"}var eO=function(){var e=0;return function(){return e++,e.toString(16)}}();function Uc(e,t){return He(e)||typeof e=="number"?ne({type:e},t):e}function fn(e,t){if(!He(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Uc(e);return ne({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Go(e,t){var n=oC(t).map(function(r){return typeof r>"u"||typeof r=="string"||ti(r)?{target:r,event:e}:ne(ne({},r),{event:e})});return n}function tO(e){if(!(e===void 0||e===G$))return yr(e)}function nO(e,t,n){if(!$t){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function uC(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Gd)return((o==null?void 0:o[t.name])||t.predicate)(n,r.data,a);var s=o==null?void 0:o[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function lC(e){return typeof e=="string"?{type:e}:e}function Al(e,t,n){var r=function(){},i=typeof e=="object",o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function Yu(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Wd(e){return(e.type===Tu||e.type===Bc&&e.to===To.Internal)&&typeof e.delay!="number"}var ga=fn({type:L$});function Hd(e,t){return t&&t[e]||void 0}function Js(e,t){var n;if(He(e)||typeof e=="number"){var r=Hd(e,t);tt(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(tt(e))n={type:e.name||e.toString(),exec:e};else{var r=Hd(e.type,t);if(tt(r))n=ne(ne({},e),{exec:r});else if(r){var i=r.type||e.type;n=ne(ne(ne({},r),e),{type:i})}else n=e}return n}var Ti=function(e,t){if(!e)return[];var n=qa(e)?e:[e];return n.map(function(r){return Js(r,t)})};function qh(e){var t=Js(e);return ne(ne({id:He(e)?e:t.id},t),{type:t.type})}function rO(e,t){return{type:Tu,event:typeof e=="function"?e:Uc(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function iO(e,t,n,r){var i={_event:n},o=fn(tt(e.event)?e.event(t,n.data,i):e.event),a;if(He(e.delay)){var s=r&&r[e.delay];a=tt(s)?s(t,n.data,i):s}else a=tt(e.delay)?e.delay(t,n.data,i):e.delay;return ne(ne({},e),{type:Tu,_event:o,delay:a})}function Gc(e,t){return{to:t?t.to:void 0,type:Bc,event:tt(e)?e:Uc(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:tt(e)?e.name:iC(e)}}function oO(e,t,n,r){var i={_event:n},o=fn(tt(e.event)?e.event(t,n.data,i):e.event),a;if(He(e.delay)){var s=r&&r[e.delay];a=tt(s)?s(t,n.data,i):s}else a=tt(e.delay)?e.delay(t,n.data,i):e.delay;var u=tt(e.to)?e.to(t,n.data,i):e.to;return ne(ne({},e),{to:u,_event:o,event:o.data,delay:a})}function aO(e,t){return Gc(e,ne(ne({},t),{to:To.Parent}))}var sO=function(e,t,n){return ne(ne({},e),{value:He(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},uO=function(e){return{type:eC,sendId:e}};function lO(e){var t=qh(e);return{type:ht.Start,activity:t,exec:void 0}}function cO(e){var t=tt(e)?e:qh(e);return{type:ht.Stop,activity:t,exec:void 0}}function fO(e,t,n){var r=tt(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:ht.Stop,activity:i};return o}var dO=function(e){return{type:jh,assignment:e}};function pO(e,t){var n=t?"#".concat(t):"";return"".concat(ht.After,"(").concat(e,")").concat(n)}function Ju(e,t){var n="".concat(ht.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function $l(e,t){var n="".concat(ht.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function xs(e,t){var n="".concat(ht.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function hO(e,t){if(!$t&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,yt([],ze(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Gc(function(r,i){return i},ne(ne({},t),{to:e}))}var vO=function(e){var t,n,r=[];try{for(var i=Ve(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===jh){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function ec(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:vO(i),u=s.length?Gm(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case Tu:{var C=iO(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case Bc:var m=oO(v,u,r,e.options.delays);if(!$t){var b=v.delay;nn(!He(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==To.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case tC:{var x=sO(v,u,r);return o==null||o(x,u,r),x}case B$:{var T=v,E=(g=T.conds.find(function(B){var G=sC(B.cond,e.options.guards);return!G||uC(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=ze(ec(e,t,u,r,[{type:p,actions:Ti(yr(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case U$:{var E=v.get(u,r.data);if(!E)return[];var P=ze(ec(e,t,u,r,[{type:p,actions:Ti(yr(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case Mh:{var x=fO(v,u,r);return o==null||o(x,n,r),x}case jh:{u=Gm(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=Js(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=ne(ne({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,yt([l[k]],ze(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Ve(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=It(i.map(d));return[h,u]}var tc=[],na=function(e,t){tc.push(e);var n=t(e);return tc.pop(),n},mO=function(e){return e(tc[tc.length-1])};function cC(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[xi]=function(){return this},t}function yO(e,t,n,r){var i,o=lC(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Zl(e.data,n,r):void 0,u=a?Fh(a,e.id,s):cC(e.id);return u.meta=e,u}function Fh(e,t,n){var r=cC(t);if(r.deferred=!0,ti(e)){var i=r.state=na(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function gO(e){try{return typeof e.send=="function"}catch{return!1}}function bO(e){return gO(e)&&"id"in e}function SO(e){var t;return ne((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[xi]=function(){return this},t),e)}var nc=function(e){return e.type==="atomic"||e.type==="final"};function fC(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Xs(e){return fC(e).filter(function(t){return t.type!=="history"})}function dC(e){var t=[e];return nc(e)?t:t.concat(It(Xs(e).map(dC)))}function Ts(e,t){var n,r,i,o,a,s,u,l,c=new Set(e),f=Kd(c),d=new Set(t);try{for(var h=Ve(d),p=h.next();!p.done;p=h.next())for(var v=p.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){n={error:I}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var C=Kd(d);try{for(var m=Ve(d),b=m.next();!b.done;b=m.next()){var v=b.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(P){return d.add(P)}):v.initialStateNodes.forEach(function(P){return d.add(P)});else if(v.type==="parallel")try{for(var x=(a=void 0,Ve(Xs(v))),T=x.next();!T.done;T=x.next()){var E=T.value;d.has(E)||(d.add(E),f.get(E)?f.get(E).forEach(function(P){return d.add(P)}):E.initialStateNodes.forEach(function(P){return d.add(P)}))}}catch(P){a={error:P}}finally{try{T&&!T.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Ve(d),N=A.next();!N.done;N=A.next())for(var v=N.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){u={error:I}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(u)throw u.error}}return d}function pC(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(nc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=pC(o,t)}),i}function Kd(e){var t,n,r=new Map;try{for(var i=Ve(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function CO(e,t){var n=Ts([e],t);return pC(e,Kd(n))}function Es(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function wO(e){return yt([],ze(new Set(It(yt([],ze(e.map(function(t){return t.ownEvents})),!1)))),!1)}function Ol(e,t){return t.type==="compound"?Xs(t).some(function(n){return n.type==="final"&&Es(e,n)}):t.type==="parallel"?Xs(t).every(function(n){return Ol(e,n)}):!1}function xO(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function zm(e){return new Set(It(e.map(function(t){return t.tags})))}function hC(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(He(e)||He(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return hC(e[i],t[i])})}function TO(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function EO(e,t){var n=e.exec,r=ne(ne({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return r}var ir=function(){function e(t){var n=this,r;this.actions=[],this.activities=Vm,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||Vm,this.meta=xO(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 wO(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var r=ga;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=ga;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),He(t))return[t];var i=Object.keys(t);return i.concat.apply(i,yt([],ze(i.map(function(o){return r.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=kh(t,["configuration","transitions","tags","machine"]);return ne(ne({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return _h(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;$t&&nn(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},e}(),IO={deferEvents:!1},Wm=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ne(ne({},IO),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.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()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e}(),Ff=new Map,AO=0,ps={bookId:function(){return"x:".concat(AO++)},register:function(e,t){return Ff.set(e,t),e},get:function(e){return Ff.get(e)},free:function(e){Ff.delete(e)}};function Lh(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;$t||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function $O(){var e=Lh();if(e&&"__xstate__"in e)return e.__xstate__}function OO(e){if(Lh()){var t=$O();t&&t.register(e)}}function DO(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var l=i.shift();n=e.transition(n,l,u),r.forEach(function(c){return c.next(n)})}o=!1}},s=SO({id:t.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,c,f){var d=Al(l,c,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,s}var Yd={sync:!1,autoForward:!1},Dt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Dt||(Dt={}));var NO=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,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=!1,this.status=Dt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,f){if(qa(c))return r.batch(c),r.state;var d=fn(Uc(c,f));if(r.status===Dt.Stopped)return $t||nn(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(r.machine.id,`". This service has already reached its final state, and will not transition.
|
|
18
18
|
Event: `).concat(JSON.stringify(d.data))),r.state;if(r.status!==Dt.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(d.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
19
|
-
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var h=r._nextState(d);r.update(h,d)}),r._state},this.sendTo=function(c,f,d){var h=r.parent&&(f===To.Parent||r.parent.id===f),p=h?r.parent:He(f)?f===To.Internal?r:r.children.get(f)||
|
|
20
|
-
Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.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){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,a=n.state,s=!1,u=[],l=function(h){var p=fn(h);n.forward(p),a=na(n,function(){return n.machine.transition(a,p,void 0,r||void 0)}),u.push.apply(u,yt([],ze(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return TO(v,a)})),!1)),s=s||!!a.changed};try{for(var c=Ve(t),f=c.next();!f.done;f=c.next()){var d=f.value;l(d)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,fn(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=fn(t);if(i.name.indexOf(Fm)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Fm)===0}))throw i.data.data;var o=na(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var i=Ve(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(t)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,r=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=r)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(t,n.context,n._event,r)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),tt(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Dt.Running)return _h(t,n);if(Bm(t))return this.spawnPromise(Promise.resolve(t),n);if(tt(t))return this.spawnCallback(t,n);if(gO(t))return this.spawnActor(t,n);if(X$(t))return this.spawnObservable(t,n);if(Qr(t))return this.spawnMachine(t,ne(ne({},r),{id:n}));if(K$(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var i=new e(t,ne(ne({},this.options),{parent:this,id:n.id||t.id})),o=ne(ne({},Hd),n);o.sync&&i.onTransition(function(s){r.send(tC,{state:s,id:i.id})});var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(s){r.removeChild(i.id),r.send(fn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=OO(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,i=this,o=!1,a;t.then(function(u){o||(a=u,i.removeChild(n),i.send(fn(Al(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var l=ws(n,u);try{i.send(fn(l,{origin:n}))}catch(c){tO(u,c,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,l,c){var f=Il(u,l,c),d=!1;return t.then(function(h){d||(f.next(h),!d&&f.complete())},function(h){d||f.error(h)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[wi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,i=this,o=!1,a=new Set,s=new Set,u,l=function(d){u=d,s.forEach(function(h){return h(d)}),!o&&i.send(fn(d,{origin:n}))},c;try{c=t(l,function(d){a.add(d)})}catch(d){this.send(ws(n,d))}if(Bm(c))return this.spawnPromise(c,n);var f=(r={id:n,send:function(d){return a.forEach(function(h){return h(d)})},subscribe:function(d){var h=Il(d);return s.add(h.next),{unsubscribe:function(){s.delete(h.next)}}},stop:function(){o=!0,tt(c)&&c()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[wi]=function(){return this},r);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var r,i=this,o,a=t.subscribe(function(u){o=u,i.send(fn(u,{origin:n}))},function(u){i.removeChild(n),i.send(fn(ws(n,u),{origin:n}))},function(){i.removeChild(n),i.send(fn(Al(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,l,c){return t.subscribe(u,l,c)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[wi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!n){$t||tn(!1,"No implementation found for activity '".concat(t.type,"'"));return}var r=n(this.state.context,t);this.spawnEffect(t.id,r)},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[wi]=function(){return this},r))},e.prototype.attachDev=function(){var t=qh();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(ne(ne({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:ne({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}$O(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[wi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Dt.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=hC,e}(),NO=function(e){return He(e)?ne(ne({},Hd),{name:e}):ne(ne(ne({},Hd),{name:Z$()}),e)};function Wm(e,t){var n=NO(t);return vO(function(r){if(!$t){var i=Qr(e)||tt(e);tn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Qr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):_h(e,n.name)})}function hC(e,t){var n=new DO(e,t);return n}function PO(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Ju(e){return ne(ne({type:Vd},e),{toJSON:function(){e.onDone,e.onError;var t=Ph(e,["onDone","onError"]);return ne(ne({},t),{type:Vd,src:PO(e.src)})}})}var ra="",Kd="#",ps="*",zo={},Wo=function(e){return e[0]===Kd},RO=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},kO=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(He(o.target)||Qr(o.target))}),i=t===ra?"the transient event":"event '".concat(t,"'");tn(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},MO=function(){function e(t,n,r,i){r===void 0&&(r="context"in t?t.context:void 0);var o=this,a;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(RO(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.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:nC),this.id=this.config.id||yt([this.machine.key],ze(this.path),!1).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:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,$t||tn(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?Cs(this.config.states,function(l,c){var f,d=new e(l,{},void 0,{parent:o,key:c});return Object.assign(o.idMap,ne((f={},f[d.id]=d,f),d.idMap)),d}):zo;var s=0;function u(l){var c,f;l.order=s++;try{for(var d=Ve(cC(l)),h=d.next();!h.done;h=d.next()){var p=h.value;u(p)}}catch(v){c={error:v}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(l){var c=l.event;return c===ra}):ra in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=vr(this.config.entry||this.config.onEntry).map(function(l){return Ys(l)}),this.onExit=vr(this.config.exit||this.config.onExit).map(function(l){return Ys(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=vr(this.config.invoke).map(function(l,c){var f,d;if(Qr(l)){var h=Ku(o.id,c);return o.machine.options.services=ne((f={},f[h]=l,f),o.machine.options.services),Ju({src:h,id:h})}else if(He(l.src)){var h=l.id||Ku(o.id,c);return Ju(ne(ne({},l),{id:h,src:l.src}))}else if(Qr(l.src)||tt(l.src)){var h=l.id||Ku(o.id,c);return o.machine.options.services=ne((d={},d[h]=l.src,d),o.machine.options.services),Ju(ne(ne({id:h},l),{src:h}))}else{var p=l.src;return Ju(ne(ne({id:Ku(o.id,c)},l),{src:p}))}}),this.activities=vr(this.config.activities).concat(this.invoke).map(function(l){return jh(l)}),this.transition=this.transition.bind(this),this.tags=vr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||fC(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,o=r.activities,a=r.guards,s=r.services,u=r.delays;return new e(this.config,{actions:ne(ne({},i),t.actions),activities:ne(ne({},o),t.activities),guards:ne(ne({},a),t.guards),services:ne(ne({},s),t.services),delays:ne(ne({},u),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return tt(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.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:Cs(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:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===ra,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===ps});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(o,a){var s=tt(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=dO(s,t.id);return t.onEntry.push(Uc(u,{delay:o})),t.onExit.push(sO(u)),u},i=qa(n)?n.map(function(o,a){var s=r(o.delay,a);return ne(ne({},o),{event:s})}):It(Object.keys(n).map(function(o,a){var s=n[o],u=He(s)?{target:s}:s,l=isNaN(+o)?o:+o,c=r(l,a);return vr(u).map(function(f){return ne(ne({},f),{event:c,delay:l})})}));return i.map(function(o){var a=o.delay;return ne(ne({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var i=t instanceof rr?t.value:ks(t,this.delimiter);if(He(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var a=Object.keys(i),s=[this];return s.push.apply(s,yt([],ze(It(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=rC(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof rr?t:rr.create(t),r=Array.from(xs([],this.getStateNodes(n.value)));return new rr(ne(ne({},n),{value:this.resolve(n.value),configuration:r,done:$l(r,this),tags:Gm(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var i=this.getStateNode(t),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},e.prototype.transitionCompoundNode=function(t,n,r){var i=Object.keys(t),o=this.getStateNode(i[0]),a=o._transition(t[i[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var i,o,a={};try{for(var s=Ve(Object.keys(t)),u=s.next();!u.done;u=s.next()){var l=u.value,c=t[l];if(c){var f=this.getStateNode(l),d=f._transition(c,n,r);d&&(a[l]=d)}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var h=Object.keys(a).map(function(C){return a[C]}),p=It(h.map(function(C){return C.transitions})),v=h.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,r);var g=It(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:p,exitSet:It(h.map(function(C){return C.exitSet})),configuration:g,source:n,actions:It(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,r){return He(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,fn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],l;try{for(var c=Ve(this.getCandidates(a)),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.cond,p=d.in,v=t.context,g=p?He(p)&&Wo(p)?t.matches(ks(this.getStateNodeById(p).path,this.delimiter)):Mh(ks(p,this.delimiter),z$(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!h||sC(this.machine,h,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
-
`).concat(x.message))}if(C&&g){d.target!==void 0&&(u=d.target),s.push.apply(s,yt([],ze(d.actions),!1)),l=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}if(l){if(!u.length)return{transitions:[l],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=It(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),b=!!l.internal;return{transitions:[l],exitSet:b?[]:It(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:m,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,i=t;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},e.prototype.getActions=function(t,n,r,i,o,a,s){var u,l,c,f,d=this,h=a?xs([],this.getStateNodes(a.value)):[],p=new Set;try{for(var v=Ve(Array.from(t).sort(function(_,L){return _.order-L.order})),g=v.next();!g.done;g=v.next()){var C=g.value;(!Ts(h,C)||Ts(r.exitSet,C)||C.parent&&p.has(C.parent))&&p.add(C)}}catch(_){u={error:_}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(u)throw u.error}}try{for(var m=Ve(h),b=m.next();!b.done;b=m.next()){var C=b.value;(!Ts(t,C)||Ts(r.exitSet,C.parent))&&r.exitSet.push(C)}}catch(_){c={error:_}}finally{try{b&&!b.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var x=Array.from(p).sort(function(_,L){return _.order-L.order}),T=new Set(r.exitSet),E=It(x.map(function(_){var L=[];if(_.type!=="final")return L;var U=_.parent;if(!U.parent)return L;L.push(Yu(_.id,_.doneData),Yu(U.id,_.doneData?Ql(_.doneData,i,o):void 0));var Y=U.parent;return Y.type==="parallel"&&Js(Y).every(function(k){return $l(r.configuration,k)})&&L.push(Yu(Y.id)),L})),A=x.map(function(_){var L=_.onEntry,U=_.activities.map(function(Y){return uO(Y)});return{type:"entry",actions:xi(s?yt(yt([],ze(L),!1),ze(U),!1):yt(yt([],ze(U),!1),ze(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:E.map(function(_){return nO(_)})}),N=Array.from(T).map(function(_){return{type:"exit",actions:xi(yt(yt([],ze(_.onExit),!1),ze(_.activities.map(function(L){return lO(L)})),!1),d.machine.options.actions)}}),I=N.concat({type:"transition",actions:xi(r.actions,this.machine.options.actions)}).concat(A);if(n){var P=xi(It(yt([],ze(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Gd(_)});return I.concat({type:"stop",actions:P})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=fn(n),a;if(t instanceof rr)a=r===void 0?t:this.resolveState(rr.from(t,r));else{var s=He(t)?this.resolve(Xl(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(rr.from(s,u))}if(!$t&&o.name===ps)throw new Error("An event cannot have the wildcard type ('".concat(ps,"')"));if(this.strict&&!this.events.includes(o.name)&&!H$(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},c=xs([],this.getStateNodes(a.value)),f=l.configuration.length?xs(c,l.configuration):c;return l.configuration=yt([],ze(f),!1),this.resolveTransition(l,a,a.context,i,o)},e.prototype.resolveRaisedTransition=function(t,n,r,i){var o,a=t.actions;return t=this.transition(t,n,void 0,i),t._event=r,t.event=r.data,(o=t.actions).unshift.apply(o,yt([],ze(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,l,c=this;o===void 0&&(o=ga);var f=t.configuration,d=!n||t.transitions.length>0,h=d?t.configuration:n?n.configuration:[],p=$l(h,this),v=d?SO(this.machine,f):void 0,g=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(h),p,t,r,o,n,i),m=n?ne({},n.activities):{};try{for(var b=Ve(C),x=b.next();!x.done;x=b.next()){var T=x.value;try{for(var E=(u=void 0,Ve(T.actions)),A=E.next();!A.done;A=E.next()){var N=A.value;N.type===Ld?m[N.activity.id||N.activity.type]=N:N.type===Rh&&(m[N.activity.id||N.activity.type]=!1)}}catch(X){u={error:X}}finally{try{A&&!A.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}}catch(X){a={error:X}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}var I=ze(Zl(this,n,r,o,C,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),P=I[0],_=I[1],L=ze(Y$(P,Gd),2),U=L[0],Y=L[1],k=P.filter(function(X){var ae;return X.type===Ld&&((ae=X.activity)===null||ae===void 0?void 0:ae.type)===Vd}),ie=k.reduce(function(X,ae){return X[ae.activity.id]=mO(ae.activity,c.machine,_,o),X},n?ne({},n.children):{}),B=new rr({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?g?J$(g,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?Y:[],activities:v?m:n?n.activities:{},events:[],configuration:h,transitions:t.transitions,children:ie,done:p,tags:Gm(h),machine:this}),G=r!==_;B.changed=o.name===tC||G;var fe=B.history;fe&&delete fe.history;var j=!p&&(this._transient||f.some(function(X){return X._transient}));if(!d&&(!j||o.name===ra))return B;var R=B;if(!p)for(j&&(R=this.resolveRaisedTransition(R,{type:q$},o,i));U.length;){var te=U.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||G||typeof fe.value!=typeof R.value||!pC(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Wo(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 n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=Wo(t)?t.slice(Kd.length):t;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&Wo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=Ud(t,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},e.prototype.resolve=function(t){var n,r=this;if(!t)return this.initialStateValue||zo;switch(this.type){case"parallel":return Cs(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):zo});case"compound":if(He(t)){var i=this.getStateNode(t);return i.type==="parallel"||i.type==="compound"?(n={},n[t]=i.initialStateValue,n):t}return Object.keys(t).length?Cs(t,function(o,a){return o?r.getStateNode(a).resolve(o):zo}):this.initialStateValue||{};default:return t||zo}},e.prototype.getResolvedPath=function(t){if(Wo(t)){var n=this.machine.idMap[t.slice(Kd.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return Ud(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Vm(this.states,function(r){return r.initialStateValue||zo},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=tc(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.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:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;He(n.target)?t=Wo(n.target)?Xl(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(tc(this))return[this];if(this.type==="compound"&&!this.initial)return $t||tn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=El(this.initialStateValue);return It(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=ze(t),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.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)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:Vm(this.states,function(n,r){if(!t)return n.historyValue();var i=He(t)?void 0:t[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var i=this.target;return i?It(El(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=W$(r.path,"states")(t).current;return He(o)?[r.getStateNode(o)]:It(El(o).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=It(Object.keys(this.states).map(function(r){return t.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=Ve(Object.keys(o)),u=s.next();!u.done;u=s.next()){var l=u.value,c=o[l];if(c.states)try{for(var f=(r=void 0,Ve(c.events)),d=f.next();!d.done;d=f.next()){var h=d.value;a.add("".concat(h))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(p){t={error:p}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!He(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
22
|
-
`).concat(s.message))}else return n.getStateNodeByPath(o)})},e.prototype.formatTransition=function(t){var n=this,r=
|
|
19
|
+
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var h=r._nextState(d);r.update(h,d)}),r._state},this.sendTo=function(c,f,d){var h=r.parent&&(f===To.Parent||r.parent.id===f),p=h?r.parent:He(f)?f===To.Internal?r:r.children.get(f)||ps.get(f):Z$(f)?f:void 0;if(!p){if(!h)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));$t||nn(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(c.type));return}if("machine"in p){if(r.status!==Dt.Stopped||r.parent!==p||r.state.done){var v=ne(ne({},c),{name:c.name===V$?"".concat(xs(r.id)):c.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([p,v]):p.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([p,c.data]):p.send(c.data)},this._exec=function(c,f,d,h){h===void 0&&(h=r.machine.options.actions);var p=c.exec||Hd(c.type,h),v=tt(p)?p:p?p.exec:c.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:c,_event:d}:{action:c,state:r.state,_event:d})}catch(Y){throw r.parent&&r.parent.send({type:"xstate.error",data:Y}),Y}switch(c.type){case Tu:{var g=c;r.defer(g);break}case Bc:var C=c;if(typeof C.delay=="number"){r.defer(C);return}else C.to?r.sendTo(C._event,C.to,d===ga):r.send(C._event);break;case eC:r.cancel(c.sendId);break;case Bd:{if(r.status!==Dt.Running)return;var m=c.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[m.id||m.type])break;if(m.type===ht.Invoke){var b=lC(m.src),x=r.machine.options.services?r.machine.options.services[b.type]:void 0,T=m.id,E=m.data;$t||nn(!("forward"in m),"`forward` property is deprecated (found in invocation of '".concat(m.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var A="autoForward"in m?m.autoForward:!!m.forward;if(!x){$t||nn(!1,"No service found for invocation '".concat(m.src,"' in machine '").concat(r.machine.id,"'."));return}var N=E?Zl(E,f,d):void 0;if(typeof x=="string")return;var I=tt(x)?x(f,d.data,{data:N,src:b,meta:m.meta}):x;if(!I)return;var P=void 0;ti(I)&&(I=N?I.withContext(N):I,P={autoForward:A}),r.spawn(I,T,P)}else r.spawnActivity(m);break}case Mh:{r.stopChild(c.activity.id);break}case tC:var _=c,L=_.label,U=_.value;L?r.logger(L,U):r.logger(U);break;default:$t||nn(!1,"No implementation found for action type '".concat(c.type,"'"));break}};var i=ne(ne({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,l=u!==void 0?u:t.id;this.id=l,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new Wm({deferEvents:this.options.deferEvents}),this.sessionId=ps.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:na(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return $t||nn(this.status!==Dt.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(t,n){var r,i;try{for(var o=Ve(t.actions),a=o.next();!a.done;a=o.next()){var s=a.value;this.exec(s,t,n)}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.update=function(t,n){var r,i,o,a,s,u,l,c,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===ga)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(I){f.state.children[I.id]=I}),this.devTools&&this.devTools.send(n.data,t),t.event)try{for(var h=Ve(this.eventListeners),p=h.next();!p.done;p=h.next()){var v=p.value;v(t.event)}}catch(I){r={error:I}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var g=Ve(this.listeners),C=g.next();!C.done;C=g.next()){var v=C.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{C&&!C.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var m=Ve(this.contextListeners),b=m.next();!b.done;b=m.next()){var x=b.value;x(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(this.state.done){var T=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),E=T&&T.doneData?Zl(T.doneData,t.context,n):void 0;this._doneEvent=$l(this.id,E);try{for(var A=Ve(this.doneListeners),N=A.next();!N.done;N=A.next()){var v=N.value;v(this._doneEvent)}}catch(I){l={error:I}}finally{try{N&&!N.done&&(c=A.return)&&c.call(A)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),ps.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Dt.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var i=this,o=Al(t,n,r);this.listeners.add(o.next),this.status!==Dt.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===Dt.Stopped?o.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(a),i.stopListeners.delete(a)}}},e.prototype.onEvent=function(t){return this.eventListeners.add(t),this},e.prototype.onSend=function(t){return this.sendListeners.add(t),this},e.prototype.onChange=function(t){return this.contextListeners.add(t),this},e.prototype.onStop=function(t){return this.stopListeners.add(t),this},e.prototype.onDone=function(t){return this.status===Dt.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},e.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},e.prototype.start=function(t){var n=this;if(this.status===Dt.Running)return this;this.machine._init(),ps.register(this.sessionId,this),this.initialized=!0,this.status=Dt.Running;var r=t===void 0?this.initialState:na(this,function(){return TO(t)?n.machine.resolveState(t):n.machine.resolveState(ir.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,ga)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){tt(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,l,c;try{for(var f=Ve(this.listeners),d=f.next();!d.done;d=f.next()){var h=d.value;this.listeners.delete(h)}}catch(A){t={error:A}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}try{for(var p=Ve(this.stopListeners),v=p.next();!v.done;v=p.next()){var h=v.value;h(),this.stopListeners.delete(h)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var g=Ve(this.contextListeners),C=g.next();!C.done;C=g.next()){var h=C.value;this.contextListeners.delete(h)}}catch(A){o={error:A}}finally{try{C&&!C.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var m=Ve(this.doneListeners),b=m.next();!b.done;b=m.next()){var h=b.value;this.doneListeners.delete(h)}}catch(A){s={error:A}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Dt.Stopped,this._initialState=void 0;try{for(var x=Ve(Object.keys(this.delayedEventsMap)),T=x.next();!T.done;T=x.next()){var E=T.value;this.clock.clearTimeout(this.delayedEventsMap[E])}}catch(A){l={error:A}}finally{try{T&&!T.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new Wm({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r;if(!(!((r=t._state)===null||r===void 0)&&r.done)){var i=fn({type:"xstate.stop"}),o=na(t,function(){var a=It(yt([],ze(t.state.configuration),!1).sort(function(f,d){return d.order-f.order}).map(function(f){return Ti(f.onExit,t.machine.options.actions)})),s=ze(ec(t.machine,t.state,t.state.context,i,[{type:"exit",actions:a}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),u=s[0],l=s[1],c=new ir({value:t.state.value,context:l,_event:i,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:u.filter(function(f){return!Wd(f)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return c.changed=!0,c});t.update(o,i),t._stopChildren(),ps.free(t.sessionId)}}),this},e.prototype.batch=function(t){var n=this;if(this.status===Dt.NotStarted&&this.options.deferEvents)$t||nn(!1,"".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,`" and are deferred. Make sure .start() is called for this service.
|
|
20
|
+
Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.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){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,a=n.state,s=!1,u=[],l=function(h){var p=fn(h);n.forward(p),a=na(n,function(){return n.machine.transition(a,p,void 0,r||void 0)}),u.push.apply(u,yt([],ze(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return EO(v,a)})),!1)),s=s||!!a.changed};try{for(var c=Ve(t),f=c.next();!f.done;f=c.next()){var d=f.value;l(d)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,fn(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=fn(t);if(i.name.indexOf(Lm)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Lm)===0}))throw i.data.data;var o=na(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var i=Ve(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(t)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,r=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=r)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(t,n.context,n._event,r)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),tt(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Dt.Running)return Fh(t,n);if(Um(t))return this.spawnPromise(Promise.resolve(t),n);if(tt(t))return this.spawnCallback(t,n);if(bO(t))return this.spawnActor(t,n);if(Q$(t))return this.spawnObservable(t,n);if(ti(t))return this.spawnMachine(t,ne(ne({},r),{id:n}));if(Y$(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var i=new e(t,ne(ne({},this.options),{parent:this,id:n.id||t.id})),o=ne(ne({},Yd),n);o.sync&&i.onTransition(function(s){r.send(nC,{state:s,id:i.id})});var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(s){r.removeChild(i.id),r.send(fn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=DO(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,i=this,o=!1,a;t.then(function(u){o||(a=u,i.removeChild(n),i.send(fn($l(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var l=xs(n,u);try{i.send(fn(l,{origin:n}))}catch(c){nO(u,c,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,l,c){var f=Al(u,l,c),d=!1;return t.then(function(h){d||(f.next(h),!d&&f.complete())},function(h){d||f.error(h)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[xi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,i=this,o=!1,a=new Set,s=new Set,u,l=function(d){u=d,s.forEach(function(h){return h(d)}),!o&&i.send(fn(d,{origin:n}))},c;try{c=t(l,function(d){a.add(d)})}catch(d){this.send(xs(n,d))}if(Um(c))return this.spawnPromise(c,n);var f=(r={id:n,send:function(d){return a.forEach(function(h){return h(d)})},subscribe:function(d){var h=Al(d);return s.add(h.next),{unsubscribe:function(){s.delete(h.next)}}},stop:function(){o=!0,tt(c)&&c()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[xi]=function(){return this},r);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var r,i=this,o,a=t.subscribe(function(u){o=u,i.send(fn(u,{origin:n}))},function(u){i.removeChild(n),i.send(fn(xs(n,u),{origin:n}))},function(){i.removeChild(n),i.send(fn($l(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,l,c){return t.subscribe(u,l,c)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[xi]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!n){$t||nn(!1,"No implementation found for activity '".concat(t.type,"'"));return}var r=n(this.state.context,t);this.spawnEffect(t.id,r)},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[xi]=function(){return this},r))},e.prototype.attachDev=function(){var t=Lh();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(ne(ne({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:ne({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}OO(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[xi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Dt.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=vC,e}(),PO=function(e){return He(e)?ne(ne({},Yd),{name:e}):ne(ne(ne({},Yd),{name:eO()}),e)};function Hm(e,t){var n=PO(t);return mO(function(r){if(!$t){var i=ti(e)||tt(e);nn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(ti(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):Fh(e,n.name)})}function vC(e,t){var n=new NO(e,t);return n}function RO(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function Xu(e){return ne(ne({type:Ud},e),{toJSON:function(){e.onDone,e.onError;var t=kh(e,["onDone","onError"]);return ne(ne({},t),{type:Ud,src:RO(e.src)})}})}var ra="",Jd="#",hs="*",zo={},Wo=function(e){return e[0]===Jd},kO=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},MO=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(He(o.target)||ti(o.target))}),i=t===ra?"the transient event":"event '".concat(t,"'");nn(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},jO=function(){function e(t,n,r,i){r===void 0&&(r="context"in t?t.context:void 0);var o=this,a;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(kO(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.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:rC),this.id=this.config.id||yt([this.machine.key],ze(this.path),!1).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:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,$t||nn(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?ws(this.config.states,function(l,c){var f,d=new e(l,{},void 0,{parent:o,key:c});return Object.assign(o.idMap,ne((f={},f[d.id]=d,f),d.idMap)),d}):zo;var s=0;function u(l){var c,f;l.order=s++;try{for(var d=Ve(fC(l)),h=d.next();!h.done;h=d.next()){var p=h.value;u(p)}}catch(v){c={error:v}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(l){var c=l.event;return c===ra}):ra in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=yr(this.config.entry||this.config.onEntry).map(function(l){return Js(l)}),this.onExit=yr(this.config.exit||this.config.onExit).map(function(l){return Js(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=yr(this.config.invoke).map(function(l,c){var f,d;if(ti(l)){var h=Yu(o.id,c);return o.machine.options.services=ne((f={},f[h]=l,f),o.machine.options.services),Xu({src:h,id:h})}else if(He(l.src)){var h=l.id||Yu(o.id,c);return Xu(ne(ne({},l),{id:h,src:l.src}))}else if(ti(l.src)||tt(l.src)){var h=l.id||Yu(o.id,c);return o.machine.options.services=ne((d={},d[h]=l.src,d),o.machine.options.services),Xu(ne(ne({id:h},l),{src:h}))}else{var p=l.src;return Xu(ne(ne({id:Yu(o.id,c)},l),{src:p}))}}),this.activities=yr(this.config.activities).concat(this.invoke).map(function(l){return qh(l)}),this.transition=this.transition.bind(this),this.tags=yr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||dC(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,o=r.activities,a=r.guards,s=r.services,u=r.delays;return new e(this.config,{actions:ne(ne({},i),t.actions),activities:ne(ne({},o),t.activities),guards:ne(ne({},a),t.guards),services:ne(ne({},s),t.services),delays:ne(ne({},u),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return tt(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.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:ws(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:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===ra,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===hs});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(o,a){var s=tt(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=pO(s,t.id);return t.onEntry.push(Gc(u,{delay:o})),t.onExit.push(uO(u)),u},i=qa(n)?n.map(function(o,a){var s=r(o.delay,a);return ne(ne({},o),{event:s})}):It(Object.keys(n).map(function(o,a){var s=n[o],u=He(s)?{target:s}:s,l=isNaN(+o)?o:+o,c=r(l,a);return yr(u).map(function(f){return ne(ne({},f),{event:c,delay:l})})}));return i.map(function(o){var a=o.delay;return ne(ne({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var i=t instanceof ir?t.value:Ms(t,this.delimiter);if(He(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var a=Object.keys(i),s=[this];return s.push.apply(s,yt([],ze(It(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=iC(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof ir?t:ir.create(t),r=Array.from(Ts([],this.getStateNodes(n.value)));return new ir(ne(ne({},n),{value:this.resolve(n.value),configuration:r,done:Ol(r,this),tags:zm(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var i=this.getStateNode(t),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},e.prototype.transitionCompoundNode=function(t,n,r){var i=Object.keys(t),o=this.getStateNode(i[0]),a=o._transition(t[i[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var i,o,a={};try{for(var s=Ve(Object.keys(t)),u=s.next();!u.done;u=s.next()){var l=u.value,c=t[l];if(c){var f=this.getStateNode(l),d=f._transition(c,n,r);d&&(a[l]=d)}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var h=Object.keys(a).map(function(C){return a[C]}),p=It(h.map(function(C){return C.transitions})),v=h.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,r);var g=It(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:p,exitSet:It(h.map(function(C){return C.exitSet})),configuration:g,source:n,actions:It(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,r){return He(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,fn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],l;try{for(var c=Ve(this.getCandidates(a)),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.cond,p=d.in,v=t.context,g=p?He(p)&&Wo(p)?t.matches(Ms(this.getStateNodeById(p).path,this.delimiter)):_h(Ms(p,this.delimiter),W$(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!h||uC(this.machine,h,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
+
`).concat(x.message))}if(C&&g){d.target!==void 0&&(u=d.target),s.push.apply(s,yt([],ze(d.actions),!1)),l=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}if(l){if(!u.length)return{transitions:[l],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=It(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),b=!!l.internal;return{transitions:[l],exitSet:b?[]:It(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:m,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,i=t;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},e.prototype.getActions=function(t,n,r,i,o,a,s){var u,l,c,f,d=this,h=a?Ts([],this.getStateNodes(a.value)):[],p=new Set;try{for(var v=Ve(Array.from(t).sort(function(_,L){return _.order-L.order})),g=v.next();!g.done;g=v.next()){var C=g.value;(!Es(h,C)||Es(r.exitSet,C)||C.parent&&p.has(C.parent))&&p.add(C)}}catch(_){u={error:_}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(u)throw u.error}}try{for(var m=Ve(h),b=m.next();!b.done;b=m.next()){var C=b.value;(!Es(t,C)||Es(r.exitSet,C.parent))&&r.exitSet.push(C)}}catch(_){c={error:_}}finally{try{b&&!b.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var x=Array.from(p).sort(function(_,L){return _.order-L.order}),T=new Set(r.exitSet),E=It(x.map(function(_){var L=[];if(_.type!=="final")return L;var U=_.parent;if(!U.parent)return L;L.push(Ju(_.id,_.doneData),Ju(U.id,_.doneData?Zl(_.doneData,i,o):void 0));var Y=U.parent;return Y.type==="parallel"&&Xs(Y).every(function(k){return Ol(r.configuration,k)})&&L.push(Ju(Y.id)),L})),A=x.map(function(_){var L=_.onEntry,U=_.activities.map(function(Y){return lO(Y)});return{type:"entry",actions:Ti(s?yt(yt([],ze(L),!1),ze(U),!1):yt(yt([],ze(U),!1),ze(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:E.map(function(_){return rO(_)})}),N=Array.from(T).map(function(_){return{type:"exit",actions:Ti(yt(yt([],ze(_.onExit),!1),ze(_.activities.map(function(L){return cO(L)})),!1),d.machine.options.actions)}}),I=N.concat({type:"transition",actions:Ti(r.actions,this.machine.options.actions)}).concat(A);if(n){var P=Ti(It(yt([],ze(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Wd(_)});return I.concat({type:"stop",actions:P})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=fn(n),a;if(t instanceof ir)a=r===void 0?t:this.resolveState(ir.from(t,r));else{var s=He(t)?this.resolve(Ql(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(ir.from(s,u))}if(!$t&&o.name===hs)throw new Error("An event cannot have the wildcard type ('".concat(hs,"')"));if(this.strict&&!this.events.includes(o.name)&&!K$(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},c=Ts([],this.getStateNodes(a.value)),f=l.configuration.length?Ts(c,l.configuration):c;return l.configuration=yt([],ze(f),!1),this.resolveTransition(l,a,a.context,i,o)},e.prototype.resolveRaisedTransition=function(t,n,r,i){var o,a=t.actions;return t=this.transition(t,n,void 0,i),t._event=r,t.event=r.data,(o=t.actions).unshift.apply(o,yt([],ze(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,l,c=this;o===void 0&&(o=ga);var f=t.configuration,d=!n||t.transitions.length>0,h=d?t.configuration:n?n.configuration:[],p=Ol(h,this),v=d?CO(this.machine,f):void 0,g=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(h),p,t,r,o,n,i),m=n?ne({},n.activities):{};try{for(var b=Ve(C),x=b.next();!x.done;x=b.next()){var T=x.value;try{for(var E=(u=void 0,Ve(T.actions)),A=E.next();!A.done;A=E.next()){var N=A.value;N.type===Bd?m[N.activity.id||N.activity.type]=N:N.type===Mh&&(m[N.activity.id||N.activity.type]=!1)}}catch(X){u={error:X}}finally{try{A&&!A.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}}catch(X){a={error:X}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}var I=ze(ec(this,n,r,o,C,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),P=I[0],_=I[1],L=ze(J$(P,Wd),2),U=L[0],Y=L[1],k=P.filter(function(X){var ae;return X.type===Bd&&((ae=X.activity)===null||ae===void 0?void 0:ae.type)===Ud}),ie=k.reduce(function(X,ae){return X[ae.activity.id]=yO(ae.activity,c.machine,_,o),X},n?ne({},n.children):{}),B=new ir({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?g?X$(g,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?Y:[],activities:v?m:n?n.activities:{},events:[],configuration:h,transitions:t.transitions,children:ie,done:p,tags:zm(h),machine:this}),G=r!==_;B.changed=o.name===nC||G;var fe=B.history;fe&&delete fe.history;var j=!p&&(this._transient||f.some(function(X){return X._transient}));if(!d&&(!j||o.name===ra))return B;var R=B;if(!p)for(j&&(R=this.resolveRaisedTransition(R,{type:F$},o,i));U.length;){var te=U.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||G||typeof fe.value!=typeof R.value||!hC(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Wo(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 n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=Wo(t)?t.slice(Jd.length):t;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&Wo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=zd(t,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},e.prototype.resolve=function(t){var n,r=this;if(!t)return this.initialStateValue||zo;switch(this.type){case"parallel":return ws(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):zo});case"compound":if(He(t)){var i=this.getStateNode(t);return i.type==="parallel"||i.type==="compound"?(n={},n[t]=i.initialStateValue,n):t}return Object.keys(t).length?ws(t,function(o,a){return o?r.getStateNode(a).resolve(o):zo}):this.initialStateValue||{};default:return t||zo}},e.prototype.getResolvedPath=function(t){if(Wo(t)){var n=this.machine.idMap[t.slice(Jd.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return zd(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Bm(this.states,function(r){return r.initialStateValue||zo},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=nc(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.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:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;He(n.target)?t=Wo(n.target)?Ql(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(nc(this))return[this];if(this.type==="compound"&&!this.initial)return $t||nn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=Il(this.initialStateValue);return It(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=ze(t),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.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)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:Bm(this.states,function(n,r){if(!t)return n.historyValue();var i=He(t)?void 0:t[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var i=this.target;return i?It(Il(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=H$(r.path,"states")(t).current;return He(o)?[r.getStateNode(o)]:It(Il(o).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=It(Object.keys(this.states).map(function(r){return t.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=Ve(Object.keys(o)),u=s.next();!u.done;u=s.next()){var l=u.value,c=o[l];if(c.states)try{for(var f=(r=void 0,Ve(c.events)),d=f.next();!d.done;d=f.next()){var h=d.value;a.add("".concat(h))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(p){t={error:p}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!He(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
22
|
+
`).concat(s.message))}else return n.getStateNodeByPath(o)})},e.prototype.formatTransition=function(t){var n=this,r=tO(t.target),i="internal"in t?t.internal:r?r.some(function(u){return He(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=ne(ne({},t),{actions:Ti(yr(t.actions)),cond:sC(t.cond,o),target:a,source:this,internal:i,eventType:t.event,toJSON:function(){return ne(ne({},s),{target:s.target?s.target.map(function(u){return"#".concat(u.id)}):void 0,source:"#".concat(n.id)})}});return s},e.prototype.formatTransitions=function(){var t,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,a=hs,s=o[a],u=s===void 0?[]:s,l=kh(o,[typeof a=="symbol"?a:a+""]);i=It(Object.keys(l).map(function(m){!$t&&m===ra&&nn(!1,"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 b=Go(m,l[m]);return $t||MO(r,m,b),b}).concat(Go(hs,u)))}var c=this.config.always?Go("",this.config.always):[],f=this.config.onDone?Go(String(Ju(this.id)),this.config.onDone):[];$t||nn(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=It(this.invoke.map(function(m){var b=[];return m.onDone&&b.push.apply(b,yt([],ze(Go(String($l(m.id)),m.onDone)),!1)),m.onError&&b.push.apply(b,yt([],ze(Go(String(xs(m.id)),m.onError)),!1)),b})),h=this.after,p=It(yt(yt(yt(yt([],ze(f),!1),ze(d),!1),ze(i),!1),ze(c),!1).map(function(m){return yr(m).map(function(b){return r.formatTransition(b)})}));try{for(var v=Ve(h),g=v.next();!g.done;g=v.next()){var C=g.value;p.push(C)}}catch(m){t={error:m}}finally{try{g&&!g.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return p},e}(),Km=!1;function Vh(e,t){return!$t&&!("predictableActionArguments"in e)&&!Km&&(Km=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new jO(e,t)}var Rn=dO,_O=Gc,mC=aO,Qu=hO,rt={},Bh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});/*! *****************************************************************************
|
|
23
23
|
Copyright (c) Microsoft Corporation.
|
|
24
24
|
|
|
25
25
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -32,7 +32,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.Running)throw
|
|
|
32
32
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
33
33
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
34
34
|
PERFORMANCE OF THIS SOFTWARE.
|
|
35
|
-
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,l=arguments.length;u<l;u++){s=arguments[u];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}return a},e.__assign.apply(this,arguments)};function t(o,a){var s={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(s[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,u=Object.getOwnPropertySymbols(o);l<u.length;l++)a.indexOf(u[l])<0&&Object.prototype.propertyIsEnumerable.call(o,u[l])&&(s[u[l]]=o[u[l]]);return s}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],u=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&u>=o.length&&(o=void 0),{value:o&&o[u++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var s=typeof Symbol=="function"&&o[Symbol.iterator];if(!s)return o;var u=s.call(o),l,c=[],f;try{for(;(a===void 0||a-- >0)&&!(l=u.next()).done;)c.push(l.value)}catch(d){f={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return c}function i(o,a,s){if(s||arguments.length===2)for(var u=0,l=a.length,c;u<l;u++)(c||!(u in a))&&(c||(c=Array.prototype.slice.call(a,0,u)),c[u]=a[u]);return o.concat(c||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Lh);var Gc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionTypes=void 0,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"}(e.ActionTypes||(e.ActionTypes={})),e.SpecialTargets=void 0,function(t){t.Parent="#_parent",t.Internal="#_internal"}(e.SpecialTargets||(e.SpecialTargets={}))})(Gc);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});var ln=Gc,_O=ln.ActionTypes.Start,qO=ln.ActionTypes.Stop,FO=ln.ActionTypes.Raise,LO=ln.ActionTypes.Send,VO=ln.ActionTypes.Cancel,BO=ln.ActionTypes.NullEvent,UO=ln.ActionTypes.Assign,GO=ln.ActionTypes.After,zO=ln.ActionTypes.DoneState,WO=ln.ActionTypes.Log,HO=ln.ActionTypes.Init,KO=ln.ActionTypes.Invoke,YO=ln.ActionTypes.ErrorExecution,JO=ln.ActionTypes.ErrorPlatform,XO=ln.ActionTypes.ErrorCustom,QO=ln.ActionTypes.Update,ZO=ln.ActionTypes.Choose,eD=ln.ActionTypes.Pure;Bt.after=GO;Bt.assign=UO;Bt.cancel=VO;Bt.choose=ZO;Bt.doneState=zO;Bt.error=XO;Bt.errorExecution=YO;Bt.errorPlatform=JO;Bt.init=HO;Bt.invoke=KO;Bt.log=WO;Bt.nullEvent=BO;Bt.pure=eD;Bt.raise=FO;Bt.send=LO;Bt.start=_O;Bt.stop=qO;Bt.update=QO;var mC={},Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});var tD=".",nD={},rD="xstate.guard",iD="";Fa.DEFAULT_GUARD_TYPE=rD;Fa.EMPTY_ACTIVITY_MAP=nD;Fa.STATE_DELIMITER=tD;Fa.TARGETLESS_KEY=iD;var zc={};Object.defineProperty(zc,"__esModule",{value:!0});var oD=process.env.NODE_ENV==="production";zc.IS_PRODUCTION=oD;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Lh,n=Gc,r=Bt,i=Fa,o=zc,a;function s(S){return Object.keys(S)}function u(S,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=h(S,F),Q=h(M,F);return G(Q)?G(q)?Q===q:!1:G(q)?q in Q:Object.keys(q).every(function(Z){return Z in Q?u(q[Z],Q[Z]):!1})}function l(S){try{return G(S)||typeof S=="number"?"".concat(S):S.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function c(S){try{return G(S)||typeof S=="number"?"".concat(S):B(S)?S.name:S.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(S,M){try{return ie(S)?S:S.toString().split(M)}catch{throw new Error("'".concat(S,"' is not a valid state path."))}}function d(S){return typeof S=="object"&&"value"in S&&"context"in S&&"event"in S&&"_event"in S}function h(S,M){if(d(S))return S.value;if(ie(S))return p(S);if(typeof S!="string")return S;var F=f(S,M);return p(F)}function p(S){if(S.length===1)return S[0];for(var M={},F=M,q=0;q<S.length-1;q++)q===S.length-2?F[S[q]]=S[q+1]:(F[S[q]]={},F=F[S[q]]);return M}function v(S,M){for(var F={},q=Object.keys(S),Q=0;Q<q.length;Q++){var Z=q[Q];F[Z]=M(S[Z],Z,S,Q)}return F}function g(S,M,F){var q,Q,Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];F($e)&&(Z[be]=M($e,be,S))}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}var C=function(S){return function(M){var F,q,Q=M;try{for(var Z=t.__values(S),ce=Z.next();!ce.done;ce=Z.next()){var se=ce.value;Q=Q[se]}}catch(be){F={error:be}}finally{try{ce&&!ce.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return Q}};function m(S,M){return function(F){var q,Q,Z=F;try{for(var ce=t.__values(S),se=ce.next();!se.done;se=ce.next()){var be=se.value;Z=Z[M][be]}}catch($e){q={error:$e}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}}function b(S){if(!S)return[[]];if(G(S))return[[S]];var M=T(Object.keys(S).map(function(F){var q=S[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:b(S[F]).map(function(Q){return[F].concat(Q)})}));return M}function x(S){var M,F,q={};if(S&&S.length===1&&S[0].length===1)return S[0][0];try{for(var Q=t.__values(S),Z=Q.next();!Z.done;Z=Q.next())for(var ce=Z.value,se=q,be=0;be<ce.length;be++){var $e=ce[be];if(be===ce.length-2){se[$e]=ce[be+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(qt){M={error:qt}}finally{try{Z&&!Z.done&&(F=Q.return)&&F.call(Q)}finally{if(M)throw M.error}}return q}function T(S){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(S),!1))}function E(S){return ie(S)?S:[S]}function A(S){return S===void 0?[]:E(S)}function N(S,M,F){var q,Q;if(B(S))return S(M,F.data);var Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];B($e)?Z[be]=$e(M,F.data):Z[be]=$e}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}function I(S){return/^(done|error)\./.test(S)}function P(S){return!!(S instanceof Promise||S!==null&&(B(S)||typeof S=="object")&&B(S.then))}function _(S){return S!==null&&typeof S=="object"&&"transition"in S&&typeof S.transition=="function"}function L(S,M){var F,q,Q=t.__read([[],[]],2),Z=Q[0],ce=Q[1];try{for(var se=t.__values(S),be=se.next();!be.done;be=se.next()){var $e=be.value;M($e)?Z.push($e):ce.push($e)}}catch(qt){F={error:qt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,ce]}function U(S,M){return v(S.states,function(F,q){if(F){var Q=(G(M)?void 0:M[q])||(F?F.current:void 0);if(Q)return{current:Q,states:U(F,Q)}}})}function Y(S,M){return{current:M,states:U(S,M)}}function k(S,M,F,q){o.IS_PRODUCTION||e.warn(!!S,"Attempting to update undefined context");var Q=S&&F.reduce(function(Z,ce){var se,be,$e=ce.assignment,qt={state:q,action:ce,_event:M},Qi={};if(B($e))Qi=$e(Z,M.data,qt);else try{for(var qr=t.__values(Object.keys($e)),hr=qr.next();!hr.done;hr=qr.next()){var ls=hr.value,Zi=$e[ls];Qi[ls]=B(Zi)?Zi(Z,M.data,qt):Zi}}catch(jf){se={error:jf}}finally{try{hr&&!hr.done&&(be=qr.return)&&be.call(qr)}finally{if(se)throw se.error}}return Object.assign({},Z,Qi)},S);return Q}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(S,M){var F=S instanceof Error?S:void 0;if(!(!F&&S)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(S){return Array.isArray(S)}function B(S){return typeof S=="function"}function G(S){return typeof S=="string"}function fe(S,M){if(S)return G(S)?{type:i.DEFAULT_GUARD_TYPE,name:S,predicate:M?M[S]:void 0}:B(S)?{type:i.DEFAULT_GUARD_TYPE,name:S.name,predicate:S}:S}function j(S){try{return"subscribe"in S&&B(S.subscribe)}catch{return!1}}var R=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[R]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(S){return!!S&&"__xstatenode"in S}function X(S){return!!S&&typeof S.send=="function"}var ae=function(){var S=0;return function(){return S++,S.toString(16)}}();function de(S,M){return G(S)||typeof S=="number"?t.__assign({type:S},M):S}function he(S,M){if(!G(S)&&"$$type"in S&&S.$$type==="scxml")return S;var F=de(S);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function Te(S,M){var F=E(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:S}:t.__assign(t.__assign({},q),{event:S})});return F}function ke(S){if(!(S===void 0||S===i.TARGETLESS_KEY))return A(S)}function Ne(S,M,F){if(!o.IS_PRODUCTION){var q=S.stack?" Stacktrace was '".concat(S.stack,"'"):"";if(S===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(S,"'.").concat(q));else{var Q=M.stack?" Stacktrace was '".concat(M.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(S,"'. ").concat(q," Current error is '").concat(M,"'.").concat(Q))}}}function mt(S,M,F,q,Q){var Z=S.options.guards,ce={state:Q,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,ce);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(S.id,"'."));return se(F,q.data,ce)}function le(S){return typeof S=="string"?{type:S}:S}function Pn(S,M,F){var q=function(){},Q=typeof S=="object",Z=Q?S:null;return{next:((Q?S.next:S)||q).bind(Z),error:((Q?S.error:M)||q).bind(Z),complete:((Q?S.complete:F)||q).bind(Z)}}function pi(S,M){return"".concat(S,":invocation[").concat(M,"]")}function Bo(S){return(S.type===r.raise||S.type===r.send&&S.to===n.SpecialTargets.Internal)&&typeof S.delay!="number"}e.createInvokeId=pi,e.evaluateGuard=mt,e.flatten=T,e.getActionType=c,e.getEventType=l,e.interopSymbols=te,e.isActor=X,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=P,e.isRaisableAction=Bo,e.isStateLike=d,e.isString=G,e.keys=s,e.mapContext=N,e.mapFilterValues=g,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=ke,e.partition=L,e.path=C,e.pathToStateValue=p,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=Ne,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=E,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=le,e.toObserver=Pn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=b,e.toStateValue=h,e.toTransitionConfigArray=Te,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=U,e.updateHistoryValue=Y})(mC);Object.defineProperty(rt,"__esModule",{value:!0});var Je=Lh,dr=Gc,on=Bt,Fe=mC,yC=zc,aD=Fe.toSCXMLEvent({type:on.init});function Yd(e,t){return t&&t[e]||void 0}function Wc(e,t){var n;if(Fe.isString(e)||typeof e=="number"){var r=Yd(e,t);Fe.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Fe.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Yd(e.type,t);if(Fe.isFunction(r))n=Je.__assign(Je.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Je.__assign(Je.__assign(Je.__assign({},r),e),{type:i})}else n=e}return n}var Jd=function(e,t){if(!e)return[];var n=Fe.isArray(e)?e:[e];return n.map(function(r){return Wc(r,t)})};function Vh(e){var t=Wc(e);return Je.__assign(Je.__assign({id:Fe.isString(e)?e:t.id},t),{type:t.type})}function sD(e,t){return{type:on.raise,event:typeof e=="function"?e:Fe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function gC(e,t,n,r){var i={_event:n},o=Fe.toSCXMLEvent(Fe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Fe.isString(e.delay)){var s=r&&r[e.delay];a=Fe.isFunction(s)?s(t,n.data,i):s}else a=Fe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return Je.__assign(Je.__assign({},e),{type:on.raise,_event:o,delay:a})}function Tu(e,t){return{to:t?t.to:void 0,type:on.send,event:Fe.isFunction(e)?e:Fe.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Fe.isFunction(e)?e.name:Fe.getEventType(e)}}function bC(e,t,n,r){var i={_event:n},o=Fe.toSCXMLEvent(Fe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Fe.isString(e.delay)){var s=r&&r[e.delay];a=Fe.isFunction(s)?s(t,n.data,i):s}else a=Fe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=Fe.isFunction(e.to)?e.to(t,n.data,i):e.to;return Je.__assign(Je.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Bh(e,t){return Tu(e,Je.__assign(Je.__assign({},t),{to:dr.SpecialTargets.Parent}))}function uD(e,t,n){return Tu(t,Je.__assign(Je.__assign({},n),{to:e}))}function lD(){return Bh(on.update)}function cD(e,t){return Tu(e,Je.__assign(Je.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var fD=function(e,t){return{context:e,event:t}};function dD(e,t){return e===void 0&&(e=fD),{type:on.log,label:t,expr:e}}var SC=function(e,t,n){return Je.__assign(Je.__assign({},e),{value:Fe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},pD=function(e){return{type:on.cancel,sendId:e}};function hD(e){var t=Vh(e);return{type:dr.ActionTypes.Start,activity:t,exec:void 0}}function vD(e){var t=Fe.isFunction(e)?e:Vh(e);return{type:dr.ActionTypes.Stop,activity:t,exec:void 0}}function CC(e,t,n){var r=Fe.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:dr.ActionTypes.Stop,activity:i};return o}var mD=function(e){return{type:on.assign,assignment:e}};function yD(e){return typeof e=="object"&&"type"in e}function gD(e,t){var n=t?"#".concat(t):"";return"".concat(dr.ActionTypes.After,"(").concat(e,")").concat(n)}function bD(e,t){var n="".concat(dr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function SD(e,t){var n="".concat(dr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function CD(e,t){var n="".concat(dr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function wD(e){return{type:dr.ActionTypes.Pure,get:e}}function xD(e,t){if(!yC.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,Je.__spreadArray([],Je.__read(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Tu(function(r,i){return i},Je.__assign(Je.__assign({},t),{to:e}))}function TD(e,t){return Bh(function(n,r,i){return{type:on.error,data:Fe.isFunction(e)?e(n,r,i):e}},Je.__assign(Je.__assign({},t),{to:dr.SpecialTargets.Parent}))}function ED(e){return{type:dr.ActionTypes.Choose,conds:e}}var ID=function(e){var t,n,r=[];try{for(var i=Je.__values(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===on.assign){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Xd(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:ID(i),u=s.length?Fe.updateContext(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case on.raise:{var C=gC(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case on.send:var m=bC(v,u,r,e.options.delays);if(!yC.IS_PRODUCTION){var b=v.delay;Fe.warn(!Fe.isString(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==dr.SpecialTargets.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case on.log:{var x=SC(v,u,r);return o==null||o(x,u,r),x}case on.choose:{var T=v,E=(g=T.conds.find(function(B){var G=Fe.toGuard(B.cond,e.options.guards);return!G||Fe.evaluateGuard(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=Je.__read(Xd(e,t,u,r,[{type:p,actions:Jd(Fe.toArray(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case on.pure:{var E=v.get(u,r.data);if(!E)return[];var P=Je.__read(Xd(e,t,u,r,[{type:p,actions:Jd(Fe.toArray(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case on.stop:{var x=CC(v,u,r);return o==null||o(x,n,r),x}case on.assign:{u=Fe.updateContext(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=Wc(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=Je.__assign(Je.__assign({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,Je.__spreadArray([l[k]],Je.__read(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Je.__values(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=Fe.flatten(i.map(d));return[h,u]}rt.actionTypes=on;rt.after=gD;rt.assign=mD;rt.cancel=pD;rt.choose=ED;rt.done=bD;rt.doneInvoke=SD;rt.error=CD;rt.escalate=TD;rt.forwardTo=xD;rt.getActionFunction=Yd;rt.initEvent=aD;rt.isActionObject=yD;var zn=rt.log=dD,AD=rt.pure=wD;rt.raise=sD;rt.resolveActions=Xd;rt.resolveLog=SC;rt.resolveRaise=gC;rt.resolveSend=bC;rt.resolveStop=CC;rt.respond=cD;rt.send=Tu;rt.sendParent=Bh;rt.sendTo=uD;rt.sendUpdate=lD;rt.start=hD;var Km=rt.stop=vD;rt.toActionObject=Wc;rt.toActionObjects=Jd;rt.toActivityDefinition=Vh;function wC(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Hc(e){return function(n,r,i,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i,o);var a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i,o);return o.delete(n),o.delete(r),u}}function xC(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function Ym(e){return e.constructor===Object||e.constructor==null}function Jm(e){return typeof e.then=="function"}function Kc(e,t){return e===t||e!==e&&t!==t}var $D="[object Arguments]",OD="[object Boolean]",DD="[object Date]",ND="[object RegExp]",PD="[object Map]",RD="[object Number]",kD="[object Object]",MD="[object Set]",jD="[object String]",Xm=Object.prototype.toString;function Yc(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,s=e.createIsNestedEqual,u=s(l);function l(c,f,d){if(c===f)return!0;if(!c||!f||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;if(Ym(c)&&Ym(f))return i(c,f,u,d);var h=Array.isArray(c),p=Array.isArray(f);if(h||p)return h===p&&t(c,f,u,d);var v=Xm.call(c);return v!==Xm.call(f)?!1:v===DD?n(c,f,u,d):v===ND?o(c,f,u,d):v===PD?r(c,f,u,d):v===MD?a(c,f,u,d):v===kD||v===$D?Jm(c)||Jm(f)?!1:i(c,f,u,d):v===OD||v===RD||v===jD?Kc(c.valueOf(),f.valueOf()):!1}return l}function TC(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var _D=Hc(TC);function EC(e,t){return Kc(e.valueOf(),t.valueOf())}function IC(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(s,u){if(i){var l=!1,c=0;t.forEach(function(f,d){!l&&!o[c]&&(l=n(u,d,a,c,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[c]=!0),c++}),a++,i=l}}),i}var qD=Hc(IC),FD="_owner",LD=Object.prototype.hasOwnProperty;function AC(e,t,n,r){var i=Object.keys(e),o=i.length;if(Object.keys(t).length!==o)return!1;for(var a;o-- >0;){if(a=i[o],a===FD){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!LD.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var VD=Hc(AC);function $C(e,t){return e.source===t.source&&e.flags===t.flags}function OC(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,s){if(i){var u=!1,l=0;t.forEach(function(c,f){!u&&!o[l]&&(u=n(a,c,s,f,e,t,r))&&(o[l]=!0),l++}),i=u}}),i}var BD=Hc(OC),DC=Object.freeze({areArraysEqual:TC,areDatesEqual:EC,areMapsEqual:IC,areObjectsEqual:AC,areRegExpsEqual:$C,areSetsEqual:OC,createIsNestedEqual:wC}),NC=Object.freeze({areArraysEqual:_D,areDatesEqual:EC,areMapsEqual:qD,areObjectsEqual:VD,areRegExpsEqual:$C,areSetsEqual:BD,createIsNestedEqual:wC}),UD=Yc(DC);function GD(e,t){return UD(e,t,void 0)}Yc(xC(DC,{createIsNestedEqual:function(){return Kc}}));Yc(NC);Yc(xC(NC,{createIsNestedEqual:function(){return Kc}}));var Qd={exports:{}},qf={},Qu={exports:{}},Ff={};/**
|
|
35
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,l=arguments.length;u<l;u++){s=arguments[u];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}return a},e.__assign.apply(this,arguments)};function t(o,a){var s={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(s[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,u=Object.getOwnPropertySymbols(o);l<u.length;l++)a.indexOf(u[l])<0&&Object.prototype.propertyIsEnumerable.call(o,u[l])&&(s[u[l]]=o[u[l]]);return s}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],u=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&u>=o.length&&(o=void 0),{value:o&&o[u++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var s=typeof Symbol=="function"&&o[Symbol.iterator];if(!s)return o;var u=s.call(o),l,c=[],f;try{for(;(a===void 0||a-- >0)&&!(l=u.next()).done;)c.push(l.value)}catch(d){f={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return c}function i(o,a,s){if(s||arguments.length===2)for(var u=0,l=a.length,c;u<l;u++)(c||!(u in a))&&(c||(c=Array.prototype.slice.call(a,0,u)),c[u]=a[u]);return o.concat(c||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Bh);var zc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionTypes=void 0,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"}(e.ActionTypes||(e.ActionTypes={})),e.SpecialTargets=void 0,function(t){t.Parent="#_parent",t.Internal="#_internal"}(e.SpecialTargets||(e.SpecialTargets={}))})(zc);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});var ln=zc,qO=ln.ActionTypes.Start,FO=ln.ActionTypes.Stop,LO=ln.ActionTypes.Raise,VO=ln.ActionTypes.Send,BO=ln.ActionTypes.Cancel,UO=ln.ActionTypes.NullEvent,GO=ln.ActionTypes.Assign,zO=ln.ActionTypes.After,WO=ln.ActionTypes.DoneState,HO=ln.ActionTypes.Log,KO=ln.ActionTypes.Init,YO=ln.ActionTypes.Invoke,JO=ln.ActionTypes.ErrorExecution,XO=ln.ActionTypes.ErrorPlatform,QO=ln.ActionTypes.ErrorCustom,ZO=ln.ActionTypes.Update,eD=ln.ActionTypes.Choose,tD=ln.ActionTypes.Pure;Bt.after=zO;Bt.assign=GO;Bt.cancel=BO;Bt.choose=eD;Bt.doneState=WO;Bt.error=QO;Bt.errorExecution=JO;Bt.errorPlatform=XO;Bt.init=KO;Bt.invoke=YO;Bt.log=HO;Bt.nullEvent=UO;Bt.pure=tD;Bt.raise=LO;Bt.send=VO;Bt.start=qO;Bt.stop=FO;Bt.update=ZO;var yC={},Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});var nD=".",rD={},iD="xstate.guard",oD="";Fa.DEFAULT_GUARD_TYPE=iD;Fa.EMPTY_ACTIVITY_MAP=rD;Fa.STATE_DELIMITER=nD;Fa.TARGETLESS_KEY=oD;var Wc={};Object.defineProperty(Wc,"__esModule",{value:!0});var aD=process.env.NODE_ENV==="production";Wc.IS_PRODUCTION=aD;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Bh,n=zc,r=Bt,i=Fa,o=Wc,a;function s(S){return Object.keys(S)}function u(S,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=h(S,F),Q=h(M,F);return G(Q)?G(q)?Q===q:!1:G(q)?q in Q:Object.keys(q).every(function(Z){return Z in Q?u(q[Z],Q[Z]):!1})}function l(S){try{return G(S)||typeof S=="number"?"".concat(S):S.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function c(S){try{return G(S)||typeof S=="number"?"".concat(S):B(S)?S.name:S.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(S,M){try{return ie(S)?S:S.toString().split(M)}catch{throw new Error("'".concat(S,"' is not a valid state path."))}}function d(S){return typeof S=="object"&&"value"in S&&"context"in S&&"event"in S&&"_event"in S}function h(S,M){if(d(S))return S.value;if(ie(S))return p(S);if(typeof S!="string")return S;var F=f(S,M);return p(F)}function p(S){if(S.length===1)return S[0];for(var M={},F=M,q=0;q<S.length-1;q++)q===S.length-2?F[S[q]]=S[q+1]:(F[S[q]]={},F=F[S[q]]);return M}function v(S,M){for(var F={},q=Object.keys(S),Q=0;Q<q.length;Q++){var Z=q[Q];F[Z]=M(S[Z],Z,S,Q)}return F}function g(S,M,F){var q,Q,Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];F($e)&&(Z[be]=M($e,be,S))}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}var C=function(S){return function(M){var F,q,Q=M;try{for(var Z=t.__values(S),ce=Z.next();!ce.done;ce=Z.next()){var se=ce.value;Q=Q[se]}}catch(be){F={error:be}}finally{try{ce&&!ce.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return Q}};function m(S,M){return function(F){var q,Q,Z=F;try{for(var ce=t.__values(S),se=ce.next();!se.done;se=ce.next()){var be=se.value;Z=Z[M][be]}}catch($e){q={error:$e}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}}function b(S){if(!S)return[[]];if(G(S))return[[S]];var M=T(Object.keys(S).map(function(F){var q=S[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:b(S[F]).map(function(Q){return[F].concat(Q)})}));return M}function x(S){var M,F,q={};if(S&&S.length===1&&S[0].length===1)return S[0][0];try{for(var Q=t.__values(S),Z=Q.next();!Z.done;Z=Q.next())for(var ce=Z.value,se=q,be=0;be<ce.length;be++){var $e=ce[be];if(be===ce.length-2){se[$e]=ce[be+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(qt){M={error:qt}}finally{try{Z&&!Z.done&&(F=Q.return)&&F.call(Q)}finally{if(M)throw M.error}}return q}function T(S){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(S),!1))}function E(S){return ie(S)?S:[S]}function A(S){return S===void 0?[]:E(S)}function N(S,M,F){var q,Q;if(B(S))return S(M,F.data);var Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];B($e)?Z[be]=$e(M,F.data):Z[be]=$e}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}function I(S){return/^(done|error)\./.test(S)}function P(S){return!!(S instanceof Promise||S!==null&&(B(S)||typeof S=="object")&&B(S.then))}function _(S){return S!==null&&typeof S=="object"&&"transition"in S&&typeof S.transition=="function"}function L(S,M){var F,q,Q=t.__read([[],[]],2),Z=Q[0],ce=Q[1];try{for(var se=t.__values(S),be=se.next();!be.done;be=se.next()){var $e=be.value;M($e)?Z.push($e):ce.push($e)}}catch(qt){F={error:qt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,ce]}function U(S,M){return v(S.states,function(F,q){if(F){var Q=(G(M)?void 0:M[q])||(F?F.current:void 0);if(Q)return{current:Q,states:U(F,Q)}}})}function Y(S,M){return{current:M,states:U(S,M)}}function k(S,M,F,q){o.IS_PRODUCTION||e.warn(!!S,"Attempting to update undefined context");var Q=S&&F.reduce(function(Z,ce){var se,be,$e=ce.assignment,qt={state:q,action:ce,_event:M},Qi={};if(B($e))Qi=$e(Z,M.data,qt);else try{for(var Vr=t.__values(Object.keys($e)),mr=Vr.next();!mr.done;mr=Vr.next()){var cs=mr.value,Zi=$e[cs];Qi[cs]=B(Zi)?Zi(Z,M.data,qt):Zi}}catch(qf){se={error:qf}}finally{try{mr&&!mr.done&&(be=Vr.return)&&be.call(Vr)}finally{if(se)throw se.error}}return Object.assign({},Z,Qi)},S);return Q}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(S,M){var F=S instanceof Error?S:void 0;if(!(!F&&S)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(S){return Array.isArray(S)}function B(S){return typeof S=="function"}function G(S){return typeof S=="string"}function fe(S,M){if(S)return G(S)?{type:i.DEFAULT_GUARD_TYPE,name:S,predicate:M?M[S]:void 0}:B(S)?{type:i.DEFAULT_GUARD_TYPE,name:S.name,predicate:S}:S}function j(S){try{return"subscribe"in S&&B(S.subscribe)}catch{return!1}}var R=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[R]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(S){return!!S&&"__xstatenode"in S}function X(S){return!!S&&typeof S.send=="function"}var ae=function(){var S=0;return function(){return S++,S.toString(16)}}();function de(S,M){return G(S)||typeof S=="number"?t.__assign({type:S},M):S}function he(S,M){if(!G(S)&&"$$type"in S&&S.$$type==="scxml")return S;var F=de(S);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function Te(S,M){var F=E(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:S}:t.__assign(t.__assign({},q),{event:S})});return F}function ke(S){if(!(S===void 0||S===i.TARGETLESS_KEY))return A(S)}function Ne(S,M,F){if(!o.IS_PRODUCTION){var q=S.stack?" Stacktrace was '".concat(S.stack,"'"):"";if(S===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(S,"'.").concat(q));else{var Q=M.stack?" Stacktrace was '".concat(M.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(S,"'. ").concat(q," Current error is '").concat(M,"'.").concat(Q))}}}function mt(S,M,F,q,Q){var Z=S.options.guards,ce={state:Q,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,ce);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(S.id,"'."));return se(F,q.data,ce)}function le(S){return typeof S=="string"?{type:S}:S}function Pn(S,M,F){var q=function(){},Q=typeof S=="object",Z=Q?S:null;return{next:((Q?S.next:S)||q).bind(Z),error:((Q?S.error:M)||q).bind(Z),complete:((Q?S.complete:F)||q).bind(Z)}}function hi(S,M){return"".concat(S,":invocation[").concat(M,"]")}function Bo(S){return(S.type===r.raise||S.type===r.send&&S.to===n.SpecialTargets.Internal)&&typeof S.delay!="number"}e.createInvokeId=hi,e.evaluateGuard=mt,e.flatten=T,e.getActionType=c,e.getEventType=l,e.interopSymbols=te,e.isActor=X,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=P,e.isRaisableAction=Bo,e.isStateLike=d,e.isString=G,e.keys=s,e.mapContext=N,e.mapFilterValues=g,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=ke,e.partition=L,e.path=C,e.pathToStateValue=p,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=Ne,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=E,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=le,e.toObserver=Pn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=b,e.toStateValue=h,e.toTransitionConfigArray=Te,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=U,e.updateHistoryValue=Y})(yC);Object.defineProperty(rt,"__esModule",{value:!0});var Je=Bh,dr=zc,an=Bt,Fe=yC,gC=Wc,sD=Fe.toSCXMLEvent({type:an.init});function Xd(e,t){return t&&t[e]||void 0}function Hc(e,t){var n;if(Fe.isString(e)||typeof e=="number"){var r=Xd(e,t);Fe.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Fe.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Xd(e.type,t);if(Fe.isFunction(r))n=Je.__assign(Je.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Je.__assign(Je.__assign(Je.__assign({},r),e),{type:i})}else n=e}return n}var Qd=function(e,t){if(!e)return[];var n=Fe.isArray(e)?e:[e];return n.map(function(r){return Hc(r,t)})};function Uh(e){var t=Hc(e);return Je.__assign(Je.__assign({id:Fe.isString(e)?e:t.id},t),{type:t.type})}function uD(e,t){return{type:an.raise,event:typeof e=="function"?e:Fe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function bC(e,t,n,r){var i={_event:n},o=Fe.toSCXMLEvent(Fe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Fe.isString(e.delay)){var s=r&&r[e.delay];a=Fe.isFunction(s)?s(t,n.data,i):s}else a=Fe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return Je.__assign(Je.__assign({},e),{type:an.raise,_event:o,delay:a})}function Eu(e,t){return{to:t?t.to:void 0,type:an.send,event:Fe.isFunction(e)?e:Fe.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Fe.isFunction(e)?e.name:Fe.getEventType(e)}}function SC(e,t,n,r){var i={_event:n},o=Fe.toSCXMLEvent(Fe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Fe.isString(e.delay)){var s=r&&r[e.delay];a=Fe.isFunction(s)?s(t,n.data,i):s}else a=Fe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=Fe.isFunction(e.to)?e.to(t,n.data,i):e.to;return Je.__assign(Je.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Gh(e,t){return Eu(e,Je.__assign(Je.__assign({},t),{to:dr.SpecialTargets.Parent}))}function lD(e,t,n){return Eu(t,Je.__assign(Je.__assign({},n),{to:e}))}function cD(){return Gh(an.update)}function fD(e,t){return Eu(e,Je.__assign(Je.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var dD=function(e,t){return{context:e,event:t}};function pD(e,t){return e===void 0&&(e=dD),{type:an.log,label:t,expr:e}}var CC=function(e,t,n){return Je.__assign(Je.__assign({},e),{value:Fe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},hD=function(e){return{type:an.cancel,sendId:e}};function vD(e){var t=Uh(e);return{type:dr.ActionTypes.Start,activity:t,exec:void 0}}function mD(e){var t=Fe.isFunction(e)?e:Uh(e);return{type:dr.ActionTypes.Stop,activity:t,exec:void 0}}function wC(e,t,n){var r=Fe.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:dr.ActionTypes.Stop,activity:i};return o}var yD=function(e){return{type:an.assign,assignment:e}};function gD(e){return typeof e=="object"&&"type"in e}function bD(e,t){var n=t?"#".concat(t):"";return"".concat(dr.ActionTypes.After,"(").concat(e,")").concat(n)}function SD(e,t){var n="".concat(dr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function CD(e,t){var n="".concat(dr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function wD(e,t){var n="".concat(dr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function xD(e){return{type:dr.ActionTypes.Pure,get:e}}function TD(e,t){if(!gC.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,Je.__spreadArray([],Je.__read(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Eu(function(r,i){return i},Je.__assign(Je.__assign({},t),{to:e}))}function ED(e,t){return Gh(function(n,r,i){return{type:an.error,data:Fe.isFunction(e)?e(n,r,i):e}},Je.__assign(Je.__assign({},t),{to:dr.SpecialTargets.Parent}))}function ID(e){return{type:dr.ActionTypes.Choose,conds:e}}var AD=function(e){var t,n,r=[];try{for(var i=Je.__values(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===an.assign){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Zd(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:AD(i),u=s.length?Fe.updateContext(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case an.raise:{var C=bC(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case an.send:var m=SC(v,u,r,e.options.delays);if(!gC.IS_PRODUCTION){var b=v.delay;Fe.warn(!Fe.isString(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==dr.SpecialTargets.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case an.log:{var x=CC(v,u,r);return o==null||o(x,u,r),x}case an.choose:{var T=v,E=(g=T.conds.find(function(B){var G=Fe.toGuard(B.cond,e.options.guards);return!G||Fe.evaluateGuard(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=Je.__read(Zd(e,t,u,r,[{type:p,actions:Qd(Fe.toArray(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case an.pure:{var E=v.get(u,r.data);if(!E)return[];var P=Je.__read(Zd(e,t,u,r,[{type:p,actions:Qd(Fe.toArray(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case an.stop:{var x=wC(v,u,r);return o==null||o(x,n,r),x}case an.assign:{u=Fe.updateContext(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=Hc(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=Je.__assign(Je.__assign({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,Je.__spreadArray([l[k]],Je.__read(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Je.__values(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=Fe.flatten(i.map(d));return[h,u]}rt.actionTypes=an;rt.after=bD;rt.assign=yD;rt.cancel=hD;rt.choose=ID;rt.done=SD;rt.doneInvoke=CD;rt.error=wD;rt.escalate=ED;rt.forwardTo=TD;rt.getActionFunction=Xd;rt.initEvent=sD;rt.isActionObject=gD;var zn=rt.log=pD,$D=rt.pure=xD;rt.raise=uD;rt.resolveActions=Zd;rt.resolveLog=CC;rt.resolveRaise=bC;rt.resolveSend=SC;rt.resolveStop=wC;rt.respond=fD;rt.send=Eu;rt.sendParent=Gh;rt.sendTo=lD;rt.sendUpdate=cD;rt.start=vD;var Ym=rt.stop=mD;rt.toActionObject=Hc;rt.toActionObjects=Qd;rt.toActivityDefinition=Uh;function xC(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Kc(e){return function(n,r,i,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i,o);var a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i,o);return o.delete(n),o.delete(r),u}}function TC(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function Jm(e){return e.constructor===Object||e.constructor==null}function Xm(e){return typeof e.then=="function"}function Yc(e,t){return e===t||e!==e&&t!==t}var OD="[object Arguments]",DD="[object Boolean]",ND="[object Date]",PD="[object RegExp]",RD="[object Map]",kD="[object Number]",MD="[object Object]",jD="[object Set]",_D="[object String]",Qm=Object.prototype.toString;function Jc(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,s=e.createIsNestedEqual,u=s(l);function l(c,f,d){if(c===f)return!0;if(!c||!f||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;if(Jm(c)&&Jm(f))return i(c,f,u,d);var h=Array.isArray(c),p=Array.isArray(f);if(h||p)return h===p&&t(c,f,u,d);var v=Qm.call(c);return v!==Qm.call(f)?!1:v===ND?n(c,f,u,d):v===PD?o(c,f,u,d):v===RD?r(c,f,u,d):v===jD?a(c,f,u,d):v===MD||v===OD?Xm(c)||Xm(f)?!1:i(c,f,u,d):v===DD||v===kD||v===_D?Yc(c.valueOf(),f.valueOf()):!1}return l}function EC(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var qD=Kc(EC);function IC(e,t){return Yc(e.valueOf(),t.valueOf())}function AC(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(s,u){if(i){var l=!1,c=0;t.forEach(function(f,d){!l&&!o[c]&&(l=n(u,d,a,c,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[c]=!0),c++}),a++,i=l}}),i}var FD=Kc(AC),LD="_owner",VD=Object.prototype.hasOwnProperty;function $C(e,t,n,r){var i=Object.keys(e),o=i.length;if(Object.keys(t).length!==o)return!1;for(var a;o-- >0;){if(a=i[o],a===LD){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!VD.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var BD=Kc($C);function OC(e,t){return e.source===t.source&&e.flags===t.flags}function DC(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,s){if(i){var u=!1,l=0;t.forEach(function(c,f){!u&&!o[l]&&(u=n(a,c,s,f,e,t,r))&&(o[l]=!0),l++}),i=u}}),i}var UD=Kc(DC),NC=Object.freeze({areArraysEqual:EC,areDatesEqual:IC,areMapsEqual:AC,areObjectsEqual:$C,areRegExpsEqual:OC,areSetsEqual:DC,createIsNestedEqual:xC}),PC=Object.freeze({areArraysEqual:qD,areDatesEqual:IC,areMapsEqual:FD,areObjectsEqual:BD,areRegExpsEqual:OC,areSetsEqual:UD,createIsNestedEqual:xC}),GD=Jc(NC);function zD(e,t){return GD(e,t,void 0)}Jc(TC(NC,{createIsNestedEqual:function(){return Yc}}));Jc(PC);Jc(TC(PC,{createIsNestedEqual:function(){return Yc}}));var ep={exports:{}},Lf={},Zu={exports:{}},Vf={};/**
|
|
36
36
|
* @license React
|
|
37
37
|
* use-sync-external-store-shim.production.min.js
|
|
38
38
|
*
|
|
@@ -40,7 +40,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.Running)throw
|
|
|
40
40
|
*
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/var
|
|
43
|
+
*/var Zm;function WD(){if(Zm)return Vf;Zm=1;var e=O;function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(f,d){var h=d(),p=r({inst:{value:h,getSnapshot:d}}),v=p[0].inst,g=p[1];return o(function(){v.value=h,v.getSnapshot=d,u(v)&&g({inst:v})},[f,h,d]),i(function(){return u(v)&&g({inst:v}),f(function(){u(v)&&g({inst:v})})},[f]),a(h),h}function u(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function l(f,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:s;return Vf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Vf}var Bf={};/**
|
|
44
44
|
* @license React
|
|
45
45
|
* use-sync-external-store-shim.development.js
|
|
46
46
|
*
|
|
@@ -48,7 +48,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.Running)throw
|
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the MIT license found in the
|
|
50
50
|
* LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/var
|
|
51
|
+
*/var ey;function HD(){return ey||(ey=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(b){{for(var x=arguments.length,T=new Array(x>1?x-1:0),E=1;E<x;E++)T[E-1]=arguments[E];r("error",b,T)}}function r(b,x,T){{var E=t.ReactDebugCurrentFrame,A=E.getStackAddendum();A!==""&&(x+="%s",T=T.concat([A]));var N=T.map(function(I){return String(I)});N.unshift("Warning: "+x),Function.prototype.apply.call(console[b],console,N)}}function i(b,x){return b===x&&(b!==0||1/b===1/x)||b!==b&&x!==x}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue,c=!1,f=!1;function d(b,x,T){c||e.startTransition!==void 0&&(c=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=x();if(!f){var A=x();o(E,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var N=a({inst:{value:E,getSnapshot:x}}),I=N[0].inst,P=N[1];return u(function(){I.value=E,I.getSnapshot=x,h(I)&&P({inst:I})},[b,E,x]),s(function(){h(I)&&P({inst:I});var _=function(){h(I)&&P({inst:I})};return b(_)},[b]),l(E),E}function h(b){var x=b.getSnapshot,T=b.value;try{var E=x();return!o(T,E)}catch{return!0}}function p(b,x,T){return x()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!v,C=g?p:d,m=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;Bf.useSyncExternalStore=m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Bf}var ty;function RC(){return ty||(ty=1,process.env.NODE_ENV==="production"?Zu.exports=WD():Zu.exports=HD()),Zu.exports}/**
|
|
52
52
|
* @license React
|
|
53
53
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
54
54
|
*
|
|
@@ -56,7 +56,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.Running)throw
|
|
|
56
56
|
*
|
|
57
57
|
* This source code is licensed under the MIT license found in the
|
|
58
58
|
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var
|
|
59
|
+
*/var ny;function KD(){if(ny)return Lf;ny=1;var e=O,t=RC();function n(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return Lf.useSyncExternalStoreWithSelector=function(l,c,f,d,h){var p=o(null);if(p.current===null){var v={hasValue:!1,value:null};p.current=v}else v=p.current;p=s(function(){function C(E){if(!m){if(m=!0,b=E,E=d(E),h!==void 0&&v.hasValue){var A=v.value;if(h(A,E))return x=A}return x=E}if(A=x,r(b,E))return A;var N=d(E);return h!==void 0&&h(A,N)?A:(b=E,x=N)}var m=!1,b,x,T=f===void 0?null:f;return[function(){return C(c())},T===null?void 0:function(){return C(T())}]},[c,f,d,h]);var g=i(l,p[0],p[1]);return a(function(){v.hasValue=!0,v.value=g},[g]),u(g),g},Lf}var Uf={};/**
|
|
60
60
|
* @license React
|
|
61
61
|
* use-sync-external-store-shim/with-selector.development.js
|
|
62
62
|
*
|
|
@@ -64,10 +64,10 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Dt.Running)throw
|
|
|
64
64
|
*
|
|
65
65
|
* This source code is licensed under the MIT license found in the
|
|
66
66
|
* LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/var ny;function KD(){return ny||(ny=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=PC();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function l(c,f,d,h,p){var v=o(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var C=s(function(){var T=!1,E,A,N=function(L){if(!T){T=!0,E=L;var U=h(L);if(p!==void 0&&g.hasValue){var Y=g.value;if(p(Y,U))return A=Y,Y}return A=U,U}var k=E,ie=A;if(r(k,L))return ie;var B=h(L);return p!==void 0&&p(ie,B)?ie:(E=L,A=B,B)},I=d===void 0?null:d,P=function(){return N(f())},_=I===null?void 0:function(){return N(I())};return[P,_]},[f,d,h,p]),m=C[0],b=C[1],x=i(c,m,b);return a(function(){g.hasValue=!0,g.value=x},[x]),u(x),x}Vf.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Vf}process.env.NODE_ENV==="production"?Qd.exports=HD():Qd.exports=KD();var YD=Qd.exports,JD=O.useLayoutEffect;function ry(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var nc=globalThis&&globalThis.__assign||function(){return nc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},nc.apply(this,arguments)},XD=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},QD=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function ZD(e,t){var n=ry(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=QD(O.useState(n),1),i=r[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,s=t.actions,u=t.activities,l=t.services,c=t.delays;t.state;var f=XD(t,["context","guards","actions","activities","services","delays","state"]),d=ry(function(){var h={context:o,guards:a,actions:s,activities:u,services:l,delays:c},p=n.withConfig(h,function(){return nc(nc({},n.context),o)});return hC(p,f)});return JD(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,u),Object.assign(d.machine.options.services,l),Object.assign(d.machine.options.delays,c)},[s,a,u,l,c]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function eN(e,t,n){if(e.status===Dt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var tN=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function nN(e){return e}function rN(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=tN(t,1),i=r[0],o=i===void 0?{}:i,a=ZD(e,o),s=O.useCallback(function(){return a.status===Dt.NotStarted?o.state?rr.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return eN(a,f,d)},[a]),l=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),c=YD.useSyncExternalStoreWithSelector(l,s,s,nN,u);return O.useEffect(function(){var f=o.state;return a.start(f?rr.create(f):void 0),function(){a.stop(),a.status=Dt.NotStarted}},[]),[c,a.send,a]}const Eu=window.configuratorReactContexts??{ConfigurationSessionContext:O.createContext(null),ConfigurationInitializationContext:O.createContext(null),ConfigurationUpdatingContext:O.createContext(null),ConfigurationContext:O.createContext(null)};window.configuratorReactContexts=Eu;const RC=Eu.ConfigurationSessionContext,kC=Eu.ConfigurationInitializationContext,MC=Eu.ConfigurationUpdatingContext,jC=Eu.ConfigurationContext,Uh=()=>O.useContext(RC),La=()=>O.useContext(jC),_C="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function Gh(e){if(!e)throw new Error(_C)}function Va(e){if(!e)throw new Error(_C)}function Iu(){const e=Uh();return Gh(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var iN=function(e){return e._tag==="Some"},Jc=function(e){return function(t){return iN(e(t))}};const oN=Jc(e=>e.type===Oe.Choice?je(e):ge),aN=Jc(e=>e.type===Oe.Numeric?je(e):ge),sN=Jc(e=>e.type===Oe.Boolean?je(e):ge),uN=Jc(e=>e.type===Oe.Component?je(e):ge);function Xc(e){return e.decision!=null&&e.decision.kind===kr.Explicit}function qC(e){return w(e.values,Yt(Xc),W(t=>({type:Oe.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function lN(e){return w(e,Su(Xc),ee(()=>({type:Oe.Numeric,attributeId:e.id,state:null})))}function cN(e){return w(e,Su(Xc),ee(()=>({type:Oe.Boolean,attributeId:e.id,state:null})))}function fN(e){return w(e,Su(Xc),ee(()=>({type:Oe.Component,attributeId:e.id,state:null})))}function dN(e,t){return w(Fo.filterAttributesOfComponent(t,e,!0),n=>[w(n,Yt(oN),DE(qC)),w(n,Yt(aN),W(lN),Qn),w(n,Yt(sN),W(cN),Qn),w(n,Yt(uN),W(fN),Qn)],bh)}function FC(){const e=Uh();return Gh(e),O.useMemo(()=>({explain:(t,n)=>ue(n).with("decisions",r=>e.explain(t,r)).with("constraints",r=>e.explain(t,r)).with("full",r=>e.explain(t,r)).exhaustive(),applySolution:t=>e.applySolution(t)}),[e])}function pN(e,t=!1){const n=La();return Va(n),O.useMemo(()=>w(Ce(e),ee(Zn(W(r=>Fo.getAttribute(n,r)),t?jo(Ce):ai)),lt(()=>n.attributes)),[e,n,t])}function hN(e){const t=La(),{makeDecision:n,setManyDecision:r}=Iu(),i=Qc(e,Wt.choiceValue);Va(t);const o=Fo.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,l)=>n({type:Oe.Choice,attributeId:e,choiceValueId:u,state:l}),clearDecisions:w(o,Ce,ee(qC),Jt(bu),ee(u=>()=>r(u,{type:"Default"})),lt(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function vN(e){const t=La(),{makeDecision:n}=Iu(),r=Qc(e,Wt.numeric);Va(t);const i=Fo.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:Oe.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function mN(e){const t=La(),{makeDecision:n}=Iu(),r=Qc(e,Wt.boolean);Va(t);const i=Fo.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:Oe.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function yN(e){const t=La(),{makeDecision:n,setManyDecision:r}=Iu(),i=Qc(e,Wt.component);Va(t);const o=t.attributes,a=Fo.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:l=>n({type:Oe.Component,attributeId:e,state:l}),clearSubtree:w(dN(e,o),Su(bu),ee(l=>()=>r(l,{type:"Default"})),lt(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Qc(e,t){const{explain:n,applySolution:r}=FC();return O.useMemo(()=>({explain:(i,o)=>{const a=ue(i.question).with(xn.whyIsNotSatisfied,()=>Wt.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return ue(o).with("decisions",u=>n(s,u)).with("constraints",u=>n(s,u)).with("full",u=>n(s,u)).exhaustive()},applySolution:r}),[e,t,n,r])}const iy=Dn(XS),gN=Dn(QS),bN=Dn((e,t)=>pS(dt).equals(e??{},t??{})),SN=bn({attributeId:iy,decisions:Wi(iy)}),CN=Dn((e,t)=>Wi(SN).equals(e??[],t??[])),wN=bn({type:dt}),xN=bn({type:dt}),TN=bn({type:dt,rules:Wi(gN)}),EN=Dn((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:sn.all},y:{type:sn.all}},({x:n,y:r})=>wN.equals(n,r)).with({x:{type:sn.none},y:{type:sn.none}},({x:n,y:r})=>xN.equals(n,r)).with({x:{type:sn.specific},y:{type:sn.specific}},({x:n,y:r})=>TN.equals(n,r)).otherwise(()=>!1)),IN=bn({rules:Cu(EN)}),LC=bn({configurationModelSource:Dn((e,t)=>GD(e,t)),attributeRelations:CN,usageRuleParameters:bN,allowedInExplain:Cu(IN)}),Zd=Cu(LC),AN=yh,Ol=Cu(AN),$N=()=>Fh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[zn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[zn("Entering ProcessChanges","SessionManagement:"),Ho(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[zn("Entering DisposeSession","SessionManagement:"),Ho(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[zn("Entering CreateSession","SessionManagement:"),Ho(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[zn("Entering SessionCreationFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[zn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:zn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[zn("Entering UpdateSession","SessionManagement:"),Ho(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[zn("Entering SessionUpdateFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[zn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:zn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Rn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Rn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Rn((e,t)=>(e.session&&e.session.close().then(Br).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Rn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Rn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Rn({sessionCreationError:()=>null}),setSessionUpdateError:Rn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Rn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Rn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({failureResult:t,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({failureResult:t,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!Ol.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!LC.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!Ol.equals(e.desiredClient,e.sessionCreationError.client)||!Zd.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!Ol.equals(e.desiredClient,e.actualClient)||!Zd.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Ho(e){const t=e===0,n=e===1;return AD((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,failureResult:r.sessionCreationError&&r.sessionCreationError.failureResult},a={isUpdating:n&&r.sessionUpdateError==null,failureResult:r.sessionUpdateError&&r.sessionUpdateError.failureResult};return vC({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const ON=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),DN=()=>Fh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[vC((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[zn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[zn("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>ON(e.session)}}}},{actions:{saveSession:Rn((e,t)=>({session:t.session}))}}),NN=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},oy=()=>{const e=NN();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var PN=function(e,t,n){var r=O.useRef(),i=O.useRef(0);return r.current==null&&(r.current=e),t.equals(e,r.current)||(n&&n.debug&&process.env.NODE_ENV!=="production"&&console.info("Stable hook update triggered:",{prev:r.current,value:e}),r.current=e,i.current+=1),[i.current]},ay=function(e,t,n,r){return O.useEffect(e,PN(t,n,r))};const RN=()=>Fh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:oy()},entry:[Rn({sessionManagementActor:()=>Wm($N()),configurationSubscriptionManagementActor:()=>Wm(DN())})],exit:[Km(e=>e.sessionManagementActor),Km(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Xu(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Xu(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Xu(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Xu(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Rn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),jO(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Rn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Rn((e,t)=>{var n;const r=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&r&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>r?null:e.isReadyPromise!=null?e.isReadyPromise:oy())()}})}});function kN(e){var t,n;const[r,i]=rN(RN,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});ay(()=>{i({type:"ChangeConfigurationClient",client:e.configuratorClient}),e.configuratorClient||console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.")},[e.configuratorClient],wm(Ol)),ay(()=>{const u=w(Ce(e.sessionContext),zE(l=>Ce(l.configurationModelSource)),or);i({type:"ChangeSessionContext",sessionContext:u}),u||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[e.sessionContext],wm(Zd));const o=O.useMemo(()=>{var u,l,c,f;return{isInitializing:((l=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(c=r.context.isReadyPromise)==null?void 0:c.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,l;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.failureResult)&&{...r.context.sessionUpdating.failureResult,retry:()=>i({type:"RetrySessionUpdate"})}}},[r.context.sessionUpdating]),s=((t=r.context.configuration)==null?void 0:t.session)===r.context.session?(n=r.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:r.context.session,configuration:s}}function MN(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=kN({configuratorClient:t,sessionContext:n});return $.jsx(kC.Provider,{value:r,children:$.jsx(MC.Provider,{value:i,children:$.jsx(RC.Provider,{value:o,children:$.jsx(jC.Provider,{value:a,children:e.children})})})})}function VC(){return O.useContext(kC)}function jN(){return O.useContext(MC)}function _N(e){const{children:t}=e,{isInitializingPromise:n}=VC();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function qN(){const e=Uh(),t=La();return Gh(e),Va(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const FN=Object.freeze(Object.defineProperty({__proto__:null,Configuration:MN,ConfigurationSuspender:_N,useAttributes:pN,useBooleanAttribute:mN,useChoiceAttribute:hN,useComponentAttribute:yN,useConfiguration:qN,useConfigurationInitialization:VC,useConfigurationUpdating:jN,useDecision:Iu,useExplain:FC,useNumericAttribute:vN},Symbol.toStringTag,{value:"Module"}));var LN=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},VN=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},BN=function(e){var t=VN(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function _r(e){return e}function Ba(e){return function(){return e}}var UN=Ba(!0),GN=Ba(null),BC=Ba(void 0),Gr=BC;function Ln(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function y(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}var Tr=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,LN([i],r,!1))}}},zN=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},UC=function(e){return e._tag==="None"},zh=function(e){return e._tag==="Some"},Ua={_tag:"None"},Ga=function(e){return{_tag:"Some",value:e}},WN=function(e){return e._tag==="Left"},Zc=function(e){return{_tag:"Left",left:e}},ef=function(e){return{_tag:"Right",right:e}},HN=function(e){return[e]},KN=function(e){return e.length>0},YN=function(e){return e[0]},JN=function(e){return e.slice(1)},XN=[],QN={},Wh=Object.prototype.hasOwnProperty,ZN=function(e){return zN([e[0]],e.slice(1),!0)},e2=function(e,t){return Tr(2,function(n,r){return t.flatMap(n,function(i){return e.fromEither(r(i))})})};function t2(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function n2(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function GC(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):GC(e,t-1,i)}}function r2(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return GC(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function i2(e){return function(t){for(var n=Object.keys(t),r=n.length,i=r2(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function o2(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function a2(e){var t=n2(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function zC(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var s2=function(e){return function(){return Promise.resolve().then(e)}};function u2(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var tf=function(e,t){return y(e,Kh(t))},Hh=function(e,t){return y(e,l2(t))},Kh=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},l2=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},Au=function(e){return function(){return Promise.resolve(e)}},Yh=Tr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),$u="Task",nf={URI:$u,map:tf},Jh={URI:$u,of:Au},c2={URI:$u,map:tf,ap:Hh},Xh={URI:$u,map:tf,of:Au,ap:Hh,chain:Yh},f2=_r,sy=Yh,rc={URI:$u,map:tf,of:Au,ap:Hh,chain:Yh,fromIO:s2,fromTask:f2};function WC(e){return function(t){return function(n){return e.fromEither(UC(n)?Zc(t()):ef(n.value))}}}function d2(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?ef(o):Zc(r(o)))})}}}var Kr=Zc,Lo=ef,HC=function(e,t){return y(e,h2(t))},p2=function(e,t){return y(e,y2(t))},Qh="Either",h2=function(e){return function(t){return Fi(t)?t:Lo(e(t.right))}},v2={URI:Qh,map:HC},m2=function(e){return function(t){return Fi(t)?t:Fi(e)?e:Lo(t.right(e.right))}},y2=m2,g2={URI:Qh,map:HC,ap:p2},b2=function(e){return function(t){return Fi(t)?Kr(e(t.left)):t}},KC={URI:Qh,fromEither:_r},S2=WC(KC),Fi=WN,C2=function(e,t){return function(n){return Fi(n)?e(n.left):t(n.right)}},ao=C2;KC.fromEither;var w2=function(e){return Fi(e)?Lo(e.left):Kr(e.right)},x2=function(e,t){try{return Lo(e())}catch(n){return Kr(t(n))}},An=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},Sn=function(e){return An(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},uy=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return An(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},Zh={equals:function(e,t){return e===t}};Zh.equals;var T2=function(e){return function(t,n){return t===n||e(t,n)===0}},za=function(e){return{equals:T2(e),compare:function(t,n){return t===n?0:e(t,n)}}},Xs=function(e){return za(function(t,n){return e.compare(n,t)})},Zr=function(e){return function(t){return za(function(n,r){return t.compare(e(n),e(r))})}},E2=function(){return{concat:function(e,t){return za(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},ev=function(){return{concat:E2().concat,empty:za(function(){return 0})}},I2={equals:UN,compare:Ba(0)},A2=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function $2(e,t){return e<t?-1:e>t?1:0}var O2={equals:Zh.equals,compare:$2},D2=O2,N2=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}},P2=function(e){return{concat:A2(e)}},R2=function(e){return{concat:function(){return e}}},k2=N2,M2=R2(void 0),j2=P2,ly=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},_2=XN,YC=KN,q2=function(e,t){return e<0||e>=t.length},F2=function(e){return function(t){return ly(ly([],t,!0),[e],!1)}},L2=F2,V2=function(e,t,n){if(n[e]===t)return n;var r=ZN(n);return r[e]=t,r},B2=function(e){return function(t){if(t.length===1)return t;for(var n=[XC(t)],r=H2(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},U2=function(e){if(YC(e)){var t=ev();return G2(e.reduce(t.concat,t.empty))}return _r},JC=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);Wh.call(n,a)?n[a].push(o):n[a]=[o]}return n}},G2=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},z2=HN,W2=YN,XC=W2,H2=JN,rf={equals:function(e,t){return e===t}},of={equals:rf.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};rf.equals,of.compare;globalThis&&globalThis.__spreadArray;var ic=function(e){return e.length===0},Wa=YC,QC=L2,tv=function(e){return UC(e)?sf:[e.value]},K2=function(e){return function(t){if(ic(t))return sf;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},nv=q2;function ep(e,t){return t===void 0?function(n){return ep(e,n)}:nv(e,t)?Ua:Ga(t[e])}var Y2=function(e){return function(t){return nv(e,t)?t:e===0?sf:t.slice(0,e)}},ZC=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Ga(n);return Ua}};function Pt(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Ga(t[n]);return Ua}}var J2=function(e,t){return function(n){return nv(e,n)?Ua:Ga(nP(e,t(n[e]),n))}},af=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}};function rv(e){return function(t,n){if(n===void 0){var r=rv(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var fa=function(e){var t=B2(e);return function(n){return Wa(n)?t(n):n}},X2=function(e){var t=U2(e);return function(n){return Wa(n)?t(n):n}},Q2=function(e){return function(t){return ic(t)?e:ic(e)?t:t.concat(e)}},Re=Q2;function ew(e){var t=rv(e);return function(n,r){if(r===void 0){var i=ew(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var Z2=z2,tw=Tr(2,function(e,t){return y(e,K2(function(n,r){return t(r,n)}))}),Ha=tw(_r),z=function(e){return function(t){return t.map(function(n){return e(n)})}},Vt=function(e){return function(t){return t.filter(e)}},eP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);zh(i)&&n.push(i.value)}return n}},Vo=function(e){return eP(function(t,n){return e(n)})},qn=Vo(_r),tp=function(e,t){return tP(e,function(n,r,i){return t(r,i)})},tP=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},Ki=function(e){return An(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},nP=function(e,t,n){return Wa(n)?V2(e,t,n):n},np=function(e){return e.slice()},cy=function(e){return ic(e)?sf:e.slice()},sf=_2,nw=tw,rP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}};function to(e){return Pt(e)}var Dl=function(e){return function(t){return t.map(function(n){return e(n)})}},iP=Tr(2,function(e,t){return y(e,rP(function(n,r){return t(r,n)}))}),oP=iP(_r),aP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);zh(i)&&n.push(i.value)}return n}},vi=function(e){return aP(function(t,n){return e(n)})},sP=function(e){return function(t){return t.filter(e)}},rw=function(e){return function(t){return Ln(e,t)}},uP=function(e){return function(t){return function(n){return t(n)&&e(n)}}},me=Ua,De=Ga;function Ou(e){return function(t){return e(t)?De(t):me}}var lP=function(e){return e._tag==="Left"?me:De(e.right)},iw=function(e,t){return y(e,K(t))},ow=function(e,t){return y(e,cP(t))},aw="Option",Yi=function(e){return{equals:function(t,n){return t===n||(ur(t)?ur(n):ur(n)?!1:e.equals(t.value,n.value))}}},sw=function(e){return{equals:Yi(e).equals,compare:function(t,n){return t===n?0:Ii(t)?Ii(n)?e.compare(t.value,n.value):1:-1}}},K=function(e){return function(t){return ur(t)?me:De(e(t.value))}},Di=De,cP=function(e){return function(t){return ur(t)||ur(e)?me:De(t.value(e.value))}},fP={URI:aw,map:iw,ap:ow,of:Di},iv=Tr(2,function(e,t){return ur(e)?me:t(e.value)}),dP={URI:aw,map:iw,ap:ow,chain:iv},uw=Tr(2,function(e,t){return ur(e)?t():e}),rp=uw,pP=iv(_r),Mt=function(e){return function(t){return ur(t)?me:e(t.value)?t:me}},hP=lP,Ii=zh,ur=function(e){return e._tag==="None"},vP=function(e,t){return function(n){return ur(n)?e():t(n.value)}},ei=vP,lw=ei,mP=function(e){return function(t){return ur(t)?e():t.value}},Qe=mP,ip=pP,yP=Tr(2,zC(dP)),ye=function(e){return e==null?me:De(e)},gP=function(e){try{return De(e())}catch{return me}},bP=function(e){return function(t){return ur(t)?me:ye(e(t.value))}},Mn=ei(GN,_r),Et=ei(BC,_r),Fn=iv,SP=yP,CP=a2(fP);function wP(e){return Ln(Lo,e.of)}function xP(e){return Ln(Kr,e.of)}function TP(e){return o2(e,v2)}function EP(e){return t2(e,g2)}function IP(e){return function(t,n){return e.chain(t,function(r){return Fi(r)?e.of(r):n(r.right)})}}function AP(e){return function(t,n){return e.map(t,b2(n))}}function $P(e){return function(t,n){return function(r){return e.map(r,ao(t,n))}}}function OP(e){return function(t){return function(n){return e.chain(n,function(r){return Fi(r)?t(r.left):e.of(r)})}}}function DP(e){return function(t){return e.map(t,w2)}}var NP=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},PP=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Ni=xP(Jh),Ka=wP(Jh),RP=Au,kP=function(e){return Kh(S2(e))},oc=$P(nf),fy=function(e,t){return function(){return NP(void 0,void 0,void 0,function(){var n;return PP(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(ef)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Zc(t(n))];case 3:return[2]}})})}},cw=OP(Xh),dy=DP(nf),fw=function(e,t){return y(e,Ht(t))},dw=function(e,t){return y(e,jP(t))},Ht=TP(nf),MP=Tr(2,AP(nf)),Sr=MP,jP=EP(c2),ov=Tr(2,IP(Xh)),da=Ka,av="TaskEither",_P={URI:av,map:fw,ap:dw,of:da},pw={URI:av,map:fw,ap:dw,chain:ov},sv={URI:av,fromEither:RP},qP=Tr(2,zC(pw)),uv=WC(sv),FP={fromEither:sv.fromEither},LP={flatMap:ov},VP=e2(FP,LP),BP=VP,op=d2(sv,pw),UP=da(QN),gr=ov,GP=qP;function zP(e){return t=>y(t,Ht(n=>(e(n)(),n)))}const Qs=zP;function Zs(e){return t=>y(t,dy,Qs(e),dy)}function WP(e){return t=>y(t,Qs(n=>()=>e(n)()),Zs(n=>()=>e(n)()))}function HP(e){return t=>y(t,K(n=>(e(n)(),n)))}const KP=HP;function YP(e){return Ln(De,e.of)}function JP(e){return Ba(e.of(me))}function XP(e){var t=JP(e);return function(n,r){return e.chain(n,ei(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var QP=YP(Jh),ZP=Au,eR=Kh(hP),tR=Tr(2,XP(Xh)),nR=tR,lv=function(e){return k2(e)(e.empty)};M2.concat;var rR=BN,ot={equals:function(e,t){return e===t}},eu={equals:ot.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},iR=function(e,t){return function(n){return n.replace(e,t)}},oR=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function cv(e){if(typeof e=="function")return cv(eu)(e);var t=oR(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var s=a[o];i.push(n(s,r[s]))}return i}}}function hw(e){return function(t,n){if(n===void 0){var r=hw(e);return function(o){return r(o,t)}}for(var i in t)if(!Wh.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function vw(e,t){return t===void 0?function(n){return vw(e,n)}:Wh.call(t,e)?Ga(t[e]):Ua}var aR=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function mw(e){var t=hw(e);return An(function(n,r){return t(n)(r)&&t(r)(n)})}function sR(e){return An((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var fv={equals:function(e,t){return e===t}},yw={equals:fv.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};function uR(e){const t=parseFloat(e);return isNaN(t)?me:De(t)}const _n=Symbol.for("@ts-pattern/matcher"),gw=Symbol.for("@ts-pattern/isVariadic"),ac="@ts-pattern/anonymous-select-key",ap=e=>!!(e&&typeof e=="object"),Nl=e=>e&&!!e[_n],gn=(e,t,n)=>{if(Nl(e)){const r=e[_n](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(ap(e)){if(!ap(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let r=[],i=[],o=[];for(const a of e.keys()){const s=e[a];Nl(s)&&s[gw]?o.push(s):o.length?i.push(s):r.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;const a=t.slice(0,r.length),s=i.length===0?[]:t.slice(-i.length),u=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((l,c)=>gn(l,a[c],n))&&i.every((l,c)=>gn(l,s[c],n))&&(o.length===0||gn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>gn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||Nl(o=i)&&o[_n]().matcherType==="optional")&&gn(i,t[r],n);var o})}return Object.is(t,e)},Xn=e=>{var t,n,r;return ap(e)?Nl(e)?(t=(n=(r=e[_n]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?tu(e,Xn):tu(Object.values(e),Xn):[]},tu=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function lR(...e){if(e.length===1){const[t]=e;return n=>gn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return gn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function En(e){return Object.assign(e,{optional:()=>dv(e),and:t=>Tt(e,t),or:t=>bw(e,t),select:t=>t===void 0?nu(e):nu(t,e)})}function sp(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[gw]:!0})}}))(e),{optional:()=>sp(dv(e)),select:t=>sp(t===void 0?nu(e):nu(t,e))})}function dv(e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Xn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:gn(e,t,r),selections:n}},getSelectionKeys:()=>Xn(e),matcherType:"optional"})})}const cR=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},fR=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function Tt(...e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>gn(i,t,r)),selections:n}},getSelectionKeys:()=>tu(e,Xn),matcherType:"and"})})}function bw(...e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return tu(e,Xn).forEach(i=>r(i,void 0)),{matched:e.some(i=>gn(i,t,r)),selections:n}},getSelectionKeys:()=>tu(e,Xn),matcherType:"or"})})}function et(e){return{[_n]:()=>({match:t=>({matched:!!e(t)})})}}function nu(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return En({[_n]:()=>({match:r=>{let i={[t??ac]:r};return{matched:n===void 0||gn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??ac].concat(n===void 0?[]:Xn(n))})})}function Or(e){return typeof e=="number"}function so(e){return typeof e=="string"}function bi(e){return typeof e=="bigint"}const Sw=En(et(function(e){return!0})),dR=Sw,uo=e=>Object.assign(En(e),{startsWith:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.startsWith(n)))));var n},endsWith:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.endsWith(n)))));var n},minLength:t=>uo(Tt(e,(n=>et(r=>so(r)&&r.length>=n))(t))),maxLength:t=>uo(Tt(e,(n=>et(r=>so(r)&&r.length<=n))(t))),includes:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.includes(n)))));var n},regex:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&!!r.match(n)))));var n}}),pR=uo(et(so)),Dr=e=>Object.assign(En(e),{between:(t,n)=>Dr(Tt(e,((r,i)=>et(o=>Or(o)&&r<=o&&i>=o))(t,n))),lt:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r<n))(t))),gt:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r>n))(t))),lte:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r<=n))(t))),gte:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r>=n))(t))),int:()=>Dr(Tt(e,et(t=>Or(t)&&Number.isInteger(t)))),finite:()=>Dr(Tt(e,et(t=>Or(t)&&Number.isFinite(t)))),positive:()=>Dr(Tt(e,et(t=>Or(t)&&t>0))),negative:()=>Dr(Tt(e,et(t=>Or(t)&&t<0)))}),hR=Dr(et(Or)),Si=e=>Object.assign(En(e),{between:(t,n)=>Si(Tt(e,((r,i)=>et(o=>bi(o)&&r<=o&&i>=o))(t,n))),lt:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r<n))(t))),gt:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r>n))(t))),lte:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r<=n))(t))),gte:t=>Si(Tt(e,(n=>et(r=>bi(r)&&r>=n))(t))),positive:()=>Si(Tt(e,et(t=>bi(t)&&t>0))),negative:()=>Si(Tt(e,et(t=>bi(t)&&t<0)))}),vR=Si(et(bi)),mR=En(et(function(e){return typeof e=="boolean"})),yR=En(et(function(e){return typeof e=="symbol"})),gR=En(et(function(e){return e==null}));var qe={__proto__:null,matcher:_n,optional:dv,array:function(...e){return sp({[_n]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let r={};if(t.length===0)return Xn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>gn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Xn(e[0])})})},set:function(...e){return En({[_n]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const r=(o,a)=>{n[o]=(n[o]||[]).concat([a])},i=e[0];return{matched:cR(t,o=>gn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Xn(e[0])})})},map:function(...e){return En({[_n]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const r=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[o,a]=e;return{matched:fR(t,(s,u)=>{const l=gn(o,u,r),c=gn(a,s,r);return l&&c}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Xn(e[0]),...Xn(e[1])]})})},intersection:Tt,union:bw,not:function(e){return En({[_n]:()=>({match:t=>({matched:!gn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:et,select:nu,any:Sw,_:dR,string:pR,number:hR,bigint:vR,boolean:mR,symbol:yR,nullish:gR,instanceOf:function(e){return En(et(function(t){return n=>n instanceof t}(e)))},shape:function(e){return En(et(lR(e)))}};const up={matched:!1,value:void 0};function H(e){return new bR(e,up)}let bR=class lp{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],r=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,a={};const s=(l,c)=>{o=!0,a[l]=c},u=!r.some(l=>gn(l,this.input,s))||i&&!i(this.input)?up:{matched:!0,value:n(o?ac in a?a[ac]:a:this.input,this.input)};return new lp(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new lp(this.input,r?{matched:!0,value:n(this.input,this.input)}:up)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var SR=Object.getOwnPropertyNames,CR=Object.getOwnPropertySymbols,wR=Object.prototype.hasOwnProperty;function py(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Zu(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var o=i.cache,a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i);return o.delete(n),o.delete(r),u}}function hy(e){return SR(e).concat(CR(e))}var Cw=Object.hasOwn||function(e,t){return wR.call(e,t)};function Ya(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var ww="_owner",vy=Object.getOwnPropertyDescriptor,my=Object.keys;function xR(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function TR(e,t){return Ya(e.getTime(),t.getTime())}function yy(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),l=!1,c=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,v=p[0],g=p[1];!l&&!r[c]&&(l=n.equals(d,v,o,c,e,t,n)&&n.equals(h,g,d,v,e,t,n))&&(r[c]=!0),c++}if(!l)return!1;o++}return!0}function ER(e,t,n){var r=my(e),i=r.length;if(my(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===ww&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Cw(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function hs(e,t,n){var r=hy(e),i=r.length;if(hy(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===ww&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Cw(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=vy(e,o),s=vy(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function IR(e,t){return Ya(e.valueOf(),t.valueOf())}function AR(e,t){return e.source===t.source&&e.flags===t.flags}function gy(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,l=0;(a=s.next())&&!a.done;)!u&&!r[l]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[l]=!0),l++;if(!u)return!1}return!0}function $R(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var OR="[object Arguments]",DR="[object Boolean]",NR="[object Date]",PR="[object Map]",RR="[object Number]",kR="[object Object]",MR="[object RegExp]",jR="[object Set]",_R="[object String]",qR=Array.isArray,by=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Sy=Object.assign,FR=Object.prototype.toString.call.bind(Object.prototype.toString);function LR(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(c,f,d){if(c===f)return!0;if(c==null||f==null||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;var h=c.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(c,f,d);if(qR(c))return t(c,f,d);if(by!=null&&by(c))return u(c,f,d);if(h===Date)return n(c,f,d);if(h===RegExp)return a(c,f,d);if(h===Map)return r(c,f,d);if(h===Set)return s(c,f,d);var p=FR(c);return p===NR?n(c,f,d):p===MR?a(c,f,d):p===PR?r(c,f,d):p===jR?s(c,f,d):p===kR?typeof c.then!="function"&&typeof f.then!="function"&&i(c,f,d):p===OR?i(c,f,d):p===DR||p===RR||p===_R?o(c,f,d):!1}}function VR(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?hs:xR,areDatesEqual:TR,areMapsEqual:r?py(yy,hs):yy,areObjectsEqual:r?hs:ER,arePrimitiveWrappersEqual:IR,areRegExpsEqual:AR,areSetsEqual:r?py(gy,hs):gy,areTypedArraysEqual:r?hs:$R};if(n&&(i=Sy({},i,n(i))),t){var o=Zu(i.areArraysEqual),a=Zu(i.areMapsEqual),s=Zu(i.areObjectsEqual),u=Zu(i.areSetsEqual);i=Sy({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function BR(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function UR(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,l){var c=r(),f=c.cache,d=f===void 0?t?new WeakMap:void 0:f,h=c.meta;return n(u,l,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(u,l){return n(u,l,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,l){return n(u,l,a)}}var GR=Ji();Ji({strict:!0});Ji({circular:!0});Ji({circular:!0,strict:!0});Ji({createInternalComparator:function(){return Ya}});Ji({strict:!0,createInternalComparator:function(){return Ya}});Ji({circular:!0,createInternalComparator:function(){return Ya}});Ji({circular:!0,createInternalComparator:function(){return Ya},strict:!0});function Ji(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=VR(e),u=LR(s),l=r?r(u):BR(u);return UR({circular:n,comparator:u,createState:i,equals:l,strict:a})}function zR(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function WR(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),zR(e)}var Ms=y,HR=rR(CP({concat:j2(D2).concat,empty:0}))();function KR(e){return function(t){return t.iterNumber>=e?me:De(0)}}function YR(e,t){return function(n){return Ms(n,t,K(function(r){return Math.min(e,r)}))}}function JR(e){return function(t){return De(e*Math.pow(2,t.iterNumber))}}var XR={iterNumber:0,cumulativeDelay:0,previousDelay:me};function QR(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+Qe(function(){return 0})(n),previousDelay:n}}function ZR(e,t){var n=QR(e,t);return Ms(n.previousDelay,lw(function(){return rc.of(n)},function(r){return u2(r)(rc.of(n))}))}function Ko(e,t,n){var r=function(i){return Ms(i,t,sy(function(o){return n(o)?Ms(ZR(e,i),sy(function(a){return Ms(a.previousDelay,lw(function(){return rc.of(o)},function(){return r(a)}))})):rc.of(o)}))};return r(XR)}var ru={};Object.defineProperty(ru,"__esModule",{value:!0});ru.isGuid=pv=ru.guid=void 0;var ek=function(e){e===void 0&&(e=2);for(var t=(Date.now()*3).toString(16),n=new Date().getTimezoneOffset(),r=Number("".concat(n<0?"7":"6").concat(Math.abs(n))).toString(16),i=e*9+3+15,o="",a=0;a<e;a++)o+=Cy()+"-";for(o+=r,o+=t;o.length<i;)o+=Cy();return o.substring(0,i)},pv=ru.guid=ek,Cy=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},tk=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=nk(n[n.length-1]);if(n.length-1!==t)return"Invalid guid, invalid number of blocks";var i=n.concat().slice(0,-1).reduce(function(o,a){return o&&a.length===8&&!a.includes(" ")},!0);return i?!r&&n[n.length-1].length!==18?"Invalid guid, last date block has invalid size":!0:"Invalid guid, one or more random blocks are invalid"};ru.isGuid=tk;var nk=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function hv(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function uf(e){return{equals(t,n){const r=y(ye(t),Qe(()=>[])),i=y(ye(n),Qe(()=>[]));return Ki(e).equals(r,i)}}}const Ja=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModelId:hv(ot)}),xw=Sn({localId:ot,configurationModelId:ot}),rk=An((e,t)=>H({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>ik.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>ok.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>ak.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>sk.equals(n.x,n.y)).otherwise(()=>!1)),ik=Sn({type:ot,attributeId:Ja,state:ot,choiceValueId:ot}),ok=Sn({type:ot,attributeId:Ja,state:ot}),ak=Sn({type:ot,attributeId:Ja,state:rf}),sk=Sn({type:ot,attributeId:Ja,state:fv});var Ft=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Ft||{}),Ue=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Ue||{}),Pl=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(Pl||{}),vn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(vn||{}),Li=(e=>(e.Channel="Channel",e.Package="Package",e))(Li||{}),V=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(V||{}),Ye=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ye||{}),Ge=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ge||{}),Se=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Se||{}),Pi=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Pi||{}),xa=(e=>(e.Always="Always",e.Optional="Optional",e))(xa||{}),pt=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(pt||{}),Tw=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Tw||{});const uk={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};let lk=class{mapToCreateSessionRequest(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToAttributeRelations(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToConfigurationModelSource(t){return H(t).with({type:Li.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Li.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return y(t,ye,K(Ln(z(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),Et)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:y([...t.decisions],Dl(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return y(ye(t),Et)}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath,sharedConfigurationModelId:t.sharedConfigurationModelId}}mapToAllowedInExplain(t){return t==null?null:{rules:this.mapToAllowedRulesInExplain(t.rules)}}mapToAllowedRulesInExplain(t){return H(t).returnType().with({type:vn.all},()=>({type:"AllowedRulesAll"})).with({type:vn.none},()=>({type:"AllowedRulesNone"})).with({type:vn.specific},n=>({type:"AllowedRulesSpecific",rules:y(n.rules,z(this.mapToGlobalConstraintId),np)})).with(qe.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function ck(e){return t=>op(n=>n!=null,e)(t)}function fk(){return Ka(Gr())}var Yn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Yn||{}),yo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(yo||{}),mn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(mn||{}),go=(e=>(e.all="all",e.none="none",e.specific="specific",e))(go||{});const wn=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModel:hv(ot)}),dk=Yi(Ki(Sn({attributeId:wn,decisions:uf(wn)}))),pk=Yi(An((e,t)=>H({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:r})=>Ki(xw).equals(n.rules,r.rules)).otherwise(()=>!1))),hk=Yi(Sn({rules:pk})),vk=Sn({configurationModelSource:An((e,t)=>GR(e,t)),decisionsToRespect:dk,usageRuleParameters:mw(ot),allowedInExplain:hk});var iu=(e=>(e.Channel="Channel",e.Package="Package",e))(iu||{}),ft=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ft||{}),Ie=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ie||{}),Zt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Zt||{}),kt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(kt||{}),Eo=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Eo||{}),Io=(e=>(e.Always="Always",e.Optional="Optional",e))(Io||{});const mk={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Yi(ot).equals(e.state,t.state)},yk={equals(e,t){return Yi(rf).equals(e.value,t.value)}},gk={equals(e,t){return Yi(fv).equals(e.value,t.value)}},bk={equals(e,t){return Yi(ot).equals(e.state,t.state)}},Sk={equals(e,t){return wn.equals(e.attributeId,t.attributeId)?H({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>gk.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>yk.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>bk.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>mk.equals(r.x,r.y)).otherwise(()=>!1):!1}},Ck=Ki(Sk),wk={equals:(e,t)=>Ck.equals(e.decisions,t.decisions)&&xk.equals(e.mode,t.mode)},xk={equals:(e,t)=>H({x:e,y:t}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var cp=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(cp||{}),ba=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ba||{}),xe=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(xe||{}),vv=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(vv||{});function Tk(e,t){console.log(`--------------------------------------------------------------------------------
|
|
67
|
+
*/var ry;function YD(){return ry||(ry=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=RC();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function l(c,f,d,h,p){var v=o(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var C=s(function(){var T=!1,E,A,N=function(L){if(!T){T=!0,E=L;var U=h(L);if(p!==void 0&&g.hasValue){var Y=g.value;if(p(Y,U))return A=Y,Y}return A=U,U}var k=E,ie=A;if(r(k,L))return ie;var B=h(L);return p!==void 0&&p(ie,B)?ie:(E=L,A=B,B)},I=d===void 0?null:d,P=function(){return N(f())},_=I===null?void 0:function(){return N(I())};return[P,_]},[f,d,h,p]),m=C[0],b=C[1],x=i(c,m,b);return a(function(){g.hasValue=!0,g.value=x},[x]),u(x),x}Uf.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Uf}process.env.NODE_ENV==="production"?ep.exports=KD():ep.exports=YD();var JD=ep.exports,XD=O.useLayoutEffect;function iy(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var rc=globalThis&&globalThis.__assign||function(){return rc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},rc.apply(this,arguments)},QD=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},ZD=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function eN(e,t){var n=iy(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=ZD(O.useState(n),1),i=r[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,s=t.actions,u=t.activities,l=t.services,c=t.delays;t.state;var f=QD(t,["context","guards","actions","activities","services","delays","state"]),d=iy(function(){var h={context:o,guards:a,actions:s,activities:u,services:l,delays:c},p=n.withConfig(h,function(){return rc(rc({},n.context),o)});return vC(p,f)});return XD(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,u),Object.assign(d.machine.options.services,l),Object.assign(d.machine.options.delays,c)},[s,a,u,l,c]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function tN(e,t,n){if(e.status===Dt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var nN=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function rN(e){return e}function iN(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=nN(t,1),i=r[0],o=i===void 0?{}:i,a=eN(e,o),s=O.useCallback(function(){return a.status===Dt.NotStarted?o.state?ir.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return tN(a,f,d)},[a]),l=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),c=JD.useSyncExternalStoreWithSelector(l,s,s,rN,u);return O.useEffect(function(){var f=o.state;return a.start(f?ir.create(f):void 0),function(){a.stop(),a.status=Dt.NotStarted}},[]),[c,a.send,a]}const Iu=window.configuratorReactContexts??{ConfigurationSessionContext:O.createContext(null),ConfigurationInitializationContext:O.createContext(null),ConfigurationUpdatingContext:O.createContext(null),ConfigurationContext:O.createContext(null)};window.configuratorReactContexts=Iu;const kC=Iu.ConfigurationSessionContext,MC=Iu.ConfigurationInitializationContext,jC=Iu.ConfigurationUpdatingContext,_C=Iu.ConfigurationContext,zh=()=>O.useContext(kC),La=()=>O.useContext(_C),qC="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function Wh(e){if(!e)throw new Error(qC)}function Va(e){if(!e)throw new Error(qC)}function Au(){const e=zh();return Wh(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var oN=function(e){return e._tag==="Some"},Xc=function(e){return function(t){return oN(e(t))}};const aN=Xc(e=>e.type===Oe.Choice?je(e):ge),sN=Xc(e=>e.type===Oe.Numeric?je(e):ge),uN=Xc(e=>e.type===Oe.Boolean?je(e):ge),lN=Xc(e=>e.type===Oe.Component?je(e):ge);function Qc(e){return e.decision!=null&&e.decision.kind===kr.Explicit}function FC(e){return w(e.values,Yt(Qc),W(t=>({type:Oe.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function cN(e){return w(e,Cu(Qc),ee(()=>({type:Oe.Numeric,attributeId:e.id,state:null})))}function fN(e){return w(e,Cu(Qc),ee(()=>({type:Oe.Boolean,attributeId:e.id,state:null})))}function dN(e){return w(e,Cu(Qc),ee(()=>({type:Oe.Component,attributeId:e.id,state:null})))}function pN(e,t){return w(Fo.filterAttributesOfComponent(t,e,!0),n=>[w(n,Yt(aN),NE(FC)),w(n,Yt(sN),W(cN),Qn),w(n,Yt(uN),W(fN),Qn),w(n,Yt(lN),W(dN),Qn)],Ch)}function LC(){const e=zh();return Wh(e),O.useMemo(()=>({explain:(t,n)=>ue(n).with("decisions",r=>e.explain(t,r)).with("constraints",r=>e.explain(t,r)).with("full",r=>e.explain(t,r)).exhaustive(),applySolution:t=>e.applySolution(t)}),[e])}function hN(e,t=!1){const n=La();return Va(n),O.useMemo(()=>w(Ce(e),ee(Zn(W(r=>Fo.getAttribute(n,r)),t?jo(Ce):li)),lt(()=>n.attributes)),[e,n,t])}function vN(e){const t=La(),{makeDecision:n,setManyDecision:r}=Au(),i=Zc(e,Wt.choiceValue);Va(t);const o=Fo.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,l)=>n({type:Oe.Choice,attributeId:e,choiceValueId:u,state:l}),clearDecisions:w(o,Ce,ee(FC),Jt(Su),ee(u=>()=>r(u,{type:"Default"})),lt(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function mN(e){const t=La(),{makeDecision:n}=Au(),r=Zc(e,Wt.numeric);Va(t);const i=Fo.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:Oe.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function yN(e){const t=La(),{makeDecision:n}=Au(),r=Zc(e,Wt.boolean);Va(t);const i=Fo.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:Oe.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function gN(e){const t=La(),{makeDecision:n,setManyDecision:r}=Au(),i=Zc(e,Wt.component);Va(t);const o=t.attributes,a=Fo.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:l=>n({type:Oe.Component,attributeId:e,state:l}),clearSubtree:w(pN(e,o),Cu(Su),ee(l=>()=>r(l,{type:"Default"})),lt(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Zc(e,t){const{explain:n,applySolution:r}=LC();return O.useMemo(()=>({explain:(i,o)=>{const a=ue(i.question).with(xn.whyIsNotSatisfied,()=>Wt.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return ue(o).with("decisions",u=>n(s,u)).with("constraints",u=>n(s,u)).with("full",u=>n(s,u)).exhaustive()},applySolution:r}),[e,t,n,r])}const oy=Dn(QS),bN=Dn(ZS),SN=Dn((e,t)=>hS(dt).equals(e??{},t??{})),CN=bn({attributeId:oy,decisions:Hi(oy)}),wN=Dn((e,t)=>Hi(CN).equals(e??[],t??[])),xN=bn({type:dt}),TN=bn({type:dt}),EN=bn({type:dt,rules:Hi(bN)}),IN=Dn((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:un.all},y:{type:un.all}},({x:n,y:r})=>xN.equals(n,r)).with({x:{type:un.none},y:{type:un.none}},({x:n,y:r})=>TN.equals(n,r)).with({x:{type:un.specific},y:{type:un.specific}},({x:n,y:r})=>EN.equals(n,r)).otherwise(()=>!1)),AN=bn({rules:wu(IN)}),VC=bn({configurationModelSource:Dn((e,t)=>zD(e,t)),attributeRelations:wN,usageRuleParameters:SN,allowedInExplain:wu(AN)}),tp=wu(VC),$N=bh,Dl=wu($N),ON=()=>Vh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[zn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[zn("Entering ProcessChanges","SessionManagement:"),Ho(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[zn("Entering DisposeSession","SessionManagement:"),Ho(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[zn("Entering CreateSession","SessionManagement:"),Ho(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[zn("Entering SessionCreationFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[zn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:zn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[zn("Entering UpdateSession","SessionManagement:"),Ho(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[zn("Entering SessionUpdateFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[zn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:zn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Rn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Rn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Rn((e,t)=>(e.session&&e.session.close().then(zr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Rn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Rn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Rn({sessionCreationError:()=>null}),setSessionUpdateError:Rn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Rn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Rn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({failureResult:t,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({failureResult:t,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!Dl.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!VC.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!Dl.equals(e.desiredClient,e.sessionCreationError.client)||!tp.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!Dl.equals(e.desiredClient,e.actualClient)||!tp.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Ho(e){const t=e===0,n=e===1;return $D((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,failureResult:r.sessionCreationError&&r.sessionCreationError.failureResult},a={isUpdating:n&&r.sessionUpdateError==null,failureResult:r.sessionUpdateError&&r.sessionUpdateError.failureResult};return mC({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const DN=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),NN=()=>Vh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[mC((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[zn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[zn("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>DN(e.session)}}}},{actions:{saveSession:Rn((e,t)=>({session:t.session}))}}),PN=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},ay=()=>{const e=PN();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var RN=function(e,t,n){var r=O.useRef(),i=O.useRef(0);return r.current==null&&(r.current=e),t.equals(e,r.current)||(n&&n.debug&&process.env.NODE_ENV!=="production"&&console.info("Stable hook update triggered:",{prev:r.current,value:e}),r.current=e,i.current+=1),[i.current]},sy=function(e,t,n,r){return O.useEffect(e,RN(t,n,r))};const kN=()=>Vh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:ay()},entry:[Rn({sessionManagementActor:()=>Hm(ON()),configurationSubscriptionManagementActor:()=>Hm(NN())})],exit:[Ym(e=>e.sessionManagementActor),Ym(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Qu(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Qu(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Qu(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Qu(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Rn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),_O(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Rn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Rn((e,t)=>{var n;const r=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&r&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>r?null:e.isReadyPromise!=null?e.isReadyPromise:ay())()}})}});function MN(e){var t,n;const[r,i]=iN(kN,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});sy(()=>{i({type:"ChangeConfigurationClient",client:e.configuratorClient}),e.configuratorClient||console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.")},[e.configuratorClient],xm(Dl)),sy(()=>{const u=w(Ce(e.sessionContext),WE(l=>Ce(l.configurationModelSource)),ar);i({type:"ChangeSessionContext",sessionContext:u}),u||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[e.sessionContext],xm(tp));const o=O.useMemo(()=>{var u,l,c,f;return{isInitializing:((l=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(c=r.context.isReadyPromise)==null?void 0:c.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,l;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.failureResult)&&{...r.context.sessionUpdating.failureResult,retry:()=>i({type:"RetrySessionUpdate"})}}},[r.context.sessionUpdating]),s=((t=r.context.configuration)==null?void 0:t.session)===r.context.session?(n=r.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:r.context.session,configuration:s}}function jN(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=MN({configuratorClient:t,sessionContext:n});return $.jsx(MC.Provider,{value:r,children:$.jsx(jC.Provider,{value:i,children:$.jsx(kC.Provider,{value:o,children:$.jsx(_C.Provider,{value:a,children:e.children})})})})}function BC(){return O.useContext(MC)}function _N(){return O.useContext(jC)}function qN(e){const{children:t}=e,{isInitializingPromise:n}=BC();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function FN(){const e=zh(),t=La();return Wh(e),Va(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const LN=Object.freeze(Object.defineProperty({__proto__:null,Configuration:jN,ConfigurationSuspender:qN,useAttributes:hN,useBooleanAttribute:yN,useChoiceAttribute:vN,useComponentAttribute:gN,useConfiguration:FN,useConfigurationInitialization:BC,useConfigurationUpdating:_N,useDecision:Au,useExplain:LC,useNumericAttribute:mN},Symbol.toStringTag,{value:"Module"}));var VN=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},BN=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},UN=function(e){var t=BN(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function _r(e){return e}function Ba(e){return function(){return e}}var GN=Ba(!0),zN=Ba(null),UC=Ba(void 0),Hr=UC;function Ln(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return o(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(o(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(a(o(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return u(s(a(o(i(r(n(t(e.apply(this,arguments)))))))))}}}function y(e,t,n,r,i,o,a,s,u){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return o(i(r(n(t(e)))));case 7:return a(o(i(r(n(t(e))))));case 8:return s(a(o(i(r(n(t(e)))))));case 9:return u(s(a(o(i(r(n(t(e))))))));default:{for(var l=arguments[0],c=1;c<arguments.length;c++)l=arguments[c](l);return l}}}var Ir=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,VN([i],r,!1))}}},WN=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},GC=function(e){return e._tag==="None"},Hh=function(e){return e._tag==="Some"},Ua={_tag:"None"},Ga=function(e){return{_tag:"Some",value:e}},HN=function(e){return e._tag==="Left"},ef=function(e){return{_tag:"Left",left:e}},tf=function(e){return{_tag:"Right",right:e}},KN=function(e){return[e]},YN=function(e){return e.length>0},JN=function(e){return e[0]},XN=function(e){return e.slice(1)},QN=[],ZN={},Kh=Object.prototype.hasOwnProperty,e2=function(e){return WN([e[0]],e.slice(1),!0)},t2=function(e,t){return Ir(2,function(n,r){return t.flatMap(n,function(i){return e.fromEither(r(i))})})};function n2(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(o){return t.ap(i,o)}}),n)}}}function r2(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(o){return t.concat(i,o)}}),r)}}}}function zC(e,t,n){return function(r){for(var i=Array(n.length+1),o=0;o<n.length;o++)i[o]=n[o];return i[n.length]=r,t===0?e.apply(null,i):zC(e,t-1,i)}}function i2(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var o;return o={},o[e[0]]=n,o[e[1]]=r,o[e[2]]=i,o}}};case 4:return function(n){return function(r){return function(i){return function(o){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a[e[3]]=o,a}}}};case 5:return function(n){return function(r){return function(i){return function(o){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=o,s[e[4]]=a,s}}}}};default:return zC(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},o=0;o<t;o++)i[e[o]]=n[o];return i},t-1,[])}}function o2(e){return function(t){for(var n=Object.keys(t),r=n.length,i=i2(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function a2(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function s2(e){var t=r2(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function WC(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var u2=function(e){return function(){return Promise.resolve().then(e)}};function l2(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var nf=function(e,t){return y(e,Jh(t))},Yh=function(e,t){return y(e,c2(t))},Jh=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},c2=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},$u=function(e){return function(){return Promise.resolve(e)}},Xh=Ir(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),Ou="Task",rf={URI:Ou,map:nf},Qh={URI:Ou,of:$u},f2={URI:Ou,map:nf,ap:Yh},Zh={URI:Ou,map:nf,of:$u,ap:Yh,chain:Xh},d2=_r,uy=Xh,ic={URI:Ou,map:nf,of:$u,ap:Yh,chain:Xh,fromIO:u2,fromTask:d2};function HC(e){return function(t){return function(n){return e.fromEither(GC(n)?ef(t()):tf(n.value))}}}function p2(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?tf(o):ef(r(o)))})}}}var Xr=ef,Lo=tf,KC=function(e,t){return y(e,v2(t))},h2=function(e,t){return y(e,g2(t))},ev="Either",v2=function(e){return function(t){return Li(t)?t:Lo(e(t.right))}},m2={URI:ev,map:KC},y2=function(e){return function(t){return Li(t)?t:Li(e)?e:Lo(t.right(e.right))}},g2=y2,b2={URI:ev,map:KC,ap:h2},S2=function(e){return function(t){return Li(t)?Xr(e(t.left)):t}},YC={URI:ev,fromEither:_r},C2=HC(YC),Li=HN,w2=function(e,t){return function(n){return Li(n)?e(n.left):t(n.right)}},ao=w2;YC.fromEither;var x2=function(e){return Li(e)?Lo(e.left):Xr(e.right)},T2=function(e,t){try{return Lo(e())}catch(n){return Xr(t(n))}},An=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},Sn=function(e){return An(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},ly=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return An(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},tv={equals:function(e,t){return e===t}};tv.equals;var E2=function(e){return function(t,n){return t===n||e(t,n)===0}},za=function(e){return{equals:E2(e),compare:function(t,n){return t===n?0:e(t,n)}}},Qs=function(e){return za(function(t,n){return e.compare(n,t)})},ni=function(e){return function(t){return za(function(n,r){return t.compare(e(n),e(r))})}},I2=function(){return{concat:function(e,t){return za(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},nv=function(){return{concat:I2().concat,empty:za(function(){return 0})}},A2={equals:GN,compare:Ba(0)},$2=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function O2(e,t){return e<t?-1:e>t?1:0}var D2={equals:tv.equals,compare:O2},N2=D2,P2=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}},R2=function(e){return{concat:$2(e)}},k2=function(e){return{concat:function(){return e}}},M2=P2,j2=k2(void 0),_2=R2,cy=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},q2=QN,JC=YN,F2=function(e,t){return e<0||e>=t.length},L2=function(e){return function(t){return cy(cy([],t,!0),[e],!1)}},V2=L2,B2=function(e,t,n){if(n[e]===t)return n;var r=e2(n);return r[e]=t,r},U2=function(e){return function(t){if(t.length===1)return t;for(var n=[QC(t)],r=K2(t),i=function(u){n.every(function(l){return!e.equals(l,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},G2=function(e){if(JC(e)){var t=nv();return z2(e.reduce(t.concat,t.empty))}return _r},XC=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);Kh.call(n,a)?n[a].push(o):n[a]=[o]}return n}},z2=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},W2=KN,H2=JN,QC=H2,K2=XN,of={equals:function(e,t){return e===t}},af={equals:of.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};of.equals,af.compare;globalThis&&globalThis.__spreadArray;var oc=function(e){return e.length===0},Wa=JC,ZC=V2,rv=function(e){return GC(e)?uf:[e.value]},Y2=function(e){return function(t){if(oc(t))return uf;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},iv=F2;function np(e,t){return t===void 0?function(n){return np(e,n)}:iv(e,t)?Ua:Ga(t[e])}var J2=function(e){return function(t){return iv(e,t)?t:e===0?uf:t.slice(0,e)}},ew=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Ga(n);return Ua}};function Pt(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Ga(t[n]);return Ua}}var X2=function(e,t){return function(n){return iv(e,n)?Ua:Ga(rP(e,t(n[e]),n))}},sf=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}};function ov(e){return function(t,n){if(n===void 0){var r=ov(e);return function(a){return r(t,a)}}for(var i=function(a){return e.equals(a,t)},o=0;o<n.length;o++)if(i(n[o]))return!0;return!1}}var fa=function(e){var t=U2(e);return function(n){return Wa(n)?t(n):n}},Q2=function(e){var t=G2(e);return function(n){return Wa(n)?t(n):n}},Z2=function(e){return function(t){return oc(t)?e:oc(e)?t:t.concat(e)}},Re=Z2;function tw(e){var t=ov(e);return function(n,r){if(r===void 0){var i=tw(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var eP=W2,nw=Ir(2,function(e,t){return y(e,Y2(function(n,r){return t(r,n)}))}),Ha=nw(_r),z=function(e){return function(t){return t.map(function(n){return e(n)})}},Vt=function(e){return function(t){return t.filter(e)}},tP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Hh(i)&&n.push(i.value)}return n}},Vo=function(e){return tP(function(t,n){return e(n)})},qn=Vo(_r),rp=function(e,t){return nP(e,function(n,r,i){return t(r,i)})},nP=function(e,t){return function(n){for(var r=n.length,i=e,o=0;o<r;o++)i=t(o,i,n[o]);return i}},Yi=function(e){return An(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},rP=function(e,t,n){return Wa(n)?B2(e,t,n):n},ip=function(e){return e.slice()},fy=function(e){return oc(e)?uf:e.slice()},uf=q2,rw=nw,iP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}};function to(e){return Pt(e)}var Nl=function(e){return function(t){return t.map(function(n){return e(n)})}},oP=Ir(2,function(e,t){return y(e,iP(function(n,r){return t(r,n)}))}),aP=oP(_r),sP=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Hh(i)&&n.push(i.value)}return n}},mi=function(e){return sP(function(t,n){return e(n)})},uP=function(e){return function(t){return t.filter(e)}},iw=function(e){return function(t){return Ln(e,t)}},lP=function(e){return function(t){return function(n){return t(n)&&e(n)}}},me=Ua,De=Ga;function Du(e){return function(t){return e(t)?De(t):me}}var cP=function(e){return e._tag==="Left"?me:De(e.right)},ow=function(e,t){return y(e,K(t))},aw=function(e,t){return y(e,fP(t))},sw="Option",Ji=function(e){return{equals:function(t,n){return t===n||(lr(t)?lr(n):lr(n)?!1:e.equals(t.value,n.value))}}},uw=function(e){return{equals:Ji(e).equals,compare:function(t,n){return t===n?0:Ai(t)?Ai(n)?e.compare(t.value,n.value):1:-1}}},K=function(e){return function(t){return lr(t)?me:De(e(t.value))}},Ni=De,fP=function(e){return function(t){return lr(t)||lr(e)?me:De(t.value(e.value))}},dP={URI:sw,map:ow,ap:aw,of:Ni},av=Ir(2,function(e,t){return lr(e)?me:t(e.value)}),pP={URI:sw,map:ow,ap:aw,chain:av},lw=Ir(2,function(e,t){return lr(e)?t():e}),op=lw,hP=av(_r),Mt=function(e){return function(t){return lr(t)?me:e(t.value)?t:me}},vP=cP,Ai=Hh,lr=function(e){return e._tag==="None"},mP=function(e,t){return function(n){return lr(n)?e():t(n.value)}},ri=mP,cw=ri,yP=function(e){return function(t){return lr(t)?e():t.value}},Qe=yP,ap=hP,gP=Ir(2,WC(pP)),ye=function(e){return e==null?me:De(e)},bP=function(e){try{return De(e())}catch{return me}},SP=function(e){return function(t){return lr(t)?me:ye(e(t.value))}},Mn=ri(zN,_r),Et=ri(UC,_r),Fn=av,CP=gP,wP=s2(dP);function xP(e){return Ln(Lo,e.of)}function TP(e){return Ln(Xr,e.of)}function EP(e){return a2(e,m2)}function IP(e){return n2(e,b2)}function AP(e){return function(t,n){return e.chain(t,function(r){return Li(r)?e.of(r):n(r.right)})}}function $P(e){return function(t,n){return e.map(t,S2(n))}}function OP(e){return function(t,n){return function(r){return e.map(r,ao(t,n))}}}function DP(e){return function(t){return function(n){return e.chain(n,function(r){return Li(r)?t(r.left):e.of(r)})}}}function NP(e){return function(t){return e.map(t,x2)}}var PP=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},RP=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Pi=TP(Qh),Ka=xP(Qh),kP=$u,MP=function(e){return Jh(C2(e))},ac=OP(rf),dy=function(e,t){return function(){return PP(void 0,void 0,void 0,function(){var n;return RP(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(tf)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,ef(t(n))];case 3:return[2]}})})}},fw=DP(Zh),py=NP(rf),dw=function(e,t){return y(e,Ht(t))},pw=function(e,t){return y(e,_P(t))},Ht=EP(rf),jP=Ir(2,$P(rf)),wr=jP,_P=IP(f2),sv=Ir(2,AP(Zh)),da=Ka,uv="TaskEither",qP={URI:uv,map:dw,ap:pw,of:da},hw={URI:uv,map:dw,ap:pw,chain:sv},lv={URI:uv,fromEither:kP},FP=Ir(2,WC(hw)),cv=HC(lv),LP={fromEither:lv.fromEither},VP={flatMap:sv},BP=t2(LP,VP),UP=BP,sp=p2(lv,hw),GP=da(ZN),Sr=sv,zP=FP;function WP(e){return t=>y(t,Ht(n=>(e(n)(),n)))}const Zs=WP;function eu(e){return t=>y(t,py,Zs(e),py)}function HP(e){return t=>y(t,Zs(n=>()=>e(n)()),eu(n=>()=>e(n)()))}function KP(e){return t=>y(t,K(n=>(e(n)(),n)))}const YP=KP;function JP(e){return Ln(De,e.of)}function XP(e){return Ba(e.of(me))}function QP(e){var t=XP(e);return function(n,r){return e.chain(n,ri(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var ZP=JP(Qh),eR=$u,tR=Jh(vP),nR=Ir(2,QP(Zh)),rR=nR,fv=function(e){return M2(e)(e.empty)};j2.concat;var iR=UN,ot={equals:function(e,t){return e===t}},tu={equals:ot.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},oR=function(e,t){return function(n){return n.replace(e,t)}},aR=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function dv(e){if(typeof e=="function")return dv(tu)(e);var t=aR(e);return function(n){return function(r){for(var i=[],o=0,a=t(r);o<a.length;o++){var s=a[o];i.push(n(s,r[s]))}return i}}}function vw(e){return function(t,n){if(n===void 0){var r=vw(e);return function(o){return r(o,t)}}for(var i in t)if(!Kh.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function mw(e,t){return t===void 0?function(n){return mw(e,n)}:Kh.call(t,e)?Ga(t[e]):Ua}var sR=function(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];t[i[0]]=i[1]}return t};function yw(e){var t=vw(e);return An(function(n,r){return t(n)(r)&&t(r)(n)})}function uR(e){return An((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var pv={equals:function(e,t){return e===t}},gw={equals:pv.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};function lR(e){const t=parseFloat(e);return isNaN(t)?me:De(t)}const _n=Symbol.for("@ts-pattern/matcher"),bw=Symbol.for("@ts-pattern/isVariadic"),sc="@ts-pattern/anonymous-select-key",up=e=>!!(e&&typeof e=="object"),Pl=e=>e&&!!e[_n],gn=(e,t,n)=>{if(Pl(e)){const r=e[_n](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(up(e)){if(!up(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let r=[],i=[],o=[];for(const a of e.keys()){const s=e[a];Pl(s)&&s[bw]?o.push(s):o.length?i.push(s):r.push(s)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<r.length+i.length)return!1;const a=t.slice(0,r.length),s=i.length===0?[]:t.slice(-i.length),u=t.slice(r.length,i.length===0?1/0:-i.length);return r.every((l,c)=>gn(l,a[c],n))&&i.every((l,c)=>gn(l,s[c],n))&&(o.length===0||gn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>gn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||Pl(o=i)&&o[_n]().matcherType==="optional")&&gn(i,t[r],n);var o})}return Object.is(t,e)},Xn=e=>{var t,n,r;return up(e)?Pl(e)?(t=(n=(r=e[_n]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?nu(e,Xn):nu(Object.values(e),Xn):[]},nu=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function cR(...e){if(e.length===1){const[t]=e;return n=>gn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return gn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function En(e){return Object.assign(e,{optional:()=>hv(e),and:t=>Tt(e,t),or:t=>Sw(e,t),select:t=>t===void 0?ru(e):ru(t,e)})}function lp(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[bw]:!0})}}))(e),{optional:()=>lp(hv(e)),select:t=>lp(t===void 0?ru(e):ru(t,e))})}function hv(e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Xn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:gn(e,t,r),selections:n}},getSelectionKeys:()=>Xn(e),matcherType:"optional"})})}const fR=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},dR=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function Tt(...e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>gn(i,t,r)),selections:n}},getSelectionKeys:()=>nu(e,Xn),matcherType:"and"})})}function Sw(...e){return En({[_n]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return nu(e,Xn).forEach(i=>r(i,void 0)),{matched:e.some(i=>gn(i,t,r)),selections:n}},getSelectionKeys:()=>nu(e,Xn),matcherType:"or"})})}function et(e){return{[_n]:()=>({match:t=>({matched:!!e(t)})})}}function ru(...e){const t=typeof e[0]=="string"?e[0]:void 0,n=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return En({[_n]:()=>({match:r=>{let i={[t??sc]:r};return{matched:n===void 0||gn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??sc].concat(n===void 0?[]:Xn(n))})})}function Or(e){return typeof e=="number"}function so(e){return typeof e=="string"}function Si(e){return typeof e=="bigint"}const Cw=En(et(function(e){return!0})),pR=Cw,uo=e=>Object.assign(En(e),{startsWith:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.startsWith(n)))));var n},endsWith:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.endsWith(n)))));var n},minLength:t=>uo(Tt(e,(n=>et(r=>so(r)&&r.length>=n))(t))),maxLength:t=>uo(Tt(e,(n=>et(r=>so(r)&&r.length<=n))(t))),includes:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&r.includes(n)))));var n},regex:t=>{return uo(Tt(e,(n=t,et(r=>so(r)&&!!r.match(n)))));var n}}),hR=uo(et(so)),Dr=e=>Object.assign(En(e),{between:(t,n)=>Dr(Tt(e,((r,i)=>et(o=>Or(o)&&r<=o&&i>=o))(t,n))),lt:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r<n))(t))),gt:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r>n))(t))),lte:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r<=n))(t))),gte:t=>Dr(Tt(e,(n=>et(r=>Or(r)&&r>=n))(t))),int:()=>Dr(Tt(e,et(t=>Or(t)&&Number.isInteger(t)))),finite:()=>Dr(Tt(e,et(t=>Or(t)&&Number.isFinite(t)))),positive:()=>Dr(Tt(e,et(t=>Or(t)&&t>0))),negative:()=>Dr(Tt(e,et(t=>Or(t)&&t<0)))}),vR=Dr(et(Or)),Ci=e=>Object.assign(En(e),{between:(t,n)=>Ci(Tt(e,((r,i)=>et(o=>Si(o)&&r<=o&&i>=o))(t,n))),lt:t=>Ci(Tt(e,(n=>et(r=>Si(r)&&r<n))(t))),gt:t=>Ci(Tt(e,(n=>et(r=>Si(r)&&r>n))(t))),lte:t=>Ci(Tt(e,(n=>et(r=>Si(r)&&r<=n))(t))),gte:t=>Ci(Tt(e,(n=>et(r=>Si(r)&&r>=n))(t))),positive:()=>Ci(Tt(e,et(t=>Si(t)&&t>0))),negative:()=>Ci(Tt(e,et(t=>Si(t)&&t<0)))}),mR=Ci(et(Si)),yR=En(et(function(e){return typeof e=="boolean"})),gR=En(et(function(e){return typeof e=="symbol"})),bR=En(et(function(e){return e==null}));var qe={__proto__:null,matcher:_n,optional:hv,array:function(...e){return lp({[_n]:()=>({match:t=>{if(!Array.isArray(t))return{matched:!1};if(e.length===0)return{matched:!0};const n=e[0];let r={};if(t.length===0)return Xn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>gn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Xn(e[0])})})},set:function(...e){return En({[_n]:()=>({match:t=>{if(!(t instanceof Set))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};if(e.length===0)return{matched:!0};const r=(o,a)=>{n[o]=(n[o]||[]).concat([a])},i=e[0];return{matched:fR(t,o=>gn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Xn(e[0])})})},map:function(...e){return En({[_n]:()=>({match:t=>{if(!(t instanceof Map))return{matched:!1};let n={};if(t.size===0)return{matched:!0,selections:n};const r=(s,u)=>{n[s]=(n[s]||[]).concat([u])};if(e.length===0)return{matched:!0};var i;if(e.length===1)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${(i=e[0])==null?void 0:i.toString()}`);const[o,a]=e;return{matched:dR(t,(s,u)=>{const l=gn(o,u,r),c=gn(a,s,r);return l&&c}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Xn(e[0]),...Xn(e[1])]})})},intersection:Tt,union:Sw,not:function(e){return En({[_n]:()=>({match:t=>({matched:!gn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:et,select:ru,any:Cw,_:pR,string:hR,number:vR,bigint:mR,boolean:yR,symbol:gR,nullish:bR,instanceOf:function(e){return En(et(function(t){return n=>n instanceof t}(e)))},shape:function(e){return En(et(cR(e)))}};const cp={matched:!1,value:void 0};function H(e){return new SR(e,cp)}let SR=class fp{constructor(t,n){this.input=void 0,this.state=void 0,this.input=t,this.state=n}with(...t){if(this.state.matched)return this;const n=t[t.length-1],r=[t[0]];let i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,a={};const s=(l,c)=>{o=!0,a[l]=c},u=!r.some(l=>gn(l,this.input,s))||i&&!i(this.input)?cp:{matched:!0,value:n(o?sc in a?a[sc]:a:this.input,this.input)};return new fp(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new fp(this.input,r?{matched:!0,value:n(this.input,this.input)}:cp)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input)}catch{t=this.input}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}};var CR=Object.getOwnPropertyNames,wR=Object.getOwnPropertySymbols,xR=Object.prototype.hasOwnProperty;function hy(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function el(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);var o=i.cache,a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i);return o.delete(n),o.delete(r),u}}function vy(e){return CR(e).concat(wR(e))}var ww=Object.hasOwn||function(e,t){return xR.call(e,t)};function Ya(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var xw="_owner",my=Object.getOwnPropertyDescriptor,yy=Object.keys;function TR(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function ER(e,t){return Ya(e.getTime(),t.getTime())}function gy(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var u=t.entries(),l=!1,c=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],h=f[1],p=s.value,v=p[0],g=p[1];!l&&!r[c]&&(l=n.equals(d,v,o,c,e,t,n)&&n.equals(h,g,d,v,e,t,n))&&(r[c]=!0),c++}if(!l)return!1;o++}return!0}function IR(e,t,n){var r=yy(e),i=r.length;if(yy(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===xw&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!ww(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function vs(e,t,n){var r=vy(e),i=r.length;if(vy(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===xw&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!ww(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=my(e,o),s=my(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function AR(e,t){return Ya(e.valueOf(),t.valueOf())}function $R(e,t){return e.source===t.source&&e.flags===t.flags}function by(e,t,n){if(e.size!==t.size)return!1;for(var r={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),u=!1,l=0;(a=s.next())&&!a.done;)!u&&!r[l]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[l]=!0),l++;if(!u)return!1}return!0}function OR(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var DR="[object Arguments]",NR="[object Boolean]",PR="[object Date]",RR="[object Map]",kR="[object Number]",MR="[object Object]",jR="[object RegExp]",_R="[object Set]",qR="[object String]",FR=Array.isArray,Sy=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Cy=Object.assign,LR=Object.prototype.toString.call.bind(Object.prototype.toString);function VR(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,u=e.areTypedArraysEqual;return function(c,f,d){if(c===f)return!0;if(c==null||f==null||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;var h=c.constructor;if(h!==f.constructor)return!1;if(h===Object)return i(c,f,d);if(FR(c))return t(c,f,d);if(Sy!=null&&Sy(c))return u(c,f,d);if(h===Date)return n(c,f,d);if(h===RegExp)return a(c,f,d);if(h===Map)return r(c,f,d);if(h===Set)return s(c,f,d);var p=LR(c);return p===PR?n(c,f,d):p===jR?a(c,f,d):p===RR?r(c,f,d):p===_R?s(c,f,d):p===MR?typeof c.then!="function"&&typeof f.then!="function"&&i(c,f,d):p===DR?i(c,f,d):p===NR||p===kR||p===qR?o(c,f,d):!1}}function BR(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?vs:TR,areDatesEqual:ER,areMapsEqual:r?hy(gy,vs):gy,areObjectsEqual:r?vs:IR,arePrimitiveWrappersEqual:AR,areRegExpsEqual:$R,areSetsEqual:r?hy(by,vs):by,areTypedArraysEqual:r?vs:OR};if(n&&(i=Cy({},i,n(i))),t){var o=el(i.areArraysEqual),a=el(i.areMapsEqual),s=el(i.areObjectsEqual),u=el(i.areSetsEqual);i=Cy({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function UR(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function GR(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,l){var c=r(),f=c.cache,d=f===void 0?t?new WeakMap:void 0:f,h=c.meta;return n(u,l,{cache:d,equals:i,meta:h,strict:o})};if(t)return function(u,l){return n(u,l,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(u,l){return n(u,l,a)}}var zR=Xi();Xi({strict:!0});Xi({circular:!0});Xi({circular:!0,strict:!0});Xi({createInternalComparator:function(){return Ya}});Xi({strict:!0,createInternalComparator:function(){return Ya}});Xi({circular:!0,createInternalComparator:function(){return Ya}});Xi({circular:!0,createInternalComparator:function(){return Ya},strict:!0});function Xi(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=BR(e),u=VR(s),l=r?r(u):UR(u);return GR({circular:n,comparator:u,createState:i,equals:l,strict:a})}function WR(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function HR(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),WR(e)}var js=y,KR=iR(wP({concat:_2(N2).concat,empty:0}))();function YR(e){return function(t){return t.iterNumber>=e?me:De(0)}}function JR(e,t){return function(n){return js(n,t,K(function(r){return Math.min(e,r)}))}}function XR(e){return function(t){return De(e*Math.pow(2,t.iterNumber))}}var QR={iterNumber:0,cumulativeDelay:0,previousDelay:me};function ZR(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+Qe(function(){return 0})(n),previousDelay:n}}function ek(e,t){var n=ZR(e,t);return js(n.previousDelay,cw(function(){return ic.of(n)},function(r){return l2(r)(ic.of(n))}))}function Ko(e,t,n){var r=function(i){return js(i,t,uy(function(o){return n(o)?js(ek(e,i),uy(function(a){return js(a.previousDelay,cw(function(){return ic.of(o)},function(){return r(a)}))})):ic.of(o)}))};return r(QR)}var iu={};Object.defineProperty(iu,"__esModule",{value:!0});iu.isGuid=vv=iu.guid=void 0;var tk=function(e){e===void 0&&(e=2);for(var t=(Date.now()*3).toString(16),n=new Date().getTimezoneOffset(),r=Number("".concat(n<0?"7":"6").concat(Math.abs(n))).toString(16),i=e*9+3+15,o="",a=0;a<e;a++)o+=wy()+"-";for(o+=r,o+=t;o.length<i;)o+=wy();return o.substring(0,i)},vv=iu.guid=tk,wy=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},nk=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=rk(n[n.length-1]);if(n.length-1!==t)return"Invalid guid, invalid number of blocks";var i=n.concat().slice(0,-1).reduce(function(o,a){return o&&a.length===8&&!a.includes(" ")},!0);return i?!r&&n[n.length-1].length!==18?"Invalid guid, last date block has invalid size":!0:"Invalid guid, one or more random blocks are invalid"};iu.isGuid=nk;var rk=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function mv(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function lf(e){return{equals(t,n){const r=y(ye(t),Qe(()=>[])),i=y(ye(n),Qe(()=>[]));return Yi(e).equals(r,i)}}}const Ja=Sn({localId:ot,componentPath:lf(ot),sharedConfigurationModelId:mv(ot)}),Tw=Sn({localId:ot,configurationModelId:ot}),ik=An((e,t)=>H({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>ok.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>ak.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>sk.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>uk.equals(n.x,n.y)).otherwise(()=>!1)),ok=Sn({type:ot,attributeId:Ja,state:ot,choiceValueId:ot}),ak=Sn({type:ot,attributeId:Ja,state:ot}),sk=Sn({type:ot,attributeId:Ja,state:of}),uk=Sn({type:ot,attributeId:Ja,state:pv});var Ft=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Ft||{}),Ue=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Ue||{}),Rl=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(Rl||{}),vn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(vn||{}),Vi=(e=>(e.Channel="Channel",e.Package="Package",e))(Vi||{}),V=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(V||{}),Ye=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ye||{}),Ge=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ge||{}),Se=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Se||{}),Ri=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Ri||{}),xa=(e=>(e.Always="Always",e.Optional="Optional",e))(xa||{}),pt=(e=>(e.Unknown="Unknown",e.CommunicationError="Local.LowLevelCommunicationError",e.ServiceError="ServiceError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationUnauthorized="ConfigurationUnauthorized",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(pt||{}),Ew=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Ew||{});const lk={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};let ck=class{mapToCreateSessionRequest(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToAttributeRelations(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToConfigurationModelSource(t){return H(t).with({type:Vi.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Vi.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return y(t,ye,K(Ln(z(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),Et)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:y([...t.decisions],Nl(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return y(ye(t),Et)}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath,sharedConfigurationModelId:t.sharedConfigurationModelId}}mapToAllowedInExplain(t){return t==null?null:{rules:this.mapToAllowedRulesInExplain(t.rules)}}mapToAllowedRulesInExplain(t){return H(t).returnType().with({type:vn.all},()=>({type:"AllowedRulesAll"})).with({type:vn.none},()=>({type:"AllowedRulesNone"})).with({type:vn.specific},n=>({type:"AllowedRulesSpecific",rules:y(n.rules,z(this.mapToGlobalConstraintId),ip)})).with(qe.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function fk(e){return t=>sp(n=>n!=null,e)(t)}function dk(){return Ka(Hr())}var Yn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Yn||{}),yo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(yo||{}),mn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(mn||{}),go=(e=>(e.all="all",e.none="none",e.specific="specific",e))(go||{});const wn=Sn({localId:ot,componentPath:lf(ot),sharedConfigurationModel:mv(ot)}),pk=Ji(Yi(Sn({attributeId:wn,decisions:lf(wn)}))),hk=Ji(An((e,t)=>H({x:e,y:t}).returnType().with({x:{type:"all"},y:{type:"all"}},()=>!0).with({x:{type:"none"},y:{type:"none"}},()=>!0).with({x:{type:"specific"},y:{type:"specific"}},({x:n,y:r})=>Yi(Tw).equals(n.rules,r.rules)).otherwise(()=>!1))),vk=Ji(Sn({rules:hk})),mk=Sn({configurationModelSource:An((e,t)=>zR(e,t)),decisionsToRespect:pk,usageRuleParameters:yw(ot),allowedInExplain:vk});var ou=(e=>(e.Channel="Channel",e.Package="Package",e))(ou||{}),ft=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ft||{}),Ie=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ie||{}),Zt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Zt||{}),kt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(kt||{}),Eo=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Eo||{}),Io=(e=>(e.Always="Always",e.Optional="Optional",e))(Io||{});const yk={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Ji(ot).equals(e.state,t.state)},gk={equals(e,t){return Ji(of).equals(e.value,t.value)}},bk={equals(e,t){return Ji(pv).equals(e.value,t.value)}},Sk={equals(e,t){return Ji(ot).equals(e.state,t.state)}},Ck={equals(e,t){return wn.equals(e.attributeId,t.attributeId)?H({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>bk.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>gk.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>Sk.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>yk.equals(r.x,r.y)).otherwise(()=>!1):!1}},wk=Yi(Ck),xk={equals:(e,t)=>wk.equals(e.decisions,t.decisions)&&Tk.equals(e.mode,t.mode)},Tk={equals:(e,t)=>H({x:e,y:t}).with({x:{type:"Default"},y:{type:"Default"}},n=>!0).with({x:{type:"DropExistingDecisions"},y:{type:"DropExistingDecisions"}},n=>!0).otherwise(()=>!1)};var dp=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(dp||{}),ba=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ba||{}),xe=(e=>(e.ServiceError="ServiceError",e.Unknown="Unknown",e.CommunicationError="CommunicationError",e.ConfigurationConflict="ConfigurationConflict",e.ConfigurationSolutionNotAvailable="ConfigurationSolutionNotAvailable",e.ConfigurationAttributeNotFound="ConfigurationAttributeNotFound",e.ConfigurationChoiceValueNotFound="ConfigurationChoiceValueNotFound",e.ConfigurationUnauthenticated="ConfigurationUnauthenticated",e.ConfigurationApplicationError="ConfigurationApplicationError",e.ConfigurationTimeout="ConfigurationTimeout",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConfigurationRejectedDecisionsConflict="ConfigurationRejectedDecisionsConflict",e.ConfigurationSetManyConflict="ConfigurationSetManyConflict",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.ConfigurationInitializationFailure="ConfigurationInitializationFailure",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(xe||{}),yv=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(yv||{});function Ek(e,t){console.log(`--------------------------------------------------------------------------------
|
|
68
68
|
-- ${t??""}
|
|
69
69
|
--------------------------------------------------------------------------------
|
|
70
|
-
${JSON.stringify(e,null,2)}`)}var js=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(js||{}),Ew=(e=>(e.BooleanAttributeNotFound="BooleanAttributeNotFound",e.ChoiceAttributeNotFound="ChoiceAttributeNotFound",e.ChoiceValueNotFound="ChoiceValueNotFound",e.ConfigurationInitializationFailure="InitializationFailure",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",e.LegacySnapshotInvalid="SnapshotInvalid",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConflictWithConsequence="ConflictWithConsequence",e.DecisionInvalid="DecisionInvalid",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.NumericAttributeNotFound="NumericAttributeNotFound",e.NumericDecisionOutOfRange="NumericDecisionOutOfRange",e.SessionNotFound="SessionNotFound",e.SetDecisionConflict="SetDecisionConflict",e.Unauthorized="Unauthorized",e.AuthenticationFailure="AuthenticationFailure",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(Ew||{});const Ek=e=>Object.values(Ew).includes(e),Ik=e=>Ek(e)?De(e):me;function Ak(e){const t=n=>H(n).with("ConfigurationModelNotFound",()=>({type:xe.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:xe.DecisionsToRespectInvalid})).with(qe.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:xe.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:xe.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:xe.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:xe.ConfigurationConflict,reason:vv.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:xe.ConfigurationConflict})).with(qe.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:xe.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:xe.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:xe.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:xe.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:xe.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return y(e.type,Ik,K(t))}const $k=e=>Object.values(js).includes(e),Ok=e=>$k(e)?De(e):me;function Dk(e){return y(e,Ok,K(n=>H(n).with("Generic::LocalClientError",()=>({type:xe.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:xe.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:xe.CommunicationError})).with("Generic::Unauthorized",()=>({type:xe.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:xe.Unknown})).exhaustive()))}function zr(e,t){Tk(e,t);const n=e.type;return y(me,rp(()=>Ak(e)),rp(()=>Dk(n)),Qe(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:xe.Unknown})))}let Nk=class{constructor(t,n,r,i){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=r,this.options=i}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return y(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),Sr(r=>zr(r,"ClientSideSessionLifetimeHandler - create")),gr(r=>this.restToDomainMapper.mapToSessionId(r)),ck(()=>({type:xe.ConfigurationUnauthenticated})))}close(t){return y(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),Sr(n=>zr(n,"ClientSideSessionLifetimeHandler - close")),Ht(()=>Gr()))}};var Iw=(e=>(e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e))(Iw||{});function Lr(e,t,n){const r=y(Array.isArray(e)?e:[e],WR);return y(fy(()=>fetch(r,t),i=>({type:"error"})),gr(i=>y(fy(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),cw(i=>i.status===401?Ni({type:js.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Ka({response:i,data:{}}):i.type==="error"?Ni({type:js.LowLevelCommunicationError}):Ni({type:js.UnhandledResponseStatus})),gr(i=>y(n(i),uv(()=>i.data))))}function fp(e,t){return Lr(e,t,n=>{if(n.response.status===200)return Di(n.data);if(n.response.status===409){const r=n.data;return H(r).with({type:"ConfigurationModelInvalid"},i=>Di(r)).with({type:"ConfigurationModelNotFeasible"},i=>Di(r)).otherwise(()=>me)}return me})}let Pk=class{constructor(t){this.baseUrl=t}createSessionUsingApiKey(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(t)};return fp([this.baseUrl,"v2/session"],r)}createSessionUsingJwtBearer(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(t)};return fp([this.baseUrl,"v2/session"],r)}setMany(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Lr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?De(i.data):me)}makeDecision(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Lr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?De(i.data):me)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Lr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?De(r.data):me)}getWhyStateNotPossible(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Lr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?De(i.data):me)}getWhyNotSatisfied(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Lr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?De(i.data):me)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Lr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?De(r.data):me)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return Lr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?De({}):me)}};var Ao=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ao||{}),dp=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(dp||{}),pp=(e=>(e.Always="Always",e.Optional="Optional",e))(pp||{}),ou=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(ou||{}),Yr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Yr||{}),Gn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Gn||{}),hp=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(hp||{}),vp=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(vp||{}),Es=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Es||{});const Bn=Sn({localId:ot,componentPath:uf(ot),sharedConfigurationModelId:hv(ot)});let Aw=class{mapToDecisions(t){return{}}mapToSessionId(t){return H(t).with({sessionId:qe.string},n=>Ka(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=y(n.constraintExplanations,z(i=>this.mapToConstraintExplanation(i)));return Ni({type:xe.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Ni({type:xe.ConfigurationModelInvalid})).otherwise(()=>Ni({type:xe.Unknown}))}mapToExplainAnswer(t,n){const r=H(n).with({question:Yn.whyIsStateNotPossible,subject:mn.boolean},a=>[{type:Ie.Boolean,attributeId:a.attributeId,value:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.numeric},a=>[{type:Ie.Numeric,attributeId:a.attributeId,value:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.component},a=>[{type:Ie.Component,attributeId:a.attributeId,state:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.choiceValue},a=>[{type:Ie.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:De(a.state)}]).otherwise(()=>[]),i=y(t.decisionExplanations,z(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=y(t.constraintExplanations,z(a=>this.mapToConstraintExplanation(a)));return H(n).with({answerType:yo.decisions},()=>({decisionExplanations:i})).with({answerType:yo.constraints},()=>({constraintExplanations:o})).with({answerType:yo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:xe.ConfigurationSetManyConflict,decisionExplanations:y(t.decisionExplanations,z(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:y(t.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const r=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:r}}mapToBooleanDecision(t){return{type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ye(t.state)}}mapToNumericDecision(t){return{type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ye(t.state)}}mapToComponentDecision(t){return{type:Ie.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return y(this.mapToDecisionState(t.state),K(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:y(t.causedByRules,z(n=>this.mapToRuleConstraint(n))),causedByCardinalities:y(t.causedByCardinalities,z(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:ba.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:ba.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=y(t.booleanDecisions??[],z(a=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),r=y(t.numericDecisions??[],z(a=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),i=y(t.componentDecisions??[],z(a=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:y(ye(a.state),K(s=>this.mapToDecisionState(s)),ip)}))),o=y(t.choiceDecisions??[],z(a=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:y(ye(a.state),K(s=>this.mapToDecisionState(s)),ip)})));return y([],Re(n),Re(r),Re(i),Re(o))}mapToDecisionExplanation(t,n,r){const i=y(t.causedByBooleanDecisions,z(p=>this.mapToCausedByBooleanDecision(p))),o=y(t.causedByNumericDecisions,z(p=>this.mapToCausedByNumericDecision(p))),a=y(t.causedByComponentDecisions,z(p=>this.mapToCausedByComponentDecision(p))),s=y(t.causedByChoiceDecisions,z(p=>this.mapToCausedByChoiceValueDecision(p))),u=y(i,z(p=>({type:Ie.Boolean,attributeId:p.attributeId,value:me}))),l=y(o,z(p=>({type:Ie.Numeric,attributeId:p.attributeId,value:me}))),c=y(a,z(p=>({type:Ie.Component,attributeId:p.attributeId,state:me}))),f=y(s,z(p=>({type:Ie.ChoiceValue,attributeId:p.attributeId,choiceValueId:p.choiceValueId,state:me}))),d=y([],Re(u),Re(l),Re(c),Re(f)),h=ew(An((p,v)=>{const g=wn.equals(p.attributeId,v.attributeId);return H({a:p,b:v}).with({a:{type:Ie.ChoiceValue},b:{type:Ie.ChoiceValue}},C=>g&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>g)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:y([],Re(d),Re(h)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return H(t).with(hp.NotAvailable,()=>cp.NotAvailable).with(hp.StateNotPossible,()=>cp.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Ie.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function r(d){return y(n.canAttributeContributeToConfigurationSatisfaction,Pt(h=>Bn.equals(h,d)),Ii)}const i=y([],Re(y(t.choiceValueDecisions,z(d=>d.attributeId))),Re(y(n.choiceConsequences,z(d=>d.attributeId))),fa(Bn)),o=y(i,z(d=>{const h=y(t.choiceValueDecisions??[],sP(v=>Bn.equals(v.attributeId,d))),p=y(n.choiceConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToChoiceAttributes(v,h,r(d))))}),qn),a=y([],Re(y(t.numericDecisions,z(d=>d.attributeId))),Re(y(n.numericConsequences,z(d=>d.attributeId))),fa(Bn)),s=y(a,z(d=>{const h=y(t.numericDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.numericConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToNumericAttribute(v,h,r(d))))}),qn),u=y([],Re(y(t.booleanDecisions,z(d=>d.attributeId))),Re(y(n.booleanConsequences,z(d=>d.attributeId))),fa(Bn)),l=y(u,z(d=>{const h=y(t.booleanDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.booleanConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToBooleanAttribute(v,h,r(d))))}),qn),c=y([],Re(y(t.componentDecisions,z(d=>d.attributeId))),Re(y(n.componentConsequences,z(d=>d.attributeId))),fa(Bn)),f=y(c,z(d=>{const h=y(t.componentDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.componentConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToComponentAttribute(v,h,r(d))))}),qn);return y([],Re(o),Re(f),Re(s),Re(l))}mapToComponentAttribute(t,n,r){return{type:ft.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:y(t.possibleDecisionStates,Dl(i=>this.mapToPossibleDecisionState(i))),decision:y(n,Fn(i=>y(this.mapToDecisionState(i.state),K(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:y(t.selection,ye,K(i=>this.mapToSelection(i)),Et),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=y(t.values,Dl(o=>{const a=y(n,Pt(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ft.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ft.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:y(n,Fn(i=>y(i.state,ye,K(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ft.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:y(n,Fn(i=>y(i.state,ye,K(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=y(t.possibleDecisionStates,Dl(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:y(n,Fn(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return H(t).with(ou.Implicit,()=>kt.Implicit).with(ou.Explicit,()=>kt.Explicit).exhaustive()}mapToDecisionState(t){return H(t).with(Yr.Included,()=>De(Zt.Included)).with(Yr.Excluded,()=>De(Zt.Excluded)).with(Yr.Undefined,()=>me).exhaustive()}mapToPossibleDecisionState(t){return H(t).with(Ao.Included,()=>Zt.Included).with(Ao.Excluded,()=>Zt.Excluded).exhaustive()}mapToSelection(t){return H(t).with(dp.Mandatory,()=>Eo.Mandatory).with(dp.Optional,()=>Eo.Optional).exhaustive()}mapToInclusion(t){return H(t).with(pp.Always,()=>Io.Always).with(pp.Optional,()=>Io.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Rk=class{constructor(t,n){this.restToDomainMapper=new Aw,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=fp(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return y(r,Sr(i=>zr(i,"ServerSideSessionLifetimeHandler - create")),gr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return y(Lr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Iw.NoContent?De({}):me),Sr(n=>zr(n,"ServerSideSessionLifetimeHandler - close")),Ht(Gr))}};const $w={whyIsNotSatisfied:{configuration:{question:Ft.whyIsNotSatisfied,subject:Ue.configuration},attribute:e=>({question:Ft.whyIsNotSatisfied,subject:Ue.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Ft.whyIsStateNotPossible,subject:Ue.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.component,attributeId:e,state:t})})}};let kk=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=me}setOnConfigurationChangedHandler(t){const n=y(t,ye,K(r=>i=>{const o=this.domainToContractMapper.mapToConfiguration(i);r(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await y(this.inner.setSessionContext(n),Ht(Gr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await y(this.inner.restoreConfiguration(n),Ht(Gr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await y(this.inner.makeDecision(n),Ht(Gr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await y(this.inner.setMany(r,i),Ht(Gr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await y(this.inner.applySolution(n),Ht(Gr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t($w):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await y(this.inner.explain(i),Ht(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await y(this.inner.close(),Sr(t=>this.domainToContractMapper.mapToFailureResult(t)),oc(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Ln(Sr(t=>this.domainToContractMapper.mapToFailureResult(t)),oc(t=>Promise.reject(t),t=>Promise.resolve(t)))}},Mk=class{mapToExplainQuestion(t,n){const r={answerType:H(n).with("decisions",()=>yo.decisions).with("constraints",()=>yo.constraints).with("full",()=>yo.all).exhaustive()};return H(t).with({question:Ft.whyIsNotSatisfied,subject:Ue.configuration},i=>({...r,question:Yn.whyIsNotSatisfied,subject:mn.configuration})).with({question:Ft.whyIsNotSatisfied,subject:Ue.attribute},i=>({...r,question:Yn.whyIsNotSatisfied,subject:mn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.choiceValue},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.component},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.numeric},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Ft.whyIsStateNotPossible,subject:Ue.boolean},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:y(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return y(t,z(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return H(t).with({type:V.Choice,choiceValueId:qe.string},n=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:V.Numeric},n=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:V.Boolean},n=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:V.Component},n=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(ye(n.state),Fn(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return y(ye(t),K(n=>y(n,z(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:y(r.decisions,z(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return H(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).exhaustive()}mapToConflictHandling(t){return H(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath??[],sharedConfigurationModel:t.sharedConfigurationModelId}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return H(t).with({type:Li.Package},n=>({type:iu.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Li.Channel},n=>({type:iu.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:y(t.decisions,z(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return H(t).with({type:V.Boolean},n=>({type:ft.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:y(n.decision,ye,K(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Numeric},n=>({type:ft.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:y(n.decision,ye,K(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Choice},n=>({type:ft.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:y(n.values,z(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Component},n=>({type:ft.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:y(n.decision,ye,Fn(r=>y(this.mapToDecisionStateOption(r.state),K(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:y(n.possibleDecisionStates,z(r=>this.mapToDecisionStateOption(r)),qn),selection:y(n.selection,ye,K(r=>this.mapToSelection(r)),Et),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:y(t.possibleDecisionStates,z(n=>this.mapToDecisionStateOption(n)),qn)}}mapToChoiceValueDecision(t){return y(t.decision,ye,Fn(n=>y(this.mapToDecisionStateOption(n.state),K(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return H(t).with(Se.Implicit,()=>kt.Implicit).with(Se.Explicit,()=>kt.Explicit).exhaustive()}mapToSelection(t){return H(t).with(Pi.Mandatory,()=>Eo.Mandatory).with(Pi.Optional,()=>Eo.Optional).exhaustive()}mapToInclusion(t){return H(t).with(xa.Always,()=>Io.Always).with(xa.Optional,()=>Io.Optional).exhaustive()}mapToDecisionState(t){return H(t).with(qe.union(Ye.Included,Ge.Included),()=>Zt.Included).with(qe.union(Ye.Excluded,Ge.Excluded),()=>Zt.Excluded).exhaustive()}mapToDecisionStateOption(t){return y(ye(t),K(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return y(t,ye,K(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return y(t,ye,K(n=>H(n).returnType().with({type:vn.all},()=>({type:go.all})).with({type:vn.none},()=>({type:go.none})).with({type:vn.specific},r=>({type:go.specific,rules:y(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()))}},Ow=class{mapToExplainAnswer(t){const n=H(t).with({decisionExplanations:qe.array(qe.any)},i=>y(i.decisionExplanations,z(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=H(t).with({constraintExplanations:qe.array(qe.any)},i=>y(i.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:y(t.causedByCardinalities,z(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:y(t.causedByRules,z(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=y(t.causedByChoiceDecisions,z(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=y(t.causedByComponentDecisions,z(a=>this.mapToCausedByComponentAttributeDecision(a))),i=y(t.causedByNumericDecisions,z(a=>this.mapToCausedByNumericAttributeDecision(a))),o=y(t.causedByBooleanDecisions,z(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:y([],Re(n),Re(r),Re(i),Re(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:y(t.decisions,z(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return H(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return H(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(t.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToFailureResult(t){return H(t).with({type:xe.ConfigurationConflict},n=>({type:pt.ConfigurationConflict,reason:H(n.reason).with(vv.NumericDecisionOutOfRange,()=>Tw.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:xe.ConfigurationApplicationError},()=>({type:pt.ConfigurationApplicationError})).with({type:xe.ConfigurationUnauthenticated},()=>({type:pt.ConfigurationUnauthenticated})).with({type:xe.ConfigurationModelNotFound},()=>({type:pt.ConfigurationModelNotFound})).with({type:xe.ConfigurationTimeout},()=>({type:pt.ConfigurationTimeout})).with({type:xe.ConfigurationAttributeNotFound},()=>({type:pt.ConfigurationAttributeNotFound})).with({type:xe.ConfigurationChoiceValueNotFound},()=>({type:pt.ConfigurationChoiceValueNotFound})).with({type:xe.ConfigurationSolutionNotAvailable},()=>({type:pt.ConfigurationSolutionNotAvailable})).with({type:xe.ConfigurationRejectedDecisionsConflict},n=>{const r=y(n.rejectedDecisions,z(i=>this.mapToExplicitDecision(i)));return uk.createConfigurationRejectedDecisionsConflict(r)}).with({type:xe.DecisionsToRespectInvalid},()=>({type:pt.DecisionsToRespectInvalid})).with({type:xe.ServiceError},()=>({type:pt.ServiceError})).with({type:xe.CommunicationError},()=>({type:pt.CommunicationError})).with({type:xe.Unknown},()=>({type:pt.Unknown})).with({type:xe.ConfigurationModelInvalid},()=>({type:pt.ConfigurationModelInvalid})).with({type:xe.ConfigurationInitializationFailure},()=>({type:pt.ConfigurationInitializationFailure})).with({type:xe.ConfigurationModelNotFeasible},n=>({type:pt.ConfigurationModelNotFeasible,constraintExplanations:y(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:xe.ConfigurationSetManyConflict},n=>({type:pt.ConfigurationSetManyConflict,decisionExplanations:y(n.decisionExplanations,z(r=>this.mapToDecisionExplanation(r))),constraintExplanations:y(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:xe.SpecifiedDeploymentForbidden},n=>({type:pt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:y(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return y(t,K(Ln(z(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:y(n.decisions,z(r=>this.mapToGlobalAttributeId(r)))})))),Mn)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return H(t).with({type:iu.Package},n=>({type:Li.Package,configurationModelPackage:n.configurationModelPackage})).with({type:iu.Channel},n=>({type:Li.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>({type:V.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.state,K(r=>this.mapToChoiceValueDecisionState(r)),Et),choiceValueId:n.choiceValueId})).with({type:Ie.Component},n=>({type:V.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.state,K(r=>this.mapToComponentDecisionState(r)),Et)})).with({type:Ie.Numeric},n=>({type:V.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).with({type:Ie.Boolean},n=>({type:V.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).exhaustive()}mapToCardinality(t){return H(t).with(ba.Cardinality,()=>Pl.Cardinality).with(ba.Component,()=>Pl.Component).with(ba.Rule,()=>Pl.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Ie.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Ie.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Ie.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:V.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:V.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:V.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:V.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return H(t).with(Eo.Mandatory,()=>Pi.Mandatory).with(Eo.Optional,()=>Pi.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return H(t).with({type:ft.Boolean},r=>({...n,type:V.Boolean,decision:y(r.decision,K(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Mn),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ft.Numeric},r=>({...n,type:V.Numeric,decision:y(r.decision,K(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Mn),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ft.Choice},r=>({...n,type:V.Choice,cardinality:r.cardinality,values:y(r.values,z(i=>{const o=y(i.decision,K(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),Mn);return{id:i.choiceValueId,possibleDecisionStates:y(i.possibleDecisionStates,z(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ft.Component},r=>({...n,type:V.Component,decision:y(r.decision,K(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),Mn),possibleDecisionStates:y(r.possibleDecisionStates,z(i=>this.mapToComponentDecisionState(i))),selection:y(r.selection,ye,K(i=>this.mapToSelection(i)),Et),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return H(t).with(Io.Always,()=>xa.Always).with(Io.Optional,()=>xa.Optional).exhaustive()}mapToComponentDecisionState(t){return H(t).with(Zt.Included,()=>Ge.Included).with(Zt.Excluded,()=>Ge.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return H(t).with(Zt.Included,()=>Ye.Included).with(Zt.Excluded,()=>Ye.Excluded).exhaustive()}mapToDecisionKind(t){return H(t).with(kt.Explicit,()=>Se.Explicit).with(kt.Implicit,()=>Se.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return y(t,K(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),Mn)}mapToAllowedRulesInExplain(t){return y(t,K(n=>H(n).returnType().with({type:go.all},()=>({type:vn.all})).with({type:go.none},()=>({type:vn.none})).with({type:go.specific},r=>({type:vn.specific,rules:y(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()),Mn)}},jk=class{constructor(t,n){this.contractToDomainMapper=new Mk,this.domainToContractMapper=new Ow,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await y(this.sessionHandler.recreate(n),Ht(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new kk(i,this.contractToDomainMapper,this.domainToContractMapper)}),oc(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:me,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function Dw(e){return e.possibleDecisionStates.some(t=>t===Ye.Included)}function _k(e){return!Dw(e)}function qk(e){return H(e).with({type:V.Choice},t=>t.cardinality.lowerBound>0).with({type:V.Boolean},t=>t.selection===Pi.Mandatory).with({type:V.Numeric},t=>t.selection===Pi.Mandatory).with({type:V.Component},t=>t.inclusion===xa.Optional&&t.selection===Pi.Mandatory).exhaustive()}function Fk(e){return H(e).with({type:V.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function Lk(e){return y(e.values,Vt(Dw))}function Vk(e){return y(e.values,Vt(_k))}function Nw(e,t){return y(e.values,Vo(n=>y(n.decision,ye,Mt(r=>r.kind===t))))}function Pw(e){return y(e.values,Vt(t=>y(t.decision,ye,K(n=>n.state===Ye.Included),Qe(()=>!1))))}const Bk=Pw;function Rw(e){return y(e.decision,ye,Mt(t=>t.kind===Se.Explicit),Mn)}function kw(e){return y(e.decision,ye,Mt(t=>t.kind===Se.Explicit),Mn)}function Uk(e,t){return e.possibleDecisionStates.some(n=>n===t)}function Mw(e){return y(e.decision,ye,Mn)}function jw(e){return _w(e,Ge.Included)}function Gk(e){return!jw(e)}function _w(e,t){return e.possibleDecisionStates.some(n=>n===t)}const $n=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:Lk,getBlockedChoiceValues:Vk,getBooleanDecision:kw,getChoiceDecisions:Nw,getComponentDecision:Mw,getIncludedChoiceValues:Pw,getNumericDecision:Rw,getSelectedChoiceValues:Bk,isBooleanValuePossible:Uk,isComponentAllowed:jw,isComponentBlocked:Gk,isComponentStatePossible:_w,isMandatory:qk,isMultiSelect:Fk},Symbol.toStringTag,{value:"Module"})),qw=e=>e.type===V.Boolean,Fw=e=>e.type===V.Choice,Lw=e=>e.type===V.Numeric,Vw=e=>e.type===V.Component,zk=sR(ot),wy=Ki(ot);function Bw(e,t){const n=a=>zk.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return y(n,uP(t?a=>wy.equals(y(a.componentPath??[],Y2(r)),e.componentPath):a=>wy.equals(a.componentPath??[],e.componentPath)))}function Wk(e,t,n){const r=y(Bw({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:y(t.componentPath??[],QC(t.localId))},n),rw(i=>i.id));return y(e,Vt(r))}function Hk(e,t,n){const r=y(Bw({sharedConfigurationModelId:t,componentPath:[]},n),rw(i=>i.id));return y(e,Vt(r))}function Kk(e){return y(e,Vt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function Yk(e,t){return y(Uw(e),z(n=>Nw(n,t)),Ha,Vo(n=>ye(n)))}function Jk(e,t){return y(zw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Rw(n)),Vo(n=>ye(n)))}function Xk(e,t){return y(Ww(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>kw(n)),Vo(n=>ye(n)))}function Qk(e,t){return y(Gw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Mw(n)),Vo(n=>ye(n)))}function Uw(e){return y(e.attributes,Vt(Fw))}function Gw(e){return y(e.attributes,Vt(Vw))}function zw(e){return y(e.attributes,Vt(Lw))}function Ww(e){return y(e.attributes,Vt(qw))}function Zk(e,t){return y(Du(e,t),Et)}function eM(e,t){return y(Hw(e,t),Et)}function tM(e,t,n){return y(Hw(e,t),K(r=>r.values),Fn(Ln(Pt(r=>r.id===n))),Et)}function nM(e,t){return y(Du(e,t),Mt(Lw),Et)}function rM(e,t){return y(Du(e,t),Mt(qw),Et)}function iM(e,t){return y(Du(e,t),Mt(Vw),Et)}function Du(e,t){return y(e.attributes,Pt(n=>Ja.equals(n.id,t)))}function Hw(e,t){return y(Du(e,t),Mt(Fw))}const Xa=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:Wk,filterAttributesOfRoot:Kk,filterAttributesOfShared:Hk,getAttribute:Zk,getBooleanAttribute:rM,getBooleanAttributes:Ww,getBooleanDecisions:Xk,getChoiceAttribute:eM,getChoiceAttributes:Uw,getChoiceDecisions:Yk,getChoiceValue:tM,getComponentAttribute:iM,getComponentAttributes:Gw,getComponentDecisions:Qk,getNumericAttribute:nM,getNumericAttributes:zw,getNumericDecisions:Jk},Symbol.toStringTag,{value:"Module"})),oM="https://spc.cloud.ceventis.de/api/engine",aM={hcaEngineBaseUrl:oM};function sM(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??aM.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function vs(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const Kw=e=>t=>n=>y(n,ZC(r=>e.equals(r,t)),K(r=>y(n,J2(r,i=>t))),ip,Qe(()=>y(n,Re(Z2(t))))),el=Kw({equals:(e,t)=>wn.equals(e.attributeId,t.attributeId)}),uM=Kw({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let lM=class{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const r=this.updateConfiguration(t.configuration,n);return{...t,configuration:r}}updateConfiguration(t,n){var r,i,o,a,s,u,l,c,f,d;const h=y(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],z(this.restToDomainMapper.mapToGlobalAttributeId)),p=I=>rv(wn)(I,h),v=y(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),g=y(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=y(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=y(((s=n.consequences)==null?void 0:s.componentConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=y(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=y(((l=n.consequences)==null?void 0:l.numericConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=y(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=y(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=y([],Re(y(T,z(I=>I.attributeId))),Re(y(E,z(I=>I.attributeId))),Re(y(b,z(I=>I.attributeId))),Re(y(x,z(I=>I.attributeId))),Re(y(v,z(I=>I.attributeId))),Re(y(g,z(I=>I.attributeId))),Re(y(C,z(I=>I.attributeId))),Re(y(m,z(I=>I.attributeId))),fa(wn)),N=y(A,tp(t.attributes,(I,P)=>{const _=t.attributes.find(L=>wn.equals(L.attributeId,P));return H(_).with({type:ft.Choice},(L,U)=>{const Y=this.mergeChoice(U,y(g,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(v,Vt(k=>wn.equals(k.attributeId,P)),z(k=>k.payload)));return el(Y)(I)}).with({type:ft.Numeric},(L,U)=>{const Y=this.mergeNumeric(U,y(x,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(b,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).with({type:ft.Boolean},(L,U)=>{const Y=this.mergeBoolean(U,y(E,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(T,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).with({type:ft.Component},(L,U)=>{const Y=this.mergeComponent(U,y(m,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(C,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return el(Y)(I)}).exhaustive()}),z(I=>{const P=p(I.attributeId);return I.canContributeToConfigurationSatisfaction!=P?{...I,canContributeToConfigurationSatisfaction:P}:I}));return{...t,isSatisfied:y((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,ye,Qe(()=>t.isSatisfied)),attributes:N}}mergeChoice(t,n,r){const i=y(n,K(u=>u.values??[]),Qe(()=>[])),o=y(r),a=y([],Re(y(i,z(u=>u.choiceValueId))),Re(y(o,z(u=>u.choiceValueId))),z(vs),fa(ot)),s=y(a,tp(t.values,(u,l)=>{const c=y(i,Pt(p=>p.choiceValueId===l)),f=y(o,Pt(p=>p.choiceValueId===l)),d=y(t.values.find(p=>p.choiceValueId===l),ye),h=this.mergeChoiceValue(l,d,c,f);return uM(h)(u)}));return{...t,isSatisfied:y(n,K(u=>vs(u.isSatisfied)),Qe(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=y(i,K(s=>({state:this.toDecisionState(vs(s.state)),kind:this.toDecisionKind(vs(s.kind))})),Qe(()=>({state:y(n,Fn(s=>y(s.decision,K(u=>u.state)))),kind:y(n,Fn(s=>y(s.decision,K(u=>u.kind))),Qe(()=>kt.Explicit))}))),a=y(r,K(s=>y(cy(s.possibleDecisionStates??[]),z(u=>this.toPossibleDecisionState(u)),qn)),Qe(()=>y(n,K(s=>s.possibleDecisionStates??[]),Qe(()=>[]))));return{choiceValueId:t,decision:y(o.state,K(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=y(r,K(a=>{const s=this.toDecisionState(vs(a.state));return y(s,K(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),Qe(()=>y(t.decision,K(a=>({state:a.state,kind:a.kind}))))),o=y(n,K(a=>y(cy(a.possibleDecisionStates??[]),z(s=>this.toPossibleDecisionState(s)),qn)),Qe(()=>t.possibleDecisionStates));return{...t,isSatisfied:y(n,K(a=>a.isSatisfied),Qe(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:y(n,Fn(i=>ye(i.isSatisfied)),Qe(()=>t.isSatisfied)),decision:y(r,ei(()=>t.decision,i=>y(i.state,ye,K(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:y(n,Fn(i=>ye(i.isSatisfied)),Qe(()=>t.isSatisfied)),decision:y(r,ei(()=>t.decision,i=>y(i.state,ye,K(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:y(n,K(i=>i.possibleDecisionStates),Qe(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return H(t).with(Ao.Included,()=>De(Zt.Included)).with(Ao.Excluded,()=>De(Zt.Excluded)).otherwise(()=>me)}toDecisionState(t){return H(t).with(Yr.Included,()=>De(Zt.Included)).with(Yr.Excluded,()=>De(Zt.Excluded)).otherwise(()=>me)}toDecisionKind(t){return H(t).with(ou.Implicit,()=>kt.Implicit).with(ou.Explicit,()=>kt.Explicit).exhaustive()}},cM=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ie.Component},n=>({type:Gn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ie.Numeric},n=>({type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).with({type:Ie.Boolean},n=>({type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=y([...t],vi(u=>u.type!==Ie.Boolean?me:De({type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:y(u.value,Et)}))),o=y([...t],vi(u=>u.type!==Ie.Numeric?me:De({type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:y(u.value,Et)}))),a=y([...t],vi(u=>u.type!==Ie.ChoiceValue?me:De({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=y([...t],vi(u=>u.type!==Ie.Component?me:De({type:Gn.Component,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:this.mapToDecisionState(u.state)})));return{mode:r,choiceDecisions:a,numericDecisions:o,booleanDecisions:i,componentDecisions:s}}mapToExplicitDecisionsInner(t){const n=y([...t],vi(a=>a.type!==ft.Boolean?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitBooleanDecision(a))))),r=y([...t],vi(a=>a.type!==ft.Numeric?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitNumericDecision(a))))),i=y([...t],vi(a=>a.type!==ft.Component?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitComponentDecision(a))))),o=y([...t],vi(a=>a.type!==ft.Choice?me:y(this.mapToExplicitChoiceDecisions(a),Ou(s=>y(s,Wa)))),oP);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return H(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:y(t.componentPath,ye,K(np),Mn),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:H(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:qe.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:y(t.decision,K(n=>n.state),Et)}}mapToExplicitNumericDecision(t){return{type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:y(t.decision,K(n=>n.state),Et)}}mapToExplicitComponentDecision(t){return{type:Gn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(y(t.decision,K(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return y(r.decision,K(i=>i.kind===kt.Explicit),Qe(()=>!1))}return y(t.values,Vt(n),z(r=>({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(y(r.decision,K(i=>i.state)))})),np)}mapToDecisionState(t){return y(t,K(n=>H(n).with(Zt.Included,()=>Yr.Included).with(Zt.Excluded,()=>Yr.Excluded).exhaustive()),Qe(()=>Yr.Undefined))}mapToPossibleDecisionState(t){return H(t).with(Zt.Included,()=>Ao.Included).with(Zt.Excluded,()=>Ao.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return H(t).with({subject:mn.attribute},n=>({type:vp.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:mn.configuration},()=>({type:vp.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return H(t).with({subject:mn.boolean},n=>({type:Es.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:mn.numeric},n=>({type:Es.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:mn.component},n=>({type:Es.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:mn.choiceValue},n=>({type:Es.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},fM=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return y(t.configuration.attributes,Pt(n=>H(n).with({type:ft.Boolean},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).with({type:ft.Numeric},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).with({type:ft.Choice},r=>y(r.values,Pt(i=>y(i.decision,K(o=>o.kind===kt.Explicit),Qe(()=>!1))),Ii)).with({type:ft.Component},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ii)).exhaustive()),ei(()=>!1,()=>!0))},getExplicitDecisions(t){return y(t.configuration.attributes,z(n=>H(n).with({type:ft.Boolean},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Boolean,attributeId:r.attributeId,value:ye(i.state)})),K(i=>[i]))).with({type:ft.Numeric},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Numeric,attributeId:r.attributeId,value:ye(i.state)})),K(i=>[i]))).with({type:ft.Choice},r=>y(r.values,z(i=>y(i.decision,Mt(o=>o.kind===kt.Explicit),K(o=>({type:Ie.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:ye(o.state)})))),qn,Di)).with({type:ft.Component},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Component,attributeId:r.attributeId,state:ye(i.state)})),K(i=>[i]))).exhaustive()),qn,Ha)}}}},dM=class{constructor(t,n,r,i,o,a){this.engineApiClient=n,this.domainToRestMapper=i,this.restToDomainMapper=r,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=t,this.interpreter=new fM}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const r=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(i,o)=>y(this.engineApiClient.makeDecision(i,r),Sr(zr),Ht(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=H(t).with({question:Yn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Yn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return y(i,Sr(zr),Ht(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return y(a,gr(s=>{var u,l,c,f;return y([],Re(y(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],z(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Re(y(((l=s.rejectedDecisions)==null?void 0:l.numericDecisions)??[],z(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Re(y(((c=s.rejectedDecisions)==null?void 0:c.componentDecisions)??[],z(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Re(y(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],z(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),da(this.domainUpdater.updateConfigurationSession(o,s))}))})}replaceDecisions(t,n){const r=this.interpreter.configurationSession.getExplicitDecisions(n),i=this.setManyInner(r,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return y(i,Ht(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return y(o,Sr(zr),gr(a=>{const s={rejectedDecisions:{booleanDecisions:qe.array(qe.any)}},u={decisionExplanations:qe.array(qe.any)};return H(a).with(s,l=>Ka(l)).with(u,l=>Ni(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>Ni({type:xe.Unknown}))}))}explainWhyStateNotPossible(t,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(t,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(t,n){return y(da(t),gr(r=>y(r.sessionId,ei(()=>this.initializeInner(r,!1),()=>da(r)))),gr(r=>y(r.sessionId,uv(()=>({type:xe.ConfigurationUnauthenticated})),gr(i=>n(i,r)))))}initializeInner(t,n){return y(UP,()=>y(t.sessionId,ZP,nR(s=>n?QP(s):y(this.sessionHandler.close(s),oc(()=>me,()=>me)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return y(s,kP(()=>({type:xe.ConfigurationUnauthenticated})),cw(()=>this.sessionHandler.create(u)))},s=>y(s,GP(u=>y(Di(t),Mt(this.interpreter.configurationSession.hasExplicitDecisions),K(l=>this.replaceDecisions(u,l)),Qe(()=>da({}))))),s=>y(s,gr(u=>{const l=this.determineConsequences(u),c=this.determineDecisions(u),f=i2(_P)({consequences:l,decisions:c});return y(f,Ht(({decisions:d,consequences:h})=>this.restToDomainMapper.mapToConfigurationModel(d,h)),Ht(d=>({sessionId:Di(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return y(this.engineApiClient.getDecisions(t),Sr(zr))}determineConsequences(t){return y(this.engineApiClient.getConsequence(t),Sr(zr))}},pM=class{constructor(t,n){this.onConfigurationChangedHandler=me,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return y(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return y(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:me}}restoreConfiguration(t){return y(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return y(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return y(this.configurationSession.sessionId,K(t=>this.sessionHandler.close(t)),K(Ln(Ht(t=>{this.configurationSession={...this.configurationSession,sessionId:me}}))),Qe(Ba(fk())))}applySolution(t){return y(this.configurationSession.solutions,Pt(n=>wk.equals(n,t)),uv(()=>({type:xe.ConfigurationSolutionNotAvailable})),Ht(n=>n.decisions),gr(n=>this.setMany(n,t.mode)))}setMany(t,n){return y(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Zs(r=>()=>{const i=H(r).with({decisionExplanations:qe.array(qe.any)},o=>De(o.decisionExplanations)).otherwise(()=>me);this.configurationSession={...this.configurationSession,solutions:y(i,K(Ln(z(o=>o.solution))),Qe(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=H(t).with({decisionExplanations:qe.array(qe.any)},r=>r.decisionExplanations).otherwise(()=>[]);return y(n,z(r=>r.solution))}invalidateAvailableSolutions(){return WP(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Zs(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Qs(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Ln(Qs(t=>()=>{this.configurationSession=t,y(this.onConfigurationChangedHandler,KP(n=>()=>n(this.configurationSession.configuration)))}),Ht(t=>t.configuration),this.invalidateAvailableSolutions())}},hM=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=YR(r,HR.concat(JR(i),KR(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Ko(this.policy,r,i=>y(i,ao(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return H(t).with({type:xe.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:xe.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},vM=class{constructor(){this.queue=[],this.operating=me}push(t){const n=new mM(t);return this.queue.push(n),this.operating=y(this.operating,Qe(()=>this.start()),Di),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=y(t,z(r=>r.argument),tp(me,(r,i)=>this.reduce(r,i)),K(Ln(r=>this.execute(r),r=>r.then(i=>{y(t,z(o=>{o.resolve(i)}))}).catch(i=>{y(t,z(o=>{o.reject(i)}))}))),Et);n&&await n}this.operating=me}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},mM=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},yM=class extends vM{constructor(t){super(),this.inner=t}reduce(t,n){return De(n)}async execute(t){return await this.inner.setSessionContext(t)()}},gM=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new yM(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(vk.equals(n,t))return Ka(this.getConfiguration());const r=this.setContextReducingTaskExecutor.push(t);return()=>r}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},bM=class{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,r){const i=performance.now(),o=()=>{const a=performance.now()-i;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),y(r(),Zs(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Qs(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}};class mv{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+pv()}static new(t){return new mv(t)}close(){return this.executeTaskSynchronous(()=>this.inner.close())}restoreConfiguration(t){return this.executeTaskSynchronous(()=>this.inner.restoreConfiguration(t))}setSessionContext(t){return this.executeTaskSynchronous(()=>this.inner.setSessionContext(t))}invalidateSessionId(){return this.inner.invalidateSessionId()}makeDecision(t){return this.executeTaskSynchronous(()=>this.inner.makeDecision(t))}applySolution(t){return this.executeTaskSynchronous(()=>this.inner.applySolution(t))}setMany(t,n){return this.executeTaskSynchronous(()=>this.inner.setMany(t,n))}explain(t){return this.executeTaskSynchronous(()=>this.inner.explain(t))}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}getConfiguration(){return this.inner.getConfiguration()}getSessionContext(){return this.inner.getSessionContext()}executeTaskSynchronous(t){return()=>navigator.locks.request(this.lockName,{mode:"exclusive"},()=>t()())}}function SM(e){e=sM(e);const t=new Pk(e.hcaEngineBaseUrl),n=new Aw,r=new cM,i=new Ow,o=new lk,a=new lM(n),s=H(e.sessionHandler).with({create:qe.any,close:qe.any},c=>c).with({accessToken:qe.string},c=>new Nk(t,o,n,c)).with({sessionCreateUrl:qe.string,sessionDeleteUrl:qe.string},c=>new Rk(o,c)).exhaustive(),u=new dM(s,t,n,r,i,a),l=(c,f)=>y(new pM(c,f),d=>new hM(d),d=>new gM(d),mv.new,d=>new bM(d,!1));return new jk(u,l)}const Nu=Ja.equals,CM=xw.equals;rk.equals;function lf(e){return An((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}/*! *****************************************************************************
|
|
70
|
+
${JSON.stringify(e,null,2)}`)}var _s=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(_s||{}),Iw=(e=>(e.BooleanAttributeNotFound="BooleanAttributeNotFound",e.ChoiceAttributeNotFound="ChoiceAttributeNotFound",e.ChoiceValueNotFound="ChoiceValueNotFound",e.ConfigurationInitializationFailure="InitializationFailure",e.ConfigurationModelInvalid="ConfigurationModelInvalid",e.LegacyConfigurationModelInvalid="DeploymentStore.Core.Store.SnapshotInvalid",e.LegacySnapshotInvalid="SnapshotInvalid",e.ConfigurationModelNotFeasible="ConfigurationModelNotFeasible",e.ConfigurationModelNotFound="ConfigurationModelNotFound",e.ConflictWithConsequence="ConflictWithConsequence",e.DecisionInvalid="DecisionInvalid",e.DecisionsToRespectInvalid="DecisionsToRespectInvalid",e.NumericAttributeNotFound="NumericAttributeNotFound",e.NumericDecisionOutOfRange="NumericDecisionOutOfRange",e.SessionNotFound="SessionNotFound",e.SetDecisionConflict="SetDecisionConflict",e.Unauthorized="Unauthorized",e.AuthenticationFailure="AuthenticationFailure",e.SpecifiedDeploymentForbidden="SpecifiedDeploymentForbidden",e))(Iw||{});const Ik=e=>Object.values(Iw).includes(e),Ak=e=>Ik(e)?De(e):me;function $k(e){const t=n=>H(n).with("ConfigurationModelNotFound",()=>({type:xe.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:xe.DecisionsToRespectInvalid})).with(qe.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:xe.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:xe.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:xe.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:xe.ConfigurationConflict,reason:yv.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:xe.ConfigurationConflict})).with(qe.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:xe.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:xe.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:xe.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:xe.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:xe.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:xe.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return y(e.type,Ak,K(t))}const Ok=e=>Object.values(_s).includes(e),Dk=e=>Ok(e)?De(e):me;function Nk(e){return y(e,Dk,K(n=>H(n).with("Generic::LocalClientError",()=>({type:xe.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:xe.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:xe.CommunicationError})).with("Generic::Unauthorized",()=>({type:xe.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:xe.Unknown})).exhaustive()))}function Kr(e,t){Ek(e,t);const n=e.type;return y(me,op(()=>$k(e)),op(()=>Nk(n)),Qe(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:xe.Unknown})))}let Pk=class{constructor(t,n,r,i){this.engineApiClient=t,this.contractToRestMapper=n,this.restToDomainMapper=r,this.options=i}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t);return y(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),wr(r=>Kr(r,"ClientSideSessionLifetimeHandler - create")),Sr(r=>this.restToDomainMapper.mapToSessionId(r)),fk(()=>({type:xe.ConfigurationUnauthenticated})))}close(t){return y(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),wr(n=>Kr(n,"ClientSideSessionLifetimeHandler - close")),Ht(()=>Hr()))}};var Aw=(e=>(e[e.Ok=200]="Ok",e[e.NoContent=204]="NoContent",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.NotFound=404]="NotFound",e[e.Conflict=409]="Conflict",e))(Aw||{});function Ur(e,t,n){const r=y(Array.isArray(e)?e:[e],HR);return y(dy(()=>fetch(r,t),i=>({type:"error"})),Sr(i=>y(dy(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),fw(i=>i.status===401?Pi({type:_s.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Ka({response:i,data:{}}):i.type==="error"?Pi({type:_s.LowLevelCommunicationError}):Pi({type:_s.UnhandledResponseStatus})),Sr(i=>y(n(i),cv(()=>i.data))))}function pp(e,t){return Ur(e,t,n=>{if(n.response.status===200)return Ni(n.data);if(n.response.status===409){const r=n.data;return H(r).with({type:"ConfigurationModelInvalid"},i=>Ni(r)).with({type:"ConfigurationModelNotFeasible"},i=>Ni(r)).otherwise(()=>me)}return me})}let Rk=class{constructor(t){this.baseUrl=t}createSessionUsingApiKey(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-API-KEY":n},body:JSON.stringify(t)};return pp([this.baseUrl,"v2/session"],r)}createSessionUsingJwtBearer(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`},body:JSON.stringify(t)};return pp([this.baseUrl,"v2/session"],r)}setMany(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Ur([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?De(i.data):me)}makeDecision(t,n){const r={method:"PUT",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Ur([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?De(i.data):me)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Ur([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?De(r.data):me)}getWhyStateNotPossible(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Ur([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?De(i.data):me)}getWhyNotSatisfied(t,n){const r={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t},body:JSON.stringify(n)};return Ur([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?De(i.data):me)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return Ur([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?De(r.data):me)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return Ur([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?De({}):me)}};var Ao=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ao||{}),hp=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(hp||{}),vp=(e=>(e.Always="Always",e.Optional="Optional",e))(vp||{}),au=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(au||{}),Qr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Qr||{}),Gn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(Gn||{}),mp=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(mp||{}),yp=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(yp||{}),Is=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Is||{});const Bn=Sn({localId:ot,componentPath:lf(ot),sharedConfigurationModelId:mv(ot)});let $w=class{mapToDecisions(t){return{}}mapToSessionId(t){return H(t).with({sessionId:qe.string},n=>Ka(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=y(n.constraintExplanations,z(i=>this.mapToConstraintExplanation(i)));return Pi({type:xe.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Pi({type:xe.ConfigurationModelInvalid})).otherwise(()=>Pi({type:xe.Unknown}))}mapToExplainAnswer(t,n){const r=H(n).with({question:Yn.whyIsStateNotPossible,subject:mn.boolean},a=>[{type:Ie.Boolean,attributeId:a.attributeId,value:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.numeric},a=>[{type:Ie.Numeric,attributeId:a.attributeId,value:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.component},a=>[{type:Ie.Component,attributeId:a.attributeId,state:De(a.state)}]).with({question:Yn.whyIsStateNotPossible,subject:mn.choiceValue},a=>[{type:Ie.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:De(a.state)}]).otherwise(()=>[]),i=y(t.decisionExplanations,z(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=y(t.constraintExplanations,z(a=>this.mapToConstraintExplanation(a)));return H(n).with({answerType:yo.decisions},()=>({decisionExplanations:i})).with({answerType:yo.constraints},()=>({constraintExplanations:o})).with({answerType:yo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:xe.ConfigurationSetManyConflict,decisionExplanations:y(t.decisionExplanations,z(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:y(t.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModel(t,n){const r=this.mapToAttributes(t,n);return{isSatisfied:n.isConfigurationSatisfied??!1,attributes:r}}mapToBooleanDecision(t){return{type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ye(t.state)}}mapToNumericDecision(t){return{type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:ye(t.state)}}mapToComponentDecision(t){return{type:Ie.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToDecisionState(t.state)}}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModel:t.sharedConfigurationModelId,componentPath:t.componentPath??[]}}mapToChoiceValueDecision(t){return y(this.mapToDecisionState(t.state),K(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:y(t.causedByRules,z(n=>this.mapToRuleConstraint(n))),causedByCardinalities:y(t.causedByCardinalities,z(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:ba.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:ba.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=y(t.booleanDecisions??[],z(a=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),r=y(t.numericDecisions??[],z(a=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:ye(a.state)}))),i=y(t.componentDecisions??[],z(a=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:y(ye(a.state),K(s=>this.mapToDecisionState(s)),ap)}))),o=y(t.choiceDecisions??[],z(a=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:y(ye(a.state),K(s=>this.mapToDecisionState(s)),ap)})));return y([],Re(n),Re(r),Re(i),Re(o))}mapToDecisionExplanation(t,n,r){const i=y(t.causedByBooleanDecisions,z(p=>this.mapToCausedByBooleanDecision(p))),o=y(t.causedByNumericDecisions,z(p=>this.mapToCausedByNumericDecision(p))),a=y(t.causedByComponentDecisions,z(p=>this.mapToCausedByComponentDecision(p))),s=y(t.causedByChoiceDecisions,z(p=>this.mapToCausedByChoiceValueDecision(p))),u=y(i,z(p=>({type:Ie.Boolean,attributeId:p.attributeId,value:me}))),l=y(o,z(p=>({type:Ie.Numeric,attributeId:p.attributeId,value:me}))),c=y(a,z(p=>({type:Ie.Component,attributeId:p.attributeId,state:me}))),f=y(s,z(p=>({type:Ie.ChoiceValue,attributeId:p.attributeId,choiceValueId:p.choiceValueId,state:me}))),d=y([],Re(u),Re(l),Re(c),Re(f)),h=tw(An((p,v)=>{const g=wn.equals(p.attributeId,v.attributeId);return H({a:p,b:v}).with({a:{type:Ie.ChoiceValue},b:{type:Ie.ChoiceValue}},C=>g&&C.a.choiceValueId===C.b.choiceValueId).otherwise(()=>g)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:y([],Re(d),Re(h)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return H(t).with(mp.NotAvailable,()=>dp.NotAvailable).with(mp.StateNotPossible,()=>dp.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Ie.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToAttributes(t,n){function r(d){return y(n.canAttributeContributeToConfigurationSatisfaction,Pt(h=>Bn.equals(h,d)),Ai)}const i=y([],Re(y(t.choiceValueDecisions,z(d=>d.attributeId))),Re(y(n.choiceConsequences,z(d=>d.attributeId))),fa(Bn)),o=y(i,z(d=>{const h=y(t.choiceValueDecisions??[],uP(v=>Bn.equals(v.attributeId,d))),p=y(n.choiceConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToChoiceAttributes(v,h,r(d))))}),qn),a=y([],Re(y(t.numericDecisions,z(d=>d.attributeId))),Re(y(n.numericConsequences,z(d=>d.attributeId))),fa(Bn)),s=y(a,z(d=>{const h=y(t.numericDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.numericConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToNumericAttribute(v,h,r(d))))}),qn),u=y([],Re(y(t.booleanDecisions,z(d=>d.attributeId))),Re(y(n.booleanConsequences,z(d=>d.attributeId))),fa(Bn)),l=y(u,z(d=>{const h=y(t.booleanDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.booleanConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToBooleanAttribute(v,h,r(d))))}),qn),c=y([],Re(y(t.componentDecisions,z(d=>d.attributeId))),Re(y(n.componentConsequences,z(d=>d.attributeId))),fa(Bn)),f=y(c,z(d=>{const h=y(t.componentDecisions??[],to(v=>Bn.equals(v.attributeId,d))),p=y(n.componentConsequences??[],to(v=>Bn.equals(v.attributeId,d)));return y(p,K(v=>this.mapToComponentAttribute(v,h,r(d))))}),qn);return y([],Re(o),Re(f),Re(s),Re(l))}mapToComponentAttribute(t,n,r){return{type:ft.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:y(t.possibleDecisionStates,Nl(i=>this.mapToPossibleDecisionState(i))),decision:y(n,Fn(i=>y(this.mapToDecisionState(i.state),K(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:y(t.selection,ye,K(i=>this.mapToSelection(i)),Et),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=y(t.values,Nl(o=>{const a=y(n,Pt(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ft.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ft.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:y(n,Fn(i=>y(i.state,ye,K(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ft.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,range:{min:t.range.min,max:t.range.max},selection:this.mapToSelection(t.selection),decimalPlaces:t.decimalPlaces,decision:y(n,Fn(i=>y(i.state,ye,K(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=y(t.possibleDecisionStates,Nl(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:y(n,Fn(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return H(t).with(au.Implicit,()=>kt.Implicit).with(au.Explicit,()=>kt.Explicit).exhaustive()}mapToDecisionState(t){return H(t).with(Qr.Included,()=>De(Zt.Included)).with(Qr.Excluded,()=>De(Zt.Excluded)).with(Qr.Undefined,()=>me).exhaustive()}mapToPossibleDecisionState(t){return H(t).with(Ao.Included,()=>Zt.Included).with(Ao.Excluded,()=>Zt.Excluded).exhaustive()}mapToSelection(t){return H(t).with(hp.Mandatory,()=>Eo.Mandatory).with(hp.Optional,()=>Eo.Optional).exhaustive()}mapToInclusion(t){return H(t).with(vp.Always,()=>Io.Always).with(vp.Optional,()=>Io.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},kk=class{constructor(t,n){this.restToDomainMapper=new $w,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=pp(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return y(r,wr(i=>Kr(i,"ServerSideSessionLifetimeHandler - create")),Sr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return y(Ur(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Aw.NoContent?De({}):me),wr(n=>Kr(n,"ServerSideSessionLifetimeHandler - close")),Ht(Hr))}};const Ow={whyIsNotSatisfied:{configuration:{question:Ft.whyIsNotSatisfied,subject:Ue.configuration},attribute:e=>({question:Ft.whyIsNotSatisfied,subject:Ue.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Ft.whyIsStateNotPossible,subject:Ue.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Ft.whyIsStateNotPossible,subject:Ue.component,attributeId:e,state:t})})}};let Mk=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=me}setOnConfigurationChangedHandler(t){const n=y(t,ye,K(r=>i=>{const o=this.domainToContractMapper.mapToConfiguration(i);r(o)}));this.inner.setOnConfigurationChangedHandler(n)}getConfiguration(){const t=this.inner.getConfiguration();return this.domainToContractMapper.mapToConfiguration(t)}getSessionContext(){const t=this.inner.getSessionContext();return this.domainToContractMapper.mapToSessionContext(t)}async setSessionContext(t){const n=this.contractToDomainMapper.mapToSessionContext(t);return await y(this.inner.setSessionContext(n),Ht(Hr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await y(this.inner.restoreConfiguration(n),Ht(Hr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await y(this.inner.makeDecision(n),Ht(Hr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await y(this.inner.setMany(r,i),Ht(Hr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await y(this.inner.applySolution(n),Ht(Hr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(Ow):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await y(this.inner.explain(i),Ht(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await y(this.inner.close(),wr(t=>this.domainToContractMapper.mapToFailureResult(t)),ac(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Ln(wr(t=>this.domainToContractMapper.mapToFailureResult(t)),ac(t=>Promise.reject(t),t=>Promise.resolve(t)))}},jk=class{mapToExplainQuestion(t,n){const r={answerType:H(n).with("decisions",()=>yo.decisions).with("constraints",()=>yo.constraints).with("full",()=>yo.all).exhaustive()};return H(t).with({question:Ft.whyIsNotSatisfied,subject:Ue.configuration},i=>({...r,question:Yn.whyIsNotSatisfied,subject:mn.configuration})).with({question:Ft.whyIsNotSatisfied,subject:Ue.attribute},i=>({...r,question:Yn.whyIsNotSatisfied,subject:mn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.choiceValue},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.component},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Ft.whyIsStateNotPossible,subject:Ue.numeric},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Ft.whyIsStateNotPossible,subject:Ue.boolean},i=>({...r,question:Yn.whyIsStateNotPossible,subject:mn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:y(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return y(t,z(n=>this.mapToAttributeDecision(n)))}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),decisionsToRespect:this.mapToDecisionsToRespect(t.attributeRelations),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToAttributeDecision(t){return H(t).with({type:V.Choice,choiceValueId:qe.string},n=>({type:Ie.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:V.Numeric},n=>({type:Ie.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:V.Boolean},n=>({type:Ie.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:ye(n.state)})).with({type:V.Component},n=>({type:Ie.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(ye(n.state),Fn(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return y(ye(t),K(n=>y(n,z(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:y(r.decisions,z(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return H(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).exhaustive()}mapToConflictHandling(t){return H(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:t.componentPath??[],sharedConfigurationModel:t.sharedConfigurationModelId}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return H(t).with({type:Vi.Package},n=>({type:ou.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Vi.Channel},n=>({type:ou.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:y(t.decisions,z(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return H(t).with({type:V.Boolean},n=>({type:ft.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:y(n.decision,ye,K(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Numeric},n=>({type:ft.Numeric,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,range:{min:n.range.min,max:n.range.max},decimalPlaces:n.decimalPlaces,selection:this.mapToSelection(n.selection),decision:y(n.decision,ye,K(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Choice},n=>({type:ft.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:y(n.values,z(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:V.Component},n=>({type:ft.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:y(n.decision,ye,Fn(r=>y(this.mapToDecisionStateOption(r.state),K(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:y(n.possibleDecisionStates,z(r=>this.mapToDecisionStateOption(r)),qn),selection:y(n.selection,ye,K(r=>this.mapToSelection(r)),Et),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:y(t.possibleDecisionStates,z(n=>this.mapToDecisionStateOption(n)),qn)}}mapToChoiceValueDecision(t){return y(t.decision,ye,Fn(n=>y(this.mapToDecisionStateOption(n.state),K(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return H(t).with(Se.Implicit,()=>kt.Implicit).with(Se.Explicit,()=>kt.Explicit).exhaustive()}mapToSelection(t){return H(t).with(Ri.Mandatory,()=>Eo.Mandatory).with(Ri.Optional,()=>Eo.Optional).exhaustive()}mapToInclusion(t){return H(t).with(xa.Always,()=>Io.Always).with(xa.Optional,()=>Io.Optional).exhaustive()}mapToDecisionState(t){return H(t).with(qe.union(Ye.Included,Ge.Included),()=>Zt.Included).with(qe.union(Ye.Excluded,Ge.Excluded),()=>Zt.Excluded).exhaustive()}mapToDecisionStateOption(t){return y(ye(t),K(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return y(t,ye,K(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return y(t,ye,K(n=>H(n).returnType().with({type:vn.all},()=>({type:go.all})).with({type:vn.none},()=>({type:go.none})).with({type:vn.specific},r=>({type:go.specific,rules:y(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()))}},Dw=class{mapToExplainAnswer(t){const n=H(t).with({decisionExplanations:qe.array(qe.any)},i=>y(i.decisionExplanations,z(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=H(t).with({constraintExplanations:qe.array(qe.any)},i=>y(i.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:y(t.causedByCardinalities,z(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:y(t.causedByRules,z(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=y(t.causedByChoiceDecisions,z(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=y(t.causedByComponentDecisions,z(a=>this.mapToCausedByComponentAttributeDecision(a))),i=y(t.causedByNumericDecisions,z(a=>this.mapToCausedByNumericAttributeDecision(a))),o=y(t.causedByBooleanDecisions,z(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:y([],Re(n),Re(r),Re(i),Re(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:y(t.decisions,z(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return H(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return H(t).with({type:"Manual"},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).with({type:"Automatic"},n=>({type:"Automatic"})).exhaustive()}mapToSessionContext(t){return{configurationModelSource:this.mapToConfigurationModelSource(t.configurationModelSource),attributeRelations:this.mapToDecisionsToRespect(t.decisionsToRespect),usageRuleParameters:this.mapToUsageRuleParameters(t.usageRuleParameters),allowedInExplain:this.mapToAllowedInExplain(t.allowedInExplain)}}mapToFailureResult(t){return H(t).with({type:xe.ConfigurationConflict},n=>({type:pt.ConfigurationConflict,reason:H(n.reason).with(yv.NumericDecisionOutOfRange,()=>Ew.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:xe.ConfigurationApplicationError},()=>({type:pt.ConfigurationApplicationError})).with({type:xe.ConfigurationUnauthenticated},()=>({type:pt.ConfigurationUnauthenticated})).with({type:xe.ConfigurationModelNotFound},()=>({type:pt.ConfigurationModelNotFound})).with({type:xe.ConfigurationTimeout},()=>({type:pt.ConfigurationTimeout})).with({type:xe.ConfigurationAttributeNotFound},()=>({type:pt.ConfigurationAttributeNotFound})).with({type:xe.ConfigurationChoiceValueNotFound},()=>({type:pt.ConfigurationChoiceValueNotFound})).with({type:xe.ConfigurationSolutionNotAvailable},()=>({type:pt.ConfigurationSolutionNotAvailable})).with({type:xe.ConfigurationRejectedDecisionsConflict},n=>{const r=y(n.rejectedDecisions,z(i=>this.mapToExplicitDecision(i)));return lk.createConfigurationRejectedDecisionsConflict(r)}).with({type:xe.DecisionsToRespectInvalid},()=>({type:pt.DecisionsToRespectInvalid})).with({type:xe.ServiceError},()=>({type:pt.ServiceError})).with({type:xe.CommunicationError},()=>({type:pt.CommunicationError})).with({type:xe.Unknown},()=>({type:pt.Unknown})).with({type:xe.ConfigurationModelInvalid},()=>({type:pt.ConfigurationModelInvalid})).with({type:xe.ConfigurationInitializationFailure},()=>({type:pt.ConfigurationInitializationFailure})).with({type:xe.ConfigurationModelNotFeasible},n=>({type:pt.ConfigurationModelNotFeasible,constraintExplanations:y(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:xe.ConfigurationSetManyConflict},n=>({type:pt.ConfigurationSetManyConflict,decisionExplanations:y(n.decisionExplanations,z(r=>this.mapToDecisionExplanation(r))),constraintExplanations:y(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:xe.SpecifiedDeploymentForbidden},n=>({type:pt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:y(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return y(t,K(Ln(z(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:y(n.decisions,z(r=>this.mapToGlobalAttributeId(r)))})))),Mn)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return H(t).with({type:ou.Package},n=>({type:Vi.Package,configurationModelPackage:n.configurationModelPackage})).with({type:ou.Channel},n=>({type:Vi.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>({type:V.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.state,K(r=>this.mapToChoiceValueDecisionState(r)),Et),choiceValueId:n.choiceValueId})).with({type:Ie.Component},n=>({type:V.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.state,K(r=>this.mapToComponentDecisionState(r)),Et)})).with({type:Ie.Numeric},n=>({type:V.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).with({type:Ie.Boolean},n=>({type:V.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).exhaustive()}mapToCardinality(t){return H(t).with(ba.Cardinality,()=>Rl.Cardinality).with(ba.Component,()=>Rl.Component).with(ba.Rule,()=>Rl.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Ie.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Ie.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Ie.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:V.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:V.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:V.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:V.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return H(t).with(Eo.Mandatory,()=>Ri.Mandatory).with(Eo.Optional,()=>Ri.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return H(t).with({type:ft.Boolean},r=>({...n,type:V.Boolean,decision:y(r.decision,K(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Mn),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ft.Numeric},r=>({...n,type:V.Numeric,decision:y(r.decision,K(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Mn),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ft.Choice},r=>({...n,type:V.Choice,cardinality:r.cardinality,values:y(r.values,z(i=>{const o=y(i.decision,K(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),Mn);return{id:i.choiceValueId,possibleDecisionStates:y(i.possibleDecisionStates,z(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ft.Component},r=>({...n,type:V.Component,decision:y(r.decision,K(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),Mn),possibleDecisionStates:y(r.possibleDecisionStates,z(i=>this.mapToComponentDecisionState(i))),selection:y(r.selection,ye,K(i=>this.mapToSelection(i)),Et),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return H(t).with(Io.Always,()=>xa.Always).with(Io.Optional,()=>xa.Optional).exhaustive()}mapToComponentDecisionState(t){return H(t).with(Zt.Included,()=>Ge.Included).with(Zt.Excluded,()=>Ge.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return H(t).with(Zt.Included,()=>Ye.Included).with(Zt.Excluded,()=>Ye.Excluded).exhaustive()}mapToDecisionKind(t){return H(t).with(kt.Explicit,()=>Se.Explicit).with(kt.Implicit,()=>Se.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return y(t,K(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),Mn)}mapToAllowedRulesInExplain(t){return y(t,K(n=>H(n).returnType().with({type:go.all},()=>({type:vn.all})).with({type:go.none},()=>({type:vn.none})).with({type:go.specific},r=>({type:vn.specific,rules:y(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()),Mn)}},_k=class{constructor(t,n){this.contractToDomainMapper=new jk,this.domainToContractMapper=new Dw,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await y(this.sessionHandler.recreate(n),Ht(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new Mk(i,this.contractToDomainMapper,this.domainToContractMapper)}),ac(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:me,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function Nw(e){return e.possibleDecisionStates.some(t=>t===Ye.Included)}function qk(e){return!Nw(e)}function Fk(e){return H(e).with({type:V.Choice},t=>t.cardinality.lowerBound>0).with({type:V.Boolean},t=>t.selection===Ri.Mandatory).with({type:V.Numeric},t=>t.selection===Ri.Mandatory).with({type:V.Component},t=>t.inclusion===xa.Optional&&t.selection===Ri.Mandatory).exhaustive()}function Lk(e){return H(e).with({type:V.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function Vk(e){return y(e.values,Vt(Nw))}function Bk(e){return y(e.values,Vt(qk))}function Pw(e,t){return y(e.values,Vo(n=>y(n.decision,ye,Mt(r=>r.kind===t))))}function Rw(e){return y(e.values,Vt(t=>y(t.decision,ye,K(n=>n.state===Ye.Included),Qe(()=>!1))))}const Uk=Rw;function kw(e){return y(e.decision,ye,Mt(t=>t.kind===Se.Explicit),Mn)}function Mw(e){return y(e.decision,ye,Mt(t=>t.kind===Se.Explicit),Mn)}function Gk(e,t){return e.possibleDecisionStates.some(n=>n===t)}function jw(e){return y(e.decision,ye,Mn)}function _w(e){return qw(e,Ge.Included)}function zk(e){return!_w(e)}function qw(e,t){return e.possibleDecisionStates.some(n=>n===t)}const $n=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:Vk,getBlockedChoiceValues:Bk,getBooleanDecision:Mw,getChoiceDecisions:Pw,getComponentDecision:jw,getIncludedChoiceValues:Rw,getNumericDecision:kw,getSelectedChoiceValues:Uk,isBooleanValuePossible:Gk,isComponentAllowed:_w,isComponentBlocked:zk,isComponentStatePossible:qw,isMandatory:Fk,isMultiSelect:Lk},Symbol.toStringTag,{value:"Module"})),Fw=e=>e.type===V.Boolean,Lw=e=>e.type===V.Choice,Vw=e=>e.type===V.Numeric,Bw=e=>e.type===V.Component,Wk=uR(ot),xy=Yi(ot);function Uw(e,t){const n=a=>Wk.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return y(n,lP(t?a=>xy.equals(y(a.componentPath??[],J2(r)),e.componentPath):a=>xy.equals(a.componentPath??[],e.componentPath)))}function Hk(e,t,n){const r=y(Uw({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:y(t.componentPath??[],ZC(t.localId))},n),iw(i=>i.id));return y(e,Vt(r))}function Kk(e,t,n){const r=y(Uw({sharedConfigurationModelId:t,componentPath:[]},n),iw(i=>i.id));return y(e,Vt(r))}function Yk(e){return y(e,Vt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function Jk(e,t){return y(Gw(e),z(n=>Pw(n,t)),Ha,Vo(n=>ye(n)))}function Xk(e,t){return y(Ww(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>kw(n)),Vo(n=>ye(n)))}function Qk(e,t){return y(Hw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Mw(n)),Vo(n=>ye(n)))}function Zk(e,t){return y(zw(e),Vt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>jw(n)),Vo(n=>ye(n)))}function Gw(e){return y(e.attributes,Vt(Lw))}function zw(e){return y(e.attributes,Vt(Bw))}function Ww(e){return y(e.attributes,Vt(Vw))}function Hw(e){return y(e.attributes,Vt(Fw))}function eM(e,t){return y(Nu(e,t),Et)}function tM(e,t){return y(Kw(e,t),Et)}function nM(e,t,n){return y(Kw(e,t),K(r=>r.values),Fn(Ln(Pt(r=>r.id===n))),Et)}function rM(e,t){return y(Nu(e,t),Mt(Vw),Et)}function iM(e,t){return y(Nu(e,t),Mt(Fw),Et)}function oM(e,t){return y(Nu(e,t),Mt(Bw),Et)}function Nu(e,t){return y(e.attributes,Pt(n=>Ja.equals(n.id,t)))}function Kw(e,t){return y(Nu(e,t),Mt(Lw))}const Xa=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:Hk,filterAttributesOfRoot:Yk,filterAttributesOfShared:Kk,getAttribute:eM,getBooleanAttribute:iM,getBooleanAttributes:Hw,getBooleanDecisions:Qk,getChoiceAttribute:tM,getChoiceAttributes:Gw,getChoiceDecisions:Jk,getChoiceValue:nM,getComponentAttribute:oM,getComponentAttributes:zw,getComponentDecisions:Zk,getNumericAttribute:rM,getNumericAttributes:Ww,getNumericDecisions:Xk},Symbol.toStringTag,{value:"Module"})),aM="https://spc.cloud.ceventis.de/api/engine",sM={hcaEngineBaseUrl:aM};function uM(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??sM.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function ms(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const Yw=e=>t=>n=>y(n,ew(r=>e.equals(r,t)),K(r=>y(n,X2(r,i=>t))),ap,Qe(()=>y(n,Re(eP(t))))),tl=Yw({equals:(e,t)=>wn.equals(e.attributeId,t.attributeId)}),lM=Yw({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let cM=class{constructor(t){this.restToDomainMapper=t}updateConfigurationSession(t,n){const r=this.updateConfiguration(t.configuration,n);return{...t,configuration:r}}updateConfiguration(t,n){var r,i,o,a,s,u,l,c,f,d;const h=y(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],z(this.restToDomainMapper.mapToGlobalAttributeId)),p=I=>ov(wn)(I,h),v=y(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),g=y(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=y(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=y(((s=n.consequences)==null?void 0:s.componentConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=y(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=y(((l=n.consequences)==null?void 0:l.numericConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=y(((c=n.affectedDecisions)==null?void 0:c.booleanDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=y(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=y([],Re(y(T,z(I=>I.attributeId))),Re(y(E,z(I=>I.attributeId))),Re(y(b,z(I=>I.attributeId))),Re(y(x,z(I=>I.attributeId))),Re(y(v,z(I=>I.attributeId))),Re(y(g,z(I=>I.attributeId))),Re(y(C,z(I=>I.attributeId))),Re(y(m,z(I=>I.attributeId))),fa(wn)),N=y(A,rp(t.attributes,(I,P)=>{const _=t.attributes.find(L=>wn.equals(L.attributeId,P));return H(_).with({type:ft.Choice},(L,U)=>{const Y=this.mergeChoice(U,y(g,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(v,Vt(k=>wn.equals(k.attributeId,P)),z(k=>k.payload)));return tl(Y)(I)}).with({type:ft.Numeric},(L,U)=>{const Y=this.mergeNumeric(U,y(x,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(b,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return tl(Y)(I)}).with({type:ft.Boolean},(L,U)=>{const Y=this.mergeBoolean(U,y(E,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(T,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return tl(Y)(I)}).with({type:ft.Component},(L,U)=>{const Y=this.mergeComponent(U,y(m,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)),y(C,Pt(k=>wn.equals(k.attributeId,P)),K(k=>k.payload)));return tl(Y)(I)}).exhaustive()}),z(I=>{const P=p(I.attributeId);return I.canContributeToConfigurationSatisfaction!=P?{...I,canContributeToConfigurationSatisfaction:P}:I}));return{...t,isSatisfied:y((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,ye,Qe(()=>t.isSatisfied)),attributes:N}}mergeChoice(t,n,r){const i=y(n,K(u=>u.values??[]),Qe(()=>[])),o=y(r),a=y([],Re(y(i,z(u=>u.choiceValueId))),Re(y(o,z(u=>u.choiceValueId))),z(ms),fa(ot)),s=y(a,rp(t.values,(u,l)=>{const c=y(i,Pt(p=>p.choiceValueId===l)),f=y(o,Pt(p=>p.choiceValueId===l)),d=y(t.values.find(p=>p.choiceValueId===l),ye),h=this.mergeChoiceValue(l,d,c,f);return lM(h)(u)}));return{...t,isSatisfied:y(n,K(u=>ms(u.isSatisfied)),Qe(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=y(i,K(s=>({state:this.toDecisionState(ms(s.state)),kind:this.toDecisionKind(ms(s.kind))})),Qe(()=>({state:y(n,Fn(s=>y(s.decision,K(u=>u.state)))),kind:y(n,Fn(s=>y(s.decision,K(u=>u.kind))),Qe(()=>kt.Explicit))}))),a=y(r,K(s=>y(fy(s.possibleDecisionStates??[]),z(u=>this.toPossibleDecisionState(u)),qn)),Qe(()=>y(n,K(s=>s.possibleDecisionStates??[]),Qe(()=>[]))));return{choiceValueId:t,decision:y(o.state,K(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=y(r,K(a=>{const s=this.toDecisionState(ms(a.state));return y(s,K(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),Qe(()=>y(t.decision,K(a=>({state:a.state,kind:a.kind}))))),o=y(n,K(a=>y(fy(a.possibleDecisionStates??[]),z(s=>this.toPossibleDecisionState(s)),qn)),Qe(()=>t.possibleDecisionStates));return{...t,isSatisfied:y(n,K(a=>a.isSatisfied),Qe(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:y(n,Fn(i=>ye(i.isSatisfied)),Qe(()=>t.isSatisfied)),decision:y(r,ri(()=>t.decision,i=>y(i.state,ye,K(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:y(n,Fn(i=>ye(i.isSatisfied)),Qe(()=>t.isSatisfied)),decision:y(r,ri(()=>t.decision,i=>y(i.state,ye,K(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:y(n,K(i=>i.possibleDecisionStates),Qe(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return H(t).with(Ao.Included,()=>De(Zt.Included)).with(Ao.Excluded,()=>De(Zt.Excluded)).otherwise(()=>me)}toDecisionState(t){return H(t).with(Qr.Included,()=>De(Zt.Included)).with(Qr.Excluded,()=>De(Zt.Excluded)).otherwise(()=>me)}toDecisionKind(t){return H(t).with(au.Implicit,()=>kt.Implicit).with(au.Explicit,()=>kt.Explicit).exhaustive()}},fM=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return H(t).with({type:Ie.ChoiceValue},n=>({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ie.Component},n=>({type:Gn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ie.Numeric},n=>({type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).with({type:Ie.Boolean},n=>({type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:y(n.value,Et)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=y([...t],mi(u=>u.type!==Ie.Boolean?me:De({type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:y(u.value,Et)}))),o=y([...t],mi(u=>u.type!==Ie.Numeric?me:De({type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:y(u.value,Et)}))),a=y([...t],mi(u=>u.type!==Ie.ChoiceValue?me:De({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=y([...t],mi(u=>u.type!==Ie.Component?me:De({type:Gn.Component,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:this.mapToDecisionState(u.state)})));return{mode:r,choiceDecisions:a,numericDecisions:o,booleanDecisions:i,componentDecisions:s}}mapToExplicitDecisionsInner(t){const n=y([...t],mi(a=>a.type!==ft.Boolean?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitBooleanDecision(a))))),r=y([...t],mi(a=>a.type!==ft.Numeric?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitNumericDecision(a))))),i=y([...t],mi(a=>a.type!==ft.Component?me:y(a.decision,Mt(s=>s.kind===kt.Explicit),K(()=>this.mapToExplicitComponentDecision(a))))),o=y([...t],mi(a=>a.type!==ft.Choice?me:y(this.mapToExplicitChoiceDecisions(a),Du(s=>y(s,Wa)))),aP);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return H(t).with({type:"Default"},()=>({type:"Default"})).with({type:"KeepExistingDecisions"},()=>({type:"KeepExistingDecisions"})).with({type:"DropExistingDecisions"},n=>this.mapToDropExistingDecisionsMode(n)).exhaustive()}mapToGlobalAttributeId(t){return{localId:t.localId,componentPath:y(t.componentPath,ye,K(ip),Mn),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:H(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:qe.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:Gn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:y(t.decision,K(n=>n.state),Et)}}mapToExplicitNumericDecision(t){return{type:Gn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:y(t.decision,K(n=>n.state),Et)}}mapToExplicitComponentDecision(t){return{type:Gn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(y(t.decision,K(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return y(r.decision,K(i=>i.kind===kt.Explicit),Qe(()=>!1))}return y(t.values,Vt(n),z(r=>({type:Gn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(y(r.decision,K(i=>i.state)))})),ip)}mapToDecisionState(t){return y(t,K(n=>H(n).with(Zt.Included,()=>Qr.Included).with(Zt.Excluded,()=>Qr.Excluded).exhaustive()),Qe(()=>Qr.Undefined))}mapToPossibleDecisionState(t){return H(t).with(Zt.Included,()=>Ao.Included).with(Zt.Excluded,()=>Ao.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return H(t).with({subject:mn.attribute},n=>({type:yp.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:mn.configuration},()=>({type:yp.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return H(t).with({subject:mn.boolean},n=>({type:Is.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:mn.numeric},n=>({type:Is.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:mn.component},n=>({type:Is.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:mn.choiceValue},n=>({type:Is.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},dM=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return y(t.configuration.attributes,Pt(n=>H(n).with({type:ft.Boolean},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ai)).with({type:ft.Numeric},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ai)).with({type:ft.Choice},r=>y(r.values,Pt(i=>y(i.decision,K(o=>o.kind===kt.Explicit),Qe(()=>!1))),Ai)).with({type:ft.Component},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),Ai)).exhaustive()),ri(()=>!1,()=>!0))},getExplicitDecisions(t){return y(t.configuration.attributes,z(n=>H(n).with({type:ft.Boolean},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Boolean,attributeId:r.attributeId,value:ye(i.state)})),K(i=>[i]))).with({type:ft.Numeric},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Numeric,attributeId:r.attributeId,value:ye(i.state)})),K(i=>[i]))).with({type:ft.Choice},r=>y(r.values,z(i=>y(i.decision,Mt(o=>o.kind===kt.Explicit),K(o=>({type:Ie.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:ye(o.state)})))),qn,Ni)).with({type:ft.Component},r=>y(r.decision,Mt(i=>i.kind===kt.Explicit),K(i=>({type:Ie.Component,attributeId:r.attributeId,state:ye(i.state)})),K(i=>[i]))).exhaustive()),qn,Ha)}}}},pM=class{constructor(t,n,r,i,o,a){this.engineApiClient=n,this.domainToRestMapper=i,this.restToDomainMapper=r,this.domainToContractMapper=o,this.domainUpdater=a,this.sessionHandler=t,this.interpreter=new dM}close(t){return this.sessionHandler.close(t)}recreate(t){return this.initializeInner(t,!1)}reinitialize(t){return this.initializeInner(t,!0)}makeDecision(t,n){const r=this.domainToRestMapper.mapToExplicitDecision(t);return this.withSession(n,(i,o)=>y(this.engineApiClient.makeDecision(i,r),wr(Kr),Ht(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=H(t).with({question:Yn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Yn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return y(i,wr(Kr),Ht(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return y(a,Sr(s=>{var u,l,c,f;return y([],Re(y(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],z(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Re(y(((l=s.rejectedDecisions)==null?void 0:l.numericDecisions)??[],z(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Re(y(((c=s.rejectedDecisions)==null?void 0:c.componentDecisions)??[],z(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Re(y(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],z(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),da(this.domainUpdater.updateConfigurationSession(o,s))}))})}replaceDecisions(t,n){const r=this.interpreter.configurationSession.getExplicitDecisions(n),i=this.setManyInner(r,{type:"DropExistingDecisions",conflictHandling:{type:"Automatic"}},t);return y(i,Ht(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return y(o,wr(Kr),Sr(a=>{const s={rejectedDecisions:{booleanDecisions:qe.array(qe.any)}},u={decisionExplanations:qe.array(qe.any)};return H(a).with(s,l=>Ka(l)).with(u,l=>Pi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(l,i,n))).otherwise(()=>Pi({type:xe.Unknown}))}))}explainWhyStateNotPossible(t,n){const r=this.domainToRestMapper.mapToWhyStateNotPossibleRequest(t);return this.engineApiClient.getWhyStateNotPossible(n,r)}explainWhyNotSatisfied(t,n){const r=this.domainToRestMapper.mapToWhyNotSatisfiedRequest(t);return this.engineApiClient.getWhyNotSatisfied(n,r)}withSession(t,n){return y(da(t),Sr(r=>y(r.sessionId,ri(()=>this.initializeInner(r,!1),()=>da(r)))),Sr(r=>y(r.sessionId,cv(()=>({type:xe.ConfigurationUnauthenticated})),Sr(i=>n(i,r)))))}initializeInner(t,n){return y(GP,()=>y(t.sessionId,eR,rR(s=>n?ZP(s):y(this.sessionHandler.close(s),ac(()=>me,()=>me)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return y(s,MP(()=>({type:xe.ConfigurationUnauthenticated})),fw(()=>this.sessionHandler.create(u)))},s=>y(s,zP(u=>y(Ni(t),Mt(this.interpreter.configurationSession.hasExplicitDecisions),K(l=>this.replaceDecisions(u,l)),Qe(()=>da({}))))),s=>y(s,Sr(u=>{const l=this.determineConsequences(u),c=this.determineDecisions(u),f=o2(qP)({consequences:l,decisions:c});return y(f,Ht(({decisions:d,consequences:h})=>this.restToDomainMapper.mapToConfigurationModel(d,h)),Ht(d=>({sessionId:Ni(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return y(this.engineApiClient.getDecisions(t),wr(Kr))}determineConsequences(t){return y(this.engineApiClient.getConsequence(t),wr(Kr))}},hM=class{constructor(t,n){this.onConfigurationChangedHandler=me,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return y(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return y(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:me}}restoreConfiguration(t){return y(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return y(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return y(this.configurationSession.sessionId,K(t=>this.sessionHandler.close(t)),K(Ln(Ht(t=>{this.configurationSession={...this.configurationSession,sessionId:me}}))),Qe(Ba(dk())))}applySolution(t){return y(this.configurationSession.solutions,Pt(n=>xk.equals(n,t)),cv(()=>({type:xe.ConfigurationSolutionNotAvailable})),Ht(n=>n.decisions),Sr(n=>this.setMany(n,t.mode)))}setMany(t,n){return y(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),eu(r=>()=>{const i=H(r).with({decisionExplanations:qe.array(qe.any)},o=>De(o.decisionExplanations)).otherwise(()=>me);this.configurationSession={...this.configurationSession,solutions:y(i,K(Ln(z(o=>o.solution))),Qe(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=H(t).with({decisionExplanations:qe.array(qe.any)},r=>r.decisionExplanations).otherwise(()=>[]);return y(n,z(r=>r.solution))}invalidateAvailableSolutions(){return HP(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return eu(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Zs(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Ln(Zs(t=>()=>{this.configurationSession=t,y(this.onConfigurationChangedHandler,YP(n=>()=>n(this.configurationSession.configuration)))}),Ht(t=>t.configuration),this.invalidateAvailableSolutions())}},vM=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=JR(r,KR.concat(XR(i),YR(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Ko(this.policy,n,r=>y(r,ao(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Ko(this.policy,r,i=>y(i,ao(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return H(t).with({type:xe.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:xe.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},mM=class{constructor(){this.queue=[],this.operating=me}push(t){const n=new yM(t);return this.queue.push(n),this.operating=y(this.operating,Qe(()=>this.start()),Ni),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=y(t,z(r=>r.argument),rp(me,(r,i)=>this.reduce(r,i)),K(Ln(r=>this.execute(r),r=>r.then(i=>{y(t,z(o=>{o.resolve(i)}))}).catch(i=>{y(t,z(o=>{o.reject(i)}))}))),Et);n&&await n}this.operating=me}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},yM=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},gM=class extends mM{constructor(t){super(),this.inner=t}reduce(t,n){return De(n)}async execute(t){return await this.inner.setSessionContext(t)()}},bM=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new gM(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(mk.equals(n,t))return Ka(this.getConfiguration());const r=this.setContextReducingTaskExecutor.push(t);return()=>r}applySolution(t){return this.inner.applySolution(t)}close(){return this.inner.close()}makeDecision(t){return this.inner.makeDecision(t)}restoreConfiguration(t){return this.inner.restoreConfiguration(t)}setMany(t,n){return this.inner.setMany(t,n)}explain(t){return this.inner.explain(t)}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}},SM=class{constructor(t,n=!1){this.stringify=n,this.inner=t,this.durationNumberFormat=new Intl.NumberFormat("en-EN",{maximumFractionDigits:3})}withLogging(t,n,r){const i=performance.now(),o=()=>{const a=performance.now()-i;return this.durationNumberFormat.format(a)};return console.debug(`Operation ${t} started with`,this.renderAsRequired(n)),y(r(),eu(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Zs(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with success`,this.renderAsRequired(a))}))}renderAsRequired(t){return this.stringify?JSON.stringify(t,null,2):t}explain(t){return this.withLogging("explain",[t],()=>this.inner.explain(t))}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){return this.withLogging("setSessionContext",[t],()=>this.inner.setSessionContext(t))}applySolution(t){return this.withLogging("applySolution",[t],()=>this.inner.applySolution(t))}close(){return this.inner.close()}makeDecision(t){return this.withLogging("makeDecision",[t],()=>this.inner.makeDecision(t))}restoreConfiguration(t){return this.withLogging("restoreConfiguration",[t],()=>this.inner.restoreConfiguration(t))}setMany(t,n){return this.withLogging("setMany",[t,n],()=>this.inner.setMany(t,n))}invalidateSessionId(){return this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}};class gv{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+vv()}static new(t){return new gv(t)}close(){return this.executeTaskSynchronous(()=>this.inner.close())}restoreConfiguration(t){return this.executeTaskSynchronous(()=>this.inner.restoreConfiguration(t))}setSessionContext(t){return this.executeTaskSynchronous(()=>this.inner.setSessionContext(t))}invalidateSessionId(){return this.inner.invalidateSessionId()}makeDecision(t){return this.executeTaskSynchronous(()=>this.inner.makeDecision(t))}applySolution(t){return this.executeTaskSynchronous(()=>this.inner.applySolution(t))}setMany(t,n){return this.executeTaskSynchronous(()=>this.inner.setMany(t,n))}explain(t){return this.executeTaskSynchronous(()=>this.inner.explain(t))}setOnConfigurationChangedHandler(t){return this.inner.setOnConfigurationChangedHandler(t)}getConfiguration(){return this.inner.getConfiguration()}getSessionContext(){return this.inner.getSessionContext()}executeTaskSynchronous(t){return()=>navigator.locks.request(this.lockName,{mode:"exclusive"},()=>t()())}}function CM(e){e=uM(e);const t=new Rk(e.hcaEngineBaseUrl),n=new $w,r=new fM,i=new Dw,o=new ck,a=new cM(n),s=H(e.sessionHandler).with({create:qe.any,close:qe.any},c=>c).with({accessToken:qe.string},c=>new Pk(t,o,n,c)).with({sessionCreateUrl:qe.string,sessionDeleteUrl:qe.string},c=>new kk(o,c)).exhaustive(),u=new pM(s,t,n,r,i,a),l=(c,f)=>y(new hM(c,f),d=>new vM(d),d=>new bM(d),gv.new,d=>new SM(d,!1));return new _k(u,l)}const Pu=Ja.equals,wM=Tw.equals;ik.equals;function cf(e){return An((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}/*! *****************************************************************************
|
|
71
71
|
Copyright (c) Microsoft Corporation.
|
|
72
72
|
|
|
73
73
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -80,12 +80,12 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
80
80
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
81
81
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
82
82
|
PERFORMANCE OF THIS SOFTWARE.
|
|
83
|
-
***************************************************************************** */var re=function(){return re=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},re.apply(this,arguments)};function yv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Be(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function We(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function gt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var vt;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(vt||(vt={}));var $o;(function(e){e.Parent="#_parent",e.Internal="#_internal"})($o||($o={}));var mp=vt.Start,gv=vt.Stop,Pu=vt.Raise,cf=vt.Send,Yw=vt.Cancel,wM=vt.NullEvent,bv=vt.Assign;vt.After;vt.DoneState;var Jw=vt.Log,xM=vt.Init,yp=vt.Invoke;vt.ErrorExecution;var xy=vt.ErrorPlatform,TM=vt.ErrorCustom,Xw=vt.Update,EM=vt.Choose,IM=vt.Pure,Qw=".",Ty={},gp="xstate.guard",AM="",Ot=process.env.NODE_ENV==="production",tl;function Sv(e,t,n){n===void 0&&(n=Qw);var r=_s(e,n),i=_s(t,n);return Ke(i)?Ke(r)?i===r:!1:Ke(r)?r in i:Object.keys(r).every(function(o){return o in i?Sv(r[o],i[o]):!1})}function Zw(e){try{return Ke(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function bp(e,t){try{return Qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function $M(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function _s(e,t){if($M(e))return e.value;if(Qa(e))return sc(e);if(typeof e!="string")return e;var n=bp(e,t);return sc(n)}function sc(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function Is(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function Ey(e,t,n){var r,i,o={};try{for(var a=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];n(l)&&(o[u]=t(l,u,e))}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var OM=function(e){return function(t){var n,r,i=t;try{for(var o=Be(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=i[s]}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function DM(e,t){return function(n){var r,i,o=n;try{for(var a=Be(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function Rl(e){if(!e)return[[]];if(Ke(e))return[[e]];var t=At(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:Rl(e[n]).map(function(i){return[n].concat(i)})}));return t}function At(e){var t;return(t=[]).concat.apply(t,gt([],We(e),!1))}function e0(e){return Qa(e)?e:[e]}function mr(e){return e===void 0?[]:e0(e)}function uc(e,t,n){var r,i;if(nt(e))return e(t,n.data);var o={};try{for(var a=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];nt(l)?o[u]=l(t,n.data):o[u]=l}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function NM(e){return/^(done|error)\./.test(e)}function Iy(e){return!!(e instanceof Promise||e!==null&&(nt(e)||typeof e=="object")&&nt(e.then))}function PM(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function RM(e,t){var n,r,i=We([[],[]],2),o=i[0],a=i[1];try{for(var s=Be(e),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)?o.push(l):a.push(l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function t0(e,t){return Is(e.states,function(n,r){if(n){var i=(Ke(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:t0(n,i)}}})}function kM(e,t){return{current:t,states:t0(e,t)}}function Ay(e,t,n,r){Ot||nn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,l=a.assignment,c={state:r,action:a,_event:t},f={};if(nt(l))f=l(o,t.data,c);else try{for(var d=Be(Object.keys(l)),h=d.next();!h.done;h=d.next()){var p=h.value,v=l[p];f[p]=nt(v)?v(o,t.data,c):v}}catch(g){s={error:g}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var nn=function(){};Ot||(nn=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});function Qa(e){return Array.isArray(e)}function nt(e){return typeof e=="function"}function Ke(e){return typeof e=="string"}function n0(e,t){if(e)return Ke(e)?{type:gp,name:e,predicate:t?t[e]:void 0}:nt(e)?{type:gp,name:e.name,predicate:e}:e}function MM(e){try{return"subscribe"in e&&nt(e.subscribe)}catch{return!1}}var Ti=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();tl={},tl[Ti]=function(){return this},tl[Symbol.observable]=function(){return this};function ti(e){return!!e&&"__xstatenode"in e}function jM(e){return!!e&&typeof e.send=="function"}var _M=function(){var e=0;return function(){return e++,e.toString(16)}}();function ff(e,t){return Ke(e)||typeof e=="number"?re({type:e},t):e}function dn(e,t){if(!Ke(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=ff(e);return re({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Yo(e,t){var n=e0(t).map(function(r){return typeof r>"u"||typeof r=="string"||ti(r)?{target:r,event:e}:re(re({},r),{event:e})});return n}function qM(e){if(!(e===void 0||e===AM))return mr(e)}function FM(e,t,n){if(!Ot){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function r0(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===gp)return((o==null?void 0:o[t.name])||t.predicate)(n,r.data,a);var s=o==null?void 0:o[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function i0(e){return typeof e=="string"?{type:e}:e}function kl(e,t,n){var r=function(){},i=typeof e=="object",o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function nl(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Sp(e){return(e.type===Pu||e.type===cf&&e.to===$o.Internal)&&typeof e.delay!="number"}var Sa=dn({type:xM});function Cp(e,t){return t&&t[e]||void 0}function au(e,t){var n;if(Ke(e)||typeof e=="number"){var r=Cp(e,t);nt(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(nt(e))n={type:e.name||e.toString(),exec:e};else{var r=Cp(e.type,t);if(nt(r))n=re(re({},e),{exec:r});else if(r){var i=r.type||e.type;n=re(re(re({},r),e),{type:i})}else n=e}return n}var Ei=function(e,t){if(!e)return[];var n=Qa(e)?e:[e];return n.map(function(r){return au(r,t)})};function Cv(e){var t=au(e);return re(re({id:Ke(e)?e:t.id},t),{type:t.type})}function LM(e,t){return{type:Pu,event:typeof e=="function"?e:ff(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function VM(e,t,n,r){var i={_event:n},o=dn(nt(e.event)?e.event(t,n.data,i):e.event),a;if(Ke(e.delay)){var s=r&&r[e.delay];a=nt(s)?s(t,n.data,i):s}else a=nt(e.delay)?e.delay(t,n.data,i):e.delay;return re(re({},e),{type:Pu,_event:o,delay:a})}function df(e,t){return{to:t?t.to:void 0,type:cf,event:nt(e)?e:ff(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:nt(e)?e.name:Zw(e)}}function BM(e,t,n,r){var i={_event:n},o=dn(nt(e.event)?e.event(t,n.data,i):e.event),a;if(Ke(e.delay)){var s=r&&r[e.delay];a=nt(s)?s(t,n.data,i):s}else a=nt(e.delay)?e.delay(t,n.data,i):e.delay;var u=nt(e.to)?e.to(t,n.data,i):e.to;return re(re({},e),{to:u,_event:o,event:o.data,delay:a})}function UM(e,t){return df(e,re(re({},t),{to:$o.Parent}))}var GM=function(e,t,n){return re(re({},e),{value:Ke(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},zM=function(e){return{type:Yw,sendId:e}};function WM(e){var t=Cv(e);return{type:vt.Start,activity:t,exec:void 0}}function HM(e){var t=nt(e)?e:Cv(e);return{type:vt.Stop,activity:t,exec:void 0}}function KM(e,t,n){var r=nt(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:vt.Stop,activity:i};return o}var YM=function(e){return{type:bv,assignment:e}};function JM(e,t){var n=t?"#".concat(t):"";return"".concat(vt.After,"(").concat(e,")").concat(n)}function rl(e,t){var n="".concat(vt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Ml(e,t){var n="".concat(vt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function As(e,t){var n="".concat(vt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function XM(e,t){if(!Ot&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,gt([],We(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return df(function(r,i){return i},re(re({},t),{to:e}))}var QM=function(e){var t,n,r=[];try{for(var i=Be(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===bv){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function lc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:QM(i),u=s.length?Ay(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case Pu:{var C=VM(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case cf:var m=BM(v,u,r,e.options.delays);if(!Ot){var b=v.delay;nn(!Ke(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==$o.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case Jw:{var x=GM(v,u,r);return o==null||o(x,u,r),x}case EM:{var T=v,E=(g=T.conds.find(function(B){var G=n0(B.cond,e.options.guards);return!G||r0(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=We(lc(e,t,u,r,[{type:p,actions:Ei(mr(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case IM:{var E=v.get(u,r.data);if(!E)return[];var P=We(lc(e,t,u,r,[{type:p,actions:Ei(mr(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case gv:{var x=KM(v,u,r);return o==null||o(x,n,r),x}case bv:{u=Ay(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=au(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=re(re({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,gt([l[k]],We(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Be(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=At(i.map(d));return[h,u]}var cc=[],ia=function(e,t){cc.push(e);var n=t(e);return cc.pop(),n},ZM=function(e){return e(cc[cc.length-1])};function o0(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[Ti]=function(){return this},t}function ej(e,t,n,r){var i,o=i0(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?uc(e.data,n,r):void 0,u=a?wv(a,e.id,s):o0(e.id);return u.meta=e,u}function wv(e,t,n){var r=o0(t);if(r.deferred=!0,ti(e)){var i=r.state=ia(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function tj(e){try{return typeof e.send=="function"}catch{return!1}}function nj(e){return tj(e)&&"id"in e}function rj(e){var t;return re((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[Ti]=function(){return this},t),e)}var fc=function(e){return e.type==="atomic"||e.type==="final"};function a0(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function su(e){return a0(e).filter(function(t){return t.type!=="history"})}function s0(e){var t=[e];return fc(e)?t:t.concat(At(su(e).map(s0)))}function $s(e,t){var n,r,i,o,a,s,u,l,c=new Set(e),f=wp(c),d=new Set(t);try{for(var h=Be(d),p=h.next();!p.done;p=h.next())for(var v=p.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){n={error:I}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var C=wp(d);try{for(var m=Be(d),b=m.next();!b.done;b=m.next()){var v=b.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(P){return d.add(P)}):v.initialStateNodes.forEach(function(P){return d.add(P)});else if(v.type==="parallel")try{for(var x=(a=void 0,Be(su(v))),T=x.next();!T.done;T=x.next()){var E=T.value;d.has(E)||(d.add(E),f.get(E)?f.get(E).forEach(function(P){return d.add(P)}):E.initialStateNodes.forEach(function(P){return d.add(P)}))}}catch(P){a={error:P}}finally{try{T&&!T.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Be(d),N=A.next();!N.done;N=A.next())for(var v=N.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){u={error:I}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(u)throw u.error}}return d}function u0(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(fc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=u0(o,t)}),i}function wp(e){var t,n,r=new Map;try{for(var i=Be(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function ij(e,t){var n=$s([e],t);return u0(e,wp(n))}function Os(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function oj(e){return gt([],We(new Set(At(gt([],We(e.map(function(t){return t.ownEvents})),!1)))),!1)}function jl(e,t){return t.type==="compound"?su(t).some(function(n){return n.type==="final"&&Os(e,n)}):t.type==="parallel"?su(t).every(function(n){return jl(e,n)}):!1}function aj(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function $y(e){return new Set(At(e.map(function(t){return t.tags})))}function l0(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(Ke(e)||Ke(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return l0(e[i],t[i])})}function sj(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function uj(e,t){var n=e.exec,r=re(re({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return r}var ir=function(){function e(t){var n=this,r;this.actions=[],this.activities=Ty,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||Ty,this.meta=aj(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 oj(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var r=Sa;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=Sa;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),Ke(t))return[t];var i=Object.keys(t);return i.concat.apply(i,gt([],We(i.map(function(o){return r.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=yv(t,["configuration","transitions","tags","machine"]);return re(re({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return Sv(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;Ot&&nn(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},e}(),lj={deferEvents:!1},Oy=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=re(re({},lj),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.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()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e}(),Bf=new Map,cj=0,ms={bookId:function(){return"x:".concat(cj++)},register:function(e,t){return Bf.set(e,t),e},get:function(e){return Bf.get(e)},free:function(e){Bf.delete(e)}};function xv(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;Ot||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function fj(){var e=xv();if(e&&"__xstate__"in e)return e.__xstate__}function dj(e){if(xv()){var t=fj();t&&t.register(e)}}function pj(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var l=i.shift();n=e.transition(n,l,u),r.forEach(function(c){return c.next(n)})}o=!1}},s=rj({id:t.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,c,f){var d=kl(l,c,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,s}var xp={sync:!1,autoForward:!1},Nt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Nt||(Nt={}));var hj=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,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=!1,this.status=Nt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,f){if(Qa(c))return r.batch(c),r.state;var d=dn(ff(c,f));if(r.status===Nt.Stopped)return Ot||nn(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(r.machine.id,`". This service has already reached its final state, and will not transition.
|
|
83
|
+
***************************************************************************** */var re=function(){return re=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},re.apply(this,arguments)};function bv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Be(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function We(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function gt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var vt;(function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"})(vt||(vt={}));var $o;(function(e){e.Parent="#_parent",e.Internal="#_internal"})($o||($o={}));var gp=vt.Start,Sv=vt.Stop,Ru=vt.Raise,ff=vt.Send,Jw=vt.Cancel,xM=vt.NullEvent,Cv=vt.Assign;vt.After;vt.DoneState;var Xw=vt.Log,TM=vt.Init,bp=vt.Invoke;vt.ErrorExecution;var Ty=vt.ErrorPlatform,EM=vt.ErrorCustom,Qw=vt.Update,IM=vt.Choose,AM=vt.Pure,Zw=".",Ey={},Sp="xstate.guard",$M="",Ot=process.env.NODE_ENV==="production",nl;function wv(e,t,n){n===void 0&&(n=Zw);var r=qs(e,n),i=qs(t,n);return Ke(i)?Ke(r)?i===r:!1:Ke(r)?r in i:Object.keys(r).every(function(o){return o in i?wv(r[o],i[o]):!1})}function e0(e){try{return Ke(e)||typeof e=="number"?"".concat(e):e.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function Cp(e,t){try{return Qa(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function OM(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function qs(e,t){if(OM(e))return e.value;if(Qa(e))return uc(e);if(typeof e!="string")return e;var n=Cp(e,t);return uc(n)}function uc(e){if(e.length===1)return e[0];for(var t={},n=t,r=0;r<e.length-1;r++)r===e.length-2?n[e[r]]=e[r+1]:(n[e[r]]={},n=n[e[r]]);return t}function As(e,t){for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var o=r[i];n[o]=t(e[o],o,e,i)}return n}function Iy(e,t,n){var r,i,o={};try{for(var a=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];n(l)&&(o[u]=t(l,u,e))}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var DM=function(e){return function(t){var n,r,i=t;try{for(var o=Be(e),a=o.next();!a.done;a=o.next()){var s=a.value;i=i[s]}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}};function NM(e,t){return function(n){var r,i,o=n;try{for(var a=Be(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function kl(e){if(!e)return[[]];if(Ke(e))return[[e]];var t=At(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:kl(e[n]).map(function(i){return[n].concat(i)})}));return t}function At(e){var t;return(t=[]).concat.apply(t,gt([],We(e),!1))}function t0(e){return Qa(e)?e:[e]}function gr(e){return e===void 0?[]:t0(e)}function lc(e,t,n){var r,i;if(nt(e))return e(t,n.data);var o={};try{for(var a=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,l=e[u];nt(l)?o[u]=l(t,n.data):o[u]=l}}catch(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}function PM(e){return/^(done|error)\./.test(e)}function Ay(e){return!!(e instanceof Promise||e!==null&&(nt(e)||typeof e=="object")&&nt(e.then))}function RM(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function kM(e,t){var n,r,i=We([[],[]],2),o=i[0],a=i[1];try{for(var s=Be(e),u=s.next();!u.done;u=s.next()){var l=u.value;t(l)?o.push(l):a.push(l)}}catch(c){n={error:c}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function n0(e,t){return As(e.states,function(n,r){if(n){var i=(Ke(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:n0(n,i)}}})}function MM(e,t){return{current:t,states:n0(e,t)}}function $y(e,t,n,r){Ot||rn(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,l=a.assignment,c={state:r,action:a,_event:t},f={};if(nt(l))f=l(o,t.data,c);else try{for(var d=Be(Object.keys(l)),h=d.next();!h.done;h=d.next()){var p=h.value,v=l[p];f[p]=nt(v)?v(o,t.data,c):v}}catch(g){s={error:g}}finally{try{h&&!h.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var rn=function(){};Ot||(rn=function(e,t){var n=e instanceof Error?e:void 0;if(!(!n&&e)&&console!==void 0){var r=["Warning: ".concat(t)];n&&r.push(n),console.warn.apply(console,r)}});function Qa(e){return Array.isArray(e)}function nt(e){return typeof e=="function"}function Ke(e){return typeof e=="string"}function r0(e,t){if(e)return Ke(e)?{type:Sp,name:e,predicate:t?t[e]:void 0}:nt(e)?{type:Sp,name:e.name,predicate:e}:e}function jM(e){try{return"subscribe"in e&&nt(e.subscribe)}catch{return!1}}var Ei=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();nl={},nl[Ei]=function(){return this},nl[Symbol.observable]=function(){return this};function ii(e){return!!e&&"__xstatenode"in e}function _M(e){return!!e&&typeof e.send=="function"}var qM=function(){var e=0;return function(){return e++,e.toString(16)}}();function df(e,t){return Ke(e)||typeof e=="number"?re({type:e},t):e}function dn(e,t){if(!Ke(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=df(e);return re({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Yo(e,t){var n=t0(t).map(function(r){return typeof r>"u"||typeof r=="string"||ii(r)?{target:r,event:e}:re(re({},r),{event:e})});return n}function FM(e){if(!(e===void 0||e===$M))return gr(e)}function LM(e,t,n){if(!Ot){var r=e.stack?" Stacktrace was '".concat(e.stack,"'"):"";if(e===t)console.error("Missing onError handler for invocation '".concat(n,"', error was '").concat(e,"'.").concat(r));else{var i=t.stack?" Stacktrace was '".concat(t.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(n,"'. ")+"Original error: '".concat(e,"'. ").concat(r," Current error is '").concat(t,"'.").concat(i))}}}function i0(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Sp)return((o==null?void 0:o[t.name])||t.predicate)(n,r.data,a);var s=o==null?void 0:o[t.type];if(!s)throw new Error("Guard '".concat(t.type,"' is not implemented on machine '").concat(e.id,"'."));return s(n,r.data,a)}function o0(e){return typeof e=="string"?{type:e}:e}function Ml(e,t,n){var r=function(){},i=typeof e=="object",o=i?e:null;return{next:((i?e.next:e)||r).bind(o),error:((i?e.error:t)||r).bind(o),complete:((i?e.complete:n)||r).bind(o)}}function rl(e,t){return"".concat(e,":invocation[").concat(t,"]")}function wp(e){return(e.type===Ru||e.type===ff&&e.to===$o.Internal)&&typeof e.delay!="number"}var Sa=dn({type:TM});function xp(e,t){return t&&t[e]||void 0}function su(e,t){var n;if(Ke(e)||typeof e=="number"){var r=xp(e,t);nt(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(nt(e))n={type:e.name||e.toString(),exec:e};else{var r=xp(e.type,t);if(nt(r))n=re(re({},e),{exec:r});else if(r){var i=r.type||e.type;n=re(re(re({},r),e),{type:i})}else n=e}return n}var Ii=function(e,t){if(!e)return[];var n=Qa(e)?e:[e];return n.map(function(r){return su(r,t)})};function xv(e){var t=su(e);return re(re({id:Ke(e)?e:t.id},t),{type:t.type})}function VM(e,t){return{type:Ru,event:typeof e=="function"?e:df(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function BM(e,t,n,r){var i={_event:n},o=dn(nt(e.event)?e.event(t,n.data,i):e.event),a;if(Ke(e.delay)){var s=r&&r[e.delay];a=nt(s)?s(t,n.data,i):s}else a=nt(e.delay)?e.delay(t,n.data,i):e.delay;return re(re({},e),{type:Ru,_event:o,delay:a})}function pf(e,t){return{to:t?t.to:void 0,type:ff,event:nt(e)?e:df(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:nt(e)?e.name:e0(e)}}function UM(e,t,n,r){var i={_event:n},o=dn(nt(e.event)?e.event(t,n.data,i):e.event),a;if(Ke(e.delay)){var s=r&&r[e.delay];a=nt(s)?s(t,n.data,i):s}else a=nt(e.delay)?e.delay(t,n.data,i):e.delay;var u=nt(e.to)?e.to(t,n.data,i):e.to;return re(re({},e),{to:u,_event:o,event:o.data,delay:a})}function GM(e,t){return pf(e,re(re({},t),{to:$o.Parent}))}var zM=function(e,t,n){return re(re({},e),{value:Ke(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},WM=function(e){return{type:Jw,sendId:e}};function HM(e){var t=xv(e);return{type:vt.Start,activity:t,exec:void 0}}function KM(e){var t=nt(e)?e:xv(e);return{type:vt.Stop,activity:t,exec:void 0}}function YM(e,t,n){var r=nt(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:vt.Stop,activity:i};return o}var JM=function(e){return{type:Cv,assignment:e}};function XM(e,t){var n=t?"#".concat(t):"";return"".concat(vt.After,"(").concat(e,")").concat(n)}function il(e,t){var n="".concat(vt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function jl(e,t){var n="".concat(vt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function $s(e,t){var n="".concat(vt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function QM(e,t){if(!Ot&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,gt([],We(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return pf(function(r,i){return i},re(re({},t),{to:e}))}var ZM=function(e){var t,n,r=[];try{for(var i=Be(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===Cv){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function cc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:ZM(i),u=s.length?$y(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case Ru:{var C=BM(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case ff:var m=UM(v,u,r,e.options.delays);if(!Ot){var b=v.delay;rn(!Ke(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==$o.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case Xw:{var x=zM(v,u,r);return o==null||o(x,u,r),x}case IM:{var T=v,E=(g=T.conds.find(function(B){var G=r0(B.cond,e.options.guards);return!G||i0(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=We(cc(e,t,u,r,[{type:p,actions:Ii(gr(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case AM:{var E=v.get(u,r.data);if(!E)return[];var P=We(cc(e,t,u,r,[{type:p,actions:Ii(gr(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case Sv:{var x=YM(v,u,r);return o==null||o(x,n,r),x}case Cv:{u=$y(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=su(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=re(re({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,gt([l[k]],We(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Be(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=At(i.map(d));return[h,u]}var fc=[],ia=function(e,t){fc.push(e);var n=t(e);return fc.pop(),n},ej=function(e){return e(fc[fc.length-1])};function a0(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[Ei]=function(){return this},t}function tj(e,t,n,r){var i,o=o0(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?lc(e.data,n,r):void 0,u=a?Tv(a,e.id,s):a0(e.id);return u.meta=e,u}function Tv(e,t,n){var r=a0(t);if(r.deferred=!0,ii(e)){var i=r.state=ia(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function nj(e){try{return typeof e.send=="function"}catch{return!1}}function rj(e){return nj(e)&&"id"in e}function ij(e){var t;return re((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[Ei]=function(){return this},t),e)}var dc=function(e){return e.type==="atomic"||e.type==="final"};function s0(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function uu(e){return s0(e).filter(function(t){return t.type!=="history"})}function u0(e){var t=[e];return dc(e)?t:t.concat(At(uu(e).map(u0)))}function Os(e,t){var n,r,i,o,a,s,u,l,c=new Set(e),f=Tp(c),d=new Set(t);try{for(var h=Be(d),p=h.next();!p.done;p=h.next())for(var v=p.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){n={error:I}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}var C=Tp(d);try{for(var m=Be(d),b=m.next();!b.done;b=m.next()){var v=b.value;if(v.type==="compound"&&(!C.get(v)||!C.get(v).length))f.get(v)?f.get(v).forEach(function(P){return d.add(P)}):v.initialStateNodes.forEach(function(P){return d.add(P)});else if(v.type==="parallel")try{for(var x=(a=void 0,Be(uu(v))),T=x.next();!T.done;T=x.next()){var E=T.value;d.has(E)||(d.add(E),f.get(E)?f.get(E).forEach(function(P){return d.add(P)}):E.initialStateNodes.forEach(function(P){return d.add(P)}))}}catch(P){a={error:P}}finally{try{T&&!T.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{b&&!b.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Be(d),N=A.next();!N.done;N=A.next())for(var v=N.value,g=v.parent;g&&!d.has(g);)d.add(g),g=g.parent}catch(I){u={error:I}}finally{try{N&&!N.done&&(l=A.return)&&l.call(A)}finally{if(u)throw u.error}}return d}function l0(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(dc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=l0(o,t)}),i}function Tp(e){var t,n,r=new Map;try{for(var i=Be(e),o=i.next();!o.done;o=i.next()){var a=o.value;r.has(a)||r.set(a,[]),a.parent&&(r.has(a.parent)||r.set(a.parent,[]),r.get(a.parent).push(a))}}catch(s){t={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function oj(e,t){var n=Os([e],t);return l0(e,Tp(n))}function Ds(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function aj(e){return gt([],We(new Set(At(gt([],We(e.map(function(t){return t.ownEvents})),!1)))),!1)}function _l(e,t){return t.type==="compound"?uu(t).some(function(n){return n.type==="final"&&Ds(e,n)}):t.type==="parallel"?uu(t).every(function(n){return _l(e,n)}):!1}function sj(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function Oy(e){return new Set(At(e.map(function(t){return t.tags})))}function c0(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(Ke(e)||Ke(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return c0(e[i],t[i])})}function uj(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function lj(e,t){var n=e.exec,r=re(re({},e),{exec:n!==void 0?function(){return n(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0});return r}var or=function(){function e(t){var n=this,r;this.actions=[],this.activities=Ey,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||Ey,this.meta=sj(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 aj(n.configuration)}})}return e.from=function(t,n){if(t instanceof e)return t.context!==n?new e({value:t.value,context:n,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t;var r=Sa;return new e({value:t,context:n,_event:r,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,n){if(t instanceof e){if(!t.actions.length)return t;var r=Sa;return new e({value:t.value,context:n,_event:r,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,n)},e.prototype.toStrings=function(t,n){var r=this;if(t===void 0&&(t=this.value),n===void 0&&(n="."),Ke(t))return[t];var i=Object.keys(t);return i.concat.apply(i,gt([],We(i.map(function(o){return r.toStrings(t[o],n).map(function(a){return o+n+a})})),!1))},e.prototype.toJSON=function(){var t=this;t.configuration,t.transitions;var n=t.tags;t.machine;var r=bv(t,["configuration","transitions","tags","machine"]);return re(re({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return wv(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;Ot&&rn(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var r=(n=this.machine)===null||n===void 0?void 0:n.getTransitionData(this,t);return!!(r!=null&&r.transitions.length)&&r.transitions.some(function(i){return i.target!==void 0||i.actions.length})},e}(),cj={deferEvents:!1},Dy=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=re(re({},cj),t)}return e.prototype.initialize=function(t){if(this.initialized=!0,t){if(!this.options.deferEvents){this.schedule(t);return}this.process(t)}this.flushEvents()},e.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()},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var t=this.queue.shift();t;)this.process(t),t=this.queue.shift()},e.prototype.process=function(t){this.processingEvent=!0;try{t()}catch(n){throw this.clear(),n}finally{this.processingEvent=!1}},e}(),Gf=new Map,fj=0,ys={bookId:function(){return"x:".concat(fj++)},register:function(e,t){return Gf.set(e,t),e},get:function(e){return Gf.get(e)},free:function(e){Gf.delete(e)}};function Ev(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;Ot||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues")}function dj(){var e=Ev();if(e&&"__xstate__"in e)return e.__xstate__}function pj(e){if(Ev()){var t=dj();t&&t.register(e)}}function hj(e,t){t===void 0&&(t={});var n=e.initialState,r=new Set,i=[],o=!1,a=function(){if(!o){for(o=!0;i.length>0;){var l=i.shift();n=e.transition(n,l,u),r.forEach(function(c){return c.next(n)})}o=!1}},s=ij({id:t.id,send:function(l){i.push(l),a()},getSnapshot:function(){return n},subscribe:function(l,c,f){var d=Ml(l,c,f);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:t.parent,self:s,id:t.id||"anonymous",observers:r};return n=e.start?e.start(u):n,s}var Ep={sync:!1,autoForward:!1},Nt;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Nt||(Nt={}));var vj=function(){function e(t,n){n===void 0&&(n=e.defaultOptions);var r=this;this.machine=t,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=!1,this.status=Nt.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(c,f){if(Qa(c))return r.batch(c),r.state;var d=dn(df(c,f));if(r.status===Nt.Stopped)return Ot||rn(!1,'Event "'.concat(d.name,'" was sent to stopped service "').concat(r.machine.id,`". This service has already reached its final state, and will not transition.
|
|
84
84
|
Event: `).concat(JSON.stringify(d.data))),r.state;if(r.status!==Nt.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(d.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.
|
|
85
|
-
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var h=r._nextState(d);r.update(h,d)}),r._state},this.sendTo=function(c,f,d){var h=r.parent&&(f===$o.Parent||r.parent.id===f),p=h?r.parent:Ke(f)?f===$o.Internal?r:r.children.get(f)||
|
|
86
|
-
Event: `).concat(JSON.stringify(event)));else if(this.status!==Nt.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){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,a=n.state,s=!1,u=[],l=function(h){var p=dn(h);n.forward(p),a=ia(n,function(){return n.machine.transition(a,p,void 0,r||void 0)}),u.push.apply(u,gt([],We(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return uj(v,a)})),!1)),s=s||!!a.changed};try{for(var c=Be(t),f=c.next();!f.done;f=c.next()){var d=f.value;l(d)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,dn(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=dn(t);if(i.name.indexOf(xy)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(xy)===0}))throw i.data.data;var o=ia(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var i=Be(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(t)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,r=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=r)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(t,n.context,n._event,r)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),nt(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Nt.Running)return wv(t,n);if(Iy(t))return this.spawnPromise(Promise.resolve(t),n);if(nt(t))return this.spawnCallback(t,n);if(nj(t))return this.spawnActor(t,n);if(MM(t))return this.spawnObservable(t,n);if(ti(t))return this.spawnMachine(t,re(re({},r),{id:n}));if(PM(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var i=new e(t,re(re({},this.options),{parent:this,id:n.id||t.id})),o=re(re({},xp),n);o.sync&&i.onTransition(function(s){r.send(Xw,{state:s,id:i.id})});var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(s){r.removeChild(i.id),r.send(dn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=pj(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,i=this,o=!1,a;t.then(function(u){o||(a=u,i.removeChild(n),i.send(dn(Ml(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var l=As(n,u);try{i.send(dn(l,{origin:n}))}catch(c){FM(u,c,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,l,c){var f=kl(u,l,c),d=!1;return t.then(function(h){d||(f.next(h),!d&&f.complete())},function(h){d||f.error(h)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[Ti]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,i=this,o=!1,a=new Set,s=new Set,u,l=function(d){u=d,s.forEach(function(h){return h(d)}),!o&&i.send(dn(d,{origin:n}))},c;try{c=t(l,function(d){a.add(d)})}catch(d){this.send(As(n,d))}if(Iy(c))return this.spawnPromise(c,n);var f=(r={id:n,send:function(d){return a.forEach(function(h){return h(d)})},subscribe:function(d){var h=kl(d);return s.add(h.next),{unsubscribe:function(){s.delete(h.next)}}},stop:function(){o=!0,nt(c)&&c()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[Ti]=function(){return this},r);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var r,i=this,o,a=t.subscribe(function(u){o=u,i.send(dn(u,{origin:n}))},function(u){i.removeChild(n),i.send(dn(As(n,u),{origin:n}))},function(){i.removeChild(n),i.send(dn(Ml(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,l,c){return t.subscribe(u,l,c)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[Ti]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!n){Ot||nn(!1,"No implementation found for activity '".concat(t.type,"'"));return}var r=n(this.state.context,t);this.spawnEffect(t.id,r)},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[Ti]=function(){return this},r))},e.prototype.attachDev=function(){var t=xv();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(re(re({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:re({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}dj(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[Ti]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Nt.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=c0,e}(),vj=function(e){return Ke(e)?re(re({},xp),{name:e}):re(re(re({},xp),{name:_M()}),e)};function Dy(e,t){var n=vj(t);return ZM(function(r){if(!Ot){var i=ti(e)||nt(e);nn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(ti(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):wv(e,n.name)})}function c0(e,t){var n=new hj(e,t);return n}function mj(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function il(e){return re(re({type:yp},e),{toJSON:function(){e.onDone,e.onError;var t=yv(e,["onDone","onError"]);return re(re({},t),{type:yp,src:mj(e.src)})}})}var oa="",Tp="#",ys="*",Jo={},Xo=function(e){return e[0]===Tp},yj=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},gj=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(Ke(o.target)||ti(o.target))}),i=t===oa?"the transient event":"event '".concat(t,"'");nn(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},bj=function(){function e(t,n,r,i){r===void 0&&(r="context"in t?t.context:void 0);var o=this,a;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(yj(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.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:Qw),this.id=this.config.id||gt([this.machine.key],We(this.path),!1).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:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,Ot||nn(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?Is(this.config.states,function(l,c){var f,d=new e(l,{},void 0,{parent:o,key:c});return Object.assign(o.idMap,re((f={},f[d.id]=d,f),d.idMap)),d}):Jo;var s=0;function u(l){var c,f;l.order=s++;try{for(var d=Be(a0(l)),h=d.next();!h.done;h=d.next()){var p=h.value;u(p)}}catch(v){c={error:v}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(l){var c=l.event;return c===oa}):oa in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=mr(this.config.entry||this.config.onEntry).map(function(l){return au(l)}),this.onExit=mr(this.config.exit||this.config.onExit).map(function(l){return au(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=mr(this.config.invoke).map(function(l,c){var f,d;if(ti(l)){var h=nl(o.id,c);return o.machine.options.services=re((f={},f[h]=l,f),o.machine.options.services),il({src:h,id:h})}else if(Ke(l.src)){var h=l.id||nl(o.id,c);return il(re(re({},l),{id:h,src:l.src}))}else if(ti(l.src)||nt(l.src)){var h=l.id||nl(o.id,c);return o.machine.options.services=re((d={},d[h]=l.src,d),o.machine.options.services),il(re(re({id:h},l),{src:h}))}else{var p=l.src;return il(re(re({id:nl(o.id,c)},l),{src:p}))}}),this.activities=mr(this.config.activities).concat(this.invoke).map(function(l){return Cv(l)}),this.transition=this.transition.bind(this),this.tags=mr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||s0(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,o=r.activities,a=r.guards,s=r.services,u=r.delays;return new e(this.config,{actions:re(re({},i),t.actions),activities:re(re({},o),t.activities),guards:re(re({},a),t.guards),services:re(re({},s),t.services),delays:re(re({},u),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return nt(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.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:Is(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:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===oa,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===ys});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(o,a){var s=nt(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=JM(s,t.id);return t.onEntry.push(df(u,{delay:o})),t.onExit.push(zM(u)),u},i=Qa(n)?n.map(function(o,a){var s=r(o.delay,a);return re(re({},o),{event:s})}):At(Object.keys(n).map(function(o,a){var s=n[o],u=Ke(s)?{target:s}:s,l=isNaN(+o)?o:+o,c=r(l,a);return mr(u).map(function(f){return re(re({},f),{event:c,delay:l})})}));return i.map(function(o){var a=o.delay;return re(re({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var i=t instanceof ir?t.value:_s(t,this.delimiter);if(Ke(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var a=Object.keys(i),s=[this];return s.push.apply(s,gt([],We(At(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=Zw(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof ir?t:ir.create(t),r=Array.from($s([],this.getStateNodes(n.value)));return new ir(re(re({},n),{value:this.resolve(n.value),configuration:r,done:jl(r,this),tags:$y(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var i=this.getStateNode(t),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},e.prototype.transitionCompoundNode=function(t,n,r){var i=Object.keys(t),o=this.getStateNode(i[0]),a=o._transition(t[i[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var i,o,a={};try{for(var s=Be(Object.keys(t)),u=s.next();!u.done;u=s.next()){var l=u.value,c=t[l];if(c){var f=this.getStateNode(l),d=f._transition(c,n,r);d&&(a[l]=d)}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var h=Object.keys(a).map(function(C){return a[C]}),p=At(h.map(function(C){return C.transitions})),v=h.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,r);var g=At(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:p,exitSet:At(h.map(function(C){return C.exitSet})),configuration:g,source:n,actions:At(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,r){return Ke(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,dn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],l;try{for(var c=Be(this.getCandidates(a)),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.cond,p=d.in,v=t.context,g=p?Ke(p)&&Xo(p)?t.matches(_s(this.getStateNodeById(p).path,this.delimiter)):Sv(_s(p,this.delimiter),OM(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!h||r0(this.machine,h,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
-
`).concat(x.message))}if(C&&g){d.target!==void 0&&(u=d.target),s.push.apply(s,gt([],We(d.actions),!1)),l=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}if(l){if(!u.length)return{transitions:[l],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=At(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),b=!!l.internal;return{transitions:[l],exitSet:b?[]:At(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:m,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,i=t;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},e.prototype.getActions=function(t,n,r,i,o,a,s){var u,l,c,f,d=this,h=a?$s([],this.getStateNodes(a.value)):[],p=new Set;try{for(var v=Be(Array.from(t).sort(function(_,L){return _.order-L.order})),g=v.next();!g.done;g=v.next()){var C=g.value;(!Os(h,C)||Os(r.exitSet,C)||C.parent&&p.has(C.parent))&&p.add(C)}}catch(_){u={error:_}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(u)throw u.error}}try{for(var m=Be(h),b=m.next();!b.done;b=m.next()){var C=b.value;(!Os(t,C)||Os(r.exitSet,C.parent))&&r.exitSet.push(C)}}catch(_){c={error:_}}finally{try{b&&!b.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var x=Array.from(p).sort(function(_,L){return _.order-L.order}),T=new Set(r.exitSet),E=At(x.map(function(_){var L=[];if(_.type!=="final")return L;var U=_.parent;if(!U.parent)return L;L.push(rl(_.id,_.doneData),rl(U.id,_.doneData?uc(_.doneData,i,o):void 0));var Y=U.parent;return Y.type==="parallel"&&su(Y).every(function(k){return jl(r.configuration,k)})&&L.push(rl(Y.id)),L})),A=x.map(function(_){var L=_.onEntry,U=_.activities.map(function(Y){return WM(Y)});return{type:"entry",actions:Ei(s?gt(gt([],We(L),!1),We(U),!1):gt(gt([],We(U),!1),We(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:E.map(function(_){return LM(_)})}),N=Array.from(T).map(function(_){return{type:"exit",actions:Ei(gt(gt([],We(_.onExit),!1),We(_.activities.map(function(L){return HM(L)})),!1),d.machine.options.actions)}}),I=N.concat({type:"transition",actions:Ei(r.actions,this.machine.options.actions)}).concat(A);if(n){var P=Ei(At(gt([],We(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Sp(_)});return I.concat({type:"stop",actions:P})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=dn(n),a;if(t instanceof ir)a=r===void 0?t:this.resolveState(ir.from(t,r));else{var s=Ke(t)?this.resolve(sc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(ir.from(s,u))}if(!Ot&&o.name===ys)throw new Error("An event cannot have the wildcard type ('".concat(ys,"')"));if(this.strict&&!this.events.includes(o.name)&&!NM(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},c=$s([],this.getStateNodes(a.value)),f=l.configuration.length?$s(c,l.configuration):c;return l.configuration=gt([],We(f),!1),this.resolveTransition(l,a,a.context,i,o)},e.prototype.resolveRaisedTransition=function(t,n,r,i){var o,a=t.actions;return t=this.transition(t,n,void 0,i),t._event=r,t.event=r.data,(o=t.actions).unshift.apply(o,gt([],We(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,l,c=this;o===void 0&&(o=Sa);var f=t.configuration,d=!n||t.transitions.length>0,h=d?t.configuration:n?n.configuration:[],p=jl(h,this),v=d?ij(this.machine,f):void 0,g=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(h),p,t,r,o,n,i),m=n?re({},n.activities):{};try{for(var b=Be(C),x=b.next();!x.done;x=b.next()){var T=x.value;try{for(var E=(u=void 0,Be(T.actions)),A=E.next();!A.done;A=E.next()){var N=A.value;N.type===mp?m[N.activity.id||N.activity.type]=N:N.type===gv&&(m[N.activity.id||N.activity.type]=!1)}}catch(X){u={error:X}}finally{try{A&&!A.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}}catch(X){a={error:X}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}var I=We(lc(this,n,r,o,C,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),P=I[0],_=I[1],L=We(RM(P,Sp),2),U=L[0],Y=L[1],k=P.filter(function(X){var ae;return X.type===mp&&((ae=X.activity)===null||ae===void 0?void 0:ae.type)===yp}),ie=k.reduce(function(X,ae){return X[ae.activity.id]=ej(ae.activity,c.machine,_,o),X},n?re({},n.children):{}),B=new ir({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?g?kM(g,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?Y:[],activities:v?m:n?n.activities:{},events:[],configuration:h,transitions:t.transitions,children:ie,done:p,tags:$y(h),machine:this}),G=r!==_;B.changed=o.name===Xw||G;var fe=B.history;fe&&delete fe.history;var j=!p&&(this._transient||f.some(function(X){return X._transient}));if(!d&&(!j||o.name===oa))return B;var R=B;if(!p)for(j&&(R=this.resolveRaisedTransition(R,{type:wM},o,i));U.length;){var te=U.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||G||typeof fe.value!=typeof R.value||!l0(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Xo(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 n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=Xo(t)?t.slice(Tp.length):t;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&Xo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=bp(t,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},e.prototype.resolve=function(t){var n,r=this;if(!t)return this.initialStateValue||Jo;switch(this.type){case"parallel":return Is(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Jo});case"compound":if(Ke(t)){var i=this.getStateNode(t);return i.type==="parallel"||i.type==="compound"?(n={},n[t]=i.initialStateValue,n):t}return Object.keys(t).length?Is(t,function(o,a){return o?r.getStateNode(a).resolve(o):Jo}):this.initialStateValue||{};default:return t||Jo}},e.prototype.getResolvedPath=function(t){if(Xo(t)){var n=this.machine.idMap[t.slice(Tp.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return bp(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Ey(this.states,function(r){return r.initialStateValue||Jo},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=fc(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.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:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;Ke(n.target)?t=Xo(n.target)?sc(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(fc(this))return[this];if(this.type==="compound"&&!this.initial)return Ot||nn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=Rl(this.initialStateValue);return At(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=We(t),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.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)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:Ey(this.states,function(n,r){if(!t)return n.historyValue();var i=Ke(t)?void 0:t[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var i=this.target;return i?At(Rl(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=DM(r.path,"states")(t).current;return Ke(o)?[r.getStateNode(o)]:At(Rl(o).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=At(Object.keys(this.states).map(function(r){return t.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=Be(Object.keys(o)),u=s.next();!u.done;u=s.next()){var l=u.value,c=o[l];if(c.states)try{for(var f=(r=void 0,Be(c.events)),d=f.next();!d.done;d=f.next()){var h=d.value;a.add("".concat(h))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(p){t={error:p}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!Ke(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
88
|
-
`).concat(s.message))}else return n.getStateNodeByPath(o)})},e.prototype.formatTransition=function(t){var n=this,r=
|
|
85
|
+
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var h=r._nextState(d);r.update(h,d)}),r._state},this.sendTo=function(c,f,d){var h=r.parent&&(f===$o.Parent||r.parent.id===f),p=h?r.parent:Ke(f)?f===$o.Internal?r:r.children.get(f)||ys.get(f):_M(f)?f:void 0;if(!p){if(!h)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));Ot||rn(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(c.type));return}if("machine"in p){if(r.status!==Nt.Stopped||r.parent!==p||r.state.done){var v=re(re({},c),{name:c.name===EM?"".concat($s(r.id)):c.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([p,v]):p.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([p,c.data]):p.send(c.data)},this._exec=function(c,f,d,h){h===void 0&&(h=r.machine.options.actions);var p=c.exec||xp(c.type,h),v=nt(p)?p:p?p.exec:c.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:c,_event:d}:{action:c,state:r.state,_event:d})}catch(Y){throw r.parent&&r.parent.send({type:"xstate.error",data:Y}),Y}switch(c.type){case Ru:{var g=c;r.defer(g);break}case ff:var C=c;if(typeof C.delay=="number"){r.defer(C);return}else C.to?r.sendTo(C._event,C.to,d===Sa):r.send(C._event);break;case Jw:r.cancel(c.sendId);break;case gp:{if(r.status!==Nt.Running)return;var m=c.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[m.id||m.type])break;if(m.type===vt.Invoke){var b=o0(m.src),x=r.machine.options.services?r.machine.options.services[b.type]:void 0,T=m.id,E=m.data;Ot||rn(!("forward"in m),"`forward` property is deprecated (found in invocation of '".concat(m.src,"' in in machine '").concat(r.machine.id,"'). ")+"Please use `autoForward` instead.");var A="autoForward"in m?m.autoForward:!!m.forward;if(!x){Ot||rn(!1,"No service found for invocation '".concat(m.src,"' in machine '").concat(r.machine.id,"'."));return}var N=E?lc(E,f,d):void 0;if(typeof x=="string")return;var I=nt(x)?x(f,d.data,{data:N,src:b,meta:m.meta}):x;if(!I)return;var P=void 0;ii(I)&&(I=N?I.withContext(N):I,P={autoForward:A}),r.spawn(I,T,P)}else r.spawnActivity(m);break}case Sv:{r.stopChild(c.activity.id);break}case Xw:var _=c,L=_.label,U=_.value;L?r.logger(L,U):r.logger(U);break;default:Ot||rn(!1,"No implementation found for action type '".concat(c.type,"'"));break}};var i=re(re({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,l=u!==void 0?u:t.id;this.id=l,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new Dy({deferEvents:this.options.deferEvents}),this.sessionId=ys.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:ia(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return Ot||rn(this.status!==Nt.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(t,n){var r,i;try{for(var o=Be(t.actions),a=o.next();!a.done;a=o.next()){var s=a.value;this.exec(s,t,n)}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.update=function(t,n){var r,i,o,a,s,u,l,c,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===Sa)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(I){f.state.children[I.id]=I}),this.devTools&&this.devTools.send(n.data,t),t.event)try{for(var h=Be(this.eventListeners),p=h.next();!p.done;p=h.next()){var v=p.value;v(t.event)}}catch(I){r={error:I}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var g=Be(this.listeners),C=g.next();!C.done;C=g.next()){var v=C.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{C&&!C.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var m=Be(this.contextListeners),b=m.next();!b.done;b=m.next()){var x=b.value;x(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(this.state.done){var T=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),E=T&&T.doneData?lc(T.doneData,t.context,n):void 0;this._doneEvent=jl(this.id,E);try{for(var A=Be(this.doneListeners),N=A.next();!N.done;N=A.next()){var v=N.value;v(this._doneEvent)}}catch(I){l={error:I}}finally{try{N&&!N.done&&(c=A.return)&&c.call(A)}finally{if(l)throw l.error}}this._stop(),this._stopChildren(),ys.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Nt.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var i=this,o=Ml(t,n,r);this.listeners.add(o.next),this.status!==Nt.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===Nt.Stopped?o.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(a),i.stopListeners.delete(a)}}},e.prototype.onEvent=function(t){return this.eventListeners.add(t),this},e.prototype.onSend=function(t){return this.sendListeners.add(t),this},e.prototype.onChange=function(t){return this.contextListeners.add(t),this},e.prototype.onStop=function(t){return this.stopListeners.add(t),this},e.prototype.onDone=function(t){return this.status===Nt.Stopped&&this._doneEvent?t(this._doneEvent):this.doneListeners.add(t),this},e.prototype.off=function(t){return this.listeners.delete(t),this.eventListeners.delete(t),this.sendListeners.delete(t),this.stopListeners.delete(t),this.doneListeners.delete(t),this.contextListeners.delete(t),this},e.prototype.start=function(t){var n=this;if(this.status===Nt.Running)return this;this.machine._init(),ys.register(this.sessionId,this),this.initialized=!0,this.status=Nt.Running;var r=t===void 0?this.initialState:ia(this,function(){return uj(t)?n.machine.resolveState(t):n.machine.resolveState(or.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,Sa)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){nt(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,l,c;try{for(var f=Be(this.listeners),d=f.next();!d.done;d=f.next()){var h=d.value;this.listeners.delete(h)}}catch(A){t={error:A}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}try{for(var p=Be(this.stopListeners),v=p.next();!v.done;v=p.next()){var h=v.value;h(),this.stopListeners.delete(h)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var g=Be(this.contextListeners),C=g.next();!C.done;C=g.next()){var h=C.value;this.contextListeners.delete(h)}}catch(A){o={error:A}}finally{try{C&&!C.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}try{for(var m=Be(this.doneListeners),b=m.next();!b.done;b=m.next()){var h=b.value;this.doneListeners.delete(h)}}catch(A){s={error:A}}finally{try{b&&!b.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Nt.Stopped,this._initialState=void 0;try{for(var x=Be(Object.keys(this.delayedEventsMap)),T=x.next();!T.done;T=x.next()){var E=T.value;this.clock.clearTimeout(this.delayedEventsMap[E])}}catch(A){l={error:A}}finally{try{T&&!T.done&&(c=x.return)&&c.call(x)}finally{if(l)throw l.error}}this.scheduler.clear(),this.scheduler=new Dy({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r=dn({type:"xstate.stop"}),i=ia(t,function(){var o=At(gt([],We(t.state.configuration),!1).sort(function(c,f){return f.order-c.order}).map(function(c){return Ii(c.onExit,t.machine.options.actions)})),a=We(cc(t.machine,t.state,t.state.context,r,[{type:"exit",actions:o}],t.machine.config.predictableActionArguments?t._exec:void 0,t.machine.config.predictableActionArguments||t.machine.config.preserveActionOrder),2),s=a[0],u=a[1],l=new or({value:t.state.value,context:u,_event:r,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:s.filter(function(c){return!wp(c)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return l.changed=!0,l});t.update(i,r),t._stopChildren(),ys.free(t.sessionId)}),this},e.prototype.batch=function(t){var n=this;if(this.status===Nt.NotStarted&&this.options.deferEvents)Ot||rn(!1,"".concat(t.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,`" and are deferred. Make sure .start() is called for this service.
|
|
86
|
+
Event: `).concat(JSON.stringify(event)));else if(this.status!==Nt.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){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,a=n.state,s=!1,u=[],l=function(h){var p=dn(h);n.forward(p),a=ia(n,function(){return n.machine.transition(a,p,void 0,r||void 0)}),u.push.apply(u,gt([],We(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return lj(v,a)})),!1)),s=s||!!a.changed};try{for(var c=Be(t),f=c.next();!f.done;f=c.next()){var d=f.value;l(d)}}catch(h){i={error:h}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,dn(t[t.length-1]))})}},e.prototype.sender=function(t){return this.send.bind(this,t)},e.prototype._nextState=function(t,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=dn(t);if(i.name.indexOf(Ty)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Ty)===0}))throw i.data.data;var o=ia(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},e.prototype.nextState=function(t){return this._nextState(t,!1)},e.prototype.forward=function(t){var n,r;try{for(var i=Be(this.forwardTo),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.children.get(a);if(!s)throw new Error("Unable to forward event '".concat(t,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(a,"'."));s.send(t)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.defer=function(t){var n=this,r=this.clock.setTimeout(function(){"to"in t&&t.to?n.sendTo(t._event,t.to,!0):n.send(t._event)},t.delay);t.id&&(this.delayedEventsMap[t.id]=r)},e.prototype.cancel=function(t){this.clock.clearTimeout(this.delayedEventsMap[t]),delete this.delayedEventsMap[t]},e.prototype.exec=function(t,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(t,n.context,n._event,r)},e.prototype.removeChild=function(t){var n;this.children.delete(t),this.forwardTo.delete(t),(n=this.state)===null||n===void 0||delete n.children[t]},e.prototype.stopChild=function(t){var n=this.children.get(t);n&&(this.removeChild(t),nt(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Nt.Running)return Tv(t,n);if(Ay(t))return this.spawnPromise(Promise.resolve(t),n);if(nt(t))return this.spawnCallback(t,n);if(rj(t))return this.spawnActor(t,n);if(jM(t))return this.spawnObservable(t,n);if(ii(t))return this.spawnMachine(t,re(re({},r),{id:n}));if(RM(t))return this.spawnBehavior(t,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof t,'".'))},e.prototype.spawnMachine=function(t,n){var r=this;n===void 0&&(n={});var i=new e(t,re(re({},this.options),{parent:this,id:n.id||t.id})),o=re(re({},Ep),n);o.sync&&i.onTransition(function(s){r.send(Qw,{state:s,id:i.id})});var a=i;return this.children.set(i.id,a),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(s){r.removeChild(i.id),r.send(dn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=hj(t,{id:n,parent:this});return this.children.set(n,r),r},e.prototype.spawnPromise=function(t,n){var r,i=this,o=!1,a;t.then(function(u){o||(a=u,i.removeChild(n),i.send(dn(jl(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var l=$s(n,u);try{i.send(dn(l,{origin:n}))}catch(c){LM(u,c,n),i.devTools&&i.devTools.send(l,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,l,c){var f=Ml(u,l,c),d=!1;return t.then(function(h){d||(f.next(h),!d&&f.complete())},function(h){d||f.error(h)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[Ei]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnCallback=function(t,n){var r,i=this,o=!1,a=new Set,s=new Set,u,l=function(d){u=d,s.forEach(function(h){return h(d)}),!o&&i.send(dn(d,{origin:n}))},c;try{c=t(l,function(d){a.add(d)})}catch(d){this.send($s(n,d))}if(Ay(c))return this.spawnPromise(c,n);var f=(r={id:n,send:function(d){return a.forEach(function(h){return h(d)})},subscribe:function(d){var h=Ml(d);return s.add(h.next),{unsubscribe:function(){s.delete(h.next)}}},stop:function(){o=!0,nt(c)&&c()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[Ei]=function(){return this},r);return this.children.set(n,f),f},e.prototype.spawnObservable=function(t,n){var r,i=this,o,a=t.subscribe(function(u){o=u,i.send(dn(u,{origin:n}))},function(u){i.removeChild(n),i.send(dn($s(n,u),{origin:n}))},function(){i.removeChild(n),i.send(dn(jl(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,l,c){return t.subscribe(u,l,c)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[Ei]=function(){return this},r);return this.children.set(n,s),s},e.prototype.spawnActor=function(t,n){return this.children.set(n,t),t},e.prototype.spawnActivity=function(t){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[t.type]:void 0;if(!n){Ot||rn(!1,"No implementation found for activity '".concat(t.type,"'"));return}var r=n(this.state.context,t);this.spawnEffect(t.id,r)},e.prototype.spawnEffect=function(t,n){var r;this.children.set(t,(r={id:t,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:t}}},r[Ei]=function(){return this},r))},e.prototype.attachDev=function(){var t=Ev();if(this.options.devTools&&t){if(t.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=t.__REDUX_DEVTOOLS_EXTENSION__.connect(re(re({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:re({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}pj(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[Ei]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Nt.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(t,n){return setTimeout(t,n)},clearTimeout:function(t){return clearTimeout(t)}},logger:console.log.bind(console),devTools:!1},e.interpret=f0,e}(),mj=function(e){return Ke(e)?re(re({},Ep),{name:e}):re(re(re({},Ep),{name:qM()}),e)};function Ny(e,t){var n=mj(t);return ej(function(r){if(!Ot){var i=ii(e)||nt(e);rn(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(ii(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):Tv(e,n.name)})}function f0(e,t){var n=new vj(e,t);return n}function yj(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function ol(e){return re(re({type:bp},e),{toJSON:function(){e.onDone,e.onError;var t=bv(e,["onDone","onError"]);return re(re({},t),{type:bp,src:yj(e.src)})}})}var oa="",Ip="#",gs="*",Jo={},Xo=function(e){return e[0]===Ip},gj=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},bj=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(Ke(o.target)||ii(o.target))}),i=t===oa?"the transient event":"event '".concat(t,"'");rn(!r,"One or more transitions for ".concat(i," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")},Sj=function(){function e(t,n,r,i){r===void 0&&(r="context"in t?t.context:void 0);var o=this,a;this.config=t,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(gj(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.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:Zw),this.id=this.config.id||gt([this.machine.key],We(this.path),!1).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:(a=this.config.schema)!==null&&a!==void 0?a:{},this.description=this.config.description,Ot||rn(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?As(this.config.states,function(l,c){var f,d=new e(l,{},void 0,{parent:o,key:c});return Object.assign(o.idMap,re((f={},f[d.id]=d,f),d.idMap)),d}):Jo;var s=0;function u(l){var c,f;l.order=s++;try{for(var d=Be(s0(l)),h=d.next();!h.done;h=d.next()){var p=h.value;u(p)}}catch(v){c={error:v}}finally{try{h&&!h.done&&(f=d.return)&&f.call(d)}finally{if(c)throw c.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(l){var c=l.event;return c===oa}):oa in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=gr(this.config.entry||this.config.onEntry).map(function(l){return su(l)}),this.onExit=gr(this.config.exit||this.config.onExit).map(function(l){return su(l)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=gr(this.config.invoke).map(function(l,c){var f,d;if(ii(l)){var h=rl(o.id,c);return o.machine.options.services=re((f={},f[h]=l,f),o.machine.options.services),ol({src:h,id:h})}else if(Ke(l.src)){var h=l.id||rl(o.id,c);return ol(re(re({},l),{id:h,src:l.src}))}else if(ii(l.src)||nt(l.src)){var h=l.id||rl(o.id,c);return o.machine.options.services=re((d={},d[h]=l.src,d),o.machine.options.services),ol(re(re({id:h},l),{src:h}))}else{var p=l.src;return ol(re(re({id:rl(o.id,c)},l),{src:p}))}}),this.activities=gr(this.config.activities).concat(this.invoke).map(function(l){return xv(l)}),this.transition=this.transition.bind(this),this.tags=gr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||u0(this).forEach(function(t){return t.on})},e.prototype.withConfig=function(t,n){var r=this.options,i=r.actions,o=r.activities,a=r.guards,s=r.services,u=r.delays;return new e(this.config,{actions:re(re({},i),t.actions),activities:re(re({},o),t.activities),guards:re(re({},a),t.guards),services:re(re({},s),t.services),delays:re(re({},u),t.delays)},n??this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return nt(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.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:As(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:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var t=this.transitions;return this.__cache.on=t.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(t){if(this.__cache.candidates[t])return this.__cache.candidates[t];var n=t===oa,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===gs});return this.__cache.candidates[t]=r,r},e.prototype.getDelayedTransitions=function(){var t=this,n=this.config.after;if(!n)return[];var r=function(o,a){var s=nt(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=XM(s,t.id);return t.onEntry.push(pf(u,{delay:o})),t.onExit.push(WM(u)),u},i=Qa(n)?n.map(function(o,a){var s=r(o.delay,a);return re(re({},o),{event:s})}):At(Object.keys(n).map(function(o,a){var s=n[o],u=Ke(s)?{target:s}:s,l=isNaN(+o)?o:+o,c=r(l,a);return gr(u).map(function(f){return re(re({},f),{event:c,delay:l})})}));return i.map(function(o){var a=o.delay;return re(re({},t.formatTransition(o)),{delay:a})})},e.prototype.getStateNodes=function(t){var n,r=this;if(!t)return[];var i=t instanceof or?t.value:qs(t,this.delimiter);if(Ke(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var a=Object.keys(i),s=[this];return s.push.apply(s,gt([],We(At(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=e0(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof or?t:or.create(t),r=Array.from(Os([],this.getStateNodes(n.value)));return new or(re(re({},n),{value:this.resolve(n.value),configuration:r,done:_l(r,this),tags:Oy(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(t,n,r){var i=this.getStateNode(t),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},e.prototype.transitionCompoundNode=function(t,n,r){var i=Object.keys(t),o=this.getStateNode(i[0]),a=o._transition(t[i[0]],n,r);return!a||!a.transitions.length?this.next(n,r):a},e.prototype.transitionParallelNode=function(t,n,r){var i,o,a={};try{for(var s=Be(Object.keys(t)),u=s.next();!u.done;u=s.next()){var l=u.value,c=t[l];if(c){var f=this.getStateNode(l),d=f._transition(c,n,r);d&&(a[l]=d)}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var h=Object.keys(a).map(function(C){return a[C]}),p=At(h.map(function(C){return C.transitions})),v=h.some(function(C){return C.transitions.length>0});if(!v)return this.next(n,r);var g=At(Object.keys(a).map(function(C){return a[C].configuration}));return{transitions:p,exitSet:At(h.map(function(C){return C.exitSet})),configuration:g,source:n,actions:At(Object.keys(a).map(function(C){return a[C].actions}))}},e.prototype._transition=function(t,n,r){return Ke(t)?this.transitionLeafNode(t,n,r):Object.keys(t).length===1?this.transitionCompoundNode(t,n,r):this.transitionParallelNode(t,n,r)},e.prototype.getTransitionData=function(t,n){return this._transition(t.value,t,dn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],l;try{for(var c=Be(this.getCandidates(a)),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.cond,p=d.in,v=t.context,g=p?Ke(p)&&Xo(p)?t.matches(qs(this.getStateNodeById(p).path,this.delimiter)):wv(qs(p,this.delimiter),DM(this.path.slice(0,-2))(t.value)):!0,C=!1;try{C=!h||i0(this.machine,h,v,n,t)}catch(x){throw new Error("Unable to evaluate guard '".concat(h.name||h.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
+
`).concat(x.message))}if(C&&g){d.target!==void 0&&(u=d.target),s.push.apply(s,gt([],We(d.actions),!1)),l=d;break}}}catch(x){r={error:x}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}if(l){if(!u.length)return{transitions:[l],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=At(u.map(function(x){return o.getRelativeStateNodes(x,t.historyValue)})),b=!!l.internal;return{transitions:[l],exitSet:b?[]:At(u.map(function(x){return o.getPotentiallyReenteringNodes(x)})),configuration:m,source:t,actions:s}}},e.prototype.getPotentiallyReenteringNodes=function(t){if(this.order<t.order)return[this];for(var n=[],r=this,i=t;r&&r!==i;)n.push(r),r=r.parent;return r!==i?[]:(n.push(i),n)},e.prototype.getActions=function(t,n,r,i,o,a,s){var u,l,c,f,d=this,h=a?Os([],this.getStateNodes(a.value)):[],p=new Set;try{for(var v=Be(Array.from(t).sort(function(_,L){return _.order-L.order})),g=v.next();!g.done;g=v.next()){var C=g.value;(!Ds(h,C)||Ds(r.exitSet,C)||C.parent&&p.has(C.parent))&&p.add(C)}}catch(_){u={error:_}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(u)throw u.error}}try{for(var m=Be(h),b=m.next();!b.done;b=m.next()){var C=b.value;(!Ds(t,C)||Ds(r.exitSet,C.parent))&&r.exitSet.push(C)}}catch(_){c={error:_}}finally{try{b&&!b.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var x=Array.from(p).sort(function(_,L){return _.order-L.order}),T=new Set(r.exitSet),E=At(x.map(function(_){var L=[];if(_.type!=="final")return L;var U=_.parent;if(!U.parent)return L;L.push(il(_.id,_.doneData),il(U.id,_.doneData?lc(_.doneData,i,o):void 0));var Y=U.parent;return Y.type==="parallel"&&uu(Y).every(function(k){return _l(r.configuration,k)})&&L.push(il(Y.id)),L})),A=x.map(function(_){var L=_.onEntry,U=_.activities.map(function(Y){return HM(Y)});return{type:"entry",actions:Ii(s?gt(gt([],We(L),!1),We(U),!1):gt(gt([],We(U),!1),We(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:E.map(function(_){return VM(_)})}),N=Array.from(T).map(function(_){return{type:"exit",actions:Ii(gt(gt([],We(_.onExit),!1),We(_.activities.map(function(L){return KM(L)})),!1),d.machine.options.actions)}}),I=N.concat({type:"transition",actions:Ii(r.actions,this.machine.options.actions)}).concat(A);if(n){var P=Ii(At(gt([],We(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!wp(_)});return I.concat({type:"stop",actions:P})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=dn(n),a;if(t instanceof or)a=r===void 0?t:this.resolveState(or.from(t,r));else{var s=Ke(t)?this.resolve(uc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(or.from(s,u))}if(!Ot&&o.name===gs)throw new Error("An event cannot have the wildcard type ('".concat(gs,"')"));if(this.strict&&!this.events.includes(o.name)&&!PM(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var l=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},c=Os([],this.getStateNodes(a.value)),f=l.configuration.length?Os(c,l.configuration):c;return l.configuration=gt([],We(f),!1),this.resolveTransition(l,a,a.context,i,o)},e.prototype.resolveRaisedTransition=function(t,n,r,i){var o,a=t.actions;return t=this.transition(t,n,void 0,i),t._event=r,t.event=r.data,(o=t.actions).unshift.apply(o,gt([],We(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,l,c=this;o===void 0&&(o=Sa);var f=t.configuration,d=!n||t.transitions.length>0,h=d?t.configuration:n?n.configuration:[],p=_l(h,this),v=d?oj(this.machine,f):void 0,g=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,C=this.getActions(new Set(h),p,t,r,o,n,i),m=n?re({},n.activities):{};try{for(var b=Be(C),x=b.next();!x.done;x=b.next()){var T=x.value;try{for(var E=(u=void 0,Be(T.actions)),A=E.next();!A.done;A=E.next()){var N=A.value;N.type===gp?m[N.activity.id||N.activity.type]=N:N.type===Sv&&(m[N.activity.id||N.activity.type]=!1)}}catch(X){u={error:X}}finally{try{A&&!A.done&&(l=E.return)&&l.call(E)}finally{if(u)throw u.error}}}}catch(X){a={error:X}}finally{try{x&&!x.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}var I=We(cc(this,n,r,o,C,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),P=I[0],_=I[1],L=We(kM(P,wp),2),U=L[0],Y=L[1],k=P.filter(function(X){var ae;return X.type===gp&&((ae=X.activity)===null||ae===void 0?void 0:ae.type)===bp}),ie=k.reduce(function(X,ae){return X[ae.activity.id]=tj(ae.activity,c.machine,_,o),X},n?re({},n.children):{}),B=new or({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?g?MM(g,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?Y:[],activities:v?m:n?n.activities:{},events:[],configuration:h,transitions:t.transitions,children:ie,done:p,tags:Oy(h),machine:this}),G=r!==_;B.changed=o.name===Qw||G;var fe=B.history;fe&&delete fe.history;var j=!p&&(this._transient||f.some(function(X){return X._transient}));if(!d&&(!j||o.name===oa))return B;var R=B;if(!p)for(j&&(R=this.resolveRaisedTransition(R,{type:xM},o,i));U.length;){var te=U.shift();R=this.resolveRaisedTransition(R,te._event,o,i)}var oe=R.changed||(fe?!!R.actions.length||G||typeof fe.value!=typeof R.value||!c0(R.value,fe.value):void 0);return R.changed=oe,R.history=fe,R},e.prototype.getStateNode=function(t){if(Xo(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 n=this.states[t];if(!n)throw new Error("Child state '".concat(t,"' does not exist on '").concat(this.id,"'"));return n},e.prototype.getStateNodeById=function(t){var n=Xo(t)?t.slice(Ip.length):t;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(t){if(typeof t=="string"&&Xo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=Cp(t,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},e.prototype.resolve=function(t){var n,r=this;if(!t)return this.initialStateValue||Jo;switch(this.type){case"parallel":return As(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Jo});case"compound":if(Ke(t)){var i=this.getStateNode(t);return i.type==="parallel"||i.type==="compound"?(n={},n[t]=i.initialStateValue,n):t}return Object.keys(t).length?As(t,function(o,a){return o?r.getStateNode(a).resolve(o):Jo}):this.initialStateValue||{};default:return t||Jo}},e.prototype.getResolvedPath=function(t){if(Xo(t)){var n=this.machine.idMap[t.slice(Ip.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return Cp(t,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Iy(this.states,function(r){return r.initialStateValue||Jo},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=dc(this.states[this.initial])?this.initial:(t={},t[this.initial]=this.states[this.initial].initialStateValue,t)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(t,n){this._init();var r=this.getStateNodes(t);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(e.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:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var t;if(this.type==="history"){var n=this.config;Ke(n.target)?t=Xo(n.target)?uc(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:t=n.target}return t},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(t,n,r){return r===void 0&&(r=!0),r?t.type==="history"?t.resolveHistory(n):t.initialStateNodes:[t]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var t=this;if(dc(this))return[this];if(this.type==="compound"&&!this.initial)return Ot||rn(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=kl(this.initialStateValue);return At(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=We(t),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.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)},e.prototype.historyValue=function(t){if(Object.keys(this.states).length)return{current:t||this.initialStateValue,states:Iy(this.states,function(n,r){if(!t)return n.historyValue();var i=Ke(t)?void 0:t[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},e.prototype.resolveHistory=function(t){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!t){var i=this.target;return i?At(kl(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=NM(r.path,"states")(t).current;return Ke(o)?[r.getStateNode(o)]:At(kl(o).map(function(a){return n.history==="deep"?r.getFromRelativePath(a):[r.states[a[0]]]}))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var t=this,n=At(Object.keys(this.states).map(function(r){return t.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var t,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,a=new Set(this.ownEvents);if(o)try{for(var s=Be(Object.keys(o)),u=s.next();!u.done;u=s.next()){var l=u.value,c=o[l];if(c.states)try{for(var f=(r=void 0,Be(c.events)),d=f.next();!d.done;d=f.next()){var h=d.value;a.add("".concat(h))}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(p){t={error:p}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return this.__cache.events=Array.from(a)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var t=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(t)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(t){var n=this;if(t!==void 0)return t.map(function(r){if(!Ke(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var a=n.parent.getStateNodeByPath(o);return a}catch(s){throw new Error("Invalid transition definition for state node '".concat(n.id,`':
|
|
88
|
+
`).concat(s.message))}else return n.getStateNodeByPath(o)})},e.prototype.formatTransition=function(t){var n=this,r=FM(t.target),i="internal"in t?t.internal:r?r.some(function(u){return Ke(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=re(re({},t),{actions:Ii(gr(t.actions)),cond:r0(t.cond,o),target:a,source:this,internal:i,eventType:t.event,toJSON:function(){return re(re({},s),{target:s.target?s.target.map(function(u){return"#".concat(u.id)}):void 0,source:"#".concat(n.id)})}});return s},e.prototype.formatTransitions=function(){var t,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,a=gs,s=o[a],u=s===void 0?[]:s,l=bv(o,[typeof a=="symbol"?a:a+""]);i=At(Object.keys(l).map(function(m){!Ot&&m===oa&&rn(!1,"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 b=Yo(m,l[m]);return Ot||bj(r,m,b),b}).concat(Yo(gs,u)))}var c=this.config.always?Yo("",this.config.always):[],f=this.config.onDone?Yo(String(il(this.id)),this.config.onDone):[];Ot||rn(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=At(this.invoke.map(function(m){var b=[];return m.onDone&&b.push.apply(b,gt([],We(Yo(String(jl(m.id)),m.onDone)),!1)),m.onError&&b.push.apply(b,gt([],We(Yo(String($s(m.id)),m.onError)),!1)),b})),h=this.after,p=At(gt(gt(gt(gt([],We(f),!1),We(d),!1),We(i),!1),We(c),!1).map(function(m){return gr(m).map(function(b){return r.formatTransition(b)})}));try{for(var v=Be(h),g=v.next();!g.done;g=v.next()){var C=g.value;p.push(C)}}catch(m){t={error:m}}finally{try{g&&!g.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return p},e}(),Py=!1;function Iv(e,t){return!Ot&&!("predictableActionArguments"in e)&&!Py&&(Py=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new Sj(e,t)}var kn=JM,Cj=pf,d0=GM,al=QM,it={},Av={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});/*! *****************************************************************************
|
|
89
89
|
Copyright (c) Microsoft Corporation.
|
|
90
90
|
|
|
91
91
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -98,7 +98,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Nt.Running)throw
|
|
|
98
98
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
99
99
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
100
100
|
PERFORMANCE OF THIS SOFTWARE.
|
|
101
|
-
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,l=arguments.length;u<l;u++){s=arguments[u];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}return a},e.__assign.apply(this,arguments)};function t(o,a){var s={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(s[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,u=Object.getOwnPropertySymbols(o);l<u.length;l++)a.indexOf(u[l])<0&&Object.prototype.propertyIsEnumerable.call(o,u[l])&&(s[u[l]]=o[u[l]]);return s}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],u=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&u>=o.length&&(o=void 0),{value:o&&o[u++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var s=typeof Symbol=="function"&&o[Symbol.iterator];if(!s)return o;var u=s.call(o),l,c=[],f;try{for(;(a===void 0||a-- >0)&&!(l=u.next()).done;)c.push(l.value)}catch(d){f={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return c}function i(o,a,s){if(s||arguments.length===2)for(var u=0,l=a.length,c;u<l;u++)(c||!(u in a))&&(c||(c=Array.prototype.slice.call(a,0,u)),c[u]=a[u]);return o.concat(c||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Ev);var pf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionTypes=void 0,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"}(e.ActionTypes||(e.ActionTypes={})),e.SpecialTargets=void 0,function(t){t.Parent="#_parent",t.Internal="#_internal"}(e.SpecialTargets||(e.SpecialTargets={}))})(pf);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});var cn=pf,Cj=cn.ActionTypes.Start,wj=cn.ActionTypes.Stop,xj=cn.ActionTypes.Raise,Tj=cn.ActionTypes.Send,Ej=cn.ActionTypes.Cancel,Ij=cn.ActionTypes.NullEvent,Aj=cn.ActionTypes.Assign,$j=cn.ActionTypes.After,Oj=cn.ActionTypes.DoneState,Dj=cn.ActionTypes.Log,Nj=cn.ActionTypes.Init,Pj=cn.ActionTypes.Invoke,Rj=cn.ActionTypes.ErrorExecution,kj=cn.ActionTypes.ErrorPlatform,Mj=cn.ActionTypes.ErrorCustom,jj=cn.ActionTypes.Update,_j=cn.ActionTypes.Choose,qj=cn.ActionTypes.Pure;Ut.after=$j;Ut.assign=Aj;Ut.cancel=Ej;Ut.choose=_j;Ut.doneState=Oj;Ut.error=Mj;Ut.errorExecution=Rj;Ut.errorPlatform=kj;Ut.init=Nj;Ut.invoke=Pj;Ut.log=Dj;Ut.nullEvent=Ij;Ut.pure=qj;Ut.raise=xj;Ut.send=Tj;Ut.start=Cj;Ut.stop=wj;Ut.update=jj;var d0={},Za={};Object.defineProperty(Za,"__esModule",{value:!0});var Fj=".",Lj={},Vj="xstate.guard",Bj="";Za.DEFAULT_GUARD_TYPE=Vj;Za.EMPTY_ACTIVITY_MAP=Lj;Za.STATE_DELIMITER=Fj;Za.TARGETLESS_KEY=Bj;var hf={};Object.defineProperty(hf,"__esModule",{value:!0});var Uj=process.env.NODE_ENV==="production";hf.IS_PRODUCTION=Uj;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Ev,n=pf,r=Ut,i=Za,o=hf,a;function s(S){return Object.keys(S)}function u(S,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=h(S,F),Q=h(M,F);return G(Q)?G(q)?Q===q:!1:G(q)?q in Q:Object.keys(q).every(function(Z){return Z in Q?u(q[Z],Q[Z]):!1})}function l(S){try{return G(S)||typeof S=="number"?"".concat(S):S.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function c(S){try{return G(S)||typeof S=="number"?"".concat(S):B(S)?S.name:S.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(S,M){try{return ie(S)?S:S.toString().split(M)}catch{throw new Error("'".concat(S,"' is not a valid state path."))}}function d(S){return typeof S=="object"&&"value"in S&&"context"in S&&"event"in S&&"_event"in S}function h(S,M){if(d(S))return S.value;if(ie(S))return p(S);if(typeof S!="string")return S;var F=f(S,M);return p(F)}function p(S){if(S.length===1)return S[0];for(var M={},F=M,q=0;q<S.length-1;q++)q===S.length-2?F[S[q]]=S[q+1]:(F[S[q]]={},F=F[S[q]]);return M}function v(S,M){for(var F={},q=Object.keys(S),Q=0;Q<q.length;Q++){var Z=q[Q];F[Z]=M(S[Z],Z,S,Q)}return F}function g(S,M,F){var q,Q,Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];F($e)&&(Z[be]=M($e,be,S))}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}var C=function(S){return function(M){var F,q,Q=M;try{for(var Z=t.__values(S),ce=Z.next();!ce.done;ce=Z.next()){var se=ce.value;Q=Q[se]}}catch(be){F={error:be}}finally{try{ce&&!ce.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return Q}};function m(S,M){return function(F){var q,Q,Z=F;try{for(var ce=t.__values(S),se=ce.next();!se.done;se=ce.next()){var be=se.value;Z=Z[M][be]}}catch($e){q={error:$e}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}}function b(S){if(!S)return[[]];if(G(S))return[[S]];var M=T(Object.keys(S).map(function(F){var q=S[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:b(S[F]).map(function(Q){return[F].concat(Q)})}));return M}function x(S){var M,F,q={};if(S&&S.length===1&&S[0].length===1)return S[0][0];try{for(var Q=t.__values(S),Z=Q.next();!Z.done;Z=Q.next())for(var ce=Z.value,se=q,be=0;be<ce.length;be++){var $e=ce[be];if(be===ce.length-2){se[$e]=ce[be+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(qt){M={error:qt}}finally{try{Z&&!Z.done&&(F=Q.return)&&F.call(Q)}finally{if(M)throw M.error}}return q}function T(S){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(S),!1))}function E(S){return ie(S)?S:[S]}function A(S){return S===void 0?[]:E(S)}function N(S,M,F){var q,Q;if(B(S))return S(M,F.data);var Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];B($e)?Z[be]=$e(M,F.data):Z[be]=$e}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}function I(S){return/^(done|error)\./.test(S)}function P(S){return!!(S instanceof Promise||S!==null&&(B(S)||typeof S=="object")&&B(S.then))}function _(S){return S!==null&&typeof S=="object"&&"transition"in S&&typeof S.transition=="function"}function L(S,M){var F,q,Q=t.__read([[],[]],2),Z=Q[0],ce=Q[1];try{for(var se=t.__values(S),be=se.next();!be.done;be=se.next()){var $e=be.value;M($e)?Z.push($e):ce.push($e)}}catch(qt){F={error:qt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,ce]}function U(S,M){return v(S.states,function(F,q){if(F){var Q=(G(M)?void 0:M[q])||(F?F.current:void 0);if(Q)return{current:Q,states:U(F,Q)}}})}function Y(S,M){return{current:M,states:U(S,M)}}function k(S,M,F,q){o.IS_PRODUCTION||e.warn(!!S,"Attempting to update undefined context");var Q=S&&F.reduce(function(Z,ce){var se,be,$e=ce.assignment,qt={state:q,action:ce,_event:M},Qi={};if(B($e))Qi=$e(Z,M.data,qt);else try{for(var qr=t.__values(Object.keys($e)),hr=qr.next();!hr.done;hr=qr.next()){var ls=hr.value,Zi=$e[ls];Qi[ls]=B(Zi)?Zi(Z,M.data,qt):Zi}}catch(jf){se={error:jf}}finally{try{hr&&!hr.done&&(be=qr.return)&&be.call(qr)}finally{if(se)throw se.error}}return Object.assign({},Z,Qi)},S);return Q}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(S,M){var F=S instanceof Error?S:void 0;if(!(!F&&S)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(S){return Array.isArray(S)}function B(S){return typeof S=="function"}function G(S){return typeof S=="string"}function fe(S,M){if(S)return G(S)?{type:i.DEFAULT_GUARD_TYPE,name:S,predicate:M?M[S]:void 0}:B(S)?{type:i.DEFAULT_GUARD_TYPE,name:S.name,predicate:S}:S}function j(S){try{return"subscribe"in S&&B(S.subscribe)}catch{return!1}}var R=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[R]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(S){return!!S&&"__xstatenode"in S}function X(S){return!!S&&typeof S.send=="function"}var ae=function(){var S=0;return function(){return S++,S.toString(16)}}();function de(S,M){return G(S)||typeof S=="number"?t.__assign({type:S},M):S}function he(S,M){if(!G(S)&&"$$type"in S&&S.$$type==="scxml")return S;var F=de(S);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function Te(S,M){var F=E(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:S}:t.__assign(t.__assign({},q),{event:S})});return F}function ke(S){if(!(S===void 0||S===i.TARGETLESS_KEY))return A(S)}function Ne(S,M,F){if(!o.IS_PRODUCTION){var q=S.stack?" Stacktrace was '".concat(S.stack,"'"):"";if(S===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(S,"'.").concat(q));else{var Q=M.stack?" Stacktrace was '".concat(M.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(S,"'. ").concat(q," Current error is '").concat(M,"'.").concat(Q))}}}function mt(S,M,F,q,Q){var Z=S.options.guards,ce={state:Q,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,ce);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(S.id,"'."));return se(F,q.data,ce)}function le(S){return typeof S=="string"?{type:S}:S}function Pn(S,M,F){var q=function(){},Q=typeof S=="object",Z=Q?S:null;return{next:((Q?S.next:S)||q).bind(Z),error:((Q?S.error:M)||q).bind(Z),complete:((Q?S.complete:F)||q).bind(Z)}}function pi(S,M){return"".concat(S,":invocation[").concat(M,"]")}function Bo(S){return(S.type===r.raise||S.type===r.send&&S.to===n.SpecialTargets.Internal)&&typeof S.delay!="number"}e.createInvokeId=pi,e.evaluateGuard=mt,e.flatten=T,e.getActionType=c,e.getEventType=l,e.interopSymbols=te,e.isActor=X,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=P,e.isRaisableAction=Bo,e.isStateLike=d,e.isString=G,e.keys=s,e.mapContext=N,e.mapFilterValues=g,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=ke,e.partition=L,e.path=C,e.pathToStateValue=p,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=Ne,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=E,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=le,e.toObserver=Pn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=b,e.toStateValue=h,e.toTransitionConfigArray=Te,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=U,e.updateHistoryValue=Y})(d0);Object.defineProperty(it,"__esModule",{value:!0});var Xe=Ev,pr=pf,an=Ut,Le=d0,p0=hf,Gj=Le.toSCXMLEvent({type:an.init});function Ep(e,t){return t&&t[e]||void 0}function vf(e,t){var n;if(Le.isString(e)||typeof e=="number"){var r=Ep(e,t);Le.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Le.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Ep(e.type,t);if(Le.isFunction(r))n=Xe.__assign(Xe.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Xe.__assign(Xe.__assign(Xe.__assign({},r),e),{type:i})}else n=e}return n}var Ip=function(e,t){if(!e)return[];var n=Le.isArray(e)?e:[e];return n.map(function(r){return vf(r,t)})};function Iv(e){var t=vf(e);return Xe.__assign(Xe.__assign({id:Le.isString(e)?e:t.id},t),{type:t.type})}function zj(e,t){return{type:an.raise,event:typeof e=="function"?e:Le.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function h0(e,t,n,r){var i={_event:n},o=Le.toSCXMLEvent(Le.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Le.isString(e.delay)){var s=r&&r[e.delay];a=Le.isFunction(s)?s(t,n.data,i):s}else a=Le.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return Xe.__assign(Xe.__assign({},e),{type:an.raise,_event:o,delay:a})}function Ru(e,t){return{to:t?t.to:void 0,type:an.send,event:Le.isFunction(e)?e:Le.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Le.isFunction(e)?e.name:Le.getEventType(e)}}function v0(e,t,n,r){var i={_event:n},o=Le.toSCXMLEvent(Le.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Le.isString(e.delay)){var s=r&&r[e.delay];a=Le.isFunction(s)?s(t,n.data,i):s}else a=Le.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=Le.isFunction(e.to)?e.to(t,n.data,i):e.to;return Xe.__assign(Xe.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Av(e,t){return Ru(e,Xe.__assign(Xe.__assign({},t),{to:pr.SpecialTargets.Parent}))}function Wj(e,t,n){return Ru(t,Xe.__assign(Xe.__assign({},n),{to:e}))}function Hj(){return Av(an.update)}function Kj(e,t){return Ru(e,Xe.__assign(Xe.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var Yj=function(e,t){return{context:e,event:t}};function Jj(e,t){return e===void 0&&(e=Yj),{type:an.log,label:t,expr:e}}var m0=function(e,t,n){return Xe.__assign(Xe.__assign({},e),{value:Le.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Xj=function(e){return{type:an.cancel,sendId:e}};function Qj(e){var t=Iv(e);return{type:pr.ActionTypes.Start,activity:t,exec:void 0}}function Zj(e){var t=Le.isFunction(e)?e:Iv(e);return{type:pr.ActionTypes.Stop,activity:t,exec:void 0}}function y0(e,t,n){var r=Le.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:pr.ActionTypes.Stop,activity:i};return o}var e_=function(e){return{type:an.assign,assignment:e}};function t_(e){return typeof e=="object"&&"type"in e}function n_(e,t){var n=t?"#".concat(t):"";return"".concat(pr.ActionTypes.After,"(").concat(e,")").concat(n)}function r_(e,t){var n="".concat(pr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function i_(e,t){var n="".concat(pr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function o_(e,t){var n="".concat(pr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function a_(e){return{type:pr.ActionTypes.Pure,get:e}}function s_(e,t){if(!p0.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,Xe.__spreadArray([],Xe.__read(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return Ru(function(r,i){return i},Xe.__assign(Xe.__assign({},t),{to:e}))}function u_(e,t){return Av(function(n,r,i){return{type:an.error,data:Le.isFunction(e)?e(n,r,i):e}},Xe.__assign(Xe.__assign({},t),{to:pr.SpecialTargets.Parent}))}function l_(e){return{type:pr.ActionTypes.Choose,conds:e}}var c_=function(e){var t,n,r=[];try{for(var i=Xe.__values(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===an.assign){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Ap(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:c_(i),u=s.length?Le.updateContext(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case an.raise:{var C=h0(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case an.send:var m=v0(v,u,r,e.options.delays);if(!p0.IS_PRODUCTION){var b=v.delay;Le.warn(!Le.isString(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==pr.SpecialTargets.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case an.log:{var x=m0(v,u,r);return o==null||o(x,u,r),x}case an.choose:{var T=v,E=(g=T.conds.find(function(B){var G=Le.toGuard(B.cond,e.options.guards);return!G||Le.evaluateGuard(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=Xe.__read(Ap(e,t,u,r,[{type:p,actions:Ip(Le.toArray(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case an.pure:{var E=v.get(u,r.data);if(!E)return[];var P=Xe.__read(Ap(e,t,u,r,[{type:p,actions:Ip(Le.toArray(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case an.stop:{var x=y0(v,u,r);return o==null||o(x,n,r),x}case an.assign:{u=Le.updateContext(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=vf(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=Xe.__assign(Xe.__assign({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,Xe.__spreadArray([l[k]],Xe.__read(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Xe.__values(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=Le.flatten(i.map(d));return[h,u]}it.actionTypes=an;it.after=n_;it.assign=e_;it.cancel=Xj;it.choose=l_;it.done=r_;it.doneInvoke=i_;it.error=o_;it.escalate=u_;it.forwardTo=s_;it.getActionFunction=Ep;it.initEvent=Gj;it.isActionObject=t_;var Wn=it.log=Jj,f_=it.pure=a_;it.raise=zj;it.resolveActions=Ap;it.resolveLog=m0;it.resolveRaise=h0;it.resolveSend=v0;it.resolveStop=y0;it.respond=Kj;it.send=Ru;it.sendParent=Av;it.sendTo=Wj;it.sendUpdate=Hj;it.start=Qj;var Py=it.stop=Zj;it.toActionObject=vf;it.toActionObjects=Ip;it.toActivityDefinition=Iv;function g0(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function mf(e){return function(n,r,i,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i,o);var a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i,o);return o.delete(n),o.delete(r),u}}function b0(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function Ry(e){return e.constructor===Object||e.constructor==null}function ky(e){return typeof e.then=="function"}function yf(e,t){return e===t||e!==e&&t!==t}var d_="[object Arguments]",p_="[object Boolean]",h_="[object Date]",v_="[object RegExp]",m_="[object Map]",y_="[object Number]",g_="[object Object]",b_="[object Set]",S_="[object String]",My=Object.prototype.toString;function gf(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,s=e.createIsNestedEqual,u=s(l);function l(c,f,d){if(c===f)return!0;if(!c||!f||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;if(Ry(c)&&Ry(f))return i(c,f,u,d);var h=Array.isArray(c),p=Array.isArray(f);if(h||p)return h===p&&t(c,f,u,d);var v=My.call(c);return v!==My.call(f)?!1:v===h_?n(c,f,u,d):v===v_?o(c,f,u,d):v===m_?r(c,f,u,d):v===b_?a(c,f,u,d):v===g_||v===d_?ky(c)||ky(f)?!1:i(c,f,u,d):v===p_||v===y_||v===S_?yf(c.valueOf(),f.valueOf()):!1}return l}function S0(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var C_=mf(S0);function C0(e,t){return yf(e.valueOf(),t.valueOf())}function w0(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(s,u){if(i){var l=!1,c=0;t.forEach(function(f,d){!l&&!o[c]&&(l=n(u,d,a,c,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[c]=!0),c++}),a++,i=l}}),i}var w_=mf(w0),x_="_owner",T_=Object.prototype.hasOwnProperty;function x0(e,t,n,r){var i=Object.keys(e),o=i.length;if(Object.keys(t).length!==o)return!1;for(var a;o-- >0;){if(a=i[o],a===x_){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!T_.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var E_=mf(x0);function T0(e,t){return e.source===t.source&&e.flags===t.flags}function E0(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,s){if(i){var u=!1,l=0;t.forEach(function(c,f){!u&&!o[l]&&(u=n(a,c,s,f,e,t,r))&&(o[l]=!0),l++}),i=u}}),i}var I_=mf(E0),I0=Object.freeze({areArraysEqual:S0,areDatesEqual:C0,areMapsEqual:w0,areObjectsEqual:x0,areRegExpsEqual:T0,areSetsEqual:E0,createIsNestedEqual:g0}),A0=Object.freeze({areArraysEqual:C_,areDatesEqual:C0,areMapsEqual:w_,areObjectsEqual:E_,areRegExpsEqual:T0,areSetsEqual:I_,createIsNestedEqual:g0}),A_=gf(I0);function $_(e,t){return A_(e,t,void 0)}gf(b0(I0,{createIsNestedEqual:function(){return yf}}));gf(A0);gf(b0(A0,{createIsNestedEqual:function(){return yf}}));var $p={exports:{}},Uf={},al={exports:{}},Gf={};/**
|
|
101
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,l=arguments.length;u<l;u++){s=arguments[u];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(a[c]=s[c])}return a},e.__assign.apply(this,arguments)};function t(o,a){var s={};for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&a.indexOf(u)<0&&(s[u]=o[u]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,u=Object.getOwnPropertySymbols(o);l<u.length;l++)a.indexOf(u[l])<0&&Object.prototype.propertyIsEnumerable.call(o,u[l])&&(s[u[l]]=o[u[l]]);return s}function n(o){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&o[a],u=0;if(s)return s.call(o);if(o&&typeof o.length=="number")return{next:function(){return o&&u>=o.length&&(o=void 0),{value:o&&o[u++],done:!o}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function r(o,a){var s=typeof Symbol=="function"&&o[Symbol.iterator];if(!s)return o;var u=s.call(o),l,c=[],f;try{for(;(a===void 0||a-- >0)&&!(l=u.next()).done;)c.push(l.value)}catch(d){f={error:d}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return c}function i(o,a,s){if(s||arguments.length===2)for(var u=0,l=a.length,c;u<l;u++)(c||!(u in a))&&(c||(c=Array.prototype.slice.call(a,0,u)),c[u]=a[u]);return o.concat(c||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Av);var hf={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ActionTypes=void 0,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"}(e.ActionTypes||(e.ActionTypes={})),e.SpecialTargets=void 0,function(t){t.Parent="#_parent",t.Internal="#_internal"}(e.SpecialTargets||(e.SpecialTargets={}))})(hf);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});var cn=hf,wj=cn.ActionTypes.Start,xj=cn.ActionTypes.Stop,Tj=cn.ActionTypes.Raise,Ej=cn.ActionTypes.Send,Ij=cn.ActionTypes.Cancel,Aj=cn.ActionTypes.NullEvent,$j=cn.ActionTypes.Assign,Oj=cn.ActionTypes.After,Dj=cn.ActionTypes.DoneState,Nj=cn.ActionTypes.Log,Pj=cn.ActionTypes.Init,Rj=cn.ActionTypes.Invoke,kj=cn.ActionTypes.ErrorExecution,Mj=cn.ActionTypes.ErrorPlatform,jj=cn.ActionTypes.ErrorCustom,_j=cn.ActionTypes.Update,qj=cn.ActionTypes.Choose,Fj=cn.ActionTypes.Pure;Ut.after=Oj;Ut.assign=$j;Ut.cancel=Ij;Ut.choose=qj;Ut.doneState=Dj;Ut.error=jj;Ut.errorExecution=kj;Ut.errorPlatform=Mj;Ut.init=Pj;Ut.invoke=Rj;Ut.log=Nj;Ut.nullEvent=Aj;Ut.pure=Fj;Ut.raise=Tj;Ut.send=Ej;Ut.start=wj;Ut.stop=xj;Ut.update=_j;var p0={},Za={};Object.defineProperty(Za,"__esModule",{value:!0});var Lj=".",Vj={},Bj="xstate.guard",Uj="";Za.DEFAULT_GUARD_TYPE=Bj;Za.EMPTY_ACTIVITY_MAP=Vj;Za.STATE_DELIMITER=Lj;Za.TARGETLESS_KEY=Uj;var vf={};Object.defineProperty(vf,"__esModule",{value:!0});var Gj=process.env.NODE_ENV==="production";vf.IS_PRODUCTION=Gj;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Av,n=hf,r=Ut,i=Za,o=vf,a;function s(S){return Object.keys(S)}function u(S,M,F){F===void 0&&(F=i.STATE_DELIMITER);var q=h(S,F),Q=h(M,F);return G(Q)?G(q)?Q===q:!1:G(q)?q in Q:Object.keys(q).every(function(Z){return Z in Q?u(q[Z],Q[Z]):!1})}function l(S){try{return G(S)||typeof S=="number"?"".concat(S):S.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function c(S){try{return G(S)||typeof S=="number"?"".concat(S):B(S)?S.name:S.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(S,M){try{return ie(S)?S:S.toString().split(M)}catch{throw new Error("'".concat(S,"' is not a valid state path."))}}function d(S){return typeof S=="object"&&"value"in S&&"context"in S&&"event"in S&&"_event"in S}function h(S,M){if(d(S))return S.value;if(ie(S))return p(S);if(typeof S!="string")return S;var F=f(S,M);return p(F)}function p(S){if(S.length===1)return S[0];for(var M={},F=M,q=0;q<S.length-1;q++)q===S.length-2?F[S[q]]=S[q+1]:(F[S[q]]={},F=F[S[q]]);return M}function v(S,M){for(var F={},q=Object.keys(S),Q=0;Q<q.length;Q++){var Z=q[Q];F[Z]=M(S[Z],Z,S,Q)}return F}function g(S,M,F){var q,Q,Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];F($e)&&(Z[be]=M($e,be,S))}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}var C=function(S){return function(M){var F,q,Q=M;try{for(var Z=t.__values(S),ce=Z.next();!ce.done;ce=Z.next()){var se=ce.value;Q=Q[se]}}catch(be){F={error:be}}finally{try{ce&&!ce.done&&(q=Z.return)&&q.call(Z)}finally{if(F)throw F.error}}return Q}};function m(S,M){return function(F){var q,Q,Z=F;try{for(var ce=t.__values(S),se=ce.next();!se.done;se=ce.next()){var be=se.value;Z=Z[M][be]}}catch($e){q={error:$e}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}}function b(S){if(!S)return[[]];if(G(S))return[[S]];var M=T(Object.keys(S).map(function(F){var q=S[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:b(S[F]).map(function(Q){return[F].concat(Q)})}));return M}function x(S){var M,F,q={};if(S&&S.length===1&&S[0].length===1)return S[0][0];try{for(var Q=t.__values(S),Z=Q.next();!Z.done;Z=Q.next())for(var ce=Z.value,se=q,be=0;be<ce.length;be++){var $e=ce[be];if(be===ce.length-2){se[$e]=ce[be+1];break}se[$e]=se[$e]||{},se=se[$e]}}catch(qt){M={error:qt}}finally{try{Z&&!Z.done&&(F=Q.return)&&F.call(Q)}finally{if(M)throw M.error}}return q}function T(S){var M;return(M=[]).concat.apply(M,t.__spreadArray([],t.__read(S),!1))}function E(S){return ie(S)?S:[S]}function A(S){return S===void 0?[]:E(S)}function N(S,M,F){var q,Q;if(B(S))return S(M,F.data);var Z={};try{for(var ce=t.__values(Object.keys(S)),se=ce.next();!se.done;se=ce.next()){var be=se.value,$e=S[be];B($e)?Z[be]=$e(M,F.data):Z[be]=$e}}catch(qt){q={error:qt}}finally{try{se&&!se.done&&(Q=ce.return)&&Q.call(ce)}finally{if(q)throw q.error}}return Z}function I(S){return/^(done|error)\./.test(S)}function P(S){return!!(S instanceof Promise||S!==null&&(B(S)||typeof S=="object")&&B(S.then))}function _(S){return S!==null&&typeof S=="object"&&"transition"in S&&typeof S.transition=="function"}function L(S,M){var F,q,Q=t.__read([[],[]],2),Z=Q[0],ce=Q[1];try{for(var se=t.__values(S),be=se.next();!be.done;be=se.next()){var $e=be.value;M($e)?Z.push($e):ce.push($e)}}catch(qt){F={error:qt}}finally{try{be&&!be.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Z,ce]}function U(S,M){return v(S.states,function(F,q){if(F){var Q=(G(M)?void 0:M[q])||(F?F.current:void 0);if(Q)return{current:Q,states:U(F,Q)}}})}function Y(S,M){return{current:M,states:U(S,M)}}function k(S,M,F,q){o.IS_PRODUCTION||e.warn(!!S,"Attempting to update undefined context");var Q=S&&F.reduce(function(Z,ce){var se,be,$e=ce.assignment,qt={state:q,action:ce,_event:M},Qi={};if(B($e))Qi=$e(Z,M.data,qt);else try{for(var Vr=t.__values(Object.keys($e)),mr=Vr.next();!mr.done;mr=Vr.next()){var cs=mr.value,Zi=$e[cs];Qi[cs]=B(Zi)?Zi(Z,M.data,qt):Zi}}catch(qf){se={error:qf}}finally{try{mr&&!mr.done&&(be=Vr.return)&&be.call(Vr)}finally{if(se)throw se.error}}return Object.assign({},Z,Qi)},S);return Q}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(S,M){var F=S instanceof Error?S:void 0;if(!(!F&&S)&&console!==void 0){var q=["Warning: ".concat(M)];F&&q.push(F),console.warn.apply(console,q)}});function ie(S){return Array.isArray(S)}function B(S){return typeof S=="function"}function G(S){return typeof S=="string"}function fe(S,M){if(S)return G(S)?{type:i.DEFAULT_GUARD_TYPE,name:S,predicate:M?M[S]:void 0}:B(S)?{type:i.DEFAULT_GUARD_TYPE,name:S.name,predicate:S}:S}function j(S){try{return"subscribe"in S&&B(S.subscribe)}catch{return!1}}var R=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[R]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(S){return!!S&&"__xstatenode"in S}function X(S){return!!S&&typeof S.send=="function"}var ae=function(){var S=0;return function(){return S++,S.toString(16)}}();function de(S,M){return G(S)||typeof S=="number"?t.__assign({type:S},M):S}function he(S,M){if(!G(S)&&"$$type"in S&&S.$$type==="scxml")return S;var F=de(S);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},M)}function Te(S,M){var F=E(M).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:S}:t.__assign(t.__assign({},q),{event:S})});return F}function ke(S){if(!(S===void 0||S===i.TARGETLESS_KEY))return A(S)}function Ne(S,M,F){if(!o.IS_PRODUCTION){var q=S.stack?" Stacktrace was '".concat(S.stack,"'"):"";if(S===M)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(S,"'.").concat(q));else{var Q=M.stack?" Stacktrace was '".concat(M.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(S,"'. ").concat(q," Current error is '").concat(M,"'.").concat(Q))}}}function mt(S,M,F,q,Q){var Z=S.options.guards,ce={state:Q,cond:M,_event:q};if(M.type===i.DEFAULT_GUARD_TYPE)return((Z==null?void 0:Z[M.name])||M.predicate)(F,q.data,ce);var se=Z==null?void 0:Z[M.type];if(!se)throw new Error("Guard '".concat(M.type,"' is not implemented on machine '").concat(S.id,"'."));return se(F,q.data,ce)}function le(S){return typeof S=="string"?{type:S}:S}function Pn(S,M,F){var q=function(){},Q=typeof S=="object",Z=Q?S:null;return{next:((Q?S.next:S)||q).bind(Z),error:((Q?S.error:M)||q).bind(Z),complete:((Q?S.complete:F)||q).bind(Z)}}function hi(S,M){return"".concat(S,":invocation[").concat(M,"]")}function Bo(S){return(S.type===r.raise||S.type===r.send&&S.to===n.SpecialTargets.Internal)&&typeof S.delay!="number"}e.createInvokeId=hi,e.evaluateGuard=mt,e.flatten=T,e.getActionType=c,e.getEventType=l,e.interopSymbols=te,e.isActor=X,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=j,e.isPromiseLike=P,e.isRaisableAction=Bo,e.isStateLike=d,e.isString=G,e.keys=s,e.mapContext=N,e.mapFilterValues=g,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=ke,e.partition=L,e.path=C,e.pathToStateValue=p,e.pathsToStateValue=x,e.reportUnhandledExceptionOnInvocation=Ne,e.symbolObservable=R,e.toArray=A,e.toArrayStrict=E,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=le,e.toObserver=Pn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=b,e.toStateValue=h,e.toTransitionConfigArray=Te,e.uniqueId=ae,e.updateContext=k,e.updateHistoryStates=U,e.updateHistoryValue=Y})(p0);Object.defineProperty(it,"__esModule",{value:!0});var Xe=Av,pr=hf,sn=Ut,Le=p0,h0=vf,zj=Le.toSCXMLEvent({type:sn.init});function Ap(e,t){return t&&t[e]||void 0}function mf(e,t){var n;if(Le.isString(e)||typeof e=="number"){var r=Ap(e,t);Le.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Le.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Ap(e.type,t);if(Le.isFunction(r))n=Xe.__assign(Xe.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Xe.__assign(Xe.__assign(Xe.__assign({},r),e),{type:i})}else n=e}return n}var $p=function(e,t){if(!e)return[];var n=Le.isArray(e)?e:[e];return n.map(function(r){return mf(r,t)})};function $v(e){var t=mf(e);return Xe.__assign(Xe.__assign({id:Le.isString(e)?e:t.id},t),{type:t.type})}function Wj(e,t){return{type:sn.raise,event:typeof e=="function"?e:Le.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function v0(e,t,n,r){var i={_event:n},o=Le.toSCXMLEvent(Le.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Le.isString(e.delay)){var s=r&&r[e.delay];a=Le.isFunction(s)?s(t,n.data,i):s}else a=Le.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return Xe.__assign(Xe.__assign({},e),{type:sn.raise,_event:o,delay:a})}function ku(e,t){return{to:t?t.to:void 0,type:sn.send,event:Le.isFunction(e)?e:Le.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Le.isFunction(e)?e.name:Le.getEventType(e)}}function m0(e,t,n,r){var i={_event:n},o=Le.toSCXMLEvent(Le.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(Le.isString(e.delay)){var s=r&&r[e.delay];a=Le.isFunction(s)?s(t,n.data,i):s}else a=Le.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=Le.isFunction(e.to)?e.to(t,n.data,i):e.to;return Xe.__assign(Xe.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Ov(e,t){return ku(e,Xe.__assign(Xe.__assign({},t),{to:pr.SpecialTargets.Parent}))}function Hj(e,t,n){return ku(t,Xe.__assign(Xe.__assign({},n),{to:e}))}function Kj(){return Ov(sn.update)}function Yj(e,t){return ku(e,Xe.__assign(Xe.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var Jj=function(e,t){return{context:e,event:t}};function Xj(e,t){return e===void 0&&(e=Jj),{type:sn.log,label:t,expr:e}}var y0=function(e,t,n){return Xe.__assign(Xe.__assign({},e),{value:Le.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Qj=function(e){return{type:sn.cancel,sendId:e}};function Zj(e){var t=$v(e);return{type:pr.ActionTypes.Start,activity:t,exec:void 0}}function e_(e){var t=Le.isFunction(e)?e:$v(e);return{type:pr.ActionTypes.Stop,activity:t,exec:void 0}}function g0(e,t,n){var r=Le.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:pr.ActionTypes.Stop,activity:i};return o}var t_=function(e){return{type:sn.assign,assignment:e}};function n_(e){return typeof e=="object"&&"type"in e}function r_(e,t){var n=t?"#".concat(t):"";return"".concat(pr.ActionTypes.After,"(").concat(e,")").concat(n)}function i_(e,t){var n="".concat(pr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function o_(e,t){var n="".concat(pr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function a_(e,t){var n="".concat(pr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function s_(e){return{type:pr.ActionTypes.Pure,get:e}}function u_(e,t){if(!h0.IS_PRODUCTION&&(!e||typeof e=="function")){var n=e;e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=typeof n=="function"?n.apply(void 0,Xe.__spreadArray([],Xe.__read(r),!1)):n;if(!o)throw new Error("Attempted to forward event to undefined actor. This risks an infinite loop in the sender.");return o}}return ku(function(r,i){return i},Xe.__assign(Xe.__assign({},t),{to:e}))}function l_(e,t){return Ov(function(n,r,i){return{type:sn.error,data:Le.isFunction(e)?e(n,r,i):e}},Xe.__assign(Xe.__assign({},t),{to:pr.SpecialTargets.Parent}))}function c_(e){return{type:pr.ActionTypes.Choose,conds:e}}var f_=function(e){var t,n,r=[];try{for(var i=Xe.__values(e),o=i.next();!o.done;o=i.next())for(var a=o.value,s=0;s<a.actions.length;){if(a.actions[s].type===sn.assign){r.push(a.actions[s]),a.actions.splice(s,1);continue}s++}}catch(u){t={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r};function Op(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:f_(i),u=s.length?Le.updateContext(n,r,s,t):n,l=a?[n]:void 0,c=[];function f(p,v){var g;switch(v.type){case sn.raise:{var C=v0(v,u,r,e.options.delays);return o&&typeof C.delay=="number"&&o(C,u,r),C}case sn.send:var m=m0(v,u,r,e.options.delays);if(!h0.IS_PRODUCTION){var b=v.delay;Le.warn(!Le.isString(b)||typeof m.delay=="number","No delay reference for delay expression '".concat(b,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==pr.SpecialTargets.Internal&&(p==="entry"?c.push(m):o(m,u,r)),m;case sn.log:{var x=y0(v,u,r);return o==null||o(x,u,r),x}case sn.choose:{var T=v,E=(g=T.conds.find(function(B){var G=Le.toGuard(B.cond,e.options.guards);return!G||Le.evaluateGuard(e,G,u,r,o?void 0:t)}))===null||g===void 0?void 0:g.actions;if(!E)return[];var A=Xe.__read(Op(e,t,u,r,[{type:p,actions:$p(Le.toArray(E),e.options.actions)}],o,a),2),N=A[0],I=A[1];return u=I,l==null||l.push(u),N}case sn.pure:{var E=v.get(u,r.data);if(!E)return[];var P=Xe.__read(Op(e,t,u,r,[{type:p,actions:$p(Le.toArray(E),e.options.actions)}],o,a),2),_=P[0],L=P[1];return u=L,l==null||l.push(u),_}case sn.stop:{var x=g0(v,u,r);return o==null||o(x,n,r),x}case sn.assign:{u=Le.updateContext(u,r,[v],o?void 0:t),l==null||l.push(u);break}default:var U=mf(v,e.options.actions),Y=U.exec;if(o)o(U,u,r);else if(Y&&l){var k=l.length-1,ie=Xe.__assign(Xe.__assign({},U),{exec:function(B){for(var G=[],fe=1;fe<arguments.length;fe++)G[fe-1]=arguments[fe];Y.apply(void 0,Xe.__spreadArray([l[k]],Xe.__read(G),!1))}});U=ie}return U}}function d(p){var v,g,C=[];try{for(var m=Xe.__values(p.actions),b=m.next();!b.done;b=m.next()){var x=b.value,T=f(p.type,x);T&&(C=C.concat(T))}}catch(E){v={error:E}}finally{try{b&&!b.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}return c.forEach(function(E){o(E,u,r)}),c.length=0,C}var h=Le.flatten(i.map(d));return[h,u]}it.actionTypes=sn;it.after=r_;it.assign=t_;it.cancel=Qj;it.choose=c_;it.done=i_;it.doneInvoke=o_;it.error=a_;it.escalate=l_;it.forwardTo=u_;it.getActionFunction=Ap;it.initEvent=zj;it.isActionObject=n_;var Wn=it.log=Xj,d_=it.pure=s_;it.raise=Wj;it.resolveActions=Op;it.resolveLog=y0;it.resolveRaise=v0;it.resolveSend=m0;it.resolveStop=g0;it.respond=Yj;it.send=ku;it.sendParent=Ov;it.sendTo=Hj;it.sendUpdate=Kj;it.start=Zj;var Ry=it.stop=e_;it.toActionObject=mf;it.toActionObjects=$p;it.toActivityDefinition=$v;function b0(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function yf(e){return function(n,r,i,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i,o);var a=o.get(n),s=o.get(r);if(a&&s)return a===r&&s===n;o.set(n,r),o.set(r,n);var u=e(n,r,i,o);return o.delete(n),o.delete(r),u}}function S0(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function ky(e){return e.constructor===Object||e.constructor==null}function My(e){return typeof e.then=="function"}function gf(e,t){return e===t||e!==e&&t!==t}var p_="[object Arguments]",h_="[object Boolean]",v_="[object Date]",m_="[object RegExp]",y_="[object Map]",g_="[object Number]",b_="[object Object]",S_="[object Set]",C_="[object String]",jy=Object.prototype.toString;function bf(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,i=e.areObjectsEqual,o=e.areRegExpsEqual,a=e.areSetsEqual,s=e.createIsNestedEqual,u=s(l);function l(c,f,d){if(c===f)return!0;if(!c||!f||typeof c!="object"||typeof f!="object")return c!==c&&f!==f;if(ky(c)&&ky(f))return i(c,f,u,d);var h=Array.isArray(c),p=Array.isArray(f);if(h||p)return h===p&&t(c,f,u,d);var v=jy.call(c);return v!==jy.call(f)?!1:v===v_?n(c,f,u,d):v===m_?o(c,f,u,d):v===y_?r(c,f,u,d):v===S_?a(c,f,u,d):v===b_||v===p_?My(c)||My(f)?!1:i(c,f,u,d):v===h_||v===g_||v===C_?gf(c.valueOf(),f.valueOf()):!1}return l}function C0(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-- >0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var w_=yf(C0);function w0(e,t){return gf(e.valueOf(),t.valueOf())}function x0(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={},a=0;return e.forEach(function(s,u){if(i){var l=!1,c=0;t.forEach(function(f,d){!l&&!o[c]&&(l=n(u,d,a,c,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[c]=!0),c++}),a++,i=l}}),i}var x_=yf(x0),T_="_owner",E_=Object.prototype.hasOwnProperty;function T0(e,t,n,r){var i=Object.keys(e),o=i.length;if(Object.keys(t).length!==o)return!1;for(var a;o-- >0;){if(a=i[o],a===T_){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!E_.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var I_=yf(T0);function E0(e,t){return e.source===t.source&&e.flags===t.flags}function I0(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var o={};return e.forEach(function(a,s){if(i){var u=!1,l=0;t.forEach(function(c,f){!u&&!o[l]&&(u=n(a,c,s,f,e,t,r))&&(o[l]=!0),l++}),i=u}}),i}var A_=yf(I0),A0=Object.freeze({areArraysEqual:C0,areDatesEqual:w0,areMapsEqual:x0,areObjectsEqual:T0,areRegExpsEqual:E0,areSetsEqual:I0,createIsNestedEqual:b0}),$0=Object.freeze({areArraysEqual:w_,areDatesEqual:w0,areMapsEqual:x_,areObjectsEqual:I_,areRegExpsEqual:E0,areSetsEqual:A_,createIsNestedEqual:b0}),$_=bf(A0);function O_(e,t){return $_(e,t,void 0)}bf(S0(A0,{createIsNestedEqual:function(){return gf}}));bf($0);bf(S0($0,{createIsNestedEqual:function(){return gf}}));var Dp={exports:{}},zf={},sl={exports:{}},Wf={};/**
|
|
102
102
|
* @license React
|
|
103
103
|
* use-sync-external-store-shim.production.min.js
|
|
104
104
|
*
|
|
@@ -106,7 +106,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Nt.Running)throw
|
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the MIT license found in the
|
|
108
108
|
* LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/var
|
|
109
|
+
*/var _y;function D_(){if(_y)return Wf;_y=1;var e=O;function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function s(f,d){var h=d(),p=r({inst:{value:h,getSnapshot:d}}),v=p[0].inst,g=p[1];return o(function(){v.value=h,v.getSnapshot=d,u(v)&&g({inst:v})},[f,h,d]),i(function(){return u(v)&&g({inst:v}),f(function(){u(v)&&g({inst:v})})},[f]),a(h),h}function u(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function l(f,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:s;return Wf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,Wf}var Hf={};/**
|
|
110
110
|
* @license React
|
|
111
111
|
* use-sync-external-store-shim.development.js
|
|
112
112
|
*
|
|
@@ -114,7 +114,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Nt.Running)throw
|
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the MIT license found in the
|
|
116
116
|
* LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/var
|
|
117
|
+
*/var qy;function N_(){return qy||(qy=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(b){{for(var x=arguments.length,T=new Array(x>1?x-1:0),E=1;E<x;E++)T[E-1]=arguments[E];r("error",b,T)}}function r(b,x,T){{var E=t.ReactDebugCurrentFrame,A=E.getStackAddendum();A!==""&&(x+="%s",T=T.concat([A]));var N=T.map(function(I){return String(I)});N.unshift("Warning: "+x),Function.prototype.apply.call(console[b],console,N)}}function i(b,x){return b===x&&(b!==0||1/b===1/x)||b!==b&&x!==x}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue,c=!1,f=!1;function d(b,x,T){c||e.startTransition!==void 0&&(c=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=x();if(!f){var A=x();o(E,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var N=a({inst:{value:E,getSnapshot:x}}),I=N[0].inst,P=N[1];return u(function(){I.value=E,I.getSnapshot=x,h(I)&&P({inst:I})},[b,E,x]),s(function(){h(I)&&P({inst:I});var _=function(){h(I)&&P({inst:I})};return b(_)},[b]),l(E),E}function h(b){var x=b.getSnapshot,T=b.value;try{var E=x();return!o(T,E)}catch{return!0}}function p(b,x,T){return x()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!v,C=g?p:d,m=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:C;Hf.useSyncExternalStore=m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Hf}var Fy;function O0(){return Fy||(Fy=1,process.env.NODE_ENV==="production"?sl.exports=D_():sl.exports=N_()),sl.exports}/**
|
|
118
118
|
* @license React
|
|
119
119
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
120
120
|
*
|
|
@@ -122,7 +122,7 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Nt.Running)throw
|
|
|
122
122
|
*
|
|
123
123
|
* This source code is licensed under the MIT license found in the
|
|
124
124
|
* LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/var
|
|
125
|
+
*/var Ly;function P_(){if(Ly)return zf;Ly=1;var e=O,t=O0();function n(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return zf.useSyncExternalStoreWithSelector=function(l,c,f,d,h){var p=o(null);if(p.current===null){var v={hasValue:!1,value:null};p.current=v}else v=p.current;p=s(function(){function C(E){if(!m){if(m=!0,b=E,E=d(E),h!==void 0&&v.hasValue){var A=v.value;if(h(A,E))return x=A}return x=E}if(A=x,r(b,E))return A;var N=d(E);return h!==void 0&&h(A,N)?A:(b=E,x=N)}var m=!1,b,x,T=f===void 0?null:f;return[function(){return C(c())},T===null?void 0:function(){return C(T())}]},[c,f,d,h]);var g=i(l,p[0],p[1]);return a(function(){v.hasValue=!0,v.value=g},[g]),u(g),g},zf}var Kf={};/**
|
|
126
126
|
* @license React
|
|
127
127
|
* use-sync-external-store-shim/with-selector.development.js
|
|
128
128
|
*
|
|
@@ -130,9 +130,9 @@ Event: `).concat(JSON.stringify(event)));else if(this.status!==Nt.Running)throw
|
|
|
130
130
|
*
|
|
131
131
|
* This source code is licensed under the MIT license found in the
|
|
132
132
|
* LICENSE file in the root directory of this source tree.
|
|
133
|
-
*/var Ly;function P_(){return Ly||(Ly=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=$0();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function l(c,f,d,h,p){var v=o(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var C=s(function(){var T=!1,E,A,N=function(L){if(!T){T=!0,E=L;var U=h(L);if(p!==void 0&&g.hasValue){var Y=g.value;if(p(Y,U))return A=Y,Y}return A=U,U}var k=E,ie=A;if(r(k,L))return ie;var B=h(L);return p!==void 0&&p(ie,B)?ie:(E=L,A=B,B)},I=d===void 0?null:d,P=function(){return N(f())},_=I===null?void 0:function(){return N(I())};return[P,_]},[f,d,h,p]),m=C[0],b=C[1],x=i(c,m,b);return a(function(){g.hasValue=!0,g.value=x},[x]),u(x),x}Wf.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Wf}process.env.NODE_ENV==="production"?$p.exports=N_():$p.exports=P_();var R_=$p.exports,k_=O.useLayoutEffect;function Vy(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var dc=globalThis&&globalThis.__assign||function(){return dc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},dc.apply(this,arguments)},M_=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},j_=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function __(e,t){var n=Vy(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=j_(O.useState(n),1),i=r[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,s=t.actions,u=t.activities,l=t.services,c=t.delays;t.state;var f=M_(t,["context","guards","actions","activities","services","delays","state"]),d=Vy(function(){var h={context:o,guards:a,actions:s,activities:u,services:l,delays:c},p=n.withConfig(h,function(){return dc(dc({},n.context),o)});return c0(p,f)});return k_(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,u),Object.assign(d.machine.options.services,l),Object.assign(d.machine.options.delays,c)},[s,a,u,l,c]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function q_(e,t,n){if(e.status===Nt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var F_=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function L_(e){return e}function V_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=F_(t,1),i=r[0],o=i===void 0?{}:i,a=__(e,o),s=O.useCallback(function(){return a.status===Nt.NotStarted?o.state?ir.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return q_(a,f,d)},[a]),l=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),c=R_.useSyncExternalStoreWithSelector(l,s,s,L_,u);return O.useEffect(function(){var f=o.state;return a.start(f?ir.create(f):void 0),function(){a.stop(),a.status=Nt.NotStarted}},[]),[c,a.send,a]}const ku=window.configuratorReactContexts??{ConfigurationSessionContext:O.createContext(null),ConfigurationInitializationContext:O.createContext(null),ConfigurationUpdatingContext:O.createContext(null),ConfigurationContext:O.createContext(null)};window.configuratorReactContexts=ku;const O0=ku.ConfigurationSessionContext,D0=ku.ConfigurationInitializationContext,B_=ku.ConfigurationUpdatingContext,N0=ku.ConfigurationContext,$v=()=>O.useContext(O0),es=()=>O.useContext(N0),P0="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function Ov(e){if(!e)throw new Error(P0)}function ts(e){if(!e)throw new Error(P0)}function si(){const e=$v();return Ov(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var U_=function(e){return e._tag==="Some"},bf=function(e){return function(t){return U_(e(t))}};const G_=bf(e=>e.type===V.Choice?De(e):me),z_=bf(e=>e.type===V.Numeric?De(e):me),W_=bf(e=>e.type===V.Boolean?De(e):me),H_=bf(e=>e.type===V.Component?De(e):me);function Sf(e){return e.decision!=null&&e.decision.kind===Se.Explicit}function R0(e){return y(e.values,Vt(Sf),z(t=>({type:V.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function K_(e){return y(e,Ou(Sf),K(()=>({type:V.Numeric,attributeId:e.id,state:null})))}function Y_(e){return y(e,Ou(Sf),K(()=>({type:V.Boolean,attributeId:e.id,state:null})))}function J_(e){return y(e,Ou(Sf),K(()=>({type:V.Component,attributeId:e.id,state:null})))}function X_(e,t){return y(Xa.filterAttributesOfComponent(t,e,!0),n=>[y(n,Vt(G_),nw(R0)),y(n,Vt(z_),z(K_),qn),y(n,Vt(W_),z(Y_),qn),y(n,Vt(H_),z(J_),qn)],Ha)}function k0(){const e=$v();return Ov(e),O.useMemo(()=>({explain:(t,n)=>H(n).with("decisions",r=>e.explain(t,r)).with("constraints",r=>e.explain(t,r)).with("full",r=>e.explain(t,r)).exhaustive(),applySolution:t=>e.applySolution(t)}),[e])}function ns(e,t=!1){const n=es();return ts(n),O.useMemo(()=>y(ye(e),K(Ln(z(r=>Xa.getAttribute(n,r)),t?Vo(ye):_r)),Qe(()=>n.attributes)),[e,n,t])}function rs(e){const t=es(),{makeDecision:n,setManyDecision:r}=si(),i=Cf(e,Ue.choiceValue);ts(t);const o=Xa.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,l)=>n({type:V.Choice,attributeId:e,choiceValueId:u,state:l}),clearDecisions:y(o,ye,K(R0),Mt(Wa),K(u=>()=>r(u,{type:"Default"})),Qe(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function M0(e){const t=es(),{makeDecision:n}=si(),r=Cf(e,Ue.numeric);ts(t);const i=Xa.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:V.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function Q_(e){const t=es(),{makeDecision:n}=si(),r=Cf(e,Ue.boolean);ts(t);const i=Xa.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:V.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function Z_(e){const t=es(),{makeDecision:n,setManyDecision:r}=si(),i=Cf(e,Ue.component);ts(t);const o=t.attributes,a=Xa.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:l=>n({type:V.Component,attributeId:e,state:l}),clearSubtree:y(X_(e,o),Ou(Wa),K(l=>()=>r(l,{type:"Default"})),Qe(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Cf(e,t){const{explain:n,applySolution:r}=k0();return O.useMemo(()=>({explain:(i,o)=>{const a=H(i.question).with(Ft.whyIsNotSatisfied,()=>Ue.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return H(o).with("decisions",u=>n(s,u)).with("constraints",u=>n(s,u)).with("full",u=>n(s,u)).exhaustive()},applySolution:r}),[e,t,n,r])}const By=An(Nu),eq=An(CM),tq=An((e,t)=>mw(ot).equals(e??{},t??{})),nq=Sn({attributeId:By,decisions:Ki(By)}),rq=An((e,t)=>Ki(nq).equals(e??[],t??[])),iq=Sn({type:ot}),oq=Sn({type:ot}),aq=Sn({type:ot,rules:Ki(eq)}),sq=An((e,t)=>H({x:e,y:t}).returnType().with({x:{type:vn.all},y:{type:vn.all}},({x:n,y:r})=>iq.equals(n,r)).with({x:{type:vn.none},y:{type:vn.none}},({x:n,y:r})=>oq.equals(n,r)).with({x:{type:vn.specific},y:{type:vn.specific}},({x:n,y:r})=>aq.equals(n,r)).otherwise(()=>!1)),uq=Sn({rules:lf(sq)}),j0=Sn({configurationModelSource:An((e,t)=>$_(e,t)),attributeRelations:rq,usageRuleParameters:tq,allowedInExplain:lf(uq)}),Op=lf(j0),lq=Zh,_l=lf(lq),cq=()=>Tv({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[Wn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Wn("Entering ProcessChanges","SessionManagement:"),Qo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Wn("Entering DisposeSession","SessionManagement:"),Qo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Wn("Entering CreateSession","SessionManagement:"),Qo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Wn("Entering SessionCreationFailed","SessionManagement:"),Qo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Wn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Wn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Wn("Entering UpdateSession","SessionManagement:"),Qo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Wn("Entering SessionUpdateFailed","SessionManagement:"),Qo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Wn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Wn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:kn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:kn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:kn((e,t)=>(e.session&&e.session.close().then(Gr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:kn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:kn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:kn({sessionCreationError:()=>null}),setSessionUpdateError:kn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:kn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:kn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({failureResult:t,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({failureResult:t,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!_l.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!j0.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!_l.equals(e.desiredClient,e.sessionCreationError.client)||!Op.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!_l.equals(e.desiredClient,e.actualClient)||!Op.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Qo(e){const t=e===0,n=e===1;return f_((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,failureResult:r.sessionCreationError&&r.sessionCreationError.failureResult},a={isUpdating:n&&r.sessionUpdateError==null,failureResult:r.sessionUpdateError&&r.sessionUpdateError.failureResult};return f0({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const fq=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),dq=()=>Tv({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[f0((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Wn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Wn("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>fq(e.session)}}}},{actions:{saveSession:kn((e,t)=>({session:t.session}))}}),pq=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},Uy=()=>{const e=pq();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var hq=function(e,t,n){var r=O.useRef(),i=O.useRef(0);return r.current==null&&(r.current=e),t.equals(e,r.current)||(n&&n.debug&&process.env.NODE_ENV!=="production"&&console.info("Stable hook update triggered:",{prev:r.current,value:e}),r.current=e,i.current+=1),[i.current]},Gy=function(e,t,n,r){return O.useEffect(e,hq(t,n,r))};const vq=()=>Tv({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:Uy()},entry:[kn({sessionManagementActor:()=>Dy(cq()),configurationSubscriptionManagementActor:()=>Dy(dq())})],exit:[Py(e=>e.sessionManagementActor),Py(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[ol(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[ol(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[ol(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[ol(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[kn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),Sj(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[kn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:kn((e,t)=>{var n;const r=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&r&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>r?null:e.isReadyPromise!=null?e.isReadyPromise:Uy())()}})}});function mq(e){var t,n;const[r,i]=V_(vq,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});Gy(()=>{i({type:"ChangeConfigurationClient",client:e.configuratorClient}),e.configuratorClient||console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.")},[e.configuratorClient],uy(_l)),Gy(()=>{const u=y(ye(e.sessionContext),SP(l=>ye(l.configurationModelSource)),Mn);i({type:"ChangeSessionContext",sessionContext:u}),u||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[e.sessionContext],uy(Op));const o=O.useMemo(()=>{var u,l,c,f;return{isInitializing:((l=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(c=r.context.isReadyPromise)==null?void 0:c.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,l;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.failureResult)&&{...r.context.sessionUpdating.failureResult,retry:()=>i({type:"RetrySessionUpdate"})}}},[r.context.sessionUpdating]),s=((t=r.context.configuration)==null?void 0:t.session)===r.context.session?(n=r.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:r.context.session,configuration:s}}function yq(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=mq({configuratorClient:t,sessionContext:n});return $.jsx(D0.Provider,{value:r,children:$.jsx(B_.Provider,{value:i,children:$.jsx(O0.Provider,{value:o,children:$.jsx(N0.Provider,{value:a,children:e.children})})})})}function Dv(){return O.useContext(D0)}function gq(e){const{children:t}=e,{isInitializingPromise:n}=Dv();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function Nv(){const e=$v(),t=es();return Ov(e),ts(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const bq=O.createContext(null),Hf={didCatch:!1,error:null};class Sq extends O.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Hf}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Hf)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&Cq(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Hf)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const u={error:a,resetErrorBoundary:this.resetErrorBoundary};if(O.isValidElement(i))s=i;else if(typeof n=="function")s=n(u);else if(r)s=O.createElement(r,u);else throw a}return O.createElement(bq.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function Cq(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}var In=function(){return In=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},In.apply(this,arguments)};function wq(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Oo(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function xq(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Tq=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Eq=xq(function(e){return Tq.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),bt="-ms-",qs="-moz-",ut="-webkit-",_0="comm",wf="rule",Pv="decl",Iq="@import",q0="@keyframes",Aq="@layer",$q=Math.abs,Rv=String.fromCharCode,Dp=Object.assign;function Oq(e,t){return rn(e,0)^45?(((t<<2^rn(e,0))<<2^rn(e,1))<<2^rn(e,2))<<2^rn(e,3):0}function F0(e){return e.trim()}function Vr(e,t){return(e=t.exec(e))?e[0]:e}function Me(e,t,n){return e.replace(t,n)}function ql(e,t){return e.indexOf(t)}function rn(e,t){return e.charCodeAt(t)|0}function Ta(e,t,n){return e.slice(t,n)}function Nr(e){return e.length}function L0(e){return e.length}function Ds(e,t){return t.push(e),e}function Dq(e,t){return e.map(t).join("")}function zy(e,t){return e.filter(function(n){return!Vr(n,t)})}var xf=1,Ea=1,V0=0,lr=0,Kt=0,is="";function Tf(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:xf,column:Ea,length:a,return:"",siblings:s}}function Ci(e,t){return Dp(Tf("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Zo(e){for(;e.root;)e=Ci(e.root,{children:[e]});Ds(e,e.siblings)}function Nq(){return Kt}function Pq(){return Kt=lr>0?rn(is,--lr):0,Ea--,Kt===10&&(Ea=1,xf--),Kt}function xr(){return Kt=lr<V0?rn(is,lr++):0,Ea++,Kt===10&&(Ea=1,xf++),Kt}function bo(){return rn(is,lr)}function Fl(){return lr}function Ef(e,t){return Ta(is,e,t)}function Np(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Rq(e){return xf=Ea=1,V0=Nr(is=e),lr=0,[]}function kq(e){return is="",e}function Kf(e){return F0(Ef(lr-1,Pp(e===91?e+2:e===40?e+1:e)))}function Mq(e){for(;(Kt=bo())&&Kt<33;)xr();return Np(e)>2||Np(Kt)>3?"":" "}function jq(e,t){for(;--t&&xr()&&!(Kt<48||Kt>102||Kt>57&&Kt<65||Kt>70&&Kt<97););return Ef(e,Fl()+(t<6&&bo()==32&&xr()==32))}function Pp(e){for(;xr();)switch(Kt){case e:return lr;case 34:case 39:e!==34&&e!==39&&Pp(Kt);break;case 40:e===41&&Pp(e);break;case 92:xr();break}return lr}function _q(e,t){for(;xr()&&e+Kt!==47+10;)if(e+Kt===42+42&&bo()===47)break;return"/*"+Ef(t,lr-1)+"*"+Rv(e===47?e:xr())}function qq(e){for(;!Np(bo());)xr();return Ef(e,lr)}function Fq(e){return kq(Ll("",null,null,null,[""],e=Rq(e),0,[0],e))}function Ll(e,t,n,r,i,o,a,s,u){for(var l=0,c=0,f=a,d=0,h=0,p=0,v=1,g=1,C=1,m=0,b="",x=i,T=o,E=r,A=b;g;)switch(p=m,m=xr()){case 40:if(p!=108&&rn(A,f-1)==58){ql(A+=Me(Kf(m),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:A+=Kf(m);break;case 9:case 10:case 13:case 32:A+=Mq(p);break;case 92:A+=jq(Fl()-1,7);continue;case 47:switch(bo()){case 42:case 47:Ds(Lq(_q(xr(),Fl()),t,n,u),u);break;default:A+="/"}break;case 123*v:s[l++]=Nr(A)*C;case 125*v:case 59:case 0:switch(m){case 0:case 125:g=0;case 59+c:C==-1&&(A=Me(A,/\f/g,"")),h>0&&Nr(A)-f&&Ds(h>32?Hy(A+";",r,n,f-1,u):Hy(Me(A," ","")+";",r,n,f-2,u),u);break;case 59:A+=";";default:if(Ds(E=Wy(A,t,n,l,c,i,s,b,x=[],T=[],f,o),o),m===123)if(c===0)Ll(A,t,E,E,x,o,f,s,T);else switch(d===99&&rn(A,3)===110?100:d){case 100:case 108:case 109:case 115:Ll(e,E,E,r&&Ds(Wy(e,E,E,0,0,i,s,b,i,x=[],f,T),T),i,T,f,s,r?x:T);break;default:Ll(A,E,E,E,[""],T,0,s,T)}}l=c=h=0,v=C=1,b=A="",f=a;break;case 58:f=1+Nr(A),h=p;default:if(v<1){if(m==123)--v;else if(m==125&&v++==0&&Pq()==125)continue}switch(A+=Rv(m),m*v){case 38:C=c>0?1:(A+="\f",-1);break;case 44:s[l++]=(Nr(A)-1)*C,C=1;break;case 64:bo()===45&&(A+=Kf(xr())),d=bo(),c=f=Nr(b=A+=qq(Fl())),m++;break;case 45:p===45&&Nr(A)==2&&(v=0)}}return o}function Wy(e,t,n,r,i,o,a,s,u,l,c,f){for(var d=i-1,h=i===0?o:[""],p=L0(h),v=0,g=0,C=0;v<r;++v)for(var m=0,b=Ta(e,d+1,d=$q(g=a[v])),x=e;m<p;++m)(x=F0(g>0?h[m]+" "+b:Me(b,/&\f/g,h[m])))&&(u[C++]=x);return Tf(e,t,n,i===0?wf:s,u,l,c,f)}function Lq(e,t,n,r){return Tf(e,t,n,_0,Rv(Nq()),Ta(e,2,-2),0,r)}function Hy(e,t,n,r,i){return Tf(e,t,n,Pv,Ta(e,0,r),Ta(e,r+1,-1),r,i)}function B0(e,t,n){switch(Oq(e,t)){case 5103:return ut+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ut+e+e;case 4789:return qs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+e+qs+e+bt+e+e;case 5936:switch(rn(e,t+11)){case 114:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return ut+e+bt+e+e;case 6165:return ut+e+bt+"flex-"+e+e;case 5187:return ut+e+Me(e,/(\w+).+(:[^]+)/,ut+"box-$1$2"+bt+"flex-$1$2")+e;case 5443:return ut+e+bt+"flex-item-"+Me(e,/flex-|-self/g,"")+(Vr(e,/flex-|baseline/)?"":bt+"grid-row-"+Me(e,/flex-|-self/g,""))+e;case 4675:return ut+e+bt+"flex-line-pack"+Me(e,/align-content|flex-|-self/g,"")+e;case 5548:return ut+e+bt+Me(e,"shrink","negative")+e;case 5292:return ut+e+bt+Me(e,"basis","preferred-size")+e;case 6060:return ut+"box-"+Me(e,"-grow","")+ut+e+bt+Me(e,"grow","positive")+e;case 4554:return ut+Me(e,/([^-])(transform)/g,"$1"+ut+"$2")+e;case 6187:return Me(Me(Me(e,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),e,"")+e;case 5495:case 3959:return Me(e,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return Me(Me(e,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+bt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+e+e;case 4200:if(!Vr(e,/flex-|baseline/))return bt+"grid-column-align"+Ta(e,t)+e;break;case 2592:case 3360:return bt+Me(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Vr(r.props,/grid-\w+-end/)})?~ql(e+(n=n[t].value),"span")?e:bt+Me(e,"-start","")+e+bt+"grid-row-span:"+(~ql(n,"span")?Vr(n,/\d+/):+Vr(n,/\d+/)-+Vr(e,/\d+/))+";":bt+Me(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Vr(r.props,/grid-\w+-start/)})?e:bt+Me(Me(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Me(e,/(.+)-inline(.+)/,ut+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Nr(e)-1-t>6)switch(rn(e,t+1)){case 109:if(rn(e,t+4)!==45)break;case 102:return Me(e,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+qs+(rn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ql(e,"stretch")?B0(Me(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Me(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,l){return bt+i+":"+o+l+(a?bt+i+"-span:"+(s?u:+u-+o)+l:"")+e});case 4949:if(rn(e,t+6)===121)return Me(e,":",":"+ut)+e;break;case 6444:switch(rn(e,rn(e,14)===45?18:11)){case 120:return Me(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ut+(rn(e,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+bt+"$2box$3")+e;case 100:return Me(e,":",":"+bt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Me(e,"scroll-","scroll-snap-")+e}return e}function pc(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Vq(e,t,n,r){switch(e.type){case Aq:if(e.children.length)break;case Iq:case Pv:return e.return=e.return||e.value;case _0:return"";case q0:return e.return=e.value+"{"+pc(e.children,r)+"}";case wf:if(!Nr(e.value=e.props.join(",")))return""}return Nr(n=pc(e.children,r))?e.return=e.value+"{"+n+"}":""}function Bq(e){var t=L0(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function Uq(e){return function(t){t.root||(t=t.return)&&e(t)}}function Gq(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Pv:e.return=B0(e.value,e.length,n);return;case q0:return pc([Ci(e,{value:Me(e.value,"@","@"+ut)})],r);case wf:if(e.length)return Dq(n=e.props,function(i){switch(Vr(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Zo(Ci(e,{props:[Me(i,/:(read-\w+)/,":"+qs+"$1")]})),Zo(Ci(e,{props:[i]})),Dp(e,{props:zy(n,r)});break;case"::placeholder":Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,":"+ut+"input-$1")]})),Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,":"+qs+"$1")]})),Zo(Ci(e,{props:[Me(i,/:(plac\w+)/,bt+"input-$1")]})),Zo(Ci(e,{props:[i]})),Dp(e,{props:zy(n,r)});break}return""})}}var zq={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Do=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",kv=typeof window<"u"&&"HTMLElement"in window,Wq=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),Hq={},Ky=/invalid hook call/i,sl=new Set,U0=function(e,t){if(process.env.NODE_ENV!=="production"){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n,` has been created dynamically.
|
|
133
|
+
*/var Vy;function R_(){return Vy||(Vy=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,t=O0();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;function l(c,f,d,h,p){var v=o(null),g;v.current===null?(g={hasValue:!1,value:null},v.current=g):g=v.current;var C=s(function(){var T=!1,E,A,N=function(L){if(!T){T=!0,E=L;var U=h(L);if(p!==void 0&&g.hasValue){var Y=g.value;if(p(Y,U))return A=Y,Y}return A=U,U}var k=E,ie=A;if(r(k,L))return ie;var B=h(L);return p!==void 0&&p(ie,B)?ie:(E=L,A=B,B)},I=d===void 0?null:d,P=function(){return N(f())},_=I===null?void 0:function(){return N(I())};return[P,_]},[f,d,h,p]),m=C[0],b=C[1],x=i(c,m,b);return a(function(){g.hasValue=!0,g.value=x},[x]),u(x),x}Kf.useSyncExternalStoreWithSelector=l,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Kf}process.env.NODE_ENV==="production"?Dp.exports=P_():Dp.exports=R_();var k_=Dp.exports,M_=O.useLayoutEffect;function By(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var pc=globalThis&&globalThis.__assign||function(){return pc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},pc.apply(this,arguments)},j_=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},__=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function q_(e,t){var n=By(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=__(O.useState(n),1),i=r[0];e!==i&&console.warn("Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\nPlease make sure that you pass the same Machine as argument each time.")}var o=t.context,a=t.guards,s=t.actions,u=t.activities,l=t.services,c=t.delays;t.state;var f=j_(t,["context","guards","actions","activities","services","delays","state"]),d=By(function(){var h={context:o,guards:a,actions:s,activities:u,services:l,delays:c},p=n.withConfig(h,function(){return pc(pc({},n.context),o)});return f0(p,f)});return M_(function(){Object.assign(d.machine.options.actions,s),Object.assign(d.machine.options.guards,a),Object.assign(d.machine.options.activities,u),Object.assign(d.machine.options.services,l),Object.assign(d.machine.options.delays,c)},[s,a,u,l,c]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function F_(e,t,n){if(e.status===Nt.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var L_=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o};function V_(e){return e}function B_(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=L_(t,1),i=r[0],o=i===void 0?{}:i,a=q_(e,o),s=O.useCallback(function(){return a.status===Nt.NotStarted?o.state?or.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return F_(a,f,d)},[a]),l=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),c=k_.useSyncExternalStoreWithSelector(l,s,s,V_,u);return O.useEffect(function(){var f=o.state;return a.start(f?or.create(f):void 0),function(){a.stop(),a.status=Nt.NotStarted}},[]),[c,a.send,a]}const Mu=window.configuratorReactContexts??{ConfigurationSessionContext:O.createContext(null),ConfigurationInitializationContext:O.createContext(null),ConfigurationUpdatingContext:O.createContext(null),ConfigurationContext:O.createContext(null)};window.configuratorReactContexts=Mu;const D0=Mu.ConfigurationSessionContext,N0=Mu.ConfigurationInitializationContext,U_=Mu.ConfigurationUpdatingContext,P0=Mu.ConfigurationContext,Dv=()=>O.useContext(D0),es=()=>O.useContext(P0),R0="The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";function Nv(e){if(!e)throw new Error(R0)}function ts(e){if(!e)throw new Error(R0)}function ci(){const e=Dv();return Nv(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var G_=function(e){return e._tag==="Some"},Sf=function(e){return function(t){return G_(e(t))}};const z_=Sf(e=>e.type===V.Choice?De(e):me),W_=Sf(e=>e.type===V.Numeric?De(e):me),H_=Sf(e=>e.type===V.Boolean?De(e):me),K_=Sf(e=>e.type===V.Component?De(e):me);function Cf(e){return e.decision!=null&&e.decision.kind===Se.Explicit}function k0(e){return y(e.values,Vt(Cf),z(t=>({type:V.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function Y_(e){return y(e,Du(Cf),K(()=>({type:V.Numeric,attributeId:e.id,state:null})))}function J_(e){return y(e,Du(Cf),K(()=>({type:V.Boolean,attributeId:e.id,state:null})))}function X_(e){return y(e,Du(Cf),K(()=>({type:V.Component,attributeId:e.id,state:null})))}function Q_(e,t){return y(Xa.filterAttributesOfComponent(t,e,!0),n=>[y(n,Vt(z_),rw(k0)),y(n,Vt(W_),z(Y_),qn),y(n,Vt(H_),z(J_),qn),y(n,Vt(K_),z(X_),qn)],Ha)}function M0(){const e=Dv();return Nv(e),O.useMemo(()=>({explain:(t,n)=>H(n).with("decisions",r=>e.explain(t,r)).with("constraints",r=>e.explain(t,r)).with("full",r=>e.explain(t,r)).exhaustive(),applySolution:t=>e.applySolution(t)}),[e])}function ns(e,t=!1){const n=es();return ts(n),O.useMemo(()=>y(ye(e),K(Ln(z(r=>Xa.getAttribute(n,r)),t?Vo(ye):_r)),Qe(()=>n.attributes)),[e,n,t])}function rs(e){const t=es(),{makeDecision:n,setManyDecision:r}=ci(),i=wf(e,Ue.choiceValue);ts(t);const o=Xa.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,l)=>n({type:V.Choice,attributeId:e,choiceValueId:u,state:l}),clearDecisions:y(o,ye,K(k0),Mt(Wa),K(u=>()=>r(u,{type:"Default"})),Qe(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function j0(e){const t=es(),{makeDecision:n}=ci(),r=wf(e,Ue.numeric);ts(t);const i=Xa.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:V.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function Z_(e){const t=es(),{makeDecision:n}=ci(),r=wf(e,Ue.boolean);ts(t);const i=Xa.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:V.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function eq(e){const t=es(),{makeDecision:n,setManyDecision:r}=ci(),i=wf(e,Ue.component);ts(t);const o=t.attributes,a=Xa.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:l=>n({type:V.Component,attributeId:e,state:l}),clearSubtree:y(Q_(e,o),Du(Wa),K(l=>()=>r(l,{type:"Default"})),Qe(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function wf(e,t){const{explain:n,applySolution:r}=M0();return O.useMemo(()=>({explain:(i,o)=>{const a=H(i.question).with(Ft.whyIsNotSatisfied,()=>Ue.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return H(o).with("decisions",u=>n(s,u)).with("constraints",u=>n(s,u)).with("full",u=>n(s,u)).exhaustive()},applySolution:r}),[e,t,n,r])}const Uy=An(Pu),tq=An(wM),nq=An((e,t)=>yw(ot).equals(e??{},t??{})),rq=Sn({attributeId:Uy,decisions:Yi(Uy)}),iq=An((e,t)=>Yi(rq).equals(e??[],t??[])),oq=Sn({type:ot}),aq=Sn({type:ot}),sq=Sn({type:ot,rules:Yi(tq)}),uq=An((e,t)=>H({x:e,y:t}).returnType().with({x:{type:vn.all},y:{type:vn.all}},({x:n,y:r})=>oq.equals(n,r)).with({x:{type:vn.none},y:{type:vn.none}},({x:n,y:r})=>aq.equals(n,r)).with({x:{type:vn.specific},y:{type:vn.specific}},({x:n,y:r})=>sq.equals(n,r)).otherwise(()=>!1)),lq=Sn({rules:cf(uq)}),_0=Sn({configurationModelSource:An((e,t)=>O_(e,t)),attributeRelations:iq,usageRuleParameters:nq,allowedInExplain:cf(lq)}),Np=cf(_0),cq=tv,ql=cf(cq),fq=()=>Iv({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{desiredClient:null,desiredSessionContext:null,actualClient:null,session:null,sessionCreationError:null,sessionUpdateError:null,hasEverSuccessfullyCreatedSession:!1},initial:"ProcessChanges",on:{ChangeConfigurationClient:{actions:["saveDesiredClient"]},ChangeSessionContext:{actions:["saveDesiredSessionContext"]}},exit:[Wn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Wn("Entering ProcessChanges","SessionManagement:"),Qo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Wn("Entering DisposeSession","SessionManagement:"),Qo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Wn("Entering CreateSession","SessionManagement:"),Qo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Wn("Entering SessionCreationFailed","SessionManagement:"),Qo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Wn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Wn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Wn("Entering UpdateSession","SessionManagement:"),Qo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Wn("Entering SessionUpdateFailed","SessionManagement:"),Qo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Wn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Wn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:kn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:kn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:kn((e,t)=>(e.session&&e.session.close().then(Hr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:kn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:kn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:kn({sessionCreationError:()=>null}),setSessionUpdateError:kn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:kn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:kn({hasEverSuccessfullyCreatedSession:()=>!0})},services:{createSession:e=>e.desiredClient.createSession(e.desiredSessionContext).then(t=>({session:t,client:e.desiredClient})).catch(t=>Promise.reject({failureResult:t,client:e.desiredClient,sessionContext:e.desiredSessionContext})),updateSession:e=>e.session.setSessionContext(e.desiredSessionContext).catch(t=>Promise.reject({failureResult:t,sessionContext:e.desiredSessionContext}))},guards:{shallDisposeSession:e=>e.session!=null&&(e.desiredSessionContext==null||e.desiredClient==null||!ql.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!_0.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!ql.equals(e.desiredClient,e.sessionCreationError.client)||!Np.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!ql.equals(e.desiredClient,e.actualClient)||!Np.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Qo(e){const t=e===0,n=e===1;return d_((r,i)=>{const o={isInitializing:(!r.hasEverSuccessfullyCreatedSession||t)&&r.sessionCreationError==null,failureResult:r.sessionCreationError&&r.sessionCreationError.failureResult},a={isUpdating:n&&r.sessionUpdateError==null,failureResult:r.sessionUpdateError&&r.sessionUpdateError.failureResult};return d0({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const dq=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),pq=()=>Iv({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[d0((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Wn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Wn("Entering Subscribe","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{target:"ProcessChanges",cond:(e,t)=>t.session==null||e.session!==t.session,actions:["saveSession"]}},invoke:{id:"configurationSubscriptionActor",src:(e,t)=>dq(e.session)}}}},{actions:{saveSession:kn((e,t)=>({session:t.session}))}}),hq=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},Gy=()=>{const e=hq();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var vq=function(e,t,n){var r=O.useRef(),i=O.useRef(0);return r.current==null&&(r.current=e),t.equals(e,r.current)||(n&&n.debug&&process.env.NODE_ENV!=="production"&&console.info("Stable hook update triggered:",{prev:r.current,value:e}),r.current=e,i.current+=1),[i.current]},zy=function(e,t,n,r){return O.useEffect(e,vq(t,n,r))};const mq=()=>Iv({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:Gy()},entry:[kn({sessionManagementActor:()=>Ny(fq()),configurationSubscriptionManagementActor:()=>Ny(pq())})],exit:[Ry(e=>e.sessionManagementActor),Ry(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[al(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[al(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[al(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[al(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[kn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),Cj(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[kn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:kn((e,t)=>{var n;const r=!((n=e.sessionInitialization)!=null&&n.isInitializing)&&e.session!=null&&e.configuration!=null&&e.configuration.session===e.session;return e.isReadyPromise&&r&&(e.isReadyPromise.resolve(),e.isReadyPromise.capsule.promise=null),{isReadyPromise:(()=>r?null:e.isReadyPromise!=null?e.isReadyPromise:Gy())()}})}});function yq(e){var t,n;const[r,i]=B_(mq,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});zy(()=>{i({type:"ChangeConfigurationClient",client:e.configuratorClient}),e.configuratorClient||console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.")},[e.configuratorClient],ly(ql)),zy(()=>{const u=y(ye(e.sessionContext),CP(l=>ye(l.configurationModelSource)),Mn);i({type:"ChangeSessionContext",sessionContext:u}),u||console.warn("The session context is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass valid session context data.")},[e.sessionContext],ly(Np));const o=O.useMemo(()=>{var u,l,c,f;return{isInitializing:((l=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:l.promise)!=null,isInitializingPromise:(c=r.context.isReadyPromise)==null?void 0:c.capsule,error:((f=r.context.sessionInitialization)==null?void 0:f.failureResult)&&{...r.context.sessionInitialization.failureResult,retry:()=>i({type:"RetrySessionCreation"})}}},[r.context.sessionInitialization,r.context.isReadyPromise]),a=O.useMemo(()=>{var u,l;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((l=r.context.sessionUpdating)==null?void 0:l.failureResult)&&{...r.context.sessionUpdating.failureResult,retry:()=>i({type:"RetrySessionUpdate"})}}},[r.context.sessionUpdating]),s=((t=r.context.configuration)==null?void 0:t.session)===r.context.session?(n=r.context.configuration)==null?void 0:n.configuration:null;return{configurationInitialization:o,configurationUpdating:a,session:r.context.session,configuration:s}}function gq(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=yq({configuratorClient:t,sessionContext:n});return $.jsx(N0.Provider,{value:r,children:$.jsx(U_.Provider,{value:i,children:$.jsx(D0.Provider,{value:o,children:$.jsx(P0.Provider,{value:a,children:e.children})})})})}function Pv(){return O.useContext(N0)}function bq(e){const{children:t}=e,{isInitializingPromise:n}=Pv();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function Rv(){const e=Dv(),t=es();return Nv(e),ts(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const Sq=O.createContext(null),Yf={didCatch:!1,error:null};class Cq extends O.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Yf}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:o,reason:"imperative-api"}),this.setState(Yf)}}componentDidCatch(t,n){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&n.error!==null&&wq(t.resetKeys,i)){var o,a;(o=(a=this.props).onReset)===null||o===void 0||o.call(a,{next:i,prev:t.resetKeys,reason:"keys"}),this.setState(Yf)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:i}=this.props,{didCatch:o,error:a}=this.state;let s=t;if(o){const u={error:a,resetErrorBoundary:this.resetErrorBoundary};if(O.isValidElement(i))s=i;else if(typeof n=="function")s=n(u);else if(r)s=O.createElement(r,u);else throw a}return O.createElement(Sq.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function wq(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}var In=function(){return In=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},In.apply(this,arguments)};function xq(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function Oo(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function Tq(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Eq=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Iq=Tq(function(e){return Eq.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),bt="-ms-",Fs="-moz-",ut="-webkit-",q0="comm",xf="rule",kv="decl",Aq="@import",F0="@keyframes",$q="@layer",Oq=Math.abs,Mv=String.fromCharCode,Pp=Object.assign;function Dq(e,t){return on(e,0)^45?(((t<<2^on(e,0))<<2^on(e,1))<<2^on(e,2))<<2^on(e,3):0}function L0(e){return e.trim()}function Gr(e,t){return(e=t.exec(e))?e[0]:e}function Me(e,t,n){return e.replace(t,n)}function Fl(e,t){return e.indexOf(t)}function on(e,t){return e.charCodeAt(t)|0}function Ta(e,t,n){return e.slice(t,n)}function Nr(e){return e.length}function V0(e){return e.length}function Ns(e,t){return t.push(e),e}function Nq(e,t){return e.map(t).join("")}function Wy(e,t){return e.filter(function(n){return!Gr(n,t)})}var Tf=1,Ea=1,B0=0,cr=0,Kt=0,is="";function Ef(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:Tf,column:Ea,length:a,return:"",siblings:s}}function wi(e,t){return Pp(Ef("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Zo(e){for(;e.root;)e=wi(e.root,{children:[e]});Ns(e,e.siblings)}function Pq(){return Kt}function Rq(){return Kt=cr>0?on(is,--cr):0,Ea--,Kt===10&&(Ea=1,Tf--),Kt}function Er(){return Kt=cr<B0?on(is,cr++):0,Ea++,Kt===10&&(Ea=1,Tf++),Kt}function bo(){return on(is,cr)}function Ll(){return cr}function If(e,t){return Ta(is,e,t)}function Rp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function kq(e){return Tf=Ea=1,B0=Nr(is=e),cr=0,[]}function Mq(e){return is="",e}function Jf(e){return L0(If(cr-1,kp(e===91?e+2:e===40?e+1:e)))}function jq(e){for(;(Kt=bo())&&Kt<33;)Er();return Rp(e)>2||Rp(Kt)>3?"":" "}function _q(e,t){for(;--t&&Er()&&!(Kt<48||Kt>102||Kt>57&&Kt<65||Kt>70&&Kt<97););return If(e,Ll()+(t<6&&bo()==32&&Er()==32))}function kp(e){for(;Er();)switch(Kt){case e:return cr;case 34:case 39:e!==34&&e!==39&&kp(Kt);break;case 40:e===41&&kp(e);break;case 92:Er();break}return cr}function qq(e,t){for(;Er()&&e+Kt!==47+10;)if(e+Kt===42+42&&bo()===47)break;return"/*"+If(t,cr-1)+"*"+Mv(e===47?e:Er())}function Fq(e){for(;!Rp(bo());)Er();return If(e,cr)}function Lq(e){return Mq(Vl("",null,null,null,[""],e=kq(e),0,[0],e))}function Vl(e,t,n,r,i,o,a,s,u){for(var l=0,c=0,f=a,d=0,h=0,p=0,v=1,g=1,C=1,m=0,b="",x=i,T=o,E=r,A=b;g;)switch(p=m,m=Er()){case 40:if(p!=108&&on(A,f-1)==58){Fl(A+=Me(Jf(m),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:A+=Jf(m);break;case 9:case 10:case 13:case 32:A+=jq(p);break;case 92:A+=_q(Ll()-1,7);continue;case 47:switch(bo()){case 42:case 47:Ns(Vq(qq(Er(),Ll()),t,n,u),u);break;default:A+="/"}break;case 123*v:s[l++]=Nr(A)*C;case 125*v:case 59:case 0:switch(m){case 0:case 125:g=0;case 59+c:C==-1&&(A=Me(A,/\f/g,"")),h>0&&Nr(A)-f&&Ns(h>32?Ky(A+";",r,n,f-1,u):Ky(Me(A," ","")+";",r,n,f-2,u),u);break;case 59:A+=";";default:if(Ns(E=Hy(A,t,n,l,c,i,s,b,x=[],T=[],f,o),o),m===123)if(c===0)Vl(A,t,E,E,x,o,f,s,T);else switch(d===99&&on(A,3)===110?100:d){case 100:case 108:case 109:case 115:Vl(e,E,E,r&&Ns(Hy(e,E,E,0,0,i,s,b,i,x=[],f,T),T),i,T,f,s,r?x:T);break;default:Vl(A,E,E,E,[""],T,0,s,T)}}l=c=h=0,v=C=1,b=A="",f=a;break;case 58:f=1+Nr(A),h=p;default:if(v<1){if(m==123)--v;else if(m==125&&v++==0&&Rq()==125)continue}switch(A+=Mv(m),m*v){case 38:C=c>0?1:(A+="\f",-1);break;case 44:s[l++]=(Nr(A)-1)*C,C=1;break;case 64:bo()===45&&(A+=Jf(Er())),d=bo(),c=f=Nr(b=A+=Fq(Ll())),m++;break;case 45:p===45&&Nr(A)==2&&(v=0)}}return o}function Hy(e,t,n,r,i,o,a,s,u,l,c,f){for(var d=i-1,h=i===0?o:[""],p=V0(h),v=0,g=0,C=0;v<r;++v)for(var m=0,b=Ta(e,d+1,d=Oq(g=a[v])),x=e;m<p;++m)(x=L0(g>0?h[m]+" "+b:Me(b,/&\f/g,h[m])))&&(u[C++]=x);return Ef(e,t,n,i===0?xf:s,u,l,c,f)}function Vq(e,t,n,r){return Ef(e,t,n,q0,Mv(Pq()),Ta(e,2,-2),0,r)}function Ky(e,t,n,r,i){return Ef(e,t,n,kv,Ta(e,0,r),Ta(e,r+1,-1),r,i)}function U0(e,t,n){switch(Dq(e,t)){case 5103:return ut+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ut+e+e;case 4789:return Fs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+e+Fs+e+bt+e+e;case 5936:switch(on(e,t+11)){case 114:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ut+e+bt+Me(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return ut+e+bt+e+e;case 6165:return ut+e+bt+"flex-"+e+e;case 5187:return ut+e+Me(e,/(\w+).+(:[^]+)/,ut+"box-$1$2"+bt+"flex-$1$2")+e;case 5443:return ut+e+bt+"flex-item-"+Me(e,/flex-|-self/g,"")+(Gr(e,/flex-|baseline/)?"":bt+"grid-row-"+Me(e,/flex-|-self/g,""))+e;case 4675:return ut+e+bt+"flex-line-pack"+Me(e,/align-content|flex-|-self/g,"")+e;case 5548:return ut+e+bt+Me(e,"shrink","negative")+e;case 5292:return ut+e+bt+Me(e,"basis","preferred-size")+e;case 6060:return ut+"box-"+Me(e,"-grow","")+ut+e+bt+Me(e,"grow","positive")+e;case 4554:return ut+Me(e,/([^-])(transform)/g,"$1"+ut+"$2")+e;case 6187:return Me(Me(Me(e,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),e,"")+e;case 5495:case 3959:return Me(e,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return Me(Me(e,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+bt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+e+e;case 4200:if(!Gr(e,/flex-|baseline/))return bt+"grid-column-align"+Ta(e,t)+e;break;case 2592:case 3360:return bt+Me(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,Gr(r.props,/grid-\w+-end/)})?~Fl(e+(n=n[t].value),"span")?e:bt+Me(e,"-start","")+e+bt+"grid-row-span:"+(~Fl(n,"span")?Gr(n,/\d+/):+Gr(n,/\d+/)-+Gr(e,/\d+/))+";":bt+Me(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Gr(r.props,/grid-\w+-start/)})?e:bt+Me(Me(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Me(e,/(.+)-inline(.+)/,ut+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Nr(e)-1-t>6)switch(on(e,t+1)){case 109:if(on(e,t+4)!==45)break;case 102:return Me(e,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+Fs+(on(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Fl(e,"stretch")?U0(Me(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Me(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,l){return bt+i+":"+o+l+(a?bt+i+"-span:"+(s?u:+u-+o)+l:"")+e});case 4949:if(on(e,t+6)===121)return Me(e,":",":"+ut)+e;break;case 6444:switch(on(e,on(e,14)===45?18:11)){case 120:return Me(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ut+(on(e,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+bt+"$2box$3")+e;case 100:return Me(e,":",":"+bt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Me(e,"scroll-","scroll-snap-")+e}return e}function hc(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Bq(e,t,n,r){switch(e.type){case $q:if(e.children.length)break;case Aq:case kv:return e.return=e.return||e.value;case q0:return"";case F0:return e.return=e.value+"{"+hc(e.children,r)+"}";case xf:if(!Nr(e.value=e.props.join(",")))return""}return Nr(n=hc(e.children,r))?e.return=e.value+"{"+n+"}":""}function Uq(e){var t=V0(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function Gq(e){return function(t){t.root||(t=t.return)&&e(t)}}function zq(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case kv:e.return=U0(e.value,e.length,n);return;case F0:return hc([wi(e,{value:Me(e.value,"@","@"+ut)})],r);case xf:if(e.length)return Nq(n=e.props,function(i){switch(Gr(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Zo(wi(e,{props:[Me(i,/:(read-\w+)/,":"+Fs+"$1")]})),Zo(wi(e,{props:[i]})),Pp(e,{props:Wy(n,r)});break;case"::placeholder":Zo(wi(e,{props:[Me(i,/:(plac\w+)/,":"+ut+"input-$1")]})),Zo(wi(e,{props:[Me(i,/:(plac\w+)/,":"+Fs+"$1")]})),Zo(wi(e,{props:[Me(i,/:(plac\w+)/,bt+"input-$1")]})),Zo(wi(e,{props:[i]})),Pp(e,{props:Wy(n,r)});break}return""})}}var Wq={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Do=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",jv=typeof window<"u"&&"HTMLElement"in window,Hq=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""?process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY:process.env.NODE_ENV!=="production"),Kq={},Yy=/invalid hook call/i,ul=new Set,G0=function(e,t){if(process.env.NODE_ENV!=="production"){var n=t?' with the id of "'.concat(t,'"'):"",r="The component ".concat(e).concat(n,` has been created dynamically.
|
|
134
134
|
`)+`You may see this warning because you've called styled inside another component.
|
|
135
|
-
To resolve this only create new StyledComponents outside of any render method and function component.`,i=console.error;try{var o=!0;console.error=function(a){for(var s=[],u=1;u<arguments.length;u++)s[u-1]=arguments[u];
|
|
135
|
+
To resolve this only create new StyledComponents outside of any render method and function component.`,i=console.error;try{var o=!0;console.error=function(a){for(var s=[],u=1;u<arguments.length;u++)s[u-1]=arguments[u];Yy.test(a)?(o=!1,ul.delete(r)):i.apply(void 0,Oo([a],s,!1))},O.useRef(),o&&!ul.has(r)&&(console.warn(r),ul.add(r))}catch(a){Yy.test(a.message)&&ul.delete(r)}finally{console.error=i}}},Af=Object.freeze([]),Ia=Object.freeze({});function z0(e,t,n){return n===void 0&&(n=Ia),e.theme!==n.theme&&e.theme||t||n.theme}var Mp=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Yq=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Jq=/(^-|-$)/g;function Jy(e){return e.replace(Yq,"-").replace(Jq,"")}var Xq=/(a)(d)/gi,Xy=function(e){return String.fromCharCode(e+(e>25?39:97))};function jp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Xy(t%52)+n;return(Xy(t%52)+n).replace(Xq,"$1-$2")}var Xf,co=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},W0=function(e){return co(5381,e)};function H0(e){return jp(W0(e)>>>0)}function K0(e){return process.env.NODE_ENV!=="production"&&typeof e=="string"&&e||e.displayName||e.name||"Component"}function Qf(e){return typeof e=="string"&&(process.env.NODE_ENV==="production"||e.charAt(0)===e.charAt(0).toLowerCase())}var Y0=typeof Symbol=="function"&&Symbol.for,J0=Y0?Symbol.for("react.memo"):60115,Qq=Y0?Symbol.for("react.forward_ref"):60112,Zq={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},eF={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},X0={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},tF=((Xf={})[Qq]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Xf[J0]=X0,Xf);function Qy(e){return("type"in(t=e)&&t.type.$$typeof)===J0?X0:"$$typeof"in e?tF[e.$$typeof]:Zq;var t}var nF=Object.defineProperty,rF=Object.getOwnPropertyNames,Zy=Object.getOwnPropertySymbols,iF=Object.getOwnPropertyDescriptor,oF=Object.getPrototypeOf,eg=Object.prototype;function Q0(e,t,n){if(typeof t!="string"){if(eg){var r=oF(t);r&&r!==eg&&Q0(e,r,n)}var i=rF(t);Zy&&(i=i.concat(Zy(t)));for(var o=Qy(e),a=Qy(t),s=0;s<i.length;++s){var u=i[s];if(!(u in eF||n&&n[u]||a&&u in a||o&&u in o)){var l=iF(t,u);try{nF(e,u,l)}catch{}}}}return e}function Aa(e){return typeof e=="function"}function _v(e){return typeof e=="object"&&"styledComponentId"in e}function fo(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function _p(e,t){if(e.length===0)return"";for(var n=e[0],r=1;r<e.length;r++)n+=t?t+e[r]:e[r];return n}function $a(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function qp(e,t,n){if(n===void 0&&(n=!1),!n&&!$a(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=qp(e[r],t[r]);else if($a(t))for(var r in t)e[r]=qp(e[r],t[r]);return e}function qv(e,t){Object.defineProperty(e,"toString",{value:t})}var aF=process.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
136
136
|
|
|
137
137
|
`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
|
|
138
138
|
|
|
@@ -173,10 +173,10 @@ as for instance in your render method then you may be running into this limitati
|
|
|
173
173
|
|
|
174
174
|
`,17:`CSSStyleSheet could not be found on HTMLStyleElement.
|
|
175
175
|
Has styled-components' style tag been unmounted or altered by another script?
|
|
176
|
-
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function
|
|
177
|
-
`);return n},e}(),
|
|
178
|
-
`),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var u=s.match(
|
|
179
|
-
`)},c=0;c<s;c++)l(c);return u}(i)})}return e.registerId=function(t){return
|
|
176
|
+
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function sF(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],i=1,o=e.length;i<o;i+=1)r.push(e[i]);return r.forEach(function(a){n=n.replace(/%[a-z]/,a)}),n}function os(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return process.env.NODE_ENV==="production"?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(sF.apply(void 0,Oo([aF[e]],t,!1)).trim())}var uF=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r<t;r++)n+=this.groupSizes[r];return n},e.prototype.insertRules=function(t,n){if(t>=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw os(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=i;a<o;a++)this.groupSizes[a]=0}for(var s=this.indexOfGroup(t+1),u=(a=0,n.length);a<u;a++)this.tag.insertRule(s,n[a])&&(this.groupSizes[t]++,s++)},e.prototype.clearGroup=function(t){if(t<this.length){var n=this.groupSizes[t],r=this.indexOfGroup(t),i=r+n;this.groupSizes[t]=0;for(var o=r;o<i;o++)this.tag.deleteRule(r)}},e.prototype.getGroup=function(t){var n="";if(t>=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,a=i;a<o;a++)n+="".concat(this.tag.getRule(a)).concat(`/*!sc*/
|
|
177
|
+
`);return n},e}(),Bl=new Map,vc=new Map,Ul=1,ll=function(e){if(Bl.has(e))return Bl.get(e);for(;vc.has(Ul);)Ul++;var t=Ul++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw os(16,"".concat(t));return Bl.set(e,t),vc.set(t,e),t},lF=function(e,t){Ul=t+1,Bl.set(e,t),vc.set(t,e)},cF="style[".concat(Do,"][").concat("data-styled-version",'="').concat("6.1.1",'"]'),fF=new RegExp("^".concat(Do,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),dF=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o<a;o++)(r=i[o])&&e.registerName(t,r)},pF=function(e,t){for(var n,r=((n=t.textContent)!==null&&n!==void 0?n:"").split(`/*!sc*/
|
|
178
|
+
`),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var u=s.match(fF);if(u){var l=0|parseInt(u[1],10),c=u[2];l!==0&&(lF(c,l),dF(e,c,u[3]),e.getTag().insertRules(l,i)),i.length=0}else i.push(s)}}};function hF(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var Z0=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(s){var u=Array.from(s.querySelectorAll("style[".concat(Do,"]")));return u[u.length-1]}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(Do,"active"),r.setAttribute("data-styled-version","6.1.1");var a=hF();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},vF=function(){function e(t){this.element=Z0(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(n){if(n.sheet)return n.sheet;for(var r=document.styleSheets,i=0,o=r.length;i<o;i++){var a=r[i];if(a.ownerNode===n)return a}throw os(17)}(this.element),this.length=0}return e.prototype.insertRule=function(t,n){try{return this.sheet.insertRule(n,t),this.length++,!0}catch{return!1}},e.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},e.prototype.getRule=function(t){var n=this.sheet.cssRules[t];return n&&n.cssText?n.cssText:""},e}(),mF=function(){function e(t){this.element=Z0(t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(t,n){if(t<=this.length&&t>=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},e}(),yF=function(){function e(t){this.rules=[],this.length=0}return e.prototype.insertRule=function(t,n){return t<=this.length&&(this.rules.splice(t,0,n),this.length++,!0)},e.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},e.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},e}(),tg=jv,gF={isServer:!jv,useCSSOMInjection:!Hq},mc=function(){function e(t,n,r){t===void 0&&(t=Ia),n===void 0&&(n={});var i=this;this.options=In(In({},gF),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&jv&&tg&&(tg=!1,function(o){for(var a=document.querySelectorAll(cF),s=0,u=a.length;s<u;s++){var l=a[s];l&&l.getAttribute(Do)!=="active"&&(pF(o,l),l.parentNode&&l.parentNode.removeChild(l))}}(this)),qv(this,function(){return function(o){for(var a=o.getTag(),s=a.length,u="",l=function(f){var d=function(C){return vc.get(C)}(f);if(d===void 0)return"continue";var h=o.names.get(d),p=a.getGroup(f);if(h===void 0||p.length===0)return"continue";var v="".concat(Do,".g").concat(f,'[id="').concat(d,'"]'),g="";h!==void 0&&h.forEach(function(C){C.length>0&&(g+="".concat(C,","))}),u+="".concat(p).concat(v,'{content:"').concat(g,'"}').concat(`/*!sc*/
|
|
179
|
+
`)},c=0;c<s;c++)l(c);return u}(i)})}return e.registerId=function(t){return ll(t)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(In(In({},this.options),t),this.gs,n&&this.names||void 0)},e.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(t=function(n){var r=n.useCSSOMInjection,i=n.target;return n.isServer?new yF(i):r?new vF(i):new mF(i)}(this.options),new uF(t)));var t},e.prototype.hasNameForId=function(t,n){return this.names.has(t)&&this.names.get(t).has(n)},e.prototype.registerName=function(t,n){if(ll(t),this.names.has(t))this.names.get(t).add(n);else{var r=new Set;r.add(n),this.names.set(t,r)}},e.prototype.insertRules=function(t,n,r){this.registerName(t,n),this.getTag().insertRules(ll(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(ll(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),bF=/&/g,SF=/^\s*\/\/.*$/gm;function ex(e,t){return e.map(function(n){return n.type==="rule"&&(n.value="".concat(t," ").concat(n.value),n.value=n.value.replaceAll(",",",".concat(t," ")),n.props=n.props.map(function(r){return"".concat(t," ").concat(r)})),Array.isArray(n.children)&&n.type!=="@keyframes"&&(n.children=ex(n.children,t)),n})}function CF(e){var t,n,r,i=e===void 0?Ia:e,o=i.options,a=o===void 0?Ia:o,s=i.plugins,u=s===void 0?Af:s,l=function(d,h,p){return p===n||p.startsWith(n)&&p.endsWith(n)&&p.replaceAll(n,"").length>0?".".concat(t):d},c=u.slice();c.push(function(d){d.type===xf&&d.value.includes("&")&&(d.props[0]=d.props[0].replace(bF,n).replace(r,l))}),a.prefix&&c.push(zq),c.push(Bq);var f=function(d,h,p,v){h===void 0&&(h=""),p===void 0&&(p=""),v===void 0&&(v="&"),t=v,n=h,r=new RegExp("\\".concat(n,"\\b"),"g");var g=d.replace(SF,""),C=Lq(p||h?"".concat(p," ").concat(h," { ").concat(g," }"):g);a.namespace&&(C=ex(C,a.namespace));var m=[];return hc(C,Uq(c.concat(Gq(function(b){return m.push(b)})))),m};return f.hash=u.length?u.reduce(function(d,h){return h.name||os(15),co(d,h.name)},5381).toString():"",f}var wF=new mc,Fp=CF(),tx=O.createContext({shouldForwardProp:void 0,styleSheet:wF,stylis:Fp});tx.Consumer;O.createContext(void 0);function Lp(){return O.useContext(tx)}var ng=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Fp);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,qv(this,function(){throw os(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Fp),this.name+t.hash},e}(),xF=function(e){return e>="A"&&e<="Z"};function rg(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;xF(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var nx=function(e){return e==null||e===!1||e===""},rx=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!nx(o)&&(Array.isArray(o)&&o.isCss||Aa(o)?r.push("".concat(rg(i),":"),o,";"):$a(o)?r.push.apply(r,Oo(Oo(["".concat(i," {")],rx(o),!1),["}"],!1)):r.push("".concat(rg(i),": ").concat((t=i,(n=o)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in Wq||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function ki(e,t,n,r){if(nx(e))return[];if(_v(e))return[".".concat(e.styledComponentId)];if(Aa(e)){if(!Aa(o=e)||o.prototype&&o.prototype.isReactComponent||!t)return[e];var i=e(t);return process.env.NODE_ENV==="production"||typeof i!="object"||Array.isArray(i)||i instanceof ng||$a(i)||i===null||console.error("".concat(K0(e)," is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")),ki(i,t,n,r)}var o;return e instanceof ng?n?(e.inject(n,r),[e.getName(r)]):[e]:$a(e)?rx(e):Array.isArray(e)?Array.prototype.concat.apply(Af,e.map(function(a){return ki(a,t,n,r)})):[e.toString()]}function ix(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(Aa(n)&&!_v(n))return!1}return!0}var TF=W0("6.1.1"),EF=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&ix(t),this.componentId=n,this.baseHash=co(TF,n),this.baseStyle=r,mc.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var i=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,n,r):"";if(this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(this.componentId,this.staticRulesId))i=fo(i,this.staticRulesId);else{var o=_p(ki(this.rules,t,n,r)),a=jp(co(this.baseHash,o)>>>0);if(!n.hasNameForId(this.componentId,a)){var s=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,s)}i=fo(i,a),this.staticRulesId=a}else{for(var u=co(this.baseHash,r.hash),l="",c=0;c<this.rules.length;c++){var f=this.rules[c];if(typeof f=="string")l+=f,process.env.NODE_ENV!=="production"&&(u=co(u,f));else if(f){var d=_p(ki(f,t,n,r));u=co(u,d+c),l+=d}}if(l){var h=jp(u>>>0);n.hasNameForId(this.componentId,h)||n.insertRules(this.componentId,h,r(l,".".concat(h),void 0,this.componentId)),i=fo(i,h)}}return i},e}(),Fv=O.createContext(void 0);Fv.Consumer;var Zf={},ig=new Set;function IF(e,t,n){var r=_v(e),i=e,o=!Qf(e),a=t.attrs,s=a===void 0?Af:a,u=t.componentId,l=u===void 0?function(x,T){var E=typeof x!="string"?"sc":Jy(x);Zf[E]=(Zf[E]||0)+1;var A="".concat(E,"-").concat(H0("6.1.1"+E+Zf[E]));return T?"".concat(T,"-").concat(A):A}(t.displayName,t.parentComponentId):u,c=t.displayName,f=c===void 0?function(x){return Qf(x)?"styled.".concat(x):"Styled(".concat(K0(x),")")}(e):c,d=t.displayName&&t.componentId?"".concat(Jy(t.displayName),"-").concat(t.componentId):t.componentId||l,h=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,p=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;p=function(x,T){return v(x,T)&&g(x,T)}}else p=v}var C=new EF(n,d,r?i.componentStyle:void 0);function m(x,T){return function(E,A,N){var I=E.attrs,P=E.componentStyle,_=E.defaultProps,L=E.foldedComponentIds,U=E.styledComponentId,Y=E.target,k=O.useContext(Fv),ie=Lp(),B=E.shouldForwardProp||ie.shouldForwardProp;process.env.NODE_ENV!=="production"&&O.useDebugValue(U);var G=function(X,ae,de){for(var he,Te=In(In({},ae),{className:void 0,theme:de}),ke=0;ke<X.length;ke+=1){var Ne=Aa(he=X[ke])?he(Te):he;for(var mt in Ne)Te[mt]=mt==="className"?fo(Te[mt],Ne[mt]):mt==="style"?In(In({},Te[mt]),Ne[mt]):Ne[mt]}return ae.className&&(Te.className=fo(Te.className,ae.className)),Te}(I,A,z0(A,k,_)||Ia),fe=G.as||Y,j={};for(var R in G)G[R]===void 0||R[0]==="$"||R==="as"||R==="theme"||(R==="forwardedAs"?j.as=G.forwardedAs:B&&!B(R,fe)||(j[R]=G[R],B||process.env.NODE_ENV!=="development"||Iq(R)||ig.has(R)||!Mp.has(fe)||(ig.add(R),console.warn('styled-components: it looks like an unknown prop "'.concat(R,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var te=function(X,ae){var de=Lp(),he=X.generateAndInjectStyles(ae,de.styleSheet,de.stylis);return process.env.NODE_ENV!=="production"&&O.useDebugValue(he),he}(P,G);process.env.NODE_ENV!=="production"&&E.warnTooManyClasses&&E.warnTooManyClasses(te);var oe=fo(L,U);return te&&(oe+=" "+te),G.className&&(oe+=" "+G.className),j[Qf(fe)&&!Mp.has(fe)?"class":"className"]=oe,j.ref=N,O.createElement(fe,j)}(b,x,T)}m.displayName=f;var b=O.forwardRef(m);return b.attrs=h,b.componentStyle=C,b.displayName=f,b.shouldForwardProp=p,b.foldedComponentIds=r?fo(i.foldedComponentIds,i.styledComponentId):"",b.styledComponentId=d,b.target=r?i.target:e,Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(x){this._foldedDefaultProps=r?function(T){for(var E=[],A=1;A<arguments.length;A++)E[A-1]=arguments[A];for(var N=0,I=E;N<I.length;N++)qp(T,I[N],!0);return T}({},i.defaultProps,x):x}}),process.env.NODE_ENV!=="production"&&(G0(f,d),b.warnTooManyClasses=function(x,T){var E={},A=!1;return function(N){if(!A&&(E[N]=!0,Object.keys(E).length>=200)){var I=T?' with the id of "'.concat(T,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(x).concat(I,`.
|
|
180
180
|
`)+`Consider using the attrs method, together with a style object for frequently changed styles.
|
|
181
181
|
Example:
|
|
182
182
|
const Component = styled.div.attrs(props => ({
|
|
@@ -185,13 +185,13 @@ Example:
|
|
|
185
185
|
},
|
|
186
186
|
}))\`width: 100%;\`
|
|
187
187
|
|
|
188
|
-
<Component />`),A=!0,E={}}}}(f,d)),
|
|
188
|
+
<Component />`),A=!0,E={}}}}(f,d)),qv(b,function(){return".".concat(b.styledComponentId)}),o&&Q0(b,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),b}function og(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n}var ag=function(e){return Object.assign(e,{isCss:!0})};function Lv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(Aa(e)||$a(e)){var r=e;return ag(ki(og(Af,Oo([r],t,!0))))}var i=e;return t.length===0&&i.length===1&&typeof i[0]=="string"?ki(i):ag(ki(og(i,t)))}function Vp(e,t,n){if(n===void 0&&(n=Ia),!t)throw os(1,t);var r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,Lv.apply(void 0,Oo([i],o,!1)))};return r.attrs=function(i){return Vp(e,t,In(In({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return Vp(e,t,In(In({},n),i))},r}var ox=function(e){return Vp(IF,e)},Ae=ox;Mp.forEach(function(e){Ae[e]=ox(e)});var AF=function(){function e(t,n){this.rules=t,this.componentId=n,this.isStatic=ix(t),mc.registerId(this.componentId+1)}return e.prototype.createStyles=function(t,n,r,i){var o=i(_p(ki(this.rules,n,r,i)),""),a=this.componentId+t;r.insertRules(a,a,o)},e.prototype.removeStyles=function(t,n){n.clearRules(this.componentId+t)},e.prototype.renderStyles=function(t,n,r,i){t>2&&mc.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function ju(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Lv.apply(void 0,Oo([e],t,!1)),i="sc-global-".concat(H0(JSON.stringify(r))),o=new AF(r,i);process.env.NODE_ENV!=="production"&&G0(i);var a=function(u){var l=Lp(),c=O.useContext(Fv),f=O.useRef(l.styleSheet.allocateGSInstance(i)).current;return process.env.NODE_ENV!=="production"&&O.Children.count(u.children)&&console.warn("The global style component ".concat(i," was given child JSX. createGlobalStyle does not render children.")),process.env.NODE_ENV!=="production"&&r.some(function(d){return typeof d=="string"&&d.indexOf("@import")!==-1})&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),l.styleSheet.server&&s(f,u,l.styleSheet,c,l.stylis),O.useLayoutEffect(function(){if(!l.styleSheet.server)return s(f,u,l.styleSheet,c,l.stylis),function(){return o.removeStyles(f,l.styleSheet)}},[f,u,l.styleSheet,c,l.stylis]),null};function s(u,l,c,f,d){if(o.isStatic)o.renderStyles(u,Kq,c,d);else{var h=In(In({},l),{theme:z0(l,f,a.defaultProps)});o.renderStyles(u,h,c,d)}}return O.memo(a)}process.env.NODE_ENV!=="production"&&typeof navigator<"u"&&navigator.product==="ReactNative"&&console.warn(`It looks like you've imported 'styled-components' on React Native.
|
|
189
189
|
Perhaps you're looking to import 'styled-components/native'?
|
|
190
|
-
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var
|
|
190
|
+
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var cl="__sc-".concat(Do,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[cl]||(window[cl]=0),window[cl]===1&&console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
|
|
191
191
|
|
|
192
|
-
See https://s-c.sh/2BAXzed for more info.`),window[
|
|
193
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
194
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var
|
|
192
|
+
See https://s-c.sh/2BAXzed for more info.`),window[cl]+=1);var $F={prefix:"fas",iconName:"minus",icon:[448,512,[8211,8722,10134,"subtract"],"f068","M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"]},OF={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"]},ax={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]};function sg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sg(Object(n),!0).forEach(function(r){en(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function DF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ug(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function NF(e,t,n){return t&&ug(e.prototype,t),n&&ug(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vv(e,t){return RF(e)||MF(e,t)||sx(e,t)||_F()}function _u(e){return PF(e)||kF(e)||sx(e)||jF()}function PF(e){if(Array.isArray(e))return Bp(e)}function RF(e){if(Array.isArray(e))return e}function kF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(e);!(i=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function sx(e,t){if(e){if(typeof e=="string")return Bp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bp(e,t)}}function Bp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
193
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _F(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
194
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var lg=function(){},Bv={},ux={},lx=null,cx={mark:lg,measure:lg};try{typeof window<"u"&&(Bv=window),typeof document<"u"&&(ux=document),typeof MutationObserver<"u"&&(lx=MutationObserver),typeof performance<"u"&&(cx=performance)}catch{}var qF=Bv.navigator||{},cg=qF.userAgent,fg=cg===void 0?"":cg,Bi=Bv,wt=ux,dg=lx,fl=cx;Bi.document;var fi=!!wt.documentElement&&!!wt.head&&typeof wt.addEventListener=="function"&&typeof wt.createElement=="function",fx=~fg.indexOf("MSIE")||~fg.indexOf("Trident/"),dl,pl,hl,vl,ml,oi="___FONT_AWESOME___",Up=16,dx="fa",px="svg-inline--fa",No="data-fa-i2svg",Gp="data-fa-pseudo-element",FF="data-fa-pseudo-element-pending",Uv="data-prefix",Gv="data-icon",pg="fontawesome-i2svg",LF="async",VF=["HTML","HEAD","STYLE","SCRIPT"],hx=function(){try{return process.env.NODE_ENV==="production"}catch{return!1}}(),St="classic",jt="sharp",zv=[St,jt];function qu(e){return new Proxy(e,{get:function(n,r){return r in n?n[r]:n[St]}})}var lu=qu((dl={},en(dl,St,{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands",fak:"kit",fakd:"kit","fa-kit":"kit","fa-kit-duotone":"kit"}),en(dl,jt,{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"}),dl)),cu=qu((pl={},en(pl,St,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),en(pl,jt,{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"}),pl)),fu=qu((hl={},en(hl,St,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),en(hl,jt,{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"}),hl)),BF=qu((vl={},en(vl,St,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),en(vl,jt,{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"}),vl)),UF=/fa(s|r|l|t|d|b|k|ss|sr|sl|st)?[\-\ ]/,vx="fa-layers-text",GF=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i,zF=qu((ml={},en(ml,St,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),en(ml,jt,{900:"fass",400:"fasr",300:"fasl",100:"fast"}),ml)),mx=[1,2,3,4,5,6,7,8,9,10],WF=mx.concat([11,12,13,14,15,16,17,18,19,20]),HF=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],po={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},du=new Set;Object.keys(cu[St]).map(du.add.bind(du));Object.keys(cu[jt]).map(du.add.bind(du));var KF=[].concat(zv,_u(du),["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",po.GROUP,po.SWAP_OPACITY,po.PRIMARY,po.SECONDARY]).concat(mx.map(function(e){return"".concat(e,"x")})).concat(WF.map(function(e){return"w-".concat(e)})),Ls=Bi.FontAwesomeConfig||{};function YF(e){var t=wt.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function JF(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}if(wt&&typeof wt.querySelector=="function"){var XF=[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]];XF.forEach(function(e){var t=Vv(e,2),n=t[0],r=t[1],i=JF(YF(n));i!=null&&(Ls[r]=i)})}var yx={styleDefault:"solid",familyDefault:"classic",cssPrefix:dx,replacementClass:px,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Ls.familyPrefix&&(Ls.cssPrefix=Ls.familyPrefix);var Oa=pe(pe({},yx),Ls);Oa.autoReplaceSvg||(Oa.observeMutations=!1);var ve={};Object.keys(yx).forEach(function(e){Object.defineProperty(ve,e,{enumerable:!0,set:function(n){Oa[e]=n,Vs.forEach(function(r){return r(ve)})},get:function(){return Oa[e]}})});Object.defineProperty(ve,"familyPrefix",{enumerable:!0,set:function(t){Oa.cssPrefix=t,Vs.forEach(function(n){return n(ve)})},get:function(){return Oa.cssPrefix}});Bi.FontAwesomeConfig=ve;var Vs=[];function QF(e){return Vs.push(e),function(){Vs.splice(Vs.indexOf(e),1)}}var yi=Up,Pr={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function ZF(e){if(!(!e||!fi)){var t=wt.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=wt.head.childNodes,r=null,i=n.length-1;i>-1;i--){var o=n[i],a=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(r=o)}return wt.head.insertBefore(t,r),e}}var eL="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function pu(){for(var e=12,t="";e-- >0;)t+=eL[Math.random()*62|0];return t}function as(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function Wv(e){return e.classList?as(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function gx(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function tL(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(gx(e[n]),'" ')},"").trim()}function $f(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function Hv(e){return e.size!==Pr.size||e.x!==Pr.x||e.y!==Pr.y||e.rotate!==Pr.rotate||e.flipX||e.flipY}function nL(e){var t=e.transform,n=e.containerWidth,r=e.iconWidth,i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(t.x*32,", ").concat(t.y*32,") "),a="scale(".concat(t.size/16*(t.flipX?-1:1),", ").concat(t.size/16*(t.flipY?-1:1),") "),s="rotate(".concat(t.rotate," 0 0)"),u={transform:"".concat(o," ").concat(a," ").concat(s)},l={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:u,path:l}}function rL(e){var t=e.transform,n=e.width,r=n===void 0?Up:n,i=e.height,o=i===void 0?Up:i,a=e.startCentered,s=a===void 0?!1:a,u="";return s&&fx?u+="translate(".concat(t.x/yi-r/2,"em, ").concat(t.y/yi-o/2,"em) "):s?u+="translate(calc(-50% + ".concat(t.x/yi,"em), calc(-50% + ").concat(t.y/yi,"em)) "):u+="translate(".concat(t.x/yi,"em, ").concat(t.y/yi,"em) "),u+="scale(".concat(t.size/yi*(t.flipX?-1:1),", ").concat(t.size/yi*(t.flipY?-1:1),") "),u+="rotate(".concat(t.rotate,"deg) "),u}var iL=`:root, :host {
|
|
195
195
|
--fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid";
|
|
196
196
|
--fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular";
|
|
197
197
|
--fa-font-light: normal 300 1em/1 "Font Awesome 6 Light";
|
|
@@ -948,41 +948,41 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
|
948
948
|
.fad.fa-inverse,
|
|
949
949
|
.fa-duotone.fa-inverse {
|
|
950
950
|
color: var(--fa-inverse, #fff);
|
|
951
|
-
}`;function gx(){var e=fx,t=dx,n=ve.cssPrefix,r=ve.replacementClass,i=rL;if(n!==e||r!==t){var o=new RegExp("\\.".concat(e,"\\-"),"g"),a=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");i=i.replace(o,".".concat(n,"-")).replace(a,"--".concat(n,"-")).replace(s,".".concat(r))}return i}var pg=!1;function Qf(){ve.autoAddCss&&!pg&&(QF(gx()),pg=!0)}var iL={mixout:function(){return{dom:{css:gx,insertCss:Qf}}},hooks:function(){return{beforeDOMElementCreation:function(){Qf()},beforeI2svg:function(){Qf()}}}},ri=Vi||{};ri[ni]||(ri[ni]={});ri[ni].styles||(ri[ni].styles={});ri[ni].hooks||(ri[ni].hooks={});ri[ni].shims||(ri[ni].shims=[]);var Cr=ri[ni],bx=[],oL=function e(){wt.removeEventListener("DOMContentLoaded",e),yc=1,bx.map(function(t){return t()})},yc=!1;ui&&(yc=(wt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(wt.readyState),yc||wt.addEventListener("DOMContentLoaded",oL));function aL(e){ui&&(yc?setTimeout(e,0):bx.push(e))}function qu(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,i=e.children,o=i===void 0?[]:i;return typeof e=="string"?yx(e):"<".concat(t," ").concat(eL(r),">").concat(o.map(qu).join(""),"</").concat(t,">")}function hg(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var sL=function(t,n){return function(r,i,o,a){return t.call(n,r,i,o,a)}},Zf=function(t,n,r,i){var o=Object.keys(t),a=o.length,s=i!==void 0?sL(n,i):n,u,l,c;for(r===void 0?(u=1,c=t[o[0]]):(u=0,c=r);u<a;u++)l=o[u],c=s(c,t[l],l,t);return c};function uL(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}function Up(e){var t=uL(e);return t.length===1?t[0].toString(16):null}function lL(e,t){var n=e.length,r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function vg(e){return Object.keys(e).reduce(function(t,n){var r=e[n],i=!!r.icon;return i?t[r.iconName]=r.icon:t[n]=r,t},{})}function Gp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=vg(t);typeof Cr.hooks.addPack=="function"&&!i?Cr.hooks.addPack(e,vg(t)):Cr.styles[e]=pe(pe({},Cr.styles[e]||{}),o),e==="fas"&&Gp("fa",t)}var ml,yl,gl,pa=Cr.styles,cL=Cr.shims,fL=(ml={},en(ml,St,Object.values(cu[St])),en(ml,jt,Object.values(cu[jt])),ml),Wv=null,Sx={},Cx={},wx={},xx={},Tx={},dL=(yl={},en(yl,St,Object.keys(uu[St])),en(yl,jt,Object.keys(uu[jt])),yl);function pL(e){return~HF.indexOf(e)}function hL(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!pL(i)?i:null}var Ex=function(){var t=function(o){return Zf(pa,function(a,s,u){return a[u]=Zf(s,o,{}),a},{})};Sx=t(function(i,o,a){if(o[3]&&(i[o[3]]=a),o[2]){var s=o[2].filter(function(u){return typeof u=="number"});s.forEach(function(u){i[u.toString(16)]=a})}return i}),Cx=t(function(i,o,a){if(i[a]=a,o[2]){var s=o[2].filter(function(u){return typeof u=="string"});s.forEach(function(u){i[u]=a})}return i}),Tx=t(function(i,o,a){var s=o[2];return i[a]=a,s.forEach(function(u){i[u]=a}),i});var n="far"in pa||ve.autoFetchSvg,r=Zf(cL,function(i,o){var a=o[0],s=o[1],u=o[2];return s==="far"&&!n&&(s="fas"),typeof a=="string"&&(i.names[a]={prefix:s,iconName:u}),typeof a=="number"&&(i.unicodes[a.toString(16)]={prefix:s,iconName:u}),i},{names:{},unicodes:{}});wx=r.names,xx=r.unicodes,Wv=$f(ve.styleDefault,{family:ve.familyDefault})};XF(function(e){Wv=$f(e.styleDefault,{family:ve.familyDefault})});Ex();function Hv(e,t){return(Sx[e]||{})[t]}function vL(e,t){return(Cx[e]||{})[t]}function ho(e,t){return(Tx[e]||{})[t]}function Ix(e){return wx[e]||{prefix:null,iconName:null}}function mL(e){var t=xx[e],n=Hv("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Bi(){return Wv}var Kv=function(){return{prefix:null,iconName:null,rest:[]}};function $f(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?St:n,i=uu[r][e],o=lu[r][e]||lu[r][i],a=e in Cr.styles?e:null;return o||a||null}var mg=(gl={},en(gl,St,Object.keys(cu[St])),en(gl,jt,Object.keys(cu[jt])),gl);function Of(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(t={},en(t,St,"".concat(ve.cssPrefix,"-").concat(St)),en(t,jt,"".concat(ve.cssPrefix,"-").concat(jt)),t),a=null,s=St;(e.includes(o[St])||e.some(function(l){return mg[St].includes(l)}))&&(s=St),(e.includes(o[jt])||e.some(function(l){return mg[jt].includes(l)}))&&(s=jt);var u=e.reduce(function(l,c){var f=hL(ve.cssPrefix,c);if(pa[c]?(c=fL[s].includes(c)?VF[s][c]:c,a=c,l.prefix=c):dL[s].indexOf(c)>-1?(a=c,l.prefix=$f(c,{family:s})):f?l.iconName=f:c!==ve.replacementClass&&c!==o[St]&&c!==o[jt]&&l.rest.push(c),!i&&l.prefix&&l.iconName){var d=a==="fa"?Ix(l.iconName):{},h=ho(l.prefix,l.iconName);d.prefix&&(a=null),l.iconName=d.iconName||h||l.iconName,l.prefix=d.prefix||l.prefix,l.prefix==="far"&&!pa.far&&pa.fas&&!ve.autoFetchSvg&&(l.prefix="fas")}return l},Kv());return(e.includes("fa-brands")||e.includes("fab"))&&(u.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(u.prefix="fad"),!u.prefix&&s===jt&&(pa.fass||ve.autoFetchSvg)&&(u.prefix="fass",u.iconName=ho(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||a==="fa")&&(u.prefix=Bi()||"fas"),u}var yL=function(){function e(){OF(this,e),this.definitions={}}return DF(e,[{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i.reduce(this._pullDefinitions,{});Object.keys(a).forEach(function(s){n.definitions[s]=pe(pe({},n.definitions[s]||{}),a[s]),Gp(s,a[s]);var u=cu[St][s];u&&Gp(u,a[s]),Ex()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,r){var i=r.prefix&&r.iconName&&r.icon?{0:r}:r;return Object.keys(i).map(function(o){var a=i[o],s=a.prefix,u=a.iconName,l=a.icon,c=l[2];n[s]||(n[s]={}),c.length>0&&c.forEach(function(f){typeof f=="string"&&(n[s][f]=l)}),n[s][u]=l}),n}}]),e}(),yg=[],ha={},Ca={},gL=Object.keys(Ca);function bL(e,t){var n=t.mixoutsTo;return yg=e,ha={},Object.keys(Ca).forEach(function(r){gL.indexOf(r)===-1&&delete Ca[r]}),yg.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(a){typeof i[a]=="function"&&(n[a]=i[a]),mc(i[a])==="object"&&Object.keys(i[a]).forEach(function(s){n[a]||(n[a]={}),n[a][s]=i[a][s]})}),r.hooks){var o=r.hooks();Object.keys(o).forEach(function(a){ha[a]||(ha[a]=[]),ha[a].push(o[a])})}r.provides&&r.provides(Ca)}),n}function zp(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=ha[e]||[];return o.forEach(function(a){t=a.apply(null,[t].concat(r))}),t}function Po(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=ha[e]||[];i.forEach(function(o){o.apply(null,n)})}function ii(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Ca[e]?Ca[e].apply(null,t):void 0}function Wp(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Bi();if(t)return t=ho(n,t)||t,hg(Ax.definitions,n,t)||hg(Cr.styles,n,t)}var Ax=new yL,SL=function(){ve.autoReplaceSvg=!1,ve.observeMutations=!1,Po("noAuto")},CL={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ui?(Po("beforeI2svg",t),ii("pseudoElements2svg",t),ii("i2svg",t)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot;ve.autoReplaceSvg===!1&&(ve.autoReplaceSvg=!0),ve.observeMutations=!0,aL(function(){xL({autoReplaceSvgRoot:n}),Po("watch",t)})}},wL={icon:function(t){if(t===null)return null;if(mc(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:ho(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){var n=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],r=$f(t[0]);return{prefix:r,iconName:ho(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(ve.cssPrefix,"-"))>-1||t.match(BF))){var i=Of(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||Bi(),iconName:ho(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var o=Bi();return{prefix:o,iconName:ho(o,t)||t}}}},nr={noAuto:SL,config:ve,dom:CL,parse:wL,library:Ax,findIconDefinition:Wp,toHtml:qu},xL=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?wt:n;(Object.keys(Cr.styles).length>0||ve.autoFetchSvg)&&ui&&ve.autoReplaceSvg&&nr.dom.i2svg({node:r})};function Df(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return qu(r)})}}),Object.defineProperty(e,"node",{get:function(){if(ui){var r=wt.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function TL(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,a=e.transform;if(zv(a)&&n.found&&!r.found){var s=n.width,u=n.height,l={x:s/u/2,y:.5};i.style=Af(pe(pe({},o),{},{"transform-origin":"".concat(l.x+a.x/16,"em ").concat(l.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function EL(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,o=e.symbol,a=o===!0?"".concat(t,"-").concat(ve.cssPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:pe(pe({},i),{},{id:a}),children:r}]}]}function Yv(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,o=e.iconName,a=e.transform,s=e.symbol,u=e.title,l=e.maskId,c=e.titleId,f=e.extra,d=e.watchable,h=d===void 0?!1:d,p=r.found?r:n,v=p.width,g=p.height,C=i==="fak",m=[ve.replacementClass,o?"".concat(ve.cssPrefix,"-").concat(o):""].filter(function(I){return f.classes.indexOf(I)===-1}).filter(function(I){return I!==""||!!I}).concat(f.classes).join(" "),b={children:[],attributes:pe(pe({},f.attributes),{},{"data-prefix":i,"data-icon":o,class:m,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(g)})},x=C&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/g*16*.0625,"em")}:{};h&&(b.attributes[No]=""),u&&(b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(c||du())},children:[u]}),delete b.attributes.title);var T=pe(pe({},b),{},{prefix:i,iconName:o,main:n,mask:r,maskId:l,transform:a,symbol:s,styles:pe(pe({},x),f.styles)}),E=r.found&&n.found?ii("generateAbstractMask",T)||{children:[],attributes:{}}:ii("generateAbstractIcon",T)||{children:[],attributes:{}},A=E.children,N=E.attributes;return T.children=A,T.attributes=N,s?EL(T):TL(T)}function gg(e){var t=e.content,n=e.width,r=e.height,i=e.transform,o=e.title,a=e.extra,s=e.watchable,u=s===void 0?!1:s,l=pe(pe(pe({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});u&&(l[No]="");var c=pe({},a.styles);zv(i)&&(c.transform=nL({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);var f=Af(c);f.length>0&&(l.style=f);var d=[];return d.push({tag:"span",attributes:l,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function IL(e){var t=e.content,n=e.title,r=e.extra,i=pe(pe(pe({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),o=Af(r.styles);o.length>0&&(i.style=o);var a=[];return a.push({tag:"span",attributes:i,children:[t]}),n&&a.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),a}var ed=Cr.styles;function Hp(e){var t=e[0],n=e[1],r=e.slice(4),i=Fv(r,1),o=i[0],a=null;return Array.isArray(o)?a={tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.PRIMARY),fill:"currentColor",d:o[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:t,height:n,icon:a}}var AL={found:!1,width:512,height:512};function $L(e,t){!px&&!ve.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Kp(e,t){var n=t;return t==="fa"&&ve.styleDefault!==null&&(t=Bi()),new Promise(function(r,i){if(ii("missingIconAbstract"),n==="fa"){var o=Ix(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&ed[t]&&ed[t][e]){var a=ed[t][e];return r(Hp(a))}$L(e,t),r(pe(pe({},AL),{},{icon:ve.showMissingIcons&&e?ii("missingIconAbstract")||{}:{}}))})}var bg=function(){},Yp=ve.measurePerformance&&cl&&cl.mark&&cl.measure?cl:{mark:bg,measure:bg},Ns='FA "6.5.1"',OL=function(t){return Yp.mark("".concat(Ns," ").concat(t," begins")),function(){return $x(t)}},$x=function(t){Yp.mark("".concat(Ns," ").concat(t," ends")),Yp.measure("".concat(Ns," ").concat(t),"".concat(Ns," ").concat(t," begins"),"".concat(Ns," ").concat(t," ends"))},Jv={begin:OL,end:$x},Ul=function(){};function Sg(e){var t=e.getAttribute?e.getAttribute(No):null;return typeof t=="string"}function DL(e){var t=e.getAttribute?e.getAttribute(Vv):null,n=e.getAttribute?e.getAttribute(Bv):null;return t&&n}function NL(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)}function PL(){if(ve.autoReplaceSvg===!0)return Gl.replace;var e=Gl[ve.autoReplaceSvg];return e||Gl.replace}function RL(e){return wt.createElementNS("http://www.w3.org/2000/svg",e)}function kL(e){return wt.createElement(e)}function Ox(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?RL:kL:n;if(typeof e=="string")return wt.createTextNode(e);var i=r(e.tag);Object.keys(e.attributes||[]).forEach(function(a){i.setAttribute(a,e.attributes[a])});var o=e.children||[];return o.forEach(function(a){i.appendChild(Ox(a,{ceFn:r}))}),i}function ML(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var Gl={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(Ox(i),n)}),n.getAttribute(No)===null&&ve.keepOriginalSource){var r=wt.createComment(ML(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~Gv(n).indexOf(ve.replacementClass))return Gl.replace(t);var i=new RegExp("".concat(ve.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var o=r[0].attributes.class.split(" ").reduce(function(s,u){return u===ve.replacementClass||u.match(i)?s.toSvg.push(u):s.toNode.push(u),s},{toNode:[],toSvg:[]});r[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",o.toNode.join(" "))}var a=r.map(function(s){return qu(s)}).join(`
|
|
952
|
-
`);n.setAttribute(No,""),n.innerHTML=a}};function
|
|
953
|
-
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function
|
|
951
|
+
}`;function bx(){var e=dx,t=px,n=ve.cssPrefix,r=ve.replacementClass,i=iL;if(n!==e||r!==t){var o=new RegExp("\\.".concat(e,"\\-"),"g"),a=new RegExp("\\--".concat(e,"\\-"),"g"),s=new RegExp("\\.".concat(t),"g");i=i.replace(o,".".concat(n,"-")).replace(a,"--".concat(n,"-")).replace(s,".".concat(r))}return i}var hg=!1;function ed(){ve.autoAddCss&&!hg&&(ZF(bx()),hg=!0)}var oL={mixout:function(){return{dom:{css:bx,insertCss:ed}}},hooks:function(){return{beforeDOMElementCreation:function(){ed()},beforeI2svg:function(){ed()}}}},ai=Bi||{};ai[oi]||(ai[oi]={});ai[oi].styles||(ai[oi].styles={});ai[oi].hooks||(ai[oi].hooks={});ai[oi].shims||(ai[oi].shims=[]);var xr=ai[oi],Sx=[],aL=function e(){wt.removeEventListener("DOMContentLoaded",e),gc=1,Sx.map(function(t){return t()})},gc=!1;fi&&(gc=(wt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(wt.readyState),gc||wt.addEventListener("DOMContentLoaded",aL));function sL(e){fi&&(gc?setTimeout(e,0):Sx.push(e))}function Fu(e){var t=e.tag,n=e.attributes,r=n===void 0?{}:n,i=e.children,o=i===void 0?[]:i;return typeof e=="string"?gx(e):"<".concat(t," ").concat(tL(r),">").concat(o.map(Fu).join(""),"</").concat(t,">")}function vg(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var uL=function(t,n){return function(r,i,o,a){return t.call(n,r,i,o,a)}},td=function(t,n,r,i){var o=Object.keys(t),a=o.length,s=i!==void 0?uL(n,i):n,u,l,c;for(r===void 0?(u=1,c=t[o[0]]):(u=0,c=r);u<a;u++)l=o[u],c=s(c,t[l],l,t);return c};function lL(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);(o&64512)==56320?t.push(((i&1023)<<10)+(o&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}function zp(e){var t=lL(e);return t.length===1?t[0].toString(16):null}function cL(e,t){var n=e.length,r=e.charCodeAt(t),i;return r>=55296&&r<=56319&&n>t+1&&(i=e.charCodeAt(t+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function mg(e){return Object.keys(e).reduce(function(t,n){var r=e[n],i=!!r.icon;return i?t[r.iconName]=r.icon:t[n]=r,t},{})}function Wp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=mg(t);typeof xr.hooks.addPack=="function"&&!i?xr.hooks.addPack(e,mg(t)):xr.styles[e]=pe(pe({},xr.styles[e]||{}),o),e==="fas"&&Wp("fa",t)}var yl,gl,bl,pa=xr.styles,fL=xr.shims,dL=(yl={},en(yl,St,Object.values(fu[St])),en(yl,jt,Object.values(fu[jt])),yl),Kv=null,Cx={},wx={},xx={},Tx={},Ex={},pL=(gl={},en(gl,St,Object.keys(lu[St])),en(gl,jt,Object.keys(lu[jt])),gl);function hL(e){return~KF.indexOf(e)}function vL(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!hL(i)?i:null}var Ix=function(){var t=function(o){return td(pa,function(a,s,u){return a[u]=td(s,o,{}),a},{})};Cx=t(function(i,o,a){if(o[3]&&(i[o[3]]=a),o[2]){var s=o[2].filter(function(u){return typeof u=="number"});s.forEach(function(u){i[u.toString(16)]=a})}return i}),wx=t(function(i,o,a){if(i[a]=a,o[2]){var s=o[2].filter(function(u){return typeof u=="string"});s.forEach(function(u){i[u]=a})}return i}),Ex=t(function(i,o,a){var s=o[2];return i[a]=a,s.forEach(function(u){i[u]=a}),i});var n="far"in pa||ve.autoFetchSvg,r=td(fL,function(i,o){var a=o[0],s=o[1],u=o[2];return s==="far"&&!n&&(s="fas"),typeof a=="string"&&(i.names[a]={prefix:s,iconName:u}),typeof a=="number"&&(i.unicodes[a.toString(16)]={prefix:s,iconName:u}),i},{names:{},unicodes:{}});xx=r.names,Tx=r.unicodes,Kv=Of(ve.styleDefault,{family:ve.familyDefault})};QF(function(e){Kv=Of(e.styleDefault,{family:ve.familyDefault})});Ix();function Yv(e,t){return(Cx[e]||{})[t]}function mL(e,t){return(wx[e]||{})[t]}function ho(e,t){return(Ex[e]||{})[t]}function Ax(e){return xx[e]||{prefix:null,iconName:null}}function yL(e){var t=Tx[e],n=Yv("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Ui(){return Kv}var Jv=function(){return{prefix:null,iconName:null,rest:[]}};function Of(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?St:n,i=lu[r][e],o=cu[r][e]||cu[r][i],a=e in xr.styles?e:null;return o||a||null}var yg=(bl={},en(bl,St,Object.keys(fu[St])),en(bl,jt,Object.keys(fu[jt])),bl);function Df(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(t={},en(t,St,"".concat(ve.cssPrefix,"-").concat(St)),en(t,jt,"".concat(ve.cssPrefix,"-").concat(jt)),t),a=null,s=St;(e.includes(o[St])||e.some(function(l){return yg[St].includes(l)}))&&(s=St),(e.includes(o[jt])||e.some(function(l){return yg[jt].includes(l)}))&&(s=jt);var u=e.reduce(function(l,c){var f=vL(ve.cssPrefix,c);if(pa[c]?(c=dL[s].includes(c)?BF[s][c]:c,a=c,l.prefix=c):pL[s].indexOf(c)>-1?(a=c,l.prefix=Of(c,{family:s})):f?l.iconName=f:c!==ve.replacementClass&&c!==o[St]&&c!==o[jt]&&l.rest.push(c),!i&&l.prefix&&l.iconName){var d=a==="fa"?Ax(l.iconName):{},h=ho(l.prefix,l.iconName);d.prefix&&(a=null),l.iconName=d.iconName||h||l.iconName,l.prefix=d.prefix||l.prefix,l.prefix==="far"&&!pa.far&&pa.fas&&!ve.autoFetchSvg&&(l.prefix="fas")}return l},Jv());return(e.includes("fa-brands")||e.includes("fab"))&&(u.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(u.prefix="fad"),!u.prefix&&s===jt&&(pa.fass||ve.autoFetchSvg)&&(u.prefix="fass",u.iconName=ho(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||a==="fa")&&(u.prefix=Ui()||"fas"),u}var gL=function(){function e(){DF(this,e),this.definitions={}}return NF(e,[{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=i.reduce(this._pullDefinitions,{});Object.keys(a).forEach(function(s){n.definitions[s]=pe(pe({},n.definitions[s]||{}),a[s]),Wp(s,a[s]);var u=fu[St][s];u&&Wp(u,a[s]),Ix()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(n,r){var i=r.prefix&&r.iconName&&r.icon?{0:r}:r;return Object.keys(i).map(function(o){var a=i[o],s=a.prefix,u=a.iconName,l=a.icon,c=l[2];n[s]||(n[s]={}),c.length>0&&c.forEach(function(f){typeof f=="string"&&(n[s][f]=l)}),n[s][u]=l}),n}}]),e}(),gg=[],ha={},Ca={},bL=Object.keys(Ca);function SL(e,t){var n=t.mixoutsTo;return gg=e,ha={},Object.keys(Ca).forEach(function(r){bL.indexOf(r)===-1&&delete Ca[r]}),gg.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(a){typeof i[a]=="function"&&(n[a]=i[a]),yc(i[a])==="object"&&Object.keys(i[a]).forEach(function(s){n[a]||(n[a]={}),n[a][s]=i[a][s]})}),r.hooks){var o=r.hooks();Object.keys(o).forEach(function(a){ha[a]||(ha[a]=[]),ha[a].push(o[a])})}r.provides&&r.provides(Ca)}),n}function Hp(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=ha[e]||[];return o.forEach(function(a){t=a.apply(null,[t].concat(r))}),t}function Po(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=ha[e]||[];i.forEach(function(o){o.apply(null,n)})}function si(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return Ca[e]?Ca[e].apply(null,t):void 0}function Kp(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Ui();if(t)return t=ho(n,t)||t,vg($x.definitions,n,t)||vg(xr.styles,n,t)}var $x=new gL,CL=function(){ve.autoReplaceSvg=!1,ve.observeMutations=!1,Po("noAuto")},wL={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fi?(Po("beforeI2svg",t),si("pseudoElements2svg",t),si("i2svg",t)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot;ve.autoReplaceSvg===!1&&(ve.autoReplaceSvg=!0),ve.observeMutations=!0,sL(function(){TL({autoReplaceSvgRoot:n}),Po("watch",t)})}},xL={icon:function(t){if(t===null)return null;if(yc(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:ho(t.prefix,t.iconName)||t.iconName};if(Array.isArray(t)&&t.length===2){var n=t[1].indexOf("fa-")===0?t[1].slice(3):t[1],r=Of(t[0]);return{prefix:r,iconName:ho(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(ve.cssPrefix,"-"))>-1||t.match(UF))){var i=Df(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||Ui(),iconName:ho(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var o=Ui();return{prefix:o,iconName:ho(o,t)||t}}}},rr={noAuto:CL,config:ve,dom:wL,parse:xL,library:$x,findIconDefinition:Kp,toHtml:Fu},TL=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?wt:n;(Object.keys(xr.styles).length>0||ve.autoFetchSvg)&&fi&&ve.autoReplaceSvg&&rr.dom.i2svg({node:r})};function Nf(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return Fu(r)})}}),Object.defineProperty(e,"node",{get:function(){if(fi){var r=wt.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function EL(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,a=e.transform;if(Hv(a)&&n.found&&!r.found){var s=n.width,u=n.height,l={x:s/u/2,y:.5};i.style=$f(pe(pe({},o),{},{"transform-origin":"".concat(l.x+a.x/16,"em ").concat(l.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function IL(e){var t=e.prefix,n=e.iconName,r=e.children,i=e.attributes,o=e.symbol,a=o===!0?"".concat(t,"-").concat(ve.cssPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:pe(pe({},i),{},{id:a}),children:r}]}]}function Xv(e){var t=e.icons,n=t.main,r=t.mask,i=e.prefix,o=e.iconName,a=e.transform,s=e.symbol,u=e.title,l=e.maskId,c=e.titleId,f=e.extra,d=e.watchable,h=d===void 0?!1:d,p=r.found?r:n,v=p.width,g=p.height,C=i==="fak",m=[ve.replacementClass,o?"".concat(ve.cssPrefix,"-").concat(o):""].filter(function(I){return f.classes.indexOf(I)===-1}).filter(function(I){return I!==""||!!I}).concat(f.classes).join(" "),b={children:[],attributes:pe(pe({},f.attributes),{},{"data-prefix":i,"data-icon":o,class:m,role:f.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(v," ").concat(g)})},x=C&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/g*16*.0625,"em")}:{};h&&(b.attributes[No]=""),u&&(b.children.push({tag:"title",attributes:{id:b.attributes["aria-labelledby"]||"title-".concat(c||pu())},children:[u]}),delete b.attributes.title);var T=pe(pe({},b),{},{prefix:i,iconName:o,main:n,mask:r,maskId:l,transform:a,symbol:s,styles:pe(pe({},x),f.styles)}),E=r.found&&n.found?si("generateAbstractMask",T)||{children:[],attributes:{}}:si("generateAbstractIcon",T)||{children:[],attributes:{}},A=E.children,N=E.attributes;return T.children=A,T.attributes=N,s?IL(T):EL(T)}function bg(e){var t=e.content,n=e.width,r=e.height,i=e.transform,o=e.title,a=e.extra,s=e.watchable,u=s===void 0?!1:s,l=pe(pe(pe({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});u&&(l[No]="");var c=pe({},a.styles);Hv(i)&&(c.transform=rL({transform:i,startCentered:!0,width:n,height:r}),c["-webkit-transform"]=c.transform);var f=$f(c);f.length>0&&(l.style=f);var d=[];return d.push({tag:"span",attributes:l,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function AL(e){var t=e.content,n=e.title,r=e.extra,i=pe(pe(pe({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),o=$f(r.styles);o.length>0&&(i.style=o);var a=[];return a.push({tag:"span",attributes:i,children:[t]}),n&&a.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),a}var nd=xr.styles;function Yp(e){var t=e[0],n=e[1],r=e.slice(4),i=Vv(r,1),o=i[0],a=null;return Array.isArray(o)?a={tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(po.PRIMARY),fill:"currentColor",d:o[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:t,height:n,icon:a}}var $L={found:!1,width:512,height:512};function OL(e,t){!hx&&!ve.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Jp(e,t){var n=t;return t==="fa"&&ve.styleDefault!==null&&(t=Ui()),new Promise(function(r,i){if(si("missingIconAbstract"),n==="fa"){var o=Ax(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&nd[t]&&nd[t][e]){var a=nd[t][e];return r(Yp(a))}OL(e,t),r(pe(pe({},$L),{},{icon:ve.showMissingIcons&&e?si("missingIconAbstract")||{}:{}}))})}var Sg=function(){},Xp=ve.measurePerformance&&fl&&fl.mark&&fl.measure?fl:{mark:Sg,measure:Sg},Ps='FA "6.5.1"',DL=function(t){return Xp.mark("".concat(Ps," ").concat(t," begins")),function(){return Ox(t)}},Ox=function(t){Xp.mark("".concat(Ps," ").concat(t," ends")),Xp.measure("".concat(Ps," ").concat(t),"".concat(Ps," ").concat(t," begins"),"".concat(Ps," ").concat(t," ends"))},Qv={begin:DL,end:Ox},Gl=function(){};function Cg(e){var t=e.getAttribute?e.getAttribute(No):null;return typeof t=="string"}function NL(e){var t=e.getAttribute?e.getAttribute(Uv):null,n=e.getAttribute?e.getAttribute(Gv):null;return t&&n}function PL(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)}function RL(){if(ve.autoReplaceSvg===!0)return zl.replace;var e=zl[ve.autoReplaceSvg];return e||zl.replace}function kL(e){return wt.createElementNS("http://www.w3.org/2000/svg",e)}function ML(e){return wt.createElement(e)}function Dx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?kL:ML:n;if(typeof e=="string")return wt.createTextNode(e);var i=r(e.tag);Object.keys(e.attributes||[]).forEach(function(a){i.setAttribute(a,e.attributes[a])});var o=e.children||[];return o.forEach(function(a){i.appendChild(Dx(a,{ceFn:r}))}),i}function jL(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var zl={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(Dx(i),n)}),n.getAttribute(No)===null&&ve.keepOriginalSource){var r=wt.createComment(jL(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~Wv(n).indexOf(ve.replacementClass))return zl.replace(t);var i=new RegExp("".concat(ve.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var o=r[0].attributes.class.split(" ").reduce(function(s,u){return u===ve.replacementClass||u.match(i)?s.toSvg.push(u):s.toNode.push(u),s},{toNode:[],toSvg:[]});r[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",o.toNode.join(" "))}var a=r.map(function(s){return Fu(s)}).join(`
|
|
952
|
+
`);n.setAttribute(No,""),n.innerHTML=a}};function wg(e){e()}function Nx(e,t){var n=typeof t=="function"?t:Gl;if(e.length===0)n();else{var r=wg;ve.mutateApproach===LF&&(r=Bi.requestAnimationFrame||wg),r(function(){var i=RL(),o=Qv.begin("mutate");e.map(i),o(),n()})}}var Zv=!1;function Px(){Zv=!0}function Qp(){Zv=!1}var bc=null;function xg(e){if(dg&&ve.observeMutations){var t=e.treeCallback,n=t===void 0?Gl:t,r=e.nodeCallback,i=r===void 0?Gl:r,o=e.pseudoElementsCallback,a=o===void 0?Gl:o,s=e.observeMutationsRoot,u=s===void 0?wt:s;bc=new dg(function(l){if(!Zv){var c=Ui();as(l).forEach(function(f){if(f.type==="childList"&&f.addedNodes.length>0&&!Cg(f.addedNodes[0])&&(ve.searchPseudoElements&&a(f.target),n(f.target)),f.type==="attributes"&&f.target.parentNode&&ve.searchPseudoElements&&a(f.target.parentNode),f.type==="attributes"&&Cg(f.target)&&~HF.indexOf(f.attributeName))if(f.attributeName==="class"&&NL(f.target)){var d=Df(Wv(f.target)),h=d.prefix,p=d.iconName;f.target.setAttribute(Uv,h||c),p&&f.target.setAttribute(Gv,p)}else PL(f.target)&&i(f.target)})}}),fi&&bc.observe(u,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function _L(){bc&&bc.disconnect()}function qL(e){var t=e.getAttribute("style"),n=[];return t&&(n=t.split(";").reduce(function(r,i){var o=i.split(":"),a=o[0],s=o.slice(1);return a&&s.length>0&&(r[a]=s.join(":").trim()),r},{})),n}function FL(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"",i=Df(Wv(e));return i.prefix||(i.prefix=Ui()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=mL(i.prefix,e.innerText)||Yv(i.prefix,zp(e.innerText))),!i.iconName&&ve.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function LL(e){var t=as(e.attributes).reduce(function(i,o){return i.name!=="class"&&i.name!=="style"&&(i[o.name]=o.value),i},{}),n=e.getAttribute("title"),r=e.getAttribute("data-fa-title-id");return ve.autoA11y&&(n?t["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(r||pu()):(t["aria-hidden"]="true",t.focusable="false")),t}function VL(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Pr,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function Tg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=FL(e),r=n.iconName,i=n.prefix,o=n.rest,a=LL(e),s=Hp("parseNodeAttributes",{},e),u=t.styleParser?qL(e):[];return pe({iconName:r,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:Pr,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:u,attributes:a}},s)}var BL=xr.styles;function Rx(e){var t=ve.autoReplaceSvg==="nest"?Tg(e,{styleParser:!1}):Tg(e);return~t.extra.classes.indexOf(vx)?si("generateLayersText",e,t):si("generateSvgReplacementMutation",e,t)}var Gi=new Set;zv.map(function(e){Gi.add("fa-".concat(e))});Object.keys(lu[St]).map(Gi.add.bind(Gi));Object.keys(lu[jt]).map(Gi.add.bind(Gi));Gi=_u(Gi);function Eg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!fi)return Promise.resolve();var n=wt.documentElement.classList,r=function(f){return n.add("".concat(pg,"-").concat(f))},i=function(f){return n.remove("".concat(pg,"-").concat(f))},o=ve.autoFetchSvg?Gi:zv.map(function(c){return"fa-".concat(c)}).concat(Object.keys(BL));o.includes("fa")||o.push("fa");var a=[".".concat(vx,":not([").concat(No,"])")].concat(o.map(function(c){return".".concat(c,":not([").concat(No,"])")})).join(", ");if(a.length===0)return Promise.resolve();var s=[];try{s=as(e.querySelectorAll(a))}catch{}if(s.length>0)r("pending"),i("complete");else return Promise.resolve();var u=Qv.begin("onTree"),l=s.reduce(function(c,f){try{var d=Rx(f);d&&c.push(d)}catch(h){hx||h.name==="MissingIcon"&&console.error(h)}return c},[]);return new Promise(function(c,f){Promise.all(l).then(function(d){Nx(d,function(){r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),u(),c()})}).catch(function(d){u(),f(d)})})}function UL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Rx(e).then(function(n){n&&Nx([n],t)})}function GL(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:Kp(t||{}),i=n.mask;return i&&(i=(i||{}).icon?i:Kp(i||{})),e(r,pe(pe({},n),{},{mask:i}))}}var zL=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?Pr:r,o=n.symbol,a=o===void 0?!1:o,s=n.mask,u=s===void 0?null:s,l=n.maskId,c=l===void 0?null:l,f=n.title,d=f===void 0?null:f,h=n.titleId,p=h===void 0?null:h,v=n.classes,g=v===void 0?[]:v,C=n.attributes,m=C===void 0?{}:C,b=n.styles,x=b===void 0?{}:b;if(t){var T=t.prefix,E=t.iconName,A=t.icon;return Nf(pe({type:"icon"},t),function(){return Po("beforeDOMElementCreation",{iconDefinition:t,params:n}),ve.autoA11y&&(d?m["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(p||pu()):(m["aria-hidden"]="true",m.focusable="false")),Xv({icons:{main:Yp(A),mask:u?Yp(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:T,iconName:E,transform:pe(pe({},Pr),i),symbol:a,title:d,maskId:c,titleId:p,extra:{attributes:m,styles:x,classes:g}})})}},WL={mixout:function(){return{icon:GL(zL)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=Eg,n.nodeCallback=UL,n}}},provides:function(t){t.i2svg=function(n){var r=n.node,i=r===void 0?wt:r,o=n.callback,a=o===void 0?function(){}:o;return Eg(i,a)},t.generateSvgReplacementMutation=function(n,r){var i=r.iconName,o=r.title,a=r.titleId,s=r.prefix,u=r.transform,l=r.symbol,c=r.mask,f=r.maskId,d=r.extra;return new Promise(function(h,p){Promise.all([Jp(i,s),c.iconName?Jp(c.iconName,c.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(v){var g=Vv(v,2),C=g[0],m=g[1];h([n,Xv({icons:{main:C,mask:m},prefix:s,iconName:i,transform:u,symbol:l,maskId:f,title:o,titleId:a,extra:d,watchable:!0})])}).catch(p)})},t.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,o=n.main,a=n.transform,s=n.styles,u=$f(s);u.length>0&&(i.style=u);var l;return Hv(a)&&(l=si("generateAbstractTransformGrouping",{main:o,transform:a,containerWidth:o.width,iconWidth:o.width})),r.push(l||o.icon),{children:r,attributes:i}}}},HL={mixout:function(){return{layer:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.classes,o=i===void 0?[]:i;return Nf({type:"layer"},function(){Po("beforeDOMElementCreation",{assembler:n,params:r});var a=[];return n(function(s){Array.isArray(s)?s.map(function(u){a=a.concat(u.abstract)}):a=a.concat(s.abstract)}),[{tag:"span",attributes:{class:["".concat(ve.cssPrefix,"-layers")].concat(_u(o)).join(" ")},children:a}]})}}}},KL={mixout:function(){return{counter:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.title,o=i===void 0?null:i,a=r.classes,s=a===void 0?[]:a,u=r.attributes,l=u===void 0?{}:u,c=r.styles,f=c===void 0?{}:c;return Nf({type:"counter",content:n},function(){return Po("beforeDOMElementCreation",{content:n,params:r}),AL({content:n.toString(),title:o,extra:{attributes:l,styles:f,classes:["".concat(ve.cssPrefix,"-layers-counter")].concat(_u(s))}})})}}}},YL={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,o=i===void 0?Pr:i,a=r.title,s=a===void 0?null:a,u=r.classes,l=u===void 0?[]:u,c=r.attributes,f=c===void 0?{}:c,d=r.styles,h=d===void 0?{}:d;return Nf({type:"text",content:n},function(){return Po("beforeDOMElementCreation",{content:n,params:r}),bg({content:n,transform:pe(pe({},Pr),o),title:s,extra:{attributes:f,styles:h,classes:["".concat(ve.cssPrefix,"-layers-text")].concat(_u(l))}})})}}},provides:function(t){t.generateLayersText=function(n,r){var i=r.title,o=r.transform,a=r.extra,s=null,u=null;if(fx){var l=parseInt(getComputedStyle(n).fontSize,10),c=n.getBoundingClientRect();s=c.width/l,u=c.height/l}return ve.autoA11y&&!i&&(a.attributes["aria-hidden"]="true"),Promise.resolve([n,bg({content:n.innerHTML,width:s,height:u,transform:o,title:i,extra:a,watchable:!0})])}}},JL=new RegExp('"',"ug"),Ig=[1105920,1112319];function XL(e){var t=e.replace(JL,""),n=cL(t,0),r=n>=Ig[0]&&n<=Ig[1],i=t.length===2?t[0]===t[1]:!1;return{value:zp(i?t[0]:t),isSecondary:r||i}}function Ag(e,t){var n="".concat(FF).concat(t.replace(":","-"));return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var o=as(e.children),a=o.filter(function(A){return A.getAttribute(Gp)===t})[0],s=Bi.getComputedStyle(e,t),u=s.getPropertyValue("font-family").match(GF),l=s.getPropertyValue("font-weight"),c=s.getPropertyValue("content");if(a&&!u)return e.removeChild(a),r();if(u&&c!=="none"&&c!==""){var f=s.getPropertyValue("content"),d=~["Sharp"].indexOf(u[2])?jt:St,h=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?cu[d][u[2].toLowerCase()]:zF[d][l],p=XL(f),v=p.value,g=p.isSecondary,C=u[0].startsWith("FontAwesome"),m=Yv(h,v),b=m;if(C){var x=yL(v);x.iconName&&x.prefix&&(m=x.iconName,h=x.prefix)}if(m&&!g&&(!a||a.getAttribute(Uv)!==h||a.getAttribute(Gv)!==b)){e.setAttribute(n,b),a&&e.removeChild(a);var T=VL(),E=T.extra;E.attributes[Gp]=t,Jp(m,h).then(function(A){var N=Xv(pe(pe({},T),{},{icons:{main:A,mask:Jv()},prefix:h,iconName:b,extra:E,watchable:!0})),I=wt.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(I,e.firstChild):e.appendChild(I),I.outerHTML=N.map(function(P){return Fu(P)}).join(`
|
|
953
|
+
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function QL(e){return Promise.all([Ag(e,"::before"),Ag(e,"::after")])}function ZL(e){return e.parentNode!==document.head&&!~VF.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(Gp)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function $g(e){if(fi)return new Promise(function(t,n){var r=as(e.querySelectorAll("*")).filter(ZL).map(QL),i=Qv.begin("searchPseudoElements");Px(),Promise.all(r).then(function(){i(),Qp(),t()}).catch(function(){i(),Qp(),n()})})}var eV={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=$g,n}}},provides:function(t){t.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?wt:r;ve.searchPseudoElements&&$g(i)}}},Og=!1,tV={mixout:function(){return{dom:{unwatch:function(){Px(),Og=!0}}}},hooks:function(){return{bootstrap:function(){xg(Hp("mutationObserverCallbacks",{}))},noAuto:function(){_L()},watch:function(n){var r=n.observeMutationsRoot;Og?Qp():xg(Hp("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},Dg=function(t){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t.toLowerCase().split(" ").reduce(function(r,i){var o=i.toLowerCase().split("-"),a=o[0],s=o.slice(1).join("-");if(a&&s==="h")return r.flipX=!0,r;if(a&&s==="v")return r.flipY=!0,r;if(s=parseFloat(s),isNaN(s))return r;switch(a){case"grow":r.size=r.size+s;break;case"shrink":r.size=r.size-s;break;case"left":r.x=r.x-s;break;case"right":r.x=r.x+s;break;case"up":r.y=r.y-s;break;case"down":r.y=r.y+s;break;case"rotate":r.rotate=r.rotate+s;break}return r},n)},nV={mixout:function(){return{parse:{transform:function(n){return Dg(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=Dg(i)),n}}},provides:function(t){t.generateAbstractTransformGrouping=function(n){var r=n.main,i=n.transform,o=n.containerWidth,a=n.iconWidth,s={transform:"translate(".concat(o/2," 256)")},u="translate(".concat(i.x*32,", ").concat(i.y*32,") "),l="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),c="rotate(".concat(i.rotate," 0 0)"),f={transform:"".concat(u," ").concat(l," ").concat(c)},d={transform:"translate(".concat(a/2*-1," -256)")},h={outer:s,inner:f,path:d};return{tag:"g",attributes:pe({},h.outer),children:[{tag:"g",attributes:pe({},h.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:pe(pe({},r.icon.attributes),h.path)}]}]}}}},rd={x:0,y:0,width:"100%",height:"100%"};function Ng(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||t)&&(e.attributes.fill="black"),e}function rV(e){return e.tag==="g"?e.children:[e]}var iV={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),o=i?Df(i.split(" ").map(function(a){return a.trim()})):Jv();return o.prefix||(o.prefix=Ui()),n.mask=o,n.maskId=r.getAttribute("data-fa-mask-id"),n}}},provides:function(t){t.generateAbstractMask=function(n){var r=n.children,i=n.attributes,o=n.main,a=n.mask,s=n.maskId,u=n.transform,l=o.width,c=o.icon,f=a.width,d=a.icon,h=nL({transform:u,containerWidth:f,iconWidth:l}),p={tag:"rect",attributes:pe(pe({},rd),{},{fill:"white"})},v=c.children?{children:c.children.map(Ng)}:{},g={tag:"g",attributes:pe({},h.inner),children:[Ng(pe({tag:c.tag,attributes:pe(pe({},c.attributes),h.path)},v))]},C={tag:"g",attributes:pe({},h.outer),children:[g]},m="mask-".concat(s||pu()),b="clip-".concat(s||pu()),x={tag:"mask",attributes:pe(pe({},rd),{},{id:m,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[p,C]},T={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:rV(d)},x]};return r.push(T,{tag:"rect",attributes:pe({fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(m,")")},rd)}),{children:r,attributes:i}}}},oV={provides:function(t){var n=!1;Bi.matchMedia&&(n=Bi.matchMedia("(prefers-reduced-motion: reduce)").matches),t.missingIconAbstract=function(){var r=[],i={fill:"currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};r.push({tag:"path",attributes:pe(pe({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var a=pe(pe({},o),{},{attributeName:"opacity"}),s={tag:"circle",attributes:pe(pe({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||s.children.push({tag:"animate",attributes:pe(pe({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:pe(pe({},a),{},{values:"1;0;1;1;0;1;"})}),r.push(s),r.push({tag:"path",attributes:pe(pe({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:pe(pe({},a),{},{values:"1;0;0;0;0;1;"})}]}),n||r.push({tag:"path",attributes:pe(pe({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:pe(pe({},a),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:r}}}},aV={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-symbol"),o=i===null?!1:i===""?!0:i;return n.symbol=o,n}}}},sV=[oL,WL,HL,KL,YL,eV,tV,nV,iV,oV,aV];SL(sV,{mixoutsTo:rr});rr.noAuto;rr.config;rr.library;rr.dom;var Zp=rr.parse;rr.findIconDefinition;rr.toHtml;var uV=rr.icon;rr.layer;rr.text;rr.counter;var eh={exports:{}},Sl={exports:{}},at={};/** @license React v16.13.1
|
|
954
954
|
* react-is.production.min.js
|
|
955
955
|
*
|
|
956
956
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
957
957
|
*
|
|
958
958
|
* This source code is licensed under the MIT license found in the
|
|
959
959
|
* LICENSE file in the root directory of this source tree.
|
|
960
|
-
*/var
|
|
960
|
+
*/var Pg;function lV(){if(Pg)return at;Pg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function b(T){if(typeof T=="object"&&T!==null){var E=T.$$typeof;switch(E){case t:switch(T=T.type,T){case u:case l:case r:case o:case i:case f:return T;default:switch(T=T&&T.$$typeof,T){case s:case c:case p:case h:case a:return T;default:return E}}case n:return E}}}function x(T){return b(T)===l}return at.AsyncMode=u,at.ConcurrentMode=l,at.ContextConsumer=s,at.ContextProvider=a,at.Element=t,at.ForwardRef=c,at.Fragment=r,at.Lazy=p,at.Memo=h,at.Portal=n,at.Profiler=o,at.StrictMode=i,at.Suspense=f,at.isAsyncMode=function(T){return x(T)||b(T)===u},at.isConcurrentMode=x,at.isContextConsumer=function(T){return b(T)===s},at.isContextProvider=function(T){return b(T)===a},at.isElement=function(T){return typeof T=="object"&&T!==null&&T.$$typeof===t},at.isForwardRef=function(T){return b(T)===c},at.isFragment=function(T){return b(T)===r},at.isLazy=function(T){return b(T)===p},at.isMemo=function(T){return b(T)===h},at.isPortal=function(T){return b(T)===n},at.isProfiler=function(T){return b(T)===o},at.isStrictMode=function(T){return b(T)===i},at.isSuspense=function(T){return b(T)===f},at.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===r||T===l||T===o||T===i||T===f||T===d||typeof T=="object"&&T!==null&&(T.$$typeof===p||T.$$typeof===h||T.$$typeof===a||T.$$typeof===s||T.$$typeof===c||T.$$typeof===g||T.$$typeof===C||T.$$typeof===m||T.$$typeof===v)},at.typeOf=b,at}var st={};/** @license React v16.13.1
|
|
961
961
|
* react-is.development.js
|
|
962
962
|
*
|
|
963
963
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
964
964
|
*
|
|
965
965
|
* This source code is licensed under the MIT license found in the
|
|
966
966
|
* LICENSE file in the root directory of this source tree.
|
|
967
|
-
*/var
|
|
967
|
+
*/var Rg;function cV(){return Rg||(Rg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,u=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,C=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function b(le){return typeof le=="string"||typeof le=="function"||le===r||le===l||le===o||le===i||le===f||le===d||typeof le=="object"&&le!==null&&(le.$$typeof===p||le.$$typeof===h||le.$$typeof===a||le.$$typeof===s||le.$$typeof===c||le.$$typeof===g||le.$$typeof===C||le.$$typeof===m||le.$$typeof===v)}function x(le){if(typeof le=="object"&&le!==null){var Pn=le.$$typeof;switch(Pn){case t:var hi=le.type;switch(hi){case u:case l:case r:case o:case i:case f:return hi;default:var Bo=hi&&hi.$$typeof;switch(Bo){case s:case c:case p:case h:case a:return Bo;default:return Pn}}case n:return Pn}}}var T=u,E=l,A=s,N=a,I=t,P=c,_=r,L=p,U=h,Y=n,k=o,ie=i,B=f,G=!1;function fe(le){return G||(G=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),j(le)||x(le)===u}function j(le){return x(le)===l}function R(le){return x(le)===s}function te(le){return x(le)===a}function oe(le){return typeof le=="object"&&le!==null&&le.$$typeof===t}function X(le){return x(le)===c}function ae(le){return x(le)===r}function de(le){return x(le)===p}function he(le){return x(le)===h}function Te(le){return x(le)===n}function ke(le){return x(le)===o}function Ne(le){return x(le)===i}function mt(le){return x(le)===f}st.AsyncMode=T,st.ConcurrentMode=E,st.ContextConsumer=A,st.ContextProvider=N,st.Element=I,st.ForwardRef=P,st.Fragment=_,st.Lazy=L,st.Memo=U,st.Portal=Y,st.Profiler=k,st.StrictMode=ie,st.Suspense=B,st.isAsyncMode=fe,st.isConcurrentMode=j,st.isContextConsumer=R,st.isContextProvider=te,st.isElement=oe,st.isForwardRef=X,st.isFragment=ae,st.isLazy=de,st.isMemo=he,st.isPortal=Te,st.isProfiler=ke,st.isStrictMode=Ne,st.isSuspense=mt,st.isValidElementType=b,st.typeOf=x}()),st}var kg;function kx(){return kg||(kg=1,process.env.NODE_ENV==="production"?Sl.exports=lV():Sl.exports=cV()),Sl.exports}/*
|
|
968
968
|
object-assign
|
|
969
969
|
(c) Sindre Sorhus
|
|
970
970
|
@license MIT
|
|
971
|
-
*/var
|
|
972
|
-
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var le=mt(he,Ne,X,ae,de+"."+Ne,n);if(le)return le}return null}return g(R)}function Y(j){switch(typeof j){case"number":case"string":case"undefined":return!0;case"boolean":return!j;case"object":if(Array.isArray(j))return j.every(Y);if(j===null||s(j))return!0;var R=f(j);if(R){var te=R.call(j),oe;if(R!==j.entries){for(;!(oe=te.next()).done;)if(!Y(oe.value))return!1}else for(;!(oe=te.next()).done;){var X=oe.value;if(X&&!Y(X[1]))return!1}}else return!1;return!0;default:return!1}}function k(j,R){return j==="symbol"?!0:R?R["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&R instanceof Symbol:!1}function ie(j){var R=typeof j;return Array.isArray(j)?"array":j instanceof RegExp?"object":k(R,j)?"symbol":R}function B(j){if(typeof j>"u"||j===null)return""+j;var R=ie(j);if(R==="object"){if(j instanceof Date)return"date";if(j instanceof RegExp)return"regexp"}return R}function G(j){var R=B(j);switch(R){case"array":case"object":return"an "+R;case"boolean":case"date":case"regexp":return"a "+R;default:return R}}function fe(j){return!j.constructor||!j.constructor.name?d:j.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},
|
|
973
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
971
|
+
*/var id,Mg;function fV(){if(Mg)return id;Mg=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var u=Object.getOwnPropertyNames(a).map(function(c){return a[c]});if(u.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(c){l[c]=c}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return id=i()?Object.assign:function(o,a){for(var s,u=r(o),l,c=1;c<arguments.length;c++){s=Object(arguments[c]);for(var f in s)t.call(s,f)&&(u[f]=s[f]);if(e){l=e(s);for(var d=0;d<l.length;d++)n.call(s,l[d])&&(u[l[d]]=s[l[d]])}}return u},id}var od,jg;function em(){if(jg)return od;jg=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return od=e,od}var ad,_g;function Mx(){return _g||(_g=1,ad=Function.call.bind(Object.prototype.hasOwnProperty)),ad}var sd,qg;function dV(){if(qg)return sd;qg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=em(),n={},r=Mx();e=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,s,u,l){if(process.env.NODE_ENV!=="production"){for(var c in o)if(r(o,c)){var f;try{if(typeof o[c]!="function"){var d=Error((u||"React class")+": "+s+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=o[c](a,c,u,s,null,t)}catch(p){f=p}if(f&&!(f instanceof Error)&&e((u||"React class")+": type specification of "+s+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var h=l?l():"";e("Failed "+s+" type: "+f.message+(h??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},sd=i,sd}var ud,Fg;function pV(){if(Fg)return ud;Fg=1;var e=kx(),t=fV(),n=em(),r=Mx(),i=dV(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(s){var u="Warning: "+s;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return ud=function(s,u){var l=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function f(j){var R=j&&(l&&j[l]||j[c]);if(typeof R=="function")return R}var d="<<anonymous>>",h={array:C("array"),bigint:C("bigint"),bool:C("boolean"),func:C("function"),number:C("number"),object:C("object"),string:C("string"),symbol:C("symbol"),any:m(),arrayOf:b,element:x(),elementType:T(),instanceOf:E,node:P(),objectOf:N,oneOf:A,oneOfType:I,shape:L,exact:U};function p(j,R){return j===R?j!==0||1/j===1/R:j!==j&&R!==R}function v(j,R){this.message=j,this.data=R&&typeof R=="object"?R:{},this.stack=""}v.prototype=Error.prototype;function g(j){if(process.env.NODE_ENV!=="production")var R={},te=0;function oe(ae,de,he,Te,ke,Ne,mt){if(Te=Te||d,Ne=Ne||he,mt!==n){if(u){var le=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw le.name="Invariant Violation",le}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Pn=Te+":"+he;!R[Pn]&&te<3&&(o("You are manually calling a React.PropTypes validation function for the `"+Ne+"` prop on `"+Te+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),R[Pn]=!0,te++)}}return de[he]==null?ae?de[he]===null?new v("The "+ke+" `"+Ne+"` is marked as required "+("in `"+Te+"`, but its value is `null`.")):new v("The "+ke+" `"+Ne+"` is marked as required in "+("`"+Te+"`, but its value is `undefined`.")):null:j(de,he,Te,ke,Ne)}var X=oe.bind(null,!1);return X.isRequired=oe.bind(null,!0),X}function C(j){function R(te,oe,X,ae,de,he){var Te=te[oe],ke=ie(Te);if(ke!==j){var Ne=B(Te);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Ne+"` supplied to `"+X+"`, expected ")+("`"+j+"`."),{expectedType:j})}return null}return g(R)}function m(){return g(a)}function b(j){function R(te,oe,X,ae,de){if(typeof j!="function")return new v("Property `"+de+"` of component `"+X+"` has invalid PropType notation inside arrayOf.");var he=te[oe];if(!Array.isArray(he)){var Te=ie(he);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Te+"` supplied to `"+X+"`, expected an array."))}for(var ke=0;ke<he.length;ke++){var Ne=j(he,ke,X,ae,de+"["+ke+"]",n);if(Ne instanceof Error)return Ne}return null}return g(R)}function x(){function j(R,te,oe,X,ae){var de=R[te];if(!s(de)){var he=ie(de);return new v("Invalid "+X+" `"+ae+"` of type "+("`"+he+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return g(j)}function T(){function j(R,te,oe,X,ae){var de=R[te];if(!e.isValidElementType(de)){var he=ie(de);return new v("Invalid "+X+" `"+ae+"` of type "+("`"+he+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return g(j)}function E(j){function R(te,oe,X,ae,de){if(!(te[oe]instanceof j)){var he=j.name||d,Te=fe(te[oe]);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Te+"` supplied to `"+X+"`, expected ")+("instance of `"+he+"`."))}return null}return g(R)}function A(j){if(!Array.isArray(j))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),a;function R(te,oe,X,ae,de){for(var he=te[oe],Te=0;Te<j.length;Te++)if(p(he,j[Te]))return null;var ke=JSON.stringify(j,function(mt,le){var Pn=B(le);return Pn==="symbol"?String(le):le});return new v("Invalid "+ae+" `"+de+"` of value `"+String(he)+"` "+("supplied to `"+X+"`, expected one of "+ke+"."))}return g(R)}function N(j){function R(te,oe,X,ae,de){if(typeof j!="function")return new v("Property `"+de+"` of component `"+X+"` has invalid PropType notation inside objectOf.");var he=te[oe],Te=ie(he);if(Te!=="object")return new v("Invalid "+ae+" `"+de+"` of type "+("`"+Te+"` supplied to `"+X+"`, expected an object."));for(var ke in he)if(r(he,ke)){var Ne=j(he,ke,X,ae,de+"."+ke,n);if(Ne instanceof Error)return Ne}return null}return g(R)}function I(j){if(!Array.isArray(j))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var R=0;R<j.length;R++){var te=j[R];if(typeof te!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(te)+" at index "+R+"."),a}function oe(X,ae,de,he,Te){for(var ke=[],Ne=0;Ne<j.length;Ne++){var mt=j[Ne],le=mt(X,ae,de,he,Te,n);if(le==null)return null;le.data&&r(le.data,"expectedType")&&ke.push(le.data.expectedType)}var Pn=ke.length>0?", expected one of type ["+ke.join(", ")+"]":"";return new v("Invalid "+he+" `"+Te+"` supplied to "+("`"+de+"`"+Pn+"."))}return g(oe)}function P(){function j(R,te,oe,X,ae){return Y(R[te])?null:new v("Invalid "+X+" `"+ae+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return g(j)}function _(j,R,te,oe,X){return new v((j||"React class")+": "+R+" type `"+te+"."+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+X+"`.")}function L(j){function R(te,oe,X,ae,de){var he=te[oe],Te=ie(he);if(Te!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+Te+"` "+("supplied to `"+X+"`, expected `object`."));for(var ke in j){var Ne=j[ke];if(typeof Ne!="function")return _(X,ae,de,ke,B(Ne));var mt=Ne(he,ke,X,ae,de+"."+ke,n);if(mt)return mt}return null}return g(R)}function U(j){function R(te,oe,X,ae,de){var he=te[oe],Te=ie(he);if(Te!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+Te+"` "+("supplied to `"+X+"`, expected `object`."));var ke=t({},te[oe],j);for(var Ne in ke){var mt=j[Ne];if(r(j,Ne)&&typeof mt!="function")return _(X,ae,de,Ne,B(mt));if(!mt)return new v("Invalid "+ae+" `"+de+"` key `"+Ne+"` supplied to `"+X+"`.\nBad object: "+JSON.stringify(te[oe],null," ")+`
|
|
972
|
+
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var le=mt(he,Ne,X,ae,de+"."+Ne,n);if(le)return le}return null}return g(R)}function Y(j){switch(typeof j){case"number":case"string":case"undefined":return!0;case"boolean":return!j;case"object":if(Array.isArray(j))return j.every(Y);if(j===null||s(j))return!0;var R=f(j);if(R){var te=R.call(j),oe;if(R!==j.entries){for(;!(oe=te.next()).done;)if(!Y(oe.value))return!1}else for(;!(oe=te.next()).done;){var X=oe.value;if(X&&!Y(X[1]))return!1}}else return!1;return!0;default:return!1}}function k(j,R){return j==="symbol"?!0:R?R["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&R instanceof Symbol:!1}function ie(j){var R=typeof j;return Array.isArray(j)?"array":j instanceof RegExp?"object":k(R,j)?"symbol":R}function B(j){if(typeof j>"u"||j===null)return""+j;var R=ie(j);if(R==="object"){if(j instanceof Date)return"date";if(j instanceof RegExp)return"regexp"}return R}function G(j){var R=B(j);switch(R){case"array":case"object":return"an "+R;case"boolean":case"date":case"regexp":return"a "+R;default:return R}}function fe(j){return!j.constructor||!j.constructor.name?d:j.constructor.name}return h.checkPropTypes=i,h.resetWarningCache=i.resetWarningCache,h.PropTypes=h,h},ud}var ld,Lg;function hV(){if(Lg)return ld;Lg=1;var e=em();function t(){}function n(){}return n.resetWarningCache=t,ld=function(){function r(a,s,u,l,c,f){if(f!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},ld}if(process.env.NODE_ENV!=="production"){var vV=kx(),mV=!0;eh.exports=pV()(vV.isElement,mV)}else eh.exports=hV()();var yV=eh.exports;const _e=SS(yV);function Vg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vg(Object(n),!0).forEach(function(r){va(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Sc(e){"@babel/helpers - typeof";return Sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sc(e)}function va(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gV(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function bV(e,t){if(e==null)return{};var n=gV(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function th(e){return SV(e)||CV(e)||wV(e)||xV()}function SV(e){if(Array.isArray(e))return nh(e)}function CV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wV(e,t){if(e){if(typeof e=="string")return nh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nh(e,t)}}function nh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
973
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TV(e){var t,n=e.beat,r=e.fade,i=e.beatFade,o=e.bounce,a=e.shake,s=e.flash,u=e.spin,l=e.spinPulse,c=e.spinReverse,f=e.pulse,d=e.fixedWidth,h=e.inverse,p=e.border,v=e.listItem,g=e.flip,C=e.size,m=e.rotation,b=e.pull,x=(t={"fa-beat":n,"fa-fade":r,"fa-beat-fade":i,"fa-bounce":o,"fa-shake":a,"fa-flash":s,"fa-spin":u,"fa-spin-reverse":c,"fa-spin-pulse":l,"fa-pulse":f,"fa-fw":d,"fa-inverse":h,"fa-border":p,"fa-li":v,"fa-flip":g===!0,"fa-flip-horizontal":g==="horizontal"||g==="both","fa-flip-vertical":g==="vertical"||g==="both"},va(t,"fa-".concat(C),typeof C<"u"&&C!==null),va(t,"fa-rotate-".concat(m),typeof m<"u"&&m!==null&&m!==0),va(t,"fa-pull-".concat(b),typeof b<"u"&&b!==null),va(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(x).map(function(T){return x[T]?T:null}).filter(function(T){return T})}function EV(e){return e=e-0,e===e}function jx(e){return EV(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(t,n){return n?n.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var IV=["style"];function AV(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $V(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),i=jx(n.slice(0,r)),o=n.slice(r+1).trim();return i.startsWith("webkit")?t[AV(i)]=o:t[i]=o,t},{})}function _x(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(u){return _x(e,u)}),i=Object.keys(t.attributes||{}).reduce(function(u,l){var c=t.attributes[l];switch(l){case"class":u.attrs.className=c,delete t.attributes.class;break;case"style":u.attrs.style=$V(c);break;default:l.indexOf("aria-")===0||l.indexOf("data-")===0?u.attrs[l.toLowerCase()]=c:u.attrs[jx(l)]=c}return u},{attrs:{}}),o=n.style,a=o===void 0?{}:o,s=bV(n,IV);return i.attrs.style=$i($i({},i.attrs.style),a),e.apply(void 0,[t.tag,$i($i({},i.attrs),s)].concat(th(r)))}var qx=!1;try{qx=process.env.NODE_ENV==="production"}catch{}function OV(){if(!qx&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Bg(e){if(e&&Sc(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Zp.icon)return Zp.icon(e);if(e===null)return null;if(e&&Sc(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function cd(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?va({},e,t):{}}var zi=O.forwardRef(function(e,t){var n=e.icon,r=e.mask,i=e.symbol,o=e.className,a=e.title,s=e.titleId,u=e.maskId,l=Bg(n),c=cd("classes",[].concat(th(TV(e)),th(o.split(" ")))),f=cd("transform",typeof e.transform=="string"?Zp.transform(e.transform):e.transform),d=cd("mask",Bg(r)),h=uV(l,$i($i($i($i({},c),f),d),{},{symbol:i,title:a,titleId:s,maskId:u}));if(!h)return OV("Could not find icon",l),null;var p=h.abstract,v={ref:t};return Object.keys(e).forEach(function(g){zi.defaultProps.hasOwnProperty(g)||(v[g]=e[g])}),DV(p[0],v)});zi.displayName="FontAwesomeIcon";zi.propTypes={beat:_e.bool,border:_e.bool,beatFade:_e.bool,bounce:_e.bool,className:_e.string,fade:_e.bool,flash:_e.bool,mask:_e.oneOfType([_e.object,_e.array,_e.string]),maskId:_e.string,fixedWidth:_e.bool,inverse:_e.bool,flip:_e.oneOf([!0,!1,"horizontal","vertical","both"]),icon:_e.oneOfType([_e.object,_e.array,_e.string]),listItem:_e.bool,pull:_e.oneOf(["right","left"]),pulse:_e.bool,rotation:_e.oneOf([0,90,180,270]),shake:_e.bool,size:_e.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:_e.bool,spinPulse:_e.bool,spinReverse:_e.bool,symbol:_e.oneOfType([_e.bool,_e.string]),title:_e.string,titleId:_e.string,transform:_e.oneOfType([_e.string,_e.object]),swapOpacity:_e.bool};zi.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var DV=_x.bind(null,O.createElement);function Fx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function NV(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fx(e))&&(r&&(r+=" "),r+=t);return r}var Cc=_m&&_m.__assign||function(){return Cc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Cc.apply(this,arguments)};function PV(e,t,n){if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style=Cc(Cc({},e.style),n);else if(typeof n=="function"){var r=e[t];e[t]=r?function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];r.apply(void 0,i),n.apply(void 0,i)}:n}else{if(n===void 0||typeof n!="object"&&n===e[t])return;if(!(t in e))e[t]=n;else throw new Error("Didn’t know how to merge prop '".concat(t,"'. ")+"Only 'className', 'style', and event handlers are supported")}}var RV=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1?t[0]:t.reduce(function(r,i){for(var o in i)PV(r,o,i[o]);return r},{})};const Lx=SS(RV);/*!
|
|
974
974
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
|
975
975
|
* http://github.com/janl/mustache.js
|
|
976
|
-
*/var
|
|
977
|
-
`&&(c(),u="",l=0,n=!1);if(!v.scan(f))break;if(a=!0,C=v.scan(
|
|
976
|
+
*/var kV=Object.prototype.toString,ss=Array.isArray||function(t){return kV.call(t)==="[object Array]"};function tm(e){return typeof e=="function"}function MV(e){return ss(e)?"array":typeof e}function fd(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ug(e,t){return e!=null&&typeof e=="object"&&t in e}function jV(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var _V=RegExp.prototype.test;function qV(e,t){return _V.call(e,t)}var FV=/\S/;function LV(e){return!qV(FV,e)}var VV={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function BV(e){return String(e).replace(/[&<>"'`=\/]/g,function(n){return VV[n]})}var UV=/\s*/,GV=/\s+/,Gg=/\s*=/,zV=/\s*\}/,WV=/#|\^|\/|>|\{|&|=|!/;function HV(e,t){if(!e)return[];var n=!1,r=[],i=[],o=[],a=!1,s=!1,u="",l=0;function c(){if(a&&!s)for(;o.length;)delete i[o.pop()];else o=[];a=!1,s=!1}var f,d,h;function p(N){if(typeof N=="string"&&(N=N.split(GV,2)),!ss(N)||N.length!==2)throw new Error("Invalid tags: "+N);f=new RegExp(fd(N[0])+"\\s*"),d=new RegExp("\\s*"+fd(N[1])),h=new RegExp("\\s*"+fd("}"+N[1]))}p(t||fr.tags);for(var v=new Lu(e),g,C,m,b,x,T;!v.eos();){if(g=v.pos,m=v.scanUntil(f),m)for(var E=0,A=m.length;E<A;++E)b=m.charAt(E),LV(b)?(o.push(i.length),u+=b):(s=!0,n=!0,u+=" "),i.push(["text",b,g,g+1]),g+=1,b===`
|
|
977
|
+
`&&(c(),u="",l=0,n=!1);if(!v.scan(f))break;if(a=!0,C=v.scan(WV)||"name",v.scan(UV),C==="="?(m=v.scanUntil(Gg),v.scan(Gg),v.scanUntil(d)):C==="{"?(m=v.scanUntil(h),v.scan(zV),v.scanUntil(d),C="&"):m=v.scanUntil(d),!v.scan(d))throw new Error("Unclosed tag at "+v.pos);if(C==">"?x=[C,m,g,v.pos,u,l,n]:x=[C,m,g,v.pos],l++,i.push(x),C==="#"||C==="^")r.push(x);else if(C==="/"){if(T=r.pop(),!T)throw new Error('Unopened section "'+m+'" at '+g);if(T[1]!==m)throw new Error('Unclosed section "'+T[1]+'" at '+g)}else C==="name"||C==="{"||C==="&"?s=!0:C==="="&&p(m)}if(c(),T=r.pop(),T)throw new Error('Unclosed section "'+T[1]+'" at '+v.pos);return YV(KV(i))}function KV(e){for(var t=[],n,r,i=0,o=e.length;i<o;++i)n=e[i],n&&(n[0]==="text"&&r&&r[0]==="text"?(r[1]+=n[1],r[3]=n[3]):(t.push(n),r=n));return t}function YV(e){for(var t=[],n=t,r=[],i,o,a=0,s=e.length;a<s;++a)switch(i=e[a],i[0]){case"#":case"^":n.push(i),r.push(i),n=i[4]=[];break;case"/":o=r.pop(),o[5]=i[2],n=r.length>0?r[r.length-1][4]:t;break;default:n.push(i)}return t}function Lu(e){this.string=e,this.tail=e,this.pos=0}Lu.prototype.eos=function(){return this.tail===""};Lu.prototype.scan=function(t){var n=this.tail.match(t);if(!n||n.index!==0)return"";var r=n[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};Lu.prototype.scanUntil=function(t){var n=this.tail.search(t),r;switch(n){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=r.length,r};function Da(e,t){this.view=e,this.cache={".":this.view},this.parent=t}Da.prototype.push=function(t){return new Da(t,this)};Da.prototype.lookup=function(t){var n=this.cache,r;if(n.hasOwnProperty(t))r=n[t];else{for(var i=this,o,a,s,u=!1;i;){if(t.indexOf(".")>0)for(o=i.view,a=t.split("."),s=0;o!=null&&s<a.length;)s===a.length-1&&(u=Ug(o,a[s])||jV(o,a[s])),o=o[a[s++]];else o=i.view[t],u=Ug(i.view,t);if(u){r=o;break}i=i.parent}n[t]=r}return tm(r)&&(r=r.call(this.view)),r};function Nn(){this.templateCache={_cache:{},set:function(t,n){this._cache[t]=n},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}Nn.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Nn.prototype.parse=function(t,n){var r=this.templateCache,i=t+":"+(n||fr.tags).join(":"),o=typeof r<"u",a=o?r.get(i):void 0;return a==null&&(a=HV(t,n),o&&r.set(i,a)),a};Nn.prototype.render=function(t,n,r,i){var o=this.getConfigTags(i),a=this.parse(t,o),s=n instanceof Da?n:new Da(n,void 0);return this.renderTokens(a,s,r,t,i)};Nn.prototype.renderTokens=function(t,n,r,i,o){for(var a="",s,u,l,c=0,f=t.length;c<f;++c)l=void 0,s=t[c],u=s[0],u==="#"?l=this.renderSection(s,n,r,i,o):u==="^"?l=this.renderInverted(s,n,r,i,o):u===">"?l=this.renderPartial(s,n,r,o):u==="&"?l=this.unescapedValue(s,n):u==="name"?l=this.escapedValue(s,n,o):u==="text"&&(l=this.rawValue(s)),l!==void 0&&(a+=l);return a};Nn.prototype.renderSection=function(t,n,r,i,o){var a=this,s="",u=n.lookup(t[1]);function l(d){return a.render(d,n,r,o)}if(u){if(ss(u))for(var c=0,f=u.length;c<f;++c)s+=this.renderTokens(t[4],n.push(u[c]),r,i,o);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")s+=this.renderTokens(t[4],n.push(u),r,i,o);else if(tm(u)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(n.view,i.slice(t[3],t[5]),l),u!=null&&(s+=u)}else s+=this.renderTokens(t[4],n,r,i,o);return s}};Nn.prototype.renderInverted=function(t,n,r,i,o){var a=n.lookup(t[1]);if(!a||ss(a)&&a.length===0)return this.renderTokens(t[4],n,r,i,o)};Nn.prototype.indentPartial=function(t,n,r){for(var i=n.replace(/[^ \t]/g,""),o=t.split(`
|
|
978
978
|
`),a=0;a<o.length;a++)o[a].length&&(a>0||!r)&&(o[a]=i+o[a]);return o.join(`
|
|
979
|
-
`)};Nn.prototype.renderPartial=function(t,n,r,i){if(r){var o=this.getConfigTags(i),a=
|
|
979
|
+
`)};Nn.prototype.renderPartial=function(t,n,r,i){if(r){var o=this.getConfigTags(i),a=tm(r)?r(t[1]):r[t[1]];if(a!=null){var s=t[6],u=t[5],l=t[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,s));var f=this.parse(c,o);return this.renderTokens(f,n,r,c,i)}}};Nn.prototype.unescapedValue=function(t,n){var r=n.lookup(t[1]);if(r!=null)return r};Nn.prototype.escapedValue=function(t,n,r){var i=this.getConfigEscape(r)||fr.escape,o=n.lookup(t[1]);if(o!=null)return typeof o=="number"&&i===fr.escape?String(o):i(o)};Nn.prototype.rawValue=function(t){return t[1]};Nn.prototype.getConfigTags=function(t){return ss(t)?t:t&&typeof t=="object"?t.tags:void 0};Nn.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!ss(t))return t.escape};var fr={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){hu.templateCache=e},get templateCache(){return hu.templateCache}},hu=new Nn;fr.clearCache=function(){return hu.clearCache()};fr.parse=function(t,n){return hu.parse(t,n)};fr.render=function(t,n,r,i){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+MV(t)+'" was given as the first argument for mustache#render(template, view, partials)');return hu.render(t,n,r,i)};fr.escape=BV;fr.Scanner=Lu;fr.Context=Da;fr.Writer=Nn;function ea(){}function JV(){return!0}function bs(e){return!!(e||"").match(/\d/)}function zg(e){return e==null}function Wg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function XV(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function QV(e,t,n){var r=XV(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function rh(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],a=i[1]||"";return{beforeDecimal:o,afterDecimal:a,hasNagation:n,addNegation:r}}function ZV(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function Vx(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function Hg(e,t){return Array(t+1).join(e)}function e5(e){e+="";var t=e[0]==="-"?"-":"";t&&(e=e.substring(1));var n=e.split(/[eE]/g),r=n[0],i=n[1];if(i=Number(i),!i)return t+r;r=r.replace(".","");var o=1+i,a=r.length;return o<0?r="0."+Hg("0",Math.abs(o))+r:o>=a?r=r+Hg("0",o-a):r=(r.substring(0,o)||"0")+"."+r.substring(o),t+r}function t5(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=e.indexOf(".")!==-1&&t,i=rh(e),o=i.beforeDecimal,a=i.afterDecimal,s=i.hasNagation,u=parseFloat("0."+(a||"0")),l=a.length<=t?"0."+a:u.toFixed(t),c=l.split("."),f=o.split("").reverse().reduce(function(v,g,C){return v.length>C?(Number(v[0])+Number(g)).toString()+v.substring(1,v.length):g+v},c[0]),d=Vx(c[1]||"",Math.min(t,a.length),n),h=s?"-":"",p=r?".":"";return""+h+f+p+d}function Kg(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function n5(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{start:n,end:i-r}}function dd(e,t,n){return Math.min(Math.max(e,t),n)}function Yg(e){return Math.max(e.selectionStart,e.selectionEnd)}function r5(e){return e||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function i5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)===-1&&(n[r]=e[r]);return n}var o5={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:ea,onChange:ea,onKeyDown:ea,onMouseUp:ea,onFocus:ea,onBlur:ea,isAllowed:JV},Bx=function(e){function t(n){e.call(this,n);var r=n.defaultValue;this.validateProps();var i=this.formatValueProp(r);this.state={value:i,numAsString:this.removeFormatting(i),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.componentDidMount=function(){this.setState({mounted:!0})},t.prototype.componentDidUpdate=function(r){this.updateValueIfRequired(r)},t.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},t.prototype.updateValueIfRequired=function(r){var i=this,o=i.props,a=i.state,s=i.focusedElm,u=a.value,l=a.numAsString;if(l===void 0&&(l=""),r!==o){this.validateProps();var c=this.formatNumString(l),f=zg(o.value)?c:this.formatValueProp(),d=this.removeFormatting(f),h=parseFloat(d),p=parseFloat(l);((!isNaN(h)||!isNaN(p))&&h!==p||c!==u||s===null&&f!==u)&&this.updateValue({formattedValue:f,numAsString:d,input:s,source:"prop",event:null})}},t.prototype.getFloatString=function(r){r===void 0&&(r="");var i=this.props,o=i.decimalScale,a=this.getSeparators(),s=a.decimalSeparator,u=this.getNumberRegex(!0),l=r[0]==="-";l&&(r=r.replace("-","")),s&&o===0&&(r=r.split(s)[0]),r=(r.match(u)||[]).join("").replace(s,".");var c=r.indexOf(".");return c!==-1&&(r=r.substring(0,c)+"."+r.substring(c+1,r.length).replace(new RegExp(Wg(s),"g"),"")),l&&(r="-"+r),r},t.prototype.getNumberRegex=function(r,i){var o=this.props,a=o.format,s=o.decimalScale,u=o.customNumerals,l=this.getSeparators(),c=l.decimalSeparator;return new RegExp("[0-9"+(u?u.join(""):"")+"]"+(c&&s!==0&&!i&&!a?"|"+Wg(c):""),r?"g":void 0)},t.prototype.getSeparators=function(){var r=this.props,i=r.decimalSeparator,o=this.props,a=o.thousandSeparator,s=o.allowedDecimalSeparators;return a===!0&&(a=","),s||(s=[i,"."]),{decimalSeparator:i,thousandSeparator:a,allowedDecimalSeparators:s}},t.prototype.getMaskAtIndex=function(r){var i=this.props,o=i.mask;return o===void 0&&(o=" "),typeof o=="string"?o:o[r]||" "},t.prototype.getValueObject=function(r,i){var o=parseFloat(i);return{formattedValue:r,value:i,floatValue:isNaN(o)?void 0:o}},t.prototype.validateProps=function(){var r=this.props,i=r.mask,o=this.getSeparators(),a=o.decimalSeparator,s=o.thousandSeparator;if(a===s)throw new Error(`
|
|
980
980
|
Decimal separator can't be same as thousand separator.
|
|
981
981
|
thousandSeparator: `+s+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
982
982
|
decimalSeparator: `+a+` (default value for decimalSeparator is .)
|
|
983
983
|
`);if(i){var u=i==="string"?i:i.toString();if(u.match(/\d/g))throw new Error(`
|
|
984
984
|
Mask `+i+` should not contain numeric character;
|
|
985
|
-
`)}},t.prototype.setPatchedCaretPosition=function(r,i,o){Hg(r,i),this.caretPositionTimeout=setTimeout(function(){r.value===o&&Hg(r,i)},0)},t.prototype.correctCaretPosition=function(r,i,o){var a=this.props,s=a.prefix,u=a.suffix,l=a.format;if(r==="")return 0;if(i=cd(i,0,r.length),!l){var c=r[0]==="-";return cd(i,s.length+(c?1:0),r.length-u.length)}if(typeof l=="function"||l[i]==="#"&&gs(r[i])||l[i-1]==="#"&&gs(r[i-1]))return i;var f=l.indexOf("#"),d=l.lastIndexOf("#");i=cd(i,f,d+1);for(var h=l.substring(i,l.length).indexOf("#"),p=i,v=i+(h===-1?0:h);p>f&&(l[p]!=="#"||!gs(r[p]));)p-=1;var g=!gs(r[v])||o==="left"&&i!==f||i-p<v-i;return g?gs(r[p])?p+1:p:v},t.prototype.getCaretPosition=function(r,i,o){var a=this.props,s=a.format,u=this.state.value,l=this.getNumberRegex(!0),c=(r.match(l)||[]).join(""),f=(i.match(l)||[]).join(""),d,h;for(d=0,h=0;h<o;h++){var p=r[h]||"",v=i[d]||"";if(!(!p.match(l)&&p!==v)&&!(p==="0"&&v.match(l)&&v!=="0"&&c.length!==f.length)){for(;p!==i[d]&&d<i.length;)d++;d++}}return typeof s=="string"&&!u&&(d=i.length),d=this.correctCaretPosition(i,d),d},t.prototype.removePrefixAndSuffix=function(r){var i=this.props,o=i.format,a=i.prefix,s=i.suffix;if(!o&&r){var u=r[0]==="-";u&&(r=r.substring(1,r.length)),r=a&&r.indexOf(a)===0?r.substring(a.length,r.length):r;var l=r.lastIndexOf(s);r=s&&l!==-1&&l===r.length-s.length?r.substring(0,l):r,u&&(r="-"+r)}return r},t.prototype.removePatternFormatting=function(r){for(var i=this.props,o=i.format,a=o.split("#").filter(function(h){return h!==""}),s=0,u="",l=0,c=a.length;l<=c;l++){var f=a[l]||"",d=l===c?r.length:r.indexOf(f,s);if(d===-1){u=r;break}else u+=r.substring(s,d),s=d+f.length}return(u.match(this.getNumberRegex(!0))||[]).join("")},t.prototype.removeFormatting=function(r){var i=this.props,o=i.format,a=i.removeFormatting;return r&&(o?typeof o=="string"?r=this.removePatternFormatting(r):typeof a=="function"?r=a(r):r=(r.match(this.getNumberRegex(!0))||[]).join(""):(r=this.removePrefixAndSuffix(r),r=this.getFloatString(r)),r)},t.prototype.formatWithPattern=function(r){for(var i=this.props,o=i.format,a=0,s=o.split(""),u=0,l=o.length;u<l;u++)o[u]==="#"&&(s[u]=r[a]||this.getMaskAtIndex(a),a+=1);return s.join("")},t.prototype.formatAsNumber=function(r){var i=this.props,o=i.decimalScale,a=i.fixedDecimalScale,s=i.prefix,u=i.suffix,l=i.allowNegative,c=i.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,h=f.decimalSeparator,p=r.indexOf(".")!==-1||o&&a,v=th(r,l),g=v.beforeDecimal,C=v.afterDecimal,m=v.addNegation;return o!==void 0&&(C=Lx(C,o,a)),d&&(g=XV(g,d,c)),s&&(g=s+g),u&&(C=C+u),m&&(g="-"+g),r=g+(p&&h||"")+C,r},t.prototype.formatNumString=function(r){r===void 0&&(r="");var i=this.props,o=i.format,a=i.allowEmptyFormatting,s=i.customNumerals,u=r;if(s&&s.length===10){var l=new RegExp("["+s.join("")+"]","g");u=r.replace(l,function(c){return s.indexOf(c).toString()})}return r===""&&!a?u="":r==="-"&&!o?u="-":typeof o=="string"?u=this.formatWithPattern(u):typeof o=="function"?u=o(u):u=this.formatAsNumber(u),u},t.prototype.formatValueProp=function(r){var i=this.props,o=i.format,a=i.decimalScale,s=i.fixedDecimalScale,u=i.allowEmptyFormatting,l=this.props,c=l.value,f=l.isNumericString;c=Gg(c)?r:c;var d=!c&&c!==0;if(d&&u&&(c=""),d&&!u)return"";typeof c=="number"&&(c=ZV(c),f=!0),c==="Infinity"&&f&&(c=""),f&&!o&&typeof a=="number"&&(c=e5(c,a,s));var h=f?this.formatNumString(c):this.formatInput(c);return h},t.prototype.formatNegation=function(r){r===void 0&&(r="");var i=this.props,o=i.allowNegative,a=new RegExp("(-)"),s=new RegExp("(-)(.)*(-)"),u=a.test(r),l=s.test(r);return r=r.replace(/-/g,""),u&&!l&&o&&(r="-"+r),r},t.prototype.formatInput=function(r){r===void 0&&(r="");var i=this.props,o=i.format;return o||(r=this.removePrefixAndSuffix(r),r=this.formatNegation(r)),r=this.removeFormatting(r),this.formatNumString(r)},t.prototype.isCharacterAFormat=function(r,i){var o=this.props,a=o.format,s=o.prefix,u=o.suffix,l=o.decimalScale,c=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[r]!=="#"||!a&&(r<s.length||r>=i.length-u.length||l&&c&&i[r]===d))},t.prototype.correctInputValue=function(r,i,o){var a=this,s=this.props,u=s.format,l=s.allowNegative,c=s.prefix,f=s.suffix,d=s.decimalScale,h=this.getSeparators(),p=h.allowedDecimalSeparators,v=h.decimalSeparator,g=this.state.numAsString||"",C=this.selectionBeforeInput,m=C.selectionStart,b=C.selectionEnd,x=t5(i,o),T=x.start,E=x.end;if(!u&&T===E&&p.indexOf(o[m])!==-1){var A=d===0?"":v;return o.substr(0,m)+A+o.substr(m+1,o.length)}var N=u?0:c.length,I=i.length-(u?0:f.length);if(o.length>i.length||!o.length||T===E||m===0&&b===i.length||T===0&&E===i.length||m===N&&b===I)return o;var P=i.substr(T,E-T),_=!![].concat(P).find(function(R,te){return a.isCharacterAFormat(te+T,i)});if(_){var L=i.substr(T),U={},Y=[];[].concat(L).forEach(function(R,te){a.isCharacterAFormat(te+T,i)?U[te]=R:te>P.length-1&&Y.push(R)}),Object.keys(U).forEach(function(R){Y.length>R?Y.splice(R,0,U[R]):Y.push(U[R])}),o=i.substr(0,T)+Y.join("")}if(!u){var k=this.removeFormatting(o),ie=th(k,l),B=ie.beforeDecimal,G=ie.afterDecimal,fe=ie.addNegation,j=r<o.indexOf(v)+1;if(k.length<g.length&&j&&B===""&&!parseFloat(G))return fe?"-":""}return o},t.prototype.updateValue=function(r){var i=r.formattedValue,o=r.input,a=r.setCaretPosition;a===void 0&&(a=!0);var s=r.source,u=r.event,l=r.numAsString,c=r.caretPos,f=this.props,d=f.onValueChange,h=this.state,p=h.value;if(o){if(c===void 0&&a){var v=r.inputValue||o.value,g=Kg(o);o.value=i,c=this.getCaretPosition(v,i,g)}o.value=i,a&&this.setPatchedCaretPosition(o,c,i)}l===void 0&&(l=this.removeFormatting(i)),i!==p&&(this.setState({value:i,numAsString:l}),d(this.getValueObject(i,l),{event:u,source:s}))},t.prototype.onChange=function(r){var i=r.target,o=i.value,a=this,s=a.state,u=a.props,l=u.isAllowed,c=s.value||"",f=Kg(i);o=this.correctInputValue(f,c,o);var d=this.formatInput(o)||"",h=this.removeFormatting(d),p=this.getValueObject(d,h),v=l(p);v||(d=c),this.updateValue({formattedValue:d,numAsString:h,inputValue:o,input:i,event:r,source:"event"}),v&&u.onChange(r)},t.prototype.onBlur=function(r){var i=this,o=i.props,a=i.state,s=o.format,u=o.onBlur,l=o.allowLeadingZeros,c=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(c))&&(c=""),l||(c=QV(c));var d=this.formatNumString(c);if(d!==f){this.updateValue({formattedValue:d,numAsString:c,input:r.target,setCaretPosition:!1,event:r,source:"event"}),u(r);return}}u(r)},t.prototype.onKeyDown=function(r){var i=r.target,o=r.key,a=i.selectionStart,s=i.selectionEnd,u=i.value;u===void 0&&(u="");var l,c=this.props,f=c.decimalScale,d=c.fixedDecimalScale,h=c.prefix,p=c.suffix,v=c.format,g=c.onKeyDown,C=f!==void 0&&d,m=this.getNumberRegex(!1,C),b=new RegExp("-"),x=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:s},o==="ArrowLeft"||o==="Backspace"?l=a-1:o==="ArrowRight"?l=a+1:o==="Delete"&&(l=a),l===void 0||a!==s){g(r);return}var T=l,E=x?v.indexOf("#"):h.length,A=x?v.lastIndexOf("#")+1:u.length-p.length;if(o==="ArrowLeft"||o==="ArrowRight"){var N=o==="ArrowLeft"?"left":"right";T=this.correctCaretPosition(u,l,N)}else if(o==="Delete"&&!m.test(u[l])&&!b.test(u[l]))for(;!m.test(u[T])&&T<A;)T++;else if(o==="Backspace"&&!m.test(u[l])){if(a<=E+1&&u[0]==="-"&&typeof v>"u"){var I=u.substring(1);this.updateValue({formattedValue:I,caretPos:T,input:i,event:r,source:"event"})}else if(!b.test(u[l])){for(;!m.test(u[T-1])&&T>E;)T--;T=this.correctCaretPosition(u,T,"left")}}(T!==l||l<E||l>A)&&(r.preventDefault(),this.setPatchedCaretPosition(i,T,u)),r.isUnitTestRun&&this.setPatchedCaretPosition(i,T,u),g(r)},t.prototype.onMouseUp=function(r){var i=r.target,o=i.selectionStart,a=i.selectionEnd,s=i.value;if(s===void 0&&(s=""),o===a){var u=this.correctCaretPosition(s,o);u!==o&&this.setPatchedCaretPosition(i,u,s)}this.props.onMouseUp(r)},t.prototype.onFocus=function(r){var i=this;r.persist(),this.focusedElm=r.target,this.focusTimeout=setTimeout(function(){var o=r.target,a=o.selectionStart,s=o.selectionEnd,u=o.value;u===void 0&&(u="");var l=i.correctCaretPosition(u,a);l!==a&&!(a===0&&s===u.length)&&i.setPatchedCaretPosition(o,l,u),i.props.onFocus(r)},0)},t.prototype.render=function(){var r=this.props,i=r.type,o=r.displayType,a=r.customInput,s=r.renderText,u=r.getInputRef,l=r.format;r.thousandSeparator,r.decimalSeparator,r.allowedDecimalSeparators,r.thousandsGroupStyle,r.decimalScale,r.fixedDecimalScale,r.prefix,r.suffix,r.removeFormatting,r.mask,r.defaultValue,r.isNumericString,r.allowNegative,r.allowEmptyFormatting,r.allowLeadingZeros,r.onValueChange,r.isAllowed,r.customNumerals,r.onChange,r.onKeyDown,r.onMouseUp,r.onFocus,r.onBlur,r.value;var c=r5(r,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"]),f=c,d=this.state,h=d.value,p=d.mounted,v=p&&n5(l)?"numeric":void 0,g=Object.assign({inputMode:v},f,{type:i,value:h,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return s?s(h,f)||null:O.createElement("span",Object.assign({},f,{ref:u}),h);if(a){var C=a;return O.createElement(C,Object.assign({},g,{ref:u}))}return O.createElement("input",Object.assign({},g,{ref:u}))},t}(O.Component);Vx.defaultProps=i5;function o5(e,t,n){var r=this,i=O.useRef(null),o=O.useRef(0),a=O.useRef(null),s=O.useRef([]),u=O.useRef(),l=O.useRef(),c=O.useRef(e),f=O.useRef(!0);O.useEffect(function(){c.current=e},[e]);var d=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var h=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,v="maxWait"in n,g=v?Math.max(+n.maxWait||0,t):null;O.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var C=O.useMemo(function(){var m=function(N){var I=s.current,P=u.current;return s.current=u.current=null,o.current=N,l.current=c.current.apply(P,I)},b=function(N,I){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(N):setTimeout(N,I)},x=function(N){if(!f.current)return!1;var I=N-i.current;return!i.current||I>=t||I<0||v&&N-o.current>=g},T=function(N){return a.current=null,p&&s.current?m(N):(s.current=u.current=null,l.current)},E=function N(){var I=Date.now();if(x(I))return T(I);if(f.current){var P=t-(I-i.current),_=v?Math.min(P,g-(I-o.current)):P;b(N,_)}},A=function(){var N=Date.now(),I=x(N);if(s.current=[].slice.call(arguments),u.current=r,i.current=N,I){if(!a.current&&f.current)return o.current=i.current,b(E,t),h?m(i.current):l.current;if(v)return b(E,t),m(i.current)}return a.current||b(E,t),l.current};return A.cancel=function(){a.current&&(d?cancelAnimationFrame(a.current):clearTimeout(a.current)),o.current=0,s.current=i.current=u.current=a.current=null},A.isPending=function(){return!!a.current},A.flush=function(){return a.current?T(Date.now()):l.current},A},[h,v,t,g,p,d]);return C}var Bx=function(){function e(t,n,r){this.r=0,this.g=0,this.b=0,this.set(t,n,r)}return e.prototype.set=function(t,n,r){this.r=this.clamp(t),this.g=this.clamp(n),this.b=this.clamp(r)},e.prototype.hueRotate=function(t){t===void 0&&(t=0),t=t/180*Math.PI;var n=Math.sin(t),r=Math.cos(t);this.multiply([.213+r*.787-n*.213,.715-r*.715-n*.715,.072-r*.072+n*.928,.213-r*.213+n*.143,.715+r*.285+n*.14,.072-r*.072-n*.283,.213-r*.213-n*.787,.715-r*.715+n*.715,.072+r*.928+n*.072])},e.prototype.grayscale=function(t){t===void 0&&(t=1),this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])},e.prototype.sepia=function(t){t===void 0&&(t=1),this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])},e.prototype.saturate=function(t){t===void 0&&(t=1),this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])},e.prototype.multiply=function(t){var n=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),r=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),i=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=n,this.g=r,this.b=i},e.prototype.brightness=function(t){t===void 0&&(t=1),this.linear(t)},e.prototype.contrast=function(t){t===void 0&&(t=1),this.linear(t,-(.5*t)+.5)},e.prototype.linear=function(t,n){t===void 0&&(t=1),n===void 0&&(n=0),this.r=this.clamp(this.r*t+n*255),this.g=this.clamp(this.g*t+n*255),this.b=this.clamp(this.b*t+n*255)},e.prototype.invert=function(t){t===void 0&&(t=1),this.r=this.clamp((t+this.r/255*(1-2*t))*255),this.g=this.clamp((t+this.g/255*(1-2*t))*255),this.b=this.clamp((t+this.b/255*(1-2*t))*255)},e.prototype.hsl=function(){var t=this.r/255,n=this.g/255,r=this.b/255,i=Math.max(t,n,r),o=Math.min(t,n,r),a=0,s=0,u=(i+o)/2;if(i===o)return{h:0,s:0,l:u*100};var l=i-o;return s=u>.5?l/(2-i-o):l/(i+o),i===t?a=(n-r)/l+(n<r?6:0):i===n?a=(r-t)/l+2:i===r&&(a=(t-n)/l+4),a/=6,{h:a*100,s:s*100,l:u*100}},e.prototype.clamp=function(t){return Math.min(Math.max(t,0),255)},e}(),a5=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new Bx(0,0,0)}return e.prototype.solve=function(){var t=this.solveNarrow(this.solveWide());return{values:t.values,called:t.called,loss:t.loss,filter:this.css(t.values)}},e.prototype.solveWide=function(){for(var t=5,n=15,r=[60,180,18e3,600,1.2,1.2],i={loss:1/0},o=0;i.loss>this.options.acceptanceLossPercentage;){var a=[50,20,3750,50,100,100],s=this.spsa({A:t,a:r,c:n,values:a,maxTriesInLoop:1e3});if(s.loss<i.loss&&(i=s),o+=1,o>=this.options.maxChecks)break}return Object.assign({},i,{called:o})},e.prototype.solveNarrow=function(t){var n=t.loss,r=2,i=n+1,o=[.25*i,.25*i,i,.25*i,.2*i,.2*i];return this.spsa({A:n,a:o,c:r,values:t.values,maxTriesInLoop:500,called:t.called})},e.prototype.fixValueByFilterIDX=function(t,n){var r=100;return n===2?r=7500:(n===4||n===5)&&(r=200),n===3?t>r?t%=r:t<0&&(t=r+t%r):t<0?t=0:t>r&&(t=r),t},e.prototype.spsa=function(t){for(var n=t.A,r=t.a,i=t.c,o=t.values,a=t.maxTriesInLoop,s=a===void 0?500:a,u=t.called,l=u===void 0?0:u,c=1,f=.16666666666666666,d=null,h=1/0,p=new Array(6),v=new Array(6),g=new Array(6),C=6,m=0;m<s;m++){for(var b=i/Math.pow(m+1,f),x=0;x<C;x++)p[x]=Math.random()>.5?1:-1,v[x]=o[x]+b*p[x],g[x]=o[x]-b*p[x];for(var T=this.loss(v)-this.loss(g),x=0;x<C;x++){var E=T/(2*b)*p[x],A=r[x]/Math.pow(n+m+1,c);o[x]=this.fixValueByFilterIDX(o[x]-A*E,x)}var N=this.loss(o);N<h&&(d=o.slice(0),h=N)}return{values:d,loss:h,called:l}},e.prototype.loss=function(t){var n=this.reusedColor;n.set(0,0,0),n.invert(t[0]/100),n.sepia(t[1]/100),n.saturate(t[2]/100),n.hueRotate(t[3]*3.6),n.brightness(t[4]/100),n.contrast(t[5]/100);var r=n.hsl();return Math.abs(n.r-this.target.r)+Math.abs(n.g-this.target.g)+Math.abs(n.b-this.target.b)+Math.abs(r.h-this.targetHSL.h)+Math.abs(r.s-this.targetHSL.s)+Math.abs(r.l-this.targetHSL.l)},e.prototype.css=function(t){var n=function(r,i){return i===void 0&&(i=1),Math.round(t[r]*i)};return["invert("+n(0)+"%)","sepia("+n(1)+"%)","saturate("+n(2)+"%)","hue-rotate("+n(3,3.6)+"deg)","brightness("+n(4)+"%)","contrast("+n(5)+"%);"].join(" ")},e}(),s5=function(e){return e.length===4?[parseInt("0x"+e[1]+e[1]),parseInt("0x"+e[2]+e[2]),parseInt("0x"+e[3]+e[3])]:e.length===7?[parseInt("0x"+e[1]+e[2]),parseInt("0x"+e[3]+e[4]),parseInt("0x"+e[5]+e[6])]:[]},fd=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},dd={},u5=function(e,t){var n;t===void 0&&(t={});var r,i,o;if(dd[e]&&!t.forceFilterRecalculation)return Object.assign({},dd[e],{cache:!0});var a;try{if(n=wq(s5(e),3),r=n[0],i=n[1],o=n[2],!fd(r)||!fd(i)||!fd(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new Bx(Number(r),Number(i),Number(o))}catch(u){throw new Error("Color value should be in HEX format. "+u)}var s=new a5(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return dd[e]=Object.assign({},s.solve(),{hex:e,rgb:[r,i,o],cache:!1})};const l5=(e,t,n,r)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+r;function c5(e,t,n,r){let i=(e+(r||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=f5(e);if(!o)throw new TypeError("Invalid or unsupported color format.");i=!1,[e,t,n,r]=o}else r!==void 0&&(r=Number.parseFloat(r));if(typeof e!="number"||typeof t!="number"||typeof n!="number"||e>255||t>255||n>255)throw new TypeError("Expected three numbers below 256");if(typeof r=="number"){if(!i&&r>=0&&r<=1)r=Math.round(255*r);else if(i&&r>=0&&r<=100)r=Math.round(255*r/100);else throw new TypeError(`Expected alpha value (${r}) as a fraction or percentage`);r=(r|256).toString(16).slice(1)}else r="";return l5(e,t,n,r)}const f5=e=>{const t=e.replace(/rgba?\(([^)]+)\)/,"$1").split(/[,\s/]+/).filter(Boolean);if(t.length<3)return;const n=(s,u)=>(s=s.trim(),s.endsWith("%")?Math.min(Number.parseFloat(s)*u/100,u):Math.min(Number.parseFloat(s),u)),r=n(t[0],255),i=n(t[1],255),o=n(t[2],255);let a;return t.length===4&&(a=n(t[3],1)),[r,i,o,a]},d5=/[\p{Lu}]/u,p5=/[\p{Ll}]/u,Yg=/^[\p{Lu}](?![\p{Lu}])/gu,Ux=/([\p{Alpha}\p{N}_]|$)/u,em=/[_.\- ]+/,h5=new RegExp("^"+em.source),Jg=new RegExp(em.source+Ux.source,"gu"),Xg=new RegExp("\\d+"+Ux.source,"gu"),v5=(e,t,n,r)=>{let i=!1,o=!1,a=!1,s=!1;for(let u=0;u<e.length;u++){const l=e[u];s=u>2?e[u-3]==="-":!0,i&&d5.test(l)?(e=e.slice(0,u)+"-"+e.slice(u),i=!1,a=o,o=!0,u++):o&&a&&p5.test(l)&&(!s||r)?(e=e.slice(0,u-1)+"-"+e.slice(u-1),a=o,o=!1,i=!0):(i=t(l)===l&&n(l)!==l,a=o,o=n(l)===l&&t(l)!==l)}return e},m5=(e,t)=>(Yg.lastIndex=0,e.replaceAll(Yg,n=>t(n))),y5=(e,t)=>(Jg.lastIndex=0,Xg.lastIndex=0,e.replaceAll(Xg,(n,r,i)=>["_","-"].includes(e.charAt(i+n.length))?n:t(n)).replaceAll(Jg,(n,r)=>t(r)));function g5(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(o=>o.trim()).filter(o=>o.length).join("-"):e=e.trim(),e.length===0)return"";const n=t.locale===!1?o=>o.toLowerCase():o=>o.toLocaleLowerCase(t.locale),r=t.locale===!1?o=>o.toUpperCase():o=>o.toLocaleUpperCase(t.locale);return e.length===1?em.test(e)?"":t.pascalCase?r(e):n(e):(e!==n(e)&&(e=v5(e,n,r,t.preserveConsecutiveUppercase)),e=e.replace(h5,""),e=t.preserveConsecutiveUppercase?m5(e,n):n(e),t.pascalCase&&(e=r(e.charAt(0))+e.slice(1)),y5(e,r))}function b5(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function S5(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),b5(e)}function Gt(){return D.RenderTarget.current()!==D.RenderTarget.preview}function C5(e){if(Gt())return null;const{error:t}=Dv();if(!t)return null;switch(t.type){case pt.ConfigurationModelNotFound:return O.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:$.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case pt.ConfigurationUnauthenticated:return O.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:$.jsx("span",{children:"The HCA access token is invalid."});case pt.SpecifiedDeploymentForbidden:return O.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:$.jsx("span",{children:"The HCA access token does not permit using the specified Configuration Model."});case pt.DecisionsToRespectInvalid:return $.jsx("span",{children:"The definition of Attribute Relations is invalid."});default:return O.Children.toArray(e.errorContent).length>0?e.errorContent:$.jsx("span",{children:"An error occurred while initializing the configuration."})}}function Er(e){return O.forwardRef((t,n)=>$.jsx(Sq,{fallbackRender:()=>$.jsx("span",{children:"Component crashed"}),children:$.jsx(e,{...t,ref:n})}))}const w5=Mu`
|
|
985
|
+
`)}},t.prototype.setPatchedCaretPosition=function(r,i,o){Kg(r,i),this.caretPositionTimeout=setTimeout(function(){r.value===o&&Kg(r,i)},0)},t.prototype.correctCaretPosition=function(r,i,o){var a=this.props,s=a.prefix,u=a.suffix,l=a.format;if(r==="")return 0;if(i=dd(i,0,r.length),!l){var c=r[0]==="-";return dd(i,s.length+(c?1:0),r.length-u.length)}if(typeof l=="function"||l[i]==="#"&&bs(r[i])||l[i-1]==="#"&&bs(r[i-1]))return i;var f=l.indexOf("#"),d=l.lastIndexOf("#");i=dd(i,f,d+1);for(var h=l.substring(i,l.length).indexOf("#"),p=i,v=i+(h===-1?0:h);p>f&&(l[p]!=="#"||!bs(r[p]));)p-=1;var g=!bs(r[v])||o==="left"&&i!==f||i-p<v-i;return g?bs(r[p])?p+1:p:v},t.prototype.getCaretPosition=function(r,i,o){var a=this.props,s=a.format,u=this.state.value,l=this.getNumberRegex(!0),c=(r.match(l)||[]).join(""),f=(i.match(l)||[]).join(""),d,h;for(d=0,h=0;h<o;h++){var p=r[h]||"",v=i[d]||"";if(!(!p.match(l)&&p!==v)&&!(p==="0"&&v.match(l)&&v!=="0"&&c.length!==f.length)){for(;p!==i[d]&&d<i.length;)d++;d++}}return typeof s=="string"&&!u&&(d=i.length),d=this.correctCaretPosition(i,d),d},t.prototype.removePrefixAndSuffix=function(r){var i=this.props,o=i.format,a=i.prefix,s=i.suffix;if(!o&&r){var u=r[0]==="-";u&&(r=r.substring(1,r.length)),r=a&&r.indexOf(a)===0?r.substring(a.length,r.length):r;var l=r.lastIndexOf(s);r=s&&l!==-1&&l===r.length-s.length?r.substring(0,l):r,u&&(r="-"+r)}return r},t.prototype.removePatternFormatting=function(r){for(var i=this.props,o=i.format,a=o.split("#").filter(function(h){return h!==""}),s=0,u="",l=0,c=a.length;l<=c;l++){var f=a[l]||"",d=l===c?r.length:r.indexOf(f,s);if(d===-1){u=r;break}else u+=r.substring(s,d),s=d+f.length}return(u.match(this.getNumberRegex(!0))||[]).join("")},t.prototype.removeFormatting=function(r){var i=this.props,o=i.format,a=i.removeFormatting;return r&&(o?typeof o=="string"?r=this.removePatternFormatting(r):typeof a=="function"?r=a(r):r=(r.match(this.getNumberRegex(!0))||[]).join(""):(r=this.removePrefixAndSuffix(r),r=this.getFloatString(r)),r)},t.prototype.formatWithPattern=function(r){for(var i=this.props,o=i.format,a=0,s=o.split(""),u=0,l=o.length;u<l;u++)o[u]==="#"&&(s[u]=r[a]||this.getMaskAtIndex(a),a+=1);return s.join("")},t.prototype.formatAsNumber=function(r){var i=this.props,o=i.decimalScale,a=i.fixedDecimalScale,s=i.prefix,u=i.suffix,l=i.allowNegative,c=i.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,h=f.decimalSeparator,p=r.indexOf(".")!==-1||o&&a,v=rh(r,l),g=v.beforeDecimal,C=v.afterDecimal,m=v.addNegation;return o!==void 0&&(C=Vx(C,o,a)),d&&(g=QV(g,d,c)),s&&(g=s+g),u&&(C=C+u),m&&(g="-"+g),r=g+(p&&h||"")+C,r},t.prototype.formatNumString=function(r){r===void 0&&(r="");var i=this.props,o=i.format,a=i.allowEmptyFormatting,s=i.customNumerals,u=r;if(s&&s.length===10){var l=new RegExp("["+s.join("")+"]","g");u=r.replace(l,function(c){return s.indexOf(c).toString()})}return r===""&&!a?u="":r==="-"&&!o?u="-":typeof o=="string"?u=this.formatWithPattern(u):typeof o=="function"?u=o(u):u=this.formatAsNumber(u),u},t.prototype.formatValueProp=function(r){var i=this.props,o=i.format,a=i.decimalScale,s=i.fixedDecimalScale,u=i.allowEmptyFormatting,l=this.props,c=l.value,f=l.isNumericString;c=zg(c)?r:c;var d=!c&&c!==0;if(d&&u&&(c=""),d&&!u)return"";typeof c=="number"&&(c=e5(c),f=!0),c==="Infinity"&&f&&(c=""),f&&!o&&typeof a=="number"&&(c=t5(c,a,s));var h=f?this.formatNumString(c):this.formatInput(c);return h},t.prototype.formatNegation=function(r){r===void 0&&(r="");var i=this.props,o=i.allowNegative,a=new RegExp("(-)"),s=new RegExp("(-)(.)*(-)"),u=a.test(r),l=s.test(r);return r=r.replace(/-/g,""),u&&!l&&o&&(r="-"+r),r},t.prototype.formatInput=function(r){r===void 0&&(r="");var i=this.props,o=i.format;return o||(r=this.removePrefixAndSuffix(r),r=this.formatNegation(r)),r=this.removeFormatting(r),this.formatNumString(r)},t.prototype.isCharacterAFormat=function(r,i){var o=this.props,a=o.format,s=o.prefix,u=o.suffix,l=o.decimalScale,c=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[r]!=="#"||!a&&(r<s.length||r>=i.length-u.length||l&&c&&i[r]===d))},t.prototype.correctInputValue=function(r,i,o){var a=this,s=this.props,u=s.format,l=s.allowNegative,c=s.prefix,f=s.suffix,d=s.decimalScale,h=this.getSeparators(),p=h.allowedDecimalSeparators,v=h.decimalSeparator,g=this.state.numAsString||"",C=this.selectionBeforeInput,m=C.selectionStart,b=C.selectionEnd,x=n5(i,o),T=x.start,E=x.end;if(!u&&T===E&&p.indexOf(o[m])!==-1){var A=d===0?"":v;return o.substr(0,m)+A+o.substr(m+1,o.length)}var N=u?0:c.length,I=i.length-(u?0:f.length);if(o.length>i.length||!o.length||T===E||m===0&&b===i.length||T===0&&E===i.length||m===N&&b===I)return o;var P=i.substr(T,E-T),_=!![].concat(P).find(function(R,te){return a.isCharacterAFormat(te+T,i)});if(_){var L=i.substr(T),U={},Y=[];[].concat(L).forEach(function(R,te){a.isCharacterAFormat(te+T,i)?U[te]=R:te>P.length-1&&Y.push(R)}),Object.keys(U).forEach(function(R){Y.length>R?Y.splice(R,0,U[R]):Y.push(U[R])}),o=i.substr(0,T)+Y.join("")}if(!u){var k=this.removeFormatting(o),ie=rh(k,l),B=ie.beforeDecimal,G=ie.afterDecimal,fe=ie.addNegation,j=r<o.indexOf(v)+1;if(k.length<g.length&&j&&B===""&&!parseFloat(G))return fe?"-":""}return o},t.prototype.updateValue=function(r){var i=r.formattedValue,o=r.input,a=r.setCaretPosition;a===void 0&&(a=!0);var s=r.source,u=r.event,l=r.numAsString,c=r.caretPos,f=this.props,d=f.onValueChange,h=this.state,p=h.value;if(o){if(c===void 0&&a){var v=r.inputValue||o.value,g=Yg(o);o.value=i,c=this.getCaretPosition(v,i,g)}o.value=i,a&&this.setPatchedCaretPosition(o,c,i)}l===void 0&&(l=this.removeFormatting(i)),i!==p&&(this.setState({value:i,numAsString:l}),d(this.getValueObject(i,l),{event:u,source:s}))},t.prototype.onChange=function(r){var i=r.target,o=i.value,a=this,s=a.state,u=a.props,l=u.isAllowed,c=s.value||"",f=Yg(i);o=this.correctInputValue(f,c,o);var d=this.formatInput(o)||"",h=this.removeFormatting(d),p=this.getValueObject(d,h),v=l(p);v||(d=c),this.updateValue({formattedValue:d,numAsString:h,inputValue:o,input:i,event:r,source:"event"}),v&&u.onChange(r)},t.prototype.onBlur=function(r){var i=this,o=i.props,a=i.state,s=o.format,u=o.onBlur,l=o.allowLeadingZeros,c=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(c))&&(c=""),l||(c=ZV(c));var d=this.formatNumString(c);if(d!==f){this.updateValue({formattedValue:d,numAsString:c,input:r.target,setCaretPosition:!1,event:r,source:"event"}),u(r);return}}u(r)},t.prototype.onKeyDown=function(r){var i=r.target,o=r.key,a=i.selectionStart,s=i.selectionEnd,u=i.value;u===void 0&&(u="");var l,c=this.props,f=c.decimalScale,d=c.fixedDecimalScale,h=c.prefix,p=c.suffix,v=c.format,g=c.onKeyDown,C=f!==void 0&&d,m=this.getNumberRegex(!1,C),b=new RegExp("-"),x=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:s},o==="ArrowLeft"||o==="Backspace"?l=a-1:o==="ArrowRight"?l=a+1:o==="Delete"&&(l=a),l===void 0||a!==s){g(r);return}var T=l,E=x?v.indexOf("#"):h.length,A=x?v.lastIndexOf("#")+1:u.length-p.length;if(o==="ArrowLeft"||o==="ArrowRight"){var N=o==="ArrowLeft"?"left":"right";T=this.correctCaretPosition(u,l,N)}else if(o==="Delete"&&!m.test(u[l])&&!b.test(u[l]))for(;!m.test(u[T])&&T<A;)T++;else if(o==="Backspace"&&!m.test(u[l])){if(a<=E+1&&u[0]==="-"&&typeof v>"u"){var I=u.substring(1);this.updateValue({formattedValue:I,caretPos:T,input:i,event:r,source:"event"})}else if(!b.test(u[l])){for(;!m.test(u[T-1])&&T>E;)T--;T=this.correctCaretPosition(u,T,"left")}}(T!==l||l<E||l>A)&&(r.preventDefault(),this.setPatchedCaretPosition(i,T,u)),r.isUnitTestRun&&this.setPatchedCaretPosition(i,T,u),g(r)},t.prototype.onMouseUp=function(r){var i=r.target,o=i.selectionStart,a=i.selectionEnd,s=i.value;if(s===void 0&&(s=""),o===a){var u=this.correctCaretPosition(s,o);u!==o&&this.setPatchedCaretPosition(i,u,s)}this.props.onMouseUp(r)},t.prototype.onFocus=function(r){var i=this;r.persist(),this.focusedElm=r.target,this.focusTimeout=setTimeout(function(){var o=r.target,a=o.selectionStart,s=o.selectionEnd,u=o.value;u===void 0&&(u="");var l=i.correctCaretPosition(u,a);l!==a&&!(a===0&&s===u.length)&&i.setPatchedCaretPosition(o,l,u),i.props.onFocus(r)},0)},t.prototype.render=function(){var r=this.props,i=r.type,o=r.displayType,a=r.customInput,s=r.renderText,u=r.getInputRef,l=r.format;r.thousandSeparator,r.decimalSeparator,r.allowedDecimalSeparators,r.thousandsGroupStyle,r.decimalScale,r.fixedDecimalScale,r.prefix,r.suffix,r.removeFormatting,r.mask,r.defaultValue,r.isNumericString,r.allowNegative,r.allowEmptyFormatting,r.allowLeadingZeros,r.onValueChange,r.isAllowed,r.customNumerals,r.onChange,r.onKeyDown,r.onMouseUp,r.onFocus,r.onBlur,r.value;var c=i5(r,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"]),f=c,d=this.state,h=d.value,p=d.mounted,v=p&&r5(l)?"numeric":void 0,g=Object.assign({inputMode:v},f,{type:i,value:h,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return s?s(h,f)||null:O.createElement("span",Object.assign({},f,{ref:u}),h);if(a){var C=a;return O.createElement(C,Object.assign({},g,{ref:u}))}return O.createElement("input",Object.assign({},g,{ref:u}))},t}(O.Component);Bx.defaultProps=o5;function a5(e,t,n){var r=this,i=O.useRef(null),o=O.useRef(0),a=O.useRef(null),s=O.useRef([]),u=O.useRef(),l=O.useRef(),c=O.useRef(e),f=O.useRef(!0);O.useEffect(function(){c.current=e},[e]);var d=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var h=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,v="maxWait"in n,g=v?Math.max(+n.maxWait||0,t):null;O.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var C=O.useMemo(function(){var m=function(N){var I=s.current,P=u.current;return s.current=u.current=null,o.current=N,l.current=c.current.apply(P,I)},b=function(N,I){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(N):setTimeout(N,I)},x=function(N){if(!f.current)return!1;var I=N-i.current;return!i.current||I>=t||I<0||v&&N-o.current>=g},T=function(N){return a.current=null,p&&s.current?m(N):(s.current=u.current=null,l.current)},E=function N(){var I=Date.now();if(x(I))return T(I);if(f.current){var P=t-(I-i.current),_=v?Math.min(P,g-(I-o.current)):P;b(N,_)}},A=function(){var N=Date.now(),I=x(N);if(s.current=[].slice.call(arguments),u.current=r,i.current=N,I){if(!a.current&&f.current)return o.current=i.current,b(E,t),h?m(i.current):l.current;if(v)return b(E,t),m(i.current)}return a.current||b(E,t),l.current};return A.cancel=function(){a.current&&(d?cancelAnimationFrame(a.current):clearTimeout(a.current)),o.current=0,s.current=i.current=u.current=a.current=null},A.isPending=function(){return!!a.current},A.flush=function(){return a.current?T(Date.now()):l.current},A},[h,v,t,g,p,d]);return C}var Ux=function(){function e(t,n,r){this.r=0,this.g=0,this.b=0,this.set(t,n,r)}return e.prototype.set=function(t,n,r){this.r=this.clamp(t),this.g=this.clamp(n),this.b=this.clamp(r)},e.prototype.hueRotate=function(t){t===void 0&&(t=0),t=t/180*Math.PI;var n=Math.sin(t),r=Math.cos(t);this.multiply([.213+r*.787-n*.213,.715-r*.715-n*.715,.072-r*.072+n*.928,.213-r*.213+n*.143,.715+r*.285+n*.14,.072-r*.072-n*.283,.213-r*.213-n*.787,.715-r*.715+n*.715,.072+r*.928+n*.072])},e.prototype.grayscale=function(t){t===void 0&&(t=1),this.multiply([.2126+.7874*(1-t),.7152-.7152*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t)])},e.prototype.sepia=function(t){t===void 0&&(t=1),this.multiply([.393+.607*(1-t),.769-.769*(1-t),.189-.189*(1-t),.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t)])},e.prototype.saturate=function(t){t===void 0&&(t=1),this.multiply([.213+.787*t,.715-.715*t,.072-.072*t,.213-.213*t,.715+.285*t,.072-.072*t,.213-.213*t,.715-.715*t,.072+.928*t])},e.prototype.multiply=function(t){var n=this.clamp(this.r*t[0]+this.g*t[1]+this.b*t[2]),r=this.clamp(this.r*t[3]+this.g*t[4]+this.b*t[5]),i=this.clamp(this.r*t[6]+this.g*t[7]+this.b*t[8]);this.r=n,this.g=r,this.b=i},e.prototype.brightness=function(t){t===void 0&&(t=1),this.linear(t)},e.prototype.contrast=function(t){t===void 0&&(t=1),this.linear(t,-(.5*t)+.5)},e.prototype.linear=function(t,n){t===void 0&&(t=1),n===void 0&&(n=0),this.r=this.clamp(this.r*t+n*255),this.g=this.clamp(this.g*t+n*255),this.b=this.clamp(this.b*t+n*255)},e.prototype.invert=function(t){t===void 0&&(t=1),this.r=this.clamp((t+this.r/255*(1-2*t))*255),this.g=this.clamp((t+this.g/255*(1-2*t))*255),this.b=this.clamp((t+this.b/255*(1-2*t))*255)},e.prototype.hsl=function(){var t=this.r/255,n=this.g/255,r=this.b/255,i=Math.max(t,n,r),o=Math.min(t,n,r),a=0,s=0,u=(i+o)/2;if(i===o)return{h:0,s:0,l:u*100};var l=i-o;return s=u>.5?l/(2-i-o):l/(i+o),i===t?a=(n-r)/l+(n<r?6:0):i===n?a=(r-t)/l+2:i===r&&(a=(t-n)/l+4),a/=6,{h:a*100,s:s*100,l:u*100}},e.prototype.clamp=function(t){return Math.min(Math.max(t,0),255)},e}(),s5=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new Ux(0,0,0)}return e.prototype.solve=function(){var t=this.solveNarrow(this.solveWide());return{values:t.values,called:t.called,loss:t.loss,filter:this.css(t.values)}},e.prototype.solveWide=function(){for(var t=5,n=15,r=[60,180,18e3,600,1.2,1.2],i={loss:1/0},o=0;i.loss>this.options.acceptanceLossPercentage;){var a=[50,20,3750,50,100,100],s=this.spsa({A:t,a:r,c:n,values:a,maxTriesInLoop:1e3});if(s.loss<i.loss&&(i=s),o+=1,o>=this.options.maxChecks)break}return Object.assign({},i,{called:o})},e.prototype.solveNarrow=function(t){var n=t.loss,r=2,i=n+1,o=[.25*i,.25*i,i,.25*i,.2*i,.2*i];return this.spsa({A:n,a:o,c:r,values:t.values,maxTriesInLoop:500,called:t.called})},e.prototype.fixValueByFilterIDX=function(t,n){var r=100;return n===2?r=7500:(n===4||n===5)&&(r=200),n===3?t>r?t%=r:t<0&&(t=r+t%r):t<0?t=0:t>r&&(t=r),t},e.prototype.spsa=function(t){for(var n=t.A,r=t.a,i=t.c,o=t.values,a=t.maxTriesInLoop,s=a===void 0?500:a,u=t.called,l=u===void 0?0:u,c=1,f=.16666666666666666,d=null,h=1/0,p=new Array(6),v=new Array(6),g=new Array(6),C=6,m=0;m<s;m++){for(var b=i/Math.pow(m+1,f),x=0;x<C;x++)p[x]=Math.random()>.5?1:-1,v[x]=o[x]+b*p[x],g[x]=o[x]-b*p[x];for(var T=this.loss(v)-this.loss(g),x=0;x<C;x++){var E=T/(2*b)*p[x],A=r[x]/Math.pow(n+m+1,c);o[x]=this.fixValueByFilterIDX(o[x]-A*E,x)}var N=this.loss(o);N<h&&(d=o.slice(0),h=N)}return{values:d,loss:h,called:l}},e.prototype.loss=function(t){var n=this.reusedColor;n.set(0,0,0),n.invert(t[0]/100),n.sepia(t[1]/100),n.saturate(t[2]/100),n.hueRotate(t[3]*3.6),n.brightness(t[4]/100),n.contrast(t[5]/100);var r=n.hsl();return Math.abs(n.r-this.target.r)+Math.abs(n.g-this.target.g)+Math.abs(n.b-this.target.b)+Math.abs(r.h-this.targetHSL.h)+Math.abs(r.s-this.targetHSL.s)+Math.abs(r.l-this.targetHSL.l)},e.prototype.css=function(t){var n=function(r,i){return i===void 0&&(i=1),Math.round(t[r]*i)};return["invert("+n(0)+"%)","sepia("+n(1)+"%)","saturate("+n(2)+"%)","hue-rotate("+n(3,3.6)+"deg)","brightness("+n(4)+"%)","contrast("+n(5)+"%);"].join(" ")},e}(),u5=function(e){return e.length===4?[parseInt("0x"+e[1]+e[1]),parseInt("0x"+e[2]+e[2]),parseInt("0x"+e[3]+e[3])]:e.length===7?[parseInt("0x"+e[1]+e[2]),parseInt("0x"+e[3]+e[4]),parseInt("0x"+e[5]+e[6])]:[]},pd=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},hd={},l5=function(e,t){var n;t===void 0&&(t={});var r,i,o;if(hd[e]&&!t.forceFilterRecalculation)return Object.assign({},hd[e],{cache:!0});var a;try{if(n=xq(u5(e),3),r=n[0],i=n[1],o=n[2],!pd(r)||!pd(i)||!pd(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new Ux(Number(r),Number(i),Number(o))}catch(u){throw new Error("Color value should be in HEX format. "+u)}var s=new s5(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return hd[e]=Object.assign({},s.solve(),{hex:e,rgb:[r,i,o],cache:!1})};const c5=(e,t,n,r)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+r;function f5(e,t,n,r){let i=(e+(r||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=d5(e);if(!o)throw new TypeError("Invalid or unsupported color format.");i=!1,[e,t,n,r]=o}else r!==void 0&&(r=Number.parseFloat(r));if(typeof e!="number"||typeof t!="number"||typeof n!="number"||e>255||t>255||n>255)throw new TypeError("Expected three numbers below 256");if(typeof r=="number"){if(!i&&r>=0&&r<=1)r=Math.round(255*r);else if(i&&r>=0&&r<=100)r=Math.round(255*r/100);else throw new TypeError(`Expected alpha value (${r}) as a fraction or percentage`);r=(r|256).toString(16).slice(1)}else r="";return c5(e,t,n,r)}const d5=e=>{const t=e.replace(/rgba?\(([^)]+)\)/,"$1").split(/[,\s/]+/).filter(Boolean);if(t.length<3)return;const n=(s,u)=>(s=s.trim(),s.endsWith("%")?Math.min(Number.parseFloat(s)*u/100,u):Math.min(Number.parseFloat(s),u)),r=n(t[0],255),i=n(t[1],255),o=n(t[2],255);let a;return t.length===4&&(a=n(t[3],1)),[r,i,o,a]},p5=/[\p{Lu}]/u,h5=/[\p{Ll}]/u,Jg=/^[\p{Lu}](?![\p{Lu}])/gu,Gx=/([\p{Alpha}\p{N}_]|$)/u,nm=/[_.\- ]+/,v5=new RegExp("^"+nm.source),Xg=new RegExp(nm.source+Gx.source,"gu"),Qg=new RegExp("\\d+"+Gx.source,"gu"),m5=(e,t,n,r)=>{let i=!1,o=!1,a=!1,s=!1;for(let u=0;u<e.length;u++){const l=e[u];s=u>2?e[u-3]==="-":!0,i&&p5.test(l)?(e=e.slice(0,u)+"-"+e.slice(u),i=!1,a=o,o=!0,u++):o&&a&&h5.test(l)&&(!s||r)?(e=e.slice(0,u-1)+"-"+e.slice(u-1),a=o,o=!1,i=!0):(i=t(l)===l&&n(l)!==l,a=o,o=n(l)===l&&t(l)!==l)}return e},y5=(e,t)=>(Jg.lastIndex=0,e.replaceAll(Jg,n=>t(n))),g5=(e,t)=>(Xg.lastIndex=0,Qg.lastIndex=0,e.replaceAll(Qg,(n,r,i)=>["_","-"].includes(e.charAt(i+n.length))?n:t(n)).replaceAll(Xg,(n,r)=>t(r)));function b5(e,t){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");if(t={pascalCase:!1,preserveConsecutiveUppercase:!1,...t},Array.isArray(e)?e=e.map(o=>o.trim()).filter(o=>o.length).join("-"):e=e.trim(),e.length===0)return"";const n=t.locale===!1?o=>o.toLowerCase():o=>o.toLocaleLowerCase(t.locale),r=t.locale===!1?o=>o.toUpperCase():o=>o.toLocaleUpperCase(t.locale);return e.length===1?nm.test(e)?"":t.pascalCase?r(e):n(e):(e!==n(e)&&(e=m5(e,n,r,t.preserveConsecutiveUppercase)),e=e.replace(v5,""),e=t.preserveConsecutiveUppercase?y5(e,n):n(e),t.pascalCase&&(e=r(e.charAt(0))+e.slice(1)),g5(e,r))}function S5(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r<e.length;r++){var i=e[r];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(r>0&&(i=i.replace(/^[\/]+/,"")),r<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var o=t.join("/");o=o.replace(/\/(\?|&|#[^!])/g,"$1");var a=o.split("?");return o=a.shift()+(a.length>0?"?":"")+a.join("&"),o}function C5(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),S5(e)}function Gt(){return D.RenderTarget.current()!==D.RenderTarget.preview}function w5(e){if(Gt())return null;const{error:t}=Pv();if(!t)return null;switch(t.type){case pt.ConfigurationModelNotFound:return O.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:$.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case pt.ConfigurationUnauthenticated:return O.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:$.jsx("span",{children:"The HCA access token is invalid."});case pt.SpecifiedDeploymentForbidden:return O.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:$.jsx("span",{children:"The HCA access token does not permit using the specified Configuration Model."});case pt.DecisionsToRespectInvalid:return $.jsx("span",{children:"The definition of Attribute Relations is invalid."});default:return O.Children.toArray(e.errorContent).length>0?e.errorContent:$.jsx("span",{children:"An error occurred while initializing the configuration."})}}function hr(e){return O.forwardRef((t,n)=>$.jsx(Cq,{fallbackRender:()=>$.jsx("span",{children:"Component crashed"}),children:$.jsx(e,{...t,ref:n})}))}const x5=ju`
|
|
986
986
|
:root {
|
|
987
987
|
--font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
988
988
|
--font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
|
|
@@ -1001,7 +1001,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1001
1001
|
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
1002
1002
|
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
1003
1003
|
}
|
|
1004
|
-
`,x5
|
|
1004
|
+
`,T5=x5,E5=ju`
|
|
1005
1005
|
:root {
|
|
1006
1006
|
--space-unit: 1em;
|
|
1007
1007
|
--space-xxs: calc(0.25 * var(--space-unit));
|
|
@@ -1021,14 +1021,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1021
1021
|
--space-xl-fixed: calc(3.25 * var(--space-unit-fixed));
|
|
1022
1022
|
--space-xxl-fixed: calc(5.25 * var(--space-unit-fixed));
|
|
1023
1023
|
}
|
|
1024
|
-
`,E5
|
|
1024
|
+
`,I5=E5,A5=ju`
|
|
1025
1025
|
:root {
|
|
1026
1026
|
--shape-border-radius-xs: 5px;
|
|
1027
1027
|
--shape-border-radius-sm: 7px;
|
|
1028
1028
|
--shape-border-radius-md: 12px;
|
|
1029
1029
|
--shape-border-radius-lg: 20px;
|
|
1030
1030
|
}
|
|
1031
|
-
|
|
1031
|
+
`,$5=A5,O5=ju`
|
|
1032
1032
|
:root {
|
|
1033
1033
|
--shadows-popover: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4));
|
|
1034
1034
|
--shadows-dialog: 0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02),
|
|
@@ -1040,7 +1040,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1040
1040
|
13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061),
|
|
1041
1041
|
40px 68px 96px rgba(0, 0, 0, 0.1);
|
|
1042
1042
|
}
|
|
1043
|
-
`,O5
|
|
1043
|
+
`,D5=O5;function Zg(){return $.jsxs($.Fragment,{children:[$.jsx(D5,{}),$.jsx($5,{}),$.jsx(I5,{}),$.jsx(T5,{})]})}const vu=O.createContext(null);function di(){const{process:e,switchMode:t,applySolution:n,dismiss:r}=O.useContext(vu);return e?{...e,switchMode:t,applySolution:n,dismiss:r}:null}function zx(e){const{explanation:t,...n}=e,r=di();return $.jsx("button",{...n,onClick:()=>r.applySolution(t.solution),children:e.children})}function Wx(e,t,n){return H(e).returnType().with({type:V.Choice},r=>t[r.choiceValueId]??r.choiceValueId).with({type:V.Boolean,state:!0},()=>n.booleanDecisionStateTrueLabel).with({type:V.Boolean,state:!1},()=>n.booleanDecisionStateFalseLabel).with({type:V.Component,state:Ge.Included},()=>n.componentDecisionStateIncludedLabel).with({type:V.Component,state:Ge.Excluded},()=>n.componentDecisionStateExcludedLabel).with({type:V.Numeric},r=>r.state.toString()).exhaustive()}const Hx={applySolutionButtonCaption:{title:"Apply Solution Button Caption",type:D.ControlType.String,defaultValue:"Apply Solution"},configurationSubjectTitle:{title:"Configuration Subject Title",type:D.ControlType.String,defaultValue:"Configuration"},generalConflictTitle:{title:"General Conflict Title",type:D.ControlType.String,defaultValue:"Conflict"},componentDecisionStateIncludedLabel:{title:"Component Decision State Included Label",type:D.ControlType.String,defaultValue:"Included"},componentDecisionStateExcludedLabel:{title:"Component Decision State Excluded Label",type:D.ControlType.String,defaultValue:"Excluded"},booleanDecisionStateTrueLabel:{title:"Boolean Decision State True Label",type:D.ControlType.String,defaultValue:"Yes"},booleanDecisionStateFalseLabel:{title:"Boolean Decision State False Label",type:D.ControlType.String,defaultValue:"No"},isBlockedSuffix:{title:"Is Blocked Suffix",type:D.ControlType.String,defaultValue:"is blocked"},isNotSatisfiedSuffix:{title:"Is Not Satisfied Suffix",type:D.ControlType.String,defaultValue:"is not satisfied"}},N5={fill:{title:"Fill",type:D.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:D.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:D.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:D.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:D.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:D.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:D.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:D.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:D.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},solutionTitle:{title:"Solution Title",type:D.ControlType.String,defaultValue:"Solution"},showMoreButtonCaption:{title:"Show More Button Caption",type:D.ControlType.String,defaultValue:"Show more ({{amount}})"},showConstraintsButtonCaption:{title:"Show Constraints Button Caption",type:D.ControlType.String,defaultValue:"Show Constraints"},...Hx},rm=O.createContext(null),im=()=>O.useContext(rm),P5={fill:{title:"Fill",type:D.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:D.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:D.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:D.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:D.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:D.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:D.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:D.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:D.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:D.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:D.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:D.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:D.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:D.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:D.ControlType.String,defaultValue:"blur(10px) saturate(200%)"},decisionExplanationSolutionsTitle:{title:"Decision Explanation Solutions Title",type:D.ControlType.String,defaultValue:"Solutions"},constraintExplanationSolutionsTitle:{title:"Constraint Explanation Solutions Title",type:D.ControlType.String,defaultValue:"Constraint Explanations"},...Hx},om=O.createContext(null),Kx=()=>O.useContext(om),R5=()=>O.useContext(rm)||O.useContext(om),am=R5,k5=Ae.div`
|
|
1044
1044
|
display: flex;
|
|
1045
1045
|
gap: var(--space-xs);
|
|
1046
1046
|
align-items: center;
|
|
@@ -1051,7 +1051,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1051
1051
|
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1052
1052
|
font-weight: 500;
|
|
1053
1053
|
min-width: 0;
|
|
1054
|
-
`,
|
|
1054
|
+
`,M5=Ae.div`
|
|
1055
1055
|
display: grid;
|
|
1056
1056
|
place-content: center;
|
|
1057
1057
|
border-top-left-radius: 360px;
|
|
@@ -1069,11 +1069,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1069
1069
|
background-color: var(--color-explain-attribute-value-remove-fill);
|
|
1070
1070
|
color: var(--color-explain-attribute-value-remove-color);
|
|
1071
1071
|
}
|
|
1072
|
-
`,
|
|
1072
|
+
`,j5=Ae.div`
|
|
1073
1073
|
white-space: nowrap;
|
|
1074
1074
|
overflow: hidden;
|
|
1075
1075
|
text-overflow: ellipsis;
|
|
1076
|
-
`;function
|
|
1076
|
+
`;function _5(e){const{decision:t,choiceValuesNames:n}=e,r=t.intention,i=am(),o=Wx(t,n,i);return $.jsxs(k5,{children:[$.jsxs(M5,{className:`mode-${r}`,children:[r==="remove"&&$.jsx(zi,{icon:$F}),r==="add"&&$.jsx(zi,{icon:OF})]}),$.jsx(j5,{children:o})]})}function tn(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}const Pf=O.createContext(null);function Rf(e){const{attributes:t}=O.useContext(Pf),{activeLocale:n}=D.useLocaleInfo(),r=n.code;return O.useMemo(()=>y(t,Pt(i=>Pu(tn(i),e)),K(i=>i.name),rv,Ha,sm(r),Et),[t,r,e.localId,e.componentPath,e.sharedConfigurationModelId])}function Vu(e){const{choiceValues:t}=O.useContext(Pf),{activeLocale:n}=D.useLocaleInfo(),r=rs(e);if(!r)return{};const i=O.useMemo(()=>y(t,Vt(s=>Pu(tn(s),e))),[t,e.localId,e.componentPath,e.sharedConfigurationModelId]),o=n.code,a=r.attribute.values;return O.useMemo(()=>y(a,z(s=>y(i,Pt(u=>u.choiceValueId===s.id),K(u=>u.name),rv,Ha,sm(o),K(u=>[s.id,u]))),qn,sR),[a,i,o])}function Yx(e,t){const{choiceValues:n}=O.useContext(Pf),{activeLocale:r}=D.useLocaleInfo(),i=r.code;return O.useMemo(()=>y(n,Pt(o=>Pu(tn(o),e)&&o.choiceValueId===t),K(o=>o.name),rv,Ha,sm(i),Et),[n,i,e.localId,e.componentPath,e.sharedConfigurationModelId,t])}function sm(e){return Ln(Pt(t=>t.localeCode.localeCompare(e,void 0,{sensitivity:"accent"})===0),K(t=>t.translation))}const q5=Ae.div`
|
|
1077
1077
|
display: grid;
|
|
1078
1078
|
grid-template-columns: subgrid;
|
|
1079
1079
|
grid-column: span 2;
|
|
@@ -1089,16 +1089,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1089
1089
|
flex-wrap: wrap;
|
|
1090
1090
|
min-width: 0;
|
|
1091
1091
|
gap: var(--space-xxs);
|
|
1092
|
-
`;function V5(e){const{decisions:t}=e,n=t[0].attributeId,r=
|
|
1092
|
+
`;function V5(e){const{decisions:t}=e,n=t[0].attributeId,r=Vu(n),i=Rf(n),o=am(),a=y(tu,ni(u=>Wx(u,r,o))),s=y(t,sf(a));return $.jsxs(q5,{children:[$.jsx(F5,{children:i??n.localId}),$.jsx(L5,{children:s.map((u,l)=>$.jsx(_5,{decision:u,choiceValuesNames:r},l))})]})}function B5(e){const t=e.sharedConfigurationModelId&&`shared::${e.sharedConfigurationModelId}`,n=(e.componentPath??[]).join("::");return[t,n,e.localId].filter(r=>(r==null?void 0:r.length)>0).join("::")}const U5=y(tu,ni(e=>e.attributeId.localId));function Jx(e){const{blockingDecisions:t,desiredDecisions:n,...r}=e,i=y([...n.map(o=>({...o,intention:"add"})),...t.map(o=>({...o,intention:"remove"}))],XC(o=>B5(o.attributeId)),dv(A2)((o,a)=>({key:o,attributeId:QC(a).attributeId,decisions:a})),sf(U5));return $.jsx("div",{...r,children:i.map(o=>$.jsx(V5,{decisions:o.decisions},o.key))})}const G5=Ae.div`
|
|
1093
1093
|
background-color: var(--color-explain-dialog-explanation-card);
|
|
1094
1094
|
padding: var(--space-sm-fixed);
|
|
1095
1095
|
box-shadow: 2px 1px 10px -5px rgba(0, 0, 0, 0.4);
|
|
1096
1096
|
border-radius: var(--shape-border-radius-sm);
|
|
1097
|
-
`,
|
|
1097
|
+
`,Xx=G5,z5=Ae(Jx)`
|
|
1098
1098
|
display: grid;
|
|
1099
1099
|
grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr);
|
|
1100
1100
|
gap: var(--space-sm);
|
|
1101
|
-
`,W5=Ae(
|
|
1101
|
+
`,W5=Ae(zx)`
|
|
1102
1102
|
border-radius: var(--shape-border-radius-sm);
|
|
1103
1103
|
background-color: var(--color-explain-dialog-apply-solution-button-fill);
|
|
1104
1104
|
color: var(--color-explain-dialog-apply-solution-button-color);
|
|
@@ -1115,7 +1115,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1115
1115
|
outline: 2px solid var(--color-explain-dialog-apply-solution-button-outline);
|
|
1116
1116
|
outline-offset: 1px;
|
|
1117
1117
|
}
|
|
1118
|
-
`;function H5(e){const{explanation:t}=e,{applySolutionButtonCaption:n}=
|
|
1118
|
+
`;function H5(e){const{explanation:t}=e,{applySolutionButtonCaption:n}=Kx(),r=t.solution.decisions.filter(i=>i.state!=null);return $.jsxs(Xx,{children:[$.jsx(z5,{blockingDecisions:t.causedByDecisions,desiredDecisions:r}),$.jsx(W5,{explanation:t,children:n})]})}const K5=Ae(Xx)`
|
|
1119
1119
|
ul {
|
|
1120
1120
|
margin: 0;
|
|
1121
1121
|
}
|
|
@@ -1125,20 +1125,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1125
1125
|
list-style-type: none;
|
|
1126
1126
|
margin-inline-start: 0;
|
|
1127
1127
|
padding-inline-start: 0;
|
|
1128
|
-
`,
|
|
1128
|
+
`,eb=Ae.ul`
|
|
1129
1129
|
list-style-type: disc;
|
|
1130
1130
|
margin-inline-start: 0;
|
|
1131
1131
|
padding-inline-start: var(--space-lg);
|
|
1132
|
-
`,
|
|
1132
|
+
`,tb=Ae.li`
|
|
1133
1133
|
font-size: 0.9em;
|
|
1134
1134
|
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1135
1135
|
font-weight: 500;
|
|
1136
|
-
`;function J5(e){const{explanation:t}=e,n=t.causedByCardinalities,r=y(t.causedByRules,
|
|
1136
|
+
`;function J5(e){const{explanation:t}=e,n=t.causedByCardinalities,r=y(t.causedByRules,XC(i=>i.configurationModelId),dv(tu)((i,o)=>({configurationModelId:i,rules:y(o,z(a=>a.localId),sf(tu))})));return $.jsx(K5,{children:$.jsxs(Y5,{children:[r.map(i=>$.jsxs("li",{children:[$.jsx("span",{children:i.configurationModelId}),$.jsx(eb,{children:i.rules.map(o=>$.jsx(tb,{children:o}))})]})),n.length>0&&$.jsxs("li",{children:[$.jsx("span",{children:"Cardinality"}),$.jsx(eb,{children:n.map(i=>$.jsx(tb,{children:i.localId}))})]})]})})}function Qx(e){const{variant:t,...n}=e,{explainQuestion:r}=di(),i=H(r).returnType().with({question:Ft.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:Ft.whyIsNotSatisfied,subject:Ue.configuration},()=>"why your configuration is not satisfied").with({question:Ft.whyIsNotSatisfied,subject:Ue.attribute},()=>"why your attribute is not satisfied").with(qe.nullish,()=>"why your selections are not possible").exhaustive(),o=H(t).returnType().with("failedToExplain",()=>$.jsxs($.Fragment,{children:["Failed to explain ",i,".",$.jsx("br",{}),"Please check your internet connection and try again."]})).with("noExplanationFound",()=>$.jsxs($.Fragment,{children:["There was no explanation found for ",i,"."]})).with("noSolutionFound",()=>$.jsxs($.Fragment,{children:["There was no solution found for ",i,"."]})).exhaustive();return $.jsx("div",{...n,children:o})}const nb=Ae.div`
|
|
1137
1137
|
font-weight: 500;
|
|
1138
1138
|
font-family: var(--font-heading);
|
|
1139
1139
|
margin-bottom: var(--space-xs);
|
|
1140
1140
|
margin-left: var(--space-sm-fixed);
|
|
1141
|
-
`,
|
|
1141
|
+
`,rb=Ae.div`
|
|
1142
1142
|
display: flex;
|
|
1143
1143
|
flex-direction: column;
|
|
1144
1144
|
gap: var(--space-xs);
|
|
@@ -1146,27 +1146,27 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1146
1146
|
display: flex;
|
|
1147
1147
|
flex-direction: column;
|
|
1148
1148
|
gap: var(--space-md);
|
|
1149
|
-
`,
|
|
1149
|
+
`,ib=Ae(Qx)`
|
|
1150
1150
|
width: min-content;
|
|
1151
1151
|
min-width: 400px;
|
|
1152
1152
|
margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
|
|
1153
|
-
`;function Q5(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Xi(),{decisionExplanationSolutionsTitle:r,constraintExplanationSolutionsTitle:i}=Hx();return n?$.jsx(rb,{variant:"failedToExplain"}):e.length===0&&t.length===0?$.jsx(rb,{variant:"noExplanationFound"}):$.jsxs(X5,{children:[e.length>0&&$.jsxs("div",{children:[$.jsx(tb,{children:r}),$.jsx(nb,{children:e.map(o=>$.jsx(H5,{explanation:o},e.indexOf(o)))})]}),t.length>0&&$.jsxs("div",{children:[$.jsx(tb,{children:i}),$.jsx(nb,{children:t.map(o=>$.jsx(J5,{explanation:o},t.indexOf(o)))})]})]})}function oi(e){return Xx(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function li(e){var t;return(t=(Xx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Xx(e){return e instanceof Node||e instanceof er(e).Node}function Lt(e){return e instanceof Element||e instanceof er(e).Element}function On(e){return e instanceof HTMLElement||e instanceof er(e).HTMLElement}function nh(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function Lu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Z5(e){return["table","td","th"].includes(oi(e))}function sm(e){const t=um(),n=tr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Qx(e){let t=Ro(e);for(;On(t)&&!Na(t);){if(sm(t))return t;t=Ro(t)}return null}function um(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Na(e){return["html","body","#document"].includes(oi(e))}function tr(e){return er(e).getComputedStyle(e)}function Rf(e){return Lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ro(e){if(oi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||nh(e)&&e.host||li(e);return nh(t)?t.host:t}function Zx(e){const t=Ro(e);return Na(t)?e.ownerDocument?e.ownerDocument.body:e.body:On(t)&&Lu(t)?t:Zx(t)}function ki(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Zx(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=er(i);return o?t.concat(a,a.visualViewport||[],Lu(i)?i:[],a.frameElement&&n?ki(a.frameElement):[]):t.concat(i,ki(i,[],n))}function aa(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Hn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&nh(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function e1(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function t1(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function e3(e){return e.mozInputSource===0&&e.isTrusted?!0:rh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function t3(e){return r3()?!1:!rh()&&e.width===0&&e.height===0||rh()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function n3(){return/apple/i.test(navigator.vendor)}function rh(){const e=/android/i;return e.test(e1())||e.test(t1())}function r3(){return t1().includes("jsdom/")}function ib(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function i3(e){return"nativeEvent"in e}function o3(e){return e.matches("html,body")}function Wr(e){return(e==null?void 0:e.ownerDocument)||document}function pd(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function sa(e){return"composedPath"in e?e.composedPath()[0]:e.target}const a3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function n1(e){return On(e)&&e.matches(a3)}function hd(e){e.preventDefault(),e.stopPropagation()}function s3(e){return e?e.getAttribute("role")==="combobox"&&n1(e):!1}const Pa=Math.min,So=Math.max,Cc=Math.round,Sl=Math.floor,zi=e=>({x:e,y:e}),u3={left:"right",right:"left",bottom:"top",top:"bottom"},l3={start:"end",end:"start"};function ih(e,t,n){return So(e,Pa(t,n))}function Vu(e,t){return typeof e=="function"?e(t):e}function ko(e){return e.split("-")[0]}function Bu(e){return e.split("-")[1]}function r1(e){return e==="x"?"y":"x"}function lm(e){return e==="y"?"height":"width"}function kf(e){return["top","bottom"].includes(ko(e))?"y":"x"}function cm(e){return r1(kf(e))}function c3(e,t,n){n===void 0&&(n=!1);const r=Bu(e),i=cm(e),o=lm(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=wc(a)),[a,wc(a)]}function f3(e){const t=wc(e);return[oh(e),t,oh(t)]}function oh(e){return e.replace(/start|end/g,t=>l3[t])}function d3(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function p3(e,t,n,r){const i=Bu(e);let o=d3(ko(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(oh)))),o}function wc(e){return e.replace(/left|right|bottom|top/g,t=>u3[t])}function h3(e){return{top:0,right:0,bottom:0,left:0,...e}}function i1(e){return typeof e!="number"?h3(e):{top:e,right:e,bottom:e,left:e}}function xc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ob(e,t,n){let{reference:r,floating:i}=e;const o=kf(t),a=cm(t),s=lm(a),u=ko(t),l=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[s]/2-i[s]/2;let h;switch(u){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Bu(t)){case"start":h[a]-=d*(n&&l?-1:1);break;case"end":h[a]+=d*(n&&l?-1:1);break}return h}const v3=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=ob(l,r,u),d=r,h={},p=0;for(let v=0;v<s.length;v++){const{name:g,fn:C}=s[v],{x:m,y:b,data:x,reset:T}=await C({x:c,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});c=m??c,f=b??f,h={...h,[g]:{...h[g],...x}},T&&p<=50&&(p++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(l=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:c,y:f}=ob(l,d,u)),v=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:h}};async function o1(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Vu(t,e),p=i1(h),v=s[d?f==="floating"?"reference":"floating":f],g=xc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:l,rootBoundary:c,strategy:u})),C=f==="floating"?{...a.floating,x:r,y:i}:a.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),b=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},x=xc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:m,strategy:u}):C);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}const m3=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:c=0}=Vu(e,t)||{};if(l==null)return{};const f=i1(c),d={x:n,y:r},h=cm(i),p=lm(h),v=await a.getDimensions(l),g=h==="y",C=g?"top":"left",m=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[h]-d[h]-o.floating[p],T=d[h]-o.reference[h],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let A=E?E[b]:0;(!A||!await(a.isElement==null?void 0:a.isElement(E)))&&(A=s.floating[b]||o.floating[p]);const N=x/2-T/2,I=A/2-v[p]/2-1,P=Pa(f[C],I),_=Pa(f[m],I),L=P,U=A-v[p]-_,Y=A/2-v[p]/2+N,k=ih(L,Y,U),ie=!u.arrow&&Bu(i)!=null&&Y!==k&&o.reference[p]/2-(Y<L?P:_)-v[p]/2<0,B=ie?Y<L?Y-L:Y-U:0;return{[h]:d[h]+B,data:{[h]:k,centerOffset:Y-k-B,...ie&&{alignmentOffset:B}},reset:ie}}}),y3=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=Vu(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=ko(i),m=ko(s)===s,b=await(u.isRTL==null?void 0:u.isRTL(l.floating)),x=d||(m||!v?[wc(s)]:f3(s));!d&&p!=="none"&&x.push(...p3(s,v,p,b));const T=[s,...x],E=await o1(t,g),A=[];let N=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(E[C]),f){const L=c3(i,a,b);A.push(E[L[0]],E[L[1]])}if(N=[...N,{placement:i,overflows:A}],!A.every(L=>L<=0)){var I,P;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,U=T[L];if(U)return{data:{index:L,overflows:N},reset:{placement:U}};let Y=(P=N.filter(k=>k.overflows[0]<=0).sort((k,ie)=>k.overflows[1]-ie.overflows[1])[0])==null?void 0:P.placement;if(!Y)switch(h){case"bestFit":{var _;const k=(_=N.map(ie=>[ie.placement,ie.overflows.filter(B=>B>0).reduce((B,G)=>B+G,0)]).sort((ie,B)=>ie[1]-B[1])[0])==null?void 0:_[0];k&&(Y=k);break}case"initialPlacement":Y=s;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};async function g3(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ko(n),s=Bu(n),u=kf(n)==="y",l=["left","top"].includes(a)?-1:1,c=o&&u?-1:1,f=Vu(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),u?{x:h*c,y:d*l}:{x:d*l,y:h*c}}const b3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await g3(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},S3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:C,y:m}=g;return{x:C,y:m}}},...u}=Vu(e,t),l={x:n,y:r},c=await o1(t,u),f=kf(ko(i)),d=r1(f);let h=l[d],p=l[f];if(o){const g=d==="y"?"top":"left",C=d==="y"?"bottom":"right",m=h+c[g],b=h-c[C];h=ih(m,h,b)}if(a){const g=f==="y"?"top":"left",C=f==="y"?"bottom":"right",m=p+c[g],b=p-c[C];p=ih(m,p,b)}const v=s.fn({...t,[d]:h,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function a1(e){const t=tr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=On(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Cc(n)!==o||Cc(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function fm(e){return Lt(e)?e:e.contextElement}function wa(e){const t=fm(e);if(!On(t))return zi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=a1(t);let a=(o?Cc(n.width):n.width)/r,s=(o?Cc(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const C3=zi(0);function s1(e){const t=er(e);return!um()||!t.visualViewport?C3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function w3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==er(e)?!1:t}function Mo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=fm(e);let a=zi(1);t&&(r?Lt(r)&&(a=wa(r)):a=wa(e));const s=w3(o,n,r)?s1(o):zi(0);let u=(i.left+s.x)/a.x,l=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=er(o),h=r&&Lt(r)?er(r):r;let p=d.frameElement;for(;p&&r&&h!==d;){const v=wa(p),g=p.getBoundingClientRect(),C=tr(p),m=g.left+(p.clientLeft+parseFloat(C.paddingLeft))*v.x,b=g.top+(p.clientTop+parseFloat(C.paddingTop))*v.y;u*=v.x,l*=v.y,c*=v.x,f*=v.y,u+=m,l+=b,p=er(p).frameElement}}return xc({width:c,height:f,x:u,y:l})}const x3=[":popover-open",":modal"];function u1(e){let t=!1,n=0,r=0;function i(o){try{t=t||e.matches(o)}catch{}}if(x3.forEach(o=>{i(o)}),t){const o=Qx(e);if(o){const a=o.getBoundingClientRect();n=a.x,r=a.y}}return[t,n,r]}function T3(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=li(r),[a]=t?u1(t.floating):[!1];if(r===o||a)return n;let s={scrollLeft:0,scrollTop:0},u=zi(1);const l=zi(0),c=On(r);if((c||!c&&i!=="fixed")&&((oi(r)!=="body"||Lu(o))&&(s=Rf(r)),On(r))){const f=Mo(r);u=wa(r),l.x=f.x+r.clientLeft,l.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+l.x,y:n.y*u.y-s.scrollTop*u.y+l.y}}function E3(e){return Array.from(e.getClientRects())}function l1(e){return Mo(li(e)).left+Rf(e).scrollLeft}function I3(e){const t=li(e),n=Rf(e),r=e.ownerDocument.body,i=So(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=So(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+l1(e);const s=-n.scrollTop;return tr(r).direction==="rtl"&&(a+=So(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function A3(e,t){const n=er(e),r=li(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const l=um();(!l||l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function $3(e,t){const n=Mo(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=On(e)?wa(e):zi(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,l=r*o.y;return{width:a,height:s,x:u,y:l}}function ab(e,t,n){let r;if(t==="viewport")r=A3(e,n);else if(t==="document")r=I3(li(e));else if(Lt(t))r=$3(t,n);else{const i=s1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return xc(r)}function c1(e,t){const n=Ro(e);return n===t||!Lt(n)||Na(n)?!1:tr(n).position==="fixed"||c1(n,t)}function O3(e,t){const n=t.get(e);if(n)return n;let r=ki(e,[],!1).filter(s=>Lt(s)&&oi(s)!=="body"),i=null;const o=tr(e).position==="fixed";let a=o?Ro(e):e;for(;Lt(a)&&!Na(a);){const s=tr(a),u=sm(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&i&&["absolute","fixed"].includes(i.position)||Lu(a)&&!u&&c1(e,a))?r=r.filter(l=>l!==a):i=s,a=Ro(a)}return t.set(e,r),r}function D3(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?O3(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((u,l)=>{const c=ab(t,l,i);return u.top=So(c.top,u.top),u.right=Pa(c.right,u.right),u.bottom=Pa(c.bottom,u.bottom),u.left=So(c.left,u.left),u},ab(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function N3(e){const{width:t,height:n}=a1(e);return{width:t,height:n}}function P3(e,t,n,r){const i=On(t),o=li(t),a=n==="fixed",s=Mo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const l=zi(0);if(i||!i&&!a)if((oi(t)!=="body"||Lu(o))&&(u=Rf(t)),i){const v=Mo(t,!0,a,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else o&&(l.x=l1(o));let c=s.left+u.scrollLeft-l.x,f=s.top+u.scrollTop-l.y;const[d,h,p]=u1(r);return d&&(c+=h,f+=p,i&&(c+=t.clientLeft,f+=t.clientTop)),{x:c,y:f,width:s.width,height:s.height}}function sb(e,t){return!On(e)||tr(e).position==="fixed"?null:t?t(e):e.offsetParent}function f1(e,t){const n=er(e);if(!On(e))return n;let r=sb(e,t);for(;r&&Z5(r)&&tr(r).position==="static";)r=sb(r,t);return r&&(oi(r)==="html"||oi(r)==="body"&&tr(r).position==="static"&&!sm(r))?n:r||Qx(e)||n}const R3=async function(e){const t=this.getOffsetParent||f1,n=this.getDimensions;return{reference:P3(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function k3(e){return tr(e).direction==="rtl"}const d1={convertOffsetParentRelativeRectToViewportRelativeRect:T3,getDocumentElement:li,getClippingRect:D3,getOffsetParent:f1,getElementRects:R3,getClientRects:E3,getDimensions:N3,getScale:wa,isElement:Lt,isRTL:k3};function M3(e,t){let n=null,r;const i=li(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const{left:l,top:c,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const h=Sl(c),p=Sl(i.clientWidth-(l+f)),v=Sl(i.clientHeight-(c+d)),g=Sl(l),C={rootMargin:-h+"px "+-p+"px "+-v+"px "+-g+"px",threshold:So(0,Pa(1,u))||1};let m=!0;function b(x){const T=x[0].intersectionRatio;if(T!==u){if(!m)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},100)}m=!1}try{n=new IntersectionObserver(b,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,C)}n.observe(e)}return a(!0),o}function j3(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=fm(e),c=i||o?[...l?ki(l):[],...ki(t)]:[];c.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const f=l&&s?M3(l,n):null;let d=-1,h=null;a&&(h=new ResizeObserver(C=>{let[m]=C;m&&m.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let p,v=u?Mo(e):null;u&&g();function g(){const C=Mo(e);v&&(C.x!==v.x||C.y!==v.y||C.width!==v.width||C.height!==v.height)&&n(),v=C,p=requestAnimationFrame(g)}return n(),()=>{var C;c.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(C=h)==null||C.disconnect(),h=null,u&&cancelAnimationFrame(p)}}const _3=S3,q3=y3,ub=m3,F3=(e,t,n)=>{const r=new Map,i={platform:d1,...n},o={...i.platform,_c:r};return v3(e,t,{...i,platform:o})},L3=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?ub({element:r.current,padding:i}).fn(n):{}:r?ub({element:r,padding:i}).fn(n):{}}}};var zl=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Tc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Tc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Tc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function p1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lb(e,t){const n=p1(e);return Math.round(t*n)/n}function cb(e){const t=J.useRef(e);return zl(()=>{t.current=e}),t}function V3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[c,f]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=J.useState(r);Tc(d,r)||h(r);const[p,v]=J.useState(null),[g,C]=J.useState(null),m=J.useCallback(B=>{B!==E.current&&(E.current=B,v(B))},[]),b=J.useCallback(B=>{B!==A.current&&(A.current=B,C(B))},[]),x=o||p,T=a||g,E=J.useRef(null),A=J.useRef(null),N=J.useRef(c),I=u!=null,P=cb(u),_=cb(i),L=J.useCallback(()=>{if(!E.current||!A.current)return;const B={placement:t,strategy:n,middleware:d};_.current&&(B.platform=_.current),F3(E.current,A.current,B).then(G=>{const fe={...G,isPositioned:!0};U.current&&!Tc(N.current,fe)&&(N.current=fe,gT.flushSync(()=>{f(fe)}))})},[d,t,n,_]);zl(()=>{l===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[l]);const U=J.useRef(!1);zl(()=>(U.current=!0,()=>{U.current=!1}),[]),zl(()=>{if(x&&(E.current=x),T&&(A.current=T),x&&T){if(P.current)return P.current(x,T,L);L()}},[x,T,L,P,I]);const Y=J.useMemo(()=>({reference:E,floating:A,setReference:m,setFloating:b}),[m,b]),k=J.useMemo(()=>({reference:x,floating:T}),[x,T]),ie=J.useMemo(()=>{const B={position:n,left:0,top:0};if(!k.floating)return B;const G=lb(k.floating,c.x),fe=lb(k.floating,c.y);return s?{...B,transform:"translate("+G+"px, "+fe+"px)",...p1(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:fe}},[n,s,k.floating,c.x,c.y]);return J.useMemo(()=>({...c,update:L,refs:Y,elements:k,floatingStyles:ie}),[c,L,Y,k,ie])}/*!
|
|
1153
|
+
`;function Q5(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=di(),{decisionExplanationSolutionsTitle:r,constraintExplanationSolutionsTitle:i}=Kx();return n?$.jsx(ib,{variant:"failedToExplain"}):e.length===0&&t.length===0?$.jsx(ib,{variant:"noExplanationFound"}):$.jsxs(X5,{children:[e.length>0&&$.jsxs("div",{children:[$.jsx(nb,{children:r}),$.jsx(rb,{children:e.map(o=>$.jsx(H5,{explanation:o},e.indexOf(o)))})]}),t.length>0&&$.jsxs("div",{children:[$.jsx(nb,{children:i}),$.jsx(rb,{children:t.map(o=>$.jsx(J5,{explanation:o},t.indexOf(o)))})]})]})}function ui(e){return Zx(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pi(e){var t;return(t=(Zx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zx(e){return e instanceof Node||e instanceof er(e).Node}function Lt(e){return e instanceof Element||e instanceof er(e).Element}function On(e){return e instanceof HTMLElement||e instanceof er(e).HTMLElement}function ih(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function Bu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=tr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Z5(e){return["table","td","th"].includes(ui(e))}function um(e){const t=lm(),n=tr(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function e1(e){let t=Ro(e);for(;On(t)&&!Na(t);){if(um(t))return t;t=Ro(t)}return null}function lm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Na(e){return["html","body","#document"].includes(ui(e))}function tr(e){return er(e).getComputedStyle(e)}function kf(e){return Lt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ro(e){if(ui(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ih(e)&&e.host||pi(e);return ih(t)?t.host:t}function t1(e){const t=Ro(e);return Na(t)?e.ownerDocument?e.ownerDocument.body:e.body:On(t)&&Bu(t)?t:t1(t)}function Mi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=t1(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=er(i);return o?t.concat(a,a.visualViewport||[],Bu(i)?i:[],a.frameElement&&n?Mi(a.frameElement):[]):t.concat(i,Mi(i,[],n))}function aa(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Hn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ih(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function n1(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function r1(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function eB(e){return e.mozInputSource===0&&e.isTrusted?!0:oh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function tB(e){return rB()?!1:!oh()&&e.width===0&&e.height===0||oh()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function nB(){return/apple/i.test(navigator.vendor)}function oh(){const e=/android/i;return e.test(n1())||e.test(r1())}function rB(){return r1().includes("jsdom/")}function ob(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function iB(e){return"nativeEvent"in e}function oB(e){return e.matches("html,body")}function Yr(e){return(e==null?void 0:e.ownerDocument)||document}function vd(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function sa(e){return"composedPath"in e?e.composedPath()[0]:e.target}const aB="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function i1(e){return On(e)&&e.matches(aB)}function md(e){e.preventDefault(),e.stopPropagation()}function sB(e){return e?e.getAttribute("role")==="combobox"&&i1(e):!1}const Pa=Math.min,So=Math.max,wc=Math.round,Cl=Math.floor,Wi=e=>({x:e,y:e}),uB={left:"right",right:"left",bottom:"top",top:"bottom"},lB={start:"end",end:"start"};function ah(e,t,n){return So(e,Pa(t,n))}function Uu(e,t){return typeof e=="function"?e(t):e}function ko(e){return e.split("-")[0]}function Gu(e){return e.split("-")[1]}function o1(e){return e==="x"?"y":"x"}function cm(e){return e==="y"?"height":"width"}function Mf(e){return["top","bottom"].includes(ko(e))?"y":"x"}function fm(e){return o1(Mf(e))}function cB(e,t,n){n===void 0&&(n=!1);const r=Gu(e),i=fm(e),o=cm(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=xc(a)),[a,xc(a)]}function fB(e){const t=xc(e);return[sh(e),t,sh(t)]}function sh(e){return e.replace(/start|end/g,t=>lB[t])}function dB(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}function pB(e,t,n,r){const i=Gu(e);let o=dB(ko(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(sh)))),o}function xc(e){return e.replace(/left|right|bottom|top/g,t=>uB[t])}function hB(e){return{top:0,right:0,bottom:0,left:0,...e}}function a1(e){return typeof e!="number"?hB(e):{top:e,right:e,bottom:e,left:e}}function Tc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ab(e,t,n){let{reference:r,floating:i}=e;const o=Mf(t),a=fm(t),s=cm(a),u=ko(t),l=o==="y",c=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[s]/2-i[s]/2;let h;switch(u){case"top":h={x:c,y:r.y-i.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Gu(t)){case"start":h[a]-=d*(n&&l?-1:1);break;case"end":h[a]+=d*(n&&l?-1:1);break}return h}const vB=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=ab(l,r,u),d=r,h={},p=0;for(let v=0;v<s.length;v++){const{name:g,fn:C}=s[v],{x:m,y:b,data:x,reset:T}=await C({x:c,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});c=m??c,f=b??f,h={...h,[g]:{...h[g],...x}},T&&p<=50&&(p++,typeof T=="object"&&(T.placement&&(d=T.placement),T.rects&&(l=T.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:c,y:f}=ab(l,d,u)),v=-1)}return{x:c,y:f,placement:d,strategy:i,middlewareData:h}};async function s1(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Uu(t,e),p=a1(h),v=s[d?f==="floating"?"reference":"floating":f],g=Tc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(s.floating)),boundary:l,rootBoundary:c,strategy:u})),C=f==="floating"?{...a.floating,x:r,y:i}:a.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),b=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},x=Tc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:m,strategy:u}):C);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}const mB=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:c=0}=Uu(e,t)||{};if(l==null)return{};const f=a1(c),d={x:n,y:r},h=fm(i),p=cm(h),v=await a.getDimensions(l),g=h==="y",C=g?"top":"left",m=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[h]-d[h]-o.floating[p],T=d[h]-o.reference[h],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l));let A=E?E[b]:0;(!A||!await(a.isElement==null?void 0:a.isElement(E)))&&(A=s.floating[b]||o.floating[p]);const N=x/2-T/2,I=A/2-v[p]/2-1,P=Pa(f[C],I),_=Pa(f[m],I),L=P,U=A-v[p]-_,Y=A/2-v[p]/2+N,k=ah(L,Y,U),ie=!u.arrow&&Gu(i)!=null&&Y!==k&&o.reference[p]/2-(Y<L?P:_)-v[p]/2<0,B=ie?Y<L?Y-L:Y-U:0;return{[h]:d[h]+B,data:{[h]:k,centerOffset:Y-k-B,...ie&&{alignmentOffset:B}},reset:ie}}}),yB=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=Uu(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=ko(i),m=ko(s)===s,b=await(u.isRTL==null?void 0:u.isRTL(l.floating)),x=d||(m||!v?[xc(s)]:fB(s));!d&&p!=="none"&&x.push(...pB(s,v,p,b));const T=[s,...x],E=await s1(t,g),A=[];let N=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&A.push(E[C]),f){const L=cB(i,a,b);A.push(E[L[0]],E[L[1]])}if(N=[...N,{placement:i,overflows:A}],!A.every(L=>L<=0)){var I,P;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,U=T[L];if(U)return{data:{index:L,overflows:N},reset:{placement:U}};let Y=(P=N.filter(k=>k.overflows[0]<=0).sort((k,ie)=>k.overflows[1]-ie.overflows[1])[0])==null?void 0:P.placement;if(!Y)switch(h){case"bestFit":{var _;const k=(_=N.map(ie=>[ie.placement,ie.overflows.filter(B=>B>0).reduce((B,G)=>B+G,0)]).sort((ie,B)=>ie[1]-B[1])[0])==null?void 0:_[0];k&&(Y=k);break}case"initialPlacement":Y=s;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}};async function gB(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ko(n),s=Gu(n),u=Mf(n)==="y",l=["left","top"].includes(a)?-1:1,c=o&&u?-1:1,f=Uu(t,e);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof p=="number"&&(h=s==="end"?p*-1:p),u?{x:h*c,y:d*l}:{x:d*l,y:h*c}}const bB=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,u=await gB(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}},SB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:C,y:m}=g;return{x:C,y:m}}},...u}=Uu(e,t),l={x:n,y:r},c=await s1(t,u),f=Mf(ko(i)),d=o1(f);let h=l[d],p=l[f];if(o){const g=d==="y"?"top":"left",C=d==="y"?"bottom":"right",m=h+c[g],b=h-c[C];h=ah(m,h,b)}if(a){const g=f==="y"?"top":"left",C=f==="y"?"bottom":"right",m=p+c[g],b=p-c[C];p=ah(m,p,b)}const v=s.fn({...t,[d]:h,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function u1(e){const t=tr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=On(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=wc(n)!==o||wc(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function dm(e){return Lt(e)?e:e.contextElement}function wa(e){const t=dm(e);if(!On(t))return Wi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=u1(t);let a=(o?wc(n.width):n.width)/r,s=(o?wc(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const CB=Wi(0);function l1(e){const t=er(e);return!lm()||!t.visualViewport?CB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==er(e)?!1:t}function Mo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=dm(e);let a=Wi(1);t&&(r?Lt(r)&&(a=wa(r)):a=wa(e));const s=wB(o,n,r)?l1(o):Wi(0);let u=(i.left+s.x)/a.x,l=(i.top+s.y)/a.y,c=i.width/a.x,f=i.height/a.y;if(o){const d=er(o),h=r&&Lt(r)?er(r):r;let p=d.frameElement;for(;p&&r&&h!==d;){const v=wa(p),g=p.getBoundingClientRect(),C=tr(p),m=g.left+(p.clientLeft+parseFloat(C.paddingLeft))*v.x,b=g.top+(p.clientTop+parseFloat(C.paddingTop))*v.y;u*=v.x,l*=v.y,c*=v.x,f*=v.y,u+=m,l+=b,p=er(p).frameElement}}return Tc({width:c,height:f,x:u,y:l})}const xB=[":popover-open",":modal"];function c1(e){let t=!1,n=0,r=0;function i(o){try{t=t||e.matches(o)}catch{}}if(xB.forEach(o=>{i(o)}),t){const o=e1(e);if(o){const a=o.getBoundingClientRect();n=a.x,r=a.y}}return[t,n,r]}function TB(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=pi(r),[a]=t?c1(t.floating):[!1];if(r===o||a)return n;let s={scrollLeft:0,scrollTop:0},u=Wi(1);const l=Wi(0),c=On(r);if((c||!c&&i!=="fixed")&&((ui(r)!=="body"||Bu(o))&&(s=kf(r)),On(r))){const f=Mo(r);u=wa(r),l.x=f.x+r.clientLeft,l.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+l.x,y:n.y*u.y-s.scrollTop*u.y+l.y}}function EB(e){return Array.from(e.getClientRects())}function f1(e){return Mo(pi(e)).left+kf(e).scrollLeft}function IB(e){const t=pi(e),n=kf(e),r=e.ownerDocument.body,i=So(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=So(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+f1(e);const s=-n.scrollTop;return tr(r).direction==="rtl"&&(a+=So(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function AB(e,t){const n=er(e),r=pi(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const l=lm();(!l||l&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function $B(e,t){const n=Mo(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=On(e)?wa(e):Wi(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,l=r*o.y;return{width:a,height:s,x:u,y:l}}function sb(e,t,n){let r;if(t==="viewport")r=AB(e,n);else if(t==="document")r=IB(pi(e));else if(Lt(t))r=$B(t,n);else{const i=l1(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Tc(r)}function d1(e,t){const n=Ro(e);return n===t||!Lt(n)||Na(n)?!1:tr(n).position==="fixed"||d1(n,t)}function OB(e,t){const n=t.get(e);if(n)return n;let r=Mi(e,[],!1).filter(s=>Lt(s)&&ui(s)!=="body"),i=null;const o=tr(e).position==="fixed";let a=o?Ro(e):e;for(;Lt(a)&&!Na(a);){const s=tr(a),u=um(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&i&&["absolute","fixed"].includes(i.position)||Bu(a)&&!u&&d1(e,a))?r=r.filter(l=>l!==a):i=s,a=Ro(a)}return t.set(e,r),r}function DB(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?OB(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((u,l)=>{const c=sb(t,l,i);return u.top=So(c.top,u.top),u.right=Pa(c.right,u.right),u.bottom=Pa(c.bottom,u.bottom),u.left=So(c.left,u.left),u},sb(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function NB(e){const{width:t,height:n}=u1(e);return{width:t,height:n}}function PB(e,t,n,r){const i=On(t),o=pi(t),a=n==="fixed",s=Mo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const l=Wi(0);if(i||!i&&!a)if((ui(t)!=="body"||Bu(o))&&(u=kf(t)),i){const v=Mo(t,!0,a,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else o&&(l.x=f1(o));let c=s.left+u.scrollLeft-l.x,f=s.top+u.scrollTop-l.y;const[d,h,p]=c1(r);return d&&(c+=h,f+=p,i&&(c+=t.clientLeft,f+=t.clientTop)),{x:c,y:f,width:s.width,height:s.height}}function ub(e,t){return!On(e)||tr(e).position==="fixed"?null:t?t(e):e.offsetParent}function p1(e,t){const n=er(e);if(!On(e))return n;let r=ub(e,t);for(;r&&Z5(r)&&tr(r).position==="static";)r=ub(r,t);return r&&(ui(r)==="html"||ui(r)==="body"&&tr(r).position==="static"&&!um(r))?n:r||e1(e)||n}const RB=async function(e){const t=this.getOffsetParent||p1,n=this.getDimensions;return{reference:PB(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function kB(e){return tr(e).direction==="rtl"}const h1={convertOffsetParentRelativeRectToViewportRelativeRect:TB,getDocumentElement:pi,getClippingRect:DB,getOffsetParent:p1,getElementRects:RB,getClientRects:EB,getDimensions:NB,getScale:wa,isElement:Lt,isRTL:kB};function MB(e,t){let n=null,r;const i=pi(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,u){s===void 0&&(s=!1),u===void 0&&(u=1),o();const{left:l,top:c,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const h=Cl(c),p=Cl(i.clientWidth-(l+f)),v=Cl(i.clientHeight-(c+d)),g=Cl(l),C={rootMargin:-h+"px "+-p+"px "+-v+"px "+-g+"px",threshold:So(0,Pa(1,u))||1};let m=!0;function b(x){const T=x[0].intersectionRatio;if(T!==u){if(!m)return a();T?a(!1,T):r=setTimeout(()=>{a(!1,1e-7)},100)}m=!1}try{n=new IntersectionObserver(b,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,C)}n.observe(e)}return a(!0),o}function jB(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=dm(e),c=i||o?[...l?Mi(l):[],...Mi(t)]:[];c.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const f=l&&s?MB(l,n):null;let d=-1,h=null;a&&(h=new ResizeObserver(C=>{let[m]=C;m&&m.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let p,v=u?Mo(e):null;u&&g();function g(){const C=Mo(e);v&&(C.x!==v.x||C.y!==v.y||C.width!==v.width||C.height!==v.height)&&n(),v=C,p=requestAnimationFrame(g)}return n(),()=>{var C;c.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(C=h)==null||C.disconnect(),h=null,u&&cancelAnimationFrame(p)}}const _B=SB,qB=yB,lb=mB,FB=(e,t,n)=>{const r=new Map,i={platform:h1,...n},o={...i.platform,_c:r};return vB(e,t,{...i,platform:o})},LB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?lb({element:r.current,padding:i}).fn(n):{}:r?lb({element:r,padding:i}).fn(n):{}}}};var Wl=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ec(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ec(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Ec(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function v1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cb(e,t){const n=v1(e);return Math.round(t*n)/n}function fb(e){const t=J.useRef(e);return Wl(()=>{t.current=e}),t}function VB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:u,open:l}=e,[c,f]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,h]=J.useState(r);Ec(d,r)||h(r);const[p,v]=J.useState(null),[g,C]=J.useState(null),m=J.useCallback(B=>{B!==E.current&&(E.current=B,v(B))},[]),b=J.useCallback(B=>{B!==A.current&&(A.current=B,C(B))},[]),x=o||p,T=a||g,E=J.useRef(null),A=J.useRef(null),N=J.useRef(c),I=u!=null,P=fb(u),_=fb(i),L=J.useCallback(()=>{if(!E.current||!A.current)return;const B={placement:t,strategy:n,middleware:d};_.current&&(B.platform=_.current),FB(E.current,A.current,B).then(G=>{const fe={...G,isPositioned:!0};U.current&&!Ec(N.current,fe)&&(N.current=fe,bT.flushSync(()=>{f(fe)}))})},[d,t,n,_]);Wl(()=>{l===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[l]);const U=J.useRef(!1);Wl(()=>(U.current=!0,()=>{U.current=!1}),[]),Wl(()=>{if(x&&(E.current=x),T&&(A.current=T),x&&T){if(P.current)return P.current(x,T,L);L()}},[x,T,L,P,I]);const Y=J.useMemo(()=>({reference:E,floating:A,setReference:m,setFloating:b}),[m,b]),k=J.useMemo(()=>({reference:x,floating:T}),[x,T]),ie=J.useMemo(()=>{const B={position:n,left:0,top:0};if(!k.floating)return B;const G=cb(k.floating,c.x),fe=cb(k.floating,c.y);return s?{...B,transform:"translate("+G+"px, "+fe+"px)",...v1(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:fe}},[n,s,k.floating,c.x,c.y]);return J.useMemo(()=>({...c,update:L,refs:Y,elements:k,floatingStyles:ie}),[c,L,Y,k,ie])}/*!
|
|
1154
1154
|
* tabbable 6.2.0
|
|
1155
1155
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
1156
|
-
*/var B3=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ah=B3.join(","),h1=typeof Element>"u",vu=h1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ec=!h1&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ic=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",a=o||n&&t&&e(t.parentNode);return a},U3=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},G3=function(e,t,n){if(Ic(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ah));return t&&vu.call(e,ah)&&r.unshift(e),r=r.filter(n),r},z3=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!Ic(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),u=s.length?s:a.children,l=e(u,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:a,candidates:l})}else{var c=vu.call(a,ah);c&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!Ic(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var h=e(f===!0?a.children:f.children,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:a,candidates:h})}else o.unshift.apply(o,a.children)}}return i},v1=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},m1=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||U3(e))&&!v1(e)?0:e.tabIndex},W3=function(e,t){var n=m1(e);return n<0&&t&&!v1(e)?0:n},H3=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},y1=function(e){return e.tagName==="INPUT"},K3=function(e){return y1(e)&&e.type==="hidden"},Y3=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},J3=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},X3=function(e){if(!e.name)return!0;var t=e.form||Ec(e),n=function(o){return t.querySelectorAll('input[type="radio"][name="'+o+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=J3(r,e.form);return!i||i===e},Q3=function(e){return y1(e)&&e.type==="radio"},Z3=function(e){return Q3(e)&&!X3(e)},eB=function(e){var t,n=e&&Ec(e),r=(t=n)===null||t===void 0?void 0:t.host,i=!1;if(n&&n!==e){var o,a,s;for(i=!!((o=r)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(s=e.ownerDocument)!==null&&s!==void 0&&s.contains(e));!i&&r;){var u,l,c;n=Ec(r),r=(u=n)===null||u===void 0?void 0:u.host,i=!!((l=r)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(r))}}return i},fb=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},tB=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=vu.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(vu.call(o,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof r=="function"){for(var a=e;e;){var s=e.parentElement,u=Ec(e);if(s&&!s.shadowRoot&&r(s)===!0)return fb(e);e.assignedSlot?e=e.assignedSlot:!s&&u!==e.ownerDocument?e=u.host:e=s}e=a}if(eB(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return fb(e);return!1},nB=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName==="LEGEND")return vu.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},rB=function(e,t){return!(t.disabled||Ic(t)||K3(t)||tB(t,e)||Y3(t)||nB(t))},db=function(e,t){return!(Z3(t)||m1(t)<0||!rB(e,t))},iB=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},oB=function e(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,u=W3(s,a),l=a?e(i.candidates):s;u===0?a?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:u,item:i,isScope:a,content:l})}),r.sort(H3).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},dm=function(e,t){t=t||{};var n;return t.getShadowRoot?n=z3([e],t.includeContainer,{filter:db.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:iB}):n=G3(e,t.includeContainer,db.bind(null,t)),oB(n)};function pm(e){return J.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const aB=J["useInsertionEffect".toString()],sB=aB||(e=>e());function ua(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return sB(()=>{t.current=e}),J.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}let pb=0;function no(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(pb);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():pb=requestAnimationFrame(o)}var sr=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ra(){return Ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ra.apply(this,arguments)}let vd=!1,uB=0;const hb=()=>"floating-ui-"+uB++;function lB(){const[e,t]=J.useState(()=>vd?hb():void 0);return sr(()=>{e==null&&t(hb())},[]),J.useEffect(()=>{vd||(vd=!0)},[]),e}const cB=J["useId".toString()],Mf=cB||lB,fB=J.forwardRef(function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i}},width:o=14,height:a=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:l,stroke:c,d:f,style:{transform:d,...h}={},...p}=e;process.env.NODE_ENV!=="production"&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=Mf();if(!r)return null;u*=2;const g=u/2,C=o/2*(s/-8+1),m=a/2*s/4,[b,x]=n.split("-"),T=d1.isRTL(r),E=!!f,A=b==="top"||b==="bottom",N=l&&x==="end"?"bottom":"top";let I=l&&x==="end"?"right":"left";l&&T&&(I=x==="end"?"left":"right");const P=(i==null?void 0:i.x)!=null?l||i.x:"",_=(i==null?void 0:i.y)!=null?l||i.y:"",L=f||"M0,0"+(" H"+o)+(" L"+(o-C)+","+(a-m))+(" Q"+o/2+","+a+" "+C+","+(a-m))+" Z",U={top:E?"rotate(180deg)":"",left:E?"rotate(90deg)":"rotate(-90deg)",bottom:E?"":"rotate(180deg)",right:E?"rotate(-90deg)":"rotate(90deg)"}[b];return J.createElement("svg",Ra({},p,{"aria-hidden":!0,ref:t,width:E?o:o+u,height:o,viewBox:"0 0 "+o+" "+(a>o?a:o),style:{position:"absolute",pointerEvents:"none",[I]:P,[N]:_,[b]:A||E?"100%":"calc(100% - "+u/2+"px)",transform:""+U+(d??""),...h}}),u>0&&J.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:c,strokeWidth:u+(f?0:1),d:L}),J.createElement("path",{stroke:u&&!f?p.fill:"none",d:L}),J.createElement("clipPath",{id:v},J.createElement("rect",{x:-g,y:g*(E?-1:1),width:o+u,height:o})))});function dB(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const pB=J.createContext(null),hB=J.createContext(null),vB=()=>{var e;return((e=J.useContext(pB))==null?void 0:e.id)||null},hm=()=>J.useContext(hB);function mu(e){return"data-floating-ui-"+e}function md(e){const t=O.useRef(e);return sr(()=>{t.current=e}),t}function mB(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function Vs(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(a=>{var s;return i.parentId===a.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let ta=new WeakMap,Cl=new WeakSet,wl={},yd=0;const yB=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,g1=e=>e&&(e.host||g1(e.parentNode)),gB=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=g1(n);return e.contains(r)?r:null}).filter(n=>n!=null);function bB(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=gB(t,e),s=new Set,u=new Set(a),l=[];wl[i]||(wl[i]=new WeakMap);const c=wl[i];a.forEach(f),d(t),s.clear();function f(h){!h||s.has(h)||(s.add(h),h.parentNode&&f(h.parentNode))}function d(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,p=>{if(s.has(p))d(p);else{const v=o?p.getAttribute(o):null,g=v!==null&&v!=="false",C=(ta.get(p)||0)+1,m=(c.get(p)||0)+1;ta.set(p,C),c.set(p,m),l.push(p),C===1&&g&&Cl.add(p),m===1&&p.setAttribute(i,""),!g&&o&&p.setAttribute(o,"true")}})}return yd++,()=>{l.forEach(h=>{const p=(ta.get(h)||0)-1,v=(c.get(h)||0)-1;ta.set(h,p),c.set(h,v),p||(!Cl.has(h)&&o&&h.removeAttribute(o),Cl.delete(h)),v||h.removeAttribute(i)}),yd--,yd||(ta=new WeakMap,ta=new WeakMap,Cl=new WeakSet,wl={})}}function vb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Wr(e[0]).body;return bB(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const vm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function b1(e,t){const n=dm(e,vm());t==="prev"&&n.reverse();const r=n.indexOf(aa(Wr(e)));return n.slice(r+1)[0]}function S1(){return b1(document.body,"next")}function C1(){return b1(document.body,"prev")}function Bs(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Hn(n,r)}function SB(e){dm(e,vm()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function CB(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const n=t.dataset.tabindex;delete t.dataset.tabindex,n?t.setAttribute("tabindex",n):t.removeAttribute("tabindex")})}const mm={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let wB;function mb(e){e.key==="Tab"&&(e.target,clearTimeout(wB))}const Ac=J.forwardRef(function(e,t){const[n,r]=J.useState();sr(()=>(n3()&&r("button"),document.addEventListener("keydown",mb),()=>{document.removeEventListener("keydown",mb)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[mu("focus-guard")]:"",style:mm};return J.createElement("span",Ra({},e,i))}),w1=J.createContext(null),yb=mu("portal");function xB(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=J.useState(null),o=Mf(),a=T1(),s=J.useRef(null);return sr(()=>()=>{r==null||r.remove(),queueMicrotask(()=>{s.current=null})},[r]),sr(()=>{if(s.current)return;const u=t?document.getElementById(t):null;if(!u)return;const l=document.createElement("div");l.id=o,l.setAttribute(yb,""),u.appendChild(l),s.current=l,i(l)},[t,o]),sr(()=>{if(s.current)return;let u=n||(a==null?void 0:a.portalNode);u&&!Lt(u)&&(u=u.current),u=u||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,u.appendChild(l));const c=document.createElement("div");c.id=o,c.setAttribute(yb,""),u=l||u,u.appendChild(c),s.current=c,i(c)},[t,n,o,a]),r}function x1(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=xB({id:n,root:r}),[a,s]=J.useState(null),u=J.useRef(null),l=J.useRef(null),c=J.useRef(null),f=J.useRef(null),d=!!a&&!a.modal&&a.open&&i&&!!(r||o);return J.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function h(p){o&&Bs(p)&&(p.type==="focusin"?CB:SB)(o)}return o.addEventListener("focusin",h,!0),o.addEventListener("focusout",h,!0),()=>{o.removeEventListener("focusin",h,!0),o.removeEventListener("focusout",h,!0)}},[o,i,a==null?void 0:a.modal]),J.createElement(w1.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:l,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:s}),[i,o])},d&&o&&J.createElement(Ac,{"data-type":"outside",ref:u,onFocus:h=>{if(Bs(h,o)){var p;(p=c.current)==null||p.focus()}else{const v=C1()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus()}}}),d&&o&&J.createElement("span",{"aria-owns":o.id,style:mm}),o&&Gb.createPortal(t,o),d&&o&&J.createElement(Ac,{"data-type":"outside",ref:l,onFocus:h=>{if(Bs(h,o)){var p;(p=f.current)==null||p.focus()}else{const v=S1()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,h.nativeEvent))}}}))}const T1=()=>J.useContext(w1),gb=20;let lo=[];function gd(e){lo=lo.filter(t=>t.isConnected),e&&oi(e)!=="body"&&(lo.push(e),lo.length>gb&&(lo=lo.slice(-gb)))}function bb(){return lo.slice().reverse().find(e=>e.isConnected)}const TB=J.forwardRef(function(e,t){return J.createElement("button",Ra({},e,{type:"button",ref:t,tabIndex:-1,style:mm}))});function E1(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:u=!0,visuallyHiddenDismiss:l=!1,closeOnFocusOut:c=!0}=e,{open:f,refs:d,nodeId:h,onOpenChange:p,events:v,dataRef:g,elements:{domReference:C,floating:m}}=t,b=typeof a=="number"&&a<0,x=s3(C)&&b,T=yB()?o:!0,E=md(i),A=md(a),N=md(s),I=hm(),P=T1(),_=J.useRef(null),L=J.useRef(null),U=J.useRef(!1),Y=J.useRef(!1),k=P!=null,ie=J.useCallback(function(j){return j===void 0&&(j=m),j?dm(j,vm()):[]},[m]),B=J.useCallback(j=>{const R=ie(j);return E.current.map(te=>C&&te==="reference"?C:m&&te==="floating"?m:R).filter(Boolean).flat()},[C,m,E,ie]);J.useEffect(()=>{if(r||!u)return;function j(te){if(te.key==="Tab"){Hn(m,aa(Wr(m)))&&ie().length===0&&!x&&hd(te);const oe=B(),X=sa(te);E.current[0]==="reference"&&X===C&&(hd(te),te.shiftKey?no(oe[oe.length-1]):no(oe[1])),E.current[1]==="floating"&&X===m&&te.shiftKey&&(hd(te),no(oe[0]))}}const R=Wr(m);return R.addEventListener("keydown",j),()=>{R.removeEventListener("keydown",j)}},[r,C,m,u,E,x,ie,B]),J.useEffect(()=>{if(r||!c)return;function j(){Y.current=!0,setTimeout(()=>{Y.current=!1})}function R(te){const oe=te.relatedTarget;queueMicrotask(()=>{const X=!(Hn(C,oe)||Hn(m,oe)||Hn(oe,m)||Hn(P==null?void 0:P.portalNode,oe)||oe!=null&&oe.hasAttribute(mu("focus-guard"))||I&&(Vs(I.nodesRef.current,h).find(ae=>{var de,he;return Hn((de=ae.context)==null?void 0:de.elements.floating,oe)||Hn((he=ae.context)==null?void 0:he.elements.domReference,oe)})||mB(I.nodesRef.current,h).find(ae=>{var de,he;return((de=ae.context)==null?void 0:de.elements.floating)===oe||((he=ae.context)==null?void 0:he.elements.domReference)===oe})));oe&&X&&!Y.current&&oe!==bb()&&(U.current=!0,p(!1,te))})}if(m&&On(C))return C.addEventListener("focusout",R),C.addEventListener("pointerdown",j),!u&&m.addEventListener("focusout",R),()=>{C.removeEventListener("focusout",R),C.removeEventListener("pointerdown",j),!u&&m.removeEventListener("focusout",R)}},[r,C,m,u,h,I,P,p,c]),J.useEffect(()=>{var j;if(r)return;const R=Array.from((P==null||(j=P.portalNode)==null?void 0:j.querySelectorAll("["+mu("portal")+"]"))||[]);if(m){const te=[m,...R,_.current,L.current,E.current.includes("reference")||x?C:null].filter(X=>X!=null),oe=u||x?vb(te,T,!T):vb(te);return()=>{oe()}}},[r,C,m,u,E,P,x,T]),sr(()=>{if(r||!m)return;const j=Wr(m),R=aa(j);queueMicrotask(()=>{const te=B(m),oe=A.current,X=(typeof oe=="number"?te[oe]:oe.current)||m,ae=Hn(m,R);!b&&!ae&&f&&no(X,{preventScroll:X===m})})},[r,f,m,b,B,A]),sr(()=>{if(r||!m)return;let j=!1;const R=Wr(m),te=aa(R),oe=g.current;gd(te);function X(ae){let{reason:de,event:he,nested:Te}=ae;de==="escape-key"&&d.domReference.current&&gd(d.domReference.current),de==="hover"&&he.type==="mouseleave"&&(U.current=!0),de==="outside-press"&&(Te?(U.current=!1,j=!0):U.current=!(e3(he)||t3(he)))}return v.on("openchange",X),()=>{v.off("openchange",X);const ae=aa(R),de=Hn(m,ae)||I&&Vs(I.nodesRef.current,h).some(Te=>{var ke;return Hn((ke=Te.context)==null?void 0:ke.elements.floating,ae)});(de||oe.openEvent&&["click","mousedown"].includes(oe.openEvent.type))&&d.domReference.current&&gd(d.domReference.current);const he=bb();N.current&&!U.current&&On(he)&&(!(he!==ae&&ae!==R.body)||de)&&no(he,{cancelPrevious:!1,preventScroll:j})}},[r,m,N,g,d,v,I,h]),sr(()=>{if(!(r||!P))return P.setFocusManagerState({modal:u,closeOnFocusOut:c,open:f,onOpenChange:p,refs:d}),()=>{P.setFocusManagerState(null)}},[r,P,u,f,p,d,c]),sr(()=>{if(r||!m||typeof MutationObserver!="function"||b)return;const j=()=>{const te=m.getAttribute("tabindex");E.current.includes("floating")||aa(Wr(m))!==d.domReference.current&&ie().length===0?te!=="0"&&m.setAttribute("tabindex","0"):te!=="-1"&&m.setAttribute("tabindex","-1")};j();const R=new MutationObserver(j);return R.observe(m,{childList:!0,subtree:!0,attributes:!0}),()=>{R.disconnect()}},[r,m,d,E,ie,b]);function G(j){return r||!l||!u?null:J.createElement(TB,{ref:j==="start"?_:L,onClick:R=>p(!1,R.nativeEvent)},typeof l=="string"?l:"Dismiss")}const fe=!r&&T&&(k||u);return J.createElement(J.Fragment,null,fe&&J.createElement(Ac,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:j=>{if(u){const te=B();no(i[0]==="reference"?te[0]:te[te.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(U.current=!1,Bs(j,P.portalNode)){const te=S1()||C;te==null||te.focus()}else{var R;(R=P.beforeOutsideRef.current)==null||R.focus()}}}),!x&&G("start"),n,G("end"),fe&&J.createElement(Ac,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:j=>{if(u)no(B()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(c&&(U.current=!0),Bs(j,P.portalNode)){const te=C1()||C;te==null||te.focus()}else{var R;(R=P.afterOutsideRef.current)==null||R.focus()}}}))}const bd=new Set,I1=J.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;const i=Mf();return sr(()=>{if(!n)return;bd.add(i);const o=/iP(hone|ad|od)|iOS/.test(e1()),a=document.body.style,s=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,l=a.left?parseFloat(a.left):window.pageXOffset,c=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",u&&(a[s]=u+"px"),o){var f,d;const h=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,p=((d=window.visualViewport)==null?void 0:d.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(c-Math.floor(p))+"px",left:-(l-Math.floor(h))+"px",right:"0"})}return()=>{bd.delete(i),bd.size===0&&(Object.assign(a,{overflow:"",[s]:""}),o&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(l,c)))}},[i,n]),J.createElement("div",Ra({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function Sb(e){return On(e.target)&&e.target.tagName==="BUTTON"}function Cb(e){return n1(e)}function A1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:u=!0,ignoreMouse:l=!1,keyboardHandlers:c=!0}=t,f=J.useRef(),d=J.useRef(!1);return J.useMemo(()=>a?{reference:{onPointerDown(h){f.current=h.pointerType},onMouseDown(h){h.button===0&&(ib(f.current,!0)&&l||s!=="click"&&(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,h.nativeEvent,"click"):(h.preventDefault(),r(!0,h.nativeEvent,"click"))))},onClick(h){if(s==="mousedown"&&f.current){f.current=void 0;return}ib(f.current,!0)&&l||(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,h.nativeEvent,"click"):r(!0,h.nativeEvent,"click"))},onKeyDown(h){f.current=void 0,!(h.defaultPrevented||!c||Sb(h))&&(h.key===" "&&!Cb(o)&&(h.preventDefault(),d.current=!0),h.key==="Enter"&&r(!(n&&u),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!c||Sb(h)||Cb(o)||h.key===" "&&d.current&&(d.current=!1,r(!(n&&u),h.nativeEvent,"click"))}}}:{},[a,i,s,l,c,o,u,n,r])}const EB={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},IB={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},wb=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function $1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:i,elements:{reference:o,domReference:a,floating:s},dataRef:u}=e,{enabled:l=!0,escapeKey:c=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:h=!1,referencePressEvent:p="pointerdown",ancestorScroll:v=!1,bubbles:g,capture:C}=t,m=hm(),b=ua(typeof f=="function"?f:()=>!1),x=typeof f=="function"?b:f,T=J.useRef(!1),E=J.useRef(!1),{escapeKey:A,outsidePress:N}=wb(g),{escapeKey:I,outsidePress:P}=wb(C),_=ua(k=>{if(!n||!l||!c||k.key!=="Escape")return;const ie=m?Vs(m.nodesRef.current,i):[];if(!A&&(k.stopPropagation(),ie.length>0)){let B=!0;if(ie.forEach(G=>{var fe;if((fe=G.context)!=null&&fe.open&&!G.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,i3(k)?k.nativeEvent:k,"escape-key")}),L=ua(k=>{var ie;const B=()=>{var G;_(k),(G=sa(k))==null||G.removeEventListener("keydown",B)};(ie=sa(k))==null||ie.addEventListener("keydown",B)}),U=ua(k=>{const ie=T.current;T.current=!1;const B=E.current;if(E.current=!1,d==="click"&&B||ie||typeof x=="function"&&!x(k))return;const G=sa(k),fe="["+mu("inert")+"]",j=Wr(s).querySelectorAll(fe);let R=Lt(G)?G:null;for(;R&&!Na(R);){const X=Ro(R);if(Na(X)||!Lt(X))break;R=X}if(j.length&&Lt(G)&&!o3(G)&&!Hn(G,s)&&Array.from(j).every(X=>!Hn(R,X)))return;if(On(G)&&s){const X=G.clientWidth>0&&G.scrollWidth>G.clientWidth,ae=G.clientHeight>0&&G.scrollHeight>G.clientHeight;let de=ae&&k.offsetX>G.clientWidth;if(ae&&tr(G).direction==="rtl"&&(de=k.offsetX<=G.offsetWidth-G.clientWidth),de||X&&k.offsetY>G.clientHeight)return}const te=m&&Vs(m.nodesRef.current,i).some(X=>{var ae;return pd(k,(ae=X.context)==null?void 0:ae.elements.floating)});if(pd(k,s)||pd(k,a)||te)return;const oe=m?Vs(m.nodesRef.current,i):[];if(oe.length>0){let X=!0;if(oe.forEach(ae=>{var de;if((de=ae.context)!=null&&de.open&&!ae.context.dataRef.current.__outsidePressBubbles){X=!1;return}}),!X)return}r(!1,k,"outside-press")}),Y=ua(k=>{var ie;const B=()=>{var G;U(k),(G=sa(k))==null||G.removeEventListener(d,B)};(ie=sa(k))==null||ie.addEventListener(d,B)});return J.useEffect(()=>{if(!n||!l)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=N;function k(G){r(!1,G,"ancestor-scroll")}const ie=Wr(s);c&&ie.addEventListener("keydown",I?L:_,I),x&&ie.addEventListener(d,P?Y:U,P);let B=[];return v&&(Lt(a)&&(B=ki(a)),Lt(s)&&(B=B.concat(ki(s))),!Lt(o)&&o&&o.contextElement&&(B=B.concat(ki(o.contextElement)))),B=B.filter(G=>{var fe;return G!==((fe=ie.defaultView)==null?void 0:fe.visualViewport)}),B.forEach(G=>{G.addEventListener("scroll",k,{passive:!0})}),()=>{c&&ie.removeEventListener("keydown",I?L:_,I),x&&ie.removeEventListener(d,P?Y:U,P),B.forEach(G=>{G.removeEventListener("scroll",k)})}},[u,s,a,o,c,x,d,n,r,v,l,A,N,_,I,L,U,P,Y]),J.useEffect(()=>{T.current=!1},[x,d]),J.useMemo(()=>l?{reference:{onKeyDown:_,[EB[p]]:k=>{h&&r(!1,k.nativeEvent,"reference-press")}},floating:{onKeyDown:_,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[IB[d]]:()=>{T.current=!0}}}:{},[l,h,d,p,r,_])}let sh;process.env.NODE_ENV!=="production"&&(sh=new Set);function O1(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const N="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!Lt(e.elements.reference)){var a;if(!((a=sh)!=null&&a.has(N))){var s;(s=sh)==null||s.add(N),console.error(N)}}}const[u,l]=J.useState(null),c=((t=e.elements)==null?void 0:t.reference)||u,f=V3(e),d=hm(),h=vB()!=null,p=ua((N,I,P)=>{N&&(g.current.openEvent=I),C.emit("openchange",{open:N,event:I,reason:P,nested:h}),r==null||r(N,I,P)}),v=J.useRef(null),g=J.useRef({}),C=J.useState(()=>dB())[0],m=Mf(),b=J.useCallback(N=>{const I=Lt(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;f.refs.setReference(I)},[f.refs]),x=J.useCallback(N=>{(Lt(N)||N===null)&&(v.current=N,l(N)),(Lt(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!Lt(N))&&f.refs.setReference(N)},[f.refs]),T=J.useMemo(()=>({...f.refs,setReference:x,setPositionReference:b,domReference:v}),[f.refs,x,b]),E=J.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),A=J.useMemo(()=>({...f,refs:T,elements:E,dataRef:g,nodeId:i,floatingId:m,events:C,open:n,onOpenChange:p}),[f,i,m,C,n,p,T,E]);return sr(()=>{const N=d==null?void 0:d.nodesRef.current.find(I=>I.id===i);N&&(N.context=A)}),J.useMemo(()=>({...f,context:A,refs:T,elements:E}),[f,T,E,A])}const xb="active",Tb="selected";function Sd(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[xb]:a,[Tb]:s,...u}=e;o=u}return{...n==="floating"&&{tabIndex:-1},...o,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(u=>{let[l,c]=u;if(!(i&&[xb,Tb].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof c=="function"){var f;(f=r.get(l))==null||f.push(c),a[l]=function(){for(var d,h=arguments.length,p=new Array(h),v=0;v<h;v++)p[v]=arguments[v];return(d=r.get(l))==null?void 0:d.map(g=>g(...p)).find(g=>g!==void 0)}}}else a[l]=c}),a),{})}}function D1(e){e===void 0&&(e=[]);const t=e,n=J.useCallback(o=>Sd(o,e,"reference"),t),r=J.useCallback(o=>Sd(o,e,"floating"),t),i=J.useCallback(o=>Sd(o,e,"item"),e.map(o=>o==null?void 0:o.item));return J.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}function AB(e={}){const{initialOpen:t=!1,open:n,onOpenChange:r}=e,[i,o]=J.useState(t),a=n??i,s=r??o,u=O1({open:a,onOpenChange:s}),l=u.context,c=A1(l,{enabled:n==null}),f=$1(l,{outsidePressEvent:"mousedown"}),d=D1([c,f]);return J.useMemo(()=>({open:a,setOpen:s,...d,...u}),[a,s,d,u])}const N1=J.createContext(null),P1=()=>{const e=J.useContext(N1);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function $B({children:e,...t}){const n=AB(t);return $.jsx(N1.Provider,{value:n,children:e})}const R1=qv`
|
|
1156
|
+
*/var BB=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],uh=BB.join(","),m1=typeof Element>"u",mu=m1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ic=!m1&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Ac=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=i===""||i==="true",a=o||n&&t&&e(t.parentNode);return a},UB=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},GB=function(e,t,n){if(Ac(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(uh));return t&&mu.call(e,uh)&&r.unshift(e),r=r.filter(n),r},zB=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!Ac(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),u=s.length?s:a.children,l=e(u,!0,r);r.flatten?i.push.apply(i,l):i.push({scopeParent:a,candidates:l})}else{var c=mu.call(a,uh);c&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!Ac(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var h=e(f===!0?a.children:f.children,!0,r);r.flatten?i.push.apply(i,h):i.push({scopeParent:a,candidates:h})}else o.unshift.apply(o,a.children)}}return i},y1=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},g1=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||UB(e))&&!y1(e)?0:e.tabIndex},WB=function(e,t){var n=g1(e);return n<0&&t&&!y1(e)?0:n},HB=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},b1=function(e){return e.tagName==="INPUT"},KB=function(e){return b1(e)&&e.type==="hidden"},YB=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},JB=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},XB=function(e){if(!e.name)return!0;var t=e.form||Ic(e),n=function(o){return t.querySelectorAll('input[type="radio"][name="'+o+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var i=JB(r,e.form);return!i||i===e},QB=function(e){return b1(e)&&e.type==="radio"},ZB=function(e){return QB(e)&&!XB(e)},e3=function(e){var t,n=e&&Ic(e),r=(t=n)===null||t===void 0?void 0:t.host,i=!1;if(n&&n!==e){var o,a,s;for(i=!!((o=r)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(s=e.ownerDocument)!==null&&s!==void 0&&s.contains(e));!i&&r;){var u,l,c;n=Ic(r),r=(u=n)===null||u===void 0?void 0:u.host,i=!!((l=r)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(r))}}return i},db=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},t3=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=mu.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(mu.call(o,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="legacy-full"){if(typeof r=="function"){for(var a=e;e;){var s=e.parentElement,u=Ic(e);if(s&&!s.shadowRoot&&r(s)===!0)return db(e);e.assignedSlot?e=e.assignedSlot:!s&&u!==e.ownerDocument?e=u.host:e=s}e=a}if(e3(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return db(e);return!1},n3=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName==="LEGEND")return mu.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},r3=function(e,t){return!(t.disabled||Ac(t)||KB(t)||t3(t,e)||YB(t)||n3(t))},pb=function(e,t){return!(ZB(t)||g1(t)<0||!r3(e,t))},i3=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},o3=function e(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,u=WB(s,a),l=a?e(i.candidates):s;u===0?a?n.push.apply(n,l):n.push(s):r.push({documentOrder:o,tabIndex:u,item:i,isScope:a,content:l})}),r.sort(HB).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},pm=function(e,t){t=t||{};var n;return t.getShadowRoot?n=zB([e],t.includeContainer,{filter:pb.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:i3}):n=GB(e,t.includeContainer,pb.bind(null,t)),o3(n)};function hm(e){return J.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const a3=J["useInsertionEffect".toString()],s3=a3||(e=>e());function ua(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return s3(()=>{t.current=e}),J.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}let hb=0;function no(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(hb);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():hb=requestAnimationFrame(o)}var ur=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ra(){return Ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ra.apply(this,arguments)}let yd=!1,u3=0;const vb=()=>"floating-ui-"+u3++;function l3(){const[e,t]=J.useState(()=>yd?vb():void 0);return ur(()=>{e==null&&t(vb())},[]),J.useEffect(()=>{yd||(yd=!0)},[]),e}const c3=J["useId".toString()],jf=c3||l3,f3=J.forwardRef(function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i}},width:o=14,height:a=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:l,stroke:c,d:f,style:{transform:d,...h}={},...p}=e;process.env.NODE_ENV!=="production"&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=jf();if(!r)return null;u*=2;const g=u/2,C=o/2*(s/-8+1),m=a/2*s/4,[b,x]=n.split("-"),T=h1.isRTL(r),E=!!f,A=b==="top"||b==="bottom",N=l&&x==="end"?"bottom":"top";let I=l&&x==="end"?"right":"left";l&&T&&(I=x==="end"?"left":"right");const P=(i==null?void 0:i.x)!=null?l||i.x:"",_=(i==null?void 0:i.y)!=null?l||i.y:"",L=f||"M0,0"+(" H"+o)+(" L"+(o-C)+","+(a-m))+(" Q"+o/2+","+a+" "+C+","+(a-m))+" Z",U={top:E?"rotate(180deg)":"",left:E?"rotate(90deg)":"rotate(-90deg)",bottom:E?"":"rotate(180deg)",right:E?"rotate(-90deg)":"rotate(90deg)"}[b];return J.createElement("svg",Ra({},p,{"aria-hidden":!0,ref:t,width:E?o:o+u,height:o,viewBox:"0 0 "+o+" "+(a>o?a:o),style:{position:"absolute",pointerEvents:"none",[I]:P,[N]:_,[b]:A||E?"100%":"calc(100% - "+u/2+"px)",transform:""+U+(d??""),...h}}),u>0&&J.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:c,strokeWidth:u+(f?0:1),d:L}),J.createElement("path",{stroke:u&&!f?p.fill:"none",d:L}),J.createElement("clipPath",{id:v},J.createElement("rect",{x:-g,y:g*(E?-1:1),width:o+u,height:o})))});function d3(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const p3=J.createContext(null),h3=J.createContext(null),v3=()=>{var e;return((e=J.useContext(p3))==null?void 0:e.id)||null},vm=()=>J.useContext(h3);function yu(e){return"data-floating-ui-"+e}function gd(e){const t=O.useRef(e);return ur(()=>{t.current=e}),t}function m3(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function Bs(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(a=>{var s;return i.parentId===a.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let ta=new WeakMap,wl=new WeakSet,xl={},bd=0;const y3=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,S1=e=>e&&(e.host||S1(e.parentNode)),g3=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=S1(n);return e.contains(r)?r:null}).filter(n=>n!=null);function b3(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=g3(t,e),s=new Set,u=new Set(a),l=[];xl[i]||(xl[i]=new WeakMap);const c=xl[i];a.forEach(f),d(t),s.clear();function f(h){!h||s.has(h)||(s.add(h),h.parentNode&&f(h.parentNode))}function d(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,p=>{if(s.has(p))d(p);else{const v=o?p.getAttribute(o):null,g=v!==null&&v!=="false",C=(ta.get(p)||0)+1,m=(c.get(p)||0)+1;ta.set(p,C),c.set(p,m),l.push(p),C===1&&g&&wl.add(p),m===1&&p.setAttribute(i,""),!g&&o&&p.setAttribute(o,"true")}})}return bd++,()=>{l.forEach(h=>{const p=(ta.get(h)||0)-1,v=(c.get(h)||0)-1;ta.set(h,p),c.set(h,v),p||(!wl.has(h)&&o&&h.removeAttribute(o),wl.delete(h)),v||h.removeAttribute(i)}),bd--,bd||(ta=new WeakMap,ta=new WeakMap,wl=new WeakSet,xl={})}}function mb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Yr(e[0]).body;return b3(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const mm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function C1(e,t){const n=pm(e,mm());t==="prev"&&n.reverse();const r=n.indexOf(aa(Yr(e)));return n.slice(r+1)[0]}function w1(){return C1(document.body,"next")}function x1(){return C1(document.body,"prev")}function Us(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Hn(n,r)}function S3(e){pm(e,mm()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function C3(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const n=t.dataset.tabindex;delete t.dataset.tabindex,n?t.setAttribute("tabindex",n):t.removeAttribute("tabindex")})}const ym={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let w3;function yb(e){e.key==="Tab"&&(e.target,clearTimeout(w3))}const $c=J.forwardRef(function(e,t){const[n,r]=J.useState();ur(()=>(nB()&&r("button"),document.addEventListener("keydown",yb),()=>{document.removeEventListener("keydown",yb)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[yu("focus-guard")]:"",style:ym};return J.createElement("span",Ra({},e,i))}),T1=J.createContext(null),gb=yu("portal");function x3(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=J.useState(null),o=jf(),a=I1(),s=J.useRef(null);return ur(()=>()=>{r==null||r.remove(),queueMicrotask(()=>{s.current=null})},[r]),ur(()=>{if(s.current)return;const u=t?document.getElementById(t):null;if(!u)return;const l=document.createElement("div");l.id=o,l.setAttribute(gb,""),u.appendChild(l),s.current=l,i(l)},[t,o]),ur(()=>{if(s.current)return;let u=n||(a==null?void 0:a.portalNode);u&&!Lt(u)&&(u=u.current),u=u||document.body;let l=null;t&&(l=document.createElement("div"),l.id=t,u.appendChild(l));const c=document.createElement("div");c.id=o,c.setAttribute(gb,""),u=l||u,u.appendChild(c),s.current=c,i(c)},[t,n,o,a]),r}function E1(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=x3({id:n,root:r}),[a,s]=J.useState(null),u=J.useRef(null),l=J.useRef(null),c=J.useRef(null),f=J.useRef(null),d=!!a&&!a.modal&&a.open&&i&&!!(r||o);return J.useEffect(()=>{if(!o||!i||a!=null&&a.modal)return;function h(p){o&&Us(p)&&(p.type==="focusin"?C3:S3)(o)}return o.addEventListener("focusin",h,!0),o.addEventListener("focusout",h,!0),()=>{o.removeEventListener("focusin",h,!0),o.removeEventListener("focusout",h,!0)}},[o,i,a==null?void 0:a.modal]),J.createElement(T1.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:l,beforeInsideRef:c,afterInsideRef:f,portalNode:o,setFocusManagerState:s}),[i,o])},d&&o&&J.createElement($c,{"data-type":"outside",ref:u,onFocus:h=>{if(Us(h,o)){var p;(p=c.current)==null||p.focus()}else{const v=x1()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus()}}}),d&&o&&J.createElement("span",{"aria-owns":o.id,style:ym}),o&&zb.createPortal(t,o),d&&o&&J.createElement($c,{"data-type":"outside",ref:l,onFocus:h=>{if(Us(h,o)){var p;(p=f.current)==null||p.focus()}else{const v=w1()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,h.nativeEvent))}}}))}const I1=()=>J.useContext(T1),bb=20;let lo=[];function Sd(e){lo=lo.filter(t=>t.isConnected),e&&ui(e)!=="body"&&(lo.push(e),lo.length>bb&&(lo=lo.slice(-bb)))}function Sb(){return lo.slice().reverse().find(e=>e.isConnected)}const T3=J.forwardRef(function(e,t){return J.createElement("button",Ra({},e,{type:"button",ref:t,tabIndex:-1,style:ym}))});function A1(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:a=0,returnFocus:s=!0,modal:u=!0,visuallyHiddenDismiss:l=!1,closeOnFocusOut:c=!0}=e,{open:f,refs:d,nodeId:h,onOpenChange:p,events:v,dataRef:g,elements:{domReference:C,floating:m}}=t,b=typeof a=="number"&&a<0,x=sB(C)&&b,T=y3()?o:!0,E=gd(i),A=gd(a),N=gd(s),I=vm(),P=I1(),_=J.useRef(null),L=J.useRef(null),U=J.useRef(!1),Y=J.useRef(!1),k=P!=null,ie=J.useCallback(function(j){return j===void 0&&(j=m),j?pm(j,mm()):[]},[m]),B=J.useCallback(j=>{const R=ie(j);return E.current.map(te=>C&&te==="reference"?C:m&&te==="floating"?m:R).filter(Boolean).flat()},[C,m,E,ie]);J.useEffect(()=>{if(r||!u)return;function j(te){if(te.key==="Tab"){Hn(m,aa(Yr(m)))&&ie().length===0&&!x&&md(te);const oe=B(),X=sa(te);E.current[0]==="reference"&&X===C&&(md(te),te.shiftKey?no(oe[oe.length-1]):no(oe[1])),E.current[1]==="floating"&&X===m&&te.shiftKey&&(md(te),no(oe[0]))}}const R=Yr(m);return R.addEventListener("keydown",j),()=>{R.removeEventListener("keydown",j)}},[r,C,m,u,E,x,ie,B]),J.useEffect(()=>{if(r||!c)return;function j(){Y.current=!0,setTimeout(()=>{Y.current=!1})}function R(te){const oe=te.relatedTarget;queueMicrotask(()=>{const X=!(Hn(C,oe)||Hn(m,oe)||Hn(oe,m)||Hn(P==null?void 0:P.portalNode,oe)||oe!=null&&oe.hasAttribute(yu("focus-guard"))||I&&(Bs(I.nodesRef.current,h).find(ae=>{var de,he;return Hn((de=ae.context)==null?void 0:de.elements.floating,oe)||Hn((he=ae.context)==null?void 0:he.elements.domReference,oe)})||m3(I.nodesRef.current,h).find(ae=>{var de,he;return((de=ae.context)==null?void 0:de.elements.floating)===oe||((he=ae.context)==null?void 0:he.elements.domReference)===oe})));oe&&X&&!Y.current&&oe!==Sb()&&(U.current=!0,p(!1,te))})}if(m&&On(C))return C.addEventListener("focusout",R),C.addEventListener("pointerdown",j),!u&&m.addEventListener("focusout",R),()=>{C.removeEventListener("focusout",R),C.removeEventListener("pointerdown",j),!u&&m.removeEventListener("focusout",R)}},[r,C,m,u,h,I,P,p,c]),J.useEffect(()=>{var j;if(r)return;const R=Array.from((P==null||(j=P.portalNode)==null?void 0:j.querySelectorAll("["+yu("portal")+"]"))||[]);if(m){const te=[m,...R,_.current,L.current,E.current.includes("reference")||x?C:null].filter(X=>X!=null),oe=u||x?mb(te,T,!T):mb(te);return()=>{oe()}}},[r,C,m,u,E,P,x,T]),ur(()=>{if(r||!m)return;const j=Yr(m),R=aa(j);queueMicrotask(()=>{const te=B(m),oe=A.current,X=(typeof oe=="number"?te[oe]:oe.current)||m,ae=Hn(m,R);!b&&!ae&&f&&no(X,{preventScroll:X===m})})},[r,f,m,b,B,A]),ur(()=>{if(r||!m)return;let j=!1;const R=Yr(m),te=aa(R),oe=g.current;Sd(te);function X(ae){let{reason:de,event:he,nested:Te}=ae;de==="escape-key"&&d.domReference.current&&Sd(d.domReference.current),de==="hover"&&he.type==="mouseleave"&&(U.current=!0),de==="outside-press"&&(Te?(U.current=!1,j=!0):U.current=!(eB(he)||tB(he)))}return v.on("openchange",X),()=>{v.off("openchange",X);const ae=aa(R),de=Hn(m,ae)||I&&Bs(I.nodesRef.current,h).some(Te=>{var ke;return Hn((ke=Te.context)==null?void 0:ke.elements.floating,ae)});(de||oe.openEvent&&["click","mousedown"].includes(oe.openEvent.type))&&d.domReference.current&&Sd(d.domReference.current);const he=Sb();N.current&&!U.current&&On(he)&&(!(he!==ae&&ae!==R.body)||de)&&no(he,{cancelPrevious:!1,preventScroll:j})}},[r,m,N,g,d,v,I,h]),ur(()=>{if(!(r||!P))return P.setFocusManagerState({modal:u,closeOnFocusOut:c,open:f,onOpenChange:p,refs:d}),()=>{P.setFocusManagerState(null)}},[r,P,u,f,p,d,c]),ur(()=>{if(r||!m||typeof MutationObserver!="function"||b)return;const j=()=>{const te=m.getAttribute("tabindex");E.current.includes("floating")||aa(Yr(m))!==d.domReference.current&&ie().length===0?te!=="0"&&m.setAttribute("tabindex","0"):te!=="-1"&&m.setAttribute("tabindex","-1")};j();const R=new MutationObserver(j);return R.observe(m,{childList:!0,subtree:!0,attributes:!0}),()=>{R.disconnect()}},[r,m,d,E,ie,b]);function G(j){return r||!l||!u?null:J.createElement(T3,{ref:j==="start"?_:L,onClick:R=>p(!1,R.nativeEvent)},typeof l=="string"?l:"Dismiss")}const fe=!r&&T&&(k||u);return J.createElement(J.Fragment,null,fe&&J.createElement($c,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:j=>{if(u){const te=B();no(i[0]==="reference"?te[0]:te[te.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(U.current=!1,Us(j,P.portalNode)){const te=w1()||C;te==null||te.focus()}else{var R;(R=P.beforeOutsideRef.current)==null||R.focus()}}}),!x&&G("start"),n,G("end"),fe&&J.createElement($c,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:j=>{if(u)no(B()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(c&&(U.current=!0),Us(j,P.portalNode)){const te=x1()||C;te==null||te.focus()}else{var R;(R=P.afterOutsideRef.current)==null||R.focus()}}}))}const Cd=new Set,$1=J.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;const i=jf();return ur(()=>{if(!n)return;Cd.add(i);const o=/iP(hone|ad|od)|iOS/.test(n1()),a=document.body.style,s=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,l=a.left?parseFloat(a.left):window.pageXOffset,c=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",u&&(a[s]=u+"px"),o){var f,d;const h=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,p=((d=window.visualViewport)==null?void 0:d.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(c-Math.floor(p))+"px",left:-(l-Math.floor(h))+"px",right:"0"})}return()=>{Cd.delete(i),Cd.size===0&&(Object.assign(a,{overflow:"",[s]:""}),o&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(l,c)))}},[i,n]),J.createElement("div",Ra({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function Cb(e){return On(e.target)&&e.target.tagName==="BUTTON"}function wb(e){return i1(e)}function O1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:a=!0,event:s="click",toggle:u=!0,ignoreMouse:l=!1,keyboardHandlers:c=!0}=t,f=J.useRef(),d=J.useRef(!1);return J.useMemo(()=>a?{reference:{onPointerDown(h){f.current=h.pointerType},onMouseDown(h){h.button===0&&(ob(f.current,!0)&&l||s!=="click"&&(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,h.nativeEvent,"click"):(h.preventDefault(),r(!0,h.nativeEvent,"click"))))},onClick(h){if(s==="mousedown"&&f.current){f.current=void 0;return}ob(f.current,!0)&&l||(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,h.nativeEvent,"click"):r(!0,h.nativeEvent,"click"))},onKeyDown(h){f.current=void 0,!(h.defaultPrevented||!c||Cb(h))&&(h.key===" "&&!wb(o)&&(h.preventDefault(),d.current=!0),h.key==="Enter"&&r(!(n&&u),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!c||Cb(h)||wb(o)||h.key===" "&&d.current&&(d.current=!1,r(!(n&&u),h.nativeEvent,"click"))}}}:{},[a,i,s,l,c,o,u,n,r])}const E3={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},I3={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},xb=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function D1(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:i,elements:{reference:o,domReference:a,floating:s},dataRef:u}=e,{enabled:l=!0,escapeKey:c=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:h=!1,referencePressEvent:p="pointerdown",ancestorScroll:v=!1,bubbles:g,capture:C}=t,m=vm(),b=ua(typeof f=="function"?f:()=>!1),x=typeof f=="function"?b:f,T=J.useRef(!1),E=J.useRef(!1),{escapeKey:A,outsidePress:N}=xb(g),{escapeKey:I,outsidePress:P}=xb(C),_=ua(k=>{if(!n||!l||!c||k.key!=="Escape")return;const ie=m?Bs(m.nodesRef.current,i):[];if(!A&&(k.stopPropagation(),ie.length>0)){let B=!0;if(ie.forEach(G=>{var fe;if((fe=G.context)!=null&&fe.open&&!G.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,iB(k)?k.nativeEvent:k,"escape-key")}),L=ua(k=>{var ie;const B=()=>{var G;_(k),(G=sa(k))==null||G.removeEventListener("keydown",B)};(ie=sa(k))==null||ie.addEventListener("keydown",B)}),U=ua(k=>{const ie=T.current;T.current=!1;const B=E.current;if(E.current=!1,d==="click"&&B||ie||typeof x=="function"&&!x(k))return;const G=sa(k),fe="["+yu("inert")+"]",j=Yr(s).querySelectorAll(fe);let R=Lt(G)?G:null;for(;R&&!Na(R);){const X=Ro(R);if(Na(X)||!Lt(X))break;R=X}if(j.length&&Lt(G)&&!oB(G)&&!Hn(G,s)&&Array.from(j).every(X=>!Hn(R,X)))return;if(On(G)&&s){const X=G.clientWidth>0&&G.scrollWidth>G.clientWidth,ae=G.clientHeight>0&&G.scrollHeight>G.clientHeight;let de=ae&&k.offsetX>G.clientWidth;if(ae&&tr(G).direction==="rtl"&&(de=k.offsetX<=G.offsetWidth-G.clientWidth),de||X&&k.offsetY>G.clientHeight)return}const te=m&&Bs(m.nodesRef.current,i).some(X=>{var ae;return vd(k,(ae=X.context)==null?void 0:ae.elements.floating)});if(vd(k,s)||vd(k,a)||te)return;const oe=m?Bs(m.nodesRef.current,i):[];if(oe.length>0){let X=!0;if(oe.forEach(ae=>{var de;if((de=ae.context)!=null&&de.open&&!ae.context.dataRef.current.__outsidePressBubbles){X=!1;return}}),!X)return}r(!1,k,"outside-press")}),Y=ua(k=>{var ie;const B=()=>{var G;U(k),(G=sa(k))==null||G.removeEventListener(d,B)};(ie=sa(k))==null||ie.addEventListener(d,B)});return J.useEffect(()=>{if(!n||!l)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=N;function k(G){r(!1,G,"ancestor-scroll")}const ie=Yr(s);c&&ie.addEventListener("keydown",I?L:_,I),x&&ie.addEventListener(d,P?Y:U,P);let B=[];return v&&(Lt(a)&&(B=Mi(a)),Lt(s)&&(B=B.concat(Mi(s))),!Lt(o)&&o&&o.contextElement&&(B=B.concat(Mi(o.contextElement)))),B=B.filter(G=>{var fe;return G!==((fe=ie.defaultView)==null?void 0:fe.visualViewport)}),B.forEach(G=>{G.addEventListener("scroll",k,{passive:!0})}),()=>{c&&ie.removeEventListener("keydown",I?L:_,I),x&&ie.removeEventListener(d,P?Y:U,P),B.forEach(G=>{G.removeEventListener("scroll",k)})}},[u,s,a,o,c,x,d,n,r,v,l,A,N,_,I,L,U,P,Y]),J.useEffect(()=>{T.current=!1},[x,d]),J.useMemo(()=>l?{reference:{onKeyDown:_,[E3[p]]:k=>{h&&r(!1,k.nativeEvent,"reference-press")}},floating:{onKeyDown:_,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[I3[d]]:()=>{T.current=!0}}}:{},[l,h,d,p,r,_])}let lh;process.env.NODE_ENV!=="production"&&(lh=new Set);function N1(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const N="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((o=e.elements)!=null&&o.reference&&!Lt(e.elements.reference)){var a;if(!((a=lh)!=null&&a.has(N))){var s;(s=lh)==null||s.add(N),console.error(N)}}}const[u,l]=J.useState(null),c=((t=e.elements)==null?void 0:t.reference)||u,f=VB(e),d=vm(),h=v3()!=null,p=ua((N,I,P)=>{N&&(g.current.openEvent=I),C.emit("openchange",{open:N,event:I,reason:P,nested:h}),r==null||r(N,I,P)}),v=J.useRef(null),g=J.useRef({}),C=J.useState(()=>d3())[0],m=jf(),b=J.useCallback(N=>{const I=Lt(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),contextElement:N}:N;f.refs.setReference(I)},[f.refs]),x=J.useCallback(N=>{(Lt(N)||N===null)&&(v.current=N,l(N)),(Lt(f.refs.reference.current)||f.refs.reference.current===null||N!==null&&!Lt(N))&&f.refs.setReference(N)},[f.refs]),T=J.useMemo(()=>({...f.refs,setReference:x,setPositionReference:b,domReference:v}),[f.refs,x,b]),E=J.useMemo(()=>({...f.elements,domReference:c}),[f.elements,c]),A=J.useMemo(()=>({...f,refs:T,elements:E,dataRef:g,nodeId:i,floatingId:m,events:C,open:n,onOpenChange:p}),[f,i,m,C,n,p,T,E]);return ur(()=>{const N=d==null?void 0:d.nodesRef.current.find(I=>I.id===i);N&&(N.context=A)}),J.useMemo(()=>({...f,context:A,refs:T,elements:E}),[f,T,E,A])}const Tb="active",Eb="selected";function wd(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[Tb]:a,[Eb]:s,...u}=e;o=u}return{...n==="floating"&&{tabIndex:-1},...o,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(u=>{let[l,c]=u;if(!(i&&[Tb,Eb].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof c=="function"){var f;(f=r.get(l))==null||f.push(c),a[l]=function(){for(var d,h=arguments.length,p=new Array(h),v=0;v<h;v++)p[v]=arguments[v];return(d=r.get(l))==null?void 0:d.map(g=>g(...p)).find(g=>g!==void 0)}}}else a[l]=c}),a),{})}}function P1(e){e===void 0&&(e=[]);const t=e,n=J.useCallback(o=>wd(o,e,"reference"),t),r=J.useCallback(o=>wd(o,e,"floating"),t),i=J.useCallback(o=>wd(o,e,"item"),e.map(o=>o==null?void 0:o.item));return J.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}function A3(e={}){const{initialOpen:t=!1,open:n,onOpenChange:r}=e,[i,o]=J.useState(t),a=n??i,s=r??o,u=N1({open:a,onOpenChange:s}),l=u.context,c=O1(l,{enabled:n==null}),f=D1(l,{outsidePressEvent:"mousedown"}),d=P1([c,f]);return J.useMemo(()=>({open:a,setOpen:s,...d,...u}),[a,s,d,u])}const R1=J.createContext(null),k1=()=>{const e=J.useContext(R1);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function $3({children:e,...t}){const n=A3(t);return $.jsx(R1.Provider,{value:n,children:e})}const M1=Lv`
|
|
1157
1157
|
display: flex;
|
|
1158
1158
|
justify-content: center;
|
|
1159
1159
|
align-items: center;
|
|
1160
1160
|
z-index: 100;
|
|
1161
1161
|
padding: var(--space-md-fixed);
|
|
1162
|
-
`,
|
|
1163
|
-
${
|
|
1164
|
-
`,
|
|
1162
|
+
`,O3=Ae($1)`
|
|
1163
|
+
${M1};
|
|
1164
|
+
`,D3=O.forwardRef((e,t)=>{const{style:n,children:r,components:i,...o}=e,a=k1(),s=hm([a.refs.setFloating,t]),u=(i==null?void 0:i.Overlay)??O3;return $.jsx(E1,{children:$.jsx(u,{lockScroll:!0,children:$.jsx(A1,{context:a.context,children:$.jsx("div",{ref:s,...a.getFloatingProps(o),children:r})})})})}),N3=D3;function j1(e){const t=O.useContext(vu),[n,r]=O.useState(t);return $.jsx(vu.Provider,{value:n,children:e.children})}const P3=O.forwardRef((e,t)=>{const{setOpen:n}=k1();return $.jsx("button",{type:"button",...e,ref:t,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),R3=P3,k3=Ae.span`
|
|
1165
1165
|
color: var(--color-explain-header-value-color);
|
|
1166
1166
|
overflow: hidden;
|
|
1167
1167
|
white-space: nowrap;
|
|
1168
1168
|
text-overflow: ellipsis;
|
|
1169
|
-
`;function
|
|
1169
|
+
`;function _1(e){const{explainQuestion:t}=di(),{configurationSubjectTitle:n,componentDecisionStateIncludedLabel:r,componentDecisionStateExcludedLabel:i,booleanDecisionStateFalseLabel:o,booleanDecisionStateTrueLabel:a,isBlockedSuffix:s,isNotSatisfiedSuffix:u,generalConflictTitle:l}=am();if(!t)return $.jsx("div",{...e,children:l});const c=H(t).returnType().with({subject:Ue.configuration},()=>n).with({subject:Ue.attribute},d=>Rf(d.attributeId)??d.attributeId.localId).with({subject:Ue.choiceValue},d=>Vu(d.attributeId)[d.choiceValueId]??d.choiceValueId).with({subject:Ue.component,state:Ge.Included},()=>r).with({subject:Ue.component,state:Ge.Excluded},()=>i).with({subject:Ue.boolean,state:!0},()=>a).with({subject:Ue.boolean,state:!1},()=>o).with({subject:Ue.numeric},d=>d.state.toString()).exhaustive(),f=H(t).returnType().with({question:Ft.whyIsStateNotPossible},()=>s).with({question:Ft.whyIsNotSatisfied},()=>u).exhaustive();return $.jsxs("div",{...e,children:[$.jsx(k3,{children:c})," ",f]})}const M3=Ae.div`
|
|
1170
1170
|
position: sticky;
|
|
1171
1171
|
top: 0;
|
|
1172
1172
|
transition: all 0.1s;
|
|
@@ -1180,7 +1180,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1180
1180
|
@media only screen and (min-resolution: 2dppx) {
|
|
1181
1181
|
border-top-width: 0.5px;
|
|
1182
1182
|
}
|
|
1183
|
-
`;function
|
|
1183
|
+
`;function j3(e){const[t,n]=O.useState(!1),r=O.useRef(null);return O.useEffect(()=>{const i=new IntersectionObserver(([a])=>n(!a.isIntersecting),{root:null,threshold:1}),o=r.current;return o&&i.observe(o),()=>{o&&i.unobserve(o)}},[]),$.jsxs($.Fragment,{children:[$.jsx("div",{ref:r}),$.jsx(M3,{...Lx(e,{className:NV(t&&"active")})})]})}const _3=Ae(D.motion.div)`
|
|
1184
1184
|
position: relative;
|
|
1185
1185
|
background-color: var(--color-explain-dialog-fill);
|
|
1186
1186
|
backdrop-filter: var(--backdrop-filter-explain-dialog);
|
|
@@ -1199,16 +1199,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1199
1199
|
max-height: min(calc(100vh - var(--space-md) * 2), 700px);
|
|
1200
1200
|
max-width: min(calc(100vw - var(--space-md) * 2), 700px);
|
|
1201
1201
|
min-width: min(calc(100vw - var(--space-md) * 2), 500px);
|
|
1202
|
-
`,
|
|
1202
|
+
`,q3=Ae.div`
|
|
1203
1203
|
overflow-y: auto;
|
|
1204
1204
|
grid-area: content;
|
|
1205
1205
|
padding-left: var(--space-xs-fixed);
|
|
1206
1206
|
padding-right: var(--space-xs-fixed);
|
|
1207
1207
|
padding-bottom: var(--space-xs-fixed);
|
|
1208
|
-
`,
|
|
1208
|
+
`,F3=Ae(j3)`
|
|
1209
1209
|
margin-left: calc(var(--space-xs-fixed) * -1);
|
|
1210
1210
|
margin-right: calc(var(--space-xs-fixed) * -1);
|
|
1211
|
-
`,
|
|
1211
|
+
`,L3=Ae(R3)`
|
|
1212
1212
|
position: absolute;
|
|
1213
1213
|
right: var(--space-sm-fixed);
|
|
1214
1214
|
top: var(--space-sm-fixed);
|
|
@@ -1223,7 +1223,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1223
1223
|
outline: 2px solid var(--color-explain-dialog-close-button-outline);
|
|
1224
1224
|
outline-offset: 1px;
|
|
1225
1225
|
}
|
|
1226
|
-
`,
|
|
1226
|
+
`,V3=Ae(_1)`
|
|
1227
1227
|
grid-area: header;
|
|
1228
1228
|
font-size: var(--text-md);
|
|
1229
1229
|
font-weight: 500;
|
|
@@ -1235,7 +1235,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1235
1235
|
text-overflow: ellipsis;
|
|
1236
1236
|
margin-right: var(--space-md);
|
|
1237
1237
|
margin-left: calc(var(--space-xs-fixed) + var(--space-sm-fixed));
|
|
1238
|
-
`,
|
|
1238
|
+
`,B3={initial:{opacity:0,scale:.5},open:{opacity:1,scale:1,transition:{type:"spring",stiffness:600,damping:40}},close:{opacity:0,scale:.7,transition:{duration:.1,ease:"cubicInOut"}}};function U3(e){return $.jsxs(_3,{variants:B3,initial:"initial",animate:"open",exit:"close",children:[$.jsx(V3,{}),$.jsxs(q3,{children:[$.jsx(F3,{}),e.children]}),$.jsx(L3,{children:$.jsx(zi,{icon:ax})})]})}const G3=Ae(N3)`
|
|
1239
1239
|
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1240
1240
|
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1241
1241
|
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
@@ -1257,9 +1257,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1257
1257
|
&:focus {
|
|
1258
1258
|
outline: none;
|
|
1259
1259
|
}
|
|
1260
|
-
`;function
|
|
1261
|
-
${
|
|
1262
|
-
`;function KB(e){return $.jsx(HB,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}function YB(e){const[t,n]=O.useState(null),{explain:r,applySolution:i}=k0(),o=O.useRef(null),a=O.useCallback(async(h,p,v,g)=>{const C=pv();o.current=C,n(null);try{const m=await h(),b=m,x=m,T=(b==null?void 0:b.decisionExplanations)??[],E=(x==null?void 0:x.constraintExplanations)??[];C==o.current&&n({controlId:g,displayMode:T.length===0&&E.length>0?"dialog":v,explainQuestion:p,hasError:!1,decisionExplanations:JB(T),constraintExplanations:E})}catch{C==o.current&&n({controlId:g,displayMode:v,explainQuestion:p,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=O.useCallback((h,p,v)=>{const g=typeof h=="function"?h($w):h;return a(()=>e.explainConstraints?r(g,"full"):r(g,"decisions"),g,p,v)},[e.explainConstraints,r,a]),u=O.useCallback((h,p,v)=>a(()=>Promise.resolve(h),null,p,v),[a]),l=O.useCallback(()=>{n(null)},[]),c=O.useCallback(async h=>{await i(h),l()},[i,l]),f=O.useCallback(h=>{n(p=>p!=null?{...p,displayMode:h}:p)},[]),d=O.useMemo(()=>({process:t,applySolution:c,explain:s,handleExplainAnswer:u,dismiss:l,switchMode:f}),[t,c,s,u,l,f]);return $.jsx(hu.Provider,{value:d,children:e.children})}function JB(e){const t=y(yw,Zr(r=>r.solution==null)),n=y(of,Zr(r=>r.causedByDecisions.length));return y(e,X2([t,n]))}const ka=new Map;function $c(e){const{singletonId:t,children:n}=e,[r,i]=O.useState(!1),o=O.useRef({chose:()=>i(!0)});return O.useEffect(()=>(XB(t,o.current),()=>QB(t,o.current)),[]),r?$.jsx($.Fragment,{children:n}):null}function XB(e,t){eU(e).candidates.add(t),j1(e)}function QB(e,t){let n=ka.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),ZB(e),j1(e))}function j1(e){let t=ka.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function ZB(e){let t=ka.get(e);t==null||t.candidates.size>0||ka.delete(e)}function eU(e){let t=ka.get(e);return t==null&&(t={chosen:null,candidates:new Set},ka.set(e,t)),t}const fr={attributeId:{title:"Attribute Id",type:D.ControlType.String},componentPath:{title:"Component Path",type:D.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:D.ControlType.String}},Eb={description:{title:"Description",type:D.ControlType.String},regex:{title:"Regex",type:D.ControlType.String},direction:{title:"Direction",type:D.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:D.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},tU={choiceValueSorting:{title:"Choice Value Sorting",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:Eb}},attributes:{title:"Attribute",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...fr,choiceValues:{title:"Choice Values",type:D.ControlType.Array,control:{type:D.ControlType.String}},rules:{title:"Rules",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:Eb}}}}},jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}}};function nU(e,t){const n=[],r=(o,a)=>{const s=n.find(l=>e.equals(l.first,o)&&e.equals(l.second,a));if(s)return s.ordering;const u=t.compare(o,a);return n.push({first:o,second:a,ordering:u}),u},i=za(r);return{cachedOrderings:n,...i}}function rU(){const e=[];return{getCache:(t,n)=>{const r=e.find(o=>o.eq===t&&o.ord===n);if(r)return r.ordCache;const i=nU(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}const _1=ev(),iU=new Intl.Collator("en",{sensitivity:"base"}),oU=new Intl.Collator("en",{sensitivity:"variant"}),aU={regex:".*",direction:"asc",mode:"string"},sU=y([iU,oU],z(vU),lv(ev())),uU=y(yw,Zr(e=>Ii(e))),lU=of;function cU(e,t){return y((t==null?void 0:t.attributes)??[],Pt(n=>Nu(un(n),e)),K(n=>[fU(n.choiceValues??[]),Ib(n.rules??[])]),Qe(()=>[Ib((t==null?void 0:t.defaultRules)??[])]),QC(q1(aU)),lv(_1))}function fU(e){return y(of,Xs,sw,Xs,Zr(t=>y(e,ZC(n=>ot.equals(t,n)))))}function Ib(e){return y(e,z(q1),lv(_1))}function q1(e){const t=gP(()=>new RegExp(e.regex)),n=H(e.mode).returnType().with("string",()=>dU(e.direction)).with("numeric",()=>pU(e.direction)).with("isMatch",()=>hU(e.direction)).exhaustive();return y(n,Zr(r=>y(t,bP(i=>(i.lastIndex=0,i[Symbol.match](r))),Fn(i=>y(i,ep(1),rp(()=>y(i,ep(0))))))))}function dU(e){return y(sU,ym(e),F1)}function pU(e){return y(lU,ym(e),F1,Zr(Fn(uR)))}function hU(e){return y(uU,ym(e))}function F1(e){return y(e,Xs,sw,Xs)}function ym(e){return t=>H(e).returnType().with("asc",()=>t).with("desc",()=>Xs(t)).exhaustive()}function vU(e){return za((t,n)=>H(e.compare(t,n)).returnType().with(qe.number.gt(0),()=>1).with(qe.number.lt(0),()=>-1).otherwise(()=>0))}const mU=rU(),L1=O.createContext(null);function Oc(e,t,n){const r=O.useContext(L1),i=O.useMemo(()=>y(cU(e,r),a=>mU.getCache(ot,a),Zr(a=>y(t,vw(a.id),ei(()=>a.id,s=>s)))),[t]),{attribute:o}=rs(e);return y(n??(o==null?void 0:o.values)??[],af(i))}const yU={localization:{title:"Localization",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}}},V1=Er(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:r,sessionCreateUrl:i,sessionDeleteUrl:o,deploymentName:a,channel:s,children:u,explainDialogProps:l,explainPopoverProps:c,explainConstraints:f}=e,{activeLocale:d}=D.useLocaleInfo(),h=d.code;if(O.useEffect(()=>{console.info("Current locale code:",h)},[h]),Gt())return $.jsxs($.Fragment,{children:[u,$.jsx($c,{singletonId:"Configuration",children:$.jsx(Qg,{})})]});const p=O.useMemo(()=>SM({hcaEngineBaseUrl:S5(t,"api","engine"),sessionHandler:H(n).with("client-side",()=>({accessToken:r})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:o})).exhaustive()}),[t,n,r,i,o]),v=O.useMemo(()=>{var m;return y(ye((m=e.attributeRelations)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),Mn)},[e.attributeRelations]),g=O.useMemo(()=>{var m;return y(ye((m=e.choiceValueSorting)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),uw(()=>ye(e.choiceValueSorting)),Qe(()=>({attributes:[],defaultRules:[]})))},[e.choiceValueSorting]),C=O.useMemo(()=>{var m;return y(ye((m=e.localization)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),Qe(()=>({attributes:[],choiceValues:[]})))},[e.localization]);return $.jsxs($.Fragment,{children:[$.jsxs(yq,{configuratorClient:p,configurationModelSource:{type:Li.Channel,channel:s,deploymentName:a},attributeRelations:v,allowedInExplain:{rules:{type:vn.all}},children:[$.jsx(C5,{...e}),$.jsx(O.Suspense,{children:$.jsx(gq,{children:$.jsx(Nf.Provider,{value:C,children:$.jsxs(YB,{explainConstraints:f,children:[$.jsx(tm.Provider,{value:c,children:$.jsx(L1.Provider,{value:g,children:u})}),$.jsx(zB,{...l})]})})})})]}),$.jsx($c,{singletonId:"Configuration",children:$.jsx(Qg,{})})]})}),gU=V1;D.addPropertyControls(V1,{children:{title:"Content",type:D.ControlType.ComponentInstance},channel:{type:D.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:D.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:D.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:D.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:D.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:D.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:D.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:D.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:D.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:D.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:D.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:D.ControlType.Object,optional:!1,controls:N5,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:D.ControlType.Object,optional:!1,controls:D5,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:D.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}},...tU,...yU});const B1={padding:{type:D.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}},bU=e=>({paddingTop:e.isMixedPadding?e.paddingTop:e.padding,paddingRight:e.isMixedPadding?e.paddingRight:e.padding,paddingBottom:e.isMixedPadding?e.paddingBottom:e.padding,paddingLeft:e.isMixedPadding?e.paddingLeft:e.padding}),SU={radius:{title:"Radius",type:D.ControlType.Number,defaultValue:6},...B1,border:{title:"Border",type:D.ControlType.Object,controls:{color:{type:D.ControlType.Color,title:"Color"},width:{type:D.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}}}},CU=e=>{var t,n,r,i,o,a,s,u,l,c,f,d,h;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(r=e.border)==null?void 0:r.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(o=e.border)!=null&&o.isMixedWidth?(a=e.border)==null?void 0:a.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(u=e.border)!=null&&u.isMixedWidth?(l=e.border)==null?void 0:l.widthBottom:(c=e.border)==null?void 0:c.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(h=e.border)==null?void 0:h.width}},wU={fill:{title:"Fill",type:D.ControlType.Color,defaultValue:"#EBEBEB"},...B1,...SU},xU=e=>({...bU(e),...CU(e),backgroundColor:e.fill}),TU={color:{title:"Color",type:D.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:D.ControlType.Number,defaultValue:16}},EU=e=>({color:e.color,fontSize:e.fontSize}),us={explain:{title:"Explain",type:D.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},uh={type:D.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:D.ControlType.Color,optional:!0},color:{title:"Color",type:D.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:D.ControlType.Color,optional:!0}}},U1={...fr,...TU,...wU,implicitLabelPrefix:{title:"Implicit Label Prefix",type:D.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...uh,title:"Unsatisfied Colors"},implicitSelectedColors:{...uh,title:"Implicit Selected Colors"},...us},lh=(e,t,n)=>{var r,i,o,a,s,u;const l=xU(e),c=EU(e);return{...l,...c,backgroundColor:H({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(r=e.unsatisfiedColors)==null?void 0:r.fill,implicitSelectedFill:(i=e.implicitSelectedColors)==null?void 0:i.fill}).with({isSatisfied:!1,unsatisfiedFill:qe.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:qe.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>l.backgroundColor),borderColor:H({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(o=e.unsatisfiedColors)==null?void 0:o.borderColor,implicitSelectedBorderColor:(a=e.implicitSelectedColors)==null?void 0:a.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:qe.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:qe.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>l.borderColor),color:H({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(s=e.unsatisfiedColors)==null?void 0:s.color,implicitSelectedColor:(u=e.implicitSelectedColors)==null?void 0:u.color}).with({isSatisfied:!1,unsatisfiedColor:qe.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:qe.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>c.color),...e.style}},gm={...U1,resetLabel:{title:"Reset Label",type:D.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:D.ControlType.String,defaultValue:"Blocked"},appearance:{title:"Appearance",type:D.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]},textAlign:{title:"Text Align",type:D.ControlType.Enum,defaultValue:"initial",options:["initial","start","center","end"]}},Ma=(e,t,n)=>({...lh(e,t,n),appearance:e.appearance,textAlign:e.textAlign});function ci(){const{explain:e,handleExplainAnswer:t}=O.useContext(hu);return{explain:e,handleExplainAnswer:t}}function IU(e={}){const{initialOpen:t=!1,placement:n="top",modal:r=!1,open:i,onOpenChange:o,arrow:a}=e,[s,u]=O.useState(t),l=i??s,c=o??u,f=O1({placement:n,open:l,onOpenChange:c,whileElementsMounted:j3,middleware:[b3(((a==null?void 0:a.height)??0)+5),q3({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),_3({padding:5}),...a?[L3(a)]:[]]}),d=f.context,h=A1(d,{enabled:i==null}),p=$1(d),v=D1([h,p]);return O.useMemo(()=>({open:l,setOpen:c,...v,...f,modal:r,arrow:a}),[l,c,v,f,r,a])}const G1=O.createContext(null),Uu=()=>{const e=O.useContext(G1);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function AU({children:e,...t}){const n=IU(t);return $.jsx(G1.Provider,{value:n,children:e})}const $U=O.forwardRef(function(e,t){const n=O.Children.toArray(e.children)[0],r=Uu(),i=e.children.ref,o=pm([r.refs.setReference,t,i]);return O.isValidElement(n)?O.cloneElement(n,r.getReferenceProps({ref:o,...e,...n.props,"data-state":r.open?"open":"closed"})):$.jsx("span",{children:"Not valid children for PopoverTrigger"})}),OU=$U,DU=Ae.div`
|
|
1260
|
+
`;function z3(e){const t=di(),n=(t==null?void 0:t.displayMode)==="dialog";return $.jsx($3,{open:n,onOpenChange:r=>!r&&n&&(t==null?void 0:t.dismiss()),children:$.jsx(W3,{...e,isOpen:n,children:O.Children.toArray(e.content)[0]??$.jsx(U3,{children:$.jsx(Q5,{})})})})}function W3(e){return $.jsx(D.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(om.Provider,{value:e,children:$.jsx(G3,{...e,components:{Overlay:K3},children:$.jsx(j1,{children:e.children})})})})}const H3=Ae(D.motion($1))`
|
|
1261
|
+
${M1}
|
|
1262
|
+
`;function K3(e){return $.jsx(H3,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}function Y3(e){const[t,n]=O.useState(null),{explain:r,applySolution:i}=M0(),o=O.useRef(null),a=O.useCallback(async(h,p,v,g)=>{const C=vv();o.current=C,n(null);try{const m=await h(),b=m,x=m,T=(b==null?void 0:b.decisionExplanations)??[],E=(x==null?void 0:x.constraintExplanations)??[];C==o.current&&n({controlId:g,displayMode:T.length===0&&E.length>0?"dialog":v,explainQuestion:p,hasError:!1,decisionExplanations:J3(T),constraintExplanations:E})}catch{C==o.current&&n({controlId:g,displayMode:v,explainQuestion:p,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=O.useCallback((h,p,v)=>{const g=typeof h=="function"?h(Ow):h;return a(()=>e.explainConstraints?r(g,"full"):r(g,"decisions"),g,p,v)},[e.explainConstraints,r,a]),u=O.useCallback((h,p,v)=>a(()=>Promise.resolve(h),null,p,v),[a]),l=O.useCallback(()=>{n(null)},[]),c=O.useCallback(async h=>{await i(h),l()},[i,l]),f=O.useCallback(h=>{n(p=>p!=null?{...p,displayMode:h}:p)},[]),d=O.useMemo(()=>({process:t,applySolution:c,explain:s,handleExplainAnswer:u,dismiss:l,switchMode:f}),[t,c,s,u,l,f]);return $.jsx(vu.Provider,{value:d,children:e.children})}function J3(e){const t=y(gw,ni(r=>r.solution==null)),n=y(af,ni(r=>r.causedByDecisions.length));return y(e,Q2([t,n]))}const ka=new Map;function Oc(e){const{singletonId:t,children:n}=e,[r,i]=O.useState(!1),o=O.useRef({chose:()=>i(!0)});return O.useEffect(()=>(X3(t,o.current),()=>Q3(t,o.current)),[]),r?$.jsx($.Fragment,{children:n}):null}function X3(e,t){eU(e).candidates.add(t),q1(e)}function Q3(e,t){let n=ka.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),Z3(e),q1(e))}function q1(e){let t=ka.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function Z3(e){let t=ka.get(e);t==null||t.candidates.size>0||ka.delete(e)}function eU(e){let t=ka.get(e);return t==null&&(t={chosen:null,candidates:new Set},ka.set(e,t)),t}const nr={attributeId:{title:"Attribute Id",type:D.ControlType.String},componentPath:{title:"Component Path",type:D.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:D.ControlType.String}},Ib={description:{title:"Description",type:D.ControlType.String},regex:{title:"Regex",type:D.ControlType.String},direction:{title:"Direction",type:D.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:D.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},tU={choiceValueSorting:{title:"Choice Value Sorting",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:Ib}},attributes:{title:"Attribute",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...nr,choiceValues:{title:"Choice Values",type:D.ControlType.Array,control:{type:D.ControlType.String}},rules:{title:"Rules",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:Ib}}}}},jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}}};function nU(e,t){const n=[],r=(o,a)=>{const s=n.find(l=>e.equals(l.first,o)&&e.equals(l.second,a));if(s)return s.ordering;const u=t.compare(o,a);return n.push({first:o,second:a,ordering:u}),u},i=za(r);return{cachedOrderings:n,...i}}function rU(){const e=[];return{getCache:(t,n)=>{const r=e.find(o=>o.eq===t&&o.ord===n);if(r)return r.ordCache;const i=nU(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}const F1=nv(),iU=new Intl.Collator("en",{sensitivity:"base"}),oU=new Intl.Collator("en",{sensitivity:"variant"}),aU={regex:".*",direction:"asc",mode:"string"},sU=y([iU,oU],z(vU),fv(nv())),uU=y(gw,ni(e=>Ai(e))),lU=af;function cU(e,t){return y((t==null?void 0:t.attributes)??[],Pt(n=>Pu(tn(n),e)),K(n=>[fU(n.choiceValues??[]),Ab(n.rules??[])]),Qe(()=>[Ab((t==null?void 0:t.defaultRules)??[])]),ZC(L1(aU)),fv(F1))}function fU(e){return y(af,Qs,uw,Qs,ni(t=>y(e,ew(n=>ot.equals(t,n)))))}function Ab(e){return y(e,z(L1),fv(F1))}function L1(e){const t=bP(()=>new RegExp(e.regex)),n=H(e.mode).returnType().with("string",()=>dU(e.direction)).with("numeric",()=>pU(e.direction)).with("isMatch",()=>hU(e.direction)).exhaustive();return y(n,ni(r=>y(t,SP(i=>(i.lastIndex=0,i[Symbol.match](r))),Fn(i=>y(i,np(1),op(()=>y(i,np(0))))))))}function dU(e){return y(sU,gm(e),V1)}function pU(e){return y(lU,gm(e),V1,ni(Fn(lR)))}function hU(e){return y(uU,gm(e))}function V1(e){return y(e,Qs,uw,Qs)}function gm(e){return t=>H(e).returnType().with("asc",()=>t).with("desc",()=>Qs(t)).exhaustive()}function vU(e){return za((t,n)=>H(e.compare(t,n)).returnType().with(qe.number.gt(0),()=>1).with(qe.number.lt(0),()=>-1).otherwise(()=>0))}const mU=rU(),B1=O.createContext(null);function Dc(e,t,n){const r=O.useContext(B1),i=O.useMemo(()=>y(cU(e,r),a=>mU.getCache(ot,a),ni(a=>y(t,mw(a.id),ri(()=>a.id,s=>s)))),[t]),{attribute:o}=rs(e);return y(n??(o==null?void 0:o.values)??[],sf(i))}const yU={localization:{title:"Localization",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}}},U1=hr(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:r,sessionCreateUrl:i,sessionDeleteUrl:o,deploymentName:a,channel:s,children:u,explainDialogProps:l,explainPopoverProps:c,explainConstraints:f}=e,{activeLocale:d}=D.useLocaleInfo(),h=d.code;if(O.useEffect(()=>{console.info("Current locale code:",h)},[h]),Gt())return $.jsxs($.Fragment,{children:[u,$.jsx(Oc,{singletonId:"Configuration",children:$.jsx(Zg,{})})]});const p=O.useMemo(()=>CM({hcaEngineBaseUrl:C5(t,"api","engine"),sessionHandler:H(n).with("client-side",()=>({accessToken:r})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:o})).exhaustive()}),[t,n,r,i,o]),v=O.useMemo(()=>{var m;return y(ye((m=e.attributeRelations)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),Mn)},[e.attributeRelations]),g=O.useMemo(()=>{var m;return y(ye((m=e.choiceValueSorting)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),lw(()=>ye(e.choiceValueSorting)),Qe(()=>({attributes:[],defaultRules:[]})))},[e.choiceValueSorting]),C=O.useMemo(()=>{var m;return y(ye((m=e.localization)==null?void 0:m.jsonDefinition),Mt(b=>b.length>0),K(b=>JSON.parse(b)),Qe(()=>({attributes:[],choiceValues:[]})))},[e.localization]);return $.jsxs($.Fragment,{children:[$.jsxs(gq,{configuratorClient:p,configurationModelSource:{type:Vi.Channel,channel:s,deploymentName:a},attributeRelations:v,allowedInExplain:{rules:{type:vn.all}},children:[$.jsx(w5,{...e}),$.jsx(O.Suspense,{children:$.jsx(bq,{children:$.jsx(Pf.Provider,{value:C,children:$.jsxs(Y3,{explainConstraints:f,children:[$.jsx(rm.Provider,{value:c,children:$.jsx(B1.Provider,{value:g,children:u})}),$.jsx(z3,{...l})]})})})})]}),$.jsx(Oc,{singletonId:"Configuration",children:$.jsx(Zg,{})})]})}),gU=U1;D.addPropertyControls(U1,{children:{title:"Content",type:D.ControlType.ComponentInstance},channel:{type:D.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:D.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:D.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:D.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:D.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:D.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:D.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:D.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:D.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:D.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:D.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:D.ControlType.Object,optional:!1,controls:P5,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:D.ControlType.Object,optional:!1,controls:N5,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:D.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:D.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:D.ControlType.String,displayTextArea:!0}}},...tU,...yU});const G1={padding:{type:D.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}},bU=e=>({paddingTop:e.isMixedPadding?e.paddingTop:e.padding,paddingRight:e.isMixedPadding?e.paddingRight:e.padding,paddingBottom:e.isMixedPadding?e.paddingBottom:e.padding,paddingLeft:e.isMixedPadding?e.paddingLeft:e.padding}),SU={radius:{title:"Radius",type:D.ControlType.Number,defaultValue:6},...G1,border:{title:"Border",type:D.ControlType.Object,controls:{color:{type:D.ControlType.Color,title:"Color"},width:{type:D.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}}}},CU=e=>{var t,n,r,i,o,a,s,u,l,c,f,d,h;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(r=e.border)==null?void 0:r.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(o=e.border)!=null&&o.isMixedWidth?(a=e.border)==null?void 0:a.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(u=e.border)!=null&&u.isMixedWidth?(l=e.border)==null?void 0:l.widthBottom:(c=e.border)==null?void 0:c.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(h=e.border)==null?void 0:h.width}},wU={fill:{title:"Fill",type:D.ControlType.Color,defaultValue:"#EBEBEB"},...G1,...SU},xU=e=>({...bU(e),...CU(e),backgroundColor:e.fill}),TU={color:{title:"Color",type:D.ControlType.Color,defaultValue:"black"},text:{title:"Text",type:D.ControlType.Font,controls:"basic",displayTextAlignment:!0,displayFontSize:!0}},EU=e=>({...e.text,color:e.color}),us={explain:{title:"Explain",type:D.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},ch={type:D.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:D.ControlType.Color,optional:!0},color:{title:"Color",type:D.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:D.ControlType.Color,optional:!0}}},z1={...nr,...TU,...wU,implicitLabelPrefix:{title:"Implicit Label Prefix",type:D.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...ch,title:"Unsatisfied Colors"},implicitSelectedColors:{...ch,title:"Implicit Selected Colors"},...us},fh=(e,t,n)=>{var r,i,o,a,s,u;const l=xU(e),c=EU(e);return{...l,...c,backgroundColor:H({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(r=e.unsatisfiedColors)==null?void 0:r.fill,implicitSelectedFill:(i=e.implicitSelectedColors)==null?void 0:i.fill}).with({isSatisfied:!1,unsatisfiedFill:qe.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:qe.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>l.backgroundColor),borderColor:H({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(o=e.unsatisfiedColors)==null?void 0:o.borderColor,implicitSelectedBorderColor:(a=e.implicitSelectedColors)==null?void 0:a.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:qe.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:qe.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>l.borderColor),color:H({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(s=e.unsatisfiedColors)==null?void 0:s.color,implicitSelectedColor:(u=e.implicitSelectedColors)==null?void 0:u.color}).with({isSatisfied:!1,unsatisfiedColor:qe.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:qe.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>c.color),...e.style}},bm={...z1,resetLabel:{title:"Reset Label",type:D.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:D.ControlType.String,defaultValue:"Blocked"},appearance:{title:"Appearance",type:D.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]}},Ma=(e,t,n)=>({...fh(e,t,n),appearance:e.appearance});function qr(){const{explain:e,handleExplainAnswer:t}=O.useContext(vu);return{explain:e,handleExplainAnswer:t}}function IU(e={}){const{initialOpen:t=!1,placement:n="top",modal:r=!1,open:i,onOpenChange:o,arrow:a}=e,[s,u]=O.useState(t),l=i??s,c=o??u,f=N1({placement:n,open:l,onOpenChange:c,whileElementsMounted:jB,middleware:[bB(((a==null?void 0:a.height)??0)+5),qB({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),_B({padding:5}),...a?[LB(a)]:[]]}),d=f.context,h=O1(d,{enabled:i==null}),p=D1(d),v=P1([h,p]);return O.useMemo(()=>({open:l,setOpen:c,...v,...f,modal:r,arrow:a}),[l,c,v,f,r,a])}const W1=O.createContext(null),zu=()=>{const e=O.useContext(W1);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function AU({children:e,...t}){const n=IU(t);return $.jsx(W1.Provider,{value:n,children:e})}const $U=O.forwardRef(function(e,t){const n=O.Children.toArray(e.children)[0],r=zu(),i=e.children.ref,o=hm([r.refs.setReference,t,i]);return O.isValidElement(n)?O.cloneElement(n,r.getReferenceProps({ref:o,...e,...n.props,"data-state":r.open?"open":"closed"})):$.jsx("span",{children:"Not valid children for PopoverTrigger"})}),OU=$U,DU=Ae.div`
|
|
1263
1263
|
display: flex;
|
|
1264
1264
|
justify-content: center;
|
|
1265
1265
|
|
|
@@ -1285,11 +1285,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1285
1285
|
outline: 2px solid var(--color-explain-popover-show-more-button-outline);
|
|
1286
1286
|
outline-offset: 1px;
|
|
1287
1287
|
}
|
|
1288
|
-
`;function PU(){const{decisionExplanations:e,switchMode:t}=
|
|
1288
|
+
`;function PU(){const{decisionExplanations:e,switchMode:t}=di(),{showConstraintsButtonCaption:n,showMoreButtonCaption:r}=im(),i=e.length-1,o=O.useMemo(()=>i>0&&fr.render(r,{amount:i}),[r,i]);return $.jsx(DU,{children:$.jsxs(NU,{onClick:()=>t("dialog"),children:[i>0&&$.jsx("span",{children:o}),i===0&&$.jsx("span",{children:n})]})})}const RU=Ae.div`
|
|
1289
1289
|
font-weight: 500;
|
|
1290
1290
|
font-family: var(--font-heading);
|
|
1291
1291
|
margin-bottom: var(--space-xs);
|
|
1292
|
-
|
|
1292
|
+
`,$b=Ae.div`
|
|
1293
1293
|
height: 1px;
|
|
1294
1294
|
background-color: var(--color-explain-popover-list-separator);
|
|
1295
1295
|
margin-left: -1.1em;
|
|
@@ -1300,7 +1300,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1300
1300
|
}
|
|
1301
1301
|
`,kU=Ae.div`
|
|
1302
1302
|
container: explain-actions / inline-size;
|
|
1303
|
-
`,MU=Ae(
|
|
1303
|
+
`,MU=Ae(Jx)`
|
|
1304
1304
|
display: grid;
|
|
1305
1305
|
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
1306
1306
|
gap: var(--space-sm);
|
|
@@ -1310,7 +1310,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1310
1310
|
margin-right: -1.1em;
|
|
1311
1311
|
overflow: auto;
|
|
1312
1312
|
max-height: 200px;
|
|
1313
|
-
`,jU=Ae(
|
|
1313
|
+
`,jU=Ae(zx)`
|
|
1314
1314
|
border-radius: 360px;
|
|
1315
1315
|
background-color: var(--color-explain-popover-apply-solution-button-fill);
|
|
1316
1316
|
color: var(--color-explain-popover-apply-solution-button-color);
|
|
@@ -1333,10 +1333,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1333
1333
|
@container explain-actions (min-width: 300px) {
|
|
1334
1334
|
width: auto;
|
|
1335
1335
|
}
|
|
1336
|
-
`,
|
|
1336
|
+
`,xd=Ae(Qx)`
|
|
1337
1337
|
width: min-content;
|
|
1338
1338
|
min-width: 300px;
|
|
1339
|
-
`;function _U(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=
|
|
1339
|
+
`;function _U(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=di(),{solutionTitle:r,applySolutionButtonCaption:i}=im();if(n)return $.jsx(xd,{variant:"failedToExplain"});const o=e[0];if(!o)return $.jsx(xd,{variant:"noExplanationFound"});if(!o.solution)return $.jsx(xd,{variant:"noSolutionFound"});const a=o.solution.decisions.filter(s=>s.state!=null);return $.jsxs($.Fragment,{children:[$.jsx(RU,{children:r}),$.jsx($b,{}),$.jsx(MU,{blockingDecisions:o.causedByDecisions,desiredDecisions:a}),$.jsx($b,{}),$.jsxs(kU,{children:[$.jsx(jU,{explanation:o,children:i}),(e.length>1||t.length>0)&&$.jsx(PU,{})]})]})}const H1=O.createContext(null),vr=()=>O.useContext(H1);function Sm(e){return O.forwardRef((t,n)=>{const r=O.useId();return $.jsx(H1.Provider,{value:r,children:$.jsx(e,{...t,ref:n})})})}const qU=O.forwardRef((e,t)=>{const{style:n,children:r,...i}=e,o=zu(),a=hm([o.refs.setFloating,t]);return $.jsx(E1,{children:$.jsx(A1,{context:o.context,modal:o.modal,children:$.jsx("div",{ref:a,style:{...o.floatingStyles,...n},...o.getFloatingProps(i),children:r})})})}),FU=qU,LU=O.forwardRef((e,t)=>{const{setOpen:n}=zu();return $.jsx("button",{type:"button",ref:t,...e,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),VU=LU,BU=Ae.div`
|
|
1340
1340
|
position: relative;
|
|
1341
1341
|
background-color: var(--color-explain-popover-fill);
|
|
1342
1342
|
color: var(--color-explain-popover-color);
|
|
@@ -1362,7 +1362,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1362
1362
|
outline: 2px solid var(--color-explain-popover-close-button-outline);
|
|
1363
1363
|
outline-offset: 1px;
|
|
1364
1364
|
}
|
|
1365
|
-
`,GU=Ae(
|
|
1365
|
+
`,GU=Ae(_1)`
|
|
1366
1366
|
font-size: var(--text-md);
|
|
1367
1367
|
font-weight: 500;
|
|
1368
1368
|
font-family: var(--font-heading);
|
|
@@ -1372,7 +1372,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1372
1372
|
white-space: nowrap;
|
|
1373
1373
|
text-overflow: ellipsis;
|
|
1374
1374
|
margin-right: var(--space-md);
|
|
1375
|
-
`;function zU(e){return $.jsxs(BU,{children:[$.jsx(GU,{}),e.children,$.jsx(UU,{children:$.jsx(
|
|
1375
|
+
`;function zU(e){return $.jsxs(BU,{children:[$.jsx(GU,{}),e.children,$.jsx(UU,{children:$.jsx(zi,{icon:ax})})]})}const WU=Ae(FU)`
|
|
1376
1376
|
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1377
1377
|
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1378
1378
|
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
@@ -1394,28 +1394,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1394
1394
|
&:focus {
|
|
1395
1395
|
outline: none;
|
|
1396
1396
|
}
|
|
1397
|
-
`,HU=Ae(
|
|
1397
|
+
`,HU=Ae(f3)`
|
|
1398
1398
|
fill: var(--color-explain-popover-fill);
|
|
1399
|
-
`,KU={initial:{opacity:0,scale:0},open:{opacity:1,scale:1,transition:{type:"spring",stiffness:600,damping:40}},close:{opacity:0,scale:0,transition:{duration:.2,ease:"cubicInOut"}}};function YU(e){const t=
|
|
1399
|
+
`,KU={initial:{opacity:0,scale:0},open:{opacity:1,scale:1,transition:{type:"spring",stiffness:600,damping:40}},close:{opacity:0,scale:0,transition:{duration:.2,ease:"cubicInOut"}}};function YU(e){const t=di(),n=vr(),r=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=O.useRef(null);return $.jsxs(AU,{open:r,onOpenChange:o=>!o&&r&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[$.jsx(OU,{children:e.children}),$.jsxs(JU,{isOpen:r,children:[O.Children.toArray(e.content)[0]??$.jsx(zU,{children:$.jsx(_U,{})}),$.jsx(XU,{})]})]})}function JU(e){var t,n;const r=im(),{middlewareData:i,arrow:o,placement:a}=zu(),s=((t=i.arrow)==null?void 0:t.x)??0,u=((n=i.arrow)==null?void 0:n.y)??0,l=(o==null?void 0:o.height)??0,c=(o==null?void 0:o.width)??0,f=s+c/2,d=u+l,h=H(a).with("top",()=>`${f}px calc(100% + ${l+5}px)`).with("bottom",()=>`${f}px ${-l-5}px`).with("left",()=>`calc(100% + ${l}px) ${d}px`).with("right",()=>`${-l}px ${d}px`).otherwise(()=>"");return $.jsx(D.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(WU,{...r,children:$.jsx(D.motion.div,{variants:KU,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:h},children:$.jsx(j1,{children:e.children})})})})}function XU(){const{context:e,arrow:t}=zu();return $.jsx(HU,{ref:t.element,context:e,width:t.width,height:t.height})}function QU(e){return O.forwardRef((t,n)=>{const r=Gt();return t.explain!=="popover"||r?$.jsx(e,{...t}):$.jsx(YU,{children:$.jsx(e,{...t,ref:n})})})}function Fr(e){return hr(Sm(QU(O.forwardRef(e))))}function Mr(){alert(`Failed to apply your selection.
|
|
1400
1400
|
Please check your internet connection and try again.`)}function ZU(){alert(`Failed to reset your configuration.
|
|
1401
|
-
Please check your internet connection and try again.`)}const
|
|
1401
|
+
Please check your internet connection and try again.`)}const Ob=Ae.select`
|
|
1402
1402
|
color: inherit;
|
|
1403
|
-
`,
|
|
1403
|
+
`,Db="<reset>",Nb="<nothing>",K1=Fr((e,t)=>{if(Gt()){const E=Ma(e,!0,!1);return $.jsx(Ob,{style:E})}const n=vr(),r=tn(e),i=rs(r);if(!i)return $.jsx("span",{children:"Choice Attribute not found"});const{explain:o}=qr(),a=Vu(r),{attribute:s,makeDecision:u,clearDecisions:l}=i,c=Dc(r,a,$n.getAllowedChoiceValues(s)),f=Dc(r,a,$n.getBlockedChoiceValues(s)),d=$n.isMultiSelect(s),h=$n.getSelectedChoiceValues(s),p=h.map(E=>E.id),v=p[0]??Nb,g=h.some(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Explicit}),C=p.length>=1,m=h.some(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Implicit}),b=c.length===0,x=async E=>{if(E===Db)try{await l()}catch{Mr()}else if(c.some(A=>A.id===E)){const A=p.some(N=>N===E)?void 0:Ye.Included;try{await u(E,A)}catch{Mr()}}else f.some(A=>A.id===E)&&e.explain!=="disabled"&&await o(A=>A.whyIsStateNotPossible.choice(s.id).choiceValue(E).state(Ye.Included),e.explain,n)},T=n4(e,s.isSatisfied,m,b);return $.jsxs(Ob,{ref:t,value:d?p:v,multiple:d,onChange:E=>x(E.currentTarget.value),style:T,children:[!C&&!d&&$.jsx("option",{value:Nb}),g&&$.jsx("option",{value:Db,children:e.resetLabel}),c.map(E=>{var A;return $.jsxs("option",{value:E.id,children:[((A=E.decision)==null?void 0:A.kind)===Se.Implicit?e.implicitLabelPrefix:"",a[E.id]??E.id]},E.id)}),f.length>0&&$.jsx("optgroup",{label:e.blockedLabel,children:f.map(E=>$.jsx("option",{value:E.id,children:a[E.id]??E.id},E.id))})]})}),e4=K1,t4={...bm,noOptionsAvailableColors:{...ch,title:"No Options Available Colors"}};D.addPropertyControls(K1,t4);const n4=(e,t,n,r)=>{var i,o,a;const s=Ma(e,t,n);return{...s,backgroundColor:H({noOptionsAvailable:r,noOptionsAvailableFill:(i=e.noOptionsAvailableColors)==null?void 0:i.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:qe.string.minLength(1)},u=>u.noOptionsAvailableFill).otherwise(()=>s.backgroundColor),borderColor:H({noOptionsAvailable:r,noOptionsAvailableBorderColor:(o=e.noOptionsAvailableColors)==null?void 0:o.borderColor}).with({noOptionsAvailable:!0,noOptionsAvailableBorderColor:qe.string.minLength(1)},u=>u.noOptionsAvailableBorderColor).otherwise(()=>s.borderColor),color:H({noOptionsAvailable:r,noOptionsAvailableColor:(a=e.noOptionsAvailableColors)==null?void 0:a.color}).with({noOptionsAvailable:!0,noOptionsAvailableColor:qe.string.minLength(1)},u=>u.noOptionsAvailableColor).otherwise(()=>s.color)}},Pb=Ae.select`
|
|
1404
1404
|
color: inherit;
|
|
1405
|
-
`,
|
|
1405
|
+
`,Rb="<reset>",Td="<nothing>",Ed="yes",kb="no",Y1=Fr((e,t)=>{var n,r,i;if(Gt()){const x=Ma(e,!0,!1);return $.jsx(Pb,{style:x})}const o=vr(),a=tn(e),s=Z_(a),{explain:u}=qr();if(!s)return $.jsx("span",{children:"Boolean Attribute not found"});const{attribute:l,makeDecision:c}=s,f=async x=>{const T=$n.getBooleanDecision(l)!=null;if(x===Rb&&T)try{await c(void 0)}catch{Mr()}else{const E=x===Ed;if($n.isBooleanValuePossible(l,E))try{await c(E)}catch{Mr()}else e.explain!=="disabled"&&await u(A=>A.whyIsStateNotPossible.boolean(l.id).state(E),e.explain,o)}},d=H((n=l.decision)==null?void 0:n.state).with(!0,()=>Ed).with(!1,()=>kb).otherwise(()=>Td),h=((r=l.decision)==null?void 0:r.kind)===Se.Explicit,p=((i=l.decision)==null?void 0:i.kind)===Se.Implicit,v=Ma(e,l.isSatisfied,p),g=$n.isBooleanValuePossible(l,!0),C=$n.isBooleanValuePossible(l,!1),m=$.jsxs("option",{value:Ed,children:[Mb(l,!0,e.implicitLabelPrefix),e.trueLabel]}),b=$.jsxs("option",{value:kb,children:[Mb(l,!1,e.implicitLabelPrefix),e.falseLabel]});return $.jsxs(Pb,{ref:t,value:d,onChange:x=>f(x.currentTarget.value),style:v,children:[d===Td&&$.jsx("option",{value:Td}),h&&$.jsx("option",{value:Rb,children:e.resetLabel}),g&&m,C&&b,(!g||!C)&&$.jsxs("optgroup",{label:e.blockedLabel,children:[!g&&m,!C&&b]})]})}),r4=Y1,Mb=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===Se.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},i4={...bm,trueLabel:{title:"True Label",type:D.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:D.ControlType.String,defaultValue:"No"}};D.addPropertyControls(Y1,i4);const jb=Ae.select`
|
|
1406
1406
|
color: inherit;
|
|
1407
|
-
`,
|
|
1407
|
+
`,_b="<reset>",Id="<nothing>",Ad="included",$d="excluded",J1=Fr((e,t)=>{var n,r,i;if(Gt()){const T=Ma(e,!0,!1);return $.jsx(jb,{style:T})}const o=vr(),a=tn(e),s=eq(a),{explain:u}=qr();if(!s)return $.jsx("span",{children:"Component Attribute not found"});const{attribute:l,makeDecision:c}=s,f=async T=>{if($n.isComponentStatePossible(l,T))try{await c(T)}catch{Mr()}else e.explain!=="disabled"&&await u(E=>E.whyIsStateNotPossible.component(l.id).state(T),e.explain,o)},d=async T=>{var E;const A=((E=l.decision)==null?void 0:E.kind)===Se.Explicit;T===_b&&A?await c(void 0):T===Ad?await f(Ge.Included):T===$d&&await f(Ge.Excluded)},h=H((n=l.decision)==null?void 0:n.state).with(Ge.Included,()=>Ad).with(Ge.Excluded,()=>$d).otherwise(()=>Id),p=((r=l.decision)==null?void 0:r.kind)===Se.Explicit,v=((i=l.decision)==null?void 0:i.kind)===Se.Implicit,g=Ma(e,l.isSatisfied,v),C=$n.isComponentStatePossible(l,Ge.Included),m=$n.isComponentStatePossible(l,Ge.Excluded),b=$.jsxs("option",{value:Ad,children:[qb(l,Ge.Included,e.implicitLabelPrefix),e.includedLabel]}),x=$.jsxs("option",{value:$d,children:[qb(l,Ge.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return $.jsxs(jb,{ref:t,value:h,onChange:T=>d(T.currentTarget.value),style:g,children:[h===Id&&$.jsx("option",{value:Id}),p&&$.jsx("option",{value:_b,children:e.resetLabel}),C&&b,m&&x,(!C||!m)&&$.jsxs("optgroup",{label:e.blockedLabel,children:[!C&&b,!m&&x]})]})}),o4=J1,qb=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===Se.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},a4={...bm,includedLabel:{title:"Included Label",type:D.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:D.ControlType.String,defaultValue:"Excluded"}};D.addPropertyControls(J1,a4);function X1(e,t,n,r,i=1e3){const[o]=gT.useForceUpdate(),a=a5(d=>{t(d),o()},i),s=O.useRef(n),u=O.useRef(e),l=a.isPending(),c=O.useRef(l);O.useEffect(()=>{e!==u.current&&(u.current=e,l&&(a.cancel(),o()),e!==n&&r(e)),n!==s.current&&(s.current=n,n!==e?(a(n),o()):l&&(a.cancel(),o())),l!==c.current&&(c.current=l,!l&&e!==n&&r(e))},[e,n,a,l]);const f=O.useCallback(()=>{a.isPending()&&a.flush()},[a]);return O.useEffect(()=>()=>f(),[f]),{flush:f}}const Fb=Ae(Bx)`
|
|
1408
1408
|
color: inherit;
|
|
1409
|
-
`,X1=fi((e,t)=>{var n,r;if(Gt()){const m=lh(e,!0,!1);return $.jsx(qb,{style:m})}const i=Ir(),o=un(e),a=M0(o),{explain:s}=ci();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:l}=a,c=((n=u.decision)==null?void 0:n.kind)===Se.Implicit,f=lh(e,u.isSatisfied,c),d=(r=u.decision)==null?void 0:r.state,[h,p]=O.useState(d),{min:v,max:g}=u.range,C=J1(d,async m=>{if(m<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(m>g){alert(`The value must be greater than or equal to ${g}.`);return}try{await l(m)}catch(b){const x=b;x.type===pt.ConfigurationModelNotFeasible||x.type===pt.ConfigurationConflict?e.explain!=="disabled"&&await s(T=>T.whyIsStateNotPossible.numeric(u.id).state(m),e.explain,i):Mr()}},h,m=>p(m),e.wait);return $.jsx(qb,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:u.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:u4(u,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:m=>{m.key==="Enter"&&C.flush()},onValueChange:m=>p(m.floatValue),value:h??"",style:f})}),s4=X1,u4=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===Se.Implicit?t:""},l4={...U1,wait:{title:"Debounce Delay",type:D.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:D.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:D.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:D.ControlType.String,defaultValue:""}};D.addPropertyControls(X1,l4);const Gu={choiceValueId:{title:"Choice Value Id",type:D.ControlType.String}};function di(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=Fx(n.props,t);return O.cloneElement(n,r)}return n})}const Q1=fi((e,t)=>{if(Gt())return e.children;const n=Ir(),{makeDecision:r}=si(),i=un(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],{explain:u}=ci();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===V.Choice,c=s.type===V.Numeric,f=s.type===V.Boolean,d=s.type===V.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(c)return $.jsx("span",{children:"Numeric Attribute is not supported"});let h=l?s.values.find(m=>m.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const p=m=>H({state:m,attribute:s}).with({attribute:{type:V.Choice},state:"undefined"},()=>h.decision==null).with({attribute:{type:V.Choice},state:"included"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Included&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Choice},state:"excluded"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Excluded&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"undefined"},{attribute:{type:V.Component},state:"undefined"},({attribute:b})=>b.decision==null).with({attribute:{type:V.Boolean},state:"true"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!0&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"false"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!1&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"included"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Included&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"excluded"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Excluded&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).otherwise(()=>!1),v=m=>H({isChoiceAttribute:l,isBooleanAttribute:f,isComponentAttribute:d,state:m}).with({isChoiceAttribute:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).otherwise(()=>null);p(e.toggleFrom);const g=p(e.toggleTo),C=async()=>{const m=g?e.toggleFrom:e.toggleTo,b=v(m),x=d?$n.isComponentStatePossible(s,b):!1,T=f?$n.isBooleanValuePossible(s,b):!1;if(l&&h.possibleDecisionStates.some(E=>E===b)||T||x||b==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:b})}catch{Mr()}else if(e.explain!=="disabled"){const E=H({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);E&&await u({question:Ft.whyIsStateNotPossible,subject:E,attributeId:i,choiceValueId:o,state:b},e.explain,n)}};return di(e.children,{onClick:C,ref:t})}),c4=Q1,f4={...fr,...Gu,children:{title:"Content",type:D.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:D.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...us};D.addPropertyControls(Q1,f4);const Z1=fi((e,t)=>{if(Gt())return e.children;const n=Ir(),{makeDecision:r}=si(),i=un(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],u=rs(i),{explain:l}=ci();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===V.Choice,f=s.type===V.Numeric,d=s.type===V.Boolean,h=s.type===V.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let p=c?s.values.find(C=>C.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>H({isChoiceAttribute:c,isBooleanAttribute:d,isComponentAttribute:h,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),g=async()=>{if(c&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Mr()}else{const C=v(),m=h?$n.isComponentStatePossible(s,C):!1,b=d?$n.isBooleanValuePossible(s,C):!1,x=(c?p.possibleDecisionStates.some(T=>T===C):!1)||b||m;if(f||x||C==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:C})}catch(T){const E=T;f&&(E.type===pt.ConfigurationModelNotFeasible||E.type===pt.ConfigurationConflict)?e.explain!=="disabled"&&await l(A=>A.whyIsStateNotPossible.numeric(s.id).state(C),e.explain,n):Mr()}else if(e.explain!=="disabled"){const T=H({isComponentAttribute:h,isBooleanAttribute:d,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);T&&await l({question:Ft.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:C},e.explain,n)}}};return di(e.children,{onClick:g,ref:t})}),d4=Z1,p4={...fr,...Gu,children:{title:"Content",type:D.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0},...us};D.addPropertyControls(Z1,p4);const eT=fi((e,t)=>{var n;if(Gt())return e.children;const r=Ir(),{setManyDecision:i}=si(),{handleExplainAnswer:o}=ci(),a=e.attributes.map(un),s=ns(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const h=e.attributes[d],p=h.choiceValueId??"",v=p.length>0,g=f.type===V.Choice,C=f.type===V.Numeric,m=f.type===V.Boolean,b=f.type===V.Component;if(!g&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let x=g?f.values.find(E=>E.id===p):null;if(v&&x==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const T=()=>H({isChoiceAttribute:g,isBooleanAttribute:m,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:v,state:h.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>h.numericValue).otherwise(()=>null);return{getDecisions:()=>g&&!v&&h.setSelection==="undefined"?f.values.filter(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Explicit}).map(E=>({type:f.type,attributeId:f.id,choiceValueId:E.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:p,state:T()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const l=async()=>{const f=s.reduce((h,p)=>[...h,...p.getDecisions()],new Array),d=H(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(h){const p=h;if(console.debug("SetMany failed",p),(p==null?void 0:p.type)===pt.ConfigurationSetManyConflict&&p.decisionExplanations){e.explain!=="disabled"&&await o(p,e.explain,r);return}Mr();return}},c=()=>{e.trigger==="click"&&l()};return O.useEffect(()=>{e.trigger==="auto"&&l()},[]),di(e.children,{onClick:c,ref:t})}),h4=eT,v4={children:{title:"Content",type:D.ControlType.ComponentInstance},attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...fr,...Gu,setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:D.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:D.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...us};D.addPropertyControls(eT,v4);const tT=Er(e=>{if(Gt())return e.enabledChildren;const{configuration:t}=Nv(),{setManyDecision:n}=si(),r=t.attributes.some(a=>H(a).with({type:V.Choice},s=>s.values.some(u=>{var l;return((l=u.decision)==null?void 0:l.kind)===Se.Explicit})).with({type:V.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{ZU()}},o=r?e.enabledChildren:e.disabledChildren;return di(o,{onClick:i})}),m4=tT,y4={enabledChildren:{title:"Content – Enabled",type:D.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:D.ControlType.ComponentInstance}};D.addPropertyControls(tT,y4);const nT=fi((e,t)=>{if(Gt())return e.unsatisfiedChildren;const n=Ir(),{configuration:r}=Nv(),{explain:i}=ci(),o=[...e.attributeId.length>0?[un(e)]:[],...e.attributes.map(un)],a=()=>{var u;const l=ns(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=l.find(f=>f.error))==null?void 0:u.error)||l.every(f=>f.isSatisfied)},s=async()=>{e.explain!=="disabled"&&(o.length===0?await i(u=>u.whyIsNotSatisfied.configuration,e.explain,n):o.length===1&&await i(u=>u.whyIsNotSatisfied.attribute(o[0]),e.explain,n))};return(o.length>0?a():r.isSatisfied)?e.satisfiedChildren:di(e.unsatisfiedChildren,{onClick:s,ref:t})}),g4=nT,b4={satisfiedChildren:{title:"Content – Satisfied",type:D.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:D.ControlType.ComponentInstance},...fr,attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...fr}}},...us};D.addPropertyControls(nT,b4);const rT=Er(O.forwardRef(function(e,t){const n=d=>H(d).with(1,()=>e.content1).with(2,()=>e.content2).with(3,()=>e.content3).with(4,()=>e.content4).with(5,()=>e.content5).with(6,()=>e.content6).with(7,()=>e.content7).with(8,()=>e.content8).with(9,()=>e.content9).with(10,()=>e.content10).otherwise(()=>null),r=e.variants.find(d=>d.useInDesignTime)||e.variants[0];if(Gt())return r&&n(r.content);const i=un(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===V.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let l=u&&a?s.values.find(d=>d.id===o):null;if(a&&l==null)return $.jsx("span",{children:"Choice Value not found"});const c=d=>()=>l?d(l):s.values.some(d),f=[...e.variants].find(({selection:d,condition:h})=>H({selection:d,condition:h,attribute:s}).with({attribute:{type:V.Choice},selection:"included",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Included))).with({attribute:{type:V.Choice},selection:"included",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"included",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"included",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Included})).with({attribute:{type:V.Choice},selection:"excluded",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Excluded))).with({attribute:{type:V.Choice},selection:"excluded",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded})).with({attribute:{type:V.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:V.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!0}).with({attribute:{type:V.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:V.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!1}).with({attribute:{type:V.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Included)).with({attribute:{type:V.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"included",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Included}).with({attribute:{type:V.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Excluded)).with({attribute:{type:V.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Implicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Explicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:V.Choice},selection:"undefined"},()=>l.decision==null).with({attribute:{type:V.Boolean},selection:"undefined"},{attribute:{type:V.Component},selection:"undefined"},{attribute:{type:V.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return f&&di(n(f.content),{ref:t})})),S4=rT,C4={...fr,...Gu,variants:{title:"Variants",type:D.ControlType.Array,maxCount:10,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:D.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:D.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:D.ControlType.ComponentInstance},content2:{title:"Content 2",type:D.ControlType.ComponentInstance},content3:{title:"Content 3",type:D.ControlType.ComponentInstance},content4:{title:"Content 4",type:D.ControlType.ComponentInstance},content5:{title:"Content 5",type:D.ControlType.ComponentInstance},content6:{title:"Content 6",type:D.ControlType.ComponentInstance},content7:{title:"Content 7",type:D.ControlType.ComponentInstance},content8:{title:"Content 8",type:D.ControlType.ComponentInstance},content9:{title:"Content 9",type:D.ControlType.ComponentInstance},content10:{title:"Content 10",type:D.ControlType.ComponentInstance}};D.addPropertyControls(rT,C4);const iT=Er(e=>{const t=O.useRef(),[n,r]=O.useState(null),i=O.useRef(n),o=O.useMemo(()=>e.color.startsWith("var"),[e.color]),a=o?n:e.color,s=O.useMemo(()=>{if(!a)return;const u=c5(a);return u5(`#${u}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[a]);return O.useLayoutEffect(()=>{if(o){const u=t.current&&getComputedStyle(t.current).color;u!=i.current&&(i.current=u,r(u))}}),$.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),w4=iT,x4={children:{title:"Content",type:D.ControlType.ComponentInstance},color:{title:"Color",type:D.ControlType.Color,defaultValue:"#0000ff"}};D.addPropertyControls(iT,x4);const oT=Er(e=>{if(Gt())return e.children;const{error:t}=Dv();return t?di(e.children,{onClick:t.retry}):null}),T4=oT,E4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(oT,E4);function I4(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const A4=Ae.div`
|
|
1409
|
+
`,Q1=Fr((e,t)=>{var n,r;if(Gt()){const m=fh(e,!0,!1);return $.jsx(Fb,{style:m})}const i=vr(),o=tn(e),a=j0(o),{explain:s}=qr();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:l}=a,c=((n=u.decision)==null?void 0:n.kind)===Se.Implicit,f=fh(e,u.isSatisfied,c),d=(r=u.decision)==null?void 0:r.state,[h,p]=O.useState(d),{min:v,max:g}=u.range,C=X1(d,async m=>{if(m<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(m>g){alert(`The value must be greater than or equal to ${g}.`);return}try{await l(m)}catch(b){const x=b;x.type===pt.ConfigurationModelNotFeasible||x.type===pt.ConfigurationConflict?e.explain!=="disabled"&&await s(T=>T.whyIsStateNotPossible.numeric(u.id).state(m),e.explain,i):Mr()}},h,m=>p(m),e.wait);return $.jsx(Fb,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:u.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:u4(u,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:m=>{m.key==="Enter"&&C.flush()},onValueChange:m=>p(m.floatValue),value:h??"",style:f})}),s4=Q1,u4=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===Se.Implicit?t:""},l4={...z1,wait:{title:"Debounce Delay",type:D.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:D.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:D.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:D.ControlType.String,defaultValue:""}};D.addPropertyControls(Q1,l4);const ls={choiceValueId:{title:"Choice Value Id",type:D.ControlType.String}};function Lr(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=Lx(n.props,t);return O.cloneElement(n,r)}return n})}const Z1=Fr((e,t)=>{if(Gt())return e.children;const n=vr(),{makeDecision:r}=ci(),i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],{explain:u}=qr();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===V.Choice,c=s.type===V.Numeric,f=s.type===V.Boolean,d=s.type===V.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(c)return $.jsx("span",{children:"Numeric Attribute is not supported"});let h=l?s.values.find(m=>m.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const p=m=>H({state:m,attribute:s}).with({attribute:{type:V.Choice},state:"undefined"},()=>h.decision==null).with({attribute:{type:V.Choice},state:"included"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Included&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Choice},state:"excluded"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Excluded&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"undefined"},{attribute:{type:V.Component},state:"undefined"},({attribute:b})=>b.decision==null).with({attribute:{type:V.Boolean},state:"true"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!0&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"false"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!1&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"included"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Included&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"excluded"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Excluded&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).otherwise(()=>!1),v=m=>H({isChoiceAttribute:l,isBooleanAttribute:f,isComponentAttribute:d,state:m}).with({isChoiceAttribute:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).otherwise(()=>null);p(e.toggleFrom);const g=p(e.toggleTo),C=async()=>{const m=g?e.toggleFrom:e.toggleTo,b=v(m),x=d?$n.isComponentStatePossible(s,b):!1,T=f?$n.isBooleanValuePossible(s,b):!1;if(l&&h.possibleDecisionStates.some(E=>E===b)||T||x||b==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:b})}catch{Mr()}else if(e.explain!=="disabled"){const E=H({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);E&&await u({question:Ft.whyIsStateNotPossible,subject:E,attributeId:i,choiceValueId:o,state:b},e.explain,n)}};return Lr(e.children,{onClick:C,ref:t})}),c4=Z1,f4={...nr,...ls,children:{title:"Content",type:D.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:D.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...us};D.addPropertyControls(Z1,f4);const eT=Fr((e,t)=>{if(Gt())return e.children;const n=vr(),{makeDecision:r}=ci(),i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],u=rs(i),{explain:l}=qr();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===V.Choice,f=s.type===V.Numeric,d=s.type===V.Boolean,h=s.type===V.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let p=c?s.values.find(C=>C.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>H({isChoiceAttribute:c,isBooleanAttribute:d,isComponentAttribute:h,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),g=async()=>{if(c&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Mr()}else{const C=v(),m=h?$n.isComponentStatePossible(s,C):!1,b=d?$n.isBooleanValuePossible(s,C):!1,x=(c?p.possibleDecisionStates.some(T=>T===C):!1)||b||m;if(f||x||C==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:C})}catch(T){const E=T;f&&(E.type===pt.ConfigurationModelNotFeasible||E.type===pt.ConfigurationConflict)?e.explain!=="disabled"&&await l(A=>A.whyIsStateNotPossible.numeric(s.id).state(C),e.explain,n):Mr()}else if(e.explain!=="disabled"){const T=H({isComponentAttribute:h,isBooleanAttribute:d,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);T&&await l({question:Ft.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:C},e.explain,n)}}};return Lr(e.children,{onClick:g,ref:t})}),d4=eT,p4={...nr,...ls,children:{title:"Content",type:D.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0},...us};D.addPropertyControls(eT,p4);const tT=Fr((e,t)=>{var n;if(Gt())return e.children;const r=vr(),{setManyDecision:i}=ci(),{handleExplainAnswer:o}=qr(),a=e.attributes.map(tn),s=ns(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const h=e.attributes[d],p=h.choiceValueId??"",v=p.length>0,g=f.type===V.Choice,C=f.type===V.Numeric,m=f.type===V.Boolean,b=f.type===V.Component;if(!g&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let x=g?f.values.find(E=>E.id===p):null;if(v&&x==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const T=()=>H({isChoiceAttribute:g,isBooleanAttribute:m,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:v,state:h.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>h.numericValue).otherwise(()=>null);return{getDecisions:()=>g&&!v&&h.setSelection==="undefined"?f.values.filter(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Explicit}).map(E=>({type:f.type,attributeId:f.id,choiceValueId:E.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:p,state:T()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const l=async()=>{const f=s.reduce((h,p)=>[...h,...p.getDecisions()],new Array),d=H(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(h){const p=h;if(console.debug("SetMany failed",p),(p==null?void 0:p.type)===pt.ConfigurationSetManyConflict&&p.decisionExplanations){e.explain!=="disabled"&&await o(p,e.explain,r);return}Mr();return}},c=()=>{e.trigger==="click"&&l()};return O.useEffect(()=>{e.trigger==="auto"&&l()},[]),Lr(e.children,{onClick:c,ref:t})}),h4=tT,v4={children:{title:"Content",type:D.ControlType.ComponentInstance},attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...nr,...ls,setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:D.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:D.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...us};D.addPropertyControls(tT,v4);const nT=hr(e=>{if(Gt())return e.enabledChildren;const{configuration:t}=Rv(),{setManyDecision:n}=ci(),r=t.attributes.some(a=>H(a).with({type:V.Choice},s=>s.values.some(u=>{var l;return((l=u.decision)==null?void 0:l.kind)===Se.Explicit})).with({type:V.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{ZU()}},o=r?e.enabledChildren:e.disabledChildren;return Lr(o,{onClick:i})}),m4=nT,y4={enabledChildren:{title:"Content – Enabled",type:D.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:D.ControlType.ComponentInstance}};D.addPropertyControls(nT,y4);const rT=Fr((e,t)=>{if(Gt())return e.unsatisfiedChildren;const n=vr(),{configuration:r}=Rv(),{explain:i}=qr(),o=[...e.attributeId.length>0?[tn(e)]:[],...e.attributes.map(tn)],a=()=>{var u;const l=ns(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=l.find(f=>f.error))==null?void 0:u.error)||l.every(f=>f.isSatisfied)},s=async()=>{e.explain!=="disabled"&&(o.length===0?await i(u=>u.whyIsNotSatisfied.configuration,e.explain,n):o.length===1&&await i(u=>u.whyIsNotSatisfied.attribute(o[0]),e.explain,n))};return(o.length>0?a():r.isSatisfied)?e.satisfiedChildren:Lr(e.unsatisfiedChildren,{onClick:s,ref:t})}),g4=rT,b4={satisfiedChildren:{title:"Content – Satisfied",type:D.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:D.ControlType.ComponentInstance},...nr,attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...nr}}},...us};D.addPropertyControls(rT,b4);const iT=hr(O.forwardRef(function(e,t){const n=d=>H(d).with(1,()=>e.content1).with(2,()=>e.content2).with(3,()=>e.content3).with(4,()=>e.content4).with(5,()=>e.content5).with(6,()=>e.content6).with(7,()=>e.content7).with(8,()=>e.content8).with(9,()=>e.content9).with(10,()=>e.content10).otherwise(()=>null),r=e.variants.find(d=>d.useInDesignTime)||e.variants[0];if(Gt())return r&&n(r.content);const i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===V.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let l=u&&a?s.values.find(d=>d.id===o):null;if(a&&l==null)return $.jsx("span",{children:"Choice Value not found"});const c=d=>()=>l?d(l):s.values.some(d),f=[...e.variants].find(({selection:d,condition:h})=>H({selection:d,condition:h,attribute:s}).with({attribute:{type:V.Choice},selection:"included",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Included))).with({attribute:{type:V.Choice},selection:"included",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"included",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"included",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Included})).with({attribute:{type:V.Choice},selection:"excluded",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Excluded))).with({attribute:{type:V.Choice},selection:"excluded",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded})).with({attribute:{type:V.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:V.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!0}).with({attribute:{type:V.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:V.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!1}).with({attribute:{type:V.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Included)).with({attribute:{type:V.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"included",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Included}).with({attribute:{type:V.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Excluded)).with({attribute:{type:V.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Implicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Explicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:V.Choice},selection:"undefined"},()=>l.decision==null).with({attribute:{type:V.Boolean},selection:"undefined"},{attribute:{type:V.Component},selection:"undefined"},{attribute:{type:V.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return f&&Lr(n(f.content),{ref:t})})),S4=iT,C4={...nr,...ls,variants:{title:"Variants",type:D.ControlType.Array,maxCount:10,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:D.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:D.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:D.ControlType.ComponentInstance},content2:{title:"Content 2",type:D.ControlType.ComponentInstance},content3:{title:"Content 3",type:D.ControlType.ComponentInstance},content4:{title:"Content 4",type:D.ControlType.ComponentInstance},content5:{title:"Content 5",type:D.ControlType.ComponentInstance},content6:{title:"Content 6",type:D.ControlType.ComponentInstance},content7:{title:"Content 7",type:D.ControlType.ComponentInstance},content8:{title:"Content 8",type:D.ControlType.ComponentInstance},content9:{title:"Content 9",type:D.ControlType.ComponentInstance},content10:{title:"Content 10",type:D.ControlType.ComponentInstance}};D.addPropertyControls(iT,C4);const oT=hr(e=>{const t=O.useRef(),[n,r]=O.useState(null),i=O.useRef(n),o=O.useMemo(()=>e.color.startsWith("var"),[e.color]),a=o?n:e.color,s=O.useMemo(()=>{if(!a)return;const u=f5(a);return l5(`#${u}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[a]);return O.useLayoutEffect(()=>{if(o){const u=t.current&&getComputedStyle(t.current).color;u!=i.current&&(i.current=u,r(u))}}),$.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),w4=oT,x4={children:{title:"Content",type:D.ControlType.ComponentInstance},color:{title:"Color",type:D.ControlType.Color,defaultValue:"#0000ff"}};D.addPropertyControls(oT,x4);const aT=hr(e=>{if(Gt())return e.children;const{error:t}=Pv();return t?Lr(e.children,{onClick:t.retry}):null}),T4=aT,E4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(aT,E4);function I4(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const A4=Ae.div`
|
|
1410
1410
|
width: 10px;
|
|
1411
1411
|
height: 10px;
|
|
1412
1412
|
background-color: greenyellow;
|
|
1413
|
-
`;function
|
|
1413
|
+
`;function sT(e){const t=O.useRef(null);return O.useEffect(()=>{if(!t.current)return;const n=setTimeout(()=>{t.current.scrollIntoView()},e.delay);return()=>clearTimeout(n)},[t.current]),$.jsx(A4,{ref:t})}const $4={delay:{title:"Delay",type:D.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};D.addPropertyControls(sT,$4);const uT=Ae.div`
|
|
1414
1414
|
display: contents;
|
|
1415
|
-
`,O4=
|
|
1415
|
+
`,O4=ju`
|
|
1416
1416
|
:root {
|
|
1417
|
-
*:has(> ${
|
|
1417
|
+
*:has(> ${uT}) {
|
|
1418
1418
|
display: contents !important;
|
|
1419
1419
|
}
|
|
1420
1420
|
}
|
|
1421
|
-
`,uT=Er(W1(e=>{const t=Ir(),n=Gt(),r=n?(()=>O.Children.toArray(e.itemTemplate)[0])():(()=>{const f=d=>{var h;const p=O.Children.toArray(d)[0],v=(h=p.props)==null?void 0:h.children;return v?f(v):p};return f(e.itemTemplate)})();if(!r)return $.jsx("span",{children:"Choice Value Template not defined"});const i=(f,d)=>f.map(h=>O.cloneElement(r,{key:h,layoutId:`${t}_${h}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:h,choiceValueName:d[h]??h}));if(n)return $.jsx(Fb,{...e,children:i(["Choice Value 1","Choice Value 2","Choice Value 3"],{})});const o=un(e),a=rs(o);if(!a)return $.jsx("span",{children:"Choice Attribute not found"});const s=Pf(o),u=e.filter??new Array,l=a.attribute.values.filter(f=>u.length===0||u.some(({selection:d,condition:h})=>H({selection:d,condition:h}).with({selection:"included",condition:"blocked"},()=>!f.possibleDecisionStates.includes(Ye.Included)).with({selection:"included",condition:"implicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Included&&((v=f.decision)==null?void 0:v.kind)===Se.Implicit}).with({selection:"included",condition:"explicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Included&&((v=f.decision)==null?void 0:v.kind)===Se.Explicit}).with({selection:"included",condition:"none"},()=>{var p;return((p=f.decision)==null?void 0:p.state)===Ye.Included}).with({selection:"excluded",condition:"blocked"},()=>!f.possibleDecisionStates.includes(Ye.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded&&((v=f.decision)==null?void 0:v.kind)===Se.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded&&((v=f.decision)==null?void 0:v.kind)===Se.Explicit}).with({selection:"excluded",condition:"none"},()=>{var p;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded}).with({selection:"undefined"},()=>f.decision==null).otherwise(()=>!1))),c=Oc(o,s,l).map(f=>f.id);return $.jsx(Fb,{...e,children:i(c,s)})}));function Fb(e){return $.jsxs($.Fragment,{children:[$.jsx($c,{singletonId:"ChoiceValueListRenderer",children:$.jsx(O4,{})}),$.jsx(sT,{style:e.style,children:e.children})]})}const D4=uT,N4={...fr,itemTemplate:{title:"Choice Value Template",type:D.ControlType.ComponentInstance},filter:{title:"Filter",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]}}}}};D.addPropertyControls(uT,N4);const{isValidElement:Lb,cloneElement:Vb}=J;function P4(e,t){return t?(Array.isArray(t)&&(t=t.map((n,r)=>Lb(n)&&typeof n.props=="object"?Vb(n,{...n.props,key:r}):n)),!e||Array.isArray(e)?t:Lb(e)?Vb(e,{...e.props,children:t}):e):e}const{isValidElement:R4}=J;function lT(e,t,n){function r(o,a){return t.visit(o,n,a)}function i(o,a){return lT(o,t,a||n)}if(R4(e)){if(typeof e.type=="function")return"prototype"in e.type&&e.type.prototype.isReactComponent?e=new e.type(e.props).render():e=e.type(e.props),i(e);if(e.props&&"children"in e.props){const o=e.props.children;return r(e,a=>Array.isArray(o)?o.map(s=>i(s,a)):i(o,a))}}else if(Array.isArray(e)){const o=e;return r(e,a=>o.map(s=>i(s,a)))}return r(e)}const{isValidElement:Bb}=J;function k4(e,t){let n;const{replace:r,updateState:i}=t;return"matchElement"in t?n=o=>Bb(o)&&o.type===t.matchElement:"matchLiteral"in t?n=o=>!Array.isArray(o)&&!Bb(o)&&t.matchLiteral(o):n=t.match,lT(e,{visit(o,a,s){const u=i?i(a):a,l=s?s(u):void 0,c=P4(o,l);return n(c,u)?r(c,u):c}},t.initialState)}function Ub(e){return $.jsx($.Fragment,{children:k4(e.children,e)})}function M4(e){return y(e,iR(/[\s\u2013]/g,"-"),g5)}const j4=Er(e=>{const{children:t,mode:n,replaceString:r,propName:i,elementName:o,text:a}=e;return n==="replace"?$.jsx(Ub,{match:s=>typeof s=="string",replace:s=>s===r?a:s,children:t}):n==="set-prop"?$.jsx(Ub,{match:s=>{var u;return((u=s.type)==null?void 0:u.displayName)===o},replace:s=>O.cloneElement(s,{[M4(i)]:a}),children:t}):t}),bm=j4,Sm=e=>({children:{title:"Content",type:D.ControlType.ComponentInstance},mode:{title:"Mode",type:D.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:D.ControlType.String,defaultValue:e,hidden:t=>t.mode!=="replace"},elementName:{title:"Element Name",type:D.ControlType.String,hidden:t=>t.mode!=="set-prop"},propName:{title:"Property Name",type:D.ControlType.String,hidden:t=>t.mode!=="set-prop"}}),cT=Er(e=>{const{attributeId:t,children:n,customName:r}=e,i=un(e),o=(r==null?void 0:r.length)>0,a=Gt(),s=o?r:a?t:(()=>ns([i],!1)[0]?om(i)??t:"Attribute not found")();return $.jsx(bm,{...e,text:s})}),_4=cT,q4={...fr,customName:{title:"Custom Name",type:D.ControlType.String},...Sm("<AttributeName>")};D.addPropertyControls(cT,q4);const fT=Er(e=>{const{choiceValueId:t,children:n,customName:r,mode:i,replaceString:o,propName:a,elementName:s}=e,u=un(e),l=r.length>0,c=t.length>0,f=Gt(),d=l?r:f?t.length>0?t:"Choice Value":(()=>{const h=rs(u);return h?c?h.attribute.values.find(p=>p.id===t)==null?"Choice Value not found":_5(u,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return $.jsx(bm,{...e,text:d})}),F4=fT,L4={...fr,...Gu,customName:{title:"Custom Name",type:D.ControlType.String},...Sm("<ChoiceValueName>")};D.addPropertyControls(fT,L4);function dT(e){return e.children}const V4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(dT,V4);function pT(e){const{children:t,fileExtension:n,fileName:r,target:i}=e;if(Gt())return t;const{configuration:o}=Nv();return di(t,{onClick:async()=>{const a={type:"spc-stored-configuration",storedConfiguration:U4(o)};i==="file"?G4(a,`${r}.${n}`):i==="clipboard"&&z4(a)}})}const B4={children:{title:"Content",type:D.ControlType.ComponentInstance},target:{title:"Target",type:D.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:D.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:D.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};D.addPropertyControls(pT,B4);function U4(e){return{schemaVersion:1,explicitDecisions:y(e.attributes,nw(t=>H(t).returnType().with({type:V.Choice},n=>n.values.filter(r=>{var i;return((i=r.decision)==null?void 0:i.kind)===Se.Explicit}).map(r=>({type:V.Choice,attributeId:n.id,choiceValueId:r.id,state:r.decision.state}))).with({type:V.Numeric},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Numeric,attributeId:n.id,state:n.decision.state}]:[]}).with({type:V.Boolean},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Boolean,attributeId:n.id,state:n.decision.state}]:[]}).with({type:V.Component},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Component,attributeId:n.id,state:n.decision.state}]:[]}).exhaustive()))}}function G4(e,t){const n=JSON.stringify(e),r=new Blob([n],{type:"application/json"}),i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)}function z4(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var hT=(e=>(e[e.parseError=0]="parseError",e[e.noConfiguration=1]="noConfiguration",e[e.unsupportedSchemaVersion=2]="unsupportedSchemaVersion",e[e.noFileSelected=3]="noFileSelected",e[e.fileReadError=4]="fileReadError",e[e.noClipboardData=5]="noClipboardData",e[e.clipboardReadError=6]="clipboardReadError",e))(hT||{});const vT=fi((e,t)=>{const{children:n,fileExtension:r,source:i}=e;if(Gt())return n;const o=Ir(),{setManyDecision:a}=si(),{handleExplainAnswer:s}=ci();return di(n,{onClick:async()=>{const u=y(await X4(i,r),Mn);if(!u)return;const l={type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{const c=K4(u);await a(c,l)}catch(c){const f=c;if(console.debug("Failed to restore stored configuration",f),(f==null?void 0:f.type)===pt.ConfigurationSetManyConflict&&f.decisionExplanations){e.explain!=="disabled"&&await s(f,e.explain,o);return}alert("Failed to restore your configuration.");return}},ref:t})}),W4=vT,H4={children:{title:"Content",type:D.ControlType.ComponentInstance},source:{title:"Source",type:D.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:D.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0},...us};D.addPropertyControls(vT,H4);function K4(e){return e.explicitDecisions.map(t=>H(t).returnType().with({type:V.Choice},n=>({type:V.Choice,attributeId:n.attributeId,choiceValueId:n.choiceValueId,state:n.state})).with({type:V.Numeric},n=>({type:V.Numeric,attributeId:n.attributeId,state:n.state})).with({type:V.Boolean},n=>({type:V.Boolean,attributeId:n.attributeId,state:n.state})).with({type:V.Component},n=>({type:V.Component,attributeId:n.attributeId,state:n.state})).exhaustive())}function Y4(e){return()=>new Promise(t=>{const n=document.createElement("input");n.type="file",n.accept=`.${e}`,n.onchange=r=>{const i=r.target;if(!i.files||i.files.length===0){t(Kr(3));return}const o=i.files[0],a=new FileReader;a.onload=()=>{t(Lo(a.result))},a.onerror=()=>{t(Kr(4))},a.readAsText(o)},n.oncancel=()=>{t(Kr(3))},n.click()})}function J4(){return()=>navigator.clipboard.readText().then(e=>e?Lo(e):Kr(5)).catch(()=>Kr(6))}function X4(e,t){return y(e==="file"?Y4(t):J4(),BP(n=>x2(()=>JSON.parse(n),()=>0)),op(n=>n.type==="spc-stored-configuration",()=>1),op(n=>{var r;return((r=n.storedConfiguration)==null?void 0:r.schemaVersion)===1},()=>2),Ht(n=>n.storedConfiguration),Zs(n=>()=>{console.debug(`Failed to load stored configuration: ${hT[n]}`),n==4?alert("Failed to read the selected file. Maybe it is damaged."):n==1||n==0?e==="file"?alert("The selected file doesn't contain a valid configuration."):e==="clipboard"&&alert("The clipboard doesn't contain a valid configuration."):n==2?alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one."):n==6?alert("Can't read the clipboard. Make to give a permission for reading the clipboard."):n==5&&alert("The clipboard doesn't contain a configuration.")}),eR)()}const mT=Er(e=>{const{fallback:t}=e,n=un(e),r=Gt()?"0.0":(()=>{var i;const o=M0(n);if(!o)return"Numeric Attribute not found";const a=(i=o.attribute.decision)==null?void 0:i.state;return a!=null?a.toLocaleString():t})();return $.jsx(bm,{...e,text:r})}),Q4=mT,Z4={...fr,fallback:{title:"Unselected Text",type:D.ControlType.String,defaultValue:""},...Sm("<NumericValue>")};D.addPropertyControls(mT,Z4);const eG=Object.freeze(Object.defineProperty({__proto__:null,AttributeName:_4,BooleanSelect:r4,ChoiceSelect:e4,ChoiceValueListRenderer:D4,ChoiceValueName:F4,Colorize:w4,ComponentSelect:o4,Configuration:gU,InitializationRetry:T4,NumericInput:s4,ResetConfiguration:m4,RestoreConfiguration:W4,SatisfactionIndicator:g4,ScrollIntoView:aT,SelectedNumericValue:Q4,SelectionIndicator:S4,SelectionToggle:c4,SetSelection:d4,SetSelections:h4,Singleton:$c,Slot:dT,StoreConfiguration:pT,useDebounceValue:J1,useRenderPlaceholder:Gt,useSortedChoiceValues:Oc,withFullSize:I4},Symbol.toStringTag,{value:"Module"}));exports.Configurator=_$;exports.ConfiguratorFramer=eG;exports.ConfiguratorReact=FN;
|
|
1421
|
+
`,lT=hr(Sm(e=>{const t=vr(),n=Gt(),r=(()=>{const f=d=>{var h;const p=O.Children.toArray(d)[0],v=(h=p.props)==null?void 0:h.children;return v?f(v):p};return f(e.itemTemplate)})();if(!r)return $.jsx("span",{children:"Choice Value Template not defined"});const i=(f,d)=>f.map(h=>O.cloneElement(r,{key:h,layoutId:`${t}_${h}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:h,choiceValueName:d[h]??h}));if(n)return $.jsx(Lb,{...e,children:i(["Choice Value 1","Choice Value 2","Choice Value 3"],{})});const o=tn(e),a=rs(o);if(!a)return $.jsx("span",{children:"Choice Attribute not found"});const s=Vu(o),u=e.filter??new Array,l=a.attribute.values.filter(f=>u.length===0||u.some(({selection:d,condition:h})=>H({selection:d,condition:h}).with({selection:"included",condition:"blocked"},()=>!f.possibleDecisionStates.includes(Ye.Included)).with({selection:"included",condition:"implicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Included&&((v=f.decision)==null?void 0:v.kind)===Se.Implicit}).with({selection:"included",condition:"explicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Included&&((v=f.decision)==null?void 0:v.kind)===Se.Explicit}).with({selection:"included",condition:"none"},()=>{var p;return((p=f.decision)==null?void 0:p.state)===Ye.Included}).with({selection:"excluded",condition:"blocked"},()=>!f.possibleDecisionStates.includes(Ye.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded&&((v=f.decision)==null?void 0:v.kind)===Se.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var p,v;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded&&((v=f.decision)==null?void 0:v.kind)===Se.Explicit}).with({selection:"excluded",condition:"none"},()=>{var p;return((p=f.decision)==null?void 0:p.state)===Ye.Excluded}).with({selection:"undefined"},()=>f.decision==null).otherwise(()=>!1))),c=Dc(o,s,l).map(f=>f.id);return $.jsx(Lb,{...e,children:i(c,s)})}));function Lb(e){return $.jsxs($.Fragment,{children:[$.jsx(Oc,{singletonId:"ChoiceValueListRenderer",children:$.jsx(O4,{})}),$.jsx(uT,{style:e.style,children:e.children})]})}const D4=lT,N4={...nr,itemTemplate:{title:"Choice Value Template",type:D.ControlType.ComponentInstance},filter:{title:"Filter",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]}}}}};D.addPropertyControls(lT,N4);const{isValidElement:Vb,cloneElement:Bb}=J;function P4(e,t){return t?(Array.isArray(t)&&(t=t.map((n,r)=>Vb(n)&&typeof n.props=="object"?Bb(n,{...n.props,key:r}):n)),!e||Array.isArray(e)?t:Vb(e)?Bb(e,{...e.props,children:t}):e):e}const{isValidElement:R4}=J;function cT(e,t,n){function r(o,a){return t.visit(o,n,a)}function i(o,a){return cT(o,t,a||n)}if(R4(e)){if(typeof e.type=="function")return"prototype"in e.type&&e.type.prototype.isReactComponent?e=new e.type(e.props).render():e=e.type(e.props),i(e);if(e.props&&"children"in e.props){const o=e.props.children;return r(e,a=>Array.isArray(o)?o.map(s=>i(s,a)):i(o,a))}}else if(Array.isArray(e)){const o=e;return r(e,a=>o.map(s=>i(s,a)))}return r(e)}const{isValidElement:Ub}=J;function k4(e,t){let n;const{replace:r,updateState:i}=t;return"matchElement"in t?n=o=>Ub(o)&&o.type===t.matchElement:"matchLiteral"in t?n=o=>!Array.isArray(o)&&!Ub(o)&&t.matchLiteral(o):n=t.match,cT(e,{visit(o,a,s){const u=i?i(a):a,l=s?s(u):void 0,c=P4(o,l);return n(c,u)?r(c,u):c}},t.initialState)}function Gb(e){return $.jsx($.Fragment,{children:k4(e.children,e)})}function M4(e){return y(e,oR(/[\s\u2013]/g,"-"),b5)}const j4=hr(e=>{const{children:t,mode:n,replaceString:r,propName:i,elementName:o,text:a}=e;return n==="replace"?$.jsx(Gb,{match:s=>typeof s=="string",replace:s=>s===r?a:s,children:t}):n==="set-prop"?$.jsx(Gb,{match:s=>{var u;return((u=s.type)==null?void 0:u.displayName)===o},replace:s=>O.cloneElement(s,{[M4(i)]:a}),children:t}):t}),_f=j4,Cm=e=>({children:{title:"Content",type:D.ControlType.ComponentInstance},mode:{title:"Mode",type:D.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:D.ControlType.String,defaultValue:e,hidden:t=>t.mode!=="replace"},elementName:{title:"Element Name",type:D.ControlType.String,hidden:t=>t.mode!=="set-prop"},propName:{title:"Property Name",type:D.ControlType.String,hidden:t=>t.mode!=="set-prop"}}),fT=hr(e=>{const{attributeId:t,children:n,customName:r}=e,i=tn(e),o=(r==null?void 0:r.length)>0,a=Gt(),s=o?r:a?t:(()=>ns([i],!1)[0]?Rf(i)??t:"Attribute not found")();return $.jsx(_f,{...e,text:s})}),_4=fT,q4={...nr,customName:{title:"Custom Name",type:D.ControlType.String},...Cm("<AttributeName>")};D.addPropertyControls(fT,q4);const dT=hr(e=>{const{choiceValueId:t,children:n,customName:r,mode:i,replaceString:o,propName:a,elementName:s}=e,u=tn(e),l=r.length>0,c=t.length>0,f=Gt(),d=l?r:f?t.length>0?t:"Choice Value":(()=>{const h=rs(u);return h?c?h.attribute.values.find(p=>p.id===t)==null?"Choice Value not found":Yx(u,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return $.jsx(_f,{...e,text:d})}),F4=dT,L4={...nr,...ls,customName:{title:"Custom Name",type:D.ControlType.String},...Cm("<ChoiceValueName>")};D.addPropertyControls(dT,L4);function pT(e){return e.children}const V4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(pT,V4);function hT(e){const{children:t,fileExtension:n,fileName:r,target:i}=e;if(Gt())return t;const{configuration:o}=Rv();return Lr(t,{onClick:async()=>{const a={type:"spc-stored-configuration",storedConfiguration:U4(o)};i==="file"?G4(a,`${r}.${n}`):i==="clipboard"&&z4(a)}})}const B4={children:{title:"Content",type:D.ControlType.ComponentInstance},target:{title:"Target",type:D.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:D.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:D.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};D.addPropertyControls(hT,B4);function U4(e){return{schemaVersion:1,explicitDecisions:y(e.attributes,rw(t=>H(t).returnType().with({type:V.Choice},n=>n.values.filter(r=>{var i;return((i=r.decision)==null?void 0:i.kind)===Se.Explicit}).map(r=>({type:V.Choice,attributeId:n.id,choiceValueId:r.id,state:r.decision.state}))).with({type:V.Numeric},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Numeric,attributeId:n.id,state:n.decision.state}]:[]}).with({type:V.Boolean},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Boolean,attributeId:n.id,state:n.decision.state}]:[]}).with({type:V.Component},n=>{var r;return((r=n.decision)==null?void 0:r.kind)===Se.Explicit?[{type:V.Component,attributeId:n.id,state:n.decision.state}]:[]}).exhaustive()))}}function G4(e,t){const n=JSON.stringify(e),r=new Blob([n],{type:"application/json"}),i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)}function z4(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var vT=(e=>(e[e.parseError=0]="parseError",e[e.noConfiguration=1]="noConfiguration",e[e.unsupportedSchemaVersion=2]="unsupportedSchemaVersion",e[e.noFileSelected=3]="noFileSelected",e[e.fileReadError=4]="fileReadError",e[e.noClipboardData=5]="noClipboardData",e[e.clipboardReadError=6]="clipboardReadError",e))(vT||{});const mT=Fr((e,t)=>{const{children:n,fileExtension:r,source:i}=e;if(Gt())return n;const o=vr(),{setManyDecision:a}=ci(),{handleExplainAnswer:s}=qr();return Lr(n,{onClick:async()=>{const u=y(await X4(i,r),Mn);if(!u)return;const l={type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{const c=K4(u);await a(c,l)}catch(c){const f=c;if(console.debug("Failed to restore stored configuration",f),(f==null?void 0:f.type)===pt.ConfigurationSetManyConflict&&f.decisionExplanations){e.explain!=="disabled"&&await s(f,e.explain,o);return}alert("Failed to restore your configuration.");return}},ref:t})}),W4=mT,H4={children:{title:"Content",type:D.ControlType.ComponentInstance},source:{title:"Source",type:D.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:D.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0},...us};D.addPropertyControls(mT,H4);function K4(e){return e.explicitDecisions.map(t=>H(t).returnType().with({type:V.Choice},n=>({type:V.Choice,attributeId:n.attributeId,choiceValueId:n.choiceValueId,state:n.state})).with({type:V.Numeric},n=>({type:V.Numeric,attributeId:n.attributeId,state:n.state})).with({type:V.Boolean},n=>({type:V.Boolean,attributeId:n.attributeId,state:n.state})).with({type:V.Component},n=>({type:V.Component,attributeId:n.attributeId,state:n.state})).exhaustive())}function Y4(e){return()=>new Promise(t=>{const n=document.createElement("input");n.type="file",n.accept=`.${e}`,n.onchange=r=>{const i=r.target;if(!i.files||i.files.length===0){t(Xr(3));return}const o=i.files[0],a=new FileReader;a.onload=()=>{t(Lo(a.result))},a.onerror=()=>{t(Xr(4))},a.readAsText(o)},n.oncancel=()=>{t(Xr(3))},n.click()})}function J4(){return()=>navigator.clipboard.readText().then(e=>e?Lo(e):Xr(5)).catch(()=>Xr(6))}function X4(e,t){return y(e==="file"?Y4(t):J4(),UP(n=>T2(()=>JSON.parse(n),()=>0)),sp(n=>n.type==="spc-stored-configuration",()=>1),sp(n=>{var r;return((r=n.storedConfiguration)==null?void 0:r.schemaVersion)===1},()=>2),Ht(n=>n.storedConfiguration),eu(n=>()=>{console.debug(`Failed to load stored configuration: ${vT[n]}`),n==4?alert("Failed to read the selected file. Maybe it is damaged."):n==1||n==0?e==="file"?alert("The selected file doesn't contain a valid configuration."):e==="clipboard"&&alert("The clipboard doesn't contain a valid configuration."):n==2?alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one."):n==6?alert("Can't read the clipboard. Make to give a permission for reading the clipboard."):n==5&&alert("The clipboard doesn't contain a configuration.")}),tR)()}const yT=hr(e=>{const{fallback:t}=e,n=tn(e),r=Gt()?"0.0":(()=>{var i;const o=j0(n);if(!o)return"Numeric Attribute not found";const a=(i=o.attribute.decision)==null?void 0:i.state;return a!=null?a.toLocaleString():t})();return $.jsx(_f,{...e,text:r})}),Q4=yT,Z4={...nr,fallback:{title:"Unselected Text",type:D.ControlType.String,defaultValue:""},...Cm("<NumericValue>")};D.addPropertyControls(yT,Z4);const eG=Object.freeze(Object.defineProperty({__proto__:null,AttributeName:_4,BooleanSelect:r4,ChoiceSelect:e4,ChoiceValueListRenderer:D4,ChoiceValueName:F4,Colorize:w4,ComponentSelect:o4,Configuration:gU,InitializationRetry:T4,NumericInput:s4,ReplaceText:_f,ResetConfiguration:m4,RestoreConfiguration:W4,SatisfactionIndicator:g4,ScrollIntoView:sT,SelectedNumericValue:Q4,SelectionIndicator:S4,SelectionToggle:c4,SetSelection:d4,SetSelections:h4,Singleton:Oc,Slot:pT,StoreConfiguration:hT,attributeIdPropertyControls:nr,choiceValueIdPropertyControls:ls,cloneChildrenWithProps:Lr,explainableComponent:Fr,parseGlobalAttributeId:tn,useAttributeName:Rf,useChoiceValueName:Yx,useChoiceValueNames:Vu,useControlId:vr,useDebounceValue:X1,useExplain:qr,useExplainProcess:di,useRenderPlaceholder:Gt,useSortedChoiceValues:Dc,withControlId:Sm,withErrorBoundary:hr,withFullSize:I4},Symbol.toStringTag,{value:"Module"}));exports.Configurator=q$;exports.ConfiguratorFramer=eG;exports.ConfiguratorReact=LN;
|