@viamedici-spc/configurator-framer 0.1.0 → 1.0.0
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 +437 -1
- package/dist/index.d.ts +387 -3
- package/dist/index.js +5094 -11
- package/package.json +32 -7
package/dist/index.cjs
CHANGED
|
@@ -1 +1,437 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),y=require("framer"),p=require("@viamedici-spc/configurator-ts"),Q=require("@viamedici-spc/configurator-react"),R=require("react"),B=require("ts-pattern"),ri=require("react-error-boundary"),V=require("styled-components"),T=require("@viamedici-spc/fp-ts-extensions"),Ge=require("@fortawesome/free-solid-svg-icons"),Je=require("@fortawesome/react-fontawesome"),Bn=require("react-dom"),li=require("clsx"),Mn=require("merge-props"),si=require("dyna-guid"),ai=require("react-number-format"),ci=require("use-debounce"),ui=require("framer-motion"),di=require("hex-to-css-filter"),fi=require("rgb-hex");function Nn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const A=Nn(R),pi=Nn(Bn);function hi(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 o=0;o<e.length;o++){var i=e[o];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(o>0&&(i=i.replace(/^[\/]+/,"")),o<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var r=t.join("/");r=r.replace(/\/(\?|&|#[^!])/g,"$1");var l=r.split("?");return r=l.shift()+(l.length>0?"?":"")+l.join("&"),r}function mi(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),hi(e)}function Z(){return y.RenderTarget.current()!==y.RenderTarget.preview}function gi(e){if(Z())return null;const{error:n}=Q.useConfigurationInitialization();if(!n)return null;switch(n.type){case p.FailureType.ConfigurationModelNotFound:return R.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:u.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case p.FailureType.ConfigurationUnauthenticated:return R.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:u.jsx("span",{children:"The HCA access token is invalid."});case p.FailureType.SpecifiedDeploymentForbidden:return R.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:u.jsx("span",{children:"The HCA access token does not permit using the specified Configuration Model."});case p.FailureType.DecisionsToRespectInvalid:return u.jsx("span",{children:"The definition of Attribute Relations is invalid."});default:return R.Children.toArray(e.errorContent).length>0?e.errorContent:u.jsx("span",{children:"An error occurred while initializing the configuration."})}}function Te(e){return R.forwardRef((t,n)=>u.jsx(ri.ErrorBoundary,{fallbackRender:()=>u.jsx("span",{children:"Component crashed"}),children:u.jsx(e,{...t,ref:n})}))}const yi=V.createGlobalStyle`
|
|
2
|
+
:root {
|
|
3
|
+
--font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
4
|
+
--font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* font sizes */
|
|
8
|
+
:root {
|
|
9
|
+
--text-base-size: calc(var(--framer-font-size, 16px) * var(--framer-font-size-scale, 1));
|
|
10
|
+
--text-scale-ratio: 1.2;
|
|
11
|
+
|
|
12
|
+
--text-xs: calc(1em / (var(--text-scale-ratio) * var(--text-scale-ratio)));
|
|
13
|
+
--text-sm: calc(1em / var(--text-scale-ratio));
|
|
14
|
+
--text-md: calc(1em * var(--text-scale-ratio));
|
|
15
|
+
--text-lg: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
16
|
+
--text-xl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
17
|
+
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
18
|
+
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
19
|
+
}
|
|
20
|
+
`,bi=yi,xi=V.createGlobalStyle`
|
|
21
|
+
:root {
|
|
22
|
+
--space-unit: 1em;
|
|
23
|
+
--space-xxs: calc(0.25 * var(--space-unit));
|
|
24
|
+
--space-xs: calc(0.5 * var(--space-unit));
|
|
25
|
+
--space-sm: calc(0.75 * var(--space-unit));
|
|
26
|
+
--space-md: calc(1.25 * var(--space-unit));
|
|
27
|
+
--space-lg: calc(2 * var(--space-unit));
|
|
28
|
+
--space-xl: calc(3.25 * var(--space-unit));
|
|
29
|
+
--space-xxl: calc(5.25 * var(--space-unit));
|
|
30
|
+
|
|
31
|
+
--space-unit-fixed: var(--text-base-size);
|
|
32
|
+
--space-xxs-fixed: calc(0.25 * var(--space-unit-fixed));
|
|
33
|
+
--space-xs-fixed: calc(0.5 * var(--space-unit-fixed));
|
|
34
|
+
--space-sm-fixed: calc(0.75 * var(--space-unit-fixed));
|
|
35
|
+
--space-md-fixed: calc(1.25 * var(--space-unit-fixed));
|
|
36
|
+
--space-lg-fixed: calc(2 * var(--space-unit-fixed));
|
|
37
|
+
--space-xl-fixed: calc(3.25 * var(--space-unit-fixed));
|
|
38
|
+
--space-xxl-fixed: calc(5.25 * var(--space-unit-fixed));
|
|
39
|
+
}
|
|
40
|
+
`,Ci=xi,vi=V.createGlobalStyle`
|
|
41
|
+
:root {
|
|
42
|
+
--shape-border-radius-xs: 5px;
|
|
43
|
+
--shape-border-radius-sm: 7px;
|
|
44
|
+
--shape-border-radius-md: 12px;
|
|
45
|
+
--shape-border-radius-lg: 20px;
|
|
46
|
+
}
|
|
47
|
+
`,wi=vi,Si=V.createGlobalStyle`
|
|
48
|
+
:root {
|
|
49
|
+
--shadows-popover: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4));
|
|
50
|
+
--shadows-dialog: 0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02),
|
|
51
|
+
0.6px 1px 5.7px rgba(0, 0, 0, 0.025),
|
|
52
|
+
1.2px 2.1px 10.6px rgba(0, 0, 0, 0.03),
|
|
53
|
+
2.3px 4px 17.2px rgba(0, 0, 0, 0.034),
|
|
54
|
+
4.2px 7.2px 25.9px rgba(0, 0, 0, 0.04),
|
|
55
|
+
7.6px 12.8px 37.7px rgba(0, 0, 0, 0.048),
|
|
56
|
+
13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061),
|
|
57
|
+
40px 68px 96px rgba(0, 0, 0, 0.1);
|
|
58
|
+
}
|
|
59
|
+
`,Ti=Si;function Ut(){return u.jsxs(u.Fragment,{children:[u.jsx(Ti,{}),u.jsx(wi,{}),u.jsx(Ci,{}),u.jsx(bi,{})]})}const Le=R.createContext(null);function me(){const{process:e,switchMode:t,applySolution:n,dismiss:o}=R.useContext(Le);return e?{...e,switchMode:t,applySolution:n,dismiss:o}:null}function Ln(e){const{explanation:t,...n}=e,o=me();return u.jsx("button",{...n,onClick:()=>o.applySolution(t.solution),children:e.children})}function $n(e){return B.match(e).returnType().with({type:p.AttributeType.Choice},t=>t.choiceValueId).with({type:p.AttributeType.Boolean},t=>t.state.toString()).with({type:p.AttributeType.Component},t=>t.state).with({type:p.AttributeType.Numeric},t=>t.state.toString()).exhaustive()}const Ai=V.div`
|
|
60
|
+
display: flex;
|
|
61
|
+
gap: var(--space-xs);
|
|
62
|
+
align-items: center;
|
|
63
|
+
background-color: var(--color-explain-attribute-value-fill);
|
|
64
|
+
border-radius: 360px;
|
|
65
|
+
padding-right: var(--space-sm);
|
|
66
|
+
font-size: 0.9em;
|
|
67
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
68
|
+
font-weight: 500;
|
|
69
|
+
min-width: 0;
|
|
70
|
+
`,Ei=V.div`
|
|
71
|
+
display: grid;
|
|
72
|
+
place-content: center;
|
|
73
|
+
border-top-left-radius: 360px;
|
|
74
|
+
border-bottom-left-radius: 360px;
|
|
75
|
+
height: 1.5em;
|
|
76
|
+
width: 1.5em;
|
|
77
|
+
flex-shrink: 0;
|
|
78
|
+
|
|
79
|
+
&.mode-add {
|
|
80
|
+
background-color: var(--color-explain-attribute-value-add-fill);
|
|
81
|
+
color: var(--color-explain-attribute-value-add-color);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&.mode-remove {
|
|
85
|
+
background-color: var(--color-explain-attribute-value-remove-fill);
|
|
86
|
+
color: var(--color-explain-attribute-value-remove-color);
|
|
87
|
+
}
|
|
88
|
+
`,Ri=V.div`
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
overflow: hidden;
|
|
91
|
+
text-overflow: ellipsis;
|
|
92
|
+
`;function Ii(e){const{decision:t}=e,n=t.intention,o=$n(t);return u.jsxs(Ai,{children:[u.jsxs(Ei,{className:`mode-${n}`,children:[n==="remove"&&u.jsx(Je.FontAwesomeIcon,{icon:Ge.faMinus}),n==="add"&&u.jsx(Je.FontAwesomeIcon,{icon:Ge.faPlus})]}),u.jsx(Ri,{children:o})]})}const Pi=V.div`
|
|
93
|
+
display: grid;
|
|
94
|
+
grid-template-columns: subgrid;
|
|
95
|
+
grid-column: span 2;
|
|
96
|
+
align-items: center;
|
|
97
|
+
`,Oi=V.div`
|
|
98
|
+
grid-area: name;
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
`,Di=V.div`
|
|
103
|
+
grid-area: values;
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-wrap: wrap;
|
|
106
|
+
min-width: 0;
|
|
107
|
+
gap: var(--space-xxs);
|
|
108
|
+
`,Vi=T.pipe(T.Str.Ord,T.Ord.contramap(e=>$n(e)));function ji(e){const{decisions:t}=e,n=t[0].attributeId,o=T.pipe(t,T.RA.sort(Vi));return u.jsxs(Pi,{children:[u.jsx(Oi,{children:n.localId}),u.jsx(Di,{children:o.map((i,r)=>u.jsx(Ii,{decision:i},r))})]})}function ki(e){const t=e.sharedConfigurationModelId&&`shared::${e.sharedConfigurationModelId}`,n=(e.componentPath??[]).join("::");return[t,n,e.localId].filter(o=>(o==null?void 0:o.length)>0).join("::")}const Fi=T.pipe(T.Str.Ord,T.Ord.contramap(e=>e.attributeId.localId));function Kn(e){const{blockingDecisions:t,desiredDecisions:n,...o}=e,i=T.pipe([...n.map(r=>({...r,intention:"add"})),...t.map(r=>({...r,intention:"remove"}))],T.RNEA.groupBy(r=>ki(r.attributeId)),T.RR.collect(T.Ord.trivial)((r,l)=>({key:r,attributeId:T.RNEA.head(l).attributeId,decisions:l})),T.RA.sort(Fi));return u.jsx("div",{...o,children:i.map(r=>u.jsx(ji,{decisions:r.decisions},r.key))})}const Bi=V.div`
|
|
109
|
+
background-color: var(--color-explain-dialog-explanation-card);
|
|
110
|
+
padding: var(--space-sm-fixed);
|
|
111
|
+
box-shadow: 2px 1px 10px -5px rgba(0, 0, 0, 0.4);
|
|
112
|
+
border-radius: var(--shape-border-radius-sm);
|
|
113
|
+
`,Wn=Bi,Mi=V(Kn)`
|
|
114
|
+
display: grid;
|
|
115
|
+
grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr);
|
|
116
|
+
gap: var(--space-sm);
|
|
117
|
+
`,Ni=V(Ln)`
|
|
118
|
+
border-radius: var(--shape-border-radius-sm);
|
|
119
|
+
background-color: var(--color-explain-dialog-apply-solution-button-fill);
|
|
120
|
+
color: var(--color-explain-dialog-apply-solution-button-color);
|
|
121
|
+
font-size: 0.9em;
|
|
122
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
123
|
+
font-weight: 600;
|
|
124
|
+
appearance: none;
|
|
125
|
+
padding: 0.6em 1em;
|
|
126
|
+
border: none;
|
|
127
|
+
width: auto;
|
|
128
|
+
margin-top: var(--space-md);
|
|
129
|
+
|
|
130
|
+
&:focus {
|
|
131
|
+
outline: 2px solid var(--color-explain-dialog-apply-solution-button-outline);
|
|
132
|
+
outline-offset: 1px;
|
|
133
|
+
}
|
|
134
|
+
`;function Li(e){const{explanation:t}=e,n=t.solution.decisions.filter(o=>o.state!=null);return u.jsxs(Wn,{children:[u.jsx(Mi,{blockingDecisions:t.causedByDecisions,desiredDecisions:n}),u.jsx(Ni,{explanation:t,children:"Apply solution"})]})}const $i=V(Wn)`
|
|
135
|
+
ul {
|
|
136
|
+
margin: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
line-height: 1.5em;
|
|
140
|
+
`,Ki=V.ul`
|
|
141
|
+
list-style-type: none;
|
|
142
|
+
margin-inline-start: 0;
|
|
143
|
+
padding-inline-start: 0;
|
|
144
|
+
`,Qt=V.ul`
|
|
145
|
+
list-style-type: disc;
|
|
146
|
+
margin-inline-start: 0;
|
|
147
|
+
padding-inline-start: var(--space-lg);
|
|
148
|
+
`,Xt=V.li`
|
|
149
|
+
font-size: 0.9em;
|
|
150
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
151
|
+
font-weight: 500;
|
|
152
|
+
`;function Wi(e){const{explanation:t}=e,n=t.causedByCardinalities,o=T.pipe(t.causedByRules,T.RNEA.groupBy(i=>i.configurationModelId),T.RR.collect(T.Str.Ord)((i,r)=>({configurationModelId:i,rules:T.pipe(r,T.RA.map(l=>l.localId),T.RA.sort(T.Str.Ord))})));return u.jsx($i,{children:u.jsxs(Ki,{children:[o.map(i=>u.jsxs("li",{children:[u.jsx("span",{children:i.configurationModelId}),u.jsx(Qt,{children:i.rules.map(r=>u.jsx(Xt,{children:r}))})]})),n.length>0&&u.jsxs("li",{children:[u.jsx("span",{children:"Cardinality"}),u.jsx(Qt,{children:n.map(i=>u.jsx(Xt,{children:i.localId}))})]})]})})}function zn(e){const{variant:t,...n}=e,{explainQuestion:o}=me(),i=B.match(o).returnType().with({question:p.ExplainQuestionType.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:p.ExplainQuestionType.whyIsNotSatisfied,subject:p.ExplainQuestionSubject.configuration},()=>"why your configuration is not satisfied").with({question:p.ExplainQuestionType.whyIsNotSatisfied,subject:p.ExplainQuestionSubject.attribute},()=>"why your attribute is not satisfied").exhaustive(),r=B.match(t).returnType().with("failedToExplain",()=>u.jsxs(u.Fragment,{children:["Failed to explain ",i,".",u.jsx("br",{}),"Please check your internet connection and try again."]})).with("noExplanationFound",()=>u.jsxs(u.Fragment,{children:["There was no explanation found for ",i,"."]})).with("noSolutionFound",()=>u.jsxs(u.Fragment,{children:["There was no solution found for ",i,"."]})).exhaustive();return u.jsx("div",{...n,children:r})}const Yt=V.div`
|
|
153
|
+
font-weight: 500;
|
|
154
|
+
font-family: var(--font-heading);
|
|
155
|
+
margin-bottom: var(--space-xs);
|
|
156
|
+
margin-left: var(--space-sm-fixed);
|
|
157
|
+
`,Gt=V.div`
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
gap: var(--space-xs);
|
|
161
|
+
`,zi=V.div`
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
gap: var(--space-md);
|
|
165
|
+
`,Jt=V(zn)`
|
|
166
|
+
width: min-content;
|
|
167
|
+
min-width: 400px;
|
|
168
|
+
margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
|
|
169
|
+
`;function qi(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=me();return n?u.jsx(Jt,{variant:"failedToExplain"}):e.length===0&&t.length===0?u.jsx(Jt,{variant:"noExplanationFound"}):u.jsxs(zi,{children:[e.length>0&&u.jsxs("div",{children:[u.jsx(Yt,{children:"Solutions"}),u.jsx(Gt,{children:e.map(o=>u.jsx(Li,{explanation:o},e.indexOf(o)))})]}),t.length>0&&u.jsxs("div",{children:[u.jsx(Yt,{children:"Constraint Explanations"}),u.jsx(Gt,{children:t.map(o=>u.jsx(Wi,{explanation:o},t.indexOf(o)))})]})]})}function ue(e){return qn(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fe(e){var t;return(t=(qn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qn(e){return e instanceof Node||e instanceof ne(e).Node}function Y(e){return e instanceof Element||e instanceof ne(e).Element}function ee(e){return e instanceof HTMLElement||e instanceof ne(e).HTMLElement}function Et(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}function We(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Hi(e){return["table","td","th"].includes(ue(e))}function kt(e){const t=Ft(),n=oe(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(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Hn(e){let t=ve(e);for(;ee(t)&&!De(t);){if(kt(t))return t;t=ve(t)}return null}function Ft(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function De(e){return["html","body","#document"].includes(ue(e))}function oe(e){return ne(e).getComputedStyle(e)}function at(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ve(e){if(ue(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||fe(e);return Et(t)?t.host:t}function _n(e){const t=ve(e);return De(t)?e.ownerDocument?e.ownerDocument.body:e.body:ee(t)&&We(t)?t:_n(t)}function pe(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=_n(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=ne(i);return r?t.concat(l,l.visualViewport||[],We(i)?i:[],l.frameElement&&n?pe(l.frameElement):[]):t.concat(i,pe(i,[],n))}function Re(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 te(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Et(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Un(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Qn(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function _i(e){return e.mozInputSource===0&&e.isTrusted?!0:Rt()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ui(e){return Xi()?!1:!Rt()&&e.width===0&&e.height===0||Rt()&&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 Qi(){return/apple/i.test(navigator.vendor)}function Rt(){const e=/android/i;return e.test(Un())||e.test(Qn())}function Xi(){return Qn().includes("jsdom/")}function Zt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Yi(e){return"nativeEvent"in e}function Gi(e){return e.matches("html,body")}function ce(e){return(e==null?void 0:e.ownerDocument)||document}function ft(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 Ie(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ji="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Xn(e){return ee(e)&&e.matches(Ji)}function pt(e){e.preventDefault(),e.stopPropagation()}function Zi(e){return e?e.getAttribute("role")==="combobox"&&Xn(e):!1}const Ve=Math.min,Ce=Math.max,Ze=Math.round,Ue=Math.floor,he=e=>({x:e,y:e}),er={left:"right",right:"left",bottom:"top",top:"bottom"},tr={start:"end",end:"start"};function It(e,t,n){return Ce(e,Ve(t,n))}function ze(e,t){return typeof e=="function"?e(t):e}function we(e){return e.split("-")[0]}function qe(e){return e.split("-")[1]}function Yn(e){return e==="x"?"y":"x"}function Bt(e){return e==="y"?"height":"width"}function ct(e){return["top","bottom"].includes(we(e))?"y":"x"}function Mt(e){return Yn(ct(e))}function nr(e,t,n){n===void 0&&(n=!1);const o=qe(e),i=Mt(e),r=Bt(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=et(l)),[l,et(l)]}function or(e){const t=et(e);return[Pt(e),t,Pt(t)]}function Pt(e){return e.replace(/start|end/g,t=>tr[t])}function ir(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function rr(e,t,n,o){const i=qe(e);let r=ir(we(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(Pt)))),r}function et(e){return e.replace(/left|right|bottom|top/g,t=>er[t])}function lr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gn(e){return typeof e!="number"?lr(e):{top:e,right:e,bottom:e,left:e}}function tt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function en(e,t,n){let{reference:o,floating:i}=e;const r=ct(t),l=Mt(t),s=Bt(l),a=we(t),c=r==="y",m=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,b=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:m,y:o.y-i.height};break;case"bottom":f={x:m,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(qe(t)){case"start":f[l]-=b*(n&&c?-1:1);break;case"end":f[l]+=b*(n&&c?-1:1);break}return f}const sr=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:d}=en(c,o,a),b=o,f={},g=0;for(let h=0;h<s.length;h++){const{name:x,fn:C}=s[h],{x:v,y:P,data:S,reset:E}=await C({x:m,y:d,initialPlacement:o,placement:b,strategy:i,middlewareData:f,rects:c,platform:l,elements:{reference:e,floating:t}});m=v??m,d=P??d,f={...f,[x]:{...f[x],...S}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(b=E.placement),E.rects&&(c=E.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:m,y:d}=en(c,b,a)),h=-1)}return{x:m,y:d,placement:b,strategy:i,middlewareData:f}};async function Jn(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:m="viewport",elementContext:d="floating",altBoundary:b=!1,padding:f=0}=ze(t,e),g=Gn(f),x=s[b?d==="floating"?"reference":"floating":d],C=tt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(x)))==null||n?x:x.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:m,strategy:a})),v=d==="floating"?{...l.floating,x:o,y:i}:l.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),S=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},E=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:P,strategy:a}):v);return{top:(C.top-E.top+g.top)/S.y,bottom:(E.bottom-C.bottom+g.bottom)/S.y,left:(C.left-E.left+g.left)/S.x,right:(E.right-C.right+g.right)/S.x}}const ar=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:a}=t,{element:c,padding:m=0}=ze(e,t)||{};if(c==null)return{};const d=Gn(m),b={x:n,y:o},f=Mt(i),g=Bt(f),h=await l.getDimensions(c),x=f==="y",C=x?"top":"left",v=x?"bottom":"right",P=x?"clientHeight":"clientWidth",S=r.reference[g]+r.reference[f]-b[f]-r.floating[g],E=b[f]-r.reference[f],w=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let I=w?w[P]:0;(!I||!await(l.isElement==null?void 0:l.isElement(w)))&&(I=s.floating[P]||r.floating[g]);const O=S/2-E/2,M=I/2-h[g]/2-1,j=Ve(d[C],M),X=Ve(d[v],M),z=j,H=I-h[g]-X,q=I/2-h[g]/2+O,k=It(z,q,H),N=!a.arrow&&qe(i)!=null&&q!==k&&r.reference[g]/2-(q<z?j:X)-h[g]/2<0,D=N?q<z?q-z:q-H:0;return{[f]:b[f]+D,data:{[f]:k,centerOffset:q-k-D,...N&&{alignmentOffset:D}},reset:N}}}),cr=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:a,elements:c}=t,{mainAxis:m=!0,crossAxis:d=!0,fallbackPlacements:b,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...x}=ze(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const C=we(i),v=we(s)===s,P=await(a.isRTL==null?void 0:a.isRTL(c.floating)),S=b||(v||!h?[et(s)]:or(s));!b&&g!=="none"&&S.push(...rr(s,h,g,P));const E=[s,...S],w=await Jn(t,x),I=[];let O=((o=r.flip)==null?void 0:o.overflows)||[];if(m&&I.push(w[C]),d){const z=nr(i,l,P);I.push(w[z[0]],w[z[1]])}if(O=[...O,{placement:i,overflows:I}],!I.every(z=>z<=0)){var M,j;const z=(((M=r.flip)==null?void 0:M.index)||0)+1,H=E[z];if(H)return{data:{index:z,overflows:O},reset:{placement:H}};let q=(j=O.filter(k=>k.overflows[0]<=0).sort((k,N)=>k.overflows[1]-N.overflows[1])[0])==null?void 0:j.placement;if(!q)switch(f){case"bestFit":{var X;const k=(X=O.map(N=>[N.placement,N.overflows.filter(D=>D>0).reduce((D,F)=>D+F,0)]).sort((N,D)=>N[1]-D[1])[0])==null?void 0:X[0];k&&(q=k);break}case"initialPlacement":q=s;break}if(i!==q)return{reset:{placement:q}}}return{}}}};async function ur(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=we(n),s=qe(n),a=ct(n)==="y",c=["left","top"].includes(l)?-1:1,m=r&&a?-1:1,d=ze(t,e);let{mainAxis:b,crossAxis:f,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof g=="number"&&(f=s==="end"?g*-1:g),a?{x:f*m,y:b*c}:{x:b*c,y:f*m}}const dr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,a=await ur(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:l}}}}},fr=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:x=>{let{x:C,y:v}=x;return{x:C,y:v}}},...a}=ze(e,t),c={x:n,y:o},m=await Jn(t,a),d=ct(we(i)),b=Yn(d);let f=c[b],g=c[d];if(r){const x=b==="y"?"top":"left",C=b==="y"?"bottom":"right",v=f+m[x],P=f-m[C];f=It(v,f,P)}if(l){const x=d==="y"?"top":"left",C=d==="y"?"bottom":"right",v=g+m[x],P=g-m[C];g=It(v,g,P)}const h=s.fn({...t,[b]:f,[d]:g});return{...h,data:{x:h.x-n,y:h.y-o}}}}};function Zn(e){const t=oe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=ee(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=Ze(n)!==r||Ze(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function Nt(e){return Y(e)?e:e.contextElement}function Oe(e){const t=Nt(e);if(!ee(t))return he(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Zn(t);let l=(r?Ze(n.width):n.width)/o,s=(r?Ze(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const pr=he(0);function eo(e){const t=ne(e);return!Ft()||!t.visualViewport?pr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ne(e)?!1:t}function Se(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=Nt(e);let l=he(1);t&&(o?Y(o)&&(l=Oe(o)):l=Oe(e));const s=hr(r,n,o)?eo(r):he(0);let a=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,m=i.width/l.x,d=i.height/l.y;if(r){const b=ne(r),f=o&&Y(o)?ne(o):o;let g=b.frameElement;for(;g&&o&&f!==b;){const h=Oe(g),x=g.getBoundingClientRect(),C=oe(g),v=x.left+(g.clientLeft+parseFloat(C.paddingLeft))*h.x,P=x.top+(g.clientTop+parseFloat(C.paddingTop))*h.y;a*=h.x,c*=h.y,m*=h.x,d*=h.y,a+=v,c+=P,g=ne(g).frameElement}}return tt({width:m,height:d,x:a,y:c})}const mr=[":popover-open",":modal"];function to(e){let t=!1,n=0,o=0;function i(r){try{t=t||e.matches(r)}catch{}}if(mr.forEach(r=>{i(r)}),t){const r=Hn(e);if(r){const l=r.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function gr(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=fe(o),[l]=t?to(t.floating):[!1];if(o===r||l)return n;let s={scrollLeft:0,scrollTop:0},a=he(1);const c=he(0),m=ee(o);if((m||!m&&i!=="fixed")&&((ue(o)!=="body"||We(r))&&(s=at(o)),ee(o))){const d=Se(o);a=Oe(o),c.x=d.x+o.clientLeft,c.y=d.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+c.x,y:n.y*a.y-s.scrollTop*a.y+c.y}}function yr(e){return Array.from(e.getClientRects())}function no(e){return Se(fe(e)).left+at(e).scrollLeft}function br(e){const t=fe(e),n=at(e),o=e.ownerDocument.body,i=Ce(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Ce(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+no(e);const s=-n.scrollTop;return oe(o).direction==="rtl"&&(l+=Ce(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function xr(e,t){const n=ne(e),o=fe(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,a=0;if(i){r=i.width,l=i.height;const c=Ft();(!c||c&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}function Cr(e,t){const n=Se(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=ee(e)?Oe(e):he(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,a=i*r.x,c=o*r.y;return{width:l,height:s,x:a,y:c}}function tn(e,t,n){let o;if(t==="viewport")o=xr(e,n);else if(t==="document")o=br(fe(e));else if(Y(t))o=Cr(t,n);else{const i=eo(e);o={...t,x:t.x-i.x,y:t.y-i.y}}return tt(o)}function oo(e,t){const n=ve(e);return n===t||!Y(n)||De(n)?!1:oe(n).position==="fixed"||oo(n,t)}function vr(e,t){const n=t.get(e);if(n)return n;let o=pe(e,[],!1).filter(s=>Y(s)&&ue(s)!=="body"),i=null;const r=oe(e).position==="fixed";let l=r?ve(e):e;for(;Y(l)&&!De(l);){const s=oe(l),a=kt(l);!a&&s.position==="fixed"&&(i=null),(r?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||We(l)&&!a&&oo(e,l))?o=o.filter(m=>m!==l):i=s,l=ve(l)}return t.set(e,o),o}function wr(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?vr(t,this._c):[].concat(n),o],s=l[0],a=l.reduce((c,m)=>{const d=tn(t,m,i);return c.top=Ce(d.top,c.top),c.right=Ve(d.right,c.right),c.bottom=Ve(d.bottom,c.bottom),c.left=Ce(d.left,c.left),c},tn(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Sr(e){const{width:t,height:n}=Zn(e);return{width:t,height:n}}function Tr(e,t,n,o){const i=ee(t),r=fe(t),l=n==="fixed",s=Se(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const c=he(0);if(i||!i&&!l)if((ue(t)!=="body"||We(r))&&(a=at(t)),i){const h=Se(t,!0,l,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else r&&(c.x=no(r));let m=s.left+a.scrollLeft-c.x,d=s.top+a.scrollTop-c.y;const[b,f,g]=to(o);return b&&(m+=f,d+=g,i&&(m+=t.clientLeft,d+=t.clientTop)),{x:m,y:d,width:s.width,height:s.height}}function nn(e,t){return!ee(e)||oe(e).position==="fixed"?null:t?t(e):e.offsetParent}function io(e,t){const n=ne(e);if(!ee(e))return n;let o=nn(e,t);for(;o&&Hi(o)&&oe(o).position==="static";)o=nn(o,t);return o&&(ue(o)==="html"||ue(o)==="body"&&oe(o).position==="static"&&!kt(o))?n:o||Hn(e)||n}const Ar=async function(e){const t=this.getOffsetParent||io,n=this.getDimensions;return{reference:Tr(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function Er(e){return oe(e).direction==="rtl"}const ro={convertOffsetParentRelativeRectToViewportRelativeRect:gr,getDocumentElement:fe,getClippingRect:wr,getOffsetParent:io,getElementRects:Ar,getClientRects:yr,getDimensions:Sr,getScale:Oe,isElement:Y,isRTL:Er};function Rr(e,t){let n=null,o;const i=fe(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),r();const{left:c,top:m,width:d,height:b}=e.getBoundingClientRect();if(s||t(),!d||!b)return;const f=Ue(m),g=Ue(i.clientWidth-(c+d)),h=Ue(i.clientHeight-(m+b)),x=Ue(c),v={rootMargin:-f+"px "+-g+"px "+-h+"px "+-x+"px",threshold:Ce(0,Ve(1,a))||1};let P=!0;function S(E){const w=E[0].intersectionRatio;if(w!==a){if(!P)return l();w?l(!1,w):o=setTimeout(()=>{l(!1,1e-7)},100)}P=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(e)}return l(!0),r}function Ir(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,c=Nt(e),m=i||r?[...c?pe(c):[],...pe(t)]:[];m.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),r&&C.addEventListener("resize",n)});const d=c&&s?Rr(c,n):null;let b=-1,f=null;l&&(f=new ResizeObserver(C=>{let[v]=C;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var P;(P=f)==null||P.observe(t)})),n()}),c&&!a&&f.observe(c),f.observe(t));let g,h=a?Se(e):null;a&&x();function x(){const C=Se(e);h&&(C.x!==h.x||C.y!==h.y||C.width!==h.width||C.height!==h.height)&&n(),h=C,g=requestAnimationFrame(x)}return n(),()=>{var C;m.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),d==null||d(),(C=f)==null||C.disconnect(),f=null,a&&cancelAnimationFrame(g)}}const Pr=fr,Or=cr,on=ar,Dr=(e,t,n)=>{const o=new Map,i={platform:ro,...n},r={...i.platform,_c:o};return sr(e,t,{...i,platform:r})},Vr=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:i}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?on({element:o.current,padding:i}).fn(n):{}:o?on({element:o,padding:i}).fn(n):{}}}};var Ye=typeof document<"u"?R.useLayoutEffect:R.useEffect;function nt(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,o,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!nt(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&e.$$typeof)&&!nt(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function lo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rn(e,t){const n=lo(e);return Math.round(t*n)/n}function ln(e){const t=A.useRef(e);return Ye(()=>{t.current=e}),t}function jr(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:l}={},transform:s=!0,whileElementsMounted:a,open:c}=e,[m,d]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,f]=A.useState(o);nt(b,o)||f(o);const[g,h]=A.useState(null),[x,C]=A.useState(null),v=A.useCallback(D=>{D!==w.current&&(w.current=D,h(D))},[]),P=A.useCallback(D=>{D!==I.current&&(I.current=D,C(D))},[]),S=r||g,E=l||x,w=A.useRef(null),I=A.useRef(null),O=A.useRef(m),M=a!=null,j=ln(a),X=ln(i),z=A.useCallback(()=>{if(!w.current||!I.current)return;const D={placement:t,strategy:n,middleware:b};X.current&&(D.platform=X.current),Dr(w.current,I.current,D).then(F=>{const J={...F,isPositioned:!0};H.current&&!nt(O.current,J)&&(O.current=J,pi.flushSync(()=>{d(J)}))})},[b,t,n,X]);Ye(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(D=>({...D,isPositioned:!1})))},[c]);const H=A.useRef(!1);Ye(()=>(H.current=!0,()=>{H.current=!1}),[]),Ye(()=>{if(S&&(w.current=S),E&&(I.current=E),S&&E){if(j.current)return j.current(S,E,z);z()}},[S,E,z,j,M]);const q=A.useMemo(()=>({reference:w,floating:I,setReference:v,setFloating:P}),[v,P]),k=A.useMemo(()=>({reference:S,floating:E}),[S,E]),N=A.useMemo(()=>{const D={position:n,left:0,top:0};if(!k.floating)return D;const F=rn(k.floating,m.x),J=rn(k.floating,m.y);return s?{...D,transform:"translate("+F+"px, "+J+"px)",...lo(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:J}},[n,s,k.floating,m.x,m.y]);return A.useMemo(()=>({...m,update:z,refs:q,elements:k,floatingStyles:N}),[m,z,q,k,N])}/*!
|
|
170
|
+
* tabbable 6.2.0
|
|
171
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
172
|
+
*/var kr=["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])"],Ot=kr.join(","),so=typeof Element>"u",$e=so?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ot=!so&&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},it=function e(t,n){var o;n===void 0&&(n=!0);var i=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),r=i===""||i==="true",l=r||n&&t&&e(t.parentNode);return l},Fr=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Br=function(t,n,o){if(it(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Ot));return n&&$e.call(t,Ot)&&i.unshift(t),i=i.filter(o),i},Mr=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!it(l,!1))if(l.tagName==="SLOT"){var s=l.assignedElements(),a=s.length?s:l.children,c=e(a,!0,o);o.flatten?i.push.apply(i,c):i.push({scopeParent:l,candidates:c})}else{var m=$e.call(l,Ot);m&&o.filter(l)&&(n||!t.includes(l))&&i.push(l);var d=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),b=!it(d,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(d&&b){var f=e(d===!0?l.children:d.children,!0,o);o.flatten?i.push.apply(i,f):i.push({scopeParent:l,candidates:f})}else r.unshift.apply(r,l.children)}}return i},ao=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},co=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Fr(t))&&!ao(t)?0:t.tabIndex},Nr=function(t,n){var o=co(t);return o<0&&n&&!ao(t)?0:o},Lr=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},uo=function(t){return t.tagName==="INPUT"},$r=function(t){return uo(t)&&t.type==="hidden"},Kr=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Wr=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},zr=function(t){if(!t.name)return!0;var n=t.form||ot(t),o=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=o(window.CSS.escape(t.name));else try{i=o(t.name)}catch(l){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",l.message),!1}var r=Wr(i,t.form);return!r||r===t},qr=function(t){return uo(t)&&t.type==="radio"},Hr=function(t){return qr(t)&&!zr(t)},_r=function(t){var n,o=t&&ot(t),i=(n=o)===null||n===void 0?void 0:n.host,r=!1;if(o&&o!==t){var l,s,a;for(r=!!((l=i)!==null&&l!==void 0&&(s=l.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!r&&i;){var c,m,d;o=ot(i),i=(c=o)===null||c===void 0?void 0:c.host,r=!!((m=i)!==null&&m!==void 0&&(d=m.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return r},sn=function(t){var n=t.getBoundingClientRect(),o=n.width,i=n.height;return o===0&&i===0},Ur=function(t,n){var o=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=$e.call(t,"details>summary:first-of-type"),l=r?t.parentElement:t;if($e.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var a=t.parentElement,c=ot(t);if(a&&!a.shadowRoot&&i(a)===!0)return sn(t);t.assignedSlot?t=t.assignedSlot:!a&&c!==t.ownerDocument?t=c.host:t=a}t=s}if(_r(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return sn(t);return!1},Qr=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var i=n.children.item(o);if(i.tagName==="LEGEND")return $e.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Xr=function(t,n){return!(n.disabled||it(n)||$r(n)||Ur(n,t)||Kr(n)||Qr(n))},an=function(t,n){return!(Hr(n)||co(n)<0||!Xr(t,n))},Yr=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Gr=function e(t){var n=[],o=[];return t.forEach(function(i,r){var l=!!i.scopeParent,s=l?i.scopeParent:i,a=Nr(s,l),c=l?e(i.candidates):s;a===0?l?n.push.apply(n,c):n.push(s):o.push({documentOrder:r,tabIndex:a,item:i,isScope:l,content:c})}),o.sort(Lr).reduce(function(i,r){return r.isScope?i.push.apply(i,r.content):i.push(r.content),i},[]).concat(n)},Lt=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Mr([t],n.includeContainer,{filter:an.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Yr}):o=Br(t,n.includeContainer,an.bind(null,n)),Gr(o)};function $t(e){return A.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Jr=A["useInsertionEffect".toString()],Zr=Jr||(e=>e());function Pe(e){const t=A.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Zr(()=>{t.current=e}),A.useCallback(function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.current==null?void 0:t.current(...o)},[])}let cn=0;function be(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(cn);const r=()=>e==null?void 0:e.focus({preventScroll:n});i?r():cn=requestAnimationFrame(r)}var ie=typeof document<"u"?R.useLayoutEffect:R.useEffect;function je(){return je=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},je.apply(this,arguments)}let ht=!1,el=0;const un=()=>"floating-ui-"+el++;function tl(){const[e,t]=A.useState(()=>ht?un():void 0);return ie(()=>{e==null&&t(un())},[]),A.useEffect(()=>{ht||(ht=!0)},[]),e}const nl=A["useId".toString()],ut=nl||tl,ol=A.forwardRef(function(t,n){let{context:{placement:o,elements:{floating:i},middlewareData:{arrow:r}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:c=0,staticOffset:m,stroke:d,d:b,style:{transform:f,...g}={},...h}=t;process.env.NODE_ENV!=="production"&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const x=ut();if(!i)return null;c*=2;const C=c/2,v=l/2*(a/-8+1),P=s/2*a/4,[S,E]=o.split("-"),w=ro.isRTL(i),I=!!b,O=S==="top"||S==="bottom",M=m&&E==="end"?"bottom":"top";let j=m&&E==="end"?"right":"left";m&&w&&(j=E==="end"?"left":"right");const X=(r==null?void 0:r.x)!=null?m||r.x:"",z=(r==null?void 0:r.y)!=null?m||r.y:"",H=b||"M0,0"+(" H"+l)+(" L"+(l-v)+","+(s-P))+(" Q"+l/2+","+s+" "+v+","+(s-P))+" Z",q={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[S];return A.createElement("svg",je({},h,{"aria-hidden":!0,ref:n,width:I?l:l+c,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[j]:X,[M]:z,[S]:O||I?"100%":"calc(100% - "+c/2+"px)",transform:""+q+(f??""),...g}}),c>0&&A.createElement("path",{clipPath:"url(#"+x+")",fill:"none",stroke:d,strokeWidth:c+(b?0:1),d:H}),A.createElement("path",{stroke:c&&!b?h.fill:"none",d:H}),A.createElement("clipPath",{id:x},A.createElement("rect",{x:-C,y:C*(I?-1:1),width:l+c,height:l})))});function il(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,((o=e.get(t))==null?void 0:o.filter(i=>i!==n))||[])}}}const rl=A.createContext(null),ll=A.createContext(null),sl=()=>{var e;return((e=A.useContext(rl))==null?void 0:e.id)||null},Kt=()=>A.useContext(ll);function Ke(e){return"data-floating-ui-"+e}function mt(e){const t=R.useRef(e);return ie(()=>{t.current=e}),t}function al(e,t){var n;let o=[],i=(n=e.find(r=>r.id===t))==null?void 0:n.parentId;for(;i;){const r=e.find(l=>l.id===i);i=r==null?void 0:r.parentId,r&&(o=o.concat(r))}return o}function Me(e,t){let n=e.filter(i=>{var r;return i.parentId===t&&((r=i.context)==null?void 0:r.open)}),o=n;for(;o.length;)o=e.filter(i=>{var r;return(r=o)==null?void 0:r.some(l=>{var s;return i.parentId===l.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(o);return n}let Ee=new WeakMap,Qe=new WeakSet,Xe={},gt=0;const cl=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,fo=e=>e&&(e.host||fo(e.parentNode)),ul=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=fo(n);return e.contains(o)?o:null}).filter(n=>n!=null);function dl(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,l=ul(t,e),s=new Set,a=new Set(l),c=[];Xe[i]||(Xe[i]=new WeakMap);const m=Xe[i];l.forEach(d),b(t),s.clear();function d(f){!f||s.has(f)||(s.add(f),f.parentNode&&d(f.parentNode))}function b(f){!f||a.has(f)||Array.prototype.forEach.call(f.children,g=>{if(s.has(g))b(g);else{const h=r?g.getAttribute(r):null,x=h!==null&&h!=="false",C=(Ee.get(g)||0)+1,v=(m.get(g)||0)+1;Ee.set(g,C),m.set(g,v),c.push(g),C===1&&x&&Qe.add(g),v===1&&g.setAttribute(i,""),!x&&r&&g.setAttribute(r,"true")}})}return gt++,()=>{c.forEach(f=>{const g=(Ee.get(f)||0)-1,h=(m.get(f)||0)-1;Ee.set(f,g),m.set(f,h),g||(!Qe.has(f)&&r&&f.removeAttribute(r),Qe.delete(f)),h||f.removeAttribute(i)}),gt--,gt||(Ee=new WeakMap,Ee=new WeakMap,Qe=new WeakSet,Xe={})}}function dn(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=ce(e[0]).body;return dl(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Wt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function po(e,t){const n=Lt(e,Wt());t==="prev"&&n.reverse();const o=n.indexOf(Re(ce(e)));return n.slice(o+1)[0]}function ho(){return po(document.body,"next")}function mo(){return po(document.body,"prev")}function Ne(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!te(n,o)}function fl(e){Lt(e,Wt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function pl(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const zt={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 hl;function fn(e){e.key==="Tab"&&(e.target,clearTimeout(hl))}const rt=A.forwardRef(function(t,n){const[o,i]=A.useState();ie(()=>(Qi()&&i("button"),document.addEventListener("keydown",fn),()=>{document.removeEventListener("keydown",fn)}),[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Ke("focus-guard")]:"",style:zt};return A.createElement("span",je({},t,r))}),go=A.createContext(null),pn=Ke("portal");function ml(e){let{id:t,root:n}=e===void 0?{}:e;const[o,i]=A.useState(null),r=ut(),l=bo(),s=A.useRef(null);return ie(()=>()=>{o==null||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),ie(()=>{if(s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(pn,""),a.appendChild(c),s.current=c,i(c)},[t,r]),ie(()=>{if(s.current)return;let a=n||(l==null?void 0:l.portalNode);a&&!Y(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const m=document.createElement("div");m.id=r,m.setAttribute(pn,""),a=c||a,a.appendChild(m),s.current=m,i(m)},[t,n,r,l]),o}function yo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const r=ml({id:n,root:o}),[l,s]=A.useState(null),a=A.useRef(null),c=A.useRef(null),m=A.useRef(null),d=A.useRef(null),b=!!l&&!l.modal&&l.open&&i&&!!(o||r);return A.useEffect(()=>{if(!r||!i||l!=null&&l.modal)return;function f(g){r&&Ne(g)&&(g.type==="focusin"?pl:fl)(r)}return r.addEventListener("focusin",f,!0),r.addEventListener("focusout",f,!0),()=>{r.removeEventListener("focusin",f,!0),r.removeEventListener("focusout",f,!0)}},[r,i,l==null?void 0:l.modal]),A.createElement(go.Provider,{value:A.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:m,afterInsideRef:d,portalNode:r,setFocusManagerState:s}),[i,r])},b&&r&&A.createElement(rt,{"data-type":"outside",ref:a,onFocus:f=>{if(Ne(f,r)){var g;(g=m.current)==null||g.focus()}else{const h=mo()||(l==null?void 0:l.refs.domReference.current);h==null||h.focus()}}}),b&&r&&A.createElement("span",{"aria-owns":r.id,style:zt}),r&&Bn.createPortal(t,r),b&&r&&A.createElement(rt,{"data-type":"outside",ref:c,onFocus:f=>{if(Ne(f,r)){var g;(g=d.current)==null||g.focus()}else{const h=ho()||(l==null?void 0:l.refs.domReference.current);h==null||h.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,f.nativeEvent))}}}))}const bo=()=>A.useContext(go),hn=20;let xe=[];function yt(e){xe=xe.filter(t=>t.isConnected),e&&ue(e)!=="body"&&(xe.push(e),xe.length>hn&&(xe=xe.slice(-hn)))}function mn(){return xe.slice().reverse().find(e=>e.isConnected)}const gl=A.forwardRef(function(t,n){return A.createElement("button",je({},t,{type:"button",ref:n,tabIndex:-1,style:zt}))});function xo(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],guards:r=!0,initialFocus:l=0,returnFocus:s=!0,modal:a=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:m=!0}=e,{open:d,refs:b,nodeId:f,onOpenChange:g,events:h,dataRef:x,elements:{domReference:C,floating:v}}=t,P=typeof l=="number"&&l<0,S=Zi(C)&&P,E=cl()?r:!0,w=mt(i),I=mt(l),O=mt(s),M=Kt(),j=bo(),X=A.useRef(null),z=A.useRef(null),H=A.useRef(!1),q=A.useRef(!1),k=j!=null,N=A.useCallback(function(K){return K===void 0&&(K=v),K?Lt(K,Wt()):[]},[v]),D=A.useCallback(K=>{const $=N(K);return w.current.map(L=>C&&L==="reference"?C:v&&L==="floating"?v:$).filter(Boolean).flat()},[C,v,w,N]);A.useEffect(()=>{if(o||!a)return;function K(L){if(L.key==="Tab"){te(v,Re(ce(v)))&&N().length===0&&!S&&pt(L);const W=D(),_=Ie(L);w.current[0]==="reference"&&_===C&&(pt(L),L.shiftKey?be(W[W.length-1]):be(W[1])),w.current[1]==="floating"&&_===v&&L.shiftKey&&(pt(L),be(W[0]))}}const $=ce(v);return $.addEventListener("keydown",K),()=>{$.removeEventListener("keydown",K)}},[o,C,v,a,w,S,N,D]),A.useEffect(()=>{if(o||!m)return;function K(){q.current=!0,setTimeout(()=>{q.current=!1})}function $(L){const W=L.relatedTarget;queueMicrotask(()=>{const _=!(te(C,W)||te(v,W)||te(W,v)||te(j==null?void 0:j.portalNode,W)||W!=null&&W.hasAttribute(Ke("focus-guard"))||M&&(Me(M.nodesRef.current,f).find(U=>{var G,le;return te((G=U.context)==null?void 0:G.elements.floating,W)||te((le=U.context)==null?void 0:le.elements.domReference,W)})||al(M.nodesRef.current,f).find(U=>{var G,le;return((G=U.context)==null?void 0:G.elements.floating)===W||((le=U.context)==null?void 0:le.elements.domReference)===W})));W&&_&&!q.current&&W!==mn()&&(H.current=!0,g(!1,L))})}if(v&&ee(C))return C.addEventListener("focusout",$),C.addEventListener("pointerdown",K),!a&&v.addEventListener("focusout",$),()=>{C.removeEventListener("focusout",$),C.removeEventListener("pointerdown",K),!a&&v.removeEventListener("focusout",$)}},[o,C,v,a,f,M,j,g,m]),A.useEffect(()=>{var K;if(o)return;const $=Array.from((j==null||(K=j.portalNode)==null?void 0:K.querySelectorAll("["+Ke("portal")+"]"))||[]);if(v){const L=[v,...$,X.current,z.current,w.current.includes("reference")||S?C:null].filter(_=>_!=null),W=a||S?dn(L,E,!E):dn(L);return()=>{W()}}},[o,C,v,a,w,j,S,E]),ie(()=>{if(o||!v)return;const K=ce(v),$=Re(K);queueMicrotask(()=>{const L=D(v),W=I.current,_=(typeof W=="number"?L[W]:W.current)||v,U=te(v,$);!P&&!U&&d&&be(_,{preventScroll:_===v})})},[o,d,v,P,D,I]),ie(()=>{if(o||!v)return;let K=!1;const $=ce(v),L=Re($),W=x.current;yt(L);function _(U){let{reason:G,event:le,nested:Be}=U;G==="escape-key"&&b.domReference.current&&yt(b.domReference.current),G==="hover"&&le.type==="mouseleave"&&(H.current=!0),G==="outside-press"&&(Be?(H.current=!1,K=!0):H.current=!(_i(le)||Ui(le)))}return h.on("openchange",_),()=>{h.off("openchange",_);const U=Re($),G=te(v,U)||M&&Me(M.nodesRef.current,f).some(ii=>{var _t;return te((_t=ii.context)==null?void 0:_t.elements.floating,U)});(G||W.openEvent&&["click","mousedown"].includes(W.openEvent.type))&&b.domReference.current&&yt(b.domReference.current);const Be=mn();O.current&&!H.current&&ee(Be)&&(!(Be!==U&&U!==$.body)||G)&&be(Be,{cancelPrevious:!1,preventScroll:K})}},[o,v,O,x,b,h,M,f]),ie(()=>{if(!(o||!j))return j.setFocusManagerState({modal:a,closeOnFocusOut:m,open:d,onOpenChange:g,refs:b}),()=>{j.setFocusManagerState(null)}},[o,j,a,d,g,b,m]),ie(()=>{if(o||!v||typeof MutationObserver!="function"||P)return;const K=()=>{const L=v.getAttribute("tabindex");w.current.includes("floating")||Re(ce(v))!==b.domReference.current&&N().length===0?L!=="0"&&v.setAttribute("tabindex","0"):L!=="-1"&&v.setAttribute("tabindex","-1")};K();const $=new MutationObserver(K);return $.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{$.disconnect()}},[o,v,b,w,N,P]);function F(K){return o||!c||!a?null:A.createElement(gl,{ref:K==="start"?X:z,onClick:$=>g(!1,$.nativeEvent)},typeof c=="string"?c:"Dismiss")}const J=!o&&E&&(k||a);return A.createElement(A.Fragment,null,J&&A.createElement(rt,{"data-type":"inside",ref:j==null?void 0:j.beforeInsideRef,onFocus:K=>{if(a){const L=D();be(i[0]==="reference"?L[0]:L[L.length-1])}else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(H.current=!1,Ne(K,j.portalNode)){const L=ho()||C;L==null||L.focus()}else{var $;($=j.beforeOutsideRef.current)==null||$.focus()}}}),!S&&F("start"),n,F("end"),J&&A.createElement(rt,{"data-type":"inside",ref:j==null?void 0:j.afterInsideRef,onFocus:K=>{if(a)be(D()[0]);else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(m&&(H.current=!0),Ne(K,j.portalNode)){const L=mo()||C;L==null||L.focus()}else{var $;($=j.afterOutsideRef.current)==null||$.focus()}}}))}const bt=new Set,Co=A.forwardRef(function(t,n){let{lockScroll:o=!1,...i}=t;const r=ut();return ie(()=>{if(!o)return;bt.add(r);const l=/iP(hone|ad|od)|iOS/.test(Un()),s=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",m=window.innerWidth-document.documentElement.clientWidth,d=s.left?parseFloat(s.left):window.pageXOffset,b=s.top?parseFloat(s.top):window.pageYOffset;if(s.overflow="hidden",m&&(s[c]=m+"px"),l){var f,g;const h=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,x=((g=window.visualViewport)==null?void 0:g.offsetTop)||0;Object.assign(s,{position:"fixed",top:-(b-Math.floor(x))+"px",left:-(d-Math.floor(h))+"px",right:"0"})}return()=>{bt.delete(r),bt.size===0&&(Object.assign(s,{overflow:"",[c]:""}),l&&(Object.assign(s,{position:"",top:"",left:"",right:""}),window.scrollTo(d,b)))}},[r,o]),A.createElement("div",je({ref:n},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))});function gn(e){return ee(e.target)&&e.target.tagName==="BUTTON"}function yn(e){return Xn(e)}function vo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:i,elements:{domReference:r}}=e,{enabled:l=!0,event:s="click",toggle:a=!0,ignoreMouse:c=!1,keyboardHandlers:m=!0}=t,d=A.useRef(),b=A.useRef(!1);return A.useMemo(()=>l?{reference:{onPointerDown(f){d.current=f.pointerType},onMouseDown(f){f.button===0&&(Zt(d.current,!0)&&c||s!=="click"&&(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?o(!1,f.nativeEvent,"click"):(f.preventDefault(),o(!0,f.nativeEvent,"click"))))},onClick(f){if(s==="mousedown"&&d.current){d.current=void 0;return}Zt(d.current,!0)&&c||(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="click")?o(!1,f.nativeEvent,"click"):o(!0,f.nativeEvent,"click"))},onKeyDown(f){d.current=void 0,!(f.defaultPrevented||!m||gn(f))&&(f.key===" "&&!yn(r)&&(f.preventDefault(),b.current=!0),f.key==="Enter"&&o(!(n&&a),f.nativeEvent,"click"))},onKeyUp(f){f.defaultPrevented||!m||gn(f)||yn(r)||f.key===" "&&b.current&&(b.current=!1,o(!(n&&a),f.nativeEvent,"click"))}}}:{},[l,i,s,c,m,r,a,n,o])}const yl={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},bl={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},bn=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 wo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,nodeId:i,elements:{reference:r,domReference:l,floating:s},dataRef:a}=e,{enabled:c=!0,escapeKey:m=!0,outsidePress:d=!0,outsidePressEvent:b="pointerdown",referencePress:f=!1,referencePressEvent:g="pointerdown",ancestorScroll:h=!1,bubbles:x,capture:C}=t,v=Kt(),P=Pe(typeof d=="function"?d:()=>!1),S=typeof d=="function"?P:d,E=A.useRef(!1),w=A.useRef(!1),{escapeKey:I,outsidePress:O}=bn(x),{escapeKey:M,outsidePress:j}=bn(C),X=Pe(k=>{if(!n||!c||!m||k.key!=="Escape")return;const N=v?Me(v.nodesRef.current,i):[];if(!I&&(k.stopPropagation(),N.length>0)){let D=!0;if(N.forEach(F=>{var J;if((J=F.context)!=null&&J.open&&!F.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}o(!1,Yi(k)?k.nativeEvent:k,"escape-key")}),z=Pe(k=>{var N;const D=()=>{var F;X(k),(F=Ie(k))==null||F.removeEventListener("keydown",D)};(N=Ie(k))==null||N.addEventListener("keydown",D)}),H=Pe(k=>{const N=E.current;E.current=!1;const D=w.current;if(w.current=!1,b==="click"&&D||N||typeof S=="function"&&!S(k))return;const F=Ie(k),J="["+Ke("inert")+"]",K=ce(s).querySelectorAll(J);let $=Y(F)?F:null;for(;$&&!De($);){const _=ve($);if(De(_)||!Y(_))break;$=_}if(K.length&&Y(F)&&!Gi(F)&&!te(F,s)&&Array.from(K).every(_=>!te($,_)))return;if(ee(F)&&s){const _=F.clientWidth>0&&F.scrollWidth>F.clientWidth,U=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let G=U&&k.offsetX>F.clientWidth;if(U&&oe(F).direction==="rtl"&&(G=k.offsetX<=F.offsetWidth-F.clientWidth),G||_&&k.offsetY>F.clientHeight)return}const L=v&&Me(v.nodesRef.current,i).some(_=>{var U;return ft(k,(U=_.context)==null?void 0:U.elements.floating)});if(ft(k,s)||ft(k,l)||L)return;const W=v?Me(v.nodesRef.current,i):[];if(W.length>0){let _=!0;if(W.forEach(U=>{var G;if((G=U.context)!=null&&G.open&&!U.context.dataRef.current.__outsidePressBubbles){_=!1;return}}),!_)return}o(!1,k,"outside-press")}),q=Pe(k=>{var N;const D=()=>{var F;H(k),(F=Ie(k))==null||F.removeEventListener(b,D)};(N=Ie(k))==null||N.addEventListener(b,D)});return A.useEffect(()=>{if(!n||!c)return;a.current.__escapeKeyBubbles=I,a.current.__outsidePressBubbles=O;function k(F){o(!1,F,"ancestor-scroll")}const N=ce(s);m&&N.addEventListener("keydown",M?z:X,M),S&&N.addEventListener(b,j?q:H,j);let D=[];return h&&(Y(l)&&(D=pe(l)),Y(s)&&(D=D.concat(pe(s))),!Y(r)&&r&&r.contextElement&&(D=D.concat(pe(r.contextElement)))),D=D.filter(F=>{var J;return F!==((J=N.defaultView)==null?void 0:J.visualViewport)}),D.forEach(F=>{F.addEventListener("scroll",k,{passive:!0})}),()=>{m&&N.removeEventListener("keydown",M?z:X,M),S&&N.removeEventListener(b,j?q:H,j),D.forEach(F=>{F.removeEventListener("scroll",k)})}},[a,s,l,r,m,S,b,n,o,h,c,I,O,X,M,z,H,j,q]),A.useEffect(()=>{E.current=!1},[S,b]),A.useMemo(()=>c?{reference:{onKeyDown:X,[yl[g]]:k=>{f&&o(!1,k.nativeEvent,"reference-press")}},floating:{onKeyDown:X,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[bl[b]]:()=>{E.current=!0}}}:{},[c,f,b,g,o,X])}let Dt;process.env.NODE_ENV!=="production"&&(Dt=new Set);function So(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var r;const O="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((r=e.elements)!=null&&r.reference&&!Y(e.elements.reference)){var l;if(!((l=Dt)!=null&&l.has(O))){var s;(s=Dt)==null||s.add(O),console.error(O)}}}const[a,c]=A.useState(null),m=((t=e.elements)==null?void 0:t.reference)||a,d=jr(e),b=Kt(),f=sl()!=null,g=Pe((O,M,j)=>{O&&(x.current.openEvent=M),C.emit("openchange",{open:O,event:M,reason:j,nested:f}),o==null||o(O,M,j)}),h=A.useRef(null),x=A.useRef({}),C=A.useState(()=>il())[0],v=ut(),P=A.useCallback(O=>{const M=Y(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),contextElement:O}:O;d.refs.setReference(M)},[d.refs]),S=A.useCallback(O=>{(Y(O)||O===null)&&(h.current=O,c(O)),(Y(d.refs.reference.current)||d.refs.reference.current===null||O!==null&&!Y(O))&&d.refs.setReference(O)},[d.refs]),E=A.useMemo(()=>({...d.refs,setReference:S,setPositionReference:P,domReference:h}),[d.refs,S,P]),w=A.useMemo(()=>({...d.elements,domReference:m}),[d.elements,m]),I=A.useMemo(()=>({...d,refs:E,elements:w,dataRef:x,nodeId:i,floatingId:v,events:C,open:n,onOpenChange:g}),[d,i,v,C,n,g,E,w]);return ie(()=>{const O=b==null?void 0:b.nodesRef.current.find(M=>M.id===i);O&&(O.context=I)}),A.useMemo(()=>({...d,context:I,refs:E,elements:w}),[d,E,w,I])}const xn="active",Cn="selected";function xt(e,t,n){const o=new Map,i=n==="item";let r=e;if(i&&e){const{[xn]:l,[Cn]:s,...a}=e;r=a}return{...n==="floating"&&{tabIndex:-1},...r,...t.map(l=>{const s=l?l[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((l,s)=>(s&&Object.entries(s).forEach(a=>{let[c,m]=a;if(!(i&&[xn,Cn].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof m=="function"){var d;(d=o.get(c))==null||d.push(m),l[c]=function(){for(var b,f=arguments.length,g=new Array(f),h=0;h<f;h++)g[h]=arguments[h];return(b=o.get(c))==null?void 0:b.map(x=>x(...g)).find(x=>x!==void 0)}}}else l[c]=m}),l),{})}}function To(e){e===void 0&&(e=[]);const t=e,n=A.useCallback(r=>xt(r,e,"reference"),t),o=A.useCallback(r=>xt(r,e,"floating"),t),i=A.useCallback(r=>xt(r,e,"item"),e.map(r=>r==null?void 0:r.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i}),[n,o,i])}function xl(e={}){const{initialOpen:t=!1,open:n,onOpenChange:o}=e,[i,r]=A.useState(t),l=n??i,s=o??r,a=So({open:l,onOpenChange:s}),c=a.context,m=vo(c,{enabled:n==null}),d=wo(c,{outsidePressEvent:"mousedown"}),b=To([m,d]);return A.useMemo(()=>({open:l,setOpen:s,...b,...a}),[l,s,b,a])}const Ao=A.createContext(null),Eo=()=>{const e=A.useContext(Ao);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function Cl({children:e,...t}){const n=xl(t);return u.jsx(Ao.Provider,{value:n,children:e})}const Ro=V.css`
|
|
173
|
+
display: flex;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
align-items: center;
|
|
176
|
+
z-index: 100;
|
|
177
|
+
padding: var(--space-md-fixed);
|
|
178
|
+
`,vl=V(Co)`
|
|
179
|
+
${Ro};
|
|
180
|
+
`,wl=R.forwardRef((e,t)=>{const{style:n,children:o,components:i,...r}=e,l=Eo(),s=$t([l.refs.setFloating,t]),a=(i==null?void 0:i.Overlay)??vl;return u.jsx(yo,{children:u.jsx(a,{lockScroll:!0,children:u.jsx(xo,{context:l.context,children:u.jsx("div",{ref:s,...l.getFloatingProps(r),children:o})})})})}),Sl=wl;function Io(e){const t=R.useContext(Le),[n,o]=R.useState(t);return u.jsx(Le.Provider,{value:n,children:e.children})}const Tl=R.forwardRef((e,t)=>{const{setOpen:n}=Eo();return u.jsx("button",{type:"button",...e,ref:t,onClick:o=>{var i;(i=e.onClick)==null||i.call(e,o),n(!1)}})}),Al=Tl,El=V.span`
|
|
181
|
+
color: var(--color-explain-header-value-color);
|
|
182
|
+
overflow: hidden;
|
|
183
|
+
white-space: nowrap;
|
|
184
|
+
text-overflow: ellipsis;
|
|
185
|
+
`;function Po(e){const{explainQuestion:t}=me();if(!t)return u.jsx("div",{...e,children:"Conflict"});const n=B.match(t).returnType().with({subject:p.ExplainQuestionSubject.configuration},()=>"Configuration").with({subject:p.ExplainQuestionSubject.attribute},i=>i.attributeId.localId).with({subject:p.ExplainQuestionSubject.choiceValue},i=>i.choiceValueId).with({subject:p.ExplainQuestionSubject.component},i=>i.state.toString()).with({subject:p.ExplainQuestionSubject.boolean},i=>i.state.toString()).with({subject:p.ExplainQuestionSubject.numeric},i=>i.state.toString()).exhaustive(),o=B.match(t).returnType().with({question:p.ExplainQuestionType.whyIsStateNotPossible},()=>"is blocked").with({question:p.ExplainQuestionType.whyIsNotSatisfied},()=>"is not satisfied").exhaustive();return u.jsxs("div",{...e,children:[u.jsx(El,{children:n})," ",o]})}const Rl=V.div`
|
|
186
|
+
position: sticky;
|
|
187
|
+
top: 0;
|
|
188
|
+
transition: all 0.1s;
|
|
189
|
+
border-top: 1px solid transparent;
|
|
190
|
+
|
|
191
|
+
&.active {
|
|
192
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
|
193
|
+
border-color: var(--color-explain-dialog-scroll-shadow-border);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
@media only screen and (min-resolution: 2dppx) {
|
|
197
|
+
border-top-width: 0.5px;
|
|
198
|
+
}
|
|
199
|
+
`;function Il(e){const[t,n]=R.useState(!1),o=R.useRef(null);return R.useEffect(()=>{const i=new IntersectionObserver(([l])=>n(!l.isIntersecting),{root:null,threshold:1}),r=o.current;return r&&i.observe(r),()=>{r&&i.unobserve(r)}},[]),u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:o}),u.jsx(Rl,{...Mn(e,{className:li(t&&"active")})})]})}const Pl=V(y.motion.div)`
|
|
200
|
+
position: relative;
|
|
201
|
+
background-color: var(--color-explain-dialog-fill);
|
|
202
|
+
backdrop-filter: var(--backdrop-filter-explain-dialog);
|
|
203
|
+
color: var(--color-explain-dialog-color);
|
|
204
|
+
outline-offset: -1px;
|
|
205
|
+
padding-top: 1.1em;
|
|
206
|
+
border-radius: var(--shape-border-radius-md);
|
|
207
|
+
box-shadow: var(--shadows-dialog);
|
|
208
|
+
font-size: var(--text-base-size);
|
|
209
|
+
font-family: var(--font-primary);
|
|
210
|
+
display: grid;
|
|
211
|
+
grid-template-rows: [header] auto [content] auto;
|
|
212
|
+
grid-template-columns: [header content] 1fr;
|
|
213
|
+
align-content: start;
|
|
214
|
+
min-height: min(calc(100vh - var(--space-md) * 2), 350px);
|
|
215
|
+
max-height: min(calc(100vh - var(--space-md) * 2), 700px);
|
|
216
|
+
max-width: min(calc(100vw - var(--space-md) * 2), 700px);
|
|
217
|
+
min-width: min(calc(100vw - var(--space-md) * 2), 500px);
|
|
218
|
+
`,Ol=V.div`
|
|
219
|
+
overflow-y: auto;
|
|
220
|
+
grid-area: content;
|
|
221
|
+
padding-left: var(--space-xs-fixed);
|
|
222
|
+
padding-right: var(--space-xs-fixed);
|
|
223
|
+
padding-bottom: var(--space-xs-fixed);
|
|
224
|
+
`,Dl=V(Il)`
|
|
225
|
+
margin-left: calc(var(--space-xs-fixed) * -1);
|
|
226
|
+
margin-right: calc(var(--space-xs-fixed) * -1);
|
|
227
|
+
`,Vl=V(Al)`
|
|
228
|
+
position: absolute;
|
|
229
|
+
right: var(--space-sm-fixed);
|
|
230
|
+
top: var(--space-sm-fixed);
|
|
231
|
+
border: none;
|
|
232
|
+
background-color: transparent;
|
|
233
|
+
color: inherit;
|
|
234
|
+
font-size: var(--text-sm);
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
border-radius: var(--shape-border-radius-xs);
|
|
237
|
+
|
|
238
|
+
&:focus {
|
|
239
|
+
outline: 2px solid var(--color-explain-dialog-close-button-outline);
|
|
240
|
+
outline-offset: 1px;
|
|
241
|
+
}
|
|
242
|
+
`,jl=V(Po)`
|
|
243
|
+
grid-area: header;
|
|
244
|
+
font-size: var(--text-md);
|
|
245
|
+
font-weight: 500;
|
|
246
|
+
font-family: var(--font-heading);
|
|
247
|
+
margin-bottom: var(--space-xs);
|
|
248
|
+
overflow: hidden;
|
|
249
|
+
display: flex;
|
|
250
|
+
white-space: nowrap;
|
|
251
|
+
text-overflow: ellipsis;
|
|
252
|
+
margin-right: var(--space-md);
|
|
253
|
+
margin-left: calc(var(--space-xs-fixed) + var(--space-sm-fixed));
|
|
254
|
+
`,kl={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 Fl(e){return u.jsxs(Pl,{variants:kl,initial:"initial",animate:"open",exit:"close",children:[u.jsx(jl,{}),u.jsxs(Ol,{children:[u.jsx(Dl,{}),e.children]}),u.jsx(Vl,{children:u.jsx(Je.FontAwesomeIcon,{icon:Ge.faXmark})})]})}const Bl=V(Sl)`
|
|
255
|
+
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
256
|
+
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
257
|
+
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
258
|
+
--color-explain-attribute-value-remove-fill: ${e=>e.attributeValueRemoveFill};
|
|
259
|
+
--color-explain-attribute-value-remove-color: ${e=>e.attributeValueRemoveColor};
|
|
260
|
+
--color-explain-header-value-color: ${e=>e.headerValueColor};
|
|
261
|
+
--color-explain-dialog-fill: ${e=>e.fill};
|
|
262
|
+
--color-explain-dialog-color: ${e=>e.color};
|
|
263
|
+
--color-explain-dialog-close-button-outline: ${e=>e.closeButtonOutline};
|
|
264
|
+
--color-explain-dialog-apply-solution-button-fill: ${e=>e.applySolutionButtonFill};
|
|
265
|
+
--color-explain-dialog-apply-solution-button-color: ${e=>e.applySolutionButtonColor};
|
|
266
|
+
--color-explain-dialog-apply-solution-button-outline: ${e=>e.applySolutionButtonOutline};
|
|
267
|
+
--color-explain-dialog-explanation-card: ${e=>e.explanationCard};
|
|
268
|
+
--color-explain-dialog-scroll-shadow-border: ${e=>e.scrollShadowBorder};
|
|
269
|
+
--backdrop-filter-explain-dialog: ${e=>e.backdropFilter};
|
|
270
|
+
|
|
271
|
+
display: grid;
|
|
272
|
+
|
|
273
|
+
&:focus {
|
|
274
|
+
outline: none;
|
|
275
|
+
}
|
|
276
|
+
`;function Ml(e){const t=me(),n=(t==null?void 0:t.displayMode)==="dialog";return u.jsx(Cl,{open:n,onOpenChange:o=>!o&&n&&(t==null?void 0:t.dismiss()),children:u.jsx(Nl,{...e,isOpen:n,children:R.Children.toArray(e.content)[0]??u.jsx(Fl,{children:u.jsx(qi,{})})})})}function Nl(e){return u.jsx(y.AnimatePresence,{initial:!1,children:e.isOpen&&u.jsx(Bl,{...e,components:{Overlay:$l},children:u.jsx(Io,{children:e.children})})})}const Ll=V(y.motion(Co))`
|
|
277
|
+
${Ro}
|
|
278
|
+
`;function $l(e){return u.jsx(Ll,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}const Kl={fill:{title:"Fill",type:y.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:y.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:y.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:y.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:y.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:y.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:y.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:y.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:y.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:y.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:y.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:y.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:y.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:y.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:y.ControlType.String,defaultValue:"blur(10px) saturate(200%)"}},Wl={fill:{title:"Fill",type:y.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:y.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:y.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:y.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:y.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:y.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:y.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:y.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:y.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:y.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:y.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:y.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:y.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:y.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"}},Oo=R.createContext(null);function zl(e){const[t,n]=R.useState(null),{explain:o,applySolution:i}=Q.useExplain(),r=R.useRef(null),l=R.useCallback(async(f,g,h,x)=>{const C=si.guid();r.current=C,n(null);try{const v=await f(),P=v,S=v,E=(P==null?void 0:P.decisionExplanations)??[],w=(S==null?void 0:S.constraintExplanations)??[];C==r.current&&n({controlId:x,displayMode:E.length===0&&w.length>0?"dialog":h,explainQuestion:g,hasError:!1,decisionExplanations:ql(E),constraintExplanations:w})}catch{C==r.current&&n({controlId:x,displayMode:h,explainQuestion:g,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=R.useCallback((f,g,h)=>{const x=typeof f=="function"?f(p.explainQuestionBuilder):f;return l(()=>e.explainConstraints?o(x,"full"):o(x,"decisions"),x,g,h)},[e.explainConstraints,o,l]),a=R.useCallback((f,g,h)=>l(()=>Promise.resolve(f),null,g,h),[l]),c=R.useCallback(()=>{n(null)},[]),m=R.useCallback(async f=>{await i(f),c()},[i,c]),d=R.useCallback(f=>{n(g=>g!=null?{...g,displayMode:f}:g)},[]),b=R.useMemo(()=>({process:t,applySolution:m,explain:s,handleExplainAnswer:a,dismiss:c,switchMode:d}),[t,m,s,a,c,d]);return u.jsx(Le.Provider,{value:b,children:e.children})}function ql(e){const t=T.pipe(T.Bool.Ord,T.Ord.contramap(o=>o.solution==null)),n=T.pipe(T.Num.Ord,T.Ord.contramap(o=>o.causedByDecisions.length));return T.pipe(e,T.RA.sortBy([t,n]))}const ke=new Map;function lt(e){const{singletonId:t,children:n}=e,[o,i]=R.useState(!1),r=R.useRef({chose:()=>i(!0)});return R.useEffect(()=>(Hl(t,r.current),()=>_l(t,r.current)),[]),o?u.jsx(u.Fragment,{children:n}):null}function Hl(e,t){Ql(e).candidates.add(t),Do(e)}function _l(e,t){let n=ke.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),Ul(e),Do(e))}function Do(e){let t=ke.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function Ul(e){let t=ke.get(e);t==null||t.candidates.size>0||ke.delete(e)}function Ql(e){let t=ke.get(e);return t==null&&(t={chosen:null,candidates:new Set},ke.set(e,t)),t}const de={attributeId:{title:"Attribute Id",type:y.ControlType.String},componentPath:{title:"Component Path",type:y.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:y.ControlType.String}},vn={description:{title:"Description",type:y.ControlType.String},regex:{title:"Regex",type:y.ControlType.String},direction:{title:"Direction",type:y.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:y.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},Xl={choiceValueSorting:{title:"Choice Value Sorting",type:y.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:y.ControlType.Array,control:{type:y.ControlType.Object,controls:vn}},attributes:{title:"Attribute",type:y.ControlType.Array,control:{type:y.ControlType.Object,controls:{...de,choiceValues:{title:"Choice Values",type:y.ControlType.Array,control:{type:y.ControlType.String}},rules:{title:"Rules",type:y.ControlType.Array,control:{type:y.ControlType.Object,controls:vn}}}}},jsonDefinition:{title:"Definition – JSON",type:y.ControlType.String,displayTextArea:!0}}}};function Yl(e,t){const n=[],o=(r,l)=>{const s=n.find(c=>e.equals(c.first,r)&&e.equals(c.second,l));if(s)return s.ordering;const a=t.compare(r,l);return n.push({first:r,second:l,ordering:a}),a},i=T.Ord.fromCompare(o);return{cachedOrderings:n,...i}}function Gl(){const e=[];return{getCache:(t,n)=>{const o=e.find(r=>r.eq===t&&r.ord===n);if(o)return o.ordCache;const i=Yl(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}function re(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}const Vo=T.Ord.getMonoid(),Jl=new Intl.Collator("en",{sensitivity:"base"}),Zl=new Intl.Collator("en",{sensitivity:"variant"}),es={regex:".*",direction:"asc",mode:"string"},ts=T.pipe([Jl,Zl],T.RA.map(cs),T.MO.concatAll(T.Ord.getMonoid())),ns=T.pipe(T.Bool.Ord,T.Ord.contramap(e=>T.O.isSome(e))),os=T.Num.Ord;function is(e,t){return T.pipe((t==null?void 0:t.attributes)??[],T.RA.findFirst(n=>p.globalAttributeIdEquals(re(n),e)),T.O.map(n=>[rs(n.choiceValues??[]),wn(n.rules??[])]),T.O.getOrElse(()=>[wn((t==null?void 0:t.defaultRules)??[])]),T.RA.append(jo(es)),T.MO.concatAll(Vo))}function rs(e){return T.pipe(T.Num.Ord,T.Ord.reverse,T.O.getOrd,T.Ord.reverse,T.Ord.contramap(t=>T.pipe(e,T.RA.findIndex(n=>T.Str.Eq.equals(t,n)))))}function wn(e){return T.pipe(e,T.RA.map(jo),T.MO.concatAll(Vo))}function jo(e){const t=T.O.tryCatch(()=>new RegExp(e.regex)),n=B.match(e.mode).returnType().with("string",()=>ls(e.direction)).with("numeric",()=>ss(e.direction)).with("isMatch",()=>as(e.direction)).exhaustive();return T.pipe(n,T.Ord.contramap(o=>T.pipe(t,T.O.chainNullableK(i=>(i.lastIndex=0,i[Symbol.match](o))),T.O.chain(i=>T.pipe(i,T.RA.lookup(1),T.O.alt(()=>T.pipe(i,T.RA.lookup(0))))))))}function ls(e){return T.pipe(ts,qt(e),ko)}function ss(e){return T.pipe(os,qt(e),ko,T.Ord.contramap(T.O.chain(T.Num.parseFloatO)))}function as(e){return T.pipe(ns,qt(e))}function ko(e){return T.pipe(e,T.Ord.reverse,T.O.getOrd,T.Ord.reverse)}function qt(e){return t=>B.match(e).returnType().with("asc",()=>t).with("desc",()=>T.Ord.reverse(t)).exhaustive()}function cs(e){return T.Ord.fromCompare((t,n)=>B.match(e.compare(t,n)).returnType().with(B.P.number.gt(0),()=>1).with(B.P.number.lt(0),()=>-1).otherwise(()=>0))}const us=Gl(),Fo=R.createContext(null);function st(e,t){const n=R.useContext(Fo),o=R.useMemo(()=>T.pipe(is(e,n),r=>us.getCache(T.Str.Eq,r),T.Ord.contramap(r=>r.id)),[]),{attribute:i}=Q.useChoiceAttribute(e);return T.pipe(t??(i==null?void 0:i.values)??[],T.RA.sort(o))}const Bo=Te(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:o,sessionCreateUrl:i,sessionDeleteUrl:r,deploymentName:l,channel:s,children:a,explainDialogProps:c,explainPopoverProps:m,explainConstraints:d}=e;if(Z())return u.jsxs(u.Fragment,{children:[a,u.jsx(lt,{singletonId:"Configuration",children:u.jsx(Ut,{})})]});const f=R.useMemo(()=>p.createClient({hcaEngineBaseUrl:mi(t,"api","engine"),sessionHandler:B.match(n).with("client-side",()=>({accessToken:o})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:r})).exhaustive()}),[t,n,o,i,r]),g=R.useMemo(()=>{var x;return T.pipe(T.O.fromNullable((x=e.attributeRelations)==null?void 0:x.jsonDefinition),T.O.filter(C=>C.length>0),T.O.map(C=>JSON.parse(C)),T.O.toNullable)},[e.attributeRelations]),h=R.useMemo(()=>{var x;return T.pipe(T.O.fromNullable((x=e.choiceValueSorting)==null?void 0:x.jsonDefinition),T.O.filter(C=>C.length>0),T.O.map(C=>JSON.parse(C)),T.O.orElse(()=>T.O.fromNullable(e.choiceValueSorting)),T.O.getOrElse(()=>({attributes:[],defaultRules:[]})))},[e.choiceValueSorting]);return u.jsxs(u.Fragment,{children:[u.jsxs(Q.Configuration,{configuratorClient:f,configurationModelSource:{type:p.ConfigurationModelSourceType.Channel,channel:s,deploymentName:l},attributeRelations:g,allowedInExplain:{rules:{type:p.AllowedRulesInExplainType.all}},children:[u.jsx(gi,{...e}),u.jsx(R.Suspense,{children:u.jsx(Q.ConfigurationSuspender,{children:u.jsxs(zl,{explainConstraints:d,children:[u.jsx(Oo.Provider,{value:m,children:u.jsx(Fo.Provider,{value:h,children:a})}),u.jsx(Ml,{...c})]})})})]}),u.jsx(lt,{singletonId:"Configuration",children:u.jsx(Ut,{})})]})}),ds=Bo;y.addPropertyControls(Bo,{children:{title:"Content",type:y.ControlType.ComponentInstance},channel:{type:y.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:y.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:y.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:y.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:y.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:y.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:y.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:y.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:y.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:y.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:y.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:y.ControlType.Object,optional:!1,controls:Kl,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:y.ControlType.Object,optional:!1,controls:Wl,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:y.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:y.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:y.ControlType.String,displayTextArea:!0}}},...Xl});const Mo={padding:{type:y.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}},fs=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}),ps={radius:{title:"Radius",type:y.ControlType.Number,defaultValue:6},...Mo,border:{title:"Border",type:y.ControlType.Object,controls:{color:{type:y.ControlType.Color,title:"Color"},width:{type:y.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}}}},hs=e=>{var t,n,o,i,r,l,s,a,c,m,d,b,f;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(o=e.border)==null?void 0:o.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(r=e.border)!=null&&r.isMixedWidth?(l=e.border)==null?void 0:l.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(a=e.border)!=null&&a.isMixedWidth?(c=e.border)==null?void 0:c.widthBottom:(m=e.border)==null?void 0:m.width,borderLeftWidth:(d=e.border)!=null&&d.isMixedWidth?(b=e.border)==null?void 0:b.widthLeft:(f=e.border)==null?void 0:f.width}},ms={fill:{title:"Fill",type:y.ControlType.Color,defaultValue:"#EBEBEB"},...Mo,...ps},gs=e=>({...fs(e),...hs(e),backgroundColor:e.fill}),ys={color:{title:"Color",type:y.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:y.ControlType.Number,defaultValue:16}},bs=e=>({color:e.color,fontSize:e.fontSize}),He={explain:{title:"Explain",type:y.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},Vt={type:y.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:y.ControlType.Color,optional:!0},color:{title:"Color",type:y.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:y.ControlType.Color,optional:!0}}},No={...de,...ys,...ms,implicitLabelPrefix:{title:"Implicit Label Prefix",type:y.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...Vt,title:"Unsatisfied Colors"},implicitSelectedColors:{...Vt,title:"Implicit Selected Colors"},...He},jt=(e,t,n)=>{var r,l,s,a,c,m;const o=gs(e),i=bs(e);return{...o,...i,backgroundColor:B.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(r=e.unsatisfiedColors)==null?void 0:r.fill,implicitSelectedFill:(l=e.implicitSelectedColors)==null?void 0:l.fill}).with({isSatisfied:!1,unsatisfiedFill:B.P.string.minLength(1)},d=>d.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:B.P.string.minLength(1)},d=>d.implicitSelectedFill).otherwise(()=>o.backgroundColor),borderColor:B.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(s=e.unsatisfiedColors)==null?void 0:s.borderColor,implicitSelectedBorderColor:(a=e.implicitSelectedColors)==null?void 0:a.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:B.P.string.minLength(1)},d=>d.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:B.P.string.minLength(1)},d=>d.implicitSelectedBorderColor).otherwise(()=>o.borderColor),color:B.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(c=e.unsatisfiedColors)==null?void 0:c.color,implicitSelectedColor:(m=e.implicitSelectedColors)==null?void 0:m.color}).with({isSatisfied:!1,unsatisfiedColor:B.P.string.minLength(1)},d=>d.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:B.P.string.minLength(1)},d=>d.implicitSelectedColor).otherwise(()=>i.color),...e.style}},Ht={...No,resetLabel:{title:"Reset Label",type:y.ControlType.String,defaultValue:"Reset"},appearance:{title:"Appearance",type:y.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]},textAlign:{title:"Text Align",type:y.ControlType.Enum,defaultValue:"initial",options:["initial","start","center","end"]}},Fe=(e,t,n)=>({...jt(e,t,n),appearance:e.appearance,textAlign:e.textAlign});function ge(){const{explain:e,handleExplainAnswer:t}=R.useContext(Le);return{explain:e,handleExplainAnswer:t}}function xs(e={}){const{initialOpen:t=!1,placement:n="top",modal:o=!1,open:i,onOpenChange:r,arrow:l}=e,[s,a]=R.useState(t),c=i??s,m=r??a,d=So({placement:n,open:c,onOpenChange:m,whileElementsMounted:Ir,middleware:[dr(((l==null?void 0:l.height)??0)+5),Or({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),Pr({padding:5}),...l?[Vr(l)]:[]]}),b=d.context,f=vo(b,{enabled:i==null}),g=wo(b),h=To([f,g]);return R.useMemo(()=>({open:c,setOpen:m,...h,...d,modal:o,arrow:l}),[c,m,h,d,o,l])}const Lo=R.createContext(null),_e=()=>{const e=R.useContext(Lo);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function Cs({children:e,...t}){const n=xs(t);return u.jsx(Lo.Provider,{value:n,children:e})}const vs=R.forwardRef(function(t,n){const o=R.Children.toArray(t.children)[0],i=_e(),r=t.children.ref,l=$t([i.refs.setReference,n,r]);return R.isValidElement(o)?R.cloneElement(o,i.getReferenceProps({ref:l,...t,...o.props,"data-state":i.open?"open":"closed"})):u.jsx("span",{children:"Not valid children for PopoverTrigger"})}),ws=vs,Ss=V.div`
|
|
279
|
+
display: flex;
|
|
280
|
+
justify-content: center;
|
|
281
|
+
|
|
282
|
+
// The Webstorm formatter doesn't support container queries and would be break it.
|
|
283
|
+
// @formatter:off
|
|
284
|
+
@container explain-actions (min-width: 300px) {
|
|
285
|
+
justify-content: start;
|
|
286
|
+
}
|
|
287
|
+
`,Ts=V.button`
|
|
288
|
+
color: inherit;
|
|
289
|
+
font-size: 0.9em;
|
|
290
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
291
|
+
font-weight: 500;
|
|
292
|
+
appearance: none;
|
|
293
|
+
border: none;
|
|
294
|
+
border-radius: var(--shape-border-radius-xs);
|
|
295
|
+
margin-top: 0.9em;
|
|
296
|
+
text-decoration: underline;
|
|
297
|
+
cursor: pointer;
|
|
298
|
+
background-color: transparent;
|
|
299
|
+
|
|
300
|
+
&:focus {
|
|
301
|
+
outline: 2px solid var(--color-explain-popover-show-more-button-outline);
|
|
302
|
+
outline-offset: 1px;
|
|
303
|
+
}
|
|
304
|
+
`;function As(){const{decisionExplanations:e,switchMode:t}=me(),n=e.length-1;return u.jsx(Ss,{children:u.jsxs(Ts,{onClick:()=>t("dialog"),children:[n>0&&u.jsxs("span",{children:["Show more (",n,")"]}),n===0&&u.jsx("span",{children:"Show Constraints"})]})})}const Es=V.div`
|
|
305
|
+
font-weight: 500;
|
|
306
|
+
font-family: var(--font-heading);
|
|
307
|
+
margin-bottom: var(--space-xs);
|
|
308
|
+
`,Sn=V.div`
|
|
309
|
+
height: 1px;
|
|
310
|
+
background-color: var(--color-explain-popover-list-separator);
|
|
311
|
+
margin-left: -1.1em;
|
|
312
|
+
margin-right: -1.1em;
|
|
313
|
+
|
|
314
|
+
@media only screen and (min-resolution: 2dppx) {
|
|
315
|
+
height: 0.5px;
|
|
316
|
+
}
|
|
317
|
+
`,Rs=V.div`
|
|
318
|
+
container: explain-actions / inline-size;
|
|
319
|
+
`,Is=V(Kn)`
|
|
320
|
+
display: grid;
|
|
321
|
+
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
322
|
+
gap: var(--space-sm);
|
|
323
|
+
padding-top: var(--space-xs);
|
|
324
|
+
padding-bottom: var(--space-xs);
|
|
325
|
+
padding-right: 1.1em;
|
|
326
|
+
margin-right: -1.1em;
|
|
327
|
+
overflow: auto;
|
|
328
|
+
max-height: 200px;
|
|
329
|
+
`,Ps=V(Ln)`
|
|
330
|
+
border-radius: 360px;
|
|
331
|
+
background-color: var(--color-explain-popover-apply-solution-button-fill);
|
|
332
|
+
color: var(--color-explain-popover-apply-solution-button-color);
|
|
333
|
+
font-size: 0.9em;
|
|
334
|
+
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
335
|
+
font-weight: 600;
|
|
336
|
+
appearance: none;
|
|
337
|
+
padding: 0.6em 2em;
|
|
338
|
+
border: none;
|
|
339
|
+
width: 100%;
|
|
340
|
+
margin-top: 1.1em;
|
|
341
|
+
|
|
342
|
+
&:focus {
|
|
343
|
+
outline: 2px solid var(--color-explain-popover-apply-solution-button-outline);
|
|
344
|
+
outline-offset: 1px;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// The Webstorm formatter doesn't support container queries and would be break it.
|
|
348
|
+
// @formatter:off
|
|
349
|
+
@container explain-actions (min-width: 300px) {
|
|
350
|
+
width: auto;
|
|
351
|
+
}
|
|
352
|
+
`,Ct=V(zn)`
|
|
353
|
+
width: min-content;
|
|
354
|
+
min-width: 300px;
|
|
355
|
+
`;function Os(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=me();if(n)return u.jsx(Ct,{variant:"failedToExplain"});const o=e[0];if(!o)return u.jsx(Ct,{variant:"noExplanationFound"});if(!o.solution)return u.jsx(Ct,{variant:"noSolutionFound"});const i=o.solution.decisions.filter(r=>r.state!=null);return u.jsxs(u.Fragment,{children:[u.jsx(Es,{children:"Solution"}),u.jsx(Sn,{}),u.jsx(Is,{blockingDecisions:o.causedByDecisions,desiredDecisions:i}),u.jsx(Sn,{}),u.jsxs(Rs,{children:[u.jsx(Ps,{explanation:o,children:"Apply solution"}),(e.length>1||t.length>0)&&u.jsx(As,{})]})]})}const $o=R.createContext(null),ae=()=>R.useContext($o);function Ko(e){return R.forwardRef((t,n)=>{const o=R.useId();return u.jsx($o.Provider,{value:o,children:u.jsx(e,{...t,ref:n})})})}const Ds=R.forwardRef((e,t)=>{const{style:n,children:o,...i}=e,r=_e(),l=$t([r.refs.setFloating,t]);return u.jsx(yo,{children:u.jsx(xo,{context:r.context,modal:r.modal,children:u.jsx("div",{ref:l,style:{...r.floatingStyles,...n},...r.getFloatingProps(i),children:o})})})}),Vs=Ds,js=R.forwardRef((e,t)=>{const{setOpen:n}=_e();return u.jsx("button",{type:"button",ref:t,...e,onClick:o=>{var i;(i=e.onClick)==null||i.call(e,o),n(!1)}})}),ks=js,Fs=V.div`
|
|
356
|
+
position: relative;
|
|
357
|
+
background-color: var(--color-explain-popover-fill);
|
|
358
|
+
color: var(--color-explain-popover-color);
|
|
359
|
+
outline-offset: -1px;
|
|
360
|
+
padding: 1.1em;
|
|
361
|
+
border-radius: var(--shape-border-radius-md);
|
|
362
|
+
font-size: var(--text-base-size);
|
|
363
|
+
font-family: var(--font-primary);
|
|
364
|
+
min-width: 300px;
|
|
365
|
+
max-width: 500px;
|
|
366
|
+
`,Bs=V(ks)`
|
|
367
|
+
position: absolute;
|
|
368
|
+
right: var(--space-sm-fixed);
|
|
369
|
+
top: var(--space-sm-fixed);
|
|
370
|
+
border: none;
|
|
371
|
+
background-color: transparent;
|
|
372
|
+
color: inherit;
|
|
373
|
+
font-size: var(--text-sm);
|
|
374
|
+
cursor: pointer;
|
|
375
|
+
border-radius: var(--shape-border-radius-xs);
|
|
376
|
+
|
|
377
|
+
&:focus {
|
|
378
|
+
outline: 2px solid var(--color-explain-popover-close-button-outline);
|
|
379
|
+
outline-offset: 1px;
|
|
380
|
+
}
|
|
381
|
+
`,Ms=V(Po)`
|
|
382
|
+
font-size: var(--text-md);
|
|
383
|
+
font-weight: 500;
|
|
384
|
+
font-family: var(--font-heading);
|
|
385
|
+
margin-bottom: var(--space-xs);
|
|
386
|
+
overflow: hidden;
|
|
387
|
+
display: flex;
|
|
388
|
+
white-space: nowrap;
|
|
389
|
+
text-overflow: ellipsis;
|
|
390
|
+
margin-right: var(--space-md);
|
|
391
|
+
`;function Ns(e){return u.jsxs(Fs,{children:[u.jsx(Ms,{}),e.children,u.jsx(Bs,{children:u.jsx(Je.FontAwesomeIcon,{icon:Ge.faXmark})})]})}const Ls=V(Vs)`
|
|
392
|
+
--color-explain-attribute-value-fill: ${e=>e.attributeValueFill};
|
|
393
|
+
--color-explain-attribute-value-add-fill: ${e=>e.attributeValueAddFill};
|
|
394
|
+
--color-explain-attribute-value-add-color: ${e=>e.attributeValueAddColor};
|
|
395
|
+
--color-explain-attribute-value-remove-fill: ${e=>e.attributeValueRemoveFill};
|
|
396
|
+
--color-explain-attribute-value-remove-color: ${e=>e.attributeValueRemoveColor};
|
|
397
|
+
--color-explain-header-value-color: ${e=>e.headerValueColor};
|
|
398
|
+
--color-explain-popover-fill: ${e=>e.fill};
|
|
399
|
+
--color-explain-popover-color: ${e=>e.color};
|
|
400
|
+
--color-explain-popover-close-button-outline: ${e=>e.closeButtonOutline};
|
|
401
|
+
--color-explain-popover-list-separator: ${e=>e.listSeparator};
|
|
402
|
+
--color-explain-popover-apply-solution-button-fill: ${e=>e.applySolutionButtonFill};
|
|
403
|
+
--color-explain-popover-apply-solution-button-color: ${e=>e.applySolutionButtonColor};
|
|
404
|
+
--color-explain-popover-apply-solution-button-outline: ${e=>e.applySolutionButtonOutline};
|
|
405
|
+
--color-explain-popover-show-more-button-outline: ${e=>e.showMoreButtonOutline};
|
|
406
|
+
|
|
407
|
+
z-index: 10;
|
|
408
|
+
filter: var(--shadows-popover);
|
|
409
|
+
|
|
410
|
+
&:focus {
|
|
411
|
+
outline: none;
|
|
412
|
+
}
|
|
413
|
+
`,$s=V(ol)`
|
|
414
|
+
fill: var(--color-explain-popover-fill);
|
|
415
|
+
`,Ks={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 Ws(e){const t=me(),n=ae(),o=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=R.useRef(null);return u.jsxs(Cs,{open:o,onOpenChange:r=>!r&&o&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[u.jsx(ws,{children:e.children}),u.jsxs(zs,{isOpen:o,children:[R.Children.toArray(e.content)[0]??u.jsx(Ns,{children:u.jsx(Os,{})}),u.jsx(qs,{})]})]})}function zs(e){var b,f;const t=R.useContext(Oo),{middlewareData:n,arrow:o,placement:i}=_e(),r=((b=n.arrow)==null?void 0:b.x)??0,l=((f=n.arrow)==null?void 0:f.y)??0,s=(o==null?void 0:o.height)??0,a=(o==null?void 0:o.width)??0,c=r+a/2,m=l+s,d=B.match(i).with("top",()=>`${c}px calc(100% + ${s+5}px)`).with("bottom",()=>`${c}px ${-s-5}px`).with("left",()=>`calc(100% + ${s}px) ${m}px`).with("right",()=>`${-s}px ${m}px`).otherwise(()=>"");return u.jsx(y.AnimatePresence,{initial:!1,children:e.isOpen&&u.jsx(Ls,{...t,children:u.jsx(y.motion.div,{variants:Ks,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:d},children:u.jsx(Io,{children:e.children})})})})}function qs(){const{context:e,arrow:t}=_e();return u.jsx($s,{ref:t.element,context:e,width:t.width,height:t.height})}function Hs(e){return R.forwardRef((t,n)=>{const o=Z();return t.explain!=="popover"||o?u.jsx(e,{...t}):u.jsx(Ws,{children:u.jsx(e,{...t,ref:n})})})}function ye(e){return Te(Ko(Hs(R.forwardRef(e))))}function se(){alert(`Failed to apply your selection.
|
|
416
|
+
Please check your internet connection and try again.`)}function _s(){alert(`Failed to reset your configuration.
|
|
417
|
+
Please check your internet connection and try again.`)}const Tn=V.select`
|
|
418
|
+
color: inherit;
|
|
419
|
+
`,An="<reset>",En="<nothing>",Wo=ye((e,t)=>{if(Z()){const w=Fe(e,!0,!1);return u.jsx(Tn,{style:w})}const o=ae(),i=re(e),r=Q.useChoiceAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Choice Attribute not found"});const{attribute:s,makeDecision:a,clearDecisions:c}=r,m=st(i,p.AttributeInterpreter.getAllowedChoiceValues(s)),d=st(i,p.AttributeInterpreter.getBlockedChoiceValues(s)),b=p.AttributeInterpreter.isMultiSelect(s),f=p.AttributeInterpreter.getSelectedChoiceValues(s),g=f.map(w=>w.id),h=g[0]??En,x=f.some(w=>{var I;return((I=w.decision)==null?void 0:I.kind)===p.DecisionKind.Explicit}),C=g.length>=1,v=f.some(w=>{var I;return((I=w.decision)==null?void 0:I.kind)===p.DecisionKind.Implicit}),P=m.length===0,S=async w=>{if(w===An)try{await c()}catch{se()}else if(m.some(I=>I.id===w)){const I=g.some(O=>O===w)?void 0:p.ChoiceValueDecisionState.Included;try{await a(w,I)}catch{se()}}else d.some(I=>I.id===w)&&e.explain!=="disabled"&&await l(I=>I.whyIsStateNotPossible.choice(s.id).choiceValue(w).state(p.ChoiceValueDecisionState.Included),e.explain,o)},E=Xs(e,s.isSatisfied,v,P);return u.jsxs(Tn,{ref:t,value:b?g:h,multiple:b,onChange:w=>S(w.currentTarget.value),style:E,children:[!C&&!b&&u.jsx("option",{value:En}),x&&u.jsx("option",{value:An,children:e.resetLabel}),m.map(w=>{var I;return u.jsxs("option",{value:w.id,children:[((I=w.decision)==null?void 0:I.kind)===p.DecisionKind.Implicit?e.implicitLabelPrefix:"",w.id]},w.id)}),d.length>0&&u.jsx("optgroup",{label:"Blocked",children:d.map(w=>u.jsx("option",{value:w.id,children:w.id},w.id))})]})}),Us=Wo,Qs={...Ht,noOptionsAvailableColors:{...Vt,title:"No Options Available Colors"}};y.addPropertyControls(Wo,Qs);const Xs=(e,t,n,o)=>{var r,l,s;const i=Fe(e,t,n);return{...i,backgroundColor:B.match({noOptionsAvailable:o,noOptionsAvailableFill:(r=e.noOptionsAvailableColors)==null?void 0:r.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:B.P.string.minLength(1)},a=>a.noOptionsAvailableFill).otherwise(()=>i.backgroundColor),borderColor:B.match({noOptionsAvailable:o,noOptionsAvailableBorderColor:(l=e.noOptionsAvailableColors)==null?void 0:l.borderColor}).with({noOptionsAvailable:!0,noOptionsAvailableBorderColor:B.P.string.minLength(1)},a=>a.noOptionsAvailableBorderColor).otherwise(()=>i.borderColor),color:B.match({noOptionsAvailable:o,noOptionsAvailableColor:(s=e.noOptionsAvailableColors)==null?void 0:s.color}).with({noOptionsAvailable:!0,noOptionsAvailableColor:B.P.string.minLength(1)},a=>a.noOptionsAvailableColor).otherwise(()=>i.color)}},Rn=V.select`
|
|
420
|
+
color: inherit;
|
|
421
|
+
`,In="<reset>",vt="<nothing>",wt="yes",Pn="no",zo=ye((e,t)=>{var v,P,S;if(Z()){const E=Fe(e,!0,!1);return u.jsx(Rn,{style:E})}const o=ae(),i=re(e),r=Q.useBooleanAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Boolean Attribute not found"});const{attribute:s,makeDecision:a}=r,c=async E=>{const w=p.AttributeInterpreter.getBooleanDecision(s)!=null;if(E===In&&w)try{await a(void 0)}catch{se()}else{const I=E===wt;if(p.AttributeInterpreter.isBooleanValuePossible(s,I))try{await a(I)}catch{se()}else e.explain!=="disabled"&&await l(M=>M.whyIsStateNotPossible.boolean(s.id).state(I),e.explain,o)}},m=B.match((v=s.decision)==null?void 0:v.state).with(!0,()=>wt).with(!1,()=>Pn).otherwise(()=>vt),d=((P=s.decision)==null?void 0:P.kind)===p.DecisionKind.Explicit,b=((S=s.decision)==null?void 0:S.kind)===p.DecisionKind.Implicit,f=Fe(e,s.isSatisfied,b),g=p.AttributeInterpreter.isBooleanValuePossible(s,!0),h=p.AttributeInterpreter.isBooleanValuePossible(s,!1),x=u.jsxs("option",{value:wt,children:[On(s,!0,e.implicitLabelPrefix),e.trueLabel]}),C=u.jsxs("option",{value:Pn,children:[On(s,!1,e.implicitLabelPrefix),e.falseLabel]});return u.jsxs(Rn,{ref:t,value:m,onChange:E=>c(E.currentTarget.value),style:f,children:[m===vt&&u.jsx("option",{value:vt}),d&&u.jsx("option",{value:In,children:e.resetLabel}),g&&x,h&&C,(!g||!h)&&u.jsxs("optgroup",{label:"Blocked",children:[!g&&x,!h&&C]})]})}),Ys=zo,On=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===p.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},Gs={...Ht,trueLabel:{title:"True Label",type:y.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:y.ControlType.String,defaultValue:"No"}};y.addPropertyControls(zo,Gs);const Dn=V.select`
|
|
422
|
+
color: inherit;
|
|
423
|
+
`,Vn="<reset>",St="<nothing>",Tt="included",At="excluded",qo=ye((e,t)=>{var P,S,E;if(Z()){const w=Fe(e,!0,!1);return u.jsx(Dn,{style:w})}const o=ae(),i=re(e),r=Q.useComponentAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Component Attribute not found"});const{attribute:s,makeDecision:a}=r,c=async w=>{if(p.AttributeInterpreter.isComponentStatePossible(s,w))try{await a(w)}catch{se()}else e.explain!=="disabled"&&await l(O=>O.whyIsStateNotPossible.component(s.id).state(w),e.explain,o)},m=async w=>{var O;const I=((O=s.decision)==null?void 0:O.kind)===p.DecisionKind.Explicit;w===Vn&&I?await a(void 0):w===Tt?await c(p.ComponentDecisionState.Included):w===At&&await c(p.ComponentDecisionState.Excluded)},d=B.match((P=s.decision)==null?void 0:P.state).with(p.ComponentDecisionState.Included,()=>Tt).with(p.ComponentDecisionState.Excluded,()=>At).otherwise(()=>St),b=((S=s.decision)==null?void 0:S.kind)===p.DecisionKind.Explicit,f=((E=s.decision)==null?void 0:E.kind)===p.DecisionKind.Implicit,g=Fe(e,s.isSatisfied,f),h=p.AttributeInterpreter.isComponentStatePossible(s,p.ComponentDecisionState.Included),x=p.AttributeInterpreter.isComponentStatePossible(s,p.ComponentDecisionState.Excluded),C=u.jsxs("option",{value:Tt,children:[jn(s,p.ComponentDecisionState.Included,e.implicitLabelPrefix),e.includedLabel]}),v=u.jsxs("option",{value:At,children:[jn(s,p.ComponentDecisionState.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return u.jsxs(Dn,{ref:t,value:d,onChange:w=>m(w.currentTarget.value),style:g,children:[d===St&&u.jsx("option",{value:St}),b&&u.jsx("option",{value:Vn,children:e.resetLabel}),h&&C,x&&v,(!h||!x)&&u.jsxs("optgroup",{label:"Blocked",children:[!h&&C,!x&&v]})]})}),Js=qo,jn=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===p.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},Zs={...Ht,includedLabel:{title:"Included Label",type:y.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:y.ControlType.String,defaultValue:"Excluded"}};y.addPropertyControls(qo,Zs);function Ho(e,t,n,o,i=1e3){const[r]=ui.useForceUpdate(),l=ci.useDebouncedCallback(b=>{t(b),r()},i),s=R.useRef(n),a=R.useRef(e),c=l.isPending(),m=R.useRef(c);R.useEffect(()=>{e!==a.current&&(a.current=e,c&&(l.cancel(),r()),e!==n&&o(e)),n!==s.current&&(s.current=n,n!==e?(l(n),r()):c&&(l.cancel(),r())),c!==m.current&&(m.current=c,!c&&e!==n&&o(e))},[e,n,l,c]);const d=R.useCallback(()=>{l.isPending()&&l.flush()},[l]);return R.useEffect(()=>()=>d(),[d]),{flush:d}}const kn=V(ai)`
|
|
424
|
+
color: inherit;
|
|
425
|
+
`,_o=ye((e,t)=>{var v,P;if(Z()){const S=jt(e,!0,!1);return u.jsx(kn,{style:S})}const o=ae(),i=re(e),r=Q.useNumericAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Numeric Attribute not found"});const{attribute:s,makeDecision:a}=r,c=((v=s.decision)==null?void 0:v.kind)===p.DecisionKind.Implicit,m=jt(e,s.isSatisfied,c),d=(P=s.decision)==null?void 0:P.state,[b,f]=R.useState(d),{min:g,max:h}=s.range,C=Ho(d,async S=>{if(S<g){alert(`The value must be smaller than or equal to ${g}.`);return}if(S>h){alert(`The value must be greater than or equal to ${h}.`);return}try{await a(S)}catch(E){const w=E;w.type===p.FailureType.ConfigurationModelNotFeasible||w.type===p.FailureType.ConfigurationConflict?e.explain!=="disabled"&&await l(O=>O.whyIsStateNotPossible.numeric(s.id).state(S),e.explain,o):se()}},b,S=>f(S),e.wait);return u.jsx(kn,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:s.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:ta(s,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:S=>{S.key==="Enter"&&C.flush()},onValueChange:S=>f(S.floatValue),value:b??"",style:m})}),ea=_o,ta=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===p.DecisionKind.Implicit?t:""},na={...No,wait:{title:"Debounce Delay",type:y.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:y.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:y.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:y.ControlType.String,defaultValue:""}};y.addPropertyControls(_o,na);const dt={choiceValueId:{title:"Choice Value Id",type:y.ControlType.String}};function Ae(e,t){return R.Children.map(e,n=>{if(R.isValidElement(n)){const o=Mn(n.props,t);return R.cloneElement(n,o)}return n})}const Uo=ye((e,t)=>{if(Z())return e.children;const o=ae(),{makeDecision:i}=Q.useDecision(),r=re(e),l=e.choiceValueId??"",s=l.length>0,a=Q.useAttributes([r])[0],{explain:c}=ge();if(!a)return u.jsx("span",{children:"Attribute not found"});const m=a.type===p.AttributeType.Choice,d=a.type===p.AttributeType.Numeric,b=a.type===p.AttributeType.Boolean,f=a.type===p.AttributeType.Component;if(!m&&s)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});if(d)return u.jsx("span",{children:"Numeric Attribute is not supported"});let g=m?a.values.find(P=>P.id===l):null;if(s&&g==null)return u.jsx("span",{children:"Choice Value not found"});const h=P=>B.match({state:P,attribute:a}).with({attribute:{type:p.AttributeType.Choice},state:"undefined"},()=>g.decision==null).with({attribute:{type:p.AttributeType.Choice},state:"included"},()=>{var S,E;return((S=g.decision)==null?void 0:S.state)===p.ChoiceValueDecisionState.Included&&((E=g.decision)==null?void 0:E.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Choice},state:"excluded"},()=>{var S,E;return((S=g.decision)==null?void 0:S.state)===p.ChoiceValueDecisionState.Excluded&&((E=g.decision)==null?void 0:E.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Boolean},state:"undefined"},{attribute:{type:p.AttributeType.Component},state:"undefined"},({attribute:S})=>S.decision==null).with({attribute:{type:p.AttributeType.Boolean},state:"true"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===!0&&((w=S.decision)==null?void 0:w.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Boolean},state:"false"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===!1&&((w=S.decision)==null?void 0:w.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Component},state:"included"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===p.ComponentDecisionState.Included&&((w=S.decision)==null?void 0:w.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Component},state:"excluded"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===p.ComponentDecisionState.Excluded&&((w=S.decision)==null?void 0:w.kind)===p.DecisionKind.Explicit}).otherwise(()=>!1),x=P=>B.match({isChoiceAttribute:m,isBooleanAttribute:b,isComponentAttribute:f,state:P}).with({isChoiceAttribute:!0,state:"included"},()=>p.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>p.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>p.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>p.ComponentDecisionState.Excluded).otherwise(()=>null);h(e.toggleFrom);const C=h(e.toggleTo),v=async()=>{const P=C?e.toggleFrom:e.toggleTo,S=x(P),E=f?p.AttributeInterpreter.isComponentStatePossible(a,S):!1,w=b?p.AttributeInterpreter.isBooleanValuePossible(a,S):!1;if((m?g.possibleDecisionStates.some(M=>M===S):!1)||w||E||S==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:S})}catch{se()}else if(e.explain!=="disabled"){const M=B.match({isComponentAttribute:f,isBooleanAttribute:b,isChoiceAttribute:m}).returnType().with({isChoiceAttribute:!0},()=>p.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>p.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>p.ExplainQuestionSubject.component).otherwise(()=>null);M&&await c({question:p.ExplainQuestionType.whyIsStateNotPossible,subject:M,attributeId:r,choiceValueId:l,state:S},e.explain,o)}};return Ae(e.children,{onClick:v,ref:t})}),oa=Uo,ia={...de,...dt,children:{title:"Content",type:y.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:y.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:y.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...He};y.addPropertyControls(Uo,ia);const Qo=ye((e,t)=>{if(Z())return e.children;const o=ae(),{makeDecision:i}=Q.useDecision(),r=re(e),l=e.choiceValueId??"",s=l.length>0,a=Q.useAttributes([r])[0],c=Q.useChoiceAttribute(r),{explain:m}=ge();if(!a)return u.jsx("span",{children:"Attribute not found"});const d=a.type===p.AttributeType.Choice,b=a.type===p.AttributeType.Numeric,f=a.type===p.AttributeType.Boolean,g=a.type===p.AttributeType.Component;if(!d&&s)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});let h=d?a.values.find(v=>v.id===l):null;if(s&&h==null)return u.jsx("span",{children:"Choice Value not found"});const x=()=>B.match({isChoiceAttribute:d,isBooleanAttribute:f,isComponentAttribute:g,isNumericAttribute:b,hasChoiceValueId:s,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>p.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>p.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>p.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>p.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),C=async()=>{if(d&&!s&&e.setSelection==="undefined")try{await c.clearDecisions()}catch{se()}else{const v=x(),P=g?p.AttributeInterpreter.isComponentStatePossible(a,v):!1,S=f?p.AttributeInterpreter.isBooleanValuePossible(a,v):!1,w=(d?h.possibleDecisionStates.some(I=>I===v):!1)||S||P;if(b||w||v==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:v})}catch(I){const O=I;b&&(O.type===p.FailureType.ConfigurationModelNotFeasible||O.type===p.FailureType.ConfigurationConflict)?e.explain!=="disabled"&&await m(j=>j.whyIsStateNotPossible.numeric(a.id).state(v),e.explain,o):se()}else if(e.explain!=="disabled"){const I=B.match({isComponentAttribute:g,isBooleanAttribute:f,isChoiceAttribute:d}).returnType().with({isChoiceAttribute:!0},()=>p.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>p.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>p.ExplainQuestionSubject.component).otherwise(()=>null);I&&await m({question:p.ExplainQuestionType.whyIsStateNotPossible,subject:I,attributeId:r,choiceValueId:l,state:v},e.explain,o)}}};return Ae(e.children,{onClick:C,ref:t})}),ra=Qo,la={...de,...dt,children:{title:"Content",type:y.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:y.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:y.ControlType.Number,defaultValue:0},...He};y.addPropertyControls(Qo,la);const Xo=ye((e,t)=>{var d;if(Z())return e.children;const o=ae(),{setManyDecision:i}=Q.useDecision(),{handleExplainAnswer:r}=ge(),l=e.attributes.map(re),s=Q.useAttributes(l).map((b,f)=>{if(!b)return{error:u.jsx("span",{children:"Attribute not found"})};const g=e.attributes[f],h=g.choiceValueId??"",x=h.length>0,C=b.type===p.AttributeType.Choice,v=b.type===p.AttributeType.Numeric,P=b.type===p.AttributeType.Boolean,S=b.type===p.AttributeType.Component;if(!C&&x)return{error:u.jsx("span",{children:"Attribute is not a Choice Attribute"})};let E=C?b.values.find(I=>I.id===h):null;if(x&&E==null)return{error:u.jsx("span",{children:"Choice Value not found"})};const w=()=>B.match({isChoiceAttribute:C,isBooleanAttribute:P,isComponentAttribute:S,isNumericAttribute:v,hasChoiceValueId:x,state:g.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>p.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>p.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>p.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>p.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>g.numericValue).otherwise(()=>null);return{getDecisions:()=>C&&!x&&g.setSelection==="undefined"?b.values.filter(I=>{var O;return((O=I.decision)==null?void 0:O.kind)===p.DecisionKind.Explicit}).map(I=>({type:b.type,attributeId:b.id,choiceValueId:I.id,state:null})):[{type:b.type,attributeId:b.id,choiceValueId:h,state:w()}]}}),a=(d=s.find(b=>b.error))==null?void 0:d.error;if(a)return a;const c=async()=>{const b=s.reduce((g,h)=>[...g,...h.getDecisions()],new Array),f=B.match(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:B.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(b,f)}catch(g){const h=g;if(console.debug("SetMany failed",h),(h==null?void 0:h.type)===p.FailureType.ConfigurationSetManyConflict&&h.decisionExplanations){e.explain!=="disabled"&&await r(h,e.explain,o);return}se();return}},m=()=>{e.trigger==="click"&&c()};return R.useEffect(()=>{e.trigger==="auto"&&c()},[]),Ae(e.children,{onClick:m,ref:t})}),sa=Xo,aa={children:{title:"Content",type:y.ControlType.ComponentInstance},attributes:{title:"Attributes",type:y.ControlType.Array,control:{type:y.ControlType.Object,controls:{...de,...dt,setSelection:{title:"Set Selection To",type:y.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:y.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:y.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:y.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:y.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...He};y.addPropertyControls(Xo,aa);const Yo=Te(e=>{if(Z())return e.enabledChildren;const{configuration:n}=Q.useConfiguration(),{setManyDecision:o}=Q.useDecision(),i=n.attributes.some(s=>B.match(s).with({type:p.AttributeType.Choice},a=>a.values.some(c=>{var m;return((m=c.decision)==null?void 0:m.kind)===p.DecisionKind.Explicit})).with({type:p.AttributeType.Boolean},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===p.DecisionKind.Explicit}).with({type:p.AttributeType.Numeric},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===p.DecisionKind.Explicit}).with({type:p.AttributeType.Component},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===p.DecisionKind.Explicit}).exhaustive()),r=()=>{if(i)try{o([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{_s()}},l=i?e.enabledChildren:e.disabledChildren;return Ae(l,{onClick:r})}),ca=Yo,ua={enabledChildren:{title:"Content – Enabled",type:y.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:y.ControlType.ComponentInstance}};y.addPropertyControls(Yo,ua);const Go=ye((e,t)=>{if(Z())return e.satisfiedChildren;const o=ae(),{configuration:i}=Q.useConfiguration(),{explain:r}=ge(),s=[...e.attributeId.length>0?[re(e)]:[],...e.attributes.map(re)],a=()=>{var f;const d=Q.useAttributes(s).map(g=>g?{isSatisfied:g.isSatisfied}:{error:u.jsx("span",{children:"Attribute not found"})}),b=(f=d.find(g=>g.error))==null?void 0:f.error;return b||d.every(g=>g.isSatisfied)},c=async()=>{e.explain!=="disabled"&&(s.length===0?await r(d=>d.whyIsNotSatisfied.configuration,e.explain,o):s.length===1&&await r(d=>d.whyIsNotSatisfied.attribute(s[0]),e.explain,o))};return(s.length>0?a():i.isSatisfied)?e.satisfiedChildren:Ae(e.unsatisfiedChildren,{onClick:c,ref:t})}),da=Go,fa={satisfiedChildren:{title:"Content – Satisfied",type:y.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:y.ControlType.ComponentInstance},...de,attributes:{title:"Attributes",type:y.ControlType.Array,control:{type:y.ControlType.Object,controls:{...de}}},...He};y.addPropertyControls(Go,fa);const Jo=Te(R.forwardRef(function(t,n){const o=f=>B.match(f).with(1,()=>t.content1).with(2,()=>t.content2).with(3,()=>t.content3).with(4,()=>t.content4).with(5,()=>t.content5).with(6,()=>t.content6).with(7,()=>t.content7).with(8,()=>t.content8).with(9,()=>t.content9).with(10,()=>t.content10).otherwise(()=>null),i=t.variants.find(f=>f.useInDesignTime)||t.variants[0];if(Z())return i&&o(i.content);const l=re(t),s=t.choiceValueId??"",a=s.length>0,c=Q.useAttributes([l])[0];if(!c)return u.jsx("span",{children:"Attribute not found"});const m=c.type===p.AttributeType.Choice;if(!m&&a)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});if(m&&!a)return u.jsx("span",{children:"Choice Value Id missing"});let d=m?c.values.find(f=>f.id===s):null;if(a&&d==null)return u.jsx("span",{children:"Choice Value not found"});const b=[...t.variants].find(({selection:f,condition:g})=>B.match({selection:f,condition:g,attribute:c}).with({attribute:{type:p.AttributeType.Choice},selection:"included",condition:"blocked"},()=>!d.possibleDecisionStates.includes(p.ChoiceValueDecisionState.Included)).with({attribute:{type:p.AttributeType.Choice},selection:"included",condition:"implicit"},()=>{var h,x;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Included&&((x=d.decision)==null?void 0:x.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Choice},selection:"included",condition:"explicit"},()=>{var h,x;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Included&&((x=d.decision)==null?void 0:x.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Choice},selection:"included",condition:"none"},()=>{var h;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Included}).with({attribute:{type:p.AttributeType.Choice},selection:"excluded",condition:"blocked"},()=>!d.possibleDecisionStates.includes(p.ChoiceValueDecisionState.Excluded)).with({attribute:{type:p.AttributeType.Choice},selection:"excluded",condition:"implicit"},()=>{var h,x;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Excluded&&((x=d.decision)==null?void 0:x.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Choice},selection:"excluded",condition:"explicit"},()=>{var h,x;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Excluded&&((x=d.decision)==null?void 0:x.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Choice},selection:"excluded",condition:"none"},()=>{var h;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Excluded}).with({attribute:{type:p.AttributeType.Boolean},selection:"true",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(!0)).with({attribute:{type:p.AttributeType.Boolean},selection:"true",condition:"implicit"},({attribute:h})=>{var x,C;return((x=h.decision)==null?void 0:x.state)===!0&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Boolean},selection:"true",condition:"explicit"},({attribute:h})=>{var x,C;return((x=h.decision)==null?void 0:x.state)===!0&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Boolean},selection:"true",condition:"none"},({attribute:h})=>{var x;return((x=h.decision)==null?void 0:x.state)===!0}).with({attribute:{type:p.AttributeType.Boolean},selection:"false",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(!1)).with({attribute:{type:p.AttributeType.Boolean},selection:"false",condition:"implicit"},({attribute:h})=>{var x,C;return((x=h.decision)==null?void 0:x.state)===!1&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Boolean},selection:"false",condition:"explicit"},({attribute:h})=>{var x,C;return((x=h.decision)==null?void 0:x.state)===!1&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Boolean},selection:"false",condition:"none"},({attribute:h})=>{var x;return((x=h.decision)==null?void 0:x.state)===!1}).with({attribute:{type:p.AttributeType.Component},selection:"included",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(p.ComponentDecisionState.Included)).with({attribute:{type:p.AttributeType.Component},selection:"included",condition:"implicit"},({attribute:h})=>{var x,C;return((x=h.decision)==null?void 0:x.state)===p.ComponentDecisionState.Included&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Component},selection:"included",condition:"explicit"},({attribute:h})=>{var x,C;return((x=h.decision)==null?void 0:x.state)===p.ComponentDecisionState.Included&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Component},selection:"included",condition:"none"},({attribute:h})=>{var x;return((x=h.decision)==null?void 0:x.state)===p.ComponentDecisionState.Included}).with({attribute:{type:p.AttributeType.Component},selection:"excluded",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(p.ComponentDecisionState.Excluded)).with({attribute:{type:p.AttributeType.Component},selection:"excluded",condition:"implicit"},({attribute:h})=>{var x,C;return((x=h.decision)==null?void 0:x.state)===p.ComponentDecisionState.Excluded&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Component},selection:"excluded",condition:"explicit"},({attribute:h})=>{var x,C;return((x=h.decision)==null?void 0:x.state)===p.ComponentDecisionState.Excluded&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Component},selection:"excluded",condition:"none"},({attribute:h})=>{var x;return((x=h.decision)==null?void 0:x.state)===p.ComponentDecisionState.Excluded}).with({attribute:{type:p.AttributeType.Numeric},selection:"numeric",condition:"implicit"},({attribute:h})=>{var x;return((x=h.decision)==null?void 0:x.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Numeric},selection:"numeric",condition:"explicit"},({attribute:h})=>{var x;return((x=h.decision)==null?void 0:x.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Numeric},selection:"numeric",condition:"none"},({attribute:h})=>h.decision!=null).with({attribute:{type:p.AttributeType.Choice},selection:"undefined"},()=>d.decision==null).with({attribute:{type:p.AttributeType.Boolean},selection:"undefined"},{attribute:{type:p.AttributeType.Component},selection:"undefined"},{attribute:{type:p.AttributeType.Numeric},selection:"undefined"},({attribute:h})=>h.decision==null).otherwise(()=>!1));return b&&Ae(o(b.content),{ref:n})})),pa=Jo,ha={...de,...dt,variants:{title:"Variants",type:y.ControlType.Array,maxCount:10,control:{type:y.ControlType.Object,controls:{selection:{title:"Selection",type:y.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:y.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:y.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:y.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:y.ControlType.ComponentInstance},content2:{title:"Content 2",type:y.ControlType.ComponentInstance},content3:{title:"Content 3",type:y.ControlType.ComponentInstance},content4:{title:"Content 4",type:y.ControlType.ComponentInstance},content5:{title:"Content 5",type:y.ControlType.ComponentInstance},content6:{title:"Content 6",type:y.ControlType.ComponentInstance},content7:{title:"Content 7",type:y.ControlType.ComponentInstance},content8:{title:"Content 8",type:y.ControlType.ComponentInstance},content9:{title:"Content 9",type:y.ControlType.ComponentInstance},content10:{title:"Content 10",type:y.ControlType.ComponentInstance}};y.addPropertyControls(Jo,ha);const Zo=Te(e=>{const t=R.useRef(),[n,o]=R.useState(null),i=R.useRef(n),r=R.useMemo(()=>e.color.startsWith("var"),[e.color]),l=r?n:e.color,s=R.useMemo(()=>{if(!l)return;const a=fi(l);return di.hexToCSSFilter(`#${a}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[l]);return R.useLayoutEffect(()=>{if(r){const a=t.current&&getComputedStyle(t.current).color;a!=i.current&&(i.current=a,o(a))}}),u.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),ma=Zo,ga={children:{title:"Content",type:y.ControlType.ComponentInstance},color:{title:"Color",type:y.ControlType.Color,defaultValue:"#0000ff"}};y.addPropertyControls(Zo,ga);const ei=Te(e=>{if(Z())return e.children;const{error:n}=Q.useConfigurationInitialization();return n?Ae(e.children,{onClick:n.retry}):null}),ya=ei,ba={children:{title:"Content",type:y.ControlType.ComponentInstance}};y.addPropertyControls(ei,ba);function xa(e){return R.forwardRef((t,n)=>{const o={...t.style,width:"100%",height:"100%"};return u.jsx(e,{...t,ref:n,style:o})})}const Ca=V.div`
|
|
426
|
+
width: 10px;
|
|
427
|
+
height: 10px;
|
|
428
|
+
background-color: greenyellow;
|
|
429
|
+
`;function ti(e){const t=R.useRef(null);return R.useEffect(()=>{if(!t.current)return;const n=setTimeout(()=>{t.current.scrollIntoView()},e.delay);return()=>clearTimeout(n)},[t.current]),u.jsx(Ca,{ref:t})}const va={delay:{title:"Delay",type:y.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};y.addPropertyControls(ti,va);const ni=V.div`
|
|
430
|
+
display: contents;
|
|
431
|
+
`,wa=V.createGlobalStyle`
|
|
432
|
+
:root {
|
|
433
|
+
*:has(> ${ni}) {
|
|
434
|
+
display: contents !important;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
`,oi=Te(Ko(e=>{const t=ae(),n=Z(),r=n?(()=>R.Children.toArray(e.itemTemplate)[0])():(()=>{const d=b=>{var h;const f=R.Children.toArray(b)[0],g=(h=f.props)==null?void 0:h.children;return g?d(g):f};return d(e.itemTemplate)})();if(!r)return u.jsx("span",{children:"Choice Value Template not defined"});const l=d=>d.map(b=>R.cloneElement(r,{key:b,layoutId:`${t}_${b}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:b}));if(n)return u.jsx(Fn,{...e,children:l(["Choice Value 1","Choice Value 2","Choice Value 3"])});const s=re(e),a=Q.useChoiceAttribute(s),c=st(s);if(!a)return u.jsx("span",{children:"Choice Attribute not found"});const m=c.map(d=>d.id);return u.jsx(Fn,{...e,children:l(m)})}));function Fn(e){return u.jsxs(u.Fragment,{children:[u.jsx(lt,{singletonId:"ChoiceValueListRenderer",children:u.jsx(wa,{})}),u.jsx(ni,{style:e.style,children:e.children})]})}const Sa=oi,Ta={...de,itemTemplate:{title:"Choice Value Template",type:y.ControlType.ComponentInstance}};y.addPropertyControls(oi,Ta);exports.BooleanSelect=Ys;exports.ChoiceSelect=Us;exports.ChoiceValueListRenderer=Sa;exports.Colorize=ma;exports.ComponentSelect=Js;exports.Configuration=ds;exports.InitializationRetry=ya;exports.NumericInput=ea;exports.ResetConfiguration=ca;exports.SatisfactionIndicator=da;exports.ScrollIntoView=ti;exports.SelectionIndicator=pa;exports.SelectionToggle=oa;exports.SetSelection=ra;exports.SetSelections=sa;exports.Singleton=lt;exports.useDebounceValue=Ho;exports.useRenderPlaceholder=Z;exports.useSortedChoiceValues=st;exports.withFullSize=xa;
|