@viamedici-spc/configurator-framer-bundle 1.3.0 → 1.4.0-alpha0001
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 +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1406,7 +1406,7 @@ Please check your internet connection and try again.`)}const Ob=Ae.select`
|
|
|
1406
1406
|
color: inherit;
|
|
1407
1407
|
`,_b="<reset>",Id="<nothing>",Ad="included",$d="excluded",J1=Fr((e,t)=>{var n,r,i;if(Gt()){const T=Ma(e,!0,!1);return $.jsx(jb,{style:T})}const o=vr(),a=tn(e),s=eq(a),{explain:u}=qr();if(!s)return $.jsx("span",{children:"Component Attribute not found"});const{attribute:l,makeDecision:c}=s,f=async T=>{if($n.isComponentStatePossible(l,T))try{await c(T)}catch{Mr()}else e.explain!=="disabled"&&await u(E=>E.whyIsStateNotPossible.component(l.id).state(T),e.explain,o)},d=async T=>{var E;const A=((E=l.decision)==null?void 0:E.kind)===Se.Explicit;T===_b&&A?await c(void 0):T===Ad?await f(Ge.Included):T===$d&&await f(Ge.Excluded)},h=H((n=l.decision)==null?void 0:n.state).with(Ge.Included,()=>Ad).with(Ge.Excluded,()=>$d).otherwise(()=>Id),p=((r=l.decision)==null?void 0:r.kind)===Se.Explicit,v=((i=l.decision)==null?void 0:i.kind)===Se.Implicit,g=Ma(e,l.isSatisfied,v),C=$n.isComponentStatePossible(l,Ge.Included),m=$n.isComponentStatePossible(l,Ge.Excluded),b=$.jsxs("option",{value:Ad,children:[qb(l,Ge.Included,e.implicitLabelPrefix),e.includedLabel]}),x=$.jsxs("option",{value:$d,children:[qb(l,Ge.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return $.jsxs(jb,{ref:t,value:h,onChange:T=>d(T.currentTarget.value),style:g,children:[h===Id&&$.jsx("option",{value:Id}),p&&$.jsx("option",{value:_b,children:e.resetLabel}),C&&b,m&&x,(!C||!m)&&$.jsxs("optgroup",{label:e.blockedLabel,children:[!C&&b,!m&&x]})]})}),o4=J1,qb=(e,t,n)=>{var r,i;return((r=e.decision)==null?void 0:r.kind)===Se.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},a4={...bm,includedLabel:{title:"Included Label",type:D.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:D.ControlType.String,defaultValue:"Excluded"}};D.addPropertyControls(J1,a4);function X1(e,t,n,r,i=1e3){const[o]=gT.useForceUpdate(),a=a5(d=>{t(d),o()},i),s=O.useRef(n),u=O.useRef(e),l=a.isPending(),c=O.useRef(l);O.useEffect(()=>{e!==u.current&&(u.current=e,l&&(a.cancel(),o()),e!==n&&r(e)),n!==s.current&&(s.current=n,n!==e?(a(n),o()):l&&(a.cancel(),o())),l!==c.current&&(c.current=l,!l&&e!==n&&r(e))},[e,n,a,l]);const f=O.useCallback(()=>{a.isPending()&&a.flush()},[a]);return O.useEffect(()=>()=>f(),[f]),{flush:f}}const Fb=Ae(Bx)`
|
|
1408
1408
|
color: inherit;
|
|
1409
|
-
`,Q1=Fr((e,t)=>{var n,r;if(Gt()){const m=fh(e,!0,!1);return $.jsx(Fb,{style:m})}const i=vr(),o=tn(e),a=j0(o),{explain:s}=qr();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:l}=a,c=((n=u.decision)==null?void 0:n.kind)===Se.Implicit,f=fh(e,u.isSatisfied,c),d=(r=u.decision)==null?void 0:r.state,[h,p]=O.useState(d),{min:v,max:g}=u.range,C=X1(d,async m=>{if(m<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(m>g){alert(`The value must be greater than or equal to ${g}.`);return}try{await l(m)}catch(b){const x=b;x.type===pt.ConfigurationModelNotFeasible||x.type===pt.ConfigurationConflict?e.explain!=="disabled"&&await s(T=>T.whyIsStateNotPossible.numeric(u.id).state(m),e.explain,i):Mr()}},h,m=>p(m),e.wait);return $.jsx(Fb,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:u.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:u4(u,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:m=>{m.key==="Enter"&&C.flush()},onValueChange:m=>p(m.floatValue),value:h??"",style:f})}),s4=Q1,u4=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===Se.Implicit?t:""},l4={...z1,wait:{title:"Debounce Delay",type:D.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:D.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:D.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:D.ControlType.String,defaultValue:""}};D.addPropertyControls(Q1,l4);const ls={choiceValueId:{title:"Choice Value Id",type:D.ControlType.String}};function Lr(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=Lx(n.props,t);return O.cloneElement(n,r)}return n})}const Z1=Fr((e,t)=>{if(Gt())return e.children;const n=vr(),{makeDecision:r}=ci(),i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],{explain:u}=qr();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===V.Choice,c=s.type===V.Numeric,f=s.type===V.Boolean,d=s.type===V.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(c)return $.jsx("span",{children:"Numeric Attribute is not supported"});let h=l?s.values.find(m=>m.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const p=m=>H({state:m,attribute:s}).with({attribute:{type:V.Choice},state:"undefined"},()=>h.decision==null).with({attribute:{type:V.Choice},state:"included"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Included&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Choice},state:"excluded"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Excluded&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"undefined"},{attribute:{type:V.Component},state:"undefined"},({attribute:b})=>b.decision==null).with({attribute:{type:V.Boolean},state:"true"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!0&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"false"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!1&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"included"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Included&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"excluded"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Excluded&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).otherwise(()=>!1),v=m=>H({isChoiceAttribute:l,isBooleanAttribute:f,isComponentAttribute:d,state:m}).with({isChoiceAttribute:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).otherwise(()=>null);p(e.toggleFrom);const g=p(e.toggleTo),C=async()=>{const m=g?e.toggleFrom:e.toggleTo,b=v(m),x=d?$n.isComponentStatePossible(s,b):!1,T=f?$n.isBooleanValuePossible(s,b):!1;if(l&&h.possibleDecisionStates.some(E=>E===b)||T||x||b==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:b})}catch{Mr()}else if(e.explain!=="disabled"){const E=H({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);E&&await u({question:Ft.whyIsStateNotPossible,subject:E,attributeId:i,choiceValueId:o,state:b},e.explain,n)}};return Lr(e.children,{onClick:C,ref:t})}),c4=Z1,f4={...nr,...ls,children:{title:"Content",type:D.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:D.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...us};D.addPropertyControls(Z1,f4);const eT=Fr((e,t)=>{if(Gt())return e.children;const n=vr(),{makeDecision:r}=ci(),i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],u=rs(i),{explain:l}=qr();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===V.Choice,f=s.type===V.Numeric,d=s.type===V.Boolean,h=s.type===V.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let p=c?s.values.find(C=>C.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>H({isChoiceAttribute:c,isBooleanAttribute:d,isComponentAttribute:h,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),g=async()=>{if(c&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Mr()}else{const C=v(),m=h?$n.isComponentStatePossible(s,C):!1,b=d?$n.isBooleanValuePossible(s,C):!1,x=(c?p.possibleDecisionStates.some(T=>T===C):!1)||b||m;if(f||x||C==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:C})}catch(T){const E=T;f&&(E.type===pt.ConfigurationModelNotFeasible||E.type===pt.ConfigurationConflict)?e.explain!=="disabled"&&await l(A=>A.whyIsStateNotPossible.numeric(s.id).state(C),e.explain,n):Mr()}else if(e.explain!=="disabled"){const T=H({isComponentAttribute:h,isBooleanAttribute:d,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);T&&await l({question:Ft.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:C},e.explain,n)}}};return Lr(e.children,{onClick:g,ref:t})}),d4=eT,p4={...nr,...ls,children:{title:"Content",type:D.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0},...us};D.addPropertyControls(eT,p4);const tT=Fr((e,t)=>{var n;if(Gt())return e.children;const r=vr(),{setManyDecision:i}=ci(),{handleExplainAnswer:o}=qr(),a=e.attributes.map(tn),s=ns(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const h=e.attributes[d],p=h.choiceValueId??"",v=p.length>0,g=f.type===V.Choice,C=f.type===V.Numeric,m=f.type===V.Boolean,b=f.type===V.Component;if(!g&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let x=g?f.values.find(E=>E.id===p):null;if(v&&x==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const T=()=>H({isChoiceAttribute:g,isBooleanAttribute:m,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:v,state:h.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>h.numericValue).otherwise(()=>null);return{getDecisions:()=>g&&!v&&h.setSelection==="undefined"?f.values.filter(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Explicit}).map(E=>({type:f.type,attributeId:f.id,choiceValueId:E.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:p,state:T()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const l=async()=>{const f=s.reduce((h,p)=>[...h,...p.getDecisions()],new Array),d=H(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(h){const p=h;if(console.debug("SetMany failed",p),(p==null?void 0:p.type)===pt.ConfigurationSetManyConflict&&p.decisionExplanations){e.explain!=="disabled"&&await o(p,e.explain,r);return}Mr();return}},c=()=>{e.trigger==="click"&&l()};return O.useEffect(()=>{e.trigger==="auto"&&l()},[]),Lr(e.children,{onClick:c,ref:t})}),h4=tT,v4={children:{title:"Content",type:D.ControlType.ComponentInstance},attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...nr,...ls,setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:D.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:D.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...us};D.addPropertyControls(tT,v4);const nT=hr(e=>{if(Gt())return e.enabledChildren;const{configuration:t}=Rv(),{setManyDecision:n}=ci(),r=t.attributes.some(a=>H(a).with({type:V.Choice},s=>s.values.some(u=>{var l;return((l=u.decision)==null?void 0:l.kind)===Se.Explicit})).with({type:V.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{ZU()}},o=r?e.enabledChildren:e.disabledChildren;return Lr(o,{onClick:i})}),m4=nT,y4={enabledChildren:{title:"Content – Enabled",type:D.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:D.ControlType.ComponentInstance}};D.addPropertyControls(nT,y4);const rT=Fr((e,t)=>{if(Gt())return e.unsatisfiedChildren;const n=vr(),{configuration:r}=Rv(),{explain:i}=qr(),o=[...e.attributeId.length>0?[tn(e)]:[],...e.attributes.map(tn)],a=()=>{var u;const l=ns(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=l.find(f=>f.error))==null?void 0:u.error)||l.every(f=>f.isSatisfied)},s=async()=>{e.explain!=="disabled"&&(o.length===0?await i(u=>u.whyIsNotSatisfied.configuration,e.explain,n):o.length===1&&await i(u=>u.whyIsNotSatisfied.attribute(o[0]),e.explain,n))};return(o.length>0?a():r.isSatisfied)?e.satisfiedChildren:Lr(e.unsatisfiedChildren,{onClick:s,ref:t})}),g4=rT,b4={satisfiedChildren:{title:"Content – Satisfied",type:D.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:D.ControlType.ComponentInstance},...nr,attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...nr}}},...us};D.addPropertyControls(rT,b4);const iT=hr(O.forwardRef(function(e,t){const n=d=>H(d).with(1,()=>e.content1).with(2,()=>e.content2).with(3,()=>e.content3).with(4,()=>e.content4).with(5,()=>e.content5).with(6,()=>e.content6).with(7,()=>e.content7).with(8,()=>e.content8).with(9,()=>e.content9).with(10,()=>e.content10).otherwise(()=>null),r=e.variants.find(d=>d.useInDesignTime)||e.variants[0];if(Gt())return r&&n(r.content);const i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===V.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let l=u&&a?s.values.find(d=>d.id===o):null;if(a&&l==null)return $.jsx("span",{children:"Choice Value not found"});const c=d=>()=>l?d(l):s.values.some(d),f=[...e.variants].find(({selection:d,condition:h})=>H({selection:d,condition:h,attribute:s}).with({attribute:{type:V.Choice},selection:"included",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Included))).with({attribute:{type:V.Choice},selection:"included",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"included",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"included",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Included})).with({attribute:{type:V.Choice},selection:"excluded",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Excluded))).with({attribute:{type:V.Choice},selection:"excluded",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded})).with({attribute:{type:V.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:V.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!0}).with({attribute:{type:V.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:V.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!1}).with({attribute:{type:V.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Included)).with({attribute:{type:V.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"included",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Included}).with({attribute:{type:V.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Excluded)).with({attribute:{type:V.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Implicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Explicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:V.Choice},selection:"undefined"},()=>l.decision==null).with({attribute:{type:V.Boolean},selection:"undefined"},{attribute:{type:V.Component},selection:"undefined"},{attribute:{type:V.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return f&&Lr(n(f.content),{ref:t})})),S4=iT,C4={...nr,...ls,variants:{title:"Variants",type:D.ControlType.Array,maxCount:10,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:D.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:D.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:D.ControlType.ComponentInstance},content2:{title:"Content 2",type:D.ControlType.ComponentInstance},content3:{title:"Content 3",type:D.ControlType.ComponentInstance},content4:{title:"Content 4",type:D.ControlType.ComponentInstance},content5:{title:"Content 5",type:D.ControlType.ComponentInstance},content6:{title:"Content 6",type:D.ControlType.ComponentInstance},content7:{title:"Content 7",type:D.ControlType.ComponentInstance},content8:{title:"Content 8",type:D.ControlType.ComponentInstance},content9:{title:"Content 9",type:D.ControlType.ComponentInstance},content10:{title:"Content 10",type:D.ControlType.ComponentInstance}};D.addPropertyControls(iT,C4);const oT=hr(e=>{const t=O.useRef(),[n,r]=O.useState(null),i=O.useRef(n),o=O.useMemo(()=>e.color.startsWith("var"),[e.color]),a=o?n:e.color,s=O.useMemo(()=>{if(!a)return;const u=f5(a);return l5(`#${u}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[a]);return O.useLayoutEffect(()=>{if(o){const u=t.current&&getComputedStyle(t.current).color;u!=i.current&&(i.current=u,r(u))}}),$.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),w4=oT,x4={children:{title:"Content",type:D.ControlType.ComponentInstance},color:{title:"Color",type:D.ControlType.Color,defaultValue:"#0000ff"}};D.addPropertyControls(oT,x4);const aT=hr(e=>{if(Gt())return e.children;const{error:t}=Pv();return t?Lr(e.children,{onClick:t.retry}):null}),T4=aT,E4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(aT,E4);function I4(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const A4=Ae.div`
|
|
1409
|
+
`,Q1=Fr((e,t)=>{var n,r;if(Gt()){const m=fh(e,!0,!1);return $.jsx(Fb,{style:m})}const i=vr(),o=tn(e),a=j0(o),{explain:s}=qr();if(!a)return $.jsx("span",{children:"Numeric Attribute not found"});const{attribute:u,makeDecision:l}=a,c=((n=u.decision)==null?void 0:n.kind)===Se.Implicit,f=fh(e,u.isSatisfied,c),d=(r=u.decision)==null?void 0:r.state,[h,p]=O.useState(d),{min:v,max:g}=u.range,C=X1(d,async m=>{if(m<v){alert(`The value must be smaller than or equal to ${v}.`);return}if(m>g){alert(`The value must be greater than or equal to ${g}.`);return}try{await l(m)}catch(b){const x=b;x.type===pt.ConfigurationModelNotFeasible||x.type===pt.ConfigurationConflict?e.explain!=="disabled"&&await s(T=>T.whyIsStateNotPossible.numeric(u.id).state(m),e.explain,i):Mr()}},h,m=>p(m),e.wait);return $.jsx(Fb,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:u.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:u4(u,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:m=>{m.key==="Enter"&&C.flush()},onValueChange:m=>p(m.floatValue),value:h??"",style:f})}),s4=Q1,u4=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===Se.Implicit?t:""},l4={...z1,wait:{title:"Debounce Delay",type:D.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:D.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:D.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:D.ControlType.String,defaultValue:""}};D.addPropertyControls(Q1,l4);const ls={choiceValueId:{title:"Choice Value Id",type:D.ControlType.String}};function Lr(e,t){return O.Children.map(e,n=>{if(O.isValidElement(n)){const r=Lx(n.props,t);return O.cloneElement(n,r)}return n})}const Z1=Fr((e,t)=>{if(Gt())return e.children;const n=vr(),{makeDecision:r}=ci(),i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],{explain:u}=qr();if(!s)return $.jsx("span",{children:"Attribute not found"});const l=s.type===V.Choice,c=s.type===V.Numeric,f=s.type===V.Boolean,d=s.type===V.Component;if(!l&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});if(c)return $.jsx("span",{children:"Numeric Attribute is not supported"});let h=l?s.values.find(m=>m.id===o):null;if(a&&h==null)return $.jsx("span",{children:"Choice Value not found"});const p=m=>H({state:m,attribute:s}).with({attribute:{type:V.Choice},state:"undefined"},()=>h.decision==null).with({attribute:{type:V.Choice},state:"included"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Included&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Choice},state:"excluded"},()=>{var b,x;return((b=h.decision)==null?void 0:b.state)===Ye.Excluded&&((x=h.decision)==null?void 0:x.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"undefined"},{attribute:{type:V.Component},state:"undefined"},({attribute:b})=>b.decision==null).with({attribute:{type:V.Boolean},state:"true"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!0&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},state:"false"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===!1&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"included"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Included&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).with({attribute:{type:V.Component},state:"excluded"},({attribute:b})=>{var x,T;return((x=b.decision)==null?void 0:x.state)===Ge.Excluded&&((T=b.decision)==null?void 0:T.kind)===Se.Explicit}).otherwise(()=>!1),v=m=>H({isChoiceAttribute:l,isBooleanAttribute:f,isComponentAttribute:d,state:m}).with({isChoiceAttribute:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).otherwise(()=>null);p(e.toggleFrom);const g=p(e.toggleTo),C=async()=>{const m=g?e.toggleFrom:e.toggleTo,b=v(m),x=d?$n.isComponentStatePossible(s,b):!1,T=f?$n.isBooleanValuePossible(s,b):!1;if(l&&h.possibleDecisionStates.includes(b)||T||x||b==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:b})}catch{Mr()}else if(e.explain!=="disabled"){const E=H({isComponentAttribute:d,isBooleanAttribute:f,isChoiceAttribute:l}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);E&&await u({question:Ft.whyIsStateNotPossible,subject:E,attributeId:i,choiceValueId:o,state:b},e.explain,n)}};return Lr(e.children,{onClick:C,ref:t})}),c4=Z1,f4={...nr,...ls,children:{title:"Content",type:D.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:D.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...us};D.addPropertyControls(Z1,f4);const eT=Fr((e,t)=>{if(Gt())return e.children;const n=vr(),{makeDecision:r}=ci(),i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0],u=rs(i),{explain:l}=qr();if(!s)return $.jsx("span",{children:"Attribute not found"});const c=s.type===V.Choice,f=s.type===V.Numeric,d=s.type===V.Boolean,h=s.type===V.Component;if(!c&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let p=c?s.values.find(C=>C.id===o):null;if(a&&p==null)return $.jsx("span",{children:"Choice Value not found"});const v=()=>H({isChoiceAttribute:c,isBooleanAttribute:d,isComponentAttribute:h,isNumericAttribute:f,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),g=async()=>{if(c&&!a&&e.setSelection==="undefined")try{await u.clearDecisions()}catch{Mr()}else{const C=v(),m=h?$n.isComponentStatePossible(s,C):!1,b=d?$n.isBooleanValuePossible(s,C):!1,x=(c?p.possibleDecisionStates.includes(C):!1)||b||m;if(f||x||C==null)try{await r({type:s.type,attributeId:i,choiceValueId:o,state:C})}catch(T){const E=T;f&&(E.type===pt.ConfigurationModelNotFeasible||E.type===pt.ConfigurationConflict)?e.explain!=="disabled"&&await l(A=>A.whyIsStateNotPossible.numeric(s.id).state(C),e.explain,n):Mr()}else if(e.explain!=="disabled"){const T=H({isComponentAttribute:h,isBooleanAttribute:d,isChoiceAttribute:c}).returnType().with({isChoiceAttribute:!0},()=>Ue.choiceValue).with({isBooleanAttribute:!0},()=>Ue.boolean).with({isComponentAttribute:!0},()=>Ue.component).otherwise(()=>null);T&&await l({question:Ft.whyIsStateNotPossible,subject:T,attributeId:i,choiceValueId:o,state:C},e.explain,n)}}};return Lr(e.children,{onClick:g,ref:t})}),d4=eT,p4={...nr,...ls,children:{title:"Content",type:D.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0},...us};D.addPropertyControls(eT,p4);const tT=Fr((e,t)=>{var n;if(Gt())return e.children;const r=vr(),{setManyDecision:i}=ci(),{handleExplainAnswer:o}=qr(),a=e.attributes.map(tn),s=ns(a).map((f,d)=>{if(!f)return{error:$.jsx("span",{children:"Attribute not found"})};const h=e.attributes[d],p=h.choiceValueId??"",v=p.length>0,g=f.type===V.Choice,C=f.type===V.Numeric,m=f.type===V.Boolean,b=f.type===V.Component;if(!g&&v)return{error:$.jsx("span",{children:"Attribute is not a Choice Attribute"})};let x=g?f.values.find(E=>E.id===p):null;if(v&&x==null)return{error:$.jsx("span",{children:"Choice Value not found"})};const T=()=>H({isChoiceAttribute:g,isBooleanAttribute:m,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:v,state:h.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>Ye.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>Ye.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>Ge.Included).with({isComponentAttribute:!0,state:"excluded"},()=>Ge.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>h.numericValue).otherwise(()=>null);return{getDecisions:()=>g&&!v&&h.setSelection==="undefined"?f.values.filter(E=>{var A;return((A=E.decision)==null?void 0:A.kind)===Se.Explicit}).map(E=>({type:f.type,attributeId:f.id,choiceValueId:E.id,state:null})):[{type:f.type,attributeId:f.id,choiceValueId:p,state:T()}]}}),u=(n=s.find(f=>f.error))==null?void 0:n.error;if(u)return u;const l=async()=>{const f=s.reduce((h,p)=>[...h,...p.getDecisions()],new Array),d=H(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:H(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(f,d)}catch(h){const p=h;if(console.debug("SetMany failed",p),(p==null?void 0:p.type)===pt.ConfigurationSetManyConflict&&p.decisionExplanations){e.explain!=="disabled"&&await o(p,e.explain,r);return}Mr();return}},c=()=>{e.trigger==="click"&&l()};return O.useEffect(()=>{e.trigger==="auto"&&l()},[]),Lr(e.children,{onClick:c,ref:t})}),h4=tT,v4={children:{title:"Content",type:D.ControlType.ComponentInstance},attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...nr,...ls,setSelection:{title:"Set Selection To",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:D.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:D.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:D.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:D.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...us};D.addPropertyControls(tT,v4);const nT=hr(e=>{if(Gt())return e.enabledChildren;const{configuration:t}=Rv(),{setManyDecision:n}=ci(),r=t.attributes.some(a=>H(a).with({type:V.Choice},s=>s.values.some(u=>{var l;return((l=u.decision)==null?void 0:l.kind)===Se.Explicit})).with({type:V.Boolean},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Numeric},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).with({type:V.Component},s=>{var u;return((u=s.decision)==null?void 0:u.kind)===Se.Explicit}).exhaustive()),i=()=>{if(r)try{n([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{ZU()}},o=r?e.enabledChildren:e.disabledChildren;return Lr(o,{onClick:i})}),m4=nT,y4={enabledChildren:{title:"Content – Enabled",type:D.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:D.ControlType.ComponentInstance}};D.addPropertyControls(nT,y4);const rT=Fr((e,t)=>{if(Gt())return e.unsatisfiedChildren;const n=vr(),{configuration:r}=Rv(),{explain:i}=qr(),o=[...e.attributeId.length>0?[tn(e)]:[],...e.attributes.map(tn)],a=()=>{var u;const l=ns(o).map(f=>f?{isSatisfied:f.isSatisfied}:{error:$.jsx("span",{children:"Attribute not found"})});return((u=l.find(f=>f.error))==null?void 0:u.error)||l.every(f=>f.isSatisfied)},s=async()=>{e.explain!=="disabled"&&(o.length===0?await i(u=>u.whyIsNotSatisfied.configuration,e.explain,n):o.length===1&&await i(u=>u.whyIsNotSatisfied.attribute(o[0]),e.explain,n))};return(o.length>0?a():r.isSatisfied)?e.satisfiedChildren:Lr(e.unsatisfiedChildren,{onClick:s,ref:t})}),g4=rT,b4={satisfiedChildren:{title:"Content – Satisfied",type:D.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:D.ControlType.ComponentInstance},...nr,attributes:{title:"Attributes",type:D.ControlType.Array,control:{type:D.ControlType.Object,controls:{...nr}}},...us};D.addPropertyControls(rT,b4);const iT=hr(O.forwardRef(function(e,t){const n=d=>H(d).with(1,()=>e.content1).with(2,()=>e.content2).with(3,()=>e.content3).with(4,()=>e.content4).with(5,()=>e.content5).with(6,()=>e.content6).with(7,()=>e.content7).with(8,()=>e.content8).with(9,()=>e.content9).with(10,()=>e.content10).otherwise(()=>null),r=e.variants.find(d=>d.useInDesignTime)||e.variants[0];if(Gt())return r&&n(r.content);const i=tn(e),o=e.choiceValueId??"",a=o.length>0,s=ns([i])[0];if(!s)return $.jsx("span",{children:"Attribute not found"});const u=s.type===V.Choice;if(!u&&a)return $.jsx("span",{children:"Attribute is not a Choice Attribute"});let l=u&&a?s.values.find(d=>d.id===o):null;if(a&&l==null)return $.jsx("span",{children:"Choice Value not found"});const c=d=>()=>l?d(l):s.values.some(d),f=[...e.variants].find(({selection:d,condition:h})=>H({selection:d,condition:h,attribute:s}).with({attribute:{type:V.Choice},selection:"included",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Included))).with({attribute:{type:V.Choice},selection:"included",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"included",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"included",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Included})).with({attribute:{type:V.Choice},selection:"excluded",condition:"blocked"},c(p=>!p.possibleDecisionStates.includes(Ye.Excluded))).with({attribute:{type:V.Choice},selection:"excluded",condition:"implicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"explicit"},c(p=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit})).with({attribute:{type:V.Choice},selection:"excluded",condition:"none"},c(p=>{var v;return((v=p.decision)==null?void 0:v.state)===Ye.Excluded})).with({attribute:{type:V.Boolean},selection:"true",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!0)).with({attribute:{type:V.Boolean},selection:"true",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!0&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"true",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!0}).with({attribute:{type:V.Boolean},selection:"false",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(!1)).with({attribute:{type:V.Boolean},selection:"false",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===!1&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Boolean},selection:"false",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===!1}).with({attribute:{type:V.Component},selection:"included",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Included)).with({attribute:{type:V.Component},selection:"included",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"included",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Included&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"included",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Included}).with({attribute:{type:V.Component},selection:"excluded",condition:"blocked"},({attribute:p})=>!p.possibleDecisionStates.includes(Ge.Excluded)).with({attribute:{type:V.Component},selection:"excluded",condition:"implicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Implicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"explicit"},({attribute:p})=>{var v,g;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded&&((g=p.decision)==null?void 0:g.kind)===Se.Explicit}).with({attribute:{type:V.Component},selection:"excluded",condition:"none"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.state)===Ge.Excluded}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"implicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Implicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"explicit"},({attribute:p})=>{var v;return((v=p.decision)==null?void 0:v.kind)===Se.Explicit}).with({attribute:{type:V.Numeric},selection:"numeric",condition:"none"},({attribute:p})=>p.decision!=null).with({attribute:{type:V.Choice},selection:"undefined"},()=>l.decision==null).with({attribute:{type:V.Boolean},selection:"undefined"},{attribute:{type:V.Component},selection:"undefined"},{attribute:{type:V.Numeric},selection:"undefined"},({attribute:p})=>p.decision==null).otherwise(()=>!1));return f&&Lr(n(f.content),{ref:t})})),S4=iT,C4={...nr,...ls,variants:{title:"Variants",type:D.ControlType.Array,maxCount:10,control:{type:D.ControlType.Object,controls:{selection:{title:"Selection",type:D.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:D.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:D.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:D.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:D.ControlType.ComponentInstance},content2:{title:"Content 2",type:D.ControlType.ComponentInstance},content3:{title:"Content 3",type:D.ControlType.ComponentInstance},content4:{title:"Content 4",type:D.ControlType.ComponentInstance},content5:{title:"Content 5",type:D.ControlType.ComponentInstance},content6:{title:"Content 6",type:D.ControlType.ComponentInstance},content7:{title:"Content 7",type:D.ControlType.ComponentInstance},content8:{title:"Content 8",type:D.ControlType.ComponentInstance},content9:{title:"Content 9",type:D.ControlType.ComponentInstance},content10:{title:"Content 10",type:D.ControlType.ComponentInstance}};D.addPropertyControls(iT,C4);const oT=hr(e=>{const t=O.useRef(),[n,r]=O.useState(null),i=O.useRef(n),o=O.useMemo(()=>e.color.startsWith("var"),[e.color]),a=o?n:e.color,s=O.useMemo(()=>{if(!a)return;const u=f5(a);return l5(`#${u}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[a]);return O.useLayoutEffect(()=>{if(o){const u=t.current&&getComputedStyle(t.current).color;u!=i.current&&(i.current=u,r(u))}}),$.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),w4=oT,x4={children:{title:"Content",type:D.ControlType.ComponentInstance},color:{title:"Color",type:D.ControlType.Color,defaultValue:"#0000ff"}};D.addPropertyControls(oT,x4);const aT=hr(e=>{if(Gt())return e.children;const{error:t}=Pv();return t?Lr(e.children,{onClick:t.retry}):null}),T4=aT,E4={children:{title:"Content",type:D.ControlType.ComponentInstance}};D.addPropertyControls(aT,E4);function I4(e){return O.forwardRef((t,n)=>{const r={...t.style,width:"100%",height:"100%"};return $.jsx(e,{...t,ref:n,style:r})})}const A4=Ae.div`
|
|
1410
1410
|
width: 10px;
|
|
1411
1411
|
height: 10px;
|
|
1412
1412
|
background-color: greenyellow;
|
package/dist/index.js
CHANGED
|
@@ -30790,7 +30790,7 @@ const gE = Yr((e, t) => {
|
|
|
30790
30790
|
p(e.toggleFrom);
|
|
30791
30791
|
const g = p(e.toggleTo), w = async () => {
|
|
30792
30792
|
const m = g ? e.toggleFrom : e.toggleTo, b = v(m), x = d ? kn.isComponentStatePossible(s, b) : !1, E = f ? kn.isBooleanValuePossible(s, b) : !1;
|
|
30793
|
-
if (c && h.possibleDecisionStates.
|
|
30793
|
+
if (c && h.possibleDecisionStates.includes(b) || E || x || b == null)
|
|
30794
30794
|
try {
|
|
30795
30795
|
await r({
|
|
30796
30796
|
type: s.type,
|
|
@@ -30855,7 +30855,7 @@ const bE = Yr((e, t) => {
|
|
|
30855
30855
|
zr();
|
|
30856
30856
|
}
|
|
30857
30857
|
else {
|
|
30858
|
-
const w = v(), m = h ? kn.isComponentStatePossible(s, w) : !1, b = d ? kn.isBooleanValuePossible(s, w) : !1, x = (l ? p.possibleDecisionStates.
|
|
30858
|
+
const w = v(), m = h ? kn.isComponentStatePossible(s, w) : !1, b = d ? kn.isBooleanValuePossible(s, w) : !1, x = (l ? p.possibleDecisionStates.includes(w) : !1) || b || m;
|
|
30859
30859
|
if (f || x || w == null)
|
|
30860
30860
|
try {
|
|
30861
30861
|
await r({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viamedici-spc/configurator-framer-bundle",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-alpha0001",
|
|
4
4
|
"description": "Component library to build configurator apps with Framer based on Viamedici SPC. All dependencies are bundled together.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|