"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[460],{99460:(e,t,s)=>{s.r(t),s.d(t,{diagram:()=>$});var a=s(1213),o=s(45625),r=s(74309),i=s(8046),n=s(73841),d=s(48003),l=s(85408);s(27856),s(27484),s(42890),s(69368),s(17967);const c="rect",p="rectWithTitle",g="statediagram",b="----parent",h="fill:none",u="fill: #333",y="text",f="normal";let m={},w=0;function x(e="",t=0,s="",a="----"){return`state-${e}${null!==s&&s.length>0?`${a}${s}`:""}-${t}`}const T=(e,t,s,o,r,n)=>{const d=s.id,l=null==(g=o[d])?"":g.classes?g.classes.join(" "):"";var g;if("root"!==d){let t=c;!0===s.start&&(t="start"),!1===s.start&&(t="end"),s.type!==a.a&&(t=s.type),m[d]||(m[d]={id:d,shape:t,description:i.d.sanitizeText(d,(0,i.g)()),classes:`${l} statediagram-state`});const o=m[d];s.description&&(Array.isArray(o.description)?(o.shape=p,o.description.push(s.description)):o.description.length>0?(o.shape=p,o.description===d?o.description=[s.description]:o.description=[o.description,s.description]):(o.shape=c,o.description=s.description),o.description=i.d.sanitizeTextOrArray(o.description,(0,i.g)())),1===o.description.length&&o.shape===p&&(o.shape=c),!o.type&&s.doc&&(i.l.info("Setting cluster for ",d,k(s)),o.type="group",o.dir=k(s),o.shape=s.type===a.b?"divider":"roundedWithTitle",o.classes=o.classes+" statediagram-cluster "+(n?"statediagram-cluster-alt":""));const r={labelStyle:"",shape:o.shape,labelText:o.description,classes:o.classes,style:"",id:d,dir:o.dir,domId:x(d,w),type:o.type,padding:15};if(s.note){const t={labelStyle:"",shape:"note",labelText:s.note.text,classes:"statediagram-note",style:"",id:d+"----note-"+w,domId:x(d,w,"note"),type:o.type,padding:15},a={labelStyle:"",shape:"noteGroup",labelText:s.note.text,classes:o.classes,style:"",id:d+b,domId:x(d,w,"parent"),type:"group",padding:0};w++;const i=d+b;e.setNode(i,a),e.setNode(t.id,t),e.setNode(d,r),e.setParent(d,i),e.setParent(t.id,i);let n=d,l=t.id;"left of"===s.note.position&&(n=t.id,l=d),e.setEdge(n,l,{arrowhead:"none",arrowType:"",style:h,labelStyle:"",classes:"transition note-edge",arrowheadStyle:u,labelpos:"c",labelType:y,thickness:f})}else e.setNode(d,r)}t&&"root"!==t.id&&(i.l.trace("Setting node ",d," to be child of its parent ",t.id),e.setParent(d,t.id)),s.doc&&(i.l.trace("Adding nodes children "),S(e,s,s.doc,o,r,!n))},S=(e,t,s,o,r,n)=>{i.l.trace("items",s),s.forEach((s=>{switch(s.stmt){case a.c:case a.a:T(e,t,s,o,r,n);break;case a.S:{T(e,t,s.state1,o,r,n),T(e,t,s.state2,o,r,n);const a={id:"edge"+w,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:h,labelStyle:"",label:i.d.sanitizeText(s.description,(0,i.g)()),arrowheadStyle:u,labelpos:"c",labelType:y,thickness:f,classes:"transition"};e.setEdge(s.state1.id,s.state2.id,a,w),w++}}}))},k=(e,t=a.e)=>{let s=t;if(e.doc)for(let t=0;t{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,a.d.clear()}}}}]);