@viamedici-spc/configurator-framer-bundle 0.1.0-alpha0021 → 0.1.0-alpha0023
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 +92 -92
- package/dist/index.js +3065 -3075
- package/package.json +3 -2
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"),j=require("framer"),Yg=require("react-dom"),i1=require("framer-motion");function Xg(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=Xg(O),o1=Xg(Yg);var a1=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))},s1=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},u1=function(e){var t=s1(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function ti(e){return e}function ul(e){return function(){return e}}var c1=ul(null),Jg=ul(void 0),qr=Jg;function Yn(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 S(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 c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var Dr=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,a1([i],r,!1))}}},l1=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))},f1=function(e){return e._tag==="None"},Lp=function(e){return e._tag==="Some"},cl={_tag:"None"},ll=function(e){return{_tag:"Some",value:e}},d1=function(e){return e._tag==="Left"},fl=function(e){return{_tag:"Left",left:e}},dl=function(e){return{_tag:"Right",right:e}},p1=function(e){return[e]},h1=function(e){return e.length>0},v1=function(e){return e[0]},m1=function(e){return e.slice(1)},y1=[],g1={},b1=Object.prototype.hasOwnProperty,S1=function(e){return l1([e[0]],e.slice(1),!0)};function C1(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 w1(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 Qg(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):Qg(e,t-1,i)}}function x1(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 Qg(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 E1(e){return function(t){for(var n=Object.keys(t),r=n.length,i=x1(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function T1(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function I1(e){var t=w1(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Zg(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var A1=function(e){return function(){return Promise.resolve().then(e)}};function $1(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var pl=function(e,t){return S(e,eb(t))},Bp=function(e,t){return S(e,O1(t))},eb=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},O1=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)})}}},Zs=function(e){return function(){return Promise.resolve(e)}},Vp=Dr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),eu="Task",hl={URI:eu,map:pl},Up={URI:eu,of:Zs},D1={URI:eu,map:pl,ap:Bp},Gp={URI:eu,map:pl,of:Zs,ap:Bp,chain:Vp},N1=ti,Mv=Vp,Ec={URI:eu,map:pl,of:Zs,ap:Bp,chain:Vp,fromIO:A1,fromTask:N1};function tb(e){return function(t){return function(n){return e.fromEither(f1(n)?fl(t()):dl(n.value))}}}function P1(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?dl(o):fl(r(o)))})}}}var zp=fl,vl=dl,nb=function(e,t){return S(e,k1(t))},R1=function(e,t){return S(e,_1(t))},Wp="Either",k1=function(e){return function(t){return xi(t)?t:vl(e(t.right))}},M1={URI:Wp,map:nb},j1=function(e){return function(t){return xi(t)?t:xi(e)?e:vl(t.right(e.right))}},_1=j1,q1={URI:Wp,map:nb,ap:R1},F1=function(e){return function(t){return xi(t)?zp(e(t.left)):t}},rb={URI:Wp,fromEither:ti},L1=tb(rb),xi=d1,B1=function(e,t){return function(n){return xi(n)?e(n.left):t(n.right)}},Yi=B1;rb.fromEither;var V1=function(e){return xi(e)?vl(e.left):zp(e.right)},On=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},yn=function(e){return On(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},jv=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return On(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},Hp={equals:function(e,t){return e===t}};Hp.equals;var U1=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function G1(e,t){return e<t?-1:e>t?1:0}var z1={equals:Hp.equals,compare:G1},W1=z1,H1=function(e){return{concat:U1(e)}},K1=H1,_v=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))},Y1=y1,X1=h1,J1=function(e,t){return e<0||e>=t.length},Q1=function(e){return function(t){return _v(_v([],t,!0),[e],!1)}},Z1=Q1,eE=function(e,t,n){if(n[e]===t)return n;var r=S1(n);return r[e]=t,r},tE=function(e){return function(t){if(t.length===1)return t;for(var n=[iE(t)],r=oE(t),i=function(u){n.every(function(c){return!e.equals(c,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},nE=p1,rE=v1,iE=rE,oE=m1,ml={equals:function(e,t){return e===t}},aE={equals:ml.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};ml.equals,aE.compare;globalThis&&globalThis.__spreadArray;var Tc=function(e){return e.length===0},Da=X1,sE=Z1,uE=function(e){return function(t){if(Tc(t))return Xp;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},ib=J1,cE=function(e){return function(t){return ib(e,t)?t:e===0?Xp:t.slice(0,e)}},lE=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ll(n);return cl}};function ln(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ll(t[n]);return cl}}var fE=function(e,t){return function(n){return ib(e,n)?cl:ll(mE(e,t(n[e]),n))}};function Kp(e){return function(t,n){if(n===void 0){var r=Kp(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 ia=function(e){var t=tE(e);return function(n){return Da(n)?t(n):n}},dE=function(e){return function(t){return Tc(t)?e:Tc(e)?t:t.concat(e)}},Ne=dE;function ob(e){var t=Kp(e);return function(n,r){if(r===void 0){var i=ob(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var pE=nE,ab=Dr(2,function(e,t){return S(e,uE(function(n,r){return t(r,n)}))}),Yp=ab(ti),z=function(e){return function(t){return t.map(function(n){return e(n)})}},zt=function(e){return function(t){return t.filter(e)}},hE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Lp(i)&&n.push(i.value)}return n}},$o=function(e){return hE(function(t,n){return e(n)})},Hn=$o(ti),od=function(e,t){return vE(e,function(n,r,i){return t(r,i)})},vE=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}},ji=function(e){return On(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},mE=function(e,t,n){return Da(n)?eE(e,t,n):n},ad=function(e){return e.slice()},qv=function(e){return Tc(e)?Xp:e.slice()},Xp=Y1,yE=ab,gE=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 Wi(e){return ln(e)}var tc=function(e){return function(t){return t.map(function(n){return e(n)})}},bE=Dr(2,function(e,t){return S(e,gE(function(n,r){return t(r,n)}))}),SE=bE(ti),CE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Lp(i)&&n.push(i.value)}return n}},oi=function(e){return CE(function(t,n){return e(n)})},wE=function(e){return function(t){return t.filter(e)}},sb=function(e){return function(t){return Yn(e,t)}},xE=function(e){return function(t){return function(n){return t(n)&&e(n)}}},me=cl,Me=ll;function tu(e){return function(t){return e(t)?Me(t):me}}var ub=function(e,t){return S(e,ee(t))},cb=function(e,t){return S(e,EE(t))},lb="Option",Oo=function(e){return{equals:function(t,n){return t===n||(yr(t)?yr(n):yr(n)?!1:e.equals(t.value,n.value))}}},ee=function(e){return function(t){return yr(t)?me:Me(e(t.value))}},gi=Me,EE=function(e){return function(t){return yr(t)||yr(e)?me:Me(t.value(e.value))}},TE={URI:lb,map:ub,ap:cb,of:gi},Jp=Dr(2,function(e,t){return yr(e)?me:t(e.value)}),IE={URI:lb,map:ub,ap:cb,chain:Jp},AE=Dr(2,function(e,t){return yr(e)?t():e}),Fv=AE,$E=Jp(ti),Ht=function(e){return function(t){return yr(t)?me:e(t.value)?t:me}},is=Lp,yr=function(e){return e._tag==="None"},OE=function(e,t){return function(n){return yr(n)?e():t(n.value)}},Ei=OE,fb=Ei,DE=function(e){return function(t){return yr(t)?e():t.value}},at=DE,sd=$E,NE=Dr(2,Zg(IE)),Se=function(e){return e==null?me:Me(e)},nr=Ei(c1,ti),kt=Ei(Jg,ti),rr=Jp,PE=NE,RE=I1(TE);function kE(e){return Yn(vl,e.of)}function ME(e){return Yn(zp,e.of)}function jE(e){return T1(e,M1)}function _E(e){return C1(e,q1)}function qE(e){return function(t,n){return e.chain(t,function(r){return xi(r)?e.of(r):n(r.right)})}}function FE(e){return function(t,n){return e.map(t,F1(n))}}function LE(e){return function(t,n){return function(r){return e.map(r,Yi(t,n))}}}function BE(e){return function(t){return function(n){return e.chain(n,function(r){return xi(r)?t(r.left):e.of(r)})}}}function VE(e){return function(t){return e.map(t,V1)}}var UE=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(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},GE=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(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Ur=ME(Up),Na=kE(Up),zE=Zs,WE=function(e){return eb(L1(e))},Ic=LE(hl),Lv=function(e,t){return function(){return UE(void 0,void 0,void 0,function(){var n;return GE(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(dl)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,fl(t(n))];case 3:return[2]}})})}},db=BE(Gp),Bv=VE(hl),pb=function(e,t){return S(e,Kt(t))},hb=function(e,t){return S(e,KE(t))},Kt=jE(hl),HE=Dr(2,FE(hl)),hr=HE,KE=_E(D1),vb=Dr(2,qE(Gp)),oa=Na,Qp="TaskEither",YE={URI:Qp,map:pb,ap:hb,of:oa},mb={URI:Qp,map:pb,ap:hb,chain:vb},Zp={URI:Qp,fromEither:zE},XE=Dr(2,Zg(mb)),eh=tb(Zp);Zp.fromEither;var JE=P1(Zp,mb),QE=oa(g1),dr=vb,ZE=XE;function eT(e){return t=>S(t,Kt(n=>(e(n)(),n)))}const Os=eT;function Ac(e){return t=>S(t,Bv,Os(e),Bv)}function tT(e){return t=>S(t,Os(n=>()=>e(n)()),Ac(n=>()=>e(n)()))}function nT(e){return t=>S(t,ee(n=>(e(n)(),n)))}const rT=nT;function iT(e){return Yn(Me,e.of)}function oT(e){return ul(e.of(me))}function aT(e){var t=oT(e);return function(n,r){return e.chain(n,Ei(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var sT=iT(Up),uT=Zs,cT=Dr(2,aT(Gp)),lT=cT,fT=u1,lt={equals:function(e,t){return e===t}};lt.equals;function yb(e){return function(t,n){if(n===void 0){var r=yb(e);return function(o){return r(o,t)}}for(var i in t)if(!b1.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function gb(e){var t=yb(e);return On(function(n,r){return t(n)(r)&&t(r)(n)})}function nu(e){return On((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var th={equals:function(e,t){return e===t}};th.equals;const Rn=Symbol.for("@ts-pattern/matcher"),bb=Symbol.for("@ts-pattern/isVariadic"),$c="@ts-pattern/anonymous-select-key",ud=e=>!!(e&&typeof e=="object"),nc=e=>e&&!!e[Rn],vn=(e,t,n)=>{if(nc(e)){const r=e[Rn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(ud(e)){if(!ud(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];nc(s)&&s[bb]?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((c,l)=>vn(c,a[l],n))&&i.every((c,l)=>vn(c,s[l],n))&&(o.length===0||vn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>vn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||nc(o=i)&&o[Rn]().matcherType==="optional")&&vn(i,t[r],n);var o})}return Object.is(t,e)},zn=e=>{var t,n,r;return ud(e)?nc(e)?(t=(n=(r=e[Rn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?Ds(e,zn):Ds(Object.values(e),zn):[]},Ds=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function dT(...e){if(e.length===1){const[t]=e;return n=>vn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return vn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function wn(e){return Object.assign(e,{optional:()=>nh(e),and:t=>xt(e,t),or:t=>Sb(e,t),select:t=>t===void 0?Ns(e):Ns(t,e)})}function cd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[bb]:!0})}}))(e),{optional:()=>cd(nh(e)),select:t=>cd(t===void 0?Ns(e):Ns(t,e))})}function nh(e){return wn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(zn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:vn(e,t,r),selections:n}},getSelectionKeys:()=>zn(e),matcherType:"optional"})})}const pT=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},hT=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function xt(...e){return wn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>vn(i,t,r)),selections:n}},getSelectionKeys:()=>Ds(e,zn),matcherType:"and"})})}function Sb(...e){return wn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return Ds(e,zn).forEach(i=>r(i,void 0)),{matched:e.some(i=>vn(i,t,r)),selections:n}},getSelectionKeys:()=>Ds(e,zn),matcherType:"or"})})}function Ye(e){return{[Rn]:()=>({match:t=>({matched:!!e(t)})})}}function Ns(...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 wn({[Rn]:()=>({match:r=>{let i={[t??$c]:r};return{matched:n===void 0||vn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??$c].concat(n===void 0?[]:zn(n))})})}function Cr(e){return typeof e=="number"}function Xi(e){return typeof e=="string"}function ui(e){return typeof e=="bigint"}const Cb=wn(Ye(function(e){return!0})),vT=Cb,Ji=e=>Object.assign(wn(e),{startsWith:t=>{return Ji(xt(e,(n=t,Ye(r=>Xi(r)&&r.startsWith(n)))));var n},endsWith:t=>{return Ji(xt(e,(n=t,Ye(r=>Xi(r)&&r.endsWith(n)))));var n},minLength:t=>Ji(xt(e,(n=>Ye(r=>Xi(r)&&r.length>=n))(t))),maxLength:t=>Ji(xt(e,(n=>Ye(r=>Xi(r)&&r.length<=n))(t))),includes:t=>{return Ji(xt(e,(n=t,Ye(r=>Xi(r)&&r.includes(n)))));var n},regex:t=>{return Ji(xt(e,(n=t,Ye(r=>Xi(r)&&!!r.match(n)))));var n}}),mT=Ji(Ye(Xi)),wr=e=>Object.assign(wn(e),{between:(t,n)=>wr(xt(e,((r,i)=>Ye(o=>Cr(o)&&r<=o&&i>=o))(t,n))),lt:t=>wr(xt(e,(n=>Ye(r=>Cr(r)&&r<n))(t))),gt:t=>wr(xt(e,(n=>Ye(r=>Cr(r)&&r>n))(t))),lte:t=>wr(xt(e,(n=>Ye(r=>Cr(r)&&r<=n))(t))),gte:t=>wr(xt(e,(n=>Ye(r=>Cr(r)&&r>=n))(t))),int:()=>wr(xt(e,Ye(t=>Cr(t)&&Number.isInteger(t)))),finite:()=>wr(xt(e,Ye(t=>Cr(t)&&Number.isFinite(t)))),positive:()=>wr(xt(e,Ye(t=>Cr(t)&&t>0))),negative:()=>wr(xt(e,Ye(t=>Cr(t)&&t<0)))}),yT=wr(Ye(Cr)),ci=e=>Object.assign(wn(e),{between:(t,n)=>ci(xt(e,((r,i)=>Ye(o=>ui(o)&&r<=o&&i>=o))(t,n))),lt:t=>ci(xt(e,(n=>Ye(r=>ui(r)&&r<n))(t))),gt:t=>ci(xt(e,(n=>Ye(r=>ui(r)&&r>n))(t))),lte:t=>ci(xt(e,(n=>Ye(r=>ui(r)&&r<=n))(t))),gte:t=>ci(xt(e,(n=>Ye(r=>ui(r)&&r>=n))(t))),positive:()=>ci(xt(e,Ye(t=>ui(t)&&t>0))),negative:()=>ci(xt(e,Ye(t=>ui(t)&&t<0)))}),gT=ci(Ye(ui)),bT=wn(Ye(function(e){return typeof e=="boolean"})),ST=wn(Ye(function(e){return typeof e=="symbol"})),CT=wn(Ye(function(e){return e==null}));var Ct={__proto__:null,matcher:Rn,optional:nh,array:function(...e){return cd({[Rn]:()=>({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 zn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>vn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:zn(e[0])})})},set:function(...e){return wn({[Rn]:()=>({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:pT(t,o=>vn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:zn(e[0])})})},map:function(...e){return wn({[Rn]:()=>({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:hT(t,(s,u)=>{const c=vn(o,u,r),l=vn(a,s,r);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...zn(e[0]),...zn(e[1])]})})},intersection:xt,union:Sb,not:function(e){return wn({[Rn]:()=>({match:t=>({matched:!vn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Ye,select:Ns,any:Cb,_:vT,string:mT,number:yT,bigint:gT,boolean:bT,symbol:ST,nullish:CT,instanceOf:function(e){return wn(Ye(function(t){return n=>n instanceof t}(e)))},shape:function(e){return wn(Ye(dT(e)))}};const ld={matched:!1,value:void 0};function ue(e){return new wT(e,ld)}let wT=class fd{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=(c,l)=>{o=!0,a[c]=l},u=!r.some(c=>vn(c,this.input,s))||i&&!i(this.input)?ld:{matched:!0,value:n(o?$c in a?a[$c]:a:this.input,this.input)};return new fd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new fd(this.input,r?{matched:!0,value:n(this.input,this.input)}:ld)}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 xT=Object.getOwnPropertyNames,ET=Object.getOwnPropertySymbols,TT=Object.prototype.hasOwnProperty;function Vv(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function xu(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 Uv(e){return xT(e).concat(ET(e))}var wb=Object.hasOwn||function(e,t){return TT.call(e,t)};function Pa(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var xb="_owner",Gv=Object.getOwnPropertyDescriptor,zv=Object.keys;function IT(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 AT(e,t){return Pa(e.getTime(),t.getTime())}function Wv(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(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],E=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,E,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function $T(e,t,n){var r=zv(e),i=r.length;if(zv(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===xb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!wb(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function Ya(e,t,n){var r=Uv(e),i=r.length;if(Uv(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===xb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!wb(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Gv(e,o),s=Gv(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function OT(e,t){return Pa(e.valueOf(),t.valueOf())}function DT(e,t){return e.source===t.source&&e.flags===t.flags}function Hv(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,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function NT(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 PT="[object Arguments]",RT="[object Boolean]",kT="[object Date]",MT="[object Map]",jT="[object Number]",_T="[object Object]",qT="[object RegExp]",FT="[object Set]",LT="[object String]",BT=Array.isArray,Kv=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Yv=Object.assign,VT=Object.prototype.toString.call.bind(Object.prototype.toString);function UT(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(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(BT(l))return t(l,f,d);if(Kv!=null&&Kv(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=VT(l);return h===kT?n(l,f,d):h===qT?a(l,f,d):h===MT?r(l,f,d):h===FT?s(l,f,d):h===_T?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===PT?i(l,f,d):h===RT||h===jT||h===LT?o(l,f,d):!1}}function GT(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?Ya:IT,areDatesEqual:AT,areMapsEqual:r?Vv(Wv,Ya):Wv,areObjectsEqual:r?Ya:$T,arePrimitiveWrappersEqual:OT,areRegExpsEqual:DT,areSetsEqual:r?Vv(Hv,Ya):Hv,areTypedArraysEqual:r?Ya:NT};if(n&&(i=Yv({},i,n(i))),t){var o=xu(i.areArraysEqual),a=xu(i.areMapsEqual),s=xu(i.areObjectsEqual),u=xu(i.areSetsEqual);i=Yv({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function zT(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function WT(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{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,c){return n(u,c,a)}}var HT=_i();_i({strict:!0});_i({circular:!0});_i({circular:!0,strict:!0});_i({createInternalComparator:function(){return Pa}});_i({strict:!0,createInternalComparator:function(){return Pa}});_i({circular:!0,createInternalComparator:function(){return Pa}});_i({circular:!0,createInternalComparator:function(){return Pa},strict:!0});function _i(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=GT(e),u=UT(s),c=r?r(u):zT(u);return WT({circular:n,comparator:u,createState:i,equals:c,strict:a})}function KT(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 YT(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),KT(e)}var gs=S,XT=fT(RE({concat:K1(W1).concat,empty:0}))();function JT(e){return function(t){return t.iterNumber>=e?me:Me(0)}}function QT(e,t){return function(n){return gs(n,t,ee(function(r){return Math.min(e,r)}))}}function ZT(e){return function(t){return Me(e*Math.pow(2,t.iterNumber))}}var eI={iterNumber:0,cumulativeDelay:0,previousDelay:me};function tI(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+at(function(){return 0})(n),previousDelay:n}}function nI(e,t){var n=tI(e,t);return gs(n.previousDelay,fb(function(){return Ec.of(n)},function(r){return $1(r)(Ec.of(n))}))}function qo(e,t,n){var r=function(i){return gs(i,t,Mv(function(o){return n(o)?gs(nI(e,i),Mv(function(a){return gs(a.previousDelay,fb(function(){return Ec.of(o)},function(){return r(a)}))})):Ec.of(o)}))};return r(eI)}var Xv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Eb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.isGuid=Tb=Ps.guid=void 0;var rI=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+=Jv()+"-";for(o+=r,o+=t;o.length<i;)o+=Jv();return o.substring(0,i)},Tb=Ps.guid=rI,Jv=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},iI=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=oI(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"};Ps.isGuid=iI;var oI=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function rh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function yl(e){return{equals(t,n){const r=S(Se(t),at(()=>[])),i=S(Se(n),at(()=>[]));return ji(e).equals(r,i)}}}const Do=yn({localId:lt,componentPath:yl(lt),sharedConfigurationModelId:rh(lt)}),ih=yn({localId:lt,configurationModelId:lt}),Ib=On((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>aI.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>sI.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>uI.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>cI.equals(n.x,n.y)).otherwise(()=>!1)),aI=yn({type:lt,attributeId:Do,state:lt,choiceValueId:lt}),sI=yn({type:lt,attributeId:Do,state:lt}),uI=yn({type:lt,attributeId:Do,state:ml}),cI=yn({type:lt,attributeId:Do,state:th});var Cn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Cn||{}),Ut=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Ut||{}),fa=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(fa||{}),on=(e=>(e.all="all",e.none="none",e.specific="specific",e))(on||{}),Hr=(e=>(e.Channel="Channel",e.Package="Package",e))(Hr||{}),Oe=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(Oe||{}),Kr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Kr||{}),Ti=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ti||{}),$r=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))($r||{}),Ar=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Ar||{}),Ii=(e=>(e.Always="Always",e.Optional="Optional",e))(Ii||{});const lI=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:on,AttributeType:Oe,ChoiceValueDecisionState:Kr,ComponentDecisionState:Ti,ConfigurationModelSourceType:Hr,ConstraintType:fa,DecisionKind:$r,ExplainQuestionSubject:Ut,ExplainQuestionType:Cn,Inclusion:Ii,Selection:Ar,eqCausedByDecision:Ib,eqGlobalAttributeId:Do,eqGlobalConstraintId:ih},Symbol.toStringTag,{value:"Module"}));var Bt=(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))(Bt||{}),gl=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(gl||{});const Ab={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},fI=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:gl,FailureResultFactory:Ab,FailureType:Bt},Symbol.toStringTag,{value:"Module"}));let $b=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:Hr.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Hr.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return S(t,Se,ee(Yn(z(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),kt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:S([...t.decisions],tc(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return S(Se(t),kt)}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:on.all},()=>({type:"AllowedRulesAll"})).with({type:on.none},()=>({type:"AllowedRulesNone"})).with({type:on.specific},n=>({type:"AllowedRulesSpecific",rules:S(n.rules,z(this.mapToGlobalConstraintId),ad)})).with(Ct.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function dI(e){return t=>JE(n=>n!=null,e)(t)}function pI(){return Na(qr())}var Un=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Un||{}),ao=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(ao||{}),dn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(dn||{}),so=(e=>(e.all="all",e.none="none",e.specific="specific",e))(so||{});const bn=yn({localId:lt,componentPath:yl(lt),sharedConfigurationModel:rh(lt)}),hI=Oo(ji(yn({attributeId:bn,decisions:yl(bn)}))),vI=Oo(On((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})=>ji(ih).equals(n.rules,r.rules)).otherwise(()=>!1))),mI=Oo(yn({rules:vI})),yI=yn({configurationModelSource:On((e,t)=>HT(e,t)),decisionsToRespect:hI,usageRuleParameters:gb(lt),allowedInExplain:mI});var Rs=(e=>(e.Channel="Channel",e.Package="Package",e))(Rs||{}),ut=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ut||{}),Ee=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ee||{}),Xt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Xt||{}),Nt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Nt||{}),po=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(po||{}),ho=(e=>(e.Always="Always",e.Optional="Optional",e))(ho||{});const gI={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Oo(lt).equals(e.state,t.state)},bI={equals(e,t){return Oo(ml).equals(e.value,t.value)}},SI={equals(e,t){return Oo(th).equals(e.value,t.value)}},CI={equals(e,t){return Oo(lt).equals(e.state,t.state)}},wI={equals(e,t){return bn.equals(e.attributeId,t.attributeId)?ue({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>SI.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>bI.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>CI.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>gI.equals(r.x,r.y)).otherwise(()=>!1):!1}},xI=ji(wI),EI={equals:(e,t)=>xI.equals(e.decisions,t.decisions)&&TI.equals(e.mode,t.mode)},TI={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 dd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(dd||{}),da=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(da||{}),Ce=(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))(Ce||{}),oh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(oh||{});const II={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};function AI(e,t){console.log(`--------------------------------------------------------------------------------
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),$=require("react/jsx-runtime"),j=require("framer"),Yg=require("react-dom"),i1=require("framer-motion");function Xg(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=Xg(O),o1=Xg(Yg);var a1=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))},s1=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},u1=function(e){var t=s1(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function Zr(e){return e}function ul(e){return function(){return e}}var c1=ul(null),Jg=ul(void 0),qr=Jg;function Yn(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 c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var Dr=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,a1([i],r,!1))}}},l1=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))},f1=function(e){return e._tag==="None"},Lp=function(e){return e._tag==="Some"},cl={_tag:"None"},ll=function(e){return{_tag:"Some",value:e}},d1=function(e){return e._tag==="Left"},fl=function(e){return{_tag:"Left",left:e}},dl=function(e){return{_tag:"Right",right:e}},p1=function(e){return[e]},h1=function(e){return e.length>0},v1=function(e){return e[0]},m1=function(e){return e.slice(1)},y1=[],g1={},b1=Object.prototype.hasOwnProperty,S1=function(e){return l1([e[0]],e.slice(1),!0)};function w1(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 C1(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 Qg(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):Qg(e,t-1,i)}}function x1(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 Qg(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 E1(e){return function(t){for(var n=Object.keys(t),r=n.length,i=x1(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function T1(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function I1(e){var t=C1(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function Zg(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var A1=function(e){return function(){return Promise.resolve().then(e)}};function $1(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var pl=function(e,t){return w(e,eb(t))},Bp=function(e,t){return w(e,O1(t))},eb=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},O1=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)})}}},Qs=function(e){return function(){return Promise.resolve(e)}},Vp=Dr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),Zs="Task",hl={URI:Zs,map:pl},Up={URI:Zs,of:Qs},D1={URI:Zs,map:pl,ap:Bp},Gp={URI:Zs,map:pl,of:Qs,ap:Bp,chain:Vp},N1=Zr,Mv=Vp,Ec={URI:Zs,map:pl,of:Qs,ap:Bp,chain:Vp,fromIO:A1,fromTask:N1};function tb(e){return function(t){return function(n){return e.fromEither(f1(n)?fl(t()):dl(n.value))}}}function P1(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?dl(o):fl(r(o)))})}}}var zp=fl,vl=dl,nb=function(e,t){return w(e,k1(t))},R1=function(e,t){return w(e,_1(t))},Wp="Either",k1=function(e){return function(t){return xi(t)?t:vl(e(t.right))}},M1={URI:Wp,map:nb},j1=function(e){return function(t){return xi(t)?t:xi(e)?e:vl(t.right(e.right))}},_1=j1,q1={URI:Wp,map:nb,ap:R1},F1=function(e){return function(t){return xi(t)?zp(e(t.left)):t}},rb={URI:Wp,fromEither:Zr},L1=tb(rb),xi=d1,B1=function(e,t){return function(n){return xi(n)?e(n.left):t(n.right)}},Yi=B1;rb.fromEither;var V1=function(e){return xi(e)?vl(e.left):zp(e.right)},On=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},yn=function(e){return On(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},jv=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return On(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},Hp={equals:function(e,t){return e===t}};Hp.equals;var U1=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function G1(e,t){return e<t?-1:e>t?1:0}var z1={equals:Hp.equals,compare:G1},W1=z1,H1=function(e){return{concat:U1(e)}},K1=H1,_v=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))},Y1=y1,X1=h1,J1=function(e,t){return e<0||e>=t.length},Q1=function(e){return function(t){return _v(_v([],t,!0),[e],!1)}},Z1=Q1,eE=function(e,t,n){if(n[e]===t)return n;var r=S1(n);return r[e]=t,r},tE=function(e){return function(t){if(t.length===1)return t;for(var n=[iE(t)],r=oE(t),i=function(u){n.every(function(c){return!e.equals(c,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},nE=p1,rE=v1,iE=rE,oE=m1,ml={equals:function(e,t){return e===t}},aE={equals:ml.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};ml.equals,aE.compare;globalThis&&globalThis.__spreadArray;var Tc=function(e){return e.length===0},eu=X1,sE=Z1,uE=function(e){return function(t){if(Tc(t))return Xp;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},ib=J1,cE=function(e){return function(t){return ib(e,t)?t:e===0?Xp:t.slice(0,e)}},lE=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ll(n);return cl}};function ln(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return ll(t[n]);return cl}}var fE=function(e,t){return function(n){return ib(e,n)?cl:ll(mE(e,t(n[e]),n))}};function Kp(e){return function(t,n){if(n===void 0){var r=Kp(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 ra=function(e){var t=tE(e);return function(n){return eu(n)?t(n):n}},dE=function(e){return function(t){return Tc(t)?e:Tc(e)?t:t.concat(e)}},Ne=dE;function ob(e){var t=Kp(e);return function(n,r){if(r===void 0){var i=ob(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var pE=nE,ab=Dr(2,function(e,t){return w(e,uE(function(n,r){return t(r,n)}))}),Yp=ab(Zr),z=function(e){return function(t){return t.map(function(n){return e(n)})}},zt=function(e){return function(t){return t.filter(e)}},hE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Lp(i)&&n.push(i.value)}return n}},$o=function(e){return hE(function(t,n){return e(n)})},Hn=$o(Zr),od=function(e,t){return vE(e,function(n,r,i){return t(r,i)})},vE=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}},ji=function(e){return On(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},mE=function(e,t,n){return eu(n)?eE(e,t,n):n},ad=function(e){return e.slice()},qv=function(e){return Tc(e)?Xp:e.slice()},Xp=Y1,yE=ab,gE=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 Wi(e){return ln(e)}var tc=function(e){return function(t){return t.map(function(n){return e(n)})}},bE=Dr(2,function(e,t){return w(e,gE(function(n,r){return t(r,n)}))}),SE=bE(Zr),wE=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);Lp(i)&&n.push(i.value)}return n}},ri=function(e){return wE(function(t,n){return e(n)})},CE=function(e){return function(t){return t.filter(e)}},sb=function(e){return function(t){return Yn(e,t)}},xE=function(e){return function(t){return function(n){return t(n)&&e(n)}}},me=cl,Me=ll;function tu(e){return function(t){return e(t)?Me(t):me}}var ub=function(e,t){return w(e,ee(t))},cb=function(e,t){return w(e,EE(t))},lb="Option",Oo=function(e){return{equals:function(t,n){return t===n||(yr(t)?yr(n):yr(n)?!1:e.equals(t.value,n.value))}}},ee=function(e){return function(t){return yr(t)?me:Me(e(t.value))}},mi=Me,EE=function(e){return function(t){return yr(t)||yr(e)?me:Me(t.value(e.value))}},TE={URI:lb,map:ub,ap:cb,of:mi},Jp=Dr(2,function(e,t){return yr(e)?me:t(e.value)}),IE={URI:lb,map:ub,ap:cb,chain:Jp},AE=Dr(2,function(e,t){return yr(e)?t():e}),Fv=AE,$E=Jp(Zr),Ht=function(e){return function(t){return yr(t)?me:e(t.value)?t:me}},rs=Lp,yr=function(e){return e._tag==="None"},OE=function(e,t){return function(n){return yr(n)?e():t(n.value)}},Ei=OE,fb=Ei,DE=function(e){return function(t){return yr(t)?e():t.value}},at=DE,sd=$E,NE=Dr(2,Zg(IE)),Se=function(e){return e==null?me:Me(e)},nr=Ei(c1,Zr),kt=Ei(Jg,Zr),rr=Jp,PE=NE,RE=I1(TE);function kE(e){return Yn(vl,e.of)}function ME(e){return Yn(zp,e.of)}function jE(e){return T1(e,M1)}function _E(e){return w1(e,q1)}function qE(e){return function(t,n){return e.chain(t,function(r){return xi(r)?e.of(r):n(r.right)})}}function FE(e){return function(t,n){return e.map(t,F1(n))}}function LE(e){return function(t,n){return function(r){return e.map(r,Yi(t,n))}}}function BE(e){return function(t){return function(n){return e.chain(n,function(r){return xi(r)?t(r.left):e.of(r)})}}}function VE(e){return function(t){return e.map(t,V1)}}var UE=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(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},GE=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(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},yi=ME(Up),Oa=kE(Up),zE=Qs,WE=function(e){return eb(L1(e))},Ic=LE(hl),Lv=function(e,t){return function(){return UE(void 0,void 0,void 0,function(){var n;return GE(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(dl)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,fl(t(n))];case 3:return[2]}})})}},db=BE(Gp),Bv=VE(hl),pb=function(e,t){return w(e,Kt(t))},hb=function(e,t){return w(e,KE(t))},Kt=jE(hl),HE=Dr(2,FE(hl)),hr=HE,KE=_E(D1),vb=Dr(2,qE(Gp)),ia=Oa,Qp="TaskEither",YE={URI:Qp,map:pb,ap:hb,of:ia},mb={URI:Qp,map:pb,ap:hb,chain:vb},Zp={URI:Qp,fromEither:zE},XE=Dr(2,Zg(mb)),eh=tb(Zp);Zp.fromEither;var JE=P1(Zp,mb),QE=ia(g1),dr=vb,ZE=XE;function eT(e){return t=>w(t,Kt(n=>(e(n)(),n)))}const $s=eT;function Ac(e){return t=>w(t,Bv,$s(e),Bv)}function tT(e){return t=>w(t,$s(n=>()=>e(n)()),Ac(n=>()=>e(n)()))}function nT(e){return t=>w(t,ee(n=>(e(n)(),n)))}const rT=nT;function iT(e){return Yn(Me,e.of)}function oT(e){return ul(e.of(me))}function aT(e){var t=oT(e);return function(n,r){return e.chain(n,Ei(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var sT=iT(Up),uT=Qs,cT=Dr(2,aT(Gp)),lT=cT,fT=u1,lt={equals:function(e,t){return e===t}};lt.equals;function yb(e){return function(t,n){if(n===void 0){var r=yb(e);return function(o){return r(o,t)}}for(var i in t)if(!b1.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function gb(e){var t=yb(e);return On(function(n,r){return t(n)(r)&&t(r)(n)})}function nu(e){return On((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}var th={equals:function(e,t){return e===t}};th.equals;const Rn=Symbol.for("@ts-pattern/matcher"),bb=Symbol.for("@ts-pattern/isVariadic"),$c="@ts-pattern/anonymous-select-key",ud=e=>!!(e&&typeof e=="object"),nc=e=>e&&!!e[Rn],vn=(e,t,n)=>{if(nc(e)){const r=e[Rn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(ud(e)){if(!ud(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];nc(s)&&s[bb]?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((c,l)=>vn(c,a[l],n))&&i.every((c,l)=>vn(c,s[l],n))&&(o.length===0||vn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>vn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||nc(o=i)&&o[Rn]().matcherType==="optional")&&vn(i,t[r],n);var o})}return Object.is(t,e)},zn=e=>{var t,n,r;return ud(e)?nc(e)?(t=(n=(r=e[Rn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?Os(e,zn):Os(Object.values(e),zn):[]},Os=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function dT(...e){if(e.length===1){const[t]=e;return n=>vn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return vn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function Cn(e){return Object.assign(e,{optional:()=>nh(e),and:t=>xt(e,t),or:t=>Sb(e,t),select:t=>t===void 0?Ds(e):Ds(t,e)})}function cd(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[bb]:!0})}}))(e),{optional:()=>cd(nh(e)),select:t=>cd(t===void 0?Ds(e):Ds(t,e))})}function nh(e){return Cn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(zn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:vn(e,t,r),selections:n}},getSelectionKeys:()=>zn(e),matcherType:"optional"})})}const pT=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},hT=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function xt(...e){return Cn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>vn(i,t,r)),selections:n}},getSelectionKeys:()=>Os(e,zn),matcherType:"and"})})}function Sb(...e){return Cn({[Rn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return Os(e,zn).forEach(i=>r(i,void 0)),{matched:e.some(i=>vn(i,t,r)),selections:n}},getSelectionKeys:()=>Os(e,zn),matcherType:"or"})})}function Ye(e){return{[Rn]:()=>({match:t=>({matched:!!e(t)})})}}function Ds(...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 Cn({[Rn]:()=>({match:r=>{let i={[t??$c]:r};return{matched:n===void 0||vn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??$c].concat(n===void 0?[]:zn(n))})})}function wr(e){return typeof e=="number"}function Xi(e){return typeof e=="string"}function ai(e){return typeof e=="bigint"}const wb=Cn(Ye(function(e){return!0})),vT=wb,Ji=e=>Object.assign(Cn(e),{startsWith:t=>{return Ji(xt(e,(n=t,Ye(r=>Xi(r)&&r.startsWith(n)))));var n},endsWith:t=>{return Ji(xt(e,(n=t,Ye(r=>Xi(r)&&r.endsWith(n)))));var n},minLength:t=>Ji(xt(e,(n=>Ye(r=>Xi(r)&&r.length>=n))(t))),maxLength:t=>Ji(xt(e,(n=>Ye(r=>Xi(r)&&r.length<=n))(t))),includes:t=>{return Ji(xt(e,(n=t,Ye(r=>Xi(r)&&r.includes(n)))));var n},regex:t=>{return Ji(xt(e,(n=t,Ye(r=>Xi(r)&&!!r.match(n)))));var n}}),mT=Ji(Ye(Xi)),Cr=e=>Object.assign(Cn(e),{between:(t,n)=>Cr(xt(e,((r,i)=>Ye(o=>wr(o)&&r<=o&&i>=o))(t,n))),lt:t=>Cr(xt(e,(n=>Ye(r=>wr(r)&&r<n))(t))),gt:t=>Cr(xt(e,(n=>Ye(r=>wr(r)&&r>n))(t))),lte:t=>Cr(xt(e,(n=>Ye(r=>wr(r)&&r<=n))(t))),gte:t=>Cr(xt(e,(n=>Ye(r=>wr(r)&&r>=n))(t))),int:()=>Cr(xt(e,Ye(t=>wr(t)&&Number.isInteger(t)))),finite:()=>Cr(xt(e,Ye(t=>wr(t)&&Number.isFinite(t)))),positive:()=>Cr(xt(e,Ye(t=>wr(t)&&t>0))),negative:()=>Cr(xt(e,Ye(t=>wr(t)&&t<0)))}),yT=Cr(Ye(wr)),si=e=>Object.assign(Cn(e),{between:(t,n)=>si(xt(e,((r,i)=>Ye(o=>ai(o)&&r<=o&&i>=o))(t,n))),lt:t=>si(xt(e,(n=>Ye(r=>ai(r)&&r<n))(t))),gt:t=>si(xt(e,(n=>Ye(r=>ai(r)&&r>n))(t))),lte:t=>si(xt(e,(n=>Ye(r=>ai(r)&&r<=n))(t))),gte:t=>si(xt(e,(n=>Ye(r=>ai(r)&&r>=n))(t))),positive:()=>si(xt(e,Ye(t=>ai(t)&&t>0))),negative:()=>si(xt(e,Ye(t=>ai(t)&&t<0)))}),gT=si(Ye(ai)),bT=Cn(Ye(function(e){return typeof e=="boolean"})),ST=Cn(Ye(function(e){return typeof e=="symbol"})),wT=Cn(Ye(function(e){return e==null}));var wt={__proto__:null,matcher:Rn,optional:nh,array:function(...e){return cd({[Rn]:()=>({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 zn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>vn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:zn(e[0])})})},set:function(...e){return Cn({[Rn]:()=>({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:pT(t,o=>vn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:zn(e[0])})})},map:function(...e){return Cn({[Rn]:()=>({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:hT(t,(s,u)=>{const c=vn(o,u,r),l=vn(a,s,r);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...zn(e[0]),...zn(e[1])]})})},intersection:xt,union:Sb,not:function(e){return Cn({[Rn]:()=>({match:t=>({matched:!vn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Ye,select:Ds,any:wb,_:vT,string:mT,number:yT,bigint:gT,boolean:bT,symbol:ST,nullish:wT,instanceOf:function(e){return Cn(Ye(function(t){return n=>n instanceof t}(e)))},shape:function(e){return Cn(Ye(dT(e)))}};const ld={matched:!1,value:void 0};function ue(e){return new CT(e,ld)}let CT=class fd{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=(c,l)=>{o=!0,a[c]=l},u=!r.some(c=>vn(c,this.input,s))||i&&!i(this.input)?ld:{matched:!0,value:n(o?$c in a?a[$c]:a:this.input,this.input)};return new fd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new fd(this.input,r?{matched:!0,value:n(this.input,this.input)}:ld)}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 xT=Object.getOwnPropertyNames,ET=Object.getOwnPropertySymbols,TT=Object.prototype.hasOwnProperty;function Vv(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function xu(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 Uv(e){return xT(e).concat(ET(e))}var Cb=Object.hasOwn||function(e,t){return TT.call(e,t)};function Da(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var xb="_owner",Gv=Object.getOwnPropertyDescriptor,zv=Object.keys;function IT(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 AT(e,t){return Da(e.getTime(),t.getTime())}function Wv(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(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],E=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,E,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function $T(e,t,n){var r=zv(e),i=r.length;if(zv(t).length!==i)return!1;for(var o;i-- >0;)if(o=r[i],o===xb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Cb(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function Ka(e,t,n){var r=Uv(e),i=r.length;if(Uv(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=r[i],o===xb&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!Cb(t,o)||!n.equals(e[o],t[o],o,o,e,t,n)||(a=Gv(e,o),s=Gv(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function OT(e,t){return Da(e.valueOf(),t.valueOf())}function DT(e,t){return e.source===t.source&&e.flags===t.flags}function Hv(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,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function NT(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 PT="[object Arguments]",RT="[object Boolean]",kT="[object Date]",MT="[object Map]",jT="[object Number]",_T="[object Object]",qT="[object RegExp]",FT="[object Set]",LT="[object String]",BT=Array.isArray,Kv=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Yv=Object.assign,VT=Object.prototype.toString.call.bind(Object.prototype.toString);function UT(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(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(BT(l))return t(l,f,d);if(Kv!=null&&Kv(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=VT(l);return h===kT?n(l,f,d):h===qT?a(l,f,d):h===MT?r(l,f,d):h===FT?s(l,f,d):h===_T?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===PT?i(l,f,d):h===RT||h===jT||h===LT?o(l,f,d):!1}}function GT(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?Ka:IT,areDatesEqual:AT,areMapsEqual:r?Vv(Wv,Ka):Wv,areObjectsEqual:r?Ka:$T,arePrimitiveWrappersEqual:OT,areRegExpsEqual:DT,areSetsEqual:r?Vv(Hv,Ka):Hv,areTypedArraysEqual:r?Ka:NT};if(n&&(i=Yv({},i,n(i))),t){var o=xu(i.areArraysEqual),a=xu(i.areMapsEqual),s=xu(i.areObjectsEqual),u=xu(i.areSetsEqual);i=Yv({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function zT(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function WT(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{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,c){return n(u,c,a)}}var HT=_i();_i({strict:!0});_i({circular:!0});_i({circular:!0,strict:!0});_i({createInternalComparator:function(){return Da}});_i({strict:!0,createInternalComparator:function(){return Da}});_i({circular:!0,createInternalComparator:function(){return Da}});_i({circular:!0,createInternalComparator:function(){return Da},strict:!0});function _i(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=GT(e),u=UT(s),c=r?r(u):zT(u);return WT({circular:n,comparator:u,createState:i,equals:c,strict:a})}function KT(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 YT(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),KT(e)}var ys=w,XT=fT(RE({concat:K1(W1).concat,empty:0}))();function JT(e){return function(t){return t.iterNumber>=e?me:Me(0)}}function QT(e,t){return function(n){return ys(n,t,ee(function(r){return Math.min(e,r)}))}}function ZT(e){return function(t){return Me(e*Math.pow(2,t.iterNumber))}}var eI={iterNumber:0,cumulativeDelay:0,previousDelay:me};function tI(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+at(function(){return 0})(n),previousDelay:n}}function nI(e,t){var n=tI(e,t);return ys(n.previousDelay,fb(function(){return Ec.of(n)},function(r){return $1(r)(Ec.of(n))}))}function _o(e,t,n){var r=function(i){return ys(i,t,Mv(function(o){return n(o)?ys(nI(e,i),Mv(function(a){return ys(a.previousDelay,fb(function(){return Ec.of(o)},function(){return r(a)}))})):Ec.of(o)}))};return r(eI)}var Xv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Eb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.isGuid=Tb=Ns.guid=void 0;var rI=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+=Jv()+"-";for(o+=r,o+=t;o.length<i;)o+=Jv();return o.substring(0,i)},Tb=Ns.guid=rI,Jv=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},iI=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=oI(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"};Ns.isGuid=iI;var oI=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function rh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function yl(e){return{equals(t,n){const r=w(Se(t),at(()=>[])),i=w(Se(n),at(()=>[]));return ji(e).equals(r,i)}}}const Do=yn({localId:lt,componentPath:yl(lt),sharedConfigurationModelId:rh(lt)}),ih=yn({localId:lt,configurationModelId:lt}),Ib=On((e,t)=>ue({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>aI.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>sI.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>uI.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>cI.equals(n.x,n.y)).otherwise(()=>!1)),aI=yn({type:lt,attributeId:Do,state:lt,choiceValueId:lt}),sI=yn({type:lt,attributeId:Do,state:lt}),uI=yn({type:lt,attributeId:Do,state:ml}),cI=yn({type:lt,attributeId:Do,state:th});var wn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(wn||{}),Ut=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Ut||{}),la=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(la||{}),on=(e=>(e.all="all",e.none="none",e.specific="specific",e))(on||{}),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||{}),Wr=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Wr||{}),Ti=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Ti||{}),$r=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))($r||{}),Ar=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Ar||{}),Ii=(e=>(e.Always="Always",e.Optional="Optional",e))(Ii||{});const lI=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:on,AttributeType:Oe,ChoiceValueDecisionState:Wr,ComponentDecisionState:Ti,ConfigurationModelSourceType:zr,ConstraintType:la,DecisionKind:$r,ExplainQuestionSubject:Ut,ExplainQuestionType:wn,Inclusion:Ii,Selection:Ar,eqCausedByDecision:Ib,eqGlobalAttributeId:Do,eqGlobalConstraintId:ih},Symbol.toStringTag,{value:"Module"}));var Bt=(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))(Bt||{}),gl=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(gl||{});const Ab={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}},fI=Object.freeze(Object.defineProperty({__proto__:null,ConfigurationConflictReason:gl,FailureResultFactory:Ab,FailureType:Bt},Symbol.toStringTag,{value:"Module"}));let $b=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,Se,ee(Yn(z(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),kt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:w([...t.decisions],tc(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return w(Se(t),kt)}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:on.all},()=>({type:"AllowedRulesAll"})).with({type:on.none},()=>({type:"AllowedRulesNone"})).with({type:on.specific},n=>({type:"AllowedRulesSpecific",rules:w(n.rules,z(this.mapToGlobalConstraintId),ad)})).with(wt.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function dI(e){return t=>JE(n=>n!=null,e)(t)}function pI(){return Oa(qr())}var Un=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Un||{}),ao=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(ao||{}),dn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(dn||{}),so=(e=>(e.all="all",e.none="none",e.specific="specific",e))(so||{});const bn=yn({localId:lt,componentPath:yl(lt),sharedConfigurationModel:rh(lt)}),hI=Oo(ji(yn({attributeId:bn,decisions:yl(bn)}))),vI=Oo(On((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})=>ji(ih).equals(n.rules,r.rules)).otherwise(()=>!1))),mI=Oo(yn({rules:vI})),yI=yn({configurationModelSource:On((e,t)=>HT(e,t)),decisionsToRespect:hI,usageRuleParameters:gb(lt),allowedInExplain:mI});var Ps=(e=>(e.Channel="Channel",e.Package="Package",e))(Ps||{}),ut=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ut||{}),Ee=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Ee||{}),Xt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Xt||{}),Nt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Nt||{}),po=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(po||{}),ho=(e=>(e.Always="Always",e.Optional="Optional",e))(ho||{});const gI={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Oo(lt).equals(e.state,t.state)},bI={equals(e,t){return Oo(ml).equals(e.value,t.value)}},SI={equals(e,t){return Oo(th).equals(e.value,t.value)}},wI={equals(e,t){return Oo(lt).equals(e.state,t.state)}},CI={equals(e,t){return bn.equals(e.attributeId,t.attributeId)?ue({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>SI.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>bI.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>wI.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>gI.equals(r.x,r.y)).otherwise(()=>!1):!1}},xI=ji(CI),EI={equals:(e,t)=>xI.equals(e.decisions,t.decisions)&&TI.equals(e.mode,t.mode)},TI={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 dd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(dd||{}),fa=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(fa||{}),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 II(e,t){console.log(`--------------------------------------------------------------------------------
|
|
2
2
|
-- ${t??""}
|
|
3
3
|
--------------------------------------------------------------------------------
|
|
4
|
-
${JSON.stringify(e,null,2)}`)}var bs=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(bs||{}),Ob=(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))(Ob||{});const $I=e=>Object.values(Ob).includes(e),OI=e=>$I(e)?Me(e):me;function DI(e){const t=n=>ue(n).with("ConfigurationModelNotFound",()=>({type:Ce.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:Ce.DecisionsToRespectInvalid})).with(Ct.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:Ce.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:Ce.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:Ce.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:Ce.ConfigurationConflict,reason:oh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:Ce.ConfigurationConflict})).with(Ct.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:Ce.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:Ce.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:Ce.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:Ce.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:Ce.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return S(e.type,OI,ee(t))}const NI=e=>Object.values(bs).includes(e),PI=e=>NI(e)?Me(e):me;function RI(e){return S(e,PI,ee(n=>ue(n).with("Generic::LocalClientError",()=>({type:Ce.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:Ce.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:Ce.CommunicationError})).with("Generic::Unauthorized",()=>({type:Ce.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:Ce.Unknown})).exhaustive()))}function Fr(e,t){AI(e,t);const n=e.type;return S(me,Fv(()=>DI(e)),Fv(()=>RI(n)),at(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:Ce.Unknown})))}let Db=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 S(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),hr(r=>Fr(r,"ClientSideSessionLifetimeHandler - create")),dr(r=>this.restToDomainMapper.mapToSessionId(r)),dI(()=>({type:Ce.ConfigurationUnauthenticated})))}close(t){return S(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),hr(n=>Fr(n,"ClientSideSessionLifetimeHandler - close")),Kt(()=>qr()))}};var Nb=(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))(Nb||{});function Mr(e,t,n){const r=S(Array.isArray(e)?e:[e],YT);return S(Lv(()=>fetch(r,t),i=>({type:"error"})),dr(i=>S(Lv(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),db(i=>i.status===401?Ur({type:bs.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Na({response:i,data:{}}):i.type==="error"?Ur({type:bs.LowLevelCommunicationError}):Ur({type:bs.UnhandledResponseStatus})),dr(i=>S(n(i),eh(()=>i.data))))}function pd(e,t){return Mr(e,t,n=>{if(n.response.status===200)return gi(n.data);if(n.response.status===409){const r=n.data;return ue(r).with({type:"ConfigurationModelInvalid"},i=>gi(r)).with({type:"ConfigurationModelNotFeasible"},i=>gi(r)).otherwise(()=>me)}return me})}let kI=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 pd([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 pd([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 Mr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?Me(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 Mr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?Me(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 Mr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?Me(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 Mr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?Me(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 Mr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?Me(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 Mr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?Me(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 Mr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?Me({}):me)}};var vo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(vo||{}),hd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(hd||{}),vd=(e=>(e.Always="Always",e.Optional="Optional",e))(vd||{}),ks=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(ks||{}),Gr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Gr||{}),_n=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(_n||{}),md=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(md||{}),yd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(yd||{}),os=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(os||{});const Mn=yn({localId:lt,componentPath:yl(lt),sharedConfigurationModelId:rh(lt)});let Pb=class{mapToDecisions(t){return{}}mapToSessionId(t){return ue(t).with({sessionId:Ct.string},n=>Na(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=S(n.constraintExplanations,z(i=>this.mapToConstraintExplanation(i)));return Ur({type:Ce.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>Ur({type:Ce.ConfigurationModelInvalid})).otherwise(()=>Ur({type:Ce.Unknown}))}mapToExplainAnswer(t,n){const r=ue(n).with({question:Un.whyIsStateNotPossible,subject:dn.boolean},a=>[{type:Ee.Boolean,attributeId:a.attributeId,value:Me(a.state)}]).with({question:Un.whyIsStateNotPossible,subject:dn.numeric},a=>[{type:Ee.Numeric,attributeId:a.attributeId,value:Me(a.state)}]).with({question:Un.whyIsStateNotPossible,subject:dn.component},a=>[{type:Ee.Component,attributeId:a.attributeId,state:Me(a.state)}]).with({question:Un.whyIsStateNotPossible,subject:dn.choiceValue},a=>[{type:Ee.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:Me(a.state)}]).otherwise(()=>[]),i=S(t.decisionExplanations,z(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=S(t.constraintExplanations,z(a=>this.mapToConstraintExplanation(a)));return ue(n).with({answerType:ao.decisions},()=>({decisionExplanations:i})).with({answerType:ao.constraints},()=>({constraintExplanations:o})).with({answerType:ao.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:Ce.ConfigurationSetManyConflict,decisionExplanations:S(t.decisionExplanations,z(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:S(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:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Se(t.state)}}mapToNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Se(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 S(this.mapToDecisionState(t.state),ee(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:S(t.causedByRules,z(n=>this.mapToRuleConstraint(n))),causedByCardinalities:S(t.causedByCardinalities,z(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:da.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:da.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=S(t.booleanDecisions??[],z(a=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Se(a.state)}))),r=S(t.numericDecisions??[],z(a=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Se(a.state)}))),i=S(t.componentDecisions??[],z(a=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:S(Se(a.state),ee(s=>this.mapToDecisionState(s)),sd)}))),o=S(t.choiceDecisions??[],z(a=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:S(Se(a.state),ee(s=>this.mapToDecisionState(s)),sd)})));return S([],Ne(n),Ne(r),Ne(i),Ne(o))}mapToDecisionExplanation(t,n,r){const i=S(t.causedByBooleanDecisions,z(h=>this.mapToCausedByBooleanDecision(h))),o=S(t.causedByNumericDecisions,z(h=>this.mapToCausedByNumericDecision(h))),a=S(t.causedByComponentDecisions,z(h=>this.mapToCausedByComponentDecision(h))),s=S(t.causedByChoiceDecisions,z(h=>this.mapToCausedByChoiceValueDecision(h))),u=S(i,z(h=>({type:Ee.Boolean,attributeId:h.attributeId,value:me}))),c=S(o,z(h=>({type:Ee.Numeric,attributeId:h.attributeId,value:me}))),l=S(a,z(h=>({type:Ee.Component,attributeId:h.attributeId,state:me}))),f=S(s,z(h=>({type:Ee.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:me}))),d=S([],Ne(u),Ne(c),Ne(l),Ne(f)),p=ob(On((h,v)=>{const E=bn.equals(h.attributeId,v.attributeId);return ue({a:h,b:v}).with({a:{type:Ee.ChoiceValue},b:{type:Ee.ChoiceValue}},x=>E&&x.a.choiceValueId===x.b.choiceValueId).otherwise(()=>E)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:S([],Ne(d),Ne(p)),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(md.NotAvailable,()=>dd.NotAvailable).with(md.StateNotPossible,()=>dd.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 S(n.canAttributeContributeToConfigurationSatisfaction,ln(p=>Mn.equals(p,d)),is)}const i=S([],Ne(S(t.choiceValueDecisions,z(d=>d.attributeId))),Ne(S(n.choiceConsequences,z(d=>d.attributeId))),ia(Mn)),o=S(i,z(d=>{const p=S(t.choiceValueDecisions??[],wE(v=>Mn.equals(v.attributeId,d))),h=S(n.choiceConsequences??[],Wi(v=>Mn.equals(v.attributeId,d)));return S(h,ee(v=>this.mapToChoiceAttributes(v,p,r(d))))}),Hn),a=S([],Ne(S(t.numericDecisions,z(d=>d.attributeId))),Ne(S(n.numericConsequences,z(d=>d.attributeId))),ia(Mn)),s=S(a,z(d=>{const p=S(t.numericDecisions??[],Wi(v=>Mn.equals(v.attributeId,d))),h=S(n.numericConsequences??[],Wi(v=>Mn.equals(v.attributeId,d)));return S(h,ee(v=>this.mapToNumericAttribute(v,p,r(d))))}),Hn),u=S([],Ne(S(t.booleanDecisions,z(d=>d.attributeId))),Ne(S(n.booleanConsequences,z(d=>d.attributeId))),ia(Mn)),c=S(u,z(d=>{const p=S(t.booleanDecisions??[],Wi(v=>Mn.equals(v.attributeId,d))),h=S(n.booleanConsequences??[],Wi(v=>Mn.equals(v.attributeId,d)));return S(h,ee(v=>this.mapToBooleanAttribute(v,p,r(d))))}),Hn),l=S([],Ne(S(t.componentDecisions,z(d=>d.attributeId))),Ne(S(n.componentConsequences,z(d=>d.attributeId))),ia(Mn)),f=S(l,z(d=>{const p=S(t.componentDecisions??[],Wi(v=>Mn.equals(v.attributeId,d))),h=S(n.componentConsequences??[],Wi(v=>Mn.equals(v.attributeId,d)));return S(h,ee(v=>this.mapToComponentAttribute(v,p,r(d))))}),Hn);return S([],Ne(o),Ne(f),Ne(s),Ne(c))}mapToComponentAttribute(t,n,r){return{type:ut.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:S(t.possibleDecisionStates,tc(i=>this.mapToPossibleDecisionState(i))),decision:S(n,rr(i=>S(this.mapToDecisionState(i.state),ee(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:S(t.selection,Se,ee(i=>this.mapToSelection(i)),kt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=S(t.values,tc(o=>{const a=S(n,ln(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ut.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ut.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:S(n,rr(i=>S(i.state,Se,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ut.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:S(n,rr(i=>S(i.state,Se,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=S(t.possibleDecisionStates,tc(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:S(n,rr(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return ue(t).with(ks.Implicit,()=>Nt.Implicit).with(ks.Explicit,()=>Nt.Explicit).exhaustive()}mapToDecisionState(t){return ue(t).with(Gr.Included,()=>Me(Xt.Included)).with(Gr.Excluded,()=>Me(Xt.Excluded)).with(Gr.Undefined,()=>me).exhaustive()}mapToPossibleDecisionState(t){return ue(t).with(vo.Included,()=>Xt.Included).with(vo.Excluded,()=>Xt.Excluded).exhaustive()}mapToSelection(t){return ue(t).with(hd.Mandatory,()=>po.Mandatory).with(hd.Optional,()=>po.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(vd.Always,()=>ho.Always).with(vd.Optional,()=>ho.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Rb=class{constructor(t,n){this.restToDomainMapper=new Pb,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=pd(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return S(r,hr(i=>Fr(i,"ServerSideSessionLifetimeHandler - create")),dr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return S(Mr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Nb.NoContent?Me({}):me),hr(n=>Fr(n,"ServerSideSessionLifetimeHandler - close")),Kt(qr))}};const ah={whyIsNotSatisfied:{configuration:{question:Cn.whyIsNotSatisfied,subject:Ut.configuration},attribute:e=>({question:Cn.whyIsNotSatisfied,subject:Ut.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:Cn.whyIsStateNotPossible,subject:Ut.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:Cn.whyIsStateNotPossible,subject:Ut.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:Cn.whyIsStateNotPossible,subject:Ut.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:Cn.whyIsStateNotPossible,subject:Ut.component,attributeId:e,state:t})})}},MI=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:ah},Symbol.toStringTag,{value:"Module"}));let jI=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=me}setOnConfigurationChangedHandler(t){const n=S(t,Se,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 S(this.inner.setSessionContext(n),Kt(qr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await S(this.inner.restoreConfiguration(n),Kt(qr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await S(this.inner.makeDecision(n),Kt(qr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await S(this.inner.setMany(r,i),Kt(qr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await S(this.inner.applySolution(n),Kt(qr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(ah):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await S(this.inner.explain(i),Kt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await S(this.inner.close(),hr(t=>this.domainToContractMapper.mapToFailureResult(t)),Ic(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Yn(hr(t=>this.domainToContractMapper.mapToFailureResult(t)),Ic(t=>Promise.reject(t),t=>Promise.resolve(t)))}},_I=class{mapToExplainQuestion(t,n){const r={answerType:ue(n).with("decisions",()=>ao.decisions).with("constraints",()=>ao.constraints).with("full",()=>ao.all).exhaustive()};return ue(t).with({question:Cn.whyIsNotSatisfied,subject:Ut.configuration},i=>({...r,question:Un.whyIsNotSatisfied,subject:dn.configuration})).with({question:Cn.whyIsNotSatisfied,subject:Ut.attribute},i=>({...r,question:Un.whyIsNotSatisfied,subject:dn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:Cn.whyIsStateNotPossible,subject:Ut.choiceValue},i=>({...r,question:Un.whyIsStateNotPossible,subject:dn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:Cn.whyIsStateNotPossible,subject:Ut.component},i=>({...r,question:Un.whyIsStateNotPossible,subject:dn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:Cn.whyIsStateNotPossible,subject:Ut.numeric},i=>({...r,question:Un.whyIsStateNotPossible,subject:dn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:Cn.whyIsStateNotPossible,subject:Ut.boolean},i=>({...r,question:Un.whyIsStateNotPossible,subject:dn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:S(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return S(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 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:Se(n.state)})).with({type:Oe.Boolean},n=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Se(n.state)})).with({type:Oe.Component},n=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:S(Se(n.state),rr(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return S(Se(t),ee(n=>S(n,z(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:S(r.decisions,z(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:Hr.Package},n=>({type:Rs.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Hr.Channel},n=>({type:Rs.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:S(t.decisions,z(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return ue(t).with({type:Oe.Boolean},n=>({type:ut.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:S(n.decision,Se,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Numeric},n=>({type:ut.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:S(n.decision,Se,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Choice},n=>({type:ut.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:S(n.values,z(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Component},n=>({type:ut.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:S(n.decision,Se,rr(r=>S(this.mapToDecisionStateOption(r.state),ee(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:S(n.possibleDecisionStates,z(r=>this.mapToDecisionStateOption(r)),Hn),selection:S(n.selection,Se,ee(r=>this.mapToSelection(r)),kt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:S(t.possibleDecisionStates,z(n=>this.mapToDecisionStateOption(n)),Hn)}}mapToChoiceValueDecision(t){return S(t.decision,Se,rr(n=>S(this.mapToDecisionStateOption(n.state),ee(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return ue(t).with($r.Implicit,()=>Nt.Implicit).with($r.Explicit,()=>Nt.Explicit).exhaustive()}mapToSelection(t){return ue(t).with(Ar.Mandatory,()=>po.Mandatory).with(Ar.Optional,()=>po.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(Ii.Always,()=>ho.Always).with(Ii.Optional,()=>ho.Optional).exhaustive()}mapToDecisionState(t){return ue(t).with(Ct.union(Kr.Included,Ti.Included),()=>Xt.Included).with(Ct.union(Kr.Excluded,Ti.Excluded),()=>Xt.Excluded).exhaustive()}mapToDecisionStateOption(t){return S(Se(t),ee(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return S(t,Se,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return S(t,Se,ee(n=>ue(n).returnType().with({type:on.all},()=>({type:so.all})).with({type:on.none},()=>({type:so.none})).with({type:on.specific},r=>({type:so.specific,rules:S(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()))}},kb=class{mapToExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},i=>S(i.decisionExplanations,z(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=ue(t).with({constraintExplanations:Ct.array(Ct.any)},i=>S(i.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:S(t.causedByCardinalities,z(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:S(t.causedByRules,z(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=S(t.causedByChoiceDecisions,z(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=S(t.causedByComponentDecisions,z(a=>this.mapToCausedByComponentAttributeDecision(a))),i=S(t.causedByNumericDecisions,z(a=>this.mapToCausedByNumericAttributeDecision(a))),o=S(t.causedByBooleanDecisions,z(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:S([],Ne(n),Ne(r),Ne(i),Ne(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:S(t.decisions,z(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:Ce.ConfigurationConflict},n=>({type:Bt.ConfigurationConflict,reason:ue(n.reason).with(oh.NumericDecisionOutOfRange,()=>gl.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:Ce.ConfigurationApplicationError},()=>({type:Bt.ConfigurationApplicationError})).with({type:Ce.ConfigurationUnauthenticated},()=>({type:Bt.ConfigurationUnauthenticated})).with({type:Ce.ConfigurationModelNotFound},()=>({type:Bt.ConfigurationModelNotFound})).with({type:Ce.ConfigurationTimeout},()=>({type:Bt.ConfigurationTimeout})).with({type:Ce.ConfigurationAttributeNotFound},()=>({type:Bt.ConfigurationAttributeNotFound})).with({type:Ce.ConfigurationChoiceValueNotFound},()=>({type:Bt.ConfigurationChoiceValueNotFound})).with({type:Ce.ConfigurationSolutionNotAvailable},()=>({type:Bt.ConfigurationSolutionNotAvailable})).with({type:Ce.ConfigurationRejectedDecisionsConflict},n=>{const r=S(n.rejectedDecisions,z(i=>this.mapToExplicitDecision(i)));return Ab.createConfigurationRejectedDecisionsConflict(r)}).with({type:Ce.DecisionsToRespectInvalid},()=>({type:Bt.DecisionsToRespectInvalid})).with({type:Ce.ServiceError},()=>({type:Bt.ServiceError})).with({type:Ce.CommunicationError},()=>({type:Bt.CommunicationError})).with({type:Ce.Unknown},()=>({type:Bt.Unknown})).with({type:Ce.ConfigurationModelInvalid},()=>({type:Bt.ConfigurationModelInvalid})).with({type:Ce.ConfigurationInitializationFailure},()=>({type:Bt.ConfigurationInitializationFailure})).with({type:Ce.ConfigurationModelNotFeasible},n=>({type:Bt.ConfigurationModelNotFeasible,constraintExplanations:S(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:Ce.ConfigurationSetManyConflict},n=>({type:Bt.ConfigurationSetManyConflict,decisionExplanations:S(n.decisionExplanations,z(r=>this.mapToDecisionExplanation(r))),constraintExplanations:S(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:Ce.SpecifiedDeploymentForbidden},n=>({type:Bt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:S(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return S(t,ee(Yn(z(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:S(n.decisions,z(r=>this.mapToGlobalAttributeId(r)))})))),nr)}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:Rs.Package},n=>({type:Hr.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Rs.Channel},n=>({type:Hr.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:S(n.state,ee(r=>this.mapToChoiceValueDecisionState(r)),kt),choiceValueId:n.choiceValueId})).with({type:Ee.Component},n=>({type:Oe.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:S(n.state,ee(r=>this.mapToComponentDecisionState(r)),kt)})).with({type:Ee.Numeric},n=>({type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:S(n.value,kt)})).with({type:Ee.Boolean},n=>({type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:S(n.value,kt)})).exhaustive()}mapToCardinality(t){return ue(t).with(da.Cardinality,()=>fa.Cardinality).with(da.Component,()=>fa.Component).with(da.Rule,()=>fa.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(po.Mandatory,()=>Ar.Mandatory).with(po.Optional,()=>Ar.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return ue(t).with({type:ut.Boolean},r=>({...n,type:Oe.Boolean,decision:S(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),nr),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ut.Numeric},r=>({...n,type:Oe.Numeric,decision:S(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),nr),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ut.Choice},r=>({...n,type:Oe.Choice,cardinality:r.cardinality,values:S(r.values,z(i=>{const o=S(i.decision,ee(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),nr);return{id:i.choiceValueId,possibleDecisionStates:S(i.possibleDecisionStates,z(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ut.Component},r=>({...n,type:Oe.Component,decision:S(r.decision,ee(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),nr),possibleDecisionStates:S(r.possibleDecisionStates,z(i=>this.mapToComponentDecisionState(i))),selection:S(r.selection,Se,ee(i=>this.mapToSelection(i)),kt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return ue(t).with(ho.Always,()=>Ii.Always).with(ho.Optional,()=>Ii.Optional).exhaustive()}mapToComponentDecisionState(t){return ue(t).with(Xt.Included,()=>Ti.Included).with(Xt.Excluded,()=>Ti.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return ue(t).with(Xt.Included,()=>Kr.Included).with(Xt.Excluded,()=>Kr.Excluded).exhaustive()}mapToDecisionKind(t){return ue(t).with(Nt.Explicit,()=>$r.Explicit).with(Nt.Implicit,()=>$r.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return S(t,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),nr)}mapToAllowedRulesInExplain(t){return S(t,ee(n=>ue(n).returnType().with({type:so.all},()=>({type:on.all})).with({type:so.none},()=>({type:on.none})).with({type:so.specific},r=>({type:on.specific,rules:S(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()),nr)}},Mb=class{constructor(t,n){this.contractToDomainMapper=new _I,this.domainToContractMapper=new kb,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await S(this.sessionHandler.recreate(n),Kt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new jI(i,this.contractToDomainMapper,this.domainToContractMapper)}),Ic(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 sh(e){return e.possibleDecisionStates.some(t=>t===Kr.Included)}function jb(e){return!sh(e)}const qI=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:sh,isBlocked:jb},Symbol.toStringTag,{value:"Module"}));function FI(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.lowerBound>0).with({type:Oe.Boolean},t=>t.selection===Ar.Mandatory).with({type:Oe.Numeric},t=>t.selection===Ar.Mandatory).with({type:Oe.Component},t=>t.inclusion===Ii.Optional&&t.selection===Ar.Mandatory).exhaustive()}function LI(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function BI(e){return S(e.values,zt(sh))}function VI(e){return S(e.values,zt(jb))}function _b(e,t){return S(e.values,$o(n=>S(n.decision,Se,Ht(r=>r.kind===t))))}function qb(e){return S(e.values,zt(t=>S(t.decision,Se,ee(n=>n.state===Kr.Included),at(()=>!1))))}const UI=qb;function Fb(e){return S(e.decision,Se,Ht(t=>t.kind===$r.Explicit),nr)}function Lb(e){return S(e.decision,Se,Ht(t=>t.kind===$r.Explicit),nr)}function GI(e,t){return e.possibleDecisionStates.some(n=>n===t)}function Bb(e){return S(e.decision,Se,nr)}function Vb(e){return Ub(e,Ti.Included)}function zI(e){return!Vb(e)}function Ub(e,t){return e.possibleDecisionStates.some(n=>n===t)}const WI=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:BI,getBlockedChoiceValues:VI,getBooleanDecision:Lb,getChoiceDecisions:_b,getComponentDecision:Bb,getIncludedChoiceValues:qb,getNumericDecision:Fb,getSelectedChoiceValues:UI,isBooleanValuePossible:GI,isComponentAllowed:Vb,isComponentBlocked:zI,isComponentStatePossible:Ub,isMandatory:FI,isMultiSelect:LI},Symbol.toStringTag,{value:"Module"})),Gb=e=>e.type===Oe.Boolean,zb=e=>e.type===Oe.Choice,Wb=e=>e.type===Oe.Numeric,Hb=e=>e.type===Oe.Component,HI=nu(lt),Qv=ji(lt);function Kb(e,t){const n=a=>HI.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return S(n,xE(t?a=>Qv.equals(S(a.componentPath??[],cE(r)),e.componentPath):a=>Qv.equals(a.componentPath??[],e.componentPath)))}function KI(e,t,n){const r=S(Kb({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:S(t.componentPath??[],sE(t.localId))},n),sb(i=>i.id));return S(e,zt(r))}function YI(e,t,n){const r=S(Kb({sharedConfigurationModelId:t,componentPath:[]},n),sb(i=>i.id));return S(e,zt(r))}function XI(e){return S(e,zt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function JI(e,t){return S(Yb(e),z(n=>_b(n,t)),Yp,$o(n=>Se(n)))}function QI(e,t){return S(Jb(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Fb(n)),$o(n=>Se(n)))}function ZI(e,t){return S(Qb(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Lb(n)),$o(n=>Se(n)))}function eA(e,t){return S(Xb(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Bb(n)),$o(n=>Se(n)))}function Yb(e){return S(e.attributes,zt(zb))}function Xb(e){return S(e.attributes,zt(Hb))}function Jb(e){return S(e.attributes,zt(Wb))}function Qb(e){return S(e.attributes,zt(Gb))}function tA(e,t){return S(ru(e,t),kt)}function nA(e,t){return S(Zb(e,t),kt)}function rA(e,t,n){return S(Zb(e,t),ee(r=>r.values),rr(Yn(ln(r=>r.id===n))),kt)}function iA(e,t){return S(ru(e,t),Ht(Wb),kt)}function oA(e,t){return S(ru(e,t),Ht(Gb),kt)}function aA(e,t){return S(ru(e,t),Ht(Hb),kt)}function ru(e,t){return S(e.attributes,ln(n=>Do.equals(n.id,t)))}function Zb(e,t){return S(ru(e,t),Ht(zb))}const No=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:KI,filterAttributesOfRoot:XI,filterAttributesOfShared:YI,getAttribute:tA,getBooleanAttribute:oA,getBooleanAttributes:Qb,getBooleanDecisions:ZI,getChoiceAttribute:nA,getChoiceAttributes:Yb,getChoiceDecisions:JI,getChoiceValue:rA,getComponentAttribute:aA,getComponentAttributes:Xb,getComponentDecisions:eA,getNumericAttribute:iA,getNumericAttributes:Jb,getNumericDecisions:QI},Symbol.toStringTag,{value:"Module"})),sA="https://spc.cloud.ceventis.de/api/engine",uA={hcaEngineBaseUrl:sA};function cA(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??uA.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function Xa(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const eS=e=>t=>n=>S(n,lE(r=>e.equals(r,t)),ee(r=>S(n,fE(r,i=>t))),sd,at(()=>S(n,Ne(pE(t))))),Eu=eS({equals:(e,t)=>bn.equals(e.attributeId,t.attributeId)}),lA=eS({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let fA=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,c,l,f,d;const p=S(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],z(this.restToDomainMapper.mapToGlobalAttributeId)),h=I=>Kp(bn)(I,p),v=S(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=S(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=S(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=S(((s=n.consequences)==null?void 0:s.componentConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=S(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),w=S(((c=n.consequences)==null?void 0:c.numericConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=S(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=S(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=S([],Ne(S(b,z(I=>I.attributeId))),Ne(S(T,z(I=>I.attributeId))),Ne(S(C,z(I=>I.attributeId))),Ne(S(w,z(I=>I.attributeId))),Ne(S(v,z(I=>I.attributeId))),Ne(S(E,z(I=>I.attributeId))),Ne(S(x,z(I=>I.attributeId))),Ne(S(m,z(I=>I.attributeId))),ia(bn)),D=S(A,od(t.attributes,(I,N)=>{const _=t.attributes.find(L=>bn.equals(L.attributeId,N));return ue(_).with({type:ut.Choice},(L,V)=>{const H=this.mergeChoice(V,S(E,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)),S(v,zt(R=>bn.equals(R.attributeId,N)),z(R=>R.payload)));return Eu(H)(I)}).with({type:ut.Numeric},(L,V)=>{const H=this.mergeNumeric(V,S(w,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)),S(C,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)));return Eu(H)(I)}).with({type:ut.Boolean},(L,V)=>{const H=this.mergeBoolean(V,S(T,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)),S(b,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)));return Eu(H)(I)}).with({type:ut.Component},(L,V)=>{const H=this.mergeComponent(V,S(m,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)),S(x,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)));return Eu(H)(I)}).exhaustive()}),z(I=>{const N=h(I.attributeId);return I.canContributeToConfigurationSatisfaction!=N?{...I,canContributeToConfigurationSatisfaction:N}:I}));return{...t,isSatisfied:S((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,Se,at(()=>t.isSatisfied)),attributes:D}}mergeChoice(t,n,r){const i=S(n,ee(u=>u.values??[]),at(()=>[])),o=S(r),a=S([],Ne(S(i,z(u=>u.choiceValueId))),Ne(S(o,z(u=>u.choiceValueId))),z(Xa),ia(lt)),s=S(a,od(t.values,(u,c)=>{const l=S(i,ln(h=>h.choiceValueId===c)),f=S(o,ln(h=>h.choiceValueId===c)),d=S(t.values.find(h=>h.choiceValueId===c),Se),p=this.mergeChoiceValue(c,d,l,f);return lA(p)(u)}));return{...t,isSatisfied:S(n,ee(u=>Xa(u.isSatisfied)),at(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=S(i,ee(s=>({state:this.toDecisionState(Xa(s.state)),kind:this.toDecisionKind(Xa(s.kind))})),at(()=>({state:S(n,rr(s=>S(s.decision,ee(u=>u.state)))),kind:S(n,rr(s=>S(s.decision,ee(u=>u.kind))),at(()=>Nt.Explicit))}))),a=S(r,ee(s=>S(qv(s.possibleDecisionStates??[]),z(u=>this.toPossibleDecisionState(u)),Hn)),at(()=>S(n,ee(s=>s.possibleDecisionStates??[]),at(()=>[]))));return{choiceValueId:t,decision:S(o.state,ee(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=S(r,ee(a=>{const s=this.toDecisionState(Xa(a.state));return S(s,ee(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),at(()=>S(t.decision,ee(a=>({state:a.state,kind:a.kind}))))),o=S(n,ee(a=>S(qv(a.possibleDecisionStates??[]),z(s=>this.toPossibleDecisionState(s)),Hn)),at(()=>t.possibleDecisionStates));return{...t,isSatisfied:S(n,ee(a=>a.isSatisfied),at(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:S(n,rr(i=>Se(i.isSatisfied)),at(()=>t.isSatisfied)),decision:S(r,Ei(()=>t.decision,i=>S(i.state,Se,ee(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:S(n,rr(i=>Se(i.isSatisfied)),at(()=>t.isSatisfied)),decision:S(r,Ei(()=>t.decision,i=>S(i.state,Se,ee(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:S(n,ee(i=>i.possibleDecisionStates),at(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return ue(t).with(vo.Included,()=>Me(Xt.Included)).with(vo.Excluded,()=>Me(Xt.Excluded)).otherwise(()=>me)}toDecisionState(t){return ue(t).with(Gr.Included,()=>Me(Xt.Included)).with(Gr.Excluded,()=>Me(Xt.Excluded)).otherwise(()=>me)}toDecisionKind(t){return ue(t).with(ks.Implicit,()=>Nt.Implicit).with(ks.Explicit,()=>Nt.Explicit).exhaustive()}},dA=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:_n.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ee.Component},n=>({type:_n.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ee.Numeric},n=>({type:_n.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:S(n.value,kt)})).with({type:Ee.Boolean},n=>({type:_n.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:S(n.value,kt)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=S([...t],oi(u=>u.type!==Ee.Boolean?me:Me({type:_n.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:S(u.value,kt)}))),o=S([...t],oi(u=>u.type!==Ee.Numeric?me:Me({type:_n.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:S(u.value,kt)}))),a=S([...t],oi(u=>u.type!==Ee.ChoiceValue?me:Me({type:_n.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=S([...t],oi(u=>u.type!==Ee.Component?me:Me({type:_n.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=S([...t],oi(a=>a.type!==ut.Boolean?me:S(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitBooleanDecision(a))))),r=S([...t],oi(a=>a.type!==ut.Numeric?me:S(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitNumericDecision(a))))),i=S([...t],oi(a=>a.type!==ut.Component?me:S(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitComponentDecision(a))))),o=S([...t],oi(a=>a.type!==ut.Choice?me:S(this.mapToExplicitChoiceDecisions(a),tu(s=>S(s,Da)))),SE);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:S(t.componentPath,Se,ee(ad),nr),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:_n.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:S(t.decision,ee(n=>n.state),kt)}}mapToExplicitNumericDecision(t){return{type:_n.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:S(t.decision,ee(n=>n.state),kt)}}mapToExplicitComponentDecision(t){return{type:_n.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(S(t.decision,ee(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return S(r.decision,ee(i=>i.kind===Nt.Explicit),at(()=>!1))}return S(t.values,zt(n),z(r=>({type:_n.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(S(r.decision,ee(i=>i.state)))})),ad)}mapToDecisionState(t){return S(t,ee(n=>ue(n).with(Xt.Included,()=>Gr.Included).with(Xt.Excluded,()=>Gr.Excluded).exhaustive()),at(()=>Gr.Undefined))}mapToPossibleDecisionState(t){return ue(t).with(Xt.Included,()=>vo.Included).with(Xt.Excluded,()=>vo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return ue(t).with({subject:dn.attribute},n=>({type:yd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:dn.configuration},()=>({type:yd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return ue(t).with({subject:dn.boolean},n=>({type:os.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:dn.numeric},n=>({type:os.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:dn.component},n=>({type:os.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:dn.choiceValue},n=>({type:os.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},pA=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return S(t.configuration.attributes,ln(n=>ue(n).with({type:ut.Boolean},r=>S(r.decision,Ht(i=>i.kind===Nt.Explicit),is)).with({type:ut.Numeric},r=>S(r.decision,Ht(i=>i.kind===Nt.Explicit),is)).with({type:ut.Choice},r=>S(r.values,ln(i=>S(i.decision,ee(o=>o.kind===Nt.Explicit),at(()=>!1))),is)).with({type:ut.Component},r=>S(r.decision,Ht(i=>i.kind===Nt.Explicit),is)).exhaustive()),Ei(()=>!1,()=>!0))},getExplicitDecisions(t){return S(t.configuration.attributes,z(n=>ue(n).with({type:ut.Boolean},r=>S(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Boolean,attributeId:r.attributeId,value:Se(i.state)})),ee(i=>[i]))).with({type:ut.Numeric},r=>S(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Numeric,attributeId:r.attributeId,value:Se(i.state)})),ee(i=>[i]))).with({type:ut.Choice},r=>S(r.values,z(i=>S(i.decision,Ht(o=>o.kind===Nt.Explicit),ee(o=>({type:Ee.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:Se(o.state)})))),Hn,gi)).with({type:ut.Component},r=>S(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Component,attributeId:r.attributeId,state:Se(i.state)})),ee(i=>[i]))).exhaustive()),Hn,Yp)}}}},hA=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 pA}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)=>S(this.engineApiClient.makeDecision(i,r),hr(Fr),Kt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=ue(t).with({question:Un.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Un.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return S(i,hr(Fr),Kt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return S(a,dr(s=>{var u,c,l,f;const d=S([],Ne(S(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],z(p=>this.restToDomainMapper.mapToBooleanDecision(p)))),Ne(S(((c=s.rejectedDecisions)==null?void 0:c.numericDecisions)??[],z(p=>this.restToDomainMapper.mapToNumericDecision(p)))),Ne(S(((l=s.rejectedDecisions)==null?void 0:l.componentDecisions)??[],z(p=>this.restToDomainMapper.mapToComponentDecision(p)))),Ne(S(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],z(p=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(p)))));return S(d,Da)?Ur(II.createConfigurationRejectedDecisionsConflict(d)):oa(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 S(i,Kt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return S(o,hr(Fr),dr(a=>{const s={rejectedDecisions:{booleanDecisions:Ct.array(Ct.any)}},u={decisionExplanations:Ct.array(Ct.any)};return ue(a).with(s,c=>Na(c)).with(u,c=>Ur(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,i,n))).otherwise(()=>Ur({type:Ce.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 S(oa(t),dr(r=>S(r.sessionId,Ei(()=>this.initializeInner(r,!1),()=>oa(r)))),dr(r=>S(r.sessionId,eh(()=>({type:Ce.ConfigurationUnauthenticated})),dr(i=>n(i,r)))))}initializeInner(t,n){return S(QE,()=>S(t.sessionId,uT,lT(s=>n?sT(s):S(this.sessionHandler.close(s),Ic(()=>me,()=>me)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return S(s,WE(()=>({type:Ce.ConfigurationUnauthenticated})),db(()=>this.sessionHandler.create(u)))},s=>S(s,ZE(u=>S(gi(t),Ht(this.interpreter.configurationSession.hasExplicitDecisions),ee(c=>this.replaceDecisions(u,c)),at(()=>oa({}))))),s=>S(s,dr(u=>{const c=this.determineConsequences(u),l=this.determineDecisions(u),f=E1(YE)({consequences:c,decisions:l});return S(f,Kt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Kt(d=>({sessionId:gi(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return S(this.engineApiClient.getDecisions(t),hr(Fr))}determineConsequences(t){return S(this.engineApiClient.getConsequence(t),hr(Fr))}},vA=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 S(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return S(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:me}}restoreConfiguration(t){return S(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return S(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return S(this.configurationSession.sessionId,ee(t=>this.sessionHandler.close(t)),ee(Yn(Kt(t=>{this.configurationSession={...this.configurationSession,sessionId:me}}))),at(ul(pI())))}applySolution(t){return S(this.configurationSession.solutions,ln(n=>EI.equals(n,t)),eh(()=>({type:Ce.ConfigurationSolutionNotAvailable})),Kt(n=>n.decisions),dr(n=>this.setMany(n,t.mode)))}setMany(t,n){return S(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Ac(r=>()=>{const i=ue(r).with({decisionExplanations:Ct.array(Ct.any)},o=>Me(o.decisionExplanations)).otherwise(()=>me);this.configurationSession={...this.configurationSession,solutions:S(i,ee(Yn(z(o=>o.solution))),at(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=ue(t).with({decisionExplanations:Ct.array(Ct.any)},r=>r.decisionExplanations).otherwise(()=>[]);return S(n,z(r=>r.solution))}invalidateAvailableSolutions(){return tT(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Ac(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return Os(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Yn(Os(t=>()=>{this.configurationSession=t,S(this.onConfigurationChangedHandler,rT(n=>()=>n(this.configurationSession.configuration)))}),Kt(t=>t.configuration),this.invalidateAvailableSolutions())}},mA=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=QT(r,XT.concat(ZT(i),JT(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return qo(this.policy,n,r=>S(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return qo(this.policy,n,r=>S(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return qo(this.policy,n,r=>S(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return qo(this.policy,n,r=>S(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return qo(this.policy,n,r=>S(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return qo(this.policy,r,i=>S(i,Yi(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:Ce.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:Ce.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}},yA=class{constructor(){this.queue=[],this.operating=me}push(t){const n=new gA(t);return this.queue.push(n),this.operating=S(this.operating,at(()=>this.start()),gi),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=S(t,z(r=>r.argument),od(me,(r,i)=>this.reduce(r,i)),ee(Yn(r=>this.execute(r),r=>r.then(i=>{S(t,z(o=>{o.resolve(i)}))}).catch(i=>{S(t,z(o=>{o.reject(i)}))}))),kt);n&&await n}this.operating=me}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},gA=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},bA=class extends yA{constructor(t){super(),this.inner=t}reduce(t,n){return Me(n)}async execute(t){return await this.inner.setSessionContext(t)()}},SA=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new bA(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(yI.equals(n,t))return Na(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)}},CA=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)),S(r(),Ac(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),Os(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)}},wA=class tS{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+Tb()}static new(t){return new tS(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 xA(e){e=cA(e);const t=new kI(e.hcaEngineBaseUrl),n=new Pb,r=new dA,i=new kb,o=new $b,a=new fA(n),s=ue(e.sessionHandler).with({create:Ct.any,close:Ct.any},l=>l).with({accessToken:Ct.string},l=>new Db(t,o,n,l)).with({sessionCreateUrl:Ct.string,sessionDeleteUrl:Ct.string},l=>new Rb(o,l)).exhaustive(),u=new hA(s,t,n,r,i,a),c=(l,f)=>S(new vA(l,f),d=>new mA(d),d=>new SA(d),wA.new,d=>new CA(d,!1));return new Mb(u,c)}const nS=Do.equals,rS=ih.equals,EA=Ib.equals,TA=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:on,AttributeInterpreter:WI,AttributeType:Oe,ChoiceValueDecisionState:Kr,ChoiceValueInterpreter:qI,ClientSideSessionLifetimeHandler:Db,ComponentDecisionState:Ti,ConfigurationConflictReason:gl,ConfigurationInterpreter:No,ConfigurationModelSourceType:Hr,ConfiguratorClient:Mb,ConstraintType:fa,ContractToRestMapper:$b,DecisionKind:$r,ExplainQuestionBuilderModule:MI,ExplainQuestionSubject:Ut,ExplainQuestionType:Cn,FailureType:Bt,Inclusion:Ii,Results:fI,Selection:Ar,ServerSideSessionLifetimeHandler:Rb,Types:lI,causedByDecisionEquals:EA,createClient:xA,explainQuestionBuilder:ah,globalAttributeIdEquals:nS,globalConstraintIdEquals:rS},Symbol.toStringTag,{value:"Module"}));/*! *****************************************************************************
|
|
4
|
+
${JSON.stringify(e,null,2)}`)}var gs=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(gs||{}),Ob=(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))(Ob||{});const AI=e=>Object.values(Ob).includes(e),$I=e=>AI(e)?Me(e):me;function OI(e){const t=n=>ue(n).with("ConfigurationModelNotFound",()=>({type:we.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:we.DecisionsToRespectInvalid})).with(wt.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(wt.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,$I,ee(t))}const DI=e=>Object.values(gs).includes(e),NI=e=>DI(e)?Me(e):me;function PI(e){return w(e,NI,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 Fr(e,t){II(e,t);const n=e.type;return w(me,Fv(()=>OI(e)),Fv(()=>PI(n)),at(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:we.Unknown})))}let Db=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),hr(r=>Fr(r,"ClientSideSessionLifetimeHandler - create")),dr(r=>this.restToDomainMapper.mapToSessionId(r)),dI(()=>({type:we.ConfigurationUnauthenticated})))}close(t){return w(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),hr(n=>Fr(n,"ClientSideSessionLifetimeHandler - close")),Kt(()=>qr()))}};var Nb=(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))(Nb||{});function Mr(e,t,n){const r=w(Array.isArray(e)?e:[e],YT);return w(Lv(()=>fetch(r,t),i=>({type:"error"})),dr(i=>w(Lv(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),db(i=>i.status===401?yi({type:gs.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?Oa({response:i,data:{}}):i.type==="error"?yi({type:gs.LowLevelCommunicationError}):yi({type:gs.UnhandledResponseStatus})),dr(i=>w(n(i),eh(()=>i.data))))}function pd(e,t){return Mr(e,t,n=>{if(n.response.status===200)return mi(n.data);if(n.response.status===409){const r=n.data;return ue(r).with({type:"ConfigurationModelInvalid"},i=>mi(r)).with({type:"ConfigurationModelNotFeasible"},i=>mi(r)).otherwise(()=>me)}return me})}let RI=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 pd([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 pd([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 Mr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?Me(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 Mr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?Me(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 Mr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?Me(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 Mr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?Me(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 Mr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?Me(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 Mr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?Me(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 Mr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?Me({}):me)}};var vo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(vo||{}),hd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(hd||{}),vd=(e=>(e.Always="Always",e.Optional="Optional",e))(vd||{}),Rs=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Rs||{}),Ur=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Ur||{}),_n=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(_n||{}),md=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(md||{}),yd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(yd||{}),is=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(is||{});const Mn=yn({localId:lt,componentPath:yl(lt),sharedConfigurationModelId:rh(lt)});let Pb=class{mapToDecisions(t){return{}}mapToSessionId(t){return ue(t).with({sessionId:wt.string},n=>Oa(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=w(n.constraintExplanations,z(i=>this.mapToConstraintExplanation(i)));return yi({type:we.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>yi({type:we.ConfigurationModelInvalid})).otherwise(()=>yi({type:we.Unknown}))}mapToExplainAnswer(t,n){const r=ue(n).with({question:Un.whyIsStateNotPossible,subject:dn.boolean},a=>[{type:Ee.Boolean,attributeId:a.attributeId,value:Me(a.state)}]).with({question:Un.whyIsStateNotPossible,subject:dn.numeric},a=>[{type:Ee.Numeric,attributeId:a.attributeId,value:Me(a.state)}]).with({question:Un.whyIsStateNotPossible,subject:dn.component},a=>[{type:Ee.Component,attributeId:a.attributeId,state:Me(a.state)}]).with({question:Un.whyIsStateNotPossible,subject:dn.choiceValue},a=>[{type:Ee.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:Me(a.state)}]).otherwise(()=>[]),i=w(t.decisionExplanations,z(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=w(t.constraintExplanations,z(a=>this.mapToConstraintExplanation(a)));return ue(n).with({answerType:ao.decisions},()=>({decisionExplanations:i})).with({answerType:ao.constraints},()=>({constraintExplanations:o})).with({answerType:ao.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:we.ConfigurationSetManyConflict,decisionExplanations:w(t.decisionExplanations,z(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:w(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:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Se(t.state)}}mapToNumericDecision(t){return{type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:Se(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,z(n=>this.mapToRuleConstraint(n))),causedByCardinalities:w(t.causedByCardinalities,z(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:fa.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:fa.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=w(t.booleanDecisions??[],z(a=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Se(a.state)}))),r=w(t.numericDecisions??[],z(a=>({type:Ee.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:Se(a.state)}))),i=w(t.componentDecisions??[],z(a=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:w(Se(a.state),ee(s=>this.mapToDecisionState(s)),sd)}))),o=w(t.choiceDecisions??[],z(a=>({type:Ee.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:w(Se(a.state),ee(s=>this.mapToDecisionState(s)),sd)})));return w([],Ne(n),Ne(r),Ne(i),Ne(o))}mapToDecisionExplanation(t,n,r){const i=w(t.causedByBooleanDecisions,z(h=>this.mapToCausedByBooleanDecision(h))),o=w(t.causedByNumericDecisions,z(h=>this.mapToCausedByNumericDecision(h))),a=w(t.causedByComponentDecisions,z(h=>this.mapToCausedByComponentDecision(h))),s=w(t.causedByChoiceDecisions,z(h=>this.mapToCausedByChoiceValueDecision(h))),u=w(i,z(h=>({type:Ee.Boolean,attributeId:h.attributeId,value:me}))),c=w(o,z(h=>({type:Ee.Numeric,attributeId:h.attributeId,value:me}))),l=w(a,z(h=>({type:Ee.Component,attributeId:h.attributeId,state:me}))),f=w(s,z(h=>({type:Ee.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:me}))),d=w([],Ne(u),Ne(c),Ne(l),Ne(f)),p=ob(On((h,v)=>{const E=bn.equals(h.attributeId,v.attributeId);return ue({a:h,b:v}).with({a:{type:Ee.ChoiceValue},b:{type:Ee.ChoiceValue}},x=>E&&x.a.choiceValueId===x.b.choiceValueId).otherwise(()=>E)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:w([],Ne(d),Ne(p)),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(md.NotAvailable,()=>dd.NotAvailable).with(md.StateNotPossible,()=>dd.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,ln(p=>Mn.equals(p,d)),rs)}const i=w([],Ne(w(t.choiceValueDecisions,z(d=>d.attributeId))),Ne(w(n.choiceConsequences,z(d=>d.attributeId))),ra(Mn)),o=w(i,z(d=>{const p=w(t.choiceValueDecisions??[],CE(v=>Mn.equals(v.attributeId,d))),h=w(n.choiceConsequences??[],Wi(v=>Mn.equals(v.attributeId,d)));return w(h,ee(v=>this.mapToChoiceAttributes(v,p,r(d))))}),Hn),a=w([],Ne(w(t.numericDecisions,z(d=>d.attributeId))),Ne(w(n.numericConsequences,z(d=>d.attributeId))),ra(Mn)),s=w(a,z(d=>{const p=w(t.numericDecisions??[],Wi(v=>Mn.equals(v.attributeId,d))),h=w(n.numericConsequences??[],Wi(v=>Mn.equals(v.attributeId,d)));return w(h,ee(v=>this.mapToNumericAttribute(v,p,r(d))))}),Hn),u=w([],Ne(w(t.booleanDecisions,z(d=>d.attributeId))),Ne(w(n.booleanConsequences,z(d=>d.attributeId))),ra(Mn)),c=w(u,z(d=>{const p=w(t.booleanDecisions??[],Wi(v=>Mn.equals(v.attributeId,d))),h=w(n.booleanConsequences??[],Wi(v=>Mn.equals(v.attributeId,d)));return w(h,ee(v=>this.mapToBooleanAttribute(v,p,r(d))))}),Hn),l=w([],Ne(w(t.componentDecisions,z(d=>d.attributeId))),Ne(w(n.componentConsequences,z(d=>d.attributeId))),ra(Mn)),f=w(l,z(d=>{const p=w(t.componentDecisions??[],Wi(v=>Mn.equals(v.attributeId,d))),h=w(n.componentConsequences??[],Wi(v=>Mn.equals(v.attributeId,d)));return w(h,ee(v=>this.mapToComponentAttribute(v,p,r(d))))}),Hn);return w([],Ne(o),Ne(f),Ne(s),Ne(c))}mapToComponentAttribute(t,n,r){return{type:ut.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:w(t.possibleDecisionStates,tc(i=>this.mapToPossibleDecisionState(i))),decision:w(n,rr(i=>w(this.mapToDecisionState(i.state),ee(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:w(t.selection,Se,ee(i=>this.mapToSelection(i)),kt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=w(t.values,tc(o=>{const a=w(n,ln(s=>s.choiceValueId==o.choiceValueId));return this.mapToChoiceValue(o,a)}));return{type:ut.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,cardinality:this.mapToCardinality(t.cardinality),values:i,canContributeToConfigurationSatisfaction:r}}mapToBooleanAttribute(t,n,r){return{type:ut.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,selection:this.mapToSelection(t.selection),possibleDecisionStates:t.possibleDecisionStates,decision:w(n,rr(i=>w(i.state,Se,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToNumericAttribute(t,n,r){return{type:ut.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,rr(i=>w(i.state,Se,ee(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=w(t.possibleDecisionStates,tc(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:w(n,rr(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return ue(t).with(Rs.Implicit,()=>Nt.Implicit).with(Rs.Explicit,()=>Nt.Explicit).exhaustive()}mapToDecisionState(t){return ue(t).with(Ur.Included,()=>Me(Xt.Included)).with(Ur.Excluded,()=>Me(Xt.Excluded)).with(Ur.Undefined,()=>me).exhaustive()}mapToPossibleDecisionState(t){return ue(t).with(vo.Included,()=>Xt.Included).with(vo.Excluded,()=>Xt.Excluded).exhaustive()}mapToSelection(t){return ue(t).with(hd.Mandatory,()=>po.Mandatory).with(hd.Optional,()=>po.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(vd.Always,()=>ho.Always).with(vd.Optional,()=>ho.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},Rb=class{constructor(t,n){this.restToDomainMapper=new Pb,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=pd(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return w(r,hr(i=>Fr(i,"ServerSideSessionLifetimeHandler - create")),dr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return w(Mr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===Nb.NoContent?Me({}):me),hr(n=>Fr(n,"ServerSideSessionLifetimeHandler - close")),Kt(qr))}};const ah={whyIsNotSatisfied:{configuration:{question:wn.whyIsNotSatisfied,subject:Ut.configuration},attribute:e=>({question:wn.whyIsNotSatisfied,subject:Ut.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:wn.whyIsStateNotPossible,subject:Ut.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:wn.whyIsStateNotPossible,subject:Ut.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:wn.whyIsStateNotPossible,subject:Ut.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:wn.whyIsStateNotPossible,subject:Ut.component,attributeId:e,state:t})})}},kI=Object.freeze(Object.defineProperty({__proto__:null,explainQuestionBuilder:ah},Symbol.toStringTag,{value:"Module"}));let MI=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=me}setOnConfigurationChangedHandler(t){const n=w(t,Se,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),Kt(qr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await w(this.inner.restoreConfiguration(n),Kt(qr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await w(this.inner.makeDecision(n),Kt(qr),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),Kt(qr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await w(this.inner.applySolution(n),Kt(qr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(ah):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await w(this.inner.explain(i),Kt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await w(this.inner.close(),hr(t=>this.domainToContractMapper.mapToFailureResult(t)),Ic(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Yn(hr(t=>this.domainToContractMapper.mapToFailureResult(t)),Ic(t=>Promise.reject(t),t=>Promise.resolve(t)))}},jI=class{mapToExplainQuestion(t,n){const r={answerType:ue(n).with("decisions",()=>ao.decisions).with("constraints",()=>ao.constraints).with("full",()=>ao.all).exhaustive()};return ue(t).with({question:wn.whyIsNotSatisfied,subject:Ut.configuration},i=>({...r,question:Un.whyIsNotSatisfied,subject:dn.configuration})).with({question:wn.whyIsNotSatisfied,subject:Ut.attribute},i=>({...r,question:Un.whyIsNotSatisfied,subject:dn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:wn.whyIsStateNotPossible,subject:Ut.choiceValue},i=>({...r,question:Un.whyIsStateNotPossible,subject:dn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:wn.whyIsStateNotPossible,subject:Ut.component},i=>({...r,question:Un.whyIsStateNotPossible,subject:dn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:wn.whyIsStateNotPossible,subject:Ut.numeric},i=>({...r,question:Un.whyIsStateNotPossible,subject:dn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:wn.whyIsStateNotPossible,subject:Ut.boolean},i=>({...r,question:Un.whyIsStateNotPossible,subject:dn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return w(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 ue(t).with({type:Oe.Choice,choiceValueId:wt.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:Se(n.state)})).with({type:Oe.Boolean},n=>({type:Ee.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:Se(n.state)})).with({type:Oe.Component},n=>({type:Ee.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(Se(n.state),rr(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return w(Se(t),ee(n=>w(n,z(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:w(r.decisions,z(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:Ps.Package,configurationModelPackage:n.configurationModelPackage})).with({type:zr.Channel},n=>({type:Ps.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:w(t.decisions,z(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return ue(t).with({type:Oe.Boolean},n=>({type:ut.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:w(n.decision,Se,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Numeric},n=>({type:ut.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,Se,ee(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Choice},n=>({type:ut.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:w(n.values,z(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:Oe.Component},n=>({type:ut.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:w(n.decision,Se,rr(r=>w(this.mapToDecisionStateOption(r.state),ee(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:w(n.possibleDecisionStates,z(r=>this.mapToDecisionStateOption(r)),Hn),selection:w(n.selection,Se,ee(r=>this.mapToSelection(r)),kt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:w(t.possibleDecisionStates,z(n=>this.mapToDecisionStateOption(n)),Hn)}}mapToChoiceValueDecision(t){return w(t.decision,Se,rr(n=>w(this.mapToDecisionStateOption(n.state),ee(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return ue(t).with($r.Implicit,()=>Nt.Implicit).with($r.Explicit,()=>Nt.Explicit).exhaustive()}mapToSelection(t){return ue(t).with(Ar.Mandatory,()=>po.Mandatory).with(Ar.Optional,()=>po.Optional).exhaustive()}mapToInclusion(t){return ue(t).with(Ii.Always,()=>ho.Always).with(Ii.Optional,()=>ho.Optional).exhaustive()}mapToDecisionState(t){return ue(t).with(wt.union(Wr.Included,Ti.Included),()=>Xt.Included).with(wt.union(Wr.Excluded,Ti.Excluded),()=>Xt.Excluded).exhaustive()}mapToDecisionStateOption(t){return w(Se(t),ee(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return w(t,Se,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return w(t,Se,ee(n=>ue(n).returnType().with({type:on.all},()=>({type:so.all})).with({type:on.none},()=>({type:so.none})).with({type:on.specific},r=>({type:so.specific,rules:w(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()))}},kb=class{mapToExplainAnswer(t){const n=ue(t).with({decisionExplanations:wt.array(wt.any)},i=>w(i.decisionExplanations,z(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=ue(t).with({constraintExplanations:wt.array(wt.any)},i=>w(i.constraintExplanations,z(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:w(t.causedByCardinalities,z(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:w(t.causedByRules,z(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=w(t.causedByChoiceDecisions,z(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=w(t.causedByComponentDecisions,z(a=>this.mapToCausedByComponentAttributeDecision(a))),i=w(t.causedByNumericDecisions,z(a=>this.mapToCausedByNumericAttributeDecision(a))),o=w(t.causedByBooleanDecisions,z(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:w([],Ne(n),Ne(r),Ne(i),Ne(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:w(t.decisions,z(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:Bt.ConfigurationConflict,reason:ue(n.reason).with(oh.NumericDecisionOutOfRange,()=>gl.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:we.ConfigurationApplicationError},()=>({type:Bt.ConfigurationApplicationError})).with({type:we.ConfigurationUnauthenticated},()=>({type:Bt.ConfigurationUnauthenticated})).with({type:we.ConfigurationModelNotFound},()=>({type:Bt.ConfigurationModelNotFound})).with({type:we.ConfigurationTimeout},()=>({type:Bt.ConfigurationTimeout})).with({type:we.ConfigurationAttributeNotFound},()=>({type:Bt.ConfigurationAttributeNotFound})).with({type:we.ConfigurationChoiceValueNotFound},()=>({type:Bt.ConfigurationChoiceValueNotFound})).with({type:we.ConfigurationSolutionNotAvailable},()=>({type:Bt.ConfigurationSolutionNotAvailable})).with({type:we.ConfigurationRejectedDecisionsConflict},n=>{const r=w(n.rejectedDecisions,z(i=>this.mapToExplicitDecision(i)));return Ab.createConfigurationRejectedDecisionsConflict(r)}).with({type:we.DecisionsToRespectInvalid},()=>({type:Bt.DecisionsToRespectInvalid})).with({type:we.ServiceError},()=>({type:Bt.ServiceError})).with({type:we.CommunicationError},()=>({type:Bt.CommunicationError})).with({type:we.Unknown},()=>({type:Bt.Unknown})).with({type:we.ConfigurationModelInvalid},()=>({type:Bt.ConfigurationModelInvalid})).with({type:we.ConfigurationInitializationFailure},()=>({type:Bt.ConfigurationInitializationFailure})).with({type:we.ConfigurationModelNotFeasible},n=>({type:Bt.ConfigurationModelNotFeasible,constraintExplanations:w(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:we.ConfigurationSetManyConflict},n=>({type:Bt.ConfigurationSetManyConflict,decisionExplanations:w(n.decisionExplanations,z(r=>this.mapToDecisionExplanation(r))),constraintExplanations:w(n.constraintExplanations,z(r=>this.mapToConstraintExplanation(r)))})).with({type:we.SpecifiedDeploymentForbidden},n=>({type:Bt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:w(t.attributes,z(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return w(t,ee(Yn(z(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:w(n.decisions,z(r=>this.mapToGlobalAttributeId(r)))})))),nr)}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:Ps.Package},n=>({type:zr.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Ps.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)),kt),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)),kt)})).with({type:Ee.Numeric},n=>({type:Oe.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,kt)})).with({type:Ee.Boolean},n=>({type:Oe.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,kt)})).exhaustive()}mapToCardinality(t){return ue(t).with(fa.Cardinality,()=>la.Cardinality).with(fa.Component,()=>la.Component).with(fa.Rule,()=>la.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(po.Mandatory,()=>Ar.Mandatory).with(po.Optional,()=>Ar.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return ue(t).with({type:ut.Boolean},r=>({...n,type:Oe.Boolean,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),nr),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ut.Numeric},r=>({...n,type:Oe.Numeric,decision:w(r.decision,ee(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),nr),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ut.Choice},r=>({...n,type:Oe.Choice,cardinality:r.cardinality,values:w(r.values,z(i=>{const o=w(i.decision,ee(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),nr);return{id:i.choiceValueId,possibleDecisionStates:w(i.possibleDecisionStates,z(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ut.Component},r=>({...n,type:Oe.Component,decision:w(r.decision,ee(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),nr),possibleDecisionStates:w(r.possibleDecisionStates,z(i=>this.mapToComponentDecisionState(i))),selection:w(r.selection,Se,ee(i=>this.mapToSelection(i)),kt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return ue(t).with(ho.Always,()=>Ii.Always).with(ho.Optional,()=>Ii.Optional).exhaustive()}mapToComponentDecisionState(t){return ue(t).with(Xt.Included,()=>Ti.Included).with(Xt.Excluded,()=>Ti.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return ue(t).with(Xt.Included,()=>Wr.Included).with(Xt.Excluded,()=>Wr.Excluded).exhaustive()}mapToDecisionKind(t){return ue(t).with(Nt.Explicit,()=>$r.Explicit).with(Nt.Implicit,()=>$r.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return w(t,ee(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),nr)}mapToAllowedRulesInExplain(t){return w(t,ee(n=>ue(n).returnType().with({type:so.all},()=>({type:on.all})).with({type:so.none},()=>({type:on.none})).with({type:so.specific},r=>({type:on.specific,rules:w(r.rules,z(this.mapToGlobalConstraintId))})).exhaustive()),nr)}},Mb=class{constructor(t,n){this.contractToDomainMapper=new jI,this.domainToContractMapper=new kb,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await w(this.sessionHandler.recreate(n),Kt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new MI(i,this.contractToDomainMapper,this.domainToContractMapper)}),Ic(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 sh(e){return e.possibleDecisionStates.some(t=>t===Wr.Included)}function jb(e){return!sh(e)}const _I=Object.freeze(Object.defineProperty({__proto__:null,isAllowed:sh,isBlocked:jb},Symbol.toStringTag,{value:"Module"}));function qI(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.lowerBound>0).with({type:Oe.Boolean},t=>t.selection===Ar.Mandatory).with({type:Oe.Numeric},t=>t.selection===Ar.Mandatory).with({type:Oe.Component},t=>t.inclusion===Ii.Optional&&t.selection===Ar.Mandatory).exhaustive()}function FI(e){return ue(e).with({type:Oe.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function LI(e){return w(e.values,zt(sh))}function BI(e){return w(e.values,zt(jb))}function _b(e,t){return w(e.values,$o(n=>w(n.decision,Se,Ht(r=>r.kind===t))))}function qb(e){return w(e.values,zt(t=>w(t.decision,Se,ee(n=>n.state===Wr.Included),at(()=>!1))))}const VI=qb;function Fb(e){return w(e.decision,Se,Ht(t=>t.kind===$r.Explicit),nr)}function Lb(e){return w(e.decision,Se,Ht(t=>t.kind===$r.Explicit),nr)}function UI(e,t){return e.possibleDecisionStates.some(n=>n===t)}function Bb(e){return w(e.decision,Se,nr)}function Vb(e){return Ub(e,Ti.Included)}function GI(e){return!Vb(e)}function Ub(e,t){return e.possibleDecisionStates.some(n=>n===t)}const zI=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:LI,getBlockedChoiceValues:BI,getBooleanDecision:Lb,getChoiceDecisions:_b,getComponentDecision:Bb,getIncludedChoiceValues:qb,getNumericDecision:Fb,getSelectedChoiceValues:VI,isBooleanValuePossible:UI,isComponentAllowed:Vb,isComponentBlocked:GI,isComponentStatePossible:Ub,isMandatory:qI,isMultiSelect:FI},Symbol.toStringTag,{value:"Module"})),Gb=e=>e.type===Oe.Boolean,zb=e=>e.type===Oe.Choice,Wb=e=>e.type===Oe.Numeric,Hb=e=>e.type===Oe.Component,WI=nu(lt),Qv=ji(lt);function Kb(e,t){const n=a=>WI.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return w(n,xE(t?a=>Qv.equals(w(a.componentPath??[],cE(r)),e.componentPath):a=>Qv.equals(a.componentPath??[],e.componentPath)))}function HI(e,t,n){const r=w(Kb({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:w(t.componentPath??[],sE(t.localId))},n),sb(i=>i.id));return w(e,zt(r))}function KI(e,t,n){const r=w(Kb({sharedConfigurationModelId:t,componentPath:[]},n),sb(i=>i.id));return w(e,zt(r))}function YI(e){return w(e,zt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function XI(e,t){return w(Yb(e),z(n=>_b(n,t)),Yp,$o(n=>Se(n)))}function JI(e,t){return w(Jb(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Fb(n)),$o(n=>Se(n)))}function QI(e,t){return w(Qb(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Lb(n)),$o(n=>Se(n)))}function ZI(e,t){return w(Xb(e),zt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),z(n=>Bb(n)),$o(n=>Se(n)))}function Yb(e){return w(e.attributes,zt(zb))}function Xb(e){return w(e.attributes,zt(Hb))}function Jb(e){return w(e.attributes,zt(Wb))}function Qb(e){return w(e.attributes,zt(Gb))}function eA(e,t){return w(ru(e,t),kt)}function tA(e,t){return w(Zb(e,t),kt)}function nA(e,t,n){return w(Zb(e,t),ee(r=>r.values),rr(Yn(ln(r=>r.id===n))),kt)}function rA(e,t){return w(ru(e,t),Ht(Wb),kt)}function iA(e,t){return w(ru(e,t),Ht(Gb),kt)}function oA(e,t){return w(ru(e,t),Ht(Hb),kt)}function ru(e,t){return w(e.attributes,ln(n=>Do.equals(n.id,t)))}function Zb(e,t){return w(ru(e,t),Ht(zb))}const No=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:HI,filterAttributesOfRoot:YI,filterAttributesOfShared:KI,getAttribute:eA,getBooleanAttribute:iA,getBooleanAttributes:Qb,getBooleanDecisions:QI,getChoiceAttribute:tA,getChoiceAttributes:Yb,getChoiceDecisions:XI,getChoiceValue:nA,getComponentAttribute:oA,getComponentAttributes:Xb,getComponentDecisions:ZI,getNumericAttribute:rA,getNumericAttributes:Jb,getNumericDecisions:JI},Symbol.toStringTag,{value:"Module"})),aA="https://spc.cloud.ceventis.de/api/engine",sA={hcaEngineBaseUrl:aA};function uA(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??sA.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function Ya(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const eS=e=>t=>n=>w(n,lE(r=>e.equals(r,t)),ee(r=>w(n,fE(r,i=>t))),sd,at(()=>w(n,Ne(pE(t))))),Eu=eS({equals:(e,t)=>bn.equals(e.attributeId,t.attributeId)}),cA=eS({equals:(e,t)=>e.choiceValueId===t.choiceValueId});let lA=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,c,l,f,d;const p=w(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],z(this.restToDomainMapper.mapToGlobalAttributeId)),h=I=>Kp(bn)(I,p),v=w(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=w(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=w(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=w(((s=n.consequences)==null?void 0:s.componentConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),S=w(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=w(((c=n.consequences)==null?void 0:c.numericConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=w(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=w(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],z(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=w([],Ne(w(b,z(I=>I.attributeId))),Ne(w(T,z(I=>I.attributeId))),Ne(w(S,z(I=>I.attributeId))),Ne(w(C,z(I=>I.attributeId))),Ne(w(v,z(I=>I.attributeId))),Ne(w(E,z(I=>I.attributeId))),Ne(w(x,z(I=>I.attributeId))),Ne(w(m,z(I=>I.attributeId))),ra(bn)),D=w(A,od(t.attributes,(I,N)=>{const _=t.attributes.find(L=>bn.equals(L.attributeId,N));return ue(_).with({type:ut.Choice},(L,V)=>{const H=this.mergeChoice(V,w(E,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)),w(v,zt(R=>bn.equals(R.attributeId,N)),z(R=>R.payload)));return Eu(H)(I)}).with({type:ut.Numeric},(L,V)=>{const H=this.mergeNumeric(V,w(C,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)),w(S,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)));return Eu(H)(I)}).with({type:ut.Boolean},(L,V)=>{const H=this.mergeBoolean(V,w(T,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)),w(b,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)));return Eu(H)(I)}).with({type:ut.Component},(L,V)=>{const H=this.mergeComponent(V,w(m,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)),w(x,ln(R=>bn.equals(R.attributeId,N)),ee(R=>R.payload)));return Eu(H)(I)}).exhaustive()}),z(I=>{const N=h(I.attributeId);return I.canContributeToConfigurationSatisfaction!=N?{...I,canContributeToConfigurationSatisfaction:N}:I}));return{...t,isSatisfied:w((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,Se,at(()=>t.isSatisfied)),attributes:D}}mergeChoice(t,n,r){const i=w(n,ee(u=>u.values??[]),at(()=>[])),o=w(r),a=w([],Ne(w(i,z(u=>u.choiceValueId))),Ne(w(o,z(u=>u.choiceValueId))),z(Ya),ra(lt)),s=w(a,od(t.values,(u,c)=>{const l=w(i,ln(h=>h.choiceValueId===c)),f=w(o,ln(h=>h.choiceValueId===c)),d=w(t.values.find(h=>h.choiceValueId===c),Se),p=this.mergeChoiceValue(c,d,l,f);return cA(p)(u)}));return{...t,isSatisfied:w(n,ee(u=>Ya(u.isSatisfied)),at(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=w(i,ee(s=>({state:this.toDecisionState(Ya(s.state)),kind:this.toDecisionKind(Ya(s.kind))})),at(()=>({state:w(n,rr(s=>w(s.decision,ee(u=>u.state)))),kind:w(n,rr(s=>w(s.decision,ee(u=>u.kind))),at(()=>Nt.Explicit))}))),a=w(r,ee(s=>w(qv(s.possibleDecisionStates??[]),z(u=>this.toPossibleDecisionState(u)),Hn)),at(()=>w(n,ee(s=>s.possibleDecisionStates??[]),at(()=>[]))));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(Ya(a.state));return w(s,ee(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),at(()=>w(t.decision,ee(a=>({state:a.state,kind:a.kind}))))),o=w(n,ee(a=>w(qv(a.possibleDecisionStates??[]),z(s=>this.toPossibleDecisionState(s)),Hn)),at(()=>t.possibleDecisionStates));return{...t,isSatisfied:w(n,ee(a=>a.isSatisfied),at(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:w(n,rr(i=>Se(i.isSatisfied)),at(()=>t.isSatisfied)),decision:w(r,Ei(()=>t.decision,i=>w(i.state,Se,ee(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:w(n,rr(i=>Se(i.isSatisfied)),at(()=>t.isSatisfied)),decision:w(r,Ei(()=>t.decision,i=>w(i.state,Se,ee(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:w(n,ee(i=>i.possibleDecisionStates),at(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return ue(t).with(vo.Included,()=>Me(Xt.Included)).with(vo.Excluded,()=>Me(Xt.Excluded)).otherwise(()=>me)}toDecisionState(t){return ue(t).with(Ur.Included,()=>Me(Xt.Included)).with(Ur.Excluded,()=>Me(Xt.Excluded)).otherwise(()=>me)}toDecisionKind(t){return ue(t).with(Rs.Implicit,()=>Nt.Implicit).with(Rs.Explicit,()=>Nt.Explicit).exhaustive()}},fA=class{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return ue(t).with({type:Ee.ChoiceValue},n=>({type:_n.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Ee.Component},n=>({type:_n.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Ee.Numeric},n=>({type:_n.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,kt)})).with({type:Ee.Boolean},n=>({type:_n.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:w(n.value,kt)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=w([...t],ri(u=>u.type!==Ee.Boolean?me:Me({type:_n.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,kt)}))),o=w([...t],ri(u=>u.type!==Ee.Numeric?me:Me({type:_n.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:w(u.value,kt)}))),a=w([...t],ri(u=>u.type!==Ee.ChoiceValue?me:Me({type:_n.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=w([...t],ri(u=>u.type!==Ee.Component?me:Me({type:_n.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],ri(a=>a.type!==ut.Boolean?me:w(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitBooleanDecision(a))))),r=w([...t],ri(a=>a.type!==ut.Numeric?me:w(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitNumericDecision(a))))),i=w([...t],ri(a=>a.type!==ut.Component?me:w(a.decision,Ht(s=>s.kind===Nt.Explicit),ee(()=>this.mapToExplicitComponentDecision(a))))),o=w([...t],ri(a=>a.type!==ut.Choice?me:w(this.mapToExplicitChoiceDecisions(a),tu(s=>w(s,eu)))),SE);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,Se,ee(ad),nr),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:ue(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:wt.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:_n.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),kt)}}mapToExplicitNumericDecision(t){return{type:_n.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:w(t.decision,ee(n=>n.state),kt)}}mapToExplicitComponentDecision(t){return{type:_n.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===Nt.Explicit),at(()=>!1))}return w(t.values,zt(n),z(r=>({type:_n.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(w(r.decision,ee(i=>i.state)))})),ad)}mapToDecisionState(t){return w(t,ee(n=>ue(n).with(Xt.Included,()=>Ur.Included).with(Xt.Excluded,()=>Ur.Excluded).exhaustive()),at(()=>Ur.Undefined))}mapToPossibleDecisionState(t){return ue(t).with(Xt.Included,()=>vo.Included).with(Xt.Excluded,()=>vo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return ue(t).with({subject:dn.attribute},n=>({type:yd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:dn.configuration},()=>({type:yd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return ue(t).with({subject:dn.boolean},n=>({type:is.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:dn.numeric},n=>({type:is.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:dn.component},n=>({type:is.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:dn.choiceValue},n=>({type:is.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}},dA=class{constructor(){this.configurationSession={hasExplicitDecisions(t){return w(t.configuration.attributes,ln(n=>ue(n).with({type:ut.Boolean},r=>w(r.decision,Ht(i=>i.kind===Nt.Explicit),rs)).with({type:ut.Numeric},r=>w(r.decision,Ht(i=>i.kind===Nt.Explicit),rs)).with({type:ut.Choice},r=>w(r.values,ln(i=>w(i.decision,ee(o=>o.kind===Nt.Explicit),at(()=>!1))),rs)).with({type:ut.Component},r=>w(r.decision,Ht(i=>i.kind===Nt.Explicit),rs)).exhaustive()),Ei(()=>!1,()=>!0))},getExplicitDecisions(t){return w(t.configuration.attributes,z(n=>ue(n).with({type:ut.Boolean},r=>w(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Boolean,attributeId:r.attributeId,value:Se(i.state)})),ee(i=>[i]))).with({type:ut.Numeric},r=>w(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Numeric,attributeId:r.attributeId,value:Se(i.state)})),ee(i=>[i]))).with({type:ut.Choice},r=>w(r.values,z(i=>w(i.decision,Ht(o=>o.kind===Nt.Explicit),ee(o=>({type:Ee.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:Se(o.state)})))),Hn,mi)).with({type:ut.Component},r=>w(r.decision,Ht(i=>i.kind===Nt.Explicit),ee(i=>({type:Ee.Component,attributeId:r.attributeId,state:Se(i.state)})),ee(i=>[i]))).exhaustive()),Hn,Yp)}}}},pA=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 dA}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),hr(Fr),Kt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=ue(t).with({question:Un.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Un.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return w(i,hr(Fr),Kt(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,dr(s=>{var u,c,l,f;return w([],Ne(w(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],z(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Ne(w(((c=s.rejectedDecisions)==null?void 0:c.numericDecisions)??[],z(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Ne(w(((l=s.rejectedDecisions)==null?void 0:l.componentDecisions)??[],z(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Ne(w(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],z(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),ia(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,Kt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return w(o,hr(Fr),dr(a=>{const s={rejectedDecisions:{booleanDecisions:wt.array(wt.any)}},u={decisionExplanations:wt.array(wt.any)};return ue(a).with(s,c=>Oa(c)).with(u,c=>yi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,i,n))).otherwise(()=>yi({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(ia(t),dr(r=>w(r.sessionId,Ei(()=>this.initializeInner(r,!1),()=>ia(r)))),dr(r=>w(r.sessionId,eh(()=>({type:we.ConfigurationUnauthenticated})),dr(i=>n(i,r)))))}initializeInner(t,n){return w(QE,()=>w(t.sessionId,uT,lT(s=>n?sT(s):w(this.sessionHandler.close(s),Ic(()=>me,()=>me)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return w(s,WE(()=>({type:we.ConfigurationUnauthenticated})),db(()=>this.sessionHandler.create(u)))},s=>w(s,ZE(u=>w(mi(t),Ht(this.interpreter.configurationSession.hasExplicitDecisions),ee(c=>this.replaceDecisions(u,c)),at(()=>ia({}))))),s=>w(s,dr(u=>{const c=this.determineConsequences(u),l=this.determineDecisions(u),f=E1(YE)({consequences:c,decisions:l});return w(f,Kt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Kt(d=>({sessionId:mi(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return w(this.engineApiClient.getDecisions(t),hr(Fr))}determineConsequences(t){return w(this.engineApiClient.getConsequence(t),hr(Fr))}},hA=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 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:me}}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(Yn(Kt(t=>{this.configurationSession={...this.configurationSession,sessionId:me}}))),at(ul(pI())))}applySolution(t){return w(this.configurationSession.solutions,ln(n=>EI.equals(n,t)),eh(()=>({type:we.ConfigurationSolutionNotAvailable})),Kt(n=>n.decisions),dr(n=>this.setMany(n,t.mode)))}setMany(t,n){return w(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),Ac(r=>()=>{const i=ue(r).with({decisionExplanations:wt.array(wt.any)},o=>Me(o.decisionExplanations)).otherwise(()=>me);this.configurationSession={...this.configurationSession,solutions:w(i,ee(Yn(z(o=>o.solution))),at(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=ue(t).with({decisionExplanations:wt.array(wt.any)},r=>r.decisionExplanations).otherwise(()=>[]);return w(n,z(r=>r.solution))}invalidateAvailableSolutions(){return tT(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return Ac(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return $s(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Yn($s(t=>()=>{this.configurationSession=t,w(this.onConfigurationChangedHandler,rT(n=>()=>n(this.configurationSession.configuration)))}),Kt(t=>t.configuration),this.invalidateAvailableSolutions())}},vA=class{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=QT(r,XT.concat(ZT(i),JT(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return _o(this.policy,n,r=>w(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return _o(this.policy,n,r=>w(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return _o(this.policy,n,r=>w(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return _o(this.policy,n,r=>w(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return _o(this.policy,n,r=>w(r,Yi(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return _o(this.policy,r,i=>w(i,Yi(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)}},mA=class{constructor(){this.queue=[],this.operating=me}push(t){const n=new yA(t);return this.queue.push(n),this.operating=w(this.operating,at(()=>this.start()),mi),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=w(t,z(r=>r.argument),od(me,(r,i)=>this.reduce(r,i)),ee(Yn(r=>this.execute(r),r=>r.then(i=>{w(t,z(o=>{o.resolve(i)}))}).catch(i=>{w(t,z(o=>{o.reject(i)}))}))),kt);n&&await n}this.operating=me}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}},yA=class{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}},gA=class extends mA{constructor(t){super(),this.inner=t}reduce(t,n){return Me(n)}async execute(t){return await this.inner.setSessionContext(t)()}},bA=class{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new gA(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(yI.equals(n,t))return Oa(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)}},SA=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(),Ac(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),$s(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)}},wA=class tS{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+Tb()}static new(t){return new tS(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 CA(e){e=uA(e);const t=new RI(e.hcaEngineBaseUrl),n=new Pb,r=new fA,i=new kb,o=new $b,a=new lA(n),s=ue(e.sessionHandler).with({create:wt.any,close:wt.any},l=>l).with({accessToken:wt.string},l=>new Db(t,o,n,l)).with({sessionCreateUrl:wt.string,sessionDeleteUrl:wt.string},l=>new Rb(o,l)).exhaustive(),u=new pA(s,t,n,r,i,a),c=(l,f)=>w(new hA(l,f),d=>new vA(d),d=>new bA(d),wA.new,d=>new SA(d,!1));return new Mb(u,c)}const nS=Do.equals,rS=ih.equals,xA=Ib.equals,EA=Object.freeze(Object.defineProperty({__proto__:null,AllowedRulesInExplainType:on,AttributeInterpreter:zI,AttributeType:Oe,ChoiceValueDecisionState:Wr,ChoiceValueInterpreter:_I,ClientSideSessionLifetimeHandler:Db,ComponentDecisionState:Ti,ConfigurationConflictReason:gl,ConfigurationInterpreter:No,ConfigurationModelSourceType:zr,ConfiguratorClient:Mb,ConstraintType:la,ContractToRestMapper:$b,DecisionKind:$r,ExplainQuestionBuilderModule:kI,ExplainQuestionSubject:Ut,ExplainQuestionType:wn,FailureType:Bt,Inclusion:Ii,Results:fI,Selection:Ar,ServerSideSessionLifetimeHandler:Rb,Types:lI,causedByDecisionEquals:xA,createClient:CA,explainQuestionBuilder:ah,globalAttributeIdEquals:nS,globalConstraintIdEquals:rS},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 uh(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 Le(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 Ue(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 mt(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 dt;(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"})(dt||(dt={}));var mo;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(mo||(mo={}));var gd=dt.Start,ch=dt.Stop,iu=dt.Raise,bl=dt.Send,iS=dt.Cancel,IA=dt.NullEvent,lh=dt.Assign;dt.After;dt.DoneState;var oS=dt.Log,AA=dt.Init,bd=dt.Invoke;dt.ErrorExecution;var Zv=dt.ErrorPlatform,$A=dt.ErrorCustom,aS=dt.Update,OA=dt.Choose,DA=dt.Pure,sS=".",em={},Sd="xstate.guard",NA="",At=process.env.NODE_ENV==="production",Tu;function fh(e,t,n){n===void 0&&(n=sS);var r=Ss(e,n),i=Ss(t,n);return ze(i)?ze(r)?i===r:!1:ze(r)?r in i:Object.keys(r).every(function(o){return o in i?fh(r[o],i[o]):!1})}function uS(e){try{return ze(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 Cd(e,t){try{return Ra(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function PA(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function Ss(e,t){if(PA(e))return e.value;if(Ra(e))return Oc(e);if(typeof e!="string")return e;var n=Cd(e,t);return Oc(n)}function Oc(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 tm(e,t,n){var r,i,o={};try{for(var a=Le(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var RA=function(e){return function(t){var n,r,i=t;try{for(var o=Le(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 kA(e,t){return function(n){var r,i,o=n;try{for(var a=Le(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}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 rc(e){if(!e)return[[]];if(ze(e))return[[e]];var t=Tt(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:rc(e[n]).map(function(i){return[n].concat(i)})}));return t}function Tt(e){var t;return(t=[]).concat.apply(t,mt([],Ue(e),!1))}function cS(e){return Ra(e)?e:[e]}function lr(e){return e===void 0?[]:cS(e)}function Dc(e,t,n){var r,i;if(Je(e))return e(t,n.data);var o={};try{for(var a=Le(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];Je(c)?o[u]=c(t,n.data):o[u]=c}}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 MA(e){return/^(done|error)\./.test(e)}function nm(e){return!!(e instanceof Promise||e!==null&&(Je(e)||typeof e=="object")&&Je(e.then))}function jA(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function _A(e,t){var n,r,i=Ue([[],[]],2),o=i[0],a=i[1];try{for(var s=Le(e),u=s.next();!u.done;u=s.next()){var c=u.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function lS(e,t){return as(e.states,function(n,r){if(n){var i=(ze(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:lS(n,i)}}})}function qA(e,t){return{current:t,states:lS(e,t)}}function rm(e,t,n,r){At||Zt(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,c=a.assignment,l={state:r,action:a,_event:t},f={};if(Je(c))f=c(o,t.data,l);else try{for(var d=Le(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=Je(v)?v(o,t.data,l):v}}catch(E){s={error:E}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var Zt=function(){};At||(Zt=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 Ra(e){return Array.isArray(e)}function Je(e){return typeof e=="function"}function ze(e){return typeof e=="string"}function fS(e,t){if(e)return ze(e)?{type:Sd,name:e,predicate:t?t[e]:void 0}:Je(e)?{type:Sd,name:e.name,predicate:e}:e}function FA(e){try{return"subscribe"in e&&Je(e.subscribe)}catch{return!1}}var pi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Tu={},Tu[pi]=function(){return this},Tu[Symbol.observable]=function(){return this};function Yr(e){return!!e&&"__xstatenode"in e}function LA(e){return!!e&&typeof e.send=="function"}var BA=function(){var e=0;return function(){return e++,e.toString(16)}}();function Sl(e,t){return ze(e)||typeof e=="number"?ne({type:e},t):e}function un(e,t){if(!ze(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Sl(e);return ne({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Fo(e,t){var n=cS(t).map(function(r){return typeof r>"u"||typeof r=="string"||Yr(r)?{target:r,event:e}:ne(ne({},r),{event:e})});return n}function VA(e){if(!(e===void 0||e===NA))return lr(e)}function UA(e,t,n){if(!At){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 dS(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Sd)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 pS(e){return typeof e=="string"?{type:e}:e}function ic(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 Iu(e,t){return"".concat(e,":invocation[").concat(t,"]")}function wd(e){return(e.type===iu||e.type===bl&&e.to===mo.Internal)&&typeof e.delay!="number"}var pa=un({type:AA});function xd(e,t){return t&&t[e]||void 0}function Ms(e,t){var n;if(ze(e)||typeof e=="number"){var r=xd(e,t);Je(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Je(e))n={type:e.name||e.toString(),exec:e};else{var r=xd(e.type,t);if(Je(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 hi=function(e,t){if(!e)return[];var n=Ra(e)?e:[e];return n.map(function(r){return Ms(r,t)})};function dh(e){var t=Ms(e);return ne(ne({id:ze(e)?e:t.id},t),{type:t.type})}function GA(e,t){return{type:iu,event:typeof e=="function"?e:Sl(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function zA(e,t,n,r){var i={_event:n},o=un(Je(e.event)?e.event(t,n.data,i):e.event),a;if(ze(e.delay)){var s=r&&r[e.delay];a=Je(s)?s(t,n.data,i):s}else a=Je(e.delay)?e.delay(t,n.data,i):e.delay;return ne(ne({},e),{type:iu,_event:o,delay:a})}function Cl(e,t){return{to:t?t.to:void 0,type:bl,event:Je(e)?e:Sl(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Je(e)?e.name:uS(e)}}function WA(e,t,n,r){var i={_event:n},o=un(Je(e.event)?e.event(t,n.data,i):e.event),a;if(ze(e.delay)){var s=r&&r[e.delay];a=Je(s)?s(t,n.data,i):s}else a=Je(e.delay)?e.delay(t,n.data,i):e.delay;var u=Je(e.to)?e.to(t,n.data,i):e.to;return ne(ne({},e),{to:u,_event:o,event:o.data,delay:a})}function HA(e,t){return Cl(e,ne(ne({},t),{to:mo.Parent}))}var KA=function(e,t,n){return ne(ne({},e),{value:ze(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},YA=function(e){return{type:iS,sendId:e}};function XA(e){var t=dh(e);return{type:dt.Start,activity:t,exec:void 0}}function JA(e){var t=Je(e)?e:dh(e);return{type:dt.Stop,activity:t,exec:void 0}}function QA(e,t,n){var r=Je(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:dt.Stop,activity:i};return o}var ZA=function(e){return{type:lh,assignment:e}};function e$(e,t){var n=t?"#".concat(t):"";return"".concat(dt.After,"(").concat(e,")").concat(n)}function Au(e,t){var n="".concat(dt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function oc(e,t){var n="".concat(dt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function ss(e,t){var n="".concat(dt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function t$(e,t){if(!At&&(!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,mt([],Ue(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 Cl(function(r,i){return i},ne(ne({},t),{to:e}))}var n$=function(e){var t,n,r=[];try{for(var i=Le(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===lh){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 Nc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:n$(i),u=s.length?rm(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var E;switch(v.type){case iu:{var x=zA(v,u,r,e.options.delays);return o&&typeof x.delay=="number"&&o(x,u,r),x}case bl:var m=WA(v,u,r,e.options.delays);if(!At){var C=v.delay;Zt(!ze(C)||typeof m.delay=="number","No delay reference for delay expression '".concat(C,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==mo.Internal&&(h==="entry"?l.push(m):o(m,u,r)),m;case oS:{var w=KA(v,u,r);return o==null||o(w,u,r),w}case OA:{var b=v,T=(E=b.conds.find(function(B){var U=fS(B.cond,e.options.guards);return!U||dS(e,U,u,r,o?void 0:t)}))===null||E===void 0?void 0:E.actions;if(!T)return[];var A=Ue(Nc(e,t,u,r,[{type:h,actions:hi(lr(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case DA:{var T=v.get(u,r.data);if(!T)return[];var N=Ue(Nc(e,t,u,r,[{type:h,actions:hi(lr(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case ch:{var w=QA(v,u,r);return o==null||o(w,n,r),w}case lh:{u=rm(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=Ms(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=ne(ne({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,mt([c[R]],Ue(U),!1))}});V=ie}return V}}function d(h){var v,E,x=[];try{for(var m=Le(h.actions),C=m.next();!C.done;C=m.next()){var w=C.value,b=f(h.type,w);b&&(x=x.concat(b))}}catch(T){v={error:T}}finally{try{C&&!C.done&&(E=m.return)&&E.call(m)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,x}var p=Tt(i.map(d));return[p,u]}var Pc=[],Jo=function(e,t){Pc.push(e);var n=t(e);return Pc.pop(),n},r$=function(e){return e(Pc[Pc.length-1])};function hS(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[pi]=function(){return this},t}function i$(e,t,n,r){var i,o=pS(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Dc(e.data,n,r):void 0,u=a?ph(a,e.id,s):hS(e.id);return u.meta=e,u}function ph(e,t,n){var r=hS(t);if(r.deferred=!0,Yr(e)){var i=r.state=Jo(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function o$(e){try{return typeof e.send=="function"}catch{return!1}}function a$(e){return o$(e)&&"id"in e}function s$(e){var t;return ne((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[pi]=function(){return this},t),e)}var Rc=function(e){return e.type==="atomic"||e.type==="final"};function vS(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function js(e){return vS(e).filter(function(t){return t.type!=="history"})}function mS(e){var t=[e];return Rc(e)?t:t.concat(Tt(js(e).map(mS)))}function us(e,t){var n,r,i,o,a,s,u,c,l=new Set(e),f=Ed(l),d=new Set(t);try{for(var p=Le(d),h=p.next();!h.done;h=p.next())for(var v=h.value,E=v.parent;E&&!d.has(E);)d.add(E),E=E.parent}catch(I){n={error:I}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var x=Ed(d);try{for(var m=Le(d),C=m.next();!C.done;C=m.next()){var v=C.value;if(v.type==="compound"&&(!x.get(v)||!x.get(v).length))f.get(v)?f.get(v).forEach(function(N){return d.add(N)}):v.initialStateNodes.forEach(function(N){return d.add(N)});else if(v.type==="parallel")try{for(var w=(a=void 0,Le(js(v))),b=w.next();!b.done;b=w.next()){var T=b.value;d.has(T)||(d.add(T),f.get(T)?f.get(T).forEach(function(N){return d.add(N)}):T.initialStateNodes.forEach(function(N){return d.add(N)}))}}catch(N){a={error:N}}finally{try{b&&!b.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{C&&!C.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Le(d),D=A.next();!D.done;D=A.next())for(var v=D.value,E=v.parent;E&&!d.has(E);)d.add(E),E=E.parent}catch(I){u={error:I}}finally{try{D&&!D.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}return d}function yS(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(Rc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=yS(o,t)}),i}function Ed(e){var t,n,r=new Map;try{for(var i=Le(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 u$(e,t){var n=us([e],t);return yS(e,Ed(n))}function cs(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function c$(e){return mt([],Ue(new Set(Tt(mt([],Ue(e.map(function(t){return t.ownEvents})),!1)))),!1)}function ac(e,t){return t.type==="compound"?js(t).some(function(n){return n.type==="final"&&cs(e,n)}):t.type==="parallel"?js(t).every(function(n){return ac(e,n)}):!1}function l$(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function im(e){return new Set(Tt(e.map(function(t){return t.tags})))}function gS(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(ze(e)||ze(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return gS(e[i],t[i])})}function f$(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function d$(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 er=function(){function e(t){var n=this,r;this.actions=[],this.activities=em,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||em,this.meta=l$(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 c$(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=pa;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=pa;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="."),ze(t))return[t];var i=Object.keys(t);return i.concat.apply(i,mt([],Ue(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=uh(t,["configuration","transitions","tags","machine"]);return ne(ne({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return fh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;At&&Zt(!!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}(),p$={deferEvents:!1},om=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ne(ne({},p$),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}(),mf=new Map,h$=0,Ja={bookId:function(){return"x:".concat(h$++)},register:function(e,t){return mf.set(e,t),e},get:function(e){return mf.get(e)},free:function(e){mf.delete(e)}};function hh(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;At||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 v$(){var e=hh();if(e&&"__xstate__"in e)return e.__xstate__}function m$(e){if(hh()){var t=v$();t&&t.register(e)}}function y$(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 c=i.shift();n=e.transition(n,c,u),r.forEach(function(l){return l.next(n)})}o=!1}},s=s$({id:t.id,send:function(c){i.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=ic(c,l,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 Td={sync:!1,autoForward:!1},Ot;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ot||(Ot={}));var g$=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=Ot.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(l,f){if(Ra(l))return r.batch(l),r.state;var d=un(Sl(l,f));if(r.status===Ot.Stopped)return At||Zt(!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 uh(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 Le(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 Ue(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 mt(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 dt;(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"})(dt||(dt={}));var mo;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(mo||(mo={}));var gd=dt.Start,ch=dt.Stop,iu=dt.Raise,bl=dt.Send,iS=dt.Cancel,TA=dt.NullEvent,lh=dt.Assign;dt.After;dt.DoneState;var oS=dt.Log,IA=dt.Init,bd=dt.Invoke;dt.ErrorExecution;var Zv=dt.ErrorPlatform,AA=dt.ErrorCustom,aS=dt.Update,$A=dt.Choose,OA=dt.Pure,sS=".",em={},Sd="xstate.guard",DA="",At=process.env.NODE_ENV==="production",Tu;function fh(e,t,n){n===void 0&&(n=sS);var r=bs(e,n),i=bs(t,n);return ze(i)?ze(r)?i===r:!1:ze(r)?r in i:Object.keys(r).every(function(o){return o in i?fh(r[o],i[o]):!1})}function uS(e){try{return ze(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 wd(e,t){try{return Na(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function NA(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function bs(e,t){if(NA(e))return e.value;if(Na(e))return Oc(e);if(typeof e!="string")return e;var n=wd(e,t);return Oc(n)}function Oc(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 os(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 tm(e,t,n){var r,i,o={};try{for(var a=Le(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var PA=function(e){return function(t){var n,r,i=t;try{for(var o=Le(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 RA(e,t){return function(n){var r,i,o=n;try{for(var a=Le(e),s=a.next();!s.done;s=a.next()){var u=s.value;o=o[t][u]}}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 rc(e){if(!e)return[[]];if(ze(e))return[[e]];var t=Tt(Object.keys(e).map(function(n){var r=e[n];return typeof r!="string"&&(!r||!Object.keys(r).length)?[[n]]:rc(e[n]).map(function(i){return[n].concat(i)})}));return t}function Tt(e){var t;return(t=[]).concat.apply(t,mt([],Ue(e),!1))}function cS(e){return Na(e)?e:[e]}function lr(e){return e===void 0?[]:cS(e)}function Dc(e,t,n){var r,i;if(Je(e))return e(t,n.data);var o={};try{for(var a=Le(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];Je(c)?o[u]=c(t,n.data):o[u]=c}}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 kA(e){return/^(done|error)\./.test(e)}function nm(e){return!!(e instanceof Promise||e!==null&&(Je(e)||typeof e=="object")&&Je(e.then))}function MA(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function jA(e,t){var n,r,i=Ue([[],[]],2),o=i[0],a=i[1];try{for(var s=Le(e),u=s.next();!u.done;u=s.next()){var c=u.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function lS(e,t){return os(e.states,function(n,r){if(n){var i=(ze(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:lS(n,i)}}})}function _A(e,t){return{current:t,states:lS(e,t)}}function rm(e,t,n,r){At||Zt(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,c=a.assignment,l={state:r,action:a,_event:t},f={};if(Je(c))f=c(o,t.data,l);else try{for(var d=Le(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=Je(v)?v(o,t.data,l):v}}catch(E){s={error:E}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var Zt=function(){};At||(Zt=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 Na(e){return Array.isArray(e)}function Je(e){return typeof e=="function"}function ze(e){return typeof e=="string"}function fS(e,t){if(e)return ze(e)?{type:Sd,name:e,predicate:t?t[e]:void 0}:Je(e)?{type:Sd,name:e.name,predicate:e}:e}function qA(e){try{return"subscribe"in e&&Je(e.subscribe)}catch{return!1}}var fi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Tu={},Tu[fi]=function(){return this},Tu[Symbol.observable]=function(){return this};function Hr(e){return!!e&&"__xstatenode"in e}function FA(e){return!!e&&typeof e.send=="function"}var LA=function(){var e=0;return function(){return e++,e.toString(16)}}();function Sl(e,t){return ze(e)||typeof e=="number"?ne({type:e},t):e}function un(e,t){if(!ze(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Sl(e);return ne({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function qo(e,t){var n=cS(t).map(function(r){return typeof r>"u"||typeof r=="string"||Hr(r)?{target:r,event:e}:ne(ne({},r),{event:e})});return n}function BA(e){if(!(e===void 0||e===DA))return lr(e)}function VA(e,t,n){if(!At){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 dS(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Sd)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 pS(e){return typeof e=="string"?{type:e}:e}function ic(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 Iu(e,t){return"".concat(e,":invocation[").concat(t,"]")}function Cd(e){return(e.type===iu||e.type===bl&&e.to===mo.Internal)&&typeof e.delay!="number"}var da=un({type:IA});function xd(e,t){return t&&t[e]||void 0}function ks(e,t){var n;if(ze(e)||typeof e=="number"){var r=xd(e,t);Je(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Je(e))n={type:e.name||e.toString(),exec:e};else{var r=xd(e.type,t);if(Je(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 di=function(e,t){if(!e)return[];var n=Na(e)?e:[e];return n.map(function(r){return ks(r,t)})};function dh(e){var t=ks(e);return ne(ne({id:ze(e)?e:t.id},t),{type:t.type})}function UA(e,t){return{type:iu,event:typeof e=="function"?e:Sl(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function GA(e,t,n,r){var i={_event:n},o=un(Je(e.event)?e.event(t,n.data,i):e.event),a;if(ze(e.delay)){var s=r&&r[e.delay];a=Je(s)?s(t,n.data,i):s}else a=Je(e.delay)?e.delay(t,n.data,i):e.delay;return ne(ne({},e),{type:iu,_event:o,delay:a})}function wl(e,t){return{to:t?t.to:void 0,type:bl,event:Je(e)?e:Sl(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Je(e)?e.name:uS(e)}}function zA(e,t,n,r){var i={_event:n},o=un(Je(e.event)?e.event(t,n.data,i):e.event),a;if(ze(e.delay)){var s=r&&r[e.delay];a=Je(s)?s(t,n.data,i):s}else a=Je(e.delay)?e.delay(t,n.data,i):e.delay;var u=Je(e.to)?e.to(t,n.data,i):e.to;return ne(ne({},e),{to:u,_event:o,event:o.data,delay:a})}function WA(e,t){return wl(e,ne(ne({},t),{to:mo.Parent}))}var HA=function(e,t,n){return ne(ne({},e),{value:ze(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},KA=function(e){return{type:iS,sendId:e}};function YA(e){var t=dh(e);return{type:dt.Start,activity:t,exec:void 0}}function XA(e){var t=Je(e)?e:dh(e);return{type:dt.Stop,activity:t,exec:void 0}}function JA(e,t,n){var r=Je(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:dt.Stop,activity:i};return o}var QA=function(e){return{type:lh,assignment:e}};function ZA(e,t){var n=t?"#".concat(t):"";return"".concat(dt.After,"(").concat(e,")").concat(n)}function Au(e,t){var n="".concat(dt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function oc(e,t){var n="".concat(dt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function as(e,t){var n="".concat(dt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function e$(e,t){if(!At&&(!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,mt([],Ue(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 wl(function(r,i){return i},ne(ne({},t),{to:e}))}var t$=function(e){var t,n,r=[];try{for(var i=Le(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===lh){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 Nc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:t$(i),u=s.length?rm(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var E;switch(v.type){case iu:{var x=GA(v,u,r,e.options.delays);return o&&typeof x.delay=="number"&&o(x,u,r),x}case bl:var m=zA(v,u,r,e.options.delays);if(!At){var S=v.delay;Zt(!ze(S)||typeof m.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==mo.Internal&&(h==="entry"?l.push(m):o(m,u,r)),m;case oS:{var C=HA(v,u,r);return o==null||o(C,u,r),C}case $A:{var b=v,T=(E=b.conds.find(function(B){var U=fS(B.cond,e.options.guards);return!U||dS(e,U,u,r,o?void 0:t)}))===null||E===void 0?void 0:E.actions;if(!T)return[];var A=Ue(Nc(e,t,u,r,[{type:h,actions:di(lr(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case OA:{var T=v.get(u,r.data);if(!T)return[];var N=Ue(Nc(e,t,u,r,[{type:h,actions:di(lr(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case ch:{var C=JA(v,u,r);return o==null||o(C,n,r),C}case lh:{u=rm(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=ks(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=ne(ne({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,mt([c[R]],Ue(U),!1))}});V=ie}return V}}function d(h){var v,E,x=[];try{for(var m=Le(h.actions),S=m.next();!S.done;S=m.next()){var C=S.value,b=f(h.type,C);b&&(x=x.concat(b))}}catch(T){v={error:T}}finally{try{S&&!S.done&&(E=m.return)&&E.call(m)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,x}var p=Tt(i.map(d));return[p,u]}var Pc=[],Xo=function(e,t){Pc.push(e);var n=t(e);return Pc.pop(),n},n$=function(e){return e(Pc[Pc.length-1])};function hS(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[fi]=function(){return this},t}function r$(e,t,n,r){var i,o=pS(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Dc(e.data,n,r):void 0,u=a?ph(a,e.id,s):hS(e.id);return u.meta=e,u}function ph(e,t,n){var r=hS(t);if(r.deferred=!0,Hr(e)){var i=r.state=Xo(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function i$(e){try{return typeof e.send=="function"}catch{return!1}}function o$(e){return i$(e)&&"id"in e}function a$(e){var t;return ne((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[fi]=function(){return this},t),e)}var Rc=function(e){return e.type==="atomic"||e.type==="final"};function vS(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Ms(e){return vS(e).filter(function(t){return t.type!=="history"})}function mS(e){var t=[e];return Rc(e)?t:t.concat(Tt(Ms(e).map(mS)))}function ss(e,t){var n,r,i,o,a,s,u,c,l=new Set(e),f=Ed(l),d=new Set(t);try{for(var p=Le(d),h=p.next();!h.done;h=p.next())for(var v=h.value,E=v.parent;E&&!d.has(E);)d.add(E),E=E.parent}catch(I){n={error:I}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var x=Ed(d);try{for(var m=Le(d),S=m.next();!S.done;S=m.next()){var v=S.value;if(v.type==="compound"&&(!x.get(v)||!x.get(v).length))f.get(v)?f.get(v).forEach(function(N){return d.add(N)}):v.initialStateNodes.forEach(function(N){return d.add(N)});else if(v.type==="parallel")try{for(var C=(a=void 0,Le(Ms(v))),b=C.next();!b.done;b=C.next()){var T=b.value;d.has(T)||(d.add(T),f.get(T)?f.get(T).forEach(function(N){return d.add(N)}):T.initialStateNodes.forEach(function(N){return d.add(N)}))}}catch(N){a={error:N}}finally{try{b&&!b.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{S&&!S.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Le(d),D=A.next();!D.done;D=A.next())for(var v=D.value,E=v.parent;E&&!d.has(E);)d.add(E),E=E.parent}catch(I){u={error:I}}finally{try{D&&!D.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}return d}function yS(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(Rc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=yS(o,t)}),i}function Ed(e){var t,n,r=new Map;try{for(var i=Le(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 s$(e,t){var n=ss([e],t);return yS(e,Ed(n))}function us(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function u$(e){return mt([],Ue(new Set(Tt(mt([],Ue(e.map(function(t){return t.ownEvents})),!1)))),!1)}function ac(e,t){return t.type==="compound"?Ms(t).some(function(n){return n.type==="final"&&us(e,n)}):t.type==="parallel"?Ms(t).every(function(n){return ac(e,n)}):!1}function c$(e){return e===void 0&&(e=[]),e.reduce(function(t,n){return n.meta!==void 0&&(t[n.id]=n.meta),t},{})}function im(e){return new Set(Tt(e.map(function(t){return t.tags})))}function gS(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(ze(e)||ze(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return gS(e[i],t[i])})}function l$(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function f$(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 er=function(){function e(t){var n=this,r;this.actions=[],this.activities=em,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||em,this.meta=c$(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 u$(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=da;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=da;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="."),ze(t))return[t];var i=Object.keys(t);return i.concat.apply(i,mt([],Ue(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=uh(t,["configuration","transitions","tags","machine"]);return ne(ne({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return fh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;At&&Zt(!!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}(),d$={deferEvents:!1},om=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=ne(ne({},d$),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}(),mf=new Map,p$=0,Xa={bookId:function(){return"x:".concat(p$++)},register:function(e,t){return mf.set(e,t),e},get:function(e){return mf.get(e)},free:function(e){mf.delete(e)}};function hh(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;At||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 h$(){var e=hh();if(e&&"__xstate__"in e)return e.__xstate__}function v$(e){if(hh()){var t=h$();t&&t.register(e)}}function m$(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 c=i.shift();n=e.transition(n,c,u),r.forEach(function(l){return l.next(n)})}o=!1}},s=a$({id:t.id,send:function(c){i.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=ic(c,l,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 Td={sync:!1,autoForward:!1},Ot;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ot||(Ot={}));var y$=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=Ot.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(l,f){if(Na(l))return r.batch(l),r.state;var d=un(Sl(l,f));if(r.status===Ot.Stopped)return At||Zt(!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!==Ot.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 p=r._nextState(d);r.update(p,d)}),r._state},this.sendTo=function(l,f,d){var p=r.parent&&(f===mo.Parent||r.parent.id===f),h=p?r.parent:ze(f)?f===mo.Internal?r:r.children.get(f)||
|
|
20
|
-
Event: `).concat(JSON.stringify(event)));else if(this.status!==Ot.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=[],c=function(p){var h=un(p);n.forward(h),a=Jo(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),u.push.apply(u,mt([],Ue(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return d$(v,a)})),!1)),s=s||!!a.changed};try{for(var l=Le(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,un(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=un(t);if(i.name.indexOf(Zv)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Zv)===0}))throw i.data.data;var o=Jo(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=Le(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),Je(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Ot.Running)return ph(t,n);if(nm(t))return this.spawnPromise(Promise.resolve(t),n);if(Je(t))return this.spawnCallback(t,n);if(a$(t))return this.spawnActor(t,n);if(FA(t))return this.spawnObservable(t,n);if(Yr(t))return this.spawnMachine(t,ne(ne({},r),{id:n}));if(jA(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({},Td),n);o.sync&&i.onTransition(function(s){r.send(aS,{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(un(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=y$(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(un(oc(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=ss(n,u);try{i.send(un(c,{origin:n}))}catch(l){UA(u,l,n),i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,c,l){var f=ic(u,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[pi]=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,c=function(d){u=d,s.forEach(function(p){return p(d)}),!o&&i.send(un(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(ss(n,d))}if(nm(l))return this.spawnPromise(l,n);var f=(r={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=ic(d);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){o=!0,Je(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[pi]=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(un(u,{origin:n}))},function(u){i.removeChild(n),i.send(un(ss(n,u),{origin:n}))},function(){i.removeChild(n),i.send(un(oc(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,c,l){return t.subscribe(u,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[pi]=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){At||Zt(!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[pi]=function(){return this},r))},e.prototype.attachDev=function(){var t=hh();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)}m$(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[pi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Ot.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=bS,e}(),b$=function(e){return ze(e)?ne(ne({},Td),{name:e}):ne(ne(ne({},Td),{name:BA()}),e)};function am(e,t){var n=b$(t);return r$(function(r){if(!At){var i=Yr(e)||Je(e);Zt(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Yr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):ph(e,n.name)})}function bS(e,t){var n=new g$(e,t);return n}function S$(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function $u(e){return ne(ne({type:bd},e),{toJSON:function(){e.onDone,e.onError;var t=uh(e,["onDone","onError"]);return ne(ne({},t),{type:bd,src:S$(e.src)})}})}var Qo="",Id="#",Qa="*",Lo={},Bo=function(e){return e[0]===Id},C$=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},w$=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(ze(o.target)||Yr(o.target))}),i=t===Qo?"the transient event":"event '".concat(t,"'");Zt(!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.")},x$=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(C$(),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:sS),this.id=this.config.id||mt([this.machine.key],Ue(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,At||Zt(!("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(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,ne((f={},f[d.id]=d,f),d.idMap)),d}):Lo;var s=0;function u(c){var l,f;c.order=s++;try{for(var d=Le(vS(c)),p=d.next();!p.done;p=d.next()){var h=p.value;u(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.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(c){var l=c.event;return l===Qo}):Qo in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=lr(this.config.entry||this.config.onEntry).map(function(c){return Ms(c)}),this.onExit=lr(this.config.exit||this.config.onExit).map(function(c){return Ms(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=lr(this.config.invoke).map(function(c,l){var f,d;if(Yr(c)){var p=Iu(o.id,l);return o.machine.options.services=ne((f={},f[p]=c,f),o.machine.options.services),$u({src:p,id:p})}else if(ze(c.src)){var p=c.id||Iu(o.id,l);return $u(ne(ne({},c),{id:p,src:c.src}))}else if(Yr(c.src)||Je(c.src)){var p=c.id||Iu(o.id,l);return o.machine.options.services=ne((d={},d[p]=c.src,d),o.machine.options.services),$u(ne(ne({id:p},c),{src:p}))}else{var h=c.src;return $u(ne(ne({id:Iu(o.id,l)},c),{src:h}))}}),this.activities=lr(this.config.activities).concat(this.invoke).map(function(c){return dh(c)}),this.transition=this.transition.bind(this),this.tags=lr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||mS(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 Je(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===Qo,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===Qa});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=Je(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=e$(s,t.id);return t.onEntry.push(Cl(u,{delay:o})),t.onExit.push(YA(u)),u},i=Ra(n)?n.map(function(o,a){var s=r(o.delay,a);return ne(ne({},o),{event:s})}):Tt(Object.keys(n).map(function(o,a){var s=n[o],u=ze(s)?{target:s}:s,c=isNaN(+o)?o:+o,l=r(c,a);return lr(u).map(function(f){return ne(ne({},f),{event:l,delay:c})})}));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 er?t.value:Ss(t,this.delimiter);if(ze(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,mt([],Ue(Tt(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=uS(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof er?t:er.create(t),r=Array.from(us([],this.getStateNodes(n.value)));return new er(ne(ne({},n),{value:this.resolve(n.value),configuration:r,done:ac(r,this),tags:im(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=Le(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,r);d&&(a[c]=d)}}}catch(x){i={error:x}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var p=Object.keys(a).map(function(x){return a[x]}),h=Tt(p.map(function(x){return x.transitions})),v=p.some(function(x){return x.transitions.length>0});if(!v)return this.next(n,r);var E=Tt(Object.keys(a).map(function(x){return a[x].configuration}));return{transitions:h,exitSet:Tt(p.map(function(x){return x.exitSet})),configuration:E,source:n,actions:Tt(Object.keys(a).map(function(x){return a[x].actions}))}},e.prototype._transition=function(t,n,r){return ze(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,un(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],c;try{for(var l=Le(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,E=h?ze(h)&&Bo(h)?t.matches(Ss(this.getStateNodeById(h).path,this.delimiter)):fh(Ss(h,this.delimiter),RA(this.path.slice(0,-2))(t.value)):!0,x=!1;try{x=!p||dS(this.machine,p,v,n,t)}catch(w){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
-
`).concat(w.message))}if(x&&E){d.target!==void 0&&(u=d.target),s.push.apply(s,mt([],Ue(d.actions),!1)),c=d;break}}}catch(w){r={error:w}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=Tt(u.map(function(w){return o.getRelativeStateNodes(w,t.historyValue)})),C=!!c.internal;return{transitions:[c],exitSet:C?[]:Tt(u.map(function(w){return o.getPotentiallyReenteringNodes(w)})),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,c,l,f,d=this,p=a?us([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Le(Array.from(t).sort(function(_,L){return _.order-L.order})),E=v.next();!E.done;E=v.next()){var x=E.value;(!cs(p,x)||cs(r.exitSet,x)||x.parent&&h.has(x.parent))&&h.add(x)}}catch(_){u={error:_}}finally{try{E&&!E.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}try{for(var m=Le(p),C=m.next();!C.done;C=m.next()){var x=C.value;(!cs(t,x)||cs(r.exitSet,x.parent))&&r.exitSet.push(x)}}catch(_){l={error:_}}finally{try{C&&!C.done&&(f=m.return)&&f.call(m)}finally{if(l)throw l.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var w=Array.from(h).sort(function(_,L){return _.order-L.order}),b=new Set(r.exitSet),T=Tt(w.map(function(_){var L=[];if(_.type!=="final")return L;var V=_.parent;if(!V.parent)return L;L.push(Au(_.id,_.doneData),Au(V.id,_.doneData?Dc(_.doneData,i,o):void 0));var H=V.parent;return H.type==="parallel"&&js(H).every(function(R){return ac(r.configuration,R)})&&L.push(Au(H.id)),L})),A=w.map(function(_){var L=_.onEntry,V=_.activities.map(function(H){return XA(H)});return{type:"entry",actions:hi(s?mt(mt([],Ue(L),!1),Ue(V),!1):mt(mt([],Ue(V),!1),Ue(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:T.map(function(_){return GA(_)})}),D=Array.from(b).map(function(_){return{type:"exit",actions:hi(mt(mt([],Ue(_.onExit),!1),Ue(_.activities.map(function(L){return JA(L)})),!1),d.machine.options.actions)}}),I=D.concat({type:"transition",actions:hi(r.actions,this.machine.options.actions)}).concat(A);if(n){var N=hi(Tt(mt([],Ue(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:N})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=un(n),a;if(t instanceof er)a=r===void 0?t:this.resolveState(er.from(t,r));else{var s=ze(t)?this.resolve(Oc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(er.from(s,u))}if(!At&&o.name===Qa)throw new Error("An event cannot have the wildcard type ('".concat(Qa,"')"));if(this.strict&&!this.events.includes(o.name)&&!MA(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=us([],this.getStateNodes(a.value)),f=c.configuration.length?us(l,c.configuration):l;return c.configuration=mt([],Ue(f),!1),this.resolveTransition(c,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,mt([],Ue(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,c,l=this;o===void 0&&(o=pa);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=ac(p,this),v=d?u$(this.machine,f):void 0,E=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,x=this.getActions(new Set(p),h,t,r,o,n,i),m=n?ne({},n.activities):{};try{for(var C=Le(x),w=C.next();!w.done;w=C.next()){var b=w.value;try{for(var T=(u=void 0,Le(b.actions)),A=T.next();!A.done;A=T.next()){var D=A.value;D.type===gd?m[D.activity.id||D.activity.type]=D:D.type===ch&&(m[D.activity.id||D.activity.type]=!1)}}catch(K){u={error:K}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}}}catch(K){a={error:K}}finally{try{w&&!w.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}var I=Ue(Nc(this,n,r,o,x,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),N=I[0],_=I[1],L=Ue(_A(N,wd),2),V=L[0],H=L[1],R=N.filter(function(K){var ae;return K.type===gd&&((ae=K.activity)===null||ae===void 0?void 0:ae.type)===bd}),ie=R.reduce(function(K,ae){return K[ae.activity.id]=i$(ae.activity,l.machine,_,o),K},n?ne({},n.children):{}),B=new er({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?E?qA(E,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?H:[],activities:v?m:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:ie,done:h,tags:im(p),machine:this}),U=r!==_;B.changed=o.name===aS||U;var fe=B.history;fe&&delete fe.history;var M=!h&&(this._transient||f.some(function(K){return K._transient}));if(!d&&(!M||o.name===Qo))return B;var P=B;if(!h)for(M&&(P=this.resolveRaisedTransition(P,{type:IA},o,i));V.length;){var te=V.shift();P=this.resolveRaisedTransition(P,te._event,o,i)}var oe=P.changed||(fe?!!P.actions.length||U||typeof fe.value!=typeof P.value||!gS(P.value,fe.value):void 0);return P.changed=oe,P.history=fe,P},e.prototype.getStateNode=function(t){if(Bo(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=Bo(t)?t.slice(Id.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"&&Bo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=Cd(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||Lo;switch(this.type){case"parallel":return as(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Lo});case"compound":if(ze(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):Lo}):this.initialStateValue||{};default:return t||Lo}},e.prototype.getResolvedPath=function(t){if(Bo(t)){var n=this.machine.idMap[t.slice(Id.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return Cd(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=tm(this.states,function(r){return r.initialStateValue||Lo},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=Rc(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;ze(n.target)?t=Bo(n.target)?Oc(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(Rc(this))return[this];if(this.type==="compound"&&!this.initial)return At||Zt(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=rc(this.initialStateValue);return Tt(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=Ue(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:tm(this.states,function(n,r){if(!t)return n.historyValue();var i=ze(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?Tt(rc(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=kA(r.path,"states")(t).current;return ze(o)?[r.getStateNode(o)]:Tt(rc(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=Tt(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=Le(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,l=o[c];if(l.states)try{for(var f=(r=void 0,Le(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}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(!ze(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 p=r._nextState(d);r.update(p,d)}),r._state},this.sendTo=function(l,f,d){var p=r.parent&&(f===mo.Parent||r.parent.id===f),h=p?r.parent:ze(f)?f===mo.Internal?r:r.children.get(f)||Xa.get(f):FA(f)?f:void 0;if(!h){if(!p)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));At||Zt(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(l.type));return}if("machine"in h){if(r.status!==Ot.Stopped||r.parent!==h||r.state.done){var v=ne(ne({},l),{name:l.name===AA?"".concat(as(r.id)):l.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,v]):h.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,l.data]):h.send(l.data)},this._exec=function(l,f,d,p){p===void 0&&(p=r.machine.options.actions);var h=l.exec||xd(l.type,p),v=Je(h)?h:h?h.exec:l.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:l,_event:d}:{action:l,state:r.state,_event:d})}catch(H){throw r.parent&&r.parent.send({type:"xstate.error",data:H}),H}switch(l.type){case iu:{var E=l;r.defer(E);break}case bl:var x=l;if(typeof x.delay=="number"){r.defer(x);return}else x.to?r.sendTo(x._event,x.to,d===da):r.send(x._event);break;case iS:r.cancel(l.sendId);break;case gd:{if(r.status!==Ot.Running)return;var m=l.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[m.id||m.type])break;if(m.type===dt.Invoke){var S=pS(m.src),C=r.machine.options.services?r.machine.options.services[S.type]:void 0,b=m.id,T=m.data;At||Zt(!("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(!C){At||Zt(!1,"No service found for invocation '".concat(m.src,"' in machine '").concat(r.machine.id,"'."));return}var D=T?Dc(T,f,d):void 0;if(typeof C=="string")return;var I=Je(C)?C(f,d.data,{data:D,src:S,meta:m.meta}):C;if(!I)return;var N=void 0;Hr(I)&&(I=D?I.withContext(D):I,N={autoForward:A}),r.spawn(I,b,N)}else r.spawnActivity(m);break}case ch:{r.stopChild(l.activity.id);break}case oS:var _=l,L=_.label,V=_.value;L?r.logger(L,V):r.logger(V);break;default:At||Zt(!1,"No implementation found for action type '".concat(l.type,"'"));break}};var i=ne(ne({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,c=u!==void 0?u:t.id;this.id=c,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new om({deferEvents:this.options.deferEvents}),this.sessionId=Xa.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:Xo(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return At||Zt(this.status!==Ot.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=Le(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,c,l,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===da)&&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 p=Le(this.eventListeners),h=p.next();!h.done;h=p.next()){var v=h.value;v(t.event)}}catch(I){r={error:I}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var E=Le(this.listeners),x=E.next();!x.done;x=E.next()){var v=x.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{x&&!x.done&&(a=E.return)&&a.call(E)}finally{if(o)throw o.error}}try{for(var m=Le(this.contextListeners),S=m.next();!S.done;S=m.next()){var C=S.value;C(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{S&&!S.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(this.state.done){var b=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),T=b&&b.doneData?Dc(b.doneData,t.context,n):void 0;this._doneEvent=oc(this.id,T);try{for(var A=Le(this.doneListeners),D=A.next();!D.done;D=A.next()){var v=D.value;v(this._doneEvent)}}catch(I){c={error:I}}finally{try{D&&!D.done&&(l=A.return)&&l.call(A)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),Xa.free(this.sessionId)}},e.prototype.onTransition=function(t){return this.listeners.add(t),this.status===Ot.Running&&t(this.state,this.state.event),this},e.prototype.subscribe=function(t,n,r){var i=this,o=ic(t,n,r);this.listeners.add(o.next),this.status!==Ot.NotStarted&&o.next(this.state);var a=function(){i.doneListeners.delete(a),i.stopListeners.delete(a),o.complete()};return this.status===Ot.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===Ot.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===Ot.Running)return this;this.machine._init(),Xa.register(this.sessionId,this),this.initialized=!0,this.status=Ot.Running;var r=t===void 0?this.initialState:Xo(this,function(){return l$(t)?n.machine.resolveState(t):n.machine.resolveState(er.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,da)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){Je(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,c,l;try{for(var f=Le(this.listeners),d=f.next();!d.done;d=f.next()){var p=d.value;this.listeners.delete(p)}}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 h=Le(this.stopListeners),v=h.next();!v.done;v=h.next()){var p=v.value;p(),this.stopListeners.delete(p)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var E=Le(this.contextListeners),x=E.next();!x.done;x=E.next()){var p=x.value;this.contextListeners.delete(p)}}catch(A){o={error:A}}finally{try{x&&!x.done&&(a=E.return)&&a.call(E)}finally{if(o)throw o.error}}try{for(var m=Le(this.doneListeners),S=m.next();!S.done;S=m.next()){var p=S.value;this.doneListeners.delete(p)}}catch(A){s={error:A}}finally{try{S&&!S.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=Ot.Stopped,this._initialState=void 0;try{for(var C=Le(Object.keys(this.delayedEventsMap)),b=C.next();!b.done;b=C.next()){var T=b.value;this.clock.clearTimeout(this.delayedEventsMap[T])}}catch(A){c={error:A}}finally{try{b&&!b.done&&(l=C.return)&&l.call(C)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new om({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=un({type:"xstate.stop"}),o=Xo(t,function(){var a=Tt(mt([],Ue(t.state.configuration),!1).sort(function(f,d){return d.order-f.order}).map(function(f){return di(f.onExit,t.machine.options.actions)})),s=Ue(Nc(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],c=s[1],l=new er({value:t.state.value,context:c,_event:i,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:u.filter(function(f){return!Cd(f)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return l.changed=!0,l});t.update(o,i),t._stopChildren(),Xa.free(t.sessionId)}}),this},e.prototype.batch=function(t){var n=this;if(this.status===Ot.NotStarted&&this.options.deferEvents)At||Zt(!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!==Ot.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=[],c=function(p){var h=un(p);n.forward(h),a=Xo(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),u.push.apply(u,mt([],Ue(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return f$(v,a)})),!1)),s=s||!!a.changed};try{for(var l=Le(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,un(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=un(t);if(i.name.indexOf(Zv)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Zv)===0}))throw i.data.data;var o=Xo(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=Le(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),Je(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Ot.Running)return ph(t,n);if(nm(t))return this.spawnPromise(Promise.resolve(t),n);if(Je(t))return this.spawnCallback(t,n);if(o$(t))return this.spawnActor(t,n);if(qA(t))return this.spawnObservable(t,n);if(Hr(t))return this.spawnMachine(t,ne(ne({},r),{id:n}));if(MA(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({},Td),n);o.sync&&i.onTransition(function(s){r.send(aS,{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(un(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=m$(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(un(oc(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=as(n,u);try{i.send(un(c,{origin:n}))}catch(l){VA(u,l,n),i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,c,l){var f=ic(u,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[fi]=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,c=function(d){u=d,s.forEach(function(p){return p(d)}),!o&&i.send(un(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(as(n,d))}if(nm(l))return this.spawnPromise(l,n);var f=(r={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=ic(d);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){o=!0,Je(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[fi]=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(un(u,{origin:n}))},function(u){i.removeChild(n),i.send(un(as(n,u),{origin:n}))},function(){i.removeChild(n),i.send(un(oc(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,c,l){return t.subscribe(u,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[fi]=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){At||Zt(!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[fi]=function(){return this},r))},e.prototype.attachDev=function(){var t=hh();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)}v$(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[fi]=function(){return this},e.prototype.getSnapshot=function(){return this.status===Ot.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=bS,e}(),g$=function(e){return ze(e)?ne(ne({},Td),{name:e}):ne(ne(ne({},Td),{name:LA()}),e)};function am(e,t){var n=g$(t);return n$(function(r){if(!At){var i=Hr(e)||Je(e);Zt(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Hr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):ph(e,n.name)})}function bS(e,t){var n=new y$(e,t);return n}function b$(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function $u(e){return ne(ne({type:bd},e),{toJSON:function(){e.onDone,e.onError;var t=uh(e,["onDone","onError"]);return ne(ne({},t),{type:bd,src:b$(e.src)})}})}var Jo="",Id="#",Ja="*",Fo={},Lo=function(e){return e[0]===Id},S$=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},w$=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(ze(o.target)||Hr(o.target))}),i=t===Jo?"the transient event":"event '".concat(t,"'");Zt(!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.")},C$=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(S$(),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:sS),this.id=this.config.id||mt([this.machine.key],Ue(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,At||Zt(!("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?os(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,ne((f={},f[d.id]=d,f),d.idMap)),d}):Fo;var s=0;function u(c){var l,f;c.order=s++;try{for(var d=Le(vS(c)),p=d.next();!p.done;p=d.next()){var h=p.value;u(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.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(c){var l=c.event;return l===Jo}):Jo in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=lr(this.config.entry||this.config.onEntry).map(function(c){return ks(c)}),this.onExit=lr(this.config.exit||this.config.onExit).map(function(c){return ks(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=lr(this.config.invoke).map(function(c,l){var f,d;if(Hr(c)){var p=Iu(o.id,l);return o.machine.options.services=ne((f={},f[p]=c,f),o.machine.options.services),$u({src:p,id:p})}else if(ze(c.src)){var p=c.id||Iu(o.id,l);return $u(ne(ne({},c),{id:p,src:c.src}))}else if(Hr(c.src)||Je(c.src)){var p=c.id||Iu(o.id,l);return o.machine.options.services=ne((d={},d[p]=c.src,d),o.machine.options.services),$u(ne(ne({id:p},c),{src:p}))}else{var h=c.src;return $u(ne(ne({id:Iu(o.id,l)},c),{src:h}))}}),this.activities=lr(this.config.activities).concat(this.invoke).map(function(c){return dh(c)}),this.transition=this.transition.bind(this),this.tags=lr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||mS(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 Je(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:os(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===Jo,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===Ja});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=Je(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=ZA(s,t.id);return t.onEntry.push(wl(u,{delay:o})),t.onExit.push(KA(u)),u},i=Na(n)?n.map(function(o,a){var s=r(o.delay,a);return ne(ne({},o),{event:s})}):Tt(Object.keys(n).map(function(o,a){var s=n[o],u=ze(s)?{target:s}:s,c=isNaN(+o)?o:+o,l=r(c,a);return lr(u).map(function(f){return ne(ne({},f),{event:l,delay:c})})}));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 er?t.value:bs(t,this.delimiter);if(ze(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,mt([],Ue(Tt(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=uS(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof er?t:er.create(t),r=Array.from(ss([],this.getStateNodes(n.value)));return new er(ne(ne({},n),{value:this.resolve(n.value),configuration:r,done:ac(r,this),tags:im(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=Le(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,r);d&&(a[c]=d)}}}catch(x){i={error:x}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var p=Object.keys(a).map(function(x){return a[x]}),h=Tt(p.map(function(x){return x.transitions})),v=p.some(function(x){return x.transitions.length>0});if(!v)return this.next(n,r);var E=Tt(Object.keys(a).map(function(x){return a[x].configuration}));return{transitions:h,exitSet:Tt(p.map(function(x){return x.exitSet})),configuration:E,source:n,actions:Tt(Object.keys(a).map(function(x){return a[x].actions}))}},e.prototype._transition=function(t,n,r){return ze(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,un(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],c;try{for(var l=Le(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,E=h?ze(h)&&Lo(h)?t.matches(bs(this.getStateNodeById(h).path,this.delimiter)):fh(bs(h,this.delimiter),PA(this.path.slice(0,-2))(t.value)):!0,x=!1;try{x=!p||dS(this.machine,p,v,n,t)}catch(C){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
21
|
+
`).concat(C.message))}if(x&&E){d.target!==void 0&&(u=d.target),s.push.apply(s,mt([],Ue(d.actions),!1)),c=d;break}}}catch(C){r={error:C}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=Tt(u.map(function(C){return o.getRelativeStateNodes(C,t.historyValue)})),S=!!c.internal;return{transitions:[c],exitSet:S?[]:Tt(u.map(function(C){return o.getPotentiallyReenteringNodes(C)})),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,c,l,f,d=this,p=a?ss([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Le(Array.from(t).sort(function(_,L){return _.order-L.order})),E=v.next();!E.done;E=v.next()){var x=E.value;(!us(p,x)||us(r.exitSet,x)||x.parent&&h.has(x.parent))&&h.add(x)}}catch(_){u={error:_}}finally{try{E&&!E.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}try{for(var m=Le(p),S=m.next();!S.done;S=m.next()){var x=S.value;(!us(t,x)||us(r.exitSet,x.parent))&&r.exitSet.push(x)}}catch(_){l={error:_}}finally{try{S&&!S.done&&(f=m.return)&&f.call(m)}finally{if(l)throw l.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var C=Array.from(h).sort(function(_,L){return _.order-L.order}),b=new Set(r.exitSet),T=Tt(C.map(function(_){var L=[];if(_.type!=="final")return L;var V=_.parent;if(!V.parent)return L;L.push(Au(_.id,_.doneData),Au(V.id,_.doneData?Dc(_.doneData,i,o):void 0));var H=V.parent;return H.type==="parallel"&&Ms(H).every(function(R){return ac(r.configuration,R)})&&L.push(Au(H.id)),L})),A=C.map(function(_){var L=_.onEntry,V=_.activities.map(function(H){return YA(H)});return{type:"entry",actions:di(s?mt(mt([],Ue(L),!1),Ue(V),!1):mt(mt([],Ue(V),!1),Ue(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:T.map(function(_){return UA(_)})}),D=Array.from(b).map(function(_){return{type:"exit",actions:di(mt(mt([],Ue(_.onExit),!1),Ue(_.activities.map(function(L){return XA(L)})),!1),d.machine.options.actions)}}),I=D.concat({type:"transition",actions:di(r.actions,this.machine.options.actions)}).concat(A);if(n){var N=di(Tt(mt([],Ue(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Cd(_)});return I.concat({type:"stop",actions:N})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=un(n),a;if(t instanceof er)a=r===void 0?t:this.resolveState(er.from(t,r));else{var s=ze(t)?this.resolve(Oc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(er.from(s,u))}if(!At&&o.name===Ja)throw new Error("An event cannot have the wildcard type ('".concat(Ja,"')"));if(this.strict&&!this.events.includes(o.name)&&!kA(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=ss([],this.getStateNodes(a.value)),f=c.configuration.length?ss(l,c.configuration):l;return c.configuration=mt([],Ue(f),!1),this.resolveTransition(c,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,mt([],Ue(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,c,l=this;o===void 0&&(o=da);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=ac(p,this),v=d?s$(this.machine,f):void 0,E=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,x=this.getActions(new Set(p),h,t,r,o,n,i),m=n?ne({},n.activities):{};try{for(var S=Le(x),C=S.next();!C.done;C=S.next()){var b=C.value;try{for(var T=(u=void 0,Le(b.actions)),A=T.next();!A.done;A=T.next()){var D=A.value;D.type===gd?m[D.activity.id||D.activity.type]=D:D.type===ch&&(m[D.activity.id||D.activity.type]=!1)}}catch(K){u={error:K}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}}}catch(K){a={error:K}}finally{try{C&&!C.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}var I=Ue(Nc(this,n,r,o,x,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),N=I[0],_=I[1],L=Ue(jA(N,Cd),2),V=L[0],H=L[1],R=N.filter(function(K){var ae;return K.type===gd&&((ae=K.activity)===null||ae===void 0?void 0:ae.type)===bd}),ie=R.reduce(function(K,ae){return K[ae.activity.id]=r$(ae.activity,l.machine,_,o),K},n?ne({},n.children):{}),B=new er({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?E?_A(E,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?H:[],activities:v?m:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:ie,done:h,tags:im(p),machine:this}),U=r!==_;B.changed=o.name===aS||U;var fe=B.history;fe&&delete fe.history;var M=!h&&(this._transient||f.some(function(K){return K._transient}));if(!d&&(!M||o.name===Jo))return B;var P=B;if(!h)for(M&&(P=this.resolveRaisedTransition(P,{type:TA},o,i));V.length;){var te=V.shift();P=this.resolveRaisedTransition(P,te._event,o,i)}var oe=P.changed||(fe?!!P.actions.length||U||typeof fe.value!=typeof P.value||!gS(P.value,fe.value):void 0);return P.changed=oe,P.history=fe,P},e.prototype.getStateNode=function(t){if(Lo(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=Lo(t)?t.slice(Id.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"&&Lo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=wd(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||Fo;switch(this.type){case"parallel":return os(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Fo});case"compound":if(ze(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?os(t,function(o,a){return o?r.getStateNode(a).resolve(o):Fo}):this.initialStateValue||{};default:return t||Fo}},e.prototype.getResolvedPath=function(t){if(Lo(t)){var n=this.machine.idMap[t.slice(Id.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return wd(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=tm(this.states,function(r){return r.initialStateValue||Fo},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=Rc(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;ze(n.target)?t=Lo(n.target)?Oc(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(Rc(this))return[this];if(this.type==="compound"&&!this.initial)return At||Zt(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=rc(this.initialStateValue);return Tt(n.map(function(r){return t.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(t){if(!t.length)return[this];var n=Ue(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:tm(this.states,function(n,r){if(!t)return n.historyValue();var i=ze(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?Tt(rc(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=RA(r.path,"states")(t).current;return ze(o)?[r.getStateNode(o)]:Tt(rc(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=Tt(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=Le(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,l=o[c];if(l.states)try{for(var f=(r=void 0,Le(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}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(!ze(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=BA(t.target),i="internal"in t?t.internal:r?r.some(function(u){return ze(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=ne(ne({},t),{actions:di(lr(t.actions)),cond:fS(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=Ja,s=o[a],u=s===void 0?[]:s,c=uh(o,[typeof a=="symbol"?a:a+""]);i=Tt(Object.keys(c).map(function(m){!At&&m===Jo&&Zt(!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 S=qo(m,c[m]);return At||w$(r,m,S),S}).concat(qo(Ja,u)))}var l=this.config.always?qo("",this.config.always):[],f=this.config.onDone?qo(String(Au(this.id)),this.config.onDone):[];At||Zt(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var d=Tt(this.invoke.map(function(m){var S=[];return m.onDone&&S.push.apply(S,mt([],Ue(qo(String(oc(m.id)),m.onDone)),!1)),m.onError&&S.push.apply(S,mt([],Ue(qo(String(as(m.id)),m.onError)),!1)),S})),p=this.after,h=Tt(mt(mt(mt(mt([],Ue(f),!1),Ue(d),!1),Ue(i),!1),Ue(l),!1).map(function(m){return lr(m).map(function(S){return r.formatTransition(S)})}));try{for(var v=Le(p),E=v.next();!E.done;E=v.next()){var x=E.value;h.push(x)}}catch(m){t={error:m}}finally{try{E&&!E.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return h},e}(),sm=!1;function vh(e,t){return!At&&!("predictableActionArguments"in e)&&!sm&&(sm=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new C$(e,t)}var Nn=QA,x$=wl,SS=WA,Ou=e$,et={},mh={};(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!==Ot.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,c=arguments.length;u<c;u++){s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(a[l]=s[l])}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 c=0,u=Object.getOwnPropertySymbols(o);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(o,u[c])&&(s[u[c]]=o[u[c]]);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),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return l}function i(o,a,s){if(s||arguments.length===2)for(var u=0,c=a.length,l;u<c;u++)(l||!(u in a))&&(l||(l=Array.prototype.slice.call(a,0,u)),l[u]=a[u]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(mh);var wl={};(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={}))})(wl);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});var an=wl,T$=an.ActionTypes.Start,I$=an.ActionTypes.Stop,A$=an.ActionTypes.Raise,$$=an.ActionTypes.Send,O$=an.ActionTypes.Cancel,D$=an.ActionTypes.NullEvent,N$=an.ActionTypes.Assign,P$=an.ActionTypes.After,R$=an.ActionTypes.DoneState,k$=an.ActionTypes.Log,M$=an.ActionTypes.Init,j$=an.ActionTypes.Invoke,_$=an.ActionTypes.ErrorExecution,q$=an.ActionTypes.ErrorPlatform,F$=an.ActionTypes.ErrorCustom,L$=an.ActionTypes.Update,B$=an.ActionTypes.Choose,V$=an.ActionTypes.Pure;Ft.after=P$;Ft.assign=N$;Ft.cancel=O$;Ft.choose=B$;Ft.doneState=R$;Ft.error=F$;Ft.errorExecution=_$;Ft.errorPlatform=q$;Ft.init=M$;Ft.invoke=j$;Ft.log=k$;Ft.nullEvent=D$;Ft.pure=V$;Ft.raise=A$;Ft.send=$$;Ft.start=T$;Ft.stop=I$;Ft.update=L$;var CS={},ka={};Object.defineProperty(ka,"__esModule",{value:!0});var U$=".",G$={},z$="xstate.guard",W$="";ka.DEFAULT_GUARD_TYPE=z$;ka.EMPTY_ACTIVITY_MAP=G$;ka.STATE_DELIMITER=U$;ka.TARGETLESS_KEY=W$;var xl={};Object.defineProperty(xl,"__esModule",{value:!0});var H$=process.env.NODE_ENV==="production";xl.IS_PRODUCTION=H$;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=mh,n=wl,r=Ft,i=ka,o=xl,a;function s(y){return Object.keys(y)}function u(y,k,F){F===void 0&&(F=i.STATE_DELIMITER);var q=p(y,F),X=p(k,F);return U(X)?U(q)?X===q:!1:U(q)?q in X:Object.keys(q).every(function(Q){return Q in X?u(q[Q],X[Q]):!1})}function c(y){try{return U(y)||typeof y=="number"?"".concat(y):y.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(y){try{return U(y)||typeof y=="number"?"".concat(y):B(y)?y.name:y.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(y,k){try{return ie(y)?y:y.toString().split(k)}catch{throw new Error("'".concat(y,"' is not a valid state path."))}}function d(y){return typeof y=="object"&&"value"in y&&"context"in y&&"event"in y&&"_event"in y}function p(y,k){if(d(y))return y.value;if(ie(y))return h(y);if(typeof y!="string")return y;var F=f(y,k);return h(F)}function h(y){if(y.length===1)return y[0];for(var k={},F=k,q=0;q<y.length-1;q++)q===y.length-2?F[y[q]]=y[q+1]:(F[y[q]]={},F=F[y[q]]);return k}function v(y,k){for(var F={},q=Object.keys(y),X=0;X<q.length;X++){var Q=q[X];F[Q]=k(y[Q],Q,y,X)}return F}function E(y,k,F){var q,X,Q={};try{for(var le=t.__values(Object.keys(y)),se=le.next();!se.done;se=le.next()){var ge=se.value,Ae=y[ge];F(Ae)&&(Q[ge]=k(Ae,ge,y))}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}var x=function(y){return function(k){var F,q,X=k;try{for(var Q=t.__values(y),le=Q.next();!le.done;le=Q.next()){var se=le.value;X=X[se]}}catch(ge){F={error:ge}}finally{try{le&&!le.done&&(q=Q.return)&&q.call(Q)}finally{if(F)throw F.error}}return X}};function m(y,k){return function(F){var q,X,Q=F;try{for(var le=t.__values(y),se=le.next();!se.done;se=le.next()){var ge=se.value;Q=Q[k][ge]}}catch(Ae){q={error:Ae}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}}function C(y){if(!y)return[[]];if(U(y))return[[y]];var k=b(Object.keys(y).map(function(F){var q=y[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:C(y[F]).map(function(X){return[F].concat(X)})}));return k}function w(y){var k,F,q={};if(y&&y.length===1&&y[0].length===1)return y[0][0];try{for(var X=t.__values(y),Q=X.next();!Q.done;Q=X.next())for(var le=Q.value,se=q,ge=0;ge<le.length;ge++){var Ae=le[ge];if(ge===le.length-2){se[Ae]=le[ge+1];break}se[Ae]=se[Ae]||{},se=se[Ae]}}catch(jt){k={error:jt}}finally{try{Q&&!Q.done&&(F=X.return)&&F.call(X)}finally{if(k)throw k.error}}return q}function b(y){var k;return(k=[]).concat.apply(k,t.__spreadArray([],t.__read(y),!1))}function T(y){return ie(y)?y:[y]}function A(y){return y===void 0?[]:T(y)}function D(y,k,F){var q,X;if(B(y))return y(k,F.data);var Q={};try{for(var le=t.__values(Object.keys(y)),se=le.next();!se.done;se=le.next()){var ge=se.value,Ae=y[ge];B(Ae)?Q[ge]=Ae(k,F.data):Q[ge]=Ae}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}function I(y){return/^(done|error)\./.test(y)}function N(y){return!!(y instanceof Promise||y!==null&&(B(y)||typeof y=="object")&&B(y.then))}function _(y){return y!==null&&typeof y=="object"&&"transition"in y&&typeof y.transition=="function"}function L(y,k){var F,q,X=t.__read([[],[]],2),Q=X[0],le=X[1];try{for(var se=t.__values(y),ge=se.next();!ge.done;ge=se.next()){var Ae=ge.value;k(Ae)?Q.push(Ae):le.push(Ae)}}catch(jt){F={error:jt}}finally{try{ge&&!ge.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Q,le]}function V(y,k){return v(y.states,function(F,q){if(F){var X=(U(k)?void 0:k[q])||(F?F.current:void 0);if(X)return{current:X,states:V(F,X)}}})}function H(y,k){return{current:k,states:V(y,k)}}function R(y,k,F,q){o.IS_PRODUCTION||e.warn(!!y,"Attempting to update undefined context");var X=y&&F.reduce(function(Q,le){var se,ge,Ae=le.assignment,jt={state:q,action:le,_event:k},Gi={};if(B(Ae))Gi=Ae(Q,k.data,jt);else try{for(var kr=t.__values(Object.keys(Ae)),cr=kr.next();!cr.done;cr=kr.next()){var Ka=cr.value,zi=Ae[Ka];Gi[Ka]=B(zi)?zi(Q,k.data,jt):zi}}catch(vf){se={error:vf}}finally{try{cr&&!cr.done&&(ge=kr.return)&&ge.call(kr)}finally{if(se)throw se.error}}return Object.assign({},Q,Gi)},y);return X}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(y,k){var F=y instanceof Error?y:void 0;if(!(!F&&y)&&console!==void 0){var q=["Warning: ".concat(k)];F&&q.push(F),console.warn.apply(console,q)}});function ie(y){return Array.isArray(y)}function B(y){return typeof y=="function"}function U(y){return typeof y=="string"}function fe(y,k){if(y)return U(y)?{type:i.DEFAULT_GUARD_TYPE,name:y,predicate:k?k[y]:void 0}:B(y)?{type:i.DEFAULT_GUARD_TYPE,name:y.name,predicate:y}:y}function M(y){try{return"subscribe"in y&&B(y.subscribe)}catch{return!1}}var P=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[P]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(y){return!!y&&"__xstatenode"in y}function K(y){return!!y&&typeof y.send=="function"}var ae=function(){var y=0;return function(){return y++,y.toString(16)}}();function de(y,k){return U(y)||typeof y=="number"?t.__assign({type:y},k):y}function he(y,k){if(!U(y)&&"$$type"in y&&y.$$type==="scxml")return y;var F=de(y);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},k)}function xe(y,k){var F=T(k).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:y}:t.__assign(t.__assign({},q),{event:y})});return F}function Re(y){if(!(y===void 0||y===i.TARGETLESS_KEY))return A(y)}function De(y,k,F){if(!o.IS_PRODUCTION){var q=y.stack?" Stacktrace was '".concat(y.stack,"'"):"";if(y===k)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(y,"'.").concat(q));else{var X=k.stack?" Stacktrace was '".concat(k.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(y,"'. ").concat(q," Current error is '").concat(k,"'.").concat(X))}}}function ht(y,k,F,q,X){var Q=y.options.guards,le={state:X,cond:k,_event:q};if(k.type===i.DEFAULT_GUARD_TYPE)return((Q==null?void 0:Q[k.name])||k.predicate)(F,q.data,le);var se=Q==null?void 0:Q[k.type];if(!se)throw new Error("Guard '".concat(k.type,"' is not implemented on machine '").concat(y.id,"'."));return se(F,q.data,le)}function ce(y){return typeof y=="string"?{type:y}:y}function Dn(y,k,F){var q=function(){},X=typeof y=="object",Q=X?y:null;return{next:((X?y.next:y)||q).bind(Q),error:((X?y.error:k)||q).bind(Q),complete:((X?y.complete:F)||q).bind(Q)}}function ii(y,k){return"".concat(y,":invocation[").concat(k,"]")}function _o(y){return(y.type===r.raise||y.type===r.send&&y.to===n.SpecialTargets.Internal)&&typeof y.delay!="number"}e.createInvokeId=ii,e.evaluateGuard=ht,e.flatten=b,e.getActionType=l,e.getEventType=c,e.interopSymbols=te,e.isActor=K,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=M,e.isPromiseLike=N,e.isRaisableAction=_o,e.isStateLike=d,e.isString=U,e.keys=s,e.mapContext=D,e.mapFilterValues=E,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=Re,e.partition=L,e.path=x,e.pathToStateValue=h,e.pathsToStateValue=w,e.reportUnhandledExceptionOnInvocation=De,e.symbolObservable=P,e.toArray=A,e.toArrayStrict=T,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=ce,e.toObserver=Dn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=C,e.toStateValue=p,e.toTransitionConfigArray=xe,e.uniqueId=ae,e.updateContext=R,e.updateHistoryStates=V,e.updateHistoryValue=H})(CS);Object.defineProperty(et,"__esModule",{value:!0});var He=mh,sr=wl,nn=Ft,qe=CS,wS=xl,K$=qe.toSCXMLEvent({type:nn.init});function Ad(e,t){return t&&t[e]||void 0}function El(e,t){var n;if(qe.isString(e)||typeof e=="number"){var r=Ad(e,t);qe.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(qe.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Ad(e.type,t);if(qe.isFunction(r))n=He.__assign(He.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=He.__assign(He.__assign(He.__assign({},r),e),{type:i})}else n=e}return n}var $d=function(e,t){if(!e)return[];var n=qe.isArray(e)?e:[e];return n.map(function(r){return El(r,t)})};function yh(e){var t=El(e);return He.__assign(He.__assign({id:qe.isString(e)?e:t.id},t),{type:t.type})}function Y$(e,t){return{type:nn.raise,event:typeof e=="function"?e:qe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function xS(e,t,n,r){var i={_event:n},o=qe.toSCXMLEvent(qe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(qe.isString(e.delay)){var s=r&&r[e.delay];a=qe.isFunction(s)?s(t,n.data,i):s}else a=qe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return He.__assign(He.__assign({},e),{type:nn.raise,_event:o,delay:a})}function ou(e,t){return{to:t?t.to:void 0,type:nn.send,event:qe.isFunction(e)?e:qe.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:qe.isFunction(e)?e.name:qe.getEventType(e)}}function ES(e,t,n,r){var i={_event:n},o=qe.toSCXMLEvent(qe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(qe.isString(e.delay)){var s=r&&r[e.delay];a=qe.isFunction(s)?s(t,n.data,i):s}else a=qe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=qe.isFunction(e.to)?e.to(t,n.data,i):e.to;return He.__assign(He.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function gh(e,t){return ou(e,He.__assign(He.__assign({},t),{to:sr.SpecialTargets.Parent}))}function X$(e,t,n){return ou(t,He.__assign(He.__assign({},n),{to:e}))}function J$(){return gh(nn.update)}function Q$(e,t){return ou(e,He.__assign(He.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var Z$=function(e,t){return{context:e,event:t}};function eO(e,t){return e===void 0&&(e=Z$),{type:nn.log,label:t,expr:e}}var TS=function(e,t,n){return He.__assign(He.__assign({},e),{value:qe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},tO=function(e){return{type:nn.cancel,sendId:e}};function nO(e){var t=yh(e);return{type:sr.ActionTypes.Start,activity:t,exec:void 0}}function rO(e){var t=qe.isFunction(e)?e:yh(e);return{type:sr.ActionTypes.Stop,activity:t,exec:void 0}}function IS(e,t,n){var r=qe.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:sr.ActionTypes.Stop,activity:i};return o}var iO=function(e){return{type:nn.assign,assignment:e}};function oO(e){return typeof e=="object"&&"type"in e}function aO(e,t){var n=t?"#".concat(t):"";return"".concat(sr.ActionTypes.After,"(").concat(e,")").concat(n)}function sO(e,t){var n="".concat(sr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function uO(e,t){var n="".concat(sr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function cO(e,t){var n="".concat(sr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function lO(e){return{type:sr.ActionTypes.Pure,get:e}}function fO(e,t){if(!wS.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,He.__spreadArray([],He.__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 ou(function(r,i){return i},He.__assign(He.__assign({},t),{to:e}))}function dO(e,t){return gh(function(n,r,i){return{type:nn.error,data:qe.isFunction(e)?e(n,r,i):e}},He.__assign(He.__assign({},t),{to:sr.SpecialTargets.Parent}))}function pO(e){return{type:sr.ActionTypes.Choose,conds:e}}var hO=function(e){var t,n,r=[];try{for(var i=He.__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===nn.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 Od(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:hO(i),u=s.length?qe.updateContext(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var E;switch(v.type){case nn.raise:{var x=xS(v,u,r,e.options.delays);return o&&typeof x.delay=="number"&&o(x,u,r),x}case nn.send:var m=ES(v,u,r,e.options.delays);if(!wS.IS_PRODUCTION){var C=v.delay;qe.warn(!qe.isString(C)||typeof m.delay=="number","No delay reference for delay expression '".concat(C,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==sr.SpecialTargets.Internal&&(h==="entry"?l.push(m):o(m,u,r)),m;case nn.log:{var w=TS(v,u,r);return o==null||o(w,u,r),w}case nn.choose:{var b=v,T=(E=b.conds.find(function(B){var U=qe.toGuard(B.cond,e.options.guards);return!U||qe.evaluateGuard(e,U,u,r,o?void 0:t)}))===null||E===void 0?void 0:E.actions;if(!T)return[];var A=He.__read(Od(e,t,u,r,[{type:h,actions:$d(qe.toArray(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case nn.pure:{var T=v.get(u,r.data);if(!T)return[];var N=He.__read(Od(e,t,u,r,[{type:h,actions:$d(qe.toArray(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case nn.stop:{var w=IS(v,u,r);return o==null||o(w,n,r),w}case nn.assign:{u=qe.updateContext(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=El(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=He.__assign(He.__assign({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,He.__spreadArray([c[R]],He.__read(U),!1))}});V=ie}return V}}function d(h){var v,E,x=[];try{for(var m=He.__values(h.actions),C=m.next();!C.done;C=m.next()){var w=C.value,b=f(h.type,w);b&&(x=x.concat(b))}}catch(T){v={error:T}}finally{try{C&&!C.done&&(E=m.return)&&E.call(m)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,x}var p=qe.flatten(i.map(d));return[p,u]}et.actionTypes=nn;et.after=aO;et.assign=iO;et.cancel=tO;et.choose=pO;et.done=sO;et.doneInvoke=uO;et.error=cO;et.escalate=dO;et.forwardTo=fO;et.getActionFunction=Ad;et.initEvent=K$;et.isActionObject=oO;var Fn=et.log=eO,vO=et.pure=lO;et.raise=Y$;et.resolveActions=Od;et.resolveLog=TS;et.resolveRaise=xS;et.resolveSend=ES;et.resolveStop=IS;et.respond=Q$;et.send=ou;et.sendParent=gh;et.sendTo=X$;et.sendUpdate=J$;et.start=nO;var um=et.stop=rO;et.toActionObject=El;et.toActionObjects=$d;et.toActivityDefinition=yh;function AS(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Tl(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 $S(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 cm(e){return e.constructor===Object||e.constructor==null}function lm(e){return typeof e.then=="function"}function Il(e,t){return e===t||e!==e&&t!==t}var mO="[object Arguments]",yO="[object Boolean]",gO="[object Date]",bO="[object RegExp]",SO="[object Map]",CO="[object Number]",wO="[object Object]",xO="[object Set]",EO="[object String]",fm=Object.prototype.toString;function Al(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(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(cm(l)&&cm(f))return i(l,f,u,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,u,d);var v=fm.call(l);return v!==fm.call(f)?!1:v===gO?n(l,f,u,d):v===bO?o(l,f,u,d):v===SO?r(l,f,u,d):v===xO?a(l,f,u,d):v===wO||v===mO?lm(l)||lm(f)?!1:i(l,f,u,d):v===yO||v===CO||v===EO?Il(l.valueOf(),f.valueOf()):!1}return c}function OS(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 TO=Tl(OS);function DS(e,t){return Il(e.valueOf(),t.valueOf())}function NS(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 c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(u,d,a,l,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[l]=!0),l++}),a++,i=c}}),i}var IO=Tl(NS),AO="_owner",$O=Object.prototype.hasOwnProperty;function PS(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===AO){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!$O.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var OO=Tl(PS);function RS(e,t){return e.source===t.source&&e.flags===t.flags}function kS(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,c=0;t.forEach(function(l,f){!u&&!o[c]&&(u=n(a,l,s,f,e,t,r))&&(o[c]=!0),c++}),i=u}}),i}var DO=Tl(kS),MS=Object.freeze({areArraysEqual:OS,areDatesEqual:DS,areMapsEqual:NS,areObjectsEqual:PS,areRegExpsEqual:RS,areSetsEqual:kS,createIsNestedEqual:AS}),jS=Object.freeze({areArraysEqual:TO,areDatesEqual:DS,areMapsEqual:IO,areObjectsEqual:OO,areRegExpsEqual:RS,areSetsEqual:DO,createIsNestedEqual:AS}),NO=Al(MS);function PO(e,t){return NO(e,t,void 0)}Al($S(MS,{createIsNestedEqual:function(){return Il}}));Al(jS);Al($S(jS,{createIsNestedEqual:function(){return Il}}));var Dd={exports:{}},yf={},Du={exports:{}},gf={};/**
|
|
35
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,c=arguments.length;u<c;u++){s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(a[l]=s[l])}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 c=0,u=Object.getOwnPropertySymbols(o);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(o,u[c])&&(s[u[c]]=o[u[c]]);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),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return l}function i(o,a,s){if(s||arguments.length===2)for(var u=0,c=a.length,l;u<c;u++)(l||!(u in a))&&(l||(l=Array.prototype.slice.call(a,0,u)),l[u]=a[u]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(mh);var Cl={};(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={}))})(Cl);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});var an=Cl,E$=an.ActionTypes.Start,T$=an.ActionTypes.Stop,I$=an.ActionTypes.Raise,A$=an.ActionTypes.Send,$$=an.ActionTypes.Cancel,O$=an.ActionTypes.NullEvent,D$=an.ActionTypes.Assign,N$=an.ActionTypes.After,P$=an.ActionTypes.DoneState,R$=an.ActionTypes.Log,k$=an.ActionTypes.Init,M$=an.ActionTypes.Invoke,j$=an.ActionTypes.ErrorExecution,_$=an.ActionTypes.ErrorPlatform,q$=an.ActionTypes.ErrorCustom,F$=an.ActionTypes.Update,L$=an.ActionTypes.Choose,B$=an.ActionTypes.Pure;Ft.after=N$;Ft.assign=D$;Ft.cancel=$$;Ft.choose=L$;Ft.doneState=P$;Ft.error=q$;Ft.errorExecution=j$;Ft.errorPlatform=_$;Ft.init=k$;Ft.invoke=M$;Ft.log=R$;Ft.nullEvent=O$;Ft.pure=B$;Ft.raise=I$;Ft.send=A$;Ft.start=E$;Ft.stop=T$;Ft.update=F$;var wS={},Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});var V$=".",U$={},G$="xstate.guard",z$="";Pa.DEFAULT_GUARD_TYPE=G$;Pa.EMPTY_ACTIVITY_MAP=U$;Pa.STATE_DELIMITER=V$;Pa.TARGETLESS_KEY=z$;var xl={};Object.defineProperty(xl,"__esModule",{value:!0});var W$=process.env.NODE_ENV==="production";xl.IS_PRODUCTION=W$;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=mh,n=Cl,r=Ft,i=Pa,o=xl,a;function s(y){return Object.keys(y)}function u(y,k,F){F===void 0&&(F=i.STATE_DELIMITER);var q=p(y,F),X=p(k,F);return U(X)?U(q)?X===q:!1:U(q)?q in X:Object.keys(q).every(function(Q){return Q in X?u(q[Q],X[Q]):!1})}function c(y){try{return U(y)||typeof y=="number"?"".concat(y):y.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(y){try{return U(y)||typeof y=="number"?"".concat(y):B(y)?y.name:y.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(y,k){try{return ie(y)?y:y.toString().split(k)}catch{throw new Error("'".concat(y,"' is not a valid state path."))}}function d(y){return typeof y=="object"&&"value"in y&&"context"in y&&"event"in y&&"_event"in y}function p(y,k){if(d(y))return y.value;if(ie(y))return h(y);if(typeof y!="string")return y;var F=f(y,k);return h(F)}function h(y){if(y.length===1)return y[0];for(var k={},F=k,q=0;q<y.length-1;q++)q===y.length-2?F[y[q]]=y[q+1]:(F[y[q]]={},F=F[y[q]]);return k}function v(y,k){for(var F={},q=Object.keys(y),X=0;X<q.length;X++){var Q=q[X];F[Q]=k(y[Q],Q,y,X)}return F}function E(y,k,F){var q,X,Q={};try{for(var le=t.__values(Object.keys(y)),se=le.next();!se.done;se=le.next()){var ge=se.value,Ae=y[ge];F(Ae)&&(Q[ge]=k(Ae,ge,y))}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}var x=function(y){return function(k){var F,q,X=k;try{for(var Q=t.__values(y),le=Q.next();!le.done;le=Q.next()){var se=le.value;X=X[se]}}catch(ge){F={error:ge}}finally{try{le&&!le.done&&(q=Q.return)&&q.call(Q)}finally{if(F)throw F.error}}return X}};function m(y,k){return function(F){var q,X,Q=F;try{for(var le=t.__values(y),se=le.next();!se.done;se=le.next()){var ge=se.value;Q=Q[k][ge]}}catch(Ae){q={error:Ae}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}}function S(y){if(!y)return[[]];if(U(y))return[[y]];var k=b(Object.keys(y).map(function(F){var q=y[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:S(y[F]).map(function(X){return[F].concat(X)})}));return k}function C(y){var k,F,q={};if(y&&y.length===1&&y[0].length===1)return y[0][0];try{for(var X=t.__values(y),Q=X.next();!Q.done;Q=X.next())for(var le=Q.value,se=q,ge=0;ge<le.length;ge++){var Ae=le[ge];if(ge===le.length-2){se[Ae]=le[ge+1];break}se[Ae]=se[Ae]||{},se=se[Ae]}}catch(jt){k={error:jt}}finally{try{Q&&!Q.done&&(F=X.return)&&F.call(X)}finally{if(k)throw k.error}}return q}function b(y){var k;return(k=[]).concat.apply(k,t.__spreadArray([],t.__read(y),!1))}function T(y){return ie(y)?y:[y]}function A(y){return y===void 0?[]:T(y)}function D(y,k,F){var q,X;if(B(y))return y(k,F.data);var Q={};try{for(var le=t.__values(Object.keys(y)),se=le.next();!se.done;se=le.next()){var ge=se.value,Ae=y[ge];B(Ae)?Q[ge]=Ae(k,F.data):Q[ge]=Ae}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}function I(y){return/^(done|error)\./.test(y)}function N(y){return!!(y instanceof Promise||y!==null&&(B(y)||typeof y=="object")&&B(y.then))}function _(y){return y!==null&&typeof y=="object"&&"transition"in y&&typeof y.transition=="function"}function L(y,k){var F,q,X=t.__read([[],[]],2),Q=X[0],le=X[1];try{for(var se=t.__values(y),ge=se.next();!ge.done;ge=se.next()){var Ae=ge.value;k(Ae)?Q.push(Ae):le.push(Ae)}}catch(jt){F={error:jt}}finally{try{ge&&!ge.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Q,le]}function V(y,k){return v(y.states,function(F,q){if(F){var X=(U(k)?void 0:k[q])||(F?F.current:void 0);if(X)return{current:X,states:V(F,X)}}})}function H(y,k){return{current:k,states:V(y,k)}}function R(y,k,F,q){o.IS_PRODUCTION||e.warn(!!y,"Attempting to update undefined context");var X=y&&F.reduce(function(Q,le){var se,ge,Ae=le.assignment,jt={state:q,action:le,_event:k},Gi={};if(B(Ae))Gi=Ae(Q,k.data,jt);else try{for(var kr=t.__values(Object.keys(Ae)),cr=kr.next();!cr.done;cr=kr.next()){var Ha=cr.value,zi=Ae[Ha];Gi[Ha]=B(zi)?zi(Q,k.data,jt):zi}}catch(vf){se={error:vf}}finally{try{cr&&!cr.done&&(ge=kr.return)&&ge.call(kr)}finally{if(se)throw se.error}}return Object.assign({},Q,Gi)},y);return X}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(y,k){var F=y instanceof Error?y:void 0;if(!(!F&&y)&&console!==void 0){var q=["Warning: ".concat(k)];F&&q.push(F),console.warn.apply(console,q)}});function ie(y){return Array.isArray(y)}function B(y){return typeof y=="function"}function U(y){return typeof y=="string"}function fe(y,k){if(y)return U(y)?{type:i.DEFAULT_GUARD_TYPE,name:y,predicate:k?k[y]:void 0}:B(y)?{type:i.DEFAULT_GUARD_TYPE,name:y.name,predicate:y}:y}function M(y){try{return"subscribe"in y&&B(y.subscribe)}catch{return!1}}var P=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[P]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(y){return!!y&&"__xstatenode"in y}function K(y){return!!y&&typeof y.send=="function"}var ae=function(){var y=0;return function(){return y++,y.toString(16)}}();function de(y,k){return U(y)||typeof y=="number"?t.__assign({type:y},k):y}function he(y,k){if(!U(y)&&"$$type"in y&&y.$$type==="scxml")return y;var F=de(y);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},k)}function xe(y,k){var F=T(k).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:y}:t.__assign(t.__assign({},q),{event:y})});return F}function Re(y){if(!(y===void 0||y===i.TARGETLESS_KEY))return A(y)}function De(y,k,F){if(!o.IS_PRODUCTION){var q=y.stack?" Stacktrace was '".concat(y.stack,"'"):"";if(y===k)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(y,"'.").concat(q));else{var X=k.stack?" Stacktrace was '".concat(k.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(y,"'. ").concat(q," Current error is '").concat(k,"'.").concat(X))}}}function ht(y,k,F,q,X){var Q=y.options.guards,le={state:X,cond:k,_event:q};if(k.type===i.DEFAULT_GUARD_TYPE)return((Q==null?void 0:Q[k.name])||k.predicate)(F,q.data,le);var se=Q==null?void 0:Q[k.type];if(!se)throw new Error("Guard '".concat(k.type,"' is not implemented on machine '").concat(y.id,"'."));return se(F,q.data,le)}function ce(y){return typeof y=="string"?{type:y}:y}function Dn(y,k,F){var q=function(){},X=typeof y=="object",Q=X?y:null;return{next:((X?y.next:y)||q).bind(Q),error:((X?y.error:k)||q).bind(Q),complete:((X?y.complete:F)||q).bind(Q)}}function ni(y,k){return"".concat(y,":invocation[").concat(k,"]")}function jo(y){return(y.type===r.raise||y.type===r.send&&y.to===n.SpecialTargets.Internal)&&typeof y.delay!="number"}e.createInvokeId=ni,e.evaluateGuard=ht,e.flatten=b,e.getActionType=l,e.getEventType=c,e.interopSymbols=te,e.isActor=K,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=M,e.isPromiseLike=N,e.isRaisableAction=jo,e.isStateLike=d,e.isString=U,e.keys=s,e.mapContext=D,e.mapFilterValues=E,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=Re,e.partition=L,e.path=x,e.pathToStateValue=h,e.pathsToStateValue=C,e.reportUnhandledExceptionOnInvocation=De,e.symbolObservable=P,e.toArray=A,e.toArrayStrict=T,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=ce,e.toObserver=Dn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=S,e.toStateValue=p,e.toTransitionConfigArray=xe,e.uniqueId=ae,e.updateContext=R,e.updateHistoryStates=V,e.updateHistoryValue=H})(wS);Object.defineProperty(et,"__esModule",{value:!0});var He=mh,sr=Cl,nn=Ft,qe=wS,CS=xl,H$=qe.toSCXMLEvent({type:nn.init});function Ad(e,t){return t&&t[e]||void 0}function El(e,t){var n;if(qe.isString(e)||typeof e=="number"){var r=Ad(e,t);qe.isFunction(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(qe.isFunction(e))n={type:e.name||e.toString(),exec:e};else{var r=Ad(e.type,t);if(qe.isFunction(r))n=He.__assign(He.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=He.__assign(He.__assign(He.__assign({},r),e),{type:i})}else n=e}return n}var $d=function(e,t){if(!e)return[];var n=qe.isArray(e)?e:[e];return n.map(function(r){return El(r,t)})};function yh(e){var t=El(e);return He.__assign(He.__assign({id:qe.isString(e)?e:t.id},t),{type:t.type})}function K$(e,t){return{type:nn.raise,event:typeof e=="function"?e:qe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function xS(e,t,n,r){var i={_event:n},o=qe.toSCXMLEvent(qe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(qe.isString(e.delay)){var s=r&&r[e.delay];a=qe.isFunction(s)?s(t,n.data,i):s}else a=qe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;return He.__assign(He.__assign({},e),{type:nn.raise,_event:o,delay:a})}function ou(e,t){return{to:t?t.to:void 0,type:nn.send,event:qe.isFunction(e)?e:qe.toEventObject(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:qe.isFunction(e)?e.name:qe.getEventType(e)}}function ES(e,t,n,r){var i={_event:n},o=qe.toSCXMLEvent(qe.isFunction(e.event)?e.event(t,n.data,i):e.event),a;if(qe.isString(e.delay)){var s=r&&r[e.delay];a=qe.isFunction(s)?s(t,n.data,i):s}else a=qe.isFunction(e.delay)?e.delay(t,n.data,i):e.delay;var u=qe.isFunction(e.to)?e.to(t,n.data,i):e.to;return He.__assign(He.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function gh(e,t){return ou(e,He.__assign(He.__assign({},t),{to:sr.SpecialTargets.Parent}))}function Y$(e,t,n){return ou(t,He.__assign(He.__assign({},n),{to:e}))}function X$(){return gh(nn.update)}function J$(e,t){return ou(e,He.__assign(He.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var Q$=function(e,t){return{context:e,event:t}};function Z$(e,t){return e===void 0&&(e=Q$),{type:nn.log,label:t,expr:e}}var TS=function(e,t,n){return He.__assign(He.__assign({},e),{value:qe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},eO=function(e){return{type:nn.cancel,sendId:e}};function tO(e){var t=yh(e);return{type:sr.ActionTypes.Start,activity:t,exec:void 0}}function nO(e){var t=qe.isFunction(e)?e:yh(e);return{type:sr.ActionTypes.Stop,activity:t,exec:void 0}}function IS(e,t,n){var r=qe.isFunction(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:sr.ActionTypes.Stop,activity:i};return o}var rO=function(e){return{type:nn.assign,assignment:e}};function iO(e){return typeof e=="object"&&"type"in e}function oO(e,t){var n=t?"#".concat(t):"";return"".concat(sr.ActionTypes.After,"(").concat(e,")").concat(n)}function aO(e,t){var n="".concat(sr.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function sO(e,t){var n="".concat(sr.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function uO(e,t){var n="".concat(sr.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function cO(e){return{type:sr.ActionTypes.Pure,get:e}}function lO(e,t){if(!CS.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,He.__spreadArray([],He.__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 ou(function(r,i){return i},He.__assign(He.__assign({},t),{to:e}))}function fO(e,t){return gh(function(n,r,i){return{type:nn.error,data:qe.isFunction(e)?e(n,r,i):e}},He.__assign(He.__assign({},t),{to:sr.SpecialTargets.Parent}))}function dO(e){return{type:sr.ActionTypes.Choose,conds:e}}var pO=function(e){var t,n,r=[];try{for(var i=He.__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===nn.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 Od(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:pO(i),u=s.length?qe.updateContext(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var E;switch(v.type){case nn.raise:{var x=xS(v,u,r,e.options.delays);return o&&typeof x.delay=="number"&&o(x,u,r),x}case nn.send:var m=ES(v,u,r,e.options.delays);if(!CS.IS_PRODUCTION){var S=v.delay;qe.warn(!qe.isString(S)||typeof m.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==sr.SpecialTargets.Internal&&(h==="entry"?l.push(m):o(m,u,r)),m;case nn.log:{var C=TS(v,u,r);return o==null||o(C,u,r),C}case nn.choose:{var b=v,T=(E=b.conds.find(function(B){var U=qe.toGuard(B.cond,e.options.guards);return!U||qe.evaluateGuard(e,U,u,r,o?void 0:t)}))===null||E===void 0?void 0:E.actions;if(!T)return[];var A=He.__read(Od(e,t,u,r,[{type:h,actions:$d(qe.toArray(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case nn.pure:{var T=v.get(u,r.data);if(!T)return[];var N=He.__read(Od(e,t,u,r,[{type:h,actions:$d(qe.toArray(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case nn.stop:{var C=IS(v,u,r);return o==null||o(C,n,r),C}case nn.assign:{u=qe.updateContext(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=El(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=He.__assign(He.__assign({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,He.__spreadArray([c[R]],He.__read(U),!1))}});V=ie}return V}}function d(h){var v,E,x=[];try{for(var m=He.__values(h.actions),S=m.next();!S.done;S=m.next()){var C=S.value,b=f(h.type,C);b&&(x=x.concat(b))}}catch(T){v={error:T}}finally{try{S&&!S.done&&(E=m.return)&&E.call(m)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,x}var p=qe.flatten(i.map(d));return[p,u]}et.actionTypes=nn;et.after=oO;et.assign=rO;et.cancel=eO;et.choose=dO;et.done=aO;et.doneInvoke=sO;et.error=uO;et.escalate=fO;et.forwardTo=lO;et.getActionFunction=Ad;et.initEvent=H$;et.isActionObject=iO;var Fn=et.log=Z$,hO=et.pure=cO;et.raise=K$;et.resolveActions=Od;et.resolveLog=TS;et.resolveRaise=xS;et.resolveSend=ES;et.resolveStop=IS;et.respond=J$;et.send=ou;et.sendParent=gh;et.sendTo=Y$;et.sendUpdate=X$;et.start=tO;var um=et.stop=nO;et.toActionObject=El;et.toActionObjects=$d;et.toActivityDefinition=yh;function AS(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Tl(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 $S(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 cm(e){return e.constructor===Object||e.constructor==null}function lm(e){return typeof e.then=="function"}function Il(e,t){return e===t||e!==e&&t!==t}var vO="[object Arguments]",mO="[object Boolean]",yO="[object Date]",gO="[object RegExp]",bO="[object Map]",SO="[object Number]",wO="[object Object]",CO="[object Set]",xO="[object String]",fm=Object.prototype.toString;function Al(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(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(cm(l)&&cm(f))return i(l,f,u,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,u,d);var v=fm.call(l);return v!==fm.call(f)?!1:v===yO?n(l,f,u,d):v===gO?o(l,f,u,d):v===bO?r(l,f,u,d):v===CO?a(l,f,u,d):v===wO||v===vO?lm(l)||lm(f)?!1:i(l,f,u,d):v===mO||v===SO||v===xO?Il(l.valueOf(),f.valueOf()):!1}return c}function OS(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 EO=Tl(OS);function DS(e,t){return Il(e.valueOf(),t.valueOf())}function NS(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 c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(u,d,a,l,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[l]=!0),l++}),a++,i=c}}),i}var TO=Tl(NS),IO="_owner",AO=Object.prototype.hasOwnProperty;function PS(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===IO){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!AO.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var $O=Tl(PS);function RS(e,t){return e.source===t.source&&e.flags===t.flags}function kS(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,c=0;t.forEach(function(l,f){!u&&!o[c]&&(u=n(a,l,s,f,e,t,r))&&(o[c]=!0),c++}),i=u}}),i}var OO=Tl(kS),MS=Object.freeze({areArraysEqual:OS,areDatesEqual:DS,areMapsEqual:NS,areObjectsEqual:PS,areRegExpsEqual:RS,areSetsEqual:kS,createIsNestedEqual:AS}),jS=Object.freeze({areArraysEqual:EO,areDatesEqual:DS,areMapsEqual:TO,areObjectsEqual:$O,areRegExpsEqual:RS,areSetsEqual:OO,createIsNestedEqual:AS}),DO=Al(MS);function NO(e,t){return DO(e,t,void 0)}Al($S(MS,{createIsNestedEqual:function(){return Il}}));Al(jS);Al($S(jS,{createIsNestedEqual:function(){return Il}}));var Dd={exports:{}},yf={},Du={exports:{}},gf={};/**
|
|
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!==Ot.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 dm;function
|
|
43
|
+
*/var dm;function PO(){if(dm)return gf;dm=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 p=d(),h=r({inst:{value:p,getSnapshot:d}}),v=h[0].inst,E=h[1];return o(function(){v.value=p,v.getSnapshot=d,u(v)&&E({inst:v})},[f,p,d]),i(function(){return u(v)&&E({inst:v}),f(function(){u(v)&&E({inst:v})})},[f]),a(p),p}function u(f){var d=f.getSnapshot;f=f.value;try{var p=d();return!n(f,p)}catch{return!0}}function c(f,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return gf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,gf}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!==Ot.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 pm;function
|
|
51
|
+
*/var pm;function RO(){return pm||(pm=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(S){{for(var C=arguments.length,b=new Array(C>1?C-1:0),T=1;T<C;T++)b[T-1]=arguments[T];r("error",S,b)}}function r(S,C,b){{var T=t.ReactDebugCurrentFrame,A=T.getStackAddendum();A!==""&&(C+="%s",b=b.concat([A]));var D=b.map(function(I){return String(I)});D.unshift("Warning: "+C),Function.prototype.apply.call(console[S],console,D)}}function i(S,C){return S===C&&(S!==0||1/S===1/C)||S!==S&&C!==C}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue,l=!1,f=!1;function d(S,C,b){l||e.startTransition!==void 0&&(l=!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 T=C();if(!f){var A=C();o(T,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var D=a({inst:{value:T,getSnapshot:C}}),I=D[0].inst,N=D[1];return u(function(){I.value=T,I.getSnapshot=C,p(I)&&N({inst:I})},[S,T,C]),s(function(){p(I)&&N({inst:I});var _=function(){p(I)&&N({inst:I})};return S(_)},[S]),c(T),T}function p(S){var C=S.getSnapshot,b=S.value;try{var T=C();return!o(b,T)}catch{return!0}}function h(S,C,b){return C()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",E=!v,x=E?h:d,m=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x;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 hm;function _S(){return hm||(hm=1,process.env.NODE_ENV==="production"?Du.exports=PO():Du.exports=RO()),Du.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!==Ot.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 vm;function
|
|
59
|
+
*/var vm;function kO(){if(vm)return yf;vm=1;var e=O,t=_S();function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}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 yf.useSyncExternalStoreWithSelector=function(c,l,f,d,p){var h=o(null);if(h.current===null){var v={hasValue:!1,value:null};h.current=v}else v=h.current;h=s(function(){function x(T){if(!m){if(m=!0,S=T,T=d(T),p!==void 0&&v.hasValue){var A=v.value;if(p(A,T))return C=A}return C=T}if(A=C,r(S,T))return A;var D=d(T);return p!==void 0&&p(A,D)?A:(S=T,C=D)}var m=!1,S,C,b=f===void 0?null:f;return[function(){return x(l())},b===null?void 0:function(){return x(b())}]},[l,f,d,p]);var E=i(c,h[0],h[1]);return a(function(){v.hasValue=!0,v.value=E},[E]),u(E),E},yf}var Sf={};/**
|
|
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!==Ot.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 mm;function jO(){return mm||(mm=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=_S();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&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 c(l,f,d,p,h){var v=o(null),E;v.current===null?(E={hasValue:!1,value:null},v.current=E):E=v.current;var x=s(function(){var b=!1,T,A,D=function(L){if(!b){b=!0,T=L;var V=p(L);if(h!==void 0&&E.hasValue){var H=E.value;if(h(H,V))return A=H,H}return A=V,V}var R=T,ie=A;if(r(R,L))return ie;var B=p(L);return h!==void 0&&h(ie,B)?ie:(T=L,A=B,B)},I=d===void 0?null:d,N=function(){return D(f())},_=I===null?void 0:function(){return D(I())};return[N,_]},[f,d,p,h]),m=x[0],C=x[1],w=i(l,m,C);return a(function(){E.hasValue=!0,E.value=w},[w]),u(w),w}Sf.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Sf}process.env.NODE_ENV==="production"?Dd.exports=MO():Dd.exports=jO();var _O=Dd.exports,qO=O.useLayoutEffect;function ym(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var kc=globalThis&&globalThis.__assign||function(){return kc=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},kc.apply(this,arguments)},FO=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},LO=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 BO(e,t){var n=ym(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=LO(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,c=t.services,l=t.delays;t.state;var f=FO(t,["context","guards","actions","activities","services","delays","state"]),d=ym(function(){var p={context:o,guards:a,actions:s,activities:u,services:c,delays:l},h=n.withConfig(p,function(){return kc(kc({},n.context),o)});return bS(h,f)});return qO(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,c),Object.assign(d.machine.options.delays,l)},[s,a,u,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function VO(e,t,n){if(e.status===Ot.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var UO=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 GO(e){return e}function zO(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=UO(t,1),i=r[0],o=i===void 0?{}:i,a=BO(e,o),s=O.useCallback(function(){return a.status===Ot.NotStarted?o.state?er.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return VO(a,f,d)},[a]),c=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=_O.useSyncExternalStoreWithSelector(c,s,s,GO,u);return O.useEffect(function(){var f=o.state;return a.start(f?er.create(f):void 0),function(){a.stop(),a.status=Ot.NotStarted}},[]),[l,a.send,a]}const qS=O.createContext(null),FS=O.createContext(null),LS=O.createContext(null),BS=O.createContext(null),bh=()=>O.useContext(qS),Ma=()=>O.useContext(BS),VS="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 Sh(e){if(!e)throw new Error(VS)}function ja(e){if(!e)throw new Error(VS)}function au(){const e=bh();return Sh(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var WO=function(e){return e._tag==="Some"},$l=function(e){return function(t){return WO(e(t))}};const HO=$l(e=>e.type===Oe.Choice?Me(e):me),KO=$l(e=>e.type===Oe.Numeric?Me(e):me),YO=$l(e=>e.type===Oe.Boolean?Me(e):me),XO=$l(e=>e.type===Oe.Component?Me(e):me);function Ol(e){return e.decision!=null&&e.decision.kind===$r.Explicit}function US(e){return S(e.values,zt(Ol),z(t=>({type:Oe.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function JO(e){return S(e,tu(Ol),ee(()=>({type:Oe.Numeric,attributeId:e.id,state:null})))}function QO(e){return S(e,tu(Ol),ee(()=>({type:Oe.Boolean,attributeId:e.id,state:null})))}function ZO(e){return S(e,tu(Ol),ee(()=>({type:Oe.Component,attributeId:e.id,state:null})))}function eD(e,t){return S(No.filterAttributesOfComponent(t,e,!0),n=>[S(n,zt(HO),yE(US)),S(n,zt(KO),z(JO),Hn),S(n,zt(YO),z(QO),Hn),S(n,zt(XO),z(ZO),Hn)],Yp)}function GS(){const e=bh();return Sh(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 tD(e,t=!1){const n=Ma();return ja(n),O.useMemo(()=>S(Se(e),ee(Yn(z(r=>No.getAttribute(n,r)),t?$o(Se):ti)),at(()=>n.attributes)),[e,n,t])}function nD(e){const t=Ma(),{makeDecision:n,setManyDecision:r}=au(),i=Dl(e,Ut.choiceValue);ja(t);const o=No.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,c)=>n({type:Oe.Choice,attributeId:e,choiceValueId:u,state:c}),clearDecisions:S(o,Se,ee(US),Ht(Da),ee(u=>()=>r(u,{type:"Default"})),at(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function rD(e){const t=Ma(),{makeDecision:n}=au(),r=Dl(e,Ut.numeric);ja(t);const i=No.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 iD(e){const t=Ma(),{makeDecision:n}=au(),r=Dl(e,Ut.boolean);ja(t);const i=No.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 oD(e){const t=Ma(),{makeDecision:n,setManyDecision:r}=au(),i=Dl(e,Ut.component);ja(t);const o=t.attributes,a=No.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:c=>n({type:Oe.Component,attributeId:e,state:c}),clearSubtree:S(eD(e,o),tu(Da),ee(c=>()=>r(c,{type:"Default"})),at(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Dl(e,t){const{explain:n,applySolution:r}=GS();return O.useMemo(()=>({explain:(i,o)=>{const a=ue(i.question).with(Cn.whyIsNotSatisfied,()=>Ut.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 gm=On(nS),aD=On(rS),sD=On((e,t)=>gb(lt).equals(e??{},t??{})),uD=yn({attributeId:gm,decisions:ji(gm)}),cD=On((e,t)=>ji(uD).equals(e??[],t??[])),lD=yn({type:lt}),fD=yn({type:lt}),dD=yn({type:lt,rules:ji(aD)}),pD=On((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:on.all},y:{type:on.all}},({x:n,y:r})=>lD.equals(n,r)).with({x:{type:on.none},y:{type:on.none}},({x:n,y:r})=>fD.equals(n,r)).with({x:{type:on.specific},y:{type:on.specific}},({x:n,y:r})=>dD.equals(n,r)).otherwise(()=>!1)),hD=yn({rules:nu(pD)}),zS=yn({configurationModelSource:On((e,t)=>PO(e,t)),attributeRelations:cD,usageRuleParameters:sD,allowedInExplain:nu(hD)}),Nd=nu(zS),vD=Hp,sc=nu(vD),mD=()=>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:[Fn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Fn("Entering ProcessChanges","SessionManagement:"),Vo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Fn("Entering DisposeSession","SessionManagement:"),Vo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Fn("Entering CreateSession","SessionManagement:"),Vo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Fn("Entering SessionCreationFailed","SessionManagement:"),Vo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Fn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Fn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Fn("Entering UpdateSession","SessionManagement:"),Vo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Fn("Entering SessionUpdateFailed","SessionManagement:"),Vo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Fn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Fn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Nn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Nn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Nn((e,t)=>(e.session&&e.session.close().then(qr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Nn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Nn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Nn({sessionCreationError:()=>null}),setSessionUpdateError:Nn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Nn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Nn({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||!sc.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!zS.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!sc.equals(e.desiredClient,e.sessionCreationError.client)||!Nd.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!sc.equals(e.desiredClient,e.actualClient)||!Nd.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Vo(e){const t=e===0,n=e===1;return vO((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 SS({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const yD=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),gD=()=>vh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[SS((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Fn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Fn("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)=>yD(e.session)}}}},{actions:{saveSession:Nn((e,t)=>({session:t.session}))}}),bD=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},bm=()=>{const e=bD();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var SD=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]},Sm=function(e,t,n,r){return O.useEffect(e,SD(t,n,r))};const CD=()=>vh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:bm()},entry:[Nn({sessionManagementActor:()=>am(mD()),configurationSubscriptionManagementActor:()=>am(gD())})],exit:[um(e=>e.sessionManagementActor),um(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Ou(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Ou(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Ou(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Ou(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Nn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),E$(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Nn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Nn((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:bm())()}})}});function wD(e){var t,n;const[r,i]=zO(CD,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});Sm(()=>{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],jv(sc)),Sm(()=>{const u=S(Se(e.sessionContext),PE(c=>Se(c.configurationModelSource)),nr);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],jv(Nd));const o=O.useMemo(()=>{var u,c,l,f;return{isInitializing:((c=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=r.context.isReadyPromise)==null?void 0:l.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,c;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((c=r.context.sessionUpdating)==null?void 0:c.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 xD(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=wD({configuratorClient:t,sessionContext:n});return $.jsx(FS.Provider,{value:r,children:$.jsx(LS.Provider,{value:i,children:$.jsx(qS.Provider,{value:o,children:$.jsx(BS.Provider,{value:a,children:e.children})})})})}function WS(){return O.useContext(FS)}function ED(){return O.useContext(LS)}function TD(e){const{children:t}=e,{isInitializingPromise:n}=WS();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function ID(){const e=bh(),t=Ma();return Sh(e),ja(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const AD=Object.freeze(Object.defineProperty({__proto__:null,Configuration:xD,ConfigurationSuspender:TD,useAttributes:tD,useBooleanAttribute:iD,useChoiceAttribute:nD,useComponentAttribute:oD,useConfiguration:ID,useConfigurationInitialization:WS,useConfigurationUpdating:ED,useDecision:au,useExplain:GS,useNumericAttribute:rD},Symbol.toStringTag,{value:"Module"}));var $D=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))},OD=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},DD=function(e){var t=OD(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function Nr(e){return e}function Nl(e){return function(){return e}}var ND=Nl(null),HS=Nl(void 0),Lr=HS;function Xn(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 g(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 c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var Pr=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,$D([i],r,!1))}}},PD=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))},RD=function(e){return e._tag==="None"},Ch=function(e){return e._tag==="Some"},Pl={_tag:"None"},Rl=function(e){return{_tag:"Some",value:e}},kD=function(e){return e._tag==="Left"},kl=function(e){return{_tag:"Left",left:e}},Ml=function(e){return{_tag:"Right",right:e}},MD=function(e){return[e]},jD=function(e){return e.length>0},_D=function(e){return e[0]},qD=function(e){return e.slice(1)},FD=[],LD={},KS=Object.prototype.hasOwnProperty,BD=function(e){return PD([e[0]],e.slice(1),!0)};function VD(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 UD(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 YS(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):YS(e,t-1,i)}}function GD(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 YS(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 zD(e){return function(t){for(var n=Object.keys(t),r=n.length,i=GD(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function WD(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function HD(e){var t=UD(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function XS(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var KD=function(e){return function(){return Promise.resolve().then(e)}};function YD(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var jl=function(e,t){return g(e,JS(t))},wh=function(e,t){return g(e,XD(t))},JS=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},XD=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)})}}},su=function(e){return function(){return Promise.resolve(e)}},xh=Pr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),uu="Task",_l={URI:uu,map:jl},Eh={URI:uu,of:su},JD={URI:uu,map:jl,ap:wh},Th={URI:uu,map:jl,of:su,ap:wh,chain:xh},QD=Nr,Cm=xh,Mc={URI:uu,map:jl,of:su,ap:wh,chain:xh,fromIO:KD,fromTask:QD};function QS(e){return function(t){return function(n){return e.fromEither(RD(n)?kl(t()):Ml(n.value))}}}function ZD(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ml(o):kl(r(o)))})}}}var Ih=kl,ql=Ml,ZS=function(e,t){return g(e,t2(t))},e2=function(e,t){return g(e,i2(t))},Ah="Either",t2=function(e){return function(t){return Ai(t)?t:ql(e(t.right))}},n2={URI:Ah,map:ZS},r2=function(e){return function(t){return Ai(t)?t:Ai(e)?e:ql(t.right(e.right))}},i2=r2,o2={URI:Ah,map:ZS,ap:e2},a2=function(e){return function(t){return Ai(t)?Ih(e(t.left)):t}},eC={URI:Ah,fromEither:Nr},s2=QS(eC),Ai=kD,u2=function(e,t){return function(n){return Ai(n)?e(n.left):t(n.right)}},Qi=u2;eC.fromEither;var c2=function(e){return Ai(e)?ql(e.left):Ih(e.right)},Tn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},gn=function(e){return Tn(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 Tn(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},$h={equals:function(e,t){return e===t}};$h.equals;var l2=function(e){return function(t,n){return t===n||e(t,n)===0}},Fl=function(e){return{equals:l2(e),compare:function(t,n){return t===n?0:e(t,n)}}},xm=function(e){return function(t){return Fl(function(n,r){return t.compare(e(n),e(r))})}},f2=function(){return{concat:function(e,t){return Fl(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},d2=function(){return{concat:f2().concat,empty:Fl(function(){return 0})}},p2=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function h2(e,t){return e<t?-1:e>t?1:0}var v2={equals:$h.equals,compare:h2},m2=v2,y2=function(e){return{concat:p2(e)}},g2=y2,Em=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))},b2=FD,tC=jD,S2=function(e,t){return e<0||e>=t.length},C2=function(e){return function(t){return Em(Em([],t,!0),[e],!1)}},w2=C2,x2=function(e,t,n){if(n[e]===t)return n;var r=BD(n);return r[e]=t,r},E2=function(e){return function(t){if(t.length===1)return t;for(var n=[O2(t)],r=D2(t),i=function(u){n.every(function(c){return!e.equals(c,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},T2=function(e){if(tC(e)){var t=d2();return I2(e.reduce(t.concat,t.empty))}return Nr},nC=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);KS.call(n,a)?n[a].push(o):n[a]=[o]}return n}},I2=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},A2=MD,$2=_D,O2=$2,D2=qD,Ll={equals:function(e,t){return e===t}},rC={equals:Ll.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};Ll.equals,rC.compare;globalThis&&globalThis.__spreadArray;var jc=function(e){return e.length===0},Po=tC,N2=w2,P2=function(e){return function(t){if(jc(t))return Nh;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},iC=S2,R2=function(e){return function(t){return iC(e,t)?t:e===0?Nh:t.slice(0,e)}},k2=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Rl(n);return Pl}};function fn(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Rl(t[n]);return Pl}}var M2=function(e,t){return function(n){return iC(e,n)?Pl:Rl(V2(e,t(n[e]),n))}},j2=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}};function Oh(e){return function(t,n){if(n===void 0){var r=Oh(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 aa=function(e){var t=E2(e);return function(n){return Po(n)?t(n):n}},_2=function(e){var t=T2(e);return function(n){return Po(n)?t(n):n}},q2=function(e){return function(t){return jc(t)?e:jc(e)?t:t.concat(e)}},Pe=q2;function oC(e){var t=Oh(e);return function(n,r){if(r===void 0){var i=oC(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var F2=A2,aC=Pr(2,function(e,t){return g(e,P2(function(n,r){return t(r,n)}))}),Dh=aC(Nr),G=function(e){return function(t){return t.map(function(n){return e(n)})}},Wt=function(e){return function(t){return t.filter(e)}},L2=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}},Ro=function(e){return L2(function(t,n){return e(n)})},Kn=Ro(Nr),Pd=function(e,t){return B2(e,function(n,r,i){return t(r,i)})},B2=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}},qi=function(e){return Tn(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},V2=function(e,t,n){return Po(n)?x2(e,t,n):n},Rd=function(e){return e.slice()},Tm=function(e){return jc(e)?Nh:e.slice()},Nh=b2,U2=aC,G2=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 Hi(e){return fn(e)}var uc=function(e){return function(t){return t.map(function(n){return e(n)})}},z2=Pr(2,function(e,t){return g(e,G2(function(n,r){return t(r,n)}))}),W2=z2(Nr),H2=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}},ai=function(e){return H2(function(t,n){return e(n)})},K2=function(e){return function(t){return t.filter(e)}},sC=function(e){return function(t){return Xn(e,t)}},Y2=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ye=Pl,je=Rl;function cu(e){return function(t){return e(t)?je(t):ye}}var uC=function(e,t){return g(e,Z(t))},cC=function(e,t){return g(e,X2(t))},lC="Option",ko=function(e){return{equals:function(t,n){return t===n||(gr(t)?gr(n):gr(n)?!1:e.equals(t.value,n.value))}}},Z=function(e){return function(t){return gr(t)?ye:je(e(t.value))}},bi=je,X2=function(e){return function(t){return gr(t)||gr(e)?ye:je(t.value(e.value))}},J2={URI:lC,map:uC,ap:cC,of:bi},Ph=Pr(2,function(e,t){return gr(e)?ye:t(e.value)}),Q2={URI:lC,map:uC,ap:cC,chain:Ph},Z2=Pr(2,function(e,t){return gr(e)?t():e}),Im=Z2,eN=Ph(Nr),Vt=function(e){return function(t){return gr(t)?ye:e(t.value)?t:ye}},ls=Ch,gr=function(e){return e._tag==="None"},tN=function(e,t){return function(n){return gr(n)?e():t(n.value)}},$i=tN,fC=$i,nN=function(e){return function(t){return gr(t)?e():t.value}},st=nN,kd=eN,rN=Pr(2,XS(Q2)),be=function(e){return e==null?ye:je(e)},Vn=$i(ND,Nr),Mt=$i(HS,Nr),ir=Ph,iN=rN,oN=HD(J2);function aN(e){return Xn(ql,e.of)}function sN(e){return Xn(Ih,e.of)}function uN(e){return WD(e,n2)}function cN(e){return VD(e,o2)}function lN(e){return function(t,n){return e.chain(t,function(r){return Ai(r)?e.of(r):n(r.right)})}}function fN(e){return function(t,n){return e.map(t,a2(n))}}function dN(e){return function(t,n){return function(r){return e.map(r,Qi(t,n))}}}function pN(e){return function(t){return function(n){return e.chain(n,function(r){return Ai(r)?t(r.left):e.of(r)})}}}function hN(e){return function(t){return e.map(t,c2)}}var vN=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(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},mN=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(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},zr=sN(Eh),_a=aN(Eh),yN=su,gN=function(e){return JS(s2(e))},_c=dN(_l),Am=function(e,t){return function(){return vN(void 0,void 0,void 0,function(){var n;return mN(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ml)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,kl(t(n))];case 3:return[2]}})})}},dC=pN(Th),$m=hN(_l),pC=function(e,t){return g(e,Yt(t))},hC=function(e,t){return g(e,SN(t))},Yt=uN(_l),bN=Pr(2,fN(_l)),vr=bN,SN=cN(JD),vC=Pr(2,lN(Th)),sa=_a,Rh="TaskEither",CN={URI:Rh,map:pC,ap:hC,of:sa},mC={URI:Rh,map:pC,ap:hC,chain:vC},kh={URI:Rh,fromEither:yN},wN=Pr(2,XS(mC)),Mh=QS(kh);kh.fromEither;var xN=ZD(kh,mC),EN=sa(LD),pr=vC,TN=wN;function IN(e){return t=>g(t,Yt(n=>(e(n)(),n)))}const _s=IN;function qc(e){return t=>g(t,$m,_s(e),$m)}function AN(e){return t=>g(t,_s(n=>()=>e(n)()),qc(n=>()=>e(n)()))}function $N(e){return t=>g(t,Z(n=>(e(n)(),n)))}const ON=$N;function DN(e){return Xn(je,e.of)}function NN(e){return Nl(e.of(ye))}function PN(e){var t=NN(e);return function(n,r){return e.chain(n,$i(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var RN=DN(Eh),kN=su,MN=Pr(2,PN(Th)),jN=MN,_N=DD,ft={equals:function(e,t){return e===t}},Md={equals:ft.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},qN=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function jh(e){if(typeof e=="function")return jh(Md)(e);var t=qN(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 yC(e){return function(t,n){if(n===void 0){var r=yC(e);return function(o){return r(o,t)}}for(var i in t)if(!KS.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function gC(e){var t=yC(e);return Tn(function(n,r){return t(n)(r)&&t(r)(n)})}function FN(e){return Tn((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}const LN=Fl(()=>0);var _h={equals:function(e,t){return e===t}},BN={equals:_h.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};const kn=Symbol.for("@ts-pattern/matcher"),bC=Symbol.for("@ts-pattern/isVariadic"),Fc="@ts-pattern/anonymous-select-key",jd=e=>!!(e&&typeof e=="object"),cc=e=>e&&!!e[kn],mn=(e,t,n)=>{if(cc(e)){const r=e[kn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(jd(e)){if(!jd(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];cc(s)&&s[bC]?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((c,l)=>mn(c,a[l],n))&&i.every((c,l)=>mn(c,s[l],n))&&(o.length===0||mn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>mn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||cc(o=i)&&o[kn]().matcherType==="optional")&&mn(i,t[r],n);var o})}return Object.is(t,e)},Wn=e=>{var t,n,r;return jd(e)?cc(e)?(t=(n=(r=e[kn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?qs(e,Wn):qs(Object.values(e),Wn):[]},qs=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function VN(...e){if(e.length===1){const[t]=e;return n=>mn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return mn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function xn(e){return Object.assign(e,{optional:()=>qh(e),and:t=>Et(e,t),or:t=>SC(e,t),select:t=>t===void 0?Fs(e):Fs(t,e)})}function _d(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[bC]:!0})}}))(e),{optional:()=>_d(qh(e)),select:t=>_d(t===void 0?Fs(e):Fs(t,e))})}function qh(e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Wn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:mn(e,t,r),selections:n}},getSelectionKeys:()=>Wn(e),matcherType:"optional"})})}const UN=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},GN=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function Et(...e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>qs(e,Wn),matcherType:"and"})})}function SC(...e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return qs(e,Wn).forEach(i=>r(i,void 0)),{matched:e.some(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>qs(e,Wn),matcherType:"or"})})}function Xe(e){return{[kn]:()=>({match:t=>({matched:!!e(t)})})}}function Fs(...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 xn({[kn]:()=>({match:r=>{let i={[t??Fc]:r};return{matched:n===void 0||mn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Fc].concat(n===void 0?[]:Wn(n))})})}function xr(e){return typeof e=="number"}function Zi(e){return typeof e=="string"}function li(e){return typeof e=="bigint"}const CC=xn(Xe(function(e){return!0})),zN=CC,eo=e=>Object.assign(xn(e),{startsWith:t=>{return eo(Et(e,(n=t,Xe(r=>Zi(r)&&r.startsWith(n)))));var n},endsWith:t=>{return eo(Et(e,(n=t,Xe(r=>Zi(r)&&r.endsWith(n)))));var n},minLength:t=>eo(Et(e,(n=>Xe(r=>Zi(r)&&r.length>=n))(t))),maxLength:t=>eo(Et(e,(n=>Xe(r=>Zi(r)&&r.length<=n))(t))),includes:t=>{return eo(Et(e,(n=t,Xe(r=>Zi(r)&&r.includes(n)))));var n},regex:t=>{return eo(Et(e,(n=t,Xe(r=>Zi(r)&&!!r.match(n)))));var n}}),WN=eo(Xe(Zi)),Er=e=>Object.assign(xn(e),{between:(t,n)=>Er(Et(e,((r,i)=>Xe(o=>xr(o)&&r<=o&&i>=o))(t,n))),lt:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r<n))(t))),gt:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r>n))(t))),lte:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r<=n))(t))),gte:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r>=n))(t))),int:()=>Er(Et(e,Xe(t=>xr(t)&&Number.isInteger(t)))),finite:()=>Er(Et(e,Xe(t=>xr(t)&&Number.isFinite(t)))),positive:()=>Er(Et(e,Xe(t=>xr(t)&&t>0))),negative:()=>Er(Et(e,Xe(t=>xr(t)&&t<0)))}),HN=Er(Xe(xr)),fi=e=>Object.assign(xn(e),{between:(t,n)=>fi(Et(e,((r,i)=>Xe(o=>li(o)&&r<=o&&i>=o))(t,n))),lt:t=>fi(Et(e,(n=>Xe(r=>li(r)&&r<n))(t))),gt:t=>fi(Et(e,(n=>Xe(r=>li(r)&&r>n))(t))),lte:t=>fi(Et(e,(n=>Xe(r=>li(r)&&r<=n))(t))),gte:t=>fi(Et(e,(n=>Xe(r=>li(r)&&r>=n))(t))),positive:()=>fi(Et(e,Xe(t=>li(t)&&t>0))),negative:()=>fi(Et(e,Xe(t=>li(t)&&t<0)))}),KN=fi(Xe(li)),YN=xn(Xe(function(e){return typeof e=="boolean"})),XN=xn(Xe(function(e){return typeof e=="symbol"})),JN=xn(Xe(function(e){return e==null}));var Ve={__proto__:null,matcher:kn,optional:qh,array:function(...e){return _d({[kn]:()=>({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 Wn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>mn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Wn(e[0])})})},set:function(...e){return xn({[kn]:()=>({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:UN(t,o=>mn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Wn(e[0])})})},map:function(...e){return xn({[kn]:()=>({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:GN(t,(s,u)=>{const c=mn(o,u,r),l=mn(a,s,r);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Wn(e[0]),...Wn(e[1])]})})},intersection:Et,union:SC,not:function(e){return xn({[kn]:()=>({match:t=>({matched:!mn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Xe,select:Fs,any:CC,_:zN,string:WN,number:HN,bigint:KN,boolean:YN,symbol:XN,nullish:JN,instanceOf:function(e){return xn(Xe(function(t){return n=>n instanceof t}(e)))},shape:function(e){return xn(Xe(VN(e)))}};const qd={matched:!1,value:void 0};function Y(e){return new QN(e,qd)}let QN=class Fd{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=(c,l)=>{o=!0,a[c]=l},u=!r.some(c=>mn(c,this.input,s))||i&&!i(this.input)?qd:{matched:!0,value:n(o?Fc in a?a[Fc]:a:this.input,this.input)};return new Fd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new Fd(this.input,r?{matched:!0,value:n(this.input,this.input)}:qd)}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 ZN=Object.getOwnPropertyNames,eP=Object.getOwnPropertySymbols,tP=Object.prototype.hasOwnProperty;function Om(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Nu(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 ZN(e).concat(eP(e))}var wC=Object.hasOwn||function(e,t){return tP.call(e,t)};function qa(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var xC="_owner",Nm=Object.getOwnPropertyDescriptor,Pm=Object.keys;function nP(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 rP(e,t){return qa(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(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],E=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,E,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function iP(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===xC&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!wC(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function Za(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===xC&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!wC(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 oP(e,t){return qa(e.valueOf(),t.valueOf())}function aP(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,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function sP(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 uP="[object Arguments]",cP="[object Boolean]",lP="[object Date]",fP="[object Map]",dP="[object Number]",pP="[object Object]",hP="[object RegExp]",vP="[object Set]",mP="[object String]",yP=Array.isArray,Mm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,jm=Object.assign,gP=Object.prototype.toString.call.bind(Object.prototype.toString);function bP(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(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(yP(l))return t(l,f,d);if(Mm!=null&&Mm(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=gP(l);return h===lP?n(l,f,d):h===hP?a(l,f,d):h===fP?r(l,f,d):h===vP?s(l,f,d):h===pP?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===uP?i(l,f,d):h===cP||h===dP||h===mP?o(l,f,d):!1}}function SP(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?Za:nP,areDatesEqual:rP,areMapsEqual:r?Om(Rm,Za):Rm,areObjectsEqual:r?Za:iP,arePrimitiveWrappersEqual:oP,areRegExpsEqual:aP,areSetsEqual:r?Om(km,Za):km,areTypedArraysEqual:r?Za:sP};if(n&&(i=jm({},i,n(i))),t){var o=Nu(i.areArraysEqual),a=Nu(i.areMapsEqual),s=Nu(i.areObjectsEqual),u=Nu(i.areSetsEqual);i=jm({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function CP(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function wP(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{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,c){return n(u,c,a)}}var xP=Fi();Fi({strict:!0});Fi({circular:!0});Fi({circular:!0,strict:!0});Fi({createInternalComparator:function(){return qa}});Fi({strict:!0,createInternalComparator:function(){return qa}});Fi({circular:!0,createInternalComparator:function(){return qa}});Fi({circular:!0,createInternalComparator:function(){return qa},strict:!0});function Fi(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=SP(e),u=bP(s),c=r?r(u):CP(u);return wP({circular:n,comparator:u,createState:i,equals:c,strict:a})}function EP(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 TP(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),EP(e)}var Cs=g,IP=_N(oN({concat:g2(m2).concat,empty:0}))();function AP(e){return function(t){return t.iterNumber>=e?ye:je(0)}}function $P(e,t){return function(n){return Cs(n,t,Z(function(r){return Math.min(e,r)}))}}function OP(e){return function(t){return je(e*Math.pow(2,t.iterNumber))}}var DP={iterNumber:0,cumulativeDelay:0,previousDelay:ye};function NP(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+st(function(){return 0})(n),previousDelay:n}}function PP(e,t){var n=NP(e,t);return Cs(n.previousDelay,fC(function(){return Mc.of(n)},function(r){return YD(r)(Mc.of(n))}))}function Uo(e,t,n){var r=function(i){return Cs(i,t,Cm(function(o){return n(o)?Cs(PP(e,i),Cm(function(a){return Cs(a.previousDelay,fC(function(){return Mc.of(o)},function(){return r(a)}))})):Mc.of(o)}))};return r(DP)}var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});Ls.isGuid=Fh=Ls.guid=void 0;var RP=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)},Fh=Ls.guid=RP,_m=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},kP=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=MP(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"};Ls.isGuid=kP;var MP=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Lh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Bl(e){return{equals(t,n){const r=g(be(t),st(()=>[])),i=g(be(n),st(()=>[]));return qi(e).equals(r,i)}}}const Fa=gn({localId:ft,componentPath:Bl(ft),sharedConfigurationModelId:Lh(ft)}),EC=gn({localId:ft,configurationModelId:ft}),jP=Tn((e,t)=>Y({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>_P.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>qP.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>FP.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>LP.equals(n.x,n.y)).otherwise(()=>!1)),_P=gn({type:ft,attributeId:Fa,state:ft,choiceValueId:ft}),qP=gn({type:ft,attributeId:Fa,state:ft}),FP=gn({type:ft,attributeId:Fa,state:Ll}),LP=gn({type:ft,attributeId:Fa,state:_h});var _t=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(_t||{}),Qe=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Qe||{}),lc=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(lc||{}),pn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(pn||{}),Oi=(e=>(e.Channel="Channel",e.Package="Package",e))(Oi||{}),W=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(W||{}),bt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(bt||{}),ot=(e=>(e.Included="Included",e.Excluded="Excluded",e))(ot||{}),$e=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))($e||{}),Si=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Si||{}),ga=(e=>(e.Always="Always",e.Optional="Optional",e))(ga||{}),vt=(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))(vt||{}),TC=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(TC||{});const BP={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};let VP=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 Y(t).with({type:Oi.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Oi.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return g(t,be,Z(Xn(G(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),Mt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:g([...t.decisions],uc(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return g(be(t),Mt)}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 Y(t).returnType().with({type:pn.all},()=>({type:"AllowedRulesAll"})).with({type:pn.none},()=>({type:"AllowedRulesNone"})).with({type:pn.specific},n=>({type:"AllowedRulesSpecific",rules:g(n.rules,G(this.mapToGlobalConstraintId),Rd)})).with(Ve.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function UP(e){return t=>xN(n=>n!=null,e)(t)}function GP(){return _a(Lr())}var Gn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Gn||{}),uo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(uo||{}),hn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(hn||{}),co=(e=>(e.all="all",e.none="none",e.specific="specific",e))(co||{});const Sn=gn({localId:ft,componentPath:Bl(ft),sharedConfigurationModel:Lh(ft)}),zP=ko(qi(gn({attributeId:Sn,decisions:Bl(Sn)}))),WP=ko(Tn((e,t)=>Y({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})=>qi(EC).equals(n.rules,r.rules)).otherwise(()=>!1))),HP=ko(gn({rules:WP})),KP=gn({configurationModelSource:Tn((e,t)=>xP(e,t)),decisionsToRespect:zP,usageRuleParameters:gC(ft),allowedInExplain:HP});var Bs=(e=>(e.Channel="Channel",e.Package="Package",e))(Bs||{}),ct=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ct||{}),Te=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Te||{}),Jt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Jt||{}),Pt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Pt||{}),yo=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(yo||{}),go=(e=>(e.Always="Always",e.Optional="Optional",e))(go||{});const YP={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:ko(ft).equals(e.state,t.state)},XP={equals(e,t){return ko(Ll).equals(e.value,t.value)}},JP={equals(e,t){return ko(_h).equals(e.value,t.value)}},QP={equals(e,t){return ko(ft).equals(e.state,t.state)}},ZP={equals(e,t){return Sn.equals(e.attributeId,t.attributeId)?Y({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>JP.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>XP.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>QP.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>YP.equals(r.x,r.y)).otherwise(()=>!1):!1}},eR=qi(ZP),tR={equals:(e,t)=>eR.equals(e.decisions,t.decisions)&&nR.equals(e.mode,t.mode)},nR={equals:(e,t)=>Y({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 Ld=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Ld||{}),ha=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(ha||{}),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||{}),Bh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Bh||{});const rR={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};function iR(e,t){console.log(`--------------------------------------------------------------------------------
|
|
67
|
+
*/var mm;function MO(){return mm||(mm=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=_S();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&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 c(l,f,d,p,h){var v=o(null),E;v.current===null?(E={hasValue:!1,value:null},v.current=E):E=v.current;var x=s(function(){var b=!1,T,A,D=function(L){if(!b){b=!0,T=L;var V=p(L);if(h!==void 0&&E.hasValue){var H=E.value;if(h(H,V))return A=H,H}return A=V,V}var R=T,ie=A;if(r(R,L))return ie;var B=p(L);return h!==void 0&&h(ie,B)?ie:(T=L,A=B,B)},I=d===void 0?null:d,N=function(){return D(f())},_=I===null?void 0:function(){return D(I())};return[N,_]},[f,d,p,h]),m=x[0],S=x[1],C=i(l,m,S);return a(function(){E.hasValue=!0,E.value=C},[C]),u(C),C}Sf.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Sf}process.env.NODE_ENV==="production"?Dd.exports=kO():Dd.exports=MO();var jO=Dd.exports,_O=O.useLayoutEffect;function ym(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var kc=globalThis&&globalThis.__assign||function(){return kc=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},kc.apply(this,arguments)},qO=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},FO=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 LO(e,t){var n=ym(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=FO(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,c=t.services,l=t.delays;t.state;var f=qO(t,["context","guards","actions","activities","services","delays","state"]),d=ym(function(){var p={context:o,guards:a,actions:s,activities:u,services:c,delays:l},h=n.withConfig(p,function(){return kc(kc({},n.context),o)});return bS(h,f)});return _O(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,c),Object.assign(d.machine.options.delays,l)},[s,a,u,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function BO(e,t,n){if(e.status===Ot.NotStarted)return!0;var r=n.changed===void 0&&(Object.keys(n.children).length>0||typeof t.changed=="boolean");return!(n.changed||r)}var VO=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 UO(e){return e}function GO(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=VO(t,1),i=r[0],o=i===void 0?{}:i,a=LO(e,o),s=O.useCallback(function(){return a.status===Ot.NotStarted?o.state?er.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return BO(a,f,d)},[a]),c=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=jO.useSyncExternalStoreWithSelector(c,s,s,UO,u);return O.useEffect(function(){var f=o.state;return a.start(f?er.create(f):void 0),function(){a.stop(),a.status=Ot.NotStarted}},[]),[l,a.send,a]}const qS=O.createContext(null),FS=O.createContext(null),LS=O.createContext(null),BS=O.createContext(null),bh=()=>O.useContext(qS),Ra=()=>O.useContext(BS),VS="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 Sh(e){if(!e)throw new Error(VS)}function ka(e){if(!e)throw new Error(VS)}function au(){const e=bh();return Sh(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var zO=function(e){return e._tag==="Some"},$l=function(e){return function(t){return zO(e(t))}};const WO=$l(e=>e.type===Oe.Choice?Me(e):me),HO=$l(e=>e.type===Oe.Numeric?Me(e):me),KO=$l(e=>e.type===Oe.Boolean?Me(e):me),YO=$l(e=>e.type===Oe.Component?Me(e):me);function Ol(e){return e.decision!=null&&e.decision.kind===$r.Explicit}function US(e){return w(e.values,zt(Ol),z(t=>({type:Oe.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function XO(e){return w(e,tu(Ol),ee(()=>({type:Oe.Numeric,attributeId:e.id,state:null})))}function JO(e){return w(e,tu(Ol),ee(()=>({type:Oe.Boolean,attributeId:e.id,state:null})))}function QO(e){return w(e,tu(Ol),ee(()=>({type:Oe.Component,attributeId:e.id,state:null})))}function ZO(e,t){return w(No.filterAttributesOfComponent(t,e,!0),n=>[w(n,zt(WO),yE(US)),w(n,zt(HO),z(XO),Hn),w(n,zt(KO),z(JO),Hn),w(n,zt(YO),z(QO),Hn)],Yp)}function GS(){const e=bh();return Sh(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 eD(e,t=!1){const n=Ra();return ka(n),O.useMemo(()=>w(Se(e),ee(Yn(z(r=>No.getAttribute(n,r)),t?$o(Se):Zr)),at(()=>n.attributes)),[e,n,t])}function tD(e){const t=Ra(),{makeDecision:n,setManyDecision:r}=au(),i=Dl(e,Ut.choiceValue);ka(t);const o=No.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,c)=>n({type:Oe.Choice,attributeId:e,choiceValueId:u,state:c}),clearDecisions:w(o,Se,ee(US),Ht(eu),ee(u=>()=>r(u,{type:"Default"})),at(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function nD(e){const t=Ra(),{makeDecision:n}=au(),r=Dl(e,Ut.numeric);ka(t);const i=No.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 rD(e){const t=Ra(),{makeDecision:n}=au(),r=Dl(e,Ut.boolean);ka(t);const i=No.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 iD(e){const t=Ra(),{makeDecision:n,setManyDecision:r}=au(),i=Dl(e,Ut.component);ka(t);const o=t.attributes,a=No.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:c=>n({type:Oe.Component,attributeId:e,state:c}),clearSubtree:w(ZO(e,o),tu(eu),ee(c=>()=>r(c,{type:"Default"})),at(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function Dl(e,t){const{explain:n,applySolution:r}=GS();return O.useMemo(()=>({explain:(i,o)=>{const a=ue(i.question).with(wn.whyIsNotSatisfied,()=>Ut.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 gm=On(nS),oD=On(rS),aD=On((e,t)=>gb(lt).equals(e??{},t??{})),sD=yn({attributeId:gm,decisions:ji(gm)}),uD=On((e,t)=>ji(sD).equals(e??[],t??[])),cD=yn({type:lt}),lD=yn({type:lt}),fD=yn({type:lt,rules:ji(oD)}),dD=On((e,t)=>ue({x:e,y:t}).returnType().with({x:{type:on.all},y:{type:on.all}},({x:n,y:r})=>cD.equals(n,r)).with({x:{type:on.none},y:{type:on.none}},({x:n,y:r})=>lD.equals(n,r)).with({x:{type:on.specific},y:{type:on.specific}},({x:n,y:r})=>fD.equals(n,r)).otherwise(()=>!1)),pD=yn({rules:nu(dD)}),zS=yn({configurationModelSource:On((e,t)=>NO(e,t)),attributeRelations:uD,usageRuleParameters:aD,allowedInExplain:nu(pD)}),Nd=nu(zS),hD=Hp,sc=nu(hD),vD=()=>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:[Fn("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Fn("Entering ProcessChanges","SessionManagement:"),Bo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Fn("Entering DisposeSession","SessionManagement:"),Bo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Fn("Entering CreateSession","SessionManagement:"),Bo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Fn("Entering SessionCreationFailed","SessionManagement:"),Bo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Fn("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Fn("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Fn("Entering UpdateSession","SessionManagement:"),Bo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Fn("Entering SessionUpdateFailed","SessionManagement:"),Bo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Fn("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Fn("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Nn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Nn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Nn((e,t)=>(e.session&&e.session.close().then(qr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Nn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Nn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Nn({sessionCreationError:()=>null}),setSessionUpdateError:Nn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Nn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Nn({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||!sc.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!zS.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!sc.equals(e.desiredClient,e.sessionCreationError.client)||!Nd.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!sc.equals(e.desiredClient,e.actualClient)||!Nd.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Bo(e){const t=e===0,n=e===1;return hO((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 SS({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const mD=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),yD=()=>vh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[SS((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Fn("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Fn("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)=>mD(e.session)}}}},{actions:{saveSession:Nn((e,t)=>({session:t.session}))}}),gD=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},bm=()=>{const e=gD();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var bD=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]},Sm=function(e,t,n,r){return O.useEffect(e,bD(t,n,r))};const SD=()=>vh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:bm()},entry:[Nn({sessionManagementActor:()=>am(vD()),configurationSubscriptionManagementActor:()=>am(yD())})],exit:[um(e=>e.sessionManagementActor),um(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[Ou(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[Ou(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[Ou(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[Ou(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Nn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),x$(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Nn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Nn((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:bm())()}})}});function wD(e){var t,n;const[r,i]=GO(SD,{logger:(...u)=>console.log("ConfigurationManagement:",...u)});Sm(()=>{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],jv(sc)),Sm(()=>{const u=w(Se(e.sessionContext),PE(c=>Se(c.configurationModelSource)),nr);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],jv(Nd));const o=O.useMemo(()=>{var u,c,l,f;return{isInitializing:((c=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=r.context.isReadyPromise)==null?void 0:l.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,c;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((c=r.context.sessionUpdating)==null?void 0:c.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 CD(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=wD({configuratorClient:t,sessionContext:n});return $.jsx(FS.Provider,{value:r,children:$.jsx(LS.Provider,{value:i,children:$.jsx(qS.Provider,{value:o,children:$.jsx(BS.Provider,{value:a,children:e.children})})})})}function WS(){return O.useContext(FS)}function xD(){return O.useContext(LS)}function ED(e){const{children:t}=e,{isInitializingPromise:n}=WS();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function TD(){const e=bh(),t=Ra();return Sh(e),ka(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const ID=Object.freeze(Object.defineProperty({__proto__:null,Configuration:CD,ConfigurationSuspender:ED,useAttributes:eD,useBooleanAttribute:rD,useChoiceAttribute:tD,useComponentAttribute:iD,useConfiguration:TD,useConfigurationInitialization:WS,useConfigurationUpdating:xD,useDecision:au,useExplain:GS,useNumericAttribute:nD},Symbol.toStringTag,{value:"Module"}));var AD=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))},$D=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}},OD=function(e){var t=$D(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};function Nr(e){return e}function Nl(e){return function(){return e}}var DD=Nl(null),HS=Nl(void 0),Lr=HS;function Xn(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 g(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 c=arguments[0],l=1;l<arguments.length;l++)c=arguments[l](c);return c}}}var Pr=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,AD([i],r,!1))}}},ND=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))},PD=function(e){return e._tag==="None"},wh=function(e){return e._tag==="Some"},Pl={_tag:"None"},Rl=function(e){return{_tag:"Some",value:e}},RD=function(e){return e._tag==="Left"},kl=function(e){return{_tag:"Left",left:e}},Ml=function(e){return{_tag:"Right",right:e}},kD=function(e){return[e]},MD=function(e){return e.length>0},jD=function(e){return e[0]},_D=function(e){return e.slice(1)},qD=[],FD={},KS=Object.prototype.hasOwnProperty,LD=function(e){return ND([e[0]],e.slice(1),!0)};function BD(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 VD(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 YS(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):YS(e,t-1,i)}}function UD(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 YS(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 GD(e){return function(t){for(var n=Object.keys(t),r=n.length,i=UD(n),o=e.map(t[n[0]],i),a=1;a<r;a++)o=e.ap(o,t[n[a]]);return o}}function zD(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function WD(e){var t=VD(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function XS(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}var HD=function(e){return function(){return Promise.resolve().then(e)}};function KD(e){return function(t){return function(){return new Promise(function(n){setTimeout(function(){Promise.resolve().then(t).then(n)},e)})}}}var jl=function(e,t){return g(e,JS(t))},Ch=function(e,t){return g(e,YD(t))},JS=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},YD=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)})}}},su=function(e){return function(){return Promise.resolve(e)}},xh=Pr(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),uu="Task",_l={URI:uu,map:jl},Eh={URI:uu,of:su},XD={URI:uu,map:jl,ap:Ch},Th={URI:uu,map:jl,of:su,ap:Ch,chain:xh},JD=Nr,wm=xh,Mc={URI:uu,map:jl,of:su,ap:Ch,chain:xh,fromIO:HD,fromTask:JD};function QS(e){return function(t){return function(n){return e.fromEither(PD(n)?kl(t()):Ml(n.value))}}}function QD(e,t){return function(n,r){return function(i){return t.chain(i,function(o){return e.fromEither(n(o)?Ml(o):kl(r(o)))})}}}var Ih=kl,ql=Ml,ZS=function(e,t){return g(e,e2(t))},ZD=function(e,t){return g(e,r2(t))},Ah="Either",e2=function(e){return function(t){return Ai(t)?t:ql(e(t.right))}},t2={URI:Ah,map:ZS},n2=function(e){return function(t){return Ai(t)?t:Ai(e)?e:ql(t.right(e.right))}},r2=n2,i2={URI:Ah,map:ZS,ap:ZD},o2=function(e){return function(t){return Ai(t)?Ih(e(t.left)):t}},e0={URI:Ah,fromEither:Nr},a2=QS(e0),Ai=RD,s2=function(e,t){return function(n){return Ai(n)?e(n.left):t(n.right)}},Qi=s2;e0.fromEither;var u2=function(e){return Ai(e)?ql(e.left):Ih(e.right)},Tn=function(e){return{equals:function(t,n){return t===n||e(t,n)}}},gn=function(e){return Tn(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})},Cm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tn(function(n,r){return e.every(function(i,o){return i.equals(n[o],r[o])})})},$h={equals:function(e,t){return e===t}};$h.equals;var c2=function(e){return function(t,n){return t===n||e(t,n)===0}},Fl=function(e){return{equals:c2(e),compare:function(t,n){return t===n?0:e(t,n)}}},xm=function(e){return function(t){return Fl(function(n,r){return t.compare(e(n),e(r))})}},l2=function(){return{concat:function(e,t){return Fl(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}},f2=function(){return{concat:l2().concat,empty:Fl(function(){return 0})}},d2=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};function p2(e,t){return e<t?-1:e>t?1:0}var h2={equals:$h.equals,compare:p2},v2=h2,m2=function(e){return{concat:d2(e)}},y2=m2,Em=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))},g2=qD,t0=MD,b2=function(e,t){return e<0||e>=t.length},S2=function(e){return function(t){return Em(Em([],t,!0),[e],!1)}},w2=S2,C2=function(e,t,n){if(n[e]===t)return n;var r=LD(n);return r[e]=t,r},x2=function(e){return function(t){if(t.length===1)return t;for(var n=[$2(t)],r=O2(t),i=function(u){n.every(function(c){return!e.equals(c,u)})&&n.push(u)},o=0,a=r;o<a.length;o++){var s=a[o];i(s)}return n}},E2=function(e){if(t0(e)){var t=f2();return T2(e.reduce(t.concat,t.empty))}return Nr},n0=function(e){return function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=e(o);KS.call(n,a)?n[a].push(o):n[a]=[o]}return n}},T2=function(e){return function(t){return t.length===1?t:t.slice().sort(e.compare)}},I2=kD,A2=jD,$2=A2,O2=_D,Ll={equals:function(e,t){return e===t}},r0={equals:Ll.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};Ll.equals,r0.compare;globalThis&&globalThis.__spreadArray;var jc=function(e){return e.length===0},Ma=t0,D2=w2,N2=function(e){return function(t){if(jc(t))return Nh;for(var n=[],r=0;r<t.length;r++)n.push.apply(n,e(r,t[r]));return n}},i0=b2,P2=function(e){return function(t){return i0(e,t)?t:e===0?Nh:t.slice(0,e)}},R2=function(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Rl(n);return Pl}};function fn(e){return function(t){for(var n=0;n<t.length;n++)if(e(t[n]))return Rl(t[n]);return Pl}}var k2=function(e,t){return function(n){return i0(e,n)?Pl:Rl(B2(e,t(n[e]),n))}},M2=function(e){return function(t){return t.length<=1?t:t.slice().sort(e.compare)}};function Oh(e){return function(t,n){if(n===void 0){var r=Oh(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 oa=function(e){var t=x2(e);return function(n){return Ma(n)?t(n):n}},j2=function(e){var t=E2(e);return function(n){return Ma(n)?t(n):n}},_2=function(e){return function(t){return jc(t)?e:jc(e)?t:t.concat(e)}},Pe=_2;function o0(e){var t=Oh(e);return function(n,r){if(r===void 0){var i=o0(e);return function(o){return i(o,n)}}return n.filter(function(o){return!t(o,r)})}}var q2=I2,a0=Pr(2,function(e,t){return g(e,N2(function(n,r){return t(r,n)}))}),Dh=a0(Nr),G=function(e){return function(t){return t.map(function(n){return e(n)})}},Wt=function(e){return function(t){return t.filter(e)}},F2=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);wh(i)&&n.push(i.value)}return n}},Po=function(e){return F2(function(t,n){return e(n)})},Kn=Po(Nr),Pd=function(e,t){return L2(e,function(n,r,i){return t(r,i)})},L2=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}},qi=function(e){return Tn(function(t,n){return t.length===n.length&&t.every(function(r,i){return e.equals(r,n[i])})})},B2=function(e,t,n){return Ma(n)?C2(e,t,n):n},Rd=function(e){return e.slice()},Tm=function(e){return jc(e)?Nh:e.slice()},Nh=g2,V2=a0,U2=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 Hi(e){return fn(e)}var uc=function(e){return function(t){return t.map(function(n){return e(n)})}},G2=Pr(2,function(e,t){return g(e,U2(function(n,r){return t(r,n)}))}),z2=G2(Nr),W2=function(e){return function(t){for(var n=[],r=0;r<t.length;r++){var i=e(r,t[r]);wh(i)&&n.push(i.value)}return n}},ii=function(e){return W2(function(t,n){return e(n)})},H2=function(e){return function(t){return t.filter(e)}},s0=function(e){return function(t){return Xn(e,t)}},K2=function(e){return function(t){return function(n){return t(n)&&e(n)}}},ye=Pl,je=Rl;function cu(e){return function(t){return e(t)?je(t):ye}}var u0=function(e,t){return g(e,Z(t))},c0=function(e,t){return g(e,Y2(t))},l0="Option",Ro=function(e){return{equals:function(t,n){return t===n||(gr(t)?gr(n):gr(n)?!1:e.equals(t.value,n.value))}}},Z=function(e){return function(t){return gr(t)?ye:je(e(t.value))}},gi=je,Y2=function(e){return function(t){return gr(t)||gr(e)?ye:je(t.value(e.value))}},X2={URI:l0,map:u0,ap:c0,of:gi},Ph=Pr(2,function(e,t){return gr(e)?ye:t(e.value)}),J2={URI:l0,map:u0,ap:c0,chain:Ph},Q2=Pr(2,function(e,t){return gr(e)?t():e}),Im=Q2,Z2=Ph(Nr),Vt=function(e){return function(t){return gr(t)?ye:e(t.value)?t:ye}},cs=wh,gr=function(e){return e._tag==="None"},eN=function(e,t){return function(n){return gr(n)?e():t(n.value)}},$i=eN,f0=$i,tN=function(e){return function(t){return gr(t)?e():t.value}},st=tN,kd=Z2,nN=Pr(2,XS(J2)),be=function(e){return e==null?ye:je(e)},Vn=$i(DD,Nr),Mt=$i(HS,Nr),ir=Ph,rN=nN,iN=WD(X2);function oN(e){return Xn(ql,e.of)}function aN(e){return Xn(Ih,e.of)}function sN(e){return zD(e,t2)}function uN(e){return BD(e,i2)}function cN(e){return function(t,n){return e.chain(t,function(r){return Ai(r)?e.of(r):n(r.right)})}}function lN(e){return function(t,n){return e.map(t,o2(n))}}function fN(e){return function(t,n){return function(r){return e.map(r,Qi(t,n))}}}function dN(e){return function(t){return function(n){return e.chain(n,function(r){return Ai(r)?t(r.left):e.of(r)})}}}function pN(e){return function(t){return e.map(t,u2)}}var hN=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(l){try{c(r.next(l))}catch(f){a(f)}}function u(l){try{c(r.throw(l))}catch(f){a(f)}}function c(l){l.done?o(l.value):i(l.value).then(s,u)}c((r=r.apply(e,t||[])).next())})},vN=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(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(l){c=[6,l],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},bi=aN(Eh),ja=oN(Eh),mN=su,yN=function(e){return JS(a2(e))},_c=fN(_l),Am=function(e,t){return function(){return hN(void 0,void 0,void 0,function(){var n;return vN(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Ml)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,kl(t(n))];case 3:return[2]}})})}},d0=dN(Th),$m=pN(_l),p0=function(e,t){return g(e,Yt(t))},h0=function(e,t){return g(e,bN(t))},Yt=sN(_l),gN=Pr(2,lN(_l)),vr=gN,bN=uN(XD),v0=Pr(2,cN(Th)),aa=ja,Rh="TaskEither",SN={URI:Rh,map:p0,ap:h0,of:aa},m0={URI:Rh,map:p0,ap:h0,chain:v0},kh={URI:Rh,fromEither:mN},wN=Pr(2,XS(m0)),Mh=QS(kh);kh.fromEither;var CN=QD(kh,m0),xN=aa(FD),pr=v0,EN=wN;function TN(e){return t=>g(t,Yt(n=>(e(n)(),n)))}const js=TN;function qc(e){return t=>g(t,$m,js(e),$m)}function IN(e){return t=>g(t,js(n=>()=>e(n)()),qc(n=>()=>e(n)()))}function AN(e){return t=>g(t,Z(n=>(e(n)(),n)))}const $N=AN;function ON(e){return Xn(je,e.of)}function DN(e){return Nl(e.of(ye))}function NN(e){var t=DN(e);return function(n,r){return e.chain(n,$i(function(){return t()},r))}}globalThis&&globalThis.__awaiter;globalThis&&globalThis.__generator;var PN=ON(Eh),RN=su,kN=Pr(2,NN(Th)),MN=kN,jN=OD,ft={equals:function(e,t){return e===t}},Md={equals:ft.equals,compare:function(e,t){return e<t?-1:e>t?1:0}},_N=function(e){return function(t){return Object.keys(t).sort(e.compare)}};function jh(e){if(typeof e=="function")return jh(Md)(e);var t=_N(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 y0(e){return function(t,n){if(n===void 0){var r=y0(e);return function(o){return r(o,t)}}for(var i in t)if(!KS.call(n,i)||!e.equals(t[i],n[i]))return!1;return!0}}function g0(e){var t=y0(e);return Tn(function(n,r){return t(n)(r)&&t(r)(n)})}function qN(e){return Tn((t,n)=>{const r=t==null,i=n==null;return r&&i||!r&&!i&&e.equals(t,n)})}const FN=Fl(()=>0);var _h={equals:function(e,t){return e===t}},LN={equals:_h.equals,compare:function(e,t){return e<t?-1:e>t?1:0}};const kn=Symbol.for("@ts-pattern/matcher"),b0=Symbol.for("@ts-pattern/isVariadic"),Fc="@ts-pattern/anonymous-select-key",jd=e=>!!(e&&typeof e=="object"),cc=e=>e&&!!e[kn],mn=(e,t,n)=>{if(cc(e)){const r=e[kn](),{matched:i,selections:o}=r.match(t);return i&&o&&Object.keys(o).forEach(a=>n(a,o[a])),i}if(jd(e)){if(!jd(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];cc(s)&&s[b0]?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((c,l)=>mn(c,a[l],n))&&i.every((c,l)=>mn(c,s[l],n))&&(o.length===0||mn(o[0],u,n))}return e.length===t.length&&e.every((a,s)=>mn(a,t[s],n))}return Object.keys(e).every(r=>{const i=e[r];return(r in t||cc(o=i)&&o[kn]().matcherType==="optional")&&mn(i,t[r],n);var o})}return Object.is(t,e)},Wn=e=>{var t,n,r;return jd(e)?cc(e)?(t=(n=(r=e[kn]()).getSelectionKeys)==null?void 0:n.call(r))!=null?t:[]:Array.isArray(e)?_s(e,Wn):_s(Object.values(e),Wn):[]},_s=(e,t)=>e.reduce((n,r)=>n.concat(t(r)),[]);function BN(...e){if(e.length===1){const[t]=e;return n=>mn(t,n,()=>{})}if(e.length===2){const[t,n]=e;return mn(t,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${e.length}.`)}function xn(e){return Object.assign(e,{optional:()=>qh(e),and:t=>Et(e,t),or:t=>S0(e,t),select:t=>t===void 0?qs(e):qs(t,e)})}function _d(e){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[b0]:!0})}}))(e),{optional:()=>_d(qh(e)),select:t=>_d(t===void 0?qs(e):qs(t,e))})}function qh(e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return t===void 0?(Wn(e).forEach(i=>r(i,void 0)),{matched:!0,selections:n}):{matched:mn(e,t,r),selections:n}},getSelectionKeys:()=>Wn(e),matcherType:"optional"})})}const VN=(e,t)=>{for(const n of e)if(!t(n))return!1;return!0},UN=(e,t)=>{for(const[n,r]of e.entries())if(!t(r,n))return!1;return!0};function Et(...e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return{matched:e.every(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>_s(e,Wn),matcherType:"and"})})}function S0(...e){return xn({[kn]:()=>({match:t=>{let n={};const r=(i,o)=>{n[i]=o};return _s(e,Wn).forEach(i=>r(i,void 0)),{matched:e.some(i=>mn(i,t,r)),selections:n}},getSelectionKeys:()=>_s(e,Wn),matcherType:"or"})})}function Xe(e){return{[kn]:()=>({match:t=>({matched:!!e(t)})})}}function qs(...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 xn({[kn]:()=>({match:r=>{let i={[t??Fc]:r};return{matched:n===void 0||mn(n,r,(o,a)=>{i[o]=a}),selections:i}},getSelectionKeys:()=>[t??Fc].concat(n===void 0?[]:Wn(n))})})}function xr(e){return typeof e=="number"}function Zi(e){return typeof e=="string"}function ui(e){return typeof e=="bigint"}const w0=xn(Xe(function(e){return!0})),GN=w0,eo=e=>Object.assign(xn(e),{startsWith:t=>{return eo(Et(e,(n=t,Xe(r=>Zi(r)&&r.startsWith(n)))));var n},endsWith:t=>{return eo(Et(e,(n=t,Xe(r=>Zi(r)&&r.endsWith(n)))));var n},minLength:t=>eo(Et(e,(n=>Xe(r=>Zi(r)&&r.length>=n))(t))),maxLength:t=>eo(Et(e,(n=>Xe(r=>Zi(r)&&r.length<=n))(t))),includes:t=>{return eo(Et(e,(n=t,Xe(r=>Zi(r)&&r.includes(n)))));var n},regex:t=>{return eo(Et(e,(n=t,Xe(r=>Zi(r)&&!!r.match(n)))));var n}}),zN=eo(Xe(Zi)),Er=e=>Object.assign(xn(e),{between:(t,n)=>Er(Et(e,((r,i)=>Xe(o=>xr(o)&&r<=o&&i>=o))(t,n))),lt:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r<n))(t))),gt:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r>n))(t))),lte:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r<=n))(t))),gte:t=>Er(Et(e,(n=>Xe(r=>xr(r)&&r>=n))(t))),int:()=>Er(Et(e,Xe(t=>xr(t)&&Number.isInteger(t)))),finite:()=>Er(Et(e,Xe(t=>xr(t)&&Number.isFinite(t)))),positive:()=>Er(Et(e,Xe(t=>xr(t)&&t>0))),negative:()=>Er(Et(e,Xe(t=>xr(t)&&t<0)))}),WN=Er(Xe(xr)),ci=e=>Object.assign(xn(e),{between:(t,n)=>ci(Et(e,((r,i)=>Xe(o=>ui(o)&&r<=o&&i>=o))(t,n))),lt:t=>ci(Et(e,(n=>Xe(r=>ui(r)&&r<n))(t))),gt:t=>ci(Et(e,(n=>Xe(r=>ui(r)&&r>n))(t))),lte:t=>ci(Et(e,(n=>Xe(r=>ui(r)&&r<=n))(t))),gte:t=>ci(Et(e,(n=>Xe(r=>ui(r)&&r>=n))(t))),positive:()=>ci(Et(e,Xe(t=>ui(t)&&t>0))),negative:()=>ci(Et(e,Xe(t=>ui(t)&&t<0)))}),HN=ci(Xe(ui)),KN=xn(Xe(function(e){return typeof e=="boolean"})),YN=xn(Xe(function(e){return typeof e=="symbol"})),XN=xn(Xe(function(e){return e==null}));var Ve={__proto__:null,matcher:kn,optional:qh,array:function(...e){return _d({[kn]:()=>({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 Wn(n).forEach(o=>{r[o]=[]}),{matched:!0,selections:r};const i=(o,a)=>{r[o]=(r[o]||[]).concat([a])};return{matched:t.every(o=>mn(n,o,i)),selections:r}},getSelectionKeys:()=>e.length===0?[]:Wn(e[0])})})},set:function(...e){return xn({[kn]:()=>({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:VN(t,o=>mn(i,o,r)),selections:n}},getSelectionKeys:()=>e.length===0?[]:Wn(e[0])})})},map:function(...e){return xn({[kn]:()=>({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:UN(t,(s,u)=>{const c=mn(o,u,r),l=mn(a,s,r);return c&&l}),selections:n}},getSelectionKeys:()=>e.length===0?[]:[...Wn(e[0]),...Wn(e[1])]})})},intersection:Et,union:S0,not:function(e){return xn({[kn]:()=>({match:t=>({matched:!mn(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:Xe,select:qs,any:w0,_:GN,string:zN,number:WN,bigint:HN,boolean:KN,symbol:YN,nullish:XN,instanceOf:function(e){return xn(Xe(function(t){return n=>n instanceof t}(e)))},shape:function(e){return xn(Xe(BN(e)))}};const qd={matched:!1,value:void 0};function Y(e){return new JN(e,qd)}let JN=class Fd{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=(c,l)=>{o=!0,a[c]=l},u=!r.some(c=>mn(c,this.input,s))||i&&!i(this.input)?qd:{matched:!0,value:n(o?Fc in a?a[Fc]:a:this.input,this.input)};return new Fd(this.input,u)}when(t,n){if(this.state.matched)return this;const r=!!t(this.input);return new Fd(this.input,r?{matched:!0,value:n(this.input,this.input)}:qd)}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 QN=Object.getOwnPropertyNames,ZN=Object.getOwnPropertySymbols,eP=Object.prototype.hasOwnProperty;function Om(e,t){return function(r,i,o){return e(r,i,o)&&t(r,i,o)}}function Nu(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 QN(e).concat(ZN(e))}var C0=Object.hasOwn||function(e,t){return eP.call(e,t)};function _a(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var x0="_owner",Nm=Object.getOwnPropertyDescriptor,Pm=Object.keys;function tP(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 nP(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(),c=!1,l=0;(s=u.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,v=h[0],E=h[1];!c&&!r[l]&&(c=n.equals(d,v,o,l,e,t,n)&&n.equals(p,E,d,v,e,t,n))&&(r[l]=!0),l++}if(!c)return!1;o++}return!0}function rP(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===x0&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!C0(t,o)||!n.equals(e[o],t[o],o,o,e,t,n))return!1;return!0}function Qa(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===x0&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!C0(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 iP(e,t){return _a(e.valueOf(),t.valueOf())}function oP(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,c=0;(a=s.next())&&!a.done;)!u&&!r[c]&&(u=n.equals(o.value,a.value,o.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!u)return!1}return!0}function aP(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 sP="[object Arguments]",uP="[object Boolean]",cP="[object Date]",lP="[object Map]",fP="[object Number]",dP="[object Object]",pP="[object RegExp]",hP="[object Set]",vP="[object String]",mP=Array.isArray,Mm=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,jm=Object.assign,yP=Object.prototype.toString.call.bind(Object.prototype.toString);function gP(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(l,f,d){if(l===f)return!0;if(l==null||f==null||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;var p=l.constructor;if(p!==f.constructor)return!1;if(p===Object)return i(l,f,d);if(mP(l))return t(l,f,d);if(Mm!=null&&Mm(l))return u(l,f,d);if(p===Date)return n(l,f,d);if(p===RegExp)return a(l,f,d);if(p===Map)return r(l,f,d);if(p===Set)return s(l,f,d);var h=yP(l);return h===cP?n(l,f,d):h===pP?a(l,f,d):h===lP?r(l,f,d):h===hP?s(l,f,d):h===dP?typeof l.then!="function"&&typeof f.then!="function"&&i(l,f,d):h===sP?i(l,f,d):h===uP||h===fP||h===vP?o(l,f,d):!1}}function bP(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,i={areArraysEqual:r?Qa:tP,areDatesEqual:nP,areMapsEqual:r?Om(Rm,Qa):Rm,areObjectsEqual:r?Qa:rP,arePrimitiveWrappersEqual:iP,areRegExpsEqual:oP,areSetsEqual:r?Om(km,Qa):km,areTypedArraysEqual:r?Qa:aP};if(n&&(i=jm({},i,n(i))),t){var o=Nu(i.areArraysEqual),a=Nu(i.areMapsEqual),s=Nu(i.areObjectsEqual),u=Nu(i.areSetsEqual);i=jm({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return i}function SP(e){return function(t,n,r,i,o,a,s){return e(t,n,s)}}function wP(e){var t=e.circular,n=e.comparator,r=e.createState,i=e.equals,o=e.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?t?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:o})};if(t)return function(u,c){return n(u,c,{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,c){return n(u,c,a)}}var CP=Fi();Fi({strict:!0});Fi({circular:!0});Fi({circular:!0,strict:!0});Fi({createInternalComparator:function(){return _a}});Fi({strict:!0,createInternalComparator:function(){return _a}});Fi({circular:!0,createInternalComparator:function(){return _a}});Fi({circular:!0,createInternalComparator:function(){return _a},strict:!0});function Fi(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=bP(e),u=gP(s),c=r?r(u):SP(u);return wP({circular:n,comparator:u,createState:i,equals:c,strict:a})}function xP(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 EP(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),xP(e)}var Ss=g,TP=jN(iN({concat:y2(v2).concat,empty:0}))();function IP(e){return function(t){return t.iterNumber>=e?ye:je(0)}}function AP(e,t){return function(n){return Ss(n,t,Z(function(r){return Math.min(e,r)}))}}function $P(e){return function(t){return je(e*Math.pow(2,t.iterNumber))}}var OP={iterNumber:0,cumulativeDelay:0,previousDelay:ye};function DP(e,t){var n=e(t);return{iterNumber:t.iterNumber+1,cumulativeDelay:t.cumulativeDelay+st(function(){return 0})(n),previousDelay:n}}function NP(e,t){var n=DP(e,t);return Ss(n.previousDelay,f0(function(){return Mc.of(n)},function(r){return KD(r)(Mc.of(n))}))}function Vo(e,t,n){var r=function(i){return Ss(i,t,wm(function(o){return n(o)?Ss(NP(e,i),wm(function(a){return Ss(a.previousDelay,f0(function(){return Mc.of(o)},function(){return r(a)}))})):Mc.of(o)}))};return r(OP)}var Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.isGuid=Fh=Fs.guid=void 0;var PP=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)},Fh=Fs.guid=PP,_m=function(){return Number(Math.random().toString().substring(2)).toString(16).substring(0,8)},RP=function(e,t){t===void 0&&(t=2);var n=e.split("-"),r=kP(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"};Fs.isGuid=RP;var kP=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};function Lh(e){return{equals(t,n){return t==null&&n==null?!0:t==null||n===null||n===void 0?!1:e.equals(t,n)}}}function Bl(e){return{equals(t,n){const r=g(be(t),st(()=>[])),i=g(be(n),st(()=>[]));return qi(e).equals(r,i)}}}const qa=gn({localId:ft,componentPath:Bl(ft),sharedConfigurationModelId:Lh(ft)}),E0=gn({localId:ft,configurationModelId:ft}),MP=Tn((e,t)=>Y({x:e,y:t}).with({x:{type:"Choice"},y:{type:"Choice"}},n=>jP.equals(n.x,n.y)).with({x:{type:"Component"},y:{type:"Component"}},n=>_P.equals(n.x,n.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},n=>qP.equals(n.x,n.y)).with({x:{type:"Boolean"},y:{type:"Boolean"}},n=>FP.equals(n.x,n.y)).otherwise(()=>!1)),jP=gn({type:ft,attributeId:qa,state:ft,choiceValueId:ft}),_P=gn({type:ft,attributeId:qa,state:ft}),qP=gn({type:ft,attributeId:qa,state:Ll}),FP=gn({type:ft,attributeId:qa,state:_h});var _t=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(_t||{}),Qe=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(Qe||{}),lc=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(lc||{}),pn=(e=>(e.all="all",e.none="none",e.specific="specific",e))(pn||{}),Oi=(e=>(e.Channel="Channel",e.Package="Package",e))(Oi||{}),W=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(W||{}),bt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(bt||{}),ot=(e=>(e.Included="Included",e.Excluded="Excluded",e))(ot||{}),$e=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))($e||{}),Si=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Si||{}),ya=(e=>(e.Always="Always",e.Optional="Optional",e))(ya||{}),vt=(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))(vt||{}),T0=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(T0||{});const LP={createConfigurationRejectedDecisionsConflict(e){return{type:"ConfigurationRejectedDecisionsConflict",rejectedDecisions:e}}};let BP=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 Y(t).with({type:Oi.Channel},n=>({type:"Channel",deploymentName:n.deploymentName,channel:n.channel})).with({type:Oi.Package},n=>({type:"Package",configurationModelPackage:n.configurationModelPackage})).exhaustive()}mapToAttributeRelations(t){return g(t,be,Z(Xn(G(n=>this.mapToDecisionsToRespect(n)),n=>[...n])),Mt)}mapToDecisionsToRespect(t){return{attributeId:t.attributeId,decisions:g([...t.decisions],uc(n=>this.mapToGlobalAttributeId(n)))}}mapToUsageRuleParameters(t){return g(be(t),Mt)}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 Y(t).returnType().with({type:pn.all},()=>({type:"AllowedRulesAll"})).with({type:pn.none},()=>({type:"AllowedRulesNone"})).with({type:pn.specific},n=>({type:"AllowedRulesSpecific",rules:g(n.rules,G(this.mapToGlobalConstraintId),Rd)})).with(Ve.nullish,()=>null).exhaustive()}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}};function VP(e){return t=>CN(n=>n!=null,e)(t)}function UP(){return ja(Lr())}var Gn=(e=>(e.whyIsNotSatisfied="why-is-not-satisfied",e.whyIsStateNotPossible="why-is-state-not-possible",e))(Gn||{}),uo=(e=>(e.decisions="decisions",e.constraints="constraints",e.all="all",e))(uo||{}),hn=(e=>(e.choiceValue="choice-value",e.component="component",e.boolean="boolean",e.numeric="numeric",e.configuration="configuration",e.attribute="attribute",e))(hn||{}),co=(e=>(e.all="all",e.none="none",e.specific="specific",e))(co||{});const Sn=gn({localId:ft,componentPath:Bl(ft),sharedConfigurationModel:Lh(ft)}),GP=Ro(qi(gn({attributeId:Sn,decisions:Bl(Sn)}))),zP=Ro(Tn((e,t)=>Y({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})=>qi(E0).equals(n.rules,r.rules)).otherwise(()=>!1))),WP=Ro(gn({rules:zP})),HP=gn({configurationModelSource:Tn((e,t)=>CP(e,t)),decisionsToRespect:GP,usageRuleParameters:g0(ft),allowedInExplain:WP});var Ls=(e=>(e.Channel="Channel",e.Package="Package",e))(Ls||{}),ct=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.Choice="Choice",e.Component="Component",e))(ct||{}),Te=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(Te||{}),Jt=(e=>(e.Included="Included",e.Excluded="Excluded",e))(Jt||{}),Pt=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Pt||{}),yo=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(yo||{}),go=(e=>(e.Always="Always",e.Optional="Optional",e))(go||{});const KP={equals:(e,t)=>e.choiceValueId!==t.choiceValueId?!1:Ro(ft).equals(e.state,t.state)},YP={equals(e,t){return Ro(Ll).equals(e.value,t.value)}},XP={equals(e,t){return Ro(_h).equals(e.value,t.value)}},JP={equals(e,t){return Ro(ft).equals(e.state,t.state)}},QP={equals(e,t){return Sn.equals(e.attributeId,t.attributeId)?Y({x:e,y:t}).with({x:{type:"Boolean"},y:{type:"Boolean"}},(n,r)=>XP.equals(r.x,r.y)).with({x:{type:"Numeric"},y:{type:"Numeric"}},(n,r)=>YP.equals(r.x,r.y)).with({x:{type:"Component"},y:{type:"Component"}},(n,r)=>JP.equals(r.x,r.y)).with({x:{type:"ChoiceValue"},y:{type:"ChoiceValue"}},(n,r)=>KP.equals(r.x,r.y)).otherwise(()=>!1):!1}},ZP=qi(QP),eR={equals:(e,t)=>ZP.equals(e.decisions,t.decisions)&&tR.equals(e.mode,t.mode)},tR={equals:(e,t)=>Y({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 Ld=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Ld||{}),pa=(e=>(e.Rule="Rule",e.Cardinality="Cardinality",e.Component="Component",e))(pa||{}),Ce=(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))(Ce||{}),Bh=(e=>(e[e.NumericDecisionOutOfRange=0]="NumericDecisionOutOfRange",e))(Bh||{});function nR(e,t){console.log(`--------------------------------------------------------------------------------
|
|
68
68
|
-- ${t??""}
|
|
69
69
|
--------------------------------------------------------------------------------
|
|
70
|
-
${JSON.stringify(e,null,2)}`)}var ws=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(ws||{}),IC=(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))(IC||{});const oR=e=>Object.values(IC).includes(e),aR=e=>oR(e)?je(e):ye;function sR(e){const t=n=>Y(n).with("ConfigurationModelNotFound",()=>({type:we.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:we.DecisionsToRespectInvalid})).with(Ve.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:we.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:we.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:we.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:we.ConfigurationConflict,reason:Bh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:we.ConfigurationConflict})).with(Ve.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 g(e.type,aR,Z(t))}const uR=e=>Object.values(ws).includes(e),cR=e=>uR(e)?je(e):ye;function lR(e){return g(e,cR,Z(n=>Y(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 Br(e,t){iR(e,t);const n=e.type;return g(ye,Im(()=>sR(e)),Im(()=>lR(n)),st(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:we.Unknown})))}let fR=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 g(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),vr(r=>Br(r,"ClientSideSessionLifetimeHandler - create")),pr(r=>this.restToDomainMapper.mapToSessionId(r)),UP(()=>({type:we.ConfigurationUnauthenticated})))}close(t){return g(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),vr(n=>Br(n,"ClientSideSessionLifetimeHandler - close")),Yt(()=>Lr()))}};var AC=(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))(AC||{});function jr(e,t,n){const r=g(Array.isArray(e)?e:[e],TP);return g(Am(()=>fetch(r,t),i=>({type:"error"})),pr(i=>g(Am(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),dC(i=>i.status===401?zr({type:ws.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?_a({response:i,data:{}}):i.type==="error"?zr({type:ws.LowLevelCommunicationError}):zr({type:ws.UnhandledResponseStatus})),pr(i=>g(n(i),Mh(()=>i.data))))}function Bd(e,t){return jr(e,t,n=>{if(n.response.status===200)return bi(n.data);if(n.response.status===409){const r=n.data;return Y(r).with({type:"ConfigurationModelInvalid"},i=>bi(r)).with({type:"ConfigurationModelNotFeasible"},i=>bi(r)).otherwise(()=>ye)}return ye})}let dR=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 Bd([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 Bd([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 jr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?je(i.data):ye)}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 jr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?je(i.data):ye)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return jr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?je(r.data):ye)}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 jr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?je(i.data):ye)}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 jr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?je(i.data):ye)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return jr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?je(r.data):ye)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return jr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?je({}):ye)}};var bo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(bo||{}),Vd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Vd||{}),Ud=(e=>(e.Always="Always",e.Optional="Optional",e))(Ud||{}),Vs=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Vs||{}),Wr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Wr||{}),qn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(qn||{}),Gd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Gd||{}),zd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(zd||{}),fs=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(fs||{});const jn=gn({localId:ft,componentPath:Bl(ft),sharedConfigurationModelId:Lh(ft)});let $C=class{mapToDecisions(t){return{}}mapToSessionId(t){return Y(t).with({sessionId:Ve.string},n=>_a(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=g(n.constraintExplanations,G(i=>this.mapToConstraintExplanation(i)));return zr({type:we.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>zr({type:we.ConfigurationModelInvalid})).otherwise(()=>zr({type:we.Unknown}))}mapToExplainAnswer(t,n){const r=Y(n).with({question:Gn.whyIsStateNotPossible,subject:hn.boolean},a=>[{type:Te.Boolean,attributeId:a.attributeId,value:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:hn.numeric},a=>[{type:Te.Numeric,attributeId:a.attributeId,value:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:hn.component},a=>[{type:Te.Component,attributeId:a.attributeId,state:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:hn.choiceValue},a=>[{type:Te.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:je(a.state)}]).otherwise(()=>[]),i=g(t.decisionExplanations,G(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=g(t.constraintExplanations,G(a=>this.mapToConstraintExplanation(a)));return Y(n).with({answerType:uo.decisions},()=>({decisionExplanations:i})).with({answerType:uo.constraints},()=>({constraintExplanations:o})).with({answerType:uo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:we.ConfigurationSetManyConflict,decisionExplanations:g(t.decisionExplanations,G(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:g(t.constraintExplanations,G(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:Te.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:be(t.state)}}mapToNumericDecision(t){return{type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:be(t.state)}}mapToComponentDecision(t){return{type:Te.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Te.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 g(this.mapToDecisionState(t.state),Z(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:g(t.causedByRules,G(n=>this.mapToRuleConstraint(n))),causedByCardinalities:g(t.causedByCardinalities,G(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:ha.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:ha.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=g(t.booleanDecisions??[],G(a=>({type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:be(a.state)}))),r=g(t.numericDecisions??[],G(a=>({type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:be(a.state)}))),i=g(t.componentDecisions??[],G(a=>({type:Te.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:g(be(a.state),Z(s=>this.mapToDecisionState(s)),kd)}))),o=g(t.choiceDecisions??[],G(a=>({type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:g(be(a.state),Z(s=>this.mapToDecisionState(s)),kd)})));return g([],Pe(n),Pe(r),Pe(i),Pe(o))}mapToDecisionExplanation(t,n,r){const i=g(t.causedByBooleanDecisions,G(h=>this.mapToCausedByBooleanDecision(h))),o=g(t.causedByNumericDecisions,G(h=>this.mapToCausedByNumericDecision(h))),a=g(t.causedByComponentDecisions,G(h=>this.mapToCausedByComponentDecision(h))),s=g(t.causedByChoiceDecisions,G(h=>this.mapToCausedByChoiceValueDecision(h))),u=g(i,G(h=>({type:Te.Boolean,attributeId:h.attributeId,value:ye}))),c=g(o,G(h=>({type:Te.Numeric,attributeId:h.attributeId,value:ye}))),l=g(a,G(h=>({type:Te.Component,attributeId:h.attributeId,state:ye}))),f=g(s,G(h=>({type:Te.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:ye}))),d=g([],Pe(u),Pe(c),Pe(l),Pe(f)),p=oC(Tn((h,v)=>{const E=Sn.equals(h.attributeId,v.attributeId);return Y({a:h,b:v}).with({a:{type:Te.ChoiceValue},b:{type:Te.ChoiceValue}},x=>E&&x.a.choiceValueId===x.b.choiceValueId).otherwise(()=>E)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:g([],Pe(d),Pe(p)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return Y(t).with(Gd.NotAvailable,()=>Ld.NotAvailable).with(Gd.StateNotPossible,()=>Ld.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Te.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Te.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 g(n.canAttributeContributeToConfigurationSatisfaction,fn(p=>jn.equals(p,d)),ls)}const i=g([],Pe(g(t.choiceValueDecisions,G(d=>d.attributeId))),Pe(g(n.choiceConsequences,G(d=>d.attributeId))),aa(jn)),o=g(i,G(d=>{const p=g(t.choiceValueDecisions??[],K2(v=>jn.equals(v.attributeId,d))),h=g(n.choiceConsequences??[],Hi(v=>jn.equals(v.attributeId,d)));return g(h,Z(v=>this.mapToChoiceAttributes(v,p,r(d))))}),Kn),a=g([],Pe(g(t.numericDecisions,G(d=>d.attributeId))),Pe(g(n.numericConsequences,G(d=>d.attributeId))),aa(jn)),s=g(a,G(d=>{const p=g(t.numericDecisions??[],Hi(v=>jn.equals(v.attributeId,d))),h=g(n.numericConsequences??[],Hi(v=>jn.equals(v.attributeId,d)));return g(h,Z(v=>this.mapToNumericAttribute(v,p,r(d))))}),Kn),u=g([],Pe(g(t.booleanDecisions,G(d=>d.attributeId))),Pe(g(n.booleanConsequences,G(d=>d.attributeId))),aa(jn)),c=g(u,G(d=>{const p=g(t.booleanDecisions??[],Hi(v=>jn.equals(v.attributeId,d))),h=g(n.booleanConsequences??[],Hi(v=>jn.equals(v.attributeId,d)));return g(h,Z(v=>this.mapToBooleanAttribute(v,p,r(d))))}),Kn),l=g([],Pe(g(t.componentDecisions,G(d=>d.attributeId))),Pe(g(n.componentConsequences,G(d=>d.attributeId))),aa(jn)),f=g(l,G(d=>{const p=g(t.componentDecisions??[],Hi(v=>jn.equals(v.attributeId,d))),h=g(n.componentConsequences??[],Hi(v=>jn.equals(v.attributeId,d)));return g(h,Z(v=>this.mapToComponentAttribute(v,p,r(d))))}),Kn);return g([],Pe(o),Pe(f),Pe(s),Pe(c))}mapToComponentAttribute(t,n,r){return{type:ct.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:g(t.possibleDecisionStates,uc(i=>this.mapToPossibleDecisionState(i))),decision:g(n,ir(i=>g(this.mapToDecisionState(i.state),Z(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:g(t.selection,be,Z(i=>this.mapToSelection(i)),Mt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=g(t.values,uc(o=>{const a=g(n,fn(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:g(n,ir(i=>g(i.state,be,Z(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:g(n,ir(i=>g(i.state,be,Z(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=g(t.possibleDecisionStates,uc(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:g(n,ir(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return Y(t).with(Vs.Implicit,()=>Pt.Implicit).with(Vs.Explicit,()=>Pt.Explicit).exhaustive()}mapToDecisionState(t){return Y(t).with(Wr.Included,()=>je(Jt.Included)).with(Wr.Excluded,()=>je(Jt.Excluded)).with(Wr.Undefined,()=>ye).exhaustive()}mapToPossibleDecisionState(t){return Y(t).with(bo.Included,()=>Jt.Included).with(bo.Excluded,()=>Jt.Excluded).exhaustive()}mapToSelection(t){return Y(t).with(Vd.Mandatory,()=>yo.Mandatory).with(Vd.Optional,()=>yo.Optional).exhaustive()}mapToInclusion(t){return Y(t).with(Ud.Always,()=>go.Always).with(Ud.Optional,()=>go.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},pR=class{constructor(t,n){this.restToDomainMapper=new $C,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Bd(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return g(r,vr(i=>Br(i,"ServerSideSessionLifetimeHandler - create")),pr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return g(jr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===AC.NoContent?je({}):ye),vr(n=>Br(n,"ServerSideSessionLifetimeHandler - close")),Yt(Lr))}};const OC={whyIsNotSatisfied:{configuration:{question:_t.whyIsNotSatisfied,subject:Qe.configuration},attribute:e=>({question:_t.whyIsNotSatisfied,subject:Qe.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:_t.whyIsStateNotPossible,subject:Qe.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:_t.whyIsStateNotPossible,subject:Qe.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:_t.whyIsStateNotPossible,subject:Qe.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:_t.whyIsStateNotPossible,subject:Qe.component,attributeId:e,state:t})})}};let hR=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=ye}setOnConfigurationChangedHandler(t){const n=g(t,be,Z(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 g(this.inner.setSessionContext(n),Yt(Lr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await g(this.inner.restoreConfiguration(n),Yt(Lr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await g(this.inner.makeDecision(n),Yt(Lr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await g(this.inner.setMany(r,i),Yt(Lr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await g(this.inner.applySolution(n),Yt(Lr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(OC):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await g(this.inner.explain(i),Yt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await g(this.inner.close(),vr(t=>this.domainToContractMapper.mapToFailureResult(t)),_c(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Xn(vr(t=>this.domainToContractMapper.mapToFailureResult(t)),_c(t=>Promise.reject(t),t=>Promise.resolve(t)))}},vR=class{mapToExplainQuestion(t,n){const r={answerType:Y(n).with("decisions",()=>uo.decisions).with("constraints",()=>uo.constraints).with("full",()=>uo.all).exhaustive()};return Y(t).with({question:_t.whyIsNotSatisfied,subject:Qe.configuration},i=>({...r,question:Gn.whyIsNotSatisfied,subject:hn.configuration})).with({question:_t.whyIsNotSatisfied,subject:Qe.attribute},i=>({...r,question:Gn.whyIsNotSatisfied,subject:hn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:_t.whyIsStateNotPossible,subject:Qe.choiceValue},i=>({...r,question:Gn.whyIsStateNotPossible,subject:hn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:_t.whyIsStateNotPossible,subject:Qe.component},i=>({...r,question:Gn.whyIsStateNotPossible,subject:hn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:_t.whyIsStateNotPossible,subject:Qe.numeric},i=>({...r,question:Gn.whyIsStateNotPossible,subject:hn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:_t.whyIsStateNotPossible,subject:Qe.boolean},i=>({...r,question:Gn.whyIsStateNotPossible,subject:hn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:g(t.attributes,G(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return g(t,G(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 Y(t).with({type:W.Choice,choiceValueId:Ve.string},n=>({type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:W.Numeric},n=>({type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:be(n.state)})).with({type:W.Boolean},n=>({type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:be(n.state)})).with({type:W.Component},n=>({type:Te.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(be(n.state),ir(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return g(be(t),Z(n=>g(n,G(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:g(r.decisions,G(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return Y(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 Y(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 Y(t).with({type:Oi.Package},n=>({type:Bs.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Oi.Channel},n=>({type:Bs.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:g(t.decisions,G(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return Y(t).with({type:W.Boolean},n=>({type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:g(n.decision,be,Z(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.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:g(n.decision,be,Z(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Choice},n=>({type:ct.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:g(n.values,G(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Component},n=>({type:ct.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:g(n.decision,be,ir(r=>g(this.mapToDecisionStateOption(r.state),Z(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:g(n.possibleDecisionStates,G(r=>this.mapToDecisionStateOption(r)),Kn),selection:g(n.selection,be,Z(r=>this.mapToSelection(r)),Mt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:g(t.possibleDecisionStates,G(n=>this.mapToDecisionStateOption(n)),Kn)}}mapToChoiceValueDecision(t){return g(t.decision,be,ir(n=>g(this.mapToDecisionStateOption(n.state),Z(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return Y(t).with($e.Implicit,()=>Pt.Implicit).with($e.Explicit,()=>Pt.Explicit).exhaustive()}mapToSelection(t){return Y(t).with(Si.Mandatory,()=>yo.Mandatory).with(Si.Optional,()=>yo.Optional).exhaustive()}mapToInclusion(t){return Y(t).with(ga.Always,()=>go.Always).with(ga.Optional,()=>go.Optional).exhaustive()}mapToDecisionState(t){return Y(t).with(Ve.union(bt.Included,ot.Included),()=>Jt.Included).with(Ve.union(bt.Excluded,ot.Excluded),()=>Jt.Excluded).exhaustive()}mapToDecisionStateOption(t){return g(be(t),Z(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return g(t,be,Z(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return g(t,be,Z(n=>Y(n).returnType().with({type:pn.all},()=>({type:co.all})).with({type:pn.none},()=>({type:co.none})).with({type:pn.specific},r=>({type:co.specific,rules:g(r.rules,G(this.mapToGlobalConstraintId))})).exhaustive()))}},DC=class{mapToExplainAnswer(t){const n=Y(t).with({decisionExplanations:Ve.array(Ve.any)},i=>g(i.decisionExplanations,G(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=Y(t).with({constraintExplanations:Ve.array(Ve.any)},i=>g(i.constraintExplanations,G(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:g(t.causedByCardinalities,G(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:g(t.causedByRules,G(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=g(t.causedByChoiceDecisions,G(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=g(t.causedByComponentDecisions,G(a=>this.mapToCausedByComponentAttributeDecision(a))),i=g(t.causedByNumericDecisions,G(a=>this.mapToCausedByNumericAttributeDecision(a))),o=g(t.causedByBooleanDecisions,G(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:g([],Pe(n),Pe(r),Pe(i),Pe(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:g(t.decisions,G(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return Y(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return Y(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 Y(t).with({type:we.ConfigurationConflict},n=>({type:vt.ConfigurationConflict,reason:Y(n.reason).with(Bh.NumericDecisionOutOfRange,()=>TC.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:we.ConfigurationApplicationError},()=>({type:vt.ConfigurationApplicationError})).with({type:we.ConfigurationUnauthenticated},()=>({type:vt.ConfigurationUnauthenticated})).with({type:we.ConfigurationModelNotFound},()=>({type:vt.ConfigurationModelNotFound})).with({type:we.ConfigurationTimeout},()=>({type:vt.ConfigurationTimeout})).with({type:we.ConfigurationAttributeNotFound},()=>({type:vt.ConfigurationAttributeNotFound})).with({type:we.ConfigurationChoiceValueNotFound},()=>({type:vt.ConfigurationChoiceValueNotFound})).with({type:we.ConfigurationSolutionNotAvailable},()=>({type:vt.ConfigurationSolutionNotAvailable})).with({type:we.ConfigurationRejectedDecisionsConflict},n=>{const r=g(n.rejectedDecisions,G(i=>this.mapToExplicitDecision(i)));return BP.createConfigurationRejectedDecisionsConflict(r)}).with({type:we.DecisionsToRespectInvalid},()=>({type:vt.DecisionsToRespectInvalid})).with({type:we.ServiceError},()=>({type:vt.ServiceError})).with({type:we.CommunicationError},()=>({type:vt.CommunicationError})).with({type:we.Unknown},()=>({type:vt.Unknown})).with({type:we.ConfigurationModelInvalid},()=>({type:vt.ConfigurationModelInvalid})).with({type:we.ConfigurationInitializationFailure},()=>({type:vt.ConfigurationInitializationFailure})).with({type:we.ConfigurationModelNotFeasible},n=>({type:vt.ConfigurationModelNotFeasible,constraintExplanations:g(n.constraintExplanations,G(r=>this.mapToConstraintExplanation(r)))})).with({type:we.ConfigurationSetManyConflict},n=>({type:vt.ConfigurationSetManyConflict,decisionExplanations:g(n.decisionExplanations,G(r=>this.mapToDecisionExplanation(r))),constraintExplanations:g(n.constraintExplanations,G(r=>this.mapToConstraintExplanation(r)))})).with({type:we.SpecifiedDeploymentForbidden},n=>({type:vt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:g(t.attributes,G(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return g(t,Z(Xn(G(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:g(n.decisions,G(r=>this.mapToGlobalAttributeId(r)))})))),Vn)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return Y(t).with({type:Bs.Package},n=>({type:Oi.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Bs.Channel},n=>({type:Oi.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return Y(t).with({type:Te.ChoiceValue},n=>({type:W.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.state,Z(r=>this.mapToChoiceValueDecisionState(r)),Mt),choiceValueId:n.choiceValueId})).with({type:Te.Component},n=>({type:W.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.state,Z(r=>this.mapToComponentDecisionState(r)),Mt)})).with({type:Te.Numeric},n=>({type:W.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,Mt)})).with({type:Te.Boolean},n=>({type:W.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,Mt)})).exhaustive()}mapToCardinality(t){return Y(t).with(ha.Cardinality,()=>lc.Cardinality).with(ha.Component,()=>lc.Component).with(ha.Rule,()=>lc.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return Y(t).with({type:Te.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Te.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Te.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Te.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:W.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:W.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:W.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:W.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return Y(t).with(yo.Mandatory,()=>Si.Mandatory).with(yo.Optional,()=>Si.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return Y(t).with({type:ct.Boolean},r=>({...n,type:W.Boolean,decision:g(r.decision,Z(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Vn),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ct.Numeric},r=>({...n,type:W.Numeric,decision:g(r.decision,Z(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Vn),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ct.Choice},r=>({...n,type:W.Choice,cardinality:r.cardinality,values:g(r.values,G(i=>{const o=g(i.decision,Z(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),Vn);return{id:i.choiceValueId,possibleDecisionStates:g(i.possibleDecisionStates,G(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ct.Component},r=>({...n,type:W.Component,decision:g(r.decision,Z(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),Vn),possibleDecisionStates:g(r.possibleDecisionStates,G(i=>this.mapToComponentDecisionState(i))),selection:g(r.selection,be,Z(i=>this.mapToSelection(i)),Mt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return Y(t).with(go.Always,()=>ga.Always).with(go.Optional,()=>ga.Optional).exhaustive()}mapToComponentDecisionState(t){return Y(t).with(Jt.Included,()=>ot.Included).with(Jt.Excluded,()=>ot.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return Y(t).with(Jt.Included,()=>bt.Included).with(Jt.Excluded,()=>bt.Excluded).exhaustive()}mapToDecisionKind(t){return Y(t).with(Pt.Explicit,()=>$e.Explicit).with(Pt.Implicit,()=>$e.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return g(t,Z(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),Vn)}mapToAllowedRulesInExplain(t){return g(t,Z(n=>Y(n).returnType().with({type:co.all},()=>({type:pn.all})).with({type:co.none},()=>({type:pn.none})).with({type:co.specific},r=>({type:pn.specific,rules:g(r.rules,G(this.mapToGlobalConstraintId))})).exhaustive()),Vn)}},mR=class{constructor(t,n){this.contractToDomainMapper=new vR,this.domainToContractMapper=new DC,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await g(this.sessionHandler.recreate(n),Yt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new hR(i,this.contractToDomainMapper,this.domainToContractMapper)}),_c(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:ye,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function NC(e){return e.possibleDecisionStates.some(t=>t===bt.Included)}function yR(e){return!NC(e)}function gR(e){return Y(e).with({type:W.Choice},t=>t.cardinality.lowerBound>0).with({type:W.Boolean},t=>t.selection===Si.Mandatory).with({type:W.Numeric},t=>t.selection===Si.Mandatory).with({type:W.Component},t=>t.inclusion===ga.Optional&&t.selection===Si.Mandatory).exhaustive()}function bR(e){return Y(e).with({type:W.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function SR(e){return g(e.values,Wt(NC))}function CR(e){return g(e.values,Wt(yR))}function PC(e,t){return g(e.values,Ro(n=>g(n.decision,be,Vt(r=>r.kind===t))))}function RC(e){return g(e.values,Wt(t=>g(t.decision,be,Z(n=>n.state===bt.Included),st(()=>!1))))}const wR=RC;function kC(e){return g(e.decision,be,Vt(t=>t.kind===$e.Explicit),Vn)}function MC(e){return g(e.decision,be,Vt(t=>t.kind===$e.Explicit),Vn)}function xR(e,t){return e.possibleDecisionStates.some(n=>n===t)}function jC(e){return g(e.decision,be,Vn)}function _C(e){return qC(e,ot.Included)}function ER(e){return!_C(e)}function qC(e,t){return e.possibleDecisionStates.some(n=>n===t)}const An=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:SR,getBlockedChoiceValues:CR,getBooleanDecision:MC,getChoiceDecisions:PC,getComponentDecision:jC,getIncludedChoiceValues:RC,getNumericDecision:kC,getSelectedChoiceValues:wR,isBooleanValuePossible:xR,isComponentAllowed:_C,isComponentBlocked:ER,isComponentStatePossible:qC,isMandatory:gR,isMultiSelect:bR},Symbol.toStringTag,{value:"Module"})),FC=e=>e.type===W.Boolean,LC=e=>e.type===W.Choice,BC=e=>e.type===W.Numeric,VC=e=>e.type===W.Component,TR=FN(ft),qm=qi(ft);function UC(e,t){const n=a=>TR.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return g(n,Y2(t?a=>qm.equals(g(a.componentPath??[],R2(r)),e.componentPath):a=>qm.equals(a.componentPath??[],e.componentPath)))}function IR(e,t,n){const r=g(UC({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:g(t.componentPath??[],N2(t.localId))},n),sC(i=>i.id));return g(e,Wt(r))}function AR(e,t,n){const r=g(UC({sharedConfigurationModelId:t,componentPath:[]},n),sC(i=>i.id));return g(e,Wt(r))}function $R(e){return g(e,Wt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function OR(e,t){return g(GC(e),G(n=>PC(n,t)),Dh,Ro(n=>be(n)))}function DR(e,t){return g(WC(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>kC(n)),Ro(n=>be(n)))}function NR(e,t){return g(HC(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>MC(n)),Ro(n=>be(n)))}function PR(e,t){return g(zC(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>jC(n)),Ro(n=>be(n)))}function GC(e){return g(e.attributes,Wt(LC))}function zC(e){return g(e.attributes,Wt(VC))}function WC(e){return g(e.attributes,Wt(BC))}function HC(e){return g(e.attributes,Wt(FC))}function RR(e,t){return g(lu(e,t),Mt)}function kR(e,t){return g(KC(e,t),Mt)}function MR(e,t,n){return g(KC(e,t),Z(r=>r.values),ir(Xn(fn(r=>r.id===n))),Mt)}function jR(e,t){return g(lu(e,t),Vt(BC),Mt)}function _R(e,t){return g(lu(e,t),Vt(FC),Mt)}function qR(e,t){return g(lu(e,t),Vt(VC),Mt)}function lu(e,t){return g(e.attributes,fn(n=>Fa.equals(n.id,t)))}function KC(e,t){return g(lu(e,t),Vt(LC))}const La=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:IR,filterAttributesOfRoot:$R,filterAttributesOfShared:AR,getAttribute:RR,getBooleanAttribute:_R,getBooleanAttributes:HC,getBooleanDecisions:NR,getChoiceAttribute:kR,getChoiceAttributes:GC,getChoiceDecisions:OR,getChoiceValue:MR,getComponentAttribute:qR,getComponentAttributes:zC,getComponentDecisions:PR,getNumericAttribute:jR,getNumericAttributes:WC,getNumericDecisions:DR},Symbol.toStringTag,{value:"Module"})),FR="https://spc.cloud.ceventis.de/api/engine",LR={hcaEngineBaseUrl:FR};function BR(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??LR.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function es(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const YC=e=>t=>n=>g(n,k2(r=>e.equals(r,t)),Z(r=>g(n,M2(r,i=>t))),kd,st(()=>g(n,Pe(F2(t))))),Pu=YC({equals:(e,t)=>Sn.equals(e.attributeId,t.attributeId)}),VR=YC({equals:(e,t)=>e.choiceValueId===t.choiceValueId});class UR{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,c,l,f,d;const p=g(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],G(this.restToDomainMapper.mapToGlobalAttributeId)),h=I=>Oh(Sn)(I,p),v=g(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=g(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=g(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=g(((s=n.consequences)==null?void 0:s.componentConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=g(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),w=g(((c=n.consequences)==null?void 0:c.numericConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=g(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=g(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=g([],Pe(g(b,G(I=>I.attributeId))),Pe(g(T,G(I=>I.attributeId))),Pe(g(C,G(I=>I.attributeId))),Pe(g(w,G(I=>I.attributeId))),Pe(g(v,G(I=>I.attributeId))),Pe(g(E,G(I=>I.attributeId))),Pe(g(x,G(I=>I.attributeId))),Pe(g(m,G(I=>I.attributeId))),aa(Sn)),D=g(A,Pd(t.attributes,(I,N)=>{const _=t.attributes.find(L=>Sn.equals(L.attributeId,N));return Y(_).with({type:ct.Choice},(L,V)=>{const H=this.mergeChoice(V,g(E,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)),g(v,Wt(R=>Sn.equals(R.attributeId,N)),G(R=>R.payload)));return Pu(H)(I)}).with({type:ct.Numeric},(L,V)=>{const H=this.mergeNumeric(V,g(w,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)),g(C,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)));return Pu(H)(I)}).with({type:ct.Boolean},(L,V)=>{const H=this.mergeBoolean(V,g(T,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)),g(b,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)));return Pu(H)(I)}).with({type:ct.Component},(L,V)=>{const H=this.mergeComponent(V,g(m,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)),g(x,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)));return Pu(H)(I)}).exhaustive()}),G(I=>{const N=h(I.attributeId);return I.canContributeToConfigurationSatisfaction!=N?{...I,canContributeToConfigurationSatisfaction:N}:I}));return{...t,isSatisfied:g((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,be,st(()=>t.isSatisfied)),attributes:D}}mergeChoice(t,n,r){const i=g(n,Z(u=>u.values??[]),st(()=>[])),o=g(r),a=g([],Pe(g(i,G(u=>u.choiceValueId))),Pe(g(o,G(u=>u.choiceValueId))),G(es),aa(ft)),s=g(a,Pd(t.values,(u,c)=>{const l=g(i,fn(h=>h.choiceValueId===c)),f=g(o,fn(h=>h.choiceValueId===c)),d=g(t.values.find(h=>h.choiceValueId===c),be),p=this.mergeChoiceValue(c,d,l,f);return VR(p)(u)}));return{...t,isSatisfied:g(n,Z(u=>es(u.isSatisfied)),st(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=g(i,Z(s=>({state:this.toDecisionState(es(s.state)),kind:this.toDecisionKind(es(s.kind))})),st(()=>({state:g(n,ir(s=>g(s.decision,Z(u=>u.state)))),kind:g(n,ir(s=>g(s.decision,Z(u=>u.kind))),st(()=>Pt.Explicit))}))),a=g(r,Z(s=>g(Tm(s.possibleDecisionStates??[]),G(u=>this.toPossibleDecisionState(u)),Kn)),st(()=>g(n,Z(s=>s.possibleDecisionStates??[]),st(()=>[]))));return{choiceValueId:t,decision:g(o.state,Z(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=g(r,Z(a=>{const s=this.toDecisionState(es(a.state));return g(s,Z(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),st(()=>g(t.decision,Z(a=>({state:a.state,kind:a.kind}))))),o=g(n,Z(a=>g(Tm(a.possibleDecisionStates??[]),G(s=>this.toPossibleDecisionState(s)),Kn)),st(()=>t.possibleDecisionStates));return{...t,isSatisfied:g(n,Z(a=>a.isSatisfied),st(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:g(n,ir(i=>be(i.isSatisfied)),st(()=>t.isSatisfied)),decision:g(r,$i(()=>t.decision,i=>g(i.state,be,Z(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:g(n,ir(i=>be(i.isSatisfied)),st(()=>t.isSatisfied)),decision:g(r,$i(()=>t.decision,i=>g(i.state,be,Z(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:g(n,Z(i=>i.possibleDecisionStates),st(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return Y(t).with(bo.Included,()=>je(Jt.Included)).with(bo.Excluded,()=>je(Jt.Excluded)).otherwise(()=>ye)}toDecisionState(t){return Y(t).with(Wr.Included,()=>je(Jt.Included)).with(Wr.Excluded,()=>je(Jt.Excluded)).otherwise(()=>ye)}toDecisionKind(t){return Y(t).with(Vs.Implicit,()=>Pt.Implicit).with(Vs.Explicit,()=>Pt.Explicit).exhaustive()}}class GR{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return Y(t).with({type:Te.ChoiceValue},n=>({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Te.Component},n=>({type:qn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Te.Numeric},n=>({type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,Mt)})).with({type:Te.Boolean},n=>({type:qn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,Mt)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=g([...t],ai(u=>u.type!==Te.Boolean?ye:je({type:qn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:g(u.value,Mt)}))),o=g([...t],ai(u=>u.type!==Te.Numeric?ye:je({type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:g(u.value,Mt)}))),a=g([...t],ai(u=>u.type!==Te.ChoiceValue?ye:je({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=g([...t],ai(u=>u.type!==Te.Component?ye:je({type:qn.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=g([...t],ai(a=>a.type!==ct.Boolean?ye:g(a.decision,Vt(s=>s.kind===Pt.Explicit),Z(()=>this.mapToExplicitBooleanDecision(a))))),r=g([...t],ai(a=>a.type!==ct.Numeric?ye:g(a.decision,Vt(s=>s.kind===Pt.Explicit),Z(()=>this.mapToExplicitNumericDecision(a))))),i=g([...t],ai(a=>a.type!==ct.Component?ye:g(a.decision,Vt(s=>s.kind===Pt.Explicit),Z(()=>this.mapToExplicitComponentDecision(a))))),o=g([...t],ai(a=>a.type!==ct.Choice?ye:g(this.mapToExplicitChoiceDecisions(a),cu(s=>g(s,Po)))),W2);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return Y(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:g(t.componentPath,be,Z(Rd),Vn),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:Y(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Ve.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:qn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:g(t.decision,Z(n=>n.state),Mt)}}mapToExplicitNumericDecision(t){return{type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:g(t.decision,Z(n=>n.state),Mt)}}mapToExplicitComponentDecision(t){return{type:qn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(g(t.decision,Z(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return g(r.decision,Z(i=>i.kind===Pt.Explicit),st(()=>!1))}return g(t.values,Wt(n),G(r=>({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(g(r.decision,Z(i=>i.state)))})),Rd)}mapToDecisionState(t){return g(t,Z(n=>Y(n).with(Jt.Included,()=>Wr.Included).with(Jt.Excluded,()=>Wr.Excluded).exhaustive()),st(()=>Wr.Undefined))}mapToPossibleDecisionState(t){return Y(t).with(Jt.Included,()=>bo.Included).with(Jt.Excluded,()=>bo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return Y(t).with({subject:hn.attribute},n=>({type:zd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:hn.configuration},()=>({type:zd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return Y(t).with({subject:hn.boolean},n=>({type:fs.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.numeric},n=>({type:fs.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.component},n=>({type:fs.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:hn.choiceValue},n=>({type:fs.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}}class zR{constructor(){this.configurationSession={hasExplicitDecisions(t){return g(t.configuration.attributes,fn(n=>Y(n).with({type:ct.Boolean},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),ls)).with({type:ct.Numeric},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),ls)).with({type:ct.Choice},r=>g(r.values,fn(i=>g(i.decision,Z(o=>o.kind===Pt.Explicit),st(()=>!1))),ls)).with({type:ct.Component},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),ls)).exhaustive()),$i(()=>!1,()=>!0))},getExplicitDecisions(t){return g(t.configuration.attributes,G(n=>Y(n).with({type:ct.Boolean},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),Z(i=>({type:Te.Boolean,attributeId:r.attributeId,value:be(i.state)})),Z(i=>[i]))).with({type:ct.Numeric},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),Z(i=>({type:Te.Numeric,attributeId:r.attributeId,value:be(i.state)})),Z(i=>[i]))).with({type:ct.Choice},r=>g(r.values,G(i=>g(i.decision,Vt(o=>o.kind===Pt.Explicit),Z(o=>({type:Te.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:be(o.state)})))),Kn,bi)).with({type:ct.Component},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),Z(i=>({type:Te.Component,attributeId:r.attributeId,state:be(i.state)})),Z(i=>[i]))).exhaustive()),Kn,Dh)}}}}class WR{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 zR}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)=>g(this.engineApiClient.makeDecision(i,r),vr(Br),Yt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=Y(t).with({question:Gn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Gn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return g(i,vr(Br),Yt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return g(a,pr(s=>{var u,c,l,f;const d=g([],Pe(g(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],G(p=>this.restToDomainMapper.mapToBooleanDecision(p)))),Pe(g(((c=s.rejectedDecisions)==null?void 0:c.numericDecisions)??[],G(p=>this.restToDomainMapper.mapToNumericDecision(p)))),Pe(g(((l=s.rejectedDecisions)==null?void 0:l.componentDecisions)??[],G(p=>this.restToDomainMapper.mapToComponentDecision(p)))),Pe(g(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],G(p=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(p)))));return g(d,Po)?zr(rR.createConfigurationRejectedDecisionsConflict(d)):sa(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 g(i,Yt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return g(o,vr(Br),pr(a=>{const s={rejectedDecisions:{booleanDecisions:Ve.array(Ve.any)}},u={decisionExplanations:Ve.array(Ve.any)};return Y(a).with(s,c=>_a(c)).with(u,c=>zr(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,i,n))).otherwise(()=>zr({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 g(sa(t),pr(r=>g(r.sessionId,$i(()=>this.initializeInner(r,!1),()=>sa(r)))),pr(r=>g(r.sessionId,Mh(()=>({type:we.ConfigurationUnauthenticated})),pr(i=>n(i,r)))))}initializeInner(t,n){return g(EN,()=>g(t.sessionId,kN,jN(s=>n?RN(s):g(this.sessionHandler.close(s),_c(()=>ye,()=>ye)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return g(s,gN(()=>({type:we.ConfigurationUnauthenticated})),dC(()=>this.sessionHandler.create(u)))},s=>g(s,TN(u=>g(bi(t),Vt(this.interpreter.configurationSession.hasExplicitDecisions),Z(c=>this.replaceDecisions(u,c)),st(()=>sa({}))))),s=>g(s,pr(u=>{const c=this.determineConsequences(u),l=this.determineDecisions(u),f=zD(CN)({consequences:c,decisions:l});return g(f,Yt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Yt(d=>({sessionId:bi(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return g(this.engineApiClient.getDecisions(t),vr(Br))}determineConsequences(t){return g(this.engineApiClient.getConsequence(t),vr(Br))}}class HR{constructor(t,n){this.onConfigurationChangedHandler=ye,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return g(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return g(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ye}}restoreConfiguration(t){return g(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return g(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return g(this.configurationSession.sessionId,Z(t=>this.sessionHandler.close(t)),Z(Xn(Yt(t=>{this.configurationSession={...this.configurationSession,sessionId:ye}}))),st(Nl(GP())))}applySolution(t){return g(this.configurationSession.solutions,fn(n=>tR.equals(n,t)),Mh(()=>({type:we.ConfigurationSolutionNotAvailable})),Yt(n=>n.decisions),pr(n=>this.setMany(n,t.mode)))}setMany(t,n){return g(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),qc(r=>()=>{const i=Y(r).with({decisionExplanations:Ve.array(Ve.any)},o=>je(o.decisionExplanations)).otherwise(()=>ye);this.configurationSession={...this.configurationSession,solutions:g(i,Z(Xn(G(o=>o.solution))),st(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=Y(t).with({decisionExplanations:Ve.array(Ve.any)},r=>r.decisionExplanations).otherwise(()=>[]);return g(n,G(r=>r.solution))}invalidateAvailableSolutions(){return AN(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return qc(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return _s(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Xn(_s(t=>()=>{this.configurationSession=t,g(this.onConfigurationChangedHandler,ON(n=>()=>n(this.configurationSession.configuration)))}),Yt(t=>t.configuration),this.invalidateAvailableSolutions())}}class KR{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=$P(r,IP.concat(OP(i),AP(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=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Uo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Uo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Uo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Uo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Uo(this.policy,r,i=>g(i,Qi(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return Y(t).with({type:we.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:we.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}}class YR{constructor(){this.queue=[],this.operating=ye}push(t){const n=new XR(t);return this.queue.push(n),this.operating=g(this.operating,st(()=>this.start()),bi),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=g(t,G(r=>r.argument),Pd(ye,(r,i)=>this.reduce(r,i)),Z(Xn(r=>this.execute(r),r=>r.then(i=>{g(t,G(o=>{o.resolve(i)}))}).catch(i=>{g(t,G(o=>{o.reject(i)}))}))),Mt);n&&await n}this.operating=ye}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}}class XR{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}}class JR extends YR{constructor(t){super(),this.inner=t}reduce(t,n){return je(n)}async execute(t){return await this.inner.setSessionContext(t)()}}class QR{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new JR(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(KP.equals(n,t))return _a(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)}}class ZR{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)),g(r(),qc(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),_s(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)}}let ek=class XC{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+Fh()}static new(t){return new XC(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 tk(e){e=BR(e);const t=new dR(e.hcaEngineBaseUrl),n=new $C,r=new GR,i=new DC,o=new VP,a=new UR(n),s=Y(e.sessionHandler).with({create:Ve.any,close:Ve.any},l=>l).with({accessToken:Ve.string},l=>new fR(t,o,n,l)).with({sessionCreateUrl:Ve.string,sessionDeleteUrl:Ve.string},l=>new pR(o,l)).exhaustive(),u=new WR(s,t,n,r,i,a),c=(l,f)=>g(new HR(l,f),d=>new KR(d),d=>new QR(d),ek.new,d=>new ZR(d,!1));return new mR(u,c)}const nk=Fa.equals,rk=EC.equals;jP.equals;function Vl(e){return Tn((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 ws=(e=>(e.ConfigurationEngineRestApiUnauthorized="Generic::Unauthorized",e.ClientError="Generic::LocalClientError",e.ServerError="Generic::ServerError",e.UnhandledResponseStatus="LocalUnhandledResponseStatus",e.LowLevelCommunicationError="LocalLowLevelCommunicationError",e))(ws||{}),I0=(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))(I0||{});const rR=e=>Object.values(I0).includes(e),iR=e=>rR(e)?je(e):ye;function oR(e){const t=n=>Y(n).with("ConfigurationModelNotFound",()=>({type:Ce.ConfigurationModelNotFound})).with("DecisionsToRespectInvalid",()=>({type:Ce.DecisionsToRespectInvalid})).with(Ve.union("ChoiceAttributeNotFound","NumericAttributeNotFound","BooleanAttributeNotFound"),()=>({type:Ce.ConfigurationAttributeNotFound})).with("ChoiceValueNotFound",()=>({type:Ce.ConfigurationChoiceValueNotFound})).with("DecisionInvalid",()=>({type:Ce.ConfigurationConflict})).with("NumericDecisionOutOfRange",()=>({type:Ce.ConfigurationConflict,reason:Bh.NumericDecisionOutOfRange})).with("ConflictWithConsequence",()=>({type:Ce.ConfigurationConflict})).with(Ve.union("SessionNotFound","Unauthorized","AuthenticationFailure"),()=>({type:Ce.ConfigurationUnauthenticated})).with("ConfigurationModelInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("DeploymentStore.Core.Store.SnapshotInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("SnapshotInvalid",()=>({type:Ce.ConfigurationModelInvalid})).with("InitializationFailure",()=>({type:Ce.ConfigurationInitializationFailure})).with("ConfigurationModelNotFeasible",r=>({type:Ce.ConfigurationModelNotFeasible,constraintExplanations:[]})).with("SetDecisionConflict",()=>({type:Ce.ConfigurationConflict})).with("SpecifiedDeploymentForbidden",()=>({type:Ce.SpecifiedDeploymentForbidden,detail:e.detail,deploymentName:e.deploymentName,channel:e.channel})).exhaustive();return g(e.type,iR,Z(t))}const aR=e=>Object.values(ws).includes(e),sR=e=>aR(e)?je(e):ye;function uR(e){return g(e,sR,Z(n=>Y(n).with("Generic::LocalClientError",()=>({type:Ce.ConfigurationApplicationError})).with("Generic::ServerError",()=>({type:Ce.ServiceError})).with("LocalLowLevelCommunicationError",()=>({type:Ce.CommunicationError})).with("Generic::Unauthorized",()=>({type:Ce.ConfigurationUnauthenticated})).with("LocalUnhandledResponseStatus",()=>({type:Ce.Unknown})).exhaustive()))}function Br(e,t){nR(e,t);const n=e.type;return g(ye,Im(()=>oR(e)),Im(()=>uR(n)),st(()=>(console.error("InterpretEngineError encountered unexpected error type","ProblemDetails",e,"Context",t),{type:Ce.Unknown})))}let cR=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 g(this.engineApiClient.createSessionUsingJwtBearer(n,this.options.accessToken),vr(r=>Br(r,"ClientSideSessionLifetimeHandler - create")),pr(r=>this.restToDomainMapper.mapToSessionId(r)),VP(()=>({type:Ce.ConfigurationUnauthenticated})))}close(t){return g(this.engineApiClient.deleteSessionUsingJwtBearer(t,this.options.accessToken),vr(n=>Br(n,"ClientSideSessionLifetimeHandler - close")),Yt(()=>Lr()))}};var A0=(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))(A0||{});function jr(e,t,n){const r=g(Array.isArray(e)?e:[e],EP);return g(Am(()=>fetch(r,t),i=>({type:"error"})),pr(i=>g(Am(async()=>{const o=await i.json();return{response:i,data:o}},()=>i))),d0(i=>i.status===401?bi({type:ws.ConfigurationEngineRestApiUnauthorized,status:401}):i.status===204?ja({response:i,data:{}}):i.type==="error"?bi({type:ws.LowLevelCommunicationError}):bi({type:ws.UnhandledResponseStatus})),pr(i=>g(n(i),Mh(()=>i.data))))}function Bd(e,t){return jr(e,t,n=>{if(n.response.status===200)return gi(n.data);if(n.response.status===409){const r=n.data;return Y(r).with({type:"ConfigurationModelInvalid"},i=>gi(r)).with({type:"ConfigurationModelNotFeasible"},i=>gi(r)).otherwise(()=>ye)}return ye})}let lR=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 Bd([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 Bd([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 jr([this.baseUrl,"v2/session/configuration/decision/many"],r,i=>i.response.status===200||i.response.status===409?je(i.data):ye)}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 jr([this.baseUrl,"v2/session/configuration/decision"],r,i=>i.response.status===200?je(i.data):ye)}getDecisions(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return jr([this.baseUrl,"v2/session/configuration/decision"],n,r=>r.response.status===200?je(r.data):ye)}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 jr([this.baseUrl,"v2/session/configuration/consequence/explain/why-state-not-possible"],r,i=>i.response.status===200?je(i.data):ye)}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 jr([this.baseUrl,"v2/session/configuration/consequence/explain/why-not-satisfied"],r,i=>i.response.status===200?je(i.data):ye)}getConsequence(t){const n={method:"GET",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}};return jr([this.baseUrl,"v2/session/configuration/consequence"],n,r=>r.response.status===200?je(r.data):ye)}deleteSessionUsingJwtBearer(t,n){const r={method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8",Authorization:`Bearer ${n}`}};return jr([this.baseUrl,`v2/session/${t}`],r,i=>i.response.status===204?je({}):ye)}};var bo=(e=>(e.Included="Included",e.Excluded="Excluded",e))(bo||{}),Vd=(e=>(e.Mandatory="Mandatory",e.Optional="Optional",e))(Vd||{}),Ud=(e=>(e.Always="Always",e.Optional="Optional",e))(Ud||{}),Bs=(e=>(e.Implicit="Implicit",e.Explicit="Explicit",e))(Bs||{}),Gr=(e=>(e.Included="Included",e.Excluded="Excluded",e.Undefined="Undefined",e))(Gr||{}),qn=(e=>(e.Choice="Choice",e.Numeric="Numeric",e.Boolean="Boolean",e.Component="Component",e))(qn||{}),Gd=(e=>(e.NotAvailable="NotAvailable",e.StateNotPossible="StateNotPossible",e))(Gd||{}),zd=(e=>(e.Attribute="Attribute",e.Configuration="Configuration",e))(zd||{}),ls=(e=>(e.Boolean="Boolean",e.Numeric="Numeric",e.ChoiceValue="ChoiceValue",e.Component="Component",e))(ls||{});const jn=gn({localId:ft,componentPath:Bl(ft),sharedConfigurationModelId:Lh(ft)});let $0=class{mapToDecisions(t){return{}}mapToSessionId(t){return Y(t).with({sessionId:Ve.string},n=>ja(n.sessionId)).with({type:"ConfigurationModelNotFeasible"},n=>{const r=g(n.constraintExplanations,G(i=>this.mapToConstraintExplanation(i)));return bi({type:Ce.ConfigurationModelNotFeasible,constraintExplanations:r})}).with({type:"ConfigurationModelInvalid"},()=>bi({type:Ce.ConfigurationModelInvalid})).otherwise(()=>bi({type:Ce.Unknown}))}mapToExplainAnswer(t,n){const r=Y(n).with({question:Gn.whyIsStateNotPossible,subject:hn.boolean},a=>[{type:Te.Boolean,attributeId:a.attributeId,value:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:hn.numeric},a=>[{type:Te.Numeric,attributeId:a.attributeId,value:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:hn.component},a=>[{type:Te.Component,attributeId:a.attributeId,state:je(a.state)}]).with({question:Gn.whyIsStateNotPossible,subject:hn.choiceValue},a=>[{type:Te.ChoiceValue,attributeId:a.attributeId,choiceValueId:a.choiceValueId,state:je(a.state)}]).otherwise(()=>[]),i=g(t.decisionExplanations,G(a=>this.mapToDecisionExplanation(a,r,{type:"Default"}))),o=g(t.constraintExplanations,G(a=>this.mapToConstraintExplanation(a)));return Y(n).with({answerType:uo.decisions},()=>({decisionExplanations:i})).with({answerType:uo.constraints},()=>({constraintExplanations:o})).with({answerType:uo.all},()=>({constraintExplanations:o,decisionExplanations:i})).exhaustive()}mapToConfigurationSetManyConflictFailure(t,n,r){const i=this.mapToExplicitDecisions(n);return{type:Ce.ConfigurationSetManyConflict,decisionExplanations:g(t.decisionExplanations,G(o=>this.mapToDecisionExplanation(o,i,r))),constraintExplanations:g(t.constraintExplanations,G(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:Te.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:be(t.state)}}mapToNumericDecision(t){return{type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),value:be(t.state)}}mapToComponentDecision(t){return{type:Te.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(t.state)}}mapToExplicitChoiceValueDecision(t){return{type:Te.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 g(this.mapToDecisionState(t.state),Z(n=>({kind:this.mapToDecisionKind(t.kind),state:n})))}mapToConstraintExplanation(t){return{causedByRules:g(t.causedByRules,G(n=>this.mapToRuleConstraint(n))),causedByCardinalities:g(t.causedByCardinalities,G(n=>this.mapToCardinalityConstraint(n)))}}mapToRuleConstraint(t){return{type:pa.Rule,ruleId:this.mapToGlobalConstraintId(t.constraintId)}}mapToCardinalityConstraint(t){return{type:pa.Cardinality,attributeId:this.mapToGlobalAttributeId(t.attributeId)}}mapToExplicitDecisions(t){const n=g(t.booleanDecisions??[],G(a=>({type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:be(a.state)}))),r=g(t.numericDecisions??[],G(a=>({type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(a.attributeId),value:be(a.state)}))),i=g(t.componentDecisions??[],G(a=>({type:Te.Component,attributeId:this.mapToGlobalAttributeId(a.attributeId),state:g(be(a.state),Z(s=>this.mapToDecisionState(s)),kd)}))),o=g(t.choiceDecisions??[],G(a=>({type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(a.attributeId),choiceValueId:a.choiceValueId,state:g(be(a.state),Z(s=>this.mapToDecisionState(s)),kd)})));return g([],Pe(n),Pe(r),Pe(i),Pe(o))}mapToDecisionExplanation(t,n,r){const i=g(t.causedByBooleanDecisions,G(h=>this.mapToCausedByBooleanDecision(h))),o=g(t.causedByNumericDecisions,G(h=>this.mapToCausedByNumericDecision(h))),a=g(t.causedByComponentDecisions,G(h=>this.mapToCausedByComponentDecision(h))),s=g(t.causedByChoiceDecisions,G(h=>this.mapToCausedByChoiceValueDecision(h))),u=g(i,G(h=>({type:Te.Boolean,attributeId:h.attributeId,value:ye}))),c=g(o,G(h=>({type:Te.Numeric,attributeId:h.attributeId,value:ye}))),l=g(a,G(h=>({type:Te.Component,attributeId:h.attributeId,state:ye}))),f=g(s,G(h=>({type:Te.ChoiceValue,attributeId:h.attributeId,choiceValueId:h.choiceValueId,state:ye}))),d=g([],Pe(u),Pe(c),Pe(l),Pe(f)),p=o0(Tn((h,v)=>{const E=Sn.equals(h.attributeId,v.attributeId);return Y({a:h,b:v}).with({a:{type:Te.ChoiceValue},b:{type:Te.ChoiceValue}},x=>E&&x.a.choiceValueId===x.b.choiceValueId).otherwise(()=>E)}))(d)(n);return{causedByBooleanDecisions:i,causedByNumericDecisions:o,causedByComponentDecisions:a,causedByChoiceDecisions:s,solution:{decisions:g([],Pe(d),Pe(p)),mode:r}}}mapToCausedByBooleanDecision(t){return{type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToReason(t){return Y(t).with(Gd.NotAvailable,()=>Ld.NotAvailable).with(Gd.StateNotPossible,()=>Ld.StateNotPossible).exhaustive()}mapToCausedByNumericDecision(t){return{type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state,reason:this.mapToReason(t.reason)}}mapToCausedByComponentDecision(t){return{type:Te.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToPossibleDecisionState(t.state),reason:this.mapToReason(t.reason)}}mapToCausedByChoiceValueDecision(t){return{type:Te.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 g(n.canAttributeContributeToConfigurationSatisfaction,fn(p=>jn.equals(p,d)),cs)}const i=g([],Pe(g(t.choiceValueDecisions,G(d=>d.attributeId))),Pe(g(n.choiceConsequences,G(d=>d.attributeId))),oa(jn)),o=g(i,G(d=>{const p=g(t.choiceValueDecisions??[],H2(v=>jn.equals(v.attributeId,d))),h=g(n.choiceConsequences??[],Hi(v=>jn.equals(v.attributeId,d)));return g(h,Z(v=>this.mapToChoiceAttributes(v,p,r(d))))}),Kn),a=g([],Pe(g(t.numericDecisions,G(d=>d.attributeId))),Pe(g(n.numericConsequences,G(d=>d.attributeId))),oa(jn)),s=g(a,G(d=>{const p=g(t.numericDecisions??[],Hi(v=>jn.equals(v.attributeId,d))),h=g(n.numericConsequences??[],Hi(v=>jn.equals(v.attributeId,d)));return g(h,Z(v=>this.mapToNumericAttribute(v,p,r(d))))}),Kn),u=g([],Pe(g(t.booleanDecisions,G(d=>d.attributeId))),Pe(g(n.booleanConsequences,G(d=>d.attributeId))),oa(jn)),c=g(u,G(d=>{const p=g(t.booleanDecisions??[],Hi(v=>jn.equals(v.attributeId,d))),h=g(n.booleanConsequences??[],Hi(v=>jn.equals(v.attributeId,d)));return g(h,Z(v=>this.mapToBooleanAttribute(v,p,r(d))))}),Kn),l=g([],Pe(g(t.componentDecisions,G(d=>d.attributeId))),Pe(g(n.componentConsequences,G(d=>d.attributeId))),oa(jn)),f=g(l,G(d=>{const p=g(t.componentDecisions??[],Hi(v=>jn.equals(v.attributeId,d))),h=g(n.componentConsequences??[],Hi(v=>jn.equals(v.attributeId,d)));return g(h,Z(v=>this.mapToComponentAttribute(v,p,r(d))))}),Kn);return g([],Pe(o),Pe(f),Pe(s),Pe(c))}mapToComponentAttribute(t,n,r){return{type:ct.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,possibleDecisionStates:g(t.possibleDecisionStates,uc(i=>this.mapToPossibleDecisionState(i))),decision:g(n,ir(i=>g(this.mapToDecisionState(i.state),Z(o=>({state:o,kind:i.kind}))))),inclusion:this.mapToInclusion(t.inclusion),selection:g(t.selection,be,Z(i=>this.mapToSelection(i)),Mt),canContributeToConfigurationSatisfaction:r}}mapToChoiceAttributes(t,n,r){const i=g(t.values,uc(o=>{const a=g(n,fn(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:g(n,ir(i=>g(i.state,be,Z(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:g(n,ir(i=>g(i.state,be,Z(o=>({kind:this.mapToDecisionKind(i.kind),state:o}))))),canContributeToConfigurationSatisfaction:r}}mapToChoiceValue(t,n){const r=g(t.possibleDecisionStates,uc(i=>this.mapToPossibleDecisionState(i)));return{choiceValueId:t.choiceValueId,decision:g(n,ir(i=>this.mapToChoiceValueDecision(i))),possibleDecisionStates:r}}mapToDecisionKind(t){return Y(t).with(Bs.Implicit,()=>Pt.Implicit).with(Bs.Explicit,()=>Pt.Explicit).exhaustive()}mapToDecisionState(t){return Y(t).with(Gr.Included,()=>je(Jt.Included)).with(Gr.Excluded,()=>je(Jt.Excluded)).with(Gr.Undefined,()=>ye).exhaustive()}mapToPossibleDecisionState(t){return Y(t).with(bo.Included,()=>Jt.Included).with(bo.Excluded,()=>Jt.Excluded).exhaustive()}mapToSelection(t){return Y(t).with(Vd.Mandatory,()=>yo.Mandatory).with(Vd.Optional,()=>yo.Optional).exhaustive()}mapToInclusion(t){return Y(t).with(Ud.Always,()=>go.Always).with(Ud.Optional,()=>go.Optional).exhaustive()}mapToCardinality(t){return{lowerBound:t.lowerBound,upperBound:t.upperBound}}},fR=class{constructor(t,n){this.restToDomainMapper=new $0,this.contractToRestMapper=t,this.options=n}create(t){const n=this.contractToRestMapper.mapToCreateSessionRequest(t),r=Bd(this.options.sessionCreateUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8"},body:JSON.stringify(n)});return g(r,vr(i=>Br(i,"ServerSideSessionLifetimeHandler - create")),pr(i=>this.restToDomainMapper.mapToSessionId(i)))}close(t){return g(jr(this.options.sessionDeleteUrl,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json;charset=UTF-8","X-SESSION-ID":t}},n=>n.response.status===A0.NoContent?je({}):ye),vr(n=>Br(n,"ServerSideSessionLifetimeHandler - close")),Yt(Lr))}};const O0={whyIsNotSatisfied:{configuration:{question:_t.whyIsNotSatisfied,subject:Qe.configuration},attribute:e=>({question:_t.whyIsNotSatisfied,subject:Qe.attribute,attributeId:e})},whyIsStateNotPossible:{choice:e=>({choiceValue:t=>({state:n=>({question:_t.whyIsStateNotPossible,subject:Qe.choiceValue,attributeId:e,choiceValueId:t,state:n})})}),boolean:e=>({state:t=>({question:_t.whyIsStateNotPossible,subject:Qe.boolean,attributeId:e,state:t})}),numeric:e=>({state:t=>({question:_t.whyIsStateNotPossible,subject:Qe.numeric,attributeId:e,state:t})}),component:e=>({state:t=>({question:_t.whyIsStateNotPossible,subject:Qe.component,attributeId:e,state:t})})}};let dR=class{constructor(t,n,r){this.inner=t,this.contractToDomainMapper=n,this.domainToContractMapper=r,this.onConfigurationChangedHandler=ye}setOnConfigurationChangedHandler(t){const n=g(t,be,Z(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 g(this.inner.setSessionContext(n),Yt(Lr),this.adaptToContractPromise())()}async restoreConfiguration(t){const n=this.contractToDomainMapper.mapToConfiguration(t);return await g(this.inner.restoreConfiguration(n),Yt(Lr),this.adaptToContractPromise())()}async makeDecision(t){const n=this.contractToDomainMapper.mapToAttributeDecision(t);return await g(this.inner.makeDecision(n),Yt(Lr),this.adaptToContractPromise())()}async setMany(t,n){const r=this.contractToDomainMapper.mapToAttributeDecisions(t),i=this.contractToDomainMapper.mapToMode(n);return await g(this.inner.setMany(r,i),Yt(Lr),this.adaptToContractPromise())()}async applySolution(t){const n=this.contractToDomainMapper.mapToSolution(t);return await g(this.inner.applySolution(n),Yt(Lr),this.adaptToContractPromise())()}async explain(t,n){const r=typeof t=="function"?t(O0):t,i=this.contractToDomainMapper.mapToExplainQuestion(r,n);return await g(this.inner.explain(i),Yt(o=>this.domainToContractMapper.mapToExplainAnswer(o)),this.adaptToContractPromise())()}async close(){return await g(this.inner.close(),vr(t=>this.domainToContractMapper.mapToFailureResult(t)),_c(Promise.reject,t=>Promise.resolve()))()}adaptToContractPromise(){return Xn(vr(t=>this.domainToContractMapper.mapToFailureResult(t)),_c(t=>Promise.reject(t),t=>Promise.resolve(t)))}},pR=class{mapToExplainQuestion(t,n){const r={answerType:Y(n).with("decisions",()=>uo.decisions).with("constraints",()=>uo.constraints).with("full",()=>uo.all).exhaustive()};return Y(t).with({question:_t.whyIsNotSatisfied,subject:Qe.configuration},i=>({...r,question:Gn.whyIsNotSatisfied,subject:hn.configuration})).with({question:_t.whyIsNotSatisfied,subject:Qe.attribute},i=>({...r,question:Gn.whyIsNotSatisfied,subject:hn.attribute,attributeId:this.mapToGlobalAttributeId(i.attributeId)})).with({question:_t.whyIsStateNotPossible,subject:Qe.choiceValue},i=>({...r,question:Gn.whyIsStateNotPossible,subject:hn.choiceValue,attributeId:this.mapToGlobalAttributeId(i.attributeId),choiceValueId:i.choiceValueId,state:this.mapToDecisionState(i.state)})).with({question:_t.whyIsStateNotPossible,subject:Qe.component},i=>({...r,question:Gn.whyIsStateNotPossible,subject:hn.component,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:this.mapToDecisionState(i.state)})).with({question:_t.whyIsStateNotPossible,subject:Qe.numeric},i=>({...r,question:Gn.whyIsStateNotPossible,subject:hn.numeric,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).with({question:_t.whyIsStateNotPossible,subject:Qe.boolean},i=>({...r,question:Gn.whyIsStateNotPossible,subject:hn.boolean,attributeId:this.mapToGlobalAttributeId(i.attributeId),state:i.state})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:g(t.attributes,G(n=>this.mapToAttribute(n)))}}mapToAttributeDecisions(t){return g(t,G(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 Y(t).with({type:W.Choice,choiceValueId:Ve.string},n=>({type:Te.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionStateOption(n.state)})).with({type:W.Numeric},n=>({type:Te.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:be(n.state)})).with({type:W.Boolean},n=>({type:Te.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),value:be(n.state)})).with({type:W.Component},n=>({type:Te.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(be(n.state),ir(r=>this.mapToDecisionStateOption(r)))})).exhaustive()}mapToDecisionsToRespect(t){return g(be(t),Z(n=>g(n,G(r=>({attributeId:this.mapToGlobalAttributeId(r.attributeId),decisions:g(r.decisions,G(i=>this.mapToGlobalAttributeId(i)))})))))}mapToMode(t){return Y(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 Y(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 Y(t).with({type:Oi.Package},n=>({type:Ls.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Oi.Channel},n=>({type:Ls.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToSolution(t){return{decisions:g(t.decisions,G(n=>this.mapToAttributeDecision(n))),mode:this.mapToMode(t.mode)}}mapToAttribute(t){return Y(t).with({type:W.Boolean},n=>({type:ct.Boolean,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,possibleDecisionStates:n.possibleDecisionStates,selection:this.mapToSelection(n.selection),decision:g(n.decision,be,Z(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.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:g(n.decision,be,Z(r=>({kind:this.mapToDecisionKind(r.kind),state:r.state}))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Choice},n=>({type:ct.Choice,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,cardinality:{lowerBound:n.cardinality.lowerBound,upperBound:n.cardinality.upperBound},values:g(n.values,G(r=>this.mapToChoiceValue(r))),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).with({type:W.Component},n=>({type:ct.Component,attributeId:this.mapToGlobalAttributeId(n.id),isSatisfied:n.isSatisfied,decision:g(n.decision,be,ir(r=>g(this.mapToDecisionStateOption(r.state),Z(i=>({kind:this.mapToDecisionKind(r.kind),state:i}))))),possibleDecisionStates:g(n.possibleDecisionStates,G(r=>this.mapToDecisionStateOption(r)),Kn),selection:g(n.selection,be,Z(r=>this.mapToSelection(r)),Mt),inclusion:this.mapToInclusion(n.inclusion),canContributeToConfigurationSatisfaction:n.canContributeToConfigurationSatisfaction})).exhaustive()}mapToChoiceValue(t){return{choiceValueId:t.id,decision:this.mapToChoiceValueDecision(t),possibleDecisionStates:g(t.possibleDecisionStates,G(n=>this.mapToDecisionStateOption(n)),Kn)}}mapToChoiceValueDecision(t){return g(t.decision,be,ir(n=>g(this.mapToDecisionStateOption(n.state),Z(r=>({state:r,kind:this.mapToDecisionKind(n.kind)})))))}mapToDecisionKind(t){return Y(t).with($e.Implicit,()=>Pt.Implicit).with($e.Explicit,()=>Pt.Explicit).exhaustive()}mapToSelection(t){return Y(t).with(Si.Mandatory,()=>yo.Mandatory).with(Si.Optional,()=>yo.Optional).exhaustive()}mapToInclusion(t){return Y(t).with(ya.Always,()=>go.Always).with(ya.Optional,()=>go.Optional).exhaustive()}mapToDecisionState(t){return Y(t).with(Ve.union(bt.Included,ot.Included),()=>Jt.Included).with(Ve.union(bt.Excluded,ot.Excluded),()=>Jt.Excluded).exhaustive()}mapToDecisionStateOption(t){return g(be(t),Z(n=>this.mapToDecisionState(n)))}mapToUsageRuleParameters(t){return t??{}}mapToAllowedInExplain(t){return g(t,be,Z(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})))}mapToAllowedRulesInExplain(t){return g(t,be,Z(n=>Y(n).returnType().with({type:pn.all},()=>({type:co.all})).with({type:pn.none},()=>({type:co.none})).with({type:pn.specific},r=>({type:co.specific,rules:g(r.rules,G(this.mapToGlobalConstraintId))})).exhaustive()))}},D0=class{mapToExplainAnswer(t){const n=Y(t).with({decisionExplanations:Ve.array(Ve.any)},i=>g(i.decisionExplanations,G(o=>this.mapToDecisionExplanation(o)))).otherwise(()=>[]),r=Y(t).with({constraintExplanations:Ve.array(Ve.any)},i=>g(i.constraintExplanations,G(o=>this.mapToConstraintExplanation(o)))).otherwise(()=>[]);return{decisionExplanations:n,constraintExplanations:r}}mapToConstraintExplanation(t){return{causedByCardinalities:g(t.causedByCardinalities,G(n=>this.mapToGlobalAttributeId(n.attributeId))),causedByRules:g(t.causedByRules,G(n=>this.mapToGlobalConstraintId(n.ruleId)))}}mapToDecisionExplanation(t){const n=g(t.causedByChoiceDecisions,G(a=>this.mapToCausedByChoiceAttributeDecision(a))),r=g(t.causedByComponentDecisions,G(a=>this.mapToCausedByComponentAttributeDecision(a))),i=g(t.causedByNumericDecisions,G(a=>this.mapToCausedByNumericAttributeDecision(a))),o=g(t.causedByBooleanDecisions,G(a=>this.mapToCausedByBooleanAttributeDecision(a)));return{causedByDecisions:g([],Pe(n),Pe(r),Pe(i),Pe(o)),solution:this.mapToSolution(t.solution)}}mapToSolution(t){return{decisions:g(t.decisions,G(n=>this.mapToExplicitDecision(n))),mode:this.mapToMode(t.mode)}}mapToMode(t){return Y(t).with({type:"DropExistingDecisions"},n=>({type:"DropExistingDecisions",conflictHandling:this.mapToConflictHandling(n.conflictHandling)})).otherwise(()=>({type:"Default"}))}mapToConflictHandling(t){return Y(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 Y(t).with({type:Ce.ConfigurationConflict},n=>({type:vt.ConfigurationConflict,reason:Y(n.reason).with(Bh.NumericDecisionOutOfRange,()=>T0.NumericDecisionOutOfRange).otherwise(()=>{})})).with({type:Ce.ConfigurationApplicationError},()=>({type:vt.ConfigurationApplicationError})).with({type:Ce.ConfigurationUnauthenticated},()=>({type:vt.ConfigurationUnauthenticated})).with({type:Ce.ConfigurationModelNotFound},()=>({type:vt.ConfigurationModelNotFound})).with({type:Ce.ConfigurationTimeout},()=>({type:vt.ConfigurationTimeout})).with({type:Ce.ConfigurationAttributeNotFound},()=>({type:vt.ConfigurationAttributeNotFound})).with({type:Ce.ConfigurationChoiceValueNotFound},()=>({type:vt.ConfigurationChoiceValueNotFound})).with({type:Ce.ConfigurationSolutionNotAvailable},()=>({type:vt.ConfigurationSolutionNotAvailable})).with({type:Ce.ConfigurationRejectedDecisionsConflict},n=>{const r=g(n.rejectedDecisions,G(i=>this.mapToExplicitDecision(i)));return LP.createConfigurationRejectedDecisionsConflict(r)}).with({type:Ce.DecisionsToRespectInvalid},()=>({type:vt.DecisionsToRespectInvalid})).with({type:Ce.ServiceError},()=>({type:vt.ServiceError})).with({type:Ce.CommunicationError},()=>({type:vt.CommunicationError})).with({type:Ce.Unknown},()=>({type:vt.Unknown})).with({type:Ce.ConfigurationModelInvalid},()=>({type:vt.ConfigurationModelInvalid})).with({type:Ce.ConfigurationInitializationFailure},()=>({type:vt.ConfigurationInitializationFailure})).with({type:Ce.ConfigurationModelNotFeasible},n=>({type:vt.ConfigurationModelNotFeasible,constraintExplanations:g(n.constraintExplanations,G(r=>this.mapToConstraintExplanation(r)))})).with({type:Ce.ConfigurationSetManyConflict},n=>({type:vt.ConfigurationSetManyConflict,decisionExplanations:g(n.decisionExplanations,G(r=>this.mapToDecisionExplanation(r))),constraintExplanations:g(n.constraintExplanations,G(r=>this.mapToConstraintExplanation(r)))})).with({type:Ce.SpecifiedDeploymentForbidden},n=>({type:vt.SpecifiedDeploymentForbidden,detail:n.detail,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToConfiguration(t){return{isSatisfied:t.isSatisfied,attributes:g(t.attributes,G(n=>this.mapToAttribute(n)))}}mapToDecisionsToRespect(t){return g(t,Z(Xn(G(n=>({attributeId:this.mapToGlobalAttributeId(n.attributeId),decisions:g(n.decisions,G(r=>this.mapToGlobalAttributeId(r)))})))),Vn)}mapToGlobalAttributeId(t){return{localId:t.localId,sharedConfigurationModelId:t.sharedConfigurationModel,componentPath:[...t.componentPath??[]]}}mapToGlobalConstraintId(t){return{localId:t.localId,configurationModelId:t.configurationModelId}}mapToConfigurationModelSource(t){return Y(t).with({type:Ls.Package},n=>({type:Oi.Package,configurationModelPackage:n.configurationModelPackage})).with({type:Ls.Channel},n=>({type:Oi.Channel,deploymentName:n.deploymentName,channel:n.channel})).exhaustive()}mapToExplicitDecision(t){return Y(t).with({type:Te.ChoiceValue},n=>({type:W.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.state,Z(r=>this.mapToChoiceValueDecisionState(r)),Mt),choiceValueId:n.choiceValueId})).with({type:Te.Component},n=>({type:W.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.state,Z(r=>this.mapToComponentDecisionState(r)),Mt)})).with({type:Te.Numeric},n=>({type:W.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,Mt)})).with({type:Te.Boolean},n=>({type:W.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,Mt)})).exhaustive()}mapToCardinality(t){return Y(t).with(pa.Cardinality,()=>lc.Cardinality).with(pa.Component,()=>lc.Component).with(pa.Rule,()=>lc.Rule).exhaustive()}mapToCausedByAttributeDecision(t){return Y(t).with({type:Te.ChoiceValue},n=>this.mapToCausedByChoiceAttributeDecision(n)).with({type:Te.Numeric},n=>this.mapToCausedByNumericAttributeDecision(n)).with({type:Te.Boolean},n=>this.mapToCausedByBooleanAttributeDecision(n)).with({type:Te.Component},n=>this.mapToCausedByComponentAttributeDecision(n)).exhaustive()}mapToCausedByChoiceAttributeDecision(t){return{type:W.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:t.choiceValueId,state:this.mapToChoiceValueDecisionState(t.state)}}mapToCausedByNumericAttributeDecision(t){return{type:W.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByBooleanAttributeDecision(t){return{type:W.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:t.state}}mapToCausedByComponentAttributeDecision(t){return{type:W.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToComponentDecisionState(t.state)}}mapToSelection(t){return Y(t).with(yo.Mandatory,()=>Si.Mandatory).with(yo.Optional,()=>Si.Optional).exhaustive()}mapToAttribute(t){const n={id:this.mapToGlobalAttributeId(t.attributeId),isSatisfied:t.isSatisfied,canContributeToConfigurationSatisfaction:t.canContributeToConfigurationSatisfaction};return Y(t).with({type:ct.Boolean},r=>({...n,type:W.Boolean,decision:g(r.decision,Z(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Vn),selection:this.mapToSelection(r.selection),possibleDecisionStates:r.possibleDecisionStates})).with({type:ct.Numeric},r=>({...n,type:W.Numeric,decision:g(r.decision,Z(i=>({state:i.state,kind:this.mapToDecisionKind(i.kind)})),Vn),range:r.range,decimalPlaces:r.decimalPlaces,selection:this.mapToSelection(r.selection)})).with({type:ct.Choice},r=>({...n,type:W.Choice,cardinality:r.cardinality,values:g(r.values,G(i=>{const o=g(i.decision,Z(a=>({state:this.mapToChoiceValueDecisionState(a.state),kind:this.mapToDecisionKind(a.kind)})),Vn);return{id:i.choiceValueId,possibleDecisionStates:g(i.possibleDecisionStates,G(a=>this.mapToChoiceValueDecisionState(a))),decision:o}}))})).with({type:ct.Component},r=>({...n,type:W.Component,decision:g(r.decision,Z(i=>({state:this.mapToComponentDecisionState(i.state),kind:this.mapToDecisionKind(i.kind)})),Vn),possibleDecisionStates:g(r.possibleDecisionStates,G(i=>this.mapToComponentDecisionState(i))),selection:g(r.selection,be,Z(i=>this.mapToSelection(i)),Mt),inclusion:this.mapToInclusion(r.inclusion)})).exhaustive()}mapToInclusion(t){return Y(t).with(go.Always,()=>ya.Always).with(go.Optional,()=>ya.Optional).exhaustive()}mapToComponentDecisionState(t){return Y(t).with(Jt.Included,()=>ot.Included).with(Jt.Excluded,()=>ot.Excluded).exhaustive()}mapToChoiceValueDecisionState(t){return Y(t).with(Jt.Included,()=>bt.Included).with(Jt.Excluded,()=>bt.Excluded).exhaustive()}mapToDecisionKind(t){return Y(t).with(Pt.Explicit,()=>$e.Explicit).with(Pt.Implicit,()=>$e.Implicit).exhaustive()}mapToUsageRuleParameters(t){return t}mapToAllowedInExplain(t){return g(t,Z(n=>({rules:this.mapToAllowedRulesInExplain(n.rules)})),Vn)}mapToAllowedRulesInExplain(t){return g(t,Z(n=>Y(n).returnType().with({type:co.all},()=>({type:pn.all})).with({type:co.none},()=>({type:pn.none})).with({type:co.specific},r=>({type:pn.specific,rules:g(r.rules,G(this.mapToGlobalConstraintId))})).exhaustive()),Vn)}},hR=class{constructor(t,n){this.contractToDomainMapper=new pR,this.domainToContractMapper=new D0,this.sessionHandler=t,this.internalConfigurationSessionCreator=n}async createSession(t){const n=this.configurationSessionFrom(t);return await g(this.sessionHandler.recreate(n),Yt(r=>{const i=this.internalConfigurationSessionCreator(this.sessionHandler,r);return new dR(i,this.contractToDomainMapper,this.domainToContractMapper)}),_c(r=>{const i=this.domainToContractMapper.mapToFailureResult(r);return Promise.reject(i)},r=>Promise.resolve(r)))()}configurationSessionFrom(t){return{context:this.contractToDomainMapper.mapToSessionContext(t),sessionId:ye,configuration:{isSatisfied:!1,attributes:[]},solutions:[]}}};function N0(e){return e.possibleDecisionStates.some(t=>t===bt.Included)}function vR(e){return!N0(e)}function mR(e){return Y(e).with({type:W.Choice},t=>t.cardinality.lowerBound>0).with({type:W.Boolean},t=>t.selection===Si.Mandatory).with({type:W.Numeric},t=>t.selection===Si.Mandatory).with({type:W.Component},t=>t.inclusion===ya.Optional&&t.selection===Si.Mandatory).exhaustive()}function yR(e){return Y(e).with({type:W.Choice},t=>t.cardinality.upperBound>1).otherwise(()=>!1)}function gR(e){return g(e.values,Wt(N0))}function bR(e){return g(e.values,Wt(vR))}function P0(e,t){return g(e.values,Po(n=>g(n.decision,be,Vt(r=>r.kind===t))))}function R0(e){return g(e.values,Wt(t=>g(t.decision,be,Z(n=>n.state===bt.Included),st(()=>!1))))}const SR=R0;function k0(e){return g(e.decision,be,Vt(t=>t.kind===$e.Explicit),Vn)}function M0(e){return g(e.decision,be,Vt(t=>t.kind===$e.Explicit),Vn)}function wR(e,t){return e.possibleDecisionStates.some(n=>n===t)}function j0(e){return g(e.decision,be,Vn)}function _0(e){return q0(e,ot.Included)}function CR(e){return!_0(e)}function q0(e,t){return e.possibleDecisionStates.some(n=>n===t)}const An=Object.freeze(Object.defineProperty({__proto__:null,getAllowedChoiceValues:gR,getBlockedChoiceValues:bR,getBooleanDecision:M0,getChoiceDecisions:P0,getComponentDecision:j0,getIncludedChoiceValues:R0,getNumericDecision:k0,getSelectedChoiceValues:SR,isBooleanValuePossible:wR,isComponentAllowed:_0,isComponentBlocked:CR,isComponentStatePossible:q0,isMandatory:mR,isMultiSelect:yR},Symbol.toStringTag,{value:"Module"})),F0=e=>e.type===W.Boolean,L0=e=>e.type===W.Choice,B0=e=>e.type===W.Numeric,V0=e=>e.type===W.Component,xR=qN(ft),qm=qi(ft);function U0(e,t){const n=a=>xR.equals(e.sharedConfigurationModelId,a.sharedConfigurationModelId),r=e.componentPath.length;return g(n,K2(t?a=>qm.equals(g(a.componentPath??[],P2(r)),e.componentPath):a=>qm.equals(a.componentPath??[],e.componentPath)))}function ER(e,t,n){const r=g(U0({sharedConfigurationModelId:t.sharedConfigurationModelId??null,componentPath:g(t.componentPath??[],D2(t.localId))},n),s0(i=>i.id));return g(e,Wt(r))}function TR(e,t,n){const r=g(U0({sharedConfigurationModelId:t,componentPath:[]},n),s0(i=>i.id));return g(e,Wt(r))}function IR(e){return g(e,Wt(t=>{const n=(t.id.componentPath??[]).length===0,r=t.id.sharedConfigurationModelId==null;return n&&r}))}function AR(e,t){return g(G0(e),G(n=>P0(n,t)),Dh,Po(n=>be(n)))}function $R(e,t){return g(W0(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>k0(n)),Po(n=>be(n)))}function OR(e,t){return g(H0(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>M0(n)),Po(n=>be(n)))}function DR(e,t){return g(z0(e),Wt(n=>{var r;return((r=n.decision)==null?void 0:r.kind)===t}),G(n=>j0(n)),Po(n=>be(n)))}function G0(e){return g(e.attributes,Wt(L0))}function z0(e){return g(e.attributes,Wt(V0))}function W0(e){return g(e.attributes,Wt(B0))}function H0(e){return g(e.attributes,Wt(F0))}function NR(e,t){return g(lu(e,t),Mt)}function PR(e,t){return g(K0(e,t),Mt)}function RR(e,t,n){return g(K0(e,t),Z(r=>r.values),ir(Xn(fn(r=>r.id===n))),Mt)}function kR(e,t){return g(lu(e,t),Vt(B0),Mt)}function MR(e,t){return g(lu(e,t),Vt(F0),Mt)}function jR(e,t){return g(lu(e,t),Vt(V0),Mt)}function lu(e,t){return g(e.attributes,fn(n=>qa.equals(n.id,t)))}function K0(e,t){return g(lu(e,t),Vt(L0))}const Fa=Object.freeze(Object.defineProperty({__proto__:null,filterAttributesOfComponent:ER,filterAttributesOfRoot:IR,filterAttributesOfShared:TR,getAttribute:NR,getBooleanAttribute:MR,getBooleanAttributes:H0,getBooleanDecisions:OR,getChoiceAttribute:PR,getChoiceAttributes:G0,getChoiceDecisions:AR,getChoiceValue:RR,getComponentAttribute:jR,getComponentAttributes:z0,getComponentDecisions:DR,getNumericAttribute:kR,getNumericAttributes:W0,getNumericDecisions:$R},Symbol.toStringTag,{value:"Module"})),_R="https://spc.cloud.ceventis.de/api/engine",qR={hcaEngineBaseUrl:_R};function FR(e){return{hcaEngineBaseUrl:e.hcaEngineBaseUrl??qR.hcaEngineBaseUrl,sessionHandler:e.sessionHandler}}function Za(e){if(e==null)throw new Error("Implementation Error: Unexpected null value encountered");return e}const Y0=e=>t=>n=>g(n,R2(r=>e.equals(r,t)),Z(r=>g(n,k2(r,i=>t))),kd,st(()=>g(n,Pe(q2(t))))),Pu=Y0({equals:(e,t)=>Sn.equals(e.attributeId,t.attributeId)}),LR=Y0({equals:(e,t)=>e.choiceValueId===t.choiceValueId});class BR{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,c,l,f,d;const p=g(((r=n.consequences)==null?void 0:r.canAttributeContributeToConfigurationSatisfaction)??[],G(this.restToDomainMapper.mapToGlobalAttributeId)),h=I=>Oh(Sn)(I,p),v=g(((i=n.affectedDecisions)==null?void 0:i.choiceValueDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),E=g(((o=n.consequences)==null?void 0:o.choiceConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),x=g(((a=n.affectedDecisions)==null?void 0:a.componentDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),m=g(((s=n.consequences)==null?void 0:s.componentConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),S=g(((u=n.affectedDecisions)==null?void 0:u.numericDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),C=g(((c=n.consequences)==null?void 0:c.numericConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),b=g(((l=n.affectedDecisions)==null?void 0:l.booleanDecisions)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),T=g(((f=n.consequences)==null?void 0:f.booleanConsequences)??[],G(I=>({attributeId:this.restToDomainMapper.mapToGlobalAttributeId(I.attributeId),payload:I}))),A=g([],Pe(g(b,G(I=>I.attributeId))),Pe(g(T,G(I=>I.attributeId))),Pe(g(S,G(I=>I.attributeId))),Pe(g(C,G(I=>I.attributeId))),Pe(g(v,G(I=>I.attributeId))),Pe(g(E,G(I=>I.attributeId))),Pe(g(x,G(I=>I.attributeId))),Pe(g(m,G(I=>I.attributeId))),oa(Sn)),D=g(A,Pd(t.attributes,(I,N)=>{const _=t.attributes.find(L=>Sn.equals(L.attributeId,N));return Y(_).with({type:ct.Choice},(L,V)=>{const H=this.mergeChoice(V,g(E,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)),g(v,Wt(R=>Sn.equals(R.attributeId,N)),G(R=>R.payload)));return Pu(H)(I)}).with({type:ct.Numeric},(L,V)=>{const H=this.mergeNumeric(V,g(C,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)),g(S,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)));return Pu(H)(I)}).with({type:ct.Boolean},(L,V)=>{const H=this.mergeBoolean(V,g(T,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)),g(b,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)));return Pu(H)(I)}).with({type:ct.Component},(L,V)=>{const H=this.mergeComponent(V,g(m,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)),g(x,fn(R=>Sn.equals(R.attributeId,N)),Z(R=>R.payload)));return Pu(H)(I)}).exhaustive()}),G(I=>{const N=h(I.attributeId);return I.canContributeToConfigurationSatisfaction!=N?{...I,canContributeToConfigurationSatisfaction:N}:I}));return{...t,isSatisfied:g((d=n.consequences)==null?void 0:d.isConfigurationSatisfied,be,st(()=>t.isSatisfied)),attributes:D}}mergeChoice(t,n,r){const i=g(n,Z(u=>u.values??[]),st(()=>[])),o=g(r),a=g([],Pe(g(i,G(u=>u.choiceValueId))),Pe(g(o,G(u=>u.choiceValueId))),G(Za),oa(ft)),s=g(a,Pd(t.values,(u,c)=>{const l=g(i,fn(h=>h.choiceValueId===c)),f=g(o,fn(h=>h.choiceValueId===c)),d=g(t.values.find(h=>h.choiceValueId===c),be),p=this.mergeChoiceValue(c,d,l,f);return LR(p)(u)}));return{...t,isSatisfied:g(n,Z(u=>Za(u.isSatisfied)),st(()=>t.isSatisfied)),values:s}}mergeChoiceValue(t,n,r,i){const o=g(i,Z(s=>({state:this.toDecisionState(Za(s.state)),kind:this.toDecisionKind(Za(s.kind))})),st(()=>({state:g(n,ir(s=>g(s.decision,Z(u=>u.state)))),kind:g(n,ir(s=>g(s.decision,Z(u=>u.kind))),st(()=>Pt.Explicit))}))),a=g(r,Z(s=>g(Tm(s.possibleDecisionStates??[]),G(u=>this.toPossibleDecisionState(u)),Kn)),st(()=>g(n,Z(s=>s.possibleDecisionStates??[]),st(()=>[]))));return{choiceValueId:t,decision:g(o.state,Z(s=>({state:s,kind:o.kind}))),possibleDecisionStates:a}}mergeComponent(t,n,r){const i=g(r,Z(a=>{const s=this.toDecisionState(Za(a.state));return g(s,Z(u=>({state:u,kind:this.toDecisionKind(a.kind)})))}),st(()=>g(t.decision,Z(a=>({state:a.state,kind:a.kind}))))),o=g(n,Z(a=>g(Tm(a.possibleDecisionStates??[]),G(s=>this.toPossibleDecisionState(s)),Kn)),st(()=>t.possibleDecisionStates));return{...t,isSatisfied:g(n,Z(a=>a.isSatisfied),st(()=>t.isSatisfied)),possibleDecisionStates:o,decision:i}}mergeNumeric(t,n,r){return{...t,isSatisfied:g(n,ir(i=>be(i.isSatisfied)),st(()=>t.isSatisfied)),decision:g(r,$i(()=>t.decision,i=>g(i.state,be,Z(o=>({kind:this.toDecisionKind(i.kind),state:o})))))}}mergeBoolean(t,n,r){return{...t,isSatisfied:g(n,ir(i=>be(i.isSatisfied)),st(()=>t.isSatisfied)),decision:g(r,$i(()=>t.decision,i=>g(i.state,be,Z(o=>({kind:this.toDecisionKind(i.kind),state:o}))))),possibleDecisionStates:g(n,Z(i=>i.possibleDecisionStates),st(()=>t.possibleDecisionStates))}}toPossibleDecisionState(t){return Y(t).with(bo.Included,()=>je(Jt.Included)).with(bo.Excluded,()=>je(Jt.Excluded)).otherwise(()=>ye)}toDecisionState(t){return Y(t).with(Gr.Included,()=>je(Jt.Included)).with(Gr.Excluded,()=>je(Jt.Excluded)).otherwise(()=>ye)}toDecisionKind(t){return Y(t).with(Bs.Implicit,()=>Pt.Implicit).with(Bs.Explicit,()=>Pt.Explicit).exhaustive()}}class VR{mapSessionToExplicitDecisions(t){return this.mapToExplicitDecisionsInner(t.configuration.attributes)}mapToExplicitDecision(t){return Y(t).with({type:Te.ChoiceValue},n=>({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToDecisionState(n.state)})).with({type:Te.Component},n=>({type:qn.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToDecisionState(n.state)})).with({type:Te.Numeric},n=>({type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,Mt)})).with({type:Te.Boolean},n=>({type:qn.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:g(n.value,Mt)})).exhaustive()}mapToExplicitDecisions(t,n){const r=this.mapToMode(n),i=g([...t],ii(u=>u.type!==Te.Boolean?ye:je({type:qn.Boolean,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:g(u.value,Mt)}))),o=g([...t],ii(u=>u.type!==Te.Numeric?ye:je({type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(u.attributeId),state:g(u.value,Mt)}))),a=g([...t],ii(u=>u.type!==Te.ChoiceValue?ye:je({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(u.attributeId),choiceValueId:u.choiceValueId,state:this.mapToDecisionState(u.state)}))),s=g([...t],ii(u=>u.type!==Te.Component?ye:je({type:qn.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=g([...t],ii(a=>a.type!==ct.Boolean?ye:g(a.decision,Vt(s=>s.kind===Pt.Explicit),Z(()=>this.mapToExplicitBooleanDecision(a))))),r=g([...t],ii(a=>a.type!==ct.Numeric?ye:g(a.decision,Vt(s=>s.kind===Pt.Explicit),Z(()=>this.mapToExplicitNumericDecision(a))))),i=g([...t],ii(a=>a.type!==ct.Component?ye:g(a.decision,Vt(s=>s.kind===Pt.Explicit),Z(()=>this.mapToExplicitComponentDecision(a))))),o=g([...t],ii(a=>a.type!==ct.Choice?ye:g(this.mapToExplicitChoiceDecisions(a),cu(s=>g(s,Ma)))),z2);return{booleanDecisions:n,numericDecisions:r,choiceDecisions:o,componentDecisions:i}}mapToMode(t){return Y(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:g(t.componentPath,be,Z(Rd),Vn),sharedConfigurationModelId:t.sharedConfigurationModel}}mapToDropExistingDecisionsMode(t){return{type:"DropExistingDecisions",conflictResolution:Y(t.conflictHandling).with({type:"Manual",includeConstraintsInConflictExplanation:Ve.boolean},n=>({type:"Manual",includeConstraintsInConflictExplanation:n.includeConstraintsInConflictExplanation})).otherwise(()=>({type:"Automatic"}))}}mapToExplicitBooleanDecision(t){return{type:qn.Boolean,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:g(t.decision,Z(n=>n.state),Mt)}}mapToExplicitNumericDecision(t){return{type:qn.Numeric,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:g(t.decision,Z(n=>n.state),Mt)}}mapToExplicitComponentDecision(t){return{type:qn.Component,attributeId:this.mapToGlobalAttributeId(t.attributeId),state:this.mapToDecisionState(g(t.decision,Z(n=>n.state)))}}mapToExplicitChoiceDecisions(t){function n(r){return g(r.decision,Z(i=>i.kind===Pt.Explicit),st(()=>!1))}return g(t.values,Wt(n),G(r=>({type:qn.Choice,attributeId:this.mapToGlobalAttributeId(t.attributeId),choiceValueId:r.choiceValueId,state:this.mapToDecisionState(g(r.decision,Z(i=>i.state)))})),Rd)}mapToDecisionState(t){return g(t,Z(n=>Y(n).with(Jt.Included,()=>Gr.Included).with(Jt.Excluded,()=>Gr.Excluded).exhaustive()),st(()=>Gr.Undefined))}mapToPossibleDecisionState(t){return Y(t).with(Jt.Included,()=>bo.Included).with(Jt.Excluded,()=>bo.Excluded).exhaustive()}mapToWhyNotSatisfiedRequest(t){return Y(t).with({subject:hn.attribute},n=>({type:zd.Attribute,attributeId:this.mapToGlobalAttributeId(n.attributeId)})).with({subject:hn.configuration},()=>({type:zd.Configuration})).exhaustive()}mapToWhyStateNotPossibleRequest(t){return Y(t).with({subject:hn.boolean},n=>({type:ls.Boolean,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.numeric},n=>({type:ls.Numeric,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:n.state})).with({subject:hn.component},n=>({type:ls.Component,attributeId:this.mapToGlobalAttributeId(n.attributeId),state:this.mapToPossibleDecisionState(n.state)})).with({subject:hn.choiceValue},n=>({type:ls.ChoiceValue,attributeId:this.mapToGlobalAttributeId(n.attributeId),choiceValueId:n.choiceValueId,state:this.mapToPossibleDecisionState(n.state)})).exhaustive()}}class UR{constructor(){this.configurationSession={hasExplicitDecisions(t){return g(t.configuration.attributes,fn(n=>Y(n).with({type:ct.Boolean},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),cs)).with({type:ct.Numeric},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),cs)).with({type:ct.Choice},r=>g(r.values,fn(i=>g(i.decision,Z(o=>o.kind===Pt.Explicit),st(()=>!1))),cs)).with({type:ct.Component},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),cs)).exhaustive()),$i(()=>!1,()=>!0))},getExplicitDecisions(t){return g(t.configuration.attributes,G(n=>Y(n).with({type:ct.Boolean},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),Z(i=>({type:Te.Boolean,attributeId:r.attributeId,value:be(i.state)})),Z(i=>[i]))).with({type:ct.Numeric},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),Z(i=>({type:Te.Numeric,attributeId:r.attributeId,value:be(i.state)})),Z(i=>[i]))).with({type:ct.Choice},r=>g(r.values,G(i=>g(i.decision,Vt(o=>o.kind===Pt.Explicit),Z(o=>({type:Te.ChoiceValue,attributeId:r.attributeId,choiceValueId:i.choiceValueId,state:be(o.state)})))),Kn,gi)).with({type:ct.Component},r=>g(r.decision,Vt(i=>i.kind===Pt.Explicit),Z(i=>({type:Te.Component,attributeId:r.attributeId,state:be(i.state)})),Z(i=>[i]))).exhaustive()),Kn,Dh)}}}}class GR{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 UR}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)=>g(this.engineApiClient.makeDecision(i,r),vr(Br),Yt(a=>this.domainUpdater.updateConfigurationSession(o,a))))}explain(t,n){return this.withSession(n,r=>{const i=Y(t).with({question:Gn.whyIsNotSatisfied},o=>this.explainWhyNotSatisfied(o,r)).with({question:Gn.whyIsStateNotPossible},o=>this.explainWhyStateNotPossible(o,r)).exhaustive();return g(i,vr(Br),Yt(o=>this.restToDomainMapper.mapToExplainAnswer(o,t)))})}setMany(t,n,r){return this.withSession(r,(i,o)=>{const a=this.setManyInner(t,n,i);return g(a,pr(s=>{var u,c,l,f;return g([],Pe(g(((u=s.rejectedDecisions)==null?void 0:u.booleanDecisions)??[],G(d=>this.restToDomainMapper.mapToBooleanDecision(d)))),Pe(g(((c=s.rejectedDecisions)==null?void 0:c.numericDecisions)??[],G(d=>this.restToDomainMapper.mapToNumericDecision(d)))),Pe(g(((l=s.rejectedDecisions)==null?void 0:l.componentDecisions)??[],G(d=>this.restToDomainMapper.mapToComponentDecision(d)))),Pe(g(((f=s.rejectedDecisions)==null?void 0:f.choiceValueDecisions)??[],G(d=>this.restToDomainMapper.mapToExplicitChoiceValueDecision(d))))),aa(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 g(i,Yt(o=>({})))}setManyInner(t,n,r){const i=this.domainToRestMapper.mapToExplicitDecisions(t,n),o=this.engineApiClient.setMany(r,i);return g(o,vr(Br),pr(a=>{const s={rejectedDecisions:{booleanDecisions:Ve.array(Ve.any)}},u={decisionExplanations:Ve.array(Ve.any)};return Y(a).with(s,c=>ja(c)).with(u,c=>bi(this.restToDomainMapper.mapToConfigurationSetManyConflictFailure(c,i,n))).otherwise(()=>bi({type:Ce.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 g(aa(t),pr(r=>g(r.sessionId,$i(()=>this.initializeInner(r,!1),()=>aa(r)))),pr(r=>g(r.sessionId,Mh(()=>({type:Ce.ConfigurationUnauthenticated})),pr(i=>n(i,r)))))}initializeInner(t,n){return g(xN,()=>g(t.sessionId,RN,MN(s=>n?PN(s):g(this.sessionHandler.close(s),_c(()=>ye,()=>ye)))),s=>{const u=this.domainToContractMapper.mapToSessionContext(t.context);return g(s,yN(()=>({type:Ce.ConfigurationUnauthenticated})),d0(()=>this.sessionHandler.create(u)))},s=>g(s,EN(u=>g(gi(t),Vt(this.interpreter.configurationSession.hasExplicitDecisions),Z(c=>this.replaceDecisions(u,c)),st(()=>aa({}))))),s=>g(s,pr(u=>{const c=this.determineConsequences(u),l=this.determineDecisions(u),f=GD(SN)({consequences:c,decisions:l});return g(f,Yt(({decisions:d,consequences:p})=>this.restToDomainMapper.mapToConfigurationModel(d,p)),Yt(d=>({sessionId:gi(u),configuration:d,context:t.context,solutions:[]})))})))}determineDecisions(t){return g(this.engineApiClient.getDecisions(t),vr(Br))}determineConsequences(t){return g(this.engineApiClient.getConsequence(t),vr(Br))}}class zR{constructor(t,n){this.onConfigurationChangedHandler=ye,this.sessionHandler=t,this.configurationSession=n}setOnConfigurationChangedHandler(t){this.onConfigurationChangedHandler=t}getSessionContext(){return this.configurationSession.context}getConfiguration(){return this.configurationSession.configuration}explain(t){return g(this.sessionHandler.explain(t,this.configurationSession),this.updateAvailableSolutionsIfRight(n=>this.deriveSolutionsFromExplainAnswer(n)),this.invalidateAvailableSolutionsIfLeft())}setSessionContext(t){return g(this.sessionHandler.recreate({...this.configurationSession,context:t}),this.updateSession())}invalidateSessionId(){this.configurationSession={...this.configurationSession,sessionId:ye}}restoreConfiguration(t){return g(this.sessionHandler.reinitialize({...this.configurationSession,configuration:t}),this.updateSession())}makeDecision(t){return g(this.sessionHandler.makeDecision(t,this.configurationSession),this.updateSession())}close(){return g(this.configurationSession.sessionId,Z(t=>this.sessionHandler.close(t)),Z(Xn(Yt(t=>{this.configurationSession={...this.configurationSession,sessionId:ye}}))),st(Nl(UP())))}applySolution(t){return g(this.configurationSession.solutions,fn(n=>eR.equals(n,t)),Mh(()=>({type:Ce.ConfigurationSolutionNotAvailable})),Yt(n=>n.decisions),pr(n=>this.setMany(n,t.mode)))}setMany(t,n){return g(this.sessionHandler.setMany(t,n,this.configurationSession),this.updateSession(),qc(r=>()=>{const i=Y(r).with({decisionExplanations:Ve.array(Ve.any)},o=>je(o.decisionExplanations)).otherwise(()=>ye);this.configurationSession={...this.configurationSession,solutions:g(i,Z(Xn(G(o=>o.solution))),st(()=>[]))}}))}deriveSolutionsFromExplainAnswer(t){const n=Y(t).with({decisionExplanations:Ve.array(Ve.any)},r=>r.decisionExplanations).otherwise(()=>[]);return g(n,G(r=>r.solution))}invalidateAvailableSolutions(){return IN(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}invalidateAvailableSolutionsIfLeft(){return qc(()=>()=>{this.configurationSession={...this.configurationSession,solutions:[]}})}updateAvailableSolutionsIfRight(t){return js(n=>()=>{this.configurationSession={...this.configurationSession,solutions:t(n)}})}updateSession(){return Xn(js(t=>()=>{this.configurationSession=t,g(this.onConfigurationChangedHandler,$N(n=>()=>n(this.configurationSession.configuration)))}),Yt(t=>t.configuration),this.invalidateAvailableSolutions())}}class WR{constructor(t){this.inner=t;const n=3,r=2e3,i=200;this.policy=AP(r,TP.concat($P(i),IP(n)))}getSessionContext(){return this.inner.getSessionContext()}close(){return this.inner.close()}setSessionContext(t){const n=()=>this.inner.setSessionContext(t);return Vo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}makeDecision(t){const n=()=>this.inner.makeDecision(t);return Vo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}restoreConfiguration(t){const n=()=>this.inner.restoreConfiguration(t);return Vo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}explain(t){const n=()=>this.inner.explain(t);return Vo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}applySolution(t){const n=()=>this.inner.applySolution(t);return Vo(this.policy,n,r=>g(r,Qi(i=>this.determineAndPrepareRetry(i),()=>!1)))}setMany(t,n){const r=()=>this.inner.setMany(t,n);return Vo(this.policy,r,i=>g(i,Qi(o=>this.determineAndPrepareRetry(o),()=>!1)))}setOnConfigurationChangedHandler(t){this.inner.setOnConfigurationChangedHandler(t)}invalidateSessionId(){this.inner.invalidateSessionId()}getConfiguration(){return this.inner.getConfiguration()}determineAndPrepareRetry(t){return Y(t).with({type:Ce.ConfigurationUnauthenticated},()=>(this.invalidateSessionId(),!0)).with({type:Ce.ConfigurationTimeout},()=>!0).otherwise(()=>!1)}}class HR{constructor(){this.queue=[],this.operating=ye}push(t){const n=new KR(t);return this.queue.push(n),this.operating=g(this.operating,st(()=>this.start()),gi),n.promise}async start(){for(;this.queue.length;){const t=[...this.queue];this.queue=[];const n=g(t,G(r=>r.argument),Pd(ye,(r,i)=>this.reduce(r,i)),Z(Xn(r=>this.execute(r),r=>r.then(i=>{g(t,G(o=>{o.resolve(i)}))}).catch(i=>{g(t,G(o=>{o.reject(i)}))}))),Mt);n&&await n}this.operating=ye}async flush(){return this.operating||Promise.resolve()}size(){return this.queue.length}}class KR{constructor(t){this.resolve=()=>{},this.reject=()=>{},this.argument=t,this.promise=new Promise((n,r)=>{this.resolve=n,this.reject=r})}}class YR extends HR{constructor(t){super(),this.inner=t}reduce(t,n){return je(n)}async execute(t){return await this.inner.setSessionContext(t)()}}class XR{constructor(t){this.inner=t,this.setContextReducingTaskExecutor=new YR(t)}getSessionContext(){return this.inner.getSessionContext()}setSessionContext(t){const n=this.inner.getSessionContext();if(HP.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)}}class JR{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)),g(r(),qc(a=>()=>{console.debug(`Operation ${t} completed after ${o()}ms with failure`,this.renderAsRequired(a))}),js(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)}}let QR=class X0{constructor(t){this.inner=t,this.lockName="SynchronousOperationDecorator_"+Fh()}static new(t){return new X0(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 ZR(e){e=FR(e);const t=new lR(e.hcaEngineBaseUrl),n=new $0,r=new VR,i=new D0,o=new BP,a=new BR(n),s=Y(e.sessionHandler).with({create:Ve.any,close:Ve.any},l=>l).with({accessToken:Ve.string},l=>new cR(t,o,n,l)).with({sessionCreateUrl:Ve.string,sessionDeleteUrl:Ve.string},l=>new fR(o,l)).exhaustive(),u=new GR(s,t,n,r,i,a),c=(l,f)=>g(new zR(l,f),d=>new WR(d),d=>new XR(d),QR.new,d=>new JR(d,!1));return new hR(u,c)}const ek=qa.equals,tk=E0.equals;MP.equals;function Vl(e){return Tn((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 Vh(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 Ge(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 pt;(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"})(pt||(pt={}));var So;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(So||(So={}));var Wd=pt.Start,Uh=pt.Stop,fu=pt.Raise,Ul=pt.Send,JC=pt.Cancel,ik=pt.NullEvent,Gh=pt.Assign;pt.After;pt.DoneState;var QC=pt.Log,ok=pt.Init,Hd=pt.Invoke;pt.ErrorExecution;var Fm=pt.ErrorPlatform,ak=pt.ErrorCustom,ZC=pt.Update,sk=pt.Choose,uk=pt.Pure,e0=".",Lm={},Kd="xstate.guard",ck="",$t=process.env.NODE_ENV==="production",Ru;function zh(e,t,n){n===void 0&&(n=e0);var r=xs(e,n),i=xs(t,n);return We(i)?We(r)?i===r:!1:We(r)?r in i:Object.keys(r).every(function(o){return o in i?zh(r[o],i[o]):!1})}function t0(e){try{return We(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 Yd(e,t){try{return Ba(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function lk(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function xs(e,t){if(lk(e))return e.value;if(Ba(e))return Lc(e);if(typeof e!="string")return e;var n=Yd(e,t);return Lc(n)}function Lc(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 ds(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=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var fk=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 dk(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(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function fc(e){if(!e)return[[]];if(We(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]]:fc(e[n]).map(function(i){return[n].concat(i)})}));return t}function It(e){var t;return(t=[]).concat.apply(t,yt([],Ge(e),!1))}function n0(e){return Ba(e)?e:[e]}function fr(e){return e===void 0?[]:n0(e)}function Bc(e,t,n){var r,i;if(Ze(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,c=e[u];Ze(c)?o[u]=c(t,n.data):o[u]=c}}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 pk(e){return/^(done|error)\./.test(e)}function Vm(e){return!!(e instanceof Promise||e!==null&&(Ze(e)||typeof e=="object")&&Ze(e.then))}function hk(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function vk(e,t){var n,r,i=Ge([[],[]],2),o=i[0],a=i[1];try{for(var s=Be(e),u=s.next();!u.done;u=s.next()){var c=u.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function r0(e,t){return ds(e.states,function(n,r){if(n){var i=(We(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:r0(n,i)}}})}function mk(e,t){return{current:t,states:r0(e,t)}}function Um(e,t,n,r){$t||en(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,c=a.assignment,l={state:r,action:a,_event:t},f={};if(Ze(c))f=c(o,t.data,l);else try{for(var d=Be(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=Ze(v)?v(o,t.data,l):v}}catch(E){s={error:E}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var en=function(){};$t||(en=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 Ba(e){return Array.isArray(e)}function Ze(e){return typeof e=="function"}function We(e){return typeof e=="string"}function i0(e,t){if(e)return We(e)?{type:Kd,name:e,predicate:t?t[e]:void 0}:Ze(e)?{type:Kd,name:e.name,predicate:e}:e}function yk(e){try{return"subscribe"in e&&Ze(e.subscribe)}catch{return!1}}var vi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Ru={},Ru[vi]=function(){return this},Ru[Symbol.observable]=function(){return this};function Xr(e){return!!e&&"__xstatenode"in e}function gk(e){return!!e&&typeof e.send=="function"}var bk=function(){var e=0;return function(){return e++,e.toString(16)}}();function Gl(e,t){return We(e)||typeof e=="number"?re({type:e},t):e}function cn(e,t){if(!We(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Gl(e);return re({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Go(e,t){var n=n0(t).map(function(r){return typeof r>"u"||typeof r=="string"||Xr(r)?{target:r,event:e}:re(re({},r),{event:e})});return n}function Sk(e){if(!(e===void 0||e===ck))return fr(e)}function Ck(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 o0(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Kd)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 a0(e){return typeof e=="string"?{type:e}:e}function dc(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 Xd(e){return(e.type===fu||e.type===Ul&&e.to===So.Internal)&&typeof e.delay!="number"}var va=cn({type:ok});function Jd(e,t){return t&&t[e]||void 0}function Us(e,t){var n;if(We(e)||typeof e=="number"){var r=Jd(e,t);Ze(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Ze(e))n={type:e.name||e.toString(),exec:e};else{var r=Jd(e.type,t);if(Ze(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 mi=function(e,t){if(!e)return[];var n=Ba(e)?e:[e];return n.map(function(r){return Us(r,t)})};function Wh(e){var t=Us(e);return re(re({id:We(e)?e:t.id},t),{type:t.type})}function wk(e,t){return{type:fu,event:typeof e=="function"?e:Gl(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function xk(e,t,n,r){var i={_event:n},o=cn(Ze(e.event)?e.event(t,n.data,i):e.event),a;if(We(e.delay)){var s=r&&r[e.delay];a=Ze(s)?s(t,n.data,i):s}else a=Ze(e.delay)?e.delay(t,n.data,i):e.delay;return re(re({},e),{type:fu,_event:o,delay:a})}function zl(e,t){return{to:t?t.to:void 0,type:Ul,event:Ze(e)?e:Gl(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Ze(e)?e.name:t0(e)}}function Ek(e,t,n,r){var i={_event:n},o=cn(Ze(e.event)?e.event(t,n.data,i):e.event),a;if(We(e.delay)){var s=r&&r[e.delay];a=Ze(s)?s(t,n.data,i):s}else a=Ze(e.delay)?e.delay(t,n.data,i):e.delay;var u=Ze(e.to)?e.to(t,n.data,i):e.to;return re(re({},e),{to:u,_event:o,event:o.data,delay:a})}function Tk(e,t){return zl(e,re(re({},t),{to:So.Parent}))}var Ik=function(e,t,n){return re(re({},e),{value:We(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Ak=function(e){return{type:JC,sendId:e}};function $k(e){var t=Wh(e);return{type:pt.Start,activity:t,exec:void 0}}function Ok(e){var t=Ze(e)?e:Wh(e);return{type:pt.Stop,activity:t,exec:void 0}}function Dk(e,t,n){var r=Ze(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:pt.Stop,activity:i};return o}var Nk=function(e){return{type:Gh,assignment:e}};function Pk(e,t){var n=t?"#".concat(t):"";return"".concat(pt.After,"(").concat(e,")").concat(n)}function Mu(e,t){var n="".concat(pt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function pc(e,t){var n="".concat(pt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function ps(e,t){var n="".concat(pt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Rk(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([],Ge(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 zl(function(r,i){return i},re(re({},t),{to:e}))}var kk=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===Gh){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 Vc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:kk(i),u=s.length?Um(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var E;switch(v.type){case fu:{var x=xk(v,u,r,e.options.delays);return o&&typeof x.delay=="number"&&o(x,u,r),x}case Ul:var m=Ek(v,u,r,e.options.delays);if(!$t){var C=v.delay;en(!We(C)||typeof m.delay=="number","No delay reference for delay expression '".concat(C,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==So.Internal&&(h==="entry"?l.push(m):o(m,u,r)),m;case QC:{var w=Ik(v,u,r);return o==null||o(w,u,r),w}case sk:{var b=v,T=(E=b.conds.find(function(B){var U=i0(B.cond,e.options.guards);return!U||o0(e,U,u,r,o?void 0:t)}))===null||E===void 0?void 0:E.actions;if(!T)return[];var A=Ge(Vc(e,t,u,r,[{type:h,actions:mi(fr(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case uk:{var T=v.get(u,r.data);if(!T)return[];var N=Ge(Vc(e,t,u,r,[{type:h,actions:mi(fr(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case Uh:{var w=Dk(v,u,r);return o==null||o(w,n,r),w}case Gh:{u=Um(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=Us(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=re(re({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,yt([c[R]],Ge(U),!1))}});V=ie}return V}}function d(h){var v,E,x=[];try{for(var m=Be(h.actions),C=m.next();!C.done;C=m.next()){var w=C.value,b=f(h.type,w);b&&(x=x.concat(b))}}catch(T){v={error:T}}finally{try{C&&!C.done&&(E=m.return)&&E.call(m)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,x}var p=It(i.map(d));return[p,u]}var Uc=[],Zo=function(e,t){Uc.push(e);var n=t(e);return Uc.pop(),n},Mk=function(e){return e(Uc[Uc.length-1])};function s0(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[vi]=function(){return this},t}function jk(e,t,n,r){var i,o=a0(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Bc(e.data,n,r):void 0,u=a?Hh(a,e.id,s):s0(e.id);return u.meta=e,u}function Hh(e,t,n){var r=s0(t);if(r.deferred=!0,Xr(e)){var i=r.state=Zo(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function _k(e){try{return typeof e.send=="function"}catch{return!1}}function qk(e){return _k(e)&&"id"in e}function Fk(e){var t;return re((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[vi]=function(){return this},t),e)}var Gc=function(e){return e.type==="atomic"||e.type==="final"};function u0(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Gs(e){return u0(e).filter(function(t){return t.type!=="history"})}function c0(e){var t=[e];return Gc(e)?t:t.concat(It(Gs(e).map(c0)))}function hs(e,t){var n,r,i,o,a,s,u,c,l=new Set(e),f=Qd(l),d=new Set(t);try{for(var p=Be(d),h=p.next();!h.done;h=p.next())for(var v=h.value,E=v.parent;E&&!d.has(E);)d.add(E),E=E.parent}catch(I){n={error:I}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var x=Qd(d);try{for(var m=Be(d),C=m.next();!C.done;C=m.next()){var v=C.value;if(v.type==="compound"&&(!x.get(v)||!x.get(v).length))f.get(v)?f.get(v).forEach(function(N){return d.add(N)}):v.initialStateNodes.forEach(function(N){return d.add(N)});else if(v.type==="parallel")try{for(var w=(a=void 0,Be(Gs(v))),b=w.next();!b.done;b=w.next()){var T=b.value;d.has(T)||(d.add(T),f.get(T)?f.get(T).forEach(function(N){return d.add(N)}):T.initialStateNodes.forEach(function(N){return d.add(N)}))}}catch(N){a={error:N}}finally{try{b&&!b.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{C&&!C.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Be(d),D=A.next();!D.done;D=A.next())for(var v=D.value,E=v.parent;E&&!d.has(E);)d.add(E),E=E.parent}catch(I){u={error:I}}finally{try{D&&!D.done&&(c=A.return)&&c.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(Gc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=l0(o,t)}),i}function Qd(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 Lk(e,t){var n=hs([e],t);return l0(e,Qd(n))}function vs(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function Bk(e){return yt([],Ge(new Set(It(yt([],Ge(e.map(function(t){return t.ownEvents})),!1)))),!1)}function hc(e,t){return t.type==="compound"?Gs(t).some(function(n){return n.type==="final"&&vs(e,n)}):t.type==="parallel"?Gs(t).every(function(n){return hc(e,n)}):!1}function Vk(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 f0(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(We(e)||We(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return f0(e[i],t[i])})}function Uk(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function Gk(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 tr=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=Vk(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 Bk(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=va;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=va;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="."),We(t))return[t];var i=Object.keys(t);return i.concat.apply(i,yt([],Ge(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=Vh(t,["configuration","transitions","tags","machine"]);return re(re({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return zh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;$t&&en(!!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}(),zk={deferEvents:!1},zm=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=re(re({},zk),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}(),Cf=new Map,Wk=0,ts={bookId:function(){return"x:".concat(Wk++)},register:function(e,t){return Cf.set(e,t),e},get:function(e){return Cf.get(e)},free:function(e){Cf.delete(e)}};function Kh(){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 Hk(){var e=Kh();if(e&&"__xstate__"in e)return e.__xstate__}function Kk(e){if(Kh()){var t=Hk();t&&t.register(e)}}function Yk(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 c=i.shift();n=e.transition(n,c,u),r.forEach(function(l){return l.next(n)})}o=!1}},s=Fk({id:t.id,send:function(c){i.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=dc(c,l,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 Zd={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 Xk=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(l,f){if(Ba(l))return r.batch(l),r.state;var d=cn(Gl(l,f));if(r.status===Dt.Stopped)return $t||en(!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 Vh(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 Ge(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 pt;(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"})(pt||(pt={}));var So;(function(e){e.Parent="#_parent",e.Internal="#_internal"})(So||(So={}));var Wd=pt.Start,Uh=pt.Stop,fu=pt.Raise,Ul=pt.Send,J0=pt.Cancel,nk=pt.NullEvent,Gh=pt.Assign;pt.After;pt.DoneState;var Q0=pt.Log,rk=pt.Init,Hd=pt.Invoke;pt.ErrorExecution;var Fm=pt.ErrorPlatform,ik=pt.ErrorCustom,Z0=pt.Update,ok=pt.Choose,ak=pt.Pure,ew=".",Lm={},Kd="xstate.guard",sk="",$t=process.env.NODE_ENV==="production",Ru;function zh(e,t,n){n===void 0&&(n=ew);var r=Cs(e,n),i=Cs(t,n);return We(i)?We(r)?i===r:!1:We(r)?r in i:Object.keys(r).every(function(o){return o in i?zh(r[o],i[o]):!1})}function tw(e){try{return We(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 Yd(e,t){try{return La(e)?e:e.toString().split(t)}catch{throw new Error("'".concat(e,"' is not a valid state path."))}}function uk(e){return typeof e=="object"&&"value"in e&&"context"in e&&"event"in e&&"_event"in e}function Cs(e,t){if(uk(e))return e.value;if(La(e))return Lc(e);if(typeof e!="string")return e;var n=Yd(e,t);return Lc(n)}function Lc(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 fs(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=Be(Object.keys(e)),s=a.next();!s.done;s=a.next()){var u=s.value,c=e[u];n(c)&&(o[u]=t(c,u,e))}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}var ck=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 lk(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(c){r={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}}function fc(e){if(!e)return[[]];if(We(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]]:fc(e[n]).map(function(i){return[n].concat(i)})}));return t}function It(e){var t;return(t=[]).concat.apply(t,yt([],Ge(e),!1))}function nw(e){return La(e)?e:[e]}function fr(e){return e===void 0?[]:nw(e)}function Bc(e,t,n){var r,i;if(Ze(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,c=e[u];Ze(c)?o[u]=c(t,n.data):o[u]=c}}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 fk(e){return/^(done|error)\./.test(e)}function Vm(e){return!!(e instanceof Promise||e!==null&&(Ze(e)||typeof e=="object")&&Ze(e.then))}function dk(e){return e!==null&&typeof e=="object"&&"transition"in e&&typeof e.transition=="function"}function pk(e,t){var n,r,i=Ge([[],[]],2),o=i[0],a=i[1];try{for(var s=Be(e),u=s.next();!u.done;u=s.next()){var c=u.value;t(c)?o.push(c):a.push(c)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return[o,a]}function rw(e,t){return fs(e.states,function(n,r){if(n){var i=(We(t)?void 0:t[r])||(n?n.current:void 0);if(i)return{current:i,states:rw(n,i)}}})}function hk(e,t){return{current:t,states:rw(e,t)}}function Um(e,t,n,r){$t||en(!!e,"Attempting to update undefined context");var i=e&&n.reduce(function(o,a){var s,u,c=a.assignment,l={state:r,action:a,_event:t},f={};if(Ze(c))f=c(o,t.data,l);else try{for(var d=Be(Object.keys(c)),p=d.next();!p.done;p=d.next()){var h=p.value,v=c[h];f[h]=Ze(v)?v(o,t.data,l):v}}catch(E){s={error:E}}finally{try{p&&!p.done&&(u=d.return)&&u.call(d)}finally{if(s)throw s.error}}return Object.assign({},o,f)},e);return i}var en=function(){};$t||(en=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 La(e){return Array.isArray(e)}function Ze(e){return typeof e=="function"}function We(e){return typeof e=="string"}function iw(e,t){if(e)return We(e)?{type:Kd,name:e,predicate:t?t[e]:void 0}:Ze(e)?{type:Kd,name:e.name,predicate:e}:e}function vk(e){try{return"subscribe"in e&&Ze(e.subscribe)}catch{return!1}}var pi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();Ru={},Ru[pi]=function(){return this},Ru[Symbol.observable]=function(){return this};function Kr(e){return!!e&&"__xstatenode"in e}function mk(e){return!!e&&typeof e.send=="function"}var yk=function(){var e=0;return function(){return e++,e.toString(16)}}();function Gl(e,t){return We(e)||typeof e=="number"?re({type:e},t):e}function cn(e,t){if(!We(e)&&"$$type"in e&&e.$$type==="scxml")return e;var n=Gl(e);return re({name:n.type,data:n,$$type:"scxml",type:"external"},t)}function Uo(e,t){var n=nw(t).map(function(r){return typeof r>"u"||typeof r=="string"||Kr(r)?{target:r,event:e}:re(re({},r),{event:e})});return n}function gk(e){if(!(e===void 0||e===sk))return fr(e)}function bk(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 ow(e,t,n,r,i){var o=e.options.guards,a={state:i,cond:t,_event:r};if(t.type===Kd)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 aw(e){return typeof e=="string"?{type:e}:e}function dc(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 Xd(e){return(e.type===fu||e.type===Ul&&e.to===So.Internal)&&typeof e.delay!="number"}var ha=cn({type:rk});function Jd(e,t){return t&&t[e]||void 0}function Vs(e,t){var n;if(We(e)||typeof e=="number"){var r=Jd(e,t);Ze(r)?n={type:e,exec:r}:r?n=r:n={type:e,exec:void 0}}else if(Ze(e))n={type:e.name||e.toString(),exec:e};else{var r=Jd(e.type,t);if(Ze(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 hi=function(e,t){if(!e)return[];var n=La(e)?e:[e];return n.map(function(r){return Vs(r,t)})};function Wh(e){var t=Vs(e);return re(re({id:We(e)?e:t.id},t),{type:t.type})}function Sk(e,t){return{type:fu,event:typeof e=="function"?e:Gl(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function wk(e,t,n,r){var i={_event:n},o=cn(Ze(e.event)?e.event(t,n.data,i):e.event),a;if(We(e.delay)){var s=r&&r[e.delay];a=Ze(s)?s(t,n.data,i):s}else a=Ze(e.delay)?e.delay(t,n.data,i):e.delay;return re(re({},e),{type:fu,_event:o,delay:a})}function zl(e,t){return{to:t?t.to:void 0,type:Ul,event:Ze(e)?e:Gl(e),delay:t?t.delay:void 0,id:t&&t.id!==void 0?t.id:Ze(e)?e.name:tw(e)}}function Ck(e,t,n,r){var i={_event:n},o=cn(Ze(e.event)?e.event(t,n.data,i):e.event),a;if(We(e.delay)){var s=r&&r[e.delay];a=Ze(s)?s(t,n.data,i):s}else a=Ze(e.delay)?e.delay(t,n.data,i):e.delay;var u=Ze(e.to)?e.to(t,n.data,i):e.to;return re(re({},e),{to:u,_event:o,event:o.data,delay:a})}function xk(e,t){return zl(e,re(re({},t),{to:So.Parent}))}var Ek=function(e,t,n){return re(re({},e),{value:We(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},Tk=function(e){return{type:J0,sendId:e}};function Ik(e){var t=Wh(e);return{type:pt.Start,activity:t,exec:void 0}}function Ak(e){var t=Ze(e)?e:Wh(e);return{type:pt.Stop,activity:t,exec:void 0}}function $k(e,t,n){var r=Ze(e.activity)?e.activity(t,n.data):e.activity,i=typeof r=="string"?{id:r}:r,o={type:pt.Stop,activity:i};return o}var Ok=function(e){return{type:Gh,assignment:e}};function Dk(e,t){var n=t?"#".concat(t):"";return"".concat(pt.After,"(").concat(e,")").concat(n)}function Mu(e,t){var n="".concat(pt.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function pc(e,t){var n="".concat(pt.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function ds(e,t){var n="".concat(pt.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function Nk(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([],Ge(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 zl(function(r,i){return i},re(re({},t),{to:e}))}var Pk=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===Gh){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 Vc(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:Pk(i),u=s.length?Um(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var E;switch(v.type){case fu:{var x=wk(v,u,r,e.options.delays);return o&&typeof x.delay=="number"&&o(x,u,r),x}case Ul:var m=Ck(v,u,r,e.options.delays);if(!$t){var S=v.delay;en(!We(S)||typeof m.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==So.Internal&&(h==="entry"?l.push(m):o(m,u,r)),m;case Q0:{var C=Ek(v,u,r);return o==null||o(C,u,r),C}case ok:{var b=v,T=(E=b.conds.find(function(B){var U=iw(B.cond,e.options.guards);return!U||ow(e,U,u,r,o?void 0:t)}))===null||E===void 0?void 0:E.actions;if(!T)return[];var A=Ge(Vc(e,t,u,r,[{type:h,actions:hi(fr(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case ak:{var T=v.get(u,r.data);if(!T)return[];var N=Ge(Vc(e,t,u,r,[{type:h,actions:hi(fr(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case Uh:{var C=$k(v,u,r);return o==null||o(C,n,r),C}case Gh:{u=Um(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=Vs(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=re(re({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,yt([c[R]],Ge(U),!1))}});V=ie}return V}}function d(h){var v,E,x=[];try{for(var m=Be(h.actions),S=m.next();!S.done;S=m.next()){var C=S.value,b=f(h.type,C);b&&(x=x.concat(b))}}catch(T){v={error:T}}finally{try{S&&!S.done&&(E=m.return)&&E.call(m)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,x}var p=It(i.map(d));return[p,u]}var Uc=[],Qo=function(e,t){Uc.push(e);var n=t(e);return Uc.pop(),n},Rk=function(e){return e(Uc[Uc.length-1])};function sw(e){var t;return t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}},t[pi]=function(){return this},t}function kk(e,t,n,r){var i,o=aw(e.src),a=(i=t==null?void 0:t.options.services)===null||i===void 0?void 0:i[o.type],s=e.data?Bc(e.data,n,r):void 0,u=a?Hh(a,e.id,s):sw(e.id);return u.meta=e,u}function Hh(e,t,n){var r=sw(t);if(r.deferred=!0,Kr(e)){var i=r.state=Qo(void 0,function(){return(n?e.withContext(n):e).initialState});r.getSnapshot=function(){return i}}return r}function Mk(e){try{return typeof e.send=="function"}catch{return!1}}function jk(e){return Mk(e)&&"id"in e}function _k(e){var t;return re((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}},t[pi]=function(){return this},t),e)}var Gc=function(e){return e.type==="atomic"||e.type==="final"};function uw(e){return Object.keys(e.states).map(function(t){return e.states[t]})}function Us(e){return uw(e).filter(function(t){return t.type!=="history"})}function cw(e){var t=[e];return Gc(e)?t:t.concat(It(Us(e).map(cw)))}function ps(e,t){var n,r,i,o,a,s,u,c,l=new Set(e),f=Qd(l),d=new Set(t);try{for(var p=Be(d),h=p.next();!h.done;h=p.next())for(var v=h.value,E=v.parent;E&&!d.has(E);)d.add(E),E=E.parent}catch(I){n={error:I}}finally{try{h&&!h.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}var x=Qd(d);try{for(var m=Be(d),S=m.next();!S.done;S=m.next()){var v=S.value;if(v.type==="compound"&&(!x.get(v)||!x.get(v).length))f.get(v)?f.get(v).forEach(function(N){return d.add(N)}):v.initialStateNodes.forEach(function(N){return d.add(N)});else if(v.type==="parallel")try{for(var C=(a=void 0,Be(Us(v))),b=C.next();!b.done;b=C.next()){var T=b.value;d.has(T)||(d.add(T),f.get(T)?f.get(T).forEach(function(N){return d.add(N)}):T.initialStateNodes.forEach(function(N){return d.add(N)}))}}catch(N){a={error:N}}finally{try{b&&!b.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}}}catch(I){i={error:I}}finally{try{S&&!S.done&&(o=m.return)&&o.call(m)}finally{if(i)throw i.error}}try{for(var A=Be(d),D=A.next();!D.done;D=A.next())for(var v=D.value,E=v.parent;E&&!d.has(E);)d.add(E),E=E.parent}catch(I){u={error:I}}finally{try{D&&!D.done&&(c=A.return)&&c.call(A)}finally{if(u)throw u.error}}return d}function lw(e,t){var n=t.get(e);if(!n)return{};if(e.type==="compound"){var r=n[0];if(r){if(Gc(r))return r.key}else return{}}var i={};return n.forEach(function(o){i[o.key]=lw(o,t)}),i}function Qd(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 qk(e,t){var n=ps([e],t);return lw(e,Qd(n))}function hs(e,t){return Array.isArray(e)?e.some(function(n){return n===t}):e instanceof Set?e.has(t):!1}function Fk(e){return yt([],Ge(new Set(It(yt([],Ge(e.map(function(t){return t.ownEvents})),!1)))),!1)}function hc(e,t){return t.type==="compound"?Us(t).some(function(n){return n.type==="final"&&hs(e,n)}):t.type==="parallel"?Us(t).every(function(n){return hc(e,n)}):!1}function Lk(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 fw(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;if(We(e)||We(t))return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(i){return fw(e[i],t[i])})}function Bk(e){return typeof e!="object"||e===null?!1:"value"in e&&"_event"in e}function Vk(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 tr=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=Lk(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 Fk(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=ha;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=ha;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="."),We(t))return[t];var i=Object.keys(t);return i.concat.apply(i,yt([],Ge(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=Vh(t,["configuration","transitions","tags","machine"]);return re(re({},r),{tags:Array.from(n)})},e.prototype.matches=function(t){return zh(t,this.value)},e.prototype.hasTag=function(t){return this.tags.has(t)},e.prototype.can=function(t){var n;$t&&en(!!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}(),Uk={deferEvents:!1},zm=function(){function e(t){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=re(re({},Uk),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}(),wf=new Map,Gk=0,es={bookId:function(){return"x:".concat(Gk++)},register:function(e,t){return wf.set(e,t),e},get:function(e){return wf.get(e)},free:function(e){wf.delete(e)}};function Kh(){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 zk(){var e=Kh();if(e&&"__xstate__"in e)return e.__xstate__}function Wk(e){if(Kh()){var t=zk();t&&t.register(e)}}function Hk(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 c=i.shift();n=e.transition(n,c,u),r.forEach(function(l){return l.next(n)})}o=!1}},s=_k({id:t.id,send:function(c){i.push(c),a()},getSnapshot:function(){return n},subscribe:function(c,l,f){var d=dc(c,l,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 Zd={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 Kk=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(l,f){if(La(l))return r.batch(l),r.state;var d=cn(Gl(l,f));if(r.status===Dt.Stopped)return $t||en(!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!==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.
|
|
85
|
-
Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var p=r._nextState(d);r.update(p,d)}),r._state},this.sendTo=function(l,f,d){var p=r.parent&&(f===So.Parent||r.parent.id===f),h=p?r.parent:We(f)?f===So.Internal?r:r.children.get(f)||
|
|
86
|
-
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=[],c=function(p){var h=cn(p);n.forward(h),a=Zo(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),u.push.apply(u,yt([],Ge(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return Gk(v,a)})),!1)),s=s||!!a.changed};try{for(var l=Be(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,cn(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=cn(t);if(i.name.indexOf(Fm)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Fm)===0}))throw i.data.data;var o=Zo(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),Ze(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Dt.Running)return Hh(t,n);if(Vm(t))return this.spawnPromise(Promise.resolve(t),n);if(Ze(t))return this.spawnCallback(t,n);if(qk(t))return this.spawnActor(t,n);if(yk(t))return this.spawnObservable(t,n);if(Xr(t))return this.spawnMachine(t,re(re({},r),{id:n}));if(hk(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({},Zd),n);o.sync&&i.onTransition(function(s){r.send(ZC,{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(cn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=Yk(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(cn(pc(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=ps(n,u);try{i.send(cn(c,{origin:n}))}catch(l){Ck(u,l,n),i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,c,l){var f=dc(u,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[vi]=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,c=function(d){u=d,s.forEach(function(p){return p(d)}),!o&&i.send(cn(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(ps(n,d))}if(Vm(l))return this.spawnPromise(l,n);var f=(r={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=dc(d);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){o=!0,Ze(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[vi]=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(cn(u,{origin:n}))},function(u){i.removeChild(n),i.send(cn(ps(n,u),{origin:n}))},function(){i.removeChild(n),i.send(cn(pc(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,c,l){return t.subscribe(u,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[vi]=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||en(!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[vi]=function(){return this},r))},e.prototype.attachDev=function(){var t=Kh();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)}Kk(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[vi]=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=d0,e}(),Jk=function(e){return We(e)?re(re({},Zd),{name:e}):re(re(re({},Zd),{name:bk()}),e)};function Wm(e,t){var n=Jk(t);return Mk(function(r){if(!$t){var i=Xr(e)||Ze(e);en(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Xr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):Hh(e,n.name)})}function d0(e,t){var n=new Xk(e,t);return n}function Qk(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function ju(e){return re(re({type:Hd},e),{toJSON:function(){e.onDone,e.onError;var t=Vh(e,["onDone","onError"]);return re(re({},t),{type:Hd,src:Qk(e.src)})}})}var ea="",ep="#",ns="*",zo={},Wo=function(e){return e[0]===ep},Zk=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},eM=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(We(o.target)||Xr(o.target))}),i=t===ea?"the transient event":"event '".concat(t,"'");en(!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.")},tM=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(Zk(),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:e0),this.id=this.config.id||yt([this.machine.key],Ge(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||en(!("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?ds(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,re((f={},f[d.id]=d,f),d.idMap)),d}):zo;var s=0;function u(c){var l,f;c.order=s++;try{for(var d=Be(u0(c)),p=d.next();!p.done;p=d.next()){var h=p.value;u(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.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(c){var l=c.event;return l===ea}):ea in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=fr(this.config.entry||this.config.onEntry).map(function(c){return Us(c)}),this.onExit=fr(this.config.exit||this.config.onExit).map(function(c){return Us(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=fr(this.config.invoke).map(function(c,l){var f,d;if(Xr(c)){var p=ku(o.id,l);return o.machine.options.services=re((f={},f[p]=c,f),o.machine.options.services),ju({src:p,id:p})}else if(We(c.src)){var p=c.id||ku(o.id,l);return ju(re(re({},c),{id:p,src:c.src}))}else if(Xr(c.src)||Ze(c.src)){var p=c.id||ku(o.id,l);return o.machine.options.services=re((d={},d[p]=c.src,d),o.machine.options.services),ju(re(re({id:p},c),{src:p}))}else{var h=c.src;return ju(re(re({id:ku(o.id,l)},c),{src:h}))}}),this.activities=fr(this.config.activities).concat(this.invoke).map(function(c){return Wh(c)}),this.transition=this.transition.bind(this),this.tags=fr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||c0(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 Ze(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:ds(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===ea,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===ns});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=Ze(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=Pk(s,t.id);return t.onEntry.push(zl(u,{delay:o})),t.onExit.push(Ak(u)),u},i=Ba(n)?n.map(function(o,a){var s=r(o.delay,a);return re(re({},o),{event:s})}):It(Object.keys(n).map(function(o,a){var s=n[o],u=We(s)?{target:s}:s,c=isNaN(+o)?o:+o,l=r(c,a);return fr(u).map(function(f){return re(re({},f),{event:l,delay:c})})}));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 tr?t.value:xs(t,this.delimiter);if(We(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([],Ge(It(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=t0(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof tr?t:tr.create(t),r=Array.from(hs([],this.getStateNodes(n.value)));return new tr(re(re({},n),{value:this.resolve(n.value),configuration:r,done:hc(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=Be(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,r);d&&(a[c]=d)}}}catch(x){i={error:x}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var p=Object.keys(a).map(function(x){return a[x]}),h=It(p.map(function(x){return x.transitions})),v=p.some(function(x){return x.transitions.length>0});if(!v)return this.next(n,r);var E=It(Object.keys(a).map(function(x){return a[x].configuration}));return{transitions:h,exitSet:It(p.map(function(x){return x.exitSet})),configuration:E,source:n,actions:It(Object.keys(a).map(function(x){return a[x].actions}))}},e.prototype._transition=function(t,n,r){return We(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,cn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],c;try{for(var l=Be(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,E=h?We(h)&&Wo(h)?t.matches(xs(this.getStateNodeById(h).path,this.delimiter)):zh(xs(h,this.delimiter),fk(this.path.slice(0,-2))(t.value)):!0,x=!1;try{x=!p||o0(this.machine,p,v,n,t)}catch(w){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
-
`).concat(w.message))}if(x&&E){d.target!==void 0&&(u=d.target),s.push.apply(s,yt([],Ge(d.actions),!1)),c=d;break}}}catch(w){r={error:w}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=It(u.map(function(w){return o.getRelativeStateNodes(w,t.historyValue)})),C=!!c.internal;return{transitions:[c],exitSet:C?[]:It(u.map(function(w){return o.getPotentiallyReenteringNodes(w)})),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,c,l,f,d=this,p=a?hs([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Be(Array.from(t).sort(function(_,L){return _.order-L.order})),E=v.next();!E.done;E=v.next()){var x=E.value;(!vs(p,x)||vs(r.exitSet,x)||x.parent&&h.has(x.parent))&&h.add(x)}}catch(_){u={error:_}}finally{try{E&&!E.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}try{for(var m=Be(p),C=m.next();!C.done;C=m.next()){var x=C.value;(!vs(t,x)||vs(r.exitSet,x.parent))&&r.exitSet.push(x)}}catch(_){l={error:_}}finally{try{C&&!C.done&&(f=m.return)&&f.call(m)}finally{if(l)throw l.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var w=Array.from(h).sort(function(_,L){return _.order-L.order}),b=new Set(r.exitSet),T=It(w.map(function(_){var L=[];if(_.type!=="final")return L;var V=_.parent;if(!V.parent)return L;L.push(Mu(_.id,_.doneData),Mu(V.id,_.doneData?Bc(_.doneData,i,o):void 0));var H=V.parent;return H.type==="parallel"&&Gs(H).every(function(R){return hc(r.configuration,R)})&&L.push(Mu(H.id)),L})),A=w.map(function(_){var L=_.onEntry,V=_.activities.map(function(H){return $k(H)});return{type:"entry",actions:mi(s?yt(yt([],Ge(L),!1),Ge(V),!1):yt(yt([],Ge(V),!1),Ge(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:T.map(function(_){return wk(_)})}),D=Array.from(b).map(function(_){return{type:"exit",actions:mi(yt(yt([],Ge(_.onExit),!1),Ge(_.activities.map(function(L){return Ok(L)})),!1),d.machine.options.actions)}}),I=D.concat({type:"transition",actions:mi(r.actions,this.machine.options.actions)}).concat(A);if(n){var N=mi(It(yt([],Ge(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Xd(_)});return I.concat({type:"stop",actions:N})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=cn(n),a;if(t instanceof tr)a=r===void 0?t:this.resolveState(tr.from(t,r));else{var s=We(t)?this.resolve(Lc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(tr.from(s,u))}if(!$t&&o.name===ns)throw new Error("An event cannot have the wildcard type ('".concat(ns,"')"));if(this.strict&&!this.events.includes(o.name)&&!pk(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=hs([],this.getStateNodes(a.value)),f=c.configuration.length?hs(l,c.configuration):l;return c.configuration=yt([],Ge(f),!1),this.resolveTransition(c,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([],Ge(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,c,l=this;o===void 0&&(o=va);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=hc(p,this),v=d?Lk(this.machine,f):void 0,E=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,x=this.getActions(new Set(p),h,t,r,o,n,i),m=n?re({},n.activities):{};try{for(var C=Be(x),w=C.next();!w.done;w=C.next()){var b=w.value;try{for(var T=(u=void 0,Be(b.actions)),A=T.next();!A.done;A=T.next()){var D=A.value;D.type===Wd?m[D.activity.id||D.activity.type]=D:D.type===Uh&&(m[D.activity.id||D.activity.type]=!1)}}catch(K){u={error:K}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}}}catch(K){a={error:K}}finally{try{w&&!w.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}var I=Ge(Vc(this,n,r,o,x,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),N=I[0],_=I[1],L=Ge(vk(N,Xd),2),V=L[0],H=L[1],R=N.filter(function(K){var ae;return K.type===Wd&&((ae=K.activity)===null||ae===void 0?void 0:ae.type)===Hd}),ie=R.reduce(function(K,ae){return K[ae.activity.id]=jk(ae.activity,l.machine,_,o),K},n?re({},n.children):{}),B=new tr({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?E?mk(E,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?H:[],activities:v?m:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:ie,done:h,tags:Gm(p),machine:this}),U=r!==_;B.changed=o.name===ZC||U;var fe=B.history;fe&&delete fe.history;var M=!h&&(this._transient||f.some(function(K){return K._transient}));if(!d&&(!M||o.name===ea))return B;var P=B;if(!h)for(M&&(P=this.resolveRaisedTransition(P,{type:ik},o,i));V.length;){var te=V.shift();P=this.resolveRaisedTransition(P,te._event,o,i)}var oe=P.changed||(fe?!!P.actions.length||U||typeof fe.value!=typeof P.value||!f0(P.value,fe.value):void 0);return P.changed=oe,P.history=fe,P},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(ep.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=Yd(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 ds(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):zo});case"compound":if(We(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?ds(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(ep.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return Yd(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=Gc(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;We(n.target)?t=Wo(n.target)?Lc(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(Gc(this))return[this];if(this.type==="compound"&&!this.initial)return $t||en(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=fc(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=Ge(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=We(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(fc(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=dk(r.path,"states")(t).current;return We(o)?[r.getStateNode(o)]:It(fc(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=Be(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,l=o[c];if(l.states)try{for(var f=(r=void 0,Be(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}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(!We(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 p=r._nextState(d);r.update(p,d)}),r._state},this.sendTo=function(l,f,d){var p=r.parent&&(f===So.Parent||r.parent.id===f),h=p?r.parent:We(f)?f===So.Internal?r:r.children.get(f)||es.get(f):mk(f)?f:void 0;if(!h){if(!p)throw new Error("Unable to send event to child '".concat(f,"' from service '").concat(r.id,"'."));$t||en(!1,"Service '".concat(r.id,"' has no parent: unable to send event ").concat(l.type));return}if("machine"in h){if(r.status!==Dt.Stopped||r.parent!==h||r.state.done){var v=re(re({},l),{name:l.name===ik?"".concat(ds(r.id)):l.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,v]):h.send(v)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([h,l.data]):h.send(l.data)},this._exec=function(l,f,d,p){p===void 0&&(p=r.machine.options.actions);var h=l.exec||Jd(l.type,p),v=Ze(h)?h:h?h.exec:l.exec;if(v)try{return v(f,d.data,r.machine.config.predictableActionArguments?{action:l,_event:d}:{action:l,state:r.state,_event:d})}catch(H){throw r.parent&&r.parent.send({type:"xstate.error",data:H}),H}switch(l.type){case fu:{var E=l;r.defer(E);break}case Ul:var x=l;if(typeof x.delay=="number"){r.defer(x);return}else x.to?r.sendTo(x._event,x.to,d===ha):r.send(x._event);break;case J0:r.cancel(l.sendId);break;case Wd:{if(r.status!==Dt.Running)return;var m=l.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[m.id||m.type])break;if(m.type===pt.Invoke){var S=aw(m.src),C=r.machine.options.services?r.machine.options.services[S.type]:void 0,b=m.id,T=m.data;$t||en(!("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(!C){$t||en(!1,"No service found for invocation '".concat(m.src,"' in machine '").concat(r.machine.id,"'."));return}var D=T?Bc(T,f,d):void 0;if(typeof C=="string")return;var I=Ze(C)?C(f,d.data,{data:D,src:S,meta:m.meta}):C;if(!I)return;var N=void 0;Kr(I)&&(I=D?I.withContext(D):I,N={autoForward:A}),r.spawn(I,b,N)}else r.spawnActivity(m);break}case Uh:{r.stopChild(l.activity.id);break}case Q0:var _=l,L=_.label,V=_.value;L?r.logger(L,V):r.logger(V);break;default:$t||en(!1,"No implementation found for action type '".concat(l.type,"'"));break}};var i=re(re({},e.defaultOptions),n),o=i.clock,a=i.logger,s=i.parent,u=i.id,c=u!==void 0?u:t.id;this.id=c,this.logger=a,this.clock=o,this.parent=s,this.options=i,this.scheduler=new zm({deferEvents:this.options.deferEvents}),this.sessionId=es.bookId()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var t=this;return this._initialState?this._initialState:Qo(this,function(){return t._initialState=t.machine.initialState,t._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return $t||en(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=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,c,l,f=this;if(t._sessionid=this.sessionId,this._state=t,(!this.machine.config.predictableActionArguments||n===ha)&&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 p=Be(this.eventListeners),h=p.next();!h.done;h=p.next()){var v=h.value;v(t.event)}}catch(I){r={error:I}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}try{for(var E=Be(this.listeners),x=E.next();!x.done;x=E.next()){var v=x.value;v(t,t.event)}}catch(I){o={error:I}}finally{try{x&&!x.done&&(a=E.return)&&a.call(E)}finally{if(o)throw o.error}}try{for(var m=Be(this.contextListeners),S=m.next();!S.done;S=m.next()){var C=S.value;C(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(I){s={error:I}}finally{try{S&&!S.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(this.state.done){var b=t.configuration.find(function(I){return I.type==="final"&&I.parent===f.machine}),T=b&&b.doneData?Bc(b.doneData,t.context,n):void 0;this._doneEvent=pc(this.id,T);try{for(var A=Be(this.doneListeners),D=A.next();!D.done;D=A.next()){var v=D.value;v(this._doneEvent)}}catch(I){c={error:I}}finally{try{D&&!D.done&&(l=A.return)&&l.call(A)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),es.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=dc(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(),es.register(this.sessionId,this),this.initialized=!0,this.status=Dt.Running;var r=t===void 0?this.initialState:Qo(this,function(){return Bk(t)?n.machine.resolveState(t):n.machine.resolveState(tr.from(t,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,ha)}),this},e.prototype._stopChildren=function(){this.children.forEach(function(t){Ze(t.stop)&&t.stop()}),this.children.clear()},e.prototype._stop=function(){var t,n,r,i,o,a,s,u,c,l;try{for(var f=Be(this.listeners),d=f.next();!d.done;d=f.next()){var p=d.value;this.listeners.delete(p)}}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 h=Be(this.stopListeners),v=h.next();!v.done;v=h.next()){var p=v.value;p(),this.stopListeners.delete(p)}}catch(A){r={error:A}}finally{try{v&&!v.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}try{for(var E=Be(this.contextListeners),x=E.next();!x.done;x=E.next()){var p=x.value;this.contextListeners.delete(p)}}catch(A){o={error:A}}finally{try{x&&!x.done&&(a=E.return)&&a.call(E)}finally{if(o)throw o.error}}try{for(var m=Be(this.doneListeners),S=m.next();!S.done;S=m.next()){var p=S.value;this.doneListeners.delete(p)}}catch(A){s={error:A}}finally{try{S&&!S.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 C=Be(Object.keys(this.delayedEventsMap)),b=C.next();!b.done;b=C.next()){var T=b.value;this.clock.clearTimeout(this.delayedEventsMap[T])}}catch(A){c={error:A}}finally{try{b&&!b.done&&(l=C.return)&&l.call(C)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new zm({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var t=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r=cn({type:"xstate.stop"}),i=Qo(t,function(){var o=It(yt([],Ge(t.state.configuration),!1).sort(function(l,f){return f.order-l.order}).map(function(l){return hi(l.onExit,t.machine.options.actions)})),a=Ge(Vc(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],c=new tr({value:t.state.value,context:u,_event:r,_sessionid:t.sessionId,historyValue:void 0,history:t.state,actions:s.filter(function(l){return!Xd(l)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:t.state.done,tags:t.state.tags,machine:t.machine});return c.changed=!0,c});t.update(i,r),t._stopChildren(),es.free(t.sessionId)}),this},e.prototype.batch=function(t){var n=this;if(this.status===Dt.NotStarted&&this.options.deferEvents)$t||en(!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!==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=[],c=function(p){var h=cn(p);n.forward(h),a=Qo(n,function(){return n.machine.transition(a,h,void 0,r||void 0)}),u.push.apply(u,yt([],Ge(n.machine.config.predictableActionArguments?a.actions:a.actions.map(function(v){return Vk(v,a)})),!1)),s=s||!!a.changed};try{for(var l=Be(t),f=l.next();!f.done;f=l.next()){var d=f.value;c(d)}}catch(p){i={error:p}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}a.changed=s,a.actions=u,n.update(a,cn(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=cn(t);if(i.name.indexOf(Fm)===0&&!this.state.nextEvents.some(function(a){return a.indexOf(Fm)===0}))throw i.data.data;var o=Qo(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),Ze(n.stop)&&n.stop())},e.prototype.spawn=function(t,n,r){if(this.status!==Dt.Running)return Hh(t,n);if(Vm(t))return this.spawnPromise(Promise.resolve(t),n);if(Ze(t))return this.spawnCallback(t,n);if(jk(t))return this.spawnActor(t,n);if(vk(t))return this.spawnObservable(t,n);if(Kr(t))return this.spawnMachine(t,re(re({},r),{id:n}));if(dk(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({},Zd),n);o.sync&&i.onTransition(function(s){r.send(Z0,{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(cn(s,{origin:i.id}))}).start(),a},e.prototype.spawnBehavior=function(t,n){var r=Hk(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(cn(pc(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=ds(n,u);try{i.send(cn(c,{origin:n}))}catch(l){bk(u,l,n),i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var s=(r={id:n,send:function(){},subscribe:function(u,c,l){var f=dc(u,c,l),d=!1;return t.then(function(p){d||(f.next(p),!d&&f.complete())},function(p){d||f.error(p)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return a}},r[pi]=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,c=function(d){u=d,s.forEach(function(p){return p(d)}),!o&&i.send(cn(d,{origin:n}))},l;try{l=t(c,function(d){a.add(d)})}catch(d){this.send(ds(n,d))}if(Vm(l))return this.spawnPromise(l,n);var f=(r={id:n,send:function(d){return a.forEach(function(p){return p(d)})},subscribe:function(d){var p=dc(d);return s.add(p.next),{unsubscribe:function(){s.delete(p.next)}}},stop:function(){o=!0,Ze(l)&&l()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[pi]=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(cn(u,{origin:n}))},function(u){i.removeChild(n),i.send(cn(ds(n,u),{origin:n}))},function(){i.removeChild(n),i.send(cn(pc(n),{origin:n}))}),s=(r={id:n,send:function(){},subscribe:function(u,c,l){return t.subscribe(u,c,l)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[pi]=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||en(!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[pi]=function(){return this},r))},e.prototype.attachDev=function(){var t=Kh();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)}Wk(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[pi]=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=dw,e}(),Yk=function(e){return We(e)?re(re({},Zd),{name:e}):re(re(re({},Zd),{name:yk()}),e)};function Wm(e,t){var n=Yk(t);return Rk(function(r){if(!$t){var i=Kr(e)||Ze(e);en(!!r||i,'Attempted to spawn an Actor (ID: "'.concat(Kr(e)?e.id:"undefined",'") outside of a service. This will have no effect.'))}return r?r.spawn(e,n.name,n):Hh(e,n.name)})}function dw(e,t){var n=new Kk(e,t);return n}function Xk(e){if(typeof e=="string"){var t={type:e};return t.toString=function(){return e},t}return e}function ju(e){return re(re({type:Hd},e),{toJSON:function(){e.onDone,e.onError;var t=Vh(e,["onDone","onError"]);return re(re({},t),{type:Hd,src:Xk(e.src)})}})}var Zo="",ep="#",ts="*",Go={},zo=function(e){return e[0]===ep},Jk=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},Qk=function(e,t,n){var r=n.slice(0,-1).some(function(o){return!("cond"in o)&&!("in"in o)&&(We(o.target)||Kr(o.target))}),i=t===Zo?"the transient event":"event '".concat(t,"'");en(!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.")},Zk=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(Jk(),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:ew),this.id=this.config.id||yt([this.machine.key],Ge(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||en(!("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?fs(this.config.states,function(c,l){var f,d=new e(c,{},void 0,{parent:o,key:l});return Object.assign(o.idMap,re((f={},f[d.id]=d,f),d.idMap)),d}):Go;var s=0;function u(c){var l,f;c.order=s++;try{for(var d=Be(uw(c)),p=d.next();!p.done;p=d.next()){var h=p.value;u(h)}}catch(v){l={error:v}}finally{try{p&&!p.done&&(f=d.return)&&f.call(d)}finally{if(l)throw l.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(c){var l=c.event;return l===Zo}):Zo in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=fr(this.config.entry||this.config.onEntry).map(function(c){return Vs(c)}),this.onExit=fr(this.config.exit||this.config.onExit).map(function(c){return Vs(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=fr(this.config.invoke).map(function(c,l){var f,d;if(Kr(c)){var p=ku(o.id,l);return o.machine.options.services=re((f={},f[p]=c,f),o.machine.options.services),ju({src:p,id:p})}else if(We(c.src)){var p=c.id||ku(o.id,l);return ju(re(re({},c),{id:p,src:c.src}))}else if(Kr(c.src)||Ze(c.src)){var p=c.id||ku(o.id,l);return o.machine.options.services=re((d={},d[p]=c.src,d),o.machine.options.services),ju(re(re({id:p},c),{src:p}))}else{var h=c.src;return ju(re(re({id:ku(o.id,l)},c),{src:h}))}}),this.activities=fr(this.config.activities).concat(this.invoke).map(function(c){return Wh(c)}),this.transition=this.transition.bind(this),this.tags=fr(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||cw(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 Ze(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:fs(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===Zo,r=this.transitions.filter(function(i){var o=i.eventType===t;return n?o:o||i.eventType===ts});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=Ze(o)?"".concat(t.id,":delay[").concat(a,"]"):o,u=Dk(s,t.id);return t.onEntry.push(zl(u,{delay:o})),t.onExit.push(Tk(u)),u},i=La(n)?n.map(function(o,a){var s=r(o.delay,a);return re(re({},o),{event:s})}):It(Object.keys(n).map(function(o,a){var s=n[o],u=We(s)?{target:s}:s,c=isNaN(+o)?o:+o,l=r(c,a);return fr(u).map(function(f){return re(re({},f),{event:l,delay:c})})}));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 tr?t.value:Cs(t,this.delimiter);if(We(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([],Ge(It(a.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),s},e.prototype.handles=function(t){var n=tw(t);return this.events.includes(n)},e.prototype.resolveState=function(t){var n=t instanceof tr?t:tr.create(t),r=Array.from(ps([],this.getStateNodes(n.value)));return new tr(re(re({},n),{value:this.resolve(n.value),configuration:r,done:hc(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=Be(Object.keys(t)),u=s.next();!u.done;u=s.next()){var c=u.value,l=t[c];if(l){var f=this.getStateNode(c),d=f._transition(l,n,r);d&&(a[c]=d)}}}catch(x){i={error:x}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}var p=Object.keys(a).map(function(x){return a[x]}),h=It(p.map(function(x){return x.transitions})),v=p.some(function(x){return x.transitions.length>0});if(!v)return this.next(n,r);var E=It(Object.keys(a).map(function(x){return a[x].configuration}));return{transitions:h,exitSet:It(p.map(function(x){return x.exitSet})),configuration:E,source:n,actions:It(Object.keys(a).map(function(x){return a[x].actions}))}},e.prototype._transition=function(t,n,r){return We(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,cn(n))},e.prototype.next=function(t,n){var r,i,o=this,a=n.name,s=[],u=[],c;try{for(var l=Be(this.getCandidates(a)),f=l.next();!f.done;f=l.next()){var d=f.value,p=d.cond,h=d.in,v=t.context,E=h?We(h)&&zo(h)?t.matches(Cs(this.getStateNodeById(h).path,this.delimiter)):zh(Cs(h,this.delimiter),ck(this.path.slice(0,-2))(t.value)):!0,x=!1;try{x=!p||ow(this.machine,p,v,n,t)}catch(C){throw new Error("Unable to evaluate guard '".concat(p.name||p.type,"' in transition for event '").concat(a,"' in state node '").concat(this.id,`':
|
|
87
|
+
`).concat(C.message))}if(x&&E){d.target!==void 0&&(u=d.target),s.push.apply(s,yt([],Ge(d.actions),!1)),c=d;break}}}catch(C){r={error:C}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:t.value?[this]:[],source:t,actions:s};var m=It(u.map(function(C){return o.getRelativeStateNodes(C,t.historyValue)})),S=!!c.internal;return{transitions:[c],exitSet:S?[]:It(u.map(function(C){return o.getPotentiallyReenteringNodes(C)})),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,c,l,f,d=this,p=a?ps([],this.getStateNodes(a.value)):[],h=new Set;try{for(var v=Be(Array.from(t).sort(function(_,L){return _.order-L.order})),E=v.next();!E.done;E=v.next()){var x=E.value;(!hs(p,x)||hs(r.exitSet,x)||x.parent&&h.has(x.parent))&&h.add(x)}}catch(_){u={error:_}}finally{try{E&&!E.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}try{for(var m=Be(p),S=m.next();!S.done;S=m.next()){var x=S.value;(!hs(t,x)||hs(r.exitSet,x.parent))&&r.exitSet.push(x)}}catch(_){l={error:_}}finally{try{S&&!S.done&&(f=m.return)&&f.call(m)}finally{if(l)throw l.error}}r.exitSet.sort(function(_,L){return L.order-_.order});var C=Array.from(h).sort(function(_,L){return _.order-L.order}),b=new Set(r.exitSet),T=It(C.map(function(_){var L=[];if(_.type!=="final")return L;var V=_.parent;if(!V.parent)return L;L.push(Mu(_.id,_.doneData),Mu(V.id,_.doneData?Bc(_.doneData,i,o):void 0));var H=V.parent;return H.type==="parallel"&&Us(H).every(function(R){return hc(r.configuration,R)})&&L.push(Mu(H.id)),L})),A=C.map(function(_){var L=_.onEntry,V=_.activities.map(function(H){return Ik(H)});return{type:"entry",actions:hi(s?yt(yt([],Ge(L),!1),Ge(V),!1):yt(yt([],Ge(V),!1),Ge(L),!1),d.machine.options.actions)}}).concat({type:"state_done",actions:T.map(function(_){return Sk(_)})}),D=Array.from(b).map(function(_){return{type:"exit",actions:hi(yt(yt([],Ge(_.onExit),!1),Ge(_.activities.map(function(L){return Ak(L)})),!1),d.machine.options.actions)}}),I=D.concat({type:"transition",actions:hi(r.actions,this.machine.options.actions)}).concat(A);if(n){var N=hi(It(yt([],Ge(t),!1).sort(function(_,L){return L.order-_.order}).map(function(_){return _.onExit})),this.machine.options.actions).filter(function(_){return!Xd(_)});return I.concat({type:"stop",actions:N})}return I},e.prototype.transition=function(t,n,r,i){t===void 0&&(t=this.initialState);var o=cn(n),a;if(t instanceof tr)a=r===void 0?t:this.resolveState(tr.from(t,r));else{var s=We(t)?this.resolve(Lc(this.getResolvedPath(t))):this.resolve(t),u=r??this.machine.context;a=this.resolveState(tr.from(s,u))}if(!$t&&o.name===ts)throw new Error("An event cannot have the wildcard type ('".concat(ts,"')"));if(this.strict&&!this.events.includes(o.name)&&!fk(o.name))throw new Error("Machine '".concat(this.id,"' does not accept event '").concat(o.name,"'"));var c=this._transition(a.value,a,o)||{transitions:[],configuration:[],exitSet:[],source:a,actions:[]},l=ps([],this.getStateNodes(a.value)),f=c.configuration.length?ps(l,c.configuration):l;return c.configuration=yt([],Ge(f),!1),this.resolveTransition(c,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([],Ge(a),!1)),t},e.prototype.resolveTransition=function(t,n,r,i,o){var a,s,u,c,l=this;o===void 0&&(o=ha);var f=t.configuration,d=!n||t.transitions.length>0,p=d?t.configuration:n?n.configuration:[],h=hc(p,this),v=d?qk(this.machine,f):void 0,E=n?n.historyValue?n.historyValue:t.source?this.machine.historyValue(n.value):void 0:void 0,x=this.getActions(new Set(p),h,t,r,o,n,i),m=n?re({},n.activities):{};try{for(var S=Be(x),C=S.next();!C.done;C=S.next()){var b=C.value;try{for(var T=(u=void 0,Be(b.actions)),A=T.next();!A.done;A=T.next()){var D=A.value;D.type===Wd?m[D.activity.id||D.activity.type]=D:D.type===Uh&&(m[D.activity.id||D.activity.type]=!1)}}catch(K){u={error:K}}finally{try{A&&!A.done&&(c=T.return)&&c.call(T)}finally{if(u)throw u.error}}}}catch(K){a={error:K}}finally{try{C&&!C.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}var I=Ge(Vc(this,n,r,o,x,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),N=I[0],_=I[1],L=Ge(pk(N,Xd),2),V=L[0],H=L[1],R=N.filter(function(K){var ae;return K.type===Wd&&((ae=K.activity)===null||ae===void 0?void 0:ae.type)===Hd}),ie=R.reduce(function(K,ae){return K[ae.activity.id]=kk(ae.activity,l.machine,_,o),K},n?re({},n.children):{}),B=new tr({value:v||n.value,context:_,_event:o,_sessionid:n?n._sessionid:null,historyValue:v?E?hk(E,v):void 0:n?n.historyValue:void 0,history:!v||t.source?n:void 0,actions:v?H:[],activities:v?m:n?n.activities:{},events:[],configuration:p,transitions:t.transitions,children:ie,done:h,tags:Gm(p),machine:this}),U=r!==_;B.changed=o.name===Z0||U;var fe=B.history;fe&&delete fe.history;var M=!h&&(this._transient||f.some(function(K){return K._transient}));if(!d&&(!M||o.name===Zo))return B;var P=B;if(!h)for(M&&(P=this.resolveRaisedTransition(P,{type:nk},o,i));V.length;){var te=V.shift();P=this.resolveRaisedTransition(P,te._event,o,i)}var oe=P.changed||(fe?!!P.actions.length||U||typeof fe.value!=typeof P.value||!fw(P.value,fe.value):void 0);return P.changed=oe,P.history=fe,P},e.prototype.getStateNode=function(t){if(zo(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=zo(t)?t.slice(ep.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"&&zo(t))try{return this.getStateNodeById(t.slice(1))}catch{}for(var n=Yd(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||Go;switch(this.type){case"parallel":return fs(this.initialStateValue,function(o,a){return o?r.getStateNode(a).resolve(t[a]||o):Go});case"compound":if(We(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?fs(t,function(o,a){return o?r.getStateNode(a).resolve(o):Go}):this.initialStateValue||{};default:return t||Go}},e.prototype.getResolvedPath=function(t){if(zo(t)){var n=this.machine.idMap[t.slice(ep.length)];if(!n)throw new Error("Unable to find state node '".concat(t,"'"));return n.path}return Yd(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||Go},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=Gc(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;We(n.target)?t=zo(n.target)?Lc(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(Gc(this))return[this];if(this.type==="compound"&&!this.initial)return $t||en(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var n=fc(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=Ge(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=We(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(fc(i).map(function(a){return r.getFromRelativePath(a)})):r.initialStateNodes}var o=lk(r.path,"states")(t).current;return We(o)?[r.getStateNode(o)]:It(fc(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=Be(Object.keys(o)),u=s.next();!u.done;u=s.next()){var c=u.value,l=o[c];if(l.states)try{for(var f=(r=void 0,Be(l.events)),d=f.next();!d.done;d=f.next()){var p=d.value;a.add("".concat(p))}}catch(h){r={error:h}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}}catch(h){t={error:h}}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(!We(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=gk(t.target),i="internal"in t?t.internal:r?r.some(function(u){return We(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,a=this.resolveTarget(r),s=re(re({},t),{actions:hi(fr(t.actions)),cond:iw(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=ts,s=o[a],u=s===void 0?[]:s,c=Vh(o,[typeof a=="symbol"?a:a+""]);i=It(Object.keys(c).map(function(m){!$t&&m===Zo&&en(!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 S=Uo(m,c[m]);return $t||Qk(r,m,S),S}).concat(Uo(ts,u)))}var l=this.config.always?Uo("",this.config.always):[],f=this.config.onDone?Uo(String(Mu(this.id)),this.config.onDone):[];$t||en(!(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 S=[];return m.onDone&&S.push.apply(S,yt([],Ge(Uo(String(pc(m.id)),m.onDone)),!1)),m.onError&&S.push.apply(S,yt([],Ge(Uo(String(ds(m.id)),m.onError)),!1)),S})),p=this.after,h=It(yt(yt(yt(yt([],Ge(f),!1),Ge(d),!1),Ge(i),!1),Ge(l),!1).map(function(m){return fr(m).map(function(S){return r.formatTransition(S)})}));try{for(var v=Be(p),E=v.next();!E.done;E=v.next()){var x=E.value;h.push(x)}}catch(m){t={error:m}}finally{try{E&&!E.done&&(n=v.return)&&n.call(v)}finally{if(t)throw t.error}}return h},e}(),Hm=!1;function Yh(e,t){return!$t&&!("predictableActionArguments"in e)&&!Hm&&(Hm=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new Zk(e,t)}var Pn=Ok,eM=zl,pw=xk,_u=Nk,tt={},Xh={};(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!==Dt.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,c=arguments.length;u<c;u++){s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(a[l]=s[l])}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 c=0,u=Object.getOwnPropertySymbols(o);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(o,u[c])&&(s[u[c]]=o[u[c]]);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),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return l}function i(o,a,s){if(s||arguments.length===2)for(var u=0,c=a.length,l;u<c;u++)(l||!(u in a))&&(l||(l=Array.prototype.slice.call(a,0,u)),l[u]=a[u]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Xh);var Wl={};(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={}))})(Wl);var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});var sn=Wl,rM=sn.ActionTypes.Start,iM=sn.ActionTypes.Stop,oM=sn.ActionTypes.Raise,aM=sn.ActionTypes.Send,sM=sn.ActionTypes.Cancel,uM=sn.ActionTypes.NullEvent,cM=sn.ActionTypes.Assign,lM=sn.ActionTypes.After,fM=sn.ActionTypes.DoneState,dM=sn.ActionTypes.Log,pM=sn.ActionTypes.Init,hM=sn.ActionTypes.Invoke,vM=sn.ActionTypes.ErrorExecution,mM=sn.ActionTypes.ErrorPlatform,yM=sn.ActionTypes.ErrorCustom,gM=sn.ActionTypes.Update,bM=sn.ActionTypes.Choose,SM=sn.ActionTypes.Pure;Lt.after=lM;Lt.assign=cM;Lt.cancel=sM;Lt.choose=bM;Lt.doneState=fM;Lt.error=yM;Lt.errorExecution=vM;Lt.errorPlatform=mM;Lt.init=pM;Lt.invoke=hM;Lt.log=dM;Lt.nullEvent=uM;Lt.pure=SM;Lt.raise=oM;Lt.send=aM;Lt.start=rM;Lt.stop=iM;Lt.update=gM;var h0={},Va={};Object.defineProperty(Va,"__esModule",{value:!0});var CM=".",wM={},xM="xstate.guard",EM="";Va.DEFAULT_GUARD_TYPE=xM;Va.EMPTY_ACTIVITY_MAP=wM;Va.STATE_DELIMITER=CM;Va.TARGETLESS_KEY=EM;var Hl={};Object.defineProperty(Hl,"__esModule",{value:!0});var TM=process.env.NODE_ENV==="production";Hl.IS_PRODUCTION=TM;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Xh,n=Wl,r=Lt,i=Va,o=Hl,a;function s(y){return Object.keys(y)}function u(y,k,F){F===void 0&&(F=i.STATE_DELIMITER);var q=p(y,F),X=p(k,F);return U(X)?U(q)?X===q:!1:U(q)?q in X:Object.keys(q).every(function(Q){return Q in X?u(q[Q],X[Q]):!1})}function c(y){try{return U(y)||typeof y=="number"?"".concat(y):y.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(y){try{return U(y)||typeof y=="number"?"".concat(y):B(y)?y.name:y.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(y,k){try{return ie(y)?y:y.toString().split(k)}catch{throw new Error("'".concat(y,"' is not a valid state path."))}}function d(y){return typeof y=="object"&&"value"in y&&"context"in y&&"event"in y&&"_event"in y}function p(y,k){if(d(y))return y.value;if(ie(y))return h(y);if(typeof y!="string")return y;var F=f(y,k);return h(F)}function h(y){if(y.length===1)return y[0];for(var k={},F=k,q=0;q<y.length-1;q++)q===y.length-2?F[y[q]]=y[q+1]:(F[y[q]]={},F=F[y[q]]);return k}function v(y,k){for(var F={},q=Object.keys(y),X=0;X<q.length;X++){var Q=q[X];F[Q]=k(y[Q],Q,y,X)}return F}function E(y,k,F){var q,X,Q={};try{for(var le=t.__values(Object.keys(y)),se=le.next();!se.done;se=le.next()){var ge=se.value,Ae=y[ge];F(Ae)&&(Q[ge]=k(Ae,ge,y))}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}var x=function(y){return function(k){var F,q,X=k;try{for(var Q=t.__values(y),le=Q.next();!le.done;le=Q.next()){var se=le.value;X=X[se]}}catch(ge){F={error:ge}}finally{try{le&&!le.done&&(q=Q.return)&&q.call(Q)}finally{if(F)throw F.error}}return X}};function m(y,k){return function(F){var q,X,Q=F;try{for(var le=t.__values(y),se=le.next();!se.done;se=le.next()){var ge=se.value;Q=Q[k][ge]}}catch(Ae){q={error:Ae}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}}function C(y){if(!y)return[[]];if(U(y))return[[y]];var k=b(Object.keys(y).map(function(F){var q=y[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:C(y[F]).map(function(X){return[F].concat(X)})}));return k}function w(y){var k,F,q={};if(y&&y.length===1&&y[0].length===1)return y[0][0];try{for(var X=t.__values(y),Q=X.next();!Q.done;Q=X.next())for(var le=Q.value,se=q,ge=0;ge<le.length;ge++){var Ae=le[ge];if(ge===le.length-2){se[Ae]=le[ge+1];break}se[Ae]=se[Ae]||{},se=se[Ae]}}catch(jt){k={error:jt}}finally{try{Q&&!Q.done&&(F=X.return)&&F.call(X)}finally{if(k)throw k.error}}return q}function b(y){var k;return(k=[]).concat.apply(k,t.__spreadArray([],t.__read(y),!1))}function T(y){return ie(y)?y:[y]}function A(y){return y===void 0?[]:T(y)}function D(y,k,F){var q,X;if(B(y))return y(k,F.data);var Q={};try{for(var le=t.__values(Object.keys(y)),se=le.next();!se.done;se=le.next()){var ge=se.value,Ae=y[ge];B(Ae)?Q[ge]=Ae(k,F.data):Q[ge]=Ae}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}function I(y){return/^(done|error)\./.test(y)}function N(y){return!!(y instanceof Promise||y!==null&&(B(y)||typeof y=="object")&&B(y.then))}function _(y){return y!==null&&typeof y=="object"&&"transition"in y&&typeof y.transition=="function"}function L(y,k){var F,q,X=t.__read([[],[]],2),Q=X[0],le=X[1];try{for(var se=t.__values(y),ge=se.next();!ge.done;ge=se.next()){var Ae=ge.value;k(Ae)?Q.push(Ae):le.push(Ae)}}catch(jt){F={error:jt}}finally{try{ge&&!ge.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Q,le]}function V(y,k){return v(y.states,function(F,q){if(F){var X=(U(k)?void 0:k[q])||(F?F.current:void 0);if(X)return{current:X,states:V(F,X)}}})}function H(y,k){return{current:k,states:V(y,k)}}function R(y,k,F,q){o.IS_PRODUCTION||e.warn(!!y,"Attempting to update undefined context");var X=y&&F.reduce(function(Q,le){var se,ge,Ae=le.assignment,jt={state:q,action:le,_event:k},Gi={};if(B(Ae))Gi=Ae(Q,k.data,jt);else try{for(var kr=t.__values(Object.keys(Ae)),cr=kr.next();!cr.done;cr=kr.next()){var Ka=cr.value,zi=Ae[Ka];Gi[Ka]=B(zi)?zi(Q,k.data,jt):zi}}catch(vf){se={error:vf}}finally{try{cr&&!cr.done&&(ge=kr.return)&&ge.call(kr)}finally{if(se)throw se.error}}return Object.assign({},Q,Gi)},y);return X}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(y,k){var F=y instanceof Error?y:void 0;if(!(!F&&y)&&console!==void 0){var q=["Warning: ".concat(k)];F&&q.push(F),console.warn.apply(console,q)}});function ie(y){return Array.isArray(y)}function B(y){return typeof y=="function"}function U(y){return typeof y=="string"}function fe(y,k){if(y)return U(y)?{type:i.DEFAULT_GUARD_TYPE,name:y,predicate:k?k[y]:void 0}:B(y)?{type:i.DEFAULT_GUARD_TYPE,name:y.name,predicate:y}:y}function M(y){try{return"subscribe"in y&&B(y.subscribe)}catch{return!1}}var P=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[P]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(y){return!!y&&"__xstatenode"in y}function K(y){return!!y&&typeof y.send=="function"}var ae=function(){var y=0;return function(){return y++,y.toString(16)}}();function de(y,k){return U(y)||typeof y=="number"?t.__assign({type:y},k):y}function he(y,k){if(!U(y)&&"$$type"in y&&y.$$type==="scxml")return y;var F=de(y);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},k)}function xe(y,k){var F=T(k).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:y}:t.__assign(t.__assign({},q),{event:y})});return F}function Re(y){if(!(y===void 0||y===i.TARGETLESS_KEY))return A(y)}function De(y,k,F){if(!o.IS_PRODUCTION){var q=y.stack?" Stacktrace was '".concat(y.stack,"'"):"";if(y===k)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(y,"'.").concat(q));else{var X=k.stack?" Stacktrace was '".concat(k.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(y,"'. ").concat(q," Current error is '").concat(k,"'.").concat(X))}}}function ht(y,k,F,q,X){var Q=y.options.guards,le={state:X,cond:k,_event:q};if(k.type===i.DEFAULT_GUARD_TYPE)return((Q==null?void 0:Q[k.name])||k.predicate)(F,q.data,le);var se=Q==null?void 0:Q[k.type];if(!se)throw new Error("Guard '".concat(k.type,"' is not implemented on machine '").concat(y.id,"'."));return se(F,q.data,le)}function ce(y){return typeof y=="string"?{type:y}:y}function Dn(y,k,F){var q=function(){},X=typeof y=="object",Q=X?y:null;return{next:((X?y.next:y)||q).bind(Q),error:((X?y.error:k)||q).bind(Q),complete:((X?y.complete:F)||q).bind(Q)}}function ii(y,k){return"".concat(y,":invocation[").concat(k,"]")}function _o(y){return(y.type===r.raise||y.type===r.send&&y.to===n.SpecialTargets.Internal)&&typeof y.delay!="number"}e.createInvokeId=ii,e.evaluateGuard=ht,e.flatten=b,e.getActionType=l,e.getEventType=c,e.interopSymbols=te,e.isActor=K,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=M,e.isPromiseLike=N,e.isRaisableAction=_o,e.isStateLike=d,e.isString=U,e.keys=s,e.mapContext=D,e.mapFilterValues=E,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=Re,e.partition=L,e.path=x,e.pathToStateValue=h,e.pathsToStateValue=w,e.reportUnhandledExceptionOnInvocation=De,e.symbolObservable=P,e.toArray=A,e.toArrayStrict=T,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=ce,e.toObserver=Dn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=C,e.toStateValue=p,e.toTransitionConfigArray=xe,e.uniqueId=ae,e.updateContext=R,e.updateHistoryStates=V,e.updateHistoryValue=H})(h0);Object.defineProperty(tt,"__esModule",{value:!0});var Ke=Xh,ur=Wl,rn=Lt,Fe=h0,v0=Hl,IM=Fe.toSCXMLEvent({type:rn.init});function tp(e,t){return t&&t[e]||void 0}function Kl(e,t){var n;if(Fe.isString(e)||typeof e=="number"){var r=tp(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=tp(e.type,t);if(Fe.isFunction(r))n=Ke.__assign(Ke.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Ke.__assign(Ke.__assign(Ke.__assign({},r),e),{type:i})}else n=e}return n}var np=function(e,t){if(!e)return[];var n=Fe.isArray(e)?e:[e];return n.map(function(r){return Kl(r,t)})};function Jh(e){var t=Kl(e);return Ke.__assign(Ke.__assign({id:Fe.isString(e)?e:t.id},t),{type:t.type})}function AM(e,t){return{type:rn.raise,event:typeof e=="function"?e:Fe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function m0(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 Ke.__assign(Ke.__assign({},e),{type:rn.raise,_event:o,delay:a})}function du(e,t){return{to:t?t.to:void 0,type:rn.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 y0(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 Ke.__assign(Ke.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Qh(e,t){return du(e,Ke.__assign(Ke.__assign({},t),{to:ur.SpecialTargets.Parent}))}function $M(e,t,n){return du(t,Ke.__assign(Ke.__assign({},n),{to:e}))}function OM(){return Qh(rn.update)}function DM(e,t){return du(e,Ke.__assign(Ke.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var NM=function(e,t){return{context:e,event:t}};function PM(e,t){return e===void 0&&(e=NM),{type:rn.log,label:t,expr:e}}var g0=function(e,t,n){return Ke.__assign(Ke.__assign({},e),{value:Fe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},RM=function(e){return{type:rn.cancel,sendId:e}};function kM(e){var t=Jh(e);return{type:ur.ActionTypes.Start,activity:t,exec:void 0}}function MM(e){var t=Fe.isFunction(e)?e:Jh(e);return{type:ur.ActionTypes.Stop,activity:t,exec:void 0}}function b0(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:ur.ActionTypes.Stop,activity:i};return o}var jM=function(e){return{type:rn.assign,assignment:e}};function _M(e){return typeof e=="object"&&"type"in e}function qM(e,t){var n=t?"#".concat(t):"";return"".concat(ur.ActionTypes.After,"(").concat(e,")").concat(n)}function FM(e,t){var n="".concat(ur.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function LM(e,t){var n="".concat(ur.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function BM(e,t){var n="".concat(ur.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function VM(e){return{type:ur.ActionTypes.Pure,get:e}}function UM(e,t){if(!v0.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,Ke.__spreadArray([],Ke.__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 du(function(r,i){return i},Ke.__assign(Ke.__assign({},t),{to:e}))}function GM(e,t){return Qh(function(n,r,i){return{type:rn.error,data:Fe.isFunction(e)?e(n,r,i):e}},Ke.__assign(Ke.__assign({},t),{to:ur.SpecialTargets.Parent}))}function zM(e){return{type:ur.ActionTypes.Choose,conds:e}}var WM=function(e){var t,n,r=[];try{for(var i=Ke.__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===rn.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 rp(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:WM(i),u=s.length?Fe.updateContext(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var E;switch(v.type){case rn.raise:{var x=m0(v,u,r,e.options.delays);return o&&typeof x.delay=="number"&&o(x,u,r),x}case rn.send:var m=y0(v,u,r,e.options.delays);if(!v0.IS_PRODUCTION){var C=v.delay;Fe.warn(!Fe.isString(C)||typeof m.delay=="number","No delay reference for delay expression '".concat(C,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==ur.SpecialTargets.Internal&&(h==="entry"?l.push(m):o(m,u,r)),m;case rn.log:{var w=g0(v,u,r);return o==null||o(w,u,r),w}case rn.choose:{var b=v,T=(E=b.conds.find(function(B){var U=Fe.toGuard(B.cond,e.options.guards);return!U||Fe.evaluateGuard(e,U,u,r,o?void 0:t)}))===null||E===void 0?void 0:E.actions;if(!T)return[];var A=Ke.__read(rp(e,t,u,r,[{type:h,actions:np(Fe.toArray(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case rn.pure:{var T=v.get(u,r.data);if(!T)return[];var N=Ke.__read(rp(e,t,u,r,[{type:h,actions:np(Fe.toArray(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case rn.stop:{var w=b0(v,u,r);return o==null||o(w,n,r),w}case rn.assign:{u=Fe.updateContext(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=Kl(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=Ke.__assign(Ke.__assign({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,Ke.__spreadArray([c[R]],Ke.__read(U),!1))}});V=ie}return V}}function d(h){var v,E,x=[];try{for(var m=Ke.__values(h.actions),C=m.next();!C.done;C=m.next()){var w=C.value,b=f(h.type,w);b&&(x=x.concat(b))}}catch(T){v={error:T}}finally{try{C&&!C.done&&(E=m.return)&&E.call(m)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,x}var p=Fe.flatten(i.map(d));return[p,u]}tt.actionTypes=rn;tt.after=qM;tt.assign=jM;tt.cancel=RM;tt.choose=zM;tt.done=FM;tt.doneInvoke=LM;tt.error=BM;tt.escalate=GM;tt.forwardTo=UM;tt.getActionFunction=tp;tt.initEvent=IM;tt.isActionObject=_M;var Ln=tt.log=PM,HM=tt.pure=VM;tt.raise=AM;tt.resolveActions=rp;tt.resolveLog=g0;tt.resolveRaise=m0;tt.resolveSend=y0;tt.resolveStop=b0;tt.respond=DM;tt.send=du;tt.sendParent=Qh;tt.sendTo=$M;tt.sendUpdate=OM;tt.start=kM;var Km=tt.stop=MM;tt.toActionObject=Kl;tt.toActionObjects=np;tt.toActivityDefinition=Jh;function S0(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Yl(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 C0(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 Xm(e){return typeof e.then=="function"}function Xl(e,t){return e===t||e!==e&&t!==t}var KM="[object Arguments]",YM="[object Boolean]",XM="[object Date]",JM="[object RegExp]",QM="[object Map]",ZM="[object Number]",ej="[object Object]",tj="[object Set]",nj="[object String]",Jm=Object.prototype.toString;function Jl(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(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(Ym(l)&&Ym(f))return i(l,f,u,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,u,d);var v=Jm.call(l);return v!==Jm.call(f)?!1:v===XM?n(l,f,u,d):v===JM?o(l,f,u,d):v===QM?r(l,f,u,d):v===tj?a(l,f,u,d):v===ej||v===KM?Xm(l)||Xm(f)?!1:i(l,f,u,d):v===YM||v===ZM||v===nj?Xl(l.valueOf(),f.valueOf()):!1}return c}function w0(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 rj=Yl(w0);function x0(e,t){return Xl(e.valueOf(),t.valueOf())}function E0(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 c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(u,d,a,l,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[l]=!0),l++}),a++,i=c}}),i}var ij=Yl(E0),oj="_owner",aj=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===oj){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!aj.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var sj=Yl(T0);function I0(e,t){return e.source===t.source&&e.flags===t.flags}function A0(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,c=0;t.forEach(function(l,f){!u&&!o[c]&&(u=n(a,l,s,f,e,t,r))&&(o[c]=!0),c++}),i=u}}),i}var uj=Yl(A0),$0=Object.freeze({areArraysEqual:w0,areDatesEqual:x0,areMapsEqual:E0,areObjectsEqual:T0,areRegExpsEqual:I0,areSetsEqual:A0,createIsNestedEqual:S0}),O0=Object.freeze({areArraysEqual:rj,areDatesEqual:x0,areMapsEqual:ij,areObjectsEqual:sj,areRegExpsEqual:I0,areSetsEqual:uj,createIsNestedEqual:S0}),cj=Jl($0);function lj(e,t){return cj(e,t,void 0)}Jl(C0($0,{createIsNestedEqual:function(){return Xl}}));Jl(O0);Jl(C0(O0,{createIsNestedEqual:function(){return Xl}}));var ip={exports:{}},wf={},qu={exports:{}},xf={};/**
|
|
101
|
+
***************************************************************************** */e.__assign=function(){return e.__assign=Object.assign||function(a){for(var s,u=1,c=arguments.length;u<c;u++){s=arguments[u];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(a[l]=s[l])}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 c=0,u=Object.getOwnPropertySymbols(o);c<u.length;c++)a.indexOf(u[c])<0&&Object.prototype.propertyIsEnumerable.call(o,u[c])&&(s[u[c]]=o[u[c]]);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),c,l=[],f;try{for(;(a===void 0||a-- >0)&&!(c=u.next()).done;)l.push(c.value)}catch(d){f={error:d}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(f)throw f.error}}return l}function i(o,a,s){if(s||arguments.length===2)for(var u=0,c=a.length,l;u<c;u++)(l||!(u in a))&&(l||(l=Array.prototype.slice.call(a,0,u)),l[u]=a[u]);return o.concat(l||Array.prototype.slice.call(a))}e.__read=r,e.__rest=t,e.__spreadArray=i,e.__values=n})(Xh);var Wl={};(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={}))})(Wl);var Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});var sn=Wl,tM=sn.ActionTypes.Start,nM=sn.ActionTypes.Stop,rM=sn.ActionTypes.Raise,iM=sn.ActionTypes.Send,oM=sn.ActionTypes.Cancel,aM=sn.ActionTypes.NullEvent,sM=sn.ActionTypes.Assign,uM=sn.ActionTypes.After,cM=sn.ActionTypes.DoneState,lM=sn.ActionTypes.Log,fM=sn.ActionTypes.Init,dM=sn.ActionTypes.Invoke,pM=sn.ActionTypes.ErrorExecution,hM=sn.ActionTypes.ErrorPlatform,vM=sn.ActionTypes.ErrorCustom,mM=sn.ActionTypes.Update,yM=sn.ActionTypes.Choose,gM=sn.ActionTypes.Pure;Lt.after=uM;Lt.assign=sM;Lt.cancel=oM;Lt.choose=yM;Lt.doneState=cM;Lt.error=vM;Lt.errorExecution=pM;Lt.errorPlatform=hM;Lt.init=fM;Lt.invoke=dM;Lt.log=lM;Lt.nullEvent=aM;Lt.pure=gM;Lt.raise=rM;Lt.send=iM;Lt.start=tM;Lt.stop=nM;Lt.update=mM;var hw={},Ba={};Object.defineProperty(Ba,"__esModule",{value:!0});var bM=".",SM={},wM="xstate.guard",CM="";Ba.DEFAULT_GUARD_TYPE=wM;Ba.EMPTY_ACTIVITY_MAP=SM;Ba.STATE_DELIMITER=bM;Ba.TARGETLESS_KEY=CM;var Hl={};Object.defineProperty(Hl,"__esModule",{value:!0});var xM=process.env.NODE_ENV==="production";Hl.IS_PRODUCTION=xM;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Xh,n=Wl,r=Lt,i=Ba,o=Hl,a;function s(y){return Object.keys(y)}function u(y,k,F){F===void 0&&(F=i.STATE_DELIMITER);var q=p(y,F),X=p(k,F);return U(X)?U(q)?X===q:!1:U(q)?q in X:Object.keys(q).every(function(Q){return Q in X?u(q[Q],X[Q]):!1})}function c(y){try{return U(y)||typeof y=="number"?"".concat(y):y.type}catch{throw new Error("Events must be strings or objects with a string event.type property.")}}function l(y){try{return U(y)||typeof y=="number"?"".concat(y):B(y)?y.name:y.type}catch{throw new Error("Actions must be strings or objects with a string action.type property.")}}function f(y,k){try{return ie(y)?y:y.toString().split(k)}catch{throw new Error("'".concat(y,"' is not a valid state path."))}}function d(y){return typeof y=="object"&&"value"in y&&"context"in y&&"event"in y&&"_event"in y}function p(y,k){if(d(y))return y.value;if(ie(y))return h(y);if(typeof y!="string")return y;var F=f(y,k);return h(F)}function h(y){if(y.length===1)return y[0];for(var k={},F=k,q=0;q<y.length-1;q++)q===y.length-2?F[y[q]]=y[q+1]:(F[y[q]]={},F=F[y[q]]);return k}function v(y,k){for(var F={},q=Object.keys(y),X=0;X<q.length;X++){var Q=q[X];F[Q]=k(y[Q],Q,y,X)}return F}function E(y,k,F){var q,X,Q={};try{for(var le=t.__values(Object.keys(y)),se=le.next();!se.done;se=le.next()){var ge=se.value,Ae=y[ge];F(Ae)&&(Q[ge]=k(Ae,ge,y))}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}var x=function(y){return function(k){var F,q,X=k;try{for(var Q=t.__values(y),le=Q.next();!le.done;le=Q.next()){var se=le.value;X=X[se]}}catch(ge){F={error:ge}}finally{try{le&&!le.done&&(q=Q.return)&&q.call(Q)}finally{if(F)throw F.error}}return X}};function m(y,k){return function(F){var q,X,Q=F;try{for(var le=t.__values(y),se=le.next();!se.done;se=le.next()){var ge=se.value;Q=Q[k][ge]}}catch(Ae){q={error:Ae}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}}function S(y){if(!y)return[[]];if(U(y))return[[y]];var k=b(Object.keys(y).map(function(F){var q=y[F];return typeof q!="string"&&(!q||!Object.keys(q).length)?[[F]]:S(y[F]).map(function(X){return[F].concat(X)})}));return k}function C(y){var k,F,q={};if(y&&y.length===1&&y[0].length===1)return y[0][0];try{for(var X=t.__values(y),Q=X.next();!Q.done;Q=X.next())for(var le=Q.value,se=q,ge=0;ge<le.length;ge++){var Ae=le[ge];if(ge===le.length-2){se[Ae]=le[ge+1];break}se[Ae]=se[Ae]||{},se=se[Ae]}}catch(jt){k={error:jt}}finally{try{Q&&!Q.done&&(F=X.return)&&F.call(X)}finally{if(k)throw k.error}}return q}function b(y){var k;return(k=[]).concat.apply(k,t.__spreadArray([],t.__read(y),!1))}function T(y){return ie(y)?y:[y]}function A(y){return y===void 0?[]:T(y)}function D(y,k,F){var q,X;if(B(y))return y(k,F.data);var Q={};try{for(var le=t.__values(Object.keys(y)),se=le.next();!se.done;se=le.next()){var ge=se.value,Ae=y[ge];B(Ae)?Q[ge]=Ae(k,F.data):Q[ge]=Ae}}catch(jt){q={error:jt}}finally{try{se&&!se.done&&(X=le.return)&&X.call(le)}finally{if(q)throw q.error}}return Q}function I(y){return/^(done|error)\./.test(y)}function N(y){return!!(y instanceof Promise||y!==null&&(B(y)||typeof y=="object")&&B(y.then))}function _(y){return y!==null&&typeof y=="object"&&"transition"in y&&typeof y.transition=="function"}function L(y,k){var F,q,X=t.__read([[],[]],2),Q=X[0],le=X[1];try{for(var se=t.__values(y),ge=se.next();!ge.done;ge=se.next()){var Ae=ge.value;k(Ae)?Q.push(Ae):le.push(Ae)}}catch(jt){F={error:jt}}finally{try{ge&&!ge.done&&(q=se.return)&&q.call(se)}finally{if(F)throw F.error}}return[Q,le]}function V(y,k){return v(y.states,function(F,q){if(F){var X=(U(k)?void 0:k[q])||(F?F.current:void 0);if(X)return{current:X,states:V(F,X)}}})}function H(y,k){return{current:k,states:V(y,k)}}function R(y,k,F,q){o.IS_PRODUCTION||e.warn(!!y,"Attempting to update undefined context");var X=y&&F.reduce(function(Q,le){var se,ge,Ae=le.assignment,jt={state:q,action:le,_event:k},Gi={};if(B(Ae))Gi=Ae(Q,k.data,jt);else try{for(var kr=t.__values(Object.keys(Ae)),cr=kr.next();!cr.done;cr=kr.next()){var Ha=cr.value,zi=Ae[Ha];Gi[Ha]=B(zi)?zi(Q,k.data,jt):zi}}catch(vf){se={error:vf}}finally{try{cr&&!cr.done&&(ge=kr.return)&&ge.call(kr)}finally{if(se)throw se.error}}return Object.assign({},Q,Gi)},y);return X}e.warn=function(){},o.IS_PRODUCTION||(e.warn=function(y,k){var F=y instanceof Error?y:void 0;if(!(!F&&y)&&console!==void 0){var q=["Warning: ".concat(k)];F&&q.push(F),console.warn.apply(console,q)}});function ie(y){return Array.isArray(y)}function B(y){return typeof y=="function"}function U(y){return typeof y=="string"}function fe(y,k){if(y)return U(y)?{type:i.DEFAULT_GUARD_TYPE,name:y,predicate:k?k[y]:void 0}:B(y)?{type:i.DEFAULT_GUARD_TYPE,name:y.name,predicate:y}:y}function M(y){try{return"subscribe"in y&&B(y.subscribe)}catch{return!1}}var P=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),te=(a={},a[P]=function(){return this},a[Symbol.observable]=function(){return this},a);function oe(y){return!!y&&"__xstatenode"in y}function K(y){return!!y&&typeof y.send=="function"}var ae=function(){var y=0;return function(){return y++,y.toString(16)}}();function de(y,k){return U(y)||typeof y=="number"?t.__assign({type:y},k):y}function he(y,k){if(!U(y)&&"$$type"in y&&y.$$type==="scxml")return y;var F=de(y);return t.__assign({name:F.type,data:F,$$type:"scxml",type:"external"},k)}function xe(y,k){var F=T(k).map(function(q){return typeof q>"u"||typeof q=="string"||oe(q)?{target:q,event:y}:t.__assign(t.__assign({},q),{event:y})});return F}function Re(y){if(!(y===void 0||y===i.TARGETLESS_KEY))return A(y)}function De(y,k,F){if(!o.IS_PRODUCTION){var q=y.stack?" Stacktrace was '".concat(y.stack,"'"):"";if(y===k)console.error("Missing onError handler for invocation '".concat(F,"', error was '").concat(y,"'.").concat(q));else{var X=k.stack?" Stacktrace was '".concat(k.stack,"'"):"";console.error("Missing onError handler and/or unhandled exception/promise rejection for invocation '".concat(F,"'. ")+"Original error: '".concat(y,"'. ").concat(q," Current error is '").concat(k,"'.").concat(X))}}}function ht(y,k,F,q,X){var Q=y.options.guards,le={state:X,cond:k,_event:q};if(k.type===i.DEFAULT_GUARD_TYPE)return((Q==null?void 0:Q[k.name])||k.predicate)(F,q.data,le);var se=Q==null?void 0:Q[k.type];if(!se)throw new Error("Guard '".concat(k.type,"' is not implemented on machine '").concat(y.id,"'."));return se(F,q.data,le)}function ce(y){return typeof y=="string"?{type:y}:y}function Dn(y,k,F){var q=function(){},X=typeof y=="object",Q=X?y:null;return{next:((X?y.next:y)||q).bind(Q),error:((X?y.error:k)||q).bind(Q),complete:((X?y.complete:F)||q).bind(Q)}}function ni(y,k){return"".concat(y,":invocation[").concat(k,"]")}function jo(y){return(y.type===r.raise||y.type===r.send&&y.to===n.SpecialTargets.Internal)&&typeof y.delay!="number"}e.createInvokeId=ni,e.evaluateGuard=ht,e.flatten=b,e.getActionType=l,e.getEventType=c,e.interopSymbols=te,e.isActor=K,e.isArray=ie,e.isBehavior=_,e.isBuiltInEvent=I,e.isFunction=B,e.isMachine=oe,e.isObservable=M,e.isPromiseLike=N,e.isRaisableAction=jo,e.isStateLike=d,e.isString=U,e.keys=s,e.mapContext=D,e.mapFilterValues=E,e.mapValues=v,e.matchesState=u,e.nestedPath=m,e.normalizeTarget=Re,e.partition=L,e.path=x,e.pathToStateValue=h,e.pathsToStateValue=C,e.reportUnhandledExceptionOnInvocation=De,e.symbolObservable=P,e.toArray=A,e.toArrayStrict=T,e.toEventObject=de,e.toGuard=fe,e.toInvokeSource=ce,e.toObserver=Dn,e.toSCXMLEvent=he,e.toStatePath=f,e.toStatePaths=S,e.toStateValue=p,e.toTransitionConfigArray=xe,e.uniqueId=ae,e.updateContext=R,e.updateHistoryStates=V,e.updateHistoryValue=H})(hw);Object.defineProperty(tt,"__esModule",{value:!0});var Ke=Xh,ur=Wl,rn=Lt,Fe=hw,vw=Hl,EM=Fe.toSCXMLEvent({type:rn.init});function tp(e,t){return t&&t[e]||void 0}function Kl(e,t){var n;if(Fe.isString(e)||typeof e=="number"){var r=tp(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=tp(e.type,t);if(Fe.isFunction(r))n=Ke.__assign(Ke.__assign({},e),{exec:r});else if(r){var i=r.type||e.type;n=Ke.__assign(Ke.__assign(Ke.__assign({},r),e),{type:i})}else n=e}return n}var np=function(e,t){if(!e)return[];var n=Fe.isArray(e)?e:[e];return n.map(function(r){return Kl(r,t)})};function Jh(e){var t=Kl(e);return Ke.__assign(Ke.__assign({id:Fe.isString(e)?e:t.id},t),{type:t.type})}function TM(e,t){return{type:rn.raise,event:typeof e=="function"?e:Fe.toEventObject(e),delay:t?t.delay:void 0,id:t==null?void 0:t.id}}function mw(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 Ke.__assign(Ke.__assign({},e),{type:rn.raise,_event:o,delay:a})}function du(e,t){return{to:t?t.to:void 0,type:rn.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 yw(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 Ke.__assign(Ke.__assign({},e),{to:u,_event:o,event:o.data,delay:a})}function Qh(e,t){return du(e,Ke.__assign(Ke.__assign({},t),{to:ur.SpecialTargets.Parent}))}function IM(e,t,n){return du(t,Ke.__assign(Ke.__assign({},n),{to:e}))}function AM(){return Qh(rn.update)}function $M(e,t){return du(e,Ke.__assign(Ke.__assign({},t),{to:function(n,r,i){var o=i._event;return o.origin}}))}var OM=function(e,t){return{context:e,event:t}};function DM(e,t){return e===void 0&&(e=OM),{type:rn.log,label:t,expr:e}}var gw=function(e,t,n){return Ke.__assign(Ke.__assign({},e),{value:Fe.isString(e.expr)?e.expr:e.expr(t,n.data,{_event:n})})},NM=function(e){return{type:rn.cancel,sendId:e}};function PM(e){var t=Jh(e);return{type:ur.ActionTypes.Start,activity:t,exec:void 0}}function RM(e){var t=Fe.isFunction(e)?e:Jh(e);return{type:ur.ActionTypes.Stop,activity:t,exec:void 0}}function bw(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:ur.ActionTypes.Stop,activity:i};return o}var kM=function(e){return{type:rn.assign,assignment:e}};function MM(e){return typeof e=="object"&&"type"in e}function jM(e,t){var n=t?"#".concat(t):"";return"".concat(ur.ActionTypes.After,"(").concat(e,")").concat(n)}function _M(e,t){var n="".concat(ur.ActionTypes.DoneState,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function qM(e,t){var n="".concat(ur.ActionTypes.DoneInvoke,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function FM(e,t){var n="".concat(ur.ActionTypes.ErrorPlatform,".").concat(e),r={type:n,data:t};return r.toString=function(){return n},r}function LM(e){return{type:ur.ActionTypes.Pure,get:e}}function BM(e,t){if(!vw.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,Ke.__spreadArray([],Ke.__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 du(function(r,i){return i},Ke.__assign(Ke.__assign({},t),{to:e}))}function VM(e,t){return Qh(function(n,r,i){return{type:rn.error,data:Fe.isFunction(e)?e(n,r,i):e}},Ke.__assign(Ke.__assign({},t),{to:ur.SpecialTargets.Parent}))}function UM(e){return{type:ur.ActionTypes.Choose,conds:e}}var GM=function(e){var t,n,r=[];try{for(var i=Ke.__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===rn.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 rp(e,t,n,r,i,o,a){a===void 0&&(a=!1);var s=a?[]:GM(i),u=s.length?Fe.updateContext(n,r,s,t):n,c=a?[n]:void 0,l=[];function f(h,v){var E;switch(v.type){case rn.raise:{var x=mw(v,u,r,e.options.delays);return o&&typeof x.delay=="number"&&o(x,u,r),x}case rn.send:var m=yw(v,u,r,e.options.delays);if(!vw.IS_PRODUCTION){var S=v.delay;Fe.warn(!Fe.isString(S)||typeof m.delay=="number","No delay reference for delay expression '".concat(S,"' was found on machine '").concat(e.id,"'"))}return o&&m.to!==ur.SpecialTargets.Internal&&(h==="entry"?l.push(m):o(m,u,r)),m;case rn.log:{var C=gw(v,u,r);return o==null||o(C,u,r),C}case rn.choose:{var b=v,T=(E=b.conds.find(function(B){var U=Fe.toGuard(B.cond,e.options.guards);return!U||Fe.evaluateGuard(e,U,u,r,o?void 0:t)}))===null||E===void 0?void 0:E.actions;if(!T)return[];var A=Ke.__read(rp(e,t,u,r,[{type:h,actions:np(Fe.toArray(T),e.options.actions)}],o,a),2),D=A[0],I=A[1];return u=I,c==null||c.push(u),D}case rn.pure:{var T=v.get(u,r.data);if(!T)return[];var N=Ke.__read(rp(e,t,u,r,[{type:h,actions:np(Fe.toArray(T),e.options.actions)}],o,a),2),_=N[0],L=N[1];return u=L,c==null||c.push(u),_}case rn.stop:{var C=bw(v,u,r);return o==null||o(C,n,r),C}case rn.assign:{u=Fe.updateContext(u,r,[v],o?void 0:t),c==null||c.push(u);break}default:var V=Kl(v,e.options.actions),H=V.exec;if(o)o(V,u,r);else if(H&&c){var R=c.length-1,ie=Ke.__assign(Ke.__assign({},V),{exec:function(B){for(var U=[],fe=1;fe<arguments.length;fe++)U[fe-1]=arguments[fe];H.apply(void 0,Ke.__spreadArray([c[R]],Ke.__read(U),!1))}});V=ie}return V}}function d(h){var v,E,x=[];try{for(var m=Ke.__values(h.actions),S=m.next();!S.done;S=m.next()){var C=S.value,b=f(h.type,C);b&&(x=x.concat(b))}}catch(T){v={error:T}}finally{try{S&&!S.done&&(E=m.return)&&E.call(m)}finally{if(v)throw v.error}}return l.forEach(function(T){o(T,u,r)}),l.length=0,x}var p=Fe.flatten(i.map(d));return[p,u]}tt.actionTypes=rn;tt.after=jM;tt.assign=kM;tt.cancel=NM;tt.choose=UM;tt.done=_M;tt.doneInvoke=qM;tt.error=FM;tt.escalate=VM;tt.forwardTo=BM;tt.getActionFunction=tp;tt.initEvent=EM;tt.isActionObject=MM;var Ln=tt.log=DM,zM=tt.pure=LM;tt.raise=TM;tt.resolveActions=rp;tt.resolveLog=gw;tt.resolveRaise=mw;tt.resolveSend=yw;tt.resolveStop=bw;tt.respond=$M;tt.send=du;tt.sendParent=Qh;tt.sendTo=IM;tt.sendUpdate=AM;tt.start=PM;var Km=tt.stop=RM;tt.toActionObject=Kl;tt.toActionObjects=np;tt.toActivityDefinition=Jh;function Sw(e){return function(n,r,i,o,a,s,u){return e(n,r,u)}}function Yl(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 ww(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 Xm(e){return typeof e.then=="function"}function Xl(e,t){return e===t||e!==e&&t!==t}var WM="[object Arguments]",HM="[object Boolean]",KM="[object Date]",YM="[object RegExp]",XM="[object Map]",JM="[object Number]",QM="[object Object]",ZM="[object Set]",ej="[object String]",Jm=Object.prototype.toString;function Jl(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(c);function c(l,f,d){if(l===f)return!0;if(!l||!f||typeof l!="object"||typeof f!="object")return l!==l&&f!==f;if(Ym(l)&&Ym(f))return i(l,f,u,d);var p=Array.isArray(l),h=Array.isArray(f);if(p||h)return p===h&&t(l,f,u,d);var v=Jm.call(l);return v!==Jm.call(f)?!1:v===KM?n(l,f,u,d):v===YM?o(l,f,u,d):v===XM?r(l,f,u,d):v===ZM?a(l,f,u,d):v===QM||v===WM?Xm(l)||Xm(f)?!1:i(l,f,u,d):v===HM||v===JM||v===ej?Xl(l.valueOf(),f.valueOf()):!1}return c}function Cw(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 tj=Yl(Cw);function xw(e,t){return Xl(e.valueOf(),t.valueOf())}function Ew(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 c=!1,l=0;t.forEach(function(f,d){!c&&!o[l]&&(c=n(u,d,a,l,e,t,r)&&n(s,f,u,d,e,t,r))&&(o[l]=!0),l++}),a++,i=c}}),i}var nj=Yl(Ew),rj="_owner",ij=Object.prototype.hasOwnProperty;function Tw(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===rj){var s=!!e.$$typeof,u=!!t.$$typeof;if((s||u)&&s!==u)return!1}if(!ij.call(t,a)||!n(e[a],t[a],a,a,e,t,r))return!1}return!0}var oj=Yl(Tw);function Iw(e,t){return e.source===t.source&&e.flags===t.flags}function Aw(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,c=0;t.forEach(function(l,f){!u&&!o[c]&&(u=n(a,l,s,f,e,t,r))&&(o[c]=!0),c++}),i=u}}),i}var aj=Yl(Aw),$w=Object.freeze({areArraysEqual:Cw,areDatesEqual:xw,areMapsEqual:Ew,areObjectsEqual:Tw,areRegExpsEqual:Iw,areSetsEqual:Aw,createIsNestedEqual:Sw}),Ow=Object.freeze({areArraysEqual:tj,areDatesEqual:xw,areMapsEqual:nj,areObjectsEqual:oj,areRegExpsEqual:Iw,areSetsEqual:aj,createIsNestedEqual:Sw}),sj=Jl($w);function uj(e,t){return sj(e,t,void 0)}Jl(ww($w,{createIsNestedEqual:function(){return Xl}}));Jl(Ow);Jl(ww(Ow,{createIsNestedEqual:function(){return Xl}}));var ip={exports:{}},Cf={},qu={exports:{}},xf={};/**
|
|
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!==Dt.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 Qm;function
|
|
109
|
+
*/var Qm;function cj(){if(Qm)return xf;Qm=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 p=d(),h=r({inst:{value:p,getSnapshot:d}}),v=h[0].inst,E=h[1];return o(function(){v.value=p,v.getSnapshot=d,u(v)&&E({inst:v})},[f,p,d]),i(function(){return u(v)&&E({inst:v}),f(function(){u(v)&&E({inst:v})})},[f]),a(p),p}function u(f){var d=f.getSnapshot;f=f.value;try{var p=d();return!n(f,p)}catch{return!0}}function c(f,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:s;return xf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,xf}var Ef={};/**
|
|
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!==Dt.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 Zm;function
|
|
117
|
+
*/var Zm;function lj(){return Zm||(Zm=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(S){{for(var C=arguments.length,b=new Array(C>1?C-1:0),T=1;T<C;T++)b[T-1]=arguments[T];r("error",S,b)}}function r(S,C,b){{var T=t.ReactDebugCurrentFrame,A=T.getStackAddendum();A!==""&&(C+="%s",b=b.concat([A]));var D=b.map(function(I){return String(I)});D.unshift("Warning: "+C),Function.prototype.apply.call(console[S],console,D)}}function i(S,C){return S===C&&(S!==0||1/S===1/C)||S!==S&&C!==C}var o=typeof Object.is=="function"?Object.is:i,a=e.useState,s=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue,l=!1,f=!1;function d(S,C,b){l||e.startTransition!==void 0&&(l=!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 T=C();if(!f){var A=C();o(T,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var D=a({inst:{value:T,getSnapshot:C}}),I=D[0].inst,N=D[1];return u(function(){I.value=T,I.getSnapshot=C,p(I)&&N({inst:I})},[S,T,C]),s(function(){p(I)&&N({inst:I});var _=function(){p(I)&&N({inst:I})};return S(_)},[S]),c(T),T}function p(S){var C=S.getSnapshot,b=S.value;try{var T=C();return!o(b,T)}catch{return!0}}function h(S,C,b){return C()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",E=!v,x=E?h:d,m=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x;Ef.useSyncExternalStore=m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ef}var ey;function Dw(){return ey||(ey=1,process.env.NODE_ENV==="production"?qu.exports=cj():qu.exports=lj()),qu.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!==Dt.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 ty;function
|
|
125
|
+
*/var ty;function fj(){if(ty)return Cf;ty=1;var e=O,t=Dw();function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}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 Cf.useSyncExternalStoreWithSelector=function(c,l,f,d,p){var h=o(null);if(h.current===null){var v={hasValue:!1,value:null};h.current=v}else v=h.current;h=s(function(){function x(T){if(!m){if(m=!0,S=T,T=d(T),p!==void 0&&v.hasValue){var A=v.value;if(p(A,T))return C=A}return C=T}if(A=C,r(S,T))return A;var D=d(T);return p!==void 0&&p(A,D)?A:(S=T,C=D)}var m=!1,S,C,b=f===void 0?null:f;return[function(){return x(l())},b===null?void 0:function(){return x(b())}]},[l,f,d,p]);var E=i(c,h[0],h[1]);return a(function(){v.hasValue=!0,v.value=E},[E]),u(E),E},Cf}var Tf={};/**
|
|
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!==Dt.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 ny;function hj(){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=D0();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&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 c(l,f,d,p,h){var v=o(null),E;v.current===null?(E={hasValue:!1,value:null},v.current=E):E=v.current;var x=s(function(){var b=!1,T,A,D=function(L){if(!b){b=!0,T=L;var V=p(L);if(h!==void 0&&E.hasValue){var H=E.value;if(h(H,V))return A=H,H}return A=V,V}var R=T,ie=A;if(r(R,L))return ie;var B=p(L);return h!==void 0&&h(ie,B)?ie:(T=L,A=B,B)},I=d===void 0?null:d,N=function(){return D(f())},_=I===null?void 0:function(){return D(I())};return[N,_]},[f,d,p,h]),m=x[0],C=x[1],w=i(l,m,C);return a(function(){E.hasValue=!0,E.value=w},[w]),u(w),w}Tf.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Tf}process.env.NODE_ENV==="production"?ip.exports=pj():ip.exports=hj();var vj=ip.exports,mj=O.useLayoutEffect;function ry(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var zc=globalThis&&globalThis.__assign||function(){return zc=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},zc.apply(this,arguments)},yj=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},gj=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 bj(e,t){var n=ry(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=gj(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,c=t.services,l=t.delays;t.state;var f=yj(t,["context","guards","actions","activities","services","delays","state"]),d=ry(function(){var p={context:o,guards:a,actions:s,activities:u,services:c,delays:l},h=n.withConfig(p,function(){return zc(zc({},n.context),o)});return d0(h,f)});return mj(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,c),Object.assign(d.machine.options.delays,l)},[s,a,u,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function Sj(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 Cj=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 wj(e){return e}function xj(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Cj(t,1),i=r[0],o=i===void 0?{}:i,a=bj(e,o),s=O.useCallback(function(){return a.status===Dt.NotStarted?o.state?tr.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return Sj(a,f,d)},[a]),c=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=vj.useSyncExternalStoreWithSelector(c,s,s,wj,u);return O.useEffect(function(){var f=o.state;return a.start(f?tr.create(f):void 0),function(){a.stop(),a.status=Dt.NotStarted}},[]),[l,a.send,a]}const N0=O.createContext(null),P0=O.createContext(null),Ej=O.createContext(null),R0=O.createContext(null),Zh=()=>O.useContext(N0),Ua=()=>O.useContext(R0),k0="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 ev(e){if(!e)throw new Error(k0)}function Ga(e){if(!e)throw new Error(k0)}function Li(){const e=Zh();return ev(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var Tj=function(e){return e._tag==="Some"},Ql=function(e){return function(t){return Tj(e(t))}};const Ij=Ql(e=>e.type===W.Choice?je(e):ye),Aj=Ql(e=>e.type===W.Numeric?je(e):ye),$j=Ql(e=>e.type===W.Boolean?je(e):ye),Oj=Ql(e=>e.type===W.Component?je(e):ye);function Zl(e){return e.decision!=null&&e.decision.kind===$e.Explicit}function M0(e){return g(e.values,Wt(Zl),G(t=>({type:W.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function Dj(e){return g(e,cu(Zl),Z(()=>({type:W.Numeric,attributeId:e.id,state:null})))}function Nj(e){return g(e,cu(Zl),Z(()=>({type:W.Boolean,attributeId:e.id,state:null})))}function Pj(e){return g(e,cu(Zl),Z(()=>({type:W.Component,attributeId:e.id,state:null})))}function Rj(e,t){return g(La.filterAttributesOfComponent(t,e,!0),n=>[g(n,Wt(Ij),U2(M0)),g(n,Wt(Aj),G(Dj),Kn),g(n,Wt($j),G(Nj),Kn),g(n,Wt(Oj),G(Pj),Kn)],Dh)}function j0(){const e=Zh();return ev(e),O.useMemo(()=>({explain:(t,n)=>Y(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 pu(e,t=!1){const n=Ua();return Ga(n),O.useMemo(()=>g(be(e),Z(Xn(G(r=>La.getAttribute(n,r)),t?Ro(be):Nr)),st(()=>n.attributes)),[e,n,t])}function tv(e){const t=Ua(),{makeDecision:n,setManyDecision:r}=Li(),i=ef(e,Qe.choiceValue);Ga(t);const o=La.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,c)=>n({type:W.Choice,attributeId:e,choiceValueId:u,state:c}),clearDecisions:g(o,be,Z(M0),Vt(Po),Z(u=>()=>r(u,{type:"Default"})),st(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function kj(e){const t=Ua(),{makeDecision:n}=Li(),r=ef(e,Qe.numeric);Ga(t);const i=La.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:W.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function Mj(e){const t=Ua(),{makeDecision:n}=Li(),r=ef(e,Qe.boolean);Ga(t);const i=La.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:W.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function jj(e){const t=Ua(),{makeDecision:n,setManyDecision:r}=Li(),i=ef(e,Qe.component);Ga(t);const o=t.attributes,a=La.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:c=>n({type:W.Component,attributeId:e,state:c}),clearSubtree:g(Rj(e,o),cu(Po),Z(c=>()=>r(c,{type:"Default"})),st(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function ef(e,t){const{explain:n,applySolution:r}=j0();return O.useMemo(()=>({explain:(i,o)=>{const a=Y(i.question).with(_t.whyIsNotSatisfied,()=>Qe.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return Y(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=Tn(nk),_j=Tn(rk),qj=Tn((e,t)=>gC(ft).equals(e??{},t??{})),Fj=gn({attributeId:iy,decisions:qi(iy)}),Lj=Tn((e,t)=>qi(Fj).equals(e??[],t??[])),Bj=gn({type:ft}),Vj=gn({type:ft}),Uj=gn({type:ft,rules:qi(_j)}),Gj=Tn((e,t)=>Y({x:e,y:t}).returnType().with({x:{type:pn.all},y:{type:pn.all}},({x:n,y:r})=>Bj.equals(n,r)).with({x:{type:pn.none},y:{type:pn.none}},({x:n,y:r})=>Vj.equals(n,r)).with({x:{type:pn.specific},y:{type:pn.specific}},({x:n,y:r})=>Uj.equals(n,r)).otherwise(()=>!1)),zj=gn({rules:Vl(Gj)}),_0=gn({configurationModelSource:Tn((e,t)=>lj(e,t)),attributeRelations:Lj,usageRuleParameters:qj,allowedInExplain:Vl(zj)}),op=Vl(_0),Wj=$h,vc=Vl(Wj),Hj=()=>Yh({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:[Ln("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Ln("Entering ProcessChanges","SessionManagement:"),Ho(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Ln("Entering DisposeSession","SessionManagement:"),Ho(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Ln("Entering CreateSession","SessionManagement:"),Ho(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Ln("Entering SessionCreationFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Ln("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Ln("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Ln("Entering UpdateSession","SessionManagement:"),Ho(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Ln("Entering SessionUpdateFailed","SessionManagement:"),Ho(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Ln("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Ln("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Pn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Pn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Pn((e,t)=>(e.session&&e.session.close().then(Lr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Pn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Pn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Pn({sessionCreationError:()=>null}),setSessionUpdateError:Pn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Pn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Pn({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||!vc.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=>!vc.equals(e.desiredClient,e.sessionCreationError.client)||!op.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!vc.equals(e.desiredClient,e.actualClient)||!op.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Ho(e){const t=e===0,n=e===1;return HM((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 p0({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const Kj=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),Yj=()=>Yh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[p0((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Ln("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Ln("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)=>Kj(e.session)}}}},{actions:{saveSession:Pn((e,t)=>({session:t.session}))}}),Xj=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},oy=()=>{const e=Xj();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var Jj=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,Jj(t,n,r))};const Qj=()=>Yh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:oy()},entry:[Pn({sessionManagementActor:()=>Wm(Hj()),configurationSubscriptionManagementActor:()=>Wm(Yj())})],exit:[Km(e=>e.sessionManagementActor),Km(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[_u(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[_u(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[_u(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[_u(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Pn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),nM(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Pn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Pn((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 Zj(e){var t,n;const[r,i]=xj(Qj,{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(vc)),ay(()=>{const u=g(be(e.sessionContext),iN(c=>be(c.configurationModelSource)),Vn);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(op));const o=O.useMemo(()=>{var u,c,l,f;return{isInitializing:((c=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=r.context.isReadyPromise)==null?void 0:l.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,c;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((c=r.context.sessionUpdating)==null?void 0:c.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 e_(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=Zj({configuratorClient:t,sessionContext:n});return $.jsx(P0.Provider,{value:r,children:$.jsx(Ej.Provider,{value:i,children:$.jsx(N0.Provider,{value:o,children:$.jsx(R0.Provider,{value:a,children:e.children})})})})}function nv(){return O.useContext(P0)}function t_(e){const{children:t}=e,{isInitializingPromise:n}=nv();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function q0(){const e=Zh(),t=Ua();return ev(e),Ga(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const n_=O.createContext(null),If={didCatch:!1,error:null};class r_ extends O.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=If}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(If)}}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&&i_(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(If)}}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(n_.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function i_(){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 En=function(){return En=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},En.apply(this,arguments)};function o_(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 Co(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 a_(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var s_=/^((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)-.*))$/,u_=a_(function(e){return s_.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),gt="-ms-",Es="-moz-",it="-webkit-",F0="comm",tf="rule",rv="decl",c_="@import",L0="@keyframes",l_="@layer",f_=Math.abs,iv=String.fromCharCode,ap=Object.assign;function d_(e,t){return tn(e,0)^45?(((t<<2^tn(e,0))<<2^tn(e,1))<<2^tn(e,2))<<2^tn(e,3):0}function B0(e){return e.trim()}function _r(e,t){return(e=t.exec(e))?e[0]:e}function ke(e,t,n){return e.replace(t,n)}function mc(e,t){return e.indexOf(t)}function tn(e,t){return e.charCodeAt(t)|0}function ba(e,t,n){return e.slice(t,n)}function Tr(e){return e.length}function V0(e){return e.length}function ms(e,t){return t.push(e),e}function p_(e,t){return e.map(t).join("")}function sy(e,t){return e.filter(function(n){return!_r(n,t)})}var nf=1,Sa=1,U0=0,ar=0,Gt=0,za="";function rf(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:nf,column:Sa,length:a,return:"",siblings:s}}function di(e,t){return ap(rf("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Ko(e){for(;e.root;)e=di(e.root,{children:[e]});ms(e,e.siblings)}function h_(){return Gt}function v_(){return Gt=ar>0?tn(za,--ar):0,Sa--,Gt===10&&(Sa=1,nf--),Gt}function br(){return Gt=ar<U0?tn(za,ar++):0,Sa++,Gt===10&&(Sa=1,nf++),Gt}function lo(){return tn(za,ar)}function yc(){return ar}function of(e,t){return ba(za,e,t)}function sp(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 m_(e){return nf=Sa=1,U0=Tr(za=e),ar=0,[]}function y_(e){return za="",e}function Af(e){return B0(of(ar-1,up(e===91?e+2:e===40?e+1:e)))}function g_(e){for(;(Gt=lo())&&Gt<33;)br();return sp(e)>2||sp(Gt)>3?"":" "}function b_(e,t){for(;--t&&br()&&!(Gt<48||Gt>102||Gt>57&&Gt<65||Gt>70&&Gt<97););return of(e,yc()+(t<6&&lo()==32&&br()==32))}function up(e){for(;br();)switch(Gt){case e:return ar;case 34:case 39:e!==34&&e!==39&&up(Gt);break;case 40:e===41&&up(e);break;case 92:br();break}return ar}function S_(e,t){for(;br()&&e+Gt!==47+10;)if(e+Gt===42+42&&lo()===47)break;return"/*"+of(t,ar-1)+"*"+iv(e===47?e:br())}function C_(e){for(;!sp(lo());)br();return of(e,ar)}function w_(e){return y_(gc("",null,null,null,[""],e=m_(e),0,[0],e))}function gc(e,t,n,r,i,o,a,s,u){for(var c=0,l=0,f=a,d=0,p=0,h=0,v=1,E=1,x=1,m=0,C="",w=i,b=o,T=r,A=C;E;)switch(h=m,m=br()){case 40:if(h!=108&&tn(A,f-1)==58){mc(A+=ke(Af(m),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:A+=Af(m);break;case 9:case 10:case 13:case 32:A+=g_(h);break;case 92:A+=b_(yc()-1,7);continue;case 47:switch(lo()){case 42:case 47:ms(x_(S_(br(),yc()),t,n,u),u);break;default:A+="/"}break;case 123*v:s[c++]=Tr(A)*x;case 125*v:case 59:case 0:switch(m){case 0:case 125:E=0;case 59+l:x==-1&&(A=ke(A,/\f/g,"")),p>0&&Tr(A)-f&&ms(p>32?cy(A+";",r,n,f-1,u):cy(ke(A," ","")+";",r,n,f-2,u),u);break;case 59:A+=";";default:if(ms(T=uy(A,t,n,c,l,i,s,C,w=[],b=[],f,o),o),m===123)if(l===0)gc(A,t,T,T,w,o,f,s,b);else switch(d===99&&tn(A,3)===110?100:d){case 100:case 108:case 109:case 115:gc(e,T,T,r&&ms(uy(e,T,T,0,0,i,s,C,i,w=[],f,b),b),i,b,f,s,r?w:b);break;default:gc(A,T,T,T,[""],b,0,s,b)}}c=l=p=0,v=x=1,C=A="",f=a;break;case 58:f=1+Tr(A),p=h;default:if(v<1){if(m==123)--v;else if(m==125&&v++==0&&v_()==125)continue}switch(A+=iv(m),m*v){case 38:x=l>0?1:(A+="\f",-1);break;case 44:s[c++]=(Tr(A)-1)*x,x=1;break;case 64:lo()===45&&(A+=Af(br())),d=lo(),l=f=Tr(C=A+=C_(yc())),m++;break;case 45:h===45&&Tr(A)==2&&(v=0)}}return o}function uy(e,t,n,r,i,o,a,s,u,c,l,f){for(var d=i-1,p=i===0?o:[""],h=V0(p),v=0,E=0,x=0;v<r;++v)for(var m=0,C=ba(e,d+1,d=f_(E=a[v])),w=e;m<h;++m)(w=B0(E>0?p[m]+" "+C:ke(C,/&\f/g,p[m])))&&(u[x++]=w);return rf(e,t,n,i===0?tf:s,u,c,l,f)}function x_(e,t,n,r){return rf(e,t,n,F0,iv(h_()),ba(e,2,-2),0,r)}function cy(e,t,n,r,i){return rf(e,t,n,rv,ba(e,0,r),ba(e,r+1,-1),r,i)}function G0(e,t,n){switch(d_(e,t)){case 5103:return it+"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 it+e+e;case 4789:return Es+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return it+e+Es+e+gt+e+e;case 5936:switch(tn(e,t+11)){case 114:return it+e+gt+ke(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return it+e+gt+ke(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return it+e+gt+ke(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return it+e+gt+e+e;case 6165:return it+e+gt+"flex-"+e+e;case 5187:return it+e+ke(e,/(\w+).+(:[^]+)/,it+"box-$1$2"+gt+"flex-$1$2")+e;case 5443:return it+e+gt+"flex-item-"+ke(e,/flex-|-self/g,"")+(_r(e,/flex-|baseline/)?"":gt+"grid-row-"+ke(e,/flex-|-self/g,""))+e;case 4675:return it+e+gt+"flex-line-pack"+ke(e,/align-content|flex-|-self/g,"")+e;case 5548:return it+e+gt+ke(e,"shrink","negative")+e;case 5292:return it+e+gt+ke(e,"basis","preferred-size")+e;case 6060:return it+"box-"+ke(e,"-grow","")+it+e+gt+ke(e,"grow","positive")+e;case 4554:return it+ke(e,/([^-])(transform)/g,"$1"+it+"$2")+e;case 6187:return ke(ke(ke(e,/(zoom-|grab)/,it+"$1"),/(image-set)/,it+"$1"),e,"")+e;case 5495:case 3959:return ke(e,/(image-set\([^]*)/,it+"$1$`$1");case 4968:return ke(ke(e,/(.+:)(flex-)?(.*)/,it+"box-pack:$3"+gt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+it+e+e;case 4200:if(!_r(e,/flex-|baseline/))return gt+"grid-column-align"+ba(e,t)+e;break;case 2592:case 3360:return gt+ke(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,_r(r.props,/grid-\w+-end/)})?~mc(e+(n=n[t].value),"span")?e:gt+ke(e,"-start","")+e+gt+"grid-row-span:"+(~mc(n,"span")?_r(n,/\d+/):+_r(n,/\d+/)-+_r(e,/\d+/))+";":gt+ke(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return _r(r.props,/grid-\w+-start/)})?e:gt+ke(ke(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return ke(e,/(.+)-inline(.+)/,it+"$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(Tr(e)-1-t>6)switch(tn(e,t+1)){case 109:if(tn(e,t+4)!==45)break;case 102:return ke(e,/(.+:)(.+)-([^]+)/,"$1"+it+"$2-$3$1"+Es+(tn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~mc(e,"stretch")?G0(ke(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return ke(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,c){return gt+i+":"+o+c+(a?gt+i+"-span:"+(s?u:+u-+o)+c:"")+e});case 4949:if(tn(e,t+6)===121)return ke(e,":",":"+it)+e;break;case 6444:switch(tn(e,tn(e,14)===45?18:11)){case 120:return ke(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+it+(tn(e,14)===45?"inline-":"")+"box$3$1"+it+"$2$3$1"+gt+"$2box$3")+e;case 100:return ke(e,":",":"+gt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return ke(e,"scroll-","scroll-snap-")+e}return e}function Wc(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function E_(e,t,n,r){switch(e.type){case l_:if(e.children.length)break;case c_:case rv:return e.return=e.return||e.value;case F0:return"";case L0:return e.return=e.value+"{"+Wc(e.children,r)+"}";case tf:if(!Tr(e.value=e.props.join(",")))return""}return Tr(n=Wc(e.children,r))?e.return=e.value+"{"+n+"}":""}function T_(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 I_(e){return function(t){t.root||(t=t.return)&&e(t)}}function A_(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case rv:e.return=G0(e.value,e.length,n);return;case L0:return Wc([di(e,{value:ke(e.value,"@","@"+it)})],r);case tf:if(e.length)return p_(n=e.props,function(i){switch(_r(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Ko(di(e,{props:[ke(i,/:(read-\w+)/,":"+Es+"$1")]})),Ko(di(e,{props:[i]})),ap(e,{props:sy(n,r)});break;case"::placeholder":Ko(di(e,{props:[ke(i,/:(plac\w+)/,":"+it+"input-$1")]})),Ko(di(e,{props:[ke(i,/:(plac\w+)/,":"+Es+"$1")]})),Ko(di(e,{props:[ke(i,/:(plac\w+)/,gt+"input-$1")]})),Ko(di(e,{props:[i]})),ap(e,{props:sy(n,r)});break}return""})}}var $_={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},wo=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ov=typeof window<"u"&&"HTMLElement"in window,O_=!!(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"),D_={},ly=/invalid hook call/i,Fu=new Set,z0=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 ny;function dj(){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=Dw();function n(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&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 c(l,f,d,p,h){var v=o(null),E;v.current===null?(E={hasValue:!1,value:null},v.current=E):E=v.current;var x=s(function(){var b=!1,T,A,D=function(L){if(!b){b=!0,T=L;var V=p(L);if(h!==void 0&&E.hasValue){var H=E.value;if(h(H,V))return A=H,H}return A=V,V}var R=T,ie=A;if(r(R,L))return ie;var B=p(L);return h!==void 0&&h(ie,B)?ie:(T=L,A=B,B)},I=d===void 0?null:d,N=function(){return D(f())},_=I===null?void 0:function(){return D(I())};return[N,_]},[f,d,p,h]),m=x[0],S=x[1],C=i(l,m,S);return a(function(){E.hasValue=!0,E.value=C},[C]),u(C),C}Tf.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Tf}process.env.NODE_ENV==="production"?ip.exports=fj():ip.exports=dj();var pj=ip.exports,hj=O.useLayoutEffect;function ry(e){var t=J.useRef();return t.current||(t.current={v:e()}),t.current.v}var zc=globalThis&&globalThis.__assign||function(){return zc=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},zc.apply(this,arguments)},vj=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},mj=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 yj(e,t){var n=ry(function(){return typeof e=="function"?e():e});if(process.env.NODE_ENV!=="production"&&typeof e!="function"){var r=mj(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,c=t.services,l=t.delays;t.state;var f=vj(t,["context","guards","actions","activities","services","delays","state"]),d=ry(function(){var p={context:o,guards:a,actions:s,activities:u,services:c,delays:l},h=n.withConfig(p,function(){return zc(zc({},n.context),o)});return dw(h,f)});return hj(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,c),Object.assign(d.machine.options.delays,l)},[s,a,u,c,l]),d}globalThis&&globalThis.__read;globalThis&&globalThis.__values;function gj(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 bj=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 Sj(e){return e}function wj(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=bj(t,1),i=r[0],o=i===void 0?{}:i,a=yj(e,o),s=O.useCallback(function(){return a.status===Dt.NotStarted?o.state?tr.create(o.state):a.machine.initialState:a.getSnapshot()},[a]),u=O.useCallback(function(f,d){return gj(a,f,d)},[a]),c=O.useCallback(function(f){var d=a.subscribe(f).unsubscribe;return d},[a]),l=pj.useSyncExternalStoreWithSelector(c,s,s,Sj,u);return O.useEffect(function(){var f=o.state;return a.start(f?tr.create(f):void 0),function(){a.stop(),a.status=Dt.NotStarted}},[]),[l,a.send,a]}const Nw=O.createContext(null),Pw=O.createContext(null),Cj=O.createContext(null),Rw=O.createContext(null),Zh=()=>O.useContext(Nw),Va=()=>O.useContext(Rw),kw="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 ev(e){if(!e)throw new Error(kw)}function Ua(e){if(!e)throw new Error(kw)}function Li(){const e=Zh();return ev(e),O.useMemo(()=>({makeDecision:t=>e.makeDecision(t),setManyDecision:(t,n)=>e.setMany(t,n)}),[e])}var xj=function(e){return e._tag==="Some"},Ql=function(e){return function(t){return xj(e(t))}};const Ej=Ql(e=>e.type===W.Choice?je(e):ye),Tj=Ql(e=>e.type===W.Numeric?je(e):ye),Ij=Ql(e=>e.type===W.Boolean?je(e):ye),Aj=Ql(e=>e.type===W.Component?je(e):ye);function Zl(e){return e.decision!=null&&e.decision.kind===$e.Explicit}function Mw(e){return g(e.values,Wt(Zl),G(t=>({type:W.Choice,attributeId:e.id,choiceValueId:t.id,state:null})))}function $j(e){return g(e,cu(Zl),Z(()=>({type:W.Numeric,attributeId:e.id,state:null})))}function Oj(e){return g(e,cu(Zl),Z(()=>({type:W.Boolean,attributeId:e.id,state:null})))}function Dj(e){return g(e,cu(Zl),Z(()=>({type:W.Component,attributeId:e.id,state:null})))}function Nj(e,t){return g(Fa.filterAttributesOfComponent(t,e,!0),n=>[g(n,Wt(Ej),V2(Mw)),g(n,Wt(Tj),G($j),Kn),g(n,Wt(Ij),G(Oj),Kn),g(n,Wt(Aj),G(Dj),Kn)],Dh)}function jw(){const e=Zh();return ev(e),O.useMemo(()=>({explain:(t,n)=>Y(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 pu(e,t=!1){const n=Va();return Ua(n),O.useMemo(()=>g(be(e),Z(Xn(G(r=>Fa.getAttribute(n,r)),t?Po(be):Nr)),st(()=>n.attributes)),[e,n,t])}function tv(e){const t=Va(),{makeDecision:n,setManyDecision:r}=Li(),i=ef(e,Qe.choiceValue);Ua(t);const o=Fa.getChoiceAttribute(t,e),a=O.useMemo(()=>({makeDecision:(u,c)=>n({type:W.Choice,attributeId:e,choiceValueId:u,state:c}),clearDecisions:g(o,be,Z(Mw),Vt(Ma),Z(u=>()=>r(u,{type:"Default"})),st(()=>()=>Promise.resolve())),...i}),[e,o,n,r,i]),s=O.useMemo(()=>({...a,attribute:o}),[o,a]);if(o)return s}function Pj(e){const t=Va(),{makeDecision:n}=Li(),r=ef(e,Qe.numeric);Ua(t);const i=Fa.getNumericAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:W.Numeric,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function Rj(e){const t=Va(),{makeDecision:n}=Li(),r=ef(e,Qe.boolean);Ua(t);const i=Fa.getBooleanAttribute(t,e),o=O.useMemo(()=>({makeDecision:s=>n({type:W.Boolean,attributeId:e,state:s}),...r}),[e,n,r]),a=O.useMemo(()=>({...o,attribute:i}),[i,o]);if(i)return a}function kj(e){const t=Va(),{makeDecision:n,setManyDecision:r}=Li(),i=ef(e,Qe.component);Ua(t);const o=t.attributes,a=Fa.getComponentAttribute(t,e),s=O.useMemo(()=>({makeDecision:c=>n({type:W.Component,attributeId:e,state:c}),clearSubtree:g(Nj(e,o),cu(Ma),Z(c=>()=>r(c,{type:"Default"})),st(()=>()=>Promise.resolve())),...i}),[e,n,o,r,i]),u=O.useMemo(()=>({...s,attribute:a}),[a,s]);if(a)return u}function ef(e,t){const{explain:n,applySolution:r}=jw();return O.useMemo(()=>({explain:(i,o)=>{const a=Y(i.question).with(_t.whyIsNotSatisfied,()=>Qe.attribute).otherwise(()=>t),s={...i,subject:a,attributeId:e};return Y(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=Tn(ek),Mj=Tn(tk),jj=Tn((e,t)=>g0(ft).equals(e??{},t??{})),_j=gn({attributeId:iy,decisions:qi(iy)}),qj=Tn((e,t)=>qi(_j).equals(e??[],t??[])),Fj=gn({type:ft}),Lj=gn({type:ft}),Bj=gn({type:ft,rules:qi(Mj)}),Vj=Tn((e,t)=>Y({x:e,y:t}).returnType().with({x:{type:pn.all},y:{type:pn.all}},({x:n,y:r})=>Fj.equals(n,r)).with({x:{type:pn.none},y:{type:pn.none}},({x:n,y:r})=>Lj.equals(n,r)).with({x:{type:pn.specific},y:{type:pn.specific}},({x:n,y:r})=>Bj.equals(n,r)).otherwise(()=>!1)),Uj=gn({rules:Vl(Vj)}),_w=gn({configurationModelSource:Tn((e,t)=>uj(e,t)),attributeRelations:qj,usageRuleParameters:jj,allowedInExplain:Vl(Uj)}),op=Vl(_w),Gj=$h,vc=Vl(Gj),zj=()=>Yh({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:[Ln("Shutting down","SessionManagement:"),"disposeOldSession"],states:{ProcessChanges:{entry:[Ln("Entering ProcessChanges","SessionManagement:"),Wo(2)],always:[{target:"DisposeSession",cond:"shallDisposeSession"},{target:"CreateSession",cond:"shallCreateSession"},{target:"UpdateSession",cond:"shallUpdateSession"}]},DisposeSession:{entry:[Ln("Entering DisposeSession","SessionManagement:"),Wo(2)],always:{actions:["disposeOldSession"],target:"ProcessChanges"}},CreateSession:{entry:[Ln("Entering CreateSession","SessionManagement:"),Wo(0)],invoke:{id:"getNewSession",src:"createSession",onDone:{actions:["setSessionCreationResult","setHasEverSuccessfullyCreatedSession"],target:"ProcessChanges"},onError:{actions:"setSessionCreationError",target:"SessionCreationFailed"}}},SessionCreationFailed:{entry:[Ln("Entering SessionCreationFailed","SessionManagement:"),Wo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionCreationError"},exit:[Ln("Exiting SessionCreationFailed","SessionManagement:"),"clearSessionCreationError"],on:{RetrySessionCreation:{target:"ProcessChanges",actions:Ln("Retrying session creation","SessionManagement:")}}},UpdateSession:{entry:[Ln("Entering UpdateSession","SessionManagement:"),Wo(1)],invoke:{id:"updateExistingSession",src:"updateSession",onDone:{target:"ProcessChanges"},onError:{actions:"setSessionUpdateError",target:"SessionUpdateFailed"}}},SessionUpdateFailed:{entry:[Ln("Entering SessionUpdateFailed","SessionManagement:"),Wo(2)],always:{target:"ProcessChanges",cond:"shallImmediatelyProcessChangesAfterSessionUpdateError"},exit:[Ln("Exiting SessionUpdateFailed","SessionManagement:"),"clearSessionUpdateError"],on:{RetrySessionUpdate:{target:"ProcessChanges",actions:Ln("Retrying session update","SessionManagement:")}}}}},{actions:{saveDesiredClient:Pn({desiredClient:(e,t)=>t.client}),saveDesiredSessionContext:Pn({desiredSessionContext:(e,t)=>t.sessionContext}),disposeOldSession:Pn((e,t)=>(e.session&&e.session.close().then(Lr).catch(n=>{}),{session:null,actualClient:null})),setSessionCreationResult:Pn((e,t)=>({session:t.data.session,actualClient:t.data.client})),setSessionCreationError:Pn((e,t)=>({sessionCreationError:t.data})),clearSessionCreationError:Pn({sessionCreationError:()=>null}),setSessionUpdateError:Pn((e,t)=>({sessionUpdateError:t.data})),clearSessionUpdateError:Pn({sessionUpdateError:()=>null}),setHasEverSuccessfullyCreatedSession:Pn({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||!vc.equals(e.actualClient,e.desiredClient)),shallCreateSession:e=>e.session==null&&e.desiredClient!=null&&e.desiredSessionContext!=null,shallUpdateSession:e=>e.session!=null&&!_w.equals(e.session.getSessionContext(),e.desiredSessionContext),shallImmediatelyProcessChangesAfterSessionCreationError:e=>!vc.equals(e.desiredClient,e.sessionCreationError.client)||!op.equals(e.desiredSessionContext,e.sessionCreationError.sessionContext),shallImmediatelyProcessChangesAfterSessionUpdateError:e=>!vc.equals(e.desiredClient,e.actualClient)||!op.equals(e.desiredSessionContext,e.sessionUpdateError.sessionContext)}});function Wo(e){const t=e===0,n=e===1;return zM((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 pw({type:"SessionManagementStateChanged",sessionInitialization:o,sessionUpdating:a,session:r.session})})}const Wj=e=>t=>(t({type:"ConfigurationChanged",session:e,configuration:e.getConfiguration()}),e.setOnConfigurationChangedHandler(n=>{t({type:"ConfigurationChanged",session:e,configuration:n})}),()=>{e.setOnConfigurationChangedHandler(null)}),Hj=()=>Yh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{session:null},on:{ConfigurationChanged:{actions:[pw((e,t)=>t)]}},initial:"ProcessChanges",states:{ProcessChanges:{entry:[Ln("Entering ProcessChanges","ConfigurationSubscriptionManagement:")],on:{ChangeSession:{actions:["saveSession"]}},always:[{target:"Subscribe",cond:(e,t)=>e.session!=null}]},Subscribe:{entry:[Ln("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)=>Wj(e.session)}}}},{actions:{saveSession:Pn((e,t)=>({session:t.session}))}}),Kj=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},oy=()=>{const e=Kj();return{capsule:{promise:e.promise},resolve:e.resolve,reject:e.reject}};var Yj=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,Yj(t,n,r))};const Xj=()=>Yh({predictableActionArguments:!0,preserveActionOrder:!0,schema:{context:{},events:{}},context:{sessionManagementActor:null,configurationSubscriptionManagementActor:null,sessionInitialization:null,sessionUpdating:null,session:null,configuration:null,isReadyPromise:oy()},entry:[Pn({sessionManagementActor:()=>Wm(zj()),configurationSubscriptionManagementActor:()=>Wm(Hj())})],exit:[Km(e=>e.sessionManagementActor),Km(e=>e.configurationSubscriptionManagementActor)],on:{ChangeConfigurationClient:{actions:[_u(e=>e.sessionManagementActor)]},ChangeSessionContext:{actions:[_u(e=>e.sessionManagementActor)]},RetrySessionCreation:{actions:[_u(e=>e.sessionManagementActor)]},RetrySessionUpdate:{actions:[_u(e=>e.sessionManagementActor)]},SessionManagementStateChanged:{actions:[Pn((e,t)=>({session:t.session,sessionInitialization:t.sessionInitialization,sessionUpdating:t.sessionUpdating})),eM(e=>({type:"ChangeSession",session:e.session}),{to:e=>e.configurationSubscriptionManagementActor}),"calculateReadyState"]},ConfigurationChanged:{actions:[Pn((e,t)=>({configuration:{session:t.session,configuration:t.configuration}})),"calculateReadyState"]}},initial:"Idle",states:{Idle:{}}},{actions:{calculateReadyState:Pn((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 Jj(e){var t,n;const[r,i]=wj(Xj,{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],Cm(vc)),ay(()=>{const u=g(be(e.sessionContext),rN(c=>be(c.configurationModelSource)),Vn);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],Cm(op));const o=O.useMemo(()=>{var u,c,l,f;return{isInitializing:((c=(u=r.context.isReadyPromise)==null?void 0:u.capsule)==null?void 0:c.promise)!=null,isInitializingPromise:(l=r.context.isReadyPromise)==null?void 0:l.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,c;return{isUpdating:(u=r.context.sessionUpdating)==null?void 0:u.isUpdating,error:((c=r.context.sessionUpdating)==null?void 0:c.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 Qj(e){const{configuratorClient:t,...n}=e,{configurationInitialization:r,configurationUpdating:i,session:o,configuration:a}=Jj({configuratorClient:t,sessionContext:n});return $.jsx(Pw.Provider,{value:r,children:$.jsx(Cj.Provider,{value:i,children:$.jsx(Nw.Provider,{value:o,children:$.jsx(Rw.Provider,{value:a,children:e.children})})})})}function nv(){return O.useContext(Pw)}function Zj(e){const{children:t}=e,{isInitializingPromise:n}=nv();if(n!=null&&n.promise)throw n.promise;return $.jsx($.Fragment,{children:t})}function qw(){const e=Zh(),t=Va();return ev(e),Ua(t),O.useMemo(()=>({configuration:t,restoreConfiguration:n=>e.restoreConfiguration(n)}),[t,e])}const e_=O.createContext(null),If={didCatch:!1,error:null};class t_ extends O.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=If}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(If)}}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&&n_(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(If)}}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(e_.Provider,{value:{didCatch:o,error:a,resetErrorBoundary:this.resetErrorBoundary}},s)}}function n_(){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 En=function(){return En=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},En.apply(this,arguments)};function r_(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 wo(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 i_(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var o_=/^((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)-.*))$/,a_=i_(function(e){return o_.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),gt="-ms-",xs="-moz-",it="-webkit-",Fw="comm",tf="rule",rv="decl",s_="@import",Lw="@keyframes",u_="@layer",c_=Math.abs,iv=String.fromCharCode,ap=Object.assign;function l_(e,t){return tn(e,0)^45?(((t<<2^tn(e,0))<<2^tn(e,1))<<2^tn(e,2))<<2^tn(e,3):0}function Bw(e){return e.trim()}function _r(e,t){return(e=t.exec(e))?e[0]:e}function ke(e,t,n){return e.replace(t,n)}function mc(e,t){return e.indexOf(t)}function tn(e,t){return e.charCodeAt(t)|0}function ga(e,t,n){return e.slice(t,n)}function Tr(e){return e.length}function Vw(e){return e.length}function vs(e,t){return t.push(e),e}function f_(e,t){return e.map(t).join("")}function sy(e,t){return e.filter(function(n){return!_r(n,t)})}var nf=1,ba=1,Uw=0,ar=0,Gt=0,Ga="";function rf(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:nf,column:ba,length:a,return:"",siblings:s}}function li(e,t){return ap(rf("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Ho(e){for(;e.root;)e=li(e.root,{children:[e]});vs(e,e.siblings)}function d_(){return Gt}function p_(){return Gt=ar>0?tn(Ga,--ar):0,ba--,Gt===10&&(ba=1,nf--),Gt}function br(){return Gt=ar<Uw?tn(Ga,ar++):0,ba++,Gt===10&&(ba=1,nf++),Gt}function lo(){return tn(Ga,ar)}function yc(){return ar}function of(e,t){return ga(Ga,e,t)}function sp(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 h_(e){return nf=ba=1,Uw=Tr(Ga=e),ar=0,[]}function v_(e){return Ga="",e}function Af(e){return Bw(of(ar-1,up(e===91?e+2:e===40?e+1:e)))}function m_(e){for(;(Gt=lo())&&Gt<33;)br();return sp(e)>2||sp(Gt)>3?"":" "}function y_(e,t){for(;--t&&br()&&!(Gt<48||Gt>102||Gt>57&&Gt<65||Gt>70&&Gt<97););return of(e,yc()+(t<6&&lo()==32&&br()==32))}function up(e){for(;br();)switch(Gt){case e:return ar;case 34:case 39:e!==34&&e!==39&&up(Gt);break;case 40:e===41&&up(e);break;case 92:br();break}return ar}function g_(e,t){for(;br()&&e+Gt!==47+10;)if(e+Gt===42+42&&lo()===47)break;return"/*"+of(t,ar-1)+"*"+iv(e===47?e:br())}function b_(e){for(;!sp(lo());)br();return of(e,ar)}function S_(e){return v_(gc("",null,null,null,[""],e=h_(e),0,[0],e))}function gc(e,t,n,r,i,o,a,s,u){for(var c=0,l=0,f=a,d=0,p=0,h=0,v=1,E=1,x=1,m=0,S="",C=i,b=o,T=r,A=S;E;)switch(h=m,m=br()){case 40:if(h!=108&&tn(A,f-1)==58){mc(A+=ke(Af(m),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:A+=Af(m);break;case 9:case 10:case 13:case 32:A+=m_(h);break;case 92:A+=y_(yc()-1,7);continue;case 47:switch(lo()){case 42:case 47:vs(w_(g_(br(),yc()),t,n,u),u);break;default:A+="/"}break;case 123*v:s[c++]=Tr(A)*x;case 125*v:case 59:case 0:switch(m){case 0:case 125:E=0;case 59+l:x==-1&&(A=ke(A,/\f/g,"")),p>0&&Tr(A)-f&&vs(p>32?cy(A+";",r,n,f-1,u):cy(ke(A," ","")+";",r,n,f-2,u),u);break;case 59:A+=";";default:if(vs(T=uy(A,t,n,c,l,i,s,S,C=[],b=[],f,o),o),m===123)if(l===0)gc(A,t,T,T,C,o,f,s,b);else switch(d===99&&tn(A,3)===110?100:d){case 100:case 108:case 109:case 115:gc(e,T,T,r&&vs(uy(e,T,T,0,0,i,s,S,i,C=[],f,b),b),i,b,f,s,r?C:b);break;default:gc(A,T,T,T,[""],b,0,s,b)}}c=l=p=0,v=x=1,S=A="",f=a;break;case 58:f=1+Tr(A),p=h;default:if(v<1){if(m==123)--v;else if(m==125&&v++==0&&p_()==125)continue}switch(A+=iv(m),m*v){case 38:x=l>0?1:(A+="\f",-1);break;case 44:s[c++]=(Tr(A)-1)*x,x=1;break;case 64:lo()===45&&(A+=Af(br())),d=lo(),l=f=Tr(S=A+=b_(yc())),m++;break;case 45:h===45&&Tr(A)==2&&(v=0)}}return o}function uy(e,t,n,r,i,o,a,s,u,c,l,f){for(var d=i-1,p=i===0?o:[""],h=Vw(p),v=0,E=0,x=0;v<r;++v)for(var m=0,S=ga(e,d+1,d=c_(E=a[v])),C=e;m<h;++m)(C=Bw(E>0?p[m]+" "+S:ke(S,/&\f/g,p[m])))&&(u[x++]=C);return rf(e,t,n,i===0?tf:s,u,c,l,f)}function w_(e,t,n,r){return rf(e,t,n,Fw,iv(d_()),ga(e,2,-2),0,r)}function cy(e,t,n,r,i){return rf(e,t,n,rv,ga(e,0,r),ga(e,r+1,-1),r,i)}function Gw(e,t,n){switch(l_(e,t)){case 5103:return it+"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 it+e+e;case 4789:return xs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return it+e+xs+e+gt+e+e;case 5936:switch(tn(e,t+11)){case 114:return it+e+gt+ke(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return it+e+gt+ke(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return it+e+gt+ke(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return it+e+gt+e+e;case 6165:return it+e+gt+"flex-"+e+e;case 5187:return it+e+ke(e,/(\w+).+(:[^]+)/,it+"box-$1$2"+gt+"flex-$1$2")+e;case 5443:return it+e+gt+"flex-item-"+ke(e,/flex-|-self/g,"")+(_r(e,/flex-|baseline/)?"":gt+"grid-row-"+ke(e,/flex-|-self/g,""))+e;case 4675:return it+e+gt+"flex-line-pack"+ke(e,/align-content|flex-|-self/g,"")+e;case 5548:return it+e+gt+ke(e,"shrink","negative")+e;case 5292:return it+e+gt+ke(e,"basis","preferred-size")+e;case 6060:return it+"box-"+ke(e,"-grow","")+it+e+gt+ke(e,"grow","positive")+e;case 4554:return it+ke(e,/([^-])(transform)/g,"$1"+it+"$2")+e;case 6187:return ke(ke(ke(e,/(zoom-|grab)/,it+"$1"),/(image-set)/,it+"$1"),e,"")+e;case 5495:case 3959:return ke(e,/(image-set\([^]*)/,it+"$1$`$1");case 4968:return ke(ke(e,/(.+:)(flex-)?(.*)/,it+"box-pack:$3"+gt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+it+e+e;case 4200:if(!_r(e,/flex-|baseline/))return gt+"grid-column-align"+ga(e,t)+e;break;case 2592:case 3360:return gt+ke(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,_r(r.props,/grid-\w+-end/)})?~mc(e+(n=n[t].value),"span")?e:gt+ke(e,"-start","")+e+gt+"grid-row-span:"+(~mc(n,"span")?_r(n,/\d+/):+_r(n,/\d+/)-+_r(e,/\d+/))+";":gt+ke(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return _r(r.props,/grid-\w+-start/)})?e:gt+ke(ke(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return ke(e,/(.+)-inline(.+)/,it+"$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(Tr(e)-1-t>6)switch(tn(e,t+1)){case 109:if(tn(e,t+4)!==45)break;case 102:return ke(e,/(.+:)(.+)-([^]+)/,"$1"+it+"$2-$3$1"+xs+(tn(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~mc(e,"stretch")?Gw(ke(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return ke(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,s,u,c){return gt+i+":"+o+c+(a?gt+i+"-span:"+(s?u:+u-+o)+c:"")+e});case 4949:if(tn(e,t+6)===121)return ke(e,":",":"+it)+e;break;case 6444:switch(tn(e,tn(e,14)===45?18:11)){case 120:return ke(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+it+(tn(e,14)===45?"inline-":"")+"box$3$1"+it+"$2$3$1"+gt+"$2box$3")+e;case 100:return ke(e,":",":"+gt)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return ke(e,"scroll-","scroll-snap-")+e}return e}function Wc(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function C_(e,t,n,r){switch(e.type){case u_:if(e.children.length)break;case s_:case rv:return e.return=e.return||e.value;case Fw:return"";case Lw:return e.return=e.value+"{"+Wc(e.children,r)+"}";case tf:if(!Tr(e.value=e.props.join(",")))return""}return Tr(n=Wc(e.children,r))?e.return=e.value+"{"+n+"}":""}function x_(e){var t=Vw(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 E_(e){return function(t){t.root||(t=t.return)&&e(t)}}function T_(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case rv:e.return=Gw(e.value,e.length,n);return;case Lw:return Wc([li(e,{value:ke(e.value,"@","@"+it)})],r);case tf:if(e.length)return f_(n=e.props,function(i){switch(_r(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Ho(li(e,{props:[ke(i,/:(read-\w+)/,":"+xs+"$1")]})),Ho(li(e,{props:[i]})),ap(e,{props:sy(n,r)});break;case"::placeholder":Ho(li(e,{props:[ke(i,/:(plac\w+)/,":"+it+"input-$1")]})),Ho(li(e,{props:[ke(i,/:(plac\w+)/,":"+xs+"$1")]})),Ho(li(e,{props:[ke(i,/:(plac\w+)/,gt+"input-$1")]})),Ho(li(e,{props:[i]})),ap(e,{props:sy(n,r)});break}return""})}}var I_={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},Co=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ov=typeof window<"u"&&"HTMLElement"in window,A_=!!(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"),$_={},ly=/invalid hook call/i,Fu=new Set,zw=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];ly.test(a)?(o=!1,Fu.delete(r)):i.apply(void 0,
|
|
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];ly.test(a)?(o=!1,Fu.delete(r)):i.apply(void 0,wo([a],s,!1))},O.useRef(),o&&!Fu.has(r)&&(console.warn(r),Fu.add(r))}catch(a){ly.test(a.message)&&Fu.delete(r)}finally{console.error=i}}},af=Object.freeze([]),Sa=Object.freeze({});function Ww(e,t,n){return n===void 0&&(n=Sa),e.theme!==n.theme&&e.theme||t||n.theme}var cp=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"]),O_=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,D_=/(^-|-$)/g;function fy(e){return e.replace(O_,"-").replace(D_,"")}var N_=/(a)(d)/gi,dy=function(e){return String.fromCharCode(e+(e>25?39:97))};function lp(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=dy(t%52)+n;return(dy(t%52)+n).replace(N_,"$1-$2")}var $f,no=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Hw=function(e){return no(5381,e)};function Kw(e){return lp(Hw(e)>>>0)}function Yw(e){return process.env.NODE_ENV!=="production"&&typeof e=="string"&&e||e.displayName||e.name||"Component"}function Of(e){return typeof e=="string"&&(process.env.NODE_ENV==="production"||e.charAt(0)===e.charAt(0).toLowerCase())}var Xw=typeof Symbol=="function"&&Symbol.for,Jw=Xw?Symbol.for("react.memo"):60115,P_=Xw?Symbol.for("react.forward_ref"):60112,R_={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},k_={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Qw={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M_=(($f={})[P_]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},$f[Jw]=Qw,$f);function py(e){return("type"in(t=e)&&t.type.$$typeof)===Jw?Qw:"$$typeof"in e?M_[e.$$typeof]:R_;var t}var j_=Object.defineProperty,__=Object.getOwnPropertyNames,hy=Object.getOwnPropertySymbols,q_=Object.getOwnPropertyDescriptor,F_=Object.getPrototypeOf,vy=Object.prototype;function Zw(e,t,n){if(typeof t!="string"){if(vy){var r=F_(t);r&&r!==vy&&Zw(e,r,n)}var i=__(t);hy&&(i=i.concat(hy(t)));for(var o=py(e),a=py(t),s=0;s<i.length;++s){var u=i[s];if(!(u in k_||n&&n[u]||a&&u in a||o&&u in o)){var c=q_(t,u);try{j_(e,u,c)}catch{}}}}return e}function wa(e){return typeof e=="function"}function av(e){return typeof e=="object"&&"styledComponentId"in e}function ro(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function fp(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 Ca(e){return e!==null&&typeof e=="object"&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function dp(e,t,n){if(n===void 0&&(n=!1),!n&&!Ca(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=dp(e[r],t[r]);else if(Ca(t))for(var r in t)e[r]=dp(e[r],t[r]);return e}function sv(e,t){Object.defineProperty(e,"toString",{value:t})}var L_=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}(),bc=new Map,Hc=new Map,Sc=1,Lu=function(e){if(bc.has(e))return bc.get(e);for(;Hc.has(Sc);)Sc++;var t=Sc++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw
|
|
178
|
-
`),i=[],o=0,a=r.length;o<a;o++){var s=r[o].trim();if(s){var u=s.match(
|
|
179
|
-
`)},l=0;l<s;l++)c(l);return u}(i)})}return e.registerId=function(t){return Lu(t)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(En(En({},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
|
|
176
|
+
`,18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function B_(){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 za(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(B_.apply(void 0,wo([L_[e]],t,!1)).trim())}var V_=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 za(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}(),bc=new Map,Hc=new Map,Sc=1,Lu=function(e){if(bc.has(e))return bc.get(e);for(;Hc.has(Sc);)Sc++;var t=Sc++;if(process.env.NODE_ENV!=="production"&&((0|t)<0||t>1073741824))throw za(16,"".concat(t));return bc.set(e,t),Hc.set(t,e),t},U_=function(e,t){Sc=t+1,bc.set(e,t),Hc.set(t,e)},G_="style[".concat(Co,"][").concat("data-styled-version",'="').concat("6.1.1",'"]'),z_=new RegExp("^".concat(Co,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),W_=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)},H_=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(z_);if(u){var c=0|parseInt(u[1],10),l=u[2];c!==0&&(U_(l,c),W_(e,l,u[3]),e.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function K_(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var eC=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(s){var u=Array.from(s.querySelectorAll("style[".concat(Co,"]")));return u[u.length-1]}(n),o=i!==void 0?i.nextSibling:null;r.setAttribute(Co,"active"),r.setAttribute("data-styled-version","6.1.1");var a=K_();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Y_=function(){function e(t){this.element=eC(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 za(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}(),X_=function(){function e(t){this.element=eC(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}(),J_=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}(),my=ov,Q_={isServer:!ov,useCSSOMInjection:!A_},Kc=function(){function e(t,n,r){t===void 0&&(t=Sa),n===void 0&&(n={});var i=this;this.options=En(En({},Q_),t),this.gs=n,this.names=new Map(r),this.server=!!t.isServer,!this.server&&ov&&my&&(my=!1,function(o){for(var a=document.querySelectorAll(G_),s=0,u=a.length;s<u;s++){var c=a[s];c&&c.getAttribute(Co)!=="active"&&(H_(o,c),c.parentNode&&c.parentNode.removeChild(c))}}(this)),sv(this,function(){return function(o){for(var a=o.getTag(),s=a.length,u="",c=function(f){var d=function(x){return Hc.get(x)}(f);if(d===void 0)return"continue";var p=o.names.get(d),h=a.getGroup(f);if(p===void 0||h.length===0)return"continue";var v="".concat(Co,".g").concat(f,'[id="').concat(d,'"]'),E="";p!==void 0&&p.forEach(function(x){x.length>0&&(E+="".concat(x,","))}),u+="".concat(h).concat(v,'{content:"').concat(E,'"}').concat(`/*!sc*/
|
|
179
|
+
`)},l=0;l<s;l++)c(l);return u}(i)})}return e.registerId=function(t){return Lu(t)},e.prototype.reconstructWithOptions=function(t,n){return n===void 0&&(n=!0),new e(En(En({},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 J_(i):r?new Y_(i):new X_(i)}(this.options),new V_(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(Lu(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(Lu(t),r)},e.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},e.prototype.clearRules=function(t){this.getTag().clearGroup(Lu(t)),this.clearNames(t)},e.prototype.clearTag=function(){this.tag=void 0},e}(),Z_=/&/g,eq=/^\s*\/\/.*$/gm;function tC(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=tC(n.children,t)),n})}function tq(e){var t,n,r,i=e===void 0?Sa:e,o=i.options,a=o===void 0?Sa:o,s=i.plugins,u=s===void 0?af:s,c=function(d,p,h){return h===n||h.startsWith(n)&&h.endsWith(n)&&h.replaceAll(n,"").length>0?".".concat(t):d},l=u.slice();l.push(function(d){d.type===tf&&d.value.includes("&")&&(d.props[0]=d.props[0].replace(Z_,n).replace(r,c))}),a.prefix&&l.push(T_),l.push(C_);var f=function(d,p,h,v){p===void 0&&(p=""),h===void 0&&(h=""),v===void 0&&(v="&"),t=v,n=p,r=new RegExp("\\".concat(n,"\\b"),"g");var E=d.replace(eq,""),x=S_(h||p?"".concat(h," ").concat(p," { ").concat(E," }"):E);a.namespace&&(x=tC(x,a.namespace));var m=[];return Wc(x,x_(l.concat(E_(function(S){return m.push(S)})))),m};return f.hash=u.length?u.reduce(function(d,p){return p.name||za(15),no(d,p.name)},5381).toString():"",f}var nq=new Kc,pp=tq(),nC=O.createContext({shouldForwardProp:void 0,styleSheet:nq,stylis:pp});nC.Consumer;O.createContext(void 0);function hp(){return O.useContext(nC)}var yy=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=pp);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,sv(this,function(){throw za(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=pp),this.name+t.hash},e}(),rq=function(e){return e>="A"&&e<="Z"};function gy(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(n===1&&r==="-"&&e[0]==="-")return e;rq(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var rC=function(e){return e==null||e===!1||e===""},iC=function(e){var t,n,r=[];for(var i in e){var o=e[i];e.hasOwnProperty(i)&&!rC(o)&&(Array.isArray(o)&&o.isCss||wa(o)?r.push("".concat(gy(i),":"),o,";"):Ca(o)?r.push.apply(r,wo(wo(["".concat(i," {")],iC(o),!1),["}"],!1)):r.push("".concat(gy(i),": ").concat((t=i,(n=o)==null||typeof n=="boolean"||n===""?"":typeof n!="number"||n===0||t in I_||t.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function wi(e,t,n,r){if(rC(e))return[];if(av(e))return[".".concat(e.styledComponentId)];if(wa(e)){if(!wa(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 yy||Ca(i)||i===null||console.error("".concat(Yw(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.")),wi(i,t,n,r)}var o;return e instanceof yy?n?(e.inject(n,r),[e.getName(r)]):[e]:Ca(e)?iC(e):Array.isArray(e)?Array.prototype.concat.apply(af,e.map(function(a){return wi(a,t,n,r)})):[e.toString()]}function oC(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(wa(n)&&!av(n))return!1}return!0}var iq=Hw("6.1.1"),oq=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=process.env.NODE_ENV==="production"&&(r===void 0||r.isStatic)&&oC(t),this.componentId=n,this.baseHash=no(iq,n),this.baseStyle=r,Kc.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=ro(i,this.staticRulesId);else{var o=fp(wi(this.rules,t,n,r)),a=lp(no(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=ro(i,a),this.staticRulesId=a}else{for(var u=no(this.baseHash,r.hash),c="",l=0;l<this.rules.length;l++){var f=this.rules[l];if(typeof f=="string")c+=f,process.env.NODE_ENV!=="production"&&(u=no(u,f));else if(f){var d=fp(wi(f,t,n,r));u=no(u,d+l),c+=d}}if(c){var p=lp(u>>>0);n.hasNameForId(this.componentId,p)||n.insertRules(this.componentId,p,r(c,".".concat(p),void 0,this.componentId)),i=ro(i,p)}}return i},e}(),uv=O.createContext(void 0);uv.Consumer;var Df={},by=new Set;function aq(e,t,n){var r=av(e),i=e,o=!Of(e),a=t.attrs,s=a===void 0?af:a,u=t.componentId,c=u===void 0?function(C,b){var T=typeof C!="string"?"sc":fy(C);Df[T]=(Df[T]||0)+1;var A="".concat(T,"-").concat(Kw("6.1.1"+T+Df[T]));return b?"".concat(b,"-").concat(A):A}(t.displayName,t.parentComponentId):u,l=t.displayName,f=l===void 0?function(C){return Of(C)?"styled.".concat(C):"Styled(".concat(Yw(C),")")}(e):l,d=t.displayName&&t.componentId?"".concat(fy(t.displayName),"-").concat(t.componentId):t.componentId||c,p=r&&i.attrs?i.attrs.concat(s).filter(Boolean):s,h=t.shouldForwardProp;if(r&&i.shouldForwardProp){var v=i.shouldForwardProp;if(t.shouldForwardProp){var E=t.shouldForwardProp;h=function(C,b){return v(C,b)&&E(C,b)}}else h=v}var x=new oq(n,d,r?i.componentStyle:void 0);function m(C,b){return function(T,A,D){var I=T.attrs,N=T.componentStyle,_=T.defaultProps,L=T.foldedComponentIds,V=T.styledComponentId,H=T.target,R=O.useContext(uv),ie=hp(),B=T.shouldForwardProp||ie.shouldForwardProp;process.env.NODE_ENV!=="production"&&O.useDebugValue(V);var U=function(K,ae,de){for(var he,xe=En(En({},ae),{className:void 0,theme:de}),Re=0;Re<K.length;Re+=1){var De=wa(he=K[Re])?he(xe):he;for(var ht in De)xe[ht]=ht==="className"?ro(xe[ht],De[ht]):ht==="style"?En(En({},xe[ht]),De[ht]):De[ht]}return ae.className&&(xe.className=ro(xe.className,ae.className)),xe}(I,A,Ww(A,R,_)||Sa),fe=U.as||H,M={};for(var P in U)U[P]===void 0||P[0]==="$"||P==="as"||P==="theme"||(P==="forwardedAs"?M.as=U.forwardedAs:B&&!B(P,fe)||(M[P]=U[P],B||process.env.NODE_ENV!=="development"||a_(P)||by.has(P)||!cp.has(fe)||(by.add(P),console.warn('styled-components: it looks like an unknown prop "'.concat(P,'" 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(K,ae){var de=hp(),he=K.generateAndInjectStyles(ae,de.styleSheet,de.stylis);return process.env.NODE_ENV!=="production"&&O.useDebugValue(he),he}(N,U);process.env.NODE_ENV!=="production"&&T.warnTooManyClasses&&T.warnTooManyClasses(te);var oe=ro(L,V);return te&&(oe+=" "+te),U.className&&(oe+=" "+U.className),M[Of(fe)&&!cp.has(fe)?"class":"className"]=oe,M.ref=D,O.createElement(fe,M)}(S,C,b)}m.displayName=f;var S=O.forwardRef(m);return S.attrs=p,S.componentStyle=x,S.displayName=f,S.shouldForwardProp=h,S.foldedComponentIds=r?ro(i.foldedComponentIds,i.styledComponentId):"",S.styledComponentId=d,S.target=r?i.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(C){this._foldedDefaultProps=r?function(b){for(var T=[],A=1;A<arguments.length;A++)T[A-1]=arguments[A];for(var D=0,I=T;D<I.length;D++)dp(b,I[D],!0);return b}({},i.defaultProps,C):C}}),process.env.NODE_ENV!=="production"&&(zw(f,d),S.warnTooManyClasses=function(C,b){var T={},A=!1;return function(D){if(!A&&(T[D]=!0,Object.keys(T).length>=200)){var I=b?' with the id of "'.concat(b,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(C).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,T={}}}}(f,d)),sv(
|
|
188
|
+
<Component />`),A=!0,T={}}}}(f,d)),sv(S,function(){return".".concat(S.styledComponentId)}),o&&Zw(S,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),S}function Sy(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 wy=function(e){return Object.assign(e,{isCss:!0})};function cv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(wa(e)||Ca(e)){var r=e;return wy(wi(Sy(af,wo([r],t,!0))))}var i=e;return t.length===0&&i.length===1&&typeof i[0]=="string"?wi(i):wy(wi(Sy(i,t)))}function vp(e,t,n){if(n===void 0&&(n=Sa),!t)throw za(1,t);var r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return e(t,n,cv.apply(void 0,wo([i],o,!1)))};return r.attrs=function(i){return vp(e,t,En(En({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},r.withConfig=function(i){return vp(e,t,En(En({},n),i))},r}var aC=function(e){return vp(aq,e)},Ie=aC;cp.forEach(function(e){Ie[e]=aC(e)});var sq=function(){function e(t,n){this.rules=t,this.componentId=n,this.isStatic=oC(t),Kc.registerId(this.componentId+1)}return e.prototype.createStyles=function(t,n,r,i){var o=i(fp(wi(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&&Kc.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function hu(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=cv.apply(void 0,wo([e],t,!1)),i="sc-global-".concat(Kw(JSON.stringify(r))),o=new sq(r,i);process.env.NODE_ENV!=="production"&&zw(i);var a=function(u){var c=hp(),l=O.useContext(uv),f=O.useRef(c.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."),c.styleSheet.server&&s(f,u,c.styleSheet,l,c.stylis),O.useLayoutEffect(function(){if(!c.styleSheet.server)return s(f,u,c.styleSheet,l,c.stylis),function(){return o.removeStyles(f,c.styleSheet)}},[f,u,c.styleSheet,l,c.stylis]),null};function s(u,c,l,f,d){if(o.isStatic)o.renderStyles(u,$_,l,d);else{var p=En(En({},c),{theme:Ww(c,f,a.defaultProps)});o.renderStyles(u,p,l,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 Bu="__sc-".concat(
|
|
190
|
+
Read more about this at https://www.styled-components.com/docs/basics#react-native`);var Bu="__sc-".concat(Co,"__");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&typeof window<"u"&&(window[Bu]||(window[Bu]=0),window[Bu]===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[Bu]+=1);var
|
|
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 Ey=function(){},fv={},
|
|
192
|
+
See https://s-c.sh/2BAXzed for more info.`),window[Bu]+=1);var uq={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"]},cq={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"]},sC={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 Cy(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?Cy(Object(n),!0).forEach(function(r){Qt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cy(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 lq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xy(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 fq(e,t,n){return t&&xy(e.prototype,t),n&&xy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lv(e,t){return pq(e)||vq(e,t)||uC(e,t)||yq()}function vu(e){return dq(e)||hq(e)||uC(e)||mq()}function dq(e){if(Array.isArray(e))return mp(e)}function pq(e){if(Array.isArray(e))return e}function hq(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vq(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 uC(e,t){if(e){if(typeof e=="string")return mp(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 mp(e,t)}}function mp(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 mq(){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 yq(){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 Ey=function(){},fv={},cC={},lC=null,fC={mark:Ey,measure:Ey};try{typeof window<"u"&&(fv=window),typeof document<"u"&&(cC=document),typeof MutationObserver<"u"&&(lC=MutationObserver),typeof performance<"u"&&(fC=performance)}catch{}var gq=fv.navigator||{},Ty=gq.userAgent,Iy=Ty===void 0?"":Ty,Di=fv,Ct=cC,Ay=lC,Vu=fC;Di.document;var ei=!!Ct.documentElement&&!!Ct.head&&typeof Ct.addEventListener=="function"&&typeof Ct.createElement=="function",dC=~Iy.indexOf("MSIE")||~Iy.indexOf("Trident/"),Uu,Gu,zu,Wu,Hu,Yr="___FONT_AWESOME___",yp=16,pC="fa",hC="svg-inline--fa",xo="data-fa-i2svg",gp="data-fa-pseudo-element",bq="data-fa-pseudo-element-pending",dv="data-prefix",pv="data-icon",$y="fontawesome-i2svg",Sq="async",wq=["HTML","HEAD","STYLE","SCRIPT"],vC=function(){try{return process.env.NODE_ENV==="production"}catch{return!1}}(),St="classic",Rt="sharp",hv=[St,Rt];function mu(e){return new Proxy(e,{get:function(n,r){return r in n?n[r]:n[St]}})}var Gs=mu((Uu={},Qt(Uu,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"}),Qt(Uu,Rt,{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"}),Uu)),zs=mu((Gu={},Qt(Gu,St,{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab",kit:"fak"}),Qt(Gu,Rt,{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"}),Gu)),Ws=mu((zu={},Qt(zu,St,{fab:"fa-brands",fad:"fa-duotone",fak:"fa-kit",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"}),Qt(zu,Rt,{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"}),zu)),Cq=mu((Wu={},Qt(Wu,St,{"fa-brands":"fab","fa-duotone":"fad","fa-kit":"fak","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"}),Qt(Wu,Rt,{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"}),Wu)),xq=/fa(s|r|l|t|d|b|k|ss|sr|sl|st)?[\-\ ]/,mC="fa-layers-text",Eq=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp|Kit)?.*/i,Tq=mu((Hu={},Qt(Hu,St,{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"}),Qt(Hu,Rt,{900:"fass",400:"fasr",300:"fasl",100:"fast"}),Hu)),yC=[1,2,3,4,5,6,7,8,9,10],Iq=yC.concat([11,12,13,14,15,16,17,18,19,20]),Aq=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],io={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Hs=new Set;Object.keys(zs[St]).map(Hs.add.bind(Hs));Object.keys(zs[Rt]).map(Hs.add.bind(Hs));var $q=[].concat(hv,vu(Hs),["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",io.GROUP,io.SWAP_OPACITY,io.PRIMARY,io.SECONDARY]).concat(yC.map(function(e){return"".concat(e,"x")})).concat(Iq.map(function(e){return"w-".concat(e)})),Es=Di.FontAwesomeConfig||{};function Oq(e){var t=Ct.querySelector("script["+e+"]");if(t)return t.getAttribute(e)}function Dq(e){return e===""?!0:e==="false"?!1:e==="true"?!0:e}if(Ct&&typeof Ct.querySelector=="function"){var Nq=[["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"]];Nq.forEach(function(e){var t=lv(e,2),n=t[0],r=t[1],i=Dq(Oq(n));i!=null&&(Es[r]=i)})}var gC={styleDefault:"solid",familyDefault:"classic",cssPrefix:pC,replacementClass:hC,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Es.familyPrefix&&(Es.cssPrefix=Es.familyPrefix);var xa=pe(pe({},gC),Es);xa.autoReplaceSvg||(xa.observeMutations=!1);var ve={};Object.keys(gC).forEach(function(e){Object.defineProperty(ve,e,{enumerable:!0,set:function(n){xa[e]=n,Ts.forEach(function(r){return r(ve)})},get:function(){return xa[e]}})});Object.defineProperty(ve,"familyPrefix",{enumerable:!0,set:function(t){xa.cssPrefix=t,Ts.forEach(function(n){return n(ve)})},get:function(){return xa.cssPrefix}});Di.FontAwesomeConfig=ve;var Ts=[];function Pq(e){return Ts.push(e),function(){Ts.splice(Ts.indexOf(e),1)}}var oi=yp,Ir={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function Rq(e){if(!(!e||!ei)){var t=Ct.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e;for(var n=Ct.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 Ct.head.insertBefore(t,r),e}}var kq="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Ks(){for(var e=12,t="";e-- >0;)t+=kq[Math.random()*62|0];return t}function Wa(e){for(var t=[],n=(e||[]).length>>>0;n--;)t[n]=e[n];return t}function vv(e){return e.classList?Wa(e.classList):(e.getAttribute("class")||"").split(" ").filter(function(t){return t})}function bC(e){return"".concat(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Mq(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,'="').concat(bC(e[n]),'" ')},"").trim()}function sf(e){return Object.keys(e||{}).reduce(function(t,n){return t+"".concat(n,": ").concat(e[n].trim(),";")},"")}function mv(e){return e.size!==Ir.size||e.x!==Ir.x||e.y!==Ir.y||e.rotate!==Ir.rotate||e.flipX||e.flipY}function jq(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)},c={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:u,path:c}}function _q(e){var t=e.transform,n=e.width,r=n===void 0?yp:n,i=e.height,o=i===void 0?yp:i,a=e.startCentered,s=a===void 0?!1:a,u="";return s&&dC?u+="translate(".concat(t.x/oi-r/2,"em, ").concat(t.y/oi-o/2,"em) "):s?u+="translate(calc(-50% + ".concat(t.x/oi,"em), calc(-50% + ").concat(t.y/oi,"em)) "):u+="translate(".concat(t.x/oi,"em, ").concat(t.y/oi,"em) "),u+="scale(".concat(t.size/oi*(t.flipX?-1:1),", ").concat(t.size/oi*(t.flipY?-1:1),") "),u+="rotate(".concat(t.rotate,"deg) "),u}var qq=`: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,35 +948,35 @@ 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 Sw(){var e=pw,t=hw,n=ve.cssPrefix,r=ve.replacementClass,i=Lq;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 Oy=!1;function Nf(){ve.autoAddCss&&!Oy&&(Mq(Sw()),Oy=!0)}var Bq={mixout:function(){return{dom:{css:Sw,insertCss:Nf}}},hooks:function(){return{beforeDOMElementCreation:function(){Nf()},beforeI2svg:function(){Nf()}}}},Qr=Di||{};Qr[Jr]||(Qr[Jr]={});Qr[Jr].styles||(Qr[Jr].styles={});Qr[Jr].hooks||(Qr[Jr].hooks={});Qr[Jr].shims||(Qr[Jr].shims=[]);var mr=Qr[Jr],Cw=[],Vq=function e(){wt.removeEventListener("DOMContentLoaded",e),Xc=1,Cw.map(function(t){return t()})},Xc=!1;ni&&(Xc=(wt.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(wt.readyState),Xc||wt.addEventListener("DOMContentLoaded",Vq));function Uq(e){ni&&(Xc?setTimeout(e,0):Cw.push(e))}function yu(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"?bw(e):"<".concat(t," ").concat(_q(r),">").concat(o.map(yu).join(""),"</").concat(t,">")}function Dy(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var Gq=function(t,n){return function(r,i,o,a){return t.call(n,r,i,o,a)}},Pf=function(t,n,r,i){var o=Object.keys(t),a=o.length,s=i!==void 0?Gq(n,i):n,u,c,l;for(r===void 0?(u=1,l=t[o[0]]):(u=0,l=r);u<a;u++)c=o[u],l=s(l,t[c],c,t);return l};function zq(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 bp(e){var t=zq(e);return t.length===1?t[0].toString(16):null}function Wq(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 Ny(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 Sp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=Ny(t);typeof mr.hooks.addPack=="function"&&!i?mr.hooks.addPack(e,Ny(t)):mr.styles[e]=pe(pe({},mr.styles[e]||{}),o),e==="fas"&&Sp("fa",t)}var Ku,Yu,Xu,ua=mr.styles,Hq=mr.shims,Kq=(Ku={},Qt(Ku,St,Object.values(Hs[St])),Qt(Ku,Rt,Object.values(Hs[Rt])),Ku),yv=null,ww={},xw={},Ew={},Tw={},Iw={},Yq=(Yu={},Qt(Yu,St,Object.keys(zs[St])),Qt(Yu,Rt,Object.keys(zs[Rt])),Yu);function Xq(e){return~Dq.indexOf(e)}function Jq(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!Xq(i)?i:null}var Aw=function(){var t=function(o){return Pf(ua,function(a,s,u){return a[u]=Pf(s,o,{}),a},{})};ww=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}),xw=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}),Iw=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 ua||ve.autoFetchSvg,r=Pf(Hq,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:{}});Ew=r.names,Tw=r.unicodes,yv=uf(ve.styleDefault,{family:ve.familyDefault})};kq(function(e){yv=uf(e.styleDefault,{family:ve.familyDefault})});Aw();function gv(e,t){return(ww[e]||{})[t]}function Qq(e,t){return(xw[e]||{})[t]}function oo(e,t){return(Iw[e]||{})[t]}function $w(e){return Ew[e]||{prefix:null,iconName:null}}function Zq(e){var t=Tw[e],n=gv("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Ni(){return yv}var bv=function(){return{prefix:null,iconName:null,rest:[]}};function uf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?St:n,i=zs[r][e],o=Ws[r][e]||Ws[r][i],a=e in mr.styles?e:null;return o||a||null}var Py=(Xu={},Qt(Xu,St,Object.keys(Hs[St])),Qt(Xu,Rt,Object.keys(Hs[Rt])),Xu);function cf(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(t={},Qt(t,St,"".concat(ve.cssPrefix,"-").concat(St)),Qt(t,Rt,"".concat(ve.cssPrefix,"-").concat(Rt)),t),a=null,s=St;(e.includes(o[St])||e.some(function(c){return Py[St].includes(c)}))&&(s=St),(e.includes(o[Rt])||e.some(function(c){return Py[Rt].includes(c)}))&&(s=Rt);var u=e.reduce(function(c,l){var f=Jq(ve.cssPrefix,l);if(ua[l]?(l=Kq[s].includes(l)?Eq[s][l]:l,a=l,c.prefix=l):Yq[s].indexOf(l)>-1?(a=l,c.prefix=uf(l,{family:s})):f?c.iconName=f:l!==ve.replacementClass&&l!==o[St]&&l!==o[Rt]&&c.rest.push(l),!i&&c.prefix&&c.iconName){var d=a==="fa"?$w(c.iconName):{},p=oo(c.prefix,c.iconName);d.prefix&&(a=null),c.iconName=d.iconName||p||c.iconName,c.prefix=d.prefix||c.prefix,c.prefix==="far"&&!ua.far&&ua.fas&&!ve.autoFetchSvg&&(c.prefix="fas")}return c},bv());return(e.includes("fa-brands")||e.includes("fab"))&&(u.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(u.prefix="fad"),!u.prefix&&s===Rt&&(ua.fass||ve.autoFetchSvg)&&(u.prefix="fass",u.iconName=oo(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||a==="fa")&&(u.prefix=Ni()||"fas"),u}var eF=function(){function e(){dq(this,e),this.definitions={}}return pq(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]),Sp(s,a[s]);var u=Hs[St][s];u&&Sp(u,a[s]),Aw()})}},{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,c=a.icon,l=c[2];n[s]||(n[s]={}),l.length>0&&l.forEach(function(f){typeof f=="string"&&(n[s][f]=c)}),n[s][u]=c}),n}}]),e}(),Ry=[],ca={},ma={},tF=Object.keys(ma);function nF(e,t){var n=t.mixoutsTo;return Ry=e,ca={},Object.keys(ma).forEach(function(r){tF.indexOf(r)===-1&&delete ma[r]}),Ry.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){ca[a]||(ca[a]=[]),ca[a].push(o[a])})}r.provides&&r.provides(ma)}),n}function Cp(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=ca[e]||[];return o.forEach(function(a){t=a.apply(null,[t].concat(r))}),t}function Eo(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=ca[e]||[];i.forEach(function(o){o.apply(null,n)})}function Zr(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return ma[e]?ma[e].apply(null,t):void 0}function wp(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Ni();if(t)return t=oo(n,t)||t,Dy(Ow.definitions,n,t)||Dy(mr.styles,n,t)}var Ow=new eF,rF=function(){ve.autoReplaceSvg=!1,ve.observeMutations=!1,Eo("noAuto")},iF={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ni?(Eo("beforeI2svg",t),Zr("pseudoElements2svg",t),Zr("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,Uq(function(){aF({autoReplaceSvgRoot:n}),Eo("watch",t)})}},oF={icon:function(t){if(t===null)return null;if(Yc(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:oo(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=uf(t[0]);return{prefix:r,iconName:oo(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(ve.cssPrefix,"-"))>-1||t.match(Tq))){var i=cf(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||Ni(),iconName:oo(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var o=Ni();return{prefix:o,iconName:oo(o,t)||t}}}},Zn={noAuto:rF,config:ve,dom:iF,parse:oF,library:Ow,findIconDefinition:wp,toHtml:yu},aF=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?wt:n;(Object.keys(mr.styles).length>0||ve.autoFetchSvg)&&ni&&ve.autoReplaceSvg&&Zn.dom.i2svg({node:r})};function lf(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return yu(r)})}}),Object.defineProperty(e,"node",{get:function(){if(ni){var r=wt.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function sF(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,a=e.transform;if(mv(a)&&n.found&&!r.found){var s=n.width,u=n.height,c={x:s/u/2,y:.5};i.style=sf(pe(pe({},o),{},{"transform-origin":"".concat(c.x+a.x/16,"em ").concat(c.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function uF(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 Sv(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,c=e.maskId,l=e.titleId,f=e.extra,d=e.watchable,p=d===void 0?!1:d,h=r.found?r:n,v=h.width,E=h.height,x=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(" "),C={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(E)})},w=x&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/E*16*.0625,"em")}:{};p&&(C.attributes[xo]=""),u&&(C.children.push({tag:"title",attributes:{id:C.attributes["aria-labelledby"]||"title-".concat(l||Ys())},children:[u]}),delete C.attributes.title);var b=pe(pe({},C),{},{prefix:i,iconName:o,main:n,mask:r,maskId:c,transform:a,symbol:s,styles:pe(pe({},w),f.styles)}),T=r.found&&n.found?Zr("generateAbstractMask",b)||{children:[],attributes:{}}:Zr("generateAbstractIcon",b)||{children:[],attributes:{}},A=T.children,D=T.attributes;return b.children=A,b.attributes=D,s?uF(b):sF(b)}function ky(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,c=pe(pe(pe({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});u&&(c[xo]="");var l=pe({},a.styles);mv(i)&&(l.transform=Fq({transform:i,startCentered:!0,width:n,height:r}),l["-webkit-transform"]=l.transform);var f=sf(l);f.length>0&&(c.style=f);var d=[];return d.push({tag:"span",attributes:c,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function cF(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=sf(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 Rf=mr.styles;function xp(e){var t=e[0],n=e[1],r=e.slice(4),i=lv(r,1),o=i[0],a=null;return Array.isArray(o)?a={tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(io.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(io.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(io.PRIMARY),fill:"currentColor",d:o[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:t,height:n,icon:a}}var lF={found:!1,width:512,height:512};function fF(e,t){!vw&&!ve.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Ep(e,t){var n=t;return t==="fa"&&ve.styleDefault!==null&&(t=Ni()),new Promise(function(r,i){if(Zr("missingIconAbstract"),n==="fa"){var o=$w(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&Rf[t]&&Rf[t][e]){var a=Rf[t][e];return r(xp(a))}fF(e,t),r(pe(pe({},lF),{},{icon:ve.showMissingIcons&&e?Zr("missingIconAbstract")||{}:{}}))})}var My=function(){},Tp=ve.measurePerformance&&Vu&&Vu.mark&&Vu.measure?Vu:{mark:My,measure:My},ys='FA "6.5.1"',dF=function(t){return Tp.mark("".concat(ys," ").concat(t," begins")),function(){return Dw(t)}},Dw=function(t){Tp.mark("".concat(ys," ").concat(t," ends")),Tp.measure("".concat(ys," ").concat(t),"".concat(ys," ").concat(t," begins"),"".concat(ys," ").concat(t," ends"))},Cv={begin:dF,end:Dw},Cc=function(){};function jy(e){var t=e.getAttribute?e.getAttribute(xo):null;return typeof t=="string"}function pF(e){var t=e.getAttribute?e.getAttribute(dv):null,n=e.getAttribute?e.getAttribute(pv):null;return t&&n}function hF(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)}function vF(){if(ve.autoReplaceSvg===!0)return wc.replace;var e=wc[ve.autoReplaceSvg];return e||wc.replace}function mF(e){return wt.createElementNS("http://www.w3.org/2000/svg",e)}function yF(e){return wt.createElement(e)}function Nw(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?mF:yF: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(Nw(a,{ceFn:r}))}),i}function gF(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var wc={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(Nw(i),n)}),n.getAttribute(xo)===null&&ve.keepOriginalSource){var r=wt.createComment(gF(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~vv(n).indexOf(ve.replacementClass))return wc.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 yu(s)}).join(`
|
|
952
|
-
`);n.setAttribute(xo,""),n.innerHTML=a}};function _y(e){e()}function
|
|
953
|
-
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function
|
|
951
|
+
}`;function SC(){var e=pC,t=hC,n=ve.cssPrefix,r=ve.replacementClass,i=qq;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 Oy=!1;function Nf(){ve.autoAddCss&&!Oy&&(Rq(SC()),Oy=!0)}var Fq={mixout:function(){return{dom:{css:SC,insertCss:Nf}}},hooks:function(){return{beforeDOMElementCreation:function(){Nf()},beforeI2svg:function(){Nf()}}}},Xr=Di||{};Xr[Yr]||(Xr[Yr]={});Xr[Yr].styles||(Xr[Yr].styles={});Xr[Yr].hooks||(Xr[Yr].hooks={});Xr[Yr].shims||(Xr[Yr].shims=[]);var mr=Xr[Yr],wC=[],Lq=function e(){Ct.removeEventListener("DOMContentLoaded",e),Xc=1,wC.map(function(t){return t()})},Xc=!1;ei&&(Xc=(Ct.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Ct.readyState),Xc||Ct.addEventListener("DOMContentLoaded",Lq));function Bq(e){ei&&(Xc?setTimeout(e,0):wC.push(e))}function yu(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"?bC(e):"<".concat(t," ").concat(Mq(r),">").concat(o.map(yu).join(""),"</").concat(t,">")}function Dy(e,t,n){if(e&&e[t]&&e[t][n])return{prefix:t,iconName:n,icon:e[t][n]}}var Vq=function(t,n){return function(r,i,o,a){return t.call(n,r,i,o,a)}},Pf=function(t,n,r,i){var o=Object.keys(t),a=o.length,s=i!==void 0?Vq(n,i):n,u,c,l;for(r===void 0?(u=1,l=t[o[0]]):(u=0,l=r);u<a;u++)c=o[u],l=s(l,t[c],c,t);return l};function Uq(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 bp(e){var t=Uq(e);return t.length===1?t[0].toString(16):null}function Gq(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 Ny(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 Sp(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=Ny(t);typeof mr.hooks.addPack=="function"&&!i?mr.hooks.addPack(e,Ny(t)):mr.styles[e]=pe(pe({},mr.styles[e]||{}),o),e==="fas"&&Sp("fa",t)}var Ku,Yu,Xu,sa=mr.styles,zq=mr.shims,Wq=(Ku={},Qt(Ku,St,Object.values(Ws[St])),Qt(Ku,Rt,Object.values(Ws[Rt])),Ku),yv=null,CC={},xC={},EC={},TC={},IC={},Hq=(Yu={},Qt(Yu,St,Object.keys(Gs[St])),Qt(Yu,Rt,Object.keys(Gs[Rt])),Yu);function Kq(e){return~$q.indexOf(e)}function Yq(e,t){var n=t.split("-"),r=n[0],i=n.slice(1).join("-");return r===e&&i!==""&&!Kq(i)?i:null}var AC=function(){var t=function(o){return Pf(sa,function(a,s,u){return a[u]=Pf(s,o,{}),a},{})};CC=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}),xC=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}),IC=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 sa||ve.autoFetchSvg,r=Pf(zq,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:{}});EC=r.names,TC=r.unicodes,yv=uf(ve.styleDefault,{family:ve.familyDefault})};Pq(function(e){yv=uf(e.styleDefault,{family:ve.familyDefault})});AC();function gv(e,t){return(CC[e]||{})[t]}function Xq(e,t){return(xC[e]||{})[t]}function oo(e,t){return(IC[e]||{})[t]}function $C(e){return EC[e]||{prefix:null,iconName:null}}function Jq(e){var t=TC[e],n=gv("fas",e);return t||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function Ni(){return yv}var bv=function(){return{prefix:null,iconName:null,rest:[]}};function uf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.family,r=n===void 0?St:n,i=Gs[r][e],o=zs[r][e]||zs[r][i],a=e in mr.styles?e:null;return o||a||null}var Py=(Xu={},Qt(Xu,St,Object.keys(Ws[St])),Qt(Xu,Rt,Object.keys(Ws[Rt])),Xu);function cf(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(t={},Qt(t,St,"".concat(ve.cssPrefix,"-").concat(St)),Qt(t,Rt,"".concat(ve.cssPrefix,"-").concat(Rt)),t),a=null,s=St;(e.includes(o[St])||e.some(function(c){return Py[St].includes(c)}))&&(s=St),(e.includes(o[Rt])||e.some(function(c){return Py[Rt].includes(c)}))&&(s=Rt);var u=e.reduce(function(c,l){var f=Yq(ve.cssPrefix,l);if(sa[l]?(l=Wq[s].includes(l)?Cq[s][l]:l,a=l,c.prefix=l):Hq[s].indexOf(l)>-1?(a=l,c.prefix=uf(l,{family:s})):f?c.iconName=f:l!==ve.replacementClass&&l!==o[St]&&l!==o[Rt]&&c.rest.push(l),!i&&c.prefix&&c.iconName){var d=a==="fa"?$C(c.iconName):{},p=oo(c.prefix,c.iconName);d.prefix&&(a=null),c.iconName=d.iconName||p||c.iconName,c.prefix=d.prefix||c.prefix,c.prefix==="far"&&!sa.far&&sa.fas&&!ve.autoFetchSvg&&(c.prefix="fas")}return c},bv());return(e.includes("fa-brands")||e.includes("fab"))&&(u.prefix="fab"),(e.includes("fa-duotone")||e.includes("fad"))&&(u.prefix="fad"),!u.prefix&&s===Rt&&(sa.fass||ve.autoFetchSvg)&&(u.prefix="fass",u.iconName=oo(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||a==="fa")&&(u.prefix=Ni()||"fas"),u}var Qq=function(){function e(){lq(this,e),this.definitions={}}return fq(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]),Sp(s,a[s]);var u=Ws[St][s];u&&Sp(u,a[s]),AC()})}},{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,c=a.icon,l=c[2];n[s]||(n[s]={}),l.length>0&&l.forEach(function(f){typeof f=="string"&&(n[s][f]=c)}),n[s][u]=c}),n}}]),e}(),Ry=[],ua={},va={},Zq=Object.keys(va);function eF(e,t){var n=t.mixoutsTo;return Ry=e,ua={},Object.keys(va).forEach(function(r){Zq.indexOf(r)===-1&&delete va[r]}),Ry.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){ua[a]||(ua[a]=[]),ua[a].push(o[a])})}r.provides&&r.provides(va)}),n}function wp(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=ua[e]||[];return o.forEach(function(a){t=a.apply(null,[t].concat(r))}),t}function Eo(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=ua[e]||[];i.forEach(function(o){o.apply(null,n)})}function Jr(){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);return va[e]?va[e].apply(null,t):void 0}function Cp(e){e.prefix==="fa"&&(e.prefix="fas");var t=e.iconName,n=e.prefix||Ni();if(t)return t=oo(n,t)||t,Dy(OC.definitions,n,t)||Dy(mr.styles,n,t)}var OC=new Qq,tF=function(){ve.autoReplaceSvg=!1,ve.observeMutations=!1,Eo("noAuto")},nF={i2svg:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ei?(Eo("beforeI2svg",t),Jr("pseudoElements2svg",t),Jr("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,Bq(function(){iF({autoReplaceSvgRoot:n}),Eo("watch",t)})}},rF={icon:function(t){if(t===null)return null;if(Yc(t)==="object"&&t.prefix&&t.iconName)return{prefix:t.prefix,iconName:oo(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=uf(t[0]);return{prefix:r,iconName:oo(r,n)||n}}if(typeof t=="string"&&(t.indexOf("".concat(ve.cssPrefix,"-"))>-1||t.match(xq))){var i=cf(t.split(" "),{skipLookups:!0});return{prefix:i.prefix||Ni(),iconName:oo(i.prefix,i.iconName)||i.iconName}}if(typeof t=="string"){var o=Ni();return{prefix:o,iconName:oo(o,t)||t}}}},Zn={noAuto:tF,config:ve,dom:nF,parse:rF,library:OC,findIconDefinition:Cp,toHtml:yu},iF=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.autoReplaceSvgRoot,r=n===void 0?Ct:n;(Object.keys(mr.styles).length>0||ve.autoFetchSvg)&&ei&&ve.autoReplaceSvg&&Zn.dom.i2svg({node:r})};function lf(e,t){return Object.defineProperty(e,"abstract",{get:t}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(function(r){return yu(r)})}}),Object.defineProperty(e,"node",{get:function(){if(ei){var r=Ct.createElement("div");return r.innerHTML=e.html,r.children}}}),e}function oF(e){var t=e.children,n=e.main,r=e.mask,i=e.attributes,o=e.styles,a=e.transform;if(mv(a)&&n.found&&!r.found){var s=n.width,u=n.height,c={x:s/u/2,y:.5};i.style=sf(pe(pe({},o),{},{"transform-origin":"".concat(c.x+a.x/16,"em ").concat(c.y+a.y/16,"em")}))}return[{tag:"svg",attributes:i,children:t}]}function aF(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 Sv(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,c=e.maskId,l=e.titleId,f=e.extra,d=e.watchable,p=d===void 0?!1:d,h=r.found?r:n,v=h.width,E=h.height,x=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(" "),S={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(E)})},C=x&&!~f.classes.indexOf("fa-fw")?{width:"".concat(v/E*16*.0625,"em")}:{};p&&(S.attributes[xo]=""),u&&(S.children.push({tag:"title",attributes:{id:S.attributes["aria-labelledby"]||"title-".concat(l||Ks())},children:[u]}),delete S.attributes.title);var b=pe(pe({},S),{},{prefix:i,iconName:o,main:n,mask:r,maskId:c,transform:a,symbol:s,styles:pe(pe({},C),f.styles)}),T=r.found&&n.found?Jr("generateAbstractMask",b)||{children:[],attributes:{}}:Jr("generateAbstractIcon",b)||{children:[],attributes:{}},A=T.children,D=T.attributes;return b.children=A,b.attributes=D,s?aF(b):oF(b)}function ky(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,c=pe(pe(pe({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});u&&(c[xo]="");var l=pe({},a.styles);mv(i)&&(l.transform=_q({transform:i,startCentered:!0,width:n,height:r}),l["-webkit-transform"]=l.transform);var f=sf(l);f.length>0&&(c.style=f);var d=[];return d.push({tag:"span",attributes:c,children:[t]}),o&&d.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),d}function sF(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=sf(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 Rf=mr.styles;function xp(e){var t=e[0],n=e[1],r=e.slice(4),i=lv(r,1),o=i[0],a=null;return Array.isArray(o)?a={tag:"g",attributes:{class:"".concat(ve.cssPrefix,"-").concat(io.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(io.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ve.cssPrefix,"-").concat(io.PRIMARY),fill:"currentColor",d:o[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:t,height:n,icon:a}}var uF={found:!1,width:512,height:512};function cF(e,t){!vC&&!ve.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(t,'" is missing.'))}function Ep(e,t){var n=t;return t==="fa"&&ve.styleDefault!==null&&(t=Ni()),new Promise(function(r,i){if(Jr("missingIconAbstract"),n==="fa"){var o=$C(e)||{};e=o.iconName||e,t=o.prefix||t}if(e&&t&&Rf[t]&&Rf[t][e]){var a=Rf[t][e];return r(xp(a))}cF(e,t),r(pe(pe({},uF),{},{icon:ve.showMissingIcons&&e?Jr("missingIconAbstract")||{}:{}}))})}var My=function(){},Tp=ve.measurePerformance&&Vu&&Vu.mark&&Vu.measure?Vu:{mark:My,measure:My},ms='FA "6.5.1"',lF=function(t){return Tp.mark("".concat(ms," ").concat(t," begins")),function(){return DC(t)}},DC=function(t){Tp.mark("".concat(ms," ").concat(t," ends")),Tp.measure("".concat(ms," ").concat(t),"".concat(ms," ").concat(t," begins"),"".concat(ms," ").concat(t," ends"))},wv={begin:lF,end:DC},wc=function(){};function jy(e){var t=e.getAttribute?e.getAttribute(xo):null;return typeof t=="string"}function fF(e){var t=e.getAttribute?e.getAttribute(dv):null,n=e.getAttribute?e.getAttribute(pv):null;return t&&n}function dF(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(ve.replacementClass)}function pF(){if(ve.autoReplaceSvg===!0)return Cc.replace;var e=Cc[ve.autoReplaceSvg];return e||Cc.replace}function hF(e){return Ct.createElementNS("http://www.w3.org/2000/svg",e)}function vF(e){return Ct.createElement(e)}function NC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.ceFn,r=n===void 0?e.tag==="svg"?hF:vF:n;if(typeof e=="string")return Ct.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(NC(a,{ceFn:r}))}),i}function mF(e){var t=" ".concat(e.outerHTML," ");return t="".concat(t,"Font Awesome fontawesome.com "),t}var Cc={replace:function(t){var n=t[0];if(n.parentNode)if(t[1].forEach(function(i){n.parentNode.insertBefore(NC(i),n)}),n.getAttribute(xo)===null&&ve.keepOriginalSource){var r=Ct.createComment(mF(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(t){var n=t[0],r=t[1];if(~vv(n).indexOf(ve.replacementClass))return Cc.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 yu(s)}).join(`
|
|
952
|
+
`);n.setAttribute(xo,""),n.innerHTML=a}};function _y(e){e()}function PC(e,t){var n=typeof t=="function"?t:wc;if(e.length===0)n();else{var r=_y;ve.mutateApproach===Sq&&(r=Di.requestAnimationFrame||_y),r(function(){var i=pF(),o=wv.begin("mutate");e.map(i),o(),n()})}}var Cv=!1;function RC(){Cv=!0}function Ip(){Cv=!1}var Jc=null;function qy(e){if(Ay&&ve.observeMutations){var t=e.treeCallback,n=t===void 0?wc:t,r=e.nodeCallback,i=r===void 0?wc:r,o=e.pseudoElementsCallback,a=o===void 0?wc:o,s=e.observeMutationsRoot,u=s===void 0?Ct:s;Jc=new Ay(function(c){if(!Cv){var l=Ni();Wa(c).forEach(function(f){if(f.type==="childList"&&f.addedNodes.length>0&&!jy(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"&&jy(f.target)&&~Aq.indexOf(f.attributeName))if(f.attributeName==="class"&&fF(f.target)){var d=cf(vv(f.target)),p=d.prefix,h=d.iconName;f.target.setAttribute(dv,p||l),h&&f.target.setAttribute(pv,h)}else dF(f.target)&&i(f.target)})}}),ei&&Jc.observe(u,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function yF(){Jc&&Jc.disconnect()}function gF(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 bF(e){var t=e.getAttribute("data-prefix"),n=e.getAttribute("data-icon"),r=e.innerText!==void 0?e.innerText.trim():"",i=cf(vv(e));return i.prefix||(i.prefix=Ni()),t&&n&&(i.prefix=t,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=Xq(i.prefix,e.innerText)||gv(i.prefix,bp(e.innerText))),!i.iconName&&ve.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=e.firstChild.data)),i}function SF(e){var t=Wa(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||Ks()):(t["aria-hidden"]="true",t.focusable="false")),t}function wF(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Ir,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function Fy(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=bF(e),r=n.iconName,i=n.prefix,o=n.rest,a=SF(e),s=wp("parseNodeAttributes",{},e),u=t.styleParser?gF(e):[];return pe({iconName:r,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:Ir,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:u,attributes:a}},s)}var CF=mr.styles;function kC(e){var t=ve.autoReplaceSvg==="nest"?Fy(e,{styleParser:!1}):Fy(e);return~t.extra.classes.indexOf(mC)?Jr("generateLayersText",e,t):Jr("generateSvgReplacementMutation",e,t)}var Pi=new Set;hv.map(function(e){Pi.add("fa-".concat(e))});Object.keys(Gs[St]).map(Pi.add.bind(Pi));Object.keys(Gs[Rt]).map(Pi.add.bind(Pi));Pi=vu(Pi);function Ly(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ei)return Promise.resolve();var n=Ct.documentElement.classList,r=function(f){return n.add("".concat($y,"-").concat(f))},i=function(f){return n.remove("".concat($y,"-").concat(f))},o=ve.autoFetchSvg?Pi:hv.map(function(l){return"fa-".concat(l)}).concat(Object.keys(CF));o.includes("fa")||o.push("fa");var a=[".".concat(mC,":not([").concat(xo,"])")].concat(o.map(function(l){return".".concat(l,":not([").concat(xo,"])")})).join(", ");if(a.length===0)return Promise.resolve();var s=[];try{s=Wa(e.querySelectorAll(a))}catch{}if(s.length>0)r("pending"),i("complete");else return Promise.resolve();var u=wv.begin("onTree"),c=s.reduce(function(l,f){try{var d=kC(f);d&&l.push(d)}catch(p){vC||p.name==="MissingIcon"&&console.error(p)}return l},[]);return new Promise(function(l,f){Promise.all(c).then(function(d){PC(d,function(){r("active"),r("complete"),i("pending"),typeof t=="function"&&t(),u(),l()})}).catch(function(d){u(),f(d)})})}function xF(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;kC(e).then(function(n){n&&PC([n],t)})}function EF(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(t||{}).icon?t:Cp(t||{}),i=n.mask;return i&&(i=(i||{}).icon?i:Cp(i||{})),e(r,pe(pe({},n),{},{mask:i}))}}var TF=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?Ir:r,o=n.symbol,a=o===void 0?!1:o,s=n.mask,u=s===void 0?null:s,c=n.maskId,l=c===void 0?null:c,f=n.title,d=f===void 0?null:f,p=n.titleId,h=p===void 0?null:p,v=n.classes,E=v===void 0?[]:v,x=n.attributes,m=x===void 0?{}:x,S=n.styles,C=S===void 0?{}:S;if(t){var b=t.prefix,T=t.iconName,A=t.icon;return lf(pe({type:"icon"},t),function(){return Eo("beforeDOMElementCreation",{iconDefinition:t,params:n}),ve.autoA11y&&(d?m["aria-labelledby"]="".concat(ve.replacementClass,"-title-").concat(h||Ks()):(m["aria-hidden"]="true",m.focusable="false")),Sv({icons:{main:xp(A),mask:u?xp(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:b,iconName:T,transform:pe(pe({},Ir),i),symbol:a,title:d,maskId:l,titleId:h,extra:{attributes:m,styles:C,classes:E}})})}},IF={mixout:function(){return{icon:EF(TF)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=Ly,n.nodeCallback=xF,n}}},provides:function(t){t.i2svg=function(n){var r=n.node,i=r===void 0?Ct:r,o=n.callback,a=o===void 0?function(){}:o;return Ly(i,a)},t.generateSvgReplacementMutation=function(n,r){var i=r.iconName,o=r.title,a=r.titleId,s=r.prefix,u=r.transform,c=r.symbol,l=r.mask,f=r.maskId,d=r.extra;return new Promise(function(p,h){Promise.all([Ep(i,s),l.iconName?Ep(l.iconName,l.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(v){var E=lv(v,2),x=E[0],m=E[1];p([n,Sv({icons:{main:x,mask:m},prefix:s,iconName:i,transform:u,symbol:c,maskId:f,title:o,titleId:a,extra:d,watchable:!0})])}).catch(h)})},t.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,o=n.main,a=n.transform,s=n.styles,u=sf(s);u.length>0&&(i.style=u);var c;return mv(a)&&(c=Jr("generateAbstractTransformGrouping",{main:o,transform:a,containerWidth:o.width,iconWidth:o.width})),r.push(c||o.icon),{children:r,attributes:i}}}},AF={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 lf({type:"layer"},function(){Eo("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(vu(o)).join(" ")},children:a}]})}}}},$F={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,c=u===void 0?{}:u,l=r.styles,f=l===void 0?{}:l;return lf({type:"counter",content:n},function(){return Eo("beforeDOMElementCreation",{content:n,params:r}),sF({content:n.toString(),title:o,extra:{attributes:c,styles:f,classes:["".concat(ve.cssPrefix,"-layers-counter")].concat(vu(s))}})})}}}},OF={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,o=i===void 0?Ir:i,a=r.title,s=a===void 0?null:a,u=r.classes,c=u===void 0?[]:u,l=r.attributes,f=l===void 0?{}:l,d=r.styles,p=d===void 0?{}:d;return lf({type:"text",content:n},function(){return Eo("beforeDOMElementCreation",{content:n,params:r}),ky({content:n,transform:pe(pe({},Ir),o),title:s,extra:{attributes:f,styles:p,classes:["".concat(ve.cssPrefix,"-layers-text")].concat(vu(c))}})})}}},provides:function(t){t.generateLayersText=function(n,r){var i=r.title,o=r.transform,a=r.extra,s=null,u=null;if(dC){var c=parseInt(getComputedStyle(n).fontSize,10),l=n.getBoundingClientRect();s=l.width/c,u=l.height/c}return ve.autoA11y&&!i&&(a.attributes["aria-hidden"]="true"),Promise.resolve([n,ky({content:n.innerHTML,width:s,height:u,transform:o,title:i,extra:a,watchable:!0})])}}},DF=new RegExp('"',"ug"),By=[1105920,1112319];function NF(e){var t=e.replace(DF,""),n=Gq(t,0),r=n>=By[0]&&n<=By[1],i=t.length===2?t[0]===t[1]:!1;return{value:bp(i?t[0]:t),isSecondary:r||i}}function Vy(e,t){var n="".concat(bq).concat(t.replace(":","-"));return new Promise(function(r,i){if(e.getAttribute(n)!==null)return r();var o=Wa(e.children),a=o.filter(function(A){return A.getAttribute(gp)===t})[0],s=Di.getComputedStyle(e,t),u=s.getPropertyValue("font-family").match(Eq),c=s.getPropertyValue("font-weight"),l=s.getPropertyValue("content");if(a&&!u)return e.removeChild(a),r();if(u&&l!=="none"&&l!==""){var f=s.getPropertyValue("content"),d=~["Sharp"].indexOf(u[2])?Rt:St,p=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?zs[d][u[2].toLowerCase()]:Tq[d][c],h=NF(f),v=h.value,E=h.isSecondary,x=u[0].startsWith("FontAwesome"),m=gv(p,v),S=m;if(x){var C=Jq(v);C.iconName&&C.prefix&&(m=C.iconName,p=C.prefix)}if(m&&!E&&(!a||a.getAttribute(dv)!==p||a.getAttribute(pv)!==S)){e.setAttribute(n,S),a&&e.removeChild(a);var b=wF(),T=b.extra;T.attributes[gp]=t,Ep(m,p).then(function(A){var D=Sv(pe(pe({},b),{},{icons:{main:A,mask:bv()},prefix:p,iconName:S,extra:T,watchable:!0})),I=Ct.createElementNS("http://www.w3.org/2000/svg","svg");t==="::before"?e.insertBefore(I,e.firstChild):e.appendChild(I),I.outerHTML=D.map(function(N){return yu(N)}).join(`
|
|
953
|
+
`),e.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function PF(e){return Promise.all([Vy(e,"::before"),Vy(e,"::after")])}function RF(e){return e.parentNode!==document.head&&!~wq.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(gp)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function Uy(e){if(ei)return new Promise(function(t,n){var r=Wa(e.querySelectorAll("*")).filter(RF).map(PF),i=wv.begin("searchPseudoElements");RC(),Promise.all(r).then(function(){i(),Ip(),t()}).catch(function(){i(),Ip(),n()})})}var kF={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=Uy,n}}},provides:function(t){t.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?Ct:r;ve.searchPseudoElements&&Uy(i)}}},Gy=!1,MF={mixout:function(){return{dom:{unwatch:function(){RC(),Gy=!0}}}},hooks:function(){return{bootstrap:function(){qy(wp("mutationObserverCallbacks",{}))},noAuto:function(){yF()},watch:function(n){var r=n.observeMutationsRoot;Gy?Ip():qy(wp("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},zy=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)},jF={mixout:function(){return{parse:{transform:function(n){return zy(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=zy(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,") "),c="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),l="rotate(".concat(i.rotate," 0 0)"),f={transform:"".concat(u," ").concat(c," ").concat(l)},d={transform:"translate(".concat(a/2*-1," -256)")},p={outer:s,inner:f,path:d};return{tag:"g",attributes:pe({},p.outer),children:[{tag:"g",attributes:pe({},p.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:pe(pe({},r.icon.attributes),p.path)}]}]}}}},kf={x:0,y:0,width:"100%",height:"100%"};function Wy(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 _F(e){return e.tag==="g"?e.children:[e]}var qF={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),o=i?cf(i.split(" ").map(function(a){return a.trim()})):bv();return o.prefix||(o.prefix=Ni()),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,c=o.width,l=o.icon,f=a.width,d=a.icon,p=jq({transform:u,containerWidth:f,iconWidth:c}),h={tag:"rect",attributes:pe(pe({},kf),{},{fill:"white"})},v=l.children?{children:l.children.map(Wy)}:{},E={tag:"g",attributes:pe({},p.inner),children:[Wy(pe({tag:l.tag,attributes:pe(pe({},l.attributes),p.path)},v))]},x={tag:"g",attributes:pe({},p.outer),children:[E]},m="mask-".concat(s||Ks()),S="clip-".concat(s||Ks()),C={tag:"mask",attributes:pe(pe({},kf),{},{id:m,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[h,x]},b={tag:"defs",children:[{tag:"clipPath",attributes:{id:S},children:_F(d)},C]};return r.push(b,{tag:"rect",attributes:pe({fill:"currentColor","clip-path":"url(#".concat(S,")"),mask:"url(#".concat(m,")")},kf)}),{children:r,attributes:i}}}},FF={provides:function(t){var n=!1;Di.matchMedia&&(n=Di.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}}}},LF={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}}}},BF=[Fq,IF,AF,$F,OF,kF,MF,jF,qF,FF,LF];eF(BF,{mixoutsTo:Zn});Zn.noAuto;Zn.config;Zn.library;Zn.dom;var Ap=Zn.parse;Zn.findIconDefinition;Zn.toHtml;var VF=Zn.icon;Zn.layer;Zn.text;Zn.counter;var $p={exports:{}},Ju={exports:{}},nt={};/** @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 Hy;function
|
|
960
|
+
*/var Hy;function UF(){if(Hy)return nt;Hy=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,c=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function S(b){if(typeof b=="object"&&b!==null){var T=b.$$typeof;switch(T){case t:switch(b=b.type,b){case u:case c:case r:case o:case i:case f:return b;default:switch(b=b&&b.$$typeof,b){case s:case l:case h:case p:case a:return b;default:return T}}case n:return T}}}function C(b){return S(b)===c}return nt.AsyncMode=u,nt.ConcurrentMode=c,nt.ContextConsumer=s,nt.ContextProvider=a,nt.Element=t,nt.ForwardRef=l,nt.Fragment=r,nt.Lazy=h,nt.Memo=p,nt.Portal=n,nt.Profiler=o,nt.StrictMode=i,nt.Suspense=f,nt.isAsyncMode=function(b){return C(b)||S(b)===u},nt.isConcurrentMode=C,nt.isContextConsumer=function(b){return S(b)===s},nt.isContextProvider=function(b){return S(b)===a},nt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},nt.isForwardRef=function(b){return S(b)===l},nt.isFragment=function(b){return S(b)===r},nt.isLazy=function(b){return S(b)===h},nt.isMemo=function(b){return S(b)===p},nt.isPortal=function(b){return S(b)===n},nt.isProfiler=function(b){return S(b)===o},nt.isStrictMode=function(b){return S(b)===i},nt.isSuspense=function(b){return S(b)===f},nt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===c||b===o||b===i||b===f||b===d||typeof b=="object"&&b!==null&&(b.$$typeof===h||b.$$typeof===p||b.$$typeof===a||b.$$typeof===s||b.$$typeof===l||b.$$typeof===E||b.$$typeof===x||b.$$typeof===m||b.$$typeof===v)},nt.typeOf=S,nt}var rt={};/** @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 Ky;function
|
|
967
|
+
*/var Ky;function GF(){return Ky||(Ky=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,c=e?Symbol.for("react.concurrent_mode"):60111,l=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function S(ce){return typeof ce=="string"||typeof ce=="function"||ce===r||ce===c||ce===o||ce===i||ce===f||ce===d||typeof ce=="object"&&ce!==null&&(ce.$$typeof===h||ce.$$typeof===p||ce.$$typeof===a||ce.$$typeof===s||ce.$$typeof===l||ce.$$typeof===E||ce.$$typeof===x||ce.$$typeof===m||ce.$$typeof===v)}function C(ce){if(typeof ce=="object"&&ce!==null){var Dn=ce.$$typeof;switch(Dn){case t:var ni=ce.type;switch(ni){case u:case c:case r:case o:case i:case f:return ni;default:var jo=ni&&ni.$$typeof;switch(jo){case s:case l:case h:case p:case a:return jo;default:return Dn}}case n:return Dn}}}var b=u,T=c,A=s,D=a,I=t,N=l,_=r,L=h,V=p,H=n,R=o,ie=i,B=f,U=!1;function fe(ce){return U||(U=!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.")),M(ce)||C(ce)===u}function M(ce){return C(ce)===c}function P(ce){return C(ce)===s}function te(ce){return C(ce)===a}function oe(ce){return typeof ce=="object"&&ce!==null&&ce.$$typeof===t}function K(ce){return C(ce)===l}function ae(ce){return C(ce)===r}function de(ce){return C(ce)===h}function he(ce){return C(ce)===p}function xe(ce){return C(ce)===n}function Re(ce){return C(ce)===o}function De(ce){return C(ce)===i}function ht(ce){return C(ce)===f}rt.AsyncMode=b,rt.ConcurrentMode=T,rt.ContextConsumer=A,rt.ContextProvider=D,rt.Element=I,rt.ForwardRef=N,rt.Fragment=_,rt.Lazy=L,rt.Memo=V,rt.Portal=H,rt.Profiler=R,rt.StrictMode=ie,rt.Suspense=B,rt.isAsyncMode=fe,rt.isConcurrentMode=M,rt.isContextConsumer=P,rt.isContextProvider=te,rt.isElement=oe,rt.isForwardRef=K,rt.isFragment=ae,rt.isLazy=de,rt.isMemo=he,rt.isPortal=xe,rt.isProfiler=Re,rt.isStrictMode=De,rt.isSuspense=ht,rt.isValidElementType=S,rt.typeOf=C}()),rt}var Yy;function MC(){return Yy||(Yy=1,process.env.NODE_ENV==="production"?Ju.exports=UF():Ju.exports=GF()),Ju.exports}/*
|
|
968
968
|
object-assign
|
|
969
969
|
(c) Sindre Sorhus
|
|
970
970
|
@license MIT
|
|
971
|
-
*/var Mf,Xy;function
|
|
972
|
-
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var ce=ht(he,De,K,ae,de+"."+De,n);if(ce)return ce}return null}return E(P)}function H(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(H);if(M===null||s(M))return!0;var P=f(M);if(P){var te=P.call(M),oe;if(P!==M.entries){for(;!(oe=te.next()).done;)if(!H(oe.value))return!1}else for(;!(oe=te.next()).done;){var K=oe.value;if(K&&!H(K[1]))return!1}}else return!1;return!0;default:return!1}}function R(M,P){return M==="symbol"?!0:P?P["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&P instanceof Symbol:!1}function ie(M){var P=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":R(P,M)?"symbol":P}function B(M){if(typeof M>"u"||M===null)return""+M;var P=ie(M);if(P==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return P}function U(M){var P=B(M);switch(P){case"array":case"object":return"an "+P;case"boolean":case"date":case"regexp":return"a "+P;default:return P}}function fe(M){return!M.constructor||!M.constructor.name?d:M.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Ff}var Lf,tg;function
|
|
973
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aL(e){var t,n=e.beat,r=e.fade,i=e.beatFade,o=e.bounce,a=e.shake,s=e.flash,u=e.spin,c=e.spinPulse,l=e.spinReverse,f=e.pulse,d=e.fixedWidth,p=e.inverse,h=e.border,v=e.listItem,E=e.flip,x=e.size,m=e.rotation,C=e.pull,w=(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":l,"fa-spin-pulse":c,"fa-pulse":f,"fa-fw":d,"fa-inverse":p,"fa-border":h,"fa-li":v,"fa-flip":E===!0,"fa-flip-horizontal":E==="horizontal"||E==="both","fa-flip-vertical":E==="vertical"||E==="both"},la(t,"fa-".concat(x),typeof x<"u"&&x!==null),la(t,"fa-rotate-".concat(m),typeof m<"u"&&m!==null&&m!==0),la(t,"fa-pull-".concat(C),typeof C<"u"&&C!==null),la(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(w).map(function(b){return w[b]?b:null}).filter(function(b){return b})}function sL(e){return e=e-0,e===e}function _w(e){return sL(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(t,n){return n?n.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var uL=["style"];function cL(e){return e.charAt(0).toUpperCase()+e.slice(1)}function lL(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),i=_w(n.slice(0,r)),o=n.slice(r+1).trim();return i.startsWith("webkit")?t[cL(i)]=o:t[i]=o,t},{})}function qw(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 qw(e,u)}),i=Object.keys(t.attributes||{}).reduce(function(u,c){var l=t.attributes[c];switch(c){case"class":u.attrs.className=l,delete t.attributes.class;break;case"style":u.attrs.style=lL(l);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?u.attrs[c.toLowerCase()]=l:u.attrs[_w(c)]=l}return u},{attrs:{}}),o=n.style,a=o===void 0?{}:o,s=tL(n,uL);return i.attrs.style=yi(yi({},i.attrs.style),a),e.apply(void 0,[t.tag,yi(yi({},i.attrs),s)].concat(Op(r)))}var Fw=!1;try{Fw=process.env.NODE_ENV==="production"}catch{}function fL(){if(!Fw&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function rg(e){if(e&&Qc(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Ap.icon)return Ap.icon(e);if(e===null)return null;if(e&&Qc(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 Bf(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?la({},e,t):{}}var Ri=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,c=rg(n),l=Bf("classes",[].concat(Op(aL(e)),Op(o.split(" ")))),f=Bf("transform",typeof e.transform=="string"?Ap.transform(e.transform):e.transform),d=Bf("mask",rg(r)),p=GF(c,yi(yi(yi(yi({},l),f),d),{},{symbol:i,title:a,titleId:s,maskId:u}));if(!p)return fL("Could not find icon",c),null;var h=p.abstract,v={ref:t};return Object.keys(e).forEach(function(E){Ri.defaultProps.hasOwnProperty(E)||(v[E]=e[E])}),dL(h[0],v)});Ri.displayName="FontAwesomeIcon";Ri.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};Ri.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 dL=qw.bind(null,O.createElement);function Lw(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=Lw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function pL(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Lw(e))&&(r&&(r+=" "),r+=t);return r}var Zc=Xv&&Xv.__assign||function(){return Zc=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},Zc.apply(this,arguments)};function hL(e,t,n){if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style=Zc(Zc({},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 vL=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)hL(r,o,i[o]);return r},{})};const Bw=Eb(vL);function Yo(){}function mL(){return!0}function rs(e){return!!(e||"").match(/\d/)}function ig(e){return e==null}function og(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function yL(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 gL(e,t,n){var r=yL(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 Np(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 bL(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 Vw(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function ag(e,t){return Array(t+1).join(e)}function SL(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."+ag("0",Math.abs(o))+r:o>=a?r=r+ag("0",o-a):r=(r.substring(0,o)||"0")+"."+r.substring(o),t+r}function CL(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=e.indexOf(".")!==-1&&t,i=Np(e),o=i.beforeDecimal,a=i.afterDecimal,s=i.hasNagation,u=parseFloat("0."+(a||"0")),c=a.length<=t?"0."+a:u.toFixed(t),l=c.split("."),f=o.split("").reverse().reduce(function(v,E,x){return v.length>x?(Number(v[0])+Number(E)).toString()+v.substring(1,v.length):E+v},l[0]),d=Vw(l[1]||"",Math.min(t,a.length),n),p=s?"-":"",h=r?".":"";return""+p+f+h+d}function sg(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 wL(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 Vf(e,t,n){return Math.min(Math.max(e,t),n)}function ug(e){return Math.max(e.selectionStart,e.selectionEnd)}function xL(e){return e||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function EL(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 TL={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:Yo,onChange:Yo,onKeyDown:Yo,onMouseUp:Yo,onFocus:Yo,onBlur:Yo,isAllowed:mL},Uw=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,c=a.numAsString;if(c===void 0&&(c=""),r!==o){this.validateProps();var l=this.formatNumString(c),f=ig(o.value)?l:this.formatValueProp(),d=this.removeFormatting(f),p=parseFloat(d),h=parseFloat(c);((!isNaN(p)||!isNaN(h))&&p!==h||l!==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),c=r[0]==="-";c&&(r=r.replace("-","")),s&&o===0&&(r=r.split(s)[0]),r=(r.match(u)||[]).join("").replace(s,".");var l=r.indexOf(".");return l!==-1&&(r=r.substring(0,l)+"."+r.substring(l+1,r.length).replace(new RegExp(og(s),"g"),"")),c&&(r="-"+r),r},t.prototype.getNumberRegex=function(r,i){var o=this.props,a=o.format,s=o.decimalScale,u=o.customNumerals,c=this.getSeparators(),l=c.decimalSeparator;return new RegExp("[0-9"+(u?u.join(""):"")+"]"+(l&&s!==0&&!i&&!a?"|"+og(l):""),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(`
|
|
971
|
+
*/var Mf,Xy;function zF(){if(Xy)return Mf;Xy=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(l){return a[l]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(l){c[l]=l}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Mf=i()?Object.assign:function(o,a){for(var s,u=r(o),c,l=1;l<arguments.length;l++){s=Object(arguments[l]);for(var f in s)t.call(s,f)&&(u[f]=s[f]);if(e){c=e(s);for(var d=0;d<c.length;d++)n.call(s,c[d])&&(u[c[d]]=s[c[d]])}}return u},Mf}var jf,Jy;function xv(){if(Jy)return jf;Jy=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return jf=e,jf}var _f,Qy;function jC(){return Qy||(Qy=1,_f=Function.call.bind(Object.prototype.hasOwnProperty)),_f}var qf,Zy;function WF(){if(Zy)return qf;Zy=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=xv(),n={},r=jC();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,c){if(process.env.NODE_ENV!=="production"){for(var l in o)if(r(o,l)){var f;try{if(typeof o[l]!="function"){var d=Error((u||"React class")+": "+s+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=o[l](a,l,u,s,null,t)}catch(h){f=h}if(f&&!(f instanceof Error)&&e((u||"React class")+": type specification of "+s+" `"+l+"` 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 p=c?c():"";e("Failed "+s+" type: "+f.message+(p??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},qf=i,qf}var Ff,eg;function HF(){if(eg)return Ff;eg=1;var e=MC(),t=zF(),n=xv(),r=jC(),i=WF(),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 Ff=function(s,u){var c=typeof Symbol=="function"&&Symbol.iterator,l="@@iterator";function f(M){var P=M&&(c&&M[c]||M[l]);if(typeof P=="function")return P}var d="<<anonymous>>",p={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:m(),arrayOf:S,element:C(),elementType:b(),instanceOf:T,node:N(),objectOf:D,oneOf:A,oneOfType:I,shape:L,exact:V};function h(M,P){return M===P?M!==0||1/M===1/P:M!==M&&P!==P}function v(M,P){this.message=M,this.data=P&&typeof P=="object"?P:{},this.stack=""}v.prototype=Error.prototype;function E(M){if(process.env.NODE_ENV!=="production")var P={},te=0;function oe(ae,de,he,xe,Re,De,ht){if(xe=xe||d,De=De||he,ht!==n){if(u){var ce=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 ce.name="Invariant Violation",ce}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Dn=xe+":"+he;!P[Dn]&&te<3&&(o("You are manually calling a React.PropTypes validation function for the `"+De+"` prop on `"+xe+"`. 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."),P[Dn]=!0,te++)}}return de[he]==null?ae?de[he]===null?new v("The "+Re+" `"+De+"` is marked as required "+("in `"+xe+"`, but its value is `null`.")):new v("The "+Re+" `"+De+"` is marked as required in "+("`"+xe+"`, but its value is `undefined`.")):null:M(de,he,xe,Re,De)}var K=oe.bind(null,!1);return K.isRequired=oe.bind(null,!0),K}function x(M){function P(te,oe,K,ae,de,he){var xe=te[oe],Re=ie(xe);if(Re!==M){var De=B(xe);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+De+"` supplied to `"+K+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return E(P)}function m(){return E(a)}function S(M){function P(te,oe,K,ae,de){if(typeof M!="function")return new v("Property `"+de+"` of component `"+K+"` has invalid PropType notation inside arrayOf.");var he=te[oe];if(!Array.isArray(he)){var xe=ie(he);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+xe+"` supplied to `"+K+"`, expected an array."))}for(var Re=0;Re<he.length;Re++){var De=M(he,Re,K,ae,de+"["+Re+"]",n);if(De instanceof Error)return De}return null}return E(P)}function C(){function M(P,te,oe,K,ae){var de=P[te];if(!s(de)){var he=ie(de);return new v("Invalid "+K+" `"+ae+"` of type "+("`"+he+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return E(M)}function b(){function M(P,te,oe,K,ae){var de=P[te];if(!e.isValidElementType(de)){var he=ie(de);return new v("Invalid "+K+" `"+ae+"` of type "+("`"+he+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return E(M)}function T(M){function P(te,oe,K,ae,de){if(!(te[oe]instanceof M)){var he=M.name||d,xe=fe(te[oe]);return new v("Invalid "+ae+" `"+de+"` of type "+("`"+xe+"` supplied to `"+K+"`, expected ")+("instance of `"+he+"`."))}return null}return E(P)}function A(M){if(!Array.isArray(M))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 P(te,oe,K,ae,de){for(var he=te[oe],xe=0;xe<M.length;xe++)if(h(he,M[xe]))return null;var Re=JSON.stringify(M,function(ht,ce){var Dn=B(ce);return Dn==="symbol"?String(ce):ce});return new v("Invalid "+ae+" `"+de+"` of value `"+String(he)+"` "+("supplied to `"+K+"`, expected one of "+Re+"."))}return E(P)}function D(M){function P(te,oe,K,ae,de){if(typeof M!="function")return new v("Property `"+de+"` of component `"+K+"` has invalid PropType notation inside objectOf.");var he=te[oe],xe=ie(he);if(xe!=="object")return new v("Invalid "+ae+" `"+de+"` of type "+("`"+xe+"` supplied to `"+K+"`, expected an object."));for(var Re in he)if(r(he,Re)){var De=M(he,Re,K,ae,de+"."+Re,n);if(De instanceof Error)return De}return null}return E(P)}function I(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var P=0;P<M.length;P++){var te=M[P];if(typeof te!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(te)+" at index "+P+"."),a}function oe(K,ae,de,he,xe){for(var Re=[],De=0;De<M.length;De++){var ht=M[De],ce=ht(K,ae,de,he,xe,n);if(ce==null)return null;ce.data&&r(ce.data,"expectedType")&&Re.push(ce.data.expectedType)}var Dn=Re.length>0?", expected one of type ["+Re.join(", ")+"]":"";return new v("Invalid "+he+" `"+xe+"` supplied to "+("`"+de+"`"+Dn+"."))}return E(oe)}function N(){function M(P,te,oe,K,ae){return H(P[te])?null:new v("Invalid "+K+" `"+ae+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return E(M)}function _(M,P,te,oe,K){return new v((M||"React class")+": "+P+" type `"+te+"."+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+K+"`.")}function L(M){function P(te,oe,K,ae,de){var he=te[oe],xe=ie(he);if(xe!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+xe+"` "+("supplied to `"+K+"`, expected `object`."));for(var Re in M){var De=M[Re];if(typeof De!="function")return _(K,ae,de,Re,B(De));var ht=De(he,Re,K,ae,de+"."+Re,n);if(ht)return ht}return null}return E(P)}function V(M){function P(te,oe,K,ae,de){var he=te[oe],xe=ie(he);if(xe!=="object")return new v("Invalid "+ae+" `"+de+"` of type `"+xe+"` "+("supplied to `"+K+"`, expected `object`."));var Re=t({},te[oe],M);for(var De in Re){var ht=M[De];if(r(M,De)&&typeof ht!="function")return _(K,ae,de,De,B(ht));if(!ht)return new v("Invalid "+ae+" `"+de+"` key `"+De+"` supplied to `"+K+"`.\nBad object: "+JSON.stringify(te[oe],null," ")+`
|
|
972
|
+
Valid keys: `+JSON.stringify(Object.keys(M),null," "));var ce=ht(he,De,K,ae,de+"."+De,n);if(ce)return ce}return null}return E(P)}function H(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(H);if(M===null||s(M))return!0;var P=f(M);if(P){var te=P.call(M),oe;if(P!==M.entries){for(;!(oe=te.next()).done;)if(!H(oe.value))return!1}else for(;!(oe=te.next()).done;){var K=oe.value;if(K&&!H(K[1]))return!1}}else return!1;return!0;default:return!1}}function R(M,P){return M==="symbol"?!0:P?P["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&P instanceof Symbol:!1}function ie(M){var P=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":R(P,M)?"symbol":P}function B(M){if(typeof M>"u"||M===null)return""+M;var P=ie(M);if(P==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return P}function U(M){var P=B(M);switch(P){case"array":case"object":return"an "+P;case"boolean":case"date":case"regexp":return"a "+P;default:return P}}function fe(M){return!M.constructor||!M.constructor.name?d:M.constructor.name}return p.checkPropTypes=i,p.resetWarningCache=i.resetWarningCache,p.PropTypes=p,p},Ff}var Lf,tg;function KF(){if(tg)return Lf;tg=1;var e=xv();function t(){}function n(){}return n.resetWarningCache=t,Lf=function(){function r(a,s,u,c,l,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},Lf}if(process.env.NODE_ENV!=="production"){var YF=MC(),XF=!0;$p.exports=HF()(YF.isElement,XF)}else $p.exports=KF()();var JF=$p.exports;const _e=Eb(JF);function ng(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 vi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ng(Object(n),!0).forEach(function(r){ca(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ng(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qc(e){"@babel/helpers - typeof";return Qc=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},Qc(e)}function ca(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QF(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 ZF(e,t){if(e==null)return{};var n=QF(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 Op(e){return eL(e)||tL(e)||nL(e)||rL()}function eL(e){if(Array.isArray(e))return Dp(e)}function tL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nL(e,t){if(e){if(typeof e=="string")return Dp(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 Dp(e,t)}}function Dp(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 rL(){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 iL(e){var t,n=e.beat,r=e.fade,i=e.beatFade,o=e.bounce,a=e.shake,s=e.flash,u=e.spin,c=e.spinPulse,l=e.spinReverse,f=e.pulse,d=e.fixedWidth,p=e.inverse,h=e.border,v=e.listItem,E=e.flip,x=e.size,m=e.rotation,S=e.pull,C=(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":l,"fa-spin-pulse":c,"fa-pulse":f,"fa-fw":d,"fa-inverse":p,"fa-border":h,"fa-li":v,"fa-flip":E===!0,"fa-flip-horizontal":E==="horizontal"||E==="both","fa-flip-vertical":E==="vertical"||E==="both"},ca(t,"fa-".concat(x),typeof x<"u"&&x!==null),ca(t,"fa-rotate-".concat(m),typeof m<"u"&&m!==null&&m!==0),ca(t,"fa-pull-".concat(S),typeof S<"u"&&S!==null),ca(t,"fa-swap-opacity",e.swapOpacity),t);return Object.keys(C).map(function(b){return C[b]?b:null}).filter(function(b){return b})}function oL(e){return e=e-0,e===e}function _C(e){return oL(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(t,n){return n?n.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var aL=["style"];function sL(e){return e.charAt(0).toUpperCase()+e.slice(1)}function uL(e){return e.split(";").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,n){var r=n.indexOf(":"),i=_C(n.slice(0,r)),o=n.slice(r+1).trim();return i.startsWith("webkit")?t[sL(i)]=o:t[i]=o,t},{})}function qC(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 qC(e,u)}),i=Object.keys(t.attributes||{}).reduce(function(u,c){var l=t.attributes[c];switch(c){case"class":u.attrs.className=l,delete t.attributes.class;break;case"style":u.attrs.style=uL(l);break;default:c.indexOf("aria-")===0||c.indexOf("data-")===0?u.attrs[c.toLowerCase()]=l:u.attrs[_C(c)]=l}return u},{attrs:{}}),o=n.style,a=o===void 0?{}:o,s=ZF(n,aL);return i.attrs.style=vi(vi({},i.attrs.style),a),e.apply(void 0,[t.tag,vi(vi({},i.attrs),s)].concat(Op(r)))}var FC=!1;try{FC=process.env.NODE_ENV==="production"}catch{}function cL(){if(!FC&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function rg(e){if(e&&Qc(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Ap.icon)return Ap.icon(e);if(e===null)return null;if(e&&Qc(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 Bf(e,t){return Array.isArray(t)&&t.length>0||!Array.isArray(t)&&t?ca({},e,t):{}}var Ri=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,c=rg(n),l=Bf("classes",[].concat(Op(iL(e)),Op(o.split(" ")))),f=Bf("transform",typeof e.transform=="string"?Ap.transform(e.transform):e.transform),d=Bf("mask",rg(r)),p=VF(c,vi(vi(vi(vi({},l),f),d),{},{symbol:i,title:a,titleId:s,maskId:u}));if(!p)return cL("Could not find icon",c),null;var h=p.abstract,v={ref:t};return Object.keys(e).forEach(function(E){Ri.defaultProps.hasOwnProperty(E)||(v[E]=e[E])}),lL(h[0],v)});Ri.displayName="FontAwesomeIcon";Ri.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};Ri.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 lL=qC.bind(null,O.createElement);function LC(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=LC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fL(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=LC(e))&&(r&&(r+=" "),r+=t);return r}var Zc=Xv&&Xv.__assign||function(){return Zc=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},Zc.apply(this,arguments)};function dL(e,t,n){if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style=Zc(Zc({},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 pL=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)dL(r,o,i[o]);return r},{})};const BC=Eb(pL);function Ko(){}function hL(){return!0}function ns(e){return!!(e||"").match(/\d/)}function ig(e){return e==null}function og(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function vL(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 mL(e,t,n){var r=vL(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 Np(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 yL(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 VC(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function ag(e,t){return Array(t+1).join(e)}function gL(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."+ag("0",Math.abs(o))+r:o>=a?r=r+ag("0",o-a):r=(r.substring(0,o)||"0")+"."+r.substring(o),t+r}function bL(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=e.indexOf(".")!==-1&&t,i=Np(e),o=i.beforeDecimal,a=i.afterDecimal,s=i.hasNagation,u=parseFloat("0."+(a||"0")),c=a.length<=t?"0."+a:u.toFixed(t),l=c.split("."),f=o.split("").reverse().reduce(function(v,E,x){return v.length>x?(Number(v[0])+Number(E)).toString()+v.substring(1,v.length):E+v},l[0]),d=VC(l[1]||"",Math.min(t,a.length),n),p=s?"-":"",h=r?".":"";return""+p+f+h+d}function sg(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 SL(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 Vf(e,t,n){return Math.min(Math.max(e,t),n)}function ug(e){return Math.max(e.selectionStart,e.selectionEnd)}function wL(e){return e||typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function CL(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 xL={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:Ko,onChange:Ko,onKeyDown:Ko,onMouseUp:Ko,onFocus:Ko,onBlur:Ko,isAllowed:hL},UC=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,c=a.numAsString;if(c===void 0&&(c=""),r!==o){this.validateProps();var l=this.formatNumString(c),f=ig(o.value)?l:this.formatValueProp(),d=this.removeFormatting(f),p=parseFloat(d),h=parseFloat(c);((!isNaN(p)||!isNaN(h))&&p!==h||l!==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),c=r[0]==="-";c&&(r=r.replace("-","")),s&&o===0&&(r=r.split(s)[0]),r=(r.match(u)||[]).join("").replace(s,".");var l=r.indexOf(".");return l!==-1&&(r=r.substring(0,l)+"."+r.substring(l+1,r.length).replace(new RegExp(og(s),"g"),"")),c&&(r="-"+r),r},t.prototype.getNumberRegex=function(r,i){var o=this.props,a=o.format,s=o.decimalScale,u=o.customNumerals,c=this.getSeparators(),l=c.decimalSeparator;return new RegExp("[0-9"+(u?u.join(""):"")+"]"+(l&&s!==0&&!i&&!a?"|"+og(l):""),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(`
|
|
974
974
|
Decimal separator can't be same as thousand separator.
|
|
975
975
|
thousandSeparator: `+s+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
976
976
|
decimalSeparator: `+a+` (default value for decimalSeparator is .)
|
|
977
977
|
`);if(i){var u=i==="string"?i:i.toString();if(u.match(/\d/g))throw new Error(`
|
|
978
978
|
Mask `+i+` should not contain numeric character;
|
|
979
|
-
`)}},t.prototype.setPatchedCaretPosition=function(r,i,o){sg(r,i),this.caretPositionTimeout=setTimeout(function(){r.value===o&&sg(r,i)},0)},t.prototype.correctCaretPosition=function(r,i,o){var a=this.props,s=a.prefix,u=a.suffix,c=a.format;if(r==="")return 0;if(i=Vf(i,0,r.length),!c){var l=r[0]==="-";return Vf(i,s.length+(l?1:0),r.length-u.length)}if(typeof c=="function"||c[i]==="#"&&rs(r[i])||c[i-1]==="#"&&rs(r[i-1]))return i;var f=c.indexOf("#"),d=c.lastIndexOf("#");i=Vf(i,f,d+1);for(var p=c.substring(i,c.length).indexOf("#"),h=i,v=i+(p===-1?0:p);h>f&&(c[h]!=="#"||!rs(r[h]));)h-=1;var E=!rs(r[v])||o==="left"&&i!==f||i-h<v-i;return E?rs(r[h])?h+1:h:v},t.prototype.getCaretPosition=function(r,i,o){var a=this.props,s=a.format,u=this.state.value,c=this.getNumberRegex(!0),l=(r.match(c)||[]).join(""),f=(i.match(c)||[]).join(""),d,p;for(d=0,p=0;p<o;p++){var h=r[p]||"",v=i[d]||"";if(!(!h.match(c)&&h!==v)&&!(h==="0"&&v.match(c)&&v!=="0"&&l.length!==f.length)){for(;h!==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 c=r.lastIndexOf(s);r=s&&c!==-1&&c===r.length-s.length?r.substring(0,c):r,u&&(r="-"+r)}return r},t.prototype.removePatternFormatting=function(r){for(var i=this.props,o=i.format,a=o.split("#").filter(function(p){return p!==""}),s=0,u="",c=0,l=a.length;c<=l;c++){var f=a[c]||"",d=c===l?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,c=o.length;u<c;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,c=i.allowNegative,l=i.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,p=f.decimalSeparator,h=r.indexOf(".")!==-1||o&&a,v=Np(r,c),E=v.beforeDecimal,x=v.afterDecimal,m=v.addNegation;return o!==void 0&&(x=Vw(x,o,a)),d&&(E=gL(E,d,l)),s&&(E=s+E),u&&(x=x+u),m&&(E="-"+E),r=E+(h&&p||"")+x,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 c=new RegExp("["+s.join("")+"]","g");u=r.replace(c,function(l){return s.indexOf(l).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,c=this.props,l=c.value,f=c.isNumericString;l=ig(l)?r:l;var d=!l&&l!==0;if(d&&u&&(l=""),d&&!u)return"";typeof l=="number"&&(l=SL(l),f=!0),l==="Infinity"&&f&&(l=""),f&&!o&&typeof a=="number"&&(l=CL(l,a,s));var p=f?this.formatNumString(l):this.formatInput(l);return p},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),c=s.test(r);return r=r.replace(/-/g,""),u&&!c&&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,c=o.decimalScale,l=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[r]!=="#"||!a&&(r<s.length||r>=i.length-u.length||c&&l&&i[r]===d))},t.prototype.correctInputValue=function(r,i,o){var a=this,s=this.props,u=s.format,c=s.allowNegative,l=s.prefix,f=s.suffix,d=s.decimalScale,p=this.getSeparators(),h=p.allowedDecimalSeparators,v=p.decimalSeparator,E=this.state.numAsString||"",x=this.selectionBeforeInput,m=x.selectionStart,C=x.selectionEnd,w=wL(i,o),b=w.start,T=w.end;if(!u&&b===T&&h.indexOf(o[m])!==-1){var A=d===0?"":v;return o.substr(0,m)+A+o.substr(m+1,o.length)}var D=u?0:l.length,I=i.length-(u?0:f.length);if(o.length>i.length||!o.length||b===T||m===0&&C===i.length||b===0&&T===i.length||m===D&&C===I)return o;var N=i.substr(b,T-b),_=!![].concat(N).find(function(P,te){return a.isCharacterAFormat(te+b,i)});if(_){var L=i.substr(b),V={},H=[];[].concat(L).forEach(function(P,te){a.isCharacterAFormat(te+b,i)?V[te]=P:te>N.length-1&&H.push(P)}),Object.keys(V).forEach(function(P){H.length>P?H.splice(P,0,V[P]):H.push(V[P])}),o=i.substr(0,b)+H.join("")}if(!u){var R=this.removeFormatting(o),ie=Np(R,c),B=ie.beforeDecimal,U=ie.afterDecimal,fe=ie.addNegation,M=r<o.indexOf(v)+1;if(R.length<E.length&&M&&B===""&&!parseFloat(U))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,c=r.numAsString,l=r.caretPos,f=this.props,d=f.onValueChange,p=this.state,h=p.value;if(o){if(l===void 0&&a){var v=r.inputValue||o.value,E=ug(o);o.value=i,l=this.getCaretPosition(v,i,E)}o.value=i,a&&this.setPatchedCaretPosition(o,l,i)}c===void 0&&(c=this.removeFormatting(i)),i!==h&&(this.setState({value:i,numAsString:c}),d(this.getValueObject(i,c),{event:u,source:s}))},t.prototype.onChange=function(r){var i=r.target,o=i.value,a=this,s=a.state,u=a.props,c=u.isAllowed,l=s.value||"",f=ug(i);o=this.correctInputValue(f,l,o);var d=this.formatInput(o)||"",p=this.removeFormatting(d),h=this.getValueObject(d,p),v=c(h);v||(d=l),this.updateValue({formattedValue:d,numAsString:p,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,c=o.allowLeadingZeros,l=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(l))&&(l=""),c||(l=bL(l));var d=this.formatNumString(l);if(d!==f){this.updateValue({formattedValue:d,numAsString:l,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 c,l=this.props,f=l.decimalScale,d=l.fixedDecimalScale,p=l.prefix,h=l.suffix,v=l.format,E=l.onKeyDown,x=f!==void 0&&d,m=this.getNumberRegex(!1,x),C=new RegExp("-"),w=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:s},o==="ArrowLeft"||o==="Backspace"?c=a-1:o==="ArrowRight"?c=a+1:o==="Delete"&&(c=a),c===void 0||a!==s){E(r);return}var b=c,T=w?v.indexOf("#"):p.length,A=w?v.lastIndexOf("#")+1:u.length-h.length;if(o==="ArrowLeft"||o==="ArrowRight"){var D=o==="ArrowLeft"?"left":"right";b=this.correctCaretPosition(u,c,D)}else if(o==="Delete"&&!m.test(u[c])&&!C.test(u[c]))for(;!m.test(u[b])&&b<A;)b++;else if(o==="Backspace"&&!m.test(u[c])){if(a<=T+1&&u[0]==="-"&&typeof v>"u"){var I=u.substring(1);this.updateValue({formattedValue:I,caretPos:b,input:i,event:r,source:"event"})}else if(!C.test(u[c])){for(;!m.test(u[b-1])&&b>T;)b--;b=this.correctCaretPosition(u,b,"left")}}(b!==c||c<T||c>A)&&(r.preventDefault(),this.setPatchedCaretPosition(i,b,u)),r.isUnitTestRun&&this.setPatchedCaretPosition(i,b,u),E(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 c=i.correctCaretPosition(u,a);c!==a&&!(a===0&&s===u.length)&&i.setPatchedCaretPosition(o,c,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,c=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 l=EL(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=l,d=this.state,p=d.value,h=d.mounted,v=h&&xL(c)?"numeric":void 0,E=Object.assign({inputMode:v},f,{type:i,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return s?s(p,f)||null:O.createElement("span",Object.assign({},f,{ref:u}),p);if(a){var x=a;return O.createElement(x,Object.assign({},E,{ref:u}))}return O.createElement("input",Object.assign({},E,{ref:u}))},t}(O.Component);Uw.defaultProps=TL;function IL(e,t,n){var r=this,i=O.useRef(null),o=O.useRef(0),a=O.useRef(null),s=O.useRef([]),u=O.useRef(),c=O.useRef(),l=O.useRef(e),f=O.useRef(!0);O.useEffect(function(){l.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 p=!!(n=n||{}).leading,h=!("trailing"in n)||!!n.trailing,v="maxWait"in n,E=v?Math.max(+n.maxWait||0,t):null;O.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var x=O.useMemo(function(){var m=function(D){var I=s.current,N=u.current;return s.current=u.current=null,o.current=D,c.current=l.current.apply(N,I)},C=function(D,I){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(D):setTimeout(D,I)},w=function(D){if(!f.current)return!1;var I=D-i.current;return!i.current||I>=t||I<0||v&&D-o.current>=E},b=function(D){return a.current=null,h&&s.current?m(D):(s.current=u.current=null,c.current)},T=function D(){var I=Date.now();if(w(I))return b(I);if(f.current){var N=t-(I-i.current),_=v?Math.min(N,E-(I-o.current)):N;C(D,_)}},A=function(){var D=Date.now(),I=w(D);if(s.current=[].slice.call(arguments),u.current=r,i.current=D,I){if(!a.current&&f.current)return o.current=i.current,C(T,t),p?m(i.current):c.current;if(v)return C(T,t),m(i.current)}return a.current||C(T,t),c.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?b(Date.now()):c.current},A},[p,v,t,E,h,d]);return x}var Gw=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 c=i-o;return s=u>.5?c/(2-i-o):c/(i+o),i===t?a=(n-r)/c+(n<r?6:0):i===n?a=(r-t)/c+2:i===r&&(a=(t-n)/c+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}(),AL=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new Gw(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,c=u===void 0?0:u,l=1,f=.16666666666666666,d=null,p=1/0,h=new Array(6),v=new Array(6),E=new Array(6),x=6,m=0;m<s;m++){for(var C=i/Math.pow(m+1,f),w=0;w<x;w++)h[w]=Math.random()>.5?1:-1,v[w]=o[w]+C*h[w],E[w]=o[w]-C*h[w];for(var b=this.loss(v)-this.loss(E),w=0;w<x;w++){var T=b/(2*C)*h[w],A=r[w]/Math.pow(n+m+1,l);o[w]=this.fixValueByFilterIDX(o[w]-A*T,w)}var D=this.loss(o);D<p&&(d=o.slice(0),p=D)}return{values:d,loss:p,called:c}},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}(),$L=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])]:[]},Uf=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Gf={},OL=function(e,t){var n;t===void 0&&(t={});var r,i,o;if(Gf[e]&&!t.forceFilterRecalculation)return Object.assign({},Gf[e],{cache:!0});var a;try{if(n=o_($L(e),3),r=n[0],i=n[1],o=n[2],!Uf(r)||!Uf(i)||!Uf(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new Gw(Number(r),Number(i),Number(o))}catch(u){throw new Error("Color value should be in HEX format. "+u)}var s=new AL(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return Gf[e]=Object.assign({},s.solve(),{hex:e,rgb:[r,i,o],cache:!1})};const DL=(e,t,n,r)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+r;function NL(e,t,n,r){let i=(e+(r||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=PL(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 DL(e,t,n,r)}const PL=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]};function RL(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 kL(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),RL(e)}function In(){return j.RenderTarget.current()!==j.RenderTarget.preview}function ML(e){if(In())return null;const{error:t}=nv();if(!t)return null;switch(t.type){case vt.ConfigurationModelNotFound:return O.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:$.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case vt.ConfigurationUnauthenticated:return O.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:$.jsx("span",{children:"The HCA access token is invalid."});case vt.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 vt.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 Mo(e){return O.forwardRef((t,n)=>$.jsx(r_,{fallbackRender:()=>$.jsx("span",{children:"Component crashed"}),children:$.jsx(e,{...t,ref:n})}))}const jL=hu`
|
|
979
|
+
`)}},t.prototype.setPatchedCaretPosition=function(r,i,o){sg(r,i),this.caretPositionTimeout=setTimeout(function(){r.value===o&&sg(r,i)},0)},t.prototype.correctCaretPosition=function(r,i,o){var a=this.props,s=a.prefix,u=a.suffix,c=a.format;if(r==="")return 0;if(i=Vf(i,0,r.length),!c){var l=r[0]==="-";return Vf(i,s.length+(l?1:0),r.length-u.length)}if(typeof c=="function"||c[i]==="#"&&ns(r[i])||c[i-1]==="#"&&ns(r[i-1]))return i;var f=c.indexOf("#"),d=c.lastIndexOf("#");i=Vf(i,f,d+1);for(var p=c.substring(i,c.length).indexOf("#"),h=i,v=i+(p===-1?0:p);h>f&&(c[h]!=="#"||!ns(r[h]));)h-=1;var E=!ns(r[v])||o==="left"&&i!==f||i-h<v-i;return E?ns(r[h])?h+1:h:v},t.prototype.getCaretPosition=function(r,i,o){var a=this.props,s=a.format,u=this.state.value,c=this.getNumberRegex(!0),l=(r.match(c)||[]).join(""),f=(i.match(c)||[]).join(""),d,p;for(d=0,p=0;p<o;p++){var h=r[p]||"",v=i[d]||"";if(!(!h.match(c)&&h!==v)&&!(h==="0"&&v.match(c)&&v!=="0"&&l.length!==f.length)){for(;h!==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 c=r.lastIndexOf(s);r=s&&c!==-1&&c===r.length-s.length?r.substring(0,c):r,u&&(r="-"+r)}return r},t.prototype.removePatternFormatting=function(r){for(var i=this.props,o=i.format,a=o.split("#").filter(function(p){return p!==""}),s=0,u="",c=0,l=a.length;c<=l;c++){var f=a[c]||"",d=c===l?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,c=o.length;u<c;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,c=i.allowNegative,l=i.thousandsGroupStyle,f=this.getSeparators(),d=f.thousandSeparator,p=f.decimalSeparator,h=r.indexOf(".")!==-1||o&&a,v=Np(r,c),E=v.beforeDecimal,x=v.afterDecimal,m=v.addNegation;return o!==void 0&&(x=VC(x,o,a)),d&&(E=mL(E,d,l)),s&&(E=s+E),u&&(x=x+u),m&&(E="-"+E),r=E+(h&&p||"")+x,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 c=new RegExp("["+s.join("")+"]","g");u=r.replace(c,function(l){return s.indexOf(l).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,c=this.props,l=c.value,f=c.isNumericString;l=ig(l)?r:l;var d=!l&&l!==0;if(d&&u&&(l=""),d&&!u)return"";typeof l=="number"&&(l=gL(l),f=!0),l==="Infinity"&&f&&(l=""),f&&!o&&typeof a=="number"&&(l=bL(l,a,s));var p=f?this.formatNumString(l):this.formatInput(l);return p},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),c=s.test(r);return r=r.replace(/-/g,""),u&&!c&&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,c=o.decimalScale,l=o.fixedDecimalScale,f=this.getSeparators(),d=f.decimalSeparator;return!!(typeof a=="string"&&a[r]!=="#"||!a&&(r<s.length||r>=i.length-u.length||c&&l&&i[r]===d))},t.prototype.correctInputValue=function(r,i,o){var a=this,s=this.props,u=s.format,c=s.allowNegative,l=s.prefix,f=s.suffix,d=s.decimalScale,p=this.getSeparators(),h=p.allowedDecimalSeparators,v=p.decimalSeparator,E=this.state.numAsString||"",x=this.selectionBeforeInput,m=x.selectionStart,S=x.selectionEnd,C=SL(i,o),b=C.start,T=C.end;if(!u&&b===T&&h.indexOf(o[m])!==-1){var A=d===0?"":v;return o.substr(0,m)+A+o.substr(m+1,o.length)}var D=u?0:l.length,I=i.length-(u?0:f.length);if(o.length>i.length||!o.length||b===T||m===0&&S===i.length||b===0&&T===i.length||m===D&&S===I)return o;var N=i.substr(b,T-b),_=!![].concat(N).find(function(P,te){return a.isCharacterAFormat(te+b,i)});if(_){var L=i.substr(b),V={},H=[];[].concat(L).forEach(function(P,te){a.isCharacterAFormat(te+b,i)?V[te]=P:te>N.length-1&&H.push(P)}),Object.keys(V).forEach(function(P){H.length>P?H.splice(P,0,V[P]):H.push(V[P])}),o=i.substr(0,b)+H.join("")}if(!u){var R=this.removeFormatting(o),ie=Np(R,c),B=ie.beforeDecimal,U=ie.afterDecimal,fe=ie.addNegation,M=r<o.indexOf(v)+1;if(R.length<E.length&&M&&B===""&&!parseFloat(U))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,c=r.numAsString,l=r.caretPos,f=this.props,d=f.onValueChange,p=this.state,h=p.value;if(o){if(l===void 0&&a){var v=r.inputValue||o.value,E=ug(o);o.value=i,l=this.getCaretPosition(v,i,E)}o.value=i,a&&this.setPatchedCaretPosition(o,l,i)}c===void 0&&(c=this.removeFormatting(i)),i!==h&&(this.setState({value:i,numAsString:c}),d(this.getValueObject(i,c),{event:u,source:s}))},t.prototype.onChange=function(r){var i=r.target,o=i.value,a=this,s=a.state,u=a.props,c=u.isAllowed,l=s.value||"",f=ug(i);o=this.correctInputValue(f,l,o);var d=this.formatInput(o)||"",p=this.removeFormatting(d),h=this.getValueObject(d,p),v=c(h);v||(d=l),this.updateValue({formattedValue:d,numAsString:p,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,c=o.allowLeadingZeros,l=a.numAsString,f=a.value;if(this.focusedElm=null,clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout),!s){isNaN(parseFloat(l))&&(l=""),c||(l=yL(l));var d=this.formatNumString(l);if(d!==f){this.updateValue({formattedValue:d,numAsString:l,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 c,l=this.props,f=l.decimalScale,d=l.fixedDecimalScale,p=l.prefix,h=l.suffix,v=l.format,E=l.onKeyDown,x=f!==void 0&&d,m=this.getNumberRegex(!1,x),S=new RegExp("-"),C=typeof v=="string";if(this.selectionBeforeInput={selectionStart:a,selectionEnd:s},o==="ArrowLeft"||o==="Backspace"?c=a-1:o==="ArrowRight"?c=a+1:o==="Delete"&&(c=a),c===void 0||a!==s){E(r);return}var b=c,T=C?v.indexOf("#"):p.length,A=C?v.lastIndexOf("#")+1:u.length-h.length;if(o==="ArrowLeft"||o==="ArrowRight"){var D=o==="ArrowLeft"?"left":"right";b=this.correctCaretPosition(u,c,D)}else if(o==="Delete"&&!m.test(u[c])&&!S.test(u[c]))for(;!m.test(u[b])&&b<A;)b++;else if(o==="Backspace"&&!m.test(u[c])){if(a<=T+1&&u[0]==="-"&&typeof v>"u"){var I=u.substring(1);this.updateValue({formattedValue:I,caretPos:b,input:i,event:r,source:"event"})}else if(!S.test(u[c])){for(;!m.test(u[b-1])&&b>T;)b--;b=this.correctCaretPosition(u,b,"left")}}(b!==c||c<T||c>A)&&(r.preventDefault(),this.setPatchedCaretPosition(i,b,u)),r.isUnitTestRun&&this.setPatchedCaretPosition(i,b,u),E(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 c=i.correctCaretPosition(u,a);c!==a&&!(a===0&&s===u.length)&&i.setPatchedCaretPosition(o,c,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,c=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 l=CL(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=l,d=this.state,p=d.value,h=d.mounted,v=h&&wL(c)?"numeric":void 0,E=Object.assign({inputMode:v},f,{type:i,value:p,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if(o==="text")return s?s(p,f)||null:O.createElement("span",Object.assign({},f,{ref:u}),p);if(a){var x=a;return O.createElement(x,Object.assign({},E,{ref:u}))}return O.createElement("input",Object.assign({},E,{ref:u}))},t}(O.Component);UC.defaultProps=xL;function EL(e,t,n){var r=this,i=O.useRef(null),o=O.useRef(0),a=O.useRef(null),s=O.useRef([]),u=O.useRef(),c=O.useRef(),l=O.useRef(e),f=O.useRef(!0);O.useEffect(function(){l.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 p=!!(n=n||{}).leading,h=!("trailing"in n)||!!n.trailing,v="maxWait"in n,E=v?Math.max(+n.maxWait||0,t):null;O.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var x=O.useMemo(function(){var m=function(D){var I=s.current,N=u.current;return s.current=u.current=null,o.current=D,c.current=l.current.apply(N,I)},S=function(D,I){d&&cancelAnimationFrame(a.current),a.current=d?requestAnimationFrame(D):setTimeout(D,I)},C=function(D){if(!f.current)return!1;var I=D-i.current;return!i.current||I>=t||I<0||v&&D-o.current>=E},b=function(D){return a.current=null,h&&s.current?m(D):(s.current=u.current=null,c.current)},T=function D(){var I=Date.now();if(C(I))return b(I);if(f.current){var N=t-(I-i.current),_=v?Math.min(N,E-(I-o.current)):N;S(D,_)}},A=function(){var D=Date.now(),I=C(D);if(s.current=[].slice.call(arguments),u.current=r,i.current=D,I){if(!a.current&&f.current)return o.current=i.current,S(T,t),p?m(i.current):c.current;if(v)return S(T,t),m(i.current)}return a.current||S(T,t),c.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?b(Date.now()):c.current},A},[p,v,t,E,h,d]);return x}var GC=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 c=i-o;return s=u>.5?c/(2-i-o):c/(i+o),i===t?a=(n-r)/c+(n<r?6:0):i===n?a=(r-t)/c+2:i===r&&(a=(t-n)/c+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}(),TL=function(){function e(t,n){this.target=t,this.targetHSL=t.hsl(),this.options=Object.assign({},{acceptanceLossPercentage:5,maxChecks:15},n),this.reusedColor=new GC(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,c=u===void 0?0:u,l=1,f=.16666666666666666,d=null,p=1/0,h=new Array(6),v=new Array(6),E=new Array(6),x=6,m=0;m<s;m++){for(var S=i/Math.pow(m+1,f),C=0;C<x;C++)h[C]=Math.random()>.5?1:-1,v[C]=o[C]+S*h[C],E[C]=o[C]-S*h[C];for(var b=this.loss(v)-this.loss(E),C=0;C<x;C++){var T=b/(2*S)*h[C],A=r[C]/Math.pow(n+m+1,l);o[C]=this.fixValueByFilterIDX(o[C]-A*T,C)}var D=this.loss(o);D<p&&(d=o.slice(0),p=D)}return{values:d,loss:p,called:c}},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}(),IL=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])]:[]},Uf=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},Gf={},AL=function(e,t){var n;t===void 0&&(t={});var r,i,o;if(Gf[e]&&!t.forceFilterRecalculation)return Object.assign({},Gf[e],{cache:!0});var a;try{if(n=r_(IL(e),3),r=n[0],i=n[1],o=n[2],!Uf(r)||!Uf(i)||!Uf(o))throw new Error("hextToRgb returned an invalid value for '"+e+"'");a=new GC(Number(r),Number(i),Number(o))}catch(u){throw new Error("Color value should be in HEX format. "+u)}var s=new TL(a,Object.assign({},{acceptanceLossPercentage:5,maxChecks:30,forceFilterRecalculation:!1},t));return Gf[e]=Object.assign({},s.solve(),{hex:e,rgb:[r,i,o],cache:!1})};const $L=(e,t,n,r)=>(n|t<<8|e<<16|1<<24).toString(16).slice(1)+r;function OL(e,t,n,r){let i=(e+(r||"")).toString().includes("%");if(typeof e=="string"&&!t){const o=DL(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 $L(e,t,n,r)}const DL=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]};function NL(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 PL(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),NL(e)}function In(){return j.RenderTarget.current()!==j.RenderTarget.preview}function RL(e){if(In())return null;const{error:t}=nv();if(!t)return null;switch(t.type){case vt.ConfigurationModelNotFound:return O.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:$.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case vt.ConfigurationUnauthenticated:return O.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:$.jsx("span",{children:"The HCA access token is invalid."});case vt.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 vt.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 ko(e){return O.forwardRef((t,n)=>$.jsx(t_,{fallbackRender:()=>$.jsx("span",{children:"Component crashed"}),children:$.jsx(e,{...t,ref:n})}))}const kL=hu`
|
|
980
980
|
:root {
|
|
981
981
|
--font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
982
982
|
--font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
|
|
@@ -995,7 +995,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
995
995
|
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
996
996
|
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
997
997
|
}
|
|
998
|
-
`,
|
|
998
|
+
`,ML=kL,jL=hu`
|
|
999
999
|
:root {
|
|
1000
1000
|
--space-unit: 1em;
|
|
1001
1001
|
--space-xxs: calc(0.25 * var(--space-unit));
|
|
@@ -1015,14 +1015,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1015
1015
|
--space-xl-fixed: calc(3.25 * var(--space-unit-fixed));
|
|
1016
1016
|
--space-xxl-fixed: calc(5.25 * var(--space-unit-fixed));
|
|
1017
1017
|
}
|
|
1018
|
-
`,
|
|
1018
|
+
`,_L=jL,qL=hu`
|
|
1019
1019
|
:root {
|
|
1020
1020
|
--shape-border-radius-xs: 5px;
|
|
1021
1021
|
--shape-border-radius-sm: 7px;
|
|
1022
1022
|
--shape-border-radius-md: 12px;
|
|
1023
1023
|
--shape-border-radius-lg: 20px;
|
|
1024
1024
|
}
|
|
1025
|
-
`,
|
|
1025
|
+
`,FL=qL,LL=hu`
|
|
1026
1026
|
:root {
|
|
1027
1027
|
--shadows-popover: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4));
|
|
1028
1028
|
--shadows-dialog: 0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02),
|
|
@@ -1034,7 +1034,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1034
1034
|
13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061),
|
|
1035
1035
|
40px 68px 96px rgba(0, 0, 0, 0.1);
|
|
1036
1036
|
}
|
|
1037
|
-
`,
|
|
1037
|
+
`,BL=LL;function cg(){return $.jsxs($.Fragment,{children:[$.jsx(BL,{}),$.jsx(FL,{}),$.jsx(_L,{}),$.jsx(ML,{})]})}const Ys=O.createContext(null);function Bi(){const{process:e,switchMode:t,applySolution:n,dismiss:r}=O.useContext(Ys);return e?{...e,switchMode:t,applySolution:n,dismiss:r}:null}function zC(e){const{explanation:t,...n}=e,r=Bi();return $.jsx("button",{...n,onClick:()=>r.applySolution(t.solution),children:e.children})}const VL=Ie.div`
|
|
1038
1038
|
display: flex;
|
|
1039
1039
|
gap: var(--space-xs);
|
|
1040
1040
|
align-items: center;
|
|
@@ -1045,7 +1045,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1045
1045
|
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1046
1046
|
font-weight: 500;
|
|
1047
1047
|
min-width: 0;
|
|
1048
|
-
`,
|
|
1048
|
+
`,UL=Ie.div`
|
|
1049
1049
|
display: grid;
|
|
1050
1050
|
place-content: center;
|
|
1051
1051
|
border-top-left-radius: 360px;
|
|
@@ -1063,36 +1063,36 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1063
1063
|
background-color: var(--color-explain-attribute-value-remove-fill);
|
|
1064
1064
|
color: var(--color-explain-attribute-value-remove-color);
|
|
1065
1065
|
}
|
|
1066
|
-
`,
|
|
1066
|
+
`,GL=Ie.div`
|
|
1067
1067
|
white-space: nowrap;
|
|
1068
1068
|
overflow: hidden;
|
|
1069
1069
|
text-overflow: ellipsis;
|
|
1070
|
-
`;function
|
|
1070
|
+
`;function zL(e){const{decision:t}=e,n=t.intention,r=WL(t);return $.jsxs(VL,{children:[$.jsxs(UL,{className:`mode-${n}`,children:[n==="remove"&&$.jsx(Ri,{icon:uq}),n==="add"&&$.jsx(Ri,{icon:cq})]}),$.jsx(GL,{children:r})]})}function WL(e){return Y(e).returnType().with({type:W.Choice},t=>t.choiceValueId).with({type:W.Boolean},t=>t.state.toString()).with({type:W.Component},t=>t.state).with({type:W.Numeric},t=>t.state.toString()).exhaustive()}const HL=Ie.div`
|
|
1071
1071
|
display: grid;
|
|
1072
1072
|
grid-template-columns: subgrid;
|
|
1073
1073
|
grid-column: span 2;
|
|
1074
1074
|
align-items: center;
|
|
1075
|
-
`,
|
|
1075
|
+
`,KL=Ie.div`
|
|
1076
1076
|
grid-area: name;
|
|
1077
1077
|
white-space: nowrap;
|
|
1078
1078
|
overflow: hidden;
|
|
1079
1079
|
text-overflow: ellipsis;
|
|
1080
|
-
`,
|
|
1080
|
+
`,YL=Ie.div`
|
|
1081
1081
|
grid-area: values;
|
|
1082
1082
|
display: flex;
|
|
1083
1083
|
flex-wrap: wrap;
|
|
1084
1084
|
min-width: 0;
|
|
1085
1085
|
gap: var(--space-xxs);
|
|
1086
|
-
`;function
|
|
1086
|
+
`;function XL(e){const{decisions:t}=e,n=t[0].attributeId;return $.jsxs(HL,{children:[$.jsx(KL,{children:n.localId}),$.jsx(YL,{children:t.map(r=>$.jsx(zL,{decision:r}))})]})}function JL(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("::")}function WC(e){const{blockingDecisions:t,desiredDecisions:n,...r}=e,i=g([...n.map(o=>({...o,intention:"add"})),...t.map(o=>({...o,intention:"remove"}))],n0(o=>JL(o.attributeId)),jh(FN)((o,a)=>a));return $.jsx("div",{...r,children:i.map(o=>$.jsx(XL,{decisions:o}))})}const QL=Ie.div`
|
|
1087
1087
|
background-color: var(--color-explain-dialog-explanation-card);
|
|
1088
1088
|
padding: var(--space-sm-fixed);
|
|
1089
1089
|
box-shadow: 2px 1px 10px -5px rgba(0, 0, 0, 0.4);
|
|
1090
1090
|
border-radius: var(--shape-border-radius-sm);
|
|
1091
|
-
`,
|
|
1091
|
+
`,HC=QL,ZL=Ie(WC)`
|
|
1092
1092
|
display: grid;
|
|
1093
1093
|
grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr);
|
|
1094
1094
|
gap: var(--space-sm);
|
|
1095
|
-
`,
|
|
1095
|
+
`,e5=Ie(zC)`
|
|
1096
1096
|
border-radius: var(--shape-border-radius-sm);
|
|
1097
1097
|
background-color: var(--color-explain-dialog-apply-solution-button-fill);
|
|
1098
1098
|
color: var(--color-explain-dialog-apply-solution-button-color);
|
|
@@ -1109,13 +1109,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1109
1109
|
outline: 2px solid var(--color-explain-dialog-apply-solution-button-outline);
|
|
1110
1110
|
outline-offset: 1px;
|
|
1111
1111
|
}
|
|
1112
|
-
`;function
|
|
1112
|
+
`;function t5(e){const{explanation:t}=e,n=t.solution.decisions.filter(r=>r.state!=null);return $.jsxs(HC,{children:[$.jsx(ZL,{blockingDecisions:t.causedByDecisions,desiredDecisions:n}),$.jsx(e5,{explanation:t,children:"Apply solution"})]})}const n5=Ie(HC)`
|
|
1113
1113
|
ul {
|
|
1114
1114
|
margin: 0;
|
|
1115
1115
|
}
|
|
1116
1116
|
|
|
1117
1117
|
line-height: 1.5em;
|
|
1118
|
-
`,
|
|
1118
|
+
`,r5=Ie.ul`
|
|
1119
1119
|
list-style-type: none;
|
|
1120
1120
|
margin-inline-start: 0;
|
|
1121
1121
|
padding-inline-start: 0;
|
|
@@ -1127,7 +1127,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1127
1127
|
font-size: 0.9em;
|
|
1128
1128
|
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
1129
1129
|
font-weight: 500;
|
|
1130
|
-
`;function
|
|
1130
|
+
`;function i5(e){const{explanation:t}=e,n=t.causedByCardinalities,r=g(t.causedByRules,n0(i=>i.configurationModelId),jh(Md)((i,o)=>({configurationModelId:i,rules:g(o,G(a=>a.localId),M2(Md))})));return $.jsx(n5,{children:$.jsxs(r5,{children:[r.map(i=>$.jsxs("li",{children:[$.jsx("span",{children:i.configurationModelId}),$.jsx(lg,{children:i.rules.map(o=>$.jsx(fg,{children:o}))})]})),n.length>0&&$.jsxs("li",{children:[$.jsx("span",{children:"Cardinality"}),$.jsx(lg,{children:n.map(i=>$.jsx(fg,{children:i.localId}))})]})]})})}function KC(e){const{variant:t,...n}=e,{explainQuestion:r}=Bi(),i=Y(r).returnType().with({question:_t.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:_t.whyIsNotSatisfied,subject:Qe.configuration},()=>"why your configuration is not satisfied").with({question:_t.whyIsNotSatisfied,subject:Qe.attribute},()=>"why your attribute is not satisfied").exhaustive(),o=Y(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 dg=Ie.div`
|
|
1131
1131
|
font-weight: 500;
|
|
1132
1132
|
font-family: var(--font-heading);
|
|
1133
1133
|
margin-bottom: var(--space-xs);
|
|
@@ -1136,31 +1136,31 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1136
1136
|
display: flex;
|
|
1137
1137
|
flex-direction: column;
|
|
1138
1138
|
gap: var(--space-xs);
|
|
1139
|
-
`,
|
|
1139
|
+
`,o5=Ie.div`
|
|
1140
1140
|
display: flex;
|
|
1141
1141
|
flex-direction: column;
|
|
1142
1142
|
gap: var(--space-md);
|
|
1143
|
-
`,hg=Ie(
|
|
1143
|
+
`,hg=Ie(KC)`
|
|
1144
1144
|
width: min-content;
|
|
1145
1145
|
min-width: 400px;
|
|
1146
1146
|
margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
|
|
1147
|
-
`;function u5(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Bi();return n?$.jsx(hg,{variant:"failedToExplain"}):e.length===0&&t.length===0?$.jsx(hg,{variant:"noExplanationFound"}):$.jsxs(s5,{children:[e.length>0&&$.jsxs("div",{children:[$.jsx(dg,{children:"Solutions"}),$.jsx(pg,{children:e.map(r=>$.jsx(r5,{explanation:r},e.indexOf(r)))})]}),t.length>0&&$.jsxs("div",{children:[$.jsx(dg,{children:"Constraint Explanations"}),$.jsx(pg,{children:t.map(r=>$.jsx(a5,{explanation:r},t.indexOf(r)))})]})]})}function ei(e){return Yw(e)?(e.nodeName||"").toLowerCase():"#document"}function Jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ri(e){var t;return(t=(Yw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yw(e){return e instanceof Node||e instanceof Jn(e).Node}function qt(e){return e instanceof Element||e instanceof Jn(e).Element}function $n(e){return e instanceof HTMLElement||e instanceof Jn(e).HTMLElement}function Pp(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jn(e).ShadowRoot}function gu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Qn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function c5(e){return["table","td","th"].includes(ei(e))}function Ev(e){const t=Tv(),n=Qn(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 Xw(e){let t=To(e);for(;$n(t)&&!Ta(t);){if(Ev(t))return t;t=To(t)}return null}function Tv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ta(e){return["html","body","#document"].includes(ei(e))}function Qn(e){return Jn(e).getComputedStyle(e)}function ff(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function To(e){if(ei(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pp(e)&&e.host||ri(e);return Pp(t)?t.host:t}function Jw(e){const t=To(e);return Ta(t)?e.ownerDocument?e.ownerDocument.body:e.body:$n(t)&&gu(t)?t:Jw(t)}function wi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Jw(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Jn(i);return o?t.concat(a,a.visualViewport||[],gu(i)?i:[],a.frameElement&&n?wi(a.frameElement):[]):t.concat(i,wi(i,[],n))}function ta(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 Bn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Pp(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Qw(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Zw(){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 l5(e){return e.mozInputSource===0&&e.isTrusted?!0:Rp()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function f5(e){return p5()?!1:!Rp()&&e.width===0&&e.height===0||Rp()&&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 d5(){return/apple/i.test(navigator.vendor)}function Rp(){const e=/android/i;return e.test(Qw())||e.test(Zw())}function p5(){return Zw().includes("jsdom/")}function vg(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function h5(e){return"nativeEvent"in e}function v5(e){return e.matches("html,body")}function Vr(e){return(e==null?void 0:e.ownerDocument)||document}function zf(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 na(e){return"composedPath"in e?e.composedPath()[0]:e.target}const m5="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ex(e){return $n(e)&&e.matches(m5)}function Wf(e){e.preventDefault(),e.stopPropagation()}function y5(e){return e?e.getAttribute("role")==="combobox"&&ex(e):!1}const Ia=Math.min,fo=Math.max,el=Math.round,Qu=Math.floor,ki=e=>({x:e,y:e}),g5={left:"right",right:"left",bottom:"top",top:"bottom"},b5={start:"end",end:"start"};function kp(e,t,n){return fo(e,Ia(t,n))}function bu(e,t){return typeof e=="function"?e(t):e}function Io(e){return e.split("-")[0]}function Su(e){return e.split("-")[1]}function tx(e){return e==="x"?"y":"x"}function Iv(e){return e==="y"?"height":"width"}function df(e){return["top","bottom"].includes(Io(e))?"y":"x"}function Av(e){return tx(df(e))}function S5(e,t,n){n===void 0&&(n=!1);const r=Su(e),i=Av(e),o=Iv(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=tl(a)),[a,tl(a)]}function C5(e){const t=tl(e);return[Mp(e),t,Mp(t)]}function Mp(e){return e.replace(/start|end/g,t=>b5[t])}function w5(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 x5(e,t,n,r){const i=Su(e);let o=w5(Io(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Mp)))),o}function tl(e){return e.replace(/left|right|bottom|top/g,t=>g5[t])}function E5(e){return{top:0,right:0,bottom:0,left:0,...e}}function nx(e){return typeof e!="number"?E5(e):{top:e,right:e,bottom:e,left:e}}function nl(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function mg(e,t,n){let{reference:r,floating:i}=e;const o=df(t),a=Av(t),s=Iv(a),u=Io(t),c=o==="y",l=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 p;switch(u){case"top":p={x:l,y:r.y-i.height};break;case"bottom":p={x:l,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Su(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1);break}return p}const T5=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 c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=mg(c,r,u),d=r,p={},h=0;for(let v=0;v<s.length;v++){const{name:E,fn:x}=s[v],{x:m,y:C,data:w,reset:b}=await x({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});l=m??l,f=C??f,p={...p,[E]:{...p[E],...w}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(c=b.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:l,y:f}=mg(c,d,u)),v=-1)}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};async function rx(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=bu(t,e),h=nx(p),v=s[d?f==="floating"?"reference":"floating":f],E=nl(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:c,rootBoundary:l,strategy:u})),x=f==="floating"?{...a.floating,x:r,y:i}:a.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),C=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},w=nl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:m,strategy:u}):x);return{top:(E.top-w.top+h.top)/C.y,bottom:(w.bottom-E.bottom+h.bottom)/C.y,left:(E.left-w.left+h.left)/C.x,right:(w.right-E.right+h.right)/C.x}}const I5=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:c,padding:l=0}=bu(e,t)||{};if(c==null)return{};const f=nx(l),d={x:n,y:r},p=Av(i),h=Iv(p),v=await a.getDimensions(c),E=p==="y",x=E?"top":"left",m=E?"bottom":"right",C=E?"clientHeight":"clientWidth",w=o.reference[h]+o.reference[p]-d[p]-o.floating[h],b=d[p]-o.reference[p],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let A=T?T[C]:0;(!A||!await(a.isElement==null?void 0:a.isElement(T)))&&(A=s.floating[C]||o.floating[h]);const D=w/2-b/2,I=A/2-v[h]/2-1,N=Ia(f[x],I),_=Ia(f[m],I),L=N,V=A-v[h]-_,H=A/2-v[h]/2+D,R=kp(L,H,V),ie=!u.arrow&&Su(i)!=null&&H!==R&&o.reference[h]/2-(H<L?N:_)-v[h]/2<0,B=ie?H<L?H-L:H-V:0;return{[p]:d[p]+B,data:{[p]:R,centerOffset:H-R-B,...ie&&{alignmentOffset:B}},reset:ie}}}),A5=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:c}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...E}=bu(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=Io(i),m=Io(s)===s,C=await(u.isRTL==null?void 0:u.isRTL(c.floating)),w=d||(m||!v?[tl(s)]:C5(s));!d&&h!=="none"&&w.push(...x5(s,v,h,C));const b=[s,...w],T=await rx(t,E),A=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(l&&A.push(T[x]),f){const L=S5(i,a,C);A.push(T[L[0]],T[L[1]])}if(D=[...D,{placement:i,overflows:A}],!A.every(L=>L<=0)){var I,N;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,V=b[L];if(V)return{data:{index:L,overflows:D},reset:{placement:V}};let H=(N=D.filter(R=>R.overflows[0]<=0).sort((R,ie)=>R.overflows[1]-ie.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(p){case"bestFit":{var _;const R=(_=D.map(ie=>[ie.placement,ie.overflows.filter(B=>B>0).reduce((B,U)=>B+U,0)]).sort((ie,B)=>ie[1]-B[1])[0])==null?void 0:_[0];R&&(H=R);break}case"initialPlacement":H=s;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function $5(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Io(n),s=Su(n),u=df(n)==="y",c=["left","top"].includes(a)?-1:1,l=o&&u?-1:1,f=bu(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),u?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const O5=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 $5(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}}}}},D5=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:E=>{let{x,y:m}=E;return{x,y:m}}},...u}=bu(e,t),c={x:n,y:r},l=await rx(t,u),f=df(Io(i)),d=tx(f);let p=c[d],h=c[f];if(o){const E=d==="y"?"top":"left",x=d==="y"?"bottom":"right",m=p+l[E],C=p-l[x];p=kp(m,p,C)}if(a){const E=f==="y"?"top":"left",x=f==="y"?"bottom":"right",m=h+l[E],C=h-l[x];h=kp(m,h,C)}const v=s.fn({...t,[d]:p,[f]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function ix(e){const t=Qn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=$n(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=el(n)!==o||el(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function $v(e){return qt(e)?e:e.contextElement}function ya(e){const t=$v(e);if(!$n(t))return ki(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=ix(t);let a=(o?el(n.width):n.width)/r,s=(o?el(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const N5=ki(0);function ox(e){const t=Jn(e);return!Tv()||!t.visualViewport?N5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function P5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jn(e)?!1:t}function Ao(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=$v(e);let a=ki(1);t&&(r?qt(r)&&(a=ya(r)):a=ya(e));const s=P5(o,n,r)?ox(o):ki(0);let u=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,l=i.width/a.x,f=i.height/a.y;if(o){const d=Jn(o),p=r&&qt(r)?Jn(r):r;let h=d.frameElement;for(;h&&r&&p!==d;){const v=ya(h),E=h.getBoundingClientRect(),x=Qn(h),m=E.left+(h.clientLeft+parseFloat(x.paddingLeft))*v.x,C=E.top+(h.clientTop+parseFloat(x.paddingTop))*v.y;u*=v.x,c*=v.y,l*=v.x,f*=v.y,u+=m,c+=C,h=Jn(h).frameElement}}return nl({width:l,height:f,x:u,y:c})}const R5=[":popover-open",":modal"];function ax(e){let t=!1,n=0,r=0;function i(o){try{t=t||e.matches(o)}catch{}}if(R5.forEach(o=>{i(o)}),t){const o=Xw(e);if(o){const a=o.getBoundingClientRect();n=a.x,r=a.y}}return[t,n,r]}function k5(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=ri(r),[a]=t?ax(t.floating):[!1];if(r===o||a)return n;let s={scrollLeft:0,scrollTop:0},u=ki(1);const c=ki(0),l=$n(r);if((l||!l&&i!=="fixed")&&((ei(r)!=="body"||gu(o))&&(s=ff(r)),$n(r))){const f=Ao(r);u=ya(r),c.x=f.x+r.clientLeft,c.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+c.x,y:n.y*u.y-s.scrollTop*u.y+c.y}}function M5(e){return Array.from(e.getClientRects())}function sx(e){return Ao(ri(e)).left+ff(e).scrollLeft}function j5(e){const t=ri(e),n=ff(e),r=e.ownerDocument.body,i=fo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=fo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+sx(e);const s=-n.scrollTop;return Qn(r).direction==="rtl"&&(a+=fo(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function _5(e,t){const n=Jn(e),r=ri(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const c=Tv();(!c||c&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function q5(e,t){const n=Ao(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=$n(e)?ya(e):ki(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:a,height:s,x:u,y:c}}function yg(e,t,n){let r;if(t==="viewport")r=_5(e,n);else if(t==="document")r=j5(ri(e));else if(qt(t))r=q5(t,n);else{const i=ox(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return nl(r)}function ux(e,t){const n=To(e);return n===t||!qt(n)||Ta(n)?!1:Qn(n).position==="fixed"||ux(n,t)}function F5(e,t){const n=t.get(e);if(n)return n;let r=wi(e,[],!1).filter(s=>qt(s)&&ei(s)!=="body"),i=null;const o=Qn(e).position==="fixed";let a=o?To(e):e;for(;qt(a)&&!Ta(a);){const s=Qn(a),u=Ev(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&i&&["absolute","fixed"].includes(i.position)||gu(a)&&!u&&ux(e,a))?r=r.filter(c=>c!==a):i=s,a=To(a)}return t.set(e,r),r}function L5(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?F5(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((u,c)=>{const l=yg(t,c,i);return u.top=fo(l.top,u.top),u.right=Ia(l.right,u.right),u.bottom=Ia(l.bottom,u.bottom),u.left=fo(l.left,u.left),u},yg(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function B5(e){const{width:t,height:n}=ix(e);return{width:t,height:n}}function V5(e,t,n,r){const i=$n(t),o=ri(t),a=n==="fixed",s=Ao(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const c=ki(0);if(i||!i&&!a)if((ei(t)!=="body"||gu(o))&&(u=ff(t)),i){const v=Ao(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else o&&(c.x=sx(o));let l=s.left+u.scrollLeft-c.x,f=s.top+u.scrollTop-c.y;const[d,p,h]=ax(r);return d&&(l+=p,f+=h,i&&(l+=t.clientLeft,f+=t.clientTop)),{x:l,y:f,width:s.width,height:s.height}}function gg(e,t){return!$n(e)||Qn(e).position==="fixed"?null:t?t(e):e.offsetParent}function cx(e,t){const n=Jn(e);if(!$n(e))return n;let r=gg(e,t);for(;r&&c5(r)&&Qn(r).position==="static";)r=gg(r,t);return r&&(ei(r)==="html"||ei(r)==="body"&&Qn(r).position==="static"&&!Ev(r))?n:r||Xw(e)||n}const U5=async function(e){const t=this.getOffsetParent||cx,n=this.getDimensions;return{reference:V5(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function G5(e){return Qn(e).direction==="rtl"}const lx={convertOffsetParentRelativeRectToViewportRelativeRect:k5,getDocumentElement:ri,getClippingRect:L5,getOffsetParent:cx,getElementRects:U5,getClientRects:M5,getDimensions:B5,getScale:ya,isElement:qt,isRTL:G5};function z5(e,t){let n=null,r;const i=ri(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:c,top:l,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p=Qu(l),h=Qu(i.clientWidth-(c+f)),v=Qu(i.clientHeight-(l+d)),E=Qu(c),x={rootMargin:-p+"px "+-h+"px "+-v+"px "+-E+"px",threshold:fo(0,Ia(1,u))||1};let m=!0;function C(w){const b=w[0].intersectionRatio;if(b!==u){if(!m)return a();b?a(!1,b):r=setTimeout(()=>{a(!1,1e-7)},100)}m=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return a(!0),o}function W5(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,c=$v(e),l=i||o?[...c?wi(c):[],...wi(t)]:[];l.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const f=c&&s?z5(c,n):null;let d=-1,p=null;a&&(p=new ResizeObserver(x=>{let[m]=x;m&&m.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var C;(C=p)==null||C.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let h,v=u?Ao(e):null;u&&E();function E(){const x=Ao(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&n(),v=x,h=requestAnimationFrame(E)}return n(),()=>{var x;l.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(x=p)==null||x.disconnect(),p=null,u&&cancelAnimationFrame(h)}}const H5=D5,K5=A5,bg=I5,Y5=(e,t,n)=>{const r=new Map,i={platform:lx,...n},o={...i.platform,_c:r};return T5(e,t,{...i,platform:o})},X5=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?bg({element:r.current,padding:i}).fn(n):{}:r?bg({element:r,padding:i}).fn(n):{}}}};var xc=typeof document<"u"?O.useLayoutEffect:O.useEffect;function rl(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(!rl(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)&&!rl(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function fx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sg(e,t){const n=fx(e);return Math.round(t*n)/n}function Cg(e){const t=J.useRef(e);return xc(()=>{t.current=e}),t}function J5(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:c}=e,[l,f]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=J.useState(r);rl(d,r)||p(r);const[h,v]=J.useState(null),[E,x]=J.useState(null),m=J.useCallback(B=>{B!==T.current&&(T.current=B,v(B))},[]),C=J.useCallback(B=>{B!==A.current&&(A.current=B,x(B))},[]),w=o||h,b=a||E,T=J.useRef(null),A=J.useRef(null),D=J.useRef(l),I=u!=null,N=Cg(u),_=Cg(i),L=J.useCallback(()=>{if(!T.current||!A.current)return;const B={placement:t,strategy:n,middleware:d};_.current&&(B.platform=_.current),Y5(T.current,A.current,B).then(U=>{const fe={...U,isPositioned:!0};V.current&&!rl(D.current,fe)&&(D.current=fe,o1.flushSync(()=>{f(fe)}))})},[d,t,n,_]);xc(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[c]);const V=J.useRef(!1);xc(()=>(V.current=!0,()=>{V.current=!1}),[]),xc(()=>{if(w&&(T.current=w),b&&(A.current=b),w&&b){if(N.current)return N.current(w,b,L);L()}},[w,b,L,N,I]);const H=J.useMemo(()=>({reference:T,floating:A,setReference:m,setFloating:C}),[m,C]),R=J.useMemo(()=>({reference:w,floating:b}),[w,b]),ie=J.useMemo(()=>{const B={position:n,left:0,top:0};if(!R.floating)return B;const U=Sg(R.floating,l.x),fe=Sg(R.floating,l.y);return s?{...B,transform:"translate("+U+"px, "+fe+"px)",...fx(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:fe}},[n,s,R.floating,l.x,l.y]);return J.useMemo(()=>({...l,update:L,refs:H,elements:R,floatingStyles:ie}),[l,L,H,R,ie])}/*!
|
|
1147
|
+
`;function a5(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Bi();return n?$.jsx(hg,{variant:"failedToExplain"}):e.length===0&&t.length===0?$.jsx(hg,{variant:"noExplanationFound"}):$.jsxs(o5,{children:[e.length>0&&$.jsxs("div",{children:[$.jsx(dg,{children:"Solutions"}),$.jsx(pg,{children:e.map(r=>$.jsx(t5,{explanation:r},e.indexOf(r)))})]}),t.length>0&&$.jsxs("div",{children:[$.jsx(dg,{children:"Constraint Explanations"}),$.jsx(pg,{children:t.map(r=>$.jsx(i5,{explanation:r},t.indexOf(r)))})]})]})}function Qr(e){return YC(e)?(e.nodeName||"").toLowerCase():"#document"}function Jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ti(e){var t;return(t=(YC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function YC(e){return e instanceof Node||e instanceof Jn(e).Node}function qt(e){return e instanceof Element||e instanceof Jn(e).Element}function $n(e){return e instanceof HTMLElement||e instanceof Jn(e).HTMLElement}function Pp(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jn(e).ShadowRoot}function gu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Qn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function s5(e){return["table","td","th"].includes(Qr(e))}function Ev(e){const t=Tv(),n=Qn(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 XC(e){let t=To(e);for(;$n(t)&&!Ea(t);){if(Ev(t))return t;t=To(t)}return null}function Tv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ea(e){return["html","body","#document"].includes(Qr(e))}function Qn(e){return Jn(e).getComputedStyle(e)}function ff(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function To(e){if(Qr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pp(e)&&e.host||ti(e);return Pp(t)?t.host:t}function JC(e){const t=To(e);return Ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:$n(t)&&gu(t)?t:JC(t)}function Ci(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=JC(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Jn(i);return o?t.concat(a,a.visualViewport||[],gu(i)?i:[],a.frameElement&&n?Ci(a.frameElement):[]):t.concat(i,Ci(i,[],n))}function ea(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 Bn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Pp(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function QC(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ZC(){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 u5(e){return e.mozInputSource===0&&e.isTrusted?!0:Rp()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function c5(e){return f5()?!1:!Rp()&&e.width===0&&e.height===0||Rp()&&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 l5(){return/apple/i.test(navigator.vendor)}function Rp(){const e=/android/i;return e.test(QC())||e.test(ZC())}function f5(){return ZC().includes("jsdom/")}function vg(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function d5(e){return"nativeEvent"in e}function p5(e){return e.matches("html,body")}function Vr(e){return(e==null?void 0:e.ownerDocument)||document}function zf(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 ta(e){return"composedPath"in e?e.composedPath()[0]:e.target}const h5="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ex(e){return $n(e)&&e.matches(h5)}function Wf(e){e.preventDefault(),e.stopPropagation()}function v5(e){return e?e.getAttribute("role")==="combobox"&&ex(e):!1}const Ta=Math.min,fo=Math.max,el=Math.round,Qu=Math.floor,ki=e=>({x:e,y:e}),m5={left:"right",right:"left",bottom:"top",top:"bottom"},y5={start:"end",end:"start"};function kp(e,t,n){return fo(e,Ta(t,n))}function bu(e,t){return typeof e=="function"?e(t):e}function Io(e){return e.split("-")[0]}function Su(e){return e.split("-")[1]}function tx(e){return e==="x"?"y":"x"}function Iv(e){return e==="y"?"height":"width"}function df(e){return["top","bottom"].includes(Io(e))?"y":"x"}function Av(e){return tx(df(e))}function g5(e,t,n){n===void 0&&(n=!1);const r=Su(e),i=Av(e),o=Iv(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=tl(a)),[a,tl(a)]}function b5(e){const t=tl(e);return[Mp(e),t,Mp(t)]}function Mp(e){return e.replace(/start|end/g,t=>y5[t])}function S5(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 w5(e,t,n,r){const i=Su(e);let o=S5(Io(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(Mp)))),o}function tl(e){return e.replace(/left|right|bottom|top/g,t=>m5[t])}function C5(e){return{top:0,right:0,bottom:0,left:0,...e}}function nx(e){return typeof e!="number"?C5(e):{top:e,right:e,bottom:e,left:e}}function nl(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function mg(e,t,n){let{reference:r,floating:i}=e;const o=df(t),a=Av(t),s=Iv(a),u=Io(t),c=o==="y",l=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 p;switch(u){case"top":p={x:l,y:r.y-i.height};break;case"bottom":p={x:l,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Su(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1);break}return p}const x5=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 c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:l,y:f}=mg(c,r,u),d=r,p={},h=0;for(let v=0;v<s.length;v++){const{name:E,fn:x}=s[v],{x:m,y:S,data:C,reset:b}=await x({x:l,y:f,initialPlacement:r,placement:d,strategy:i,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});l=m??l,f=S??f,p={...p,[E]:{...p[E],...C}},b&&h<=50&&(h++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(c=b.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:l,y:f}=mg(c,d,u)),v=-1)}return{x:l,y:f,placement:d,strategy:i,middlewareData:p}};async function rx(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=bu(t,e),h=nx(p),v=s[d?f==="floating"?"reference":"floating":f],E=nl(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:c,rootBoundary:l,strategy:u})),x=f==="floating"?{...a.floating,x:r,y:i}:a.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(s.floating)),S=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},C=nl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:m,strategy:u}):x);return{top:(E.top-C.top+h.top)/S.y,bottom:(C.bottom-E.bottom+h.bottom)/S.y,left:(E.left-C.left+h.left)/S.x,right:(C.right-E.right+h.right)/S.x}}const E5=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:c,padding:l=0}=bu(e,t)||{};if(c==null)return{};const f=nx(l),d={x:n,y:r},p=Av(i),h=Iv(p),v=await a.getDimensions(c),E=p==="y",x=E?"top":"left",m=E?"bottom":"right",S=E?"clientHeight":"clientWidth",C=o.reference[h]+o.reference[p]-d[p]-o.floating[h],b=d[p]-o.reference[p],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let A=T?T[S]:0;(!A||!await(a.isElement==null?void 0:a.isElement(T)))&&(A=s.floating[S]||o.floating[h]);const D=C/2-b/2,I=A/2-v[h]/2-1,N=Ta(f[x],I),_=Ta(f[m],I),L=N,V=A-v[h]-_,H=A/2-v[h]/2+D,R=kp(L,H,V),ie=!u.arrow&&Su(i)!=null&&H!==R&&o.reference[h]/2-(H<L?N:_)-v[h]/2<0,B=ie?H<L?H-L:H-V:0;return{[p]:d[p]+B,data:{[p]:R,centerOffset:H-R-B,...ie&&{alignmentOffset:B}},reset:ie}}}),T5=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:c}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...E}=bu(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const x=Io(i),m=Io(s)===s,S=await(u.isRTL==null?void 0:u.isRTL(c.floating)),C=d||(m||!v?[tl(s)]:b5(s));!d&&h!=="none"&&C.push(...w5(s,v,h,S));const b=[s,...C],T=await rx(t,E),A=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(l&&A.push(T[x]),f){const L=g5(i,a,S);A.push(T[L[0]],T[L[1]])}if(D=[...D,{placement:i,overflows:A}],!A.every(L=>L<=0)){var I,N;const L=(((I=o.flip)==null?void 0:I.index)||0)+1,V=b[L];if(V)return{data:{index:L,overflows:D},reset:{placement:V}};let H=(N=D.filter(R=>R.overflows[0]<=0).sort((R,ie)=>R.overflows[1]-ie.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(p){case"bestFit":{var _;const R=(_=D.map(ie=>[ie.placement,ie.overflows.filter(B=>B>0).reduce((B,U)=>B+U,0)]).sort((ie,B)=>ie[1]-B[1])[0])==null?void 0:_[0];R&&(H=R);break}case"initialPlacement":H=s;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function I5(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Io(n),s=Su(n),u=df(n)==="y",c=["left","top"].includes(a)?-1:1,l=o&&u?-1:1,f=bu(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),u?{x:p*l,y:d*c}:{x:d*c,y:p*l}}const A5=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 I5(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}}}}},$5=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:E=>{let{x,y:m}=E;return{x,y:m}}},...u}=bu(e,t),c={x:n,y:r},l=await rx(t,u),f=df(Io(i)),d=tx(f);let p=c[d],h=c[f];if(o){const E=d==="y"?"top":"left",x=d==="y"?"bottom":"right",m=p+l[E],S=p-l[x];p=kp(m,p,S)}if(a){const E=f==="y"?"top":"left",x=f==="y"?"bottom":"right",m=h+l[E],S=h-l[x];h=kp(m,h,S)}const v=s.fn({...t,[d]:p,[f]:h});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function ix(e){const t=Qn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=$n(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=el(n)!==o||el(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function $v(e){return qt(e)?e:e.contextElement}function ma(e){const t=$v(e);if(!$n(t))return ki(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=ix(t);let a=(o?el(n.width):n.width)/r,s=(o?el(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const O5=ki(0);function ox(e){const t=Jn(e);return!Tv()||!t.visualViewport?O5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function D5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jn(e)?!1:t}function Ao(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=$v(e);let a=ki(1);t&&(r?qt(r)&&(a=ma(r)):a=ma(e));const s=D5(o,n,r)?ox(o):ki(0);let u=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,l=i.width/a.x,f=i.height/a.y;if(o){const d=Jn(o),p=r&&qt(r)?Jn(r):r;let h=d.frameElement;for(;h&&r&&p!==d;){const v=ma(h),E=h.getBoundingClientRect(),x=Qn(h),m=E.left+(h.clientLeft+parseFloat(x.paddingLeft))*v.x,S=E.top+(h.clientTop+parseFloat(x.paddingTop))*v.y;u*=v.x,c*=v.y,l*=v.x,f*=v.y,u+=m,c+=S,h=Jn(h).frameElement}}return nl({width:l,height:f,x:u,y:c})}const N5=[":popover-open",":modal"];function ax(e){let t=!1,n=0,r=0;function i(o){try{t=t||e.matches(o)}catch{}}if(N5.forEach(o=>{i(o)}),t){const o=XC(e);if(o){const a=o.getBoundingClientRect();n=a.x,r=a.y}}return[t,n,r]}function P5(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=ti(r),[a]=t?ax(t.floating):[!1];if(r===o||a)return n;let s={scrollLeft:0,scrollTop:0},u=ki(1);const c=ki(0),l=$n(r);if((l||!l&&i!=="fixed")&&((Qr(r)!=="body"||gu(o))&&(s=ff(r)),$n(r))){const f=Ao(r);u=ma(r),c.x=f.x+r.clientLeft,c.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+c.x,y:n.y*u.y-s.scrollTop*u.y+c.y}}function R5(e){return Array.from(e.getClientRects())}function sx(e){return Ao(ti(e)).left+ff(e).scrollLeft}function k5(e){const t=ti(e),n=ff(e),r=e.ownerDocument.body,i=fo(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=fo(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+sx(e);const s=-n.scrollTop;return Qn(r).direction==="rtl"&&(a+=fo(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}function M5(e,t){const n=Jn(e),r=ti(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,u=0;if(i){o=i.width,a=i.height;const c=Tv();(!c||c&&t==="fixed")&&(s=i.offsetLeft,u=i.offsetTop)}return{width:o,height:a,x:s,y:u}}function j5(e,t){const n=Ao(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=$n(e)?ma(e):ki(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,u=i*o.x,c=r*o.y;return{width:a,height:s,x:u,y:c}}function yg(e,t,n){let r;if(t==="viewport")r=M5(e,n);else if(t==="document")r=k5(ti(e));else if(qt(t))r=j5(t,n);else{const i=ox(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return nl(r)}function ux(e,t){const n=To(e);return n===t||!qt(n)||Ea(n)?!1:Qn(n).position==="fixed"||ux(n,t)}function _5(e,t){const n=t.get(e);if(n)return n;let r=Ci(e,[],!1).filter(s=>qt(s)&&Qr(s)!=="body"),i=null;const o=Qn(e).position==="fixed";let a=o?To(e):e;for(;qt(a)&&!Ea(a);){const s=Qn(a),u=Ev(a);!u&&s.position==="fixed"&&(i=null),(o?!u&&!i:!u&&s.position==="static"&&i&&["absolute","fixed"].includes(i.position)||gu(a)&&!u&&ux(e,a))?r=r.filter(c=>c!==a):i=s,a=To(a)}return t.set(e,r),r}function q5(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?_5(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((u,c)=>{const l=yg(t,c,i);return u.top=fo(l.top,u.top),u.right=Ta(l.right,u.right),u.bottom=Ta(l.bottom,u.bottom),u.left=fo(l.left,u.left),u},yg(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function F5(e){const{width:t,height:n}=ix(e);return{width:t,height:n}}function L5(e,t,n,r){const i=$n(t),o=ti(t),a=n==="fixed",s=Ao(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const c=ki(0);if(i||!i&&!a)if((Qr(t)!=="body"||gu(o))&&(u=ff(t)),i){const v=Ao(t,!0,a,t);c.x=v.x+t.clientLeft,c.y=v.y+t.clientTop}else o&&(c.x=sx(o));let l=s.left+u.scrollLeft-c.x,f=s.top+u.scrollTop-c.y;const[d,p,h]=ax(r);return d&&(l+=p,f+=h,i&&(l+=t.clientLeft,f+=t.clientTop)),{x:l,y:f,width:s.width,height:s.height}}function gg(e,t){return!$n(e)||Qn(e).position==="fixed"?null:t?t(e):e.offsetParent}function cx(e,t){const n=Jn(e);if(!$n(e))return n;let r=gg(e,t);for(;r&&s5(r)&&Qn(r).position==="static";)r=gg(r,t);return r&&(Qr(r)==="html"||Qr(r)==="body"&&Qn(r).position==="static"&&!Ev(r))?n:r||XC(e)||n}const B5=async function(e){const t=this.getOffsetParent||cx,n=this.getDimensions;return{reference:L5(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function V5(e){return Qn(e).direction==="rtl"}const lx={convertOffsetParentRelativeRectToViewportRelativeRect:P5,getDocumentElement:ti,getClippingRect:q5,getOffsetParent:cx,getElementRects:B5,getClientRects:R5,getDimensions:F5,getScale:ma,isElement:qt,isRTL:V5};function U5(e,t){let n=null,r;const i=ti(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:c,top:l,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p=Qu(l),h=Qu(i.clientWidth-(c+f)),v=Qu(i.clientHeight-(l+d)),E=Qu(c),x={rootMargin:-p+"px "+-h+"px "+-v+"px "+-E+"px",threshold:fo(0,Ta(1,u))||1};let m=!0;function S(C){const b=C[0].intersectionRatio;if(b!==u){if(!m)return a();b?a(!1,b):r=setTimeout(()=>{a(!1,1e-7)},100)}m=!1}try{n=new IntersectionObserver(S,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(e)}return a(!0),o}function G5(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,c=$v(e),l=i||o?[...c?Ci(c):[],...Ci(t)]:[];l.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const f=c&&s?U5(c,n):null;let d=-1,p=null;a&&(p=new ResizeObserver(x=>{let[m]=x;m&&m.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let h,v=u?Ao(e):null;u&&E();function E(){const x=Ao(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&n(),v=x,h=requestAnimationFrame(E)}return n(),()=>{var x;l.forEach(m=>{i&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(x=p)==null||x.disconnect(),p=null,u&&cancelAnimationFrame(h)}}const z5=$5,W5=T5,bg=E5,H5=(e,t,n)=>{const r=new Map,i={platform:lx,...n},o={...i.platform,_c:r};return x5(e,t,{...i,platform:o})},K5=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?bg({element:r.current,padding:i}).fn(n):{}:r?bg({element:r,padding:i}).fn(n):{}}}};var xc=typeof document<"u"?O.useLayoutEffect:O.useEffect;function rl(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(!rl(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)&&!rl(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function fx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sg(e,t){const n=fx(e);return Math.round(t*n)/n}function wg(e){const t=J.useRef(e);return xc(()=>{t.current=e}),t}function Y5(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:c}=e,[l,f]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=J.useState(r);rl(d,r)||p(r);const[h,v]=J.useState(null),[E,x]=J.useState(null),m=J.useCallback(B=>{B!==T.current&&(T.current=B,v(B))},[]),S=J.useCallback(B=>{B!==A.current&&(A.current=B,x(B))},[]),C=o||h,b=a||E,T=J.useRef(null),A=J.useRef(null),D=J.useRef(l),I=u!=null,N=wg(u),_=wg(i),L=J.useCallback(()=>{if(!T.current||!A.current)return;const B={placement:t,strategy:n,middleware:d};_.current&&(B.platform=_.current),H5(T.current,A.current,B).then(U=>{const fe={...U,isPositioned:!0};V.current&&!rl(D.current,fe)&&(D.current=fe,o1.flushSync(()=>{f(fe)}))})},[d,t,n,_]);xc(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[c]);const V=J.useRef(!1);xc(()=>(V.current=!0,()=>{V.current=!1}),[]),xc(()=>{if(C&&(T.current=C),b&&(A.current=b),C&&b){if(N.current)return N.current(C,b,L);L()}},[C,b,L,N,I]);const H=J.useMemo(()=>({reference:T,floating:A,setReference:m,setFloating:S}),[m,S]),R=J.useMemo(()=>({reference:C,floating:b}),[C,b]),ie=J.useMemo(()=>{const B={position:n,left:0,top:0};if(!R.floating)return B;const U=Sg(R.floating,l.x),fe=Sg(R.floating,l.y);return s?{...B,transform:"translate("+U+"px, "+fe+"px)",...fx(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:fe}},[n,s,R.floating,l.x,l.y]);return J.useMemo(()=>({...l,update:L,refs:H,elements:R,floatingStyles:ie}),[l,L,H,R,ie])}/*!
|
|
1148
1148
|
* tabbable 6.2.0
|
|
1149
1149
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
1150
|
-
*/var Q5=["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])"],jp=Q5.join(","),dx=typeof Element>"u",Js=dx?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,il=!dx&&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},ol=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},Z5=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},e3=function(e,t,n){if(ol(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(jp));return t&&Js.call(e,jp)&&r.unshift(e),r=r.filter(n),r},t3=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!ol(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),u=s.length?s:a.children,c=e(u,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:a,candidates:c})}else{var l=Js.call(a,jp);l&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!ol(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var p=e(f===!0?a.children:f.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:a,candidates:p})}else o.unshift.apply(o,a.children)}}return i},px=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},hx=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Z5(e))&&!px(e)?0:e.tabIndex},n3=function(e,t){var n=hx(e);return n<0&&t&&!px(e)?0:n},r3=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},vx=function(e){return e.tagName==="INPUT"},i3=function(e){return vx(e)&&e.type==="hidden"},o3=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},a3=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},s3=function(e){if(!e.name)return!0;var t=e.form||il(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=a3(r,e.form);return!i||i===e},u3=function(e){return vx(e)&&e.type==="radio"},c3=function(e){return u3(e)&&!s3(e)},l3=function(e){var t,n=e&&il(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,c,l;n=il(r),r=(u=n)===null||u===void 0?void 0:u.host,i=!!((c=r)!==null&&c!==void 0&&(l=c.ownerDocument)!==null&&l!==void 0&&l.contains(r))}}return i},wg=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},f3=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=Js.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(Js.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=il(e);if(s&&!s.shadowRoot&&r(s)===!0)return wg(e);e.assignedSlot?e=e.assignedSlot:!s&&u!==e.ownerDocument?e=u.host:e=s}e=a}if(l3(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return wg(e);return!1},d3=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 Js.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},p3=function(e,t){return!(t.disabled||ol(t)||i3(t)||f3(t,e)||o3(t)||d3(t))},xg=function(e,t){return!(c3(t)||hx(t)<0||!p3(e,t))},h3=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},v3=function e(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,u=n3(s,a),c=a?e(i.candidates):s;u===0?a?n.push.apply(n,c):n.push(s):r.push({documentOrder:o,tabIndex:u,item:i,isScope:a,content:c})}),r.sort(r3).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Ov=function(e,t){t=t||{};var n;return t.getShadowRoot?n=t3([e],t.includeContainer,{filter:xg.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:h3}):n=e3(e,t.includeContainer,xg.bind(null,t)),v3(n)};function Dv(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 m3=J["useInsertionEffect".toString()],y3=m3||(e=>e());function ra(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return y3(()=>{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 Eg=0;function Ki(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Eg);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Eg=requestAnimationFrame(o)}var or=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Aa(){return Aa=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},Aa.apply(this,arguments)}let Hf=!1,g3=0;const Tg=()=>"floating-ui-"+g3++;function b3(){const[e,t]=J.useState(()=>Hf?Tg():void 0);return or(()=>{e==null&&t(Tg())},[]),J.useEffect(()=>{Hf||(Hf=!0)},[]),e}const S3=J["useId".toString()],pf=S3||b3,C3=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:c,stroke:l,d:f,style:{transform:d,...p}={},...h}=e;process.env.NODE_ENV!=="production"&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=pf();if(!r)return null;u*=2;const E=u/2,x=o/2*(s/-8+1),m=a/2*s/4,[C,w]=n.split("-"),b=lx.isRTL(r),T=!!f,A=C==="top"||C==="bottom",D=c&&w==="end"?"bottom":"top";let I=c&&w==="end"?"right":"left";c&&b&&(I=w==="end"?"left":"right");const N=(i==null?void 0:i.x)!=null?c||i.x:"",_=(i==null?void 0:i.y)!=null?c||i.y:"",L=f||"M0,0"+(" H"+o)+(" L"+(o-x)+","+(a-m))+(" Q"+o/2+","+a+" "+x+","+(a-m))+" Z",V={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[C];return J.createElement("svg",Aa({},h,{"aria-hidden":!0,ref:t,width:T?o:o+u,height:o,viewBox:"0 0 "+o+" "+(a>o?a:o),style:{position:"absolute",pointerEvents:"none",[I]:N,[D]:_,[C]:A||T?"100%":"calc(100% - "+u/2+"px)",transform:""+V+(d??""),...p}}),u>0&&J.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:l,strokeWidth:u+(f?0:1),d:L}),J.createElement("path",{stroke:u&&!f?h.fill:"none",d:L}),J.createElement("clipPath",{id:v},J.createElement("rect",{x:-E,y:E*(T?-1:1),width:o+u,height:o})))});function w3(){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 x3=J.createContext(null),E3=J.createContext(null),T3=()=>{var e;return((e=J.useContext(x3))==null?void 0:e.id)||null},Nv=()=>J.useContext(E3);function Qs(e){return"data-floating-ui-"+e}function Kf(e){const t=O.useRef(e);return or(()=>{t.current=e}),t}function I3(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 As(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 Xo=new WeakMap,Zu=new WeakSet,ec={},Yf=0;const A3=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,mx=e=>e&&(e.host||mx(e.parentNode)),$3=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=mx(n);return e.contains(r)?r:null}).filter(n=>n!=null);function O3(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=$3(t,e),s=new Set,u=new Set(a),c=[];ec[i]||(ec[i]=new WeakMap);const l=ec[i];a.forEach(f),d(t),s.clear();function f(p){!p||s.has(p)||(s.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,h=>{if(s.has(h))d(h);else{const v=o?h.getAttribute(o):null,E=v!==null&&v!=="false",x=(Xo.get(h)||0)+1,m=(l.get(h)||0)+1;Xo.set(h,x),l.set(h,m),c.push(h),x===1&&E&&Zu.add(h),m===1&&h.setAttribute(i,""),!E&&o&&h.setAttribute(o,"true")}})}return Yf++,()=>{c.forEach(p=>{const h=(Xo.get(p)||0)-1,v=(l.get(p)||0)-1;Xo.set(p,h),l.set(p,v),h||(!Zu.has(p)&&o&&p.removeAttribute(o),Zu.delete(p)),v||p.removeAttribute(i)}),Yf--,Yf||(Xo=new WeakMap,Xo=new WeakMap,Zu=new WeakSet,ec={})}}function Ig(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Vr(e[0]).body;return O3(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Pv=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function yx(e,t){const n=Ov(e,Pv());t==="prev"&&n.reverse();const r=n.indexOf(ta(Vr(e)));return n.slice(r+1)[0]}function gx(){return yx(document.body,"next")}function bx(){return yx(document.body,"prev")}function $s(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Bn(n,r)}function D3(e){Ov(e,Pv()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function N3(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 Rv={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 P3;function Ag(e){e.key==="Tab"&&(e.target,clearTimeout(P3))}const al=J.forwardRef(function(e,t){const[n,r]=J.useState();or(()=>(d5()&&r("button"),document.addEventListener("keydown",Ag),()=>{document.removeEventListener("keydown",Ag)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[Qs("focus-guard")]:"",style:Rv};return J.createElement("span",Aa({},e,i))}),Sx=J.createContext(null),$g=Qs("portal");function R3(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=J.useState(null),o=pf(),a=wx(),s=J.useRef(null);return or(()=>()=>{r==null||r.remove(),queueMicrotask(()=>{s.current=null})},[r]),or(()=>{if(s.current)return;const u=t?document.getElementById(t):null;if(!u)return;const c=document.createElement("div");c.id=o,c.setAttribute($g,""),u.appendChild(c),s.current=c,i(c)},[t,o]),or(()=>{if(s.current)return;let u=n||(a==null?void 0:a.portalNode);u&&!qt(u)&&(u=u.current),u=u||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,u.appendChild(c));const l=document.createElement("div");l.id=o,l.setAttribute($g,""),u=c||u,u.appendChild(l),s.current=l,i(l)},[t,n,o,a]),r}function Cx(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=R3({id:n,root:r}),[a,s]=J.useState(null),u=J.useRef(null),c=J.useRef(null),l=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 p(h){o&&$s(h)&&(h.type==="focusin"?N3:D3)(o)}return o.addEventListener("focusin",p,!0),o.addEventListener("focusout",p,!0),()=>{o.removeEventListener("focusin",p,!0),o.removeEventListener("focusout",p,!0)}},[o,i,a==null?void 0:a.modal]),J.createElement(Sx.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:l,afterInsideRef:f,portalNode:o,setFocusManagerState:s}),[i,o])},d&&o&&J.createElement(al,{"data-type":"outside",ref:u,onFocus:p=>{if($s(p,o)){var h;(h=l.current)==null||h.focus()}else{const v=bx()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus()}}}),d&&o&&J.createElement("span",{"aria-owns":o.id,style:Rv}),o&&Yg.createPortal(t,o),d&&o&&J.createElement(al,{"data-type":"outside",ref:c,onFocus:p=>{if($s(p,o)){var h;(h=f.current)==null||h.focus()}else{const v=gx()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,p.nativeEvent))}}}))}const wx=()=>J.useContext(Sx),Og=20;let to=[];function Xf(e){to=to.filter(t=>t.isConnected),e&&ei(e)!=="body"&&(to.push(e),to.length>Og&&(to=to.slice(-Og)))}function Dg(){return to.slice().reverse().find(e=>e.isConnected)}const k3=J.forwardRef(function(e,t){return J.createElement("button",Aa({},e,{type:"button",ref:t,tabIndex:-1,style:Rv}))});function xx(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:c=!1,closeOnFocusOut:l=!0}=e,{open:f,refs:d,nodeId:p,onOpenChange:h,events:v,dataRef:E,elements:{domReference:x,floating:m}}=t,C=typeof a=="number"&&a<0,w=y5(x)&&C,b=A3()?o:!0,T=Kf(i),A=Kf(a),D=Kf(s),I=Nv(),N=wx(),_=J.useRef(null),L=J.useRef(null),V=J.useRef(!1),H=J.useRef(!1),R=N!=null,ie=J.useCallback(function(M){return M===void 0&&(M=m),M?Ov(M,Pv()):[]},[m]),B=J.useCallback(M=>{const P=ie(M);return T.current.map(te=>x&&te==="reference"?x:m&&te==="floating"?m:P).filter(Boolean).flat()},[x,m,T,ie]);J.useEffect(()=>{if(r||!u)return;function M(te){if(te.key==="Tab"){Bn(m,ta(Vr(m)))&&ie().length===0&&!w&&Wf(te);const oe=B(),K=na(te);T.current[0]==="reference"&&K===x&&(Wf(te),te.shiftKey?Ki(oe[oe.length-1]):Ki(oe[1])),T.current[1]==="floating"&&K===m&&te.shiftKey&&(Wf(te),Ki(oe[0]))}}const P=Vr(m);return P.addEventListener("keydown",M),()=>{P.removeEventListener("keydown",M)}},[r,x,m,u,T,w,ie,B]),J.useEffect(()=>{if(r||!l)return;function M(){H.current=!0,setTimeout(()=>{H.current=!1})}function P(te){const oe=te.relatedTarget;queueMicrotask(()=>{const K=!(Bn(x,oe)||Bn(m,oe)||Bn(oe,m)||Bn(N==null?void 0:N.portalNode,oe)||oe!=null&&oe.hasAttribute(Qs("focus-guard"))||I&&(As(I.nodesRef.current,p).find(ae=>{var de,he;return Bn((de=ae.context)==null?void 0:de.elements.floating,oe)||Bn((he=ae.context)==null?void 0:he.elements.domReference,oe)})||I3(I.nodesRef.current,p).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&&K&&!H.current&&oe!==Dg()&&(V.current=!0,h(!1,te))})}if(m&&$n(x))return x.addEventListener("focusout",P),x.addEventListener("pointerdown",M),!u&&m.addEventListener("focusout",P),()=>{x.removeEventListener("focusout",P),x.removeEventListener("pointerdown",M),!u&&m.removeEventListener("focusout",P)}},[r,x,m,u,p,I,N,h,l]),J.useEffect(()=>{var M;if(r)return;const P=Array.from((N==null||(M=N.portalNode)==null?void 0:M.querySelectorAll("["+Qs("portal")+"]"))||[]);if(m){const te=[m,...P,_.current,L.current,T.current.includes("reference")||w?x:null].filter(K=>K!=null),oe=u||w?Ig(te,b,!b):Ig(te);return()=>{oe()}}},[r,x,m,u,T,N,w,b]),or(()=>{if(r||!m)return;const M=Vr(m),P=ta(M);queueMicrotask(()=>{const te=B(m),oe=A.current,K=(typeof oe=="number"?te[oe]:oe.current)||m,ae=Bn(m,P);!C&&!ae&&f&&Ki(K,{preventScroll:K===m})})},[r,f,m,C,B,A]),or(()=>{if(r||!m)return;let M=!1;const P=Vr(m),te=ta(P),oe=E.current;Xf(te);function K(ae){let{reason:de,event:he,nested:xe}=ae;de==="escape-key"&&d.domReference.current&&Xf(d.domReference.current),de==="hover"&&he.type==="mouseleave"&&(V.current=!0),de==="outside-press"&&(xe?(V.current=!1,M=!0):V.current=!(l5(he)||f5(he)))}return v.on("openchange",K),()=>{v.off("openchange",K);const ae=ta(P),de=Bn(m,ae)||I&&As(I.nodesRef.current,p).some(xe=>{var Re;return Bn((Re=xe.context)==null?void 0:Re.elements.floating,ae)});(de||oe.openEvent&&["click","mousedown"].includes(oe.openEvent.type))&&d.domReference.current&&Xf(d.domReference.current);const he=Dg();D.current&&!V.current&&$n(he)&&(!(he!==ae&&ae!==P.body)||de)&&Ki(he,{cancelPrevious:!1,preventScroll:M})}},[r,m,D,E,d,v,I,p]),or(()=>{if(!(r||!N))return N.setFocusManagerState({modal:u,closeOnFocusOut:l,open:f,onOpenChange:h,refs:d}),()=>{N.setFocusManagerState(null)}},[r,N,u,f,h,d,l]),or(()=>{if(r||!m||typeof MutationObserver!="function"||C)return;const M=()=>{const te=m.getAttribute("tabindex");T.current.includes("floating")||ta(Vr(m))!==d.domReference.current&&ie().length===0?te!=="0"&&m.setAttribute("tabindex","0"):te!=="-1"&&m.setAttribute("tabindex","-1")};M();const P=new MutationObserver(M);return P.observe(m,{childList:!0,subtree:!0,attributes:!0}),()=>{P.disconnect()}},[r,m,d,T,ie,C]);function U(M){return r||!c||!u?null:J.createElement(k3,{ref:M==="start"?_:L,onClick:P=>h(!1,P.nativeEvent)},typeof c=="string"?c:"Dismiss")}const fe=!r&&b&&(R||u);return J.createElement(J.Fragment,null,fe&&J.createElement(al,{"data-type":"inside",ref:N==null?void 0:N.beforeInsideRef,onFocus:M=>{if(u){const te=B();Ki(i[0]==="reference"?te[0]:te[te.length-1])}else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(V.current=!1,$s(M,N.portalNode)){const te=gx()||x;te==null||te.focus()}else{var P;(P=N.beforeOutsideRef.current)==null||P.focus()}}}),!w&&U("start"),n,U("end"),fe&&J.createElement(al,{"data-type":"inside",ref:N==null?void 0:N.afterInsideRef,onFocus:M=>{if(u)Ki(B()[0]);else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(l&&(V.current=!0),$s(M,N.portalNode)){const te=bx()||x;te==null||te.focus()}else{var P;(P=N.afterOutsideRef.current)==null||P.focus()}}}))}const Jf=new Set,Ex=J.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;const i=pf();return or(()=>{if(!n)return;Jf.add(i);const o=/iP(hone|ad|od)|iOS/.test(Qw()),a=document.body.style,s=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,c=a.left?parseFloat(a.left):window.pageXOffset,l=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",u&&(a[s]=u+"px"),o){var f,d;const p=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,h=((d=window.visualViewport)==null?void 0:d.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(l-Math.floor(h))+"px",left:-(c-Math.floor(p))+"px",right:"0"})}return()=>{Jf.delete(i),Jf.size===0&&(Object.assign(a,{overflow:"",[s]:""}),o&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(c,l)))}},[i,n]),J.createElement("div",Aa({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function Ng(e){return $n(e.target)&&e.target.tagName==="BUTTON"}function Pg(e){return ex(e)}function Tx(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:c=!1,keyboardHandlers:l=!0}=t,f=J.useRef(),d=J.useRef(!1);return J.useMemo(()=>a?{reference:{onPointerDown(p){f.current=p.pointerType},onMouseDown(p){p.button===0&&(vg(f.current,!0)&&c||s!=="click"&&(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){if(s==="mousedown"&&f.current){f.current=void 0;return}vg(f.current,!0)&&c||(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!l||Ng(p))&&(p.key===" "&&!Pg(o)&&(p.preventDefault(),d.current=!0),p.key==="Enter"&&r(!(n&&u),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!l||Ng(p)||Pg(o)||p.key===" "&&d.current&&(d.current=!1,r(!(n&&u),p.nativeEvent,"click"))}}}:{},[a,i,s,c,l,o,u,n,r])}const M3={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},j3={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Rg=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 Ix(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:i,elements:{reference:o,domReference:a,floating:s},dataRef:u}=e,{enabled:c=!0,escapeKey:l=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:p=!1,referencePressEvent:h="pointerdown",ancestorScroll:v=!1,bubbles:E,capture:x}=t,m=Nv(),C=ra(typeof f=="function"?f:()=>!1),w=typeof f=="function"?C:f,b=J.useRef(!1),T=J.useRef(!1),{escapeKey:A,outsidePress:D}=Rg(E),{escapeKey:I,outsidePress:N}=Rg(x),_=ra(R=>{if(!n||!c||!l||R.key!=="Escape")return;const ie=m?As(m.nodesRef.current,i):[];if(!A&&(R.stopPropagation(),ie.length>0)){let B=!0;if(ie.forEach(U=>{var fe;if((fe=U.context)!=null&&fe.open&&!U.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,h5(R)?R.nativeEvent:R,"escape-key")}),L=ra(R=>{var ie;const B=()=>{var U;_(R),(U=na(R))==null||U.removeEventListener("keydown",B)};(ie=na(R))==null||ie.addEventListener("keydown",B)}),V=ra(R=>{const ie=b.current;b.current=!1;const B=T.current;if(T.current=!1,d==="click"&&B||ie||typeof w=="function"&&!w(R))return;const U=na(R),fe="["+Qs("inert")+"]",M=Vr(s).querySelectorAll(fe);let P=qt(U)?U:null;for(;P&&!Ta(P);){const K=To(P);if(Ta(K)||!qt(K))break;P=K}if(M.length&&qt(U)&&!v5(U)&&!Bn(U,s)&&Array.from(M).every(K=>!Bn(P,K)))return;if($n(U)&&s){const K=U.clientWidth>0&&U.scrollWidth>U.clientWidth,ae=U.clientHeight>0&&U.scrollHeight>U.clientHeight;let de=ae&&R.offsetX>U.clientWidth;if(ae&&Qn(U).direction==="rtl"&&(de=R.offsetX<=U.offsetWidth-U.clientWidth),de||K&&R.offsetY>U.clientHeight)return}const te=m&&As(m.nodesRef.current,i).some(K=>{var ae;return zf(R,(ae=K.context)==null?void 0:ae.elements.floating)});if(zf(R,s)||zf(R,a)||te)return;const oe=m?As(m.nodesRef.current,i):[];if(oe.length>0){let K=!0;if(oe.forEach(ae=>{var de;if((de=ae.context)!=null&&de.open&&!ae.context.dataRef.current.__outsidePressBubbles){K=!1;return}}),!K)return}r(!1,R,"outside-press")}),H=ra(R=>{var ie;const B=()=>{var U;V(R),(U=na(R))==null||U.removeEventListener(d,B)};(ie=na(R))==null||ie.addEventListener(d,B)});return J.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=D;function R(U){r(!1,U,"ancestor-scroll")}const ie=Vr(s);l&&ie.addEventListener("keydown",I?L:_,I),w&&ie.addEventListener(d,N?H:V,N);let B=[];return v&&(qt(a)&&(B=wi(a)),qt(s)&&(B=B.concat(wi(s))),!qt(o)&&o&&o.contextElement&&(B=B.concat(wi(o.contextElement)))),B=B.filter(U=>{var fe;return U!==((fe=ie.defaultView)==null?void 0:fe.visualViewport)}),B.forEach(U=>{U.addEventListener("scroll",R,{passive:!0})}),()=>{l&&ie.removeEventListener("keydown",I?L:_,I),w&&ie.removeEventListener(d,N?H:V,N),B.forEach(U=>{U.removeEventListener("scroll",R)})}},[u,s,a,o,l,w,d,n,r,v,c,A,D,_,I,L,V,N,H]),J.useEffect(()=>{b.current=!1},[w,d]),J.useMemo(()=>c?{reference:{onKeyDown:_,[M3[h]]:R=>{p&&r(!1,R.nativeEvent,"reference-press")}},floating:{onKeyDown:_,onMouseDown(){T.current=!0},onMouseUp(){T.current=!0},[j3[d]]:()=>{b.current=!0}}}:{},[c,p,d,h,r,_])}let _p;process.env.NODE_ENV!=="production"&&(_p=new Set);function Ax(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 D="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&&!qt(e.elements.reference)){var a;if(!((a=_p)!=null&&a.has(D))){var s;(s=_p)==null||s.add(D),console.error(D)}}}const[u,c]=J.useState(null),l=((t=e.elements)==null?void 0:t.reference)||u,f=J5(e),d=Nv(),p=T3()!=null,h=ra((D,I,N)=>{D&&(E.current.openEvent=I),x.emit("openchange",{open:D,event:I,reason:N,nested:p}),r==null||r(D,I,N)}),v=J.useRef(null),E=J.useRef({}),x=J.useState(()=>w3())[0],m=pf(),C=J.useCallback(D=>{const I=qt(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),contextElement:D}:D;f.refs.setReference(I)},[f.refs]),w=J.useCallback(D=>{(qt(D)||D===null)&&(v.current=D,c(D)),(qt(f.refs.reference.current)||f.refs.reference.current===null||D!==null&&!qt(D))&&f.refs.setReference(D)},[f.refs]),b=J.useMemo(()=>({...f.refs,setReference:w,setPositionReference:C,domReference:v}),[f.refs,w,C]),T=J.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),A=J.useMemo(()=>({...f,refs:b,elements:T,dataRef:E,nodeId:i,floatingId:m,events:x,open:n,onOpenChange:h}),[f,i,m,x,n,h,b,T]);return or(()=>{const D=d==null?void 0:d.nodesRef.current.find(I=>I.id===i);D&&(D.context=A)}),J.useMemo(()=>({...f,context:A,refs:b,elements:T}),[f,b,T,A])}const kg="active",Mg="selected";function Qf(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[kg]:a,[Mg]: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[c,l]=u;if(!(i&&[kg,Mg].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof l=="function"){var f;(f=r.get(c))==null||f.push(l),a[c]=function(){for(var d,p=arguments.length,h=new Array(p),v=0;v<p;v++)h[v]=arguments[v];return(d=r.get(c))==null?void 0:d.map(E=>E(...h)).find(E=>E!==void 0)}}}else a[c]=l}),a),{})}}function $x(e){e===void 0&&(e=[]);const t=e,n=J.useCallback(o=>Qf(o,e,"reference"),t),r=J.useCallback(o=>Qf(o,e,"floating"),t),i=J.useCallback(o=>Qf(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 _3(e={}){const{initialOpen:t=!1,open:n,onOpenChange:r}=e,[i,o]=J.useState(t),a=n??i,s=r??o,u=Ax({open:a,onOpenChange:s}),c=u.context,l=Tx(c,{enabled:n==null}),f=Ix(c,{outsidePressEvent:"mousedown"}),d=$x([l,f]);return J.useMemo(()=>({open:a,setOpen:s,...d,...u}),[a,s,d,u])}const Ox=J.createContext(null),Dx=()=>{const e=J.useContext(Ox);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function q3({children:e,...t}){const n=_3(t);return $.jsx(Ox.Provider,{value:n,children:e})}const Nx=cv`
|
|
1150
|
+
*/var X5=["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])"],jp=X5.join(","),dx=typeof Element>"u",Xs=dx?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,il=!dx&&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},ol=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},J5=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},Q5=function(e,t,n){if(ol(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(jp));return t&&Xs.call(e,jp)&&r.unshift(e),r=r.filter(n),r},Z5=function e(t,n,r){for(var i=[],o=Array.from(t);o.length;){var a=o.shift();if(!ol(a,!1))if(a.tagName==="SLOT"){var s=a.assignedElements(),u=s.length?s:a.children,c=e(u,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:a,candidates:c})}else{var l=Xs.call(a,jp);l&&r.filter(a)&&(n||!t.includes(a))&&i.push(a);var f=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),d=!ol(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(f&&d){var p=e(f===!0?a.children:f.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:a,candidates:p})}else o.unshift.apply(o,a.children)}}return i},px=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},hx=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||J5(e))&&!px(e)?0:e.tabIndex},e3=function(e,t){var n=hx(e);return n<0&&t&&!px(e)?0:n},t3=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},vx=function(e){return e.tagName==="INPUT"},n3=function(e){return vx(e)&&e.type==="hidden"},r3=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},i3=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},o3=function(e){if(!e.name)return!0;var t=e.form||il(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=i3(r,e.form);return!i||i===e},a3=function(e){return vx(e)&&e.type==="radio"},s3=function(e){return a3(e)&&!o3(e)},u3=function(e){var t,n=e&&il(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,c,l;n=il(r),r=(u=n)===null||u===void 0?void 0:u.host,i=!!((c=r)!==null&&c!==void 0&&(l=c.ownerDocument)!==null&&l!==void 0&&l.contains(r))}}return i},Cg=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},c3=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=Xs.call(e,"details>summary:first-of-type"),o=i?e.parentElement:e;if(Xs.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=il(e);if(s&&!s.shadowRoot&&r(s)===!0)return Cg(e);e.assignedSlot?e=e.assignedSlot:!s&&u!==e.ownerDocument?e=u.host:e=s}e=a}if(u3(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return Cg(e);return!1},l3=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 Xs.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},f3=function(e,t){return!(t.disabled||ol(t)||n3(t)||c3(t,e)||r3(t)||l3(t))},xg=function(e,t){return!(s3(t)||hx(t)<0||!f3(e,t))},d3=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},p3=function e(t){var n=[],r=[];return t.forEach(function(i,o){var a=!!i.scopeParent,s=a?i.scopeParent:i,u=e3(s,a),c=a?e(i.candidates):s;u===0?a?n.push.apply(n,c):n.push(s):r.push({documentOrder:o,tabIndex:u,item:i,isScope:a,content:c})}),r.sort(t3).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},Ov=function(e,t){t=t||{};var n;return t.getShadowRoot?n=Z5([e],t.includeContainer,{filter:xg.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:d3}):n=Q5(e,t.includeContainer,xg.bind(null,t)),p3(n)};function Dv(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 h3=J["useInsertionEffect".toString()],v3=h3||(e=>e());function na(e){const t=J.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return v3(()=>{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 Eg=0;function Ki(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Eg);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Eg=requestAnimationFrame(o)}var or=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Ia(){return Ia=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},Ia.apply(this,arguments)}let Hf=!1,m3=0;const Tg=()=>"floating-ui-"+m3++;function y3(){const[e,t]=J.useState(()=>Hf?Tg():void 0);return or(()=>{e==null&&t(Tg())},[]),J.useEffect(()=>{Hf||(Hf=!0)},[]),e}const g3=J["useId".toString()],pf=g3||y3,b3=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:c,stroke:l,d:f,style:{transform:d,...p}={},...h}=e;process.env.NODE_ENV!=="production"&&(t||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const v=pf();if(!r)return null;u*=2;const E=u/2,x=o/2*(s/-8+1),m=a/2*s/4,[S,C]=n.split("-"),b=lx.isRTL(r),T=!!f,A=S==="top"||S==="bottom",D=c&&C==="end"?"bottom":"top";let I=c&&C==="end"?"right":"left";c&&b&&(I=C==="end"?"left":"right");const N=(i==null?void 0:i.x)!=null?c||i.x:"",_=(i==null?void 0:i.y)!=null?c||i.y:"",L=f||"M0,0"+(" H"+o)+(" L"+(o-x)+","+(a-m))+(" Q"+o/2+","+a+" "+x+","+(a-m))+" Z",V={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[S];return J.createElement("svg",Ia({},h,{"aria-hidden":!0,ref:t,width:T?o:o+u,height:o,viewBox:"0 0 "+o+" "+(a>o?a:o),style:{position:"absolute",pointerEvents:"none",[I]:N,[D]:_,[S]:A||T?"100%":"calc(100% - "+u/2+"px)",transform:""+V+(d??""),...p}}),u>0&&J.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:l,strokeWidth:u+(f?0:1),d:L}),J.createElement("path",{stroke:u&&!f?h.fill:"none",d:L}),J.createElement("clipPath",{id:v},J.createElement("rect",{x:-E,y:E*(T?-1:1),width:o+u,height:o})))});function S3(){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 w3=J.createContext(null),C3=J.createContext(null),x3=()=>{var e;return((e=J.useContext(w3))==null?void 0:e.id)||null},Nv=()=>J.useContext(C3);function Js(e){return"data-floating-ui-"+e}function Kf(e){const t=O.useRef(e);return or(()=>{t.current=e}),t}function E3(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 Is(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 Yo=new WeakMap,Zu=new WeakSet,ec={},Yf=0;const T3=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,mx=e=>e&&(e.host||mx(e.parentNode)),I3=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=mx(n);return e.contains(r)?r:null}).filter(n=>n!=null);function A3(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,a=I3(t,e),s=new Set,u=new Set(a),c=[];ec[i]||(ec[i]=new WeakMap);const l=ec[i];a.forEach(f),d(t),s.clear();function f(p){!p||s.has(p)||(s.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,h=>{if(s.has(h))d(h);else{const v=o?h.getAttribute(o):null,E=v!==null&&v!=="false",x=(Yo.get(h)||0)+1,m=(l.get(h)||0)+1;Yo.set(h,x),l.set(h,m),c.push(h),x===1&&E&&Zu.add(h),m===1&&h.setAttribute(i,""),!E&&o&&h.setAttribute(o,"true")}})}return Yf++,()=>{c.forEach(p=>{const h=(Yo.get(p)||0)-1,v=(l.get(p)||0)-1;Yo.set(p,h),l.set(p,v),h||(!Zu.has(p)&&o&&p.removeAttribute(o),Zu.delete(p)),v||p.removeAttribute(i)}),Yf--,Yf||(Yo=new WeakMap,Yo=new WeakMap,Zu=new WeakSet,ec={})}}function Ig(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Vr(e[0]).body;return A3(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Pv=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function yx(e,t){const n=Ov(e,Pv());t==="prev"&&n.reverse();const r=n.indexOf(ea(Vr(e)));return n.slice(r+1)[0]}function gx(){return yx(document.body,"next")}function bx(){return yx(document.body,"prev")}function As(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Bn(n,r)}function $3(e){Ov(e,Pv()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function O3(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 Rv={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 D3;function Ag(e){e.key==="Tab"&&(e.target,clearTimeout(D3))}const al=J.forwardRef(function(e,t){const[n,r]=J.useState();or(()=>(l5()&&r("button"),document.addEventListener("keydown",Ag),()=>{document.removeEventListener("keydown",Ag)}),[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[Js("focus-guard")]:"",style:Rv};return J.createElement("span",Ia({},e,i))}),Sx=J.createContext(null),$g=Js("portal");function N3(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=J.useState(null),o=pf(),a=Cx(),s=J.useRef(null);return or(()=>()=>{r==null||r.remove(),queueMicrotask(()=>{s.current=null})},[r]),or(()=>{if(s.current)return;const u=t?document.getElementById(t):null;if(!u)return;const c=document.createElement("div");c.id=o,c.setAttribute($g,""),u.appendChild(c),s.current=c,i(c)},[t,o]),or(()=>{if(s.current)return;let u=n||(a==null?void 0:a.portalNode);u&&!qt(u)&&(u=u.current),u=u||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,u.appendChild(c));const l=document.createElement("div");l.id=o,l.setAttribute($g,""),u=c||u,u.appendChild(l),s.current=l,i(l)},[t,n,o,a]),r}function wx(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=N3({id:n,root:r}),[a,s]=J.useState(null),u=J.useRef(null),c=J.useRef(null),l=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 p(h){o&&As(h)&&(h.type==="focusin"?O3:$3)(o)}return o.addEventListener("focusin",p,!0),o.addEventListener("focusout",p,!0),()=>{o.removeEventListener("focusin",p,!0),o.removeEventListener("focusout",p,!0)}},[o,i,a==null?void 0:a.modal]),J.createElement(Sx.Provider,{value:J.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:c,beforeInsideRef:l,afterInsideRef:f,portalNode:o,setFocusManagerState:s}),[i,o])},d&&o&&J.createElement(al,{"data-type":"outside",ref:u,onFocus:p=>{if(As(p,o)){var h;(h=l.current)==null||h.focus()}else{const v=bx()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus()}}}),d&&o&&J.createElement("span",{"aria-owns":o.id,style:Rv}),o&&Yg.createPortal(t,o),d&&o&&J.createElement(al,{"data-type":"outside",ref:c,onFocus:p=>{if(As(p,o)){var h;(h=f.current)==null||h.focus()}else{const v=gx()||(a==null?void 0:a.refs.domReference.current);v==null||v.focus(),a!=null&&a.closeOnFocusOut&&(a==null||a.onOpenChange(!1,p.nativeEvent))}}}))}const Cx=()=>J.useContext(Sx),Og=20;let to=[];function Xf(e){to=to.filter(t=>t.isConnected),e&&Qr(e)!=="body"&&(to.push(e),to.length>Og&&(to=to.slice(-Og)))}function Dg(){return to.slice().reverse().find(e=>e.isConnected)}const P3=J.forwardRef(function(e,t){return J.createElement("button",Ia({},e,{type:"button",ref:t,tabIndex:-1,style:Rv}))});function xx(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:c=!1,closeOnFocusOut:l=!0}=e,{open:f,refs:d,nodeId:p,onOpenChange:h,events:v,dataRef:E,elements:{domReference:x,floating:m}}=t,S=typeof a=="number"&&a<0,C=v5(x)&&S,b=T3()?o:!0,T=Kf(i),A=Kf(a),D=Kf(s),I=Nv(),N=Cx(),_=J.useRef(null),L=J.useRef(null),V=J.useRef(!1),H=J.useRef(!1),R=N!=null,ie=J.useCallback(function(M){return M===void 0&&(M=m),M?Ov(M,Pv()):[]},[m]),B=J.useCallback(M=>{const P=ie(M);return T.current.map(te=>x&&te==="reference"?x:m&&te==="floating"?m:P).filter(Boolean).flat()},[x,m,T,ie]);J.useEffect(()=>{if(r||!u)return;function M(te){if(te.key==="Tab"){Bn(m,ea(Vr(m)))&&ie().length===0&&!C&&Wf(te);const oe=B(),K=ta(te);T.current[0]==="reference"&&K===x&&(Wf(te),te.shiftKey?Ki(oe[oe.length-1]):Ki(oe[1])),T.current[1]==="floating"&&K===m&&te.shiftKey&&(Wf(te),Ki(oe[0]))}}const P=Vr(m);return P.addEventListener("keydown",M),()=>{P.removeEventListener("keydown",M)}},[r,x,m,u,T,C,ie,B]),J.useEffect(()=>{if(r||!l)return;function M(){H.current=!0,setTimeout(()=>{H.current=!1})}function P(te){const oe=te.relatedTarget;queueMicrotask(()=>{const K=!(Bn(x,oe)||Bn(m,oe)||Bn(oe,m)||Bn(N==null?void 0:N.portalNode,oe)||oe!=null&&oe.hasAttribute(Js("focus-guard"))||I&&(Is(I.nodesRef.current,p).find(ae=>{var de,he;return Bn((de=ae.context)==null?void 0:de.elements.floating,oe)||Bn((he=ae.context)==null?void 0:he.elements.domReference,oe)})||E3(I.nodesRef.current,p).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&&K&&!H.current&&oe!==Dg()&&(V.current=!0,h(!1,te))})}if(m&&$n(x))return x.addEventListener("focusout",P),x.addEventListener("pointerdown",M),!u&&m.addEventListener("focusout",P),()=>{x.removeEventListener("focusout",P),x.removeEventListener("pointerdown",M),!u&&m.removeEventListener("focusout",P)}},[r,x,m,u,p,I,N,h,l]),J.useEffect(()=>{var M;if(r)return;const P=Array.from((N==null||(M=N.portalNode)==null?void 0:M.querySelectorAll("["+Js("portal")+"]"))||[]);if(m){const te=[m,...P,_.current,L.current,T.current.includes("reference")||C?x:null].filter(K=>K!=null),oe=u||C?Ig(te,b,!b):Ig(te);return()=>{oe()}}},[r,x,m,u,T,N,C,b]),or(()=>{if(r||!m)return;const M=Vr(m),P=ea(M);queueMicrotask(()=>{const te=B(m),oe=A.current,K=(typeof oe=="number"?te[oe]:oe.current)||m,ae=Bn(m,P);!S&&!ae&&f&&Ki(K,{preventScroll:K===m})})},[r,f,m,S,B,A]),or(()=>{if(r||!m)return;let M=!1;const P=Vr(m),te=ea(P),oe=E.current;Xf(te);function K(ae){let{reason:de,event:he,nested:xe}=ae;de==="escape-key"&&d.domReference.current&&Xf(d.domReference.current),de==="hover"&&he.type==="mouseleave"&&(V.current=!0),de==="outside-press"&&(xe?(V.current=!1,M=!0):V.current=!(u5(he)||c5(he)))}return v.on("openchange",K),()=>{v.off("openchange",K);const ae=ea(P),de=Bn(m,ae)||I&&Is(I.nodesRef.current,p).some(xe=>{var Re;return Bn((Re=xe.context)==null?void 0:Re.elements.floating,ae)});(de||oe.openEvent&&["click","mousedown"].includes(oe.openEvent.type))&&d.domReference.current&&Xf(d.domReference.current);const he=Dg();D.current&&!V.current&&$n(he)&&(!(he!==ae&&ae!==P.body)||de)&&Ki(he,{cancelPrevious:!1,preventScroll:M})}},[r,m,D,E,d,v,I,p]),or(()=>{if(!(r||!N))return N.setFocusManagerState({modal:u,closeOnFocusOut:l,open:f,onOpenChange:h,refs:d}),()=>{N.setFocusManagerState(null)}},[r,N,u,f,h,d,l]),or(()=>{if(r||!m||typeof MutationObserver!="function"||S)return;const M=()=>{const te=m.getAttribute("tabindex");T.current.includes("floating")||ea(Vr(m))!==d.domReference.current&&ie().length===0?te!=="0"&&m.setAttribute("tabindex","0"):te!=="-1"&&m.setAttribute("tabindex","-1")};M();const P=new MutationObserver(M);return P.observe(m,{childList:!0,subtree:!0,attributes:!0}),()=>{P.disconnect()}},[r,m,d,T,ie,S]);function U(M){return r||!c||!u?null:J.createElement(P3,{ref:M==="start"?_:L,onClick:P=>h(!1,P.nativeEvent)},typeof c=="string"?c:"Dismiss")}const fe=!r&&b&&(R||u);return J.createElement(J.Fragment,null,fe&&J.createElement(al,{"data-type":"inside",ref:N==null?void 0:N.beforeInsideRef,onFocus:M=>{if(u){const te=B();Ki(i[0]==="reference"?te[0]:te[te.length-1])}else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(V.current=!1,As(M,N.portalNode)){const te=gx()||x;te==null||te.focus()}else{var P;(P=N.beforeOutsideRef.current)==null||P.focus()}}}),!C&&U("start"),n,U("end"),fe&&J.createElement(al,{"data-type":"inside",ref:N==null?void 0:N.afterInsideRef,onFocus:M=>{if(u)Ki(B()[0]);else if(N!=null&&N.preserveTabOrder&&N.portalNode)if(l&&(V.current=!0),As(M,N.portalNode)){const te=bx()||x;te==null||te.focus()}else{var P;(P=N.afterOutsideRef.current)==null||P.focus()}}}))}const Jf=new Set,Ex=J.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;const i=pf();return or(()=>{if(!n)return;Jf.add(i);const o=/iP(hone|ad|od)|iOS/.test(QC()),a=document.body.style,s=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",u=window.innerWidth-document.documentElement.clientWidth,c=a.left?parseFloat(a.left):window.pageXOffset,l=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",u&&(a[s]=u+"px"),o){var f,d;const p=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,h=((d=window.visualViewport)==null?void 0:d.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(l-Math.floor(h))+"px",left:-(c-Math.floor(p))+"px",right:"0"})}return()=>{Jf.delete(i),Jf.size===0&&(Object.assign(a,{overflow:"",[s]:""}),o&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(c,l)))}},[i,n]),J.createElement("div",Ia({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function Ng(e){return $n(e.target)&&e.target.tagName==="BUTTON"}function Pg(e){return ex(e)}function Tx(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:c=!1,keyboardHandlers:l=!0}=t,f=J.useRef(),d=J.useRef(!1);return J.useMemo(()=>a?{reference:{onPointerDown(p){f.current=p.pointerType},onMouseDown(p){p.button===0&&(vg(f.current,!0)&&c||s!=="click"&&(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){if(s==="mousedown"&&f.current){f.current=void 0;return}vg(f.current,!0)&&c||(n&&u&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){f.current=void 0,!(p.defaultPrevented||!l||Ng(p))&&(p.key===" "&&!Pg(o)&&(p.preventDefault(),d.current=!0),p.key==="Enter"&&r(!(n&&u),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!l||Ng(p)||Pg(o)||p.key===" "&&d.current&&(d.current=!1,r(!(n&&u),p.nativeEvent,"click"))}}}:{},[a,i,s,c,l,o,u,n,r])}const R3={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},k3={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Rg=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 Ix(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:i,elements:{reference:o,domReference:a,floating:s},dataRef:u}=e,{enabled:c=!0,escapeKey:l=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:p=!1,referencePressEvent:h="pointerdown",ancestorScroll:v=!1,bubbles:E,capture:x}=t,m=Nv(),S=na(typeof f=="function"?f:()=>!1),C=typeof f=="function"?S:f,b=J.useRef(!1),T=J.useRef(!1),{escapeKey:A,outsidePress:D}=Rg(E),{escapeKey:I,outsidePress:N}=Rg(x),_=na(R=>{if(!n||!c||!l||R.key!=="Escape")return;const ie=m?Is(m.nodesRef.current,i):[];if(!A&&(R.stopPropagation(),ie.length>0)){let B=!0;if(ie.forEach(U=>{var fe;if((fe=U.context)!=null&&fe.open&&!U.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,d5(R)?R.nativeEvent:R,"escape-key")}),L=na(R=>{var ie;const B=()=>{var U;_(R),(U=ta(R))==null||U.removeEventListener("keydown",B)};(ie=ta(R))==null||ie.addEventListener("keydown",B)}),V=na(R=>{const ie=b.current;b.current=!1;const B=T.current;if(T.current=!1,d==="click"&&B||ie||typeof C=="function"&&!C(R))return;const U=ta(R),fe="["+Js("inert")+"]",M=Vr(s).querySelectorAll(fe);let P=qt(U)?U:null;for(;P&&!Ea(P);){const K=To(P);if(Ea(K)||!qt(K))break;P=K}if(M.length&&qt(U)&&!p5(U)&&!Bn(U,s)&&Array.from(M).every(K=>!Bn(P,K)))return;if($n(U)&&s){const K=U.clientWidth>0&&U.scrollWidth>U.clientWidth,ae=U.clientHeight>0&&U.scrollHeight>U.clientHeight;let de=ae&&R.offsetX>U.clientWidth;if(ae&&Qn(U).direction==="rtl"&&(de=R.offsetX<=U.offsetWidth-U.clientWidth),de||K&&R.offsetY>U.clientHeight)return}const te=m&&Is(m.nodesRef.current,i).some(K=>{var ae;return zf(R,(ae=K.context)==null?void 0:ae.elements.floating)});if(zf(R,s)||zf(R,a)||te)return;const oe=m?Is(m.nodesRef.current,i):[];if(oe.length>0){let K=!0;if(oe.forEach(ae=>{var de;if((de=ae.context)!=null&&de.open&&!ae.context.dataRef.current.__outsidePressBubbles){K=!1;return}}),!K)return}r(!1,R,"outside-press")}),H=na(R=>{var ie;const B=()=>{var U;V(R),(U=ta(R))==null||U.removeEventListener(d,B)};(ie=ta(R))==null||ie.addEventListener(d,B)});return J.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=A,u.current.__outsidePressBubbles=D;function R(U){r(!1,U,"ancestor-scroll")}const ie=Vr(s);l&&ie.addEventListener("keydown",I?L:_,I),C&&ie.addEventListener(d,N?H:V,N);let B=[];return v&&(qt(a)&&(B=Ci(a)),qt(s)&&(B=B.concat(Ci(s))),!qt(o)&&o&&o.contextElement&&(B=B.concat(Ci(o.contextElement)))),B=B.filter(U=>{var fe;return U!==((fe=ie.defaultView)==null?void 0:fe.visualViewport)}),B.forEach(U=>{U.addEventListener("scroll",R,{passive:!0})}),()=>{l&&ie.removeEventListener("keydown",I?L:_,I),C&&ie.removeEventListener(d,N?H:V,N),B.forEach(U=>{U.removeEventListener("scroll",R)})}},[u,s,a,o,l,C,d,n,r,v,c,A,D,_,I,L,V,N,H]),J.useEffect(()=>{b.current=!1},[C,d]),J.useMemo(()=>c?{reference:{onKeyDown:_,[R3[h]]:R=>{p&&r(!1,R.nativeEvent,"reference-press")}},floating:{onKeyDown:_,onMouseDown(){T.current=!0},onMouseUp(){T.current=!0},[k3[d]]:()=>{b.current=!0}}}:{},[c,p,d,h,r,_])}let _p;process.env.NODE_ENV!=="production"&&(_p=new Set);function Ax(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 D="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&&!qt(e.elements.reference)){var a;if(!((a=_p)!=null&&a.has(D))){var s;(s=_p)==null||s.add(D),console.error(D)}}}const[u,c]=J.useState(null),l=((t=e.elements)==null?void 0:t.reference)||u,f=Y5(e),d=Nv(),p=x3()!=null,h=na((D,I,N)=>{D&&(E.current.openEvent=I),x.emit("openchange",{open:D,event:I,reason:N,nested:p}),r==null||r(D,I,N)}),v=J.useRef(null),E=J.useRef({}),x=J.useState(()=>S3())[0],m=pf(),S=J.useCallback(D=>{const I=qt(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),contextElement:D}:D;f.refs.setReference(I)},[f.refs]),C=J.useCallback(D=>{(qt(D)||D===null)&&(v.current=D,c(D)),(qt(f.refs.reference.current)||f.refs.reference.current===null||D!==null&&!qt(D))&&f.refs.setReference(D)},[f.refs]),b=J.useMemo(()=>({...f.refs,setReference:C,setPositionReference:S,domReference:v}),[f.refs,C,S]),T=J.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),A=J.useMemo(()=>({...f,refs:b,elements:T,dataRef:E,nodeId:i,floatingId:m,events:x,open:n,onOpenChange:h}),[f,i,m,x,n,h,b,T]);return or(()=>{const D=d==null?void 0:d.nodesRef.current.find(I=>I.id===i);D&&(D.context=A)}),J.useMemo(()=>({...f,context:A,refs:b,elements:T}),[f,b,T,A])}const kg="active",Mg="selected";function Qf(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[kg]:a,[Mg]: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[c,l]=u;if(!(i&&[kg,Mg].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof l=="function"){var f;(f=r.get(c))==null||f.push(l),a[c]=function(){for(var d,p=arguments.length,h=new Array(p),v=0;v<p;v++)h[v]=arguments[v];return(d=r.get(c))==null?void 0:d.map(E=>E(...h)).find(E=>E!==void 0)}}}else a[c]=l}),a),{})}}function $x(e){e===void 0&&(e=[]);const t=e,n=J.useCallback(o=>Qf(o,e,"reference"),t),r=J.useCallback(o=>Qf(o,e,"floating"),t),i=J.useCallback(o=>Qf(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 M3(e={}){const{initialOpen:t=!1,open:n,onOpenChange:r}=e,[i,o]=J.useState(t),a=n??i,s=r??o,u=Ax({open:a,onOpenChange:s}),c=u.context,l=Tx(c,{enabled:n==null}),f=Ix(c,{outsidePressEvent:"mousedown"}),d=$x([l,f]);return J.useMemo(()=>({open:a,setOpen:s,...d,...u}),[a,s,d,u])}const Ox=J.createContext(null),Dx=()=>{const e=J.useContext(Ox);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function j3({children:e,...t}){const n=M3(t);return $.jsx(Ox.Provider,{value:n,children:e})}const Nx=cv`
|
|
1151
1151
|
display: flex;
|
|
1152
1152
|
justify-content: center;
|
|
1153
1153
|
align-items: center;
|
|
1154
1154
|
z-index: 100;
|
|
1155
1155
|
padding: var(--space-md-fixed);
|
|
1156
|
-
`,
|
|
1156
|
+
`,_3=Ie(Ex)`
|
|
1157
1157
|
${Nx};
|
|
1158
|
-
`,
|
|
1158
|
+
`,q3=O.forwardRef((e,t)=>{const{style:n,children:r,components:i,...o}=e,a=Dx(),s=Dv([a.refs.setFloating,t]),u=(i==null?void 0:i.Overlay)??_3;return $.jsx(wx,{children:$.jsx(u,{lockScroll:!0,children:$.jsx(xx,{context:a.context,children:$.jsx("div",{ref:s,...a.getFloatingProps(o),children:r})})})})}),F3=q3;function Px(e){const t=O.useContext(Ys),[n,r]=O.useState(t);return $.jsx(Ys.Provider,{value:n,children:e.children})}const L3=O.forwardRef((e,t)=>{const{setOpen:n}=Dx();return $.jsx("button",{type:"button",...e,ref:t,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),B3=L3,V3=Ie.span`
|
|
1159
1159
|
color: var(--color-explain-header-value-color);
|
|
1160
1160
|
overflow: hidden;
|
|
1161
1161
|
white-space: nowrap;
|
|
1162
1162
|
text-overflow: ellipsis;
|
|
1163
|
-
`;function Rx(e){const{explainQuestion:t}=Bi();if(!t)return $.jsx("div",{...e,children:"Conflict"});const n=Y(t).returnType().with({subject:Qe.configuration},()=>"Configuration").with({subject:Qe.attribute},i=>i.attributeId.localId).with({subject:Qe.choiceValue},i=>i.choiceValueId).with({subject:Qe.component},i=>i.state.toString()).with({subject:Qe.boolean},i=>i.state.toString()).with({subject:Qe.numeric},i=>i.state.toString()).exhaustive(),r=Y(t).returnType().with({question:_t.whyIsStateNotPossible},()=>"is blocked").with({question:_t.whyIsNotSatisfied},()=>"is not satisfied").exhaustive();return $.jsxs("div",{...e,children:[$.jsx(
|
|
1163
|
+
`;function Rx(e){const{explainQuestion:t}=Bi();if(!t)return $.jsx("div",{...e,children:"Conflict"});const n=Y(t).returnType().with({subject:Qe.configuration},()=>"Configuration").with({subject:Qe.attribute},i=>i.attributeId.localId).with({subject:Qe.choiceValue},i=>i.choiceValueId).with({subject:Qe.component},i=>i.state.toString()).with({subject:Qe.boolean},i=>i.state.toString()).with({subject:Qe.numeric},i=>i.state.toString()).exhaustive(),r=Y(t).returnType().with({question:_t.whyIsStateNotPossible},()=>"is blocked").with({question:_t.whyIsNotSatisfied},()=>"is not satisfied").exhaustive();return $.jsxs("div",{...e,children:[$.jsx(V3,{children:n})," ",r]})}const U3=Ie.div`
|
|
1164
1164
|
position: sticky;
|
|
1165
1165
|
top: 0;
|
|
1166
1166
|
transition: all 0.1s;
|
|
@@ -1174,7 +1174,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1174
1174
|
@media only screen and (min-resolution: 2dppx) {
|
|
1175
1175
|
border-top-width: 0.5px;
|
|
1176
1176
|
}
|
|
1177
|
-
`;function
|
|
1177
|
+
`;function G3(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(U3,{...BC(e,{className:fL(t&&"active")})})]})}const z3=Ie(j.motion.div)`
|
|
1178
1178
|
position: relative;
|
|
1179
1179
|
background-color: var(--color-explain-dialog-fill);
|
|
1180
1180
|
backdrop-filter: var(--backdrop-filter-explain-dialog);
|
|
@@ -1193,16 +1193,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1193
1193
|
max-height: min(calc(100vh - var(--space-md) * 2), 700px);
|
|
1194
1194
|
max-width: min(calc(100vw - var(--space-md) * 2), 700px);
|
|
1195
1195
|
min-width: min(calc(100vw - var(--space-md) * 2), 500px);
|
|
1196
|
-
`,
|
|
1196
|
+
`,W3=Ie.div`
|
|
1197
1197
|
overflow-y: auto;
|
|
1198
1198
|
grid-area: content;
|
|
1199
1199
|
padding-left: var(--space-xs-fixed);
|
|
1200
1200
|
padding-right: var(--space-xs-fixed);
|
|
1201
1201
|
padding-bottom: var(--space-xs-fixed);
|
|
1202
|
-
`,
|
|
1202
|
+
`,H3=Ie(G3)`
|
|
1203
1203
|
margin-left: calc(var(--space-xs-fixed) * -1);
|
|
1204
1204
|
margin-right: calc(var(--space-xs-fixed) * -1);
|
|
1205
|
-
`,
|
|
1205
|
+
`,K3=Ie(B3)`
|
|
1206
1206
|
position: absolute;
|
|
1207
1207
|
right: var(--space-sm-fixed);
|
|
1208
1208
|
top: var(--space-sm-fixed);
|
|
@@ -1217,7 +1217,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1217
1217
|
outline: 2px solid var(--color-explain-dialog-close-button-outline);
|
|
1218
1218
|
outline-offset: 1px;
|
|
1219
1219
|
}
|
|
1220
|
-
`,
|
|
1220
|
+
`,Y3=Ie(Rx)`
|
|
1221
1221
|
grid-area: header;
|
|
1222
1222
|
font-size: var(--text-md);
|
|
1223
1223
|
font-weight: 500;
|
|
@@ -1229,7 +1229,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1229
1229
|
text-overflow: ellipsis;
|
|
1230
1230
|
margin-right: var(--space-md);
|
|
1231
1231
|
margin-left: calc(var(--space-xs-fixed) + var(--space-sm-fixed));
|
|
1232
|
-
`,
|
|
1232
|
+
`,X3={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 J3(e){return $.jsxs(z3,{variants:X3,initial:"initial",animate:"open",exit:"close",children:[$.jsx(Y3,{}),$.jsxs(W3,{children:[$.jsx(H3,{}),e.children]}),$.jsx(K3,{children:$.jsx(Ri,{icon:sC})})]})}const Q3=Ie(F3)`
|
|
1233
1233
|
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1234
1234
|
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1235
1235
|
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
@@ -1251,9 +1251,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1251
1251
|
&:focus {
|
|
1252
1252
|
outline: none;
|
|
1253
1253
|
}
|
|
1254
|
-
`;function
|
|
1254
|
+
`;function Z3(e){const t=Bi(),n=(t==null?void 0:t.displayMode)==="dialog";return $.jsx(j3,{open:n,onOpenChange:r=>!r&&n&&(t==null?void 0:t.dismiss()),children:$.jsx(eB,{...e,isOpen:n,children:O.Children.toArray(e.content)[0]??$.jsx(J3,{children:$.jsx(a5,{})})})})}function eB(e){return $.jsx(j.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(Q3,{...e,components:{Overlay:nB},children:$.jsx(Px,{children:e.children})})})}const tB=Ie(j.motion(Ex))`
|
|
1255
1255
|
${Nx}
|
|
1256
|
-
`;function iB(e){return $.jsx(rB,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}const oB={fill:{title:"Fill",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:j.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:j.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:j.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:j.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:j.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:j.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:j.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:j.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:j.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:j.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:j.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:j.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:j.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:j.ControlType.String,defaultValue:"blur(10px) saturate(200%)"}},aB={fill:{title:"Fill",type:j.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:j.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:j.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:j.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:j.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:j.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:j.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:j.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:j.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"}},kx=O.createContext(null);function sB(e){const[t,n]=O.useState(null),{explain:r,applySolution:i}=j0(),o=O.useRef(null),a=O.useCallback(async(p,h,v,E)=>{const x=Fh();o.current=x,n(null);try{const m=await p(),C=m,w=m,b=(C==null?void 0:C.decisionExplanations)??[],T=(w==null?void 0:w.constraintExplanations)??[];x==o.current&&n({controlId:E,displayMode:b.length===0&&T.length>0?"dialog":v,explainQuestion:h,hasError:!1,decisionExplanations:uB(b),constraintExplanations:T})}catch{x==o.current&&n({controlId:E,displayMode:v,explainQuestion:h,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=O.useCallback((p,h,v)=>{const E=typeof p=="function"?p(OC):p;return a(()=>e.explainConstraints?r(E,"full"):r(E,"decisions"),E,h,v)},[e.explainConstraints,r,a]),u=O.useCallback((p,h,v)=>a(()=>Promise.resolve(p),null,h,v),[a]),c=O.useCallback(()=>{n(null)},[]),l=O.useCallback(async p=>{await i(p),c()},[i,c]),f=O.useCallback(p=>{n(h=>h!=null?{...h,displayMode:p}:h)},[]),d=O.useMemo(()=>({process:t,applySolution:l,explain:s,handleExplainAnswer:u,dismiss:c,switchMode:f}),[t,l,s,u,c,f]);return $.jsx(Xs.Provider,{value:d,children:e.children})}function uB(e){const t=g(BN,xm(r=>r.solution==null)),n=g(rC,xm(r=>r.causedByDecisions.length));return g(e,_2([t,n]))}const $a=new Map;function sl(e){const{singletonId:t,children:n}=e,[r,i]=O.useState(!1),o=O.useRef({chose:()=>i(!0)});return O.useEffect(()=>(cB(t,o.current),()=>lB(t,o.current)),[]),r?$.jsx($.Fragment,{children:n}):null}function cB(e,t){dB(e).candidates.add(t),Mx(e)}function lB(e,t){let n=$a.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),fB(e),Mx(e))}function Mx(e){let t=$a.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function fB(e){let t=$a.get(e);t==null||t.candidates.size>0||$a.delete(e)}function dB(e){let t=$a.get(e);return t==null&&(t={chosen:null,candidates:new Set},$a.set(e,t)),t}const jx=Mo(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:r,sessionCreateUrl:i,sessionDeleteUrl:o,deploymentName:a,channel:s,children:u,explainDialogProps:c,explainPopoverProps:l,explainConstraints:f,attributeRelations:d}=e;if(In())return $.jsxs($.Fragment,{children:[u,$.jsx(sl,{singletonId:"Configuration",children:$.jsx(cg,{})})]});const p=O.useMemo(()=>tk({hcaEngineBaseUrl:kL(t,"api","engine"),sessionHandler:Y(n).with("client-side",()=>({accessToken:r})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:o})).exhaustive()}),[t,n,r,i,o]),h=g(be(d==null?void 0:d.jsonDefinition),Vt(v=>v.length>0),Z(v=>JSON.parse(v)),Vn);return $.jsxs($.Fragment,{children:[$.jsxs(e_,{configuratorClient:p,configurationModelSource:{type:Oi.Channel,channel:s,deploymentName:a},attributeRelations:h,allowedInExplain:{rules:{type:pn.all}},children:[$.jsx(ML,{...e}),$.jsx(O.Suspense,{children:$.jsx(t_,{children:$.jsxs(sB,{explainConstraints:f,children:[$.jsx(kx.Provider,{value:l,children:u}),$.jsx(tB,{...c})]})})})]}),$.jsx(sl,{singletonId:"Configuration",children:$.jsx(cg,{})})]})}),pB=jx;j.addPropertyControls(jx,{children:{title:"Content",type:j.ControlType.ComponentInstance},channel:{type:j.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:j.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:j.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:j.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:j.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:j.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:j.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:j.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:j.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:j.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:j.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:j.ControlType.Object,optional:!1,controls:oB,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:j.ControlType.Object,optional:!1,controls:aB,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:j.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:j.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:j.ControlType.String,displayTextArea:!0}}}});const Mi={attributeId:{title:"Attribute Id",type:j.ControlType.String},componentPath:{title:"Component Path",type:j.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:j.ControlType.String}},_x={padding:{type:j.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}},hB=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}),vB={radius:{title:"Radius",type:j.ControlType.Number,defaultValue:6},..._x,border:{title:"Border",type:j.ControlType.Object,controls:{color:{type:j.ControlType.Color,title:"Color"},width:{type:j.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}}}},mB=e=>{var t,n,r,i,o,a,s,u,c,l,f,d,p;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?(c=e.border)==null?void 0:c.widthBottom:(l=e.border)==null?void 0:l.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(p=e.border)==null?void 0:p.width}},yB={fill:{title:"Fill",type:j.ControlType.Color,defaultValue:"#EBEBEB"},..._x,...vB},gB=e=>({...hB(e),...mB(e),backgroundColor:e.fill}),bB={color:{title:"Color",type:j.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:j.ControlType.Number,defaultValue:16}},SB=e=>({color:e.color,fontSize:e.fontSize}),Cu={explain:{title:"Explain",type:j.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},qp={type:j.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:j.ControlType.Color,optional:!0},color:{title:"Color",type:j.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:j.ControlType.Color,optional:!0}}},qx={...Mi,...bB,...yB,implicitLabelPrefix:{title:"Implicit Label Prefix",type:j.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...qp,title:"Unsatisfied Colors"},implicitSelectedColors:{...qp,title:"Implicit Selected Colors"},...Cu},Fp=(e,t,n)=>{var r,i,o,a,s,u;const c=gB(e),l=SB(e);return{...c,...l,backgroundColor:Y({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:Ve.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:Ve.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>c.backgroundColor),borderColor:Y({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:Ve.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:Ve.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>c.borderColor),color:Y({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:Ve.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:Ve.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>l.color),...e.style}},kv={...qx,resetLabel:{title:"Reset Label",type:j.ControlType.String,defaultValue:"Reset"}},Oa=(e,t,n)=>Fp(e,t,n);function Sr(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}function Vi(){const{explain:e,handleExplainAnswer:t}=O.useContext(Xs);return{explain:e,handleExplainAnswer:t}}function CB(e={}){const{initialOpen:t=!1,placement:n="top",modal:r=!1,open:i,onOpenChange:o,arrow:a}=e,[s,u]=O.useState(t),c=i??s,l=o??u,f=Ax({placement:n,open:c,onOpenChange:l,whileElementsMounted:W5,middleware:[O5(((a==null?void 0:a.height)??0)+5),K5({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),H5({padding:5}),...a?[X5(a)]:[]]}),d=f.context,p=Tx(d,{enabled:i==null}),h=Ix(d),v=$x([p,h]);return O.useMemo(()=>({open:c,setOpen:l,...v,...f,modal:r,arrow:a}),[c,l,v,f,r,a])}const Fx=O.createContext(null),wu=()=>{const e=O.useContext(Fx);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function wB({children:e,...t}){const n=CB(t);return $.jsx(Fx.Provider,{value:n,children:e})}const xB=O.forwardRef(function(e,t){const n=O.Children.toArray(e.children)[0],r=wu(),i=e.children.ref,o=Dv([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"})}),EB=xB,TB=Ie.div`
|
|
1256
|
+
`;function nB(e){return $.jsx(tB,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}const rB={fill:{title:"Fill",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:j.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:j.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:j.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:j.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:j.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:j.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:j.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:j.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:j.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:j.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:j.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:j.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:j.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:j.ControlType.String,defaultValue:"blur(10px) saturate(200%)"}},iB={fill:{title:"Fill",type:j.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:j.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:j.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:j.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:j.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:j.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:j.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:j.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:j.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:j.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"}},kx=O.createContext(null);function oB(e){const[t,n]=O.useState(null),{explain:r,applySolution:i}=jw(),o=O.useRef(null),a=O.useCallback(async(p,h,v,E)=>{const x=Fh();o.current=x,n(null);try{const m=await p(),S=m,C=m,b=(S==null?void 0:S.decisionExplanations)??[],T=(C==null?void 0:C.constraintExplanations)??[];x==o.current&&n({controlId:E,displayMode:b.length===0&&T.length>0?"dialog":v,explainQuestion:h,hasError:!1,decisionExplanations:aB(b),constraintExplanations:T})}catch{x==o.current&&n({controlId:E,displayMode:v,explainQuestion:h,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=O.useCallback((p,h,v)=>{const E=typeof p=="function"?p(O0):p;return a(()=>e.explainConstraints?r(E,"full"):r(E,"decisions"),E,h,v)},[e.explainConstraints,r,a]),u=O.useCallback((p,h,v)=>a(()=>Promise.resolve(p),null,h,v),[a]),c=O.useCallback(()=>{n(null)},[]),l=O.useCallback(async p=>{await i(p),c()},[i,c]),f=O.useCallback(p=>{n(h=>h!=null?{...h,displayMode:p}:h)},[]),d=O.useMemo(()=>({process:t,applySolution:l,explain:s,handleExplainAnswer:u,dismiss:c,switchMode:f}),[t,l,s,u,c,f]);return $.jsx(Ys.Provider,{value:d,children:e.children})}function aB(e){const t=g(LN,xm(r=>r.solution==null)),n=g(r0,xm(r=>r.causedByDecisions.length));return g(e,j2([t,n]))}const Aa=new Map;function sl(e){const{singletonId:t,children:n}=e,[r,i]=O.useState(!1),o=O.useRef({chose:()=>i(!0)});return O.useEffect(()=>(sB(t,o.current),()=>uB(t,o.current)),[]),r?$.jsx($.Fragment,{children:n}):null}function sB(e,t){lB(e).candidates.add(t),Mx(e)}function uB(e,t){let n=Aa.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),cB(e),Mx(e))}function Mx(e){let t=Aa.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function cB(e){let t=Aa.get(e);t==null||t.candidates.size>0||Aa.delete(e)}function lB(e){let t=Aa.get(e);return t==null&&(t={chosen:null,candidates:new Set},Aa.set(e,t)),t}const jx=ko(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:r,sessionCreateUrl:i,sessionDeleteUrl:o,deploymentName:a,channel:s,children:u,explainDialogProps:c,explainPopoverProps:l,explainConstraints:f,attributeRelations:d}=e;if(In())return $.jsxs($.Fragment,{children:[u,$.jsx(sl,{singletonId:"Configuration",children:$.jsx(cg,{})})]});const p=O.useMemo(()=>ZR({hcaEngineBaseUrl:PL(t,"api","engine"),sessionHandler:Y(n).with("client-side",()=>({accessToken:r})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:o})).exhaustive()}),[t,n,r,i,o]),h=g(be(d==null?void 0:d.jsonDefinition),Vt(v=>v.length>0),Z(v=>JSON.parse(v)),Vn);return $.jsxs($.Fragment,{children:[$.jsxs(Qj,{configuratorClient:p,configurationModelSource:{type:Oi.Channel,channel:s,deploymentName:a},attributeRelations:h,allowedInExplain:{rules:{type:pn.all}},children:[$.jsx(RL,{...e}),$.jsx(O.Suspense,{children:$.jsx(Zj,{children:$.jsxs(oB,{explainConstraints:f,children:[$.jsx(kx.Provider,{value:l,children:u}),$.jsx(Z3,{...c})]})})})]}),$.jsx(sl,{singletonId:"Configuration",children:$.jsx(cg,{})})]})}),fB=jx;j.addPropertyControls(jx,{children:{title:"Content",type:j.ControlType.ComponentInstance},channel:{type:j.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:j.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:j.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:j.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:j.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:j.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:j.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:j.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:j.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:j.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:j.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:j.ControlType.Object,optional:!1,controls:rB,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:j.ControlType.Object,optional:!1,controls:iB,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:j.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:j.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:j.ControlType.String,displayTextArea:!0}}}});const Mi={attributeId:{title:"Attribute Id",type:j.ControlType.String},componentPath:{title:"Component Path",type:j.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:j.ControlType.String}},_x={padding:{type:j.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}},dB=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}),pB={radius:{title:"Radius",type:j.ControlType.Number,defaultValue:6},..._x,border:{title:"Border",type:j.ControlType.Object,controls:{color:{type:j.ControlType.Color,title:"Color"},width:{type:j.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}}}},hB=e=>{var t,n,r,i,o,a,s,u,c,l,f,d,p;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?(c=e.border)==null?void 0:c.widthBottom:(l=e.border)==null?void 0:l.width,borderLeftWidth:(f=e.border)!=null&&f.isMixedWidth?(d=e.border)==null?void 0:d.widthLeft:(p=e.border)==null?void 0:p.width}},vB={fill:{title:"Fill",type:j.ControlType.Color,defaultValue:"#EBEBEB"},..._x,...pB},mB=e=>({...dB(e),...hB(e),backgroundColor:e.fill}),yB={color:{title:"Color",type:j.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:j.ControlType.Number,defaultValue:16}},gB=e=>({color:e.color,fontSize:e.fontSize}),wu={explain:{title:"Explain",type:j.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},qp={type:j.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:j.ControlType.Color,optional:!0},color:{title:"Color",type:j.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:j.ControlType.Color,optional:!0}}},qx={...Mi,...yB,...vB,implicitLabelPrefix:{title:"Implicit Label Prefix",type:j.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...qp,title:"Unsatisfied Colors"},implicitSelectedColors:{...qp,title:"Implicit Selected Colors"},...wu},Fp=(e,t,n)=>{var r,i,o,a,s,u;const c=mB(e),l=gB(e);return{...c,...l,backgroundColor:Y({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:Ve.string.minLength(1)},f=>f.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:Ve.string.minLength(1)},f=>f.implicitSelectedFill).otherwise(()=>c.backgroundColor),borderColor:Y({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:Ve.string.minLength(1)},f=>f.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:Ve.string.minLength(1)},f=>f.implicitSelectedBorderColor).otherwise(()=>c.borderColor),color:Y({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:Ve.string.minLength(1)},f=>f.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:Ve.string.minLength(1)},f=>f.implicitSelectedColor).otherwise(()=>l.color),...e.style}},kv={...qx,resetLabel:{title:"Reset Label",type:j.ControlType.String,defaultValue:"Reset"}},$a=(e,t,n)=>Fp(e,t,n);function Sr(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}function Vi(){const{explain:e,handleExplainAnswer:t}=O.useContext(Ys);return{explain:e,handleExplainAnswer:t}}function bB(e={}){const{initialOpen:t=!1,placement:n="top",modal:r=!1,open:i,onOpenChange:o,arrow:a}=e,[s,u]=O.useState(t),c=i??s,l=o??u,f=Ax({placement:n,open:c,onOpenChange:l,whileElementsMounted:G5,middleware:[A5(((a==null?void 0:a.height)??0)+5),W5({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),z5({padding:5}),...a?[K5(a)]:[]]}),d=f.context,p=Tx(d,{enabled:i==null}),h=Ix(d),v=$x([p,h]);return O.useMemo(()=>({open:c,setOpen:l,...v,...f,modal:r,arrow:a}),[c,l,v,f,r,a])}const Fx=O.createContext(null),Cu=()=>{const e=O.useContext(Fx);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function SB({children:e,...t}){const n=bB(t);return $.jsx(Fx.Provider,{value:n,children:e})}const wB=O.forwardRef(function(e,t){const n=O.Children.toArray(e.children)[0],r=Cu(),i=e.children.ref,o=Dv([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"})}),CB=wB,xB=Ie.div`
|
|
1257
1257
|
display: flex;
|
|
1258
1258
|
justify-content: center;
|
|
1259
1259
|
|
|
@@ -1262,7 +1262,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1262
1262
|
@container explain-actions (min-width: 300px) {
|
|
1263
1263
|
justify-content: start;
|
|
1264
1264
|
}
|
|
1265
|
-
`,
|
|
1265
|
+
`,EB=Ie.button`
|
|
1266
1266
|
color: inherit;
|
|
1267
1267
|
font-size: 0.9em;
|
|
1268
1268
|
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
@@ -1279,7 +1279,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1279
1279
|
outline: 2px solid var(--color-explain-popover-show-more-button-outline);
|
|
1280
1280
|
outline-offset: 1px;
|
|
1281
1281
|
}
|
|
1282
|
-
`;function
|
|
1282
|
+
`;function TB(){const{decisionExplanations:e,switchMode:t}=Bi(),n=e.length-1;return $.jsx(xB,{children:$.jsxs(EB,{onClick:()=>t("dialog"),children:[n>0&&$.jsxs("span",{children:["Show more (",n,")"]}),n===0&&$.jsx("span",{children:"Show Constraints"})]})})}const IB=Ie.div`
|
|
1283
1283
|
font-weight: 500;
|
|
1284
1284
|
font-family: var(--font-heading);
|
|
1285
1285
|
margin-bottom: var(--space-xs);
|
|
@@ -1292,9 +1292,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1292
1292
|
@media only screen and (min-resolution: 2dppx) {
|
|
1293
1293
|
height: 0.5px;
|
|
1294
1294
|
}
|
|
1295
|
-
`,
|
|
1295
|
+
`,AB=Ie.div`
|
|
1296
1296
|
container: explain-actions / inline-size;
|
|
1297
|
-
|
|
1297
|
+
`,$B=Ie(WC)`
|
|
1298
1298
|
display: grid;
|
|
1299
1299
|
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
1300
1300
|
gap: var(--space-sm);
|
|
@@ -1304,7 +1304,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1304
1304
|
margin-right: -1.1em;
|
|
1305
1305
|
overflow: auto;
|
|
1306
1306
|
max-height: 200px;
|
|
1307
|
-
`,
|
|
1307
|
+
`,OB=Ie(zC)`
|
|
1308
1308
|
border-radius: 360px;
|
|
1309
1309
|
background-color: var(--color-explain-popover-apply-solution-button-fill);
|
|
1310
1310
|
color: var(--color-explain-popover-apply-solution-button-color);
|
|
@@ -1327,10 +1327,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1327
1327
|
@container explain-actions (min-width: 300px) {
|
|
1328
1328
|
width: auto;
|
|
1329
1329
|
}
|
|
1330
|
-
`,Zf=Ie(
|
|
1330
|
+
`,Zf=Ie(KC)`
|
|
1331
1331
|
width: min-content;
|
|
1332
1332
|
min-width: 300px;
|
|
1333
|
-
`;function
|
|
1333
|
+
`;function DB(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=Bi();if(n)return $.jsx(Zf,{variant:"failedToExplain"});const r=e[0];if(!r)return $.jsx(Zf,{variant:"noExplanationFound"});if(!r.solution)return $.jsx(Zf,{variant:"noSolutionFound"});const i=r.solution.decisions.filter(o=>o.state!=null);return $.jsxs($.Fragment,{children:[$.jsx(IB,{children:"Solution"}),$.jsx(jg,{}),$.jsx($B,{blockingDecisions:r.causedByDecisions,desiredDecisions:i}),$.jsx(jg,{}),$.jsxs(AB,{children:[$.jsx(OB,{explanation:r,children:"Apply solution"}),(e.length>1||t.length>0)&&$.jsx(TB,{})]})]})}const Lx=O.createContext(null),Rr=()=>O.useContext(Lx);function Bx(e){return O.forwardRef((t,n)=>{const r=O.useId();return $.jsx(Lx.Provider,{value:r,children:$.jsx(e,{...t,ref:n})})})}const NB=O.forwardRef((e,t)=>{const{style:n,children:r,...i}=e,o=Cu(),a=Dv([o.refs.setFloating,t]);return $.jsx(wx,{children:$.jsx(xx,{context:o.context,modal:o.modal,children:$.jsx("div",{ref:a,style:{...o.floatingStyles,...n},...o.getFloatingProps(i),children:r})})})}),PB=NB,RB=O.forwardRef((e,t)=>{const{setOpen:n}=Cu();return $.jsx("button",{type:"button",ref:t,...e,onClick:r=>{var i;(i=e.onClick)==null||i.call(e,r),n(!1)}})}),kB=RB,MB=Ie.div`
|
|
1334
1334
|
position: relative;
|
|
1335
1335
|
background-color: var(--color-explain-popover-fill);
|
|
1336
1336
|
color: var(--color-explain-popover-color);
|
|
@@ -1341,7 +1341,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1341
1341
|
font-family: var(--font-primary);
|
|
1342
1342
|
min-width: 300px;
|
|
1343
1343
|
max-width: 500px;
|
|
1344
|
-
`,
|
|
1344
|
+
`,jB=Ie(kB)`
|
|
1345
1345
|
position: absolute;
|
|
1346
1346
|
right: var(--space-sm-fixed);
|
|
1347
1347
|
top: var(--space-sm-fixed);
|
|
@@ -1356,7 +1356,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1356
1356
|
outline: 2px solid var(--color-explain-popover-close-button-outline);
|
|
1357
1357
|
outline-offset: 1px;
|
|
1358
1358
|
}
|
|
1359
|
-
`,
|
|
1359
|
+
`,_B=Ie(Rx)`
|
|
1360
1360
|
font-size: var(--text-md);
|
|
1361
1361
|
font-weight: 500;
|
|
1362
1362
|
font-family: var(--font-heading);
|
|
@@ -1366,7 +1366,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1366
1366
|
white-space: nowrap;
|
|
1367
1367
|
text-overflow: ellipsis;
|
|
1368
1368
|
margin-right: var(--space-md);
|
|
1369
|
-
`;function
|
|
1369
|
+
`;function qB(e){return $.jsxs(MB,{children:[$.jsx(_B,{}),e.children,$.jsx(jB,{children:$.jsx(Ri,{icon:sC})})]})}const FB=Ie(PB)`
|
|
1370
1370
|
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
1371
1371
|
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
1372
1372
|
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
@@ -1388,28 +1388,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1388
1388
|
&:focus {
|
|
1389
1389
|
outline: none;
|
|
1390
1390
|
}
|
|
1391
|
-
`,
|
|
1391
|
+
`,LB=Ie(b3)`
|
|
1392
1392
|
fill: var(--color-explain-popover-fill);
|
|
1393
|
-
`,
|
|
1394
|
-
Please check your internet connection and try again.`)}function
|
|
1393
|
+
`,BB={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 VB(e){const t=Bi(),n=Rr(),r=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=O.useRef(null);return $.jsxs(SB,{open:r,onOpenChange:o=>!o&&r&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[$.jsx(CB,{children:e.children}),$.jsxs(UB,{isOpen:r,children:[O.Children.toArray(e.content)[0]??$.jsx(qB,{children:$.jsx(DB,{})}),$.jsx(GB,{})]})]})}function UB(e){var t,n;const r=O.useContext(kx),{middlewareData:i,arrow:o,placement:a}=Cu(),s=((t=i.arrow)==null?void 0:t.x)??0,u=((n=i.arrow)==null?void 0:n.y)??0,c=(o==null?void 0:o.height)??0,l=(o==null?void 0:o.width)??0,f=s+l/2,d=u+c,p=Y(a).with("top",()=>`${f}px calc(100% + ${c+5}px)`).with("bottom",()=>`${f}px ${-c-5}px`).with("left",()=>`calc(100% + ${c}px) ${d}px`).with("right",()=>`${-c}px ${d}px`).otherwise(()=>"");return $.jsx(j.AnimatePresence,{initial:!1,children:e.isOpen&&$.jsx(FB,{...r,children:$.jsx(j.motion.div,{variants:BB,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:p},children:$.jsx(Px,{children:e.children})})})})}function GB(){const{context:e,arrow:t}=Cu();return $.jsx(LB,{ref:t.element,context:e,width:t.width,height:t.height})}function zB(e){return O.forwardRef((t,n)=>{const r=In();return t.explain!=="popover"||r?$.jsx(e,{...t}):$.jsx(VB,{children:$.jsx(e,{...t,ref:n})})})}function Ui(e){return ko(Bx(zB(O.forwardRef(e))))}function Or(){alert(`Failed to apply your selection.
|
|
1394
|
+
Please check your internet connection and try again.`)}function WB(){alert(`Failed to reset your configuration.
|
|
1395
1395
|
Please check your internet connection and try again.`)}const _g=Ie.select`
|
|
1396
1396
|
color: inherit;
|
|
1397
|
-
`,qg="<reset>",Fg="<nothing>",Vx=Ui((e,t)=>{if(In()){const b
|
|
1397
|
+
`,qg="<reset>",Fg="<nothing>",Vx=Ui((e,t)=>{if(In()){const b=$a(e,!0,!1);return $.jsx(_g,{style:b})}const n=Rr(),r=Sr(e),i=tv(r),{explain:o}=Vi();if(!i)return $.jsx("span",{children:"Choice Attribute not found"});const{attribute:a,makeDecision:s,clearDecisions:u}=i,c=An.getAllowedChoiceValues(a),l=An.getBlockedChoiceValues(a),f=An.isMultiSelect(a),d=An.getSelectedChoiceValues(a),p=d.map(b=>b.id),h=p[0]??Fg,v=d.some(b=>{var T;return((T=b.decision)==null?void 0:T.kind)===$e.Explicit}),E=p.length>=1,x=d.some(b=>{var T;return((T=b.decision)==null?void 0:T.kind)===$e.Implicit}),m=c.length===0,S=async b=>{if(b===qg)try{await u()}catch{Or()}else if(c.some(T=>T.id===b)){const T=p.some(A=>A===b)?void 0:bt.Included;try{await s(b,T)}catch{Or()}}else l.some(T=>T.id===b)&&e.explain!=="disabled"&&await o(T=>T.whyIsStateNotPossible.choice(a.id).choiceValue(b).state(bt.Included),e.explain,n)},C=YB(e,a.isSatisfied,x,m);return $.jsxs(_g,{ref:t,value:f?p:h,multiple:f,onChange:b=>S(b.currentTarget.value),style:C,children:[!E&&!f&&$.jsx("option",{value:Fg}),v&&$.jsx("option",{value:qg,children:e.resetLabel}),c.map(b=>{var T;return $.jsxs("option",{value:b.id,children:[((T=b.decision)==null?void 0:T.kind)===$e.Implicit?e.implicitLabelPrefix:"",b.id]},b.id)}),l.length>0&&$.jsx("optgroup",{label:"Blocked",children:l.map(b=>$.jsx("option",{value:b.id,children:b.id},b.id))})]})}),HB=Vx,KB={...kv,noOptionsAvailableColors:{...qp,title:"No Options Available Colors"}};j.addPropertyControls(Vx,KB);const YB=(e,t,n,r)=>{var i,o,a;const s=$a(e,t,n);return{...s,backgroundColor:Y({noOptionsAvailable:r,noOptionsAvailableFill:(i=e.noOptionsAvailableColors)==null?void 0:i.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:Ve.string.minLength(1)},u=>u.noOptionsAvailableFill).otherwise(()=>s.backgroundColor),borderColor:Y({noOptionsAvailable:r,noOptionsAvailableBorderColor:(o=e.noOptionsAvailableColors)==null?void 0:o.borderColor}).with({noOptionsAvailable:!0,noOptionsAvailableBorderColor:Ve.string.minLength(1)},u=>u.noOptionsAvailableBorderColor).otherwise(()=>s.borderColor),color:Y({noOptionsAvailable:r,noOptionsAvailableColor:(a=e.noOptionsAvailableColors)==null?void 0:a.color}).with({noOptionsAvailable:!0,noOptionsAvailableColor:Ve.string.minLength(1)},u=>u.noOptionsAvailableColor).otherwise(()=>s.color)}},Lg=Ie.select`
|
|
1398
1398
|
color: inherit;
|
|
1399
|
-
`,Bg="<reset>",ed="<nothing>",td="yes",Vg="no",Ux=Ui((e,t)=>{var n,r,i;if(In()){const
|
|
1399
|
+
`,Bg="<reset>",ed="<nothing>",td="yes",Vg="no",Ux=Ui((e,t)=>{var n,r,i;if(In()){const C=$a(e,!0,!1);return $.jsx(Lg,{style:C})}const o=Rr(),a=Sr(e),s=Rj(a),{explain:u}=Vi();if(!s)return $.jsx("span",{children:"Boolean Attribute not found"});const{attribute:c,makeDecision:l}=s,f=async C=>{const b=An.getBooleanDecision(c)!=null;if(C===Bg&&b)try{await l(void 0)}catch{Or()}else{const T=C===td;if(An.isBooleanValuePossible(c,T))try{await l(T)}catch{Or()}else e.explain!=="disabled"&&await u(A=>A.whyIsStateNotPossible.boolean(c.id).state(T),e.explain,o)}},d=Y((n=c.decision)==null?void 0:n.state).with(!0,()=>td).with(!1,()=>Vg).otherwise(()=>ed),p=((r=c.decision)==null?void 0:r.kind)===$e.Explicit,h=((i=c.decision)==null?void 0:i.kind)===$e.Implicit,v=$a(e,c.isSatisfied,h),E=An.isBooleanValuePossible(c,!0),x=An.isBooleanValuePossible(c,!1),m=$.jsxs("option",{value:td,children:[Ug(c,!0,e.implicitLabelPrefix),e.trueLabel]}),S=$.jsxs("option",{value:Vg,children:[Ug(c,!1,e.implicitLabelPrefix),e.falseLabel]});return $.jsxs(Lg,{ref:t,value:d,onChange:C=>f(C.currentTarget.value),style:v,children:[d===ed&&$.jsx("option",{value:ed}),p&&$.jsx("option",{value:Bg,children:e.resetLabel}),E&&m,x&&S,(!E||!x)&&$.jsxs("optgroup",{label:"Blocked",children:[!E&&m,!x&&S]})]})}),XB=Ux,Ug=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===$e.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},JB={...kv,trueLabel:{title:"True Label",type:j.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:j.ControlType.String,defaultValue:"No"}};j.addPropertyControls(Ux,JB);const Gg=Ie.select`
|
|
1400
1400
|
color: inherit;
|
|
1401
|
-
`,zg="<reset>",nd="<nothing>",rd="included",id="excluded",Gx=Ui((e,t)=>{var n,r,i;if(In()){const b
|
|
1401
|
+
`,zg="<reset>",nd="<nothing>",rd="included",id="excluded",Gx=Ui((e,t)=>{var n,r,i;if(In()){const b=$a(e,!0,!1);return $.jsx(Gg,{style:b})}const o=Rr(),a=Sr(e),s=kj(a),{explain:u}=Vi();if(!s)return $.jsx("span",{children:"Component Attribute not found"});const{attribute:c,makeDecision:l}=s,f=async b=>{if(An.isComponentStatePossible(c,b))try{await l(b)}catch{Or()}else e.explain!=="disabled"&&await u(T=>T.whyIsStateNotPossible.component(c.id).state(b),e.explain,o)},d=async b=>{var T;const A=((T=c.decision)==null?void 0:T.kind)===$e.Explicit;b===zg&&A?await l(void 0):b===rd?await f(ot.Included):b===id&&await f(ot.Excluded)},p=Y((n=c.decision)==null?void 0:n.state).with(ot.Included,()=>rd).with(ot.Excluded,()=>id).otherwise(()=>nd),h=((r=c.decision)==null?void 0:r.kind)===$e.Explicit,v=((i=c.decision)==null?void 0:i.kind)===$e.Implicit,E=$a(e,c.isSatisfied,v),x=An.isComponentStatePossible(c,ot.Included),m=An.isComponentStatePossible(c,ot.Excluded),S=$.jsxs("option",{value:rd,children:[Wg(c,ot.Included,e.implicitLabelPrefix),e.includedLabel]}),C=$.jsxs("option",{value:id,children:[Wg(c,ot.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return $.jsxs(Gg,{ref:t,value:p,onChange:b=>d(b.currentTarget.value),style:E,children:[p===nd&&$.jsx("option",{value:nd}),h&&$.jsx("option",{value:zg,children:e.resetLabel}),x&&S,m&&C,(!x||!m)&&$.jsxs("optgroup",{label:"Blocked",children:[!x&&S,!m&&C]})]})}),QB=Gx,Wg=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===$e.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},ZB={...kv,includedLabel:{title:"Included Label",type:j.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:j.ControlType.String,defaultValue:"Excluded"}};j.addPropertyControls(Gx,ZB);function zx(e,t,n,r,i=1e3){const[o]=i1.useForceUpdate(),a=EL(d=>{t(d),o()},i),s=O.useRef(n),u=O.useRef(e),c=a.isPending(),l=O.useRef(c);O.useEffect(()=>{e!==u.current&&(u.current=e,c&&(a.cancel(),o()),e!==n&&r(e)),n!==s.current&&(s.current=n,n!==e?(a(n),o()):c&&(a.cancel(),o())),c!==l.current&&(l.current=c,!c&&e!==n&&r(e))},[e,n,a,c]);const f=O.useCallback(()=>{a.isPending()&&a.flush()},[a]);return O.useEffect(()=>()=>f(),[f]),{flush:f}}const Hg=Ie(UC)`
|
|
1402
1402
|
color: inherit;
|
|
1403
|
-
`,Wx=Ui((e,t)=>{var n,r;if(In()){const m=Fp(e,!0,!1);return $.jsx(Hg,{style:m})}const i=Rr(),o=Sr(e),a=kj(o),{explain:s}=Vi();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:c}=a,l=((n=u.decision)==null?void 0:n.kind)===$e.Implicit,f=Fp(e,u.isSatisfied,l),d=(r=u.decision)==null?void 0:r.state,[p,h]=O.useState(d),{min:v,max:E}=u.range,x=zx(d,async m=>{if(m<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(m>E){alert(`The value must be greater than or equal to ${E}.`);return}try{await c(m)}catch(C){const w=C;w.type===vt.ConfigurationModelNotFeasible||w.type===vt.ConfigurationConflict?e.explain!=="disabled"&&await s(b=>b.whyIsStateNotPossible.numeric(u.id).state(m),e.explain,i):Or()}},p,m=>h(m),e.wait);return $.jsx(Hg,{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:rV(u,e.implicitLabelPrefix),onBlur:()=>{x.flush()},onKeyPress:m=>{m.key==="Enter"&&x.flush()},onValueChange:m=>h(m.floatValue),value:p??"",style:f})}),nV=Wx,rV=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===$e.Implicit?t:""},iV={...qx,wait:{title:"Debounce Delay",type:j.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:j.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:j.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:j.ControlType.String,defaultValue:""}};j.addPropertyControls(Wx,iV);const hf={choiceValueId:{title:"Choice Value Id",type:j.ControlType.String}};function jo(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=Bw(n.props,t);return O.cloneElement(n,r)}return n})}const Hx=Ui((e,t)=>{if(In())return e.children;const n=Rr(),{makeDecision:r}=Li(),i=Sr(e),o=e.choiceValueId??"",a=o.length>0,s=pu([i])[0],{explain:u}=Vi();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===W.Choice,l=s.type===W.Numeric,f=s.type===W.Boolean,d=s.type===W.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(l)return $.jsx("span",{children:"Numeric Attribute is not supported"});let p=c?s.values.find(m=>m.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const h=m=>Y({state:m,attribute:s}).with({attribute:{type:W.Choice},state:"undefined"},()=>p.decision==null).with({attribute:{type:W.Choice},state:"included"},()=>{var C,w;return((C=p.decision)==null?void 0:C.state)===bt.Included&&((w=p.decision)==null?void 0:w.kind)===$e.Explicit}).with({attribute:{type:W.Choice},state:"excluded"},()=>{var C,w;return((C=p.decision)==null?void 0:C.state)===bt.Excluded&&((w=p.decision)==null?void 0:w.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},state:"undefined"},{attribute:{type:W.Component},state:"undefined"},({attribute:C})=>C.decision==null).with({attribute:{type:W.Boolean},state:"true"},({attribute:C})=>{var w,b;return((w=C.decision)==null?void 0:w.state)===!0&&((b=C.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},state:"false"},({attribute:C})=>{var w,b;return((w=C.decision)==null?void 0:w.state)===!1&&((b=C.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Component},state:"included"},({attribute:C})=>{var w,b;return((w=C.decision)==null?void 0:w.state)===ot.Included&&((b=C.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Component},state:"excluded"},({attribute:C})=>{var w,b;return((w=C.decision)==null?void 0:w.state)===ot.Excluded&&((b=C.decision)==null?void 0:b.kind)===$e.Explicit}).otherwise(()=>!1),v=m=>Y({isChoiceAttribute:c,isBooleanAttribute:f,isComponentAttribute:d,state:m}).with({isChoiceAttribute:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ot.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ot.Excluded).otherwise(()=>null);h(e.toggleFrom);const E=h(e.toggleTo),x=async()=>{const m=E?e.toggleFrom:e.toggleTo,C=v(m),w=d?An.isComponentStatePossible(s,C):!1,b=f?An.isBooleanValuePossible(s,C):!1;if(c&&p.possibleDecisionStates.some(T=>T===C)||b||w||C==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:C})}catch{Or()}else if(e.explain!=="disabled"){const T=Y({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Qe.choiceValue).with({isBooleanAttribute:!0},()=>Qe.boolean).with({isComponentAttribute:!0},()=>Qe.component).otherwise(()=>null);T&&await u({question:_t.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:C},e.explain,n)}};return jo(e.children,{onClick:x,ref:t})}),oV=Hx,aV={...Mi,...hf,children:{title:"Content",type:j.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:j.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:j.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...Cu};j.addPropertyControls(Hx,aV);const Kx=Ui((e,t)=>{if(In())return e.children;const n=Rr(),{makeDecision:r}=Li(),i=Sr(e),o=e.choiceValueId??"",a=o.length>0,s=pu([i])[0],u=tv(i),{explain:c}=Vi();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===W.Choice,f=s.type===W.Numeric,d=s.type===W.Boolean,p=s.type===W.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let h=l?s.values.find(x=>x.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>Y({isChoiceAttribute:l,isBooleanAttribute:d,isComponentAttribute:p,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ot.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ot.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),E=async()=>{if(l&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Or()}else{const x=v(),m=p?An.isComponentStatePossible(s,x):!1,C=d?An.isBooleanValuePossible(s,x):!1,w=(l?h.possibleDecisionStates.some(b=>b===x):!1)||C||m;if(f||w||x==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:x})}catch(b){const T=b;f&&(T.type===vt.ConfigurationModelNotFeasible||T.type===vt.ConfigurationConflict)?e.explain!=="disabled"&&await c(A=>A.whyIsStateNotPossible.numeric(s.id).state(x),e.explain,n):Or()}else if(e.explain!=="disabled"){const b=Y({isComponentAttribute:p,isBooleanAttribute:d,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Qe.choiceValue).with({isBooleanAttribute:!0},()=>Qe.boolean).with({isComponentAttribute:!0},()=>Qe.component).otherwise(()=>null);b&&await c({question:_t.whyIsStateNotPossible,subject:b,attributeId:i,choiceValueId:o,state:x},e.explain,n)}}};return jo(e.children,{onClick:E,ref:t})}),sV=Kx,uV={...Mi,...hf,children:{title:"Content",type:j.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:j.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:j.ControlType.Number,defaultValue:0},...Cu};j.addPropertyControls(Kx,uV);const Yx=Ui((e,t)=>{var n;if(In())return e.children;const r=Rr(),{setManyDecision:i}=Li(),{handleExplainAnswer:o}=Vi(),a=e.attributes.map(Sr),s=pu(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const p=e.attributes[d],h=p.choiceValueId??"",v=h.length>0,E=f.type===W.Choice,x=f.type===W.Numeric,m=f.type===W.Boolean,C=f.type===W.Component;if(!E&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let w=E?f.values.find(T=>T.id===h):null;if(v&&w==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const b=()=>Y({isChoiceAttribute:E,isBooleanAttribute:m,isComponentAttribute:C,isNumericAttribute:x,hasChoiceValueId:v,state:p.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ot.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ot.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>p.numericValue).otherwise(()=>null);return{getDecisions:()=>E&&!v&&p.setSelection==="undefined"?f.values.filter(T=>{var A;return((A=T.decision)==null?void 0:A.kind)===$e.Explicit}).map(T=>({type:f.type,attributeId:f.id,choiceValueId:T.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:h,state:b()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const c=async()=>{const f=s.reduce((p,h)=>[...p,...h.getDecisions()],new Array),d=Y(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:Y(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(p){const h=p;(h==null?void 0:h.type)===vt.ConfigurationSetManyConflict&&h.decisionExplanations?e.explain!=="disabled"&&await o(h,e.explain,r):Or()}},l=()=>{e.trigger==="click"&&c()};return O.useEffect(()=>{e.trigger==="auto"&&c()},[]),jo(e.children,{onClick:l,ref:t})}),cV=Yx,lV={children:{title:"Content",type:j.ControlType.ComponentInstance},attributes:{title:"Attributes",type:j.ControlType.Array,control:{type:j.ControlType.Object,controls:{...Mi,...hf,setSelection:{title:"Set Selection To",type:j.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:j.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:j.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:j.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:j.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...Cu};j.addPropertyControls(Yx,lV);const Xx=Mo(e=>{if(In())return e.enabledChildren;const{configuration:t}=q0(),{setManyDecision:n}=Li(),r=t.attributes.some(a=>Y(a).with({type:W.Choice},s=>s.values.some(u=>{var c;return((c=u.decision)==null?void 0:c.kind)===$e.Explicit})).with({type:W.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).with({type:W.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).with({type:W.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{KB()}},o=r?e.enabledChildren:e.disabledChildren;return jo(o,{onClick:i})}),fV=Xx,dV={enabledChildren:{title:"Content – Enabled",type:j.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:j.ControlType.ComponentInstance}};j.addPropertyControls(Xx,dV);const Jx=Ui((e,t)=>{if(In())return e.satisfiedChildren;const n=Rr(),{configuration:r}=q0(),{explain:i}=Vi(),o=[...e.attributeId.length>0?[Sr(e)]:[],...e.attributes.map(Sr)],a=()=>{var u;const c=pu(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=c.find(f=>f.error))==null?void 0:u.error)||c.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:jo(e.unsatisfiedChildren,{onClick:s,ref:t})}),pV=Jx,hV={satisfiedChildren:{title:"Content – Satisfied",type:j.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:j.ControlType.ComponentInstance},...Mi,attributes:{title:"Attributes",type:j.ControlType.Array,control:{type:j.ControlType.Object,controls:{...Mi}}},...Cu};j.addPropertyControls(Jx,hV);const Qx=Mo(O.forwardRef(function(e,t){const n=f=>Y(f).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(f=>f.useInDesignTime)||e.variants[0];if(In())return r&&n(r.content);const i=Sr(e),o=e.choiceValueId??"",a=o.length>0,s=pu([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===W.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(u&&!a)return $.jsx("span",{children:"Choice Value Id missing"});let c=u?s.values.find(f=>f.id===o):null;if(a&&c==null)return $.jsx("span",{children:"Choice Value not found"});const l=[...e.variants].find(({selection:f,condition:d})=>Y({selection:f,condition:d,attribute:s}).with({attribute:{type:W.Choice},selection:"included",condition:"blocked"},()=>!c.possibleDecisionStates.includes(bt.Included)).with({attribute:{type:W.Choice},selection:"included",condition:"implicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Included&&((h=c.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Choice},selection:"included",condition:"explicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Included&&((h=c.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Choice},selection:"included",condition:"none"},()=>{var p;return((p=c.decision)==null?void 0:p.state)===bt.Included}).with({attribute:{type:W.Choice},selection:"excluded",condition:"blocked"},()=>!c.possibleDecisionStates.includes(bt.Excluded)).with({attribute:{type:W.Choice},selection:"excluded",condition:"implicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Excluded&&((h=c.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Choice},selection:"excluded",condition:"explicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Excluded&&((h=c.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Choice},selection:"excluded",condition:"none"},()=>{var p;return((p=c.decision)==null?void 0:p.state)===bt.Excluded}).with({attribute:{type:W.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:W.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!0&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!0&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===!0}).with({attribute:{type:W.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:W.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!1&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!1&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===!1}).with({attribute:{type:W.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(ot.Included)).with({attribute:{type:W.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ot.Included&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ot.Included&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Component},selection:"included",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===ot.Included}).with({attribute:{type:W.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(ot.Excluded)).with({attribute:{type:W.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ot.Excluded&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ot.Excluded&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===ot.Excluded}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:W.Choice},selection:"undefined"},()=>c.decision==null).with({attribute:{type:W.Boolean},selection:"undefined"},{attribute:{type:W.Component},selection:"undefined"},{attribute:{type:W.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return l&&jo(n(l.content),{ref:t})})),vV=Qx,mV={...Mi,...hf,variants:{title:"Variants",type:j.ControlType.Array,maxCount:10,control:{type:j.ControlType.Object,controls:{selection:{title:"Selection",type:j.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:j.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:j.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:j.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:j.ControlType.ComponentInstance},content2:{title:"Content 2",type:j.ControlType.ComponentInstance},content3:{title:"Content 3",type:j.ControlType.ComponentInstance},content4:{title:"Content 4",type:j.ControlType.ComponentInstance},content5:{title:"Content 5",type:j.ControlType.ComponentInstance},content6:{title:"Content 6",type:j.ControlType.ComponentInstance},content7:{title:"Content 7",type:j.ControlType.ComponentInstance},content8:{title:"Content 8",type:j.ControlType.ComponentInstance},content9:{title:"Content 9",type:j.ControlType.ComponentInstance},content10:{title:"Content 10",type:j.ControlType.ComponentInstance}};j.addPropertyControls(Qx,mV);const Zx=Mo(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=NL(a);return OL(`#${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})}),yV=Zx,gV={children:{title:"Content",type:j.ControlType.ComponentInstance},color:{title:"Color",type:j.ControlType.Color,defaultValue:"#0000ff"}};j.addPropertyControls(Zx,gV);const e1=Mo(e=>{if(In())return e.children;const{error:t}=nv();return t?jo(e.children,{onClick:t.retry}):null}),bV=e1,SV={children:{title:"Content",type:j.ControlType.ComponentInstance}};j.addPropertyControls(e1,SV);function CV(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const wV=Ie.div`
|
|
1403
|
+
`,Wx=Ui((e,t)=>{var n,r;if(In()){const m=Fp(e,!0,!1);return $.jsx(Hg,{style:m})}const i=Rr(),o=Sr(e),a=Pj(o),{explain:s}=Vi();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:c}=a,l=((n=u.decision)==null?void 0:n.kind)===$e.Implicit,f=Fp(e,u.isSatisfied,l),d=(r=u.decision)==null?void 0:r.state,[p,h]=O.useState(d),{min:v,max:E}=u.range,x=zx(d,async m=>{if(m<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(m>E){alert(`The value must be greater than or equal to ${E}.`);return}try{await c(m)}catch(S){const C=S;C.type===vt.ConfigurationModelNotFeasible||C.type===vt.ConfigurationConflict?e.explain!=="disabled"&&await s(b=>b.whyIsStateNotPossible.numeric(u.id).state(m),e.explain,i):Or()}},p,m=>h(m),e.wait);return $.jsx(Hg,{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:tV(u,e.implicitLabelPrefix),onBlur:()=>{x.flush()},onKeyPress:m=>{m.key==="Enter"&&x.flush()},onValueChange:m=>h(m.floatValue),value:p??"",style:f})}),eV=Wx,tV=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===$e.Implicit?t:""},nV={...qx,wait:{title:"Debounce Delay",type:j.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:j.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:j.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:j.ControlType.String,defaultValue:""}};j.addPropertyControls(Wx,nV);const hf={choiceValueId:{title:"Choice Value Id",type:j.ControlType.String}};function Mo(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=BC(n.props,t);return O.cloneElement(n,r)}return n})}const Hx=Ui((e,t)=>{if(In())return e.children;const n=Rr(),{makeDecision:r}=Li(),i=Sr(e),o=e.choiceValueId??"",a=o.length>0,s=pu([i])[0],{explain:u}=Vi();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===W.Choice,l=s.type===W.Numeric,f=s.type===W.Boolean,d=s.type===W.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(l)return $.jsx("span",{children:"Numeric Attribute is not supported"});let p=c?s.values.find(m=>m.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const h=m=>Y({state:m,attribute:s}).with({attribute:{type:W.Choice},state:"undefined"},()=>p.decision==null).with({attribute:{type:W.Choice},state:"included"},()=>{var S,C;return((S=p.decision)==null?void 0:S.state)===bt.Included&&((C=p.decision)==null?void 0:C.kind)===$e.Explicit}).with({attribute:{type:W.Choice},state:"excluded"},()=>{var S,C;return((S=p.decision)==null?void 0:S.state)===bt.Excluded&&((C=p.decision)==null?void 0:C.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},state:"undefined"},{attribute:{type:W.Component},state:"undefined"},({attribute:S})=>S.decision==null).with({attribute:{type:W.Boolean},state:"true"},({attribute:S})=>{var C,b;return((C=S.decision)==null?void 0:C.state)===!0&&((b=S.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},state:"false"},({attribute:S})=>{var C,b;return((C=S.decision)==null?void 0:C.state)===!1&&((b=S.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Component},state:"included"},({attribute:S})=>{var C,b;return((C=S.decision)==null?void 0:C.state)===ot.Included&&((b=S.decision)==null?void 0:b.kind)===$e.Explicit}).with({attribute:{type:W.Component},state:"excluded"},({attribute:S})=>{var C,b;return((C=S.decision)==null?void 0:C.state)===ot.Excluded&&((b=S.decision)==null?void 0:b.kind)===$e.Explicit}).otherwise(()=>!1),v=m=>Y({isChoiceAttribute:c,isBooleanAttribute:f,isComponentAttribute:d,state:m}).with({isChoiceAttribute:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ot.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ot.Excluded).otherwise(()=>null);h(e.toggleFrom);const E=h(e.toggleTo),x=async()=>{const m=E?e.toggleFrom:e.toggleTo,S=v(m),C=d?An.isComponentStatePossible(s,S):!1,b=f?An.isBooleanValuePossible(s,S):!1;if(c&&p.possibleDecisionStates.some(T=>T===S)||b||C||S==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:S})}catch{Or()}else if(e.explain!=="disabled"){const T=Y({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Qe.choiceValue).with({isBooleanAttribute:!0},()=>Qe.boolean).with({isComponentAttribute:!0},()=>Qe.component).otherwise(()=>null);T&&await u({question:_t.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:S},e.explain,n)}};return Mo(e.children,{onClick:x,ref:t})}),rV=Hx,iV={...Mi,...hf,children:{title:"Content",type:j.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:j.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:j.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...wu};j.addPropertyControls(Hx,iV);const Kx=Ui((e,t)=>{if(In())return e.children;const n=Rr(),{makeDecision:r}=Li(),i=Sr(e),o=e.choiceValueId??"",a=o.length>0,s=pu([i])[0],u=tv(i),{explain:c}=Vi();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===W.Choice,f=s.type===W.Numeric,d=s.type===W.Boolean,p=s.type===W.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let h=l?s.values.find(x=>x.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>Y({isChoiceAttribute:l,isBooleanAttribute:d,isComponentAttribute:p,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ot.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ot.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),E=async()=>{if(l&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Or()}else{const x=v(),m=p?An.isComponentStatePossible(s,x):!1,S=d?An.isBooleanValuePossible(s,x):!1,C=(l?h.possibleDecisionStates.some(b=>b===x):!1)||S||m;if(f||C||x==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:x})}catch(b){const T=b;f&&(T.type===vt.ConfigurationModelNotFeasible||T.type===vt.ConfigurationConflict)?e.explain!=="disabled"&&await c(A=>A.whyIsStateNotPossible.numeric(s.id).state(x),e.explain,n):Or()}else if(e.explain!=="disabled"){const b=Y({isComponentAttribute:p,isBooleanAttribute:d,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Qe.choiceValue).with({isBooleanAttribute:!0},()=>Qe.boolean).with({isComponentAttribute:!0},()=>Qe.component).otherwise(()=>null);b&&await c({question:_t.whyIsStateNotPossible,subject:b,attributeId:i,choiceValueId:o,state:x},e.explain,n)}}};return Mo(e.children,{onClick:E,ref:t})}),oV=Kx,aV={...Mi,...hf,children:{title:"Content",type:j.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:j.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:j.ControlType.Number,defaultValue:0},...wu};j.addPropertyControls(Kx,aV);const Yx=Ui((e,t)=>{var n;if(In())return e.children;const r=Rr(),{setManyDecision:i}=Li(),{handleExplainAnswer:o}=Vi(),a=e.attributes.map(Sr),s=pu(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const p=e.attributes[d],h=p.choiceValueId??"",v=h.length>0,E=f.type===W.Choice,x=f.type===W.Numeric,m=f.type===W.Boolean,S=f.type===W.Component;if(!E&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let C=E?f.values.find(T=>T.id===h):null;if(v&&C==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const b=()=>Y({isChoiceAttribute:E,isBooleanAttribute:m,isComponentAttribute:S,isNumericAttribute:x,hasChoiceValueId:v,state:p.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>bt.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>bt.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>ot.Included).with({isComponentAttribute:!0,state:"excluded"},()=>ot.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>p.numericValue).otherwise(()=>null);return{getDecisions:()=>E&&!v&&p.setSelection==="undefined"?f.values.filter(T=>{var A;return((A=T.decision)==null?void 0:A.kind)===$e.Explicit}).map(T=>({type:f.type,attributeId:f.id,choiceValueId:T.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:h,state:b()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const c=async()=>{const f=s.reduce((p,h)=>[...p,...h.getDecisions()],new Array),d=Y(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:Y(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(p){const h=p;if(console.debug("SetMany failed",h),(h==null?void 0:h.type)===vt.ConfigurationSetManyConflict&&h.decisionExplanations){e.explain!=="disabled"&&await o(h,e.explain,r);return}Or();return}},l=()=>{e.trigger==="click"&&c()};return O.useEffect(()=>{e.trigger==="auto"&&c()},[]),Mo(e.children,{onClick:l,ref:t})}),sV=Yx,uV={children:{title:"Content",type:j.ControlType.ComponentInstance},attributes:{title:"Attributes",type:j.ControlType.Array,control:{type:j.ControlType.Object,controls:{...Mi,...hf,setSelection:{title:"Set Selection To",type:j.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:j.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:j.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:j.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:j.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...wu};j.addPropertyControls(Yx,uV);const Xx=ko(e=>{if(In())return e.enabledChildren;const{configuration:t}=qw(),{setManyDecision:n}=Li(),r=t.attributes.some(a=>Y(a).with({type:W.Choice},s=>s.values.some(u=>{var c;return((c=u.decision)==null?void 0:c.kind)===$e.Explicit})).with({type:W.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).with({type:W.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).with({type:W.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===$e.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{WB()}},o=r?e.enabledChildren:e.disabledChildren;return Mo(o,{onClick:i})}),cV=Xx,lV={enabledChildren:{title:"Content – Enabled",type:j.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:j.ControlType.ComponentInstance}};j.addPropertyControls(Xx,lV);const Jx=Ui((e,t)=>{if(In())return e.satisfiedChildren;const n=Rr(),{configuration:r}=qw(),{explain:i}=Vi(),o=[...e.attributeId.length>0?[Sr(e)]:[],...e.attributes.map(Sr)],a=()=>{var u;const c=pu(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=c.find(f=>f.error))==null?void 0:u.error)||c.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:Mo(e.unsatisfiedChildren,{onClick:s,ref:t})}),fV=Jx,dV={satisfiedChildren:{title:"Content – Satisfied",type:j.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:j.ControlType.ComponentInstance},...Mi,attributes:{title:"Attributes",type:j.ControlType.Array,control:{type:j.ControlType.Object,controls:{...Mi}}},...wu};j.addPropertyControls(Jx,dV);const Qx=ko(O.forwardRef(function(e,t){const n=f=>Y(f).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(f=>f.useInDesignTime)||e.variants[0];if(In())return r&&n(r.content);const i=Sr(e),o=e.choiceValueId??"",a=o.length>0,s=pu([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===W.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(u&&!a)return $.jsx("span",{children:"Choice Value Id missing"});let c=u?s.values.find(f=>f.id===o):null;if(a&&c==null)return $.jsx("span",{children:"Choice Value not found"});const l=[...e.variants].find(({selection:f,condition:d})=>Y({selection:f,condition:d,attribute:s}).with({attribute:{type:W.Choice},selection:"included",condition:"blocked"},()=>!c.possibleDecisionStates.includes(bt.Included)).with({attribute:{type:W.Choice},selection:"included",condition:"implicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Included&&((h=c.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Choice},selection:"included",condition:"explicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Included&&((h=c.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Choice},selection:"included",condition:"none"},()=>{var p;return((p=c.decision)==null?void 0:p.state)===bt.Included}).with({attribute:{type:W.Choice},selection:"excluded",condition:"blocked"},()=>!c.possibleDecisionStates.includes(bt.Excluded)).with({attribute:{type:W.Choice},selection:"excluded",condition:"implicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Excluded&&((h=c.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Choice},selection:"excluded",condition:"explicit"},()=>{var p,h;return((p=c.decision)==null?void 0:p.state)===bt.Excluded&&((h=c.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Choice},selection:"excluded",condition:"none"},()=>{var p;return((p=c.decision)==null?void 0:p.state)===bt.Excluded}).with({attribute:{type:W.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:W.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!0&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!0&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===!0}).with({attribute:{type:W.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:W.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!1&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===!1&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===!1}).with({attribute:{type:W.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(ot.Included)).with({attribute:{type:W.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ot.Included&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ot.Included&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Component},selection:"included",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===ot.Included}).with({attribute:{type:W.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(ot.Excluded)).with({attribute:{type:W.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ot.Excluded&&((v=p.decision)==null?void 0:v.kind)===$e.Implicit}).with({attribute:{type:W.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var h,v;return((h=p.decision)==null?void 0:h.state)===ot.Excluded&&((v=p.decision)==null?void 0:v.kind)===$e.Explicit}).with({attribute:{type:W.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.state)===ot.Excluded}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.kind)===$e.Implicit}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var h;return((h=p.decision)==null?void 0:h.kind)===$e.Explicit}).with({attribute:{type:W.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:W.Choice},selection:"undefined"},()=>c.decision==null).with({attribute:{type:W.Boolean},selection:"undefined"},{attribute:{type:W.Component},selection:"undefined"},{attribute:{type:W.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return l&&Mo(n(l.content),{ref:t})})),pV=Qx,hV={...Mi,...hf,variants:{title:"Variants",type:j.ControlType.Array,maxCount:10,control:{type:j.ControlType.Object,controls:{selection:{title:"Selection",type:j.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:j.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:j.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:j.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:j.ControlType.ComponentInstance},content2:{title:"Content 2",type:j.ControlType.ComponentInstance},content3:{title:"Content 3",type:j.ControlType.ComponentInstance},content4:{title:"Content 4",type:j.ControlType.ComponentInstance},content5:{title:"Content 5",type:j.ControlType.ComponentInstance},content6:{title:"Content 6",type:j.ControlType.ComponentInstance},content7:{title:"Content 7",type:j.ControlType.ComponentInstance},content8:{title:"Content 8",type:j.ControlType.ComponentInstance},content9:{title:"Content 9",type:j.ControlType.ComponentInstance},content10:{title:"Content 10",type:j.ControlType.ComponentInstance}};j.addPropertyControls(Qx,hV);const Zx=ko(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=OL(a);return AL(`#${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})}),vV=Zx,mV={children:{title:"Content",type:j.ControlType.ComponentInstance},color:{title:"Color",type:j.ControlType.Color,defaultValue:"#0000ff"}};j.addPropertyControls(Zx,mV);const e1=ko(e=>{if(In())return e.children;const{error:t}=nv();return t?Mo(e.children,{onClick:t.retry}):null}),yV=e1,gV={children:{title:"Content",type:j.ControlType.ComponentInstance}};j.addPropertyControls(e1,gV);function bV(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const SV=Ie.div`
|
|
1404
1404
|
width: 10px;
|
|
1405
1405
|
height: 10px;
|
|
1406
1406
|
background-color: greenyellow;
|
|
1407
|
-
`;function t1(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(
|
|
1407
|
+
`;function t1(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(SV,{ref:t})}const wV={delay:{title:"Delay",type:j.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};j.addPropertyControls(t1,wV);const n1=Ie.div`
|
|
1408
1408
|
display: contents;
|
|
1409
|
-
`,
|
|
1409
|
+
`,CV=hu`
|
|
1410
1410
|
:root {
|
|
1411
1411
|
*:has(> ${n1}) {
|
|
1412
1412
|
display: contents !important;
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
|
-
`,r1=
|
|
1415
|
+
`,r1=ko(Bx(e=>{const t=Rr(),n=In(),r=n?(()=>O.Children.toArray(e.itemTemplate)[0])():(()=>{const c=l=>{var f;const d=O.Children.toArray(l)[0],p=(f=d.props)==null?void 0:f.children;return p?c(p):d};return c(e.itemTemplate)})();if(!r)return $.jsx("span",{children:"Choice Value Template not defined"});const i=c=>c.map(l=>O.cloneElement(r,{key:l,layoutId:`${t}_${l}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:l}));if(n)return $.jsx(Kg,{...e,children:i(["Choice Value 1","Choice Value 2","Choice Value 3"])});const o=Sr(e),a=tv(o);if(!a)return $.jsx("span",{children:"Choice Attribute not found"});const{attribute:s}=a,u=s.values.map(c=>c.id);return $.jsx(Kg,{...e,children:i(u)})}));function Kg(e){return $.jsxs($.Fragment,{children:[$.jsx(sl,{singletonId:"ChoiceValueListRenderer",children:$.jsx(CV,{})}),$.jsx(n1,{style:e.style,children:e.children})]})}const xV=r1,EV={...Mi,itemTemplate:{title:"Choice Value Template",type:j.ControlType.ComponentInstance}};j.addPropertyControls(r1,EV);const TV=Object.freeze(Object.defineProperty({__proto__:null,BooleanSelect:XB,ChoiceSelect:HB,ChoiceValueListRenderer:xV,Colorize:vV,ComponentSelect:QB,Configuration:fB,InitializationRetry:yV,NumericInput:eV,ResetConfiguration:cV,SatisfactionIndicator:fV,ScrollIntoView:t1,SelectionIndicator:pV,SelectionToggle:rV,SetSelection:oV,SetSelections:sV,Singleton:sl,useDebounceValue:zx,useRenderPlaceholder:In,withFullSize:bV},Symbol.toStringTag,{value:"Module"}));exports.Configurator=EA;exports.ConfiguratorFramer=TV;exports.ConfiguratorReact=ID;
|